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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d7f4ea5c8cbf03c238c6958e9cad7d14eea7464f | 9,493 | py | Python | Machine_Learning_and_Parallel_Computing/FINAL_MLP_MAXMIN/m3.py | AlexKnightDu/Lessons | 0440136051a3277deab3b9f952f8363fcae79a7f | [
"Apache-2.0"
] | 8 | 2019-03-31T05:11:31.000Z | 2021-04-07T13:15:42.000Z | Machine_Learning_and_Parallel_Computing/FINAL_MLP_MAXMIN/m3.py | AlexKnightDu/Lessons | 0440136051a3277deab3b9f952f8363fcae79a7f | [
"Apache-2.0"
] | null | null | null | Machine_Learning_and_Parallel_Computing/FINAL_MLP_MAXMIN/m3.py | AlexKnightDu/Lessons | 0440136051a3277deab3b9f952f8363fcae79a7f | [
"Apache-2.0"
] | 2 | 2021-03-27T04:14:58.000Z | 2021-04-07T13:15:53.000Z | import tensorflow as tf
import numpy as np
import scipy.io as scio
import math as ma
import multiprocessing as mp
from tensorflow.contrib import layers
import time
import os
main()
| 33.308772 | 122 | 0.577689 | import tensorflow as tf
import numpy as np
import scipy.io as scio
import math as ma
import multiprocessing as mp
from tensorflow.contrib import layers
import time
import os
def next_batch(data, label, batch_size):
index = np.arange(len(data))
np.random.shuffle(index)
index = index[0:batch_size]
batch... | 9,061 | 0 | 227 |
b704c27ade50c487c10e4d1d92a82ae4c3a82117 | 1,036 | py | Python | keras_vgg.py | DiNOV-Tokyo/uied-d | c15d7e003dda13c24cfd0c17b4efb058dcc3b292 | [
"Apache-2.0"
] | null | null | null | keras_vgg.py | DiNOV-Tokyo/uied-d | c15d7e003dda13c24cfd0c17b4efb058dcc3b292 | [
"Apache-2.0"
] | null | null | null | keras_vgg.py | DiNOV-Tokyo/uied-d | c15d7e003dda13c24cfd0c17b4efb058dcc3b292 | [
"Apache-2.0"
] | null | null | null | from keras.preprocessing import image
import requests
import numpy as np
from keras.applications.vgg16 import VGG16, preprocess_input, decode_predictions
model = VGG16(include_top=True, weights='imagenet', input_tensor=None, input_shape=None)
model.summary()
#画像をダンロードするための関数
if __name__ == '__main__':
#画像のダウ... | 27.263158 | 88 | 0.700772 | from keras.preprocessing import image
import requests
import numpy as np
from keras.applications.vgg16 import VGG16, preprocess_input, decode_predictions
model = VGG16(include_top=True, weights='imagenet', input_tensor=None, input_shape=None)
model.summary()
#画像をダンロードするための関数
def download_img(url, file_name):
r... | 152 | 0 | 22 |
49a7170160a3706f9f9ada4a2e282be0e2cf8679 | 1,995 | py | Python | qcengine/programs/cfour/keywords.py | jhrmnn/QCEngine | 141fcc7872068936d9eacb0ac546563829d4103d | [
"BSD-3-Clause"
] | null | null | null | qcengine/programs/cfour/keywords.py | jhrmnn/QCEngine | 141fcc7872068936d9eacb0ac546563829d4103d | [
"BSD-3-Clause"
] | 1 | 2021-04-09T16:17:53.000Z | 2021-04-09T16:17:53.000Z | qcengine/programs/cfour/keywords.py | jhrmnn/QCEngine | 141fcc7872068936d9eacb0ac546563829d4103d | [
"BSD-3-Clause"
] | null | null | null | from typing import Any, Dict, Tuple
from qcengine.exceptions import InputError
def format_keywords(keywords: Dict[str, Any]) -> str:
"""Form keywords deck from dictionary `keywords` where keys are CFOUR keyword ("__" separating
any nested-module keywords) strings and values are Python formatted.
"""
... | 29.776119 | 98 | 0.541353 | from typing import Any, Dict, Tuple
from qcengine.exceptions import InputError
def format_keywords(keywords: Dict[str, Any]) -> str:
"""Form keywords deck from dictionary `keywords` where keys are CFOUR keyword ("__" separating
any nested-module keywords) strings and values are Python formatted.
"""
... | 0 | 0 | 0 |
cebc3e0c1da62804ea1c732351e20ef80090b70c | 353 | py | Python | tests/audio/encode_test.py | MulberryBeacon/anarky | 54684e4422d36c6ea3c0bb3fab5af56002864690 | [
"MIT"
] | 1 | 2015-05-12T13:05:04.000Z | 2015-05-12T13:05:04.000Z | tests/audio/encode_test.py | MulberryBeacon/anarky | 54684e4422d36c6ea3c0bb3fab5af56002864690 | [
"MIT"
] | null | null | null | tests/audio/encode_test.py | MulberryBeacon/anarky | 54684e4422d36c6ea3c0bb3fab5af56002864690 | [
"MIT"
] | null | null | null | # -*- coding: utf8 -*-
"""
Tests for the encoding library.
Author: Eduardo Ferreira
License: MIT (see LICENSE for details)
"""
import unittest
class EncodeTests(unittest.TestCase):
"""
Tests for the encoding library.
"""
def test_dummy(self):
"""
Dummy test method.
"""
... | 15.347826 | 38 | 0.606232 | # -*- coding: utf8 -*-
"""
Tests for the encoding library.
Author: Eduardo Ferreira
License: MIT (see LICENSE for details)
"""
import unittest
class EncodeTests(unittest.TestCase):
"""
Tests for the encoding library.
"""
def test_dummy(self):
"""
Dummy test method.
"""
... | 0 | 0 | 0 |
f0f856c955d4d13afe98f22773552b965f9e4084 | 869 | py | Python | configcrunch/tests/acceptance/merging_easy_test.py | Parakoopa/configcrunch | 18f1a73bf62b2d15b4822072e222d2881f9ac350 | [
"MIT"
] | 1 | 2019-10-06T07:26:38.000Z | 2019-10-06T07:26:38.000Z | configcrunch/tests/acceptance/merging_easy_test.py | Parakoopa/configcrunch | 18f1a73bf62b2d15b4822072e222d2881f9ac350 | [
"MIT"
] | 1 | 2020-02-03T10:43:26.000Z | 2020-02-03T12:29:16.000Z | configcrunch/tests/acceptance/merging_easy_test.py | Parakoopa/configcrunch | 18f1a73bf62b2d15b4822072e222d2881f9ac350 | [
"MIT"
] | null | null | null | from configcrunch.tests.acceptance.testcases import ConfigcrunchTestCase
| 28.966667 | 72 | 0.654776 | from configcrunch.tests.acceptance.testcases import ConfigcrunchTestCase
class MergingEasyTest(ConfigcrunchTestCase):
@classmethod
def fixture_name(cls):
return 'merging_easy'
def test_same(self):
self.assertDocEqualMerging(
'easy_expected.yml',
'easy.yml',
... | 625 | 147 | 23 |
06cab0bf174065b88bc4f54fedb44b33155aff6d | 1,634 | py | Python | api/server/swagger_server/code_templates/run_component.TEMPLATE.py | krishnakumar27/mlx | dce67d58dffa24ca7a6a4d6b5fd8d4eb94e35215 | [
"Apache-2.0"
] | 98 | 2021-05-03T23:27:53.000Z | 2022-03-13T02:29:12.000Z | api/server/swagger_server/code_templates/run_component.TEMPLATE.py | krishnakumar27/mlx | dce67d58dffa24ca7a6a4d6b5fd8d4eb94e35215 | [
"Apache-2.0"
] | 296 | 2021-05-03T22:44:26.000Z | 2022-03-31T11:50:16.000Z | api/server/swagger_server/code_templates/run_component.TEMPLATE.py | krishnakumar27/mlx | dce67d58dffa24ca7a6a4d6b5fd8d4eb94e35215 | [
"Apache-2.0"
] | 38 | 2021-05-03T22:52:59.000Z | 2022-03-31T03:58:34.000Z | # Copyright 2021 The MLX Contributors
#
# SPDX-License-Identifier: Apache-2.0
from kfp import dsl
from kfp_tekton.compiler import TektonCompiler
from kfp_tekton import TektonClient
from os import path
from tempfile import gettempdir
############################################################
# Define ... | 29.178571 | 87 | 0.571603 | # Copyright 2021 The MLX Contributors
#
# SPDX-License-Identifier: Apache-2.0
from kfp import dsl
from kfp_tekton.compiler import TektonCompiler
from kfp_tekton import TektonClient
from os import path
from tempfile import gettempdir
############################################################
# Define ... | 207 | 0 | 22 |
4871f033380bcbe552045d9126e22993ef5c608c | 98 | py | Python | monobank_api/__init__.py | edicasoft/monobank-api | 111ec0d7b4c8e43e2594a554b8d7e61c0da1f4f5 | [
"MIT"
] | 3 | 2019-12-25T11:23:16.000Z | 2021-07-15T08:28:53.000Z | monobank_api/__init__.py | edicasoft/monobank-api | 111ec0d7b4c8e43e2594a554b8d7e61c0da1f4f5 | [
"MIT"
] | null | null | null | monobank_api/__init__.py | edicasoft/monobank-api | 111ec0d7b4c8e43e2594a554b8d7e61c0da1f4f5 | [
"MIT"
] | null | null | null | from .client import BaseAPI, CorporateAPI, PersonalAPI
from .errors import Error, TooManyRequests
| 32.666667 | 54 | 0.836735 | from .client import BaseAPI, CorporateAPI, PersonalAPI
from .errors import Error, TooManyRequests
| 0 | 0 | 0 |
b7ff078dd5c9962b18391c49ebf4aa707645e21e | 849 | py | Python | main.py | kseniia-grishchenko/parsing-python | b0d1dde671ab6ed012245393a782cd476d27b411 | [
"Apache-2.0"
] | null | null | null | main.py | kseniia-grishchenko/parsing-python | b0d1dde671ab6ed012245393a782cd476d27b411 | [
"Apache-2.0"
] | null | null | null | main.py | kseniia-grishchenko/parsing-python | b0d1dde671ab6ed012245393a782cd476d27b411 | [
"Apache-2.0"
] | null | null | null | from parse_one_paged import parse_one_paged
AVAILABLE_SITES = [
{
'name': 'make up',
'url': 'https://makeup.com.ua/brand/1771098/',
'product_class': '.simple-slider-list__link',
'name_class': '.simple-slider-list__name',
'price_class': '.simple-slider-list__price',
'... | 29.275862 | 136 | 0.592462 | from parse_one_paged import parse_one_paged
AVAILABLE_SITES = [
{
'name': 'make up',
'url': 'https://makeup.com.ua/brand/1771098/',
'product_class': '.simple-slider-list__link',
'name_class': '.simple-slider-list__name',
'price_class': '.simple-slider-list__price',
'... | 270 | 0 | 23 |
7e5bfbbc8e01103fdb4513a01af0ad749b68be83 | 58 | py | Python | services/keywords/constants.py | jaimehisao/major-tom | e991616deb6fc6d86ff3752c4b2136578b3d11f3 | [
"Apache-2.0"
] | 6 | 2020-07-15T18:28:38.000Z | 2021-04-20T13:39:26.000Z | services/keywords/constants.py | jaimehisao/major-tom | e991616deb6fc6d86ff3752c4b2136578b3d11f3 | [
"Apache-2.0"
] | 61 | 2020-07-20T21:52:59.000Z | 2021-06-18T16:53:34.000Z | services/keywords/constants.py | jaimehisao/major-tom | e991616deb6fc6d86ff3752c4b2136578b3d11f3 | [
"Apache-2.0"
] | 10 | 2020-07-17T21:44:09.000Z | 2021-04-26T22:53:33.000Z | KEY_PARTS_OF_SPEECH = ["ADJ", "NOUN", "NUM", "VERB", "X"]
| 29 | 57 | 0.586207 | KEY_PARTS_OF_SPEECH = ["ADJ", "NOUN", "NUM", "VERB", "X"]
| 0 | 0 | 0 |
b56dbf0e39ffc9443c9b0eacfc47c257aab4af41 | 12,678 | py | Python | demo_data_process.py | Milton-Hu/Human-Pose-Estimation-and-Evaluation-for-Rehabilitation | d559ac1a43041e4dc6bf9452d47860c1afe0ce56 | [
"Apache-2.0"
] | null | null | null | demo_data_process.py | Milton-Hu/Human-Pose-Estimation-and-Evaluation-for-Rehabilitation | d559ac1a43041e4dc6bf9452d47860c1afe0ce56 | [
"Apache-2.0"
] | null | null | null | demo_data_process.py | Milton-Hu/Human-Pose-Estimation-and-Evaluation-for-Rehabilitation | d559ac1a43041e4dc6bf9452d47860c1afe0ce56 | [
"Apache-2.0"
] | null | null | null | # 绘图相关包
from PyQt5.Qt import *
from pyqtgraph import PlotWidget
from PyQt5 import QtCore
import numpy as np
import pyqtgraph as pq
# 绘图相关包
import cv2
import math
import torch
import pyrealsense2 as rs
#人体姿态估计相关包
from models.with_mobilenet import PoseEstimationWithMobileNet
from modules.keypoints import... | 44.020833 | 214 | 0.624862 | # 绘图相关包
from PyQt5.Qt import *
from pyqtgraph import PlotWidget
from PyQt5 import QtCore
import numpy as np
import pyqtgraph as pq
# 绘图相关包
import cv2
import math
import torch
import pyrealsense2 as rs
#人体姿态估计相关包
from models.with_mobilenet import PoseEstimationWithMobileNet
from modules.keypoints import... | 11,798 | 1 | 240 |
6b7ea80d74bd122a5019eb14a389e7445ba04672 | 532 | py | Python | Exercicio41a50/ex041.py | ItamarHavenstein/Python | fe536302aea00a4a898e0f54f5b9fa6aba3301cb | [
"MIT"
] | null | null | null | Exercicio41a50/ex041.py | ItamarHavenstein/Python | fe536302aea00a4a898e0f54f5b9fa6aba3301cb | [
"MIT"
] | null | null | null | Exercicio41a50/ex041.py | ItamarHavenstein/Python | fe536302aea00a4a898e0f54f5b9fa6aba3301cb | [
"MIT"
] | null | null | null | import datetime
nascimento = int(input('Digite seu ano de nascimento: '))
anoAtual = datetime.date.today().year
idade = anoAtual - nascimento
print('A idade do atleta é {}'.format(idade))
if idade <= 9:
print('A categoria do atleta é MIRIM')
elif idade > 9 and idade <= 14:
print('A categoria do atleta é INF... | 26.6 | 57 | 0.684211 | import datetime
nascimento = int(input('Digite seu ano de nascimento: '))
anoAtual = datetime.date.today().year
idade = anoAtual - nascimento
print('A idade do atleta é {}'.format(idade))
if idade <= 9:
print('A categoria do atleta é MIRIM')
elif idade > 9 and idade <= 14:
print('A categoria do atleta é INF... | 0 | 0 | 0 |
c570c4bbc8d1f3c0e2b8593b955f43f6512aace4 | 1,731 | py | Python | wikigame/test_csv_data_extracter.py | danieldourado/camara-mirim-crawler | a00476a6b85acd788265f1be05e5c4dff7c63226 | [
"MIT"
] | null | null | null | wikigame/test_csv_data_extracter.py | danieldourado/camara-mirim-crawler | a00476a6b85acd788265f1be05e5c4dff7c63226 | [
"MIT"
] | 21 | 2019-12-26T16:41:19.000Z | 2022-03-21T22:16:22.000Z | wikigame/test_csv_data_extracter.py | danieldourado/plenarinho-util | a00476a6b85acd788265f1be05e5c4dff7c63226 | [
"MIT"
] | null | null | null | from django.test import TestCase
from .models import WikiGame, WikiTermos
from .csv_data_extracter import extract_data_from_csv, save_termos, save_wikigame, extract_termos_from_string, refresh_wikigame_model | 45.552632 | 163 | 0.671288 | from django.test import TestCase
from .models import WikiGame, WikiTermos
from .csv_data_extracter import extract_data_from_csv, save_termos, save_wikigame, extract_termos_from_string, refresh_wikigame_model
class CSVDETestCase(TestCase):
mockup = {}
def setUp(self):
self.mockup = [
{"termo... | 1,295 | 214 | 23 |
b46218f0c0260e786fb670c6e75ded1567d9cbcd | 1,160 | py | Python | Learning Unittests/matplotlib-tutorial-master/scripts/rain-static.py | BethWIntera/Beths_PySandbox | 6fb1d41353d29be4f7142c722cce8ec9872863e4 | [
"TCL",
"SWL",
"MIT",
"X11",
"BSD-3-Clause"
] | 6 | 2019-10-22T19:45:51.000Z | 2022-02-13T11:11:37.000Z | resources/Rougier Tutorial/scripts/rain-static.py | nstarman/2019-10-22-dotAstronomy-Plotting-Workshop | 31e1a10b3d0f051a2cd197ce390bcf96753f153c | [
"MIT"
] | 5 | 2019-11-15T02:00:26.000Z | 2021-01-06T04:26:40.000Z | resources/Rougier Tutorial/scripts/rain-static.py | nstarman/2019-10-22-dotAstronomy-Plotting-Workshop | 31e1a10b3d0f051a2cd197ce390bcf96753f153c | [
"MIT"
] | null | null | null | # -----------------------------------------------------------------------------
# Copyright (c) 2015, Nicolas P. Rougier. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -----------------------------------------------------------------------------
import numpy as np
impo... | 28.292683 | 79 | 0.57069 | # -----------------------------------------------------------------------------
# Copyright (c) 2015, Nicolas P. Rougier. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -----------------------------------------------------------------------------
import numpy as np
impo... | 0 | 0 | 0 |
76f9fcd8cbfb281fd98572b67802852dd900e5e0 | 328 | py | Python | app/tests/test_main.py | BrianThomasRoss/ds-bw | e2dcb909d48cdbcb5918e16ae26b0d1a70c1c36c | [
"MIT"
] | null | null | null | app/tests/test_main.py | BrianThomasRoss/ds-bw | e2dcb909d48cdbcb5918e16ae26b0d1a70c1c36c | [
"MIT"
] | null | null | null | app/tests/test_main.py | BrianThomasRoss/ds-bw | e2dcb909d48cdbcb5918e16ae26b0d1a70c1c36c | [
"MIT"
] | null | null | null | """Main application unittests."""
from fastapi.testclient import TestClient
from app.main import app
client = TestClient(app)
def test_docs():
"""Return HTML docs for root route."""
response = client.get('/')
assert response.status_code == 200
assert response.headers['content-type'].startswith('text... | 23.428571 | 67 | 0.710366 | """Main application unittests."""
from fastapi.testclient import TestClient
from app.main import app
client = TestClient(app)
def test_docs():
"""Return HTML docs for root route."""
response = client.get('/')
assert response.status_code == 200
assert response.headers['content-type'].startswith('text... | 0 | 0 | 0 |
7da5914781a84876cf010359d3fd910b3fd35a8f | 189 | py | Python | data_collection/gazette/spiders/sc_saltinho.py | Jefersonalves/diario-oficial | 9a4bdfe2e31414c993d88831a67160c49a5ee657 | [
"MIT"
] | 3 | 2021-08-18T17:50:31.000Z | 2021-11-12T23:36:33.000Z | data_collection/gazette/spiders/sc_saltinho.py | Jefersonalves/diario-oficial | 9a4bdfe2e31414c993d88831a67160c49a5ee657 | [
"MIT"
] | 4 | 2021-02-10T02:36:48.000Z | 2022-03-02T14:55:34.000Z | data_collection/gazette/spiders/sc_saltinho.py | Jefersonalves/diario-oficial | 9a4bdfe2e31414c993d88831a67160c49a5ee657 | [
"MIT"
] | null | null | null | from gazette.spiders.base import FecamGazetteSpider
| 23.625 | 51 | 0.767196 | from gazette.spiders.base import FecamGazetteSpider
class ScSaltinhoSpider(FecamGazetteSpider):
name = "sc_saltinho"
FECAM_QUERY = "cod_entidade:228"
TERRITORY_ID = "4215356"
| 0 | 113 | 23 |
e5daec4c060e5b408bdc03a6009a4ee4f7ac2cd8 | 3,340 | py | Python | services/Runner/externalServices/manager.py | muhammad-abbady/JenTab | df7b1450cb14e64edade30ea7de49d05a7d7dbf2 | [
"Apache-2.0"
] | 9 | 2021-03-23T11:32:40.000Z | 2022-03-31T13:58:41.000Z | services/Runner/externalServices/manager.py | muhammad-abbady/JenTab | df7b1450cb14e64edade30ea7de49d05a7d7dbf2 | [
"Apache-2.0"
] | null | null | null | services/Runner/externalServices/manager.py | muhammad-abbady/JenTab | df7b1450cb14e64edade30ea7de49d05a7d7dbf2 | [
"Apache-2.0"
] | 1 | 2021-04-29T21:27:08.000Z | 2021-04-29T21:27:08.000Z | import config
import json
import traceback
import requests
# maximum length of an error message to be stored
# excessive error messages might make it properly to the manager
MAX_ERROR_LENGTH = 2 * 1024 * 1024
# create an instance for export
Manager = Manager_Service()
| 33.069307 | 85 | 0.596407 | import config
import json
import traceback
import requests
# maximum length of an error message to be stored
# excessive error messages might make it properly to the manager
MAX_ERROR_LENGTH = 2 * 1024 * 1024
class Manager_Service():
root = config.manager_url
def get_work(self):
"""retrieve a new w... | 0 | 3,044 | 23 |
bdf7197d3017603e7d978b7cd8b575326cdce351 | 2,400 | py | Python | bld2repo/bld2repo/cli.py | ppisar/modulemd-tools | 1296439248e14fe3b2e17a2141975e68d3dc9be1 | [
"MIT"
] | 23 | 2020-07-26T14:49:46.000Z | 2022-03-30T03:38:41.000Z | bld2repo/bld2repo/cli.py | ppisar/modulemd-tools | 1296439248e14fe3b2e17a2141975e68d3dc9be1 | [
"MIT"
] | 44 | 2020-06-25T12:59:51.000Z | 2022-03-31T11:45:31.000Z | bld2repo/bld2repo/cli.py | ppisar/modulemd-tools | 1296439248e14fe3b2e17a2141975e68d3dc9be1 | [
"MIT"
] | 13 | 2020-06-25T12:53:16.000Z | 2021-09-06T06:25:54.000Z | import argparse
import os
from bld2repo import (get_buildrequire_pkgs_from_build, add_rpm_urls, rpm_bulk_download,
create_repo)
from bld2repo.config import Config
from bld2repo.utils import get_koji_session
if __name__ == "__main__":
main()
| 40.677966 | 98 | 0.642083 | import argparse
import os
from bld2repo import (get_buildrequire_pkgs_from_build, add_rpm_urls, rpm_bulk_download,
create_repo)
from bld2repo.config import Config
from bld2repo.utils import get_koji_session
def get_arg_parser():
description = (
"When provided with a build id it will... | 2,081 | 0 | 46 |
5eba01cc06175f5868b76bf826bf0d4381e28d47 | 1,101 | py | Python | sandbox/finetuning/envs/mujoco/gather/swimmer_gather_unevenfloor_env.py | andrewli77/rllab-finetuning | 2dae9141d0fdc284d04f18931907131d66b43023 | [
"MIT"
] | 23 | 2020-04-27T23:53:44.000Z | 2022-03-10T03:13:16.000Z | sandbox/finetuning/envs/mujoco/gather/swimmer_gather_unevenfloor_env.py | WeiChengTseng/rllab-finetuning | 2dae9141d0fdc284d04f18931907131d66b43023 | [
"MIT"
] | 1 | 2021-11-14T13:30:22.000Z | 2021-11-14T13:30:22.000Z | sandbox/finetuning/envs/mujoco/gather/swimmer_gather_unevenfloor_env.py | WeiChengTseng/rllab-finetuning | 2dae9141d0fdc284d04f18931907131d66b43023 | [
"MIT"
] | 8 | 2020-06-17T03:28:34.000Z | 2022-03-09T03:13:03.000Z | from rllab.envs.mujoco.gather.gather_env import GatherEnv
from sandbox.finetuning.envs.mujoco.swimmer_unevenfloor_env import SwimmerUnevenFloorEnv
if __name__ == "__main__":
env = SwimmerGatherUnevenFloorEnv()
while True:
env.reset()
for _ in range(1000):
env.render()
_... | 33.363636 | 89 | 0.660309 | from rllab.envs.mujoco.gather.gather_env import GatherEnv
from sandbox.finetuning.envs.mujoco.swimmer_unevenfloor_env import SwimmerUnevenFloorEnv
class SwimmerGatherUnevenFloorEnv(GatherEnv):
MODEL_CLASS = SwimmerUnevenFloorEnv
ORI_IND = 2
if __name__ == "__main__":
env = SwimmerGatherUnevenFloorEnv()
... | 0 | 81 | 23 |
f044b60a0ff24131432e7e5141763c3749fa4897 | 210 | py | Python | django_easy_ajax/urls.py | ApptecSrl/django-easy-ajax | 4931ab1aa51564bfda7328665cb5b078b6f5b132 | [
"BSD-3-Clause"
] | null | null | null | django_easy_ajax/urls.py | ApptecSrl/django-easy-ajax | 4931ab1aa51564bfda7328665cb5b078b6f5b132 | [
"BSD-3-Clause"
] | null | null | null | django_easy_ajax/urls.py | ApptecSrl/django-easy-ajax | 4931ab1aa51564bfda7328665cb5b078b6f5b132 | [
"BSD-3-Clause"
] | null | null | null | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^(?P<strategy_name>[-\w]+)/(?P<pk>\d+)/$', views.AjaxBaseSerializedView.as_view(),
name='django-easy-ajax-selector'),
]
| 21 | 92 | 0.647619 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^(?P<strategy_name>[-\w]+)/(?P<pk>\d+)/$', views.AjaxBaseSerializedView.as_view(),
name='django-easy-ajax-selector'),
]
| 0 | 0 | 0 |
5887dcecd81a99876c5c5c6ee478e6117c74d657 | 23,348 | py | Python | rayMarchRenderer.py | s-neilson/Python-ray-march-renderer | c3850336686a4853c9658f2dff49566e71872470 | [
"MIT"
] | null | null | null | rayMarchRenderer.py | s-neilson/Python-ray-march-renderer | c3850336686a4853c9658f2dff49566e71872470 | [
"MIT"
] | null | null | null | rayMarchRenderer.py | s-neilson/Python-ray-march-renderer | c3850336686a4853c9658f2dff49566e71872470 | [
"MIT"
] | null | null | null | import copy
import math
import numpy
from tqdm import tqdm
import matplotlib.pyplot as plt
#A class for three-dimentional vector operations; using numpy arrays and their operations was found to be slower.
#Returns the unit vector pointing from the location represented by fromVector to the lo... | 64.6759 | 229 | 0.710853 | import copy
import math
import numpy
from tqdm import tqdm
import matplotlib.pyplot as plt
#A class for three-dimentional vector operations; using numpy arrays and their operations was found to be slower.
class Vector3D():
x=0.0
y=0.0
z=0.0
def __init__(self,x,y,z):
self.x=x... | 17,001 | 1,780 | 165 |
ce0779ba605786061035545a0272a055142dc5cc | 1,484 | py | Python | calc-s3-etag.py | aws-samples/calc-s3-etag | 09609ec170adce0ada5dfb73eb0f548f4d0dd3e2 | [
"MIT-0"
] | null | null | null | calc-s3-etag.py | aws-samples/calc-s3-etag | 09609ec170adce0ada5dfb73eb0f548f4d0dd3e2 | [
"MIT-0"
] | null | null | null | calc-s3-etag.py | aws-samples/calc-s3-etag | 09609ec170adce0ada5dfb73eb0f548f4d0dd3e2 | [
"MIT-0"
] | 1 | 2021-06-10T19:01:33.000Z | 2021-06-10T19:01:33.000Z | #// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
#// SPDX-License-Identifier: MIT-0
import sys
import hashlib
if len(sys.argv) !=3:
print("Usage: calc-s3-etag.py {file} {multipart-transfer size}")
print("")
print("Multipart transfersize may be gotten by referencing the .aws/config fil... | 41.222222 | 174 | 0.66779 | #// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
#// SPDX-License-Identifier: MIT-0
import sys
import hashlib
def calculate_s3_etag(file_path, chunk_size):
md5s = []
with open(file_path, 'rb') as fp:
while True:
data = fp.read(chunk_size)
if not data:
... | 532 | 0 | 23 |
72ce4745976e9c1bb7896987be9ec2993372dc7b | 173 | py | Python | startmicro/__init__.py | munisisazade/startmicro | 4c74f41a31a6bef9aaa09586628e8427a7d68851 | [
"MIT"
] | 1 | 2019-09-27T10:23:24.000Z | 2019-09-27T10:23:24.000Z | startmicro/__init__.py | munisisazade/startmicro | 4c74f41a31a6bef9aaa09586628e8427a7d68851 | [
"MIT"
] | 1 | 2020-09-01T06:50:19.000Z | 2020-09-01T06:50:19.000Z | startmicro/__init__.py | munisisazade/startmicro | 4c74f41a31a6bef9aaa09586628e8427a7d68851 | [
"MIT"
] | null | null | null | from startmicro.utils.version import get_version
VERSION = (0, 0, 6, 'alpha', 0)
__version__ = get_version(VERSION)
__author__ = "Munis Isazade <munisisazade@gmail.com>"
| 21.625 | 53 | 0.751445 | from startmicro.utils.version import get_version
VERSION = (0, 0, 6, 'alpha', 0)
__version__ = get_version(VERSION)
__author__ = "Munis Isazade <munisisazade@gmail.com>"
| 0 | 0 | 0 |
1b7fd39603cccc95e49b6ce348febb847840ef6b | 1,138 | py | Python | PoC1/exploit_offset.py | gcheca/exploits | 452b0b65fd549b14fec48a0d22dfe5227c9383a5 | [
"MIT"
] | null | null | null | PoC1/exploit_offset.py | gcheca/exploits | 452b0b65fd549b14fec48a0d22dfe5227c9383a5 | [
"MIT"
] | null | null | null | PoC1/exploit_offset.py | gcheca/exploits | 452b0b65fd549b14fec48a0d22dfe5227c9383a5 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import socket
try:
print "\n Sending ""evil"" buffer..."
padding = "A" * 780
eip = "B" * 4
buffer = "C" * 16
payload = padding + eip + buffer
content = "username=" + payload + "&password=A"
buffer = "POST /login HTTP/1.1\r\n"
buffer += "Host: 192.168.1.1\r\n"
buf... | 28.45 | 104 | 0.581722 | #!/usr/bin/python
import socket
try:
print "\n Sending ""evil"" buffer..."
padding = "A" * 780
eip = "B" * 4
buffer = "C" * 16
payload = padding + eip + buffer
content = "username=" + payload + "&password=A"
buffer = "POST /login HTTP/1.1\r\n"
buffer += "Host: 192.168.1.1\r\n"
buf... | 0 | 0 | 0 |
9a1dfacdee354f4a82f68846e5e83586c85bed27 | 7,323 | py | Python | core/base_model.py | Janspiry/distributed-pytorch-template | 8b612c8877d4ec3ffba28fcb3bc1ccfda44b6c10 | [
"MIT"
] | 3 | 2022-01-30T07:10:02.000Z | 2022-02-11T10:16:43.000Z | core/base_model.py | Janspiry/A-Seed-Project-For-Deep-Learning-by-Pytorch | 8b612c8877d4ec3ffba28fcb3bc1ccfda44b6c10 | [
"MIT"
] | null | null | null | core/base_model.py | Janspiry/A-Seed-Project-For-Deep-Learning-by-Pytorch | 8b612c8877d4ec3ffba28fcb3bc1ccfda44b6c10 | [
"MIT"
] | null | null | null | import os
from abc import abstractmethod
from functools import partial
import collections
import torch
import torch.nn as nn
import core.util as Util
from core.logger import LogTracker
CustomResult = collections.namedtuple('CustomResult', 'name result')
| 47.245161 | 156 | 0.62092 | import os
from abc import abstractmethod
from functools import partial
import collections
import torch
import torch.nn as nn
import core.util as Util
from core.logger import LogTracker
CustomResult = collections.namedtuple('CustomResult', 'name result')
class BaseModel():
def __init__(self, opt, phase_loader, v... | 2,606 | 4,438 | 23 |
a9b8a1cbfc37583a3c3b3265e5a00f579fd39128 | 3,300 | py | Python | scripts/evaluate_glas.py | mRcfps/wessup | b27052fc969ac60b443d340d7d10b28605b790a0 | [
"MIT"
] | 8 | 2020-03-01T05:56:49.000Z | 2022-02-12T14:38:42.000Z | scripts/evaluate_glas.py | mRcfps/wessup | b27052fc969ac60b443d340d7d10b28605b790a0 | [
"MIT"
] | null | null | null | scripts/evaluate_glas.py | mRcfps/wessup | b27052fc969ac60b443d340d7d10b28605b790a0 | [
"MIT"
] | 5 | 2020-02-29T01:49:33.000Z | 2022-02-03T20:20:32.000Z | import argparse
import os
from pathlib import Path
import sys
sys.path.append(str(Path(__file__).parent.parent))
import pandas as pd
from skimage.io import imread, imsave
from joblib import Parallel, delayed
from utils.metrics import *
parser = argparse.ArgumentParser()
parser.add_argument('pred_root')
args = parse... | 33.333333 | 109 | 0.706364 | import argparse
import os
from pathlib import Path
import sys
sys.path.append(str(Path(__file__).parent.parent))
import pandas as pd
from skimage.io import imread, imsave
from joblib import Parallel, delayed
from utils.metrics import *
parser = argparse.ArgumentParser()
parser.add_argument('pred_root')
args = parse... | 1,378 | 0 | 46 |
7c8578fa5f45ed4663d04f117ce01c5ce38b800d | 16,745 | py | Python | stella/rotations.py | afeinstein20/sally | f9ffd78d1c7279012e870f3657812595f18eee74 | [
"MIT"
] | 22 | 2019-06-27T19:43:48.000Z | 2022-03-24T21:32:20.000Z | stella/rotations.py | afeinstein20/sally | f9ffd78d1c7279012e870f3657812595f18eee74 | [
"MIT"
] | 16 | 2020-05-21T22:26:51.000Z | 2022-03-21T13:23:37.000Z | stella/rotations.py | afeinstein20/sally | f9ffd78d1c7279012e870f3657812595f18eee74 | [
"MIT"
] | 11 | 2019-07-19T16:41:15.000Z | 2022-03-11T21:49:04.000Z | import numpy as np
from tqdm import tqdm
import statistics as stats
from astropy import units as u
from scipy.signal import medfilt
from scipy.optimize import curve_fit
from astropy.table import Table, Column
from astropy.timeseries import LombScargle
__all__ = ['MeasureProt']
class MeasureProt(object):
"""
U... | 35.476695 | 97 | 0.478232 | import numpy as np
from tqdm import tqdm
import statistics as stats
from astropy import units as u
from scipy.signal import medfilt
from scipy.optimize import curve_fit
from astropy.table import Table, Column
from astropy.timeseries import LombScargle
__all__ = ['MeasureProt']
class MeasureProt(object):
"""
U... | 3,082 | 0 | 120 |
70dbecde69f5350b76c86a87b6e8a98005d66126 | 4,777 | py | Python | api/routes/flashcard.py | axxander/FlashcardAPI | b7221aa567b2c59700813a3cab46d58ca7897086 | [
"MIT"
] | null | null | null | api/routes/flashcard.py | axxander/FlashcardAPI | b7221aa567b2c59700813a3cab46d58ca7897086 | [
"MIT"
] | null | null | null | api/routes/flashcard.py | axxander/FlashcardAPI | b7221aa567b2c59700813a3cab46d58ca7897086 | [
"MIT"
] | null | null | null | from typing import List
from fastapi import APIRouter, Depends, HTTPException, status
from app import schemas, models
from app.services.jwt import get_current_user
router = APIRouter(
prefix="/flashcard",
tags=["flashcard"]
)
# Create new flashcard
@router.post("/", response_model=schemas.Flashcard)
# L... | 29.487654 | 87 | 0.6973 | from typing import List
from fastapi import APIRouter, Depends, HTTPException, status
from app import schemas, models
from app.services.jwt import get_current_user
router = APIRouter(
prefix="/flashcard",
tags=["flashcard"]
)
# Create new flashcard
@router.post("/", response_model=schemas.Flashcard)
async... | 3,636 | 0 | 176 |
8efe44c0c18ac4acd87d73e2cad4d86b35c3048e | 1,654 | py | Python | ws2122-lspm/Lib/site-packages/pm4py/evaluation/wf_net/evaluator.py | Malekhy/ws2122-lspm | e4dc8b801d12f862b8ef536a0f125f346f085a00 | [
"MIT"
] | 1 | 2022-01-19T04:02:46.000Z | 2022-01-19T04:02:46.000Z | ws2122-lspm/Lib/site-packages/pm4py/evaluation/wf_net/evaluator.py | Malekhy/ws2122-lspm | e4dc8b801d12f862b8ef536a0f125f346f085a00 | [
"MIT"
] | 1 | 2021-11-19T07:21:48.000Z | 2021-11-19T07:21:48.000Z | ws2122-lspm/Lib/site-packages/pm4py/evaluation/wf_net/evaluator.py | Malekhy/ws2122-lspm | e4dc8b801d12f862b8ef536a0f125f346f085a00 | [
"MIT"
] | 1 | 2022-01-14T17:15:38.000Z | 2022-01-14T17:15:38.000Z | '''
This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de).
PM4Py is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any late... | 31.207547 | 102 | 0.696493 | '''
This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de).
PM4Py is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any late... | 550 | 26 | 45 |
cee50dbaf550492b0b7a5acbd949e37a38288f3b | 801 | py | Python | src/zzsn2021/utils/rundir.py | 2021L-ZZSN/template | 0cea7744701bb702d563acbf0cbd9ecf371f45bf | [
"MIT"
] | null | null | null | src/zzsn2021/utils/rundir.py | 2021L-ZZSN/template | 0cea7744701bb702d563acbf0cbd9ecf371f45bf | [
"MIT"
] | null | null | null | src/zzsn2021/utils/rundir.py | 2021L-ZZSN/template | 0cea7744701bb702d563acbf0cbd9ecf371f45bf | [
"MIT"
] | 1 | 2021-05-09T21:27:39.000Z | 2021-05-09T21:27:39.000Z | from __future__ import annotations
import os
from datetime import datetime
import coolname # type: ignore
from dotenv import load_dotenv
load_dotenv()
def setup_rundir():
"""
Create a working directory with a randomly generated run name.
"""
date = datetime.now().strftime("%Y%m%d-%H%M")
name =... | 27.62069 | 77 | 0.656679 | from __future__ import annotations
import os
from datetime import datetime
import coolname # type: ignore
from dotenv import load_dotenv
load_dotenv()
def setup_rundir():
"""
Create a working directory with a randomly generated run name.
"""
date = datetime.now().strftime("%Y%m%d-%H%M")
name =... | 0 | 0 | 0 |
5ee4f693c91d826992e4ab0a99fcaee72fdb7edb | 2,705 | py | Python | src/configflow/misc/string.py | volodymyrPivoshenko/configflow | 2158c8395c4913b836c2a27e38c51f5ec519323b | [
"MIT"
] | 8 | 2022-01-25T09:06:34.000Z | 2022-03-28T14:55:45.000Z | src/configflow/misc/string.py | volodymyrPivoshenko/configflow | 2158c8395c4913b836c2a27e38c51f5ec519323b | [
"MIT"
] | 23 | 2022-01-23T15:15:00.000Z | 2022-03-28T21:47:15.000Z | src/configflow/misc/string.py | volodymyrPivoshenko/configflow | 2158c8395c4913b836c2a27e38c51f5ec519323b | [
"MIT"
] | 1 | 2022-03-15T21:08:19.000Z | 2022-03-15T21:08:19.000Z | """Module for the string helper functions and primitive data types."""
from __future__ import annotations
import ast
import typing
import apm
# WPS600 - inheritance from the str is the only way to implement correct
# error message with all str functionality
class ErrorMessage(str): # noqa: WPS600
"""Implement... | 29.086022 | 99 | 0.602957 | """Module for the string helper functions and primitive data types."""
from __future__ import annotations
import ast
import typing
import apm
# WPS600 - inheritance from the str is the only way to implement correct
# error message with all str functionality
class ErrorMessage(str): # noqa: WPS600
"""Implement... | 0 | 0 | 0 |
5024b443babb9d5f7f10c485d8a141f2f3c148b8 | 2,403 | py | Python | recipes/Python/510399_Byte_Hex_Hex_Byte_String/recipe-510399.py | tdiprima/code | 61a74f5f93da087d27c70b2efe779ac6bd2a3b4f | [
"MIT"
] | 2,023 | 2017-07-29T09:34:46.000Z | 2022-03-24T08:00:45.000Z | recipes/Python/510399_Byte_Hex_Hex_Byte_String/recipe-510399.py | unhacker/code | 73b09edc1b9850c557a79296655f140ce5e853db | [
"MIT"
] | 32 | 2017-09-02T17:20:08.000Z | 2022-02-11T17:49:37.000Z | recipes/Python/510399_Byte_Hex_Hex_Byte_String/recipe-510399.py | unhacker/code | 73b09edc1b9850c557a79296655f140ce5e853db | [
"MIT"
] | 780 | 2017-07-28T19:23:28.000Z | 2022-03-25T20:39:41.000Z | """
HexByteConversion
Convert a byte string to it's hex representation for output or visa versa.
ByteToHex converts byte string "\xFF\xFE\x00\x01" to the string "FF FE 00 01"
HexToByte converts string "FF FE 00 01" to the byte string "\xFF\xFE\x00\x01"
"""
#-----------------------------------------------------------... | 35.338235 | 90 | 0.554307 | """
HexByteConversion
Convert a byte string to it's hex representation for output or visa versa.
ByteToHex converts byte string "\xFF\xFE\x00\x01" to the string "FF FE 00 01"
HexToByte converts string "FF FE 00 01" to the byte string "\xFF\xFE\x00\x01"
"""
#-----------------------------------------------------------... | 0 | 0 | 0 |
6810b1a32afedd13cfa216ce1724b423ebb45fe3 | 24,325 | py | Python | train_metarcnn.py | Anqw/meta_edge | 3c4b138f85d0c2c13c6cc1ee71e621737b40525c | [
"AFL-1.1"
] | null | null | null | train_metarcnn.py | Anqw/meta_edge | 3c4b138f85d0c2c13c6cc1ee71e621737b40525c | [
"AFL-1.1"
] | null | null | null | train_metarcnn.py | Anqw/meta_edge | 3c4b138f85d0c2c13c6cc1ee71e621737b40525c | [
"AFL-1.1"
] | null | null | null | # --------------------------------------------------------
# Pytorch Meta R-CNN
# Written by Anny Xu, Xiaopeng Yan, based on the code from Jianwei Yang
# --------------------------------------------------------
import _init_paths
import os
import sys
import numpy as np
import argparse
import pprint
import pdb
import ti... | 45.896226 | 147 | 0.575005 | # --------------------------------------------------------
# Pytorch Meta R-CNN
# Written by Anny Xu, Xiaopeng Yan, based on the code from Jianwei Yang
# --------------------------------------------------------
import _init_paths
import os
import sys
import numpy as np
import argparse
import pprint
import pdb
import ti... | 836 | 2 | 103 |
8b572207b8865cd9cdb8ae107f4ea6e1955c9b1c | 16,228 | py | Python | systems/GameGUI.py | itsabugnotafeature/Raiders | 72c20a83c253538a3a41658a78cbc0fe5eca346b | [
"MIT"
] | 1 | 2022-03-27T05:36:44.000Z | 2022-03-27T05:36:44.000Z | systems/GameGUI.py | itsabugnotafeature/Raiders | 72c20a83c253538a3a41658a78cbc0fe5eca346b | [
"MIT"
] | null | null | null | systems/GameGUI.py | itsabugnotafeature/Raiders | 72c20a83c253538a3a41658a78cbc0fe5eca346b | [
"MIT"
] | null | null | null | import scripts.gui_elements
import scripts.tools
from scripts.Colors import Color
from scripts.variables.localvars import *
from systems.BaseSystem import BaseSystem
from scripts import highlights
# HELPER FUNCTIONS #
| 47.311953 | 126 | 0.575857 | import scripts.gui_elements
import scripts.tools
from scripts.Colors import Color
from scripts.variables.localvars import *
from systems.BaseSystem import BaseSystem
from scripts import highlights
class GUI(BaseSystem):
def __init__(self):
self.Engine = None
self.game_vars = {}
self.GUIT... | 15,413 | 1 | 590 |
c5dc6a406b72c855d204ebef2026915104ccb941 | 10,616 | py | Python | system/events/mumble.py | UltrosBot/Ultros | 639efc11f73ebf7e8f47f0554aced00a559d9e2d | [
"Artistic-2.0"
] | 16 | 2015-01-02T00:16:11.000Z | 2019-06-03T06:23:11.000Z | system/events/mumble.py | UltrosBot/Ultros | 639efc11f73ebf7e8f47f0554aced00a559d9e2d | [
"Artistic-2.0"
] | 31 | 2015-01-18T12:14:53.000Z | 2018-01-07T13:32:29.000Z | system/events/mumble.py | UltrosBot/Ultros | 639efc11f73ebf7e8f47f0554aced00a559d9e2d | [
"Artistic-2.0"
] | 9 | 2015-02-13T09:38:53.000Z | 2020-11-29T19:59:32.000Z | # coding=utf-8
"""
Events specific to Mumble-based protocols
"""
__author__ = 'Gareth Coles'
from system.events.base import BaseEvent
class MumbleEvent(BaseEvent):
"""
A Mumble event. This will only be thrown from the Mumble protocol.
If an event subclasses this, chances are it's a Mumble event.
""... | 20.815686 | 77 | 0.608986 | # coding=utf-8
"""
Events specific to Mumble-based protocols
"""
__author__ = 'Gareth Coles'
from system.events.base import BaseEvent
class MumbleEvent(BaseEvent):
"""
A Mumble event. This will only be thrown from the Mumble protocol.
If an event subclasses this, chances are it's a Mumble event.
""... | 56 | 0 | 27 |
9adb43ddfd7c249bcc04844d8cc841ab379b1785 | 7,009 | py | Python | wagtail_template/settings/base.py | b-ggs/wagtail-template | d6b7dfe4ab2cf0af8f412148b394d7b44a6a278a | [
"BSD-3-Clause"
] | null | null | null | wagtail_template/settings/base.py | b-ggs/wagtail-template | d6b7dfe4ab2cf0af8f412148b394d7b44a6a278a | [
"BSD-3-Clause"
] | null | null | null | wagtail_template/settings/base.py | b-ggs/wagtail-template | d6b7dfe4ab2cf0af8f412148b394d7b44a6a278a | [
"BSD-3-Clause"
] | null | null | null | """
Django settings for wagtail_template project.
Generated by 'django-admin startproject' using Django 4.0.3.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.0/ref/settings/
"""
# B... | 29.952991 | 97 | 0.709231 | """
Django settings for wagtail_template project.
Generated by 'django-admin startproject' using Django 4.0.3.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.0/ref/settings/
"""
# B... | 209 | 0 | 26 |
243d131c3f4dd5c382d0fd89e7593090e1cd85cd | 1,195 | py | Python | app/ples/templatetags/ples.py | misli/ples | 1cccd19946d460a232d79113465706472577729a | [
"BSD-3-Clause"
] | null | null | null | app/ples/templatetags/ples.py | misli/ples | 1cccd19946d460a232d79113465706472577729a | [
"BSD-3-Clause"
] | null | null | null | app/ples/templatetags/ples.py | misli/ples | 1cccd19946d460a232d79113465706472577729a | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement
from django import template
from ..models import Seat
register = template.Library()
@register.filter
@register.inclusion_tag('seat.html', takes_context=True)
| 31.447368 | 125 | 0.681172 | from __future__ import absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement
from django import template
from ..models import Seat
register = template.Library()
@register.filter
def split(value):
return value.split()
@register.inclusion_tag('seat.html', takes_... | 859 | 0 | 44 |
2e6006e584a17825353e404af334a6f750425bb8 | 911 | py | Python | data/worker.py | suibex/fleonSide | 6bdf3b1cc2893984f7bff6715ec333e9c2cfcbae | [
"CC0-1.0"
] | 1 | 2022-01-17T22:46:02.000Z | 2022-01-17T22:46:02.000Z | data/worker.py | suibex/fleonSide | 6bdf3b1cc2893984f7bff6715ec333e9c2cfcbae | [
"CC0-1.0"
] | null | null | null | data/worker.py | suibex/fleonSide | 6bdf3b1cc2893984f7bff6715ec333e9c2cfcbae | [
"CC0-1.0"
] | null | null | null | import threading
import os
import obd
from random import random
from pathlib import Path
conn = obd.OBD()
connect = obd.Async(fast=False)
speed=""
fueli=""
tem =""
connect.watch(obd.commands.INTAKE_TEMP,callback=get_temp)
connect.watch(obd.commands.FUEL_LEVEL,callback=get_fuel)
connect.watch(obd.comma... | 15.706897 | 57 | 0.607025 | import threading
import os
import obd
from random import random
from pathlib import Path
conn = obd.OBD()
connect = obd.Async(fast=False)
speed=""
fueli=""
tem =""
def get_temp(t):
if not t.is_null():
tem=str(t.value)
if t.is_null():
tem=str(0)
def get_fuel(f):
if n... | 278 | 0 | 68 |
62d5047c4d6f556bef84c17d674c5de797b2b02f | 189 | py | Python | gym_mouse_lib/gym_mouse/__init__.py | TalHadad/yolov5_pytorch | 49d3e191cf79ca759d48fe027407eba30d6a2224 | [
"Apache-2.0"
] | null | null | null | gym_mouse_lib/gym_mouse/__init__.py | TalHadad/yolov5_pytorch | 49d3e191cf79ca759d48fe027407eba30d6a2224 | [
"Apache-2.0"
] | null | null | null | gym_mouse_lib/gym_mouse/__init__.py | TalHadad/yolov5_pytorch | 49d3e191cf79ca759d48fe027407eba30d6a2224 | [
"Apache-2.0"
] | null | null | null | # Core Library
import logging
# Third party
from gym.envs.registration import register
logger = logging.getLogger(__name__)
register(id="Mouse-v0", entry_point="gym_mouse.envs:MouseEnv") | 21 | 62 | 0.793651 | # Core Library
import logging
# Third party
from gym.envs.registration import register
logger = logging.getLogger(__name__)
register(id="Mouse-v0", entry_point="gym_mouse.envs:MouseEnv") | 0 | 0 | 0 |
9af56af6b43afee1d873a3caf8046bff62a1f68a | 975 | py | Python | python/tree/N-aryTreePostorderTraversal.py | Nobodylesszb/LeetCode | 0e902f6bff4834a93ce64cf9c57fd64297e63523 | [
"MIT"
] | null | null | null | python/tree/N-aryTreePostorderTraversal.py | Nobodylesszb/LeetCode | 0e902f6bff4834a93ce64cf9c57fd64297e63523 | [
"MIT"
] | null | null | null | python/tree/N-aryTreePostorderTraversal.py | Nobodylesszb/LeetCode | 0e902f6bff4834a93ce64cf9c57fd64297e63523 | [
"MIT"
] | null | null | null | #Given an n-ary tree,
# return the postorder
# traversal of its nodes' values.
#Recursion is easy to implement and understand by definition
# https://en.wikipedia.org/wiki/Tree_traversal#Post-order_(LRN)
| 26.351351 | 73 | 0.558974 | #Given an n-ary tree,
# return the postorder
# traversal of its nodes' values.
#Recursion is easy to implement and understand by definition
# https://en.wikipedia.org/wiki/Tree_traversal#Post-order_(LRN)
class Solution:
def postorder(self,root):
"""
:type:root :node
:rtype:list[int]
... | 360 | 384 | 22 |
ebf21320142be0bab15ccda9ee4a55b1fe2b60a5 | 3,030 | py | Python | resourses/keywords_resource.py | maxazure/papers | d58267d86a522316f2a32128d9f9c82feee08bcc | [
"MIT"
] | null | null | null | resourses/keywords_resource.py | maxazure/papers | d58267d86a522316f2a32128d9f9c82feee08bcc | [
"MIT"
] | null | null | null | resourses/keywords_resource.py | maxazure/papers | d58267d86a522316f2a32128d9f9c82feee08bcc | [
"MIT"
] | null | null | null | from flask_restful import Resource, reqparse, request
from flask_restful import fields, marshal_with, marshal
from sqlalchemy.exc import IntegrityError
from sqlalchemy import or_, and_, text
from flask_jwt_extended import jwt_required
from models.keyword import Keyword
from app import db
from utils.util import max_res
... | 30.918367 | 125 | 0.588779 | from flask_restful import Resource, reqparse, request
from flask_restful import fields, marshal_with, marshal
from sqlalchemy.exc import IntegrityError
from sqlalchemy import or_, and_, text
from flask_jwt_extended import jwt_required
from models.keyword import Keyword
from app import db
from utils.util import max_res
... | 2,555 | 166 | 23 |
741231e4e762030a801183488d2c8a85666d9f67 | 1,785 | py | Python | hardhat/recipes/python/__init__.py | stangelandcl/hardhat | 1ad0c5dec16728c0243023acb9594f435ef18f9c | [
"MIT"
] | null | null | null | hardhat/recipes/python/__init__.py | stangelandcl/hardhat | 1ad0c5dec16728c0243023acb9594f435ef18f9c | [
"MIT"
] | null | null | null | hardhat/recipes/python/__init__.py | stangelandcl/hardhat | 1ad0c5dec16728c0243023acb9594f435ef18f9c | [
"MIT"
] | null | null | null | import os
directory = os.path.dirname(__file__)
| 30.254237 | 79 | 0.547899 | import os
directory = os.path.dirname(__file__)
def load(settings):
from hardhat.util import load_recipes
recipes = load_recipes(directory, 'hardhat.recipes.python')
dependencies = [
# only one version of cython is needed so alias it
['cython', 'python3-cython'], # alias
['devpi... | 1,688 | 0 | 46 |
2051c4639387560e84e8d243f881177997e1a1f1 | 1,069 | py | Python | obfuscatorPage.py | andrewrx83/python2 | e70b7e1db3af575b4a522063c1bb6584f1a9275d | [
"MIT"
] | 26 | 2015-10-17T11:30:35.000Z | 2021-03-22T07:46:36.000Z | obfuscatorPage.py | andrewrx83/python2 | e70b7e1db3af575b4a522063c1bb6584f1a9275d | [
"MIT"
] | 10 | 2015-05-10T22:51:35.000Z | 2017-09-15T10:00:33.000Z | obfuscatorPage.py | andrewrx83/python2 | e70b7e1db3af575b4a522063c1bb6584f1a9275d | [
"MIT"
] | 16 | 2015-08-16T07:13:37.000Z | 2021-12-09T12:08:56.000Z | import os, sys, cyclone.web
import pyobf
from twisted.python import log
from twisted.internet import reactor
if __name__ == "__main__":
log.startLogging(sys.stdout)
port = int(os.environ.get('PORT', 5000))
reactor.listenTCP(port, Application())
reactor.run()
| 28.891892 | 122 | 0.626754 | import os, sys, cyclone.web
import pyobf
from twisted.python import log
from twisted.internet import reactor
class IndexHandler(cyclone.web.RequestHandler):
def get(self):
self.render("index.html", original="", obfuscated="", originalLen=0, obfLen=0)
def post(self):
string = self.get_argument(... | 619 | 48 | 125 |
ceb1eeaa4872baf6c67cf9b0a43f35e96e62a66b | 1,569 | py | Python | babyshortener/utils/url.py | mnowotka/babyshortener | 079a95a715e0b30ca18265885d4d93a56553537a | [
"MIT"
] | 1 | 2019-09-20T07:36:15.000Z | 2019-09-20T07:36:15.000Z | babyshortener/utils/url.py | mnowotka/babyshortener | 079a95a715e0b30ca18265885d4d93a56553537a | [
"MIT"
] | 20 | 2018-10-05T09:00:23.000Z | 2022-03-31T01:53:32.000Z | babyshortener/utils/url.py | mnowotka/babyshortener | 079a95a715e0b30ca18265885d4d93a56553537a | [
"MIT"
] | null | null | null | """This file defines a URL validators based on Django ones.
"""
import re
# ----------------------------------------------------------------------------------------------------------------------
""" this regex is different from the one defined by Django because:
- in our case protocol is optional
- I decided t... | 37.357143 | 120 | 0.361377 | """This file defines a URL validators based on Django ones.
"""
import re
# ----------------------------------------------------------------------------------------------------------------------
""" this regex is different from the one defined by Django because:
- in our case protocol is optional
- I decided t... | 94 | 0 | 46 |
444bde82d6fd488d23f00861a4f896b303889cbc | 7,111 | py | Python | war.py | Feldari/cardgame-war | 895082a81c78f7643b15c057909a2a4505d42d27 | [
"MIT"
] | null | null | null | war.py | Feldari/cardgame-war | 895082a81c78f7643b15c057909a2a4505d42d27 | [
"MIT"
] | null | null | null | war.py | Feldari/cardgame-war | 895082a81c78f7643b15c057909a2a4505d42d27 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3.6
import random
def init():
'''
This builds the deck to draw from.
This runs at the beginning of the program then shoud only be run
to start a new game.
'''
# These are the possible face values and suits for the cards.
cardfaces = ("A","K","Q","J","10","9","8","7",... | 30.650862 | 78 | 0.50682 | #!/usr/bin/env python3.6
import random
def init():
'''
This builds the deck to draw from.
This runs at the beginning of the program then shoud only be run
to start a new game.
'''
# These are the possible face values and suits for the cards.
cardfaces = ("A","K","Q","J","10","9","8","7",... | 0 | 0 | 0 |
0221ddaeac067a10aac025cefb09e848688bdbb3 | 3,467 | py | Python | wearebeautiful/database.py | wearebeautiful/wearebeautiful.info | ba93138f94079b89d7f9d89328509e201837bd07 | [
"CC0-1.0"
] | 1 | 2019-07-20T10:17:14.000Z | 2019-07-20T10:17:14.000Z | wearebeautiful/database.py | wearebeautiful/wearebeautiful-tools | ba93138f94079b89d7f9d89328509e201837bd07 | [
"CC0-1.0"
] | 26 | 2020-02-17T17:42:49.000Z | 2020-04-17T21:24:52.000Z | wearebeautiful/database.py | wearebeautiful/wearebeautiful-tools | ba93138f94079b89d7f9d89328509e201837bd07 | [
"CC0-1.0"
] | 1 | 2019-08-14T19:23:33.000Z | 2019-08-14T19:23:33.000Z | import os
import json
import shutil
from peewee import SqliteDatabase
from wearebeautiful.db_model import DBModel, db, create_from_manifest
from wearebeautiful.manifest import validate_manifest
import config
DB_FILE = "wab-models.db"
MIN_SURFACE_MED_SIZE = 8 * 1024 * 1024
MAX_SURFACE_MED_SIZE = 12 * 1024 * 1024
MIN_S... | 36.494737 | 160 | 0.590424 | import os
import json
import shutil
from peewee import SqliteDatabase
from wearebeautiful.db_model import DBModel, db, create_from_manifest
from wearebeautiful.manifest import validate_manifest
import config
DB_FILE = "wab-models.db"
MIN_SURFACE_MED_SIZE = 8 * 1024 * 1024
MAX_SURFACE_MED_SIZE = 12 * 1024 * 1024
MIN_S... | 2,997 | 0 | 69 |
d87d8fc47074e1ce777b15fdf6a6fb91c0181af1 | 733 | py | Python | stephen/week2.py | kanglicheng/learn-python-2020 | e5b2f0945f123763595bff825af59855d616a100 | [
"Unlicense"
] | null | null | null | stephen/week2.py | kanglicheng/learn-python-2020 | e5b2f0945f123763595bff825af59855d616a100 | [
"Unlicense"
] | null | null | null | stephen/week2.py | kanglicheng/learn-python-2020 | e5b2f0945f123763595bff825af59855d616a100 | [
"Unlicense"
] | null | null | null |
# print(pig_latin("Python"))
# print(pig_latin("computer"))
# print(pig_latin(("air")))
# print(ubbi_dubbi())
get_running_avg()
| 18.794872 | 42 | 0.572988 | def pig_latin(word):
vowels = "aeiou"
if not word:
return None
if word[0] in vowels:
return word+"way"
else:
new_word = [word[1:]+word[0]+"ay"]
return "".join(new_word)
# print(pig_latin("Python"))
# print(pig_latin("computer"))
# print(pig_latin(("air")))
def ubbi_du... | 529 | 0 | 68 |
d4423723c5ded922dbd098a0b6a015236bed2606 | 2,490 | py | Python | app.py | behrad-kzm/LocationBrain | 44ef5e03cc9b240bfabad5c3c14635ef812a39ae | [
"MIT"
] | null | null | null | app.py | behrad-kzm/LocationBrain | 44ef5e03cc9b240bfabad5c3c14635ef812a39ae | [
"MIT"
] | null | null | null | app.py | behrad-kzm/LocationBrain | 44ef5e03cc9b240bfabad5c3c14635ef812a39ae | [
"MIT"
] | null | null | null | from flask import Flask
app = Flask(__name__)
@app.route('/')
if __name__ == '__main__':
app.run()
| 31.923077 | 76 | 0.542972 | from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
print(__doc__)
from time import time
import numpy as np
from scipy import ndimage
from matplotlib import pyplot as plt
from sklearn import manifold, datasets
X, y = datasets.load_digits(return_X_y=True)
... | 2,360 | 0 | 22 |
23a910acf49e30a5a8a9310c45d430a0c2df692a | 130 | py | Python | gastrotourism/accounts/admin.py | fallprojects/gastrotourism | 79dc3fbeda9b9d2175fca6590369b003d7a10c36 | [
"MIT"
] | null | null | null | gastrotourism/accounts/admin.py | fallprojects/gastrotourism | 79dc3fbeda9b9d2175fca6590369b003d7a10c36 | [
"MIT"
] | null | null | null | gastrotourism/accounts/admin.py | fallprojects/gastrotourism | 79dc3fbeda9b9d2175fca6590369b003d7a10c36 | [
"MIT"
] | null | null | null | from django.contrib import admin
# Register your models here.
from accounts.models import Customer
admin.site.register(Customer) | 21.666667 | 36 | 0.823077 | from django.contrib import admin
# Register your models here.
from accounts.models import Customer
admin.site.register(Customer) | 0 | 0 | 0 |
aeb22914ed6e50a3574958d1d84e46aeb1996420 | 3,596 | py | Python | stuff.py | karol-prz/predictor | 2774fe2a88a9bf5f7aa58f884cdcf879182c64c7 | [
"MIT"
] | null | null | null | stuff.py | karol-prz/predictor | 2774fe2a88a9bf5f7aa58f884cdcf879182c64c7 | [
"MIT"
] | null | null | null | stuff.py | karol-prz/predictor | 2774fe2a88a9bf5f7aa58f884cdcf879182c64c7 | [
"MIT"
] | null | null | null |
'''
def compare(file1, file2):
f1 = open(file1, 'r')
f2 = open(file2, 'r')
right_counter = 0
wrong_lines = []
for i in range(50):
r1 = f1.readline()
r2 = f2.readline()
r1 = r1.strip('\n')
r2 = r2.strip('\n')
if r1[-1:] == r2[-1:]:
right_counter += 1
else:
wrong_lines.append(i)
print('Wrong lin... | 21.793939 | 148 | 0.630423 |
def get_team_names(deatils):
outfile = open('team_names.txt', 'a+')
teams = []
for game in details:
for i in ['home-team', 'away-team']:
if game[i] not in teams:
teams.append(game[i])
outfile.write('\n'.join(teams))
outfile.close()
def sort_team_names():
file = open('team_names.txt', 'r')
teams = fi... | 2,902 | 0 | 184 |
5ccdda389df3723602d93a8ee43208eb6dde9c1e | 125 | py | Python | eyed/db/__init__.py | ThousandMileEye/Eye | b0eca371fed5e01353ebddf7e4c400927decf0d2 | [
"Apache-2.0"
] | null | null | null | eyed/db/__init__.py | ThousandMileEye/Eye | b0eca371fed5e01353ebddf7e4c400927decf0d2 | [
"Apache-2.0"
] | 55 | 2017-12-21T15:20:36.000Z | 2019-01-20T02:49:41.000Z | eyed/db/__init__.py | ThousandMileEye/Eye | b0eca371fed5e01353ebddf7e4c400927decf0d2 | [
"Apache-2.0"
] | 3 | 2018-05-18T09:02:36.000Z | 2019-12-29T10:27:44.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from db import SessionFactory, Engine
__all__ = [
SessionFactory,
Engine
]
| 12.5 | 37 | 0.672 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from db import SessionFactory, Engine
__all__ = [
SessionFactory,
Engine
]
| 0 | 0 | 0 |
15464d100b378bacafa095cea5a8e320fa5b16fc | 2,596 | py | Python | core2pkgs/core2pkgs/config.py | DmitryRyumin/pkgs | 8d0b1e03495f2b4d6da96664a222fecac8d98e74 | [
"MIT"
] | 2 | 2019-09-19T13:22:48.000Z | 2020-01-13T17:03:46.000Z | core2pkgs/core2pkgs/config.py | DmitryRyumin/pkgs | 8d0b1e03495f2b4d6da96664a222fecac8d98e74 | [
"MIT"
] | null | null | null | core2pkgs/core2pkgs/config.py | DmitryRyumin/pkgs | 8d0b1e03495f2b4d6da96664a222fecac8d98e74 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Глобальный файл настроек
"""
# ######################################################################################################################
# Класс для выделения текста
# ######################################################################################... | 34.613333 | 120 | 0.277735 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Глобальный файл настроек
"""
# ######################################################################################################################
# Класс для выделения текста
# ######################################################################################... | 1,001 | 0 | 184 |
4ea1a7e3af7017746226259f4bbb840efd076b0c | 5,261 | py | Python | RaspberryPi/main.py | effx13/ArduinoRobotArm_MDP | 5c11829766b8b7134aabd8902ecc698998c25b84 | [
"MIT"
] | 2 | 2021-11-01T11:02:44.000Z | 2021-12-01T05:40:24.000Z | RaspberryPi/main.py | effx13/ArduinoRobotArm_MDP | 5c11829766b8b7134aabd8902ecc698998c25b84 | [
"MIT"
] | 1 | 2021-12-01T05:33:16.000Z | 2021-12-01T05:33:16.000Z | RaspberryPi/main.py | effx13/ArduinoRobotArm_MDP | 5c11829766b8b7134aabd8902ecc698998c25b84 | [
"MIT"
] | null | null | null | import cv2
import imutils
import time
import threading
import serial
import RPi.GPIO as GPIO
from bluetooth import *
from serial.serialutil import SerialException
# -------------------변수 선언 부분-------------------
port = "/dev/ttyACM0"
reset_timer_seconds = -1
angles = [150, 120, 130]
arduino = serial.Serial(port, 11520... | 31.315476 | 110 | 0.547234 | import cv2
import imutils
import time
import threading
import serial
import RPi.GPIO as GPIO
from bluetooth import *
from serial.serialutil import SerialException
# -------------------변수 선언 부분-------------------
port = "/dev/ttyACM0"
reset_timer_seconds = -1
angles = [150, 120, 130]
arduino = serial.Serial(port, 11520... | 3,258 | 0 | 113 |
d11b9271af6be6db5151310a6e7b78b927945e06 | 556 | py | Python | src/pytypes/tests/test_alnum_filter.py | tonybaloney/onefuzz | e0f2e9ed5aae006e0054387de7a0ff8c83c8f722 | [
"MIT"
] | 2,692 | 2020-09-15T17:54:21.000Z | 2022-03-31T11:58:57.000Z | src/pytypes/tests/test_alnum_filter.py | tonybaloney/onefuzz | e0f2e9ed5aae006e0054387de7a0ff8c83c8f722 | [
"MIT"
] | 980 | 2020-09-18T18:23:01.000Z | 2022-03-30T22:20:43.000Z | src/pytypes/tests/test_alnum_filter.py | tonybaloney/onefuzz | e0f2e9ed5aae006e0054387de7a0ff8c83c8f722 | [
"MIT"
] | 177 | 2020-09-16T00:10:56.000Z | 2022-03-30T21:18:10.000Z | #!/usr/bin/env python
#
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import unittest
from onefuzztypes.validators import check_alnum_dash
if __name__ == "__main__":
unittest.main()
| 23.166667 | 76 | 0.638489 | #!/usr/bin/env python
#
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import unittest
from onefuzztypes.validators import check_alnum_dash
class TestFilter(unittest.TestCase):
def test_filter(self) -> None:
check_alnum_dash("abc-")
check_alnum_dash("-abc12A")
... | 274 | 15 | 49 |
df80bfdf494e35c26f3d249e25ba71884bd5df77 | 5,554 | py | Python | quotequail/__init__.py | noufalsalim/quotequail | 400d5105cf5104f20ffb3f9b401b71ec088b5838 | [
"MIT"
] | 35 | 2015-07-21T03:37:37.000Z | 2022-03-14T13:22:40.000Z | quotequail/__init__.py | noufalsalim/quotequail | 400d5105cf5104f20ffb3f9b401b71ec088b5838 | [
"MIT"
] | 18 | 2015-11-19T00:52:17.000Z | 2022-02-02T08:03:26.000Z | quotequail/__init__.py | noufalsalim/quotequail | 400d5105cf5104f20ffb3f9b401b71ec088b5838 | [
"MIT"
] | 24 | 2016-01-27T10:16:00.000Z | 2022-02-26T23:44:29.000Z | # -*- coding: utf-8 -*-
# quotequail
# a library that identifies quoted text in email messages
import re
from . import _internal
__all__ = ['quote', 'quote_html', 'unwrap', 'unwrap_html']
def quote(text, limit=1000):
"""
Takes a plain text message as an argument, returns a list of tuples. The
first arg... | 32.863905 | 88 | 0.620994 | # -*- coding: utf-8 -*-
# quotequail
# a library that identifies quoted text in email messages
import re
from . import _internal
__all__ = ['quote', 'quote_html', 'unwrap', 'unwrap_html']
def quote(text, limit=1000):
"""
Takes a plain text message as an argument, returns a list of tuples. The
first arg... | 0 | 0 | 0 |
6a4c6a5ead1b8e02e2e5f40e25c2514b6405df58 | 7,876 | py | Python | disturbance/settings.py | thakurpriya1990/disturbance | 47f9ce5ae5f1b02d97ace11f1041e96daf7e4556 | [
"Apache-2.0"
] | 1 | 2020-06-30T04:47:42.000Z | 2020-06-30T04:47:42.000Z | disturbance/settings.py | thakurpriya1990/disturbance | 47f9ce5ae5f1b02d97ace11f1041e96daf7e4556 | [
"Apache-2.0"
] | 3 | 2021-05-12T00:05:54.000Z | 2022-03-02T10:37:22.000Z | disturbance/settings.py | thakurpriya1990/disturbance | 47f9ce5ae5f1b02d97ace11f1041e96daf7e4556 | [
"Apache-2.0"
] | 1 | 2020-06-16T05:51:52.000Z | 2020-06-16T05:51:52.000Z | from django.core.exceptions import ImproperlyConfigured
import os, hashlib
import confy
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
confy.read_environment_file(BASE_DIR+"/.env")
os.environ.setdefault("BASE_DIR", BASE_DIR)
from ledger.settings_base import *
ROOT_URLCONF = 'disturbance.urls... | 36.462963 | 128 | 0.734002 | from django.core.exceptions import ImproperlyConfigured
import os, hashlib
import confy
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
confy.read_environment_file(BASE_DIR+"/.env")
os.environ.setdefault("BASE_DIR", BASE_DIR)
from ledger.settings_base import *
ROOT_URLCONF = 'disturbance.urls... | 0 | 0 | 0 |
f924ae02089b8d9b8047385bafaca4369a73ed8a | 99 | py | Python | django_auth/p_library/apps.py | bobruk76/D7 | f5167ac40d093d49a89c36b3465e5073e6530ed1 | [
"MIT"
] | null | null | null | django_auth/p_library/apps.py | bobruk76/D7 | f5167ac40d093d49a89c36b3465e5073e6530ed1 | [
"MIT"
] | 7 | 2021-04-08T21:29:04.000Z | 2022-01-13T03:05:35.000Z | django_auth/p_library/apps.py | bobruk76/D7 | f5167ac40d093d49a89c36b3465e5073e6530ed1 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
| 16.5 | 35 | 0.727273 | from django.apps import AppConfig
class OrmExampleConfig(AppConfig):
name = 'p_library'
| 0 | 37 | 25 |
871940d70a528cc5f3e9d07b3130d476a0ac2b28 | 1,928 | py | Python | provision/cg.py | mkosterin/snr_phones_autoprovision_config_generator | c21cf91fcebd5f17a59cf5f30faf2d0ca7fffcc3 | [
"MIT"
] | null | null | null | provision/cg.py | mkosterin/snr_phones_autoprovision_config_generator | c21cf91fcebd5f17a59cf5f30faf2d0ca7fffcc3 | [
"MIT"
] | null | null | null | provision/cg.py | mkosterin/snr_phones_autoprovision_config_generator | c21cf91fcebd5f17a59cf5f30faf2d0ca7fffcc3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import string
import random
from jinja2 import Template, Environment, FileSystemLoader
baseDir = "c:\\provision"
# which extension number we should start
start_ext = 821
extensionHeader = """#cid_number,transfer,mailbox,type,qualify,hasdirectory,call-limit,host,context,fullname,se... | 32.677966 | 318 | 0.645747 | # -*- coding: utf-8 -*-
import string
import random
from jinja2 import Template, Environment, FileSystemLoader
def password():
alphabet = string.ascii_letters + string.digits
while True:
password = ''.join(random.choice(alphabet) for i in range(10))
if (any(c.islower() for c in passw... | 343 | 0 | 25 |
044676a8ff601efa4be0c7cc2f74a9175441a1bb | 1,352 | py | Python | alerta/views/__init__.py | smbambling/alerta | 1b3c3888b67ac4db48ef5eb9dcd704ac0c5aecb1 | [
"Apache-2.0"
] | 1,233 | 2017-11-01T00:29:12.000Z | 2022-03-29T04:13:09.000Z | alerta/views/__init__.py | smbambling/alerta | 1b3c3888b67ac4db48ef5eb9dcd704ac0c5aecb1 | [
"Apache-2.0"
] | 760 | 2017-10-27T20:33:41.000Z | 2022-03-28T17:01:41.000Z | alerta/views/__init__.py | smbambling/alerta | 1b3c3888b67ac4db48ef5eb9dcd704ac0c5aecb1 | [
"Apache-2.0"
] | 238 | 2017-11-02T14:58:15.000Z | 2022-03-29T03:59:20.000Z | from flask import Blueprint, current_app, jsonify, request
from alerta.app import custom_webhooks
from alerta.exceptions import ApiError
from alerta.utils.response import absolute_url
api = Blueprint('api', __name__)
from . import alerts, blackouts, config, customers, groups, heartbeats, keys, oembed, permissions, u... | 28.765957 | 133 | 0.642012 | from flask import Blueprint, current_app, jsonify, request
from alerta.app import custom_webhooks
from alerta.exceptions import ApiError
from alerta.utils.response import absolute_url
api = Blueprint('api', __name__)
from . import alerts, blackouts, config, customers, groups, heartbeats, keys, oembed, permissions, u... | 772 | 0 | 66 |
a3a6ca3d60b2fa60a87dfa7d07a083ca5ad28d60 | 19,506 | py | Python | tools/cocos2d-console/plugins/project_compile/build_android.py | kinzhang/cocos2d-js-v3.2 | 530c6fe1345aa31fbd94d0ec191071a6db23820d | [
"MIT"
] | null | null | null | tools/cocos2d-console/plugins/project_compile/build_android.py | kinzhang/cocos2d-js-v3.2 | 530c6fe1345aa31fbd94d0ec191071a6db23820d | [
"MIT"
] | null | null | null | tools/cocos2d-console/plugins/project_compile/build_android.py | kinzhang/cocos2d-js-v3.2 | 530c6fe1345aa31fbd94d0ec191071a6db23820d | [
"MIT"
] | null | null | null | #!/usr/bin/python
# build_native.py
# Build native codes
import sys
import os, os.path
import shutil
from optparse import OptionParser
import cocos
import cocos_project
import json
import re
from xml.dom import minidom
import project_compile
BUILD_CFIG_FILE="build-cfg.json"
| 39.889571 | 186 | 0.618886 | #!/usr/bin/python
# build_native.py
# Build native codes
import sys
import os, os.path
import shutil
from optparse import OptionParser
import cocos
import cocos_project
import json
import re
from xml.dom import minidom
import project_compile
BUILD_CFIG_FILE="build-cfg.json"
class AndroidBuilder(object):
CFG_K... | 17,491 | 1,713 | 23 |
df8f8127a729283da8ae42c9a26f1ef82d99e21a | 190 | py | Python | atest/testdata/test_libraries/ClassWithNotKeywordDecorator.py | rdagum/robotframework | b7069d505374e9f09a140ed5a9727d2a40716446 | [
"ECL-2.0",
"Apache-2.0"
] | 7,073 | 2015-01-01T17:19:16.000Z | 2022-03-31T22:01:29.000Z | atest/testdata/test_libraries/ClassWithNotKeywordDecorator.py | imust6226/robotframework | 08c56fef2ebc64d682c7f99acd77c480d8d0e028 | [
"ECL-2.0",
"Apache-2.0"
] | 2,412 | 2015-01-02T09:29:05.000Z | 2022-03-31T13:10:46.000Z | atest/testdata/test_libraries/ClassWithNotKeywordDecorator.py | 3mdeb/robotframework | 6006ce0b3d5fc6b45c5eb040dc859acd64bfa846 | [
"ECL-2.0",
"Apache-2.0"
] | 2,298 | 2015-01-03T02:47:15.000Z | 2022-03-31T02:00:16.000Z | from robot.api.deco import not_keyword
| 15.833333 | 38 | 0.710526 | from robot.api.deco import not_keyword
class ClassWithNotKeywordDecorator:
def exposed_in_class(self):
pass
@not_keyword
def not_exposed_in_class(self):
pass
| 42 | 85 | 23 |
a15b4093e656e40e94de6847d3082d5d816ef4dd | 164 | py | Python | WEEKS/CD_Sata-Structures/_MISC/misc-examples/tuples.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | null | null | null | WEEKS/CD_Sata-Structures/_MISC/misc-examples/tuples.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | null | null | null | WEEKS/CD_Sata-Structures/_MISC/misc-examples/tuples.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | null | null | null | l1 = [1, 3, 5, 7, 9] # list mutable (read write)
t1 = (1, 3, 5, 7, 9) # tuple imutable (read only)
f(l1)
print(l1)
f(t1)
print(t1)
| 12.615385 | 50 | 0.542683 | l1 = [1, 3, 5, 7, 9] # list mutable (read write)
t1 = (1, 3, 5, 7, 9) # tuple imutable (read only)
def f(x):
x.append(29)
f(l1)
print(l1)
f(t1)
print(t1)
| 5 | 0 | 23 |
bc2349ff8bae24f07701d461a1fd2e888e76d0b2 | 1,629 | py | Python | stereo/dataset/DS.py | Owl-AI/Reversing | a4321642ccad6e7c2f4c71bcb960ee9c5edf5ed8 | [
"Apache-2.0"
] | 41 | 2020-07-06T13:02:44.000Z | 2022-03-23T04:39:19.000Z | stereo/dataset/DS.py | Owl-AI/Reversing | a4321642ccad6e7c2f4c71bcb960ee9c5edf5ed8 | [
"Apache-2.0"
] | 19 | 2020-09-23T18:40:29.000Z | 2022-02-10T02:05:39.000Z | stereo/dataset/DS.py | Owl-AI/Reversing | a4321642ccad6e7c2f4c71bcb960ee9c5edf5ed8 | [
"Apache-2.0"
] | 6 | 2020-12-03T09:49:58.000Z | 2022-02-18T12:18:34.000Z | # Copyright 2020 Filippo Aleotti, Fabio Tosi, Li Zhang, Matteo Poggi, Stefano Mattoccia
#
# 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
#
# ... | 29.618182 | 87 | 0.679558 | # Copyright 2020 Filippo Aleotti, Fabio Tosi, Li Zhang, Matteo Poggi, Stefano Mattoccia
#
# 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
#
# ... | 0 | 0 | 0 |
ee9ed6c949b34da36c66762654aacec08e5ca418 | 1,009 | py | Python | scc_home/views.py | supercooledcreations/supercooledcreations | e4fcbbfd1eb60d808273d16c1de0ffb81ac33e49 | [
"MIT"
] | null | null | null | scc_home/views.py | supercooledcreations/supercooledcreations | e4fcbbfd1eb60d808273d16c1de0ffb81ac33e49 | [
"MIT"
] | null | null | null | scc_home/views.py | supercooledcreations/supercooledcreations | e4fcbbfd1eb60d808273d16c1de0ffb81ac33e49 | [
"MIT"
] | null | null | null | # Import #
# Django
from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.views import View
from django.urls import reverse
from django.utils import timezone
# App
from .forms import BookmarkForm
from .models import Bookma... | 24.609756 | 66 | 0.693756 | # Import #
# Django
from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.views import View
from django.urls import reverse
from django.utils import timezone
# App
from .forms import BookmarkForm
from .models import Bookma... | 551 | 20 | 75 |
35580bce47e7ce13de691232e814794292ae6419 | 4,100 | py | Python | Engine/src/simulation/benchmarker/model_benchmarker.py | xapharius/HadoopML | c0129f298007ca89b538eb1a3800f991141ba361 | [
"MIT"
] | 2 | 2018-02-05T12:41:31.000Z | 2018-11-23T04:13:13.000Z | Engine/src/simulation/benchmarker/model_benchmarker.py | xapharius/HadoopML | c0129f298007ca89b538eb1a3800f991141ba361 | [
"MIT"
] | null | null | null | Engine/src/simulation/benchmarker/model_benchmarker.py | xapharius/HadoopML | c0129f298007ca89b538eb1a3800f991141ba361 | [
"MIT"
] | null | null | null | '''
Created on Apr 21, 2015
@author: xapharius
'''
import numpy as np
import pandas as pd
from datahandler.numerical2.numerical_data_handler import NumericalDataHandler
from sklearn.linear_model.logistic import LogisticRegression
from factory.algorithm_factory import AlgorithmFactory
from factory.homogenous_factory ... | 42.708333 | 129 | 0.706098 | '''
Created on Apr 21, 2015
@author: xapharius
'''
import numpy as np
import pandas as pd
from datahandler.numerical2.numerical_data_handler import NumericalDataHandler
from sklearn.linear_model.logistic import LogisticRegression
from factory.algorithm_factory import AlgorithmFactory
from factory.homogenous_factory ... | 2,226 | 0 | 27 |
805a04eab2c89b61a881966d193f53c1ab24ddc7 | 243 | py | Python | acf_example/httpbin_client/actions/status.py | Jamim/acf | af7ebd9af7c4cd8bf977ddcb51f297107ba3fcbc | [
"MIT"
] | 5 | 2018-11-15T13:35:53.000Z | 2022-02-23T06:43:13.000Z | acf_example/httpbin_client/actions/status.py | Jamim/acf | af7ebd9af7c4cd8bf977ddcb51f297107ba3fcbc | [
"MIT"
] | 4 | 2018-12-15T23:56:35.000Z | 2018-12-19T05:48:42.000Z | acf_example/httpbin_client/actions/status.py | Jamim/acf | af7ebd9af7c4cd8bf977ddcb51f297107ba3fcbc | [
"MIT"
] | 4 | 2018-11-15T13:36:02.000Z | 2022-02-23T06:43:14.000Z | from ..wrappers.status import UpdateStatusResultWrapper
from .base import HttpbinAction
| 22.090909 | 55 | 0.765432 | from ..wrappers.status import UpdateStatusResultWrapper
from .base import HttpbinAction
class UpdateStatusAction(HttpbinAction):
METHOD = 'PUT'
URL_COMPONENTS = ('status', '{status}')
RESULT_WRAPPER = UpdateStatusResultWrapper
| 0 | 131 | 23 |
dd650dd25a31e2850c06900e6356f7ef7f9c2098 | 928 | py | Python | ch06/06_06_fav-langs.py | remotephone/pythoncrashcourse | 837d05c5ef4976621bd2206328254749a71d60ff | [
"Apache-2.0"
] | null | null | null | ch06/06_06_fav-langs.py | remotephone/pythoncrashcourse | 837d05c5ef4976621bd2206328254749a71d60ff | [
"Apache-2.0"
] | null | null | null | ch06/06_06_fav-langs.py | remotephone/pythoncrashcourse | 837d05c5ef4976621bd2206328254749a71d60ff | [
"Apache-2.0"
] | null | null | null | favorite_languages = {
'jen': 'python',
'sarah': 'c',
'edward': 'ruby',
'phil': 'python',
}
for name, language in favorite_languages.items():
print(name.title() + "'s favorite language is " +
language.title() + ".")
for name in favorite_languages.keys():
print(name.title())
friend... | 25.777778 | 59 | 0.636853 | favorite_languages = {
'jen': 'python',
'sarah': 'c',
'edward': 'ruby',
'phil': 'python',
}
for name, language in favorite_languages.items():
print(name.title() + "'s favorite language is " +
language.title() + ".")
for name in favorite_languages.keys():
print(name.title())
friend... | 0 | 0 | 0 |
1ac9df902aa5e4f7697bbdceacd57712c28d228c | 15,340 | py | Python | python/dsbox/JobManager/DistributedJobManager.py | usc-isi-i2/dsbox-ta2 | 85e0e8f5bbda052fa77cb98f4eef1f4b50909fd2 | [
"MIT"
] | 7 | 2018-05-10T22:19:44.000Z | 2020-07-21T07:28:39.000Z | python/dsbox/JobManager/DistributedJobManager.py | usc-isi-i2/dsbox-ta2 | 85e0e8f5bbda052fa77cb98f4eef1f4b50909fd2 | [
"MIT"
] | 187 | 2018-04-13T17:19:24.000Z | 2020-04-21T00:41:15.000Z | python/dsbox/JobManager/DistributedJobManager.py | usc-isi-i2/dsbox-ta2 | 85e0e8f5bbda052fa77cb98f4eef1f4b50909fd2 | [
"MIT"
] | 7 | 2018-07-10T00:14:07.000Z | 2019-07-25T17:59:44.000Z | import copy
import os
import logging
import pickle
import psutil
import time
import threading
import typing
from enum import Enum
from math import ceil
from multiprocessing import Pool, Queue, Manager, current_process
from threading import Timer
_logger = logging.getLogger(__name__)
# used to save all PID of workers ... | 35.591647 | 110 | 0.585854 | import copy
import os
import logging
import pickle
import psutil
import time
import threading
import typing
from enum import Enum
from math import ceil
from multiprocessing import Pool, Queue, Manager, current_process
from threading import Timer
_logger = logging.getLogger(__name__)
# used to save all PID of workers ... | 4,684 | 9,567 | 391 |
4d0daa960362632a61b5cf757503f182df9a344c | 15,588 | py | Python | razor/passes.py | MuhammadAbuBakar95/OCCAM | 4ffec0043caa6003288520a42838a0226eb6cfa3 | [
"BSD-3-Clause"
] | null | null | null | razor/passes.py | MuhammadAbuBakar95/OCCAM | 4ffec0043caa6003288520a42838a0226eb6cfa3 | [
"BSD-3-Clause"
] | null | null | null | razor/passes.py | MuhammadAbuBakar95/OCCAM | 4ffec0043caa6003288520a42838a0226eb6cfa3 | [
"BSD-3-Clause"
] | null | null | null | """
OCCAM
Copyright (c) 2011-2017, SRI International
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of con... | 36.420561 | 96 | 0.624391 | """
OCCAM
Copyright (c) 2011-2017, SRI International
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of con... | 127 | 0 | 31 |
a371f4fac06296e177e959b547db9d31e5eb8257 | 24,893 | py | Python | GChartWrapper/GChart.py | dhilipsiva/google-chartwrapper | 3769aecbef6c83b6cd93ee72ece478ffe433ac57 | [
"BSD-3-Clause"
] | null | null | null | GChartWrapper/GChart.py | dhilipsiva/google-chartwrapper | 3769aecbef6c83b6cd93ee72ece478ffe433ac57 | [
"BSD-3-Clause"
] | 1 | 2019-01-14T05:09:15.000Z | 2019-01-14T05:09:15.000Z | GChartWrapper/GChart.py | dhilipsiva/google-chartwrapper | 3769aecbef6c83b6cd93ee72ece478ffe433ac57 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
################################################################################
# GChartWrapper - v0.8
# Copyright (C) 2009 Justin Quick <justquick@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License ver... | 32.328571 | 89 | 0.528582 | # -*- coding: utf-8 -*-
################################################################################
# GChartWrapper - v0.8
# Copyright (C) 2009 Justin Quick <justquick@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License ver... | 4,203 | 457 | 970 |
5f42ca913e67b584e2439069cf41f85b536f737a | 1,166 | py | Python | template.py | franbeep/TWDM-PON-Sim | c34f626c737f03d280bb96fd1dbd4eaa291383e3 | [
"MIT"
] | 1 | 2021-11-19T07:20:09.000Z | 2021-11-19T07:20:09.000Z | template.py | franbeep/TWDM-PON-Sim | c34f626c737f03d280bb96fd1dbd4eaa291383e3 | [
"MIT"
] | null | null | null | template.py | franbeep/TWDM-PON-Sim | c34f626c737f03d280bb96fd1dbd4eaa291383e3 | [
"MIT"
] | null | null | null | import sim
# seed
sim.random.seed(13)
# environment
env = sim.simpy.Environment()
# writer
# packet_w = Writer("packet_", start="# id src init_time waited_time freq processed_time\n")
# default values
sim.tg_default_size = lambda x: 5000
sim.tg_default_dist = lambda x: 1
sim.ONU_consumption = lambda x: 15
sim.PN_co... | 18.507937 | 92 | 0.678388 | import sim
# seed
sim.random.seed(13)
# environment
env = sim.simpy.Environment()
# writer
# packet_w = Writer("packet_", start="# id src init_time waited_time freq processed_time\n")
# default values
sim.tg_default_size = lambda x: 5000
sim.tg_default_dist = lambda x: 1
sim.ONU_consumption = lambda x: 15
sim.PN_co... | 0 | 0 | 0 |
67cea391e6faee05921bb6b7f027d954dc5deb2b | 3,186 | py | Python | train.py | team-eyespace/show-tell-api | b9947091083174e5469fcf3cf3079fabd73789dd | [
"MIT"
] | null | null | null | train.py | team-eyespace/show-tell-api | b9947091083174e5469fcf3cf3079fabd73789dd | [
"MIT"
] | 20 | 2019-11-28T06:38:26.000Z | 2022-03-12T00:41:52.000Z | train.py | team-eyespace/show-tell-api | b9947091083174e5469fcf3cf3079fabd73789dd | [
"MIT"
] | 1 | 2019-12-22T08:58:30.000Z | 2019-12-22T08:58:30.000Z | '''
File to train the NIC model, based on the paper:
https://www.cv-foundation.org/openaccess/content_cvpr_2015/papers/Vinyals_Show_and_Tell_2015_CVPR_paper.pdf
'''
from keras.callbacks import ModelCheckpoint
from keras.models import Model, load_model
from keras.optimizers import Adam
from keras.utils import plot_mod... | 40.846154 | 115 | 0.710609 | '''
File to train the NIC model, based on the paper:
https://www.cv-foundation.org/openaccess/content_cvpr_2015/papers/Vinyals_Show_and_Tell_2015_CVPR_paper.pdf
'''
from keras.callbacks import ModelCheckpoint
from keras.models import Model, load_model
from keras.optimizers import Adam
from keras.utils import plot_mod... | 2,035 | 0 | 23 |
1bc936cdd0503d0f79ce563f75d7d7191567ce61 | 1,943 | py | Python | trees/tssb/util.py | sharadmv/trees | ed8ce87718da753a13fe1707487df7b93037ae2f | [
"MIT"
] | 3 | 2017-01-18T21:20:26.000Z | 2019-01-22T19:11:58.000Z | trees/tssb/util.py | sharadmv/trees | ed8ce87718da753a13fe1707487df7b93037ae2f | [
"MIT"
] | null | null | null | trees/tssb/util.py | sharadmv/trees | ed8ce87718da753a13fe1707487df7b93037ae2f | [
"MIT"
] | 3 | 2016-10-13T06:31:25.000Z | 2021-11-08T19:09:03.000Z | import cPickle as pickle
import matplotlib.pyplot as plt
import numpy as np
import networkx as nx
| 29.439394 | 89 | 0.594956 | import cPickle as pickle
import matplotlib.pyplot as plt
import numpy as np
import networkx as nx
def plot_tssb(tssb, ax=None):
g = nx.DiGraph()
if ax:
ax.set_axis_off()
assert tssb.root is not None
add_nodes(g, tssb.root)
pos = nx.graphviz_layout(g, prog='dot', args='-Granksep=100.0')
... | 1,684 | 0 | 161 |
d4f988f814604af80219f450450b3d48b4a82f8f | 2,034 | py | Python | sktime/performance_metrics/tests/test_metrics_classes.py | khrapovs/sktime | 1589d007ef5dbcdc1f42f2c8278919ebed516358 | [
"BSD-3-Clause"
] | 1 | 2021-12-22T02:45:39.000Z | 2021-12-22T02:45:39.000Z | sktime/performance_metrics/tests/test_metrics_classes.py | khrapovs/sktime | 1589d007ef5dbcdc1f42f2c8278919ebed516358 | [
"BSD-3-Clause"
] | null | null | null | sktime/performance_metrics/tests/test_metrics_classes.py | khrapovs/sktime | 1589d007ef5dbcdc1f42f2c8278919ebed516358 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Tests for classes in _classes module."""
from inspect import getmembers, isclass
import numpy as np
import pandas as pd
import pytest
from sktime.performance_metrics.forecasting import _classes
from sktime.utils._testing.series import _make_series
metric_classes = getmembers(_classes, iscl... | 32.806452 | 88 | 0.701573 | # -*- coding: utf-8 -*-
"""Tests for classes in _classes module."""
from inspect import getmembers, isclass
import numpy as np
import pandas as pd
import pytest
from sktime.performance_metrics.forecasting import _classes
from sktime.utils._testing.series import _make_series
metric_classes = getmembers(_classes, iscl... | 0 | 0 | 0 |
19da141c48b7413d93cb25e65307a76b60c3d964 | 3,952 | py | Python | 4 term/MNA/Lab 3/main.py | mrojaczy/Labs | 21cd2ad3ddf8fa3b64cf253d147a4a04ad0667ab | [
"Apache-2.0"
] | 1 | 2020-03-15T17:11:23.000Z | 2020-03-15T17:11:23.000Z | 4 term/MNA/Lab 3/main.py | Asphobel/Labs | ee827143b32b691dd7736ba4888a4a9625b4694a | [
"Apache-2.0"
] | null | null | null | 4 term/MNA/Lab 3/main.py | Asphobel/Labs | ee827143b32b691dd7736ba4888a4a9625b4694a | [
"Apache-2.0"
] | null | null | null | import numpy as np
import numpy.linalg as la
import math
if __name__ == '__main__':
n = 4
matrixA = np.array([[3.738, 0.195, 0.275, 0.136],
[0.519, 5.002, 0.405, 0.283],
[0.306, 0.381, 4.812, 0.418],
[0.272, 0.142, 0.314, 3.935]])
... | 35.603604 | 88 | 0.527328 | import numpy as np
import numpy.linalg as la
import math
def squareRootMethod(n, matrixA, matrixB):
extendedMatrix = np.column_stack((matrixA, matrixB))
if la.matrix_rank(extendedMatrix) != la.matrix_rank(matrixA):
print("Система не имеет решений")
return
elif la.matrix_rank(matrixA) != n:... | 2,886 | 0 | 69 |
a4e1c2123e1d9a7067b7fb0d3a9954f49505f739 | 9,003 | py | Python | popnn_torch.py | bhardwajRahul/Gesture-Recognition | e4722ecb58e5c65f34f92a21058eae81ed3c84e0 | [
"MIT"
] | 102 | 2018-11-03T03:39:10.000Z | 2022-03-31T03:11:54.000Z | popnn_torch.py | shuren007/Gesture-Recognition | e4722ecb58e5c65f34f92a21058eae81ed3c84e0 | [
"MIT"
] | 2 | 2019-06-14T14:03:49.000Z | 2020-04-20T12:14:27.000Z | popnn_torch.py | shuren007/Gesture-Recognition | e4722ecb58e5c65f34f92a21058eae81ed3c84e0 | [
"MIT"
] | 34 | 2018-12-13T23:20:53.000Z | 2022-01-09T16:37:34.000Z | # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
''' Imports '''
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.optim.lr_scheduler import StepLR
import argparse
import random
import numpy as np
import time
from tqdm import tqdm
import matplotlib... | 34.494253 | 232 | 0.721315 | # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
''' Imports '''
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.optim.lr_scheduler import StepLR
import argparse
import random
import numpy as np
import time
from tqdm import tqdm
import matplotlib... | 631 | 0 | 24 |
f167c13fb9a6fa79b72ac03dc561d070112c7b79 | 1,214 | py | Python | 226.invert-binary-tree.py | windard/leeeeee | 0107a5f95746592ca4fe78d2b5875cf65b1910e7 | [
"MIT"
] | null | null | null | 226.invert-binary-tree.py | windard/leeeeee | 0107a5f95746592ca4fe78d2b5875cf65b1910e7 | [
"MIT"
] | null | null | null | 226.invert-binary-tree.py | windard/leeeeee | 0107a5f95746592ca4fe78d2b5875cf65b1910e7 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=226 lang=python
#
# [226] Invert Binary Tree
#
# https://leetcode.com/problems/invert-binary-tree/description/
#
# algorithms
# Easy (56.72%)
# Total Accepted: 297.1K
# Total Submissions: 522.5K
# Testcase Example: '[4,2,7,1,3,6,9]'
#
# Invert a binary tree.
#
# Example:
#
# Input:
#
#
# ... | 18.393939 | 77 | 0.553542 | #
# @lc app=leetcode id=226 lang=python
#
# [226] Invert Binary Tree
#
# https://leetcode.com/problems/invert-binary-tree/description/
#
# algorithms
# Easy (56.72%)
# Total Accepted: 297.1K
# Total Submissions: 522.5K
# Testcase Example: '[4,2,7,1,3,6,9]'
#
# Invert a binary tree.
#
# Example:
#
# Input:
#
#
# ... | 0 | 351 | 23 |
ea3a96f8d11422a1ee7342ce72973227c97bad62 | 476 | py | Python | Blackjack/functions.py | Peter380/Python | 03b6cfda249cd538711d6a047a2e852dc91f84c5 | [
"MIT"
] | null | null | null | Blackjack/functions.py | Peter380/Python | 03b6cfda249cd538711d6a047a2e852dc91f84c5 | [
"MIT"
] | null | null | null | Blackjack/functions.py | Peter380/Python | 03b6cfda249cd538711d6a047a2e852dc91f84c5 | [
"MIT"
] | null | null | null | import os
#Functions for Blackjack
| 22.666667 | 82 | 0.596639 | import os
#Functions for Blackjack
def display_players_cards(Player):
for card in Player.hand:
print(card)
def get_players_bet():
valid_input = False
while valid_input == False:
try:
bet = int(input("How much are you betting? Please insert a number: "))
vali... | 360 | 0 | 76 |
22c5a1b7e06dc39bf91f470930269579fc50fe4b | 9,524 | py | Python | ait/dsn/cfdp/machines/machine.py | kmarwah/AIT-DSN | 338614dfef6713431f79d6daaffc0e4303be0ced | [
"MIT"
] | 12 | 2019-01-30T17:43:51.000Z | 2022-02-23T03:36:57.000Z | ait/dsn/cfdp/machines/machine.py | kmarwah/AIT-DSN | 338614dfef6713431f79d6daaffc0e4303be0ced | [
"MIT"
] | 117 | 2018-04-16T16:11:48.000Z | 2022-03-31T18:21:24.000Z | ait/dsn/cfdp/machines/machine.py | kmarwah/AIT-DSN | 338614dfef6713431f79d6daaffc0e4303be0ced | [
"MIT"
] | 12 | 2018-08-30T15:52:56.000Z | 2022-01-12T19:52:04.000Z | # Advanced Multi-Mission Operations System (AMMOS) Instrument Toolkit (AIT)
# Bespoke Link to Instruments and Small Satellites (BLISS)
#
# Copyright 2018, by the California Institute of Technology. ALL RIGHTS
# RESERVED. United States Government Sponsorship acknowledged. Any
# commercial use must be negotiated with the... | 36.212928 | 114 | 0.653507 | # Advanced Multi-Mission Operations System (AMMOS) Instrument Toolkit (AIT)
# Bespoke Link to Instruments and Small Satellites (BLISS)
#
# Copyright 2018, by the California Institute of Technology. ALL RIGHTS
# RESERVED. United States Government Sponsorship acknowledged. Any
# commercial use must be negotiated with the... | 4,168 | 3,843 | 203 |
167538b2fcb361c4fd74d8a7824450a235f4128c | 27,895 | py | Python | member/views.py | pincoin/rakmai | d9daa399aff50712a86b2dec9d94e622237b25b0 | [
"MIT"
] | 11 | 2018-04-02T16:36:19.000Z | 2019-07-10T05:54:58.000Z | member/views.py | pincoin/rakmai | d9daa399aff50712a86b2dec9d94e622237b25b0 | [
"MIT"
] | 22 | 2019-01-01T20:40:21.000Z | 2022-02-10T08:06:39.000Z | member/views.py | pincoin/rakmai | d9daa399aff50712a86b2dec9d94e622237b25b0 | [
"MIT"
] | 4 | 2019-03-12T14:24:37.000Z | 2022-01-07T16:20:22.000Z | import json
import logging
import re
import uuid
from datetime import datetime
import requests
from allauth.account.models import EmailAddress
from allauth.account.views import (
LoginView, LogoutView, SignupView,
PasswordChangeView, PasswordSetView,
PasswordResetView, PasswordResetDoneView, PasswordResetF... | 42.915385 | 120 | 0.59197 | import json
import logging
import re
import uuid
from datetime import datetime
import requests
from allauth.account.models import EmailAddress
from allauth.account.views import (
LoginView, LogoutView, SignupView,
PasswordChangeView, PasswordSetView,
PasswordResetView, PasswordResetDoneView, PasswordResetF... | 20,900 | 4,681 | 552 |
6702ad0203698101aea2205d1430ecdc7231ca29 | 1,011 | py | Python | TestPython/win32_test.py | ppcrong/TestPython | 6a87d09e31ad662ce1dea707118d1e914dfeaba7 | [
"Apache-2.0"
] | null | null | null | TestPython/win32_test.py | ppcrong/TestPython | 6a87d09e31ad662ce1dea707118d1e914dfeaba7 | [
"Apache-2.0"
] | null | null | null | TestPython/win32_test.py | ppcrong/TestPython | 6a87d09e31ad662ce1dea707118d1e914dfeaba7 | [
"Apache-2.0"
] | null | null | null | """
ref: https://blog.csdn.net/chengqiuming/article/details/78601000
"""
import win32gui
from win32con import *
wc = win32gui.WNDCLASS()
wc.hbrBackground = COLOR_BTNFACE + 1
wc.hCursor = win32gui.LoadCursor(0, IDI_APPLICATION)
wc.lpszClassName = "Python no Windows"
wc.lpfnWndProc = WndProc
reg = win32gui.RegisterCla... | 33.7 | 109 | 0.714144 | """
ref: https://blog.csdn.net/chengqiuming/article/details/78601000
"""
import win32gui
from win32con import *
def WndProc(hwnd, msg, wParam, lParam):
if msg == WM_PAINT:
hdc, ps = win32gui.BeginPaint(hwnd)
rect = win32gui.GetClientRect(hwnd)
win32gui.DrawText(hdc, 'GUI Python', len('GUI ... | 399 | 0 | 23 |
4033af3baa2cce496ab17f96798632a32ab16573 | 1,842 | py | Python | resources/code/train/Python/unix_completers.py | searene/PLDetector | a8052b1d2ba91bfcc3fd4a5252480cf511d8a210 | [
"MIT"
] | 1 | 2020-11-09T08:24:17.000Z | 2020-11-09T08:24:17.000Z | resources/code/train/Python/unix_completers.py | searene/PLDetector | a8052b1d2ba91bfcc3fd4a5252480cf511d8a210 | [
"MIT"
] | null | null | null | resources/code/train/Python/unix_completers.py | searene/PLDetector | a8052b1d2ba91bfcc3fd4a5252480cf511d8a210 | [
"MIT"
] | null | null | null | # This file is part of the Hotwire Shell project API.
# Copyright (C) 2007 Colin Walters <walters@verbum.org>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includin... | 43.857143 | 86 | 0.741585 | # This file is part of the Hotwire Shell project API.
# Copyright (C) 2007 Colin Walters <walters@verbum.org>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includin... | 329 | 11 | 107 |
7b4db5c13a68afc8004647b967a4e4ecd74c7f3b | 1,688 | py | Python | securityheaders/checkers/csp/test_deprecateddirective.py | th3cyb3rc0p/securityheaders | 941264be581dc01afe28f6416f2d7bed79aecfb3 | [
"Apache-2.0"
] | 151 | 2018-07-29T22:34:43.000Z | 2022-03-22T05:08:27.000Z | securityheaders/checkers/csp/test_deprecateddirective.py | th3cyb3rc0p/securityheaders | 941264be581dc01afe28f6416f2d7bed79aecfb3 | [
"Apache-2.0"
] | 5 | 2019-04-24T07:31:36.000Z | 2021-04-15T14:31:23.000Z | securityheaders/checkers/csp/test_deprecateddirective.py | th3cyb3rc0p/securityheaders | 941264be581dc01afe28f6416f2d7bed79aecfb3 | [
"Apache-2.0"
] | 42 | 2018-07-31T08:18:59.000Z | 2022-03-28T08:18:32.000Z | import unittest
from securityheaders.checkers.csp import CSPDeprecatedDirectiveChecker, CSPReportOnlyDeprecatedDirectiveChecker
if __name__ == '__main__':
unittest.main()
| 33.098039 | 116 | 0.659953 | import unittest
from securityheaders.checkers.csp import CSPDeprecatedDirectiveChecker, CSPReportOnlyDeprecatedDirectiveChecker
class DeprectedDirectiveTest(unittest.TestCase):
def setUp(self):
self.x = CSPDeprecatedDirectiveChecker()
self.y = CSPReportOnlyDeprecatedDirectiveChecker()
def te... | 1,241 | 27 | 242 |
cb3b77714fd32c8a065680423d9cd22edd9be990 | 1,483 | py | Python | monlan/datamanagement/SymbolDataManager.py | CameleoGrey/Monlan | 998baa99d375ac28de317c431a724bdbc36ba0ff | [
"Apache-2.0"
] | 3 | 2021-12-04T10:05:10.000Z | 2022-03-18T13:25:17.000Z | monlan/datamanagement/SymbolDataManager.py | CameleoGrey/Monlan | 998baa99d375ac28de317c431a724bdbc36ba0ff | [
"Apache-2.0"
] | null | null | null | monlan/datamanagement/SymbolDataManager.py | CameleoGrey/Monlan | 998baa99d375ac28de317c431a724bdbc36ba0ff | [
"Apache-2.0"
] | 1 | 2021-04-28T18:18:25.000Z | 2021-04-28T18:18:25.000Z |
import pandas as pd
from datetime import datetime
from dateutil import parser
| 35.309524 | 96 | 0.609575 |
import pandas as pd
from datetime import datetime
from dateutil import parser
class SymbolDataManager:
def __init__(self, rawDataDir=None):
if rawDataDir is None:
self.rawDataDir = "../data/raw/"
else:
self.rawDataDir = rawDataDir
pass
def getData(self, symbol,... | 1,270 | 3 | 130 |
ff4152be70b620fb20dbfd2a00e10d70abf195e2 | 2,133 | py | Python | hooks/post_gen_project.py | insspb/python3-boilerplate | 7d70cd8a7bbbe2805ae5f4cb538996a30b96c736 | [
"MIT"
] | 3 | 2020-04-22T04:09:18.000Z | 2021-12-20T08:44:44.000Z | hooks/post_gen_project.py | insspb/python3-boilerplate | 7d70cd8a7bbbe2805ae5f4cb538996a30b96c736 | [
"MIT"
] | 11 | 2019-08-31T08:37:40.000Z | 2019-08-31T11:25:29.000Z | hooks/post_gen_project.py | insspb/python3-boilerplate | 7d70cd8a7bbbe2805ae5f4cb538996a30b96c736 | [
"MIT"
] | 1 | 2020-11-24T11:18:50.000Z | 2020-11-24T11:18:50.000Z | #!/usr/bin/env python
import os
import shutil
PROJECT_DIRECTORY = os.path.realpath(os.path.curdir)
if __name__ == '__main__':
if '{{ cookiecutter.authors_format }}' == 'Markdown':
remove_file('AUTHORS.rst')
remove_file('docs/source/AUTHORS.rst')
elif '{{ cookiecutter.authors_format }}' == ... | 33.857143 | 94 | 0.65354 | #!/usr/bin/env python
import os
import shutil
PROJECT_DIRECTORY = os.path.realpath(os.path.curdir)
def remove_file(filepath):
os.remove(os.path.join(PROJECT_DIRECTORY, filepath))
def remove_directory(dirpath):
shutil.rmtree(os.path.join(PROJECT_DIRECTORY, dirpath), ignore_errors=False, onerror=None)
if _... | 166 | 0 | 46 |
f86e8dde87c41ff53dc076cdae82faecd78c22b6 | 2,452 | py | Python | custom_components/magicmirror/coordinator.py | sindrebroch/ha-magicmirror-remote | 479d326065d834c695114359bb70b7627c14bf87 | [
"Apache-2.0"
] | 4 | 2021-10-31T00:43:38.000Z | 2022-02-27T19:54:12.000Z | custom_components/magicmirror/coordinator.py | sindrebroch/ha-magicmirror-remote | 479d326065d834c695114359bb70b7627c14bf87 | [
"Apache-2.0"
] | 5 | 2022-02-13T17:50:16.000Z | 2022-03-30T20:55:45.000Z | custom_components/magicmirror/coordinator.py | sindrebroch/ha-magicmirror | 479d326065d834c695114359bb70b7627c14bf87 | [
"Apache-2.0"
] | null | null | null | """The MagicMirror integration."""
from __future__ import annotations
from datetime import timedelta
from aiohttp.client_exceptions import ClientConnectorError
from async_timeout import timeout
from voluptuous.error import Error
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import D... | 34.535211 | 88 | 0.641109 | """The MagicMirror integration."""
from __future__ import annotations
from datetime import timedelta
from aiohttp.client_exceptions import ClientConnectorError
from async_timeout import timeout
from voluptuous.error import Error
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import D... | 0 | 0 | 0 |
799ae99b0615493922bf217db8bdbd66c9dff751 | 1,540 | py | Python | qittle/types/methods/hook.py | muffleo/qittle | 6658e11eae9e6d83bcf0e930803c2f41abd3f4a0 | [
"MIT"
] | 2 | 2020-09-15T19:48:13.000Z | 2020-09-16T10:26:17.000Z | qittle/types/methods/hook.py | cyanlabs-org/qittle | 6658e11eae9e6d83bcf0e930803c2f41abd3f4a0 | [
"MIT"
] | 2 | 2021-05-04T17:15:28.000Z | 2021-05-04T17:20:09.000Z | qittle/types/methods/hook.py | cyanlabs-org/qittle | 6658e11eae9e6d83bcf0e930803c2f41abd3f4a0 | [
"MIT"
] | null | null | null | from qittle.types.responses import hook
from .base import Base
| 27.017544 | 66 | 0.470779 | from qittle.types.responses import hook
from .base import Base
class HookCategory(Base):
async def register(
self,
param: str,
hook_type: int = 1,
txn_type: str = 2,
**kwargs
) -> hook.DescriptionModel:
params = self.get_set_param... | 1,330 | 4 | 139 |
d788a229f5971b43b029ba0f7cd215f7e844b9c5 | 4,328 | py | Python | hug/documentation.py | alisaifee/hug | bfd9b56fb5ce2a8c994219fa5941c28bc7f37bab | [
"MIT"
] | null | null | null | hug/documentation.py | alisaifee/hug | bfd9b56fb5ce2a8c994219fa5941c28bc7f37bab | [
"MIT"
] | null | null | null | hug/documentation.py | alisaifee/hug | bfd9b56fb5ce2a8c994219fa5941c28bc7f37bab | [
"MIT"
] | null | null | null | """hug/documentation.py
Defines tools that automate the creation of documentation for an API build using the Hug Framework
Copyright (C) 2015 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to d... | 50.325581 | 117 | 0.597043 | """hug/documentation.py
Defines tools that automate the creation of documentation for an API build using the Hug Framework
Copyright (C) 2015 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to d... | 0 | 0 | 0 |
c0a073a2a76e8d22abebee5090e5a9a433d0dde2 | 257 | py | Python | src/tests/common_test.py | bronger/bobcat | 93e1cc88069001268824bc832490fd8db178848c | [
"MIT"
] | null | null | null | src/tests/common_test.py | bronger/bobcat | 93e1cc88069001268824bc832490fd8db178848c | [
"MIT"
] | null | null | null | src/tests/common_test.py | bronger/bobcat | 93e1cc88069001268824bc832490fd8db178848c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, os.path
testmodules_path = os.path.dirname(os.path.abspath(__file__))
rootpath = os.path.split(testmodules_path)[0]
sys.path.append(rootpath)
| 23.363636 | 61 | 0.735409 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, os.path
testmodules_path = os.path.dirname(os.path.abspath(__file__))
rootpath = os.path.split(testmodules_path)[0]
sys.path.append(rootpath)
def chdir_to_testbed():
os.chdir(testmodules_path)
| 33 | 0 | 23 |
a5e4382e2fe1aea2bd047a8db71a62a40e246774 | 476 | py | Python | kattis/k_apaxiaaans.py | ivanlyon/exercises | 0792976ae2acb85187b26a52812f9ebdd119b5e8 | [
"MIT"
] | null | null | null | kattis/k_apaxiaaans.py | ivanlyon/exercises | 0792976ae2acb85187b26a52812f9ebdd119b5e8 | [
"MIT"
] | null | null | null | kattis/k_apaxiaaans.py | ivanlyon/exercises | 0792976ae2acb85187b26a52812f9ebdd119b5e8 | [
"MIT"
] | null | null | null | '''
No problem, just process
Status: Accepted
'''
###############################################################################
def main():
"""Read input and print output"""
result = ''
for i in input():
if result:
if i != result[-1]:
result += i
else:
... | 19.04 | 79 | 0.315126 | '''
No problem, just process
Status: Accepted
'''
###############################################################################
def main():
"""Read input and print output"""
result = ''
for i in input():
if result:
if i != result[-1]:
result += i
else:
... | 0 | 0 | 0 |
1b985080d7fa8e77186bd6fbe6fb9bd100a355a6 | 386 | py | Python | lab5/DeanerySystem/day.py | R3zn0w/blue-rapier | 84cdc33e1e327c0a402a4d2e29a8d6f5cda95e9b | [
"MIT"
] | null | null | null | lab5/DeanerySystem/day.py | R3zn0w/blue-rapier | 84cdc33e1e327c0a402a4d2e29a8d6f5cda95e9b | [
"MIT"
] | null | null | null | lab5/DeanerySystem/day.py | R3zn0w/blue-rapier | 84cdc33e1e327c0a402a4d2e29a8d6f5cda95e9b | [
"MIT"
] | null | null | null | from enum import Enum
| 15.44 | 43 | 0.443005 | from enum import Enum
class Day(Enum):
MON = 1
TUE = 2
WED = 3
THU = 4
FRI = 5
SAT = 6
SUN = 7
def difference(self, day):
d = day.value - self.value
if d > 3:
return d - 7
elif d < -3:
return d + 7
else:
return d
de... | 210 | 106 | 46 |
8310fa13339108f5a042b8ebfc3966a35442df24 | 6,667 | py | Python | kolibri/plugins/coach/api.py | bonidjukic/kolibri | bbc6266b02da0cba7cb94c6eeb1b66d5e31d47f5 | [
"MIT"
] | null | null | null | kolibri/plugins/coach/api.py | bonidjukic/kolibri | bbc6266b02da0cba7cb94c6eeb1b66d5e31d47f5 | [
"MIT"
] | 3 | 2016-05-24T21:12:01.000Z | 2017-03-09T22:43:08.000Z | kolibri/plugins/coach/api.py | DXCanas/kolibri | 4571fc5e5482a2dc9cd8f93dd45222a69d8a68b4 | [
"MIT"
] | null | null | null | import datetime
from dateutil.parser import parse
from django.db import connection
from django.db.models import Min
from django.db.models import Q
from django.utils import timezone
from rest_framework import mixins
from rest_framework import pagination
from rest_framework import permissions
from rest_framework import ... | 45.664384 | 122 | 0.744563 | import datetime
from dateutil.parser import parse
from django.db import connection
from django.db.models import Min
from django.db.models import Q
from django.utils import timezone
from rest_framework import mixins
from rest_framework import pagination
from rest_framework import permissions
from rest_framework import ... | 3,724 | 959 | 185 |
0694d04650787688fa74a9c2b1229237ea3faa9f | 2,412 | py | Python | src/student_code.py | azarrias/udacity-nd256-project4 | 295db734b854b477095cf8441498f72ade1ae03c | [
"MIT"
] | null | null | null | src/student_code.py | azarrias/udacity-nd256-project4 | 295db734b854b477095cf8441498f72ade1ae03c | [
"MIT"
] | null | null | null | src/student_code.py | azarrias/udacity-nd256-project4 | 295db734b854b477095cf8441498f72ade1ae03c | [
"MIT"
] | null | null | null | from math import sqrt
from collections import deque
# sort using g + h costs
# implement A* seaarch algorithm
# use euclidean distance to the goal node to determine the h value
# use stack to retrieve elements in reverse order | 37.107692 | 113 | 0.639718 | from math import sqrt
from collections import deque
class Node:
def __init__(self, _id):
self.id = _id
self.parent = None
self.g_value = 0
self.h_value = 0
# sort using g + h costs
def __lt__(self, other):
return self.g_value + self.h_value < other.g_value + other.h... | 2,020 | -10 | 168 |
51d9098bcedee877280944be77e98d7906ec131c | 6,436 | py | Python | venv/lib/python3.5/site-packages/praw/models/reddit/comment.py | cssidy/python-reddit | b9ec30662032993bb55c93aee5e2321fdbd5bf0c | [
"MIT"
] | null | null | null | venv/lib/python3.5/site-packages/praw/models/reddit/comment.py | cssidy/python-reddit | b9ec30662032993bb55c93aee5e2321fdbd5bf0c | [
"MIT"
] | null | null | null | venv/lib/python3.5/site-packages/praw/models/reddit/comment.py | cssidy/python-reddit | b9ec30662032993bb55c93aee5e2321fdbd5bf0c | [
"MIT"
] | null | null | null | """Provide the Comment class."""
from ...const import urljoin
from ...exceptions import ClientException
from ..comment_forest import CommentForest
from .base import RedditBase
from .mixins import InboxableMixin, ThingModerationMixin, UserContentMixin
from .redditor import Redditor
class Comment(RedditBase, InboxableM... | 37.202312 | 79 | 0.629117 | """Provide the Comment class."""
from ...const import urljoin
from ...exceptions import ClientException
from ..comment_forest import CommentForest
from .base import RedditBase
from .mixins import InboxableMixin, ThingModerationMixin, UserContentMixin
from .redditor import Redditor
class Comment(RedditBase, InboxableM... | 0 | 0 | 0 |
4745880a71149ff8c4b63d9e2ab860d088aa92ed | 1,290 | py | Python | venv/Lib/site-packages/networkutil/validation.py | avim2809/CameraSiteBlocker | bfc0434e75e8f3f95c459a4adc86b7673200816e | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/networkutil/validation.py | avim2809/CameraSiteBlocker | bfc0434e75e8f3f95c459a4adc86b7673200816e | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/networkutil/validation.py | avim2809/CameraSiteBlocker | bfc0434e75e8f3f95c459a4adc86b7673200816e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Description: validation functions
from ipaddress import (AddressValueError, NetmaskValueError,
ip_address, IPv4Address, IPv6Address,
ip_network, IPv4Network, IPv6Network)
| 23.454545 | 73 | 0.53876 | # -*- coding: utf-8 -*-
# Description: validation functions
from ipaddress import (AddressValueError, NetmaskValueError,
ip_address, IPv4Address, IPv6Address,
ip_network, IPv4Network, IPv6Network)
def valid_ip(ip,
method=ip_address):
try:
method... | 902 | 0 | 138 |
63728377d479403422a92ef81174df58b96731e3 | 433 | py | Python | nekumo/api/__init__.py | Nekmo/nekumo | 4e0b63de0794a23dbe43eebd88124edd11045cb0 | [
"MIT"
] | null | null | null | nekumo/api/__init__.py | Nekmo/nekumo | 4e0b63de0794a23dbe43eebd88124edd11045cb0 | [
"MIT"
] | 1 | 2016-03-31T17:57:15.000Z | 2016-03-31T17:57:15.000Z | nekumo/api/__init__.py | Nekmo/nekumo | 4e0b63de0794a23dbe43eebd88124edd11045cb0 | [
"MIT"
] | null | null | null | from nekumo.api.config import QuickStart
from nekumo.api.nodes import Dir, File, Node, Image, Video
__author__ = 'nekmo'
stanza_classes = [
# Este listado se recorre para determinar el tipo de clase mejor a usar
# con un nodo. Se usa un método estático is_capable para determinarlo.
# Por ejemplo, tendrem... | 25.470588 | 75 | 0.704388 | from nekumo.api.config import QuickStart
from nekumo.api.nodes import Dir, File, Node, Image, Video
__author__ = 'nekmo'
stanza_classes = [
# Este listado se recorre para determinar el tipo de clase mejor a usar
# con un nodo. Se usa un método estático is_capable para determinarlo.
# Por ejemplo, tendrem... | 0 | 0 | 0 |
cec52e737fbc12c84d80316828bc07b3c2d217d2 | 354 | py | Python | timer.py | edif/Countdown-timer | 625d62f3dabec93b52c5a9f7012177289fd9f067 | [
"MIT"
] | null | null | null | timer.py | edif/Countdown-timer | 625d62f3dabec93b52c5a9f7012177289fd9f067 | [
"MIT"
] | null | null | null | timer.py | edif/Countdown-timer | 625d62f3dabec93b52c5a9f7012177289fd9f067 | [
"MIT"
] | 1 | 2021-05-20T04:25:42.000Z | 2021-05-20T04:25:42.000Z | import time
import pygame
pygame.mixer.init()
alarm = pygame.mixer.Sound("alarm_ding.ogg")
alarm_len = alarm.get_length()
minutes = int(input ("Minutes:"))*60
seconds = int(input("Seconds:"))
timer = minutes + seconds
for i in range(timer):
print("", str(timer - i), end="\r")
time.sleep(1)
alarm.play()
print("t... | 25.285714 | 44 | 0.69209 | import time
import pygame
pygame.mixer.init()
alarm = pygame.mixer.Sound("alarm_ding.ogg")
alarm_len = alarm.get_length()
minutes = int(input ("Minutes:"))*60
seconds = int(input("Seconds:"))
timer = minutes + seconds
for i in range(timer):
print("", str(timer - i), end="\r")
time.sleep(1)
alarm.play()
print("t... | 0 | 0 | 0 |
be7462abf626e2b079537e2f1c3b0b33acf2580d | 2,886 | py | Python | Old PyGame stuff/snake/snake.py | Narcolapser/PyGameLearningByDoing | 460da31b190b2f4d44bb2914215efc04e3fc1c8f | [
"Apache-2.0"
] | null | null | null | Old PyGame stuff/snake/snake.py | Narcolapser/PyGameLearningByDoing | 460da31b190b2f4d44bb2914215efc04e3fc1c8f | [
"Apache-2.0"
] | null | null | null | Old PyGame stuff/snake/snake.py | Narcolapser/PyGameLearningByDoing | 460da31b190b2f4d44bb2914215efc04e3fc1c8f | [
"Apache-2.0"
] | null | null | null | #################################3##################################################################
# Name: Pygame Snake Experiement
# Purpose: Make a simple pygame game to get a handle on PyGame
# Date: 2013/12/22
# Programmer: Toben "Littlefoo" "Narcolapser" Archer
# Version: 0.1
##################################... | 23.088 | 100 | 0.618503 | #################################3##################################################################
# Name: Pygame Snake Experiement
# Purpose: Make a simple pygame game to get a handle on PyGame
# Date: 2013/12/22
# Programmer: Toben "Littlefoo" "Narcolapser" Archer
# Version: 0.1
##################################... | 1,101 | 0 | 161 |
0daa40e3ec7edb96b0896e8da663755d0a55eed0 | 7,692 | py | Python | examples/networking/decentralized-firewall/validator/validator.py | Kiranug/cloud-foundation-fabric | c4b2f85a3b197a6386081431d8e00d69f4b1ccfb | [
"Apache-2.0"
] | 84 | 2022-01-12T21:25:12.000Z | 2022-03-31T05:40:02.000Z | examples/networking/decentralized-firewall/validator/validator.py | Kiranug/cloud-foundation-fabric | c4b2f85a3b197a6386081431d8e00d69f4b1ccfb | [
"Apache-2.0"
] | 77 | 2022-01-12T18:49:05.000Z | 2022-03-29T13:05:17.000Z | examples/networking/decentralized-firewall/validator/validator.py | Kiranug/cloud-foundation-fabric | c4b2f85a3b197a6386081431d8e00d69f4b1ccfb | [
"Apache-2.0"
] | 55 | 2022-01-15T13:47:30.000Z | 2022-03-31T17:35:48.000Z | #!/usr/bin/env python3
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 29.247148 | 77 | 0.656526 | #!/usr/bin/env python3
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 5,158 | 157 | 370 |
01cf7eb68c103c544c2212f518a5b1cea3c6bd46 | 10,355 | py | Python | Livid_Alias8/Alias.py | thomasf/LiveRemoteScripts | 866330653e1561a140e076c9a7ae64dd486e5692 | [
"MIT"
] | 25 | 2015-02-02T21:41:51.000Z | 2022-02-19T13:08:53.000Z | Livid_Alias8/Alias.py | thomasf/LiveRemoteScripts | 866330653e1561a140e076c9a7ae64dd486e5692 | [
"MIT"
] | null | null | null | Livid_Alias8/Alias.py | thomasf/LiveRemoteScripts | 866330653e1561a140e076c9a7ae64dd486e5692 | [
"MIT"
] | 13 | 2015-10-25T04:44:09.000Z | 2020-03-01T18:02:27.000Z | # amounra 0513 : http://www.aumhaa.com
from __future__ import with_statement
import Live
import math
""" _Framework files """
from _Framework.ButtonElement import ButtonElement # Class representing a button a the controller
from _Framework.ButtonMatrixElement import ButtonMatrixElement # Class representing a 2-dimen... | 39.67433 | 182 | 0.764558 | # amounra 0513 : http://www.aumhaa.com
from __future__ import with_statement
import Live
import math
""" _Framework files """
from _Framework.ButtonElement import ButtonElement # Class representing a button a the controller
from _Framework.ButtonMatrixElement import ButtonMatrixElement # Class representing a 2-dimen... | 5,917 | 829 | 70 |
82b9eabb76e95d06a5105bb51a2e9d0e4f0c6e98 | 8,575 | py | Python | flask_datadog/generator/datadog_monitor.py | abuhabuh/flask-datadog-monitor | 8edf4872027fe609638a5aa4decb6125a335ae6d | [
"MIT"
] | 1 | 2021-05-26T14:56:30.000Z | 2021-05-26T14:56:30.000Z | flask_datadog/generator/datadog_monitor.py | abuhabuh/flask-datadog | 8edf4872027fe609638a5aa4decb6125a335ae6d | [
"MIT"
] | null | null | null | flask_datadog/generator/datadog_monitor.py | abuhabuh/flask-datadog | 8edf4872027fe609638a5aa4decb6125a335ae6d | [
"MIT"
] | null | null | null | from dataclasses import dataclass
from typing import Optional
from flask_datadog.generator import endpoint_util
from flask_datadog.shared.datadog_constants import \
MonitorType, \
MonitorSpec
@dataclass(frozen=True)
@dataclass(frozen=True)
class DatadogMonitor:
"""Represents a DataDog Monitor"""
... | 36.489362 | 118 | 0.60793 | from dataclasses import dataclass
from typing import Optional
from flask_datadog.generator import endpoint_util
from flask_datadog.shared.datadog_constants import \
MonitorType, \
MonitorSpec
class DatadogMonitorFormatException(Exception):
pass
@dataclass(frozen=True)
class AlertThresholds:
critica... | 303 | 203 | 71 |