hexsha
stringlengths
40
40
size
int64
5
2.06M
ext
stringclasses
11 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
3
251
max_stars_repo_name
stringlengths
4
130
max_stars_repo_head_hexsha
stringlengths
40
78
max_stars_repo_licenses
listlengths
1
10
max_stars_count
int64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
3
251
max_issues_repo_name
stringlengths
4
130
max_issues_repo_head_hexsha
stringlengths
40
78
max_issues_repo_licenses
listlengths
1
10
max_issues_count
int64
1
116k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
3
251
max_forks_repo_name
stringlengths
4
130
max_forks_repo_head_hexsha
stringlengths
40
78
max_forks_repo_licenses
listlengths
1
10
max_forks_count
int64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
1
1.05M
avg_line_length
float64
1
1.02M
max_line_length
int64
3
1.04M
alphanum_fraction
float64
0
1
6fcc2a2fdacd2a22f891e4c2ee4f20a75d5a6130
1,398
py
Python
sa/profiles/Cisco/SCOS/profile.py
prorevizor/noc
37e44b8afc64318b10699c06a1138eee9e7d6a4e
[ "BSD-3-Clause" ]
84
2017-10-22T11:01:39.000Z
2022-02-27T03:43:48.000Z
sa/profiles/Cisco/SCOS/profile.py
prorevizor/noc
37e44b8afc64318b10699c06a1138eee9e7d6a4e
[ "BSD-3-Clause" ]
22
2017-12-11T07:21:56.000Z
2021-09-23T02:53:50.000Z
sa/profiles/Cisco/SCOS/profile.py
prorevizor/noc
37e44b8afc64318b10699c06a1138eee9e7d6a4e
[ "BSD-3-Clause" ]
23
2017-12-06T06:59:52.000Z
2022-02-24T00:02:25.000Z
# --------------------------------------------------------------------- # Vendor: Cisco # OS: SCOS # --------------------------------------------------------------------- # Copyright (C) 2007-2012 The NOC Project # See LICENSE for details # --------------------------------------------------------------------- # NOC modules from noc.core.profile.base import BaseProfile
38.833333
89
0.537196
6fccd64c6d5968278f8f06dd0c3bc69ffe2d9072
4,825
py
Python
airflow/providers/amazon/aws/example_dags/example_hive_to_dynamodb.py
npodewitz/airflow
511ea702d5f732582d018dad79754b54d5e53f9d
[ "Apache-2.0" ]
8,092
2016-04-27T20:32:29.000Z
2019-01-05T07:39:33.000Z
airflow/providers/amazon/aws/example_dags/example_hive_to_dynamodb.py
npodewitz/airflow
511ea702d5f732582d018dad79754b54d5e53f9d
[ "Apache-2.0" ]
2,961
2016-05-05T07:16:16.000Z
2019-01-05T08:47:59.000Z
airflow/providers/amazon/aws/example_dags/example_hive_to_dynamodb.py
npodewitz/airflow
511ea702d5f732582d018dad79754b54d5e53f9d
[ "Apache-2.0" ]
3,546
2016-05-04T20:33:16.000Z
2019-01-05T05:14:26.000Z
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. """ This DAG will not work unless you create an Amazon EMR cluster running Apache Hive and copy data into it following steps 1-4 (inclusive) here: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/EMRforDynamoDB.Tutorial.html """ import os from datetime import datetime from airflow import DAG from airflow.decorators import task from airflow.models import Connection from airflow.providers.amazon.aws.hooks.dynamodb import DynamoDBHook from airflow.providers.amazon.aws.transfers.hive_to_dynamodb import HiveToDynamoDBOperator from airflow.utils import db DYNAMODB_TABLE_NAME = 'example_hive_to_dynamodb_table' HIVE_CONNECTION_ID = os.getenv('HIVE_CONNECTION_ID', 'hive_on_emr') HIVE_HOSTNAME = os.getenv('HIVE_HOSTNAME', 'ec2-123-45-67-890.compute-1.amazonaws.com') # These values assume you set up the Hive data source following the link above. DYNAMODB_TABLE_HASH_KEY = 'feature_id' HIVE_SQL = 'SELECT feature_id, feature_name, feature_class, state_alpha FROM hive_features' # Included for sample purposes only; in production you wouldn't delete # the table you just backed your data up to. Using 'all_done' so even # if an intermediate step fails, the DAG will clean up after itself. # Included for sample purposes only; in production this should # be configured in the environment and not be part of the DAG. # Note: The 'hiveserver2_default' connection will not work if Hive # is hosted on EMR. You must set the host name of the connection # to match your EMR cluster's hostname. with DAG( dag_id='example_hive_to_dynamodb', schedule_interval=None, start_date=datetime(2021, 1, 1), tags=['example'], catchup=False, ) as dag: # Add the prerequisites docstring to the DAG in the UI. dag.doc_md = __doc__ # [START howto_transfer_hive_to_dynamodb] backup_to_dynamodb = HiveToDynamoDBOperator( task_id='backup_to_dynamodb', hiveserver2_conn_id=HIVE_CONNECTION_ID, sql=HIVE_SQL, table_name=DYNAMODB_TABLE_NAME, table_keys=[DYNAMODB_TABLE_HASH_KEY], ) # [END howto_transfer_hive_to_dynamodb] ( configure_hive_connection() >> create_dynamodb_table() >> backup_to_dynamodb >> get_dynamodb_item_count() >> delete_dynamodb_table() )
36.278195
96
0.732228
6fcd19005d9f0c8dc04e8be2bcd4a496b3ee5923
74
py
Python
tle_download/__init__.py
cognitive-space/tle-download
86e9859eed1e87bf93f33471a665ad2567ebccca
[ "MIT" ]
null
null
null
tle_download/__init__.py
cognitive-space/tle-download
86e9859eed1e87bf93f33471a665ad2567ebccca
[ "MIT" ]
null
null
null
tle_download/__init__.py
cognitive-space/tle-download
86e9859eed1e87bf93f33471a665ad2567ebccca
[ "MIT" ]
null
null
null
__version__ = "0.1.0" from tle_download.main import get_tles, write_tles
18.5
50
0.783784
6fcf8180fcc5543d1eb052a5cecb72e8028c0a9e
4,125
py
Python
bmi203_hw3/methods.py
cjmathy/bmi203_hw3
7d785e12be048a2870b90d704f18d2391f210aec
[ "Apache-2.0" ]
null
null
null
bmi203_hw3/methods.py
cjmathy/bmi203_hw3
7d785e12be048a2870b90d704f18d2391f210aec
[ "Apache-2.0" ]
null
null
null
bmi203_hw3/methods.py
cjmathy/bmi203_hw3
7d785e12be048a2870b90d704f18d2391f210aec
[ "Apache-2.0" ]
null
null
null
import numpy as np import random
28.061224
270
0.667394
6fcfd483955455d5e0edc10b34fa44d33f3eefa6
4,346
py
Python
custom_components/netatmo/select.py
mauriziosacca/netatmo_custom
149a211d7cd6b87db012c5dabd12f34db302f066
[ "MIT" ]
5
2020-08-07T11:35:49.000Z
2020-09-19T03:27:47.000Z
custom_components/netatmo/select.py
mauriziosacca/netatmo_custom
149a211d7cd6b87db012c5dabd12f34db302f066
[ "MIT" ]
4
2020-06-14T06:11:05.000Z
2020-07-22T10:15:39.000Z
custom_components/netatmo/select.py
mauriziosacca/netatmo_custom
149a211d7cd6b87db012c5dabd12f34db302f066
[ "MIT" ]
2
2020-06-13T23:04:41.000Z
2020-07-05T14:13:49.000Z
"""Support for the Netatmo climate schedule selector.""" from __future__ import annotations import logging from homeassistant.components.select import SelectEntity from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant, callback from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helpers.entity_platform import AddEntitiesCallback from .const import ( CONF_URL_ENERGY, DATA_SCHEDULES, DOMAIN, EVENT_TYPE_SCHEDULE, MANUFACTURER, NETATMO_CREATE_SELECT, ) from .data_handler import HOME, SIGNAL_NAME, NetatmoHome from .netatmo_entity_base import NetatmoBase _LOGGER = logging.getLogger(__name__)
32.192593
87
0.631615
6fcfd615a77be7f31719c843dfcd485b0a7a9fe7
349
py
Python
Olympiad Solutions/URI/1943.py
Ashwanigupta9125/code-DS-ALGO
49f6cf7d0c682da669db23619aef3f80697b352b
[ "MIT" ]
36
2019-12-27T08:23:08.000Z
2022-01-24T20:35:47.000Z
Olympiad Solutions/URI/1943.py
Ashwanigupta9125/code-DS-ALGO
49f6cf7d0c682da669db23619aef3f80697b352b
[ "MIT" ]
10
2019-11-13T02:55:18.000Z
2021-10-13T23:28:09.000Z
Olympiad Solutions/URI/1943.py
Ashwanigupta9125/code-DS-ALGO
49f6cf7d0c682da669db23619aef3f80697b352b
[ "MIT" ]
53
2020-08-15T11:08:40.000Z
2021-10-09T15:51:38.000Z
# Ivan Carvalho # Solution to https://www.urionlinejudge.com.br/judge/problems/view/1943 #!/usr/bin/env python2.7 # encoding : utf-8 e = int(raw_input()) if e == 1: print "Top 1" elif e <= 3: print "Top 3" elif e <= 5: print "Top 5" elif e <= 10: print "Top 10" elif e <= 25: print "Top 25" elif e <= 50: print "Top 50" else: print "Top 100"
17.45
72
0.633238
6fd077e82e7625e41bd526705fa44002dd980b86
21,889
py
Python
skbot/ignition/sdformat/bindings/v15/physics.py
FirefoxMetzger/ropy
c1bcebda223f3af0b6d35e3f4c26d8fd9d26577a
[ "Apache-2.0" ]
6
2021-03-24T05:54:45.000Z
2021-07-20T21:03:21.000Z
skbot/ignition/sdformat/bindings/v15/physics.py
FirefoxMetzger/scikit-bot
ee6f1d3451a3c61a6fa122cc42efc4dd67afc9c9
[ "Apache-2.0" ]
31
2021-08-12T08:12:58.000Z
2022-03-21T23:16:36.000Z
skbot/ignition/sdformat/bindings/v15/physics.py
FirefoxMetzger/scikit-bot
ee6f1d3451a3c61a6fa122cc42efc4dd67afc9c9
[ "Apache-2.0" ]
1
2021-07-20T20:13:49.000Z
2021-07-20T20:13:49.000Z
from dataclasses import dataclass, field from typing import Optional __NAMESPACE__ = "sdformat/v1.5/physics.xsd"
35.707993
822
0.457673
6fd0b30bf860cf4cb13764228ffc837786f5279e
4,826
py
Python
lib/surface/help.py
bshaffer/google-cloud-sdk
f587382fd112f238c0d6d5ca3dab8f52d2b5c5f9
[ "Apache-2.0" ]
null
null
null
lib/surface/help.py
bshaffer/google-cloud-sdk
f587382fd112f238c0d6d5ca3dab8f52d2b5c5f9
[ "Apache-2.0" ]
null
null
null
lib/surface/help.py
bshaffer/google-cloud-sdk
f587382fd112f238c0d6d5ca3dab8f52d2b5c5f9
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- # # Copyright 2013 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. """A calliope command that prints help for another calliope command.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import argparse from googlecloudsdk.calliope import base from googlecloudsdk.command_lib.help_search import search from googlecloudsdk.command_lib.help_search import search_util from googlecloudsdk.core import log _DEFAULT_LIMIT = 5
33.513889
80
0.715292
6fd10f3af083decdb2efd072cc80a08a18e55c62
66
py
Python
algocoin/__init__.py
dendisuhubdy/algo-coin
e324f971cc0db5ebc29d04224d2fdeee13a31ac1
[ "Apache-2.0" ]
252
2017-09-01T21:36:08.000Z
2022-01-08T15:48:31.000Z
algocoin/__init__.py
dendisuhubdy/algo-coin
e324f971cc0db5ebc29d04224d2fdeee13a31ac1
[ "Apache-2.0" ]
75
2017-10-10T01:01:19.000Z
2020-05-04T11:03:20.000Z
algocoin/__init__.py
dendisuhubdy/algo-coin
e324f971cc0db5ebc29d04224d2fdeee13a31ac1
[ "Apache-2.0" ]
61
2017-08-31T07:22:25.000Z
2022-01-08T15:48:38.000Z
from .main import main as run # noqa: F401 __version__ = '0.0.3'
22
43
0.681818
6fd18ba88e62fdb096046d7f14533a962dedc716
283
py
Python
mmrazor/models/architectures/components/backbones/__init__.py
HIT-cwh/mmrazor
2dad24044d7f1dad88f20221f8fc071dd40fdd4f
[ "Apache-2.0" ]
553
2021-12-23T11:43:35.000Z
2022-03-31T01:04:20.000Z
mmrazor/models/architectures/components/backbones/__init__.py
HIT-cwh/mmrazor
2dad24044d7f1dad88f20221f8fc071dd40fdd4f
[ "Apache-2.0" ]
113
2021-12-23T12:09:06.000Z
2022-03-30T10:13:42.000Z
mmrazor/models/architectures/components/backbones/__init__.py
HIT-cwh/mmrazor
2dad24044d7f1dad88f20221f8fc071dd40fdd4f
[ "Apache-2.0" ]
76
2021-12-23T11:48:39.000Z
2022-03-29T11:24:35.000Z
# Copyright (c) OpenMMLab. All rights reserved. from .darts_backbone import DartsBackbone from .searchable_mobilenet import SearchableMobileNet from .searchable_shufflenet_v2 import SearchableShuffleNetV2 __all__ = ['DartsBackbone', 'SearchableShuffleNetV2', 'SearchableMobileNet']
40.428571
76
0.844523
6fd19f63f1a65c7260c9a3e5a8928272b7a43f33
2,013
py
Python
tools/ideabuck/scripts/generate_grammar_kit.py
thelvis4/buck
dd55ad3373c1dc01d83bc3780dfc205a923c8088
[ "Apache-2.0" ]
1
2021-06-14T22:35:29.000Z
2021-06-14T22:35:29.000Z
tools/ideabuck/scripts/generate_grammar_kit.py
thelvis4/buck
dd55ad3373c1dc01d83bc3780dfc205a923c8088
[ "Apache-2.0" ]
null
null
null
tools/ideabuck/scripts/generate_grammar_kit.py
thelvis4/buck
dd55ad3373c1dc01d83bc3780dfc205a923c8088
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python # Copyright 2018-present Facebook, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from __future__ import absolute_import, division, print_function, unicode_literals import os import shutil import subprocess # The location of the generate grammar kit script DIR = os.path.dirname(__file__) # The location of the plugin directory PLUGIN_PATH = os.path.abspath(os.path.join(DIR, "..")) # The location of the grammar-kit directory GRAMMAR_KIT = os.path.abspath( os.path.join(DIR, "../../../third-party/java/grammar-kit/") ) OUT_DIR = os.path.join(PLUGIN_PATH, "gen") FLEX_OUT_DIR = os.path.join(OUT_DIR, "com/facebook/buck/intellij/ideabuck/lang") GRAMMAR_KIT_JAR = os.path.join(GRAMMAR_KIT, "grammar-kit.jar") GRAMMAR_KIT_JFLEX_JAR = os.path.join(GRAMMAR_KIT, "JFlex.jar") JFLEX_SKELETON = os.path.join(PLUGIN_PATH, "resources/idea-flex.skeleton") FLEX_FILE = os.path.join( PLUGIN_PATH, "src/com/facebook/buck/intellij/ideabuck/lang/Buck.flex" ) BNF_FILE = os.path.join( PLUGIN_PATH, "src/com/facebook/buck/intellij/ideabuck/lang/Buck.bnf" ) shutil.rmtree(OUT_DIR, ignore_errors=True) subprocess_call(["java", "-jar", GRAMMAR_KIT_JAR, OUT_DIR, BNF_FILE]) subprocess_call( [ "java", "-jar", GRAMMAR_KIT_JFLEX_JAR, "-sliceandcharat", "-skel", JFLEX_SKELETON, "-d", FLEX_OUT_DIR, FLEX_FILE, ] )
29.602941
82
0.718331
6fd2040d5d7a06ef6b0a4c0bd8f53d00185458f8
5,639
py
Python
d_parser/d_spider_24int.py
Holovin/D_GrabDemo
6adb03fb42ae03e7896eb2eacb342cf9660feb92
[ "MIT" ]
null
null
null
d_parser/d_spider_24int.py
Holovin/D_GrabDemo
6adb03fb42ae03e7896eb2eacb342cf9660feb92
[ "MIT" ]
2
2018-03-28T19:47:46.000Z
2021-12-13T20:56:31.000Z
d_parser/d_spider_24int.py
Holovin/D_GrabDemo
6adb03fb42ae03e7896eb2eacb342cf9660feb92
[ "MIT" ]
null
null
null
from lxml import html from d_parser.d_spider_common import DSpiderCommon from d_parser.helpers.re_set import Ree from helpers.url_generator import UrlGenerator from d_parser.helpers.stat_counter import StatCounter as SC VERSION = 29 # Warn: Don't remove task argument even if not use it (it's break grab and spider crashed) # Warn: noinspection PyUnusedLocal
36.380645
144
0.563575
6fd40b146434a9e17e7620f9be3907c90f0f31db
2,007
py
Python
agents/displays/mcts_display.py
johink/willsmith
a6bdfff2e3b12770100811002867bf3ed64ad6d3
[ "MIT" ]
null
null
null
agents/displays/mcts_display.py
johink/willsmith
a6bdfff2e3b12770100811002867bf3ed64ad6d3
[ "MIT" ]
null
null
null
agents/displays/mcts_display.py
johink/willsmith
a6bdfff2e3b12770100811002867bf3ed64ad6d3
[ "MIT" ]
null
null
null
from tkinter import Label, GROOVE from willsmith.gui_display_controller import GUIDisplayController
33.45
93
0.652217
6fd4802c9f5de417a2846d954a84224c9c4296eb
9,461
py
Python
mrgcn.py
bretthannigan/relational-gcn
61219cdee2c244682680ac0d7371758dcb9cea96
[ "MIT" ]
null
null
null
mrgcn.py
bretthannigan/relational-gcn
61219cdee2c244682680ac0d7371758dcb9cea96
[ "MIT" ]
null
null
null
mrgcn.py
bretthannigan/relational-gcn
61219cdee2c244682680ac0d7371758dcb9cea96
[ "MIT" ]
null
null
null
#!/usr/bin/python3 import logging import argparse from time import time import toml from data.io.knowledge_graph import KnowledgeGraph from data.io.tarball import Tarball from data.io.tsv import TSV from data.utils import is_readable, is_writable from embeddings import graph_structure from tasks.node_classification import build_dataset, build_model, evaluate_model from tasks.utils import mksplits, init_fold, mkfolds, sample_mask, set_seed, strip_graph if __name__ == "__main__": timestamp = int(time()) parser = argparse.ArgumentParser() parser.add_argument("-c", "--config", help="Configuration file (toml)", required=True, default=None) parser.add_argument("-i", "--input", help="Optional prepared input file (tar)", default=None) parser.add_argument("-o", "--output", help="Output directory", default="/tmp/") parser.add_argument("-v", "--verbose", help="Increase output verbosity", action='count', default=0) args = parser.parse_args() # load configuration assert is_readable(args.config) config = toml.load(args.config) # set output base filename baseFilename = "{}{}{}".format(args.output, config['name'], timestamp) if args.output.endswith("/") \ else "{}/{}{}".format(args.output, config['name'], timestamp) assert is_writable(baseFilename) init_logger(baseFilename+'.log', args.verbose) logger = logging.getLogger(__name__) tsv_writer = TSV(baseFilename+'.tsv', 'w') # log parameters logger.debug("Arguments:\n{}".format( "\n".join(["\t{}: {}".format(arg, getattr(args, arg)) for arg in vars(args)]))) logger.debug("Configuration:\n{}".format( "\n".join(["\t{}: {}".format(k,v) for k,v in config.items()]))) # run training run(args, tsv_writer, config) logging.shutdown()
38.45935
105
0.51559
6fd6455ab81b55e483148e73eb93742490544d5f
9,343
py
Python
core.py
aminPial/Overwatch-Streaming-Automation
5d382e979980e99cebadd802eef999601833dc48
[ "MIT" ]
1
2020-03-21T04:32:14.000Z
2020-03-21T04:32:14.000Z
core.py
aminPial/Overwatch-Streaming-Automation
5d382e979980e99cebadd802eef999601833dc48
[ "MIT" ]
null
null
null
core.py
aminPial/Overwatch-Streaming-Automation
5d382e979980e99cebadd802eef999601833dc48
[ "MIT" ]
null
null
null
import argparse, time, os, cv2, shutil, datetime, math, subprocess, pickle, multiprocessing from actn import * ap = argparse.ArgumentParser() # for help -> python alpha.py --help ap.add_argument("-f", "--file", required=True, help="name of the file") ap.add_argument("-o", "--output", required=True, help="specifiy the folder path of output") ap.add_argument("-b", "--before", required=True, help="seconds to cut before", type=int) ap.add_argument("-a", "--after", required=True, help="seconds to cut after", type=int) args = vars(ap.parse_args()) if __name__ == "__main__": a = core_overwatch(file_name=str(args['file']), output_folder=str(args['output']), before=int(args['before']), after=int(args['after'])) a.build_folder() start_frame, n, common_diff = a.which_frame_formula() # returns a,n,d c = a.select_frame(start_frame, n, common_diff) # returns which_frame_list st = time.time() print("[+++++]Reading Frames....") a.read_save_frame() print("[+++++++]Finished Reading Frames") print("[+++++++]Image Processing Rolling....") d = a.get_action_process_multithreaded_cmd_run_commands() print("[++++++++]Finished Processing Images") f = a.action_index_find(raw_list=d, which_frame=c) # return list to start aft and bef(action first observed) g = a.build_frame_range_to_cut(f) a.send_frame_signal(frame_range=g) print('[++++++]Time req to run The Engine is {0}m'.format((time.time() - st) / 60)) print('Deleting temp folders..') shutil.rmtree('./raw_calc/frame_db_temp') os.remove('./tmp1') os.remove('./tmp2')
33.851449
146
0.558172
6fd71b1757e46f6f90fe0e76c1023674c1eb24fe
2,168
py
Python
reports/ipam-reports/ip-primary-missing.py
ryanmerolle/reports
9f69eb088884033c4cc85ce43c528e964b5a8b41
[ "MIT" ]
null
null
null
reports/ipam-reports/ip-primary-missing.py
ryanmerolle/reports
9f69eb088884033c4cc85ce43c528e964b5a8b41
[ "MIT" ]
3
2022-01-30T17:51:00.000Z
2022-01-30T17:52:16.000Z
reports/ipam-reports/ip-primary-missing.py
ryanmerolle/reports
9f69eb088884033c4cc85ce43c528e964b5a8b41
[ "MIT" ]
null
null
null
from dcim.choices import DeviceStatusChoices from dcim.models import Device from extras.reports import Report
41.692308
90
0.497694
6fd82d73cc91d48c575559a3f1137c753ea8bb0d
3,940
py
Python
runtime/bots/irc/main.py
AKhilRaghav0/dovenetwork
accf19fc4942d5e177d1f4d1302c40c9f979c391
[ "MIT" ]
null
null
null
runtime/bots/irc/main.py
AKhilRaghav0/dovenetwork
accf19fc4942d5e177d1f4d1302c40c9f979c391
[ "MIT" ]
null
null
null
runtime/bots/irc/main.py
AKhilRaghav0/dovenetwork
accf19fc4942d5e177d1f4d1302c40c9f979c391
[ "MIT" ]
null
null
null
import socket import random import os import requests import re import github import minecraft import string import sys HOST = "xeroxirc.net" PORT = 6667 NICK = "ak_sus" #PASSWORD = os.getenv("PASSWORD") CHANNEL = "#BlockySurvival" SERVER = "" readbuffer = "" s = socket.socket() s.connect((HOST, PORT)) send(bytes("NICK %s\r\n" % NICK, "UTF-8")) send(bytes("USER %s %s %s :%s\r\n" % (NICK, NICK, NICK, NICK), "UTF-8")) #s.send(bytes("PRIVMSG NickServ regain {} {}\r\n".format(NICK, PASSWORD), "UTF-8")) #s.send(bytes("PRIVMSG NickServ identify {} {}\r\n".format(NICK, PASSWORD), "UTF-8")) send(bytes("JOIN {}\r\n".format(CHANNEL), "UTF-8")) #s.send(bytes("PRIVMSG NickServ :identify {}\r\n".format(PASSWORD), "UTF-8")) readbuffer = readbuffer + s.recv(1024).decode("UTF-8") temp = str.split(readbuffer, "\n") readbuffer = temp.pop() for line in temp: SERVER = str.rstrip(line)[1:].split()[0] print(str.rstrip(line)) while 1: readbuffer = readbuffer + s.recv(1024).decode("UTF-8") temp = str.split(readbuffer, "\n") readbuffer = temp.pop() for line in temp: print(str.rstrip(line)) message = str.rstrip(line).split(" PRIVMSG {} :".format(CHANNEL)) if "PING" in line: send("PONG :{}\r\n".format(SERVER).encode("utf-8")) msg = message[-1] tokens = msg.split() if msg == "$hello": send("PRIVMSG {} :Hello!\r\n".format(CHANNEL).encode("utf-8")) if msg == "$ping": send("PRIVMSG {} :Pong!\r\n".format(CHANNEL).encode("utf-8")) if msg == "$random": send("PRIVMSG {} :{}\r\n".format(CHANNEL, random.randint(0, 100)).encode("utf-8")) if msg.startswith("$youtube "): html = requests.get("https://www.youtube.com/results?search_query=" + " ".join(msg.split()[1:])).content video_ids = re.findall(r"watch\?v=(\S{11})", html.decode()) send("PRIVMSG {} :https://www.youtube.com/watch?v={}\r\n".format(CHANNEL, video_ids[0]).encode("utf-8")) #if msg.startswith("$google "): send("PRIVMSG {} :{}\r\n".format(CHANNEL, googlesearch.search(" ".join(msg.split()[1:]))[0]).encode("utf-8")) #if msg.startswith("$wolfram "): send("PRIVMSG {} :{}\r\n".format(CHANNEL, wolfram.get(" ".join(msg.split()[1:]))).encode("utf-8")) if msg.startswith("$github "): if tokens[1] == "url": send("PRIVMSG {} :https://github.com/{}/{}\r\n".format(CHANNEL, tokens[2], tokens[3]).encode("utf-8")) if tokens[1] == "issues": send("PRIVMSG {} :#{}: {}\r\n".format(CHANNEL, tokens[4], github.get_issue_title(tokens[2], tokens[3], tokens[4])).encode("utf-8")) if msg == "$server": send("PRIVMSG {} :{}\r\n".format(CHANNEL, minecraft.get()).encode("utf-8")) if msg == "$help": send("PRIVMSG {} :Avalible commands: $hello, $ping, $youtube, $google, $github, $wolfram.\r\n".format(CHANNEL).encode("utf-8")) if msg.startswith("$help "): if tokens[1] == "hello": send("PRIVMSG {} :Syntax: $hello Action: Says \"Hello!\".\r\n".format(CHANNEL).encode("utf-8")) if tokens[1] == "ping":send("PRIVMSG {} :Syntax: $ping Action: Says \"Ping!\".\r\n".format(CHANNEL).encode("utf-8")) if tokens[1] == "youtube": send("PRIVMSG {} :Syntax: $youtube <keyword> Action: Sends the URL of a YouTube video matching the keyword given.\r\n".format(CHANNEL).encode("utf-8")) #if tokens[1] == "google": send("PRIVMSG {} :Syntax: $google <keyword> Action: Sends the URL of a google search with the keyword given\r\n".format(CHANNEL).encode("utf-8")) if tokens[1] == "github": send("PRIVMSG {} :Syntax: $github <topic> <user> <repo> <number> Action: Returns data about a github repo.\r\n".format(CHANNEL).encode("utf-8")) #if tokens[1] == "wolfram": send("PRIVMSG {} :Syntax: $wolfram <query> Action: Asks Wolfram|Alpha the query given.\r\n".format(CHANNEL).encode("utf-8"))
60.615385
190
0.612437
6fd8ba3787eb3badc7089b8d33f9dd05d0100188
3,456
py
Python
evaluate.py
PhilippMarquardt/Amazing-Semantic-Segmentation
9ca17b71a7bd9e4f4d433fe3bb50105bad564df4
[ "Apache-2.0" ]
null
null
null
evaluate.py
PhilippMarquardt/Amazing-Semantic-Segmentation
9ca17b71a7bd9e4f4d433fe3bb50105bad564df4
[ "Apache-2.0" ]
null
null
null
evaluate.py
PhilippMarquardt/Amazing-Semantic-Segmentation
9ca17b71a7bd9e4f4d433fe3bb50105bad564df4
[ "Apache-2.0" ]
null
null
null
""" The file defines the evaluate process on target dataset. @Author: Yang Lu @Github: https://github.com/luyanger1799 @Project: https://github.com/luyanger1799/amazing-semantic-segmentation """ from sklearn.metrics import multilabel_confusion_matrix from amazingutils.helpers import * from amazingutils.utils import load_image import numpy as np import argparse import sys import cv2 import os parser = argparse.ArgumentParser() parser.add_argument('--dataset', help='The path of the dataset.', type=str, default='CamVid') parser.add_argument('--crop_height', help='The height to crop the image.', type=int, default=256) parser.add_argument('--crop_width', help='The width to crop the image.', type=int, default=256) parser.add_argument('--predictions', help='The path of predicted image.', type=str, required=True) args = parser.parse_args() # check related paths paths = check_related_path(os.getcwd()) # get image and label file names for training and validation _, _, _, _, _, test_label_names = get_dataset_info(args.dataset) # get color info csv_file = os.path.join(args.dataset, 'class_dict.csv') class_names, _ = get_colored_info(csv_file) # get the prediction file name list if not os.path.exists(args.predictions): raise ValueError('the path of predictions does not exit.') prediction_names = [] for file in sorted(os.listdir(args.predictions)): prediction_names.append(os.path.join(args.predictions, file)) # evaluated classes evaluated_classes = get_evaluated_classes(os.path.join(args.dataset, 'evaluated_classes.txt')) num_classes = len(class_names) class_iou = dict() for name in evaluated_classes: class_iou[name] = list() class_idx = dict(zip(class_names, range(num_classes))) # begin evaluate assert len(test_label_names) == len(prediction_names) for i, (name1, name2) in enumerate(zip(test_label_names, prediction_names)): sys.stdout.write('\rRunning test image %d / %d' % (i + 1, len(test_label_names))) sys.stdout.flush() label = np.array(cv2.resize(load_image(name1), dsize=(args.crop_width, args.crop_height), interpolation=cv2.INTER_NEAREST)) pred = np.array(cv2.resize(load_image(name2), dsize=(args.crop_width, args.crop_height), interpolation=cv2.INTER_NEAREST)) confusion_matrix = multilabel_confusion_matrix(label.flatten(), pred.flatten(), labels=list(class_idx.values())) for eval_cls in evaluated_classes: eval_idx = class_idx[eval_cls] (tn, fp), (fn, tp) = confusion_matrix[eval_idx] if tp + fn > 0: class_iou[eval_cls].append(tp / (tp + fp + fn)) print('\n****************************************') print('* The IoU of each class is as follows: *') print('****************************************') for eval_cls in evaluated_classes: class_iou[eval_cls] = np.mean(class_iou[eval_cls]) print('{cls:}: {iou:.4f}'.format(cls=eval_cls, iou=class_iou[eval_cls])) print('\n**********************************************') print('* The Mean IoU of all classes is as follows: *') print('**********************************************') print('Mean IoU: {mean_iou:.4f}'.format(mean_iou=np.mean(list(class_iou.values()))))
36
116
0.672743
6fd965866bb7ccf36c6dbb4a056de13696d6bd75
6,524
py
Python
examples/pso_trail/demo_gpso.py
gmjustforfun/code
7551909edf61bddfeafdff223c2a3390661dc62f
[ "MIT" ]
null
null
null
examples/pso_trail/demo_gpso.py
gmjustforfun/code
7551909edf61bddfeafdff223c2a3390661dc62f
[ "MIT" ]
null
null
null
examples/pso_trail/demo_gpso.py
gmjustforfun/code
7551909edf61bddfeafdff223c2a3390661dc62f
[ "MIT" ]
null
null
null
from pso.GPSO import GPSO import numpy as np import time import pandas as pd np.random.seed(42) # f1 # f2 # f3 # f4 # f5 # f6 # f7 def Rosenbrock(p): ''' -2.048<=xi<=2.048 (1,...,1)0 :param p: :return: ''' n_dim = len(p) res = 0 for i in range(n_dim - 1): res += 100 * np.square(np.square(p[i]) - p[i + 1]) + np.square(p[i] - 1) return res # f8 ,APSOf8 # f9 def Rastrigin(p): ''' -5.12<=xi<=5.12 10n has a global minimum at x = 0 where f(x) = 0 ''' return np.sum([np.square(x) - 10 * np.cos(2 * np.pi * x) + 10 for x in p]) # f10 # f11 ok def Griewank(p): ''' (0,...,0)0 -600<=xi<=600 ''' part1 = [np.square(x) / 4000 for x in p] part2 = [np.cos(x / np.sqrt(i + 1)) for i, x in enumerate(p)] return np.sum(part1) - np.prod(part2) + 1 g = 10000 times = 30 table = np.zeros((2, 10)) gBest = np.zeros((10, 30)) # 101030 for i in range(times): optimizer = GPSO(func=Sphere, dim=30, pop=20, max_iter=g, lb=np.ones(30) * (-100), ub=np.ones(30) * 100, w=0.9, c1=2, c2=2, acceptance=0.01) start = time.time() optimizer.run() end = time.time() print('Sphere:', optimizer.gbest_y) table[0, 0] += optimizer.gbest_y table[1, 0] += end - start gBest[0, i] = optimizer.gbest_y optimizer = GPSO(func=Sch222, dim=30, pop=20, max_iter=g, lb=np.ones(30) * (-10), ub=np.ones(30) * 10, w=0.9, c1=2, c2=2, acceptance=0.01) start = time.time() optimizer.run() end = time.time() print('Sch222:', optimizer.gbest_y) table[0, 1] += optimizer.gbest_y table[1, 1] += end - start gBest[1, i] = optimizer.gbest_y optimizer = GPSO(func=Quadric, dim=30, pop=20, max_iter=g, lb=np.ones(30) * (-100), ub=np.ones(30) * 100, w=0.9, c1=2, c2=2, acceptance=100) start = time.time() optimizer.run() end = time.time() print('Quadric:', optimizer.gbest_y) table[0, 2] += optimizer.gbest_y table[1, 2] += end - start gBest[2, i] = optimizer.gbest_y optimizer = GPSO(func=Rosenbrock, dim=30, pop=20, max_iter=g, lb=np.ones(30) * (-10), ub=np.ones(30) * 10, w=0.9, c1=2, c2=2, acceptance=100) start = time.time() optimizer.run() end = time.time() print('Rosenbrock:', optimizer.gbest_y) table[0, 3] += optimizer.gbest_y table[1, 3] += end - start gBest[3, i] = optimizer.gbest_y optimizer = GPSO(func=Step, dim=30, pop=20, max_iter=g, lb=np.ones(30) * (-100), ub=np.ones(30) * 100, w=0.9, c1=2, c2=2, acceptance=0) start = time.time() optimizer.run() end = time.time() print('Step:', optimizer.gbest_y) table[0, 4] += optimizer.gbest_y table[1, 4] += end - start gBest[4, i] = optimizer.gbest_y optimizer = GPSO(func=Noise, dim=30, pop=20, max_iter=g, lb=np.ones(30) * (-1.28), ub=np.ones(30) * 1.28, w=0.9, c1=2, c2=2, acceptance=0.01) start = time.time() optimizer.run() end = time.time() print('Noise:', optimizer.gbest_y) table[0, 5] += optimizer.gbest_y table[1, 5] += end - start gBest[5, i] = optimizer.gbest_y optimizer = GPSO(func=Schewel, dim=30, pop=20, max_iter=g, lb=np.ones(30) * (-500), ub=np.ones(30) * 500, w=0.9, c1=2, c2=2, acceptance=-10000) start = time.time() optimizer.run() end = time.time() print('Schewel:', optimizer.gbest_y) table[0, 6] += optimizer.gbest_y table[1, 6] += end - start gBest[6, i] = optimizer.gbest_y optimizer = GPSO(func=Rastrigin, dim=30, pop=20, max_iter=g, lb=np.ones(30) * (-5.12), ub=np.ones(30) * 5.12, w=0.9, c1=2, c2=2, acceptance=50) start = time.time() optimizer.run() end = time.time() print('Rastrigin:', optimizer.gbest_y) table[0, 7] += optimizer.gbest_y table[1, 7] += end - start gBest[7, i] = optimizer.gbest_y optimizer = GPSO(func=Ackley, dim=30, pop=20, max_iter=g, lb=np.ones(30) * (-32), ub=np.ones(30) * 32, w=0.9, c1=2, c2=2, acceptance=0.01) start = time.time() optimizer.run() end = time.time() print('Ackley:', optimizer.gbest_y) table[0, 8] += optimizer.gbest_y table[1, 8] += end - start gBest[8, i] = optimizer.gbest_y optimizer = GPSO(func=Griewank, dim=30, pop=20, max_iter=g, lb=np.ones(30) * (-600), ub=np.ones(30) * 600, w=0.9, c1=2, c2=2, acceptance=0.01) start = time.time() optimizer.run() end = time.time() print('Griewank:', optimizer.gbest_y) table[0, 9] += optimizer.gbest_y table[1, 9] += end - start gBest[9, i] = optimizer.gbest_y table = table / times table = pd.DataFrame(table) table.columns = ['Sphere', 'Schwefel_P222', 'Quadric', 'Rosenbrock', 'Step', 'Quadric_Noise', 'Schwefel', 'Rastrigin', 'Ackley', 'Griewank'] table.index = ['mean score', 'mean time'] print(table) print('1030std:', np.std(gBest, axis=1)) print('1030best:', np.min(gBest, axis=1))
28.995556
113
0.566524
6fdb320f11ce21ba2207772e25516617a4f09f64
310
py
Python
setup.py
Juniper/contrail-server-manager
61a586495b4819904887b5dccb9288b9cf3d2ad5
[ "Apache-2.0" ]
12
2015-07-28T15:31:51.000Z
2019-03-03T23:39:10.000Z
setup.py
Juniper/contrail-server-manager
61a586495b4819904887b5dccb9288b9cf3d2ad5
[ "Apache-2.0" ]
4
2017-01-25T05:24:17.000Z
2019-04-03T00:25:13.000Z
setup.py
Juniper/contrail-server-manager
61a586495b4819904887b5dccb9288b9cf3d2ad5
[ "Apache-2.0" ]
33
2015-01-07T10:01:28.000Z
2020-07-26T08:22:53.000Z
# # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # from setuptools import setup import setuptools setup( name='contrail-server-manager', version='0.1dev', packages=setuptools.find_packages(exclude=["*.pyc"]), zip_safe=False, long_description="Server Manager package", )
20.666667
64
0.716129
6fdc3aa267ad82108937792e25090869d2290abd
6,272
py
Python
Modules/Loadable/Markups/Testing/Python/MarkupsSceneViewRestoreTestManyLists.py
TheInterventionCentre/NorMIT-Plan-App
765ed9a5dccc1cc134b65ccabe93fc132baeb2ea
[ "MIT" ]
null
null
null
Modules/Loadable/Markups/Testing/Python/MarkupsSceneViewRestoreTestManyLists.py
TheInterventionCentre/NorMIT-Plan-App
765ed9a5dccc1cc134b65ccabe93fc132baeb2ea
[ "MIT" ]
null
null
null
Modules/Loadable/Markups/Testing/Python/MarkupsSceneViewRestoreTestManyLists.py
TheInterventionCentre/NorMIT-Plan-App
765ed9a5dccc1cc134b65ccabe93fc132baeb2ea
[ "MIT" ]
null
null
null
# Test restoring a scene with multiple lists with different number # of fiducials # first fiducial list displayNode1 = slicer.vtkMRMLMarkupsDisplayNode() slicer.mrmlScene.AddNode(displayNode1) fidNode1 = slicer.vtkMRMLMarkupsFiducialNode() fidNode1.SetName("FidNode1") slicer.mrmlScene.AddNode(fidNode1) fidNode1.SetAndObserveDisplayNodeID(displayNode1.GetID()) coords = [0.0, 0.0, 0.0] numFidsInList1 = 5 for i in range(numFidsInList1): fidNode1.AddFiducialFromArray(coords) coords[0] += 1.0 coords[1] += 2.0 coords[2] += 1.0 # second fiducial list displayNode2 = slicer.vtkMRMLMarkupsDisplayNode() slicer.mrmlScene.AddNode(displayNode2) fidNode2 = slicer.vtkMRMLMarkupsFiducialNode() fidNode2.SetName("FidNode2") slicer.mrmlScene.AddNode(fidNode2) fidNode2.SetAndObserveDisplayNodeID(displayNode2.GetID()) numFidsInList2 = 10 for i in range(numFidsInList2): fidNode2.AddFiducialFromArray(coords) coords[0] += 1.0 coords[1] += 1.0 coords[2] += 3.0 sv = slicer.mrmlScene.AddNode(slicer.vtkMRMLSceneViewNode()) numFidNodesBeforeStore = slicer.mrmlScene.GetNumberOfNodesByClass('vtkMRMLMarkupsFiducialNode') sv.StoreScene() # add a third list that will get removed on restore # second fiducial list displayNode3 = slicer.vtkMRMLMarkupsDisplayNode() slicer.mrmlScene.AddNode(displayNode3) fidNode3 = slicer.vtkMRMLMarkupsFiducialNode() fidNode3.SetName("FidNode3") slicer.mrmlScene.AddNode(fidNode3) fidNode3.SetAndObserveDisplayNodeID(displayNode3.GetID()) numFidsInList3 = 2 for i in range(numFidsInList3): fidNode3.AddFiducialFromArray(coords) coords[0] += 1.0 coords[1] += 2.0 coords[2] += 3.0 sv.RestoreScene() numFidNodesAfterRestore = slicer.mrmlScene.GetNumberOfNodesByClass('vtkMRMLMarkupsFiducialNode') if numFidNodesAfterRestore != numFidNodesBeforeStore: print "After restoring the scene, expected ", numFidNodesBeforeStore, " fiducial nodes, but have ", numFidNodesAfterRestore exceptionMessage = "After restoring the scene, expected " + str(numFidNodesBeforeStore) + " fiducial nodes, but have " + str(numFidNodesAfterRestore) raise Exception(exceptionMessage) #fid1AfterRestore = slicer.mrmlScene.GetNodeByID("vtkMRMLMarkupsFiducialNode1") fid1AfterRestore = slicer.mrmlScene.GetFirstNodeByName("FidNode1") numFidsInList1AfterRestore = fid1AfterRestore.GetNumberOfMarkups() print "After restore, list with name FidNode1 has id ", fid1AfterRestore.GetID(), " and num fids = ", numFidsInList1AfterRestore if numFidsInList1AfterRestore != numFidsInList1: exceptionMessage = "After restoring list 1, id = " + fid1AfterRestore.GetID() exceptionMessage += ", expected " + str(numFidsInList1) + " but got " exceptionMessage += str(numFidsInList1AfterRestore) raise Exception(exceptionMessage) # fid2AfterRestore = slicer.mrmlScene.GetNodeByID("vtkMRMLMarkupsFiducialNode2") fid2AfterRestore = slicer.mrmlScene.GetFirstNodeByName("FidNode2") numFidsInList2AfterRestore = fid2AfterRestore.GetNumberOfMarkups() print "After restore, list with name FidNode2 has id ", fid2AfterRestore.GetID(), " and num fids = ", numFidsInList2AfterRestore if numFidsInList2AfterRestore != numFidsInList2: exceptionMessage = "After restoring list 2, id = " + fid2AfterRestore.GetID() exceptionMessage += ", expected " + str(numFidsInList2) + " but got " exceptionMessage += str(numFidsInList2AfterRestore) raise Exception(exceptionMessage) # check the displayable manager for the right number of widgets/seeds lm = slicer.app.layoutManager() td = lm.threeDWidget(0) ms = vtk.vtkCollection() td.getDisplayableManagers(ms) fidManagerIndex = -1 for i in range(ms.GetNumberOfItems()): m = ms.GetItemAsObject(i) if m.GetClassName() == "vtkMRMLMarkupsFiducialDisplayableManager3D": fidManagerIndex = i print m.GetClassName(), fidManagerIndex if fidManagerIndex == -1: exceptionMessage = "Failed to find markups fiducial displayable manager 3d!" raise Exception(exceptionMessage) mfm = ms.GetItemAsObject(fidManagerIndex) h = mfm.GetHelper() print 'Helper = ',h seedWidget1 = h.GetWidget(fid1AfterRestore) rep1 = seedWidget1.GetRepresentation() print "Seed widget 1 has number of seeds = ",rep1.GetNumberOfSeeds() if rep1.GetNumberOfSeeds() != numFidsInList1AfterRestore: exceptionMessage = "After restoring list 1, expected seed widget to have " exceptionMessage += str(numFidsInList1AfterRestore) + " seeds, but it has " exceptionMessage += str(rep1.GetNumberOfSeeds()) raise Exception(exceptionMessage) # check positions for s in range(numFidsInList1AfterRestore): seed = seedWidget1.GetSeed(s) handleRep = seed.GetHandleRepresentation() worldPos = handleRep.GetWorldPosition() print "seed ",s," world position = ",worldPos fidPos = [0.0,0.0,0.0] fid1AfterRestore.GetNthFiducialPosition(s,fidPos) xdiff = fidPos[0] - worldPos[0] ydiff = fidPos[1] - worldPos[1] zdiff = fidPos[2] - worldPos[2] diffTotal = xdiff + ydiff + zdiff if diffTotal > 0.1: exceptionMessage = "List1: Difference between seed position " + str(s) exceptionMessage += " and fiducial position totals = " + str(diffTotal) raise Exception(exceptionMessage) seedWidget2 = h.GetWidget(fid2AfterRestore) rep2 = seedWidget2.GetRepresentation() print "Seed widget 2 has number of seeds = ",rep2.GetNumberOfSeeds() if rep2.GetNumberOfSeeds() != numFidsInList2AfterRestore: exceptionMessage = "After restoring fid list 2, expected seed widget to have " exceptionMessage += str(numFidsInList2AfterRestore) + " seeds, but it has " exceptionMessage += str(rep2.GetNumberOfSeeds()) raise Exception(exceptionMessage) # check positions for s in range(numFidsInList2AfterRestore): seed = seedWidget2.GetSeed(s) handleRep = seed.GetHandleRepresentation() worldPos = handleRep.GetWorldPosition() print "seed ",s," world position = ",worldPos fidPos = [0.0,0.0,0.0] fid2AfterRestore.GetNthFiducialPosition(s,fidPos) xdiff = fidPos[0] - worldPos[0] ydiff = fidPos[1] - worldPos[1] zdiff = fidPos[2] - worldPos[2] diffTotal = xdiff + ydiff + zdiff if diffTotal > 0.1: exceptionMessage = "List2: Difference between seed position " + str(s) exceptionMessage += " and fiducial position totals = " + str(diffTotal) raise Exception(exceptionMessage) ms.RemoveAllItems()
37.333333
151
0.772162
6fdd8bc73e2b49aa962aeebacd2ae774e4162d17
1,013
py
Python
segmentfault/apps/msg/consumer.py
Yookyiss/segmentfault
8fb7890c8b650ac34541a8fb14c3cd9bef98d120
[ "MIT" ]
null
null
null
segmentfault/apps/msg/consumer.py
Yookyiss/segmentfault
8fb7890c8b650ac34541a8fb14c3cd9bef98d120
[ "MIT" ]
12
2020-02-12T01:14:42.000Z
2022-03-11T23:54:43.000Z
segmentfault/apps/msg/consumer.py
Yookyiss/segmentfault
8fb7890c8b650ac34541a8fb14c3cd9bef98d120
[ "MIT" ]
null
null
null
# -*- coding:utf-8 -*- # @Time : 2019/7/21 12:35 PM # @Author : __wutonghe__ # docs https://channels.readthedocs.io/en/latest/tutorial/part_3.html#rewrite-the-consumer-to-be-asynchronous from channels.generic.websocket import AsyncWebsocketConsumer import json
30.69697
119
0.669299
6fe090a4e22c0963ebcb0f7db477cda0fa848e0e
2,618
py
Python
tests/utils/test_interpolator.py
JelleAalbers/hypney
3e38e21743fc9babe0ed47af299d08242a9b6d32
[ "MIT" ]
null
null
null
tests/utils/test_interpolator.py
JelleAalbers/hypney
3e38e21743fc9babe0ed47af299d08242a9b6d32
[ "MIT" ]
null
null
null
tests/utils/test_interpolator.py
JelleAalbers/hypney
3e38e21743fc9babe0ed47af299d08242a9b6d32
[ "MIT" ]
null
null
null
import eagerpy as ep import numpy as np from scipy.interpolate import RegularGridInterpolator import hypney tl = ep.numpy def test_regular_grid_interpolator(): """Adapted from https://github.com/sbarratt/torch_interpolations/blob/master/tests/test_grid_interpolator.py """ points = [tl.arange(-0.5, 2.5, 0.1) * 1.0, tl.arange(-0.5, 2.5, 0.2) * 1.0] values = ( hypney.utils.eagerpy.sin(points[0])[:, None] + 2 * hypney.utils.eagerpy.cos(points[1])[None, :] + hypney.utils.eagerpy.sin(5 * points[0][:, None] @ points[1][None, :]) ) X, Y = ep.meshgrid(tl.arange(-0.5, 2, 0.1), tl.arange(-0.5, 2, 0.1)) points_to_interp = ep.stack([X.flatten(), Y.flatten()]).T gi = hypney.utils.interpolation.RegularGridInterpolator(points, values) fx = gi(points_to_interp) rgi = RegularGridInterpolator( [p.numpy() for p in points], [x.numpy() for x in values], bounds_error=False ) rfx = rgi(points_to_interp.numpy()) np.testing.assert_allclose(rfx, fx.numpy(), atol=1e-6) # TODO: port derivative test to eagerpy # note that points_to_interp has to be transposed # # def test_regular_grid_interpolator_derivative(): # points = [torch.arange(-.5, 2.5, .5) * 1., torch.arange(-.5, 2.5, .5) * 1.] # values = torch.sin(points[0])[:, None] + 2 * torch.cos(points[1])[None, :] + torch.sin(5 * points[0][:, None] @ points[1][None, :]) # values.requires_grad_(True) # # X, Y = np.meshgrid(np.arange(-.5, 2, .19), np.arange(-.5, 2, .19)) # points_to_interp = [torch.from_numpy( # X.flatten()).float(), torch.from_numpy(Y.flatten()).float()] # # def f(values): # return torch_interpolations.RegularGridInterpolator( # points, values)(points_to_interp) # # torch.autograd.gradcheck(f, (values,), eps=1e-5, atol=1e-1, rtol=1e-1)
33.564103
137
0.632544
6fe12a816ae34998a3fcf2329f909ed39bda660d
8,451
py
Python
python/database.py
bvmeggelen/routino
b6bcc47be6ba4a90353a5b140ca9996aaa17d2b8
[ "X11", "MIT" ]
1
2016-02-12T20:26:31.000Z
2016-02-12T20:26:31.000Z
python/database.py
bvmeggelen/routino
b6bcc47be6ba4a90353a5b140ca9996aaa17d2b8
[ "X11", "MIT" ]
2
2019-01-16T10:00:19.000Z
2019-02-03T10:53:32.000Z
python/database.py
bvmeggelen/routino
b6bcc47be6ba4a90353a5b140ca9996aaa17d2b8
[ "X11", "MIT" ]
null
null
null
#!/usr/bin/python3 ########################################## # Routino database access from Python. # # Part of the Routino routing software. ########################################## # This file Copyright 2018 Andrew M. Bishop # # 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/>. ########################################## import routino.database # Database, access all attributes database = routino.database.LoadDatabase("../../src/test/fat", "turns") if database is None: database = routino.database.LoadDatabase("../src/test/fat", "turns") if database is None: print("Failed to load database") exit(1) print(database) database_attrs = ['nnodes', 'nsegments', 'nways', 'nrelations'] for attr in database_attrs: print(" Attribute: " + attr + " =", getattr(database, attr)) print("") # A single node, access all attributes and all functions node=database.GetNode(0) print("1st node =", node) node_attrs = ['id', 'firstsegment', 'latitude', 'longitude', 'allow', 'flags'] node_infos = ['', '', 'degrees', 'degrees', '[note 1]', '[note 2]'] for attr,info in zip(node_attrs,node_infos): print(" Attribute: " + attr + " =", getattr(node, attr), info) segments = node.Segments() print(" Function: " + "Segments()" + " = [" + ", ".join([str(segments[x]) for x in range(len(segments))]) + "]") print("") # A single segment, access all attributes and all functions segment=database.GetSegment(0) print("1st segment =", segment) segment_attrs = ['id', 'node1', 'node2', 'next2', 'way', 'distance', 'flags'] segment_infos = ['', '', '', '', '', 'km', '[note 3]'] for attr,info in zip(segment_attrs,segment_infos): print(" Attribute: " + attr + " =", getattr(segment, attr), info) print(" Function: " + "Node1()" + " = " + str(segment.Node1())) print(" Function: " + "Node2()" + " = " + str(segment.Node2())) print(" Function: " + "Way()" + " = " + str(segment.Way())) print("") # A single way, access all attributes and all functions way=database.GetWay(0) print("1st way =", way) way_attrs = ['id', 'name', 'allow', 'type', 'props', 'speed', 'weight', 'height', 'width', 'length'] way_infos = ['', '', '[note 1]', '[note 4]', '[note 5]', 'km/hr [note 6]', 'tonnes [note 6]', 'metres [note 6]', 'metres [note 6]', 'metres [note 6]'] for attr,info in zip(way_attrs,way_infos): print(" Attribute: " + attr + " =", getattr(way, attr), info) print("") # A single relation, access all attributes and all functions relation=database.GetRelation(0) print("1st relation =", relation) relation_attrs = ['id', 'from_seg', 'via_node', 'to_seg', 'from_way', 'to_way', 'from_node', 'to_node', 'except_transport'] relation_infos = ['', '', '', '', '', '', '', '', '[note 7]'] for attr,info in zip(relation_attrs,relation_infos): print(" Attribute: " + attr + " =", getattr(relation, attr), info) print(" Function: " + "FromSegment()" + " = " + str(relation.FromSegment())) print(" Function: " + "ViaNode()" + " = " + str(relation.ViaNode())) print(" Function: " + "ToSegment()" + " = " + str(relation.ToSegment())) print(" Function: " + "FromWay()" + " = " + str(relation.FromWay())) print(" Function: " + "ToWay()" + " = " + str(relation.ToWay())) print(" Function: " + "FromNode()" + " = " + str(relation.FromNode())) print(" Function: " + "ToNode()" + " = " + str(relation.ToNode())) print("") # The list of nodes as a list and an iterable (just the first 4) nodes=database.Nodes() print("len(database.Nodes()) = " + str(len(nodes))) print("database.Nodes() = [" + ", ".join([str(nodes[x]) for x in range(4)]) + ", ...]") for node in nodes: if node.id == 4: break print(node) print("") # The list of segments as a list and an iterable (just the first 4) segments=database.Segments() print("len(database.Segments()) = " + str(len(segments))) print("database.Segments() = [" + ", ".join([str(segments[x]) for x in range(4)]) + ", ...]") for segment in segments: if segment.id == 4: break print(segment) print("") # The list of ways as a list and an iterable (just the first 4) ways=database.Ways() print("len(database.Ways()) = " + str(len(ways))) print("database.Ways() = [" + ", ".join([str(ways[x]) for x in range(4)]) + ", ...]") for way in ways: if way.id == 4: break print(way) print("") # The list of relations as a list and an iterable (just the first 4) relations=database.Relations() print("len(database.Relations()) = " + str(len(relations))) print("database.Relations() = [" + ", ".join([str(relations[x]) for x in range(4)]) + ", ...]") for relation in relations: if relation.id == 4: break print(relation) print("") # Enumerated lists transports_enum = ["Transports_None", "Transports_Foot", "Transports_Horse", "Transports_Wheelchair", "Transports_Bicycle", "Transports_Moped", "Transports_Motorcycle", "Transports_Motorcar", "Transports_Goods", "Transports_HGV", "Transports_PSV", "Transports_ALL"] nodeflags_enum = ["Nodeflag_Super", "Nodeflag_U_Turn", "Nodeflag_Mini_Roundabout", "Nodeflag_Turn_Restrict", "Nodeflag_Turn_Restrict2"] segmentflags_enum = ["Segmentflag_Area", "Segmentflag_Oneway_1to2", "Segmentflag_Oneway_2to1", "Segmentflag_Super", "Segmentflag_Normal"] properties_enum = ["Properties_None", "Properties_Paved", "Properties_Multilane", "Properties_Bridge", "Properties_Tunnel", "Properties_FootRoute", "Properties_BicycleRoute", "Properties_ALL"] highway_enum = ["Highway_Motorway", "Highway_Trunk", "Highway_Primary", "Highway_Secondary", "Highway_Tertiary", "Highway_Unclassified", "Highway_Residential", "Highway_Service", "Highway_Track", "Highway_Cycleway", "Highway_Path", "Highway_Steps", "Highway_Ferry", "Highway_Count", "Highway_CycleBothWays", "Highway_OneWay", "Highway_Roundabout", "Highway_Area"] print("Note 1: The Node's and Way's 'allow' parameter can be the combination of these enumerated values:") print_enum(transports_enum) print("") print("Note 2: The Node's 'flags' parameter can be the combination of these enumerated values:") print_enum(nodeflags_enum) print("") print("Note 3: The Segment's 'flags' parameter can be the combination of these enumerated values:") print_enum(segmentflags_enum) print("") print("Note 4: The Way's 'type' parameter can be one the combination of these enumerated values:") print_enum(highway_enum) print("") print("Note 5: The Way's 'props' parameter can be the combination of these enumerated values:") print_enum(properties_enum) print("") print("Note 6: A value of zero for a Way's speed, weight, height, width or length means that there is no limit.") print("") print("Note 7: The Relation's 'except_transport' parameter can be the combination of these enumerated values:") print_enum(transports_enum) print("") import gc gc.collect()
30.956044
156
0.587504
6fe133c49876165e512b3f8ef38f50888917b203
475
py
Python
vcsver/tests/test_util.py
janneronkko/vcsver
77020e296a8239ee142213642504c03b9064653f
[ "MIT" ]
1
2020-12-23T19:22:51.000Z
2020-12-23T19:22:51.000Z
vcsver/tests/test_util.py
janneronkko/vcsver
77020e296a8239ee142213642504c03b9064653f
[ "MIT" ]
null
null
null
vcsver/tests/test_util.py
janneronkko/vcsver
77020e296a8239ee142213642504c03b9064653f
[ "MIT" ]
null
null
null
import io from .. import util
19.791667
66
0.614737
6fe228d5ef8bd389e1153721d4a2bf62938a548d
820
py
Python
matrixFuncs/determinant.py
AmaarMarfatia/MatrixFunctions
c115dd58c273dc791dfd56316c855e601b0d94cc
[ "MIT" ]
null
null
null
matrixFuncs/determinant.py
AmaarMarfatia/MatrixFunctions
c115dd58c273dc791dfd56316c855e601b0d94cc
[ "MIT" ]
null
null
null
matrixFuncs/determinant.py
AmaarMarfatia/MatrixFunctions
c115dd58c273dc791dfd56316c855e601b0d94cc
[ "MIT" ]
null
null
null
matA = [[1,2,3],[4,5,6],[7,8,15]] print(determinant(matA))
28.275862
65
0.486585
6fe25b4c2678c24198e66f7fedfb9fb15fdcf64a
5,498
py
Python
pysnmp/BAY-STACK-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
11
2021-02-02T16:27:16.000Z
2021-08-31T06:22:49.000Z
pysnmp/BAY-STACK-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
75
2021-02-24T17:30:31.000Z
2021-12-08T00:01:18.000Z
pysnmp/BAY-STACK-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
10
2019-04-30T05:51:36.000Z
2022-02-16T03:33:41.000Z
# # PySNMP MIB module BAY-STACK-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/BAY-STACK-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:19:06 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ConstraintsUnion, ConstraintsIntersection, ValueSizeConstraint, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsUnion", "ConstraintsIntersection", "ValueSizeConstraint", "ValueRangeConstraint") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") TimeTicks, MibScalar, MibTable, MibTableRow, MibTableColumn, Gauge32, Counter64, Bits, Counter32, ModuleIdentity, ObjectIdentity, IpAddress, iso, Integer32, NotificationType, MibIdentifier, Unsigned32 = mibBuilder.importSymbols("SNMPv2-SMI", "TimeTicks", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Gauge32", "Counter64", "Bits", "Counter32", "ModuleIdentity", "ObjectIdentity", "IpAddress", "iso", "Integer32", "NotificationType", "MibIdentifier", "Unsigned32") TruthValue, TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TruthValue", "TextualConvention", "DisplayString") bayStackMibs, = mibBuilder.importSymbols("SYNOPTICS-ROOT-MIB", "bayStackMibs") bayStackMib = ModuleIdentity((1, 3, 6, 1, 4, 1, 45, 5, 13)) bayStackMib.setRevisions(('2013-10-11 00:00', '2012-10-02 00:00', '2009-09-28 00:00', '2007-09-04 00:00', '2005-08-22 00:00',)) if mibBuilder.loadTexts: bayStackMib.setLastUpdated('201310110000Z') if mibBuilder.loadTexts: bayStackMib.setOrganization('Nortel Networks') bayStackObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 45, 5, 13, 1)) bayStackConfig = MibIdentifier((1, 3, 6, 1, 4, 1, 45, 5, 13, 1, 1)) bayStackConfigExpectedStackSize = MibScalar((1, 3, 6, 1, 4, 1, 45, 5, 13, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 8))).setMaxAccess("readwrite") if mibBuilder.loadTexts: bayStackConfigExpectedStackSize.setStatus('current') bayStackConfigStackErrorNotificationInterval = MibScalar((1, 3, 6, 1, 4, 1, 45, 5, 13, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)).clone(60)).setUnits('Seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: bayStackConfigStackErrorNotificationInterval.setStatus('current') bayStackConfigStackErrorNotificationEnabled = MibScalar((1, 3, 6, 1, 4, 1, 45, 5, 13, 1, 1, 3), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: bayStackConfigStackErrorNotificationEnabled.setStatus('current') bayStackConfigStackRebootUnitOnFailure = MibScalar((1, 3, 6, 1, 4, 1, 45, 5, 13, 1, 1, 4), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: bayStackConfigStackRebootUnitOnFailure.setStatus('current') bayStackConfigStackRetryCount = MibScalar((1, 3, 6, 1, 4, 1, 45, 5, 13, 1, 1, 5), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readwrite") if mibBuilder.loadTexts: bayStackConfigStackRetryCount.setStatus('current') bayStackUnitConfigTable = MibTable((1, 3, 6, 1, 4, 1, 45, 5, 13, 1, 2), ) if mibBuilder.loadTexts: bayStackUnitConfigTable.setStatus('current') bayStackUnitConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 45, 5, 13, 1, 2, 1), ).setIndexNames((0, "BAY-STACK-MIB", "bayStackUnitConfigIndex")) if mibBuilder.loadTexts: bayStackUnitConfigEntry.setStatus('current') bayStackUnitConfigIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 5, 13, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 8))).setMaxAccess("readonly") if mibBuilder.loadTexts: bayStackUnitConfigIndex.setStatus('current') bayStackUnitConfigRearPortAdminMode = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 5, 13, 1, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("standalone", 1), ("stacking", 2), ("spb", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: bayStackUnitConfigRearPortAdminMode.setStatus('current') bayStackUnitConfigRearPortOperMode = MibTableColumn((1, 3, 6, 1, 4, 1, 45, 5, 13, 1, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("standalone", 1), ("stacking", 2), ("spb", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: bayStackUnitConfigRearPortOperMode.setStatus('current') mibBuilder.exportSymbols("BAY-STACK-MIB", bayStackMib=bayStackMib, bayStackUnitConfigIndex=bayStackUnitConfigIndex, bayStackConfigStackErrorNotificationEnabled=bayStackConfigStackErrorNotificationEnabled, PYSNMP_MODULE_ID=bayStackMib, bayStackConfigStackRetryCount=bayStackConfigStackRetryCount, bayStackConfigStackErrorNotificationInterval=bayStackConfigStackErrorNotificationInterval, bayStackUnitConfigRearPortOperMode=bayStackUnitConfigRearPortOperMode, bayStackUnitConfigEntry=bayStackUnitConfigEntry, bayStackConfigStackRebootUnitOnFailure=bayStackConfigStackRebootUnitOnFailure, bayStackObjects=bayStackObjects, bayStackUnitConfigRearPortAdminMode=bayStackUnitConfigRearPortAdminMode, bayStackConfig=bayStackConfig, bayStackUnitConfigTable=bayStackUnitConfigTable, bayStackConfigExpectedStackSize=bayStackConfigExpectedStackSize)
130.904762
836
0.790833
6fe276f59396e1213dd3856def48f978483f24dc
2,184
py
Python
priv/flatex/flatex.py
w495/survey-cbvr
861db7b9020a4c5809af5c147cfd7387a3a856ed
[ "MIT" ]
1
2016-08-15T22:37:03.000Z
2016-08-15T22:37:03.000Z
priv/flatex/flatex.py
w495/survey-cbvr
861db7b9020a4c5809af5c147cfd7387a3a856ed
[ "MIT" ]
null
null
null
priv/flatex/flatex.py
w495/survey-cbvr
861db7b9020a4c5809af5c147cfd7387a3a856ed
[ "MIT" ]
null
null
null
#!/usr/bin/env python # This "flattens" a LaTeX document by replacing all # \input{X} lines w/ the text actually contained in X. See # associated README.md for details. # Use as a python module in a python script by saying import flatex then flatex.main(in file, out file) import os import re import sys def is_input(line): """ Determines whether or not a read in line contains an uncommented out \input{} statement. Allows only spaces between start of line and '\input{}'. """ #tex_input_re = r"""^\s*\\input{[^}]*}""" # input only tex_input_re = r"""(^[^\%]*\\input{[^}]*})|(^[^\%]*\\include{[^}]*})""" # input or include return re.search(tex_input_re, line) def get_input(line): """ Gets the file name from a line containing an input statement. """ tex_input_filename_re = r"""{[^}]*""" m = re.search(tex_input_filename_re, line) return m.group()[1:] def combine_path(base_path, relative_ref): """ Combines the base path of the tex document being worked on with the the relate reference found in that document. """ #if (base_path != ""): #print "os.getcwd()", os.getcwd() #os.chdir(base_path) filePath = os.path.abspath(relative_ref) filePath = filePath + ".tex" return filePath def expand_file(base_file): """ Recursively-defined function that takes as input a file and returns it with all the inputs replaced with the contents of the referenced file. """ output_lines = [] f = open(base_file, "r") for line in f: if is_input(line): new_base_file = combine_path(current_path, get_input(line)) output_lines += expand_file(new_base_file) output_lines.append('\n') # add a new line after each file input else: output_lines.append(line) f.close() return output_lines if __name__ == '__main__': base_file, output_file = sys.argv[1:] current_path = os.path.split(base_file)[0] main(base_file, output_file)
31.2
106
0.641026
6fe3cc82a26ac5744b2544116ad6a32d14b35afa
30
py
Python
sigal/plugins/encrypt/__init__.py
fidergo-stephane-gourichon/sigal
b1f2e947700e618425e170e8758b1fbb82c91acb
[ "MIT" ]
null
null
null
sigal/plugins/encrypt/__init__.py
fidergo-stephane-gourichon/sigal
b1f2e947700e618425e170e8758b1fbb82c91acb
[ "MIT" ]
null
null
null
sigal/plugins/encrypt/__init__.py
fidergo-stephane-gourichon/sigal
b1f2e947700e618425e170e8758b1fbb82c91acb
[ "MIT" ]
null
null
null
from .encrypt import register
15
29
0.833333
6fe4383a2b514d6df56ab04d2ab236c4e1f75e15
1,600
py
Python
pull_1m/pull_v2.py
tlh45342/polygon-pull
1fc59d07d37ea56be5db4856f25ac1d9eca7e810
[ "Apache-2.0" ]
null
null
null
pull_1m/pull_v2.py
tlh45342/polygon-pull
1fc59d07d37ea56be5db4856f25ac1d9eca7e810
[ "Apache-2.0" ]
null
null
null
pull_1m/pull_v2.py
tlh45342/polygon-pull
1fc59d07d37ea56be5db4856f25ac1d9eca7e810
[ "Apache-2.0" ]
null
null
null
import datetime import os import pandas from polygon.rest.client import RESTClient # ---------------------------- daystr = "2021-09-10" df = pull_day("LC", daystr) fname = r"M:\data\out.csv" print("Writing: ", fname) df.to_csv (fname, index = False, header=True)
34.042553
113
0.56
6fe47402ae7ebb99a7865e69f0ddb0204cb01079
1,595
py
Python
pwython/__main__.py
Adwaith-Rajesh/Pwython
f734066e251373c7b1634c27617089f9fe0ac79a
[ "Unlicense" ]
null
null
null
pwython/__main__.py
Adwaith-Rajesh/Pwython
f734066e251373c7b1634c27617089f9fe0ac79a
[ "Unlicense" ]
null
null
null
pwython/__main__.py
Adwaith-Rajesh/Pwython
f734066e251373c7b1634c27617089f9fe0ac79a
[ "Unlicense" ]
null
null
null
from random import choice, randint from re import sub, split, findall from string import ascii_letters from subprocess import PIPE, Popen from sys import argv, executable, stderr from .responses import pronouns, reactions, remarks if __name__ == "__main__": main()
29.537037
112
0.573041
6fe49f0a6289892c3834db40f35fd362645dee89
6,966
py
Python
botnet/fabfile.py
MrScytheLULZ/Simple-python-cnc
23adc7ae553239a0c23da63d6eb97da24054fd93
[ "MIT" ]
23
2016-05-31T22:42:07.000Z
2022-03-30T13:37:44.000Z
botnet/fabfile.py
MrScytheLULZ/Simple-python-cnc
23adc7ae553239a0c23da63d6eb97da24054fd93
[ "MIT" ]
null
null
null
botnet/fabfile.py
MrScytheLULZ/Simple-python-cnc
23adc7ae553239a0c23da63d6eb97da24054fd93
[ "MIT" ]
18
2017-03-15T08:22:33.000Z
2020-11-14T23:37:06.000Z
import os from fabric.api import env, run, sudo, execute, local, settings, \ hide, open_shell, parallel, serial, put from fabric.decorators import hosts from fabric.contrib.console import confirm import fabric.colors as fab_col import paramiko import getpass from tabulate import tabulate file_hosts = "hosts.txt" paramiko.util.log_to_file("paramiko.log") env.colorize_errors = True # The selected hosts are the hosts in env (at the beginning) selected_hosts = env.hosts running_hosts = {} env.connection_attempts = 2 # env.skip_bad_hosts = True def load_hosts(): """ Load hosts from hosts.txt. A host can either be in form username@host[:port] password or username@host[:port] If no port is specified, port 22 is selected. """ with open(file_hosts, "r") as f: data = f.readlines() for line in data: try: host, password = line.strip().split() except ValueError: host = line.strip() password = None if len(host.split(':')) == 1: host = host + ":22" env.hosts.append(host) if password is not None: env.passwords[host] = password.strip() env.hosts = list(set(env.hosts)) # Remove duplicates def add_host(): """ Add a new host to the running hosts. The user can decide whether to add the host also to the external hosts.txt file. """ name = raw_input("Username: ") host = raw_input("Host: ") port = input("Port: ") new_host = name + "@" + host + ":" + str(port) selected_hosts.append(new_host) password = None if confirm("Authenticate using a password? "): password = getpass.getpass("Password: ").strip() env.passwords[new_host] = password # Append the new host to the hosts file if confirm("Add the new host to the hosts file? "): if password is not None: line = new_host + " " + password + "\n" else: line = new_host + "\n" with open(file_hosts, 'a') as f: f.write(line) def print_hosts(): """ Print selected hosts. If hosts haven't been hand-selected yet, all hosts are selected. """ hosts = map(lambda x: [x, env.passwords.get(x, None)], selected_hosts) print(fab_col.green(tabulate(hosts, ["Host", "Password"]))) def check_hosts(): """ Check if hosts are active or not and print the result. """ global running_hosts running_hosts = dict() for host in selected_hosts: print(fab_col.magenta("\nPing host %d of %d" % (selected_hosts.index(host) + 1, len(selected_hosts)))) response = os.system("ping -c 1 " + host.split("@")[1].split(":")[0]) if response == 0: running_hosts[host] = True else: running_hosts[host] = False # Convert running_hosts in order to print it as table mylist = map(lambda index: [index[0], str(index[1])], running_hosts.items()) print(fab_col.green(tabulate(mylist, ["Host", "Running"]))) def select_running_hosts(): """ Select all active hosts. """ global selected_hosts with hide('stdout'): check_hosts() host_up = filter(lambda x: running_hosts.get(x, False), running_hosts.keys()) selected_hosts = host_up def choose_hosts(): """ Select the hosts to be used. """ global selected_hosts mylist = map(lambda (num, h): [num, h], enumerate(env.hosts)) print(fab_col.blue("Select Hosts (space-separated):")) print(fab_col.blue(tabulate(mylist, ["Number", "Host"]))) choices = raw_input("> ").split() # Avoid letters in string index choices = filter(lambda x: x.isdigit(), choices) # Convert to int list choices = map(int, choices) # Avoid IndexError choices = filter(lambda x: x < len(env.hosts), choices) # Remove duplicates choices = list(set(choices)) # If no hosts are selected, keep the current hosts if len(choices) == 0: return # Get only selected hosts selected_hosts = map(lambda i: env.hosts[i], choices) def run_locally(cmd=None): """ Execute a command locally. """ if cmd is None: cmd = raw_input("Insert command: ") with settings(warn_only=True): local(cmd) # This function cannot have the parallel decorator since # a sudo command must receive the user password def open_sh(): """ Open a shell on a host. """ mylist = map(lambda (num, h): [num, h], enumerate(selected_hosts)) print(fab_col.blue(tabulate(mylist, ["Number", "Host"]))) try: n = input("Open shell in host number: ") h = selected_hosts[n] execute(open_shell, host=h) except (NameError, IndexError): print(fab_col.red("Error: invalid host selection.")) print(fab_col.red("Shell not opened."))
28.904564
80
0.611111
6fe5e32a34a80c26893983ec1a48a618f1bae5f3
781
py
Python
shared.py
gattis/magnum-py
98027eee373296030a118681a449629c57d85426
[ "Unlicense" ]
null
null
null
shared.py
gattis/magnum-py
98027eee373296030a118681a449629c57d85426
[ "Unlicense" ]
null
null
null
shared.py
gattis/magnum-py
98027eee373296030a118681a449629c57d85426
[ "Unlicense" ]
null
null
null
objects = {}
27.892857
112
0.690141
6fe5fbc85c69cdd93c1fbe4aaa0233fcbcd08383
10,398
py
Python
appengine/cr-buildbucket/legacy/api_common.py
xinghun61/infra
b5d4783f99461438ca9e6a477535617fadab6ba3
[ "BSD-3-Clause" ]
2
2021-04-13T21:22:18.000Z
2021-09-07T02:11:57.000Z
appengine/cr-buildbucket/legacy/api_common.py
xinghun61/infra
b5d4783f99461438ca9e6a477535617fadab6ba3
[ "BSD-3-Clause" ]
16
2020-09-07T11:55:09.000Z
2022-03-02T05:47:58.000Z
appengine/cr-buildbucket/legacy/api_common.py
xinghun61/infra
b5d4783f99461438ca9e6a477535617fadab6ba3
[ "BSD-3-Clause" ]
null
null
null
# Copyright 2017 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import json from google.appengine.ext import ndb from google.protobuf import json_format from google.protobuf import struct_pb2 from protorpc import messages from components import utils from proto import common_pb2 import bbutil import config import logging import model # Names of well-known parameters. BUILDER_PARAMETER = 'builder_name' PROPERTIES_PARAMETER = 'properties' def format_luci_bucket(bucket_id): """Returns V1 luci bucket name, e.g. "luci.chromium.try".""" return 'luci.%s.%s' % config.parse_bucket_id(bucket_id) def parse_luci_bucket(bucket): """Converts V1 LUCI bucket to a bucket ID string. Returns '' if bucket is not a LUCI bucket. """ parts = bucket.split('.', 2) if len(parts) == 3 and parts[0] == 'luci': return config.format_bucket_id(parts[1], parts[2]) return '' CANARY_PREFERENCE_TO_TRINARY = { CanaryPreference.AUTO: common_pb2.UNSET, CanaryPreference.PROD: common_pb2.NO, CanaryPreference.CANARY: common_pb2.YES, } TRINARY_TO_CANARY_PREFERENCE = { v: k for k, v in CANARY_PREFERENCE_TO_TRINARY.iteritems() } # List of deprecated properties that are converted from float to int for # backward compatibility. # TODO(crbug.com/877161): remove this list. INTEGER_PROPERTIES = [ 'buildnumber', 'issue', 'patchset', 'patch_issue', 'patch_set', ] def get_build_url(build): """Returns view URL of the build.""" if build.url: return build.url settings = config.get_settings_async().get_result() return 'https://%s/b/%d' % (settings.swarming.milo_hostname, build.proto.id) def properties_to_json(properties): """Converts properties to JSON. properties should be struct_pb2.Struct, but for convenience in tests a dict is also accepted. CAUTION: in general converts all numbers to floats, because JSON format does not distinguish floats and ints. For backward compatibility, temporarily (crbug.com/877161) renders widely used, deprecated properties as integers, see INTEGER_PROPERTIES. """ return json.dumps(_properties_to_dict(properties), sort_keys=True) def _properties_to_dict(properties): """Implements properties_to_json.""" assert isinstance(properties, (dict, struct_pb2.Struct)), properties if isinstance(properties, dict): # pragma: no branch properties = bbutil.dict_to_struct(properties) # Note: this dict does not necessarily equal the original one. # In particular, an int may turn into a float. as_dict = json_format.MessageToDict(properties) for p in INTEGER_PROPERTIES: if isinstance(as_dict.get(p), float): as_dict[p] = int(as_dict[p]) return as_dict def build_to_message(build_bundle, include_lease_key=False): """Converts a model.BuildBundle to BuildMessage.""" build = build_bundle.build assert build assert build.key assert build.key.id() bp = build.proto infra = build_bundle.infra.parse() sw = infra.swarming logdog = infra.logdog recipe = infra.recipe result_details = (build.result_details or {}).copy() result_details['properties'] = {} if build_bundle.output_properties: # pragma: no branch result_details['properties'] = _properties_to_dict( build_bundle.output_properties.parse() ) if bp.summary_markdown: result_details['ui'] = {'info': bp.summary_markdown} parameters = (build.parameters or {}).copy() parameters[BUILDER_PARAMETER] = bp.builder.builder parameters[PROPERTIES_PARAMETER] = _properties_to_dict( infra.buildbucket.requested_properties ) recipe_name = recipe.name if build_bundle.input_properties: # pragma: no cover input_props = build_bundle.input_properties.parse() if 'recipe' in input_props.fields: recipe_name = input_props['recipe'] if bp.status != common_pb2.SUCCESS and bp.summary_markdown: result_details['error'] = { 'message': bp.summary_markdown, } if sw.bot_dimensions: by_key = {} for d in sw.bot_dimensions: by_key.setdefault(d.key, []).append(d.value) result_details.setdefault('swarming', {})['bot_dimensions'] = by_key tags = set(build.tags) if build.is_luci: tags.add('swarming_hostname:%s' % sw.hostname) tags.add('swarming_task_id:%s' % sw.task_id) # Milo uses swarming tags. tags.add('swarming_tag:recipe_name:%s' % recipe_name) tags.add( 'swarming_tag:recipe_package:%s' % (bp.exe.cipd_package or recipe.cipd_package) ) tags.add( 'swarming_tag:log_location:logdog://%s/%s/%s/+/annotations' % (logdog.hostname, logdog.project, logdog.prefix) ) tags.add('swarming_tag:luci_project:%s' % bp.builder.project) # Try to find OS for d in sw.bot_dimensions: if d.key == 'os': tags.add('swarming_tag:os:%s' % d.value) break msg = BuildMessage( id=build.key.id(), project=bp.builder.project, bucket=legacy_bucket_name(build.bucket_id, build.is_luci), tags=sorted(tags), parameters_json=json.dumps(parameters, sort_keys=True), status=build.status_legacy, result=build.result, result_details_json=json.dumps(result_details, sort_keys=True), cancelation_reason=build.cancelation_reason, failure_reason=build.failure_reason, lease_key=build.lease_key if include_lease_key else None, url=get_build_url(build), created_ts=proto_to_timestamp(bp.create_time), started_ts=proto_to_timestamp(bp.start_time), updated_ts=proto_to_timestamp(bp.update_time), completed_ts=proto_to_timestamp(bp.end_time), created_by=build.created_by.to_bytes() if build.created_by else None, status_changed_ts=utils.datetime_to_timestamp(build.status_changed_time), utcnow_ts=utils.datetime_to_timestamp(utils.utcnow()), retry_of=build.retry_of, canary_preference=( # This is not accurate, but it does not matter at this point. # This is deprecated. CanaryPreference.CANARY if build.canary else CanaryPreference.PROD ), canary=build.canary, experimental=build.experimental, service_account=sw.task_service_account, # when changing this function, make sure build_to_dict would still work ) if build.lease_expiration_date is not None: msg.lease_expiration_ts = utils.datetime_to_timestamp( build.lease_expiration_date ) return msg def build_to_dict(build_bundle, include_lease_key=False): """Converts a build to an externally consumable dict. This function returns a dict that a BuildMessage would be encoded to. """ # Implementing this function in a generic way (message_to_dict) requires # knowledge of many protorpc and endpoints implementation details. # Not worth it. msg = build_to_message(build_bundle, include_lease_key=include_lease_key) # Special cases result = { 'tags': msg.tags, # a list } for f in msg.all_fields(): v = msg.get_assigned_value(f.name) if f.name in result or v is None: # None is the default. It is omitted by Cloud Endpoints. continue if isinstance(v, messages.Enum): v = str(v) else: assert isinstance(v, (basestring, int, long, bool)), v if (isinstance(f, messages.IntegerField) and f.variant == messages.Variant.INT64): v = str(v) result[f.name] = v return result
31.413897
79
0.726486
6fe6702a87b9963548f65391cbbfe3151ca980e8
1,606
py
Python
src/probnum/random_variables/__init__.py
admdev8/probnum
792b6299bac247cf8b1b5056756f0f078855d83a
[ "MIT" ]
null
null
null
src/probnum/random_variables/__init__.py
admdev8/probnum
792b6299bac247cf8b1b5056756f0f078855d83a
[ "MIT" ]
2
2020-12-28T19:37:16.000Z
2020-12-28T19:37:31.000Z
src/probnum/random_variables/__init__.py
admdev8/probnum
792b6299bac247cf8b1b5056756f0f078855d83a
[ "MIT" ]
null
null
null
""" This package implements random variables. Random variables are the primary in- and outputs of probabilistic numerical methods. A generic signature of such methods looks like this: .. highlight:: python .. code-block:: python randvar_out, info = probnum_method(problem, randvar_in, **kwargs) """ from ._dirac import Dirac from ._normal import Normal from ._random_variable import ( ContinuousRandomVariable, DiscreteRandomVariable, RandomVariable, ) from ._scipy_stats import ( WrappedSciPyContinuousRandomVariable, WrappedSciPyDiscreteRandomVariable, WrappedSciPyRandomVariable, ) from ._utils import asrandvar # Public classes and functions. Order is reflected in documentation. __all__ = [ "asrandvar", "RandomVariable", "DiscreteRandomVariable", "ContinuousRandomVariable", "Dirac", "Normal", "WrappedSciPyRandomVariable", "WrappedSciPyDiscreteRandomVariable", "WrappedSciPyContinuousRandomVariable", ] # Set correct module paths. Corrects links and module paths in documentation. RandomVariable.__module__ = "probnum.random_variables" DiscreteRandomVariable.__module__ = "probnum.random_variables" ContinuousRandomVariable.__module__ = "probnum.random_variables" WrappedSciPyRandomVariable.__module__ = "probnum.random_variables" WrappedSciPyDiscreteRandomVariable.__module__ = "probnum.random_variables" WrappedSciPyContinuousRandomVariable.__module__ = "probnum.random_variables" Dirac.__module__ = "probnum.random_variables" Normal.__module__ = "probnum.random_variables" asrandvar.__module__ = "probnum.random_variables"
30.301887
85
0.797011
6fe83234101021db05245c3a1a51c329dc0916b4
6,147
py
Python
test/acceptance/features/steps/generic_testapp.py
multi-arch/service-binding-operator
a92b303d45a06e8c4396ae80721e1cc5b9019e4a
[ "Apache-2.0" ]
null
null
null
test/acceptance/features/steps/generic_testapp.py
multi-arch/service-binding-operator
a92b303d45a06e8c4396ae80721e1cc5b9019e4a
[ "Apache-2.0" ]
null
null
null
test/acceptance/features/steps/generic_testapp.py
multi-arch/service-binding-operator
a92b303d45a06e8c4396ae80721e1cc5b9019e4a
[ "Apache-2.0" ]
null
null
null
from app import App import requests import json import polling2 from behave import step from openshift import Openshift from util import substitute_scenario_id from string import Template
45.198529
160
0.738572
6fe90908102c482823f4162b72dbc1d35bfe2cbb
8,033
py
Python
SKY130_PDK/gen_param.py
ALIGN-analoglayout/ALIGN-pdk-sky130
ffddd848656f09cc03f210d7b44b5ffbd1ab228f
[ "BSD-3-Clause" ]
null
null
null
SKY130_PDK/gen_param.py
ALIGN-analoglayout/ALIGN-pdk-sky130
ffddd848656f09cc03f210d7b44b5ffbd1ab228f
[ "BSD-3-Clause" ]
null
null
null
SKY130_PDK/gen_param.py
ALIGN-analoglayout/ALIGN-pdk-sky130
ffddd848656f09cc03f210d7b44b5ffbd1ab228f
[ "BSD-3-Clause" ]
null
null
null
import json import logging from math import sqrt, floor, ceil, log10 from copy import deepcopy logger = logging.getLogger(__name__)
45.642045
142
0.563675
6fe94897b6016b8d63c8281d624fe928a95dab1f
1,804
py
Python
forcephot/throttles.py
lukeshingles/atlasserver
87c8e437891a1516ac1fadb84d1d9b796dc5a367
[ "MIT" ]
5
2020-11-06T11:55:07.000Z
2021-09-28T22:27:28.000Z
forcephot/throttles.py
lukeshingles/atlasserver
87c8e437891a1516ac1fadb84d1d9b796dc5a367
[ "MIT" ]
21
2020-11-03T13:26:30.000Z
2022-02-18T10:50:52.000Z
forcephot/throttles.py
lukeshingles/atlasserver
87c8e437891a1516ac1fadb84d1d9b796dc5a367
[ "MIT" ]
null
null
null
from rest_framework.throttling import SimpleRateThrottle
34.037736
77
0.644678
6fea6ea2847af9fb33f26ea132b770aa2ffca311
9,206
py
Python
dot_vim/plugged/ultisnips/test/test_SnippetOptions.py
gabefgonc/san-francisco-rice-dotfiles
60ff3539f34ecfff6d7bce895497e2a3805910d4
[ "MIT" ]
10
2020-07-21T21:59:54.000Z
2021-07-19T11:01:47.000Z
dot_vim/plugged/ultisnips/test/test_SnippetOptions.py
gabefgonc/san-francisco-rice-dotfiles
60ff3539f34ecfff6d7bce895497e2a3805910d4
[ "MIT" ]
null
null
null
dot_vim/plugged/ultisnips/test/test_SnippetOptions.py
gabefgonc/san-francisco-rice-dotfiles
60ff3539f34ecfff6d7bce895497e2a3805910d4
[ "MIT" ]
1
2021-01-30T18:17:01.000Z
2021-01-30T18:17:01.000Z
# encoding: utf-8 from test.vim_test_case import VimTestCase as _VimTest from test.constant import * from test.util import running_on_windows # Tests for Bug #691575
25.360882
86
0.647078
6fef2e1b0042f7afa10afa7bd70caee5d7662859
3,119
py
Python
Solver.py
kazemisoroush/JCL
a752e8b445e270dab7597d96956c2c52d53665dc
[ "MIT" ]
null
null
null
Solver.py
kazemisoroush/JCL
a752e8b445e270dab7597d96956c2c52d53665dc
[ "MIT" ]
null
null
null
Solver.py
kazemisoroush/JCL
a752e8b445e270dab7597d96956c2c52d53665dc
[ "MIT" ]
null
null
null
from scipy.optimize import minimize
29.149533
113
0.588971
6ff10fab31eb05859eb44845cd805cd024038463
9,444
py
Python
scope/device/spectra.py
drew-sinha/rpc-scope
268864097b5b7d123a842f216adc446ec6b32d01
[ "MIT" ]
null
null
null
scope/device/spectra.py
drew-sinha/rpc-scope
268864097b5b7d123a842f216adc446ec6b32d01
[ "MIT" ]
null
null
null
scope/device/spectra.py
drew-sinha/rpc-scope
268864097b5b7d123a842f216adc446ec6b32d01
[ "MIT" ]
null
null
null
# This code is licensed under the MIT License (see LICENSE file for details) import threading import time from ..util import smart_serial from ..util import property_device from ..util import state_stack from ..config import scope_configuration from . import iotool LAMP_DAC_COMMANDS = { 'uv': _make_dac_bytes(0x18, 0), 'blue': _make_dac_bytes(0x1A, 0), 'cyan': _make_dac_bytes(0x18, 1), 'teal': _make_dac_bytes(0x1A, 1), 'green_yellow': _make_dac_bytes(0x18, 2), 'red': _make_dac_bytes(0x18, 3) } LAMP_SPECS = { 'uv': (396, 16), 'blue': (434, 22), 'cyan': (481, 22), 'teal': (508, 29), 'green_yellow': (545, 70), 'red': (633, 19) } LAMP_NAMES = set(LAMP_DAC_COMMANDS.keys())
42.927273
159
0.66529
6ff1787c0118af1f7695392c705c973f44490257
352
py
Python
src/rics/utility/perf/__init__.py
rsundqvist/rics
c67ff6703facb3170535dcf173d7e55734cedbc6
[ "MIT" ]
1
2022-02-24T22:12:13.000Z
2022-02-24T22:12:13.000Z
src/rics/utility/perf/__init__.py
rsundqvist/rics
c67ff6703facb3170535dcf173d7e55734cedbc6
[ "MIT" ]
26
2022-02-24T21:08:51.000Z
2022-03-19T19:55:26.000Z
src/rics/utility/perf/__init__.py
rsundqvist/rics
c67ff6703facb3170535dcf173d7e55734cedbc6
[ "MIT" ]
null
null
null
"""Performance testing utility.""" from ._format_perf_counter import format_perf_counter from ._multi_case_timer import MultiCaseTimer from ._util import plot_run, to_dataframe from ._wrappers import run_multivariate_test __all__ = [ "MultiCaseTimer", "run_multivariate_test", "format_perf_counter", "plot_run", "to_dataframe", ]
23.466667
53
0.769886
6ff20bebb27acf09aac86317bb08657cf322d1a8
1,951
py
Python
LinkPrediction/pruning.py
x-zho14/Unified-LTH-GNN
edbb2f9aaa7cb363424dcfcb2ce198cfb66f3d55
[ "MIT" ]
29
2021-02-17T02:46:54.000Z
2022-03-18T02:09:03.000Z
LinkPrediction/pruning.py
x-zho14/Unified-LTH-GNN
edbb2f9aaa7cb363424dcfcb2ce198cfb66f3d55
[ "MIT" ]
1
2021-09-03T13:30:50.000Z
2021-09-03T13:30:50.000Z
LinkPrediction/pruning.py
x-zho14/Unified-LTH-GNN
edbb2f9aaa7cb363424dcfcb2ce198cfb66f3d55
[ "MIT" ]
10
2021-04-01T16:27:03.000Z
2022-03-07T09:20:38.000Z
import numpy as np import torch from sklearn.metrics import roc_auc_score from sklearn.metrics import average_precision_score def get_roc_score(edges_pos, edges_neg, embeddings, adj_sparse): "from https://github.com/tkipf/gae" score_matrix = np.dot(embeddings, embeddings.T) # Store positive edge predictions, actual values preds_pos = [] pos = [] for edge in edges_pos: preds_pos.append(sigmoid(score_matrix[edge[0], edge[1]])) # predicted score pos.append(adj_sparse[edge[0], edge[1]]) # actual value (1 for positive) # Store negative edge predictions, actual values preds_neg = [] neg = [] for edge in edges_neg: preds_neg.append(sigmoid(score_matrix[edge[0], edge[1]])) # predicted score neg.append(adj_sparse[edge[0], edge[1]]) # actual value (0 for negative) # Calculate scores preds_all = np.hstack([preds_pos, preds_neg]) labels_all = np.hstack([np.ones(len(preds_pos)), np.zeros(len(preds_neg))]) #print(preds_all, labels_all ) roc_score = roc_auc_score(labels_all, preds_all) ap_score = average_precision_score(labels_all, preds_all) return roc_score, ap_score
34.839286
104
0.672476
6ff236eea364203b4294e15e6410629f2aeb3886
3,143
py
Python
imap_wrapper.py
tbrownaw/rss-imap
41d930d778017a9d60feed1688f9f2c7a94b94a6
[ "MIT" ]
2
2016-09-28T19:44:53.000Z
2021-09-17T11:36:24.000Z
imap_wrapper.py
tbrownaw/rss-imap
41d930d778017a9d60feed1688f9f2c7a94b94a6
[ "MIT" ]
null
null
null
imap_wrapper.py
tbrownaw/rss-imap
41d930d778017a9d60feed1688f9f2c7a94b94a6
[ "MIT" ]
null
null
null
import email import logging import re from imapclient import IMAPClient
34.538462
81
0.610563
6ff24a30aea978a6baf63da8c2c0d8819e5f801c
19
py
Python
beeline/version.py
noam-stein/beeline-python
a5ae7b30d9abebc681524f1087c404fb2e2b915f
[ "Apache-2.0" ]
null
null
null
beeline/version.py
noam-stein/beeline-python
a5ae7b30d9abebc681524f1087c404fb2e2b915f
[ "Apache-2.0" ]
null
null
null
beeline/version.py
noam-stein/beeline-python
a5ae7b30d9abebc681524f1087c404fb2e2b915f
[ "Apache-2.0" ]
null
null
null
VERSION = '2.11.2'
9.5
18
0.578947
6ff5a9c769828d3ebb1466ef2f609d93dfafa30f
2,527
py
Python
genie/seg.py
karawoo/Genie
d39451655ec3632df6002c1d73b17dacba2a8720
[ "MIT" ]
null
null
null
genie/seg.py
karawoo/Genie
d39451655ec3632df6002c1d73b17dacba2a8720
[ "MIT" ]
null
null
null
genie/seg.py
karawoo/Genie
d39451655ec3632df6002c1d73b17dacba2a8720
[ "MIT" ]
1
2022-01-20T16:33:19.000Z
2022-01-20T16:33:19.000Z
import logging import os import pandas as pd from .example_filetype_format import FileTypeFormat from . import process_functions logger = logging.getLogger(__name__)
40.111111
143
0.61852
6ff60de2cd7ad626ba0327a1b10d9c7e29a27101
3,150
py
Python
serve/api/predict.py
HalleyYoung/musicautobot
075afba70a57ebacfcd8d2bf9dc178a93c05a116
[ "MIT" ]
402
2019-07-31T00:37:10.000Z
2022-03-27T22:21:29.000Z
serve/api/predict.py
HalleyYoung/musicautobot
075afba70a57ebacfcd8d2bf9dc178a93c05a116
[ "MIT" ]
26
2019-08-20T13:44:30.000Z
2022-01-27T10:42:28.000Z
serve/api/predict.py
HalleyYoung/musicautobot
075afba70a57ebacfcd8d2bf9dc178a93c05a116
[ "MIT" ]
81
2019-08-14T06:55:55.000Z
2022-03-19T09:49:15.000Z
import sys from . import app sys.path.append(str(app.config['LIB_PATH'])) from musicautobot.music_transformer import * from musicautobot.config import * from flask import Response, send_from_directory, send_file, request, jsonify from .save import to_s3 import torch import traceback torch.set_num_threads(4) data = load_data(app.config['DATA_PATH'], app.config['DATA_SAVE_NAME'], num_workers=1) learn = music_model_learner(data, pretrained_path=app.config['MUSIC_MODEL_PATH']) if torch.cuda.is_available(): learn.model.cuda() # learn.to_fp16(loss_scale=512) # fp16 not supported for cpu - https://github.com/pytorch/pytorch/issues/17699 # @app.route('/midi/song/<path:sid>') # def get_song_midi(sid): # return send_from_directory(file_path/data_dir, htlist[sid]['midi'], mimetype='audio/midi')
35
113
0.672381
6ff6a8b26ae79b9bbc49d8449424fa04eace814f
1,086
py
Python
tests/test_user.py
meisnate12/trakt.py
37da6f64a4f82c6600a61e388458190590f86f29
[ "MIT" ]
147
2015-01-07T11:27:26.000Z
2022-02-21T19:57:44.000Z
tests/test_user.py
meisnate12/trakt.py
37da6f64a4f82c6600a61e388458190590f86f29
[ "MIT" ]
90
2015-01-11T14:38:22.000Z
2021-10-03T12:18:13.000Z
tests/test_user.py
meisnate12/trakt.py
37da6f64a4f82c6600a61e388458190590f86f29
[ "MIT" ]
61
2015-01-09T12:32:09.000Z
2022-02-03T00:50:36.000Z
from __future__ import absolute_import, division, print_function from tests.core import mock from trakt import Trakt from httmock import HTTMock import pytest
22.163265
64
0.601289
6ff6e195cda0b39ff8fca0cbb3168fe50f6be0ec
12,983
py
Python
main.py
mohamed-seyam/Image-Mixer-
f2a2c3d5808e1c8485c851f3a27cbed7249ad073
[ "MIT" ]
null
null
null
main.py
mohamed-seyam/Image-Mixer-
f2a2c3d5808e1c8485c851f3a27cbed7249ad073
[ "MIT" ]
null
null
null
main.py
mohamed-seyam/Image-Mixer-
f2a2c3d5808e1c8485c851f3a27cbed7249ad073
[ "MIT" ]
null
null
null
import sys import PyQt5.QtWidgets as qtw import PyQt5.QtCore as qtc from Image import Image from main_layout import Ui_MainWindow import logging import os logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) formatter = logging.Formatter('%(levelname)s:%(name)s:%(asctime)s - %(message)s') file_handler = logging.FileHandler('log') file_handler.setLevel(logging.INFO) file_handler.setFormatter(formatter) logger.addHandler(file_handler) if __name__ == '__main__': main_window()
47.907749
303
0.632828
6ff8202663f6030215b86bce2a40c9dd2290ed53
1,029
py
Python
main_project/tienda_lissa_app/forms.py
NahuelA/TiendaLissa_Django
72599e7cb20e1ebe346b484836e2200b69389281
[ "MIT" ]
null
null
null
main_project/tienda_lissa_app/forms.py
NahuelA/TiendaLissa_Django
72599e7cb20e1ebe346b484836e2200b69389281
[ "MIT" ]
null
null
null
main_project/tienda_lissa_app/forms.py
NahuelA/TiendaLissa_Django
72599e7cb20e1ebe346b484836e2200b69389281
[ "MIT" ]
null
null
null
from django import forms # Form for create sales
42.875
85
0.543246
6ff8a222216fa1ac81945884dc109adff1cb0094
2,159
py
Python
src/vargenpath/pipeline.py
AldisiRana/VarGenPath
ff7285f5165855f8427de9ec30ade2a8fb1f0ca3
[ "MIT" ]
null
null
null
src/vargenpath/pipeline.py
AldisiRana/VarGenPath
ff7285f5165855f8427de9ec30ade2a8fb1f0ca3
[ "MIT" ]
3
2019-11-11T12:34:03.000Z
2019-11-13T13:37:40.000Z
src/vargenpath/pipeline.py
AldisiRana/VarGenPath
ff7285f5165855f8427de9ec30ade2a8fb1f0ca3
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """Pipeline for VarGenPath""" from typing import Optional from .constants import LINKSET_PATH, FILE_TYPES from .utils import ( get_cytoscape_connection, get_associated_genes, var_genes_network, extend_vargen_network, save_session, save_image, save_network ) def get_vargenpath_network( *, variant_list: list, network_name: Optional[str] = 'VarGenPath network', linkset_path: Optional[str] = LINKSET_PATH, session_path: Optional[str] = None, image_path: Optional[str] = None, extend_network: bool = True, image_type: Optional[str] = 'svg', network_path: Optional[str] = None, network_file_path: Optional[str] = 'cyjs', ) -> dict: """ Pipeline for creating vargenpath network. :param network_file_path: the type of network file to be saved. :param network_path: if input path, the cytoscape network will be saved to this path. :param variant_list: list of variants. :param network_name: the name of the network. :param linkset_path: the path to the linkset to extend network. :param session_path: if input path, the cytoscape session will be saved to this path. :param image_path: if input path, the image of the network will be saved to this path. :param extend_network: if true, the network will be extended. :param image_type: the type of the image to be saved. :return: cytoscape network """ try: cy = get_cytoscape_connection() except Exception: raise Exception('Uh-oh! Make sure that cytoscape is open then try again.') vargen_df = get_associated_genes(variant_list) network = var_genes_network(variants_genes_df=vargen_df, client=cy, network_name=network_name) if extend_network: network = extend_vargen_network(linkset_path, client=cy) if session_path is not None: save_session(session_file=session_path, client=cy) if image_path is not None: save_image(network_image=image_path, image_type=FILE_TYPES[image_type]) if network_path is not None: save_network(network_path=network_path, file_type=FILE_TYPES[network_file_path]) return network
39.981481
119
0.727652
6ff8f022a6fe57527d82ea4903beacbf84f7acb1
1,485
py
Python
ott/examples/fairness/models.py
MUCDK/ott
f6c79d964d275aed12a7f9b66aa2b118423dff71
[ "Apache-2.0" ]
232
2021-01-18T15:05:20.000Z
2022-03-26T01:22:01.000Z
ott/examples/fairness/models.py
RamonYeung/ott
800de80d6b2a0faf4fc7977b0673674468c70e3f
[ "Apache-2.0" ]
20
2021-02-25T04:38:34.000Z
2022-01-24T16:21:25.000Z
ott/examples/fairness/models.py
RamonYeung/ott
800de80d6b2a0faf4fc7977b0673674468c70e3f
[ "Apache-2.0" ]
29
2021-02-25T04:40:25.000Z
2022-01-29T18:31:17.000Z
# coding=utf-8 # Copyright 2021 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. """A model for to embed structured features.""" from typing import Any, Tuple import flax.linen as nn import jax.numpy as jnp
27.5
74
0.676768
6ff9bf08b760f07cf353cf2bb85e608d4d99b8bc
699
py
Python
src/create_hbjsons.py
karim-daw/pollination-app
ed87f3dbc2d93d25568707d6a6ad0ee35c5109b8
[ "MIT" ]
null
null
null
src/create_hbjsons.py
karim-daw/pollination-app
ed87f3dbc2d93d25568707d6a6ad0ee35c5109b8
[ "MIT" ]
null
null
null
src/create_hbjsons.py
karim-daw/pollination-app
ed87f3dbc2d93d25568707d6a6ad0ee35c5109b8
[ "MIT" ]
null
null
null
from models import shoe_box # run if __name__ == "__main__": # create models createHBjsons()
19.416667
76
0.53505
6ffae9b25573e5f7348c89e03b62b498cbca2ea9
184
py
Python
reikna/core/__init__.py
ringw/reikna
0f27f86e35a9f06405de2d99580f766a1b504562
[ "MIT" ]
122
2015-05-01T12:42:34.000Z
2021-09-30T22:47:59.000Z
lib/python/reikna-0.7.5/reikna/core/__init__.py
voxie-viewer/voxie
d2b5e6760519782e9ef2e51f5322a3baa0cb1198
[ "MIT" ]
42
2015-05-04T16:55:47.000Z
2021-09-18T04:53:34.000Z
lib/python/reikna-0.7.5/reikna/core/__init__.py
voxie-viewer/voxie
d2b5e6760519782e9ef2e51f5322a3baa0cb1198
[ "MIT" ]
14
2015-05-01T19:22:52.000Z
2021-09-30T22:48:03.000Z
from reikna.core.signature import Type, Annotation, Parameter, Signature from reikna.core.computation import Computation from reikna.core.transformation import Transformation, Indices
46
72
0.858696
6ffbf82ddb4fd7b31865d27adb16c802d9e91417
1,234
py
Python
docs/setup/mysite/models/__init__.py
pauleveritt/pyramid_sqltraversal
1853b3b30fc9bdd453ce5c74b6a67668b21c5321
[ "MIT" ]
6
2015-10-21T20:39:42.000Z
2016-09-03T15:37:28.000Z
docs/setup/mysite/models/__init__.py
pauleveritt/pyramid_sqltraversal
1853b3b30fc9bdd453ce5c74b6a67668b21c5321
[ "MIT" ]
1
2015-11-30T19:18:29.000Z
2015-12-01T08:23:08.000Z
docs/setup/mysite/models/__init__.py
pauleveritt/pyramid_sqltraversal
1853b3b30fc9bdd453ce5c74b6a67668b21c5321
[ "MIT" ]
null
null
null
from sqlalchemy import engine_from_config from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker from sqlalchemy.schema import MetaData import zope.sqlalchemy from .node import Node NAMING_CONVENTION = { "ix": 'ix_%(column_0_label)s', "uq": "uq_%(table_name)s_%(column_0_name)s", "ck": "ck_%(table_name)s_%(constraint_name)s", "fk": "fk_%(table_name)s_%(column_0_name)s_%(referred_table_name)s", "pk": "pk_%(table_name)s" } metadata = MetaData(naming_convention=NAMING_CONVENTION) Base = declarative_base(metadata=metadata)
27.422222
72
0.723663
6ffc37d2645887ce4dd7940f03465b3689f39751
458
py
Python
nngen/onnx/shape.py
RyusukeYamano/nngen
9ed1f7fb83908794aa94d70287d89545d45fe875
[ "Apache-2.0" ]
207
2019-11-12T11:42:25.000Z
2022-03-20T20:32:17.000Z
nngen/onnx/shape.py
RyusukeYamano/nngen
9ed1f7fb83908794aa94d70287d89545d45fe875
[ "Apache-2.0" ]
31
2019-11-25T07:33:30.000Z
2022-03-17T12:34:34.000Z
nngen/onnx/shape.py
RyusukeYamano/nngen
9ed1f7fb83908794aa94d70287d89545d45fe875
[ "Apache-2.0" ]
29
2019-11-07T02:25:48.000Z
2022-03-12T16:22:57.000Z
from __future__ import absolute_import from __future__ import print_function from __future__ import division
28.625
85
0.713974
6fff99cc890883af4358d405c2662b44fb123105
17,072
py
Python
nales/NDS/interfaces.py
Jojain/Nales
dc1073967ba1a8c5bbc226dbfe7b2fb8afd44bd9
[ "MIT" ]
5
2022-03-07T23:21:42.000Z
2022-03-29T17:40:36.000Z
nales/NDS/interfaces.py
Jojain/Nales
dc1073967ba1a8c5bbc226dbfe7b2fb8afd44bd9
[ "MIT" ]
3
2022-03-29T17:33:27.000Z
2022-03-29T17:40:10.000Z
nales/NDS/interfaces.py
Jojain/Nales
dc1073967ba1a8c5bbc226dbfe7b2fb8afd44bd9
[ "MIT" ]
null
null
null
import typing from typing import ( Any, Callable, Dict, Iterable, List, Literal, Optional, Set, Tuple, Union, ) from ncadquery import Workplane from OCP.Quantity import Quantity_NameOfColor from OCP.TCollection import TCollection_ExtendedString from OCP.TDataStd import TDataStd_Name from OCP.TDF import TDF_Label, TDF_TagSource from OCP.TNaming import TNaming_Builder, TNaming_NamedShape from OCP.TopoDS import TopoDS_Shape from OCP.TPrsStd import TPrsStd_AISPresentation from PyQt5.QtCore import QPersistentModelIndex, Qt from nales.nales_cq_impl import NALES_TYPES, CQMethodCall, Part from nales.utils import TypeChecker from nales.widgets.msg_boxs import StdErrorMsgBox
30.594982
126
0.606666
b501613aec75d3cca56c1a86620e64aefbb4d375
5,134
py
Python
plane_1.0/plane/hero.py
misaka46/Aircraft-war
f83cdc5237c01889d109c32b1e27aaaf2c118b94
[ "MIT" ]
null
null
null
plane_1.0/plane/hero.py
misaka46/Aircraft-war
f83cdc5237c01889d109c32b1e27aaaf2c118b94
[ "MIT" ]
null
null
null
plane_1.0/plane/hero.py
misaka46/Aircraft-war
f83cdc5237c01889d109c32b1e27aaaf2c118b94
[ "MIT" ]
null
null
null
from flyingObject import FlyingObject from bullet import Bullet import random
31.304878
110
0.494351
b5017203cb6c1ccd2ec216b379d968a6634173ea
21,118
py
Python
chip9-emulator/emulator.py
Quphoria/CHIP9
1ead51ea717e30e927f9b2b811fadd0b0571d354
[ "MIT" ]
1
2021-12-12T21:52:27.000Z
2021-12-12T21:52:27.000Z
chip9-emulator/emulator.py
Quphoria/CHIP9
1ead51ea717e30e927f9b2b811fadd0b0571d354
[ "MIT" ]
null
null
null
chip9-emulator/emulator.py
Quphoria/CHIP9
1ead51ea717e30e927f9b2b811fadd0b0571d354
[ "MIT" ]
null
null
null
import sys import pygame as pg import numpy as np import random import time pic = np.zeros(shape=(128,64)) width = 128 height = 64 refresh_rate = 60 interval = 1 / refresh_rate bootrom_file = "bootrom0" rom_file = "rom" # rom_file = "hello_world" debug = False pg.display.init() display = pg.display.set_mode((width*4, height*4), flags=0, depth=8) screen = pg.Surface((width, height), flags=0, depth=8) pg.transform.scale(screen, (width*4, height*4), display) screen_clear() # screen_draw_line(0,0,0b10101011) # input() ONE_REG = reg() ONE_REG.value = 1 FL = Flags() halt = False A = reg() B = reg() C = reg() D = reg() E = reg() H = reg() L = reg() BC = Dreg(B, C) DE = Dreg(D, E) HL = Dreg(H, L) #E.value = 0x1 # Randomness loop PC = regPC() SP = regSP() memory = [] jumped = False print("RESERVING MEMORY...") for i in range(0x10000): memory.append(memByte()) print("MEMORY RESERVED.") print("LOADING MEMORY...") f = open(bootrom_file, "rb") rom_data = f.read() f.close() for i in range(len(rom_data)): memory[i+0x0].value = rom_data[i] f = open(rom_file, "rb") rom_data = f.read() f.close() for i in range(len(rom_data)): memory[i+0x597].value = rom_data[i] print("MEMORY LOADED.") MOV_REGISTERS = [B, C, D, E, H, L, HL, A] MOVB_OPCODES = [0x09, 0x19, 0x29, 0x39, 0x49, 0x59, 0x69, 0x79] MOVC_OPCODES = [0x99, 0x99, 0xA9, 0xB9, 0xC9, 0xD9, 0xE9, 0xF9] MOVD_OPCODES = [0x0A, 0x1A, 0x2A, 0x3A, 0x4A, 0x5A, 0x6A, 0x7A] MOVE_OPCODES = [0x8A, 0x9A, 0xAA, 0xBA, 0xCA, 0xDA, 0xEA, 0xFA] MOVH_OPCODES = [0x0B, 0x1B, 0x2B, 0x3B, 0x4B, 0x5B, 0x6B, 0x7B] MOVL_OPCODES = [0x8B, 0x9B, 0xAB, 0xBB, 0xCB, 0xDB, 0xEB, 0xFB] MOVMHL_OPCODES = [0x0C, 0x1C, 0x2C, 0x3C, 0x4C, 0x5C, 0x6C, 0x7C] MOVA_OPCODES = [0x8C, 0x9C, 0xAC, 0xBC, 0xCC, 0xDC, 0xEC, 0xFC] screen_update() last_update = time.time() while not halt: b_up = memory[PC.value].readUpper() b_down = memory[PC.value].readLower() b_val = memory[PC.value].value jumped = False if time.time() > last_update + interval: screen_update() last_update = time.time() # Handle pygame events for event in pg.event.get(): # print("EVENT:",event.type) # input() pass if debug: pass#input() if debug or False: print(hex(PC.value), hex(b_val)) # if b_val in [0x86, 0x96, 0xA6, 0xB6, 0xC6, 0xD6, 0xE6, 0xF6]: # print("CMP R") # input() # if b_val == 0xF7: # print("CMPI") # input() # HCF (HALT) if b_val == 0x6C: halt = True # LDI R, xx if b_val == 0x20: LDI(B) elif b_val == 0x30: LDI(C) elif b_val == 0x40: LDI(D) elif b_val == 0x50: LDI(E) elif b_val == 0x60: LDI(H) elif b_val == 0x70: LDI(L) elif b_val == 0x80: LDI(HL, mem=True) elif b_val == 0x90: LDI(A) # LDX RR, xxyy elif b_val == 0x21: LDX(BC) elif b_val == 0x31: LDX(DE) elif b_val == 0x41: LDX(HL) elif b_val == 0x22: LDX(SP) # PUSH R elif b_val == 0x81: PUSH_R(B) elif b_val == 0x91: PUSH_R(C) elif b_val == 0xA1: PUSH_R(D) elif b_val == 0xB1: PUSH_R(E) elif b_val == 0xC1: PUSH_R(H) elif b_val == 0xD1: PUSH_R(L) elif b_val == 0xC0: PUSH_R(HL, mem=True) elif b_val == 0xD0: PUSH_R(A) # PUSH RR elif b_val == 0x51: PUSH_RR(BC) elif b_val == 0x61: PUSH_RR(DE) elif b_val == 0x71: PUSH_RR(HL) # POP R elif b_val == 0x82: POP_R(B) elif b_val == 0x92: POP_R(C) elif b_val == 0xA2: POP_R(D) elif b_val == 0xB2: POP_R(E) elif b_val == 0xC2: POP_R(H) elif b_val == 0xD2: POP_R(L) elif b_val == 0xC3: POP_R(HL, mem=True) elif b_val == 0xD3: POP_R(A) # POP RR elif b_val == 0x52: POP_RR(BC) elif b_val == 0x62: POP_RR(DE) elif b_val == 0x72: POP_RR(HL) # MOV R1, R2 elif b_val in MOVB_OPCODES: MOV(B, MOVB_OPCODES.index(b_val)) elif b_val in MOVC_OPCODES: MOV(C, MOVC_OPCODES.index(b_val)) elif b_val in MOVD_OPCODES: MOV(D, MOVD_OPCODES.index(b_val)) elif b_val in MOVE_OPCODES: MOV(E, MOVE_OPCODES.index(b_val)) elif b_val in MOVH_OPCODES: MOV(H, MOVH_OPCODES.index(b_val)) elif b_val in MOVL_OPCODES: MOV(L, MOVL_OPCODES.index(b_val)) elif b_val in MOVMHL_OPCODES: MOV(HL, MOVMHL_OPCODES.index(b_val), mem=True) elif b_val in MOVA_OPCODES: MOV(A, MOVA_OPCODES.index(b_val)) # MOV RR1, RR2 elif b_val == 0xED: MOV_RR(HL, BC) elif b_val == 0xFD: MOV_RR(HL, DE) # CLRFLAG elif b_val == 0x08: FL.clearFlags() # SETFLAG f, x elif b_val == 0x18: FL.setZero() elif b_val == 0x28: FL.clearZero() elif b_val == 0x38: FL.setNeg() elif b_val == 0x48: FL.clearNeg() elif b_val == 0x58: FL.setHalf() elif b_val == 0x68: FL.clearHalf() elif b_val == 0x78: FL.setCarry() elif b_val == 0x88: FL.clearCarry() # ADD R elif b_val == 0x04: ADD_R(B) elif b_val == 0x14: ADD_R(C) elif b_val == 0x24: ADD_R(D) elif b_val == 0x34: ADD_R(E) elif b_val == 0x44: ADD_R(H) elif b_val == 0x54: ADD_R(L) elif b_val == 0x64: ADD_R(HL, mem=True) elif b_val == 0x74: ADD_R(A) # ADDI xx elif b_val == 0xA7: PC.inc() value = ADD_8(A.value, memory[PC.value].value) A.value = value # ADDX RR elif b_val == 0x83: ADDX_RR(BC) elif b_val == 0x93: ADDX_RR(DE) elif b_val == 0xA3: ADDX_RR(HL) # SUB R | CMP R elif b_val == 0x84 or b_val == 0x86: SUB_R(B, b_val == 0x86) elif b_val == 0x94 or b_val == 0x96: SUB_R(C, b_val == 0x96) elif b_val == 0xA4 or b_val == 0xA6: SUB_R(D, b_val == 0xA6) elif b_val == 0xB4 or b_val == 0xB6: SUB_R(E, b_val == 0xB6) elif b_val == 0xC4 or b_val == 0xC6: SUB_R(H, b_val == 0xC6) elif b_val == 0xD4 or b_val == 0xD6: SUB_R(L, b_val == 0xD6) elif b_val == 0xE4 or b_val == 0xE6: SUB_R(HL, b_val == 0xE6, mem=True) elif b_val == 0xF4 or b_val == 0xF6: SUB_R(A, b_val == 0xF6) # SUBI xx | CMPI xx elif b_val == 0xB7 or b_val == 0xF7: PC.inc() value = SUB_8(A.value, memory[PC.value].value) if b_val == 0xB7: # SUBI xx A.value = value # INC R elif b_val == 0x03: INC(B) elif b_val == 0x13: INC(C) elif b_val == 0x23: INC(D) elif b_val == 0x33: INC(E) elif b_val == 0x43: INC(H) elif b_val == 0x53: INC(L) elif b_val == 0x63: INC(HL, mem=True) elif b_val == 0x73: INC(A) # INX RR elif b_val == 0xA8: BC.getvalue() BC.value += 1 BC.value & 0xffff BC.setvalue() elif b_val == 0xB8: DE.getvalue() DE.value += 1 DE.value & 0xffff DE.setvalue() elif b_val == 0xC8: HL.getvalue() HL.value += 1 HL.value & 0xffff HL.setvalue() # DEC R elif b_val == 0x07: DEC(B) elif b_val == 0x17: DEC(C) elif b_val == 0x27: DEC(D) elif b_val == 0x37: DEC(E) elif b_val == 0x47: DEC(H) elif b_val == 0x57: DEC(L) elif b_val == 0x67: DEC(HL, mem=True) elif b_val == 0x77: DEC(A) # AND R elif b_val == 0x05: AND_R(B) elif b_val == 0x15: AND_R(C) elif b_val == 0x25: AND_R(D) elif b_val == 0x35: AND_R(E) elif b_val == 0x45: AND_R(H) elif b_val == 0x55: AND_R(L) elif b_val == 0x65: AND_R(HL, mem=True) elif b_val == 0x75: AND_R(A) # ANDI xx elif b_val == 0xC7: PC.inc() value = AND_8(memory[PC.value].value, A.value) A.value = value # OR R elif b_val == 0x85: OR_R(B) elif b_val == 0x95: OR_R(C) elif b_val == 0xA5: OR_R(D) elif b_val == 0xB5: OR_R(E) elif b_val == 0xC5: OR_R(H) elif b_val == 0xD5: OR_R(L) elif b_val == 0xE5: OR_R(HL, mem=True) elif b_val == 0xF5: OR_R(A) # ORI xx elif b_val == 0xD7: PC.inc() value = OR_8(memory[PC.value].value, A.value) A.value = value # XOR R elif b_val == 0x06: XOR_R(B) elif b_val == 0x16: XOR_R(C) elif b_val == 0x26: XOR_R(D) elif b_val == 0x36: XOR_R(E) elif b_val == 0x46: XOR_R(H) elif b_val == 0x56: XOR_R(L) elif b_val == 0x66: XOR_R(HL, mem=True) elif b_val == 0x76: XOR_R(A) # XORI xx elif b_val == 0xE7: PC.inc() value = XOR_8(memory[PC.value].value, A.value) A.value = value # CMPS R elif b_val == 0x0D: CMPS(B) elif b_val == 0x1D: CMPS(C) elif b_val == 0x2D: CMPS(D) elif b_val == 0x3D: CMPS(E) elif b_val == 0x4D: CMPS(H) elif b_val == 0x5D: CMPS(L) elif b_val == 0x6D: CMPS(HL, mem=True) elif b_val == 0x7D: CMPS(A) # SIN elif b_val == 0xE0: A.value = ord(sys.stdin.buffer.read(1)) & 0xff pass # SOUT elif b_val == 0xE1: print(chr(A.value),end="",flush=True) if A.value == 7: print("[BELL]") pass # CLRSCR elif b_val == 0xF0: screen_clear() # DRAW elif b_val == 0xF1: x = C.value if x & 0b10000000: x = - ((0x100 - x) & 0xff) y = B.value if y & 0b10000000: y = - ((0x100 - y) & 0xff) screen_draw_line(x, y, A.value & 0xff) # JMP xxyy elif b_val == 0x0F: JUMP() # JMPcc xxyy elif b_val == 0x1F: if FL.z: JUMP() else: PC.inc(2) elif b_val == 0x2F: if not FL.z: JUMP() else: PC.inc(2) elif b_val == 0x3F: if FL.n: JUMP() else: PC.inc(2) elif b_val == 0x4F: if not FL.n: JUMP() else: PC.inc(2) elif b_val == 0x5F: if FL.h: JUMP() elif b_val == 0x6F: if not FL.h: JUMP() else: PC.inc(2) elif b_val == 0x7F: if FL.c: JUMP() else: PC.inc(2) elif b_val == 0x8F: if not FL.c: JUMP() else: PC.inc(2) # JMP xx elif b_val == 0x9F: REL_JUMP() # JMPcc xx elif b_val == 0xAF: if FL.z: REL_JUMP() else: PC.inc() elif b_val == 0xBF: if not FL.z: REL_JUMP() else: PC.inc() elif b_val == 0xCF: if FL.n: REL_JUMP() else: PC.inc() elif b_val == 0xDF: if not FL.n: REL_JUMP() else: PC.inc() elif b_val == 0xEF: if FL.h: REL_JUMP() else: PC.inc() elif b_val == 0xFF: if not FL.h: REL_JUMP() else: PC.inc() elif b_val == 0xEE: if FL.c: REL_JUMP() else: PC.inc() elif b_val == 0xFE: if not FL.c: REL_JUMP() else: PC.inc() # CALL xxyy elif b_val == 0x1E: memory[SP.value].value = (PC.value+3) & 0xff memory[SP.value + 1].value = (PC.value+3) >> 8 SP.dec() JUMP() # RET elif b_val == 0x0E: SP.inc() PC.value = memory[SP.value].value + (memory[SP.value + 1].value << 8) jumped = True # NOP elif b_val == 0x00: pass else: pass print("UNKNOWN:",hex(b_val),"@",hex(PC.value)) if debug: BC.getvalue() DE.getvalue() HL.getvalue() print("A:",hex(A.value),"B:",hex(B.value),"C:",hex(C.value),"D:",hex(D.value),"E:",hex(E.value),"H:",hex(H.value), "L:",hex(L.value),"BC:",hex(BC.value),"DE:",hex(DE.value),"HL:",hex(HL.value),"PC:",hex(PC.value),"SP:",hex(SP.value)) if not jumped: PC.inc() else: pass #print("JUMPED")
23.997727
134
0.516479
b501d27bf56c98bbd366b6f8bf399a623a2e87f1
1,423
py
Python
Burp/lib/data.py
wisdark/HUNT
9b128913f62e01ed9e82db1e1eee79e4b88385fb
[ "Apache-2.0" ]
1,628
2017-08-07T17:27:17.000Z
2022-03-28T18:43:34.000Z
Burp/lib/data.py
wisdark/HUNT
9b128913f62e01ed9e82db1e1eee79e4b88385fb
[ "Apache-2.0" ]
48
2017-08-08T11:56:48.000Z
2021-04-08T18:01:31.000Z
Burp/lib/data.py
wisdark/HUNT
9b128913f62e01ed9e82db1e1eee79e4b88385fb
[ "Apache-2.0" ]
328
2017-08-08T05:12:48.000Z
2022-03-31T15:15:20.000Z
from __future__ import print_function import json import os
26.849057
99
0.595924
b502452c7fbc49bc12b35532d369cf96f4db27dd
851
py
Python
twisted/test/stdio_test_write.py
engdan77/otis_app
6c6ea8da47d580e91a794663338572cf2a7368b6
[ "MIT" ]
null
null
null
twisted/test/stdio_test_write.py
engdan77/otis_app
6c6ea8da47d580e91a794663338572cf2a7368b6
[ "MIT" ]
1
2022-03-04T17:40:22.000Z
2022-03-04T17:40:22.000Z
twisted/test/stdio_test_write.py
cpdean/twisted
e502df17e0704de42dc38b6e171ebbc7daf52c8a
[ "Unlicense", "MIT" ]
null
null
null
# -*- test-case-name: twisted.test.test_stdio.StandardInputOutputTests.test_write -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Main program for the child process run by L{twisted.test.test_stdio.StandardInputOutputTests.test_write} to test that ITransport.write() works for process transports. """ __import__('_preamble') import sys from twisted.internet import stdio, protocol from twisted.python import reflect if __name__ == '__main__': reflect.namedAny(sys.argv[1]).install() from twisted.internet import reactor stdio.StandardIO(WriteChild()) reactor.run()
25.787879
85
0.72738
b504bcac5479aa4c47a0573d3779bba648bf5ec4
4,133
py
Python
pyweb/overload.py
DrDaveD/wlcg-wpad
9947173b770c385376e02763b1462911b0af6d7c
[ "BSD-3-Clause" ]
null
null
null
pyweb/overload.py
DrDaveD/wlcg-wpad
9947173b770c385376e02763b1462911b0af6d7c
[ "BSD-3-Clause" ]
2
2016-06-24T17:24:19.000Z
2020-10-23T12:33:03.000Z
pyweb/overload.py
DrDaveD/wlcg-wpad
9947173b770c385376e02763b1462911b0af6d7c
[ "BSD-3-Clause" ]
1
2020-09-07T11:21:53.000Z
2020-09-07T11:21:53.000Z
# calculate the load on each org import threading # cannot use from wpad_dispatch here, have to import whole module, # because of circular dependency import wpad_dispatch from wpad_utils import * from wlcg_wpad import getiporg orgcleanminutes = 5 orgcleantime = 0 # Minute records keep track of the number of requests in each minute orgdata = {} # lock for adding, deleting, and looking up an org orgdatalock = threading.Lock() # return triple of org name, minutes remaining in an overload, # and percent of limit in the last minutes being tracked
37.917431
127
0.605129
b50625d78235e9ce3f4c2da0638ea06afe91b30f
865
py
Python
test/bulk_insert.py
jfcarter2358/Ceres
cdfd92f9b1a71345a0b634722bc6c2be7f78cd91
[ "MIT" ]
null
null
null
test/bulk_insert.py
jfcarter2358/Ceres
cdfd92f9b1a71345a0b634722bc6c2be7f78cd91
[ "MIT" ]
null
null
null
test/bulk_insert.py
jfcarter2358/Ceres
cdfd92f9b1a71345a0b634722bc6c2be7f78cd91
[ "MIT" ]
null
null
null
import requests from datetime import datetime import time headers = { 'Content-Type': 'application/json' } with open('test/logs.txt', 'r') as f: logs = f.read().split('\n') levels = ['INFO', 'WARN', 'DEBUG', 'ERROR', 'TRACE'] messages = [] for i in range(0, len(logs)): if i % 100 == 0: print('{} of {}'.format(i, len(logs))) data = { 'messages': messages } requests.post('http://localhost:9090/insert', json=data, headers=headers) messages = [] now = datetime.now() message = { 'year': now.year, 'month': now.month, 'day': now.day, 'hour': now.hour, 'minute': now.minute, 'second': now.second, 'service': 'foobar', 'message': logs[i], 'level': levels[i % 5] } time.sleep(0.001) messages.append(message)
22.763158
81
0.528324
b50682e6cffc6dbeabe21d64aa2a3d1319871a0b
1,282
py
Python
tests/test_jsons.py
jrinks/greater-chicago-food-despository
67255aec807a1bb026d8ae2172b2bf353bb2cc46
[ "MIT" ]
null
null
null
tests/test_jsons.py
jrinks/greater-chicago-food-despository
67255aec807a1bb026d8ae2172b2bf353bb2cc46
[ "MIT" ]
null
null
null
tests/test_jsons.py
jrinks/greater-chicago-food-despository
67255aec807a1bb026d8ae2172b2bf353bb2cc46
[ "MIT" ]
null
null
null
import os import sys sys.path.append(os.path.abspath('')) # Raises linting error because not at top of file # Not sure how to resolve this with the pathing from src import uploadJson # noqa: E402 import src.config as config # noqa: E402 # Taking out of commission until new geojson format requested developed # def test_main(): # from src import main # import json # import geojson # #from src import main # main_dict = main.main(['county']) # for v in main_dict.values(): # v_str = json.dumps(v) # v_geojson = geojson.loads(v_str) # assert v_geojson.is_valid == True
28.488889
71
0.670047
b5068529d2a14e7fea802599be5ae03e8acda2e9
12,939
py
Python
tetris.py
AkshayRaul/Python-Scripts
52f1f9d329634830507fa7eeb885cb8d9c8afd88
[ "MIT" ]
null
null
null
tetris.py
AkshayRaul/Python-Scripts
52f1f9d329634830507fa7eeb885cb8d9c8afd88
[ "MIT" ]
null
null
null
tetris.py
AkshayRaul/Python-Scripts
52f1f9d329634830507fa7eeb885cb8d9c8afd88
[ "MIT" ]
null
null
null
#!/usr/bin/env python """ Code is personal property of the owner.Rights reserved by the user only. Codes on https://github.com/kt97679/tetris Attempt to spread the open source knowledge :) """ import sys import select import tty import termios import random import os import time import fcntl if (sys.hexversion >> 16) >= 0x202: FCNTL = fcntl else: import FCNTL import contextlib PLAYFIELD_W = 10 PLAYFIELD_H = 20 PLAYFIELD_X = 30 PLAYFIELD_Y = 1 BORDER_COLOR = 'yellow' HELP_X = 58 HELP_Y = 1 HELP_COLOR = 'cyan' SCORE_X = 1 SCORE_Y = 2 SCORE_COLOR = 'green' NEXT_X = 14 NEXT_Y = 11 GAMEOVER_X = 1 GAMEOVER_Y = PLAYFIELD_H + 3 INITIAL_MOVE_DOWN_DELAY = 1.0 DELAY_FACTOR = 0.8 LEVEL_UP = 20 NEXT_EMPTY_CELL = " " PLAYFIELD_EMPTY_CELL = " ." FILLED_CELL = "[]" class TetrisInputProcessor: delay = INITIAL_MOVE_DOWN_DELAY if __name__ == '__main__': run()
28.626106
102
0.558312
b508d14c18fba6ec3f26029dc4d010c75e52591f
11,471
py
Python
cucm.py
PresidioCode/cucm-exporter
8771042afcb2f007477f7b47c1516092c621da2e
[ "MIT" ]
10
2020-10-06T01:12:41.000Z
2022-02-14T03:03:25.000Z
cucm.py
bradh11/cucm-exporter
8771042afcb2f007477f7b47c1516092c621da2e
[ "MIT" ]
1
2020-10-14T13:47:36.000Z
2020-10-17T03:06:25.000Z
cucm.py
PresidioCode/cucm-exporter
8771042afcb2f007477f7b47c1516092c621da2e
[ "MIT" ]
4
2020-10-13T16:19:46.000Z
2022-03-08T19:29:34.000Z
import time import json def export_users(ucm_axl): """ retrieve users from ucm """ try: user_list = ucm_axl.get_users( tagfilter={ "userid": "", "firstName": "", "lastName": "", "directoryUri": "", "telephoneNumber": "", "enableCti": "", "mailid": "", "primaryExtension": {"pattern": "", "routePartitionName": ""}, "enableMobility": "", "homeCluster": "", "associatedPc": "", "enableEmcc": "", "imAndPresenceEnable": "", "serviceProfile": {"_value_1": ""}, "status": "", "userLocale": "", "title": "", "subscribeCallingSearchSpaceName": "", } ) all_users = [] for user in user_list: # print(user) user_details = {} user_details['userid'] = user.userid user_details['firstName'] = user.firstName user_details['lastName'] = user.lastName user_details['telephoneNumber'] = user.telephoneNumber user_details['primaryExtension'] = user.primaryExtension.pattern user_details['directoryUri'] = user.directoryUri user_details['mailid'] = user.mailid all_users.append(user_details) print( f"{user_details.get('userid')} -- {user_details.get('firstName')} {user_details.get('lastName')}: {user_details.get('primaryExtension')}" ) print("-" * 35) print(f"number of users: {len(all_users)}") # print(user_list) # print(json.dumps(all_users, indent=2)) return all_users except Exception as e: print(e) return [] def export_phones(ucm_axl): """ Export Phones """ try: phone_list = ucm_axl.get_phones( tagfilter={ "name": "", "description": "", "product": "", "model": "", "class": "", "protocol": "", "protocolSide": "", "callingSearchSpaceName": "", "devicePoolName": "", "commonDeviceConfigName": "", "commonPhoneConfigName": "", "networkLocation": "", "locationName": "", "mediaResourceListName": "", "networkHoldMohAudioSourceId": "", "userHoldMohAudioSourceId": "", "loadInformation": "", "securityProfileName": "", "sipProfileName": "", "cgpnTransformationCssName": "", "useDevicePoolCgpnTransformCss": "", "numberOfButtons": "", "phoneTemplateName": "", "primaryPhoneName": "", "loginUserId": "", "defaultProfileName": "", "enableExtensionMobility": "", "currentProfileName": "", "loginTime": "", "loginDuration": "", # "currentConfig": "", "ownerUserName": "", "subscribeCallingSearchSpaceName": "", "rerouteCallingSearchSpaceName": "", "allowCtiControlFlag": "", "alwaysUsePrimeLine": "", "alwaysUsePrimeLineForVoiceMessage": "", } ) all_phones = [] for phone in phone_list: # print(phone) phone_details = { "name": phone.name, "description": phone.description, "product": phone.product, "model": phone.model, "protocol": phone.protocol, "protocolSide": phone.protocolSide, "callingSearchSpaceName": phone.callingSearchSpaceName._value_1, "devicePoolName": phone.defaultProfileName._value_1, "commonDeviceConfigName": phone.commonDeviceConfigName._value_1, "commonPhoneConfigName": phone.commonPhoneConfigName._value_1, "networkLocation": phone.networkLocation, "locationName": phone.locationName._value_1, "mediaResourceListName": phone.mediaResourceListName._value_1, "networkHoldMohAudioSourceId": phone.networkHoldMohAudioSourceId, "userHoldMohAudioSourceId": phone.userHoldMohAudioSourceId, "loadInformation": phone.loadInformation, "securityProfileName": phone.securityProfileName._value_1, "sipProfileName": phone.sipProfileName._value_1, "cgpnTransformationCssName": phone.cgpnTransformationCssName._value_1, "useDevicePoolCgpnTransformCss": phone.useDevicePoolCgpnTransformCss, "numberOfButtons": phone.numberOfButtons, "phoneTemplateName": phone.phoneTemplateName._value_1, "primaryPhoneName": phone.primaryPhoneName._value_1, "loginUserId": phone.loginUserId, "defaultProfileName": phone.defaultProfileName._value_1, "enableExtensionMobility": phone.enableExtensionMobility, "currentProfileName": phone.currentProfileName._value_1, "loginTime": phone.loginTime, "loginDuration": phone.loginDuration, # "currentConfig": phone.currentConfig, "ownerUserName": phone.ownerUserName._value_1, "subscribeCallingSearchSpaceName": phone.subscribeCallingSearchSpaceName._value_1, "rerouteCallingSearchSpaceName": phone.rerouteCallingSearchSpaceName._value_1, "allowCtiControlFlag": phone.allowCtiControlFlag, "alwaysUsePrimeLine": phone.alwaysUsePrimeLine, "alwaysUsePrimeLineForVoiceMessage": phone.alwaysUsePrimeLineForVoiceMessage, } line_details = ucm_axl.get_phone(name=phone.name) # print(line_details.lines.line) try: for line in line_details.lines.line: # print(line) phone_details[f"line_{line.index}_dirn"] = line.dirn.pattern phone_details[f"line_{line.index}_routePartitionName"] = line.dirn.routePartitionName._value_1 phone_details[f"line_{line.index}_display"] = line.display phone_details[f"line_{line.index}_e164Mask"] = line.e164Mask except Exception as e: print(e) all_phones.append(phone_details) print( f"exporting: {phone.name}: {phone.model} - {phone.description}") print("-" * 35) print(f"number of phones: {len(all_phones)}") return all_phones except Exception as e: print(e) return [] def export_phone_registrations(ucm_axl, ucm_ris): """ Export Phone Registrations """ nodes = ucm_axl.list_process_nodes() del nodes[0] # remove EnterpriseWideData node subs = [] for node in nodes: subs.append(node.name) phones = ucm_axl.get_phones(tagfilter={"name": ""}) all_phones = [] phone_reg = [] reg = {} for phone in phones: all_phones.append(phone.name) groups = limit(all_phones) for group in groups: registered = ucm_ris.checkRegistration(group, subs) if registered["TotalDevicesFound"] < 1: print("no devices found!") else: reg["user"] = registered["LoginUserId"] reg["regtime"] = time.strftime( "%Y-%m-%d %H:%M:%S", time.localtime(registered["TimeStamp"])) for item in registered["IPAddress"]: reg["ip"] = item[1][0]["IP"] for item in registered["LinesStatus"]: reg["primeline"] = item[1][0]["DirectoryNumber"] reg["name"] = registered["Name"] print(f"exporting: {reg['name']}: {reg['ip']} - {reg['regtime']}") phone_reg.append(reg) print("-" * 35) print(f"number of registered phones: {len(phone_reg)}") return phone_reg
40.677305
154
0.555488
b50af19fbfd3dbcdc0b721d01520bacb09232597
256
py
Python
web.backend/config.py
Forevka/YTDownloader
fff92bfc13b70843472ec6cce13ed6609d89433a
[ "MIT" ]
1
2020-10-27T05:31:51.000Z
2020-10-27T05:31:51.000Z
web.backend/config.py
Forevka/YTDownloader
fff92bfc13b70843472ec6cce13ed6609d89433a
[ "MIT" ]
null
null
null
web.backend/config.py
Forevka/YTDownloader
fff92bfc13b70843472ec6cce13ed6609d89433a
[ "MIT" ]
null
null
null
host = "localhost" port = 9999 dboptions = { "host": "194.67.198.163", "user": "postgres", "password": "werdwerd2012", "database": "zno_bot", 'migrate': True } API_PATH = '/api/' API_VERSION = 'v1' API_URL = API_PATH + API_VERSION
14.222222
32
0.597656
b50d91bfd6f0c80409d4587612832b09f44bae48
829
py
Python
ml_train.py
ElvinOuyang/LearningFlask
eb94355c971897dc06943b8cfdbcdd0f0da44f51
[ "MIT" ]
null
null
null
ml_train.py
ElvinOuyang/LearningFlask
eb94355c971897dc06943b8cfdbcdd0f0da44f51
[ "MIT" ]
null
null
null
ml_train.py
ElvinOuyang/LearningFlask
eb94355c971897dc06943b8cfdbcdd0f0da44f51
[ "MIT" ]
null
null
null
import pandas as pd import numpy as np from sklearn.datasets import load_iris from sklearn.naive_bayes import GaussianNB import pickle def train_iris_nb(): """Train a GaussianNB model on iris dataset.""" X, y_train = load_iris(return_X_y=True, as_frame=True) colnames = X.columns X_train = X.values model = GaussianNB() model.fit(X_train, y_train) return model def dump_model(model_path, model): """Save model as binary pickle file.""" with open(model_path, 'wb') as file: pickle.dump(model, file) def load_model(model_path): """Load model to return for future use.""" with open(model_path, 'rb') as file: model = pickle.load(file) return model if __name__ == '__main__': main()
25.90625
58
0.683957
b50dc3fa0e49a34e31b885324c803f179d4c5bd2
746
py
Python
UFOscrapy/UFOscrapy/pipelines.py
anaheino/Ufo-sightings-map
64af02093f97737cbbdfd8af9e1aeb4d8aa8fcdc
[ "MIT" ]
null
null
null
UFOscrapy/UFOscrapy/pipelines.py
anaheino/Ufo-sightings-map
64af02093f97737cbbdfd8af9e1aeb4d8aa8fcdc
[ "MIT" ]
null
null
null
UFOscrapy/UFOscrapy/pipelines.py
anaheino/Ufo-sightings-map
64af02093f97737cbbdfd8af9e1aeb4d8aa8fcdc
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- from .parserules import parseAll
22.606061
66
0.430295
b50e4ff7686cf0dbd4629ae146083491535bb7be
1,028
py
Python
precompressed/context_processors.py
EightMedia/django-precompressed
1b135b4784a96948237f93bf0648d3ab747fcfb3
[ "MIT" ]
4
2015-05-05T06:58:35.000Z
2018-10-15T18:53:50.000Z
precompressed/context_processors.py
EightMedia/django-precompressed
1b135b4784a96948237f93bf0648d3ab747fcfb3
[ "MIT" ]
2
2015-02-04T10:48:00.000Z
2020-01-27T15:36:39.000Z
precompressed/context_processors.py
EightMedia/django-precompressed
1b135b4784a96948237f93bf0648d3ab747fcfb3
[ "MIT" ]
1
2019-02-20T20:40:04.000Z
2019-02-20T20:40:04.000Z
# ***************************************************************************** # precompressed/context_processors.py # ***************************************************************************** """ A set of request processors that return dictionaries to be merged into a template context. Each function takes the request object as its only parameter and returns a dictionary to add to the context. These are referenced from the setting TEMPLATE_CONTEXT_PROCESSORS and used by RequestContext. """ from __future__ import absolute_import, division from __future__ import print_function, unicode_literals from precompressed import utils # ***************************************************************************** # accepts_gzip # ***************************************************************************** def accepts_gzip(request): """ defines ACCEPTS_GZIP -- a boolean which reflects whether the request accepts Content-Type: gzip. """ return {'ACCEPTS_GZIP': utils.accepts_gzip(request)}
30.235294
79
0.539883
b51221f86b651bcc587032cb289ea216ea969861
6,612
py
Python
Code/pytorchFwdModel.py
mChataign/smileCompletion
1bde2dd9fada2194c79cb3599bc9e9139cde6ee5
[ "BSD-3-Clause" ]
4
2021-01-06T13:53:39.000Z
2021-12-16T21:23:13.000Z
Code/pytorchFwdModel.py
mChataign/smileCompletion
1bde2dd9fada2194c79cb3599bc9e9139cde6ee5
[ "BSD-3-Clause" ]
null
null
null
Code/pytorchFwdModel.py
mChataign/smileCompletion
1bde2dd9fada2194c79cb3599bc9e9139cde6ee5
[ "BSD-3-Clause" ]
2
2021-01-06T20:53:15.000Z
2021-12-29T08:59:31.000Z
#Import modules import os import pandas as pd import numpy as np from pandas import DatetimeIndex import dask import scipy import time import glob import torch import torch.nn as nn from live_plotter import live_plotter import matplotlib.pyplot as plt from mpl_toolkits import mplot3d from functools import partial from abc import ABCMeta, abstractmethod import plottingTools import pytorchModel import loadData
43.788079
141
0.57078
b5122d95a7d1bf2036d53b90080cc31fd62623ab
911
py
Python
quickstart.py
s-samarth/Learning-Tensorflow
a46d8be1a741de5a0f366af83b8534cefcf0b615
[ "MIT" ]
null
null
null
quickstart.py
s-samarth/Learning-Tensorflow
a46d8be1a741de5a0f366af83b8534cefcf0b615
[ "MIT" ]
null
null
null
quickstart.py
s-samarth/Learning-Tensorflow
a46d8be1a741de5a0f366af83b8534cefcf0b615
[ "MIT" ]
null
null
null
import numpy as np import tensorflow as tf from tensorflow import keras import warnings warnings.filterwarnings('ignore') mnist = tf.keras.datasets.mnist (X_train, y_train), (X_test, y_test) = mnist.load_data() X_train, X_test = X_train / 255.0, X_test / 255.0 X_train.shape = (60000, 28, 28) model = tf.keras.Sequential([ tf.keras.layers.Flatten(input_shape=(28, 28)), tf.keras.layers.Dense(128, activation='relu'), tf.keras.layers.Dropout(0.2), tf.keras.layers.Dense(10) ]) # output shape is (None, 10) ie batch size, 10 # logits is the inverse of sigmoid logits = model(X_train[:1]).numpy() loss_fn = keras.losses.SparseCategoricalCrossentropy(from_logits=True) model.compile(optimizer='adam', loss=loss_fn, metrics=['accuracy']) model.fit(X_train, y_train, epochs=1) model.evaluate(X_test, y_test, verbose=2) probab_model = keras.Sequential([ model, keras.layers.Softmax() ])
27.606061
70
0.728869
b512b2de6527126b947a320b79c117609580ec75
114
py
Python
pyquil/__init__.py
ftripier/pyquil
573d5ae64bbc594917ad46885fca0d8f5f3fe0e9
[ "Apache-2.0" ]
null
null
null
pyquil/__init__.py
ftripier/pyquil
573d5ae64bbc594917ad46885fca0d8f5f3fe0e9
[ "Apache-2.0" ]
null
null
null
pyquil/__init__.py
ftripier/pyquil
573d5ae64bbc594917ad46885fca0d8f5f3fe0e9
[ "Apache-2.0" ]
null
null
null
__version__ = "2.1.0.dev0" from pyquil.quil import Program from pyquil.api import list_quantum_computers, get_qc
22.8
53
0.807018
b513b3e8cf7e95cf1452eb5dac904886fb0f42d5
1,546
py
Python
equation_solution.py
free-free/Algorithm
174b6bc7a73f5ec1393149d238fc4496b2baedaa
[ "Apache-2.0" ]
7
2015-11-15T05:34:33.000Z
2021-04-29T00:39:08.000Z
equation_solution.py
free-free/Algorithm
174b6bc7a73f5ec1393149d238fc4496b2baedaa
[ "Apache-2.0" ]
null
null
null
equation_solution.py
free-free/Algorithm
174b6bc7a73f5ec1393149d238fc4496b2baedaa
[ "Apache-2.0" ]
null
null
null
#!/bin/env python3.5 import math # binary seperation # tan line method if __name__ == '__main__': print(binary_seperation(test_func,[0,1] )) print(tanline(test_func, df_test_func, [0,1]))
20.342105
57
0.467012
b5141515336b431125ee2d8bfb2d41e31fd83729
3,428
py
Python
test/test_sparql/test_sparql_parser.py
trishnaguha/rdfextras
c66b30de4a3b9cb67090add06cb8a9cf05d2c545
[ "BSD-3-Clause" ]
3
2015-05-15T02:18:21.000Z
2019-02-12T03:14:46.000Z
test/test_sparql/test_sparql_parser.py
trishnaguha/rdfextras
c66b30de4a3b9cb67090add06cb8a9cf05d2c545
[ "BSD-3-Clause" ]
1
2015-11-05T15:18:36.000Z
2015-11-05T16:44:04.000Z
test/test_sparql/test_sparql_parser.py
trishnaguha/rdfextras
c66b30de4a3b9cb67090add06cb8a9cf05d2c545
[ "BSD-3-Clause" ]
4
2015-11-05T07:24:41.000Z
2022-01-18T07:54:43.000Z
import unittest from rdflib import Graph tests = [ ("basic", """\ SELECT ?name WHERE { ?a <http://xmlns.com/foaf/0.1/name> ?name }"""), ("simple_prefix", """\ PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?name WHERE { ?a foaf:name ?name }"""), ("base_statement", """\ BASE <http://xmlns.com/foaf/0.1/> SELECT ?name WHERE { ?a <name> ?name }"""), ("prefix_and_colon_only_prefix", """\ PREFIX : <http://xmlns.com/foaf/0.1/> PREFIX vcard: <http://www.w3.org/2001/vcard-rdf/3.0#> SELECT ?name ?title WHERE { ?a :name ?name . ?a vcard:TITLE ?title }"""), ("predicate_object_list_notation", """\ PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?name ?mbox WHERE { ?x foaf:name ?name ; foaf:mbox ?mbox . }"""), ("object_list_notation", """\ PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?x WHERE { ?x foaf:nick "Alice" , "Alice_" . } """), ("escaped_literals", """\ PREFIX tag: <http://xmlns.com/foaf/0.1/> PREFIX vcard: <http://www.w3.org/2001/vcard-rdf/3.0#> SELECT ?name WHERE { ?a tag:name ?name ; vcard:TITLE "escape test vcard:TITLE " ; <tag://test/escaping> "This is a ''' Test \"\"\"" ; <tag://test/escaping> ?d } """), ("key_word_as_variable", """\ PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?PREFIX ?WHERE WHERE { ?x foaf:name ?PREFIX ; foaf:mbox ?WHERE . }"""), ("key_word_as_prefix", """\ PREFIX WHERE: <http://xmlns.com/foaf/0.1/> SELECT ?name ?mbox WHERE { ?x WHERE:name ?name ; WHERE:mbox ?mbox . }"""), ("some_test_cases_from_grammar_py_1", """\ SELECT ?title WHERE { <http://example.org/book/book1> <http://purl.org/dc/elements/1.1/title> ?title . }"""), ("some_test_cases_from_grammar_py_2", """\ PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?name ?mbox WHERE { ?person foaf:name ?name . OPTIONAL { ?person foaf:mbox ?mbox} }"""), ("some_test_cases_from_grammar_py_3", """\ PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?name ?name2 WHERE { ?person foaf:name ?name . OPTIONAL { ?person foaf:knows ?p2 . ?p2 foaf:name ?name2 . } }"""), ("some_test_cases_from_grammar_py_4", """\ PREFIX foaf: <http://xmlns.com/foaf/0.1/> #PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> SELECT ?name ?mbox WHERE { { ?person rdf:type foaf:Person } . OPTIONAL { ?person foaf:name ?name } . OPTIONAL {?person foaf:mbox ?mbox} . }""") ]
25.774436
66
0.540548
b514465b893f2b24e5e74f092847f939b1d7ff56
1,228
py
Python
day1.py
derek-elliott/aoc2018
b7fed374e94665cb70eff413297b2e3865f835c4
[ "MIT" ]
null
null
null
day1.py
derek-elliott/aoc2018
b7fed374e94665cb70eff413297b2e3865f835c4
[ "MIT" ]
null
null
null
day1.py
derek-elliott/aoc2018
b7fed374e94665cb70eff413297b2e3865f835c4
[ "MIT" ]
null
null
null
if __name__ == '__main__': print(f'Part 1: {part_one()}\nPart 2: {part_two()}')
25.583333
56
0.566775
b5155fe82e40d2b63e9f83d54603790af7163224
5,122
py
Python
file_sync_tool/transfer/process.py
jackd248/file-sync-tool
68fbca562f232c2bc064f546d9eade20a2ae456f
[ "MIT" ]
null
null
null
file_sync_tool/transfer/process.py
jackd248/file-sync-tool
68fbca562f232c2bc064f546d9eade20a2ae456f
[ "MIT" ]
null
null
null
file_sync_tool/transfer/process.py
jackd248/file-sync-tool
68fbca562f232c2bc064f546d9eade20a2ae456f
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: future_fstrings -*- from db_sync_tool.utility import mode, system, output, helper from db_sync_tool.remote import client as remote_client from file_sync_tool.transfer import utility def transfer_files(): """ Transfering configured files between clients :return: """ if 'files' in system.config: for config in system.config['files']['config']: output.message( output.Subject.INFO, f'Starting rsync file transfer' ) if 'exclude' not in config: config['exclude'] = [] if mode.get_sync_mode() == mode.SyncMode.PROXY: # Proxy mode: Transferring from origin to local and from local to target utility.generate_temp_dir_name() helper.check_and_create_dump_dir(mode.Client.LOCAL, utility.temp_data_dir) synchronize( origin_path=config[mode.Client.ORIGIN], target_path=utility.temp_data_dir, exclude=config['exclude'], pseudo_client=mode.Client.ORIGIN ) synchronize( origin_path=f'{utility.temp_data_dir}/*', target_path=config[mode.Client.TARGET], exclude=config['exclude'], pseudo_client=mode.Client.TARGET ) utility.remove_temporary_dir() elif mode.get_sync_mode() == mode.SyncMode.SYNC_REMOTE: synchronize( origin_path=config[mode.Client.ORIGIN], target_path=config[mode.Client.TARGET], exclude=config['exclude'], client=mode.Client.ORIGIN, force_remote=True ) else: synchronize( origin_path=config[mode.Client.ORIGIN], target_path=config[mode.Client.TARGET], exclude=config['exclude'] ) else: f'{output.Subject.WARNING} No file sync configuration provided' def synchronize(origin_path, target_path, exclude, client=mode.Client.LOCAL, pseudo_client=None, force_remote=False): """ Using rsync command to synchronize files between systems :param origin_path: String :param target_path: String :param exclude: List :param client: String :param pseudo_client: String Client, which will be forced as remote client. Necessary for proxy transfer. :param force_remote: Boolean :return: """ _remote_client = None if force_remote: remote_client.load_ssh_client_origin() _origin_subject = f'{output.Subject.ORIGIN}{output.CliFormat.BLACK}[REMOTE]{output.CliFormat.ENDC} ' _target_subject = f'{output.Subject.TARGET}{output.CliFormat.BLACK}[REMOTE]{output.CliFormat.ENDC} ' elif mode.is_remote(mode.Client.ORIGIN) and pseudo_client != mode.Client.TARGET: _remote_client = mode.Client.ORIGIN _origin_subject = f'{output.Subject.ORIGIN}{output.CliFormat.BLACK}[REMOTE]{output.CliFormat.ENDC} ' _target_subject = f'{output.Subject.TARGET}{output.CliFormat.BLACK}[LOCAL]{output.CliFormat.ENDC} ' elif mode.is_remote(mode.Client.TARGET) and pseudo_client != mode.Client.ORIGIN: _remote_client = mode.Client.TARGET _origin_subject = f'{output.Subject.ORIGIN}{output.CliFormat.BLACK}[LOCAL]{output.CliFormat.ENDC} ' _target_subject = f'{output.Subject.TARGET}{output.CliFormat.BLACK}[REMOTE]{output.CliFormat.ENDC} ' elif not mode.is_remote(mode.Client.TARGET) and not mode.is_remote(mode.Client.ORIGIN): _origin_subject = f'{output.Subject.ORIGIN}{output.CliFormat.BLACK}[LOCAL]{output.CliFormat.ENDC} ' _target_subject = f'{output.Subject.TARGET}{output.CliFormat.BLACK}[LOCAL]{output.CliFormat.ENDC} ' _origin_name = helper.get_ssh_host_name(mode.Client.ORIGIN, True) if _remote_client == mode.Client.ORIGIN else '' _target_name = helper.get_ssh_host_name(mode.Client.TARGET, True) if _remote_client == mode.Client.TARGET else '' if not system.config['mute']: print( f'{_origin_subject}' f'{_origin_name}' f'{output.CliFormat.BLACK}{origin_path}{output.CliFormat.ENDC}' ) print( f'{_target_subject}' f'{_target_name}' f'{output.CliFormat.BLACK}{target_path}{output.CliFormat.ENDC}' ) _origin_user_host = utility.get_host(mode.Client.ORIGIN) if _remote_client == mode.Client.ORIGIN else '' _target_user_host = utility.get_host(mode.Client.TARGET) if _remote_client == mode.Client.TARGET else '' _output = mode.run_command( f'{utility.get_password_environment(_remote_client)}rsync {utility.get_options()} ' f'{utility.get_authorization(_remote_client)} {utility.get_excludes(exclude)}' f'{_origin_user_host}{origin_path} {_target_user_host}{target_path}', client, True ) utility.read_stats(_output)
44.53913
117
0.639594
82ecef2ff3628afa85b6185c93f911d25a8014e1
5,635
py
Python
src/main/python/Training+Data+Analysis.py
sully90/dp-search-service
efc6a94dad1c5b3fc898da9ced1606aa345c7ecd
[ "MIT" ]
null
null
null
src/main/python/Training+Data+Analysis.py
sully90/dp-search-service
efc6a94dad1c5b3fc898da9ced1606aa345c7ecd
[ "MIT" ]
null
null
null
src/main/python/Training+Data+Analysis.py
sully90/dp-search-service
efc6a94dad1c5b3fc898da9ced1606aa345c7ecd
[ "MIT" ]
null
null
null
# coding: utf-8 # # Training Set Analysis # The purpose of this notebook is to compute the kernel density estimate of the PDF between the judgement and each feature in a training set, in order to estimate how each feature is performing. # # # TODO # Modify features to use custom function score queries, and use ML to optimise features given the below plot (plot ideal relationship between judgement and features, and optimise to get as close as possible). # In[51]: import sys import numpy as np import scipy from scipy import stats import matplotlib.pylab as plt models_dir = "/Users/sullid/ONS/dp-search-service/src/main/resources/elastic.ltr/models" model_name = sys.argv[1] # In[52]: trainingData = TrainingData(models_dir, model_name) # In[56]: import matplotlib.gridspec as gridspec import matplotlib.pylab as pylab fs=25 params = {'legend.fontsize': 'x-large', 'figure.figsize': (15, 5), 'axes.labelsize': fs, 'axes.titlesize':fs, 'xtick.labelsize':fs, 'ytick.labelsize':fs} pylab.rcParams.update(params) print "QIDS: ", trainingData.qids() for qid in trainingData.qids(): numFeatures = trainingData.numFeatures(qid) + 1 fig = plt.figure(figsize=(50, 50)) plt.suptitle('qid:%d' % qid, fontsize=fs*1.5) gs = gridspec.GridSpec(numFeatures, numFeatures) for i in range(numFeatures): rowLabel, rowValues = getValues(trainingData, qid, i) labelRow = True for j in range(i+1, numFeatures): colLabel, colValues = getValues(trainingData, qid, j) ax = plt.subplot(gs[i,j-numFeatures]) # ax.text(0.25, 0.5, "ax %d:%d" % (i,j)) if (labelRow): ax.set_ylabel(rowLabel) labelRow = False if (j == (i+1)): ax.set_xlabel(colLabel) try: Z, (xmin,xmax,ymin,ymax) = fitKernel(colValues, rowValues, 200j) extent = [xmin,xmax,ymin,ymax] ax.imshow(Z, cmap=plt.cm.gist_stern_r, extent=extent) ax.set_xlim([xmin, xmax]) ax.set_ylim([ymin, ymax]) forceAspect(ax) except: pass # ax.imshow(np.rot90(Z), cmap=plt.cm.gist_earth_r, # extent=[xmin, xmax, ymin, ymax], aspect=50) # ax.plot(x, y, 'k.', markersize=2) # ax.set_xlim([xmin, xmax]) # ax.set_ylim([ymin, ymax]) plt.show()
31.836158
208
0.525998
82ef5f165b2867c26c9995bbb6a7009f9e7374ac
3,623
py
Python
src/utility_lib/collection_utilities/collection_utilities.py
DonalChilde/utility_lib
9cf1cc142e5fcbf99f9f2e9bf6099520cc3eb545
[ "MIT" ]
null
null
null
src/utility_lib/collection_utilities/collection_utilities.py
DonalChilde/utility_lib
9cf1cc142e5fcbf99f9f2e9bf6099520cc3eb545
[ "MIT" ]
null
null
null
src/utility_lib/collection_utilities/collection_utilities.py
DonalChilde/utility_lib
9cf1cc142e5fcbf99f9f2e9bf6099520cc3eb545
[ "MIT" ]
null
null
null
from operator import attrgetter, itemgetter from typing import ( Sequence, Any, Tuple, Union, List, Iterable, Dict, Callable, NamedTuple, ) SortSpec = NamedTuple("SortSpec", [("sort_key", Union[str, int]), ("reversed", bool)]) def index_list_of_objects( data: Iterable[Union[Sequence, Any]], key_field, use_get_item: bool, cast_index: Callable = None, ): """ Will index a list of objects based on key_field. Returns a dict with key based on key_field of object Parameters ---------- data : Iterable[Union[Sequence, Any]] [description] key : [type] [description] use_get_item : bool [description] cast_index : Callable, optional [description], by default None Returns ------- [type] [description] """ if use_get_item: indexer = itemgetter(key_field) else: indexer = attrgetter(key_field) result = {} for item in data: key_field_value = indexer(item) if cast_index is not None: key_field_value = cast_index(key_field_value) result[key_field_value] = item return result
27.44697
95
0.629865
82efe2ac2a9247e0f62ea4de8994ddbcc198a68c
368
py
Python
manage_it/catalog/admin.py
ShangShungInstitute/django-manage-it
13cb23b57ce3577db7f69250741bcbfe82b69a57
[ "MIT", "Unlicense" ]
1
2015-01-20T14:34:32.000Z
2015-01-20T14:34:32.000Z
manage_it/catalog/admin.py
ShangShungInstitute/django-manage-it
13cb23b57ce3577db7f69250741bcbfe82b69a57
[ "MIT", "Unlicense" ]
null
null
null
manage_it/catalog/admin.py
ShangShungInstitute/django-manage-it
13cb23b57ce3577db7f69250741bcbfe82b69a57
[ "MIT", "Unlicense" ]
null
null
null
from django.contrib import admin from models import Location, ItemTemplate, Log, Inventory, Supplier admin.site.register(Location) admin.site.register(ItemTemplate, ItemTemplateAdmin) admin.site.register(Log) admin.site.register(Inventory) admin.site.register(Supplier)
24.533333
67
0.807065
82f077676382d093577f0c067da14ea95e4000cd
1,557
py
Python
core_get/actions/module.py
core-get/core-get
8fb960e4e51d0d46b5e3b2f4832eb4a39e0e60f7
[ "MIT" ]
null
null
null
core_get/actions/module.py
core-get/core-get
8fb960e4e51d0d46b5e3b2f4832eb4a39e0e60f7
[ "MIT" ]
null
null
null
core_get/actions/module.py
core-get/core-get
8fb960e4e51d0d46b5e3b2f4832eb4a39e0e60f7
[ "MIT" ]
null
null
null
from typing import Dict, Type from injector import Module, Binder from core_get.actions.action import Action from core_get.actions.init.init import Init from core_get.actions.init.init_options import InitOptions from core_get.actions.install.install import Install from core_get.actions.install.install_options import InstallOptions from core_get.actions.login.login import Login from core_get.actions.login.login_options import LoginOptions from core_get.actions.package.package import Package from core_get.actions.package.package_options import PackageOptions from core_get.actions.publish.publish import Publish from core_get.actions.publish.publish_options import PublishOptions from core_get.actions.remove.remove import Remove from core_get.actions.remove.remove_options import RemoveOptions from core_get.actions.test.test import Test from core_get.actions.test.test_options import TestOptions from core_get.actions.yank.yank import Yank from core_get.actions.yank.yank_options import YankOptions from core_get.options.options import Options from core_get.utils.injection import MultiMapClassProvider
39.923077
80
0.787412
82f09047154f2ff625d401ca2b201a78ede23eab
8,773
py
Python
venv/Lib/site-packages/direct/particles/ParticleEffect.py
ferris77/pacman
9d793146189630b4305af0bc7af65ce822b3998f
[ "MIT" ]
null
null
null
venv/Lib/site-packages/direct/particles/ParticleEffect.py
ferris77/pacman
9d793146189630b4305af0bc7af65ce822b3998f
[ "MIT" ]
20
2021-05-03T18:02:23.000Z
2022-03-12T12:01:04.000Z
Lib/site-packages/direct/particles/ParticleEffect.py
fochoao/cpython
3dc84b260e5bced65ebc2c45c40c8fa65f9b5aa9
[ "bzip2-1.0.6", "0BSD" ]
1
2021-04-09T00:02:59.000Z
2021-04-09T00:02:59.000Z
from panda3d.core import * # Leave these imports in, they may be used by ptf files. from panda3d.physics import * from . import Particles from . import ForceGroup from direct.directnotify import DirectNotifyGlobal
33.484733
94
0.596831
82f2ce225147eef11b48a4a976040f87c859485c
7,566
py
Python
orchestra/contrib/payments/models.py
udm88/django-orchestra
49c84f13a8f92427b01231615136549fb5be3a78
[ "Unlicense" ]
68
2015-02-09T10:28:44.000Z
2022-03-12T11:08:36.000Z
orchestra/contrib/payments/models.py
ferminhg/django-orchestra
49c84f13a8f92427b01231615136549fb5be3a78
[ "Unlicense" ]
17
2015-05-01T18:10:03.000Z
2021-03-19T21:52:55.000Z
orchestra/contrib/payments/models.py
ferminhg/django-orchestra
49c84f13a8f92427b01231615136549fb5be3a78
[ "Unlicense" ]
29
2015-03-31T04:51:03.000Z
2022-02-17T02:58:50.000Z
from django.core.exceptions import ValidationError from django.db import models from django.utils.functional import cached_property from django.utils.translation import ugettext_lazy as _ from jsonfield import JSONField from orchestra.models.fields import PrivateFileField from orchestra.models.queryset import group_by from . import settings from .methods import PaymentMethod def get_due_delta(self): return self.method_instance.due_delta def clean(self): self.data = self.method_instance.clean_data() class TransactionQuerySet(models.QuerySet): group_by = group_by class Transaction(models.Model): WAITTING_PROCESSING = 'WAITTING_PROCESSING' # CREATED WAITTING_EXECUTION = 'WAITTING_EXECUTION' # PROCESSED EXECUTED = 'EXECUTED' SECURED = 'SECURED' REJECTED = 'REJECTED' STATES = ( (WAITTING_PROCESSING, _("Waitting processing")), (WAITTING_EXECUTION, _("Waitting execution")), (EXECUTED, _("Executed")), (SECURED, _("Secured")), (REJECTED, _("Rejected")), ) STATE_HELP = { WAITTING_PROCESSING: _("The transaction is created and requires processing by the " "specific payment method."), WAITTING_EXECUTION: _("The transaction is processed and its pending execution on " "the related financial institution."), EXECUTED: _("The transaction is executed on the financial institution."), SECURED: _("The transaction ammount is secured."), REJECTED: _("The transaction has failed and the ammount is lost, a new transaction " "should be created for recharging."), } bill = models.ForeignKey('bills.bill', verbose_name=_("bill"), related_name='transactions') source = models.ForeignKey(PaymentSource, null=True, blank=True, on_delete=models.SET_NULL, verbose_name=_("source"), related_name='transactions') process = models.ForeignKey('payments.TransactionProcess', null=True, blank=True, on_delete=models.SET_NULL, verbose_name=_("process"), related_name='transactions') state = models.CharField(_("state"), max_length=32, choices=STATES, default=WAITTING_PROCESSING) amount = models.DecimalField(_("amount"), max_digits=12, decimal_places=2) currency = models.CharField(max_length=10, default=settings.PAYMENT_CURRENCY) created_at = models.DateTimeField(_("created"), auto_now_add=True) modified_at = models.DateTimeField(_("modified"), auto_now=True) objects = TransactionQuerySet.as_manager() class TransactionProcess(models.Model): """ Stores arbitrary data generated by payment methods while processing transactions """ CREATED = 'CREATED' EXECUTED = 'EXECUTED' ABORTED = 'ABORTED' COMMITED = 'COMMITED' STATES = ( (CREATED, _("Created")), (EXECUTED, _("Executed")), (ABORTED, _("Aborted")), (COMMITED, _("Commited")), ) data = JSONField(_("data"), blank=True) file = PrivateFileField(_("file"), blank=True) state = models.CharField(_("state"), max_length=16, choices=STATES, default=CREATED) created_at = models.DateTimeField(_("created"), auto_now_add=True, db_index=True) updated_at = models.DateTimeField(_("updated"), auto_now=True)
35.85782
118
0.648163
82f6b63b42d651692733eea279e00b78a2b3c076
1,264
py
Python
src/visualisation/draw_map.py
Aluriak/24hducode2016
629a3225c5a426d3deb472d67f0e0091904d1547
[ "Unlicense" ]
null
null
null
src/visualisation/draw_map.py
Aluriak/24hducode2016
629a3225c5a426d3deb472d67f0e0091904d1547
[ "Unlicense" ]
null
null
null
src/visualisation/draw_map.py
Aluriak/24hducode2016
629a3225c5a426d3deb472d67f0e0091904d1547
[ "Unlicense" ]
null
null
null
# -*- coding: utf-8 -*- ########## # IMPORT # ########## import plotly.offline as py import plotly.tools as tls tls.set_credentials_file(username='ducktypers', api_key='fd81wnx3lh') ######## # MAIN # ######## def draw_map(lon, lat, text, titre='NO TITLE'): """ Take 3list as input, and the title of the map. """ py.plot({ # use `py.iplot` inside the ipython notebook "data": [{ 'type': 'scattergeo', 'locationmode': 'france', 'lon': lon, 'lat': lat, 'text': text, 'mode': 'markers', 'marker': dict( size = 8, opacity = 0.8, line = dict(width=1, color="rgb(102,102,102)") ) }], "layout": { 'title': str(titre), 'geo': dict(scope='europe', projection=dict( type='albers europe' ), showland = True, landcolor = "rgb(200, 200, 200)", subunitcolor = "rgb(217, 217, 217)", countrycolor = "rgb(217, 217, 217)", countrywidth = 1, subunitwidth = 1) } }, filename='interactive_map', # name of the file as saved in your plotly account #sharing='public' )
25.28
90
0.476266
82f77b388ad6652721586ee5ac9c7649d9fe0b48
89,313
py
Python
config/custom_components/mbapi2020/proto/acp_pb2.py
mhaack/home-assistant-conf
7cb856bee67906ba066adffe2151f6b50b6b73ce
[ "MIT" ]
28
2019-05-31T12:30:15.000Z
2022-03-10T18:54:57.000Z
config/custom_components/mbapi2020/proto/acp_pb2.py
mhaack/home-assistant-conf
7cb856bee67906ba066adffe2151f6b50b6b73ce
[ "MIT" ]
2
2020-04-15T20:02:42.000Z
2021-03-09T19:45:21.000Z
config/custom_components/mbapi2020/proto/acp_pb2.py
mhaack/home-assistant-conf
7cb856bee67906ba066adffe2151f6b50b6b73ce
[ "MIT" ]
2
2021-03-31T08:27:19.000Z
2021-04-30T15:13:24.000Z
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: acp.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() import custom_components.mbapi2020.proto.gogo_pb2 as gogo__pb2 DESCRIPTOR = _descriptor.FileDescriptor( name='acp.proto', package='proto', syntax='proto3', serialized_options=b'\n\032com.daimler.mbcarkit.proto\220\001\001\320\341\036\001', create_key=_descriptor._internal_create_key, serialized_pb=b'\n\tacp.proto\x12\x05proto\x1a\ngogo.proto\"\xa5\x02\n\x03VVA\"v\n\x0c\x43ommandState\x12\x19\n\x15UNKNOWN_COMMAND_STATE\x10\x00\x12\x0c\n\x07\x43REATED\x10\xf2\x07\x12\r\n\x08\x45NQUEUED\x10\xf8\x07\x12\x0f\n\nPROCESSING\x10\xf4\x07\x12\x0e\n\tSUSPENDED\x10\xf9\x07\x12\r\n\x08\x46INISHED\x10\xfa\x07\"\xa5\x01\n\x10\x43ommandCondition\x12\x1d\n\x19UNKNWON_COMMAND_CONDITION\x10\x00\x12\t\n\x04NONE\x10\xe8\x07\x12\r\n\x08\x41\x43\x43\x45PTED\x10\xe9\x07\x12\r\n\x08REJECTED\x10\xea\x07\x12\x0e\n\tTERMINATE\x10\xeb\x07\x12\x0c\n\x07SUCCESS\x10\xf3\x07\x12\x0b\n\x06\x46\x41ILED\x10\xf5\x07\x12\x10\n\x0bOVERWRITTEN\x10\xf6\x07\x12\x0c\n\x07TIMEOUT\x10\xf7\x07\"\x8f\x0b\n\nVehicleAPI\"~\n\x0c\x43ommandState\x12\x19\n\x15UNKNOWN_COMMAND_STATE\x10\x00\x12\x0e\n\nINITIATION\x10\x01\x12\x0c\n\x08\x45NQUEUED\x10\x02\x12\x0e\n\nPROCESSING\x10\x03\x12\x0b\n\x07WAITING\x10\x04\x12\x0c\n\x08\x46INISHED\x10\x05\x12\n\n\x06\x46\x41ILED\x10\x06\"S\n\x0f\x41ttributeStatus\x12\r\n\tVALUE_SET\x10\x00\x12\x11\n\rVALUE_NOT_SET\x10\x01\x12\x0b\n\x07INVALID\x10\x03\x12\x11\n\rNOT_AVAILABLE\x10\x04\"\xab\t\n\tQueueType\x12\x1b\n\x17UNKNOWNCOMMANDQUEUETYPE\x10\x00\x12\t\n\x05\x44OORS\x10\n\x12\x0b\n\x07\x41UXHEAT\x10\x0b\x12\x0b\n\x07PRECOND\x10\x0c\x12\r\n\tCHARGEOPT\x10\r\x12\x0f\n\x0bMAINTENANCE\x10\x0e\x12\x07\n\x03TCU\x10\x0f\x12\x08\n\x04\x46\x45\x45\x44\x10\x10\x12\x15\n\x11SERVICEACTIVATION\x10\x11\x12\x07\n\x03\x41TP\x10\x12\x12\x0e\n\nASSISTANCE\x10\x13\x12\x08\n\x04RACP\x10\x14\x12\x0f\n\x0bWEEKPROFILE\x10\x15\x12\x13\n\x0fREMOTEDIAGNOSIS\x10\x16\x12\x08\n\x04\x46LSH\x10\x17\x12\x0f\n\x0bTEMPERATURE\x10\x18\x12\x0c\n\x08TRIPCOMP\x10\x19\x12\n\n\x06\x45NGINE\x10\x1a\x12\x0e\n\nTHEFTALARM\x10\x1b\x12\n\n\x06WINDOW\x10\x1c\x12\x0c\n\x08HEADUNIT\x10\x1d\x12\n\n\x06MECALL\x10\x1f\x12\x0f\n\x0bIMMOBILIZER\x10 \x12\x10\n\x0cRENTALSIGNAL\x10!\x12\x07\n\x03\x42\x43\x46\x10\"\x12\x11\n\rPLUGANDCHARGE\x10#\x12\x14\n\x10\x43\x41RSHARINGMODULE\x10$\x12\x0b\n\x07\x42\x41TTERY\x10%\x12\x11\n\rONBOARDFENCES\x10&\x12\x0f\n\x0bSPEEDFENCES\x10\'\x12\x13\n\x0f\x43HARGINGTARIFFS\x10(\x12\r\n\tRTMCONFIG\x10)\x12\x17\n\x13MAINTENANCECOMPUTER\x10*\x12\x0b\n\x07MECALL2\x10+\x12\x19\n\x15\x41UTOMATEDVALETPARKING\x10,\x12\x11\n\rCHARGECONTROL\x10-\x12\x0e\n\nSPEEDALERT\x10.\x12\x1b\n\x17unknowncommandqueuetype\x10\x00\x12\t\n\x05\x64oors\x10\n\x12\x0b\n\x07\x61uxheat\x10\x0b\x12\x0b\n\x07precond\x10\x0c\x12\r\n\tchargeopt\x10\r\x12\x0f\n\x0bmaintenance\x10\x0e\x12\x07\n\x03tcu\x10\x0f\x12\x08\n\x04\x66\x65\x65\x64\x10\x10\x12\x15\n\x11serviceactivation\x10\x11\x12\x07\n\x03\x61tp\x10\x12\x12\x0e\n\nassistance\x10\x13\x12\x08\n\x04racp\x10\x14\x12\x0f\n\x0bweekprofile\x10\x15\x12\x13\n\x0fremotediagnosis\x10\x16\x12\x08\n\x04\x66lsh\x10\x17\x12\x0f\n\x0btemperature\x10\x18\x12\x0c\n\x08tripcomp\x10\x19\x12\n\n\x06\x65ngine\x10\x1a\x12\x0e\n\ntheftalarm\x10\x1b\x12\n\n\x06window\x10\x1c\x12\x0c\n\x08headunit\x10\x1d\x12\n\n\x06mecall\x10\x1f\x12\x0f\n\x0bimmobilizer\x10 \x12\x10\n\x0crentalsignal\x10!\x12\x07\n\x03\x62\x63\x66\x10\"\x12\x11\n\rplugandcharge\x10#\x12\x14\n\x10\x63\x61rsharingmodule\x10$\x12\x0b\n\x07\x62\x61ttery\x10%\x12\x11\n\ronboardfences\x10&\x12\x0f\n\x0bspeedfences\x10\'\x12\x13\n\x0f\x63hargingtariffs\x10(\x12\r\n\trtmconfig\x10)\x12\x17\n\x13maintenancecomputer\x10*\x12\x0b\n\x07mecall2\x10+\x12\x19\n\x15\x61utomatedvaletparking\x10,\x12\x11\n\rchargecontrol\x10-\x12\x0e\n\nspeedalert\x10.\x1a\x02\x10\x01\"\xa9\x31\n\x03\x41\x43P\"\xa1\x31\n\x0b\x43ommandType\x12\x16\n\x12UNKNOWNCOMMANDTYPE\x10\x00\x12\r\n\tDOORSLOCK\x10\x64\x12\x0f\n\x0b\x44OORSUNLOCK\x10n\x12\x0f\n\x0bTRUNKUNLOCK\x10s\x12\x12\n\x0e\x46UELFLAPUNLOCK\x10t\x12\x14\n\x10\x43HARGEFLAPUNLOCK\x10u\x12\x17\n\x13\x43HARGECOUPLERUNLOCK\x10v\x12\x16\n\x12\x44OORSPREPARERENTAL\x10x\x12\x17\n\x12\x44OORSSECUREVEHICLE\x10\x82\x01\x12\x11\n\x0c\x41UXHEATSTART\x10\xac\x02\x12\x10\n\x0b\x41UXHEATSTOP\x10\xb6\x02\x12\x15\n\x10\x41UXHEATCONFIGURE\x10\xc0\x02\x12\x19\n\x14TEMPERATURECONFIGURE\x10\xde\x02\x12\x19\n\x14WEEKPROFILECONFIGURE\x10\xe8\x02\x12\x1b\n\x16WEEKPROFILEV2CONFIGURE\x10\xf2\x02\x12\x11\n\x0cPRECONDSTART\x10\x90\x03\x12\x10\n\x0bPRECONDSTOP\x10\x9a\x03\x12\x15\n\x10PRECONDCONFIGURE\x10\xa4\x03\x12\x1a\n\x15PRECONDCONFIGURESEATS\x10\xa9\x03\x12\x17\n\x12\x43HARGEOPTCONFIGURE\x10\xae\x03\x12\x13\n\x0e\x43HARGEOPTSTART\x10\xb8\x03\x12\x12\n\rCHARGEOPTSTOP\x10\xc2\x03\x12\x0c\n\x07\x46\x45\x45\x44POI\x10\xf4\x03\x12\x11\n\x0c\x46\x45\x45\x44\x46REETEXT\x10\xfe\x03\x12\x10\n\x0b\x45NGINESTART\x10\xa6\x04\x12\x0f\n\nENGINESTOP\x10\xb0\x04\x12\x13\n\x0e\x45NGINEAVPSTART\x10\xba\x04\x12\x0e\n\tTCUWAKEUP\x10\xd8\x04\x12\x10\n\x0bTCUSWUPDATE\x10\xe2\x04\x12\x10\n\x0bTCURCSRESET\x10\xec\x04\x12\x15\n\x10TCUINTERROGATION\x10\xf6\x04\x12\x14\n\x0fSPEEDALERTSTART\x10\xc6\x05\x12\x13\n\x0eSPEEDALERTSTOP\x10\xd0\x05\x12\x0e\n\tFLSHSTART\x10\xee\x05\x12\r\n\x08\x46LSHSTOP\x10\xf8\x05\x12\x10\n\x0bSIGPOSSTART\x10\x82\x06\x12\x16\n\x11\x43ONTRACTCONFIGURE\x10\xa0\x06\x12\x13\n\x0e\x43ONTRACTREMOVE\x10\xaa\x06\x12\x12\n\rROOTCONFIGURE\x10\xb4\x06\x12\x0f\n\nROOTREMOVE\x10\xbe\x06\x12\r\n\x08TRIPCOMP\x10\xd2\x06\x12\x19\n\x14MAINTENANCECONFIGURE\x10\xa2\x07\x12\x1e\n\x19MAINTENANCECOMPUTEROFFSET\x10\xa3\x07\x12\x15\n\x10SHORTTESTEXECUTE\x10\xa7\x07\x12\x1f\n\x1aSERVICEACTIVATIONCONFIGURE\x10\xac\x07\x12\"\n\x1d\x44\x43\x32SERVICEACTIVATIONCONFIGURE\x10\xb1\x07\x12\x13\n\x0e\x44\x43\x32RAWDOWNLOAD\x10\xb6\x07\x12\x1d\n\x18\x41PPLICATIONCONFIGURATION\x10\xbb\x07\x12\x15\n\x10\x44\x43\x32STARTTRACKING\x10\xc0\x07\x12\x10\n\x0b\x41TPSEQUENCE\x10\xde\x07\x12\x1d\n\x18THEFTALARMTOGGLEINTERIOR\x10\xe8\x07\x12\x18\n\x13THEFTALARMTOGGLETOW\x10\xf2\x07\x12 \n\x1bTHEFTALARMSELECTINTERIORTOW\x10\xfc\x07\x12\"\n\x1dTHEFTALARMDESELECTINTERIORTOW\x10\x86\x08\x12\x13\n\x0eTHEFTALARMSTOP\x10\x90\x08\x12\x0f\n\nWINDOWOPEN\x10\xcc\x08\x12\x10\n\x0bWINDOWCLOSE\x10\xd6\x08\x12\x14\n\x0fWINDOWVENTILATE\x10\xe0\x08\x12\x0f\n\nWINDOWMOVE\x10\xe1\x08\x12\r\n\x08ROOFOPEN\x10\xea\x08\x12\x0e\n\tROOFCLOSE\x10\xf4\x08\x12\r\n\x08ROOFLIFT\x10\xfe\x08\x12\r\n\x08ROOFMOVE\x10\xff\x08\x12\x12\n\rBATTERYMAXSOC\x10\xd0\x0f\x12\x19\n\x14\x42\x41TTERYCHARGEPROGRAM\x10\xda\x0f\x12\x1b\n\x16\x43HARGEPROGRAMCONFIGURE\x10\xe4\x0f\x12\x18\n\x13ONBOARDFENCESCREATE\x10\xb4\x10\x12\x18\n\x13ONBOARDFENCESUPDATE\x10\xbe\x10\x12\x18\n\x13ONBOARDFENCESDELETE\x10\xc8\x10\x12\x16\n\x11SPEEDFENCESCREATE\x10\x98\x11\x12\x16\n\x11SPEEDFENCESUPDATE\x10\xa2\x11\x12\x16\n\x11SPEEDFENCESDELETE\x10\xac\x11\x12\x1a\n\x15\x43HARGINGTARIFFSCREATE\x10\xfc\x11\x12\x1a\n\x15\x43HARGINGTARIFFSUPDATE\x10\x86\x12\x12\x1a\n\x15\x43HARGINGTARIFFSDELETE\x10\x90\x12\x12\x14\n\x0fTHEFTALARMSTART\x10\xc4\x13\x12\x1d\n\x18THEFTALARMSELECTINTERIOR\x10\xce\x13\x12\x1f\n\x1aTHEFTALARMDESELECTINTERIOR\x10\xd8\x13\x12\x18\n\x13THEFTALARMSELECTTOW\x10\xe2\x13\x12\x1a\n\x15THEFTALARMDESELECTTOW\x10\xec\x13\x12$\n\x1fTHEFTALARMSELECTDAMAGEDETECTION\x10\xf6\x13\x12&\n!THEFTALARMDESELECTDAMAGEDETECTION\x10\x80\x14\x12%\n THEFTALARMCONFIRMDAMAGEDETECTION\x10\x8a\x14\x12\x11\n\x0cMECALL2START\x10\xa8\x14\x12\x1e\n\x19UDXTRIGGERSYNCHRONIZATION\x10\xb0\t\x12\x19\n\x14UDXACTIVEUSERPROFILE\x10\xba\t\x12\x15\n\x10UDXRESETUSERDATA\x10\xc4\t\x12\x12\n\rUSERPROFSYNCH\x10\xce\t\x12\x12\n\rUSERDATARESET\x10\xd8\t\x12\x17\n\x12PROFACTIVATIONSNAP\x10\xe2\t\x12\x19\n\x14PROFACTIVATIONDIRECT\x10\xe7\t\x12\x13\n\x0eSOFTWAREUPDATE\x10\xec\t\x12\x15\n\x10PUSHNOTIFICATION\x10\xf6\t\x12\x12\n\rMECALLCOMMAND\x10\x9e\n\x12\x14\n\x0fPRECONDSTARTRCS\x10\xf8\n\x12\x13\n\x0ePRECONDSTOPRCS\x10\x82\x0b\x12\x18\n\x13PRECONDCONFIGURERCS\x10\x8c\x0b\x12\x11\n\x0cTCUCONFIGURE\x10\x96\x0b\x12\x1c\n\x17\x45\x44ISONSERVICEACTIVATION\x10\x97\x0b\x12\x11\n\x0cTESTSEQUENCE\x10\x98\x0b\x12\x19\n\x14PRECONDCONFIGURERACP\x10\x99\x0b\x12\x1b\n\x16\x43HARGEOPTCONFIGURERACP\x10\x9a\x0b\x12\x18\n\x13TARIFFTABLEDOWNLOAD\x10\x9b\x0b\x12\x15\n\x10PRECONDSTARTRACP\x10\x9c\x0b\x12\x14\n\x0fPRECONDSTOPRACP\x10\x9d\x0b\x12\x1a\n\x15ROOTCERTIFICATEREMOVE\x10\x9e\x0b\x12\x19\n\x14ONREQUESTPROBEUPLOAD\x10\x9f\x0b\x12\x1c\n\x17ROOTCERTIFICATEDOWNLOAD\x10\xa0\x0b\x12\x1e\n\x19\x43ONTRACTCERTIFICATEREMOVE\x10\xa1\x0b\x12 \n\x1b\x43ONTRACTCERTIFICATEDOWNLOAD\x10\xa2\x0b\x12\x1d\n\x18PROBECONFIGURATIONUPDATE\x10\xa3\x0b\x12\x13\n\x0eRDIAGDELETEECU\x10\xdc\x0b\x12\x16\n\x11RDIAGSTATUSREPORT\x10\xdd\x0b\x12\x13\n\x0eRDIAGEXECUTION\x10\xde\x0b\x12\x19\n\x14IMMOBILIZERCHALLENGE\x10\xc0\x0c\x12\x1d\n\x18IMMOBILIZERSEARCHKEYLINE\x10\xca\x0c\x12\x1e\n\x19IMMOBILIZERRELEASEKEYLINE\x10\xd4\x0c\x12\x1b\n\x16IMMOBILIZERLOCKKEYLINE\x10\xde\x0c\x12\x1b\n\x16IMMOBILIZERLOCKVEHICLE\x10\xdf\x0c\x12\x1e\n\x19IMMOBILIZERRELEASEVEHICLE\x10\xd5\x0c\x12\x14\n\x0fSETRENTALSIGNAL\x10\xa4\r\x12\x19\n\x14\x42LACKCHANNELDOWNLOAD\x10\x88\x0e\x12\x17\n\x12\x42LACKCHANNELUPLOAD\x10\x92\x0e\x12\x11\n\x0c\x43ONFIGURECSM\x10\xec\x0e\x12\x16\n\x11UPDATEVEHICLEINFO\x10\xed\x0e\x12\x16\n\x11RELAYMESSAGETOCSM\x10\xee\x0e\x12\x1c\n\x17RELAYRENTALREQUESTTOCSB\x10\xef\x0e\x12\x16\n\x11RTMDOWNLOADCONFIG\x10\xe0\x12\x12\x12\n\rRTMREADCONFIG\x10\xea\x12\x12\x10\n\x0b\x41VPACTIVATE\x10\x8c\x15\x12\x1b\n\x16\x43HARGECONTROLCONFIGURE\x10\xf0\x15\x12\x16\n\x12unknownCommandType\x10\x00\x12\r\n\tdoorsLock\x10\x64\x12\x0f\n\x0b\x64oorsUnlock\x10n\x12\x0f\n\x0btrunkUnlock\x10s\x12\x12\n\x0e\x66uelflapUnlock\x10t\x12\x14\n\x10\x63hargeflapUnlock\x10u\x12\x17\n\x13\x63hargecouplerUnlock\x10v\x12\x16\n\x12\x64oorsPrepareRental\x10x\x12\x17\n\x12\x64oorsSecureVehicle\x10\x82\x01\x12\x11\n\x0c\x61uxheatStart\x10\xac\x02\x12\x10\n\x0b\x61uxheatStop\x10\xb6\x02\x12\x15\n\x10\x61uxheatConfigure\x10\xc0\x02\x12\x19\n\x14temperatureConfigure\x10\xde\x02\x12\x19\n\x14weekprofileConfigure\x10\xe8\x02\x12\x1b\n\x16weekprofileV2Configure\x10\xf2\x02\x12\x11\n\x0cprecondStart\x10\x90\x03\x12\x10\n\x0bprecondStop\x10\x9a\x03\x12\x15\n\x10precondConfigure\x10\xa4\x03\x12\x1a\n\x15precondConfigureSeats\x10\xa9\x03\x12\x17\n\x12\x63hargeoptConfigure\x10\xae\x03\x12\x13\n\x0e\x63hargeoptStart\x10\xb8\x03\x12\x12\n\rchargeoptStop\x10\xc2\x03\x12\x0c\n\x07\x66\x65\x65\x64Poi\x10\xf4\x03\x12\x11\n\x0c\x66\x65\x65\x64\x46reetext\x10\xfe\x03\x12\x10\n\x0b\x65ngineStart\x10\xa6\x04\x12\x0f\n\nengineStop\x10\xb0\x04\x12\x13\n\x0e\x65ngineAvpstart\x10\xba\x04\x12\x0e\n\ttcuWakeup\x10\xd8\x04\x12\x10\n\x0btcuSwUpdate\x10\xe2\x04\x12\x10\n\x0btcuRcsReset\x10\xec\x04\x12\x15\n\x10tcuInterrogation\x10\xf6\x04\x12\x14\n\x0fspeedalertStart\x10\xc6\x05\x12\x13\n\x0espeedalertStop\x10\xd0\x05\x12\x0e\n\tflshStart\x10\xee\x05\x12\r\n\x08\x66lshStop\x10\xf8\x05\x12\x10\n\x0bsigposStart\x10\x82\x06\x12\x16\n\x11\x63ontractConfigure\x10\xa0\x06\x12\x13\n\x0e\x63ontractRemove\x10\xaa\x06\x12\x12\n\rrootConfigure\x10\xb4\x06\x12\x0f\n\nrootRemove\x10\xbe\x06\x12\r\n\x08tripcomp\x10\xd2\x06\x12\x19\n\x14maintenanceConfigure\x10\xa2\x07\x12\x1e\n\x19maintenanceComputerOffset\x10\xa3\x07\x12\x15\n\x10shorttestExecute\x10\xa7\x07\x12\x1f\n\x1aserviceactivationConfigure\x10\xac\x07\x12\"\n\x1d\x64\x63\x32ServiceactivationConfigure\x10\xb1\x07\x12\x13\n\x0e\x64\x63\x32RawDownload\x10\xb6\x07\x12\x1d\n\x18\x61pplicationConfiguration\x10\xbb\x07\x12\x15\n\x10\x64\x63\x32StartTracking\x10\xc0\x07\x12\x10\n\x0b\x61tpSequence\x10\xde\x07\x12\x1d\n\x18theftalarmToggleInterior\x10\xe8\x07\x12\x18\n\x13theftalarmToggleTow\x10\xf2\x07\x12 \n\x1btheftalarmSelectInteriorTow\x10\xfc\x07\x12\"\n\x1dtheftalarmDeselectInteriorTow\x10\x86\x08\x12\x13\n\x0etheftalarmStop\x10\x90\x08\x12\x0f\n\nwindowOpen\x10\xcc\x08\x12\x10\n\x0bwindowClose\x10\xd6\x08\x12\x14\n\x0fwindowVentilate\x10\xe0\x08\x12\x0f\n\nwindowMove\x10\xe1\x08\x12\r\n\x08roofOpen\x10\xea\x08\x12\x0e\n\troofClose\x10\xf4\x08\x12\r\n\x08roofLift\x10\xfe\x08\x12\r\n\x08roofMove\x10\xff\x08\x12\x12\n\rbatteryMaxsoc\x10\xd0\x0f\x12\x19\n\x14\x62\x61tteryChargeprogram\x10\xda\x0f\x12\x1b\n\x16\x63hargeprogramconfigure\x10\xe4\x0f\x12\x18\n\x13onboardfencesCreate\x10\xb4\x10\x12\x18\n\x13onboardfencesUpdate\x10\xbe\x10\x12\x18\n\x13onboardfencesDelete\x10\xc8\x10\x12\x16\n\x11speedfencesCreate\x10\x98\x11\x12\x16\n\x11speedfencesUpdate\x10\xa2\x11\x12\x16\n\x11speedfencesDelete\x10\xac\x11\x12\x1a\n\x15\x63hargingtariffsCreate\x10\xfc\x11\x12\x1a\n\x15\x63hargingtariffsUpdate\x10\x86\x12\x12\x1a\n\x15\x63hargingtariffsDelete\x10\x90\x12\x12\x14\n\x0ftheftalarmstart\x10\xc4\x13\x12\x1d\n\x18theftalarmselectinterior\x10\xce\x13\x12\x1f\n\x1atheftalarmdeselectinterior\x10\xd8\x13\x12\x18\n\x13theftalarmselecttow\x10\xe2\x13\x12\x1a\n\x15theftalarmdeselecttow\x10\xec\x13\x12$\n\x1ftheftalarmselectdamagedetection\x10\xf6\x13\x12&\n!theftalarmdeselectdamagedetection\x10\x80\x14\x12%\n theftalarmconfirmdamagedetection\x10\x8a\x14\x12\x11\n\x0cmecall2start\x10\xa8\x14\x12\x1e\n\x19udxTriggerSynchronization\x10\xb0\t\x12\x19\n\x14udxActiveUserProfile\x10\xba\t\x12\x15\n\x10udxResetUserData\x10\xc4\t\x12\x12\n\ruserProfSynch\x10\xce\t\x12\x12\n\ruserDataReset\x10\xd8\t\x12\x17\n\x12profActivationSnap\x10\xe2\t\x12\x19\n\x14profActivationDirect\x10\xe7\t\x12\x13\n\x0esoftwareUpdate\x10\xec\t\x12\x15\n\x10pushNotification\x10\xf6\t\x12\x12\n\rmecallcommand\x10\x9e\n\x12\x14\n\x0fprecondStartRcs\x10\xf8\n\x12\x13\n\x0eprecondStopRcs\x10\x82\x0b\x12\x18\n\x13precondConfigureRcs\x10\x8c\x0b\x12\x11\n\x0ctcuConfigure\x10\x96\x0b\x12\x1c\n\x17\x65\x64isonServiceActivation\x10\x97\x0b\x12\x11\n\x0ctestSequence\x10\x98\x0b\x12\x19\n\x14precondConfigureRacp\x10\x99\x0b\x12\x1b\n\x16\x63hargeoptConfigureRacp\x10\x9a\x0b\x12\x18\n\x13tariffTableDownload\x10\x9b\x0b\x12\x15\n\x10precondStartRacp\x10\x9c\x0b\x12\x14\n\x0fprecondStopRacp\x10\x9d\x0b\x12\x1a\n\x15rootCertificateRemove\x10\x9e\x0b\x12\x19\n\x14onRequestProbeUpload\x10\x9f\x0b\x12\x1c\n\x17rootCertificateDownload\x10\xa0\x0b\x12\x1e\n\x19\x63ontractCertificateRemove\x10\xa1\x0b\x12 \n\x1b\x63ontractCertificateDownload\x10\xa2\x0b\x12\x1d\n\x18probeConfigurationUpdate\x10\xa3\x0b\x12\x13\n\x0erdiagDeleteEcu\x10\xdc\x0b\x12\x16\n\x11rdiagStatusReport\x10\xdd\x0b\x12\x13\n\x0erdiagExecution\x10\xde\x0b\x12\x19\n\x14immobilizerChallenge\x10\xc0\x0c\x12\x1d\n\x18immobilizerSearchKeyline\x10\xca\x0c\x12\x1e\n\x19immobilizerReleaseKeyline\x10\xd4\x0c\x12\x1b\n\x16immobilizerLockKeyline\x10\xde\x0c\x12\x1b\n\x16immobilizerLockVehicle\x10\xdf\x0c\x12\x1e\n\x19immobilizerReleaseVehicle\x10\xd5\x0c\x12\x14\n\x0fsetRentalSignal\x10\xa4\r\x12\x19\n\x14\x62lackchannelDownload\x10\x88\x0e\x12\x17\n\x12\x62lackchannelUpload\x10\x92\x0e\x12\x11\n\x0c\x63onfigurecsm\x10\xec\x0e\x12\x16\n\x11updatevehicleinfo\x10\xed\x0e\x12\x16\n\x11relaymessagetocsm\x10\xee\x0e\x12\x1c\n\x17relayrentalrequesttocsb\x10\xef\x0e\x12\x16\n\x11rtmDownloadConfig\x10\xe0\x12\x12\x12\n\rrtmReadConfig\x10\xea\x12\x12\x10\n\x0b\x61vpActivate\x10\x8c\x15\x12\x1b\n\x16\x63hargecontrolconfigure\x10\xf0\x15\x1a\x02\x10\x01\x42#\n\x1a\x63om.daimler.mbcarkit.proto\x90\x01\x01\xd0\xe1\x1e\x01\x62\x06proto3' , dependencies=[gogo__pb2.DESCRIPTOR,]) _VVA_COMMANDSTATE = _descriptor.EnumDescriptor( name='CommandState', full_name='proto.VVA.CommandState', filename=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name='UNKNOWN_COMMAND_STATE', index=0, number=0, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='CREATED', index=1, number=1010, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ENQUEUED', index=2, number=1016, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='PROCESSING', index=3, number=1012, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='SUSPENDED', index=4, number=1017, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='FINISHED', index=5, number=1018, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), ], containing_type=None, serialized_options=None, serialized_start=40, serialized_end=158, ) _sym_db.RegisterEnumDescriptor(_VVA_COMMANDSTATE) _VVA_COMMANDCONDITION = _descriptor.EnumDescriptor( name='CommandCondition', full_name='proto.VVA.CommandCondition', filename=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name='UNKNWON_COMMAND_CONDITION', index=0, number=0, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='NONE', index=1, number=1000, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ACCEPTED', index=2, number=1001, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='REJECTED', index=3, number=1002, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='TERMINATE', index=4, number=1003, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='SUCCESS', index=5, number=1011, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='FAILED', index=6, number=1013, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='OVERWRITTEN', index=7, number=1014, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='TIMEOUT', index=8, number=1015, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), ], containing_type=None, serialized_options=None, serialized_start=161, serialized_end=326, ) _sym_db.RegisterEnumDescriptor(_VVA_COMMANDCONDITION) _VEHICLEAPI_COMMANDSTATE = _descriptor.EnumDescriptor( name='CommandState', full_name='proto.VehicleAPI.CommandState', filename=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name='UNKNOWN_COMMAND_STATE', index=0, number=0, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='INITIATION', index=1, number=1, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ENQUEUED', index=2, number=2, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='PROCESSING', index=3, number=3, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='WAITING', index=4, number=4, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='FINISHED', index=5, number=5, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='FAILED', index=6, number=6, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), ], containing_type=None, serialized_options=None, serialized_start=343, serialized_end=469, ) _sym_db.RegisterEnumDescriptor(_VEHICLEAPI_COMMANDSTATE) _VEHICLEAPI_ATTRIBUTESTATUS = _descriptor.EnumDescriptor( name='AttributeStatus', full_name='proto.VehicleAPI.AttributeStatus', filename=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name='VALUE_SET', index=0, number=0, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='VALUE_NOT_SET', index=1, number=1, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='INVALID', index=2, number=3, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='NOT_AVAILABLE', index=3, number=4, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), ], containing_type=None, serialized_options=None, serialized_start=471, serialized_end=554, ) _sym_db.RegisterEnumDescriptor(_VEHICLEAPI_ATTRIBUTESTATUS) _VEHICLEAPI_QUEUETYPE = _descriptor.EnumDescriptor( name='QueueType', full_name='proto.VehicleAPI.QueueType', filename=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name='UNKNOWNCOMMANDQUEUETYPE', index=0, number=0, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='DOORS', index=1, number=10, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='AUXHEAT', index=2, number=11, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='PRECOND', index=3, number=12, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='CHARGEOPT', index=4, number=13, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='MAINTENANCE', index=5, number=14, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='TCU', index=6, number=15, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='FEED', index=7, number=16, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='SERVICEACTIVATION', index=8, number=17, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ATP', index=9, number=18, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ASSISTANCE', index=10, number=19, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='RACP', index=11, number=20, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='WEEKPROFILE', index=12, number=21, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='REMOTEDIAGNOSIS', index=13, number=22, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='FLSH', index=14, number=23, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='TEMPERATURE', index=15, number=24, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='TRIPCOMP', index=16, number=25, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ENGINE', index=17, number=26, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='THEFTALARM', index=18, number=27, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='WINDOW', index=19, number=28, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='HEADUNIT', index=20, number=29, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='MECALL', index=21, number=31, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='IMMOBILIZER', index=22, number=32, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='RENTALSIGNAL', index=23, number=33, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='BCF', index=24, number=34, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='PLUGANDCHARGE', index=25, number=35, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='CARSHARINGMODULE', index=26, number=36, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='BATTERY', index=27, number=37, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ONBOARDFENCES', index=28, number=38, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='SPEEDFENCES', index=29, number=39, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='CHARGINGTARIFFS', index=30, number=40, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='RTMCONFIG', index=31, number=41, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='MAINTENANCECOMPUTER', index=32, number=42, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='MECALL2', index=33, number=43, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='AUTOMATEDVALETPARKING', index=34, number=44, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='CHARGECONTROL', index=35, number=45, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='SPEEDALERT', index=36, number=46, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='unknowncommandqueuetype', index=37, number=0, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='doors', index=38, number=10, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='auxheat', index=39, number=11, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='precond', index=40, number=12, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='chargeopt', index=41, number=13, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='maintenance', index=42, number=14, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='tcu', index=43, number=15, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='feed', index=44, number=16, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='serviceactivation', index=45, number=17, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='atp', index=46, number=18, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='assistance', index=47, number=19, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='racp', index=48, number=20, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='weekprofile', index=49, number=21, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='remotediagnosis', index=50, number=22, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='flsh', index=51, number=23, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='temperature', index=52, number=24, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='tripcomp', index=53, number=25, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='engine', index=54, number=26, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='theftalarm', index=55, number=27, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='window', index=56, number=28, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='headunit', index=57, number=29, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='mecall', index=58, number=31, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='immobilizer', index=59, number=32, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='rentalsignal', index=60, number=33, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='bcf', index=61, number=34, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='plugandcharge', index=62, number=35, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='carsharingmodule', index=63, number=36, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='battery', index=64, number=37, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='onboardfences', index=65, number=38, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='speedfences', index=66, number=39, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='chargingtariffs', index=67, number=40, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='rtmconfig', index=68, number=41, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='maintenancecomputer', index=69, number=42, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='mecall2', index=70, number=43, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='automatedvaletparking', index=71, number=44, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='chargecontrol', index=72, number=45, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='speedalert', index=73, number=46, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), ], containing_type=None, serialized_options=b'\020\001', serialized_start=557, serialized_end=1752, ) _sym_db.RegisterEnumDescriptor(_VEHICLEAPI_QUEUETYPE) _ACP_COMMANDTYPE = _descriptor.EnumDescriptor( name='CommandType', full_name='proto.ACP.CommandType', filename=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name='UNKNOWNCOMMANDTYPE', index=0, number=0, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='DOORSLOCK', index=1, number=100, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='DOORSUNLOCK', index=2, number=110, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='TRUNKUNLOCK', index=3, number=115, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='FUELFLAPUNLOCK', index=4, number=116, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='CHARGEFLAPUNLOCK', index=5, number=117, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='CHARGECOUPLERUNLOCK', index=6, number=118, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='DOORSPREPARERENTAL', index=7, number=120, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='DOORSSECUREVEHICLE', index=8, number=130, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='AUXHEATSTART', index=9, number=300, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='AUXHEATSTOP', index=10, number=310, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='AUXHEATCONFIGURE', index=11, number=320, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='TEMPERATURECONFIGURE', index=12, number=350, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='WEEKPROFILECONFIGURE', index=13, number=360, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='WEEKPROFILEV2CONFIGURE', index=14, number=370, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='PRECONDSTART', index=15, number=400, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='PRECONDSTOP', index=16, number=410, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='PRECONDCONFIGURE', index=17, number=420, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='PRECONDCONFIGURESEATS', index=18, number=425, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='CHARGEOPTCONFIGURE', index=19, number=430, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='CHARGEOPTSTART', index=20, number=440, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='CHARGEOPTSTOP', index=21, number=450, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='FEEDPOI', index=22, number=500, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='FEEDFREETEXT', index=23, number=510, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ENGINESTART', index=24, number=550, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ENGINESTOP', index=25, number=560, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ENGINEAVPSTART', index=26, number=570, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='TCUWAKEUP', index=27, number=600, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='TCUSWUPDATE', index=28, number=610, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='TCURCSRESET', index=29, number=620, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='TCUINTERROGATION', index=30, number=630, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='SPEEDALERTSTART', index=31, number=710, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='SPEEDALERTSTOP', index=32, number=720, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='FLSHSTART', index=33, number=750, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='FLSHSTOP', index=34, number=760, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='SIGPOSSTART', index=35, number=770, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='CONTRACTCONFIGURE', index=36, number=800, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='CONTRACTREMOVE', index=37, number=810, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ROOTCONFIGURE', index=38, number=820, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ROOTREMOVE', index=39, number=830, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='TRIPCOMP', index=40, number=850, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='MAINTENANCECONFIGURE', index=41, number=930, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='MAINTENANCECOMPUTEROFFSET', index=42, number=931, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='SHORTTESTEXECUTE', index=43, number=935, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='SERVICEACTIVATIONCONFIGURE', index=44, number=940, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='DC2SERVICEACTIVATIONCONFIGURE', index=45, number=945, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='DC2RAWDOWNLOAD', index=46, number=950, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='APPLICATIONCONFIGURATION', index=47, number=955, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='DC2STARTTRACKING', index=48, number=960, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ATPSEQUENCE', index=49, number=990, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='THEFTALARMTOGGLEINTERIOR', index=50, number=1000, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='THEFTALARMTOGGLETOW', index=51, number=1010, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='THEFTALARMSELECTINTERIORTOW', index=52, number=1020, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='THEFTALARMDESELECTINTERIORTOW', index=53, number=1030, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='THEFTALARMSTOP', index=54, number=1040, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='WINDOWOPEN', index=55, number=1100, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='WINDOWCLOSE', index=56, number=1110, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='WINDOWVENTILATE', index=57, number=1120, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='WINDOWMOVE', index=58, number=1121, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ROOFOPEN', index=59, number=1130, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ROOFCLOSE', index=60, number=1140, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ROOFLIFT', index=61, number=1150, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ROOFMOVE', index=62, number=1151, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='BATTERYMAXSOC', index=63, number=2000, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='BATTERYCHARGEPROGRAM', index=64, number=2010, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='CHARGEPROGRAMCONFIGURE', index=65, number=2020, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ONBOARDFENCESCREATE', index=66, number=2100, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ONBOARDFENCESUPDATE', index=67, number=2110, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ONBOARDFENCESDELETE', index=68, number=2120, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='SPEEDFENCESCREATE', index=69, number=2200, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='SPEEDFENCESUPDATE', index=70, number=2210, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='SPEEDFENCESDELETE', index=71, number=2220, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='CHARGINGTARIFFSCREATE', index=72, number=2300, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='CHARGINGTARIFFSUPDATE', index=73, number=2310, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='CHARGINGTARIFFSDELETE', index=74, number=2320, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='THEFTALARMSTART', index=75, number=2500, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='THEFTALARMSELECTINTERIOR', index=76, number=2510, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='THEFTALARMDESELECTINTERIOR', index=77, number=2520, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='THEFTALARMSELECTTOW', index=78, number=2530, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='THEFTALARMDESELECTTOW', index=79, number=2540, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='THEFTALARMSELECTDAMAGEDETECTION', index=80, number=2550, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='THEFTALARMDESELECTDAMAGEDETECTION', index=81, number=2560, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='THEFTALARMCONFIRMDAMAGEDETECTION', index=82, number=2570, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='MECALL2START', index=83, number=2600, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='UDXTRIGGERSYNCHRONIZATION', index=84, number=1200, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='UDXACTIVEUSERPROFILE', index=85, number=1210, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='UDXRESETUSERDATA', index=86, number=1220, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='USERPROFSYNCH', index=87, number=1230, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='USERDATARESET', index=88, number=1240, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='PROFACTIVATIONSNAP', index=89, number=1250, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='PROFACTIVATIONDIRECT', index=90, number=1255, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='SOFTWAREUPDATE', index=91, number=1260, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='PUSHNOTIFICATION', index=92, number=1270, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='MECALLCOMMAND', index=93, number=1310, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='PRECONDSTARTRCS', index=94, number=1400, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='PRECONDSTOPRCS', index=95, number=1410, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='PRECONDCONFIGURERCS', index=96, number=1420, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='TCUCONFIGURE', index=97, number=1430, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='EDISONSERVICEACTIVATION', index=98, number=1431, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='TESTSEQUENCE', index=99, number=1432, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='PRECONDCONFIGURERACP', index=100, number=1433, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='CHARGEOPTCONFIGURERACP', index=101, number=1434, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='TARIFFTABLEDOWNLOAD', index=102, number=1435, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='PRECONDSTARTRACP', index=103, number=1436, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='PRECONDSTOPRACP', index=104, number=1437, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ROOTCERTIFICATEREMOVE', index=105, number=1438, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ONREQUESTPROBEUPLOAD', index=106, number=1439, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ROOTCERTIFICATEDOWNLOAD', index=107, number=1440, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='CONTRACTCERTIFICATEREMOVE', index=108, number=1441, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='CONTRACTCERTIFICATEDOWNLOAD', index=109, number=1442, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='PROBECONFIGURATIONUPDATE', index=110, number=1443, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='RDIAGDELETEECU', index=111, number=1500, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='RDIAGSTATUSREPORT', index=112, number=1501, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='RDIAGEXECUTION', index=113, number=1502, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='IMMOBILIZERCHALLENGE', index=114, number=1600, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='IMMOBILIZERSEARCHKEYLINE', index=115, number=1610, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='IMMOBILIZERRELEASEKEYLINE', index=116, number=1620, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='IMMOBILIZERLOCKKEYLINE', index=117, number=1630, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='IMMOBILIZERLOCKVEHICLE', index=118, number=1631, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='IMMOBILIZERRELEASEVEHICLE', index=119, number=1621, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='SETRENTALSIGNAL', index=120, number=1700, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='BLACKCHANNELDOWNLOAD', index=121, number=1800, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='BLACKCHANNELUPLOAD', index=122, number=1810, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='CONFIGURECSM', index=123, number=1900, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='UPDATEVEHICLEINFO', index=124, number=1901, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='RELAYMESSAGETOCSM', index=125, number=1902, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='RELAYRENTALREQUESTTOCSB', index=126, number=1903, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='RTMDOWNLOADCONFIG', index=127, number=2400, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='RTMREADCONFIG', index=128, number=2410, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='AVPACTIVATE', index=129, number=2700, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='CHARGECONTROLCONFIGURE', index=130, number=2800, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='unknownCommandType', index=131, number=0, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='doorsLock', index=132, number=100, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='doorsUnlock', index=133, number=110, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='trunkUnlock', index=134, number=115, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='fuelflapUnlock', index=135, number=116, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='chargeflapUnlock', index=136, number=117, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='chargecouplerUnlock', index=137, number=118, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='doorsPrepareRental', index=138, number=120, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='doorsSecureVehicle', index=139, number=130, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='auxheatStart', index=140, number=300, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='auxheatStop', index=141, number=310, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='auxheatConfigure', index=142, number=320, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='temperatureConfigure', index=143, number=350, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='weekprofileConfigure', index=144, number=360, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='weekprofileV2Configure', index=145, number=370, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='precondStart', index=146, number=400, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='precondStop', index=147, number=410, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='precondConfigure', index=148, number=420, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='precondConfigureSeats', index=149, number=425, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='chargeoptConfigure', index=150, number=430, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='chargeoptStart', index=151, number=440, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='chargeoptStop', index=152, number=450, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='feedPoi', index=153, number=500, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='feedFreetext', index=154, number=510, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='engineStart', index=155, number=550, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='engineStop', index=156, number=560, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='engineAvpstart', index=157, number=570, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='tcuWakeup', index=158, number=600, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='tcuSwUpdate', index=159, number=610, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='tcuRcsReset', index=160, number=620, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='tcuInterrogation', index=161, number=630, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='speedalertStart', index=162, number=710, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='speedalertStop', index=163, number=720, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='flshStart', index=164, number=750, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='flshStop', index=165, number=760, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='sigposStart', index=166, number=770, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='contractConfigure', index=167, number=800, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='contractRemove', index=168, number=810, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='rootConfigure', index=169, number=820, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='rootRemove', index=170, number=830, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='tripcomp', index=171, number=850, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='maintenanceConfigure', index=172, number=930, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='maintenanceComputerOffset', index=173, number=931, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='shorttestExecute', index=174, number=935, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='serviceactivationConfigure', index=175, number=940, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='dc2ServiceactivationConfigure', index=176, number=945, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='dc2RawDownload', index=177, number=950, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='applicationConfiguration', index=178, number=955, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='dc2StartTracking', index=179, number=960, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='atpSequence', index=180, number=990, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='theftalarmToggleInterior', index=181, number=1000, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='theftalarmToggleTow', index=182, number=1010, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='theftalarmSelectInteriorTow', index=183, number=1020, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='theftalarmDeselectInteriorTow', index=184, number=1030, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='theftalarmStop', index=185, number=1040, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='windowOpen', index=186, number=1100, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='windowClose', index=187, number=1110, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='windowVentilate', index=188, number=1120, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='windowMove', index=189, number=1121, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='roofOpen', index=190, number=1130, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='roofClose', index=191, number=1140, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='roofLift', index=192, number=1150, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='roofMove', index=193, number=1151, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='batteryMaxsoc', index=194, number=2000, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='batteryChargeprogram', index=195, number=2010, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='chargeprogramconfigure', index=196, number=2020, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='onboardfencesCreate', index=197, number=2100, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='onboardfencesUpdate', index=198, number=2110, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='onboardfencesDelete', index=199, number=2120, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='speedfencesCreate', index=200, number=2200, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='speedfencesUpdate', index=201, number=2210, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='speedfencesDelete', index=202, number=2220, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='chargingtariffsCreate', index=203, number=2300, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='chargingtariffsUpdate', index=204, number=2310, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='chargingtariffsDelete', index=205, number=2320, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='theftalarmstart', index=206, number=2500, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='theftalarmselectinterior', index=207, number=2510, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='theftalarmdeselectinterior', index=208, number=2520, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='theftalarmselecttow', index=209, number=2530, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='theftalarmdeselecttow', index=210, number=2540, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='theftalarmselectdamagedetection', index=211, number=2550, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='theftalarmdeselectdamagedetection', index=212, number=2560, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='theftalarmconfirmdamagedetection', index=213, number=2570, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='mecall2start', index=214, number=2600, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='udxTriggerSynchronization', index=215, number=1200, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='udxActiveUserProfile', index=216, number=1210, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='udxResetUserData', index=217, number=1220, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='userProfSynch', index=218, number=1230, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='userDataReset', index=219, number=1240, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='profActivationSnap', index=220, number=1250, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='profActivationDirect', index=221, number=1255, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='softwareUpdate', index=222, number=1260, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='pushNotification', index=223, number=1270, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='mecallcommand', index=224, number=1310, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='precondStartRcs', index=225, number=1400, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='precondStopRcs', index=226, number=1410, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='precondConfigureRcs', index=227, number=1420, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='tcuConfigure', index=228, number=1430, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='edisonServiceActivation', index=229, number=1431, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='testSequence', index=230, number=1432, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='precondConfigureRacp', index=231, number=1433, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='chargeoptConfigureRacp', index=232, number=1434, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='tariffTableDownload', index=233, number=1435, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='precondStartRacp', index=234, number=1436, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='precondStopRacp', index=235, number=1437, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='rootCertificateRemove', index=236, number=1438, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='onRequestProbeUpload', index=237, number=1439, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='rootCertificateDownload', index=238, number=1440, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='contractCertificateRemove', index=239, number=1441, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='contractCertificateDownload', index=240, number=1442, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='probeConfigurationUpdate', index=241, number=1443, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='rdiagDeleteEcu', index=242, number=1500, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='rdiagStatusReport', index=243, number=1501, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='rdiagExecution', index=244, number=1502, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='immobilizerChallenge', index=245, number=1600, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='immobilizerSearchKeyline', index=246, number=1610, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='immobilizerReleaseKeyline', index=247, number=1620, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='immobilizerLockKeyline', index=248, number=1630, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='immobilizerLockVehicle', index=249, number=1631, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='immobilizerReleaseVehicle', index=250, number=1621, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='setRentalSignal', index=251, number=1700, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='blackchannelDownload', index=252, number=1800, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='blackchannelUpload', index=253, number=1810, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='configurecsm', index=254, number=1900, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='updatevehicleinfo', index=255, number=1901, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='relaymessagetocsm', index=256, number=1902, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='relayrentalrequesttocsb', index=257, number=1903, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='rtmDownloadConfig', index=258, number=2400, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='rtmReadConfig', index=259, number=2410, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='avpActivate', index=260, number=2700, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='chargecontrolconfigure', index=261, number=2800, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), ], containing_type=None, serialized_options=b'\020\001', serialized_start=1763, serialized_end=8068, ) _sym_db.RegisterEnumDescriptor(_ACP_COMMANDTYPE) _VVA = _descriptor.Descriptor( name='VVA', full_name='proto.VVA', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ ], extensions=[ ], nested_types=[], enum_types=[ _VVA_COMMANDSTATE, _VVA_COMMANDCONDITION, ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=33, serialized_end=326, ) _VEHICLEAPI = _descriptor.Descriptor( name='VehicleAPI', full_name='proto.VehicleAPI', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ ], extensions=[ ], nested_types=[], enum_types=[ _VEHICLEAPI_COMMANDSTATE, _VEHICLEAPI_ATTRIBUTESTATUS, _VEHICLEAPI_QUEUETYPE, ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=329, serialized_end=1752, ) _ACP = _descriptor.Descriptor( name='ACP', full_name='proto.ACP', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ ], extensions=[ ], nested_types=[], enum_types=[ _ACP_COMMANDTYPE, ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=1755, serialized_end=8068, ) _VVA_COMMANDSTATE.containing_type = _VVA _VVA_COMMANDCONDITION.containing_type = _VVA _VEHICLEAPI_COMMANDSTATE.containing_type = _VEHICLEAPI _VEHICLEAPI_ATTRIBUTESTATUS.containing_type = _VEHICLEAPI _VEHICLEAPI_QUEUETYPE.containing_type = _VEHICLEAPI _ACP_COMMANDTYPE.containing_type = _ACP DESCRIPTOR.message_types_by_name['VVA'] = _VVA DESCRIPTOR.message_types_by_name['VehicleAPI'] = _VEHICLEAPI DESCRIPTOR.message_types_by_name['ACP'] = _ACP _sym_db.RegisterFileDescriptor(DESCRIPTOR) VVA = _reflection.GeneratedProtocolMessageType('VVA', (_message.Message,), { 'DESCRIPTOR' : _VVA, '__module__' : 'acp_pb2' # @@protoc_insertion_point(class_scope:proto.VVA) }) _sym_db.RegisterMessage(VVA) VehicleAPI = _reflection.GeneratedProtocolMessageType('VehicleAPI', (_message.Message,), { 'DESCRIPTOR' : _VEHICLEAPI, '__module__' : 'acp_pb2' # @@protoc_insertion_point(class_scope:proto.VehicleAPI) }) _sym_db.RegisterMessage(VehicleAPI) ACP = _reflection.GeneratedProtocolMessageType('ACP', (_message.Message,), { 'DESCRIPTOR' : _ACP, '__module__' : 'acp_pb2' # @@protoc_insertion_point(class_scope:proto.ACP) }) _sym_db.RegisterMessage(ACP) DESCRIPTOR._options = None _VEHICLEAPI_QUEUETYPE._options = None _ACP_COMMANDTYPE._options = None # @@protoc_insertion_point(module_scope)
43.631168
14,931
0.740687
82f79bc5bf128b18eacd7d7a60bb82df70b8c973
5,632
py
Python
src/promnesia/sources/reddit.py
seanbreckenridge/promnesia-fork
92ac664176c8101672cbab90ea6964c360ff287e
[ "MIT" ]
2
2018-06-04T05:59:02.000Z
2019-08-25T21:45:07.000Z
src/promnesia/sources/reddit.py
seanbreckenridge/promnesia-fork
92ac664176c8101672cbab90ea6964c360ff287e
[ "MIT" ]
1
2019-07-14T13:23:45.000Z
2019-07-14T13:23:45.000Z
src/promnesia/sources/reddit.py
seanbreckenridge/promnesia-fork
92ac664176c8101672cbab90ea6964c360ff287e
[ "MIT" ]
null
null
null
''' Uses HPI [[https://github.com/karlicoss/HPI/blob/master/doc/MODULES.org#myreddit][reddit]] module ''' from itertools import chain from typing import Set, Optional from ..common import Visit, Loc, extract_urls, Results, logger # mostly here so we can keep track of how the user # wants to render markdown import typing if typing.TYPE_CHECKING: from my.reddit.common import Submission, Comment, Save, Upvote, RedditBase
32.182857
133
0.588956
82f8c42e4b7f145f7c76d62522e5c2d2fdd59996
8,992
py
Python
puwifi.py
SaicharanKandukuri/logmein
9946488fb61093bf2394254da056d2ebd290e83a
[ "MIT" ]
4
2021-12-01T12:07:49.000Z
2022-03-16T15:11:57.000Z
puwifi.py
SaicharanKandukuri/puwifi
9946488fb61093bf2394254da056d2ebd290e83a
[ "MIT" ]
10
2021-12-01T11:41:04.000Z
2022-03-16T16:12:36.000Z
puwifi.py
SaicharanKandukuri/logmein
9946488fb61093bf2394254da056d2ebd290e83a
[ "MIT" ]
2
2021-11-29T16:16:22.000Z
2021-11-30T05:06:05.000Z
import optparse import sys from sys import getsizeof import logging from signal import signal, SIGINT import time import requests # MIT License # # Copyright (c) 2022 SaicharanKandukuri # # 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 rich.logging import RichHandler FORMAT = "%(message)s" logging.basicConfig( level="NOTSET", format=FORMAT, datefmt="[%X]", handlers=[RichHandler()] ) logging.disable('DEBUG') log = logging.getLogger("rich") # def get_xml_msg(xml): # for later ('') # return Et.parse(xml).getroot()[1] def grey_print(_string): """prints outs grey text Args: _string (str) """ print(f"\033[90m{_string}\033[0m") def connection_to(url, timeout=10): """checks if connection to url is available""" try: requests.get(url, timeout=timeout) return True except (requests.ConnectionError, requests.Timeout): return False def keep_alive(username, password, host, port): """keeps connection alive to wifi host""" while True: if connection_to("http://10.0.0.11:8090/"): log.info("connection to router \"available\"") else: log.critical("connection to router \"unavailable\"") if connection_to("https://google.com"): log.info("Connected to the internet") else: log.warning("Not connected to the internet") log.info("Tying to login back") try: log.info(WifiUtils.login(username, password, host, port)) except (requests.ConnectionError, requests.Timeout): log.critical( "Connection error: \"UNSTABLE CONNECTION TO HOST\"") time.sleep(5) def exit_handler(_signal, frame): """captures keyboard interrupts and kill signals & exits with messesage""" log.warning('SIGINT or CTRL-C detected. Exiting gracefully') grey_print("signal:"+str(_signal)) grey_print("frame:"+str(frame)) sys.exit(0) if __name__ == '__main__': signal(SIGINT, exit_handler) parser = optparse.OptionParser() parser.add_option('-u', '--username', dest='username', help='username to login/logout with parul university wifi service') parser.add_option('-p', '--password', dest='password', help='password to login/logout with parul university wifi service') parser.add_option('-H', '--host', dest='host', default='10.0.0.11', type=str) parser.add_option('-P', '--port', dest='port', default='8090', type=str) parser.add_option('-k', '--keep-alive', action='store_true', help='keep connecting to wifi when it gets signed out', default=False) parser.add_option('-o', '--logout', action='store_true', help='logout from wifi', default=False) parser.add_option('-l', '--login', action='store_true', help='login to wifi', default=False) options, args = parser.parse_args() WifiUtils = WifiUtils( options.username, options.password, options.host, options.port) if options.login: log.info("=> login <=") log.info(WifiUtils.login(options.username, options.password, options.host, options.port, )) sys.exit(0) if options.logout: log.info("=> logout <=") log.info(WifiUtils.logout(options.username, options.password, options.host, options.port, )) sys.exit(0) if options.keep_alive: log.info("=> keep alive <=") keep_alive(options.username, options.password, options.host, options.port, )
36.702041
98
0.585187
82fa552a0171833c0c07fa00ed134b17a1330763
2,974
py
Python
sphinxsimulink/diagram/application.py
dekalinowski/sphinx-simulink
f86daf2efdd7b0c84307bfb17c23efff0c72a8a9
[ "MIT" ]
2
2017-12-06T00:58:05.000Z
2020-05-27T21:00:59.000Z
sphinxsimulink/diagram/application.py
dekalinowski/sphinx-simulink
f86daf2efdd7b0c84307bfb17c23efff0c72a8a9
[ "MIT" ]
null
null
null
sphinxsimulink/diagram/application.py
dekalinowski/sphinx-simulink
f86daf2efdd7b0c84307bfb17c23efff0c72a8a9
[ "MIT" ]
2
2020-01-24T09:17:11.000Z
2020-04-02T10:15:02.000Z
""" sphinx-simulink.application ~~~~~~~~~~~~~~~~~~~~~~~ Embed Simulink diagrams on your documentation. :copyright: Copyright 2016 by Dennis Edward Kalinowski <dekalinowski@gmail.com>. :license: MIT, see LICENSE for details. """ import matlab.engine import os from sphinx.errors import SphinxError from sphinx.util.osutil import ensuredir from sphinxsimulink.diagram import directives,nodes from sphinxsimulink.metadata import __version__ engine = None
23.983871
78
0.613652
82fb854e5de1301c151e67839d828f2c3db87864
221
py
Python
bentoml/pytorch_lightning.py
francoisserra/BentoML
213e9e9b39e055286f2649c733907df88e6d2503
[ "Apache-2.0" ]
1
2021-06-12T17:04:07.000Z
2021-06-12T17:04:07.000Z
bentoml/pytorch_lightning.py
francoisserra/BentoML
213e9e9b39e055286f2649c733907df88e6d2503
[ "Apache-2.0" ]
4
2021-05-16T08:06:25.000Z
2021-11-13T08:46:36.000Z
bentoml/pytorch_lightning.py
francoisserra/BentoML
213e9e9b39e055286f2649c733907df88e6d2503
[ "Apache-2.0" ]
null
null
null
from ._internal.frameworks.pytorch_lightning import load from ._internal.frameworks.pytorch_lightning import save from ._internal.frameworks.pytorch_lightning import load_runner __all__ = ["load", "load_runner", "save"]
36.833333
63
0.828054
82fd258b0956b6fcb923493f7bbd91bb6546c5c0
335
py
Python
bugex_online/bugex_webapp/templatetags/custom_tags.py
fkleon/bugex-online
bf0687ff6167d66980eb44adcdb14e8fc65d9504
[ "Apache-2.0" ]
null
null
null
bugex_online/bugex_webapp/templatetags/custom_tags.py
fkleon/bugex-online
bf0687ff6167d66980eb44adcdb14e8fc65d9504
[ "Apache-2.0" ]
7
2020-06-30T23:15:12.000Z
2022-02-01T00:57:38.000Z
bugex_online/bugex_webapp/templatetags/custom_tags.py
fkleon/bugex-online
bf0687ff6167d66980eb44adcdb14e8fc65d9504
[ "Apache-2.0" ]
null
null
null
from django import template from django.conf import settings register = template.Library()
22.333333
82
0.707463
82fd4ff37849618d568dd247a4ca0ff25544b1fd
13,195
py
Python
CreateRobot.py
KonstantinosAng/KinectPython
cb2c7822dd9ef959230d9488aaa3de8ec1816e08
[ "MIT" ]
5
2020-08-06T04:28:27.000Z
2022-03-23T09:10:29.000Z
CreateRobot.py
KonstantinosAng/KinectPython
cb2c7822dd9ef959230d9488aaa3de8ec1816e08
[ "MIT" ]
4
2020-11-28T07:23:40.000Z
2022-03-28T08:57:07.000Z
CreateRobot.py
KonstantinosAng/KinectPython
cb2c7822dd9ef959230d9488aaa3de8ec1816e08
[ "MIT" ]
1
2020-10-18T02:39:55.000Z
2020-10-18T02:39:55.000Z
""" Author: Konstantinos Angelopoulos Date: 04/02/2020 All rights reserved. Feel free to use and modify and if you like it give it a star. Import the Robot's Step Files and Color/Scale/Assemble them using the instructions in /RoboDK/KUKA/KUKA LWR IV+ Description (for Original=kuka_lwr_model_description.json, for custom=custom_kuka_lwr_model_description, for custom2=custom_kuka_lwr_model_description_2) before running the code to complete the robot model. ######################################################################### ######### To quickly color and scale use the next lines of code ######### ######################################################################### from robolink import * # RoboDK API from robodk import * # Robot toolbox RDK = Robolink() for station in RDK.ItemList(): for item in station.Childs(): item.Scale(1000) item.setColor(255/255, 85/255, 0/255, 255/255) ######################################################################## #### For custom2 run these commands before assembling the stl files #### ######################################################################## from robolink import * # RoboDK API from robodk import * # Robot toolbox import numpy as np RDK = Robolink() for station in RDK.ItemList(): for item in station.Childs(): item.setGeometryPose(item.Pose()*rotz(np.pi)) item.Scale(1000) item.setColor(255/255, 85/255, 0/255, 255/255) and after building the mechanism and import it, in order to rotate the robot run: from robolink import * # RoboDK API from robodk import * # Robot toolbox RDK = Robolink() ref = RDK.Item('reference2') ref.setPoseAbs(ref.Pose()*rotz(pi)) ############################################################################################## ##### The original option is just the robot model without any inverted sense and joints ###### ##### home are [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] ########################################### ############################################################################################## ##### The custom robot is the real model that has the same limitations, home joints and ###### ##### senses as the REAl KUKA LWR but the X and Y axis system are inverted ################### ############################################################################################## ##### The custom2 robot is the same as the custom option but with the X and Y axis being ##### ##### the same as the REAL KUKA ROBOT ######################################################## ############################################################################################## """ # Start the RoboDK API from robolink.robolink import * from robodk.robodk import * import json import os # ORIGINAL ROBOT DATA with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'RoboDK/KUKA/KUKA LWR IV+ Description/kuka_lwr_model_description.json')) as config_file: data = json.load(config_file) original_robot_name = data['Robot name'] original_robot_dof = data['DOF'] original_robot_joint1 = data['Joint 1'] original_robot_joint2 = data['Joint 2'] original_robot_joint3 = data['Joint 3'] original_robot_joint4 = data['Joint 4'] original_robot_joint5 = data['Joint 5'] original_robot_joint6 = data['Joint 6'] original_robot_joint7 = data['Joint 7'] original_robot_joints_build = [original_robot_joint1["Build joints"], original_robot_joint2["Build joints"], original_robot_joint3["Build joints"], original_robot_joint4["Build joints"], original_robot_joint5["Build joints"], original_robot_joint6["Build joints"], original_robot_joint7["Build joints"]] original_robot_joints_home = [original_robot_joint1["Home"], original_robot_joint2["Home"], original_robot_joint3["Home"], original_robot_joint4["Home"], original_robot_joint5["Home"], original_robot_joint6["Home"], original_robot_joint7["Home"]] original_robot_parameters = [data["d1"], data["d3"], data["d5"], data["d7"], data["dtheta1"], data["dtheta2"], data["dtheta3"], data["dtheta4"], data["dtheta5"], data["dtheta6"], data["dtheta7"]] original_robot_joint_senses = [original_robot_joint1["Invert Sense"], original_robot_joint2["Invert Sense"], original_robot_joint3["Invert Sense"], original_robot_joint4["Invert Sense"], original_robot_joint5["Invert Sense"], original_robot_joint6["Invert Sense"], original_robot_joint7["Invert Sense"]] original_robot_joint_lower_limit = [original_robot_joint1["Minimum limit"], original_robot_joint2["Minimum limit"], original_robot_joint3["Minimum limit"], original_robot_joint4["Minimum limit"], original_robot_joint5["Minimum limit"], original_robot_joint6["Minimum limit"], original_robot_joint7["Minimum limit"]] original_robot_joint_upper_limit = [original_robot_joint1["Maximum limit"], original_robot_joint2["Maximum limit"], original_robot_joint3["Maximum limit"], original_robot_joint4["Maximum limit"], original_robot_joint5["Maximum limit"], original_robot_joint6["Maximum limit"], original_robot_joint7["Maximum limit"]] original_robot_base_pose = data["Base shift"] original_robot_tool_pose = data["End-effector shift"] # CUSTOM ROBOT DATA with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'RoboDK/KUKA/KUKA LWR IV+ Description/custom_lwr_model_description.json')) as config_file: data = json.load(config_file) custom_robot_name = data['Robot name'] custom_robot_dof = data['DOF'] custom_robot_joint1 = data['Joint 1'] custom_robot_joint2 = data['Joint 2'] custom_robot_joint3 = data['Joint 3'] custom_robot_joint4 = data['Joint 4'] custom_robot_joint5 = data['Joint 5'] custom_robot_joint6 = data['Joint 6'] custom_robot_joint7 = data['Joint 7'] custom_robot_joints_build = [custom_robot_joint1["Build joints"], custom_robot_joint2["Build joints"], custom_robot_joint3["Build joints"], custom_robot_joint4["Build joints"], custom_robot_joint5["Build joints"], custom_robot_joint6["Build joints"], custom_robot_joint7["Build joints"]] custom_robot_joints_home = [custom_robot_joint1["Home"], custom_robot_joint2["Home"], custom_robot_joint3["Home"], custom_robot_joint4["Home"], custom_robot_joint5["Home"], custom_robot_joint6["Home"], custom_robot_joint7["Home"]] custom_robot_parameters = [data["d1"], data["d3"], data["d5"], data["d7"], data["dtheta1"], data["dtheta2"], data["dtheta3"], data["dtheta4"], data["dtheta5"], data["dtheta6"], data["dtheta7"]] custom_robot_joint_senses = [custom_robot_joint1["Invert Sense"], custom_robot_joint2["Invert Sense"], custom_robot_joint3["Invert Sense"], custom_robot_joint4["Invert Sense"], custom_robot_joint5["Invert Sense"], custom_robot_joint6["Invert Sense"], custom_robot_joint7["Invert Sense"]] custom_robot_joint_lower_limit = [custom_robot_joint1["Minimum limit"], custom_robot_joint2["Minimum limit"], custom_robot_joint3["Minimum limit"], custom_robot_joint4["Minimum limit"], custom_robot_joint5["Minimum limit"], custom_robot_joint6["Minimum limit"], custom_robot_joint7["Minimum limit"]] custom_robot_joint_upper_limit = [custom_robot_joint1["Maximum limit"], custom_robot_joint2["Maximum limit"], custom_robot_joint3["Maximum limit"], custom_robot_joint4["Maximum limit"], custom_robot_joint5["Maximum limit"], custom_robot_joint6["Maximum limit"], custom_robot_joint7["Maximum limit"]] custom_robot_base_pose = data["Base shift"] custom_robot_tool_pose = data["End-effector shift"] # CUSTOM 2 ROBOT DATA with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'RoboDK/KUKA/KUKA LWR IV+ Description/custom_lwr_model_description_2.json')) as config_file: data = json.load(config_file) custom_2_robot_name = data['Robot name'] custom_2_robot_dof = data['DOF'] custom_2_robot_joint1 = data['Joint 1'] custom_2_robot_joint2 = data['Joint 2'] custom_2_robot_joint3 = data['Joint 3'] custom_2_robot_joint4 = data['Joint 4'] custom_2_robot_joint5 = data['Joint 5'] custom_2_robot_joint6 = data['Joint 6'] custom_2_robot_joint7 = data['Joint 7'] custom_2_robot_joints_build = [custom_2_robot_joint1["Build joints"], custom_2_robot_joint2["Build joints"], custom_2_robot_joint3["Build joints"], custom_2_robot_joint4["Build joints"], custom_2_robot_joint5["Build joints"], custom_2_robot_joint6["Build joints"], custom_2_robot_joint7["Build joints"]] custom_2_robot_joints_home = [custom_2_robot_joint1["Home"], custom_2_robot_joint2["Home"], custom_2_robot_joint3["Home"], custom_2_robot_joint4["Home"], custom_2_robot_joint5["Home"], custom_2_robot_joint6["Home"], custom_2_robot_joint7["Home"]] custom_2_robot_parameters = [data["d1"], data["d3"], data["d5"], data["d7"], data["dtheta1"], data["dtheta2"], data["dtheta3"], data["dtheta4"], data["dtheta5"], data["dtheta6"], data["dtheta7"]] custom_2_robot_joint_senses = [custom_2_robot_joint1["Invert Sense"], custom_2_robot_joint2["Invert Sense"], custom_2_robot_joint3["Invert Sense"], custom_2_robot_joint4["Invert Sense"], custom_2_robot_joint5["Invert Sense"], custom_2_robot_joint6["Invert Sense"], custom_2_robot_joint7["Invert Sense"]] custom_2_robot_joint_lower_limit = [custom_2_robot_joint1["Minimum limit"], custom_2_robot_joint2["Minimum limit"], custom_2_robot_joint3["Minimum limit"], custom_2_robot_joint4["Minimum limit"], custom_2_robot_joint5["Minimum limit"], custom_2_robot_joint6["Minimum limit"], custom_2_robot_joint7["Minimum limit"]] custom_2_robot_joint_upper_limit = [custom_2_robot_joint1["Maximum limit"], custom_2_robot_joint2["Maximum limit"], custom_2_robot_joint3["Maximum limit"], custom_2_robot_joint4["Maximum limit"], custom_2_robot_joint5["Maximum limit"], custom_2_robot_joint6["Maximum limit"], custom_2_robot_joint7["Maximum limit"]] custom_2_robot_base_pose = data["Base shift"] custom_2_robot_tool_pose = data["End-effector shift"] RDK = Robolink() custom = False custom2 = True if custom: robot_name = custom_robot_name DOFs = custom_robot_dof joints_build = custom_robot_joints_build joints_home = custom_robot_joints_home parameters = custom_robot_parameters joints_senses = custom_robot_joint_senses # -1 = Inverted, +1 = Not Inverted lower_limits = custom_robot_joint_lower_limit upper_limits = custom_robot_joint_upper_limit base_pose = xyzrpw_2_pose(custom_robot_base_pose) tool_pose = xyzrpw_2_pose(custom_robot_tool_pose) list_objects = [] elif custom2: robot_name = custom_2_robot_name DOFs = custom_2_robot_dof joints_build = custom_2_robot_joints_build joints_home = custom_2_robot_joints_home parameters = custom_2_robot_parameters joints_senses = custom_2_robot_joint_senses # -1 = Inverted, +1 = Not Inverted lower_limits = custom_2_robot_joint_lower_limit upper_limits = custom_2_robot_joint_upper_limit base_pose = xyzrpw_2_pose(custom_2_robot_base_pose) tool_pose = xyzrpw_2_pose(custom_2_robot_tool_pose) list_objects = [] else: robot_name = original_robot_name DOFs = original_robot_dof joints_build = original_robot_joints_build joints_home = original_robot_joints_home parameters = original_robot_parameters joints_senses = original_robot_joint_senses # -1 = Inverted, +1 = Not Inverted lower_limits = original_robot_joint_lower_limit upper_limits = original_robot_joint_upper_limit base_pose = xyzrpw_2_pose(original_robot_base_pose) tool_pose = xyzrpw_2_pose(original_robot_tool_pose) list_objects = [] for i in range(DOFs + 1): if i == 0: itm = RDK.Item('base', ITEM_TYPE_OBJECT) else: itm = RDK.Item('link_'+str(i), ITEM_TYPE_OBJECT) list_objects.append(itm) new_robot = RDK.BuildMechanism(MAKE_ROBOT_7DOF, list_objects, parameters, joints_build, joints_home, joints_senses, lower_limits, upper_limits, base_pose, tool_pose, robot_name) if not new_robot.Valid(): print("Failed to create the robot. Check input values.") else: print("Robot/mechanism created: " + new_robot.Name())
55.209205
177
0.649564
82fd84aa8cc3e3cc7d56b2efc824a18ff2e55d25
368
py
Python
tests/Parser/701isNotSubtitleFile_test.py
Bas-Man/TVShowFile
2f341c97dcbe52eee0c0e71752173c9e9442450c
[ "MIT" ]
null
null
null
tests/Parser/701isNotSubtitleFile_test.py
Bas-Man/TVShowFile
2f341c97dcbe52eee0c0e71752173c9e9442450c
[ "MIT" ]
null
null
null
tests/Parser/701isNotSubtitleFile_test.py
Bas-Man/TVShowFile
2f341c97dcbe52eee0c0e71752173c9e9442450c
[ "MIT" ]
null
null
null
import unittest from context import parser if __name__ == '__main__': unittest.main()
19.368421
64
0.69837
82fdd7e670db27270125e392ffe7dfc17727a77e
10,668
py
Python
archdiffer/tests/tests_rest_routes.py
Kratochvilova/archdiffer
06f2ef0bb232b1ffe46e9d50575c4b79b1cff191
[ "MIT" ]
null
null
null
archdiffer/tests/tests_rest_routes.py
Kratochvilova/archdiffer
06f2ef0bb232b1ffe46e9d50575c4b79b1cff191
[ "MIT" ]
null
null
null
archdiffer/tests/tests_rest_routes.py
Kratochvilova/archdiffer
06f2ef0bb232b1ffe46e9d50575c4b79b1cff191
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # This file is part of Archdiffer and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ Created on Sat May 12 20:39:46 2018 @author: Pavla Kratochvilova <pavla.kratochvilova@gmail.com> """ from random import choice from datetime import datetime from . import RESTTest from ..constants import STATE_STRINGS from .. import database DATETIMES = [ '1000-01-01 00:00:00', '2018-01-01 00:00:00', '9999-01-01 00:00:00', ] IDS = LIMITS = OFFSETS = ['0', '1', '2', '10', '999999'] STATES = list(STATE_STRINGS.values())
32.036036
79
0.522778
82ff0515b3da6ec57b02cf613a0fd6672311351d
150
py
Python
src/posts/templatetags/urlify.py
thunderoy/blogger
8102d11c04fbc98a31298ebfdb75023e9207109f
[ "MIT" ]
null
null
null
src/posts/templatetags/urlify.py
thunderoy/blogger
8102d11c04fbc98a31298ebfdb75023e9207109f
[ "MIT" ]
null
null
null
src/posts/templatetags/urlify.py
thunderoy/blogger
8102d11c04fbc98a31298ebfdb75023e9207109f
[ "MIT" ]
null
null
null
from urllib.parse import quote from django import template register = template.Library()
18.75
30
0.78
82ff896e3d6c189f07e2be0a44d052ed10938137
330
py
Python
producto/migrations/0004_auto_20180611_2350.py
JohanVasquez/crud-venta-libre
557f82b5d88c42480020a65cc6034348ff20efce
[ "MIT" ]
null
null
null
producto/migrations/0004_auto_20180611_2350.py
JohanVasquez/crud-venta-libre
557f82b5d88c42480020a65cc6034348ff20efce
[ "MIT" ]
null
null
null
producto/migrations/0004_auto_20180611_2350.py
JohanVasquez/crud-venta-libre
557f82b5d88c42480020a65cc6034348ff20efce
[ "MIT" ]
null
null
null
# Generated by Django 2.0.6 on 2018-06-11 23:50 from django.db import migrations
18.333333
48
0.593939
d2013debcc235b195c7f8a356464f5f2511b9b80
4,173
py
Python
service_matcher_app/service_matcher/models.py
City-of-Turku/PaohServiceMatchEngine
39f580003f9c0d10708acd93644f796f764ec2f0
[ "MIT" ]
null
null
null
service_matcher_app/service_matcher/models.py
City-of-Turku/PaohServiceMatchEngine
39f580003f9c0d10708acd93644f796f764ec2f0
[ "MIT" ]
null
null
null
service_matcher_app/service_matcher/models.py
City-of-Turku/PaohServiceMatchEngine
39f580003f9c0d10708acd93644f796f764ec2f0
[ "MIT" ]
null
null
null
from datetime import datetime from pydantic import BaseModel from typing import Optional, List from fastapi import Query
29.595745
148
0.671699
d20192a90dd1bce99c4dd2075229189ba55979b5
6,481
py
Python
src/test/testcases/testPSUReadSbeMem.py
open-power/sbe
0208243c5bbd68fa36464397fa46a2940c827edf
[ "Apache-2.0" ]
9
2017-03-21T08:34:24.000Z
2022-01-25T06:00:51.000Z
src/test/testcases/testPSUReadSbeMem.py
sumant8098/sbe
0208243c5bbd68fa36464397fa46a2940c827edf
[ "Apache-2.0" ]
17
2016-11-04T00:46:43.000Z
2021-04-13T16:31:11.000Z
src/test/testcases/testPSUReadSbeMem.py
sumant8098/sbe
0208243c5bbd68fa36464397fa46a2940c827edf
[ "Apache-2.0" ]
17
2017-03-24T11:52:56.000Z
2022-01-25T06:00:49.000Z
# IBM_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # # $Source: src/test/testcases/testPSUReadSbeMem.py $ # # OpenPOWER sbe Project # # Contributors Listed Below - COPYRIGHT 2017,2019 # [+] International Business Machines Corp. # # # 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. # # IBM_PROLOG_END_TAG from __future__ import print_function import sys sys.path.append("targets/p9_nimbus/sbeTest" ) sys.path.append("targets/p9_axone/sbeTest" ) import testPSUUtil import testRegistry as reg import testUtil import testMemUtil #------------------------------- # This is a Test Expected Data #------------------------------- def readSeeprom(offset, size, destAddr, primStatus, secStatus): ''' #------------------------------------------------------------------------------------------------------------------------------ # SBE side test data - #------------------------------------------------------------------------------------------------------------------------------ ''' sbe_test_data = ( #----------------------------------------------------------------------------------------------------- # OP Reg ValueToWrite size Test Expected Data Description #----------------------------------------------------------------------------------------------------- # FFDC Size, Pass CMD Size ["write", reg.REG_MBOX0, "0000010000F0D703", 8, "None", "Writing to MBOX0 address"], # seeprom offset, Size ["write", reg.REG_MBOX1, getdoubleword((offset<<32)+size), 8, "None", "Writing to MBOX1 address"], # response Addr ["write", reg.REG_MBOX2, getdoubleword(destAddr), 8, "None", "Writing to MBOX2 address"], ["write", reg.PSU_SBE_DOORBELL_REG_WO_OR, "8000000000000000", 8, "None", "Update SBE Doorbell register to interrupt SBE"], ) ''' #--------------------- # Host side test data - SUCCESS #--------------------- ''' host_test_data_success = ( #---------------------------------------------------------------------------------------------------------------- # OP Reg ValueToWrite size Test Expected Data Description #---------------------------------------------------------------------------------------------------------------- ["read", reg.REG_MBOX4, "0", 8, getdoubleword((primStatus<<48)+(secStatus<<32)+0xF0D703), "Reading Host MBOX4 data to Validate"], ) ''' #----------------------------------------------------------------------- # Do not modify - Used to simulate interrupt on Ringing Doorbell on Host #----------------------------------------------------------------------- ''' host_polling_data = ( #---------------------------------------------------------------------------------------------------------------- # OP Reg ValueToWrite size Test Expected Data Description #---------------------------------------------------------------------------------------------------------------- ["read", reg.PSU_HOST_DOORBELL_REG_WO_OR, "0", 8, "8000000000000000", "Reading Host Doorbell for Interrupt Bit0"], ) # Run Simics initially testUtil.runCycles( 10000000 ); # Intialize the class obj instances regObj = testPSUUtil.registry() # Registry obj def for operation # HOST->SBE data set execution regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_data ) print("\n Poll on Host side for INTR ...\n") #Poll on HOST DoorBell Register for interrupt regObj.pollingOn( testPSUUtil.simSbeObj, host_polling_data, 5 ) #SBE->HOST data set execution regObj.ExecuteTestOp( testPSUUtil.simSbeObj, host_test_data_success ) #------------------------- # Main Function #------------------------- if __name__ == "__main__": if testUtil.getMachineName() == "axone": try: main() except: print ( "\nTest Suite completed with error(s)" ) testUtil.collectFFDC() raise() print ( "\nTest Suite completed with no errors" ) else: main() if err: print ( "\nTest Suite completed with error(s)" ) #sys.exit(1) else: print ( "\nTest Suite completed with no errors" ) #sys.exit(0);
38.123529
144
0.494214
d202532cd5f882629e4b1ca88d649d9dd76cb423
9,780
py
Python
biobb_ml/clustering/clustering_predict.py
bioexcel/biobb_ml
f99346ef7885d3a62de47dab738a01db4b27467a
[ "Apache-2.0" ]
null
null
null
biobb_ml/clustering/clustering_predict.py
bioexcel/biobb_ml
f99346ef7885d3a62de47dab738a01db4b27467a
[ "Apache-2.0" ]
5
2021-06-30T11:24:14.000Z
2021-08-04T12:53:00.000Z
biobb_ml/clustering/clustering_predict.py
bioexcel/biobb_ml
f99346ef7885d3a62de47dab738a01db4b27467a
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python3 """Module containing the ClusteringPredict class and the command line interface.""" import argparse import pandas as pd import joblib from biobb_common.generic.biobb_object import BiobbObject from sklearn.preprocessing import StandardScaler from biobb_common.configuration import settings from biobb_common.tools import file_utils as fu from biobb_common.tools.file_utils import launchlogger from biobb_ml.clustering.common import * def clustering_predict(input_model_path: str, output_results_path: str, input_dataset_path: str = None, properties: dict = None, **kwargs) -> int: """Execute the :class:`ClusteringPredict <clustering.clustering_predict.ClusteringPredict>` class and execute the :meth:`launch() <clustering.clustering_predict.ClusteringPredict.launch>` method.""" return ClusteringPredict(input_model_path=input_model_path, output_results_path=output_results_path, input_dataset_path=input_dataset_path, properties=properties, **kwargs).launch() def main(): """Command line execution of this building block. Please check the command line documentation.""" parser = argparse.ArgumentParser(description="Makes predictions from an input dataset and a given clustering model.", formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, width=99999)) parser.add_argument('--config', required=False, help='Configuration file') # Specific args of each building block required_args = parser.add_argument_group('required arguments') required_args.add_argument('--input_model_path', required=True, help='Path to the input model. Accepted formats: pkl.') required_args.add_argument('--output_results_path', required=True, help='Path to the output results file. Accepted formats: csv.') parser.add_argument('--input_dataset_path', required=False, help='Path to the dataset to predict. Accepted formats: csv.') args = parser.parse_args() args.config = args.config or "{}" properties = settings.ConfReader(config=args.config).get_prop_dic() # Specific call of each building block clustering_predict(input_model_path=args.input_model_path, output_results_path=args.output_results_path, input_dataset_path=args.input_dataset_path, properties=properties) if __name__ == '__main__': main()
52.864865
354
0.645194
d2025b2a20a97cda599aa94a7ddf6c498a1acbae
121
py
Python
treeviz_test.py
larsga/sprake
32598651b2fb514b18aab4f82ffba89d606a7b74
[ "Apache-2.0" ]
1
2022-01-26T08:50:33.000Z
2022-01-26T08:50:33.000Z
treeviz_test.py
larsga/sprake
32598651b2fb514b18aab4f82ffba89d606a7b74
[ "Apache-2.0" ]
null
null
null
treeviz_test.py
larsga/sprake
32598651b2fb514b18aab4f82ffba89d606a7b74
[ "Apache-2.0" ]
null
null
null
from sprake import treeviz # we don't actually have any meaningful tests that we can do, but at least # we can do this
20.166667
74
0.752066
d2037084e3cebaba8f3eced7b0c24bf337957571
1,926
py
Python
build/scripts/gen_mx_table.py
r1nadeg/04_catboost
6755bbbd1496540b92ded57eea1974f64bef87c5
[ "Apache-2.0" ]
null
null
null
build/scripts/gen_mx_table.py
r1nadeg/04_catboost
6755bbbd1496540b92ded57eea1974f64bef87c5
[ "Apache-2.0" ]
null
null
null
build/scripts/gen_mx_table.py
r1nadeg/04_catboost
6755bbbd1496540b92ded57eea1974f64bef87c5
[ "Apache-2.0" ]
1
2018-08-06T14:13:12.000Z
2018-08-06T14:13:12.000Z
import sys tmpl = """ #include "yabs_mx_calc_table.h" #include <kernel/matrixnet/mn_sse.h> #include <library/archive/yarchive.h> #include <util/memory/blob.h> #include <util/generic/hash.h> #include <util/generic/ptr.h> #include <util/generic/singleton.h> using namespace NMatrixnet; extern "C" { extern const unsigned char MxFormulas[]; extern const ui32 MxFormulasSize; } namespace { struct TFml: public TBlob, public TMnSseInfo { inline TFml(const TBlob& b) : TBlob(b) , TMnSseInfo(Data(), Size()) { } }; struct TFormulas: public THashMap<size_t, TAutoPtr<TFml>> { inline TFormulas() { TBlob b = TBlob::NoCopy(MxFormulas, MxFormulasSize); TArchiveReader ar(b); %s } inline const TMnSseInfo& at(size_t n) const throw () { return *find(n)->second; } }; %s static func_descr_t yabs_funcs[] = { %s }; } yabs_mx_calc_table_t yabs_mx_calc_table = {YABS_MX_CALC_VERSION, 10000, 0, yabs_funcs}; """ if __name__ == '__main__': init = [] body = [] defs = {} for i in sys.argv[1:]: name = i.replace('.', '_') num = long(name.split('_')[1]) init.append('(*this)[%s] = new TFml(ar.ObjectBlobByKey("%s"));' % (num, '/' + i)) f1 = 'static void yabs_%s(size_t count, const float** args, double* res) {Singleton<TFormulas>()->at(%s).DoCalcRelevs(args, res, count);}' % (name, num) f2 = 'static size_t yabs_%s_factor_count() {return Singleton<TFormulas>()->at(%s).MaxFactorIndex() + 1;}' % (name, num) body.append(f1) body.append(f2) d1 = 'yabs_%s' % name d2 = 'yabs_%s_factor_count' % name defs[num] = '{%s, %s}' % (d1, d2) print tmpl % ('\n'.join(init), '\n\n'.join(body), ',\n'.join((defs.get(i, '{nullptr, nullptr}') for i in range(0, 10000))))
25.342105
160
0.576324