hexsha string | size int64 | ext string | lang string | max_stars_repo_path string | max_stars_repo_name string | max_stars_repo_head_hexsha string | max_stars_repo_licenses list | max_stars_count int64 | max_stars_repo_stars_event_min_datetime string | max_stars_repo_stars_event_max_datetime string | max_issues_repo_path string | max_issues_repo_name string | max_issues_repo_head_hexsha string | max_issues_repo_licenses list | max_issues_count int64 | max_issues_repo_issues_event_min_datetime string | max_issues_repo_issues_event_max_datetime string | max_forks_repo_path string | max_forks_repo_name string | max_forks_repo_head_hexsha string | max_forks_repo_licenses list | max_forks_count int64 | max_forks_repo_forks_event_min_datetime string | max_forks_repo_forks_event_max_datetime string | content string | avg_line_length float64 | max_line_length int64 | alphanum_fraction float64 | qsc_code_num_words_quality_signal int64 | qsc_code_num_chars_quality_signal float64 | qsc_code_mean_word_length_quality_signal float64 | qsc_code_frac_words_unique_quality_signal float64 | qsc_code_frac_chars_top_2grams_quality_signal float64 | qsc_code_frac_chars_top_3grams_quality_signal float64 | qsc_code_frac_chars_top_4grams_quality_signal float64 | qsc_code_frac_chars_dupe_5grams_quality_signal float64 | qsc_code_frac_chars_dupe_6grams_quality_signal float64 | qsc_code_frac_chars_dupe_7grams_quality_signal float64 | qsc_code_frac_chars_dupe_8grams_quality_signal float64 | qsc_code_frac_chars_dupe_9grams_quality_signal float64 | qsc_code_frac_chars_dupe_10grams_quality_signal float64 | qsc_code_frac_chars_replacement_symbols_quality_signal float64 | qsc_code_frac_chars_digital_quality_signal float64 | qsc_code_frac_chars_whitespace_quality_signal float64 | qsc_code_size_file_byte_quality_signal float64 | qsc_code_num_lines_quality_signal float64 | qsc_code_num_chars_line_max_quality_signal float64 | qsc_code_num_chars_line_mean_quality_signal float64 | qsc_code_frac_chars_alphabet_quality_signal float64 | qsc_code_frac_chars_comments_quality_signal float64 | qsc_code_cate_xml_start_quality_signal float64 | qsc_code_frac_lines_dupe_lines_quality_signal float64 | qsc_code_cate_autogen_quality_signal float64 | qsc_code_frac_lines_long_string_quality_signal float64 | qsc_code_frac_chars_string_length_quality_signal float64 | qsc_code_frac_chars_long_word_length_quality_signal float64 | qsc_code_frac_lines_string_concat_quality_signal float64 | qsc_code_cate_encoded_data_quality_signal float64 | qsc_code_frac_chars_hex_words_quality_signal float64 | qsc_code_frac_lines_prompt_comments_quality_signal float64 | qsc_code_frac_lines_assert_quality_signal float64 | qsc_codepython_cate_ast_quality_signal float64 | qsc_codepython_frac_lines_func_ratio_quality_signal float64 | qsc_codepython_cate_var_zero_quality_signal bool | qsc_codepython_frac_lines_pass_quality_signal float64 | qsc_codepython_frac_lines_import_quality_signal float64 | qsc_codepython_frac_lines_simplefunc_quality_signal float64 | qsc_codepython_score_lines_no_logic_quality_signal float64 | qsc_codepython_frac_lines_print_quality_signal float64 | qsc_code_num_words int64 | qsc_code_num_chars int64 | qsc_code_mean_word_length int64 | qsc_code_frac_words_unique null | qsc_code_frac_chars_top_2grams int64 | qsc_code_frac_chars_top_3grams int64 | qsc_code_frac_chars_top_4grams int64 | qsc_code_frac_chars_dupe_5grams int64 | qsc_code_frac_chars_dupe_6grams int64 | qsc_code_frac_chars_dupe_7grams int64 | qsc_code_frac_chars_dupe_8grams int64 | qsc_code_frac_chars_dupe_9grams int64 | qsc_code_frac_chars_dupe_10grams int64 | qsc_code_frac_chars_replacement_symbols int64 | qsc_code_frac_chars_digital int64 | qsc_code_frac_chars_whitespace int64 | qsc_code_size_file_byte int64 | qsc_code_num_lines int64 | qsc_code_num_chars_line_max int64 | qsc_code_num_chars_line_mean int64 | qsc_code_frac_chars_alphabet int64 | qsc_code_frac_chars_comments int64 | qsc_code_cate_xml_start int64 | qsc_code_frac_lines_dupe_lines int64 | qsc_code_cate_autogen int64 | qsc_code_frac_lines_long_string int64 | qsc_code_frac_chars_string_length int64 | qsc_code_frac_chars_long_word_length int64 | qsc_code_frac_lines_string_concat null | qsc_code_cate_encoded_data int64 | qsc_code_frac_chars_hex_words int64 | qsc_code_frac_lines_prompt_comments int64 | qsc_code_frac_lines_assert int64 | qsc_codepython_cate_ast int64 | qsc_codepython_frac_lines_func_ratio int64 | qsc_codepython_cate_var_zero int64 | qsc_codepython_frac_lines_pass int64 | qsc_codepython_frac_lines_import int64 | qsc_codepython_frac_lines_simplefunc int64 | qsc_codepython_score_lines_no_logic int64 | qsc_codepython_frac_lines_print int64 | effective string | hits int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4d1e11fe07c9e17482225346b3bf314a5354caa6 | 360 | py | Python | create_table_from_word/table_columns.py | yongli82/CodeGenerator | 4ca9255c3c4c5392e45815fd20f605ccbbfd2325 | [
"MIT"
] | null | null | null | create_table_from_word/table_columns.py | yongli82/CodeGenerator | 4ca9255c3c4c5392e45815fd20f605ccbbfd2325 | [
"MIT"
] | null | null | null | create_table_from_word/table_columns.py | yongli82/CodeGenerator | 4ca9255c3c4c5392e45815fd20f605ccbbfd2325 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import os
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import ExcelUtil
from jinja2 import Template
import re
def get_table_list():
column_headers = ExcelUtil.generate_columns('A', 'F')
data_grid = ExcelUtil.read_excel_with_head(u"财务账务表.xlsx", u"表", column_headers)
start_columns = False
| 18.947368 | 83 | 0.730556 | 53 | 360 | 4.773585 | 0.735849 | 0.031621 | 0.079051 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009709 | 0.141667 | 360 | 18 | 84 | 20 | 0.809061 | 0.113889 | 0 | 0 | 0 | 0 | 0.056962 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.090909 | false | 0 | 0.454545 | 0 | 0.545455 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
4d2a55ccfddd9dd9215b0c629a81b67391bf257c | 360 | py | Python | tts/symbols.py | entn-at/tn2-wg | 00f59da91a1e23020b20210ea62d838e20c049f2 | [
"BSD-3-Clause"
] | 38 | 2019-07-03T21:40:57.000Z | 2021-11-30T15:59:20.000Z | tts/symbols.py | entn-at/tn2-wg | 00f59da91a1e23020b20210ea62d838e20c049f2 | [
"BSD-3-Clause"
] | 4 | 2019-08-20T12:19:10.000Z | 2021-07-29T11:20:59.000Z | tts/symbols.py | entn-at/tn2-wg | 00f59da91a1e23020b20210ea62d838e20c049f2 | [
"BSD-3-Clause"
] | 11 | 2019-07-04T09:17:27.000Z | 2021-11-14T21:05:04.000Z | """ from https://github.com/keithito/tacotron """
_pad = '_'
#_punctuation = '!\'(),.:;? '
_punctuation = '!",.:;? '
_special = '-'
#_letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
_letters = "АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдеёжзийклмнопрстуфхцчшщъыьэюя"
symbols = [_pad] + list(_special) + list(_punctuation) + list(_letters)
| 32.727273 | 79 | 0.711111 | 22 | 360 | 11.136364 | 0.636364 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.116667 | 360 | 10 | 80 | 36 | 0.77044 | 0.377778 | 0 | 0 | 0 | 0 | 0.351852 | 0.305556 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
4d2c6196de9f0ffebba719e30abbaf48e28d2d23 | 5,719 | py | Python | test/test_tdodbc.py | Teradata/PyTd | 5e960ed4c380c4f8ae84d582ad779a87adce5ae1 | [
"MIT"
] | 133 | 2015-07-27T22:12:58.000Z | 2021-08-31T05:26:38.000Z | test/test_tdodbc.py | Teradata/PyTd | 5e960ed4c380c4f8ae84d582ad779a87adce5ae1 | [
"MIT"
] | 121 | 2015-07-30T18:03:03.000Z | 2021-08-09T13:46:37.000Z | test/test_tdodbc.py | Teradata/PyTd | 5e960ed4c380c4f8ae84d582ad779a87adce5ae1 | [
"MIT"
] | 57 | 2015-07-27T10:41:08.000Z | 2021-04-26T08:58:57.000Z | # The MIT License (MIT)
#
# Copyright (c) 2015 by Teradata
#
# 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.
import unittest
import os
import teradata
from teradata import tdodbc, util
class TdOdbcTest (unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.username = cls.password = util.setupTestUser(udaExec, dsn)
def testGlobals(self):
self.assertEqual(tdodbc.apilevel, "2.0")
self.assertEqual(tdodbc.threadsafety, 1)
self.assertEqual(tdodbc.paramstyle, "qmark")
def testSystemNotFound(self):
with self.assertRaises(tdodbc.DatabaseError) as cm:
tdodbc.connect(system="continuum.td.teradata.com",
username=self.username, password=self.password)
self.assertTrue("08004" in cm.exception.msg, cm.exception)
def testBadCredentials(self):
with self.assertRaises(tdodbc.DatabaseError) as cm:
tdodbc.connect(system=system, username="bad", password="bad")
self.assertEqual(cm.exception.code, 8017, cm.exception.msg)
def testConnect(self):
conn = tdodbc.connect(
system=system, username=self.username, password=self.password)
self.assertIsNotNone(conn)
conn.close()
def testConnectBadDriver(self):
with self.assertRaises(tdodbc.InterfaceError) as cm:
tdodbc.connect(
system=system, username=self.username,
password=self.password,
driver="BadDriver")
self.assertEqual(cm.exception.code, "DRIVER_NOT_FOUND")
def testCursorBasics(self):
with tdodbc.connect(system=system, username=self.username,
password=self.password, autoCommit=True) as conn:
self.assertIsNotNone(conn)
with conn.cursor() as cursor:
count = 0
for row in cursor.execute("SELECT * FROM DBC.DBCInfo"):
self.assertEqual(len(row), 2)
self.assertIsNotNone(row[0])
self.assertIsNotNone(row['InfoKey'])
self.assertIsNotNone(row['infokey'])
self.assertIsNotNone(row.InfoKey)
self.assertIsNotNone(row.infokey)
self.assertIsNotNone(row[1])
self.assertIsNotNone(row['InfoData'])
self.assertIsNotNone(row['infodata'])
self.assertIsNotNone(row.infodata)
self.assertIsNotNone(row.InfoData)
row[0] = "test1"
self.assertEqual(row[0], "test1")
self.assertEqual(row['InfoKey'], "test1")
self.assertEqual(row.infokey, "test1")
row['infokey'] = "test2"
self.assertEqual(row[0], "test2")
self.assertEqual(row['InfoKey'], "test2")
self.assertEqual(row.infokey, "test2")
row.infokey = "test3"
self.assertEqual(row[0], "test3")
self.assertEqual(row['InfoKey'], "test3")
self.assertEqual(row.InfoKey, "test3")
count += 1
self.assertEqual(cursor.description[0][0], "InfoKey")
self.assertEqual(cursor.description[0][1], tdodbc.STRING)
self.assertEqual(cursor.description[1][0], "InfoData")
self.assertEqual(cursor.description[1][1], tdodbc.STRING)
self.assertEqual(count, 3)
def testExecuteWithParamsMismatch(self):
with self.assertRaises(teradata.InterfaceError) as cm:
with tdodbc.connect(system=system, username=self.username,
password=self.password,
autoCommit=True) as conn:
self.assertIsNotNone(conn)
with conn.cursor() as cursor:
cursor.execute(
"CREATE TABLE testExecuteWithParamsMismatch (id INT, "
"name VARCHAR(128), dob TIMESTAMP)")
cursor.execute(
"INSERT INTO testExecuteWithParamsMismatch "
"VALUES (?, ?, ?)", (1, "TEST", ))
self.assertEqual(
cm.exception.code, "PARAMS_MISMATCH", cm.exception.msg)
configFiles = [os.path.join(os.path.dirname(__file__), 'udaexec.ini')]
udaExec = teradata.UdaExec(configFiles=configFiles, configureLogging=False)
dsn = 'ODBC'
odbcConfig = udaExec.config.section(dsn)
system = odbcConfig['system']
super_username = odbcConfig['username']
super_password = odbcConfig['password']
if __name__ == '__main__':
unittest.main()
| 43.656489 | 79 | 0.616541 | 601 | 5,719 | 5.838602 | 0.332779 | 0.089769 | 0.062696 | 0.042747 | 0.409233 | 0.325734 | 0.243374 | 0.224565 | 0.224565 | 0.224565 | 0 | 0.012219 | 0.28449 | 5,719 | 130 | 80 | 43.992308 | 0.845308 | 0.18762 | 0 | 0.139785 | 0 | 0 | 0.093858 | 0.01795 | 0 | 0 | 0 | 0 | 0.419355 | 1 | 0.086022 | false | 0.086022 | 0.043011 | 0 | 0.139785 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
4d69852609dac731ffb1bbf364bfde4e5a34166e | 390 | py | Python | lmsapi/api_cash/views.py | orkasolutions-develop/lms-api-new | c9e5a2d98874a4a7415002397048258526a94644 | [
"MIT"
] | null | null | null | lmsapi/api_cash/views.py | orkasolutions-develop/lms-api-new | c9e5a2d98874a4a7415002397048258526a94644 | [
"MIT"
] | null | null | null | lmsapi/api_cash/views.py | orkasolutions-develop/lms-api-new | c9e5a2d98874a4a7415002397048258526a94644 | [
"MIT"
] | null | null | null | from core.views import BaseViewSet
from .models import Cash
from .serializers import CashSerializer
class CashViewSet(BaseViewSet):
"""
- Vybirame jen typ 4 coz jsou platby z Banky
- Setridime nenovejsim datem na zacatek
"""
queryset = Cash.objects.all().filter(type=4).order_by('-time')
serializer_class = CashSerializer
filter_fields = ['comment', 'userid']
| 27.857143 | 66 | 0.717949 | 47 | 390 | 5.893617 | 0.787234 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006289 | 0.184615 | 390 | 13 | 67 | 30 | 0.86478 | 0.215385 | 0 | 0 | 0 | 0 | 0.062937 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.428571 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
4d6cac5c33887bd192cb3cbbad427835d929fc30 | 4,511 | py | Python | IPython/core/events.py | pyarnold/ipython | c4797f7f069d0a974ddfa1e4251c7550c809dba0 | [
"BSD-3-Clause-Clear"
] | 1 | 2020-12-18T01:07:55.000Z | 2020-12-18T01:07:55.000Z | IPython/core/events.py | pyarnold/ipython | c4797f7f069d0a974ddfa1e4251c7550c809dba0 | [
"BSD-3-Clause-Clear"
] | null | null | null | IPython/core/events.py | pyarnold/ipython | c4797f7f069d0a974ddfa1e4251c7550c809dba0 | [
"BSD-3-Clause-Clear"
] | null | null | null | """Infrastructure for registering and firing callbacks on application events.
Unlike :mod:`IPython.core.hooks`, which lets end users set single functions to
be called at specific times, or a collection of alternative methods to try,
callbacks are designed to be used by extension authors. A number of callbacks
can be registered for the same event without needing to be aware of one another.
The functions defined in this module are no-ops indicating the names of available
events and the arguments which will be passed to them.
.. note::
This API is experimental in IPython 2.0, and may be revised in future versions.
"""
from __future__ import print_function
class EventManager(object):
"""Manage a collection of events and a sequence of callbacks for each.
This is attached to :class:`~IPython.core.interactiveshell.InteractiveShell`
instances as an ``events`` attribute.
.. note::
This API is experimental in IPython 2.0, and may be revised in future versions.
"""
def __init__(self, shell, available_events):
"""Initialise the :class:`CallbackManager`.
Parameters
----------
shell
The :class:`~IPython.core.interactiveshell.InteractiveShell` instance
available_callbacks
An iterable of names for callback events.
"""
self.shell = shell
self.callbacks = {n: [] for n in available_events}
def register(self, event, function):
"""Register a new event callback
Parameters
----------
event : str
The event for which to register this callback.
function : callable
A function to be called on the given event. It should take the same
parameters as the appropriate callback prototype.
Raises
------
TypeError
If ``function`` is not callable.
KeyError
If ``event`` is not one of the known events.
"""
if not callable(function):
raise TypeError('Need a callable, got %r' % function)
self.callbacks[event].append(function)
def unregister(self, event, function):
"""Remove a callback from the given event."""
self.callbacks[event].remove(function)
def reset(self, event):
"""Clear all callbacks for the given event."""
self.callbacks[event] = []
def reset_all(self):
"""Clear all callbacks for all events."""
self.callbacks = {n: [] for n in self.callbacks}
def trigger(self, event, *args, **kwargs):
"""Call callbacks for ``event``.
Any additional arguments are passed to all callbacks registered for this
event. Exceptions raised by callbacks are caught, and a message printed.
"""
for func in self.callbacks[event]:
try:
func(*args, **kwargs)
except Exception:
print("Error in callback {} (for {}):".format(func, event))
self.shell.showtraceback()
# event_name -> prototype mapping
available_events = {}
def _define_event(callback_proto):
available_events[callback_proto.__name__] = callback_proto
return callback_proto
# ------------------------------------------------------------------------
# Callback prototypes
#
# No-op functions which describe the names of available events and the
# signatures of callbacks for those events.
# ------------------------------------------------------------------------
@_define_event
def pre_execute():
"""Fires before code is executed in response to user/frontend action.
This includes comm and widget messages and silent execution, as well as user
code cells."""
pass
@_define_event
def pre_run_cell():
"""Fires before user-entered code runs."""
pass
@_define_event
def post_execute():
"""Fires after code is executed in response to user/frontend action.
This includes comm and widget messages and silent execution, as well as user
code cells."""
pass
@_define_event
def post_run_cell():
"""Fires after user-entered code runs."""
pass
@_define_event
def shell_initialized(ip):
"""Fires after initialisation of :class:`~IPython.core.interactiveshell.InteractiveShell`.
This is before extensions and startup scripts are loaded, so it can only be
set by subclassing.
Parameters
----------
ip : :class:`~IPython.core.interactiveshell.InteractiveShell`
The newly initialised shell.
"""
pass
| 30.275168 | 94 | 0.643095 | 548 | 4,511 | 5.215328 | 0.34854 | 0.03184 | 0.024493 | 0.044787 | 0.293912 | 0.223933 | 0.188244 | 0.16655 | 0.140658 | 0.140658 | 0 | 0.001168 | 0.240745 | 4,511 | 148 | 95 | 30.47973 | 0.833285 | 0.614055 | 0 | 0.243902 | 0 | 0 | 0.037669 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.292683 | false | 0.121951 | 0.02439 | 0 | 0.365854 | 0.04878 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
4d7873d4b9675dd4cab3d904b988b8e5a2734851 | 3,188 | py | Python | qrand/caches/cache.py | LaurentAjdnik/qrand | 69a4fb049e1d50af5aaa52a6b417d58490169769 | [
"Apache-2.0"
] | 18 | 2020-10-28T19:04:39.000Z | 2022-03-02T17:23:32.000Z | qrand/caches/cache.py | LaurentAjdnik/qrand | 69a4fb049e1d50af5aaa52a6b417d58490169769 | [
"Apache-2.0"
] | 25 | 2021-04-05T01:11:24.000Z | 2022-02-10T16:13:43.000Z | qrand/caches/cache.py | LaurentAjdnik/qrand | 69a4fb049e1d50af5aaa52a6b417d58490169769 | [
"Apache-2.0"
] | 16 | 2020-12-02T14:59:12.000Z | 2022-01-04T19:17:47.000Z | ## _____ _____
## | __ \| __ \ AUTHOR: Pedro Rivero
## | |__) | |__) | ---------------------------------
## | ___/| _ / DATE: May 18, 2021
## | | | | \ \ ---------------------------------
## |_| |_| \_\ https://github.com/pedrorrivero
##
## Copyright 2021 Pedro Rivero
##
## 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 abc import ABC, abstractmethod
###############################################################################
## BIT CACHE INTERFACE
###############################################################################
class BitCache(ABC):
"""
BitCache FIFO (first in, first out) data structure.
Attributes
----------
size: int
The number of bits currently stored in the BitCache.
Methods
-------
dump() -> str
Outputs all the contents in the cache without erasing.
flush() -> None:
Erases the cache.
pop(n: int) -> str:
Returns a size `n` bitstring removing it from the top of the cache.
push(bitstring: str) -> None:
Inserts bitstring at the end of the cache.
"""
############################### PUBLIC API ###############################
@property
@abstractmethod
def size(self) -> int:
"""
The number of bits currently stored in the BitCache.
"""
pass
@abstractmethod
def dump(self) -> str:
"""
Outputs all the contents in the cache without erasing.
Returns
-------
out: str
Cache contents.
"""
pass
@abstractmethod
def flush(self) -> None:
"""
Erases the cache.
"""
pass
@abstractmethod
def pop(self, num_bits: int) -> str:
"""
Returns a size `n` bitstring removing it from the top of the cache.
Parameters
----------
num_bits: int
Number of bits to retrieve.
Returns
-------
out: str
Size `n` bitstring.
Raises
------
TypeError
If input is not int.
ValueError
If input is less than one.
RuntimeError
If input is greater than cache size.
"""
pass
@abstractmethod
def push(self, bitstring: str) -> None:
"""
Inserts bitstring at the end of the cache.
Parameters
----------
bitstring: str
The bitstring to insert.
Raises
------
TypeError
If input bitstring is not str.
ValueError
If input bitstring is not a valid bitstring.
"""
pass
| 26.131148 | 79 | 0.500627 | 324 | 3,188 | 4.842593 | 0.407407 | 0.04079 | 0.025494 | 0.020395 | 0.284257 | 0.257489 | 0.257489 | 0.257489 | 0.257489 | 0.257489 | 0 | 0.006434 | 0.31744 | 3,188 | 121 | 80 | 26.347107 | 0.714614 | 0.629862 | 0 | 0.555556 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.277778 | false | 0.277778 | 0.055556 | 0 | 0.388889 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
4d8becef069dc2415fd75f8eb057517bc3d380a9 | 343 | py | Python | Python_lxf/Python_Basic_Operation/Python_Basic/basicValueAndFunc/slice.py | QAlexBall/Learning_Py | 8a5987946928a9d86f6807555ed435ac604b2c44 | [
"MIT"
] | 2 | 2019-01-24T15:06:59.000Z | 2019-01-25T07:34:45.000Z | Python_lxf/Python_Basic_Operation/Python_Basic/basicValueAndFunc/slice.py | QAlexBall/Learning_Py | 8a5987946928a9d86f6807555ed435ac604b2c44 | [
"MIT"
] | 1 | 2019-12-23T09:45:11.000Z | 2019-12-23T09:45:11.000Z | Python_lxf/Python_Basic_Operation/Python_Basic/basicValueAndFunc/slice.py | QAlexBall/Learning_Py | 8a5987946928a9d86f6807555ed435ac604b2c44 | [
"MIT"
] | 1 | 2019-07-18T14:21:35.000Z | 2019-07-18T14:21:35.000Z | L = ['michael', 'sarah', 'tracy', 'bob', 'jack']
# 取前N个元素
r = []
n = 3
for i in range(n):
r.append(L[i])
print(r)
# python提供slice操作符简化.
m = 0
print(L[m:n], L[:n], L[-n:-1])
L = list(range(100))
print(L[:10], '\r', L[-10:], '\r', L[10:20], '\r', L[:10:2], '\r', L[::5])
print((0, 1, 2, 3, 4, 5)[:3])
print('ABCDEFG'[:3], 'ABCDEFG'[::2])
| 16.333333 | 74 | 0.483965 | 67 | 343 | 2.477612 | 0.41791 | 0.072289 | 0.072289 | 0.060241 | 0.066265 | 0 | 0 | 0 | 0 | 0 | 0 | 0.094077 | 0.163265 | 343 | 20 | 75 | 17.15 | 0.484321 | 0.075802 | 0 | 0 | 0 | 0 | 0.148387 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.416667 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 2 |
4d9a39367847fba7d83c619b3792a5d2c6b7b745 | 401 | py | Python | shoottikala/privileges.py | conikuvat/shootti-ilmo | bf5ab15e20173994bac25e6b5cd3aec42f671f05 | [
"MIT"
] | null | null | null | shoottikala/privileges.py | conikuvat/shootti-ilmo | bf5ab15e20173994bac25e6b5cd3aec42f671f05 | [
"MIT"
] | 9 | 2017-02-15T20:36:49.000Z | 2017-05-26T12:10:43.000Z | shoottikala/privileges.py | conikuvat/shootti-ilmo | bf5ab15e20173994bac25e6b5cd3aec42f671f05 | [
"MIT"
] | null | null | null | from .exceptions import AccessDenied
class AccessControlMixin(object):
def user_can_edit(self, user):
return (user.is_superuser or self.user == user)
def check_write_privileges(self, user):
if not self.user_can_edit(user):
raise AccessDenied()
def check_read_privileges(self, user):
if not self.user_can_view(user):
raise AccessDenied()
| 26.733333 | 55 | 0.678304 | 51 | 401 | 5.117647 | 0.470588 | 0.183908 | 0.084291 | 0.153257 | 0.260536 | 0.260536 | 0.260536 | 0.260536 | 0 | 0 | 0 | 0 | 0.236908 | 401 | 14 | 56 | 28.642857 | 0.852941 | 0 | 0 | 0.2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.3 | false | 0 | 0.1 | 0.1 | 0.6 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
4d9e067a4c732861782bebe97c9870ee7872595c | 218 | py | Python | tareas/3/FranciscoRodrigo-SanchezBeatriz/common/random_proc.py | Miguelp-rez/sistop-2019-2 | 428444217ba0cc98030a9d84d8b415dcddad9b65 | [
"CC-BY-4.0"
] | null | null | null | tareas/3/FranciscoRodrigo-SanchezBeatriz/common/random_proc.py | Miguelp-rez/sistop-2019-2 | 428444217ba0cc98030a9d84d8b415dcddad9b65 | [
"CC-BY-4.0"
] | null | null | null | tareas/3/FranciscoRodrigo-SanchezBeatriz/common/random_proc.py | Miguelp-rez/sistop-2019-2 | 428444217ba0cc98030a9d84d8b415dcddad9b65 | [
"CC-BY-4.0"
] | null | null | null | import random
def rand_proc(num_proc):
procesos = []
for j in range(0,num_proc):
t_0 = random.randint(1,10+1)
t =random.randint(1,10+1)
procesos.append([j,t_0,t])
return procesos
| 19.818182 | 36 | 0.600917 | 36 | 218 | 3.5 | 0.5 | 0.111111 | 0.222222 | 0.253968 | 0.269841 | 0 | 0 | 0 | 0 | 0 | 0 | 0.06875 | 0.266055 | 218 | 10 | 37 | 21.8 | 0.71875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0.125 | 0 | 0.375 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
4d9e28ca22e75c89217adddb5f64ba79edc5981d | 1,753 | py | Python | fooof/tests/test_analysis.py | anchandm/fooof | dcc93b14c4a6987ce7e394696af3221dd2a7bbd6 | [
"Apache-2.0"
] | 1 | 2019-03-26T16:30:43.000Z | 2019-03-26T16:30:43.000Z | fooof/tests/test_analysis.py | anchandm/fooof | dcc93b14c4a6987ce7e394696af3221dd2a7bbd6 | [
"Apache-2.0"
] | null | null | null | fooof/tests/test_analysis.py | anchandm/fooof | dcc93b14c4a6987ce7e394696af3221dd2a7bbd6 | [
"Apache-2.0"
] | null | null | null | """Test functions for FOOOF analysis."""
import numpy as np
from fooof.analysis import *
###################################################################################################
###################################################################################################
def test_get_band_peak_fm(tfm):
assert np.all(get_band_peak_fm(tfm, (8, 12)))
def test_get_band_peaks_fg(tfg):
assert np.all(get_band_peaks_fg(tfg, (8, 12)))
def test_get_band_peaks_group():
dat = np.array([[10, 1, 1.8, 0], [13, 1, 2, 2], [14, 2, 4, 2]])
out1 = get_band_peaks_group(dat, [8, 12], 3)
assert out1.shape == (3, 3)
assert np.array_equal(out1[0, :], [10, 1, 1.8])
out2 = get_band_peaks_group(dat, [12, 16], 3)
assert out2.shape == (3, 3)
assert np.array_equal(out2[2, :], [14, 2, 4])
def test_get_band_peak():
dat = np.array([[10, 1, 1.8], [14, 2, 4]])
# Test single result
assert np.array_equal(get_band_peak(dat, [10, 12]), [10, 1, 1.8])
# Test no results - returns nan
assert np.all(np.isnan(get_band_peak(dat, [4, 8])))
# Test muliple results - return all
assert np.array_equal(get_band_peak(dat, [10, 15], ret_one=False), [[10, 1, 1.8], [14, 2, 4]])
# Test multiple results - return one
assert np.array_equal(get_band_peak(dat, [10, 15], ret_one=True), [14, 2, 4])
def test_get_highest_peak():
dat = np.array([[10, 1, 1.8], [14, 2, 4], [12, 3, 2]])
assert np.array_equal(get_highest_peak(dat), [12, 3, 2])
def test_empty_inputs():
dat = np.empty(shape=[0, 3])
assert np.all(get_band_peak(dat, [8, 12]))
assert np.all(get_highest_peak(dat))
dat = np.empty(shape=[0, 4])
assert np.all(get_band_peaks_group(dat, [8, 12], 0))
| 28.274194 | 99 | 0.551055 | 282 | 1,753 | 3.223404 | 0.202128 | 0.107811 | 0.09681 | 0.033003 | 0.618262 | 0.486249 | 0.369637 | 0.19912 | 0.180418 | 0.143014 | 0 | 0.083621 | 0.174558 | 1,753 | 61 | 100 | 28.737705 | 0.544575 | 0.087279 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.482759 | 1 | 0.206897 | false | 0 | 0.068966 | 0 | 0.275862 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
4da267cbfd8f27c90210ee8dd60a31e0b0b8e755 | 347 | py | Python | rssplus/forms.py | Davidhw/infocatch | ddeb5d31b1eb353f41f444c5c6eec2c5d1b1ba72 | [
"BSD-2-Clause"
] | null | null | null | rssplus/forms.py | Davidhw/infocatch | ddeb5d31b1eb353f41f444c5c6eec2c5d1b1ba72 | [
"BSD-2-Clause"
] | null | null | null | rssplus/forms.py | Davidhw/infocatch | ddeb5d31b1eb353f41f444c5c6eec2c5d1b1ba72 | [
"BSD-2-Clause"
] | null | null | null | from django import forms
class URLForm(forms.Form):
siteUrl = forms.CharField(label='Website Address', max_length=100,required=True)
'''
javascriptChoices = ((2,"Keep Javascript",),(1,"Remove Some Javascript"),(0,"Remove All Javascript"))
keepJavascript = forms.ChoiceField(choices=javascriptChoices,label=" Website Javascript")
'''
| 34.7 | 105 | 0.737752 | 39 | 347 | 6.538462 | 0.74359 | 0.094118 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.019544 | 0.115274 | 347 | 9 | 106 | 38.555556 | 0.811075 | 0 | 0 | 0 | 0 | 0 | 0.107914 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
4db08c1ad06a4f3c0a888874af940f73222f14eb | 1,458 | py | Python | mojo/python/tests/bindings_constants_unittest.py | zbowling/mojo | 4d2ed40dc2390ca98a6fea0580e840535878f11c | [
"BSD-3-Clause"
] | 1 | 2020-04-28T14:35:10.000Z | 2020-04-28T14:35:10.000Z | mojo/python/tests/bindings_constants_unittest.py | TribeMedia/sky_engine | 4a3894ed246327931b198a7d64652bd0b615b036 | [
"BSD-3-Clause"
] | null | null | null | mojo/python/tests/bindings_constants_unittest.py | TribeMedia/sky_engine | 4a3894ed246327931b198a7d64652bd0b615b036 | [
"BSD-3-Clause"
] | 1 | 2020-04-28T14:35:11.000Z | 2020-04-28T14:35:11.000Z | # Copyright 2014 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 math
import unittest
# Generated files
# pylint: disable=F0401
import sample_service_mojom
import test_constants_mojom
class ConstantBindingsTest(unittest.TestCase):
def testConstantGeneration(self):
self.assertEquals(test_constants_mojom.INT8_VALUE, -2)
self.assertEquals(test_constants_mojom.UINT64_VALUE, 9999999999999999999)
self.assertEquals(test_constants_mojom.DOUBLE_INFINITY,
float('inf'))
self.assertEquals(test_constants_mojom.DOUBLE_NEGATIVE_INFINITY,
float('-inf'))
self.assertTrue(math.isnan(test_constants_mojom.DOUBLE_NA_N))
self.assertEquals(test_constants_mojom.FLOAT_INFINITY,
float('inf'))
self.assertEquals(test_constants_mojom.FLOAT_NEGATIVE_INFINITY,
float('-inf'))
self.assertTrue(math.isnan(test_constants_mojom.FLOAT_NA_N))
def testConstantOnStructGeneration(self):
self.assertEquals(test_constants_mojom.StructWithConstants.INT8_VALUE, 5)
def testStructImmutability(self):
with self.assertRaises(AttributeError):
sample_service_mojom.Foo.FOOBY = 0
with self.assertRaises(AttributeError):
del sample_service_mojom.Foo.FOOBY
with self.assertRaises(AttributeError):
sample_service_mojom.Foo.BAR = 1
| 37.384615 | 77 | 0.752401 | 171 | 1,458 | 6.175439 | 0.426901 | 0.123106 | 0.170455 | 0.192235 | 0.54072 | 0.479167 | 0.32197 | 0.32197 | 0.123106 | 0.123106 | 0 | 0.028926 | 0.170096 | 1,458 | 38 | 78 | 38.368421 | 0.843802 | 0.132373 | 0 | 0.259259 | 0 | 0 | 0.01112 | 0 | 0 | 0 | 0 | 0 | 0.444444 | 1 | 0.111111 | false | 0 | 0.148148 | 0 | 0.296296 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
4dbc315472764792a06e13d3e501c508bdc38cb4 | 769 | py | Python | src/pdf/domain/encrypt.py | ichiro-kazusa/PDFCon | 529c22145bfd20919b015b5ba70e8bab33feed01 | [
"MIT"
] | null | null | null | src/pdf/domain/encrypt.py | ichiro-kazusa/PDFCon | 529c22145bfd20919b015b5ba70e8bab33feed01 | [
"MIT"
] | null | null | null | src/pdf/domain/encrypt.py | ichiro-kazusa/PDFCon | 529c22145bfd20919b015b5ba70e8bab33feed01 | [
"MIT"
] | null | null | null |
from ..command.encrypt import EncryptionCommand
class Encryption:
def __init__(self, owner: str = '', user: str = '') -> None:
self.__owner = owner
self.__user = user
self.__verify_entries()
@property
def owner(self):
return self.__owner
@property
def user(self):
return self.__user
def __verify_entries(self):
# ## verify encryption rules
# when user password is given, empty owner password is not allowed .
# -> use user password as owner password
if self.__owner == '' and self.__user != '':
self.__owner = self.__user
@staticmethod
def create_encryption_from_CMD(cmd: EncryptionCommand) -> 'Encryption':
raise NotImplementedError()
| 24.806452 | 76 | 0.625488 | 83 | 769 | 5.445783 | 0.421687 | 0.099558 | 0.057522 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.279584 | 769 | 30 | 77 | 25.633333 | 0.815884 | 0.16775 | 0 | 0.111111 | 0 | 0 | 0.015848 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.277778 | false | 0 | 0.055556 | 0.111111 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
4dbd2fe8b25b1e5fbb2859a59ee51157048af1ed | 709 | py | Python | photos/migrations/0002_auto_20190616_1812.py | savannah8/The-gallery | ddb95d08e81e874fe8b24046a2acc40be0a68cbe | [
"Unlicense"
] | null | null | null | photos/migrations/0002_auto_20190616_1812.py | savannah8/The-gallery | ddb95d08e81e874fe8b24046a2acc40be0a68cbe | [
"Unlicense"
] | 5 | 2020-06-05T21:16:21.000Z | 2021-09-08T01:03:08.000Z | photos/migrations/0002_auto_20190616_1812.py | savannah8/The-gallery | ddb95d08e81e874fe8b24046a2acc40be0a68cbe | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-06-16 15:12
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('photos', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='image',
name='image_category',
),
migrations.RemoveField(
model_name='image',
name='image_location',
),
migrations.DeleteModel(
name='Category',
),
migrations.DeleteModel(
name='Image',
),
migrations.DeleteModel(
name='Location',
),
]
| 21.484848 | 46 | 0.543018 | 61 | 709 | 6.147541 | 0.57377 | 0.12 | 0.2 | 0.16 | 0.234667 | 0.234667 | 0.234667 | 0 | 0 | 0 | 0 | 0.042918 | 0.342736 | 709 | 32 | 47 | 22.15625 | 0.761803 | 0.093089 | 0 | 0.48 | 1 | 0 | 0.120313 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.08 | 0 | 0.2 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
4dbe3d037f49de1a5bf9a99b444cecb6fba61822 | 2,984 | py | Python | my/rtm.py | almereyda/HPI | c83bfbd21ce94a96f7af01ab0a82f20535f4aefb | [
"MIT"
] | null | null | null | my/rtm.py | almereyda/HPI | c83bfbd21ce94a96f7af01ab0a82f20535f4aefb | [
"MIT"
] | null | null | null | my/rtm.py | almereyda/HPI | c83bfbd21ce94a96f7af01ab0a82f20535f4aefb | [
"MIT"
] | null | null | null | """
[[https://rememberthemilk.com][Remember The Milk]] tasks and notes
"""
REQUIRES = [
'icalendar',
]
import re
from pathlib import Path
from typing import Dict, List, Optional, Iterator
from datetime import datetime
from .common import LazyLogger, get_files, group_by_key, cproperty, make_dict
from my.config import rtm as config
import icalendar # type: ignore
from icalendar.cal import Todo # type: ignore
logger = LazyLogger(__name__)
# TODO extract in a module to parse RTM's ical?
class MyTodo:
def __init__(self, todo: Todo, revision=None) -> None:
self.todo = todo
self.revision = revision
@cproperty
def notes(self) -> List[str]:
# TODO can there be multiple??
desc = self.todo['DESCRIPTION']
notes = re.findall(r'---\n\n(.*?)\n\nUpdated:', desc, flags=re.DOTALL)
return notes
@cproperty
def tags(self) -> List[str]:
desc = self.todo['DESCRIPTION']
[tags_str] = re.findall(r'\nTags: (.*?)\n', desc, flags=re.DOTALL)
if tags_str == 'none':
return []
tags = [t.strip() for t in tags_str.split(',')]
return tags
@cproperty
def uid(self) -> str:
return str(self.todo['UID'])
@cproperty
def title(self) -> str:
return str(self.todo['SUMMARY'])
def get_status(self) -> str:
if 'STATUS' not in self.todo:
return None # type: ignore
# TODO 'COMPLETED'?
return str(self.todo['STATUS'])
# TODO tz?
@cproperty
def time(self) -> datetime:
t1 = self.todo['DTSTAMP'].dt
t2 = self.todo['LAST-MODIFIED'].dt
assert t1 == t2 # TODO not sure which one is correct
return t1
def is_completed(self) -> bool:
return self.get_status() == 'COMPLETED'
def __repr__(self):
return repr(self.todo)
def __str__(self):
return str(self.todo)
@staticmethod
def alala_key(mtodo):
return (mtodo.revision, mtodo.get_time())
class DAL:
def __init__(self, data: str, revision=None) -> None:
self.cal = icalendar.Calendar.from_ical(data)
self.revision = revision
def all_todos(self) -> Iterator[MyTodo]:
for t in self.cal.walk('VTODO'):
yield MyTodo(t, self.revision)
def get_todos_by_uid(self) -> Dict[str, MyTodo]:
todos = self.all_todos()
return make_dict(todos, key=lambda t: t.uid)
def get_todos_by_title(self) -> Dict[str, List[MyTodo]]:
todos = self.all_todos()
return group_by_key(todos, lambda todo: todo.title)
def dal():
last = get_files(config.export_path)[-1]
data = last.read_text()
return DAL(data=data, revision='TODO')
def all_tasks() -> Iterator[MyTodo]:
yield from dal().all_todos()
def active_tasks() -> Iterator[MyTodo]:
for t in all_tasks():
if not t.is_completed():
yield t
def print_all_todos():
for t in all_tasks():
print(t)
| 24.661157 | 78 | 0.612936 | 400 | 2,984 | 4.4325 | 0.2925 | 0.054146 | 0.013536 | 0.038353 | 0.094755 | 0.059786 | 0 | 0 | 0 | 0 | 0 | 0.002709 | 0.257708 | 2,984 | 120 | 79 | 24.866667 | 0.797743 | 0.081769 | 0 | 0.1625 | 0 | 0 | 0.049541 | 0.008807 | 0 | 0 | 0 | 0.008333 | 0.0125 | 1 | 0.2375 | false | 0 | 0.1 | 0.075 | 0.55 | 0.025 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
4dc1180d1faca62d2a5375c9a1f39fa3d254832a | 350 | py | Python | learnpython/fib.py | Octoberr/swm0920 | 8f05a6b91fc205960edd57f9076facec04f49a1a | [
"Apache-2.0"
] | 2 | 2019-05-19T11:54:26.000Z | 2019-05-19T12:03:49.000Z | learnpython/fib.py | Octoberr/swm0920 | 8f05a6b91fc205960edd57f9076facec04f49a1a | [
"Apache-2.0"
] | 1 | 2020-11-27T07:55:15.000Z | 2020-11-27T07:55:15.000Z | learnpython/fib.py | Octoberr/swm0920 | 8f05a6b91fc205960edd57f9076facec04f49a1a | [
"Apache-2.0"
] | 2 | 2021-09-06T18:06:12.000Z | 2021-12-31T07:44:43.000Z | # def fib2(n): # 返回到 n 的斐波那契数列
# result = []
# a, b = 0, 1
# while b < n:
# result.append(b)
# a, b = b, a+b
# return result
#
# a = fib2(500)
# print(a)
def recur_fibo(n):
"""递归函数
输出斐波那契数列"""
if n <= 1:
return n
else:
return(recur_fibo(n-1) + recur_fibo(n-2))
a = recur_fibo(10)
print(a) | 15.217391 | 48 | 0.485714 | 56 | 350 | 2.964286 | 0.410714 | 0.216867 | 0.180723 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.051948 | 0.34 | 350 | 23 | 49 | 15.217391 | 0.666667 | 0.511429 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0 | 0 | 0.285714 | 0.142857 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
4dc7d26cc18475fbd2b690b1e9dc6d7f0d1003fa | 637 | py | Python | core/cdag/node/sub.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 84 | 2017-10-22T11:01:39.000Z | 2022-02-27T03:43:48.000Z | core/cdag/node/sub.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 22 | 2017-12-11T07:21:56.000Z | 2021-09-23T02:53:50.000Z | core/cdag/node/sub.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 23 | 2017-12-06T06:59:52.000Z | 2022-02-24T00:02:25.000Z | # ----------------------------------------------------------------------
# SubNode
# ----------------------------------------------------------------------
# Copyright (C) 2007-2020 The NOC Project
# See LICENSE for details
# ----------------------------------------------------------------------
# Python modules
from typing import Optional
# NOC modules
from .base import BaseCDAGNode, ValueType, Category
class SubNode(BaseCDAGNode):
"""
Subtract `y` from `y`
"""
name = "sub"
categories = [Category.OPERATION]
def get_value(self, x: ValueType, y: ValueType) -> Optional[ValueType]:
return x - y
| 25.48 | 75 | 0.44113 | 51 | 637 | 5.490196 | 0.686275 | 0.078571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.014898 | 0.156986 | 637 | 24 | 76 | 26.541667 | 0.506518 | 0.524333 | 0 | 0 | 0 | 0 | 0.010714 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.285714 | 0.142857 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 2 |
4dccb31b43009dc8e9a6ff9aaa09678332eccb6f | 1,028 | py | Python | tokenizer.py | momennaas/kalam-lp | fdf032ca71a155169f507cba40275ca38f409c87 | [
"MIT"
] | 6 | 2019-03-31T04:46:27.000Z | 2020-02-27T16:39:31.000Z | tokenizer.py | momennaas/kalam-lp | fdf032ca71a155169f507cba40275ca38f409c87 | [
"MIT"
] | null | null | null | tokenizer.py | momennaas/kalam-lp | fdf032ca71a155169f507cba40275ca38f409c87 | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
##############################################################
## Author: Abdulmumen Naas
## Description: Arabic Natural Language Processor (Kalam-lp)
## Version: 0.0.1
## Copyright (c) 2014 Abdulmumen Naas
##############################################################
import re
import string
from constants import *
class Tokenizer:
@classmethod
def wordTokenize(self, s, xPunct= False):
"""wordTokenize: return a list words as tokens from a raw of text."""
if not s or s == "":
return None
punct_regex = re.compile(r"[%s\s]+" % re.escape(string.punctuation))
w_regex = re.compile(r"[\w]+|[%s]" % re.escape(string.punctuation))
#_TODO_: Adding arabic punctuations
if not xPunct:
#Not exclude punctuation
tokens = re.findall(w_regex, s)
return tokens
elif xPunct:
r = punct_regx.sub(" ", s)
tokens = r.split()
return tokens
else:
return None
def main():
print "It works"
if __name__ == "__main__":
main()
| 25.073171 | 72 | 0.559339 | 121 | 1,028 | 4.636364 | 0.561983 | 0.049911 | 0.049911 | 0.053476 | 0.092692 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009792 | 0.205253 | 1,028 | 40 | 73 | 25.7 | 0.676867 | 0.208171 | 0 | 0.173913 | 0 | 0 | 0.059859 | 0 | 0 | 0 | 0 | 0.025 | 0 | 0 | null | null | 0 | 0.130435 | null | null | 0.043478 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
4dd688bf34007f2b88b7cc72d6792e3f5c02e4ad | 801 | py | Python | rec/migrations/0005_auto_20200922_1701.py | lpkyrius/rg1 | 6132ec5cd8db86088f8635f2e12ce6bf16aeff8e | [
"MIT"
] | null | null | null | rec/migrations/0005_auto_20200922_1701.py | lpkyrius/rg1 | 6132ec5cd8db86088f8635f2e12ce6bf16aeff8e | [
"MIT"
] | 2 | 2020-09-16T14:06:34.000Z | 2020-09-16T18:14:26.000Z | rec/migrations/0005_auto_20200922_1701.py | lpkyrius/rg1 | 6132ec5cd8db86088f8635f2e12ce6bf16aeff8e | [
"MIT"
] | null | null | null | # Generated by Django 3.1.1 on 2020-09-22 20:01
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rec', '0004_auto_20200922_1633'),
]
operations = [
migrations.AlterField(
model_name='convenio',
name='cnpj',
field=models.CharField(blank=True, default=' ', max_length=14, null=True),
),
migrations.AlterField(
model_name='convenio',
name='obs',
field=models.CharField(blank=True, default=' ', max_length=300, null=True),
),
migrations.AlterField(
model_name='convenio',
name='telefone',
field=models.CharField(blank=True, default=' ', max_length=100, null=True),
),
]
| 27.62069 | 87 | 0.574282 | 83 | 801 | 5.433735 | 0.518072 | 0.133038 | 0.166297 | 0.192905 | 0.607539 | 0.607539 | 0.51663 | 0.51663 | 0 | 0 | 0 | 0.069149 | 0.29588 | 801 | 28 | 88 | 28.607143 | 0.730496 | 0.05618 | 0 | 0.409091 | 1 | 0 | 0.090186 | 0.030504 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.045455 | 0 | 0.181818 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
4de2f8a837d616a9960e145e5c2a45f95ecf9856 | 127 | py | Python | learn_tf/MNIST.py | pkumusic/AI | 912f1b6f12177e301c4a7efccc305bcb52e4d823 | [
"MIT"
] | 1 | 2017-05-26T15:23:03.000Z | 2017-05-26T15:23:03.000Z | learn_tf/MNIST.py | pkumusic/AI | 912f1b6f12177e301c4a7efccc305bcb52e4d823 | [
"MIT"
] | null | null | null | learn_tf/MNIST.py | pkumusic/AI | 912f1b6f12177e301c4a7efccc305bcb52e4d823 | [
"MIT"
] | null | null | null | __author__ = "Music"
# MNIST For ML Beginners
# https://www.tensorflow.org/versions/r0.9/tutorials/mnist/beginners/index.html
| 25.4 | 79 | 0.771654 | 18 | 127 | 5.222222 | 0.888889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.017241 | 0.086614 | 127 | 4 | 80 | 31.75 | 0.793103 | 0.787402 | 0 | 0 | 0 | 0 | 0.217391 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
4de7d409e55429843384ad1f22b9b00b0eb2103a | 3,437 | py | Python | argonneV14.py | floresab/Toy-Models | 0b990563e1be903cbdcb56ead57d83bc3ca71198 | [
"MIT"
] | null | null | null | argonneV14.py | floresab/Toy-Models | 0b990563e1be903cbdcb56ead57d83bc3ca71198 | [
"MIT"
] | null | null | null | argonneV14.py | floresab/Toy-Models | 0b990563e1be903cbdcb56ead57d83bc3ca71198 | [
"MIT"
] | null | null | null | """
File : argonneV14.py
Language : Python 3.6
Created : 7/13/2018
Edited : 7/13/2018
San Digeo State University
Department of Physics and Astronomy
#https://journals.aps.org/prc/pdf/10.1103/PhysRevC.51.38 --argonneV18
This code implements Argonne V14 potential outlined in ...
--CONSTANTS --
Hbar*c | 197.33 MeV fm
pion-Mass | 138.03 MeV
Wood-Saxon|
R | 0.5 fm
a | 0.2 fm
Operator | p | Ip | Sp | Index |
-----------------------------------------------------------
central | c | -4.801125 | 2061.5625 | 0 |
tao dot tao | tao | 0.798925 | -477.3125 | 1 |
sigma dot sigma| sigma | 1.189325 | -502.3125 | 2 |
(sigma)(tao) | sigma-tao | 0.182875 | 97.0625 | 3 |
Sij | t | -0.1575 | 108.75 | 4 |
Sij(tao) | t-tao | -0.7525 | 297.25 | 5 |
L dot S | b | 0.5625 | -719.75 | 6 |
L dot S (tao) | b-tao | 0.0475 | -159.25 | 7 |
L squared | q | 0.070625 | 8.625 | 8 |
L^2(tao) | q-tao | -0.148125 | 5.625 | 9 |
L^2(sigma | q-sigma | -0.040625 | 17.375 | 10 |
L^2(sigma)(tao)| q-sigma-tao | -0.001875 | -33.625 | 11 |
(L dot S)^2 | bb | -0.5425 | 391.0 | 12 |
(LS)^2(tao) | bb-tao | 0.0025 | 145.0 | 13 |
"""
import numpy as np
def Yukawa(r):
#mu = mc/hbar
c = 2 #1/fm^2
mu = 138.03/197.33
return np.exp(-r*mu)/(mu*r)*(1-np.exp(-c*r**2))
def Tensor(r):
c = 2 #1/fm^2
mu = 138.03/197.33
return (1+3/(mu*r) + 3/(mu*r)**2)*(np.exp(-mu*r)/(mu*r))*(1-np.exp(-c*r**2))**2
def V14(r):
Vst = np.array([0,0,0,1,0,0,0,0,0,0,0,0,0,0])
Vttao = np.array([0,0,0,0,0,1,0,0,0,0,0,0,0,0])
#Short Range Strengths
Sp = np.array([\
2061.5625,\
-477.3125,\
-502.3125,\
97.0625,\
108.75,\
297.25,\
-719.75,\
-159.25,\
8.625,\
5.625,\
17.375,\
-33.625,\
391.0,\
145.0])
# phenomenological Strengths
Ip = np.array([\
-4.801125,\
0.798925,\
1.189325,\
0.182875,\
-0.1575,\
-0.7525,\
0.5625,\
0.0475,\
0.070625,\
-0.148125,\
-0.040625,\
-0.001875,\
-0.5425,\
0.0025])
#woods-Saxon
short_range = Sp*1.0/(1+np.exp((r-0.5)/.2))
# phenomenological shape
phenomenological = Ip*(Tensor(r)**2)
#Explcit Pion Exchange
pion = 3.72681*(Vst*Yukawa(r) + Vttao*Tensor(r))
#compute V14 potential -- of indivdual operators
return short_range + phenomenological + pion
| 33.696078 | 84 | 0.364562 | 417 | 3,437 | 3 | 0.335731 | 0.035172 | 0.043165 | 0.044764 | 0.091127 | 0.078337 | 0.078337 | 0.078337 | 0.059153 | 0.057554 | 0 | 0.262158 | 0.479488 | 3,437 | 101 | 85 | 34.029703 | 0.437116 | 0.524003 | 0 | 0.086957 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.065217 | false | 0 | 0.021739 | 0 | 0.152174 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
4dfbb723c6f3d56895498fae876785ec1b7ea406 | 19,132 | py | Python | pysnmp/ERI-DNX-STS1-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/ERI-DNX-STS1-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/ERI-DNX-STS1-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 ERI-DNX-STS1-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ERI-DNX-STS1-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 18:51:50 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)
#
ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueSizeConstraint, ValueRangeConstraint, SingleValueConstraint, ConstraintsUnion, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ValueRangeConstraint", "SingleValueConstraint", "ConstraintsUnion", "ConstraintsIntersection")
DecisionType, LinkCmdStatus, PortStatus, LinkPortAddress, FunctionSwitch, devices, trapSequence = mibBuilder.importSymbols("ERI-DNX-SMC-MIB", "DecisionType", "LinkCmdStatus", "PortStatus", "LinkPortAddress", "FunctionSwitch", "devices", "trapSequence")
eriMibs, = mibBuilder.importSymbols("ERI-ROOT-SMI", "eriMibs")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
MibScalar, MibTable, MibTableRow, MibTableColumn, NotificationType, Integer32, Gauge32, IpAddress, Counter64, ObjectIdentity, iso, Unsigned32, MibIdentifier, Counter32, Bits, TimeTicks, ModuleIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "NotificationType", "Integer32", "Gauge32", "IpAddress", "Counter64", "ObjectIdentity", "iso", "Unsigned32", "MibIdentifier", "Counter32", "Bits", "TimeTicks", "ModuleIdentity")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
eriDNXSts1MIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 644, 3, 4))
if mibBuilder.loadTexts: eriDNXSts1MIB.setLastUpdated('200204080000Z')
if mibBuilder.loadTexts: eriDNXSts1MIB.setOrganization('Eastern Research, Inc.')
dnxSTS1 = MibIdentifier((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3))
sts1Config = MibIdentifier((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 1))
sts1Diag = MibIdentifier((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 2))
class VtGroupType(TextualConvention, Integer32):
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1))
namedValues = NamedValues(("vt2-0-e1", 0), ("vt1-5-ds1", 1))
sts1MapperConfigTable = MibTable((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 1, 1), )
if mibBuilder.loadTexts: sts1MapperConfigTable.setStatus('current')
sts1MapperConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 1, 1, 1), ).setIndexNames((0, "ERI-DNX-STS1-MIB", "sts1MapperAddr"))
if mibBuilder.loadTexts: sts1MapperConfigEntry.setStatus('current')
sts1MapperAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 1, 1, 1, 1), LinkPortAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sts1MapperAddr.setStatus('current')
sts1MapperResource = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 1, 1, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sts1MapperResource.setStatus('current')
sts1VtGroup1 = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 1, 1, 1, 3), VtGroupType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sts1VtGroup1.setStatus('current')
sts1VtGroup2 = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 1, 1, 1, 4), VtGroupType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sts1VtGroup2.setStatus('current')
sts1VtGroup3 = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 1, 1, 1, 5), VtGroupType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sts1VtGroup3.setStatus('current')
sts1VtGroup4 = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 1, 1, 1, 6), VtGroupType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sts1VtGroup4.setStatus('current')
sts1VtGroup5 = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 1, 1, 1, 7), VtGroupType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sts1VtGroup5.setStatus('current')
sts1VtGroup6 = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 1, 1, 1, 8), VtGroupType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sts1VtGroup6.setStatus('current')
sts1VtGroup7 = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 1, 1, 1, 9), VtGroupType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sts1VtGroup7.setStatus('current')
sts1VtMapping = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 1, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("standardVT", 0), ("sequencialFrm", 1)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: sts1VtMapping.setStatus('current')
sts1Timing = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 1, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("internal", 0), ("ec1-Line", 1)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sts1Timing.setStatus('current')
sts1ShortCable = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 1, 1, 1, 12), FunctionSwitch()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sts1ShortCable.setStatus('current')
sts1MaprCmdStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 1, 1, 1, 13), LinkCmdStatus()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sts1MaprCmdStatus.setStatus('current')
sts1T1E1LinkConfigTable = MibTable((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 1, 2), )
if mibBuilder.loadTexts: sts1T1E1LinkConfigTable.setStatus('current')
sts1T1E1LinkConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 1, 2, 1), ).setIndexNames((0, "ERI-DNX-STS1-MIB", "sts1T1E1CfgLinkAddr"))
if mibBuilder.loadTexts: sts1T1E1LinkConfigEntry.setStatus('current')
sts1T1E1CfgLinkAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 1, 2, 1, 1), LinkPortAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sts1T1E1CfgLinkAddr.setStatus('current')
sts1T1E1CfgResource = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 1, 2, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sts1T1E1CfgResource.setStatus('current')
sts1T1E1CfgLinkName = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 1, 2, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 20))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sts1T1E1CfgLinkName.setStatus('current')
sts1T1E1Status = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 1, 2, 1, 4), PortStatus()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sts1T1E1Status.setStatus('current')
sts1T1E1Clear = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 1, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("disabled", 0), ("framed", 1), ("unframed", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sts1T1E1Clear.setStatus('current')
sts1T1E1Framing = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 1, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(5, 6, 7))).clone(namedValues=NamedValues(("t1Esf", 5), ("t1D4", 6), ("t1Unframed", 7)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sts1T1E1Framing.setStatus('current')
sts1T1E1NetLoop = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 1, 2, 1, 7), FunctionSwitch()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sts1T1E1NetLoop.setStatus('current')
sts1T1E1YelAlrm = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 1, 2, 1, 8), DecisionType()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sts1T1E1YelAlrm.setStatus('current')
sts1T1E1RecoverTime = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 1, 2, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(3, 10, 15))).clone(namedValues=NamedValues(("timeout-3-secs", 3), ("timeout-10-secs", 10), ("timeout-15-secs", 15)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sts1T1E1RecoverTime.setStatus('current')
sts1T1E1EsfFormat = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 1, 2, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("att-54016", 0), ("ansi-t1-403", 1)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sts1T1E1EsfFormat.setStatus('current')
sts1T1E1IdleCode = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 1, 2, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("busy", 0), ("idle", 1)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sts1T1E1IdleCode.setStatus('current')
sts1T1E1CfgCmdStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 1, 2, 1, 12), LinkCmdStatus()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sts1T1E1CfgCmdStatus.setStatus('current')
sts1T1E1Gr303Facility = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 1, 2, 1, 13), DecisionType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sts1T1E1Gr303Facility.setStatus('obsolete')
sts1MapperStatusTable = MibTable((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 2, 1), )
if mibBuilder.loadTexts: sts1MapperStatusTable.setStatus('current')
sts1MapperStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 2, 1, 1), ).setIndexNames((0, "ERI-DNX-STS1-MIB", "sts1MapperStatusAddr"))
if mibBuilder.loadTexts: sts1MapperStatusEntry.setStatus('current')
sts1MapperStatusAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 2, 1, 1, 1), LinkPortAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sts1MapperStatusAddr.setStatus('current')
sts1MapperStatusResource = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 2, 1, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sts1MapperStatusResource.setStatus('current')
sts1MapperStatusState = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 2, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 32, 256, 512, 1024, 8192, 131072, 2147483647))).clone(namedValues=NamedValues(("ok", 0), ("lof", 32), ("lop", 256), ("oof", 512), ("ais", 1024), ("los", 8192), ("lomf", 131072), ("errors", 2147483647)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: sts1MapperStatusState.setStatus('current')
sts1MapperStatusLOSErrs = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 2, 1, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sts1MapperStatusLOSErrs.setStatus('current')
sts1MapperStatusOOFErrs = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 2, 1, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sts1MapperStatusOOFErrs.setStatus('current')
sts1MapperStatusLOFErrs = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 2, 1, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sts1MapperStatusLOFErrs.setStatus('current')
sts1MapperStatusLOPtrErrs = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 2, 1, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sts1MapperStatusLOPtrErrs.setStatus('current')
sts1MapperStatusAISErrs = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 2, 1, 1, 8), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sts1MapperStatusAISErrs.setStatus('current')
sts1MapperStatusMultiFErrs = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 2, 1, 1, 9), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sts1MapperStatusMultiFErrs.setStatus('current')
sts1MapperStatusRxTraceErrs = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 2, 1, 1, 10), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sts1MapperStatusRxTraceErrs.setStatus('current')
sts1MapperStatusTotErrSecs = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 2, 1, 1, 11), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sts1MapperStatusTotErrSecs.setStatus('current')
sts1MapperStatusCmdStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 2, 1, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 14, 101, 114, 200, 206, 500, 501, 502))).clone(namedValues=NamedValues(("ready-for-command", 0), ("update", 1), ("clearErrors", 14), ("update-successful", 101), ("clear-successful", 114), ("err-general-test-error", 200), ("err-field-cannot-be-set", 206), ("err-snmp-parse-failed", 500), ("err-invalid-snmp-type", 501), ("err-invalid-snmp-var-size", 502)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sts1MapperStatusCmdStatus.setStatus('current')
sts1LIUTable = MibTable((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 2, 2), )
if mibBuilder.loadTexts: sts1LIUTable.setStatus('current')
sts1LIUEntry = MibTableRow((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 2, 2, 1), ).setIndexNames((0, "ERI-DNX-STS1-MIB", "sts1LIUAddr"))
if mibBuilder.loadTexts: sts1LIUEntry.setStatus('current')
sts1LIUAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 2, 2, 1, 1), LinkPortAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sts1LIUAddr.setStatus('current')
sts1LIUResource = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 2, 2, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sts1LIUResource.setStatus('current')
sts1LIUBertState = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 2, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(45, 44))).clone(namedValues=NamedValues(("off", 45), ("liu-bert", 44)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sts1LIUBertState.setStatus('current')
sts1LIUBertErrSecs = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 2, 2, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sts1LIUBertErrSecs.setStatus('current')
sts1LIUBertDuration = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 2, 2, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sts1LIUBertDuration.setStatus('current')
sts1LIULoopType = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 2, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 39))).clone(namedValues=NamedValues(("off", 0), ("mapper", 1), ("liu", 39)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sts1LIULoopType.setStatus('current')
sts1LIUDigitalErrs = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 2, 2, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sts1LIUDigitalErrs.setStatus('current')
sts1LIUAnalogErrs = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 2, 2, 1, 8), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sts1LIUAnalogErrs.setStatus('current')
sts1LIUExcessZeros = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 2, 2, 1, 9), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sts1LIUExcessZeros.setStatus('current')
sts1LIUCodingViolationErrs = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 2, 2, 1, 10), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sts1LIUCodingViolationErrs.setStatus('current')
sts1LIUPRBSErrs = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 2, 2, 1, 11), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sts1LIUPRBSErrs.setStatus('current')
sts1LIUCmdStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 2, 2, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 14, 101, 114, 200, 202, 203, 205, 206, 500, 501, 502))).clone(namedValues=NamedValues(("ready-for-command", 0), ("update", 1), ("clearErrors", 14), ("update-successful", 101), ("clear-successful", 114), ("err-general-test-error", 200), ("err-invalid-loop-type", 202), ("err-invalid-bert-type", 203), ("err-test-in-progress", 205), ("err-field-cannot-be-set", 206), ("err-snmp-parse-failed", 500), ("err-invalid-snmp-type", 501), ("err-invalid-snmp-var-size", 502)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sts1LIUCmdStatus.setStatus('current')
dnxSTS1Enterprise = ObjectIdentity((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 0))
if mibBuilder.loadTexts: dnxSTS1Enterprise.setStatus('current')
sts1MapperConfigTrap = NotificationType((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 0, 1)).setObjects(("ERI-DNX-SMC-MIB", "trapSequence"), ("ERI-DNX-STS1-MIB", "sts1MapperAddr"), ("ERI-DNX-STS1-MIB", "sts1MaprCmdStatus"))
if mibBuilder.loadTexts: sts1MapperConfigTrap.setStatus('current')
sts1T1E1ConfigTrap = NotificationType((1, 3, 6, 1, 4, 1, 644, 2, 4, 2, 3, 0, 2)).setObjects(("ERI-DNX-SMC-MIB", "trapSequence"), ("ERI-DNX-STS1-MIB", "sts1T1E1CfgLinkAddr"), ("ERI-DNX-STS1-MIB", "sts1T1E1CfgCmdStatus"))
if mibBuilder.loadTexts: sts1T1E1ConfigTrap.setStatus('current')
mibBuilder.exportSymbols("ERI-DNX-STS1-MIB", sts1MapperStatusCmdStatus=sts1MapperStatusCmdStatus, sts1MapperStatusTotErrSecs=sts1MapperStatusTotErrSecs, sts1MapperStatusEntry=sts1MapperStatusEntry, PYSNMP_MODULE_ID=eriDNXSts1MIB, sts1T1E1YelAlrm=sts1T1E1YelAlrm, sts1Config=sts1Config, sts1VtGroup5=sts1VtGroup5, sts1MapperStatusState=sts1MapperStatusState, sts1LIUDigitalErrs=sts1LIUDigitalErrs, sts1Diag=sts1Diag, sts1LIUBertDuration=sts1LIUBertDuration, sts1T1E1NetLoop=sts1T1E1NetLoop, sts1MapperResource=sts1MapperResource, sts1ShortCable=sts1ShortCable, sts1MapperStatusAISErrs=sts1MapperStatusAISErrs, sts1LIUCodingViolationErrs=sts1LIUCodingViolationErrs, sts1VtGroup1=sts1VtGroup1, sts1MapperAddr=sts1MapperAddr, sts1LIUResource=sts1LIUResource, sts1LIUBertState=sts1LIUBertState, dnxSTS1=dnxSTS1, sts1T1E1CfgLinkName=sts1T1E1CfgLinkName, sts1LIULoopType=sts1LIULoopType, sts1T1E1ConfigTrap=sts1T1E1ConfigTrap, sts1T1E1CfgResource=sts1T1E1CfgResource, sts1LIUAnalogErrs=sts1LIUAnalogErrs, sts1MapperStatusLOPtrErrs=sts1MapperStatusLOPtrErrs, sts1LIUAddr=sts1LIUAddr, sts1VtGroup6=sts1VtGroup6, sts1T1E1Status=sts1T1E1Status, sts1VtMapping=sts1VtMapping, VtGroupType=VtGroupType, sts1VtGroup3=sts1VtGroup3, sts1T1E1IdleCode=sts1T1E1IdleCode, sts1LIUBertErrSecs=sts1LIUBertErrSecs, sts1VtGroup4=sts1VtGroup4, sts1MapperConfigTable=sts1MapperConfigTable, sts1MapperStatusAddr=sts1MapperStatusAddr, sts1T1E1Gr303Facility=sts1T1E1Gr303Facility, sts1Timing=sts1Timing, sts1MapperStatusOOFErrs=sts1MapperStatusOOFErrs, sts1MapperStatusResource=sts1MapperStatusResource, sts1VtGroup2=sts1VtGroup2, eriDNXSts1MIB=eriDNXSts1MIB, sts1T1E1Framing=sts1T1E1Framing, sts1MapperStatusLOFErrs=sts1MapperStatusLOFErrs, sts1LIUTable=sts1LIUTable, sts1T1E1LinkConfigTable=sts1T1E1LinkConfigTable, sts1MapperStatusMultiFErrs=sts1MapperStatusMultiFErrs, sts1LIUExcessZeros=sts1LIUExcessZeros, sts1VtGroup7=sts1VtGroup7, sts1MapperStatusLOSErrs=sts1MapperStatusLOSErrs, sts1T1E1CfgLinkAddr=sts1T1E1CfgLinkAddr, sts1T1E1RecoverTime=sts1T1E1RecoverTime, dnxSTS1Enterprise=dnxSTS1Enterprise, sts1MaprCmdStatus=sts1MaprCmdStatus, sts1T1E1EsfFormat=sts1T1E1EsfFormat, sts1MapperStatusRxTraceErrs=sts1MapperStatusRxTraceErrs, sts1MapperConfigEntry=sts1MapperConfigEntry, sts1T1E1LinkConfigEntry=sts1T1E1LinkConfigEntry, sts1LIUCmdStatus=sts1LIUCmdStatus, sts1MapperConfigTrap=sts1MapperConfigTrap, sts1LIUEntry=sts1LIUEntry, sts1LIUPRBSErrs=sts1LIUPRBSErrs, sts1T1E1CfgCmdStatus=sts1T1E1CfgCmdStatus, sts1MapperStatusTable=sts1MapperStatusTable, sts1T1E1Clear=sts1T1E1Clear)
| 127.546667 | 2,554 | 0.744041 | 2,312 | 19,132 | 6.156142 | 0.120675 | 0.009696 | 0.013701 | 0.018267 | 0.471931 | 0.413124 | 0.359306 | 0.333099 | 0.265931 | 0.235579 | 0 | 0.112316 | 0.089275 | 19,132 | 149 | 2,555 | 128.402685 | 0.704545 | 0.01704 | 0 | 0 | 0 | 0 | 0.128478 | 0.016492 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.056738 | 0 | 0.085106 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
4dfd222e1995b07a6acae65ab8a9083933dc5471 | 632 | py | Python | nqs_tf/models/ffnn.py | ameya1101/neural-quantum-states | 2ab4f970e4cd7ed2a4ed3ebfdfe66bab396c11af | [
"MIT"
] | null | null | null | nqs_tf/models/ffnn.py | ameya1101/neural-quantum-states | 2ab4f970e4cd7ed2a4ed3ebfdfe66bab396c11af | [
"MIT"
] | null | null | null | nqs_tf/models/ffnn.py | ameya1101/neural-quantum-states | 2ab4f970e4cd7ed2a4ed3ebfdfe66bab396c11af | [
"MIT"
] | null | null | null | import tensorflow as tf
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Dense
from activations.activations import tan_sigmoid, exponential, ReLU
class FFNN(Model):
""" Creates a generic Feedforward neural network.
"""
def __init__(self):
super(FFNN, self).__init__()
def build(self, input_shape):
self.dense1 = Dense(units=input_shape[-1], activation=ReLU)
self.output_layer = Dense(units=1, activation=exponential)
def call(self, inputs):
x = self.dense1(inputs)
x = self.output_layer(x)
return tf.reduce_sum(x, axis=-1)
| 30.095238 | 67 | 0.683544 | 82 | 632 | 5.097561 | 0.52439 | 0.066986 | 0.090909 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.01006 | 0.213608 | 632 | 20 | 68 | 31.6 | 0.830986 | 0.071203 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.214286 | false | 0 | 0.285714 | 0 | 0.642857 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
15035bfbd1a02ccbee3c988cf9c68e7e783016d5 | 3,104 | py | Python | sciunit/models/examples.py | russelljjarvis/sciun | f8f6ede84299dc700afe94b07ae4e98f87a19116 | [
"MIT"
] | 1 | 2020-05-28T00:35:23.000Z | 2020-05-28T00:35:23.000Z | sciunit/models/examples.py | ChihweiLHBird/sciunit | f5669d165fa505c3a17ac17af3d3c78aafd44ae2 | [
"MIT"
] | 1 | 2020-12-29T04:28:57.000Z | 2020-12-29T04:28:57.000Z | sciunit/models/examples.py | russelljjarvis/sciunit | f8f6ede84299dc700afe94b07ae4e98f87a19116 | [
"MIT"
] | null | null | null | """Example SciUnit model classes."""
import random
from sciunit.models import Model
from sciunit.capabilities import ProducesNumber
from sciunit.utils import class_intern, method_cache
from sciunit.utils import method_memoize # Decorator for caching of capability method results.
from typing import Union
class ConstModel(Model, ProducesNumber):
"""A model that always produces a constant number as output."""
def __init__(self, constant: Union[int, float], name: str=None):
self.constant = constant
super(ConstModel, self).__init__(name=name, constant=constant)
def produce_number(self) -> Union[int, float]:
return self.constant
class UniformModel(Model, ProducesNumber):
"""A model that always produces a random uniformly distributed number.
in [a,b] as output."""
def __init__(self, a, b, name=None):
self.a, self.b = a, b
super(UniformModel, self).__init__(name=name, a=a, b=b)
def produce_number(self) -> float:
"""Produece a number between `a` and `b`.
Returns:
float: The number between a and b.
"""
return random.uniform(self.a, self.b)
################################################################
# Here are several examples of caching and sharing can be used
# to reduce the computational load of testing.
################################################################
class UniqueRandomNumberModel(Model, ProducesNumber):
"""An example model to ProducesNumber."""
def produce_number(self) -> float:
"""Each call to this method will produce a different random number.
Returns:
float: A random number produced.
"""
return random.random()
class RepeatedRandomNumberModel(Model, ProducesNumber):
"""An example model to demonstrate ProducesNumber with cypy.lazy."""
@method_memoize
def produce_number(self):
"""Each call to this method will produce the same random number as was returned in the first call, ensuring reproducibility and eliminating computational overhead.
Returns:
float: A random number produced.
"""
return random.random()
@class_intern
class SharedModel(Model):
"""A model that, each time it is instantiated with the same parameters,
will return the same instance at the same locaiton in memory.
Attributes should not be set post-instantiation
unless the goal is to set those attributes on all models of this class."""
pass
class PersistentUniformModel(UniformModel):
"""TODO"""
def run(self) -> None:
self._x = random.uniform(self.a, self.b)
def produce_number(self) -> float:
return self._x
class CacheByInstancePersistentUniformModel(PersistentUniformModel):
"""TODO"""
@method_cache(by='instance', method='run')
def produce_number(self) -> float:
return self._x
class CacheByValuePersistentUniformModel(PersistentUniformModel):
"""TODO"""
@method_cache(by='value', method='run')
def produce_number(self) -> float:
return self._x
| 30.732673 | 171 | 0.661727 | 369 | 3,104 | 5.474255 | 0.322493 | 0.034653 | 0.055446 | 0.069307 | 0.354951 | 0.267327 | 0.19703 | 0.166337 | 0.122772 | 0.1 | 0 | 0 | 0.208763 | 3,104 | 100 | 172 | 31.04 | 0.822476 | 0.356959 | 0 | 0.243902 | 0 | 0 | 0.011085 | 0 | 0 | 0 | 0 | 0.01 | 0 | 1 | 0.243902 | false | 0.02439 | 0.146341 | 0.097561 | 0.756098 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
150ef1714addd55d364456c56a5bbe4b9e5b825d | 12,703 | py | Python | eden.py | nobesio/eden | c301abdc64647fde02e8117ea137db322a804739 | [
"MIT"
] | null | null | null | eden.py | nobesio/eden | c301abdc64647fde02e8117ea137db322a804739 | [
"MIT"
] | null | null | null | eden.py | nobesio/eden | c301abdc64647fde02e8117ea137db322a804739 | [
"MIT"
] | null | null | null | from random import randint
import copy
# Auxiliary Function for rotating the DNA in each cycle.
def rotate(l,n):
return l[n:] + l[:n]
# History is the object responsible for accounting all the organisms.
class History:
def __init__(self):
self.orgs = []
def addOrganism(self, org):
self.orgs.append(org)
def getGenepool(self):
genepool = []
genepooldetail = []
for organism in self.orgs:
if not organism.dna in genepool:
genepool.append(organism.dna)
genepooldetail.append([[organism.name], organism.dna, 1])
else:
for unit in genepooldetail:
if unit[1] == organism.dna:
unit[0].append(organism.name)
unit[2] += 1
return genepooldetail
# Organism is the structure for the living organisms.
class Organism:
def __init__(self, name, dna, energy):
self.memory = 0
self.name = name
self.dna = dna
self.energy = energy
self.size = len(dna)
self.age = 0
self.sons = 0
self.parent = ""
def __repr__(self):
return self.name + " E:" + str(self.energy) + "Y:" + str(self.age)
def toAge(self):
self.age += 1
def reportStatus(self):
print("Name: ", self.name)
print("DNA: ", self.dna)
print("Energy: ", self.energy)
print("Size: ", self.size)
print("Age: ", self.age)
def divide(self):
self.sons += 1
son = copy.deepcopy(self)
son.sons = 0
son.parent = self.name
son.name = son.name + "-" + str(self.sons)
son.age = 0
son.energy = 5
self.energy += -5
for x in range(randint(0,10)):
if randint(1,100) > 95:
print("MUTACION!")
if randint(0,1) == 0:
# ADD GEN
son.dna.insert(randint(0,len(son.dna)-1), randint(0,12))
else:
# REMOVE GEN
son.dna.pop(randint(0, len(son.dna)-1))
print(son.dna)
return son
def decreaseEnergy(self):
print("Bajando de ", self.energy)
self.energy = self.energy - 1
def increaseEnergy(self, energy):
self.energy = energy + energy
# QuantumPackages are the "food" of this simulation. The name comes from the concept used in operative systems.
class QuantumPackage:
def __init__(self, quantums):
self.quantums = quantums
def __repr__(self):
return 'QP'
# Enviroment is the class responsible for holding all the living organisms.
class Enviroment:
def __init__(self, size):
self.size = size
self.landscape = [[0 for x in range(size)] for x in range(size)]
def reportStatus(self):
print("LANDSCAPE:")
for row in self.landscape:
print(row)
def getOrganismsCoor(self):
organisms = []
fila = 0
columna = 0
for row in self.landscape:
columna = 0
for element in row:
if isinstance(element,Organism):
organisms.append((fila, columna))
columna += 1
fila += 1
print("FOUND ", len(organisms))
return organisms
def getOrganisms(self):
orgs = []
for row in self.landscape:
for element in row:
if isinstance(element,Organism):
orgs.append(element)
return orgs
def countOrgs(self):
cont = 0
for row in self.landscape:
for element in row:
if isinstance(element, Organism):
cont += 1
return cont
# Time is the class responsible for aging the living organisms.
class Time:
def aging(self, enviroment):
for row in enviroment.landscape:
for element in row:
if isinstance(element, Organism):
element.toAge()
# Death is the class responsible for killing old or starving organisms.
class Death:
def __init__(self):
self.killed = []
def kill(self, enviroment):
fila=0
for row in enviroment.landscape:
columna = 0
for element in row:
if isinstance(element, Organism):
if element.energy <= 0 or element.age > 20:
self.killed.append(element)
print("Killing ", fila, columna)
enviroment.landscape[fila][columna] = 0
columna +=1
fila +=1
# Interpreter is the class that gives life to the organism. It executes the code in their DNA.
class Interpreter:
def interprete(self, enviroment):
def up():
enviroment.landscape[x][y].decreaseEnergy()
print("Move Up" , x, y)
if x > 0:
if enviroment.landscape[x-1][y] == 0:
enviroment.landscape[x-1][y] = enviroment.landscape[x][y]
enviroment.landscape[x][y] = 0
elif isinstance(enviroment.landscape[x-1][y],QuantumPackage):
enviroment.landscape[x][y].increaseEnergy(enviroment.landscape[x-1][y].quantums)
enviroment.landscape[x-1][y] = enviroment.landscape[x][y]
enviroment.landscape[x][y] = 0
def down():
enviroment.landscape[x][y].decreaseEnergy()
print("Move Down", x, y)
if x < enviroment.size-1:
if enviroment.landscape[x+1][y] == 0:
enviroment.landscape[x+1][y] = enviroment.landscape[x][y]
enviroment.landscape[x][y] = 0
elif isinstance(enviroment.landscape[x+1][y],QuantumPackage):
enviroment.landscape[x][y].increaseEnergy(enviroment.landscape[x+1][y].quantums)
enviroment.landscape[x+1][y] = enviroment.landscape[x][y]
enviroment.landscape[x][y] = 0
def right():
enviroment.landscape[x][y].decreaseEnergy()
print("Move Right", x, y)
if y < enviroment.size-1:
if enviroment.landscape[x][y+1] == 0:
enviroment.landscape[x][y+1] = enviroment.landscape[x][y]
enviroment.landscape[x][y] = 0
elif isinstance(enviroment.landscape[x][y+1],QuantumPackage):
enviroment.landscape[x][y].increaseEnergy(enviroment.landscape[x][y+1].quantums)
enviroment.landscape[x][y+1] = enviroment.landscape[x][y]
enviroment.landscape[x][y] = 0
def left():
enviroment.landscape[x][y].decreaseEnergy()
print("Move Left", x, y)
if y > 0:
if enviroment.landscape[x][y-1] == 0:
enviroment.landscape[x][y-1] = enviroment.landscape[x][y]
enviroment.landscape[x][y] = 0
elif isinstance(enviroment.landscape[x][y-1],QuantumPackage):
enviroment.landscape[x][y].increaseEnergy(enviroment.landscape[x][y-1].quantums)
enviroment.landscape[x][y-1] = enviroment.landscape[x][y]
enviroment.landscape[x][y] = 0
def divide():
if enviroment.landscape[x][y].energy > 7:
enviroment.landscape[x][y].decreaseEnergy()
sonX = randint(-1,1)
sonY = randint(-1,1)
if sonX != 0 or sonY != 0:
if x + sonX > 0 and x + sonX < enviroment.size-1:
if y + sonY > 0 and y + sonY < enviroment.size-1:
if enviroment.landscape[x + sonX][y + sonY] == 0:
enviroment.landscape[x + sonX][y + sonY] = enviroment.landscape[x][y].divide()
else:
enviroment.landscape[x][y].decreaseEnergy()
def writeOne():
print("WRITE 1")
enviroment.landscape[x][y].memory = 1
def writeCero():
print("WRITE 0")
enviroment.landscape[x][y].memory = 0
def ifTrue():
print("CHECKING iF TRUE")
if enviroment.landscape[x][y].memory != 1:
enviroment.landscape[x][y].dna = rotate(enviroment.landscape[x][y].dna, 1)
def checkUp():
print("CHECKING UP")
if x > 0:
if enviroment.landscape[x-1][y] != 0:
enviroment.landscape[x][y].memory = 1
else:
enviroment.landscape[x][y].memory = 0
else:
enviroment.landscape[x][y].memory = 0
def checkDown():
print("CHECKING DOWN")
if x < enviroment.size-1:
if enviroment.landscape[x+1][y] != 0:
enviroment.landscape[x][y].memory = 1
else:
enviroment.landscape[x][y].memory = 0
else:
enviroment.landscape[x][y].memory = 0
def checkRight():
print("CHECKING RIGHT")
if y < enviroment.size-1:
if enviroment.landscape[x][y+1] != 0:
enviroment.landscape[x][y].memory = 1
else:
enviroment.landscape[x][y].memory = 0
else:
enviroment.landscape[x][y].memory = 0
def checkLeft():
print("CHECKING LEFT")
if y > 0:
if enviroment.landscape[x][y-1] != 0:
enviroment.landscape[x][y].memory = 1
else:
enviroment.landscape[x][y].memory = 0
else:
enviroment.landscape[x][y].memory = 0
def checkEnergyDivide():
if enviroment.landscape[x][y].energy > 7:
enviroment.landscape[x][y].memory = 1
else:
enviroment.landscape[x][y].memory = 0
options = {0 : up,
1 : down,
2 : right,
3 : left,
4 : divide,
5 : writeOne,
6 : writeCero,
7 : ifTrue,
8 : checkUp,
9 : checkDown,
10 : checkRight,
11 : checkLeft,
12: checkEnergyDivide
}
for organismCoordinates in enviroment.getOrganismsCoor():
x = organismCoordinates[0]
y = organismCoordinates[1]
gen = enviroment.landscape[x][y].dna[0]
enviroment.landscape[x][y].dna = rotate(enviroment.landscape[x][y].dna, 1)
print("ejecutando en ", x, y, "gen ", gen)
options[gen]()
if __name__ == '__main__':
book = History()
earth = Enviroment(10)
earth.reportStatus()
earth.landscape[0][0] = QuantumPackage(10)
earth.landscape[1][1] = Organism("Eva", [8,7,0,9,7,1,10,7,2,11,7,3,12,7,4], 15)
#Poblemos Tierra
for i in range(0,4):
x = randint(0, earth.size-1)
y = randint(0, earth.size-1)
if earth.landscape[x][y] == 0:
dna = []
for a in range(1,11):
dna.append(randint(0,12))
earth.landscape[x][y] = Organism("Eva"+str(i), dna, 15)
earth.reportStatus()
chronos = Time()
parca = Death()
god = Interpreter()
for i in range(0,200):
if earth.countOrgs() > 0:
print("ciclo: ", i)
god.interprete((earth))
chronos.aging(earth)
parca.kill(earth)
earth.reportStatus()
for i in range(1,4):
x = randint(0,9)
y = randint(0,9)
if earth.landscape[x][y] == 0:
earth.landscape[x][y] = QuantumPackage(randint(5,10))
for org in earth.getOrganisms():
if not org in book.orgs:
book.addOrganism(org)
else:
print("SE MURIERON TODOS EN EL CICLO: ", i)
break
print("Living:", len(earth.getOrganisms()))
print("GENEPOOL:", book.getGenepool())
| 37.919403 | 112 | 0.492954 | 1,369 | 12,703 | 4.547845 | 0.130022 | 0.1301 | 0.24735 | 0.212496 | 0.471089 | 0.422904 | 0.393511 | 0.354321 | 0.354321 | 0.346129 | 0 | 0.027111 | 0.393135 | 12,703 | 334 | 113 | 38.032934 | 0.780516 | 0.04865 | 0 | 0.336735 | 0 | 0 | 0.024197 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.119048 | false | 0 | 0.006803 | 0.010204 | 0.176871 | 0.095238 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
151306af1c1480903dd00ab70e45e88f683fbe48 | 2,463 | py | Python | scripts/tflite_model_tools/tflite/Metadata.py | LaudateCorpus1/edgeai-tidl-tools | d98789769a711e5a3700dfdc20d877073bd87da7 | [
"CNRI-Python"
] | 15 | 2021-09-05T03:43:54.000Z | 2022-03-29T14:17:29.000Z | scripts/tflite_model_tools/tflite/Metadata.py | LaudateCorpus1/edgeai-tidl-tools | d98789769a711e5a3700dfdc20d877073bd87da7 | [
"CNRI-Python"
] | 21 | 2021-09-01T06:58:31.000Z | 2022-03-31T06:33:15.000Z | scripts/tflite_model_tools/tflite/Metadata.py | LaudateCorpus1/edgeai-tidl-tools | d98789769a711e5a3700dfdc20d877073bd87da7 | [
"CNRI-Python"
] | 6 | 2021-09-22T06:44:19.000Z | 2022-02-07T06:28:35.000Z | # automatically generated by the FlatBuffers compiler, do not modify
# namespace: tflite
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class Metadata(object):
__slots__ = ['_tab']
@classmethod
def GetRootAsMetadata(cls, buf, offset):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = Metadata()
x.Init(buf, n + offset)
return x
@classmethod
def MetadataBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed)
# Metadata
def Init(self, buf, pos):
self._tab = flatbuffers.table.Table(buf, pos)
# Metadata
def Name(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
return self._tab.String(o + self._tab.Pos)
return None
# Metadata
def Buffer(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos)
return 0
def MetadataStart(builder): builder.StartObject(2)
def MetadataAddName(builder, name): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0)
def MetadataAddBuffer(builder, buffer): builder.PrependUint32Slot(1, buffer, 0)
def MetadataEnd(builder): return builder.EndObject()
class MetadataT(object):
# MetadataT
def __init__(self):
self.name = None # type: str
self.buffer = 0 # type: int
@classmethod
def InitFromBuf(cls, buf, pos):
metadata = Metadata()
metadata.Init(buf, pos)
return cls.InitFromObj(metadata)
@classmethod
def InitFromObj(cls, metadata):
x = MetadataT()
x._UnPack(metadata)
return x
# MetadataT
def _UnPack(self, metadata):
if metadata is None:
return
self.name = metadata.Name()
self.buffer = metadata.Buffer()
# MetadataT
def Pack(self, builder):
if self.name is not None:
name = builder.CreateString(self.name)
MetadataStart(builder)
if self.name is not None:
MetadataAddName(builder, name)
MetadataAddBuffer(builder, self.buffer)
metadata = MetadataEnd(builder)
return metadata
| 29.674699 | 131 | 0.657734 | 283 | 2,463 | 5.618375 | 0.29682 | 0.030818 | 0.055346 | 0.066038 | 0.175472 | 0.154088 | 0.106918 | 0.074214 | 0.074214 | 0.074214 | 0 | 0.011803 | 0.243199 | 2,463 | 82 | 132 | 30.036585 | 0.841202 | 0.065367 | 0 | 0.172414 | 1 | 0 | 0.00873 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.241379 | false | 0 | 0.051724 | 0.034483 | 0.517241 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
15165694e2716645ea22f6406f0f303943c423b8 | 329 | py | Python | src/genie/libs/parser/iosxe/tests/ShowInstallState/cli/equal/golden_output3_expected.py | ykoehler/genieparser | b62cf622c3d8eab77c7b69e932c214ed04a2565a | [
"Apache-2.0"
] | null | null | null | src/genie/libs/parser/iosxe/tests/ShowInstallState/cli/equal/golden_output3_expected.py | ykoehler/genieparser | b62cf622c3d8eab77c7b69e932c214ed04a2565a | [
"Apache-2.0"
] | null | null | null | src/genie/libs/parser/iosxe/tests/ShowInstallState/cli/equal/golden_output3_expected.py | ykoehler/genieparser | b62cf622c3d8eab77c7b69e932c214ed04a2565a | [
"Apache-2.0"
] | null | null | null | expected_output = {
"location": {
"R0 R1": {
"auto_abort_timer": "inactive",
"pkg_state": {
1: {
"filename_version": "17.08.01.0.149429",
"state": "U",
"type": "IMG",
}
},
}
}
} | 23.5 | 60 | 0.31307 | 23 | 329 | 4.26087 | 0.956522 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.104575 | 0.534954 | 329 | 14 | 61 | 23.5 | 0.535948 | 0 | 0 | 0 | 0 | 0 | 0.278788 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
1519b725bc8e51fd74703c95a095ecb5723fb0b3 | 437 | py | Python | tests/creditcrawler_test.py | Mivinci/cqupt-piper | ce76a4334a2d7a7b75750d7bfac9efa747f968c7 | [
"MIT"
] | 3 | 2019-09-08T16:22:30.000Z | 2021-01-23T02:54:10.000Z | tests/creditcrawler_test.py | Mivinci/cqupt-piper | ce76a4334a2d7a7b75750d7bfac9efa747f968c7 | [
"MIT"
] | 1 | 2020-01-11T05:13:43.000Z | 2020-01-11T05:13:43.000Z | tests/creditcrawler_test.py | Mivinci/cqupt-piper | ce76a4334a2d7a7b75750d7bfac9efa747f968c7 | [
"MIT"
] | null | null | null | import requests
from bs4 import BeautifulSoup
from prettytable import PrettyTable
# html = requests.get(
# 'http://jwzx.cqu.pt/student/xkxfTj.php',
# cookies={'PHPSESSID': 'o2r2fpddrj892dp1ntqddcp2hv'}).text
# soup = BeautifulSoup(html, 'html.parser')
# for tr in soup.find('table', {'id': 'AxfTjTable'}).findAll('tr')[1:]:
# tds = tr.findAll('td')
# print(tds[1:5])
table = PrettyTable(['aaa', 'bbb'])
print(table) | 24.277778 | 71 | 0.665904 | 54 | 437 | 5.388889 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.029412 | 0.144165 | 437 | 18 | 72 | 24.277778 | 0.748663 | 0.654462 | 0 | 0 | 0 | 0 | 0.041667 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.6 | 0 | 0.6 | 0.2 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
1519fb893e14d2984bb652c58400576b1b324256 | 1,117 | py | Python | webpack_manifest/templatetags/webpack_manifest_tags.py | temoto/python-webpack-manifest | bb10dbb718f2b41d8356c983b375b064e220d521 | [
"MIT"
] | 55 | 2015-11-02T19:50:41.000Z | 2022-03-06T21:48:36.000Z | webpack_manifest/templatetags/webpack_manifest_tags.py | temoto/python-webpack-manifest | bb10dbb718f2b41d8356c983b375b064e220d521 | [
"MIT"
] | 7 | 2015-09-16T05:24:37.000Z | 2018-07-25T23:10:30.000Z | webpack_manifest/templatetags/webpack_manifest_tags.py | temoto/python-webpack-manifest | bb10dbb718f2b41d8356c983b375b064e220d521 | [
"MIT"
] | 10 | 2016-03-06T16:30:00.000Z | 2020-08-12T01:41:51.000Z | from django import template
from django.conf import settings
from webpack_manifest import webpack_manifest
if not hasattr(settings, 'WEBPACK_MANIFEST'):
raise webpack_manifest.WebpackManifestConfigError('`WEBPACK_MANIFEST` has not been defined in settings')
if 'manifests' not in settings.WEBPACK_MANIFEST:
raise webpack_manifest.WebpackManifestConfigError(
'`WEBPACK_MANIFEST[\'manifests\']` has not been defined in settings'
)
register = template.Library()
@register.simple_tag
def load_webpack_manifest(name):
if name not in settings.WEBPACK_MANIFEST['manifests']:
raise webpack_manifest.WebpackManifestConfigError(
'"%s" has not been defined in `WEBPACK_MANIFEST[\'manifests\']`' % name,
)
conf = settings.WEBPACK_MANIFEST['manifests'][name]
for prop in ('path', 'static_url', 'static_root'):
if prop not in conf:
raise webpack_manifest.WebpackManifestConfigError(
'"%s" has not been defined in `WEBPACK_MANIFEST[\'manifests\'][\'%s\']`' % (prop, name),
)
return webpack_manifest.load(**conf)
| 34.90625 | 108 | 0.706356 | 126 | 1,117 | 6.103175 | 0.261905 | 0.312094 | 0.156047 | 0.239272 | 0.56567 | 0.522757 | 0.452536 | 0.452536 | 0.452536 | 0.23407 | 0 | 0 | 0.188899 | 1,117 | 31 | 109 | 36.032258 | 0.848786 | 0 | 0 | 0.130435 | 0 | 0 | 0.24709 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.043478 | false | 0 | 0.130435 | 0 | 0.217391 | 0 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
151d22605d16726325dce1205b7a8ba505f35329 | 525 | py | Python | python3/hackerrank_leetcode/remove_duplicates_from_sorted_array/test.py | seLain/codesnippets | ae9a1fa05b67f4b3ac1703cc962fcf5f6de1e289 | [
"MIT"
] | null | null | null | python3/hackerrank_leetcode/remove_duplicates_from_sorted_array/test.py | seLain/codesnippets | ae9a1fa05b67f4b3ac1703cc962fcf5f6de1e289 | [
"MIT"
] | null | null | null | python3/hackerrank_leetcode/remove_duplicates_from_sorted_array/test.py | seLain/codesnippets | ae9a1fa05b67f4b3ac1703cc962fcf5f6de1e289 | [
"MIT"
] | null | null | null | import unittest
from main import Solution
class TestSolutionMethods(unittest.TestCase):
solution = Solution()
def test_longestCommonPrefix(self):
# leetcode test
self.assertEqual(self.solution.removeDuplicates([1,1,2]), 2)
# customized test
self.assertEqual(self.solution.removeDuplicates([]), 0)
self.assertEqual(self.solution.removeDuplicates([1]), 1)
self.assertEqual(self.solution.removeDuplicates([1,1,2,3,3]), 3)
if __name__ == '__main__':
unittest.main() | 30.882353 | 72 | 0.693333 | 58 | 525 | 6.12069 | 0.37931 | 0.169014 | 0.214085 | 0.304225 | 0.529577 | 0.529577 | 0.385915 | 0.259155 | 0 | 0 | 0 | 0.030233 | 0.180952 | 525 | 17 | 73 | 30.882353 | 0.795349 | 0.055238 | 0 | 0 | 0 | 0 | 0.016194 | 0 | 0 | 0 | 0 | 0 | 0.363636 | 1 | 0.090909 | false | 0 | 0.181818 | 0 | 0.454545 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
12772bd26a04aaf3f825acfbb2e6f63963b94d81 | 246 | py | Python | 7KYU/word_splitter.py | yaznasivasai/python_codewars | 25493591dde4649dc9c1ec3bece8191a3bed6818 | [
"MIT"
] | 4 | 2021-07-17T22:48:03.000Z | 2022-03-25T14:10:58.000Z | 7KYU/word_splitter.py | yaznasivasai/python_codewars | 25493591dde4649dc9c1ec3bece8191a3bed6818 | [
"MIT"
] | null | null | null | 7KYU/word_splitter.py | yaznasivasai/python_codewars | 25493591dde4649dc9c1ec3bece8191a3bed6818 | [
"MIT"
] | 3 | 2021-06-14T14:18:16.000Z | 2022-03-16T06:02:02.000Z | SEPARATOR: list = [':', ',', '*', ';', '#', '|', '+', '%', '>', '?', '&', '=', '!']
def word_splitter(string: str) -> list:
for i in string:
if i in SEPARATOR:
string = string.replace(i, ' ')
return string.split()
| 35.142857 | 83 | 0.426829 | 23 | 246 | 4.521739 | 0.608696 | 0.057692 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.276423 | 246 | 7 | 84 | 35.142857 | 0.58427 | 0 | 0 | 0 | 0 | 0 | 0.05668 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
128cfb0881a4cb2a09e645ca55b7c92a498aaab7 | 192 | py | Python | verbose.py | lowrey/myjsonstore | 4d47f147fa5d86bea5d4e9b0bcab567583a794af | [
"MIT"
] | 1 | 2018-07-30T14:17:25.000Z | 2018-07-30T14:17:25.000Z | verbose.py | lowrey/myjsonstore | 4d47f147fa5d86bea5d4e9b0bcab567583a794af | [
"MIT"
] | null | null | null | verbose.py | lowrey/myjsonstore | 4d47f147fa5d86bea5d4e9b0bcab567583a794af | [
"MIT"
] | null | null | null | import sys
verbose = False
def set_v(v):
global verbose
verbose = v
def print_v(s):
if verbose:
print(s)
def write_v(s):
if verbose:
sys.stdout.write(s)
| 10.105263 | 27 | 0.583333 | 30 | 192 | 3.633333 | 0.433333 | 0.036697 | 0.073395 | 0.201835 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.317708 | 192 | 18 | 28 | 10.666667 | 0.832061 | 0 | 0 | 0.181818 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.272727 | false | 0 | 0.090909 | 0 | 0.363636 | 0.181818 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
128e873ecfed93a46701bf97c5bfb7c6ee49fa55 | 931 | py | Python | Demo2_PageObjectModel/features/steps/PageObject_Registration.py | imademethink/imademethink_python_selenium_demo | cc364bda00e75eb9115c680ddea5e2fbca1d7acb | [
"BSD-4-Clause"
] | 2 | 2019-04-05T05:09:14.000Z | 2020-07-21T16:06:53.000Z | Demo2_PageObjectModel/features/steps/PageObject_Registration.py | imademethink/Python_Selenium_Demo | cc364bda00e75eb9115c680ddea5e2fbca1d7acb | [
"BSD-4-Clause"
] | 1 | 2020-01-08T08:15:42.000Z | 2020-01-08T08:15:42.000Z | Demo2_PageObjectModel/features/steps/PageObject_Registration.py | imademethink/Python_Selenium_Demo | cc364bda00e75eb9115c680ddea5e2fbca1d7acb | [
"BSD-4-Clause"
] | 4 | 2018-04-13T08:28:53.000Z | 2018-12-30T20:35:19.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
import time
from page_objects import PageObject, PageElement
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.common.by import By
delay_min = 3 # sec
delay_medium = 5 # sec
delay_max = 9 # sec
class RegistrationPage(PageObject):
text_box_first_name = PageElement(id_='customer.firstName')
button_submit_form = PageElement(css="input[value='Register']")
form_submit_result_message = PageElement(id_='customer.lastName.errors')
def method_registration_page_clean_database(self, current_web_driver,):
self.text_box_first_name = 'name_first'
self.button_submit_form.click()
WebDriverWait(current_web_driver,delay_medium).until(expected_conditions.visibility_of(self.form_submit_result_message))
return
| 35.807692 | 128 | 0.784103 | 121 | 931 | 5.743802 | 0.53719 | 0.069065 | 0.120863 | 0.077698 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004914 | 0.125671 | 931 | 25 | 129 | 37.24 | 0.848894 | 0.053706 | 0 | 0 | 0 | 0 | 0.085616 | 0.053653 | 0 | 0 | 0 | 0 | 0 | 1 | 0.055556 | false | 0 | 0.333333 | 0 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
1290db3be5d147e6281013adc1419767bcf94d89 | 1,322 | py | Python | services/web/manage.py | EMBEDDIA/ULR_NER_REST | 520accbced155a43543969f8a0a96a02c0b2d46d | [
"MIT"
] | null | null | null | services/web/manage.py | EMBEDDIA/ULR_NER_REST | 520accbced155a43543969f8a0a96a02c0b2d46d | [
"MIT"
] | 3 | 2020-04-24T11:38:40.000Z | 2021-12-03T09:01:17.000Z | services/web/manage.py | EMBEDDIA/ULR_NER_REST | 520accbced155a43543969f8a0a96a02c0b2d46d | [
"MIT"
] | null | null | null | # Copyright (c) 2020 Michael Herman
# Copyright (c) 2020 Vid Podpečan
# 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 flask.cli import FlaskGroup
from flask_cors import CORS
from project import flask_app
CORS(flask_app)
cli = FlaskGroup(flask_app)
if __name__ == "__main__":
cli()
#flask_app.run(debug=True)
| 45.586207 | 96 | 0.781392 | 204 | 1,322 | 5 | 0.539216 | 0.086275 | 0.027451 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007246 | 0.164902 | 1,322 | 28 | 97 | 47.214286 | 0.916667 | 0.840393 | 0 | 0 | 0 | 0 | 0.041451 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.428571 | 0 | 0.428571 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
1292ffb60fd870f5e14b52506ec687c6761bed39 | 299 | py | Python | utility.py | Ming-desu/POKEMING | 2def3b47e7c08b71885f14944bffe105a63cc12a | [
"MIT"
] | null | null | null | utility.py | Ming-desu/POKEMING | 2def3b47e7c08b71885f14944bffe105a63cc12a | [
"MIT"
] | null | null | null | utility.py | Ming-desu/POKEMING | 2def3b47e7c08b71885f14944bffe105a63cc12a | [
"MIT"
] | null | null | null | # POKEMING - GON'NA CATCH 'EM ALL
# -- A simple hack 'n slash game in console
# -- This class is handles all utility related things
class Utility:
# This allows to see important message of the game
def pause(message):
print(message)
input('Press any key to continue.') | 37.375 | 55 | 0.665552 | 44 | 299 | 4.522727 | 0.818182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.257525 | 299 | 8 | 56 | 37.375 | 0.896396 | 0.58194 | 0 | 0 | 0 | 0 | 0.22807 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 0 | 0.5 | 0.25 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
129d3359e74cfc680cc1a6d1b0edd803c1383270 | 20,753 | py | Python | data-batch-treatment/test_agg_script/locations.py | coder-baymax/taxi-poc-aws | 4be8021873ee6b58b2dba5a5d41df12cdd3b67fc | [
"MIT"
] | null | null | null | data-batch-treatment/test_agg_script/locations.py | coder-baymax/taxi-poc-aws | 4be8021873ee6b58b2dba5a5d41df12cdd3b67fc | [
"MIT"
] | null | null | null | data-batch-treatment/test_agg_script/locations.py | coder-baymax/taxi-poc-aws | 4be8021873ee6b58b2dba5a5d41df12cdd3b67fc | [
"MIT"
] | null | null | null | class Location:
def __init__(self, location_id, borough, zone, lat, lng):
self.location_id = location_id
self.borough = borough
self.zone = zone
self.lat = lat
self.lng = lng
@property
def json(self):
return {
"location_id": self.location_id,
"borough": self.borough,
"zone": self.zone,
"lat": self.lat,
"lng": self.lng
}
Locations = [
Location(1, "EWR", "Newark Airport", 40.6895314, -74.1744624),
Location(2, "Queens", "Jamaica Bay", 40.6056632, -73.8713099),
Location(3, "Bronx", "Allerton/Pelham Gardens", 40.8627726, -73.84343919999999),
Location(4, "Manhattan", "Alphabet City", 40.7258428, -73.9774916),
Location(5, "Staten Island", "Arden Heights", 40.556413, -74.1735044),
Location(6, "Staten Island", "Arrochar/Fort Wadsworth", 40.6012117, -74.0579185),
Location(7, "Queens", "Astoria", 40.7643574, -73.92346189999999),
Location(8, "Queens", "Astoria Park", 40.7785364, -73.92283359999999),
Location(9, "Queens", "Auburndale", 40.7577672, -73.78339609999999),
Location(10, "Queens", "Baisley Park", 40.6737751, -73.786025),
Location(11, "Brooklyn", "Bath Beach", 40.6038852, -74.0062078),
Location(12, "Manhattan", "Battery Park", 40.703141, -74.0159996),
Location(13, "Manhattan", "Battery Park City", 40.7115786, -74.0158441),
Location(14, "Brooklyn", "Bay Ridge", 40.6263732, -74.0298767),
Location(15, "Queens", "Bay Terrace/Fort Totten", 40.7920899, -73.7760996),
Location(16, "Queens", "Bayside", 40.7585569, -73.7654367),
Location(17, "Brooklyn", "Bedford", 40.6872176, -73.9417735),
Location(18, "Bronx", "Bedford Park", 40.8700999, -73.8856912),
Location(19, "Queens", "Bellerose", 40.7361769, -73.7137365),
Location(20, "Bronx", "Belmont", 40.8534507, -73.88936819999999),
Location(21, "Brooklyn", "Bensonhurst East", 40.6139307, -73.9921833),
Location(22, "Brooklyn", "Bensonhurst West", 40.6139307, -73.9921833),
Location(23, "Staten Island", "Bloomfield/Emerson Hill", 40.6074525, -74.0963115),
Location(24, "Manhattan", "Bloomingdale", 40.7988958, -73.9697795),
Location(25, "Brooklyn", "Boerum Hill", 40.6848689, -73.9844722),
Location(26, "Brooklyn", "Borough Park", 40.6350319, -73.9921028),
Location(27, "Queens", "Breezy Point/Fort Tilden/Riis Beach", 40.5597687, -73.88761509999999),
Location(28, "Queens", "Briarwood/Jamaica Hills", 40.7109315, -73.81356099999999),
Location(29, "Brooklyn", "Brighton Beach", 40.5780706, -73.9596565),
Location(30, "Queens", "Broad Channel", 40.6158335, -73.8213213),
Location(31, "Bronx", "Bronx Park", 40.8608544, -73.8706278),
Location(32, "Bronx", "Bronxdale", 40.8474697, -73.8599132),
Location(33, "Brooklyn", "Brooklyn Heights", 40.6959294, -73.9955523),
Location(34, "Brooklyn", "Brooklyn Navy Yard", 40.7025634, -73.9697795),
Location(35, "Brooklyn", "Brownsville", 40.665214, -73.9125304),
Location(36, "Brooklyn", "Bushwick North", 40.6957755, -73.9170604),
Location(37, "Brooklyn", "Bushwick South", 40.7043655, -73.9383476),
Location(38, "Queens", "Cambria Heights", 40.692158, -73.7330753),
Location(39, "Brooklyn", "Canarsie", 40.6402325, -73.9060579),
Location(40, "Brooklyn", "Carroll Gardens", 40.6795331, -73.9991637),
Location(41, "Manhattan", "Central Harlem", 40.8089419, -73.9482305),
Location(42, "Manhattan", "Central Harlem North", 40.8142585, -73.9426617),
Location(43, "Manhattan", "Central Park", 40.7812199, -73.9665138),
Location(44, "Staten Island", "Charleston/Tottenville", 40.5083408, -74.23554039999999),
Location(45, "Manhattan", "Chinatown", 40.7157509, -73.9970307),
Location(46, "Bronx", "City Island", 40.8468202, -73.7874983),
Location(47, "Bronx", "Claremont/Bathgate", 40.84128339999999, -73.9001573),
Location(48, "Manhattan", "Clinton East", 40.7637581, -73.9918181),
Location(49, "Brooklyn", "Clinton Hill", 40.6896834, -73.9661144),
Location(50, "Manhattan", "Clinton West", 40.7628785, -73.9940134),
Location(51, "Bronx", "Co-Op City", 40.8738889, -73.82944440000001),
Location(52, "Brooklyn", "Cobble Hill", 40.686536, -73.9962255),
Location(53, "Queens", "College Point", 40.786395, -73.8389657),
Location(54, "Brooklyn", "Columbia Street", 40.6775239, -74.00634409999999),
Location(55, "Brooklyn", "Coney Island", 40.5755438, -73.9707016),
Location(56, "Queens", "Corona", 40.7449859, -73.8642613),
Location(57, "Queens", "Corona", 40.7449859, -73.8642613),
Location(58, "Bronx", "Country Club", 40.8391667, -73.8197222),
Location(59, "Bronx", "Crotona Park", 40.8400367, -73.8953489),
Location(60, "Bronx", "Crotona Park East", 40.8365344, -73.8933509),
Location(61, "Brooklyn", "Crown Heights North", 40.6694022, -73.9422324),
Location(62, "Brooklyn", "Crown Heights South", 40.6694022, -73.9422324),
Location(63, "Brooklyn", "Cypress Hills", 40.6836873, -73.87963309999999),
Location(64, "Queens", "Douglaston", 40.76401509999999, -73.7433727),
Location(65, "Brooklyn", "Downtown Brooklyn/MetroTech", 40.6930987, -73.98566339999999),
Location(66, "Brooklyn", "DUMBO/Vinegar Hill", 40.70371859999999, -73.98226830000002),
Location(67, "Brooklyn", "Dyker Heights", 40.6214932, -74.00958399999999),
Location(68, "Manhattan", "East Chelsea", 40.7465004, -74.00137370000002),
Location(69, "Bronx", "East Concourse/Concourse Village", 40.8255863, -73.9184388),
Location(70, "Queens", "East Elmhurst", 40.7737505, -73.8713099),
Location(71, "Brooklyn", "East Flatbush/Farragut", 40.63751329999999, -73.9280797),
Location(72, "Brooklyn", "East Flatbush/Remsen Village", 40.6511399, -73.9181602),
Location(73, "Queens", "East Flushing", 40.7540534, -73.8086418),
Location(74, "Manhattan", "East Harlem North", 40.7957399, -73.93892129999999),
Location(75, "Manhattan", "East Harlem South", 40.7957399, -73.93892129999999),
Location(76, "Brooklyn", "East New York", 40.6590529, -73.8759245),
Location(77, "Brooklyn", "East New York/Pennsylvania Avenue", 40.65845729999999, -73.8904498),
Location(78, "Bronx", "East Tremont", 40.8453781, -73.8909693),
Location(79, "Manhattan", "East Village", 40.7264773, -73.98153370000001),
Location(80, "Brooklyn", "East Williamsburg", 40.7141953, -73.9316461),
Location(81, "Bronx", "Eastchester", 40.8859837, -73.82794710000002),
Location(82, "Queens", "Elmhurst", 40.737975, -73.8801301),
Location(83, "Queens", "Elmhurst/Maspeth", 40.7294018, -73.9065883),
Location(84, "Staten Island", "Eltingville/Annadale/Prince's Bay", 40.52899439999999, -74.197644),
Location(85, "Brooklyn", "Erasmus", 40.649649, -73.95287379999999),
Location(86, "Queens", "Far Rockaway", 40.5998931, -73.74484369999999),
Location(87, "Manhattan", "Financial District North", 40.7077143, -74.00827869999999),
Location(88, "Manhattan", "Financial District South", 40.705123, -74.0049259),
Location(89, "Brooklyn", "Flatbush/Ditmas Park", 40.6414876, -73.9593998),
Location(90, "Manhattan", "Flatiron", 40.740083, -73.9903489),
Location(91, "Brooklyn", "Flatlands", 40.6232714, -73.9321664),
Location(92, "Queens", "Flushing", 40.7674987, -73.833079),
Location(93, "Queens", "Flushing Meadows-Corona Park", 40.7400275, -73.8406953),
Location(94, "Bronx", "Fordham South", 40.8592667, -73.8984694),
Location(95, "Queens", "Forest Hills", 40.718106, -73.8448469),
Location(96, "Queens", "Forest Park/Highland Park", 40.6960418, -73.8663024),
Location(97, "Brooklyn", "Fort Greene", 40.6920638, -73.97418739999999),
Location(98, "Queens", "Fresh Meadows", 40.7335179, -73.7801447),
Location(99, "Staten Island", "Freshkills Park", 40.5772365, -74.1858183),
Location(100, "Manhattan", "Garment District", 40.7547072, -73.9916342),
Location(101, "Queens", "Glen Oaks", 40.7471504, -73.7118223),
Location(102, "Queens", "Glendale", 40.7016662, -73.8842219),
Location(103, "Manhattan", "Governor's Island/Ellis Island/Liberty Island", 40.6892494, -74.04450039999999),
Location(104, "Manhattan", "Governor's Island/Ellis Island/Liberty Island", 40.6892494, -74.04450039999999),
Location(105, "Manhattan", "Governor's Island/Ellis Island/Liberty Island", 40.6892494, -74.04450039999999),
Location(106, "Brooklyn", "Gowanus", 40.6751161, -73.9879753),
Location(107, "Manhattan", "Gramercy", 40.7367783, -73.9844722),
Location(108, "Brooklyn", "Gravesend", 40.5918636, -73.9768653),
Location(109, "Staten Island", "Great Kills", 40.5543273, -74.156292),
Location(110, "Staten Island", "Great Kills Park", 40.5492367, -74.1238486),
Location(111, "Brooklyn", "Green-Wood Cemetery", 40.6579777, -73.9940634),
Location(112, "Brooklyn", "Greenpoint", 40.7304701, -73.95150319999999),
Location(113, "Manhattan", "Greenwich Village North", 40.7335719, -74.0027418),
Location(114, "Manhattan", "Greenwich Village South", 40.7335719, -74.0027418),
Location(115, "Staten Island", "Grymes Hill/Clifton", 40.6189726, -74.0784785),
Location(116, "Manhattan", "Hamilton Heights", 40.8252793, -73.94761390000001),
Location(117, "Queens", "Hammels/Arverne", 40.5880813, -73.81199289999999),
Location(118, "Staten Island", "Heartland Village/Todt Hill", 40.5975007, -74.10189749999999),
Location(119, "Bronx", "Highbridge", 40.836916, -73.9271294),
Location(120, "Manhattan", "Highbridge Park", 40.8537599, -73.9257492),
Location(121, "Queens", "Hillcrest/Pomonok", 40.732341, -73.81077239999999),
Location(122, "Queens", "Hollis", 40.7112203, -73.762495),
Location(123, "Brooklyn", "Homecrest", 40.6004787, -73.9565551),
Location(124, "Queens", "Howard Beach", 40.6571222, -73.8429989),
Location(125, "Manhattan", "Hudson Sq", 40.7265834, -74.0074731),
Location(126, "Bronx", "Hunts Point", 40.8094385, -73.8803315),
Location(127, "Manhattan", "Inwood", 40.8677145, -73.9212019),
Location(128, "Manhattan", "Inwood Hill Park", 40.8722007, -73.9255549),
Location(129, "Queens", "Jackson Heights", 40.7556818, -73.8830701),
Location(130, "Queens", "Jamaica", 40.702677, -73.7889689),
Location(131, "Queens", "Jamaica Estates", 40.7179512, -73.783822),
Location(132, "Queens", "JFK Airport", 40.6413111, -73.77813909999999),
Location(133, "Brooklyn", "Kensington", 40.63852019999999, -73.97318729999999),
Location(134, "Queens", "Kew Gardens", 40.705695, -73.8272029),
Location(135, "Queens", "Kew Gardens Hills", 40.724707, -73.8207618),
Location(136, "Bronx", "Kingsbridge Heights", 40.8711235, -73.8976328),
Location(137, "Manhattan", "Kips Bay", 40.74232920000001, -73.9800645),
Location(138, "Queens", "LaGuardia Airport", 40.7769271, -73.8739659),
Location(139, "Queens", "Laurelton", 40.67764, -73.7447853),
Location(140, "Manhattan", "Lenox Hill East", 40.7662315, -73.9602312),
Location(141, "Manhattan", "Lenox Hill West", 40.7662315, -73.9602312),
Location(142, "Manhattan", "Lincoln Square East", 40.7741769, -73.98491179999999),
Location(143, "Manhattan", "Lincoln Square West", 40.7741769, -73.98491179999999),
Location(144, "Manhattan", "Little Italy/NoLiTa", 40.7230413, -73.99486069999999),
Location(145, "Queens", "Long Island City/Hunters Point", 40.7485587, -73.94964639999999),
Location(146, "Queens", "Long Island City/Queens Plaza", 40.7509846, -73.9402762),
Location(147, "Bronx", "Longwood", 40.8248438, -73.8915875),
Location(148, "Manhattan", "Lower East Side", 40.715033, -73.9842724),
Location(149, "Brooklyn", "Madison", 40.60688529999999, -73.947958),
Location(150, "Brooklyn", "Manhattan Beach", 40.57815799999999, -73.93892129999999),
Location(151, "Manhattan", "Manhattan Valley", 40.7966989, -73.9684247),
Location(152, "Manhattan", "Manhattanville", 40.8169443, -73.9558333),
Location(153, "Manhattan", "Marble Hill", 40.8761173, -73.9102628),
Location(154, "Brooklyn", "Marine Park/Floyd Bennett Field", 40.58816030000001, -73.8969745),
Location(155, "Brooklyn", "Marine Park/Mill Basin", 40.6055157, -73.9348698),
Location(156, "Staten Island", "Mariners Harbor", 40.63677010000001, -74.1587547),
Location(157, "Queens", "Maspeth", 40.7294018, -73.9065883),
Location(158, "Manhattan", "Meatpacking/West Village West", 40.7342331, -74.0100622),
Location(159, "Bronx", "Melrose South", 40.824545, -73.9104143),
Location(160, "Queens", "Middle Village", 40.717372, -73.87425),
Location(161, "Manhattan", "Midtown Center", 40.7314658, -73.9970956),
Location(162, "Manhattan", "Midtown East", 40.7571432, -73.9718815),
Location(163, "Manhattan", "Midtown North", 40.7649516, -73.9851039),
Location(164, "Manhattan", "Midtown South", 40.7521795, -73.9875438),
Location(165, "Brooklyn", "Midwood", 40.6204388, -73.95997779999999),
Location(166, "Manhattan", "Morningside Heights", 40.8105443, -73.9620581),
Location(167, "Bronx", "Morrisania/Melrose", 40.824545, -73.9104143),
Location(168, "Bronx", "Mott Haven/Port Morris", 40.8022025, -73.9166051),
Location(169, "Bronx", "Mount Hope", 40.8488863, -73.9051185),
Location(170, "Manhattan", "Murray Hill", 40.7478792, -73.9756567),
Location(171, "Queens", "Murray Hill-Queens", 40.7634996, -73.8073261),
Location(172, "Staten Island", "New Dorp/Midland Beach", 40.5739937, -74.1159755),
Location(173, "Queens", "North Corona", 40.7543725, -73.8669188),
Location(174, "Bronx", "Norwood", 40.8810341, -73.878486),
Location(175, "Queens", "Oakland Gardens", 40.7408584, -73.758241),
Location(176, "Staten Island", "Oakwood", 40.563994, -74.1159754),
Location(177, "Brooklyn", "Ocean Hill", 40.6782737, -73.9108212),
Location(178, "Brooklyn", "Ocean Parkway South", 40.61287799999999, -73.96838620000001),
Location(179, "Queens", "Old Astoria", 40.7643574, -73.92346189999999),
Location(180, "Queens", "Ozone Park", 40.6794072, -73.8507279),
Location(181, "Brooklyn", "Park Slope", 40.6710672, -73.98142279999999),
Location(182, "Bronx", "Parkchester", 40.8382522, -73.8566087),
Location(183, "Bronx", "Pelham Bay", 40.8505556, -73.83333329999999),
Location(184, "Bronx", "Pelham Bay Park", 40.8670144, -73.81006339999999),
Location(185, "Bronx", "Pelham Parkway", 40.8553279, -73.8639594),
Location(186, "Manhattan", "Penn Station/Madison Sq West", 40.7505045, -73.9934387),
Location(187, "Staten Island", "Port Richmond", 40.63549140000001, -74.1254641),
Location(188, "Brooklyn", "Prospect-Lefferts Gardens", 40.6592355, -73.9533895),
Location(189, "Brooklyn", "Prospect Heights", 40.6774196, -73.9668408),
Location(190, "Brooklyn", "Prospect Park", 40.6602037, -73.9689558),
Location(191, "Queens", "Queens Village", 40.7156628, -73.7419017),
Location(192, "Queens", "Queensboro Hill", 40.7429383, -73.8251741),
Location(193, "Queens", "Queensbridge/Ravenswood", 40.7556711, -73.9456723),
Location(194, "Manhattan", "Randalls Island", 40.7932271, -73.92128579999999),
Location(195, "Brooklyn", "Red Hook", 40.6733676, -74.00831889999999),
Location(196, "Queens", "Rego Park", 40.72557219999999, -73.8624893),
Location(197, "Queens", "Richmond Hill", 40.6958108, -73.8272029),
Location(198, "Queens", "Ridgewood", 40.7043986, -73.9018292),
Location(199, "Bronx", "Rikers Island", 40.79312770000001, -73.88601),
Location(200, "Bronx", "Riverdale/North Riverdale/Fieldston", 40.89961830000001, -73.9088276),
Location(201, "Queens", "Rockaway Park", 40.57978629999999, -73.8372237),
Location(202, "Manhattan", "Roosevelt Island", 40.76050310000001, -73.9509934),
Location(203, "Queens", "Rosedale", 40.6584068, -73.7389596),
Location(204, "Staten Island", "Rossville/Woodrow", 40.5434385, -74.19764409999999),
Location(205, "Queens", "Saint Albans", 40.6895283, -73.76436880000001),
Location(206, "Staten Island", "Saint George/New Brighton", 40.6404369, -74.090226),
Location(207, "Queens", "Saint Michaels Cemetery/Woodside", 40.7646761, -73.89850419999999),
Location(208, "Bronx", "Schuylerville/Edgewater Park", 40.8235967, -73.81029269999999),
Location(209, "Manhattan", "Seaport", 40.70722629999999, -74.0027431),
Location(210, "Brooklyn", "Sheepshead Bay", 40.5953955, -73.94575379999999),
Location(211, "Manhattan", "SoHo", 40.723301, -74.0029883),
Location(212, "Bronx", "Soundview/Bruckner", 40.8247566, -73.8710929),
Location(213, "Bronx", "Soundview/Castle Hill", 40.8176831, -73.8507279),
Location(214, "Staten Island", "South Beach/Dongan Hills", 40.5903824, -74.06680759999999),
Location(215, "Queens", "South Jamaica", 40.6808594, -73.7919103),
Location(216, "Queens", "South Ozone Park", 40.6764003, -73.8124984),
Location(217, "Brooklyn", "South Williamsburg", 40.7043921, -73.9565551),
Location(218, "Queens", "Springfield Gardens North", 40.6715916, -73.779798),
Location(219, "Queens", "Springfield Gardens South", 40.6715916, -73.779798),
Location(220, "Bronx", "Spuyten Duyvil/Kingsbridge", 40.8833912, -73.9051185),
Location(221, "Staten Island", "Stapleton", 40.6264929, -74.07764139999999),
Location(222, "Brooklyn", "Starrett City", 40.6484272, -73.88236119999999),
Location(223, "Queens", "Steinway", 40.7745459, -73.9037477),
Location(224, "Manhattan", "Stuy Town/Peter Cooper Village", 40.7316903, -73.9778494),
Location(225, "Brooklyn", "Stuyvesant Heights", 40.6824166, -73.9319933),
Location(226, "Queens", "Sunnyside", 40.7432759, -73.9196324),
Location(227, "Brooklyn", "Sunset Park East", 40.65272, -74.00933479999999),
Location(228, "Brooklyn", "Sunset Park West", 40.65272, -74.00933479999999),
Location(229, "Manhattan", "Sutton Place/Turtle Bay North", 40.7576281, -73.961698),
Location(230, "Manhattan", "Times Sq/Theatre District", 40.759011, -73.9844722),
Location(231, "Manhattan", "TriBeCa/Civic Center", 40.71625299999999, -74.0122396),
Location(232, "Manhattan", "Two Bridges/Seward Park", 40.7149056, -73.98924699999999),
Location(233, "Manhattan", "UN/Turtle Bay South", 40.7571432, -73.9718815),
Location(234, "Manhattan", "Union Sq", 40.7358633, -73.9910835),
Location(235, "Bronx", "University Heights/Morris Heights", 40.8540855, -73.9198498),
Location(236, "Manhattan", "Upper East Side North", 40.7600931, -73.9598414),
Location(237, "Manhattan", "Upper East Side South", 40.7735649, -73.9565551),
Location(238, "Manhattan", "Upper West Side North", 40.7870106, -73.9753676),
Location(239, "Manhattan", "Upper West Side South", 40.7870106, -73.9753676),
Location(240, "Bronx", "Van Cortlandt Park", 40.8972233, -73.8860668),
Location(241, "Bronx", "Van Cortlandt Village", 40.8837203, -73.89313899999999),
Location(242, "Bronx", "Van Nest/Morris Park", 40.8459682, -73.8625946),
Location(243, "Manhattan", "Washington Heights North", 40.852476, -73.9342996),
Location(244, "Manhattan", "Washington Heights South", 40.8417082, -73.9393554),
Location(245, "Staten Island", "West Brighton", 40.6270298, -74.10931409999999),
Location(246, "Manhattan", "West Chelsea/Hudson Yards", 40.7542535, -74.0023331),
Location(247, "Bronx", "West Concourse", 40.8316761, -73.9227554),
Location(248, "Bronx", "West Farms/Bronx River", 40.8430609, -73.8816001),
Location(249, "Manhattan", "West Village", 40.73468, -74.0047554),
Location(250, "Bronx", "Westchester Village/Unionport", 40.8340447, -73.8531349),
Location(251, "Staten Island", "Westerleigh", 40.616296, -74.1386767),
Location(252, "Queens", "Whitestone", 40.7920449, -73.8095574),
Location(253, "Queens", "Willets Point", 40.7606911, -73.840436),
Location(254, "Bronx", "Williamsbridge/Olinville", 40.8787602, -73.85283559999999),
Location(255, "Brooklyn", "Williamsburg (North Side)", 40.71492, -73.9528472),
Location(256, "Brooklyn", "Williamsburg (South Side)", 40.70824229999999, -73.9571487),
Location(257, "Brooklyn", "Windsor Terrace", 40.6539346, -73.9756567),
Location(258, "Queens", "Woodhaven", 40.6901366, -73.8566087),
Location(259, "Bronx", "Woodlawn/Wakefield", 40.8955885, -73.8627133),
Location(260, "Queens", "Woodside", 40.7532952, -73.9068973),
Location(261, "Manhattan", "World Trade Center", 40.7118011, -74.0131196),
Location(262, "Manhattan", "Yorkville East", 40.7762231, -73.94920789999999),
Location(263, "Manhattan", "Yorkville West", 40.7762231, -73.94920789999999)
]
| 72.562937 | 112 | 0.679131 | 2,534 | 20,753 | 5.558406 | 0.416732 | 0.01065 | 0.002982 | 0.005112 | 0.076038 | 0.033014 | 0.022648 | 0.017252 | 0.017252 | 0.017252 | 0 | 0.332328 | 0.137281 | 20,753 | 285 | 113 | 72.817544 | 0.454368 | 0 | 0 | 0 | 0 | 0 | 0.299186 | 0.00583 | 0 | 0 | 0 | 0 | 0 | 1 | 0.007117 | false | 0 | 0 | 0.003559 | 0.014235 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
129d53076c9002e63bb6e233e94f66b83a1c9e37 | 114 | py | Python | main.py | viniciuslimafernandes/interpolation | 1aff08cba6026143fd267a0c648bad8975ae5d74 | [
"MIT"
] | null | null | null | main.py | viniciuslimafernandes/interpolation | 1aff08cba6026143fd267a0c648bad8975ae5d74 | [
"MIT"
] | null | null | null | main.py | viniciuslimafernandes/interpolation | 1aff08cba6026143fd267a0c648bad8975ae5d74 | [
"MIT"
] | null | null | null | import math
from utils import *
def main():
showHome()
option = chooseOption()
handleOption(option)
main() | 12.666667 | 25 | 0.701754 | 13 | 114 | 6.153846 | 0.769231 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.184211 | 114 | 9 | 26 | 12.666667 | 0.860215 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.285714 | 0 | 0.428571 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
12a1ccdc2c994161fe55e1738031ece8631b2305 | 693 | py | Python | tests/bugs/test-200908181430.py | eLBati/pyxb | 14737c23a125fd12c954823ad64fc4497816fae3 | [
"Apache-2.0"
] | 123 | 2015-01-12T06:43:22.000Z | 2022-03-20T18:06:46.000Z | tests/bugs/test-200908181430.py | eLBati/pyxb | 14737c23a125fd12c954823ad64fc4497816fae3 | [
"Apache-2.0"
] | 103 | 2015-01-08T18:35:57.000Z | 2022-01-18T01:44:14.000Z | tests/bugs/test-200908181430.py | eLBati/pyxb | 14737c23a125fd12c954823ad64fc4497816fae3 | [
"Apache-2.0"
] | 54 | 2015-02-15T17:12:00.000Z | 2022-03-07T23:02:32.000Z | # -*- coding: utf-8 -*-
import logging
if __name__ == '__main__':
logging.basicConfig()
_log = logging.getLogger(__name__)
import pyxb.binding.generate
import pyxb.binding.datatypes as xs
import pyxb.binding.basis
import pyxb.utils.domutils
import os.path
xsd='''<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:simpleType name="foo"/>
</xs:schema>'''
from pyxb.exceptions_ import *
import unittest
class TestTrac_200908181430 (unittest.TestCase):
def testParsing (self):
self.assertRaises(pyxb.SchemaValidationError, pyxb.binding.generate.GeneratePython, schema_text=xsd)
if __name__ == '__main__':
unittest.main()
| 25.666667 | 108 | 0.735931 | 89 | 693 | 5.460674 | 0.58427 | 0.082305 | 0.104938 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.03437 | 0.118326 | 693 | 26 | 109 | 26.653846 | 0.761047 | 0.030303 | 0 | 0.1 | 1 | 0 | 0.228358 | 0 | 0 | 0 | 0 | 0 | 0.05 | 1 | 0.05 | false | 0 | 0.4 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
12a82679ea427e2384e89df55cbadd443f41af9e | 4,739 | py | Python | src/data/domain.py | AlexMoreo/pydci | 44f8fe1ce95da45709061cbe19fa6f462c1f2164 | [
"BSD-3-Clause"
] | 7 | 2018-10-21T17:34:08.000Z | 2021-05-17T11:37:56.000Z | src/data/domain.py | AlexMoreo/pydci | 44f8fe1ce95da45709061cbe19fa6f462c1f2164 | [
"BSD-3-Clause"
] | null | null | null | src/data/domain.py | AlexMoreo/pydci | 44f8fe1ce95da45709061cbe19fa6f462c1f2164 | [
"BSD-3-Clause"
] | 4 | 2018-11-22T10:30:07.000Z | 2021-03-20T10:07:57.000Z | import pickle
from scipy.sparse import lil_matrix
import numpy as np
class Domain:
"""
Defines a domain, composed by a labelled set and a unlabeled set. All sets share a common vocabulary.
The domain is also characterized by its name and language.
"""
def __init__(self, X, y, U, vocabulary, domain, language='en'):
"""
:param X: the document collection
:param y: the document labels
:param U: the unlabeled collection
:param vocabulary: the feature space of X and U
:param domain: a descriptive name of the domain
:param language: a descriptive name of the language
"""
self.X = X
self.y = y
self.U = U
self.V=vocabulary if isinstance(vocabulary, Vocabulary) else Vocabulary(vocabulary)
self.domain = domain
self.language = language
def name(self):
return '{}_{}'.format(self.language,self.domain)
def dump(self, path):
pickle.dump(self, open(path, 'wb'), pickle.HIGHEST_PROTOCOL)
def show(self):
print('domain: '+self.domain)
print('language: ' + self.language)
print('|V|={}'.format(len(self.V)))
print('|X|={} (prev={})'.format(self.X.shape[0], self.y.mean()))
print('|U|={}'.format(self.U.shape[0]))
@classmethod
def load(cls, path):
domain = pickle.load(open(path, 'rb'))
assert isinstance(domain, Domain), 'wrong pickle'
return domain
class Vocabulary:
"""
A bidirectional dictionary words->id and id->words
"""
def __init__(self, word2idx_dict):
self._word2idx = word2idx_dict
self._idx2word = {idx:word for word, idx in word2idx_dict.items()}
def word2idx(self, word):
if word in self._word2idx:
return self._word2idx[word]
return None
def idx2word(self, idx):
if idx in self._idx2word:
return self._idx2word[idx]
return None
def __len__(self):
return len(self._word2idx)
def term_set(self):
return set(self._word2idx.keys())
def index_list(self):
return sorted(self._idx2word.keys())
def __contains__(self, word):
return word in self._word2idx
class WordOracle:
"""
An oracle that, given a source term returns the target translation, or viceversa.
As defined by Prettenhofer, Peter, and Benno Stein. "Cross-language text classification using structural
correspondence learning." Proceedings of the 48th annual meeting of the association for computational linguistics.
Association for Computational Linguistics, 2010.
"""
def __init__(self, dictionary, source, target, analyzer=None):
self.source = source
self.target = target
self.s2t_dict = {_preproc(analyzer, s) : _preproc(analyzer, t) for s, t in dictionary.items()} if analyzer else dictionary
self.t2s_dict = {v:k for k,v in dictionary.items()}
def source2target(self, word):
if word in self.s2t_dict.keys():
return self.s2t_dict[word]
return None
def target2source(self, word):
if word in self.t2s_dict.keys():
return self.t2s_dict[word]
return None
def _preproc(analyzer, str):
return analyzer(str)[0] if analyzer(str) else 'null__'
def pack_domains(source, target, pivots_source, pivots_target):
dX = {source.name(): source.X, target.name(): target.X}
dU = {source.name(): source.U, target.name(): target.U}
dP = {source.name(): pivots_source, target.name(): pivots_target}
dV = {source.name(): source.V, target.name(): target.V}
return dX, dU, dP, dV
def unify_feat_space(source, target):
"""
Given a source and a target domain, returns two new versions of them in which the feature spaces are common, by
trivially juxtapossing the two vocabularies
:param source: the source domain
:param target: the target domain
:return: a new version of the source and the target domains where the feature space is common
"""
word_set = source.V.term_set().union(target.V.term_set())
word2idx = {w:i for i,w in enumerate(word_set)}
Vshared = Vocabulary(word2idx)
def reindexDomain(domain, sharedV):
V = domain.V
nD=domain.X.shape[0]
nF=len(sharedV)
newX = lil_matrix((nD,nF))
domainIndexes = np.array(V.index_list())
sharedIndexes = np.array([sharedV.word2idx(w) for w in [V.idx2word(i) for i in domainIndexes]])
newX[:,sharedIndexes]=domain.X[:,domainIndexes]
return Domain(newX.tocsr(),domain.y,None,sharedV,domain.domain+'_shared',domain.language)
return reindexDomain(source, Vshared), reindexDomain(target, Vshared) | 34.845588 | 130 | 0.650559 | 628 | 4,739 | 4.808917 | 0.269108 | 0.027815 | 0.013245 | 0.013907 | 0.047682 | 0.019868 | 0 | 0 | 0 | 0 | 0 | 0.010255 | 0.238658 | 4,739 | 136 | 131 | 34.845588 | 0.826774 | 0.237392 | 0 | 0.04878 | 0 | 0 | 0.023706 | 0 | 0 | 0 | 0 | 0 | 0.012195 | 1 | 0.231707 | false | 0 | 0.036585 | 0.073171 | 0.52439 | 0.060976 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
12aa4d4698103b11546cfe0e6f724650c7f1a730 | 3,165 | py | Python | hamal/hamal/conf/identity.py | JackDan9/hamal | 965be9db066209300c52f0cf17d251290d8901b7 | [
"MIT"
] | 3 | 2020-06-12T13:03:46.000Z | 2020-08-06T11:25:46.000Z | hamal/hamal/conf/identity.py | JackDan9/hamal | 965be9db066209300c52f0cf17d251290d8901b7 | [
"MIT"
] | null | null | null | hamal/hamal/conf/identity.py | JackDan9/hamal | 965be9db066209300c52f0cf17d251290d8901b7 | [
"MIT"
] | null | null | null | # 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 oslo_config import cfg
import passlib.utils
from hamal.conf import utils
max_password_length = cfg.IntOpt(
'max_password_length',
default=4096,
max=passlib.utils.MAX_PASSWORD_SIZE,
help=utils.fmt("""
Maximum allowed length for user passwords. Decrease this value to improve
performance. Changing this value does not effect existing passwords.
"""))
password_hash_algorithm = cfg.StrOpt(
'password_hash_algorithm',
choices=['bcrypt', 'scrypt', 'pbkdf2_sha512'],
default='bcrypt',
help=utils.fmt("""
The password hashing algorithm to use for passwords stored within hamal.
"""))
password_hash_rounds = cfg.IntOpt(
'password_hash_rounds',
help=utils.fmt("""
This option represents a trade off between security and performance. Higher
values lead to slower performance, but higher security. Changing this option
will only affect newly created passwords as existing password hashes already
have a fixed number of rounds applied, so it is safe to tune this option in a
running cluster.
The default for bcrypt is 12, must be between 4 and 31, inclusive.
The default for scrypt is 16, must be within `range(1,32)`.
The default for pbkdf_sha512 is 60000, must be within `range(1,1<32)`
WARNING: If using scrypt, increasing this value increases BOTH time AND
memory requirements to hash a password.
"""))
salt_bytesize = cfg.IntOpt(
'salt_bytesize',
min=0,
max=96,
help=utils.fmt("""
Number of bytes to use in scrypt and pbkfd2_sha512 hashing salt.
Default for scrypt is 16 bytes.
Default for pbkfd2_sha512 is 16 bytes.
Limited to a maximum of 96 bytes due to the size of the column used to store
password hashes.
"""))
scrypt_block_size = cfg.IntOpt(
'scrypt_block_size',
help=utils.fmt("""
Optional block size to pass to scrypt hash function (the `r` parameter).
Useful for tuning scrypt to optimal performance for your CPU architecture.
This option is only used when the `password_hash_algorithm` option is set
to `scrypt`. Defaults to 8.
"""))
scrypt_paralellism = cfg.IntOpt(
'scrypt_parallelism',
help=utils.fmt("""
Optional parallelism to pass to scrypt hash function (the `p` parameter).
This option is only used when the `password_hash_algorithm` option is set
to `scrypt`. Defaults to 1.
"""))
GROUP_NAME = __name__.split('.')[-1]
ALL_OPTS = [
max_password_length,
password_hash_algorithm,
password_hash_rounds,
scrypt_block_size,
scrypt_paralellism,
salt_bytesize
]
def register_opts(conf):
conf.register_opts(ALL_OPTS, group=GROUP_NAME)
def list_opts():
return {GROUP_NAME: ALL_OPTS} | 30.728155 | 77 | 0.749447 | 476 | 3,165 | 4.869748 | 0.397059 | 0.041415 | 0.031061 | 0.013805 | 0.124245 | 0.091458 | 0.091458 | 0.066437 | 0.066437 | 0.066437 | 0 | 0.020571 | 0.170616 | 3,165 | 103 | 78 | 30.728155 | 0.862476 | 0.164929 | 0 | 0.197183 | 0 | 0 | 0.632599 | 0.027736 | 0 | 0 | 0 | 0 | 0 | 1 | 0.028169 | false | 0.295775 | 0.042254 | 0.014085 | 0.084507 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
12d4213a1f0e884d767b82004cfca76be19c9038 | 1,375 | py | Python | bga/forms.py | KarmaPoliceT2/bga | f7708ddae72bc83d68a2294d8f1b600345ebec30 | [
"MIT"
] | null | null | null | bga/forms.py | KarmaPoliceT2/bga | f7708ddae72bc83d68a2294d8f1b600345ebec30 | [
"MIT"
] | 3 | 2019-12-26T16:57:34.000Z | 2021-06-01T23:08:35.000Z | bga/forms.py | KarmaPoliceT2/bga | f7708ddae72bc83d68a2294d8f1b600345ebec30 | [
"MIT"
] | null | null | null | from wtforms import Form, StringField, PasswordField, DecimalField, IntegerField, SelectField, validators
from wtforms.fields.html5 import DateField
def strip_filter(x): return x.strip() if x else None
class RegistrationForm(Form):
username = StringField('Username', [validators.Length(
min=1, max=255)], filters=[strip_filter])
password = PasswordField('Password', [validators.Length(min=3, max=255)])
class CreateCourseForm(Form):
coursename = StringField(
'Course Name', [validators.Length(min=1, max=255)], filters=[strip_filter])
courselocation = StringField(
'Course Location', [validators.Length(min=1, max=255)], filters=[strip_filter])
rating = DecimalField('Rating', [validators.NumberRange(
min=50, max=150, message="Must Be Between 50-150")], places=2)
slope = IntegerField('Slope', [validators.NumberRange(
min=55, max=155, message="Must Be Between 55-155")])
courseimage = StringField('Course Image URL', [validators.Length(
min=1, max=255), validators.URL(message="Must Be a URL")], filters=[strip_filter])
class CreateScoreForm(Form):
course = SelectField('Course Name', choices=[('oops', 'oops')])
rounddate = DateField('Round Date', format='%Y-%m-%d')
score = IntegerField('Round Score')
attest = SelectField('Attesting Golfer', choices=[('oops', 'oops')])
| 42.96875 | 105 | 0.696 | 162 | 1,375 | 5.876543 | 0.425926 | 0.057773 | 0.09979 | 0.084034 | 0.165966 | 0.165966 | 0.138655 | 0.138655 | 0.138655 | 0 | 0 | 0.036082 | 0.153455 | 1,375 | 31 | 106 | 44.354839 | 0.781787 | 0 | 0 | 0 | 0 | 0 | 0.144 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.043478 | false | 0.086957 | 0.086957 | 0.043478 | 0.73913 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 |
12e130d67ccfe9de3b3564473e4a39882ddb1111 | 583 | py | Python | authors/apps/profiles/migrations/0023_auto_20190124_1222.py | andela/ah-django-unchained | a4e5f6cd11fdc0b9422020693ac1200b849cf0f3 | [
"BSD-3-Clause"
] | null | null | null | authors/apps/profiles/migrations/0023_auto_20190124_1222.py | andela/ah-django-unchained | a4e5f6cd11fdc0b9422020693ac1200b849cf0f3 | [
"BSD-3-Clause"
] | 26 | 2019-01-07T14:22:05.000Z | 2019-02-28T17:11:48.000Z | authors/apps/profiles/migrations/0023_auto_20190124_1222.py | andela/ah-django-unchained | a4e5f6cd11fdc0b9422020693ac1200b849cf0f3 | [
"BSD-3-Clause"
] | 3 | 2019-09-19T22:16:09.000Z | 2019-10-16T21:16:16.000Z | # Generated by Django 2.1.4 on 2019-01-24 12:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('profiles', '0022_auto_20190123_1211'),
]
operations = [
migrations.AlterField(
model_name='userprofile',
name='first_name',
field=models.CharField(blank=True, max_length=100),
),
migrations.AlterField(
model_name='userprofile',
name='last_name',
field=models.CharField(blank=True, max_length=100),
),
]
| 24.291667 | 63 | 0.595197 | 61 | 583 | 5.540984 | 0.639344 | 0.118343 | 0.147929 | 0.171598 | 0.526627 | 0.526627 | 0.266272 | 0.266272 | 0.266272 | 0 | 0 | 0.089588 | 0.291595 | 583 | 23 | 64 | 25.347826 | 0.728814 | 0.077187 | 0 | 0.470588 | 1 | 0 | 0.134328 | 0.04291 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.058824 | 0 | 0.235294 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
12e5018fbac310b4e1d16e7744a8549158b1a76a | 1,943 | py | Python | photos/models.py | benjaminbills/galleria | 4c89f265a2f4f853a5685828d5bc505b51b9bb74 | [
"MIT"
] | null | null | null | photos/models.py | benjaminbills/galleria | 4c89f265a2f4f853a5685828d5bc505b51b9bb74 | [
"MIT"
] | null | null | null | photos/models.py | benjaminbills/galleria | 4c89f265a2f4f853a5685828d5bc505b51b9bb74 | [
"MIT"
] | null | null | null | from django.db import models
# Create your models here.
class Image(models.Model):
name = models.CharField(max_length=255)
posted_date = models.DateTimeField(auto_now_add=True)
image_description = models.CharField(max_length=500, default='DEFAULT VALUE')
image = models.ImageField(upload_to='images/', blank=True)
location = models.ForeignKey('Location', on_delete=models.CASCADE, default=0)
category = models.ForeignKey('Category', on_delete=models.CASCADE, default=0)
def __str__(self):
return self.name
def save_image(self):
self.save()
def delete_image(self):
self.delete()
@classmethod
def update_image(cls,image_id):
image=cls.objects.filter(pk=image_id)
image.update()
return image
@classmethod
def search_by_category(cls,search_term):
images = cls.objects.filter(category__name__contains=search_term)
return images
@classmethod
def search_by_location(cls,search_term):
images = cls.objects.filter(location__name__contains=search_term)
return images
@classmethod
def get_image_by_id(cls,id):
image=cls.objects.get(id=id)
return image
class Location(models.Model):
name = models.CharField(max_length=255)
#magic method
def __str__(self):
return self.name
def save_location(self):
self.save()
def delete_location(self):
self.delete()
@classmethod
def update_location(cls, id, name):
location = cls.objects.filter(pk=id).update(name=name)
return location
class Category(models.Model):
name = models.CharField(max_length=255)
#magic method
def __str__(self):
return self.name
def save_category(self):
self.save()
def delete_category(self):
self.delete()
@classmethod
def update_category(cls, id, name):
category = cls.objects.filter(pk=id).update(name=name)
return category | 26.986111 | 79 | 0.691199 | 251 | 1,943 | 5.139442 | 0.231076 | 0.037209 | 0.062016 | 0.074419 | 0.550388 | 0.50155 | 0.377519 | 0.323256 | 0.192248 | 0.130233 | 0 | 0.009044 | 0.203294 | 1,943 | 72 | 80 | 26.986111 | 0.824289 | 0.024704 | 0 | 0.454545 | 0 | 0 | 0.019027 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.272727 | false | 0 | 0.018182 | 0.054545 | 0.654545 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
12ffa5ef886269b64400e6ff0dbf8d65f1d35e0b | 305 | py | Python | api/tests.py | everett-toews/metaslacker | ec4bf3c4b39aa16b5ae46a0c3e732b8b9cb2cf72 | [
"MIT"
] | 90 | 2015-09-17T00:38:59.000Z | 2021-05-29T02:36:42.000Z | api/tests.py | everett-toews/metaslacker | ec4bf3c4b39aa16b5ae46a0c3e732b8b9cb2cf72 | [
"MIT"
] | null | null | null | api/tests.py | everett-toews/metaslacker | ec4bf3c4b39aa16b5ae46a0c3e732b8b9cb2cf72 | [
"MIT"
] | 10 | 2016-02-23T16:28:32.000Z | 2021-06-01T20:24:31.000Z | import unittest
class MainTestCase(unittest.TestCase):
def test_two_and_two(self):
four = 2 + 2
self.assertEqual(four, 4)
self.assertNotEqual(four, 5)
self.assertNotEqual(four, 6)
self.assertNotEqual(four, 22)
if __name__ == '__main__':
unittest.main()
| 20.333333 | 38 | 0.642623 | 36 | 305 | 5.138889 | 0.583333 | 0.291892 | 0.356757 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.030568 | 0.24918 | 305 | 14 | 39 | 21.785714 | 0.777293 | 0 | 0 | 0 | 0 | 0 | 0.02623 | 0 | 0 | 0 | 0 | 0 | 0.4 | 1 | 0.1 | false | 0 | 0.1 | 0 | 0.3 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
4208c41522c79409c03ff3e274e65ad419a2c482 | 4,473 | py | Python | bot/localization.py | Supportiii/telegram-report-bot | 6a050caafb1c205c0fd58f91be9264f1190ea706 | [
"MIT"
] | null | null | null | bot/localization.py | Supportiii/telegram-report-bot | 6a050caafb1c205c0fd58f91be9264f1190ea706 | [
"MIT"
] | null | null | null | bot/localization.py | Supportiii/telegram-report-bot | 6a050caafb1c205c0fd58f91be9264f1190ea706 | [
"MIT"
] | null | null | null | strings = {
"en": {
"error_no_reply": "This command must be sent as a reply to one's message!",
"error_report_admin": "Whoa! Don't report admins 😈",
"error_restrict_admin": "You cannot restrict an admin.",
"report_date_format": "%d.%m.%Y at %H:%M",
"report_message": '👆 Sent {time} (server time)\n'
'<a href="{msg_url}">Go to message</a>',
"report_note": "\n\nNote: {note}",
"report_sent": "<i>Report sent</i>",
"action_del_msg": "Delete message",
"action_del_and_ban": "Delete and ban",
"action_deleted": "\n\n🗑 <b>Deleted</b>",
"action_deleted_banned": "\n\n🗑❌ <b>Deleted, user banned</b>",
"action_deleted_partially": "Some messages couldn't be found or deleted",
"readonly_forever": "🙊 <i>User set to read-only mode forever</i>",
"readonly_temporary": "🙊 <i>User set to read-only mode until {time} (server time)</i>",
"nomedia_forever": "🖼 <i>User set to text-only mode forever</i>",
"nomedia_temporary": "🖼 <i>User set to text-only mode until {time} (server time)</i>",
"need_admins_attention": 'Dear admins, your presence in chat is needed!\n\n'
'<a href="{msg_url}">Go to chat</a>',
},
"ru": {
"error_no_reply": "Эта команда должна быть ответом на какое-либо сообщение!",
"error_report_admin": "Админов репортишь? Ай-ай-ай 😈",
"error_restrict_admin": "Невозможно ограничить администратора.",
"report_date_format": "%d.%m.%Y в %H:%M",
"report_message": '👆 Отправлено {time} (время серверное)\n'
'<a href="{msg_url}">Перейти к сообщению</a>',
"report_note": "\n\nПримечание: {note}",
"report_sent": "<i>Жалоба отправлена администраторам</i>",
"action_del_msg": "Удалить сообщение",
"action_del_and_ban": "Удалить и забанить",
"action_deleted": "\n\n🗑 <b>Удалено</b>",
"action_deleted_banned": "\n\n🗑❌ <b>Удалено, юзер забанен</b>",
"action_deleted_partially": "Не удалось найти или удалить некоторые сообщения",
"readonly_forever": "🙊 <i>Пользователь переведён в режим «только чтение» навсегда</i>",
"readonly_temporary": "🙊 <i>Пользователь переведён в режим «только чтение» до {time} (время серверное)</i>",
"nomedia_forever": "🖼 <i>Пользователю запрещено отправлять медиафайлы навсегда</i>",
"nomedia_temporary": "🖼 <i>Пользователю запрещено отправлять медиафайлы до {time} (время серверное)</i>",
"need_admins_attention": 'Товарищи админы, в чате нужно ваше присутствие!\n\n'
'<a href="{msg_url}">Перейти к чату</a>',
},
"de": {
"error_no_reply": "Dieser Befehl kann nur als Antwort gesendet werden!",
"error_report_admin": "Whoa! Du kannst Admins nicht melden 😈",
"error_restrict_admin": "Du kannst keine Admins einschränken.",
"report_date_format": "%d.%m.%Y um %H:%M Uhr",
"report_message": '👆 Gesendet {time} (server time)\n'
'<a href="{msg_url}">Zur Nachricht</a>',
"report_note": "\n\nNotiz: {note}",
"report_sent": "<i>Gemeldet</i>",
"action_del_msg": "Nachricht löschen",
"action_del_and_ban": "Löschen und Sperren",
"action_deleted": "\n\n🗑 <b>Löschen</b>",
"action_deleted_banned": "\n\n🗑❌ <b>Gelöscht, Nutzer gesperrt!</b>",
"action_deleted_partially": "Einige Nachrichten wurden nicht gefunden zum löschen",
"readonly_forever": "🙊 <i>Nutzer ist für immer stumm</i>",
"readonly_temporary": "🙊 <i>Nutzer bis {time} stumm. (server time)</i>",
"nomedia_forever": "🖼 <i>Nutzer für immer im Nur-Text-Modus.</i>",
"nomedia_temporary": "🖼 <i>Nutzer bis {time} im nur Text-Modus. (server time)</i>",
"need_admins_attention": 'Liebe Admins, ich sehne euch herbei!\n\n'
'<a href="{msg_url}">Zum Chat</a>',
}
@@ -64,7 +89,7 @@ def get_string(lang: str, key: str):
lang = strings.get(lang)
if not lang:
if not strings.get("en"):
raise KeyError(f'Neither "{lang}" nor "en" locales found')
raise KeyError(f'Weder "{lang}" noch "en" gefunden.')
else:
lang = strings.get("en")
try:
return lang[key]
except KeyError:
return strings.get("en").get(key, "ERR_NO_STRING")
| 47.585106 | 116 | 0.591549 | 598 | 4,473 | 4.326087 | 0.351171 | 0.045226 | 0.013916 | 0.020874 | 0.34828 | 0.27213 | 0.1724 | 0.117897 | 0.033243 | 0.033243 | 0 | 0.001776 | 0.244802 | 4,473 | 93 | 117 | 48.096774 | 0.754885 | 0 | 0 | 0 | 0 | 0.052632 | 0.680751 | 0.054997 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
421750365075d0ccd2892de6546549e569376c1b | 208 | py | Python | complete/01 - 10/Problem1/main.py | this-jacob/project-euler | 8f9e700e2875e84d081eade44fd2107db0a0ae12 | [
"MIT"
] | null | null | null | complete/01 - 10/Problem1/main.py | this-jacob/project-euler | 8f9e700e2875e84d081eade44fd2107db0a0ae12 | [
"MIT"
] | null | null | null | complete/01 - 10/Problem1/main.py | this-jacob/project-euler | 8f9e700e2875e84d081eade44fd2107db0a0ae12 | [
"MIT"
] | null | null | null | def main():
total = 0
for i in range(0, 1000):
if i % 3 == 0:
total += i
elif i % 5 == 0:
total += i
print(total)
if __name__ == '__main__':
main()
| 13.866667 | 28 | 0.408654 | 28 | 208 | 2.75 | 0.535714 | 0.155844 | 0.181818 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.087719 | 0.451923 | 208 | 14 | 29 | 14.857143 | 0.587719 | 0 | 0 | 0.2 | 0 | 0 | 0.038462 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.1 | false | 0 | 0 | 0 | 0.1 | 0.1 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
42274dc240f54ea288091543468dd2eda53a4feb | 55 | py | Python | tOYOpy/settings.py | fkab/tOYO | b0a7be760a45edd795b8734ce2e5f1ccec35091b | [
"MIT"
] | null | null | null | tOYOpy/settings.py | fkab/tOYO | b0a7be760a45edd795b8734ce2e5f1ccec35091b | [
"MIT"
] | null | null | null | tOYOpy/settings.py | fkab/tOYO | b0a7be760a45edd795b8734ce2e5f1ccec35091b | [
"MIT"
] | null | null | null | elements = {
'em': '',
'blockquote': '<br/>'
}
| 11 | 25 | 0.4 | 4 | 55 | 5.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.290909 | 55 | 4 | 26 | 13.75 | 0.564103 | 0 | 0 | 0 | 0 | 0 | 0.309091 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
422874e1c950eddb051f58c230d75405855070fc | 2,277 | py | Python | tests/test_url_enc_dec.py | FWidm/poe-profile | 08190dfab88758081ce1ddcd30a43081e2d7863f | [
"MIT"
] | 1 | 2018-12-02T19:48:09.000Z | 2018-12-02T19:48:09.000Z | tests/test_url_enc_dec.py | FWidm/poe-profile | 08190dfab88758081ce1ddcd30a43081e2d7863f | [
"MIT"
] | null | null | null | tests/test_url_enc_dec.py | FWidm/poe-profile | 08190dfab88758081ce1ddcd30a43081e2d7863f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import logging
import sys
import unittest
from src.util.tree_codec import encode_hashes, decode_url
url = 'AAAABAMDAQQHBLMGSQj0Dc0OPA5cES0UIBRxFScWbxhWGF0YkRo4HM4c3CSqJy8o-itQLJwy0TWSNuk6UjpYOuE8LUGHRARFR0V-RZ1Ms025TeNQR' \
'1NSVcZZ81qRXz9mnmebaGVodGpDaqxq-mvbcg9yqXasfIN99YIHgseDX4PMg9uFYIhAjLGOvo8akDOQVZLBmK2a4JuKogCmV6asqH2qxKyYrKqtja' \
'3xrj6vp7c-uJO8n7zqvk_AZsT2xq7MvM9-0B_Tj9P72L3ZXtl82mLfsONq5FHqGOvu7IPsiu8O7-vwH_JF8933MvfX-Ov56PrS_Ev-Cv5U_oH-jw=='
decoded = (4, 3, 3, 1, [1031, 1203, 1609, 2292, 3533, 3644, 3676, 4397, 5152, 5233, 5415, 5743, 6230, 6237, 6289,
6712,
7374, 7388, 9386, 10031, 10490, 11088, 11420, 13009, 13714, 14057, 14930, 14936, 15073,
15405,
16775, 17412, 17735, 17790, 17821, 19635, 19897, 19939, 20551, 21330, 21958, 23027, 23185,
24383,
26270, 26523, 26725, 26740, 27203, 27308, 27386, 27611, 29199, 29353, 30380, 31875, 32245,
33287,
33479, 33631, 33740, 33755, 34144, 34880, 36017, 36542, 36634, 36915, 36949, 37569, 39085,
39648,
39818, 41472, 42583, 42668, 43133, 43716, 44184, 44202, 44429, 44529, 44606, 44967, 46910,
47251,
48287, 48362, 48719, 49254, 50422, 50862, 52412, 53118, 53279, 54159, 54267, 55485, 55646,
55676,
55906, 57264, 58218, 58449, 59928, 60398, 60547, 60554, 61198, 61419, 61471, 62021, 62429,
63282,
63447, 63723, 63976, 64210, 64587, 65034, 65108, 65153, 65167])
class BasicTestSuite(unittest.TestCase):
"""Basic test cases."""
def test_encode(self):
result = encode_hashes(decoded[0],decoded[1],decoded[2],decoded[3],decoded[4])
print(result)
print(url)
self.assertEqual(result,url)
def test_decode(self):
result = decode_url(url)
self.assertEqual(result,decoded)
if __name__ == '__main__':
logger = logging.getLogger()
logger.level = logging.DEBUG
stream_handler = logging.StreamHandler(sys.stdout)
logger.addHandler(stream_handler)
unittest.main()
| 42.962264 | 123 | 0.62231 | 231 | 2,277 | 6.038961 | 0.800866 | 0.017204 | 0.017204 | 0.034409 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.401332 | 0.274484 | 2,277 | 52 | 124 | 43.788462 | 0.443099 | 0.017567 | 0 | 0 | 0 | 0 | 0.155984 | 0.152398 | 0 | 0 | 0 | 0 | 0.051282 | 1 | 0.051282 | false | 0 | 0.102564 | 0 | 0.179487 | 0.051282 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
422975ef7721aeaa44f60c6499ab2952315acfbe | 262 | py | Python | _test/registry/reg04.py | javacommons/commonthread | dff8b39d7c86729e4711b669bcec8eab6f146659 | [
"Unlicense"
] | null | null | null | _test/registry/reg04.py | javacommons/commonthread | dff8b39d7c86729e4711b669bcec8eab6f146659 | [
"Unlicense"
] | null | null | null | _test/registry/reg04.py | javacommons/commonthread | dff8b39d7c86729e4711b669bcec8eab6f146659 | [
"Unlicense"
] | null | null | null | # source http://itasuke.hatenablog.com/entry/2018/01/08/133510
import winreg
newkey = winreg.CreateKeyEx(winreg.HKEY_CURRENT_USER, r'Software\__javacommons__\abc')
newkey.Close()
winreg.DeleteKeyEx(winreg.HKEY_CURRENT_USER, r'Software\__javacommons__\abc')
| 43.666667 | 87 | 0.80916 | 35 | 262 | 5.714286 | 0.657143 | 0.1 | 0.17 | 0.21 | 0.44 | 0.44 | 0.44 | 0.44 | 0 | 0 | 0 | 0.057143 | 0.064886 | 262 | 5 | 88 | 52.4 | 0.759184 | 0.229008 | 0 | 0 | 0 | 0 | 0.287179 | 0.287179 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
4230f1879c1a68f9bf6052b16b5fb1dd036ba09b | 14,169 | py | Python | script/forecasting/forecaster.py | bialesdaniel/noisepage | 44ca689bd818b1bd39b84a7fe5148ddaa65a61eb | [
"MIT"
] | null | null | null | script/forecasting/forecaster.py | bialesdaniel/noisepage | 44ca689bd818b1bd39b84a7fe5148ddaa65a61eb | [
"MIT"
] | null | null | null | script/forecasting/forecaster.py | bialesdaniel/noisepage | 44ca689bd818b1bd39b84a7fe5148ddaa65a61eb | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Main script for workload forecasting.
Example usage:
- Generate data (runs OLTP benchmark on the built database) and perform training, and save the trained model
./forecaster --gen_data --models=LSTM --model_save_path=model.pickle
- Use the trained models (LSTM) to generate predictions.
./forecaster --model_load_path=model.pickle --test_file=test_query.csv --test_model=LSTM
TODO:
- Better metrics for training and prediction (currently not focusing on models' accuracy yet)
- Multiple models (currently only simple-one-layer-untuned LSTM used)
- API and interaction with Pilot
"""
import argparse
import json
import pickle
from functools import lru_cache
from typing import Dict, List, Optional, Tuple, Union
import numpy as np
from ..testing.self_driving.constants import (DEFAULT_ITER_NUM,
DEFAULT_QUERY_TRACE_FILE,
DEFAULT_TPCC_WEIGHTS,
DEFAULT_WORKLOAD_PATTERN)
from ..testing.self_driving.forecast import gen_oltp_trace
from ..testing.util.constants import LOG
from .cluster import QueryCluster
from .data_loader import DataLoader
from .models import ForecastModel, get_models
# Interval duration for aggregation in microseconds
INTERVAL_MICRO_SEC = 500000
# Number of Microseconds per second
MICRO_SEC_PER_SEC = 1000000
# Number of data points in a sequence
SEQ_LEN = 10 * MICRO_SEC_PER_SEC // INTERVAL_MICRO_SEC
# Number of data points for the horizon
HORIZON_LEN = 30 * MICRO_SEC_PER_SEC // INTERVAL_MICRO_SEC
# Number of data points for testing set
EVAL_DATA_SIZE = 2 * SEQ_LEN + HORIZON_LEN
argp = argparse.ArgumentParser(description="Query Load Forecaster")
# Generation stage related options
argp.add_argument(
"--gen_data",
default=False,
action="store_true",
help="If specified, OLTP benchmark would be downloaded and built to generate the query trace data")
argp.add_argument(
"--tpcc_weight",
type=str,
default=DEFAULT_TPCC_WEIGHTS,
help="Workload weights for the TPCC")
argp.add_argument(
"--tpcc_rates",
nargs="+",
default=DEFAULT_WORKLOAD_PATTERN,
help="Rate array for the TPCC workload")
argp.add_argument(
"--pattern_iter",
type=int,
default=DEFAULT_ITER_NUM,
help="Number of iterations the DEFAULT_WORKLOAD_PATTERN should be run")
argp.add_argument("--trace_file", default=DEFAULT_QUERY_TRACE_FILE,
help="Path to the query trace file", metavar="FILE")
# Model specific
argp.add_argument("--models", nargs='+', type=str, help="Models to use")
argp.add_argument("--models_config", type=str, metavar="FILE",
help="Models and init arguments JSON config file")
argp.add_argument("--seq_len", type=int, default=SEQ_LEN,
help="Length of one sequence in number of data points")
argp.add_argument(
"--horizon_len",
type=int,
default=HORIZON_LEN,
help="Length of the horizon in number of data points, "
"aka, how many further in the a sequence is used for prediction"
)
# Training stage related options
argp.add_argument("--model_save_path", metavar="FILE",
help="Where the model trained will be stored")
argp.add_argument(
"--eval_size",
type=int,
default=EVAL_DATA_SIZE,
help="Length of the evaluation data set length in number of data points")
argp.add_argument("--lr", type=float, default=0.001, help="Learning rate")
argp.add_argument("--epochs", type=int, default=10,
help="Number of epochs for training")
# Testing stage related options
argp.add_argument(
"--model_load_path",
default="model.pickle",
metavar="FILE",
help="Where the model should be loaded from")
argp.add_argument(
"--test_file",
help="Path to the test query trace file",
metavar="FILE")
argp.add_argument(
"--test_model",
type=str,
help="Model to be used for forecasting"
)
class Forecaster:
"""
A wrapper around various ForecastModels, that prepares training and evaluation data.
"""
TRAIN_DATA_IDX = 0
TEST_DATA_IDX = 1
def __init__(
self,
trace_file: str,
interval_us: int = INTERVAL_MICRO_SEC,
test_mode: bool = False,
eval_size: int = EVAL_DATA_SIZE,
seq_len: int = SEQ_LEN,
horizon_len: int = HORIZON_LEN) -> None:
"""
Initializer
:param trace_file: trace file for the forecaster
:param interval_us: number of microseconds for the time-series interval
:param test_mode: True If the Loader is for testing
:param eval_size: Number of data points used for evaluation(testing)
:param seq_len: Length of a sequence
:param horizon_len: Horizon length
"""
self._seq_len = seq_len
self._horizon_len = horizon_len
self._test_mode = test_mode
self._eval_data_size = eval_size
self._data_loader = DataLoader(
query_trace_file=trace_file,
interval_us=interval_us)
self._make_clusters()
def _make_clusters(self) -> None:
"""
Extract data from the DataLoader and put them into different clusters.
:return: None
"""
# FIXME:
# Assuming all the queries in the current trace file are from
# the same cluster for now. A future TODO would have a clustering
# process that separates traces into multiple clusters
self._clusters = [QueryCluster(self._data_loader.get_ts_data())]
self._cluster_data = []
for cluster in self._clusters:
# Aggregated time-series from the cluster
data = cluster.get_timeseries()
train_raw_data, test_raw_data = self._split_data(data)
self._cluster_data.append((train_raw_data, test_raw_data))
def _split_data(self, data: np.ndarray) -> Tuple[np.ndarray, np.ndarray]:
"""
Split the raw data into a training set, and a testing(evaluation) set.
:param data: All the raw data
:return: traing, test raw data set
"""
if self._test_mode:
self._test_set_size = len(data)
else:
self._test_set_size = self._eval_data_size
if self._test_set_size > len(data):
raise ValueError(
"Eval data size is too small. Not enough data points.")
split_idx = len(data) - self._test_set_size
# First part as the training set
train_raw_data = data[:split_idx]
# Last part as the testing set
test_raw_data = data[split_idx:]
return train_raw_data, test_raw_data
def _make_seqs(self,
input_data: np.ndarray,
start: int,
end: int,
with_label: bool = False) -> List[Union[Tuple[np.ndarray,
np.ndarray],
np.ndarray]]:
"""
Create time-series sequences of fixed sequence length from a continuous range of time-series.
:param input_data: Input time-series
:param start: Start index (inclusive) of the first sequence to be made
:param end: End index (exclusive) of the last sequence to be made
:param with_label: True if label in a certain horizon is added
:return: Sequences of fixed length if with_label is False,
or List of fixed length sequence and label if with_label is True
"""
seq_len = self._seq_len
horizon = self._horizon_len
seq_start = start
if with_label:
# Reserve space for horizon
seq_end = end - seq_len - horizon
else:
# Use all data for prediction
seq_end = end - seq_len
if seq_end <= seq_start:
raise IndexError(f"Not enough data points to make sequences")
seqs = []
for i in range(seq_start, seq_end):
seq = input_data[i:i + seq_len].reshape(-1, 1)
# Look beyond the horizon to get the label
if with_label:
label_i = i + seq_len + horizon
label = input_data[label_i: label_i + 1].reshape(1, -1)
seqs.append((seq, label))
else:
seqs.append(seq)
return seqs
@lru_cache(maxsize=32)
def _cluster_seqs(self,
cluster_id: int,
test_mode: bool = False,
with_label: bool = False) -> List[Union[Tuple[np.ndarray,
np.ndarray],
np.ndarray]]:
"""
Create time-series sequences of fixed sequence length from a continuous range of time-series. A cached wrapper
over _make_seqs with different options.
:param cluster_id: Cluster id
:param test_mode: True if using test dataset, otherwise use the training dataset
:param with_label: True if label (time-series data in a horizon from the sequence) is also added.
:return: Sequences of fixed length if with_label is False,
or List of fixed length sequence and label if with_label is True
"""
if test_mode:
input_data = self._cluster_data[cluster_id][self.TEST_DATA_IDX]
else:
input_data = self._cluster_data[cluster_id][self.TRAIN_DATA_IDX]
seqs = self._make_seqs(
input_data,
0,
len(input_data),
with_label=with_label)
return seqs
def train(self, models_kwargs: Dict) -> List[List[ForecastModel]]:
"""
:param models_kwargs: A dictionary of models' init arguments
:return: List of models(a list of models) for each cluster.
"""
models = []
for cid in range(len(self._cluster_data)):
cluster_models = get_models(models_kwargs)
train_seqs = self._cluster_seqs(
cid, test_mode=False, with_label=True)
for model_name, model in cluster_models.items():
# Fit the model
model.fit(train_seqs)
self.eval(cid, model)
models.append(cluster_models)
return models
def eval(self, cid: int, model: ForecastModel) -> None:
"""
Evaluate a fitted model on the test dataset.
:param cid: Cluster id
:param model: Model to use
"""
eval_seqs = self._cluster_seqs(cid, test_mode=True, with_label=True)
preds = []
gts = []
for seq, label in eval_seqs:
pred = model.predict(seq)
preds.append(pred)
gts.append(label.item())
# FIXME:
# simple L2 norm for comparing the prediction and results
l2norm = np.linalg.norm(np.array(preds) - np.array(gts))
LOG.info(
f"[{model.name}] has L2 norm(prediction, ground truth) = {l2norm}")
def predict(self, cid: int, model: ForecastModel) -> Dict:
"""
Output prediction on the test dataset, and segregate the predicted cluster time-series into individual queries
:param cid: Cluser id
:param model: Model to use
:return: Dict of {query_id -> time-series}
"""
test_seqs = self._cluster_seqs(cid, test_mode=True, with_label=False)
preds = list([model.predict(seq) for seq in test_seqs])
query_preds = self._clusters[cid].segregate(preds)
return query_preds
def parse_model_config(model_names: Optional[List[str]],
models_config: Optional[str]) -> Dict:
"""
Load models from
:param model_names: List of model names
:param models_config: JSON model config file
:return: Merged model config Dict
"""
model_kwargs = dict([(model_name, {}) for model_name in model_names])
if models_config is not None:
with open(models_config, 'r') as f:
custom_config = json.load(f)
# Simple and non-recursive merging of options
model_kwargs.update(custom_config)
if len(model_kwargs) < 1:
raise ValueError("At least 1 model needs to be used.")
return model_kwargs
if __name__ == "__main__":
args = argp.parse_args()
if args.test_file is None:
# Parse models arguments
models_kwargs = parse_model_config(args.models, args.models_config)
# Generate OLTP trace file
if args.gen_data:
gen_oltp_trace(
tpcc_weight=args.tpcc_weight,
tpcc_rates=args.tpcc_rates,
pattern_iter=args.pattern_iter)
trace_file = DEFAULT_QUERY_TRACE_FILE
else:
trace_file = args.trace_file
forecaster = Forecaster(
trace_file=trace_file,
interval_us=INTERVAL_MICRO_SEC,
seq_len=args.seq_len,
eval_size=args.eval_size,
horizon_len=args.horizon_len)
models = forecaster.train(models_kwargs)
# Save the model
if args.model_save_path:
with open(args.model_save_path, "wb") as f:
pickle.dump(models, f)
else:
# Do inference on a trained model
with open(args.model_load_path, "rb") as f:
models = pickle.load(f)
forecaster = Forecaster(
trace_file=args.test_file,
test_mode=True,
interval_us=INTERVAL_MICRO_SEC,
seq_len=args.seq_len,
eval_size=args.eval_size,
horizon_len=args.horizon_len)
# FIXME:
# Assuming all the queries in the current trace file are from
# the same cluster for now
query_pred = forecaster.predict(0, models[0][args.test_model])
# TODO:
# How are we consuming predictions?
for qid, ts in query_pred.items():
LOG.info(f"[Query: {qid}] pred={ts[:10]}")
| 36.145408 | 118 | 0.619239 | 1,816 | 14,169 | 4.629405 | 0.174009 | 0.021411 | 0.028548 | 0.014988 | 0.228738 | 0.189961 | 0.160105 | 0.13465 | 0.117521 | 0.117521 | 0 | 0.004536 | 0.29988 | 14,169 | 391 | 119 | 36.237852 | 0.842944 | 0.268121 | 0 | 0.181034 | 1 | 0 | 0.119741 | 0.002427 | 0 | 0 | 0 | 0.01023 | 0 | 1 | 0.038793 | false | 0 | 0.051724 | 0 | 0.12931 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
4237a4d8945ebfffd7fd8c863df2a43bde57f4e3 | 975 | py | Python | modules/kubrick/apps/awards/models.py | Lab-Quatro/aposcar | 97631f2e3939566cc4e5b81e50c58ce03a5350a4 | [
"MIT"
] | 3 | 2021-07-05T14:18:27.000Z | 2021-09-02T10:15:55.000Z | modules/kubrick/apps/awards/models.py | Lab-Quatro/aposcar | 97631f2e3939566cc4e5b81e50c58ce03a5350a4 | [
"MIT"
] | 1 | 2021-10-31T21:40:39.000Z | 2021-10-31T21:40:39.000Z | modules/kubrick/apps/awards/models.py | Lab-Quatro/aposcar | 97631f2e3939566cc4e5b81e50c58ce03a5350a4 | [
"MIT"
] | null | null | null | from django.db import models
class Nominee(models.Model):
name = models.TextField()
picture_url = models.ImageField(upload_to="nominees/")
description = models.TextField(max_length=350)
class Meta:
verbose_name_plural = "nominees"
def __str__(self):
return self.name
class Category(models.Model):
name = models.CharField(max_length=40)
url_field = models.CharField(max_length=40)
class Meta:
verbose_name_plural = "categories"
def __str__(self):
return self.name
class Indication(models.Model):
nominated = models.ForeignKey(Nominee, on_delete=models.CASCADE)
category = models.ForeignKey(
Category, on_delete=models.CASCADE, related_name="indications"
)
year = models.IntegerField()
annotation = models.TextField(blank=True)
is_winner = models.BooleanField(default=False)
def __str__(self):
return f'"{self.nominated.name}" on "{self.category.name}"'
| 25.657895 | 70 | 0.695385 | 115 | 975 | 5.669565 | 0.443478 | 0.050614 | 0.046012 | 0.07362 | 0.248466 | 0.088957 | 0.088957 | 0 | 0 | 0 | 0 | 0.00894 | 0.196923 | 975 | 37 | 71 | 26.351351 | 0.823755 | 0 | 0 | 0.269231 | 0 | 0 | 0.089231 | 0.046154 | 0 | 0 | 0 | 0 | 0 | 1 | 0.115385 | false | 0 | 0.038462 | 0.115385 | 0.846154 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 2 |
424371e9002a0d30915e7782779c23b77cf1168c | 522 | py | Python | homeassistant/components/solaredge/__init__.py | DavidDeSloovere/core | 909a20b36d4df6724c955c2ae28cb82fe6d50c2e | [
"Apache-2.0"
] | 4 | 2020-08-10T20:02:24.000Z | 2022-01-31T02:14:22.000Z | homeassistant/components/solaredge/__init__.py | DavidDeSloovere/core | 909a20b36d4df6724c955c2ae28cb82fe6d50c2e | [
"Apache-2.0"
] | 78 | 2020-07-23T07:13:08.000Z | 2022-03-31T06:02:04.000Z | homeassistant/components/solaredge/__init__.py | DavidDeSloovere/core | 909a20b36d4df6724c955c2ae28cb82fe6d50c2e | [
"Apache-2.0"
] | 3 | 2022-01-17T20:10:54.000Z | 2022-01-17T20:17:22.000Z | """The solaredge integration."""
from __future__ import annotations
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
import homeassistant.helpers.config_validation as cv
from .const import DOMAIN
CONFIG_SCHEMA = cv.deprecated(DOMAIN)
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Load the saved entities."""
hass.async_create_task(
hass.config_entries.async_forward_entry_setup(entry, "sensor")
)
return True
| 27.473684 | 77 | 0.781609 | 63 | 522 | 6.238095 | 0.555556 | 0.086514 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.139847 | 522 | 18 | 78 | 29 | 0.875278 | 0.049808 | 0 | 0 | 0 | 0 | 0.013043 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.454545 | 0 | 0.545455 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
424d5b248c6b3fcd0ec5e3855e8a59d969b36415 | 1,296 | py | Python | bailleurs/migrations/0001_initial.py | MTES-MCT/appel | 3b840ccea600ef31cfea57721fe5e6edbdbc2c79 | [
"MIT"
] | null | null | null | bailleurs/migrations/0001_initial.py | MTES-MCT/appel | 3b840ccea600ef31cfea57721fe5e6edbdbc2c79 | [
"MIT"
] | 2 | 2021-12-15T05:10:43.000Z | 2021-12-15T05:11:00.000Z | bailleurs/migrations/0001_initial.py | MTES-MCT/appel | 3b840ccea600ef31cfea57721fe5e6edbdbc2c79 | [
"MIT"
] | 1 | 2021-12-28T13:06:06.000Z | 2021-12-28T13:06:06.000Z | # Generated by Django 3.2.5 on 2021-07-06 14:18
import uuid
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="Bailleur",
fields=[
("id", models.AutoField(primary_key=True, serialize=False)),
("uuid", models.UUIDField(default=uuid.uuid4, editable=False)),
("nom", models.CharField(max_length=255)),
("siret", models.CharField(max_length=14)),
("capital_social", models.CharField(max_length=255)),
("siege", models.CharField(max_length=255)),
("dg_nom", models.CharField(max_length=255)),
("dg_fonction", models.CharField(max_length=255)),
("dg_date_deliberation", models.DateField()),
("operation_exceptionnelle", models.TextField()),
("cree_le", models.DateTimeField(auto_now_add=True)),
("mis_a_jour_le", models.DateTimeField(auto_now=True)),
],
options={
"permissions": (
("can_edit_bailleur", "Créer ou mettre à jour un bailleur"),
),
},
),
]
| 35.027027 | 80 | 0.548611 | 126 | 1,296 | 5.468254 | 0.579365 | 0.130624 | 0.156749 | 0.208999 | 0.29463 | 0.174165 | 0 | 0 | 0 | 0 | 0 | 0.037373 | 0.318673 | 1,296 | 36 | 81 | 36 | 0.742922 | 0.034722 | 0 | 0.068966 | 1 | 0 | 0.147318 | 0.019215 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.068966 | 0 | 0.206897 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
424d80dc7999edc27c21ab202ecf629475f40e26 | 2,026 | py | Python | tests/primitives/flow/probe_tcpip_extended_unibiflow_test.py | kjerabek/netexp | 362c200230ba7b2549adcedd4a9890492dad51c7 | [
"MIT"
] | null | null | null | tests/primitives/flow/probe_tcpip_extended_unibiflow_test.py | kjerabek/netexp | 362c200230ba7b2549adcedd4a9890492dad51c7 | [
"MIT"
] | null | null | null | tests/primitives/flow/probe_tcpip_extended_unibiflow_test.py | kjerabek/netexp | 362c200230ba7b2549adcedd4a9890492dad51c7 | [
"MIT"
] | null | null | null | from tests.primitives.flow import probe_tcpip_extended_biflow_test
from netexp.primitives.flow import TCPIPFlowExtendedUniBiFlowInfo
from netexp.common import naming
class TestTCPIPExtendedUniBiFlow(probe_tcpip_extended_biflow_test.TestTCPIPExtendedBiFlow):
flow_class = TCPIPFlowExtendedUniBiFlowInfo
def test_short_single_uni_flow_stats(self, probe_short_flow):
probe_short_flow.run()
processed_flow = self.output.send.call_args.args[0]
stats = processed_flow.to_dict()
assert stats[naming.TIMESTAMP_AB] == [1590076139670363, 1590076139673838, 1590076139676297, 1590076139696210,
1590076139696270, 1590076141095061, 1590076141098597]
assert stats[naming.L3_HEADER_LENGTH_AB] == [20, 20, 20, 20, 20, 20, 20]
assert stats[naming.L4_HEADER_LENGTH_AB] == [40, 32, 32, 32, 32, 32, 32]
assert stats[naming.L4_PAYSIZE_AB] == [0, 0, 517, 0, 0, 0, 0]
assert stats[naming.TCP_FLAG_PSH_AB] == [0, 0, 1, 0, 0, 0, 0]
assert stats[naming.TCP_FLAG_RST_AB] == [0, 0, 0, 0, 0, 0, 0]
assert stats[naming.TCP_FLAG_ACK_AB] == [0, 1, 1, 1, 1, 1, 1]
assert stats[naming.TCP_FLAG_FIN_AB] == [0, 0, 0, 0, 0, 1, 0]
assert stats[naming.TCP_FLAG_SYN_AB] == [1, 0, 0, 0, 0, 0, 0]
assert stats[naming.TIMESTAMP_BA] == [1590076139673781, 1590076139679702, 1590076139696191, 1590076139696249,
1590076141098561]
assert stats[naming.L3_HEADER_LENGTH_BA] == [20, 20, 20, 20, 20]
assert stats[naming.L4_HEADER_LENGTH_BA] == [40, 32, 32, 32, 32]
assert stats[naming.L4_PAYSIZE_BA] == [0, 0, 1418, 1740, 0]
assert stats[naming.TCP_FLAG_PSH_BA] == [0, 0, 0, 1, 0]
assert stats[naming.TCP_FLAG_RST_BA] == [0, 0, 0, 0, 0]
assert stats[naming.TCP_FLAG_ACK_BA] == [1, 1, 1, 1, 1]
assert stats[naming.TCP_FLAG_FIN_BA] == [0, 0, 0, 0, 1]
assert stats[naming.TCP_FLAG_SYN_BA] == [1, 0, 0, 0, 0]
| 56.277778 | 117 | 0.651037 | 289 | 2,026 | 4.321799 | 0.231834 | 0.057646 | 0.057646 | 0.048038 | 0.510008 | 0.445957 | 0.36269 | 0.333066 | 0.333066 | 0.214572 | 0 | 0.209213 | 0.228529 | 2,026 | 35 | 118 | 57.885714 | 0.589891 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.62069 | 1 | 0.034483 | false | 0 | 0.103448 | 0 | 0.206897 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
42569d1c317bd48e4f4e7021e87396555e651ced | 1,276 | py | Python | db_conn.py | achhetr/Library-book-store-app | a85e9a26dba48119ce52abb5ee8219528e06ac30 | [
"MIT"
] | null | null | null | db_conn.py | achhetr/Library-book-store-app | a85e9a26dba48119ce52abb5ee8219528e06ac30 | [
"MIT"
] | null | null | null | db_conn.py | achhetr/Library-book-store-app | a85e9a26dba48119ce52abb5ee8219528e06ac30 | [
"MIT"
] | null | null | null | import sqlite3
class Database:
# create book always if not exists
def __init__(self,db):
self.conn = sqlite3.connect(db)
self.cur = self.conn.execute("CREATE TABLE IF NOT EXISTS book (id INTEGER PRIMARY KEY, " +
"title TEXT, author TEXT, year INTEGER, isbn INTEGER)")
self.conn.commit()
def insert(self,title,author,year,isbn):
self.cur.execute("INSERT INTO book VALUES (NULL,?,?,?,?)",(title,author,year,isbn))
self.conn.commit()
def view(self):
self.cur.execute("SELECT * FROM book")
rows = self.cur.fetchall()
return rows
def search(self,title="",author="",year="",isbn=""):
self.cur.execute("SELECT * FROM book WHERE title=? OR author=? " +
"OR year=? OR isbn=?",(title,author,year,isbn))
rows = self.cur.fetchall()
return rows
def delete(self,id):
self.cur.execute("DELETE FROM book WHERE id=?",(id,))
self.conn.commit()
def update(self,id,title,author,year,isbn):
self.cur.execute("UPDATE book SET title=?, author=?, " +
"year=?,isbn=? WHERE id=?", (title,author,year,isbn,id))
self.conn.commit()
def __del__(self):
self.conn.close() | 33.578947 | 98 | 0.579937 | 163 | 1,276 | 4.490798 | 0.288344 | 0.076503 | 0.143443 | 0.181694 | 0.405738 | 0.290984 | 0.233607 | 0.101093 | 0 | 0 | 0 | 0.002137 | 0.266458 | 1,276 | 38 | 99 | 33.578947 | 0.779915 | 0.025078 | 0 | 0.285714 | 0 | 0 | 0.253419 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.035714 | 0 | 0.392857 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
4262ea9b91c2ce1c0da94f2913617caab9285e6f | 110 | py | Python | app/pathfinding/finder/__init__.py | TheronHa/Spaghetti | e181c2f7ea0c044fb7d0edb36bd203dac2eabaf9 | [
"MIT"
] | 208 | 2017-01-23T17:45:13.000Z | 2022-03-22T22:27:25.000Z | app/pathfinding/finder/__init__.py | TheronHa/Spaghetti | e181c2f7ea0c044fb7d0edb36bd203dac2eabaf9 | [
"MIT"
] | 31 | 2017-10-28T09:21:06.000Z | 2021-09-26T15:38:36.000Z | app/pathfinding/finder/__init__.py | TheronHa/Spaghetti | e181c2f7ea0c044fb7d0edb36bd203dac2eabaf9 | [
"MIT"
] | 60 | 2016-12-13T00:05:36.000Z | 2022-03-21T22:23:49.000Z | __all__ = ['a_star', 'best_first', 'bi_a_star', 'breadth_first', 'dijkstra',
'finder', 'ida_star']
| 36.666667 | 76 | 0.609091 | 14 | 110 | 4.071429 | 0.714286 | 0.175439 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.181818 | 110 | 2 | 77 | 55 | 0.633333 | 0 | 0 | 0 | 0 | 0 | 0.545455 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
4263245bfbde431be1ac8c88739a3f1f392bf22f | 34,891 | py | Python | dependencies/src/4Suite-XML-1.0.2/test/Xml/Xslt/Borrowed/uo_20000929.py | aleasims/Peach | bb56841e943d719d5101fee0a503ed34308eda04 | [
"MIT"
] | null | null | null | dependencies/src/4Suite-XML-1.0.2/test/Xml/Xslt/Borrowed/uo_20000929.py | aleasims/Peach | bb56841e943d719d5101fee0a503ed34308eda04 | [
"MIT"
] | null | null | null | dependencies/src/4Suite-XML-1.0.2/test/Xml/Xslt/Borrowed/uo_20000929.py | aleasims/Peach | bb56841e943d719d5101fee0a503ed34308eda04 | [
"MIT"
] | 1 | 2020-07-26T03:57:45.000Z | 2020-07-26T03:57:45.000Z | #Uche's test from Sun's SVG slide publisher
import os
from Xml.Xslt import test_harness
#From Sun's toolkit
sheet_1_uri = "Xml/Xslt/Borrowed/svgslides.xsl"
sheet_2_uri = "Xml/Xslt/Borrowed/svgslides_custom.xsl"
sheet_3_uri = "Xml/Xslt/Borrowed/slidescript.xsl"
source_1_uri = "Xml/Xslt/Borrowed/slides4svg.xml"
saxon_output = """"""
expected_1 = """<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet href="slides.css" type="text/css"?>
<svg height='768' width='1024' style='pointer-events:visible' xml:space='preserve' onload='initSlides(evt)' xmlns:xlink='http://www.w3.org/2000/xlink/namespace/'>
<script><![CDATA[
var doc = null;
// Called upon presentation loading
function initSlides(evt){
var target = evt.getTarget();
doc = target.getOwnerDocument();
hideAndShow(evt, curSlide, curSlide);
}
function onPrevSlide(evt){
// Process new current slide
var oldCurSlide = curSlide;
curSlide = curSlide - 1;
if(curSlide < 0){
curSlide = slideList.length - 1;
}
hideAndShow(evt, oldCurSlide, curSlide);
}
function onNextSlide(evt){
// Process new current slide
var prevSlide = curSlide;
curSlide = curSlide + 1;
if(curSlide > (slideList.length - 1)){
curSlide = 0;
}
hideAndShow(evt, prevSlide, curSlide);
// alert("onNextSlide");
}
function hideAndShow(evt, hideSlide, showSlide){
// alert("Hiding : " + hideSlide + " and showing : " + showSlide);
// Hide previous current slide and show new
// one.
var hideSlideName = slideList[hideSlide];
var showSlideName = slideList[showSlide];
/*if(hideSlideName == null)
alert("hideSlideName is null");
else
alert("hideSlideName is NOT null:" + hideSlideName);*/
var slideGroup = doc.getElementById(hideSlideName);
slideGroup.setAttribute("style", "visibility:hidden");
slideGroup = doc.getElementById(showSlideName);
slideGroup.setAttribute("style", "visibility:show");
var slideMenuItemId = slideList[hideSlide] + "MenuItem";
var menuItem = doc.getElementById(slideMenuItemId);
if(menuItem != null)
menuItem.setAttribute("class", "slideMenuItem");
slideMenuItemId = slideList[showSlide] + "MenuItem";
menuItem = doc.getElementById(slideMenuItemId);
if(menuItem != null)
menuItem.setAttribute("class", "currentSlideMenuItem");
}
function onHighlightMenuItem(evt, highlight, itemId){
var target = evt.getTarget();
var doc = target.getOwnerDocument();
var menuItem = doc.getElementById(itemId);
if(highlight == "true")
menuItem.setAttribute("class", "highlightedSlideMenuItem");
else{
var curSlideMenuItemId = slideList[curSlide] + "MenuItem";
if(curSlideMenuItemId == itemId)
menuItem.setAttribute("class", "currentSlideMenuItem");
else
menuItem.setAttribute("class", "slideMenuItem");
}
}
function onMenuItemSelected(evt, index){
// alert("Should show slide # " + index);
var oldCurSlide = curSlide;
curSlide = index;
hideAndShow(evt, oldCurSlide, index);
}
function onSetFill(evt, elementId, fillValue){
var element = doc.getElementById(elementId);
element.setAttribute("style", "fill:" + fillValue);
}
function onExpand(evt, submenuGroupId){
var submenuGroup = doc.getElementById(submenuGroupId);
submenuGroup.setAttribute("style", "visibility:hidden");
var javaScriptCode = "window.expandNow('" + submenuGroupId + "')";
window.expandNow = expandNow;
setTimeout(javaScriptCode, 1000);
}
function expandNow(submenuGroupId){
var submenuGroup = doc.getElementById(submenuGroupId);
submenuGroup.setAttribute("style", "visibility:show");
}
function onCollapse(evt, submenuGroupId){
var submenuGroup = doc.getElementById(submenuGroupId);
submenuGroup.setAttribute("style", "visibility:hidden");
}
]]></script>
<script><![CDATA[
var slideList = new Array();
var slideIndex = new Object();
var curSlide = 0;
slideList[0]="slideShowCover";
slideIndex["slideShowCover"] = 0;
slideList[1]="slidesetCover1";
slideIndex["slidesetCover1"] = 1;
slideList[2] = "slide1-1";
slideIndex["slide1-1"] = 2;
slideList[3]="slidesetCover2";
slideIndex["slidesetCover2"] = 3;
slideList[4] = "slide2-1";
slideIndex["slide2-1"] = 4;
slideList[5] = "slide2-2";
slideIndex["slide2-2"] = 5;
slideList[6] = "slide2-3";
slideIndex["slide2-3"] = 6;
slideList[7]="slidesetCover3";
slideIndex["slidesetCover3"] = 7;
slideList[8] = "slide3-1";
slideIndex["slide3-1"] = 8;
slideList[9] = "slide3-2";
slideIndex["slide3-2"] = 9;
]]></script>
<defs>
<linearGradient spreadMethod='pad' id='slideBackgroundPaint' x1='0' y2='768' x2='1024' y1='0' gradientUnits='userSpaceOnUse'>
<stop offset='0%' style='stop-color:black; stop-opacity:1;'/>
<stop offset='100%' style='stop-color:rgb(103, 107, 157); stop-opacity:1;'/>
</linearGradient>
<linearGradient spreadMethod='pad' id='slideTitleSeparatorPaint' x1='0' y2='0' x2='1024' y1='0' gradientUnits='userSpaceOnUse'>
<stop offset='0%' style='stop-color:rgb(23, 27, 77); stop-opacity:1;'/>
<stop offset='.5' style='stop-color:rgb(103, 107, 157); stop-opacity:1;'/>
<stop offset='100%' style='stop-color:rgb(23, 27, 77); stop-opacity:1;'/>
</linearGradient>
<linearGradient spreadMethod='pad' id='menuBarPaint' x1='0' y2='0' x2='210' y1='0' gradientUnits='userSpaceOnUse'>
<stop offset='0%' style='stop-color:black; stop-opacity:1;'/>
<stop offset='50%' style='stop-color:rgb(103, 107, 157); stop-opacity:1;'/>
<stop offset='100%' style='stop-color:white; stop-opacity:1;'/>
</linearGradient>
<linearGradient spreadMethod='pad' id='slideBackgroundHeaderPaint' x1='0' y2='100' x2='0' y1='0' gradientUnits='userSpaceOnUse'>
<stop offset='0%' style='stop-color:black; stop-opacity:1;'/>
<stop offset='50%' style='stop-color:rgb(103, 107, 157); stop-opacity:1;'/>
<stop offset='100%' style='stop-color:white; stop-opacity:1;'/>
</linearGradient>
<g id='stripePattern'>
<g style='fill:black; fill-opacity:.25'>
<rect height='2' width='1' y='0'/>
<rect height='2' width='1' y='4'/>
<rect height='2' width='1' y='8'/>
<rect height='2' width='1' y='12'/>
<rect height='2' width='1' y='16'/>
<rect height='2' width='1' y='20'/>
<rect height='2' width='1' y='24'/>
<rect height='2' width='1' y='28'/>
<rect height='2' width='1' y='32'/>
<rect height='2' width='1' y='36'/>
<rect height='2' width='1' y='40'/>
<rect height='2' width='1' y='44'/>
<rect height='2' width='1' y='48'/>
<rect height='2' width='1' y='52'/>
<rect height='2' width='1' y='56'/>
<rect height='2' width='1' y='60'/>
<rect height='2' width='1' y='64'/>
<rect height='2' width='1' y='68'/>
<rect height='2' width='1' y='72'/>
<rect height='2' width='1' y='76'/>
<rect height='2' width='1' y='80'/>
<rect height='2' width='1' y='84'/>
<rect height='2' width='1' y='88'/>
<rect height='2' width='1' y='92'/>
<rect height='2' width='1' y='96'/>
<rect height='2' width='1' y='100'/>
<rect height='2' width='1' y='104'/>
<rect height='2' width='1' y='108'/>
<rect height='2' width='1' y='112'/>
<rect height='2' width='1' y='116'/>
<rect height='2' width='1' y='120'/>
<rect height='2' width='1' y='124'/>
<rect height='2' width='1' y='128'/>
<rect height='2' width='1' y='132'/>
<rect height='2' width='1' y='136'/>
<rect height='2' width='1' y='140'/>
<rect height='2' width='1' y='144'/>
<rect height='2' width='1' y='148'/>
<rect height='2' width='1' y='152'/>
<rect height='2' width='1' y='156'/>
<rect height='2' width='1' y='160'/>
<rect height='2' width='1' y='164'/>
<rect height='2' width='1' y='168'/>
<rect height='2' width='1' y='172'/>
<rect height='2' width='1' y='176'/>
<rect height='2' width='1' y='180'/>
<rect height='2' width='1' y='184'/>
<rect height='2' width='1' y='188'/>
<rect height='2' width='1' y='192'/>
<rect height='2' width='1' y='196'/>
<rect height='2' width='1' y='200'/>
<rect height='2' width='1' y='204'/>
<rect height='2' width='1' y='208'/>
<rect height='2' width='1' y='212'/>
<rect height='2' width='1' y='216'/>
<rect height='2' width='1' y='220'/>
<rect height='2' width='1' y='224'/>
<rect height='2' width='1' y='228'/>
<rect height='2' width='1' y='232'/>
<rect height='2' width='1' y='236'/>
<rect height='2' width='1' y='240'/>
<rect height='2' width='1' y='244'/>
<rect height='2' width='1' y='248'/>
<rect height='2' width='1' y='252'/>
<rect height='2' width='1' y='256'/>
<rect height='2' width='1' y='260'/>
<rect height='2' width='1' y='264'/>
<rect height='2' width='1' y='268'/>
<rect height='2' width='1' y='272'/>
<rect height='2' width='1' y='276'/>
<rect height='2' width='1' y='280'/>
<rect height='2' width='1' y='284'/>
<rect height='2' width='1' y='288'/>
<rect height='2' width='1' y='292'/>
<rect height='2' width='1' y='296'/>
<rect height='2' width='1' y='300'/>
<rect height='2' width='1' y='304'/>
<rect height='2' width='1' y='308'/>
<rect height='2' width='1' y='312'/>
<rect height='2' width='1' y='316'/>
<rect height='2' width='1' y='320'/>
<rect height='2' width='1' y='324'/>
<rect height='2' width='1' y='328'/>
<rect height='2' width='1' y='332'/>
<rect height='2' width='1' y='336'/>
<rect height='2' width='1' y='340'/>
<rect height='2' width='1' y='344'/>
<rect height='2' width='1' y='348'/>
<rect height='2' width='1' y='352'/>
<rect height='2' width='1' y='356'/>
<rect height='2' width='1' y='360'/>
<rect height='2' width='1' y='364'/>
<rect height='2' width='1' y='368'/>
<rect height='2' width='1' y='372'/>
<rect height='2' width='1' y='376'/>
<rect height='2' width='1' y='380'/>
<rect height='2' width='1' y='384'/>
<rect height='2' width='1' y='388'/>
<rect height='2' width='1' y='392'/>
<rect height='2' width='1' y='396'/>
<rect height='2' width='1' y='400'/>
<rect height='2' width='1' y='404'/>
<rect height='2' width='1' y='408'/>
<rect height='2' width='1' y='412'/>
<rect height='2' width='1' y='416'/>
<rect height='2' width='1' y='420'/>
<rect height='2' width='1' y='424'/>
<rect height='2' width='1' y='428'/>
<rect height='2' width='1' y='432'/>
<rect height='2' width='1' y='436'/>
<rect height='2' width='1' y='440'/>
<rect height='2' width='1' y='444'/>
<rect height='2' width='1' y='448'/>
<rect height='2' width='1' y='452'/>
<rect height='2' width='1' y='456'/>
<rect height='2' width='1' y='460'/>
<rect height='2' width='1' y='464'/>
<rect height='2' width='1' y='468'/>
<rect height='2' width='1' y='472'/>
<rect height='2' width='1' y='476'/>
<rect height='2' width='1' y='480'/>
<rect height='2' width='1' y='484'/>
<rect height='2' width='1' y='488'/>
<rect height='2' width='1' y='492'/>
<rect height='2' width='1' y='496'/>
<rect height='2' width='1' y='500'/>
<rect height='2' width='1' y='504'/>
<rect height='2' width='1' y='508'/>
<rect height='2' width='1' y='512'/>
<rect height='2' width='1' y='516'/>
<rect height='2' width='1' y='520'/>
<rect height='2' width='1' y='524'/>
<rect height='2' width='1' y='528'/>
<rect height='2' width='1' y='532'/>
<rect height='2' width='1' y='536'/>
<rect height='2' width='1' y='540'/>
<rect height='2' width='1' y='544'/>
<rect height='2' width='1' y='548'/>
<rect height='2' width='1' y='552'/>
<rect height='2' width='1' y='556'/>
<rect height='2' width='1' y='560'/>
<rect height='2' width='1' y='564'/>
<rect height='2' width='1' y='568'/>
<rect height='2' width='1' y='572'/>
<rect height='2' width='1' y='576'/>
<rect height='2' width='1' y='580'/>
<rect height='2' width='1' y='584'/>
<rect height='2' width='1' y='588'/>
<rect height='2' width='1' y='592'/>
<rect height='2' width='1' y='596'/>
<rect height='2' width='1' y='600'/>
<rect height='2' width='1' y='604'/>
<rect height='2' width='1' y='608'/>
<rect height='2' width='1' y='612'/>
<rect height='2' width='1' y='616'/>
<rect height='2' width='1' y='620'/>
<rect height='2' width='1' y='624'/>
<rect height='2' width='1' y='628'/>
<rect height='2' width='1' y='632'/>
<rect height='2' width='1' y='636'/>
<rect height='2' width='1' y='640'/>
<rect height='2' width='1' y='644'/>
<rect height='2' width='1' y='648'/>
<rect height='2' width='1' y='652'/>
<rect height='2' width='1' y='656'/>
<rect height='2' width='1' y='660'/>
<rect height='2' width='1' y='664'/>
<rect height='2' width='1' y='668'/>
<rect height='2' width='1' y='672'/>
<rect height='2' width='1' y='676'/>
<rect height='2' width='1' y='680'/>
<rect height='2' width='1' y='684'/>
<rect height='2' width='1' y='688'/>
<rect height='2' width='1' y='692'/>
<rect height='2' width='1' y='696'/>
<rect height='2' width='1' y='700'/>
<rect height='2' width='1' y='704'/>
<rect height='2' width='1' y='708'/>
<rect height='2' width='1' y='712'/>
<rect height='2' width='1' y='716'/>
<rect height='2' width='1' y='720'/>
<rect height='2' width='1' y='724'/>
<rect height='2' width='1' y='728'/>
<rect height='2' width='1' y='732'/>
<rect height='2' width='1' y='736'/>
<rect height='2' width='1' y='740'/>
<rect height='2' width='1' y='744'/>
<rect height='2' width='1' y='748'/>
<rect height='2' width='1' y='752'/>
<rect height='2' width='1' y='756'/>
<rect height='2' width='1' y='760'/>
<rect height='2' width='1' y='764'/>
<rect height='2' width='1' y='768'/>
<rect height='2' width='1' y='772'/>
<rect height='2' width='1' y='776'/>
<rect height='2' width='1' y='780'/>
<rect height='2' width='1' y='784'/>
<rect height='2' width='1' y='788'/>
<rect height='2' width='1' y='792'/>
<rect height='2' width='1' y='796'/>
</g>
</g>
<g id='bullet' transform='translate(0, -20)'>
<path style='stroke:white; stroke-width:2; fill:none' d='M0.436,1.418C7.853-1.088,16.396,1.706,19.52,7.658c2.498,4.762-0.287,10.248-6.22,12.252c-4.747,1.604-10.215-0.184-12.213-3.993c-1.599-3.048,0.183-6.559,3.981-7.842c3.038-1.026,6.538,0.118,7.816,2.556 c1.024,1.951-0.117,4.198-2.547,5.019c-1.945,0.657-4.185-0.076-5.003-1.636c-0.655-1.248,0.075-2.686,1.63-3.212c1.245-0.42,2.678,0.048,3.202,1.047'/>
</g>
</defs>
<g id='slideBackground' class='slideBackground'>
<rect height='768' style='fill:black' width='1024' x='0' y='0'/>
<rect height='668' style='fill:url(#menuBarPaint)' width='210' x='0' y='100'/>
<rect height='100' style='fill:url(#slideBackgroundHeaderPaint)' width='1024' x='0' y='0'/>
<use xlink:href='#stripePattern' transform='scale(1024, 1)'/>
<rect height='5' style='fill:url(#slideTitleSeparatorPaint)' width='1024' x='0' y='100'/>
</g>
<g id='navigationGroup' style='fill:white' transform='translate(984, 45) scale(2, 2)'>
<polygon id='prevSlideControl' onclick='onPrevSlide(evt)' onmouseover="onSetFill(evt, 'prevSlideControl', 'rgb(176, 22, 40)')" points='1 10 10 0 1 -10 1 10' onmouseout="onSetFill(evt, 'prevSlideControl', 'white')" transform='rotate(180)'/>
<polygon id='nextSlideControl' onclick='onNextSlide(evt)' onmouseover="onSetFill(evt, 'nextSlideControl', 'rgb(176, 22, 40)')" points='1 10 10 0 1 -10 1 10' onmouseout="onSetFill(evt, 'nextSlideControl', 'white')"/>
</g>
<g id='slideMenu' transform='translate(15, 130)'>
<text onclick='onMenuItemSelected(evt, 1)' class='slidesetMenuHeader' x='0' y='0'>Background and Motivation</text>
<g style='visibility:visible'>
<rect height='5' id='Expand1' x='-10' y='-5' onclick="onExpand(evt, 'slideSetSubmenu1')" style='fill:white' width='5'/>
<rect height='5' id='Collapse1' x='-10' y='-5' onclick="onCollapse(evt, 'slideSetSubmenu1')" style='fill:red; visibility:hidden' width='5'>
<set fill='freeze' attributeType='CSS' attributeName='visibility' dur='0s' to='hidden' begin='Collapse1.click'/>
<set fill='freeze' attributeType='CSS' attributeName='visibility' dur='0s' to='visible' begin='Expand1.click'/>
</rect>
<set fill='freeze' attributeType='CSS' attributeName='visibility' dur='0s' to='visible' begin='Collapse1.click'/>
<set fill='freeze' attributeType='CSS' attributeName='visibility' dur='0s' to='hidden' begin='Expand1.click'/>
</g>
<g style='visibility:hidden' id='slideSetSubmenu1'>
<text id='slide1-1MenuItem' x='10' y='20' onmouseout="onHighlightMenuItem(evt, 'false', 'slide1-1MenuItem')" onclick='onMenuItemSelected(evt, 2)' onmouseover="onHighlightMenuItem(evt, 'true', 'slide1-1MenuItem')" class='slideMenuItem'>Why Yet Another Grap...</text>
</g>
<g transform='translate(0, 20)'>
<g>
<text onclick='onMenuItemSelected(evt, 3)' class='slidesetMenuHeader' x='0' y='0'>The ABCs of SVG</text>
<g style='visibility:visible'>
<rect height='5' id='Expand2' x='-10' y='-5' onclick="onExpand(evt, 'slideSetSubmenu2')" style='fill:white' width='5'/>
<rect height='5' id='Collapse2' x='-10' y='-5' onclick="onCollapse(evt, 'slideSetSubmenu2')" style='fill:red; visibility:hidden' width='5'>
<set fill='freeze' attributeType='CSS' attributeName='visibility' dur='0s' to='hidden' begin='Collapse2.click'/>
<set fill='freeze' attributeType='CSS' attributeName='visibility' dur='0s' to='visible' begin='Expand2.click'/>
</rect>
<set fill='freeze' attributeType='CSS' attributeName='visibility' dur='0s' to='visible' begin='Collapse2.click'/>
<set fill='freeze' attributeType='CSS' attributeName='visibility' dur='0s' to='hidden' begin='Expand2.click'/>
</g>
<g style='visibility:hidden' id='slideSetSubmenu2'>
<text id='slide2-1MenuItem' x='10' y='20' onmouseout="onHighlightMenuItem(evt, 'false', 'slide2-1MenuItem')" onclick='onMenuItemSelected(evt, 4)' onmouseover="onHighlightMenuItem(evt, 'true', 'slide2-1MenuItem')" class='slideMenuItem'>SVG Features</text>
<text id='slide2-2MenuItem' x='10' y='40' onmouseout="onHighlightMenuItem(evt, 'false', 'slide2-2MenuItem')" onclick='onMenuItemSelected(evt, 5)' onmouseover="onHighlightMenuItem(evt, 'true', 'slide2-2MenuItem')" class='slideMenuItem'>SVG Sample Source</text>
<text id='slide2-3MenuItem' x='10' y='60' onmouseout="onHighlightMenuItem(evt, 'false', 'slide2-3MenuItem')" onclick='onMenuItemSelected(evt, 6)' onmouseover="onHighlightMenuItem(evt, 'true', 'slide2-3MenuItem')" class='slideMenuItem'>SVG Sample Output</text>
</g>
<g transform='translate(0, 20)'>
<g>
<text onclick='onMenuItemSelected(evt, 7)' class='slidesetMenuHeader' x='0' y='0'>The SVG Community</text>
<g style='visibility:visible'>
<rect height='5' id='Expand3' x='-10' y='-5' onclick="onExpand(evt, 'slideSetSubmenu3')" style='fill:white' width='5'/>
<rect height='5' id='Collapse3' x='-10' y='-5' onclick="onCollapse(evt, 'slideSetSubmenu3')" style='fill:red; visibility:hidden' width='5'>
<set fill='freeze' attributeType='CSS' attributeName='visibility' dur='0s' to='hidden' begin='Collapse3.click'/>
<set fill='freeze' attributeType='CSS' attributeName='visibility' dur='0s' to='visible' begin='Expand3.click'/>
</rect>
<set fill='freeze' attributeType='CSS' attributeName='visibility' dur='0s' to='visible' begin='Collapse3.click'/>
<set fill='freeze' attributeType='CSS' attributeName='visibility' dur='0s' to='hidden' begin='Expand3.click'/>
</g>
<g style='visibility:hidden' id='slideSetSubmenu3'>
<text id='slide3-1MenuItem' x='10' y='20' onmouseout="onHighlightMenuItem(evt, 'false', 'slide3-1MenuItem')" onclick='onMenuItemSelected(evt, 8)' onmouseover="onHighlightMenuItem(evt, 'true', 'slide3-1MenuItem')" class='slideMenuItem'>Some SVG Resources</text>
<text id='slide3-2MenuItem' x='10' y='40' onmouseout="onHighlightMenuItem(evt, 'false', 'slide3-2MenuItem')" onclick='onMenuItemSelected(evt, 9)' onmouseover="onHighlightMenuItem(evt, 'true', 'slide3-2MenuItem')" class='slideMenuItem'>Quote Them on it</text>
</g>
<animateTransform fill='freeze' id='translator' type='translate' from='0, 0' dur='1s' accumulate='none' attributeName='transform' attributeType='XML' additive='replace' begin='Expand2.click' to='0, 60'/>
<animateTransform fill='freeze' id='translator2' type='translate' from='0, 0' dur='1s' accumulate='sum' attributeName='transform' attributeType='XML' additive='sum' begin='Collapse2.click' to='0, -60'/>
</g>
</g>
<animateTransform fill='freeze' id='translator' type='translate' from='0, 0' dur='1s' accumulate='none' attributeName='transform' attributeType='XML' additive='replace' begin='Expand1.click' to='0, 20'/>
<animateTransform fill='freeze' id='translator2' type='translate' from='0, 0' dur='1s' accumulate='sum' attributeName='transform' attributeType='XML' additive='sum' begin='Collapse1.click' to='0, -20'/>
</g>
</g>
</g>
<g onclick='onNextSlide(evt)' style='visibility:hidden' id='slideShowCover'>
<defs>
<linearGradient spreadMethod='pad' id='backgroundPaint' x1='0' y2='768' x2='0' y1='0' gradientUnits='userSpaceOnUse'>
<stop offset='0%' style='stop-color:black; stop-opacity:1;'/>
<stop offset='25%' style='stop-color:rgb(103, 103, 157); stop-opacity:1;'/>
<stop offset='50%' style='stop-color:white; stop-opacity:1;'/>
<stop offset='75%' style='stop-color:rgb(103, 103, 157); stop-opacity:1;'/>
<stop offset='100%' style='stop-color:black; stop-opacity:1;'/>
</linearGradient>
<filter height='105%' id='dropShadow' filterUnits='objectBoundingBox' x='0%' width='105%' y='0%'>
<feGaussianBlur in='SourceAlpha' result='blur' stdDeviation='4'/>
<feOffset dy='4' dx='4' result='offsetBlur' in='blur'/>
<feFlood style='flood-color:black' result='solidBlack'/>
<feComposite in='solidBlack' in2='SourceAlpha' result='separation' operator='in'/>
<feOffset dy='-1' dx='-1' result='offsetSeparation' in='separation'/>
<feMerge>
<feMergeNode in='offsetBlur'/>
<feMergeNode in='offsetSeparation'/>
<feMergeNode in='SourceGraphic'/>
</feMerge>
</filter>
</defs>
<rect height='768' style='fill:url(#backgroundPaint)' width='1024'/>
<use xlink:href='#stripePattern' transform='scale(1024, 1)'/>
<g style='filter:url(#dropShadow)'>
<text class='slideCoverTitle' style='text-anchor:middle' x='512' y='300'>Introduction to SVG</text>
<g transform='translate(512, 490)' id='metadata' style='text-anchor:middle;'>
<text x='0' class='slideCoverSubTitle' y='0'>Uche Ogbuji</text>
<text x='0' class='slideCoverSubTitle' y='50'>Principal Consultant</text>
<text x='0' class='slideCoverSubTitle' y='100'>Fourthought Inc.</text>
<text x='0' class='slideCoverSubTitle' y='150'>Front Range XML Keiretsu</text>
</g>
</g>
</g>
<g onclick='onNextSlide(evt)' style='visibility:hidden' id='slidesetCover1'>
<rect height='768' style='fill:black' width='1024' x='0' y='0'/>
<rect height='768' style='fill:url(#menuBarPaint)' width='210' x='0' y='0'/>
<g transform='scale(210, 1)'>
<use xlink:href='#stripePattern'/>
</g>
<text x='240' class='slidesetCoverTitle' y='200'>Background and Motivation</text>
</g>
<g onclick='onNextSlide(evt)' style='visibility:hidden' id='slidesetCover2'>
<rect height='768' style='fill:black' width='1024' x='0' y='0'/>
<rect height='768' style='fill:url(#menuBarPaint)' width='210' x='0' y='0'/>
<g transform='scale(210, 1)'>
<use xlink:href='#stripePattern'/>
</g>
<text x='240' class='slidesetCoverTitle' y='200'>The ABCs of SVG</text>
</g>
<g onclick='onNextSlide(evt)' style='visibility:hidden' id='slidesetCover3'>
<rect height='768' style='fill:black' width='1024' x='0' y='0'/>
<rect height='768' style='fill:url(#menuBarPaint)' width='210' x='0' y='0'/>
<g transform='scale(210, 1)'>
<use xlink:href='#stripePattern'/>
</g>
<text x='240' class='slidesetCoverTitle' y='200'>The SVG Community</text>
</g>
<g id='slide1-1' style='visibility:hidden' class='slide'>
<text class='slideTitle' x='30' y='60'>Why Yet Another Graphics Format?</text>
<g><text x="240" y="150" class="itemClass">Leveraging the existing XML technology base</text></g>
<g><text x="240" y="185" class="itemClass">Integrating graphics into the semantic Web</text></g>
<g><text x="240" y="220" class="itemClass">Giving browsers access to image <tspan class='emphasis'>internals</tspan></text></g>
<g><text x="240" y="255" class="itemClass">Supporting the next generation of browsers</text></g>
</g>
<g id='slide2-1' style='visibility:hidden' class='slide'>
<text class='slideTitle' x='30' y='60'>SVG Features</text>
<text x='240' class='headingInline' y='150'>Basic Features</text>
<use class='listBullet' xlink:href='#bullet' x='240' y='185'/>
<g><text x="270" y="185" class="itemClass">Coordinate spaces and transforms</text></g>
<use class='listBullet' xlink:href='#bullet' x='240' y='220'/>
<g><text x="270" y="220" class="itemClass">Graphics primitives: ellipses, polygons, polylines, curves, etc.</text></g>
<use class='listBullet' xlink:href='#bullet' x='240' y='255'/>
<g><text x="270" y="255" class="itemClass">Stylesheets: CSS, XSL, etc.</text></g>
<text x='240' class='headingInline' y='290'>Advanced Features</text>
<use class='listBullet' xlink:href='#bullet' x='240' y='325'/>
<g><text x="270" y="325" class="itemClass">Raster filter effects</text></g>
<use class='listBullet' xlink:href='#bullet' x='240' y='360'/>
<g><text x="270" y="360" class="itemClass">Alpha masking</text></g>
<use class='listBullet' xlink:href='#bullet' x='240' y='395'/>
<g><text x="270" y="395" class="itemClass">Animation</text></g>
<use class='listBullet' xlink:href='#bullet' x='240' y='430'/>
<g><text x="270" y="430" class="itemClass">Zooming and Panning</text></g>
<use class='listBullet' xlink:href='#bullet' x='240' y='465'/>
<g><text x="270" y="465" class="itemClass">Scripting and extensibility</text></g>
</g>
<g id='slide2-2' style='visibility:hidden' class='slide'>
<text class='slideTitle' x='30' y='60'>SVG Sample Source</text>
<text x='240' class='preformattedInline' y='135'>
<?xml version="1.0"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20000802//EN"
"http://www.w3.org/TR/2000/CR-SVG-20000802/DTD/svg-20000802.dtd"
>
<svg width="800" height="800">
<desc>SVG Sample for SunWorld Article</desc>
<style type="text/css">
.Lagos { fill: white; stroke: green; stroke-width: 30 }
.ViaAppia { fill: none; stroke: black; stroke-width: 10 }
.OrthoLogos { font-size: 32; font-family: helvetica }
</style>
<ellipse transform="translate(500 200)" rx="250" ry="100"
style="fill: brown; stroke: yellow; stroke-width: 10"/>
<polygon transform="translate(100 200) rotate(45)"
class="Lagos"
points="350,75 379,161 469,161 397,215 423,301 350,250 277,
301 303,215 231,161 321,161"/>
<text class="OrthoLogos" x="400" y="400">TO KALON</text>
<path class="ViaAppia" d="M500,600 C500,500 650,500 650,600
S800,700 800,600"/>
</svg>
</text>
</g>
<g id='slide2-3' style='visibility:hidden' class='slide'>
<text class='slideTitle' x='30' y='60'>SVG Sample Output</text>
<g transform='translate(240, 135)'>
<svg height='10cm' width='10cm' viewBox='0 0 200 200'>
<desc>SVG Sample for SunWorld Article</desc>
<style type='text/css'>
.Lagos { fill: white; stroke: green; stroke-width: 30 }
.ViaAppia { fill: none; stroke: white; stroke-width: 10 }
.OrthoLogos { font-size: 32; font-family: helvetica; fill:white }
</style>
<ellipse transform='translate(500 200)' ry='100' rx='250' style='fill: brown; stroke: yellow; stroke-width: 10'/>
<polygon points='350,75 379,161 469,161 397,215 423,301 350,250 277, 301 303,215 231,161 321,161' transform='translate(100 200) rotate(45)' class='Lagos'/>
<text class='OrthoLogos' x='400' y='400'>TO KALON</text>
<path class='ViaAppia' d='M500,600 C500,500 650,500 650,600 S800,700 800,600'/>
</svg>
</g>
</g>
<g id='slide3-1' style='visibility:hidden' class='slide'>
<text class='slideTitle' x='30' y='60'>Some SVG Resources</text>
<g><text x="240" y="150" class="itemClass"><tspan class='linkStyle'>The W3C's SVG Page</tspan></text></g>
<g><text x="240" y="185" class="itemClass"><tspan class='linkStyle'>OpenDirectory SVG Links</tspan></text></g>
<g><text x="240" y="220" class="itemClass"><tspan class='linkStyle'>How to make slides like these</tspan></text></g>
</g>
<g id='slide3-2' style='visibility:hidden' class='slide'>
<text class='slideTitle' x='30' y='60'>Quote Them on it</text>
<text x='240' class='paraInline' y='150'>"Over twenty organizations, including Sun Microsystems, Adobe, Apple, IBM, and Kodak, have been involved in defining SVG."<tspan class='emphasis'> -- Vincent J. Hardy, Sun</tspan>
</text>
<text x='240' class='paraInline' y='185'>"I have been working with computer graphics for
over 25 years and split an immense amount of blood on the floor at
midnight. With SVG I can now do almost anything I want [except for 3D - in
which I also have a molecular interest]. And I suspect that I can stick
with it for the foreseeable future." <tspan class='emphasis'>-- Peter Murray-Rust, XML-DEV Founder</tspan>
</text>
<text x='240' class='paraInline' y='220'>"I envision a day where we have XHTML Web pages with SVG as the "chrome" of our interfaces--defining the buttons, the layers, the coloring, and the grid--where we can actually use a language that's XML-based rather than theses separate GIF files that can take so long to download. That's certainly one vision; that vision not just extending on the Web, on a monitor, but wireless onto my Palm Pilot or to print and other output as well." <tspan class='emphasis'>-- Steve Mulder, Razorfish</tspan>
</text>
</g>
</svg>"""
#"'
expected_1="""
<svg/>"""
def Test(tester):
tester.startTest("Checking for SVG stylesheets")
try:
import urllib
for uri in (sheet_1_uri, sheet_2_uri, sheet_3_uri):
fd = urllib.urlopen(uri)
fd.close()
tester.testDone()
except (IOError, OSError):
tester.warning(
"You must have 'svgslides.xsl', 'svgslides_custom.xsl' and\n"
"'slidescript.xsl' from Sun's SVG toolkit to run this test.\n"
"See http://www.sun.com/software/xml/developers/svg-slidetoolkit/\n"
"or ftp://ftp.fourthought.com/pub/third-party/test-material/\n"
"It's enough to copy *.xsl from that package to the\n"
"'%s' directory." % os.path.dirname(__file__))
tester.testDone()
else:
source = test_harness.FileInfo(uri=source_1_uri)
sheet = test_harness.FileInfo(uri=sheet_1_uri)
test_harness.XsltTest(tester, source, [sheet], expected_1)
return
| 51.010234 | 541 | 0.567367 | 4,516 | 34,891 | 4.376439 | 0.176262 | 0.109796 | 0.111314 | 0.161911 | 0.592795 | 0.547308 | 0.345679 | 0.322506 | 0.298877 | 0.265483 | 0 | 0.090256 | 0.238514 | 34,891 | 683 | 542 | 51.084919 | 0.653619 | 0.001777 | 0 | 0.177066 | 0 | 0.155143 | 0.976971 | 0.211078 | 0 | 0 | 0 | 0 | 0 | 1 | 0.001686 | false | 0 | 0.005059 | 0 | 0.008432 | 0.001686 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
426b013c87350379997d161bc0ecdefe4dd2b27e | 19,353 | py | Python | src/robotide/ui/treenodehandlers.py | crylearner/RIDE3X | 767f45b0c908f18ecc7473208def8dc7489f43b0 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2017-08-20T14:46:02.000Z | 2017-08-20T14:46:02.000Z | src/robotide/ui/treenodehandlers.py | crylearner/RIDE3X | 767f45b0c908f18ecc7473208def8dc7489f43b0 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/robotide/ui/treenodehandlers.py | crylearner/RIDE3X | 767f45b0c908f18ecc7473208def8dc7489f43b0 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright 2008-2015 Nokia Solutions and Networks
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import wx
from robotide.controller.commands import (
RenameKeywordOccurrences, RemoveMacro, AddKeyword, AddTestCase, RenameTest,
CopyMacroAs, AddVariable, UpdateVariableName, RenameFile,
RenameResourceFile, DeleteFile, SortKeywords, Include, Exclude)
from robotide.controller.settingcontrollers import VariableController
from robotide.controller.macrocontrollers import (
TestCaseController, UserKeywordController)
from robotide.controller.filecontrollers import (
TestDataDirectoryController, ResourceFileController,
TestCaseFileController, ExcludedDirectoryController,
DirtyRobotDataException)
from robotide.editor.editordialogs import (
TestCaseNameDialog, UserKeywordNameDialog, ScalarVariableDialog,
ListVariableDialog, CopyUserKeywordDialog, DictionaryVariableDialog)
from robotide.publish import RideOpenVariableDialog
from robotide.ui.progress import LoadProgressObserver
from robotide.usages.UsageRunner import Usages, ResourceFileUsages
from .filedialogs import (
AddSuiteDialog, AddDirectoryDialog, ChangeFormatDialog, NewResourceDialog,
RobotFilePathDialog)
from robotide.utils import overrides
from robotide.widgets import PopupMenuItems
from .progress import RenameProgressObserver
from .resourcedialogs import ResourceRenameDialog, ResourceDeleteDialog
from robotide.ui.resourcedialogs import FolderDeleteDialog
def action_handler_class(controller):
return {
TestDataDirectoryController: TestDataDirectoryHandler,
ResourceFileController: ResourceFileHandler,
TestCaseFileController: TestCaseFileHandler,
TestCaseController: TestCaseHandler,
UserKeywordController: UserKeywordHandler,
VariableController: VariableHandler,
ExcludedDirectoryController: ExcludedDirectoryHandler
}[controller.__class__]
class _ActionHandler(wx.Window):
is_user_keyword = False
is_test_suite = False
is_variable = False
_label_add_suite = 'New Suite\tCtrl-Shift-F'
_label_add_directory = 'New Directory'
_label_new_test_case = 'New Test Case\tCtrl-Shift-T'
_label_new_user_keyword = 'New User Keyword\tCtrl-Shift-K'
_label_sort_keywords = 'Sort Keywords'
_label_new_scalar = 'New Scalar\tCtrl-Shift-V'
_label_new_list_variable = 'New List Variable\tCtrl-Shift-L'
_label_new_dict_variable = 'New Dictionary Variable'
_label_change_format = 'Change Format'
_label_copy_macro = 'Copy\tCtrl-Shift-C'
_label_rename = 'Rename\tF2'
_label_add_resource = 'Add Resource'
_label_new_resource = 'New Resource'
_label_find_usages = 'Find Usages'
_label_select_all = 'Select All Tests'
_label_deselect_all = 'Deselect All Tests'
_label_select_failed_tests = 'Select Only Failed Tests'
_label_select_passed_tests = 'Select Only Passed Tests'
_label_delete = 'Delete\tCtrl-Shift-D'
_label_delete_no_kbsc = 'Delete'
_label_exclude = 'Exclude'
_label_include = 'Include'
_label_expand_all = 'Expand all'
_label_collapse_all = 'Collapse all'
def __init__(self, controller, tree, node, settings):
wx.Window.__init__(self, tree)
self.controller = controller
self._tree = tree
self._node = node
self._settings = settings
self._rendered = False
self.Show(False)
self._popup_creator = tree._popup_creator
@property
def item(self):
return self.controller.data
@property
def node(self):
return self._node
def show_popup(self):
self._popup_creator.show(self, PopupMenuItems(self, self._actions),
self.controller)
def begin_label_edit(self):
return False
def double_clicked(self):
pass
def end_label_edit(self, event):
pass
def OnDelete(self, event):
pass
def OnNewSuite(self, event):
pass
def OnNewDirectory(self, event):
pass
def OnNewResource(self, event):
pass
def OnNewUserKeyword(self, event):
pass
def OnNewTestCase(self, event):
pass
def OnNewScalar(self, event):
pass
def OnNewListVariable(self, event):
pass
def OnNewDictionaryVariable(self, event):
pass
def OnCopy(self, event):
pass
def OnFindUsages(self, event):
pass
def OnSelectAllTests(self, event):
self._tree.SelectAllTests(self._node)
def OnDeselectAllTests(self, event):
self._tree.DeselectAllTests(self._node)
def OnSelectOnlyFailedTests(self, event):
self._tree.SelectFailedTests(self._node)
def OnSelectOnlyPassedTests(self, event):
self._tree.SelectPassedTests(self._node)
def OnSafeDelete(self, event):
pass
def OnExclude(self, event):
pass
def OnInclude(self, event):
pass
class _CanBeRenamed(object):
def OnRename(self, event):
self._tree.label_editor.OnLabelEdit()
def begin_label_edit(self):
def label_edit():
# FIXME: yep.yep.yep.yep.yep
node = self._tree._controller.find_node_by_controller(
self.controller)
if node:
self._tree.EditLabel(node)
# Must handle pending events before label edit
# This is a fix for situations where there is a pending action
# that will change this label (Text Editor all changing actions)
wx.CallAfter(label_edit)
return True
def end_label_edit(self, event):
if not event.IsEditCancelled():
if self._is_valid_rename(event.GetLabel()):
self.rename(event.GetLabel())
else:
event.Veto()
def _is_valid_rename(self, label):
validation = self.controller.validate_name(label)
if validation.error_message:
self._show_validation_error(validation.error_message)
return False
return True
def _show_validation_error(self, err_msg):
wx.MessageBox(err_msg, 'Validation Error', style=wx.ICON_ERROR)
class DirectoryHandler(_ActionHandler):
is_draggable = False
is_test_suite = False
can_be_rendered = False
_actions = [_ActionHandler._label_new_resource]
def OnNewResource(self, event):
NewResourceDialog(self.controller, self._settings).execute()
class TestDataHandler(_ActionHandler):
accepts_drag = lambda self, dragged: \
(isinstance(dragged, UserKeywordHandler) or
isinstance(dragged, VariableHandler))
is_draggable = False
is_test_suite = True
@property
def tests(self):
return self.controller.tests
@property
def keywords(self):
return self.controller.keywords
@property
def variables(self):
return self.controller.variables
def has_been_modified_on_disk(self):
return self.item.has_been_modified_on_disk()
def do_drop(self, item):
self.controller.add_test_or_keyword(item)
def rename(self, new_name):
return False
def OnSortKeywords(self, event):
"""Sorts the keywords inside the treenode"""
self.controller.execute(SortKeywords())
@property
def can_be_rendered(self):
if not self._has_children():
return False
return not self._rendered
def _has_children(self):
return (self.item.keyword_table or self.item.testcase_table or
self.item.variable_table)
def set_rendered(self):
self._rendered = True
def OnChangeFormat(self, event):
ChangeFormatDialog(self.controller).execute()
def OnNewUserKeyword(self, event):
dlg = UserKeywordNameDialog(self.controller)
if dlg.ShowModal() == wx.ID_OK:
self.controller.execute(AddKeyword(dlg.get_name(), dlg.get_args()))
dlg.Destroy()
def OnNewScalar(self, event):
self._new_var(ScalarVariableDialog)
def OnNewListVariable(self, event):
class FakePlugin(object):
global_settings = self._settings
self._new_var(ListVariableDialog, plugin=FakePlugin())
def OnNewDictionaryVariable(self, event):
class FakePlugin(object):
global_settings = self._settings
self._new_var(DictionaryVariableDialog, plugin=FakePlugin())
def _new_var(self, dialog_class, plugin=None):
dlg = dialog_class(self._var_controller, plugin=plugin)
if dlg.ShowModal() == wx.ID_OK:
name, value = dlg.get_value()
comment = dlg.get_comment()
self.controller.execute(AddVariable(name, value, comment))
@property
def _var_controller(self):
return self.controller.datafile_controller.variables
class TestDataDirectoryHandler(TestDataHandler):
def __init__(self, *args):
TestDataHandler.__init__(self, *args)
self._actions = [
_ActionHandler._label_add_suite,
_ActionHandler._label_add_directory,
_ActionHandler._label_new_resource,
'---',
_ActionHandler._label_new_user_keyword,
_ActionHandler._label_new_scalar,
_ActionHandler._label_new_list_variable,
_ActionHandler._label_new_dict_variable,
'---',
_ActionHandler._label_change_format
]
if self.controller.parent:
self._actions.extend([_ActionHandler._label_delete_no_kbsc])
self._actions.extend([
'---',
_ActionHandler._label_select_all,
_ActionHandler._label_deselect_all,
_ActionHandler._label_select_failed_tests,
_ActionHandler._label_select_passed_tests
])
if self.controller.parent:
self._actions.extend(['---',
_ActionHandler._label_exclude])
self._actions.extend(['---',
_ActionHandler._label_expand_all,
_ActionHandler._label_collapse_all])
def OnExpandAll(self, event):
self._tree.ExpandAllSubNodes(self._node)
def OnCollapseAll(self, event):
self._tree.CollapseAllSubNodes(self._node)
def OnNewSuite(self, event):
AddSuiteDialog(self.controller, self._settings).execute()
def OnNewDirectory(self, event):
AddDirectoryDialog(self.controller, self._settings).execute()
def OnNewResource(self, event):
NewResourceDialog(self.controller, self._settings).execute()
def OnDelete(self, event):
FolderDeleteDialog(self.controller).execute()
def OnExclude(self, event):
try:
self.controller.execute(Exclude())
except DirtyRobotDataException:
wx.MessageBox('Directory contains unsaved data!\n'
'You must save data before excluding.')
class _FileHandlerThanCanBeRenamed(_CanBeRenamed):
@overrides(_CanBeRenamed)
def begin_label_edit(self):
self._old_label = self._node.GetText()
self._set_node_label(self.controller.basename)
return _CanBeRenamed.begin_label_edit(self)
@overrides(_CanBeRenamed)
def end_label_edit(self, event):
if not event.IsEditCancelled():
result = self.controller.execute(
self._rename_command(event.GetLabel()))
if result:
self._rename_ok_handler()
self._old_label = self.controller.basename
else:
event.Veto()
else:
self._set_node_label(self._old_label)
def _rename_ok_handler(self):
pass
def _rename_command(self, label):
raise NotImplementedError(self.__class__)
def _set_node_label(self, label):
self._tree.SetItemText(self._node, label)
class ResourceFileHandler(_FileHandlerThanCanBeRenamed, TestDataHandler):
is_test_suite = False
_actions = [_ActionHandler._label_new_user_keyword,
_ActionHandler._label_new_scalar,
_ActionHandler._label_new_list_variable,
_ActionHandler._label_new_dict_variable,
'---',
_ActionHandler._label_rename,
_ActionHandler._label_change_format,
_ActionHandler._label_sort_keywords,
_ActionHandler._label_find_usages,
_ActionHandler._label_delete]
def OnFindUsages(self, event):
ResourceFileUsages(self.controller, self._tree.highlight).show()
def OnDelete(self, event):
ResourceDeleteDialog(self.controller).execute()
def OnSafeDelete(self, event):
return self.OnDelete(event)
@overrides(_FileHandlerThanCanBeRenamed)
def _rename_command(self, label):
return RenameResourceFile(
label, self._check_should_rename_static_imports)
def _check_should_rename_static_imports(self):
return ResourceRenameDialog(self.controller).execute()
class TestCaseFileHandler(_FileHandlerThanCanBeRenamed, TestDataHandler):
accepts_drag = lambda *args: True
_actions = [_ActionHandler._label_new_test_case,
_ActionHandler._label_new_user_keyword,
_ActionHandler._label_new_scalar,
_ActionHandler._label_new_list_variable,
_ActionHandler._label_new_dict_variable,
'---',
_ActionHandler._label_rename,
_ActionHandler._label_change_format,
_ActionHandler._label_sort_keywords,
_ActionHandler._label_delete,
'---',
_ActionHandler._label_select_all,
_ActionHandler._label_deselect_all,
_ActionHandler._label_select_failed_tests,
_ActionHandler._label_select_passed_tests
]
def OnNewTestCase(self, event):
dlg = TestCaseNameDialog(self.controller)
if dlg.ShowModal() == wx.ID_OK:
self.controller.execute(AddTestCase(dlg.get_name()))
dlg.Destroy()
def OnDelete(self, event):
if wx.MessageBox('Delete test case file', caption='Confirm',
style=wx.YES_NO | wx.ICON_QUESTION) == wx.YES:
self.controller.execute(DeleteFile())
def OnSafeDelete(self, event):
return self.OnDelete(event)
@overrides(_FileHandlerThanCanBeRenamed)
def _rename_command(self, label):
return RenameFile(label)
@overrides(_FileHandlerThanCanBeRenamed)
def _rename_ok_handler(self):
self._tree.DeselectAllTests(self._node)
class _TestOrUserKeywordHandler(_CanBeRenamed, _ActionHandler):
accepts_drag = lambda *args: False
is_draggable = True
_actions = [
_ActionHandler._label_copy_macro, 'Move Up\tCtrl-Up',
'Move Down\tCtrl-Down', _ActionHandler._label_rename, '---', 'Delete'
]
def remove(self):
self.controller.delete()
def rename(self, new_name):
self.controller.execute(self._create_rename_command(new_name))
def OnCopy(self, event):
dlg = self._copy_name_dialog_class(self.controller, self.item)
if dlg.ShowModal() == wx.ID_OK:
self.controller.execute(CopyMacroAs(dlg.get_name()))
dlg.Destroy()
def OnMoveUp(self, event):
if self.controller.move_up():
self._tree.move_up(self._node)
def OnMoveDown(self, event):
if self.controller.move_down():
self._tree.move_down(self._node)
def OnDelete(self, event):
self.controller.execute(RemoveMacro(self.controller))
class TestCaseHandler(_TestOrUserKeywordHandler):
_datalist = property(lambda self: self.item.datalist)
_copy_name_dialog_class = TestCaseNameDialog
def _add_copy_to_tree(self, parent_node, copied):
self._tree.add_test(parent_node, copied)
def _create_rename_command(self, new_name):
return RenameTest(new_name)
class UserKeywordHandler(_TestOrUserKeywordHandler):
is_user_keyword = True
_datalist = property(lambda self: self.item.datalist)
_copy_name_dialog_class = CopyUserKeywordDialog
_actions = _TestOrUserKeywordHandler._actions + [
_ActionHandler._label_find_usages]
def _add_copy_to_tree(self, parent_node, copied):
self._tree.add_keyword(parent_node, copied)
def _create_rename_command(self, new_name):
return RenameKeywordOccurrences(
self.controller.name, new_name,
RenameProgressObserver(self.GetParent().GetParent()),
self.controller.info)
def OnFindUsages(self, event):
Usages(self.controller, self._tree.highlight).show()
class VariableHandler(_CanBeRenamed, _ActionHandler):
accepts_drag = lambda *args: False
is_draggable = True
is_variable = True
OnMoveUp = OnMoveDown = lambda *args: None
_actions = [_ActionHandler._label_rename, 'Delete']
@overrides(_ActionHandler)
def double_clicked(self):
RideOpenVariableDialog(controller=self.controller).publish()
def OnDelete(self, event):
self.remove()
def remove(self):
self.controller.delete()
def rename(self, new_name):
self.controller.execute(UpdateVariableName(new_name))
@property
def index(self):
return self.controller.index
class ResourceRootHandler(_ActionHandler):
can_be_rendered = is_draggable = is_user_keyword = is_test_suite = False
rename = lambda self, new_name: False
accepts_drag = lambda self, dragged: False
_actions = [_ActionHandler._label_add_resource]
@property
def item(self):
return None
def OnAddResource(self, event):
path = RobotFilePathDialog(
self, self.controller, self._settings).execute()
if path:
self.controller.load_resource(path, LoadProgressObserver(self))
class ExcludedDirectoryHandler(TestDataDirectoryHandler):
is_draggable = False
is_test_suite = True
def __init__(self, *args):
TestDataHandler.__init__(self, *args)
self._actions = [_ActionHandler._label_include]
def OnInclude(self, event):
self.controller.execute(Include())
| 33.598958 | 80 | 0.661965 | 1,931 | 19,353 | 6.321077 | 0.18436 | 0.058496 | 0.027527 | 0.018352 | 0.291988 | 0.23341 | 0.207439 | 0.20236 | 0.20236 | 0.189661 | 0 | 0.000906 | 0.258565 | 19,353 | 575 | 81 | 33.657391 | 0.849746 | 0.042164 | 0 | 0.410673 | 0 | 0 | 0.033055 | 0.002397 | 0 | 0 | 0 | 0.001739 | 0 | 1 | 0.215777 | false | 0.051044 | 0.039443 | 0.046404 | 0.49652 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
428b1f1d92a691f7e032bddbf0f11e16a416cdf3 | 186 | py | Python | syncgateway/__init__.py | ecordell/syncgateway-admin-client | 78a8d45ff290b42b5c771b901fb92edcde126ff4 | [
"MIT"
] | null | null | null | syncgateway/__init__.py | ecordell/syncgateway-admin-client | 78a8d45ff290b42b5c771b901fb92edcde126ff4 | [
"MIT"
] | 1 | 2015-12-10T20:42:12.000Z | 2015-12-10T20:42:12.000Z | syncgateway/__init__.py | ecordell/syncgateway-admin-client | 78a8d45ff290b42b5c771b901fb92edcde126ff4 | [
"MIT"
] | null | null | null | __author__ = 'Evan Cordell'
__copyright__ = 'Copyright 2012-2015 Localmed, Inc.'
__version__ = "0.1.6"
__version_info__ = tuple(__version__.split('.'))
__short_version__ = __version__
| 23.25 | 52 | 0.758065 | 21 | 186 | 5.285714 | 0.761905 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.066667 | 0.112903 | 186 | 7 | 53 | 26.571429 | 0.606061 | 0 | 0 | 0 | 0 | 0 | 0.27957 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
428e40b791a018156767a64f9f6283399ebd2b1c | 289 | py | Python | tests/test_update.py | sosie-js/ankisync2 | a41580197eab7f180f02a38a4aa912eb54cfaa93 | [
"MIT"
] | 39 | 2020-02-12T23:41:24.000Z | 2022-02-28T15:46:23.000Z | tests/test_update.py | sosie-js/ankisync2 | a41580197eab7f180f02a38a4aa912eb54cfaa93 | [
"MIT"
] | 9 | 2019-08-02T18:25:07.000Z | 2022-02-07T23:14:43.000Z | tests/test_update.py | sosie-js/ankisync2 | a41580197eab7f180f02a38a4aa912eb54cfaa93 | [
"MIT"
] | 6 | 2019-09-09T14:27:48.000Z | 2021-08-31T08:13:00.000Z | # from ankisync2.apkg import Apkg, db
# Has to be done through normal database methods
# def test_update():
# apkg = Apkg("example1.apkg")
# for n in db.Notes.filter(db.Notes.data["field1"] == "data1"):
# n.data["field3"] = "data2"
# n.save()
# apkg.close()
| 24.083333 | 67 | 0.598616 | 40 | 289 | 4.3 | 0.725 | 0.081395 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.027149 | 0.235294 | 289 | 11 | 68 | 26.272727 | 0.751131 | 0.930796 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
42ab6fa034b5730a8c76b4b76e6056f1b558984c | 687 | py | Python | problems/slidingwindow/Solution1100.py | akalu/cs-problems-python | 9b1bd8e3932be62135a38a77f955ded9a766b654 | [
"MIT"
] | null | null | null | problems/slidingwindow/Solution1100.py | akalu/cs-problems-python | 9b1bd8e3932be62135a38a77f955ded9a766b654 | [
"MIT"
] | null | null | null | problems/slidingwindow/Solution1100.py | akalu/cs-problems-python | 9b1bd8e3932be62135a38a77f955ded9a766b654 | [
"MIT"
] | null | null | null | """
Sliding window
Given a string S, return the number of substrings of length K with no
repeated characters.
Example 1:
Input: S = "havefunonleetcode", K = 5 Output: 6 Explanation: There are 6
substrings they are : 'havef','avefu','vefun','efuno','etcod','tcode'.
counter havefunonleetcode
IDEA:
1) for each letter in the string setup a counter and
2) update unique counter each time when counter[let] hits 0, 1 or 2 (magic numbers)
aaabac
|||
123
0) a:3 unique=0
1) a:2 b:1 unique=1
2) a:2 b:1 unique=1
3) a:2 b:1 c:1 unique=1+2=3
"""
class Solution1100:
pass
| 18.078947 | 86 | 0.58952 | 105 | 687 | 3.857143 | 0.580952 | 0.014815 | 0.022222 | 0.02963 | 0.054321 | 0.054321 | 0 | 0 | 0 | 0 | 0 | 0.072187 | 0.31441 | 687 | 37 | 87 | 18.567568 | 0.787686 | 0.796215 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.5 | 0 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
35ef2ec3e738f6a7d680ddbb0d8cfed8a80181c4 | 384 | py | Python | blazer/hpc/local/__init__.py | radiantone/blazer | 4f369729a72a397a5a472f081002bf24cf22b69c | [
"CC0-1.0"
] | 4 | 2022-02-11T13:37:03.000Z | 2022-02-26T00:25:13.000Z | blazer/hpc/local/__init__.py | radiantone/blazer | 4f369729a72a397a5a472f081002bf24cf22b69c | [
"CC0-1.0"
] | null | null | null | blazer/hpc/local/__init__.py | radiantone/blazer | 4f369729a72a397a5a472f081002bf24cf22b69c | [
"CC0-1.0"
] | null | null | null | from functools import partial
from pipe import select, where
from pydash import chunk
from pydash import filter_ as filter
from pydash import flatten, get, omit
from .primitives import parallel, pipeline, scatter
__all__ = (
"parallel",
"scatter",
"pipeline",
"partial",
"select",
"where",
"flatten",
"chunk",
"omit",
"get",
"filter",
)
| 16.695652 | 51 | 0.648438 | 43 | 384 | 5.674419 | 0.44186 | 0.122951 | 0.196721 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.242188 | 384 | 22 | 52 | 17.454545 | 0.838488 | 0 | 0 | 0 | 0 | 0 | 0.171875 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.315789 | 0 | 0.315789 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
c403737a02fdcf7c798629d6151ff7c1e4a813cf | 913 | py | Python | ryu/gui/views/topology.py | uiuc-srg/ryu | 2a597f812270ea9690269a20bf659f334c323eb6 | [
"Apache-2.0"
] | 269 | 2015-03-08T11:32:45.000Z | 2022-03-30T11:18:16.000Z | ryu/gui/views/topology.py | uiuc-srg/ryu | 2a597f812270ea9690269a20bf659f334c323eb6 | [
"Apache-2.0"
] | 4 | 2017-03-07T11:51:24.000Z | 2020-07-07T20:13:55.000Z | ryu/gui/views/topology.py | uiuc-srg/ryu | 2a597f812270ea9690269a20bf659f334c323eb6 | [
"Apache-2.0"
] | 205 | 2015-01-13T04:52:25.000Z | 2022-03-30T13:37:33.000Z | # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
#
# 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 flask import render_template, request
import view_base
class IndexView(view_base.ViewBase):
def __init__(self):
super(IndexView, self).__init__()
def run(self):
host, port = request.host.split(':')
return render_template('topology.html', host=host, port=port)
| 33.814815 | 69 | 0.739321 | 132 | 913 | 5.022727 | 0.666667 | 0.090498 | 0.039216 | 0.048265 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.010652 | 0.177437 | 913 | 26 | 70 | 35.115385 | 0.87217 | 0.638554 | 0 | 0 | 0 | 0 | 0.044444 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0 | 0.75 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
c40b63017932ee0022e50a1cd077dafbac537066 | 4,610 | py | Python | 19/network.py | jcsesznegi/advent-of-code-2017 | 9710e184e092b82aa798076b9ce3915c6e42758d | [
"MIT"
] | 1 | 2020-04-12T17:54:52.000Z | 2020-04-12T17:54:52.000Z | 19/network.py | jcsesznegi/advent-of-code-2017 | 9710e184e092b82aa798076b9ce3915c6e42758d | [
"MIT"
] | null | null | null | 19/network.py | jcsesznegi/advent-of-code-2017 | 9710e184e092b82aa798076b9ce3915c6e42758d | [
"MIT"
] | null | null | null | from pprint import pprint
from enum import Enum
class Direction(Enum):
UP = 'up'
DOWN = 'down'
LEFT = 'left'
RIGHT = 'right'
class Network:
def __init__(self, diagramRows):
self.diagram = self.setDiagram(diagramRows)
self.currentPosition = self.setCurrentPosition()
self.currentDirection = Direction.DOWN
self.route = []
self.steps = 1
def setDiagram(self, diagramRows):
splitRows = []
for diagramRow in diagramRows:
splitRows.append(list(diagramRow))
return splitRows
def setCurrentPosition(self):
startIndex = self.diagram[0].index('|')
return (startIndex, 0)
def getTraveledRoute(self):
return ''.join(self.route)
def getTraveledSteps(self):
return self.steps
def getForwardPosition(self):
if self.currentDirection == Direction.UP:
return (self.currentPosition[0], self.currentPosition[1] - 1)
elif self.currentDirection == Direction.DOWN:
return (self.currentPosition[0], self.currentPosition[1] + 1)
elif self.currentDirection == Direction.LEFT:
return (self.currentPosition[0] - 1, self.currentPosition[1])
elif self.currentDirection == Direction.RIGHT:
return (self.currentPosition[0] + 1, self.currentPosition[1])
def getLeftPosition(self):
if self.currentDirection == Direction.UP:
return (self.currentPosition[0] - 1, self.currentPosition[1])
elif self.currentDirection == Direction.DOWN:
return (self.currentPosition[0] + 1, self.currentPosition[1])
elif self.currentDirection == Direction.LEFT:
return (self.currentPosition[0], self.currentPosition[1] + 1)
elif self.currentDirection == Direction.RIGHT:
return (self.currentPosition[0], self.currentPosition[1] - 1)
def getRightPosition(self):
if self.currentDirection == Direction.UP:
return (self.currentPosition[0] + 1, self.currentPosition[1])
elif self.currentDirection == Direction.DOWN:
return (self.currentPosition[0] - 1, self.currentPosition[1])
elif self.currentDirection == Direction.LEFT:
return (self.currentPosition[0], self.currentPosition[1] - 1)
elif self.currentDirection == Direction.RIGHT:
return (self.currentPosition[0], self.currentPosition[1] + 1)
def positionExists(self, position):
return (position[1] > 0
and position[1] < len(self.diagram)
and position[0] > 0
and position[0] < len(self.diagram[position[1]])
and self.diagram[position[1]][position[0]] is not ' ')
def changeDirectionLeft(self):
if self.currentDirection == Direction.UP:
self.currentDirection = Direction.LEFT
elif self.currentDirection == Direction.DOWN:
self.currentDirection = Direction.RIGHT
elif self.currentDirection == Direction.LEFT:
self.currentDirection = Direction.DOWN
elif self.currentDirection == Direction.RIGHT:
self.currentDirection = Direction.UP
def changeDirectionRight(self):
if self.currentDirection == Direction.UP:
self.currentDirection = Direction.RIGHT
elif self.currentDirection == Direction.DOWN:
self.currentDirection = Direction.LEFT
elif self.currentDirection == Direction.LEFT:
self.currentDirection = Direction.UP
elif self.currentDirection == Direction.RIGHT:
self.currentDirection = Direction.DOWN
def getNextPosition(self):
nextPosition = self.getForwardPosition()
if self.positionExists(nextPosition):
return nextPosition
nextPosition = self.getLeftPosition()
if self.positionExists(nextPosition):
self.changeDirectionLeft()
return nextPosition
nextPosition = self.getRightPosition()
if self.positionExists(nextPosition):
self.changeDirectionRight()
return nextPosition
return False
def run(self):
hasNextPosition = True
while hasNextPosition:
nextPosition = self.getNextPosition()
if not nextPosition:
hasNextPosition = False
else:
self.currentPosition = nextPosition
self.steps += 1
character = self.diagram[nextPosition[1]][nextPosition[0]]
if character.isalpha():
self.route.append(character)
| 37.786885 | 74 | 0.632972 | 432 | 4,610 | 6.74537 | 0.136574 | 0.199039 | 0.288607 | 0.16987 | 0.574468 | 0.537062 | 0.537062 | 0.537062 | 0.387097 | 0.341798 | 0 | 0.015156 | 0.270065 | 4,610 | 121 | 75 | 38.099174 | 0.850817 | 0 | 0 | 0.460784 | 0 | 0 | 0.003688 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.127451 | false | 0 | 0.019608 | 0.029412 | 0.411765 | 0.009804 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
c412a68b17b363d84e8cdaf62f22ff38191fc6e5 | 335 | py | Python | pymarl/envs/__init__.py | twoodford/pymarl | c78e63e54ed772171fbcaea6c55c703cff0e9302 | [
"Apache-2.0"
] | null | null | null | pymarl/envs/__init__.py | twoodford/pymarl | c78e63e54ed772171fbcaea6c55c703cff0e9302 | [
"Apache-2.0"
] | null | null | null | pymarl/envs/__init__.py | twoodford/pymarl | c78e63e54ed772171fbcaea6c55c703cff0e9302 | [
"Apache-2.0"
] | null | null | null | from functools import partial
from .multiagentenv import MultiAgentEnv
import sys
import os
def env_fn(env, **kwargs) -> MultiAgentEnv:
return env(**kwargs)
REGISTRY = {}
#REGISTRY["sc2"] = partial(env_fn, env=StarCraft2Env)
def register_env(nm, env_class):
global REGISTRY
REGISTRY[nm] = partial(env_fn, env=env_class)
| 22.333333 | 53 | 0.740299 | 45 | 335 | 5.377778 | 0.422222 | 0.061983 | 0.099174 | 0.123967 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007018 | 0.149254 | 335 | 14 | 54 | 23.928571 | 0.842105 | 0.155224 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.4 | 0.1 | 0.7 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
c4184af48713ebd40a957015c82bc531d4f8d4b7 | 3,601 | py | Python | apps/1d/mhd/shock_tube/this_app_params.py | dcseal/finess | 766e583ae9e84480640c7c3b3c157bf40ab87fe4 | [
"BSD-3-Clause"
] | null | null | null | apps/1d/mhd/shock_tube/this_app_params.py | dcseal/finess | 766e583ae9e84480640c7c3b3c157bf40ab87fe4 | [
"BSD-3-Clause"
] | null | null | null | apps/1d/mhd/shock_tube/this_app_params.py | dcseal/finess | 766e583ae9e84480640c7c3b3c157bf40ab87fe4 | [
"BSD-3-Clause"
] | null | null | null | #section [initial]
def _parameters_accessors_checks():
from finess.params import Parameter, Accessor, Check, \
CheckGreaterEqual, CheckGreaterThan, \
CheckOneOf, EnumParameterType
parameters = []
checks = []
rhol = Parameter(variable_name = "rhol",
section = "initial",
name = "rhol",
type_ = "double")
parameters.append(rhol)
checks.append(CheckGreaterThan(rhol, 0.0))
unl = Parameter(variable_name = "unl",
section = "initial",
name = "unl",
type_ = "double")
parameters.append(unl)
utl = Parameter(variable_name = "utl",
section = "initial",
name = "utl",
type_ = "double")
parameters.append(utl)
u3l = Parameter(variable_name = "u3l",
section = "initial",
name = "u3l",
type_ = "double")
parameters.append(u3l)
pl = Parameter(variable_name = "pl",
section = "initial",
name = "pl",
type_ = "double")
parameters.append(pl)
checks.append(CheckGreaterThan(pl, 0.0))
Bnl = Parameter(variable_name = "Bnl",
section = "initial",
name = "Bnl",
type_ = "double")
parameters.append(Bnl)
Btl = Parameter(variable_name = "Btl",
section = "initial",
name = "Btl",
type_ = "double")
parameters.append(Btl)
B3l = Parameter(variable_name = "B3l",
section = "initial",
name = "B3l",
type_ = "double")
parameters.append(B3l)
rhor = Parameter(variable_name = "rhor",
section = "initial",
name = "rhor",
type_ = "double")
parameters.append(rhor)
checks.append(CheckGreaterThan(rhor, 0.0))
unr = Parameter(variable_name = "unr",
section = "initial",
name = "unr",
type_ = "double")
parameters.append(unr)
utr = Parameter(variable_name = "utr",
section = "initial",
name = "utr",
type_ = "double")
parameters.append(utr)
u3r = Parameter(variable_name = "u3r",
section = "initial",
name = "u3r",
type_ = "double")
parameters.append(u3r)
pr = Parameter(variable_name = "pr",
section = "initial",
name = "pr",
type_ = "double")
parameters.append(pr)
checks.append(CheckGreaterThan(pr, 0.0))
Bnr = Parameter(variable_name = "Bnr",
section = "initial",
name = "Bnr",
type_ = "double")
parameters.append(Bnr)
Btr = Parameter(variable_name = "Btr",
section = "initial",
name = "Btr",
type_ = "double")
parameters.append(Btr)
B3r = Parameter(variable_name = "B3r",
section = "initial",
name = "B3r",
type_ = "double")
parameters.append(B3r)
return parameters, map(Accessor, parameters), checks
parameter_list, accessor_list, check_list = \
_parameters_accessors_checks()
| 31.587719 | 68 | 0.463482 | 282 | 3,601 | 5.77305 | 0.148936 | 0.146192 | 0.206388 | 0.255528 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011622 | 0.426548 | 3,601 | 113 | 69 | 31.867257 | 0.776755 | 0.004721 | 0 | 0.344086 | 0 | 0 | 0.084869 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.010753 | false | 0 | 0.010753 | 0 | 0.032258 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
c41b88fc454a463ac7213753efc46174f0522ef0 | 12,745 | py | Python | futu/common/pb/Qot_GetPriceReminder_pb2.py | Hason-Cheung/py-futu-api | caa2f136ee07a2b123c79b2d75bbb524d7873e53 | [
"Apache-2.0"
] | 858 | 2018-11-12T12:54:56.000Z | 2022-03-10T17:35:43.000Z | futu/common/pb/Qot_GetPriceReminder_pb2.py | EricChengg/hongkong-futu-user-investment-report-generater | d450260a107f9e053036c31b05b8290b7b22c237 | [
"Apache-2.0"
] | 113 | 2018-11-12T01:52:31.000Z | 2022-02-27T03:53:07.000Z | futu/common/pb/Qot_GetPriceReminder_pb2.py | EricChengg/hongkong-futu-user-investment-report-generater | d450260a107f9e053036c31b05b8290b7b22c237 | [
"Apache-2.0"
] | 201 | 2018-11-19T08:32:45.000Z | 2022-03-23T06:39:02.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: Qot_GetPriceReminder.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
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
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
import Common_pb2 as Common__pb2
import Qot_Common_pb2 as Qot__Common__pb2
DESCRIPTOR = _descriptor.FileDescriptor(
name='Qot_GetPriceReminder.proto',
package='Qot_GetPriceReminder',
syntax='proto2',
serialized_pb=_b('\n\x1aQot_GetPriceReminder.proto\x12\x14Qot_GetPriceReminder\x1a\x0c\x43ommon.proto\x1a\x10Qot_Common.proto\"k\n\x11PriceReminderItem\x12\x0b\n\x03key\x18\x01 \x02(\x03\x12\x0c\n\x04type\x18\x02 \x02(\x05\x12\r\n\x05value\x18\x03 \x02(\x01\x12\x0c\n\x04note\x18\x04 \x02(\t\x12\x0c\n\x04\x66req\x18\x05 \x02(\x05\x12\x10\n\x08isEnable\x18\x06 \x02(\x08\"r\n\rPriceReminder\x12&\n\x08security\x18\x01 \x02(\x0b\x32\x14.Qot_Common.Security\x12\x39\n\x08itemList\x18\x02 \x03(\x0b\x32\'.Qot_GetPriceReminder.PriceReminderItem\"=\n\x03\x43\x32S\x12&\n\x08security\x18\x01 \x01(\x0b\x32\x14.Qot_Common.Security\x12\x0e\n\x06market\x18\x02 \x01(\x05\"E\n\x03S2C\x12>\n\x11priceReminderList\x18\x01 \x03(\x0b\x32#.Qot_GetPriceReminder.PriceReminder\"1\n\x07Request\x12&\n\x03\x63\x32s\x18\x01 \x02(\x0b\x32\x19.Qot_GetPriceReminder.C2S\"j\n\x08Response\x12\x15\n\x07retType\x18\x01 \x02(\x05:\x04-400\x12\x0e\n\x06retMsg\x18\x02 \x01(\t\x12\x0f\n\x07\x65rrCode\x18\x03 \x01(\x05\x12&\n\x03s2c\x18\x04 \x01(\x0b\x32\x19.Qot_GetPriceReminder.S2CBJ\n\x13\x63om.futu.openapi.pbZ3github.com/futuopen/ftapi4go/pb/qotgetpricereminder')
,
dependencies=[Common__pb2.DESCRIPTOR,Qot__Common__pb2.DESCRIPTOR,])
_PRICEREMINDERITEM = _descriptor.Descriptor(
name='PriceReminderItem',
full_name='Qot_GetPriceReminder.PriceReminderItem',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='key', full_name='Qot_GetPriceReminder.PriceReminderItem.key', index=0,
number=1, type=3, cpp_type=2, label=2,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='type', full_name='Qot_GetPriceReminder.PriceReminderItem.type', index=1,
number=2, type=5, cpp_type=1, label=2,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='value', full_name='Qot_GetPriceReminder.PriceReminderItem.value', index=2,
number=3, type=1, cpp_type=5, label=2,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='note', full_name='Qot_GetPriceReminder.PriceReminderItem.note', index=3,
number=4, type=9, cpp_type=9, label=2,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='freq', full_name='Qot_GetPriceReminder.PriceReminderItem.freq', index=4,
number=5, type=5, cpp_type=1, label=2,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='isEnable', full_name='Qot_GetPriceReminder.PriceReminderItem.isEnable', index=5,
number=6, type=8, cpp_type=7, label=2,
has_default_value=False, default_value=False,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=84,
serialized_end=191,
)
_PRICEREMINDER = _descriptor.Descriptor(
name='PriceReminder',
full_name='Qot_GetPriceReminder.PriceReminder',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='security', full_name='Qot_GetPriceReminder.PriceReminder.security', index=0,
number=1, type=11, cpp_type=10, label=2,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='itemList', full_name='Qot_GetPriceReminder.PriceReminder.itemList', index=1,
number=2, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=193,
serialized_end=307,
)
_C2S = _descriptor.Descriptor(
name='C2S',
full_name='Qot_GetPriceReminder.C2S',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='security', full_name='Qot_GetPriceReminder.C2S.security', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='market', full_name='Qot_GetPriceReminder.C2S.market', index=1,
number=2, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=309,
serialized_end=370,
)
_S2C = _descriptor.Descriptor(
name='S2C',
full_name='Qot_GetPriceReminder.S2C',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='priceReminderList', full_name='Qot_GetPriceReminder.S2C.priceReminderList', index=0,
number=1, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=372,
serialized_end=441,
)
_REQUEST = _descriptor.Descriptor(
name='Request',
full_name='Qot_GetPriceReminder.Request',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='c2s', full_name='Qot_GetPriceReminder.Request.c2s', index=0,
number=1, type=11, cpp_type=10, label=2,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=443,
serialized_end=492,
)
_RESPONSE = _descriptor.Descriptor(
name='Response',
full_name='Qot_GetPriceReminder.Response',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='retType', full_name='Qot_GetPriceReminder.Response.retType', index=0,
number=1, type=5, cpp_type=1, label=2,
has_default_value=True, default_value=-400,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='retMsg', full_name='Qot_GetPriceReminder.Response.retMsg', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='errCode', full_name='Qot_GetPriceReminder.Response.errCode', index=2,
number=3, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='s2c', full_name='Qot_GetPriceReminder.Response.s2c', index=3,
number=4, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=494,
serialized_end=600,
)
_PRICEREMINDER.fields_by_name['security'].message_type = Qot__Common__pb2._SECURITY
_PRICEREMINDER.fields_by_name['itemList'].message_type = _PRICEREMINDERITEM
_C2S.fields_by_name['security'].message_type = Qot__Common__pb2._SECURITY
_S2C.fields_by_name['priceReminderList'].message_type = _PRICEREMINDER
_REQUEST.fields_by_name['c2s'].message_type = _C2S
_RESPONSE.fields_by_name['s2c'].message_type = _S2C
DESCRIPTOR.message_types_by_name['PriceReminderItem'] = _PRICEREMINDERITEM
DESCRIPTOR.message_types_by_name['PriceReminder'] = _PRICEREMINDER
DESCRIPTOR.message_types_by_name['C2S'] = _C2S
DESCRIPTOR.message_types_by_name['S2C'] = _S2C
DESCRIPTOR.message_types_by_name['Request'] = _REQUEST
DESCRIPTOR.message_types_by_name['Response'] = _RESPONSE
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
PriceReminderItem = _reflection.GeneratedProtocolMessageType('PriceReminderItem', (_message.Message,), dict(
DESCRIPTOR = _PRICEREMINDERITEM,
__module__ = 'Qot_GetPriceReminder_pb2'
# @@protoc_insertion_point(class_scope:Qot_GetPriceReminder.PriceReminderItem)
))
_sym_db.RegisterMessage(PriceReminderItem)
PriceReminder = _reflection.GeneratedProtocolMessageType('PriceReminder', (_message.Message,), dict(
DESCRIPTOR = _PRICEREMINDER,
__module__ = 'Qot_GetPriceReminder_pb2'
# @@protoc_insertion_point(class_scope:Qot_GetPriceReminder.PriceReminder)
))
_sym_db.RegisterMessage(PriceReminder)
C2S = _reflection.GeneratedProtocolMessageType('C2S', (_message.Message,), dict(
DESCRIPTOR = _C2S,
__module__ = 'Qot_GetPriceReminder_pb2'
# @@protoc_insertion_point(class_scope:Qot_GetPriceReminder.C2S)
))
_sym_db.RegisterMessage(C2S)
S2C = _reflection.GeneratedProtocolMessageType('S2C', (_message.Message,), dict(
DESCRIPTOR = _S2C,
__module__ = 'Qot_GetPriceReminder_pb2'
# @@protoc_insertion_point(class_scope:Qot_GetPriceReminder.S2C)
))
_sym_db.RegisterMessage(S2C)
Request = _reflection.GeneratedProtocolMessageType('Request', (_message.Message,), dict(
DESCRIPTOR = _REQUEST,
__module__ = 'Qot_GetPriceReminder_pb2'
# @@protoc_insertion_point(class_scope:Qot_GetPriceReminder.Request)
))
_sym_db.RegisterMessage(Request)
Response = _reflection.GeneratedProtocolMessageType('Response', (_message.Message,), dict(
DESCRIPTOR = _RESPONSE,
__module__ = 'Qot_GetPriceReminder_pb2'
# @@protoc_insertion_point(class_scope:Qot_GetPriceReminder.Response)
))
_sym_db.RegisterMessage(Response)
DESCRIPTOR.has_options = True
DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n\023com.futu.openapi.pbZ3github.com/futuopen/ftapi4go/pb/qotgetpricereminder'))
# @@protoc_insertion_point(module_scope)
| 36.83526 | 1,141 | 0.748764 | 1,583 | 12,745 | 5.732786 | 0.123184 | 0.047603 | 0.058292 | 0.065455 | 0.671625 | 0.54854 | 0.524738 | 0.518347 | 0.495207 | 0.495207 | 0 | 0.04194 | 0.126324 | 12,745 | 345 | 1,142 | 36.942029 | 0.773058 | 0.045116 | 0 | 0.614379 | 1 | 0.009804 | 0.174439 | 0.14039 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.026144 | 0 | 0.026144 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
c42f5f63c17465e80eb4449fa0bfca6ef5e47655 | 948 | py | Python | hqq_tool/rongcloud/demo.py | yaoruda/DRFLearning | 6b17ef0d557142e8563d80788351f8b7ab94f248 | [
"MIT"
] | 1 | 2018-09-21T09:42:02.000Z | 2018-09-21T09:42:02.000Z | hqq_tool/rongcloud/demo.py | yaoruda/DRFLearning | 6b17ef0d557142e8563d80788351f8b7ab94f248 | [
"MIT"
] | null | null | null | hqq_tool/rongcloud/demo.py | yaoruda/DRFLearning | 6b17ef0d557142e8563d80788351f8b7ab94f248 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# __author__= "Ruda"
# Date: 2018/10/16
'''
import os
from rongcloud import RongCloud
app_key = os.environ['APP_KEY']
app_secret = os.environ['APP_SECRET']
rcloud = RongCloud(app_key, app_secret)
r = rcloud.User.getToken(userId='userid1', name='username', portraitUri='http://www.rongcloud.cn/images/logo.png')
print(r)
{'token': 'P9YNVZ2cMQwwaADiNDVrtRZKF+J2pVPOWSNlYMA1yA1g49pxjZs58n4FEufsH9XMCHTk6nHR6unQTuRgD8ZS/nlbkcv6ll4x', 'userId': 'userid1', 'code': 200}
r = rcloud.Message.publishPrivate(
fromUserId='userId1',
toUserId={"userId2","userid3","userId4"},
objectName='RC:VcMsg',
content='{"content":"hello","extra":"helloExtra","duration":20}',
pushContent='thisisapush',
pushData='{"pushData":"hello"}',
count='4',
verifyBlacklist='0',
isPersisted='0',
isCounted='0')
print(r)
{'code': 200}
'''
'''
More:
https://github.com/rongcloud/server-sdk-python
''' | 27.085714 | 143 | 0.679325 | 104 | 948 | 6.096154 | 0.682692 | 0.028391 | 0.047319 | 0.047319 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.051995 | 0.127637 | 948 | 35 | 144 | 27.085714 | 0.714631 | 0.918776 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
c4606fc8327fb668e73c4a4c899e2f956318eefb | 563 | py | Python | yxf_utils/jsonx.py | yanyaming/yxf_utils | c1e1f7012f089374088210e55a953548b3c4da8b | [
"MIT"
] | null | null | null | yxf_utils/jsonx.py | yanyaming/yxf_utils | c1e1f7012f089374088210e55a953548b3c4da8b | [
"MIT"
] | null | null | null | yxf_utils/jsonx.py | yanyaming/yxf_utils | c1e1f7012f089374088210e55a953548b3c4da8b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
通用json处理接口
"""
import json
# 输入单引号为边界的类json字符串(内部可能还有双引号),返回单引号为边界的python字典or列表对象。
def singleQuoteJsonStr_to_PythonObj(strr):
jsonObj = eval(strr) # 不能用内置函数解析。只能模拟执行。
return jsonObj # dict or list
# 输入完全正规的json字符串(键-值边界为双引号),返回单引号为边界的python字典or列表对象。
def jsonStr_to_PythonObj(strr):
jsonObj = json.loads(strr)
return jsonObj # dict or list
# 输入python列表或字典(边界为单引号的类json对象),返回边界为双引号的json字符串且双引号加斜杠转义。
def pythonObj_to_jsonStr(obj):
jsonStr = json.dumps(obj)
return jsonStr # str
| 20.851852 | 58 | 0.735346 | 61 | 563 | 6.688525 | 0.606557 | 0.127451 | 0.073529 | 0.107843 | 0.112745 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004202 | 0.154529 | 563 | 26 | 59 | 21.653846 | 0.852941 | 0.468917 | 0 | 0.2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.3 | false | 0 | 0.1 | 0 | 0.7 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
c46ae74020d50b1e15aaa99acf255cf154208cb8 | 251 | pyw | Python | client.pyw | thatfuckingbird/hydrus-websocket-server | b55454740dca5101448bf92224432f8bdbec7e77 | [
"WTFPL"
] | 1,417 | 2015-01-22T00:50:30.000Z | 2022-03-30T18:44:55.000Z | client.pyw | thatfuckingbird/hydrus-websocket-server | b55454740dca5101448bf92224432f8bdbec7e77 | [
"WTFPL"
] | 975 | 2015-01-05T01:41:40.000Z | 2022-03-31T06:01:50.000Z | client.pyw | thatfuckingbird/hydrus-websocket-server | b55454740dca5101448bf92224432f8bdbec7e77 | [
"WTFPL"
] | 163 | 2015-02-04T13:09:35.000Z | 2022-03-23T01:00:05.000Z | #!/usr/bin/env python3
# Hydrus is released under WTFPL
# You just DO WHAT THE FUCK YOU WANT TO.
# https://github.com/sirkris/WTFPL/blob/master/WTFPL.md
from hydrus import hydrus_client
if __name__ == '__main__':
hydrus_client.boot()
| 19.307692 | 55 | 0.709163 | 38 | 251 | 4.421053 | 0.815789 | 0.142857 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004878 | 0.183267 | 251 | 12 | 56 | 20.916667 | 0.814634 | 0.577689 | 0 | 0 | 0 | 0 | 0.078431 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.333333 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
c46bcfd7797c21307852fe37265fa68fac0dbbc3 | 570 | py | Python | plugins/session_list/views.py | farazkhanfk7/ajenti | ff51635bea0d29bf9f35dd7912f145398040541d | [
"MIT"
] | 1 | 2021-04-27T07:16:01.000Z | 2021-04-27T07:16:01.000Z | plugins/session_list/views.py | farazkhanfk7/ajenti | ff51635bea0d29bf9f35dd7912f145398040541d | [
"MIT"
] | null | null | null | plugins/session_list/views.py | farazkhanfk7/ajenti | ff51635bea0d29bf9f35dd7912f145398040541d | [
"MIT"
] | null | null | null | from jadi import component
from aj.api.http import url, HttpPlugin
from aj.auth import authorize
from aj.api.endpoint import endpoint, EndpointError
import aj
import gevent
@component(HttpPlugin)
class Handler(HttpPlugin):
def __init__(self, context):
self.context = context
@url(r'/api/session_list/list')
@endpoint(api=True)
def handle_api_list_sessions(self, http_context):
if http_context.method == 'GET':
self.context.worker.update_sessionlist()
gevent.sleep(1)
return aj.sessions
| 25.909091 | 53 | 0.687719 | 72 | 570 | 5.291667 | 0.486111 | 0.047244 | 0.047244 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002262 | 0.224561 | 570 | 21 | 54 | 27.142857 | 0.859729 | 0 | 0 | 0 | 0 | 0 | 0.04386 | 0.038596 | 0 | 0 | 0 | 0 | 0 | 1 | 0.117647 | false | 0 | 0.352941 | 0 | 0.588235 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
c475cdfc5c22b9c5d0eee35b59b44abcb5b1b364 | 1,027 | py | Python | arachnado/rpc/sites.py | wigginzz/arachnado | 8de92625262958e886263b4ccb189f4fc62d7400 | [
"MIT"
] | 2 | 2017-12-26T14:50:14.000Z | 2018-06-12T07:04:08.000Z | arachnado/rpc/sites.py | wigginzz/arachnado | 8de92625262958e886263b4ccb189f4fc62d7400 | [
"MIT"
] | null | null | null | arachnado/rpc/sites.py | wigginzz/arachnado | 8de92625262958e886263b4ccb189f4fc62d7400 | [
"MIT"
] | null | null | null | import logging
from functools import partial
from arachnado.storages.mongotail import MongoTailStorage
class Sites(object):
""" 'Known sites' object exposed via JSON-RPC """
logger = logging.getLogger(__name__)
def __init__(self, handler, site_storage, **kwargs):
self.handler = handler
self.storage = site_storage # type: MongoTailStorage
def list(self):
return self.storage.fetch()
def post(self, site):
self.storage.create(site)
def patch(self, site):
self.storage.update(site)
def delete(self, site):
self.storage.delete(site)
def subscribe(self):
for event_name in self.storage.available_events:
self.storage.subscribe(
event_name,
partial(self._publish, event=event_name)
)
def _on_close(self):
self.storage.unsubscribe(self.storage.available_events)
def _publish(self, event, data):
self.handler.write_event('sites.{}'.format(event), data)
| 26.333333 | 64 | 0.650438 | 119 | 1,027 | 5.445378 | 0.411765 | 0.152778 | 0.055556 | 0.087963 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.246349 | 1,027 | 38 | 65 | 27.026316 | 0.837209 | 0.064265 | 0 | 0 | 0 | 0 | 0.008386 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.307692 | false | 0 | 0.115385 | 0.038462 | 0.538462 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
c47eb0be6f206f7a309aab7d8baf760825081212 | 19,781 | py | Python | src/ui/ui_hw_recovery_wdg.py | frosted97/dash-masternode-tool | d824740309ab878d745e41d39f274e952111542f | [
"MIT"
] | 75 | 2017-03-20T06:33:14.000Z | 2022-02-15T16:16:45.000Z | src/ui/ui_hw_recovery_wdg.py | frosted97/dash-masternode-tool | d824740309ab878d745e41d39f274e952111542f | [
"MIT"
] | 42 | 2017-10-25T06:34:54.000Z | 2022-02-10T20:53:46.000Z | src/ui/ui_hw_recovery_wdg.py | frosted97/dash-masternode-tool | d824740309ab878d745e41d39f274e952111542f | [
"MIT"
] | 98 | 2017-03-20T05:27:36.000Z | 2022-03-20T05:03:08.000Z | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file ui_hw_recovery_wdg.ui
#
# Created by: PyQt5 UI code generator
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_WdgRecoverHw(object):
def setupUi(self, WdgRecoverHw):
WdgRecoverHw.setObjectName("WdgRecoverHw")
WdgRecoverHw.resize(587, 352)
self.verticalLayout_4 = QtWidgets.QVBoxLayout(WdgRecoverHw)
self.verticalLayout_4.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_4.setSpacing(6)
self.verticalLayout_4.setObjectName("verticalLayout_4")
self.pages = QtWidgets.QStackedWidget(WdgRecoverHw)
self.pages.setObjectName("pages")
self.page0 = QtWidgets.QWidget()
self.page0.setObjectName("page0")
self.verticalLayout = QtWidgets.QVBoxLayout(self.page0)
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
self.verticalLayout.setSpacing(6)
self.verticalLayout.setObjectName("verticalLayout")
self.label_2 = QtWidgets.QLabel(self.page0)
self.label_2.setObjectName("label_2")
self.verticalLayout.addWidget(self.label_2)
self.gbSeedSource = QtWidgets.QGroupBox(self.page0)
self.gbSeedSource.setTitle("")
self.gbSeedSource.setFlat(False)
self.gbSeedSource.setObjectName("gbSeedSource")
self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.gbSeedSource)
self.verticalLayout_5.setContentsMargins(6, 6, 6, 6)
self.verticalLayout_5.setSpacing(8)
self.verticalLayout_5.setObjectName("verticalLayout_5")
self.rbSeedSourceHwScreen = QtWidgets.QRadioButton(self.gbSeedSource)
self.rbSeedSourceHwScreen.setChecked(False)
self.rbSeedSourceHwScreen.setObjectName("rbSeedSourceHwScreen")
self.verticalLayout_5.addWidget(self.rbSeedSourceHwScreen)
self.rbSeedSourceAppWords = QtWidgets.QRadioButton(self.gbSeedSource)
self.rbSeedSourceAppWords.setChecked(False)
self.rbSeedSourceAppWords.setObjectName("rbSeedSourceAppWords")
self.verticalLayout_5.addWidget(self.rbSeedSourceAppWords)
self.rbSeedSourceAppEntropy = QtWidgets.QRadioButton(self.gbSeedSource)
self.rbSeedSourceAppEntropy.setObjectName("rbSeedSourceAppEntropy")
self.verticalLayout_5.addWidget(self.rbSeedSourceAppEntropy)
self.verticalLayout.addWidget(self.gbSeedSource)
self.lblActionTypeMessage = QtWidgets.QLabel(self.page0)
self.lblActionTypeMessage.setWordWrap(True)
self.lblActionTypeMessage.setObjectName("lblActionTypeMessage")
self.verticalLayout.addWidget(self.lblActionTypeMessage)
spacerItem = QtWidgets.QSpacerItem(20, 288, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout.addItem(spacerItem)
self.pages.addWidget(self.page0)
self.page1 = QtWidgets.QWidget()
self.page1.setObjectName("page1")
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.page1)
self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_2.setSpacing(6)
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.label = QtWidgets.QLabel(self.page1)
self.label.setObjectName("label")
self.verticalLayout_2.addWidget(self.label)
self.gbNumberOfMnemonicWords = QtWidgets.QGroupBox(self.page1)
self.gbNumberOfMnemonicWords.setTitle("")
self.gbNumberOfMnemonicWords.setObjectName("gbNumberOfMnemonicWords")
self.verticalLayout_8 = QtWidgets.QVBoxLayout(self.gbNumberOfMnemonicWords)
self.verticalLayout_8.setContentsMargins(6, 6, 6, 6)
self.verticalLayout_8.setSpacing(8)
self.verticalLayout_8.setObjectName("verticalLayout_8")
self.rbWordsCount24 = QtWidgets.QRadioButton(self.gbNumberOfMnemonicWords)
self.rbWordsCount24.setChecked(True)
self.rbWordsCount24.setObjectName("rbWordsCount24")
self.verticalLayout_8.addWidget(self.rbWordsCount24)
self.rbWordsCount18 = QtWidgets.QRadioButton(self.gbNumberOfMnemonicWords)
self.rbWordsCount18.setObjectName("rbWordsCount18")
self.verticalLayout_8.addWidget(self.rbWordsCount18)
self.rbWordsCount12 = QtWidgets.QRadioButton(self.gbNumberOfMnemonicWords)
self.rbWordsCount12.setObjectName("rbWordsCount12")
self.verticalLayout_8.addWidget(self.rbWordsCount12)
self.verticalLayout_2.addWidget(self.gbNumberOfMnemonicWords)
self.lblPage1Message = QtWidgets.QLabel(self.page1)
self.lblPage1Message.setText("")
self.lblPage1Message.setWordWrap(True)
self.lblPage1Message.setObjectName("lblPage1Message")
self.verticalLayout_2.addWidget(self.lblPage1Message)
spacerItem1 = QtWidgets.QSpacerItem(20, 310, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout_2.addItem(spacerItem1)
self.pages.addWidget(self.page1)
self.page2 = QtWidgets.QWidget()
self.page2.setObjectName("page2")
self.verticalLayout_6 = QtWidgets.QVBoxLayout(self.page2)
self.verticalLayout_6.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_6.setSpacing(6)
self.verticalLayout_6.setObjectName("verticalLayout_6")
self.lblStep1HexEntropy = QtWidgets.QLabel(self.page2)
self.lblStep1HexEntropy.setObjectName("lblStep1HexEntropy")
self.verticalLayout_6.addWidget(self.lblStep1HexEntropy)
self.edtHexEntropy = QtWidgets.QLineEdit(self.page2)
self.edtHexEntropy.setObjectName("edtHexEntropy")
self.verticalLayout_6.addWidget(self.edtHexEntropy)
spacerItem2 = QtWidgets.QSpacerItem(20, 365, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout_6.addItem(spacerItem2)
self.pages.addWidget(self.page2)
self.page3 = QtWidgets.QWidget()
self.page3.setObjectName("page3")
self.verticalLayout_7 = QtWidgets.QVBoxLayout(self.page3)
self.verticalLayout_7.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_7.setSpacing(6)
self.verticalLayout_7.setObjectName("verticalLayout_7")
self.lblStepWordListTitle = QtWidgets.QLabel(self.page3)
self.lblStepWordListTitle.setWordWrap(True)
self.lblStepWordListTitle.setOpenExternalLinks(True)
self.lblStepWordListTitle.setObjectName("lblStepWordListTitle")
self.verticalLayout_7.addWidget(self.lblStepWordListTitle)
self.pages.addWidget(self.page3)
self.page4 = QtWidgets.QWidget()
self.page4.setObjectName("page4")
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.page4)
self.verticalLayout_3.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_3.setSpacing(6)
self.verticalLayout_3.setObjectName("verticalLayout_3")
self.lblStep1HexEntropy_2 = QtWidgets.QLabel(self.page4)
self.lblStep1HexEntropy_2.setObjectName("lblStep1HexEntropy_2")
self.verticalLayout_3.addWidget(self.lblStep1HexEntropy_2)
self.gridLayout_2 = QtWidgets.QGridLayout()
self.gridLayout_2.setSpacing(6)
self.gridLayout_2.setObjectName("gridLayout_2")
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.lblPinMessage = QtWidgets.QLabel(self.page4)
self.lblPinMessage.setText("")
self.lblPinMessage.setWordWrap(False)
self.lblPinMessage.setObjectName("lblPinMessage")
self.horizontalLayout_3.addWidget(self.lblPinMessage)
self.edtPrimaryPIN = QtWidgets.QLineEdit(self.page4)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.edtPrimaryPIN.sizePolicy().hasHeightForWidth())
self.edtPrimaryPIN.setSizePolicy(sizePolicy)
self.edtPrimaryPIN.setLayoutDirection(QtCore.Qt.LeftToRight)
self.edtPrimaryPIN.setEchoMode(QtWidgets.QLineEdit.Password)
self.edtPrimaryPIN.setObjectName("edtPrimaryPIN")
self.horizontalLayout_3.addWidget(self.edtPrimaryPIN)
self.btnShowPIN = QtWidgets.QToolButton(self.page4)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.btnShowPIN.sizePolicy().hasHeightForWidth())
self.btnShowPIN.setSizePolicy(sizePolicy)
self.btnShowPIN.setMinimumSize(QtCore.QSize(21, 21))
self.btnShowPIN.setMaximumSize(QtCore.QSize(21, 21))
self.btnShowPIN.setText("")
self.btnShowPIN.setObjectName("btnShowPIN")
self.horizontalLayout_3.addWidget(self.btnShowPIN)
self.edtSecondaryPIN = QtWidgets.QLineEdit(self.page4)
self.edtSecondaryPIN.setEchoMode(QtWidgets.QLineEdit.Password)
self.edtSecondaryPIN.setObjectName("edtSecondaryPIN")
self.horizontalLayout_3.addWidget(self.edtSecondaryPIN)
self.btnShowSecondaryPIN = QtWidgets.QToolButton(self.page4)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.btnShowSecondaryPIN.sizePolicy().hasHeightForWidth())
self.btnShowSecondaryPIN.setSizePolicy(sizePolicy)
self.btnShowSecondaryPIN.setMinimumSize(QtCore.QSize(21, 21))
self.btnShowSecondaryPIN.setMaximumSize(QtCore.QSize(21, 21))
self.btnShowSecondaryPIN.setText("")
self.btnShowSecondaryPIN.setObjectName("btnShowSecondaryPIN")
self.horizontalLayout_3.addWidget(self.btnShowSecondaryPIN)
self.gridLayout_2.addLayout(self.horizontalLayout_3, 2, 1, 1, 1)
self.chbUsePassphrase = QtWidgets.QCheckBox(self.page4)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.chbUsePassphrase.sizePolicy().hasHeightForWidth())
self.chbUsePassphrase.setSizePolicy(sizePolicy)
self.chbUsePassphrase.setLayoutDirection(QtCore.Qt.RightToLeft)
self.chbUsePassphrase.setText("Use passphrase")
self.chbUsePassphrase.setObjectName("chbUsePassphrase")
self.gridLayout_2.addWidget(self.chbUsePassphrase, 3, 0, 1, 1)
self.chbUsePIN = QtWidgets.QCheckBox(self.page4)
self.chbUsePIN.setLayoutDirection(QtCore.Qt.RightToLeft)
self.chbUsePIN.setChecked(True)
self.chbUsePIN.setObjectName("chbUsePIN")
self.gridLayout_2.addWidget(self.chbUsePIN, 2, 0, 1, 1)
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
self.edtDeviceLabel = QtWidgets.QLineEdit(self.page4)
self.edtDeviceLabel.setPlaceholderText("")
self.edtDeviceLabel.setObjectName("edtDeviceLabel")
self.horizontalLayout.addWidget(self.edtDeviceLabel)
self.gridLayout_2.addLayout(self.horizontalLayout, 1, 1, 1, 1)
self.lblDeviceLabel = QtWidgets.QLabel(self.page4)
self.lblDeviceLabel.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.lblDeviceLabel.setObjectName("lblDeviceLabel")
self.gridLayout_2.addWidget(self.lblDeviceLabel, 1, 0, 1, 1)
self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
self.lblPassphraseMessage = QtWidgets.QLabel(self.page4)
self.lblPassphraseMessage.setText("")
self.lblPassphraseMessage.setWordWrap(False)
self.lblPassphraseMessage.setObjectName("lblPassphraseMessage")
self.horizontalLayout_4.addWidget(self.lblPassphraseMessage)
self.edtPassphrase = QtWidgets.QLineEdit(self.page4)
self.edtPassphrase.setEchoMode(QtWidgets.QLineEdit.Password)
self.edtPassphrase.setObjectName("edtPassphrase")
self.horizontalLayout_4.addWidget(self.edtPassphrase)
self.btnShowPassphrase = QtWidgets.QToolButton(self.page4)
self.btnShowPassphrase.setMinimumSize(QtCore.QSize(21, 21))
self.btnShowPassphrase.setMaximumSize(QtCore.QSize(21, 21))
self.btnShowPassphrase.setText("")
self.btnShowPassphrase.setObjectName("btnShowPassphrase")
self.horizontalLayout_4.addWidget(self.btnShowPassphrase)
spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_4.addItem(spacerItem3)
self.gridLayout_2.addLayout(self.horizontalLayout_4, 3, 1, 1, 1)
self.lblDeviceWordsInputType = QtWidgets.QLabel(self.page4)
self.lblDeviceWordsInputType.setAlignment(QtCore.Qt.AlignCenter)
self.lblDeviceWordsInputType.setObjectName("lblDeviceWordsInputType")
self.gridLayout_2.addWidget(self.lblDeviceWordsInputType, 0, 0, 1, 1)
self.gbDeviceWordsInputType = QtWidgets.QGroupBox(self.page4)
self.gbDeviceWordsInputType.setObjectName("gbDeviceWordsInputType")
self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.gbDeviceWordsInputType)
self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.rbScrambledWords = QtWidgets.QRadioButton(self.gbDeviceWordsInputType)
self.rbScrambledWords.setLayoutDirection(QtCore.Qt.LeftToRight)
self.rbScrambledWords.setChecked(True)
self.rbScrambledWords.setObjectName("rbScrambledWords")
self.horizontalLayout_2.addWidget(self.rbScrambledWords)
self.rbWordsMatrix = QtWidgets.QRadioButton(self.gbDeviceWordsInputType)
self.rbWordsMatrix.setLayoutDirection(QtCore.Qt.LeftToRight)
self.rbWordsMatrix.setChecked(False)
self.rbWordsMatrix.setObjectName("rbWordsMatrix")
self.horizontalLayout_2.addWidget(self.rbWordsMatrix)
spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem4)
self.gridLayout_2.addWidget(self.gbDeviceWordsInputType, 0, 1, 1, 1)
self.verticalLayout_3.addLayout(self.gridLayout_2)
self.lblOptionsPageMessage = QtWidgets.QLabel(self.page4)
self.lblOptionsPageMessage.setText("")
self.lblOptionsPageMessage.setObjectName("lblOptionsPageMessage")
self.verticalLayout_3.addWidget(self.lblOptionsPageMessage)
spacerItem5 = QtWidgets.QSpacerItem(20, 293, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout_3.addItem(spacerItem5)
self.lblOptionsEntropy = QtWidgets.QLabel(self.page4)
self.lblOptionsEntropy.setStyleSheet("font-size:11px")
self.lblOptionsEntropy.setWordWrap(True)
self.lblOptionsEntropy.setOpenExternalLinks(True)
self.lblOptionsEntropy.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByKeyboard|QtCore.Qt.TextSelectableByMouse)
self.lblOptionsEntropy.setObjectName("lblOptionsEntropy")
self.verticalLayout_3.addWidget(self.lblOptionsEntropy)
self.btnPreviewAddresses = QtWidgets.QPushButton(self.page4)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.btnPreviewAddresses.sizePolicy().hasHeightForWidth())
self.btnPreviewAddresses.setSizePolicy(sizePolicy)
self.btnPreviewAddresses.setLayoutDirection(QtCore.Qt.LeftToRight)
self.btnPreviewAddresses.setAutoDefault(False)
self.btnPreviewAddresses.setObjectName("btnPreviewAddresses")
self.verticalLayout_3.addWidget(self.btnPreviewAddresses)
self.pages.addWidget(self.page4)
self.verticalLayout_4.addWidget(self.pages)
self.retranslateUi(WdgRecoverHw)
self.pages.setCurrentIndex(4)
QtCore.QMetaObject.connectSlotsByName(WdgRecoverHw)
def retranslateUi(self, WdgRecoverHw):
_translate = QtCore.QCoreApplication.translate
WdgRecoverHw.setWindowTitle(_translate("WdgRecoverHw", "Form"))
self.label_2.setText(_translate("WdgRecoverHw", "<b>Source of the recovery seed</b>"))
self.rbSeedSourceHwScreen.setText(_translate("WdgRecoverHw", "Recover from seed words using hardware wallet screen (secure)"))
self.rbSeedSourceAppWords.setText(_translate("WdgRecoverHw", "Recover from seed words using in-app editor (convenient but insecure)"))
self.rbSeedSourceAppEntropy.setText(_translate("WdgRecoverHw", "Recover from hexadecimal entropy (insecure)"))
self.lblActionTypeMessage.setText(_translate("WdgRecoverHw", "..."))
self.label.setText(_translate("WdgRecoverHw", "<b>Number of words of the recovery seed</b>"))
self.rbWordsCount24.setText(_translate("WdgRecoverHw", "24"))
self.rbWordsCount18.setText(_translate("WdgRecoverHw", "18"))
self.rbWordsCount12.setText(_translate("WdgRecoverHw", "12"))
self.lblStep1HexEntropy.setText(_translate("WdgRecoverHw", "<b>Enter the hexadecimal entropy of the recovery seed</b>"))
self.edtHexEntropy.setPlaceholderText(_translate("WdgRecoverHw", "32/24/16-byte hexadecimal string"))
self.lblStepWordListTitle.setText(_translate("WdgRecoverHw", "<b>Enter the words of your recovery seed</b>"))
self.lblStep1HexEntropy_2.setText(_translate("WdgRecoverHw", "<b>Tune hardware wallet options as needed</b>"))
self.edtPrimaryPIN.setPlaceholderText(_translate("WdgRecoverHw", "PIN"))
self.btnShowPIN.setToolTip(_translate("WdgRecoverHw", "Show PIN"))
self.edtSecondaryPIN.setToolTip(_translate("WdgRecoverHw", "<html><head/><body><p>This PIN will be used to activate passphrase saved in your Ledger Nano S.</p></body></html>"))
self.edtSecondaryPIN.setPlaceholderText(_translate("WdgRecoverHw", "Secondary PIN"))
self.btnShowSecondaryPIN.setToolTip(_translate("WdgRecoverHw", "Show secondary PIN"))
self.chbUsePassphrase.setWhatsThis(_translate("WdgRecoverHw", "<html><head/><body><p>Check the link attached <a href="dash.org">dash.org</a></p></body></html>"))
self.chbUsePIN.setText(_translate("WdgRecoverHw", "Use PIN"))
self.lblDeviceLabel.setText(_translate("WdgRecoverHw", "Device label"))
self.edtPassphrase.setToolTip(_translate("WdgRecoverHw", "<html><head/><body><p>This passphrase (if used) will be saved in your Ledger Nano S device and will be secured with the secondary PIN .</p></body></html>"))
self.edtPassphrase.setPlaceholderText(_translate("WdgRecoverHw", "Passphrase"))
self.btnShowPassphrase.setToolTip(_translate("WdgRecoverHw", "Show passphrase"))
self.lblDeviceWordsInputType.setText(_translate("WdgRecoverHw", "Tnput type on device"))
self.rbScrambledWords.setText(_translate("WdgRecoverHw", "Scrambled words"))
self.rbWordsMatrix.setText(_translate("WdgRecoverHw", "Word matrix"))
self.lblOptionsEntropy.setText(_translate("WdgRecoverHw", "Entropy:"))
self.btnPreviewAddresses.setText(_translate("WdgRecoverHw", "Show preview"))
| 64.016181 | 222 | 0.745008 | 1,840 | 19,781 | 7.934239 | 0.141304 | 0.070279 | 0.036441 | 0.010069 | 0.334475 | 0.178848 | 0.135009 | 0.099048 | 0.064936 | 0.064936 | 0 | 0.02253 | 0.154087 | 19,781 | 308 | 223 | 64.224026 | 0.849937 | 0.013852 | 0 | 0.040816 | 1 | 0.010204 | 0.111544 | 0.013078 | 0 | 0 | 0 | 0 | 0 | 1 | 0.006803 | false | 0.098639 | 0.003401 | 0 | 0.013605 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
c47ed8028e53c0742399199be9ea4ca791d59010 | 1,108 | py | Python | datahandler/analyser.py | ameliecordier/IIK | 57b40d6b851a1c2369604049d1820e5b572c6227 | [
"MIT"
] | null | null | null | datahandler/analyser.py | ameliecordier/IIK | 57b40d6b851a1c2369604049d1820e5b572c6227 | [
"MIT"
] | null | null | null | datahandler/analyser.py | ameliecordier/IIK | 57b40d6b851a1c2369604049d1820e5b572c6227 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import csv
from matplotlib import pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
def isValid(p, ep):
return p in ep.patterns
# CLASS ANALYSER
class Analyser:
"""
Représentation d'un résultat d'analyse
"""
def __init__(self):
"""
:param results: contient les résultats de l'analyse
"""
self.results = []
def addResult(self, result):
"""
Ajoute une liste de résultats à l'ensemble des résultats
:param result: la ligne de résultats
:return: None
"""
self.results.append(result)
def __str__(self):
"""
Affichage des résultats sur la sortie standard
"""
return "Résultats : %r" % self.results
def toFile(self, filename):
with open(filename, "w") as outfile:
fieldnames = ['idxExpert', 'idxMining', 'pattern expert', 'pattern mining' , 'full pattern']
w = csv.DictWriter(outfile, delimiter=";", fieldnames=fieldnames)
w.writeheader()
w.writerows(self.results)
| 25.181818 | 104 | 0.598375 | 123 | 1,108 | 5.317073 | 0.585366 | 0.067278 | 0.042813 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.001276 | 0.292419 | 1,108 | 43 | 105 | 25.767442 | 0.832908 | 0.255415 | 0 | 0 | 0 | 0 | 0.102351 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.277778 | false | 0 | 0.166667 | 0.055556 | 0.611111 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
c4844ed8e45f32c88606465081cf2391a8999d1d | 4,849 | py | Python | lemonpie/_nbdev.py | corazonlabs/ehr_preprocessing | 5bf3be1f04d9dc6db002b58331800b30cf668e69 | [
"Apache-2.0"
] | 3 | 2021-04-03T01:16:18.000Z | 2021-07-31T20:44:47.000Z | lemonpie/_nbdev.py | corazonlabs/ehr_preprocessing | 5bf3be1f04d9dc6db002b58331800b30cf668e69 | [
"Apache-2.0"
] | 5 | 2021-03-30T21:23:47.000Z | 2022-02-26T10:17:12.000Z | lemonpie/_nbdev.py | vin00d/lemonpie | 5bf3be1f04d9dc6db002b58331800b30cf668e69 | [
"Apache-2.0"
] | 1 | 2020-11-26T00:35:28.000Z | 2020-11-26T00:35:28.000Z | # AUTOGENERATED BY NBDEV! DO NOT EDIT!
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"get_device": "00_basics.ipynb",
"settings_template": "00_basics.ipynb",
"read_settings": "00_basics.ipynb",
"DEVICE": "00_basics.ipynb",
"settings": "00_basics.ipynb",
"DATA_STORE": "00_basics.ipynb",
"LOG_STORE": "00_basics.ipynb",
"MODEL_STORE": "00_basics.ipynb",
"EXPERIMENT_STORE": "00_basics.ipynb",
"PATH_1K": "00_basics.ipynb",
"PATH_10K": "00_basics.ipynb",
"PATH_20K": "00_basics.ipynb",
"PATH_100K": "00_basics.ipynb",
"FILENAMES": "00_basics.ipynb",
"SYNTHEA_DATAGEN_DATES": "00_basics.ipynb",
"CONDITIONS": "00_basics.ipynb",
"LOG_NUMERICALIZE_EXCEP": "00_basics.ipynb",
"read_raw_ehrdata": "01_preprocessing_clean.ipynb",
"split_patients": "01_preprocessing_clean.ipynb",
"split_ehr_dataset": "01_preprocessing_clean.ipynb",
"cleanup_pts": "01_preprocessing_clean.ipynb",
"cleanup_obs": "01_preprocessing_clean.ipynb",
"cleanup_algs": "01_preprocessing_clean.ipynb",
"cleanup_crpls": "01_preprocessing_clean.ipynb",
"cleanup_meds": "01_preprocessing_clean.ipynb",
"cleanup_img": "01_preprocessing_clean.ipynb",
"cleanup_procs": "01_preprocessing_clean.ipynb",
"cleanup_cnds": "01_preprocessing_clean.ipynb",
"cleanup_immns": "01_preprocessing_clean.ipynb",
"cleanup_dataset": "01_preprocessing_clean.ipynb",
"extract_ys": "01_preprocessing_clean.ipynb",
"insert_age": "01_preprocessing_clean.ipynb",
"clean_raw_ehrdata": "01_preprocessing_clean.ipynb",
"load_cleaned_ehrdata": "01_preprocessing_clean.ipynb",
"load_ehr_vocabcodes": "01_preprocessing_clean.ipynb",
"EhrVocab": "02_preprocessing_vocab.ipynb",
"ObsVocab": "02_preprocessing_vocab.ipynb",
"EhrVocabList": "02_preprocessing_vocab.ipynb",
"get_all_emb_dims": "02_preprocessing_vocab.ipynb",
"collate_codes_offsts": "03_preprocessing_transform.ipynb",
"get_codenums_offsts": "03_preprocessing_transform.ipynb",
"get_demographics": "03_preprocessing_transform.ipynb",
"Patient": "03_preprocessing_transform.ipynb",
"get_pckl_dir": "03_preprocessing_transform.ipynb",
"PatientList": "03_preprocessing_transform.ipynb",
"cpu_cnt": "03_preprocessing_transform.ipynb",
"create_all_ptlists": "03_preprocessing_transform.ipynb",
"preprocess_ehr_dataset": "03_preprocessing_transform.ipynb",
"EHRDataSplits": "04_data.ipynb",
"LabelEHRData": "04_data.ipynb",
"EHRDataset": "04_data.ipynb",
"EHRData": "04_data.ipynb",
"accuracy": "05_metrics.ipynb",
"null_accuracy": "05_metrics.ipynb",
"ROC": "05_metrics.ipynb",
"MultiLabelROC": "05_metrics.ipynb",
"plot_rocs": "05_metrics.ipynb",
"plot_train_valid_rocs": "05_metrics.ipynb",
"auroc_score": "05_metrics.ipynb",
"auroc_ci": "05_metrics.ipynb",
"save_to_checkpoint": "06_learn.ipynb",
"load_from_checkpoint": "06_learn.ipynb",
"get_loss_fn": "06_learn.ipynb",
"RunHistory": "06_learn.ipynb",
"train": "06_learn.ipynb",
"evaluate": "06_learn.ipynb",
"fit": "06_learn.ipynb",
"predict": "06_learn.ipynb",
"plot_loss": "06_learn.ipynb",
"plot_losses": "06_learn.ipynb",
"plot_aurocs": "06_learn.ipynb",
"plot_train_valid_aurocs": "06_learn.ipynb",
"plot_fit_results": "06_learn.ipynb",
"summarize_prediction": "06_learn.ipynb",
"count_parameters": "06_learn.ipynb",
"dropout_mask": "07_models.ipynb",
"InputDropout": "07_models.ipynb",
"linear_layer": "07_models.ipynb",
"create_linear_layers": "07_models.ipynb",
"init_lstm": "07_models.ipynb",
"EHR_LSTM": "07_models.ipynb",
"init_cnn": "07_models.ipynb",
"conv_layer": "07_models.ipynb",
"EHR_CNN": "07_models.ipynb",
"get_data": "08_experiment.ipynb",
"get_optimizer": "08_experiment.ipynb",
"get_model": "08_experiment.ipynb",
"Experiment": "08_experiment.ipynb"}
modules = ["basics.py",
"preprocessing/clean.py",
"preprocessing/vocab.py",
"preprocessing/transform.py",
"data.py",
"metrics.py",
"learn.py",
"models.py",
"experiment.py"]
doc_url = "https://corazonlabs.github.io/lemonpie/"
git_url = "https://github.com/corazonlabs/lemonpie/tree/main/"
def custom_doc_links(name): return None
| 44.486239 | 70 | 0.630852 | 531 | 4,849 | 5.350282 | 0.284369 | 0.12038 | 0.126716 | 0.158395 | 0.249912 | 0.06547 | 0 | 0 | 0 | 0 | 0 | 0.048936 | 0.224582 | 4,849 | 108 | 71 | 44.898148 | 0.706649 | 0.007424 | 0 | 0 | 1 | 0 | 0.6402 | 0.225109 | 0 | 0 | 0 | 0 | 0 | 1 | 0.009901 | false | 0 | 0 | 0.009901 | 0.009901 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
c485ee350fbe503865765122e5205b0c6d84fd8d | 1,300 | py | Python | {{cookiecutter.project_slug}}/core/management/commands/snippets/fastapi_project/core/security.py | claysllanxavier/django-cookiecutter | 97de7ff4ed3dc94c32bf756a57aee0664a888cbc | [
"BSD-3-Clause"
] | 8 | 2021-08-13T17:48:27.000Z | 2022-02-22T02:34:15.000Z | {{cookiecutter.project_slug}}/core/management/commands/snippets/fastapi_project/core/security.py | claysllanxavier/django-cookiecutter | 97de7ff4ed3dc94c32bf756a57aee0664a888cbc | [
"BSD-3-Clause"
] | 2 | 2022-03-24T20:39:00.000Z | 2022-03-24T20:39:48.000Z | {{cookiecutter.project_slug}}/core/management/commands/snippets/fastapi_project/core/security.py | claysllanxavier/django-cookiecutter | 97de7ff4ed3dc94c32bf756a57aee0664a888cbc | [
"BSD-3-Clause"
] | 2 | 2021-09-21T00:05:27.000Z | 2022-01-03T10:50:05.000Z | from datetime import datetime, timedelta
from typing import Any, Union
from jose import jwt
from passlib.context import CryptContext
from .config import settings
pwd_context = CryptContext(
default="django_pbkdf2_sha256",
schemes=["django_argon2", "django_bcrypt", "django_bcrypt_sha256",
"django_pbkdf2_sha256", "django_pbkdf2_sha1",
"django_disabled"])
ALGORITHM = "HS256"
ACCESS_TOKEN_EXPIRE_MINUTES = 60 * 24 * 8 # 8 days
'''
Arquivo de configuração de segurança dos tokens JWT
- Métodos de verificação e criação de hash de senha
- Método para criar o token jwt válido
'''
def verify_password(plain_password: str, hashed_password: str) -> bool:
return pwd_context.verify(plain_password, hashed_password)
def get_password_hash(password: str) -> str:
return pwd_context.hash(password)
def create_access_token(
subject: Union[str, Any], expires_delta: timedelta = None
) -> str:
if expires_delta:
expire = datetime.utcnow() + expires_delta
else:
expire = datetime.utcnow() + timedelta(
minutes=ACCESS_TOKEN_EXPIRE_MINUTES
)
to_encode = {"exp": expire, "sub": str(subject)}
encoded_jwt = jwt.encode(to_encode, settings.app_secret, algorithm=ALGORITHM)
return encoded_jwt | 29.545455 | 81 | 0.713077 | 163 | 1,300 | 5.460123 | 0.460123 | 0.033708 | 0.040449 | 0.053933 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.022094 | 0.199231 | 1,300 | 44 | 82 | 29.545455 | 0.832853 | 0.004615 | 0 | 0 | 0 | 0 | 0.113835 | 0 | 0 | 0 | 0 | 0.045455 | 0 | 1 | 0.107143 | false | 0.178571 | 0.178571 | 0.071429 | 0.392857 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
6706396f498d795e0d71e25c46fb2f83e80c424d | 1,025 | py | Python | odoo/base-addons/l10n_tr/__manifest__.py | LucasBorges-Santos/docker-odoo | 53987bbd61f6119669b5f801ee2ad54695084a21 | [
"MIT"
] | null | null | null | odoo/base-addons/l10n_tr/__manifest__.py | LucasBorges-Santos/docker-odoo | 53987bbd61f6119669b5f801ee2ad54695084a21 | [
"MIT"
] | null | null | null | odoo/base-addons/l10n_tr/__manifest__.py | LucasBorges-Santos/docker-odoo | 53987bbd61f6119669b5f801ee2ad54695084a21 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Turkey - Accounting',
'version': '1.0',
'category': 'Localization',
'description': """
Türkiye için Tek düzen hesap planı şablonu Odoo Modülü.
==========================================================
Bu modül kurulduktan sonra, Muhasebe yapılandırma sihirbazı çalışır
* Sihirbaz sizden hesap planı şablonu, planın kurulacağı şirket, banka hesap
bilgileriniz, ilgili para birimi gibi bilgiler isteyecek.
""",
'author': 'Ahmet Altınışık, Can Tecim',
'maintainer':'https://launchpad.net/~openerp-turkey, http://www.cantecim.com',
'depends': [
'account',
],
'data': [
'data/l10n_tr_chart_data.xml',
'data/account.account.template.csv',
'data/l10n_tr_chart_post_data.xml',
'data/account_data.xml',
'data/account_tax_template_data.xml',
'data/account_chart_template_data.xml',
],
'license': 'LGPL-3',
}
| 33.064516 | 82 | 0.61561 | 113 | 1,025 | 5.460177 | 0.707965 | 0.056726 | 0.071313 | 0.116694 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009756 | 0.2 | 1,025 | 30 | 83 | 34.166667 | 0.742683 | 0.091707 | 0 | 0.076923 | 0 | 0 | 0.771552 | 0.259698 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
671650e9876f386bef01f59b8d08f601fc6d3ed8 | 14,103 | py | Python | lab7/lab7.py | cudaczek/nlp-labs-2020 | 8e40fe04d2350c6e43a36b29f4428a34aedb6dea | [
"MIT"
] | null | null | null | lab7/lab7.py | cudaczek/nlp-labs-2020 | 8e40fe04d2350c6e43a36b29f4428a34aedb6dea | [
"MIT"
] | null | null | null | lab7/lab7.py | cudaczek/nlp-labs-2020 | 8e40fe04d2350c6e43a36b29f4428a34aedb6dea | [
"MIT"
] | null | null | null | import pprint
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn import manifold
from gensim.models import KeyedVectors
# Download polish word embeddings for word2vec github/Google drive:
# https://github.com/sdadas/polish-nlp-resources
# with 100 dimensionality
word2vec_100 = KeyedVectors.load("word2vec/word2vec_100_3_polish.bin")
# with 300 dimensionality
word2vec_300 = KeyedVectors.load("word2vec_300_3_polish/word2vec_300_3_polish.bin")
# Using the downloaded models find the most similar words for the following expressions...
# And display 5 most similar words according to each model:
# kpk
# szkoda
# wypadek
# kolizja
# nieszczęście
# rozwód
words = ['kpk', 'szkoda', 'wypadek', 'kolizja', 'nieszczęście', 'rozwód']
def get_most_similar_words(expression):
print(f"--------- Most similar words for {expression} ---------")
print("word2vec_100:")
result = word2vec_100.most_similar(positive=[expression])
pprint.pprint(result[:5])
print("word2vec_300:")
result = word2vec_300.most_similar(positive=[expression])
pprint.pprint(result[:5])
print()
for word in words:
get_most_similar_words(word)
# --------- Most similar words for kpk ---------
# word2vec_100:
# [('kilopond', 0.6665806770324707),
# ('kpzs', 0.6363496780395508),
# ('kpu', 0.6300562024116516),
# ('sownarkomu', 0.6254925727844238),
# ('wcik', 0.6224358677864075)]
# word2vec_300:
# [('ksh', 0.5774794220924377),
# ('cywilnego', 0.5498510599136353),
# ('postępowania', 0.5285828113555908),
# ('kilopond', 0.5151568055152893),
# ('kkkw', 0.48344212770462036)]
#
# --------- Most similar words for szkoda ---------
# word2vec_100:
# [('krzywda', 0.6817898750305176),
# ('pożytek', 0.6121943593025208),
# ('strata', 0.5968126654624939),
# ('ryzyko', 0.5745570659637451),
# ('uszczerbek', 0.5639551877975464)]
# word2vec_300:
# [('uszczerbek', 0.6027276515960693),
# ('krzywda', 0.5920778512954712),
# ('strata', 0.550269365310669),
# ('despekt', 0.5382484197616577),
# ('pożytek', 0.531347393989563)]
#
# --------- Most similar words for wypadek ---------
# word2vec_100:
# [('przypadek', 0.7544811964035034),
# ('okoliczności', 0.7268072366714478),
# ('padku', 0.6788284182548523),
# ('incydent', 0.6418948173522949),
# ('zdarzenie', 0.6114422082901001)]
# word2vec_300:
# [('przypadek', 0.7066895961761475),
# ('okoliczności', 0.6121077537536621),
# ('padku', 0.6056742072105408),
# ('padki', 0.5596078634262085),
# ('incydent', 0.5496981143951416)]
#
# --------- Most similar words for kolizja ---------
# word2vec_100:
# [('zderzenie', 0.8431548476219177),
# ('awaria', 0.7090569734573364),
# ('kraksa', 0.6777161359786987),
# ('turbulencja', 0.6613468527793884),
# ('poślizg', 0.6391660571098328)]
# word2vec_300:
# [('zderzenie', 0.7603178024291992),
# ('awaria', 0.611009955406189),
# ('kraksa', 0.5939033031463623),
# ('turbulencja', 0.5664489269256592),
# ('poślizg', 0.5569967031478882)]
#
# --------- Most similar words for nieszczęście ---------
# word2vec_100:
# [('niebezpieczeństwo', 0.7519958019256592),
# ('cierpienia', 0.7408335208892822),
# ('strapienie', 0.7345459461212158),
# ('cierpienie', 0.7262567281723022),
# ('utrapienie', 0.7251379489898682)]
# word2vec_300:
# [('utrapienie', 0.6610732674598694),
# ('cierpienia', 0.6526124477386475),
# ('niedola', 0.6478177309036255),
# ('strapienie', 0.6300181150436401),
# ('cierpienie', 0.6248573064804077)]
#
# --------- Most similar words for rozwód ---------
# word2vec_100:
# [('małżeństwo', 0.7646843194961548),
# ('separacja', 0.7547168135643005),
# ('adopcja', 0.7333694696426392),
# ('ślub', 0.7324203848838806),
# ('unieważnienie', 0.7096400856971741)]
# word2vec_300:
# [('separacja', 0.7053208351135254),
# ('małżeństwo', 0.6689504384994507),
# ('ślub', 0.6553219556808472),
# ('rozwodowy', 0.614338219165802),
# ('unieważnienie', 0.6127183437347412)]
# Find the most similar words for the following expressions (average the representations for each word):
# sąd najwyższy
# trybunał konstytucyjny
# szkoda majątkowy
# kodeks cywilny
# sąd rejonowy
# Display 7 most similar words according to each model.
expressions = ['sąd najwyższy', 'trybunał konstytucyjny', 'szkoda majątkowy', 'kodeks cywilny', 'sąd rejonowy']
def get_most_similiar_words_for_expression_avg(expressions):
for expr in expressions:
print(f"--------- Most similar words for {expr} ---------")
print("word2vec_100:")
word_1, word_2 = tuple(expr.split())
result = np.array([np.mean(k) for k in zip(np.array(word2vec_100[word_1]), np.array(word2vec_100[word_2]))])
pprint.pprint(word2vec_100.similar_by_vector(result)[:7])
print("word2vec_300:")
result = np.array([np.mean(k) for k in zip(np.array(word2vec_300[word_1]), np.array(word2vec_300[word_2]))])
pprint.pprint(word2vec_300.similar_by_vector(result)[:7])
print()
get_most_similiar_words_for_expression_avg(expressions)
# --------- Most similar words for sąd najwyższy ---------
# word2vec_100:
# [('sąd', 0.8644266128540039),
# ('trybunał', 0.7672435641288757),
# ('najwyższy', 0.7527138590812683),
# ('trybunat', 0.6843459010124207),
# ('sędzia', 0.6718415021896362),
# ('areopag', 0.6571060419082642),
# ('sprawiedliwość', 0.6562486886978149)]
# word2vec_300:
# [('sąd', 0.8261206150054932),
# ('trybunał', 0.711520791053772),
# ('najwyższy', 0.7068409323692322),
# ('sędzia', 0.6023203730583191),
# ('sądowy', 0.5670486688613892),
# ('trybunat', 0.5525928735733032),
# ('sprawiedliwość', 0.5319530367851257)]
#
# --------- Most similar words for trybunał konstytucyjny ---------
# word2vec_100:
# [('trybunał', 0.9073251485824585),
# ('konstytucyjny', 0.7998723387718201),
# ('sąd', 0.7972990274429321),
# ('bunał', 0.7729247808456421),
# ('senat', 0.7585273385047913),
# ('bunału', 0.7441976070404053),
# ('trybunat', 0.7347140908241272)]
# word2vec_300:
# [('trybunał', 0.8845913410186768),
# ('konstytucyjny', 0.7739969491958618),
# ('sąd', 0.7300779819488525),
# ('trybunat', 0.6758428812026978),
# ('senat', 0.6632090210914612),
# ('parlament', 0.6614581346511841),
# ('bunału', 0.6404117941856384)]
#
# --------- Most similar words for szkoda majątkowy ---------
# word2vec_100:
# [('szkoda', 0.8172438144683838),
# ('majątkowy', 0.7424530386924744),
# ('krzywda', 0.6498408317565918),
# ('świadczenie', 0.6419471502304077),
# ('odszkodowanie', 0.6392182111740112),
# ('dochód', 0.637932538986206),
# ('wydatek', 0.6325603127479553)]
# word2vec_300:
# [('szkoda', 0.7971925735473633),
# ('majątkowy', 0.7278684973716736),
# ('uszczerbek', 0.5841633081436157),
# ('korzyść', 0.5474051237106323),
# ('krzywda', 0.5431190729141235),
# ('majątek', 0.525060772895813),
# ('strata', 0.5228629112243652)]
#
# --------- Most similar words for kodeks cywilny ---------
# word2vec_100:
# [('kodeks', 0.8756389617919922),
# ('cywilny', 0.8532464504241943),
# ('pasztunwali', 0.6438998579978943),
# ('deksu', 0.6374959945678711),
# ('teodozjańskim', 0.6283917427062988),
# ('pozakodeksowy', 0.6153194904327393),
# ('sądowo', 0.6136723160743713)]
# word2vec_300:
# [('kodeks', 0.8212110996246338),
# ('cywilny', 0.7886406779289246),
# ('amiatyński', 0.5660314559936523),
# ('cywilnego', 0.5531740188598633),
# ('deksu', 0.5472918748855591),
# ('isps', 0.5369160175323486),
# ('jōei', 0.5361183881759644)]
#
# --------- Most similar words for sąd rejonowy ---------
# word2vec_100:
# [('sąd', 0.8773891925811768),
# ('prokuratura', 0.8396657705307007),
# ('rejonowy', 0.7694871425628662),
# ('trybunał', 0.755321204662323),
# ('sądowy', 0.7153753042221069),
# ('magistrat', 0.7151126861572266),
# ('prokurator', 0.7081375122070312)]
# word2vec_300:
# [('sąd', 0.8507211208343506),
# ('rejonowy', 0.7344856262207031),
# ('prokuratura', 0.711697518825531),
# ('trybunał', 0.6748420596122742),
# ('sądowy', 0.6426382064819336),
# ('okręgowy', 0.6349465847015381),
# ('apelacyjny', 0.599929690361023)]
# Find the result of the following equations (5 top results, both models):
# sąd + konstytucja - kpk
# pasażer + kobieta - mężczyzna
# pilot + kobieta - mężczyzna
# lekarz + kobieta - mężczyzna
# nauczycielka + mężczyzna - kobieta
# przedszkolanka + mężczyzna - 'kobieta
# samochód + rzeka - droga
equations = [(['sąd', 'konstytucja'], ['kpk']),
(['pasażer', 'kobieta'], ['mężczyzna']),
(['pilot', 'kobieta'], ['mężczyzna']),
(['lekarz', 'kobieta'], ['mężczyzna']),
(['nauczycielka', 'mężczyzna'], ['kobieta']),
(['przedszkolanka', 'mężczyzna'], ['kobieta']),
(['samochód', 'rzeka'], ['droga'])]
def get_result_of_equation(positive, negative):
print(f"--------- Result for + {positive} and - {negative} ---------")
print("word2vec_100:")
result = word2vec_100.most_similar(positive=positive, negative=negative)
pprint.pprint(result[:5])
print("word2vec_300:")
result = word2vec_300.most_similar(positive=positive, negative=negative)
pprint.pprint(result[:5])
print()
for equa in equations:
get_result_of_equation(equa[0], equa[1])
# --------- Result for + ['sąd', 'konstytucja'] and - ['kpk'] ---------
# word2vec_100:
# [('trybunał', 0.6436409950256348),
# ('ustawa', 0.6028786897659302),
# ('elekcja', 0.5823959112167358),
# ('deklaracja', 0.5771891474723816),
# ('dekret', 0.5759621262550354)]
# word2vec_300:
# [('trybunał', 0.5860734581947327),
# ('senat', 0.5112544298171997),
# ('ustawa', 0.5023636817932129),
# ('dekret', 0.48704710602760315),
# ('władza', 0.4868926703929901)]
#
# --------- Result for + ['pasażer', 'kobieta'] and - ['mężczyzna'] ---------
# word2vec_100:
# [('pasażerka', 0.7234811186790466),
# ('stewardessa', 0.6305270195007324),
# ('stewardesa', 0.6282645463943481),
# ('taksówka', 0.619726300239563),
# ('podróżny', 0.614517092704773)]
# word2vec_300:
# [('pasażerka', 0.6741673946380615),
# ('stewardesa', 0.5810248255729675),
# ('stewardessa', 0.5653151273727417),
# ('podróżny', 0.5060371160507202),
# ('pasażerski', 0.4896503686904907)]
#
# --------- Result for + ['pilot', 'kobieta'] and - ['mężczyzna'] ---------
# word2vec_100:
# [('nawigator', 0.6925703287124634),
# ('oblatywacz', 0.6686224937438965),
# ('lotnik', 0.6569937467575073),
# ('pilotka', 0.6518791913986206),
# ('awionetka', 0.6428645849227905)]
# word2vec_300:
# [('pilotka', 0.6108255386352539),
# ('lotnik', 0.6020804047584534),
# ('stewardesa', 0.5943204760551453),
# ('nawigator', 0.5849766731262207),
# ('oblatywacz', 0.5674178600311279)]
#
# --------- Result for + ['lekarz', 'kobieta'] and - ['mężczyzna'] ---------
# word2vec_100:
# [('lekarka', 0.7690489292144775),
# ('ginekolog', 0.7575511336326599),
# ('pediatra', 0.7478542923927307),
# ('psychiatra', 0.732271671295166),
# ('położna', 0.7268943786621094)]
# word2vec_300:
# [('lekarka', 0.7388788461685181),
# ('pielęgniarka', 0.6719920635223389),
# ('ginekolog', 0.658279299736023),
# ('psychiatra', 0.6389409303665161),
# ('chirurg', 0.6305986642837524)]
#
# --------- Result for + ['nauczycielka', 'mężczyzna'] and - ['kobieta'] ---------
# word2vec_100:
# [('uczennica', 0.7441667318344116),
# ('studentka', 0.7274973392486572),
# ('nauczyciel', 0.7176114916801453),
# ('wychowawczyni', 0.7153530120849609),
# ('koleżanka', 0.678418755531311)]
# word2vec_300:
# [('nauczyciel', 0.6561620235443115),
# ('wychowawczyni', 0.6211140155792236),
# ('uczennica', 0.6142012476921082),
# ('koleżanka', 0.5501158237457275),
# ('przedszkolanka', 0.5497692823410034)]
#
# --------- Result for + ['przedszkolanka', 'mężczyzna'] and - ['kobieta'] ---------
# word2vec_100:
# [('stażysta', 0.6987776756286621),
# ('wychowawczyni', 0.6618361473083496),
# ('kreślarka', 0.6590923070907593),
# ('pielęgniarz', 0.6492814421653748),
# ('siedmiolatek', 0.6483469009399414)]
# word2vec_300:
# [('stażysta', 0.5117638111114502),
# ('pierwszoklasista', 0.49398648738861084),
# ('wychowawczyni', 0.49037522077560425),
# ('praktykant', 0.48884207010269165),
# ('pielęgniarz', 0.4795262813568115)]
#
# --------- Result for + ['samochód', 'rzeka'] and - ['droga'] ---------
# word2vec_100:
# [('jeep', 0.6142987608909607),
# ('buick', 0.5962571501731873),
# ('dżip', 0.5938510894775391),
# ('ponton', 0.580719530582428),
# ('landrower', 0.5799552202224731)]
# word2vec_300:
# [('dżip', 0.5567235946655273),
# ('jeep', 0.5533617734909058),
# ('auto', 0.5478508472442627),
# ('ciężarówka', 0.5461742281913757),
# ('wóz', 0.5204571485519409)]
# Using the t-SNE algorithm compute the projection of the random 1000 words with the following words highlighted (both models):
# szkoda
# strata
# uszczerbek
# krzywda
# niesprawiedliwość
# nieszczęście
# kobieta
# mężczyzna
# pasażer
# pasażerka
# student
# studentka
# lekarz
# lekarka
words = np.array(['szkoda', 'strata', 'uszczerbek', 'krzywda', 'niesprawiedliwość', 'nieszczęście', 'kobieta',
'mężczyzna', 'pasażer', 'pasażerka', 'student', 'studentka', 'lekarz', 'lekarka'])
def scatter_points(hue, point_labels, principal_components):
x = np.transpose(principal_components)[0]
y = np.transpose(principal_components)[1]
plt.scatter(x, y, c=hue, s=100, marker='o', alpha=0.2)
for i, text in enumerate(point_labels):
plt.annotate(text, (x[i], y[i]), ha="center", size=8)
def plot_with_tsne(wv, words, perplexity=30, learning_rate=100.0, iterations=1000, filename='slowa300'):
random_words = np.random.choice(list(wv.wv.vocab), 1000)
words = np.concatenate((words, random_words))
vecs = [wv[word] for word in words]
tsne = manifold.TSNE(2, perplexity=perplexity, learning_rate=learning_rate, n_iter=iterations)
results = tsne.fit_transform(vecs)
hue = [0 for _ in range(14)] + [1 for _ in range(1000)]
plt.figure(figsize=(30, 30))
scatter_points(hue, words, results)
plt.savefig(filename + '.png')
plt.show()
plt.clf()
wv = word2vec_300
plot_with_tsne(wv, words)
wv = word2vec_100
plot_with_tsne(wv, words)
| 33.901442 | 127 | 0.667801 | 1,397 | 14,103 | 6.652112 | 0.342878 | 0.035511 | 0.032713 | 0.030668 | 0.216184 | 0.172818 | 0.152158 | 0.14441 | 0.134295 | 0.109868 | 0 | 0.301166 | 0.130043 | 14,103 | 415 | 128 | 33.983133 | 0.456272 | 0.693753 | 0 | 0.2 | 0 | 0 | 0.184178 | 0.020215 | 0 | 0 | 0 | 0 | 0 | 1 | 0.066667 | false | 0 | 0.08 | 0 | 0.146667 | 0.253333 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
673cf80cda7d6f2ddfed4ffa2f717379b2c4aa55 | 3,146 | py | Python | pipenv/cmdparse.py | sthagen/pipenv | 0924f75fd1004c848ea67d4272315eda4210b352 | [
"MIT"
] | 23 | 2017-01-20T01:18:31.000Z | 2017-01-20T17:25:11.000Z | pipenv/cmdparse.py | sthagen/pipenv | 0924f75fd1004c848ea67d4272315eda4210b352 | [
"MIT"
] | 1 | 2017-01-20T05:13:58.000Z | 2017-01-20T05:13:58.000Z | pipenv/cmdparse.py | sthagen/pipenv | 0924f75fd1004c848ea67d4272315eda4210b352 | [
"MIT"
] | null | null | null | import itertools
import re
import shlex
class ScriptEmptyError(ValueError):
pass
def _quote_if_contains(value, pattern):
if next(iter(re.finditer(pattern, value)), None):
return '"{0}"'.format(re.sub(r'(\\*)"', r'\1\1\\"', value))
return value
class Script(object):
"""Parse a script line (in Pipfile's [scripts] section).
This always works in POSIX mode, even on Windows.
"""
def __init__(self, command, args=None):
self._parts = [command]
if args:
self._parts.extend(args)
@classmethod
def parse(cls, value):
if isinstance(value, str):
value = shlex.split(value)
if not value:
raise ScriptEmptyError(value)
return cls(value[0], value[1:])
def __repr__(self):
return "Script({0!r})".format(self._parts)
@property
def command(self):
return self._parts[0]
@property
def args(self):
return self._parts[1:]
@property
def cmd_args(self):
return self._parts
def extend(self, extra_args):
self._parts.extend(extra_args)
def cmdify(self):
"""Encode into a cmd-executable string.
This re-implements CreateProcess's quoting logic to turn a list of
arguments into one single string for the shell to interpret.
* All double quotes are escaped with a backslash.
* Existing backslashes before a quote are doubled, so they are all
escaped properly.
* Backslashes elsewhere are left as-is; cmd will interpret them
literally.
The result is then quoted into a pair of double quotes to be grouped.
An argument is intentionally not quoted if it does not contain
foul characters. This is done to be compatible with Windows built-in
commands that don't work well with quotes, e.g. everything with `echo`,
and DOS-style (forward slash) switches.
Foul characters include:
* Whitespaces.
* Carets (^). (pypa/pipenv#3307)
* Parentheses in the command. (pypa/pipenv#3168)
Carets introduce a difficult situation since they are essentially
"lossy" when parsed. Consider this in cmd.exe::
> echo "foo^bar"
"foo^bar"
> echo foo^^bar
foo^bar
The two commands produce different results, but are both parsed by the
shell as `foo^bar`, and there's essentially no sensible way to tell
what was actually passed in. This implementation assumes the quoted
variation (the first) since it is easier to implement, and arguably
the more common case.
The intended use of this function is to pre-process an argument list
before passing it into ``subprocess.Popen(..., shell=True)``.
See also: https://docs.python.org/3/library/subprocess.html#converting-argument-sequence
"""
return " ".join(
itertools.chain(
[_quote_if_contains(self.command, r"[\s^()]")],
(_quote_if_contains(arg, r"[\s^]") for arg in self.args),
)
)
| 30.543689 | 96 | 0.62206 | 408 | 3,146 | 4.730392 | 0.495098 | 0.032642 | 0.023316 | 0.029534 | 0.040415 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007566 | 0.28576 | 3,146 | 102 | 97 | 30.843137 | 0.851357 | 0.517483 | 0 | 0.073171 | 0 | 0 | 0.035228 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.219512 | false | 0.02439 | 0.073171 | 0.097561 | 0.536585 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
673f86c193b95f2ceb11fd09422584819f2d7221 | 346 | py | Python | python/speaktest.py | kyle-cook/templates | f1047a8c31a42507acbd7a27e66db0825be811a6 | [
"MIT"
] | null | null | null | python/speaktest.py | kyle-cook/templates | f1047a8c31a42507acbd7a27e66db0825be811a6 | [
"MIT"
] | null | null | null | python/speaktest.py | kyle-cook/templates | f1047a8c31a42507acbd7a27e66db0825be811a6 | [
"MIT"
] | null | null | null | import unittest
import speak
class SpeakTests(unittest.TestCase):
"""
Unit test for the speak library
"""
def testHello(self):
self.assertEqual("Hello World!", speak.helloworld())
def testGoodbye(self):
self.assertEqual("Goodbye World!", speak.goodbyeworld())
if __name__ == "__main__":
unittest.main()
| 21.625 | 64 | 0.66474 | 37 | 346 | 6 | 0.648649 | 0.072072 | 0.171171 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.208092 | 346 | 15 | 65 | 23.066667 | 0.810219 | 0.089595 | 0 | 0 | 0 | 0 | 0.113712 | 0 | 0 | 0 | 0 | 0 | 0.222222 | 1 | 0.222222 | false | 0 | 0.222222 | 0 | 0.555556 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
67416b98862ed94f8c8dd26ec4773d955430f943 | 460 | py | Python | pylox/error_reporting.py | hculpan/pylox | a5bde624f289115575e9e01bd171b6271c2e899a | [
"MIT"
] | 1 | 2018-05-18T08:16:02.000Z | 2018-05-18T08:16:02.000Z | pylox/error_reporting.py | hculpan/pylox | a5bde624f289115575e9e01bd171b6271c2e899a | [
"MIT"
] | null | null | null | pylox/error_reporting.py | hculpan/pylox | a5bde624f289115575e9e01bd171b6271c2e899a | [
"MIT"
] | null | null | null | errorFound = False
def hasError():
global errorFound
return errorFound
def clearError():
global errorFound
errorFound = False
def error(message, lineNo = 0):
report(lineNo, "", message)
def report(lineNo, where, message):
global errorFound
errorFound = True
if lineNo == 0:
print("Error {1}: {2}".format(lineNo, where, message))
else:
print("[Line {0}] Error {1}: {2}".format(lineNo, where, message)) | 19.166667 | 73 | 0.630435 | 53 | 460 | 5.471698 | 0.396226 | 0.165517 | 0.186207 | 0.089655 | 0.213793 | 0.213793 | 0.213793 | 0 | 0 | 0 | 0 | 0.019943 | 0.236957 | 460 | 24 | 73 | 19.166667 | 0.806268 | 0 | 0 | 0.3125 | 0 | 0 | 0.084599 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 0 | 0.3125 | 0.125 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
675e9236debc2ccf610756e1ddfa6942ba31102c | 621 | py | Python | akshare/fx/cons.py | PKUuu/akshare | 03967312b6c8afdec32e081fb23ae5916b674936 | [
"MIT"
] | 1 | 2020-05-14T13:20:48.000Z | 2020-05-14T13:20:48.000Z | akshare/fx/cons.py | 13767849/akshare | 5b7e4daaa80b1ccaf3f5a980a1205848e2e8570d | [
"MIT"
] | null | null | null | akshare/fx/cons.py | 13767849/akshare | 5b7e4daaa80b1ccaf3f5a980a1205848e2e8570d | [
"MIT"
] | 2 | 2020-09-23T08:50:14.000Z | 2020-09-28T09:57:07.000Z | # -*- coding:utf-8 -*-
# /usr/bin/env python
"""
Author: Albert King
date: 2019/10/20 10:58
contact: jindaxiang@163.com
desc: 外汇配置文件
"""
# headers
SHORT_HEADERS = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.91 Safari/537.36'
}
# url
FX_SPOT_URL = "http://www.chinamoney.com.cn/r/cms/www/chinamoney/data/fx/rfx-sp-quot.json"
FX_SWAP_URL = "http://www.chinamoney.com.cn/r/cms/www/chinamoney/data/fx/rfx-sw-quot.json"
FX_PAIR_URL = "http://www.chinamoney.com.cn/r/cms/www/chinamoney/data/fx/cpair-quot.json"
# payload
SPOT_PAYLOAD = {
"t": {}
}
| 29.571429 | 134 | 0.698873 | 108 | 621 | 3.944444 | 0.583333 | 0.183099 | 0.070423 | 0.140845 | 0.352113 | 0.352113 | 0.352113 | 0.352113 | 0.352113 | 0.352113 | 0 | 0.079137 | 0.10467 | 621 | 20 | 135 | 31.05 | 0.68705 | 0.233494 | 0 | 0 | 0 | 0.444444 | 0.74569 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
67659e478a5e5c7c61b17fe40c449153891a0e5c | 291 | py | Python | app/models.py | dangger/awesome-flask-todo | 8eb2ec5357a028a76015035940d6f7844623ff98 | [
"MIT"
] | null | null | null | app/models.py | dangger/awesome-flask-todo | 8eb2ec5357a028a76015035940d6f7844623ff98 | [
"MIT"
] | null | null | null | app/models.py | dangger/awesome-flask-todo | 8eb2ec5357a028a76015035940d6f7844623ff98 | [
"MIT"
] | null | null | null | from app import db
import datetime
from flask_mongoengine.wtf import model_form
class Todo(db.Document):
content = db.StringField(required=True, max_length=20)
time = db.DateTimeField(default=datetime.datetime.now())
status = db.IntField(default=0)
TodoForm = model_form(Todo)
| 26.454545 | 60 | 0.766323 | 41 | 291 | 5.341463 | 0.682927 | 0.082192 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011905 | 0.134021 | 291 | 10 | 61 | 29.1 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.375 | 0 | 0.875 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
6767a8053401b419268988cde796fcad2ed726b3 | 157 | py | Python | Python/Mundo01/teste/teste2.py | eStev4m/CursoPython | 8b52a618e67c80d66518ef91c1d4596a2bfddc22 | [
"MIT"
] | null | null | null | Python/Mundo01/teste/teste2.py | eStev4m/CursoPython | 8b52a618e67c80d66518ef91c1d4596a2bfddc22 | [
"MIT"
] | null | null | null | Python/Mundo01/teste/teste2.py | eStev4m/CursoPython | 8b52a618e67c80d66518ef91c1d4596a2bfddc22 | [
"MIT"
] | null | null | null | dia = int(input('Dia = '))
mes = str(input('Mês = '))
ano = int(input('Ano = '))
print('Você nasceu no dia {} de {} de {}. Correto?' .format(dia, mes, ano))
| 31.4 | 75 | 0.56051 | 24 | 157 | 3.666667 | 0.583333 | 0.181818 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.178344 | 157 | 4 | 76 | 39.25 | 0.682171 | 0 | 0 | 0 | 0 | 0 | 0.388535 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.25 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
6768a012fa3b71acafcce223de6b3ec16122e616 | 763 | py | Python | source/utils/converters.py | GoBoopADog/maelstrom | fce79fa964578dfee5d7beb4ec440deec5f8f25d | [
"MIT"
] | 2 | 2021-03-02T15:37:01.000Z | 2021-04-21T10:45:32.000Z | source/utils/converters.py | GoBoopADog/maelstrom | fce79fa964578dfee5d7beb4ec440deec5f8f25d | [
"MIT"
] | 1 | 2021-02-28T20:26:04.000Z | 2021-03-01T17:55:55.000Z | source/utils/converters.py | GoBoopADog/maelstrom | fce79fa964578dfee5d7beb4ec440deec5f8f25d | [
"MIT"
] | 4 | 2021-02-28T04:08:03.000Z | 2021-09-05T17:16:44.000Z | from discord.ext import commands
from typing import Union
from types import ModuleType
from .context import Context
class SourceConverter(commands.Converter):
"""A Converter that converts a string to a Command, Cog or Extension."""
async def convert(
self, ctx: Context, argument: str
) -> Union[commands.Command, commands.Cog, ModuleType]:
if command := ctx.bot.get_command(argument):
if command.name == "help":
return ctx.bot.help_command
return command
if cog := ctx.bot.get_cog(argument):
return cog
if extension := ctx.bot.extensions.get(argument):
return extension
raise commands.BadArgument("Not a valid Command, Cog nor Extension.")
| 30.52 | 77 | 0.655308 | 93 | 763 | 5.344086 | 0.44086 | 0.04829 | 0.036217 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.258191 | 763 | 24 | 78 | 31.791667 | 0.878092 | 0.086501 | 0 | 0 | 0 | 0 | 0.062229 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.235294 | 0 | 0.529412 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
676d466a108d99b100b2c3a5a8c5c61b4428733b | 280 | py | Python | SinglePackage/tests/test_single.py | CJosephides/PythonApplicationStructures | b82385f7a35f3097eac08011d24d9d1429cee171 | [
"RSA-MD"
] | 1 | 2019-02-05T11:45:11.000Z | 2019-02-05T11:45:11.000Z | SinglePackage/tests/test_single.py | CJosephides/PythonApplicationStructures | b82385f7a35f3097eac08011d24d9d1429cee171 | [
"RSA-MD"
] | null | null | null | SinglePackage/tests/test_single.py | CJosephides/PythonApplicationStructures | b82385f7a35f3097eac08011d24d9d1429cee171 | [
"RSA-MD"
] | null | null | null | from unittest import TestCase, main
from single_package.single import Single
class SingleTests(TestCase):
def setUp(self):
self.single = Single()
def test_Single(self):
self.assertIsInstance(self.single, Single)
if __name__ == "__main__":
main()
| 17.5 | 50 | 0.692857 | 33 | 280 | 5.575758 | 0.484848 | 0.086957 | 0.173913 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.210714 | 280 | 15 | 51 | 18.666667 | 0.832579 | 0 | 0 | 0 | 0 | 0 | 0.028571 | 0 | 0 | 0 | 0 | 0 | 0.111111 | 1 | 0.222222 | false | 0 | 0.222222 | 0 | 0.555556 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
677a3f9b4fdf1b1623975d077e5ac1590631e821 | 1,927 | py | Python | ADTs/ADT_of_staff.py | hitachinsk/DataStructure | 91214dd56d9c0493458e8a36af27a46b0a2fdc03 | [
"MIT"
] | null | null | null | ADTs/ADT_of_staff.py | hitachinsk/DataStructure | 91214dd56d9c0493458e8a36af27a46b0a2fdc03 | [
"MIT"
] | null | null | null | ADTs/ADT_of_staff.py | hitachinsk/DataStructure | 91214dd56d9c0493458e8a36af27a46b0a2fdc03 | [
"MIT"
] | null | null | null | import ADT_of_person as AP
import datetime as dm
#ADT Staff()
# Staff(self, str name, str sex, tuple birthday, tuple entey_date, int salary, str position)
# name(self)
# sex(self)
# en_year(self)
# salary(self)
# set_salary(self, new_salary)
# position(self)
# set_position(self, new_position)
# birthday(self)
# detail(self)
class Staff(AP.Person):
_id_num = 0
@classmethod
def _id_gen(cls, birthday):
cls._id_num += 1
birth_year = dm.date(*birthday).year
return '0{:04}{:05}'.format(birth_year, cls._id_num)
def __init__(self, name, sex, birthday, entry_date, salary, position):
if not isinstance(name, str) or sex not in ('male', 'female') or\
not isinstance(salary, int):
raise AP.PersonValueError()
try:
birth = dm.date(*birthday)
entry = dm.date(*enter_date)
except:
raise AP.PersonValueError()
self._name = name
self._sex = sex
self._birthday = birth
self._entry_date = entry
self._position = position
self._salary = salary
def name(self):
return self._name
def sex(self):
return self._sex
def en_year(self):
return self._entry_date.year
def set_salary(self, new_salary):
if not isinstance(new_salary, int):
raise TypeError
self._salaey = new_salary
def position(self):
return self._position
def set_position(self, new_position):
self._position = new_position
def birthday(self):
return self._birthday
def detail(self):
return ','.join((super.detail(),
'entry_date' + str(self._entry_date),
'position' + str(self._position),
'salary' + str(self._salary)))
| 28.338235 | 95 | 0.570317 | 229 | 1,927 | 4.572052 | 0.248908 | 0.068768 | 0.066858 | 0.030564 | 0.091691 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005393 | 0.326414 | 1,927 | 67 | 96 | 28.761194 | 0.801233 | 0.142709 | 0 | 0.044444 | 0 | 0 | 0.029225 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.044444 | 0.133333 | 0.466667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
678d54c4f215c915ab40d1921519e8d17b0d89cd | 4,954 | py | Python | smartlicense/settings/__init__.py | coblo/smartlicense | 288b40496646c225716fa3bf5f43b48ff645b96c | [
"MIT"
] | 6 | 2018-04-26T05:54:29.000Z | 2021-04-03T05:08:46.000Z | smartlicense/settings/__init__.py | coblo/smartlicense | 288b40496646c225716fa3bf5f43b48ff645b96c | [
"MIT"
] | 13 | 2018-03-31T07:58:02.000Z | 2022-02-10T10:35:28.000Z | smartlicense/settings/__init__.py | coblo/smartlicense | 288b40496646c225716fa3bf5f43b48ff645b96c | [
"MIT"
] | 2 | 2019-06-13T21:42:21.000Z | 2021-04-03T05:09:02.000Z | # -*- coding: utf-8 -*-
"""
Django settings for smartlicense project.
Generated by 'django-admin startproject' using Django 2.0.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref/settings/
"""
from os.path import dirname, abspath, join
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = dirname(dirname(dirname(abspath(__file__))))
SCRATCH_DIR = join(BASE_DIR, '.scratch')
SCRACTH_DB = join(SCRATCH_DIR, 'scratch.sqlite3')
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '3ka4^(c+fm7rw+@ttete34bt6tv3^8=r1!*_*-ovp1vu&qi=a9'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ADMINS = [('admin', 'admin@admin.org')]
ALLOWED_HOSTS = ['*']
# Application definition
INSTALLED_APPS = [
'martor',
'suit',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_markup',
'django_object_actions',
'smartlicense.apps.SmartLicenseConfig',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'smartlicense.urls'
MEDIA_ROOT = SCRATCH_DIR
MEDIA_URL = '/media/'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [join(BASE_DIR, 'smartlicense', 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'smartlicense.wsgi.application'
# Database
# https://docs.djangoproject.com/en/2.0/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': SCRACTH_DB,
}
}
# Password validation
# https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/2.0/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.0/howto/static-files/
STATIC_URL = '/static/'
# Mator
MARTOR_ENABLE_CONFIGS = {
'imgur': 'false', # to enable/disable imgur/custom uploader.
'mention': 'false', # to enable/disable mention
'jquery': 'true',
# to include/revoke jquery (require for admin default django)
}
# Custom project settings
NODE_IP = '127.0.0.1'
NODE_PORT = '9718'
NODE_USER = 'testuser'
NODE_PWD = 'testpassword'
STREAM_SMART_LICENSE = 'smart-license'
STREAM_SMART_LICENSE_ATTESTATION = 'smart-license'
STREAM_ISCC = 'iscc'
SUIT_CONFIG = {
'ADMIN_NAME': 'Smart License Demo',
'CONFIRM_UNSAVED_CHANGES': False,
'MENU_OPEN_FIRST_CHILD': True,
'SEARCH_URL': 'admin:smartlicense_mediacontent_changelist',
'LIST_PER_PAGE': 18,
'MENU': (
{'label': 'Smart Licenses', 'models': (
{'model': 'smartlicense.mediacontent'},
{'model': 'smartlicense.smartlicense'},
)},
{'label': 'Transactions', 'models': (
{'model': 'smartlicense.attestation'},
{'model': 'smartlicense.tokentransaction'},
)},
{'label': 'Configuration', 'models': (
{'model': 'smartlicense.template'},
{'model': 'smartlicense.rightsmodule'},
{'model': 'smartlicense.activationmode'},
)}
)
}
# Make sure deployment overrides settings
try:
from smartlicense.settings.config import *
except Exception:
print(
'No custom configuration found. Create a smartlicense/settings/config.py')
import sys
sys.exit(0)
| 27.370166 | 91 | 0.677836 | 530 | 4,954 | 6.211321 | 0.424528 | 0.059235 | 0.04678 | 0.053159 | 0.128493 | 0.128493 | 0.081106 | 0.081106 | 0.036452 | 0 | 0 | 0.012349 | 0.182681 | 4,954 | 180 | 92 | 27.522222 | 0.800692 | 0.244449 | 0 | 0.017241 | 1 | 0 | 0.516833 | 0.371128 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.051724 | 0.025862 | 0 | 0.025862 | 0.008621 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
67995960cafd98e838927288e205c58078f19735 | 141,788 | py | Python | pertama/andir.py | alitkurniawan48/BelajarGIS | c52556bc6fa74b849b9c3461410805807b742967 | [
"MIT"
] | 2 | 2020-02-09T14:47:07.000Z | 2020-02-09T14:47:12.000Z | pertama/andir.py | alitkurniawan48/BelajarGIS | c52556bc6fa74b849b9c3461410805807b742967 | [
"MIT"
] | 12 | 2019-12-11T06:45:59.000Z | 2020-01-06T09:35:35.000Z | pertama/andir.py | alitkurniawan48/BelajarGIS | c52556bc6fa74b849b9c3461410805807b742967 | [
"MIT"
] | 71 | 2019-12-09T13:52:54.000Z | 2021-05-28T16:19:09.000Z | import shapefile
class Andir:
def __init__(self):
self.kelurahan = shapefile.Writer(
'kelurahan_andir', shapeType=shapefile.POLYGON)
self.kelurahan.shapeType
self.kelurahan.field('kelurahan_di_andir', 'C')
self.kantor = shapefile.Writer(
'kantor_kelurahan_andir', shapeType=shapefile.POINT)
self.kantor.shapeType
self.kantor.field('kantor_kelurahan_di_andir', 'C')
self.jalan = shapefile.Writer(
'jalan_andir', shapeType=shapefile.POLYLINE)
self.jalan.shapeType
self.jalan.field('jalan_di_andir', 'C')
# Kelurahan
def kelurahanCampaka(self, nama):
self.kelurahan.record(nama)
self.kelurahan.poly([[
[107.5688412, -6.9100128],
[107.5691201, -6.9097865],
[107.5691094, -6.9097226],
[107.569163, -6.9097412],
[107.5691523, -6.9096667],
[107.5692167, -6.9096507],
[107.5693562, -6.9094057],
[107.5693213, -6.9093125],
[107.5693401, -6.9092593],
[107.5693937, -6.909254],
[107.5693588, -6.9092193],
[107.5694259, -6.9090809],
[107.5694232, -6.9089158],
[107.5694956, -6.9086948],
[107.5695412, -6.9086335],
[107.5695734, -6.9085164],
[107.5696029, -6.9084791],
[107.5696002, -6.9084285],
[107.5696888, -6.908298],
[107.5697504, -6.9080557],
[107.5697183, -6.9079758],
[107.5699838, -6.9070998],
[107.570016, -6.9070679],
[107.5701353, -6.9069387],
[107.5701655, -6.906761],
[107.5701471, -6.9066948],
[107.5701499, -6.906643],
[107.570264, -6.9064906],
[107.5702372, -6.9063532],
[107.5701916, -6.9062912],
[107.5701796, -6.9062082],
[107.5702621, -6.9061069],
[107.5702705, -6.9060224],
[107.5702735, -6.9059272],
[107.5702582, -6.9058752],
[107.5702812, -6.9058353],
[107.570331, -6.9053586],
[107.5703968, -6.9051163],
[107.5703898, -6.9050277],
[107.5704728, -6.9047611],
[107.570537, -6.9044838],
[107.5705486, -6.9044575],
[107.5705852, -6.904431],
[107.5706371, -6.9043805],
[107.5706415, -6.9043086],
[107.5706277, -6.9042101],
[107.570663, -6.9041775],
[107.5706565, -6.9041212],
[107.5707491, -6.9039007],
[107.5707861, -6.9038517],
[107.5708515, -6.903726],
[107.571029, -6.9033889],
[107.5711822, -6.9031591],
[107.5712829, -6.9031001],
[107.5713198, -6.9030174],
[107.5713183, -6.9029548],
[107.5712337, -6.9028629],
[107.5709224, -6.9026604],
[107.5709029, -6.9026318],
[107.5708951, -6.9026101],
[107.570902, -6.9025687],
[107.5709255, -6.902512],
[107.5699489, -6.9018673],
[107.5693062, -6.9014289],
[107.5681693, -6.9006596],
[107.567794, -6.9004107],
[107.5674402, -6.9001352],
[107.5671834, -6.8999973],
[107.5668738, -6.8997586],
[107.5673784, -6.8990922],
[107.5674804, -6.898867],
[107.5674938, -6.8987944],
[107.5676575, -6.8983809],
[107.5678829, -6.8980119],
[107.5679768, -6.8978061],
[107.5680828, -6.897634],
[107.5682431, -6.8973935],
[107.5683634, -6.897188],
[107.5684758, -6.8969693],
[107.5685892, -6.8969163],
[107.5686339, -6.8968247],
[107.5686241, -6.8967202],
[107.5686192, -6.8965988],
[107.5685952, -6.8964875],
[107.5685484, -6.8964145],
[107.5685499, -6.8963149],
[107.5685818, -6.896162],
[107.5685851, -6.8960259],
[107.5684635, -6.8959323],
[107.5684081, -6.8959108],
[107.5683958, -6.8958547],
[107.5683944, -6.8957056],
[107.568337, -6.8955877],
[107.5682957, -6.895382],
[107.5681746, -6.8949567],
[107.5682117, -6.894851],
[107.5680265, -6.8945171],
[107.5680009, -6.8944163],
[107.5678567, -6.8942487],
[107.56782, -6.8941755],
[107.5678101, -6.894097],
[107.5678994, -6.8939173],
[107.5679365, -6.8938042],
[107.5679396, -6.8937164],
[107.5678969, -6.8936179],
[107.5677161, -6.8934741],
[107.5671385, -6.8930081],
[107.5671064, -6.8928797],
[107.5669697, -6.8927356],
[107.5669268, -6.8925901],
[107.5670463, -6.8923704],
[107.5668794, -6.8920902],
[107.5668064, -6.892011],
[107.56655, -6.8918584],
[107.5662883, -6.891759],
[107.5660598, -6.8918053],
[107.5648658, -6.8913936],
[107.5648508, -6.8916644],
[107.5646481, -6.8921482],
[107.564771, -6.8922401],
[107.5649719, -6.892278],
[107.5651165, -6.8924518],
[107.5647567, -6.8931561],
[107.5645768, -6.8931904],
[107.5645606, -6.8932806],
[107.5642931, -6.8933683],
[107.5639611, -6.8939379],
[107.5639608, -6.8940531],
[107.5650172, -6.894951],
[107.5649834, -6.8950079],
[107.5650354, -6.895118],
[107.5650229, -6.8952121],
[107.5648317, -6.8955468],
[107.5646603, -6.8960059],
[107.5645372, -6.8961801],
[107.5644152, -6.8963125],
[107.5643791, -6.896405],
[107.5642962, -6.8964301],
[107.5642355, -6.8965784],
[107.563983, -6.8967268],
[107.5639292, -6.8968649],
[107.563634, -6.8969206],
[107.5630975, -6.896794],
[107.5630412, -6.8968213],
[107.5628963, -6.8970962],
[107.5617891, -6.8964114],
[107.5614757, -6.8962167],
[107.5611903, -6.8960248],
[107.5608727, -6.8958382],
[107.5602911, -6.8954171],
[107.5601647, -6.8953644],
[107.5599015, -6.8953304],
[107.5621585, -6.8990243],
[107.5648286, -6.9034798],
[107.5675416, -6.9078873],
[107.568771, -6.909903],
[107.5688412, -6.9100128],
]])
def kelurahanCiroyom(self, nama):
self.kelurahan.record(nama)
self.kelurahan.poly([[
[107.5835421, -6.9108951],
[107.5834349, -6.9110762],
[107.5831184, -6.9118271],
[107.5827777, -6.912759],
[107.5825149, -6.913691],
[107.5830862, -6.9138388],
[107.5833719, -6.9138914],
[107.5835388, -6.9138911],
[107.5836441, -6.9139414],
[107.5833732, -6.9150303],
[107.5835301, -6.9150849],
[107.5847384, -6.9154724],
[107.5852265, -6.9156322],
[107.5851635, -6.9173336],
[107.5851589, -6.9176585],
[107.5850925, -6.9185052],
[107.592997, -6.9194399],
[107.5933806, -6.9166693],
[107.5933698, -6.9164523],
[107.593343, -6.9163811],
[107.593351, -6.9162309],
[107.5932464, -6.9160569],
[107.5931579, -6.9159776],
[107.5928159, -6.9157064],
[107.5928199, -6.9154431],
[107.5925933, -6.91527],
[107.5926596, -6.9150317],
[107.5926606, -6.9149552],
[107.5928542, -6.9143204],
[107.5929564, -6.9143133],
[107.5929807, -6.9142711],
[107.592966, -6.9140969],
[107.5929728, -6.9140132],
[107.5916209, -6.9139234],
[107.5901283, -6.9139075],
[107.5891399, -6.9137692],
[107.588118, -6.9135059],
[107.5868466, -6.9130123],
[107.5852239, -6.9120075],
[107.5847424, -6.9116616],
[107.5835421, -6.9108951],
]])
def kelurahanDungusCariang(self, nama):
self.kelurahan.record(nama)
self.kelurahan.poly([[
[107.5791752, -6.9079447],
[107.57897, -6.9082596],
[107.5787527, -6.9087209],
[107.5769161, -6.9168328],
[107.5768158, -6.9174711],
[107.57737, -6.9175158],
[107.578077, -6.9176377],
[107.5808391, -6.9179676],
[107.581166, -6.918042],
[107.5850925, -6.9185052],
[107.5851589, -6.9176585],
[107.5851635, -6.9173336],
[107.5851729, -6.9170687],
[107.5852265, -6.9156322],
[107.5847384, -6.9154724],
[107.5835301, -6.9150849],
[107.5833732, -6.9150303],
[107.5836441, -6.9139414],
[107.5835388, -6.9138911],
[107.5833719, -6.9138914],
[107.5830862, -6.9138388],
[107.5825149, -6.913691],
[107.5827777, -6.912759],
[107.5831184, -6.9118271],
[107.5834349, -6.9110762],
[107.5835421, -6.9108951],
[107.5791752, -6.9079447],
]])
def kelurahanGaruda(self, nama):
self.kelurahan.record(nama)
self.kelurahan.poly([[
[107.5768158, -6.9174711],
[107.5769161, -6.9168328],
[107.5772109, -6.91553],
[107.5773243, -6.9150268],
[107.5774343, -6.9145455],
[107.5775151, -6.9141873],
[107.5775811, -6.9138958],
[107.5777239, -6.9132647],
[107.5779033, -6.9124703],
[107.57808, -6.9116905],
[107.578135, -6.9114494],
[107.5781879, -6.9112091],
[107.5785809, -6.9094757],
[107.5786521, -6.9091642],
[107.5787527, -6.9087209],
[107.57897, -6.9082596],
[107.5791752, -6.9079447],
[107.5752133, -6.9053072],
[107.5749994, -6.9056383],
[107.5748938, -6.905937],
[107.5746716, -6.9063303],
[107.5749331, -6.9064624],
[107.574801, -6.9066536],
[107.5747065, -6.9068635],
[107.5744047, -6.9067304],
[107.5742339, -6.9071245],
[107.5739906, -6.9076517],
[107.5739769, -6.9079446],
[107.5740325, -6.9080411],
[107.5737868, -6.9084887],
[107.5734708, -6.9094448],
[107.5733059, -6.909819],
[107.5737331, -6.9100447],
[107.5749462, -6.910534],
[107.5760434, -6.9109361],
[107.5760824, -6.9109827],
[107.5761964, -6.9110346],
[107.5760496, -6.9114401],
[107.5763302, -6.9115669],
[107.5760199, -6.9123399],
[107.5758189, -6.9122928],
[107.5755187, -6.9124428],
[107.5753446, -6.912919],
[107.5753835, -6.9129355],
[107.5750134, -6.9137162],
[107.5746031, -6.9135943],
[107.5745069, -6.913683],
[107.5743743, -6.9139497],
[107.5739091, -6.9150764],
[107.5736437, -6.9150009],
[107.5734682, -6.9149867],
[107.5730218, -6.9153425],
[107.5729636, -6.9155205],
[107.572743, -6.9155911],
[107.5725292, -6.9158665],
[107.5724994, -6.9158819],
[107.573832, -6.9170058],
[107.5753239, -6.9173423],
[107.5768158, -6.9174711],
]])
def kelurahanKebonJeruk(self, nama):
self.kelurahan.record(nama)
self.kelurahan.poly([[
[107.592997, -6.9194399],
[107.6041614, -6.9207853],
[107.6045322, -6.9159498],
[107.6045972, -6.9154333],
[107.6046274, -6.9148208],
[107.6046281, -6.9145413],
[107.6022538, -6.9144167],
[107.5983239, -6.9143134],
[107.5952277, -6.914224],
[107.5934297, -6.9139855],
[107.5929728, -6.9140132],
[107.592966, -6.9140969],
[107.5929807, -6.9142711],
[107.5929564, -6.9143133],
[107.5928542, -6.9143204],
[107.5926606, -6.9149552],
[107.5926596, -6.9150317],
[107.5925933, -6.91527],
[107.5928199, -6.9154431],
[107.5928159, -6.9157064],
[107.5931579, -6.9159776],
[107.5932464, -6.9160569],
[107.593351, -6.9162309],
[107.593343, -6.9163811],
[107.5933698, -6.9164523],
[107.5933806, -6.9166693],
[107.592997, -6.9194399],
]])
def kelurahanMaleber(self, nama):
self.kelurahan.record(nama)
self.kelurahan.poly([[
[107.5709255, -6.902512],
[107.570902, -6.9025687],
[107.5708951, -6.9026101],
[107.5709029, -6.9026318],
[107.5709224, -6.9026604],
[107.5712337, -6.9028629],
[107.5713183, -6.9029548],
[107.5713198, -6.9030174],
[107.5712829, -6.9031001],
[107.5711822, -6.9031591],
[107.571029, -6.9033889],
[107.5707861, -6.9038517],
[107.5707491, -6.9039007],
[107.5706565, -6.9041212],
[107.570663, -6.9041775],
[107.5706277, -6.9042101],
[107.5706415, -6.9043086],
[107.5706371, -6.9043805],
[107.5705852, -6.904431],
[107.5705486, -6.9044575],
[107.570537, -6.9044838],
[107.5704728, -6.9047611],
[107.5703898, -6.9050277],
[107.5703968, -6.9051163],
[107.570331, -6.9053586],
[107.5702812, -6.9058353],
[107.5702582, -6.9058752],
[107.5702735, -6.9059272],
[107.5702705, -6.9060224],
[107.5702621, -6.9061069],
[107.5701796, -6.9062082],
[107.5701916, -6.9062912],
[107.5702372, -6.9063532],
[107.570264, -6.9064906],
[107.5701499, -6.906643],
[107.5701471, -6.9066948],
[107.5701655, -6.906761],
[107.5701353, -6.9069387],
[107.570016, -6.9070679],
[107.5699838, -6.9070998],
[107.5697183, -6.9079758],
[107.5697504, -6.9080557],
[107.5696888, -6.908298],
[107.5696002, -6.9084285],
[107.5696029, -6.9084791],
[107.5695734, -6.9085164],
[107.5695412, -6.9086335],
[107.5694956, -6.9086948],
[107.5694232, -6.9089158],
[107.5694259, -6.9090809],
[107.5693588, -6.9092193],
[107.5693937, -6.909254],
[107.5693401, -6.9092593],
[107.5693213, -6.9093125],
[107.5693403, -6.9093623],
[107.5693562, -6.9094057],
[107.5692167, -6.9096507],
[107.5691523, -6.9096667],
[107.569163, -6.9097412],
[107.5691094, -6.9097226],
[107.5691201, -6.9097865],
[107.5688412, -6.9100128],
[107.5700534, -6.9120367],
[107.5714501, -6.9143263],
[107.5715541, -6.9146136],
[107.5716975, -6.914762],
[107.5720703, -6.9154531],
[107.5724994, -6.9158819],
[107.5725292, -6.9158665],
[107.572743, -6.9155911],
[107.5729636, -6.9155205],
[107.5730218, -6.9153425],
[107.5734682, -6.9149867],
[107.5736437, -6.9150009],
[107.5739091, -6.9150764],
[107.5742, -6.9143704],
[107.5743743, -6.9139497],
[107.5745069, -6.913683],
[107.5746031, -6.9135943],
[107.5750134, -6.9137162],
[107.5753835, -6.9129355],
[107.5753446, -6.912919],
[107.5755187, -6.9124428],
[107.5758189, -6.9122928],
[107.5760199, -6.9123399],
[107.5763302, -6.9115669],
[107.5760496, -6.9114401],
[107.5761964, -6.9110346],
[107.5760824, -6.9109827],
[107.5760434, -6.9109361],
[107.5749462, -6.910534],
[107.5737331, -6.9100447],
[107.5733059, -6.909819],
[107.5734708, -6.9094448],
[107.5737868, -6.9084887],
[107.5740325, -6.9080411],
[107.5739769, -6.9079446],
[107.5739906, -6.9076517],
[107.5742339, -6.9071245],
[107.5744047, -6.9067304],
[107.5747065, -6.9068635],
[107.574801, -6.9066536],
[107.5749331, -6.9064624],
[107.5746716, -6.9063303],
[107.5748938, -6.905937],
[107.5749994, -6.9056383],
[107.5752133, -6.9053072],
[107.5709255, -6.902512],
]])
# Kantor Kelurahan
def kantorKelurahanCampaka(self, nama):
self.kantor.record(nama)
self.kantor.point(107.5631291, -6.8977897)
def kantorKelurahanCiroyom(self, nama):
self.kantor.record(nama)
self.kantor.point(107.5875214, -6.9144205)
def kantorKelurahanDungusCariang(self, nama):
self.kantor.record(nama)
self.kantor.point(107.5806731, -6.9125569)
def kantorKelurahanGaruda(self, nama):
self.kantor.record(nama)
self.kantor.point(107.5764865, -6.9160994)
def kantorKelurahanKebonJeruk(self, nama):
self.kantor.record(nama)
self.kantor.point(107.6011905, -6.918966)
def kantorKelurahanMaleber(self, nama):
self.kantor.record(nama)
self.kantor.point(107.5734513, -6.9073058)
# Jalan
def jalanKelurahanCampaka(self, nama):
self.jalan.record(nama)
self.jalan.line([[
[107.5696727,-6.903724],
[107.5697268,-6.9035733],
[107.5696674,-6.9035376],
[107.5697241,-6.9035733],
[107.5699168,-6.9036068],
[107.5701264,-6.9035813],
[107.5702467,-6.9034683],
[107.5703674,-6.9031728],
[107.5704988,-6.9029597],
[107.5707939,-6.9027334],
[107.5708904,-6.902808],
[107.5709445,-6.902873],
[107.5710889,-6.9029757],
[107.5709418,-6.9028703],
[107.5708904,-6.902808],
[107.5707939,-6.9027334],
[107.5707916,-6.9025375],
[107.5709002,-6.902592],
[107.5707862,-6.9025348],
[107.5705998,-6.9023923],
[107.5704737,-6.902576],
[107.5705998,-6.9023923],
[107.5704469,-6.9022991],
[107.570117,-6.9028236],
[107.5699051,-6.9027145],
[107.5702619,-6.9021713],
[107.5704469,-6.9022991],
[107.5702619,-6.9021713],
[107.5697415,-6.9018784],
[107.5696905,-6.9020248],
[107.5697415,-6.9018784],
[107.5694612,-6.9017094],
[107.5693271,-6.9019916],
[107.5694639,-6.901704],
[107.5692372,-6.9016014],
[107.569192,-6.9015038],
[107.5679511,-6.9007108],
[107.5667267,-6.8999008],
[107.5679511,-6.9007108],
[107.569192,-6.9015038],
[107.5692372,-6.9016014],
[107.5691916,-6.9016361],
[107.5690106,-6.9015496],
[107.5677473,-6.9007854],
[107.5676952,-6.9007974],
[107.5672929,-6.9015004],
[107.5673036,-6.9015696],
[107.5678079,-6.9018359],
[107.5678814,-6.9018904],
[107.5678814,-6.9019703],
[107.567817,-6.9020156],
[107.567722,-6.9019957],
[107.567773,-6.9018186],
[107.567722,-6.9019957],
[107.5676416,-6.9022779],
[107.5676843,-6.902328],
[107.5675397,-6.9027626],
[107.5677621,-6.9028579],
[107.5675397,-6.9027626],
[107.5676816,-6.9023226],
[107.5684194,-6.9025176],
[107.5684326,-6.9024771],
[107.5688217,-6.9014312],
[107.5690106,-6.9015496],
[107.5691916,-6.9016361],
[107.5689154,-6.9023657],
[107.5699051,-6.9027145],
[107.5689154,-6.9023657],
[107.5688493,-6.902523],
[107.5703674,-6.9031728],
[107.5702467,-6.9034683],
[107.569681,-6.9032161],
[107.5697827,-6.9029278],
[107.5688493,-6.902523],
[107.5687598,-6.9027677],
[107.569426,-6.9030878],
[107.5687598,-6.9027677],
[107.5686428,-6.9029574],
[107.5689566,-6.9030772],
[107.5692597,-6.9032343],
[107.5689566,-6.9030772],
[107.5686428,-6.9029574],
[107.5684084,-6.9033349],
[107.5680066,-6.9031487],
[107.5684084,-6.9033349],
[107.5681912,-6.9035905],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5688412,-6.9100128],
[107.5684508,-6.9093516],
[107.5687715,-6.9091011],
[107.5688948,-6.9088615],
[107.5689996,-6.9083494],
[107.5688948,-6.9088615],
[107.5687715,-6.9091011],
[107.5684508,-6.9093516],
[107.5682389,-6.9089975],
[107.568412,-6.908723],
[107.5682967,-6.9089014],
[107.5681156,-6.9087791],
[107.5683933,-6.908313],
[107.5683718,-6.9082517],
[107.5683933,-6.908313],
[107.5685354,-6.9083875],
[107.5687366,-6.9081665],
[107.5688761,-6.9082224],
[107.5687366,-6.9081665],
[107.5685354,-6.9083875],
[107.5683933,-6.908313],
[107.5681867,-6.9086591],
[107.5680821,-6.9085792],
[107.5681867,-6.9086591],
[107.5681156,-6.9087791],
[107.5682389,-6.9089975],
[107.5681156,-6.9087791],
[107.5675416,-6.9078873],
[107.5665894,-6.9062815],
[107.5675416,-6.9078873],
[107.5680661,-6.9075027],
[107.5683826,-6.9072897],
[107.5689941,-6.9070767],
[107.5685623,-6.9072264],
[107.568726,-6.9067624],
[107.5687947,-6.9066466],
[107.5689887,-6.9064269],
[107.5689083,-6.9063497],
[107.5686454,-6.9062326],
[107.5689083,-6.9063497],
[107.5691032,-6.9059463],
[107.5693821,-6.9055415],
[107.5693419,-6.905435],
[107.569248,-6.9052673],
[107.5691914,-6.905117],
[107.5691941,-6.9050238],
[107.5692531,-6.9048854],
[107.5691941,-6.9050238],
[107.5691914,-6.905117],
[107.569248,-6.9052726],
[107.5693419,-6.9054377],
[107.5693658,-6.905322],
[107.5698378,-6.9049999],
[107.5699505,-6.90488],
[107.5700098,-6.9047161],
[107.5699505,-6.90488],
[107.5698378,-6.9049999],
[107.5693658,-6.905322],
[107.5693419,-6.9054404],
[107.5693821,-6.9055442],
[107.5695592,-6.9057013],
[107.5696459,-6.9058065],
[107.5689887,-6.9064269],
[107.5696459,-6.9058065],
[107.5700026,-6.9054763],
[107.5701421,-6.9055136],
[107.570185,-6.9054923],
[107.5702655,-6.9051222],
[107.5702145,-6.9050184],
[107.5701957,-6.9049278],
[107.5702923,-6.904784],
[107.5703826,-6.9046682],
[107.5704148,-6.9045137],
[107.5703746,-6.9044711],
[107.569957,-6.9042754],
[107.5698873,-6.9043047],
[107.5697764,-6.9042687],
[107.5696459,-6.9041396],
[107.5696539,-6.9040651],
[107.5696459,-6.9041396],
[107.5697737,-6.9042687],
[107.5698873,-6.9043047],
[107.569957,-6.9042754],
[107.5699454,-6.9042022],
[107.569983,-6.9039732],
[107.5700151,-6.9038534],
[107.5700876,-6.9036909],
[107.5701492,-6.903659],
[107.5702512,-6.9036084],
[107.5703692,-6.903433],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5654548,-6.9044202],
[107.565461,-6.9044548],
[107.5665894,-6.9062815],
[107.5669547,-6.9055636],
[107.5676279,-6.9058565],
[107.5669547,-6.9055636],
[107.5669681,-6.9054997],
[107.5666784,-6.9053719],
[107.5669681,-6.9054997],
[107.5670673,-6.9052734],
[107.5668984,-6.9052042],
[107.5670673,-6.9052734],
[107.5670888,-6.9052121],
[107.5673731,-6.9053639],
[107.5678103,-6.905537],
[107.5677298,-6.9057314],
[107.5676467,-6.9057048],
[107.5677298,-6.9057314],
[107.5678103,-6.905537],
[107.5679069,-6.9053666],
[107.5680946,-6.9054278],
[107.5679069,-6.9053666],
[107.5678103,-6.905537],
[107.5673731,-6.9053639],
[107.5670888,-6.9052121],
[107.5671639,-6.9050471],
[107.5673976,-6.9051418],
[107.5671639,-6.9050471],
[107.5673141,-6.9046796],
[107.5669654,-6.9045518],
[107.5673141,-6.9046796],
[107.5673838,-6.9045358],
[107.5676574,-6.9046423],
[107.5676789,-6.9047302],
[107.5678589,-6.9049181],
[107.5681107,-6.9050271],
[107.5684379,-6.9051376],
[107.5681107,-6.9050271],
[107.567982,-6.9049718],
[107.5678961,-6.9049349],
[107.5679954,-6.9046343],
[107.5682126,-6.9046876],
[107.5682475,-6.9045491],
[107.568336,-6.9045624],
[107.5684084,-6.9043068],
[107.5684648,-6.9042882],
[107.5686207,-6.9043856],
[107.5688376,-6.9044905],
[107.5690575,-6.9039127],
[107.568787,-6.9037945],
[107.5687437,-6.9038062],
[107.5686874,-6.9039207],
[107.5686096,-6.9039154],
[107.5684648,-6.9042882],
[107.5686096,-6.9039154],
[107.5686874,-6.9039207],
[107.5687437,-6.9038062],
[107.568556,-6.9037343],
[107.568784,-6.9032177],
[107.568556,-6.9037343],
[107.5680624,-6.9035426],
[107.5681322,-6.9034095],
[107.5680624,-6.9035426],
[107.567864,-6.9035053],
[107.5676682,-6.9039234],
[107.5679954,-6.9040672],
[107.5676682,-6.9039234],
[107.5674589,-6.9043707],
[107.5679954,-6.9046343],
[107.5674589,-6.9043707],
[107.5673838,-6.9045358],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5652,-6.9039968],
[107.5654548,-6.9044202],
[107.5658421,-6.9040966],
[107.5657401,-6.9039155],
[107.5658421,-6.9040966],
[107.5659385,-6.9041193],
[107.5660191,-6.9041552],
[107.5663946,-6.9039155],
[107.5665502,-6.9037025],
[107.5666735,-6.9036812],
[107.5667326,-6.9035641],
[107.5667326,-6.9034575],
[107.5665931,-6.9034096],
[107.5667326,-6.9034575],
[107.5667326,-6.9035641],
[107.5672553,-6.9037584],
[107.5674243,-6.9037904],
[107.5672553,-6.9037584],
[107.5675265,-6.9032179],
[107.5675855,-6.9031939],
[107.5676123,-6.9030981],
[107.5675855,-6.9031939],
[107.5676821,-6.9032179],
[107.567733,-6.9031966],
[107.5678108,-6.902933],
[107.567733,-6.9031966],
[107.5676821,-6.9032179],
[107.5675855,-6.9031939],
[107.5675265,-6.9032179],
[107.5670491,-6.9041925],
[107.5663946,-6.9039155],
[107.5667755,-6.9040806],
[107.5665984,-6.9044587],
[107.5664697,-6.9046984],
[107.5665984,-6.9044587],
[107.5660191,-6.9041552],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5671064,-6.8928797],
[107.5670844,-6.8929687],
[107.5671826,-6.8930938],
[107.567197,-6.8931524],
[107.5671853,-6.8930912],
[107.5672721,-6.8931284],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5655931,-6.8933281],
[107.5659042,-6.8934826],
[107.5658211,-6.8936264],
[107.5659042,-6.8934826],
[107.5663951,-6.8937382],
[107.5665453,-6.8933974],
[107.5663951,-6.8937382],
[107.5663887,-6.8937888],
[107.5661386,-6.8941398],
[107.5661306,-6.8942223],
[107.5659696,-6.8944886],
[107.5661306,-6.8942223],
[107.5661386,-6.8941398],
[107.5663914,-6.8937888],
[107.5663951,-6.8937382],
[107.5666767,-6.8939246],
[107.5665345,-6.8941536],
[107.5666767,-6.8939246],
[107.5667062,-6.8939379],
[107.5670378,-6.8933335],
[107.5671129,-6.893171],
[107.567197,-6.8931524],
[107.5675913,-6.8934347],
[107.5675618,-6.8934853],
[107.5673945,-6.8934293],
[107.5673473,-6.8934426],
[107.567197,-6.8937036],
[107.5674331,-6.8938474],
[107.567197,-6.8937036],
[107.5670468,-6.8939539],
[107.567197,-6.8937036],
[107.5673473,-6.8934426],
[107.5673918,-6.8934267],
[107.5675618,-6.8934853],
[107.5677549,-6.8935971],
[107.5677818,-6.893677],
[107.5676852,-6.8938634],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5648649,-6.8914296],
[107.5654767,-6.8916706],
[107.5654982,-6.8916147],
[107.5654767,-6.8916706],
[107.5658814,-6.891821],
[107.5658496,-6.8919396],
[107.5658814,-6.891821],
[107.5660856,-6.891857],
[107.5661017,-6.8918038],
[107.5660933,-6.8918396],
[107.566096,-6.8919515],
[107.5658559,-6.8926917],
[107.5657691,-6.8926799],
[107.5655824,-6.8926145],
[107.5657691,-6.8926825],
[107.5658559,-6.8926917],
[107.5655931,-6.8933281],
[107.5654161,-6.8932989],
[107.5655555,-6.8928994],
[107.5654161,-6.8932989],
[107.5652122,-6.8935172],
[107.5654161,-6.8932989],
[107.5655931,-6.8933281],
[107.5657084,-6.8930539],
[107.5661698,-6.893227],
[107.5663522,-6.8928116],
[107.5664836,-6.8929127],
[107.5663522,-6.8928116],
[107.5664809,-6.8924894],
[107.5660035,-6.8922524],
[107.5664809,-6.8924894],
[107.5665332,-6.8923775],
[107.5669328,-6.8925346],
[107.5665332,-6.8923775],
[107.5665842,-6.8922337],
[107.5665577,-6.8921633],
[107.566096,-6.8919515],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5645095,-6.8932962],
[107.564906,-6.8936092],
[107.5650572,-6.8937553],
[107.5652261,-6.893517],
[107.5650853,-6.8934371],
[107.5650424,-6.8933612],
[107.5650531,-6.8932494],
[107.5651076,-6.8930699],
[107.5648662,-6.8929607],
[107.5651076,-6.8930699],
[107.5652712,-6.892713],
[107.5652364,-6.8927836],
[107.5650003,-6.8926851],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5650859,-6.894871],
[107.5649973,-6.8950414],
[107.5650724,-6.8950787],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5647506,-6.8957444],
[107.5650142,-6.8958335],
[107.565051,-6.8958136],
[107.565338,-6.8952704],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5599402,-6.8953401],
[107.5601682,-6.8956996],
[107.5602335,-6.8957136],
[107.5606604,-6.8959371],
[107.5607914,-6.8960384],
[107.5608343,-6.8961183],
[107.5608396,-6.8962195],
[107.5606697,-6.8965144],
[107.5601682,-6.8956996],
[107.5606697,-6.8965144],
[107.561225,-6.8974171],
[107.5615853,-6.8971515],
[107.5618964,-6.8967574],
[107.5615853,-6.8971515],
[107.561225,-6.8974171],
[107.5613001,-6.8975396],
[107.5615048,-6.8974124],
[107.5613001,-6.8975396],
[107.5615254,-6.897915],
[107.5622451,-6.8974817],
[107.562449,-6.8975935],
[107.5624651,-6.8976841],
[107.562288,-6.8978598],
[107.5624651,-6.8976841],
[107.562449,-6.8975935],
[107.5622451,-6.8974817],
[107.5615254,-6.897915],
[107.5619116,-6.8985328],
[107.5621378,-6.8983551],
[107.5619116,-6.8985328],
[107.5620162,-6.8987299],
[107.5621088,-6.8986744],
[107.5620162,-6.8987299],
[107.5625634,-6.8996299],
[107.5629886,-6.8992762],
[107.5632032,-6.8989993],
[107.5634816,-6.8983231],
[107.56331,-6.8982086],
[107.5631624,-6.898198],
[107.5630498,-6.8980702],
[107.5628835,-6.8981447],
[107.5627816,-6.8983311],
[107.5628835,-6.8981447],
[107.5630498,-6.8980702],
[107.5631281,-6.8979182],
[107.5631651,-6.8978904],
[107.5633797,-6.8980076],
[107.56331,-6.8982086],
[107.5633797,-6.8980076],
[107.5631651,-6.8978904],
[107.5632751,-6.8976588],
[107.564702,-6.8986493],
[107.5641661,-6.8996427],
[107.5642117,-6.8997129],
[107.564378,-6.8998451],
[107.5646194,-6.8994931],
[107.5643512,-6.8993173],
[107.5646194,-6.8994931],
[107.5647642,-6.8992588],
[107.5644906,-6.899083],
[107.5647642,-6.8992588],
[107.5649922,-6.8988972],
[107.564702,-6.8986493],
[107.5649922,-6.8988972],
[107.5652202,-6.8990516],
[107.5649834,-6.8994079],
[107.5647642,-6.8992588],
[107.5649861,-6.8994079],
[107.5648574,-6.8996475],
[107.5646194,-6.8994931],
[107.5648574,-6.8996502],
[107.5646033,-6.9000368],
[107.5643699,-6.8998744],
[107.564378,-6.8998451],
[107.5643699,-6.8998744],
[107.5644263,-6.8999223],
[107.56404,-6.9004975],
[107.5645309,-6.9007957],
[107.5647079,-6.9005507],
[107.5646489,-6.9004629],
[107.5642385,-6.9001993],
[107.5646489,-6.9004629],
[107.5647079,-6.9005507],
[107.5649171,-6.9002392],
[107.5646033,-6.9000368],
[107.5649171,-6.9002392],
[107.5655255,-6.8992671],
[107.5652202,-6.8990516],
[107.5655255,-6.8992671],
[107.5651183,-6.8999223],
[107.5655742,-6.9002392],
[107.5652999,-6.9000443],
[107.5656735,-6.8995149],
[107.5654796,-6.8993493],
[107.5656735,-6.8995149],
[107.5658688,-6.8996505],
[107.5658237,-6.899688],
[107.5654991,-6.9001913],
[107.5658237,-6.899688],
[107.5658688,-6.8996505],
[107.5659544,-6.8996715],
[107.5664589,-6.9000073],
[107.5660753,-6.899757],
[107.5662121,-6.8996239],
[107.5667267,-6.8999008],
[107.566869,-6.8996741],
[107.5667993,-6.8995809],
[107.5664962,-6.8993839],
[107.5665605,-6.8993014],
[107.5664935,-6.8993839],
[107.566287,-6.8992534],
[107.5663781,-6.8992028],
[107.5662789,-6.8992561],
[107.5659168,-6.8990324],
[107.5659544,-6.8988939],
[107.5663325,-6.8980099],
[107.5676199,-6.8984603],
[107.5663325,-6.8980099],
[107.5651229,-6.8975945],
[107.5649592,-6.8979407],
[107.5649405,-6.8980845],
[107.5653052,-6.8982549],
[107.5649405,-6.8980845],
[107.5648198,-6.8984067],
[107.5659168,-6.8990324],
[107.5648036,-6.8984017],
[107.563999,-6.8978315],
[107.5648036,-6.8984017],
[107.5649405,-6.8980845],
[107.5649592,-6.8979407],
[107.5651229,-6.8975945],
[107.5636133,-6.8970598],
[107.5649061,-6.8975232],
[107.5654991,-6.8962457],
[107.5655847,-6.896221],
[107.5683769,-6.897161],
[107.5669875,-6.896703],
[107.5671217,-6.8963249],
[107.5669849,-6.8962583],
[107.5669527,-6.8962264],
[107.5666764,-6.8960719],
[107.5667461,-6.8958616],
[107.5665664,-6.895779],
[107.5663358,-6.8961145],
[107.5662124,-6.896253],
[107.5663358,-6.8961145],
[107.5665664,-6.895779],
[107.566612,-6.8956272],
[107.5667087,-6.8956643],
[107.5668133,-6.8956696],
[107.5668749,-6.8956991],
[107.566808,-6.8956696],
[107.5667087,-6.8956669],
[107.566612,-6.8956272],
[107.5665745,-6.8957338],
[107.5662687,-6.895582],
[107.5665745,-6.8957338],
[107.5665986,-6.8956619],
[107.5666469,-6.8955607],
[107.5664591,-6.8954329],
[107.5664053,-6.8953507],
[107.5661614,-6.8952065],
[107.5661105,-6.8952518],
[107.5660675,-6.8953796],
[107.5665986,-6.8956619],
[107.5660675,-6.8953796],
[107.5658852,-6.8960134],
[107.5659442,-6.8960293],
[107.5660622,-6.896048],
[107.5659442,-6.8960293],
[107.5658852,-6.8960134],
[107.5657618,-6.8962716],
[107.5658852,-6.8960134],
[107.56603,-6.8955234],
[107.5655177,-6.8952598],
[107.5656006,-6.895143],
[107.5656275,-6.8950498],
[107.5656572,-6.8949509],
[107.5656275,-6.8950524],
[107.5656033,-6.8951456],
[107.5655177,-6.8952598],
[107.5653834,-6.8955823],
[107.5652627,-6.8957927],
[107.5653807,-6.8955823],
[107.5655177,-6.8952598],
[107.56603,-6.8955234],
[107.5660675,-6.8953796],
[107.5661105,-6.8952518],
[107.5661614,-6.8952065],
[107.566384,-6.8948391],
[107.5662164,-6.8947043],
[107.5658945,-6.8951064],
[107.5662164,-6.8947043],
[107.5659696,-6.8944886],
[107.5659015,-6.8944306],
[107.5660249,-6.8942122],
[107.5659015,-6.8944306],
[107.5658372,-6.8943746],
[107.5659364,-6.8941909],
[107.5658372,-6.8943746],
[107.565408,-6.8940311],
[107.5652632,-6.8942175],
[107.565408,-6.8940311],
[107.5652685,-6.8939273],
[107.5650996,-6.8941802],
[107.5652685,-6.8939273],
[107.5651934,-6.8939033],
[107.5652873,-6.8937995],
[107.5651934,-6.8939033],
[107.565003,-6.8937116],
[107.5649279,-6.8937995],
[107.565003,-6.8937116],
[107.564906,-6.8936092],
[107.5647509,-6.8938474],
[107.5646677,-6.8940684],
[107.5644421,-6.8944663],
[107.5646677,-6.8940684],
[107.5643137,-6.8938607],
[107.5644075,-6.8936983],
[107.5643137,-6.8938607],
[107.5641259,-6.8941163],
[107.5643137,-6.8938607],
[107.5641179,-6.8937276],
[107.5639596,-6.8940045],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5662883,-6.891759],
[107.5668064,-6.892011],
[107.5668571,-6.8920704],
[107.5668544,-6.8921343],
[107.566892,-6.8922196],
[107.5668893,-6.8922835],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5667062,-6.8939379],
[107.566732,-6.8939459],
[107.5671595,-6.8942308],
[107.5672909,-6.8939912],
[107.5671595,-6.8942308],
[107.5674331,-6.8944066],
[107.5675672,-6.8942016],
[107.5676959,-6.8940631],
[107.5675672,-6.8942016],
[107.5674331,-6.8944066],
[107.5680124,-6.8948007],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.566384,-6.8948391],
[107.5667287,-6.8951037],
[107.5668977,-6.894896],
[107.5670774,-6.8946936],
[107.5668548,-6.8945498],
[107.5670774,-6.8946936],
[107.5672866,-6.8948241],
[107.5671659,-6.895101],
[107.5672165,-6.8951513],
[107.5670533,-6.8953726],
[107.5667287,-6.8951037],
[107.5674365,-6.8956839],
[107.5671217,-6.8963249],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5651612,-6.9012271],
[107.565019,-6.9014638],
[107.5653543,-6.9016398],
[107.5656493,-6.9017889],
[107.5656433,-6.9018904],
[107.5653463,-6.9023827],
[107.5650861,-6.9022496],
[107.5650378,-6.9021324],
[107.5651337,-6.9020022],
[107.5653543,-6.9016398],
[107.5651987,-6.9019114],
[107.5655126,-6.9020739],
[107.5651987,-6.9019114],
[107.565078,-6.9020632],
[107.564834,-6.9017274],
[107.565019,-6.9014638],
[107.564834,-6.9017274],
[107.5646569,-6.9018845],
[107.5647749,-6.9020579],
[107.5646569,-6.9018845],
[107.5641137,-6.9021941],
[107.5637918,-6.9016483],
[107.5641137,-6.9021941],
[107.5644034,-6.9026734],
[107.5647165,-6.9024614],
[107.5648849,-6.9026914],
[107.5648795,-6.9027712],
[107.5645911,-6.9029797],
[107.5644034,-6.9026734],
[107.5645911,-6.9029797],
[107.5652,-6.9039968],
[107.5652759,-6.9039315],
[107.5655119,-6.9035215],
[107.5656982,-6.9031164],
[107.565843,-6.9027277],
[107.5659732,-6.9023392],
[107.5669281,-6.9003421],
[107.5668208,-6.9005605],
[107.5675236,-6.9008747],
[107.567309,-6.9007815],
[107.5669227,-6.9015643],
[107.5664721,-6.901322],
[107.5669227,-6.9015643],
[107.5664453,-6.9025416],
[107.5659732,-6.9023392],
[107.5664453,-6.9025416],
[107.5668798,-6.9027439],
[107.5670339,-6.9027383],
[107.5670622,-6.9025629],
[107.5674485,-6.9017427],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5672263,-6.8961199],
[107.5676715,-6.8964101],
[107.5676956,-6.8964767],
[107.5677788,-6.8965273],
[107.5678603,-6.8965123],
[107.5680296,-6.8964031],
[107.5676993,-6.8959798],
[107.5674529,-6.8956975],
[107.567702,-6.8959771],
[107.5680296,-6.8964031],
[107.5683001,-6.8968212],
[107.56844,-6.8969251],
[107.5685553,-6.8968878],
[107.5685925,-6.8968132],
[107.5686032,-6.8967493],
[107.5686036,-6.8967892],
[107.5684423,-6.8965895],
[107.5682733,-6.8963392],
[107.5682254,-6.896254],
[107.56798,-6.8959758],
[107.5681017,-6.8958999],
[107.56798,-6.8959758],
[107.5676742,-6.8956216],
[107.5673184,-6.8953753],
[107.5673067,-6.8952994],
[107.567642,-6.8947802],
[107.5673067,-6.8952994],
[107.5673184,-6.895378],
[107.5676742,-6.8956216],
[107.5680292,-6.8950265],
[107.5679219,-6.8952075],
[107.5681017,-6.8958999],
[107.5682254,-6.8961502],
[107.5682254,-6.896254],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5637852,-6.8990676],
[107.5635867,-6.898977],
[107.5634794,-6.8989717],
[107.5632751,-6.8988477],
[107.5634794,-6.8989717],
[107.5629859,-6.899664],
[107.5630771,-6.899925],
[107.5628772,-6.9001332],
[107.5625634,-6.8996299],
[107.5628772,-6.9001332],
[107.5637918,-6.9016483],
[107.5639374,-6.9015708],
[107.5642378,-6.9011448],
[107.5645309,-6.9007957],
[107.5651612,-6.9012271],
[107.5655152,-6.900657],
[107.5655126,-6.9006064],
[107.5649171,-6.9002392],
[107.5655126,-6.9006064],
[107.5656708,-6.9004946],
[107.5657566,-6.9004946],
[107.5662609,-6.9007475],
[107.5661911,-6.9007103],
[107.5664406,-6.9001564],
[107.5665184,-6.9002097],
[107.5664406,-6.9001564],
[107.5661214,-6.8999221],
[107.566159,-6.8999514],
[107.5657566,-6.9004946],
[107.5659578,-6.900223],
[107.5660544,-6.9002709],
[107.5661885,-6.8999753],
[107.5660544,-6.9002709],
[107.5659149,-6.9005745],
]])
def jalanKelurahanCiroyom(self, nama):
self.jalan.record(nama)
self.jalan.line([[
[107.5840308,-6.915249],
[107.5842615,-6.9142664],
[107.5845351,-6.9142771],
[107.5845431,-6.9142478],
[107.5845807,-6.9137019],
[107.5848891,-6.9136514],
[107.5848918,-6.9135901],
[107.584983,-6.9135795],
[107.5850367,-6.913204],
[107.584924,-6.9132067],
[107.5850367,-6.913204],
[107.5851118,-6.9129031],
[107.5851359,-6.9128153],
[107.5852083,-6.9126022],
[107.58516,-6.9125836],
[107.5852405,-6.9123386],
[107.5844621,-6.9118109],
[107.5852405,-6.9123386],
[107.5857367,-6.9126875],
[107.5855785,-6.9130576],
[107.585439,-6.9135209],
[107.5849991,-6.9134596],
[107.585439,-6.9135235],
[107.5854014,-6.9137259],
[107.5854014,-6.9139815],
[107.5852915,-6.9139815],
[107.5854309,-6.9147564],
[107.5852888,-6.9148203],
[107.585321,-6.9151558],
[107.5853103,-6.9154833],
[107.5851842,-6.9154966],
[107.5851815,-6.9154327],
[107.5851842,-6.9154966],
[107.5851815,-6.9156191],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5850876,-6.9184706],
[107.586536,-6.9186623],
[107.5878127,-6.9187848],
[107.5878556,-6.918199],
[107.5879307,-6.918199],
[107.5878556,-6.918199],
[107.5878127,-6.9187848],
[107.5884028,-6.9188594],
[107.5889982,-6.9189233],
[107.5901462,-6.9190724],
[107.5917019,-6.9192747],
[107.5923242,-6.919344],
[107.5929357,-6.9194292],
[107.5930215,-6.9188221],
[107.5917829,-6.918673],
[107.5915737,-6.9185186],
[107.5914717,-6.9183109],
[107.5917185,-6.9181937],
[107.591461,-6.9183162],
[107.5914825,-6.9181511],
[107.5914771,-6.9183109],
[107.5909299,-6.9183748],
[107.5907529,-6.9181937],
[107.5901896,-6.9185186],
[107.590136,-6.9186624],
[107.5901462,-6.9190724],
[107.590136,-6.9186624],
[107.5901896,-6.9185186],
[107.590256,-6.91848],
[107.5901574,-6.9182363],
[107.5893079,-6.9181977],
[107.5893474,-6.9178156],
[107.5892938,-6.9183269],
[107.5895995,-6.9183641],
[107.5896371,-6.918215],
[107.5895995,-6.9183641],
[107.5895942,-6.9185399],
[107.5895995,-6.9183641],
[107.5892938,-6.9183269],
[107.5890631,-6.9183002],
[107.5889982,-6.9189233],
[107.5890631,-6.9183002],
[107.5885267,-6.9182363],
[107.5884028,-6.9188594],
[107.5885267,-6.9182363],
[107.5881994,-6.9181724],
[107.58806,-6.9181937],
[107.5881994,-6.9181724],
[107.5882316,-6.9177357],
[107.5879098,-6.9176931],
[107.5882316,-6.9177357],
[107.5881994,-6.9181724],
[107.5885267,-6.9182363],
[107.5887124,-6.9182576],
[107.5888163,-6.9172991],
[107.5889773,-6.9172298],
[107.5889987,-6.9171074],
[107.5889773,-6.9172298],
[107.5888163,-6.9172991],
[107.5887626,-6.9172586],
[107.5884622,-6.9172347],
[107.5878239,-6.9171415],
[107.5872043,-6.9170935],
[107.5870353,-6.9171415],
[107.5867617,-6.9171441],
[107.5866705,-6.9171388],
[107.5866437,-6.9173145],
[107.5865364,-6.9173465],
[107.5864774,-6.9174743],
[107.5865042,-6.9175968],
[107.5865525,-6.9177672],
[107.5865632,-6.918108],
[107.586536,-6.9186623],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5851589,-6.9176585],
[107.5852342,-6.9176629],
[107.5852879,-6.9171677],
[107.5852342,-6.9176629],
[107.5861998,-6.9177375],
[107.586232,-6.9173647],
[107.5854917,-6.9172955],
[107.5853844,-6.9180304],
[107.5861569,-6.9180996],
[107.5861998,-6.9177375],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5930215,-6.9188221],
[107.5931774,-6.9177051],
[107.5931077,-6.9177158],
[107.5931774,-6.9177051],
[107.5932954,-6.9170661],
[107.5933169,-6.9165122],
[107.5927697,-6.9164803],
[107.5928233,-6.9160383],
[107.592877,-6.915969],
[107.5928877,-6.915772],
[107.592877,-6.915969],
[107.5929521,-6.915985],
[107.5929574,-6.9158226],
[107.5929521,-6.915985],
[107.5932149,-6.9160289],
[107.5929521,-6.915985],
[107.592877,-6.915969],
[107.5928233,-6.9160383],
[107.5927697,-6.9164803],
[107.5913213,-6.9164962],
[107.5910531,-6.9168104],
[107.5909136,-6.917966],
[107.5907529,-6.9181937],
[107.5909136,-6.917966],
[107.590974,-6.9174628],
[107.5910531,-6.9168104],
[107.5910531,-6.9164962],
[107.5913213,-6.9164962],
[107.5910531,-6.9164962],
[107.5904737,-6.9164536],
[107.5904415,-6.9166986],
[107.5904737,-6.9164536],
[107.590066,-6.9164004],
[107.5899534,-6.9171459],
[107.5898944,-6.9177424],
[107.5898622,-6.9182163],
[107.589889,-6.9177371],
[107.589948,-6.9171353],
[107.5900017,-6.9168477],
[107.5898085,-6.9168477],
[107.5898085,-6.9167359],
[107.589712,-6.9165921],
[107.5897066,-6.9163738],
[107.590066,-6.9164004],
[107.5897066,-6.9163738],
[107.5894223,-6.9163205],
[107.5894062,-6.9164749],
[107.5893794,-6.9166187],
[107.5894545,-6.9166773],
[107.5894598,-6.9167146],
[107.5894116,-6.9167998],
[107.5894759,-6.9168158],
[107.5894545,-6.9169223],
[107.5896261,-6.916885],
[107.5898085,-6.9168477],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5890883,-6.9137554],
[107.589024,-6.9145329],
[107.5891151,-6.9147299],
[107.5900646,-6.9159441],
[107.5902953,-6.9157844],
[107.5908371,-6.915827],
[107.5902953,-6.9157844],
[107.5904884,-6.9155501],
[107.5903972,-6.9156619],
[107.5899627,-6.91514],
[107.5903972,-6.9156619],
[107.5902953,-6.9157844],
[107.5900646,-6.9159441],
[107.5905314,-6.9164554],
[107.5910531,-6.9164962],
[107.5913213,-6.9164962],
[107.5918456,-6.9164926],
[107.5916793,-6.9158696],
[107.5913467,-6.9155394],
[107.5915238,-6.9153264],
[107.5915881,-6.915124],
[107.5917705,-6.9149057],
[107.5920924,-6.9152039],
[107.5917652,-6.914911],
[107.5913414,-6.9146021],
[107.5906923,-6.9142666],
[107.590923,-6.914224],
[107.5916203,-6.9142453],
[107.5909283,-6.9142187],
[107.5906869,-6.914272],
[107.5905367,-6.9142933],
[107.5904026,-6.9146075],
[107.5904455,-6.9145169],
[107.5911965,-6.9149589],
[107.5910249,-6.9152838],
[107.5913414,-6.9155501],
[107.5910356,-6.9152891],
[107.5905099,-6.914895],
[107.590585,-6.9149589],
[107.5907459,-6.9147033],
[107.5904509,-6.9145169],
[107.5901183,-6.9143465],
[107.5894048,-6.9140909],
[107.5890669,-6.9139844],
[107.589024,-6.9145436],
[107.5885358,-6.9141388],
[107.5880315,-6.9145649],
[107.5880047,-6.914927],
[107.5886163,-6.9150761],
[107.5891205,-6.9147299],
[107.5886216,-6.9150708],
[107.5881335,-6.9154702],
[107.5884178,-6.916237],
[107.5894223,-6.9163205],
[107.5890642,-6.9162929],
[107.5890964,-6.9164634],
[107.5890695,-6.9166178],
[107.5890481,-6.9168255],
[107.5890374,-6.9168628],
[107.5886833,-6.9169586],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5884622,-6.9172347],
[107.5884771,-6.9170196],
[107.5883752,-6.916945],
[107.5883591,-6.9167347],
[107.5883645,-6.9162341],
[107.5884178,-6.916237],
[107.5883672,-6.9162288],
[107.5879675,-6.9161729],
[107.5879756,-6.916314],
[107.5879407,-6.9166016],
[107.5879622,-6.9168359],
[107.5879434,-6.9166016],
[107.5879783,-6.9163113],
[107.5879648,-6.9161702],
[107.5876081,-6.9161409],
[107.5876403,-6.916543],
[107.587702,-6.9168332],
[107.5877127,-6.9170169],
[107.5878415,-6.9170382],
[107.5878239,-6.9171415],
[107.5878361,-6.9170382],
[107.5877047,-6.9170089],
[107.5877047,-6.9168279],
[107.5876376,-6.916535],
[107.5876081,-6.9161382],
[107.5875732,-6.9161329],
[107.5875893,-6.9158533],
[107.5883001,-6.9159252],
[107.5878924,-6.9158853],
[107.58793,-6.9157388],
[107.5881335,-6.9154702],
[107.58793,-6.9157335],
[107.5878897,-6.915888],
[107.5875866,-6.915856],
[107.587769,-6.9154752],
[107.5880399,-6.9149427],
[107.5880047,-6.914927],
[107.5880315,-6.9145649],
[107.586959,-6.9154167],
[107.5869912,-6.9154353],
[107.5869885,-6.9154726],
[107.5870127,-6.9155152],
[107.5869697,-6.9158693],
[107.5869697,-6.9160797],
[107.5875786,-6.9161356],
[107.5869697,-6.916077],
[107.5867739,-6.9160664],
[107.5867364,-6.91633],
[107.5867364,-6.916559],
[107.5866908,-6.9166415],
[107.5867203,-6.9168572],
[107.5867471,-6.9170888],
[107.5867617,-6.9171441],
[107.5867444,-6.9170888],
[107.5867176,-6.9168519],
[107.5863153,-6.9168998],
[107.5862643,-6.9167879],
[107.5863153,-6.9169078],
[107.5863421,-6.9169956],
[107.5859881,-6.9169983],
[107.5853631,-6.9169424],
[107.58517,-6.9168998],
[107.5853631,-6.9169424],
[107.5853792,-6.9166974],
[107.5855213,-6.9167081],
[107.5853846,-6.9166974],
[107.5851861,-6.9167001],
[107.5853792,-6.9166974],
[107.5853872,-6.916543],
[107.5857359,-6.9165989],
[107.5853872,-6.9165377],
[107.5851941,-6.916527],
[107.5853899,-6.916543],
[107.5854087,-6.9163859],
[107.5851995,-6.9163513],
[107.5854141,-6.9163832],
[107.5854275,-6.9162208],
[107.5855991,-6.9158294],
[107.5852236,-6.9157149],
[107.5856018,-6.9158294],
[107.5861222,-6.9159865],
[107.586149,-6.9163273],
[107.5862268,-6.916322],
[107.5862965,-6.9163646],
[107.5864521,-6.9163486],
[107.5865674,-6.9163752],
[107.5867418,-6.916338],
[107.5865647,-6.9163779],
[107.5864494,-6.9163486],
[107.5862938,-6.9163646],
[107.5862187,-6.916322],
[107.5861436,-6.9163246],
[107.5861302,-6.9164737],
[107.5859344,-6.9164498],
[107.5857735,-6.9164072],
[107.5854087,-6.9163859],
[107.5854302,-6.9162155],
[107.5856233,-6.9162794],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5834349,-6.9110762],
[107.5836306,-6.9112092],
[107.5834267,-6.9116352],
[107.583239,-6.9115606],
[107.5834267,-6.9116352],
[107.5836306,-6.9112092],
[107.5838023,-6.9113423],
[107.583636,-6.9116299],
[107.5838023,-6.9113423],
[107.5844621,-6.9118109],
[107.5844192,-6.9119707],
[107.584505,-6.9122316],
[107.5845694,-6.9123754],
[107.5845425,-6.9126044],
[107.5840544,-6.9125512],
[107.5839471,-6.9128334],
[107.5845479,-6.9128387],
[107.5839471,-6.9128334],
[107.5837969,-6.9131689],
[107.5847035,-6.9132062],
[107.5837969,-6.9131689],
[107.5836441,-6.9139414],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5830862,-6.9138388],
[107.5831746,-6.913342],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5853103,-6.9154833],
[107.5856881,-6.9154143],
[107.5855915,-6.91514],
[107.5856881,-6.9154143],
[107.5856881,-6.9155794],
[107.5856291,-6.9158377],
[107.5857927,-6.9158829],
[107.5859697,-6.9153903],
[107.5856881,-6.9154143],
[107.5859697,-6.9153903],
[107.5859992,-6.9152945],
[107.586077,-6.9152732],
[107.5866376,-6.9153664],
[107.586959,-6.9154167],
[107.5866376,-6.9153664],
[107.5868307,-6.9147646],
[107.5871445,-6.913798],
[107.5879277,-6.9140909],
[107.5883381,-6.9142986],
[107.5885358,-6.9141388],
[107.5882496,-6.9139285],
[107.5878311,-6.9137395],
[107.5876434,-6.9136915],
[107.5872169,-6.9135105],
[107.5871445,-6.913798],
[107.5872169,-6.9135105],
[107.5868736,-6.9133587],
[107.5867851,-6.9136543],
[107.5868092,-6.9137315],
[107.5866376,-6.9145409],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5867739,-6.9160664],
[107.5861222,-6.9159865],
[107.5861651,-6.9159929],
[107.5861503,-6.9157705],
[107.5861288,-6.9152753],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5857367,-6.9126875],
[107.5863523,-6.9130875],
[107.5867492,-6.9133005],
[107.5868736,-6.9133587],
[107.5867546,-6.9133005],
[107.5866473,-6.9135562],
[107.5867546,-6.9132952],
[107.5863523,-6.9130822],
[107.5861162,-6.9132846],
[107.5861377,-6.9135189],
[107.5860411,-6.9135402],
[107.5859285,-6.9148236],
[107.5857783,-6.9148449],
[107.585789,-6.9149887],
]])
def jalanKelurahanDungusCariang(self, nama):
self.jalan.record(nama)
self.jalan.line([[
[107.5767156,-6.9174426],
[107.5770075,-6.9174589],
[107.5770182,-6.9173577],
[107.5770075,-6.9174589],
[107.5780053,-6.917576],
[107.5781233,-6.9171447],
[107.5780053,-6.917576],
[107.5781286,-6.9175973],
[107.5787509,-6.9176825],
[107.5788689,-6.9176879],
[107.5789923,-6.9177305],
[107.580607,-6.9179169],
[107.5812024,-6.9180074],
[107.5820017,-6.9180926],
[107.5820178,-6.9178796],
[107.5820822,-6.9177092],
[107.5820178,-6.9178796],
[107.5820017,-6.9180926],
[107.5826938,-6.9181831],
[107.5830907,-6.9182417],
[107.5843996,-6.9183802],
[107.5850876,-6.9184706],
[107.5849951,-6.9184494],
[107.5850648,-6.9176399],
[107.5851589,-6.9176585],
[107.5850648,-6.9176399],
[107.5850809,-6.9172938],
[107.5844104,-6.9173257],
[107.5839222,-6.9172885],
[107.5844104,-6.9173257],
[107.5844265,-6.9170808],
[107.5844104,-6.9173257],
[107.5843996,-6.9183802],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5850809,-6.9172938],
[107.5851171,-6.9168794],
[107.58517,-6.9168998],
[107.5851171,-6.9168794],
[107.5851117,-6.9166984],
[107.5851861,-6.9167001],
[107.5851117,-6.9166984],
[107.5851225,-6.9165173],
[107.5851941,-6.916527],
[107.5851225,-6.9165173],
[107.5851332,-6.9163362],
[107.5851995,-6.9163513],
[107.5851332,-6.9163362],
[107.5851868,-6.9157025],
[107.5852236,-6.9157149],
[107.5843232,-6.9154256],
[107.5842749,-6.9155747],
[107.5842856,-6.9157025],
[107.5842749,-6.9155747],
[107.5843232,-6.9154256],
[107.5838725,-6.9152552],
[107.5838243,-6.9156812],
[107.5838296,-6.915596],
[107.5836687,-6.9155747],
[107.5836633,-6.9154416],
[107.5836204,-6.915399],
[107.5836687,-6.9151966],
[107.5838725,-6.9152552],
[107.5836687,-6.9151966],
[107.5835399,-6.9151806],
[107.583497,-6.915367],
[107.5834058,-6.915383],
[107.5833576,-6.9156013],
[107.5834058,-6.915383],
[107.583497,-6.915367],
[107.5835399,-6.9151806],
[107.5832878,-6.9150741],
[107.5834756,-6.9144138],
[107.5835882,-6.9139931],
[107.5836366,-6.9139975],
[107.5835882,-6.9139931],
[107.5830303,-6.9138653],
[107.5824724,-6.9137268],
[107.5824724,-6.9136576],
[107.5825368,-6.91337],
[107.5826173,-6.9131463],
[107.5827138,-6.9127842],
[107.5828587,-6.9123102],
[107.5830089,-6.9118842],
[107.5831913,-6.9115221],
[107.583239,-6.9115606],
[107.5831913,-6.9115221],
[107.5833844,-6.9110481],
[107.5834349,-6.9110762],
[107.5833844,-6.9110481],
[107.5826226,-6.9105635],
[107.5824402,-6.9109043],
[107.5826226,-6.9105635],
[107.5821613,-6.9102386],
[107.5821291,-6.9103398],
[107.5821184,-6.910654],
[107.5819789,-6.9108883],
[107.5819789,-6.9110747],
[107.5819789,-6.9108883],
[107.5821184,-6.910654],
[107.5821291,-6.9103398],
[107.5821613,-6.9102386],
[107.581657,-6.9099351],
[107.5815229,-6.9098446],
[107.5813566,-6.9101801],
[107.581244,-6.9105315],
[107.5813674,-6.9105688],
[107.581244,-6.9105315],
[107.5813566,-6.9101801],
[107.5815229,-6.9098446],
[107.5813888,-6.9096901],
[107.5811528,-6.9100097],
[107.5809811,-6.9103185],
[107.5810348,-6.9104037],
[107.5810026,-6.9104676],
[107.5806217,-6.9102173],
[107.5810079,-6.9096262],
[107.5810723,-6.9096262],
[107.5811313,-6.909525],
[107.5813888,-6.9096901],
[107.5811313,-6.909525],
[107.5807236,-6.9092907],
[107.5804983,-6.9091096],
[107.5801443,-6.9088807],
[107.5798814,-6.9087369],
[107.5790499,-6.9081351],
[107.5798814,-6.9087369],
[107.5798653,-6.9088487],
[107.5797419,-6.9088221],
[107.579581,-6.9087102],
[107.5793289,-6.9085451],
[107.5791519,-6.9084493],
[107.578889,-6.908428],
[107.5788085,-6.908412],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5788757,-6.9112659],
[107.5781462,-6.9110636],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5782803,-6.9117612],
[107.5780013,-6.9117026],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.576847,-6.9168861],
[107.5773318,-6.9169331],
[107.5774338,-6.9168479],
[107.5775947,-6.9164166],
[107.5776752,-6.9162408],
[107.5777663,-6.9157562],
[107.57782,-6.9154633],
[107.5772031,-6.9153408],
[107.57782,-6.9154633],
[107.5778736,-6.9154101],
[107.5782062,-6.915458],
[107.5785549,-6.9156124],
[107.5784798,-6.9159053],
[107.5781633,-6.9158468],
[107.5780507,-6.9158042],
[107.5777663,-6.9157562],
[107.5780507,-6.9158042],
[107.5781687,-6.9158468],
[107.5784798,-6.9159053],
[107.5784369,-6.9160544],
[107.5782277,-6.9160065],
[107.5784369,-6.9160544],
[107.578394,-6.9163154],
[107.5790324,-6.9164805],
[107.5791128,-6.9164059],
[107.5791718,-6.9162621],
[107.5791128,-6.9164059],
[107.5790324,-6.9164805],
[107.578394,-6.9163154],
[107.5782491,-6.9169065],
[107.5781286,-6.9175973],
[107.5787509,-6.9176825],
[107.5788689,-6.9176879],
[107.5789465,-6.9173006],
[107.5789519,-6.9170556],
[107.5782491,-6.9169065],
[107.5789519,-6.9170556],
[107.5789465,-6.9173006],
[107.5790377,-6.9171941],
[107.5793274,-6.9163527],
[107.5796546,-6.9164539],
[107.5796707,-6.9165391],
[107.5798907,-6.9166083],
[107.5799336,-6.9165178],
[107.5801213,-6.9165444],
[107.5806578,-6.9167254],
[107.5807597,-6.9165444],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5775873,-6.9136243],
[107.5787955,-6.9139343],
[107.5786346,-6.9142752],
[107.5784951,-6.914813],
[107.5779962,-6.9147385],
[107.5778736,-6.9154101],
[107.5782062,-6.915458],
[107.5784951,-6.914813],
[107.5784522,-6.9149089],
[107.5786453,-6.9149834],
[107.5785702,-6.9153136],
[107.5785112,-6.9155905],
[107.5785549,-6.9156124],
[107.5791362,-6.9156811],
[107.5793561,-6.9157317],
[107.579289,-6.9159607],
[107.5793561,-6.9157317],
[107.5795412,-6.915753],
[107.5793274,-6.9163527],
[107.5794634,-6.9159793],
[107.5802734,-6.9162056],
[107.5802224,-6.9163654],
[107.5801313,-6.9164133],
[107.5800991,-6.9165464],
[107.5801313,-6.9164133],
[107.5802224,-6.9163654],
[107.5802734,-6.9162056],
[107.580724,-6.9163521],
[107.5807616,-6.9160938],
[107.5808179,-6.9158435],
[107.5803941,-6.9157184],
[107.5803244,-6.9159394],
[107.5807616,-6.9160938],
[107.5803244,-6.9159394],
[107.5795412,-6.915753],
[107.579686,-6.9151405],
[107.5793936,-6.915058],
[107.5793695,-6.9151166],
[107.5791013,-6.9150553],
[107.5790423,-6.9152311],
[107.5791013,-6.9150553],
[107.5793695,-6.9151166],
[107.5792971,-6.9153722],
[107.5792408,-6.9154161],
[107.5791388,-6.9156811],
[107.5792408,-6.9154161],
[107.5785729,-6.915311],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5805838,-6.9179197],
[107.5806643,-6.917696],
[107.5807501,-6.917704],
[107.5808225,-6.9175176],
[107.5808252,-6.9174084],
[107.5808494,-6.9173445],
[107.5807635,-6.9173099],
[107.5810344,-6.9166682],
[107.5808157,-6.9164871],
[107.580821,-6.9163966],
[107.580724,-6.9163521],
[107.580821,-6.9163966],
[107.5810249,-6.9160664],
[107.5814219,-6.9162155],
[107.5812234,-6.9166469],
[107.5811697,-6.9167427],
[107.5810344,-6.9166682],
[107.5811697,-6.9167427],
[107.5812234,-6.9166469],
[107.5817705,-6.9169078],
[107.5818564,-6.9169078],
[107.5819958,-6.9169558],
[107.5820441,-6.9168386],
[107.5819958,-6.9169558],
[107.5822426,-6.9170303],
[107.5821729,-6.9172593],
[107.5822426,-6.9170303],
[107.5825055,-6.9171102],
[107.5828166,-6.9171475],
[107.5827361,-6.9177066],
[107.5826938,-6.9181831],
[107.5830907,-6.9182417],
[107.5831224,-6.9178877],
[107.5829829,-6.9178717],
[107.5829346,-6.9177705],
[107.5830634,-6.9168812],
[107.5831331,-6.9168066],
[107.5834496,-6.9168546],
[107.5837768,-6.9168919],
[107.5838144,-6.9169717],
[107.5837071,-6.9180634],
[107.5833745,-6.9180315],
[107.5833289,-6.9179503],
[107.5833316,-6.9179023],
[107.5831224,-6.9178877],
[107.5833316,-6.9179023],
[107.583455,-6.9168546],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5851107,-6.9168255],
[107.5844186,-6.9166924],
[107.5836247,-6.9165273],
[107.5833779,-6.9164634],
[107.5827449,-6.9164101],
[107.5827289,-6.9165273],
[107.582863,-6.9166125],
[107.5833833,-6.9166125],
[107.5835872,-6.9166604],
[107.5836247,-6.9165273],
[107.5844186,-6.9166924],
[107.5844669,-6.9163302],
[107.5846171,-6.9161012],
[107.5844669,-6.9163302],
[107.5837159,-6.9161598],
[107.5836408,-6.9161066],
[107.5834316,-6.9160746],
[107.5835764,-6.9154249],
[107.5836204,-6.915399],
[107.5835764,-6.9154249],
[107.5834316,-6.9160746],
[107.5833779,-6.9164634],
[107.5834316,-6.9160746],
[107.5830078,-6.9160001],
[107.5829059,-6.9160001],
[107.582525,-6.9158882],
[107.5824499,-6.9163462],
[107.5825481,-6.916367],
[107.5824499,-6.9163462],
[107.5822426,-6.9170303],
[107.5824499,-6.9163462],
[107.5819054,-6.9162051],
[107.5820422,-6.9157311],
[107.5820207,-6.9156992],
[107.5817042,-6.9156459],
[107.5816882,-6.915606],
[107.5816935,-6.9155421],
[107.5816399,-6.9154888],
[107.5816506,-6.9154356],
[107.5816962,-6.9152811],
[107.5816372,-6.9152172],
[107.5817203,-6.9147885],
[107.5820181,-6.914887],
[107.5820663,-6.9148657],
[107.5822541,-6.9149084],
[107.582187,-6.9152944],
[107.5822541,-6.9149084],
[107.5822863,-6.9147726],
[107.5825277,-6.9148444],
[107.5824901,-6.9150681],
[107.5825277,-6.9148444],
[107.5825786,-6.9148365],
[107.5825974,-6.9146075],
[107.5825786,-6.9148365],
[107.5830588,-6.9150015],
[107.583107,-6.9150042],
[107.5832116,-6.914674],
[107.583107,-6.9150042],
[107.5832878,-6.9150741],
[107.583107,-6.9150042],
[107.5830185,-6.9151187],
[107.58293,-6.9154888],
[107.5826511,-6.9154249],
[107.5825921,-6.9155927],
[107.582525,-6.9158882],
[107.5825062,-6.9159921],
[107.582187,-6.9159175],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5824724,-6.9137268],
[107.5823858,-6.9138174],
[107.5823192,-6.9143792],
[107.5822863,-6.9147726],
[107.5811283,-6.9144964],
[107.5811604,-6.9141396],
[107.5812302,-6.9137615],
[107.5811604,-6.9141396],
[107.5811283,-6.9144964],
[107.5810263,-6.9150023],
[107.5812785,-6.9150236],
[107.5812892,-6.9150822],
[107.5813965,-6.9151035],
[107.5812892,-6.9150822],
[107.5811229,-6.9157478],
[107.5815735,-6.9158544],
[107.5811229,-6.9157478],
[107.5810249,-6.9160664],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5798653,-6.9088487],
[107.5798571,-6.9090062],
[107.5792724,-6.9088518],
[107.5794226,-6.9088891],
[107.5793904,-6.9090968],
[107.5793904,-6.9092778],
[107.5792885,-6.9092778],
[107.5793904,-6.9092778],
[107.5796748,-6.9092778],
[107.579723,-6.9093258],
[107.5798411,-6.9093311],
[107.5798571,-6.9090062],
[107.5798411,-6.9093311],
[107.5798303,-6.9094536],
[107.5796157,-6.9094163],
[107.5795567,-6.9093577],
[107.5795567,-6.9092778],
[107.5795567,-6.9093577],
[107.5796157,-6.9094163],
[107.5798303,-6.9094536],
[107.5798089,-6.9097891],
[107.5796587,-6.9097731],
[107.5796372,-6.909837],
[107.5795192,-6.9098051],
[107.5796372,-6.909837],
[107.5796587,-6.9097731],
[107.5798089,-6.9097891],
[107.5798035,-6.9100766],
[107.5792992,-6.9099808],
[107.5793743,-6.9097252],
[107.5792992,-6.9099808],
[107.5798035,-6.9100766],
[107.5797713,-6.9104494],
[107.578913,-6.9101885],
[107.5797713,-6.9104494],
[107.5798357,-6.9105027],
[107.5801844,-6.9106305],
[107.5802595,-6.9107157],
[107.5803453,-6.910737],
[107.5805545,-6.9102098],
[107.5806217,-6.9102173],
[107.5805545,-6.9102098],
[107.5802434,-6.9099968],
[107.5798089,-6.9097891],
[107.5798035,-6.9100766],
[107.5797713,-6.9104494],
[107.579723,-6.9109926],
[107.5796587,-6.9112482],
[107.5799001,-6.9113494],
[107.5796587,-6.9112482],
[107.5795246,-6.9116423],
[107.5796587,-6.9117062],
[107.5795246,-6.9116423],
[107.5794655,-6.9117595],
[107.5790847,-6.9115678],
[107.5794655,-6.9117595],
[107.5793851,-6.9120098],
[107.5789291,-6.9118127],
[107.5793851,-6.9120098],
[107.5793314,-6.9121163],
[107.5788379,-6.9119352],
[107.5793314,-6.9121163],
[107.5792456,-6.9123187],
[107.5789935,-6.9122122],
[107.5792456,-6.9123187],
[107.5792027,-6.9124465],
[107.5794226,-6.912521],
[107.5792027,-6.9124465],
[107.5790471,-6.9127074],
[107.5792134,-6.912782],
[107.5790471,-6.9127074],
[107.5789774,-6.9129897],
[107.5793422,-6.9130908],
[107.5789774,-6.9129897],
[107.5789345,-6.9132932],
[107.5793958,-6.9134263],
[107.5789345,-6.9132932],
[107.5788594,-6.9135755],
[107.5787955,-6.9139343],
[107.5797797,-6.9141558],
[107.5796748,-6.9141346],
[107.5800261,-6.9130243],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5810263,-6.9150023],
[107.5804959,-6.914912],
[107.5804422,-6.9149653],
[107.5803618,-6.9149413],
[107.5804047,-6.9147789],
[107.5803886,-6.9148375],
[107.5803618,-6.9149413],
[107.5803537,-6.9149893],
[107.580182,-6.9149307],
[107.5803537,-6.9149893],
[107.5803081,-6.915149],
[107.5797475,-6.9149919],
[107.579686,-6.9151405],
[107.5793936,-6.915058],
[107.5795088,-6.9147097],
[107.5795893,-6.9147283],
[107.5796161,-6.9146964],
[107.5797797,-6.9141558],
[107.5803027,-6.914289],
[107.5811283,-6.9144964],
[107.5807155,-6.9143921],
[107.5807963,-6.9141612],
[107.5807104,-6.9141079],
[107.5806407,-6.9141052],
[107.5807104,-6.9141079],
[107.5807963,-6.9141612],
[107.5808472,-6.9141159],
[107.5808633,-6.9139987],
[107.5805549,-6.9138922],
[107.5808633,-6.9139987],
[107.5808472,-6.9141159],
[107.5807963,-6.9141612],
[107.5807155,-6.9143921],
[107.5808855,-6.9144348],
[107.5809331,-6.9142304],
[107.5808855,-6.9144348],
[107.5807641,-6.9149546],
[107.5808855,-6.9144348],
[107.5803027,-6.914289],
[107.580233,-6.9144461],
[107.5801445,-6.9147762],
[107.5803886,-6.9148375],
[107.5801445,-6.9147762],
[107.5800426,-6.9148748],
[107.5797663,-6.9148295],
[107.5797207,-6.9148535],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.581657,-6.9099351],
[107.5813715,-6.9107838],
[107.5811623,-6.9114814],
[107.580878,-6.9114441],
[107.5807599,-6.911721],
[107.5804542,-6.9116358],
[107.5804864,-6.9115453],
[107.5804542,-6.9116358],
[107.5802986,-6.9121684],
[107.5803898,-6.912195],
[107.5802986,-6.9121684],
[107.5802611,-6.9122163],
[107.5794081,-6.9119607],
[107.5797568,-6.9120672],
[107.5796871,-6.9122323],
[107.5797568,-6.9120672],
[107.5802611,-6.9122163],
[107.5801377,-6.9126743],
[107.579907,-6.9126184],
[107.5801377,-6.9126743],
[107.5800261,-6.9130243],
[107.5797595,-6.9129512],
[107.5800261,-6.9130243],
[107.5801377,-6.9126743],
[107.5801752,-6.9125358],
[107.5804274,-6.9126876],
[107.5807358,-6.9127648],
[107.5809772,-6.911998],
[107.5805856,-6.9118542],
[107.5809826,-6.911998],
[107.5811703,-6.9119287],
[107.5813018,-6.9117983],
[107.5813339,-6.9117503],
[107.5813822,-6.9116598],
[107.5813339,-6.9117503],
[107.5810308,-6.9116598],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5799214,-6.9141892],
[107.5804274,-6.9126876],
[107.5807358,-6.9127648],
[107.580879,-6.9128259],
[107.5808548,-6.9129057],
[107.5807878,-6.912959],
[107.5808548,-6.9129057],
[107.580879,-6.9128232],
[107.5809192,-6.912714],
[107.5812572,-6.9127832],
[107.5811874,-6.9130415],
[107.5812572,-6.9127832],
[107.5826173,-6.9131463],
[107.5825368,-6.91337],
[107.5822335,-6.9133105],
[107.5821611,-6.9135661],
[107.5822335,-6.9133105],
[107.5813323,-6.9130522],
[107.5812089,-6.9130761],
[107.5811338,-6.9133318],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5827138,-6.9127842],
[107.5821254,-6.9126154],
[107.5810471,-6.9123038],
[107.5821227,-6.912618],
[107.5822756,-6.9122452],
[107.5815406,-6.9120322],
[107.5822756,-6.9122452],
[107.5824285,-6.9118911],
[107.5816989,-6.9116595],
]])
def jalanKelurahanGaruda(self, nama):
self.jalan.record(nama)
self.jalan.line([[
[107.5729636,-6.9155205],
[107.5731415,-6.9155822],
[107.5732327,-6.9156515],
[107.5733587,-6.9156834],
[107.5735492,-6.9157713],
[107.573348,-6.9159337],
[107.5730303,-6.9163057],
[107.5733507,-6.9159337],
[107.5735492,-6.9157713],
[107.5737476,-6.9158778],
[107.5734472,-6.9162719],
[107.5736323,-6.9164529],
[107.5737262,-6.9164503],
[107.5739113,-6.916184],
[107.5739971,-6.9162266],
[107.5739113,-6.916184],
[107.5737262,-6.9164503],
[107.5736323,-6.9164529],
[107.573446,-6.9166438],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5725292,-6.9158665],
[107.5729203,-6.9162178],
[107.5729766,-6.9161486],
[107.5729203,-6.9162178],
[107.5730303,-6.9163057],
[107.573446,-6.9166438],
[107.5738617,-6.9169766],
[107.5742453,-6.9170805],
[107.5743445,-6.9170166],
[107.5744813,-6.9170459],
[107.5745457,-6.9171391],
[107.5752914,-6.9173095],
[107.5758546,-6.9173521],
[107.5759914,-6.9169021],
[107.5758546,-6.9173521],
[107.5767156,-6.9174426],
[107.576847,-6.9168861],
[107.5765171,-6.9168409],
[107.5764528,-6.9167743],
[107.5764367,-6.9166438],
[107.5764528,-6.9167743],
[107.5765171,-6.9168409],
[107.576847,-6.9168861],
[107.5770321,-6.916074],
[107.5774452,-6.9142767],
[107.5775873,-6.9136243],
[107.577987,-6.9117897],
[107.5784376,-6.9098406],
[107.5783115,-6.909782],
[107.5783384,-6.9097048],
[107.5784751,-6.9097154],
[107.5784376,-6.9098406],
[107.5784751,-6.9097154],
[107.5786978,-6.9086637],
[107.5788963,-6.908227],
[107.5787271,-6.908121],
[107.5788963,-6.908227],
[107.5791012,-6.9079],
[107.5790556,-6.9079719],
[107.5781562,-6.9074106],
[107.5780409,-6.9076289],
[107.5780087,-6.9077701],
[107.5780409,-6.9076289],
[107.5778719,-6.9075544],
[107.5780409,-6.9076289],
[107.5781562,-6.9074106],
[107.5777807,-6.9071816],
[107.5776788,-6.9073813],
[107.5777807,-6.9071816],
[107.5775983,-6.9070431],
[107.5773999,-6.907344],
[107.5775983,-6.9070431],
[107.5771665,-6.9067955],
[107.5765281,-6.9063428],
[107.5761902,-6.9069686],
[107.5758039,-6.9068088],
[107.5761902,-6.9069686],
[107.5765281,-6.9063428],
[107.5761285,-6.9060872],
[107.5758549,-6.9065905],
[107.5761285,-6.9060872],
[107.5754177,-6.9056052],
[107.5751361,-6.9054375],
[107.5754177,-6.9056052],
[107.5751253,-6.9061591],
[107.5748947,-6.9064467],
[107.5750127,-6.9063002],
[107.5753909,-6.9065292],
[107.5754713,-6.9064307],
[107.5756403,-6.9064973],
[107.5759381,-6.9059607],
[107.5756832,-6.9057836],
[107.5755491,-6.9059967],
[107.5753936,-6.9062816],
[107.5751253,-6.9061591],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5737476,-6.9158778],
[107.5739852,-6.915599],
[107.5741636,-6.9152395],
[107.5735333,-6.9149932],
[107.5741636,-6.9152395],
[107.5743219,-6.9152648],
[107.5749656,-6.9137098],
[107.5743219,-6.9152648],
[107.5749334,-6.915595],
[107.5747617,-6.9160316],
[107.5741287,-6.9157707],
[107.5747617,-6.9160316],
[107.5743445,-6.9170166],
[107.5747617,-6.9160316],
[107.5744813,-6.9170459],
[107.5747617,-6.9160316],
[107.5749334,-6.915595],
[107.576017,-6.9158559],
[107.5765374,-6.9159731],
[107.5770321,-6.916074],
[107.5765374,-6.9159731],
[107.577106,-6.9135074],
[107.5775873,-6.9136243],
[107.577106,-6.9135074],
[107.5774118,-6.9121707],
[107.5773688,-6.9123465],
[107.5767197,-6.9121121],
[107.5770202,-6.9114784],
[107.5774547,-6.9116435],
[107.577987,-6.9117897],
[107.5774547,-6.9116435],
[107.577519,-6.9113133],
[107.5774547,-6.9116435],
[107.5770202,-6.9114784],
[107.5775459,-6.9105518],
[107.5775888,-6.91044],
[107.577562,-6.9103494],
[107.577283,-6.9101897],
[107.577562,-6.909721],
[107.5774064,-6.909982],
[107.577224,-6.9098861],
[107.5774815,-6.9094974],
[107.5776639,-6.9091938],
[107.5779643,-6.9087039],
[107.5781467,-6.9086133],
[107.5780179,-6.9085015],
[107.5779267,-6.9084589],
[107.5778034,-6.9083311],
[107.5779267,-6.9084589],
[107.5780233,-6.9085015],
[107.5781413,-6.9086133],
[107.5782915,-6.908608],
[107.5786978,-6.9086637],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.576017,-6.9158559],
[107.5761265,-6.9153624],
[107.5750911,-6.9150828],
[107.5761265,-6.9153624],
[107.5764025,-6.9140311],
[107.5758017,-6.9137967],
[107.5759612,-6.9138593],
[107.5762308,-6.9133175],
[107.577106,-6.9135074],
[107.5762308,-6.9133175],
[107.5764883,-6.9127583],
[107.577234,-6.91295],
[107.5764883,-6.9127583],
[107.5767197,-6.9121121],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5749334,-6.915595],
[107.5758022,-6.9131228],
[107.5753516,-6.9129897],
[107.575483,-6.9130269],
[107.5756734,-6.9125423],
[107.575483,-6.9130269],
[107.5758022,-6.9131228],
[107.5762308,-6.9133175],
[107.5758022,-6.9131228],
[107.5758558,-6.9130323],
[107.5766337,-6.9112536],
[107.5761723,-6.9110832],
[107.5766337,-6.9112536],
[107.5770202,-6.9114784],
[107.5766337,-6.9112536],
[107.5768107,-6.9109553],
[107.5767678,-6.9108701],
[107.5770306,-6.9104175],
[107.5767678,-6.9108701],
[107.5768107,-6.9109553],
[107.577283,-6.9101897],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5737868,-6.9084887],
[107.5746753,-6.9087599],
[107.5752063,-6.908909],
[107.574627,-6.9099368],
[107.5742139,-6.9097664],
[107.5746753,-6.9087599],
[107.5742139,-6.9097664],
[107.5734708,-6.9094448],
[107.5742139,-6.9097664],
[107.574627,-6.9099368],
[107.5750132,-6.9100859],
[107.5755121,-6.9092498],
[107.5756999,-6.9092924],
[107.5757857,-6.9090634],
[107.5754316,-6.9089196],
[107.5757857,-6.9090634],
[107.5756999,-6.9092924],
[107.5755121,-6.9092498],
[107.5750132,-6.9100859],
[107.5754263,-6.9101924],
[107.5760164,-6.9092764],
[107.5754263,-6.9101924],
[107.5752653,-6.9106504],
[107.5754263,-6.9101924],
[107.5766225,-6.9107037],
[107.5759024,-6.9103908],
[107.5762685,-6.9097983],
[107.576365,-6.9094788],
[107.5761934,-6.9093936],
[107.576306,-6.9090528],
[107.5764026,-6.9086054],
[107.5767567,-6.9086693],
[107.5768586,-6.9084457],
[107.5767567,-6.9086693],
[107.5770302,-6.9087119],
[107.5773253,-6.9082699],
[107.5770302,-6.9087119],
[107.5772448,-6.9087758],
[107.577336,-6.9087652],
[107.577395,-6.908648],
[107.577336,-6.9087652],
[107.5775238,-6.9087545],
[107.5779643,-6.9087039],
[107.5775238,-6.9087545],
[107.5770839,-6.9090208],
[107.5770517,-6.9092818],
[107.5770034,-6.9098516],
[107.577224,-6.9098861],
[107.5770034,-6.9098516],
[107.5770517,-6.9092764],
[107.5770839,-6.9090208],
[107.5769873,-6.9090155],
[107.5768532,-6.9089516],
[107.5767674,-6.9089835],
[107.5767298,-6.9090847],
[107.5766011,-6.9096492],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5771665,-6.9067955],
[107.5770051,-6.907072],
[107.5768174,-6.9069868],
[107.5770051,-6.907072],
[107.5766135,-6.9077324],
[107.5762756,-6.907514],
[107.5766135,-6.9077324],
[107.5765009,-6.9078868],
[107.5763936,-6.9080732],
[107.5764901,-6.9081477],
[107.5764026,-6.9086054],
[107.5759966,-6.9084939],
[107.5760932,-6.9082117],
[107.5759966,-6.9084939],
[107.575723,-6.9084619],
[107.5756586,-6.9086483],
[107.575723,-6.9084619],
[107.5756426,-6.9084513],
[107.5757713,-6.9080892],
[107.5757713,-6.9079134],
[107.576002,-6.9074182],
[107.5751919,-6.9070241],
[107.5752992,-6.9067045],
[107.575428,-6.9067844],
[107.5752992,-6.9067045],
[107.5753909,-6.9065292],
[107.5752992,-6.9067045],
[107.5751919,-6.9070241],
[107.57509,-6.9071359],
[107.5748701,-6.90704],
[107.5746931,-6.9069229],
[107.5743926,-6.9067631],
[107.5744879,-6.9068124],
[107.574339,-6.9071199],
[107.5742478,-6.907072],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5739905,-6.9081123],
[107.5742721,-6.9081522],
[107.5742453,-6.9079925],
[107.5742158,-6.9079073],
[107.5742426,-6.9077182],
[107.5742158,-6.9079073],
[107.5742453,-6.9079925],
[107.5742721,-6.9081522],
[107.5749856,-6.9082801],
[107.5751519,-6.9079579],
[107.5749856,-6.9082801],
[107.5754228,-6.9083946],
[107.5755006,-6.9082082],
[107.5754228,-6.9083946],
[107.5755301,-6.9084265],
[107.5754282,-6.9086901],
[107.5755301,-6.9084265],
[107.5756426,-6.9084513],
]])
def jalanKelurahanKebonJeruk(self, nama):
self.jalan.record(nama)
self.jalan.line([[
[107.592997,-6.9194399],
[107.5938698,-6.9195477],
[107.5951519,-6.9197021],
[107.5954952,-6.9197421],
[107.5956937,-6.9197687],
[107.5972386,-6.9199498],
[107.5976544,-6.9200004],
[107.5983705,-6.9200829],
[107.5997385,-6.9202507],
[107.6004761,-6.9203385],
[107.6005619,-6.9200589],
[107.6005673,-6.9198033],
[107.6005619,-6.9200589],
[107.6004761,-6.9203385],
[107.6018038,-6.9204983],
[107.6021498,-6.9205462],
[107.6031502,-6.9206607],
[107.6041051,-6.9207779],
[107.6041775,-6.9198513],
[107.6041909,-6.9194519],
[107.6042151,-6.9191164],
[107.6042419,-6.9186477],
[107.6042875,-6.9183176],
[107.6043438,-6.9183309],
[107.6042875,-6.9183202],
[107.6043948,-6.91713],
[107.6044752,-6.9158253],
[107.604545,-6.9158066],
[107.6044752,-6.9158253],
[107.6045745,-6.9148294],
[107.6046228,-6.9147629],
[107.6045745,-6.9148268],
[107.6030376,-6.9147602],
[107.6027881,-6.9147842],
[107.6027881,-6.9151463],
[107.6027881,-6.9147842],
[107.6025628,-6.9148241],
[107.6015168,-6.9147708],
[107.6004385,-6.9146777],
[107.5994568,-6.9146537],
[107.5992235,-6.9147309],
[107.5990786,-6.9146191],
[107.5989258,-6.9147069],
[107.5982847,-6.9146723],
[107.5981855,-6.9147149],
[107.5982847,-6.9146723],
[107.5989258,-6.9147069],
[107.5990786,-6.9146191],
[107.5992262,-6.9147336],
[107.5990089,-6.9148081],
[107.5980702,-6.9148107],
[107.5981185,-6.9142994],
[107.5980702,-6.9148107],
[107.5973567,-6.9148426],
[107.5973031,-6.9146829],
[107.5979307,-6.9147521],
[107.5973031,-6.9146829],
[107.595506,-6.9146349],
[107.5953773,-6.9145764],
[107.5936124,-6.9143421],
[107.5929579,-6.9143474],
[107.5928399,-6.9143634],
[107.5927862,-6.914406],
[107.5927916,-6.9145071],
[107.592856,-6.9145604],
[107.5929365,-6.914603],
[107.5929472,-6.9148107],
[107.5928877,-6.915772],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5929574,-6.9158226],
[107.5930423,-6.9146035],
[107.5931067,-6.914513],
[107.5932301,-6.9144757],
[107.5935922,-6.9144837],
[107.5954965,-6.9147686],
[107.595506,-6.9146349],
[107.5954992,-6.9147686],
[107.5954617,-6.9151574],
[107.5972724,-6.915159],
[107.5971812,-6.9152921],
[107.5978732,-6.9152921],
[107.5971812,-6.9152921],
[107.5956201,-6.9153134],
[107.5954592,-6.9152602],
[107.5954592,-6.915159],
[107.5954592,-6.9152602],
[107.5954914,-6.9160536],
[107.5932149,-6.9160289],
[107.5954914,-6.9160536],
[107.5954806,-6.9163838],
[107.5933169,-6.9165122],
[107.5942522,-6.916453],
[107.5942951,-6.9171347],
[107.5942522,-6.916453],
[107.5954806,-6.9163838],
[107.5955987,-6.9163838],
[107.5955504,-6.9172945],
[107.5955987,-6.9163838],
[107.5958562,-6.9163838],
[107.5958722,-6.9166501],
[107.5960546,-6.9169803],
[107.5959634,-6.9174329],
[107.5960546,-6.9169803],
[107.5958722,-6.9166554],
[107.5958562,-6.9163838],
[107.5959259,-6.9163785],
[107.5958883,-6.9161495],
[107.5959259,-6.9163785],
[107.5966984,-6.9163732],
[107.5966876,-6.9166767],
[107.5967252,-6.9167353],
[107.5967145,-6.9169962],
[107.5967252,-6.9167353],
[107.5966876,-6.9166767],
[107.5966984,-6.9163732],
[107.5974011,-6.9163465],
[107.5973904,-6.9164956],
[107.5972831,-6.9170069],
[107.5973904,-6.9164956],
[107.5974011,-6.9163465],
[107.598195,-6.9163252],
[107.5982165,-6.9170921],
[107.598195,-6.9163199],
[107.598136,-6.9155318],
[107.5972187,-6.915585],
[107.598136,-6.9155318],
[107.5980702,-6.9148107],
[107.5973567,-6.9148426],
[107.5972724,-6.915159],
[107.5973567,-6.9148426],
[107.5980702,-6.9148107],
[107.598136,-6.9155318],
[107.598195,-6.9163252],
[107.5995703,-6.9162367],
[107.5992753,-6.9147988],
[107.5995489,-6.9147829],
[107.5992753,-6.9147988],
[107.5992235,-6.9147309],
[107.5992753,-6.9147988],
[107.5995703,-6.9162367],
[107.5999405,-6.9162047],
[107.5998976,-6.9160343],
[107.5998815,-6.915816],
[107.5996937,-6.9148787],
[107.5998815,-6.915816],
[107.5998976,-6.916029],
[107.5999405,-6.9162047],
[107.6013406,-6.9161994],
[107.6012923,-6.9156722],
[107.6014533,-6.9156562],
[107.6014586,-6.9155604],
[107.6018019,-6.9155497],
[107.6018127,-6.9152994],
[107.601582,-6.9153473],
[107.6015168,-6.9147708],
[107.601582,-6.9153473],
[107.6018127,-6.9152994],
[107.6018019,-6.9155497],
[107.6014586,-6.9155604],
[107.6014533,-6.9156562],
[107.6012923,-6.9156722],
[107.6013406,-6.9161994],
[107.6016142,-6.9162047],
[107.6016356,-6.9156349],
[107.6016142,-6.9162047],
[107.6023008,-6.9161195],
[107.6023116,-6.9153686],
[107.6024779,-6.915374],
[107.6024832,-6.9158266],
[107.6024779,-6.915374],
[107.6027514,-6.9153846],
[107.6027193,-6.9161089],
[107.6023008,-6.9161195],
[107.6027193,-6.9161089],
[107.6031055,-6.9160982],
[107.6044752,-6.9158253],
[107.6031055,-6.9160982],
[107.6031484,-6.9168012],
[107.6027407,-6.9168065],
[107.60273,-6.916929],
[107.6026388,-6.9169343],
[107.60273,-6.916929],
[107.6027407,-6.9168065],
[107.6028748,-6.9168065],
[107.6028802,-6.9169503],
[107.6028748,-6.9168065],
[107.6031484,-6.9168012],
[107.6031699,-6.9170089],
[107.6043948,-6.91713],
[107.6042875,-6.9183176],
[107.6034971,-6.9180633],
[107.6030948,-6.9179302],
[107.6031699,-6.9170089],
[107.6030948,-6.9179302],
[107.603025,-6.9182284],
[107.6030948,-6.9179302],
[107.6034971,-6.9180633],
[107.6033684,-6.9185692],
[107.6033684,-6.9186437],
[107.6037921,-6.9186704],
[107.6038619,-6.9185905],
[107.6042419,-6.9186477],
[107.6042151,-6.9191164],
[107.6036419,-6.9191017],
[107.6032986,-6.9190751],
[107.6033684,-6.9186437],
[107.6033684,-6.9185692],
[107.6027032,-6.9185266],
[107.6027032,-6.9189526],
[107.6029982,-6.9189633],
[107.6033093,-6.9190005],
[107.6029982,-6.9189633],
[107.6029928,-6.9191017],
[107.602907,-6.9191337],
[107.6029124,-6.9193627],
[107.6029928,-6.9194053],
[107.6030197,-6.9196609],
[107.6032342,-6.9196662],
[107.6032986,-6.9190751],
[107.6032705,-6.9193414],
[107.6041909,-6.9194519],
[107.6041775,-6.9198513],
[107.6032503,-6.919794],
[107.6032342,-6.9196662],
[107.6032503,-6.919794],
[107.6032369,-6.9198792],
[107.6021948,-6.9198239],
[107.6032369,-6.9198792],
[107.6032141,-6.9201819],
[107.6026696,-6.9200807],
[107.6032168,-6.9201819],
[107.6031658,-6.9204348],
[107.6031502,-6.9206607],
[107.6021498,-6.9205462],
[107.6021895,-6.9198677],
[107.6018515,-6.9198464],
[107.6021895,-6.9198677],
[107.6021948,-6.9198239],
[107.6022351,-6.9193085],
[107.6018837,-6.9193085],
[107.6022378,-6.9193112],
[107.6022538,-6.9184511],
[107.6027032,-6.9185266],
[107.6022512,-6.9184485],
[107.6022485,-6.9179799],
[107.6025757,-6.9179692],
[107.6022485,-6.9179799],
[107.6022458,-6.917884],
[107.6016182,-6.917892],
[107.6022458,-6.9178867],
[107.6022726,-6.9173115],
[107.6026776,-6.9173594],
[107.6026723,-6.9175805],
[107.6026803,-6.9173594],
[107.6031363,-6.9173861],
[107.6026776,-6.9173648],
[107.6022753,-6.9173142],
[107.6022699,-6.9169467],
[107.6022109,-6.9161266],
[107.6022699,-6.9169441],
[107.602278,-6.9173168],
[107.6015162,-6.9172955],
[107.6015484,-6.9168296],
[107.6015189,-6.9172955],
[107.6012882,-6.9172876],
[107.6008323,-6.9172663],
[107.6007894,-6.9177242],
[107.6008296,-6.9172609],
[107.6007974,-6.9172583],
[107.6008135,-6.9171837],
[107.6008189,-6.917],
[107.6007062,-6.9168855],
[107.600505,-6.9166432],
[107.6004004,-6.9163982],
[107.6003924,-6.9162038],
[107.5999405,-6.9162047],
[107.5995703,-6.9162367],
[107.5991908,-6.9162571],
[107.5992095,-6.9165447],
[107.5994456,-6.9166325],
[107.5998211,-6.9168935],
[107.5998586,-6.9166911],
[107.5998211,-6.9168935],
[107.5998104,-6.9171864],
[107.5982165,-6.9170921],
[107.5972831,-6.9170069],
[107.5967145,-6.9169962],
[107.5964254,-6.9169893],
[107.5963315,-6.9170639],
[107.5962886,-6.9169893],
[107.5963154,-6.9167337],
[107.5962886,-6.9169973],
[107.5963369,-6.9170612],
[107.5960043,-6.9174526],
[107.5959634,-6.9174329],
[107.5955504,-6.9172945],
[107.5952291,-6.9171864],
[107.5942951,-6.9171347],
[107.5941616,-6.9171411],
[107.5932954,-6.9170661],
[107.5941616,-6.9171411],
[107.5941643,-6.9181529],
[107.5941482,-6.918334],
[107.5931129,-6.9181849],
[107.5941536,-6.9183313],
[107.5940248,-6.9187041],
[107.5933757,-6.9186242],
[107.5940248,-6.9187041],
[107.593939,-6.9190076],
[107.5938698,-6.9195477],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5941643,-6.9181529],
[107.5944015,-6.9181847],
[107.5944444,-6.9178652],
[107.5950291,-6.9178652],
[107.5950559,-6.9177427],
[107.5952008,-6.9177054],
[107.5955226,-6.9177534],
[107.5955504,-6.9172945],
[107.5955226,-6.917748],
[107.5954904,-6.9183179],
[107.5943961,-6.91819],
[107.5954958,-6.9183179],
[107.5961503,-6.9183072],
[107.5954958,-6.9183179],
[107.5954422,-6.9187812],
[107.5953992,-6.9189409],
[107.5951632,-6.9193882],
[107.5951519,-6.9197021],
[107.5954952,-6.9197421],
[107.5956085,-6.9194095],
[107.5956889,-6.9190314],
[107.5957908,-6.9186054],
[107.5956889,-6.9190314],
[107.5956085,-6.9194149],
[107.5954952,-6.9197421],
[107.5956937,-6.9197687],
[107.5958713,-6.9192711],
[107.5959947,-6.9191113],
[107.596279,-6.9192019],
[107.5964453,-6.9192338],
[107.5966867,-6.9192871],
[107.5967564,-6.91909],
[107.5965794,-6.9190527],
[107.5965526,-6.9191539],
[107.5965794,-6.9190527],
[107.596456,-6.9190368],
[107.5964507,-6.9192338],
[107.596456,-6.9190368],
[107.5963273,-6.9190527],
[107.596279,-6.9192019],
[107.5959947,-6.9191113],
[107.5961503,-6.9187332],
[107.5964829,-6.9188557],
[107.5967779,-6.9188983],
[107.5967564,-6.91909],
[107.5967779,-6.9188983],
[107.5968289,-6.9185868],
[107.5965875,-6.9185149],
[107.5962119,-6.9184856],
[107.5961503,-6.9187306],
[107.5962093,-6.9184909],
[107.5962441,-6.9183152],
[107.5961476,-6.9183072],
[107.5962441,-6.9183179],
[107.5965821,-6.918443],
[107.5965875,-6.9185149],
[107.5965821,-6.9184403],
[107.596743,-6.9176256],
[107.5963407,-6.9175137],
[107.5962978,-6.9175723],
[107.5960043,-6.9174526],
[107.5959705,-6.9174924],
[107.5961503,-6.9183072],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5972831,-6.9170069],
[107.597159,-6.9175675],
[107.5974702,-6.91769],
[107.5973951,-6.9183557],
[107.5969123,-6.9182439],
[107.597159,-6.9175675],
[107.5969123,-6.9182439],
[107.5968289,-6.9185868],
[107.597379,-6.9186699],
[107.5973951,-6.9183557],
[107.597379,-6.9186699],
[107.5973575,-6.9190118],
[107.5967779,-6.9188983],
[107.5973575,-6.9190118],
[107.5972386,-6.9199498],
[107.5976544,-6.9200004],
[107.5977706,-6.9193739],
[107.5977116,-6.9193153],
[107.5977867,-6.9186656],
[107.597379,-6.9186699],
[107.5977867,-6.9186656],
[107.5982802,-6.9187082],
[107.5983705,-6.9200829],
[107.5982802,-6.9187082],
[107.5982641,-6.9177869],
[107.5981193,-6.9177923],
[107.5979154,-6.9177656],
[107.597733,-6.9177443],
[107.5979154,-6.9177656],
[107.5981193,-6.9177923],
[107.5982641,-6.9177869],
[107.5982165,-6.9170921],
[107.5982641,-6.9177869],
[107.5982748,-6.9180532],
[107.5989722,-6.9181224],
[107.5990795,-6.9180745],
[107.5990956,-6.9178562],
[107.5989668,-6.9178455],
[107.5989132,-6.9177656],
[107.5987254,-6.9177071],
[107.5989132,-6.9177656],
[107.5989668,-6.9178455],
[107.5990956,-6.9178562],
[107.5991868,-6.9174994],
[107.5994765,-6.9175473],
[107.5997822,-6.9175739],
[107.5998104,-6.9171864],
[107.6007974,-6.9172583],
[107.5998104,-6.9171864],
[107.5997822,-6.9175739],
[107.6000612,-6.9176378],
[107.5997822,-6.9175739],
[107.599734,-6.9177443],
[107.6003831,-6.9178455],
[107.6004206,-6.9174994],
[107.600544,-6.9174727],
[107.6005547,-6.9172384],
[107.600544,-6.9174727],
[107.6004206,-6.9174994],
[107.6003831,-6.9178455],
[107.6004004,-6.9182369],
[107.6005667,-6.9182795],
[107.6005399,-6.9185458],
[107.6004433,-6.9186097],
[107.6002395,-6.9186097],
[107.6002234,-6.9188973],
[107.5996387,-6.9188281],
[107.599628,-6.9183168],
[107.5999713,-6.9183168],
[107.599628,-6.9183168],
[107.5996119,-6.9180293],
[107.5999874,-6.9180825],
[107.6004004,-6.9182369],
[107.6003831,-6.9178455],
[107.599734,-6.9177443],
[107.5996119,-6.9180293],
[107.5996199,-6.9181631],
[107.5993812,-6.9181304],
[107.5994765,-6.9175473],
[107.5993812,-6.9181304],
[107.5990795,-6.9180745],
[107.5989722,-6.9181224],
[107.5989198,-6.9187535],
[107.5993812,-6.9187855],
[107.5993812,-6.9181304],
[107.5993812,-6.9187855],
[107.5996387,-6.9188281],
[107.5998157,-6.9190783],
[107.5995421,-6.919105],
[107.5998157,-6.9190783],
[107.5997621,-6.9197706],
[107.5997385,-6.9202507],
[107.5997621,-6.9197706],
[107.5993436,-6.919744],
[107.5992793,-6.9198026],
[107.5992846,-6.9199304],
[107.5992793,-6.9198026],
[107.5993436,-6.919744],
[107.5997621,-6.9197706],
[107.5997889,-6.9194085],
[107.5991291,-6.9193499],
[107.5991291,-6.9190996],
[107.5987804,-6.919073],
[107.5987643,-6.9187482],
[107.5989198,-6.9187535],
[107.5987643,-6.9187482],
[107.5982802,-6.9187082],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.6018038,-6.9204983],
[107.6018515,-6.9198464],
[107.6018837,-6.9193085],
[107.6015508,-6.9193359],
[107.6015616,-6.9196714],
[107.6011592,-6.9196608],
[107.6011217,-6.919762],
[107.6011592,-6.9198951],
[107.6011217,-6.919762],
[107.6011592,-6.9196608],
[107.6011807,-6.919304],
[107.6015508,-6.9193359],
[107.6015562,-6.9189099],
[107.6017761,-6.9189099],
[107.6015562,-6.9189099],
[107.6015776,-6.9185318],
[107.60117,-6.9185265],
[107.6015776,-6.9185318],
[107.6016182,-6.917892],
[107.6012451,-6.9178981],
[107.6012882,-6.9172876],
[107.6012451,-6.9178981],
[107.60117,-6.9185265],
[107.6010788,-6.9192667],
[107.6011807,-6.919304],
[107.6010788,-6.9192667],
[107.6006872,-6.9190111],
[107.6002234,-6.9188973],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.6004385,-6.9146777],
[107.6004271,-6.9149108],
[107.5999765,-6.9150493],
[107.6001857,-6.915912],
[107.6002501,-6.915928],
[107.6002554,-6.9162049],
[107.600588,-6.9161996],
[107.600529,-6.9158641],
[107.6002501,-6.9159227],
[107.600529,-6.9158641],
[107.6006739,-6.9158321],
[107.6007382,-6.9157842],
[107.6007114,-6.9156457],
[107.6009528,-6.9156085],
[107.6010011,-6.9155339],
[107.6015053,-6.9154274],
[107.6014732,-6.9152357],
[107.6013551,-6.9152517],
[107.6013716,-6.9154557],
[107.6010011,-6.9155339],
[107.6008777,-6.9153315],
[107.6006041,-6.9154061],
[107.6004271,-6.9149055],
]])
def jalanKelurahanMaleber(self, nama):
self.jalan.record(nama)
self.jalan.line([[
[107.5688412,-6.9100128],
[107.569164,-6.9105174],
[107.569341,-6.9106346],
[107.5692847,-6.9107491],
[107.5696974,-6.9114267],
[107.5699509,-6.9108835],
[107.5696974,-6.9114267],
[107.5700515,-6.9119965],
[107.5701373,-6.9119139],
[107.5700515,-6.9119965],
[107.5704029,-6.9125876],
[107.5705826,-6.9123799],
[107.5706255,-6.9122947],
[107.5706952,-6.9120551],
[107.5706523,-6.9120471],
[107.5706952,-6.9120551],
[107.5708293,-6.912063],
[107.5709715,-6.9120737],
[107.5708293,-6.912063],
[107.5710466,-6.9113122],
[107.5708293,-6.912063],
[107.5706952,-6.9120551],
[107.5706255,-6.9122947],
[107.5705826,-6.9123799],
[107.5704029,-6.9125876],
[107.5706335,-6.9129604],
[107.5707784,-6.9128432],
[107.571009,-6.9125743],
[107.5710546,-6.9125743],
[107.5711968,-6.9126062],
[107.5712799,-6.9123719],
[107.5711968,-6.9126062],
[107.5710546,-6.9125743],
[107.571009,-6.9125743],
[107.5707784,-6.9128432],
[107.5706335,-6.9129604],
[107.5709473,-6.9134849],
[107.571229,-6.9133278],
[107.5714865,-6.9133997],
[107.571229,-6.9133278],
[107.5709473,-6.9134849],
[107.5716769,-6.9147284],
[107.5717761,-6.9146565],
[107.5720175,-6.9138817],
[107.5721946,-6.9135195],
[107.5720256,-6.9134477],
[107.5721946,-6.9135195],
[107.5722482,-6.913421],
[107.5723825,-6.9130857],
[107.5721198,-6.9129207],
[107.5722113,-6.9127933],
[107.5721959,-6.9127141],
[107.5718432,-6.9126089],
[107.5721959,-6.9127141],
[107.5722113,-6.9127933],
[107.5721198,-6.9129207],
[107.5723825,-6.9130857],
[107.5733039,-6.9134641],
[107.5723825,-6.9130857],
[107.5722482,-6.913421],
[107.5721946,-6.9135195],
[107.5720175,-6.9138817],
[107.5717761,-6.9146565],
[107.5716769,-6.9147284],
[107.5718647,-6.9150186],
[107.572157,-6.9148296],
[107.5725674,-6.9148882],
[107.5725754,-6.9148296],
[107.5725674,-6.9148882],
[107.572157,-6.9148296],
[107.5718647,-6.9150186],
[107.5721892,-6.9154953],
[107.572318,-6.9153142],
[107.5721892,-6.9154953],
[107.5724226,-6.9157908],
[107.572554,-6.9155805],
[107.572503,-6.9154846],
[107.5723662,-6.915426],
[107.572503,-6.9154846],
[107.572554,-6.9155805],
[107.572664,-6.9156071],
[107.5728008,-6.9155565],
[107.5729214,-6.9155139],
[107.5729636,-6.9155205],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5735333,-6.9149932],
[107.5731403,-6.9148526],
[107.5733817,-6.9149379],
[107.5735078,-6.9142189],
[107.5735641,-6.9139686],
[107.5742373,-6.9141444],
[107.5738457,-6.9151136],
[107.5742373,-6.9141417],
[107.574468,-6.9136757],
[107.57424,-6.914147],
[107.5735587,-6.9139713],
[107.5731537,-6.9138568],
[107.5722482,-6.913421],
[107.5731537,-6.9138568],
[107.5733039,-6.9134641],
[107.5739476,-6.9137037],
[107.5733039,-6.9134641],
[107.5734675,-6.9129448],
[107.5740469,-6.9131525],
[107.5734675,-6.9129448],
[107.5737223,-6.9123404],
[107.5745994,-6.9126759],
[107.5745833,-6.9127717],
[107.5745941,-6.9128383],
[107.574645,-6.9128783],
[107.5747738,-6.912849],
[107.5748086,-6.9127904],
[107.5748355,-6.9127584],
[107.5753516,-6.9129897],
[107.5748355,-6.9127611],
[107.5747604,-6.9127345],
[107.5749052,-6.9124735],
[107.574645,-6.9123244],
[107.5749079,-6.9124735],
[107.5747604,-6.9127345],
[107.5745967,-6.9126759],
[107.5740871,-6.9124762],
[107.574181,-6.9122259],
[107.5740871,-6.9124762],
[107.5737223,-6.9123404],
[107.5732932,-6.9121726],
[107.5736097,-6.9113685],
[107.5732932,-6.9121726],
[107.5729794,-6.9120448],
[107.5727299,-6.9126386],
[107.5729794,-6.9120422],
[107.5729016,-6.9120129],
[107.5731576,-6.9113992],
[107.5733064,-6.9109505],
[107.5731576,-6.9113992],
[107.5729016,-6.9120129],
[107.5719977,-6.9116561],
[107.5721237,-6.911451],
[107.5719977,-6.9116561],
[107.5718662,-6.9119729],
[107.5719977,-6.9116561],
[107.571771,-6.9115695],
[107.5717187,-6.9116827],
[107.571771,-6.9115695],
[107.5717974,-6.9115781],
[107.5719453,-6.911215],
[107.5717981,-6.9112033],
[107.5719453,-6.911215],
[107.5717974,-6.9115781],
[107.5715459,-6.9114949],
[107.5713824,-6.9119103],
[107.5715459,-6.9114949],
[107.57131,-6.9114123],
[107.5714226,-6.9110928],
[107.57131,-6.9114123],
[107.5710466,-6.9113122],
[107.5711517,-6.9109676],
[107.5710466,-6.9113122],
[107.5706314,-6.9111354],
[107.5705402,-6.9113484],
[107.5705617,-6.9114496],
[107.5705053,-6.9115987],
[107.5704436,-6.9115774],
[107.5704597,-6.9115108],
[107.5703363,-6.9114443],
[107.5704517,-6.9110848],
[107.5706314,-6.9111354],
[107.5705821,-6.9111211],
[107.5709613,-6.9101795],
[107.5708916,-6.9101555],
[107.5709613,-6.9101795],
[107.5705821,-6.9111211],
[107.5704463,-6.9110821],
[107.5699509,-6.9108835],
[107.5696658,-6.9107653],
[107.5703524,-6.909125],
[107.5705804,-6.909133],
[107.570854,-6.9085925],
[107.5705804,-6.909133],
[107.5703524,-6.909125],
[107.5696658,-6.9107653],
[107.569341,-6.9106346],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5696075,-6.9094825],
[107.5696906,-6.9092908],
[107.5693588,-6.9092193],
[107.5696906,-6.9092908],
[107.5697684,-6.9090911],
[107.5695056,-6.9090351],
[107.5697684,-6.9090911],
[107.5698569,-6.9088914],
[107.5695834,-6.9088354],
[107.5698569,-6.9088914],
[107.5699481,-6.9087023],
[107.5697282,-6.9086331],
[107.5699481,-6.9087023],
[107.5700366,-6.9084973],
[107.5696569,-6.9084019],
[107.5700366,-6.9084973],
[107.5701129,-6.9083221],
[107.5698607,-6.9082528],
[107.5701129,-6.9083221],
[107.570854,-6.9085925],
[107.5701129,-6.9083221],
[107.5701665,-6.9082049],
[107.5698661,-6.9081197],
[107.5701665,-6.9082049],
[107.5702041,-6.908125],
[107.5703113,-6.908157],
[107.5702041,-6.908125],
[107.5702631,-6.9079652],
[107.5700002,-6.9078694],
[107.5702631,-6.9079652],
[107.5702952,-6.9079173],
[107.5705125,-6.9079985],
[107.570719,-6.9080877],
[107.5705125,-6.9079985],
[107.5702952,-6.9079173],
[107.5703435,-6.9077203],
[107.569968,-6.9076297],
[107.5703435,-6.9077203],
[107.5704133,-6.9075499],
[107.5700753,-6.9074806],
[107.5704133,-6.9075499],
[107.5706332,-6.9076138],
[107.5705125,-6.9079985],
[107.5706332,-6.9076138],
[107.5704133,-6.9075499],
[107.570483,-6.907257],
[107.5700807,-6.9071558],
[107.570483,-6.907257],
[107.5709604,-6.9073794],
[107.570483,-6.907257],
[107.5705098,-6.9070013],
[107.5702309,-6.9069641],
[107.5705098,-6.9070013],
[107.5705366,-6.9069215],
[107.5707995,-6.9069854],
[107.5705366,-6.9069215],
[107.570542,-6.9068256],
[107.5702255,-6.9067777],
[107.570542,-6.9068256],
[107.5705742,-6.9067138],
[107.5708585,-6.9067777],
[107.5705742,-6.9067138],
[107.570593,-6.9065859],
[107.5702094,-6.9065487],
[107.570593,-6.9065859],
[107.5705957,-6.906522],
[107.5707727,-6.9065487],
[107.5705957,-6.906522],
[107.5706225,-6.9063889],
[107.5702952,-6.9063463],
[107.5706225,-6.9063889],
[107.5706654,-6.9061972],
[107.5702952,-6.9061493],
[107.5706654,-6.9061972],
[107.570719,-6.9059629],
[107.5702952,-6.9058936],
[107.570719,-6.9059629],
[107.5708961,-6.9059788],
[107.570719,-6.9059629],
[107.5707459,-6.9057392],
[107.570365,-6.9056487],
[107.5707459,-6.9057392],
[107.5707673,-6.9055368],
[107.5703274,-6.9054569],
[107.5707673,-6.9055368],
[107.5708371,-6.9053664],
[107.5706654,-6.9053025],
[107.5708371,-6.9053664],
[107.5708961,-6.9052066],
[107.570542,-6.9051108],
[107.5708961,-6.9052066],
[107.5709765,-6.9049776],
[107.5709578,-6.9050296],
[107.5705313,-6.9048871],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5758411,-6.9122926],
[107.5737543,-6.9114911],
[107.5736578,-6.9113633],
[107.5736097,-6.9113685],
[107.5736604,-6.9113659],
[107.5736953,-6.9112754],
[107.5737892,-6.9112434],
[107.5739179,-6.9109692],
[107.5742505,-6.9110704],
[107.5760771,-6.9117866],
[107.5742532,-6.9110704],
[107.5739179,-6.9109665],
[107.5742183,-6.9102769],
[107.5761723,-6.9110832],
[107.574221,-6.9102769],
[107.5737194,-6.9100665],
[107.5733064,-6.9109505],
[107.5737221,-6.9100665],
[107.5732742,-6.9098349],
[107.5730677,-6.909739],
[107.5732715,-6.9098322],
[107.5734512,-6.9094301],
[107.5737248,-6.908602],
[107.5737868,-6.9084887],
[107.5739448,-6.9081067],
[107.5739905,-6.9081123],
[107.5739448,-6.9081067],
[107.5736658,-6.9080375],
[107.5737838,-6.907694],
[107.5739367,-6.907694],
[107.5742478,-6.907072],
[107.5739367,-6.907694],
[107.5737838,-6.907694],
[107.5736658,-6.9080375],
[107.5731535,-6.9079523],
[107.5737731,-6.9064718],
[107.5741084,-6.906597],
[107.5743926,-6.9067631],
[107.5741084,-6.906597],
[107.5737731,-6.9064718],
[107.5731535,-6.9079523],
[107.5728906,-6.9078964],
[107.5729577,-6.9078218],
[107.5730382,-6.907505],
[107.5729577,-6.9078218],
[107.5728906,-6.9078964],
[107.5726573,-6.9085807],
[107.5728906,-6.9078964],
[107.5726788,-6.9078511],
[107.5729657,-6.9069831],
[107.5732527,-6.9070576],
[107.5729657,-6.9069831],
[107.5729604,-6.9068979],
[107.5730623,-6.9064692],
[107.5730221,-6.9064239],
[107.5730757,-6.9062135],
[107.5733627,-6.90632],
[107.5734325,-6.9062934],
[107.5734566,-6.9061763],
[107.5734995,-6.9060724],
[107.5737007,-6.905476],
[107.5737999,-6.9055079],
[107.5743256,-6.9057928],
[107.5742291,-6.9060538],
[107.5741888,-6.9061283],
[107.5743095,-6.9061922],
[107.5744436,-6.9062082],
[107.5745643,-6.9058993],
[107.5745107,-6.9058461],
[107.5745831,-6.9055905],
[107.5747682,-6.9052044],
[107.575074,-6.9053961],
[107.574685,-6.9060218],
[107.575074,-6.9053961],
[107.5751361,-6.9054375],
[107.575074,-6.9053961],
[107.5747682,-6.9052044],
[107.5741271,-6.904781],
[107.5746166,-6.9051038],
[107.5745375,-6.9052363],
[107.5745053,-6.9052549],
[107.5744705,-6.9053455],
[107.5745322,-6.9054067],
[107.5744061,-6.9057023],
[107.5743551,-6.9057209],
[107.5743256,-6.9057928],
[107.5737999,-6.9055079],
[107.5741271,-6.904781],
[107.573816,-6.9045014],
[107.573706,-6.9044401],
[107.5735478,-6.9046958],
[107.573706,-6.9044401],
[107.5734485,-6.9042697],
[107.5733439,-6.9044481],
[107.5734485,-6.9042697],
[107.5731079,-6.9040407],
[107.5729684,-6.904291],
[107.5731079,-6.9040407],
[107.5728772,-6.9038836],
[107.572778,-6.9040194],
[107.5728772,-6.9038836],
[107.572609,-6.9037798],
[107.5722684,-6.9042751],
[107.5723542,-6.9041526],
[107.5725098,-6.9042617],
[107.5723542,-6.9041526],
[107.572609,-6.9037798],
[107.5723327,-6.9035428],
[107.572204,-6.9037958],
[107.5720645,-6.9041233],
[107.572204,-6.9037958],
[107.5723327,-6.9035428],
[107.5719251,-6.9032739],
[107.5717802,-6.9035295],
[107.5719251,-6.9032739],
[107.571799,-6.903194],
[107.5715388,-6.9037239],
[107.571799,-6.903194],
[107.5709002,-6.902592],
[107.5715469,-6.9030262],
[107.5711499,-6.9036679],
[107.5709434,-6.9041313],
[107.5713511,-6.9043043],
[107.5714369,-6.9040194],
[107.5715388,-6.9037239],
[107.571681,-6.9037904],
[107.571858,-6.9039129],
[107.5718741,-6.9040061],
[107.5714369,-6.9040194],
[107.5718741,-6.9040061],
[107.5720645,-6.9041233],
[107.5722684,-6.9042751],
[107.5721557,-6.9044721],
[107.5722281,-6.9045067],
[107.5721557,-6.9044721],
[107.5720404,-6.9046825],
[107.5713913,-6.9043629],
[107.5712947,-6.904544],
[107.5713913,-6.9043629],
[107.5713511,-6.9043043],
[107.5713913,-6.9043629],
[107.5720404,-6.9046825],
[107.5717829,-6.9051271],
[107.57163,-6.9050339],
[107.5717829,-6.9051271],
[107.5717078,-6.9052842],
[107.5715576,-6.9056331],
[107.5713242,-6.9055718],
[107.5711472,-6.9054893],
[107.5712813,-6.9051618],
[107.5711472,-6.9054893],
[107.570997,-6.9054307],
[107.5708371,-6.9053664],
[107.570997,-6.9054307],
[107.5708961,-6.9059788],
[107.5707727,-6.9065487],
[107.5708897,-6.9066209],
[107.5708585,-6.9067777],
[107.5707995,-6.9069854],
[107.5708585,-6.9067777],
[107.5708897,-6.9066209],
[107.5709353,-6.9066183],
[107.5710989,-6.9066289],
[107.5713752,-6.9066795],
[107.5712733,-6.9073905],
[107.5712384,-6.9074491],
[107.5709604,-6.9073794],
[107.570719,-6.9080877],
[107.5706564,-6.9082532],
[107.570719,-6.9080877],
[107.5709604,-6.9073794],
[107.5712384,-6.9074491],
[107.5710158,-6.908176],
[107.570938,-6.9083783],
[107.5708736,-6.9083517],
[107.570938,-6.9083783],
[107.570854,-6.9085925],
[107.570938,-6.9083783],
[107.5710158,-6.908176],
[107.5713913,-6.9083411],
[107.5710936,-6.9093289],
[107.571343,-6.9094088],
[107.5714101,-6.9094275],
[107.5713135,-6.9098349],
[107.5715388,-6.9099227],
[107.5713913,-6.9104047],
[107.5714825,-6.910426],
[107.5713913,-6.9104047],
[107.5709434,-6.9102263],
[107.5709613,-6.9101795],
[107.5710936,-6.909771],
[107.5710667,-6.9098615],
[107.5712169,-6.9099147],
[107.5710667,-6.9098615],
[107.5709434,-6.9102263],
[107.5713913,-6.9104047],
[107.5712786,-6.9107242],
[107.571233,-6.9107242],
[107.5711517,-6.9109676],
[107.570989,-6.9109079],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5731576,-6.9113992],
[107.5722645,-6.9110155],
[107.5721814,-6.9112551],
[107.5719453,-6.911215],
[107.5722404,-6.9104856],
[107.5728948,-6.9107652],
[107.5730987,-6.9103897],
[107.5730424,-6.9104909],
[107.5728439,-6.9103977],
[107.5730424,-6.9104909],
[107.5728948,-6.9107652],
[107.5733064,-6.9109505],
[107.5728948,-6.9107652],
[107.5722404,-6.9104856],
[107.5723369,-6.9102166],
[107.5715388,-6.9099227],
[107.5723369,-6.9102166],
[107.5725703,-6.9097054],
[107.5727473,-6.9097959],
[107.5725703,-6.9097054],
[107.5717737,-6.9094924],
[107.5714101,-6.9094275],
[107.571343,-6.9094088],
[107.5719588,-6.907687],
[107.5716503,-6.9076018],
[107.5716074,-6.9075033],
[107.5712733,-6.9073905],
[107.5716074,-6.9075033],
[107.5716503,-6.9076018],
[107.5713913,-6.9083411],
[107.5716503,-6.9076018],
[107.5719588,-6.907687],
[107.5724201,-6.9077829],
[107.5726788,-6.9078511],
[107.5724201,-6.9077829],
[107.5724201,-6.9076311],
[107.5721626,-6.9075699],
[107.5723209,-6.9067471],
[107.5721626,-6.9075699],
[107.5716583,-6.9074527],
[107.5721626,-6.9075699],
[107.5724201,-6.9076311],
[107.5724201,-6.9077829],
[107.5719614,-6.9089492],
[107.5717737,-6.9094924],
[107.5719614,-6.9089492],
[107.5729351,-6.9093033],
[107.5729914,-6.9092847],
[107.5732918,-6.9084992],
[107.5737248,-6.908602],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.5708961,-6.9059788],
[107.5710438,-6.9060206],
[107.5711472,-6.9054893],
[107.5710438,-6.9060206],
[107.5709353,-6.9066183],
[107.5710438,-6.9060206],
[107.5712101,-6.9060499],
[107.5713242,-6.9055718],
[107.5712101,-6.9060499],
[107.5710989,-6.9066289],
[107.5712101,-6.9060499],
[107.5714622,-6.9060952],
[107.5714729,-6.9060605],
[107.5715576,-6.9056331],
[107.5714729,-6.9060605],
[107.5714622,-6.9060952],
[107.5714434,-6.9062922],
[107.5713752,-6.9066795],
[107.5714434,-6.9062922],
[107.5718323,-6.906428],
[107.5717572,-6.9067475],
[107.5718323,-6.906428],
[107.5720308,-6.9064839],
[107.5723876,-6.9066969],
[107.5729604,-6.9068979],
[107.5730623,-6.9064692],
[107.5730221,-6.9064239],
[107.5722615,-6.9060632],
[107.5721113,-6.9060179],
[107.5720711,-6.9062603],
[107.5723151,-6.9063455],
[107.5726102,-6.9064946],
[107.5723125,-6.9063428],
[107.5720711,-6.9062603],
[107.5714729,-6.9060605],
[107.5720711,-6.9062603],
[107.5720308,-6.9064839],
[107.5720711,-6.9062603],
[107.5721113,-6.9060179],
[107.5721515,-6.9058129],
[107.57224,-6.9055706],
[107.5717078,-6.9052842],
[107.5717829,-6.9051271],
[107.5720094,-6.9047425],
[107.5725297,-6.9050354],
[107.5724332,-6.9052378],
[107.57224,-6.9055706],
[107.5724332,-6.9052378],
[107.572527,-6.9053496],
[107.5723285,-6.905757],
[107.5725834,-6.9058848],
[107.5726531,-6.9058555],
[107.5727604,-6.9055733],
[107.5729642,-6.9051099],
[107.5733439,-6.9044481],
[107.5731386,-6.9043377],
[107.5730688,-6.9043298],
[107.5727094,-6.9049688],
[107.572527,-6.9053496],
[107.5727094,-6.9049688],
[107.5729642,-6.9051099],
]])
self.jalan.record(nama)
self.jalan.line([[
[107.573816,-6.9045014],
[107.5735225,-6.9049559],
[107.5732355,-6.9056402],
[107.5736057,-6.9057613],
[107.5734995,-6.9060724],
[107.5730934,-6.9059863],
[107.5732355,-6.9056402],
[107.5730934,-6.9059863],
[107.5730558,-6.9060902],
[107.5734566,-6.9061763],
[107.5731222,-6.9061048],
[107.5730757,-6.9062135],
[107.5728386,-6.9061328],
[107.5726642,-6.9060822],
[107.5721515,-6.9058129],
]])
def close(self):
self.kelurahan.close()
self.kantor.close()
self.jalan.close()
| 36.383885 | 64 | 0.471471 | 14,919 | 141,788 | 4.479791 | 0.31289 | 0.017506 | 0.015711 | 0.01791 | 0.623306 | 0.062438 | 0.062438 | 0.058443 | 0.029117 | 0.017042 | 0 | 0.682381 | 0.345615 | 141,788 | 3,896 | 65 | 36.393224 | 0.037938 | 0.000226 | 0 | 0.615748 | 0 | 0 | 0.000762 | 0.000332 | 0 | 0 | 0 | 0 | 0 | 1 | 0.005249 | false | 0 | 0.000262 | 0 | 0.005774 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
67a4dc5dd5440ed57b743f18f84e2d218d7c1ec4 | 5,216 | py | Python | site/flask/lib/python2.7/site-packages/speaklater.py | theholyhades1/tartanHacks2015 | a801b473f21cfbd136e2a5a74423e8c72d14f900 | [
"MIT"
] | 32 | 2015-01-19T12:13:26.000Z | 2021-11-11T00:11:22.000Z | site/flask/lib/python2.7/site-packages/speaklater.py | theholyhades1/tartanHacks2015 | a801b473f21cfbd136e2a5a74423e8c72d14f900 | [
"MIT"
] | 10 | 2020-06-05T19:42:26.000Z | 2022-03-11T23:38:35.000Z | site/flask/lib/python2.7/site-packages/speaklater.py | theholyhades1/tartanHacks2015 | a801b473f21cfbd136e2a5a74423e8c72d14f900 | [
"MIT"
] | 9 | 2015-07-18T01:03:56.000Z | 2019-05-24T09:36:40.000Z | # -*- coding: utf-8 -*-
r"""
speaklater
~~~~~~~~~~
A module that provides lazy strings for translations. Basically you
get an object that appears to be a string but changes the value every
time the value is evaluated based on a callable you provide.
For example you can have a global `lazy_gettext` function that returns
a lazy string with the value of the current set language.
Example:
>>> from speaklater import make_lazy_string
>>> sval = u'Hello World'
>>> string = make_lazy_string(lambda: sval)
This lazy string will evaluate to the value of the `sval` variable.
>>> string
lu'Hello World'
>>> unicode(string)
u'Hello World'
>>> string.upper()
u'HELLO WORLD'
If you change the value, the lazy string will change as well:
>>> sval = u'Hallo Welt'
>>> string.upper()
u'HALLO WELT'
This is especially handy when combined with a thread local and gettext
translations or dicts of translatable strings:
>>> from speaklater import make_lazy_gettext
>>> from threading import local
>>> l = local()
>>> l.translations = {u'Yes': 'Ja'}
>>> lazy_gettext = make_lazy_gettext(lambda: l.translations.get)
>>> yes = lazy_gettext(u'Yes')
>>> print yes
Ja
>>> l.translations[u'Yes'] = u'Si'
>>> print yes
Si
Lazy strings are no real strings so if you pass this sort of string to
a function that performs an instance check, it will fail. In that case
you have to explicitly convert it with `unicode` and/or `string` depending
on what string type the lazy string encapsulates.
To check if a string is lazy, you can use the `is_lazy_string` function:
>>> from speaklater import is_lazy_string
>>> is_lazy_string(u'yes')
False
>>> is_lazy_string(yes)
True
New in version 1.2: It's now also possible to pass keyword arguments to
the callback used with `make_lazy_string`.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
def is_lazy_string(obj):
"""Checks if the given object is a lazy string."""
return isinstance(obj, _LazyString)
def make_lazy_string(__func, *args, **kwargs):
"""Creates a lazy string by invoking func with args."""
return _LazyString(__func, args, kwargs)
def make_lazy_gettext(lookup_func):
"""Creates a lazy gettext function dispatches to a gettext
function as returned by `lookup_func`.
Example:
>>> translations = {u'Yes': u'Ja'}
>>> lazy_gettext = make_lazy_gettext(lambda: translations.get)
>>> x = lazy_gettext(u'Yes')
>>> x
lu'Ja'
>>> translations[u'Yes'] = u'Si'
>>> x
lu'Si'
"""
def lazy_gettext(string):
if is_lazy_string(string):
return string
return make_lazy_string(lookup_func(), string)
return lazy_gettext
class _LazyString(object):
"""Class for strings created by a function call.
The proxy implementation attempts to be as complete as possible, so that
the lazy objects should mostly work as expected, for example for sorting.
"""
__slots__ = ('_func', '_args', '_kwargs')
def __init__(self, func, args, kwargs):
self._func = func
self._args = args
self._kwargs = kwargs
value = property(lambda x: x._func(*x._args, **x._kwargs))
def __contains__(self, key):
return key in self.value
def __nonzero__(self):
return bool(self.value)
def __dir__(self):
return dir(unicode)
def __iter__(self):
return iter(self.value)
def __len__(self):
return len(self.value)
def __str__(self):
return str(self.value)
def __unicode__(self):
return unicode(self.value)
def __add__(self, other):
return self.value + other
def __radd__(self, other):
return other + self.value
def __mod__(self, other):
return self.value % other
def __rmod__(self, other):
return other % self.value
def __mul__(self, other):
return self.value * other
def __rmul__(self, other):
return other * self.value
def __lt__(self, other):
return self.value < other
def __le__(self, other):
return self.value <= other
def __eq__(self, other):
return self.value == other
def __ne__(self, other):
return self.value != other
def __gt__(self, other):
return self.value > other
def __ge__(self, other):
return self.value >= other
def __getattr__(self, name):
if name == '__members__':
return self.__dir__()
return getattr(self.value, name)
def __getstate__(self):
return self._func, self._args, self._kwargs
def __setstate__(self, tup):
self._func, self._args, self._kwargs = tup
def __getitem__(self, key):
return self.value[key]
def __copy__(self):
return self
def __repr__(self):
try:
return 'l' + repr(self.value)
except Exception:
return '<%s broken>' % self.__class__.__name__
if __name__ == '__main__':
import doctest
doctest.testmod()
| 25.950249 | 78 | 0.637078 | 697 | 5,216 | 4.48924 | 0.284075 | 0.060403 | 0.057526 | 0.05465 | 0.191115 | 0.161074 | 0.144455 | 0 | 0 | 0 | 0 | 0.001819 | 0.262078 | 5,216 | 200 | 79 | 26.08 | 0.81112 | 0.466449 | 0 | 0 | 0 | 0 | 0.019192 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.394737 | false | 0 | 0.013158 | 0.289474 | 0.855263 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
67aebac6e47b438aae9ad595766760877ca83a55 | 166 | py | Python | Chapter04/listcmp1.py | kaushalkumarshah/Learn-Python-in-7-Days | 2663656767c8959ace836f0c0e272f3e501bbe6e | [
"MIT"
] | 12 | 2018-07-09T16:20:31.000Z | 2022-03-21T22:52:15.000Z | Chapter04/listcmp1.py | kaushalkumarshah/Learn-Python-in-7-Days | 2663656767c8959ace836f0c0e272f3e501bbe6e | [
"MIT"
] | null | null | null | Chapter04/listcmp1.py | kaushalkumarshah/Learn-Python-in-7-Days | 2663656767c8959ace836f0c0e272f3e501bbe6e | [
"MIT"
] | 19 | 2018-01-09T12:49:06.000Z | 2021-11-23T08:05:55.000Z | list1 = [10,9,3,7,2,1,23,1,561,1,1,96,1]
def cmp1(x,y):
if x == 1 or y==1:
c = y-x
else:
c = x-y
return c
list1.sort(cmp = cmp1)
print list1 | 12.769231 | 41 | 0.5 | 39 | 166 | 2.128205 | 0.564103 | 0.048193 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.215517 | 0.301205 | 166 | 13 | 42 | 12.769231 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.111111 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
67c3fb858e01fe9489719be010810d56f24cb176 | 3,905 | py | Python | mongoadmin/auth/forms.py | hywhut/django-mongoadmin | 7252f9724e4d556878a907914424745f5fdb0d42 | [
"BSD-3-Clause"
] | null | null | null | mongoadmin/auth/forms.py | hywhut/django-mongoadmin | 7252f9724e4d556878a907914424745f5fdb0d42 | [
"BSD-3-Clause"
] | null | null | null | mongoadmin/auth/forms.py | hywhut/django-mongoadmin | 7252f9724e4d556878a907914424745f5fdb0d42 | [
"BSD-3-Clause"
] | 1 | 2020-05-10T13:57:36.000Z | 2020-05-10T13:57:36.000Z | # from django.utils.translation import ugettext_lazy as _
# from django import forms
# from django.contrib.auth.forms import ReadOnlyPasswordHashField
#
# from mongoengine.django.auth import User
#
# from mongodbforms import DocumentForm
#
# class UserCreationForm(DocumentForm):
# """
# A form that creates a user, with no privileges, from the given username and
# password.
# """
# error_messages = {
# 'duplicate_username': _("A user with that username already exists."),
# 'password_mismatch': _("The two password fields didn't match."),
# }
# username = forms.RegexField(label=_("Username"), max_length=30,
# regex=r'^[\w.@+-]+$',
# help_text=_("Required. 30 characters or fewer. Letters, digits and "
# "@/./+/-/_ only."),
# error_messages={
# 'invalid': _("This value may contain only letters, numbers and "
# "@/./+/-/_ characters.")})
# password1 = forms.CharField(label=_("Password"),
# widget=forms.PasswordInput)
# password2 = forms.CharField(label=_("Password confirmation"),
# widget=forms.PasswordInput,
# help_text=_("Enter the same password as above, for verification."))
#
# class Meta:
# model = User
# fields = ("username",)
#
# def clean_username(self):
# # Since User.username is unique, this check is redundant,
# # but it sets a nicer error message than the ORM. See #13147.
# username = self.cleaned_data["username"]
# try:
# User.objects.get(username=username)
# except User.DoesNotExist:
# return username
# raise forms.ValidationError(
# self.error_messages['duplicate_username'],
# code='duplicate_username',
# )
#
# def clean_password2(self):
# password1 = self.cleaned_data.get("password1")
# password2 = self.cleaned_data.get("password2")
# if password1 and password2 and password1 != password2:
# raise forms.ValidationError(
# self.error_messages['password_mismatch'],
# code='password_mismatch',
# )
# return password2
#
# def save(self, commit=True):
# user = super(UserCreationForm, self).save(commit=False)
# self.instance = user.set_password(self.cleaned_data["password1"])
# return self.instance
#
#
# class UserChangeForm(DocumentForm):
# username = forms.RegexField(
# label=_("Username"), max_length=30, regex=r"^[\w.@+-]+$",
# help_text=_("Required. 30 characters or fewer. Letters, digits and "
# "@/./+/-/_ only."),
# error_messages={
# 'invalid': _("This value may contain only letters, numbers and "
# "@/./+/-/_ characters.")})
# password = ReadOnlyPasswordHashField(label=_("Password"),
# help_text=_("Raw passwords are not stored, so there is no way to see "
# "this user's password, but you can change the password "
# "using <a href=\"password/\">this form</a>."))
#
# class Meta:
# model = User
#
# def __init__(self, *args, **kwargs):
# super(UserChangeForm, self).__init__(*args, **kwargs)
# f = self.fields.get('user_permissions', None)
# if f is not None:
# f.queryset = f.queryset.select_related('content_type')
#
# def clean_password(self):
# # Regardless of what the user provides, return the initial value.
# # This is done here, rather than on the field, because the
# # field does not have access to the initial value
# return self.initial["password"]
#
# def clean_email(self):
# email = self.cleaned_data.get("email")
# if email == '':
# return None
# return email
| 40.257732 | 81 | 0.589245 | 407 | 3,905 | 5.513514 | 0.380835 | 0.028966 | 0.033422 | 0.024064 | 0.19697 | 0.19697 | 0.159537 | 0.159537 | 0.159537 | 0.159537 | 0 | 0.009246 | 0.279898 | 3,905 | 96 | 82 | 40.677083 | 0.788762 | 0.94904 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
67c4dc33394c474c6cabe97b41d6b2b8fa22728a | 2,554 | py | Python | odin-libraries/python/odin_test.py | gspu/odin | a01d039e809eca257fa78d358fe72eb3ad2a09f2 | [
"MIT"
] | 447 | 2020-05-21T11:22:16.000Z | 2022-03-13T01:28:25.000Z | odin-libraries/python/odin_test.py | gspu/odin | a01d039e809eca257fa78d358fe72eb3ad2a09f2 | [
"MIT"
] | 40 | 2020-05-21T13:17:57.000Z | 2022-03-02T08:44:45.000Z | odin-libraries/python/odin_test.py | gspu/odin | a01d039e809eca257fa78d358fe72eb3ad2a09f2 | [
"MIT"
] | 25 | 2020-05-28T21:23:13.000Z | 2022-03-18T19:31:31.000Z | """ Runs tests for Ptyhon Odin SDK """
import unittest
from os import environ
import random
from pymongo import MongoClient
import pyodin as odin
class OdinSdkTest(unittest.TestCase):
""" Establish OdinSdkTest object """
def setUp(self):
client = MongoClient(environ.get('ODIN_MONGODB'))
mongodb = client['odin']
self.collection = mongodb['observability']
def tearDown(self):
self.collection.delete_many({"id" : "test_id"})
def test_condition_not_odin_env(self):
""" Run condition operation outside of Odin Env """
random_int = random.randint(100000, 999999)
test_desc = 'test_desc' + str(random_int)
odin_test = odin.Odin(config="job.yml", path_type="relative")
cond = odin_test.condition(test_desc, True)
result = self.collection.find_one({"description" : test_desc})
self.assertEqual(cond, True)
self.assertEqual(None, result)
def test_watch_not_odin_env(self):
""" Run watch operation outside of Odin Env """
random_int = random.randint(100000, 999999)
test_desc = 'test_desc' + str(random_int)
odin_test = odin.Odin(config="job.yml", path_type="relative")
odin_test.watch(test_desc, True)
result = self.collection.find_one({"description" : test_desc})
self.assertEqual(None, result)
def test_condition(self):
""" Run condition operation inside Odin Env """
random_int = random.randint(100000, 999999)
test_desc = 'test_desc' + str(random_int)
# test True sets odin exc env to true and in turn enables logging everything to the DB
odin_test = odin.Odin(test=True, config="job.yml", path_type="relative")
cond = odin_test.condition(test_desc, True)
result = self.collection.find_one({"description" : test_desc})
self.assertEqual(cond, True)
self.assertEqual(test_desc, result['description'])
def test_watch(self):
""" Run watch operation inside Odin Env """
random_int = random.randint(100000, 999999)
test_desc = 'test_desc' + str(random_int)
# test True sets odin exc env to true and in turn enables logging everything to the DB
odin_test = odin.Odin(test=True, config="job.yml", path_type="relative")
odin_test.watch(test_desc, True)
result = self.collection.find_one({"description" : test_desc})
self.assertEqual(test_desc, result['description'])
if __name__ == "__main__":
unittest.main() # run all tests
| 34.513514 | 94 | 0.664056 | 327 | 2,554 | 4.993884 | 0.238532 | 0.088181 | 0.031843 | 0.039192 | 0.73117 | 0.710349 | 0.65891 | 0.65891 | 0.65891 | 0.65891 | 0 | 0.02423 | 0.224354 | 2,554 | 73 | 95 | 34.986301 | 0.800101 | 0.160533 | 0 | 0.590909 | 0 | 0 | 0.098812 | 0 | 0 | 0 | 0 | 0 | 0.136364 | 1 | 0.136364 | false | 0 | 0.113636 | 0 | 0.272727 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
67c4e469d6bfee9cfc7c187e94df576f7ce20488 | 657 | py | Python | artemis/general/test_dict_ops.py | peteroconnor-bc/artemis | ad2871fae7d986bf10580eec27aee5b7315adad5 | [
"BSD-2-Clause-FreeBSD"
] | 235 | 2016-08-26T14:18:51.000Z | 2022-03-13T10:54:39.000Z | artemis/general/test_dict_ops.py | peteroconnor-bc/artemis | ad2871fae7d986bf10580eec27aee5b7315adad5 | [
"BSD-2-Clause-FreeBSD"
] | 112 | 2016-04-30T11:48:38.000Z | 2021-01-12T20:17:32.000Z | artemis/general/test_dict_ops.py | peteroconnor-bc/artemis | ad2871fae7d986bf10580eec27aee5b7315adad5 | [
"BSD-2-Clause-FreeBSD"
] | 31 | 2016-11-05T19:09:19.000Z | 2021-09-13T07:35:40.000Z | from artemis.general.dict_ops import cross_dict_dicts, merge_dicts
__author__ = 'peter'
def test_cross_dict_dicts():
assert cross_dict_dicts({'a':{'aa': 1}, 'b':{'bb': 2}}, {'c': {'cc': 3}, 'd': {'dd': 4}}) == {
('a','c'):{'aa':1, 'cc':3},
('a','d'):{'aa':1, 'dd':4},
('b','c'):{'bb':2, 'cc':3},
('b','d'):{'bb':2, 'dd':4}
}
def test_dict_merge():
assert merge_dicts({'a': 1, 'b': 2, 'c': 3}, {'c': 4, 'd': 5}, {'d': 6, 'e': 7}) == {
'a': 1,
'b': 2,
'c': 4,
'd': 6,
'e': 7,
}
if __name__ == "__main__":
test_dict_merge()
test_cross_dict_dicts()
| 22.655172 | 98 | 0.427702 | 99 | 657 | 2.545455 | 0.333333 | 0.142857 | 0.222222 | 0.142857 | 0.039683 | 0 | 0 | 0 | 0 | 0 | 0 | 0.050314 | 0.273973 | 657 | 28 | 99 | 23.464286 | 0.477987 | 0 | 0 | 0 | 0 | 0 | 0.092846 | 0 | 0 | 0 | 0 | 0 | 0.1 | 1 | 0.1 | false | 0 | 0.05 | 0 | 0.15 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
67ce55c048774bb454c705b23d4003d7370d1d13 | 204 | py | Python | status/urls.py | Khryptooo/infra_api | 15b69dea8e0ce1795525f96d9362722151b3c8f7 | [
"BSD-2-Clause"
] | null | null | null | status/urls.py | Khryptooo/infra_api | 15b69dea8e0ce1795525f96d9362722151b3c8f7 | [
"BSD-2-Clause"
] | null | null | null | status/urls.py | Khryptooo/infra_api | 15b69dea8e0ce1795525f96d9362722151b3c8f7 | [
"BSD-2-Clause"
] | null | null | null | from django.conf.urls import patterns, url
from status import views
urlpatterns = patterns('',
url(r'^ups$', views.ups_status, name='ups_status'),
url(r'^tor$', views.tor_status, name='tor_status'),
)
| 25.5 | 52 | 0.720588 | 31 | 204 | 4.612903 | 0.451613 | 0.153846 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.107843 | 204 | 7 | 53 | 29.142857 | 0.785714 | 0 | 0 | 0 | 0 | 0 | 0.147059 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
67cee025d3929b6dcb02f8283d7e7b80eb2a3619 | 2,958 | py | Python | fe/functional.py | proteneer/timemachine | feee9f24adcb533ab9e1c15a3f4fa4dcc9d9a701 | [
"Apache-2.0"
] | 91 | 2019-01-05T17:03:04.000Z | 2022-03-11T09:08:46.000Z | fe/functional.py | proteneer/timemachine | feee9f24adcb533ab9e1c15a3f4fa4dcc9d9a701 | [
"Apache-2.0"
] | 474 | 2019-01-07T14:33:15.000Z | 2022-03-31T19:15:12.000Z | fe/functional.py | proteneer/timemachine | feee9f24adcb533ab9e1c15a3f4fa4dcc9d9a701 | [
"Apache-2.0"
] | 12 | 2019-01-13T00:40:36.000Z | 2022-01-14T10:23:54.000Z | from jax import config
config.update("jax_enable_x64", True)
from jax import custom_jvp, numpy as np
from timemachine.lib.potentials import SummedPotential
def _make_selection_mask(compute_du_dx=False, compute_du_dp=False, compute_du_dl=False, compute_u=False):
return (compute_du_dx, compute_du_dp, compute_du_dl, compute_u)
def wrap_impl(impl, pack=lambda x: x):
"""Construct a differentiable function U(x, params, box, lam) -> float
from a single unbound potential
"""
@custom_jvp
def U(coords, params, box, lam):
selection = _make_selection_mask(compute_u=True)
result_tuple = impl.execute_selective(coords, pack(params), box, lam, *selection)
return result_tuple[3]
def U_jvp_x(coords_dot, _, coords, params, box, lam):
selection = _make_selection_mask(compute_du_dx=True)
result_tuple = impl.execute_selective(coords, pack(params), box, lam, *selection)
return np.sum(coords_dot * result_tuple[0])
def U_jvp_params(params_dot, _, coords, params, box, lam):
selection = _make_selection_mask(compute_du_dp=True)
result_tuple = impl.execute_selective(coords, pack(params), box, lam, *selection)
return np.sum(pack(params_dot) * result_tuple[1])
def U_jvp_lam(lam_dot, _, coords, params, box, lam):
selection = _make_selection_mask(compute_du_dl=True)
result_tuple = impl.execute_selective(coords, pack(params), box, lam, *selection)
return np.sum(lam_dot * result_tuple[2])
U.defjvps(U_jvp_x, U_jvp_params, None, U_jvp_lam)
return U
def construct_differentiable_interface(unbound_potentials, precision=np.float32):
"""Construct a differentiable function U(x, params, box, lam) -> float
from a collection of unbound potentials
>>> U = construct_differentiable_interface(unbound_potentials)
>>> _ = grad(U, (0,1,3))(coords, sys_params, box, lam)
This implementation computes the sum of the component potentials in Python
"""
impls = [ubp.unbound_impl(precision) for ubp in unbound_potentials]
U_s = [wrap_impl(impl) for impl in impls]
def U(coords, params, box, lam):
return np.sum(np.array([U_i(coords, p_i, box, lam) for (U_i, p_i) in zip(U_s, params)]))
return U
def construct_differentiable_interface_fast(unbound_potentials, params, precision=np.float32):
"""Construct a differentiable function U(x, params, box, lam) -> float
from a collection of unbound potentials
>>> U = construct_differentiable_interface(unbound_potentials, params)
>>> _ = grad(U, (0,1,3))(coords, sys_params, box, lam)
This implementation computes the sum of the component potentials in C++ using the SummedPotential custom op
"""
impl = SummedPotential(unbound_potentials, params).unbound_impl(precision)
def pack(params):
return np.concatenate([ps.reshape(-1) for ps in params])
U = wrap_impl(impl, pack)
return U
| 36.975 | 111 | 0.713658 | 423 | 2,958 | 4.747045 | 0.205674 | 0.044821 | 0.083665 | 0.083665 | 0.60508 | 0.596614 | 0.526892 | 0.526892 | 0.526892 | 0.501494 | 0 | 0.007031 | 0.182556 | 2,958 | 79 | 112 | 37.443038 | 0.823408 | 0.252197 | 0 | 0.236842 | 0 | 0 | 0.006527 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.263158 | false | 0 | 0.078947 | 0.078947 | 0.605263 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
67d9abf1948658a2c5e38ae12ec4d8b8adf3bd58 | 1,515 | py | Python | sdk/core/azure-core/azure/core/pipeline/policies/authentication_async.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | null | null | null | sdk/core/azure-core/azure/core/pipeline/policies/authentication_async.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | null | null | null | sdk/core/azure-core/azure/core/pipeline/policies/authentication_async.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | null | null | null | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE.txt in the project root for
# license information.
# --------------------------------------------------------------------------
from azure.core.pipeline import PipelineRequest, PipelineResponse
from azure.core.pipeline.policies import AsyncHTTPPolicy
from azure.core.pipeline.policies.authentication import _BearerTokenCredentialPolicyBase
class AsyncBearerTokenCredentialPolicy(_BearerTokenCredentialPolicyBase, AsyncHTTPPolicy):
# pylint:disable=too-few-public-methods
"""Adds a bearer token Authorization header to requests.
:param credential: The credential.
:type credential: ~azure.core.credentials.TokenCredential
:param str scopes: Lets you specify the type of access needed.
"""
async def send(self, request: PipelineRequest) -> PipelineResponse:
"""Aync flavor that adds a bearer token Authorization header to request and sends request to next policy.
:param request: The pipeline request object to be modified.
:type request: ~azure.core.pipeline.PipelineRequest
:return: The pipeline response object
:rtype: ~azure.core.pipeline.PipelineResponse
"""
token = await self._credential.get_token(*self._scopes)
self._update_headers(request.http_request.headers, token)
return await self.next.send(request) # type: ignore
| 48.870968 | 113 | 0.681848 | 156 | 1,515 | 6.570513 | 0.532051 | 0.052683 | 0.082927 | 0.061463 | 0.12878 | 0.072195 | 0.072195 | 0 | 0 | 0 | 0 | 0 | 0.154455 | 1,515 | 30 | 114 | 50.5 | 0.800156 | 0.370957 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.375 | 0 | 0.625 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
67ea232a964b415b5c48734cb2b31e366146e901 | 269 | py | Python | docs/examples/combine-configs/convert.py | Mbompr/fromconfig | eb34582c79a9a9e3b9e60d41fec2ac6a619e9c27 | [
"Apache-2.0"
] | 19 | 2021-03-18T16:48:03.000Z | 2022-03-02T13:09:21.000Z | docs/examples/combine-configs/convert.py | Mbompr/fromconfig | eb34582c79a9a9e3b9e60d41fec2ac6a619e9c27 | [
"Apache-2.0"
] | 3 | 2021-04-23T23:03:29.000Z | 2021-05-11T14:09:16.000Z | docs/examples/combine-configs/convert.py | Mbompr/fromconfig | eb34582c79a9a9e3b9e60d41fec2ac6a619e9c27 | [
"Apache-2.0"
] | 3 | 2021-04-19T22:05:34.000Z | 2022-02-21T11:32:16.000Z | """Convert file format."""
import fire
import fromconfig
def convert(path_input, path_output):
"""Convert input into output with load and dump."""
fromconfig.dump(fromconfig.load(path_input), path_output)
if __name__ == "__main__":
fire.Fire(convert)
| 17.933333 | 61 | 0.717472 | 35 | 269 | 5.171429 | 0.514286 | 0.099448 | 0.143646 | 0.209945 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.159851 | 269 | 14 | 62 | 19.214286 | 0.800885 | 0.245353 | 0 | 0 | 0 | 0 | 0.041667 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.333333 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
67f2d1af7b93140433f3b44d8d6f9fbf50549676 | 912 | py | Python | microcosm_caching/base.py | globality-corp/microcosm-caching | 9e4ddb60d95e1344bf97f69248d1f7ac36a92cc8 | [
"Apache-2.0"
] | 1 | 2019-08-29T16:47:18.000Z | 2019-08-29T16:47:18.000Z | microcosm_caching/base.py | globality-corp/microcosm-caching | 9e4ddb60d95e1344bf97f69248d1f7ac36a92cc8 | [
"Apache-2.0"
] | 2 | 2019-10-29T19:25:16.000Z | 2019-11-12T00:00:04.000Z | microcosm_caching/base.py | globality-corp/microcosm-caching | 9e4ddb60d95e1344bf97f69248d1f7ac36a92cc8 | [
"Apache-2.0"
] | null | null | null | """
Cache abstractions for use with API resources.
"""
from abc import ABC, abstractmethod
class CacheBase(ABC):
"""
A simple key-value cache interface.
"""
@abstractmethod
def get(self, key):
pass
@abstractmethod
def set(self, key, value, ttl=None):
"""
Set a key, value pair to the cache.
Optional ttl (time-to-live) value should be in seconds.
"""
pass
@abstractmethod
def set_many(self, values, ttl=None):
"""
Set key/value pairs in the cache
Optional ttl (time-to-live) value should be in seconds.
"""
pass
@abstractmethod
def add(self, key, value, ttl=None):
"""
Add a key, value pair to the cache, skipping the set if
the key has already been set
Optional ttl (time-to-live) value should be in seconds.
"""
pass
| 19.404255 | 63 | 0.574561 | 117 | 912 | 4.470085 | 0.376068 | 0.091778 | 0.120459 | 0.097514 | 0.510516 | 0.437859 | 0.437859 | 0.365201 | 0.365201 | 0.365201 | 0 | 0 | 0.332237 | 912 | 46 | 64 | 19.826087 | 0.858785 | 0.446272 | 0 | 0.571429 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0.285714 | 0.071429 | 0 | 0.428571 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
67fc89d1bcce49307c043c31ae573dd5205a3395 | 289 | py | Python | src/renault_api/exceptions.py | slater0013/renault-api | 13c784b6af09331368341c93888f1eb32c46cb19 | [
"MIT"
] | 44 | 2020-11-01T15:52:33.000Z | 2022-03-31T04:40:03.000Z | src/renault_api/exceptions.py | slater0013/renault-api | 13c784b6af09331368341c93888f1eb32c46cb19 | [
"MIT"
] | 334 | 2020-11-01T13:00:01.000Z | 2022-03-31T17:17:40.000Z | src/renault_api/exceptions.py | slater0013/renault-api | 13c784b6af09331368341c93888f1eb32c46cb19 | [
"MIT"
] | 22 | 2020-11-20T08:26:26.000Z | 2022-03-11T18:58:31.000Z | """Exceptions for Renault API."""
class RenaultException(Exception): # noqa: N818
"""Base exception for Renault API errors."""
pass
class NotAuthenticatedException(RenaultException): # noqa: N818
"""You are not authenticated, or authentication has expired."""
pass
| 20.642857 | 67 | 0.702422 | 30 | 289 | 6.766667 | 0.7 | 0.098522 | 0.128079 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.025532 | 0.186851 | 289 | 13 | 68 | 22.230769 | 0.838298 | 0.508651 | 0 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.5 | 0 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.