hexsha stringlengths 40 40 | size int64 6 782k | ext stringclasses 7
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 237 | max_stars_repo_name stringlengths 6 72 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses list | max_stars_count int64 1 53k ⌀ | 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 184 | max_issues_repo_name stringlengths 6 72 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses list | max_issues_count int64 1 27.1k ⌀ | 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 184 | max_forks_repo_name stringlengths 6 72 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses list | max_forks_count int64 1 12.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 6 782k | avg_line_length float64 2.75 664k | max_line_length int64 5 782k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
62db697283a0c08424580ebe3b1a39720c394b35 | 919 | py | Python | top/clearlight/base/liaoxuefeng/object_oriented/Extends_polymorphic.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | 1 | 2020-01-16T09:23:43.000Z | 2020-01-16T09:23:43.000Z | top/clearlight/base/liaoxuefeng/object_oriented/Extends_polymorphic.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | top/clearlight/base/liaoxuefeng/object_oriented/Extends_polymorphic.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | # 继承和多态
# 继承可以把父类的所有功能都直接拿过来,这样就不必重零做起,
# 子类只需要新增自己特有的方法,也可以把父类不适合的方法覆盖重写
# 定义一个class的时候, 我们实际上就定义了一种数据类型
class Animal(object):
def run(self):
print('Animal is running...')
def eat(self):
print('Eating meat...')
class Dog(Animal):
# 重写方法
# def run(self):
# print('Dog is runn... | 15.065574 | 46 | 0.648531 |
b8e3f5c619813825de9ec2a2774cbeca04e783a5 | 3,780 | py | Python | python/oneflow/compatible/single_client/nn/modules/pixelshuffle.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 1 | 2021-09-13T02:34:53.000Z | 2021-09-13T02:34:53.000Z | python/oneflow/compatible/single_client/nn/modules/pixelshuffle.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/compatible/single_client/nn/modules/pixelshuffle.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 1 | 2021-01-17T03:34:39.000Z | 2021-01-17T03:34:39.000Z | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 35.327103 | 116 | 0.634392 |
627b37c23f1add633fdc363006e8c7b7d7db3f5d | 6,048 | py | Python | tests/utils/tensorflow/test_model_data.py | YourThomasLee/rasa | 501b1b312c158e19e54c67cbca8ed3728ea60ca3 | [
"Apache-2.0"
] | 5 | 2020-08-28T06:44:31.000Z | 2021-03-14T18:46:01.000Z | tests/utils/test_model_data.py | alfredfrancis/rasa | d8d226408f20cc2563c3aefbccef3e364a447666 | [
"Apache-2.0"
] | 75 | 2020-08-06T08:55:42.000Z | 2022-03-01T13:22:11.000Z | tests/utils/test_model_data.py | alfredfrancis/rasa | d8d226408f20cc2563c3aefbccef3e364a447666 | [
"Apache-2.0"
] | 3 | 2019-02-27T10:13:16.000Z | 2019-07-26T08:33:45.000Z | import copy
import pytest
import scipy.sparse
import numpy as np
from rasa.utils.tensorflow.model_data import RasaModelData
@pytest.fixture
async def model_data() -> RasaModelData:
return RasaModelData(
label_key="intent_ids",
data={
"text_features": [
np.array(
... | 31.831579 | 88 | 0.578869 |
65563f89674ced418e0c14f9168f5f6695efa7ab | 3,647 | py | Python | src/main.py | Somsubhra/Enrich | cf1e69b86ceb64c8b09c98b442e09c1196b50125 | [
"MIT"
] | 1 | 2015-11-30T09:27:51.000Z | 2015-11-30T09:27:51.000Z | src/main.py | Somsubhra/Enrich | cf1e69b86ceb64c8b09c98b442e09c1196b50125 | [
"MIT"
] | null | null | null | src/main.py | Somsubhra/Enrich | cf1e69b86ceb64c8b09c98b442e09c1196b50125 | [
"MIT"
] | null | null | null | # Headers
__author__ = 'Somsubhra Bairi'
__email__ = 'somsubhra.bairi@gmail.com'
# All imports
import sys
from os import path
from webapp import WebApp
from corpus import TxtDump
from corpus import Sanitizer
from corpus import Stemmer
from features import TermFrequency
from features import DocumentFrequency
from fea... | 30.647059 | 96 | 0.574445 |
02f9280feee77bf7dee61d4f6ed1b6f37f453c17 | 2,853 | py | Python | src/ztc/net/__init__.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | src/ztc/net/__init__.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | src/ztc/net/__init__.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | #!/usr/bin/env python
# pylint: disable-msg=W0232,R0903
"""
net module for ZTC - contains additional network metrics
Copyright (c) 2010-2011 Vladimir Rusinov <vladimir@greenmice.info>
Copyright (c) 2010 Murano Software [http://muranosoft.com]
Copyright (c) 2010 Wrike, Inc. [http://wrike.com]
Licensed under GNU GPL v.3... | 32.793103 | 78 | 0.56572 |
02fdfc38fda1d6ae1a8dcf6a1efab80cbf019323 | 59,149 | py | Python | Packs/CarbonBlackEnterpriseEDR/Integrations/CarbonBlackEnterpriseEDR/CarbonBlackEnterpriseEDR.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CarbonBlackEnterpriseEDR/Integrations/CarbonBlackEnterpriseEDR/CarbonBlackEnterpriseEDR.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CarbonBlackEnterpriseEDR/Integrations/CarbonBlackEnterpriseEDR/CarbonBlackEnterpriseEDR.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from typing import Union, Dict, Optional, Any, Tuple, List
import dateparser
import demistomock as demisto
import requests
from CommonServerPython import * # noqa: E402 lgtm [py/polluting-import]
from CommonServerUserPython import * # noqa: E402 lgtm [py/polluting-import]
# Disable insecure warnings
requests.packa... | 40.820566 | 120 | 0.634804 |
b8a68349f48cd2c76ff0082953cd2484d7b55e4b | 3,888 | py | Python | svenMain.py | SvenElyes/SvenFPQualityMatch | 31a4681568786139d2e31c8a4d32346f24c047c4 | [
"MIT"
] | 1 | 2020-12-31T01:57:33.000Z | 2020-12-31T01:57:33.000Z | svenMain.py | SvenElyes/SvenFPQualityMatch | 31a4681568786139d2e31c8a4d32346f24c047c4 | [
"MIT"
] | null | null | null | svenMain.py | SvenElyes/SvenFPQualityMatch | 31a4681568786139d2e31c8a4d32346f24c047c4 | [
"MIT"
] | null | null | null | #this is a main file, to get the whole workflow of Sven Leschbers anfaenger Praktikum.
import os
import pathlib
videos = sorted(os.listdir('./IMAGES/'))
videos.remove('.DS_Store')
videos.remove('temptrack.mp4')
for i in range (0,len(videos),2):
#for i in range(2,4,2):
video = videos[i]
video_label = vid... | 47.414634 | 197 | 0.737654 |
a2c7802686c8eff3eca7ab9d68b6adc3d14e686a | 6,482 | py | Python | frappe-bench/apps/erpnext/erpnext/stock/doctype/batch/test_batch.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/stock/doctype/batch/test_batch.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/stock/doctype/batch/test_batch.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.exceptions import ValidationError
import unittest
from erpnext.stock.doctype.batch.batch import get_batch_qty, UnableToSelect... | 28.060606 | 102 | 0.710737 |
a7dabe34604f6ce18990a2c16f4c066f973450a7 | 22,717 | py | Python | scripts/turtle_dance.py | marvinferber/turtlebot_easyprog | 8d6bca3a112cc78aa46b1a3e4a293eb4041b071c | [
"Apache-2.0"
] | null | null | null | scripts/turtle_dance.py | marvinferber/turtlebot_easyprog | 8d6bca3a112cc78aa46b1a3e4a293eb4041b071c | [
"Apache-2.0"
] | null | null | null | scripts/turtle_dance.py | marvinferber/turtlebot_easyprog | 8d6bca3a112cc78aa46b1a3e4a293eb4041b071c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2016 Katja Fiedler, Claudia Buhl, Marvin Ferber
#
# 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/... | 37.302135 | 127 | 0.577893 |
cbfa8aab275f3185876c5dce4ebf1776a4c24a91 | 11,676 | py | Python | CI-Python/qa327_test/frontend/test_buy.py | michael-fourie/Mags_Co | b9c8ae1730fabde3da95ed0f271ff061505a06c2 | [
"MIT"
] | 3 | 2020-11-06T21:54:57.000Z | 2020-12-10T22:06:24.000Z | CI-Python/qa327_test/frontend/test_buy.py | michael-fourie/Mags_Co | b9c8ae1730fabde3da95ed0f271ff061505a06c2 | [
"MIT"
] | 3 | 2020-11-30T01:04:41.000Z | 2020-12-13T19:29:45.000Z | CI-Python/qa327_test/frontend/test_buy.py | michael-fourie/Mags_Co | b9c8ae1730fabde3da95ed0f271ff061505a06c2 | [
"MIT"
] | 3 | 2020-11-23T19:25:41.000Z | 2022-02-04T15:18:19.000Z | import pytest
from seleniumbase import BaseCase
from qa327_test.conftest import base_url
from unittest.mock import patch
from qa327.models import db, User, Form, Ticket
from werkzeug.security import generate_password_hash, check_password_hash
import requests
"""
This file defines all buy function unit tests for the fro... | 42.304348 | 105 | 0.649366 |
026ef914ef66d9f95b30c6f90bc5209a991c4dc4 | 1,257 | py | Python | src/visitpy/visit_utils/tests/test_engine.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/visitpy/visit_utils/tests/test_engine.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/visitpy/visit_utils/tests/test_engine.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
# Project developers. See the top-level LICENSE file for dates and other
# details. No copyright assignment is required to contribute to VisIt.
"""
file: test_engine.py
author: Cyrus Harrison (cyrush@llnl.gov)
created: 4/09/2010
descriptio... | 26.1875 | 73 | 0.694511 |
5a2ed645969b1b666d8154ce82c90d64fd8eac96 | 1,744 | py | Python | examples/converter_examples.py | timdebruin/compute-engine | bdd3c080ea330ad911cfb6b02dd41b6c574a7cf4 | [
"Apache-2.0"
] | null | null | null | examples/converter_examples.py | timdebruin/compute-engine | bdd3c080ea330ad911cfb6b02dd41b6c574a7cf4 | [
"Apache-2.0"
] | null | null | null | examples/converter_examples.py | timdebruin/compute-engine | bdd3c080ea330ad911cfb6b02dd41b6c574a7cf4 | [
"Apache-2.0"
] | null | null | null | """Examples of TF lite model conversion."""
import tensorflow as tf
import larq_compute_engine as lqce
import larq_zoo as lqz
# Generate a tf.keras model with our custom bsign op
def testnet():
def shortcut_block(x):
shortcut = x
x = tf.keras.layers.Lambda(lqce.bsign)(x)
x = tf.keras.layers... | 31.709091 | 83 | 0.6875 |
0c67076dc3ff59f1bdded367c840ab9308d67318 | 933 | py | Python | tests/test_xml.py | torsten-rathmann/rdmo-catalog | 8cc58d6c5a94369ed06ed1e1cb96694eba76f519 | [
"CC0-1.0"
] | 10 | 2017-03-17T13:13:44.000Z | 2022-02-09T17:12:03.000Z | tests/test_xml.py | torsten-rathmann/rdmo-catalog | 8cc58d6c5a94369ed06ed1e1cb96694eba76f519 | [
"CC0-1.0"
] | 74 | 2017-12-14T18:42:43.000Z | 2022-03-08T16:22:52.000Z | tests/test_xml.py | torsten-rathmann/rdmo-catalog | 8cc58d6c5a94369ed06ed1e1cb96694eba76f519 | [
"CC0-1.0"
] | 36 | 2017-12-19T17:00:24.000Z | 2022-03-04T13:06:52.000Z | import os
from pathlib import Path
from subprocess import check_call
import xml.etree.ElementTree as ET
import pytest
PATHS = ['rdmorganiser', 'shared']
TAGS = [
'condition',
'attribute',
'optionset',
'option',
'catalog',
'section',
'questionset',
'question',
'task',
'view'
]
... | 20.733333 | 54 | 0.614148 |
0c7f74157b4dc97827d4ca1595fc5c0cbd71f535 | 10,199 | py | Python | mysite/charge/migrations/0001_initial.py | hschueh/TrollersHackNTU | 9303a07909f89b7b2511db1fc5185be35047e0c4 | [
"Apache-2.0"
] | null | null | null | mysite/charge/migrations/0001_initial.py | hschueh/TrollersHackNTU | 9303a07909f89b7b2511db1fc5185be35047e0c4 | [
"Apache-2.0"
] | null | null | null | mysite/charge/migrations/0001_initial.py | hschueh/TrollersHackNTU | 9303a07909f89b7b2511db1fc5185be35047e0c4 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-08-21 09:45
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateM... | 51.251256 | 127 | 0.589175 |
0cf465484986f95d79d40328371c1ea0ef9dda6c | 2,578 | py | Python | d_Ensemble/TestEnsemble.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 1,107 | 2016-09-21T02:18:36.000Z | 2022-03-29T02:52:12.000Z | d_Ensemble/TestEnsemble.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 18 | 2016-12-22T10:24:47.000Z | 2022-03-11T23:18:43.000Z | d_Ensemble/TestEnsemble.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 776 | 2016-12-21T12:08:08.000Z | 2022-03-21T06:12:08.000Z | import os
import sys
root_path = os.path.abspath("../")
if root_path not in sys.path:
sys.path.append(root_path)
import time
from d_Ensemble.AdaBoost import AdaBoost
from d_Ensemble.RandomForest import RandomForest
from _SKlearn.Ensemble import SKAdaBoost, SKRandomForest
from Util.Util import DataUti... | 34.373333 | 90 | 0.613266 |
b2fd5f53cb738edf277334bfaf916c3c47ae37d8 | 630 | py | Python | zencad/examples/1.GeomPrim/1.prim3d/sphere.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | 5 | 2018-04-11T14:11:40.000Z | 2018-09-12T19:03:36.000Z | zencad/examples/1.GeomPrim/1.prim3d/sphere.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | zencad/examples/1.GeomPrim/1.prim3d/sphere.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
ZenCad API example: sphere
"""
from zencad import *
m1 = sphere(r=10)
m2 = sphere(r=10, yaw=deg(135))
m3 = sphere(r=10, pitch=(deg(20), deg(60)))
m4 = sphere(r=10, yaw=deg(135), pitch=(deg(10), deg(45)))
display(m1)
display(m2.right(30))
display(m3.right(60))
display(m4.right(90))
# Pacma... | 20.322581 | 65 | 0.626984 |
654af9a708859e9e3fce07d3edcc1290815bc820 | 1,640 | py | Python | util/cerea_simulator.py | danrauch/arduino-cerea-remote-control | a68609e1601488d0d8cf764d6438f886a54f208a | [
"MIT"
] | null | null | null | util/cerea_simulator.py | danrauch/arduino-cerea-remote-control | a68609e1601488d0d8cf764d6438f886a54f208a | [
"MIT"
] | 11 | 2019-03-13T07:49:56.000Z | 2020-03-22T19:14:28.000Z | util/cerea_simulator.py | danrauch/arduino-cerea-remote-control | a68609e1601488d0d8cf764d6438f886a54f208a | [
"MIT"
] | 1 | 2019-05-30T18:43:40.000Z | 2019-05-30T18:43:40.000Z | import sys
import time
import serial
def cerea_simulation():
'''
cerea_simulation() mimics the serial output behavior of
the Cerea auto-steer system. Can be used for testing and
prototyping of e.g. Arduino controlles without the necessity
of a working Cerea setup.
The settings of the serial ... | 29.285714 | 64 | 0.55 |
334409518486ddc63585128ce15c8ac585c5b70c | 1,786 | py | Python | Problems/UnionFind/MinCostConnectAllPoints/min_cost_connect_all_points.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/UnionFind/MinCostConnectAllPoints/min_cost_connect_all_points.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/UnionFind/MinCostConnectAllPoints/min_cost_connect_all_points.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | def minCostConnectPoints(self, points: List[List[int]]) -> int:
if not points or len(points) == 0:
return 0
size = len(points)
pq = []
uf = UnionFind(size)
for i in range(size):
x1, y1 = points[i]
for j in range(i + 1, size):
x2, y2 = points[j]
... | 29.278689 | 63 | 0.504479 |
68219313a03e7ebd2bca1277c0557329bcdb3151 | 186 | py | Python | Task9.py | cornelia247/cil-internship-cohort-01 | b8184337056d378eab16d26b40b26ed58cd177bb | [
"MIT"
] | null | null | null | Task9.py | cornelia247/cil-internship-cohort-01 | b8184337056d378eab16d26b40b26ed58cd177bb | [
"MIT"
] | null | null | null | Task9.py | cornelia247/cil-internship-cohort-01 | b8184337056d378eab16d26b40b26ed58cd177bb | [
"MIT"
] | null | null | null | img= cv2.imread(r"C:\Users\HP\funbiioye\animal.jpg", 1)
cv2.imshow(img)
imgcopy= img.copy()
cv2.imshow(imgcopy)
resized_imgcopy = cv2.resize(img, (600,600))
cv2.imshow(resized_imgcopy) | 23.25 | 55 | 0.747312 |
6851e67475fa1b473cd6b9082f17f0d3aead785c | 400 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v5_7/update_item_description_based_on_item_master.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v5_7/update_item_description_based_on_item_master.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v5_7/update_item_description_based_on_item_master.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | import frappe
def execute():
name = frappe.db.sql(""" select name from `tabPatch Log` \
where \
patch like 'execute:frappe.db.sql("update `tabProduction Order` pro set description%' """)
if not name:
frappe.db.sql("update `tabProduction Order` pro \
set \
description = (select description from tabItem ... | 30.769231 | 93 | 0.6825 |
502ccff4a8bdfebc792e462922bb99212488ee5e | 811 | py | Python | skil/config.py | pcrete/skil-python | 672a1aa9e8af020c960ab9ee280cbb6b194afc3f | [
"Apache-2.0"
] | 23 | 2018-09-19T13:34:27.000Z | 2022-02-14T09:49:35.000Z | skil/config.py | pcrete/skil-python | 672a1aa9e8af020c960ab9ee280cbb6b194afc3f | [
"Apache-2.0"
] | 33 | 2018-10-18T07:58:05.000Z | 2019-05-16T08:24:12.000Z | skil/config.py | pcrete/skil-python | 672a1aa9e8af020c960ab9ee280cbb6b194afc3f | [
"Apache-2.0"
] | 11 | 2018-10-21T18:58:57.000Z | 2022-02-14T09:49:36.000Z | import json
import os
def mkdir(x):
if not os.path.isdir(x):
os.mkdir(x)
_USER_PATH = os.path.expanduser('~')
_DL4J_DIR = os.path.join(_USER_PATH, '.deeplearning4j')
mkdir(_DL4J_DIR)
_BASE_DIR = os.path.join(_DL4J_DIR, 'pyskil')
mkdir(_BASE_DIR)
_SKIL_DIR = os.path.join(_BASE_DIR, '.skil')
DEFAULT_SKI... | 19.309524 | 55 | 0.648582 |
c5834e8f41dc5646aaaf1da8d6aecc886d304153 | 567 | py | Python | pandas_show.py | lixianyu/DL | 4cf08b2cc8a5478af38c1b00d765548efe396392 | [
"MIT"
] | null | null | null | pandas_show.py | lixianyu/DL | 4cf08b2cc8a5478af38c1b00d765548efe396392 | [
"MIT"
] | null | null | null | pandas_show.py | lixianyu/DL | 4cf08b2cc8a5478af38c1b00d765548efe396392 | [
"MIT"
] | null | null | null | import pandas as pd
% matplotlib inline
df_census = pd.read_csv('census_income_data.csv')
df_a = df_census[df_census['income'] == ' >50K']
df_b = df_census[df_census['income'] == ' <=50K']
ind = df_a['education'].value_counts().index
# bar --- 柱状图
# value_counts 返回的值是按大小排序的
df_a['education'].value_counts().... | 27 | 55 | 0.677249 |
8c626ebdb777e1e3476fdb6adb0a7ececf540621 | 1,214 | py | Python | robot/csdn/fastview3.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2017-10-23T14:58:47.000Z | 2017-10-23T14:58:47.000Z | robot/csdn/fastview3.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | null | null | null | robot/csdn/fastview3.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2018-04-06T07:49:18.000Z | 2018-04-06T07:49:18.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from random import random
import requests
from robot.csdn.fastlist import *
def auto_click(articles, proxies=[]):
if not articles:
return
for ip in proxies:
useful = is_useful(ip)
print(ip, useful)
if not useful:
conti... | 30.35 | 105 | 0.575783 |
2ce2cac677e11837df7cab4589af8424459133fd | 806 | py | Python | new-docs/examples/python/getting-started/application/expenses-flask/app/organization.py | saschajullmann/oso | 85d07c6a1825acba5ec043c917bff6e0f5c7128f | [
"Apache-2.0"
] | null | null | null | new-docs/examples/python/getting-started/application/expenses-flask/app/organization.py | saschajullmann/oso | 85d07c6a1825acba5ec043c917bff6e0f5c7128f | [
"Apache-2.0"
] | 2 | 2021-03-24T19:24:40.000Z | 2021-03-24T19:54:46.000Z | new-docs/examples/python/getting-started/application/expenses-flask/app/organization.py | saschajullmann/oso | 85d07c6a1825acba5ec043c917bff6e0f5c7128f | [
"Apache-2.0"
] | 1 | 2021-03-24T19:51:45.000Z | 2021-03-24T19:51:45.000Z | from dataclasses import dataclass
from flask import Blueprint, jsonify
from werkzeug.exceptions import NotFound
from .authorization import authorize
from .db import query_db
bp = Blueprint("organization", __name__, url_prefix="/organizations")
@dataclass
class Organization:
"""Organization model"""
name: s... | 24.424242 | 79 | 0.66129 |
fa2148ce8685cf55da3e8113325ab064719b54db | 3,735 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/module_utils/xenserver/conftest.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/module_utils/xenserver/conftest.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/module_utils/xenserver/conftest.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2019, Bojan Vitnik <bvitnik@mainstream.rs>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import sys
import importlib
import os
import json
im... | 31.386555 | 127 | 0.702544 |
d70e65df86e09ba0aa2e2b6e50ccec137d3298e7 | 688 | py | Python | Tests/test_planet.py | fdienesch/Solar-System | 617096bcb525a19ee94ff86948b53bd8a65e4386 | [
"MIT"
] | null | null | null | Tests/test_planet.py | fdienesch/Solar-System | 617096bcb525a19ee94ff86948b53bd8a65e4386 | [
"MIT"
] | null | null | null | Tests/test_planet.py | fdienesch/Solar-System | 617096bcb525a19ee94ff86948b53bd8a65e4386 | [
"MIT"
] | null | null | null | from unittest import TestCase
from Objekte.planet import Planet
from Model.solarSysModel import SolarSunModel
from OpenGL.GLUT import *
__author__ = 'floriandienesch'
class TestPlanet(TestCase):
def setUp(self):
glutInit(sys.argv)
glutCreateWindow("Solarsystem v0.9")
self.planet = Plane... | 26.461538 | 103 | 0.674419 |
0ea1bc4b1a0ec7c4e98f13b7efd6245cf86df12b | 754 | py | Python | frappe-bench/apps/erpnext/erpnext/hub_node/data_migration_mapping/hub_message_to_lead/__init__.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/hub_node/data_migration_mapping/hub_message_to_lead/__init__.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/hub_node/data_migration_mapping/hub_message_to_lead/__init__.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | import frappe, json
def pre_process(doc):
return json.loads(doc['data'])
def post_process(remote_doc=None, local_doc=None, **kwargs):
if not local_doc:
return
hub_message = remote_doc
# update hub message on hub
hub_connector = frappe.get_doc('Data Migration Connector', 'Hub Connector')
connection = hub_conn... | 25.133333 | 76 | 0.712202 |
1db9cbed0654a12b5dd26e8e28bf454e7592cfa0 | 865 | py | Python | S5/CS331-SS/PGM_010 - Pass 2 of a 2-pass-assembler.py | joe247/CSE-LABS | bab17548562bdc9c0bc8b15679f07379a9e98dec | [
"MIT"
] | 2 | 2021-02-03T02:03:21.000Z | 2021-07-03T20:24:14.000Z | S5/CS331-SS/PGM_010 - Pass 2 of a 2-pass-assembler.py | joe247/CSE-LABS | bab17548562bdc9c0bc8b15679f07379a9e98dec | [
"MIT"
] | null | null | null | S5/CS331-SS/PGM_010 - Pass 2 of a 2-pass-assembler.py | joe247/CSE-LABS | bab17548562bdc9c0bc8b15679f07379a9e98dec | [
"MIT"
] | null | null | null | import csv
print('INPUT\n')
print('INPUT.asm\n=========\n')
with open('input2.csv', newline='') as IPF:
reader = csv.reader(IPF)
for row in reader:
[print(i, end= '\n' if row.index(i)==3 else '\t') for i in row]
print('\n\nOPTAB.db\n========\n')
with open('optab2.csv', newline='') as OPTF:
reader = csv... | 30.892857 | 71 | 0.576879 |
69949d0fd3391b1729c1af0075a8de817897c86f | 1,722 | py | Python | python/en/archive/topics/temp/data_normalization.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/topics/temp/data_normalization.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/topics/temp/data_normalization.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | '''
data_normalization.py
https://aimldl.blog.me/221627895429
https://livebook.manning.com/book/deep-learning-with-python/chapter-3/190
'''
from keras.datasets import boston_housing
import numpy as np
# Load data
(train_data, train_targets), (test_data, test_targets) = boston_housing.load_data()
print(f'train_data.sh... | 31.888889 | 83 | 0.680023 |
384d8a00acbcc8fa3b3593a54500907906958acb | 9,648 | py | Python | create_dataloader.py | saliAlavi/SegAN | 2b1ec5003e523a883ea9ae123765da1a529676f9 | [
"MIT"
] | 1 | 2022-01-17T18:08:01.000Z | 2022-01-17T18:08:01.000Z | create_dataloader.py | saliAlavi/SegAN | 2b1ec5003e523a883ea9ae123765da1a529676f9 | [
"MIT"
] | null | null | null | create_dataloader.py | saliAlavi/SegAN | 2b1ec5003e523a883ea9ae123765da1a529676f9 | [
"MIT"
] | 2 | 2020-07-31T07:15:40.000Z | 2022-02-27T11:09:12.000Z | import os
import numpy as np
import torch
from PIL import Image
from torch.utils.data import DataLoader, Dataset, random_split
from torchvision import transforms, models
import torchvision.transforms.functional as TF
from torchvision.transforms import Compose, CenterCrop, Normalize, ToTensor
# I have placed a manual ... | 43.264574 | 134 | 0.669051 |
aa944c90982e14fa90c5dbd08186dee09e40bb20 | 10,202 | py | Python | Bowlingkugel.py | UlrichBerntien/Uebungen-Python | 67e6d885dd2319e999979410448364ec4d59dc51 | [
"Apache-2.0"
] | null | null | null | Bowlingkugel.py | UlrichBerntien/Uebungen-Python | 67e6d885dd2319e999979410448364ec4d59dc51 | [
"Apache-2.0"
] | null | null | null | Bowlingkugel.py | UlrichBerntien/Uebungen-Python | 67e6d885dd2319e999979410448364ec4d59dc51 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Bowlingkugel (Simulationen)
https://www.programmieraufgaben.ch/aufgabe/bowlingkugel/sor45wf7
"""
# Programmieraufgabe:
# Die Aufgabe besteht darin, in einem 100-stöckigen Haus das Stockwerk zu
# bestimmen, aus welchem eine Bowlingkugel den freien Fall gerade ... | 38.353383 | 95 | 0.692413 |
2ac6fc86420809007391a221749dcb3899d881ba | 164 | py | Python | 2015/07/map-isis/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2015/07/map-isis/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2015/07/map-isis/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 7 | 2015-04-04T04:45:54.000Z | 2021-02-18T11:12:48.000Z | #!/usr/bin/env python
COPY_GOOGLE_DOC_KEY = '18GcBvY6uaRJCvNhH72v9J1zxlmeft8Mf0-fPaMSz5lY'
# COPY_GOOGLE_DOC_KEY = '0AlXMOHKxzQVRdHZuX1UycXplRlBfLVB0UVNldHJYZmc'
| 27.333333 | 70 | 0.853659 |
2ae460f3d373b9006105abb08bfbf167924dd4e9 | 1,439 | py | Python | src/onegov/recipient/model.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/recipient/model.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/recipient/model.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.orm import Base
from onegov.core.orm.mixins import ContentMixin, TimestampMixin
from onegov.core.orm.types import UUID
from onegov.core.utils import normalize_for_url
from sqlalchemy import Column, Enum, Text
from sqlalchemy_utils import observes
from uuid import uuid4
class GenericRecipient(Base, Co... | 29.367347 | 76 | 0.691452 |
2d8a321c233e7279fd065ed738ca3977c7eabdc5 | 5,487 | py | Python | 0SupervisedLearning.py | bian0505/Pad_Me | c05b899b85a99d982948741e9da10e0a72d054d8 | [
"MIT"
] | null | null | null | 0SupervisedLearning.py | bian0505/Pad_Me | c05b899b85a99d982948741e9da10e0a72d054d8 | [
"MIT"
] | null | null | null | 0SupervisedLearning.py | bian0505/Pad_Me | c05b899b85a99d982948741e9da10e0a72d054d8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Oct 24 13:56:11 2019
@author: bian
"""
import matplotlib.pyplot as plt
import re,cv2,time,os
import eventlet
import people0,people
import find_pad
eventlet.monkey_patch()
f = open("datasheet.csv") # 返回一个文件对象
line = f.readline() # 调用文件的... | 35.4 | 93 | 0.445963 |
930a7207ce842d9a4bfc8173ebb0d87a4b1fa4c0 | 438 | py | Python | PINp/2014/Cheraneva A.S/task_1_24.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PINp/2014/Cheraneva A.S/task_1_24.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PINp/2014/Cheraneva A.S/task_1_24.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача 1. Вариант 24.
#Напишите программу, которая будет сообщать род деятельности и псевдоним под которым скрывается Джон Гриффит Лондон.
#После вывода информации программа должна дожидаться пока пользователь нажмет Enter для выхода.
#Cheraneva A.S.
#23.02.2016
print ("Джон Гриффит Лондон - американский писатель, ... | 36.5 | 130 | 0.80137 |
fadb972a5d88c51cd37a2e0f8487b4c75f2a60e4 | 75 | py | Python | basics/fomratted-printing.py | karinakozarova/Learning-Python | 217dfc8ca6931a238445daf0b84e188c02916c52 | [
"MIT"
] | 1 | 2019-04-07T23:14:29.000Z | 2019-04-07T23:14:29.000Z | basics/fomratted-printing.py | karinakozarova/Learning-Python | 217dfc8ca6931a238445daf0b84e188c02916c52 | [
"MIT"
] | null | null | null | basics/fomratted-printing.py | karinakozarova/Learning-Python | 217dfc8ca6931a238445daf0b84e188c02916c52 | [
"MIT"
] | null | null | null | username = 3
password = 4
print("{0} adfd {1}".format(username, password) ) | 25 | 49 | 0.68 |
87bbdea304b9afc60f4c78a509db2a0a9e8d8f4a | 2,247 | py | Python | research/nlp/hypertext/src/mobius_linear.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/nlp/hypertext/src/mobius_linear.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/nlp/hypertext/src/mobius_linear.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 38.084746 | 78 | 0.656431 |
87c48789791570a4f54a018ab7da1f78537379ba | 128 | py | Python | frds/measures/__init__.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | 31 | 2020-06-17T13:19:12.000Z | 2022-03-27T08:56:38.000Z | frds/measures/__init__.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | null | null | null | frds/measures/__init__.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | 8 | 2020-06-14T15:21:51.000Z | 2021-09-29T06:28:53.000Z | r"""`frds.measures` package provides built-in measures.
"""
from .bank import *
from .corporate import *
from .general import * | 21.333333 | 55 | 0.726563 |
e202f62f4d0c2d0180191bf84da979a26895dcab | 4,449 | py | Python | test/test_npu/test_network_ops/test_mean.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test_mean.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test_mean.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020, Huawei Technologies.All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law... | 43.617647 | 131 | 0.636098 |
ea6e9ce91e256476000dff3d00332adf5a647222 | 3,012 | py | Python | src/encrypt_tools.py | minhluu2000/AggiePass | a86198b26e5fbec0f2de68f88fc4fd6aac362233 | [
"MIT"
] | null | null | null | src/encrypt_tools.py | minhluu2000/AggiePass | a86198b26e5fbec0f2de68f88fc4fd6aac362233 | [
"MIT"
] | null | null | null | src/encrypt_tools.py | minhluu2000/AggiePass | a86198b26e5fbec0f2de68f88fc4fd6aac362233 | [
"MIT"
] | null | null | null | from pandas import DataFrame
import secrets
import base64
import hashlib
import bcrypt
from Crypto import Random
from Crypto.Cipher import AES
class AESCipher(object):
def __init__(self, key):
self.bs = AES.block_size
self.key = hashlib.sha256(key.encode()).digest()
def encrypt(self, raw):
... | 27.888889 | 81 | 0.654382 |
17a7d1cd171f51a2f42cc86941824f7f2e9d1942 | 306 | py | Python | Problems/Stack/Easy/NextGreaterElement1/test_next_greater_element_1.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | 1 | 2021-08-16T14:52:05.000Z | 2021-08-16T14:52:05.000Z | Problems/Stack/Easy/NextGreaterElement1/test_next_greater_element_1.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/Stack/Easy/NextGreaterElement1/test_next_greater_element_1.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | from unittest import TestCase
from next_greater_element_1 import nextGreaterElement
class Test(TestCase):
def test_next_greater_element(self):
self.assertEqual(nextGreaterElement([4, 1, 2], [1, 3, 4, 2]), [-1, 3, -1])
self.assertEqual(nextGreaterElement([2, 4], [1, 2, 3, 4]), [3, -1]) | 43.714286 | 82 | 0.683007 |
aa20a74ca0d9ecdc68deff998abbeac8eb998f81 | 5,363 | py | Python | src/test/tests/plots/vector.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/plots/vector.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/test/tests/plots/vector.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: vector.py
#
# Tests: vector - 3D rectilinear, unstructured single domain
# plots - vector, plus interactions with some operators.
#
# Defect ID: '4954
#
# Programmer: Hank Chi... | 22.253112 | 121 | 0.709118 |
eaae61253e95166a7c153521bde4334e18887daa | 485 | py | Python | scripts/HelloPython/global_and_local_Var.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | scripts/HelloPython/global_and_local_Var.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | scripts/HelloPython/global_and_local_Var.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | #!/usr/bin/env python
# ------------------------------------------------
# --- global_and_local_Var.py ----
# Version vom 19.09.2019 by OJ
# -------------------------------------------------
# WHS - Campus Bocholt - ROP
# globale Variablen - Demo
# -------------------------------------------------
# globale Variable
... | 22.045455 | 59 | 0.445361 |
dc8d51bea176e642474896d2f29d93b5fb8c7763 | 3,642 | py | Python | src/onegov/winterthur/collections/address.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/winterthur/collections/address.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/winterthur/collections/address.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from concurrent.futures import ThreadPoolExecutor
from io import BytesIO
from onegov.core.collection import GenericCollection
from onegov.core.csv import CSVFile
from onegov.core.orm import as_selectable
from onegov.winterthur.models import WinterthurAddress
from pycurl import Curl
from sqlalchemy import select, func
... | 30.35 | 79 | 0.618616 |
f4c7715c2892d807504d1b4f20d2bbfa237740be | 7,455 | py | Python | python/oneflow/framework/check_point_v2.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/framework/check_point_v2.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/framework/check_point_v2.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 35.165094 | 199 | 0.664252 |
8751a04a69a9b944cd91ae177b6eb16ab1a43c39 | 1,747 | py | Python | venv/Lib/site-packages/pynance/tst/unit/learn/test_metrics.py | LeonardoHMS/imobi | 6b2b97a05df67ea7d493f7b601382f65c6629cc2 | [
"MIT"
] | 35 | 2015-03-12T04:16:14.000Z | 2020-12-17T18:10:15.000Z | venv/Lib/site-packages/pynance/tst/unit/learn/test_metrics.py | LeonardoHMS/imobi | 6b2b97a05df67ea7d493f7b601382f65c6629cc2 | [
"MIT"
] | 31 | 2015-03-16T21:31:04.000Z | 2021-01-26T00:12:34.000Z | venv/Lib/site-packages/pynance/tst/unit/learn/test_metrics.py | LeonardoHMS/imobi | 6b2b97a05df67ea7d493f7b601382f65c6629cc2 | [
"MIT"
] | 18 | 2015-09-30T10:40:26.000Z | 2021-01-25T21:20:44.000Z | """
Copyright (c) 2016 Marshall Farrier
license http://opensource.org/licenses/MIT
@author: Marshall Farrier
@contact: marshalldfarrier@gmail.com
@since: 2016-02-01
@summary: Unit tests for machine learning metrics
"""
import unittest
import numpy as np
import pynance as pn
class TestMetrics(unittest.TestCase):
... | 28.177419 | 80 | 0.534058 |
5e419f616c055455309228cff6105da33670335e | 669 | py | Python | Bachelor_Arbeit/Beobachtungen/calc_stats.py | terben/Linux_Deutsch_Jupyter | 1980dacc970fc2905380624c941b5ed31aaa9bad | [
"CC-BY-4.0"
] | 1 | 2022-01-24T17:17:57.000Z | 2022-01-24T17:17:57.000Z | Bachelor_Arbeit/Beobachtungen/calc_stats.py | terben/Linux_Deutsch_Jupyter | 1980dacc970fc2905380624c941b5ed31aaa9bad | [
"CC-BY-4.0"
] | null | null | null | Bachelor_Arbeit/Beobachtungen/calc_stats.py | terben/Linux_Deutsch_Jupyter | 1980dacc970fc2905380624c941b5ed31aaa9bad | [
"CC-BY-4.0"
] | 1 | 2019-11-28T11:58:57.000Z | 2019-11-28T11:58:57.000Z | # Sehr einfaches Python Programm zur Berechnung von Mittelwert und
# Standardabweichung einer Textdatei mit einer Zahlenspalte
#
# Wir führen keine wirklichen Tests für die Korrektheit der
# Eingangsdaten durch.
import sys
import os.path as op
import numpy as np
# Wir brauchen zwei Argumente: Die Datei und die Spalte... | 26.76 | 66 | 0.689088 |
5e8507abe9c54d9336a956213d23f5a5895a61e9 | 11,494 | py | Python | src/backend/DB/dbModels.py | tonyLyx1/CSC4001-Better-SIS | 98c69317a2c2ea4bfe45b3fc6f3db4766c4aae91 | [
"MIT"
] | 2 | 2021-04-07T03:12:33.000Z | 2021-05-25T10:01:40.000Z | src/backend/DB/dbModels.py | tonyLyx1/CSC4001-Better-SIS | 98c69317a2c2ea4bfe45b3fc6f3db4766c4aae91 | [
"MIT"
] | null | null | null | src/backend/DB/dbModels.py | tonyLyx1/CSC4001-Better-SIS | 98c69317a2c2ea4bfe45b3fc6f3db4766c4aae91 | [
"MIT"
] | 3 | 2021-04-07T03:12:44.000Z | 2021-04-13T11:21:03.000Z | # import sqlite3
import hashlib
# from random import randint, choice
import random
from datetime import datetime, time
from flask import Flask
from flask.helpers import get_flashed_messages, send_file
# from flask.globals import session
from flask_sqlalchemy import SQLAlchemy
SQLALCHEMY_DATABASE_URI = 'sql... | 33.805882 | 140 | 0.558117 |
801e0d3ec4d0014bc2e769d700e5effdfdb5efd6 | 4,577 | py | Python | src/projectEuler/lib/sieves.py | scrasmussen/ProsaicOeuvre | e7a5fa61f60acf9a02171235b0855d10341cdefc | [
"MIT"
] | null | null | null | src/projectEuler/lib/sieves.py | scrasmussen/ProsaicOeuvre | e7a5fa61f60acf9a02171235b0855d10341cdefc | [
"MIT"
] | 1 | 2021-07-02T23:08:16.000Z | 2021-07-02T23:10:42.000Z | src/projectEuler/lib/sieves.py | scrasmussen/ProsaicOeuvre | e7a5fa61f60acf9a02171235b0855d10341cdefc | [
"MIT"
] | null | null | null | import numpy as np
import math
class Sieves:
def __init__(self, size):
self.n = math.ceil(int(size/2))
self.A = np.zeros(self.n, int)
# Sieve of Eratosthenes
#
# Sift the Two's and Sift the Three's,
# The Sieve of Eratosthenes.
# When the multiples sublime,
# The numbers th... | 42.775701 | 84 | 0.608259 |
33b8e14dcd7ee2c8a3df3af246262638f7ec1074 | 2,048 | py | Python | official/cv/ctpn/src/CTPN/BoundingBoxEncode.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/ctpn/src/CTPN/BoundingBoxEncode.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/ctpn/src/CTPN/BoundingBoxEncode.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 36.571429 | 78 | 0.617676 |
6358e1fdb93405f685a8361705019a6987817715 | 595 | py | Python | tests/web.adblockplus.org/conftest.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 9 | 2016-01-29T18:05:29.000Z | 2021-10-06T04:21:55.000Z | tests/web.adblockplus.org/conftest.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 9 | 2015-04-06T19:03:32.000Z | 2019-05-28T13:34:55.000Z | tests/web.adblockplus.org/conftest.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 18 | 2015-04-06T17:42:31.000Z | 2021-10-06T04:26:29.000Z | import os
def pytest_addoption(parser):
parser.addoption('--landing_page_url', action='store',
default='https://adblockplus.org', help='URL address of the landing page.')
parser.addoption('--generic_donation_page', action='store',
default='donate',
... | 37.1875 | 96 | 0.660504 |
63998b9b270f33b8fd63b43608045404e04dcaeb | 354 | py | Python | leetcode/389-Find-the-Difference/FindtheDifference_26lower.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/389-Find-the-Difference/FindtheDifference_26lower.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/389-Find-the-Difference/FindtheDifference_26lower.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution(object):
def findTheDifference(self, s, t):
"""
:type s: str
:type t: str
:rtype: str
"""
diff = [0] * 26
for w in s:
diff[ord(w) - 97] += 1
for w in t:
i = ord(w) - 97
diff[i] -= 1
if diff... | 22.125 | 38 | 0.364407 |
98222051e28a37247b798b96c9df9180649f7d6c | 3,576 | py | Python | research/cv/LearningToSeeInTheDark/src/unet_parts.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/LearningToSeeInTheDark/src/unet_parts.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/LearningToSeeInTheDark/src/unet_parts.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 35.405941 | 118 | 0.643177 |
985f29d7278ee9c189881bf361e013a10e032b2b | 19,473 | py | Python | src/Sephrasto/Sephrasto.py | Ilaris-Tools/Sephrasto | 8574a5b45da8ebfa5f69a775066fd3136da1c718 | [
"MIT"
] | 1 | 2022-02-02T16:15:59.000Z | 2022-02-02T16:15:59.000Z | src/Sephrasto/Sephrasto.py | Ilaris-Tools/Sephrasto | 8574a5b45da8ebfa5f69a775066fd3136da1c718 | [
"MIT"
] | 1 | 2022-01-14T11:04:19.000Z | 2022-01-14T11:04:19.000Z | src/Sephrasto/Sephrasto.py | lukruh/Sephrasto | 8574a5b45da8ebfa5f69a775066fd3136da1c718 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 23 21:30:34 2017
@author: Aeolitus
"""
from PyQt5 import QtWidgets, QtCore, QtGui
import sys
import logging
import os
import os.path
import UI.MainWindow
import CharakterEditor
import DatenbankEditor
import UI.CharakterMain
import UI.DatenbankMain
f... | 47.963054 | 201 | 0.631592 |
f68ad2a174f71e92b15d90682dfbb2acf6bcdc8a | 14,918 | py | Python | profiles.py | WarcraftPriests/sl-shadow-priest | 4c8753592b3cc18c6d2de7e9227e5adb8cef3208 | [
"MIT"
] | 13 | 2020-04-10T17:34:49.000Z | 2022-02-13T04:04:30.000Z | profiles.py | WarcraftPriests/sl-shadow-priest | 4c8753592b3cc18c6d2de7e9227e5adb8cef3208 | [
"MIT"
] | 213 | 2020-04-10T04:15:00.000Z | 2022-01-20T19:18:55.000Z | profiles.py | WarcraftPriests/sl-shadow-priest | 4c8753592b3cc18c6d2de7e9227e5adb8cef3208 | [
"MIT"
] | 7 | 2020-10-08T07:22:08.000Z | 2021-07-08T21:09:33.000Z | """Generates profiles used to sim based on the base profiles"""
import os
from itertools import combinations_with_replacement
import re
import yaml
from internal import utils
with open("config.yml", "r", encoding="utf8") as ymlfile:
config = yaml.load(ymlfile, Loader=yaml.FullLoader)
fightExpressions = {
"pw... | 42.260623 | 131 | 0.599946 |
c3d7fedf3764dec4d955713825854a79995e8cb8 | 1,836 | py | Python | DataProcess/my_utils/aug_utils.py | ZhangQiHang-98/RFID_Scirpt | 0f74087add4cf16e2d201ad4f31cc1abd287db7e | [
"MIT"
] | 3 | 2021-12-24T04:52:03.000Z | 2021-12-27T02:14:49.000Z | DataProcess/my_utils/aug_utils.py | ZhangQiHang-98/RFID_Scirpt | 0f74087add4cf16e2d201ad4f31cc1abd287db7e | [
"MIT"
] | null | null | null | DataProcess/my_utils/aug_utils.py | ZhangQiHang-98/RFID_Scirpt | 0f74087add4cf16e2d201ad4f31cc1abd287db7e | [
"MIT"
] | null | null | null | # !/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@Project :DataProcess
@File :aug_utils.py
@Author :Zhang Qihang
@Description: 数据增强过程中的一些工具函数
@Date :2022/1/18 21:09
"""
import pandas as pd
from scipy import interpolate
import numpy as np
import math
# 插值函数
def my_interpolation(df, kind="cubic"):
... | 27.402985 | 74 | 0.639978 |
61af695255f2b6c9bc6dd084c8b212efb4365502 | 3,331 | py | Python | begin-python/cp10/chapter10.py | Jocs/reading-notes | 26b8331877a2de034b8860bc3e3967893112d52d | [
"MIT"
] | 3 | 2021-08-04T07:59:48.000Z | 2022-03-26T23:58:17.000Z | begin-python/cp10/chapter10.py | Jocs/reading-notes | 26b8331877a2de034b8860bc3e3967893112d52d | [
"MIT"
] | null | null | null | begin-python/cp10/chapter10.py | Jocs/reading-notes | 26b8331877a2de034b8860bc3e3967893112d52d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf8 -*-
# ##自带电池
# Python 标准安装中包括一组模块,称为标准库。
# ####10.1.4 包
# 为了组织好模块,我们可以将模块分组为包。包基本是另外一类模块,有趣的它能够包含其他模块。
# ###10.3 标准库:一些最爱
# ####10.3.1 sys模块
# sys 模块让你能够访问与 Python 联系紧密的变量和函数。
from sys import argv, exit, modules, path, platform, stdin, stdout, stderr
print argv # 用于打印参数
print ... | 20.689441 | 89 | 0.666767 |
9c9e53eb8e6838a929e9c623a8e46672bd3eedf6 | 27,407 | py | Python | Packs/AzureCompute/Integrations/AzureCompute_v2/AzureCompute_v2.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/AzureCompute/Integrations/AzureCompute_v2/AzureCompute_v2.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/AzureCompute/Integrations/AzureCompute_v2/AzureCompute_v2.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
'''GLOBAL VARS'''
API_VERSION = '2018-06-01'
APP_NAME = 'ms-azure-compute'
# Image options to be used in the create_vm_command
IMAGES = {
'u... | 37.187246 | 119 | 0.651184 |
9cc9f2d3c0af0654f057d473c2e3576eaa15b6fe | 3,851 | py | Python | examples/run.py | xinetzone/dash-tests | cd4526caa2f9d906915c31370b3487bdcef92aa4 | [
"Apache-2.0"
] | 1 | 2022-03-01T07:38:32.000Z | 2022-03-01T07:38:32.000Z | examples/run.py | xinetzone/dash-tests | cd4526caa2f9d906915c31370b3487bdcef92aa4 | [
"Apache-2.0"
] | 12 | 2021-07-13T12:33:36.000Z | 2021-07-14T05:25:19.000Z | examples/run.py | xinetzone/dash-book | 1f624e87e2aa02c9931318918df969e44bdd2c07 | [
"Apache-2.0"
] | null | null | null | from examples import intro, callback, figure_n_slider, \
multiple_inputs, multiple_outputs, chained_callback, \
table_callback, state_callback, print_graph, hover_update_graph, \
cross_filter, prevent_update, no_update, callback_context, \
first_load, indirect_result, prevent_initial_call, sync_slider_t... | 43.761364 | 79 | 0.705271 |
dce42d589e8d63e5bfdc1db3341caa1bad324734 | 2,703 | py | Python | Python_GUI/Controller.py | michaelloose/DualStepperController | a18e280ac4612b8b787a3f5217ff0b33215ad7db | [
"MIT"
] | 1 | 2020-12-08T12:15:44.000Z | 2020-12-08T12:15:44.000Z | Python_GUI/Controller.py | michaelloose/DualStepperController | a18e280ac4612b8b787a3f5217ff0b33215ad7db | [
"MIT"
] | null | null | null | Python_GUI/Controller.py | michaelloose/DualStepperController | a18e280ac4612b8b787a3f5217ff0b33215ad7db | [
"MIT"
] | null | null | null | import serial
from MotorController import MotorController
import queue
from PyQt5 import QtCore, QtGui, QtWidgets, uic
#from MyThreading import Worker
from time import sleep
from functools import partial
class Controller:
def __init__(self):
self.threadpool = QtCore.QThreadPool()
self.MotorControl... | 32.566265 | 91 | 0.688494 |
2eab23cd24d84f918fb342d636943b0f9405b3ef | 1,046 | py | Python | kernel/accounts/urls.py | sageteam/behpack | 3b8afb81dc7da70807308af4c8a2d2ab92b1a133 | [
"MIT"
] | null | null | null | kernel/accounts/urls.py | sageteam/behpack | 3b8afb81dc7da70807308af4c8a2d2ab92b1a133 | [
"MIT"
] | null | null | null | kernel/accounts/urls.py | sageteam/behpack | 3b8afb81dc7da70807308af4c8a2d2ab92b1a133 | [
"MIT"
] | null | null | null | from django.urls import re_path
from django.contrib.auth import views as auth_views
from . import views
app_name = 'accounts'
urlpatterns = [
re_path(r'^signup/$', views.SignUpView.as_view(), name='signup'),
re_path(r'^register/$', views.SignUpView.as_view(), name='register'),
re_path(r'^signin/$', views.... | 49.809524 | 101 | 0.691205 |
25fa1729d64afb0d8c870ca4cba902e6fae51593 | 2,086 | py | Python | marsyas-vamp/marsyas/scripts/Python/icme2011_stats_from_pitch_contour.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/Python/icme2011_stats_from_pitch_contour.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/Python/icme2011_stats_from_pitch_contour.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Calculate the stats of a pitch contour txt file
#
# Stats include median, mean, min, max, std dev.
#
import sys
import os
import datetime
import commands
import re
import numpy as np
if len(sys.argv) != 3:
print "Usage: icme2011_stats_from_pitch_contour.py path output_file"
exit(0);
#... | 24.833333 | 72 | 0.563758 |
d3732d3de8f705a7d198fde4c654b5230874881c | 3,552 | py | Python | firmware/scripts/gen_note_macros.py | cwoodall/artemis-synth | a8e9496cf06a4afb002435746d07ca6c6ccdc49b | [
"CC-BY-3.0"
] | null | null | null | firmware/scripts/gen_note_macros.py | cwoodall/artemis-synth | a8e9496cf06a4afb002435746d07ca6c6ccdc49b | [
"CC-BY-3.0"
] | null | null | null | firmware/scripts/gen_note_macros.py | cwoodall/artemis-synth | a8e9496cf06a4afb002435746d07ca6c6ccdc49b | [
"CC-BY-3.0"
] | null | null | null | from cw_fixedpoint import *
# A list of different frequencies for different notes. Stolen from a table on the internet. Conveniently tab seperated
k = """
C0 16.35 2100.
C#0/Db0 17.32 1990.
D0 18.35 1870.
D#0/Eb0 19.45 1770.
E0 20.60 1670.
F0 21.83 1580.
F#0/Gb0 23.12 1490.
G0 24.50 1400.
G#0/Ab0 25.9... | 22.624204 | 118 | 0.606419 |
e222daace67618549345a3bf3f06f814c478c133 | 860 | py | Python | tests/onegov/ticket/test_handler.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/ticket/test_handler.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/ticket/test_handler.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import pytest
from onegov.ticket import Handler
from onegov.ticket.errors import DuplicateHandlerError
def test_invalid_handler_code(handlers):
# it's possible for the registry to not be empty due to other tests
count = len(handlers.registry)
with pytest.raises(AssertionError):
handlers.registe... | 23.243243 | 71 | 0.710465 |
2c9cf407bb65eefce23bd4c0b9e48a216d8483c2 | 86 | py | Python | dewar/wsgi.py | shonenada-archives/dewar | 392b996771a35bc26e9c301cc2a25bad973e8f61 | [
"MIT"
] | null | null | null | dewar/wsgi.py | shonenada-archives/dewar | 392b996771a35bc26e9c301cc2a25bad973e8f61 | [
"MIT"
] | null | null | null | dewar/wsgi.py | shonenada-archives/dewar | 392b996771a35bc26e9c301cc2a25bad973e8f61 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from dewar.app import create_app
application = create_app()
| 14.333333 | 32 | 0.686047 |
1abfd08134e3aa16471e87f1835f1027bcbfe0a6 | 1,121 | py | Python | Codeforces/643-2/A.py | dipta007/Competitive-Programming | 998d47f08984703c5b415b98365ddbc84ad289c4 | [
"MIT"
] | 6 | 2018-10-15T18:45:05.000Z | 2022-03-29T04:30:10.000Z | Codeforces/643-2/A.py | dipta007/Competitive-Programming | 998d47f08984703c5b415b98365ddbc84ad289c4 | [
"MIT"
] | null | null | null | Codeforces/643-2/A.py | dipta007/Competitive-Programming | 998d47f08984703c5b415b98365ddbc84ad289c4 | [
"MIT"
] | 4 | 2018-01-07T06:20:07.000Z | 2019-08-21T15:45:59.000Z | """ Python 3 compatibility tools. """
from __future__ import division, print_function
import itertools
import sys
if sys.version_info[0] < 3:
input = raw_input
range = xrange
filter = itertools.ifilter
map = itertools.imap
zip = itertools.izip
def input1(type=int):
return type(input())
def input2(type... | 14.946667 | 47 | 0.560214 |
37646465b1b84a8e088072db9d8a25e2d86d753c | 5,244 | py | Python | oneflow/python/eager/eager_blob_util.py | xxg1413/oneflow | f2e3c85a25b8aecfb6c0c0af1737833b1a77e135 | [
"Apache-2.0"
] | 2 | 2021-09-10T00:19:49.000Z | 2021-11-16T11:27:20.000Z | oneflow/python/eager/eager_blob_util.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | null | null | null | oneflow/python/eager/eager_blob_util.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 29.627119 | 82 | 0.723684 |
03ecf7a465c2b6cc033b22b17704b6d662932332 | 239 | py | Python | Licence 1/I11/TP3/tp3_3_2.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 8 | 2020-11-26T20:45:12.000Z | 2021-11-29T15:46:22.000Z | Licence 1/I11/TP3/tp3_3_2.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | null | null | null | Licence 1/I11/TP3/tp3_3_2.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 6 | 2020-10-23T15:29:24.000Z | 2021-05-05T19:10:45.000Z | text = input("entrez une chaine de caracteres : ")
isPalindromic = text[0] == text[len(text) - 1]
i, j = 0, len(text)- 1
while i < j and isPalindromic:
isPalindromic = text[i] == text[j]
i, j = i + 1, j - 1
print(isPalindromic)
| 21.727273 | 50 | 0.615063 |
ff6b14ee1aac5b0c69e785b0568a5dc244af3108 | 6,503 | py | Python | project/access.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | project/access.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | project/access.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | from authlib.integrations.flask_oauth2 import current_token
from flask import abort
from flask_login import login_user
from flask_principal import Permission, RoleNeed
from flask_security import current_user
from flask_security.utils import FsPermNeed
from sqlalchemy import and_
from project import app
from project.mo... | 26.983402 | 88 | 0.745041 |
4446bef2b6fdb644fb51e63e39fbed2c2d337a91 | 1,074 | py | Python | leetcode/059-Spiral-Matrix-II/SpiralMatrixII_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/059-Spiral-Matrix-II/SpiralMatrixII_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/059-Spiral-Matrix-II/SpiralMatrixII_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution:
# @param {integer} n
# @return {integer[][]}
def generateMatrix(self, n):
if n < 1:
return []
res = [[0 for _ in range(n)] for _ in range(n)]
top, bottom = 0, n - 1
left, right = 0, n - 1
num = 1
while left < right and top < bottom:... | 29.833333 | 55 | 0.39013 |
9221af44e1d60c44c9006295a88c4b627d598943 | 5,361 | py | Python | algorithm.py | LuisGMM/Num-Lab | 69e41628a14c7b3ea94be44c78653592fe5891cc | [
"MIT"
] | null | null | null | algorithm.py | LuisGMM/Num-Lab | 69e41628a14c7b3ea94be44c78653592fe5891cc | [
"MIT"
] | null | null | null | algorithm.py | LuisGMM/Num-Lab | 69e41628a14c7b3ea94be44c78653592fe5891cc | [
"MIT"
] | null | null | null |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
dt = 0.005
tf = 50
dx = 0.05
xmin = -60
xmax = 60
k0 = 1
sigma0 = 3
x0 = -10
L = 2
V0 = 2
M = 2401
i = 1j
N = int((10/k0)/dt) # Round to the nearest integer number
N = 10000 # Override Number of... | 34.587097 | 175 | 0.614997 |
a6a3e70955686bc39e806916a513a99f6e1d4742 | 639 | py | Python | packages/watchmen-data-kernel/src/watchmen_data_kernel/storage_bridge/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-data-kernel/src/watchmen_data_kernel/storage_bridge/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-data-kernel/src/watchmen_data_kernel/storage_bridge/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from .ask_action_defined_as import parse_action_defined_as
from .ask_from_memory import parse_parameter_in_memory, parse_prerequisite_defined_as, parse_prerequisite_in_memory, \
ParsedMemoryConstantParameter, ParsedMemoryParameter, PrerequisiteDefinedAs, PrerequisiteTest
from .ask_from_storage import parse_condition_f... | 63.9 | 118 | 0.895149 |
3430757b04e8768b90ec07c179087ac5c8e71e07 | 2,769 | py | Python | Liquid-docs/api.py | PasaLab/YAO | 2e70203197cd79f9522d65731ee5dc0eb236b005 | [
"Apache-2.0"
] | 2 | 2021-08-30T14:12:09.000Z | 2022-01-20T02:14:22.000Z | Liquid-docs/api.py | PasaLab/YAO | 2e70203197cd79f9522d65731ee5dc0eb236b005 | [
"Apache-2.0"
] | null | null | null | Liquid-docs/api.py | PasaLab/YAO | 2e70203197cd79f9522d65731ee5dc0eb236b005 | [
"Apache-2.0"
] | null | null | null | import requests
import time
import os
import json
'''Configuration'''
BASE_URL = 'http://yao.example.com'
''''''
sess = requests.Session()
sess.headers.update({'Referer': BASE_URL})
status_map = [
'Created', # 0
'Starting', # 1
'Running', # 2
'Stopped', # 3
'Finished', # 4
'Failed', # 5... | 24.078261 | 211 | 0.608884 |
1b4461d8cf5b139c58eac5d47ad221207b1b58c5 | 8,505 | py | Python | src/onegov/fsi/views/subscription.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/fsi/views/subscription.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/fsi/views/subscription.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from webob import Response
from onegov.core.security import Personal, Secret, Private
from onegov.core.utils import normalize_for_url
from onegov.fsi import FsiApp
from onegov.fsi.collections.subscription import SubscriptionsCollection
from onegov.fsi.forms.subscription import AddFsiSubscriptionForm, \
EditFsiSubs... | 30.593525 | 73 | 0.65244 |
1b61caf28f6df1da17049ad6712c6de90837d53d | 413 | py | Python | INBa/2015/SOSNOVY_M_S/task_5_26.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/SOSNOVY_M_S/task_5_26.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/SOSNOVY_M_S/task_5_26.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача 5. Вариант 26.
#Напишите программу, которая бы при запуске случайным образом отображала имена двух братьев, легендарных основателей Рима.+
#Sosnovy M.S.
#16.03.2016
import random
A =int(random.randint(0,1))
one = " Ромул "
two = ' Рем '
if A == 0:
print('Великие основатели Рима' + one + "и" + two)
else:
... | 25.8125 | 123 | 0.687651 |
9434b478febdb3415e54bc7d1a9cd37d1aa713c7 | 1,841 | py | Python | bindings/python/ensmallen/datasets/__init__.py | LucaCappelletti94/EnsmallenGraph | 572532b6d3f4352bf58f9ccca955376acd95fd89 | [
"MIT"
] | null | null | null | bindings/python/ensmallen/datasets/__init__.py | LucaCappelletti94/EnsmallenGraph | 572532b6d3f4352bf58f9ccca955376acd95fd89 | [
"MIT"
] | null | null | null | bindings/python/ensmallen/datasets/__init__.py | LucaCappelletti94/EnsmallenGraph | 572532b6d3f4352bf58f9ccca955376acd95fd89 | [
"MIT"
] | null | null | null | """Module with datasets."""
from . import (kghub, kgobo, linqs, monarchinitiative, networkrepository,
pheknowlatorkg, string, yue, zenodo, wikidata, wikipedia)
from .get_dataset import (get_all_available_graphs_dataframe,
get_available_graphs_from_repository,
... | 54.147059 | 158 | 0.790331 |
948115776d08f1ff6bb84fd95f4676b6dbb2fbb2 | 636 | py | Python | lego/calculus/nodes/number.py | tipptop3d/Horst-oder-Klaus | 2afda1a64b5ccace74ebc7b806a5e5501c0f12bb | [
"MIT"
] | null | null | null | lego/calculus/nodes/number.py | tipptop3d/Horst-oder-Klaus | 2afda1a64b5ccace74ebc7b806a5e5501c0f12bb | [
"MIT"
] | null | null | null | lego/calculus/nodes/number.py | tipptop3d/Horst-oder-Klaus | 2afda1a64b5ccace74ebc7b806a5e5501c0f12bb | [
"MIT"
] | null | null | null | """Number node. Multiton"""
from . import node
class Number(node.Node):
"""Number node. Multiton"""
_instances = dict()
def __new__(cls, value):
if value in cls._instances:
return cls._instances[value]
else:
obj = super(Number, cls).__new__(cls)
cls._... | 19.272727 | 49 | 0.569182 |
ca97b2fb34a815705ff142dc9c6c2c6c90c2932f | 39,282 | py | Python | Implementation/vibrostudies-backend/db/views.py | VibroStudies/vibrostudies | 24491d4dd193655e3036354174babc4ab17a8639 | [
"MIT"
] | null | null | null | Implementation/vibrostudies-backend/db/views.py | VibroStudies/vibrostudies | 24491d4dd193655e3036354174babc4ab17a8639 | [
"MIT"
] | null | null | null | Implementation/vibrostudies-backend/db/views.py | VibroStudies/vibrostudies | 24491d4dd193655e3036354174babc4ab17a8639 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from rest_framework import viewsets
from rest_framework.filters import OrderingFilter
from rest_framework.decorators import api_view
from .serializers import *
from .models import *
from rest_framework import generics
from django_filters import rest_framework as filters
from django.h... | 50.426187 | 393 | 0.60305 |
048b833178bf2ce82b5a69e76bc8d8cbdceb9141 | 8,796 | py | Python | haas_lib_bundles/python/libraries/qmc6310/qmc6310.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/libraries/qmc6310/qmc6310.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/libraries/qmc6310/qmc6310.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | """
Copyright (C) 2015-2021 Alibaba Group Holding Limited
MicroPython's driver for QMC6310 magnetometer
Author: HaaS
Date: 2021/09/09
"""
from driver import I2C
from micropython import const
import utime
import math
# vendor chip id
QMC6308_IIC_ADDR = const(0x2C)
QMC6310U_IIC_ADDR = const(0x1c)
QMC631... | 28.745098 | 92 | 0.586517 |
bf65ee9415b7584a518e3b35af5df8d39ed13e62 | 16,452 | py | Python | test/test_npu/test_network_ops/test_lstm.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test_lstm.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test_lstm.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020 Huawei Technologies Co., Ltd
# Copyright (c) 2019, Facebook CORPORATION.
# All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/lice... | 44.95082 | 120 | 0.580355 |
78a674b488bcb4cd5f3e3d4e5c091ae06feadc93 | 4,194 | py | Python | repo/service.vpn.manager/libs/utility.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 1 | 2017-11-26T18:18:46.000Z | 2017-11-26T18:18:46.000Z | repo/service.vpn.manager/libs/utility.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | null | null | null | repo/service.vpn.manager/libs/utility.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 3 | 2019-09-30T19:52:05.000Z | 2020-04-12T21:20:56.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Zomboided
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your... | 29.125 | 89 | 0.618264 |
155da8fef3d1a5bb2057068c0a09ea5ebf168b04 | 29,395 | py | Python | .arch/plugins/doc_lcdoc/pre_process.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | 24 | 2021-10-04T22:11:59.000Z | 2022-02-02T21:51:43.000Z | .arch/plugins/doc_lcdoc/pre_process.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | 2 | 2021-10-04T21:51:30.000Z | 2021-10-05T14:15:31.000Z | .arch/plugins/doc_lcdoc/pre_process.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
"""
Add various autogeneratable pages to the docs
See the Flags (-h) regarding possibilities.
"""
import importlib
import inspect
import json
import os
import shutil
import time
from contextlib import contextmanager
from functools import partial
from hashlib import md5
import toml
from devapp.ap... | 33.065242 | 168 | 0.558428 |
e5b7ef946b9a0cdf90ce742524617db086fbcaac | 1,740 | py | Python | Python/app.py | mruessler/Wohnlagenkarte | 6ba9d3819ceb5dbbab5a9da9c1a9743b182575cd | [
"Apache-2.0"
] | null | null | null | Python/app.py | mruessler/Wohnlagenkarte | 6ba9d3819ceb5dbbab5a9da9c1a9743b182575cd | [
"Apache-2.0"
] | null | null | null | Python/app.py | mruessler/Wohnlagenkarte | 6ba9d3819ceb5dbbab5a9da9c1a9743b182575cd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import dash
import dash_core_components as dcc
import dash_html_components as html
import pandas as pd
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
mapbox_access_token = 'pk.eyJ1IjoiYWxpc2hvYmVpcmkiLCJhIjoiY2ozYnM3YTUxMDAxeDMzcGNjbmZyMmplZiJ9.ZjmQ0C2MNs1AzEBC_Syadg'
a... | 28.064516 | 123 | 0.526437 |
e5c9db9712f43be5271ef56b3c6985f0299a0cc3 | 2,533 | py | Python | src/models/chen2017/train.py | kaphka/imi-master-thesis | 2331a3534dc32e30a1333bb21c68c1e1b07ec9e4 | [
"MIT"
] | 2 | 2018-04-27T09:02:15.000Z | 2019-04-19T19:12:13.000Z | src/models/chen2017/train.py | kaphka/imi-master-thesis | 2331a3534dc32e30a1333bb21c68c1e1b07ec9e4 | [
"MIT"
] | 1 | 2019-04-19T19:13:08.000Z | 2021-02-22T21:29:55.000Z | src/models/chen2017/train.py | kaphka/imi-master-thesis | 2331a3534dc32e30a1333bb21c68c1e1b07ec9e4 | [
"MIT"
] | null | null | null |
import json
import os
from pathlib import Path
import torch
import torchvision
import torchvision.transforms as transforms
from torch.utils.data import DataLoader
from inferno.trainers.basic import Trainer
from inferno.trainers.callbacks.logging.tensorboard import TensorboardLogger
import models.selfsupervised.dis... | 30.890244 | 109 | 0.744572 |
005c341455d941c575a3d747085264720a5b3e69 | 3,336 | py | Python | test/test_npu/test_network_ops/run_tests.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/run_tests.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/run_tests.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020 Huawei Technologies Co., Ltd
# Copyright (c) 2019, Facebook CORPORATION.
# All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/lice... | 39.247059 | 131 | 0.705036 |
dadcdfb6e1b8f4b4ee2b293af4cc8ccb49d96f08 | 1,154 | py | Python | packages/watchmen-model/src/watchmen_model/pipeline_kernel/pipeline_trigger_data.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/pipeline_kernel/pipeline_trigger_data.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/pipeline_kernel/pipeline_trigger_data.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from enum import Enum
from typing import Any, Dict, TypeVar
from pydantic import BaseModel
from watchmen_model.admin import PipelineTriggerType
from watchmen_model.common import TenantId
PipelineTriggerTraceId = TypeVar('PipelineTriggerTraceId', bound=str)
class PipelineTriggerData(BaseModel):
# topic name
code:... | 25.086957 | 105 | 0.781629 |
97828c38397b36493137edf4eb838f363355aa0c | 1,400 | py | Python | DataProcess/auto_rotation/eight_freq_build_phase_mat.py | zhangupkai/RFID_Script | 9e05fad86e71dc6bd5dd12650d369f13d5a835c8 | [
"MIT"
] | null | null | null | DataProcess/auto_rotation/eight_freq_build_phase_mat.py | zhangupkai/RFID_Script | 9e05fad86e71dc6bd5dd12650d369f13d5a835c8 | [
"MIT"
] | null | null | null | DataProcess/auto_rotation/eight_freq_build_phase_mat.py | zhangupkai/RFID_Script | 9e05fad86e71dc6bd5dd12650d369f13d5a835c8 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import math
from scipy import interpolate
from filters import hampel
from base_list import get_freq_list
from locate_degree_main import locate_degree
from cal_rotation_cycle_time_main import cal_rotation_cycle_time
rotation_level = 'auto_rotation_... | 29.166667 | 95 | 0.677857 |
c1d5815fa09adcc4fb4717d294b7d2c15e573048 | 3,696 | py | Python | zencad/geom/trans.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | 5 | 2018-04-11T14:11:40.000Z | 2018-09-12T19:03:36.000Z | zencad/geom/trans.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | zencad/geom/trans.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | import sys
import numpy as np
import pickle
import base64 as b64
from OCC.Core.gp import gp_Trsf, gp_Vec, gp_Ax1, gp_Ax2, gp_Pnt, gp_Dir, gp_XYZ, gp_Quaternion
import zencad.util
from zencad.util import point3, vector3
class Transformation:
def __init__(self, trsf):
self._trsf = trsf
def inverse(se... | 19.870968 | 94 | 0.611742 |
e724bf9d6f93e7b02aa242240c2d30df100b7f2a | 2,873 | py | Python | Bikecounter/stations_with_ags.py | tho-wa/virushack | 2bb057b4557969d4bf8899b78fe9fc2d5ef5ae13 | [
"Apache-2.0"
] | 29 | 2020-03-21T00:47:51.000Z | 2021-07-17T15:50:33.000Z | Bikecounter/stations_with_ags.py | tho-wa/virushack | 2bb057b4557969d4bf8899b78fe9fc2d5ef5ae13 | [
"Apache-2.0"
] | 7 | 2020-03-21T14:04:26.000Z | 2022-03-02T08:05:40.000Z | Bikecounter/stations_with_ags.py | tho-wa/virushack | 2bb057b4557969d4bf8899b78fe9fc2d5ef5ae13 | [
"Apache-2.0"
] | 13 | 2020-03-21T01:08:08.000Z | 2020-04-08T17:21:11.000Z | """ Dieses Script kann als Vorlage verwendet werden um lon/lat auf Gemeindeschlüssel
(=ags [amtlicher Gemeindeschlüssel]) zu mappen.
Ich verwende für die Zuordnung einen nearest-neighbor approach.
install geopy by "pip install geopy"
@author Parzival
"""
import pandas as pd
import geopy.distance
import os
import m... | 30.892473 | 113 | 0.679429 |
e753769f6ebc2c6f5e2b438a91084b8c325b41d7 | 968 | pyde | Python | sketches/peano3/peano3.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/peano3/peano3.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/peano3/peano3.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | add_library('Turtle')
import math
num_gen = 4
len_seg = 4
a = 90 # Winkel
axiom = "S"
sentence = axiom
rules = {"S": "SFZFS+F+ZFSFZ-F-SFZFS",
"Z": "ZFSFZ-F-SFZFS+F+ZFSFZ",
}
def setup():
global p
size(400, 400)
this.surface.setTitle("SZ-Peano-Kurve")
background(50)
strokeWeight(1)
... | 18.980392 | 44 | 0.52686 |
e7663430c22328a5e077897956bbf7ab46773d52 | 1,551 | py | Python | test.py | inyukwo1/qgm_decoder | 70e60afec140ec3e2ee04f980a384e1cf28d761c | [
"MIT"
] | null | null | null | test.py | inyukwo1/qgm_decoder | 70e60afec140ec3e2ee04f980a384e1cf28d761c | [
"MIT"
] | null | null | null | test.py | inyukwo1/qgm_decoder | 70e60afec140ec3e2ee04f980a384e1cf28d761c | [
"MIT"
] | null | null | null | import json
import argparse
from commons.utils import eval, test, import_module
if __name__ == '__main__':
# Parse Arguments
parser = argparse.ArgumentParser()
parser.add_argument('--test_config', type=str, default='', help='Model Name')
parser.add_argument('--output_path', type=str, default='./out.sql... | 31.653061 | 106 | 0.678272 |
e774785f3751cedd3d4709d25e743b746cd5f4f6 | 7,521 | py | Python | test/test_npu/test_network_ops/test_slow_conv_dilated2d.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test_slow_conv_dilated2d.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test_slow_conv_dilated2d.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020, Huawei Technologies.All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law... | 45.035928 | 114 | 0.572397 |
ec0379496c4c08a2bfaed55137794a9089705474 | 2,693 | py | Python | Packs/ML/Scripts/DBotPredictOutOfTheBox/DBotPredictOutOfTheBox.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/ML/Scripts/DBotPredictOutOfTheBox/DBotPredictOutOfTheBox.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/ML/Scripts/DBotPredictOutOfTheBox/DBotPredictOutOfTheBox.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | # pylint: disable=no-member
import demisto_ml
from CommonServerPython import *
OUT_OF_THE_BOX_MODEL_NAME = 'demisto_out_of_the_box_model'
OUT_OF_THE_BOX_MODEL_PATH = '/var/oob_model.ftz'
EVALUATION_PATH = '/var/oob_evaluation.json'
HASH_SEED = 5381
def oob_model_exists():
res_model = demisto.executeCommand("get... | 39.602941 | 97 | 0.571853 |
6be53f56e24f8e98fb36e77a503a7dfeffd336ce | 2,746 | py | Python | WebAppExample/WebApp/Main/static/Photos/main.py | wallamejorge/PepqaWebApp | 20896a1224d1a2cea3a137950c4f0306f0269db7 | [
"Apache-2.0"
] | null | null | null | WebAppExample/WebApp/Main/static/Photos/main.py | wallamejorge/PepqaWebApp | 20896a1224d1a2cea3a137950c4f0306f0269db7 | [
"Apache-2.0"
] | null | null | null | WebAppExample/WebApp/Main/static/Photos/main.py | wallamejorge/PepqaWebApp | 20896a1224d1a2cea3a137950c4f0306f0269db7 | [
"Apache-2.0"
] | null | null | null |
# -*- coding: utf-8 -*-
import PIL # MODULO PARA PROCESAR IMAGENES
from PIL import Image
import os # MODULO PARA HACER COSAS EN EL DIRECTORIO
import fnmatch # MODULO PARA COMPARAR EXTENSIONES EN EL DIRECTORIO
import tarfile # MODULO PARA COMPRIMIR
current_dir = os.path.dirname(os.path.abspath(__file__)) # LEEMOS ... | 45.016393 | 126 | 0.690459 |
2b29b00f0c663d58540c8185cd48e2b37286b44f | 4,209 | py | Python | pandemie/tester/strategy.py | marvinsxtr/informaticup-2020-pandemie | 0d37d5236eadfe7bb3cbd7cbfd0e1b7afca74c89 | [
"MIT"
] | null | null | null | pandemie/tester/strategy.py | marvinsxtr/informaticup-2020-pandemie | 0d37d5236eadfe7bb3cbd7cbfd0e1b7afca74c89 | [
"MIT"
] | null | null | null | pandemie/tester/strategy.py | marvinsxtr/informaticup-2020-pandemie | 0d37d5236eadfe7bb3cbd7cbfd0e1b7afca74c89 | [
"MIT"
] | 1 | 2020-03-28T00:02:41.000Z | 2020-03-28T00:02:41.000Z | import os
import threading
from abc import ABC, abstractmethod
from pandemie.util.event_checker import EventChecker
from pandemie.util import filter_unicode, log_json, now
class AbstractStrategy(ABC):
"""
An abstract template for strategies with all necessary functionalities, default run values and integrat... | 33.943548 | 109 | 0.60632 |
993ad17d96163302ac0f73726b43230fc1495338 | 1,407 | py | Python | chemolab/elements/element.py | MeleiDigitalMedia/ChemoLab | b27421a836d76de88b23845f6c808d4429925702 | [
"MIT"
] | null | null | null | chemolab/elements/element.py | MeleiDigitalMedia/ChemoLab | b27421a836d76de88b23845f6c808d4429925702 | [
"MIT"
] | null | null | null | chemolab/elements/element.py | MeleiDigitalMedia/ChemoLab | b27421a836d76de88b23845f6c808d4429925702 | [
"MIT"
] | null | null | null | import xml.etree.ElementTree as et
from pathlib import Path
class Element():
"""Creates an instance of an element"""
def __init__(self, element_data):
path = str(Path(__file__).parent)+'\\'+str(element_data)
root = et.parse(path).getroot()
self.NAME = root.find('chemolab-element... | 63.954545 | 366 | 0.658849 |
993cdcee8a935b6a7d018bb9d0b5080524fb7689 | 22,522 | py | Python | CS303/lab1-3/work/mcts/index.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 22 | 2018-08-07T06:55:10.000Z | 2021-06-12T02:12:19.000Z | CS303/lab1-3/work/mcts/index.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 28 | 2020-03-04T23:47:22.000Z | 2022-02-26T18:50:00.000Z | CS303/lab1-3/work/mcts/index.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 4 | 2019-11-09T15:41:26.000Z | 2021-10-10T08:56:57.000Z |
from collections import deque
import tensorflow as tf
import numpy as np
import binascii
import random
import time
import copy
COLOR_BLACK = -1
COLOR_WHITE = 1
COLOR_NONE = 0
class AI(object):
def __init__(self, chessboard_size, color, time_out, c_puct=5, n_playout=400):
self.chessboard_size = chessboard... | 39.443082 | 116 | 0.583296 |
514314e13696ace6aad8da0d4eadc19ee760fdd5 | 2,942 | py | Python | src/bo4e/com/verbrauch.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/com/verbrauch.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/com/verbrauch.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | """
Contains Verbrauch and corresponding marshmallow schema for de-/serialization
"""
from datetime import datetime
from decimal import Decimal
from typing import Optional
import attr
from marshmallow import fields
from marshmallow_enum import EnumField # type:ignore[import]
from bo4e.com.com import COM, COMSchema
f... | 38.207792 | 173 | 0.75051 |
51c294431a568c8a5c371b2706bf9cce52547075 | 2,091 | py | Python | website/apps/blog/views.py | stahlnow/stahlnow | 265dd46c54f68173071d1c86218201d6e618ceeb | [
"MIT"
] | 1 | 2017-03-14T08:08:31.000Z | 2017-03-14T08:08:31.000Z | website/apps/blog/views.py | stahlnow/stahlnow | 265dd46c54f68173071d1c86218201d6e618ceeb | [
"MIT"
] | null | null | null | website/apps/blog/views.py | stahlnow/stahlnow | 265dd46c54f68173071d1c86218201d6e618ceeb | [
"MIT"
] | null | null | null | from django.http import Http404
from django.utils.translation import ugettext as _
from itertools import chain
from el_pagination.views import AjaxListView
from django.views.generic import DetailView, ListView
from django.utils import timezone
from django.db.models import Q
from django.contrib.contenttypes.models impor... | 33.190476 | 117 | 0.710187 |
5c9961ee6b6512a7185a59ad5833e2efdd265dc6 | 662 | py | Python | Kapitel 2/Kreis.py | mqng/HS-CO_WS2122_IF_FProg | b52470e0991bdbaeba22b154c4029e6cded51fd7 | [
"MIT"
] | null | null | null | Kapitel 2/Kreis.py | mqng/HS-CO_WS2122_IF_FProg | b52470e0991bdbaeba22b154c4029e6cded51fd7 | [
"MIT"
] | null | null | null | Kapitel 2/Kreis.py | mqng/HS-CO_WS2122_IF_FProg | b52470e0991bdbaeba22b154c4029e6cded51fd7 | [
"MIT"
] | null | null | null | import math
def umfangKreis(radius):
return math.pi * 2 * radius
def flaecheKreis(radius):
return math.pi * radius * radius
def summeUmfangKreis(radiusliste):
sum = 0
for r in radiusliste:
sum += umfangKreis(r)
return sum
def summeFlaecheKreis(radiusliste):
sum = 0
for r in radiu... | 22.827586 | 67 | 0.654079 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.