blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 3
616
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 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
sequencelengths 1
1
| author_id
stringlengths 1
132
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7407c2e2b17c0229bc90b732819e8d9409972b16 | 8b6cd902deb20812fba07f1bd51a4460d22adc03 | /.history/back-end/djreact/articles/api/urls_20191212170930.py | 3e7b419002f664981ec5529074a7a5d3fed5aac1 | [] | no_license | vishaldenzil/Django-react- | f3a49d141e0b6882685b7eaa4dc43c84857f335a | 35b6d41f6dacb3bddcf7858aa4dc0d2fe039ff98 | refs/heads/master | 2022-11-08T09:27:02.938053 | 2020-05-29T04:53:52 | 2020-05-29T04:53:52 | 267,768,028 | 0 | 1 | null | 2022-10-15T14:08:30 | 2020-05-29T04:52:20 | Python | UTF-8 | Python | false | false | 250 | py | from django.urls import path
from .views import ArticleDetailView,ArticleListView,ArticleCreateView
urlpatterns = [
path('',ArticleListView.as_view()),\
path('<pk>',ArticleCreateView.as_view())
path('<pk>',ArticleDetailView.as_view()),
] | [
"[email protected]"
] | |
9d21e326eec729c6206b1528818da7493cf0a122 | 01fbe5abd060ecedda70c7ae5db928e2bc3371e2 | /scripts/git-sync | 12ace2c00429c60c12eba6750aa8f66539612904 | [] | no_license | arecker/bastard | a3911c7c0abc53c4f254bb1c492fa0fccfad0283 | 2e3ab598022dba127503e4f55b43cb0e755c3cd2 | refs/heads/master | 2022-03-14T23:19:13.883117 | 2019-12-02T22:02:51 | 2019-12-02T22:02:51 | 198,136,763 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,831 | #!/usr/bin/env python
import argparse
import datetime
import logging
import os
import sys
def get_logger(verbose=False):
if verbose:
level = logging.DEBUG
else:
level = logging.INFO
logger = logging.getLogger('git-sync')
logger.setLevel(level)
handler = logging.StreamHandler(sys.stdout)
handler.setLevel(level)
formatter = logging.Formatter('%(name)s - %(levelname)s - %(message)s')
handler.setFormatter(formatter)
logger.addHandler(handler)
return logger
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument('-v', '--verbose', action='store_true', help='print debug logs')
parser.add_argument('-d', '--dir', '--directory', help='path to git repo')
return parser.parse_args()
class ShellCommandFailed(Exception):
pass
def shell(cmd, suppress=False):
code = os.system(cmd)
if not suppress and code != 0:
raise ShellCommandFailed
return code
def main():
args = get_args()
logger = get_logger(verbose=args.verbose)
logger.debug('starting git-sync')
logger.debug('validating git is installed')
try:
shell('which git')
except ShellCommandFailed:
logger.error('git is not installed!')
sys.exit(1)
path = os.path.abspath(args.dir)
logger.debug('moving to %s', path)
os.chdir(path)
logger.info('checking for changes')
if shell('git diff --exit-code', suppress=True) == 0:
logger.info('no changes')
logger.info('rebasing')
try:
shell('git fetch --all --prune >/dev/null')
shell('git rebase origin/master >/dev/null')
except ShellCommandFailed:
logger.error('failed to rebase!')
sys.exit(1)
sys.exit(0)
logger.info('adding modifications')
try:
shell('git add -A > /dev/null')
except ShellCommandFailed:
logger.error('failed to add modifications!')
sys.exit(1)
logger.info('writing commit')
message = 'git-sync: {}'.format(datetime.datetime.now())
logger.debug('generated commit message: %s', message)
try:
shell('git commit -m "{}" > /dev/null'.format(message))
except ShellCommandFailed:
logger.error('failed write commit modifications!')
sys.exit(1)
try:
logger.info('pushing commit')
shell('git push > /dev/null')
except ShellCommandFailed:
logger.info('failed to push, trying rebase')
try:
shell('git fetch --all --prune > /dev/null')
shell('git rebase origin/master > /dev/null')
shell('git push > /dev/null')
except ShellCommandFailed:
logger.error('failed to rebase + push!')
sys.exit(1)
logger.info('finished!')
if __name__ == '__main__':
main()
| [
"[email protected]"
] | ||
abddd850b8a545171a5c6c097c1615a2f5a038b0 | 62e58c051128baef9452e7e0eb0b5a83367add26 | /x12/6040/107006040.py | a26c23e1f479d456f90f6ff07e4618f40f826786 | [] | no_license | dougvanhorn/bots-grammars | 2eb6c0a6b5231c14a6faf194b932aa614809076c | 09db18d9d9bd9d92cefbf00f1c0de1c590fe3d0d | refs/heads/master | 2021-05-16T12:55:58.022904 | 2019-05-17T15:22:23 | 2019-05-17T15:22:23 | 105,274,633 | 0 | 0 | null | 2017-09-29T13:21:21 | 2017-09-29T13:21:21 | null | UTF-8 | Python | false | false | 2,065 | py | from bots.botsconfig import *
from records006040 import recorddefs
syntax = {
'version': '00604',
'functionalgroup': 'MC',
}
structure = [
{ID: 'ST', MIN: 1, MAX: 1, LEVEL: [
{ID: 'BGN', MIN: 1, MAX: 1},
{ID: 'G62', MIN: 0, MAX: 10},
{ID: 'AT5', MIN: 0, MAX: 99},
{ID: 'PR', MIN: 0, MAX: 99},
{ID: 'ID4', MIN: 0, MAX: 1},
{ID: 'IV1', MIN: 0, MAX: 1},
{ID: 'MI1', MIN: 0, MAX: 1},
{ID: 'CUR', MIN: 0, MAX: 1},
{ID: 'MCT', MIN: 0, MAX: 999},
{ID: 'MS2', MIN: 0, MAX: 1, LEVEL: [
{ID: 'AT9', MIN: 0, MAX: 1},
]},
{ID: 'N1', MIN: 1, MAX: 10, LEVEL: [
{ID: 'N2', MIN: 0, MAX: 1},
{ID: 'N3', MIN: 0, MAX: 2},
{ID: 'N4', MIN: 0, MAX: 1},
{ID: 'PER', MIN: 0, MAX: 5},
]},
{ID: 'LX', MIN: 1, MAX: 99999, LEVEL: [
{ID: 'GY', MIN: 1, MAX: 999},
{ID: 'CUR', MIN: 0, MAX: 1},
{ID: 'PR', MIN: 0, MAX: 99},
{ID: 'ID4', MIN: 0, MAX: 1},
{ID: 'AT5', MIN: 0, MAX: 99},
{ID: 'MS2', MIN: 0, MAX: 1, LEVEL: [
{ID: 'AT9', MIN: 0, MAX: 1},
]},
{ID: 'N1', MIN: 0, MAX: 1, LEVEL: [
{ID: 'N2', MIN: 0, MAX: 1},
{ID: 'N3', MIN: 0, MAX: 2},
{ID: 'N4', MIN: 0, MAX: 1},
{ID: 'G62', MIN: 0, MAX: 10},
]},
{ID: 'CA1', MIN: 1, MAX: 99999, LEVEL: [
{ID: 'GY', MIN: 1, MAX: 999},
{ID: 'PR', MIN: 0, MAX: 99},
{ID: 'ID4', MIN: 0, MAX: 1},
{ID: 'IV1', MIN: 0, MAX: 1},
{ID: 'SV', MIN: 0, MAX: 1},
{ID: 'AT5', MIN: 0, MAX: 99},
{ID: 'MCT', MIN: 0, MAX: 999},
{ID: 'MS2', MIN: 0, MAX: 1, LEVEL: [
{ID: 'AT9', MIN: 0, MAX: 1},
]},
{ID: 'N1', MIN: 0, MAX: 1, LEVEL: [
{ID: 'N2', MIN: 0, MAX: 1},
{ID: 'N3', MIN: 0, MAX: 2},
{ID: 'N4', MIN: 0, MAX: 1},
{ID: 'G62', MIN: 0, MAX: 10},
]},
]},
]},
{ID: 'SE', MIN: 1, MAX: 1},
]}
]
| [
"[email protected]"
] | |
e2b7411a8ee36f2d8980496e3c37c414729356fb | 74091dce735f281188d38d2f00d1a68e1d38ff7a | /network_programs/bridge_demo/bridge.py | 9763824c4e75dcdb9d39fd950ea0f3be209e0614 | [] | no_license | nbiadrytski-zz/python-training | 96741aa0ef37bda32d049fde5938191025fe2924 | 559a64aae2db51e11812cea5ff602f25953e8070 | refs/heads/master | 2023-05-07T04:08:23.898161 | 2019-12-10T12:12:59 | 2019-12-10T12:12:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 137 | py | import serial
sr = serial.Serial('/dev/tty.usbserial-14200', 115200)
sr.write(b'hello\n')
sr.s
print(sr.readline().decode('utf-8')) | [
"[email protected]"
] | |
0a07372dde34fc99c3a5e21470fc0c5ab2b738c3 | 43c96941aae099dd0d01120fd22abaccd6e55b21 | /tests/test_instantiate.py | e3bd9a88fdd63583d743b475da8789f3560c831d | [
"BSD-3-Clause"
] | permissive | agoose77/widget-ts-cookiecutter | 6ddba56c724d9dba6f0d667f23cdab84ed5f9faf | bd6825f02bfd5dc34965024d68dc3f69700863c4 | refs/heads/master | 2023-03-15T23:41:39.624795 | 2020-03-25T12:13:51 | 2020-03-25T12:13:51 | 258,137,524 | 0 | 0 | BSD-3-Clause | 2020-04-23T08:14:11 | 2020-04-23T08:14:10 | null | UTF-8 | Python | false | false | 1,267 | py |
import os
import sys
import pytest
HERE = os.path.abspath(os.path.dirname(__file__))
PROJECT_ROOT = os.path.dirname(HERE)
pytest_plugins = "pytester"
use_shell = os.name == 'nt'
@pytest.fixture(scope='session')
def example_instance(tmpdir_factory):
from cookiecutter.main import cookiecutter
import pip
tmpdir = tmpdir_factory.mktemp('example_instance')
with tmpdir.as_cwd():
cookiecutter(PROJECT_ROOT, no_input=True, config_file=os.path.join(HERE, 'testconfig.yaml'))
instance_path = tmpdir.join('jupyter-widget-testwidgets')
with instance_path.as_cwd():
print(str(instance_path))
try:
pip.main(['install', '-v', '-e', '.[test]'])
yield instance_path
finally:
try:
pip.main(['uninstall', 'ipywidgettestwidgets', '-y'])
except Exception:
pass
def test_python_tests(example_instance, testdir):
with example_instance.as_cwd():
testdir.runpytest()
def test_js_tests(example_instance):
from subprocess import check_call
cmd = ['npm', 'test']
with example_instance.as_cwd():
check_call(cmd, stdout=sys.stdout, stderr=sys.stderr, shell=use_shell)
| [
"[email protected]"
] | |
d5fb0b3044f373ee8bab7e7212d39f211b1dfb15 | f63c4eb29ce57319441f5469d1d049b63bc220de | /swu_cycle_variance/run375.py | 6d1f034926f57b0b4994ea4d60d658683618678e | [] | no_license | a-co/diversion_models | 0237642153668b16035699e9e734ff0538568582 | 69eed2687b1cd2b48f5717d15919eccd24a0eabc | refs/heads/main | 2023-05-02T19:04:26.333677 | 2020-06-18T20:50:18 | 2020-06-18T20:50:18 | 216,904,337 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,241 | py | SIMULATION = {'simulation': {'agent': [{'name': 'deployer_civilian', 'prototype': 'civilian_deployer'}, {'name': 'deployer_shared', 'prototype': 'shared_deployer'}], 'archetypes': {'spec': [{'lib': 'cycamore', 'name': 'DeployInst'}, {'lib': 'cycamore', 'name': 'Source'}, {'lib': 'cycamore', 'name': 'Sink'}, {'lib': 'cycamore', 'name': 'Storage'}, {'lib': 'cycamore', 'name': 'Reactor'}, {'lib': 'cycamore', 'name': 'Separations'}, {'lib': 'cycamore', 'name': 'Enrichment'}]}, 'control': {'duration': '144', 'explicit_inventory': 'true', 'startmonth': '1', 'startyear': '2020'}, 'prototype': [{'config': {'Source': {'inventory_size': '1e30', 'outcommod': 'u_ore', 'outrecipe': 'r_u_ore', 'throughput': '1e10'}}, 'name': 'mine'}, {'config': {'Separations': {'feed_commod_prefs': {'val': ['1.0', '10.0', '100.0']}, 'feed_commods': {'val': ['u_ore', 'u_ore1', 'u_ore2']}, 'feedbuf_size': '2e8', 'leftover_commod': 'waste', 'streams': {'item': {'commod': 'u_nat', 'info': {'buf_size': '150000', 'efficiencies': {'item': [{'comp': 'U', 'eff': '.99'}, {'comp': 'O', 'eff': '.99'}]}}}}, 'throughput': '2e8'}}, 'name': 'milling'}, {'config': {'Separations': {'feed_commod_prefs': {'val': '1.0'}, 'feed_commods': {'val': 'u_nat'}, 'feedbuf_size': '200000', 'leftover_commod': 'waste', 'streams': {'item': {'commod': 'uf6', 'info': {'buf_size': '200000', 'efficiencies': {'item': {'comp': 'U', 'eff': '.99'}}}}}, 'throughput': '200000'}}, 'name': 'conversion'}, {'config': {'Enrichment': {'feed_commod_prefs': {'val': ['1', '20']}, 'feed_commods': {'val': ['uf6', 'mil_uf6']}, 'feed_recipe': 'r_natl_u', 'max_feed_inventory': '100000', 'product_commod': 'civ_leu', 'swu_capacity': '173638.3521720509', 'tails_assay': '0.003', 'tails_commod': 'u_dep'}}, 'name': 'civ_enrichment'}, {'config': {'Storage': {'in_commods': {'val': 'u_dep'}, 'out_commods': {'val': 'u_dep_str'}, 'residence_time': '0'}}, 'name': 'civ_str_u_dep'}, {'config': {'Storage': {'in_commod_prefs': {'val': '1000'}, 'in_commods': {'val': 'civ_leu'}, 'in_recipe': 'r_uox', 'max_inv_size': '30000', 'out_commods': {'val': 'uox'}, 'residence_time': '1'}}, 'name': 'civ_fabrication'}, {'config': {'Reactor': {'assem_size': '29565', 'cycle_time': '-7', 'fuel_incommods': {'val': 'uox'}, 'fuel_inrecipes': {'val': 'r_uox'}, 'fuel_outcommods': {'val': 'uox_spent'}, 'fuel_outrecipes': {'val': 'r_uox_spent'}, 'n_assem_batch': '1', 'n_assem_core': '3', 'power_cap': '900', 'refuel_time': '0'}}, 'lifetime': '960', 'name': 'civ_lwr'}, {'config': {'Storage': {'in_commods': {'val': 'uox_spent'}, 'out_commods': {'val': 'uox_spent_str'}, 'residence_time': '60'}}, 'name': 'civ_str_uox_spent'}, {'config': {'DeployInst': {'build_times': {'val': ['121', '121', '121', '145', '157', '169']}, 'n_build': {'val': ['1', '1', '1', '1', '1', '1']}, 'prototypes': {'val': ['civ_enrichment', 'civ_str_u_dep', 'civ_fabrication', 'civ_lwr', 'civ_str_uox_spent', 'civ_lwr']}}}, 'name': 'civilian_deployer'}, {'config': {'DeployInst': {'build_times': {'val': ['1', '1', '1']}, 'n_build': {'val': ['1', '1', '1']}, 'prototypes': {'val': ['mine', 'milling', 'conversion']}}}, 'name': 'shared_deployer'}], 'recipe': [{'basis': 'mass', 'name': 'r_u_ore', 'nuclide': [{'comp': '0.0071', 'id': '922350000'}, {'comp': '0.9929', 'id': '922380000'}, {'comp': '999', 'id': '120240000'}]}, {'basis': 'mass', 'name': 'r_natl_u', 'nuclide': [{'comp': '0.0071', 'id': '922350000'}, {'comp': '0.9929', 'id': '922380000'}]}, {'basis': 'mass', 'name': 'r_uox', 'nuclide': [{'comp': '0.05', 'id': '922350000'}, {'comp': '0.95', 'id': '922380000'}]}, {'basis': 'mass', 'name': 'r_uox_spent', 'nuclide': [{'comp': '0.01', 'id': '922350000'}, {'comp': '0.94', 'id': '922380000'}, {'comp': '0.01', 'id': '942390000'}, {'comp': '0.001', 'id': '952410000'}, {'comp': '0.03', 'id': '551350000'}]}, {'basis': 'mass', 'name': 'r_mil_uox', 'nuclide': [{'comp': '0.0071', 'id': '922350000'}, {'comp': '0.9929', 'id': '922380000'}]}, {'basis': 'mass', 'name': 'r_mil_uox_spent', 'nuclide': [{'comp': '0.0071', 'id': '922350000'}, {'comp': '0.9919', 'id': '922380000'}, {'comp': '0.001', 'id': '942390000'}]}, {'basis': 'mass', 'name': 'r_mil_heu', 'nuclide': [{'comp': '0.90', 'id': '922350000'}, {'comp': '0.10', 'id': '922380000'}]}]}} | [
"[email protected]"
] | |
8ab219fea28eb0c510914d55eb4b35a9627a217a | 6234f8d6f22d73ae2759d1388e8de5e5761c16e6 | /meshio/dolfin_io.py | 686ee4d45bd9ae0e4a2720c40b9124d1501913b2 | [
"MIT"
] | permissive | renanozelo/meshio | 44f457cae3a86976629ee8606795b79a7fde649d | 073b99b0315c326bee17527498494aa7941bbe9e | refs/heads/master | 2021-01-13T14:54:31.092974 | 2016-12-06T19:36:06 | 2016-12-06T19:36:06 | 76,459,995 | 1 | 0 | null | 2016-12-14T13:01:04 | 2016-12-14T13:01:04 | null | UTF-8 | Python | false | false | 4,338 | py | # -*- coding: utf-8 -*-
#
'''
I/O for DOLFIN's XML format, cf.
<https://people.sc.fsu.edu/~jburkardt/data/dolfin_xml/dolfin_xml.html>.
.. moduleauthor:: Nico Schlömer <[email protected]>
'''
import numpy
import warnings
def read(filename):
from lxml import etree as ET
tree = ET.parse(filename)
root = tree.getroot()
mesh = root.getchildren()[0]
assert mesh.tag == 'mesh'
dolfin_to_meshio_type = {
'triangle': ('triangle', 3),
'tetrahedron': ('tetra', 4),
}
cell_type, npc = dolfin_to_meshio_type[mesh.attrib['celltype']]
is_2d = mesh.attrib['dim'] == '2'
if not is_2d:
assert mesh.attrib['dim'] == '3'
points = None
cells = {
cell_type: None
}
for child in mesh.getchildren():
if child.tag == 'vertices':
num_verts = int(child.attrib['size'])
points = numpy.empty((num_verts, 3))
for vert in child.getchildren():
assert vert.tag == 'vertex'
idx = int(vert.attrib['index'])
points[idx, 0] = vert.attrib['x']
points[idx, 1] = vert.attrib['y']
if is_2d:
points[idx, 2] = 0.0
else:
points[idx, 2] = vert.attrib['z']
elif child.tag == 'cells':
num_cells = int(child.attrib['size'])
cells[cell_type] = numpy.empty((num_cells, npc), dtype=int)
for cell in child.getchildren():
assert(dolfin_to_meshio_type[cell.tag][0] == cell_type)
idx = int(cell.attrib['index'])
for k in range(npc):
cells[cell_type][idx, k] = cell.attrib['v%s' % k]
else:
raise RuntimeError('Unknown entry \'%s\'.' % child.tag)
point_data = {}
cell_data = {}
field_data = {}
return points, cells, point_data, cell_data, field_data
def write(
filename,
points,
cells,
point_data=None,
cell_data=None,
field_data=None
):
from lxml import etree as ET
if point_data is None:
point_data = {}
if cell_data is None:
cell_data = {}
if field_data is None:
field_data = {}
dolfin = ET.Element(
'dolfin',
nsmap={'dolfin': 'http://fenicsproject.org/'}
)
meshio_to_dolfin_type = {
'triangle': 'triangle',
'tetra': 'tetrahedron',
}
if 'tetra' in cells:
stripped_cells = {'tetra': cells['tetra']}
cell_type = 'tetra'
elif 'triangle' in cells:
stripped_cells = {'triangle': cells['triangle']}
cell_type = 'triangle'
else:
raise RuntimeError(
'Dolfin XML can only deal with triangle or tetra. '
'The input data contains only ' + ', '.join(cells.keys()) + '.'
)
if len(cells) > 1:
discarded_cells = cells.keys()
discarded_cells.remove(cell_type)
warnings.warn(
'DOLFIN XML can only handle one cell type at a time. '
'Using ' + cell_type +
', discarding ' + ', '.join(discarded_cells) +
'.'
)
if all(points[:, 2] == 0):
dim = '2'
else:
dim = '3'
mesh = ET.SubElement(
dolfin,
'mesh',
celltype=meshio_to_dolfin_type[cell_type],
dim=dim
)
vertices = ET.SubElement(mesh, 'vertices', size=str(len(points)))
for k, point in enumerate(points):
ET.SubElement(
vertices,
'vertex',
index=str(k),
x=str(point[0]), y=str(point[1]), z=str(point[2])
)
num_cells = 0
for cls in stripped_cells.values():
num_cells += len(cls)
xcells = ET.SubElement(mesh, 'cells', size=str(num_cells))
idx = 0
for cell_type, cls in stripped_cells.iteritems():
for cell in cls:
cell_entry = ET.SubElement(
xcells,
meshio_to_dolfin_type[cell_type],
index=str(idx)
)
for k, c in enumerate(cell):
cell_entry.attrib['v%d' % k] = str(c)
idx += 1
tree = ET.ElementTree(dolfin)
tree.write(filename, pretty_print=True)
return
| [
"[email protected]"
] | |
7fc2467f0250ee8322bbda3d68f914db118efa47 | ca7aa979e7059467e158830b76673f5b77a0f5a3 | /Python_codes/p02725/s138858472.py | cea9d71bc4a6904057ab3ad27c3bc17dd530ad24 | [] | 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 | 442 | py | # 改善1:sys入力
# 改善2:ifで分岐させるより、あとから個別対応した方が分岐を毎回やらないですむ?
import sys
input=sys.stdin.readline
def main():
k,n = map(int, input().split())
s = list(map(int, input().split()))
l = []
for i in range(1,n):
a = s[i] - s[i-1]
l.append(a)
l.append(k - (s[-1] - s[0]))
print(k - max(l))
if __name__ == '__main__':
main()
| [
"[email protected]"
] | |
95be8ddec2560fac150592bcd46209a003361b3a | 788f1d32045560ffafff468476c9c9897dabb31c | /Curso em Vídeo/Mundo 3 Estruturas Compostas/Aulas/file020.py | cfe7d4178f46631dfc5a24cec6d9e537d8ec2e08 | [
"MIT"
] | permissive | henriqueumeda/-Python-study | 7f8d911e9e724aa2f183e652e6a7ae31b742b90e | 28e93a377afa4732037a29eb74d4bc7c9e24b62f | refs/heads/main | 2023-08-10T21:10:32.360808 | 2021-09-21T02:37:16 | 2021-09-21T02:37:16 | 330,294,636 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 62 | py | pessoa = ('Gustavo', 39, 'M', 99.88)
del(pessoa)
print(pessoa) | [
"[email protected]"
] | |
5bc3f4f8bb4647a25f30f51ce63937096d4246a1 | 784936ad8234b5c3c20311ce499551ee02a08879 | /lab9/file/parse_file.py | cc36e2a591a78376ec7e3cffe6d4e0078c023d42 | [] | no_license | jonlin97/CPE101 | 100ba6e5030364d4045f37e317aa05fd6a06cb08 | 985d64497a9861f59ab7473322b9089bfa57fd10 | refs/heads/master | 2021-06-16T01:31:31.025153 | 2017-02-28T19:29:11 | 2017-02-28T19:29:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,077 | py | from sys import argv
def main():
if len(argv) == 1 or len(argv) > 3:
print 'Usage: [-s] file_name'
exit()
elif len(argv) == 3 and '-s' not in argv:
print 'Usage: [-s] file_name'
exit()
else:
if len(argv) == 2:
file_name = argv[1]
else:
argv.pop(argv.index('-s'))
file_name = argv[1]
argv.append('-s')
try:
inFile = open(file_name, 'r')
except IOError as e:
print e
exit()
total = 0
ints = floats = other = 0
for line in inFile:
the_line = line.split()
for elem in the_line:
try:
temp = int(elem)
ints += 1
total += temp
except:
try:
temp = float(elem)
floats += 1
total += temp
except:
other += 1
inFile.close()
print 'Ints: %d' % ints
print 'Floats: %d' % floats
print 'Other: %d' % other
if len(argv) == 3:
print 'Sum: %.2f' % total
if __name__ == '__main__':
main()
| [
"[email protected]"
] | |
d0d77d4bd9e7aadf754112ca3de60249267d85d5 | 11211916f39b9d98027b64d778e52743d0c519a1 | /L3/tmp/musicphotos/download/code/system/doc/design/admin/main.py | c5ea17877d1524a989a95723012b8d7d353e5101 | [] | no_license | mantasruigys3000/Group-Task | 87baf1bc2747323c0508f6f32ef733c3f4b50978 | 6790d74ae7fa0fe6b13733efcd75a9f4aca70ab0 | refs/heads/master | 2020-04-23T20:54:09.696659 | 2019-02-22T01:29:53 | 2019-02-22T01:29:53 | 171,454,102 | 0 | 0 | null | 2019-02-19T10:31:09 | 2019-02-19T10:31:08 | null | UTF-8 | Python | false | false | 80 | py | Quaerat etincidunt adipisci sit ipsum aliquam.
Username: Bert
Password: maggie1
| [
"[email protected]"
] | |
cc187ad5d061659b1d141e6ae8c0c903749475b1 | 45de7d905486934629730945619f49281ad19359 | /xlsxwriter/test/comparison/test_textbox11.py | ca80f1243f3d1dbb199c896488058878d7a21f2d | [
"BSD-2-Clause"
] | permissive | jmcnamara/XlsxWriter | 599e1d225d698120ef931a776a9d93a6f60186ed | ab13807a1be68652ffc512ae6f5791d113b94ee1 | refs/heads/main | 2023-09-04T04:21:04.559742 | 2023-08-31T19:30:52 | 2023-08-31T19:30:52 | 7,433,211 | 3,251 | 712 | BSD-2-Clause | 2023-08-28T18:52:14 | 2013-01-04T01:07:06 | Python | UTF-8 | Python | false | false | 857 | py | ###############################################################################
#
# Tests for XlsxWriter.
#
# SPDX-License-Identifier: BSD-2-Clause
# Copyright (c), 2013-2023, John McNamara, [email protected]
#
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""
Test file created by XlsxWriter against a file created by Excel.
"""
def setUp(self):
self.set_filename("textbox11.xlsx")
def test_create_file(self):
"""Test the creation of a simple XlsxWriter file with textbox(s)."""
workbook = Workbook(self.got_filename)
worksheet = workbook.add_worksheet()
worksheet.insert_textbox("E9", "This is some text", {"fill": {"color": "red"}})
workbook.close()
self.assertExcelEqual()
| [
"[email protected]"
] | |
9411320ce5f493de2d42d37e564a2e9624a820f8 | 97884252481ff208519194ecd63dc3a79c250220 | /pyobs/events/newspectrum.py | bb03c0263c82eddeafae717430787cfbb9842aa4 | [
"MIT"
] | permissive | pyobs/pyobs-core | a1f30137d7f991bad4e115de38f543e59a6e30d2 | 2d7a06e5485b61b6ca7e51d99b08651ea6021086 | refs/heads/master | 2023-09-01T20:49:07.610730 | 2023-08-29T09:20:05 | 2023-08-29T09:20:05 | 174,351,157 | 9 | 3 | NOASSERTION | 2023-09-14T20:39:48 | 2019-03-07T13:41:27 | Python | UTF-8 | Python | false | false | 1,003 | py | from __future__ import annotations
from typing import Dict, Any
from typing_extensions import TypedDict
from pyobs.events.event import Event
DataType = TypedDict("DataType", {"filename": str})
class NewSpectrumEvent(Event):
"""Event to be sent on a new image."""
__module__ = "pyobs.events"
def __init__(self, filename: str, **kwargs: Any):
"""Initializes new NewSpectrumEvent.
Args:
filename: Name of new image file.
"""
Event.__init__(self)
self.data: DataType = {"filename": filename}
@classmethod
def from_dict(cls, d: Dict[str, Any]) -> Event:
# get filename
if "filename" not in d or not isinstance(d["filename"], str):
raise ValueError("Invalid type for filename.")
filename: str = d["filename"]
# return object
return NewSpectrumEvent(filename)
@property
def filename(self) -> str:
return self.data["filename"]
__all__ = ["NewSpectrumEvent"]
| [
"[email protected]"
] | |
854ae9710abde0ac2c9a66fa74291936c78a3839 | 503e97b5c0bb77e923fe135ff14a8b5ca5e6ba07 | /mxshop/mxshop/settings.py | 14c8a2c9bfd1e2ae8fcb833563b71aac4cf284a3 | [] | no_license | pshyms/dianshang-1 | 72345de3ce769efeb2b17c975b586590524dcdbe | 788b7950f52cb7979a8b73e5d9193243f2e69cad | refs/heads/master | 2021-05-21T10:11:38.248170 | 2020-04-03T06:25:13 | 2020-04-03T06:25:13 | 252,649,823 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,483 | py | """
Django settings for mxshop project.
Generated by 'django-admin startproject' using Django 2.2.1.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
import sys
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, BASE_DIR)
sys.path.insert(0, os.path.join(BASE_DIR, 'apps'))
sys.path.insert(0, os.path.join(BASE_DIR, 'extra_apps'))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'u(txeme@dat=dxizn0@rrm7k85(#ce+9m3up7u!v6!djs#6i3y'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
AUTH_USER_MODEL = "users.UserProfile"
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'users',
'goods',
'trade',
'user_operation',
'DjangoUeditor',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'mxshop.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'mxshop.wsgi.application'
# Database
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'vue_shop',
'USER': 'root',
'PASSWORD': '123456',
'HOST': '127.0.0.1',
"OPTIONS": {"init_command": "SET default_storage_engine=INNODB;"}
}
}
# Password validation
# https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/2.2/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.2/howto/static-files/
STATIC_URL = '/static/'
| [
"[email protected]"
] | |
f3dd845a32db99083ff44cd824500f31f1ae9c52 | 4d4d05bb396e19e32e1ecbba1e2bd20c52d5d22e | /backend/mobile_testing_12_d_14208/wsgi.py | 2897d07e06cc71965e9451a659567a8368ba3255 | [] | no_license | crowdbotics-apps/mobile-testing-12-d-14208 | c78e93a4b214901383bf803d12dbf70573536b87 | 9dacf9161fbd7912f57a07e47c017b1ac4b52f5b | refs/heads/master | 2023-01-02T20:56:47.081621 | 2020-10-29T15:34:50 | 2020-10-29T15:34:50 | 308,371,847 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 427 | py | """
WSGI config for mobile_testing_12_d_14208 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mobile_testing_12_d_14208.settings')
application = get_wsgi_application()
| [
"[email protected]"
] | |
af19b5a06d215882024497e34544be63114c99d3 | 4d64248b2d7fed5fc61afb93717f6da9d77bb78e | /test/integration/test_main.py | d29c6c5b74ebd22411d73ba02378a9073d052370 | [
"Apache-2.0"
] | permissive | aniltimilsina/ansible-runner | eab0e40b2e2f1f9db202d9bc532abe92b5439f6e | dd6dbdf137e91adaabff3a1bb602615e174c0f73 | refs/heads/master | 2020-03-31T01:37:39.924968 | 2018-09-28T14:22:50 | 2018-09-28T14:22:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 7,312 | py | from __future__ import print_function
from ansible_runner.__main__ import main
import os
import multiprocessing
import shutil
import yaml
import tempfile
import time
from contextlib import contextmanager
from pytest import raises
from ansible_runner.exceptions import AnsibleRunnerException
HERE = os.path.abspath(os.path.dirname(__file__))
def ensure_directory(directory):
if not os.path.exists(directory):
os.makedirs(directory)
def ensure_removed(file_path):
if os.path.exists(file_path):
os.unlink(file_path)
@contextmanager
def temp_directory(files=None):
temp_dir = tempfile.mkdtemp()
try:
yield temp_dir
shutil.rmtree(temp_dir)
except BaseException:
print(temp_dir)
if files is not None:
for file in files:
if os.path.exists(file):
with open(file) as f:
print(f.read())
raise
def test_temp_directory():
context = dict()
def will_fail():
with temp_directory() as temp_dir:
context['saved_temp_dir'] = temp_dir
assert False
def will_pass():
with temp_directory() as temp_dir:
context['saved_temp_dir'] = temp_dir
assert True
with raises(AssertionError):
will_fail()
assert os.path.exists(context['saved_temp_dir'])
shutil.rmtree(context['saved_temp_dir'])
will_pass()
assert not os.path.exists(context['saved_temp_dir'])
def test_help():
with raises(SystemExit) as exc:
main([])
assert exc.value.code == 2, 'Should raise SystemExit with return code 2'
def test_module_run():
main(['-m', 'ping',
'--hosts', 'localhost',
'run',
'ping'])
def test_module_run_clean():
with temp_directory() as temp_dir:
main(['-m', 'ping',
'--hosts', 'localhost',
'run',
temp_dir])
def test_role_run():
with temp_directory() as temp_dir:
main(['-r', 'benthomasson.hello_role',
'--hosts', 'localhost',
'--roles-path', 'test/integration/roles',
'run',
temp_dir])
def test_role_logfile():
with temp_directory() as temp_dir:
main(['-r', 'benthomasson.hello_role',
'--hosts', 'localhost',
'--roles-path', 'test/integration/roles',
'--logfile', 'new_logfile',
'run',
temp_dir])
def test_role_bad_project_dir():
with open("bad_project_dir", 'w') as f:
f.write('not a directory')
try:
with raises(OSError):
main(['-r', 'benthomasson.hello_role',
'--hosts', 'localhost',
'--roles-path', 'test/integration/roles',
'--logfile', 'new_logfile',
'run',
'bad_project_dir'])
finally:
os.unlink('bad_project_dir')
def test_role_run_clean():
with temp_directory() as temp_dir:
main(['-r', 'benthomasson.hello_role',
'--hosts', 'localhost',
'--roles-path', 'test/integration/roles',
'run',
temp_dir])
def test_role_run_cmd_line():
with temp_directory() as temp_dir:
main(['-r', 'benthomasson.hello_role',
'--hosts', 'localhost',
'--roles-path', 'test/integration/roles',
'--cmdline', 'msg=hi',
'run',
temp_dir])
def test_role_run_artifacts_dir():
with temp_directory() as temp_dir:
main(['-r', 'benthomasson.hello_role',
'--hosts', 'localhost',
'--roles-path', 'test/integration/roles',
'--artifact-dir', 'otherartifacts',
'run',
temp_dir])
def test_role_run_env_vars():
with temp_directory() as temp_dir:
ensure_directory(os.path.join(temp_dir, 'env'))
with open(os.path.join(temp_dir, 'env/envvars'), 'w') as f:
f.write(yaml.dump(dict(msg='hi')))
main(['-r', 'benthomasson.hello_role',
'--hosts', 'localhost',
'--roles-path', 'test/integration/roles',
'run',
temp_dir])
def test_role_run_args():
with temp_directory() as temp_dir:
main(['-r', 'benthomasson.hello_role',
'--hosts', 'localhost',
'--roles-path', 'test/integration/roles',
'--role-vars', 'msg=hi',
'run',
temp_dir])
def test_role_run_inventory():
with temp_directory() as temp_dir:
ensure_directory(os.path.join(temp_dir, 'inventory'))
shutil.copy(os.path.join(HERE, 'inventories/localhost'), os.path.join(temp_dir, 'inventory/localhost'))
main(['-r', 'benthomasson.hello_role',
'--hosts', 'localhost',
'--roles-path', 'test/integration/roles',
'--inventory', 'localhost',
'run',
temp_dir])
def test_role_run_inventory_missing():
with temp_directory() as temp_dir:
ensure_directory(os.path.join(temp_dir, 'inventory'))
shutil.copy(os.path.join(HERE, 'inventories/localhost'), os.path.join(temp_dir, 'inventory/localhost'))
with raises(AnsibleRunnerException):
main(['-r', 'benthomasson.hello_role',
'--hosts', 'localhost',
'--roles-path', 'test/integration/roles',
'--inventory', 'does_not_exist',
'run',
temp_dir])
def test_role_start():
with temp_directory() as temp_dir:
p = multiprocessing.Process(target=main,
args=[['-r', 'benthomasson.hello_role',
'--hosts', 'localhost',
'--roles-path', 'test/integration/roles',
'start',
temp_dir]])
p.start()
p.join()
def test_playbook_start():
with temp_directory() as temp_dir:
project_dir = os.path.join(temp_dir, 'project')
ensure_directory(project_dir)
shutil.copy(os.path.join(HERE, 'playbooks/hello.yml'), project_dir)
ensure_directory(os.path.join(temp_dir, 'inventory'))
shutil.copy(os.path.join(HERE, 'inventories/localhost'), os.path.join(temp_dir, 'inventory/localhost'))
p = multiprocessing.Process(target=main,
args=[['-p', 'hello.yml',
'--inventory', os.path.join(HERE, 'inventories/localhost'),
'--hosts', 'localhost',
'start',
temp_dir]])
p.start()
time.sleep(5)
assert os.path.exists(os.path.join(temp_dir, 'pid'))
rc = main(['is-alive', temp_dir])
assert rc == 0
rc = main(['stop', temp_dir])
assert rc == 0
time.sleep(1)
rc = main(['is-alive', temp_dir])
assert rc == 1
ensure_removed(os.path.join(temp_dir, 'pid'))
rc = main(['stop', temp_dir])
assert rc == 1
| [
"[email protected]"
] | |
61bce7c35d257868765417a85473fa98fae8ce2f | 75a35cefa5adf2f42503eb0cc8c60f7f96ff9650 | /economico/migrations/0003_auto_20210624_1236.py | 49bc13dc659775704cd8f50eb92f82ef53321af2 | [] | no_license | PatacaSis/agroweb | 5c70f35001d0e88fb5f1642161d4eee6b4abda59 | e2181fa0bb6ca7752bdbaab62fe60ede9f2630b2 | refs/heads/main | 2023-06-20T23:37:50.294745 | 2021-07-19T23:26:55 | 2021-07-19T23:26:55 | 381,737,279 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,984 | py | # Generated by Django 2.2 on 2021-06-24 15:36
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('economico', '0002_auto_20210624_1117'),
]
operations = [
migrations.CreateModel(
name='Subrubro',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('nombre', models.CharField(max_length=100, verbose_name='Rubro')),
],
options={
'verbose_name': 'Subrubro',
'verbose_name_plural': 'Sububros',
'ordering': ['nombre'],
},
),
migrations.AlterModelOptions(
name='rubro',
options={'ordering': ['nombre'], 'verbose_name': 'Rubro', 'verbose_name_plural': 'Rubros'},
),
migrations.CreateModel(
name='Gasto',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('fecha', models.DateField()),
('comprobante', models.CharField(max_length=10)),
('concepto', models.CharField(max_length=150)),
('cantidad', models.IntegerField()),
('unidades', models.CharField(max_length=10)),
('importe', models.IntegerField()),
('iva', models.IntegerField()),
('rubro', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='rubros', to='economico.Rubro')),
('subrubro', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='subrubros', to='economico.Subrubro')),
],
options={
'verbose_name': 'Gasto',
'verbose_name_plural': 'Gastos',
'ordering': ['fecha'],
},
),
]
| [
"[email protected]"
] | |
b70bb144c8be07a7f7244b2cacdb4a2f8bf5fd20 | 2b468b1d22ecc5668529255676a1d43936829074 | /codes/personal_backend/tuoen/agile/apis/shop/channel/__init__.py | 972111c6caa39d94c4dbc5d5ab175e75eadc7a70 | [] | no_license | MaseraTiGo/4U | 5ac31b4cccc1093ab9a07d18218c3d8c0157dc9c | f572830aa996cfe619fc4dd8279972a2f567c94c | refs/heads/master | 2023-07-26T09:44:21.014294 | 2023-07-13T03:43:34 | 2023-07-13T03:43:34 | 149,217,706 | 0 | 0 | null | 2020-06-05T20:38:16 | 2018-09-18T02:34:29 | Python | UTF-8 | Python | false | false | 9,674 | py | # coding=UTF-8
# 环境的
# 第三方
# 公用的
from tuoen.sys.core.exception.business_error import BusinessError
from tuoen.sys.core.field.base import CharField, DictField, IntField, ListField, BooleanField, DatetimeField
from tuoen.sys.core.api.request import RequestField, RequestFieldSet
from tuoen.sys.core.api.utils import with_metaclass
from tuoen.sys.core.api.response import ResponseField, ResponseFieldSet
# 逻辑的 service | middleware - > apis
from tuoen.agile.apis.base import NoAuthrizedApi, StaffAuthorizedApi
from tuoen.abs.service.shop.manager import ChannelServer, ShopServer
class Add(StaffAuthorizedApi):
"""添加店铺渠道"""
request = with_metaclass(RequestFieldSet)
request.channel_info = RequestField(DictField, desc = "渠道详情", conf = {
'name': CharField(desc = "渠道名称", is_required = False),
'freight': IntField(desc = "运费/分", is_required = False),
'single_repair_money': IntField(desc = "单次补单金额/分", is_required = False),
'single_point_money': IntField(desc = "单次扣点金额/分", is_required = False),
'remark': CharField(desc = "备注", is_required = False),
})
response = with_metaclass(ResponseFieldSet)
@classmethod
def get_desc(cls):
return "店铺渠道添加接口"
@classmethod
def get_author(cls):
return "fsy"
def execute(self, request):
ChannelServer.is_name_exist(request.channel_info['name'])
ChannelServer.generate(**request.channel_info)
def fill(self, response):
return response
class Search(StaffAuthorizedApi):
"""店铺渠道列表"""
request = with_metaclass(RequestFieldSet)
request.current_page = RequestField(IntField, desc = "当前查询页码")
request.search_info = RequestField(DictField, desc = '搜索条件', conf = {
'name': CharField(desc = "店铺渠道名称", is_required = False)
})
response = with_metaclass(ResponseFieldSet)
response.data_list = ResponseField(ListField, desc = '店铺渠道列表', fmt = DictField(desc = "店铺渠道列表", conf = {
'id': IntField(desc = "店铺渠道id"),
'name': CharField(desc = "店铺渠道名称"),
'shop_num': IntField(desc = "店铺数目"),
'freight': IntField(desc = "运费/分"),
'single_repair_money': IntField(desc = "单次补单金额/分"),
'single_point_money': IntField(desc = "单次扣点金额/分"),
'remark': CharField(desc = "备注"),
'update_time': DatetimeField(desc = "更新时间"),
'create_time': DatetimeField(desc = "创建时间"),
}))
response.total = ResponseField(IntField, desc = "数据总数")
response.total_page = ResponseField(IntField, desc = "总页码数")
@classmethod
def get_desc(cls):
return "店铺渠道列表接口"
@classmethod
def get_author(cls):
return "fsy"
def execute(self, request):
channel_page = ChannelServer.search(request.current_page, **request.search_info)
# 挂载店铺数量
ShopServer.hung_shopnum_bychannel(channel_page.data)
return channel_page
def fill(self, response, channel_page):
response.data_list = [{
'id': channel.id,
'name': channel.name,
'shop_num': channel.shop_num,
'freight': channel.freight,
'single_repair_money': channel.single_repair_money,
'single_point_money': channel.single_point_money,
'remark': channel.remark,
'update_time': channel.update_time,
'create_time': channel.create_time,
} for channel in channel_page.data]
response.total = channel_page.total
response.total_page = channel_page.total_page
return response
class SearchAll(StaffAuthorizedApi):
"""店铺渠道列表"""
request = with_metaclass(RequestFieldSet)
request.search_info = RequestField(DictField, desc = '搜索条件', conf = {
})
response = with_metaclass(ResponseFieldSet)
response.data_list = ResponseField(ListField, desc = '店铺渠道列表', fmt = DictField(desc = "店铺渠道列表", conf = {
'id': IntField(desc = "店铺渠道id"),
'name': CharField(desc = "店铺渠道名称"),
'freight': IntField(desc = "运费/分"),
'single_repair_money': IntField(desc = "单次补单金额/分"),
'single_point_money': IntField(desc = "单次扣点金额/分"),
}))
@classmethod
def get_desc(cls):
return "搜索全部店铺渠道列表接口"
@classmethod
def get_author(cls):
return "fsy"
def execute(self, request):
channel_list = ChannelServer.search_all(**request.search_info)
return channel_list
def fill(self, response, channel_list):
response.data_list = [{
'id': channel.id,
'name': channel.name,
'freight': channel.freight,
'single_repair_money': channel.single_repair_money,
'single_point_money': channel.single_point_money,
} for channel in channel_list]
return response
class Get(StaffAuthorizedApi):
"""获取店铺渠道详情"""
request = with_metaclass(RequestFieldSet)
request.channel_id = RequestField(IntField, desc = '店铺渠道id')
response = with_metaclass(ResponseFieldSet)
response.channel_info = ResponseField(DictField, desc = "店铺渠道详情", conf = {
'id': IntField(desc = "店铺渠道id"),
'name': CharField(desc = "店铺渠道名称"),
'freight': IntField(desc = "运费/分"),
'single_repair_money': IntField(desc = "单次补单金额/分"),
'single_point_money': IntField(desc = "单次扣点金额/分"),
'remark': CharField(desc = "备注"),
'update_time': DatetimeField(desc = "更新时间"),
'create_time': DatetimeField(desc = "创建时间"),
})
@classmethod
def get_desc(cls):
return "店铺渠道详情接口"
@classmethod
def get_author(cls):
return "fsy"
def execute(self, request):
channel = ChannelServer.get(request.channel_id)
return channel
def fill(self, response, channel):
response.channel_info = {
'id': channel.id,
'name': channel.name,
'single_repair_money': channel.single_repair_money,
'single_point_money': channel.single_point_money,
'remark': channel.remark,
'update_time': channel.update_time,
'create_time': channel.create_time,
}
return response
class Update(StaffAuthorizedApi):
"""修改店铺渠道信息"""
request = with_metaclass(RequestFieldSet)
request.channel_id = RequestField(IntField, desc = '店铺渠道id')
request.channel_info = RequestField(DictField, desc = "店铺渠道详情", conf = {
'name': CharField(desc = "店铺渠道名称", is_required = False),
'freight': IntField(desc = "运费/分", is_required = False),
'single_repair_money': CharField(desc = "单次补单金额/分", is_required = False),
'single_point_money': CharField(desc = "单次扣点金额/分", is_required = False),
'remark': CharField(desc = "备注", is_required = False),
})
response = with_metaclass(ResponseFieldSet)
@classmethod
def get_desc(cls):
return "修改店铺渠道接口"
@classmethod
def get_author(cls):
return "fsy"
def execute(self, request):
channel = ChannelServer.get(request.channel_id)
ChannelServer.is_name_exist(request.channel_info['name'], channel)
ChannelServer.update(channel, **request.channel_info)
def fill(self, response):
return response
class Remove(StaffAuthorizedApi):
"""删除店铺渠道"""
request = with_metaclass(RequestFieldSet)
request.channel_id = RequestField(IntField, desc = "店铺渠道id")
response = with_metaclass(ResponseFieldSet)
@classmethod
def get_desc(cls):
return "店铺渠道删除接口"
@classmethod
def get_author(cls):
return "fsy"
def execute(self, request):
ChannelServer.remove(request.channel_id)
def fill(self, response):
return response
class Match(StaffAuthorizedApi):
request = with_metaclass(RequestFieldSet)
request.keyword = RequestField(CharField, desc = "匹配信息(店铺渠道名称)")
request.size = RequestField(IntField, desc = "返回数量")
response = with_metaclass(ResponseFieldSet)
response.match_list = ResponseField(ListField, desc = '店铺渠道列表', fmt = DictField(desc = "店铺渠道列表", conf = {
'id': IntField(desc = "店铺渠道id"),
'name': CharField(desc = "店铺渠道名称"),
'single_repair_money': IntField(desc = "单次补单金额/分"),
'single_point_money': IntField(desc = "单次扣点金额/分"),
}))
@classmethod
def get_desc(cls):
return "通过店铺渠道名称匹配渠道基础信息"
@classmethod
def get_author(cls):
return "Fsy"
def execute(self, request):
channel_list = ChannelServer.match(request.keyword, request.size)
return channel_list
def fill(self, response, channel_list):
response.match_list = [{
'id': channel.id,
'name': channel.name,
'single_repair_money': channel.name,
'single_point_money': channel.name,
} for channel in channel_list]
return response
| [
"[email protected]"
] | |
4a39feec52733f26c0e7cbb9c3736c8c737ab13c | 5f357d6f03b61a9c3d4f65d64c407df8d314d57a | /scripts/pdns/lib/python2.7/sre_constants.py | 95dabd6e7dddaa095692cac6fc8dc92500955f12 | [] | no_license | mrlesmithjr/ansible-vsphere-management | a1c721a724f3a8cf00a312fff839f1610749ad2b | 5ea2bfdbba110aaca41278242ba94f4cc0a0cb99 | refs/heads/master | 2023-06-08T04:39:54.739166 | 2023-05-29T14:26:24 | 2023-05-29T14:26:24 | 103,217,448 | 86 | 39 | null | 2018-02-23T17:45:06 | 2017-09-12T03:28:16 | Python | UTF-8 | Python | false | false | 105 | py | /usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_constants.py | [
"[email protected]"
] | |
0fa8189b6205033ea38a4baca5d931a95dd69480 | 6203b9132af8f78c6cb12242bd223fa17d14f31e | /leetcode/hot100/739.py | 4a83290d96acb97e8294d1fcc0c49ad525e00df8 | [] | no_license | joshuap233/algorithms | 82c608d7493b0d21989b287a2e246ef739e60443 | dc68b883362f3ddcfb433d3d83d1bbf925bbcf02 | refs/heads/master | 2023-08-23T12:44:42.675137 | 2021-09-28T02:37:01 | 2021-09-28T02:37:01 | 230,285,450 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 689 | py | # https://leetcode-cn.com/problems/daily-temperatures/
# 739. 每日温度
from typing import List
from collections import deque
class Solution:
"""
从左向右遍历
维护一个单调栈,如果当前元素 <= 栈顶元素, 当前元素入栈
否则栈顶元素出栈,直到当前元素为最小元素
"""
def dailyTemperatures(self, temperatures: List[int]) -> List[int]:
stack = deque()
res = [0] * len(temperatures)
for i, t in enumerate(temperatures):
while stack and temperatures[stack[-1]] < t:
e = stack.pop()
res[e] = i - e
stack.append(i)
return res
| [
"[email protected]"
] | |
d219b210b9aea9a439ac50e2a4a42aed1ea38432 | 37dd9a4970ef0c69868809cd1f09bb9bf137187a | /tests/cupy_tests/core_tests/test_ndarray_scatter.py | 26b568f3b49a1944ebbef7aa07ef03a659b8a08c | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | minus9d/chainer | 3d7549135a85926a528e7167e37947735dd096d7 | f34c20e45dc86dfa6bbc62e080be3fd97aa3f466 | refs/heads/master | 2021-01-11T22:17:47.567101 | 2017-01-13T03:49:34 | 2017-01-13T03:49:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,537 | py | import unittest
import numpy
import cupy
from cupy import testing
@testing.parameterize(
# array only
{'shape': (2, 3, 4), 'slices': numpy.array(-1), 'value': 1},
{'shape': (2, 3, 4), 'slices': numpy.array([1, 0]), 'value': 1},
{'shape': (2, 3, 4), 'slices': (slice(None), [1, 2]), 'value': 1},
{'shape': (3, 4, 5),
'slices': (slice(None), [[1, 2], [0, -1]],), 'value': 1},
{'shape': (3, 4, 5),
'slices': (slice(None), slice(None), [[1, 2], [0, 3]]), 'value': 1},
# slice and array
{'shape': (3, 4, 5),
'slices': (slice(None), slice(1, 2), [[1, 3], [0, 2]]), 'value': 1},
# None and array
{'shape': (3, 4, 5),
'slices': (None, [1, -1]), 'value': 1},
{'shape': (3, 4, 5),
'slices': (None, [1, -1], None), 'value': 1},
{'shape': (3, 4, 5),
'slices': (None, None, None, [1, -1]), 'value': 1},
# None, slice and array
{'shape': (3, 4, 5),
'slices': (slice(0, 1), None, [1, -1]), 'value': 1},
{'shape': (3, 4, 5),
'slices': (slice(0, 1), slice(1, 2), [1, -1]), 'value': 1},
{'shape': (3, 4, 5),
'slices': (slice(0, 1), None, slice(1, 2), [1, -1]), 'value': 1},
# broadcasting
{'shape': (3, 4, 5), 'slices': (slice(None), [[1, 2], [0, -1]],),
'value': numpy.arange(3 * 2 * 2 * 5).reshape(3, 2, 2, 5)},
)
@testing.gpu
class TestScatterAddNoDuplicate(unittest.TestCase):
@testing.for_dtypes([numpy.float32, numpy.int32])
@testing.numpy_cupy_array_equal()
def test_scatter_add(self, xp, dtype):
a = xp.zeros(self.shape, dtype)
if xp is cupy:
a.scatter_add(self.slices, self.value)
else:
a[self.slices] = a[self.slices] + self.value
return a
@testing.parameterize(
{'shape': (2, 3), 'slices': ([1, 1], slice(None)), 'value': 1,
'expected': numpy.array([[0, 0, 0], [2, 2, 2]])},
{'shape': (2, 3), 'slices': ([1, 0, 1], slice(None)), 'value': 1,
'expected': numpy.array([[1, 1, 1], [2, 2, 2]])},
{'shape': (2, 3), 'slices': (slice(1, 2), [1, 0, 1]), 'value': 1,
'expected': numpy.array([[0, 0, 0], [1, 2, 0]])},
)
@testing.gpu
class TestScatterAddDuplicateVectorValue(unittest.TestCase):
@testing.for_dtypes([numpy.float32, numpy.int32])
def test_scatter_add(self, dtype):
a = cupy.zeros(self.shape, dtype)
a.scatter_add(self.slices, self.value)
numpy.testing.assert_almost_equal(a.get(), self.expected)
@testing.gpu
class TestScatterAdd(unittest.TestCase):
@testing.for_dtypes([numpy.float32, numpy.int32])
def test_scatter_add_cupy_arguments(self, dtype):
shape = (2, 3)
a = cupy.zeros(shape, dtype)
slices = (cupy.array([1, 1]), slice(None))
a.scatter_add(slices, cupy.array(1.))
testing.assert_array_equal(
a, cupy.array([[0., 0., 0.], [2., 2., 2.]], dtype))
@testing.for_dtypes(
[numpy.float32, numpy.int32, numpy.uint32, numpy.uint64,
numpy.ulonglong], name='src_dtype')
@testing.for_dtypes(
[numpy.float32, numpy.int32, numpy.uint32, numpy.uint64,
numpy.ulonglong], name='dst_dtype')
def test_scatter_add_differnt_dtypes(self, src_dtype, dst_dtype):
shape = (2, 3)
a = cupy.zeros(shape, dtype=src_dtype)
value = cupy.array(1, dtype=dst_dtype)
slices = ([1, 1], slice(None))
a.scatter_add(slices, value)
numpy.testing.assert_almost_equal(
a.get(),
numpy.array([[0, 0, 0], [2, 2, 2]], dtype=src_dtype))
| [
"[email protected]"
] | |
79f035817224a222421136ec0202b67a832a3d4d | 4e30d990963870478ed248567e432795f519e1cc | /tests/models/validators/v3_1_patch_1/jsd_bea2910401185295a9715d65cb1c07c9.py | 4c20015d51ab24952aff9a591ff4fba674cede0d | [
"MIT"
] | permissive | CiscoISE/ciscoisesdk | 84074a57bf1042a735e3fc6eb7876555150d2b51 | f468c54998ec1ad85435ea28988922f0573bfee8 | refs/heads/main | 2023-09-04T23:56:32.232035 | 2023-08-25T17:31:49 | 2023-08-25T17:31:49 | 365,359,531 | 48 | 9 | MIT | 2023-08-25T17:31:51 | 2021-05-07T21:43:52 | Python | UTF-8 | Python | false | false | 8,098 | py | # -*- coding: utf-8 -*-
"""Identity Services Engine updateNetworkAccessConditionByName data model.
Copyright (c) 2021 Cisco and/or its affiliates.
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 __future__ import absolute_import, division, print_function, unicode_literals
import json
from builtins import *
import fastjsonschema
from ciscoisesdk.exceptions import MalformedRequest
class JSONSchemaValidatorBea2910401185295A9715D65Cb1C07C9(object):
"""updateNetworkAccessConditionByName request schema definition."""
def __init__(self):
super(JSONSchemaValidatorBea2910401185295A9715D65Cb1C07C9, self).__init__()
self._validator = fastjsonschema.compile(json.loads(
'''{
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"response": {
"properties": {
"attributeName": {
"type": "string"
},
"attributeValue": {
"type": "string"
},
"children": {
"items": {
"properties": {
"conditionType": {
"enum": [
"ConditionAndBlock",
"ConditionAttributes",
"ConditionOrBlock",
"ConditionReference",
"LibraryConditionAndBlock",
"LibraryConditionAttributes",
"LibraryConditionOrBlock",
"TimeAndDateCondition"
],
"type": "string"
},
"isNegate": {
"type": "boolean"
},
"link": {
"properties": {
"href": {
"type": "string"
},
"rel": {
"enum": [
"next",
"previous",
"self",
"status"
],
"type": "string"
},
"type": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
},
"type": "array"
},
"conditionType": {
"enum": [
"ConditionAndBlock",
"ConditionAttributes",
"ConditionOrBlock",
"ConditionReference",
"LibraryConditionAndBlock",
"LibraryConditionAttributes",
"LibraryConditionOrBlock",
"TimeAndDateCondition"
],
"type": "string"
},
"datesRange": {
"properties": {
"endDate": {
"type": "string"
},
"startDate": {
"type": "string"
}
},
"type": "object"
},
"datesRangeException": {
"properties": {
"endDate": {
"type": "string"
},
"startDate": {
"type": "string"
}
},
"type": "object"
},
"description":
{
"type": "string"
},
"dictionaryName": {
"type": "string"
},
"dictionaryValue": {
"type": "string"
},
"hoursRange": {
"properties": {
"endTime": {
"type": "string"
},
"startTime": {
"type": "string"
}
},
"type": "object"
},
"hoursRangeException": {
"properties": {
"endTime": {
"type": "string"
},
"startTime": {
"type": "string"
}
},
"type": "object"
},
"id": {
"type": "string"
},
"isNegate": {
"type": "boolean"
},
"link": {
"properties": {
"href": {
"type": "string"
},
"rel": {
"enum": [
"next",
"previous",
"self",
"status"
],
"type": "string"
},
"type": {
"type": "string"
}
},
"type": "object"
},
"name": {
"type": "string"
},
"operator": {
"enum": [
"contains",
"endsWith",
"equals",
"greaterOrEquals",
"greaterThan",
"in",
"ipEquals",
"ipGreaterThan",
"ipLessThan",
"ipNotEquals",
"lessOrEquals",
"lessThan",
"matches",
"notContains",
"notEndsWith",
"notEquals",
"notIn",
"notStartsWith",
"startsWith"
],
"type": "string"
},
"weekDays": {
"items": {
"enum": [
"Friday",
"Monday",
"Saturday",
"Sunday",
"Thursday",
"Tuesday",
"Wednesday"
],
"type": "string"
},
"type": "array"
},
"weekDaysException": {
"items": {
"enum": [
"Friday",
"Monday",
"Saturday",
"Sunday",
"Thursday",
"Tuesday",
"Wednesday"
],
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"version": {
"type": "string"
}
},
"required": [
"response",
"version"
],
"type": "object"
}'''.replace("\n" + ' ' * 16, '')
))
def validate(self, request):
try:
self._validator(request)
except fastjsonschema.exceptions.JsonSchemaException as e:
raise MalformedRequest(
'{} is invalid. Reason: {}'.format(request, e.message)
)
| [
"[email protected]"
] | |
45a1448d0fb517a8f6109c50acd0d444b35696a9 | 09301c71638abf45230192e62503f79a52e0bd80 | /besco_erp/besco_account/general_account_asset/wizard/wizard_asset_compute.py | 2159e39e0228453a5ac13d57989d9b0e66b11412 | [] | no_license | westlyou/NEDCOFFEE | 24ef8c46f74a129059622f126401366497ba72a6 | 4079ab7312428c0eb12015e543605eac0bd3976f | refs/heads/master | 2020-05-27T06:01:15.188827 | 2017-11-14T15:35:22 | 2017-11-14T15:35:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,916 | py | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import osv, fields
from tools.translate import _
DATETIME_FORMAT = "%Y-%m-%d"
DATE_FORMAT = "%Y-%m-%d"
import time
from datetime import datetime
class asset_depreciation_confirmation_wizard(osv.osv_memory):
_inherit = "asset.depreciation.confirmation.wizard"
_columns = {
'date': fields.date('Date',required=True),
'period_id': fields.many2one('account.period', 'Period', required=True, domain=[('state','=','draft')], help="Choose the period for which you want to automatically post the depreciation lines of running assets")
}
def default_get(self, cr, uid, fields, context=None):
res = {}
period_obj = self.pool.get('account.period')
depreciation_obj = self.pool.get('account.asset.depreciation.line')
if 'active_ids' in context and context['active_ids']:
depreciation_ids = depreciation_obj.browse(cr,uid,context['active_ids'][0])
if depreciation_ids:
res.update({'date':depreciation_ids.depreciation_date})
return res
def onchange_date(self,cr,uid,ids,date,period_id):
value ={}
warning ={}
period_id_after = False
period_ids = self.pool.get('account.period').search(cr,uid,[('date_start','<=',date),('date_stop','>=',date),('state','=','draft')])
if period_ids:
period_id_after = self.pool.get('account.period').browse(cr,uid,period_ids[0])
if period_id_after:
value.update({'period_id':period_id_after.id})
else:
value.update({'date':False})
warning = {
'title': _('Period Warning!'),
'message' : _('You must open Period')
}
return {'value': value, 'warning': warning}
def asset_compute(self, cr, uid, ids, context):
ass_obj = self.pool.get('account.asset.asset')
period_obj = self.pool.get('account.period')
asset_ids = ass_obj.search(cr, uid, [('state','=','open')], context=context)
data = self.browse(cr, uid, ids, context=context)
period_id = data[0].period_id.id
period = period_obj.browse(cr, uid, period_id, context=context)
date = data and data[0].date
if period:
if (date >= period.date_start and date <= period.date_stop)==False:
raise osv.except_osv(_('Error !'), _('You must choose date between start_date and end_date in period'))
# sql ='''
# select '%s' between '%s' and '%s' condition
# ''' %(date,period.date_start,period.date_stop)
# cr.execute(sql)
# res = cr.dictfetchone()
# if res['condition'] == False:
# raise osv.except_osv(_('Error !'), _('You must choose date between start_date and end_date in period'))
# date_now = time.strftime(DATE_FORMAT)
# date_now = datetime.strptime(date_now, DATE_FORMAT)
# month_now = int(date_now.strftime('%m'))
# year_now = int(date_now.strftime('%Y'))
#
# date_compare = datetime.strptime(date, DATE_FORMAT)
# month_compare = int(date_compare.strftime('%m'))
# year_compare = int(date_compare.strftime('%Y'))
#
# if (month_now >= month_compare and year_now >= year_compare)==False:
# raise osv.except_osv(_('Error !'), _('Period must smaller Current Date'))
# sql ='''
# select '%s' >= '%s' and '%s' >= '%s' condition
# ''' %(month_now,month_compare,year_now,year_compare)
# cr.execute(sql)
# res = cr.dictfetchone()
# if res['condition'] == False:
#
context.update({'date':date})
if 'asset_type' in context and context['asset_type'] == 'create_move':
active_ids = context.get('active_ids')
depreciation_obj = self.pool.get('account.asset.depreciation.line')
depreciation_ids = depreciation_obj.search(cr, uid, [('id', 'in', active_ids), ('depreciation_date', '<=', period.date_stop), ('depreciation_date', '>=', period.date_start), ('move_check', '=', False)], context=context)
created_move_ids = self.pool.get('account.asset.depreciation.line').create_move(cr,uid,depreciation_ids,context)
else:
created_move_ids = ass_obj._compute_entries(cr, uid, asset_ids, period_id, context=context)
return {
'name': _('Created Asset Moves'),
'view_type': 'form',
'view_mode': 'tree,form',
'res_model': 'account.move',
'view_id': False,
'domain': "[('id','in',["+','.join(map(str,created_move_ids))+"])]",
'type': 'ir.actions.act_window',
}
asset_depreciation_confirmation_wizard()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
| [
"[email protected]"
] | |
e8fe137014c1db7c346768859e5a1022752e8930 | 231ced7456347d52fdcd126cfc6427bef47843d3 | /spj/timc.py | 1b9cec7e3976f743b8bc8040989f2d874b006b54 | [] | no_license | overminder/SPJ-D.Lester-book-Reading | d6590590d39d0e41ba23b77aecd448ed9888203b | 8a80f4100cdb32c73acf0c14ffdee5f72a8b7288 | refs/heads/master | 2016-09-05T23:37:40.028269 | 2012-12-04T14:25:32 | 2012-12-04T14:25:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 7,401 | py | from spj.errors import InterpError
from spj.language import W_Root, W_EAp, W_EInt, W_EVar, W_ELet, ppr
from spj.timrun import (State, Take, Enter, Return, PushInt, PushLabel,
PushArg, PushCode, PushVInt, Move, Cond, Closure)
from spj.primitive import module
def compile(prog):
cc = ProgramCompiler()
cc.compile_program(prog)
ppr(cc)
initcode = [PushLabel('main'), Enter()]
initstack = [Closure('<init>', [], None)]
return State(initcode,
None,
initstack,
cc.globalenv,
cc.codefrags)
class ProgramCompiler(W_Root):
def __init__(self):
self.codefrags = module.codefrags[:]
self.globalenv = module.scs.copy()
def ppr(self, p):
p.writeln('<ProgCompiler>')
with p.block(2):
p.writeln('Supercombinators:')
p.write_dict(self.globalenv.items())
p.newline(2)
p.writeln('Anonymous codes:')
for i, code in enumerate(self.codefrags):
p.write('%d:' % i)
p.writeln(code)
p.writeln('')
def compile_program(self, prog):
for sc in prog:
cc = Compiler(self, sc.name, framesize=sc.arity)
cc.compile_sc(sc)
self.globalenv[sc.name] = cc.code
def add_code(self, code):
i = len(self.codefrags)
self.codefrags.append(code)
return i
class Compiler(object):
def __init__(self, progcc, name='?', initcode=None, framesize=0):
self.progcc = progcc
self.name = name
if initcode is None:
self.code = []
else:
self.code = initcode
self.framesize = framesize
def emit(self, instr):
self.code.append(instr)
def emit_move(self, addr_mode):
if isinstance(addr_mode, Arg):
self.emit(Move(addr_mode.ival))
elif isinstance(addr_mode, IndirectArg):
self.emit(Move(addr_mode.ival))
else:
assert 0
def emit_push(self, addr_mode):
if isinstance(addr_mode, Arg):
self.emit(PushArg(addr_mode.ival))
elif isinstance(addr_mode, IndirectArg):
co = [PushArg(addr_mode.ival), Enter()]
self.emit(PushCode(self.progcc.add_code(co)))
elif isinstance(addr_mode, Label):
self.emit(PushLabel(addr_mode.name))
else:
assert 0
def compile_sc(self, sc):
local_env = mk_func_env(sc.args)
self.compile_r(sc.body, local_env)
self.code = [Take(self.framesize, sc.arity)] + self.code
# Compile apply e to args (sort of like unwind)
def compile_r(self, expr, env):
# First try to compile as arith
if self.compile_b(expr, env, [Return()]):
return
if isinstance(expr, W_EAp):
self.compile_a(expr.a, env)
self.compile_r(expr.f, env)
elif isinstance(expr, W_EInt) or isinstance(expr, W_EVar):
self.compile_a(expr, env)
self.emit(Enter())
elif isinstance(expr, W_ELet):
new_env = env.copy()
if expr.isrec:
rec_env = new_env.copy()
for i, (name, e) in enumerate(expr.defns):
frameslot = self.framesize
self.framesize += 1
new_env[name] = Arg(frameslot)
rec_env[name] = IndirectArg(frameslot)
for i, (name, e) in enumerate(expr.defns):
self.compile_a(e, rec_env)
self.emit_move(new_env[name])
else:
for i, (name, e) in enumerate(expr.defns):
self.compile_a(e, env)
frameslot = self.framesize
self.framesize += 1
new_env[name] = Arg(frameslot)
self.emit_move(new_env[name])
self.compile_r(expr.expr, new_env)
else:
raise InterpError('compile_r(%s): not implemented' % expr.to_s())
# Compile atomic expression (addressing mode?)
def compile_a(self, expr, env):
if isinstance(expr, W_EInt):
self.emit(PushInt(expr.ival))
elif isinstance(expr, W_EVar):
if expr.name in env:
self.emit_push(env[expr.name])
else:
self.emit_push(Label(expr.name))
elif isinstance(expr, W_EAp):
# Create a shared closure
cc = Compiler(self.progcc, expr.to_s())
cc.compile_r(expr, env)
fragindex = self.progcc.add_code(cc.code)
self.emit(PushCode(fragindex))
else:
raise InterpError('compile_a(%s): not implemented' % expr.to_s())
# eval <expr> inline, push the result then jump to <cont>
# Return True if <expr> is successfully compiled inlined, False otherwise
def compile_b(self, expr, env, cont, use_fallback=False):
if isinstance(expr, W_EAp):
revargs = [] # [argn, ..., arg1]
iterexpr = expr
while isinstance(iterexpr, W_EAp):
revargs.append(iterexpr.a)
iterexpr = iterexpr.f
func = iterexpr
if (isinstance(func, W_EVar) and func.name in module.ops
and len(revargs) == module.ops[func.name].get_arity()):
cont = [module.ops[func.name]] + cont
# We can just inline the arith
for i in xrange(len(revargs) - 1, -1, -1):
arg = revargs[i]
cc = Compiler(self.progcc, '<cont for %s>' % func.name)
cc.compile_b(arg, env, cont, use_fallback=True)
cont = cc.code
for instr in cont:
self.emit(instr)
return True
elif (isinstance(func, W_EVar) and func.name == 'if' and
len(revargs) == 3):
condexpr = revargs[2]
trueexpr = revargs[1]
falseexpr = revargs[0]
cc1 = Compiler(self.progcc, '<cont for true>')
cc1.compile_r(trueexpr, env)
truecode = cc1.code
truefrag = self.progcc.add_code(truecode)
cc2 = Compiler(self.progcc, '<cont for false>')
cc2.compile_r(falseexpr, env)
falsecode = cc2.code
falsefrag = self.progcc.add_code(falsecode)
newcont = [Cond(truefrag, falsefrag)] + cont
self.compile_b(condexpr, env, newcont)
return True
elif isinstance(expr, W_EInt):
self.emit(PushVInt(expr.ival))
for instr in cont:
self.emit(instr)
return True
# Otherwise
if use_fallback:
i = self.progcc.add_code(cont)
self.emit(PushCode(i))
self.compile_r(expr, env)
return False
class AddressMode(object):
pass
class Arg(AddressMode):
def __init__(self, ival):
self.ival = ival
class IndirectArg(AddressMode):
def __init__(self, ival):
self.ival = ival
class Label(AddressMode):
def __init__(self, name):
self.name = name
def mk_func_env(args):
d = {}
for i, name in enumerate(args):
d[name] = Arg(i)
return d
| [
"[email protected]"
] | |
a26a366b10cc223f2342920a7884674cb453093c | be50b4dd0b5b8c3813b8c3158332b1154fe8fe62 | /Strings/Python/ConvertToPalindrome.py | 46439cae661b90bd3d651d5ecdbabb178e6a9e66 | [] | no_license | Zimmermann25/InterviewBit | a8d89e090068d9644e28085625963c8ce75d3dff | 6d2138e740bd5ba8eab992d9bf090977e077bfc5 | refs/heads/main | 2023-03-24T18:12:48.244950 | 2021-03-24T14:36:48 | 2021-03-24T14:36:48 | 350,835,917 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,093 | py | class Solution:
# @param A : string
# @return an integer
def solve(self, A):
'''while(i<j){
if(count>1) return 0;
if(A[i]==A[j]) i++,j--;
else if(A[i]!=A[j] && A[i+1]==A[j]) i++,count++;
else if(A[i]!=A[j] && A[i]==A[j-1]) j--,count++;
else return 0;
}
if(i==j && count>1) return 0;
return 1;'''
if len(A) < 1:return 0
# jak wchodzi parzysta dlugosc, usuwam 1 znak, bedzie nieparzysta
left = 0
right = len(A)-1
used = 0
while left < right:
if A[left] == A[right]:
right -=1
left +=1
elif A[left+1] == A[right]:
used +=1
left +=1
elif A[left] == A[right-1]:
right -=1
used +=1
else: # jeśli trzeba by bylo minimum 2 zmienić
return 0
if used > 1: return 0
return 1
| [
"[email protected]"
] | |
6b06a0acefe3c3545167fd5f57a55c8c71e71347 | fa60536fbc7c0d8a2a8f08f0a5b6351c77d08054 | /3]. Competitive Programming/03]. HackerRank/1]. Practice/08]. Problem Solving/Algorithms/02]. Implementation/Python/_63) Sequence Equation.py | b4f4bb8ecf6be9a2c2c62234e16e5f5721b99482 | [
"MIT"
] | permissive | poojitha2002/The-Complete-FAANG-Preparation | 15cad1f9fb0371d15acc0fb541a79593e0605c4c | 7910c846252d3f1a66f92af3b7d9fb9ad1f86999 | refs/heads/master | 2023-07-17T20:24:19.161348 | 2021-08-28T11:39:48 | 2021-08-28T11:39:48 | 400,784,346 | 5 | 2 | MIT | 2021-08-28T12:14:35 | 2021-08-28T12:14:34 | null | UTF-8 | Python | false | false | 191 | py |
# Contributed by Paraj Shah
# https://github.com/parajshah
n = int(input().strip())
p = list(map(int,input().strip().split(' ')))
for i in range(n):
print(p.index(p.index(i+1)+1)+1)
| [
"[email protected]"
] | |
89ce91e9cdd45bcea7cda1f6618b0a8911d4b680 | 15f321878face2af9317363c5f6de1e5ddd9b749 | /solutions_python/Problem_97/1400.py | 447598b617c56ae623656f731538c43f7a43f01b | [] | no_license | dr-dos-ok/Code_Jam_Webscraper | c06fd59870842664cd79c41eb460a09553e1c80a | 26a35bf114a3aa30fc4c677ef069d95f41665cc0 | refs/heads/master | 2020-04-06T08:17:40.938460 | 2018-10-14T10:12:47 | 2018-10-14T10:12:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 466 | py | import sys
_ = sys.stdin.readline()
for case, line in enumerate(sys.stdin.readlines()):
case += 1
a, b = map(int, line.split())
if a/10 == 0 and b/10 == 0:
print 'Case #%d: 0' % case
else:
r = {}
for i in xrange(a, b+1):
n = m = str(i)
for _ in n:
m = m[-1] + m[:-1]
if a <= i < int(m) <= b:
r[n+m] = 1
print 'Case #%d: %d' % (case, len(r))
| [
"[email protected]"
] | |
9c35522a35153ec47b7157766cefe7a0384683de | e5202e0f36c15b8898920a461a866168fa059947 | /clirad/co2_0.0004/band_6/atmpro_saw/cliradlw_de5d43e/param.py | 3674e302c2882b619563b3d9eeb6f45422df8f75 | [] | no_license | qAp/analysis_-_new_kdist_param | 653c9873751646f6fa9481544e98ed6065a16155 | 272dc3667030cdb18664108d0bd78fee03736144 | refs/heads/master | 2021-06-11T04:21:35.105924 | 2019-08-04T13:13:07 | 2019-08-04T13:13:07 | 136,108,828 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 535 | py | PARAM = {'atmpro': 'saw', 'band': [6], 'commitnumber': 'de5d43e', 'molecule': {'co2': 0.0004}, 'tsfc': 257}
PARAM_LBLNEW = {'molecule': 'co2', 'band': '4', 'commitnumber': 'a22ab94', 'vmin': 800, 'vmax': 980, 'dv': 0.001, 'nv': 1000, 'ref_pts': [(1, 250), (500, 250)], 'ng_refs': [1, 2], 'ng_adju': [0, 0], 'klin': 6.5e-24, 'option_wgt_k': 1, 'wgt': [(0.75,), (0.75, 0.95)], 'w_diffuse': [(1.75,), (1.66, 1.9)], 'option_wgt_flux': 1, 'atmpro': 'saw', 'tsfc': 257, 'conc': 0.0004, 'option_compute_btable': 0, 'option_compute_ktable': 0} | [
"[email protected]"
] | |
f836bad57be012645982c1938cbfcf9f3c52db1d | 5844d61fc4e9fe70a6936e9d0d6bb4bc4f84465c | /phy/traces/filter.py | ef951d1253112612182224882c05961906dd82a7 | [] | no_license | danieljdenman/phy | 4f57c910020e3839432cf56e5ed817bf7b997e8e | 9ba3a00d12b6b72856f1420ed977586d8a8f7d31 | refs/heads/master | 2021-01-22T15:35:47.522407 | 2015-06-25T15:40:41 | 2015-06-25T15:40:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,532 | py | # -*- coding: utf-8 -*-
"""Waveform filtering routines."""
#------------------------------------------------------------------------------
# Imports
#------------------------------------------------------------------------------
import numpy as np
from scipy import signal
from ..utils._types import _as_array
#------------------------------------------------------------------------------
# Waveform filtering routines
#------------------------------------------------------------------------------
def bandpass_filter(rate=None, low=None, high=None, order=None):
"""Butterworth bandpass filter."""
assert low < high
assert order >= 1
return signal.butter(order,
(low / (rate / 2.), high / (rate / 2.)),
'pass')
def apply_filter(x, filter=None):
"""Apply a filter to an array."""
x = _as_array(x)
if x.shape[0] == 0:
return x
b, a = filter
return signal.filtfilt(b, a, x, axis=0)
class Filter(object):
"""Bandpass filter."""
def __init__(self, rate=None, low=None, high=None, order=None):
self._filter = bandpass_filter(rate=rate,
low=low,
high=high,
order=order,
)
def __call__(self, data):
return apply_filter(data, filter=self._filter)
#------------------------------------------------------------------------------
# Whitening
#------------------------------------------------------------------------------
class Whitening(object):
"""Compute a whitening matrix and apply it to data.
Contributed by Pierre Yger.
"""
def fit(self, x, fudge=1e-18):
"""Compute the whitening matrix.
Parameters
----------
x : array
An `(n_samples, n_channels)` array.
"""
assert x.ndim == 2
ns, nc = x.shape
x_cov = np.cov(x, rowvar=0)
assert x_cov.shape == (nc, nc)
d, v = np.linalg.eigh(x_cov)
d = np.diag(1. / np.sqrt(d + fudge))
# This is equivalent, but seems much slower...
# w = np.einsum('il,lk,jk->ij', v, d, v)
w = np.dot(np.dot(v, d), v.T)
self._matrix = w
return w
def transform(self, x):
"""Whiten some data.
Parameters
----------
x : array
An `(n_samples, n_channels)` array.
"""
return np.dot(x, self._matrix)
| [
"[email protected]"
] | |
f91aec160267606ac564ac84e93d38b1da5028e3 | 0ba5622abc2125ac8a9907757680da4d7cb7b47e | /Knowrob/indigo/indigo-knowrob-dev/catkin_ws/devel/lib/python2.7/dist-packages/iai_robosherlock_msgs/msg/_SimplePerceiveObjectAction.py | 5d73e25e09154e4dd4d08e1bf6954f1e0c2942ca | [] | no_license | IoT-Lab-Minden/docker-ros | c2a327117bdf1d0b861d4580156e595a079ec5d5 | 5c57c15717cbcae515d82c3dc75470587bb2508e | refs/heads/master | 2021-01-18T03:33:22.128596 | 2017-05-17T13:48:05 | 2017-05-17T13:48:05 | 85,809,457 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 137 | py | /root/catkin_ws/devel/.private/iai_robosherlock_msgs/lib/python2.7/dist-packages/iai_robosherlock_msgs/msg/_SimplePerceiveObjectAction.py | [
"[email protected]"
] | |
6a2bab06289e994ca0c8efdf9279028438e85c5d | 9f48355699f7e12915241024b01985a76620c203 | /CustomStack/mystack.py | 0ab1c2f9594ce238ff9729bd2f2fdc0884d8d517 | [] | no_license | zingp/leetcode-py | 537bebaeb2ac223f5e10014f755ab961582ed0d3 | 53975bd952a1ceb34189682fda16bbee403fd84b | refs/heads/master | 2021-08-10T12:34:07.061017 | 2021-06-15T01:00:23 | 2021-06-15T01:00:23 | 155,186,882 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 474 | py |
class stack(object):
def __init__(self):
self.stack = []
def push(self, ele):
self.stack.append(ele)
def pop(self):
if len(self.stack) > 0:
return self.stack.pop()
else:
return None
def get_top(self):
if len(self.stack) > 0:
return self.stack[-1]
else:
return None
if __name__ == "__main__":
s = stack()
s.push(1)
s.push(2)
print(s.stack)
| [
"[email protected]"
] | |
7cb5946ebbe03db4a9a0ab885e014d84f61157cf | fa380310206f7e0c015be610dd9f74f7ba62e8f9 | /util.py | 68c9d046a986830428a7fe3115ba82a09e164dd5 | [
"MIT"
] | permissive | sharkbound/advent_of_code_2016 | 71c666ce6f7e7e816dbb6e76795650ecd9f1cb48 | e655974b2dea422af4ec1debad296ee6c22d690a | refs/heads/master | 2020-12-05T03:12:53.883458 | 2020-01-13T01:24:25 | 2020-01-13T01:24:25 | 231,993,705 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 67 | py | def make_dict(*args):
return dict(zip(args[0::2], args[1::2]))
| [
"[email protected]"
] | |
7b912e2285b65f0e82ad4d4d5cf759fb35624272 | 51f887286aa3bd2c3dbe4c616ad306ce08976441 | /pybind/slxos/v17r_2_00/routing_system/router/isis/router_isis_cmds_holder/address_family/ipv4/af_ipv4_unicast/af_ipv4_attributes/af_common_attributes/redistribute/isis/level_1/__init__.py | 1a220564369c61b327bc9301d3e66a11c96fa4d0 | [
"Apache-2.0"
] | permissive | b2220333/pybind | a8c06460fd66a97a78c243bf144488eb88d7732a | 44c467e71b2b425be63867aba6e6fa28b2cfe7fb | refs/heads/master | 2020-03-18T09:09:29.574226 | 2018-04-03T20:09:50 | 2018-04-03T20:09:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,914 | py |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from decimal import Decimal
from bitarray import bitarray
import __builtin__
import into
class level_1(PybindBase):
"""
This class was auto-generated by the PythonClass plugin for PYANG
from YANG module brocade-common-def - based on the path /routing-system/router/isis/router-isis-cmds-holder/address-family/ipv4/af-ipv4-unicast/af-ipv4-attributes/af-common-attributes/redistribute/isis/level-1. Each member element of
the container is represented as a class variable - with a specific
YANG type.
"""
__slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_rest_name', '_extmethods', '__into',)
_yang_name = 'level-1'
_rest_name = 'level-1'
_pybind_generated_by = 'container'
def __init__(self, *args, **kwargs):
path_helper_ = kwargs.pop("path_helper", None)
if path_helper_ is False:
self._path_helper = False
elif path_helper_ is not None and isinstance(path_helper_, xpathhelper.YANGPathHelper):
self._path_helper = path_helper_
elif hasattr(self, "_parent"):
path_helper_ = getattr(self._parent, "_path_helper", False)
self._path_helper = path_helper_
else:
self._path_helper = False
extmethods = kwargs.pop("extmethods", None)
if extmethods is False:
self._extmethods = False
elif extmethods is not None and isinstance(extmethods, dict):
self._extmethods = extmethods
elif hasattr(self, "_parent"):
extmethods = getattr(self._parent, "_extmethods", None)
self._extmethods = extmethods
else:
self._extmethods = False
self.__into = YANGDynClass(base=into.into, is_container='container', presence=False, yang_name="into", rest_name="into", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:brocade.com:mgmt:brocade-isis', defining_module='brocade-isis', yang_type='container', is_config=True)
load = kwargs.pop("load", None)
if args:
if len(args) > 1:
raise TypeError("cannot create a YANG container with >1 argument")
all_attr = True
for e in self._pyangbind_elements:
if not hasattr(args[0], e):
all_attr = False
break
if not all_attr:
raise ValueError("Supplied object did not have the correct attributes")
for e in self._pyangbind_elements:
nobj = getattr(args[0], e)
if nobj._changed() is False:
continue
setmethod = getattr(self, "_set_%s" % e)
if load is None:
setmethod(getattr(args[0], e))
else:
setmethod(getattr(args[0], e), load=load)
def _path(self):
if hasattr(self, "_parent"):
return self._parent._path()+[self._yang_name]
else:
return [u'routing-system', u'router', u'isis', u'router-isis-cmds-holder', u'address-family', u'ipv4', u'af-ipv4-unicast', u'af-ipv4-attributes', u'af-common-attributes', u'redistribute', u'isis', u'level-1']
def _rest_path(self):
if hasattr(self, "_parent"):
if self._rest_name:
return self._parent._rest_path()+[self._rest_name]
else:
return self._parent._rest_path()
else:
return [u'router', u'isis', u'address-family', u'ipv4', u'unicast', u'redistribute', u'isis', u'level-1']
def _get_into(self):
"""
Getter method for into, mapped from YANG variable /routing_system/router/isis/router_isis_cmds_holder/address_family/ipv4/af_ipv4_unicast/af_ipv4_attributes/af_common_attributes/redistribute/isis/level_1/into (container)
"""
return self.__into
def _set_into(self, v, load=False):
"""
Setter method for into, mapped from YANG variable /routing_system/router/isis/router_isis_cmds_holder/address_family/ipv4/af_ipv4_unicast/af_ipv4_attributes/af_common_attributes/redistribute/isis/level_1/into (container)
If this variable is read-only (config: false) in the
source YANG file, then _set_into is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_into() directly.
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=into.into, is_container='container', presence=False, yang_name="into", rest_name="into", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:brocade.com:mgmt:brocade-isis', defining_module='brocade-isis', yang_type='container', is_config=True)
except (TypeError, ValueError):
raise ValueError({
'error-string': """into must be of a type compatible with container""",
'defined-type': "container",
'generated-type': """YANGDynClass(base=into.into, is_container='container', presence=False, yang_name="into", rest_name="into", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:brocade.com:mgmt:brocade-isis', defining_module='brocade-isis', yang_type='container', is_config=True)""",
})
self.__into = t
if hasattr(self, '_set'):
self._set()
def _unset_into(self):
self.__into = YANGDynClass(base=into.into, is_container='container', presence=False, yang_name="into", rest_name="into", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:brocade.com:mgmt:brocade-isis', defining_module='brocade-isis', yang_type='container', is_config=True)
into = __builtin__.property(_get_into, _set_into)
_pyangbind_elements = {'into': into, }
| [
"[email protected]"
] | |
68ba6bf1e51fff464bbcb634b294cd93a537c5f4 | 9e3d6b9f3bbc1d139d3b5a69bbf025c081289ea1 | /manage.py | fbcefc8d2c7375dad31a142433bc03dfdf09fd04 | [] | no_license | abugasavio/msalama | aca5ef2257ff4e192b895c1bb4831d1d43ab7e65 | 2acc5807e8a7f87f387c34a6ae7612d454685292 | refs/heads/master | 2021-05-29T11:44:18.268131 | 2015-09-01T11:28:52 | 2015-09-01T11:28:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 252 | py | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "msalama.production")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| [
"[email protected]"
] | |
12aae2888e93f9adc894ae28e23152cd367211f1 | c9ddbdb5678ba6e1c5c7e64adf2802ca16df778c | /cases/pa3/benchmarks/sieve-868.py | 0df90c2432f34c2721944ae516c8dedfeab8a95b | [] | no_license | Virtlink/ccbench-chocopy | c3f7f6af6349aff6503196f727ef89f210a1eac8 | c7efae43bf32696ee2b2ee781bdfe4f7730dec3f | refs/heads/main | 2023-04-07T15:07:12.464038 | 2022-02-03T15:42:39 | 2022-02-03T15:42:39 | 451,969,776 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,589 | py | # A resizable list of integers
class Vector(object):
items: [int] = None
size: int = 0
def __init__(self:"Vector"):
self.items = [0]
# Returns current capacity
def capacity(self:"Vector") -> int:
return len(self.items)
# Increases capacity of vector by one element
def increase_capacity(self:"Vector") -> int:
self.items = self.items + [0]
return self.capacity()
# Appends one item to end of vector
def append(self:"Vector", item: int) -> object:
if self.size == self.capacity():
self.increase_capacity()
self.items[self.size] = item
self.size = self.size + 1
# Appends many items to end of vector
def append_all(self:"Vector", new_items: [int]) -> object:
item:int = 0
for item in new_items:
self.append(item)
# Removes an item from the middle of vector
def remove_at(self:"Vector", idx: int) -> object:
if idx < 0:
return
while idx < self.size - 1:
self.items[idx] = self.items[idx + 1]
idx = idx + 1
self.size = self.size - 1
# Retrieves an item at a given index
def get(self:"Vector", idx: int) -> int:
return self.items[idx]
# Retrieves the current size of the vector
def length(self:"Vector") -> int:
return self.size
# A faster (but more memory-consuming) implementation of vector
class DoublingVector(Vector):
doubling_limit:int = 1000
# Overriding to do fewer resizes
def increase_capacity(self:"DoublingVector") -> int:
if (self.capacity() <= self.doubling_limit // 2):
self.items = self.items + self.items
else:
# If doubling limit has been reached, fall back to
# standard capacity increases
self.items = self.items + [0]
return self.capacity()
# Makes a vector in the range [i, j)
def vrange(i:int, j:int) -> Vector:
v:Vector = None
v = DoublingVector()
while i < j:
v.append(i)
i = i + 1
return v
# Sieve of Eratosthenes (not really)
def sieve(v:Vector) -> object:
i:int = 0
j:int = 0
k:int = 0
while i < v.length():
k = v.get(i)
j = i + 1
while j < v.length():
if v.get(j) % k == 0:
v.remove_at(j)
else:
j = j + 1
i = i + 1
# Input parameter
n:int = 50
# Data
v:Vector = None
i:int = 0
# Crunch
v = vrange(2, n)
sieve(v)
# Print
while i < v.length():
print(v.get(i))
i = $ID + 1
| [
"[email protected]"
] | |
aa5e04f5a6941d9b5a4fe1cd4674a98c766f223a | f0d713996eb095bcdc701f3fab0a8110b8541cbb | /kzZD8Xp3EC7bipfxe_5.py | 1d9f1e7d1c26d008ef7a788ee6e967091963b8a4 | [] | no_license | daniel-reich/turbo-robot | feda6c0523bb83ab8954b6d06302bfec5b16ebdf | a7a25c63097674c0a81675eed7e6b763785f1c41 | refs/heads/main | 2023-03-26T01:55:14.210264 | 2021-03-23T16:08:01 | 2021-03-23T16:08:01 | 350,773,815 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 686 | py | """
Create a function that outputs the result of a math expression in words.
### Examples
worded_math("One plus one") ➞ "Two"
worded_math("zero Plus one") ➞ "One"
worded_math("one minus one") ➞ "Zero"
### Notes
* Expect only the operations `plus` and `minus`.
* Expect to only get numbers and answers from `0` to `2`.
* The first letter of the answer must be capitalised.
"""
def worded_math(equ):
d={"ZERO":0,"ONE":1,"TWO":2}
eq=equ.upper().split()
if eq[1]=="PLUS":
return (list(d.keys())[list(d.values()).index(d[eq[0]]+d[eq[2]])]).capitalize()
return (list(d.keys())[list(d.values()).index(d[eq[0]]-d[eq[2]])]).capitalize()
| [
"[email protected]"
] | |
f7097dcc6105aad7afc861e0c8e8b5fb76c7534e | edc945ca683745f0c1009c280e0098cbf1e5f19e | /7.Chapter-7/02_quick_quiz.py | 8c2ff9180f98dca9611ce913cc4cea130a00248c | [] | no_license | rayhan60611/Python-A-2-Z | 5235db8a79a870b437d284972469ae0fdc8857d5 | cc11e17595db685a02aa060cf08271727fcd81de | refs/heads/master | 2023-04-20T06:13:35.396705 | 2021-04-20T16:51:51 | 2021-04-20T16:51:51 | 357,170,853 | 3 | 0 | null | null | null | null | UTF-8 | Python | false | false | 47 | py | i = 1
while i<=50:
print(i)
i = i + 1
| [
"[email protected]"
] | |
f46582d98339c2a8629936bcfb829cf3411d77e1 | 1a3a0111cfcabc9e763a0bdfea47958c2727a896 | /api/views/assets_api.py | 69842c48319da8929aaf17a4e3a7c0920c1528b9 | [] | no_license | imyanzhao/roe | e2bd044c6232ea7195512e9a3e04597d57c37029 | e225a02899e46212d646efe516f527759471a052 | refs/heads/master | 2020-03-28T11:42:44.028412 | 2018-09-11T01:10:04 | 2018-09-11T01:10:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 27,242 | py | #!/usr/bin/env python
# _#_ coding:utf-8 _*_
from rest_framework import viewsets,permissions
from api import serializers
from CodeOps.models import *
from CMDB.models import *
from rest_framework import status
from django.http import Http404
from django.contrib.auth.models import Group
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.decorators import api_view
from tasks.assets import recordAssets
from django.contrib.auth.decorators import permission_required
from utils.logger import logger
from django.http import JsonResponse
@api_view(['GET', 'POST' ])
@permission_required('OpsManage.can_add_project_assets',raise_exception=True)
def project_list(request,format=None):
if request.method == 'GET':
snippets = Project_Assets.objects.all()
serializer = serializers.ProjectSerializer(snippets, many=True)
return Response(serializer.data)
elif request.method == 'POST':
serializer = serializers.ProjectSerializer(data=request.data)
if serializer.is_valid():
serializer.save()
recordAssets.delay(user=str(request.user),content="添加产品线名称:{project_name}".format(project_name=request.data.get("project_name")),type="project",id=serializer.data.get('id'))
return Response(serializer.data, status=status.HTTP_201_CREATED)
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
@api_view(['GET', 'PUT', 'DELETE'])
def project_detail(request, id,format=None):
try:
snippet = Project_Assets.objects.get(id=id)
except Project_Assets.DoesNotExist:
return Response(status=status.HTTP_404_NOT_FOUND)
if request.method == 'GET':
serializer = serializers.ProjectSerializer(snippet)
return Response(serializer.data)
elif request.method == 'PUT' and request.user.has_perm('OpsManage.can_change_project_assets'):
serializer = serializers.ProjectSerializer(snippet, data=request.data)
old_name = snippet.project_name
if serializer.is_valid():
serializer.save()
recordAssets.delay(user=str(request.user),content="修改产品线为:{old_name} -> {project_name}".format(old_name=old_name,project_name=request.data.get("project_name")),type="project",id=id)
return Response(serializer.data)
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
elif request.method == 'DELETE' and request.user.has_perm('OpsManage.can_delete_rroject_assets'):
if not request.user.has_perm('OpsManage.can_delete_rroject_Assets'):
return Response(status=status.HTTP_403_FORBIDDEN)
snippet.delete()
return Response(status=status.HTTP_204_NO_CONTENT)
@api_view(['GET', 'POST' ])
@permission_required('OpsManage.can_add_service_assets',raise_exception=True)
def service_list(request,format=None):
"""
List all order, or create a server assets order.
"""
if request.method == 'GET':
snippets = Service_Assets.objects.all()
serializer = serializers.ServiceSerializer(snippets, many=True)
return Response(serializer.data)
elif request.method == 'POST':
del request.data['project_name']
try:
service = Service_Assets.objects.create(**request.data)
except Exception, ex:
return Response({"msg":str(ex)}, status=status.HTTP_400_BAD_REQUEST)
try:
snippet = Service_Assets.objects.get(id=service.id)
serializer = serializers.ServiceSerializer(snippet)
recordAssets.delay(user=str(request.user),content="添加业务类型名称:{service_name}".format(service_name=request.data.get("service_name")),type="service",id=serializer.data.get('id'))
except Exception, ex:
logger.error(msg="添加service失败: {ex}".format(ex=str(ex)))
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
return Response(serializer.data)
# serializer = ServiceSerializer(data=request.data)
# if serializer.is_valid():
# serializer.save()
# # recordAssets.delay(user=str(request.user),content="添加业务类型名称:{service_name}".format(service_name=request.data.get("service_name")),type="service",id=serializer.data.get('id'))
# return Response(serializer.data, status=status.HTTP_201_CREATED)
# return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
@api_view(['GET', 'PUT', 'DELETE'])
@permission_required('OpsManage.can_change_service_assets',raise_exception=True)
def service_detail(request, id,format=None):
"""
Retrieve, update or delete a server assets instance.
"""
try:
snippet = Service_Assets.objects.get(id=id)
except Service_Assets.DoesNotExist:
return Response(status=status.HTTP_404_NOT_FOUND)
if request.method == 'GET':
serializer = serializers.ServiceSerializer(snippet)
return Response(serializer.data)
elif request.method == 'PUT':
serializer = serializers.ServiceSerializer(snippet, data=request.data)
old_name = snippet.service_name
if serializer.is_valid():
serializer.save()
recordAssets.delay(user=str(request.user),content="修改业务类型为:{old_name} -> {service_name}".format(old_name=old_name,service_name=request.data.get("service_name")),type="service",id=id)
return Response(serializer.data)
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
elif request.method == 'DELETE' and request.user.has_perm('OpsManage.can_delete_assets'):
if not request.user.has_perm('OpsManage.can_delete_service_assets'):
return Response(status=status.HTTP_403_FORBIDDEN)
snippet.delete()
recordAssets.delay(user=str(request.user),content="删除业务类型:{service_name}".format(service_name=snippet.service_name),type="service",id=id)
return Response(status=status.HTTP_204_NO_CONTENT)
@api_view(['GET', 'DELETE'])
@permission_required('OpsManage.read_log_assets',raise_exception=True)
def assetsLog_detail(request, id,format=None):
"""
Retrieve, update or delete a server assets instance.
"""
try:
snippet = Log_Assets.objects.get(id=id)
except Log_Assets.DoesNotExist:
return Response(status=status.HTTP_404_NOT_FOUND)
if request.method == 'GET':
serializer = serializers.AssetsLogsSerializer(snippet)
return Response(serializer.data)
elif request.method == 'DELETE' and request.user.has_perm('OpsManage.delete_log_assets'):
if not request.user.has_perm('OpsManage.delete_log_assets'):
return Response(status=status.HTTP_403_FORBIDDEN)
snippet.delete()
return Response(status=status.HTTP_204_NO_CONTENT)
@api_view(['GET', 'POST' ])
@permission_required('Opsmanage.add_group',raise_exception=True)
def group_list(request,format=None):
"""
List all order, or create a server assets order.
"""
if not request.user.has_perm('Opsmanage.read_group'):
return Response(status=status.HTTP_403_FORBIDDEN)
if request.method == 'GET':
snippets = Group.objects.all()
serializer = serializers.GroupSerializer(snippets, many=True)
return Response(serializer.data)
elif request.method == 'POST':
if not request.user.has_perm('Opsmanage.change_group'):
return Response(status=status.HTTP_403_FORBIDDEN)
serializer = serializers.GroupSerializer(data=request.data)
if serializer.is_valid():
serializer.save()
recordAssets.delay(user=str(request.user),content="添加用户组:{group_name}".format(group_name=request.data.get("name")),type="group",id=serializer.data.get('id'))
return Response(serializer.data, status=status.HTTP_201_CREATED)
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
@api_view(['GET', 'PUT', 'DELETE'])
@permission_required('Opsmanage.change_group',raise_exception=True)
def group_detail(request, id,format=None):
"""
Retrieve, update or delete a server assets instance.
"""
try:
snippet = Group.objects.get(id=id)
except Group.DoesNotExist:
return Response(status=status.HTTP_404_NOT_FOUND)
if request.method == 'GET':
serializer = serializers.GroupSerializer(snippet)
return Response(serializer.data)
elif request.method == 'PUT':
serializer = serializers.GroupSerializer(snippet, data=request.data)
old_name = snippet.name
if serializer.is_valid():
serializer.save()
recordAssets.delay(user=str(request.user),content="修改用户组名称:{old_name} -> {group_name}".format(old_name=old_name,group_name=request.data.get("name")),type="group",id=id)
return Response(serializer.data)
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
elif request.method == 'DELETE':
if not request.user.has_perm('Opsmanage.delete_group'):
return Response(status=status.HTTP_403_FORBIDDEN)
snippet.delete()
recordAssets.delay(user=str(request.user),content="删除用户组:{group_name}".format(group_name=snippet.name),type="group",id=id)
return Response(status=status.HTTP_204_NO_CONTENT)
@api_view(['GET', 'POST' ])
@permission_required('OpsManage.can_add_zone_assets',raise_exception=True)
def zone_list(request,format=None):
"""
List all order, or create a server assets order.
"""
if request.method == 'GET':
snippets = Zone_Assets.objects.all()
serializer = serializers.ZoneSerializer(snippets, many=True)
return Response(serializer.data)
elif request.method == 'POST':
serializer = serializers.ZoneSerializer(data=request.data)
if serializer.is_valid():
serializer.save()
recordAssets.delay(user=str(request.user),content="添加机房资产:{zone_name}".format(zone_name=request.data.get("zone_name")),type="zone",id=serializer.data.get('id'))
return Response(serializer.data, status=status.HTTP_201_CREATED)
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
@api_view(['GET', 'PUT', 'DELETE'])
@permission_required('OpsManage.can_change_zone_assets',raise_exception=True)
def zone_detail(request, id,format=None):
"""
Retrieve, update or delete a server assets instance.
"""
try:
snippet = Zone_Assets.objects.get(id=id)
except Zone_Assets.DoesNotExist:
return Response(status=status.HTTP_404_NOT_FOUND)
if request.method == 'GET':
serializer = serializers.ZoneSerializer(snippet)
return Response(serializer.data)
elif request.method == 'PUT':
old_name = snippet.zone_name
serializer = serializers.ZoneSerializer(snippet, data=request.data)
if serializer.is_valid():
serializer.save()
recordAssets.delay(user=str(request.user),content="修改机房资产:{old_name} -> {zone_name}".format(old_name=old_name,zone_name=request.data.get("zone_name")),type="zone",id=id)
return Response(serializer.data)
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
elif request.method == 'DELETE':
if not request.user.has_perm('OpsManage.can_delete_zone_assets'):
return Response(status=status.HTTP_403_FORBIDDEN)
snippet.delete()
recordAssets.delay(user=str(request.user),content="删除机房资产:{zone_name}".format(zone_name=snippet.zone_name),type="zone",id=id)
return Response(status=status.HTTP_204_NO_CONTENT)
@api_view(['GET', 'POST' ])
@permission_required('OpsManage.can_add_line_assets',raise_exception=True)
def line_list(request,format=None):
"""
List all order, or create a server assets order.
"""
if request.method == 'GET':
snippets = Line_Assets.objects.all()
serializer = serializers.LineSerializer(snippets, many=True)
return Response(serializer.data)
elif request.method == 'POST':
serializer = serializers.LineSerializer(data=request.data)
if serializer.is_valid():
serializer.save()
recordAssets.delay(user=str(request.user),content="添加出口线路:{line_name}".format(line_name=request.data.get("line_name")),type="line",id=serializer.data.get('id'))
return Response(serializer.data, status=status.HTTP_201_CREATED)
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
@api_view(['GET', 'PUT', 'DELETE'])
@permission_required('OpsManage.can_change_line_assets',raise_exception=True)
def line_detail(request, id,format=None):
"""
Retrieve, update or delete a server assets instance.
"""
try:
snippet = Line_Assets.objects.get(id=id)
except Line_Assets.DoesNotExist:
return Response(status=status.HTTP_404_NOT_FOUND)
if request.method == 'GET':
serializer = serializers.LineSerializer(snippet)
return Response(serializer.data)
elif request.method == 'PUT':
serializer = serializers.LineSerializer(snippet, data=request.data)
old_name = snippet.line_name
if serializer.is_valid():
serializer.save()
recordAssets.delay(user=str(request.user),content="修改出口线路类型:{old_name} -> {line_name}".format(old_name=old_name,line_name=request.data.get("line_name")),type="line",id=id)
return Response(serializer.data)
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
elif request.method == 'DELETE':
if not request.user.has_perm('OpsManage.can_delete_line_assets'):
return Response(status=status.HTTP_403_FORBIDDEN)
snippet.delete()
recordAssets.delay(user=str(request.user),content="删除出口线路:{line_name}".format(line_name=snippet.line_name),type="line",id=id)
return Response(status=status.HTTP_204_NO_CONTENT)
@api_view(['GET', 'POST' ])
@permission_required('OpsManage.can_add_raid_assets',raise_exception=True)
def raid_list(request,format=None):
"""
List all order, or create a server assets order.
"""
if request.method == 'GET':
snippets = Raid_Assets.objects.all()
serializer = serializers.RaidSerializer(snippets, many=True)
return Response(serializer.data)
elif request.method == 'POST':
serializer = serializers.RaidSerializer(data=request.data)
if serializer.is_valid():
serializer.save()
recordAssets.delay(user=str(request.user),content="添加Raid类型:{raid_name}".format(raid_name=request.data.get("raid_name")),type="raid",id=serializer.data.get('id'))
return Response(serializer.data, status=status.HTTP_201_CREATED)
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
@api_view(['GET', 'PUT', 'DELETE'])
@permission_required('OpsManage.can_change_raid_assets',raise_exception=True)
def raid_detail(request, id,format=None):
"""
Retrieve, update or delete a server assets instance.
"""
try:
snippet = Raid_Assets.objects.get(id=id)
except Raid_Assets.DoesNotExist:
return Response(status=status.HTTP_404_NOT_FOUND)
if request.method == 'GET':
serializer = serializers.RaidSerializer(snippet)
return Response(serializer.data)
elif request.method == 'PUT':
old_name = snippet.raid_name
serializer = serializers.RaidSerializer(snippet, data=request.data)
if serializer.is_valid():
serializer.save()
recordAssets.delay(user=str(request.user),content="修改Raid类型:{old_name} -> {raid_name}".format(old_name=old_name,raid_name=request.data.get("raid_name")),type="raid",id=id)
return Response(serializer.data)
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
elif request.method == 'DELETE':
if not request.user.has_perm('OpsManage.can_delete_raid_assets'):
return Response(status=status.HTTP_403_FORBIDDEN)
snippet.delete()
recordAssets.delay(user=str(request.user),content="删除Raid类型:{raid_name}".format(raid_name=snippet.raid_name),type="raid",id=id)
return Response(status=status.HTTP_204_NO_CONTENT)
@api_view(['GET', 'POST' ])
@permission_required('OpsManage.can_add_assets',raise_exception=True)
def asset_list(request,format=None):
"""
List all order, or create a server assets order.
"""
if request.method == 'GET':
snippets = Assets.objects.all()
serializer = serializers.AssetsSerializer(snippets, many=True)
return Response(serializer.data)
elif request.method == 'POST':
serializer = serializers.AssetsSerializer(data=request.data)
if serializer.is_valid():
serializer.save()
recordAssets.delay(user=str(request.user),content="添加资产:{name}".format(name=request.data.get("name")),type="assets",id=serializer.data.get('id'))
return Response(serializer.data, status=status.HTTP_201_CREATED)
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
@api_view(['GET', 'PUT', 'DELETE'])
@permission_required('OpsManage.can_change_assets',raise_exception=True)
def asset_detail(request, id,format=None):
"""
Retrieve, update or delete a server assets instance.
"""
try:
snippet = Assets.objects.get(id=id)
except Assets.DoesNotExist:
return Response(status=status.HTTP_404_NOT_FOUND)
if request.method == 'GET':
serializer = serializers.AssetsSerializer(snippet)
return Response(serializer.data)
elif request.method == 'PUT':
serializer = serializers.AssetsSerializer(snippet, data=request.data)
if serializer.is_valid():
serializer.save()
recordAssets.delay(user=str(request.user),content="更新资产:{name}".format(name=snippet.name),type="assets",id=id)
return Response(serializer.data)
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
elif request.method == 'DELETE':
if not request.user.has_perm('OpsManage.delete_asset_assets'):
return Response(status=status.HTTP_403_FORBIDDEN)
snippet.delete()
recordAssets.delay(user=str(request.user),content="删除资产:{name}".format(name=snippet.name),type="assets",id=id)
return Response(status=status.HTTP_204_NO_CONTENT)
@api_view(['GET', 'POST' ])
@permission_required('OpsManage.can_add_server_assets',raise_exception=True)
def asset_server_list(request,format=None):
"""
List all order, or create a server assets order.
"""
if request.method == 'GET':
snippets = Server_Assets.objects.all()
serializer = serializers.ServerSerializer(snippets, many=True)
return Response(serializer.data)
elif request.method == 'POST':
if(request.data.get('data')):
data = request.data.get('data')
else:
data = request.data
serializer = serializers.ServerSerializer(data=data)
if serializer.is_valid():
serializer.save()
recordAssets.delay(user=str(request.user),content="添加服务器资产:{ip}".format(ip=data.get("ip")),type="server",id=serializer.data.get('id'))
return Response(serializer.data, status=status.HTTP_201_CREATED)
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
@api_view(['GET', 'PUT', 'DELETE'])
@permission_required('OpsManage.can_change_server_assets',raise_exception=True)
def asset_server_detail(request, id,format=None):
"""
Retrieve, update or delete a server assets instance.
"""
try:
snippet = Server_Assets.objects.get(id=id)
except Server_Assets.DoesNotExist:
return Response(status=status.HTTP_404_NOT_FOUND)
if request.method == 'GET':
serializer = serializers.ServerSerializer(snippet)
return Response(serializer.data)
elif request.method == 'PUT':
'''如果更新字段包含assets则先更新总资产表'''
if(request.data.get('data')):
data = request.data.get('data')
else:
data = request.data
if(data.get('assets')):
assets_data = data.pop('assets')
try:
assets_snippet = Assets.objects.get(id=snippet.assets.id)
assets = serializers.AssetsSerializer(assets_snippet,data=assets_data)
except Assets.DoesNotExist:
return Response(status=status.HTTP_404_NOT_FOUND)
if assets.is_valid():
assets.save()
recordAssets.delay(user=str(request.user),content="修改服务器资产:{ip}".format(ip=snippet.ip),type="server",id=id)
serializer = serializers.ServerSerializer(snippet, data=data)
if serializer.is_valid():
serializer.save()
return Response(serializer.data)
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
elif request.method == 'DELETE':
if not request.user.has_perm('OpsManage.can_delete_server_assets'):
return Response(status=status.HTTP_403_FORBIDDEN)
snippet.delete()
try:
assets_snippet = Assets.objects.get(id=snippet.assets.id)
assets_snippet.delete()
recordAssets.delay(user=str(request.user),content="删除服务器资产:{ip}".format(ip=snippet.ip),type="server",id=id)
except Assets.DoesNotExist:
pass
return Response(status=status.HTTP_204_NO_CONTENT)
@api_view(['GET', 'POST' ])
@permission_required('OpsManage.can_add_net_assets',raise_exception=True)
def asset_net_list(request,format=None):
"""
List all order, or create a new net assets.
"""
if request.method == 'GET':
snippets = Network_Assets.objects.all()
serializer = serializers.NetworkSerializer(snippets, many=True)
return Response(serializer.data)
elif request.method == 'POST':
if(request.data.get('data')):
data = request.data.get('data')
else:
data = request.data
serializer = serializers.NetworkSerializer(data=data)
if serializer.is_valid():
serializer.save()
recordAssets.delay(user=str(request.user),content="添加网络设备资产:{ip}".format(ip=data.get("ip")),type="net",id=serializer.data.get('id'))
return Response(serializer.data, status=status.HTTP_201_CREATED)
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
@api_view(['GET', 'PUT', 'DELETE'])
@permission_required('OpsManage.can_change_net_assets',raise_exception=True)
def asset_net_detail(request, id,format=None):
"""
Retrieve, update or delete a net assets instance.
"""
try:
snippet = Network_Assets.objects.get(id=id)
except Network_Assets.DoesNotExist:
return Response(status=status.HTTP_404_NOT_FOUND)
if request.method == 'GET':
serializer = serializers.NetworkSerializer(snippet)
return Response(serializer.data)
elif request.method == 'PUT':
'''如果更新字段包含assets则先更新总资产表'''
if(request.data.get('data')):
data = request.data.get('data')
else:
data = request.data
if(data.get('assets')):
assets_data = data.pop('assets')
try:
assets_snippet = Assets.objects.get(id=snippet.assets.id)
assets = serializers.AssetsSerializer(assets_snippet,data=assets_data)
except Assets.DoesNotExist:
return Response(status=status.HTTP_404_NOT_FOUND)
if assets.is_valid():
assets.save()
serializer = serializers.NetworkSerializer(snippet, data=data)
if serializer.is_valid():
serializer.save()
recordAssets.delay(user=str(request.user),content="更新网络设备资产:{ip}".format(ip=snippet.ip),type="net",id=id)
return Response(serializer.data)
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
elif request.method == 'DELETE':
if not request.user.has_perm('OpsManage.delete_net_assets'):
return Response(status=status.HTTP_403_FORBIDDEN)
snippet.delete()
try:
assets_snippet = Assets.objects.get(id=snippet.assets.id)
assets_snippet.delete()
recordAssets.delay(user=str(request.user),content="删除网络设备资产:{ip}".format(ip=snippet.ip),type="net",id=id)
except Assets.DoesNotExist:
pass
return Response(status=status.HTTP_204_NO_CONTENT)
@api_view(['GET', 'POST'])
@permission_required('OpsManage.can_change_assets',raise_exception=True)
def asset_info(request, id,format=None):
"""
Retrieve, update or delete a server assets instance.
"""
try:
assets = Assets.objects.get(id=id)
except Assets.DoesNotExist:
return Response(status=status.HTTP_404_NOT_FOUND)
if request.method == 'POST':
dataList = []
try:
if assets.assets_type in ['server','vmser']:
dataList.append({"name":'CPU型号',"value":assets.server_assets.cpu})
dataList.append({"name":'CPU个数',"value":assets.server_assets.vcpu_number})
dataList.append({"name":'硬盘容量',"value":str(int(assets.server_assets.disk_total)/1024)+'GB'})
dataList.append({"name":'内存容量',"value":str(int(assets.server_assets.ram_total)/1024)+'GB'})
dataList.append({"name":'操作系统',"value":assets.server_assets.system})
dataList.append({"name":'内核版本',"value":assets.server_assets.kernel})
dataList.append({"name":'主机名',"value":assets.server_assets.hostname})
else:
dataList.append({"name":'CPU型号',"value":assets.network_assets.cpu})
dataList.append({"name":'内存容量',"value":assets.network_assets.stone})
dataList.append({"name":'背板带宽',"value":assets.network_assets.bandwidth})
dataList.append({"name":'端口总数',"value":assets.network_assets.port_number})
except Exception ,ex:
logger.warn(msg="获取资产信息失败: {ex}".format(ex=ex))
return JsonResponse({"code":200,"msg":"success","data":dataList})
| [
"[email protected]"
] | |
9bc92d13acd0e88decb4e96d6907a77962b3f05e | 182d36353a6e33dc1f27f2dc7c0ae95577941dca | /liaoxuefeng/debug.py | 6be77d8e784f6bd8495c5b83bddcd9efcf4e57e1 | [] | no_license | tp-yan/PythonScript | d0da587162b1f621ed6852be758705690a6c9dce | 497c933217019046aca0d4258b174a13965348a7 | refs/heads/master | 2020-09-02T02:49:20.305732 | 2019-12-01T06:54:19 | 2019-12-01T06:54:19 | 219,115,755 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,774 | py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 22 14:22:06 2019
@author: tangpeng
调试
"""
"""
1. 断言
凡是用print()来辅助查看的地方,都可以用断言(assert)来替代,如果断言失败,assert语句本身就会抛出AssertionError。
启动Python解释器时可以用-O参数(英文大写字母O)来关闭assert: python -O err.py
"""
def foo(s):
n = int(s)
assert n != 0, "n is zero" # assert的意思是,表达式n != 0应该是True,否则,根据程序运行的逻辑,后面的代码肯定会出错。
def main():
foo('0')
#main() # AssertionError: n is zero
"""
2. logging
把print()替换为logging,和assert比,logging不会抛出错误,而且可以输出到文件:
logging.basicConfig(level=logging.INFO) 指定记录信息的级别,有debug,info,warning,error等几个级别,
当我们指定level=INFO时,logging.debug就不起作用了。同理,指定level=WARNING后,debug和info就不起作用了。
logging的另一个好处是通过简单的配置,一条语句可以同时输出到不同的地方,比如console和文件。
"""
import logging
logging.basicConfig(level=logging.INFO) # 控制logging输出等级,默认不输出
s = "0"
n = int(s)
logging.info("n = %d" % n) # logging.info()就可以输出一段文本
print(10/n)
"""
# 在控制台会有logging输出,在IPython下没有
python debug.py
INFO:root:n = 0
Traceback (most recent call last):
File "debug.py", line 34, in <module>
print(10/n)
ZeroDivisionError: division by zero
"""
"""
3. pdb
Python的调试器 pdb ,让程序以单步方式运行,可以随时查看运行状态:
python -m pdb err.py # 以参数-m pdb启动 pdb
> d:\project\pythonproject\script\err.py(9)<module>()
-> '''
(Pdb) l # 输入命令l来查看代码:
4 Created on Tue Oct 22 15:26:08 2019
5
6 @author: tangpeng
7
8 err.py:用于调试测试的模块
9 -> '''
10
11 s = '0'
12 n = int(s)
13 print(10 / n)
[EOF]
(Pdb) n # 输入命令n可以单步执行代码
> d:\project\pythonproject\script\err.py(11)<module>()
-> s = '0'
(Pdb) n
> d:\project\pythonproject\script\err.py(12)<module>()
-> n = int(s)
(Pdb) n
> d:\project\pythonproject\script\err.py(13)<module>()
-> print(10 / n)
(Pdb) p s # 任何时候都可以输入命令p 变量名来查看变量:
'0'
(Pdb) p n
0
(Pdb) n
ZeroDivisionError: division by zero
> d:\project\pythonproject\script\err.py(13)<module>()
-> print(10 / n)
(Pdb) q # 输入命令q结束调试,退出程序
"""
"""
`pdb.set_trace()`:这个方法也是用pdb,但是不需要单步执行,我们只需要`import pdb`,
然后,在可能出错的地方放一个`pdb.set_trace()`,就可以设置一个断点:
""" | [
"[email protected]"
] | |
5f772c255a2d963e4174ee771b2d84e4f7d34570 | 0f9f8e8478017da7c8d408058f78853d69ac0171 | /python3/l0283_move_zeros.py | 45ac985e2ff57c7e657675ed0adcd7c6d9b39d2c | [] | no_license | sprax/1337 | dc38f1776959ec7965c33f060f4d43d939f19302 | 33b6b68a8136109d2aaa26bb8bf9e873f995d5ab | refs/heads/master | 2022-09-06T18:43:54.850467 | 2020-06-04T17:19:51 | 2020-06-04T17:19:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 350 | py | from typing import List
class Solution:
def moveZeroes(self, nums: List[int]) -> None:
"""
Do not return anything, modify nums in-place instead.
"""
i, j = 0, 0
while j < len(nums):
if nums[j] != 0:
nums[i], nums[j] = nums[j], nums[i]
i += 1
j += 1
| [
"[email protected]"
] | |
9d3f3c39c35169c2ce75b294ff350c29185fb2dc | 10b3d1ce02eaa4908dc16ca378ddfb1955b2d625 | /avod/avod/datasets/kitti/kitti_utils.py | 012a4b4a0c4467fe3f617fd15797ae88e6dd5259 | [
"MIT",
"BSD-3-Clause"
] | permissive | ZiningWang/Sparse_Pooling | 7281aa0d974849eac8c48faa5ba08519b091ef6e | f46882832d0e2fed5ab4a0af15cead44fd3c6faa | refs/heads/master | 2023-05-26T08:47:16.232822 | 2023-05-20T08:39:11 | 2023-05-20T08:39:11 | 141,640,800 | 56 | 21 | null | null | null | null | UTF-8 | Python | false | false | 13,729 | py | import os
import numpy as np
from wavedata.tools.core.voxel_grid_2d import VoxelGrid2D
from wavedata.tools.core.voxel_grid import VoxelGrid
from wavedata.tools.obj_detection import obj_utils
from avod.builders import bev_generator_builder
from avod.core.label_cluster_utils import LabelClusterUtils
from avod.core.mini_batch_utils import MiniBatchUtils
class KittiUtils(object):
# Definition for difficulty levels
# These values are from Kitti dataset
# 0 - easy, 1 - medium, 2 - hard
HEIGHT = (40, 25, 25)
OCCLUSION = (0, 1, 2)
TRUNCATION = (0.15, 0.3, 0.5)
def __init__(self, dataset):
self.dataset = dataset
# Label Clusters
self.label_cluster_utils = LabelClusterUtils(self.dataset)
self.clusters, self.std_devs = [None, None]
# BEV source from dataset config
self.bev_source = self.dataset.bev_source
# Parse config
self.config = dataset.config.kitti_utils_config
self.area_extents = np.reshape(self.config.area_extents, (3, 2))
self.bev_extents = self.area_extents[[0, 2]]
self.voxel_size = self.config.voxel_size
self.anchor_strides = np.reshape(self.config.anchor_strides, (-1, 2))
self.bev_generator = bev_generator_builder.build(
self.config.bev_generator, self)
self._density_threshold = self.config.density_threshold
# Check that depth maps folder exists
if self.bev_source == 'depth' and \
not os.path.exists(self.dataset.depth_dir):
raise FileNotFoundError(
'Could not find depth maps, please run '
'demos/save_lidar_depth_maps.py in wavedata first')
# Mini Batch Utils
self.mini_batch_utils = MiniBatchUtils(self.dataset)
self._mini_batch_dir = self.mini_batch_utils.mini_batch_dir
# Label Clusters
self.clusters, self.std_devs = \
self.label_cluster_utils.get_clusters()
def class_str_to_index(self, class_str):
"""
Converts an object class type string into a integer index
Args:
class_str: the object type (e.g. 'Car', 'Pedestrian', or 'Cyclist')
Returns:
The corresponding integer index for a class type, starting at 1
(0 is reserved for the background class).
Returns -1 if we don't care about that class type.
"""
if class_str in self.dataset.classes:
return self.dataset.classes.index(class_str) + 1
raise ValueError('Invalid class string {}, not in {}'.format(
class_str, self.dataset.classes))
def create_slice_filter(self, point_cloud, area_extents,
ground_plane, ground_offset_dist, offset_dist):
""" Creates a slice filter to take a slice of the point cloud between
ground_offset_dist and offset_dist above the ground plane
Args:
point_cloud: Point cloud in the shape (3, N)
area_extents: 3D area extents
ground_plane: ground plane coefficients
offset_dist: max distance above the ground
ground_offset_dist: min distance above the ground plane
Returns:
A boolean mask if shape (N,) where
True indicates the point should be kept
False indicates the point should be removed
"""
# Filter points within certain xyz range and offset from ground plane
offset_filter = obj_utils.get_point_filter(point_cloud, area_extents,
ground_plane, offset_dist)
# Filter points within 0.2m of the road plane
road_filter = obj_utils.get_point_filter(point_cloud, area_extents,
ground_plane,
ground_offset_dist)
slice_filter = np.logical_xor(offset_filter, road_filter)
return slice_filter
def create_bev_maps(self, point_cloud, ground_plane, output_indices=False):
""" Calculates bev maps
Args:
point_cloud: point cloud
ground_plane: ground_plane coefficients
Returns:
Dictionary with entries for each type of map (e.g. height, density)
"""
bev_maps = self.bev_generator.generate_bev(self.bev_source,
point_cloud,
ground_plane,
self.area_extents,
self.voxel_size,
output_indices=output_indices)
return bev_maps
def get_anchors_info(self, classes_name, anchor_strides, sample_name):
anchors_info = self.mini_batch_utils.get_anchors_info(classes_name,
anchor_strides,
sample_name)
return anchors_info
def get_point_cloud(self, source, img_idx, image_shape=None):
""" Gets the points from the point cloud for a particular image,
keeping only the points within the area extents, and takes a slice
between self._ground_filter_offset and self._offset_distance above
the ground plane
Args:
source: point cloud source, e.g. 'lidar'
img_idx: An integer sample image index, e.g. 123 or 500
image_shape: image dimensions (h, w), only required when
source is 'lidar' or 'depth'
Returns:
The set of points in the shape (N, 3)
"""
if source == 'lidar':
# wavedata wants im_size in (w, h) order
im_size = [image_shape[1], image_shape[0]]
point_cloud = obj_utils.get_lidar_point_cloud(
img_idx, self.dataset.calib_dir, self.dataset.velo_dir,
im_size=im_size)
else:
raise ValueError("Invalid source {}".format(source))
return point_cloud
def get_ground_plane(self, sample_name):
"""Reads the ground plane for the sample
Args:
sample_name: name of the sample, e.g. '000123'
Returns:
ground_plane: ground plane coefficients
"""
ground_plane = obj_utils.get_road_plane(int(sample_name),
self.dataset.planes_dir)
return ground_plane
def _apply_offset_filter(
self,
point_cloud,
ground_plane,
offset_dist=2.0):
""" Applies an offset filter to the point cloud
Args:
point_cloud: A point cloud in the shape (3, N)
ground_plane: ground plane coefficients,
if None, will only filter to the area extents
offset_dist: (optional) height above ground plane for filtering
Returns:
Points filtered with an offset filter in the shape (N, 3)
"""
offset_filter = obj_utils.get_point_filter(
point_cloud, self.area_extents, ground_plane, offset_dist)
# Transpose point cloud into N x 3 points
points = np.asarray(point_cloud).T
filtered_points = points[offset_filter]
return filtered_points
def _apply_slice_filter(self, point_cloud, ground_plane,
height_lo=0.2, height_hi=2.0):
""" Applies a slice filter to the point cloud
Args:
point_cloud: A point cloud in the shape (3, N)
ground_plane: ground plane coefficients
height_lo: (optional) lower height for slicing
height_hi: (optional) upper height for slicing
Returns:
Points filtered with a slice filter in the shape (N, 3)
"""
slice_filter = self.create_slice_filter(point_cloud,
self.area_extents,
ground_plane,
height_lo, height_hi)
# Transpose point cloud into N x 3 points
points = np.asarray(point_cloud).T
filtered_points = points[slice_filter]
return filtered_points
def create_sliced_voxel_grid_2d(self, sample_name, source,
image_shape=None):
"""Generates a filtered 2D voxel grid from point cloud data
Args:
sample_name: image name to generate stereo pointcloud from
source: point cloud source, e.g. 'lidar'
image_shape: image dimensions [h, w], only required when
source is 'lidar' or 'depth'
Returns:
voxel_grid_2d: 3d voxel grid from the given image
"""
img_idx = int(sample_name)
ground_plane = obj_utils.get_road_plane(img_idx,
self.dataset.planes_dir)
point_cloud = self.get_point_cloud(source, img_idx,
image_shape=image_shape)
filtered_points = self._apply_slice_filter(point_cloud, ground_plane)
# Create Voxel Grid
voxel_grid_2d = VoxelGrid2D()
voxel_grid_2d.voxelize_2d(filtered_points, self.voxel_size,
extents=self.area_extents,
ground_plane=ground_plane,
create_leaf_layout=True)
return voxel_grid_2d
def create_voxel_grid_3d(self, sample_name, ground_plane,
source='lidar',
filter_type='slice'):
"""Generates a filtered voxel grid from stereo data
Args:
sample_name: image name to generate stereo pointcloud from
ground_plane: ground plane coefficients
source: source of the pointcloud to create bev images
either "stereo" or "lidar"
filter_type: type of point filter to use
'slice' for slice filtering (offset + ground)
'offset' for offset filtering only
'area' for area filtering only
Returns:
voxel_grid_3d: 3d voxel grid from the given image
"""
img_idx = int(sample_name)
points = self.get_point_cloud(source, img_idx)
if filter_type == 'slice':
filtered_points = self._apply_slice_filter(points, ground_plane)
elif filter_type == 'offset':
filtered_points = self._apply_offset_filter(points, ground_plane)
elif filter_type == 'area':
# A None ground plane will filter the points to the area extents
filtered_points = self._apply_offset_filter(points, None)
else:
raise ValueError("Invalid filter_type {}, should be 'slice', "
"'offset', or 'area'".format(filter_type))
# Create Voxel Grid
voxel_grid_3d = VoxelGrid()
voxel_grid_3d.voxelize(filtered_points, self.voxel_size,
extents=self.area_extents)
return voxel_grid_3d
def filter_labels(self, objects,
classes=None,
difficulty=None,
max_occlusion=None):
"""Filters ground truth labels based on class, difficulty, and
maximum occlusion
Args:
objects: A list of ground truth instances of Object Label
classes: (optional) classes to filter by, if None
all classes are used
difficulty: (optional) KITTI difficulty rating as integer
max_occlusion: (optional) maximum occlusion to filter objects
Returns:
filtered object label list
"""
if classes is None:
classes = self.dataset.classes
objects = np.asanyarray(objects)
filter_mask = np.ones(len(objects), dtype=np.bool)
for obj_idx in range(len(objects)):
obj = objects[obj_idx]
if filter_mask[obj_idx]:
if not self._check_class(obj, classes):
filter_mask[obj_idx] = False
continue
# Filter by difficulty (occlusion, truncation, and height)
if difficulty is not None and \
not self._check_difficulty(obj, difficulty):
filter_mask[obj_idx] = False
continue
if max_occlusion and \
obj.occlusion > max_occlusion:
filter_mask[obj_idx] = False
continue
return objects[filter_mask]
def _check_difficulty(self, obj, difficulty):
"""This filters an object by difficulty.
Args:
obj: An instance of ground-truth Object Label
difficulty: An int defining the KITTI difficulty rate
Returns: True or False depending on whether the object
matches the difficulty criteria.
"""
return ((obj.occlusion <= self.OCCLUSION[difficulty]) and
(obj.truncation <= self.TRUNCATION[difficulty]) and
(obj.y2 - obj.y1) >= self.HEIGHT[difficulty])
def _check_class(self, obj, classes):
"""This filters an object by class.
Args:
obj: An instance of ground-truth Object Label
Returns: True or False depending on whether the object
matches the desired class.
"""
return obj.type in classes
| [
"[email protected]"
] | |
8c47efca30c846eaf43046cb0784d1cc21e03a32 | 9ecdf9b65c0d0ab96945ccdcb7c59e08ea3ad49e | /arelle/plugin/profileFormula.py | 2485a86198492bc9cb376af75f32f6fec1689b7d | [
"Apache-2.0"
] | permissive | joskoanicic/carelle | 348bd5b4e0619161035d2906e6c99ed1ab362c1a | 311f97bd944d49016885cc90d8be41a4bb85300a | refs/heads/master | 2020-04-15T10:04:51.445961 | 2015-11-10T16:50:09 | 2015-11-10T16:50:09 | 68,085,924 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,608 | py | '''
Profile Formula Validation is an example of a plug-in to GUI menu that will profile formula execution.
(c) Copyright 2012 Mark V Systems Limited, All rights reserved.
'''
import os
from tkinter import simpledialog, messagebox
def profileFormulaMenuEntender(cntlr, menu):
# Extend menu with an item for the profile formula plugin
menu.add_command(label="Profile formula validation",
underline=0,
command=lambda: profileFormulaMenuCommand(cntlr) )
def profileFormulaMenuCommand(cntlr):
# save DTS menu item has been invoked
if cntlr.modelManager is None or cntlr.modelManager.modelXbrl is None:
cntlr.addToLog("No taxonomy loaded.")
return
# get file name into which to save log file while in foreground thread
profileReportFile = cntlr.uiFileDialog("save",
title=_("arelle - Save Formula Profile Report"),
initialdir=cntlr.config.setdefault("formulaProfileReportDir","."),
filetypes=[(_("Profile report file .log"), "*.log")],
defaultextension=".log")
if not profileReportFile:
return False
errMsg = ""
maxRunTime = 0
while (1):
timeout = simpledialog.askstring(_("arelle - Set formula run time limit"),
_("{0}You may enter the maximum number of minutes to run formulas.\n"
"(Leave empty for no run time limitation.)".format(errMsg)),
parent=cntlr.parent)
if timeout:
try:
maxRunTime = float(timeout)
break
except ValueError as err:
errMsg = str(err) + "\n\n"
excludeCompileTime = messagebox.askyesno(_("arelle - Exclude formula compile statistics"),
_("Should formula compiling be excluded from the statistics?\n"
"(Yes will make a separate compiling \"pass\" so that statistics include execution only.)".format(errMsg)),
parent=cntlr.parent)
cntlr.config["formulaProfileReportDir"] = os.path.dirname(profileReportFile)
cntlr.saveConfig()
# perform validation and profiling on background thread
import threading
thread = threading.Thread(target=lambda c=cntlr, f=profileReportFile, t=maxRunTime, e=excludeCompileTime: backgroundProfileFormula(c,f,t,e))
thread.daemon = True
thread.start()
def backgroundProfileFormula(cntlr, profileReportFile, maxRunTime, excludeCompileTime):
from arelle import Locale, XPathParser, ValidateXbrlDimensions, ValidateFormula
# build grammar before profiling (if this is the first pass, so it doesn't count in profile statistics)
XPathParser.initializeParser(cntlr.modelManager)
# load dimension defaults
ValidateXbrlDimensions.loadDimensionDefaults(cntlr.modelManager)
import cProfile, pstats, sys, time
# a minimal validation class for formula validator parameters that are needed
class Validate:
def __init__(self, modelXbrl, maxRunTime):
self.modelXbrl = modelXbrl
self.parameters = None
self.validateSBRNL = False
self.maxFormulaRunTime = maxRunTime
def close(self):
self.__dict__.clear()
val = Validate(cntlr.modelManager.modelXbrl, maxRunTime)
formulaOptions = val.modelXbrl.modelManager.formulaOptions
if excludeCompileTime:
startedAt = time.time()
cntlr.addToLog(_("pre-compiling formulas before profiling"))
val.validateFormulaCompileOnly = True
ValidateFormula.validate(val)
del val.validateFormulaCompileOnly
cntlr.addToLog(Locale.format_string(cntlr.modelManager.locale,
_("formula pre-compiling completed in %.2f secs"),
time.time() - startedAt))
cntlr.addToLog(_("executing formulas for profiling"))
else:
cntlr.addToLog(_("compiling and executing formulas for profiling"))
startedAt = time.time()
statsFile = profileReportFile + ".bin"
cProfile.runctx("ValidateFormula.validate(val)", globals(), locals(), statsFile)
cntlr.addToLog(Locale.format_string(cntlr.modelManager.locale,
_("formula profiling completed in %.2f secs"),
time.time() - startedAt))
# dereference val
val.close()
# specify a file for log
priorStdOut = sys.stdout
sys.stdout = open(profileReportFile, "w")
statObj = pstats.Stats(statsFile)
statObj.strip_dirs()
statObj.sort_stats("time")
statObj.print_stats()
statObj.print_callees()
statObj.print_callers()
sys.stdout.flush()
sys.stdout.close()
del statObj
sys.stdout = priorStdOut
os.remove(statsFile)
__pluginInfo__ = {
'name': 'Profile Formula Validation',
'version': '1.0',
'description': "This plug-in adds a profiled formula validation. "
"Includes XPath compilation in the profile if it is the first validation of instance; "
"to exclude XPath compile statistics, validate first the normal way (e.g., toolbar button) "
"and then validate again using this profile formula validation plug-in. ",
'license': 'Apache-2',
'author': 'Mark V Systems Limited',
'copyright': '(c) Copyright 2012 Mark V Systems Limited, All rights reserved.',
# classes of mount points (required)
'CntlrWinMain.Menu.Validation': profileFormulaMenuEntender,
}
| [
"[email protected]"
] | |
1f9525b6078ff952fcc29b26d4a6bb1223a4dac0 | 23392f060c85b5fee645d319f2fd5560653dfd5c | /01_jumptopy/chap03/124.py | 1ee85ae3e8516ba4fe143ffe5436b7c0839cc65d | [] | no_license | heyhello89/openbigdata | 65192f381de83e4d153c072ff09fa7574f003037 | b35ff237c32013c3e5380eee782085a64edb9d80 | refs/heads/master | 2021-10-22T04:29:00.852546 | 2019-03-08T02:14:34 | 2019-03-08T02:14:34 | 125,938,319 | 0 | 0 | null | null | null | null | UHC | Python | false | false | 486 | py | # coding: cp949
prompt="""
1. 추가
2. 삭제
3. 목록
4. 종료
숫자를 입력하세요: """
number=0
while number!=4:
number=int(input(prompt))
if number==1:
print("'1. 추가' 메뉴를 선택하셨습니다.")
elif number==2:
print("'2. 삭제' 메뉴를 선택하셨습니다.")
elif number==3:
print("'3. 목록' 메뉴를 선택하셨습니다.")
elif number==4:
print("'4. 종료' 메뉴를 선택하셨습니다.")
| [
"[email protected]"
] | |
e6a331871f9ab5acab6cd7dd8eaab2051ab270f2 | 43e0cfda9c2ac5be1123f50723a79da1dd56195f | /python/paddle/distributed/auto_parallel/tuner/trial.py | 3937ca9865181f066597d4afb48ac9832f1036bd | [
"Apache-2.0"
] | permissive | jiangjiajun/Paddle | 837f5a36e868a3c21006f5f7bb824055edae671f | 9b35f03572867bbca056da93698f36035106c1f3 | refs/heads/develop | 2022-08-23T11:12:04.503753 | 2022-08-11T14:40:07 | 2022-08-11T14:40:07 | 426,936,577 | 0 | 0 | Apache-2.0 | 2022-02-17T03:43:19 | 2021-11-11T09:09:28 | Python | UTF-8 | Python | false | false | 4,766 | py | # Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Notice that the following codes are modified from KerasTuner to implement our own tuner.
# Please refer to https://github.com/keras-team/keras-tuner/blob/master/keras_tuner/engine/trial.py.
import hashlib
import random
import time
from enum import Enum
from .storable import Storable
from .recorder import MetricsRecorder
from .tunable_space import TunableSpace
class TrialStatus:
RUNNING = "RUNNING"
COMPLETED = "COMPLETED"
STOPPED = "STOPPED"
INVALID = "INVALID"
class Trial(Storable):
def __init__(self,
tunable_space,
trial_id=None,
status=TrialStatus.RUNNING):
self._id = _generate_trial_id() if trial_id is None else trial_id
self._space = tunable_space
self._recorder = MetricsRecorder()
self._score = None
self._best_step = None
self._status = status
@property
def id(self):
return self._id
@property
def space(self):
return self._space
@property
def recorder(self):
return self._recorder
@property
def score(self):
return self._score
@score.setter
def score(self, score):
self._score = score
@property
def best_step(self):
return self._best_step
@best_step.setter
def best_step(self, best_step):
self._best_step = best_step
@property
def status(self):
return self._status
@status.setter
def status(self, status):
self._status = status
def summary(self):
print("Tunable space:")
if self.space.values:
for tv, value in self.space.values.items():
print(tv + ":", value)
if self.score is not None:
print("Score: {}".format(self.score))
def get_state(self):
return {
"id": self.id,
"space": self.space.get_state(),
"recorder": self.recorder.get_state(),
"score": self.score,
"best_step": self.best_step,
"status": self.status,
}
def set_state(self, state):
self._id = state["id"]
self._space = TunableSpace.from_state(state["space"])
self._recorder = MetricsRecorder.from_state(state["recorder"])
self._score = state["score"]
self._best_step = state["best_step"]
self._status = state["status"]
@classmethod
def from_state(cls, state):
trial = cls(tunable_space=None)
trial.set_state(state)
return trial
class OptimizationTunerTrial(Trial):
def __init__(self,
config,
name,
changed_configs,
trial_id=None,
status=TrialStatus.RUNNING):
super(OptimizationTunerTrial, self).__init__(config, trial_id, status)
self._name = name
self._changed_configs = changed_configs
@property
def name(self):
return self._name
def summary(self):
spacing = 2
max_k = 38
max_v = 38
length = max_k + max_v + spacing
h1_format = " " + "|{{:^{}s}}|\n".format(length)
h2_format = " " + "|{{:>{}s}}{}{{:^{}s}}|\n".format(
max_k, " " * spacing, max_v)
border = " +" + "".join(["="] * length) + "+"
line = " +" + "".join(["-"] * length) + "+"
draws = border + "\n"
draws += h1_format.format("")
draws += h1_format.format("Tuned Configuartions Overview")
draws += h1_format.format("")
for name in self._changed_configs:
draws += border + "\n"
draws += h1_format.format("{} auto=True <-> {}".format(name, name))
draws += line + "\n"
my_configs = getattr(self.space, name)
keys = my_configs.keys()
for key in keys:
draws += h2_format.format(key, str(my_configs.get(key, None)))
result_res = draws + border
return result_res
def _generate_trial_id():
s = str(time.time()) + str(random.randint(1, int(1e7)))
return hashlib.sha256(s.encode("utf-8")).hexdigest()[:32]
| [
"[email protected]"
] | |
91dea81801c12a77130116ba0f99f0dc3c092c70 | 8a8bae1fc33dc503e55b1c6a5a67d90469331891 | /ppy_terminal/sketches/tarbell/happyplace_port/archive_code/happyplace_port_496237_20200918_110010_000.png.py | ac938a63e20845bc78d2743c10bdf4a21c29306f | [
"MIT"
] | permissive | LSturtew/generative_art | 071f168c92d2bb31b57558058d881bad6cf4d7aa | 76d98d8fa63e2c952055481d14ab53f56717b6dd | refs/heads/master | 2022-12-30T02:41:36.391487 | 2020-10-12T01:43:48 | 2020-10-12T01:43:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 9,580 | py | ################################################################################
# porting Jared Tarbell's Happy Place to Python Processing
# all credit for the algorithm goes to them
#
# code and images by Aaron Penne
# https://github.com/aaronpenne
#
# released under MIT License (https://opensource.org/licenses/MIT)
################################################################################
################################################################################
# Imports
################################################################################
# Processing mode uses Python 2.7 but I prefer Python 3.x, pull in future tools
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import with_statement
# Normal Python imports
import os
import sys
import shutil
import logging
from datetime import datetime
from collections import OrderedDict
from random import seed, shuffle, sample
################################################################################
# Globals
################################################################################
# Knobs to turn
w = 900
h = 900
use_seed = False
rand_seed = 3802806
image_file_name = 'wyeth.jpg'
num = 150 # number of friends
numpal = 212 # number of colors in palette
good_colors = []
friends = []
# Utility variables
timestamp = datetime.now().strftime('%Y%m%d_%H%M%S')
script_path = os.path.abspath(__file__)
script_name = os.path.basename(script_path)
script_ext = os.path.splitext(script_name)[1]
sketch_name = os.path.splitext(script_name)[0]
# Initialize random number generators with seed
if not use_seed:
rand_seed = int(random(99999,9999999))
randomSeed(rand_seed)
noiseSeed(rand_seed)
seed(rand_seed)
################################################################################
# Helper methods
#
# These exist here in the script instead of a separate centralized file to
# preserve portability and ability to recreate image with a single script
################################################################################
# Standardizes log formats
# ex. 2020-06-31 12:30:55 - INFO - log is better than print
logging.basicConfig(level=logging.INFO,
stream=sys.stdout,
format='%(asctime)s - %(levelname)s - %(message)s',
datefmt='%Y-%m-%d %H:%M:%S')
log = logging.getLogger(__name__)
def get_filename(counter):
"""Standardizes filename string format
ex. comet_12345_20200631_123055_001.png
"""
return '{}_{}_{}_{:03d}.png'.format(sketch_name, rand_seed, timestamp, counter)
def make_dir(path):
"""Creates dir if it does not exist"""
try:
os.makedirs(path)
except OSError:
if not os.path.isdir(path):
raise
def save_code(pg=None, path='output', counter=0):
"""Saves image and creates copy of this script"""
make_dir(path)
output_file = get_filename(counter)
output_path = os.path.join(path, output_file)
make_dir('archive_code')
src = script_path
dst = os.path.join('archive_code', output_file + script_ext)
shutil.copy(src, dst)
def save_graphic(pg=None, path='output', counter=0):
"""Saves image and creates copy of this script"""
make_dir(path)
output_file = get_filename(counter)
output_path = os.path.join(path, output_file)
if pg:
pg.save(output_path)
else:
save(output_path)
log.info('Saved to {}'.format(output_path))
def color_tuple(c, color_space='HSB', rounded=True):
"""Takes color (Processing datatype) and returns human readable tuple."""
if color_space == 'HSB':
c_tuple = (hue(c), saturation(c), brightness(c), alpha(c))
if color_space == 'RGB':
c_tuple = (red(c), green(c), blue(c), alpha(c))
if rounded:
c_tuple = (round(c_tuple[0]), round(c_tuple[1]), round(c_tuple[2]), round(c_tuple[3]))
return c_tuple
def extract_colors(img_filename, max_colors=100, randomize=True):
"""Extracts unique pixels from a source image to create a color palette.
If randomize=False then the image is sampled left to right, then top to bottom.
"""
colors_list = []
img = loadImage(img_filename)
img.loadPixels()
if randomize:
shuffle(img.pixels)
num_colors = 0
for i,c in enumerate(img.pixels):
# only grab new colors (no repeats)
if color_tuple(c) not in [color_tuple(gc) for gc in colors_list]:
colors_list.append(c)
num_colors += 1
if num_colors == max_colors:
break
return colors_list
def sort_color_hues(colors_list, sort_on='hsb'):
"""Takes list of colors (Processing datatype) and sorts the list on hue"""
colors_tuples = [color_tuple(c) for c in colors_list]
if sort_on == 'hsb':
colors = sorted(zip(colors_tuples, colors_list), key=lambda x: (x[0][0], x[0][1], x[0][2]))
if sort_on == 'bsh':
colors = sorted(zip(colors_tuples, colors_list), key=lambda x: (x[0][2], x[0][1], x[0][0]))
return [c for _,c in colors]
def some_color():
return good_colors[int(random(numpal))]
def reset_all():
global friends
for i in range(num):
fx = w/2 + 0.4*w*cos(TAU*i/num)
fy = h/2 + 0.4*h*sin(TAU*i/num)
friends[i] = Friend(fx, fy, i)
for i in range(int(num*2.2)):
a = int(floor(random(num)))
b = int(floor(a+random(22))%num)
if (b >= num) or (b < 0):
b = 0
print('+')
if a != b:
friends[a].connect_to(b)
friends[b].connect_to(a)
print('{} made friends with {}'.format(a,b))
################################################################################
# Setup
################################################################################
def setup():
size(w, h)
colorMode(HSB, 360, 100, 100, 100)
#colorMode(HSB)
strokeWeight(2)
global good_colors
good_colors = extract_colors(image_file_name, numpal)
background(0, 0, 100)
frameRate(30)
global friends
friends = [Friend() for i in range(num)]
print(len(friends))
reset_all()
save_code(None, 'output', frameCount)
#noLoop()
################################################################################
# Draw
################################################################################
def draw():
#for c in good_colors:
# print(color_tuple(c))
for f in friends:
f.move()
for f in friends:
f.expose()
f.expose_connections()
for f in friends:
f.find_happy_place()
if frameCount % 200 == 0:
save_graphic(None, 'output', frameCount)
if frameCount % 20 == 0:
print(frameCount, frameRate)
#exit()
def mousePressed():
save_graphic(None, 'output', frameCount)
class Friend:
def __init__(self, x=0, y=0, identifier=0):
self.x = x
self.y = y
self.vx = 0
self.vy = 0
self.id = identifier
self.numcon = 0
self.maxcon = 10
self.lencon = 10+int(random(500))
self.connections = [0 for i in range(self.maxcon)]
self.myc = some_color()
self.myc = color(hue(self.myc), saturation(self.myc), brightness(self.myc), 5)
self.numsands = 3
self.sands = [SandPainter() for i in range(self.numsands)]
def connect_to(self, f):
if (self.numcon < self.maxcon):
if not self.friend_of(f):
self.connections[self.numcon] = f
self.numcon += 1
def friend_of(self, f):
#FIXME possibly replace with simple is in?
is_friend = False
for i in range(self.numcon):
if self.connections[i] == f:
is_friend = True
return is_friend
def expose(self):
for dx in range(-1,2):
a = 0.5-abs(dx)/5
stroke(0, 0, 0, 100*a)
point(self.x+dx, self.y)
stroke(0, 0, 100, 100*a)
point(self.x+dx-1, self.y-1)
for dy in range(-1,2):
a = 0.5-abs(dy)/5
stroke(0, 0, 0, 100*a)
point(self.x, self.y+dy)
stroke(0, 0, 100, 100*a)
point(self.x-1, self.y+dy-1)
def expose_connections(self):
stroke(self.myc)
for i in range(self.numcon):
ox = friends[self.connections[i]].x
oy = friends[self.connections[i]].y
#line(self.x, self.y, ox, oy)
for s in range(self.numsands):
self.sands[s].render(self.x, self.y, ox, oy)
def find_happy_place(self):
# self.vx += random(-w*0.001, w*0.001)
# self.vy += random(-h*0.001, h*0.001)
ax = 0
ay = 0
for n in range(num):
if friends[n] <> this:
ddx = friends[n].x - self.x
ddy = friends[n].y - self.y
d = sqrt(ddx*ddx + ddy*ddy)
t = atan2(ddy, ddx)
friend = False
for j in range(self.numcon):
if self.connections[j]==n:
friend=True
if friend:
# attract
if (d>self.lencon):
ax += 4*cos(t)
ay += 4*sin(t)
self.vx += ax/80
self.vy += ay/80
def move(self):
self.x += self.vx
self.y += self.vy
self.vx *= 0.97
self.vy *= 0.97
class SandPainter:
def __init__(self):
self.p = random(1)
self.c = some_color()
self.g = random(0.01, 0.1)
def render(self, x, y, ox, oy):
stroke(hue(self.c), saturation(self.c), brightness(self.c), 10)
point(ox + (x-ox)*sin(self.p), oy+(y-oy)*sin(self.p))
self.g += random(-0.05, 0.05)
maxg = 0.22
if (self.g < -maxg):
self.g = -maxg
if (self.g > maxg):
self.g = maxg
w = self.g/10
for i in range(11):
a = 0.1 - i/110
stroke(hue(self.c), saturation(self.c), brightness(self.c), 100*a)
point(ox+(x-ox)*sin(self.p+sin(i*w)), oy+(y-oy)*sin(self.p+sin(i*w)))
point(ox+(x-ox)*sin(self.p-sin(i*w)), oy+(y-oy)*sin(self.p-sin(i*w)))
| [
"[email protected]"
] | |
10bd6fbd6e7f9ba2be09ca378ab0c7fcfca3e1fc | d2fe80fba383f3debee17d8c360b411498069d81 | /bin/osh_eval.py | 9fe39643a646597057e0eebf84dcf4a9e058f6c0 | [] | no_license | stevenworthington/oil | 7c6bfb20f5dc9485da28c6285e0f909a644316b9 | 721e5da392a8ae02e1af4acf03cb76900946ec29 | refs/heads/master | 2022-11-07T16:34:54.883277 | 2020-06-15T17:03:02 | 2020-06-15T17:29:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 12,045 | py | #!/usr/bin/env python2
"""
osh_eval.py
"""
from __future__ import print_function
import sys
from _devbuild.gen.option_asdl import builtin_i
from _devbuild.gen.syntax_asdl import (source, source_t)
from asdl import format as fmt
from asdl import runtime
from core import alloc
from core import dev
from core import error
# Still has too many deps
#from core import main as main_
from core import main_loop
from core import meta
from core import optview
from core import pyutil
from core.util import log
from core import util
from core.util import e_die
from core import state
from core import ui
from core import vm
from frontend import args
from frontend import consts
from frontend import flag_def # side effect: flags are defined!
_ = flag_def
from frontend import parse_lib
from frontend import reader
from mycpp import mylib
from osh import split
from osh import builtin_assign
from osh import builtin_meta
from osh import builtin_pure
from osh import builtin_printf
from osh import builtin_bracket
from osh import builtin_process # not translated yet
# - note: history has readline_mod argument
from osh import builtin_misc
# Depends on core/completion.py
# _FlagSpecAndMore needs translating
#from osh import builtin_comp
# Evaluators
from osh import cmd_eval
from osh import sh_expr_eval
from osh import word_eval
from osh import prompt
import posix_ as posix
from typing import List, Dict, Tuple, Optional, TYPE_CHECKING
if TYPE_CHECKING:
from _devbuild.gen.syntax_asdl import command__ShFunction
from _devbuild.gen.runtime_asdl import cmd_value__Argv
from core.state import MutableOpts
from core.vm import _AssignBuiltin
from pgen2.grammar import Grammar
if mylib.PYTHON:
unused1 = log
unused2 = args
unused3 = builtin_process
def Parse(argv):
# type: (List[str]) -> Tuple[int, bool, Optional[str], bool]
"""
returns the -n and -c value
"""
i = 0
flag_a = True
flag_c = None # type: str
flag_n = False
n = len(argv)
while i < n:
if argv[i] == '-n':
flag_n = True
elif argv[i] == '-a':
if i >= n:
raise AssertionError(argv)
i += 1
if argv[i] == "none":
flag_a = False
elif argv[i] == '-c':
if i >= n:
raise AssertionError(argv)
i += 1
flag_c = argv[i]
else:
break
i += 1
return i, flag_a, flag_c, flag_n
def main(argv):
# type: (List[str]) -> int
arena = alloc.Arena()
dollar0 = argv[0]
debug_stack = [] # type: List[state.DebugFrame]
argv = argv[1:] # remove binary name
i, flag_a, flag_c, flag_n = Parse(argv)
argv = argv[i:] # truncate
mem = state.Mem(dollar0, argv, arena, debug_stack)
# TODO: look at extern char** environ;
environ = {} # type: Dict[str, str]
environ['PWD'] = posix.getcwd()
state.InitMem(mem, environ, 'VERSION')
opt_hook = state.OptHook()
parse_opts, exec_opts, mutable_opts = state.MakeOpts(mem, opt_hook)
# Dummy value; not respecting aliases!
aliases = {} # type: Dict[str, str]
# parse `` and a[x+1]=bar differently
oil_grammar = None # type: Grammar
if mylib.PYTHON:
loader = pyutil.GetResourceLoader()
oil_grammar = meta.LoadOilGrammar(loader)
parse_ctx = parse_lib.ParseContext(arena, parse_opts, aliases, oil_grammar)
if flag_c:
# This path is easier to run through GDB
line_reader = reader.StringLineReader(flag_c, arena)
src = source.CFlag() # type: source_t
elif len(argv) == 0:
line_reader = reader.FileLineReader(mylib.Stdin(), arena)
src = source.Stdin('')
elif len(argv) == 1:
path = argv[0]
f = mylib.open(path)
line_reader = reader.FileLineReader(f, arena)
src = source.MainFile(path)
else:
raise AssertionError(argv)
arena.PushSource(src)
c_parser = parse_ctx.MakeOshParser(line_reader)
# C++ doesn't have the abbreviations yet (though there are some differences
# like omitting spids)
#tree = node.AbbreviatedTree()
if flag_n:
try:
node = main_loop.ParseWholeFile(c_parser)
except error.Parse as e:
ui.PrettyPrintError(e, arena)
return 2
assert node is not None
if flag_a:
tree = node.PrettyTree()
ast_f = fmt.DetectConsoleOutput(mylib.Stdout())
fmt.PrintTree(tree, ast_f)
ast_f.write('\n')
return 0
# New osh_eval.py instantiations
errfmt = ui.ErrorFormatter(arena)
splitter = split.SplitContext(mem)
arith_ev = sh_expr_eval.ArithEvaluator(mem, exec_opts, parse_ctx, errfmt)
bool_ev = sh_expr_eval.BoolEvaluator(mem, exec_opts, parse_ctx, errfmt)
word_ev = word_eval.NormalWordEvaluator(mem, exec_opts, splitter, errfmt)
prompt_ev = prompt.Evaluator('osh', parse_ctx, mem)
arith_ev.word_ev = word_ev
word_ev.arith_ev = arith_ev
word_ev.prompt_ev = prompt_ev
prompt_ev.word_ev = word_ev
procs = {} # type: Dict[str, command__ShFunction]
assign_builtins = {} # type: Dict[int, _AssignBuiltin]
new_var = builtin_assign.NewVar(mem, procs, errfmt)
assign_builtins[builtin_i.declare] = new_var
assign_builtins[builtin_i.typeset] = new_var
assign_builtins[builtin_i.local] = new_var
assign_builtins[builtin_i.export_] = builtin_assign.Export(mem, errfmt)
assign_builtins[builtin_i.readonly] = builtin_assign.Readonly(mem, errfmt)
#assign_builtins = {
# # ShAssignment (which are pure)
# builtin_i.declare: new_var,
# builtin_i.typeset: new_var,
# builtin_i.local: new_var,
# builtin_i.export_: builtin_assign.Export(mem, errfmt),
# builtin_i.readonly: builtin_assign.Readonly(mem, errfmt),
#}
cmd_deps = cmd_eval.Deps()
cmd_deps.mutable_opts = mutable_opts
cmd_deps.traps = {}
cmd_deps.trap_nodes = [] # TODO: Clear on fork() to avoid duplicates
cmd_deps.dumper = dev.CrashDumper('')
search_path = state.SearchPath(mem)
builtins = {} # type: Dict[int, vm._Builtin]
builtins[builtin_i.echo] = builtin_pure.Echo(exec_opts)
builtins[builtin_i.set] = Set(mutable_opts) # DUMMY until ParseMore()
if mylib.PYTHON:
# Use the real one
builtins[builtin_i.set] = builtin_pure.Set(mutable_opts, mem)
builtins[builtin_i.shopt] = builtin_pure.Shopt(mutable_opts)
builtins[builtin_i.alias] = builtin_pure.Alias(aliases, errfmt)
builtins[builtin_i.unalias] = builtin_pure.UnAlias(aliases, errfmt)
builtins[builtin_i.hash] = builtin_pure.Hash(search_path)
builtins[builtin_i.getopts] = builtin_pure.GetOpts(mem, errfmt)
builtins[builtin_i.shift] = builtin_assign.Shift(mem)
builtins[builtin_i.unset] = builtin_assign.Unset(
mem, exec_opts, procs, parse_ctx, arith_ev, errfmt)
true_ = builtin_pure.Boolean(0)
builtins[builtin_i.colon] = true_ # a "special" builtin
builtins[builtin_i.true_] = true_
builtins[builtin_i.false_] = builtin_pure.Boolean(1)
# builtin_meta
builtins[builtin_i.type] = builtin_meta.Type(procs, aliases, search_path, errfmt)
shell_ex = NullExecutor(exec_opts, mutable_opts, procs, builtins)
trace_f = util.DebugFile(mylib.Stderr())
tracer = dev.Tracer(parse_ctx, exec_opts, mutable_opts, mem, word_ev, trace_f)
cmd_ev = cmd_eval.CommandEvaluator(mem, exec_opts, errfmt, procs,
assign_builtins, arena, cmd_deps)
# TODO: can't instantiate this yet
#fd_state = None
# needs cmd_ev
builtins[builtin_i.eval] = builtin_meta.Eval(parse_ctx, exec_opts, cmd_ev)
#source_builtin = builtin_meta.Source(
# parse_ctx, search_path, cmd_ev, fd_state, errfmt)
#builtins[builtin_i.source] = source_builtin
#builtins[builtin_i.dot] = source_builtin
builtins[builtin_i.builtin] = builtin_meta.Builtin(shell_ex, errfmt)
builtins[builtin_i.command] = builtin_meta.Command(shell_ex, procs, aliases,
search_path)
builtins[builtin_i.printf] = builtin_printf.Printf(mem, parse_ctx, errfmt)
builtins[builtin_i.test] = builtin_bracket.Test(False, exec_opts, mem, errfmt)
builtins[builtin_i.bracket] = builtin_bracket.Test(True, exec_opts, mem, errfmt)
dir_stack = state.DirStack()
builtins[builtin_i.pushd] = builtin_misc.Pushd(mem, dir_stack, errfmt)
builtins[builtin_i.popd] = builtin_misc.Popd(mem, dir_stack, errfmt)
builtins[builtin_i.dirs] = builtin_misc.Dirs(mem, dir_stack, errfmt)
builtins[builtin_i.pwd] = builtin_misc.Pwd(mem, errfmt)
builtins[builtin_i.times] = builtin_misc.Times()
builtins[builtin_i.read] = builtin_misc.Read(splitter, mem)
builtins[builtin_i.cat] = builtin_misc.Cat() # for $(<file)
builtins[builtin_i.cd] = builtin_misc.Cd(mem, dir_stack, cmd_ev, errfmt)
# vm.InitCircularDeps
cmd_ev.arith_ev = arith_ev
cmd_ev.bool_ev = bool_ev
cmd_ev.word_ev = word_ev
cmd_ev.tracer = tracer
cmd_ev.shell_ex = shell_ex
shell_ex.cmd_ev = cmd_ev
bool_ev.word_ev = word_ev
try:
status = main_loop.Batch(cmd_ev, c_parser, arena,
cmd_flags=cmd_eval.IsMainProgram)
except util.UserExit as e:
# TODO: fix this
#status = e.status
status = 1
return status
class Set(vm._Builtin):
def __init__(self, mutable_opts):
# type: (MutableOpts) -> None
self.mutable_opts = mutable_opts
def Run(self, cmd_val):
# type: (cmd_value__Argv) -> int
argv = cmd_val.argv
if len(argv) != 3:
#log('shopt %s', argv)
log('set %d', len(argv))
return 1
b = (argv[1] == '-o')
opt_name = argv[2]
self.mutable_opts.SetOption(opt_name, b)
return 0
class NullExecutor(vm._Executor):
def __init__(self, exec_opts, mutable_opts, procs, builtins):
# type: (optview.Exec, state.MutableOpts, Dict[str, command__ShFunction], Dict[int, vm._Builtin]) -> None
self.exec_opts = exec_opts
self.mutable_opts = mutable_opts
self.procs = procs
self.builtins = builtins
self.cmd_ev = None # type: cmd_eval.CommandEvaluator
def RunBuiltin(self, builtin_id, cmd_val):
# type: (int, cmd_value__Argv) -> int
"""Run a builtin. Also called by the 'builtin' builtin."""
builtin_func = self.builtins[builtin_id]
try:
status = builtin_func.Run(cmd_val)
except error.Usage as e:
status = 2
finally:
pass
return status
def RunSimpleCommand(self, cmd_val, do_fork, call_procs=True):
# type: (cmd_value__Argv, bool, bool) -> int
argv = cmd_val.argv
span_id = cmd_val.arg_spids[0] if cmd_val.arg_spids else runtime.NO_SPID
arg0 = argv[0]
builtin_id = consts.LookupSpecialBuiltin(arg0)
if builtin_id != consts.NO_INDEX:
return self.RunBuiltin(builtin_id, cmd_val)
func_node = self.procs.get(arg0)
if func_node is not None:
if (self.exec_opts.strict_errexit() and
self.mutable_opts.errexit.SpidIfDisabled() != runtime.NO_SPID):
# NOTE: This would be checked below, but this gives a better error
# message.
e_die("can't disable errexit running a function. "
"Maybe wrap the function in a process with the at-splice "
"pattern.", span_id=span_id)
# NOTE: Functions could call 'exit 42' directly, etc.
status = self.cmd_ev.RunProc(func_node, argv[1:])
return status
builtin_id = consts.LookupNormalBuiltin(arg0)
if builtin_id != consts.NO_INDEX:
return self.RunBuiltin(builtin_id, cmd_val)
# See how many tests will pass
if mylib.PYTHON:
import subprocess
try:
status = subprocess.call(cmd_val.argv)
except OSError as e:
log('Error running %s: %s', cmd_val.argv, e)
return 1
return status
log('Unhandled SimpleCommand')
f = mylib.Stdout()
#ast_f = fmt.DetectConsoleOutput(f)
# Stupid Eclipse debugger doesn't display ANSI
ast_f = fmt.TextOutput(f)
tree = cmd_val.PrettyTree()
ast_f.FileHeader()
fmt.PrintTree(tree, ast_f)
ast_f.FileFooter()
ast_f.write('\n')
return 0
if __name__ == '__main__':
try:
status = main(sys.argv)
except RuntimeError as e:
print('FATAL: %s' % e, file=sys.stderr)
status = 1
sys.exit(status)
| [
"[email protected]"
] | |
019b27e9cca1e38504aa2f88a847103c2a28ba29 | d767a2048c050421e7213be2ecccff09014e270e | /Day 31/Median(Hackerrank).py | 003a4c1716d6c06f3cb5f09b0a631babc3e5b208 | [] | no_license | Benson1198/31-Days-of-CP | 23ff16f9899d37e2ca9a1eba81a87b521233fd2f | 0e5de1d0b4e1d4811fb096455de951f37c3d69d0 | refs/heads/master | 2022-09-18T22:26:53.178381 | 2020-06-03T14:20:41 | 2020-06-03T14:20:41 | 260,527,724 | 2 | 1 | null | 2020-05-04T17:36:36 | 2020-05-01T18:15:21 | Python | UTF-8 | Python | false | false | 101 | py | n = int(input())
arr = [int(y) for y in input().split()]
arr.sort()
mid = (n/2)
print(arr[int(mid)]) | [
"[email protected]"
] | |
ff56e6a71796c367dacdf9136d62cb7bbd047cc4 | ca9152cf5adf7c38867aad2fb8ca4d2747149c84 | /src/pytorch_metric_learning/losses/triplet_margin_loss.py | 9e7843bcc5bc24db1cc148eaf81d0060454c7e81 | [
"MIT"
] | permissive | Bobo-y/pytorch-metric-learning | 91d14dec18b988f5acc153c8205e85e069cbc548 | dff4ae570db89dcb59a102f13f665502f9c1c7c6 | refs/heads/master | 2023-04-15T21:01:16.115250 | 2021-04-03T02:44:16 | 2021-04-03T02:44:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,110 | py | import torch
from ..reducers import AvgNonZeroReducer
from ..utils import loss_and_miner_utils as lmu
from .base_metric_loss_function import BaseMetricLossFunction
class TripletMarginLoss(BaseMetricLossFunction):
"""
Args:
margin: The desired difference between the anchor-positive distance and the
anchor-negative distance.
swap: Use the positive-negative distance instead of anchor-negative distance,
if it violates the margin more.
smooth_loss: Use the log-exp version of the triplet loss
"""
def __init__(
self,
margin=0.05,
swap=False,
smooth_loss=False,
triplets_per_anchor="all",
**kwargs
):
super().__init__(**kwargs)
self.margin = margin
self.swap = swap
self.smooth_loss = smooth_loss
self.triplets_per_anchor = triplets_per_anchor
self.add_to_recordable_attributes(list_of_names=["margin"], is_stat=False)
def compute_loss(self, embeddings, labels, indices_tuple):
indices_tuple = lmu.convert_to_triplets(
indices_tuple, labels, t_per_anchor=self.triplets_per_anchor
)
anchor_idx, positive_idx, negative_idx = indices_tuple
if len(anchor_idx) == 0:
return self.zero_losses()
mat = self.distance(embeddings)
ap_dists = mat[anchor_idx, positive_idx]
an_dists = mat[anchor_idx, negative_idx]
if self.swap:
pn_dists = mat[positive_idx, negative_idx]
an_dists = self.distance.smallest_dist(an_dists, pn_dists)
current_margins = self.distance.margin(an_dists, ap_dists)
if self.smooth_loss:
loss = torch.log(1 + torch.exp(-current_margins))
else:
loss = torch.nn.functional.relu(-current_margins + self.margin)
return {
"loss": {
"losses": loss,
"indices": indices_tuple,
"reduction_type": "triplet",
}
}
def get_default_reducer(self):
return AvgNonZeroReducer()
| [
"[email protected]"
] | |
d1e50c76f375ed530a5863b29ab5b7398e27d129 | 75bb552fa497bbce4b179c2c9e22d88f0428ff43 | /mogu/content.py | eed3a9cbf69d6ca26a8b09c4629d66deec1134e2 | [] | no_license | Mamata2507/mogu2 | 7725558abc74bfffbee98a959694288e48859a71 | b28b34f0c9ce7a86b81551e4362d2cae55e28322 | refs/heads/master | 2023-03-17T16:57:51.513507 | 2013-03-25T13:03:02 | 2013-03-25T13:03:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 8,930 | py | #coding=utf-8
#
from datetime import datetime, timedelta
__author__ = u'王健'
import logging
import string
from mogu.login import login_required
from mogu.models.model import ContentClass
from google.appengine.ext import db
from tools.page import Page
from tools.util import replaceStr, getLevelByCode, AutoCode, getMainCode, getReplyCode, getPageing
class ContentAdd(Page):
@login_required
def get(self):
father = self.request.get('father')
prev = self.request.get('prev')
next = self.request.get('next')
prevValue = self.request.get('prevValue')
page = self.request.get('page_id')
if(prevValue != '' and prev==''):#分页后下一页调用
prev = prevValue
newAddCode = AutoCode(father,prev,next)
if self.request.get('isReply'):
newAddCode = getReplyCode(newAddCode)#为编号加特殊标记's',newAddCode有's'则直接返回
if int(getLevelByCode(newAddCode))==1:#父类层,maincode与code相同
maincode = newAddCode
father = ''
if int(getLevelByCode(newAddCode))>=2:
maincode = getMainCode(newAddCode)
template_values = {"newAddCode":newAddCode,"maincode":maincode,"father":father,"page":page,'isReply':self.request.get('isReply')}
self.render('template/content/contentAdd.html',template_values)
@login_required
def post(self):
page = self.request.get('page_Id')
father = replaceStr(self.request.get('father'))
code=replaceStr(self.request.get('code'))
if not ContentClass.get_by_key_name(code):
content = ContentClass(key_name=code)
content.maincode = replaceStr(self.request.get('maincode'))
content.title = replaceStr(self.request.get('title'))
content.content = replaceStr(self.request.get('content'),'[()]')
content.updateSpanTime = replaceStr(self.request.get('updateSpanTime'))
content.father = father
content.userName = replaceStr(self.request.get('userName'))
content.replyType = replaceStr(self.request.get('replyType'))
content.level = getLevelByCode(code)
content.status = "1"
content.put()
logging.info(content.key().name())
self.redirect('/contentList/%s?father=%s' %(page,father))
else:
self.redirect(self.request.environ['HTTP_REFERER'])
class ContentUpdate(Page):
@login_required
def get(self):
contentCode = self.request.get('contentCode')
index = self.request.get('page_id')
father = self.request.get('father')
if index=="":
index='0'
index = string.atoi(index)
contentList = []
contents=ContentClass.get_by_key_name(contentCode)
template_values={"cList":contents,"index":index,"father":father,}
self.render('template/content/contentUpdate.html', template_values)
# self.render('html/contentManage/contentUpdate.html', template_values)
@login_required
def post(self):
pageId = self.request.get('page_id')
father = self.request.get('father')
code=self.request.get('code')
content = ContentClass.get_by_key_name(code)
if content:
content.title = replaceStr(self.request.get('title'))
content.content = replaceStr(self.request.get('content'),'[()]')
content.updateSpanTime = replaceStr(self.request.get('updateSpanTime'))
content.status = replaceStr(self.request.get('status'))
content.userName = replaceStr(self.request.get('userName'))
content.replyType = replaceStr(self.request.get('replyType'))
content.put()
self.redirect('/contentList/%s?father=%s' %(pageId,father))
class ContentDelete(Page):
@login_required
def get(self):
contentCode = self.request.get('contentCode')
pageId = self.request.get('page_id')
father = self.request.get('father')
content=ContentClass.get_by_key_name(contentCode)
if content.status == '1':
content.status = '0'
content.put()
contentList=findChildNodes(content.key().name())
db.delete(contentList)
self.redirect('/contentList/%s?father=%s' %(pageId,father))
def findChildNodes(code,status=None):
if status:
return ContentClass.all().filter('status =',status).filter('__key__ >',ContentClass(key_name=code+'-').key()).filter('__key__ <',ContentClass(key_name=code+u"-\ufffd").key())
else:
return ContentClass.all().filter('__key__ >',ContentClass(key_name=code+'-').key()).filter('__key__ <',ContentClass(key_name=code+u"-\ufffd").key())
def findFather(father):
fatherCodeList = []
fList = ''
father_list = father.split('-')
for i in range(len(father_list)):
fList = fList + father_list[i]
fatherCodeList.append(fList)
fList = fList+"-"
if father and fatherCodeList:
return ContentClass.get_by_key_name(fatherCodeList)
else:
return []
# for i in range(len(fatherCodeList)):
# if ( fatherCodeList[i].find('s')!=-1):
# replyContents = db.GqlQuery("SELECT * FROM ReplyContent WHERE code=:1 ",fatherCodeList[i])
# for replyContent in replyContents:
# fatherList.append(replyContent)
# else:
# contents = db.GqlQuery("SELECT * FROM ContentClass WHERE code=:1 ",fatherCodeList[i])
# for content in contents:
# fatherList.append(content)
# return fatherList
class ContentList(Page):
@login_required
def get(self,page):
prevValue = self.request.get('prevValue')
father = self.request.get('father')
if father =='':
level = '1'
contents=ContentClass.all().filter('level =',level).order('__key__')
#contents = db.GqlQuery("SELECT * FROM ContentClass WHERE level = :1 ORDER BY code ASC", level)
totalcount=contents.count(limit=1000000)
else:
level = str(int(getLevelByCode(father))+1)
contents=ContentClass.all().filter('father =',father).order('__key__')
#contents = db.GqlQuery("SELECT * FROM ContentClass WHERE father=:1 ORDER BY code ASC",father)
totalcount=contents.count(limit=1000000)
if level=='5':
level = None
fatherList = findFather(father)
index=0 if page=="" else int(page)
num=0 if index==0 else 1
contents = contents.fetch(16+2^num,index*16-num)
count=len(contents)
for i in range(count):
p,n=None,None
c=contents[i]
if i<count-1:
n=contents[i+1]
if i!=0:
p=contents[i-1]
if p:
c.prev=p.key().name()
if n:
c.next=n.key().name()
if num==1:
contents=contents[1:17]
else:
contents=contents[0:16]
if index!=0:
if len(contents)==0:
self.redirect('/contentList/%s?father=%s' %(index-1,father))
prev,next=None,None
if len(contents)>0:
if contents[0].__dict__.has_key('prev') :
prev=contents[0].prev
else:
prev=None
next=str(contents[0].key().name())
prevpage,nextpage=getPageing(len(contents), index)
template_values = {"contents":contents,"contentlength":len(contents),"fatherList":fatherList,"prev":prev,"next":next,"prevpage":prevpage,"nextpage":nextpage,"index":index,"father":father,"level":level,"prevValue":prevValue,'lastpage':totalcount/16}
self.render('template/content/zxlist.html',template_values)
#self.render('html/contentManage/contentList.html',template_values)
@login_required
def post(self,page):
father = self.request.get('hidden')
prev = self.request.get('prev')
code = self.request.get('code')
next = self.request.get('next')
prevValue = self.request.get('prevValue')
if self.request.get('do')==u'插入':
next=code
if self.request.get('do')==u'添加':
prev=code
if not code:
prev=self.request.get('prevcode')
next=self.request.get('nextcode')
self.redirect('/contentAdd?father=%s&prev=%s&next=%s&prevValue=%s&page_id=%s' %(father,prev,next,prevValue,page))
class DeleteContentTimeOut(Page):
def get(self):
#datetime.now()+timedelta(hours=-10)
t1=datetime.now()+timedelta(hours=-241)
for con in ContentClass.all().filter('status =','0').fetch(60):
if (t1-con.lastUpdateTime).days>=10:
con.delete()
# pass
# db.delete(ContentClass.all().filter('status =','0').filter('lastUpdateTime <',datetime.now()+timedelta(hours=-240)).fetch(30))
# t1=timedelta(9, 86383, 314441).
# t1 | [
"[email protected]"
] | |
06f580e8601734f21702378de0b414ab38485f97 | ca7aa979e7059467e158830b76673f5b77a0f5a3 | /Python_codes/p02271/s017858399.py | b1332bc0fcd0f6a8c679f83cab6e08e303625121 | [] | 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 | 956 | py | from itertools import repeat
from itertools import combinations
def rec(s, i, total, m):
if total == m:
return 1
if len(s) == i or total > m:
return 0
return rec(s, i + 1, total, m) + rec(s, i + 1, total + s[i], m)
def makeCache(s):
cache = {}
for i in range(len(s)):
comb = list(combinations(s, i))
for c in comb:
cache[sum(c)] = 1
return cache
def loop(s, m):
for i in range(len(s)):
comb = list(combinations(s, i))
for c in comb:
if sum(c) == m:
return 1
return 0
if __name__ == "__main__":
n = int(input())
a = [int (x) for x in input().split()]
q = int(input())
m = [int (x) for x in input().split()]
s = makeCache(a)
for i in m:
#print("yes") if rec(a, 0, 0, i) > 0 else print("no")
#print("yes") if loop(a, i) > 0 else print("no")
print("yes") if i in s else print("no")
| [
"[email protected]"
] | |
a5756844ed7ffefe8846c9c06add82ab2a62d5f5 | a90dc9c18177b0fbb59fca1e64aa4b1f502ed30e | /hail/python/hailtop/utils/utils.py | 0fab5e0c0dafbed298045d5f46a1f83a60eb5bdc | [] | no_license | hail-ci-test/ci-test-bsagfqddmkzj | 245780191c59c68f29ffb15cb3fb8a2297434773 | d4024384372c7fbac03592baf8e1c353135d9fc0 | refs/heads/master | 2023-02-21T12:53:51.750549 | 2021-01-25T18:18:41 | 2021-01-25T18:18:41 | 332,841,053 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 18,182 | py | from typing import Callable, TypeVar, Awaitable
import traceback
import os
import errno
import random
import logging
import asyncio
import aiohttp
from aiohttp import web
import urllib
import urllib3
import secrets
import socket
import requests
import google.auth.exceptions
import time
import weakref
from requests.adapters import HTTPAdapter
from urllib3.poolmanager import PoolManager
from .time import time_msecs
log = logging.getLogger('hailtop.utils')
RETRY_FUNCTION_SCRIPT = """function retry() {
"$@" ||
(sleep 2 && "$@") ||
(sleep 5 && "$@");
}"""
def flatten(xxs):
return [x for xs in xxs for x in xs]
def first_extant_file(*files):
for f in files:
if f is not None and os.path.isfile(f):
return f
return None
def cost_str(cost):
if cost is None:
return None
return f'${cost:.4f}'
def secret_alnum_string(n=22, *, case=None):
# 22 characters is math.log(62 ** 22, 2) == ~130 bits of randomness. OWASP
# recommends at least 128 bits:
# https://owasp.org/www-community/vulnerabilities/Insufficient_Session-ID_Length
numbers = '0123456789'
upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
lower = 'abcdefghijklmnopqrstuvwxyz'
if case is None:
alphabet = numbers + upper + lower
elif case == 'upper':
alphabet = numbers + upper
elif case == 'lower':
alphabet = numbers + lower
elif case == 'numbers':
alphabet = numbers
else:
raise ValueError(f'invalid argument for case {case}')
return ''.join([secrets.choice(alphabet) for _ in range(n)])
def digits_needed(i: int):
assert i >= 0
if i < 10:
return 1
return 1 + digits_needed(i // 10)
def grouped(n, ls):
while len(ls) != 0:
group = ls[:n]
ls = ls[n:]
yield group
def partition(k, ls):
if k == 0:
assert not ls
return []
assert ls
assert k > 0
n = len(ls)
parts = [(n - i + k - 1) // k for i in range(k)]
assert sum(parts) == n
assert max(parts) - min(parts) <= 1
def generator():
start = 0
for part in parts:
yield ls[start:start + part]
start += part
return generator()
def unzip(lst):
a = []
b = []
for x, y in lst:
a.append(x)
b.append(y)
return a, b
def async_to_blocking(coro):
return asyncio.get_event_loop().run_until_complete(coro)
async def blocking_to_async(thread_pool, fun, *args, **kwargs):
return await asyncio.get_event_loop().run_in_executor(
thread_pool, lambda: fun(*args, **kwargs))
async def bounded_gather(*pfs, parallelism=10, return_exceptions=False):
gatherer = AsyncThrottledGather(*pfs,
parallelism=parallelism,
return_exceptions=return_exceptions)
return await gatherer.wait()
class AsyncThrottledGather:
def __init__(self, *pfs, parallelism=10, return_exceptions=False):
self.count = len(pfs)
self.n_finished = 0
self._queue = asyncio.Queue()
self._done = asyncio.Event()
self._return_exceptions = return_exceptions
self._results = [None] * len(pfs)
self._errors = []
self._workers = []
for _ in range(parallelism):
self._workers.append(asyncio.ensure_future(self._worker()))
for i, pf in enumerate(pfs):
self._queue.put_nowait((i, pf))
def _cancel_workers(self):
for worker in self._workers:
try:
worker.cancel()
except Exception:
pass
async def _worker(self):
while True:
i, pf = await self._queue.get()
try:
res = await pf()
except asyncio.CancelledError: # pylint: disable=try-except-raise
raise
except Exception as err: # pylint: disable=broad-except
res = err
if not self._return_exceptions:
self._errors.append(err)
self._done.set()
return
self._results[i] = res
self.n_finished += 1
if self.n_finished == self.count:
self._done.set()
async def wait(self):
try:
if self.count > 0:
await self._done.wait()
finally:
self._cancel_workers()
if self._errors:
raise self._errors[0]
return self._results
class AsyncWorkerPool:
def __init__(self, parallelism, queue_size=1000):
self._queue = asyncio.Queue(maxsize=queue_size)
self.workers = weakref.WeakSet([
asyncio.ensure_future(self._worker())
for _ in range(parallelism)])
async def _worker(self):
while True:
f, args, kwargs = await self._queue.get()
try:
await f(*args, **kwargs)
except asyncio.CancelledError: # pylint: disable=try-except-raise
raise
except Exception: # pylint: disable=broad-except
log.exception('worker pool caught exception')
async def call(self, f, *args, **kwargs):
await self._queue.put((f, args, kwargs))
def call_nowait(self, f, *args, **kwargs):
self._queue.put_nowait((f, args, kwargs))
def shutdown(self):
for worker in self.workers:
try:
worker.cancel()
except Exception:
pass
class WaitableSharedPool:
def __init__(self, worker_pool):
self._worker_pool = worker_pool
self._n_submitted = 0
self._n_complete = 0
self._waiting = False
self._done = asyncio.Event()
async def call(self, f, *args, **kwargs):
assert not self._waiting
self._n_submitted += 1
async def invoke():
try:
await f(*args, **kwargs)
finally:
self._n_complete += 1
if self._waiting and (self._n_complete == self._n_submitted):
self._done.set()
await self._worker_pool.call(invoke)
async def wait(self):
assert not self._waiting
self._waiting = True
if self._n_complete == self._n_submitted:
self._done.set()
await self._done.wait()
RETRYABLE_HTTP_STATUS_CODES = {408, 500, 502, 503, 504}
if os.environ.get('HAIL_DONT_RETRY_500') == '1':
RETRYABLE_HTTP_STATUS_CODES.remove(500)
def is_transient_error(e):
# observed exceptions:
#
# aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host <host> ssl:None [Connect call failed ('<ip>', 80)]
#
# concurrent.futures._base.TimeoutError
# from aiohttp/helpers.py:585:TimerContext: raise asyncio.TimeoutError from None
#
# Connected call failed caused by:
# OSError: [Errno 113] Connect call failed ('<ip>', 80)
# 113 is EHOSTUNREACH: No route to host
#
# Fatal read error on socket transport
# protocol: <asyncio.sslproto.SSLProtocol object at 0x12b47d320>
# transport: <_SelectorSocketTransport fd=13 read=polling write=<idle, bufsize=0>>
# Traceback (most recent call last):
# File "/anaconda3/lib/python3.7/asyncio/selector_events.py", line 812, in _read_ready__data_received
# data = self._sock.recv(self.max_size)
# TimeoutError: [Errno 60] Operation timed out
#
# Traceback (most recent call last):
# ...
# File "/usr/local/lib/python3.6/dist-packages/aiohttp/client.py", line 505, in _request
# await resp.start(conn)
# File "/usr/local/lib/python3.6/dist-packages/aiohttp/client_reqrep.py", line 848, in start
# message, payload = await self._protocol.read() # type: ignore # noqa
# File "/usr/local/lib/python3.6/dist-packages/aiohttp/streams.py", line 592, in read
# await self._waiter
# aiohttp.client_exceptions.ServerDisconnectedError: None
#
# during aiohttp request
# aiohttp.client_exceptions.ClientOSError: [Errno 104] Connection reset by peer
#
# urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='www.googleapis.com', port=443): Read timed out. (read timeout=60)
#
# requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
#
# socket.timeout: The read operation timed out
#
# ConnectionResetError: [Errno 104] Connection reset by peer
#
# google.auth.exceptions.TransportError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
#
# aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host batch.pr-6925-default-s24o4bgat8e8:80 ssl:None [Connect call failed ('10.36.7.86', 80)]
#
# OSError: [Errno 51] Connect call failed ('35.188.91.25', 443)
# https://hail.zulipchat.com/#narrow/stream/223457-Batch-support/topic/ssl.20error
if isinstance(e, aiohttp.ClientResponseError) and (
e.status in RETRYABLE_HTTP_STATUS_CODES):
# nginx returns 502 if it cannot connect to the upstream server
# 408 request timeout, 500 internal server error, 502 bad gateway
# 503 service unavailable, 504 gateway timeout
return True
if (isinstance(e, aiohttp.ClientOSError)
and (e.errno == errno.ETIMEDOUT
or e.errno == errno.ECONNREFUSED
or e.errno == errno.EHOSTUNREACH
or e.errno == errno.ECONNRESET)):
return True
if isinstance(e, aiohttp.ServerTimeoutError):
return True
if isinstance(e, aiohttp.ServerDisconnectedError):
return True
if isinstance(e, asyncio.TimeoutError):
return True
if isinstance(e, aiohttp.client_exceptions.ClientConnectorError):
return hasattr(e, 'os_error') and is_transient_error(e.os_error)
if (isinstance(e, OSError)
and e.errno in (errno.ETIMEDOUT,
errno.ECONNREFUSED,
errno.EHOSTUNREACH,
errno.ECONNRESET,
errno.ENETUNREACH
)):
return True
if isinstance(e, urllib3.exceptions.ReadTimeoutError):
return True
if isinstance(e, requests.exceptions.ReadTimeout):
return True
if isinstance(e, requests.exceptions.ConnectionError):
return True
if isinstance(e, socket.timeout):
return True
if isinstance(e, ConnectionResetError):
return True
if isinstance(e, google.auth.exceptions.TransportError):
return is_transient_error(e.__cause__)
return False
async def sleep_and_backoff(delay):
# exponentially back off, up to (expected) max of 30s
t = delay * random.random()
await asyncio.sleep(t)
return min(delay * 2, 60.0)
def sync_sleep_and_backoff(delay):
# exponentially back off, up to (expected) max of 30s
t = delay * random.random()
time.sleep(t)
return min(delay * 2, 60.0)
def retry_all_errors(msg=None, error_logging_interval=10):
async def _wrapper(f, *args, **kwargs):
delay = 0.1
errors = 0
while True:
try:
return await f(*args, **kwargs)
except asyncio.CancelledError: # pylint: disable=try-except-raise
raise
except Exception:
errors += 1
if msg and errors % error_logging_interval == 0:
log.exception(msg, stack_info=True)
delay = await sleep_and_backoff(delay)
return _wrapper
T = TypeVar('T') # pylint: disable=invalid-name
async def retry_transient_errors(f: Callable[..., Awaitable[T]], *args, **kwargs) -> T:
delay = 0.1
errors = 0
while True:
try:
return await f(*args, **kwargs)
except Exception as e:
if not is_transient_error(e):
raise
errors += 1
if errors % 10 == 0:
st = ''.join(traceback.format_stack())
log.warning(f'encountered {errors} errors. My stack trace is {st}. Most recent error was {e}', exc_info=True)
delay = await sleep_and_backoff(delay)
def sync_retry_transient_errors(f, *args, **kwargs):
delay = 0.1
errors = 0
while True:
try:
return f(*args, **kwargs)
except Exception as e:
errors += 1
if errors % 10 == 0:
log.warning(f'encountered {errors} errors, most recent one was {e}', exc_info=True)
if is_transient_error(e):
pass
else:
raise
delay = sync_sleep_and_backoff(delay)
async def request_retry_transient_errors(session, method, url, **kwargs):
return await retry_transient_errors(session.request, method, url, **kwargs)
async def request_raise_transient_errors(session, method, url, **kwargs):
try:
return await session.request(method, url, **kwargs)
except Exception as e:
if is_transient_error(e):
log.exception('request failed with transient exception: {method} {url}')
raise web.HTTPServiceUnavailable()
raise
def retry_response_returning_functions(fun, *args, **kwargs):
delay = 0.1
errors = 0
response = sync_retry_transient_errors(
fun, *args, **kwargs)
while response.status_code in RETRYABLE_HTTP_STATUS_CODES:
errors += 1
if errors % 10 == 0:
log.warning(f'encountered {errors} bad status codes, most recent '
f'one was {response.status_code}')
response = sync_retry_transient_errors(
fun, *args, **kwargs)
delay = sync_sleep_and_backoff(delay)
return response
def external_requests_client_session(headers=None, timeout=5) -> requests.Session:
session = requests.Session()
adapter = TimeoutHTTPAdapter(max_retries=1, timeout=timeout)
session.mount('http://', adapter)
session.mount('https://', adapter)
if headers:
session.headers = headers
return session
class TimeoutHTTPAdapter(HTTPAdapter):
def __init__(self, max_retries, timeout):
self.max_retries = max_retries
self.timeout = timeout
super().__init__(max_retries=max_retries)
def init_poolmanager(self, connections, maxsize, block=False):
self.poolmanager = PoolManager(
num_pools=connections,
maxsize=maxsize,
block=block,
retries=self.max_retries,
timeout=self.timeout)
async def collect_agen(agen):
return [x async for x in agen]
async def retry_long_running(name, f, *args, **kwargs):
delay_secs = 0.1
while True:
try:
start_time = time_msecs()
return await f(*args, **kwargs)
except Exception:
end_time = time_msecs()
log.exception(f'in {name}')
t = delay_secs * random.uniform(0.7, 1.3)
await asyncio.sleep(t)
ran_for_secs = (end_time - start_time) * 1000
delay_secs = min(
max(0.1, 2 * delay_secs - min(0, (ran_for_secs - t) / 2)),
30.0)
async def run_if_changed(changed, f, *args, **kwargs):
while True:
changed.clear()
should_wait = await f(*args, **kwargs)
if should_wait:
await changed.wait()
async def run_if_changed_idempotent(changed, f, *args, **kwargs):
while True:
should_wait = await f(*args, **kwargs)
changed.clear()
if should_wait:
await changed.wait()
async def periodically_call(period, f, *args, **kwargs):
async def loop():
log.info(f'starting loop for {f.__name__}')
while True:
await f(*args, **kwargs)
await asyncio.sleep(period)
await retry_long_running(f.__name__, loop)
class LoggingTimerStep:
def __init__(self, timer, name):
self.timer = timer
self.name = name
self.start_time = None
async def __aenter__(self):
self.start_time = time_msecs()
async def __aexit__(self, exc_type, exc, tb):
finish_time = time_msecs()
self.timer.timing[self.name] = finish_time - self.start_time
class LoggingTimer:
def __init__(self, description, threshold_ms=None):
self.description = description
self.threshold_ms = threshold_ms
self.timing = {}
self.start_time = None
def step(self, name):
return LoggingTimerStep(self, name)
async def __aenter__(self):
self.start_time = time_msecs()
return self
async def __aexit__(self, exc_type, exc, tb):
finish_time = time_msecs()
total = finish_time - self.start_time
if self.threshold_ms is None or total > self.threshold_ms:
self.timing['total'] = total
log.info(f'{self.description} timing {self.timing}')
def url_basename(url: str) -> str:
"""Return the basename of the path of the URL `url`."""
return os.path.basename(urllib.parse.urlparse(url).path)
def url_join(url: str, path: str) -> str:
"""Join the (relative or absolute) path `path` to the URL `url`."""
parsed = urllib.parse.urlparse(url)
return urllib.parse.urlunparse(parsed._replace(path=os.path.join(parsed.path, path)))
def is_google_registry_image(path: str) -> bool:
"""Returns true if the given Docker image path points to either the Google
Container Registry or the Artifact Registry."""
host = path.partition('/')[0]
return host == 'gcr.io' or host.endswith('docker.pkg.dev')
def url_scheme(url: str) -> str:
"""Return scheme of `url`, or the empty string if there is no scheme."""
parsed = urllib.parse.urlparse(url)
return parsed.scheme
class Notice:
def __init__(self):
self.subscribers = []
def subscribe(self):
e = asyncio.Event()
self.subscribers.append(e)
return e
def notify(self):
for e in self.subscribers:
e.set()
| [
"[email protected]"
] | |
b45991fc4b005bf57fcb4a36ebb41de146a131fa | 65c0eb470e48a018c65631a995c5cf4d0f142cf8 | /test_camera.py | c5b5d5e588650b9737463a5e098433f186ef427f | [] | no_license | WolfgangFahl/ESE205-CVChess | eab7491d130fa534ed966fe3af39cbb7a6f33341 | 3b88090be3015caa90e42f59db4c88be8a67c355 | refs/heads/master | 2020-08-14T05:45:59.729411 | 2019-11-12T08:44:28 | 2019-11-12T08:44:28 | 215,108,730 | 0 | 1 | null | 2019-10-14T17:46:17 | 2019-10-14T17:46:16 | null | UTF-8 | Python | false | false | 163 | py | from Camera import Camera
# test the camera
def test_Camera():
camera=Camera()
assert camera
assert camera.cam
# call the camera test
test_Camera()
| [
"[email protected]"
] | |
6eb1c2b72186303722500f9625bae4ec1dd3f465 | 61673ab9a42f7151de7337608c442fa6247f13bb | /tkinter/label/label-os.listdir/main.py | befd86ad6bda534d9a7e53df6543a2a2e83995a9 | [
"MIT"
] | permissive | furas/python-examples | 22d101670ecd667a29376d7c7d7d86f8ec71f6cf | 95cb53b664f312e0830f010c0c96be94d4a4db90 | refs/heads/master | 2022-08-23T23:55:08.313936 | 2022-08-01T14:48:33 | 2022-08-01T14:48:33 | 45,575,296 | 176 | 91 | MIT | 2021-02-17T23:33:37 | 2015-11-04T23:54:32 | Python | UTF-8 | Python | false | false | 459 | py | #!/usr/bin/env python3
# date: 2019.10.15
# https://stackoverflow.com/questions/58364159/printing-text-from-a-function-into-a-tkinter-label
import os
import tkinter as tk
def get_filenames():
filenames = sorted(os.listdir('.'))
text = "\n".join(filenames)
label['text'] = text # change text in label
root = tk.Tk()
label = tk.Label(root) # empty label
label.pack()
tk.Button(root, text="OK", command=get_filenames).pack()
root.mainloop()
| [
"[email protected]"
] | |
27700db0c9ee4bb37b0c7f811e97c74938133910 | 278d7f4467a112416d1adfbcd3218033ff0fd9b3 | /mmdet/models/detectors/fcos.py | 9f34b76946c8e068fb0a13416e4c7f7d582acc4c | [] | no_license | Young-1217/detection | e3d67938b454e955b5b7a82d5ae222e62f9545fb | 6760288dac92e00ddc3e813ed0e1363c1fa1ce2d | refs/heads/main | 2023-06-01T21:41:37.998947 | 2021-06-21T10:03:01 | 2021-06-21T10:03:01 | 371,868,683 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 562 | py | from ..builder import DETECTORS
from .single_stage import SingleStageDetector
@DETECTORS.register_module()
class FCOS(SingleStageDetector):
"""Implementation of `FCOS <https://arxiv.org/abs/1904.01355>`_"""
def __init__(self,
backbone,
neck,
bbox_head,
train_cfg=None,
test_cfg=None,
pretrained=None):
super(FCOS, self).__init__(backbone, neck, bbox_head, train_cfg,
test_cfg, pretrained)
| [
"[email protected]"
] | |
7df13a7dca896b802ae30f52268f015494835398 | 53fab060fa262e5d5026e0807d93c75fb81e67b9 | /backup/user_353/ch135_2020_04_01_12_34_36_501450.py | 17730c3e4d8367f61aa6c05c9fd0102f30264240 | [] | no_license | gabriellaec/desoft-analise-exercicios | b77c6999424c5ce7e44086a12589a0ad43d6adca | 01940ab0897aa6005764fc220b900e4d6161d36b | refs/heads/main | 2023-01-31T17:19:42.050628 | 2020-12-16T05:21:31 | 2020-12-16T05:21:31 | 306,735,108 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 225 | py | def equaliza_imagem(k,cores):
i=0
ls=[]
n=len(cores)
while i<=(n-1):
if(cores[i]*k)>=255:
ls.append(255)
else:
ls.append(cores[i]*k)
i+=1
return ls
| [
"[email protected]"
] | |
b86e6518cc484c69443fbd6a6ac37c886b02c94b | 1977dfcd971bb80fd5926f00a86d37c21cf80520 | /y/google-cloud-sdk/.install/.backup/lib/googlecloudsdk/core/exceptions.py | 98eab373e0afc66b67b7c92ec5685cdea0b2abd9 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | camidagreat/music_game_poc | fd39cd1bbcddaee6ccac2601b95ec81d0358dbf8 | be3c69c026a254078e1dbcee936b368766092a5e | refs/heads/master | 2023-01-08T22:12:05.372029 | 2020-04-22T19:40:31 | 2020-04-22T19:40:31 | 204,744,171 | 0 | 1 | null | 2022-12-10T07:53:06 | 2019-08-27T16:27:00 | Python | UTF-8 | Python | false | false | 4,408 | py | # -*- coding: utf-8 -*- #
# Copyright 2014 Google LLC. 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.
"""Base exceptions for the Cloud SDK."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import os
import sys
from googlecloudsdk.core.util import platforms
import six
class _Error(Exception):
"""A base exception for all Cloud SDK errors.
This exception should not be used directly.
"""
pass
class InternalError(_Error):
"""A base class for all non-recoverable internal errors."""
pass
class Error(_Error):
"""A base exception for all user recoverable errors.
Any exception that extends this class will not be printed with a stack trace
when running from CLI mode. Instead it will be shows with a message of how
the user can correct this problem.
All exceptions of this type must have a message for the user.
"""
def __init__(self, *args, **kwargs):
"""Initialize a core.Error.
Args:
*args: positional args for exceptions.
**kwargs: keyword args for exceptions, and additional arguments:
- exit_code: int, The desired exit code for the CLI.
"""
super(Error, self).__init__(*args)
self.exit_code = kwargs.get('exit_code', 1)
class MultiError(Error):
"""Collection of Error instances as single exception."""
def __init__(self, errors):
super(MultiError,
self).__init__(', '.join(six.text_type(e) for e in errors))
class RequiresAdminRightsError(Error):
"""An exception for when you don't have permission to modify the SDK.
This tells the user how to run their command with administrator rights so that
they can perform the operation.
"""
def __init__(self, sdk_root):
message = (
'You cannot perform this action because you do not have permission '
'to modify the Google Cloud SDK installation directory [{root}].\n\n'
.format(root=sdk_root))
if (platforms.OperatingSystem.Current() ==
platforms.OperatingSystem.WINDOWS):
message += (
'Click the Google Cloud SDK Shell icon and re-run the command in '
'that window, or re-run the command with elevated privileges by '
'right-clicking cmd.exe and selecting "Run as Administrator".')
else:
# Specify the full path because sudo often uses secure_path and won't
# respect the user's $PATH settings.
gcloud_path = os.path.join(sdk_root, 'bin', 'gcloud')
message += (
'Re-run the command with sudo: sudo {0} ...'.format(gcloud_path))
super(RequiresAdminRightsError, self).__init__(message)
class NetworkIssueError(Error):
"""An error to wrap a general network issue."""
def __init__(self, message):
super(NetworkIssueError, self).__init__(
'{message}\n'
'This may be due to network connectivity issues. Please check your '
'network settings, and the status of the service you are trying to '
'reach.'.format(message=message))
class ExceptionContext(object):
"""An exception context that can be re-raised outside of try-except.
Usage:
exception_context = None
...
try:
...
except ... e:
# This MUST be called in the except: clause.
exception_context = exceptions.ExceptionContext(e)
...
if exception_context:
exception_context.Reraise()
"""
def __init__(self, e):
self._exception = e
self._traceback = sys.exc_info()[2]
if not self._traceback:
raise ValueError('Must set ExceptionContext within an except clause.')
def Reraise(self):
six.reraise(type(self._exception), self._exception, self._traceback)
def reraise(exc_value, tb=None): # pylint: disable=invalid-name
"""Adds tb or the most recent traceback to exc_value and reraises."""
tb = tb or sys.exc_info()[2]
six.reraise(type(exc_value), exc_value, tb)
| [
"[email protected]"
] | |
08434b4f3f8fccef164b31dfdc8d67c11c1d3bfc | 781e2692049e87a4256320c76e82a19be257a05d | /all_data/exercism_data/python/bob/9b8c6e044ac64769ba086a15c36a3d73.py | d48491b573d2706315333b916b8c906f5b06dde1 | [] | no_license | itsolutionscorp/AutoStyle-Clustering | 54bde86fe6dbad35b568b38cfcb14c5ffaab51b0 | be0e2f635a7558f56c61bc0b36c6146b01d1e6e6 | refs/heads/master | 2020-12-11T07:27:19.291038 | 2016-03-16T03:18:00 | 2016-03-16T03:18:42 | 59,454,921 | 4 | 0 | null | 2016-05-23T05:40:56 | 2016-05-23T05:40:56 | null | UTF-8 | Python | false | false | 271 | py | #
# Skeleton file for the Python "Bob" exercise.
#
def hey(what):
if what.isupper():
return 'Whoa, chill out!'
if what.endswith('?'):
return 'Sure.'
if not what.strip():
return 'Fine. Be that way!'
else:
return 'Whatever.'
| [
"[email protected]"
] | |
f7491a276be527fc1210623a64651d181bcea56d | 187a6558f3c7cb6234164677a2bda2e73c26eaaf | /jdcloud_sdk/services/antipro/apis/DescribeCpsIpResourcesRequest.py | 27085dc7fbcfc694427a428f43b1e9cbd3a61bc4 | [
"Apache-2.0"
] | permissive | jdcloud-api/jdcloud-sdk-python | 4d2db584acc2620b7a866af82d21658cdd7cc227 | 3d1c50ed9117304d3b77a21babe899f939ae91cd | refs/heads/master | 2023-09-04T02:51:08.335168 | 2023-08-30T12:00:25 | 2023-08-30T12:00:25 | 126,276,169 | 18 | 36 | Apache-2.0 | 2023-09-07T06:54:49 | 2018-03-22T03:47:02 | Python | UTF-8 | Python | false | false | 1,797 | py | # coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# NOTE: This class is auto generated by the jdcloud code generator program.
from jdcloud_sdk.core.jdcloudrequest import JDCloudRequest
class DescribeCpsIpResourcesRequest(JDCloudRequest):
"""
查询 DDoS 防护包可防护的云物理服务器公网 IP(包括云物理服务器弹性公网 IP 及云物理服务器基础网络实例的公网 IP)
"""
def __init__(self, parameters, header=None, version="v1"):
super(DescribeCpsIpResourcesRequest, self).__init__(
'/regions/{regionId}/cpsIpResources', 'GET', header, version)
self.parameters = parameters
class DescribeCpsIpResourcesParameters(object):
def __init__(self, regionId, ):
"""
:param regionId: 地域编码, 防护包目前支持: 华北-北京, 华东-宿迁, 华东-上海
"""
self.regionId = regionId
self.pageNumber = None
self.pageSize = None
def setPageNumber(self, pageNumber):
"""
:param pageNumber: (Optional) 页码
"""
self.pageNumber = pageNumber
def setPageSize(self, pageSize):
"""
:param pageSize: (Optional) 分页大小
"""
self.pageSize = pageSize
| [
"[email protected]"
] | |
f36c42bb664c1f1846d355327925384abfd55024 | 15f321878face2af9317363c5f6de1e5ddd9b749 | /solutions_python/Problem_74/1232.py | a374f2c0f81a9d1cd08433442c5246cff3db1822 | [] | no_license | dr-dos-ok/Code_Jam_Webscraper | c06fd59870842664cd79c41eb460a09553e1c80a | 26a35bf114a3aa30fc4c677ef069d95f41665cc0 | refs/heads/master | 2020-04-06T08:17:40.938460 | 2018-10-14T10:12:47 | 2018-10-14T10:12:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 659 | py | #!/usr/bin/python
import sys
import string
def alg(case,f):
row = f.readline().split()
moves = int(row[0])
pO = pB = 1
tO = tB = 0
for i in range(moves):
who = row[i*2+1]
btn = int(row[i*2+2])
if (who == 'O'):
tO += abs(btn-pO) # go
if (tB>=tO): tO=tB # wait before press
tO+=1 # and press
pO=btn
else: # who == 'B'
tB += abs(btn-pB) # go
if (tO>=tB): tB=tO # wait before press
tB+=1 # and press
pB=btn
print 'Case #%d: %d'%(case+1,max(tO,tB))
def main(argv):
with open(argv[1],'r') as f:
cases = int(f.readline())
for i in range(cases):
alg(i,f)
f.closed
if __name__ == "__main__":
main(sys.argv)
| [
"[email protected]"
] | |
b242453fdad7f3bf393fc5997532df9cb737c959 | e1f5cf7055e54f24f4bea5b1232f337fcbcae63c | /loop/solution/loop_label_encoder.py | 9263b77c47d9d3e6a37ba4fe190b9ce3e983fbd3 | [
"MIT"
] | permissive | revirevy/book-python | fcd64d44840b68e528422de785383f9d4a81fb98 | 9da7bfd43117f33530e708e889c26152dc8c7a25 | refs/heads/master | 2020-04-01T05:13:50.394724 | 2018-10-13T14:58:19 | 2018-10-13T14:58:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,563 | py | from random import shuffle
DATABASE = [
('Sepal length', 'Sepal width', 'Petal length', 'Petal width', 'Species'),
(5.1, 3.5, 1.4, 0.2, 'setosa'),
(4.9, 3.0, 1.4, 0.2, 'setosa'),
(4.7, 3.2, 1.3, 0.2, 'setosa'),
(4.6, 3.1, 1.5, 0.2, 'setosa'),
(5.0, 3.6, 1.4, 0.3, 'setosa'),
(5.4, 3.9, 1.7, 0.4, 'setosa'),
(4.6, 3.4, 1.4, 0.3, 'setosa'),
(7.0, 3.2, 4.7, 1.4, 'versicolor'),
(6.4, 3.2, 4.5, 1.5, 'versicolor'),
(6.9, 3.1, 4.9, 1.5, 'versicolor'),
(5.5, 2.3, 4.0, 1.3, 'versicolor'),
(6.5, 2.8, 4.6, 1.5, 'versicolor'),
(5.7, 2.8, 4.5, 1.3, 'versicolor'),
(5.7, 2.8, 4.1, 1.3, 'versicolor'),
(6.3, 3.3, 6.0, 2.5, 'virginica'),
(5.8, 2.7, 5.1, 1.9, 'virginica'),
(7.1, 3.0, 5.9, 2.1, 'virginica'),
(6.3, 2.9, 5.6, 1.8, 'virginica'),
(6.5, 3.0, 5.8, 2.2, 'virginica'),
(7.6, 3.0, 6.6, 2.1, 'virginica'),
(4.9, 2.5, 4.5, 1.7, 'virginica'),
]
species = dict()
labels = list()
header = DATABASE[0]
data = DATABASE[1:]
shuffle(data)
for record in data:
name = record[-1]
if name not in species.keys():
species[name] = len(species)
labels.append(species[name])
species = {value: key for key, value in species.items()}
print(species)
# {0: 'versicolor', 1: 'virginica', 2: 'setosa'}
print(labels)
# [0, 1, 2, 1, 1, 0, ...]
## Alternative solution 1
species = set(x[-1] for x in data)
indexes = range(0, len(species))
d = zip(species, indexes)
d = dict(d)
## In numerical analysis you can find this
result = dict(enumerate(set(x[-1] for x in data)))
| [
"[email protected]"
] | |
74a0f6c997b3b3ace16354b5deb86dd6faa55781 | 62e58c051128baef9452e7e0eb0b5a83367add26 | /x12/5010/354005010.py | 08b7b2d5821d99edd27618c3cec12800d84b3b4e | [] | no_license | dougvanhorn/bots-grammars | 2eb6c0a6b5231c14a6faf194b932aa614809076c | 09db18d9d9bd9d92cefbf00f1c0de1c590fe3d0d | refs/heads/master | 2021-05-16T12:55:58.022904 | 2019-05-17T15:22:23 | 2019-05-17T15:22:23 | 105,274,633 | 0 | 0 | null | 2017-09-29T13:21:21 | 2017-09-29T13:21:21 | null | UTF-8 | Python | false | false | 453 | py | from bots.botsconfig import *
from records005010 import recorddefs
syntax = {
'version' : '00403', #version of ISA to send
'functionalgroup' : 'AY',
}
structure = [
{ID: 'ST', MIN: 1, MAX: 1, LEVEL: [
{ID: 'M10', MIN: 1, MAX: 1},
{ID: 'P4', MIN: 1, MAX: 20, LEVEL: [
{ID: 'X01', MIN: 1, MAX: 1},
{ID: 'X02', MIN: 0, MAX: 9999},
]},
{ID: 'SE', MIN: 1, MAX: 1},
]}
]
| [
"[email protected]"
] | |
c6a413388ac7660111141273b005926c2b61fb11 | f576f0ea3725d54bd2551883901b25b863fe6688 | /sdk/network/azure-mgmt-network/generated_samples/express_route_circuit_peering_delete.py | 1b338805532ac4ac6dcc362677370c26eaf1de84 | [
"MIT",
"LicenseRef-scancode-generic-cla",
"LGPL-2.1-or-later"
] | permissive | Azure/azure-sdk-for-python | 02e3838e53a33d8ba27e9bcc22bd84e790e4ca7c | c2ca191e736bb06bfbbbc9493e8325763ba990bb | refs/heads/main | 2023-09-06T09:30:13.135012 | 2023-09-06T01:08:06 | 2023-09-06T01:08:06 | 4,127,088 | 4,046 | 2,755 | MIT | 2023-09-14T21:48:49 | 2012-04-24T16:46:12 | Python | UTF-8 | Python | false | false | 1,584 | py | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.network import NetworkManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-network
# USAGE
python express_route_circuit_peering_delete.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = NetworkManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
client.express_route_circuit_peerings.begin_delete(
resource_group_name="rg1",
circuit_name="circuitName",
peering_name="peeringName",
).result()
# x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2023-04-01/examples/ExpressRouteCircuitPeeringDelete.json
if __name__ == "__main__":
main()
| [
"[email protected]"
] | |
8d83846060bb604cdedc59bea541a59c93abc2d5 | 1086ef8bcd54d4417175a4a77e5d63b53a47c8cf | /Mine/marathon2019/marathon.py | 0a130b63e70d6e960c9cd1e632b5c35ddce5e692 | [] | no_license | wisdomtohe/CompetitiveProgramming | b883da6380f56af0c2625318deed3529cb0838f6 | a20bfea8a2fd539382a100d843fb91126ab5ad34 | refs/heads/master | 2022-12-18T17:33:48.399350 | 2020-09-25T02:24:41 | 2020-09-25T02:24:41 | 298,446,025 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 268 | py | def findValleys(n, s):
compteur = 0
marqueur = 0
if s[i] == "U":
marqueur = 1
else:
marqueur = -1
start = (s[i] == "U" and s[i+1] == "D")
for i in s:
if start :
compteur += 1
if !start:
| [
"[email protected]"
] | |
3733f46ba880d140ef4e0a90c9a769cf7108649a | a2c7bc7f0cf5c18ba84e9a605cfc722fbf169901 | /python_1_to_1000/269_Alien_Dictionary.py | 01a1de2634d2366896df31c02bfe358cf26a20f1 | [] | no_license | jakehoare/leetcode | 3bf9edd499034ce32be462d4c197af9a8ed53b5d | 05e0beff0047f0ad399d0b46d625bb8d3459814e | refs/heads/master | 2022-02-07T04:03:20.659422 | 2022-01-26T22:03:00 | 2022-01-26T22:03:00 | 71,602,471 | 58 | 38 | null | null | null | null | UTF-8 | Python | false | false | 2,771 | py | _author_ = 'jake'
_project_ = 'leetcode'
# https://leetcode.com/problems/alien-dictionary/
# There is a new alien language which uses the latin alphabet. However, the order among letters are unknown to you.
# You receive a list of words from the dictionary, where words are sorted lexicographically by the rules of this
# new language. Derive the order of letters in this language.
# For each character, count the number of chars that appear before it and create a set of chars that appear after it.
# The first difference in chars at the same position for consecutive words in the dictionary gives an ordered pair
# of chars. Find a topologial ordering of the resulting directed graph by repeatedly removing chars that have no
# earlier chars remaining.
# Time - O(n), total number of chars in all words
# Space - O(m**2), nb chars in alphabet - order can be set of all chars for each char
from collections import defaultdict
class Solution(object):
def alienOrder(self, words):
"""
:type words: List[str]
:rtype: str
"""
after = defaultdict(int) # key is char, value is nb times char depends on a previous char
order = defaultdict(set) # key is char, value is set of chars appearing after char
seen = set(words[0]) # all chars found so far
for i in range(1, len(words)):
diff_to_prev = False
for j, c in enumerate(words[i]):
seen.add(c) # add every char of every word to seen
# new difference from previous word at this position
if j < len(words[i-1]) and not diff_to_prev and c != words[i-1][j]:
if c not in order[words[i-1][j]]: # have not seen this ordering before
order[words[i-1][j]].add(c)
after[c] += 1
diff_to_prev = True
if not diff_to_prev and len(words[i-1]) > len(words[i]): # no differences and longer word first
return ""
for c in seen: # all chars depend on at least zero previous chars
if c not in after:
after[c] = 0
frontier = set() # frontier have no dependencies
for a in after:
if after[a] == 0:
frontier.add(a)
letters = []
while frontier:
b = frontier.pop() # add char from frontier to result
del after[b]
letters.append(b)
for a in order[b]: # decrement dependency count of those appearing after b
after[a] -= 1
if after[a] == 0:
frontier.add(a)
if after:
return ""
return "".join(letters)
| [
"[email protected]"
] | |
93145477fa4ff6706c0c009cf567d7a6d78d89ae | 81539aba88c22cf75bd2e14f5e0e92f2bf54e962 | /DarkMatterMap2017/TTbarDMJets_Inclusive_pseudoscalar_LO_TuneCP5_13TeV_madgraph_mcatnlo_pythia8/TTbarDMJets_Inclusive_pseudoscalar_LO_Mchi-1_Mphi-100_TuneCP5_13TeV-madgraph-mcatnlo-pythia8/TTbarDMJets_Inclusive_pseudoscalar_LO_TuneCP5_13TeV_madgraph_mcatnlo_pythia8_280000_1_cff.py | 8897a9cac11197d9bf5c60c2bd6601128a72cdc7 | [] | no_license | nistefan/RandomizedParametersSeparator | ad35b48b95e9745814c0bf9d8d8b6eb8aa479177 | 66a0e291b59113c6b5301768f1c10e36cf23d3c3 | refs/heads/master | 2021-01-03T00:41:17.415005 | 2020-02-19T13:30:54 | 2020-02-19T13:30:54 | 239,838,928 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 10,592 | py | import FWCore.ParameterSet.Config as cms
maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) )
readFiles = cms.untracked.vstring()
source = cms.Source ("PoolSource",fileNames = readFiles, lumisToProcess = cms.untracked.VLuminosityBlockRange(*('1:1886', '1:13149', '1:13410', '1:14824', '1:15943', '1:2833', '1:6892', '1:9237', '1:9464', '1:2410', '1:3674', '1:9089', '1:26899', '1:31002', '1:26481', '1:26662', '1:26785', '1:26954', '1:76275', '1:76405', '1:90855', '1:90916', '1:90940', '1:90941', '1:91089', '1:91376', '1:91413', '1:97280', '1:70369', '1:71039', '1:71152', '1:70360', '1:70589', '1:77136', '1:82657', '1:83961', '1:84045', '1:88082', '1:90391', '1:77512', '1:86934', '1:72880', '1:72907', '1:72957', '1:75640', '1:75727', '1:73071', '1:73072', '1:73329', '1:84235', '1:84491', '1:84535', '1:84383', '1:84416', '1:76627', '1:86351', '1:87980', '1:91812', '1:92209', '1:96609', '1:97614', '1:98686', '1:77695', '1:73322', '1:73466', '1:73662', '1:73691', '1:73624', '1:73768', '1:74620', '1:74844', '1:74985', '1:74993', '1:75067', '1:75091', '1:75107', '1:75171', '1:74712', '1:74713', '1:74727', '1:74811', '1:74835', '1:74836', '1:74840', '1:74907', '1:78144', '1:78581', '1:78719', '1:76998', '1:78110', '1:78137', '1:78321', '1:78509', '1:78517', '1:95758', '1:82650', '1:82840', '1:82867', '1:83183', '1:26966', '1:39178', '1:41020', '1:51745', '1:54810', '1:62406', '1:65697', '1:65980', '1:66068', '1:65930', '1:65934', '1:66010', '1:62327', '1:62539', '1:62549', '1:62562', '1:62584', '1:62710', '1:62806', '1:62514', '1:64134', '1:64263', '1:67195', '1:67454', '1:73441', '1:73678', '1:62867', '1:90251', '1:74481', '1:75277', '1:80646', '1:80914', '1:80921', '1:80898', '1:36042', '1:38071', '1:38671', '1:68028', '1:35880', '1:36052', '1:37414', '1:34520', '1:36301', '1:70553', '1:82925', '1:93371', '1:88258', '1:91078', '1:94014', '1:77212', '1:77365', '1:77507', '1:77633', '1:88502', '1:88588', '1:89024', '1:89874', '1:90255', '1:92546', '1:73368', '1:73393', '1:73406', '1:73484', '1:73525', '1:78379', '1:95888', '1:70619', '1:79955', '1:73973', '1:64346', '1:64462', '1:81918', '1:70072', '1:70707', '1:82008', '1:82475', '1:82888', '1:71126', '1:71188', '1:71251', '1:71460', '1:71483', '1:77194', '1:71394', '1:71423', '1:71676', '1:71257', '1:71265', '1:71520', '1:71631', '1:73732', '1:73735', '1:73774', '1:73782', '1:73886', '1:74037', '1:74117', '1:74402', '1:74176', '1:74178', '1:71953', '1:71824', '1:71613', '1:73788', '1:87017', '1:106422', '1:71866', '1:71923', '1:72055', '1:72088', '1:72134', '1:71772', '1:72108', '1:72110', '1:72133', '1:81802', '1:75006', '1:75063', '1:75104', '1:75113', '1:75117', '1:75134', '1:75157', '1:75161', '1:75175', '1:75256', '1:75260', '1:75308', '1:75324', '1:75334', '1:75350', '1:75358', '1:75382', '1:75487', '1:75552', '1:75554', '1:75660', '1:77071', '1:81805', '1:89487', '1:89260', '1:89407', '1:97465', '1:97681', '1:97716', '1:97823', '1:98610', '1:98697', '1:98716', '1:89426', '1:90612', '1:90973', '1:91884', '1:90632', '1:89838', '1:90303', '1:89963', '1:90020', '1:90225', '1:90288', '1:90132', '1:90414', '1:90420', '1:38693', '1:50347', '1:50801', '1:34030', '1:34528', '1:34552', '1:34891', '1:36404', '1:37445', '1:37455', '1:37925', '1:38667', '1:68105', '1:53733', '1:53744', '1:54036', '1:67292', '1:67438', '1:72117', '1:64824', '1:75419', '1:65211', '1:65324', '1:65428', '1:65454', '1:73439', '1:80399', '1:65824', '1:65177', '1:56210', '1:56234', '1:56273', '1:56337', '1:56419', '1:56516', '1:56728', '1:56839', '1:56890', '1:56993', '1:56994', '1:56354', '1:56557', '1:56622', '1:56623', '1:67169', '1:67176', '1:67428', '1:67393', '1:71007', '1:71022', '1:71233', '1:67367', '1:67503', '1:67518', '1:67552', '1:67381', '1:67397', '1:94317', '1:72315', '1:72390', '1:72451', '1:72726', '1:60485', '1:60729', '1:60772', '1:60866', '1:60916', '1:60537', '1:60626', '1:60638', '1:60794', '1:64144', '1:66204', '1:74016', '1:78575', '1:64268', '1:64411', '1:64422', '1:73826', '1:73974', '1:78555', '1:78107', '1:78126', '1:78225', '1:78258', '1:78412', '1:78489', '1:78344', '1:78482', '1:78894', '1:90301', '1:90356', '1:90444', '1:90719', '1:90930', '1:90969', '1:91040', '1:105735', '1:65790', '1:65769', '1:74063', '1:74192', '1:75569', '1:75745', '1:66392', '1:66425', '1:66502', '1:66504', '1:66615', '1:66616', '1:66354', '1:66482', '1:66530', '1:66555', '1:66614', '1:66727', '1:67782', '1:71168', '1:71184', '1:67567', '1:67311', '1:67280', '1:67436', '1:87516', '1:77400', '1:85858', '1:88341', '1:88467', '1:90169', '1:90975', '1:92392', '1:97863', '1:87886', '1:89492', '1:90198', '1:93323', '1:91590', '1:91945', '1:93211', '1:92185', '1:92466', '1:93065', '1:71787', '1:71925', '1:72015', '1:72148', '1:72697', '1:77950', '1:79136', '1:79455', '1:79240', '1:79353', '1:79373', '1:79392', '1:79419', '1:79507', '1:79496', '1:79879', '1:79210', '1:79673', '1:79690', '1:79697', '1:79424', '1:79447', '1:79479', '1:79610', '1:82884', '1:83087', '1:88986', '1:89361', '1:76151', '1:76257', '1:76377', '1:76411', '1:76508', '1:95612', '1:83066', '1:84467', '1:84612', '1:90781', '1:90684', '1:90745', '1:90788', '1:91160', '1:91397', '1:57466', '1:57558', '1:57615', '1:58342', '1:57585', '1:57649', '1:57655', '1:57672', '1:57988', '1:58035', '1:70299', '1:84396', '1:84510', '1:70790', '1:61283', '1:61434', '1:61291', '1:61396', '1:61399', '1:61519', '1:61521', '1:61534', '1:61560', '1:61637', '1:66665', '1:86957', '1:87649', '1:98625', '1:103002', '1:103169', '1:103175', '1:77313', '1:77585', '1:77675', '1:77443', '1:77568', '1:74693', '1:75545', '1:81871', '1:64184', '1:79278', '1:79409', '1:79537', '1:65272', '1:65397', '1:72799', '1:76215', '1:81608', '1:84067', '1:68607', '1:83108', '1:83519', '1:84170', '1:84410', '1:84968', '1:85138', '1:76242', '1:76461', '1:76550', '1:76600', '1:76638', '1:75142', '1:75399', '1:97611', '1:97650', '1:97742', '1:98520', '1:98763', '1:103418', '1:103498', '1:103501', '1:103542', '1:103576', '1:103564', '1:103586', '1:72171', '1:84966', '1:71647', '1:78311', '1:78442', '1:78968', '1:78560', '1:78822', '1:78704', '1:79096', '1:80945', '1:81210', '1:81235', '1:81104', '1:81220', '1:81889', '1:81367', '1:88952', '1:89066', '1:91584', '1:92031', '1:105957', '1:105960', '1:106084', '1:106116', '1:106157', '1:106183', '1:106228', '1:106272', '1:106280', '1:106245', '1:82812', '1:83444', '1:82801', '1:82803', '1:90463', '1:90474', '1:90723', '1:97875', '1:105598', '1:105684', '1:105785', '1:61820', '1:62080', '1:62515', '1:62603', '1:62611', '1:62724', '1:62856', '1:68137', '1:68172', '1:68191', '1:84997', '1:88590', '1:66452', '1:66598', '1:66626', '1:66747', '1:95854', '1:95910', '1:96045', '1:98898', '1:96642', '1:102244', '1:102788', '1:102798', '1:102917', '1:103356', '1:103382', '1:103508', '1:103530', '1:67708', '1:67839', '1:67954', '1:72200', '1:77856', '1:82444', '1:87204', '1:87722', '1:91114', '1:71018', '1:71027', '1:68103', '1:77179', '1:89362', '1:81435', '1:81443', '1:81840', '1:81594', '1:81786', '1:82151', '1:82156', '1:82254', '1:82332', '1:82522', '1:94496', '1:95503', '1:96668', '1:92979', '1:90527', '1:91071', '1:91208', '1:91324', '1:91581', '1:97547', '1:91662', '1:91791', '1:67935', '1:67967', '1:71378', '1:67956', '1:73069', '1:72776', '1:73022', '1:73158', '1:73352', '1:73434', '1:73166', '1:73263', '1:73320', '1:73376', '1:73573', '1:84214', '1:97029', '1:105653', '1:105948', '1:84688', '1:84759', '1:84769', '1:84777', '1:84890', '1:25', '1:35', '1:63', '1:79', '1:216', '1:283', '1:71', '1:793', '1:48', '1:73', '1:736', '1:758', '1:837', '1:37185', '1:37214', '1:37425', '1:810', '1:35132', '1:35136', '1:35787', '1:35868', '1:35893', '1:35895', '1:37428', '1:37631', '1:37929', '1:3144', '1:5123', '1:5553', '1:5725', '1:7748', '1:9185', '1:17029', '1:36225', '1:32775', '1:2809', '1:3812', '1:6414', '1:9317', '1:10262', '1:36686', '1:36855', '1:36946', '1:36957', '1:36983', '1:36991', '1:38090', '1:38138', '1:36956', '1:36962', '1:36968', '1:38112', '1:36953', '1:37280', '1:38018', '1:38024', '1:38025', '1:38026', '1:38362', '1:38366', '1:38394', '1:51391', '1:52531', '1:48643', '1:52449', '1:53360', '1:53438', '1:53501', '1:53668', '1:54542', '1:54791', '1:57702', '1:58844', '1:61255', '1:61783', '1:79252', '1:75417', '1:79354', '1:88831', '1:79708', '1:80103', '1:80623', '1:81222', '1:81515', '1:80062', '1:80194', '1:80598', ))
)
readFiles.extend( ['/store/mc/RunIIFall17MiniAODv2/TTbarDMJets_Inclusive_pseudoscalar_LO_TuneCP5_13TeV-madgraph-mcatnlo-pythia8/MINIAODSIM/PU2017_12Apr2018_rp_94X_mc2017_realistic_v14-v1/280000/1C9C6947-3818-EA11-B7C0-0CC47AA992AC.root', '/store/mc/RunIIFall17MiniAODv2/TTbarDMJets_Inclusive_pseudoscalar_LO_TuneCP5_13TeV-madgraph-mcatnlo-pythia8/MINIAODSIM/PU2017_12Apr2018_rp_94X_mc2017_realistic_v14-v1/280000/B28BC2BA-B318-EA11-B8C6-0025905A60A6.root', '/store/mc/RunIIFall17MiniAODv2/TTbarDMJets_Inclusive_pseudoscalar_LO_TuneCP5_13TeV-madgraph-mcatnlo-pythia8/MINIAODSIM/PU2017_12Apr2018_rp_94X_mc2017_realistic_v14-v1/280000/3E19ACBC-B318-EA11-B9D6-AC1F6BAC816E.root', '/store/mc/RunIIFall17MiniAODv2/TTbarDMJets_Inclusive_pseudoscalar_LO_TuneCP5_13TeV-madgraph-mcatnlo-pythia8/MINIAODSIM/PU2017_12Apr2018_rp_94X_mc2017_realistic_v14-v1/280000/F0087DB3-B318-EA11-97EB-0025905A48E4.root', '/store/mc/RunIIFall17MiniAODv2/TTbarDMJets_Inclusive_pseudoscalar_LO_TuneCP5_13TeV-madgraph-mcatnlo-pythia8/MINIAODSIM/PU2017_12Apr2018_rp_94X_mc2017_realistic_v14-v1/280000/CC9AC8B3-B318-EA11-BB72-0025905B859E.root', '/store/mc/RunIIFall17MiniAODv2/TTbarDMJets_Inclusive_pseudoscalar_LO_TuneCP5_13TeV-madgraph-mcatnlo-pythia8/MINIAODSIM/PU2017_12Apr2018_rp_94X_mc2017_realistic_v14-v1/280000/5EA0C1BE-B318-EA11-987C-AC1F6BAC7C4A.root', '/store/mc/RunIIFall17MiniAODv2/TTbarDMJets_Inclusive_pseudoscalar_LO_TuneCP5_13TeV-madgraph-mcatnlo-pythia8/MINIAODSIM/PU2017_12Apr2018_rp_94X_mc2017_realistic_v14-v1/280000/52F0C4B8-B318-EA11-BE8C-0025905A60B0.root', '/store/mc/RunIIFall17MiniAODv2/TTbarDMJets_Inclusive_pseudoscalar_LO_TuneCP5_13TeV-madgraph-mcatnlo-pythia8/MINIAODSIM/PU2017_12Apr2018_rp_94X_mc2017_realistic_v14-v1/280000/AA45AB59-B118-EA11-91AB-0025905A6104.root', '/store/mc/RunIIFall17MiniAODv2/TTbarDMJets_Inclusive_pseudoscalar_LO_TuneCP5_13TeV-madgraph-mcatnlo-pythia8/MINIAODSIM/PU2017_12Apr2018_rp_94X_mc2017_realistic_v14-v1/280000/80F1D651-B118-EA11-91B6-0CC47A4D7644.root', '/store/mc/RunIIFall17MiniAODv2/TTbarDMJets_Inclusive_pseudoscalar_LO_TuneCP5_13TeV-madgraph-mcatnlo-pythia8/MINIAODSIM/PU2017_12Apr2018_rp_94X_mc2017_realistic_v14-v1/280000/D8D308B4-CA17-EA11-92E0-FA163E1C81E7.root']); | [
"[email protected]"
] | |
c89c37e3bf9189730efe0f6a17ec092b259312f8 | bdccb54daf0d0b0a19fabfe9ea9b90fcfc1bdfbf | /Tutorials/10 Days of Statistics/Day 1/interquartile_range.py | c3b235ee9c1a4978d65e8c075307fef710c91737 | [
"MIT"
] | permissive | xuedong/hacker-rank | aba1ad8587bc88efda1e90d7ecfef8dbd74ccd68 | 1ee76899d555850a257a7d3000d8c2be78339dc9 | refs/heads/master | 2022-08-08T07:43:26.633759 | 2022-07-16T11:02:27 | 2022-07-16T11:02:27 | 120,025,883 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 754 | py | #!/bin/python3
import sys
n = int(input().strip())
values = [int(arr_i) for arr_i in input().strip().split(' ')]
freqs = [int(arr_i) for arr_i in input().strip().split(' ')]
arr = []
for i in range(n):
current = [values[i]] * freqs[i]
arr.extend(current)
sorted_arr = sorted(arr)
def my_median(arr):
length = len(arr)
if length % 2 == 0:
median = (arr[length//2-1] + arr[length//2])/2
else:
median = arr[(length-1)//2]
return median
def my_quartiles(arr):
length = len(arr)
L = arr[0:length//2]
U = arr[(length+1)//2:]
q1 = my_median(L)
q3 = my_median(U)
return q1, q3
def interquartile(arr):
q1, q3 = my_quartiles(arr)
return q3 - q1
print(float(interquartile(sorted_arr)))
| [
"[email protected]"
] | |
b616ace58044491cc943fd3f4f586b46d8608671 | 8155e744f698f7ed4ae32bbbfad3f72c65e810d9 | /admin_honeypot/migrations/0002_auto_20160208_0854.py | 44af8099881b4e75447578fd2f441b5d07de62c4 | [
"MIT"
] | permissive | dmpayton/django-admin-honeypot | 3ccdbd3f65d9a1238356d4e7ee50a8e1d58fe125 | a840496d183df89965eeb33c9a5dd9ea3919dfff | refs/heads/develop | 2023-07-29T00:06:18.292499 | 2022-01-01T22:31:28 | 2022-01-01T22:31:28 | 2,382,101 | 925 | 199 | MIT | 2022-08-09T07:08:28 | 2011-09-13T23:29:15 | Python | UTF-8 | Python | false | false | 503 | py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-02-08 08:54
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('admin_honeypot', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='loginattempt',
name='ip_address',
field=models.GenericIPAddressField(blank=True, null=True, verbose_name='ip address'),
),
]
| [
"[email protected]"
] | |
0567a858be21236855068d0786f3a3355555923f | 3ef7deb616a70d52a44df739e7b274fcd825f09c | /test/test_fx.py | 4d3a86205e375b98e8f525aee5ca8936d526ea16 | [
"BSD-3-Clause",
"LicenseRef-scancode-generic-cla",
"BSL-1.0",
"Apache-2.0",
"BSD-2-Clause"
] | permissive | jbnunn/pytorch | 4287042ab9a703dcf94c4730cf369330c07e6d53 | a3e08e53443b19c83c69a34704dfe96fcbf7d036 | refs/heads/master | 2023-01-10T16:21:16.252590 | 2020-11-13T19:53:24 | 2020-11-13T20:02:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 40,827 | py | import torch
import unittest
import operator
import numbers
import pickle
import copy
import sys
import functools
import contextlib
from pathlib import Path
from torch.fx import symbolic_trace, Proxy, Node, GraphModule, Tracer, Graph
from torch.fx.experimental import GraphManipulation
from torch.fx.experimental import shape_prop
from torch.fx.immutable_collections import immutable_dict, immutable_list
from copy import deepcopy
from torch.fx.proxy import TraceError
from fx.quantization import Quantizer
from typing import Any, Callable, Dict, NamedTuple, List, Optional, Tuple, Union
from torch.testing._internal.common_utils import run_tests, TEST_WITH_ROCM, IS_WINDOWS, IS_SANDCASTLE, IS_MACOS
from torch.testing._internal.jit_utils import JitTestCase
try:
from torchvision.models import resnet18
HAS_TORCHVISION = True
except ImportError:
HAS_TORCHVISION = False
skipIfNoTorchVision = unittest.skipIf(not HAS_TORCHVISION, "no torchvision")
class SimpleTest(torch.nn.Module):
def forward(self, x):
return torch.relu(x + 3.0)
def a_non_torch_leaf(a, b):
return a + b
class Pair(NamedTuple):
x : torch.Tensor
y : torch.Tensor
class TestFX(JitTestCase):
def checkGraphModule(self, m: torch.nn.Module, args, kwargs=None):
"""Check that an nn.Module's results match the GraphModule version
for a given set of args/kwargs.
"""
kwargs = kwargs if kwargs else {}
ref_outs = m(*args, **kwargs)
gm = symbolic_trace(m)
gm.graph.lint(gm)
test_outs = gm(*args, **kwargs)
self.assertEqual(ref_outs, test_outs)
def test_graph_module(self):
class MySub(torch.nn.Module):
def __init__(self):
super().__init__()
self.w = torch.nn.Parameter(torch.rand(4, 3))
def forward(self, x):
return self.w + x
class MyModule(torch.nn.Module):
def __init__(self):
super().__init__()
self.lin = torch.nn.Linear(4, 3)
self.sub_mod = MySub()
self.w = torch.nn.Parameter(torch.rand(3))
def forward(self, A, B, c):
t = torch.sigmoid(A) + self.lin(c)
return self.sub_mod(t.data + self.w + t + 1 - A + B // A + -A + A.add(B, alpha=3))
m = MyModule()
gm = symbolic_trace(m)
ms = torch.jit.script(gm)
class M2(torch.nn.Module):
def forward(self, A):
m, idx = torch.max(A, 0)
return m + 1, idx + 1
m2 = M2()
gm2 = symbolic_trace(m2)
class T(torch.nn.Module):
def forward(self, A, b=4, *args, c=5, **kwargs):
x = A + 1 + args[0] + kwargs['3']
return x
t = T()
symbolic_trace(t)
def test_custom_import(self):
graph = torch.fx.Graph()
a = graph.placeholder('x')
b = graph.placeholder('y')
c = graph.call_function(a_non_torch_leaf, (a, b))
d = graph.call_function(torch.sin, (c,))
graph.output(d)
gm = GraphModule(torch.nn.Module(), graph)
x, y = torch.rand(1), torch.rand(1)
self.assertEqual(torch.sin(x + y), gm(x, y))
def test_args_kwargs(self):
class T(torch.nn.Module):
def forward(self, *args, **kwargs):
x = args[0] + kwargs['foo']
return x
t = T()
self.checkGraphModule(t, (torch.rand(1), torch.rand(1)), {'foo': torch.rand(1)})
def test_args_kwargs_no_self(self):
class T(torch.nn.Module):
def forward(*args, **kwargs): # noqa: B902
self = args[0]
return torch.relu(args[1])
t = T()
with self.assertRaisesRegex(RuntimeError, r'cannot be part of \*args expansion'):
self.checkGraphModule(t, (torch.rand(1), torch.rand(1)), {'foo': torch.rand(1)})
def test_fx_shifts(self):
class MyModule(torch.nn.Module):
def forward(self, x):
return x << 3, x >> 3
input = torch.LongTensor(10).random_(0, 1024)
m = MyModule()
self.checkGraphModule(m, (input,))
def test_dict(self):
class MyDictMod(torch.nn.Module):
def forward(self, d):
return d['3'].relu(), {'4' : d['3'].neg()}
input_dict = {'3': torch.rand(3, 4)}
m = MyDictMod()
self.checkGraphModule(m, (input_dict,))
def test_disallow_override(self):
# Custom delegate to disallow in-place tensor operations
class NoMutableCallTracer(Tracer):
def create_node(self, kind : str, target : Union[str, Callable],
args : Tuple[Any], kwargs : Dict[str, Any], name : Optional[str] = None,
type_expr : Optional[Any] = None) -> Node:
name = target if isinstance(target, str) else torch.typename(target)
if name[-1] == '_':
raise RuntimeError('In-place operations are not supported')
return super().create_node(kind, target, args, kwargs, name)
# Test method
class MyInplaceMod(torch.nn.Module):
def forward(self, x):
x.add_(3.0)
return x
m = MyInplaceMod()
with self.assertRaisesRegex(RuntimeError, 'In-place operations'):
NoMutableCallTracer().trace(m)
# Test free function
class MyInplaceMod2(torch.nn.Module):
def forward(self, x):
torch.log_(x)
return x
m2 = MyInplaceMod2()
with self.assertRaisesRegex(RuntimeError, 'In-place operations'):
NoMutableCallTracer().trace(m2)
# Test symbolic node as an arg
class MyInplaceMod3(torch.nn.Module):
def forward(self, x):
y = torch.ones(3, 4)
y.add_(x)
return x
m3 = MyInplaceMod3()
with self.assertRaisesRegex(RuntimeError, 'In-place operations'):
NoMutableCallTracer().trace(m3)
def test_leaf_module(self):
# Custom delegate to make it so that there are no leaf modules, everything
# should get traced through
class NoLeafModulesTracer(Tracer):
def is_leaf_module(self, m, qualname):
return False
class MyReluMod(torch.nn.Module):
def __init__(self):
super().__init__()
self.relu = torch.nn.ReLU()
def forward(self, x):
return self.relu(x)
mrm = MyReluMod()
sym = NoLeafModulesTracer().trace(mrm)
for node in sym.nodes:
self.assertNotEqual(node.op, 'call_module')
sym.lint(sym)
def test_graph_edit_with_proxy(self):
class M(torch.nn.Module):
def forward(self, a, b):
return a + b
m = M()
g = symbolic_trace(m).graph
new_g = torch.fx.Graph()
val_map : Dict[Node, Node] = {}
output_val = new_g.graph_copy(g, val_map)
t = Proxy(output_val)
# test that we can use proxy objects to generate more graph code later for things that do not need to work with modules.
new_g.output((t + t).node)
gm = GraphModule(m, new_g)
gm.graph.lint(gm)
self.assertEqual(gm(3, 4), 14)
def test_graph_unique_names(self):
class M(torch.nn.Module):
def forward(self, a, b):
return a + b
m = M()
g = symbolic_trace(m).graph
new_g = torch.fx.Graph()
val_map : Dict[Node, Node] = {}
output_val = new_g.graph_copy(g, val_map)
t = Proxy(output_val)
# test that we can use proxy objects to generate more graph code later for things that do not need to work with modules.
new_g.output((t + t).node)
gm = GraphModule(m, new_g)
seen_names : Set[str] = set()
for node in gm.graph.nodes:
assert node.name not in seen_names
seen_names.add(node.name)
def test_graph_unique_names_manual(self):
graph : torch.fx.Graph = torch.fx.Graph()
a : torch.fx.Node = graph.create_node('placeholder', 'x')
b : torch.fx.Node = graph.create_node('call_module', 'linear_mod', args=(a,), name='foo_1_1')
c : torch.fx.Node = graph.create_node('get_attr', 'y_attr', name='foo_1')
d : torch.fx.Node = graph.create_node('call_function', operator.add, args=(b, c))
graph.output(d)
graph2 = torch.fx.Graph()
val_map : Dict[Node, Node] = {}
graph2.graph_copy(graph, val_map)
seen_names : Set[str] = set()
for node in graph2.nodes:
assert node.name not in seen_names
seen_names.add(node.name)
@skipIfNoTorchVision
def test_resnet(self):
resnet = resnet18()
resnet.train()
res_graph = symbolic_trace(resnet)
res_script = torch.jit.script(res_graph)
ip = torch.rand(1, 3, 224, 224)
a = resnet(ip)
b = res_graph(ip)
c = res_script(ip)
self.assertEqual(a, b)
self.assertEqual(a, c)
quantizer = Quantizer(res_graph)
for i in range(10):
quantizer.observe((torch.rand(1, 3, 224, 224),))
qgraph = quantizer.quantize()
qgraph.graph.lint(qgraph)
qgraph_script = torch.jit.script(qgraph)
d = qgraph(ip)
e = qgraph_script(ip)
assert (a - d).abs().max() < 2
self.assertEqual(d, e)
def test_unpack(self):
class M(torch.nn.Module):
def forward(self, a, b):
c, d = a
return c + d + b
a = (torch.rand(1), torch.rand(1))
b = torch.rand(1)
m = M()
self.checkGraphModule(m, (a, b))
def test_native_callable(self):
if TEST_WITH_ROCM or IS_SANDCASTLE or IS_WINDOWS or IS_MACOS:
raise unittest.SkipTest("non-portable load_library call used in test")
torch_root = Path(__file__).resolve().parent.parent
p = torch_root / 'build' / 'lib' / 'libtorchbind_test.so'
torch.ops.load_library(str(p))
# This test exercises the case where we use FX to translate from Python
# code to some native callable object
#
# For the purposes of testing, we use ElementwiseInterpreter defined
# in test_custom_class.cpp.
#
# We test that we can
# 1) Construct a native callable from FX IR
# 2) Construct a drop-in replacement module that delegates to the
# native callable rather than the original code
# 3) Run both the original code and native callable wrapper with
# equivalent results
# 4) TorchScript compile the native callable wrapper and confirm
# equivalent results with the reference
# 5) TorchScript serialize and deserialize the native callable
# and confirm equivalent results with the reference
# We use this simple Module as a reference computation
class MySimpleMod(torch.nn.Module):
def forward(self, x):
return 3.0 * x + x
msm = MySimpleMod()
# This is what a lowering pass might look like: a function that takes
# a valid nn.Module, symbolically traces it, lowers the Module to some
# representation, and wraps that representation up into another
# nn.Module instance that handles dispatch to the compiled/lowered code.
def lower_to_elementwise_interpreter(orig_mod : torch.nn.Module) -> torch.nn.Module:
# ===== Stage 1: Symbolic trace the module =====
mod = symbolic_trace(orig_mod)
# ===== Stage 2: Lower GraphModule representation to the C++
# interpreter's instruction format ======
instructions = []
constant_idx = 0
constants = {}
fn_input_names = []
target_to_name = {
operator.add : "add",
operator.mul : "mul"
}
output_node : Optional[Node] = None
# For each instruction, create a triple
# (instruction_name : str, inputs : List[str], output : str)
# to feed into the C++ interpreter
for n in mod.graph.nodes:
target, args, out_name = n.target, n.args, n.name
assert len(n.kwargs) == 0, "kwargs currently not supported"
if n.op == 'placeholder':
# Placeholders specify function argument names. Save these
# for later when we generate the wrapper GraphModule
fn_input_names.append(target)
elif n.op == 'call_function':
assert target in target_to_name, "Unsupported call target " + target
arg_names = []
for arg in args:
if not isinstance(arg, Node):
# Pull out constants. These constants will later be
# fed to the interpreter C++ object via add_constant()
arg_name = f'constant_{constant_idx}'
constants[arg_name] = torch.Tensor(
[arg] if isinstance(arg, numbers.Number) else arg)
arg_names.append(arg_name)
constant_idx += 1
else:
arg_names.append(arg.name)
instructions.append((target_to_name[target], arg_names, out_name))
elif n.op == 'output':
if output_node is not None:
raise RuntimeError('Multiple output nodes!')
output_node = n
else:
raise RuntimeError('Unsupported opcode ' + n.op)
interpreter = torch.classes._TorchScriptTesting._ElementwiseInterpreter()
# Load constants
for k, v in constants.items():
interpreter.add_constant(k, v)
# Specify names for positional input arguments
interpreter.set_input_names(fn_input_names)
# Load instructions
interpreter.set_instructions(instructions)
# Specify name for single output
assert isinstance(output_node.args[0], torch.fx.Node)
interpreter.set_output_name(output_node.args[0].name)
# ===== Stage 3: Create a wrapper GraphModule around the interpreter =====
class WrapperModule(torch.nn.Module):
def __init__(self, interpreter):
super().__init__()
self.interpreter = interpreter
wrapper = WrapperModule(interpreter)
# Create a graph that: 1) Takes function arguments 2) Invokes the interpreter
# 3) Returns the speficied return value
# FIXME: The following code could be greatly simplified by symbolic_trace'ing
# the wrapper with a Tracer that considers the Wrapper instance a root
# module, however, I can't get `__call__` exposed on TorchBind classes
# without it messing up Python `hasattr` for some reason. More digging
# into CPython's implementation of hasattr is probably in order...
graph = torch.fx.Graph()
# Add placeholders for fn inputs
placeholder_nodes = []
for name in fn_input_names:
placeholder_nodes.append(graph.create_node('placeholder', name))
# Get the interpreter object
interpreter_node = graph.create_node('get_attr', 'interpreter')
# Add a node to call the interpreter instance
output_node = graph.create_node(
op='call_method', target='__call__', args=(interpreter_node, placeholder_nodes))
# Register output
graph.output(output_node)
graph.lint(wrapper)
# Return final GraphModule!!!
return GraphModule(wrapper, graph)
# Lower GraphModule to C++ interpreter
lowered = lower_to_elementwise_interpreter(msm)
# Compare correctness with original module
x = torch.rand(3, 4)
ref_out = msm(x)
test_out = lowered(x)
torch.testing.assert_allclose(test_out, ref_out)
# Test TorchScript compilation
scripted_lowered = torch.jit.script(lowered)
script_out = scripted_lowered(x)
torch.testing.assert_allclose(script_out, ref_out)
# Test TorchScript ser/de
import_copy = self.getExportImportCopy(scripted_lowered)
imported_out = import_copy(x)
torch.testing.assert_allclose(imported_out, ref_out)
def test_reserved_getattr(self):
"""Ensure that we do not name any nodes with a reserved builtin like `getattr`"""
class M(torch.nn.Module):
def forward(self, a):
return a.foo.bar.baz
m = M()
m_g = symbolic_trace(m)
m_g.graph.lint(m_g)
for node in m_g.graph.nodes:
self.assertTrue(node.name != "getattr")
def test_node_tagging(self):
class TaggingTracer(Tracer):
def create_node(self, kind : str, target : Union[str, Callable],
args : Tuple[Any], kwargs : Dict[str, Any], name : Optional[str] = None,
type_expr : Optional[Any] = None) -> Node:
n = super().create_node(kind, target, args, kwargs, name)
n.tag = 'foo'
return n
class M(torch.nn.Module):
def forward(self, a, b):
return a + b
m = M()
g = TaggingTracer().trace(m)
g.lint(m)
for n in g.nodes:
self.assertTrue(hasattr(n, 'tag'))
self.assertEqual(n.tag, 'foo')
def test_tensor_attribute(self):
class TensorAttribute(torch.nn.Module):
def __init__(self):
super().__init__()
self.tensor = torch.rand(3, 4)
def forward(self, x):
return torch.nn.functional.linear(x, self.tensor)
ta = TensorAttribute()
traced = symbolic_trace(ta)
traced(torch.rand(4, 4))
class WrapperForQualname(torch.nn.Module):
def __init__(self):
super().__init__()
self.ta = TensorAttribute()
def forward(self, x):
return torch.nn.functional.linear(x, self.ta.tensor)
wfq = WrapperForQualname()
traced2 = symbolic_trace(wfq)
traced2.graph.lint(traced2)
traced2(torch.rand(4, 4))
def test_symbolic_trace_sequential(self):
class Simple(torch.nn.Module):
def forward(self, x):
return torch.neg(x)
seq = torch.nn.Sequential(
Simple(),
Simple(),
Simple()
)
traced = symbolic_trace(seq)
traced.graph.lint(traced)
x = torch.rand(3, 4)
self.assertEqual(traced(x), seq(x))
def test_tensor_constant(self):
class ConstTensor(torch.nn.Module):
def forward(self, x):
return torch.nn.functional.linear(x, torch.zeros(3, 4))
ct = ConstTensor()
traced = symbolic_trace(ct)
traced.graph.lint(traced)
traced(torch.rand(4, 4))
def test_pickle_graphmodule(self):
class Nested(torch.nn.Module):
def __init__(self):
super().__init__()
self.st = torch.nn.Linear(4, 4)
def forward(self, x):
return self.st(x)
n = Nested()
traced = symbolic_trace(n)
traced.graph.lint(traced)
pickled = pickle.dumps(traced)
loaded = pickle.loads(pickled)
loaded.graph.lint(loaded)
x = torch.rand(3, 4)
self.assertEqual(loaded(x), traced(x))
def test_deepcopy_graphmodule_with_transform(self):
st = SimpleTest()
traced = symbolic_trace(st)
traced.graph.lint(traced)
def transform(traced):
new_graph = torch.fx.Graph()
val_map : Dict[Node, Node] = {}
output_value = new_graph.graph_copy(traced.graph, val_map)
relu_out = new_graph.create_node(
op='call_method', target='neg', args=(output_value,), kwargs={})
new_graph.output(relu_out)
return GraphModule(traced, new_graph)
transformed = transform(traced)
transformed.graph.lint(transformed)
copied = copy.deepcopy(transformed)
self.assertNotEqual(id(type(transformed)), id(type(copied)))
x = torch.randn(3, 4)
self.assertEqual(copied(x), transformed(x))
def test_deepcopy_with_submods_params(self):
class Bar(torch.nn.Module):
def __init__(self):
super().__init__()
self.param = torch.nn.Parameter(torch.rand(3, 4))
def forward(self, x):
return torch.relu(x) + self.param
class Baz(torch.nn.Module):
def __init__(self):
super().__init__()
self.param = torch.nn.Parameter(torch.rand(3, 4))
self.bar = Bar()
def forward(self, x):
return self.bar(x) - self.param
baz = Baz()
traced = symbolic_trace(baz)
traced.graph.lint(traced)
copied = copy.deepcopy(traced)
copied.graph.lint(copied)
def test_unpack_list_better_error(self):
class SomeArgs(torch.nn.Module):
def forward(self, a, b):
return torch.rand(3, 4)
class UnpacksList(torch.nn.Module):
def __init__(self):
super().__init__()
self.sa = SomeArgs()
def forward(self, x : list):
return self.sa(*x)
ul = UnpacksList()
with self.assertRaisesRegex(TraceError, 'Proxy object cannot be iterated.'):
symbolic_trace(ul)
def test_unpack_dict_better_error(self):
class SomeKwargs(torch.nn.Module):
def forward(self, x=3, y=4):
return torch.rand(3, 4)
class UnpacksDict(torch.nn.Module):
def __init__(self):
super().__init__()
self.sk = SomeKwargs()
def forward(self, x : dict):
return self.sk(**x)
ud = UnpacksDict()
with self.assertRaisesRegex(TraceError, 'Proxy object cannot be iterated.'):
symbolic_trace(ud)
def test_script_tensor_constant(self):
# TorchScript seems to ignore attributes that start with `__`.
# We used to call anonymous Tensor values `__tensor_constant*`, but
# they were getting ignored by script. Now they're called
# `_tensor_constant*`
class IHaveATensorConstant(torch.nn.Module):
def forward(self, x):
return x + torch.rand(3, 4)
traced = torch.fx.symbolic_trace(IHaveATensorConstant())
torch.jit.script(traced)
def test_torch_custom_ops(self):
class M(torch.nn.Module):
def forward(self, a):
b = torch.ops.aten.sigmoid(a)
c = torch.ops.aten.cat([a, b])
return torch.ops.aten.cat((c, c))
m = M()
input = torch.randn(3)
ref_out = m(input)
gm = symbolic_trace(m)
gm.graph.lint(gm)
out = gm(input)
self.assertEqual(out, ref_out)
def test_replace_target_nodes_with(self):
class testModule(torch.nn.Module):
def forward(self, a, b):
return a + b
m = testModule()
traced = symbolic_trace(m)
input1 = torch.randn(1)
input2 = torch.randn(1)
assert (input1 + input2) == traced(input1, input2)
GraphManipulation.replace_target_nodes_with(
fx_module=traced,
old_op="call_function",
old_target=operator.add,
new_op="call_function",
new_target=operator.mul,
)
assert (input1 * input2) == traced(input1, input2)
def test_pretty_print(self):
st = SimpleTest()
traced = symbolic_trace(st)
traced.graph.lint(traced)
printed = str(traced)
assert 'GraphModuleImpl()' in printed
assert 'torch.relu' in printed
def test_pretty_print_graph(self):
class KwargPrintTest(torch.nn.Module):
def forward(self, x):
return torch.squeeze(x + 3.0, dim=2)
st = KwargPrintTest()
traced = symbolic_trace(st)
traced.graph.lint(traced)
stringed = str(traced.graph)
for s in ['args', 'kwargs', '#users']:
assert s in stringed
def test_graph_fns(self):
g = Graph()
a = g.placeholder('a')
b = g.call_module('linear', (a,))
c = g.get_attr('bias')
d = g.call_method('add', (b, c))
e = g.call_function(torch.sin, (d,))
g.output(e)
mod = torch.nn.Module()
mod.linear = torch.nn.Linear(3, 4)
mod.bias = torch.rand(4)
gm = GraphModule(mod, g)
gm.graph.lint(gm)
input = torch.rand(3)
r = gm(input)
ref = torch.sin(mod.linear(input) + mod.bias)
self.assertEqual(r, ref)
def test_remove_uses(self):
g : torch.fx.Graph = Graph()
x : torch.fx.Node = g.placeholder('x')
relu : torch.fx.Node = g.call_function(torch.relu, (x,))
neg : torch.fx.Node = g.call_function(torch.neg, (relu,))
g.output(neg)
neg.replace_all_uses_with(relu)
g.erase_node(neg)
self.assertTrue(neg not in relu.users)
def test_construct_root_dict(self):
graph : torch.fx.Graph = torch.fx.Graph()
a : torch.fx.Node = graph.create_node('placeholder', 'x')
b : torch.fx.Node = graph.create_node('call_module', 'foo.bar.baz', args=(a,))
c : torch.fx.Node = graph.create_node('get_attr', 'zip.zap.zam')
d : torch.fx.Node = graph.create_node('call_function', operator.add, args=(b, c))
graph.output(d)
linear_mod : torch.nn.Module = torch.nn.Linear(3, 4)
add_param : torch.Tensor = torch.rand(3, 4)
gm : torch.fx.GraphModule = torch.fx.GraphModule(
{'foo.bar.baz': linear_mod, 'zip.zap.zam' : add_param}, graph)
gm.graph.lint(gm)
assert 'self.foo.bar.baz' in gm.code
x : torch.Tensor = torch.rand(3, 3)
out : torch.Tensor = gm(x)
ref_out : torch.Tensor = linear_mod(x) + add_param
self.assertEqual(out, ref_out)
def test_symbolic_trace_assert(self):
message = "assert_foobar"
class AssertsTensorShape(torch.nn.Module):
def forward(self, x):
torch.Assert(x.shape[1] > 4, message)
return x
m = AssertsTensorShape()
# verify traceability
traced = symbolic_trace(m)
# verify assertion on traced model works correctly at runtime
traced(torch.rand(4, 5))
with self.assertRaisesRegex(AssertionError, message):
traced(torch.rand(4, 3))
def test_copy_no_remap(self):
traced = symbolic_trace(SimpleTest())
g = traced.graph
copied = torch.fx.Graph()
for node in g.nodes:
copied.node_copy(node)
with self.assertRaisesRegex(RuntimeError, 'does not belong to this Graph'):
copied.lint()
def test_wrong_topo(self):
graph : torch.fx.Graph = torch.fx.Graph()
a : torch.fx.Node = graph.create_node('placeholder', 'x')
b : torch.fx.Node = graph.create_node('call_module', 'foo.bar.baz', args=(a,))
c : torch.fx.Node = graph.create_node('get_attr', 'zip.zap.zam')
d : torch.fx.Node = graph.create_node('call_function', operator.add, args=(b, c))
graph.output(d)
nodes = list(graph.nodes)
nodes[3].append(nodes[2])
with self.assertRaisesRegex(RuntimeError, 'was used before it has been defined'):
graph.lint()
def test_example_shape_prop(self):
class TestCase(torch.nn.Module):
def __init__(self):
super().__init__()
self.attr = torch.randn(3, 4)
self.submod = torch.nn.Linear(4, 4)
def forward(self, x):
return torch.neg(self.submod(x.relu() + self.attr))
tc = TestCase()
tc_traced = symbolic_trace(tc)
ref_out = tc_traced(torch.rand(3, 4))
shape_prop.ShapeProp(tc_traced).propagate(torch.rand(3, 4))
# Make sure we're testing all opcodes
opcodes = set()
output_shape : Optional[torch.Shape] = None
for node in tc_traced.graph.nodes:
opcodes.add(node.op)
if node.op == 'output':
output_shape = node.args[0].shape
self.assertEqual(opcodes, set(['placeholder', 'get_attr', 'call_function', 'call_method',
'call_module', 'output']))
# Test shape propogation and make sure results match actual
self.assertEqual(output_shape, ref_out.shape)
def test_fn_type_annotations(self):
class Foo(torch.nn.Module):
def forward(self, p : Pair, z : torch.Tensor, i : int) -> Dict[str, torch.Tensor]:
return {'a': p.x + p.y + z + i}
foo_scripted = torch.jit.script(Foo())
foo_scripted(Pair(torch.rand(5), torch.rand(5)), torch.rand(5), 3)
fxed = symbolic_trace(Foo())
fxed_scripted = torch.jit.script(fxed)
fxed_scripted(Pair(torch.rand(5), torch.rand(5)), torch.rand(5), 3)
def test_fn_type_annotation_empty(self):
def forward(a : List[torch.Tensor]):
return a[0]
torch.jit.script(symbolic_trace(forward))
def test_wrapped_method(self):
def wrap_with_relu(fn):
@functools.wraps(fn)
def wrapper(*args, **kwargs):
return torch.relu(fn(*args, **kwargs))
return wrapper
class Foo(torch.nn.Module):
@wrap_with_relu
def forward(self, x, w):
return torch.matmul(x, w)
f = Foo()
traced = symbolic_trace(f)
x, w = torch.rand(3, 4), torch.rand(4, 4)
self.assertTrue(any(n.target == torch.relu for n in traced.graph.nodes))
def test_sequential(self):
m = torch.nn.Sequential(torch.nn.Conv2d(1, 1, 1))
gm = torch.fx.symbolic_trace(m)
gm_copy = copy.deepcopy(gm)
def test_ctx_mgr(self):
@contextlib.contextmanager
def do_nothing():
yield
class M(torch.nn.Module):
def __init__(self):
super().__init__()
@do_nothing()
def forward(self, x):
return torch.relu(x)
m = M()
self.checkGraphModule(m, (torch.rand(3, 4),))
def test_typename_print(self):
graph : torch.fx.Graph = torch.fx.Graph()
x : torch.fx.Node = graph.create_node('placeholder', 'x')
b : torch.fx.Node = graph.create_node('call_function', target=torch.relu, args=(x,),
type_expr=List[float])
output : torch.fx.Node = graph.output(b)
self.assertTrue('typing.List[float]' in str(graph))
def test_inf_nan(self):
class FooMod(torch.nn.Module):
def forward(self, x):
return x + float('inf'), x + float('-inf'), x + float('nan')
fm = FooMod()
self.checkGraphModule(fm, (torch.rand(3, 4),))
def test_inf_nan_kwds(self):
graph : torch.fx.Graph = torch.fx.Graph()
x : torch.fx.Node = graph.create_node('placeholder', 'x')
b : torch.fx.Node = graph.create_node('call_function', operator.add, (x, float('inf')), {}, name='inf')
c : torch.fx.Node = graph.create_node('call_function', operator.add, (x, float('nan')), {}, name='nan')
graph.output((b, c))
gm = torch.fx.GraphModule(torch.nn.Module(), graph)
x = torch.rand(3, 4)
self.assertEqual(gm(x), (x + float('inf'), x + float('nan')))
def test_deepcopy_recursion_depth(self):
depth = sys.getrecursionlimit() + 20
g = torch.fx.Graph()
x = g.placeholder('x')
for i in range(depth):
x = g.call_function(torch.relu, (x,))
g.output(x)
copied_graph = copy.deepcopy(g)
val_map = {}
for orig_node, new_node in zip(g.nodes, copied_graph.nodes):
val_map[orig_node] = new_node
for orig_node, new_node in zip(g.nodes, copied_graph.nodes):
orig_users = set(orig_node.users.keys())
orig_users_equiv = set(val_map[u] for u in orig_users)
new_users = set(new_node.users.keys())
self.assertEqual(orig_users_equiv, new_users)
@skipIfNoTorchVision
def test_replace_uses(self):
rn18 = resnet18()
class LowerReluTracer(torch.fx.Tracer):
def is_leaf_module(self, m : torch.nn.Module, qualname : str):
if isinstance(m, torch.nn.ReLU):
return False
return super().is_leaf_module(m, qualname)
rn18_traced = GraphModule(rn18, LowerReluTracer().trace(rn18))
to_erase = []
for node in rn18_traced.graph.nodes:
if node.op == 'call_function' and node.target in [torch.relu, torch.nn.functional.relu]:
kwargs = node.kwargs.copy()
# Neg doesn't have in-place
kwargs.pop('inplace')
with rn18_traced.graph.inserting_before(node):
new_node = rn18_traced.graph.call_function(
the_function=torch.neg, args=node.args, kwargs=node.kwargs)
node.replace_all_uses_with(replace_with=new_node)
to_erase.append(node)
for node in to_erase:
rn18_traced.graph.erase_node(node)
def test_insertion_point(self):
graph : torch.fx.Graph = torch.fx.Graph()
x : torch.fx.Node = graph.create_node('placeholder', 'x')
b : torch.fx.Node = graph.create_node('call_function', target=torch.relu, args=(x,))
output : torch.fx.Node = graph.output(b)
with graph.inserting_before(b):
neg : torch.fx.Node = graph.call_function(the_function=torch.neg, args=(x,))
_, *relu_args = b.args
b.args = (neg, *relu_args)
gm = torch.fx.GraphModule(torch.nn.Module(), graph)
input = torch.randn(33, 44)
self.assertEqual(gm(input), torch.relu(torch.neg(input)))
def test_move_before(self):
graph : torch.fx.Graph = torch.fx.Graph()
x : torch.fx.Node = graph.create_node('placeholder', 'x')
b : torch.fx.Node = graph.create_node('call_function', target=torch.relu, args=(x,))
output : torch.fx.Node = graph.output(b)
neg : torch.fx.Node = graph.call_function(the_function=torch.neg, args=(x,))
_, *relu_args = b.args
b.args = (neg, *relu_args)
b.prepend(neg)
gm = torch.fx.GraphModule(torch.nn.Module(), graph)
input = torch.randn(33, 44)
self.assertEqual(gm(input), torch.relu(torch.neg(input)))
def test_erase_node_error(self):
st = SimpleTest()
traced = symbolic_trace(st)
for node in traced.graph.nodes:
# Test deleting with uses both in another Node and at the output
if node.target in [operator.add, torch.relu]:
with self.assertRaisesRegex(RuntimeError, 'but it still had .* users in the graph'):
traced.graph.erase_node(node)
def test_copy_it(self):
d = immutable_dict([(3, 4), (5, 6)])
l = immutable_list([(3, 4), (5, 6)])
self.assertEqual(d, deepcopy(d))
self.assertEqual(l, deepcopy(l))
def test_find_uses(self):
graph = torch.fx.Graph()
x = torch.fx.Proxy(graph.placeholder('x'))
y = torch.relu(x)
z = x + x
u = torch.neg(x)
graph.output((y + z + u).node)
graph.lint()
users_of_x = x.node.users
self.assertEqual(len(users_of_x), 3)
expected_ops = set(['relu', 'add', 'neg'])
for use in users_of_x:
assert any(use.name.startswith(prefix) for prefix in expected_ops)
def test_inline_graph(self):
class InlineInto(torch.nn.Module):
def forward(self, x):
return torch.relu(x)
class ToInline(torch.nn.Module):
def forward(self, x):
return torch.neg(x)
inline_into = symbolic_trace(InlineInto())
to_inline = symbolic_trace(ToInline())
combined_graph = torch.fx.Graph()
output_node = combined_graph.graph_copy(inline_into.graph, {})
input_node = list(to_inline.graph.nodes)[0]
assert input_node and input_node.op == 'placeholder'
val_map = {input_node : output_node}
output = combined_graph.graph_copy(to_inline.graph, val_map)
combined_graph.output(output)
combined_module = torch.fx.GraphModule(torch.nn.Module(), combined_graph)
input = torch.rand(3, 4)
self.assertEqual(combined_module(input), input.relu().neg())
def test_multi_insert_point(self):
graph = torch.fx.Graph()
x = torch.fx.Proxy(graph.placeholder('x'))
relu = torch.relu(x)
with graph.inserting_before(relu.node):
y = torch.neg(x)
z = torch.tanh(y)
graph.output((relu.node, z.node))
graph.lint()
expected_ops = ['x', 'neg', 'tanh', 'relu']
for node, expected in zip(graph.nodes, expected_ops):
assert expected in node.name
def test_reassign_args_kwargs_uses(self):
graph = torch.fx.Graph()
x, y = Proxy(graph.placeholder('x')), Proxy(graph.placeholder('y'))
z = x + y
zed = z + z + z
graph.output(zed.node)
graph.lint()
# zed = z + z + z -> zed = z + z + x
zed.node.args = (zed.node.args[0], x.node)
self.assertEqual(x.node.users.keys(), [z.node, zed.node])
# z = x + y -> z = y + y
z.node.args = (y.node, y.node)
self.assertEqual(x.node.users.keys(), [zed.node])
def test_trace_function(self):
def foo(x, y):
return torch.relu(x) + y
x, y = torch.randn(3, 4), torch.randn(3, 4)
self.checkGraphModule(foo, (x, y))
def test_direct_param_use(self):
class TransposeTest(torch.nn.Module):
def __init__(self):
super().__init__()
self.b = torch.nn.Parameter(torch.rand(4, 3))
def forward(self, x):
return self.b
class Foo(torch.nn.Module):
def __init__(self):
super().__init__()
self.a = TransposeTest()
def forward(self, x):
return self.a.b, self.a.b.t(), self.a.b.view(12)
traced = torch.fx.symbolic_trace(Foo())
assert(all('constant' not in node.target for node in traced.graph.nodes))
def test_single_default_arg(self):
class M(torch.nn.Module):
def __init__(self):
super().__init__()
def forward(self, y=1):
return y
m = M()
self.checkGraphModule(m, ())
self.checkGraphModule(m, (3,))
def test_multiple_default_args(self):
class M(torch.nn.Module):
def __init__(self):
super().__init__()
def forward(self, y=1, z=2):
return y + z
m = M()
self.checkGraphModule(m, ())
self.checkGraphModule(m, (3,))
self.checkGraphModule(m, (3, 4))
def test_regular_and_default_args(self):
class M(torch.nn.Module):
def __init__(self):
super().__init__()
def forward(self, x, y=1):
return x + y
m = M()
self.checkGraphModule(m, (2,))
self.checkGraphModule(m, (2, 3))
def test_string_literal_return(self):
class M(torch.nn.Module):
def __init__(self):
super().__init__()
def forward(self):
return "foo"
m = M()
self.checkGraphModule(m, ())
if __name__ == '__main__':
run_tests()
| [
"[email protected]"
] | |
22851edde555a723915cdb62226e165703f4edfb | 55c250525bd7198ac905b1f2f86d16a44f73e03a | /Python/Games/Game of Thrones/flask/bin/flask/lib/python2.7/site-packages/pip/cmdoptions.py | 5b9f06dc119b57172b170108b5967275f923fa78 | [] | no_license | NateWeiler/Resources | 213d18ba86f7cc9d845741b8571b9e2c2c6be916 | bd4a8a82a3e83a381c97d19e5df42cbababfc66c | refs/heads/master | 2023-09-03T17:50:31.937137 | 2023-08-28T23:50:57 | 2023-08-28T23:50:57 | 267,368,545 | 2 | 1 | null | 2022-09-08T15:20:18 | 2020-05-27T16:18:17 | null | UTF-8 | Python | false | false | 130 | py | version https://git-lfs.github.com/spec/v1
oid sha256:a5fdb88accc0dfdae1709e438c5038a03ff3e6f4c8d0d1bdf2a51a847b37a8f3
size 15878
| [
"[email protected]"
] | |
54442e9c8e985ef92e301aa2c7baa274c910bc31 | 050ccac41c3b3b217204eb5871ca987f897b8d56 | /tradeorsale/tests/unit/core.py | a231ecb06478a6a93f65777b268bfbf34a8239b0 | [] | no_license | marconi/tradeorsale | 6aefc7760f389aabd7e08fe40953914f5ea60abc | 6750260734f77cbf60c19ddddc83ebd27a5fb3a9 | refs/heads/master | 2021-01-23T20:21:24.210074 | 2013-01-12T09:05:09 | 2013-01-12T09:05:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,821 | py | # -*- coding: utf-8 -*-
import unittest
import importlib
from paste.deploy.loadwsgi import appconfig
from sqlalchemy import engine_from_config
from StringIO import StringIO
from PIL import Image
from pyramid import testing
from tradeorsale import settings
from tradeorsale.libs.models import initialize_db, Base, DBSession
from tradeorsale.apps.item.models import Item, ItemStatus
pyramid_settings = appconfig('config:test.ini', relative_to='.')
class BaseTestCase(unittest.TestCase):
"""
A parent TestCase with the following enabled support:
- database
- settings
- threadlocals
- static file serving
"""
def __init__(self, *args, **kwargs):
super(BaseTestCase, self).__init__(*args, **kwargs)
self.model_scanner()
# cache the engine so it doesn't get recreated on every setup
self.engine = engine_from_config(pyramid_settings, 'sqlalchemy.')
def model_scanner(self):
"""
Scans all apps for models and imports them so
they can be found by sqlalchemy's metadata.
"""
for app in settings.INSTALLED_APPS:
importlib.import_module(app)
def setUp(self):
initialize_db(self.engine)
Base.metadata.create_all() # create all tables
request = testing.DummyRequest()
self.config = testing.setUp(request=request, settings=pyramid_settings)
self.config.add_static_view('static', 'tradeorsale:static')
self.config.testing_securitypolicy(userid='marc', permissive=True)
def tearDown(self):
testing.tearDown()
# manually delete images path created by item because tearDown
# disruptively drops table and no time to execute delete images event.
self._remove_existing_items()
DBSession.remove()
Base.metadata.drop_all(self.engine) # drop all tables
def _create_item_status(self):
"""
Helper method to create item statuses.
"""
self.draft_status = ItemStatus('DRAFTS')
self.ongoing_status = ItemStatus('ONGOING')
self.archived_status = ItemStatus('ARCHIVED')
DBSession.add(self.draft_status)
DBSession.add(self.ongoing_status)
DBSession.add(self.archived_status)
DBSession.commit()
def _remove_existing_items(self):
"""
Helper method to remove existing items.
"""
for item in DBSession.query(Item).all():
DBSession.delete(item)
DBSession.commit()
class MockFileImage(object):
def __init__(self, file, filename='image.jpg'):
self.file = StringIO()
# create empty image and save it to file attribute
Image.new("RGB", (5, 5), (255, 255, 255)).save(self.file, 'JPEG')
self.file.seek(0)
self.filename = filename
| [
"[email protected]"
] | |
16d05ad9988bfa577d4c6f13830d771a36c469e6 | e3c03026a557cfda67efe7fd5cc8147368bb61d3 | /DoD/data_processing_utils.py | ef8eccf75e6956591e11a59bb9b185177eb53c81 | [
"MIT"
] | permissive | damienrrb/aurum-datadiscovery | f933144f0a2dfe5d043e4c6debd36af25dbd6ee5 | 07f118f1eb6141cbc29b9ea66ee89c27c7b5c4f5 | refs/heads/master | 2020-03-24T05:26:57.474461 | 2018-07-26T20:10:56 | 2018-07-26T20:10:56 | 142,488,834 | 0 | 0 | MIT | 2018-07-26T20:06:11 | 2018-07-26T20:06:10 | null | UTF-8 | Python | false | false | 9,911 | py | import pandas as pd
from collections import defaultdict
import editdistance
from DoD.utils import FilterType
import config as C
# Cache reading and transformation of DFs
cache = dict()
data_separator = C.separator
def configure_csv_separator(separator):
global data_separator
data_separator = separator
def join_ab_on_key(a: pd.DataFrame, b: pd.DataFrame, a_key: str, b_key: str, suffix_str=None):
# First make sure to remove empty/nan values from join columns
# TODO: Generate data event if nan values are found
a_valid_index = (a[a_key].dropna()).index
b_valid_index = (b[b_key].dropna()).index
a = a.iloc[a_valid_index]
b = b.iloc[b_valid_index]
# Normalize join columns
# a_original = a[a_key].copy()
# b_original = b[b_key].copy()
a[a_key] = a[a_key].apply(lambda x: str(x).lower())
b[b_key] = b[b_key].apply(lambda x: str(x).lower())
joined = pd.merge(a, b, how='inner', left_on=a_key, right_on=b_key, sort=False, suffixes=('', suffix_str))
# # Recover format of original columns
# FIXME: would be great to do this, but it's broken
# joined[a_key] = a_original
# joined[b_key] = b_original
return joined
def find_key_for(relation_path, key, attribute, value):
"""
select key from relation where attribute = value;
"""
# normalize this value
value = str(value).lower()
# Check if DF in cache
if relation_path in cache:
df = cache[relation_path]
else:
df = pd.read_csv(relation_path, encoding='latin1', sep=data_separator)
#df = df.apply(lambda x: x.astype(str).str.lower())
# cache[relation_path] = df # cache for later
try:
key_value_df = df[df[attribute].map(lambda x: str(x).lower()) == value][[key]]
except KeyError:
print("wtf")
a = 1
return {x[0] for x in key_value_df.values}
def is_value_in_column(value, relation_path, column):
# normalize this value
value = str(value).lower()
if relation_path in cache:
df = cache[relation_path]
else:
df = pd.read_csv(relation_path, encoding='latin1', sep=data_separator)
#df = df.apply(lambda x: x.astype(str).str.lower())
cache[relation_path] = df # cache for later
return value in df[column].map(lambda x: str(x).lower()).unique()
def obtain_attributes_to_project(jp_with_filters):
filters, jp = jp_with_filters
attributes_to_project = set()
for f in filters:
f_type = f[1].value
if f_type is FilterType.ATTR.value:
attributes_to_project.add(f[0][0])
elif f_type is FilterType.CELL.value:
attributes_to_project.add(f[0][1])
return attributes_to_project
def project(df, attributes_to_project):
# print("Project requested: " + str(attributes_to_project))
# actual_attribute_names = df.columns
# mapping = dict()
# for req in attributes_to_project:
# candidate, score = None, 1000
# for c in actual_attribute_names:
# d = editdistance.eval(req, c)
# if d < score:
# candidate, score = c, d
# mapping[req] = candidate
# print("Projecting on: " + str(mapping.values()))
print("Project: " + str(attributes_to_project))
df = df[list(attributes_to_project)]
return df
class InTreeNode:
def __init__(self, node):
self.node = node
self.parent = None
self.payload = None
def add_parent(self, parent):
self.parent = parent
def set_payload(self, payload: pd.DataFrame):
self.payload = payload
def get_payload(self):
return self.payload
def get_parent(self):
return self.parent
def __hash__(self):
return hash(self.node)
def __eq__(self, other):
# compare with both strings and other nodes
if type(other) is str:
return self.node == other
elif type(other) is InTreeNode:
return self.node == other.node
def materialize_join_graph(jg_with_filters, dod):
def build_tree(jg):
# Build in-tree (leaves to root)
intree = dict() # keep reference to all nodes here
leaves = []
for l, r in jg:
if len(intree) == 0:
node = InTreeNode(l.source_name)
node_path = dod.aurum_api.helper.get_path_nid(l.nid) + "/" + l.source_name
df = get_dataframe(node_path)
node.set_payload(df)
intree[l.source_name] = node
leaves.append(node)
# now either l or r should be in intree
if l.source_name in intree.keys():
rnode = InTreeNode(r.source_name) # create node for r
node_path = dod.aurum_api.helper.get_path_nid(r.nid) + "/" + r.source_name
df = get_dataframe(node_path)
rnode.set_payload(df)
r_parent = intree[l.source_name]
rnode.add_parent(r_parent) # add ref
# r becomes a leave, and l stops being one
if r_parent in leaves:
leaves.remove(r_parent)
leaves.append(rnode)
intree[r.source_name] = rnode
elif r.source_name in intree.keys():
lnode = InTreeNode(l.source_name) # create node for l
node_path = dod.aurum_api.helper.get_path_nid(l.nid) + "/" + l.source_name
df = get_dataframe(node_path)
lnode.set_payload(df)
l_parent = intree[r.source_name]
lnode.add_parent(l_parent) # add ref
if l_parent in leaves:
leaves.remove(l_parent)
leaves.append(lnode)
intree[l.source_name] = lnode
else:
# FIXME: to implement
print("disjoint pair on assembling join in-tree... fix")
exit()
return intree, leaves
def get_join_info_pair(t1, t2, jg):
# t1 and t2 won't never be the same
for l, r in jg:
if (t1 == l.source_name or t1 == r.source_name) and (t2 == l.source_name or t2 == r.source_name):
return l, r
filters, jg = jg_with_filters
intree, leaves = build_tree(jg)
# find groups of leaves with same common ancestor
suffix_str = '_x'
go_on = True
while go_on:
if len(leaves) == 1 and leaves[0].get_parent() is None:
go_on = False
continue # we have now converged
leave_ancestor = defaultdict(list)
for leave in leaves:
if leave.get_parent() is not None: # never add the parent's parent, which does not exist
leave_ancestor[leave.get_parent()].append(leave)
# pick ancestor and find its join info with each children, then join, then add itself to leaves (remove others)
for k, v in leave_ancestor.items():
for child in v:
l_info, r_info = get_join_info_pair(k, child, jg)
l_key = l_info.field_name
r_key = r_info.field_name
l = k.get_payload()
r = child.get_payload()
df = join_ab_on_key(l, r, l_key, r_key, suffix_str=suffix_str)
suffix_str += '_x'
k.set_payload(df) # update payload
if child in leaves:
leaves.remove(child) # removed merged children
# joined all children, now we include joint df on leaves
if k not in leaves: # avoid re-adding parent element
leaves.append(k) # k becomes a new leave
materialized_view = leaves[0].get_payload() # the last leave is folded onto the in-tree root
return materialized_view
def materialize_join_path(jp_with_filters, dod):
filters, jp = jp_with_filters
df = None
suffix = '_x'
for l, r in jp:
l_path = dod.aurum_api.helper.get_path_nid(l.nid)
r_path = dod.aurum_api.helper.get_path_nid(r.nid)
l_key = l.field_name
r_key = r.field_name
print("Joining: " + str(l.source_name) + "." + str(l_key) + " with: " + str(r.source_name) + "." + str(r_key))
if df is None: # first iteration
path = l_path + '/' + l.source_name
if path in cache:
l = cache[path]
else:
l = pd.read_csv(path, encoding='latin1', sep=data_separator)
path = r_path + '/' + r.source_name
if path in cache:
r = cache[path]
else:
r = pd.read_csv(path, encoding='latin1', sep=data_separator)
else: # roll the partially joint
l = df
path = r_path + '/' + r.source_name
if path in cache:
r = cache[path]
else:
r = pd.read_csv(path, encoding='latin1', sep=data_separator)
df = join_ab_on_key(l, r, l_key, r_key, suffix_str=suffix)
suffix += '_x' # this is to make sure we don't end up with repeated columns
return df
def get_dataframe(path):
# TODO: only csv is supported
df = pd.read_csv(path, encoding='latin1', sep=data_separator)
return df
if __name__ == "__main__":
# JOIN
a = pd.read_csv("/Users/ra-mit/data/mitdwhdata/Drupal_employee_directory.csv", encoding='latin1', sep=data_separator)
b = pd.read_csv("/Users/ra-mit/data/mitdwhdata/Employee_directory.csv", encoding='latin1', sep=data_separator)
a_key = 'Mit Id'
b_key = 'Mit Id'
joined = join_ab_on_key(a, b, a_key, b_key)
# Find KEY
path = "/Users/ra-mit/data/mitdwhdata/Warehouse_users.csv"
attribute_name = 'Unit Name'
attribute_value = 'Mechanical Engineering'
key_attribute = 'Krb Name Uppercase'
keys = find_key_for(path, key_attribute, attribute_name, attribute_value)
print(str(keys))
| [
"[email protected]"
] | |
46ea56be6c49a072fddf5364b9d3558b946ccc02 | acd582814b04fb8065d795582f7c5d77db604bea | /nightreads/user_manager/models.py | 02e7dc0a2feb0ca3cc9dd49578f3ecfa6b24f968 | [
"MIT"
] | permissive | lgp171188/nightreads | 30a37a106f05b0bb8c15c95a7e45931e7068f2d3 | b1bf663d4e752b1c137e846e9928fc55004f7951 | refs/heads/master | 2021-01-21T16:15:39.137766 | 2016-05-26T03:40:13 | 2016-05-26T03:47:16 | 59,670,135 | 0 | 0 | null | 2016-05-25T14:28:42 | 2016-05-25T14:28:42 | null | UTF-8 | Python | false | false | 386 | py | from django.db import models
from django.contrib.auth.models import User
from nightreads.utils import TimeStampMixin
from nightreads.posts.models import Tag
class Subscription(TimeStampMixin):
is_subscribed = models.BooleanField(default=False)
user = models.OneToOneField(User)
tags = models.ManyToManyField(Tag)
def __str__(self):
return self.user.username
| [
"[email protected]"
] | |
73d69759d852d2c0af909923caf42a47c061ee40 | 8952afe242c836b516c6236cf0987676cfb7abf7 | /TaobaoSdk/Request/SimbaNonsearchAllplacesGetRequest.py | 0d0d5542730ad88aef570803179f657da9678931 | [] | no_license | xieguanfu/TaobaoOpenPythonSDK | 2fc20df983811990a2d981379c9da6c1117f9f21 | 88cdab41ba19a2326aa4085c92455697bd37d8d7 | refs/heads/master | 2021-01-18T14:38:51.465614 | 2014-08-21T05:44:42 | 2014-08-21T05:44:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,784 | py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim: set ts=4 sts=4 sw=4 et:
## @brief 获取单独出价投放位置列表
# @author [email protected]
# @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 SimbaNonsearchAllplacesGetRequest(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.simba.nonsearch.allplaces.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())
| [
"[email protected]"
] | |
81a47a577a07d2ef20d2a0d108284521ccb59b0b | 60654caf2633613021470d0285817343f76223e5 | /utils/body_to_row.py | 8d642084644245e05c5263bd4a23600e7fa7f042 | [] | no_license | whoiskx/com_code | 79460ccee973d1dfe770af3780c273e4a0f466c9 | 388b5a055393ee7768cc8525c0484f19c3f97193 | refs/heads/master | 2020-04-09T23:14:28.228729 | 2018-12-06T07:10:25 | 2018-12-06T07:10:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,529 | py | def body_to_row(body=''):
if '?' in body:
body = body.split('?')[-1]
# print(body)
body_split = body.split('&')
result = ""
for r in body_split:
result += r + '\n'
print(result)
return result
def headers_to_dict(headers=''):
if headers == '':
return ''
items = headers.split("\n")
# print(items)
d = {}
for item in items:
k, v = item.split(": ", 1)
d[k] = v.strip()
print(d)
return d
def main():
# body_to_row(body)
headers_to_dict(headers=headers)
if __name__ == '__main__':
# body = 'r=0.7690273252447204&__biz=MjM5MTI2MTI0MA%3D%3D&appmsg_type=9&mid=2655142500&sn=77fbb51f69117d7b573e17928f1a26ce&idx=1&scene=0&title=16%25E5%25A4%25A7%25E9%2587%258D%25E7%2582%25B9%25E9%25A1%25B9%25E7%259B%25AE%25E6%259B%259D%25E5%2585%2589%25EF%25BC%2581%25E4%25BD%259B%25E5%25B1%25B1%25E4%25B8%2589%25E6%2597%25A7%25E6%2594%25B9%25E9%2580%25A0%25E5%25AE%25A3%25E4%25BC%25A0%25E5%25A4%25A7%25E7%2589%2587%25E5%2587%25BA%25E7%2582%2589&ct=1530443859&abtest_cookie=BAABAAoACwAMABIACgA%2Bix4A44seAEKPHgBllR4AepUeAICVHgDwlR4AOJYeAJ2WHgC1lh4AAAA%3D&devicetype=android-26&version=26060739&is_need_ticket=0&is_need_ad=1&comment_id=349831597094109186&is_need_reward=0&both_ad=0&reward_uin_count=0&send_time=&msg_daily_idx=1&is_original=0&is_only_read=1&req_id=030920599jFyODX9v0PULyo0&pass_ticket=lmz4dXv%25252FWib0B0%25252B0lpXZZ8VPthtTPqPnjpwYcH6p5usaQBW%25252FdJNeVlTua%25252FCMp8Ki&is_temp_url=0&item_show_type=undefined&tmp_version=1'
headers = '''Host: jin.baidu.com
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Referer: https://jin.baidu.com/v/static/mip2/gongjijin-mip2/mip-login.html?wyn=5213da38-73b8-48ab-adb0-dfd7b9380aff
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9
Cookie: BAIDUID=B2C24DC33FBE42CE4C613FF24AD6DDBE:FG=1; BIDUPSID=B2C24DC33FBE42CE4C613FF24AD6DDBE; PSTM=1528341053; pgv_pvi=4125007872; BDRCVFR[IzI_eUGSZP3]=mbxnW11j9Dfmh7GuZR8mvqV; delPer=0; PSINO=6; pgv_si=s6237508608; ZD_ENTRY=google; BDUSS=kJiaThuZDhvZkhFRTdQckZJeU52cGNoNzVDRzhYYjZDWnl2Y3RBNk5zMEVIZ3BjQVFBQUFBJCQAAAAAAAAAAAEAAACn~KxI0MfG2rDLX7K7t8W82QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASR4lsEkeJbf; H_PS_PSSID=1441_25810_21102_18559_20882_27508'''
main()
| [
"[email protected]"
] | |
9f01b0a8f9ec6d29aba97973f582194564ec31b4 | 1924da60fa3298e386acc6dac9bd390784a9b5bb | /test57.py | 5c6a319152b336f3c4ea818e87668b062f0e03ec | [] | no_license | yukitomo/NLP100DrillExercises | c8a177b56f798cef225ace540e965809a1fc1fbc | ea2ceb366de1fa1f27d084e3b9328cc6f34ac1dd | refs/heads/master | 2020-06-01T02:55:11.423238 | 2015-06-10T15:39:03 | 2015-06-10T15:39:03 | 37,205,750 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 884 | py | #!/usr/bin/python
#-*-coding:utf-8-*-
#2014-12-14 Yuki Tomo
#(57) (56)を修正し,非自立語は出力に含めないようにせよ
#cat test51_japanese.txt|python test57.py
import sys
from test52 import Morph
from test53 import Chunk,cabtxt2chunk_inputter
from collections import defaultdict
def show_dependency_indynoun_verb(text):
for i in range(len(text)):
for j in range(len(text[i])):
dst = text[i][j].dst
if not dst == -1 :
#係り元文節 text[i][j]
#係り先文節 text[i][dst]
if text[i][j].noun_in() and text[i][dst].verb_in(): #それぞれ名詞、動詞を含むか
#非自立語は除去
print "%s\t%s"%(text[i][j].phrase_independent(), text[i][dst].phrase_independent())
else:
pass
def main():
text_chunk = cabtxt2chunk_inputter(sys.stdin)
show_dependency_indynoun_verb(text_chunk)
if __name__ == '__main__':
main() | [
"[email protected]"
] | |
7f1d0a8ce4c9888b733f77c5f659c376afbf1b78 | 9f2445e9a00cc34eebcf3d3f60124d0388dcb613 | /2019-04-02-Traub1991/plot_steadystate_constants.py | b77e2617830947d93bdfdab0f5048daf51f56e97 | [] | no_license | analkumar2/Thesis-work | 7ee916d71f04a60afbd117325df588908518b7d2 | 75905427c2a78a101b4eed2c27a955867c04465c | refs/heads/master | 2022-01-02T02:33:35.864896 | 2021-12-18T03:34:04 | 2021-12-18T03:34:04 | 201,130,673 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 5,573 | py | #Author - Anal Kumar
#disclaimer - The code uses eval() function. Use at your own discretion.
import moose
import rdesigneur as rd
import numpy as np
import matplotlib.pyplot as plt
import Channelprotos as Cp #Channelprotos and rdesigneurProtos should be in the same directory as the pwd
try:
moose.delete('/model')
moose.delete('/library')
except:
pass
Cp_list = dir(Cp) #getting a list of all variables and functions in the Channelprotos and rdesigneurProtos
for func in Cp_list: #Channelprotos
if callable( eval('Cp.%s' %(func)) ): #checking if its a function or another variable
moose.Neutral('/library') #setting up library
try:
eval('Cp.%s(\'%s\')' %(func, func)) # setting up the channel
Chan = moose.element('/library/' + func)
except:
continue
if Chan.className == 'HHChannel': #use this if the channel setup is HHChanel
#Xgate
if Chan.Xpower >=1 and Chan.instant != 1:
Chanxgate = moose.element(Chan.path + '/gateX')
min = Chanxgate.min
max = Chanxgate.max
minf = Chanxgate.tableA/Chanxgate.tableB
tau = 1/Chanxgate.tableB
plt.figure(0)
plt.plot(np.linspace(min, max, len(minf)), minf, color = 'red', label = 'mInfinity')
plt.xlabel('Membrane potential (V)')
plt.ylabel('mInfinity')
plt.title(func + ' mInfinity for its x gate')
plt.legend()
plt.savefig('./gateparams/Cp_' + func + '_xgate_mInf.png')
plt.figure(1)
plt.plot(np.linspace(min, max, len(tau)), tau, color = 'blue', label = 'Tau')
plt.xlabel('Membrane potential (V)')
plt.ylabel('Time constant (s)')
plt.title(func + ' time constant for its x gate')
plt.legend()
plt.savefig('./gateparams/Cp_' + func + '_xgate_tau.png')
plt.close('all')
# Ygate
if Chan.Ypower >=1 and Chan.instant != 2:
Chanygate = moose.element(Chan.path + '/gateY')
min = Chanygate.min
max = Chanygate.max
minf = Chanygate.tableA/Chanygate.tableB
tau = 1/Chanygate.tableB
plt.figure(0)
plt.plot(np.linspace(min, max, len(minf)), minf, color = 'red', label = 'mInfinity')
plt.xlabel('Membrane potential (V)')
plt.ylabel('mInfinity')
plt.title(func + ' mInfinity for its y gate')
plt.legend()
plt.savefig('./gateparams/Cp_' + func + '_ygate_mInf.png')
plt.figure(1)
plt.plot(np.linspace(min, max, len(tau)), tau, color = 'blue', label = 'Tau')
plt.xlabel('Membrane potential (V)')
plt.ylabel('Time constant (s)')
plt.title(func + ' time constant for its y gate')
plt.legend()
plt.savefig('./gateparams/Cp_' + func + '_ygate_tau.png')
plt.close('all')
# Zgate
if Chan.Zpower >=1 and Chan.instant != 4 and Chan.useConcentration == 0:
Chanzgate = moose.element(Chan.path + '/gateZ')
min = Chanzgate.min
max = Chanzgate.max
minf = Chanzgate.tableA/Chanzgate.tableB
tau = 1/Chanzgate.tableB
plt.figure(0)
plt.plot(np.linspace(min, max, len(minf)), minf, color = 'red', label = 'mInfinity')
plt.xlabel('Membrane potential (V)')
plt.ylabel('mInfinity')
plt.title(func + ' mInfinity for its z gate')
plt.legend()
plt.savefig('./gateparams/Cp_' + func + '_zgate_mInf.png')
plt.figure(1)
plt.plot(np.linspace(min, max, len(tau)), tau, color = 'blue', label = 'Tau')
plt.xlabel('Membrane potential (V)')
plt.ylabel('Time constant (s)')
plt.title(func + ' time constant for its z gate')
plt.legend()
plt.savefig('./gateparams/Cp_' + func + '_zgate_tau.png')
plt.close('all')
elif Chan.Zpower >=1 and Chan.instant != 4 and Chan.useConcentration == 1:
Chanzgate = moose.element(Chan.path + '/gateZ')
min = Chanzgate.min
max = Chanzgate.max
minf = Chanzgate.tableA/Chanzgate.tableB
tau = 1/Chanzgate.tableB
plt.figure(0)
plt.plot(np.linspace(min, max, len(minf)), minf, color = 'red', label = 'mInfinity')
plt.xlabel('Calcium concentration (mol/m^3)')
plt.ylabel('mInfinity')
plt.title(func + ' mInfinity for its z gate')
plt.legend()
plt.savefig('./gateparams/Cp_' + func + '_zgate_mInf.png')
plt.figure(1)
plt.plot(np.linspace(min, max, len(tau)), tau, color = 'blue', label = 'Tau')
plt.xlabel('Calcium concentration (mol/m^3)')
plt.ylabel('Time constant (s)')
plt.title(func + ' time constant for its z gate')
plt.legend()
plt.savefig('./gateparams/Cp_' + func + '_zgate_tau.png')
plt.close('all')
print 'Cp_' + str(func)
moose.delete('/library') | [
"[email protected]"
] | |
408bc8142e8201c4f69273c94a5d7cc8a3391f73 | f52c121da03c427a7b1a4f70d6c6d379869f338e | /CGAT/WrapperBl2Seq.py | 2b72705164e87201f6a0724c9bde4859f7425fce | [
"BSD-2-Clause"
] | permissive | orianna14/cgat | 7975e5cb8d907f2c83236a6e926d7f4230eb6788 | 7494d17f0a9e3f2333483426aef2c163f3fee0b1 | refs/heads/master | 2021-01-22T11:11:24.509030 | 2015-01-09T11:16:25 | 2015-01-09T11:16:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,850 | py | ##########################################################################
#
# MRC FGU Computational Genomics Group
#
# $Id$
#
# Copyright (C) 2009 Andreas Heger
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
##########################################################################
'''
WrapperBl2Seq.py -
======================================================
:Author: Andreas Heger
:Release: $Id$
:Date: |today|
:Tags: Python
Code
----
'''
import os
import sys
import string
import re
import tempfile
import subprocess
import optparse
"""Wrapper for adaptive codon bias program
"""
from CGAT import Experiment as Experiment
from CGAT import FastaIterator as FastaIterator
class Bl2SeqError(Exception):
pass
class Bl2Seq:
mOptions = ""
mExecutable = "bl2seq"
mStderr = sys.stderr
def __init__(self, options=""):
self.mOptions = options
def CreateTemporaryFiles(self):
"""create temporary files."""
self.mTempDirectory = tempfile.mkdtemp()
self.mFilenameTempInput = self.mTempDirectory + "/input"
self.mFilenameTempOutput = self.mTempDirectory + "/output"
def DeleteTemporaryFiles(self):
"""clean up."""
os.remove(self.mFilenameTempInput)
os.remove(self.mFilenameTempOutput)
os.rmdir(self.mTempDirectory)
def SetStderr(self, file=None):
"""set file for dumping stderr."""
self.mStderr = file
def WriteOutput(self, lines, filename_output=None):
"""write output to file.
If file is not given, lines are written to stdout.
"""
if filename_output:
outfile = open(filename_output, "w")
else:
outfile = sys.stdout
outfile.write(string.join(lines, ""))
if filename_output:
outfile.close()
def ParseResult(self, trace_file=None, information_file=None):
result = AdaptiveCAIResult()
result.Read(trace_file, information_file)
return result
def RunOnFile(self, infile, outfile, errfile):
self.CreateTemporaryFiles()
statement = string.join((self.mExecutable,
self.mFilenameTempInput,
self.mFilenameTempOutput),
" ")
i = FastaIterator.FastaIterator(infile)
outfile.write("GENE\tBl2Seq\n")
while 1:
f = i.next()
if f is None:
break
file = open(self.mFilenameTempInput, "w")
file.write(">%s\n%s" % (f.title, f.sequence))
file.close()
s = subprocess.Popen(statement,
shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
cwd=self.mTempDirectory,
close_fds=True)
(out, err) = s.communicate()
if s.returncode != 0:
raise Bl2SeqError, "Error in calculating Bl2Seq\n%s" % err
d = open(self.mFilenameTempOutput).readlines()[2][:-1]
enc = d.split(" ")[2]
outfile.write((string.join((f.title, enc), "\t")) + "\n")
errfile.write(err)
self.DeleteTemporaryFiles()
if __name__ == "__main__":
parser = E.OptionParser(
version="%prog version: $Id: WrapperBl2Seq.py 2781 2009-09-10 11:33:14Z andreas $")
parser.add_option("-f", "--input-file", dest="input_filename", type="string",
help="input filename. If '-', stdin is used [default=%default].",
metavar="FILE")
parser.add_option("-o", "--output-file", dest="output_filename", type="string",
help="output filename for codon usage. If '-', output is stdout [default=%default].",
metavar="FILE")
parser.add_option("-e", "--error-file", dest="error_filename", type="string",
help="output filename for error messages. If '-', output is stderr [default=%default].",
metavar="FILE")
parser.set_defaults(
input_filename="-",
output_filename="-",
error_filename="/dev/null",
)
(options, args) = Experiment.Start(parser)
wrapper = Bl2Seq()
if options.input_filename == "-":
file_stdin = sys.stdin
else:
file_stdin = open(options.input_filename, "r")
if options.output_filename:
if options.output_filename == "-":
file_stdout = sys.stdout
else:
file_stdout = open(options.output_filename, "w")
if options.error_filename:
if options.error_filename == "-":
file_stderr = sys.stderr
else:
file_stderr = open(options.error_filename, "w")
wrapper.RunOnFile(file_stdin, file_stdout, file_stderr)
if file_stdin and file_stdin != sys.stdin:
file_stdin.close()
if file_stdout and file_stdout != sys.stdout:
file_stdout.close()
if file_stderr and file_stderr != sys.stderr:
file_stderr.close()
Experiment.Stop()
| [
"[email protected]"
] | |
dcff796b59a37ecaef4452f97bf6cbec40f411ef | b7939b343e52d2633857a93e19108dde49109008 | /build/scripts-2.5/Packet.py | b28285fca318fcbe0666dec643c67b7e5b67a9ad | [] | no_license | hobson/safety-monitor | 040e74e0ac6d153b084860b3cdd6d9739fd0c10e | 122b09bc7f55302cdd5fda576358b56dcd8ee03e | refs/heads/master | 2021-01-22T05:28:23.350603 | 2012-04-15T04:45:09 | 2012-04-15T04:45:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 11,342 | py | #import math # surprisingly this isn't required for min() and max() functions
import re
import binascii
import string
#from array import array # is this required
import pickle #serialization of objects
class Packet(object):
def __str__(s):
if s and s.t:
text = "%(srcAdd)05d ->%(dstAdd)05d\t" % {'srcAdd': s.srcAdd, 'dstAdd': s.dstAdd}
for i in range(s.TT_MAX_NEIGHBORS):
text += str(s.neighbors[i][0])+"=\t"+str(s.neighbors[i][1])+"\t"+str(s.neighbors[i][2])+"\t| "
else:
#log.debug("Unusual Packet: probably a comment at the beginning or end of the log file")
text = "----------"
#ActionHL: really need to delay the display of this packet until a display timer goes off and when it does trigger the read of the next packet
#ActionHL: otherwise the simulation of the real timing of packets isn't realistic and code may break on real packets and not during simulation
#text+="\n"
text = ''.join([(c >= '\x09') and c or '<%d>' % ord(c) for c in text]) # replace characers with ascii less than 9 with their ASCI decimal value surrounded by <> brackets
return text
def __init__(s, text):
s.TT_MAX_NEIGHBORS = 3 # including self
s.TT_PACKET_BYTES = 43
s.TT_PAYLOAD_BYTES = 16
s.TT_BYTES_PER_NEIGHBOR = 4
s.TT_MAX_NWK_ADD = 3
s.MAC_TYPES = ["Beacon", "Data", "Acknowledgement", "Command"]
s.MAX_MAC_TYPE = 3
s.MAC_COMMANDS = ["Undefined", "Association Request", "Association Response",\
"Disassociation Notification", "Data Request", \
"PAN ID Conflict Notification", "Orphan Notification", \
"Beacon Request", "Coordinator Realignment", "GTS Request",\
"Reserved"]
s.MAX_MAC_COMMAND = int(10)
s.SECURITY_KEY_ID_BYTES = [0, 1, 5, 9] # total security header lengths can be [0, 5, 6, 10, 14]
s.translation_table = ''.join(chr(i) for i in xrange(256))
s.t = None; # time the packet was received (relative to the previous packet received)
s.seq = None; # sequence number transmitted by the sender (relative to the other packets it has sent)
s.N = None; # number of bytes in the entire MAC packet, including FCF header and CRC footer
s.FCF = None; # 2 byte frame control field
s.pTime = re.compile(r"^\s*(\d*\.\d*)mS\s+([0123456789ABCDEF ]+)\s*") # pattern for pulling the time value off
s.h = None # string array of hexadecimal characters without spaces (2 characters for each byte)
s.b = None #[""] #array('B',"") # array of bytes directly representing the values in the packet
s.srcAdd = 0L # network address of the source
s.dstAdd = 0L # network address of the destination
s.mac_type = 0 # MAC frame type (0=Beacon, 1=Data, 2=Acknowledgement, 3=Command)
s.mac_type_name = ""
s.mac_command = 0 # 0=Undefined, 1=Association Request, ..., 9=GTS Request, 10<=Reserved
s.mac_command_name = ""
s.srcAddMode = 0 # this integer is redundant with the bit counts below
s.dstAddMode = 0 # this integer is redundant with the bit counts below
s.srcAddBytes = 0 # 0, 16, or 64 bit network address used for the source address
s.dstAddBytes = 0 # 0, 16, or 64 bit network address used for the destination address
s.srcPANBytes = 0 # 0, 16, or 64 bit network address used for the source address
s.srcPANBytes = 0 # 0, 16, or 64 bit network address used for the source address
s.dstPAN = 0L
s.srcPAN = 0L
s.PANIDCompressed = False
s.reqACK = False
s.secEnabled = False
s.pendPacket = False
s.invalidResBits = 0
s.secKeyIDBytes = 0
s.SCF = 0
s.secLevel = 0
s.secKeyIDMode = 0
s.secInvalidResBits = 0
s.secFrameCounter = 0L # need 8-bit unsigne int
s.secKeyIDBytes = 0
s.secKeyID = 0L # need 64-bit unsigned ing
s.CRC = None # need 16-bit unsigned int
s.mac_header_bytes = None
s.mac_footer_bytes = None
s.nwk_header_bytes = None
s.packet_bytes = None
#actHL: make this a numpy matrix for easier processing and sizing
s.neighbors = [[int(0) for i in range(s.TT_BYTES_PER_NEIGHBOR)] for i in range(s.TT_MAX_NEIGHBORS+1)]
m = re.match(s.pTime,text)
if m and len(m.groups())==2:
#print m.groups()
s.t = m.group(1)
s.h = m.group(2)
#print s.h
s.h = s.h.translate(s.translation_table, " \t")
s.b = binascii.unhexlify(s.h) # should also look into array.byteswap for the portions of the array that contian multi-byte elements misordered
#print "Hex digits:" + str(len(s.h))
else:
return None
#print "Not a standard hexadecimal packet line."
s.packet_bytes = len(s.b)
nextByte = 0
# for TT packets this is bytes 0 & 1 from left (0 offset, 0 = first byte received)
s.FCF = long(ord(s.b[nextByte+1]))*256 + long(ord(s.b[nextByte]))
nextByte += 2
# bytes swapped and bits read from LSB to MSB to match 802.15.4 spec
s.mac_type = int((s.FCF & (0x03 << 0))>>0 )
s.invalidResBits = long((s.FCF & (0x01 << 2))>>2 ) #2 bit (#0= LSB) should always be zero
s.secEnabled = bool((s.FCF & (0x01 << 3))>>3 )
s.pendPacket = bool((s.FCF & (0x01 << 4))>>4 )
s.reqACK = bool((s.FCF & (0x01 << 5))>>5 )
s.PANIDCompressed = bool((s.FCF & (0x01 << 6))>>6 )
s.invalidResBits += long((s.FCF & (0x07 << 7))>>7 ) #7,8&9 bits (#0=LSB) should always be zero
s.dstAddMode = int((s.FCF & (0x03 << 10))>>10)
s.invalidResBits += long((s.FCF & (0x03 << 12))>>12) #12&13 bits (#0=LSB) should always be zero
s.srcAddMode = int((s.FCF & (0x03 << 14))>>14)
s.mac_type_name = s.MAC_TYPES[ min( max(s.mac_type, 0) , s.MAX_MAC_TYPE) ]
s.dstAddBytes = int((4**s.dstAddMode)/8) if s.dstAddMode>0 else 0
s.srcAddBytes = int((4**s.srcAddMode)/8) if s.srcAddMode>0 else 0
#print "srcAddbytes=" + str(s.srcAddBytes)
s.srcPANBytes = 2 if s.srcAddMode and not s.PANIDCompressed else 0
s.dstPANBytes = 2 if s.dstAddMode else 0
# for TT packets this is byte 2 from left (0 offset, 0 = first byte received)
s.seq = ord(s.b[nextByte])
# for TT packets this is bytes 3 & 4 from left (0 offset, 0 = first byte received)
nextByte += 1 # position of next unprocessed byte in the array s.b[]
if s.dstPANBytes > 0:
s.dstPAN = 0L
for i in range(s.dstPANBytes):
s.dstPAN += long(ord(s.b[nextByte+i]))<<(i*8)
nextByte += s.dstPANBytes
# for TT packets this is bytes 5 & 6 from left (0 offset, 0 = first byte received)
s.dstAdd = 0L
for i in range(s.dstAddBytes):
s.dstAdd += long(ord(s.b[nextByte+i]))<<(i*8)
nextByte += s.dstAddBytes
# for TT packets PANIDCompressed is always true, so no bytes used for srcPAN
if s.PANIDCompressed:
s.srcPAN = s.dstPAN
else:
s.srcPAN = 0L
for i in range(s.srcPANBytes):
s.srcPAN += long(ord(s.b[nextByte+i]))<<(i*8)
nextByte += s.srcPANBytes
# for TT packets this is bytes 7 & 8 from left (0 offset, 0 = first byte received)
s.srcAdd = 0L
for i in range(s.srcAddBytes):
s.srcAdd += long(ord(s.b[nextByte+i] ))<<(i*8)
#print "srcAdd=" + str(s.srcAdd) + "@ byte" + str(nextByte)
nextByte += s.srcAddBytes
# Security Control Field, Frame Counter, and KeyIDMode
# HL: need to check that I'm doing the correct byte order/swapping here
if s.secEnabled:
s.SCF = s.b[nextByte]
s.secLevel = int((s.SCF & (0x07 << 0))>>0 )
s.secKeyIDMode = int((s.SCF & (0x03 << 3))>>3 )
s.secInvalidResBits = int((s.SCF & (0x07 << 5))>>5 ) # reserved bits for which nonzero is invalid
nextByte += 1
s.secFrameCounter = long(s.b[nextByte]) # need long to capture the unsigned char as a signed integer
nextByte += 1
# HL: key index is shown on the right in a multi-octet field so it is the MSbyte and RXed last
s.secKeyIDBytes = s.SECURITY_KEY_ID_BYTES[s.secKeyIDMode]
s.secKeyID = 0
if s.secKeyIDMode > 0:
for i in range(s.secKeyIDBytes):
s.secKeyID += long(ord(s.b[nextByte+i]))<<(i*8)
nextByte += s.secKeyIDBytes
if s.mac_type_name == "Command":
s.mac_command = int(ord(s.b[nextByte]))
s.mac_command_name = s.MAC_COMMANDS[ min(max(s.mac_command, 0), s.MAX_MAC_COMMAND) ]
else:
s.mac_command = None
s.mac_command_name = None
s.mac_header_bytes = nextByte
s.CRC = long(ord(s.b[s.packet_bytes-1]))*256 + long(ord(s.b[s.packet_bytes-2]))
s.mac_footer_bytes = 2 # 2-byte CRC
# unfortunately this only gets us through the MAC header (1st 10 bytes), the NWK header is another 15 bytes
# HL: may need to implement NWK header/footer parsing
s.nwk_header_bytes = 16
if s.mac_header_bytes > s.packet_bytes - s.mac_footer_bytes:
return None
#print nextByte
#print s.mac_header_bytes
#print s.mac_header_bytes + s.nwk_header_bytes + s.mac_footer_bytes + s.TT_PAYLOAD_BYTES
#print s.packet_bytes
# this may ignore packets that are good if NWK header length is not consitently 15 bytes for good packets
if s.mac_header_bytes + s.nwk_header_bytes + s.mac_footer_bytes + s.TT_PAYLOAD_BYTES != s.packet_bytes:
return None
i0 = s.packet_bytes - s.TT_PAYLOAD_BYTES - s.mac_footer_bytes + s.TT_BYTES_PER_NEIGHBOR # (skip the first neighbor entry, it's a self info entry)
for i in range( s.TT_MAX_NEIGHBORS ):
#print "processing neighbor" + str(i) + "with" + str(( ord(s.b[i0+i*4 ])<=s.TT_MAX_NWK_ADD)) + str((i-1) <= ord( s.b[i0+i+3]))
nAdd = int(ord(s.b[i0+i*4]))
#print " neighbor address" + str(nAdd)
# this additional check doesn't work: (ord(s.b[i0+i*4+3]) <= s.TT_MAX_NEIGHBORS) nor this (i-1) <= ord( s.b[i0+i+3]))
# for some reason the numneighbors value reported by each device is different and usually much larger than 3
if (nAdd <= s.TT_MAX_NWK_ADD) :
# NWK_ID CRC valid, RSSI, LQI, num_neighbors
s.neighbors[ i ][0] = nAdd #int((ord(s.b[i*4+1]) & (0x01 << 7))>>7 ) # CRC
#print "rssi = " + str(ord(s.b[i0+i*4+1])) + " " + str(ord(s.b[i0+i*4+2]))
s.neighbors[ i ][1] = int( ord(s.b[i0+i*4+1]) & 0x1F ) #RSSI
s.neighbors[ i ][2] = int( ord(s.b[i0+i*4+2]) ) #LQI
s.neighbors[ i ][3] = int( ord(s.b[i0+i*4+3]) ) #numneighbors (doesn't seem right)
# end of __init_
def Describes(s):
s.description = ""
s.description += s.t + " ms "
s.description += s.secLevel if s.secLevel > 0 else ""
return s.description
def Describe(s):
print s.Describes()
if __name__ == "__main__":
p = Packet( " 753.231990mS 61 88 3D 3B 0C 01 00 00 00 48 00 01 "+\
"00 00 00 03 5C 40 01 01 00 00 30 01 0A 00 00 00 00 03 B7 90 "+\
"18 02 B1 7A 18 01 BF C7 18 F2 54")
#print p.h
print pickle.dumps(p)
p = Packet( " 1506.816000mS 03 08 01 FF FF FF FF 07 13 2D")
print pickle.dumps(p)
| [
"[email protected]"
] | |
aca4ca0c39312e95987015256fa06b2de03e1a64 | c16ea32a4cddb6b63ad3bacce3c6db0259d2bacd | /google/ads/googleads/v8/googleads-py/tests/unit/gapic/googleads.v8/test_module_import.py | b35c5788522ecd9b7d328ccbbdd30b4862576d92 | [
"Apache-2.0"
] | permissive | dizcology/googleapis-gen | 74a72b655fba2565233e5a289cfaea6dc7b91e1a | 478f36572d7bcf1dc66038d0e76b9b3fa2abae63 | refs/heads/master | 2023-06-04T15:51:18.380826 | 2021-06-16T20:42:38 | 2021-06-16T20:42:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 422,437 | py | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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 pytest
def test_module_level_imports():
expected_names = []
# Message types
from google.ads.googleads import PolicyTopicEntryTypeEnum
expected_names.append(PolicyTopicEntryTypeEnum.__name__)
from google.ads.googleads import PolicyTopicEvidenceDestinationMismatchUrlTypeEnum
expected_names.append(PolicyTopicEvidenceDestinationMismatchUrlTypeEnum.__name__)
from google.ads.googleads import PolicyTopicEvidenceDestinationNotWorkingDeviceEnum
expected_names.append(PolicyTopicEvidenceDestinationNotWorkingDeviceEnum.__name__)
from google.ads.googleads import PolicyTopicEvidenceDestinationNotWorkingDnsErrorTypeEnum
expected_names.append(PolicyTopicEvidenceDestinationNotWorkingDnsErrorTypeEnum.__name__)
from google.ads.googleads import PolicyViolationKey
expected_names.append(PolicyViolationKey.__name__)
from google.ads.googleads import PolicyValidationParameter
expected_names.append(PolicyValidationParameter.__name__)
from google.ads.googleads import PolicyTopicEntry
expected_names.append(PolicyTopicEntry.__name__)
from google.ads.googleads import PolicyTopicEvidence
expected_names.append(PolicyTopicEvidence.__name__)
from google.ads.googleads import PolicyTopicConstraint
expected_names.append(PolicyTopicConstraint.__name__)
from google.ads.googleads import PolicyApprovalStatusEnum
expected_names.append(PolicyApprovalStatusEnum.__name__)
from google.ads.googleads import PolicyReviewStatusEnum
expected_names.append(PolicyReviewStatusEnum.__name__)
from google.ads.googleads import AdAssetPolicySummary
expected_names.append(AdAssetPolicySummary.__name__)
from google.ads.googleads import AssetPerformanceLabelEnum
expected_names.append(AssetPerformanceLabelEnum.__name__)
from google.ads.googleads import ServedAssetFieldTypeEnum
expected_names.append(ServedAssetFieldTypeEnum.__name__)
from google.ads.googleads import AdTextAsset
expected_names.append(AdTextAsset.__name__)
from google.ads.googleads import AdImageAsset
expected_names.append(AdImageAsset.__name__)
from google.ads.googleads import AdVideoAsset
expected_names.append(AdVideoAsset.__name__)
from google.ads.googleads import AdMediaBundleAsset
expected_names.append(AdMediaBundleAsset.__name__)
from google.ads.googleads import CallConversionReportingStateEnum
expected_names.append(CallConversionReportingStateEnum.__name__)
from google.ads.googleads import DisplayAdFormatSettingEnum
expected_names.append(DisplayAdFormatSettingEnum.__name__)
from google.ads.googleads import DisplayUploadProductTypeEnum
expected_names.append(DisplayUploadProductTypeEnum.__name__)
from google.ads.googleads import LegacyAppInstallAdAppStoreEnum
expected_names.append(LegacyAppInstallAdAppStoreEnum.__name__)
from google.ads.googleads import MimeTypeEnum
expected_names.append(MimeTypeEnum.__name__)
from google.ads.googleads import TextAdInfo
expected_names.append(TextAdInfo.__name__)
from google.ads.googleads import ExpandedTextAdInfo
expected_names.append(ExpandedTextAdInfo.__name__)
from google.ads.googleads import ExpandedDynamicSearchAdInfo
expected_names.append(ExpandedDynamicSearchAdInfo.__name__)
from google.ads.googleads import HotelAdInfo
expected_names.append(HotelAdInfo.__name__)
from google.ads.googleads import ShoppingSmartAdInfo
expected_names.append(ShoppingSmartAdInfo.__name__)
from google.ads.googleads import ShoppingProductAdInfo
expected_names.append(ShoppingProductAdInfo.__name__)
from google.ads.googleads import ShoppingComparisonListingAdInfo
expected_names.append(ShoppingComparisonListingAdInfo.__name__)
from google.ads.googleads import GmailAdInfo
expected_names.append(GmailAdInfo.__name__)
from google.ads.googleads import GmailTeaser
expected_names.append(GmailTeaser.__name__)
from google.ads.googleads import DisplayCallToAction
expected_names.append(DisplayCallToAction.__name__)
from google.ads.googleads import ProductImage
expected_names.append(ProductImage.__name__)
from google.ads.googleads import ProductVideo
expected_names.append(ProductVideo.__name__)
from google.ads.googleads import ImageAdInfo
expected_names.append(ImageAdInfo.__name__)
from google.ads.googleads import VideoBumperInStreamAdInfo
expected_names.append(VideoBumperInStreamAdInfo.__name__)
from google.ads.googleads import VideoNonSkippableInStreamAdInfo
expected_names.append(VideoNonSkippableInStreamAdInfo.__name__)
from google.ads.googleads import VideoTrueViewInStreamAdInfo
expected_names.append(VideoTrueViewInStreamAdInfo.__name__)
from google.ads.googleads import VideoOutstreamAdInfo
expected_names.append(VideoOutstreamAdInfo.__name__)
from google.ads.googleads import VideoTrueViewDiscoveryAdInfo
expected_names.append(VideoTrueViewDiscoveryAdInfo.__name__)
from google.ads.googleads import VideoAdInfo
expected_names.append(VideoAdInfo.__name__)
from google.ads.googleads import VideoResponsiveAdInfo
expected_names.append(VideoResponsiveAdInfo.__name__)
from google.ads.googleads import ResponsiveSearchAdInfo
expected_names.append(ResponsiveSearchAdInfo.__name__)
from google.ads.googleads import LegacyResponsiveDisplayAdInfo
expected_names.append(LegacyResponsiveDisplayAdInfo.__name__)
from google.ads.googleads import AppAdInfo
expected_names.append(AppAdInfo.__name__)
from google.ads.googleads import AppEngagementAdInfo
expected_names.append(AppEngagementAdInfo.__name__)
from google.ads.googleads import LegacyAppInstallAdInfo
expected_names.append(LegacyAppInstallAdInfo.__name__)
from google.ads.googleads import ResponsiveDisplayAdInfo
expected_names.append(ResponsiveDisplayAdInfo.__name__)
from google.ads.googleads import LocalAdInfo
expected_names.append(LocalAdInfo.__name__)
from google.ads.googleads import DisplayUploadAdInfo
expected_names.append(DisplayUploadAdInfo.__name__)
from google.ads.googleads import ResponsiveDisplayAdControlSpec
expected_names.append(ResponsiveDisplayAdControlSpec.__name__)
from google.ads.googleads import SmartCampaignAdInfo
expected_names.append(SmartCampaignAdInfo.__name__)
from google.ads.googleads import CallAdInfo
expected_names.append(CallAdInfo.__name__)
from google.ads.googleads import AgeRangeTypeEnum
expected_names.append(AgeRangeTypeEnum.__name__)
from google.ads.googleads import AppPaymentModelTypeEnum
expected_names.append(AppPaymentModelTypeEnum.__name__)
from google.ads.googleads import ContentLabelTypeEnum
expected_names.append(ContentLabelTypeEnum.__name__)
from google.ads.googleads import DayOfWeekEnum
expected_names.append(DayOfWeekEnum.__name__)
from google.ads.googleads import DeviceEnum
expected_names.append(DeviceEnum.__name__)
from google.ads.googleads import GenderTypeEnum
expected_names.append(GenderTypeEnum.__name__)
from google.ads.googleads import HotelDateSelectionTypeEnum
expected_names.append(HotelDateSelectionTypeEnum.__name__)
from google.ads.googleads import IncomeRangeTypeEnum
expected_names.append(IncomeRangeTypeEnum.__name__)
from google.ads.googleads import InteractionTypeEnum
expected_names.append(InteractionTypeEnum.__name__)
from google.ads.googleads import KeywordMatchTypeEnum
expected_names.append(KeywordMatchTypeEnum.__name__)
from google.ads.googleads import ListingGroupTypeEnum
expected_names.append(ListingGroupTypeEnum.__name__)
from google.ads.googleads import LocationGroupRadiusUnitsEnum
expected_names.append(LocationGroupRadiusUnitsEnum.__name__)
from google.ads.googleads import MinuteOfHourEnum
expected_names.append(MinuteOfHourEnum.__name__)
from google.ads.googleads import ParentalStatusTypeEnum
expected_names.append(ParentalStatusTypeEnum.__name__)
from google.ads.googleads import PreferredContentTypeEnum
expected_names.append(PreferredContentTypeEnum.__name__)
from google.ads.googleads import ProductBiddingCategoryLevelEnum
expected_names.append(ProductBiddingCategoryLevelEnum.__name__)
from google.ads.googleads import ProductChannelEnum
expected_names.append(ProductChannelEnum.__name__)
from google.ads.googleads import ProductChannelExclusivityEnum
expected_names.append(ProductChannelExclusivityEnum.__name__)
from google.ads.googleads import ProductConditionEnum
expected_names.append(ProductConditionEnum.__name__)
from google.ads.googleads import ProductCustomAttributeIndexEnum
expected_names.append(ProductCustomAttributeIndexEnum.__name__)
from google.ads.googleads import ProductTypeLevelEnum
expected_names.append(ProductTypeLevelEnum.__name__)
from google.ads.googleads import ProximityRadiusUnitsEnum
expected_names.append(ProximityRadiusUnitsEnum.__name__)
from google.ads.googleads import WebpageConditionOperandEnum
expected_names.append(WebpageConditionOperandEnum.__name__)
from google.ads.googleads import WebpageConditionOperatorEnum
expected_names.append(WebpageConditionOperatorEnum.__name__)
from google.ads.googleads import KeywordInfo
expected_names.append(KeywordInfo.__name__)
from google.ads.googleads import PlacementInfo
expected_names.append(PlacementInfo.__name__)
from google.ads.googleads import MobileAppCategoryInfo
expected_names.append(MobileAppCategoryInfo.__name__)
from google.ads.googleads import MobileApplicationInfo
expected_names.append(MobileApplicationInfo.__name__)
from google.ads.googleads import LocationInfo
expected_names.append(LocationInfo.__name__)
from google.ads.googleads import DeviceInfo
expected_names.append(DeviceInfo.__name__)
from google.ads.googleads import PreferredContentInfo
expected_names.append(PreferredContentInfo.__name__)
from google.ads.googleads import ListingGroupInfo
expected_names.append(ListingGroupInfo.__name__)
from google.ads.googleads import ListingScopeInfo
expected_names.append(ListingScopeInfo.__name__)
from google.ads.googleads import ListingDimensionInfo
expected_names.append(ListingDimensionInfo.__name__)
from google.ads.googleads import HotelIdInfo
expected_names.append(HotelIdInfo.__name__)
from google.ads.googleads import HotelClassInfo
expected_names.append(HotelClassInfo.__name__)
from google.ads.googleads import HotelCountryRegionInfo
expected_names.append(HotelCountryRegionInfo.__name__)
from google.ads.googleads import HotelStateInfo
expected_names.append(HotelStateInfo.__name__)
from google.ads.googleads import HotelCityInfo
expected_names.append(HotelCityInfo.__name__)
from google.ads.googleads import ProductBiddingCategoryInfo
expected_names.append(ProductBiddingCategoryInfo.__name__)
from google.ads.googleads import ProductBrandInfo
expected_names.append(ProductBrandInfo.__name__)
from google.ads.googleads import ProductChannelInfo
expected_names.append(ProductChannelInfo.__name__)
from google.ads.googleads import ProductChannelExclusivityInfo
expected_names.append(ProductChannelExclusivityInfo.__name__)
from google.ads.googleads import ProductConditionInfo
expected_names.append(ProductConditionInfo.__name__)
from google.ads.googleads import ProductCustomAttributeInfo
expected_names.append(ProductCustomAttributeInfo.__name__)
from google.ads.googleads import ProductItemIdInfo
expected_names.append(ProductItemIdInfo.__name__)
from google.ads.googleads import ProductTypeInfo
expected_names.append(ProductTypeInfo.__name__)
from google.ads.googleads import UnknownListingDimensionInfo
expected_names.append(UnknownListingDimensionInfo.__name__)
from google.ads.googleads import HotelDateSelectionTypeInfo
expected_names.append(HotelDateSelectionTypeInfo.__name__)
from google.ads.googleads import HotelAdvanceBookingWindowInfo
expected_names.append(HotelAdvanceBookingWindowInfo.__name__)
from google.ads.googleads import HotelLengthOfStayInfo
expected_names.append(HotelLengthOfStayInfo.__name__)
from google.ads.googleads import HotelCheckInDateRangeInfo
expected_names.append(HotelCheckInDateRangeInfo.__name__)
from google.ads.googleads import HotelCheckInDayInfo
expected_names.append(HotelCheckInDayInfo.__name__)
from google.ads.googleads import InteractionTypeInfo
expected_names.append(InteractionTypeInfo.__name__)
from google.ads.googleads import AdScheduleInfo
expected_names.append(AdScheduleInfo.__name__)
from google.ads.googleads import AgeRangeInfo
expected_names.append(AgeRangeInfo.__name__)
from google.ads.googleads import GenderInfo
expected_names.append(GenderInfo.__name__)
from google.ads.googleads import IncomeRangeInfo
expected_names.append(IncomeRangeInfo.__name__)
from google.ads.googleads import ParentalStatusInfo
expected_names.append(ParentalStatusInfo.__name__)
from google.ads.googleads import YouTubeVideoInfo
expected_names.append(YouTubeVideoInfo.__name__)
from google.ads.googleads import YouTubeChannelInfo
expected_names.append(YouTubeChannelInfo.__name__)
from google.ads.googleads import UserListInfo
expected_names.append(UserListInfo.__name__)
from google.ads.googleads import ProximityInfo
expected_names.append(ProximityInfo.__name__)
from google.ads.googleads import GeoPointInfo
expected_names.append(GeoPointInfo.__name__)
from google.ads.googleads import AddressInfo
expected_names.append(AddressInfo.__name__)
from google.ads.googleads import TopicInfo
expected_names.append(TopicInfo.__name__)
from google.ads.googleads import LanguageInfo
expected_names.append(LanguageInfo.__name__)
from google.ads.googleads import IpBlockInfo
expected_names.append(IpBlockInfo.__name__)
from google.ads.googleads import ContentLabelInfo
expected_names.append(ContentLabelInfo.__name__)
from google.ads.googleads import CarrierInfo
expected_names.append(CarrierInfo.__name__)
from google.ads.googleads import UserInterestInfo
expected_names.append(UserInterestInfo.__name__)
from google.ads.googleads import WebpageInfo
expected_names.append(WebpageInfo.__name__)
from google.ads.googleads import WebpageConditionInfo
expected_names.append(WebpageConditionInfo.__name__)
from google.ads.googleads import WebpageSampleInfo
expected_names.append(WebpageSampleInfo.__name__)
from google.ads.googleads import OperatingSystemVersionInfo
expected_names.append(OperatingSystemVersionInfo.__name__)
from google.ads.googleads import AppPaymentModelInfo
expected_names.append(AppPaymentModelInfo.__name__)
from google.ads.googleads import MobileDeviceInfo
expected_names.append(MobileDeviceInfo.__name__)
from google.ads.googleads import CustomAffinityInfo
expected_names.append(CustomAffinityInfo.__name__)
from google.ads.googleads import CustomIntentInfo
expected_names.append(CustomIntentInfo.__name__)
from google.ads.googleads import LocationGroupInfo
expected_names.append(LocationGroupInfo.__name__)
from google.ads.googleads import CustomAudienceInfo
expected_names.append(CustomAudienceInfo.__name__)
from google.ads.googleads import CombinedAudienceInfo
expected_names.append(CombinedAudienceInfo.__name__)
from google.ads.googleads import KeywordThemeInfo
expected_names.append(KeywordThemeInfo.__name__)
from google.ads.googleads import Money
expected_names.append(Money.__name__)
from google.ads.googleads import LeadFormCallToActionTypeEnum
expected_names.append(LeadFormCallToActionTypeEnum.__name__)
from google.ads.googleads import LeadFormDesiredIntentEnum
expected_names.append(LeadFormDesiredIntentEnum.__name__)
from google.ads.googleads import LeadFormFieldUserInputTypeEnum
expected_names.append(LeadFormFieldUserInputTypeEnum.__name__)
from google.ads.googleads import LeadFormPostSubmitCallToActionTypeEnum
expected_names.append(LeadFormPostSubmitCallToActionTypeEnum.__name__)
from google.ads.googleads import PromotionExtensionDiscountModifierEnum
expected_names.append(PromotionExtensionDiscountModifierEnum.__name__)
from google.ads.googleads import PromotionExtensionOccasionEnum
expected_names.append(PromotionExtensionOccasionEnum.__name__)
from google.ads.googleads import YoutubeVideoAsset
expected_names.append(YoutubeVideoAsset.__name__)
from google.ads.googleads import MediaBundleAsset
expected_names.append(MediaBundleAsset.__name__)
from google.ads.googleads import ImageAsset
expected_names.append(ImageAsset.__name__)
from google.ads.googleads import ImageDimension
expected_names.append(ImageDimension.__name__)
from google.ads.googleads import TextAsset
expected_names.append(TextAsset.__name__)
from google.ads.googleads import LeadFormAsset
expected_names.append(LeadFormAsset.__name__)
from google.ads.googleads import LeadFormField
expected_names.append(LeadFormField.__name__)
from google.ads.googleads import LeadFormSingleChoiceAnswers
expected_names.append(LeadFormSingleChoiceAnswers.__name__)
from google.ads.googleads import LeadFormDeliveryMethod
expected_names.append(LeadFormDeliveryMethod.__name__)
from google.ads.googleads import WebhookDelivery
expected_names.append(WebhookDelivery.__name__)
from google.ads.googleads import BookOnGoogleAsset
expected_names.append(BookOnGoogleAsset.__name__)
from google.ads.googleads import PromotionAsset
expected_names.append(PromotionAsset.__name__)
from google.ads.googleads import CalloutAsset
expected_names.append(CalloutAsset.__name__)
from google.ads.googleads import StructuredSnippetAsset
expected_names.append(StructuredSnippetAsset.__name__)
from google.ads.googleads import SitelinkAsset
expected_names.append(SitelinkAsset.__name__)
from google.ads.googleads import TargetImpressionShareLocationEnum
expected_names.append(TargetImpressionShareLocationEnum.__name__)
from google.ads.googleads import Commission
expected_names.append(Commission.__name__)
from google.ads.googleads import EnhancedCpc
expected_names.append(EnhancedCpc.__name__)
from google.ads.googleads import ManualCpc
expected_names.append(ManualCpc.__name__)
from google.ads.googleads import ManualCpm
expected_names.append(ManualCpm.__name__)
from google.ads.googleads import ManualCpv
expected_names.append(ManualCpv.__name__)
from google.ads.googleads import MaximizeConversions
expected_names.append(MaximizeConversions.__name__)
from google.ads.googleads import MaximizeConversionValue
expected_names.append(MaximizeConversionValue.__name__)
from google.ads.googleads import TargetCpa
expected_names.append(TargetCpa.__name__)
from google.ads.googleads import TargetCpm
expected_names.append(TargetCpm.__name__)
from google.ads.googleads import TargetImpressionShare
expected_names.append(TargetImpressionShare.__name__)
from google.ads.googleads import TargetRoas
expected_names.append(TargetRoas.__name__)
from google.ads.googleads import TargetSpend
expected_names.append(TargetSpend.__name__)
from google.ads.googleads import PercentCpc
expected_names.append(PercentCpc.__name__)
from google.ads.googleads import ClickLocation
expected_names.append(ClickLocation.__name__)
from google.ads.googleads import AdvertisingChannelSubTypeEnum
expected_names.append(AdvertisingChannelSubTypeEnum.__name__)
from google.ads.googleads import AdvertisingChannelTypeEnum
expected_names.append(AdvertisingChannelTypeEnum.__name__)
from google.ads.googleads import CriterionCategoryChannelAvailabilityModeEnum
expected_names.append(CriterionCategoryChannelAvailabilityModeEnum.__name__)
from google.ads.googleads import CriterionCategoryLocaleAvailabilityModeEnum
expected_names.append(CriterionCategoryLocaleAvailabilityModeEnum.__name__)
from google.ads.googleads import CriterionCategoryAvailability
expected_names.append(CriterionCategoryAvailability.__name__)
from google.ads.googleads import CriterionCategoryChannelAvailability
expected_names.append(CriterionCategoryChannelAvailability.__name__)
from google.ads.googleads import CriterionCategoryLocaleAvailability
expected_names.append(CriterionCategoryLocaleAvailability.__name__)
from google.ads.googleads import CustomParameter
expected_names.append(CustomParameter.__name__)
from google.ads.googleads import MonthOfYearEnum
expected_names.append(MonthOfYearEnum.__name__)
from google.ads.googleads import DateRange
expected_names.append(DateRange.__name__)
from google.ads.googleads import YearMonthRange
expected_names.append(YearMonthRange.__name__)
from google.ads.googleads import YearMonth
expected_names.append(YearMonth.__name__)
from google.ads.googleads import ExplorerAutoOptimizerSetting
expected_names.append(ExplorerAutoOptimizerSetting.__name__)
from google.ads.googleads import AppStoreEnum
expected_names.append(AppStoreEnum.__name__)
from google.ads.googleads import PriceExtensionPriceQualifierEnum
expected_names.append(PriceExtensionPriceQualifierEnum.__name__)
from google.ads.googleads import PriceExtensionPriceUnitEnum
expected_names.append(PriceExtensionPriceUnitEnum.__name__)
from google.ads.googleads import PriceExtensionTypeEnum
expected_names.append(PriceExtensionTypeEnum.__name__)
from google.ads.googleads import AppFeedItem
expected_names.append(AppFeedItem.__name__)
from google.ads.googleads import CallFeedItem
expected_names.append(CallFeedItem.__name__)
from google.ads.googleads import CalloutFeedItem
expected_names.append(CalloutFeedItem.__name__)
from google.ads.googleads import LocationFeedItem
expected_names.append(LocationFeedItem.__name__)
from google.ads.googleads import AffiliateLocationFeedItem
expected_names.append(AffiliateLocationFeedItem.__name__)
from google.ads.googleads import TextMessageFeedItem
expected_names.append(TextMessageFeedItem.__name__)
from google.ads.googleads import PriceFeedItem
expected_names.append(PriceFeedItem.__name__)
from google.ads.googleads import PriceOffer
expected_names.append(PriceOffer.__name__)
from google.ads.googleads import PromotionFeedItem
expected_names.append(PromotionFeedItem.__name__)
from google.ads.googleads import StructuredSnippetFeedItem
expected_names.append(StructuredSnippetFeedItem.__name__)
from google.ads.googleads import SitelinkFeedItem
expected_names.append(SitelinkFeedItem.__name__)
from google.ads.googleads import HotelCalloutFeedItem
expected_names.append(HotelCalloutFeedItem.__name__)
from google.ads.googleads import ImageFeedItem
expected_names.append(ImageFeedItem.__name__)
from google.ads.googleads import FeedItemSetStringFilterTypeEnum
expected_names.append(FeedItemSetStringFilterTypeEnum.__name__)
from google.ads.googleads import DynamicLocationSetFilter
expected_names.append(DynamicLocationSetFilter.__name__)
from google.ads.googleads import BusinessNameFilter
expected_names.append(BusinessNameFilter.__name__)
from google.ads.googleads import DynamicAffiliateLocationSetFilter
expected_names.append(DynamicAffiliateLocationSetFilter.__name__)
from google.ads.googleads import AppUrlOperatingSystemTypeEnum
expected_names.append(AppUrlOperatingSystemTypeEnum.__name__)
from google.ads.googleads import FinalAppUrl
expected_names.append(FinalAppUrl.__name__)
from google.ads.googleads import FrequencyCapEventTypeEnum
expected_names.append(FrequencyCapEventTypeEnum.__name__)
from google.ads.googleads import FrequencyCapLevelEnum
expected_names.append(FrequencyCapLevelEnum.__name__)
from google.ads.googleads import FrequencyCapTimeUnitEnum
expected_names.append(FrequencyCapTimeUnitEnum.__name__)
from google.ads.googleads import FrequencyCapEntry
expected_names.append(FrequencyCapEntry.__name__)
from google.ads.googleads import FrequencyCapKey
expected_names.append(FrequencyCapKey.__name__)
from google.ads.googleads import KeywordPlanAggregateMetricTypeEnum
expected_names.append(KeywordPlanAggregateMetricTypeEnum.__name__)
from google.ads.googleads import KeywordPlanCompetitionLevelEnum
expected_names.append(KeywordPlanCompetitionLevelEnum.__name__)
from google.ads.googleads import KeywordPlanConceptGroupTypeEnum
expected_names.append(KeywordPlanConceptGroupTypeEnum.__name__)
from google.ads.googleads import KeywordPlanHistoricalMetrics
expected_names.append(KeywordPlanHistoricalMetrics.__name__)
from google.ads.googleads import HistoricalMetricsOptions
expected_names.append(HistoricalMetricsOptions.__name__)
from google.ads.googleads import MonthlySearchVolume
expected_names.append(MonthlySearchVolume.__name__)
from google.ads.googleads import KeywordPlanAggregateMetrics
expected_names.append(KeywordPlanAggregateMetrics.__name__)
from google.ads.googleads import KeywordPlanAggregateMetricResults
expected_names.append(KeywordPlanAggregateMetricResults.__name__)
from google.ads.googleads import KeywordPlanDeviceSearches
expected_names.append(KeywordPlanDeviceSearches.__name__)
from google.ads.googleads import KeywordAnnotations
expected_names.append(KeywordAnnotations.__name__)
from google.ads.googleads import KeywordConcept
expected_names.append(KeywordConcept.__name__)
from google.ads.googleads import ConceptGroup
expected_names.append(ConceptGroup.__name__)
from google.ads.googleads import MatchingFunctionContextTypeEnum
expected_names.append(MatchingFunctionContextTypeEnum.__name__)
from google.ads.googleads import MatchingFunctionOperatorEnum
expected_names.append(MatchingFunctionOperatorEnum.__name__)
from google.ads.googleads import MatchingFunction
expected_names.append(MatchingFunction.__name__)
from google.ads.googleads import Operand
expected_names.append(Operand.__name__)
from google.ads.googleads import InteractionEventTypeEnum
expected_names.append(InteractionEventTypeEnum.__name__)
from google.ads.googleads import QualityScoreBucketEnum
expected_names.append(QualityScoreBucketEnum.__name__)
from google.ads.googleads import Metrics
expected_names.append(Metrics.__name__)
from google.ads.googleads import UserIdentifierSourceEnum
expected_names.append(UserIdentifierSourceEnum.__name__)
from google.ads.googleads import OfflineUserAddressInfo
expected_names.append(OfflineUserAddressInfo.__name__)
from google.ads.googleads import UserIdentifier
expected_names.append(UserIdentifier.__name__)
from google.ads.googleads import TransactionAttribute
expected_names.append(TransactionAttribute.__name__)
from google.ads.googleads import StoreAttribute
expected_names.append(StoreAttribute.__name__)
from google.ads.googleads import ItemAttribute
expected_names.append(ItemAttribute.__name__)
from google.ads.googleads import UserData
expected_names.append(UserData.__name__)
from google.ads.googleads import UserAttribute
expected_names.append(UserAttribute.__name__)
from google.ads.googleads import CustomerMatchUserListMetadata
expected_names.append(CustomerMatchUserListMetadata.__name__)
from google.ads.googleads import StoreSalesMetadata
expected_names.append(StoreSalesMetadata.__name__)
from google.ads.googleads import StoreSalesThirdPartyMetadata
expected_names.append(StoreSalesThirdPartyMetadata.__name__)
from google.ads.googleads import RealTimeBiddingSetting
expected_names.append(RealTimeBiddingSetting.__name__)
from google.ads.googleads import AdDestinationTypeEnum
expected_names.append(AdDestinationTypeEnum.__name__)
from google.ads.googleads import AdNetworkTypeEnum
expected_names.append(AdNetworkTypeEnum.__name__)
from google.ads.googleads import BudgetCampaignAssociationStatusEnum
expected_names.append(BudgetCampaignAssociationStatusEnum.__name__)
from google.ads.googleads import ClickTypeEnum
expected_names.append(ClickTypeEnum.__name__)
from google.ads.googleads import ConversionActionCategoryEnum
expected_names.append(ConversionActionCategoryEnum.__name__)
from google.ads.googleads import ConversionAttributionEventTypeEnum
expected_names.append(ConversionAttributionEventTypeEnum.__name__)
from google.ads.googleads import ConversionLagBucketEnum
expected_names.append(ConversionLagBucketEnum.__name__)
from google.ads.googleads import ConversionOrAdjustmentLagBucketEnum
expected_names.append(ConversionOrAdjustmentLagBucketEnum.__name__)
from google.ads.googleads import ExternalConversionSourceEnum
expected_names.append(ExternalConversionSourceEnum.__name__)
from google.ads.googleads import HotelPriceBucketEnum
expected_names.append(HotelPriceBucketEnum.__name__)
from google.ads.googleads import HotelRateTypeEnum
expected_names.append(HotelRateTypeEnum.__name__)
from google.ads.googleads import PlaceholderTypeEnum
expected_names.append(PlaceholderTypeEnum.__name__)
from google.ads.googleads import RecommendationTypeEnum
expected_names.append(RecommendationTypeEnum.__name__)
from google.ads.googleads import SearchEngineResultsPageTypeEnum
expected_names.append(SearchEngineResultsPageTypeEnum.__name__)
from google.ads.googleads import SearchTermMatchTypeEnum
expected_names.append(SearchTermMatchTypeEnum.__name__)
from google.ads.googleads import SlotEnum
expected_names.append(SlotEnum.__name__)
from google.ads.googleads import Segments
expected_names.append(Segments.__name__)
from google.ads.googleads import Keyword
expected_names.append(Keyword.__name__)
from google.ads.googleads import BudgetCampaignAssociationStatus
expected_names.append(BudgetCampaignAssociationStatus.__name__)
from google.ads.googleads import AssetInteractionTarget
expected_names.append(AssetInteractionTarget.__name__)
from google.ads.googleads import BidModifierSimulationPointList
expected_names.append(BidModifierSimulationPointList.__name__)
from google.ads.googleads import CpcBidSimulationPointList
expected_names.append(CpcBidSimulationPointList.__name__)
from google.ads.googleads import CpvBidSimulationPointList
expected_names.append(CpvBidSimulationPointList.__name__)
from google.ads.googleads import TargetCpaSimulationPointList
expected_names.append(TargetCpaSimulationPointList.__name__)
from google.ads.googleads import TargetRoasSimulationPointList
expected_names.append(TargetRoasSimulationPointList.__name__)
from google.ads.googleads import PercentCpcBidSimulationPointList
expected_names.append(PercentCpcBidSimulationPointList.__name__)
from google.ads.googleads import BudgetSimulationPointList
expected_names.append(BudgetSimulationPointList.__name__)
from google.ads.googleads import TargetImpressionShareSimulationPointList
expected_names.append(TargetImpressionShareSimulationPointList.__name__)
from google.ads.googleads import BidModifierSimulationPoint
expected_names.append(BidModifierSimulationPoint.__name__)
from google.ads.googleads import CpcBidSimulationPoint
expected_names.append(CpcBidSimulationPoint.__name__)
from google.ads.googleads import CpvBidSimulationPoint
expected_names.append(CpvBidSimulationPoint.__name__)
from google.ads.googleads import TargetCpaSimulationPoint
expected_names.append(TargetCpaSimulationPoint.__name__)
from google.ads.googleads import TargetRoasSimulationPoint
expected_names.append(TargetRoasSimulationPoint.__name__)
from google.ads.googleads import PercentCpcBidSimulationPoint
expected_names.append(PercentCpcBidSimulationPoint.__name__)
from google.ads.googleads import BudgetSimulationPoint
expected_names.append(BudgetSimulationPoint.__name__)
from google.ads.googleads import TargetImpressionShareSimulationPoint
expected_names.append(TargetImpressionShareSimulationPoint.__name__)
from google.ads.googleads import TrackingCodePageFormatEnum
expected_names.append(TrackingCodePageFormatEnum.__name__)
from google.ads.googleads import TrackingCodeTypeEnum
expected_names.append(TrackingCodeTypeEnum.__name__)
from google.ads.googleads import TagSnippet
expected_names.append(TagSnippet.__name__)
from google.ads.googleads import TargetingDimensionEnum
expected_names.append(TargetingDimensionEnum.__name__)
from google.ads.googleads import TargetingSetting
expected_names.append(TargetingSetting.__name__)
from google.ads.googleads import TargetRestriction
expected_names.append(TargetRestriction.__name__)
from google.ads.googleads import TargetRestrictionOperation
expected_names.append(TargetRestrictionOperation.__name__)
from google.ads.googleads import TextLabel
expected_names.append(TextLabel.__name__)
from google.ads.googleads import UrlCollection
expected_names.append(UrlCollection.__name__)
from google.ads.googleads import CustomerMatchUploadKeyTypeEnum
expected_names.append(CustomerMatchUploadKeyTypeEnum.__name__)
from google.ads.googleads import UserListCombinedRuleOperatorEnum
expected_names.append(UserListCombinedRuleOperatorEnum.__name__)
from google.ads.googleads import UserListCrmDataSourceTypeEnum
expected_names.append(UserListCrmDataSourceTypeEnum.__name__)
from google.ads.googleads import UserListDateRuleItemOperatorEnum
expected_names.append(UserListDateRuleItemOperatorEnum.__name__)
from google.ads.googleads import UserListLogicalRuleOperatorEnum
expected_names.append(UserListLogicalRuleOperatorEnum.__name__)
from google.ads.googleads import UserListNumberRuleItemOperatorEnum
expected_names.append(UserListNumberRuleItemOperatorEnum.__name__)
from google.ads.googleads import UserListPrepopulationStatusEnum
expected_names.append(UserListPrepopulationStatusEnum.__name__)
from google.ads.googleads import UserListRuleTypeEnum
expected_names.append(UserListRuleTypeEnum.__name__)
from google.ads.googleads import UserListStringRuleItemOperatorEnum
expected_names.append(UserListStringRuleItemOperatorEnum.__name__)
from google.ads.googleads import SimilarUserListInfo
expected_names.append(SimilarUserListInfo.__name__)
from google.ads.googleads import CrmBasedUserListInfo
expected_names.append(CrmBasedUserListInfo.__name__)
from google.ads.googleads import UserListRuleInfo
expected_names.append(UserListRuleInfo.__name__)
from google.ads.googleads import UserListRuleItemGroupInfo
expected_names.append(UserListRuleItemGroupInfo.__name__)
from google.ads.googleads import UserListRuleItemInfo
expected_names.append(UserListRuleItemInfo.__name__)
from google.ads.googleads import UserListDateRuleItemInfo
expected_names.append(UserListDateRuleItemInfo.__name__)
from google.ads.googleads import UserListNumberRuleItemInfo
expected_names.append(UserListNumberRuleItemInfo.__name__)
from google.ads.googleads import UserListStringRuleItemInfo
expected_names.append(UserListStringRuleItemInfo.__name__)
from google.ads.googleads import CombinedRuleUserListInfo
expected_names.append(CombinedRuleUserListInfo.__name__)
from google.ads.googleads import DateSpecificRuleUserListInfo
expected_names.append(DateSpecificRuleUserListInfo.__name__)
from google.ads.googleads import ExpressionRuleUserListInfo
expected_names.append(ExpressionRuleUserListInfo.__name__)
from google.ads.googleads import RuleBasedUserListInfo
expected_names.append(RuleBasedUserListInfo.__name__)
from google.ads.googleads import LogicalUserListInfo
expected_names.append(LogicalUserListInfo.__name__)
from google.ads.googleads import UserListLogicalRuleInfo
expected_names.append(UserListLogicalRuleInfo.__name__)
from google.ads.googleads import LogicalUserListOperandInfo
expected_names.append(LogicalUserListOperandInfo.__name__)
from google.ads.googleads import BasicUserListInfo
expected_names.append(BasicUserListInfo.__name__)
from google.ads.googleads import UserListActionInfo
expected_names.append(UserListActionInfo.__name__)
from google.ads.googleads import Value
expected_names.append(Value.__name__)
from google.ads.googleads import AccessInvitationStatusEnum
expected_names.append(AccessInvitationStatusEnum.__name__)
from google.ads.googleads import AccessReasonEnum
expected_names.append(AccessReasonEnum.__name__)
from google.ads.googleads import AccessRoleEnum
expected_names.append(AccessRoleEnum.__name__)
from google.ads.googleads import AccountBudgetProposalStatusEnum
expected_names.append(AccountBudgetProposalStatusEnum.__name__)
from google.ads.googleads import AccountBudgetProposalTypeEnum
expected_names.append(AccountBudgetProposalTypeEnum.__name__)
from google.ads.googleads import AccountBudgetStatusEnum
expected_names.append(AccountBudgetStatusEnum.__name__)
from google.ads.googleads import AccountLinkStatusEnum
expected_names.append(AccountLinkStatusEnum.__name__)
from google.ads.googleads import AdCustomizerPlaceholderFieldEnum
expected_names.append(AdCustomizerPlaceholderFieldEnum.__name__)
from google.ads.googleads import AdGroupAdRotationModeEnum
expected_names.append(AdGroupAdRotationModeEnum.__name__)
from google.ads.googleads import AdGroupAdStatusEnum
expected_names.append(AdGroupAdStatusEnum.__name__)
from google.ads.googleads import AdGroupCriterionApprovalStatusEnum
expected_names.append(AdGroupCriterionApprovalStatusEnum.__name__)
from google.ads.googleads import AdGroupCriterionStatusEnum
expected_names.append(AdGroupCriterionStatusEnum.__name__)
from google.ads.googleads import AdGroupStatusEnum
expected_names.append(AdGroupStatusEnum.__name__)
from google.ads.googleads import AdGroupTypeEnum
expected_names.append(AdGroupTypeEnum.__name__)
from google.ads.googleads import AdServingOptimizationStatusEnum
expected_names.append(AdServingOptimizationStatusEnum.__name__)
from google.ads.googleads import AdStrengthEnum
expected_names.append(AdStrengthEnum.__name__)
from google.ads.googleads import AdTypeEnum
expected_names.append(AdTypeEnum.__name__)
from google.ads.googleads import AffiliateLocationFeedRelationshipTypeEnum
expected_names.append(AffiliateLocationFeedRelationshipTypeEnum.__name__)
from google.ads.googleads import AffiliateLocationPlaceholderFieldEnum
expected_names.append(AffiliateLocationPlaceholderFieldEnum.__name__)
from google.ads.googleads import AppCampaignAppStoreEnum
expected_names.append(AppCampaignAppStoreEnum.__name__)
from google.ads.googleads import AppCampaignBiddingStrategyGoalTypeEnum
expected_names.append(AppCampaignBiddingStrategyGoalTypeEnum.__name__)
from google.ads.googleads import AppPlaceholderFieldEnum
expected_names.append(AppPlaceholderFieldEnum.__name__)
from google.ads.googleads import AssetFieldTypeEnum
expected_names.append(AssetFieldTypeEnum.__name__)
from google.ads.googleads import AssetLinkStatusEnum
expected_names.append(AssetLinkStatusEnum.__name__)
from google.ads.googleads import AssetTypeEnum
expected_names.append(AssetTypeEnum.__name__)
from google.ads.googleads import AttributionModelEnum
expected_names.append(AttributionModelEnum.__name__)
from google.ads.googleads import BatchJobStatusEnum
expected_names.append(BatchJobStatusEnum.__name__)
from google.ads.googleads import BidModifierSourceEnum
expected_names.append(BidModifierSourceEnum.__name__)
from google.ads.googleads import BiddingSourceEnum
expected_names.append(BiddingSourceEnum.__name__)
from google.ads.googleads import BiddingStrategyStatusEnum
expected_names.append(BiddingStrategyStatusEnum.__name__)
from google.ads.googleads import BiddingStrategyTypeEnum
expected_names.append(BiddingStrategyTypeEnum.__name__)
from google.ads.googleads import BillingSetupStatusEnum
expected_names.append(BillingSetupStatusEnum.__name__)
from google.ads.googleads import BrandSafetySuitabilityEnum
expected_names.append(BrandSafetySuitabilityEnum.__name__)
from google.ads.googleads import BudgetDeliveryMethodEnum
expected_names.append(BudgetDeliveryMethodEnum.__name__)
from google.ads.googleads import BudgetPeriodEnum
expected_names.append(BudgetPeriodEnum.__name__)
from google.ads.googleads import BudgetStatusEnum
expected_names.append(BudgetStatusEnum.__name__)
from google.ads.googleads import BudgetTypeEnum
expected_names.append(BudgetTypeEnum.__name__)
from google.ads.googleads import CallPlaceholderFieldEnum
expected_names.append(CallPlaceholderFieldEnum.__name__)
from google.ads.googleads import CallTrackingDisplayLocationEnum
expected_names.append(CallTrackingDisplayLocationEnum.__name__)
from google.ads.googleads import CallTypeEnum
expected_names.append(CallTypeEnum.__name__)
from google.ads.googleads import CalloutPlaceholderFieldEnum
expected_names.append(CalloutPlaceholderFieldEnum.__name__)
from google.ads.googleads import CampaignCriterionStatusEnum
expected_names.append(CampaignCriterionStatusEnum.__name__)
from google.ads.googleads import CampaignDraftStatusEnum
expected_names.append(CampaignDraftStatusEnum.__name__)
from google.ads.googleads import CampaignExperimentStatusEnum
expected_names.append(CampaignExperimentStatusEnum.__name__)
from google.ads.googleads import CampaignExperimentTrafficSplitTypeEnum
expected_names.append(CampaignExperimentTrafficSplitTypeEnum.__name__)
from google.ads.googleads import CampaignExperimentTypeEnum
expected_names.append(CampaignExperimentTypeEnum.__name__)
from google.ads.googleads import CampaignServingStatusEnum
expected_names.append(CampaignServingStatusEnum.__name__)
from google.ads.googleads import CampaignSharedSetStatusEnum
expected_names.append(CampaignSharedSetStatusEnum.__name__)
from google.ads.googleads import CampaignStatusEnum
expected_names.append(CampaignStatusEnum.__name__)
from google.ads.googleads import ChangeClientTypeEnum
expected_names.append(ChangeClientTypeEnum.__name__)
from google.ads.googleads import ChangeEventResourceTypeEnum
expected_names.append(ChangeEventResourceTypeEnum.__name__)
from google.ads.googleads import ChangeStatusOperationEnum
expected_names.append(ChangeStatusOperationEnum.__name__)
from google.ads.googleads import ChangeStatusResourceTypeEnum
expected_names.append(ChangeStatusResourceTypeEnum.__name__)
from google.ads.googleads import CombinedAudienceStatusEnum
expected_names.append(CombinedAudienceStatusEnum.__name__)
from google.ads.googleads import ConversionActionCountingTypeEnum
expected_names.append(ConversionActionCountingTypeEnum.__name__)
from google.ads.googleads import ConversionActionStatusEnum
expected_names.append(ConversionActionStatusEnum.__name__)
from google.ads.googleads import ConversionActionTypeEnum
expected_names.append(ConversionActionTypeEnum.__name__)
from google.ads.googleads import ConversionAdjustmentTypeEnum
expected_names.append(ConversionAdjustmentTypeEnum.__name__)
from google.ads.googleads import ConversionCustomVariableStatusEnum
expected_names.append(ConversionCustomVariableStatusEnum.__name__)
from google.ads.googleads import CriterionSystemServingStatusEnum
expected_names.append(CriterionSystemServingStatusEnum.__name__)
from google.ads.googleads import CriterionTypeEnum
expected_names.append(CriterionTypeEnum.__name__)
from google.ads.googleads import CustomAudienceMemberTypeEnum
expected_names.append(CustomAudienceMemberTypeEnum.__name__)
from google.ads.googleads import CustomAudienceStatusEnum
expected_names.append(CustomAudienceStatusEnum.__name__)
from google.ads.googleads import CustomAudienceTypeEnum
expected_names.append(CustomAudienceTypeEnum.__name__)
from google.ads.googleads import CustomInterestMemberTypeEnum
expected_names.append(CustomInterestMemberTypeEnum.__name__)
from google.ads.googleads import CustomInterestStatusEnum
expected_names.append(CustomInterestStatusEnum.__name__)
from google.ads.googleads import CustomInterestTypeEnum
expected_names.append(CustomInterestTypeEnum.__name__)
from google.ads.googleads import CustomPlaceholderFieldEnum
expected_names.append(CustomPlaceholderFieldEnum.__name__)
from google.ads.googleads import CustomerPayPerConversionEligibilityFailureReasonEnum
expected_names.append(CustomerPayPerConversionEligibilityFailureReasonEnum.__name__)
from google.ads.googleads import DataDrivenModelStatusEnum
expected_names.append(DataDrivenModelStatusEnum.__name__)
from google.ads.googleads import DistanceBucketEnum
expected_names.append(DistanceBucketEnum.__name__)
from google.ads.googleads import DsaPageFeedCriterionFieldEnum
expected_names.append(DsaPageFeedCriterionFieldEnum.__name__)
from google.ads.googleads import EducationPlaceholderFieldEnum
expected_names.append(EducationPlaceholderFieldEnum.__name__)
from google.ads.googleads import ExtensionSettingDeviceEnum
expected_names.append(ExtensionSettingDeviceEnum.__name__)
from google.ads.googleads import ExtensionTypeEnum
expected_names.append(ExtensionTypeEnum.__name__)
from google.ads.googleads import FeedAttributeTypeEnum
expected_names.append(FeedAttributeTypeEnum.__name__)
from google.ads.googleads import FeedItemQualityApprovalStatusEnum
expected_names.append(FeedItemQualityApprovalStatusEnum.__name__)
from google.ads.googleads import FeedItemQualityDisapprovalReasonEnum
expected_names.append(FeedItemQualityDisapprovalReasonEnum.__name__)
from google.ads.googleads import FeedItemSetStatusEnum
expected_names.append(FeedItemSetStatusEnum.__name__)
from google.ads.googleads import FeedItemStatusEnum
expected_names.append(FeedItemStatusEnum.__name__)
from google.ads.googleads import FeedItemTargetDeviceEnum
expected_names.append(FeedItemTargetDeviceEnum.__name__)
from google.ads.googleads import FeedItemTargetStatusEnum
expected_names.append(FeedItemTargetStatusEnum.__name__)
from google.ads.googleads import FeedItemTargetTypeEnum
expected_names.append(FeedItemTargetTypeEnum.__name__)
from google.ads.googleads import FeedItemValidationStatusEnum
expected_names.append(FeedItemValidationStatusEnum.__name__)
from google.ads.googleads import FeedLinkStatusEnum
expected_names.append(FeedLinkStatusEnum.__name__)
from google.ads.googleads import FeedMappingCriterionTypeEnum
expected_names.append(FeedMappingCriterionTypeEnum.__name__)
from google.ads.googleads import FeedMappingStatusEnum
expected_names.append(FeedMappingStatusEnum.__name__)
from google.ads.googleads import FeedOriginEnum
expected_names.append(FeedOriginEnum.__name__)
from google.ads.googleads import FeedStatusEnum
expected_names.append(FeedStatusEnum.__name__)
from google.ads.googleads import FlightPlaceholderFieldEnum
expected_names.append(FlightPlaceholderFieldEnum.__name__)
from google.ads.googleads import GeoTargetConstantStatusEnum
expected_names.append(GeoTargetConstantStatusEnum.__name__)
from google.ads.googleads import GeoTargetingRestrictionEnum
expected_names.append(GeoTargetingRestrictionEnum.__name__)
from google.ads.googleads import GeoTargetingTypeEnum
expected_names.append(GeoTargetingTypeEnum.__name__)
from google.ads.googleads import GoogleAdsFieldCategoryEnum
expected_names.append(GoogleAdsFieldCategoryEnum.__name__)
from google.ads.googleads import GoogleAdsFieldDataTypeEnum
expected_names.append(GoogleAdsFieldDataTypeEnum.__name__)
from google.ads.googleads import GoogleVoiceCallStatusEnum
expected_names.append(GoogleVoiceCallStatusEnum.__name__)
from google.ads.googleads import HotelPlaceholderFieldEnum
expected_names.append(HotelPlaceholderFieldEnum.__name__)
from google.ads.googleads import ImagePlaceholderFieldEnum
expected_names.append(ImagePlaceholderFieldEnum.__name__)
from google.ads.googleads import InvoiceTypeEnum
expected_names.append(InvoiceTypeEnum.__name__)
from google.ads.googleads import JobPlaceholderFieldEnum
expected_names.append(JobPlaceholderFieldEnum.__name__)
from google.ads.googleads import KeywordPlanForecastIntervalEnum
expected_names.append(KeywordPlanForecastIntervalEnum.__name__)
from google.ads.googleads import KeywordPlanKeywordAnnotationEnum
expected_names.append(KeywordPlanKeywordAnnotationEnum.__name__)
from google.ads.googleads import KeywordPlanNetworkEnum
expected_names.append(KeywordPlanNetworkEnum.__name__)
from google.ads.googleads import LabelStatusEnum
expected_names.append(LabelStatusEnum.__name__)
from google.ads.googleads import LinkedAccountTypeEnum
expected_names.append(LinkedAccountTypeEnum.__name__)
from google.ads.googleads import LocalPlaceholderFieldEnum
expected_names.append(LocalPlaceholderFieldEnum.__name__)
from google.ads.googleads import LocationExtensionTargetingCriterionFieldEnum
expected_names.append(LocationExtensionTargetingCriterionFieldEnum.__name__)
from google.ads.googleads import LocationPlaceholderFieldEnum
expected_names.append(LocationPlaceholderFieldEnum.__name__)
from google.ads.googleads import LocationSourceTypeEnum
expected_names.append(LocationSourceTypeEnum.__name__)
from google.ads.googleads import ManagerLinkStatusEnum
expected_names.append(ManagerLinkStatusEnum.__name__)
from google.ads.googleads import MediaTypeEnum
expected_names.append(MediaTypeEnum.__name__)
from google.ads.googleads import MerchantCenterLinkStatusEnum
expected_names.append(MerchantCenterLinkStatusEnum.__name__)
from google.ads.googleads import MessagePlaceholderFieldEnum
expected_names.append(MessagePlaceholderFieldEnum.__name__)
from google.ads.googleads import MobileAppVendorEnum
expected_names.append(MobileAppVendorEnum.__name__)
from google.ads.googleads import MobileDeviceTypeEnum
expected_names.append(MobileDeviceTypeEnum.__name__)
from google.ads.googleads import NegativeGeoTargetTypeEnum
expected_names.append(NegativeGeoTargetTypeEnum.__name__)
from google.ads.googleads import OfflineUserDataJobFailureReasonEnum
expected_names.append(OfflineUserDataJobFailureReasonEnum.__name__)
from google.ads.googleads import OfflineUserDataJobStatusEnum
expected_names.append(OfflineUserDataJobStatusEnum.__name__)
from google.ads.googleads import OfflineUserDataJobTypeEnum
expected_names.append(OfflineUserDataJobTypeEnum.__name__)
from google.ads.googleads import OperatingSystemVersionOperatorTypeEnum
expected_names.append(OperatingSystemVersionOperatorTypeEnum.__name__)
from google.ads.googleads import OptimizationGoalTypeEnum
expected_names.append(OptimizationGoalTypeEnum.__name__)
from google.ads.googleads import PaymentModeEnum
expected_names.append(PaymentModeEnum.__name__)
from google.ads.googleads import PlacementTypeEnum
expected_names.append(PlacementTypeEnum.__name__)
from google.ads.googleads import PositiveGeoTargetTypeEnum
expected_names.append(PositiveGeoTargetTypeEnum.__name__)
from google.ads.googleads import PricePlaceholderFieldEnum
expected_names.append(PricePlaceholderFieldEnum.__name__)
from google.ads.googleads import ProductBiddingCategoryStatusEnum
expected_names.append(ProductBiddingCategoryStatusEnum.__name__)
from google.ads.googleads import PromotionPlaceholderFieldEnum
expected_names.append(PromotionPlaceholderFieldEnum.__name__)
from google.ads.googleads import ReachPlanAdLengthEnum
expected_names.append(ReachPlanAdLengthEnum.__name__)
from google.ads.googleads import ReachPlanAgeRangeEnum
expected_names.append(ReachPlanAgeRangeEnum.__name__)
from google.ads.googleads import ReachPlanNetworkEnum
expected_names.append(ReachPlanNetworkEnum.__name__)
from google.ads.googleads import RealEstatePlaceholderFieldEnum
expected_names.append(RealEstatePlaceholderFieldEnum.__name__)
from google.ads.googleads import ResourceChangeOperationEnum
expected_names.append(ResourceChangeOperationEnum.__name__)
from google.ads.googleads import ResourceLimitTypeEnum
expected_names.append(ResourceLimitTypeEnum.__name__)
from google.ads.googleads import ResponseContentTypeEnum
expected_names.append(ResponseContentTypeEnum.__name__)
from google.ads.googleads import SearchTermTargetingStatusEnum
expected_names.append(SearchTermTargetingStatusEnum.__name__)
from google.ads.googleads import SharedSetStatusEnum
expected_names.append(SharedSetStatusEnum.__name__)
from google.ads.googleads import SharedSetTypeEnum
expected_names.append(SharedSetTypeEnum.__name__)
from google.ads.googleads import SimulationModificationMethodEnum
expected_names.append(SimulationModificationMethodEnum.__name__)
from google.ads.googleads import SimulationTypeEnum
expected_names.append(SimulationTypeEnum.__name__)
from google.ads.googleads import SitelinkPlaceholderFieldEnum
expected_names.append(SitelinkPlaceholderFieldEnum.__name__)
from google.ads.googleads import SpendingLimitTypeEnum
expected_names.append(SpendingLimitTypeEnum.__name__)
from google.ads.googleads import StructuredSnippetPlaceholderFieldEnum
expected_names.append(StructuredSnippetPlaceholderFieldEnum.__name__)
from google.ads.googleads import SummaryRowSettingEnum
expected_names.append(SummaryRowSettingEnum.__name__)
from google.ads.googleads import SystemManagedResourceSourceEnum
expected_names.append(SystemManagedResourceSourceEnum.__name__)
from google.ads.googleads import TargetCpaOptInRecommendationGoalEnum
expected_names.append(TargetCpaOptInRecommendationGoalEnum.__name__)
from google.ads.googleads import TimeTypeEnum
expected_names.append(TimeTypeEnum.__name__)
from google.ads.googleads import TravelPlaceholderFieldEnum
expected_names.append(TravelPlaceholderFieldEnum.__name__)
from google.ads.googleads import UserInterestTaxonomyTypeEnum
expected_names.append(UserInterestTaxonomyTypeEnum.__name__)
from google.ads.googleads import UserListAccessStatusEnum
expected_names.append(UserListAccessStatusEnum.__name__)
from google.ads.googleads import UserListClosingReasonEnum
expected_names.append(UserListClosingReasonEnum.__name__)
from google.ads.googleads import UserListMembershipStatusEnum
expected_names.append(UserListMembershipStatusEnum.__name__)
from google.ads.googleads import UserListSizeRangeEnum
expected_names.append(UserListSizeRangeEnum.__name__)
from google.ads.googleads import UserListTypeEnum
expected_names.append(UserListTypeEnum.__name__)
from google.ads.googleads import VanityPharmaDisplayUrlModeEnum
expected_names.append(VanityPharmaDisplayUrlModeEnum.__name__)
from google.ads.googleads import VanityPharmaTextEnum
expected_names.append(VanityPharmaTextEnum.__name__)
from google.ads.googleads import AccessInvitationErrorEnum
expected_names.append(AccessInvitationErrorEnum.__name__)
from google.ads.googleads import AccountBudgetProposalErrorEnum
expected_names.append(AccountBudgetProposalErrorEnum.__name__)
from google.ads.googleads import AccountLinkErrorEnum
expected_names.append(AccountLinkErrorEnum.__name__)
from google.ads.googleads import AdCustomizerErrorEnum
expected_names.append(AdCustomizerErrorEnum.__name__)
from google.ads.googleads import AdErrorEnum
expected_names.append(AdErrorEnum.__name__)
from google.ads.googleads import AdGroupAdErrorEnum
expected_names.append(AdGroupAdErrorEnum.__name__)
from google.ads.googleads import AdGroupBidModifierErrorEnum
expected_names.append(AdGroupBidModifierErrorEnum.__name__)
from google.ads.googleads import AdGroupCriterionErrorEnum
expected_names.append(AdGroupCriterionErrorEnum.__name__)
from google.ads.googleads import AdGroupErrorEnum
expected_names.append(AdGroupErrorEnum.__name__)
from google.ads.googleads import AdGroupFeedErrorEnum
expected_names.append(AdGroupFeedErrorEnum.__name__)
from google.ads.googleads import AdParameterErrorEnum
expected_names.append(AdParameterErrorEnum.__name__)
from google.ads.googleads import AdSharingErrorEnum
expected_names.append(AdSharingErrorEnum.__name__)
from google.ads.googleads import AdxErrorEnum
expected_names.append(AdxErrorEnum.__name__)
from google.ads.googleads import AssetErrorEnum
expected_names.append(AssetErrorEnum.__name__)
from google.ads.googleads import AssetLinkErrorEnum
expected_names.append(AssetLinkErrorEnum.__name__)
from google.ads.googleads import AuthenticationErrorEnum
expected_names.append(AuthenticationErrorEnum.__name__)
from google.ads.googleads import AuthorizationErrorEnum
expected_names.append(AuthorizationErrorEnum.__name__)
from google.ads.googleads import BatchJobErrorEnum
expected_names.append(BatchJobErrorEnum.__name__)
from google.ads.googleads import BiddingErrorEnum
expected_names.append(BiddingErrorEnum.__name__)
from google.ads.googleads import BiddingStrategyErrorEnum
expected_names.append(BiddingStrategyErrorEnum.__name__)
from google.ads.googleads import BillingSetupErrorEnum
expected_names.append(BillingSetupErrorEnum.__name__)
from google.ads.googleads import CampaignBudgetErrorEnum
expected_names.append(CampaignBudgetErrorEnum.__name__)
from google.ads.googleads import CampaignCriterionErrorEnum
expected_names.append(CampaignCriterionErrorEnum.__name__)
from google.ads.googleads import CampaignDraftErrorEnum
expected_names.append(CampaignDraftErrorEnum.__name__)
from google.ads.googleads import CampaignErrorEnum
expected_names.append(CampaignErrorEnum.__name__)
from google.ads.googleads import CampaignExperimentErrorEnum
expected_names.append(CampaignExperimentErrorEnum.__name__)
from google.ads.googleads import CampaignFeedErrorEnum
expected_names.append(CampaignFeedErrorEnum.__name__)
from google.ads.googleads import CampaignSharedSetErrorEnum
expected_names.append(CampaignSharedSetErrorEnum.__name__)
from google.ads.googleads import ChangeEventErrorEnum
expected_names.append(ChangeEventErrorEnum.__name__)
from google.ads.googleads import ChangeStatusErrorEnum
expected_names.append(ChangeStatusErrorEnum.__name__)
from google.ads.googleads import CollectionSizeErrorEnum
expected_names.append(CollectionSizeErrorEnum.__name__)
from google.ads.googleads import ContextErrorEnum
expected_names.append(ContextErrorEnum.__name__)
from google.ads.googleads import ConversionActionErrorEnum
expected_names.append(ConversionActionErrorEnum.__name__)
from google.ads.googleads import ConversionAdjustmentUploadErrorEnum
expected_names.append(ConversionAdjustmentUploadErrorEnum.__name__)
from google.ads.googleads import ConversionCustomVariableErrorEnum
expected_names.append(ConversionCustomVariableErrorEnum.__name__)
from google.ads.googleads import ConversionUploadErrorEnum
expected_names.append(ConversionUploadErrorEnum.__name__)
from google.ads.googleads import CountryCodeErrorEnum
expected_names.append(CountryCodeErrorEnum.__name__)
from google.ads.googleads import CriterionErrorEnum
expected_names.append(CriterionErrorEnum.__name__)
from google.ads.googleads import CurrencyCodeErrorEnum
expected_names.append(CurrencyCodeErrorEnum.__name__)
from google.ads.googleads import CustomAudienceErrorEnum
expected_names.append(CustomAudienceErrorEnum.__name__)
from google.ads.googleads import CustomInterestErrorEnum
expected_names.append(CustomInterestErrorEnum.__name__)
from google.ads.googleads import CustomerClientLinkErrorEnum
expected_names.append(CustomerClientLinkErrorEnum.__name__)
from google.ads.googleads import CustomerErrorEnum
expected_names.append(CustomerErrorEnum.__name__)
from google.ads.googleads import CustomerFeedErrorEnum
expected_names.append(CustomerFeedErrorEnum.__name__)
from google.ads.googleads import CustomerManagerLinkErrorEnum
expected_names.append(CustomerManagerLinkErrorEnum.__name__)
from google.ads.googleads import CustomerUserAccessErrorEnum
expected_names.append(CustomerUserAccessErrorEnum.__name__)
from google.ads.googleads import DatabaseErrorEnum
expected_names.append(DatabaseErrorEnum.__name__)
from google.ads.googleads import DateErrorEnum
expected_names.append(DateErrorEnum.__name__)
from google.ads.googleads import DateRangeErrorEnum
expected_names.append(DateRangeErrorEnum.__name__)
from google.ads.googleads import DistinctErrorEnum
expected_names.append(DistinctErrorEnum.__name__)
from google.ads.googleads import EnumErrorEnum
expected_names.append(EnumErrorEnum.__name__)
from google.ads.googleads import ExtensionFeedItemErrorEnum
expected_names.append(ExtensionFeedItemErrorEnum.__name__)
from google.ads.googleads import ExtensionSettingErrorEnum
expected_names.append(ExtensionSettingErrorEnum.__name__)
from google.ads.googleads import FeedAttributeReferenceErrorEnum
expected_names.append(FeedAttributeReferenceErrorEnum.__name__)
from google.ads.googleads import FeedErrorEnum
expected_names.append(FeedErrorEnum.__name__)
from google.ads.googleads import FeedItemErrorEnum
expected_names.append(FeedItemErrorEnum.__name__)
from google.ads.googleads import FeedItemSetErrorEnum
expected_names.append(FeedItemSetErrorEnum.__name__)
from google.ads.googleads import FeedItemSetLinkErrorEnum
expected_names.append(FeedItemSetLinkErrorEnum.__name__)
from google.ads.googleads import FeedItemTargetErrorEnum
expected_names.append(FeedItemTargetErrorEnum.__name__)
from google.ads.googleads import FeedItemValidationErrorEnum
expected_names.append(FeedItemValidationErrorEnum.__name__)
from google.ads.googleads import FeedMappingErrorEnum
expected_names.append(FeedMappingErrorEnum.__name__)
from google.ads.googleads import FieldErrorEnum
expected_names.append(FieldErrorEnum.__name__)
from google.ads.googleads import FieldMaskErrorEnum
expected_names.append(FieldMaskErrorEnum.__name__)
from google.ads.googleads import FunctionErrorEnum
expected_names.append(FunctionErrorEnum.__name__)
from google.ads.googleads import FunctionParsingErrorEnum
expected_names.append(FunctionParsingErrorEnum.__name__)
from google.ads.googleads import GeoTargetConstantSuggestionErrorEnum
expected_names.append(GeoTargetConstantSuggestionErrorEnum.__name__)
from google.ads.googleads import HeaderErrorEnum
expected_names.append(HeaderErrorEnum.__name__)
from google.ads.googleads import IdErrorEnum
expected_names.append(IdErrorEnum.__name__)
from google.ads.googleads import ImageErrorEnum
expected_names.append(ImageErrorEnum.__name__)
from google.ads.googleads import InternalErrorEnum
expected_names.append(InternalErrorEnum.__name__)
from google.ads.googleads import InvoiceErrorEnum
expected_names.append(InvoiceErrorEnum.__name__)
from google.ads.googleads import KeywordPlanAdGroupErrorEnum
expected_names.append(KeywordPlanAdGroupErrorEnum.__name__)
from google.ads.googleads import KeywordPlanAdGroupKeywordErrorEnum
expected_names.append(KeywordPlanAdGroupKeywordErrorEnum.__name__)
from google.ads.googleads import KeywordPlanCampaignErrorEnum
expected_names.append(KeywordPlanCampaignErrorEnum.__name__)
from google.ads.googleads import KeywordPlanCampaignKeywordErrorEnum
expected_names.append(KeywordPlanCampaignKeywordErrorEnum.__name__)
from google.ads.googleads import KeywordPlanErrorEnum
expected_names.append(KeywordPlanErrorEnum.__name__)
from google.ads.googleads import KeywordPlanIdeaErrorEnum
expected_names.append(KeywordPlanIdeaErrorEnum.__name__)
from google.ads.googleads import LabelErrorEnum
expected_names.append(LabelErrorEnum.__name__)
from google.ads.googleads import LanguageCodeErrorEnum
expected_names.append(LanguageCodeErrorEnum.__name__)
from google.ads.googleads import ListOperationErrorEnum
expected_names.append(ListOperationErrorEnum.__name__)
from google.ads.googleads import ManagerLinkErrorEnum
expected_names.append(ManagerLinkErrorEnum.__name__)
from google.ads.googleads import MediaBundleErrorEnum
expected_names.append(MediaBundleErrorEnum.__name__)
from google.ads.googleads import MediaFileErrorEnum
expected_names.append(MediaFileErrorEnum.__name__)
from google.ads.googleads import MediaUploadErrorEnum
expected_names.append(MediaUploadErrorEnum.__name__)
from google.ads.googleads import MultiplierErrorEnum
expected_names.append(MultiplierErrorEnum.__name__)
from google.ads.googleads import MutateErrorEnum
expected_names.append(MutateErrorEnum.__name__)
from google.ads.googleads import NewResourceCreationErrorEnum
expected_names.append(NewResourceCreationErrorEnum.__name__)
from google.ads.googleads import NotAllowlistedErrorEnum
expected_names.append(NotAllowlistedErrorEnum.__name__)
from google.ads.googleads import NotEmptyErrorEnum
expected_names.append(NotEmptyErrorEnum.__name__)
from google.ads.googleads import NullErrorEnum
expected_names.append(NullErrorEnum.__name__)
from google.ads.googleads import OfflineUserDataJobErrorEnum
expected_names.append(OfflineUserDataJobErrorEnum.__name__)
from google.ads.googleads import OperationAccessDeniedErrorEnum
expected_names.append(OperationAccessDeniedErrorEnum.__name__)
from google.ads.googleads import OperatorErrorEnum
expected_names.append(OperatorErrorEnum.__name__)
from google.ads.googleads import PartialFailureErrorEnum
expected_names.append(PartialFailureErrorEnum.__name__)
from google.ads.googleads import PaymentsAccountErrorEnum
expected_names.append(PaymentsAccountErrorEnum.__name__)
from google.ads.googleads import PolicyFindingErrorEnum
expected_names.append(PolicyFindingErrorEnum.__name__)
from google.ads.googleads import PolicyValidationParameterErrorEnum
expected_names.append(PolicyValidationParameterErrorEnum.__name__)
from google.ads.googleads import PolicyViolationErrorEnum
expected_names.append(PolicyViolationErrorEnum.__name__)
from google.ads.googleads import QueryErrorEnum
expected_names.append(QueryErrorEnum.__name__)
from google.ads.googleads import QuotaErrorEnum
expected_names.append(QuotaErrorEnum.__name__)
from google.ads.googleads import RangeErrorEnum
expected_names.append(RangeErrorEnum.__name__)
from google.ads.googleads import ReachPlanErrorEnum
expected_names.append(ReachPlanErrorEnum.__name__)
from google.ads.googleads import RecommendationErrorEnum
expected_names.append(RecommendationErrorEnum.__name__)
from google.ads.googleads import RegionCodeErrorEnum
expected_names.append(RegionCodeErrorEnum.__name__)
from google.ads.googleads import RequestErrorEnum
expected_names.append(RequestErrorEnum.__name__)
from google.ads.googleads import ResourceAccessDeniedErrorEnum
expected_names.append(ResourceAccessDeniedErrorEnum.__name__)
from google.ads.googleads import ResourceCountLimitExceededErrorEnum
expected_names.append(ResourceCountLimitExceededErrorEnum.__name__)
from google.ads.googleads import SettingErrorEnum
expected_names.append(SettingErrorEnum.__name__)
from google.ads.googleads import SharedCriterionErrorEnum
expected_names.append(SharedCriterionErrorEnum.__name__)
from google.ads.googleads import SharedSetErrorEnum
expected_names.append(SharedSetErrorEnum.__name__)
from google.ads.googleads import SizeLimitErrorEnum
expected_names.append(SizeLimitErrorEnum.__name__)
from google.ads.googleads import StringFormatErrorEnum
expected_names.append(StringFormatErrorEnum.__name__)
from google.ads.googleads import StringLengthErrorEnum
expected_names.append(StringLengthErrorEnum.__name__)
from google.ads.googleads import ThirdPartyAppAnalyticsLinkErrorEnum
expected_names.append(ThirdPartyAppAnalyticsLinkErrorEnum.__name__)
from google.ads.googleads import TimeZoneErrorEnum
expected_names.append(TimeZoneErrorEnum.__name__)
from google.ads.googleads import UrlFieldErrorEnum
expected_names.append(UrlFieldErrorEnum.__name__)
from google.ads.googleads import UserDataErrorEnum
expected_names.append(UserDataErrorEnum.__name__)
from google.ads.googleads import UserListErrorEnum
expected_names.append(UserListErrorEnum.__name__)
from google.ads.googleads import YoutubeVideoRegistrationErrorEnum
expected_names.append(YoutubeVideoRegistrationErrorEnum.__name__)
from google.ads.googleads import GoogleAdsFailure
expected_names.append(GoogleAdsFailure.__name__)
from google.ads.googleads import GoogleAdsError
expected_names.append(GoogleAdsError.__name__)
from google.ads.googleads import ErrorCode
expected_names.append(ErrorCode.__name__)
from google.ads.googleads import ErrorLocation
expected_names.append(ErrorLocation.__name__)
from google.ads.googleads import ErrorDetails
expected_names.append(ErrorDetails.__name__)
from google.ads.googleads import PolicyViolationDetails
expected_names.append(PolicyViolationDetails.__name__)
from google.ads.googleads import PolicyFindingDetails
expected_names.append(PolicyFindingDetails.__name__)
from google.ads.googleads import QuotaErrorDetails
expected_names.append(QuotaErrorDetails.__name__)
from google.ads.googleads import ResourceCountDetails
expected_names.append(ResourceCountDetails.__name__)
from google.ads.googleads import AccessibleBiddingStrategy
expected_names.append(AccessibleBiddingStrategy.__name__)
from google.ads.googleads import AccountBudget
expected_names.append(AccountBudget.__name__)
from google.ads.googleads import AccountBudgetProposal
expected_names.append(AccountBudgetProposal.__name__)
from google.ads.googleads import AccountLink
expected_names.append(AccountLink.__name__)
from google.ads.googleads import ThirdPartyAppAnalyticsLinkIdentifier
expected_names.append(ThirdPartyAppAnalyticsLinkIdentifier.__name__)
from google.ads.googleads import DataPartnerLinkIdentifier
expected_names.append(DataPartnerLinkIdentifier.__name__)
from google.ads.googleads import GoogleAdsLinkIdentifier
expected_names.append(GoogleAdsLinkIdentifier.__name__)
from google.ads.googleads import Ad
expected_names.append(Ad.__name__)
from google.ads.googleads import AdGroup
expected_names.append(AdGroup.__name__)
from google.ads.googleads import AdGroupAd
expected_names.append(AdGroupAd.__name__)
from google.ads.googleads import AdGroupAdPolicySummary
expected_names.append(AdGroupAdPolicySummary.__name__)
from google.ads.googleads import AdGroupAdAssetView
expected_names.append(AdGroupAdAssetView.__name__)
from google.ads.googleads import AdGroupAdAssetPolicySummary
expected_names.append(AdGroupAdAssetPolicySummary.__name__)
from google.ads.googleads import AdGroupAdLabel
expected_names.append(AdGroupAdLabel.__name__)
from google.ads.googleads import AdGroupAsset
expected_names.append(AdGroupAsset.__name__)
from google.ads.googleads import AdGroupAudienceView
expected_names.append(AdGroupAudienceView.__name__)
from google.ads.googleads import AdGroupBidModifier
expected_names.append(AdGroupBidModifier.__name__)
from google.ads.googleads import AdGroupCriterion
expected_names.append(AdGroupCriterion.__name__)
from google.ads.googleads import AdGroupCriterionLabel
expected_names.append(AdGroupCriterionLabel.__name__)
from google.ads.googleads import AdGroupCriterionSimulation
expected_names.append(AdGroupCriterionSimulation.__name__)
from google.ads.googleads import AdGroupExtensionSetting
expected_names.append(AdGroupExtensionSetting.__name__)
from google.ads.googleads import AdGroupFeed
expected_names.append(AdGroupFeed.__name__)
from google.ads.googleads import AdGroupLabel
expected_names.append(AdGroupLabel.__name__)
from google.ads.googleads import AdGroupSimulation
expected_names.append(AdGroupSimulation.__name__)
from google.ads.googleads import AdParameter
expected_names.append(AdParameter.__name__)
from google.ads.googleads import AdScheduleView
expected_names.append(AdScheduleView.__name__)
from google.ads.googleads import AgeRangeView
expected_names.append(AgeRangeView.__name__)
from google.ads.googleads import Asset
expected_names.append(Asset.__name__)
from google.ads.googleads import AssetPolicySummary
expected_names.append(AssetPolicySummary.__name__)
from google.ads.googleads import AssetFieldTypeView
expected_names.append(AssetFieldTypeView.__name__)
from google.ads.googleads import BatchJob
expected_names.append(BatchJob.__name__)
from google.ads.googleads import BiddingStrategy
expected_names.append(BiddingStrategy.__name__)
from google.ads.googleads import BiddingStrategySimulation
expected_names.append(BiddingStrategySimulation.__name__)
from google.ads.googleads import BillingSetup
expected_names.append(BillingSetup.__name__)
from google.ads.googleads import CallView
expected_names.append(CallView.__name__)
from google.ads.googleads import Campaign
expected_names.append(Campaign.__name__)
from google.ads.googleads import CampaignAsset
expected_names.append(CampaignAsset.__name__)
from google.ads.googleads import CampaignAudienceView
expected_names.append(CampaignAudienceView.__name__)
from google.ads.googleads import CampaignBidModifier
expected_names.append(CampaignBidModifier.__name__)
from google.ads.googleads import CampaignBudget
expected_names.append(CampaignBudget.__name__)
from google.ads.googleads import CampaignCriterion
expected_names.append(CampaignCriterion.__name__)
from google.ads.googleads import CampaignCriterionSimulation
expected_names.append(CampaignCriterionSimulation.__name__)
from google.ads.googleads import CampaignDraft
expected_names.append(CampaignDraft.__name__)
from google.ads.googleads import CampaignExperiment
expected_names.append(CampaignExperiment.__name__)
from google.ads.googleads import CampaignExtensionSetting
expected_names.append(CampaignExtensionSetting.__name__)
from google.ads.googleads import CampaignFeed
expected_names.append(CampaignFeed.__name__)
from google.ads.googleads import CampaignLabel
expected_names.append(CampaignLabel.__name__)
from google.ads.googleads import CampaignSharedSet
expected_names.append(CampaignSharedSet.__name__)
from google.ads.googleads import CampaignSimulation
expected_names.append(CampaignSimulation.__name__)
from google.ads.googleads import CarrierConstant
expected_names.append(CarrierConstant.__name__)
from google.ads.googleads import Feed
expected_names.append(Feed.__name__)
from google.ads.googleads import FeedAttribute
expected_names.append(FeedAttribute.__name__)
from google.ads.googleads import FeedAttributeOperation
expected_names.append(FeedAttributeOperation.__name__)
from google.ads.googleads import FeedItem
expected_names.append(FeedItem.__name__)
from google.ads.googleads import FeedItemAttributeValue
expected_names.append(FeedItemAttributeValue.__name__)
from google.ads.googleads import FeedItemPlaceholderPolicyInfo
expected_names.append(FeedItemPlaceholderPolicyInfo.__name__)
from google.ads.googleads import FeedItemValidationError
expected_names.append(FeedItemValidationError.__name__)
from google.ads.googleads import ChangeEvent
expected_names.append(ChangeEvent.__name__)
from google.ads.googleads import ChangeStatus
expected_names.append(ChangeStatus.__name__)
from google.ads.googleads import ClickView
expected_names.append(ClickView.__name__)
from google.ads.googleads import CombinedAudience
expected_names.append(CombinedAudience.__name__)
from google.ads.googleads import ConversionAction
expected_names.append(ConversionAction.__name__)
from google.ads.googleads import ConversionCustomVariable
expected_names.append(ConversionCustomVariable.__name__)
from google.ads.googleads import CurrencyConstant
expected_names.append(CurrencyConstant.__name__)
from google.ads.googleads import CustomAudience
expected_names.append(CustomAudience.__name__)
from google.ads.googleads import CustomAudienceMember
expected_names.append(CustomAudienceMember.__name__)
from google.ads.googleads import CustomInterest
expected_names.append(CustomInterest.__name__)
from google.ads.googleads import CustomInterestMember
expected_names.append(CustomInterestMember.__name__)
from google.ads.googleads import Customer
expected_names.append(Customer.__name__)
from google.ads.googleads import CallReportingSetting
expected_names.append(CallReportingSetting.__name__)
from google.ads.googleads import ConversionTrackingSetting
expected_names.append(ConversionTrackingSetting.__name__)
from google.ads.googleads import RemarketingSetting
expected_names.append(RemarketingSetting.__name__)
from google.ads.googleads import CustomerAsset
expected_names.append(CustomerAsset.__name__)
from google.ads.googleads import CustomerClient
expected_names.append(CustomerClient.__name__)
from google.ads.googleads import CustomerClientLink
expected_names.append(CustomerClientLink.__name__)
from google.ads.googleads import CustomerExtensionSetting
expected_names.append(CustomerExtensionSetting.__name__)
from google.ads.googleads import CustomerFeed
expected_names.append(CustomerFeed.__name__)
from google.ads.googleads import CustomerLabel
expected_names.append(CustomerLabel.__name__)
from google.ads.googleads import CustomerManagerLink
expected_names.append(CustomerManagerLink.__name__)
from google.ads.googleads import CustomerNegativeCriterion
expected_names.append(CustomerNegativeCriterion.__name__)
from google.ads.googleads import CustomerUserAccess
expected_names.append(CustomerUserAccess.__name__)
from google.ads.googleads import CustomerUserAccessInvitation
expected_names.append(CustomerUserAccessInvitation.__name__)
from google.ads.googleads import DetailPlacementView
expected_names.append(DetailPlacementView.__name__)
from google.ads.googleads import DetailedDemographic
expected_names.append(DetailedDemographic.__name__)
from google.ads.googleads import DisplayKeywordView
expected_names.append(DisplayKeywordView.__name__)
from google.ads.googleads import DistanceView
expected_names.append(DistanceView.__name__)
from google.ads.googleads import DomainCategory
expected_names.append(DomainCategory.__name__)
from google.ads.googleads import DynamicSearchAdsSearchTermView
expected_names.append(DynamicSearchAdsSearchTermView.__name__)
from google.ads.googleads import ExpandedLandingPageView
expected_names.append(ExpandedLandingPageView.__name__)
from google.ads.googleads import ExtensionFeedItem
expected_names.append(ExtensionFeedItem.__name__)
from google.ads.googleads import FeedItemSet
expected_names.append(FeedItemSet.__name__)
from google.ads.googleads import FeedItemSetLink
expected_names.append(FeedItemSetLink.__name__)
from google.ads.googleads import FeedItemTarget
expected_names.append(FeedItemTarget.__name__)
from google.ads.googleads import FeedMapping
expected_names.append(FeedMapping.__name__)
from google.ads.googleads import AttributeFieldMapping
expected_names.append(AttributeFieldMapping.__name__)
from google.ads.googleads import FeedPlaceholderView
expected_names.append(FeedPlaceholderView.__name__)
from google.ads.googleads import GenderView
expected_names.append(GenderView.__name__)
from google.ads.googleads import GeoTargetConstant
expected_names.append(GeoTargetConstant.__name__)
from google.ads.googleads import GeographicView
expected_names.append(GeographicView.__name__)
from google.ads.googleads import GoogleAdsField
expected_names.append(GoogleAdsField.__name__)
from google.ads.googleads import GroupPlacementView
expected_names.append(GroupPlacementView.__name__)
from google.ads.googleads import HotelGroupView
expected_names.append(HotelGroupView.__name__)
from google.ads.googleads import HotelPerformanceView
expected_names.append(HotelPerformanceView.__name__)
from google.ads.googleads import IncomeRangeView
expected_names.append(IncomeRangeView.__name__)
from google.ads.googleads import Invoice
expected_names.append(Invoice.__name__)
from google.ads.googleads import KeywordPlan
expected_names.append(KeywordPlan.__name__)
from google.ads.googleads import KeywordPlanForecastPeriod
expected_names.append(KeywordPlanForecastPeriod.__name__)
from google.ads.googleads import KeywordPlanAdGroup
expected_names.append(KeywordPlanAdGroup.__name__)
from google.ads.googleads import KeywordPlanAdGroupKeyword
expected_names.append(KeywordPlanAdGroupKeyword.__name__)
from google.ads.googleads import KeywordPlanCampaign
expected_names.append(KeywordPlanCampaign.__name__)
from google.ads.googleads import KeywordPlanGeoTarget
expected_names.append(KeywordPlanGeoTarget.__name__)
from google.ads.googleads import KeywordPlanCampaignKeyword
expected_names.append(KeywordPlanCampaignKeyword.__name__)
from google.ads.googleads import KeywordThemeConstant
expected_names.append(KeywordThemeConstant.__name__)
from google.ads.googleads import KeywordView
expected_names.append(KeywordView.__name__)
from google.ads.googleads import Label
expected_names.append(Label.__name__)
from google.ads.googleads import LandingPageView
expected_names.append(LandingPageView.__name__)
from google.ads.googleads import LanguageConstant
expected_names.append(LanguageConstant.__name__)
from google.ads.googleads import LifeEvent
expected_names.append(LifeEvent.__name__)
from google.ads.googleads import LocationView
expected_names.append(LocationView.__name__)
from google.ads.googleads import ManagedPlacementView
expected_names.append(ManagedPlacementView.__name__)
from google.ads.googleads import MediaFile
expected_names.append(MediaFile.__name__)
from google.ads.googleads import MediaImage
expected_names.append(MediaImage.__name__)
from google.ads.googleads import MediaBundle
expected_names.append(MediaBundle.__name__)
from google.ads.googleads import MediaAudio
expected_names.append(MediaAudio.__name__)
from google.ads.googleads import MediaVideo
expected_names.append(MediaVideo.__name__)
from google.ads.googleads import MerchantCenterLink
expected_names.append(MerchantCenterLink.__name__)
from google.ads.googleads import MobileAppCategoryConstant
expected_names.append(MobileAppCategoryConstant.__name__)
from google.ads.googleads import MobileDeviceConstant
expected_names.append(MobileDeviceConstant.__name__)
from google.ads.googleads import OfflineUserDataJob
expected_names.append(OfflineUserDataJob.__name__)
from google.ads.googleads import OperatingSystemVersionConstant
expected_names.append(OperatingSystemVersionConstant.__name__)
from google.ads.googleads import PaidOrganicSearchTermView
expected_names.append(PaidOrganicSearchTermView.__name__)
from google.ads.googleads import ParentalStatusView
expected_names.append(ParentalStatusView.__name__)
from google.ads.googleads import PaymentsAccount
expected_names.append(PaymentsAccount.__name__)
from google.ads.googleads import ProductBiddingCategoryConstant
expected_names.append(ProductBiddingCategoryConstant.__name__)
from google.ads.googleads import ProductGroupView
expected_names.append(ProductGroupView.__name__)
from google.ads.googleads import Recommendation
expected_names.append(Recommendation.__name__)
from google.ads.googleads import RemarketingAction
expected_names.append(RemarketingAction.__name__)
from google.ads.googleads import SearchTermView
expected_names.append(SearchTermView.__name__)
from google.ads.googleads import SharedCriterion
expected_names.append(SharedCriterion.__name__)
from google.ads.googleads import SharedSet
expected_names.append(SharedSet.__name__)
from google.ads.googleads import ShoppingPerformanceView
expected_names.append(ShoppingPerformanceView.__name__)
from google.ads.googleads import SmartCampaignSearchTermView
expected_names.append(SmartCampaignSearchTermView.__name__)
from google.ads.googleads import SmartCampaignSetting
expected_names.append(SmartCampaignSetting.__name__)
from google.ads.googleads import ThirdPartyAppAnalyticsLink
expected_names.append(ThirdPartyAppAnalyticsLink.__name__)
from google.ads.googleads import TopicConstant
expected_names.append(TopicConstant.__name__)
from google.ads.googleads import TopicView
expected_names.append(TopicView.__name__)
from google.ads.googleads import UserInterest
expected_names.append(UserInterest.__name__)
from google.ads.googleads import UserList
expected_names.append(UserList.__name__)
from google.ads.googleads import UserLocationView
expected_names.append(UserLocationView.__name__)
from google.ads.googleads import Video
expected_names.append(Video.__name__)
from google.ads.googleads import WebpageView
expected_names.append(WebpageView.__name__)
from google.ads.googleads import GetAccessibleBiddingStrategyRequest
expected_names.append(GetAccessibleBiddingStrategyRequest.__name__)
from google.ads.googleads import GetAccountBudgetProposalRequest
expected_names.append(GetAccountBudgetProposalRequest.__name__)
from google.ads.googleads import MutateAccountBudgetProposalRequest
expected_names.append(MutateAccountBudgetProposalRequest.__name__)
from google.ads.googleads import AccountBudgetProposalOperation
expected_names.append(AccountBudgetProposalOperation.__name__)
from google.ads.googleads import MutateAccountBudgetProposalResponse
expected_names.append(MutateAccountBudgetProposalResponse.__name__)
from google.ads.googleads import MutateAccountBudgetProposalResult
expected_names.append(MutateAccountBudgetProposalResult.__name__)
from google.ads.googleads import GetAccountBudgetRequest
expected_names.append(GetAccountBudgetRequest.__name__)
from google.ads.googleads import GetAccountLinkRequest
expected_names.append(GetAccountLinkRequest.__name__)
from google.ads.googleads import CreateAccountLinkRequest
expected_names.append(CreateAccountLinkRequest.__name__)
from google.ads.googleads import CreateAccountLinkResponse
expected_names.append(CreateAccountLinkResponse.__name__)
from google.ads.googleads import MutateAccountLinkRequest
expected_names.append(MutateAccountLinkRequest.__name__)
from google.ads.googleads import AccountLinkOperation
expected_names.append(AccountLinkOperation.__name__)
from google.ads.googleads import MutateAccountLinkResponse
expected_names.append(MutateAccountLinkResponse.__name__)
from google.ads.googleads import MutateAccountLinkResult
expected_names.append(MutateAccountLinkResult.__name__)
from google.ads.googleads import GetAdGroupAdAssetViewRequest
expected_names.append(GetAdGroupAdAssetViewRequest.__name__)
from google.ads.googleads import GetAdGroupAdLabelRequest
expected_names.append(GetAdGroupAdLabelRequest.__name__)
from google.ads.googleads import MutateAdGroupAdLabelsRequest
expected_names.append(MutateAdGroupAdLabelsRequest.__name__)
from google.ads.googleads import AdGroupAdLabelOperation
expected_names.append(AdGroupAdLabelOperation.__name__)
from google.ads.googleads import MutateAdGroupAdLabelsResponse
expected_names.append(MutateAdGroupAdLabelsResponse.__name__)
from google.ads.googleads import MutateAdGroupAdLabelResult
expected_names.append(MutateAdGroupAdLabelResult.__name__)
from google.ads.googleads import GetAdGroupAdRequest
expected_names.append(GetAdGroupAdRequest.__name__)
from google.ads.googleads import MutateAdGroupAdsRequest
expected_names.append(MutateAdGroupAdsRequest.__name__)
from google.ads.googleads import AdGroupAdOperation
expected_names.append(AdGroupAdOperation.__name__)
from google.ads.googleads import MutateAdGroupAdsResponse
expected_names.append(MutateAdGroupAdsResponse.__name__)
from google.ads.googleads import MutateAdGroupAdResult
expected_names.append(MutateAdGroupAdResult.__name__)
from google.ads.googleads import GetAdGroupAssetRequest
expected_names.append(GetAdGroupAssetRequest.__name__)
from google.ads.googleads import MutateAdGroupAssetsRequest
expected_names.append(MutateAdGroupAssetsRequest.__name__)
from google.ads.googleads import AdGroupAssetOperation
expected_names.append(AdGroupAssetOperation.__name__)
from google.ads.googleads import MutateAdGroupAssetsResponse
expected_names.append(MutateAdGroupAssetsResponse.__name__)
from google.ads.googleads import MutateAdGroupAssetResult
expected_names.append(MutateAdGroupAssetResult.__name__)
from google.ads.googleads import GetAdGroupAudienceViewRequest
expected_names.append(GetAdGroupAudienceViewRequest.__name__)
from google.ads.googleads import GetAdGroupBidModifierRequest
expected_names.append(GetAdGroupBidModifierRequest.__name__)
from google.ads.googleads import MutateAdGroupBidModifiersRequest
expected_names.append(MutateAdGroupBidModifiersRequest.__name__)
from google.ads.googleads import AdGroupBidModifierOperation
expected_names.append(AdGroupBidModifierOperation.__name__)
from google.ads.googleads import MutateAdGroupBidModifiersResponse
expected_names.append(MutateAdGroupBidModifiersResponse.__name__)
from google.ads.googleads import MutateAdGroupBidModifierResult
expected_names.append(MutateAdGroupBidModifierResult.__name__)
from google.ads.googleads import GetAdGroupCriterionLabelRequest
expected_names.append(GetAdGroupCriterionLabelRequest.__name__)
from google.ads.googleads import MutateAdGroupCriterionLabelsRequest
expected_names.append(MutateAdGroupCriterionLabelsRequest.__name__)
from google.ads.googleads import AdGroupCriterionLabelOperation
expected_names.append(AdGroupCriterionLabelOperation.__name__)
from google.ads.googleads import MutateAdGroupCriterionLabelsResponse
expected_names.append(MutateAdGroupCriterionLabelsResponse.__name__)
from google.ads.googleads import MutateAdGroupCriterionLabelResult
expected_names.append(MutateAdGroupCriterionLabelResult.__name__)
from google.ads.googleads import GetAdGroupCriterionRequest
expected_names.append(GetAdGroupCriterionRequest.__name__)
from google.ads.googleads import MutateAdGroupCriteriaRequest
expected_names.append(MutateAdGroupCriteriaRequest.__name__)
from google.ads.googleads import AdGroupCriterionOperation
expected_names.append(AdGroupCriterionOperation.__name__)
from google.ads.googleads import MutateAdGroupCriteriaResponse
expected_names.append(MutateAdGroupCriteriaResponse.__name__)
from google.ads.googleads import MutateAdGroupCriterionResult
expected_names.append(MutateAdGroupCriterionResult.__name__)
from google.ads.googleads import GetAdGroupCriterionSimulationRequest
expected_names.append(GetAdGroupCriterionSimulationRequest.__name__)
from google.ads.googleads import GetAdGroupExtensionSettingRequest
expected_names.append(GetAdGroupExtensionSettingRequest.__name__)
from google.ads.googleads import MutateAdGroupExtensionSettingsRequest
expected_names.append(MutateAdGroupExtensionSettingsRequest.__name__)
from google.ads.googleads import AdGroupExtensionSettingOperation
expected_names.append(AdGroupExtensionSettingOperation.__name__)
from google.ads.googleads import MutateAdGroupExtensionSettingsResponse
expected_names.append(MutateAdGroupExtensionSettingsResponse.__name__)
from google.ads.googleads import MutateAdGroupExtensionSettingResult
expected_names.append(MutateAdGroupExtensionSettingResult.__name__)
from google.ads.googleads import GetAdGroupFeedRequest
expected_names.append(GetAdGroupFeedRequest.__name__)
from google.ads.googleads import MutateAdGroupFeedsRequest
expected_names.append(MutateAdGroupFeedsRequest.__name__)
from google.ads.googleads import AdGroupFeedOperation
expected_names.append(AdGroupFeedOperation.__name__)
from google.ads.googleads import MutateAdGroupFeedsResponse
expected_names.append(MutateAdGroupFeedsResponse.__name__)
from google.ads.googleads import MutateAdGroupFeedResult
expected_names.append(MutateAdGroupFeedResult.__name__)
from google.ads.googleads import GetAdGroupLabelRequest
expected_names.append(GetAdGroupLabelRequest.__name__)
from google.ads.googleads import MutateAdGroupLabelsRequest
expected_names.append(MutateAdGroupLabelsRequest.__name__)
from google.ads.googleads import AdGroupLabelOperation
expected_names.append(AdGroupLabelOperation.__name__)
from google.ads.googleads import MutateAdGroupLabelsResponse
expected_names.append(MutateAdGroupLabelsResponse.__name__)
from google.ads.googleads import MutateAdGroupLabelResult
expected_names.append(MutateAdGroupLabelResult.__name__)
from google.ads.googleads import GetAdGroupRequest
expected_names.append(GetAdGroupRequest.__name__)
from google.ads.googleads import MutateAdGroupsRequest
expected_names.append(MutateAdGroupsRequest.__name__)
from google.ads.googleads import AdGroupOperation
expected_names.append(AdGroupOperation.__name__)
from google.ads.googleads import MutateAdGroupsResponse
expected_names.append(MutateAdGroupsResponse.__name__)
from google.ads.googleads import MutateAdGroupResult
expected_names.append(MutateAdGroupResult.__name__)
from google.ads.googleads import GetAdGroupSimulationRequest
expected_names.append(GetAdGroupSimulationRequest.__name__)
from google.ads.googleads import GetAdParameterRequest
expected_names.append(GetAdParameterRequest.__name__)
from google.ads.googleads import MutateAdParametersRequest
expected_names.append(MutateAdParametersRequest.__name__)
from google.ads.googleads import AdParameterOperation
expected_names.append(AdParameterOperation.__name__)
from google.ads.googleads import MutateAdParametersResponse
expected_names.append(MutateAdParametersResponse.__name__)
from google.ads.googleads import MutateAdParameterResult
expected_names.append(MutateAdParameterResult.__name__)
from google.ads.googleads import GetAdScheduleViewRequest
expected_names.append(GetAdScheduleViewRequest.__name__)
from google.ads.googleads import GetAdRequest
expected_names.append(GetAdRequest.__name__)
from google.ads.googleads import MutateAdsRequest
expected_names.append(MutateAdsRequest.__name__)
from google.ads.googleads import AdOperation
expected_names.append(AdOperation.__name__)
from google.ads.googleads import MutateAdsResponse
expected_names.append(MutateAdsResponse.__name__)
from google.ads.googleads import MutateAdResult
expected_names.append(MutateAdResult.__name__)
from google.ads.googleads import GetAgeRangeViewRequest
expected_names.append(GetAgeRangeViewRequest.__name__)
from google.ads.googleads import GetAssetFieldTypeViewRequest
expected_names.append(GetAssetFieldTypeViewRequest.__name__)
from google.ads.googleads import GetAssetRequest
expected_names.append(GetAssetRequest.__name__)
from google.ads.googleads import MutateAssetsRequest
expected_names.append(MutateAssetsRequest.__name__)
from google.ads.googleads import AssetOperation
expected_names.append(AssetOperation.__name__)
from google.ads.googleads import MutateAssetsResponse
expected_names.append(MutateAssetsResponse.__name__)
from google.ads.googleads import MutateAssetResult
expected_names.append(MutateAssetResult.__name__)
from google.ads.googleads import GetBiddingStrategyRequest
expected_names.append(GetBiddingStrategyRequest.__name__)
from google.ads.googleads import MutateBiddingStrategiesRequest
expected_names.append(MutateBiddingStrategiesRequest.__name__)
from google.ads.googleads import BiddingStrategyOperation
expected_names.append(BiddingStrategyOperation.__name__)
from google.ads.googleads import MutateBiddingStrategiesResponse
expected_names.append(MutateBiddingStrategiesResponse.__name__)
from google.ads.googleads import MutateBiddingStrategyResult
expected_names.append(MutateBiddingStrategyResult.__name__)
from google.ads.googleads import GetCampaignAssetRequest
expected_names.append(GetCampaignAssetRequest.__name__)
from google.ads.googleads import MutateCampaignAssetsRequest
expected_names.append(MutateCampaignAssetsRequest.__name__)
from google.ads.googleads import CampaignAssetOperation
expected_names.append(CampaignAssetOperation.__name__)
from google.ads.googleads import MutateCampaignAssetsResponse
expected_names.append(MutateCampaignAssetsResponse.__name__)
from google.ads.googleads import MutateCampaignAssetResult
expected_names.append(MutateCampaignAssetResult.__name__)
from google.ads.googleads import GetCampaignBidModifierRequest
expected_names.append(GetCampaignBidModifierRequest.__name__)
from google.ads.googleads import MutateCampaignBidModifiersRequest
expected_names.append(MutateCampaignBidModifiersRequest.__name__)
from google.ads.googleads import CampaignBidModifierOperation
expected_names.append(CampaignBidModifierOperation.__name__)
from google.ads.googleads import MutateCampaignBidModifiersResponse
expected_names.append(MutateCampaignBidModifiersResponse.__name__)
from google.ads.googleads import MutateCampaignBidModifierResult
expected_names.append(MutateCampaignBidModifierResult.__name__)
from google.ads.googleads import GetCampaignBudgetRequest
expected_names.append(GetCampaignBudgetRequest.__name__)
from google.ads.googleads import MutateCampaignBudgetsRequest
expected_names.append(MutateCampaignBudgetsRequest.__name__)
from google.ads.googleads import CampaignBudgetOperation
expected_names.append(CampaignBudgetOperation.__name__)
from google.ads.googleads import MutateCampaignBudgetsResponse
expected_names.append(MutateCampaignBudgetsResponse.__name__)
from google.ads.googleads import MutateCampaignBudgetResult
expected_names.append(MutateCampaignBudgetResult.__name__)
from google.ads.googleads import GetCampaignCriterionRequest
expected_names.append(GetCampaignCriterionRequest.__name__)
from google.ads.googleads import MutateCampaignCriteriaRequest
expected_names.append(MutateCampaignCriteriaRequest.__name__)
from google.ads.googleads import CampaignCriterionOperation
expected_names.append(CampaignCriterionOperation.__name__)
from google.ads.googleads import MutateCampaignCriteriaResponse
expected_names.append(MutateCampaignCriteriaResponse.__name__)
from google.ads.googleads import MutateCampaignCriterionResult
expected_names.append(MutateCampaignCriterionResult.__name__)
from google.ads.googleads import GetCampaignDraftRequest
expected_names.append(GetCampaignDraftRequest.__name__)
from google.ads.googleads import MutateCampaignDraftsRequest
expected_names.append(MutateCampaignDraftsRequest.__name__)
from google.ads.googleads import PromoteCampaignDraftRequest
expected_names.append(PromoteCampaignDraftRequest.__name__)
from google.ads.googleads import CampaignDraftOperation
expected_names.append(CampaignDraftOperation.__name__)
from google.ads.googleads import MutateCampaignDraftsResponse
expected_names.append(MutateCampaignDraftsResponse.__name__)
from google.ads.googleads import MutateCampaignDraftResult
expected_names.append(MutateCampaignDraftResult.__name__)
from google.ads.googleads import ListCampaignDraftAsyncErrorsRequest
expected_names.append(ListCampaignDraftAsyncErrorsRequest.__name__)
from google.ads.googleads import ListCampaignDraftAsyncErrorsResponse
expected_names.append(ListCampaignDraftAsyncErrorsResponse.__name__)
from google.ads.googleads import GetCampaignExperimentRequest
expected_names.append(GetCampaignExperimentRequest.__name__)
from google.ads.googleads import MutateCampaignExperimentsRequest
expected_names.append(MutateCampaignExperimentsRequest.__name__)
from google.ads.googleads import CampaignExperimentOperation
expected_names.append(CampaignExperimentOperation.__name__)
from google.ads.googleads import MutateCampaignExperimentsResponse
expected_names.append(MutateCampaignExperimentsResponse.__name__)
from google.ads.googleads import MutateCampaignExperimentResult
expected_names.append(MutateCampaignExperimentResult.__name__)
from google.ads.googleads import CreateCampaignExperimentRequest
expected_names.append(CreateCampaignExperimentRequest.__name__)
from google.ads.googleads import CreateCampaignExperimentMetadata
expected_names.append(CreateCampaignExperimentMetadata.__name__)
from google.ads.googleads import GraduateCampaignExperimentRequest
expected_names.append(GraduateCampaignExperimentRequest.__name__)
from google.ads.googleads import GraduateCampaignExperimentResponse
expected_names.append(GraduateCampaignExperimentResponse.__name__)
from google.ads.googleads import PromoteCampaignExperimentRequest
expected_names.append(PromoteCampaignExperimentRequest.__name__)
from google.ads.googleads import EndCampaignExperimentRequest
expected_names.append(EndCampaignExperimentRequest.__name__)
from google.ads.googleads import ListCampaignExperimentAsyncErrorsRequest
expected_names.append(ListCampaignExperimentAsyncErrorsRequest.__name__)
from google.ads.googleads import ListCampaignExperimentAsyncErrorsResponse
expected_names.append(ListCampaignExperimentAsyncErrorsResponse.__name__)
from google.ads.googleads import GetCampaignExtensionSettingRequest
expected_names.append(GetCampaignExtensionSettingRequest.__name__)
from google.ads.googleads import MutateCampaignExtensionSettingsRequest
expected_names.append(MutateCampaignExtensionSettingsRequest.__name__)
from google.ads.googleads import CampaignExtensionSettingOperation
expected_names.append(CampaignExtensionSettingOperation.__name__)
from google.ads.googleads import MutateCampaignExtensionSettingsResponse
expected_names.append(MutateCampaignExtensionSettingsResponse.__name__)
from google.ads.googleads import MutateCampaignExtensionSettingResult
expected_names.append(MutateCampaignExtensionSettingResult.__name__)
from google.ads.googleads import GetCampaignFeedRequest
expected_names.append(GetCampaignFeedRequest.__name__)
from google.ads.googleads import MutateCampaignFeedsRequest
expected_names.append(MutateCampaignFeedsRequest.__name__)
from google.ads.googleads import CampaignFeedOperation
expected_names.append(CampaignFeedOperation.__name__)
from google.ads.googleads import MutateCampaignFeedsResponse
expected_names.append(MutateCampaignFeedsResponse.__name__)
from google.ads.googleads import MutateCampaignFeedResult
expected_names.append(MutateCampaignFeedResult.__name__)
from google.ads.googleads import GetCampaignLabelRequest
expected_names.append(GetCampaignLabelRequest.__name__)
from google.ads.googleads import MutateCampaignLabelsRequest
expected_names.append(MutateCampaignLabelsRequest.__name__)
from google.ads.googleads import CampaignLabelOperation
expected_names.append(CampaignLabelOperation.__name__)
from google.ads.googleads import MutateCampaignLabelsResponse
expected_names.append(MutateCampaignLabelsResponse.__name__)
from google.ads.googleads import MutateCampaignLabelResult
expected_names.append(MutateCampaignLabelResult.__name__)
from google.ads.googleads import GetCampaignRequest
expected_names.append(GetCampaignRequest.__name__)
from google.ads.googleads import MutateCampaignsRequest
expected_names.append(MutateCampaignsRequest.__name__)
from google.ads.googleads import CampaignOperation
expected_names.append(CampaignOperation.__name__)
from google.ads.googleads import MutateCampaignsResponse
expected_names.append(MutateCampaignsResponse.__name__)
from google.ads.googleads import MutateCampaignResult
expected_names.append(MutateCampaignResult.__name__)
from google.ads.googleads import GetCampaignSharedSetRequest
expected_names.append(GetCampaignSharedSetRequest.__name__)
from google.ads.googleads import MutateCampaignSharedSetsRequest
expected_names.append(MutateCampaignSharedSetsRequest.__name__)
from google.ads.googleads import CampaignSharedSetOperation
expected_names.append(CampaignSharedSetOperation.__name__)
from google.ads.googleads import MutateCampaignSharedSetsResponse
expected_names.append(MutateCampaignSharedSetsResponse.__name__)
from google.ads.googleads import MutateCampaignSharedSetResult
expected_names.append(MutateCampaignSharedSetResult.__name__)
from google.ads.googleads import GetConversionActionRequest
expected_names.append(GetConversionActionRequest.__name__)
from google.ads.googleads import MutateConversionActionsRequest
expected_names.append(MutateConversionActionsRequest.__name__)
from google.ads.googleads import ConversionActionOperation
expected_names.append(ConversionActionOperation.__name__)
from google.ads.googleads import MutateConversionActionsResponse
expected_names.append(MutateConversionActionsResponse.__name__)
from google.ads.googleads import MutateConversionActionResult
expected_names.append(MutateConversionActionResult.__name__)
from google.ads.googleads import GetConversionCustomVariableRequest
expected_names.append(GetConversionCustomVariableRequest.__name__)
from google.ads.googleads import MutateConversionCustomVariablesRequest
expected_names.append(MutateConversionCustomVariablesRequest.__name__)
from google.ads.googleads import ConversionCustomVariableOperation
expected_names.append(ConversionCustomVariableOperation.__name__)
from google.ads.googleads import MutateConversionCustomVariablesResponse
expected_names.append(MutateConversionCustomVariablesResponse.__name__)
from google.ads.googleads import MutateConversionCustomVariableResult
expected_names.append(MutateConversionCustomVariableResult.__name__)
from google.ads.googleads import GetCustomerAssetRequest
expected_names.append(GetCustomerAssetRequest.__name__)
from google.ads.googleads import MutateCustomerAssetsRequest
expected_names.append(MutateCustomerAssetsRequest.__name__)
from google.ads.googleads import CustomerAssetOperation
expected_names.append(CustomerAssetOperation.__name__)
from google.ads.googleads import MutateCustomerAssetsResponse
expected_names.append(MutateCustomerAssetsResponse.__name__)
from google.ads.googleads import MutateCustomerAssetResult
expected_names.append(MutateCustomerAssetResult.__name__)
from google.ads.googleads import GetCustomerExtensionSettingRequest
expected_names.append(GetCustomerExtensionSettingRequest.__name__)
from google.ads.googleads import MutateCustomerExtensionSettingsRequest
expected_names.append(MutateCustomerExtensionSettingsRequest.__name__)
from google.ads.googleads import CustomerExtensionSettingOperation
expected_names.append(CustomerExtensionSettingOperation.__name__)
from google.ads.googleads import MutateCustomerExtensionSettingsResponse
expected_names.append(MutateCustomerExtensionSettingsResponse.__name__)
from google.ads.googleads import MutateCustomerExtensionSettingResult
expected_names.append(MutateCustomerExtensionSettingResult.__name__)
from google.ads.googleads import GetCustomerFeedRequest
expected_names.append(GetCustomerFeedRequest.__name__)
from google.ads.googleads import MutateCustomerFeedsRequest
expected_names.append(MutateCustomerFeedsRequest.__name__)
from google.ads.googleads import CustomerFeedOperation
expected_names.append(CustomerFeedOperation.__name__)
from google.ads.googleads import MutateCustomerFeedsResponse
expected_names.append(MutateCustomerFeedsResponse.__name__)
from google.ads.googleads import MutateCustomerFeedResult
expected_names.append(MutateCustomerFeedResult.__name__)
from google.ads.googleads import GetCustomerLabelRequest
expected_names.append(GetCustomerLabelRequest.__name__)
from google.ads.googleads import MutateCustomerLabelsRequest
expected_names.append(MutateCustomerLabelsRequest.__name__)
from google.ads.googleads import CustomerLabelOperation
expected_names.append(CustomerLabelOperation.__name__)
from google.ads.googleads import MutateCustomerLabelsResponse
expected_names.append(MutateCustomerLabelsResponse.__name__)
from google.ads.googleads import MutateCustomerLabelResult
expected_names.append(MutateCustomerLabelResult.__name__)
from google.ads.googleads import GetCustomerNegativeCriterionRequest
expected_names.append(GetCustomerNegativeCriterionRequest.__name__)
from google.ads.googleads import MutateCustomerNegativeCriteriaRequest
expected_names.append(MutateCustomerNegativeCriteriaRequest.__name__)
from google.ads.googleads import CustomerNegativeCriterionOperation
expected_names.append(CustomerNegativeCriterionOperation.__name__)
from google.ads.googleads import MutateCustomerNegativeCriteriaResponse
expected_names.append(MutateCustomerNegativeCriteriaResponse.__name__)
from google.ads.googleads import MutateCustomerNegativeCriteriaResult
expected_names.append(MutateCustomerNegativeCriteriaResult.__name__)
from google.ads.googleads import GetCustomerRequest
expected_names.append(GetCustomerRequest.__name__)
from google.ads.googleads import MutateCustomerRequest
expected_names.append(MutateCustomerRequest.__name__)
from google.ads.googleads import CreateCustomerClientRequest
expected_names.append(CreateCustomerClientRequest.__name__)
from google.ads.googleads import CustomerOperation
expected_names.append(CustomerOperation.__name__)
from google.ads.googleads import CreateCustomerClientResponse
expected_names.append(CreateCustomerClientResponse.__name__)
from google.ads.googleads import MutateCustomerResponse
expected_names.append(MutateCustomerResponse.__name__)
from google.ads.googleads import MutateCustomerResult
expected_names.append(MutateCustomerResult.__name__)
from google.ads.googleads import ListAccessibleCustomersRequest
expected_names.append(ListAccessibleCustomersRequest.__name__)
from google.ads.googleads import ListAccessibleCustomersResponse
expected_names.append(ListAccessibleCustomersResponse.__name__)
from google.ads.googleads import GetExtensionFeedItemRequest
expected_names.append(GetExtensionFeedItemRequest.__name__)
from google.ads.googleads import MutateExtensionFeedItemsRequest
expected_names.append(MutateExtensionFeedItemsRequest.__name__)
from google.ads.googleads import ExtensionFeedItemOperation
expected_names.append(ExtensionFeedItemOperation.__name__)
from google.ads.googleads import MutateExtensionFeedItemsResponse
expected_names.append(MutateExtensionFeedItemsResponse.__name__)
from google.ads.googleads import MutateExtensionFeedItemResult
expected_names.append(MutateExtensionFeedItemResult.__name__)
from google.ads.googleads import GetFeedItemRequest
expected_names.append(GetFeedItemRequest.__name__)
from google.ads.googleads import MutateFeedItemsRequest
expected_names.append(MutateFeedItemsRequest.__name__)
from google.ads.googleads import FeedItemOperation
expected_names.append(FeedItemOperation.__name__)
from google.ads.googleads import MutateFeedItemsResponse
expected_names.append(MutateFeedItemsResponse.__name__)
from google.ads.googleads import MutateFeedItemResult
expected_names.append(MutateFeedItemResult.__name__)
from google.ads.googleads import GetFeedItemSetLinkRequest
expected_names.append(GetFeedItemSetLinkRequest.__name__)
from google.ads.googleads import MutateFeedItemSetLinksRequest
expected_names.append(MutateFeedItemSetLinksRequest.__name__)
from google.ads.googleads import FeedItemSetLinkOperation
expected_names.append(FeedItemSetLinkOperation.__name__)
from google.ads.googleads import MutateFeedItemSetLinksResponse
expected_names.append(MutateFeedItemSetLinksResponse.__name__)
from google.ads.googleads import MutateFeedItemSetLinkResult
expected_names.append(MutateFeedItemSetLinkResult.__name__)
from google.ads.googleads import GetFeedItemSetRequest
expected_names.append(GetFeedItemSetRequest.__name__)
from google.ads.googleads import MutateFeedItemSetsRequest
expected_names.append(MutateFeedItemSetsRequest.__name__)
from google.ads.googleads import FeedItemSetOperation
expected_names.append(FeedItemSetOperation.__name__)
from google.ads.googleads import MutateFeedItemSetsResponse
expected_names.append(MutateFeedItemSetsResponse.__name__)
from google.ads.googleads import MutateFeedItemSetResult
expected_names.append(MutateFeedItemSetResult.__name__)
from google.ads.googleads import GetFeedItemTargetRequest
expected_names.append(GetFeedItemTargetRequest.__name__)
from google.ads.googleads import MutateFeedItemTargetsRequest
expected_names.append(MutateFeedItemTargetsRequest.__name__)
from google.ads.googleads import FeedItemTargetOperation
expected_names.append(FeedItemTargetOperation.__name__)
from google.ads.googleads import MutateFeedItemTargetsResponse
expected_names.append(MutateFeedItemTargetsResponse.__name__)
from google.ads.googleads import MutateFeedItemTargetResult
expected_names.append(MutateFeedItemTargetResult.__name__)
from google.ads.googleads import GetFeedMappingRequest
expected_names.append(GetFeedMappingRequest.__name__)
from google.ads.googleads import MutateFeedMappingsRequest
expected_names.append(MutateFeedMappingsRequest.__name__)
from google.ads.googleads import FeedMappingOperation
expected_names.append(FeedMappingOperation.__name__)
from google.ads.googleads import MutateFeedMappingsResponse
expected_names.append(MutateFeedMappingsResponse.__name__)
from google.ads.googleads import MutateFeedMappingResult
expected_names.append(MutateFeedMappingResult.__name__)
from google.ads.googleads import GetFeedRequest
expected_names.append(GetFeedRequest.__name__)
from google.ads.googleads import MutateFeedsRequest
expected_names.append(MutateFeedsRequest.__name__)
from google.ads.googleads import FeedOperation
expected_names.append(FeedOperation.__name__)
from google.ads.googleads import MutateFeedsResponse
expected_names.append(MutateFeedsResponse.__name__)
from google.ads.googleads import MutateFeedResult
expected_names.append(MutateFeedResult.__name__)
from google.ads.googleads import GetKeywordPlanAdGroupKeywordRequest
expected_names.append(GetKeywordPlanAdGroupKeywordRequest.__name__)
from google.ads.googleads import MutateKeywordPlanAdGroupKeywordsRequest
expected_names.append(MutateKeywordPlanAdGroupKeywordsRequest.__name__)
from google.ads.googleads import KeywordPlanAdGroupKeywordOperation
expected_names.append(KeywordPlanAdGroupKeywordOperation.__name__)
from google.ads.googleads import MutateKeywordPlanAdGroupKeywordsResponse
expected_names.append(MutateKeywordPlanAdGroupKeywordsResponse.__name__)
from google.ads.googleads import MutateKeywordPlanAdGroupKeywordResult
expected_names.append(MutateKeywordPlanAdGroupKeywordResult.__name__)
from google.ads.googleads import GetKeywordPlanAdGroupRequest
expected_names.append(GetKeywordPlanAdGroupRequest.__name__)
from google.ads.googleads import MutateKeywordPlanAdGroupsRequest
expected_names.append(MutateKeywordPlanAdGroupsRequest.__name__)
from google.ads.googleads import KeywordPlanAdGroupOperation
expected_names.append(KeywordPlanAdGroupOperation.__name__)
from google.ads.googleads import MutateKeywordPlanAdGroupsResponse
expected_names.append(MutateKeywordPlanAdGroupsResponse.__name__)
from google.ads.googleads import MutateKeywordPlanAdGroupResult
expected_names.append(MutateKeywordPlanAdGroupResult.__name__)
from google.ads.googleads import GetKeywordPlanCampaignKeywordRequest
expected_names.append(GetKeywordPlanCampaignKeywordRequest.__name__)
from google.ads.googleads import MutateKeywordPlanCampaignKeywordsRequest
expected_names.append(MutateKeywordPlanCampaignKeywordsRequest.__name__)
from google.ads.googleads import KeywordPlanCampaignKeywordOperation
expected_names.append(KeywordPlanCampaignKeywordOperation.__name__)
from google.ads.googleads import MutateKeywordPlanCampaignKeywordsResponse
expected_names.append(MutateKeywordPlanCampaignKeywordsResponse.__name__)
from google.ads.googleads import MutateKeywordPlanCampaignKeywordResult
expected_names.append(MutateKeywordPlanCampaignKeywordResult.__name__)
from google.ads.googleads import GetKeywordPlanCampaignRequest
expected_names.append(GetKeywordPlanCampaignRequest.__name__)
from google.ads.googleads import MutateKeywordPlanCampaignsRequest
expected_names.append(MutateKeywordPlanCampaignsRequest.__name__)
from google.ads.googleads import KeywordPlanCampaignOperation
expected_names.append(KeywordPlanCampaignOperation.__name__)
from google.ads.googleads import MutateKeywordPlanCampaignsResponse
expected_names.append(MutateKeywordPlanCampaignsResponse.__name__)
from google.ads.googleads import MutateKeywordPlanCampaignResult
expected_names.append(MutateKeywordPlanCampaignResult.__name__)
from google.ads.googleads import GetKeywordPlanRequest
expected_names.append(GetKeywordPlanRequest.__name__)
from google.ads.googleads import MutateKeywordPlansRequest
expected_names.append(MutateKeywordPlansRequest.__name__)
from google.ads.googleads import KeywordPlanOperation
expected_names.append(KeywordPlanOperation.__name__)
from google.ads.googleads import MutateKeywordPlansResponse
expected_names.append(MutateKeywordPlansResponse.__name__)
from google.ads.googleads import MutateKeywordPlansResult
expected_names.append(MutateKeywordPlansResult.__name__)
from google.ads.googleads import GenerateForecastCurveRequest
expected_names.append(GenerateForecastCurveRequest.__name__)
from google.ads.googleads import GenerateForecastCurveResponse
expected_names.append(GenerateForecastCurveResponse.__name__)
from google.ads.googleads import GenerateForecastTimeSeriesRequest
expected_names.append(GenerateForecastTimeSeriesRequest.__name__)
from google.ads.googleads import GenerateForecastTimeSeriesResponse
expected_names.append(GenerateForecastTimeSeriesResponse.__name__)
from google.ads.googleads import GenerateForecastMetricsRequest
expected_names.append(GenerateForecastMetricsRequest.__name__)
from google.ads.googleads import GenerateForecastMetricsResponse
expected_names.append(GenerateForecastMetricsResponse.__name__)
from google.ads.googleads import KeywordPlanCampaignForecast
expected_names.append(KeywordPlanCampaignForecast.__name__)
from google.ads.googleads import KeywordPlanAdGroupForecast
expected_names.append(KeywordPlanAdGroupForecast.__name__)
from google.ads.googleads import KeywordPlanKeywordForecast
expected_names.append(KeywordPlanKeywordForecast.__name__)
from google.ads.googleads import KeywordPlanCampaignForecastCurve
expected_names.append(KeywordPlanCampaignForecastCurve.__name__)
from google.ads.googleads import KeywordPlanMaxCpcBidForecastCurve
expected_names.append(KeywordPlanMaxCpcBidForecastCurve.__name__)
from google.ads.googleads import KeywordPlanMaxCpcBidForecast
expected_names.append(KeywordPlanMaxCpcBidForecast.__name__)
from google.ads.googleads import KeywordPlanWeeklyTimeSeriesForecast
expected_names.append(KeywordPlanWeeklyTimeSeriesForecast.__name__)
from google.ads.googleads import KeywordPlanWeeklyForecast
expected_names.append(KeywordPlanWeeklyForecast.__name__)
from google.ads.googleads import ForecastMetrics
expected_names.append(ForecastMetrics.__name__)
from google.ads.googleads import GenerateHistoricalMetricsRequest
expected_names.append(GenerateHistoricalMetricsRequest.__name__)
from google.ads.googleads import GenerateHistoricalMetricsResponse
expected_names.append(GenerateHistoricalMetricsResponse.__name__)
from google.ads.googleads import KeywordPlanKeywordHistoricalMetrics
expected_names.append(KeywordPlanKeywordHistoricalMetrics.__name__)
from google.ads.googleads import GetLabelRequest
expected_names.append(GetLabelRequest.__name__)
from google.ads.googleads import MutateLabelsRequest
expected_names.append(MutateLabelsRequest.__name__)
from google.ads.googleads import LabelOperation
expected_names.append(LabelOperation.__name__)
from google.ads.googleads import MutateLabelsResponse
expected_names.append(MutateLabelsResponse.__name__)
from google.ads.googleads import MutateLabelResult
expected_names.append(MutateLabelResult.__name__)
from google.ads.googleads import GetMediaFileRequest
expected_names.append(GetMediaFileRequest.__name__)
from google.ads.googleads import MutateMediaFilesRequest
expected_names.append(MutateMediaFilesRequest.__name__)
from google.ads.googleads import MediaFileOperation
expected_names.append(MediaFileOperation.__name__)
from google.ads.googleads import MutateMediaFilesResponse
expected_names.append(MutateMediaFilesResponse.__name__)
from google.ads.googleads import MutateMediaFileResult
expected_names.append(MutateMediaFileResult.__name__)
from google.ads.googleads import GetRemarketingActionRequest
expected_names.append(GetRemarketingActionRequest.__name__)
from google.ads.googleads import MutateRemarketingActionsRequest
expected_names.append(MutateRemarketingActionsRequest.__name__)
from google.ads.googleads import RemarketingActionOperation
expected_names.append(RemarketingActionOperation.__name__)
from google.ads.googleads import MutateRemarketingActionsResponse
expected_names.append(MutateRemarketingActionsResponse.__name__)
from google.ads.googleads import MutateRemarketingActionResult
expected_names.append(MutateRemarketingActionResult.__name__)
from google.ads.googleads import GetSharedCriterionRequest
expected_names.append(GetSharedCriterionRequest.__name__)
from google.ads.googleads import MutateSharedCriteriaRequest
expected_names.append(MutateSharedCriteriaRequest.__name__)
from google.ads.googleads import SharedCriterionOperation
expected_names.append(SharedCriterionOperation.__name__)
from google.ads.googleads import MutateSharedCriteriaResponse
expected_names.append(MutateSharedCriteriaResponse.__name__)
from google.ads.googleads import MutateSharedCriterionResult
expected_names.append(MutateSharedCriterionResult.__name__)
from google.ads.googleads import GetSharedSetRequest
expected_names.append(GetSharedSetRequest.__name__)
from google.ads.googleads import MutateSharedSetsRequest
expected_names.append(MutateSharedSetsRequest.__name__)
from google.ads.googleads import SharedSetOperation
expected_names.append(SharedSetOperation.__name__)
from google.ads.googleads import MutateSharedSetsResponse
expected_names.append(MutateSharedSetsResponse.__name__)
from google.ads.googleads import MutateSharedSetResult
expected_names.append(MutateSharedSetResult.__name__)
from google.ads.googleads import GetSmartCampaignSettingRequest
expected_names.append(GetSmartCampaignSettingRequest.__name__)
from google.ads.googleads import MutateSmartCampaignSettingsRequest
expected_names.append(MutateSmartCampaignSettingsRequest.__name__)
from google.ads.googleads import SmartCampaignSettingOperation
expected_names.append(SmartCampaignSettingOperation.__name__)
from google.ads.googleads import MutateSmartCampaignSettingsResponse
expected_names.append(MutateSmartCampaignSettingsResponse.__name__)
from google.ads.googleads import MutateSmartCampaignSettingResult
expected_names.append(MutateSmartCampaignSettingResult.__name__)
from google.ads.googleads import GetUserListRequest
expected_names.append(GetUserListRequest.__name__)
from google.ads.googleads import MutateUserListsRequest
expected_names.append(MutateUserListsRequest.__name__)
from google.ads.googleads import UserListOperation
expected_names.append(UserListOperation.__name__)
from google.ads.googleads import MutateUserListsResponse
expected_names.append(MutateUserListsResponse.__name__)
from google.ads.googleads import MutateUserListResult
expected_names.append(MutateUserListResult.__name__)
from google.ads.googleads import SearchGoogleAdsRequest
expected_names.append(SearchGoogleAdsRequest.__name__)
from google.ads.googleads import SearchGoogleAdsResponse
expected_names.append(SearchGoogleAdsResponse.__name__)
from google.ads.googleads import SearchGoogleAdsStreamRequest
expected_names.append(SearchGoogleAdsStreamRequest.__name__)
from google.ads.googleads import SearchGoogleAdsStreamResponse
expected_names.append(SearchGoogleAdsStreamResponse.__name__)
from google.ads.googleads import GoogleAdsRow
expected_names.append(GoogleAdsRow.__name__)
from google.ads.googleads import MutateGoogleAdsRequest
expected_names.append(MutateGoogleAdsRequest.__name__)
from google.ads.googleads import MutateGoogleAdsResponse
expected_names.append(MutateGoogleAdsResponse.__name__)
from google.ads.googleads import MutateOperation
expected_names.append(MutateOperation.__name__)
from google.ads.googleads import MutateOperationResponse
expected_names.append(MutateOperationResponse.__name__)
from google.ads.googleads import MutateBatchJobRequest
expected_names.append(MutateBatchJobRequest.__name__)
from google.ads.googleads import BatchJobOperation
expected_names.append(BatchJobOperation.__name__)
from google.ads.googleads import MutateBatchJobResponse
expected_names.append(MutateBatchJobResponse.__name__)
from google.ads.googleads import MutateBatchJobResult
expected_names.append(MutateBatchJobResult.__name__)
from google.ads.googleads import GetBatchJobRequest
expected_names.append(GetBatchJobRequest.__name__)
from google.ads.googleads import RunBatchJobRequest
expected_names.append(RunBatchJobRequest.__name__)
from google.ads.googleads import AddBatchJobOperationsRequest
expected_names.append(AddBatchJobOperationsRequest.__name__)
from google.ads.googleads import AddBatchJobOperationsResponse
expected_names.append(AddBatchJobOperationsResponse.__name__)
from google.ads.googleads import ListBatchJobResultsRequest
expected_names.append(ListBatchJobResultsRequest.__name__)
from google.ads.googleads import ListBatchJobResultsResponse
expected_names.append(ListBatchJobResultsResponse.__name__)
from google.ads.googleads import BatchJobResult
expected_names.append(BatchJobResult.__name__)
from google.ads.googleads import GetBiddingStrategySimulationRequest
expected_names.append(GetBiddingStrategySimulationRequest.__name__)
from google.ads.googleads import GetBillingSetupRequest
expected_names.append(GetBillingSetupRequest.__name__)
from google.ads.googleads import MutateBillingSetupRequest
expected_names.append(MutateBillingSetupRequest.__name__)
from google.ads.googleads import BillingSetupOperation
expected_names.append(BillingSetupOperation.__name__)
from google.ads.googleads import MutateBillingSetupResponse
expected_names.append(MutateBillingSetupResponse.__name__)
from google.ads.googleads import MutateBillingSetupResult
expected_names.append(MutateBillingSetupResult.__name__)
from google.ads.googleads import GetCampaignAudienceViewRequest
expected_names.append(GetCampaignAudienceViewRequest.__name__)
from google.ads.googleads import GetCampaignCriterionSimulationRequest
expected_names.append(GetCampaignCriterionSimulationRequest.__name__)
from google.ads.googleads import GetCampaignSimulationRequest
expected_names.append(GetCampaignSimulationRequest.__name__)
from google.ads.googleads import GetCarrierConstantRequest
expected_names.append(GetCarrierConstantRequest.__name__)
from google.ads.googleads import GetChangeStatusRequest
expected_names.append(GetChangeStatusRequest.__name__)
from google.ads.googleads import GetClickViewRequest
expected_names.append(GetClickViewRequest.__name__)
from google.ads.googleads import GetCombinedAudienceRequest
expected_names.append(GetCombinedAudienceRequest.__name__)
from google.ads.googleads import UploadConversionAdjustmentsRequest
expected_names.append(UploadConversionAdjustmentsRequest.__name__)
from google.ads.googleads import UploadConversionAdjustmentsResponse
expected_names.append(UploadConversionAdjustmentsResponse.__name__)
from google.ads.googleads import ConversionAdjustment
expected_names.append(ConversionAdjustment.__name__)
from google.ads.googleads import RestatementValue
expected_names.append(RestatementValue.__name__)
from google.ads.googleads import GclidDateTimePair
expected_names.append(GclidDateTimePair.__name__)
from google.ads.googleads import ConversionAdjustmentResult
expected_names.append(ConversionAdjustmentResult.__name__)
from google.ads.googleads import UploadClickConversionsRequest
expected_names.append(UploadClickConversionsRequest.__name__)
from google.ads.googleads import UploadClickConversionsResponse
expected_names.append(UploadClickConversionsResponse.__name__)
from google.ads.googleads import UploadCallConversionsRequest
expected_names.append(UploadCallConversionsRequest.__name__)
from google.ads.googleads import UploadCallConversionsResponse
expected_names.append(UploadCallConversionsResponse.__name__)
from google.ads.googleads import ClickConversion
expected_names.append(ClickConversion.__name__)
from google.ads.googleads import CallConversion
expected_names.append(CallConversion.__name__)
from google.ads.googleads import ExternalAttributionData
expected_names.append(ExternalAttributionData.__name__)
from google.ads.googleads import ClickConversionResult
expected_names.append(ClickConversionResult.__name__)
from google.ads.googleads import CallConversionResult
expected_names.append(CallConversionResult.__name__)
from google.ads.googleads import CustomVariable
expected_names.append(CustomVariable.__name__)
from google.ads.googleads import CartData
expected_names.append(CartData.__name__)
from google.ads.googleads import GetCurrencyConstantRequest
expected_names.append(GetCurrencyConstantRequest.__name__)
from google.ads.googleads import GetCustomAudienceRequest
expected_names.append(GetCustomAudienceRequest.__name__)
from google.ads.googleads import MutateCustomAudiencesRequest
expected_names.append(MutateCustomAudiencesRequest.__name__)
from google.ads.googleads import CustomAudienceOperation
expected_names.append(CustomAudienceOperation.__name__)
from google.ads.googleads import MutateCustomAudiencesResponse
expected_names.append(MutateCustomAudiencesResponse.__name__)
from google.ads.googleads import MutateCustomAudienceResult
expected_names.append(MutateCustomAudienceResult.__name__)
from google.ads.googleads import GetCustomInterestRequest
expected_names.append(GetCustomInterestRequest.__name__)
from google.ads.googleads import MutateCustomInterestsRequest
expected_names.append(MutateCustomInterestsRequest.__name__)
from google.ads.googleads import CustomInterestOperation
expected_names.append(CustomInterestOperation.__name__)
from google.ads.googleads import MutateCustomInterestsResponse
expected_names.append(MutateCustomInterestsResponse.__name__)
from google.ads.googleads import MutateCustomInterestResult
expected_names.append(MutateCustomInterestResult.__name__)
from google.ads.googleads import GetCustomerClientLinkRequest
expected_names.append(GetCustomerClientLinkRequest.__name__)
from google.ads.googleads import MutateCustomerClientLinkRequest
expected_names.append(MutateCustomerClientLinkRequest.__name__)
from google.ads.googleads import CustomerClientLinkOperation
expected_names.append(CustomerClientLinkOperation.__name__)
from google.ads.googleads import MutateCustomerClientLinkResponse
expected_names.append(MutateCustomerClientLinkResponse.__name__)
from google.ads.googleads import MutateCustomerClientLinkResult
expected_names.append(MutateCustomerClientLinkResult.__name__)
from google.ads.googleads import GetCustomerClientRequest
expected_names.append(GetCustomerClientRequest.__name__)
from google.ads.googleads import GetCustomerManagerLinkRequest
expected_names.append(GetCustomerManagerLinkRequest.__name__)
from google.ads.googleads import MutateCustomerManagerLinkRequest
expected_names.append(MutateCustomerManagerLinkRequest.__name__)
from google.ads.googleads import MoveManagerLinkRequest
expected_names.append(MoveManagerLinkRequest.__name__)
from google.ads.googleads import CustomerManagerLinkOperation
expected_names.append(CustomerManagerLinkOperation.__name__)
from google.ads.googleads import MutateCustomerManagerLinkResponse
expected_names.append(MutateCustomerManagerLinkResponse.__name__)
from google.ads.googleads import MoveManagerLinkResponse
expected_names.append(MoveManagerLinkResponse.__name__)
from google.ads.googleads import MutateCustomerManagerLinkResult
expected_names.append(MutateCustomerManagerLinkResult.__name__)
from google.ads.googleads import GetCustomerUserAccessInvitationRequest
expected_names.append(GetCustomerUserAccessInvitationRequest.__name__)
from google.ads.googleads import MutateCustomerUserAccessInvitationRequest
expected_names.append(MutateCustomerUserAccessInvitationRequest.__name__)
from google.ads.googleads import CustomerUserAccessInvitationOperation
expected_names.append(CustomerUserAccessInvitationOperation.__name__)
from google.ads.googleads import MutateCustomerUserAccessInvitationResponse
expected_names.append(MutateCustomerUserAccessInvitationResponse.__name__)
from google.ads.googleads import MutateCustomerUserAccessInvitationResult
expected_names.append(MutateCustomerUserAccessInvitationResult.__name__)
from google.ads.googleads import GetCustomerUserAccessRequest
expected_names.append(GetCustomerUserAccessRequest.__name__)
from google.ads.googleads import MutateCustomerUserAccessRequest
expected_names.append(MutateCustomerUserAccessRequest.__name__)
from google.ads.googleads import CustomerUserAccessOperation
expected_names.append(CustomerUserAccessOperation.__name__)
from google.ads.googleads import MutateCustomerUserAccessResponse
expected_names.append(MutateCustomerUserAccessResponse.__name__)
from google.ads.googleads import MutateCustomerUserAccessResult
expected_names.append(MutateCustomerUserAccessResult.__name__)
from google.ads.googleads import GetDetailPlacementViewRequest
expected_names.append(GetDetailPlacementViewRequest.__name__)
from google.ads.googleads import GetDetailedDemographicRequest
expected_names.append(GetDetailedDemographicRequest.__name__)
from google.ads.googleads import GetDisplayKeywordViewRequest
expected_names.append(GetDisplayKeywordViewRequest.__name__)
from google.ads.googleads import GetDistanceViewRequest
expected_names.append(GetDistanceViewRequest.__name__)
from google.ads.googleads import GetDomainCategoryRequest
expected_names.append(GetDomainCategoryRequest.__name__)
from google.ads.googleads import GetDynamicSearchAdsSearchTermViewRequest
expected_names.append(GetDynamicSearchAdsSearchTermViewRequest.__name__)
from google.ads.googleads import GetExpandedLandingPageViewRequest
expected_names.append(GetExpandedLandingPageViewRequest.__name__)
from google.ads.googleads import GetFeedPlaceholderViewRequest
expected_names.append(GetFeedPlaceholderViewRequest.__name__)
from google.ads.googleads import GetGenderViewRequest
expected_names.append(GetGenderViewRequest.__name__)
from google.ads.googleads import GetGeoTargetConstantRequest
expected_names.append(GetGeoTargetConstantRequest.__name__)
from google.ads.googleads import SuggestGeoTargetConstantsRequest
expected_names.append(SuggestGeoTargetConstantsRequest.__name__)
from google.ads.googleads import SuggestGeoTargetConstantsResponse
expected_names.append(SuggestGeoTargetConstantsResponse.__name__)
from google.ads.googleads import GeoTargetConstantSuggestion
expected_names.append(GeoTargetConstantSuggestion.__name__)
from google.ads.googleads import GetGeographicViewRequest
expected_names.append(GetGeographicViewRequest.__name__)
from google.ads.googleads import GetGoogleAdsFieldRequest
expected_names.append(GetGoogleAdsFieldRequest.__name__)
from google.ads.googleads import SearchGoogleAdsFieldsRequest
expected_names.append(SearchGoogleAdsFieldsRequest.__name__)
from google.ads.googleads import SearchGoogleAdsFieldsResponse
expected_names.append(SearchGoogleAdsFieldsResponse.__name__)
from google.ads.googleads import GetGroupPlacementViewRequest
expected_names.append(GetGroupPlacementViewRequest.__name__)
from google.ads.googleads import GetHotelGroupViewRequest
expected_names.append(GetHotelGroupViewRequest.__name__)
from google.ads.googleads import GetHotelPerformanceViewRequest
expected_names.append(GetHotelPerformanceViewRequest.__name__)
from google.ads.googleads import GetIncomeRangeViewRequest
expected_names.append(GetIncomeRangeViewRequest.__name__)
from google.ads.googleads import ListInvoicesRequest
expected_names.append(ListInvoicesRequest.__name__)
from google.ads.googleads import ListInvoicesResponse
expected_names.append(ListInvoicesResponse.__name__)
from google.ads.googleads import GenerateKeywordIdeasRequest
expected_names.append(GenerateKeywordIdeasRequest.__name__)
from google.ads.googleads import KeywordAndUrlSeed
expected_names.append(KeywordAndUrlSeed.__name__)
from google.ads.googleads import KeywordSeed
expected_names.append(KeywordSeed.__name__)
from google.ads.googleads import SiteSeed
expected_names.append(SiteSeed.__name__)
from google.ads.googleads import UrlSeed
expected_names.append(UrlSeed.__name__)
from google.ads.googleads import GenerateKeywordIdeaResponse
expected_names.append(GenerateKeywordIdeaResponse.__name__)
from google.ads.googleads import GenerateKeywordIdeaResult
expected_names.append(GenerateKeywordIdeaResult.__name__)
from google.ads.googleads import GetKeywordThemeConstantRequest
expected_names.append(GetKeywordThemeConstantRequest.__name__)
from google.ads.googleads import SuggestKeywordThemeConstantsRequest
expected_names.append(SuggestKeywordThemeConstantsRequest.__name__)
from google.ads.googleads import SuggestKeywordThemeConstantsResponse
expected_names.append(SuggestKeywordThemeConstantsResponse.__name__)
from google.ads.googleads import GetKeywordViewRequest
expected_names.append(GetKeywordViewRequest.__name__)
from google.ads.googleads import GetLandingPageViewRequest
expected_names.append(GetLandingPageViewRequest.__name__)
from google.ads.googleads import GetLanguageConstantRequest
expected_names.append(GetLanguageConstantRequest.__name__)
from google.ads.googleads import GetLifeEventRequest
expected_names.append(GetLifeEventRequest.__name__)
from google.ads.googleads import GetLocationViewRequest
expected_names.append(GetLocationViewRequest.__name__)
from google.ads.googleads import GetManagedPlacementViewRequest
expected_names.append(GetManagedPlacementViewRequest.__name__)
from google.ads.googleads import ListMerchantCenterLinksRequest
expected_names.append(ListMerchantCenterLinksRequest.__name__)
from google.ads.googleads import ListMerchantCenterLinksResponse
expected_names.append(ListMerchantCenterLinksResponse.__name__)
from google.ads.googleads import GetMerchantCenterLinkRequest
expected_names.append(GetMerchantCenterLinkRequest.__name__)
from google.ads.googleads import MutateMerchantCenterLinkRequest
expected_names.append(MutateMerchantCenterLinkRequest.__name__)
from google.ads.googleads import MerchantCenterLinkOperation
expected_names.append(MerchantCenterLinkOperation.__name__)
from google.ads.googleads import MutateMerchantCenterLinkResponse
expected_names.append(MutateMerchantCenterLinkResponse.__name__)
from google.ads.googleads import MutateMerchantCenterLinkResult
expected_names.append(MutateMerchantCenterLinkResult.__name__)
from google.ads.googleads import GetMobileAppCategoryConstantRequest
expected_names.append(GetMobileAppCategoryConstantRequest.__name__)
from google.ads.googleads import GetMobileDeviceConstantRequest
expected_names.append(GetMobileDeviceConstantRequest.__name__)
from google.ads.googleads import CreateOfflineUserDataJobRequest
expected_names.append(CreateOfflineUserDataJobRequest.__name__)
from google.ads.googleads import CreateOfflineUserDataJobResponse
expected_names.append(CreateOfflineUserDataJobResponse.__name__)
from google.ads.googleads import GetOfflineUserDataJobRequest
expected_names.append(GetOfflineUserDataJobRequest.__name__)
from google.ads.googleads import RunOfflineUserDataJobRequest
expected_names.append(RunOfflineUserDataJobRequest.__name__)
from google.ads.googleads import AddOfflineUserDataJobOperationsRequest
expected_names.append(AddOfflineUserDataJobOperationsRequest.__name__)
from google.ads.googleads import OfflineUserDataJobOperation
expected_names.append(OfflineUserDataJobOperation.__name__)
from google.ads.googleads import AddOfflineUserDataJobOperationsResponse
expected_names.append(AddOfflineUserDataJobOperationsResponse.__name__)
from google.ads.googleads import GetOperatingSystemVersionConstantRequest
expected_names.append(GetOperatingSystemVersionConstantRequest.__name__)
from google.ads.googleads import GetPaidOrganicSearchTermViewRequest
expected_names.append(GetPaidOrganicSearchTermViewRequest.__name__)
from google.ads.googleads import GetParentalStatusViewRequest
expected_names.append(GetParentalStatusViewRequest.__name__)
from google.ads.googleads import ListPaymentsAccountsRequest
expected_names.append(ListPaymentsAccountsRequest.__name__)
from google.ads.googleads import ListPaymentsAccountsResponse
expected_names.append(ListPaymentsAccountsResponse.__name__)
from google.ads.googleads import GetProductBiddingCategoryConstantRequest
expected_names.append(GetProductBiddingCategoryConstantRequest.__name__)
from google.ads.googleads import GetProductGroupViewRequest
expected_names.append(GetProductGroupViewRequest.__name__)
from google.ads.googleads import ListPlannableLocationsRequest
expected_names.append(ListPlannableLocationsRequest.__name__)
from google.ads.googleads import ListPlannableLocationsResponse
expected_names.append(ListPlannableLocationsResponse.__name__)
from google.ads.googleads import PlannableLocation
expected_names.append(PlannableLocation.__name__)
from google.ads.googleads import ListPlannableProductsRequest
expected_names.append(ListPlannableProductsRequest.__name__)
from google.ads.googleads import ListPlannableProductsResponse
expected_names.append(ListPlannableProductsResponse.__name__)
from google.ads.googleads import ProductMetadata
expected_names.append(ProductMetadata.__name__)
from google.ads.googleads import PlannableTargeting
expected_names.append(PlannableTargeting.__name__)
from google.ads.googleads import GenerateProductMixIdeasRequest
expected_names.append(GenerateProductMixIdeasRequest.__name__)
from google.ads.googleads import Preferences
expected_names.append(Preferences.__name__)
from google.ads.googleads import GenerateProductMixIdeasResponse
expected_names.append(GenerateProductMixIdeasResponse.__name__)
from google.ads.googleads import ProductAllocation
expected_names.append(ProductAllocation.__name__)
from google.ads.googleads import GenerateReachForecastRequest
expected_names.append(GenerateReachForecastRequest.__name__)
from google.ads.googleads import FrequencyCap
expected_names.append(FrequencyCap.__name__)
from google.ads.googleads import Targeting
expected_names.append(Targeting.__name__)
from google.ads.googleads import CampaignDuration
expected_names.append(CampaignDuration.__name__)
from google.ads.googleads import PlannedProduct
expected_names.append(PlannedProduct.__name__)
from google.ads.googleads import GenerateReachForecastResponse
expected_names.append(GenerateReachForecastResponse.__name__)
from google.ads.googleads import ReachCurve
expected_names.append(ReachCurve.__name__)
from google.ads.googleads import ReachForecast
expected_names.append(ReachForecast.__name__)
from google.ads.googleads import Forecast
expected_names.append(Forecast.__name__)
from google.ads.googleads import PlannedProductReachForecast
expected_names.append(PlannedProductReachForecast.__name__)
from google.ads.googleads import PlannedProductForecast
expected_names.append(PlannedProductForecast.__name__)
from google.ads.googleads import OnTargetAudienceMetrics
expected_names.append(OnTargetAudienceMetrics.__name__)
from google.ads.googleads import GetRecommendationRequest
expected_names.append(GetRecommendationRequest.__name__)
from google.ads.googleads import ApplyRecommendationRequest
expected_names.append(ApplyRecommendationRequest.__name__)
from google.ads.googleads import ApplyRecommendationOperation
expected_names.append(ApplyRecommendationOperation.__name__)
from google.ads.googleads import ApplyRecommendationResponse
expected_names.append(ApplyRecommendationResponse.__name__)
from google.ads.googleads import ApplyRecommendationResult
expected_names.append(ApplyRecommendationResult.__name__)
from google.ads.googleads import DismissRecommendationRequest
expected_names.append(DismissRecommendationRequest.__name__)
from google.ads.googleads import DismissRecommendationResponse
expected_names.append(DismissRecommendationResponse.__name__)
from google.ads.googleads import GetSearchTermViewRequest
expected_names.append(GetSearchTermViewRequest.__name__)
from google.ads.googleads import GetShoppingPerformanceViewRequest
expected_names.append(GetShoppingPerformanceViewRequest.__name__)
from google.ads.googleads import GetSmartCampaignSearchTermViewRequest
expected_names.append(GetSmartCampaignSearchTermViewRequest.__name__)
from google.ads.googleads import SuggestSmartCampaignBudgetOptionsRequest
expected_names.append(SuggestSmartCampaignBudgetOptionsRequest.__name__)
from google.ads.googleads import SmartCampaignSuggestionInfo
expected_names.append(SmartCampaignSuggestionInfo.__name__)
from google.ads.googleads import SuggestSmartCampaignBudgetOptionsResponse
expected_names.append(SuggestSmartCampaignBudgetOptionsResponse.__name__)
from google.ads.googleads import GetThirdPartyAppAnalyticsLinkRequest
expected_names.append(GetThirdPartyAppAnalyticsLinkRequest.__name__)
from google.ads.googleads import RegenerateShareableLinkIdRequest
expected_names.append(RegenerateShareableLinkIdRequest.__name__)
from google.ads.googleads import RegenerateShareableLinkIdResponse
expected_names.append(RegenerateShareableLinkIdResponse.__name__)
from google.ads.googleads import GetTopicConstantRequest
expected_names.append(GetTopicConstantRequest.__name__)
from google.ads.googleads import GetTopicViewRequest
expected_names.append(GetTopicViewRequest.__name__)
from google.ads.googleads import UploadUserDataRequest
expected_names.append(UploadUserDataRequest.__name__)
from google.ads.googleads import UserDataOperation
expected_names.append(UserDataOperation.__name__)
from google.ads.googleads import UploadUserDataResponse
expected_names.append(UploadUserDataResponse.__name__)
from google.ads.googleads import GetUserInterestRequest
expected_names.append(GetUserInterestRequest.__name__)
from google.ads.googleads import GetUserLocationViewRequest
expected_names.append(GetUserLocationViewRequest.__name__)
from google.ads.googleads import GetVideoRequest
expected_names.append(GetVideoRequest.__name__)
from google.ads.googleads import GetWebpageViewRequest
expected_names.append(GetWebpageViewRequest.__name__)
# Client and transport classes
from google.ads.googleads import WebpageViewServiceClient
expected_names.append(WebpageViewServiceClient.__name__)
from google.ads.googleads import WebpageViewServiceTransport
expected_names.append(WebpageViewServiceTransport.__name__)
from google.ads.googleads import WebpageViewServiceGrpcTransport
expected_names.append(WebpageViewServiceGrpcTransport.__name__)
from google.ads.googleads import VideoServiceClient
expected_names.append(VideoServiceClient.__name__)
from google.ads.googleads import VideoServiceTransport
expected_names.append(VideoServiceTransport.__name__)
from google.ads.googleads import VideoServiceGrpcTransport
expected_names.append(VideoServiceGrpcTransport.__name__)
from google.ads.googleads import UserLocationViewServiceClient
expected_names.append(UserLocationViewServiceClient.__name__)
from google.ads.googleads import UserLocationViewServiceTransport
expected_names.append(UserLocationViewServiceTransport.__name__)
from google.ads.googleads import UserLocationViewServiceGrpcTransport
expected_names.append(UserLocationViewServiceGrpcTransport.__name__)
from google.ads.googleads import UserInterestServiceClient
expected_names.append(UserInterestServiceClient.__name__)
from google.ads.googleads import UserInterestServiceTransport
expected_names.append(UserInterestServiceTransport.__name__)
from google.ads.googleads import UserInterestServiceGrpcTransport
expected_names.append(UserInterestServiceGrpcTransport.__name__)
from google.ads.googleads import UserDataServiceClient
expected_names.append(UserDataServiceClient.__name__)
from google.ads.googleads import UserDataServiceTransport
expected_names.append(UserDataServiceTransport.__name__)
from google.ads.googleads import UserDataServiceGrpcTransport
expected_names.append(UserDataServiceGrpcTransport.__name__)
from google.ads.googleads import TopicViewServiceClient
expected_names.append(TopicViewServiceClient.__name__)
from google.ads.googleads import TopicViewServiceTransport
expected_names.append(TopicViewServiceTransport.__name__)
from google.ads.googleads import TopicViewServiceGrpcTransport
expected_names.append(TopicViewServiceGrpcTransport.__name__)
from google.ads.googleads import TopicConstantServiceClient
expected_names.append(TopicConstantServiceClient.__name__)
from google.ads.googleads import TopicConstantServiceTransport
expected_names.append(TopicConstantServiceTransport.__name__)
from google.ads.googleads import TopicConstantServiceGrpcTransport
expected_names.append(TopicConstantServiceGrpcTransport.__name__)
from google.ads.googleads import ThirdPartyAppAnalyticsLinkServiceClient
expected_names.append(ThirdPartyAppAnalyticsLinkServiceClient.__name__)
from google.ads.googleads import ThirdPartyAppAnalyticsLinkServiceTransport
expected_names.append(ThirdPartyAppAnalyticsLinkServiceTransport.__name__)
from google.ads.googleads import ThirdPartyAppAnalyticsLinkServiceGrpcTransport
expected_names.append(ThirdPartyAppAnalyticsLinkServiceGrpcTransport.__name__)
from google.ads.googleads import SmartCampaignSuggestServiceClient
expected_names.append(SmartCampaignSuggestServiceClient.__name__)
from google.ads.googleads import SmartCampaignSuggestServiceTransport
expected_names.append(SmartCampaignSuggestServiceTransport.__name__)
from google.ads.googleads import SmartCampaignSuggestServiceGrpcTransport
expected_names.append(SmartCampaignSuggestServiceGrpcTransport.__name__)
from google.ads.googleads import SmartCampaignSearchTermViewServiceClient
expected_names.append(SmartCampaignSearchTermViewServiceClient.__name__)
from google.ads.googleads import SmartCampaignSearchTermViewServiceTransport
expected_names.append(SmartCampaignSearchTermViewServiceTransport.__name__)
from google.ads.googleads import SmartCampaignSearchTermViewServiceGrpcTransport
expected_names.append(SmartCampaignSearchTermViewServiceGrpcTransport.__name__)
from google.ads.googleads import ShoppingPerformanceViewServiceClient
expected_names.append(ShoppingPerformanceViewServiceClient.__name__)
from google.ads.googleads import ShoppingPerformanceViewServiceTransport
expected_names.append(ShoppingPerformanceViewServiceTransport.__name__)
from google.ads.googleads import ShoppingPerformanceViewServiceGrpcTransport
expected_names.append(ShoppingPerformanceViewServiceGrpcTransport.__name__)
from google.ads.googleads import SearchTermViewServiceClient
expected_names.append(SearchTermViewServiceClient.__name__)
from google.ads.googleads import SearchTermViewServiceTransport
expected_names.append(SearchTermViewServiceTransport.__name__)
from google.ads.googleads import SearchTermViewServiceGrpcTransport
expected_names.append(SearchTermViewServiceGrpcTransport.__name__)
from google.ads.googleads import RecommendationServiceClient
expected_names.append(RecommendationServiceClient.__name__)
from google.ads.googleads import RecommendationServiceTransport
expected_names.append(RecommendationServiceTransport.__name__)
from google.ads.googleads import RecommendationServiceGrpcTransport
expected_names.append(RecommendationServiceGrpcTransport.__name__)
from google.ads.googleads import ReachPlanServiceClient
expected_names.append(ReachPlanServiceClient.__name__)
from google.ads.googleads import ReachPlanServiceTransport
expected_names.append(ReachPlanServiceTransport.__name__)
from google.ads.googleads import ReachPlanServiceGrpcTransport
expected_names.append(ReachPlanServiceGrpcTransport.__name__)
from google.ads.googleads import ProductGroupViewServiceClient
expected_names.append(ProductGroupViewServiceClient.__name__)
from google.ads.googleads import ProductGroupViewServiceTransport
expected_names.append(ProductGroupViewServiceTransport.__name__)
from google.ads.googleads import ProductGroupViewServiceGrpcTransport
expected_names.append(ProductGroupViewServiceGrpcTransport.__name__)
from google.ads.googleads import ProductBiddingCategoryConstantServiceClient
expected_names.append(ProductBiddingCategoryConstantServiceClient.__name__)
from google.ads.googleads import ProductBiddingCategoryConstantServiceTransport
expected_names.append(ProductBiddingCategoryConstantServiceTransport.__name__)
from google.ads.googleads import ProductBiddingCategoryConstantServiceGrpcTransport
expected_names.append(ProductBiddingCategoryConstantServiceGrpcTransport.__name__)
from google.ads.googleads import PaymentsAccountServiceClient
expected_names.append(PaymentsAccountServiceClient.__name__)
from google.ads.googleads import PaymentsAccountServiceTransport
expected_names.append(PaymentsAccountServiceTransport.__name__)
from google.ads.googleads import PaymentsAccountServiceGrpcTransport
expected_names.append(PaymentsAccountServiceGrpcTransport.__name__)
from google.ads.googleads import ParentalStatusViewServiceClient
expected_names.append(ParentalStatusViewServiceClient.__name__)
from google.ads.googleads import ParentalStatusViewServiceTransport
expected_names.append(ParentalStatusViewServiceTransport.__name__)
from google.ads.googleads import ParentalStatusViewServiceGrpcTransport
expected_names.append(ParentalStatusViewServiceGrpcTransport.__name__)
from google.ads.googleads import PaidOrganicSearchTermViewServiceClient
expected_names.append(PaidOrganicSearchTermViewServiceClient.__name__)
from google.ads.googleads import PaidOrganicSearchTermViewServiceTransport
expected_names.append(PaidOrganicSearchTermViewServiceTransport.__name__)
from google.ads.googleads import PaidOrganicSearchTermViewServiceGrpcTransport
expected_names.append(PaidOrganicSearchTermViewServiceGrpcTransport.__name__)
from google.ads.googleads import OperatingSystemVersionConstantServiceClient
expected_names.append(OperatingSystemVersionConstantServiceClient.__name__)
from google.ads.googleads import OperatingSystemVersionConstantServiceTransport
expected_names.append(OperatingSystemVersionConstantServiceTransport.__name__)
from google.ads.googleads import OperatingSystemVersionConstantServiceGrpcTransport
expected_names.append(OperatingSystemVersionConstantServiceGrpcTransport.__name__)
from google.ads.googleads import OfflineUserDataJobServiceClient
expected_names.append(OfflineUserDataJobServiceClient.__name__)
from google.ads.googleads import OfflineUserDataJobServiceTransport
expected_names.append(OfflineUserDataJobServiceTransport.__name__)
from google.ads.googleads import OfflineUserDataJobServiceGrpcTransport
expected_names.append(OfflineUserDataJobServiceGrpcTransport.__name__)
from google.ads.googleads import MobileDeviceConstantServiceClient
expected_names.append(MobileDeviceConstantServiceClient.__name__)
from google.ads.googleads import MobileDeviceConstantServiceTransport
expected_names.append(MobileDeviceConstantServiceTransport.__name__)
from google.ads.googleads import MobileDeviceConstantServiceGrpcTransport
expected_names.append(MobileDeviceConstantServiceGrpcTransport.__name__)
from google.ads.googleads import MobileAppCategoryConstantServiceClient
expected_names.append(MobileAppCategoryConstantServiceClient.__name__)
from google.ads.googleads import MobileAppCategoryConstantServiceTransport
expected_names.append(MobileAppCategoryConstantServiceTransport.__name__)
from google.ads.googleads import MobileAppCategoryConstantServiceGrpcTransport
expected_names.append(MobileAppCategoryConstantServiceGrpcTransport.__name__)
from google.ads.googleads import MerchantCenterLinkServiceClient
expected_names.append(MerchantCenterLinkServiceClient.__name__)
from google.ads.googleads import MerchantCenterLinkServiceTransport
expected_names.append(MerchantCenterLinkServiceTransport.__name__)
from google.ads.googleads import MerchantCenterLinkServiceGrpcTransport
expected_names.append(MerchantCenterLinkServiceGrpcTransport.__name__)
from google.ads.googleads import ManagedPlacementViewServiceClient
expected_names.append(ManagedPlacementViewServiceClient.__name__)
from google.ads.googleads import ManagedPlacementViewServiceTransport
expected_names.append(ManagedPlacementViewServiceTransport.__name__)
from google.ads.googleads import ManagedPlacementViewServiceGrpcTransport
expected_names.append(ManagedPlacementViewServiceGrpcTransport.__name__)
from google.ads.googleads import LocationViewServiceClient
expected_names.append(LocationViewServiceClient.__name__)
from google.ads.googleads import LocationViewServiceTransport
expected_names.append(LocationViewServiceTransport.__name__)
from google.ads.googleads import LocationViewServiceGrpcTransport
expected_names.append(LocationViewServiceGrpcTransport.__name__)
from google.ads.googleads import LifeEventServiceClient
expected_names.append(LifeEventServiceClient.__name__)
from google.ads.googleads import LifeEventServiceTransport
expected_names.append(LifeEventServiceTransport.__name__)
from google.ads.googleads import LifeEventServiceGrpcTransport
expected_names.append(LifeEventServiceGrpcTransport.__name__)
from google.ads.googleads import LanguageConstantServiceClient
expected_names.append(LanguageConstantServiceClient.__name__)
from google.ads.googleads import LanguageConstantServiceTransport
expected_names.append(LanguageConstantServiceTransport.__name__)
from google.ads.googleads import LanguageConstantServiceGrpcTransport
expected_names.append(LanguageConstantServiceGrpcTransport.__name__)
from google.ads.googleads import LandingPageViewServiceClient
expected_names.append(LandingPageViewServiceClient.__name__)
from google.ads.googleads import LandingPageViewServiceTransport
expected_names.append(LandingPageViewServiceTransport.__name__)
from google.ads.googleads import LandingPageViewServiceGrpcTransport
expected_names.append(LandingPageViewServiceGrpcTransport.__name__)
from google.ads.googleads import KeywordViewServiceClient
expected_names.append(KeywordViewServiceClient.__name__)
from google.ads.googleads import KeywordViewServiceTransport
expected_names.append(KeywordViewServiceTransport.__name__)
from google.ads.googleads import KeywordViewServiceGrpcTransport
expected_names.append(KeywordViewServiceGrpcTransport.__name__)
from google.ads.googleads import KeywordThemeConstantServiceClient
expected_names.append(KeywordThemeConstantServiceClient.__name__)
from google.ads.googleads import KeywordThemeConstantServiceTransport
expected_names.append(KeywordThemeConstantServiceTransport.__name__)
from google.ads.googleads import KeywordThemeConstantServiceGrpcTransport
expected_names.append(KeywordThemeConstantServiceGrpcTransport.__name__)
from google.ads.googleads import KeywordPlanIdeaServiceClient
expected_names.append(KeywordPlanIdeaServiceClient.__name__)
from google.ads.googleads import KeywordPlanIdeaServiceTransport
expected_names.append(KeywordPlanIdeaServiceTransport.__name__)
from google.ads.googleads import KeywordPlanIdeaServiceGrpcTransport
expected_names.append(KeywordPlanIdeaServiceGrpcTransport.__name__)
from google.ads.googleads import InvoiceServiceClient
expected_names.append(InvoiceServiceClient.__name__)
from google.ads.googleads import InvoiceServiceTransport
expected_names.append(InvoiceServiceTransport.__name__)
from google.ads.googleads import InvoiceServiceGrpcTransport
expected_names.append(InvoiceServiceGrpcTransport.__name__)
from google.ads.googleads import IncomeRangeViewServiceClient
expected_names.append(IncomeRangeViewServiceClient.__name__)
from google.ads.googleads import IncomeRangeViewServiceTransport
expected_names.append(IncomeRangeViewServiceTransport.__name__)
from google.ads.googleads import IncomeRangeViewServiceGrpcTransport
expected_names.append(IncomeRangeViewServiceGrpcTransport.__name__)
from google.ads.googleads import HotelPerformanceViewServiceClient
expected_names.append(HotelPerformanceViewServiceClient.__name__)
from google.ads.googleads import HotelPerformanceViewServiceTransport
expected_names.append(HotelPerformanceViewServiceTransport.__name__)
from google.ads.googleads import HotelPerformanceViewServiceGrpcTransport
expected_names.append(HotelPerformanceViewServiceGrpcTransport.__name__)
from google.ads.googleads import HotelGroupViewServiceClient
expected_names.append(HotelGroupViewServiceClient.__name__)
from google.ads.googleads import HotelGroupViewServiceTransport
expected_names.append(HotelGroupViewServiceTransport.__name__)
from google.ads.googleads import HotelGroupViewServiceGrpcTransport
expected_names.append(HotelGroupViewServiceGrpcTransport.__name__)
from google.ads.googleads import GroupPlacementViewServiceClient
expected_names.append(GroupPlacementViewServiceClient.__name__)
from google.ads.googleads import GroupPlacementViewServiceTransport
expected_names.append(GroupPlacementViewServiceTransport.__name__)
from google.ads.googleads import GroupPlacementViewServiceGrpcTransport
expected_names.append(GroupPlacementViewServiceGrpcTransport.__name__)
from google.ads.googleads import GoogleAdsFieldServiceClient
expected_names.append(GoogleAdsFieldServiceClient.__name__)
from google.ads.googleads import GoogleAdsFieldServiceTransport
expected_names.append(GoogleAdsFieldServiceTransport.__name__)
from google.ads.googleads import GoogleAdsFieldServiceGrpcTransport
expected_names.append(GoogleAdsFieldServiceGrpcTransport.__name__)
from google.ads.googleads import GeographicViewServiceClient
expected_names.append(GeographicViewServiceClient.__name__)
from google.ads.googleads import GeographicViewServiceTransport
expected_names.append(GeographicViewServiceTransport.__name__)
from google.ads.googleads import GeographicViewServiceGrpcTransport
expected_names.append(GeographicViewServiceGrpcTransport.__name__)
from google.ads.googleads import GeoTargetConstantServiceClient
expected_names.append(GeoTargetConstantServiceClient.__name__)
from google.ads.googleads import GeoTargetConstantServiceTransport
expected_names.append(GeoTargetConstantServiceTransport.__name__)
from google.ads.googleads import GeoTargetConstantServiceGrpcTransport
expected_names.append(GeoTargetConstantServiceGrpcTransport.__name__)
from google.ads.googleads import GenderViewServiceClient
expected_names.append(GenderViewServiceClient.__name__)
from google.ads.googleads import GenderViewServiceTransport
expected_names.append(GenderViewServiceTransport.__name__)
from google.ads.googleads import GenderViewServiceGrpcTransport
expected_names.append(GenderViewServiceGrpcTransport.__name__)
from google.ads.googleads import FeedPlaceholderViewServiceClient
expected_names.append(FeedPlaceholderViewServiceClient.__name__)
from google.ads.googleads import FeedPlaceholderViewServiceTransport
expected_names.append(FeedPlaceholderViewServiceTransport.__name__)
from google.ads.googleads import FeedPlaceholderViewServiceGrpcTransport
expected_names.append(FeedPlaceholderViewServiceGrpcTransport.__name__)
from google.ads.googleads import ExpandedLandingPageViewServiceClient
expected_names.append(ExpandedLandingPageViewServiceClient.__name__)
from google.ads.googleads import ExpandedLandingPageViewServiceTransport
expected_names.append(ExpandedLandingPageViewServiceTransport.__name__)
from google.ads.googleads import ExpandedLandingPageViewServiceGrpcTransport
expected_names.append(ExpandedLandingPageViewServiceGrpcTransport.__name__)
from google.ads.googleads import DynamicSearchAdsSearchTermViewServiceClient
expected_names.append(DynamicSearchAdsSearchTermViewServiceClient.__name__)
from google.ads.googleads import DynamicSearchAdsSearchTermViewServiceTransport
expected_names.append(DynamicSearchAdsSearchTermViewServiceTransport.__name__)
from google.ads.googleads import DynamicSearchAdsSearchTermViewServiceGrpcTransport
expected_names.append(DynamicSearchAdsSearchTermViewServiceGrpcTransport.__name__)
from google.ads.googleads import DomainCategoryServiceClient
expected_names.append(DomainCategoryServiceClient.__name__)
from google.ads.googleads import DomainCategoryServiceTransport
expected_names.append(DomainCategoryServiceTransport.__name__)
from google.ads.googleads import DomainCategoryServiceGrpcTransport
expected_names.append(DomainCategoryServiceGrpcTransport.__name__)
from google.ads.googleads import DistanceViewServiceClient
expected_names.append(DistanceViewServiceClient.__name__)
from google.ads.googleads import DistanceViewServiceTransport
expected_names.append(DistanceViewServiceTransport.__name__)
from google.ads.googleads import DistanceViewServiceGrpcTransport
expected_names.append(DistanceViewServiceGrpcTransport.__name__)
from google.ads.googleads import DisplayKeywordViewServiceClient
expected_names.append(DisplayKeywordViewServiceClient.__name__)
from google.ads.googleads import DisplayKeywordViewServiceTransport
expected_names.append(DisplayKeywordViewServiceTransport.__name__)
from google.ads.googleads import DisplayKeywordViewServiceGrpcTransport
expected_names.append(DisplayKeywordViewServiceGrpcTransport.__name__)
from google.ads.googleads import DetailedDemographicServiceClient
expected_names.append(DetailedDemographicServiceClient.__name__)
from google.ads.googleads import DetailedDemographicServiceTransport
expected_names.append(DetailedDemographicServiceTransport.__name__)
from google.ads.googleads import DetailedDemographicServiceGrpcTransport
expected_names.append(DetailedDemographicServiceGrpcTransport.__name__)
from google.ads.googleads import DetailPlacementViewServiceClient
expected_names.append(DetailPlacementViewServiceClient.__name__)
from google.ads.googleads import DetailPlacementViewServiceTransport
expected_names.append(DetailPlacementViewServiceTransport.__name__)
from google.ads.googleads import DetailPlacementViewServiceGrpcTransport
expected_names.append(DetailPlacementViewServiceGrpcTransport.__name__)
from google.ads.googleads import CustomerUserAccessServiceClient
expected_names.append(CustomerUserAccessServiceClient.__name__)
from google.ads.googleads import CustomerUserAccessServiceTransport
expected_names.append(CustomerUserAccessServiceTransport.__name__)
from google.ads.googleads import CustomerUserAccessServiceGrpcTransport
expected_names.append(CustomerUserAccessServiceGrpcTransport.__name__)
from google.ads.googleads import CustomerUserAccessInvitationServiceClient
expected_names.append(CustomerUserAccessInvitationServiceClient.__name__)
from google.ads.googleads import CustomerUserAccessInvitationServiceTransport
expected_names.append(CustomerUserAccessInvitationServiceTransport.__name__)
from google.ads.googleads import CustomerUserAccessInvitationServiceGrpcTransport
expected_names.append(CustomerUserAccessInvitationServiceGrpcTransport.__name__)
from google.ads.googleads import CustomerManagerLinkServiceClient
expected_names.append(CustomerManagerLinkServiceClient.__name__)
from google.ads.googleads import CustomerManagerLinkServiceTransport
expected_names.append(CustomerManagerLinkServiceTransport.__name__)
from google.ads.googleads import CustomerManagerLinkServiceGrpcTransport
expected_names.append(CustomerManagerLinkServiceGrpcTransport.__name__)
from google.ads.googleads import CustomerClientServiceClient
expected_names.append(CustomerClientServiceClient.__name__)
from google.ads.googleads import CustomerClientServiceTransport
expected_names.append(CustomerClientServiceTransport.__name__)
from google.ads.googleads import CustomerClientServiceGrpcTransport
expected_names.append(CustomerClientServiceGrpcTransport.__name__)
from google.ads.googleads import CustomerClientLinkServiceClient
expected_names.append(CustomerClientLinkServiceClient.__name__)
from google.ads.googleads import CustomerClientLinkServiceTransport
expected_names.append(CustomerClientLinkServiceTransport.__name__)
from google.ads.googleads import CustomerClientLinkServiceGrpcTransport
expected_names.append(CustomerClientLinkServiceGrpcTransport.__name__)
from google.ads.googleads import CustomInterestServiceClient
expected_names.append(CustomInterestServiceClient.__name__)
from google.ads.googleads import CustomInterestServiceTransport
expected_names.append(CustomInterestServiceTransport.__name__)
from google.ads.googleads import CustomInterestServiceGrpcTransport
expected_names.append(CustomInterestServiceGrpcTransport.__name__)
from google.ads.googleads import CustomAudienceServiceClient
expected_names.append(CustomAudienceServiceClient.__name__)
from google.ads.googleads import CustomAudienceServiceTransport
expected_names.append(CustomAudienceServiceTransport.__name__)
from google.ads.googleads import CustomAudienceServiceGrpcTransport
expected_names.append(CustomAudienceServiceGrpcTransport.__name__)
from google.ads.googleads import CurrencyConstantServiceClient
expected_names.append(CurrencyConstantServiceClient.__name__)
from google.ads.googleads import CurrencyConstantServiceTransport
expected_names.append(CurrencyConstantServiceTransport.__name__)
from google.ads.googleads import CurrencyConstantServiceGrpcTransport
expected_names.append(CurrencyConstantServiceGrpcTransport.__name__)
from google.ads.googleads import ConversionUploadServiceClient
expected_names.append(ConversionUploadServiceClient.__name__)
from google.ads.googleads import ConversionUploadServiceTransport
expected_names.append(ConversionUploadServiceTransport.__name__)
from google.ads.googleads import ConversionUploadServiceGrpcTransport
expected_names.append(ConversionUploadServiceGrpcTransport.__name__)
from google.ads.googleads import ConversionAdjustmentUploadServiceClient
expected_names.append(ConversionAdjustmentUploadServiceClient.__name__)
from google.ads.googleads import ConversionAdjustmentUploadServiceTransport
expected_names.append(ConversionAdjustmentUploadServiceTransport.__name__)
from google.ads.googleads import ConversionAdjustmentUploadServiceGrpcTransport
expected_names.append(ConversionAdjustmentUploadServiceGrpcTransport.__name__)
from google.ads.googleads import CombinedAudienceServiceClient
expected_names.append(CombinedAudienceServiceClient.__name__)
from google.ads.googleads import CombinedAudienceServiceTransport
expected_names.append(CombinedAudienceServiceTransport.__name__)
from google.ads.googleads import CombinedAudienceServiceGrpcTransport
expected_names.append(CombinedAudienceServiceGrpcTransport.__name__)
from google.ads.googleads import ClickViewServiceClient
expected_names.append(ClickViewServiceClient.__name__)
from google.ads.googleads import ClickViewServiceTransport
expected_names.append(ClickViewServiceTransport.__name__)
from google.ads.googleads import ClickViewServiceGrpcTransport
expected_names.append(ClickViewServiceGrpcTransport.__name__)
from google.ads.googleads import ChangeStatusServiceClient
expected_names.append(ChangeStatusServiceClient.__name__)
from google.ads.googleads import ChangeStatusServiceTransport
expected_names.append(ChangeStatusServiceTransport.__name__)
from google.ads.googleads import ChangeStatusServiceGrpcTransport
expected_names.append(ChangeStatusServiceGrpcTransport.__name__)
from google.ads.googleads import CarrierConstantServiceClient
expected_names.append(CarrierConstantServiceClient.__name__)
from google.ads.googleads import CarrierConstantServiceTransport
expected_names.append(CarrierConstantServiceTransport.__name__)
from google.ads.googleads import CarrierConstantServiceGrpcTransport
expected_names.append(CarrierConstantServiceGrpcTransport.__name__)
from google.ads.googleads import CampaignSimulationServiceClient
expected_names.append(CampaignSimulationServiceClient.__name__)
from google.ads.googleads import CampaignSimulationServiceTransport
expected_names.append(CampaignSimulationServiceTransport.__name__)
from google.ads.googleads import CampaignSimulationServiceGrpcTransport
expected_names.append(CampaignSimulationServiceGrpcTransport.__name__)
from google.ads.googleads import CampaignCriterionSimulationServiceClient
expected_names.append(CampaignCriterionSimulationServiceClient.__name__)
from google.ads.googleads import CampaignCriterionSimulationServiceTransport
expected_names.append(CampaignCriterionSimulationServiceTransport.__name__)
from google.ads.googleads import CampaignCriterionSimulationServiceGrpcTransport
expected_names.append(CampaignCriterionSimulationServiceGrpcTransport.__name__)
from google.ads.googleads import CampaignAudienceViewServiceClient
expected_names.append(CampaignAudienceViewServiceClient.__name__)
from google.ads.googleads import CampaignAudienceViewServiceTransport
expected_names.append(CampaignAudienceViewServiceTransport.__name__)
from google.ads.googleads import CampaignAudienceViewServiceGrpcTransport
expected_names.append(CampaignAudienceViewServiceGrpcTransport.__name__)
from google.ads.googleads import BillingSetupServiceClient
expected_names.append(BillingSetupServiceClient.__name__)
from google.ads.googleads import BillingSetupServiceTransport
expected_names.append(BillingSetupServiceTransport.__name__)
from google.ads.googleads import BillingSetupServiceGrpcTransport
expected_names.append(BillingSetupServiceGrpcTransport.__name__)
from google.ads.googleads import BiddingStrategySimulationServiceClient
expected_names.append(BiddingStrategySimulationServiceClient.__name__)
from google.ads.googleads import BiddingStrategySimulationServiceTransport
expected_names.append(BiddingStrategySimulationServiceTransport.__name__)
from google.ads.googleads import BiddingStrategySimulationServiceGrpcTransport
expected_names.append(BiddingStrategySimulationServiceGrpcTransport.__name__)
from google.ads.googleads import BatchJobServiceClient
expected_names.append(BatchJobServiceClient.__name__)
from google.ads.googleads import BatchJobServiceTransport
expected_names.append(BatchJobServiceTransport.__name__)
from google.ads.googleads import BatchJobServiceGrpcTransport
expected_names.append(BatchJobServiceGrpcTransport.__name__)
from google.ads.googleads import GoogleAdsServiceClient
expected_names.append(GoogleAdsServiceClient.__name__)
from google.ads.googleads import GoogleAdsServiceTransport
expected_names.append(GoogleAdsServiceTransport.__name__)
from google.ads.googleads import GoogleAdsServiceGrpcTransport
expected_names.append(GoogleAdsServiceGrpcTransport.__name__)
from google.ads.googleads import UserListServiceClient
expected_names.append(UserListServiceClient.__name__)
from google.ads.googleads import UserListServiceTransport
expected_names.append(UserListServiceTransport.__name__)
from google.ads.googleads import UserListServiceGrpcTransport
expected_names.append(UserListServiceGrpcTransport.__name__)
from google.ads.googleads import SmartCampaignSettingServiceClient
expected_names.append(SmartCampaignSettingServiceClient.__name__)
from google.ads.googleads import SmartCampaignSettingServiceTransport
expected_names.append(SmartCampaignSettingServiceTransport.__name__)
from google.ads.googleads import SmartCampaignSettingServiceGrpcTransport
expected_names.append(SmartCampaignSettingServiceGrpcTransport.__name__)
from google.ads.googleads import SharedSetServiceClient
expected_names.append(SharedSetServiceClient.__name__)
from google.ads.googleads import SharedSetServiceTransport
expected_names.append(SharedSetServiceTransport.__name__)
from google.ads.googleads import SharedSetServiceGrpcTransport
expected_names.append(SharedSetServiceGrpcTransport.__name__)
from google.ads.googleads import SharedCriterionServiceClient
expected_names.append(SharedCriterionServiceClient.__name__)
from google.ads.googleads import SharedCriterionServiceTransport
expected_names.append(SharedCriterionServiceTransport.__name__)
from google.ads.googleads import SharedCriterionServiceGrpcTransport
expected_names.append(SharedCriterionServiceGrpcTransport.__name__)
from google.ads.googleads import RemarketingActionServiceClient
expected_names.append(RemarketingActionServiceClient.__name__)
from google.ads.googleads import RemarketingActionServiceTransport
expected_names.append(RemarketingActionServiceTransport.__name__)
from google.ads.googleads import RemarketingActionServiceGrpcTransport
expected_names.append(RemarketingActionServiceGrpcTransport.__name__)
from google.ads.googleads import MediaFileServiceClient
expected_names.append(MediaFileServiceClient.__name__)
from google.ads.googleads import MediaFileServiceTransport
expected_names.append(MediaFileServiceTransport.__name__)
from google.ads.googleads import MediaFileServiceGrpcTransport
expected_names.append(MediaFileServiceGrpcTransport.__name__)
from google.ads.googleads import LabelServiceClient
expected_names.append(LabelServiceClient.__name__)
from google.ads.googleads import LabelServiceTransport
expected_names.append(LabelServiceTransport.__name__)
from google.ads.googleads import LabelServiceGrpcTransport
expected_names.append(LabelServiceGrpcTransport.__name__)
from google.ads.googleads import KeywordPlanServiceClient
expected_names.append(KeywordPlanServiceClient.__name__)
from google.ads.googleads import KeywordPlanServiceTransport
expected_names.append(KeywordPlanServiceTransport.__name__)
from google.ads.googleads import KeywordPlanServiceGrpcTransport
expected_names.append(KeywordPlanServiceGrpcTransport.__name__)
from google.ads.googleads import KeywordPlanCampaignServiceClient
expected_names.append(KeywordPlanCampaignServiceClient.__name__)
from google.ads.googleads import KeywordPlanCampaignServiceTransport
expected_names.append(KeywordPlanCampaignServiceTransport.__name__)
from google.ads.googleads import KeywordPlanCampaignServiceGrpcTransport
expected_names.append(KeywordPlanCampaignServiceGrpcTransport.__name__)
from google.ads.googleads import KeywordPlanCampaignKeywordServiceClient
expected_names.append(KeywordPlanCampaignKeywordServiceClient.__name__)
from google.ads.googleads import KeywordPlanCampaignKeywordServiceTransport
expected_names.append(KeywordPlanCampaignKeywordServiceTransport.__name__)
from google.ads.googleads import KeywordPlanCampaignKeywordServiceGrpcTransport
expected_names.append(KeywordPlanCampaignKeywordServiceGrpcTransport.__name__)
from google.ads.googleads import KeywordPlanAdGroupServiceClient
expected_names.append(KeywordPlanAdGroupServiceClient.__name__)
from google.ads.googleads import KeywordPlanAdGroupServiceTransport
expected_names.append(KeywordPlanAdGroupServiceTransport.__name__)
from google.ads.googleads import KeywordPlanAdGroupServiceGrpcTransport
expected_names.append(KeywordPlanAdGroupServiceGrpcTransport.__name__)
from google.ads.googleads import KeywordPlanAdGroupKeywordServiceClient
expected_names.append(KeywordPlanAdGroupKeywordServiceClient.__name__)
from google.ads.googleads import KeywordPlanAdGroupKeywordServiceTransport
expected_names.append(KeywordPlanAdGroupKeywordServiceTransport.__name__)
from google.ads.googleads import KeywordPlanAdGroupKeywordServiceGrpcTransport
expected_names.append(KeywordPlanAdGroupKeywordServiceGrpcTransport.__name__)
from google.ads.googleads import FeedServiceClient
expected_names.append(FeedServiceClient.__name__)
from google.ads.googleads import FeedServiceTransport
expected_names.append(FeedServiceTransport.__name__)
from google.ads.googleads import FeedServiceGrpcTransport
expected_names.append(FeedServiceGrpcTransport.__name__)
from google.ads.googleads import FeedMappingServiceClient
expected_names.append(FeedMappingServiceClient.__name__)
from google.ads.googleads import FeedMappingServiceTransport
expected_names.append(FeedMappingServiceTransport.__name__)
from google.ads.googleads import FeedMappingServiceGrpcTransport
expected_names.append(FeedMappingServiceGrpcTransport.__name__)
from google.ads.googleads import FeedItemTargetServiceClient
expected_names.append(FeedItemTargetServiceClient.__name__)
from google.ads.googleads import FeedItemTargetServiceTransport
expected_names.append(FeedItemTargetServiceTransport.__name__)
from google.ads.googleads import FeedItemTargetServiceGrpcTransport
expected_names.append(FeedItemTargetServiceGrpcTransport.__name__)
from google.ads.googleads import FeedItemSetServiceClient
expected_names.append(FeedItemSetServiceClient.__name__)
from google.ads.googleads import FeedItemSetServiceTransport
expected_names.append(FeedItemSetServiceTransport.__name__)
from google.ads.googleads import FeedItemSetServiceGrpcTransport
expected_names.append(FeedItemSetServiceGrpcTransport.__name__)
from google.ads.googleads import FeedItemSetLinkServiceClient
expected_names.append(FeedItemSetLinkServiceClient.__name__)
from google.ads.googleads import FeedItemSetLinkServiceTransport
expected_names.append(FeedItemSetLinkServiceTransport.__name__)
from google.ads.googleads import FeedItemSetLinkServiceGrpcTransport
expected_names.append(FeedItemSetLinkServiceGrpcTransport.__name__)
from google.ads.googleads import FeedItemServiceClient
expected_names.append(FeedItemServiceClient.__name__)
from google.ads.googleads import FeedItemServiceTransport
expected_names.append(FeedItemServiceTransport.__name__)
from google.ads.googleads import FeedItemServiceGrpcTransport
expected_names.append(FeedItemServiceGrpcTransport.__name__)
from google.ads.googleads import ExtensionFeedItemServiceClient
expected_names.append(ExtensionFeedItemServiceClient.__name__)
from google.ads.googleads import ExtensionFeedItemServiceTransport
expected_names.append(ExtensionFeedItemServiceTransport.__name__)
from google.ads.googleads import ExtensionFeedItemServiceGrpcTransport
expected_names.append(ExtensionFeedItemServiceGrpcTransport.__name__)
from google.ads.googleads import CustomerServiceClient
expected_names.append(CustomerServiceClient.__name__)
from google.ads.googleads import CustomerServiceTransport
expected_names.append(CustomerServiceTransport.__name__)
from google.ads.googleads import CustomerServiceGrpcTransport
expected_names.append(CustomerServiceGrpcTransport.__name__)
from google.ads.googleads import CustomerNegativeCriterionServiceClient
expected_names.append(CustomerNegativeCriterionServiceClient.__name__)
from google.ads.googleads import CustomerNegativeCriterionServiceTransport
expected_names.append(CustomerNegativeCriterionServiceTransport.__name__)
from google.ads.googleads import CustomerNegativeCriterionServiceGrpcTransport
expected_names.append(CustomerNegativeCriterionServiceGrpcTransport.__name__)
from google.ads.googleads import CustomerLabelServiceClient
expected_names.append(CustomerLabelServiceClient.__name__)
from google.ads.googleads import CustomerLabelServiceTransport
expected_names.append(CustomerLabelServiceTransport.__name__)
from google.ads.googleads import CustomerLabelServiceGrpcTransport
expected_names.append(CustomerLabelServiceGrpcTransport.__name__)
from google.ads.googleads import CustomerFeedServiceClient
expected_names.append(CustomerFeedServiceClient.__name__)
from google.ads.googleads import CustomerFeedServiceTransport
expected_names.append(CustomerFeedServiceTransport.__name__)
from google.ads.googleads import CustomerFeedServiceGrpcTransport
expected_names.append(CustomerFeedServiceGrpcTransport.__name__)
from google.ads.googleads import CustomerExtensionSettingServiceClient
expected_names.append(CustomerExtensionSettingServiceClient.__name__)
from google.ads.googleads import CustomerExtensionSettingServiceTransport
expected_names.append(CustomerExtensionSettingServiceTransport.__name__)
from google.ads.googleads import CustomerExtensionSettingServiceGrpcTransport
expected_names.append(CustomerExtensionSettingServiceGrpcTransport.__name__)
from google.ads.googleads import CustomerAssetServiceClient
expected_names.append(CustomerAssetServiceClient.__name__)
from google.ads.googleads import CustomerAssetServiceTransport
expected_names.append(CustomerAssetServiceTransport.__name__)
from google.ads.googleads import CustomerAssetServiceGrpcTransport
expected_names.append(CustomerAssetServiceGrpcTransport.__name__)
from google.ads.googleads import ConversionCustomVariableServiceClient
expected_names.append(ConversionCustomVariableServiceClient.__name__)
from google.ads.googleads import ConversionCustomVariableServiceTransport
expected_names.append(ConversionCustomVariableServiceTransport.__name__)
from google.ads.googleads import ConversionCustomVariableServiceGrpcTransport
expected_names.append(ConversionCustomVariableServiceGrpcTransport.__name__)
from google.ads.googleads import ConversionActionServiceClient
expected_names.append(ConversionActionServiceClient.__name__)
from google.ads.googleads import ConversionActionServiceTransport
expected_names.append(ConversionActionServiceTransport.__name__)
from google.ads.googleads import ConversionActionServiceGrpcTransport
expected_names.append(ConversionActionServiceGrpcTransport.__name__)
from google.ads.googleads import CampaignSharedSetServiceClient
expected_names.append(CampaignSharedSetServiceClient.__name__)
from google.ads.googleads import CampaignSharedSetServiceTransport
expected_names.append(CampaignSharedSetServiceTransport.__name__)
from google.ads.googleads import CampaignSharedSetServiceGrpcTransport
expected_names.append(CampaignSharedSetServiceGrpcTransport.__name__)
from google.ads.googleads import CampaignServiceClient
expected_names.append(CampaignServiceClient.__name__)
from google.ads.googleads import CampaignServiceTransport
expected_names.append(CampaignServiceTransport.__name__)
from google.ads.googleads import CampaignServiceGrpcTransport
expected_names.append(CampaignServiceGrpcTransport.__name__)
from google.ads.googleads import CampaignLabelServiceClient
expected_names.append(CampaignLabelServiceClient.__name__)
from google.ads.googleads import CampaignLabelServiceTransport
expected_names.append(CampaignLabelServiceTransport.__name__)
from google.ads.googleads import CampaignLabelServiceGrpcTransport
expected_names.append(CampaignLabelServiceGrpcTransport.__name__)
from google.ads.googleads import CampaignFeedServiceClient
expected_names.append(CampaignFeedServiceClient.__name__)
from google.ads.googleads import CampaignFeedServiceTransport
expected_names.append(CampaignFeedServiceTransport.__name__)
from google.ads.googleads import CampaignFeedServiceGrpcTransport
expected_names.append(CampaignFeedServiceGrpcTransport.__name__)
from google.ads.googleads import CampaignExtensionSettingServiceClient
expected_names.append(CampaignExtensionSettingServiceClient.__name__)
from google.ads.googleads import CampaignExtensionSettingServiceTransport
expected_names.append(CampaignExtensionSettingServiceTransport.__name__)
from google.ads.googleads import CampaignExtensionSettingServiceGrpcTransport
expected_names.append(CampaignExtensionSettingServiceGrpcTransport.__name__)
from google.ads.googleads import CampaignExperimentServiceClient
expected_names.append(CampaignExperimentServiceClient.__name__)
from google.ads.googleads import CampaignExperimentServiceTransport
expected_names.append(CampaignExperimentServiceTransport.__name__)
from google.ads.googleads import CampaignExperimentServiceGrpcTransport
expected_names.append(CampaignExperimentServiceGrpcTransport.__name__)
from google.ads.googleads import CampaignDraftServiceClient
expected_names.append(CampaignDraftServiceClient.__name__)
from google.ads.googleads import CampaignDraftServiceTransport
expected_names.append(CampaignDraftServiceTransport.__name__)
from google.ads.googleads import CampaignDraftServiceGrpcTransport
expected_names.append(CampaignDraftServiceGrpcTransport.__name__)
from google.ads.googleads import CampaignCriterionServiceClient
expected_names.append(CampaignCriterionServiceClient.__name__)
from google.ads.googleads import CampaignCriterionServiceTransport
expected_names.append(CampaignCriterionServiceTransport.__name__)
from google.ads.googleads import CampaignCriterionServiceGrpcTransport
expected_names.append(CampaignCriterionServiceGrpcTransport.__name__)
from google.ads.googleads import CampaignBudgetServiceClient
expected_names.append(CampaignBudgetServiceClient.__name__)
from google.ads.googleads import CampaignBudgetServiceTransport
expected_names.append(CampaignBudgetServiceTransport.__name__)
from google.ads.googleads import CampaignBudgetServiceGrpcTransport
expected_names.append(CampaignBudgetServiceGrpcTransport.__name__)
from google.ads.googleads import CampaignBidModifierServiceClient
expected_names.append(CampaignBidModifierServiceClient.__name__)
from google.ads.googleads import CampaignBidModifierServiceTransport
expected_names.append(CampaignBidModifierServiceTransport.__name__)
from google.ads.googleads import CampaignBidModifierServiceGrpcTransport
expected_names.append(CampaignBidModifierServiceGrpcTransport.__name__)
from google.ads.googleads import CampaignAssetServiceClient
expected_names.append(CampaignAssetServiceClient.__name__)
from google.ads.googleads import CampaignAssetServiceTransport
expected_names.append(CampaignAssetServiceTransport.__name__)
from google.ads.googleads import CampaignAssetServiceGrpcTransport
expected_names.append(CampaignAssetServiceGrpcTransport.__name__)
from google.ads.googleads import BiddingStrategyServiceClient
expected_names.append(BiddingStrategyServiceClient.__name__)
from google.ads.googleads import BiddingStrategyServiceTransport
expected_names.append(BiddingStrategyServiceTransport.__name__)
from google.ads.googleads import BiddingStrategyServiceGrpcTransport
expected_names.append(BiddingStrategyServiceGrpcTransport.__name__)
from google.ads.googleads import AssetServiceClient
expected_names.append(AssetServiceClient.__name__)
from google.ads.googleads import AssetServiceTransport
expected_names.append(AssetServiceTransport.__name__)
from google.ads.googleads import AssetServiceGrpcTransport
expected_names.append(AssetServiceGrpcTransport.__name__)
from google.ads.googleads import AssetFieldTypeViewServiceClient
expected_names.append(AssetFieldTypeViewServiceClient.__name__)
from google.ads.googleads import AssetFieldTypeViewServiceTransport
expected_names.append(AssetFieldTypeViewServiceTransport.__name__)
from google.ads.googleads import AssetFieldTypeViewServiceGrpcTransport
expected_names.append(AssetFieldTypeViewServiceGrpcTransport.__name__)
from google.ads.googleads import AgeRangeViewServiceClient
expected_names.append(AgeRangeViewServiceClient.__name__)
from google.ads.googleads import AgeRangeViewServiceTransport
expected_names.append(AgeRangeViewServiceTransport.__name__)
from google.ads.googleads import AgeRangeViewServiceGrpcTransport
expected_names.append(AgeRangeViewServiceGrpcTransport.__name__)
from google.ads.googleads import AdServiceClient
expected_names.append(AdServiceClient.__name__)
from google.ads.googleads import AdServiceTransport
expected_names.append(AdServiceTransport.__name__)
from google.ads.googleads import AdServiceGrpcTransport
expected_names.append(AdServiceGrpcTransport.__name__)
from google.ads.googleads import AdScheduleViewServiceClient
expected_names.append(AdScheduleViewServiceClient.__name__)
from google.ads.googleads import AdScheduleViewServiceTransport
expected_names.append(AdScheduleViewServiceTransport.__name__)
from google.ads.googleads import AdScheduleViewServiceGrpcTransport
expected_names.append(AdScheduleViewServiceGrpcTransport.__name__)
from google.ads.googleads import AdParameterServiceClient
expected_names.append(AdParameterServiceClient.__name__)
from google.ads.googleads import AdParameterServiceTransport
expected_names.append(AdParameterServiceTransport.__name__)
from google.ads.googleads import AdParameterServiceGrpcTransport
expected_names.append(AdParameterServiceGrpcTransport.__name__)
from google.ads.googleads import AdGroupSimulationServiceClient
expected_names.append(AdGroupSimulationServiceClient.__name__)
from google.ads.googleads import AdGroupSimulationServiceTransport
expected_names.append(AdGroupSimulationServiceTransport.__name__)
from google.ads.googleads import AdGroupSimulationServiceGrpcTransport
expected_names.append(AdGroupSimulationServiceGrpcTransport.__name__)
from google.ads.googleads import AdGroupServiceClient
expected_names.append(AdGroupServiceClient.__name__)
from google.ads.googleads import AdGroupServiceTransport
expected_names.append(AdGroupServiceTransport.__name__)
from google.ads.googleads import AdGroupServiceGrpcTransport
expected_names.append(AdGroupServiceGrpcTransport.__name__)
from google.ads.googleads import AdGroupLabelServiceClient
expected_names.append(AdGroupLabelServiceClient.__name__)
from google.ads.googleads import AdGroupLabelServiceTransport
expected_names.append(AdGroupLabelServiceTransport.__name__)
from google.ads.googleads import AdGroupLabelServiceGrpcTransport
expected_names.append(AdGroupLabelServiceGrpcTransport.__name__)
from google.ads.googleads import AdGroupFeedServiceClient
expected_names.append(AdGroupFeedServiceClient.__name__)
from google.ads.googleads import AdGroupFeedServiceTransport
expected_names.append(AdGroupFeedServiceTransport.__name__)
from google.ads.googleads import AdGroupFeedServiceGrpcTransport
expected_names.append(AdGroupFeedServiceGrpcTransport.__name__)
from google.ads.googleads import AdGroupExtensionSettingServiceClient
expected_names.append(AdGroupExtensionSettingServiceClient.__name__)
from google.ads.googleads import AdGroupExtensionSettingServiceTransport
expected_names.append(AdGroupExtensionSettingServiceTransport.__name__)
from google.ads.googleads import AdGroupExtensionSettingServiceGrpcTransport
expected_names.append(AdGroupExtensionSettingServiceGrpcTransport.__name__)
from google.ads.googleads import AdGroupCriterionSimulationServiceClient
expected_names.append(AdGroupCriterionSimulationServiceClient.__name__)
from google.ads.googleads import AdGroupCriterionSimulationServiceTransport
expected_names.append(AdGroupCriterionSimulationServiceTransport.__name__)
from google.ads.googleads import AdGroupCriterionSimulationServiceGrpcTransport
expected_names.append(AdGroupCriterionSimulationServiceGrpcTransport.__name__)
from google.ads.googleads import AdGroupCriterionServiceClient
expected_names.append(AdGroupCriterionServiceClient.__name__)
from google.ads.googleads import AdGroupCriterionServiceTransport
expected_names.append(AdGroupCriterionServiceTransport.__name__)
from google.ads.googleads import AdGroupCriterionServiceGrpcTransport
expected_names.append(AdGroupCriterionServiceGrpcTransport.__name__)
from google.ads.googleads import AdGroupCriterionLabelServiceClient
expected_names.append(AdGroupCriterionLabelServiceClient.__name__)
from google.ads.googleads import AdGroupCriterionLabelServiceTransport
expected_names.append(AdGroupCriterionLabelServiceTransport.__name__)
from google.ads.googleads import AdGroupCriterionLabelServiceGrpcTransport
expected_names.append(AdGroupCriterionLabelServiceGrpcTransport.__name__)
from google.ads.googleads import AdGroupBidModifierServiceClient
expected_names.append(AdGroupBidModifierServiceClient.__name__)
from google.ads.googleads import AdGroupBidModifierServiceTransport
expected_names.append(AdGroupBidModifierServiceTransport.__name__)
from google.ads.googleads import AdGroupBidModifierServiceGrpcTransport
expected_names.append(AdGroupBidModifierServiceGrpcTransport.__name__)
from google.ads.googleads import AdGroupAudienceViewServiceClient
expected_names.append(AdGroupAudienceViewServiceClient.__name__)
from google.ads.googleads import AdGroupAudienceViewServiceTransport
expected_names.append(AdGroupAudienceViewServiceTransport.__name__)
from google.ads.googleads import AdGroupAudienceViewServiceGrpcTransport
expected_names.append(AdGroupAudienceViewServiceGrpcTransport.__name__)
from google.ads.googleads import AdGroupAssetServiceClient
expected_names.append(AdGroupAssetServiceClient.__name__)
from google.ads.googleads import AdGroupAssetServiceTransport
expected_names.append(AdGroupAssetServiceTransport.__name__)
from google.ads.googleads import AdGroupAssetServiceGrpcTransport
expected_names.append(AdGroupAssetServiceGrpcTransport.__name__)
from google.ads.googleads import AdGroupAdServiceClient
expected_names.append(AdGroupAdServiceClient.__name__)
from google.ads.googleads import AdGroupAdServiceTransport
expected_names.append(AdGroupAdServiceTransport.__name__)
from google.ads.googleads import AdGroupAdServiceGrpcTransport
expected_names.append(AdGroupAdServiceGrpcTransport.__name__)
from google.ads.googleads import AdGroupAdLabelServiceClient
expected_names.append(AdGroupAdLabelServiceClient.__name__)
from google.ads.googleads import AdGroupAdLabelServiceTransport
expected_names.append(AdGroupAdLabelServiceTransport.__name__)
from google.ads.googleads import AdGroupAdLabelServiceGrpcTransport
expected_names.append(AdGroupAdLabelServiceGrpcTransport.__name__)
from google.ads.googleads import AdGroupAdAssetViewServiceClient
expected_names.append(AdGroupAdAssetViewServiceClient.__name__)
from google.ads.googleads import AdGroupAdAssetViewServiceTransport
expected_names.append(AdGroupAdAssetViewServiceTransport.__name__)
from google.ads.googleads import AdGroupAdAssetViewServiceGrpcTransport
expected_names.append(AdGroupAdAssetViewServiceGrpcTransport.__name__)
from google.ads.googleads import AccountLinkServiceClient
expected_names.append(AccountLinkServiceClient.__name__)
from google.ads.googleads import AccountLinkServiceTransport
expected_names.append(AccountLinkServiceTransport.__name__)
from google.ads.googleads import AccountLinkServiceGrpcTransport
expected_names.append(AccountLinkServiceGrpcTransport.__name__)
from google.ads.googleads import AccountBudgetServiceClient
expected_names.append(AccountBudgetServiceClient.__name__)
from google.ads.googleads import AccountBudgetServiceTransport
expected_names.append(AccountBudgetServiceTransport.__name__)
from google.ads.googleads import AccountBudgetServiceGrpcTransport
expected_names.append(AccountBudgetServiceGrpcTransport.__name__)
from google.ads.googleads import AccountBudgetProposalServiceClient
expected_names.append(AccountBudgetProposalServiceClient.__name__)
from google.ads.googleads import AccountBudgetProposalServiceTransport
expected_names.append(AccountBudgetProposalServiceTransport.__name__)
from google.ads.googleads import AccountBudgetProposalServiceGrpcTransport
expected_names.append(AccountBudgetProposalServiceGrpcTransport.__name__)
from google.ads.googleads import AccessibleBiddingStrategyServiceClient
expected_names.append(AccessibleBiddingStrategyServiceClient.__name__)
from google.ads.googleads import AccessibleBiddingStrategyServiceTransport
expected_names.append(AccessibleBiddingStrategyServiceTransport.__name__)
from google.ads.googleads import AccessibleBiddingStrategyServiceGrpcTransport
expected_names.append(AccessibleBiddingStrategyServiceGrpcTransport.__name__)
expected_names.sort()
from google.ads import googleads
actual_names = dir(googleads)
assert expected_names == actual_names
# Verify the logic for handling non-existant names
with pytest.raises(ImportError):
from google.ads.googleads import GiantSquid
def test_versionsed_module_level_imports():
expected_names = []
# Message types
from google.ads.googleads.v8 import PolicyTopicEntryTypeEnum
expected_names.append(PolicyTopicEntryTypeEnum.__name__)
from google.ads.googleads.v8 import PolicyTopicEvidenceDestinationMismatchUrlTypeEnum
expected_names.append(PolicyTopicEvidenceDestinationMismatchUrlTypeEnum.__name__)
from google.ads.googleads.v8 import PolicyTopicEvidenceDestinationNotWorkingDeviceEnum
expected_names.append(PolicyTopicEvidenceDestinationNotWorkingDeviceEnum.__name__)
from google.ads.googleads.v8 import PolicyTopicEvidenceDestinationNotWorkingDnsErrorTypeEnum
expected_names.append(PolicyTopicEvidenceDestinationNotWorkingDnsErrorTypeEnum.__name__)
from google.ads.googleads.v8 import PolicyViolationKey
expected_names.append(PolicyViolationKey.__name__)
from google.ads.googleads.v8 import PolicyValidationParameter
expected_names.append(PolicyValidationParameter.__name__)
from google.ads.googleads.v8 import PolicyTopicEntry
expected_names.append(PolicyTopicEntry.__name__)
from google.ads.googleads.v8 import PolicyTopicEvidence
expected_names.append(PolicyTopicEvidence.__name__)
from google.ads.googleads.v8 import PolicyTopicConstraint
expected_names.append(PolicyTopicConstraint.__name__)
from google.ads.googleads.v8 import PolicyApprovalStatusEnum
expected_names.append(PolicyApprovalStatusEnum.__name__)
from google.ads.googleads.v8 import PolicyReviewStatusEnum
expected_names.append(PolicyReviewStatusEnum.__name__)
from google.ads.googleads.v8 import AdAssetPolicySummary
expected_names.append(AdAssetPolicySummary.__name__)
from google.ads.googleads.v8 import AssetPerformanceLabelEnum
expected_names.append(AssetPerformanceLabelEnum.__name__)
from google.ads.googleads.v8 import ServedAssetFieldTypeEnum
expected_names.append(ServedAssetFieldTypeEnum.__name__)
from google.ads.googleads.v8 import AdTextAsset
expected_names.append(AdTextAsset.__name__)
from google.ads.googleads.v8 import AdImageAsset
expected_names.append(AdImageAsset.__name__)
from google.ads.googleads.v8 import AdVideoAsset
expected_names.append(AdVideoAsset.__name__)
from google.ads.googleads.v8 import AdMediaBundleAsset
expected_names.append(AdMediaBundleAsset.__name__)
from google.ads.googleads.v8 import CallConversionReportingStateEnum
expected_names.append(CallConversionReportingStateEnum.__name__)
from google.ads.googleads.v8 import DisplayAdFormatSettingEnum
expected_names.append(DisplayAdFormatSettingEnum.__name__)
from google.ads.googleads.v8 import DisplayUploadProductTypeEnum
expected_names.append(DisplayUploadProductTypeEnum.__name__)
from google.ads.googleads.v8 import LegacyAppInstallAdAppStoreEnum
expected_names.append(LegacyAppInstallAdAppStoreEnum.__name__)
from google.ads.googleads.v8 import MimeTypeEnum
expected_names.append(MimeTypeEnum.__name__)
from google.ads.googleads.v8 import TextAdInfo
expected_names.append(TextAdInfo.__name__)
from google.ads.googleads.v8 import ExpandedTextAdInfo
expected_names.append(ExpandedTextAdInfo.__name__)
from google.ads.googleads.v8 import ExpandedDynamicSearchAdInfo
expected_names.append(ExpandedDynamicSearchAdInfo.__name__)
from google.ads.googleads.v8 import HotelAdInfo
expected_names.append(HotelAdInfo.__name__)
from google.ads.googleads.v8 import ShoppingSmartAdInfo
expected_names.append(ShoppingSmartAdInfo.__name__)
from google.ads.googleads.v8 import ShoppingProductAdInfo
expected_names.append(ShoppingProductAdInfo.__name__)
from google.ads.googleads.v8 import ShoppingComparisonListingAdInfo
expected_names.append(ShoppingComparisonListingAdInfo.__name__)
from google.ads.googleads.v8 import GmailAdInfo
expected_names.append(GmailAdInfo.__name__)
from google.ads.googleads.v8 import GmailTeaser
expected_names.append(GmailTeaser.__name__)
from google.ads.googleads.v8 import DisplayCallToAction
expected_names.append(DisplayCallToAction.__name__)
from google.ads.googleads.v8 import ProductImage
expected_names.append(ProductImage.__name__)
from google.ads.googleads.v8 import ProductVideo
expected_names.append(ProductVideo.__name__)
from google.ads.googleads.v8 import ImageAdInfo
expected_names.append(ImageAdInfo.__name__)
from google.ads.googleads.v8 import VideoBumperInStreamAdInfo
expected_names.append(VideoBumperInStreamAdInfo.__name__)
from google.ads.googleads.v8 import VideoNonSkippableInStreamAdInfo
expected_names.append(VideoNonSkippableInStreamAdInfo.__name__)
from google.ads.googleads.v8 import VideoTrueViewInStreamAdInfo
expected_names.append(VideoTrueViewInStreamAdInfo.__name__)
from google.ads.googleads.v8 import VideoOutstreamAdInfo
expected_names.append(VideoOutstreamAdInfo.__name__)
from google.ads.googleads.v8 import VideoTrueViewDiscoveryAdInfo
expected_names.append(VideoTrueViewDiscoveryAdInfo.__name__)
from google.ads.googleads.v8 import VideoAdInfo
expected_names.append(VideoAdInfo.__name__)
from google.ads.googleads.v8 import VideoResponsiveAdInfo
expected_names.append(VideoResponsiveAdInfo.__name__)
from google.ads.googleads.v8 import ResponsiveSearchAdInfo
expected_names.append(ResponsiveSearchAdInfo.__name__)
from google.ads.googleads.v8 import LegacyResponsiveDisplayAdInfo
expected_names.append(LegacyResponsiveDisplayAdInfo.__name__)
from google.ads.googleads.v8 import AppAdInfo
expected_names.append(AppAdInfo.__name__)
from google.ads.googleads.v8 import AppEngagementAdInfo
expected_names.append(AppEngagementAdInfo.__name__)
from google.ads.googleads.v8 import LegacyAppInstallAdInfo
expected_names.append(LegacyAppInstallAdInfo.__name__)
from google.ads.googleads.v8 import ResponsiveDisplayAdInfo
expected_names.append(ResponsiveDisplayAdInfo.__name__)
from google.ads.googleads.v8 import LocalAdInfo
expected_names.append(LocalAdInfo.__name__)
from google.ads.googleads.v8 import DisplayUploadAdInfo
expected_names.append(DisplayUploadAdInfo.__name__)
from google.ads.googleads.v8 import ResponsiveDisplayAdControlSpec
expected_names.append(ResponsiveDisplayAdControlSpec.__name__)
from google.ads.googleads.v8 import SmartCampaignAdInfo
expected_names.append(SmartCampaignAdInfo.__name__)
from google.ads.googleads.v8 import CallAdInfo
expected_names.append(CallAdInfo.__name__)
from google.ads.googleads.v8 import AgeRangeTypeEnum
expected_names.append(AgeRangeTypeEnum.__name__)
from google.ads.googleads.v8 import AppPaymentModelTypeEnum
expected_names.append(AppPaymentModelTypeEnum.__name__)
from google.ads.googleads.v8 import ContentLabelTypeEnum
expected_names.append(ContentLabelTypeEnum.__name__)
from google.ads.googleads.v8 import DayOfWeekEnum
expected_names.append(DayOfWeekEnum.__name__)
from google.ads.googleads.v8 import DeviceEnum
expected_names.append(DeviceEnum.__name__)
from google.ads.googleads.v8 import GenderTypeEnum
expected_names.append(GenderTypeEnum.__name__)
from google.ads.googleads.v8 import HotelDateSelectionTypeEnum
expected_names.append(HotelDateSelectionTypeEnum.__name__)
from google.ads.googleads.v8 import IncomeRangeTypeEnum
expected_names.append(IncomeRangeTypeEnum.__name__)
from google.ads.googleads.v8 import InteractionTypeEnum
expected_names.append(InteractionTypeEnum.__name__)
from google.ads.googleads.v8 import KeywordMatchTypeEnum
expected_names.append(KeywordMatchTypeEnum.__name__)
from google.ads.googleads.v8 import ListingGroupTypeEnum
expected_names.append(ListingGroupTypeEnum.__name__)
from google.ads.googleads.v8 import LocationGroupRadiusUnitsEnum
expected_names.append(LocationGroupRadiusUnitsEnum.__name__)
from google.ads.googleads.v8 import MinuteOfHourEnum
expected_names.append(MinuteOfHourEnum.__name__)
from google.ads.googleads.v8 import ParentalStatusTypeEnum
expected_names.append(ParentalStatusTypeEnum.__name__)
from google.ads.googleads.v8 import PreferredContentTypeEnum
expected_names.append(PreferredContentTypeEnum.__name__)
from google.ads.googleads.v8 import ProductBiddingCategoryLevelEnum
expected_names.append(ProductBiddingCategoryLevelEnum.__name__)
from google.ads.googleads.v8 import ProductChannelEnum
expected_names.append(ProductChannelEnum.__name__)
from google.ads.googleads.v8 import ProductChannelExclusivityEnum
expected_names.append(ProductChannelExclusivityEnum.__name__)
from google.ads.googleads.v8 import ProductConditionEnum
expected_names.append(ProductConditionEnum.__name__)
from google.ads.googleads.v8 import ProductCustomAttributeIndexEnum
expected_names.append(ProductCustomAttributeIndexEnum.__name__)
from google.ads.googleads.v8 import ProductTypeLevelEnum
expected_names.append(ProductTypeLevelEnum.__name__)
from google.ads.googleads.v8 import ProximityRadiusUnitsEnum
expected_names.append(ProximityRadiusUnitsEnum.__name__)
from google.ads.googleads.v8 import WebpageConditionOperandEnum
expected_names.append(WebpageConditionOperandEnum.__name__)
from google.ads.googleads.v8 import WebpageConditionOperatorEnum
expected_names.append(WebpageConditionOperatorEnum.__name__)
from google.ads.googleads.v8 import KeywordInfo
expected_names.append(KeywordInfo.__name__)
from google.ads.googleads.v8 import PlacementInfo
expected_names.append(PlacementInfo.__name__)
from google.ads.googleads.v8 import MobileAppCategoryInfo
expected_names.append(MobileAppCategoryInfo.__name__)
from google.ads.googleads.v8 import MobileApplicationInfo
expected_names.append(MobileApplicationInfo.__name__)
from google.ads.googleads.v8 import LocationInfo
expected_names.append(LocationInfo.__name__)
from google.ads.googleads.v8 import DeviceInfo
expected_names.append(DeviceInfo.__name__)
from google.ads.googleads.v8 import PreferredContentInfo
expected_names.append(PreferredContentInfo.__name__)
from google.ads.googleads.v8 import ListingGroupInfo
expected_names.append(ListingGroupInfo.__name__)
from google.ads.googleads.v8 import ListingScopeInfo
expected_names.append(ListingScopeInfo.__name__)
from google.ads.googleads.v8 import ListingDimensionInfo
expected_names.append(ListingDimensionInfo.__name__)
from google.ads.googleads.v8 import HotelIdInfo
expected_names.append(HotelIdInfo.__name__)
from google.ads.googleads.v8 import HotelClassInfo
expected_names.append(HotelClassInfo.__name__)
from google.ads.googleads.v8 import HotelCountryRegionInfo
expected_names.append(HotelCountryRegionInfo.__name__)
from google.ads.googleads.v8 import HotelStateInfo
expected_names.append(HotelStateInfo.__name__)
from google.ads.googleads.v8 import HotelCityInfo
expected_names.append(HotelCityInfo.__name__)
from google.ads.googleads.v8 import ProductBiddingCategoryInfo
expected_names.append(ProductBiddingCategoryInfo.__name__)
from google.ads.googleads.v8 import ProductBrandInfo
expected_names.append(ProductBrandInfo.__name__)
from google.ads.googleads.v8 import ProductChannelInfo
expected_names.append(ProductChannelInfo.__name__)
from google.ads.googleads.v8 import ProductChannelExclusivityInfo
expected_names.append(ProductChannelExclusivityInfo.__name__)
from google.ads.googleads.v8 import ProductConditionInfo
expected_names.append(ProductConditionInfo.__name__)
from google.ads.googleads.v8 import ProductCustomAttributeInfo
expected_names.append(ProductCustomAttributeInfo.__name__)
from google.ads.googleads.v8 import ProductItemIdInfo
expected_names.append(ProductItemIdInfo.__name__)
from google.ads.googleads.v8 import ProductTypeInfo
expected_names.append(ProductTypeInfo.__name__)
from google.ads.googleads.v8 import UnknownListingDimensionInfo
expected_names.append(UnknownListingDimensionInfo.__name__)
from google.ads.googleads.v8 import HotelDateSelectionTypeInfo
expected_names.append(HotelDateSelectionTypeInfo.__name__)
from google.ads.googleads.v8 import HotelAdvanceBookingWindowInfo
expected_names.append(HotelAdvanceBookingWindowInfo.__name__)
from google.ads.googleads.v8 import HotelLengthOfStayInfo
expected_names.append(HotelLengthOfStayInfo.__name__)
from google.ads.googleads.v8 import HotelCheckInDateRangeInfo
expected_names.append(HotelCheckInDateRangeInfo.__name__)
from google.ads.googleads.v8 import HotelCheckInDayInfo
expected_names.append(HotelCheckInDayInfo.__name__)
from google.ads.googleads.v8 import InteractionTypeInfo
expected_names.append(InteractionTypeInfo.__name__)
from google.ads.googleads.v8 import AdScheduleInfo
expected_names.append(AdScheduleInfo.__name__)
from google.ads.googleads.v8 import AgeRangeInfo
expected_names.append(AgeRangeInfo.__name__)
from google.ads.googleads.v8 import GenderInfo
expected_names.append(GenderInfo.__name__)
from google.ads.googleads.v8 import IncomeRangeInfo
expected_names.append(IncomeRangeInfo.__name__)
from google.ads.googleads.v8 import ParentalStatusInfo
expected_names.append(ParentalStatusInfo.__name__)
from google.ads.googleads.v8 import YouTubeVideoInfo
expected_names.append(YouTubeVideoInfo.__name__)
from google.ads.googleads.v8 import YouTubeChannelInfo
expected_names.append(YouTubeChannelInfo.__name__)
from google.ads.googleads.v8 import UserListInfo
expected_names.append(UserListInfo.__name__)
from google.ads.googleads.v8 import ProximityInfo
expected_names.append(ProximityInfo.__name__)
from google.ads.googleads.v8 import GeoPointInfo
expected_names.append(GeoPointInfo.__name__)
from google.ads.googleads.v8 import AddressInfo
expected_names.append(AddressInfo.__name__)
from google.ads.googleads.v8 import TopicInfo
expected_names.append(TopicInfo.__name__)
from google.ads.googleads.v8 import LanguageInfo
expected_names.append(LanguageInfo.__name__)
from google.ads.googleads.v8 import IpBlockInfo
expected_names.append(IpBlockInfo.__name__)
from google.ads.googleads.v8 import ContentLabelInfo
expected_names.append(ContentLabelInfo.__name__)
from google.ads.googleads.v8 import CarrierInfo
expected_names.append(CarrierInfo.__name__)
from google.ads.googleads.v8 import UserInterestInfo
expected_names.append(UserInterestInfo.__name__)
from google.ads.googleads.v8 import WebpageInfo
expected_names.append(WebpageInfo.__name__)
from google.ads.googleads.v8 import WebpageConditionInfo
expected_names.append(WebpageConditionInfo.__name__)
from google.ads.googleads.v8 import WebpageSampleInfo
expected_names.append(WebpageSampleInfo.__name__)
from google.ads.googleads.v8 import OperatingSystemVersionInfo
expected_names.append(OperatingSystemVersionInfo.__name__)
from google.ads.googleads.v8 import AppPaymentModelInfo
expected_names.append(AppPaymentModelInfo.__name__)
from google.ads.googleads.v8 import MobileDeviceInfo
expected_names.append(MobileDeviceInfo.__name__)
from google.ads.googleads.v8 import CustomAffinityInfo
expected_names.append(CustomAffinityInfo.__name__)
from google.ads.googleads.v8 import CustomIntentInfo
expected_names.append(CustomIntentInfo.__name__)
from google.ads.googleads.v8 import LocationGroupInfo
expected_names.append(LocationGroupInfo.__name__)
from google.ads.googleads.v8 import CustomAudienceInfo
expected_names.append(CustomAudienceInfo.__name__)
from google.ads.googleads.v8 import CombinedAudienceInfo
expected_names.append(CombinedAudienceInfo.__name__)
from google.ads.googleads.v8 import KeywordThemeInfo
expected_names.append(KeywordThemeInfo.__name__)
from google.ads.googleads.v8 import Money
expected_names.append(Money.__name__)
from google.ads.googleads.v8 import LeadFormCallToActionTypeEnum
expected_names.append(LeadFormCallToActionTypeEnum.__name__)
from google.ads.googleads.v8 import LeadFormDesiredIntentEnum
expected_names.append(LeadFormDesiredIntentEnum.__name__)
from google.ads.googleads.v8 import LeadFormFieldUserInputTypeEnum
expected_names.append(LeadFormFieldUserInputTypeEnum.__name__)
from google.ads.googleads.v8 import LeadFormPostSubmitCallToActionTypeEnum
expected_names.append(LeadFormPostSubmitCallToActionTypeEnum.__name__)
from google.ads.googleads.v8 import PromotionExtensionDiscountModifierEnum
expected_names.append(PromotionExtensionDiscountModifierEnum.__name__)
from google.ads.googleads.v8 import PromotionExtensionOccasionEnum
expected_names.append(PromotionExtensionOccasionEnum.__name__)
from google.ads.googleads.v8 import YoutubeVideoAsset
expected_names.append(YoutubeVideoAsset.__name__)
from google.ads.googleads.v8 import MediaBundleAsset
expected_names.append(MediaBundleAsset.__name__)
from google.ads.googleads.v8 import ImageAsset
expected_names.append(ImageAsset.__name__)
from google.ads.googleads.v8 import ImageDimension
expected_names.append(ImageDimension.__name__)
from google.ads.googleads.v8 import TextAsset
expected_names.append(TextAsset.__name__)
from google.ads.googleads.v8 import LeadFormAsset
expected_names.append(LeadFormAsset.__name__)
from google.ads.googleads.v8 import LeadFormField
expected_names.append(LeadFormField.__name__)
from google.ads.googleads.v8 import LeadFormSingleChoiceAnswers
expected_names.append(LeadFormSingleChoiceAnswers.__name__)
from google.ads.googleads.v8 import LeadFormDeliveryMethod
expected_names.append(LeadFormDeliveryMethod.__name__)
from google.ads.googleads.v8 import WebhookDelivery
expected_names.append(WebhookDelivery.__name__)
from google.ads.googleads.v8 import BookOnGoogleAsset
expected_names.append(BookOnGoogleAsset.__name__)
from google.ads.googleads.v8 import PromotionAsset
expected_names.append(PromotionAsset.__name__)
from google.ads.googleads.v8 import CalloutAsset
expected_names.append(CalloutAsset.__name__)
from google.ads.googleads.v8 import StructuredSnippetAsset
expected_names.append(StructuredSnippetAsset.__name__)
from google.ads.googleads.v8 import SitelinkAsset
expected_names.append(SitelinkAsset.__name__)
from google.ads.googleads.v8 import TargetImpressionShareLocationEnum
expected_names.append(TargetImpressionShareLocationEnum.__name__)
from google.ads.googleads.v8 import Commission
expected_names.append(Commission.__name__)
from google.ads.googleads.v8 import EnhancedCpc
expected_names.append(EnhancedCpc.__name__)
from google.ads.googleads.v8 import ManualCpc
expected_names.append(ManualCpc.__name__)
from google.ads.googleads.v8 import ManualCpm
expected_names.append(ManualCpm.__name__)
from google.ads.googleads.v8 import ManualCpv
expected_names.append(ManualCpv.__name__)
from google.ads.googleads.v8 import MaximizeConversions
expected_names.append(MaximizeConversions.__name__)
from google.ads.googleads.v8 import MaximizeConversionValue
expected_names.append(MaximizeConversionValue.__name__)
from google.ads.googleads.v8 import TargetCpa
expected_names.append(TargetCpa.__name__)
from google.ads.googleads.v8 import TargetCpm
expected_names.append(TargetCpm.__name__)
from google.ads.googleads.v8 import TargetImpressionShare
expected_names.append(TargetImpressionShare.__name__)
from google.ads.googleads.v8 import TargetRoas
expected_names.append(TargetRoas.__name__)
from google.ads.googleads.v8 import TargetSpend
expected_names.append(TargetSpend.__name__)
from google.ads.googleads.v8 import PercentCpc
expected_names.append(PercentCpc.__name__)
from google.ads.googleads.v8 import ClickLocation
expected_names.append(ClickLocation.__name__)
from google.ads.googleads.v8 import AdvertisingChannelSubTypeEnum
expected_names.append(AdvertisingChannelSubTypeEnum.__name__)
from google.ads.googleads.v8 import AdvertisingChannelTypeEnum
expected_names.append(AdvertisingChannelTypeEnum.__name__)
from google.ads.googleads.v8 import CriterionCategoryChannelAvailabilityModeEnum
expected_names.append(CriterionCategoryChannelAvailabilityModeEnum.__name__)
from google.ads.googleads.v8 import CriterionCategoryLocaleAvailabilityModeEnum
expected_names.append(CriterionCategoryLocaleAvailabilityModeEnum.__name__)
from google.ads.googleads.v8 import CriterionCategoryAvailability
expected_names.append(CriterionCategoryAvailability.__name__)
from google.ads.googleads.v8 import CriterionCategoryChannelAvailability
expected_names.append(CriterionCategoryChannelAvailability.__name__)
from google.ads.googleads.v8 import CriterionCategoryLocaleAvailability
expected_names.append(CriterionCategoryLocaleAvailability.__name__)
from google.ads.googleads.v8 import CustomParameter
expected_names.append(CustomParameter.__name__)
from google.ads.googleads.v8 import MonthOfYearEnum
expected_names.append(MonthOfYearEnum.__name__)
from google.ads.googleads.v8 import DateRange
expected_names.append(DateRange.__name__)
from google.ads.googleads.v8 import YearMonthRange
expected_names.append(YearMonthRange.__name__)
from google.ads.googleads.v8 import YearMonth
expected_names.append(YearMonth.__name__)
from google.ads.googleads.v8 import ExplorerAutoOptimizerSetting
expected_names.append(ExplorerAutoOptimizerSetting.__name__)
from google.ads.googleads.v8 import AppStoreEnum
expected_names.append(AppStoreEnum.__name__)
from google.ads.googleads.v8 import PriceExtensionPriceQualifierEnum
expected_names.append(PriceExtensionPriceQualifierEnum.__name__)
from google.ads.googleads.v8 import PriceExtensionPriceUnitEnum
expected_names.append(PriceExtensionPriceUnitEnum.__name__)
from google.ads.googleads.v8 import PriceExtensionTypeEnum
expected_names.append(PriceExtensionTypeEnum.__name__)
from google.ads.googleads.v8 import AppFeedItem
expected_names.append(AppFeedItem.__name__)
from google.ads.googleads.v8 import CallFeedItem
expected_names.append(CallFeedItem.__name__)
from google.ads.googleads.v8 import CalloutFeedItem
expected_names.append(CalloutFeedItem.__name__)
from google.ads.googleads.v8 import LocationFeedItem
expected_names.append(LocationFeedItem.__name__)
from google.ads.googleads.v8 import AffiliateLocationFeedItem
expected_names.append(AffiliateLocationFeedItem.__name__)
from google.ads.googleads.v8 import TextMessageFeedItem
expected_names.append(TextMessageFeedItem.__name__)
from google.ads.googleads.v8 import PriceFeedItem
expected_names.append(PriceFeedItem.__name__)
from google.ads.googleads.v8 import PriceOffer
expected_names.append(PriceOffer.__name__)
from google.ads.googleads.v8 import PromotionFeedItem
expected_names.append(PromotionFeedItem.__name__)
from google.ads.googleads.v8 import StructuredSnippetFeedItem
expected_names.append(StructuredSnippetFeedItem.__name__)
from google.ads.googleads.v8 import SitelinkFeedItem
expected_names.append(SitelinkFeedItem.__name__)
from google.ads.googleads.v8 import HotelCalloutFeedItem
expected_names.append(HotelCalloutFeedItem.__name__)
from google.ads.googleads.v8 import ImageFeedItem
expected_names.append(ImageFeedItem.__name__)
from google.ads.googleads.v8 import FeedItemSetStringFilterTypeEnum
expected_names.append(FeedItemSetStringFilterTypeEnum.__name__)
from google.ads.googleads.v8 import DynamicLocationSetFilter
expected_names.append(DynamicLocationSetFilter.__name__)
from google.ads.googleads.v8 import BusinessNameFilter
expected_names.append(BusinessNameFilter.__name__)
from google.ads.googleads.v8 import DynamicAffiliateLocationSetFilter
expected_names.append(DynamicAffiliateLocationSetFilter.__name__)
from google.ads.googleads.v8 import AppUrlOperatingSystemTypeEnum
expected_names.append(AppUrlOperatingSystemTypeEnum.__name__)
from google.ads.googleads.v8 import FinalAppUrl
expected_names.append(FinalAppUrl.__name__)
from google.ads.googleads.v8 import FrequencyCapEventTypeEnum
expected_names.append(FrequencyCapEventTypeEnum.__name__)
from google.ads.googleads.v8 import FrequencyCapLevelEnum
expected_names.append(FrequencyCapLevelEnum.__name__)
from google.ads.googleads.v8 import FrequencyCapTimeUnitEnum
expected_names.append(FrequencyCapTimeUnitEnum.__name__)
from google.ads.googleads.v8 import FrequencyCapEntry
expected_names.append(FrequencyCapEntry.__name__)
from google.ads.googleads.v8 import FrequencyCapKey
expected_names.append(FrequencyCapKey.__name__)
from google.ads.googleads.v8 import KeywordPlanAggregateMetricTypeEnum
expected_names.append(KeywordPlanAggregateMetricTypeEnum.__name__)
from google.ads.googleads.v8 import KeywordPlanCompetitionLevelEnum
expected_names.append(KeywordPlanCompetitionLevelEnum.__name__)
from google.ads.googleads.v8 import KeywordPlanConceptGroupTypeEnum
expected_names.append(KeywordPlanConceptGroupTypeEnum.__name__)
from google.ads.googleads.v8 import KeywordPlanHistoricalMetrics
expected_names.append(KeywordPlanHistoricalMetrics.__name__)
from google.ads.googleads.v8 import HistoricalMetricsOptions
expected_names.append(HistoricalMetricsOptions.__name__)
from google.ads.googleads.v8 import MonthlySearchVolume
expected_names.append(MonthlySearchVolume.__name__)
from google.ads.googleads.v8 import KeywordPlanAggregateMetrics
expected_names.append(KeywordPlanAggregateMetrics.__name__)
from google.ads.googleads.v8 import KeywordPlanAggregateMetricResults
expected_names.append(KeywordPlanAggregateMetricResults.__name__)
from google.ads.googleads.v8 import KeywordPlanDeviceSearches
expected_names.append(KeywordPlanDeviceSearches.__name__)
from google.ads.googleads.v8 import KeywordAnnotations
expected_names.append(KeywordAnnotations.__name__)
from google.ads.googleads.v8 import KeywordConcept
expected_names.append(KeywordConcept.__name__)
from google.ads.googleads.v8 import ConceptGroup
expected_names.append(ConceptGroup.__name__)
from google.ads.googleads.v8 import MatchingFunctionContextTypeEnum
expected_names.append(MatchingFunctionContextTypeEnum.__name__)
from google.ads.googleads.v8 import MatchingFunctionOperatorEnum
expected_names.append(MatchingFunctionOperatorEnum.__name__)
from google.ads.googleads.v8 import MatchingFunction
expected_names.append(MatchingFunction.__name__)
from google.ads.googleads.v8 import Operand
expected_names.append(Operand.__name__)
from google.ads.googleads.v8 import InteractionEventTypeEnum
expected_names.append(InteractionEventTypeEnum.__name__)
from google.ads.googleads.v8 import QualityScoreBucketEnum
expected_names.append(QualityScoreBucketEnum.__name__)
from google.ads.googleads.v8 import Metrics
expected_names.append(Metrics.__name__)
from google.ads.googleads.v8 import UserIdentifierSourceEnum
expected_names.append(UserIdentifierSourceEnum.__name__)
from google.ads.googleads.v8 import OfflineUserAddressInfo
expected_names.append(OfflineUserAddressInfo.__name__)
from google.ads.googleads.v8 import UserIdentifier
expected_names.append(UserIdentifier.__name__)
from google.ads.googleads.v8 import TransactionAttribute
expected_names.append(TransactionAttribute.__name__)
from google.ads.googleads.v8 import StoreAttribute
expected_names.append(StoreAttribute.__name__)
from google.ads.googleads.v8 import ItemAttribute
expected_names.append(ItemAttribute.__name__)
from google.ads.googleads.v8 import UserData
expected_names.append(UserData.__name__)
from google.ads.googleads.v8 import UserAttribute
expected_names.append(UserAttribute.__name__)
from google.ads.googleads.v8 import CustomerMatchUserListMetadata
expected_names.append(CustomerMatchUserListMetadata.__name__)
from google.ads.googleads.v8 import StoreSalesMetadata
expected_names.append(StoreSalesMetadata.__name__)
from google.ads.googleads.v8 import StoreSalesThirdPartyMetadata
expected_names.append(StoreSalesThirdPartyMetadata.__name__)
from google.ads.googleads.v8 import RealTimeBiddingSetting
expected_names.append(RealTimeBiddingSetting.__name__)
from google.ads.googleads.v8 import AdDestinationTypeEnum
expected_names.append(AdDestinationTypeEnum.__name__)
from google.ads.googleads.v8 import AdNetworkTypeEnum
expected_names.append(AdNetworkTypeEnum.__name__)
from google.ads.googleads.v8 import BudgetCampaignAssociationStatusEnum
expected_names.append(BudgetCampaignAssociationStatusEnum.__name__)
from google.ads.googleads.v8 import ClickTypeEnum
expected_names.append(ClickTypeEnum.__name__)
from google.ads.googleads.v8 import ConversionActionCategoryEnum
expected_names.append(ConversionActionCategoryEnum.__name__)
from google.ads.googleads.v8 import ConversionAttributionEventTypeEnum
expected_names.append(ConversionAttributionEventTypeEnum.__name__)
from google.ads.googleads.v8 import ConversionLagBucketEnum
expected_names.append(ConversionLagBucketEnum.__name__)
from google.ads.googleads.v8 import ConversionOrAdjustmentLagBucketEnum
expected_names.append(ConversionOrAdjustmentLagBucketEnum.__name__)
from google.ads.googleads.v8 import ExternalConversionSourceEnum
expected_names.append(ExternalConversionSourceEnum.__name__)
from google.ads.googleads.v8 import HotelPriceBucketEnum
expected_names.append(HotelPriceBucketEnum.__name__)
from google.ads.googleads.v8 import HotelRateTypeEnum
expected_names.append(HotelRateTypeEnum.__name__)
from google.ads.googleads.v8 import PlaceholderTypeEnum
expected_names.append(PlaceholderTypeEnum.__name__)
from google.ads.googleads.v8 import RecommendationTypeEnum
expected_names.append(RecommendationTypeEnum.__name__)
from google.ads.googleads.v8 import SearchEngineResultsPageTypeEnum
expected_names.append(SearchEngineResultsPageTypeEnum.__name__)
from google.ads.googleads.v8 import SearchTermMatchTypeEnum
expected_names.append(SearchTermMatchTypeEnum.__name__)
from google.ads.googleads.v8 import SlotEnum
expected_names.append(SlotEnum.__name__)
from google.ads.googleads.v8 import Segments
expected_names.append(Segments.__name__)
from google.ads.googleads.v8 import Keyword
expected_names.append(Keyword.__name__)
from google.ads.googleads.v8 import BudgetCampaignAssociationStatus
expected_names.append(BudgetCampaignAssociationStatus.__name__)
from google.ads.googleads.v8 import AssetInteractionTarget
expected_names.append(AssetInteractionTarget.__name__)
from google.ads.googleads.v8 import BidModifierSimulationPointList
expected_names.append(BidModifierSimulationPointList.__name__)
from google.ads.googleads.v8 import CpcBidSimulationPointList
expected_names.append(CpcBidSimulationPointList.__name__)
from google.ads.googleads.v8 import CpvBidSimulationPointList
expected_names.append(CpvBidSimulationPointList.__name__)
from google.ads.googleads.v8 import TargetCpaSimulationPointList
expected_names.append(TargetCpaSimulationPointList.__name__)
from google.ads.googleads.v8 import TargetRoasSimulationPointList
expected_names.append(TargetRoasSimulationPointList.__name__)
from google.ads.googleads.v8 import PercentCpcBidSimulationPointList
expected_names.append(PercentCpcBidSimulationPointList.__name__)
from google.ads.googleads.v8 import BudgetSimulationPointList
expected_names.append(BudgetSimulationPointList.__name__)
from google.ads.googleads.v8 import TargetImpressionShareSimulationPointList
expected_names.append(TargetImpressionShareSimulationPointList.__name__)
from google.ads.googleads.v8 import BidModifierSimulationPoint
expected_names.append(BidModifierSimulationPoint.__name__)
from google.ads.googleads.v8 import CpcBidSimulationPoint
expected_names.append(CpcBidSimulationPoint.__name__)
from google.ads.googleads.v8 import CpvBidSimulationPoint
expected_names.append(CpvBidSimulationPoint.__name__)
from google.ads.googleads.v8 import TargetCpaSimulationPoint
expected_names.append(TargetCpaSimulationPoint.__name__)
from google.ads.googleads.v8 import TargetRoasSimulationPoint
expected_names.append(TargetRoasSimulationPoint.__name__)
from google.ads.googleads.v8 import PercentCpcBidSimulationPoint
expected_names.append(PercentCpcBidSimulationPoint.__name__)
from google.ads.googleads.v8 import BudgetSimulationPoint
expected_names.append(BudgetSimulationPoint.__name__)
from google.ads.googleads.v8 import TargetImpressionShareSimulationPoint
expected_names.append(TargetImpressionShareSimulationPoint.__name__)
from google.ads.googleads.v8 import TrackingCodePageFormatEnum
expected_names.append(TrackingCodePageFormatEnum.__name__)
from google.ads.googleads.v8 import TrackingCodeTypeEnum
expected_names.append(TrackingCodeTypeEnum.__name__)
from google.ads.googleads.v8 import TagSnippet
expected_names.append(TagSnippet.__name__)
from google.ads.googleads.v8 import TargetingDimensionEnum
expected_names.append(TargetingDimensionEnum.__name__)
from google.ads.googleads.v8 import TargetingSetting
expected_names.append(TargetingSetting.__name__)
from google.ads.googleads.v8 import TargetRestriction
expected_names.append(TargetRestriction.__name__)
from google.ads.googleads.v8 import TargetRestrictionOperation
expected_names.append(TargetRestrictionOperation.__name__)
from google.ads.googleads.v8 import TextLabel
expected_names.append(TextLabel.__name__)
from google.ads.googleads.v8 import UrlCollection
expected_names.append(UrlCollection.__name__)
from google.ads.googleads.v8 import CustomerMatchUploadKeyTypeEnum
expected_names.append(CustomerMatchUploadKeyTypeEnum.__name__)
from google.ads.googleads.v8 import UserListCombinedRuleOperatorEnum
expected_names.append(UserListCombinedRuleOperatorEnum.__name__)
from google.ads.googleads.v8 import UserListCrmDataSourceTypeEnum
expected_names.append(UserListCrmDataSourceTypeEnum.__name__)
from google.ads.googleads.v8 import UserListDateRuleItemOperatorEnum
expected_names.append(UserListDateRuleItemOperatorEnum.__name__)
from google.ads.googleads.v8 import UserListLogicalRuleOperatorEnum
expected_names.append(UserListLogicalRuleOperatorEnum.__name__)
from google.ads.googleads.v8 import UserListNumberRuleItemOperatorEnum
expected_names.append(UserListNumberRuleItemOperatorEnum.__name__)
from google.ads.googleads.v8 import UserListPrepopulationStatusEnum
expected_names.append(UserListPrepopulationStatusEnum.__name__)
from google.ads.googleads.v8 import UserListRuleTypeEnum
expected_names.append(UserListRuleTypeEnum.__name__)
from google.ads.googleads.v8 import UserListStringRuleItemOperatorEnum
expected_names.append(UserListStringRuleItemOperatorEnum.__name__)
from google.ads.googleads.v8 import SimilarUserListInfo
expected_names.append(SimilarUserListInfo.__name__)
from google.ads.googleads.v8 import CrmBasedUserListInfo
expected_names.append(CrmBasedUserListInfo.__name__)
from google.ads.googleads.v8 import UserListRuleInfo
expected_names.append(UserListRuleInfo.__name__)
from google.ads.googleads.v8 import UserListRuleItemGroupInfo
expected_names.append(UserListRuleItemGroupInfo.__name__)
from google.ads.googleads.v8 import UserListRuleItemInfo
expected_names.append(UserListRuleItemInfo.__name__)
from google.ads.googleads.v8 import UserListDateRuleItemInfo
expected_names.append(UserListDateRuleItemInfo.__name__)
from google.ads.googleads.v8 import UserListNumberRuleItemInfo
expected_names.append(UserListNumberRuleItemInfo.__name__)
from google.ads.googleads.v8 import UserListStringRuleItemInfo
expected_names.append(UserListStringRuleItemInfo.__name__)
from google.ads.googleads.v8 import CombinedRuleUserListInfo
expected_names.append(CombinedRuleUserListInfo.__name__)
from google.ads.googleads.v8 import DateSpecificRuleUserListInfo
expected_names.append(DateSpecificRuleUserListInfo.__name__)
from google.ads.googleads.v8 import ExpressionRuleUserListInfo
expected_names.append(ExpressionRuleUserListInfo.__name__)
from google.ads.googleads.v8 import RuleBasedUserListInfo
expected_names.append(RuleBasedUserListInfo.__name__)
from google.ads.googleads.v8 import LogicalUserListInfo
expected_names.append(LogicalUserListInfo.__name__)
from google.ads.googleads.v8 import UserListLogicalRuleInfo
expected_names.append(UserListLogicalRuleInfo.__name__)
from google.ads.googleads.v8 import LogicalUserListOperandInfo
expected_names.append(LogicalUserListOperandInfo.__name__)
from google.ads.googleads.v8 import BasicUserListInfo
expected_names.append(BasicUserListInfo.__name__)
from google.ads.googleads.v8 import UserListActionInfo
expected_names.append(UserListActionInfo.__name__)
from google.ads.googleads.v8 import Value
expected_names.append(Value.__name__)
from google.ads.googleads.v8 import AccessInvitationStatusEnum
expected_names.append(AccessInvitationStatusEnum.__name__)
from google.ads.googleads.v8 import AccessReasonEnum
expected_names.append(AccessReasonEnum.__name__)
from google.ads.googleads.v8 import AccessRoleEnum
expected_names.append(AccessRoleEnum.__name__)
from google.ads.googleads.v8 import AccountBudgetProposalStatusEnum
expected_names.append(AccountBudgetProposalStatusEnum.__name__)
from google.ads.googleads.v8 import AccountBudgetProposalTypeEnum
expected_names.append(AccountBudgetProposalTypeEnum.__name__)
from google.ads.googleads.v8 import AccountBudgetStatusEnum
expected_names.append(AccountBudgetStatusEnum.__name__)
from google.ads.googleads.v8 import AccountLinkStatusEnum
expected_names.append(AccountLinkStatusEnum.__name__)
from google.ads.googleads.v8 import AdCustomizerPlaceholderFieldEnum
expected_names.append(AdCustomizerPlaceholderFieldEnum.__name__)
from google.ads.googleads.v8 import AdGroupAdRotationModeEnum
expected_names.append(AdGroupAdRotationModeEnum.__name__)
from google.ads.googleads.v8 import AdGroupAdStatusEnum
expected_names.append(AdGroupAdStatusEnum.__name__)
from google.ads.googleads.v8 import AdGroupCriterionApprovalStatusEnum
expected_names.append(AdGroupCriterionApprovalStatusEnum.__name__)
from google.ads.googleads.v8 import AdGroupCriterionStatusEnum
expected_names.append(AdGroupCriterionStatusEnum.__name__)
from google.ads.googleads.v8 import AdGroupStatusEnum
expected_names.append(AdGroupStatusEnum.__name__)
from google.ads.googleads.v8 import AdGroupTypeEnum
expected_names.append(AdGroupTypeEnum.__name__)
from google.ads.googleads.v8 import AdServingOptimizationStatusEnum
expected_names.append(AdServingOptimizationStatusEnum.__name__)
from google.ads.googleads.v8 import AdStrengthEnum
expected_names.append(AdStrengthEnum.__name__)
from google.ads.googleads.v8 import AdTypeEnum
expected_names.append(AdTypeEnum.__name__)
from google.ads.googleads.v8 import AffiliateLocationFeedRelationshipTypeEnum
expected_names.append(AffiliateLocationFeedRelationshipTypeEnum.__name__)
from google.ads.googleads.v8 import AffiliateLocationPlaceholderFieldEnum
expected_names.append(AffiliateLocationPlaceholderFieldEnum.__name__)
from google.ads.googleads.v8 import AppCampaignAppStoreEnum
expected_names.append(AppCampaignAppStoreEnum.__name__)
from google.ads.googleads.v8 import AppCampaignBiddingStrategyGoalTypeEnum
expected_names.append(AppCampaignBiddingStrategyGoalTypeEnum.__name__)
from google.ads.googleads.v8 import AppPlaceholderFieldEnum
expected_names.append(AppPlaceholderFieldEnum.__name__)
from google.ads.googleads.v8 import AssetFieldTypeEnum
expected_names.append(AssetFieldTypeEnum.__name__)
from google.ads.googleads.v8 import AssetLinkStatusEnum
expected_names.append(AssetLinkStatusEnum.__name__)
from google.ads.googleads.v8 import AssetTypeEnum
expected_names.append(AssetTypeEnum.__name__)
from google.ads.googleads.v8 import AttributionModelEnum
expected_names.append(AttributionModelEnum.__name__)
from google.ads.googleads.v8 import BatchJobStatusEnum
expected_names.append(BatchJobStatusEnum.__name__)
from google.ads.googleads.v8 import BidModifierSourceEnum
expected_names.append(BidModifierSourceEnum.__name__)
from google.ads.googleads.v8 import BiddingSourceEnum
expected_names.append(BiddingSourceEnum.__name__)
from google.ads.googleads.v8 import BiddingStrategyStatusEnum
expected_names.append(BiddingStrategyStatusEnum.__name__)
from google.ads.googleads.v8 import BiddingStrategyTypeEnum
expected_names.append(BiddingStrategyTypeEnum.__name__)
from google.ads.googleads.v8 import BillingSetupStatusEnum
expected_names.append(BillingSetupStatusEnum.__name__)
from google.ads.googleads.v8 import BrandSafetySuitabilityEnum
expected_names.append(BrandSafetySuitabilityEnum.__name__)
from google.ads.googleads.v8 import BudgetDeliveryMethodEnum
expected_names.append(BudgetDeliveryMethodEnum.__name__)
from google.ads.googleads.v8 import BudgetPeriodEnum
expected_names.append(BudgetPeriodEnum.__name__)
from google.ads.googleads.v8 import BudgetStatusEnum
expected_names.append(BudgetStatusEnum.__name__)
from google.ads.googleads.v8 import BudgetTypeEnum
expected_names.append(BudgetTypeEnum.__name__)
from google.ads.googleads.v8 import CallPlaceholderFieldEnum
expected_names.append(CallPlaceholderFieldEnum.__name__)
from google.ads.googleads.v8 import CallTrackingDisplayLocationEnum
expected_names.append(CallTrackingDisplayLocationEnum.__name__)
from google.ads.googleads.v8 import CallTypeEnum
expected_names.append(CallTypeEnum.__name__)
from google.ads.googleads.v8 import CalloutPlaceholderFieldEnum
expected_names.append(CalloutPlaceholderFieldEnum.__name__)
from google.ads.googleads.v8 import CampaignCriterionStatusEnum
expected_names.append(CampaignCriterionStatusEnum.__name__)
from google.ads.googleads.v8 import CampaignDraftStatusEnum
expected_names.append(CampaignDraftStatusEnum.__name__)
from google.ads.googleads.v8 import CampaignExperimentStatusEnum
expected_names.append(CampaignExperimentStatusEnum.__name__)
from google.ads.googleads.v8 import CampaignExperimentTrafficSplitTypeEnum
expected_names.append(CampaignExperimentTrafficSplitTypeEnum.__name__)
from google.ads.googleads.v8 import CampaignExperimentTypeEnum
expected_names.append(CampaignExperimentTypeEnum.__name__)
from google.ads.googleads.v8 import CampaignServingStatusEnum
expected_names.append(CampaignServingStatusEnum.__name__)
from google.ads.googleads.v8 import CampaignSharedSetStatusEnum
expected_names.append(CampaignSharedSetStatusEnum.__name__)
from google.ads.googleads.v8 import CampaignStatusEnum
expected_names.append(CampaignStatusEnum.__name__)
from google.ads.googleads.v8 import ChangeClientTypeEnum
expected_names.append(ChangeClientTypeEnum.__name__)
from google.ads.googleads.v8 import ChangeEventResourceTypeEnum
expected_names.append(ChangeEventResourceTypeEnum.__name__)
from google.ads.googleads.v8 import ChangeStatusOperationEnum
expected_names.append(ChangeStatusOperationEnum.__name__)
from google.ads.googleads.v8 import ChangeStatusResourceTypeEnum
expected_names.append(ChangeStatusResourceTypeEnum.__name__)
from google.ads.googleads.v8 import CombinedAudienceStatusEnum
expected_names.append(CombinedAudienceStatusEnum.__name__)
from google.ads.googleads.v8 import ConversionActionCountingTypeEnum
expected_names.append(ConversionActionCountingTypeEnum.__name__)
from google.ads.googleads.v8 import ConversionActionStatusEnum
expected_names.append(ConversionActionStatusEnum.__name__)
from google.ads.googleads.v8 import ConversionActionTypeEnum
expected_names.append(ConversionActionTypeEnum.__name__)
from google.ads.googleads.v8 import ConversionAdjustmentTypeEnum
expected_names.append(ConversionAdjustmentTypeEnum.__name__)
from google.ads.googleads.v8 import ConversionCustomVariableStatusEnum
expected_names.append(ConversionCustomVariableStatusEnum.__name__)
from google.ads.googleads.v8 import CriterionSystemServingStatusEnum
expected_names.append(CriterionSystemServingStatusEnum.__name__)
from google.ads.googleads.v8 import CriterionTypeEnum
expected_names.append(CriterionTypeEnum.__name__)
from google.ads.googleads.v8 import CustomAudienceMemberTypeEnum
expected_names.append(CustomAudienceMemberTypeEnum.__name__)
from google.ads.googleads.v8 import CustomAudienceStatusEnum
expected_names.append(CustomAudienceStatusEnum.__name__)
from google.ads.googleads.v8 import CustomAudienceTypeEnum
expected_names.append(CustomAudienceTypeEnum.__name__)
from google.ads.googleads.v8 import CustomInterestMemberTypeEnum
expected_names.append(CustomInterestMemberTypeEnum.__name__)
from google.ads.googleads.v8 import CustomInterestStatusEnum
expected_names.append(CustomInterestStatusEnum.__name__)
from google.ads.googleads.v8 import CustomInterestTypeEnum
expected_names.append(CustomInterestTypeEnum.__name__)
from google.ads.googleads.v8 import CustomPlaceholderFieldEnum
expected_names.append(CustomPlaceholderFieldEnum.__name__)
from google.ads.googleads.v8 import CustomerPayPerConversionEligibilityFailureReasonEnum
expected_names.append(CustomerPayPerConversionEligibilityFailureReasonEnum.__name__)
from google.ads.googleads.v8 import DataDrivenModelStatusEnum
expected_names.append(DataDrivenModelStatusEnum.__name__)
from google.ads.googleads.v8 import DistanceBucketEnum
expected_names.append(DistanceBucketEnum.__name__)
from google.ads.googleads.v8 import DsaPageFeedCriterionFieldEnum
expected_names.append(DsaPageFeedCriterionFieldEnum.__name__)
from google.ads.googleads.v8 import EducationPlaceholderFieldEnum
expected_names.append(EducationPlaceholderFieldEnum.__name__)
from google.ads.googleads.v8 import ExtensionSettingDeviceEnum
expected_names.append(ExtensionSettingDeviceEnum.__name__)
from google.ads.googleads.v8 import ExtensionTypeEnum
expected_names.append(ExtensionTypeEnum.__name__)
from google.ads.googleads.v8 import FeedAttributeTypeEnum
expected_names.append(FeedAttributeTypeEnum.__name__)
from google.ads.googleads.v8 import FeedItemQualityApprovalStatusEnum
expected_names.append(FeedItemQualityApprovalStatusEnum.__name__)
from google.ads.googleads.v8 import FeedItemQualityDisapprovalReasonEnum
expected_names.append(FeedItemQualityDisapprovalReasonEnum.__name__)
from google.ads.googleads.v8 import FeedItemSetStatusEnum
expected_names.append(FeedItemSetStatusEnum.__name__)
from google.ads.googleads.v8 import FeedItemStatusEnum
expected_names.append(FeedItemStatusEnum.__name__)
from google.ads.googleads.v8 import FeedItemTargetDeviceEnum
expected_names.append(FeedItemTargetDeviceEnum.__name__)
from google.ads.googleads.v8 import FeedItemTargetStatusEnum
expected_names.append(FeedItemTargetStatusEnum.__name__)
from google.ads.googleads.v8 import FeedItemTargetTypeEnum
expected_names.append(FeedItemTargetTypeEnum.__name__)
from google.ads.googleads.v8 import FeedItemValidationStatusEnum
expected_names.append(FeedItemValidationStatusEnum.__name__)
from google.ads.googleads.v8 import FeedLinkStatusEnum
expected_names.append(FeedLinkStatusEnum.__name__)
from google.ads.googleads.v8 import FeedMappingCriterionTypeEnum
expected_names.append(FeedMappingCriterionTypeEnum.__name__)
from google.ads.googleads.v8 import FeedMappingStatusEnum
expected_names.append(FeedMappingStatusEnum.__name__)
from google.ads.googleads.v8 import FeedOriginEnum
expected_names.append(FeedOriginEnum.__name__)
from google.ads.googleads.v8 import FeedStatusEnum
expected_names.append(FeedStatusEnum.__name__)
from google.ads.googleads.v8 import FlightPlaceholderFieldEnum
expected_names.append(FlightPlaceholderFieldEnum.__name__)
from google.ads.googleads.v8 import GeoTargetConstantStatusEnum
expected_names.append(GeoTargetConstantStatusEnum.__name__)
from google.ads.googleads.v8 import GeoTargetingRestrictionEnum
expected_names.append(GeoTargetingRestrictionEnum.__name__)
from google.ads.googleads.v8 import GeoTargetingTypeEnum
expected_names.append(GeoTargetingTypeEnum.__name__)
from google.ads.googleads.v8 import GoogleAdsFieldCategoryEnum
expected_names.append(GoogleAdsFieldCategoryEnum.__name__)
from google.ads.googleads.v8 import GoogleAdsFieldDataTypeEnum
expected_names.append(GoogleAdsFieldDataTypeEnum.__name__)
from google.ads.googleads.v8 import GoogleVoiceCallStatusEnum
expected_names.append(GoogleVoiceCallStatusEnum.__name__)
from google.ads.googleads.v8 import HotelPlaceholderFieldEnum
expected_names.append(HotelPlaceholderFieldEnum.__name__)
from google.ads.googleads.v8 import ImagePlaceholderFieldEnum
expected_names.append(ImagePlaceholderFieldEnum.__name__)
from google.ads.googleads.v8 import InvoiceTypeEnum
expected_names.append(InvoiceTypeEnum.__name__)
from google.ads.googleads.v8 import JobPlaceholderFieldEnum
expected_names.append(JobPlaceholderFieldEnum.__name__)
from google.ads.googleads.v8 import KeywordPlanForecastIntervalEnum
expected_names.append(KeywordPlanForecastIntervalEnum.__name__)
from google.ads.googleads.v8 import KeywordPlanKeywordAnnotationEnum
expected_names.append(KeywordPlanKeywordAnnotationEnum.__name__)
from google.ads.googleads.v8 import KeywordPlanNetworkEnum
expected_names.append(KeywordPlanNetworkEnum.__name__)
from google.ads.googleads.v8 import LabelStatusEnum
expected_names.append(LabelStatusEnum.__name__)
from google.ads.googleads.v8 import LinkedAccountTypeEnum
expected_names.append(LinkedAccountTypeEnum.__name__)
from google.ads.googleads.v8 import LocalPlaceholderFieldEnum
expected_names.append(LocalPlaceholderFieldEnum.__name__)
from google.ads.googleads.v8 import LocationExtensionTargetingCriterionFieldEnum
expected_names.append(LocationExtensionTargetingCriterionFieldEnum.__name__)
from google.ads.googleads.v8 import LocationPlaceholderFieldEnum
expected_names.append(LocationPlaceholderFieldEnum.__name__)
from google.ads.googleads.v8 import LocationSourceTypeEnum
expected_names.append(LocationSourceTypeEnum.__name__)
from google.ads.googleads.v8 import ManagerLinkStatusEnum
expected_names.append(ManagerLinkStatusEnum.__name__)
from google.ads.googleads.v8 import MediaTypeEnum
expected_names.append(MediaTypeEnum.__name__)
from google.ads.googleads.v8 import MerchantCenterLinkStatusEnum
expected_names.append(MerchantCenterLinkStatusEnum.__name__)
from google.ads.googleads.v8 import MessagePlaceholderFieldEnum
expected_names.append(MessagePlaceholderFieldEnum.__name__)
from google.ads.googleads.v8 import MobileAppVendorEnum
expected_names.append(MobileAppVendorEnum.__name__)
from google.ads.googleads.v8 import MobileDeviceTypeEnum
expected_names.append(MobileDeviceTypeEnum.__name__)
from google.ads.googleads.v8 import NegativeGeoTargetTypeEnum
expected_names.append(NegativeGeoTargetTypeEnum.__name__)
from google.ads.googleads.v8 import OfflineUserDataJobFailureReasonEnum
expected_names.append(OfflineUserDataJobFailureReasonEnum.__name__)
from google.ads.googleads.v8 import OfflineUserDataJobStatusEnum
expected_names.append(OfflineUserDataJobStatusEnum.__name__)
from google.ads.googleads.v8 import OfflineUserDataJobTypeEnum
expected_names.append(OfflineUserDataJobTypeEnum.__name__)
from google.ads.googleads.v8 import OperatingSystemVersionOperatorTypeEnum
expected_names.append(OperatingSystemVersionOperatorTypeEnum.__name__)
from google.ads.googleads.v8 import OptimizationGoalTypeEnum
expected_names.append(OptimizationGoalTypeEnum.__name__)
from google.ads.googleads.v8 import PaymentModeEnum
expected_names.append(PaymentModeEnum.__name__)
from google.ads.googleads.v8 import PlacementTypeEnum
expected_names.append(PlacementTypeEnum.__name__)
from google.ads.googleads.v8 import PositiveGeoTargetTypeEnum
expected_names.append(PositiveGeoTargetTypeEnum.__name__)
from google.ads.googleads.v8 import PricePlaceholderFieldEnum
expected_names.append(PricePlaceholderFieldEnum.__name__)
from google.ads.googleads.v8 import ProductBiddingCategoryStatusEnum
expected_names.append(ProductBiddingCategoryStatusEnum.__name__)
from google.ads.googleads.v8 import PromotionPlaceholderFieldEnum
expected_names.append(PromotionPlaceholderFieldEnum.__name__)
from google.ads.googleads.v8 import ReachPlanAdLengthEnum
expected_names.append(ReachPlanAdLengthEnum.__name__)
from google.ads.googleads.v8 import ReachPlanAgeRangeEnum
expected_names.append(ReachPlanAgeRangeEnum.__name__)
from google.ads.googleads.v8 import ReachPlanNetworkEnum
expected_names.append(ReachPlanNetworkEnum.__name__)
from google.ads.googleads.v8 import RealEstatePlaceholderFieldEnum
expected_names.append(RealEstatePlaceholderFieldEnum.__name__)
from google.ads.googleads.v8 import ResourceChangeOperationEnum
expected_names.append(ResourceChangeOperationEnum.__name__)
from google.ads.googleads.v8 import ResourceLimitTypeEnum
expected_names.append(ResourceLimitTypeEnum.__name__)
from google.ads.googleads.v8 import ResponseContentTypeEnum
expected_names.append(ResponseContentTypeEnum.__name__)
from google.ads.googleads.v8 import SearchTermTargetingStatusEnum
expected_names.append(SearchTermTargetingStatusEnum.__name__)
from google.ads.googleads.v8 import SharedSetStatusEnum
expected_names.append(SharedSetStatusEnum.__name__)
from google.ads.googleads.v8 import SharedSetTypeEnum
expected_names.append(SharedSetTypeEnum.__name__)
from google.ads.googleads.v8 import SimulationModificationMethodEnum
expected_names.append(SimulationModificationMethodEnum.__name__)
from google.ads.googleads.v8 import SimulationTypeEnum
expected_names.append(SimulationTypeEnum.__name__)
from google.ads.googleads.v8 import SitelinkPlaceholderFieldEnum
expected_names.append(SitelinkPlaceholderFieldEnum.__name__)
from google.ads.googleads.v8 import SpendingLimitTypeEnum
expected_names.append(SpendingLimitTypeEnum.__name__)
from google.ads.googleads.v8 import StructuredSnippetPlaceholderFieldEnum
expected_names.append(StructuredSnippetPlaceholderFieldEnum.__name__)
from google.ads.googleads.v8 import SummaryRowSettingEnum
expected_names.append(SummaryRowSettingEnum.__name__)
from google.ads.googleads.v8 import SystemManagedResourceSourceEnum
expected_names.append(SystemManagedResourceSourceEnum.__name__)
from google.ads.googleads.v8 import TargetCpaOptInRecommendationGoalEnum
expected_names.append(TargetCpaOptInRecommendationGoalEnum.__name__)
from google.ads.googleads.v8 import TimeTypeEnum
expected_names.append(TimeTypeEnum.__name__)
from google.ads.googleads.v8 import TravelPlaceholderFieldEnum
expected_names.append(TravelPlaceholderFieldEnum.__name__)
from google.ads.googleads.v8 import UserInterestTaxonomyTypeEnum
expected_names.append(UserInterestTaxonomyTypeEnum.__name__)
from google.ads.googleads.v8 import UserListAccessStatusEnum
expected_names.append(UserListAccessStatusEnum.__name__)
from google.ads.googleads.v8 import UserListClosingReasonEnum
expected_names.append(UserListClosingReasonEnum.__name__)
from google.ads.googleads.v8 import UserListMembershipStatusEnum
expected_names.append(UserListMembershipStatusEnum.__name__)
from google.ads.googleads.v8 import UserListSizeRangeEnum
expected_names.append(UserListSizeRangeEnum.__name__)
from google.ads.googleads.v8 import UserListTypeEnum
expected_names.append(UserListTypeEnum.__name__)
from google.ads.googleads.v8 import VanityPharmaDisplayUrlModeEnum
expected_names.append(VanityPharmaDisplayUrlModeEnum.__name__)
from google.ads.googleads.v8 import VanityPharmaTextEnum
expected_names.append(VanityPharmaTextEnum.__name__)
from google.ads.googleads.v8 import AccessInvitationErrorEnum
expected_names.append(AccessInvitationErrorEnum.__name__)
from google.ads.googleads.v8 import AccountBudgetProposalErrorEnum
expected_names.append(AccountBudgetProposalErrorEnum.__name__)
from google.ads.googleads.v8 import AccountLinkErrorEnum
expected_names.append(AccountLinkErrorEnum.__name__)
from google.ads.googleads.v8 import AdCustomizerErrorEnum
expected_names.append(AdCustomizerErrorEnum.__name__)
from google.ads.googleads.v8 import AdErrorEnum
expected_names.append(AdErrorEnum.__name__)
from google.ads.googleads.v8 import AdGroupAdErrorEnum
expected_names.append(AdGroupAdErrorEnum.__name__)
from google.ads.googleads.v8 import AdGroupBidModifierErrorEnum
expected_names.append(AdGroupBidModifierErrorEnum.__name__)
from google.ads.googleads.v8 import AdGroupCriterionErrorEnum
expected_names.append(AdGroupCriterionErrorEnum.__name__)
from google.ads.googleads.v8 import AdGroupErrorEnum
expected_names.append(AdGroupErrorEnum.__name__)
from google.ads.googleads.v8 import AdGroupFeedErrorEnum
expected_names.append(AdGroupFeedErrorEnum.__name__)
from google.ads.googleads.v8 import AdParameterErrorEnum
expected_names.append(AdParameterErrorEnum.__name__)
from google.ads.googleads.v8 import AdSharingErrorEnum
expected_names.append(AdSharingErrorEnum.__name__)
from google.ads.googleads.v8 import AdxErrorEnum
expected_names.append(AdxErrorEnum.__name__)
from google.ads.googleads.v8 import AssetErrorEnum
expected_names.append(AssetErrorEnum.__name__)
from google.ads.googleads.v8 import AssetLinkErrorEnum
expected_names.append(AssetLinkErrorEnum.__name__)
from google.ads.googleads.v8 import AuthenticationErrorEnum
expected_names.append(AuthenticationErrorEnum.__name__)
from google.ads.googleads.v8 import AuthorizationErrorEnum
expected_names.append(AuthorizationErrorEnum.__name__)
from google.ads.googleads.v8 import BatchJobErrorEnum
expected_names.append(BatchJobErrorEnum.__name__)
from google.ads.googleads.v8 import BiddingErrorEnum
expected_names.append(BiddingErrorEnum.__name__)
from google.ads.googleads.v8 import BiddingStrategyErrorEnum
expected_names.append(BiddingStrategyErrorEnum.__name__)
from google.ads.googleads.v8 import BillingSetupErrorEnum
expected_names.append(BillingSetupErrorEnum.__name__)
from google.ads.googleads.v8 import CampaignBudgetErrorEnum
expected_names.append(CampaignBudgetErrorEnum.__name__)
from google.ads.googleads.v8 import CampaignCriterionErrorEnum
expected_names.append(CampaignCriterionErrorEnum.__name__)
from google.ads.googleads.v8 import CampaignDraftErrorEnum
expected_names.append(CampaignDraftErrorEnum.__name__)
from google.ads.googleads.v8 import CampaignErrorEnum
expected_names.append(CampaignErrorEnum.__name__)
from google.ads.googleads.v8 import CampaignExperimentErrorEnum
expected_names.append(CampaignExperimentErrorEnum.__name__)
from google.ads.googleads.v8 import CampaignFeedErrorEnum
expected_names.append(CampaignFeedErrorEnum.__name__)
from google.ads.googleads.v8 import CampaignSharedSetErrorEnum
expected_names.append(CampaignSharedSetErrorEnum.__name__)
from google.ads.googleads.v8 import ChangeEventErrorEnum
expected_names.append(ChangeEventErrorEnum.__name__)
from google.ads.googleads.v8 import ChangeStatusErrorEnum
expected_names.append(ChangeStatusErrorEnum.__name__)
from google.ads.googleads.v8 import CollectionSizeErrorEnum
expected_names.append(CollectionSizeErrorEnum.__name__)
from google.ads.googleads.v8 import ContextErrorEnum
expected_names.append(ContextErrorEnum.__name__)
from google.ads.googleads.v8 import ConversionActionErrorEnum
expected_names.append(ConversionActionErrorEnum.__name__)
from google.ads.googleads.v8 import ConversionAdjustmentUploadErrorEnum
expected_names.append(ConversionAdjustmentUploadErrorEnum.__name__)
from google.ads.googleads.v8 import ConversionCustomVariableErrorEnum
expected_names.append(ConversionCustomVariableErrorEnum.__name__)
from google.ads.googleads.v8 import ConversionUploadErrorEnum
expected_names.append(ConversionUploadErrorEnum.__name__)
from google.ads.googleads.v8 import CountryCodeErrorEnum
expected_names.append(CountryCodeErrorEnum.__name__)
from google.ads.googleads.v8 import CriterionErrorEnum
expected_names.append(CriterionErrorEnum.__name__)
from google.ads.googleads.v8 import CurrencyCodeErrorEnum
expected_names.append(CurrencyCodeErrorEnum.__name__)
from google.ads.googleads.v8 import CustomAudienceErrorEnum
expected_names.append(CustomAudienceErrorEnum.__name__)
from google.ads.googleads.v8 import CustomInterestErrorEnum
expected_names.append(CustomInterestErrorEnum.__name__)
from google.ads.googleads.v8 import CustomerClientLinkErrorEnum
expected_names.append(CustomerClientLinkErrorEnum.__name__)
from google.ads.googleads.v8 import CustomerErrorEnum
expected_names.append(CustomerErrorEnum.__name__)
from google.ads.googleads.v8 import CustomerFeedErrorEnum
expected_names.append(CustomerFeedErrorEnum.__name__)
from google.ads.googleads.v8 import CustomerManagerLinkErrorEnum
expected_names.append(CustomerManagerLinkErrorEnum.__name__)
from google.ads.googleads.v8 import CustomerUserAccessErrorEnum
expected_names.append(CustomerUserAccessErrorEnum.__name__)
from google.ads.googleads.v8 import DatabaseErrorEnum
expected_names.append(DatabaseErrorEnum.__name__)
from google.ads.googleads.v8 import DateErrorEnum
expected_names.append(DateErrorEnum.__name__)
from google.ads.googleads.v8 import DateRangeErrorEnum
expected_names.append(DateRangeErrorEnum.__name__)
from google.ads.googleads.v8 import DistinctErrorEnum
expected_names.append(DistinctErrorEnum.__name__)
from google.ads.googleads.v8 import EnumErrorEnum
expected_names.append(EnumErrorEnum.__name__)
from google.ads.googleads.v8 import ExtensionFeedItemErrorEnum
expected_names.append(ExtensionFeedItemErrorEnum.__name__)
from google.ads.googleads.v8 import ExtensionSettingErrorEnum
expected_names.append(ExtensionSettingErrorEnum.__name__)
from google.ads.googleads.v8 import FeedAttributeReferenceErrorEnum
expected_names.append(FeedAttributeReferenceErrorEnum.__name__)
from google.ads.googleads.v8 import FeedErrorEnum
expected_names.append(FeedErrorEnum.__name__)
from google.ads.googleads.v8 import FeedItemErrorEnum
expected_names.append(FeedItemErrorEnum.__name__)
from google.ads.googleads.v8 import FeedItemSetErrorEnum
expected_names.append(FeedItemSetErrorEnum.__name__)
from google.ads.googleads.v8 import FeedItemSetLinkErrorEnum
expected_names.append(FeedItemSetLinkErrorEnum.__name__)
from google.ads.googleads.v8 import FeedItemTargetErrorEnum
expected_names.append(FeedItemTargetErrorEnum.__name__)
from google.ads.googleads.v8 import FeedItemValidationErrorEnum
expected_names.append(FeedItemValidationErrorEnum.__name__)
from google.ads.googleads.v8 import FeedMappingErrorEnum
expected_names.append(FeedMappingErrorEnum.__name__)
from google.ads.googleads.v8 import FieldErrorEnum
expected_names.append(FieldErrorEnum.__name__)
from google.ads.googleads.v8 import FieldMaskErrorEnum
expected_names.append(FieldMaskErrorEnum.__name__)
from google.ads.googleads.v8 import FunctionErrorEnum
expected_names.append(FunctionErrorEnum.__name__)
from google.ads.googleads.v8 import FunctionParsingErrorEnum
expected_names.append(FunctionParsingErrorEnum.__name__)
from google.ads.googleads.v8 import GeoTargetConstantSuggestionErrorEnum
expected_names.append(GeoTargetConstantSuggestionErrorEnum.__name__)
from google.ads.googleads.v8 import HeaderErrorEnum
expected_names.append(HeaderErrorEnum.__name__)
from google.ads.googleads.v8 import IdErrorEnum
expected_names.append(IdErrorEnum.__name__)
from google.ads.googleads.v8 import ImageErrorEnum
expected_names.append(ImageErrorEnum.__name__)
from google.ads.googleads.v8 import InternalErrorEnum
expected_names.append(InternalErrorEnum.__name__)
from google.ads.googleads.v8 import InvoiceErrorEnum
expected_names.append(InvoiceErrorEnum.__name__)
from google.ads.googleads.v8 import KeywordPlanAdGroupErrorEnum
expected_names.append(KeywordPlanAdGroupErrorEnum.__name__)
from google.ads.googleads.v8 import KeywordPlanAdGroupKeywordErrorEnum
expected_names.append(KeywordPlanAdGroupKeywordErrorEnum.__name__)
from google.ads.googleads.v8 import KeywordPlanCampaignErrorEnum
expected_names.append(KeywordPlanCampaignErrorEnum.__name__)
from google.ads.googleads.v8 import KeywordPlanCampaignKeywordErrorEnum
expected_names.append(KeywordPlanCampaignKeywordErrorEnum.__name__)
from google.ads.googleads.v8 import KeywordPlanErrorEnum
expected_names.append(KeywordPlanErrorEnum.__name__)
from google.ads.googleads.v8 import KeywordPlanIdeaErrorEnum
expected_names.append(KeywordPlanIdeaErrorEnum.__name__)
from google.ads.googleads.v8 import LabelErrorEnum
expected_names.append(LabelErrorEnum.__name__)
from google.ads.googleads.v8 import LanguageCodeErrorEnum
expected_names.append(LanguageCodeErrorEnum.__name__)
from google.ads.googleads.v8 import ListOperationErrorEnum
expected_names.append(ListOperationErrorEnum.__name__)
from google.ads.googleads.v8 import ManagerLinkErrorEnum
expected_names.append(ManagerLinkErrorEnum.__name__)
from google.ads.googleads.v8 import MediaBundleErrorEnum
expected_names.append(MediaBundleErrorEnum.__name__)
from google.ads.googleads.v8 import MediaFileErrorEnum
expected_names.append(MediaFileErrorEnum.__name__)
from google.ads.googleads.v8 import MediaUploadErrorEnum
expected_names.append(MediaUploadErrorEnum.__name__)
from google.ads.googleads.v8 import MultiplierErrorEnum
expected_names.append(MultiplierErrorEnum.__name__)
from google.ads.googleads.v8 import MutateErrorEnum
expected_names.append(MutateErrorEnum.__name__)
from google.ads.googleads.v8 import NewResourceCreationErrorEnum
expected_names.append(NewResourceCreationErrorEnum.__name__)
from google.ads.googleads.v8 import NotAllowlistedErrorEnum
expected_names.append(NotAllowlistedErrorEnum.__name__)
from google.ads.googleads.v8 import NotEmptyErrorEnum
expected_names.append(NotEmptyErrorEnum.__name__)
from google.ads.googleads.v8 import NullErrorEnum
expected_names.append(NullErrorEnum.__name__)
from google.ads.googleads.v8 import OfflineUserDataJobErrorEnum
expected_names.append(OfflineUserDataJobErrorEnum.__name__)
from google.ads.googleads.v8 import OperationAccessDeniedErrorEnum
expected_names.append(OperationAccessDeniedErrorEnum.__name__)
from google.ads.googleads.v8 import OperatorErrorEnum
expected_names.append(OperatorErrorEnum.__name__)
from google.ads.googleads.v8 import PartialFailureErrorEnum
expected_names.append(PartialFailureErrorEnum.__name__)
from google.ads.googleads.v8 import PaymentsAccountErrorEnum
expected_names.append(PaymentsAccountErrorEnum.__name__)
from google.ads.googleads.v8 import PolicyFindingErrorEnum
expected_names.append(PolicyFindingErrorEnum.__name__)
from google.ads.googleads.v8 import PolicyValidationParameterErrorEnum
expected_names.append(PolicyValidationParameterErrorEnum.__name__)
from google.ads.googleads.v8 import PolicyViolationErrorEnum
expected_names.append(PolicyViolationErrorEnum.__name__)
from google.ads.googleads.v8 import QueryErrorEnum
expected_names.append(QueryErrorEnum.__name__)
from google.ads.googleads.v8 import QuotaErrorEnum
expected_names.append(QuotaErrorEnum.__name__)
from google.ads.googleads.v8 import RangeErrorEnum
expected_names.append(RangeErrorEnum.__name__)
from google.ads.googleads.v8 import ReachPlanErrorEnum
expected_names.append(ReachPlanErrorEnum.__name__)
from google.ads.googleads.v8 import RecommendationErrorEnum
expected_names.append(RecommendationErrorEnum.__name__)
from google.ads.googleads.v8 import RegionCodeErrorEnum
expected_names.append(RegionCodeErrorEnum.__name__)
from google.ads.googleads.v8 import RequestErrorEnum
expected_names.append(RequestErrorEnum.__name__)
from google.ads.googleads.v8 import ResourceAccessDeniedErrorEnum
expected_names.append(ResourceAccessDeniedErrorEnum.__name__)
from google.ads.googleads.v8 import ResourceCountLimitExceededErrorEnum
expected_names.append(ResourceCountLimitExceededErrorEnum.__name__)
from google.ads.googleads.v8 import SettingErrorEnum
expected_names.append(SettingErrorEnum.__name__)
from google.ads.googleads.v8 import SharedCriterionErrorEnum
expected_names.append(SharedCriterionErrorEnum.__name__)
from google.ads.googleads.v8 import SharedSetErrorEnum
expected_names.append(SharedSetErrorEnum.__name__)
from google.ads.googleads.v8 import SizeLimitErrorEnum
expected_names.append(SizeLimitErrorEnum.__name__)
from google.ads.googleads.v8 import StringFormatErrorEnum
expected_names.append(StringFormatErrorEnum.__name__)
from google.ads.googleads.v8 import StringLengthErrorEnum
expected_names.append(StringLengthErrorEnum.__name__)
from google.ads.googleads.v8 import ThirdPartyAppAnalyticsLinkErrorEnum
expected_names.append(ThirdPartyAppAnalyticsLinkErrorEnum.__name__)
from google.ads.googleads.v8 import TimeZoneErrorEnum
expected_names.append(TimeZoneErrorEnum.__name__)
from google.ads.googleads.v8 import UrlFieldErrorEnum
expected_names.append(UrlFieldErrorEnum.__name__)
from google.ads.googleads.v8 import UserDataErrorEnum
expected_names.append(UserDataErrorEnum.__name__)
from google.ads.googleads.v8 import UserListErrorEnum
expected_names.append(UserListErrorEnum.__name__)
from google.ads.googleads.v8 import YoutubeVideoRegistrationErrorEnum
expected_names.append(YoutubeVideoRegistrationErrorEnum.__name__)
from google.ads.googleads.v8 import GoogleAdsFailure
expected_names.append(GoogleAdsFailure.__name__)
from google.ads.googleads.v8 import GoogleAdsError
expected_names.append(GoogleAdsError.__name__)
from google.ads.googleads.v8 import ErrorCode
expected_names.append(ErrorCode.__name__)
from google.ads.googleads.v8 import ErrorLocation
expected_names.append(ErrorLocation.__name__)
from google.ads.googleads.v8 import ErrorDetails
expected_names.append(ErrorDetails.__name__)
from google.ads.googleads.v8 import PolicyViolationDetails
expected_names.append(PolicyViolationDetails.__name__)
from google.ads.googleads.v8 import PolicyFindingDetails
expected_names.append(PolicyFindingDetails.__name__)
from google.ads.googleads.v8 import QuotaErrorDetails
expected_names.append(QuotaErrorDetails.__name__)
from google.ads.googleads.v8 import ResourceCountDetails
expected_names.append(ResourceCountDetails.__name__)
from google.ads.googleads.v8 import AccessibleBiddingStrategy
expected_names.append(AccessibleBiddingStrategy.__name__)
from google.ads.googleads.v8 import AccountBudget
expected_names.append(AccountBudget.__name__)
from google.ads.googleads.v8 import AccountBudgetProposal
expected_names.append(AccountBudgetProposal.__name__)
from google.ads.googleads.v8 import AccountLink
expected_names.append(AccountLink.__name__)
from google.ads.googleads.v8 import ThirdPartyAppAnalyticsLinkIdentifier
expected_names.append(ThirdPartyAppAnalyticsLinkIdentifier.__name__)
from google.ads.googleads.v8 import DataPartnerLinkIdentifier
expected_names.append(DataPartnerLinkIdentifier.__name__)
from google.ads.googleads.v8 import GoogleAdsLinkIdentifier
expected_names.append(GoogleAdsLinkIdentifier.__name__)
from google.ads.googleads.v8 import Ad
expected_names.append(Ad.__name__)
from google.ads.googleads.v8 import AdGroup
expected_names.append(AdGroup.__name__)
from google.ads.googleads.v8 import AdGroupAd
expected_names.append(AdGroupAd.__name__)
from google.ads.googleads.v8 import AdGroupAdPolicySummary
expected_names.append(AdGroupAdPolicySummary.__name__)
from google.ads.googleads.v8 import AdGroupAdAssetView
expected_names.append(AdGroupAdAssetView.__name__)
from google.ads.googleads.v8 import AdGroupAdAssetPolicySummary
expected_names.append(AdGroupAdAssetPolicySummary.__name__)
from google.ads.googleads.v8 import AdGroupAdLabel
expected_names.append(AdGroupAdLabel.__name__)
from google.ads.googleads.v8 import AdGroupAsset
expected_names.append(AdGroupAsset.__name__)
from google.ads.googleads.v8 import AdGroupAudienceView
expected_names.append(AdGroupAudienceView.__name__)
from google.ads.googleads.v8 import AdGroupBidModifier
expected_names.append(AdGroupBidModifier.__name__)
from google.ads.googleads.v8 import AdGroupCriterion
expected_names.append(AdGroupCriterion.__name__)
from google.ads.googleads.v8 import AdGroupCriterionLabel
expected_names.append(AdGroupCriterionLabel.__name__)
from google.ads.googleads.v8 import AdGroupCriterionSimulation
expected_names.append(AdGroupCriterionSimulation.__name__)
from google.ads.googleads.v8 import AdGroupExtensionSetting
expected_names.append(AdGroupExtensionSetting.__name__)
from google.ads.googleads.v8 import AdGroupFeed
expected_names.append(AdGroupFeed.__name__)
from google.ads.googleads.v8 import AdGroupLabel
expected_names.append(AdGroupLabel.__name__)
from google.ads.googleads.v8 import AdGroupSimulation
expected_names.append(AdGroupSimulation.__name__)
from google.ads.googleads.v8 import AdParameter
expected_names.append(AdParameter.__name__)
from google.ads.googleads.v8 import AdScheduleView
expected_names.append(AdScheduleView.__name__)
from google.ads.googleads.v8 import AgeRangeView
expected_names.append(AgeRangeView.__name__)
from google.ads.googleads.v8 import Asset
expected_names.append(Asset.__name__)
from google.ads.googleads.v8 import AssetPolicySummary
expected_names.append(AssetPolicySummary.__name__)
from google.ads.googleads.v8 import AssetFieldTypeView
expected_names.append(AssetFieldTypeView.__name__)
from google.ads.googleads.v8 import BatchJob
expected_names.append(BatchJob.__name__)
from google.ads.googleads.v8 import BiddingStrategy
expected_names.append(BiddingStrategy.__name__)
from google.ads.googleads.v8 import BiddingStrategySimulation
expected_names.append(BiddingStrategySimulation.__name__)
from google.ads.googleads.v8 import BillingSetup
expected_names.append(BillingSetup.__name__)
from google.ads.googleads.v8 import CallView
expected_names.append(CallView.__name__)
from google.ads.googleads.v8 import Campaign
expected_names.append(Campaign.__name__)
from google.ads.googleads.v8 import CampaignAsset
expected_names.append(CampaignAsset.__name__)
from google.ads.googleads.v8 import CampaignAudienceView
expected_names.append(CampaignAudienceView.__name__)
from google.ads.googleads.v8 import CampaignBidModifier
expected_names.append(CampaignBidModifier.__name__)
from google.ads.googleads.v8 import CampaignBudget
expected_names.append(CampaignBudget.__name__)
from google.ads.googleads.v8 import CampaignCriterion
expected_names.append(CampaignCriterion.__name__)
from google.ads.googleads.v8 import CampaignCriterionSimulation
expected_names.append(CampaignCriterionSimulation.__name__)
from google.ads.googleads.v8 import CampaignDraft
expected_names.append(CampaignDraft.__name__)
from google.ads.googleads.v8 import CampaignExperiment
expected_names.append(CampaignExperiment.__name__)
from google.ads.googleads.v8 import CampaignExtensionSetting
expected_names.append(CampaignExtensionSetting.__name__)
from google.ads.googleads.v8 import CampaignFeed
expected_names.append(CampaignFeed.__name__)
from google.ads.googleads.v8 import CampaignLabel
expected_names.append(CampaignLabel.__name__)
from google.ads.googleads.v8 import CampaignSharedSet
expected_names.append(CampaignSharedSet.__name__)
from google.ads.googleads.v8 import CampaignSimulation
expected_names.append(CampaignSimulation.__name__)
from google.ads.googleads.v8 import CarrierConstant
expected_names.append(CarrierConstant.__name__)
from google.ads.googleads.v8 import Feed
expected_names.append(Feed.__name__)
from google.ads.googleads.v8 import FeedAttribute
expected_names.append(FeedAttribute.__name__)
from google.ads.googleads.v8 import FeedAttributeOperation
expected_names.append(FeedAttributeOperation.__name__)
from google.ads.googleads.v8 import FeedItem
expected_names.append(FeedItem.__name__)
from google.ads.googleads.v8 import FeedItemAttributeValue
expected_names.append(FeedItemAttributeValue.__name__)
from google.ads.googleads.v8 import FeedItemPlaceholderPolicyInfo
expected_names.append(FeedItemPlaceholderPolicyInfo.__name__)
from google.ads.googleads.v8 import FeedItemValidationError
expected_names.append(FeedItemValidationError.__name__)
from google.ads.googleads.v8 import ChangeEvent
expected_names.append(ChangeEvent.__name__)
from google.ads.googleads.v8 import ChangeStatus
expected_names.append(ChangeStatus.__name__)
from google.ads.googleads.v8 import ClickView
expected_names.append(ClickView.__name__)
from google.ads.googleads.v8 import CombinedAudience
expected_names.append(CombinedAudience.__name__)
from google.ads.googleads.v8 import ConversionAction
expected_names.append(ConversionAction.__name__)
from google.ads.googleads.v8 import ConversionCustomVariable
expected_names.append(ConversionCustomVariable.__name__)
from google.ads.googleads.v8 import CurrencyConstant
expected_names.append(CurrencyConstant.__name__)
from google.ads.googleads.v8 import CustomAudience
expected_names.append(CustomAudience.__name__)
from google.ads.googleads.v8 import CustomAudienceMember
expected_names.append(CustomAudienceMember.__name__)
from google.ads.googleads.v8 import CustomInterest
expected_names.append(CustomInterest.__name__)
from google.ads.googleads.v8 import CustomInterestMember
expected_names.append(CustomInterestMember.__name__)
from google.ads.googleads.v8 import Customer
expected_names.append(Customer.__name__)
from google.ads.googleads.v8 import CallReportingSetting
expected_names.append(CallReportingSetting.__name__)
from google.ads.googleads.v8 import ConversionTrackingSetting
expected_names.append(ConversionTrackingSetting.__name__)
from google.ads.googleads.v8 import RemarketingSetting
expected_names.append(RemarketingSetting.__name__)
from google.ads.googleads.v8 import CustomerAsset
expected_names.append(CustomerAsset.__name__)
from google.ads.googleads.v8 import CustomerClient
expected_names.append(CustomerClient.__name__)
from google.ads.googleads.v8 import CustomerClientLink
expected_names.append(CustomerClientLink.__name__)
from google.ads.googleads.v8 import CustomerExtensionSetting
expected_names.append(CustomerExtensionSetting.__name__)
from google.ads.googleads.v8 import CustomerFeed
expected_names.append(CustomerFeed.__name__)
from google.ads.googleads.v8 import CustomerLabel
expected_names.append(CustomerLabel.__name__)
from google.ads.googleads.v8 import CustomerManagerLink
expected_names.append(CustomerManagerLink.__name__)
from google.ads.googleads.v8 import CustomerNegativeCriterion
expected_names.append(CustomerNegativeCriterion.__name__)
from google.ads.googleads.v8 import CustomerUserAccess
expected_names.append(CustomerUserAccess.__name__)
from google.ads.googleads.v8 import CustomerUserAccessInvitation
expected_names.append(CustomerUserAccessInvitation.__name__)
from google.ads.googleads.v8 import DetailPlacementView
expected_names.append(DetailPlacementView.__name__)
from google.ads.googleads.v8 import DetailedDemographic
expected_names.append(DetailedDemographic.__name__)
from google.ads.googleads.v8 import DisplayKeywordView
expected_names.append(DisplayKeywordView.__name__)
from google.ads.googleads.v8 import DistanceView
expected_names.append(DistanceView.__name__)
from google.ads.googleads.v8 import DomainCategory
expected_names.append(DomainCategory.__name__)
from google.ads.googleads.v8 import DynamicSearchAdsSearchTermView
expected_names.append(DynamicSearchAdsSearchTermView.__name__)
from google.ads.googleads.v8 import ExpandedLandingPageView
expected_names.append(ExpandedLandingPageView.__name__)
from google.ads.googleads.v8 import ExtensionFeedItem
expected_names.append(ExtensionFeedItem.__name__)
from google.ads.googleads.v8 import FeedItemSet
expected_names.append(FeedItemSet.__name__)
from google.ads.googleads.v8 import FeedItemSetLink
expected_names.append(FeedItemSetLink.__name__)
from google.ads.googleads.v8 import FeedItemTarget
expected_names.append(FeedItemTarget.__name__)
from google.ads.googleads.v8 import FeedMapping
expected_names.append(FeedMapping.__name__)
from google.ads.googleads.v8 import AttributeFieldMapping
expected_names.append(AttributeFieldMapping.__name__)
from google.ads.googleads.v8 import FeedPlaceholderView
expected_names.append(FeedPlaceholderView.__name__)
from google.ads.googleads.v8 import GenderView
expected_names.append(GenderView.__name__)
from google.ads.googleads.v8 import GeoTargetConstant
expected_names.append(GeoTargetConstant.__name__)
from google.ads.googleads.v8 import GeographicView
expected_names.append(GeographicView.__name__)
from google.ads.googleads.v8 import GoogleAdsField
expected_names.append(GoogleAdsField.__name__)
from google.ads.googleads.v8 import GroupPlacementView
expected_names.append(GroupPlacementView.__name__)
from google.ads.googleads.v8 import HotelGroupView
expected_names.append(HotelGroupView.__name__)
from google.ads.googleads.v8 import HotelPerformanceView
expected_names.append(HotelPerformanceView.__name__)
from google.ads.googleads.v8 import IncomeRangeView
expected_names.append(IncomeRangeView.__name__)
from google.ads.googleads.v8 import Invoice
expected_names.append(Invoice.__name__)
from google.ads.googleads.v8 import KeywordPlan
expected_names.append(KeywordPlan.__name__)
from google.ads.googleads.v8 import KeywordPlanForecastPeriod
expected_names.append(KeywordPlanForecastPeriod.__name__)
from google.ads.googleads.v8 import KeywordPlanAdGroup
expected_names.append(KeywordPlanAdGroup.__name__)
from google.ads.googleads.v8 import KeywordPlanAdGroupKeyword
expected_names.append(KeywordPlanAdGroupKeyword.__name__)
from google.ads.googleads.v8 import KeywordPlanCampaign
expected_names.append(KeywordPlanCampaign.__name__)
from google.ads.googleads.v8 import KeywordPlanGeoTarget
expected_names.append(KeywordPlanGeoTarget.__name__)
from google.ads.googleads.v8 import KeywordPlanCampaignKeyword
expected_names.append(KeywordPlanCampaignKeyword.__name__)
from google.ads.googleads.v8 import KeywordThemeConstant
expected_names.append(KeywordThemeConstant.__name__)
from google.ads.googleads.v8 import KeywordView
expected_names.append(KeywordView.__name__)
from google.ads.googleads.v8 import Label
expected_names.append(Label.__name__)
from google.ads.googleads.v8 import LandingPageView
expected_names.append(LandingPageView.__name__)
from google.ads.googleads.v8 import LanguageConstant
expected_names.append(LanguageConstant.__name__)
from google.ads.googleads.v8 import LifeEvent
expected_names.append(LifeEvent.__name__)
from google.ads.googleads.v8 import LocationView
expected_names.append(LocationView.__name__)
from google.ads.googleads.v8 import ManagedPlacementView
expected_names.append(ManagedPlacementView.__name__)
from google.ads.googleads.v8 import MediaFile
expected_names.append(MediaFile.__name__)
from google.ads.googleads.v8 import MediaImage
expected_names.append(MediaImage.__name__)
from google.ads.googleads.v8 import MediaBundle
expected_names.append(MediaBundle.__name__)
from google.ads.googleads.v8 import MediaAudio
expected_names.append(MediaAudio.__name__)
from google.ads.googleads.v8 import MediaVideo
expected_names.append(MediaVideo.__name__)
from google.ads.googleads.v8 import MerchantCenterLink
expected_names.append(MerchantCenterLink.__name__)
from google.ads.googleads.v8 import MobileAppCategoryConstant
expected_names.append(MobileAppCategoryConstant.__name__)
from google.ads.googleads.v8 import MobileDeviceConstant
expected_names.append(MobileDeviceConstant.__name__)
from google.ads.googleads.v8 import OfflineUserDataJob
expected_names.append(OfflineUserDataJob.__name__)
from google.ads.googleads.v8 import OperatingSystemVersionConstant
expected_names.append(OperatingSystemVersionConstant.__name__)
from google.ads.googleads.v8 import PaidOrganicSearchTermView
expected_names.append(PaidOrganicSearchTermView.__name__)
from google.ads.googleads.v8 import ParentalStatusView
expected_names.append(ParentalStatusView.__name__)
from google.ads.googleads.v8 import PaymentsAccount
expected_names.append(PaymentsAccount.__name__)
from google.ads.googleads.v8 import ProductBiddingCategoryConstant
expected_names.append(ProductBiddingCategoryConstant.__name__)
from google.ads.googleads.v8 import ProductGroupView
expected_names.append(ProductGroupView.__name__)
from google.ads.googleads.v8 import Recommendation
expected_names.append(Recommendation.__name__)
from google.ads.googleads.v8 import RemarketingAction
expected_names.append(RemarketingAction.__name__)
from google.ads.googleads.v8 import SearchTermView
expected_names.append(SearchTermView.__name__)
from google.ads.googleads.v8 import SharedCriterion
expected_names.append(SharedCriterion.__name__)
from google.ads.googleads.v8 import SharedSet
expected_names.append(SharedSet.__name__)
from google.ads.googleads.v8 import ShoppingPerformanceView
expected_names.append(ShoppingPerformanceView.__name__)
from google.ads.googleads.v8 import SmartCampaignSearchTermView
expected_names.append(SmartCampaignSearchTermView.__name__)
from google.ads.googleads.v8 import SmartCampaignSetting
expected_names.append(SmartCampaignSetting.__name__)
from google.ads.googleads.v8 import ThirdPartyAppAnalyticsLink
expected_names.append(ThirdPartyAppAnalyticsLink.__name__)
from google.ads.googleads.v8 import TopicConstant
expected_names.append(TopicConstant.__name__)
from google.ads.googleads.v8 import TopicView
expected_names.append(TopicView.__name__)
from google.ads.googleads.v8 import UserInterest
expected_names.append(UserInterest.__name__)
from google.ads.googleads.v8 import UserList
expected_names.append(UserList.__name__)
from google.ads.googleads.v8 import UserLocationView
expected_names.append(UserLocationView.__name__)
from google.ads.googleads.v8 import Video
expected_names.append(Video.__name__)
from google.ads.googleads.v8 import WebpageView
expected_names.append(WebpageView.__name__)
from google.ads.googleads.v8 import GetAccessibleBiddingStrategyRequest
expected_names.append(GetAccessibleBiddingStrategyRequest.__name__)
from google.ads.googleads.v8 import GetAccountBudgetProposalRequest
expected_names.append(GetAccountBudgetProposalRequest.__name__)
from google.ads.googleads.v8 import MutateAccountBudgetProposalRequest
expected_names.append(MutateAccountBudgetProposalRequest.__name__)
from google.ads.googleads.v8 import AccountBudgetProposalOperation
expected_names.append(AccountBudgetProposalOperation.__name__)
from google.ads.googleads.v8 import MutateAccountBudgetProposalResponse
expected_names.append(MutateAccountBudgetProposalResponse.__name__)
from google.ads.googleads.v8 import MutateAccountBudgetProposalResult
expected_names.append(MutateAccountBudgetProposalResult.__name__)
from google.ads.googleads.v8 import GetAccountBudgetRequest
expected_names.append(GetAccountBudgetRequest.__name__)
from google.ads.googleads.v8 import GetAccountLinkRequest
expected_names.append(GetAccountLinkRequest.__name__)
from google.ads.googleads.v8 import CreateAccountLinkRequest
expected_names.append(CreateAccountLinkRequest.__name__)
from google.ads.googleads.v8 import CreateAccountLinkResponse
expected_names.append(CreateAccountLinkResponse.__name__)
from google.ads.googleads.v8 import MutateAccountLinkRequest
expected_names.append(MutateAccountLinkRequest.__name__)
from google.ads.googleads.v8 import AccountLinkOperation
expected_names.append(AccountLinkOperation.__name__)
from google.ads.googleads.v8 import MutateAccountLinkResponse
expected_names.append(MutateAccountLinkResponse.__name__)
from google.ads.googleads.v8 import MutateAccountLinkResult
expected_names.append(MutateAccountLinkResult.__name__)
from google.ads.googleads.v8 import GetAdGroupAdAssetViewRequest
expected_names.append(GetAdGroupAdAssetViewRequest.__name__)
from google.ads.googleads.v8 import GetAdGroupAdLabelRequest
expected_names.append(GetAdGroupAdLabelRequest.__name__)
from google.ads.googleads.v8 import MutateAdGroupAdLabelsRequest
expected_names.append(MutateAdGroupAdLabelsRequest.__name__)
from google.ads.googleads.v8 import AdGroupAdLabelOperation
expected_names.append(AdGroupAdLabelOperation.__name__)
from google.ads.googleads.v8 import MutateAdGroupAdLabelsResponse
expected_names.append(MutateAdGroupAdLabelsResponse.__name__)
from google.ads.googleads.v8 import MutateAdGroupAdLabelResult
expected_names.append(MutateAdGroupAdLabelResult.__name__)
from google.ads.googleads.v8 import GetAdGroupAdRequest
expected_names.append(GetAdGroupAdRequest.__name__)
from google.ads.googleads.v8 import MutateAdGroupAdsRequest
expected_names.append(MutateAdGroupAdsRequest.__name__)
from google.ads.googleads.v8 import AdGroupAdOperation
expected_names.append(AdGroupAdOperation.__name__)
from google.ads.googleads.v8 import MutateAdGroupAdsResponse
expected_names.append(MutateAdGroupAdsResponse.__name__)
from google.ads.googleads.v8 import MutateAdGroupAdResult
expected_names.append(MutateAdGroupAdResult.__name__)
from google.ads.googleads.v8 import GetAdGroupAssetRequest
expected_names.append(GetAdGroupAssetRequest.__name__)
from google.ads.googleads.v8 import MutateAdGroupAssetsRequest
expected_names.append(MutateAdGroupAssetsRequest.__name__)
from google.ads.googleads.v8 import AdGroupAssetOperation
expected_names.append(AdGroupAssetOperation.__name__)
from google.ads.googleads.v8 import MutateAdGroupAssetsResponse
expected_names.append(MutateAdGroupAssetsResponse.__name__)
from google.ads.googleads.v8 import MutateAdGroupAssetResult
expected_names.append(MutateAdGroupAssetResult.__name__)
from google.ads.googleads.v8 import GetAdGroupAudienceViewRequest
expected_names.append(GetAdGroupAudienceViewRequest.__name__)
from google.ads.googleads.v8 import GetAdGroupBidModifierRequest
expected_names.append(GetAdGroupBidModifierRequest.__name__)
from google.ads.googleads.v8 import MutateAdGroupBidModifiersRequest
expected_names.append(MutateAdGroupBidModifiersRequest.__name__)
from google.ads.googleads.v8 import AdGroupBidModifierOperation
expected_names.append(AdGroupBidModifierOperation.__name__)
from google.ads.googleads.v8 import MutateAdGroupBidModifiersResponse
expected_names.append(MutateAdGroupBidModifiersResponse.__name__)
from google.ads.googleads.v8 import MutateAdGroupBidModifierResult
expected_names.append(MutateAdGroupBidModifierResult.__name__)
from google.ads.googleads.v8 import GetAdGroupCriterionLabelRequest
expected_names.append(GetAdGroupCriterionLabelRequest.__name__)
from google.ads.googleads.v8 import MutateAdGroupCriterionLabelsRequest
expected_names.append(MutateAdGroupCriterionLabelsRequest.__name__)
from google.ads.googleads.v8 import AdGroupCriterionLabelOperation
expected_names.append(AdGroupCriterionLabelOperation.__name__)
from google.ads.googleads.v8 import MutateAdGroupCriterionLabelsResponse
expected_names.append(MutateAdGroupCriterionLabelsResponse.__name__)
from google.ads.googleads.v8 import MutateAdGroupCriterionLabelResult
expected_names.append(MutateAdGroupCriterionLabelResult.__name__)
from google.ads.googleads.v8 import GetAdGroupCriterionRequest
expected_names.append(GetAdGroupCriterionRequest.__name__)
from google.ads.googleads.v8 import MutateAdGroupCriteriaRequest
expected_names.append(MutateAdGroupCriteriaRequest.__name__)
from google.ads.googleads.v8 import AdGroupCriterionOperation
expected_names.append(AdGroupCriterionOperation.__name__)
from google.ads.googleads.v8 import MutateAdGroupCriteriaResponse
expected_names.append(MutateAdGroupCriteriaResponse.__name__)
from google.ads.googleads.v8 import MutateAdGroupCriterionResult
expected_names.append(MutateAdGroupCriterionResult.__name__)
from google.ads.googleads.v8 import GetAdGroupCriterionSimulationRequest
expected_names.append(GetAdGroupCriterionSimulationRequest.__name__)
from google.ads.googleads.v8 import GetAdGroupExtensionSettingRequest
expected_names.append(GetAdGroupExtensionSettingRequest.__name__)
from google.ads.googleads.v8 import MutateAdGroupExtensionSettingsRequest
expected_names.append(MutateAdGroupExtensionSettingsRequest.__name__)
from google.ads.googleads.v8 import AdGroupExtensionSettingOperation
expected_names.append(AdGroupExtensionSettingOperation.__name__)
from google.ads.googleads.v8 import MutateAdGroupExtensionSettingsResponse
expected_names.append(MutateAdGroupExtensionSettingsResponse.__name__)
from google.ads.googleads.v8 import MutateAdGroupExtensionSettingResult
expected_names.append(MutateAdGroupExtensionSettingResult.__name__)
from google.ads.googleads.v8 import GetAdGroupFeedRequest
expected_names.append(GetAdGroupFeedRequest.__name__)
from google.ads.googleads.v8 import MutateAdGroupFeedsRequest
expected_names.append(MutateAdGroupFeedsRequest.__name__)
from google.ads.googleads.v8 import AdGroupFeedOperation
expected_names.append(AdGroupFeedOperation.__name__)
from google.ads.googleads.v8 import MutateAdGroupFeedsResponse
expected_names.append(MutateAdGroupFeedsResponse.__name__)
from google.ads.googleads.v8 import MutateAdGroupFeedResult
expected_names.append(MutateAdGroupFeedResult.__name__)
from google.ads.googleads.v8 import GetAdGroupLabelRequest
expected_names.append(GetAdGroupLabelRequest.__name__)
from google.ads.googleads.v8 import MutateAdGroupLabelsRequest
expected_names.append(MutateAdGroupLabelsRequest.__name__)
from google.ads.googleads.v8 import AdGroupLabelOperation
expected_names.append(AdGroupLabelOperation.__name__)
from google.ads.googleads.v8 import MutateAdGroupLabelsResponse
expected_names.append(MutateAdGroupLabelsResponse.__name__)
from google.ads.googleads.v8 import MutateAdGroupLabelResult
expected_names.append(MutateAdGroupLabelResult.__name__)
from google.ads.googleads.v8 import GetAdGroupRequest
expected_names.append(GetAdGroupRequest.__name__)
from google.ads.googleads.v8 import MutateAdGroupsRequest
expected_names.append(MutateAdGroupsRequest.__name__)
from google.ads.googleads.v8 import AdGroupOperation
expected_names.append(AdGroupOperation.__name__)
from google.ads.googleads.v8 import MutateAdGroupsResponse
expected_names.append(MutateAdGroupsResponse.__name__)
from google.ads.googleads.v8 import MutateAdGroupResult
expected_names.append(MutateAdGroupResult.__name__)
from google.ads.googleads.v8 import GetAdGroupSimulationRequest
expected_names.append(GetAdGroupSimulationRequest.__name__)
from google.ads.googleads.v8 import GetAdParameterRequest
expected_names.append(GetAdParameterRequest.__name__)
from google.ads.googleads.v8 import MutateAdParametersRequest
expected_names.append(MutateAdParametersRequest.__name__)
from google.ads.googleads.v8 import AdParameterOperation
expected_names.append(AdParameterOperation.__name__)
from google.ads.googleads.v8 import MutateAdParametersResponse
expected_names.append(MutateAdParametersResponse.__name__)
from google.ads.googleads.v8 import MutateAdParameterResult
expected_names.append(MutateAdParameterResult.__name__)
from google.ads.googleads.v8 import GetAdScheduleViewRequest
expected_names.append(GetAdScheduleViewRequest.__name__)
from google.ads.googleads.v8 import GetAdRequest
expected_names.append(GetAdRequest.__name__)
from google.ads.googleads.v8 import MutateAdsRequest
expected_names.append(MutateAdsRequest.__name__)
from google.ads.googleads.v8 import AdOperation
expected_names.append(AdOperation.__name__)
from google.ads.googleads.v8 import MutateAdsResponse
expected_names.append(MutateAdsResponse.__name__)
from google.ads.googleads.v8 import MutateAdResult
expected_names.append(MutateAdResult.__name__)
from google.ads.googleads.v8 import GetAgeRangeViewRequest
expected_names.append(GetAgeRangeViewRequest.__name__)
from google.ads.googleads.v8 import GetAssetFieldTypeViewRequest
expected_names.append(GetAssetFieldTypeViewRequest.__name__)
from google.ads.googleads.v8 import GetAssetRequest
expected_names.append(GetAssetRequest.__name__)
from google.ads.googleads.v8 import MutateAssetsRequest
expected_names.append(MutateAssetsRequest.__name__)
from google.ads.googleads.v8 import AssetOperation
expected_names.append(AssetOperation.__name__)
from google.ads.googleads.v8 import MutateAssetsResponse
expected_names.append(MutateAssetsResponse.__name__)
from google.ads.googleads.v8 import MutateAssetResult
expected_names.append(MutateAssetResult.__name__)
from google.ads.googleads.v8 import GetBiddingStrategyRequest
expected_names.append(GetBiddingStrategyRequest.__name__)
from google.ads.googleads.v8 import MutateBiddingStrategiesRequest
expected_names.append(MutateBiddingStrategiesRequest.__name__)
from google.ads.googleads.v8 import BiddingStrategyOperation
expected_names.append(BiddingStrategyOperation.__name__)
from google.ads.googleads.v8 import MutateBiddingStrategiesResponse
expected_names.append(MutateBiddingStrategiesResponse.__name__)
from google.ads.googleads.v8 import MutateBiddingStrategyResult
expected_names.append(MutateBiddingStrategyResult.__name__)
from google.ads.googleads.v8 import GetCampaignAssetRequest
expected_names.append(GetCampaignAssetRequest.__name__)
from google.ads.googleads.v8 import MutateCampaignAssetsRequest
expected_names.append(MutateCampaignAssetsRequest.__name__)
from google.ads.googleads.v8 import CampaignAssetOperation
expected_names.append(CampaignAssetOperation.__name__)
from google.ads.googleads.v8 import MutateCampaignAssetsResponse
expected_names.append(MutateCampaignAssetsResponse.__name__)
from google.ads.googleads.v8 import MutateCampaignAssetResult
expected_names.append(MutateCampaignAssetResult.__name__)
from google.ads.googleads.v8 import GetCampaignBidModifierRequest
expected_names.append(GetCampaignBidModifierRequest.__name__)
from google.ads.googleads.v8 import MutateCampaignBidModifiersRequest
expected_names.append(MutateCampaignBidModifiersRequest.__name__)
from google.ads.googleads.v8 import CampaignBidModifierOperation
expected_names.append(CampaignBidModifierOperation.__name__)
from google.ads.googleads.v8 import MutateCampaignBidModifiersResponse
expected_names.append(MutateCampaignBidModifiersResponse.__name__)
from google.ads.googleads.v8 import MutateCampaignBidModifierResult
expected_names.append(MutateCampaignBidModifierResult.__name__)
from google.ads.googleads.v8 import GetCampaignBudgetRequest
expected_names.append(GetCampaignBudgetRequest.__name__)
from google.ads.googleads.v8 import MutateCampaignBudgetsRequest
expected_names.append(MutateCampaignBudgetsRequest.__name__)
from google.ads.googleads.v8 import CampaignBudgetOperation
expected_names.append(CampaignBudgetOperation.__name__)
from google.ads.googleads.v8 import MutateCampaignBudgetsResponse
expected_names.append(MutateCampaignBudgetsResponse.__name__)
from google.ads.googleads.v8 import MutateCampaignBudgetResult
expected_names.append(MutateCampaignBudgetResult.__name__)
from google.ads.googleads.v8 import GetCampaignCriterionRequest
expected_names.append(GetCampaignCriterionRequest.__name__)
from google.ads.googleads.v8 import MutateCampaignCriteriaRequest
expected_names.append(MutateCampaignCriteriaRequest.__name__)
from google.ads.googleads.v8 import CampaignCriterionOperation
expected_names.append(CampaignCriterionOperation.__name__)
from google.ads.googleads.v8 import MutateCampaignCriteriaResponse
expected_names.append(MutateCampaignCriteriaResponse.__name__)
from google.ads.googleads.v8 import MutateCampaignCriterionResult
expected_names.append(MutateCampaignCriterionResult.__name__)
from google.ads.googleads.v8 import GetCampaignDraftRequest
expected_names.append(GetCampaignDraftRequest.__name__)
from google.ads.googleads.v8 import MutateCampaignDraftsRequest
expected_names.append(MutateCampaignDraftsRequest.__name__)
from google.ads.googleads.v8 import PromoteCampaignDraftRequest
expected_names.append(PromoteCampaignDraftRequest.__name__)
from google.ads.googleads.v8 import CampaignDraftOperation
expected_names.append(CampaignDraftOperation.__name__)
from google.ads.googleads.v8 import MutateCampaignDraftsResponse
expected_names.append(MutateCampaignDraftsResponse.__name__)
from google.ads.googleads.v8 import MutateCampaignDraftResult
expected_names.append(MutateCampaignDraftResult.__name__)
from google.ads.googleads.v8 import ListCampaignDraftAsyncErrorsRequest
expected_names.append(ListCampaignDraftAsyncErrorsRequest.__name__)
from google.ads.googleads.v8 import ListCampaignDraftAsyncErrorsResponse
expected_names.append(ListCampaignDraftAsyncErrorsResponse.__name__)
from google.ads.googleads.v8 import GetCampaignExperimentRequest
expected_names.append(GetCampaignExperimentRequest.__name__)
from google.ads.googleads.v8 import MutateCampaignExperimentsRequest
expected_names.append(MutateCampaignExperimentsRequest.__name__)
from google.ads.googleads.v8 import CampaignExperimentOperation
expected_names.append(CampaignExperimentOperation.__name__)
from google.ads.googleads.v8 import MutateCampaignExperimentsResponse
expected_names.append(MutateCampaignExperimentsResponse.__name__)
from google.ads.googleads.v8 import MutateCampaignExperimentResult
expected_names.append(MutateCampaignExperimentResult.__name__)
from google.ads.googleads.v8 import CreateCampaignExperimentRequest
expected_names.append(CreateCampaignExperimentRequest.__name__)
from google.ads.googleads.v8 import CreateCampaignExperimentMetadata
expected_names.append(CreateCampaignExperimentMetadata.__name__)
from google.ads.googleads.v8 import GraduateCampaignExperimentRequest
expected_names.append(GraduateCampaignExperimentRequest.__name__)
from google.ads.googleads.v8 import GraduateCampaignExperimentResponse
expected_names.append(GraduateCampaignExperimentResponse.__name__)
from google.ads.googleads.v8 import PromoteCampaignExperimentRequest
expected_names.append(PromoteCampaignExperimentRequest.__name__)
from google.ads.googleads.v8 import EndCampaignExperimentRequest
expected_names.append(EndCampaignExperimentRequest.__name__)
from google.ads.googleads.v8 import ListCampaignExperimentAsyncErrorsRequest
expected_names.append(ListCampaignExperimentAsyncErrorsRequest.__name__)
from google.ads.googleads.v8 import ListCampaignExperimentAsyncErrorsResponse
expected_names.append(ListCampaignExperimentAsyncErrorsResponse.__name__)
from google.ads.googleads.v8 import GetCampaignExtensionSettingRequest
expected_names.append(GetCampaignExtensionSettingRequest.__name__)
from google.ads.googleads.v8 import MutateCampaignExtensionSettingsRequest
expected_names.append(MutateCampaignExtensionSettingsRequest.__name__)
from google.ads.googleads.v8 import CampaignExtensionSettingOperation
expected_names.append(CampaignExtensionSettingOperation.__name__)
from google.ads.googleads.v8 import MutateCampaignExtensionSettingsResponse
expected_names.append(MutateCampaignExtensionSettingsResponse.__name__)
from google.ads.googleads.v8 import MutateCampaignExtensionSettingResult
expected_names.append(MutateCampaignExtensionSettingResult.__name__)
from google.ads.googleads.v8 import GetCampaignFeedRequest
expected_names.append(GetCampaignFeedRequest.__name__)
from google.ads.googleads.v8 import MutateCampaignFeedsRequest
expected_names.append(MutateCampaignFeedsRequest.__name__)
from google.ads.googleads.v8 import CampaignFeedOperation
expected_names.append(CampaignFeedOperation.__name__)
from google.ads.googleads.v8 import MutateCampaignFeedsResponse
expected_names.append(MutateCampaignFeedsResponse.__name__)
from google.ads.googleads.v8 import MutateCampaignFeedResult
expected_names.append(MutateCampaignFeedResult.__name__)
from google.ads.googleads.v8 import GetCampaignLabelRequest
expected_names.append(GetCampaignLabelRequest.__name__)
from google.ads.googleads.v8 import MutateCampaignLabelsRequest
expected_names.append(MutateCampaignLabelsRequest.__name__)
from google.ads.googleads.v8 import CampaignLabelOperation
expected_names.append(CampaignLabelOperation.__name__)
from google.ads.googleads.v8 import MutateCampaignLabelsResponse
expected_names.append(MutateCampaignLabelsResponse.__name__)
from google.ads.googleads.v8 import MutateCampaignLabelResult
expected_names.append(MutateCampaignLabelResult.__name__)
from google.ads.googleads.v8 import GetCampaignRequest
expected_names.append(GetCampaignRequest.__name__)
from google.ads.googleads.v8 import MutateCampaignsRequest
expected_names.append(MutateCampaignsRequest.__name__)
from google.ads.googleads.v8 import CampaignOperation
expected_names.append(CampaignOperation.__name__)
from google.ads.googleads.v8 import MutateCampaignsResponse
expected_names.append(MutateCampaignsResponse.__name__)
from google.ads.googleads.v8 import MutateCampaignResult
expected_names.append(MutateCampaignResult.__name__)
from google.ads.googleads.v8 import GetCampaignSharedSetRequest
expected_names.append(GetCampaignSharedSetRequest.__name__)
from google.ads.googleads.v8 import MutateCampaignSharedSetsRequest
expected_names.append(MutateCampaignSharedSetsRequest.__name__)
from google.ads.googleads.v8 import CampaignSharedSetOperation
expected_names.append(CampaignSharedSetOperation.__name__)
from google.ads.googleads.v8 import MutateCampaignSharedSetsResponse
expected_names.append(MutateCampaignSharedSetsResponse.__name__)
from google.ads.googleads.v8 import MutateCampaignSharedSetResult
expected_names.append(MutateCampaignSharedSetResult.__name__)
from google.ads.googleads.v8 import GetConversionActionRequest
expected_names.append(GetConversionActionRequest.__name__)
from google.ads.googleads.v8 import MutateConversionActionsRequest
expected_names.append(MutateConversionActionsRequest.__name__)
from google.ads.googleads.v8 import ConversionActionOperation
expected_names.append(ConversionActionOperation.__name__)
from google.ads.googleads.v8 import MutateConversionActionsResponse
expected_names.append(MutateConversionActionsResponse.__name__)
from google.ads.googleads.v8 import MutateConversionActionResult
expected_names.append(MutateConversionActionResult.__name__)
from google.ads.googleads.v8 import GetConversionCustomVariableRequest
expected_names.append(GetConversionCustomVariableRequest.__name__)
from google.ads.googleads.v8 import MutateConversionCustomVariablesRequest
expected_names.append(MutateConversionCustomVariablesRequest.__name__)
from google.ads.googleads.v8 import ConversionCustomVariableOperation
expected_names.append(ConversionCustomVariableOperation.__name__)
from google.ads.googleads.v8 import MutateConversionCustomVariablesResponse
expected_names.append(MutateConversionCustomVariablesResponse.__name__)
from google.ads.googleads.v8 import MutateConversionCustomVariableResult
expected_names.append(MutateConversionCustomVariableResult.__name__)
from google.ads.googleads.v8 import GetCustomerAssetRequest
expected_names.append(GetCustomerAssetRequest.__name__)
from google.ads.googleads.v8 import MutateCustomerAssetsRequest
expected_names.append(MutateCustomerAssetsRequest.__name__)
from google.ads.googleads.v8 import CustomerAssetOperation
expected_names.append(CustomerAssetOperation.__name__)
from google.ads.googleads.v8 import MutateCustomerAssetsResponse
expected_names.append(MutateCustomerAssetsResponse.__name__)
from google.ads.googleads.v8 import MutateCustomerAssetResult
expected_names.append(MutateCustomerAssetResult.__name__)
from google.ads.googleads.v8 import GetCustomerExtensionSettingRequest
expected_names.append(GetCustomerExtensionSettingRequest.__name__)
from google.ads.googleads.v8 import MutateCustomerExtensionSettingsRequest
expected_names.append(MutateCustomerExtensionSettingsRequest.__name__)
from google.ads.googleads.v8 import CustomerExtensionSettingOperation
expected_names.append(CustomerExtensionSettingOperation.__name__)
from google.ads.googleads.v8 import MutateCustomerExtensionSettingsResponse
expected_names.append(MutateCustomerExtensionSettingsResponse.__name__)
from google.ads.googleads.v8 import MutateCustomerExtensionSettingResult
expected_names.append(MutateCustomerExtensionSettingResult.__name__)
from google.ads.googleads.v8 import GetCustomerFeedRequest
expected_names.append(GetCustomerFeedRequest.__name__)
from google.ads.googleads.v8 import MutateCustomerFeedsRequest
expected_names.append(MutateCustomerFeedsRequest.__name__)
from google.ads.googleads.v8 import CustomerFeedOperation
expected_names.append(CustomerFeedOperation.__name__)
from google.ads.googleads.v8 import MutateCustomerFeedsResponse
expected_names.append(MutateCustomerFeedsResponse.__name__)
from google.ads.googleads.v8 import MutateCustomerFeedResult
expected_names.append(MutateCustomerFeedResult.__name__)
from google.ads.googleads.v8 import GetCustomerLabelRequest
expected_names.append(GetCustomerLabelRequest.__name__)
from google.ads.googleads.v8 import MutateCustomerLabelsRequest
expected_names.append(MutateCustomerLabelsRequest.__name__)
from google.ads.googleads.v8 import CustomerLabelOperation
expected_names.append(CustomerLabelOperation.__name__)
from google.ads.googleads.v8 import MutateCustomerLabelsResponse
expected_names.append(MutateCustomerLabelsResponse.__name__)
from google.ads.googleads.v8 import MutateCustomerLabelResult
expected_names.append(MutateCustomerLabelResult.__name__)
from google.ads.googleads.v8 import GetCustomerNegativeCriterionRequest
expected_names.append(GetCustomerNegativeCriterionRequest.__name__)
from google.ads.googleads.v8 import MutateCustomerNegativeCriteriaRequest
expected_names.append(MutateCustomerNegativeCriteriaRequest.__name__)
from google.ads.googleads.v8 import CustomerNegativeCriterionOperation
expected_names.append(CustomerNegativeCriterionOperation.__name__)
from google.ads.googleads.v8 import MutateCustomerNegativeCriteriaResponse
expected_names.append(MutateCustomerNegativeCriteriaResponse.__name__)
from google.ads.googleads.v8 import MutateCustomerNegativeCriteriaResult
expected_names.append(MutateCustomerNegativeCriteriaResult.__name__)
from google.ads.googleads.v8 import GetCustomerRequest
expected_names.append(GetCustomerRequest.__name__)
from google.ads.googleads.v8 import MutateCustomerRequest
expected_names.append(MutateCustomerRequest.__name__)
from google.ads.googleads.v8 import CreateCustomerClientRequest
expected_names.append(CreateCustomerClientRequest.__name__)
from google.ads.googleads.v8 import CustomerOperation
expected_names.append(CustomerOperation.__name__)
from google.ads.googleads.v8 import CreateCustomerClientResponse
expected_names.append(CreateCustomerClientResponse.__name__)
from google.ads.googleads.v8 import MutateCustomerResponse
expected_names.append(MutateCustomerResponse.__name__)
from google.ads.googleads.v8 import MutateCustomerResult
expected_names.append(MutateCustomerResult.__name__)
from google.ads.googleads.v8 import ListAccessibleCustomersRequest
expected_names.append(ListAccessibleCustomersRequest.__name__)
from google.ads.googleads.v8 import ListAccessibleCustomersResponse
expected_names.append(ListAccessibleCustomersResponse.__name__)
from google.ads.googleads.v8 import GetExtensionFeedItemRequest
expected_names.append(GetExtensionFeedItemRequest.__name__)
from google.ads.googleads.v8 import MutateExtensionFeedItemsRequest
expected_names.append(MutateExtensionFeedItemsRequest.__name__)
from google.ads.googleads.v8 import ExtensionFeedItemOperation
expected_names.append(ExtensionFeedItemOperation.__name__)
from google.ads.googleads.v8 import MutateExtensionFeedItemsResponse
expected_names.append(MutateExtensionFeedItemsResponse.__name__)
from google.ads.googleads.v8 import MutateExtensionFeedItemResult
expected_names.append(MutateExtensionFeedItemResult.__name__)
from google.ads.googleads.v8 import GetFeedItemRequest
expected_names.append(GetFeedItemRequest.__name__)
from google.ads.googleads.v8 import MutateFeedItemsRequest
expected_names.append(MutateFeedItemsRequest.__name__)
from google.ads.googleads.v8 import FeedItemOperation
expected_names.append(FeedItemOperation.__name__)
from google.ads.googleads.v8 import MutateFeedItemsResponse
expected_names.append(MutateFeedItemsResponse.__name__)
from google.ads.googleads.v8 import MutateFeedItemResult
expected_names.append(MutateFeedItemResult.__name__)
from google.ads.googleads.v8 import GetFeedItemSetLinkRequest
expected_names.append(GetFeedItemSetLinkRequest.__name__)
from google.ads.googleads.v8 import MutateFeedItemSetLinksRequest
expected_names.append(MutateFeedItemSetLinksRequest.__name__)
from google.ads.googleads.v8 import FeedItemSetLinkOperation
expected_names.append(FeedItemSetLinkOperation.__name__)
from google.ads.googleads.v8 import MutateFeedItemSetLinksResponse
expected_names.append(MutateFeedItemSetLinksResponse.__name__)
from google.ads.googleads.v8 import MutateFeedItemSetLinkResult
expected_names.append(MutateFeedItemSetLinkResult.__name__)
from google.ads.googleads.v8 import GetFeedItemSetRequest
expected_names.append(GetFeedItemSetRequest.__name__)
from google.ads.googleads.v8 import MutateFeedItemSetsRequest
expected_names.append(MutateFeedItemSetsRequest.__name__)
from google.ads.googleads.v8 import FeedItemSetOperation
expected_names.append(FeedItemSetOperation.__name__)
from google.ads.googleads.v8 import MutateFeedItemSetsResponse
expected_names.append(MutateFeedItemSetsResponse.__name__)
from google.ads.googleads.v8 import MutateFeedItemSetResult
expected_names.append(MutateFeedItemSetResult.__name__)
from google.ads.googleads.v8 import GetFeedItemTargetRequest
expected_names.append(GetFeedItemTargetRequest.__name__)
from google.ads.googleads.v8 import MutateFeedItemTargetsRequest
expected_names.append(MutateFeedItemTargetsRequest.__name__)
from google.ads.googleads.v8 import FeedItemTargetOperation
expected_names.append(FeedItemTargetOperation.__name__)
from google.ads.googleads.v8 import MutateFeedItemTargetsResponse
expected_names.append(MutateFeedItemTargetsResponse.__name__)
from google.ads.googleads.v8 import MutateFeedItemTargetResult
expected_names.append(MutateFeedItemTargetResult.__name__)
from google.ads.googleads.v8 import GetFeedMappingRequest
expected_names.append(GetFeedMappingRequest.__name__)
from google.ads.googleads.v8 import MutateFeedMappingsRequest
expected_names.append(MutateFeedMappingsRequest.__name__)
from google.ads.googleads.v8 import FeedMappingOperation
expected_names.append(FeedMappingOperation.__name__)
from google.ads.googleads.v8 import MutateFeedMappingsResponse
expected_names.append(MutateFeedMappingsResponse.__name__)
from google.ads.googleads.v8 import MutateFeedMappingResult
expected_names.append(MutateFeedMappingResult.__name__)
from google.ads.googleads.v8 import GetFeedRequest
expected_names.append(GetFeedRequest.__name__)
from google.ads.googleads.v8 import MutateFeedsRequest
expected_names.append(MutateFeedsRequest.__name__)
from google.ads.googleads.v8 import FeedOperation
expected_names.append(FeedOperation.__name__)
from google.ads.googleads.v8 import MutateFeedsResponse
expected_names.append(MutateFeedsResponse.__name__)
from google.ads.googleads.v8 import MutateFeedResult
expected_names.append(MutateFeedResult.__name__)
from google.ads.googleads.v8 import GetKeywordPlanAdGroupKeywordRequest
expected_names.append(GetKeywordPlanAdGroupKeywordRequest.__name__)
from google.ads.googleads.v8 import MutateKeywordPlanAdGroupKeywordsRequest
expected_names.append(MutateKeywordPlanAdGroupKeywordsRequest.__name__)
from google.ads.googleads.v8 import KeywordPlanAdGroupKeywordOperation
expected_names.append(KeywordPlanAdGroupKeywordOperation.__name__)
from google.ads.googleads.v8 import MutateKeywordPlanAdGroupKeywordsResponse
expected_names.append(MutateKeywordPlanAdGroupKeywordsResponse.__name__)
from google.ads.googleads.v8 import MutateKeywordPlanAdGroupKeywordResult
expected_names.append(MutateKeywordPlanAdGroupKeywordResult.__name__)
from google.ads.googleads.v8 import GetKeywordPlanAdGroupRequest
expected_names.append(GetKeywordPlanAdGroupRequest.__name__)
from google.ads.googleads.v8 import MutateKeywordPlanAdGroupsRequest
expected_names.append(MutateKeywordPlanAdGroupsRequest.__name__)
from google.ads.googleads.v8 import KeywordPlanAdGroupOperation
expected_names.append(KeywordPlanAdGroupOperation.__name__)
from google.ads.googleads.v8 import MutateKeywordPlanAdGroupsResponse
expected_names.append(MutateKeywordPlanAdGroupsResponse.__name__)
from google.ads.googleads.v8 import MutateKeywordPlanAdGroupResult
expected_names.append(MutateKeywordPlanAdGroupResult.__name__)
from google.ads.googleads.v8 import GetKeywordPlanCampaignKeywordRequest
expected_names.append(GetKeywordPlanCampaignKeywordRequest.__name__)
from google.ads.googleads.v8 import MutateKeywordPlanCampaignKeywordsRequest
expected_names.append(MutateKeywordPlanCampaignKeywordsRequest.__name__)
from google.ads.googleads.v8 import KeywordPlanCampaignKeywordOperation
expected_names.append(KeywordPlanCampaignKeywordOperation.__name__)
from google.ads.googleads.v8 import MutateKeywordPlanCampaignKeywordsResponse
expected_names.append(MutateKeywordPlanCampaignKeywordsResponse.__name__)
from google.ads.googleads.v8 import MutateKeywordPlanCampaignKeywordResult
expected_names.append(MutateKeywordPlanCampaignKeywordResult.__name__)
from google.ads.googleads.v8 import GetKeywordPlanCampaignRequest
expected_names.append(GetKeywordPlanCampaignRequest.__name__)
from google.ads.googleads.v8 import MutateKeywordPlanCampaignsRequest
expected_names.append(MutateKeywordPlanCampaignsRequest.__name__)
from google.ads.googleads.v8 import KeywordPlanCampaignOperation
expected_names.append(KeywordPlanCampaignOperation.__name__)
from google.ads.googleads.v8 import MutateKeywordPlanCampaignsResponse
expected_names.append(MutateKeywordPlanCampaignsResponse.__name__)
from google.ads.googleads.v8 import MutateKeywordPlanCampaignResult
expected_names.append(MutateKeywordPlanCampaignResult.__name__)
from google.ads.googleads.v8 import GetKeywordPlanRequest
expected_names.append(GetKeywordPlanRequest.__name__)
from google.ads.googleads.v8 import MutateKeywordPlansRequest
expected_names.append(MutateKeywordPlansRequest.__name__)
from google.ads.googleads.v8 import KeywordPlanOperation
expected_names.append(KeywordPlanOperation.__name__)
from google.ads.googleads.v8 import MutateKeywordPlansResponse
expected_names.append(MutateKeywordPlansResponse.__name__)
from google.ads.googleads.v8 import MutateKeywordPlansResult
expected_names.append(MutateKeywordPlansResult.__name__)
from google.ads.googleads.v8 import GenerateForecastCurveRequest
expected_names.append(GenerateForecastCurveRequest.__name__)
from google.ads.googleads.v8 import GenerateForecastCurveResponse
expected_names.append(GenerateForecastCurveResponse.__name__)
from google.ads.googleads.v8 import GenerateForecastTimeSeriesRequest
expected_names.append(GenerateForecastTimeSeriesRequest.__name__)
from google.ads.googleads.v8 import GenerateForecastTimeSeriesResponse
expected_names.append(GenerateForecastTimeSeriesResponse.__name__)
from google.ads.googleads.v8 import GenerateForecastMetricsRequest
expected_names.append(GenerateForecastMetricsRequest.__name__)
from google.ads.googleads.v8 import GenerateForecastMetricsResponse
expected_names.append(GenerateForecastMetricsResponse.__name__)
from google.ads.googleads.v8 import KeywordPlanCampaignForecast
expected_names.append(KeywordPlanCampaignForecast.__name__)
from google.ads.googleads.v8 import KeywordPlanAdGroupForecast
expected_names.append(KeywordPlanAdGroupForecast.__name__)
from google.ads.googleads.v8 import KeywordPlanKeywordForecast
expected_names.append(KeywordPlanKeywordForecast.__name__)
from google.ads.googleads.v8 import KeywordPlanCampaignForecastCurve
expected_names.append(KeywordPlanCampaignForecastCurve.__name__)
from google.ads.googleads.v8 import KeywordPlanMaxCpcBidForecastCurve
expected_names.append(KeywordPlanMaxCpcBidForecastCurve.__name__)
from google.ads.googleads.v8 import KeywordPlanMaxCpcBidForecast
expected_names.append(KeywordPlanMaxCpcBidForecast.__name__)
from google.ads.googleads.v8 import KeywordPlanWeeklyTimeSeriesForecast
expected_names.append(KeywordPlanWeeklyTimeSeriesForecast.__name__)
from google.ads.googleads.v8 import KeywordPlanWeeklyForecast
expected_names.append(KeywordPlanWeeklyForecast.__name__)
from google.ads.googleads.v8 import ForecastMetrics
expected_names.append(ForecastMetrics.__name__)
from google.ads.googleads.v8 import GenerateHistoricalMetricsRequest
expected_names.append(GenerateHistoricalMetricsRequest.__name__)
from google.ads.googleads.v8 import GenerateHistoricalMetricsResponse
expected_names.append(GenerateHistoricalMetricsResponse.__name__)
from google.ads.googleads.v8 import KeywordPlanKeywordHistoricalMetrics
expected_names.append(KeywordPlanKeywordHistoricalMetrics.__name__)
from google.ads.googleads.v8 import GetLabelRequest
expected_names.append(GetLabelRequest.__name__)
from google.ads.googleads.v8 import MutateLabelsRequest
expected_names.append(MutateLabelsRequest.__name__)
from google.ads.googleads.v8 import LabelOperation
expected_names.append(LabelOperation.__name__)
from google.ads.googleads.v8 import MutateLabelsResponse
expected_names.append(MutateLabelsResponse.__name__)
from google.ads.googleads.v8 import MutateLabelResult
expected_names.append(MutateLabelResult.__name__)
from google.ads.googleads.v8 import GetMediaFileRequest
expected_names.append(GetMediaFileRequest.__name__)
from google.ads.googleads.v8 import MutateMediaFilesRequest
expected_names.append(MutateMediaFilesRequest.__name__)
from google.ads.googleads.v8 import MediaFileOperation
expected_names.append(MediaFileOperation.__name__)
from google.ads.googleads.v8 import MutateMediaFilesResponse
expected_names.append(MutateMediaFilesResponse.__name__)
from google.ads.googleads.v8 import MutateMediaFileResult
expected_names.append(MutateMediaFileResult.__name__)
from google.ads.googleads.v8 import GetRemarketingActionRequest
expected_names.append(GetRemarketingActionRequest.__name__)
from google.ads.googleads.v8 import MutateRemarketingActionsRequest
expected_names.append(MutateRemarketingActionsRequest.__name__)
from google.ads.googleads.v8 import RemarketingActionOperation
expected_names.append(RemarketingActionOperation.__name__)
from google.ads.googleads.v8 import MutateRemarketingActionsResponse
expected_names.append(MutateRemarketingActionsResponse.__name__)
from google.ads.googleads.v8 import MutateRemarketingActionResult
expected_names.append(MutateRemarketingActionResult.__name__)
from google.ads.googleads.v8 import GetSharedCriterionRequest
expected_names.append(GetSharedCriterionRequest.__name__)
from google.ads.googleads.v8 import MutateSharedCriteriaRequest
expected_names.append(MutateSharedCriteriaRequest.__name__)
from google.ads.googleads.v8 import SharedCriterionOperation
expected_names.append(SharedCriterionOperation.__name__)
from google.ads.googleads.v8 import MutateSharedCriteriaResponse
expected_names.append(MutateSharedCriteriaResponse.__name__)
from google.ads.googleads.v8 import MutateSharedCriterionResult
expected_names.append(MutateSharedCriterionResult.__name__)
from google.ads.googleads.v8 import GetSharedSetRequest
expected_names.append(GetSharedSetRequest.__name__)
from google.ads.googleads.v8 import MutateSharedSetsRequest
expected_names.append(MutateSharedSetsRequest.__name__)
from google.ads.googleads.v8 import SharedSetOperation
expected_names.append(SharedSetOperation.__name__)
from google.ads.googleads.v8 import MutateSharedSetsResponse
expected_names.append(MutateSharedSetsResponse.__name__)
from google.ads.googleads.v8 import MutateSharedSetResult
expected_names.append(MutateSharedSetResult.__name__)
from google.ads.googleads.v8 import GetSmartCampaignSettingRequest
expected_names.append(GetSmartCampaignSettingRequest.__name__)
from google.ads.googleads.v8 import MutateSmartCampaignSettingsRequest
expected_names.append(MutateSmartCampaignSettingsRequest.__name__)
from google.ads.googleads.v8 import SmartCampaignSettingOperation
expected_names.append(SmartCampaignSettingOperation.__name__)
from google.ads.googleads.v8 import MutateSmartCampaignSettingsResponse
expected_names.append(MutateSmartCampaignSettingsResponse.__name__)
from google.ads.googleads.v8 import MutateSmartCampaignSettingResult
expected_names.append(MutateSmartCampaignSettingResult.__name__)
from google.ads.googleads.v8 import GetUserListRequest
expected_names.append(GetUserListRequest.__name__)
from google.ads.googleads.v8 import MutateUserListsRequest
expected_names.append(MutateUserListsRequest.__name__)
from google.ads.googleads.v8 import UserListOperation
expected_names.append(UserListOperation.__name__)
from google.ads.googleads.v8 import MutateUserListsResponse
expected_names.append(MutateUserListsResponse.__name__)
from google.ads.googleads.v8 import MutateUserListResult
expected_names.append(MutateUserListResult.__name__)
from google.ads.googleads.v8 import SearchGoogleAdsRequest
expected_names.append(SearchGoogleAdsRequest.__name__)
from google.ads.googleads.v8 import SearchGoogleAdsResponse
expected_names.append(SearchGoogleAdsResponse.__name__)
from google.ads.googleads.v8 import SearchGoogleAdsStreamRequest
expected_names.append(SearchGoogleAdsStreamRequest.__name__)
from google.ads.googleads.v8 import SearchGoogleAdsStreamResponse
expected_names.append(SearchGoogleAdsStreamResponse.__name__)
from google.ads.googleads.v8 import GoogleAdsRow
expected_names.append(GoogleAdsRow.__name__)
from google.ads.googleads.v8 import MutateGoogleAdsRequest
expected_names.append(MutateGoogleAdsRequest.__name__)
from google.ads.googleads.v8 import MutateGoogleAdsResponse
expected_names.append(MutateGoogleAdsResponse.__name__)
from google.ads.googleads.v8 import MutateOperation
expected_names.append(MutateOperation.__name__)
from google.ads.googleads.v8 import MutateOperationResponse
expected_names.append(MutateOperationResponse.__name__)
from google.ads.googleads.v8 import MutateBatchJobRequest
expected_names.append(MutateBatchJobRequest.__name__)
from google.ads.googleads.v8 import BatchJobOperation
expected_names.append(BatchJobOperation.__name__)
from google.ads.googleads.v8 import MutateBatchJobResponse
expected_names.append(MutateBatchJobResponse.__name__)
from google.ads.googleads.v8 import MutateBatchJobResult
expected_names.append(MutateBatchJobResult.__name__)
from google.ads.googleads.v8 import GetBatchJobRequest
expected_names.append(GetBatchJobRequest.__name__)
from google.ads.googleads.v8 import RunBatchJobRequest
expected_names.append(RunBatchJobRequest.__name__)
from google.ads.googleads.v8 import AddBatchJobOperationsRequest
expected_names.append(AddBatchJobOperationsRequest.__name__)
from google.ads.googleads.v8 import AddBatchJobOperationsResponse
expected_names.append(AddBatchJobOperationsResponse.__name__)
from google.ads.googleads.v8 import ListBatchJobResultsRequest
expected_names.append(ListBatchJobResultsRequest.__name__)
from google.ads.googleads.v8 import ListBatchJobResultsResponse
expected_names.append(ListBatchJobResultsResponse.__name__)
from google.ads.googleads.v8 import BatchJobResult
expected_names.append(BatchJobResult.__name__)
from google.ads.googleads.v8 import GetBiddingStrategySimulationRequest
expected_names.append(GetBiddingStrategySimulationRequest.__name__)
from google.ads.googleads.v8 import GetBillingSetupRequest
expected_names.append(GetBillingSetupRequest.__name__)
from google.ads.googleads.v8 import MutateBillingSetupRequest
expected_names.append(MutateBillingSetupRequest.__name__)
from google.ads.googleads.v8 import BillingSetupOperation
expected_names.append(BillingSetupOperation.__name__)
from google.ads.googleads.v8 import MutateBillingSetupResponse
expected_names.append(MutateBillingSetupResponse.__name__)
from google.ads.googleads.v8 import MutateBillingSetupResult
expected_names.append(MutateBillingSetupResult.__name__)
from google.ads.googleads.v8 import GetCampaignAudienceViewRequest
expected_names.append(GetCampaignAudienceViewRequest.__name__)
from google.ads.googleads.v8 import GetCampaignCriterionSimulationRequest
expected_names.append(GetCampaignCriterionSimulationRequest.__name__)
from google.ads.googleads.v8 import GetCampaignSimulationRequest
expected_names.append(GetCampaignSimulationRequest.__name__)
from google.ads.googleads.v8 import GetCarrierConstantRequest
expected_names.append(GetCarrierConstantRequest.__name__)
from google.ads.googleads.v8 import GetChangeStatusRequest
expected_names.append(GetChangeStatusRequest.__name__)
from google.ads.googleads.v8 import GetClickViewRequest
expected_names.append(GetClickViewRequest.__name__)
from google.ads.googleads.v8 import GetCombinedAudienceRequest
expected_names.append(GetCombinedAudienceRequest.__name__)
from google.ads.googleads.v8 import UploadConversionAdjustmentsRequest
expected_names.append(UploadConversionAdjustmentsRequest.__name__)
from google.ads.googleads.v8 import UploadConversionAdjustmentsResponse
expected_names.append(UploadConversionAdjustmentsResponse.__name__)
from google.ads.googleads.v8 import ConversionAdjustment
expected_names.append(ConversionAdjustment.__name__)
from google.ads.googleads.v8 import RestatementValue
expected_names.append(RestatementValue.__name__)
from google.ads.googleads.v8 import GclidDateTimePair
expected_names.append(GclidDateTimePair.__name__)
from google.ads.googleads.v8 import ConversionAdjustmentResult
expected_names.append(ConversionAdjustmentResult.__name__)
from google.ads.googleads.v8 import UploadClickConversionsRequest
expected_names.append(UploadClickConversionsRequest.__name__)
from google.ads.googleads.v8 import UploadClickConversionsResponse
expected_names.append(UploadClickConversionsResponse.__name__)
from google.ads.googleads.v8 import UploadCallConversionsRequest
expected_names.append(UploadCallConversionsRequest.__name__)
from google.ads.googleads.v8 import UploadCallConversionsResponse
expected_names.append(UploadCallConversionsResponse.__name__)
from google.ads.googleads.v8 import ClickConversion
expected_names.append(ClickConversion.__name__)
from google.ads.googleads.v8 import CallConversion
expected_names.append(CallConversion.__name__)
from google.ads.googleads.v8 import ExternalAttributionData
expected_names.append(ExternalAttributionData.__name__)
from google.ads.googleads.v8 import ClickConversionResult
expected_names.append(ClickConversionResult.__name__)
from google.ads.googleads.v8 import CallConversionResult
expected_names.append(CallConversionResult.__name__)
from google.ads.googleads.v8 import CustomVariable
expected_names.append(CustomVariable.__name__)
from google.ads.googleads.v8 import CartData
expected_names.append(CartData.__name__)
from google.ads.googleads.v8 import GetCurrencyConstantRequest
expected_names.append(GetCurrencyConstantRequest.__name__)
from google.ads.googleads.v8 import GetCustomAudienceRequest
expected_names.append(GetCustomAudienceRequest.__name__)
from google.ads.googleads.v8 import MutateCustomAudiencesRequest
expected_names.append(MutateCustomAudiencesRequest.__name__)
from google.ads.googleads.v8 import CustomAudienceOperation
expected_names.append(CustomAudienceOperation.__name__)
from google.ads.googleads.v8 import MutateCustomAudiencesResponse
expected_names.append(MutateCustomAudiencesResponse.__name__)
from google.ads.googleads.v8 import MutateCustomAudienceResult
expected_names.append(MutateCustomAudienceResult.__name__)
from google.ads.googleads.v8 import GetCustomInterestRequest
expected_names.append(GetCustomInterestRequest.__name__)
from google.ads.googleads.v8 import MutateCustomInterestsRequest
expected_names.append(MutateCustomInterestsRequest.__name__)
from google.ads.googleads.v8 import CustomInterestOperation
expected_names.append(CustomInterestOperation.__name__)
from google.ads.googleads.v8 import MutateCustomInterestsResponse
expected_names.append(MutateCustomInterestsResponse.__name__)
from google.ads.googleads.v8 import MutateCustomInterestResult
expected_names.append(MutateCustomInterestResult.__name__)
from google.ads.googleads.v8 import GetCustomerClientLinkRequest
expected_names.append(GetCustomerClientLinkRequest.__name__)
from google.ads.googleads.v8 import MutateCustomerClientLinkRequest
expected_names.append(MutateCustomerClientLinkRequest.__name__)
from google.ads.googleads.v8 import CustomerClientLinkOperation
expected_names.append(CustomerClientLinkOperation.__name__)
from google.ads.googleads.v8 import MutateCustomerClientLinkResponse
expected_names.append(MutateCustomerClientLinkResponse.__name__)
from google.ads.googleads.v8 import MutateCustomerClientLinkResult
expected_names.append(MutateCustomerClientLinkResult.__name__)
from google.ads.googleads.v8 import GetCustomerClientRequest
expected_names.append(GetCustomerClientRequest.__name__)
from google.ads.googleads.v8 import GetCustomerManagerLinkRequest
expected_names.append(GetCustomerManagerLinkRequest.__name__)
from google.ads.googleads.v8 import MutateCustomerManagerLinkRequest
expected_names.append(MutateCustomerManagerLinkRequest.__name__)
from google.ads.googleads.v8 import MoveManagerLinkRequest
expected_names.append(MoveManagerLinkRequest.__name__)
from google.ads.googleads.v8 import CustomerManagerLinkOperation
expected_names.append(CustomerManagerLinkOperation.__name__)
from google.ads.googleads.v8 import MutateCustomerManagerLinkResponse
expected_names.append(MutateCustomerManagerLinkResponse.__name__)
from google.ads.googleads.v8 import MoveManagerLinkResponse
expected_names.append(MoveManagerLinkResponse.__name__)
from google.ads.googleads.v8 import MutateCustomerManagerLinkResult
expected_names.append(MutateCustomerManagerLinkResult.__name__)
from google.ads.googleads.v8 import GetCustomerUserAccessInvitationRequest
expected_names.append(GetCustomerUserAccessInvitationRequest.__name__)
from google.ads.googleads.v8 import MutateCustomerUserAccessInvitationRequest
expected_names.append(MutateCustomerUserAccessInvitationRequest.__name__)
from google.ads.googleads.v8 import CustomerUserAccessInvitationOperation
expected_names.append(CustomerUserAccessInvitationOperation.__name__)
from google.ads.googleads.v8 import MutateCustomerUserAccessInvitationResponse
expected_names.append(MutateCustomerUserAccessInvitationResponse.__name__)
from google.ads.googleads.v8 import MutateCustomerUserAccessInvitationResult
expected_names.append(MutateCustomerUserAccessInvitationResult.__name__)
from google.ads.googleads.v8 import GetCustomerUserAccessRequest
expected_names.append(GetCustomerUserAccessRequest.__name__)
from google.ads.googleads.v8 import MutateCustomerUserAccessRequest
expected_names.append(MutateCustomerUserAccessRequest.__name__)
from google.ads.googleads.v8 import CustomerUserAccessOperation
expected_names.append(CustomerUserAccessOperation.__name__)
from google.ads.googleads.v8 import MutateCustomerUserAccessResponse
expected_names.append(MutateCustomerUserAccessResponse.__name__)
from google.ads.googleads.v8 import MutateCustomerUserAccessResult
expected_names.append(MutateCustomerUserAccessResult.__name__)
from google.ads.googleads.v8 import GetDetailPlacementViewRequest
expected_names.append(GetDetailPlacementViewRequest.__name__)
from google.ads.googleads.v8 import GetDetailedDemographicRequest
expected_names.append(GetDetailedDemographicRequest.__name__)
from google.ads.googleads.v8 import GetDisplayKeywordViewRequest
expected_names.append(GetDisplayKeywordViewRequest.__name__)
from google.ads.googleads.v8 import GetDistanceViewRequest
expected_names.append(GetDistanceViewRequest.__name__)
from google.ads.googleads.v8 import GetDomainCategoryRequest
expected_names.append(GetDomainCategoryRequest.__name__)
from google.ads.googleads.v8 import GetDynamicSearchAdsSearchTermViewRequest
expected_names.append(GetDynamicSearchAdsSearchTermViewRequest.__name__)
from google.ads.googleads.v8 import GetExpandedLandingPageViewRequest
expected_names.append(GetExpandedLandingPageViewRequest.__name__)
from google.ads.googleads.v8 import GetFeedPlaceholderViewRequest
expected_names.append(GetFeedPlaceholderViewRequest.__name__)
from google.ads.googleads.v8 import GetGenderViewRequest
expected_names.append(GetGenderViewRequest.__name__)
from google.ads.googleads.v8 import GetGeoTargetConstantRequest
expected_names.append(GetGeoTargetConstantRequest.__name__)
from google.ads.googleads.v8 import SuggestGeoTargetConstantsRequest
expected_names.append(SuggestGeoTargetConstantsRequest.__name__)
from google.ads.googleads.v8 import SuggestGeoTargetConstantsResponse
expected_names.append(SuggestGeoTargetConstantsResponse.__name__)
from google.ads.googleads.v8 import GeoTargetConstantSuggestion
expected_names.append(GeoTargetConstantSuggestion.__name__)
from google.ads.googleads.v8 import GetGeographicViewRequest
expected_names.append(GetGeographicViewRequest.__name__)
from google.ads.googleads.v8 import GetGoogleAdsFieldRequest
expected_names.append(GetGoogleAdsFieldRequest.__name__)
from google.ads.googleads.v8 import SearchGoogleAdsFieldsRequest
expected_names.append(SearchGoogleAdsFieldsRequest.__name__)
from google.ads.googleads.v8 import SearchGoogleAdsFieldsResponse
expected_names.append(SearchGoogleAdsFieldsResponse.__name__)
from google.ads.googleads.v8 import GetGroupPlacementViewRequest
expected_names.append(GetGroupPlacementViewRequest.__name__)
from google.ads.googleads.v8 import GetHotelGroupViewRequest
expected_names.append(GetHotelGroupViewRequest.__name__)
from google.ads.googleads.v8 import GetHotelPerformanceViewRequest
expected_names.append(GetHotelPerformanceViewRequest.__name__)
from google.ads.googleads.v8 import GetIncomeRangeViewRequest
expected_names.append(GetIncomeRangeViewRequest.__name__)
from google.ads.googleads.v8 import ListInvoicesRequest
expected_names.append(ListInvoicesRequest.__name__)
from google.ads.googleads.v8 import ListInvoicesResponse
expected_names.append(ListInvoicesResponse.__name__)
from google.ads.googleads.v8 import GenerateKeywordIdeasRequest
expected_names.append(GenerateKeywordIdeasRequest.__name__)
from google.ads.googleads.v8 import KeywordAndUrlSeed
expected_names.append(KeywordAndUrlSeed.__name__)
from google.ads.googleads.v8 import KeywordSeed
expected_names.append(KeywordSeed.__name__)
from google.ads.googleads.v8 import SiteSeed
expected_names.append(SiteSeed.__name__)
from google.ads.googleads.v8 import UrlSeed
expected_names.append(UrlSeed.__name__)
from google.ads.googleads.v8 import GenerateKeywordIdeaResponse
expected_names.append(GenerateKeywordIdeaResponse.__name__)
from google.ads.googleads.v8 import GenerateKeywordIdeaResult
expected_names.append(GenerateKeywordIdeaResult.__name__)
from google.ads.googleads.v8 import GetKeywordThemeConstantRequest
expected_names.append(GetKeywordThemeConstantRequest.__name__)
from google.ads.googleads.v8 import SuggestKeywordThemeConstantsRequest
expected_names.append(SuggestKeywordThemeConstantsRequest.__name__)
from google.ads.googleads.v8 import SuggestKeywordThemeConstantsResponse
expected_names.append(SuggestKeywordThemeConstantsResponse.__name__)
from google.ads.googleads.v8 import GetKeywordViewRequest
expected_names.append(GetKeywordViewRequest.__name__)
from google.ads.googleads.v8 import GetLandingPageViewRequest
expected_names.append(GetLandingPageViewRequest.__name__)
from google.ads.googleads.v8 import GetLanguageConstantRequest
expected_names.append(GetLanguageConstantRequest.__name__)
from google.ads.googleads.v8 import GetLifeEventRequest
expected_names.append(GetLifeEventRequest.__name__)
from google.ads.googleads.v8 import GetLocationViewRequest
expected_names.append(GetLocationViewRequest.__name__)
from google.ads.googleads.v8 import GetManagedPlacementViewRequest
expected_names.append(GetManagedPlacementViewRequest.__name__)
from google.ads.googleads.v8 import ListMerchantCenterLinksRequest
expected_names.append(ListMerchantCenterLinksRequest.__name__)
from google.ads.googleads.v8 import ListMerchantCenterLinksResponse
expected_names.append(ListMerchantCenterLinksResponse.__name__)
from google.ads.googleads.v8 import GetMerchantCenterLinkRequest
expected_names.append(GetMerchantCenterLinkRequest.__name__)
from google.ads.googleads.v8 import MutateMerchantCenterLinkRequest
expected_names.append(MutateMerchantCenterLinkRequest.__name__)
from google.ads.googleads.v8 import MerchantCenterLinkOperation
expected_names.append(MerchantCenterLinkOperation.__name__)
from google.ads.googleads.v8 import MutateMerchantCenterLinkResponse
expected_names.append(MutateMerchantCenterLinkResponse.__name__)
from google.ads.googleads.v8 import MutateMerchantCenterLinkResult
expected_names.append(MutateMerchantCenterLinkResult.__name__)
from google.ads.googleads.v8 import GetMobileAppCategoryConstantRequest
expected_names.append(GetMobileAppCategoryConstantRequest.__name__)
from google.ads.googleads.v8 import GetMobileDeviceConstantRequest
expected_names.append(GetMobileDeviceConstantRequest.__name__)
from google.ads.googleads.v8 import CreateOfflineUserDataJobRequest
expected_names.append(CreateOfflineUserDataJobRequest.__name__)
from google.ads.googleads.v8 import CreateOfflineUserDataJobResponse
expected_names.append(CreateOfflineUserDataJobResponse.__name__)
from google.ads.googleads.v8 import GetOfflineUserDataJobRequest
expected_names.append(GetOfflineUserDataJobRequest.__name__)
from google.ads.googleads.v8 import RunOfflineUserDataJobRequest
expected_names.append(RunOfflineUserDataJobRequest.__name__)
from google.ads.googleads.v8 import AddOfflineUserDataJobOperationsRequest
expected_names.append(AddOfflineUserDataJobOperationsRequest.__name__)
from google.ads.googleads.v8 import OfflineUserDataJobOperation
expected_names.append(OfflineUserDataJobOperation.__name__)
from google.ads.googleads.v8 import AddOfflineUserDataJobOperationsResponse
expected_names.append(AddOfflineUserDataJobOperationsResponse.__name__)
from google.ads.googleads.v8 import GetOperatingSystemVersionConstantRequest
expected_names.append(GetOperatingSystemVersionConstantRequest.__name__)
from google.ads.googleads.v8 import GetPaidOrganicSearchTermViewRequest
expected_names.append(GetPaidOrganicSearchTermViewRequest.__name__)
from google.ads.googleads.v8 import GetParentalStatusViewRequest
expected_names.append(GetParentalStatusViewRequest.__name__)
from google.ads.googleads.v8 import ListPaymentsAccountsRequest
expected_names.append(ListPaymentsAccountsRequest.__name__)
from google.ads.googleads.v8 import ListPaymentsAccountsResponse
expected_names.append(ListPaymentsAccountsResponse.__name__)
from google.ads.googleads.v8 import GetProductBiddingCategoryConstantRequest
expected_names.append(GetProductBiddingCategoryConstantRequest.__name__)
from google.ads.googleads.v8 import GetProductGroupViewRequest
expected_names.append(GetProductGroupViewRequest.__name__)
from google.ads.googleads.v8 import ListPlannableLocationsRequest
expected_names.append(ListPlannableLocationsRequest.__name__)
from google.ads.googleads.v8 import ListPlannableLocationsResponse
expected_names.append(ListPlannableLocationsResponse.__name__)
from google.ads.googleads.v8 import PlannableLocation
expected_names.append(PlannableLocation.__name__)
from google.ads.googleads.v8 import ListPlannableProductsRequest
expected_names.append(ListPlannableProductsRequest.__name__)
from google.ads.googleads.v8 import ListPlannableProductsResponse
expected_names.append(ListPlannableProductsResponse.__name__)
from google.ads.googleads.v8 import ProductMetadata
expected_names.append(ProductMetadata.__name__)
from google.ads.googleads.v8 import PlannableTargeting
expected_names.append(PlannableTargeting.__name__)
from google.ads.googleads.v8 import GenerateProductMixIdeasRequest
expected_names.append(GenerateProductMixIdeasRequest.__name__)
from google.ads.googleads.v8 import Preferences
expected_names.append(Preferences.__name__)
from google.ads.googleads.v8 import GenerateProductMixIdeasResponse
expected_names.append(GenerateProductMixIdeasResponse.__name__)
from google.ads.googleads.v8 import ProductAllocation
expected_names.append(ProductAllocation.__name__)
from google.ads.googleads.v8 import GenerateReachForecastRequest
expected_names.append(GenerateReachForecastRequest.__name__)
from google.ads.googleads.v8 import FrequencyCap
expected_names.append(FrequencyCap.__name__)
from google.ads.googleads.v8 import Targeting
expected_names.append(Targeting.__name__)
from google.ads.googleads.v8 import CampaignDuration
expected_names.append(CampaignDuration.__name__)
from google.ads.googleads.v8 import PlannedProduct
expected_names.append(PlannedProduct.__name__)
from google.ads.googleads.v8 import GenerateReachForecastResponse
expected_names.append(GenerateReachForecastResponse.__name__)
from google.ads.googleads.v8 import ReachCurve
expected_names.append(ReachCurve.__name__)
from google.ads.googleads.v8 import ReachForecast
expected_names.append(ReachForecast.__name__)
from google.ads.googleads.v8 import Forecast
expected_names.append(Forecast.__name__)
from google.ads.googleads.v8 import PlannedProductReachForecast
expected_names.append(PlannedProductReachForecast.__name__)
from google.ads.googleads.v8 import PlannedProductForecast
expected_names.append(PlannedProductForecast.__name__)
from google.ads.googleads.v8 import OnTargetAudienceMetrics
expected_names.append(OnTargetAudienceMetrics.__name__)
from google.ads.googleads.v8 import GetRecommendationRequest
expected_names.append(GetRecommendationRequest.__name__)
from google.ads.googleads.v8 import ApplyRecommendationRequest
expected_names.append(ApplyRecommendationRequest.__name__)
from google.ads.googleads.v8 import ApplyRecommendationOperation
expected_names.append(ApplyRecommendationOperation.__name__)
from google.ads.googleads.v8 import ApplyRecommendationResponse
expected_names.append(ApplyRecommendationResponse.__name__)
from google.ads.googleads.v8 import ApplyRecommendationResult
expected_names.append(ApplyRecommendationResult.__name__)
from google.ads.googleads.v8 import DismissRecommendationRequest
expected_names.append(DismissRecommendationRequest.__name__)
from google.ads.googleads.v8 import DismissRecommendationResponse
expected_names.append(DismissRecommendationResponse.__name__)
from google.ads.googleads.v8 import GetSearchTermViewRequest
expected_names.append(GetSearchTermViewRequest.__name__)
from google.ads.googleads.v8 import GetShoppingPerformanceViewRequest
expected_names.append(GetShoppingPerformanceViewRequest.__name__)
from google.ads.googleads.v8 import GetSmartCampaignSearchTermViewRequest
expected_names.append(GetSmartCampaignSearchTermViewRequest.__name__)
from google.ads.googleads.v8 import SuggestSmartCampaignBudgetOptionsRequest
expected_names.append(SuggestSmartCampaignBudgetOptionsRequest.__name__)
from google.ads.googleads.v8 import SmartCampaignSuggestionInfo
expected_names.append(SmartCampaignSuggestionInfo.__name__)
from google.ads.googleads.v8 import SuggestSmartCampaignBudgetOptionsResponse
expected_names.append(SuggestSmartCampaignBudgetOptionsResponse.__name__)
from google.ads.googleads.v8 import GetThirdPartyAppAnalyticsLinkRequest
expected_names.append(GetThirdPartyAppAnalyticsLinkRequest.__name__)
from google.ads.googleads.v8 import RegenerateShareableLinkIdRequest
expected_names.append(RegenerateShareableLinkIdRequest.__name__)
from google.ads.googleads.v8 import RegenerateShareableLinkIdResponse
expected_names.append(RegenerateShareableLinkIdResponse.__name__)
from google.ads.googleads.v8 import GetTopicConstantRequest
expected_names.append(GetTopicConstantRequest.__name__)
from google.ads.googleads.v8 import GetTopicViewRequest
expected_names.append(GetTopicViewRequest.__name__)
from google.ads.googleads.v8 import UploadUserDataRequest
expected_names.append(UploadUserDataRequest.__name__)
from google.ads.googleads.v8 import UserDataOperation
expected_names.append(UserDataOperation.__name__)
from google.ads.googleads.v8 import UploadUserDataResponse
expected_names.append(UploadUserDataResponse.__name__)
from google.ads.googleads.v8 import GetUserInterestRequest
expected_names.append(GetUserInterestRequest.__name__)
from google.ads.googleads.v8 import GetUserLocationViewRequest
expected_names.append(GetUserLocationViewRequest.__name__)
from google.ads.googleads.v8 import GetVideoRequest
expected_names.append(GetVideoRequest.__name__)
from google.ads.googleads.v8 import GetWebpageViewRequest
expected_names.append(GetWebpageViewRequest.__name__)
# Client and transport classes
from google.ads.googleads.v8 import WebpageViewServiceClient
expected_names.append(WebpageViewServiceClient.__name__)
from google.ads.googleads.v8 import WebpageViewServiceTransport
expected_names.append(WebpageViewServiceTransport.__name__)
from google.ads.googleads.v8 import WebpageViewServiceGrpcTransport
expected_names.append(WebpageViewServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import VideoServiceClient
expected_names.append(VideoServiceClient.__name__)
from google.ads.googleads.v8 import VideoServiceTransport
expected_names.append(VideoServiceTransport.__name__)
from google.ads.googleads.v8 import VideoServiceGrpcTransport
expected_names.append(VideoServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import UserLocationViewServiceClient
expected_names.append(UserLocationViewServiceClient.__name__)
from google.ads.googleads.v8 import UserLocationViewServiceTransport
expected_names.append(UserLocationViewServiceTransport.__name__)
from google.ads.googleads.v8 import UserLocationViewServiceGrpcTransport
expected_names.append(UserLocationViewServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import UserInterestServiceClient
expected_names.append(UserInterestServiceClient.__name__)
from google.ads.googleads.v8 import UserInterestServiceTransport
expected_names.append(UserInterestServiceTransport.__name__)
from google.ads.googleads.v8 import UserInterestServiceGrpcTransport
expected_names.append(UserInterestServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import UserDataServiceClient
expected_names.append(UserDataServiceClient.__name__)
from google.ads.googleads.v8 import UserDataServiceTransport
expected_names.append(UserDataServiceTransport.__name__)
from google.ads.googleads.v8 import UserDataServiceGrpcTransport
expected_names.append(UserDataServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import TopicViewServiceClient
expected_names.append(TopicViewServiceClient.__name__)
from google.ads.googleads.v8 import TopicViewServiceTransport
expected_names.append(TopicViewServiceTransport.__name__)
from google.ads.googleads.v8 import TopicViewServiceGrpcTransport
expected_names.append(TopicViewServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import TopicConstantServiceClient
expected_names.append(TopicConstantServiceClient.__name__)
from google.ads.googleads.v8 import TopicConstantServiceTransport
expected_names.append(TopicConstantServiceTransport.__name__)
from google.ads.googleads.v8 import TopicConstantServiceGrpcTransport
expected_names.append(TopicConstantServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import ThirdPartyAppAnalyticsLinkServiceClient
expected_names.append(ThirdPartyAppAnalyticsLinkServiceClient.__name__)
from google.ads.googleads.v8 import ThirdPartyAppAnalyticsLinkServiceTransport
expected_names.append(ThirdPartyAppAnalyticsLinkServiceTransport.__name__)
from google.ads.googleads.v8 import ThirdPartyAppAnalyticsLinkServiceGrpcTransport
expected_names.append(ThirdPartyAppAnalyticsLinkServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import SmartCampaignSuggestServiceClient
expected_names.append(SmartCampaignSuggestServiceClient.__name__)
from google.ads.googleads.v8 import SmartCampaignSuggestServiceTransport
expected_names.append(SmartCampaignSuggestServiceTransport.__name__)
from google.ads.googleads.v8 import SmartCampaignSuggestServiceGrpcTransport
expected_names.append(SmartCampaignSuggestServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import SmartCampaignSearchTermViewServiceClient
expected_names.append(SmartCampaignSearchTermViewServiceClient.__name__)
from google.ads.googleads.v8 import SmartCampaignSearchTermViewServiceTransport
expected_names.append(SmartCampaignSearchTermViewServiceTransport.__name__)
from google.ads.googleads.v8 import SmartCampaignSearchTermViewServiceGrpcTransport
expected_names.append(SmartCampaignSearchTermViewServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import ShoppingPerformanceViewServiceClient
expected_names.append(ShoppingPerformanceViewServiceClient.__name__)
from google.ads.googleads.v8 import ShoppingPerformanceViewServiceTransport
expected_names.append(ShoppingPerformanceViewServiceTransport.__name__)
from google.ads.googleads.v8 import ShoppingPerformanceViewServiceGrpcTransport
expected_names.append(ShoppingPerformanceViewServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import SearchTermViewServiceClient
expected_names.append(SearchTermViewServiceClient.__name__)
from google.ads.googleads.v8 import SearchTermViewServiceTransport
expected_names.append(SearchTermViewServiceTransport.__name__)
from google.ads.googleads.v8 import SearchTermViewServiceGrpcTransport
expected_names.append(SearchTermViewServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import RecommendationServiceClient
expected_names.append(RecommendationServiceClient.__name__)
from google.ads.googleads.v8 import RecommendationServiceTransport
expected_names.append(RecommendationServiceTransport.__name__)
from google.ads.googleads.v8 import RecommendationServiceGrpcTransport
expected_names.append(RecommendationServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import ReachPlanServiceClient
expected_names.append(ReachPlanServiceClient.__name__)
from google.ads.googleads.v8 import ReachPlanServiceTransport
expected_names.append(ReachPlanServiceTransport.__name__)
from google.ads.googleads.v8 import ReachPlanServiceGrpcTransport
expected_names.append(ReachPlanServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import ProductGroupViewServiceClient
expected_names.append(ProductGroupViewServiceClient.__name__)
from google.ads.googleads.v8 import ProductGroupViewServiceTransport
expected_names.append(ProductGroupViewServiceTransport.__name__)
from google.ads.googleads.v8 import ProductGroupViewServiceGrpcTransport
expected_names.append(ProductGroupViewServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import ProductBiddingCategoryConstantServiceClient
expected_names.append(ProductBiddingCategoryConstantServiceClient.__name__)
from google.ads.googleads.v8 import ProductBiddingCategoryConstantServiceTransport
expected_names.append(ProductBiddingCategoryConstantServiceTransport.__name__)
from google.ads.googleads.v8 import ProductBiddingCategoryConstantServiceGrpcTransport
expected_names.append(ProductBiddingCategoryConstantServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import PaymentsAccountServiceClient
expected_names.append(PaymentsAccountServiceClient.__name__)
from google.ads.googleads.v8 import PaymentsAccountServiceTransport
expected_names.append(PaymentsAccountServiceTransport.__name__)
from google.ads.googleads.v8 import PaymentsAccountServiceGrpcTransport
expected_names.append(PaymentsAccountServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import ParentalStatusViewServiceClient
expected_names.append(ParentalStatusViewServiceClient.__name__)
from google.ads.googleads.v8 import ParentalStatusViewServiceTransport
expected_names.append(ParentalStatusViewServiceTransport.__name__)
from google.ads.googleads.v8 import ParentalStatusViewServiceGrpcTransport
expected_names.append(ParentalStatusViewServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import PaidOrganicSearchTermViewServiceClient
expected_names.append(PaidOrganicSearchTermViewServiceClient.__name__)
from google.ads.googleads.v8 import PaidOrganicSearchTermViewServiceTransport
expected_names.append(PaidOrganicSearchTermViewServiceTransport.__name__)
from google.ads.googleads.v8 import PaidOrganicSearchTermViewServiceGrpcTransport
expected_names.append(PaidOrganicSearchTermViewServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import OperatingSystemVersionConstantServiceClient
expected_names.append(OperatingSystemVersionConstantServiceClient.__name__)
from google.ads.googleads.v8 import OperatingSystemVersionConstantServiceTransport
expected_names.append(OperatingSystemVersionConstantServiceTransport.__name__)
from google.ads.googleads.v8 import OperatingSystemVersionConstantServiceGrpcTransport
expected_names.append(OperatingSystemVersionConstantServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import OfflineUserDataJobServiceClient
expected_names.append(OfflineUserDataJobServiceClient.__name__)
from google.ads.googleads.v8 import OfflineUserDataJobServiceTransport
expected_names.append(OfflineUserDataJobServiceTransport.__name__)
from google.ads.googleads.v8 import OfflineUserDataJobServiceGrpcTransport
expected_names.append(OfflineUserDataJobServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import MobileDeviceConstantServiceClient
expected_names.append(MobileDeviceConstantServiceClient.__name__)
from google.ads.googleads.v8 import MobileDeviceConstantServiceTransport
expected_names.append(MobileDeviceConstantServiceTransport.__name__)
from google.ads.googleads.v8 import MobileDeviceConstantServiceGrpcTransport
expected_names.append(MobileDeviceConstantServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import MobileAppCategoryConstantServiceClient
expected_names.append(MobileAppCategoryConstantServiceClient.__name__)
from google.ads.googleads.v8 import MobileAppCategoryConstantServiceTransport
expected_names.append(MobileAppCategoryConstantServiceTransport.__name__)
from google.ads.googleads.v8 import MobileAppCategoryConstantServiceGrpcTransport
expected_names.append(MobileAppCategoryConstantServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import MerchantCenterLinkServiceClient
expected_names.append(MerchantCenterLinkServiceClient.__name__)
from google.ads.googleads.v8 import MerchantCenterLinkServiceTransport
expected_names.append(MerchantCenterLinkServiceTransport.__name__)
from google.ads.googleads.v8 import MerchantCenterLinkServiceGrpcTransport
expected_names.append(MerchantCenterLinkServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import ManagedPlacementViewServiceClient
expected_names.append(ManagedPlacementViewServiceClient.__name__)
from google.ads.googleads.v8 import ManagedPlacementViewServiceTransport
expected_names.append(ManagedPlacementViewServiceTransport.__name__)
from google.ads.googleads.v8 import ManagedPlacementViewServiceGrpcTransport
expected_names.append(ManagedPlacementViewServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import LocationViewServiceClient
expected_names.append(LocationViewServiceClient.__name__)
from google.ads.googleads.v8 import LocationViewServiceTransport
expected_names.append(LocationViewServiceTransport.__name__)
from google.ads.googleads.v8 import LocationViewServiceGrpcTransport
expected_names.append(LocationViewServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import LifeEventServiceClient
expected_names.append(LifeEventServiceClient.__name__)
from google.ads.googleads.v8 import LifeEventServiceTransport
expected_names.append(LifeEventServiceTransport.__name__)
from google.ads.googleads.v8 import LifeEventServiceGrpcTransport
expected_names.append(LifeEventServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import LanguageConstantServiceClient
expected_names.append(LanguageConstantServiceClient.__name__)
from google.ads.googleads.v8 import LanguageConstantServiceTransport
expected_names.append(LanguageConstantServiceTransport.__name__)
from google.ads.googleads.v8 import LanguageConstantServiceGrpcTransport
expected_names.append(LanguageConstantServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import LandingPageViewServiceClient
expected_names.append(LandingPageViewServiceClient.__name__)
from google.ads.googleads.v8 import LandingPageViewServiceTransport
expected_names.append(LandingPageViewServiceTransport.__name__)
from google.ads.googleads.v8 import LandingPageViewServiceGrpcTransport
expected_names.append(LandingPageViewServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import KeywordViewServiceClient
expected_names.append(KeywordViewServiceClient.__name__)
from google.ads.googleads.v8 import KeywordViewServiceTransport
expected_names.append(KeywordViewServiceTransport.__name__)
from google.ads.googleads.v8 import KeywordViewServiceGrpcTransport
expected_names.append(KeywordViewServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import KeywordThemeConstantServiceClient
expected_names.append(KeywordThemeConstantServiceClient.__name__)
from google.ads.googleads.v8 import KeywordThemeConstantServiceTransport
expected_names.append(KeywordThemeConstantServiceTransport.__name__)
from google.ads.googleads.v8 import KeywordThemeConstantServiceGrpcTransport
expected_names.append(KeywordThemeConstantServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import KeywordPlanIdeaServiceClient
expected_names.append(KeywordPlanIdeaServiceClient.__name__)
from google.ads.googleads.v8 import KeywordPlanIdeaServiceTransport
expected_names.append(KeywordPlanIdeaServiceTransport.__name__)
from google.ads.googleads.v8 import KeywordPlanIdeaServiceGrpcTransport
expected_names.append(KeywordPlanIdeaServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import InvoiceServiceClient
expected_names.append(InvoiceServiceClient.__name__)
from google.ads.googleads.v8 import InvoiceServiceTransport
expected_names.append(InvoiceServiceTransport.__name__)
from google.ads.googleads.v8 import InvoiceServiceGrpcTransport
expected_names.append(InvoiceServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import IncomeRangeViewServiceClient
expected_names.append(IncomeRangeViewServiceClient.__name__)
from google.ads.googleads.v8 import IncomeRangeViewServiceTransport
expected_names.append(IncomeRangeViewServiceTransport.__name__)
from google.ads.googleads.v8 import IncomeRangeViewServiceGrpcTransport
expected_names.append(IncomeRangeViewServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import HotelPerformanceViewServiceClient
expected_names.append(HotelPerformanceViewServiceClient.__name__)
from google.ads.googleads.v8 import HotelPerformanceViewServiceTransport
expected_names.append(HotelPerformanceViewServiceTransport.__name__)
from google.ads.googleads.v8 import HotelPerformanceViewServiceGrpcTransport
expected_names.append(HotelPerformanceViewServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import HotelGroupViewServiceClient
expected_names.append(HotelGroupViewServiceClient.__name__)
from google.ads.googleads.v8 import HotelGroupViewServiceTransport
expected_names.append(HotelGroupViewServiceTransport.__name__)
from google.ads.googleads.v8 import HotelGroupViewServiceGrpcTransport
expected_names.append(HotelGroupViewServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import GroupPlacementViewServiceClient
expected_names.append(GroupPlacementViewServiceClient.__name__)
from google.ads.googleads.v8 import GroupPlacementViewServiceTransport
expected_names.append(GroupPlacementViewServiceTransport.__name__)
from google.ads.googleads.v8 import GroupPlacementViewServiceGrpcTransport
expected_names.append(GroupPlacementViewServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import GoogleAdsFieldServiceClient
expected_names.append(GoogleAdsFieldServiceClient.__name__)
from google.ads.googleads.v8 import GoogleAdsFieldServiceTransport
expected_names.append(GoogleAdsFieldServiceTransport.__name__)
from google.ads.googleads.v8 import GoogleAdsFieldServiceGrpcTransport
expected_names.append(GoogleAdsFieldServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import GeographicViewServiceClient
expected_names.append(GeographicViewServiceClient.__name__)
from google.ads.googleads.v8 import GeographicViewServiceTransport
expected_names.append(GeographicViewServiceTransport.__name__)
from google.ads.googleads.v8 import GeographicViewServiceGrpcTransport
expected_names.append(GeographicViewServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import GeoTargetConstantServiceClient
expected_names.append(GeoTargetConstantServiceClient.__name__)
from google.ads.googleads.v8 import GeoTargetConstantServiceTransport
expected_names.append(GeoTargetConstantServiceTransport.__name__)
from google.ads.googleads.v8 import GeoTargetConstantServiceGrpcTransport
expected_names.append(GeoTargetConstantServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import GenderViewServiceClient
expected_names.append(GenderViewServiceClient.__name__)
from google.ads.googleads.v8 import GenderViewServiceTransport
expected_names.append(GenderViewServiceTransport.__name__)
from google.ads.googleads.v8 import GenderViewServiceGrpcTransport
expected_names.append(GenderViewServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import FeedPlaceholderViewServiceClient
expected_names.append(FeedPlaceholderViewServiceClient.__name__)
from google.ads.googleads.v8 import FeedPlaceholderViewServiceTransport
expected_names.append(FeedPlaceholderViewServiceTransport.__name__)
from google.ads.googleads.v8 import FeedPlaceholderViewServiceGrpcTransport
expected_names.append(FeedPlaceholderViewServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import ExpandedLandingPageViewServiceClient
expected_names.append(ExpandedLandingPageViewServiceClient.__name__)
from google.ads.googleads.v8 import ExpandedLandingPageViewServiceTransport
expected_names.append(ExpandedLandingPageViewServiceTransport.__name__)
from google.ads.googleads.v8 import ExpandedLandingPageViewServiceGrpcTransport
expected_names.append(ExpandedLandingPageViewServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import DynamicSearchAdsSearchTermViewServiceClient
expected_names.append(DynamicSearchAdsSearchTermViewServiceClient.__name__)
from google.ads.googleads.v8 import DynamicSearchAdsSearchTermViewServiceTransport
expected_names.append(DynamicSearchAdsSearchTermViewServiceTransport.__name__)
from google.ads.googleads.v8 import DynamicSearchAdsSearchTermViewServiceGrpcTransport
expected_names.append(DynamicSearchAdsSearchTermViewServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import DomainCategoryServiceClient
expected_names.append(DomainCategoryServiceClient.__name__)
from google.ads.googleads.v8 import DomainCategoryServiceTransport
expected_names.append(DomainCategoryServiceTransport.__name__)
from google.ads.googleads.v8 import DomainCategoryServiceGrpcTransport
expected_names.append(DomainCategoryServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import DistanceViewServiceClient
expected_names.append(DistanceViewServiceClient.__name__)
from google.ads.googleads.v8 import DistanceViewServiceTransport
expected_names.append(DistanceViewServiceTransport.__name__)
from google.ads.googleads.v8 import DistanceViewServiceGrpcTransport
expected_names.append(DistanceViewServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import DisplayKeywordViewServiceClient
expected_names.append(DisplayKeywordViewServiceClient.__name__)
from google.ads.googleads.v8 import DisplayKeywordViewServiceTransport
expected_names.append(DisplayKeywordViewServiceTransport.__name__)
from google.ads.googleads.v8 import DisplayKeywordViewServiceGrpcTransport
expected_names.append(DisplayKeywordViewServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import DetailedDemographicServiceClient
expected_names.append(DetailedDemographicServiceClient.__name__)
from google.ads.googleads.v8 import DetailedDemographicServiceTransport
expected_names.append(DetailedDemographicServiceTransport.__name__)
from google.ads.googleads.v8 import DetailedDemographicServiceGrpcTransport
expected_names.append(DetailedDemographicServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import DetailPlacementViewServiceClient
expected_names.append(DetailPlacementViewServiceClient.__name__)
from google.ads.googleads.v8 import DetailPlacementViewServiceTransport
expected_names.append(DetailPlacementViewServiceTransport.__name__)
from google.ads.googleads.v8 import DetailPlacementViewServiceGrpcTransport
expected_names.append(DetailPlacementViewServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import CustomerUserAccessServiceClient
expected_names.append(CustomerUserAccessServiceClient.__name__)
from google.ads.googleads.v8 import CustomerUserAccessServiceTransport
expected_names.append(CustomerUserAccessServiceTransport.__name__)
from google.ads.googleads.v8 import CustomerUserAccessServiceGrpcTransport
expected_names.append(CustomerUserAccessServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import CustomerUserAccessInvitationServiceClient
expected_names.append(CustomerUserAccessInvitationServiceClient.__name__)
from google.ads.googleads.v8 import CustomerUserAccessInvitationServiceTransport
expected_names.append(CustomerUserAccessInvitationServiceTransport.__name__)
from google.ads.googleads.v8 import CustomerUserAccessInvitationServiceGrpcTransport
expected_names.append(CustomerUserAccessInvitationServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import CustomerManagerLinkServiceClient
expected_names.append(CustomerManagerLinkServiceClient.__name__)
from google.ads.googleads.v8 import CustomerManagerLinkServiceTransport
expected_names.append(CustomerManagerLinkServiceTransport.__name__)
from google.ads.googleads.v8 import CustomerManagerLinkServiceGrpcTransport
expected_names.append(CustomerManagerLinkServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import CustomerClientServiceClient
expected_names.append(CustomerClientServiceClient.__name__)
from google.ads.googleads.v8 import CustomerClientServiceTransport
expected_names.append(CustomerClientServiceTransport.__name__)
from google.ads.googleads.v8 import CustomerClientServiceGrpcTransport
expected_names.append(CustomerClientServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import CustomerClientLinkServiceClient
expected_names.append(CustomerClientLinkServiceClient.__name__)
from google.ads.googleads.v8 import CustomerClientLinkServiceTransport
expected_names.append(CustomerClientLinkServiceTransport.__name__)
from google.ads.googleads.v8 import CustomerClientLinkServiceGrpcTransport
expected_names.append(CustomerClientLinkServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import CustomInterestServiceClient
expected_names.append(CustomInterestServiceClient.__name__)
from google.ads.googleads.v8 import CustomInterestServiceTransport
expected_names.append(CustomInterestServiceTransport.__name__)
from google.ads.googleads.v8 import CustomInterestServiceGrpcTransport
expected_names.append(CustomInterestServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import CustomAudienceServiceClient
expected_names.append(CustomAudienceServiceClient.__name__)
from google.ads.googleads.v8 import CustomAudienceServiceTransport
expected_names.append(CustomAudienceServiceTransport.__name__)
from google.ads.googleads.v8 import CustomAudienceServiceGrpcTransport
expected_names.append(CustomAudienceServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import CurrencyConstantServiceClient
expected_names.append(CurrencyConstantServiceClient.__name__)
from google.ads.googleads.v8 import CurrencyConstantServiceTransport
expected_names.append(CurrencyConstantServiceTransport.__name__)
from google.ads.googleads.v8 import CurrencyConstantServiceGrpcTransport
expected_names.append(CurrencyConstantServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import ConversionUploadServiceClient
expected_names.append(ConversionUploadServiceClient.__name__)
from google.ads.googleads.v8 import ConversionUploadServiceTransport
expected_names.append(ConversionUploadServiceTransport.__name__)
from google.ads.googleads.v8 import ConversionUploadServiceGrpcTransport
expected_names.append(ConversionUploadServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import ConversionAdjustmentUploadServiceClient
expected_names.append(ConversionAdjustmentUploadServiceClient.__name__)
from google.ads.googleads.v8 import ConversionAdjustmentUploadServiceTransport
expected_names.append(ConversionAdjustmentUploadServiceTransport.__name__)
from google.ads.googleads.v8 import ConversionAdjustmentUploadServiceGrpcTransport
expected_names.append(ConversionAdjustmentUploadServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import CombinedAudienceServiceClient
expected_names.append(CombinedAudienceServiceClient.__name__)
from google.ads.googleads.v8 import CombinedAudienceServiceTransport
expected_names.append(CombinedAudienceServiceTransport.__name__)
from google.ads.googleads.v8 import CombinedAudienceServiceGrpcTransport
expected_names.append(CombinedAudienceServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import ClickViewServiceClient
expected_names.append(ClickViewServiceClient.__name__)
from google.ads.googleads.v8 import ClickViewServiceTransport
expected_names.append(ClickViewServiceTransport.__name__)
from google.ads.googleads.v8 import ClickViewServiceGrpcTransport
expected_names.append(ClickViewServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import ChangeStatusServiceClient
expected_names.append(ChangeStatusServiceClient.__name__)
from google.ads.googleads.v8 import ChangeStatusServiceTransport
expected_names.append(ChangeStatusServiceTransport.__name__)
from google.ads.googleads.v8 import ChangeStatusServiceGrpcTransport
expected_names.append(ChangeStatusServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import CarrierConstantServiceClient
expected_names.append(CarrierConstantServiceClient.__name__)
from google.ads.googleads.v8 import CarrierConstantServiceTransport
expected_names.append(CarrierConstantServiceTransport.__name__)
from google.ads.googleads.v8 import CarrierConstantServiceGrpcTransport
expected_names.append(CarrierConstantServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import CampaignSimulationServiceClient
expected_names.append(CampaignSimulationServiceClient.__name__)
from google.ads.googleads.v8 import CampaignSimulationServiceTransport
expected_names.append(CampaignSimulationServiceTransport.__name__)
from google.ads.googleads.v8 import CampaignSimulationServiceGrpcTransport
expected_names.append(CampaignSimulationServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import CampaignCriterionSimulationServiceClient
expected_names.append(CampaignCriterionSimulationServiceClient.__name__)
from google.ads.googleads.v8 import CampaignCriterionSimulationServiceTransport
expected_names.append(CampaignCriterionSimulationServiceTransport.__name__)
from google.ads.googleads.v8 import CampaignCriterionSimulationServiceGrpcTransport
expected_names.append(CampaignCriterionSimulationServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import CampaignAudienceViewServiceClient
expected_names.append(CampaignAudienceViewServiceClient.__name__)
from google.ads.googleads.v8 import CampaignAudienceViewServiceTransport
expected_names.append(CampaignAudienceViewServiceTransport.__name__)
from google.ads.googleads.v8 import CampaignAudienceViewServiceGrpcTransport
expected_names.append(CampaignAudienceViewServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import BillingSetupServiceClient
expected_names.append(BillingSetupServiceClient.__name__)
from google.ads.googleads.v8 import BillingSetupServiceTransport
expected_names.append(BillingSetupServiceTransport.__name__)
from google.ads.googleads.v8 import BillingSetupServiceGrpcTransport
expected_names.append(BillingSetupServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import BiddingStrategySimulationServiceClient
expected_names.append(BiddingStrategySimulationServiceClient.__name__)
from google.ads.googleads.v8 import BiddingStrategySimulationServiceTransport
expected_names.append(BiddingStrategySimulationServiceTransport.__name__)
from google.ads.googleads.v8 import BiddingStrategySimulationServiceGrpcTransport
expected_names.append(BiddingStrategySimulationServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import BatchJobServiceClient
expected_names.append(BatchJobServiceClient.__name__)
from google.ads.googleads.v8 import BatchJobServiceTransport
expected_names.append(BatchJobServiceTransport.__name__)
from google.ads.googleads.v8 import BatchJobServiceGrpcTransport
expected_names.append(BatchJobServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import GoogleAdsServiceClient
expected_names.append(GoogleAdsServiceClient.__name__)
from google.ads.googleads.v8 import GoogleAdsServiceTransport
expected_names.append(GoogleAdsServiceTransport.__name__)
from google.ads.googleads.v8 import GoogleAdsServiceGrpcTransport
expected_names.append(GoogleAdsServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import UserListServiceClient
expected_names.append(UserListServiceClient.__name__)
from google.ads.googleads.v8 import UserListServiceTransport
expected_names.append(UserListServiceTransport.__name__)
from google.ads.googleads.v8 import UserListServiceGrpcTransport
expected_names.append(UserListServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import SmartCampaignSettingServiceClient
expected_names.append(SmartCampaignSettingServiceClient.__name__)
from google.ads.googleads.v8 import SmartCampaignSettingServiceTransport
expected_names.append(SmartCampaignSettingServiceTransport.__name__)
from google.ads.googleads.v8 import SmartCampaignSettingServiceGrpcTransport
expected_names.append(SmartCampaignSettingServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import SharedSetServiceClient
expected_names.append(SharedSetServiceClient.__name__)
from google.ads.googleads.v8 import SharedSetServiceTransport
expected_names.append(SharedSetServiceTransport.__name__)
from google.ads.googleads.v8 import SharedSetServiceGrpcTransport
expected_names.append(SharedSetServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import SharedCriterionServiceClient
expected_names.append(SharedCriterionServiceClient.__name__)
from google.ads.googleads.v8 import SharedCriterionServiceTransport
expected_names.append(SharedCriterionServiceTransport.__name__)
from google.ads.googleads.v8 import SharedCriterionServiceGrpcTransport
expected_names.append(SharedCriterionServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import RemarketingActionServiceClient
expected_names.append(RemarketingActionServiceClient.__name__)
from google.ads.googleads.v8 import RemarketingActionServiceTransport
expected_names.append(RemarketingActionServiceTransport.__name__)
from google.ads.googleads.v8 import RemarketingActionServiceGrpcTransport
expected_names.append(RemarketingActionServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import MediaFileServiceClient
expected_names.append(MediaFileServiceClient.__name__)
from google.ads.googleads.v8 import MediaFileServiceTransport
expected_names.append(MediaFileServiceTransport.__name__)
from google.ads.googleads.v8 import MediaFileServiceGrpcTransport
expected_names.append(MediaFileServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import LabelServiceClient
expected_names.append(LabelServiceClient.__name__)
from google.ads.googleads.v8 import LabelServiceTransport
expected_names.append(LabelServiceTransport.__name__)
from google.ads.googleads.v8 import LabelServiceGrpcTransport
expected_names.append(LabelServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import KeywordPlanServiceClient
expected_names.append(KeywordPlanServiceClient.__name__)
from google.ads.googleads.v8 import KeywordPlanServiceTransport
expected_names.append(KeywordPlanServiceTransport.__name__)
from google.ads.googleads.v8 import KeywordPlanServiceGrpcTransport
expected_names.append(KeywordPlanServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import KeywordPlanCampaignServiceClient
expected_names.append(KeywordPlanCampaignServiceClient.__name__)
from google.ads.googleads.v8 import KeywordPlanCampaignServiceTransport
expected_names.append(KeywordPlanCampaignServiceTransport.__name__)
from google.ads.googleads.v8 import KeywordPlanCampaignServiceGrpcTransport
expected_names.append(KeywordPlanCampaignServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import KeywordPlanCampaignKeywordServiceClient
expected_names.append(KeywordPlanCampaignKeywordServiceClient.__name__)
from google.ads.googleads.v8 import KeywordPlanCampaignKeywordServiceTransport
expected_names.append(KeywordPlanCampaignKeywordServiceTransport.__name__)
from google.ads.googleads.v8 import KeywordPlanCampaignKeywordServiceGrpcTransport
expected_names.append(KeywordPlanCampaignKeywordServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import KeywordPlanAdGroupServiceClient
expected_names.append(KeywordPlanAdGroupServiceClient.__name__)
from google.ads.googleads.v8 import KeywordPlanAdGroupServiceTransport
expected_names.append(KeywordPlanAdGroupServiceTransport.__name__)
from google.ads.googleads.v8 import KeywordPlanAdGroupServiceGrpcTransport
expected_names.append(KeywordPlanAdGroupServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import KeywordPlanAdGroupKeywordServiceClient
expected_names.append(KeywordPlanAdGroupKeywordServiceClient.__name__)
from google.ads.googleads.v8 import KeywordPlanAdGroupKeywordServiceTransport
expected_names.append(KeywordPlanAdGroupKeywordServiceTransport.__name__)
from google.ads.googleads.v8 import KeywordPlanAdGroupKeywordServiceGrpcTransport
expected_names.append(KeywordPlanAdGroupKeywordServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import FeedServiceClient
expected_names.append(FeedServiceClient.__name__)
from google.ads.googleads.v8 import FeedServiceTransport
expected_names.append(FeedServiceTransport.__name__)
from google.ads.googleads.v8 import FeedServiceGrpcTransport
expected_names.append(FeedServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import FeedMappingServiceClient
expected_names.append(FeedMappingServiceClient.__name__)
from google.ads.googleads.v8 import FeedMappingServiceTransport
expected_names.append(FeedMappingServiceTransport.__name__)
from google.ads.googleads.v8 import FeedMappingServiceGrpcTransport
expected_names.append(FeedMappingServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import FeedItemTargetServiceClient
expected_names.append(FeedItemTargetServiceClient.__name__)
from google.ads.googleads.v8 import FeedItemTargetServiceTransport
expected_names.append(FeedItemTargetServiceTransport.__name__)
from google.ads.googleads.v8 import FeedItemTargetServiceGrpcTransport
expected_names.append(FeedItemTargetServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import FeedItemSetServiceClient
expected_names.append(FeedItemSetServiceClient.__name__)
from google.ads.googleads.v8 import FeedItemSetServiceTransport
expected_names.append(FeedItemSetServiceTransport.__name__)
from google.ads.googleads.v8 import FeedItemSetServiceGrpcTransport
expected_names.append(FeedItemSetServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import FeedItemSetLinkServiceClient
expected_names.append(FeedItemSetLinkServiceClient.__name__)
from google.ads.googleads.v8 import FeedItemSetLinkServiceTransport
expected_names.append(FeedItemSetLinkServiceTransport.__name__)
from google.ads.googleads.v8 import FeedItemSetLinkServiceGrpcTransport
expected_names.append(FeedItemSetLinkServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import FeedItemServiceClient
expected_names.append(FeedItemServiceClient.__name__)
from google.ads.googleads.v8 import FeedItemServiceTransport
expected_names.append(FeedItemServiceTransport.__name__)
from google.ads.googleads.v8 import FeedItemServiceGrpcTransport
expected_names.append(FeedItemServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import ExtensionFeedItemServiceClient
expected_names.append(ExtensionFeedItemServiceClient.__name__)
from google.ads.googleads.v8 import ExtensionFeedItemServiceTransport
expected_names.append(ExtensionFeedItemServiceTransport.__name__)
from google.ads.googleads.v8 import ExtensionFeedItemServiceGrpcTransport
expected_names.append(ExtensionFeedItemServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import CustomerServiceClient
expected_names.append(CustomerServiceClient.__name__)
from google.ads.googleads.v8 import CustomerServiceTransport
expected_names.append(CustomerServiceTransport.__name__)
from google.ads.googleads.v8 import CustomerServiceGrpcTransport
expected_names.append(CustomerServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import CustomerNegativeCriterionServiceClient
expected_names.append(CustomerNegativeCriterionServiceClient.__name__)
from google.ads.googleads.v8 import CustomerNegativeCriterionServiceTransport
expected_names.append(CustomerNegativeCriterionServiceTransport.__name__)
from google.ads.googleads.v8 import CustomerNegativeCriterionServiceGrpcTransport
expected_names.append(CustomerNegativeCriterionServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import CustomerLabelServiceClient
expected_names.append(CustomerLabelServiceClient.__name__)
from google.ads.googleads.v8 import CustomerLabelServiceTransport
expected_names.append(CustomerLabelServiceTransport.__name__)
from google.ads.googleads.v8 import CustomerLabelServiceGrpcTransport
expected_names.append(CustomerLabelServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import CustomerFeedServiceClient
expected_names.append(CustomerFeedServiceClient.__name__)
from google.ads.googleads.v8 import CustomerFeedServiceTransport
expected_names.append(CustomerFeedServiceTransport.__name__)
from google.ads.googleads.v8 import CustomerFeedServiceGrpcTransport
expected_names.append(CustomerFeedServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import CustomerExtensionSettingServiceClient
expected_names.append(CustomerExtensionSettingServiceClient.__name__)
from google.ads.googleads.v8 import CustomerExtensionSettingServiceTransport
expected_names.append(CustomerExtensionSettingServiceTransport.__name__)
from google.ads.googleads.v8 import CustomerExtensionSettingServiceGrpcTransport
expected_names.append(CustomerExtensionSettingServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import CustomerAssetServiceClient
expected_names.append(CustomerAssetServiceClient.__name__)
from google.ads.googleads.v8 import CustomerAssetServiceTransport
expected_names.append(CustomerAssetServiceTransport.__name__)
from google.ads.googleads.v8 import CustomerAssetServiceGrpcTransport
expected_names.append(CustomerAssetServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import ConversionCustomVariableServiceClient
expected_names.append(ConversionCustomVariableServiceClient.__name__)
from google.ads.googleads.v8 import ConversionCustomVariableServiceTransport
expected_names.append(ConversionCustomVariableServiceTransport.__name__)
from google.ads.googleads.v8 import ConversionCustomVariableServiceGrpcTransport
expected_names.append(ConversionCustomVariableServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import ConversionActionServiceClient
expected_names.append(ConversionActionServiceClient.__name__)
from google.ads.googleads.v8 import ConversionActionServiceTransport
expected_names.append(ConversionActionServiceTransport.__name__)
from google.ads.googleads.v8 import ConversionActionServiceGrpcTransport
expected_names.append(ConversionActionServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import CampaignSharedSetServiceClient
expected_names.append(CampaignSharedSetServiceClient.__name__)
from google.ads.googleads.v8 import CampaignSharedSetServiceTransport
expected_names.append(CampaignSharedSetServiceTransport.__name__)
from google.ads.googleads.v8 import CampaignSharedSetServiceGrpcTransport
expected_names.append(CampaignSharedSetServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import CampaignServiceClient
expected_names.append(CampaignServiceClient.__name__)
from google.ads.googleads.v8 import CampaignServiceTransport
expected_names.append(CampaignServiceTransport.__name__)
from google.ads.googleads.v8 import CampaignServiceGrpcTransport
expected_names.append(CampaignServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import CampaignLabelServiceClient
expected_names.append(CampaignLabelServiceClient.__name__)
from google.ads.googleads.v8 import CampaignLabelServiceTransport
expected_names.append(CampaignLabelServiceTransport.__name__)
from google.ads.googleads.v8 import CampaignLabelServiceGrpcTransport
expected_names.append(CampaignLabelServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import CampaignFeedServiceClient
expected_names.append(CampaignFeedServiceClient.__name__)
from google.ads.googleads.v8 import CampaignFeedServiceTransport
expected_names.append(CampaignFeedServiceTransport.__name__)
from google.ads.googleads.v8 import CampaignFeedServiceGrpcTransport
expected_names.append(CampaignFeedServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import CampaignExtensionSettingServiceClient
expected_names.append(CampaignExtensionSettingServiceClient.__name__)
from google.ads.googleads.v8 import CampaignExtensionSettingServiceTransport
expected_names.append(CampaignExtensionSettingServiceTransport.__name__)
from google.ads.googleads.v8 import CampaignExtensionSettingServiceGrpcTransport
expected_names.append(CampaignExtensionSettingServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import CampaignExperimentServiceClient
expected_names.append(CampaignExperimentServiceClient.__name__)
from google.ads.googleads.v8 import CampaignExperimentServiceTransport
expected_names.append(CampaignExperimentServiceTransport.__name__)
from google.ads.googleads.v8 import CampaignExperimentServiceGrpcTransport
expected_names.append(CampaignExperimentServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import CampaignDraftServiceClient
expected_names.append(CampaignDraftServiceClient.__name__)
from google.ads.googleads.v8 import CampaignDraftServiceTransport
expected_names.append(CampaignDraftServiceTransport.__name__)
from google.ads.googleads.v8 import CampaignDraftServiceGrpcTransport
expected_names.append(CampaignDraftServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import CampaignCriterionServiceClient
expected_names.append(CampaignCriterionServiceClient.__name__)
from google.ads.googleads.v8 import CampaignCriterionServiceTransport
expected_names.append(CampaignCriterionServiceTransport.__name__)
from google.ads.googleads.v8 import CampaignCriterionServiceGrpcTransport
expected_names.append(CampaignCriterionServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import CampaignBudgetServiceClient
expected_names.append(CampaignBudgetServiceClient.__name__)
from google.ads.googleads.v8 import CampaignBudgetServiceTransport
expected_names.append(CampaignBudgetServiceTransport.__name__)
from google.ads.googleads.v8 import CampaignBudgetServiceGrpcTransport
expected_names.append(CampaignBudgetServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import CampaignBidModifierServiceClient
expected_names.append(CampaignBidModifierServiceClient.__name__)
from google.ads.googleads.v8 import CampaignBidModifierServiceTransport
expected_names.append(CampaignBidModifierServiceTransport.__name__)
from google.ads.googleads.v8 import CampaignBidModifierServiceGrpcTransport
expected_names.append(CampaignBidModifierServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import CampaignAssetServiceClient
expected_names.append(CampaignAssetServiceClient.__name__)
from google.ads.googleads.v8 import CampaignAssetServiceTransport
expected_names.append(CampaignAssetServiceTransport.__name__)
from google.ads.googleads.v8 import CampaignAssetServiceGrpcTransport
expected_names.append(CampaignAssetServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import BiddingStrategyServiceClient
expected_names.append(BiddingStrategyServiceClient.__name__)
from google.ads.googleads.v8 import BiddingStrategyServiceTransport
expected_names.append(BiddingStrategyServiceTransport.__name__)
from google.ads.googleads.v8 import BiddingStrategyServiceGrpcTransport
expected_names.append(BiddingStrategyServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import AssetServiceClient
expected_names.append(AssetServiceClient.__name__)
from google.ads.googleads.v8 import AssetServiceTransport
expected_names.append(AssetServiceTransport.__name__)
from google.ads.googleads.v8 import AssetServiceGrpcTransport
expected_names.append(AssetServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import AssetFieldTypeViewServiceClient
expected_names.append(AssetFieldTypeViewServiceClient.__name__)
from google.ads.googleads.v8 import AssetFieldTypeViewServiceTransport
expected_names.append(AssetFieldTypeViewServiceTransport.__name__)
from google.ads.googleads.v8 import AssetFieldTypeViewServiceGrpcTransport
expected_names.append(AssetFieldTypeViewServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import AgeRangeViewServiceClient
expected_names.append(AgeRangeViewServiceClient.__name__)
from google.ads.googleads.v8 import AgeRangeViewServiceTransport
expected_names.append(AgeRangeViewServiceTransport.__name__)
from google.ads.googleads.v8 import AgeRangeViewServiceGrpcTransport
expected_names.append(AgeRangeViewServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import AdServiceClient
expected_names.append(AdServiceClient.__name__)
from google.ads.googleads.v8 import AdServiceTransport
expected_names.append(AdServiceTransport.__name__)
from google.ads.googleads.v8 import AdServiceGrpcTransport
expected_names.append(AdServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import AdScheduleViewServiceClient
expected_names.append(AdScheduleViewServiceClient.__name__)
from google.ads.googleads.v8 import AdScheduleViewServiceTransport
expected_names.append(AdScheduleViewServiceTransport.__name__)
from google.ads.googleads.v8 import AdScheduleViewServiceGrpcTransport
expected_names.append(AdScheduleViewServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import AdParameterServiceClient
expected_names.append(AdParameterServiceClient.__name__)
from google.ads.googleads.v8 import AdParameterServiceTransport
expected_names.append(AdParameterServiceTransport.__name__)
from google.ads.googleads.v8 import AdParameterServiceGrpcTransport
expected_names.append(AdParameterServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import AdGroupSimulationServiceClient
expected_names.append(AdGroupSimulationServiceClient.__name__)
from google.ads.googleads.v8 import AdGroupSimulationServiceTransport
expected_names.append(AdGroupSimulationServiceTransport.__name__)
from google.ads.googleads.v8 import AdGroupSimulationServiceGrpcTransport
expected_names.append(AdGroupSimulationServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import AdGroupServiceClient
expected_names.append(AdGroupServiceClient.__name__)
from google.ads.googleads.v8 import AdGroupServiceTransport
expected_names.append(AdGroupServiceTransport.__name__)
from google.ads.googleads.v8 import AdGroupServiceGrpcTransport
expected_names.append(AdGroupServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import AdGroupLabelServiceClient
expected_names.append(AdGroupLabelServiceClient.__name__)
from google.ads.googleads.v8 import AdGroupLabelServiceTransport
expected_names.append(AdGroupLabelServiceTransport.__name__)
from google.ads.googleads.v8 import AdGroupLabelServiceGrpcTransport
expected_names.append(AdGroupLabelServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import AdGroupFeedServiceClient
expected_names.append(AdGroupFeedServiceClient.__name__)
from google.ads.googleads.v8 import AdGroupFeedServiceTransport
expected_names.append(AdGroupFeedServiceTransport.__name__)
from google.ads.googleads.v8 import AdGroupFeedServiceGrpcTransport
expected_names.append(AdGroupFeedServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import AdGroupExtensionSettingServiceClient
expected_names.append(AdGroupExtensionSettingServiceClient.__name__)
from google.ads.googleads.v8 import AdGroupExtensionSettingServiceTransport
expected_names.append(AdGroupExtensionSettingServiceTransport.__name__)
from google.ads.googleads.v8 import AdGroupExtensionSettingServiceGrpcTransport
expected_names.append(AdGroupExtensionSettingServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import AdGroupCriterionSimulationServiceClient
expected_names.append(AdGroupCriterionSimulationServiceClient.__name__)
from google.ads.googleads.v8 import AdGroupCriterionSimulationServiceTransport
expected_names.append(AdGroupCriterionSimulationServiceTransport.__name__)
from google.ads.googleads.v8 import AdGroupCriterionSimulationServiceGrpcTransport
expected_names.append(AdGroupCriterionSimulationServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import AdGroupCriterionServiceClient
expected_names.append(AdGroupCriterionServiceClient.__name__)
from google.ads.googleads.v8 import AdGroupCriterionServiceTransport
expected_names.append(AdGroupCriterionServiceTransport.__name__)
from google.ads.googleads.v8 import AdGroupCriterionServiceGrpcTransport
expected_names.append(AdGroupCriterionServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import AdGroupCriterionLabelServiceClient
expected_names.append(AdGroupCriterionLabelServiceClient.__name__)
from google.ads.googleads.v8 import AdGroupCriterionLabelServiceTransport
expected_names.append(AdGroupCriterionLabelServiceTransport.__name__)
from google.ads.googleads.v8 import AdGroupCriterionLabelServiceGrpcTransport
expected_names.append(AdGroupCriterionLabelServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import AdGroupBidModifierServiceClient
expected_names.append(AdGroupBidModifierServiceClient.__name__)
from google.ads.googleads.v8 import AdGroupBidModifierServiceTransport
expected_names.append(AdGroupBidModifierServiceTransport.__name__)
from google.ads.googleads.v8 import AdGroupBidModifierServiceGrpcTransport
expected_names.append(AdGroupBidModifierServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import AdGroupAudienceViewServiceClient
expected_names.append(AdGroupAudienceViewServiceClient.__name__)
from google.ads.googleads.v8 import AdGroupAudienceViewServiceTransport
expected_names.append(AdGroupAudienceViewServiceTransport.__name__)
from google.ads.googleads.v8 import AdGroupAudienceViewServiceGrpcTransport
expected_names.append(AdGroupAudienceViewServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import AdGroupAssetServiceClient
expected_names.append(AdGroupAssetServiceClient.__name__)
from google.ads.googleads.v8 import AdGroupAssetServiceTransport
expected_names.append(AdGroupAssetServiceTransport.__name__)
from google.ads.googleads.v8 import AdGroupAssetServiceGrpcTransport
expected_names.append(AdGroupAssetServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import AdGroupAdServiceClient
expected_names.append(AdGroupAdServiceClient.__name__)
from google.ads.googleads.v8 import AdGroupAdServiceTransport
expected_names.append(AdGroupAdServiceTransport.__name__)
from google.ads.googleads.v8 import AdGroupAdServiceGrpcTransport
expected_names.append(AdGroupAdServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import AdGroupAdLabelServiceClient
expected_names.append(AdGroupAdLabelServiceClient.__name__)
from google.ads.googleads.v8 import AdGroupAdLabelServiceTransport
expected_names.append(AdGroupAdLabelServiceTransport.__name__)
from google.ads.googleads.v8 import AdGroupAdLabelServiceGrpcTransport
expected_names.append(AdGroupAdLabelServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import AdGroupAdAssetViewServiceClient
expected_names.append(AdGroupAdAssetViewServiceClient.__name__)
from google.ads.googleads.v8 import AdGroupAdAssetViewServiceTransport
expected_names.append(AdGroupAdAssetViewServiceTransport.__name__)
from google.ads.googleads.v8 import AdGroupAdAssetViewServiceGrpcTransport
expected_names.append(AdGroupAdAssetViewServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import AccountLinkServiceClient
expected_names.append(AccountLinkServiceClient.__name__)
from google.ads.googleads.v8 import AccountLinkServiceTransport
expected_names.append(AccountLinkServiceTransport.__name__)
from google.ads.googleads.v8 import AccountLinkServiceGrpcTransport
expected_names.append(AccountLinkServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import AccountBudgetServiceClient
expected_names.append(AccountBudgetServiceClient.__name__)
from google.ads.googleads.v8 import AccountBudgetServiceTransport
expected_names.append(AccountBudgetServiceTransport.__name__)
from google.ads.googleads.v8 import AccountBudgetServiceGrpcTransport
expected_names.append(AccountBudgetServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import AccountBudgetProposalServiceClient
expected_names.append(AccountBudgetProposalServiceClient.__name__)
from google.ads.googleads.v8 import AccountBudgetProposalServiceTransport
expected_names.append(AccountBudgetProposalServiceTransport.__name__)
from google.ads.googleads.v8 import AccountBudgetProposalServiceGrpcTransport
expected_names.append(AccountBudgetProposalServiceGrpcTransport.__name__)
from google.ads.googleads.v8 import AccessibleBiddingStrategyServiceClient
expected_names.append(AccessibleBiddingStrategyServiceClient.__name__)
from google.ads.googleads.v8 import AccessibleBiddingStrategyServiceTransport
expected_names.append(AccessibleBiddingStrategyServiceTransport.__name__)
from google.ads.googleads.v8 import AccessibleBiddingStrategyServiceGrpcTransport
expected_names.append(AccessibleBiddingStrategyServiceGrpcTransport.__name__)
expected_names.sort()
from google.ads.googleads import v8
actual_names = dir(v8)
assert expected_names == actual_names
# Verify the logic for handling non-existant names
with pytest.raises(ImportError):
from google.ads.googleads.v8 import GiantSquid
| [
"bazel-bot-development[bot]@users.noreply.github.com"
] | bazel-bot-development[bot]@users.noreply.github.com |
9585a4e4a65ef46efe897765a84b7e09465160f0 | 81acce1d49924d89e6ebf5a472ad5b1b80cc202c | /Draw2D.py | 7f1ca89964823ded207e1bb4b4b9b8c0241f238d | [] | no_license | truggles/Z_to_TauTau_13TeV | 36a85b024052fcfef3c9efd8aebc63dc85744f7b | 123fe0d25f8e926d8959f54cd4f64122394b60d5 | refs/heads/master | 2021-03-13T01:50:43.031581 | 2017-10-12T18:56:25 | 2017-10-12T18:56:25 | 37,312,811 | 0 | 0 | null | 2016-09-29T08:29:13 | 2015-06-12T09:08:22 | Python | UTF-8 | Python | false | false | 7,908 | py | #!/usr/bin/env python
import ROOT
import re
from array import array
import math
ROOT.gROOT.SetBatch(True)
def add_lumi():
lowX=0.58
lowY=0.835
lumi = ROOT.TPaveText(lowX, lowY+0.06, lowX+0.30, lowY+0.16, "NDC")
lumi.SetBorderSize( 0 )
lumi.SetFillStyle( 0 )
lumi.SetTextAlign( 12 )
lumi.SetTextColor( 1 )
lumi.SetTextSize(0.06)
lumi.SetTextFont ( 42 )
lumi.AddText("2016, 35.9 fb^{-1} (13 TeV)")
return lumi
def add_CMS():
lowX=0.21
lowY=0.70
lumi = ROOT.TPaveText(lowX, lowY+0.06, lowX+0.15, lowY+0.16, "NDC")
lumi.SetTextFont(61)
lumi.SetTextSize(0.08)
lumi.SetBorderSize( 0 )
lumi.SetFillStyle( 0 )
lumi.SetTextAlign( 12 )
lumi.SetTextColor( 1 )
lumi.AddText("CMS")
return lumi
def add_Preliminary():
lowX=0.21
lowY=0.63
lumi = ROOT.TPaveText(lowX, lowY+0.06, lowX+0.15, lowY+0.16, "NDC")
lumi.SetTextFont(52)
lumi.SetTextSize(0.06)
lumi.SetBorderSize( 0 )
lumi.SetFillStyle( 0 )
lumi.SetTextAlign( 12 )
lumi.SetTextColor( 1 )
lumi.AddText("Preliminary")
return lumi
def make_legend():
output = ROOT.TLegend(0.65, 0.4, 0.92, 0.82, "", "brNDC")
output.SetLineWidth(0)
output.SetLineStyle(0)
output.SetFillStyle(0)
output.SetBorderSize(0)
output.SetTextFont(62)
return output
import argparse
parser = argparse.ArgumentParser(description='Process some integers.')
parser.add_argument('--mthd', action='store', dest='mthd', help="Which method? FF or Standard?")
args = parser.parse_args()
print args.mthd
ROOT.gStyle.SetFrameLineWidth(3)
ROOT.gStyle.SetLineWidth(3)
ROOT.gStyle.SetOptStat(0)
c=ROOT.TCanvas("canvas","",0,0,1200,600)
c.cd()
file=ROOT.TFile("httShapes/htt/htt_tt.inputs-sm-13TeV_svFitMass2D-5040-Tight.root","r")
adapt=ROOT.gROOT.GetColor(12)
new_idx=ROOT.gROOT.GetListOfColors().GetSize() + 1
trans=ROOT.TColor(new_idx, adapt.GetRed(), adapt.GetGreen(),adapt.GetBlue(), "",0.5)
categories= ["tt_boosted","tt_VBF",]
categories= ["tt_0jet",]
ncat=len(categories)
for cat in categories:
print cat
Data=file.Get(cat).Get("data_obs")
print Data.Integral()
QCD=file.Get(cat).Get("QCD")
W=file.Get(cat).Get("W")
TT=file.Get(cat).Get("TTT")
VV=file.Get(cat).Get("VV")
#if not "2bjet" in cat :
if W != None : VV.Add(W)
ZL=file.Get(cat).Get("ZL")
ZJ=file.Get(cat).Get("ZJ")
if ZJ != None : ZL.Add(ZJ)
ZTT=file.Get(cat).Get("ZTT")
SMHiggs=file.Get(cat).Get("ggH125")
SMHiggs.Add(file.Get(cat).Get("qqH125"))
Data.GetXaxis().SetTitle("")
Data.GetXaxis().SetTitleSize(0)
Data.GetXaxis().SetNdivisions(505)
Data.GetYaxis().SetLabelFont(42)
Data.GetYaxis().SetLabelOffset(0.01)
Data.GetYaxis().SetLabelSize(0.06)
Data.GetYaxis().SetTitleSize(0.075)
Data.GetYaxis().SetTitleOffset(1.04)
Data.SetTitle("")
Data.GetYaxis().SetTitle("Events/bin")
QCD.SetFillColor(ROOT.TColor.GetColor("#ffccff"))
VV.SetFillColor(ROOT.TColor.GetColor("#de5a6a"))
TT.SetFillColor(ROOT.TColor.GetColor("#9999cc"))
if not "2bjet" in cat :
ZL.SetFillColor(ROOT.TColor.GetColor("#4496c8"))
ZTT.SetFillColor(ROOT.TColor.GetColor("#ffcc66"))
SMHiggs.SetLineColor(ROOT.kBlue)
Data.SetMarkerStyle(20)
Data.SetMarkerSize(1)
QCD.SetLineColor(1)
VV.SetLineColor(1)
TT.SetLineColor(1)
ZTT.SetLineColor(1)
if not "2bjet" in cat :
ZL.SetLineColor(1)
Data.SetLineColor(1)
Data.SetLineWidth(2)
SMHiggs.SetLineWidth(2)
stack=ROOT.THStack("stack","stack")
stack.Add(QCD)
stack.Add(VV)
stack.Add(TT)
if not "2bjet" in cat :
stack.Add(ZL)
stack.Add(ZTT)
errorBand = QCD.Clone()
errorBand.Add(VV)
errorBand.Add(TT)
if not "2bjet" in cat :
errorBand.Add(ZL)
errorBand.Add(ZTT)
errorBand.SetMarkerSize(0)
errorBand.SetFillColor(new_idx)
errorBand.SetFillStyle(3001)
errorBand.SetLineWidth(1)
pad1 = ROOT.TPad("pad1","pad1",0,0.35,1,1)
pad1.Draw()
pad1.cd()
pad1.SetFillColor(0)
pad1.SetBorderMode(0)
pad1.SetBorderSize(10)
pad1.SetTickx(1)
pad1.SetTicky(1)
pad1.SetLeftMargin(0.18)
pad1.SetRightMargin(0.05)
pad1.SetTopMargin(0.122)
pad1.SetBottomMargin(0.026)
pad1.SetFrameFillStyle(0)
pad1.SetFrameLineStyle(0)
pad1.SetFrameLineWidth(3)
pad1.SetFrameBorderMode(0)
pad1.SetFrameBorderSize(10)
Data.GetXaxis().SetLabelSize(0)
Data.SetMaximum(Data.GetMaximum()*1.5)
Data.Draw("e")
stack.Draw("hist same")
# Scale SMH x 10
higgsSF = 10.
SMHiggs.Scale( higgsSF )
SMHiggs.Draw("histsame")
errorBand.Draw("e2same")
# Blind
for bin in range(1, Data.GetNbinsX()+1):
smh = SMHiggs.GetBinContent( bin ) / higgsSF
bkg = stack.GetStack().Last().GetBinContent( bin )
if smh > 0. or bkg > 0. :
sig = smh / math.sqrt( smh + bkg )
else :
sig = 0.
if sig > 0.1 :
Data.SetBinContent( bin, 0. )
Data.SetBinError( bin, 0. )
Data.Draw("esamex0")
legende=make_legend()
legende.AddEntry(Data,"Observed","elp")
legende.AddEntry(ZTT,"Z#rightarrow#tau_{h}#tau_{h}","f")
if not "2bjet" in cat :
legende.AddEntry(ZL,"DY others","f")
legende.AddEntry(TT,"t#bar{t}+jets","f")
legende.AddEntry(VV,"Electroweak","f")
legende.AddEntry(QCD,"QCD multijet","f")
legende.AddEntry(SMHiggs,"SM h(125) x %s" % higgsSF,"f")
legende.AddEntry(errorBand,"Uncertainty","f")
legende.Draw()
l1=add_lumi()
l1.Draw("same")
l2=add_CMS()
l2.Draw("same")
l3=add_Preliminary()
l3.Draw("same")
pad1.RedrawAxis()
categ = ROOT.TPaveText(0.21, 0.5+0.013, 0.43, 0.70+0.155, "NDC")
categ.SetBorderSize( 0 )
categ.SetFillStyle( 0 )
categ.SetTextAlign( 12 )
categ.SetTextSize ( 0.06 )
categ.SetTextColor( 1 )
categ.SetTextFont ( 41 )
categ.AddText(cat)
categ.Draw("same")
c.cd()
pad2 = ROOT.TPad("pad2","pad2",0,0,1,0.35);
pad2.SetTopMargin(0.05);
pad2.SetBottomMargin(0.35);
pad2.SetLeftMargin(0.18);
pad2.SetRightMargin(0.05);
pad2.SetTickx(1)
pad2.SetTicky(1)
pad2.SetFrameLineWidth(3)
pad2.SetGridx()
pad2.SetGridy()
pad2.Draw()
pad2.cd()
h1=Data.Clone()
#h1.SetMaximum(1.5)#FIXME(1.5)
#h1.SetMinimum(0.5)#FIXME(0.5)
h1.SetMaximum(1.75)#FIXME(1.5)
h1.SetMinimum(0.25)#FIXME(0.5)
h1.SetMarkerStyle(20)
h3=errorBand.Clone()
hwoE=errorBand.Clone()
for iii in range (1,hwoE.GetSize()-2):
hwoE.SetBinError(iii,0)
h3.Sumw2()
h1.Sumw2()
h1.SetStats(0)
h1.Divide(hwoE)
h3.Divide(hwoE)
h1.GetXaxis().SetTitle("m_{#tau#tau} (GeV)")
#h1.GetXaxis().SetTitle("m_{vis} (GeV)")
#h1.GetXaxis().SetTitle("N_{charged}")
h1.GetXaxis().SetLabelSize(0.08)
h1.GetYaxis().SetLabelSize(0.08)
h1.GetYaxis().SetTitle("Obs./Exp.")
h1.GetXaxis().SetNdivisions(505)
h1.GetYaxis().SetNdivisions(5)
h1.GetXaxis().SetTitleSize(0.15)
h1.GetYaxis().SetTitleSize(0.15)
h1.GetYaxis().SetTitleOffset(0.56)
h1.GetXaxis().SetTitleOffset(1.04)
h1.GetXaxis().SetLabelSize(0.11)
h1.GetYaxis().SetLabelSize(0.11)
h1.GetXaxis().SetTitleFont(42)
h1.GetYaxis().SetTitleFont(42)
h1.Draw("ep")
h3.Draw("e2same")
c.cd()
pad1.Draw()
ROOT.gPad.RedrawAxis()
c.Modified()
#c.SaveAs("mVis"+cat+args.mthd+".pdf")
#c.SaveAs("mVis"+cat+args.mthd+".png")
date='Nov02'
c.SaveAs("/afs/cern.ch/user/t/truggles/www/2D/"+date+"/mSV"+cat+args.mthd+".pdf")
c.SaveAs("/afs/cern.ch/user/t/truggles/www/2D/"+date+"/mSV"+cat+args.mthd+".png")
pad1.SetLogy()
del legende
Data.SetMaximum(Data.GetMaximum()*3)
Data.SetMinimum(0.01)
pad1.Update()
c.SaveAs("/afs/cern.ch/user/t/truggles/www/2D/"+date+"/mSV"+cat+args.mthd+"log.pdf")
c.SaveAs("/afs/cern.ch/user/t/truggles/www/2D/"+date+"/mSV"+cat+args.mthd+"log.png")
| [
"[email protected]"
] | |
90d2a950603b34fd3f89912efe29b45abdb4d45a | 2bb90b620f86d0d49f19f01593e1a4cc3c2e7ba8 | /pardus/tags/2007.3/programming/languages/perl/XML-XQL/actions.py | e6165f4328993702d0ec62af5da1fff8f5818066 | [] | no_license | aligulle1/kuller | bda0d59ce8400aa3c7ba9c7e19589f27313492f7 | 7f98de19be27d7a517fe19a37c814748f7e18ba6 | refs/heads/master | 2021-01-20T02:22:09.451356 | 2013-07-23T17:57:58 | 2013-07-23T17:57:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 456 | py | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2006 TUBITAK/UEKAE
# Licensed under the GNU General Public License, version 2.
# See the file http://www.gnu.org/copyleft/gpl.txt.
from pisi.actionsapi import perlmodules
from pisi.actionsapi import pisitools
def setup():
perlmodules.configure("/usr")
def build():
perlmodules.make()
def install():
perlmodules.install()
pisitools.dodoc("Changes","README")
| [
"[email protected]"
] | |
27a5fbcd017b34cabd64cefb4a53a4f4208369b8 | a55ad28bbb4fa7edb534f6c1834e7aa00b7dbc2a | /ververica_api_sdk/models/job.py | b3cc3e3509886202781ef2aff5ddaa66edbccc8a | [] | no_license | justlikemikezz/ververica-api-sdk | df29dca99af00944aef5cf06b715e697752fada8 | 0eee284b4433f74b35fd2f41d149e619624aaed3 | refs/heads/master | 2020-12-22T16:01:43.588537 | 2020-01-29T00:39:34 | 2020-01-29T00:39:34 | 236,848,741 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,421 | py | # coding: utf-8
"""
Application Manager API
Application Manager APIs to control Apache Flink jobs # noqa: E501
OpenAPI spec version: 2.0.1
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class Job(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_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.
"""
swagger_types = {
'api_version': 'str',
'kind': 'str',
'metadata': 'JobMetadata',
'spec': 'JobSpec',
'status': 'JobStatus'
}
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
"""Job - a model defined in Swagger""" # 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
if spec is not None:
self.spec = spec
if status is not None:
self.status = status
@property
def api_version(self):
"""Gets the api_version of this Job. # noqa: E501
:return: The api_version of this Job. # noqa: E501
:rtype: str
"""
return self._api_version
@api_version.setter
def api_version(self, api_version):
"""Sets the api_version of this Job.
:param api_version: The api_version of this Job. # noqa: E501
:type: str
"""
self._api_version = api_version
@property
def kind(self):
"""Gets the kind of this Job. # noqa: E501
:return: The kind of this Job. # noqa: E501
:rtype: str
"""
return self._kind
@kind.setter
def kind(self, kind):
"""Sets the kind of this Job.
:param kind: The kind of this Job. # noqa: E501
:type: str
"""
self._kind = kind
@property
def metadata(self):
"""Gets the metadata of this Job. # noqa: E501
:return: The metadata of this Job. # noqa: E501
:rtype: JobMetadata
"""
return self._metadata
@metadata.setter
def metadata(self, metadata):
"""Sets the metadata of this Job.
:param metadata: The metadata of this Job. # noqa: E501
:type: JobMetadata
"""
self._metadata = metadata
@property
def spec(self):
"""Gets the spec of this Job. # noqa: E501
:return: The spec of this Job. # noqa: E501
:rtype: JobSpec
"""
return self._spec
@spec.setter
def spec(self, spec):
"""Sets the spec of this Job.
:param spec: The spec of this Job. # noqa: E501
:type: JobSpec
"""
self._spec = spec
@property
def status(self):
"""Gets the status of this Job. # noqa: E501
:return: The status of this Job. # noqa: E501
:rtype: JobStatus
"""
return self._status
@status.setter
def status(self, status):
"""Sets the status of this Job.
:param status: The status of this Job. # noqa: E501
:type: JobStatus
"""
self._status = status
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_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
if issubclass(Job, dict):
for key, value in self.items():
result[key] = 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, Job):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
| [
"[email protected]"
] | |
207a7011a5837bad96395aed19342501aa663f78 | a3cc7286d4a319cb76f3a44a593c4a18e5ddc104 | /lib/surface/tasks/queues/resume.py | 230674c0f92827e5d0fc9bf32cb2124351e7564d | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | jordanistan/Google-Cloud-SDK | f2c6bb7abc2f33b9dfaec5de792aa1be91154099 | 42b9d7914c36a30d1e4b84ae2925df7edeca9962 | refs/heads/master | 2023-09-01T01:24:53.495537 | 2023-08-22T01:12:23 | 2023-08-22T01:12:23 | 127,072,491 | 0 | 1 | NOASSERTION | 2023-08-22T01:12:24 | 2018-03-28T02:31:19 | Python | UTF-8 | Python | false | false | 1,406 | 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.
"""`gcloud tasks queues resume` command."""
from googlecloudsdk.api_lib.tasks import queues
from googlecloudsdk.calliope import base
from googlecloudsdk.command_lib.tasks import constants
from googlecloudsdk.command_lib.tasks import flags
from googlecloudsdk.command_lib.tasks import parsers
from googlecloudsdk.core import log
class Resume(base.Command):
"""Request to resume a paused or disabled queue."""
@staticmethod
def Args(parser):
flags.AddQueueResourceArg(parser, 'to resume')
flags.AddLocationFlag(parser)
def Run(self, args):
queues_client = queues.Queues()
queue_ref = parsers.ParseQueue(args.queue, args.location)
log.warn(constants.QUEUE_MANAGEMENT_WARNING)
queues_client.Resume(queue_ref)
log.status.Print('Resumed queue [{}].'.format(queue_ref.Name()))
| [
"[email protected]"
] | |
0d12a1eb786b8fb073816be57a8967bb4bb8891a | 875188967ac96bdabc2780983ef2db32c8c727ef | /ebirdtaiwan/home/migrations/0006_auto_20200824_1303.py | e9cdb42fcf9d8df64348e88652a2c892ff30a1d9 | [
"MIT"
] | permissive | even311379/EbirdTaiwan2020 | b57ef8db79ef0d6b452016b6aa48bee2afe227b2 | 2c1aa4d7346b5ade909d45f7c245fa4988394124 | refs/heads/master | 2022-12-28T01:04:48.431595 | 2020-10-16T15:03:52 | 2020-10-16T15:03:52 | 289,954,202 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 356 | py | # Generated by Django 3.1 on 2020-08-24 13:03
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('home', '0005_auto_20200824_1301'),
]
operations = [
migrations.RenameField(
model_name='homepage',
old_name='Title',
new_name='Why',
),
]
| [
"[email protected]"
] | |
e93167fdb787888ff891a9b26a2a79b76ce27430 | f202ac96ff532c5dfba9914cc5b0c843c9ad34e1 | /parlai/agents/programr/processors/post/denormalize.py | d05d38b9c718e33a2958870d12afecede2d0e06c | [
"MIT"
] | permissive | roholazandie/ParlAI | 3caf2c913bbe6a4c2e7e7eee5674d7786eca5427 | 32352cab81ecb666aefd596232c5ed9f33cbaeb9 | refs/heads/master | 2021-12-02T01:30:09.548622 | 2021-10-19T17:38:23 | 2021-10-19T17:38:23 | 187,677,302 | 0 | 0 | MIT | 2021-06-24T21:44:34 | 2019-05-20T16:31:52 | Python | UTF-8 | Python | false | false | 497 | py | from parlai.agents.programr.utils.logging.ylogger import YLogger
from parlai.agents.programr.processors.processing import PostProcessor
DEBUG = False
class DenormalizePostProcessor(PostProcessor):
def __init__(self):
super().__init__()
def process(self, word_string):
# denormalized = brain.denormals.denormalise_string(word_string)
# if DEBUG: YLogger.debug(brain, "Denormalising input from [%s] to [%s]", word_string, denormalized)
return word_string
| [
"[email protected]"
] | |
b48dd591d3492478f1c4606a1de80669a3716b41 | 9b1cf71a9b744b66276701ef76ed3a4190b1bd84 | /kcliutils/utils/texts/core_texts/readme.py | 4dbab9971fb669563ee1b0136eeee6b4f6a45ee1 | [
"MIT"
] | permissive | kkristof200/py_cli_utils | f9678ae5de322e558f3c29f9fede546f73d95db2 | 8c18ea37e84be5e7df1f5fcf7cdc10ae70ecf7c6 | refs/heads/main | 2023-07-18T10:02:02.783816 | 2021-09-06T20:35:43 | 2021-09-06T20:35:43 | 331,058,727 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 252 | py | readme = '''
# [PACKAGE_NAME]
[SHIELDS]
## Description
[DESCRIPTION]
## Install
~~~~bash
pip install [PACKAGE_NAME]
# or
pip3 install [PACKAGE_NAME]
~~~~
## Usage
~~~~python
import [PACKAGE_NAME]
~~~~
## Dependencies
[DEPENDENCIES]
'''.strip() | [
"[email protected]"
] | |
fd564c59e983ccc78fb0dc633639dc628bc55e09 | a34507bee8dc5502c663a71f3e98257f8ff0334d | /easy/326-3的幂.py | 466aedce67d6f53f2b802168fd8b4e5de6ccb34c | [] | no_license | michelleweii/Leetcode | 85b7876a3e283f3982dd86de01ccc5470e63388f | 0c09b5a018e7334bd49dd251834fc8e547084cc1 | refs/heads/master | 2022-05-17T07:28:23.684720 | 2022-04-28T12:40:48 | 2022-04-28T12:40:48 | 149,776,312 | 3 | 2 | null | null | null | null | UTF-8 | Python | false | false | 971 | py | # 利用pow(a, b)函数即可。需要开a的r次方则pow(a, 1/r)。
# 用取余! python除法/都保留小数点后的数字的
# 不知道为什么leetcode上报错
# class Solution(object):
# def isPowerOfThree(self, n):
# """
# :type n: int
# :rtype: bool
# """
# if n==0:
# return False
# else:
# rs = pow(n,1/3)
# if 3**int(rs) == n:
# return True
# return False
class Solution:
def isPowerOfThree(self, n):
"""
:type n: int
:rtype: bool
"""
while n > 1 :
l = list(map(int, str(n))) # 妙!
if sum(l) % 3 == 0:
n = n // 3
else:
return False
if n <= 0:
return False
return True
def main():
n= 27
myResult = Solution()
print(myResult.isPowerOfThree(n))
if __name__ == '__main__':
main() | [
"[email protected]"
] | |
11a68425333067afa7dc3f201861931da7d6047d | ae12996324ff89489ded4c10163f7ff9919d080b | /LeetCodePython/CanPlaceFlowers.py | 0358e0ea494a51eb3138962f4b54b4310d1f6b00 | [] | no_license | DeanHe/Practice | 31f1f2522f3e7a35dc57f6c1ae74487ad044e2df | 3230cda09ad345f71bb1537cb66124ec051de3a5 | refs/heads/master | 2023-07-05T20:31:33.033409 | 2023-07-01T18:02:32 | 2023-07-01T18:02:32 | 149,399,927 | 1 | 1 | null | null | null | null | UTF-8 | Python | false | false | 1,130 | py | """
You have a long flowerbed in which some of the plots are planted, and some are not. However, flowers cannot be planted in adjacent plots.
Given an integer array flowerbed containing 0's and 1's, where 0 means empty and 1 means not empty, and an integer n, return if n new flowers can be planted in the flowerbed without violating the no-adjacent-flowers rule.
Example 1:
Input: flowerbed = [1,0,0,0,1], n = 1
Output: true
Example 2:
Input: flowerbed = [1,0,0,0,1], n = 2
Output: false
Constraints:
1 <= flowerbed.length <= 2 * 10^4
flowerbed[i] is 0 or 1.
There are no two adjacent flowers in flowerbed.
0 <= n <= flowerbed.length
"""
from typing import List
class CanPlaceFlowers:
def canPlaceFlowers(self, flowerbed: List[int], n: int) -> bool:
cnt = 0
for i in range(len(flowerbed)):
pre, nxt = i - 1, i + 1
if (pre < 0 or flowerbed[pre] == 0) and (nxt >= len(flowerbed) or flowerbed[nxt] == 0):
if flowerbed[i] == 0:
flowerbed[i] = 1
cnt += 1
if cnt >= n:
return True
return False | [
"[email protected]"
] | |
73f8f75df4969f97b4a998348fe16dcc440d2d48 | 7d02813987b49c2a69d92b9b2fdf5148af37274f | /case/Meet/testAEContactsList.py | 63942a80c243f1797dfec6ebb3cadd7c2807d850 | [] | no_license | xgh321324/api_test | 29e01cbe5f0b7c2df25fb7e781cedf8031140c72 | 2575495baac3ab90adab7a7a85904c38a78dd4b7 | refs/heads/master | 2022-07-23T19:54:39.320828 | 2022-07-02T09:13:35 | 2022-07-02T09:13:35 | 129,185,513 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,111 | py | #coding:utf-8
import requests
import unittest
import time
from common.login import LG
from common.logger import Log
from common.Excel import Excel_util
from common.Hash import get_digit,get_sign
class Contact(unittest.TestCase):
def setUp(self):
self.s = requests.session()
self.lgin = LG(self.s) #实例化登录类
self.uid_token = self.lgin.login() #直接取第二部登录
self.header = {'User-Agent': 'LanTingDoctor/1.3.1 (iPad; iOS 10.1.1; Scale/2.00)',
'Accept-Encoding': 'gzip, deflate',
'Accept-Language': 'zh-Hans-CN;q=1',
'Content-Type': 'application/json',
'requestApp': '3',
'requestclient': '2',
'versionForApp': '2.0',
'Authorization': 'Basic YXBpTGFudGluZ0BtZWRsYW5kZXIuY29tOkFwaVRobWxkTWxkQDIwMTM=',
'Connection': 'keep-alive'}
self.log = Log()#实例化日志的类
self.excel = Excel_util(r'C:\Users\Administrator\Desktop\interface_testcase.xls')
def test_contact_list(self):
u'联系人列表接口'
self.log.info('参会人列表接口测试开始')
url = 'http://api.meet.sunnycare.cc/v2/contact/records'
json_data = {
"token":self.uid_token,
"nonce": get_digit(),
"timestamp": str(int(time.time()))
}
#入参加密
json_data['sign'] = get_sign(json_data)
r = self.s.post(url,headers = self.header,json=json_data)
self.log.info('参会人列表返回内容是:%s' % r.json())
conten = r.json()['data']['content']
contact_code = {}
j = 1
for i in conten:
contact_code['contact_code'+str(j)] = i['contact_code']
j += 1
#将contact_code写入excel供其他借口调用
self.excel.write_value(15,6,contact_code)
self.log.info('参会人列表接口测试结束!')
def tearDown(self):
self.s.close()
if __name__=='__main__':
unittest.main()
| [
"[email protected]"
] | |
95667a1114228dc710f3b65a3610f04a9a086f0a | 2b682a01d19960e2039e2e064a742289b30da62c | /SConsArguments/tar.py | bc76ba439c220b692ae99a89c81ab1e85f7ee5f7 | [
"MIT"
] | permissive | mcqueen256/scons-arguments | 952a427977c42161802225464e99bfeb4e5e9fd5 | f4b783fc79fe3fc16e8d0f58308099a67752d299 | refs/heads/master | 2021-01-01T16:11:53.403454 | 2017-02-15T19:46:28 | 2017-02-15T19:46:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,620 | py | """`SConsArguments.tar`
Defines arguments related to tar archiver
**Arguments**
Programs:
TAR
The tar archiver
Flags for programs:
TARFLAGS
General options passed to the tar archiver
"""
#
# Copyright (c) 2017 by Pawel Tomulik
#
# 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
__docformat__ = "restructuredText"
from SConsArguments.Util import flags2list
from SConsArguments.Importer import export_arguments
_all_arguments = {
'TAR' : {
'help' : 'The tar archiver',
'metavar' : 'PROG'
},
'TARFLAGS' : {
'help' : 'General options passed to the tar archiver',
'metavar' : 'FLAGS',
'converter' : flags2list
},
}
_groups = {
'progs' : [ 'TAR' ],
'flags' : [ 'TARFLAGS' ]
}
def arguments(**kw):
"""Returns argument declarations for 'tar' tool
:Keywords:
include_groups : str | list
include only arguments assigned to these groups
exclude_groups : str | list
exclude arguments assigned to these groups
tar_include_groups : str | list
include only arguments assigned to these groups, this has
higher priority than **include_groups**
tar_exclude_groups : str | list
exclude arguments assigned to these groups, this has higher
priority than **exclude_groups**
"""
return export_arguments('tar', _all_arguments, _groups, **kw)
# Local Variables:
# # tab-width:4
# # indent-tabs-mode:nil
# # End:
# vim: set syntax=python expandtab tabstop=4 shiftwidth=4:
| [
"[email protected]"
] | |
8969b6e9049aa0a8874b99aaa9b5e8d495a76ee7 | c9ddbdb5678ba6e1c5c7e64adf2802ca16df778c | /cases/synthetic/sieve-big-3356.py | b8a251c4ba3c06f4fc6c3353b8e3e7644e1718ee | [] | no_license | Virtlink/ccbench-chocopy | c3f7f6af6349aff6503196f727ef89f210a1eac8 | c7efae43bf32696ee2b2ee781bdfe4f7730dec3f | refs/heads/main | 2023-04-07T15:07:12.464038 | 2022-02-03T15:42:39 | 2022-02-03T15:42:39 | 451,969,776 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 31,756 | py | # A resizable list of integers
class Vector(object):
items: [int] = None
size: int = 0
def __init__(self:"Vector"):
self.items = [0]
# Returns current capacity
def capacity(self:"Vector") -> int:
return len(self.items)
# Increases capacity of vector by one element
def increase_capacity(self:"Vector") -> int:
self.items = self.items + [0]
return self.capacity()
# Appends one item to end of vector
def append(self:"Vector", item: int) -> object:
if self.size == self.capacity():
self.increase_capacity()
self.items[self.size] = item
self.size = self.size + 1
# Appends many items to end of vector
def append_all(self:"Vector", new_items: [int]) -> object:
item:int = 0
for item in new_items:
self.append(item)
# Removes an item from the middle of vector
def remove_at(self:"Vector", idx: int) -> object:
if idx < 0:
return
while idx < self.size - 1:
self.items[idx] = self.items[idx + 1]
idx = idx + 1
self.size = self.size - 1
# Retrieves an item at a given index
def get(self:"Vector", idx: int) -> int:
return self.items[idx]
# Retrieves the current size of the vector
def length(self:"Vector") -> int:
return self.size
# A resizable list of integers
class Vector2(object):
items: [int] = None
items2: [int] = None
size: int = 0
size2: int = 0
def __init__(self:"Vector2"):
self.items = [0]
# Returns current capacity
def capacity(self:"Vector2") -> int:
return len(self.items)
# Returns current capacity
def capacity2(self:"Vector2") -> int:
return len(self.items)
# Increases capacity of vector by one element
def increase_capacity(self:"Vector2") -> int:
self.items = self.items + [0]
return self.capacity()
# Increases capacity of vector by one element
def increase_capacity2(self:"Vector2") -> int:
self.items = self.items + [0]
return self.capacity()
# Appends one item to end of vector
def append(self:"Vector2", item: int) -> object:
if self.size == self.capacity():
self.increase_capacity()
self.items[self.size] = item
self.size = self.size + 1
# Appends one item to end of vector
def append2(self:"Vector2", item: int, item2: int) -> object:
if self.size == self.capacity():
self.increase_capacity()
self.items[self.size] = item
self.size = self.size + 1
# Appends many items to end of vector
def append_all(self:"Vector2", new_items: [int]) -> object:
item:int = 0
for item in new_items:
self.append(item)
# Appends many items to end of vector
def append_all2(self:"Vector2", new_items: [int], new_items2: [int]) -> object:
item:int = 0
item2:int = 0
for item in new_items:
self.append(item)
# Removes an item from the middle of vector
def remove_at(self:"Vector2", idx: int) -> object:
if idx < 0:
return
while idx < self.size - 1:
self.items[idx] = self.items[idx + 1]
idx = idx + 1
self.size = self.size - 1
# Removes an item from the middle of vector
def remove_at2(self:"Vector2", idx: int, idx2: int) -> object:
if idx < 0:
return
while idx < self.size - 1:
self.items[idx] = self.items[idx + 1]
idx = idx + 1
self.size = self.size - 1
# Retrieves an item at a given index
def get(self:"Vector2", idx: int) -> int:
return self.items[idx]
# Retrieves an item at a given index
def get2(self:"Vector2", idx: int, idx2: int) -> int:
return self.items[idx]
# Retrieves the current size of the vector
def length(self:"Vector2") -> int:
return self.size
# Retrieves the current size of the vector
def length2(self:"Vector2") -> int:
return self.size
# A resizable list of integers
class Vector3(object):
items: [int] = None
items2: [int] = None
items3: [int] = None
size: int = 0
size2: int = 0
size3: int = 0
def __init__(self:"Vector3"):
self.items = [0]
# Returns current capacity
def capacity(self:"Vector3") -> int:
return len(self.items)
# Returns current capacity
def capacity2(self:"Vector3") -> int:
return len(self.items)
# Returns current capacity
def capacity3(self:"Vector3") -> int:
return len(self.items)
# Increases capacity of vector by one element
def increase_capacity(self:"Vector3") -> int:
self.items = self.items + [0]
return self.capacity()
# Increases capacity of vector by one element
def increase_capacity2(self:"Vector3") -> int:
self.items = self.items + [0]
return self.capacity()
# Increases capacity of vector by one element
def increase_capacity3(self:"Vector3") -> int:
self.items = self.items + [0]
return self.capacity()
# Appends one item to end of vector
def append(self:"Vector3", item: int) -> object:
if self.size == self.capacity():
self.increase_capacity()
self.items[self.size] = item
self.size = self.size + 1
# Appends one item to end of vector
def append2(self:"Vector3", item: int, item2: int) -> object:
if self.size == self.capacity():
self.increase_capacity()
self.items[self.size] = item
self.size = self.size + 1
# Appends one item to end of vector
def append3(self:"Vector3", item: int, item2: int, item3: int) -> object:
if self.size == self.capacity():
self.increase_capacity()
self.items[self.size] = item
self.size = self.size + 1
# Appends many items to end of vector
def append_all(self:"Vector3", new_items: [int]) -> object:
item:int = 0
for item in new_items:
self.append(item)
# Appends many items to end of vector
def append_all2(self:"Vector3", new_items: [int], new_items2: [int]) -> object:
item:int = 0
item2:int = 0
for item in new_items:
self.append(item)
# Appends many items to end of vector
def append_all3(self:"Vector3", new_items: [int], new_items2: [int], new_items3: [int]) -> object:
item:int = 0
item2:int = 0
item3:int = 0
for item in new_items:
self.append(item)
# Removes an item from the middle of vector
def remove_at(self:"Vector3", idx: int) -> object:
if idx < 0:
return
while idx < self.size - 1:
self.items[idx] = self.items[idx + 1]
idx = idx + 1
self.size = self.size - 1
# Removes an item from the middle of vector
def remove_at2(self:"Vector3", idx: int, idx2: int) -> object:
if idx < 0:
return
while idx < self.size - 1:
self.items[idx] = self.items[idx + 1]
idx = idx + 1
self.size = self.size - 1
# Removes an item from the middle of vector
def remove_at3(self:"Vector3", idx: int, idx2: int, idx3: int) -> object:
if idx < 0:
return
while idx < self.size - 1:
self.items[idx] = self.items[idx + 1]
idx = idx + 1
self.size = self.size - 1
# Retrieves an item at a given index
def get(self:"Vector3", idx: int) -> int:
return self.items[idx]
# Retrieves an item at a given index
def get2(self:"Vector3", idx: int, idx2: int) -> int:
return self.items[idx]
# Retrieves an item at a given index
def get3(self:"Vector3", idx: int, idx2: int, idx3: int) -> int:
return self.items[idx]
# Retrieves the current size of the vector
def length(self:"Vector3") -> int:
return self.size
# Retrieves the current size of the vector
def length2(self:"Vector3") -> int:
return self.size
# Retrieves the current size of the vector
def length3(self:"Vector3") -> int:
return self.size
# A resizable list of integers
class Vector4(object):
items: [int] = None
items2: [int] = None
items3: [int] = None
items4: [int] = None
size: int = 0
size2: int = 0
size3: int = 0
size4: int = 0
def __init__(self:"Vector4"):
self.items = [0]
# Returns current capacity
def capacity(self:"Vector4") -> int:
return len(self.items)
# Returns current capacity
def capacity2(self:"Vector4") -> int:
return len(self.items)
# Returns current capacity
def capacity3(self:"Vector4") -> int:
return len(self.items)
# Returns current capacity
def capacity4(self:"Vector4") -> int:
return len(self.items)
# Increases capacity of vector by one element
def increase_capacity(self:"Vector4") -> int:
self.items = self.items + [0]
return self.capacity()
# Increases capacity of vector by one element
def increase_capacity2(self:"Vector4") -> int:
self.items = self.items + [0]
return self.capacity()
# Increases capacity of vector by one element
def increase_capacity3(self:"Vector4") -> int:
self.items = self.items + [0]
return self.capacity()
# Increases capacity of vector by one element
def increase_capacity4(self:"Vector4") -> int:
self.items = self.items + [0]
return self.capacity()
# Appends one item to end of vector
def append(self:"Vector4", item: int) -> object:
if self.size == self.capacity():
self.increase_capacity()
self.items[self.size] = item
self.size = self.size + 1
# Appends one item to end of vector
def append2(self:"Vector4", item: int, item2: int) -> object:
if self.size == self.capacity():
self.increase_capacity()
self.items[self.size] = item
self.size = self.size + 1
# Appends one item to end of vector
def append3(self:"Vector4", item: int, item2: int, item3: int) -> object:
if self.size == self.capacity():
self.increase_capacity()
self.items[self.size] = item
self.size = self.size + 1
# Appends one item to end of vector
def append4(self:"Vector4", item: int, item2: int, item3: int, item4: int) -> object:
if self.size == self.capacity():
self.increase_capacity()
self.items[self.size] = item
self.size = self.size + 1
# Appends many items to end of vector
def append_all(self:"Vector4", new_items: [int]) -> object:
item:int = 0
for item in new_items:
self.append(item)
# Appends many items to end of vector
def append_all2(self:"Vector4", new_items: [int], new_items2: [int]) -> object:
$TypedVar = 0
item2:int = 0
for item in new_items:
self.append(item)
# Appends many items to end of vector
def append_all3(self:"Vector4", new_items: [int], new_items2: [int], new_items3: [int]) -> object:
item:int = 0
item2:int = 0
item3:int = 0
for item in new_items:
self.append(item)
# Appends many items to end of vector
def append_all4(self:"Vector4", new_items: [int], new_items2: [int], new_items3: [int], new_items4: [int]) -> object:
item:int = 0
item2:int = 0
item3:int = 0
item4:int = 0
for item in new_items:
self.append(item)
# Removes an item from the middle of vector
def remove_at(self:"Vector4", idx: int) -> object:
if idx < 0:
return
while idx < self.size - 1:
self.items[idx] = self.items[idx + 1]
idx = idx + 1
self.size = self.size - 1
# Removes an item from the middle of vector
def remove_at2(self:"Vector4", idx: int, idx2: int) -> object:
if idx < 0:
return
while idx < self.size - 1:
self.items[idx] = self.items[idx + 1]
idx = idx + 1
self.size = self.size - 1
# Removes an item from the middle of vector
def remove_at3(self:"Vector4", idx: int, idx2: int, idx3: int) -> object:
if idx < 0:
return
while idx < self.size - 1:
self.items[idx] = self.items[idx + 1]
idx = idx + 1
self.size = self.size - 1
# Removes an item from the middle of vector
def remove_at4(self:"Vector4", idx: int, idx2: int, idx3: int, idx4: int) -> object:
if idx < 0:
return
while idx < self.size - 1:
self.items[idx] = self.items[idx + 1]
idx = idx + 1
self.size = self.size - 1
# Retrieves an item at a given index
def get(self:"Vector4", idx: int) -> int:
return self.items[idx]
# Retrieves an item at a given index
def get2(self:"Vector4", idx: int, idx2: int) -> int:
return self.items[idx]
# Retrieves an item at a given index
def get3(self:"Vector4", idx: int, idx2: int, idx3: int) -> int:
return self.items[idx]
# Retrieves an item at a given index
def get4(self:"Vector4", idx: int, idx2: int, idx3: int, idx4: int) -> int:
return self.items[idx]
# Retrieves the current size of the vector
def length(self:"Vector4") -> int:
return self.size
# Retrieves the current size of the vector
def length2(self:"Vector4") -> int:
return self.size
# Retrieves the current size of the vector
def length3(self:"Vector4") -> int:
return self.size
# Retrieves the current size of the vector
def length4(self:"Vector4") -> int:
return self.size
# A resizable list of integers
class Vector5(object):
items: [int] = None
items2: [int] = None
items3: [int] = None
items4: [int] = None
items5: [int] = None
size: int = 0
size2: int = 0
size3: int = 0
size4: int = 0
size5: int = 0
def __init__(self:"Vector5"):
self.items = [0]
# Returns current capacity
def capacity(self:"Vector5") -> int:
return len(self.items)
# Returns current capacity
def capacity2(self:"Vector5") -> int:
return len(self.items)
# Returns current capacity
def capacity3(self:"Vector5") -> int:
return len(self.items)
# Returns current capacity
def capacity4(self:"Vector5") -> int:
return len(self.items)
# Returns current capacity
def capacity5(self:"Vector5") -> int:
return len(self.items)
# Increases capacity of vector by one element
def increase_capacity(self:"Vector5") -> int:
self.items = self.items + [0]
return self.capacity()
# Increases capacity of vector by one element
def increase_capacity2(self:"Vector5") -> int:
self.items = self.items + [0]
return self.capacity()
# Increases capacity of vector by one element
def increase_capacity3(self:"Vector5") -> int:
self.items = self.items + [0]
return self.capacity()
# Increases capacity of vector by one element
def increase_capacity4(self:"Vector5") -> int:
self.items = self.items + [0]
return self.capacity()
# Increases capacity of vector by one element
def increase_capacity5(self:"Vector5") -> int:
self.items = self.items + [0]
return self.capacity()
# Appends one item to end of vector
def append(self:"Vector5", item: int) -> object:
if self.size == self.capacity():
self.increase_capacity()
self.items[self.size] = item
self.size = self.size + 1
# Appends one item to end of vector
def append2(self:"Vector5", item: int, item2: int) -> object:
if self.size == self.capacity():
self.increase_capacity()
self.items[self.size] = item
self.size = self.size + 1
# Appends one item to end of vector
def append3(self:"Vector5", item: int, item2: int, item3: int) -> object:
if self.size == self.capacity():
self.increase_capacity()
self.items[self.size] = item
self.size = self.size + 1
# Appends one item to end of vector
def append4(self:"Vector5", item: int, item2: int, item3: int, item4: int) -> object:
if self.size == self.capacity():
self.increase_capacity()
self.items[self.size] = item
self.size = self.size + 1
# Appends one item to end of vector
def append5(self:"Vector5", item: int, item2: int, item3: int, item4: int, item5: int) -> object:
if self.size == self.capacity():
self.increase_capacity()
self.items[self.size] = item
self.size = self.size + 1
# Appends many items to end of vector
def append_all(self:"Vector5", new_items: [int]) -> object:
item:int = 0
for item in new_items:
self.append(item)
# Appends many items to end of vector
def append_all2(self:"Vector5", new_items: [int], new_items2: [int]) -> object:
item:int = 0
item2:int = 0
for item in new_items:
self.append(item)
# Appends many items to end of vector
def append_all3(self:"Vector5", new_items: [int], new_items2: [int], new_items3: [int]) -> object:
item:int = 0
item2:int = 0
item3:int = 0
for item in new_items:
self.append(item)
# Appends many items to end of vector
def append_all4(self:"Vector5", new_items: [int], new_items2: [int], new_items3: [int], new_items4: [int]) -> object:
item:int = 0
item2:int = 0
item3:int = 0
item4:int = 0
for item in new_items:
self.append(item)
# Appends many items to end of vector
def append_all5(self:"Vector5", new_items: [int], new_items2: [int], new_items3: [int], new_items4: [int], new_items5: [int]) -> object:
item:int = 0
item2:int = 0
item3:int = 0
item4:int = 0
item5:int = 0
for item in new_items:
self.append(item)
# Removes an item from the middle of vector
def remove_at(self:"Vector5", idx: int) -> object:
if idx < 0:
return
while idx < self.size - 1:
self.items[idx] = self.items[idx + 1]
idx = idx + 1
self.size = self.size - 1
# Removes an item from the middle of vector
def remove_at2(self:"Vector5", idx: int, idx2: int) -> object:
if idx < 0:
return
while idx < self.size - 1:
self.items[idx] = self.items[idx + 1]
idx = idx + 1
self.size = self.size - 1
# Removes an item from the middle of vector
def remove_at3(self:"Vector5", idx: int, idx2: int, idx3: int) -> object:
if idx < 0:
return
while idx < self.size - 1:
self.items[idx] = self.items[idx + 1]
idx = idx + 1
self.size = self.size - 1
# Removes an item from the middle of vector
def remove_at4(self:"Vector5", idx: int, idx2: int, idx3: int, idx4: int) -> object:
if idx < 0:
return
while idx < self.size - 1:
self.items[idx] = self.items[idx + 1]
idx = idx + 1
self.size = self.size - 1
# Removes an item from the middle of vector
def remove_at5(self:"Vector5", idx: int, idx2: int, idx3: int, idx4: int, idx5: int) -> object:
if idx < 0:
return
while idx < self.size - 1:
self.items[idx] = self.items[idx + 1]
idx = idx + 1
self.size = self.size - 1
# Retrieves an item at a given index
def get(self:"Vector5", idx: int) -> int:
return self.items[idx]
# Retrieves an item at a given index
def get2(self:"Vector5", idx: int, idx2: int) -> int:
return self.items[idx]
# Retrieves an item at a given index
def get3(self:"Vector5", idx: int, idx2: int, idx3: int) -> int:
return self.items[idx]
# Retrieves an item at a given index
def get4(self:"Vector5", idx: int, idx2: int, idx3: int, idx4: int) -> int:
return self.items[idx]
# Retrieves an item at a given index
def get5(self:"Vector5", idx: int, idx2: int, idx3: int, idx4: int, idx5: int) -> int:
return self.items[idx]
# Retrieves the current size of the vector
def length(self:"Vector5") -> int:
return self.size
# Retrieves the current size of the vector
def length2(self:"Vector5") -> int:
return self.size
# Retrieves the current size of the vector
def length3(self:"Vector5") -> int:
return self.size
# Retrieves the current size of the vector
def length4(self:"Vector5") -> int:
return self.size
# Retrieves the current size of the vector
def length5(self:"Vector5") -> int:
return self.size
# A faster (but more memory-consuming) implementation of vector
class DoublingVector(Vector):
doubling_limit:int = 1000
# Overriding to do fewer resizes
def increase_capacity(self:"DoublingVector") -> int:
if (self.capacity() <= self.doubling_limit // 2):
self.items = self.items + self.items
else:
# If doubling limit has been reached, fall back to
# standard capacity increases
self.items = self.items + [0]
return self.capacity()
# A faster (but more memory-consuming) implementation of vector
class DoublingVector2(Vector):
doubling_limit:int = 1000
doubling_limit2:int = 1000
# Overriding to do fewer resizes
def increase_capacity(self:"DoublingVector2") -> int:
if (self.capacity() <= self.doubling_limit // 2):
self.items = self.items + self.items
else:
# If doubling limit has been reached, fall back to
# standard capacity increases
self.items = self.items + [0]
return self.capacity()
# Overriding to do fewer resizes
def increase_capacity2(self:"DoublingVector2") -> int:
if (self.capacity() <= self.doubling_limit // 2):
self.items = self.items + self.items
else:
# If doubling limit has been reached, fall back to
# standard capacity increases
self.items = self.items + [0]
return self.capacity()
# A faster (but more memory-consuming) implementation of vector
class DoublingVector3(Vector):
doubling_limit:int = 1000
doubling_limit2:int = 1000
doubling_limit3:int = 1000
# Overriding to do fewer resizes
def increase_capacity(self:"DoublingVector3") -> int:
if (self.capacity() <= self.doubling_limit // 2):
self.items = self.items + self.items
else:
# If doubling limit has been reached, fall back to
# standard capacity increases
self.items = self.items + [0]
return self.capacity()
# Overriding to do fewer resizes
def increase_capacity2(self:"DoublingVector3") -> int:
if (self.capacity() <= self.doubling_limit // 2):
self.items = self.items + self.items
else:
# If doubling limit has been reached, fall back to
# standard capacity increases
self.items = self.items + [0]
return self.capacity()
# Overriding to do fewer resizes
def increase_capacity3(self:"DoublingVector3") -> int:
if (self.capacity() <= self.doubling_limit // 2):
self.items = self.items + self.items
else:
# If doubling limit has been reached, fall back to
# standard capacity increases
self.items = self.items + [0]
return self.capacity()
# A faster (but more memory-consuming) implementation of vector
class DoublingVector4(Vector):
doubling_limit:int = 1000
doubling_limit2:int = 1000
doubling_limit3:int = 1000
doubling_limit4:int = 1000
# Overriding to do fewer resizes
def increase_capacity(self:"DoublingVector4") -> int:
if (self.capacity() <= self.doubling_limit // 2):
self.items = self.items + self.items
else:
# If doubling limit has been reached, fall back to
# standard capacity increases
self.items = self.items + [0]
return self.capacity()
# Overriding to do fewer resizes
def increase_capacity2(self:"DoublingVector4") -> int:
if (self.capacity() <= self.doubling_limit // 2):
self.items = self.items + self.items
else:
# If doubling limit has been reached, fall back to
# standard capacity increases
self.items = self.items + [0]
return self.capacity()
# Overriding to do fewer resizes
def increase_capacity3(self:"DoublingVector4") -> int:
if (self.capacity() <= self.doubling_limit // 2):
self.items = self.items + self.items
else:
# If doubling limit has been reached, fall back to
# standard capacity increases
self.items = self.items + [0]
return self.capacity()
# Overriding to do fewer resizes
def increase_capacity4(self:"DoublingVector4") -> int:
if (self.capacity() <= self.doubling_limit // 2):
self.items = self.items + self.items
else:
# If doubling limit has been reached, fall back to
# standard capacity increases
self.items = self.items + [0]
return self.capacity()
# A faster (but more memory-consuming) implementation of vector
class DoublingVector5(Vector):
doubling_limit:int = 1000
doubling_limit2:int = 1000
doubling_limit3:int = 1000
doubling_limit4:int = 1000
doubling_limit5:int = 1000
# Overriding to do fewer resizes
def increase_capacity(self:"DoublingVector5") -> int:
if (self.capacity() <= self.doubling_limit // 2):
self.items = self.items + self.items
else:
# If doubling limit has been reached, fall back to
# standard capacity increases
self.items = self.items + [0]
return self.capacity()
# Overriding to do fewer resizes
def increase_capacity2(self:"DoublingVector5") -> int:
if (self.capacity() <= self.doubling_limit // 2):
self.items = self.items + self.items
else:
# If doubling limit has been reached, fall back to
# standard capacity increases
self.items = self.items + [0]
return self.capacity()
# Overriding to do fewer resizes
def increase_capacity3(self:"DoublingVector5") -> int:
if (self.capacity() <= self.doubling_limit // 2):
self.items = self.items + self.items
else:
# If doubling limit has been reached, fall back to
# standard capacity increases
self.items = self.items + [0]
return self.capacity()
# Overriding to do fewer resizes
def increase_capacity4(self:"DoublingVector5") -> int:
if (self.capacity() <= self.doubling_limit // 2):
self.items = self.items + self.items
else:
# If doubling limit has been reached, fall back to
# standard capacity increases
self.items = self.items + [0]
return self.capacity()
# Overriding to do fewer resizes
def increase_capacity5(self:"DoublingVector5") -> int:
if (self.capacity() <= self.doubling_limit // 2):
self.items = self.items + self.items
else:
# If doubling limit has been reached, fall back to
# standard capacity increases
self.items = self.items + [0]
return self.capacity()
# Makes a vector in the range [i, j)
def vrange(i:int, j:int) -> Vector:
v:Vector = None
v = DoublingVector()
while i < j:
v.append(i)
i = i + 1
return v
def vrange2(i:int, j:int, i2:int, j2:int) -> Vector:
v:Vector = None
v2:Vector = None
v = DoublingVector()
while i < j:
v.append(i)
i = i + 1
return v
def vrange3(i:int, j:int, i2:int, j2:int, i3:int, j3:int) -> Vector:
v:Vector = None
v2:Vector = None
v3:Vector = None
v = DoublingVector()
while i < j:
v.append(i)
i = i + 1
return v
def vrange4(i:int, j:int, i2:int, j2:int, i3:int, j3:int, i4:int, j4:int) -> Vector:
v:Vector = None
v2:Vector = None
v3:Vector = None
v4:Vector = None
v = DoublingVector()
while i < j:
v.append(i)
i = i + 1
return v
def vrange5(i:int, j:int, i2:int, j2:int, i3:int, j3:int, i4:int, j4:int, i5:int, j5:int) -> Vector:
v:Vector = None
v2:Vector = None
v3:Vector = None
v4:Vector = None
v5:Vector = None
v = DoublingVector()
while i < j:
v.append(i)
i = i + 1
return v
# Sieve of Eratosthenes (not really)
def sieve(v:Vector) -> object:
i:int = 0
j:int = 0
k:int = 0
while i < v.length():
k = v.get(i)
j = i + 1
while j < v.length():
if v.get(j) % k == 0:
v.remove_at(j)
else:
j = j + 1
i = i + 1
def sieve2(v:Vector, v2:Vector) -> object:
i:int = 0
i2:int = 0
j:int = 0
j2:int = 0
k:int = 0
k2:int = 0
while i < v.length():
k = v.get(i)
j = i + 1
while j < v.length():
if v.get(j) % k == 0:
v.remove_at(j)
else:
j = j + 1
i = i + 1
def sieve3(v:Vector, v2:Vector, v3:Vector) -> object:
i:int = 0
i2:int = 0
i3:int = 0
j:int = 0
j2:int = 0
j3:int = 0
k:int = 0
k2:int = 0
k3:int = 0
while i < v.length():
k = v.get(i)
j = i + 1
while j < v.length():
if v.get(j) % k == 0:
v.remove_at(j)
else:
j = j + 1
i = i + 1
def sieve4(v:Vector, v2:Vector, v3:Vector, v4:Vector) -> object:
i:int = 0
i2:int = 0
i3:int = 0
i4:int = 0
j:int = 0
j2:int = 0
j3:int = 0
j4:int = 0
k:int = 0
k2:int = 0
k3:int = 0
k4:int = 0
while i < v.length():
k = v.get(i)
j = i + 1
while j < v.length():
if v.get(j) % k == 0:
v.remove_at(j)
else:
j = j + 1
i = i + 1
def sieve5(v:Vector, v2:Vector, v3:Vector, v4:Vector, v5:Vector) -> object:
i:int = 0
i2:int = 0
i3:int = 0
i4:int = 0
i5:int = 0
j:int = 0
j2:int = 0
j3:int = 0
j4:int = 0
j5:int = 0
k:int = 0
k2:int = 0
k3:int = 0
k4:int = 0
k5:int = 0
while i < v.length():
k = v.get(i)
j = i + 1
while j < v.length():
if v.get(j) % k == 0:
v.remove_at(j)
else:
j = j + 1
i = i + 1
# Input parameter
n:int = 50
n2:int = 50
n3:int = 50
n4:int = 50
n5:int = 50
# Data
v:Vector = None
v2:Vector = None
v3:Vector = None
v4:Vector = None
v5:Vector = None
i:int = 0
i2:int = 0
i3:int = 0
i4:int = 0
i5:int = 0
# Crunch
v = vrange(2, n)
v2 = vrange(2, n)
v3 = vrange(2, n)
v4 = vrange(2, n)
v5 = vrange(2, n)
sieve(v)
# Print
while i < v.length():
print(v.get(i))
i = i + 1
| [
"[email protected]"
] | |
e59394be39c2b5feb474f059797294a1fc29e9c5 | 6fcfb638fa725b6d21083ec54e3609fc1b287d9e | /python/gevent_gevent/gevent-master/src/gevent/pywsgi.py | 87d77b3f444faa1b63eb9184dc9cbe8ff4535e17 | [] | no_license | LiuFang816/SALSTM_py_data | 6db258e51858aeff14af38898fef715b46980ac1 | d494b3041069d377d6a7a9c296a14334f2fa5acc | refs/heads/master | 2022-12-25T06:39:52.222097 | 2019-12-12T08:49:07 | 2019-12-12T08:49:07 | 227,546,525 | 10 | 7 | null | 2022-12-19T02:53:01 | 2019-12-12T07:29:39 | Python | UTF-8 | Python | false | false | 59,101 | py | # Copyright (c) 2005-2009, eventlet contributors
# Copyright (c) 2009-2015, gevent contributors
"""
A pure-Python, gevent-friendly WSGI server.
The server is provided in :class:`WSGIServer`, but most of the actual
WSGI work is handled by :class:`WSGIHandler` --- a new instance is
created for each request. The server can be customized to use
different subclasses of :class:`WSGIHandler`.
"""
# FIXME: Can we refactor to make smallor?
# pylint:disable=too-many-lines
import errno
from io import BytesIO
import string
import sys
import time
import traceback
from datetime import datetime
try:
from urllib import unquote
except ImportError:
from urllib.parse import unquote # python 2 pylint:disable=import-error,no-name-in-module
from gevent import socket
import gevent
from gevent.server import StreamServer
from gevent.hub import GreenletExit
from gevent._compat import PY3, reraise
from functools import partial
if PY3:
unquote_latin1 = partial(unquote, encoding='latin-1')
else:
unquote_latin1 = unquote
_no_undoc_members = True # Don't put undocumented things into sphinx
__all__ = [
'WSGIServer',
'WSGIHandler',
'LoggingLogAdapter',
'Environ',
'SecureEnviron',
'WSGISecureEnviron',
]
MAX_REQUEST_LINE = 8192
# Weekday and month names for HTTP date/time formatting; always English!
_WEEKDAYNAME = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
_MONTHNAME = [None, # Dummy so we can use 1-based month numbers
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
# The contents of the "HEX" grammar rule for HTTP, upper and lowercase A-F plus digits,
# in byte form for comparing to the network.
_HEX = string.hexdigits.encode('ascii')
# Errors
_ERRORS = dict()
_INTERNAL_ERROR_STATUS = '500 Internal Server Error'
_INTERNAL_ERROR_BODY = b'Internal Server Error'
_INTERNAL_ERROR_HEADERS = [('Content-Type', 'text/plain'),
('Connection', 'close'),
('Content-Length', str(len(_INTERNAL_ERROR_BODY)))]
_ERRORS[500] = (_INTERNAL_ERROR_STATUS, _INTERNAL_ERROR_HEADERS, _INTERNAL_ERROR_BODY)
_BAD_REQUEST_STATUS = '400 Bad Request'
_BAD_REQUEST_BODY = ''
_BAD_REQUEST_HEADERS = [('Content-Type', 'text/plain'),
('Connection', 'close'),
('Content-Length', str(len(_BAD_REQUEST_BODY)))]
_ERRORS[400] = (_BAD_REQUEST_STATUS, _BAD_REQUEST_HEADERS, _BAD_REQUEST_BODY)
_REQUEST_TOO_LONG_RESPONSE = b"HTTP/1.1 414 Request URI Too Long\r\nConnection: close\r\nContent-length: 0\r\n\r\n"
_BAD_REQUEST_RESPONSE = b"HTTP/1.1 400 Bad Request\r\nConnection: close\r\nContent-length: 0\r\n\r\n"
_CONTINUE_RESPONSE = b"HTTP/1.1 100 Continue\r\n\r\n"
def format_date_time(timestamp):
# Return a byte-string of the date and time in HTTP format
# .. versionchanged:: 1.1b5
# Return a byte string, not a native string
year, month, day, hh, mm, ss, wd, _y, _z = time.gmtime(timestamp)
value = "%s, %02d %3s %4d %02d:%02d:%02d GMT" % (_WEEKDAYNAME[wd], day, _MONTHNAME[month], year, hh, mm, ss)
if PY3:
value = value.encode("latin-1")
return value
class _InvalidClientInput(IOError):
# Internal exception raised by Input indicating that the client
# sent invalid data at the lowest level of the stream. The result
# *should* be a HTTP 400 error.
pass
class _InvalidClientRequest(ValueError):
# Internal exception raised by WSGIHandler.read_request
# indicating that the client sent an HTTP request that cannot
# be parsed (e.g., invalid grammar). The result *should* be an
# HTTP 400 error
pass
class Input(object):
__slots__ = ('rfile', 'content_length', 'socket', 'position',
'chunked_input', 'chunk_length', '_chunked_input_error')
def __init__(self, rfile, content_length, socket=None, chunked_input=False):
# pylint:disable=redefined-outer-name
self.rfile = rfile
self.content_length = content_length
self.socket = socket
self.position = 0
self.chunked_input = chunked_input
self.chunk_length = -1
self._chunked_input_error = False
def _discard(self):
if self._chunked_input_error:
# We are in an unknown state, so we can't necessarily discard
# the body (e.g., if the client keeps the socket open, we could hang
# here forever).
# In this case, we've raised an exception and the user of this object
# is going to close the socket, so we don't have to discard
return
if self.socket is None and (self.position < (self.content_length or 0) or self.chunked_input):
# ## Read and discard body
while 1:
d = self.read(16384)
if not d:
break
def _send_100_continue(self):
if self.socket is not None:
self.socket.sendall(_CONTINUE_RESPONSE)
self.socket = None
def _do_read(self, length=None, use_readline=False):
if use_readline:
reader = self.rfile.readline
else:
reader = self.rfile.read
content_length = self.content_length
if content_length is None:
# Either Content-Length or "Transfer-Encoding: chunked" must be present in a request with a body
# if it was chunked, then this function would have not been called
return b''
self._send_100_continue()
left = content_length - self.position
if length is None:
length = left
elif length > left:
length = left
if not length:
return b''
# On Python 2, self.rfile is usually socket.makefile(), which
# uses cStringIO.StringIO. If *length* is greater than the C
# sizeof(int) (typically 32 bits signed), parsing the argument to
# readline raises OverflowError. StringIO.read(), OTOH, uses
# PySize_t, typically a long (64 bits). In a bare readline()
# case, because the header lines we're trying to read with
# readline are typically expected to be small, we can correct
# that failure by simply doing a smaller call to readline and
# appending; failures in read we let propagate.
try:
read = reader(length)
except OverflowError:
if not use_readline:
# Expecting to read more than 64 bits of data. Ouch!
raise
# We could loop on calls to smaller readline(), appending them
# until we actually get a newline. For uses in this module,
# we expect the actual length to be small, but WSGI applications
# are allowed to pass in an arbitrary length. (This loop isn't optimal,
# but even client applications *probably* have short lines.)
read = b''
while len(read) < length and not read.endswith(b'\n'):
read += reader(MAX_REQUEST_LINE)
self.position += len(read)
if len(read) < length:
if (use_readline and not read.endswith(b"\n")) or not use_readline:
raise IOError("unexpected end of file while reading request at position %s" % (self.position,))
return read
def __read_chunk_length(self, rfile):
# Read and return the next integer chunk length. If no
# chunk length can be read, raises _InvalidClientInput.
# Here's the production for a chunk:
# (http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html)
# chunk = chunk-size [ chunk-extension ] CRLF
# chunk-data CRLF
# chunk-size = 1*HEX
# chunk-extension= *( ";" chunk-ext-name [ "=" chunk-ext-val ] )
# chunk-ext-name = token
# chunk-ext-val = token | quoted-string
# To cope with malicious or broken clients that fail to send valid
# chunk lines, the strategy is to read character by character until we either reach
# a ; or newline. If at any time we read a non-HEX digit, we bail. If we hit a
# ;, indicating an chunk-extension, we'll read up to the next
# MAX_REQUEST_LINE characters
# looking for the CRLF, and if we don't find it, we bail. If we read more than 16 hex characters,
# (the number needed to represent a 64-bit chunk size), we bail (this protects us from
# a client that sends an infinite stream of `F`, for example).
buf = BytesIO()
while 1:
char = rfile.read(1)
if not char:
self._chunked_input_error = True
raise _InvalidClientInput("EOF before chunk end reached")
if char == b'\r':
break
if char == b';':
break
if char not in _HEX:
self._chunked_input_error = True
raise _InvalidClientInput("Non-hex data", char)
buf.write(char)
if buf.tell() > 16:
self._chunked_input_error = True
raise _InvalidClientInput("Chunk-size too large.")
if char == b';':
i = 0
while i < MAX_REQUEST_LINE:
char = rfile.read(1)
if char == b'\r':
break
i += 1
else:
# we read more than MAX_REQUEST_LINE without
# hitting CR
self._chunked_input_error = True
raise _InvalidClientInput("Too large chunk extension")
if char == b'\r':
# We either got here from the main loop or from the
# end of an extension
char = rfile.read(1)
if char != b'\n':
self._chunked_input_error = True
raise _InvalidClientInput("Line didn't end in CRLF")
return int(buf.getvalue(), 16)
def _chunked_read(self, length=None, use_readline=False):
# pylint:disable=too-many-branches
rfile = self.rfile
self._send_100_continue()
if length == 0:
return b""
if length is not None and length < 0:
length = None
if use_readline:
reader = self.rfile.readline
else:
reader = self.rfile.read
response = []
while self.chunk_length != 0:
maxreadlen = self.chunk_length - self.position
if length is not None and length < maxreadlen:
maxreadlen = length
if maxreadlen > 0:
data = reader(maxreadlen)
if not data:
self.chunk_length = 0
self._chunked_input_error = True
raise IOError("unexpected end of file while parsing chunked data")
datalen = len(data)
response.append(data)
self.position += datalen
if self.chunk_length == self.position:
rfile.readline()
if length is not None:
length -= datalen
if length == 0:
break
if use_readline and data[-1] == b"\n"[0]:
break
else:
# We're at the beginning of a chunk, so we need to
# determine the next size to read
self.chunk_length = self.__read_chunk_length(rfile)
self.position = 0
if self.chunk_length == 0:
# Last chunk. Terminates with a CRLF.
rfile.readline()
return b''.join(response)
def read(self, length=None):
if self.chunked_input:
return self._chunked_read(length)
return self._do_read(length)
def readline(self, size=None):
if self.chunked_input:
return self._chunked_read(size, True)
else:
return self._do_read(size, use_readline=True)
def readlines(self, hint=None):
# pylint:disable=unused-argument
return list(self)
def __iter__(self):
return self
def next(self):
line = self.readline()
if not line:
raise StopIteration
return line
__next__ = next
try:
import mimetools
headers_factory = mimetools.Message
except ImportError:
# adapt Python 3 HTTP headers to old API
from http import client # pylint:disable=import-error
class OldMessage(client.HTTPMessage):
def __init__(self, **kwargs):
super(client.HTTPMessage, self).__init__(**kwargs) # pylint:disable=bad-super-call
self.status = ''
def getheader(self, name, default=None):
return self.get(name, default)
@property
def headers(self):
for key, value in self._headers:
yield '%s: %s\r\n' % (key, value)
@property
def typeheader(self):
return self.get('content-type')
def headers_factory(fp, *args): # pylint:disable=unused-argument
try:
ret = client.parse_headers(fp, _class=OldMessage)
except client.LineTooLong:
ret = OldMessage()
ret.status = 'Line too long'
return ret
class WSGIHandler(object):
"""
Handles HTTP requests from a socket, creates the WSGI environment, and
interacts with the WSGI application.
This is the default value of :attr:`WSGIServer.handler_class`.
This class may be subclassed carefully, and that class set on a
:class:`WSGIServer` instance through a keyword argument at
construction time.
Instances are constructed with the same arguments as passed to the
server's :meth:`WSGIServer.handle` method followed by the server
itself. The application and environment are obtained from the server.
"""
# pylint:disable=too-many-instance-attributes
protocol_version = 'HTTP/1.1'
if PY3:
# if we do like Py2, then headers_factory unconditionally
# becomes a bound method, meaning the fp argument becomes WSGIHandler
def MessageClass(self, *args):
return headers_factory(*args)
else:
MessageClass = headers_factory
# Attributes reset at various times for each request; not public
# documented. Class attributes to keep the constructor fast
# (but not make lint tools complain)
status = None # byte string: b'200 OK'
_orig_status = None # native string: '200 OK'
response_headers = None # list of tuples (b'name', b'value')
code = None # Integer parsed from status
provided_date = None
provided_content_length = None
close_connection = False
time_start = 0 # time.time() when begin handling request
time_finish = 0 # time.time() when done handling request
headers_sent = False # Have we already sent headers?
response_use_chunked = False # Write with transfer-encoding chunked
environ = None # Dict from self.get_environ
application = None # application callable from self.server.application
requestline = None # native str 'GET / HTTP/1.1'
response_length = 0 # How much data we sent
result = None # The return value of the WSGI application
wsgi_input = None # Instance of Input()
content_length = 0 # From application-provided headers Incoming
# request headers, instance of MessageClass (gunicorn uses hasattr
# on this so the default value needs to be compatible with the
# API)
headers = headers_factory(BytesIO())
request_version = None # str: 'HTTP 1.1'
command = None # str: 'GET'
path = None # str: '/'
def __init__(self, sock, address, server, rfile=None):
# Deprecation: The rfile kwarg was introduced in 1.0a1 as part
# of a refactoring. It was never documented or used. It is
# considered DEPRECATED and may be removed in the future. Its
# use is not supported.
self.socket = sock
self.client_address = address
self.server = server
if rfile is None:
self.rfile = sock.makefile('rb', -1)
else:
self.rfile = rfile
def handle(self):
"""
The main request handling method, called by the server.
This method runs a request handling loop, calling
:meth:`handle_one_request` until all requests on the
connection have been handled (that is, it implements
keep-alive).
"""
try:
while self.socket is not None:
self.time_start = time.time()
self.time_finish = 0
result = self.handle_one_request()
if result is None:
break
if result is True:
continue
self.status, response_body = result
self.socket.sendall(response_body)
if self.time_finish == 0:
self.time_finish = time.time()
self.log_request()
break
finally:
if self.socket is not None:
_sock = getattr(self.socket, '_sock', None) # Python 3
try:
# read out request data to prevent error: [Errno 104] Connection reset by peer
if _sock:
try:
# socket.recv would hang
_sock.recv(16384)
finally:
_sock.close()
self.socket.close()
except socket.error:
pass
self.__dict__.pop('socket', None)
self.__dict__.pop('rfile', None)
def _check_http_version(self):
version_str = self.request_version
if not version_str.startswith("HTTP/"):
return False
version = tuple(int(x) for x in version_str[5:].split(".")) # "HTTP/"
if version[1] < 0 or version < (0, 9) or version >= (2, 0):
return False
return True
def read_request(self, raw_requestline):
"""
Parse the incoming request.
Parses various headers into ``self.headers`` using
:attr:`MessageClass`. Other attributes that are set upon a successful
return of this method include ``self.content_length`` and ``self.close_connection``.
:param str raw_requestline: A native :class:`str` representing
the request line. A processed version of this will be stored
into ``self.requestline``.
:raises ValueError: If the request is invalid. This error will
not be logged as a traceback (because it's a client issue, not a server problem).
:return: A boolean value indicating whether the request was successfully parsed.
This method should either return a true value or have raised a ValueError
with details about the parsing error.
.. versionchanged:: 1.1b6
Raise the previously documented :exc:`ValueError` in more cases instead of returning a
false value; this allows subclasses more opportunity to customize behaviour.
"""
# pylint:disable=too-many-branches
self.requestline = raw_requestline.rstrip()
words = self.requestline.split()
if len(words) == 3:
self.command, self.path, self.request_version = words
if not self._check_http_version():
raise _InvalidClientRequest('Invalid http version: %r', raw_requestline)
elif len(words) == 2:
self.command, self.path = words
if self.command != "GET":
raise _InvalidClientRequest('Expected GET method: %r', raw_requestline)
self.request_version = "HTTP/0.9"
# QQQ I'm pretty sure we can drop support for HTTP/0.9
else:
raise _InvalidClientRequest('Invalid HTTP method: %r', raw_requestline)
self.headers = self.MessageClass(self.rfile, 0)
if self.headers.status:
raise _InvalidClientRequest('Invalid headers status: %r', self.headers.status)
if self.headers.get("transfer-encoding", "").lower() == "chunked":
try:
del self.headers["content-length"]
except KeyError:
pass
content_length = self.headers.get("content-length")
if content_length is not None:
content_length = int(content_length)
if content_length < 0:
raise _InvalidClientRequest('Invalid Content-Length: %r', content_length)
if content_length and self.command in ('HEAD', ):
raise _InvalidClientRequest('Unexpected Content-Length')
self.content_length = content_length
if self.request_version == "HTTP/1.1":
conntype = self.headers.get("Connection", "").lower()
self.close_connection = (conntype == 'close')
else:
self.close_connection = True
return True
def log_error(self, msg, *args):
try:
message = msg % args
except Exception: # pylint:disable=broad-except
traceback.print_exc()
message = '%r %r' % (msg, args)
try:
message = '%s: %s' % (self.socket, message)
except Exception: # pylint:disable=broad-except
pass
try:
self.server.error_log.write(message + '\n')
except Exception: # pylint:disable=broad-except
traceback.print_exc()
def read_requestline(self):
"""
Read and return the HTTP request line.
Under both Python 2 and 3, this should return the native
``str`` type; under Python 3, this probably means the bytes read
from the network need to be decoded (using the ISO-8859-1 charset, aka
latin-1).
"""
line = self.rfile.readline(MAX_REQUEST_LINE)
if PY3:
line = line.decode('latin-1')
return line
def handle_one_request(self):
"""
Handles one HTTP request using ``self.socket`` and ``self.rfile``.
Each invocation of this method will do several things, including (but not limited to):
- Read the request line using :meth:`read_requestline`;
- Read the rest of the request, including headers, with :meth:`read_request`;
- Construct a new WSGI environment in ``self.environ`` using :meth:`get_environ`;
- Store the application in ``self.application``, retrieving it from the server;
- Handle the remainder of the request, including invoking the application,
with :meth:`handle_one_response`
There are several possible return values to indicate the state
of the client connection:
- ``None``
The client connection is already closed or should
be closed because the WSGI application or client set the
``Connection: close`` header. The request handling
loop should terminate and perform cleanup steps.
- (status, body)
An HTTP status and body tuple. The request was in error,
as detailed by the status and body. The request handling
loop should terminate, close the connection, and perform
cleanup steps. Note that the ``body`` is the complete contents
to send to the client, including all headers and the initial
status line.
- ``True``
The literal ``True`` value. The request was successfully handled
and the response sent to the client by :meth:`handle_one_response`.
The connection remains open to process more requests and the connection
handling loop should call this method again. This is the typical return
value.
.. seealso:: :meth:`handle`
.. versionchanged:: 1.1b6
Funnel exceptions having to do with invalid HTTP requests through
:meth:`_handle_client_error` to allow subclasses to customize. Note that
this is experimental and may change in the future.
"""
# pylint:disable=too-many-return-statements
if self.rfile.closed:
return
try:
self.requestline = self.read_requestline()
# Account for old subclasses that haven't done this
if PY3 and isinstance(self.requestline, bytes):
self.requestline = self.requestline.decode('latin-1')
except socket.error:
# "Connection reset by peer" or other socket errors aren't interesting here
return
if not self.requestline:
return
self.response_length = 0
if len(self.requestline) >= MAX_REQUEST_LINE:
return ('414', _REQUEST_TOO_LONG_RESPONSE)
try:
# for compatibility with older versions of pywsgi, we pass self.requestline as an argument there
# NOTE: read_request is supposed to raise ValueError on invalid input; allow old
# subclasses that return a False value instead.
# NOTE: This can mutate the value of self.headers, so self.get_environ() must not be
# called until AFTER this call is done.
if not self.read_request(self.requestline):
return ('400', _BAD_REQUEST_RESPONSE)
except Exception as ex: # pylint:disable=broad-except
# Notice we don't use self.handle_error because it reports
# a 500 error to the client, and this is almost certainly
# a client error.
# Provide a hook for subclasses.
return self._handle_client_error(ex)
self.environ = self.get_environ()
self.application = self.server.application
self.handle_one_response()
if self.close_connection:
return
if self.rfile.closed:
return
return True # read more requests
def finalize_headers(self):
if self.provided_date is None:
self.response_headers.append((b'Date', format_date_time(time.time())))
if self.code not in (304, 204):
# the reply will include message-body; make sure we have either Content-Length or chunked
if self.provided_content_length is None:
if hasattr(self.result, '__len__'):
total_len = sum(len(chunk) for chunk in self.result)
total_len_str = str(total_len)
if PY3:
total_len_str = total_len_str.encode("latin-1")
self.response_headers.append((b'Content-Length', total_len_str))
else:
if self.request_version != 'HTTP/1.0':
self.response_use_chunked = True
self.response_headers.append((b'Transfer-Encoding', b'chunked'))
def _sendall(self, data):
try:
self.socket.sendall(data)
except socket.error as ex:
self.status = 'socket error: %s' % ex
if self.code > 0:
self.code = -self.code
raise
self.response_length += len(data)
def _write(self, data):
if not data:
# The application/middleware are allowed to yield
# empty bytestrings.
return
if self.response_use_chunked:
## Write the chunked encoding
header = ("%x\r\n" % len(data)).encode('ascii')
# socket.sendall will slice these small strings, as [0:],
# but that's special cased to return the original string.
# They're small enough we probably expect them to go down to the network
# buffers in one go anyway.
self._sendall(header)
self._sendall(data)
self._sendall(b'\r\n') # trailer
else:
self._sendall(data)
def write(self, data):
# The write() callable we return from start_response.
# https://www.python.org/dev/peps/pep-3333/#the-write-callable
# Supposed to do pretty much the same thing as yielding values
# from the application's return.
if self.code in (304, 204) and data:
raise AssertionError('The %s response must have no body' % self.code)
if self.headers_sent:
self._write(data)
else:
if not self.status:
raise AssertionError("The application did not call start_response()")
self._write_with_headers(data)
def _write_with_headers(self, data):
towrite = bytearray()
self.headers_sent = True
self.finalize_headers()
# self.response_headers and self.status are already in latin-1, as encoded by self.start_response
towrite.extend(b'HTTP/1.1 ')
towrite.extend(self.status)
towrite.extend(b'\r\n')
for header, value in self.response_headers:
towrite.extend(header)
towrite.extend(b': ')
towrite.extend(value)
towrite.extend(b"\r\n")
towrite.extend(b'\r\n')
self._sendall(towrite)
# No need to copy the data into towrite; we may make an extra syscall
# but the copy time could be substantial too, and it reduces the chances
# of sendall being able to send everything in one go
self._write(data)
def start_response(self, status, headers, exc_info=None):
"""
.. versionchanged:: 1.2a1
Avoid HTTP header injection by raising a :exc:`ValueError`
if *status* or any *header* name or value contains a carriage
return or newline.
.. versionchanged:: 1.1b5
Pro-actively handle checking the encoding of the status line
and headers during this method. On Python 2, avoid some
extra encodings.
"""
# pylint:disable=too-many-branches,too-many-statements
if exc_info:
try:
if self.headers_sent:
# Re-raise original exception if headers sent
reraise(*exc_info)
finally:
# Avoid dangling circular ref
exc_info = None
# Pep 3333, "The start_response callable":
# https://www.python.org/dev/peps/pep-3333/#the-start-response-callable
# "Servers should check for errors in the headers at the time
# start_response is called, so that an error can be raised
# while the application is still running." Here, we check the encoding.
# This aids debugging: headers especially are generated programatically
# and an encoding error in a loop or list comprehension yields an opaque
# UnicodeError without any clue which header was wrong.
# Note that this results in copying the header list at this point, not modifying it,
# although we are allowed to do so if needed. This slightly increases memory usage.
# We also check for HTTP Response Splitting vulnerabilities
response_headers = []
header = None
value = None
try:
for header, value in headers:
if not isinstance(header, str):
raise UnicodeError("The header must be a native string", header, value)
if not isinstance(value, str):
raise UnicodeError("The value must be a native string", header, value)
if '\r' in header or '\n' in header:
raise ValueError('carriage return or newline in header name', header)
if '\r' in value or '\n' in value:
raise ValueError('carriage return or newline in header value', value)
# Either we're on Python 2, in which case bytes is correct, or
# we're on Python 3 and the user screwed up (because it should be a native
# string). In either case, make sure that this is latin-1 compatible. Under
# Python 2, bytes.encode() will take a round-trip through the system encoding,
# which may be ascii, which is not really what we want. However, the latin-1 encoding
# can encode everything except control characters and the block from 0x7F to 0x9F, so
# explicitly round-tripping bytes through the encoding is unlikely to be of much
# benefit, so we go for speed (the WSGI spec specifically calls out allowing the range
# from 0x00 to 0xFF, although the HTTP spec forbids the control characters).
# Note: Some Python 2 implementations, like Jython, may allow non-octet (above 255) values
# in their str implementation; this is mentioned in the WSGI spec, but we don't
# run on any platform like that so we can assume that a str value is pure bytes.
response_headers.append((header if not PY3 else header.encode("latin-1"),
value if not PY3 else value.encode("latin-1")))
except UnicodeEncodeError:
# If we get here, we're guaranteed to have a header and value
raise UnicodeError("Non-latin1 header", repr(header), repr(value))
# Same as above
if not isinstance(status, str):
raise UnicodeError("The status string must be a native string")
if '\r' in status or '\n' in status:
raise ValueError("carriage return or newline in status", status)
# don't assign to anything until the validation is complete, including parsing the
# code
code = int(status.split(' ', 1)[0])
self.status = status if not PY3 else status.encode("latin-1")
self._orig_status = status # Preserve the native string for logging
self.response_headers = response_headers
self.code = code
provided_connection = None
self.provided_date = None
self.provided_content_length = None
for header, value in headers:
header = header.lower()
if header == 'connection':
provided_connection = value
elif header == 'date':
self.provided_date = value
elif header == 'content-length':
self.provided_content_length = value
if self.request_version == 'HTTP/1.0' and provided_connection is None:
response_headers.append((b'Connection', b'close'))
self.close_connection = True
elif provided_connection == 'close':
self.close_connection = True
if self.code in (304, 204):
if self.provided_content_length is not None and self.provided_content_length != '0':
msg = 'Invalid Content-Length for %s response: %r (must be absent or zero)' % (self.code, self.provided_content_length)
if PY3:
msg = msg.encode('latin-1')
raise AssertionError(msg)
return self.write
def log_request(self):
self.server.log.write(self.format_request() + '\n')
def format_request(self):
now = datetime.now().replace(microsecond=0)
length = self.response_length or '-'
if self.time_finish:
delta = '%.6f' % (self.time_finish - self.time_start)
else:
delta = '-'
client_address = self.client_address[0] if isinstance(self.client_address, tuple) else self.client_address
return '%s - - [%s] "%s" %s %s %s' % (
client_address or '-',
now,
self.requestline or '',
# Use the native string version of the status, saved so we don't have to
# decode. But fallback to the encoded 'status' in case of subclasses
# (Is that really necessary? At least there's no overhead.)
(self._orig_status or self.status or '000').split()[0],
length,
delta)
def process_result(self):
for data in self.result:
if data:
self.write(data)
if self.status and not self.headers_sent:
# In other words, the application returned an empty
# result iterable (and did not use the write callable)
# Trigger the flush of the headers.
self.write(b'')
if self.response_use_chunked:
self.socket.sendall(b'0\r\n\r\n')
self.response_length += 5
def run_application(self):
assert self.result is None
try:
self.result = self.application(self.environ, self.start_response)
self.process_result()
finally:
close = getattr(self.result, 'close', None)
try:
if close is not None:
close()
finally:
# Discard the result. If it's a generator this can
# free a lot of hidden resources (if we failed to iterate
# all the way through it---the frames are automatically
# cleaned up when StopIteration is raised); but other cases
# could still free up resources sooner than otherwise.
close = None
self.result = None
def handle_one_response(self):
self.time_start = time.time()
self.status = None
self.headers_sent = False
self.result = None
self.response_use_chunked = False
self.response_length = 0
try:
try:
self.run_application()
finally:
try:
self.wsgi_input._discard()
except (socket.error, IOError):
# Don't let exceptions during discarding
# input override any exception that may have been
# raised by the application, such as our own _InvalidClientInput.
# In the general case, these aren't even worth logging (see the comment
# just below)
pass
except _InvalidClientInput:
self._send_error_response_if_possible(400)
except socket.error as ex:
if ex.args[0] in (errno.EPIPE, errno.ECONNRESET):
# Broken pipe, connection reset by peer.
# Swallow these silently to avoid spewing
# useless info on normal operating conditions,
# bloating logfiles. See https://github.com/gevent/gevent/pull/377
# and https://github.com/gevent/gevent/issues/136.
if not PY3:
sys.exc_clear()
self.close_connection = True
else:
self.handle_error(*sys.exc_info())
except: # pylint:disable=bare-except
self.handle_error(*sys.exc_info())
finally:
self.time_finish = time.time()
self.log_request()
def _send_error_response_if_possible(self, error_code):
if self.response_length:
self.close_connection = True
else:
status, headers, body = _ERRORS[error_code]
try:
self.start_response(status, headers[:])
self.write(body)
except socket.error:
if not PY3:
sys.exc_clear()
self.close_connection = True
def _log_error(self, t, v, tb):
# TODO: Shouldn't we dump this to wsgi.errors? If we did that now, it would
# wind up getting logged twice
if not issubclass(t, GreenletExit):
context = self.environ
if not isinstance(context, self.server.secure_environ_class):
context = self.server.secure_environ_class(context)
self.server.loop.handle_error(context, t, v, tb)
def handle_error(self, t, v, tb):
# Called for internal, unexpected errors, NOT invalid client input
self._log_error(t, v, tb)
del tb
self._send_error_response_if_possible(500)
def _handle_client_error(self, ex):
# Called for invalid client input
# Returns the appropriate error response.
if not isinstance(ex, ValueError):
# XXX: Why not self._log_error to send it through the loop's
# handle_error method?
traceback.print_exc()
if isinstance(ex, _InvalidClientRequest):
# These come with good error messages, and we want to let
# log_error deal with the formatting, especially to handle encoding
self.log_error(*ex.args)
else:
self.log_error('Invalid request: %s', str(ex) or ex.__class__.__name__)
return ('400', _BAD_REQUEST_RESPONSE)
def _headers(self):
key = None
value = None
IGNORED_KEYS = (None, 'CONTENT_TYPE', 'CONTENT_LENGTH')
for header in self.headers.headers:
if key is not None and header[:1] in " \t":
value += header
continue
if key not in IGNORED_KEYS:
yield 'HTTP_' + key, value.strip()
key, value = header.split(':', 1)
if '_' in key:
# strip incoming bad veaders
key = None
else:
key = key.replace('-', '_').upper()
if key not in IGNORED_KEYS:
yield 'HTTP_' + key, value.strip()
def get_environ(self):
"""
Construct and return a new WSGI environment dictionary for a specific request.
This should begin with asking the server for the base environment
using :meth:`WSGIServer.get_environ`, and then proceed to add the
request specific values.
By the time this method is invoked the request line and request shall have
been parsed and ``self.headers`` shall be populated.
"""
env = self.server.get_environ()
env['REQUEST_METHOD'] = self.command
env['SCRIPT_NAME'] = ''
if '?' in self.path:
path, query = self.path.split('?', 1)
else:
path, query = self.path, ''
# Note that self.path contains the original str object; if it contains
# encoded escapes, it will NOT match PATH_INFO.
env['PATH_INFO'] = unquote_latin1(path)
env['QUERY_STRING'] = query
if self.headers.typeheader is not None:
env['CONTENT_TYPE'] = self.headers.typeheader
length = self.headers.getheader('content-length')
if length:
env['CONTENT_LENGTH'] = length
env['SERVER_PROTOCOL'] = self.request_version
client_address = self.client_address
if isinstance(client_address, tuple):
env['REMOTE_ADDR'] = str(client_address[0])
env['REMOTE_PORT'] = str(client_address[1])
for key, value in self._headers():
if key in env:
if 'COOKIE' in key:
env[key] += '; ' + value
else:
env[key] += ',' + value
else:
env[key] = value
if env.get('HTTP_EXPECT') == '100-continue':
sock = self.socket
else:
sock = None
chunked = env.get('HTTP_TRANSFER_ENCODING', '').lower() == 'chunked'
self.wsgi_input = Input(self.rfile, self.content_length, socket=sock, chunked_input=chunked)
env['wsgi.input'] = self.wsgi_input
return env
class _NoopLog(object):
# Does nothing; implements just enough file-like methods
# to pass the WSGI validator
def write(self, *args, **kwargs):
# pylint:disable=unused-argument
return
def flush(self):
pass
def writelines(self, *args, **kwargs):
pass
class LoggingLogAdapter(object):
"""
An adapter for :class:`logging.Logger` instances
to let them be used with :class:`WSGIServer`.
.. warning:: Unless the entire process is monkey-patched at a very
early part of the lifecycle (before logging is configured),
loggers are likely to not be gevent-cooperative. For example,
the socket and syslog handlers use the socket module in a way
that can block, and most handlers acquire threading locks.
.. warning:: It *may* be possible for the logging functions to be
called in the :class:`gevent.Hub` greenlet. Code running in the
hub greenlet cannot use any gevent blocking functions without triggering
a ``LoopExit``.
.. versionadded:: 1.1a3
.. versionchanged:: 1.1b6
Attributes not present on this object are proxied to the underlying
logger instance. This permits using custom :class:`~logging.Logger`
subclasses (or indeed, even duck-typed objects).
.. versionchanged:: 1.1
Strip trailing newline characters on the message passed to :meth:`write`
because log handlers will usually add one themselves.
"""
# gevent avoids importing and using logging because importing it and
# creating loggers creates native locks unless monkey-patched.
__slots__ = ('_logger', '_level')
def __init__(self, logger, level=20):
"""
Write information to the *logger* at the given *level* (default to INFO).
"""
self._logger = logger
self._level = level
def write(self, msg):
if msg and msg.endswith('\n'):
msg = msg[:-1]
self._logger.log(self._level, msg)
def flush(self):
"No-op; required to be a file-like object"
pass
def writelines(self, lines):
for line in lines:
self.write(line)
def __getattr__(self, name):
return getattr(self._logger, name)
def __setattr__(self, name, value):
if name not in LoggingLogAdapter.__slots__:
setattr(self._logger, name, value)
else:
object.__setattr__(self, name, value)
def __delattr__(self, name):
delattr(self._logger, name)
####
## Environ classes.
# These subclass dict. They could subclass collections.UserDict on
# 3.3+ and proxy to the underlying real dict to avoid a copy if we
# have to print them (on 2.7 it's slightly more complicated to be an
# instance of collections.MutableMapping; UserDict.UserDict isn't.)
# Then we could have either the WSGIHandler.get_environ or the
# WSGIServer.get_environ return one of these proxies, and
# WSGIHandler.run_application would know to access the `environ.data`
# attribute to be able to pass the *real* dict to the application
# (because PEP3333 requires no subclasses, only actual dict objects;
# wsgiref.validator and webob.Request both enforce this). This has the
# advantage of not being fragile if anybody else tries to print/log
# self.environ (and not requiring a copy). However, if there are any
# subclasses of Handler or Server, this could break if they don't know
# to return this type.
####
class Environ(dict):
"""
A base class that can be used for WSGI environment objects.
Provisional API.
.. versionadded:: 1.2a1
"""
__slots__ = () # add no ivars or weakref ability
def copy(self):
return self.__class__(self)
if not hasattr(dict, 'iteritems'):
# Python 3
def iteritems(self):
return self.items()
def __reduce_ex__(self, proto):
return (dict, (), None, None, iter(self.iteritems()))
class SecureEnviron(Environ):
"""
An environment that does not print its keys and values
by default.
Provisional API.
This is intended to keep potentially sensitive information like
HTTP authorization and cookies from being inadvertently printed
or logged.
For debugging, each instance can have its *secure_repr* attribute
set to ``False``, which will cause it to print like a normal dict.
When *secure_repr* is ``True`` (the default), then the value of
the *whitelist_keys* attribute is consulted; if this value is
true-ish, it should be a container (something that responds to
``in``) of key names (typically a list or set). Keys and values in
this dictionary that are in *whitelist_keys* will then be printed,
while all other values will be masked. These values may be
customized on the class by setting the *default_secure_repr* and
*default_whitelist_keys*, respectively::
>>> environ = SecureEnviron(key='value')
>>> environ # doctest: +ELLIPSIS
<pywsgi.SecureEnviron dict (keys: 1) at ...
If we whitelist the key, it gets printed::
>>> environ.whitelist_keys = {'key'}
>>> environ
{'key': 'value'}
A non-whitelisted key (*only*, to avoid doctest issues) is masked::
>>> environ['secure'] = 'secret'; del environ['key']
>>> environ
{'secure': '<MASKED>'}
We can turn it off entirely for the instance::
>>> environ.secure_repr = False
>>> environ
{'secure': 'secret'}
We can also customize it at the class level (here we use a new
class to be explicit and to avoid polluting the true default
values; we would set this class to be the ``environ_class`` of the
server)::
>>> class MyEnviron(SecureEnviron):
... default_whitelist_keys = ('key',)
...
>>> environ = MyEnviron({'key': 'value'})
>>> environ
{'key': 'value'}
.. versionadded:: 1.2a1
"""
default_secure_repr = True
default_whitelist_keys = ()
default_print_masked_keys = True
# Allow instances to override the class values,
# but inherit from the class if not present. Keeps instances
# small since we can't combine __slots__ with class attributes
# of the same name.
__slots__ = ('secure_repr', 'whitelist_keys', 'print_masked_keys')
def __getattr__(self, name):
if name in SecureEnviron.__slots__:
return getattr(type(self), 'default_' + name)
raise AttributeError(name)
def __repr__(self):
if self.secure_repr:
whitelist = self.whitelist_keys
print_masked = self.print_masked_keys
if whitelist:
safe = {k: self[k] if k in whitelist else "<MASKED>"
for k in self
if k in whitelist or print_masked}
safe_repr = repr(safe)
if not print_masked and len(safe) != len(self):
safe_repr = safe_repr[:-1] + ", (hidden keys: %d)}" % (len(self) - len(safe))
return safe_repr
return "<pywsgi.SecureEnviron dict (keys: %d) at %s>" % (len(self), id(self))
return Environ.__repr__(self)
__str__ = __repr__
class WSGISecureEnviron(SecureEnviron):
"""
Specializes the default list of whitelisted keys to a few
common WSGI variables.
Example::
>>> environ = WSGISecureEnviron(REMOTE_ADDR='::1', HTTP_AUTHORIZATION='secret')
>>> environ
{'REMOTE_ADDR': '::1', (hidden keys: 1)}
>>> import pprint
>>> pprint.pprint(environ)
{'REMOTE_ADDR': '::1', (hidden keys: 1)}
>>> print(pprint.pformat(environ))
{'REMOTE_ADDR': '::1', (hidden keys: 1)}
"""
default_whitelist_keys = ('REMOTE_ADDR', 'REMOTE_PORT', 'HTTP_HOST')
default_print_masked_keys = False
class WSGIServer(StreamServer):
"""
A WSGI server based on :class:`StreamServer` that supports HTTPS.
:keyword log: If given, an object with a ``write`` method to which
request (access) logs will be written. If not given, defaults
to :obj:`sys.stderr`. You may pass ``None`` to disable request
logging. You may use a wrapper, around e.g., :mod:`logging`,
to support objects that don't implement a ``write`` method.
(If you pass a :class:`~logging.Logger` instance, or in
general something that provides a ``log`` method but not a
``write`` method, such a wrapper will automatically be created
and it will be logged to at the :data:`~logging.INFO` level.)
:keyword error_log: If given, a file-like object with ``write``,
``writelines`` and ``flush`` methods to which error logs will
be written. If not given, defaults to :obj:`sys.stderr`. You
may pass ``None`` to disable error logging (not recommended).
You may use a wrapper, around e.g., :mod:`logging`, to support
objects that don't implement the proper methods. This
parameter will become the value for ``wsgi.errors`` in the
WSGI environment (if not already set). (As with *log*,
wrappers for :class:`~logging.Logger` instances and the like
will be created automatically and logged to at the :data:`~logging.ERROR`
level.)
.. seealso::
:class:`LoggingLogAdapter`
See important warnings before attempting to use :mod:`logging`.
.. versionchanged:: 1.1a3
Added the ``error_log`` parameter, and set ``wsgi.errors`` in the WSGI
environment to this value.
.. versionchanged:: 1.1a3
Add support for passing :class:`logging.Logger` objects to the ``log`` and
``error_log`` arguments.
"""
#: A callable taking three arguments: (socket, address, server) and returning
#: an object with a ``handle()`` method. The callable is called once for
#: each incoming socket request, as is its handle method. The handle method should not
#: return until all use of the socket is complete.
#:
#: This class uses the :class:`WSGIHandler` object as the default value. You may
#: subclass this class and set a different default value, or you may pass
#: a value to use in the ``handler_class`` keyword constructor argument.
handler_class = WSGIHandler
#: The object to which request logs will be written.
#: It must never be None. Initialized from the ``log`` constructor
#: parameter.
log = None
#: The object to which error logs will be written.
#: It must never be None. Initialized from the ``error_log`` constructor
#: parameter.
error_log = None
#: The class of environ objects passed to the handlers.
#: Must be a dict subclass. For compliance with :pep:`3333`
#: and libraries like WebOb, this is simply :class:`dict`
#: but this can be customized in a subclass or per-instance
#: (probably to :class:`WSGISecureEnviron`).
#:
#: .. versionadded:: 1.2a1
environ_class = dict
# Undocumented internal detail: the class that WSGIHandler._log_error
# will cast to before passing to the loop.
secure_environ_class = WSGISecureEnviron
base_env = {'GATEWAY_INTERFACE': 'CGI/1.1',
'SERVER_SOFTWARE': 'gevent/%d.%d Python/%d.%d' % (gevent.version_info[:2] + sys.version_info[:2]),
'SCRIPT_NAME': '',
'wsgi.version': (1, 0),
'wsgi.multithread': False, # XXX: Aren't we really, though?
'wsgi.multiprocess': False,
'wsgi.run_once': False}
def __init__(self, listener, application=None, backlog=None, spawn='default',
log='default', error_log='default',
handler_class=None,
environ=None, **ssl_args):
StreamServer.__init__(self, listener, backlog=backlog, spawn=spawn, **ssl_args)
if application is not None:
self.application = application
if handler_class is not None:
self.handler_class = handler_class
# Note that we can't initialize these as class variables:
# sys.stderr might get monkey patched at runtime.
def _make_log(l, level=20):
if l == 'default':
return sys.stderr
if l is None:
return _NoopLog()
if not hasattr(l, 'write') and hasattr(l, 'log'):
return LoggingLogAdapter(l, level)
return l
self.log = _make_log(log)
self.error_log = _make_log(error_log, 40) # logging.ERROR
self.set_environ(environ)
self.set_max_accept()
def set_environ(self, environ=None):
if environ is not None:
self.environ = environ
environ_update = getattr(self, 'environ', None)
self.environ = self.environ_class(self.base_env)
if self.ssl_enabled:
self.environ['wsgi.url_scheme'] = 'https'
else:
self.environ['wsgi.url_scheme'] = 'http'
if environ_update is not None:
self.environ.update(environ_update)
if self.environ.get('wsgi.errors') is None:
self.environ['wsgi.errors'] = self.error_log
def set_max_accept(self):
if self.environ.get('wsgi.multiprocess'):
self.max_accept = 1
def get_environ(self):
return self.environ_class(self.environ)
def init_socket(self):
StreamServer.init_socket(self)
self.update_environ()
def update_environ(self):
"""
Called before the first request is handled to fill in WSGI environment values.
This includes getting the correct server name and port.
"""
address = self.address
if isinstance(address, tuple):
if 'SERVER_NAME' not in self.environ:
try:
name = socket.getfqdn(address[0])
except socket.error:
name = str(address[0])
if PY3 and not isinstance(name, str):
name = name.decode('ascii') # python 2 pylint:disable=redefined-variable-type
self.environ['SERVER_NAME'] = name
self.environ.setdefault('SERVER_PORT', str(address[1]))
else:
self.environ.setdefault('SERVER_NAME', '')
self.environ.setdefault('SERVER_PORT', '')
def handle(self, sock, address):
"""
Create an instance of :attr:`handler_class` to handle the request.
This method blocks until the handler returns.
"""
# pylint:disable=method-hidden
handler = self.handler_class(sock, address, self)
handler.handle()
def _main():
# Provisional main handler, for quick tests, not production
# usage.
from gevent import monkey; monkey.patch_all()
import argparse
import importlib
parser = argparse.ArgumentParser()
parser.add_argument("app", help="dotted name of WSGI app callable [module:callable]")
parser.add_argument("-b", "--bind",
help="The socket to bind",
default=":8080")
args = parser.parse_args()
module_name, app_name = args.app.split(':')
module = importlib.import_module(module_name)
app = getattr(module, app_name)
bind = args.bind
server = WSGIServer(bind, app)
server.serve_forever()
if __name__ == '__main__':
_main()
| [
"[email protected]"
] | |
c4da8d29e29b93170f1cbb3d3c8c60f367f50b30 | facb8b9155a569b09ba66aefc22564a5bf9cd319 | /wp2/merra_scripts/03_model_fitting/merra882/877-tideGauge.py | 348659e25243c0c7f3f7fa0be098997bc9e4bf98 | [] | no_license | moinabyssinia/modeling-global-storm-surges | 13e69faa8f45a1244a964c5de4e2a5a6c95b2128 | 6e385b2a5f0867df8ceabd155e17ba876779c1bd | refs/heads/master | 2023-06-09T00:40:39.319465 | 2021-06-25T21:00:44 | 2021-06-25T21:00:44 | 229,080,191 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 7,041 | py | # -*- coding: utf-8 -*-
"""
Created on Mon May 4 15:51:30 2020
This program is designed to validate a multiple
linear regression model by using the KFOLD method
@author: Michael Tadesse
"""
import os
import numpy as np
import pandas as pd
from sklearn import metrics
from scipy import stats
from datetime import datetime
from sklearn.linear_model import LinearRegression
from sklearn.decomposition import PCA
from sklearn.model_selection import KFold
from sklearn.preprocessing import StandardScaler
def validate():
"""
run KFOLD method for regression
"""
#defining directories
dir_in = "/lustre/fs0/home/mtadesse/merraAllLagged"
dir_out = "/lustre/fs0/home/mtadesse/merraLRValidation"
surge_path = "/lustre/fs0/home/mtadesse/05_dmax_surge_georef"
#cd to the lagged predictors directory
os.chdir(dir_in)
x = 877
y = 878
#empty dataframe for model validation
df = pd.DataFrame(columns = ['tg', 'lon', 'lat', 'num_year', \
'num_95pcs','corrn', 'rmse'])
#looping through
for tg in range(x,y):
os.chdir(dir_in)
tg_name = os.listdir()[tg]
print(tg, tg_name)
##########################################
#check if this tg is already taken care of
##########################################
os.chdir(dir_out)
if os.path.isfile(tg_name):
return "file already analyzed!"
os.chdir(dir_in)
#load predictor
pred = pd.read_csv(tg_name)
pred.drop('Unnamed: 0', axis = 1, inplace = True)
#add squared and cubed wind terms (as in WPI model)
pickTerms = lambda x: x.startswith('wnd')
wndTerms = pred.columns[list(map(pickTerms, pred.columns))]
wnd_sqr = pred[wndTerms]**2
wnd_cbd = pred[wndTerms]**3
pred = pd.concat([pred, wnd_sqr, wnd_cbd], axis = 1)
#standardize predictor data
dat = pred.iloc[:,1:]
scaler = StandardScaler()
print(scaler.fit(dat))
dat_standardized = pd.DataFrame(scaler.transform(dat), \
columns = dat.columns)
pred_standardized = pd.concat([pred['date'], dat_standardized], axis = 1)
#load surge data
os.chdir(surge_path)
surge = pd.read_csv(tg_name)
surge.drop('Unnamed: 0', axis = 1, inplace = True)
#remove duplicated surge rows
surge.drop(surge[surge['ymd'].duplicated()].index, axis = 0, inplace = True)
surge.reset_index(inplace = True)
surge.drop('index', axis = 1, inplace = True)
#adjust surge time format to match that of pred
time_str = lambda x: str(datetime.strptime(x, '%Y-%m-%d'))
surge_time = pd.DataFrame(list(map(time_str, surge['ymd'])), columns = ['date'])
time_stamp = lambda x: (datetime.strptime(x, '%Y-%m-%d %H:%M:%S'))
surge_new = pd.concat([surge_time, surge[['surge', 'lon', 'lat']]], axis = 1)
#merge predictors and surge to find common time frame
pred_surge = pd.merge(pred_standardized, surge_new.iloc[:,:2], on='date', how='right')
pred_surge.sort_values(by = 'date', inplace = True)
#find rows that have nans and remove them
row_nan = pred_surge[pred_surge.isna().any(axis =1)]
pred_surge.drop(row_nan.index, axis = 0, inplace = True)
pred_surge.reset_index(inplace = True)
pred_surge.drop('index', axis = 1, inplace = True)
#in case pred and surge don't overlap
if pred_surge.shape[0] == 0:
print('-'*80)
print('Predictors and Surge don''t overlap')
print('-'*80)
continue
pred_surge['date'] = pd.DataFrame(list(map(time_stamp, \
pred_surge['date'])), \
columns = ['date'])
#prepare data for training/testing
X = pred_surge.iloc[:,1:-1]
y = pd.DataFrame(pred_surge['surge'])
y = y.reset_index()
y.drop(['index'], axis = 1, inplace = True)
#apply PCA
pca = PCA(.95)
pca.fit(X)
X_pca = pca.transform(X)
#apply 10 fold cross validation
kf = KFold(n_splits=10, random_state=29)
metric_corr = []; metric_rmse = []; #combo = pd.DataFrame(columns = ['pred', 'obs'])
for train_index, test_index in kf.split(X):
X_train, X_test = X_pca[train_index], X_pca[test_index]
y_train, y_test = y['surge'][train_index], y['surge'][test_index]
#train regression model
lm = LinearRegression()
lm.fit(X_train, y_train)
#predictions
predictions = lm.predict(X_test)
# pred_obs = pd.concat([pd.DataFrame(np.array(predictions)), \
# pd.DataFrame(np.array(y_test))], \
# axis = 1)
# pred_obs.columns = ['pred', 'obs']
# combo = pd.concat([combo, pred_obs], axis = 0)
#evaluation matrix - check p value
if stats.pearsonr(y_test, predictions)[1] >= 0.05:
print("insignificant correlation!")
continue
else:
print(stats.pearsonr(y_test, predictions))
metric_corr.append(stats.pearsonr(y_test, predictions)[0])
print(np.sqrt(metrics.mean_squared_error(y_test, predictions)))
metric_rmse.append(np.sqrt(metrics.mean_squared_error(y_test, predictions)))
#number of years used to train/test model
num_years = (pred_surge['date'][pred_surge.shape[0]-1] -\
pred_surge['date'][0]).days/365
longitude = surge['lon'][0]
latitude = surge['lat'][0]
num_pc = X_pca.shape[1] #number of principal components
corr = np.mean(metric_corr)
rmse = np.mean(metric_rmse)
print('num_year = ', num_years, ' num_pc = ', num_pc ,'avg_corr = ',np.mean(metric_corr), ' - avg_rmse (m) = ', \
np.mean(metric_rmse), '\n')
#original size and pca size of matrix added
new_df = pd.DataFrame([tg_name, longitude, latitude, num_years, num_pc, corr, rmse]).T
new_df.columns = ['tg', 'lon', 'lat', 'num_year', \
'num_95pcs','corrn', 'rmse']
df = pd.concat([df, new_df], axis = 0)
#save df as cs - in case of interruption
os.chdir(dir_out)
df.to_csv(tg_name)
#cd to dir_in
os.chdir(dir_in)
#run script
validate()
| [
"[email protected]"
] | |
486c5c4863977b8e538c9d79f11f23a270e47d2a | b478d1e63cce432b6fd3692c0aa7a84f411ae9dc | /net_prog/ch1/test3.py | c94c114170bd57be0c4c29c64f58045d0441b891 | [] | no_license | yiqing95/py_study | 8d414aa00b4ac31070fe5667a98815980eee46d0 | 6ce6b46ad729a795bc9253d6339169e62ef47766 | refs/heads/master | 2016-09-06T17:45:26.081269 | 2015-01-12T15:22:29 | 2015-01-12T15:22:29 | 20,810,777 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 301 | py | __author__ = 'yiqing'
import socket
def get_remote_machine_info():
remote_host = 'www.python.com'
try:
print("IP address : %s " % socket.gethostbyname(remote_host))
except socket.error as err:
print("%s " % err)
if __name__ == '__main__':
get_remote_machine_info() | [
"[email protected]"
] | |
e0747aef526c8d78bb3770f3ba3343fd6496a2ce | d52413173437ba73ecdf822ca895e659f00a8ce7 | /kiwibackend/application/website/mobile/views/gmapi/instance.py | af1bb96d97b926f195022a516f2f0c28cf6178d2 | [] | no_license | whiteprism/mywork | 2329b3459c967c079d6185c5acabd6df80cab8ea | a8e568e89744ca7acbc59e4744aff2a0756d7252 | refs/heads/master | 2021-01-21T11:15:49.090408 | 2017-03-31T03:28:13 | 2017-03-31T03:28:13 | 83,540,646 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,423 | py | # -*- coding: utf-8 -*-
from decorators import *
from api import *
from opensocial.http import HttpResponseJson
from module.common.static import ErrorCode
from django.conf import settings
@handle_verification
def query_player_raceinstance(request):
'''
查询用户活动副本
'''
playerId = request.REQUEST.get("playerId", "").strip()
serverId = request.REQUEST.get("serverId", str(settings.SERVERID)).strip()
player = get_player_by_id_or_str(playerId, int(serverId))
resdata = {}
if not player:
resdata["success"] = False
resdata["message"] = u"该玩家不存在!"
resdata["data"] = []
return HttpResponseJson(resdata)
instances = player.raidinstances.all().values()
data = []
for instance in instances:
meta = instance.to_dict()
data.append(meta)
resdata["success"] = True
resdata["message"] = ""
resdata["data"] = data
return HttpResponseJson(resdata)
# if not player:
# data = {"success": False,
# "message": "The user does not exist!",
# "errorcode": ErrorCode.ERROR_PLAYER_IS_NONE
# }
# return HttpResponseJson(data)
# instances = player.raidinstances.all().values()
# data = []
# for instance in instances:
# meta = instance.to_dict()
# data.append(meta)
# return HttpResponseJson(data)
@handle_verification
def query_player_elementtower(request):
'''
查询用户元素之塔
'''
playerId = request.REQUEST.get("playerId", "").strip()
serverId = request.REQUEST.get("serverId", str(settings.SERVERID)).strip()
player = get_player_by_id_or_str(playerId, int(serverId))
resdata = {}
if not player:
resdata["success"] = False
resdata["message"] = u"该玩家不存在!"
resdata["data"] = {}
return HttpResponseJson(resdata)
data = player.elementTower.to_dict()
resdata["success"] = True
resdata["message"] = ""
resdata["data"] = data
return HttpResponseJson(resdata)
# if not player:
# data = {"success": False,
# "message": "The user does not exist!",
# "errorcode": ErrorCode.ERROR_PLAYER_IS_NONE
# }
# return HttpResponseJson(data)
# return HttpResponseJson(player.elementTower.to_dict())
| [
"[email protected]"
] | |
ac3a26558056f3fc9a3935f967d3e2c606441a03 | 3d61fe0f49f5d344fc32a6faa799f0a46deec9a5 | /2020/AoC-2020-8.py | 706a0af5c3c9f154ced7975039174fb55ed93ec7 | [] | no_license | sbeaumont/AoC | 558296fd26cd5272e33d3cb9113c09e4945c98ac | 406eda614d8434d8feb71fe1262f1fda54972a12 | refs/heads/master | 2022-12-13T07:38:36.089775 | 2022-12-04T21:11:49 | 2022-12-04T21:11:49 | 75,467,985 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,433 | py | #!/usr/bin/env python3
"""Solution for Advent of Code challenge 2020 - Day 8"""
__author__ = "Serge Beaumont"
__date__ = "December 2020"
from copy import deepcopy
with open(f"AoC-2020-8-input.txt") as infile:
program_file = [line.strip().split() for line in infile.readlines()]
for line in program_file:
line[1] = int(line[1])
def run_program(program):
visited = list()
pointer = 0
accumulator = 0
while pointer not in visited:
visited.append(pointer)
instruction = program[pointer]
if instruction[0] == 'acc':
accumulator += instruction[1]
pointer += 1
elif instruction[0] == 'nop':
pointer += 1
elif instruction[0] == 'jmp':
pointer += instruction[1]
else:
assert False, f"Instruction {instruction} not known"
if pointer >= len(program):
return "normal", accumulator
return 'looped', accumulator
if __name__ == '__main__':
print("Part 1:", run_program(program_file)[1])
for i in range(len(program_file)):
operator = program_file[i][0]
if operator in ['jmp', 'nop']:
proggy = deepcopy(program_file)
proggy[i][0] = 'nop' if operator == 'jmp' else 'jmp'
result, accumulator = run_program(proggy)
if result == 'normal':
print("Part 2:", accumulator)
break
| [
"[email protected]"
] | |
515efa1f6a90f9f2e0e52cc7abd3fddc39d81afb | 8c1aa957a41954daac70b13f1be06df0c4046bb2 | /wagtailwebsitebuilder/home/migrations/0017_auto_20200422_0845.py | 6ca88cea553b2a0fffa682871e8b1086cfdd800a | [] | no_license | hanztura/wagtailwebsitebuilder | 6c1a2358d53877e4f70d70e5c7c6b472fabec974 | f56d1b799f9eda53b5596ed882b60df154581cc5 | refs/heads/master | 2021-05-21T08:30:16.170885 | 2020-08-29T22:35:59 | 2020-08-29T22:35:59 | 252,619,323 | 1 | 0 | null | 2021-04-16T20:26:46 | 2020-04-03T03:01:27 | Python | UTF-8 | Python | false | false | 1,152 | py | # Generated by Django 2.2.12 on 2020-04-22 08:45
from django.db import migrations
import puputextension.helpers
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.images.blocks
class Migration(migrations.Migration):
dependencies = [
('home', '0016_auto_20200412_1525'),
]
operations = [
migrations.AlterField(
model_name='homepage',
name='body',
field=wagtail.core.fields.StreamField([('with_id', wagtail.core.blocks.StructBlock([('id', wagtail.core.blocks.CharBlock()), ('paragraph', wagtail.core.blocks.RichTextBlock())], template='home/blocks/with_id.html')), ('paragraph', wagtail.core.blocks.RichTextBlock()), ('code', wagtail.core.blocks.StructBlock([('language', wagtail.core.blocks.ChoiceBlock(blank=False, choices=[('python3', 'Python 3'), ('bash', 'Bash/Shell'), ('javascript', 'Javascript'), ('css', 'CSS'), ('html', 'HTML')], null=False)), ('caption', wagtail.core.blocks.CharBlock(blank=True, nullable=True, required=False)), ('code', puputextension.helpers.CodeTextBlock())])), ('image', wagtail.images.blocks.ImageChooserBlock())]),
),
]
| [
"[email protected]"
] | |
25c71476cf84f80af692fc6fbeb2506beb383991 | 8697dbe95cfbdc4c0df211c8f809bcaaf473a36f | /pendulum/__version__.pyi | bc75e0e25899f0df91b9d34c814d5a441699f106 | [
"MIT"
] | permissive | Michael0x2a/pendulum-stubs | 9ef1b03c76ea7aa6eff56c890dab65801672a299 | 5a1189f2d39e1a1974cf0acf686db4b7f01bf8db | refs/heads/master | 2020-04-19T02:29:28.303289 | 2019-02-10T17:23:30 | 2019-02-10T17:23:30 | 167,904,665 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 148 | pyi | # Stubs for pendulum.__version__ (Python 3.7)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
__version__: str = ...
| [
"[email protected]"
] | |
035e3ff6b199e3d228fa8e688242053edc7dff29 | 1a758ef862f733d98ddd8ebc8ade5cefd95c24f2 | /customers/migrations/0027_auto_20170508_2340.py | 9962ba06eee066980375d3484ef93bfaf2f713d6 | [] | no_license | ajajul/ReactJS_Python | f116b35394666c5b3f2419eb5d8d7aeb077d4a24 | 08310d56fa88f326ddbfdd4b189f2a3a71f76d99 | refs/heads/master | 2020-03-19T03:16:57.510672 | 2018-06-01T10:36:36 | 2018-06-01T10:36:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 581 | py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('customers', '0026_auto_20170428_1403'),
]
operations = [
migrations.AlterField(
model_name='coffeereview',
name='order',
field=models.ForeignKey(related_name='reviews', to='customers.Order'),
),
migrations.AlterUniqueTogether(
name='coffeereview',
unique_together=set([('order', 'coffee')]),
),
]
| [
"[email protected]"
] | |
b676d38523f8e46480dd315d996f0d67698a85e9 | 6219e6536774e8eeb4cadc4a84f6f2bea376c1b0 | /scraper/storage_spiders/xbookcomvn.py | 3195cfea973ea8288043a4a74beb690127d93d2e | [
"MIT"
] | permissive | nguyenminhthai/choinho | 109d354b410b92784a9737f020894d073bea1534 | d2a216fe7a5064d73cdee3e928a7beef7f511fd1 | refs/heads/master | 2023-05-07T16:51:46.667755 | 2019-10-22T07:53:41 | 2019-10-22T07:53:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,072 | py | # Auto generated by generator.py. Delete this line if you make modification.
from scrapy.spiders import Rule
from scrapy.linkextractors import LinkExtractor
XPATH = {
'name' : "//div/font[@class='CTieuDeNhoNho']",
'price' : "//table//tr/td[2]/font/div/font/b",
'category' : "//div[@id='content']/table[1]/tbody/tr/td[1]/table/tbody/tr[1]/td[@class='CTieuDeNho']",
'description' : "//div[@id='content']/table[1]/tbody/tr/td[1]/table/tbody/tr[2]/td/table/tbody/tr[2]/td/p",
'images' : "//div[@id='content']/table//tr/td/table//tr[2]/td/table/tbody/tr[1]/td/table//tr/td[1]/table//tr[1]/td/a/img/@src",
'canonical' : "",
'base_url' : "",
'brand' : ""
}
name = 'xbook.com.vn'
allowed_domains = ['xbook.com.vn']
start_urls = ['http://www.xbook.com.vn']
tracking_url = ''
sitemap_urls = ['']
sitemap_rules = [('', 'parse_item')]
sitemap_follow = []
rules = [
Rule(LinkExtractor(allow=['CatId=', 'NewsId=']), 'parse_item'),
Rule(LinkExtractor(allow=['CategoryLoai=+\d+$']), 'parse'),
#Rule(LinkExtractor(), 'parse_item_and_links'),
]
| [
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.