hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f0d4ba7982bf76baf6d8ccab2c0d603da68b5643 | 148 | py | Python | tests/testing_config/custom_components/test_standalone.py | veresspeter/home-assistant | a3c22c6eec2c77a28a8fa859e899984269708666 | [
"Apache-2.0"
] | 11 | 2017-09-25T13:11:33.000Z | 2020-05-16T21:54:28.000Z | tests/testing_config/custom_components/test_standalone.py | veresspeter/home-assistant | a3c22c6eec2c77a28a8fa859e899984269708666 | [
"Apache-2.0"
] | 125 | 2018-12-11T07:31:20.000Z | 2021-07-27T08:20:03.000Z | tests/testing_config/custom_components/test_standalone.py | veresspeter/home-assistant | a3c22c6eec2c77a28a8fa859e899984269708666 | [
"Apache-2.0"
] | 3 | 2018-05-22T18:52:01.000Z | 2019-07-18T21:30:45.000Z | """Provide a mock standalone component."""
DOMAIN = 'test_standalone'
def setup(hass, config):
"""Mock a successful setup."""
return True
| 18.5 | 42 | 0.675676 | """Provide a mock standalone component."""
DOMAIN = 'test_standalone'
def setup(hass, config):
"""Mock a successful setup."""
return True
| 0 | 0 | 0 |
317e85e513098ff254eb7db66c92992d3f1553c2 | 2,026 | py | Python | learntools/libs/tests/test_wavelet.py | yueranyuan/vector_edu | 259ff50479ebd5e12136554f1cd47bff149fa15c | [
"MIT"
] | 3 | 2015-05-01T14:16:22.000Z | 2021-04-07T23:08:43.000Z | learntools/libs/tests/test_wavelet.py | yueranyuan/vector_edu | 259ff50479ebd5e12136554f1cd47bff149fa15c | [
"MIT"
] | 1 | 2015-01-30T20:40:20.000Z | 2015-01-30T23:30:42.000Z | learntools/libs/tests/test_wavelet.py | yueranyuan/vector_edu | 259ff50479ebd5e12136554f1cd47bff149fa15c | [
"MIT"
] | 3 | 2015-01-14T19:59:40.000Z | 2015-01-28T06:37:42.000Z | from learntools.libs.wavelet import signal_to_wavelet
| 253.25 | 1,773 | 0.661895 | from learntools.libs.wavelet import signal_to_wavelet
def test_wavelet():
eeg_str = "57 38 20 29 56 54 35 21 22 13 -7 -26 -30 -8 10 4 -10 -5 16 33 49 55 43 41 39 32 28 44 32 -6 -22 0 37 67 50 21 20 27 23 20 22 22 25 25 38 59 45 8 7 22 7 -21 -27 -35 -37 -11 23 53 84 100 86 71 66 55 41 34 27 13 12 65 118 120 105 98... | 1,949 | 0 | 23 |
3b28f0fd72990fffe005e50f2256e6601c21ef56 | 13,471 | py | Python | apps/keyboard/js/imes/latin/dictionaries/xml2dict.py | lightsofapollo/gaia | c0ac6c7a784da15b30809b9108975c8c7345288d | [
"Apache-2.0"
] | null | null | null | apps/keyboard/js/imes/latin/dictionaries/xml2dict.py | lightsofapollo/gaia | c0ac6c7a784da15b30809b9108975c8c7345288d | [
"Apache-2.0"
] | null | null | null | apps/keyboard/js/imes/latin/dictionaries/xml2dict.py | lightsofapollo/gaia | c0ac6c7a784da15b30809b9108975c8c7345288d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
This script reads a XML-formatted word list and produces a dictionary
file used by the FirefoxOS virtual keyboard for word suggestions and
auto corrections.
The word lists come from the Android source: https://android.googlesource.com/platform/packages/inputmethods/LatinIME/+/master/dictio... | 32.304556 | 140 | 0.629797 | # -*- coding: utf-8 -*-
"""
This script reads a XML-formatted word list and produces a dictionary
file used by the FirefoxOS virtual keyboard for word suggestions and
auto corrections.
The word lists come from the Android source: https://android.googlesource.com/platform/packages/inputmethods/LatinIME/+/master/dictio... | 8,446 | -14 | 594 |
ad675be89f3dd71f339323b20f1a2ef697ee66ce | 1,526 | py | Python | BitTorrent-5.2.2/BitTorrent/GUI_wx/StatusLight.py | jpabb7/p2pScrapper | 0fd57049606864223eb45f956a58adda1231af88 | [
"MIT"
] | 4 | 2016-04-26T03:43:54.000Z | 2016-11-17T08:09:04.000Z | BitTorrent-5.2.2/BitTorrent/GUI_wx/StatusLight.py | jpabb7/p2pScrapper | 0fd57049606864223eb45f956a58adda1231af88 | [
"MIT"
] | 17 | 2015-01-05T21:06:22.000Z | 2015-12-07T20:45:44.000Z | BitTorrent-5.2.2/BitTorrent/GUI_wx/StatusLight.py | jpabb7/p2pScrapper | 0fd57049606864223eb45f956a58adda1231af88 | [
"MIT"
] | 7 | 2015-07-28T09:17:17.000Z | 2021-11-07T02:29:41.000Z | # The contents of this file are subject to the BitTorrent Open Source License
# Version 1.1 (the License). You may not copy or use this file, in either
# source code or executable form, except in compliance with the License. You
# may obtain a copy of the License at http://www.bittorrent.com/license/.
#
# Software di... | 30.52 | 77 | 0.665793 | # The contents of this file are subject to the BitTorrent Open Source License
# Version 1.1 (the License). You may not copy or use this file, in either
# source code or executable form, except in compliance with the License. You
# may obtain a copy of the License at http://www.bittorrent.com/license/.
#
# Software di... | 729 | 41 | 112 |
8a8a7da767ee0aff5d8f1d6a0b4f8d75563f33f2 | 5,888 | py | Python | kinto/core/testing.py | dreuse/kinto | 533037ad421b63419f9883653a428683c67d43b8 | [
"Apache-2.0"
] | null | null | null | kinto/core/testing.py | dreuse/kinto | 533037ad421b63419f9883653a428683c67d43b8 | [
"Apache-2.0"
] | null | null | null | kinto/core/testing.py | dreuse/kinto | 533037ad421b63419f9883653a428683c67d43b8 | [
"Apache-2.0"
] | null | null | null | import os
import threading
import unittest
from collections import defaultdict
from unittest import mock
import webtest
from cornice import errors as cornice_errors
from pyramid.url import parse_url_overrides
from kinto.core import DEFAULT_SETTINGS
from kinto.core import statsd
from kinto.core.storage import generato... | 32.351648 | 91 | 0.657439 | import os
import threading
import unittest
from collections import defaultdict
from unittest import mock
import webtest
from cornice import errors as cornice_errors
from pyramid.url import parse_url_overrides
from kinto.core import DEFAULT_SETTINGS
from kinto.core import statsd
from kinto.core.storage import generato... | 2,802 | -3 | 233 |
06c1cb9b0a70ddef0acfcdc28ee415680220cfb4 | 3,934 | py | Python | flamio/player.py | Jkreid/flamio | c7d98b7e39f0a8e5792a236e9508632d294525b2 | [
"MIT"
] | null | null | null | flamio/player.py | Jkreid/flamio | c7d98b7e39f0a8e5792a236e9508632d294525b2 | [
"MIT"
] | 11 | 2020-05-29T18:14:58.000Z | 2021-07-21T02:41:14.000Z | flamio/player.py | Jkreid/flamio | c7d98b7e39f0a8e5792a236e9508632d294525b2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat Jul 17 11:31:40 2021
@author: justi
"""
import utils
import play
import spotify
import time as t
from abc import ABC, abstractmethod
| 24.898734 | 75 | 0.609049 | # -*- coding: utf-8 -*-
"""
Created on Sat Jul 17 11:31:40 2021
@author: justi
"""
import utils
import play
import spotify
import time as t
from abc import ABC, abstractmethod
class Player(ABC):
def __init__(self, *args, **kwargs):
super().__init__()
def play_track(self, *args, **kwargs):
... | 2,269 | 1,441 | 46 |
52010871575d24c3de36b7385ca8ba57577b8969 | 10,688 | py | Python | typeddfs/_mixins/_ini_like_mixin.py | dmyersturnbull/typed-dfs | 57504da6cf2085e96ef62f35afcc2f733a9910e0 | [
"Apache-2.0"
] | 5 | 2020-07-14T14:03:35.000Z | 2022-01-15T03:34:15.000Z | typeddfs/_mixins/_ini_like_mixin.py | kokellab/typed-dfs | 11c80080446a28e618a379569606f1c1ba387062 | [
"Apache-2.0"
] | 83 | 2021-01-06T06:19:12.000Z | 2022-03-28T03:06:18.000Z | typeddfs/_mixins/_ini_like_mixin.py | kokellab/typed-dfs | 11c80080446a28e618a379569606f1c1ba387062 | [
"Apache-2.0"
] | null | null | null | """
Mixin for INI, .properties, and TOML.
"""
from __future__ import annotations
import os
from typing import Optional, Sequence, Set, Union
import pandas as pd
from typeddfs.df_errors import UnsupportedOperationError
from typeddfs.utils import IoUtils, ParseUtils, Utils
__all__ = ["_IniLikeMixin"]
| 32.785276 | 101 | 0.539577 | """
Mixin for INI, .properties, and TOML.
"""
from __future__ import annotations
import os
from typing import Optional, Sequence, Set, Union
import pandas as pd
from typeddfs.df_errors import UnsupportedOperationError
from typeddfs.utils import IoUtils, ParseUtils, Utils
class _IniLikeMixin:
def to_properties(... | 841 | 9,518 | 23 |
d91f2664e77c2b0a606d4e795da17ecfe4662d86 | 476 | py | Python | Tag_03.py | Gravitar64/Advent-of-Code-2016 | d998dc28af626061117c6b1cab643292e1baf047 | [
"Apache-2.0"
] | null | null | null | Tag_03.py | Gravitar64/Advent-of-Code-2016 | d998dc28af626061117c6b1cab643292e1baf047 | [
"Apache-2.0"
] | null | null | null | Tag_03.py | Gravitar64/Advent-of-Code-2016 | d998dc28af626061117c6b1cab643292e1baf047 | [
"Apache-2.0"
] | null | null | null | from time import perf_counter as pfc
puzzle = load('Tag_03.txt')
start = pfc()
print(solve(puzzle), pfc() - start)
| 23.8 | 78 | 0.632353 | from time import perf_counter as pfc
def load(file):
with open(file) as f:
return [[int(l) for l in t.split()] for t in f]
def is_valid(triangle):
a,b,c = sorted(triangle)
return a+b > c
def solve(p):
part1 = sum([is_valid(triangle) for triangle in p])
p, l = [list(t) for t in zip(*p)], len(p)
r... | 285 | 0 | 73 |
47badda5c2ffd0678ed0a7a72db46349537bcefa | 3,049 | py | Python | tests/test_pipeline.py | broadinstitute/scRNA-Seq | 03aafb92274a97f4d634ac9e42f0e0feca91ed98 | [
"BSD-3-Clause"
] | 12 | 2019-04-08T11:39:33.000Z | 2022-02-22T02:50:27.000Z | tests/test_pipeline.py | broadinstitute/scRNA-Seq | 03aafb92274a97f4d634ac9e42f0e0feca91ed98 | [
"BSD-3-Clause"
] | null | null | null | tests/test_pipeline.py | broadinstitute/scRNA-Seq | 03aafb92274a97f4d634ac9e42f0e0feca91ed98 | [
"BSD-3-Clause"
] | 3 | 2019-03-06T20:44:33.000Z | 2020-02-17T13:43:46.000Z | import os
import unittest
import scCloud.pipeline
| 49.983607 | 116 | 0.343391 | import os
import unittest
import scCloud.pipeline
class TestPipeline(unittest.TestCase):
def tearDown(self):
os.remove('test.h5')
os.remove('test.h5ad')
def test_run(self):
scCloud.tools.aggregate_10x_matrices('data/aggregate_test.csv', restrictions=None, attributes=['Version'],
... | 2,904 | 17 | 76 |
c31aae7f812d53a79501329a5513905db184e3c8 | 184 | py | Python | annoy.py | jlgrady1/annoyotron | 4f6de578660accc27d58ed45935671fb116d5638 | [
"MIT"
] | null | null | null | annoy.py | jlgrady1/annoyotron | 4f6de578660accc27d58ed45935671fb116d5638 | [
"MIT"
] | null | null | null | annoy.py | jlgrady1/annoyotron | 4f6de578660accc27d58ed45935671fb116d5638 | [
"MIT"
] | null | null | null | import time
from datetime import datetime
if __name__ == '__main__':
main()
| 12.266667 | 47 | 0.603261 | import time
from datetime import datetime
def main():
while True:
time.sleep(2)
print '{} hello'.format(datetime.now())
if __name__ == '__main__':
main()
| 76 | 0 | 23 |
fb5aa4a1b1a93ed158df39749d38809de234f8ea | 2,540 | py | Python | naivebayes/__init__.py | itdxer/naive-bayes | 6b41ca98359df5d2f503145aad0763a2ac65c317 | [
"MIT"
] | 16 | 2015-04-25T16:41:43.000Z | 2019-03-19T09:30:38.000Z | naivebayes/__init__.py | itdxer/naive-bayes | 6b41ca98359df5d2f503145aad0763a2ac65c317 | [
"MIT"
] | 2 | 2017-07-14T05:27:42.000Z | 2019-10-29T10:28:24.000Z | naivebayes/__init__.py | itdxer/naive-bayes | 6b41ca98359df5d2f503145aad0763a2ac65c317 | [
"MIT"
] | 6 | 2016-01-14T03:52:42.000Z | 2021-03-30T15:46:31.000Z | import numpy as np
from sklearn.feature_extraction.text import CountVectorizer
| 37.910448 | 78 | 0.648425 | import numpy as np
from sklearn.feature_extraction.text import CountVectorizer
class NaiveBayesTextClassifier(object):
def __init__(self, categories, **kwargs):
self.categories = categories
self.vectorizer = CountVectorizer(**kwargs)
# Will populate this variables in `train` method
... | 2,339 | 18 | 103 |
a1a9cd8bb95b4cff28581a3e8d98ef0e089e6f08 | 838 | py | Python | pyasst/command.py | NvwaOS/nvwaos-tools | 757c72da5f7bef560f48a635d05e88e45e79fd3e | [
"MIT"
] | null | null | null | pyasst/command.py | NvwaOS/nvwaos-tools | 757c72da5f7bef560f48a635d05e88e45e79fd3e | [
"MIT"
] | null | null | null | pyasst/command.py | NvwaOS/nvwaos-tools | 757c72da5f7bef560f48a635d05e88e45e79fd3e | [
"MIT"
] | null | null | null | import os
from . import env
PAUSE = {
'windows': 'PAUSE',
'macos': None,
'linux': None,
'unix': None
}
CLEAR = {
'windows': 'CLS',
'macos': 'clear',
'linux': 'clear',
'unix': 'clear'
}
| 17.829787 | 43 | 0.572792 | import os
from . import env
PAUSE = {
'windows': 'PAUSE',
'macos': None,
'linux': None,
'unix': None
}
CLEAR = {
'windows': 'CLS',
'macos': 'clear',
'linux': 'clear',
'unix': 'clear'
}
def _select_cmd_(commands: dict) -> str:
if env.isWindows():
return commands['windows']... | 549 | 0 | 92 |
4215fb0c184c70f06d0c10bc38e20eb616678168 | 647 | py | Python | fairy/tf/tf_load.py | qilutong/fairy | e4d40c5d3d6d431875a49c4f708ee278ab795901 | [
"MIT"
] | null | null | null | fairy/tf/tf_load.py | qilutong/fairy | e4d40c5d3d6d431875a49c4f708ee278ab795901 | [
"MIT"
] | null | null | null | fairy/tf/tf_load.py | qilutong/fairy | e4d40c5d3d6d431875a49c4f708ee278ab795901 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@FileName : tf_load.py
@Description : 加载tf模型
@Author : 齐鲁桐
@Email : qilutong@yahoo.com
@Time : 2019-05-15 19:08
@Modify : None
"""
from __future__ import absolute_import, division, print_function
import tensorflow as tf
def load_graph(model_file, name=None):
... | 20.21875 | 64 | 0.627512 | # -*- coding: utf-8 -*-
"""
@FileName : tf_load.py
@Description : 加载tf模型
@Author : 齐鲁桐
@Email : qilutong@yahoo.com
@Time : 2019-05-15 19:08
@Modify : None
"""
from __future__ import absolute_import, division, print_function
import tensorflow as tf
def load_graph(model_file, name=None):
... | 0 | 0 | 0 |
6c58548d18a6d8b6ed8fa05cf67679af3e4f7024 | 1,204 | py | Python | hylfm/datasets/beads.py | kreshuklab/hylfm-net | 9f1013640e40e998674b65176023367b1e978782 | [
"MIT"
] | 8 | 2020-11-13T05:46:59.000Z | 2022-01-30T06:12:04.000Z | hylfm/datasets/beads.py | kreshuklab/hylfm-net | 9f1013640e40e998674b65176023367b1e978782 | [
"MIT"
] | 1 | 2020-11-13T08:29:23.000Z | 2022-02-10T16:45:19.000Z | hylfm/datasets/beads.py | kreshuklab/hylfm-net | 9f1013640e40e998674b65176023367b1e978782 | [
"MIT"
] | 2 | 2020-10-30T11:02:42.000Z | 2021-01-12T06:51:33.000Z | from hylfm.datasets.online import OnlineTensorInfo
| 29.365854 | 58 | 0.58804 | from hylfm.datasets.online import OnlineTensorInfo
def get_tensor_info(tag: str, name: str, meta: dict):
samples_per_dataset = 1
insert_singleton_axes_at = [0, 0]
if tag == "small_0":
doi = "10.5281/zenodo.4019246"
file_name = f"{tag}_{name}.zip"
in_file_glob = "TP_*.tif"
elif ... | 1,129 | 0 | 23 |
5fa2f7f9bc06248f6a52d7d56ea84b451e48777b | 45,228 | py | Python | StockAndFlowInPython/sfd_canvas/interactive_sfd.py | Rutherford1895/SFD_Canvas | 2f8de22e70950807bb6ddd6c5e361722638e0e55 | [
"MIT"
] | 3 | 2021-05-29T09:19:09.000Z | 2022-03-27T14:30:39.000Z | StockAndFlowInPython/sfd_canvas/interactive_sfd.py | wzh1895/Stock-and-Flow-in-Python | 2f8de22e70950807bb6ddd6c5e361722638e0e55 | [
"MIT"
] | 1 | 2019-06-13T12:47:12.000Z | 2019-06-13T12:47:12.000Z | StockAndFlowInPython/sfd_canvas/interactive_sfd.py | wzh1895/Stock-and-Flow-in-Python | 2f8de22e70950807bb6ddd6c5e361722638e0e55 | [
"MIT"
] | 1 | 2022-03-27T14:48:20.000Z | 2022-03-27T14:48:20.000Z | import sys
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg
from StockAndFlowInPython.sfd_canvas.interactive_sfd_ui import Ui_widget_interactive_sfd
from StockAndFlowInPython.parsing.XMILE_parsing import text_to_equation,... | 43.074286 | 125 | 0.623375 | import sys
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg
from StockAndFlowInPython.sfd_canvas.interactive_sfd_ui import Ui_widget_interactive_sfd
from StockAndFlowInPython.parsing.XMILE_parsing import text_to_equation,... | 40,692 | 2,265 | 1,444 |
daa5ddffa682a10fd503e8a050698e96c91acd3f | 311 | py | Python | Decompose_Factors.py | arunbutte/Python_Codes | 537ed529fb87f9fc050c5236ffcbde8c2cd93b00 | [
"MIT"
] | null | null | null | Decompose_Factors.py | arunbutte/Python_Codes | 537ed529fb87f9fc050c5236ffcbde8c2cd93b00 | [
"MIT"
] | null | null | null | Decompose_Factors.py | arunbutte/Python_Codes | 537ed529fb87f9fc050c5236ffcbde8c2cd93b00 | [
"MIT"
] | null | null | null | n = 84
| 23.923077 | 41 | 0.369775 | n = 84
def decomposed(n):
prime = [2, 3, 5, 7, 11, 13, 17, 19]
dict = {s:0 for s in prime}
res = ""
for p in prime:
while (n % p == 0):
dict[p] += 1
n = n / p
print(p, n, dict)
for p in prime:
print(p,"^",dict[p]) | 281 | 0 | 23 |
62d4d854c6d74346169c942ff68bfd4e92e735d1 | 2,468 | py | Python | backend/optimal_v_dbs_value_iteration.py | DerekDick/reinforce-py | 95bef3ed2ed7aa33dd5ef177a6cdfd6867298365 | [
"Apache-2.0"
] | 1 | 2021-10-19T06:32:13.000Z | 2021-10-19T06:32:13.000Z | backend/optimal_v_dbs_value_iteration.py | DerekDick/reinforce-py | 95bef3ed2ed7aa33dd5ef177a6cdfd6867298365 | [
"Apache-2.0"
] | 15 | 2021-05-11T23:33:10.000Z | 2022-02-27T10:57:12.000Z | backend/optimal_v_dbs_value_iteration.py | DerekDick/reinforce-py | 95bef3ed2ed7aa33dd5ef177a6cdfd6867298365 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Jianfeng Hou <frankderekdick@gmail.com>
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless req... | 33.351351 | 133 | 0.76094 | # Copyright 2020 Jianfeng Hou <frankderekdick@gmail.com>
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless req... | 0 | 0 | 0 |
cfeadc6235189352f8468ef5082c19f7fd79e3ca | 5,895 | py | Python | imagenet_training/models/resnet/resnet.py | daniilgaltsev/ImageNet-Training | 9ca1d26cde07782398c7f366d5bf510c9e988236 | [
"MIT"
] | null | null | null | imagenet_training/models/resnet/resnet.py | daniilgaltsev/ImageNet-Training | 9ca1d26cde07782398c7f366d5bf510c9e988236 | [
"MIT"
] | null | null | null | imagenet_training/models/resnet/resnet.py | daniilgaltsev/ImageNet-Training | 9ca1d26cde07782398c7f366d5bf510c9e988236 | [
"MIT"
] | null | null | null | """Module with resnet like models."""
import argparse
from collections import OrderedDict
import importlib
from typing import Any, Dict, List, Optional, Type, Union
import torch
import torch.nn as nn
from .blocks import ResNetBlock, ResNetBottleneck, conv1x1
TYPE_TO_ARGS = {
"resnet18": ([2, 2, 2, 2], ResNetB... | 36.165644 | 118 | 0.617812 | """Module with resnet like models."""
import argparse
from collections import OrderedDict
import importlib
from typing import Any, Dict, List, Optional, Type, Union
import torch
import torch.nn as nn
from .blocks import ResNetBlock, ResNetBottleneck, conv1x1
TYPE_TO_ARGS = {
"resnet18": ([2, 2, 2, 2], ResNetB... | 3,811 | 0 | 104 |
8ce90a8b9109f0cd1d6c28f3238050dc9f224702 | 236 | py | Python | fcsSimpleMooc/forum/forms.py | Franklin-Siqueira/mooc-lab | 0a2cd48971a97901f2d50e4013ddda1eaece3430 | [
"MIT"
] | null | null | null | fcsSimpleMooc/forum/forms.py | Franklin-Siqueira/mooc-lab | 0a2cd48971a97901f2d50e4013ddda1eaece3430 | [
"MIT"
] | null | null | null | fcsSimpleMooc/forum/forms.py | Franklin-Siqueira/mooc-lab | 0a2cd48971a97901f2d50e4013ddda1eaece3430 | [
"MIT"
] | null | null | null | '''
forms for the forum's related instances
. ReplyForm
. Meta:
'''
from django import forms
#
from .models import Reply
| 13.882353 | 39 | 0.618644 | '''
forms for the forum's related instances
. ReplyForm
. Meta:
'''
from django import forms
#
from .models import Reply
class ReplyForm(forms.ModelForm):
class Meta:
model = Reply
fields = ['reply']
| 0 | 78 | 23 |
58dfa1669964296505d0705409094ca0297eef0d | 5,982 | py | Python | SpatialiseTEST.py | Senzt/CNNBSL | 9b5dcf4381e4ca4321d0c6bd2472dbe8ec9af810 | [
"MIT"
] | 2 | 2021-07-21T14:12:02.000Z | 2021-07-21T14:13:19.000Z | SpatialiseTEST.py | Senzt/CNNBSL | 9b5dcf4381e4ca4321d0c6bd2472dbe8ec9af810 | [
"MIT"
] | null | null | null | SpatialiseTEST.py | Senzt/CNNBSL | 9b5dcf4381e4ca4321d0c6bd2472dbe8ec9af810 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun Mar 21 18:43:20 2021
@author: Waradon Senzt Phokhinanan
"""
############################################################################################
import math
import librosa
import scipy.io
import matplotlib.pyplot as plt
from scipy import signal
import ... | 32.51087 | 148 | 0.526747 | # -*- coding: utf-8 -*-
"""
Created on Sun Mar 21 18:43:20 2021
@author: Waradon Senzt Phokhinanan
"""
############################################################################################
import math
import librosa
import scipy.io
import matplotlib.pyplot as plt
from scipy import signal
import ... | 2,985 | 0 | 79 |
8695ab1daa525e73eb68ec88d8c37272c8c11f52 | 5,072 | py | Python | tests/test_dgraph.py | superphy/prairiedog | cc7031dab8a453bdbbd7446c80b4d126ee62f1db | [
"Apache-2.0"
] | null | null | null | tests/test_dgraph.py | superphy/prairiedog | cc7031dab8a453bdbbd7446c80b4d126ee62f1db | [
"Apache-2.0"
] | 125 | 2018-06-29T15:00:31.000Z | 2021-11-15T17:48:43.000Z | tests/test_dgraph.py | superphy/prairiedog | cc7031dab8a453bdbbd7446c80b4d126ee62f1db | [
"Apache-2.0"
] | null | null | null | import subprocess
import logging
from prairiedog.node import Node
from prairiedog.edge import Edge
from prairiedog.dgraph import Dgraph
from prairiedog.graph import Graph
from prairiedog.errors import GraphException
log = logging.getLogger('prairiedog')
# TODO: this currently runs too slow for tests
# def test_dgr... | 27.122995 | 78 | 0.619282 | import subprocess
import logging
from prairiedog.node import Node
from prairiedog.edge import Edge
from prairiedog.dgraph import Dgraph
from prairiedog.graph import Graph
from prairiedog.errors import GraphException
log = logging.getLogger('prairiedog')
def test_dgraph_install():
r = subprocess.run(
['d... | 4,388 | 0 | 299 |
16d9e3095b7bc0e853b04d38ab2992688abaa009 | 13,258 | py | Python | analyze_prob_attn.py | jiacheng-xu/text-sum-uncertainty | 0c0f2ca7719a2086f84ae4797f793b9e5e23b274 | [
"MIT"
] | 25 | 2020-10-16T01:43:22.000Z | 2021-06-04T00:46:05.000Z | analyze_prob_attn.py | jiacheng-xu/text-sum-uncertainty | 0c0f2ca7719a2086f84ae4797f793b9e5e23b274 | [
"MIT"
] | 1 | 2020-10-16T02:58:29.000Z | 2020-10-16T03:51:38.000Z | analyze_prob_attn.py | jiacheng-xu/text-sum-uncertainty | 0c0f2ca7719a2086f84ae4797f793b9e5e23b274 | [
"MIT"
] | null | null | null | import statistics
import os, random, pickle
import numpy as np
# we are going to show for each timestep, for each layer, what's the majority attention.
# majority attention excluding roadmark tokens
# majority
from typing import List
import scipy
from collections import Counter
from util import convert_enc_attn, lo... | 34.258398 | 124 | 0.604314 | import statistics
import os, random, pickle
import numpy as np
# we are going to show for each timestep, for each layer, what's the majority attention.
# majority attention excluding roadmark tokens
# majority
from typing import List
import scipy
from collections import Counter
from util import convert_enc_attn, lo... | 10,804 | 0 | 276 |
e20f29720dcb2681e0f29205bf0745dbf1c1cd01 | 1,979 | py | Python | marketplace/marketplace/urls.py | kecs/marketplace | 92f882a651f97a2b3134607edd9205202dd830e6 | [
"MIT"
] | 1 | 2019-11-11T19:49:37.000Z | 2019-11-11T19:49:37.000Z | marketplace/marketplace/urls.py | kecs/marketplace | 92f882a651f97a2b3134607edd9205202dd830e6 | [
"MIT"
] | 1 | 2020-06-26T07:53:02.000Z | 2020-07-08T14:39:20.000Z | marketplace/marketplace/urls.py | kecs/marketplace | 92f882a651f97a2b3134607edd9205202dd830e6 | [
"MIT"
] | null | null | null | from django.conf.urls.static import static
from django.conf import settings
"""marketplace URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import view... | 43.977778 | 89 | 0.688732 | from django.conf.urls.static import static
from django.conf import settings
"""marketplace URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import view... | 0 | 0 | 0 |
825da5bfb8ec69653b0d4b0338aa7c81c3b8cbc5 | 1,878 | py | Python | sound_player/sound.py | Krozark/sound-player | ad592b364d0d8303c499abaa304f8a698e5fbedb | [
"BSD-2-Clause"
] | null | null | null | sound_player/sound.py | Krozark/sound-player | ad592b364d0d8303c499abaa304f8a698e5fbedb | [
"BSD-2-Clause"
] | 1 | 2021-08-24T14:14:03.000Z | 2021-08-25T08:06:32.000Z | sound_player/sound.py | Krozark/sound-player | ad592b364d0d8303c499abaa304f8a698e5fbedb | [
"BSD-2-Clause"
] | 1 | 2021-12-27T20:44:25.000Z | 2021-12-27T20:44:25.000Z | import logging
import os
from currentplatform import platform
from sound_player.common import StatusObject, STATUS
logger = logging.getLogger(__name__)
| 25.04 | 81 | 0.599574 | import logging
import os
from currentplatform import platform
from sound_player.common import StatusObject, STATUS
logger = logging.getLogger(__name__)
class BaseSound(StatusObject):
def __init__(self, filepath, loop=None):
super().__init__()
self._filepath = filepath
self._loop = loop
... | 881 | 819 | 23 |
aa98a097571f128607756fa843f7b853b13f854e | 68 | py | Python | logging_process/__init__.py | AsiaZhang123/process_log | 49aba60afbedf64b6d78ab7dbc9ddd24d3137a7a | [
"MIT"
] | 1 | 2021-07-14T08:59:28.000Z | 2021-07-14T08:59:28.000Z | logging_process/__init__.py | AsiaZhang123/process_log | 49aba60afbedf64b6d78ab7dbc9ddd24d3137a7a | [
"MIT"
] | null | null | null | logging_process/__init__.py | AsiaZhang123/process_log | 49aba60afbedf64b6d78ab7dbc9ddd24d3137a7a | [
"MIT"
] | null | null | null | from .clog import MyRotatingFileHandler, MyTimedRotatingFileHandler
| 34 | 67 | 0.897059 | from .clog import MyRotatingFileHandler, MyTimedRotatingFileHandler
| 0 | 0 | 0 |
1781bd14599982ff14e9e7fa035ebfeac0d5db50 | 2,534 | py | Python | src/unicef_attachments/fields.py | unicef/unicef-attachments | 4c3da173329c3e5f2d77970c933e9de6fcc54ed9 | [
"Apache-2.0"
] | null | null | null | src/unicef_attachments/fields.py | unicef/unicef-attachments | 4c3da173329c3e5f2d77970c933e9de6fcc54ed9 | [
"Apache-2.0"
] | 9 | 2019-03-12T10:31:17.000Z | 2021-11-23T21:38:04.000Z | src/unicef_attachments/fields.py | unicef/unicef-attachments | 4c3da173329c3e5f2d77970c933e9de6fcc54ed9 | [
"Apache-2.0"
] | 1 | 2019-02-27T13:54:08.000Z | 2019-02-27T13:54:08.000Z | import base64
import mimetypes
import uuid
from django.core.files.base import ContentFile
from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from unicef_restlib.fields import ModelChoiceField
from unicef_attachments.utils import get_client_ip
| 30.166667 | 106 | 0.668508 | import base64
import mimetypes
import uuid
from django.core.files.base import ContentFile
from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from unicef_restlib.fields import ModelChoiceField
from unicef_attachments.utils import get_client_ip
class FileTypeModelChoiceField... | 1,501 | 597 | 144 |
0027cee07361c62a69c0d0077181b5576bf40d76 | 5,488 | py | Python | experiments/actors.py | Bellboy-Capstone/System | debf2e06580bf2354cd1aac0a3ca4d2b52a3da6c | [
"MIT"
] | null | null | null | experiments/actors.py | Bellboy-Capstone/System | debf2e06580bf2354cd1aac0a3ca4d2b52a3da6c | [
"MIT"
] | 12 | 2020-10-06T03:22:02.000Z | 2020-12-04T01:46:33.000Z | experiments/actors.py | Bellboy-Capstone/System | debf2e06580bf2354cd1aac0a3ca4d2b52a3da6c | [
"MIT"
] | null | null | null | import logging
import time
from datetime import timedelta
from time import sleep
import RPi.GPIO as GPIO
from thespian.actors import Actor, ActorSystem, ActorTypeDispatcher
# Logging
logging.basicConfig(level=logging.DEBUG)
log = logging.getLogger(__name__)
# Sensor
trigPin = 16
echoPin = 18
MAX_DISTANCE = 220
time... | 33.463415 | 163 | 0.646319 | import logging
import time
from datetime import timedelta
from time import sleep
import RPi.GPIO as GPIO
from thespian.actors import Actor, ActorSystem, ActorTypeDispatcher
# Logging
logging.basicConfig(level=logging.DEBUG)
log = logging.getLogger(__name__)
# Sensor
trigPin = 16
echoPin = 18
MAX_DISTANCE = 220
time... | 119 | 0 | 27 |
016c6c3725d37f7ecd517f61fbe94cdaf534984a | 1,220 | py | Python | sdk/subscription/azure-mgmt-subscription/azure/mgmt/subscription/models/subscription_client_enums.py | Ochirkhuyag/azure-sdk-for-python | cd7236f498f86fb8aeb047a536b83aef5c7160c1 | [
"MIT"
] | null | null | null | sdk/subscription/azure-mgmt-subscription/azure/mgmt/subscription/models/subscription_client_enums.py | Ochirkhuyag/azure-sdk-for-python | cd7236f498f86fb8aeb047a536b83aef5c7160c1 | [
"MIT"
] | null | null | null | sdk/subscription/azure-mgmt-subscription/azure/mgmt/subscription/models/subscription_client_enums.py | Ochirkhuyag/azure-sdk-for-python | cd7236f498f86fb8aeb047a536b83aef5c7160c1 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 21.403509 | 76 | 0.596721 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 0 | 580 | 138 |
7f3ed65cdeb4ef21c1249ff30bb0314c140e2b1c | 1,386 | py | Python | web/main/services.py | Mikhail-Gorelov/django-blog-master | 7fd18f228f795773abb8228999d8e331dcfcf619 | [
"MIT"
] | null | null | null | web/main/services.py | Mikhail-Gorelov/django-blog-master | 7fd18f228f795773abb8228999d8e331dcfcf619 | [
"MIT"
] | 1 | 2022-03-28T08:23:26.000Z | 2022-03-28T08:23:26.000Z | web/main/services.py | Mikhail-Gorelov/django-blog-master | 7fd18f228f795773abb8228999d8e331dcfcf619 | [
"MIT"
] | 1 | 2022-01-06T15:14:21.000Z | 2022-01-06T15:14:21.000Z | from django.contrib.auth import get_user_model
from auth_app.utils import get_activate_key
from main.decorators import except_shell
from src.celery import app
from auth_app.tasks import send_information_email
from django.conf import settings
from microservice_request.services import MicroServiceConnect, ConnectionServ... | 27.72 | 80 | 0.662338 | from django.contrib.auth import get_user_model
from auth_app.utils import get_activate_key
from main.decorators import except_shell
from src.celery import app
from auth_app.tasks import send_information_email
from django.conf import settings
from microservice_request.services import MicroServiceConnect, ConnectionServ... | 721 | 223 | 69 |
b42737d22ed321c0765451444ca355d7fda9e050 | 704 | py | Python | Exams/01. Python Advanced Exam - 23 February 2020/02. Solutions/01. ExpressionEvaluator.py | indieza/Python-Developing | f7b5fa7e9ca5d9e8ad30fc7d2a1a21e2ad4b75a4 | [
"MIT"
] | null | null | null | Exams/01. Python Advanced Exam - 23 February 2020/02. Solutions/01. ExpressionEvaluator.py | indieza/Python-Developing | f7b5fa7e9ca5d9e8ad30fc7d2a1a21e2ad4b75a4 | [
"MIT"
] | null | null | null | Exams/01. Python Advanced Exam - 23 February 2020/02. Solutions/01. ExpressionEvaluator.py | indieza/Python-Developing | f7b5fa7e9ca5d9e8ad30fc7d2a1a21e2ad4b75a4 | [
"MIT"
] | null | null | null | import math
inputItems = input().split(' ')
sum = 0
numbers = []
operators = []
isFirst = True
for item in inputItems:
if item == '*' or item == '/' or item == '+' or item == '-':
for number in numbers:
if isFirst:
sum = int(number)
isFirst = False
e... | 24.275862 | 64 | 0.411932 | import math
inputItems = input().split(' ')
sum = 0
numbers = []
operators = []
isFirst = True
for item in inputItems:
if item == '*' or item == '/' or item == '+' or item == '-':
for number in numbers:
if isFirst:
sum = int(number)
isFirst = False
e... | 0 | 0 | 0 |
5f620067b7dd51b70d58550f24215b168300ba68 | 2,925 | py | Python | barbican-8.0.0/barbican/tests/objects/test_ovo_project.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 177 | 2015-01-02T09:35:53.000Z | 2022-02-26T01:43:55.000Z | barbican/tests/objects/test_ovo_project.py | kkutysllb/barbican | 7b14d983e0dce6dcffe9781b05c52335b8203fc7 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | barbican/tests/objects/test_ovo_project.py | kkutysllb/barbican | 7b14d983e0dce6dcffe9781b05c52335b8203fc7 | [
"Apache-2.0"
] | 87 | 2015-01-13T17:33:40.000Z | 2021-11-09T05:30:36.000Z | # Copyright 2018 Fujitsu.
#
# 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... | 45.703125 | 78 | 0.669402 | # Copyright 2018 Fujitsu.
#
# 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... | 2,051 | 24 | 130 |
15f0edc364933154a2544a8fde7c9ea93ea09e27 | 5,933 | py | Python | ftl/data_manager/federated_data_manager.py | microsoft/OpenMSFTL | 0d18ceaf6f9a7859c7f4124ecf41ded5ffe3b03e | [
"MIT"
] | 8 | 2020-09-07T08:20:39.000Z | 2022-03-04T21:20:06.000Z | ftl/data_manager/federated_data_manager.py | microsoft/OpenMSFTL | 0d18ceaf6f9a7859c7f4124ecf41ded5ffe3b03e | [
"MIT"
] | 1 | 2020-11-06T20:14:37.000Z | 2020-11-06T20:14:37.000Z | ftl/data_manager/federated_data_manager.py | microsoft/OpenMSFTL | 0d18ceaf6f9a7859c7f4124ecf41ded5ffe3b03e | [
"MIT"
] | 3 | 2020-10-21T01:15:13.000Z | 2021-11-10T11:23:47.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License
from ftl.agents import Client, Server
from ftl.training_utils import cycle
from torchvision import datasets
from torch.utils.data import DataLoader, Subset
import torch
import numpy as np
from typing import Dict, List
class DataManager:
"""
... | 45.992248 | 114 | 0.612169 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License
from ftl.agents import Client, Server
from ftl.training_utils import cycle
from torchvision import datasets
from torch.utils.data import DataLoader, Subset
import torch
import numpy as np
from typing import Dict, List
class DataManager:
"""
... | 590 | 0 | 27 |
a71252621d3fc9836134cc749733262b3a6efbd5 | 5,686 | py | Python | botlist.py | Botomatik/JackBot | 58651d8b5a5bcead2a2eb79849019cb4f972b7cd | [
"MIT"
] | null | null | null | botlist.py | Botomatik/JackBot | 58651d8b5a5bcead2a2eb79849019cb4f972b7cd | [
"MIT"
] | null | null | null | botlist.py | Botomatik/JackBot | 58651d8b5a5bcead2a2eb79849019cb4f972b7cd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Allows access to the site's bot user list.
The function refresh() downloads the current bot user list and saves
it to disk. It is run automatically when a bot first tries to get this
data.
"""
# (C) Daniel Herding, 2005
# (C) Dr. Trigon, 2009-2010
# (C) Pywikipedia bot team, 2010-2012
#
# ... | 31.765363 | 101 | 0.563313 | # -*- coding: utf-8 -*-
"""
Allows access to the site's bot user list.
The function refresh() downloads the current bot user list and saves
it to disk. It is run automatically when a bot first tries to get this
data.
"""
# (C) Daniel Herding, 2005
# (C) Dr. Trigon, 2009-2010
# (C) Pywikipedia bot team, 2010-2012
#
# ... | 3,242 | 0 | 69 |
be27dc717f95dfa134a4a0eb6d9557499ae498f7 | 6,841 | py | Python | tx2-setup/slam_front_end/tools/evaluate_communication.py | SnowCarter/DOOR-SLAM | cf56d2b4b7a21ed7c6445f01600408c9dd5235c6 | [
"MIT"
] | null | null | null | tx2-setup/slam_front_end/tools/evaluate_communication.py | SnowCarter/DOOR-SLAM | cf56d2b4b7a21ed7c6445f01600408c9dd5235c6 | [
"MIT"
] | null | null | null | tx2-setup/slam_front_end/tools/evaluate_communication.py | SnowCarter/DOOR-SLAM | cf56d2b4b7a21ed7c6445f01600408c9dd5235c6 | [
"MIT"
] | null | null | null | import numpy as np
path = '/Users/benjaminramtoula/Documents/Cours/POLYMTL/MISTLAB/SLAM/decentralized_slam_project/logs/'
dir = '2019-08-22_11-43-20_0.13_20/'
timestamps_combined = []
nb_kf_used = []
data_exchanged_f_m_q = []
data_exchanged_f_m_a = []
data_exchanged_r_s_q = []
with open(path+dir+'find_matches_query.... | 41.713415 | 144 | 0.701944 | import numpy as np
path = '/Users/benjaminramtoula/Documents/Cours/POLYMTL/MISTLAB/SLAM/decentralized_slam_project/logs/'
dir = '2019-08-22_11-43-20_0.13_20/'
timestamps_combined = []
nb_kf_used = []
data_exchanged_f_m_q = []
data_exchanged_f_m_a = []
data_exchanged_r_s_q = []
with open(path+dir+'find_matches_query.... | 0 | 0 | 0 |
e031010d543bf826ac8114631a830f1bd61cd022 | 848 | py | Python | django_rq_email_backend/tasks.py | jefftriplett/django-rq-email-backend | 674e48ab086d31ea5837fc12dd267c3b20d0fab1 | [
"BSD-3-Clause"
] | 10 | 2015-01-25T22:11:51.000Z | 2021-01-06T07:07:59.000Z | django_rq_email_backend/tasks.py | jefftriplett/django-rq-email-backend | 674e48ab086d31ea5837fc12dd267c3b20d0fab1 | [
"BSD-3-Clause"
] | null | null | null | django_rq_email_backend/tasks.py | jefftriplett/django-rq-email-backend | 674e48ab086d31ea5837fc12dd267c3b20d0fab1 | [
"BSD-3-Clause"
] | 4 | 2015-05-11T16:34:37.000Z | 2018-09-26T17:38:39.000Z | import logging
from django.conf import settings
from django.core.mail import get_connection
from django_rq import job
RQ_EMAIL_DEFAULT_QUEUE = getattr(settings, 'RQ_EMAIL_DEFAULT_QUEUE', 'default')
RQ_EMAIL_BACKEND = getattr(settings, 'RQ_EMAIL_BACKEND',
'django.core.mail.backends.smtp.Ema... | 32.615385 | 83 | 0.695755 | import logging
from django.conf import settings
from django.core.mail import get_connection
from django_rq import job
RQ_EMAIL_DEFAULT_QUEUE = getattr(settings, 'RQ_EMAIL_DEFAULT_QUEUE', 'default')
RQ_EMAIL_BACKEND = getattr(settings, 'RQ_EMAIL_BACKEND',
'django.core.mail.backends.smtp.Ema... | 426 | 0 | 22 |
504d8ea93126b46a4d985fc9f9dfd82d55ae4788 | 1,319 | py | Python | Model/Glassdoor.py | RLeDEV/AutoJob | 8fa45f464b3cd5c92dffef0c57d6c64ab46012d2 | [
"MIT"
] | 2 | 2020-08-11T01:04:00.000Z | 2020-08-24T13:58:39.000Z | Model/Glassdoor.py | RLeDEV/AutoJob | 8fa45f464b3cd5c92dffef0c57d6c64ab46012d2 | [
"MIT"
] | null | null | null | Model/Glassdoor.py | RLeDEV/AutoJob | 8fa45f464b3cd5c92dffef0c57d6c64ab46012d2 | [
"MIT"
] | null | null | null | from Model.job import Job
from Model.website import Website
from Driver.WebDriver import WebDriver | 34.710526 | 75 | 0.579985 | from Model.job import Job
from Model.website import Website
from Driver.WebDriver import WebDriver
class Glassdoor(Website):
def __init__(self, url):
self._url = url
self._classname = "(//div[@class='jobContainer'])"
self._jobs = []
def get_all_jobs(self):
return self._jobs
... | 1,114 | 4 | 103 |
e05ed200a2a8a3f55fc59bea4c0cb97b0a233945 | 15,065 | py | Python | notepad.py | SukruGokk/python-notepad | 8f9f1c7bfdfa27a05190534f8256d1690d55f900 | [
"Apache-2.0"
] | 1 | 2020-07-01T11:05:20.000Z | 2020-07-01T11:05:20.000Z | notepad.py | SukruGokk/python-notepad | 8f9f1c7bfdfa27a05190534f8256d1690d55f900 | [
"Apache-2.0"
] | null | null | null | notepad.py | SukruGokk/python-notepad | 8f9f1c7bfdfa27a05190534f8256d1690d55f900 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
######################
# TÜRKÇE NOT DEFTERİ #
######################
# @author : Şükrü Erdem Gök
# @date : 28/06/2020
# @os : Windows 10
# @version : Python 3.8
# @description: Kodlar dışında yorumları ve uygulamanı görünen kısmını tamamen türkçe yaptım. Umarım işinize yarar.
# GÖK DEFTER
# K... | 39.028497 | 124 | 0.667707 | # -*- coding: utf-8 -*-
######################
# TÜRKÇE NOT DEFTERİ #
######################
# @author : Şükrü Erdem Gök
# @date : 28/06/2020
# @os : Windows 10
# @version : Python 3.8
# @description: Kodlar dışında yorumları ve uygulamanı görünen kısmını tamamen türkçe yaptım. Umarım işinize yarar.
# GÖK DEFTER
# K... | 12,986 | 9 | 412 |
96d4c0a3bbeb30f1666a465e23b74a59a5b9a9bb | 2,804 | py | Python | src/features/previous_application_loans.py | elfaizamine/loan_default_prediction | c76632b0757e9f23d347e00bcd755d26800a54be | [
"MIT"
] | null | null | null | src/features/previous_application_loans.py | elfaizamine/loan_default_prediction | c76632b0757e9f23d347e00bcd755d26800a54be | [
"MIT"
] | null | null | null | src/features/previous_application_loans.py | elfaizamine/loan_default_prediction | c76632b0757e9f23d347e00bcd755d26800a54be | [
"MIT"
] | null | null | null | from src.utils.utils import *
import src.config.Consts as cs
def sum_one_hot_columns_on_rows(df, col_to_aggregate):
"""
aggregate past loans information (category columns) in one row
:param df: previous loans application dataframe
:param col_to_aggregate: columns to be aggregated
:return datafr... | 31.505618 | 98 | 0.702568 | from src.utils.utils import *
import src.config.Consts as cs
def sum_one_hot_columns_on_rows(df, col_to_aggregate):
"""
aggregate past loans information (category columns) in one row
:param df: previous loans application dataframe
:param col_to_aggregate: columns to be aggregated
:return datafr... | 0 | 0 | 0 |
b8d2083b80a7501af9306c08a47d71c5031164e8 | 271 | py | Python | 哥伦布(STM32F407)/1.基础实验/12.EEPROM/main.py | 01studio-lab/MicroPython_Examples | f06a1bee398674ceafebed2aac88d8413cc8abad | [
"MIT"
] | 73 | 2020-05-02T13:48:27.000Z | 2022-03-26T13:15:10.000Z | 哥伦布(STM32F407)/1.基础实验/12.EEPROM/main.py | 01studio-lab/MicroPython_Examples | f06a1bee398674ceafebed2aac88d8413cc8abad | [
"MIT"
] | null | null | null | 哥伦布(STM32F407)/1.基础实验/12.EEPROM/main.py | 01studio-lab/MicroPython_Examples | f06a1bee398674ceafebed2aac88d8413cc8abad | [
"MIT"
] | 50 | 2020-05-15T13:57:28.000Z | 2022-03-30T14:03:33.000Z | '''
实验名称:EEPROM(AT24C02)
版本:v1.0
日期:2020.12
作者:01Studio
说明:EEPROM的读写实验
'''
from at24c02 import AT24C02
import time
EE = AT24C02(i2c_num=1) #哥伦布的B8,B9为I2C1
EE.write(1,8) #往地址1写入数字8(用户可以更改自己写的数字)
time.sleep_ms(5) #需要适当延时再读取
print(EE.read(1)) #读取地址1数据,等于前面写入的数字
| 15.055556 | 43 | 0.726937 | '''
实验名称:EEPROM(AT24C02)
版本:v1.0
日期:2020.12
作者:01Studio
说明:EEPROM的读写实验
'''
from at24c02 import AT24C02
import time
EE = AT24C02(i2c_num=1) #哥伦布的B8,B9为I2C1
EE.write(1,8) #往地址1写入数字8(用户可以更改自己写的数字)
time.sleep_ms(5) #需要适当延时再读取
print(EE.read(1)) #读取地址1数据,等于前面写入的数字
| 0 | 0 | 0 |
6aabaa357f6fc3fce94d6b8382f28bdea5017684 | 21,729 | py | Python | neutron/agent/l3/dvr_fip_ns.py | congnt95/neutron | 6a73a362c5ff5b7c28c15a49f47a9900c0d2b4e1 | [
"Apache-2.0"
] | 1,080 | 2015-01-04T08:35:00.000Z | 2022-03-27T09:15:52.000Z | neutron/agent/l3/dvr_fip_ns.py | congnt95/neutron | 6a73a362c5ff5b7c28c15a49f47a9900c0d2b4e1 | [
"Apache-2.0"
] | 24 | 2015-02-21T01:48:28.000Z | 2021-11-26T02:38:56.000Z | neutron/agent/l3/dvr_fip_ns.py | congnt95/neutron | 6a73a362c5ff5b7c28c15a49f47a9900c0d2b4e1 | [
"Apache-2.0"
] | 1,241 | 2015-01-02T10:47:10.000Z | 2022-03-27T09:42:23.000Z | # Copyright (c) 2015 OpenStack Foundation
#
# 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 ... | 45.745263 | 79 | 0.6096 | # Copyright (c) 2015 OpenStack Foundation
#
# 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 ... | 10,638 | 9,379 | 23 |
dfb662e7ea084a66d1d7b1485d7da04ee1ec3015 | 5,348 | py | Python | netease_im/components/team.py | jsli/NIM_SDK_Python | e2ed059a2ab6acbba09c6692deb1e4767f505982 | [
"MIT"
] | 7 | 2018-05-21T03:36:43.000Z | 2020-03-25T08:10:46.000Z | netease_im/components/team.py | jsli/NIM_SDK_Python | e2ed059a2ab6acbba09c6692deb1e4767f505982 | [
"MIT"
] | 1 | 2019-01-29T09:20:39.000Z | 2019-03-30T09:55:45.000Z | netease_im/components/team.py | jsli/NIM_SDK_Python | e2ed059a2ab6acbba09c6692deb1e4767f505982 | [
"MIT"
] | 2 | 2018-10-09T02:56:50.000Z | 2019-03-29T08:27:31.000Z | # -*- coding: utf-8 -*-
"""NIM REST API Python Client -- Team component"""
from __future__ import absolute_import
import json
from netease_im import util
from netease_im.components import base
from netease_im.util import is_str_type
__author__ = "Manson Li"
__email__ = "manson.li3307@gmail.com"
class TeamCompone... | 32.216867 | 100 | 0.580965 | # -*- coding: utf-8 -*-
"""NIM REST API Python Client -- Team component"""
from __future__ import absolute_import
import json
from netease_im import util
from netease_im.components import base
from netease_im.util import is_str_type
__author__ = "Manson Li"
__email__ = "manson.li3307@gmail.com"
class TeamCompone... | 0 | 0 | 0 |
40eba78dfc56b73bed13f9906afd74cd6848a6a9 | 812 | py | Python | notes/api.py | justinborek/djorg | f6aa9cb23f0476c032ac5250045879962cc11072 | [
"MIT"
] | null | null | null | notes/api.py | justinborek/djorg | f6aa9cb23f0476c032ac5250045879962cc11072 | [
"MIT"
] | null | null | null | notes/api.py | justinborek/djorg | f6aa9cb23f0476c032ac5250045879962cc11072 | [
"MIT"
] | null | null | null | from rest_framework import serializers, viewsets
from .models import Note
class NoteSerializer(serializers.HyperlinkedModelSerializer):
"""Serializer to define the API representation for Notes"""
class NoteViewSet(viewsets.ModelViewSet):
"""ViewSet to define the view behavior for Notes."""
serializer_clas... | 31.230769 | 63 | 0.672414 | from rest_framework import serializers, viewsets
from .models import Note
class NoteSerializer(serializers.HyperlinkedModelSerializer):
"""Serializer to define the API representation for Notes"""
class Meta:
model = Note
fields = ('title', 'content',)
def create(self, validated_data):
... | 308 | 50 | 81 |
e77beaa1068793c423116a1de233ca10e79623d0 | 147 | py | Python | myproject/config.py | codeballet/server-bionic | af559cac6a8e11d026f44cc4ae992aaa793d4016 | [
"Unlicense"
] | null | null | null | myproject/config.py | codeballet/server-bionic | af559cac6a8e11d026f44cc4ae992aaa793d4016 | [
"Unlicense"
] | null | null | null | myproject/config.py | codeballet/server-bionic | af559cac6a8e11d026f44cc4ae992aaa793d4016 | [
"Unlicense"
] | null | null | null | import os
| 21 | 45 | 0.687075 | import os
class Config(object):
SECRET_KEY = os.environ.get('SECRET_KEY')
FLASK_ENV = 'development'
DB_URI = os.environ.get('DB_URI')
| 0 | 114 | 23 |
9b057a4f374c0826ddd97db09a2b3a5c666d068c | 4,527 | py | Python | View/Task/LinkedBrowsing.py | parente/clique | e0a36e592d194a822f0078781d08a2d1aa63c9e4 | [
"BSD-3-Clause"
] | 3 | 2015-05-02T10:00:50.000Z | 2018-10-26T02:42:13.000Z | View/Task/LinkedBrowsing.py | parente/clique | e0a36e592d194a822f0078781d08a2d1aa63c9e4 | [
"BSD-3-Clause"
] | null | null | null | View/Task/LinkedBrowsing.py | parente/clique | e0a36e592d194a822f0078781d08a2d1aa63c9e4 | [
"BSD-3-Clause"
] | 1 | 2018-10-26T02:42:14.000Z | 2018-10-26T02:42:14.000Z | '''
Defines classes for the pattern of browsing a number of dyanmic views.
@author: Peter Parente <parente@cs.unc.edu>
@copyright: Copyright (c) 2008 Peter Parente
@license: BSD License
All rights reserved. This program and the accompanying materials are made
available under the terms of The BSD License which accompa... | 33.043796 | 81 | 0.682792 | '''
Defines classes for the pattern of browsing a number of dyanmic views.
@author: Peter Parente <parente@cs.unc.edu>
@copyright: Copyright (c) 2008 Peter Parente
@license: BSD License
All rights reserved. This program and the accompanying materials are made
available under the terms of The BSD License which accompa... | 133 | 0 | 24 |
027d759da4f9f2e1382edd4f6f9322c8b52f538a | 892 | py | Python | app/data_models/fulfilment_request.py | petechd/eq-questionnaire-runner | 1c5b182a7f8bc878cfdd767ae080410fa679abd6 | [
"MIT"
] | null | null | null | app/data_models/fulfilment_request.py | petechd/eq-questionnaire-runner | 1c5b182a7f8bc878cfdd767ae080410fa679abd6 | [
"MIT"
] | null | null | null | app/data_models/fulfilment_request.py | petechd/eq-questionnaire-runner | 1c5b182a7f8bc878cfdd767ae080410fa679abd6 | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
from datetime import datetime
from functools import cached_property
from typing import Mapping
from uuid import uuid4
from dateutil.tz import tzutc
from app.utilities.json import json_dumps
| 26.235294 | 65 | 0.605381 | from abc import ABC, abstractmethod
from datetime import datetime
from functools import cached_property
from typing import Mapping
from uuid import uuid4
from dateutil.tz import tzutc
from app.utilities.json import json_dumps
class FulfilmentRequest(ABC):
@abstractmethod
def _payload(self) -> Mapping:
... | 497 | 143 | 23 |
01903e287d0bd96d907635d63c34e6715718b51f | 785 | py | Python | kata/07/dominator.py | vyahello/upgrade-python-kata | 15de7b094f3aaef69a845887f0df5e0958c29ed4 | [
"MIT"
] | null | null | null | kata/07/dominator.py | vyahello/upgrade-python-kata | 15de7b094f3aaef69a845887f0df5e0958c29ed4 | [
"MIT"
] | 4 | 2021-01-25T16:58:39.000Z | 2022-03-12T13:46:37.000Z | kata/07/dominator.py | vyahello/upgrade-python-kata | 15de7b094f3aaef69a845887f0df5e0958c29ed4 | [
"MIT"
] | null | null | null | """
A zero-indexed array arr consisting of n integers is given.
The dominator of array arr is the value that occurs in more than half of the elements of arr.
For example, consider array arr such that arr = [3,4,3,2,3,1,3,3]
The dominator of arr is 3 because it occurs in 5 out of 8 elements of arr and 5 is more than a ... | 28.035714 | 105 | 0.633121 | """
A zero-indexed array arr consisting of n integers is given.
The dominator of array arr is the value that occurs in more than half of the elements of arr.
For example, consider array arr such that arr = [3,4,3,2,3,1,3,3]
The dominator of arr is 3 because it occurs in 5 out of 8 elements of arr and 5 is more than a ... | 0 | 0 | 0 |
9013a1f5cdb9f8a25a8ccf7bf602c46499dc58e5 | 1,490 | py | Python | API/Controllers/Service.py | UlascanKilic/sentiment-alanalysis | 46909a610d0e3f82c36b57d3eb43cf871be955cf | [
"MIT"
] | 1 | 2022-01-06T06:45:37.000Z | 2022-01-06T06:45:37.000Z | API/Controllers/Service.py | UlascanKilic/sentiment-alanalysis | 46909a610d0e3f82c36b57d3eb43cf871be955cf | [
"MIT"
] | null | null | null | API/Controllers/Service.py | UlascanKilic/sentiment-alanalysis | 46909a610d0e3f82c36b57d3eb43cf871be955cf | [
"MIT"
] | null | null | null | import collections
import numpy
from xgboost.callback import print_evaluation
import Crawler
import SentAnalysis
import DatabaseService
from flask import Flask, request, Response
| 24.42623 | 62 | 0.428188 | import collections
import numpy
from xgboost.callback import print_evaluation
import Crawler
import SentAnalysis
import DatabaseService
from flask import Flask, request, Response
def SentimentalAnalysis(url):
text = Crawler.Crawl(url)
if len(text) == 0:
return Response(status=404)
log_ac... | 1,284 | 0 | 23 |
04ddf723c77e5e13afa75ce73ec94a59fc369de8 | 2,315 | py | Python | rawa/models.py | hackerspace-silesia/rawa | ba0a32c342185407292cc084c2bd1f4c1d5f220a | [
"MIT"
] | 4 | 2019-12-07T18:34:52.000Z | 2020-01-11T15:32:52.000Z | rawa/models.py | hackerspace-silesia/rawa | ba0a32c342185407292cc084c2bd1f4c1d5f220a | [
"MIT"
] | 4 | 2021-06-08T20:41:45.000Z | 2022-03-12T00:07:55.000Z | rawa/models.py | hackerspace-silesia/rawa | ba0a32c342185407292cc084c2bd1f4c1d5f220a | [
"MIT"
] | 1 | 2019-12-07T20:24:38.000Z | 2019-12-07T20:24:38.000Z | from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import relationship
from sqlalchemy.sql.schema import MetaData
db = SQLAlchemy(
metadata=MetaData(
naming_convention={
"ix": 'ix_%(column_0_label)s',
"uq": "uq_%(table_na... | 30.866667 | 83 | 0.685961 | from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import relationship
from sqlalchemy.sql.schema import MetaData
db = SQLAlchemy(
metadata=MetaData(
naming_convention={
"ix": 'ix_%(column_0_label)s',
"uq": "uq_%(table_na... | 38 | 1,570 | 161 |
d445f0e736d5c29229101c8be1d7ecab26e3c67e | 764 | py | Python | lib/logger.py | yorozultd/nobrand | ee308f87f7f5929df803ffef11b3b79eec6e763b | [
"MIT"
] | null | null | null | lib/logger.py | yorozultd/nobrand | ee308f87f7f5929df803ffef11b3b79eec6e763b | [
"MIT"
] | null | null | null | lib/logger.py | yorozultd/nobrand | ee308f87f7f5929df803ffef11b3b79eec6e763b | [
"MIT"
] | null | null | null | import requests,sys,time
import time,datetime
| 28.296296 | 73 | 0.692408 | import requests,sys,time
import time,datetime
class Logger:
def __init__(self,application_name):
ts = time.time()
prefix = "./log/"
tms = datetime.datetime.fromtimestamp(ts).strftime('%Y_%m_%d_%H_%M_%S')
self.file_name = prefix+str(application_name)+"_log_"+str(tms)
self.pointer = open(self.file_name,"w+"... | 609 | -8 | 115 |
8f148f893dea9817a14e75b1cb53be28f0b376a0 | 18,564 | py | Python | plugin.picture.sane-scanner/addon.py | Heckie75/kodi-addon-sane-scanner | a67b16146325cf9bce8d5c07ab6354959a8124bf | [
"MIT"
] | null | null | null | plugin.picture.sane-scanner/addon.py | Heckie75/kodi-addon-sane-scanner | a67b16146325cf9bce8d5c07ab6354959a8124bf | [
"MIT"
] | null | null | null | plugin.picture.sane-scanner/addon.py | Heckie75/kodi-addon-sane-scanner | a67b16146325cf9bce8d5c07ab6354959a8124bf | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import datetime
import os
import re
import shutil
import subprocess
import sys
import time
import urllib.parse
import xbmc
import xbmcgui
import xbmcplugin
import xbmcaddon
import xbmcvfs
__PLUGIN_ID__ = "plugin.picture.sane-scanner"
_PLUGIN_NAME = "Kodi Sane Scanner"
_TMP... | 24.68617 | 103 | 0.49693 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import datetime
import os
import re
import shutil
import subprocess
import sys
import time
import urllib.parse
import xbmc
import xbmcgui
import xbmcplugin
import xbmcaddon
import xbmcvfs
__PLUGIN_ID__ = "plugin.picture.sane-scanner"
_PLUGIN_NAME = "Kodi Sane Scanner"
_TMP... | 16,168 | 19 | 736 |
d207c9e59b96883918e294858849c73358860f28 | 852 | py | Python | Bloglog/app/requests.py | NzauM/Github-API | 69649068de1e397ac9f2566b212b5a723b99e944 | [
"MIT"
] | null | null | null | Bloglog/app/requests.py | NzauM/Github-API | 69649068de1e397ac9f2566b212b5a723b99e944 | [
"MIT"
] | 8 | 2021-03-09T22:14:42.000Z | 2022-03-02T06:10:03.000Z | Bloglog/app/requests.py | NzauM/blog-log | 69649068de1e397ac9f2566b212b5a723b99e944 | [
"MIT"
] | null | null | null | import urllib.request,json
from .models import Quote
get_quotes_url = 'http://quotes.stormconsultancy.co.uk/random.json'
| 16.705882 | 67 | 0.657277 | import urllib.request,json
from .models import Quote
get_quotes_url = 'http://quotes.stormconsultancy.co.uk/random.json'
def getquotes():
with urllib.request.urlopen(get_quotes_url) as url:
get_quotes_data = url.read()
get_quotes_resp = json.loads(get_quotes_data)
quote_results = None
... | 643 | 0 | 46 |
ffad50c0e72851c09ab2c741602dafb6d2e712e6 | 911 | py | Python | test_scripts/ns_instance/duan/service/vfc/nfvo/lcm/lcm/ns/const.py | lremember/VFC | 837559db1396091811382359100bfc60e1aab5b2 | [
"MIT"
] | 4 | 2018-08-29T02:51:38.000Z | 2021-11-16T11:36:11.000Z | test_scripts/ns_instance/duan/service/vfc/nfvo/lcm/lcm/ns/const.py | lremember/VFC-Files | 837559db1396091811382359100bfc60e1aab5b2 | [
"MIT"
] | null | null | null | test_scripts/ns_instance/duan/service/vfc/nfvo/lcm/lcm/ns/const.py | lremember/VFC-Files | 837559db1396091811382359100bfc60e1aab5b2 | [
"MIT"
] | 1 | 2019-05-12T08:21:19.000Z | 2019-05-12T08:21:19.000Z | # Copyright 2016-2017 ZTE 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 t... | 41.409091 | 74 | 0.771679 | # Copyright 2016-2017 ZTE 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 t... | 0 | 0 | 0 |
2e4461e9fc8fdaf4c31f784c3d8e483b389c1f9f | 8,317 | py | Python | tcutils/traffic_utils/ping_traffic.py | vkolli/contrail-test-perf | db04b8924a2c330baabe3059788b149d957a7d67 | [
"Apache-2.0"
] | 1 | 2017-06-13T04:42:34.000Z | 2017-06-13T04:42:34.000Z | tcutils/traffic_utils/ping_traffic.py | vkolli/contrail-test-perf | db04b8924a2c330baabe3059788b149d957a7d67 | [
"Apache-2.0"
] | null | null | null | tcutils/traffic_utils/ping_traffic.py | vkolli/contrail-test-perf | db04b8924a2c330baabe3059788b149d957a7d67 | [
"Apache-2.0"
] | null | null | null | import re
import string
import logging
from tcutils.util import get_random_name, retry, is_v6
result_file = '/tmp/ping'
class Ping:
''' Helper to generate ping traffic
Mandatory args:
host : Dest IP
sender_vm_fixture : Sender VMs fixture handle
Supports ping with IPv4 and IPv6
... | 38.50463 | 99 | 0.564266 | import re
import string
import logging
from tcutils.util import get_random_name, retry, is_v6
result_file = '/tmp/ping'
class Ping:
''' Helper to generate ping traffic
Mandatory args:
host : Dest IP
sender_vm_fixture : Sender VMs fixture handle
Supports ping with IPv4 and IPv6
... | 1,688 | 0 | 106 |
cabc8a4726226c8b82b7751986327c467fc71dc6 | 5,714 | py | Python | python/origen/origen/web/origen_sphinx_extension/templating.py | Origen-SDK/o2 | 5b0f9a6d113ddebc73c7ee224931e8b2d0301794 | [
"MIT"
] | null | null | null | python/origen/origen/web/origen_sphinx_extension/templating.py | Origen-SDK/o2 | 5b0f9a6d113ddebc73c7ee224931e8b2d0301794 | [
"MIT"
] | 127 | 2019-11-23T17:09:35.000Z | 2021-09-02T11:06:20.000Z | python/origen/origen/web/origen_sphinx_extension/templating.py | Origen-SDK/o2 | 5b0f9a6d113ddebc73c7ee224931e8b2d0301794 | [
"MIT"
] | null | null | null | import origen, subprocess, builtins, types, inspect, re, pathlib
from .. import origen_sphinx_extension as ose
def insert_header(app, docname, source):
'''
Insert content at the beginning of the docs.
Currently inserts:
* Any |shorthand| ``include`` RST files
'''
ext = ose.sphinx_ext(ap... | 39.136986 | 137 | 0.60133 | import origen, subprocess, builtins, types, inspect, re, pathlib
from .. import origen_sphinx_extension as ose
def preprocess_src(app, docname, source):
# Origen's compiler supports multiple templating engines as well as a different context
# than Sphinx's Jinja engine.
# The Jinja compiler will be run on... | 3,563 | 0 | 114 |
ca1e1401ba5b03affbad982f7de4e708a5e292ac | 2,326 | py | Python | python/code_challenges/graph-depth-first/tests/test_graph_depth_first.py | AbdullahElian1/data-structures-and-algorithms | 857faea9bcb56ef75b544ed485ad892e4ed74cf7 | [
"MIT"
] | null | null | null | python/code_challenges/graph-depth-first/tests/test_graph_depth_first.py | AbdullahElian1/data-structures-and-algorithms | 857faea9bcb56ef75b544ed485ad892e4ed74cf7 | [
"MIT"
] | 2 | 2021-08-15T13:51:41.000Z | 2021-09-07T19:18:13.000Z | python/code_challenges/graph-depth-first/tests/test_graph_depth_first.py | AbdullahElian1/data-structures-and-algorithms | 857faea9bcb56ef75b544ed485ad892e4ed74cf7 | [
"MIT"
] | 1 | 2021-09-05T18:33:59.000Z | 2021-09-05T18:33:59.000Z | from graph_depth_first import __version__
import pytest
from graph_depth_first.graph_depth import *
@pytest.fixture
# Node can be successfully added to the graph
# An edge can be successfully added to the graph
# A collection of all nodes can be properly retrieved from the graph
# All appropriate neighbo... | 21.943396 | 76 | 0.703353 | from graph_depth_first import __version__
import pytest
def test_version():
assert __version__ == '0.1.0'
from graph_depth_first.graph_depth import *
@pytest.fixture
def date():
ver=Vertex('a')
ver2=Vertex('c')
ver3=Vertex('d')
ver4=Vertex('p')
graph=Graph()
graph.add_vertex(ver)
... | 1,449 | 0 | 266 |
86f8f698335c00c5ec191f79d553e09b22414e2b | 13,038 | py | Python | PythonScripts/Lib/libDuplicateAlongACurve.py | Neill3d/MoPlugs | 84efea03e045f820f3dc132c1a60a779fc5e34fc | [
"BSD-3-Clause"
] | 23 | 2017-10-20T07:01:18.000Z | 2022-02-25T08:46:07.000Z | PythonScripts/Lib/libDuplicateAlongACurve.py | droidoid/MoPlugs | fce52e6469408e32e94af8ac8a303840bc956e53 | [
"BSD-3-Clause"
] | 1 | 2019-11-08T04:03:38.000Z | 2019-11-10T10:16:00.000Z | PythonScripts/Lib/libDuplicateAlongACurve.py | droidoid/MoPlugs | fce52e6469408e32e94af8ac8a303840bc956e53 | [
"BSD-3-Clause"
] | 5 | 2017-12-03T20:43:27.000Z | 2020-01-22T16:54:13.000Z |
##############################################################
#
# script uses local X axis to compute element Length and snapshot it along a curve
# 21.02.2016
# Sergey Solohin (Neill3d) 2016
# e-mail to: s@neill3d.com
# www.neill3d.com
#
# Github repo - https://github.com/Neill3d/MoPlugs
# Licensed under BSD... | 32.272277 | 139 | 0.546173 |
##############################################################
#
# script uses local X axis to compute element Length and snapshot it along a curve
# 21.02.2016
# Sergey Solohin (Neill3d) 2016
# e-mail to: s@neill3d.com
# www.neill3d.com
#
# Github repo - https://github.com/Neill3d/MoPlugs
# Licensed under BSD... | 10,833 | 1,560 | 46 |
3d71c6221d5712af50d5ded07ee8fe8505612bac | 4,209 | py | Python | PAN03.py | zfng/Synth2021 | 80f854a38c8d9e2ad315d92d83f554e717b83140 | [
"MIT"
] | null | null | null | PAN03.py | zfng/Synth2021 | 80f854a38c8d9e2ad315d92d83f554e717b83140 | [
"MIT"
] | null | null | null | PAN03.py | zfng/Synth2021 | 80f854a38c8d9e2ad315d92d83f554e717b83140 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from FUNCS import FNS
from LEGS import LegVar, LegFun
from BMAP3D import MapVar, MapFun
# ---------------------------------------------------------------------------------------------------------------------
# Leg Module - pr... | 36.284483 | 119 | 0.540508 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from FUNCS import FNS
from LEGS import LegVar, LegFun
from BMAP3D import MapVar, MapFun
# ---------------------------------------------------------------------------------------------------------------------
# Leg Module - pr... | 2,334 | 0 | 27 |
b4fa1f153a1f39fc6ff70b1f33e0a3deba093dce | 901 | py | Python | 2021/day21/part1.py | trongbq/adventofcode | 7ab692a91304a00a7843460052238b98c6f44963 | [
"MIT"
] | null | null | null | 2021/day21/part1.py | trongbq/adventofcode | 7ab692a91304a00a7843460052238b98c6f44963 | [
"MIT"
] | null | null | null | 2021/day21/part1.py | trongbq/adventofcode | 7ab692a91304a00a7843460052238b98c6f44963 | [
"MIT"
] | null | null | null | dice_state = 0
# https://adventofcode.com/2021/day/21
if __name__ == '__main__':
res = solve(2, 5)
print(res)
| 20.022222 | 149 | 0.584906 | dice_state = 0
# https://adventofcode.com/2021/day/21
def solve(p1, p2):
sc1, sc2 = 0, 0
roll = 0
turn = 1
while sc1 < 1000 and sc2 < 1000:
if turn == 1:
p1, d = move(p1)
sc1 += p1
turn = 2
else:
p2, d = move(p2)
sc2 += p2
turn = 1
roll += 3
print(f"Player ... | 689 | 0 | 91 |
427cb561645f67b00e5b38fb53255444197d5c10 | 5,967 | py | Python | rewrite/commands/moderation/clear/_clear_from.py | VoxelPrismatic/prizai | 632a5dfed23807d78064d292d474ac4cc8988b12 | [
"Unlicense"
] | 2 | 2019-11-08T21:34:44.000Z | 2020-07-05T15:31:19.000Z | rewrite/commands/moderation/clear/_clear_from.py | VoxelPrismatic/prizai | 632a5dfed23807d78064d292d474ac4cc8988b12 | [
"Unlicense"
] | null | null | null | rewrite/commands/moderation/clear/_clear_from.py | VoxelPrismatic/prizai | 632a5dfed23807d78064d292d474ac4cc8988b12 | [
"Unlicense"
] | 2 | 2020-07-05T15:39:51.000Z | 2020-07-05T16:15:47.000Z | import io
import json
import re
| 36.833333 | 138 | 0.382269 | import io
import json
import re
async def c(WS, msg, options):
channels_URL = f"https://discord.com/channels/{msg['guild_id']}/{msg['channel_id']}/"
def get_ID(snow):
try:
if len(snow) < 17:
raise IndentationError
return int(snow)
except:
prin... | 5,912 | 0 | 23 |
a855dad8fe9de6bee3e4a024f1c431b5fbf333b0 | 4,148 | py | Python | handler/ClassWeekHandler.py | Videl/absentees-blackboard | 35658c14253340c34ef7dac98322306c7c555df1 | [
"MIT"
] | null | null | null | handler/ClassWeekHandler.py | Videl/absentees-blackboard | 35658c14253340c34ef7dac98322306c7c555df1 | [
"MIT"
] | null | null | null | handler/ClassWeekHandler.py | Videl/absentees-blackboard | 35658c14253340c34ef7dac98322306c7c555df1 | [
"MIT"
] | null | null | null | from time import strftime, strptime
from datetime import date, timedelta, datetime
from handler.BaseHandler import *
from model.Accounts import *
from util import *
| 39.504762 | 105 | 0.621263 | from time import strftime, strptime
from datetime import date, timedelta, datetime
from handler.BaseHandler import *
from model.Accounts import *
from util import *
class ClassWeekHandler(BaseHandler):
ade_communicator = None
def __init__(self, request=None, response=None):
super(ClassWeekHandler, s... | 3,779 | 178 | 23 |
7eb89475feb9090a048453009a38fa835e21dcc4 | 5,254 | py | Python | Simon/penny/guesser.py | uncharted-distil/simon | 26e4e54e6de455bde8ee1a24634d060e1ec7babb | [
"MIT"
] | null | null | null | Simon/penny/guesser.py | uncharted-distil/simon | 26e4e54e6de455bde8ee1a24634d060e1ec7babb | [
"MIT"
] | 2 | 2021-01-27T14:57:26.000Z | 2021-10-07T19:34:09.000Z | Simon/penny/guesser.py | uncharted-distil/simon | 26e4e54e6de455bde8ee1a24634d060e1ec7babb | [
"MIT"
] | 1 | 2021-03-18T19:13:05.000Z | 2021-03-18T19:13:05.000Z | from collections import Counter
from .utils import to_unicode
''' from .value_checks import (is_a_date, is_a_number, is_a_nothing,
is_a_latitude, is_a_longitude, is_a_coord_pair, is_a_country, is_a_city,
is_a_state, is_a_address, is_a_text, is_a_label, is_a_zip, is_a_street,
is_a_phone, is_a_url, is_a_ema... | 28.554348 | 82 | 0.627141 | from collections import Counter
from .utils import to_unicode
''' from .value_checks import (is_a_date, is_a_number, is_a_nothing,
is_a_latitude, is_a_longitude, is_a_coord_pair, is_a_country, is_a_city,
is_a_state, is_a_address, is_a_text, is_a_label, is_a_zip, is_a_street,
is_a_phone, is_a_url, is_a_ema... | 4,529 | 0 | 46 |
167caa472eff4c5160a21abaa6c6538ab4eb084f | 244 | py | Python | Tree_Traversal/01_csTreeTraversalCategories.py | med-cab1/CSPT15_BST_GP | b526bd03cc9ff256963b1b7f48e40697a4558b4c | [
"MIT"
] | null | null | null | Tree_Traversal/01_csTreeTraversalCategories.py | med-cab1/CSPT15_BST_GP | b526bd03cc9ff256963b1b7f48e40697a4558b4c | [
"MIT"
] | null | null | null | Tree_Traversal/01_csTreeTraversalCategories.py | med-cab1/CSPT15_BST_GP | b526bd03cc9ff256963b1b7f48e40697a4558b4c | [
"MIT"
] | 38 | 2020-12-02T02:04:13.000Z | 2021-02-11T03:48:57.000Z | """
What are the two primary categories for tree traversals?
A - 1- Depth-First
2- Breadth-First
B - 1- Height-First
2- Width-First
C - 1- Level-First
2- Branch-First
D - 1- Leaf-First
2- Branch-First
answer is :
""" | 10.166667 | 56 | 0.618852 | """
What are the two primary categories for tree traversals?
A - 1- Depth-First
2- Breadth-First
B - 1- Height-First
2- Width-First
C - 1- Level-First
2- Branch-First
D - 1- Leaf-First
2- Branch-First
answer is :
""" | 0 | 0 | 0 |
84ccc37d6e154935b315a0ef917ab237b5b2c86e | 468 | py | Python | leetcode/contests/biweekly-contest-3/2-1100. Find K-Length Substrings With No Repeated Characters.py | palash24/algorithms-and-data-structures | 164be7d1a501a21af808673888964bbab36243a1 | [
"MIT"
] | 23 | 2018-11-06T03:54:00.000Z | 2022-03-14T13:30:40.000Z | leetcode/contests/biweekly-contest-3/2-1100. Find K-Length Substrings With No Repeated Characters.py | palash24/algorithms-and-data-structures | 164be7d1a501a21af808673888964bbab36243a1 | [
"MIT"
] | null | null | null | leetcode/contests/biweekly-contest-3/2-1100. Find K-Length Substrings With No Repeated Characters.py | palash24/algorithms-and-data-structures | 164be7d1a501a21af808673888964bbab36243a1 | [
"MIT"
] | 5 | 2019-05-24T16:56:45.000Z | 2022-03-10T17:29:10.000Z | # 1100. Find K-Length Substrings With No Repeated Characters
import collections
print(Solution().numKLenSubstrNoRepeats("havefunonleetcode", 5)) | 33.428571 | 64 | 0.570513 | # 1100. Find K-Length Substrings With No Repeated Characters
import collections
class Solution:
def numKLenSubstrNoRepeats(self, S: str, K: int) -> int:
if K > len(S): return 0
ans = 0
for i in range(len(S)-K+1):
cnt = collections.Counter(S[i:i+K])
if all(v =... | 269 | -6 | 48 |
865f1998b8248e73167722084a218b89ab01c1ce | 25,385 | py | Python | sdk/python/pulumi_google_native/appengine/v1/get_version.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 44 | 2021-04-18T23:00:48.000Z | 2022-02-14T17:43:15.000Z | sdk/python/pulumi_google_native/appengine/v1/get_version.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 354 | 2021-04-16T16:48:39.000Z | 2022-03-31T17:16:39.000Z | sdk/python/pulumi_google_native/appengine/v1/get_version.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 8 | 2021-04-24T17:46:51.000Z | 2022-01-05T10:40:21.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 46.577982 | 766 | 0.68312 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 10,064 | 11,558 | 71 |
f54a5eefd76fc79d5d5d5a10da0490577dd294c0 | 1,176 | py | Python | Common/utils.py | wchen61/DeepLearningModels | 6fde6e66f2aea5f58aeee9863c9eb43db202f7c5 | [
"MIT"
] | null | null | null | Common/utils.py | wchen61/DeepLearningModels | 6fde6e66f2aea5f58aeee9863c9eb43db202f7c5 | [
"MIT"
] | null | null | null | Common/utils.py | wchen61/DeepLearningModels | 6fde6e66f2aea5f58aeee9863c9eb43db202f7c5 | [
"MIT"
] | null | null | null | import torch
import numpy as np
import time | 21.381818 | 83 | 0.588435 | import torch
import numpy as np
import time
def cpu():
return torch.device('cpu')
def gpu(i=0):
return torch.device(f'cuda:{i}')
def num_gpus():
return torch.cuda.device_count()
def try_gpu(i=0):
if num_gpus() >= i + 1:
return gpu(i)
return cpu()
def try_all_gpus():
devices = [torch... | 712 | -12 | 433 |
24d5aa3aeee546b4b096d147bb736c95d35497f4 | 700 | py | Python | corpora_creation/create_word_lists_test.py | sofignatova/02books | 9eed066fee5503c88359958708dfb8eba56e465a | [
"MIT"
] | 38 | 2020-12-22T01:15:38.000Z | 2021-11-09T11:01:40.000Z | corpora_creation/create_word_lists_test.py | sofignatova/02books | 9eed066fee5503c88359958708dfb8eba56e465a | [
"MIT"
] | 1 | 2020-12-21T19:11:11.000Z | 2020-12-21T19:11:11.000Z | corpora_creation/create_word_lists_test.py | sofignatova/02books | 9eed066fee5503c88359958708dfb8eba56e465a | [
"MIT"
] | 3 | 2020-12-22T04:17:50.000Z | 2020-12-22T09:03:37.000Z | import create_word_lists
| 29.166667 | 83 | 0.527143 | import create_word_lists
def test_sorter_in_wordlists():
sorter = create_word_lists.create_sorter_from_wordlists(
[["a", "b", "c"], ["d", "e", "f"]]
)
assert sorter(["f", "c", "a", "e", "b", "d"]) == ["a", "b", "c", "d", "e", "f"]
def test_sorter_not_in_wordlists():
sorter = create_word_list... | 603 | 0 | 69 |
6bd4c7083e65c9f822b460dc08b16a677df05fcf | 7,863 | py | Python | app.py | schuyler/odm360 | cd33688db91443b5db3451d2800a465d9fef7931 | [
"MIT"
] | null | null | null | app.py | schuyler/odm360 | cd33688db91443b5db3451d2800a465d9fef7931 | [
"MIT"
] | null | null | null | app.py | schuyler/odm360 | cd33688db91443b5db3451d2800a465d9fef7931 | [
"MIT"
] | null | null | null | # Server is setup here
from flask import (
Flask,
render_template,
redirect,
request,
jsonify,
make_response,
Response,
)
from flask_bootstrap import Bootstrap
import psycopg2
import logging
from odm360.log import start_logger, stream_logger
from odm360.camera360rig import do_request
from o... | 33.892241 | 165 | 0.638815 | # Server is setup here
from flask import (
Flask,
render_template,
redirect,
request,
jsonify,
make_response,
Response,
)
from flask_bootstrap import Bootstrap
import psycopg2
import logging
from odm360.log import start_logger, stream_logger
from odm360.camera360rig import do_request
from o... | 4,574 | 0 | 155 |
d21a6ff2453628d9674e8dd1561e0aef09c9335c | 4,962 | py | Python | model.py | hatsuame/LineRelifer | 90e8592dfd8e758aa3b42ddb81771164f4573a60 | [
"MIT"
] | 23 | 2018-04-17T07:28:58.000Z | 2022-01-26T15:34:34.000Z | model.py | hatsuame/LineRelifer | 90e8592dfd8e758aa3b42ddb81771164f4573a60 | [
"MIT"
] | null | null | null | model.py | hatsuame/LineRelifer | 90e8592dfd8e758aa3b42ddb81771164f4573a60 | [
"MIT"
] | 1 | 2018-05-13T00:57:02.000Z | 2018-05-13T00:57:02.000Z | import numpy as np
import datetime
from keras.models import Model
from keras.layers import Input, Activation, Reshape, BatchNormalization, MaxPool2D, Conv2D, Add, Dropout, Flatten, Dense
from keras.optimizers import Adam
from keras.preprocessing.image import ImageDataGenerator
from keras.applications import xception
... | 27.566667 | 120 | 0.615276 | import numpy as np
import datetime
from keras.models import Model
from keras.layers import Input, Activation, Reshape, BatchNormalization, MaxPool2D, Conv2D, Add, Dropout, Flatten, Dense
from keras.optimizers import Adam
from keras.preprocessing.image import ImageDataGenerator
from keras.applications import xception
... | 4,368 | 0 | 115 |
ee608fa5b117d9394478055bcfa7e40cae18da3b | 15,237 | py | Python | main_lsdr_ol.py | xjtuygao/EPT | 1fb39f0f8508dd5531a97671c3b7294c7d20c286 | [
"MIT"
] | null | null | null | main_lsdr_ol.py | xjtuygao/EPT | 1fb39f0f8508dd5531a97671c3b7294c7d20c286 | [
"MIT"
] | null | null | null | main_lsdr_ol.py | xjtuygao/EPT | 1fb39f0f8508dd5531a97671c3b7294c7d20c286 | [
"MIT"
] | null | null | null | from __future__ import print_function
# basic functions
import argparse
import os
import random
import math
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
plt.switch_backend('agg')
# torch functions
import torch
import torch.nn as nn
import torch.nn.parallel
from torch.autograd import grad as ... | 36.539568 | 133 | 0.628208 | from __future__ import print_function
# basic functions
import argparse
import os
import random
import math
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
plt.switch_backend('agg')
# torch functions
import torch
import torch.nn as nn
import torch.nn.parallel
from torch.autograd import grad as ... | 361 | 0 | 23 |
d49372b8a81c000e0e9cf63cfc844469840d8ddd | 1,716 | py | Python | problems/array/Solution1652.py | akalu/cs-problems-python | 9b1bd8e3932be62135a38a77f955ded9a766b654 | [
"MIT"
] | null | null | null | problems/array/Solution1652.py | akalu/cs-problems-python | 9b1bd8e3932be62135a38a77f955ded9a766b654 | [
"MIT"
] | null | null | null | problems/array/Solution1652.py | akalu/cs-problems-python | 9b1bd8e3932be62135a38a77f955ded9a766b654 | [
"MIT"
] | null | null | null | """ You have a bomb to defuse, and your time is running out! Your informer will
provide you with a circular array code of length of n and a key k. To decrypt
the code, you must replace every number. All the numbers are replaced
simultaneously.
If k > 0, replace the ith number with the sum of the next... | 33 | 81 | 0.555361 | """ You have a bomb to defuse, and your time is running out! Your informer will
provide you with a circular array code of length of n and a key k. To decrypt
the code, you must replace every number. All the numbers are replaced
simultaneously.
If k > 0, replace the ith number with the sum of the next... | 703 | -2 | 49 |
4d41deba294d765948d6032e78b1d818612a5eab | 4,190 | py | Python | DBSCAN Clustering/Demo/DBSCAN_Clustering.py | aryasoni98/Statistics-and-Econometrics-for-Data-Science | 6e1e67b49289a74522d65ea52b843801756c6c5f | [
"MIT"
] | null | null | null | DBSCAN Clustering/Demo/DBSCAN_Clustering.py | aryasoni98/Statistics-and-Econometrics-for-Data-Science | 6e1e67b49289a74522d65ea52b843801756c6c5f | [
"MIT"
] | null | null | null | DBSCAN Clustering/Demo/DBSCAN_Clustering.py | aryasoni98/Statistics-and-Econometrics-for-Data-Science | 6e1e67b49289a74522d65ea52b843801756c6c5f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# In[2]:
df=pd.read_csv("./Dataset/Mall_Customers.csv")
# In[3]:
df.head()
# In[4]:
df.info()
# In[5]:
df.describe()
# In[6]:
df.rename(columns={'Annual Inco... | 17.531381 | 448 | 0.63747 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# In[2]:
df=pd.read_csv("./Dataset/Mall_Customers.csv")
# In[3]:
df.head()
# In[4]:
df.info()
# In[5]:
df.describe()
# In[6]:
df.rename(columns={'Annual Inco... | 0 | 0 | 0 |
fc977aa01da06ec285fac44c38b82017adce47e1 | 546 | py | Python | acra_api/split.py | legalese/legalese-google-app | 8bf34cf4a956c55a0551e056f0a24741dcf9ff26 | [
"Apache-2.0"
] | 8 | 2016-09-15T02:20:40.000Z | 2021-05-19T04:16:34.000Z | acra_api/split.py | legalese/legalese-google-app | 8bf34cf4a956c55a0551e056f0a24741dcf9ff26 | [
"Apache-2.0"
] | 4 | 2016-09-19T08:33:16.000Z | 2016-09-30T22:16:53.000Z | acra_api/split.py | legalese/legalese-google-app | 8bf34cf4a956c55a0551e056f0a24741dcf9ff26 | [
"Apache-2.0"
] | 1 | 2016-08-19T13:59:37.000Z | 2016-08-19T13:59:37.000Z | import json
import sys
f = open('/path/to/json', 'r')
h = json.load(f)
'''
for i in h["UEN_DATAGOV"]["BODY"][0]["DATA"]:
if i["ENTITY_NAME"][0] == "LEGALESE PTE. LTD.":
print i["ENTITY_NAME"][0]
print i["UEN"][0]
'''
# note that my parser prints the key values into a single-element array
chunkSiz... | 27.3 | 77 | 0.584249 | import json
import sys
f = open('/path/to/json', 'r')
h = json.load(f)
'''
for i in h["UEN_DATAGOV"]["BODY"][0]["DATA"]:
if i["ENTITY_NAME"][0] == "LEGALESE PTE. LTD.":
print i["ENTITY_NAME"][0]
print i["UEN"][0]
'''
# note that my parser prints the key values into a single-element array
chunkSiz... | 0 | 0 | 0 |
2e7e5e7e8237d6f391b0d45ec5d63cc57e8776fe | 644 | py | Python | imageSpider/pipelines.py | Maaaaaaaa12138/imageSpider | 2142eb89f50950bdc6d17641a61a42d08fba3268 | [
"MIT"
] | null | null | null | imageSpider/pipelines.py | Maaaaaaaa12138/imageSpider | 2142eb89f50950bdc6d17641a61a42d08fba3268 | [
"MIT"
] | 9 | 2021-03-19T03:44:12.000Z | 2022-03-12T00:30:38.000Z | imageSpider/pipelines.py | Maaaaaaaa12138/imageSpider | 2142eb89f50950bdc6d17641a61a42d08fba3268 | [
"MIT"
] | 1 | 2021-04-30T02:29:45.000Z | 2021-04-30T02:29:45.000Z | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
import scrapy
from scrapy.pipelines.images import ImagesPipeline | 33.894737 | 73 | 0.698758 | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
import scrapy
from scrapy.pipelines.images import ImagesPipeline
class ImagespiderPipeline(ImagesPipeline):
def get... | 279 | 21 | 85 |
a9bfd2c084ca7cadec1eda2c245ec0f618ba73f5 | 1,845 | py | Python | api/server_inference.py | smolendawid/ubaar-competition | 28de972d6beb13343c537fc030101be672a852a3 | [
"Apache-2.0"
] | null | null | null | api/server_inference.py | smolendawid/ubaar-competition | 28de972d6beb13343c537fc030101be672a852a3 | [
"Apache-2.0"
] | null | null | null | api/server_inference.py | smolendawid/ubaar-competition | 28de972d6beb13343c537fc030101be672a852a3 | [
"Apache-2.0"
] | null | null | null | import os
import pandas as pd
from feature_extraction.date_utils import date_features
from feature_extraction.coords_features import coord_features
from feature_extraction.other_features import raw_features, categorical_features
from feature_extraction.path_utils import project_root
import xgboost as xgb
import joblib
... | 38.4375 | 104 | 0.730081 | import os
import pandas as pd
from feature_extraction.date_utils import date_features
from feature_extraction.coords_features import coord_features
from feature_extraction.other_features import raw_features, categorical_features
from feature_extraction.path_utils import project_root
import xgboost as xgb
import joblib
... | 844 | 0 | 46 |
c5623e5ee9db6463d65c55baf0653205703e7d4a | 329 | py | Python | view/routes.py | Yoshiinori/droid-multi | 451cb361692efbe3999409f9d5f9ee2cd944c17d | [
"MIT"
] | 1 | 2020-12-15T09:58:14.000Z | 2020-12-15T09:58:14.000Z | view/routes.py | Yoshiinori/droid-multi | 451cb361692efbe3999409f9d5f9ee2cd944c17d | [
"MIT"
] | null | null | null | view/routes.py | Yoshiinori/droid-multi | 451cb361692efbe3999409f9d5f9ee2cd944c17d | [
"MIT"
] | null | null | null | from flask import Blueprint, render_template, session
view = Blueprint('view', __name__, template_folder='templates')
@view.route('/')
print('view working') | 23.5 | 63 | 0.696049 | from flask import Blueprint, render_template, session
view = Blueprint('view', __name__, template_folder='templates')
@view.route('/')
def index():
username = 'hello'
if 'username' in session:
username = session['username']
return render_template('index.html', username=username)
print('view ... | 141 | 0 | 22 |
701bb5ae63a734bfbe9eb252e0d76238ac48381e | 12,128 | py | Python | csp/csp.py | mkbabb/csp-solver | b5e4aab74d62709f4804bec25b6d5488378f896d | [
"Unlicense"
] | null | null | null | csp/csp.py | mkbabb/csp-solver | b5e4aab74d62709f4804bec25b6d5488378f896d | [
"Unlicense"
] | null | null | null | csp/csp.py | mkbabb/csp-solver | b5e4aab74d62709f4804bec25b6d5488378f896d | [
"Unlicense"
] | null | null | null | import pprint
import random
from collections import defaultdict, deque
from enum import Enum, auto
from typing import *
import numpy as np
V = TypeVar("V")
D = TypeVar("D")
Solution = Dict[V, D]
Constraint = Callable[[Solution], bool]
if __name__ == "__main__":
kwargs = {
"pruning_type": ... | 30.938776 | 88 | 0.610818 | import pprint
import random
from collections import defaultdict, deque
from enum import Enum, auto
from typing import *
import numpy as np
V = TypeVar("V")
D = TypeVar("D")
Solution = Dict[V, D]
Constraint = Callable[[Solution], bool]
class PruningType(Enum):
FORWARD_CHECKING = auto()
AC3 = auto()
AC_F... | 10,584 | 139 | 807 |
d739b85698982f3e86d8476bd9cf16f8fe06ea62 | 305 | py | Python | VSR/Backend/Torch/Models/Contrib/ntire20/xiaozhong/__init__.py | Kadantte/VideoSuperResolution | 4c86e49d81c7a9bea1fe0780d651afc126768df3 | [
"MIT"
] | 1,447 | 2018-06-04T08:44:07.000Z | 2022-03-29T06:19:10.000Z | VSR/Backend/Torch/Models/Contrib/ntire20/xiaozhong/__init__.py | Kadantte/VideoSuperResolution | 4c86e49d81c7a9bea1fe0780d651afc126768df3 | [
"MIT"
] | 96 | 2018-08-29T01:02:45.000Z | 2022-01-12T06:00:01.000Z | VSR/Backend/Torch/Models/Contrib/ntire20/xiaozhong/__init__.py | Kadantte/VideoSuperResolution | 4c86e49d81c7a9bea1fe0780d651afc126768df3 | [
"MIT"
] | 307 | 2018-06-26T13:35:54.000Z | 2022-01-21T09:01:54.000Z | # Copyright (c) 2017-2020 Wenyi Tang.
# Author: Wenyi Tang
# Email: wenyitang@outlook.com
# Update: 2020 - 5 - 28
import logging
_logger = logging.getLogger("VSR.RWSR")
_logger.info("LICENSE: RealSR is implemented by Xiaozhong Ji. "
"@xiaozhongji https://github.com/jixiaozhong/RealSR")
| 30.5 | 66 | 0.701639 | # Copyright (c) 2017-2020 Wenyi Tang.
# Author: Wenyi Tang
# Email: wenyitang@outlook.com
# Update: 2020 - 5 - 28
import logging
_logger = logging.getLogger("VSR.RWSR")
_logger.info("LICENSE: RealSR is implemented by Xiaozhong Ji. "
"@xiaozhongji https://github.com/jixiaozhong/RealSR")
| 0 | 0 | 0 |
b561ead315ebf2163401e97c2659a90145251c28 | 3,850 | py | Python | snipy/plot_helpers.py | navdeeprana/snipy | 55a5286a17d1c471d147e9ed7cbe06945c3eef02 | [
"MIT"
] | null | null | null | snipy/plot_helpers.py | navdeeprana/snipy | 55a5286a17d1c471d147e9ed7cbe06945c3eef02 | [
"MIT"
] | null | null | null | snipy/plot_helpers.py | navdeeprana/snipy | 55a5286a17d1c471d147e9ed7cbe06945c3eef02 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib
from matplotlib import pyplot as plt
def no_ticks(ax, axis="both"):
"""
Remove ticks and labels from one or both axis.
ax : matplotlib ax object.
axis : "both", "x", "y"
"""
from numpy import ndarray
try:
for axi in ax:
set(axi)
... | 25.328947 | 76 | 0.599481 | import numpy as np
import matplotlib
from matplotlib import pyplot as plt
def no_ticks(ax, axis="both"):
"""
Remove ticks and labels from one or both axis.
ax : matplotlib ax object.
axis : "both", "x", "y"
"""
from numpy import ndarray
def set(ax):
if axis == "both" or axis == ... | 1,611 | 0 | 211 |
d2c88e044e1de21a07e0cac103586cc5d21d6b70 | 1,411 | py | Python | lang/Python/levenshtein-distance-3.py | ethansaxenian/RosettaDecode | 8ea1a42a5f792280b50193ad47545d14ee371fb7 | [
"MIT"
] | null | null | null | lang/Python/levenshtein-distance-3.py | ethansaxenian/RosettaDecode | 8ea1a42a5f792280b50193ad47545d14ee371fb7 | [
"MIT"
] | null | null | null | lang/Python/levenshtein-distance-3.py | ethansaxenian/RosettaDecode | 8ea1a42a5f792280b50193ad47545d14ee371fb7 | [
"MIT"
] | null | null | null |
print((
ld('kitten','kitten'), # 0
ld('kitten','sitten'), # 1
ld('kitten','sittes'), # 2
ld('kitten','sityteng'), # 3
ld('kitten','sittYing'), # 4
ld('rosettacode','raisethysword'), # 8
ld('kitten','kittenaaaaaaaaaaaaaaaaa'), # 17
ld('kittenaaaaaaaaaaaaaaaaa','kitten') # 17
))
print((
... | 32.813953 | 68 | 0.533664 | def ld(a, b, mx=-1):
def result(d): return d if mx < 0 else False if d > mx else True
if a == b: return result(0)
la, lb = len(a), len(b)
if mx >= 0 and abs(la - lb) > mx: return result(mx+1)
if la == 0: return result(lb)
if lb == 0: return result(la)
if lb > la: a, b, la, lb = b, a, lb, l... | 725 | 0 | 22 |
997d71ff359b2b27a7cc8e63b3f0c00567fcdf52 | 1,179 | py | Python | ML Artefact 2/main.py | amifsud02/Machine-Learning---Object-Detection | fbf8b67ca93f7a31e20e7b06602f70bae29dbc4a | [
"Unlicense"
] | null | null | null | ML Artefact 2/main.py | amifsud02/Machine-Learning---Object-Detection | fbf8b67ca93f7a31e20e7b06602f70bae29dbc4a | [
"Unlicense"
] | null | null | null | ML Artefact 2/main.py | amifsud02/Machine-Learning---Object-Detection | fbf8b67ca93f7a31e20e7b06602f70bae29dbc4a | [
"Unlicense"
] | null | null | null | import cv2 as cv
faceCascade = cv.CascadeClassifier('haarcascade/haarcascade_frontalface_default.xml') #most accurate
eyeCascade = cv.CascadeClassifier('haarcascade/haarcascade_eye.xml')
video = cv.VideoCapture(0)
while(True):
ret, frame = video.read()
gray = cv.cvtColor(frame, cv.COLOR_BGR2GRAY)
f... | 31.026316 | 100 | 0.578456 | import cv2 as cv
faceCascade = cv.CascadeClassifier('haarcascade/haarcascade_frontalface_default.xml') #most accurate
eyeCascade = cv.CascadeClassifier('haarcascade/haarcascade_eye.xml')
video = cv.VideoCapture(0)
while(True):
ret, frame = video.read()
gray = cv.cvtColor(frame, cv.COLOR_BGR2GRAY)
f... | 0 | 0 | 0 |
26cf23fa30a8759b9b99adae7f2ae12970eb59ba | 979 | py | Python | py_knots/hom_basis.py | Chinmaya-Kausik/py_knots | 3c9930ea0e95f6c62da9e13eb5ffcfc0e0737f9f | [
"MIT"
] | null | null | null | py_knots/hom_basis.py | Chinmaya-Kausik/py_knots | 3c9930ea0e95f6c62da9e13eb5ffcfc0e0737f9f | [
"MIT"
] | null | null | null | py_knots/hom_basis.py | Chinmaya-Kausik/py_knots | 3c9930ea0e95f6c62da9e13eb5ffcfc0e0737f9f | [
"MIT"
] | null | null | null | from braid import *
from sgraph import *
from typing import List
from numpy import random
| 27.194444 | 58 | 0.651685 | from braid import *
from sgraph import *
from typing import List
from numpy import random
def find_min_perm(p: ColBraid, col_signs: List[int],
tries: int) -> (ColBraid, List[int]):
colors = max(p.col_list)+1
col = list(range(colors))
col_list = self.deepcopy(p.col_list)
graph = p.make_graph(c... | 863 | 0 | 23 |
9ba5e8ded5c859b527a1f9a92667c3dc77db3a2d | 257 | py | Python | lang/python/modelaapi/__init__.py | metaprov/modeldapi | ee05693832051dcd990ee4f061715d7ae0787340 | [
"Apache-2.0"
] | 5 | 2022-02-18T03:40:10.000Z | 2022-03-01T16:11:24.000Z | lang/python/modelaapi/__init__.py | metaprov/modeldapi | ee05693832051dcd990ee4f061715d7ae0787340 | [
"Apache-2.0"
] | 1 | 2022-01-07T19:59:25.000Z | 2022-02-04T01:21:14.000Z | lang/python/modelaapi/__init__.py | metaprov/modeldapi | ee05693832051dcd990ee4f061715d7ae0787340 | [
"Apache-2.0"
] | 1 | 2022-03-25T10:21:43.000Z | 2022-03-25T10:21:43.000Z | ##########################################################################
## Package Version
##########################################################################
from .version import get_version, __version_info__
__version__ = get_version(short=True) | 51.4 | 74 | 0.346304 | ##########################################################################
## Package Version
##########################################################################
from .version import get_version, __version_info__
__version__ = get_version(short=True) | 0 | 0 | 0 |
98efbf34cf83a2d8fce0470b97f10ff4c12f2a66 | 359 | py | Python | pyexplain/attach/examples/urls.py | LucasMagnum/pyexplain | ca7a91df8519f576c21d5ede4b4f779fabfd5cbe | [
"MIT"
] | 6 | 2018-03-20T19:50:47.000Z | 2021-11-21T12:59:01.000Z | pyexplain/attach/examples/urls.py | LucasMagnum/pyexplain | ca7a91df8519f576c21d5ede4b4f779fabfd5cbe | [
"MIT"
] | 1 | 2015-10-30T22:01:28.000Z | 2015-11-03T23:07:52.000Z | pyexplain/attach/examples/urls.py | LucasMagnum/pyexplain | ca7a91df8519f576c21d5ede4b4f779fabfd5cbe | [
"MIT"
] | 1 | 2015-12-18T12:53:59.000Z | 2015-12-18T12:53:59.000Z | # coding: utf-8
from . import views
from django.conf.urls import url
urlpatterns = [
url(
r'^create/(?P<app_label>\w+)/(?P<model>\w+)/(?P<obj_id>\d+)/$',
views.ExampleCreateView.as_view(),
name='create'
),
url(
r'^update/(?P<pk>\d+)/$',
views.ExampleUpdateView.as_... | 17.95 | 71 | 0.532033 | # coding: utf-8
from . import views
from django.conf.urls import url
urlpatterns = [
url(
r'^create/(?P<app_label>\w+)/(?P<model>\w+)/(?P<obj_id>\d+)/$',
views.ExampleCreateView.as_view(),
name='create'
),
url(
r'^update/(?P<pk>\d+)/$',
views.ExampleUpdateView.as_... | 0 | 0 | 0 |
6a0f03ac34b998ef30737a7e0e14d6c3f86917db | 2,090 | py | Python | Classification/random_forest_classification.py | KacperKubara/SUAIS_Workshops | ab989150855d4612d801c759ae486e48176083b0 | [
"MIT"
] | 11 | 2019-02-04T18:14:49.000Z | 2022-03-20T13:29:01.000Z | Classification/random_forest_classification.py | MohamedNabilFcih/Workshops-Material | f69b55bc49d0b76a22922a7450b755d94feefc78 | [
"MIT"
] | 2 | 2019-02-01T21:42:22.000Z | 2019-03-18T17:11:04.000Z | Classification/random_forest_classification.py | MohamedNabilFcih/Workshops-Material | f69b55bc49d0b76a22922a7450b755d94feefc78 | [
"MIT"
] | 3 | 2019-02-04T18:17:33.000Z | 2019-03-18T15:33:21.000Z | # Random forest classification with PCA
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# Read Data
from sklearn.datasets import load_iris
dataset = load_iris()
# Choose which features to use
x = dataset["data"] # It has 4 features - with PCA we will reduce it to 3 for 3D visualisation
y =... | 34.262295 | 97 | 0.743541 | # Random forest classification with PCA
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# Read Data
from sklearn.datasets import load_iris
dataset = load_iris()
# Choose which features to use
x = dataset["data"] # It has 4 features - with PCA we will reduce it to 3 for 3D visualisation
y =... | 0 | 0 | 0 |
33de9502e055603028405e1eef45ad01d83cca6a | 2,603 | py | Python | polling_people/polls/models.py | Uforick/API-polling-people | 8d96d106a3e36c592cc7554c8302043622455e5c | [
"BSD-3-Clause"
] | null | null | null | polling_people/polls/models.py | Uforick/API-polling-people | 8d96d106a3e36c592cc7554c8302043622455e5c | [
"BSD-3-Clause"
] | null | null | null | polling_people/polls/models.py | Uforick/API-polling-people | 8d96d106a3e36c592cc7554c8302043622455e5c | [
"BSD-3-Clause"
] | null | null | null | from datetime import date
from django.db import models
| 21.162602 | 58 | 0.597388 | from datetime import date
from django.db import models
class Poll(models.Model):
title = models.CharField(
max_length=255,
verbose_name='Название',
)
start_date = models.DateField(
auto_now_add=True,
db_index=True,
verbose_name='Дата_начала',
)
end_date = m... | 385 | 2,199 | 115 |
c2f9c75cb485bb39811871bbd00de9e074bbc0ed | 39 | py | Python | pm4pymdl/visualization/__init__.py | dorian1000/pm4py-mdl | 71e0c2425abb183da293a58d31e25e50137c774f | [
"MIT"
] | 5 | 2021-01-31T22:45:29.000Z | 2022-02-22T14:26:06.000Z | pm4pymdl/visualization/__init__.py | Javert899/pm4py-mdl | 4cc875999100f3f1ad60b925a20e40cf52337757 | [
"MIT"
] | 3 | 2021-07-07T15:32:55.000Z | 2021-07-07T16:15:36.000Z | pm4pymdl/visualization/__init__.py | dorian1000/pm4py-mdl | 71e0c2425abb183da293a58d31e25e50137c774f | [
"MIT"
] | 9 | 2020-09-23T15:34:11.000Z | 2022-03-17T09:15:40.000Z | from pm4pymdl.visualization import mvp
| 19.5 | 38 | 0.871795 | from pm4pymdl.visualization import mvp
| 0 | 0 | 0 |
bb2a83c3c3acc7e93a8a2d765afb094b00927c42 | 2,439 | py | Python | pypolybuilder/Bond.py | mssm-labmmol/pypolybuilder | 0b6cc8d7c67492e5cbcbc6e6999d7546eb133190 | [
"MIT"
] | 16 | 2021-04-06T02:24:24.000Z | 2022-02-04T16:32:22.000Z | pypolybuilder/Bond.py | mssm-labmmol/pypolybuilder | 0b6cc8d7c67492e5cbcbc6e6999d7546eb133190 | [
"MIT"
] | null | null | null | pypolybuilder/Bond.py | mssm-labmmol/pypolybuilder | 0b6cc8d7c67492e5cbcbc6e6999d7546eb133190 | [
"MIT"
] | 2 | 2021-04-14T02:37:57.000Z | 2022-01-05T18:12:21.000Z | """
Created on Dec 22, 2013
@author: root
"""
import Utils
from Utils import print_pypoly_warning
| 28.694118 | 115 | 0.558016 | """
Created on Dec 22, 2013
@author: root
"""
import Utils
from Utils import print_pypoly_warning
class Bond(object):
__a1 = None
__a2 = None
__func = None
__param = None
def __init__(self, a1, a2, func, param):
self.__a1 = a1
self.__a2 = a2
self.__func = func
... | 1,647 | 669 | 23 |
62d3bb59c1ffa044a17258ddf6d4ddd27e36797d | 360 | py | Python | pics/urls.py | wamakimaN/galeria | 0088d0ef7dd23f019e015736535b0556c43c7cdd | [
"MIT"
] | null | null | null | pics/urls.py | wamakimaN/galeria | 0088d0ef7dd23f019e015736535b0556c43c7cdd | [
"MIT"
] | 3 | 2021-06-08T20:54:29.000Z | 2021-09-08T01:38:37.000Z | pics/urls.py | wamakimaN/galeria | 0088d0ef7dd23f019e015736535b0556c43c7cdd | [
"MIT"
] | null | null | null | from django.conf.urls import url
from django.conf import settings
from . import views
from django.conf.urls.static import static
urlpatterns = [
url(r'^$', views.home_page, name='homePage'),
url(r'^category/', views.category, name='showCategory'),
]
if settings.DEBUG:
urlpatterns+= static(settings.MEDIA_U... | 30 | 81 | 0.744444 | from django.conf.urls import url
from django.conf import settings
from . import views
from django.conf.urls.static import static
urlpatterns = [
url(r'^$', views.home_page, name='homePage'),
url(r'^category/', views.category, name='showCategory'),
]
if settings.DEBUG:
urlpatterns+= static(settings.MEDIA_U... | 0 | 0 | 0 |
0fd5a34c6d5608f650b6d88cfa7fc54bb96e8c8e | 1,215 | py | Python | darkroom/models.py | jonnygovish/Darkroom | 04e27e0adfe5ef95307be16f86f7bba6193b3dbc | [
"MIT"
] | 1 | 2019-08-13T09:48:21.000Z | 2019-08-13T09:48:21.000Z | darkroom/models.py | jonnygovish/Darkroom | 04e27e0adfe5ef95307be16f86f7bba6193b3dbc | [
"MIT"
] | null | null | null | darkroom/models.py | jonnygovish/Darkroom | 04e27e0adfe5ef95307be16f86f7bba6193b3dbc | [
"MIT"
] | null | null | null | from django.db import models
# Create your models here.
| 21.696429 | 59 | 0.702881 | from django.db import models
# Create your models here.
class User(models.Model):
first_name = models.CharField(max_length = 30)
last_name = models.CharField(max_length = 30)
email = models.EmailField()
def __str__(self):
return self.first_name
def save_user(self):
self.save()
class Meta:
o... | 312 | 777 | 68 |
fa94ba36f260a400c46a8d9e5a2aab74ead026c4 | 765 | py | Python | screenpy/actions/dismiss_alert.py | perrygoy/screenpy | 862c0d7e5ff9f1265e520ab383c04ddbd4d060eb | [
"MIT"
] | 39 | 2019-03-22T15:18:23.000Z | 2022-02-23T17:32:03.000Z | screenpy/actions/dismiss_alert.py | perrygoy/screenpy | 862c0d7e5ff9f1265e520ab383c04ddbd4d060eb | [
"MIT"
] | 63 | 2019-07-17T06:25:19.000Z | 2022-01-13T07:03:53.000Z | screenpy/actions/dismiss_alert.py | bandophahita/screenpy | db0f3ef91a891b9d095016d83fa4b589620808ce | [
"MIT"
] | 15 | 2019-07-09T11:02:56.000Z | 2021-12-24T07:43:56.000Z | """
Dismiss a javascript alert.
"""
from screenpy.abilities import BrowseTheWeb
from screenpy.actor import Actor
from screenpy.pacing import aside, beat
class DismissAlert:
"""Dismiss an alert.
Abilities Required:
|BrowseTheWeb|
Examples::
the_actor.attempts_to(DismissAlert())
"""
... | 23.90625 | 65 | 0.647059 | """
Dismiss a javascript alert.
"""
from screenpy.abilities import BrowseTheWeb
from screenpy.actor import Actor
from screenpy.pacing import aside, beat
class DismissAlert:
"""Dismiss an alert.
Abilities Required:
|BrowseTheWeb|
Examples::
the_actor.attempts_to(DismissAlert())
"""
... | 0 | 0 | 0 |
98c3fe27d54c7d6930b7045994a0da5df8f4026e | 326 | py | Python | tests/test_git.py | joshuaellinger/corona19-data-pipeline | b0a3582d9cd3c765b682264c855258f7690d94d6 | [
"Apache-2.0"
] | 17 | 2020-03-27T15:30:08.000Z | 2020-10-15T15:01:57.000Z | tests/test_git.py | joshuaellinger/corona19-data-pipeline | b0a3582d9cd3c765b682264c855258f7690d94d6 | [
"Apache-2.0"
] | 5 | 2020-03-15T15:41:10.000Z | 2020-03-31T00:39:00.000Z | tests/test_git.py | joshuaellinger/corona19-data-pipeline | b0a3582d9cd3c765b682264c855258f7690d94d6 | [
"Apache-2.0"
] | 7 | 2020-03-20T21:17:54.000Z | 2021-03-31T00:41:44.000Z | #
# working file for testing git support . should be a unit test
#
import sys
import os
from src import check_path
check_path()
from shared.util_git import pull, push, isbehind
if __name__ == "__main__":
test_status()
| 14.173913 | 64 | 0.677914 | #
# working file for testing git support . should be a unit test
#
import sys
import os
from src import check_path
check_path()
from shared.util_git import pull, push, isbehind
def test_status():
xdir = sys.path[0]
x = isbehind(xdir)
print(f"isbehind = {x}")
if __name__ == "__main__":
test_stat... | 74 | 0 | 23 |
6fc76e198c3f990fa57f64dad73d15822e4435f1 | 395 | py | Python | src/gaming_bot/utils/exceptions.py | Unknown15082/gaming-bot | d454094f152a92402b6fd2dae4c89f624c0d547d | [
"MIT"
] | null | null | null | src/gaming_bot/utils/exceptions.py | Unknown15082/gaming-bot | d454094f152a92402b6fd2dae4c89f624c0d547d | [
"MIT"
] | null | null | null | src/gaming_bot/utils/exceptions.py | Unknown15082/gaming-bot | d454094f152a92402b6fd2dae4c89f624c0d547d | [
"MIT"
] | null | null | null | """
Files for every custom exceptions.
"""
class GameNotFoundError(Exception):
"""
Exception to raise when the required game is not found.
"""
| 23.235294 | 77 | 0.637975 | """
Files for every custom exceptions.
"""
class GameNotFoundError(Exception):
"""
Exception to raise when the required game is not found.
"""
def __init__(self, game_type: str, game_id: int) -> None:
self.game_id = game_id
self.game_type = game_type
def __str__(self) -> str:
... | 184 | 0 | 54 |
47f249b23a7b5f7230bfbb222ddcb290a2a7adde | 5,259 | py | Python | boto3_type_annotations_with_docs/boto3_type_annotations/mobile/paginator.py | cowboygneox/boto3_type_annotations | 450dce1de4e066b939de7eac2ec560ed1a7ddaa2 | [
"MIT"
] | 119 | 2018-12-01T18:20:57.000Z | 2022-02-02T10:31:29.000Z | boto3_type_annotations_with_docs/boto3_type_annotations/mobile/paginator.py | cowboygneox/boto3_type_annotations | 450dce1de4e066b939de7eac2ec560ed1a7ddaa2 | [
"MIT"
] | 15 | 2018-11-16T00:16:44.000Z | 2021-11-13T03:44:18.000Z | boto3_type_annotations_with_docs/boto3_type_annotations/mobile/paginator.py | cowboygneox/boto3_type_annotations | 450dce1de4e066b939de7eac2ec560ed1a7ddaa2 | [
"MIT"
] | 11 | 2019-05-06T05:26:51.000Z | 2021-09-28T15:27:59.000Z | from typing import Dict
from botocore.paginate import Paginator
| 40.145038 | 224 | 0.487165 | from typing import Dict
from botocore.paginate import Paginator
class ListBundles(Paginator):
def paginate(self, PaginationConfig: Dict = None) -> Dict:
"""
Creates an iterator that will paginate through responses from :py:meth:`Mobile.Client.list_bundles`.
See also: `AWS API Documentation... | 0 | 5,147 | 46 |
60b2af9de09831f509a1a5e05e9ee15b1eb3477c | 2,014 | py | Python | conrad/schema.py | hasan-haider/conrad | 3e040b73a0cbec0ecee36c397c3bdedf9e439b54 | [
"Apache-2.0"
] | 244 | 2019-10-27T22:40:17.000Z | 2022-01-11T13:04:50.000Z | conrad/schema.py | hasan-haider/conrad | 3e040b73a0cbec0ecee36c397c3bdedf9e439b54 | [
"Apache-2.0"
] | 92 | 2019-10-27T23:01:34.000Z | 2021-08-21T15:19:37.000Z | conrad/schema.py | hasan-haider/conrad | 3e040b73a0cbec0ecee36c397c3bdedf9e439b54 | [
"Apache-2.0"
] | 71 | 2019-10-28T03:05:42.000Z | 2022-02-02T13:34:32.000Z | # -*- coding: utf-8 -*-
LATEST = "2"
f1 = "events.json"
v1 = {
"name": {"type": "string", "minlength": 1, "required": True},
"url": {"type": "string", "minlength": 1, "required": True},
"city": {"type": "string", "minlength": 1, "required": True},
"state": {"type": "string", "required": True, "nullabl... | 49.121951 | 86 | 0.5571 | # -*- coding: utf-8 -*-
LATEST = "2"
f1 = "events.json"
v1 = {
"name": {"type": "string", "minlength": 1, "required": True},
"url": {"type": "string", "minlength": 1, "required": True},
"city": {"type": "string", "minlength": 1, "required": True},
"state": {"type": "string", "required": True, "nullabl... | 0 | 0 | 0 |
cd645d24e4cef57ac2c139482e8bcfd3d50dadb6 | 21,686 | py | Python | pysnmp-with-texts/HP-ICF-IP-LOCKDOWN-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/HP-ICF-IP-LOCKDOWN-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/HP-ICF-IP-LOCKDOWN-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 HP-ICF-IP-LOCKDOWN-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HP-ICF-IP-LOCKDOWN-MIB
# Produced by pysmi-0.3.4 at Wed May 1 13:34:15 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (d... | 147.52381 | 2,186 | 0.776953 | #
# PySNMP MIB module HP-ICF-IP-LOCKDOWN-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HP-ICF-IP-LOCKDOWN-MIB
# Produced by pysmi-0.3.4 at Wed May 1 13:34:15 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (d... | 0 | 0 | 0 |
dd86dbd4ef3a2a9346aac24f05e201323a786ef8 | 3,604 | py | Python | vectorhub/encoders/audio/tfhub/yamnet.py | NanaAkwasiAbayieBoateng/vectorhub | 265933521cf0a3113a47182a30b0037bf163584b | [
"Apache-2.0"
] | 1 | 2020-11-04T16:02:39.000Z | 2020-11-04T16:02:39.000Z | vectorhub/encoders/audio/tfhub/yamnet.py | NanaAkwasiAbayieBoateng/vectorhub | 265933521cf0a3113a47182a30b0037bf163584b | [
"Apache-2.0"
] | null | null | null | vectorhub/encoders/audio/tfhub/yamnet.py | NanaAkwasiAbayieBoateng/vectorhub | 265933521cf0a3113a47182a30b0037bf163584b | [
"Apache-2.0"
] | null | null | null | from ....import_utils import *
from ....models_dict import MODEL_REQUIREMENTS
if is_all_dependency_installed(MODEL_REQUIREMENTS['encoders-audio-tfhub-yamnet']):
import tensorflow as tf
import tensorflow_hub as hub
from ..base import BaseAudio2Vec
from ....base import catch_vector_errors
from ....doc_utils impo... | 55.446154 | 365 | 0.740844 | from ....import_utils import *
from ....models_dict import MODEL_REQUIREMENTS
if is_all_dependency_installed(MODEL_REQUIREMENTS['encoders-audio-tfhub-yamnet']):
import tensorflow as tf
import tensorflow_hub as hub
from ..base import BaseAudio2Vec
from ....base import catch_vector_errors
from ....doc_utils impo... | 669 | 128 | 23 |
44d34fc0868e00425a9ff4a762b942d42d75e211 | 5,642 | py | Python | tests/test_utils.py | Shopify/pyoozie | 6dcbcb8249820dc40b5a9bbbc04b0370240fd706 | [
"MIT"
] | 9 | 2017-03-16T15:30:23.000Z | 2019-08-07T03:35:59.000Z | tests/test_utils.py | Shopify/pyoozie | 6dcbcb8249820dc40b5a9bbbc04b0370240fd706 | [
"MIT"
] | 43 | 2017-02-01T22:20:52.000Z | 2020-08-10T08:48:20.000Z | tests/test_utils.py | Shopify/pyoozie | 6dcbcb8249820dc40b5a9bbbc04b0370240fd706 | [
"MIT"
] | 5 | 2017-02-08T17:59:06.000Z | 2020-11-12T11:29:08.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2017 "Shopify inc." All rights reserved.
# Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
from __future__ import unicode_literals
import xml.etree.ElementTree as et
import pytest
import six
import tests.utils
@pytest.fixture
... | 36.4 | 111 | 0.64268 | # -*- coding: utf-8 -*-
# Copyright (c) 2017 "Shopify inc." All rights reserved.
# Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
from __future__ import unicode_literals
import xml.etree.ElementTree as et
import pytest
import six
import tests.utils
@pytest.fixture
... | 5,246 | 0 | 91 |
4c42e1dbecc75b75160171083b199f71c48c5b86 | 884 | py | Python | perception/database/migrations/versions/506c8e35ba7c_create_openvas_vuln_table.py | asrozar/perception | e308489e30aaa3495092e3926799e43312ee6242 | [
"MIT"
] | 1 | 2017-08-07T11:05:52.000Z | 2017-08-07T11:05:52.000Z | perception/database/migrations/versions/506c8e35ba7c_create_openvas_vuln_table.py | CriticalSecurity/python-perception | e308489e30aaa3495092e3926799e43312ee6242 | [
"MIT"
] | null | null | null | perception/database/migrations/versions/506c8e35ba7c_create_openvas_vuln_table.py | CriticalSecurity/python-perception | e308489e30aaa3495092e3926799e43312ee6242 | [
"MIT"
] | 1 | 2016-10-10T00:36:29.000Z | 2016-10-10T00:36:29.000Z | """create openvas_vuln table
Revision ID: 506c8e35ba7c
Revises: 13b7c3d4c802
Create Date: 2017-07-21 12:19:35.711173
"""
from sqlalchemy.dialects import postgresql
from alembic import op
import sqlalchemy as sa
import datetime
# revision identifiers, used by Alembic.
revision = '506c8e35ba7c'
down_revision = '13b7c... | 26 | 92 | 0.699095 | """create openvas_vuln table
Revision ID: 506c8e35ba7c
Revises: 13b7c3d4c802
Create Date: 2017-07-21 12:19:35.711173
"""
from sqlalchemy.dialects import postgresql
from alembic import op
import sqlalchemy as sa
import datetime
def _get_date():
return datetime.datetime.now()
# revision identifiers, used by Alem... | 445 | 0 | 69 |
b9e21cfd43d35755fc3138718fd40112f134835f | 342 | py | Python | src/admin_panel/migrations/0025_remove_tariff_services.py | Rey092/myhouse24_django | b2b31873006ec4917c2ed043350f2841745fadfb | [
"MIT"
] | null | null | null | src/admin_panel/migrations/0025_remove_tariff_services.py | Rey092/myhouse24_django | b2b31873006ec4917c2ed043350f2841745fadfb | [
"MIT"
] | null | null | null | src/admin_panel/migrations/0025_remove_tariff_services.py | Rey092/myhouse24_django | b2b31873006ec4917c2ed043350f2841745fadfb | [
"MIT"
] | null | null | null | # Generated by Django 3.2.4 on 2021-07-09 04:35
from django.db import migrations
| 19 | 59 | 0.608187 | # Generated by Django 3.2.4 on 2021-07-09 04:35
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("admin_panel", "0024_alter_service_is_removable"),
]
operations = [
migrations.RemoveField(
model_name="tariff",
name="servic... | 0 | 236 | 23 |
325519a74c6bb9dfb5936da32392fa70764b39b3 | 5,243 | py | Python | pytorch_utils.py | The-Data-Team/SDMR | 93bd04de108d5b3003e31217cb2da74ffcbfe0f3 | [
"MIT"
] | 11 | 2019-05-06T11:24:02.000Z | 2020-06-16T07:31:40.000Z | pytorch_utils.py | The-Data-Team/SDMR | 93bd04de108d5b3003e31217cb2da74ffcbfe0f3 | [
"MIT"
] | null | null | null | pytorch_utils.py | The-Data-Team/SDMR | 93bd04de108d5b3003e31217cb2da74ffcbfe0f3 | [
"MIT"
] | 6 | 2019-08-27T13:59:02.000Z | 2021-06-14T19:26:00.000Z | import torch
import numpy as np
import collections
from itertools import repeat
import random
def flatten(x):
'''
flatten high dimensional tensor x into an array
:param x:
:return: 1 dimensional tensor
'''
dims = x.size()[1:] #remove the first dimension as it is batch dimension
num_features... | 28.807692 | 108 | 0.668701 | import torch
import numpy as np
import collections
from itertools import repeat
import random
def _to_iterable(val, num):
try:
iter(val)
return val
except TypeError:
return (val,) * num
def is_cuda(x):
return x.is_cuda
def flatten(x):
'''
flatten high dimensional tensor x... | 3,112 | 0 | 427 |