hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 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 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7e8bf82afd31cdff3e5db5074cd93a3e611f576b | 262 | py | Python | phanterpwa/tests/__init__.py | PhanterJR/phanterpwa | 6daff40845b3a853cd08d319c4ce148f8deebed7 | [
"MIT"
] | 2 | 2019-06-06T10:37:01.000Z | 2021-10-16T03:36:28.000Z | phanterpwa/tests/test_configer_path/project_without_ini/__init__.py | PhanterJR/phanterpwa | 6daff40845b3a853cd08d319c4ce148f8deebed7 | [
"MIT"
] | null | null | null | phanterpwa/tests/test_configer_path/project_without_ini/__init__.py | PhanterJR/phanterpwa | 6daff40845b3a853cd08d319c4ce148f8deebed7 | [
"MIT"
] | null | null | null | import os
import glob
current_path = os.path.dirname(__file__)
__all__ = [os.path.basename(x) for x in glob.glob(os.path.join(current_path, "*"))
if os.path.isdir(x) and not os.path.basename(x).startswith("_")]
if __name__ == '__main__':
print(__all__)
| 29.111111 | 82 | 0.706107 | import os
import glob
current_path = os.path.dirname(__file__)
__all__ = [os.path.basename(x) for x in glob.glob(os.path.join(current_path, "*"))
if os.path.isdir(x) and not os.path.basename(x).startswith("_")]
if __name__ == '__main__':
print(__all__)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9e2d0d93715f19666ddfe60f880b13ff75999556 | 1,114 | py | Python | scificrew/tests/scificrew/test_clustering_users.py | ychebaro/project_insight | 0076bd9cf88b0e47f9339fb9635b743a8ea9016b | [
"MIT"
] | null | null | null | scificrew/tests/scificrew/test_clustering_users.py | ychebaro/project_insight | 0076bd9cf88b0e47f9339fb9635b743a8ea9016b | [
"MIT"
] | null | null | null | scificrew/tests/scificrew/test_clustering_users.py | ychebaro/project_insight | 0076bd9cf88b0e47f9339fb9635b743a8ea9016b | [
"MIT"
] | null | null | null | """ Clustering users with k-means algorithm
:Author: Yassmine Chebaro <yassmnine.chebaro@mssm.edu>
:Date: 2019-09-25
:License: MIT
"""
# Import Libraries
| 27.170732 | 99 | 0.781867 | """ Clustering users with k-means algorithm
:Author: Yassmine Chebaro <yassmnine.chebaro@mssm.edu>
:Date: 2019-09-25
:License: MIT
"""
# Import Libraries
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from scipy.sparse import csr_matrix
from sklearn.cluster import KMeans
from sklearn.metrics i... | 0 | 0 | 0 | 578 | 0 | 0 | 0 | 110 | 265 |
b14b21f2faf40291e12a01fc25cc59eee64aca24 | 1,819 | py | Python | iasset/migrations/0002_auto_20170321_2259.py | gzy403999903/itam | 9ced83fecf10a70686d0a2a5159effdea03eca6c | [
"Artistic-1.0-cl8"
] | 79 | 2018-05-28T09:13:31.000Z | 2022-03-22T08:55:21.000Z | iasset/migrations/0002_auto_20170321_2259.py | tracyzk/itam | 9ced83fecf10a70686d0a2a5159effdea03eca6c | [
"Artistic-1.0-cl8"
] | 1 | 2018-11-16T07:40:12.000Z | 2018-11-16T08:40:11.000Z | iasset/migrations/0002_auto_20170321_2259.py | tracyzk/itam | 9ced83fecf10a70686d0a2a5159effdea03eca6c | [
"Artistic-1.0-cl8"
] | 34 | 2018-05-28T09:13:34.000Z | 2021-10-18T06:52:55.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
| 35.666667 | 138 | 0.590984 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('iservice', '0001_initial'),
('iasset', '0001_initial'),
]
operations = [
migrations.AddField(
model_name... | 0 | 0 | 0 | 1,689 | 0 | 0 | 0 | 19 | 46 |
b48b1b8e57b1dea4565d3288dbcb2d7f98878817 | 155 | py | Python | idem/idem/req/onchanges.py | brejoc/idem | 12a901f60e77d6fc8a4c8a7496ac0b54b588cf7a | [
"Apache-2.0"
] | 16 | 2019-10-10T22:23:48.000Z | 2022-03-23T18:12:37.000Z | idem/idem/req/onchanges.py | brejoc/idem | 12a901f60e77d6fc8a4c8a7496ac0b54b588cf7a | [
"Apache-2.0"
] | 14 | 2019-11-01T15:15:26.000Z | 2020-02-10T15:42:55.000Z | idem/idem/req/onchanges.py | brejoc/idem | 12a901f60e77d6fc8a4c8a7496ac0b54b588cf7a | [
"Apache-2.0"
] | 5 | 2019-10-15T11:54:11.000Z | 2019-11-27T07:50:30.000Z | def define(hub):
'''
Define how the onchanges requisite should run
'''
return {
'result': True,
'changes': True,
}
| 17.222222 | 49 | 0.503226 | def define(hub):
'''
Define how the onchanges requisite should run
'''
return {
'result': True,
'changes': True,
}
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9a663470b779e1db507ee988b4182322926ab85c | 186 | py | Python | bitwise operations/binary digits count.py | DiyanKalaydzhiev23/fundamentals---python | 7fa032d9a3270648ffa383bb00dad8e51613189d | [
"MIT"
] | null | null | null | bitwise operations/binary digits count.py | DiyanKalaydzhiev23/fundamentals---python | 7fa032d9a3270648ffa383bb00dad8e51613189d | [
"MIT"
] | null | null | null | bitwise operations/binary digits count.py | DiyanKalaydzhiev23/fundamentals---python | 7fa032d9a3270648ffa383bb00dad8e51613189d | [
"MIT"
] | null | null | null | number = int(input())
n_to_count = int(input())
counter = 0
while number > 0:
result = number % 2
number //= 2
if result == n_to_count:
counter += 1
print(counter)
| 15.5 | 28 | 0.591398 | number = int(input())
n_to_count = int(input())
counter = 0
while number > 0:
result = number % 2
number //= 2
if result == n_to_count:
counter += 1
print(counter)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b1a0be2a59ab87cdcb86347ec965d6418a8f9cc7 | 4,221 | py | Python | TicTacToeGui.py | SJCaldwell/alpha-toe | 3e7637136022898c1ca2cf0d51286051f9ac137f | [
"MIT"
] | null | null | null | TicTacToeGui.py | SJCaldwell/alpha-toe | 3e7637136022898c1ca2cf0d51286051f9ac137f | [
"MIT"
] | null | null | null | TicTacToeGui.py | SJCaldwell/alpha-toe | 3e7637136022898c1ca2cf0d51286051f9ac137f | [
"MIT"
] | null | null | null | # coding=UTF8
# Python TicTacToe game with Tk GUI and minimax AI
# Author: Maurits van der Schee <maurits@vdschee.nl>
# Repo: https://github.com/mevdschee/python-tictactoe
"""
Run this file to play manually with any agent.
"""
import numpy as np
from MCTS import MCTS
from tictactoe.TicTacToeGame import TicTacToeG... | 32.221374 | 93 | 0.634447 | # coding=UTF8
# Python TicTacToe game with Tk GUI and minimax AI
# Author: Maurits van der Schee <maurits@vdschee.nl>
# Repo: https://github.com/mevdschee/python-tictactoe
"""
Run this file to play manually with any agent.
"""
from Tkinter import Tk, Button, PhotoImage
from PIL import ImageTk, Image
from tkFont impo... | 0 | 0 | 0 | 3,315 | 0 | 0 | 0 | 62 | 157 |
95eccfee9e284d900d45c40aa27a0eb613366363 | 39 | py | Python | everyvoter_common/utils/__init__.py | everyvoter/everyvoter | 65d9b8bdf9b5c64057135c279f6e03b6c207e0fa | [
"MIT"
] | 5 | 2019-07-01T17:50:44.000Z | 2022-02-20T02:44:42.000Z | everyvoter_common/utils/__init__.py | everyvoter/everyvoter | 65d9b8bdf9b5c64057135c279f6e03b6c207e0fa | [
"MIT"
] | 3 | 2020-06-05T21:44:33.000Z | 2021-06-10T21:39:26.000Z | everyvoter_common/utils/__init__.py | everyvoter/everyvoter | 65d9b8bdf9b5c64057135c279f6e03b6c207e0fa | [
"MIT"
] | 1 | 2021-12-09T06:32:40.000Z | 2021-12-09T06:32:40.000Z | """Utilities for EveryVoter project"""
| 19.5 | 38 | 0.74359 | """Utilities for EveryVoter project"""
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f4f922a4fd9691d74861f0dbcd0859dab3ef1eb7 | 7,898 | py | Python | ibeatles/interfaces/ui_binningWindow.py | indudhiman/bragg-edge | 56af0a448534ef9cb5428879ba900e194dc05db2 | [
"MIT"
] | null | null | null | ibeatles/interfaces/ui_binningWindow.py | indudhiman/bragg-edge | 56af0a448534ef9cb5428879ba900e194dc05db2 | [
"MIT"
] | null | null | null | ibeatles/interfaces/ui_binningWindow.py | indudhiman/bragg-edge | 56af0a448534ef9cb5428879ba900e194dc05db2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'designer/ui_binningWindow.ui'
#
# Created by: PyQt5 UI code generator 5.6
#
# WARNING! All changes made in this file will be lost!
| 58.940299 | 114 | 0.738035 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'designer/ui_binningWindow.ui'
#
# Created by: PyQt5 UI code generator 5.6
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
... | 0 | 0 | 0 | 7,620 | 0 | 0 | 0 | 21 | 46 |
f646adcf7907cbd717f6c0b6630834f649a54625 | 1,597 | py | Python | video2img.py | DaheeHan333/C3D | 1bc2f236dca87130fee4741fdad3bca53f58da7a | [
"MIT"
] | 14 | 2019-08-23T01:37:44.000Z | 2022-03-31T20:03:59.000Z | video2img.py | DaheeHan333/C3D | 1bc2f236dca87130fee4741fdad3bca53f58da7a | [
"MIT"
] | 2 | 2019-10-11T07:31:35.000Z | 2021-06-20T07:32:09.000Z | video2img.py | DaheeHan333/C3D | 1bc2f236dca87130fee4741fdad3bca53f58da7a | [
"MIT"
] | 4 | 2020-12-16T12:26:06.000Z | 2022-02-20T13:53:33.000Z | import cv2
import os
from PIL import Image
from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
video_path = '/home/shixi/C3D-keras/datasets/ucf101/'
save_path = '/home/shixi/C3D-keras/datasets/ucfimgs/'
action_list = os.listdir(video_path)
for action in action_list:
if not os.path.exists(save_path+a... | 36.295455 | 83 | 0.564183 | import cv2
import os
from PIL import Image
from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
video_path = '/home/shixi/C3D-keras/datasets/ucf101/'
save_path = '/home/shixi/C3D-keras/datasets/ucfimgs/'
action_list = os.listdir(video_path)
for action in action_list:
if not os.path.exists(save_path+a... | 183 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
915da8bb1cbf5c82b119f797171542b53b3c8fa8 | 4,117 | py | Python | python/cuml/dask/decomposition/base.py | Salonijain27/cuml | 887575445ee0b162f4ac02feae86c0d7de14f793 | [
"Apache-2.0"
] | null | null | null | python/cuml/dask/decomposition/base.py | Salonijain27/cuml | 887575445ee0b162f4ac02feae86c0d7de14f793 | [
"Apache-2.0"
] | 1 | 2020-08-04T18:44:53.000Z | 2020-08-04T18:44:53.000Z | python/cuml/dask/decomposition/base.py | Salonijain27/cuml | 887575445ee0b162f4ac02feae86c0d7de14f793 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 33.201613 | 76 | 0.632256 | # Copyright (c) 2019, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 0 | 282 | 0 | 2,811 | 0 | 0 | 0 | 227 | 205 |
408adf9c7defe3920097625718117a7e71b999f2 | 2,470 | py | Python | project/app/api/population.py | labs26-citrics/Labs26-Citrics-DS-TeamB | 980ff695f49be7bcb3ffdda38dba56049ef1e988 | [
"MIT"
] | 1 | 2021-01-04T19:32:50.000Z | 2021-01-04T19:32:50.000Z | project/app/api/population.py | labs26-citrics/Labs26-Citrics-DS-TeamB | 980ff695f49be7bcb3ffdda38dba56049ef1e988 | [
"MIT"
] | 3 | 2020-09-08T22:27:35.000Z | 2020-10-01T22:19:13.000Z | project/app/api/population.py | labs26-citrics/Labs26-Citrics-DS-TeamB | 980ff695f49be7bcb3ffdda38dba56049ef1e988 | [
"MIT"
] | 4 | 2020-10-13T21:56:42.000Z | 2021-03-03T01:59:37.000Z | from fastapi import APIRouter
import pandas as pd
import plotly.express as px
import os
router = APIRouter()
DATA_FILEPATH1 = os.path.join(os.path.dirname(__file__), "..", "..","data", "current_pop_data_final.csv")
DATA_FILEPATH2 = os.path.join(os.path.dirname(__file__), "..", "..","data", "historical_pop_dat... | 36.323529 | 109 | 0.641296 | from fastapi import APIRouter, HTTPException
import pandas as pd
import plotly.express as px
import os
router = APIRouter()
DATA_FILEPATH1 = os.path.join(os.path.dirname(__file__), "..", "..","data", "current_pop_data_final.csv")
DATA_FILEPATH2 = os.path.join(os.path.dirname(__file__), "..", "..","data", "his... | 0 | 1,148 | 0 | 0 | 0 | 0 | 0 | 15 | 25 |
c819420b9b2f71fde062c39c40d5304f49c54972 | 1,671 | py | Python | python/problem30.py | chjdev/euler | 48db9e035583c2c3fcce8eed0c911a0e67cff2c6 | [
"BSD-2-Clause"
] | null | null | null | python/problem30.py | chjdev/euler | 48db9e035583c2c3fcce8eed0c911a0e67cff2c6 | [
"BSD-2-Clause"
] | null | null | null | python/problem30.py | chjdev/euler | 48db9e035583c2c3fcce8eed0c911a0e67cff2c6 | [
"BSD-2-Clause"
] | null | null | null | # Digit fifth powers
#
# Problem 30
#
# Surprisingly there are only three numbers that can be written as the sum of fourth powers of their digits:
#
# 1634 = 14 + 64 + 34 + 44
# 8208 = 84 + 24 + 04 + 84
# 9474 = 94 + 44 + 74 + 44
# As 1 = 14 is not a sum it is not included.
#
# The sum of these numbers is 1634 + 8208 +... | 34.102041 | 118 | 0.616996 | # Digit fifth powers
#
# Problem 30
#
# Surprisingly there are only three numbers that can be written as the sum of fourth powers of their digits:
#
# 1634 = 14 + 64 + 34 + 44
# 8208 = 84 + 24 + 04 + 84
# 9474 = 94 + 44 + 74 + 44
# As 1 = 14 is not a sum it is not included.
#
# The sum of these numbers is 1634 + 8208 +... | 0 | 0 | 0 | 0 | 425 | 326 | 0 | 0 | 45 |
220b1f09e8fc099c7708125223d2e25a4115b511 | 3,325 | py | Python | delfin/task_manager/metrics_rpcapi.py | guankc/delfin | 85c2ac90dba7042a9159f1d4e927020ea166f139 | [
"Apache-2.0"
] | 19 | 2020-07-28T00:13:43.000Z | 2022-02-15T16:44:21.000Z | delfin/task_manager/metrics_rpcapi.py | guankc/delfin | 85c2ac90dba7042a9159f1d4e927020ea166f139 | [
"Apache-2.0"
] | 581 | 2020-06-22T15:20:58.000Z | 2022-03-31T04:06:14.000Z | delfin/task_manager/metrics_rpcapi.py | guankc/delfin | 85c2ac90dba7042a9159f1d4e927020ea166f139 | [
"Apache-2.0"
] | 153 | 2021-03-10T09:32:08.000Z | 2022-02-22T01:32:32.000Z | # Copyright 2021 The SODA Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 39.583333 | 78 | 0.615338 | # Copyright 2021 The SODA Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 0 | 0 | 0 | 2,557 | 0 | 0 | 0 | 14 | 69 |
6402f8c0364cd5789bddc3744d7d90002b8bed85 | 3,029 | py | Python | Server/emotions.py | AgoraIO-Community/SentimentAnalysis | 8d52cadb4377283bc0e00e55bf459a4a28573e25 | [
"MIT"
] | 5 | 2019-03-02T10:12:05.000Z | 2020-08-03T17:10:05.000Z | Server/emotions.py | itsmepiyush2/SentimentAnalysis | 8d52cadb4377283bc0e00e55bf459a4a28573e25 | [
"MIT"
] | 5 | 2020-01-28T23:03:33.000Z | 2022-02-10T00:34:23.000Z | Server/emotions.py | GarrettYoung510/Agora-web-app | ae4e1aaffdd053f09f0348095da66b8e782bd35f | [
"MIT"
] | 3 | 2019-07-01T03:42:53.000Z | 2021-07-13T09:42:03.000Z | import cv2
from keras.models import load_model
from utils.datasets import get_labels
import tensorflow as tf
# parameters for loading data and images
emotion_model_path = './models/model.hdf5'
emotion_labels = get_labels('fer2013')
# hyper-parameters for bounding boxes shape
frame_window = 10
emotion_offsets = (20, ... | 33.655556 | 86 | 0.700231 | import cv2
import numpy as np
from keras.models import load_model
from statistics import mode
from utils.datasets import get_labels
from utils.inference import detect_faces
from utils.inference import draw_text
from utils.inference import draw_bounding_box
from utils.inference import apply_offsets
from utils.inference ... | 0 | 0 | 0 | 0 | 0 | 2,014 | 0 | 135 | 198 |
fae7ab2a6ae52af817a8934b44b1f7c9dbb98058 | 3,074 | py | Python | maxmatrix/matrix.py | mdonath/micropython-maxmatrix | f675058e55a9ea9ce51d47c156ee28f36b4e356b | [
"MIT"
] | 1 | 2019-02-09T05:19:10.000Z | 2019-02-09T05:19:10.000Z | maxmatrix/matrix.py | mdonath/micropython-maxmatrix | f675058e55a9ea9ce51d47c156ee28f36b4e356b | [
"MIT"
] | null | null | null | maxmatrix/matrix.py | mdonath/micropython-maxmatrix | f675058e55a9ea9ce51d47c156ee28f36b4e356b | [
"MIT"
] | null | null | null | _NOOP=const(0)
_DIGIT0=const(1)
_DIGIT1=const(2)
_DIGIT2=const(3)
_DIGIT3=const(4)
_DIGIT4=const(5)
_DIGIT5=const(6)
_DIGIT6=const(7)
_DIGIT7=const(8)
_DECODEMODE=const(9)
_INTENSITY=const(10)
_SCANLIMIT=const(11)
_SHUTDOWN=const(12)
_DISPLAYTEST=const(15)
| 18.975309 | 52 | 0.633377 | _NOOP=const(0)
_DIGIT0=const(1)
_DIGIT1=const(2)
_DIGIT2=const(3)
_DIGIT3=const(4)
_DIGIT4=const(5)
_DIGIT5=const(6)
_DIGIT6=const(7)
_DIGIT7=const(8)
_DECODEMODE=const(9)
_INTENSITY=const(10)
_SCANLIMIT=const(11)
_SHUTDOWN=const(12)
_DISPLAYTEST=const(15)
class Matrix8x8:
def __init__(self,spi,cs,num):
self.spi=sp... | 0 | 0 | 0 | 2,793 | 0 | 0 | 0 | 0 | 23 |
4ac2a0483a397db0a29a8cb752ddfb2c825f2d9a | 5,257 | py | Python | tests/test_text_qrnn.py | JiahuaWU/fastai | 13a2df812d875abf0558004283392ab40d9bdea1 | [
"Apache-2.0"
] | 59 | 2020-08-18T03:41:35.000Z | 2022-03-23T03:51:55.000Z | tests/test_text_qrnn.py | JiahuaWU/fastai | 13a2df812d875abf0558004283392ab40d9bdea1 | [
"Apache-2.0"
] | 17 | 2020-08-25T14:15:32.000Z | 2022-03-27T02:12:19.000Z | tests/test_text_qrnn.py | JiahuaWU/fastai | 13a2df812d875abf0558004283392ab40d9bdea1 | [
"Apache-2.0"
] | 89 | 2020-08-17T23:45:42.000Z | 2022-03-27T20:53:43.000Z |
# bug in pytorch=1.0.1, fixed in 1.0.2 https://github.com/pytorch/pytorch/issues/18189
| 45.318966 | 104 | 0.657409 | import pytest,torch
from fastai.basics import have_min_pkg_version
from fastai.gen_doc.doctest import this_tests
from fastai.text.models.qrnn import ForgetMultGPU, BwdForgetMultGPU, forget_mult_CPU, QRNN, QRNNLayer
@pytest.mark.cuda
@pytest.mark.cpp
def test_forget_mult_forward_gpu():
this_tests(ForgetMultGPU)
... | 0 | 3,011 | 0 | 0 | 0 | 1,760 | 0 | 127 | 271 |
9502a79c51ee44dd851ff487323b6e8822979128 | 374 | py | Python | one_off/PrintN.py | EichlerLab/chm1_scripts | 55d1783139f4ccc6e41c79812920785b1eaea65e | [
"MIT"
] | 5 | 2016-04-21T20:00:01.000Z | 2020-03-12T16:35:55.000Z | one_off/PrintN.py | EichlerLab/chm1_scripts | 55d1783139f4ccc6e41c79812920785b1eaea65e | [
"MIT"
] | null | null | null | one_off/PrintN.py | EichlerLab/chm1_scripts | 55d1783139f4ccc6e41c79812920785b1eaea65e | [
"MIT"
] | 8 | 2015-09-15T07:08:06.000Z | 2021-07-13T02:25:12.000Z | #!/usr/bin/env python
from Bio import SeqIO
from Bio import Seq
import sys
inFile = open(sys.argv[1])
for rec in SeqIO.parse(inFile, "fasta"):
i = 0
l = len(rec.seq)
while (i < l):
j=i
while (j < l and rec.seq[j] == 'N'):
j += 1
if (j - i > 100000):
print r... | 19.684211 | 56 | 0.47861 | #!/usr/bin/env python
from Bio import SeqIO
from Bio import Seq
import sys
inFile = open(sys.argv[1])
for rec in SeqIO.parse(inFile, "fasta"):
i = 0
l = len(rec.seq)
while (i < l):
j=i
while (j < l and rec.seq[j] == 'N'):
j += 1
if (j - i > 100000):
print r... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
023fa0d4a47b037454b12650fe29d8632094d5ec | 1,700 | py | Python | appimagebuilder/modules/generate/desktop_entry_parser.py | AppImageCrafters/AppImageBuilder | dd041050e65f8eff28f878a092fd07bcf3ec5a4d | [
"MIT"
] | 3 | 2019-11-01T09:23:59.000Z | 2019-11-09T12:03:12.000Z | appimagebuilder/modules/generate/desktop_entry_parser.py | AppImageCrafters/AppImageCraft | a08ae8d300d9632d78865003c974175dcb90ce21 | [
"MIT"
] | 2 | 2019-11-01T09:22:01.000Z | 2019-11-11T23:25:48.000Z | appimagebuilder/modules/generate/desktop_entry_parser.py | AppImageCrafters/AppImageBuilder | dd041050e65f8eff28f878a092fd07bcf3ec5a4d | [
"MIT"
] | null | null | null | # Copyright 2020 Alexis Lopez Zubieta
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publi... | 33.333333 | 80 | 0.672353 | # Copyright 2020 Alexis Lopez Zubieta
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publi... | 0 | 0 | 0 | 954 | 0 | 0 | 0 | 4 | 113 |
7fff003dd1008db15361818e0982081c00833b64 | 2,897 | py | Python | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GLX/SGIX/pbuffer.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GLX/SGIX/pbuffer.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GLX/SGIX/pbuffer.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | '''Autogenerated by xml_generate script, do not edit!'''
# Code generation uses this
# End users want this...
from OpenGL.constant import Constant as _C
_EXTENSION_NAME = 'GLX_SGIX_pbuffer'
GLX_ACCUM_BUFFER_BIT_SGIX=_C('GLX_ACCUM_BUFFER_BIT_SGIX',0x00000080)
GLX_AUX_BUFFERS_BIT_SGIX=_C('GLX_AUX_BUFFERS_BIT_SGIX',... | 53.648148 | 126 | 0.84087 | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GLX import _types as _cs
# End users want this...
from OpenGL.raw.GLX._types import *
from OpenGL.raw.GLX import _errors
from OpenGL.constant import Constant as _C
imp... | 0 | 640 | 0 | 0 | 0 | 111 | 0 | 58 | 255 |
f4934137649adf2efbe3798179ec73cdc885b0fe | 5,785 | py | Python | Max Heap/Max Heap.py | AMshoka/Data-Structures | 244171f34b1560befd879adb9d4bc9df7e45b677 | [
"MIT"
] | null | null | null | Max Heap/Max Heap.py | AMshoka/Data-Structures | 244171f34b1560befd879adb9d4bc9df7e45b677 | [
"MIT"
] | null | null | null | Max Heap/Max Heap.py | AMshoka/Data-Structures | 244171f34b1560befd879adb9d4bc9df7e45b677 | [
"MIT"
] | null | null | null | if __name__ == '__main__':
p = HEAP()
q = [1, 2, 3]
e = []
while True:
a = str(input())
q = []
qq = []
senten = ""
kk = 0
k = 1
if a[0] == ";":
break
if a[0] == "+": p.insert(int(a[1:len(a)]))
if a[0] == ... | 26.782407 | 77 | 0.35592 | class HEAP():
def __init__(self):
self.heap = [0]
self.length = 0
def newsort(self, arr):
n = len(arr)
for i in range(n, -1, -1):
self.newcahnge(arr, n, i)
self.heap = self.heap + arr
def newcahnge(self, arr, n, i):
largest = i
... | 0 | 0 | 0 | 4,723 | 0 | 0 | 0 | 0 | 23 |
791ea9e96c297f68ce396e6f9a55d76ca7bc923e | 6,944 | py | Python | tests/integration/actions/collections/base.py | saito-hideki/ansible-navigator | 0a15b83c2a9a548315765360bd19d6fd270862d4 | [
"Apache-2.0"
] | null | null | null | tests/integration/actions/collections/base.py | saito-hideki/ansible-navigator | 0a15b83c2a9a548315765360bd19d6fd270862d4 | [
"Apache-2.0"
] | null | null | null | tests/integration/actions/collections/base.py | saito-hideki/ansible-navigator | 0a15b83c2a9a548315765360bd19d6fd270862d4 | [
"Apache-2.0"
] | null | null | null | """Base class for collections interactive tests.
"""
from ..._interactions import SearchFor
from ..._interactions import UiTestStep
EXPECTED_COLLECTIONS = ["ansible.builtin", "company_name.coll_1", "company_name.coll_2"]
base_steps = (
UiTestStep(user_input=":1", comment="Browse company_name.coll_1 plugins windo... | 37.73913 | 99 | 0.650778 | """Base class for collections interactive tests.
"""
import difflib
import os
from typing import Generator
import pytest
from ....defaults import FIXTURES_COLLECTION_DIR
from ..._common import copytree
from ..._common import retrieve_fixture_for_step
from ..._common import update_fixtures
from ..._interactions impor... | 0 | 1,198 | 0 | 2,464 | 0 | 0 | 0 | 80 | 224 |
ed79448d97d004d7d588050e04195e36e732bc3c | 18,512 | py | Python | heat/engine/scheduler.py | pshchelo/heat | 6cf94a3ece89d77b839f61292e5f023c3f192c82 | [
"Apache-2.0"
] | null | null | null | heat/engine/scheduler.py | pshchelo/heat | 6cf94a3ece89d77b839f61292e5f023c3f192c82 | [
"Apache-2.0"
] | null | null | null | heat/engine/scheduler.py | pshchelo/heat | 6cf94a3ece89d77b839f61292e5f023c3f192c82 | [
"Apache-2.0"
] | null | null | null | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | 33.71949 | 79 | 0.589077 | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | 0 | 3,379 | 0 | 12,992 | 0 | 0 | 0 | 28 | 366 |
42550e85895afdac1435575c647657e02530d5c8 | 145 | py | Python | python/p_lesson_2/task5.py | korwil/lessons | cbeb375cea38e143498979b63e133fdf71bf83bf | [
"Apache-2.0"
] | null | null | null | python/p_lesson_2/task5.py | korwil/lessons | cbeb375cea38e143498979b63e133fdf71bf83bf | [
"Apache-2.0"
] | null | null | null | python/p_lesson_2/task5.py | korwil/lessons | cbeb375cea38e143498979b63e133fdf71bf83bf | [
"Apache-2.0"
] | null | null | null | my_list = [7, 5, 3, 3, 2]
i = int(input(' : '))
my_list.append(i)
my_list.sort()
my_list.reverse()
print(my_list)
| 16.111111 | 50 | 0.682759 | my_list = [7, 5, 3, 3, 2]
i = int(input('Ввидите новый элемент рейтинга: '))
my_list.append(i)
my_list.sort()
my_list.reverse()
print(my_list)
| 54 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c1677580a03f25dfa5be8ea38ddd0f2d37789aca | 266 | py | Python | mps/__init__.py | kirthevasank/mps | 2ba818c361e467841f6bbe0ef47a1e833ef315d3 | [
"MIT"
] | 3 | 2019-08-11T22:50:51.000Z | 2021-08-03T06:39:04.000Z | mps/__init__.py | kirthevasank/mps | 2ba818c361e467841f6bbe0ef47a1e833ef315d3 | [
"MIT"
] | null | null | null | mps/__init__.py | kirthevasank/mps | 2ba818c361e467841f6bbe0ef47a1e833ef315d3 | [
"MIT"
] | 3 | 2019-08-11T22:53:00.000Z | 2021-04-15T13:16:43.000Z | """
Library for Adaptive Design of Experiments.
-- kandasamy@cs.cmu.edu
"""
| 26.6 | 65 | 0.827068 | """
Library for Adaptive Design of Experiments.
-- kandasamy@cs.cmu.edu
"""
from .exd.goal_oriented_exd import GoalOrientedExperimentDesigner
from .exd.worker_manager import get_default_worker_manager
from .policies.policy_utils import load_options_for_policy
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 118 | 67 |
fc856399354b9c73dfb9dfa892eb171a4435a463 | 1,730 | py | Python | code/plot_isd_series.py | DonaldWhyte/high-performance-data-processing-in-python | 5f0d4155c951155bc6885a4f283eb4044879d0ad | [
"MIT"
] | 16 | 2018-07-26T16:37:19.000Z | 2021-08-18T18:34:22.000Z | code/plot_isd_series.py | DonaldWhyte/high-performance-data-processing-in-python-v2 | f7f8076ff67d53be09e1d2f9988976e31b92f8e9 | [
"MIT"
] | 1 | 2019-12-13T01:18:00.000Z | 2019-12-14T16:34:26.000Z | code/plot_isd_series.py | DonaldWhyte/high-performance-data-processing-in-python-v2 | f7f8076ff67d53be09e1d2f9988976e31b92f8e9 | [
"MIT"
] | 5 | 2019-02-14T14:04:49.000Z | 2021-04-20T17:00:37.000Z |
if __name__ == '__main__':
_main()
| 27.460317 | 80 | 0.641618 | import argparse
import datetime
import h5py
import matplotlib.dates as mdates
import matplotlib.pyplot as plt
import numpy as np
def _main():
args = _parse_args()
input_file = h5py.File(args.input, mode='r')
station_indices = np.where(input_file['station_usaf'][:] == args.station)[0]
start_dt = arg... | 0 | 0 | 0 | 0 | 0 | 1,511 | 0 | -3 | 178 |
049acebb8c48d3aecde2608d0771a2418071fdb1 | 272 | py | Python | wunderground_pws/exceptions.py | pensionado/WUndergroundPWS-API | b92ab56f7efa9396518016325a54b5dd739692c7 | [
"MIT"
] | 2 | 2021-01-21T06:43:18.000Z | 2021-01-24T22:16:46.000Z | wunderground_pws/exceptions.py | pensionado/WUndergroundPWS-API | b92ab56f7efa9396518016325a54b5dd739692c7 | [
"MIT"
] | 2 | 2020-11-10T06:31:38.000Z | 2021-05-12T11:13:27.000Z | wunderground_pws/exceptions.py | pensionado/WUndergroundPWS-API | b92ab56f7efa9396518016325a54b5dd739692c7 | [
"MIT"
] | 1 | 2020-11-27T06:01:54.000Z | 2020-11-27T06:01:54.000Z | # This file is a part of WUnderground PWS Python API
# Copyright (c) 2019 Marco Aceti <mail@marcoaceti.it>
# See LICENSE file for more details about licensing and copying.
| 22.666667 | 64 | 0.768382 | # This file is a part of WUnderground PWS Python API
# Copyright (c) 2019 Marco Aceti <mail@marcoaceti.it>
# See LICENSE file for more details about licensing and copying.
class BadRequestError(Exception):
pass
class StationIDNotSuppliedError(Exception):
pass
| 0 | 0 | 0 | 52 | 0 | 0 | 0 | 0 | 46 |
d9c9b6e0f0d017cdace8c697e66763d0f4276fc2 | 481 | py | Python | flags/migrations/0013_add_required_field.py | mdunc/django-flags | 7fdb7a67da25df197f53df4bfa06c8e5175944a3 | [
"CC0-1.0"
] | 142 | 2018-07-27T15:38:13.000Z | 2022-03-19T19:09:44.000Z | flags/migrations/0013_add_required_field.py | mdunc/django-flags | 7fdb7a67da25df197f53df4bfa06c8e5175944a3 | [
"CC0-1.0"
] | 64 | 2018-06-25T14:21:35.000Z | 2022-03-14T17:42:18.000Z | flags/migrations/0013_add_required_field.py | mdunc/django-flags | 7fdb7a67da25df197f53df4bfa06c8e5175944a3 | [
"CC0-1.0"
] | 24 | 2018-10-09T20:05:36.000Z | 2022-03-29T16:34:30.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-01-29 21:10
from __future__ import unicode_literals
| 22.904762 | 70 | 0.640333 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-01-29 21:10
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('flags', '0012_replace_migrations_for_wagtail_independence'),
]
operations = [
... | 0 | 0 | 0 | 301 | 0 | 0 | 0 | 19 | 46 |
f96d22561095020eb3fd09e08a1f5c0194d75b25 | 3,365 | py | Python | annotate_links_from_mp.py | JosuaCarl/Script_Assisted_Modeling | dbfffe423919461ae6c6f327ef58c121416fda66 | [
"Unlicense"
] | null | null | null | annotate_links_from_mp.py | JosuaCarl/Script_Assisted_Modeling | dbfffe423919461ae6c6f327ef58c121416fda66 | [
"Unlicense"
] | null | null | null | annotate_links_from_mp.py | JosuaCarl/Script_Assisted_Modeling | dbfffe423919461ae6c6f327ef58c121416fda66 | [
"Unlicense"
] | null | null | null | import sys
'''
Usage: annotate_links_from_mp.py <path_model-polisher_sbml-file> <path_input_sbml-file> <path_output_sbml-file>
Extracts annotations form ModelPolisher file and adds it to previous file.
'''
if __name__ == '__main__':
main(sys.argv)
| 35.421053 | 119 | 0.6211 | import sys
import os
import libsbml
from tqdm import tqdm
'''
Usage: annotate_links_from_mp.py <path_model-polisher_sbml-file> <path_input_sbml-file> <path_output_sbml-file>
Extracts annotations form ModelPolisher file and adds it to previous file.
'''
def main(args):
# console access
if len(args) != 6:
... | 0 | 0 | 0 | 0 | 0 | 3,039 | 0 | -19 | 89 |
786c4680122f485f25bc02862c05eea4f34b439a | 1,816 | py | Python | populating_next_right_pointers_in_each_node.py | fossilet/leetcode | 4cf787c74fc339dc6aee6a0b633ca15b38ac18a1 | [
"MIT"
] | 5 | 2015-12-10T14:19:02.000Z | 2021-07-02T01:23:34.000Z | populating_next_right_pointers_in_each_node.py | fossilet/leetcode | 4cf787c74fc339dc6aee6a0b633ca15b38ac18a1 | [
"MIT"
] | null | null | null | populating_next_right_pointers_in_each_node.py | fossilet/leetcode | 4cf787c74fc339dc6aee6a0b633ca15b38ac18a1 | [
"MIT"
] | 1 | 2015-10-01T01:43:14.000Z | 2015-10-01T01:43:14.000Z | #! /usr/bin/env python3
"""
http://oj.leetcode.com/problems/populating-next-right-pointers-in-each-node/
Since Apr-10-2014 18:33
"""
# Definition for a binary tree node
if __name__ == '__main__':
s = Solution()
n1 = TreeNode(1)
n2 = TreeNode(2)
n3 = TreeNode(3)
n4 = TreeNode(4)
n5 = Tree... | 26.705882 | 76 | 0.520925 | #! /usr/bin/env python3
"""
http://oj.leetcode.com/problems/populating-next-right-pointers-in-each-node/
Since Apr-10-2014 18:33
"""
# Definition for a binary tree node
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
self.next = None
clas... | 0 | 0 | 0 | 1,128 | 0 | 0 | 0 | 0 | 45 |
3ecfb0be4068066f7e531124ca2573a89798a3e0 | 791 | py | Python | others/python/download-music/Main.py | HuaZhuangNan/study-note | 342210b7718af2182769a2e1c0408139ed45ea45 | [
"MIT"
] | null | null | null | others/python/download-music/Main.py | HuaZhuangNan/study-note | 342210b7718af2182769a2e1c0408139ed45ea45 | [
"MIT"
] | 5 | 2020-05-16T08:15:49.000Z | 2020-05-16T08:15:57.000Z | others/python/download-music/Main.py | HuaZhuangNan/study-note | 342210b7718af2182769a2e1c0408139ed45ea45 | [
"MIT"
] | null | null | null | #
import os
#
import Tools
#
BASE_URL = 'http://www.9ku.com'
CHILD_URLS = ['/douyin/bang.htm','/douyin/new.htm','/douyin/zhongwen.htm','/douyin/bgm.htm',
'/laoge/500shou.htm','/laoge/80.htm','/laoge/70.htm',
'/wangluo/zuixin.htm','/wangluo/haoting.htm']
SAVE_PATH = os.path.abspath(os.c... | 30.423077 | 92 | 0.633375 | # 主函数
import os
# 自写
import Tools
# 设置需要爬取的页面
BASE_URL = 'http://www.9ku.com'
CHILD_URLS = ['/douyin/bang.htm','/douyin/new.htm','/douyin/zhongwen.htm','/douyin/bgm.htm',
'/laoge/500shou.htm','/laoge/80.htm','/laoge/70.htm',
'/wangluo/zuixin.htm','/wangluo/haoting.htm']
SAVE_PATH = os.pat... | 69 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f8dfd2b065c6ea80a4523e86440243d52c924aa2 | 414 | py | Python | profiles/migrations/New folder/0042_profile_last_login.py | Rxavio/link | a0aa34b89a769cfaa20a92a04980e142e42eaa10 | [
"MIT"
] | null | null | null | profiles/migrations/New folder/0042_profile_last_login.py | Rxavio/link | a0aa34b89a769cfaa20a92a04980e142e42eaa10 | [
"MIT"
] | null | null | null | profiles/migrations/New folder/0042_profile_last_login.py | Rxavio/link | a0aa34b89a769cfaa20a92a04980e142e42eaa10 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.3 on 2020-11-03 07:48
| 21.789474 | 81 | 0.611111 | # Generated by Django 3.0.3 on 2020-11-03 07:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('profiles', '0041_delete_user'),
]
operations = [
migrations.AddField(
model_name='profile',
name='last_login',
... | 0 | 0 | 0 | 300 | 0 | 0 | 0 | 19 | 46 |
bc5ac4759e8d4cc7afce05aa2795261d2b4d89a1 | 6,538 | py | Python | src/main/python/metrics.py | SzatmariA/CharmFL-dev | 542faf0ddeccfd714fac44c27c949343807e3e84 | [
"Apache-2.0"
] | null | null | null | src/main/python/metrics.py | SzatmariA/CharmFL-dev | 542faf0ddeccfd714fac44c27c949343807e3e84 | [
"Apache-2.0"
] | 5 | 2021-12-06T13:49:42.000Z | 2021-12-09T17:12:58.000Z | src/main/python/metrics.py | SzatmariA/CharmFL-dev | 542faf0ddeccfd714fac44c27c949343807e3e84 | [
"Apache-2.0"
] | null | null | null |
scores = []
elements = []
end_res = {"files": []}
| 39.865854 | 169 | 0.51346 | import json
import math
import collections
import sys
scores = []
elements = []
end_res = {"files": []}
def make_score_json(basic_statistics, method_cov="", class_cov=""):
print(basic_statistics)
idx = 0
for element in basic_statistics:
element_parts = str(element).split(":")
filename = e... | 0 | 0 | 0 | 0 | 0 | 6,337 | 0 | -34 | 180 |
74b4729b313564d5aee966b517601a9406da940e | 2,374 | py | Python | check_yt_models.py | itmagistr/check_yt_videos | 494055d8de35d0b92ea1ce8ad6f28cec3e931bf0 | [
"MIT"
] | null | null | null | check_yt_models.py | itmagistr/check_yt_videos | 494055d8de35d0b92ea1ce8ad6f28cec3e931bf0 | [
"MIT"
] | null | null | null | check_yt_models.py | itmagistr/check_yt_videos | 494055d8de35d0b92ea1ce8ad6f28cec3e931bf0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from pony import orm
#orm.set_sql_debug(True)
db = orm.Database()
db.bind(provider='sqlite', filename='checkytdb.sqlite', create_db=True)
db.generate_mapping(create_tables=True)
| 28.261905 | 72 | 0.70893 | # -*- coding: utf-8 -*-
from pony import orm
import pony.orm.dbproviders.sqlite
import datetime
#orm.set_sql_debug(True)
db = orm.Database()
@db.on_connect(provider='sqlite')
def sqlite_case_sensitivity(db, connection):
cursor = connection.cursor()
cursor.execute('PRAGMA case_sensitive_like = OFF... | 102 | 148 | 0 | 1,726 | 0 | 0 | 0 | 7 | 220 |
10bdb9bf956904116b4dfbed6f6582955e14d480 | 1,095 | py | Python | scripts/sanity_check.py | tailintalent/PDE-Control | 7031909188e7ce217da2b1628236011d1dff161a | [
"MIT"
] | 22 | 2020-04-27T12:48:32.000Z | 2022-03-23T10:41:48.000Z | scripts/sanity_check.py | tailintalent/PDE-Control | 7031909188e7ce217da2b1628236011d1dff161a | [
"MIT"
] | 5 | 2020-12-18T14:19:23.000Z | 2022-01-22T18:29:27.000Z | scripts/sanity_check.py | tailintalent/PDE-Control | 7031909188e7ce217da2b1628236011d1dff161a | [
"MIT"
] | 3 | 2021-05-29T23:30:53.000Z | 2022-02-14T06:30:32.000Z | import numpy as np
from phi.flow import Scene
from control.control_training import ControlTraining
from control.pde.value import IncrementPDE
# Data generation
from control.sequences import StaggeredSequence
if len(Scene.list('~/phi/data/value')) == 0:
scene = Scene.create('~/phi/data/value')
for frame in ... | 34.21875 | 153 | 0.603653 | import numpy as np
from phi.flow import Scene
from control.control_training import ControlTraining
from control.pde.value import IncrementPDE
# Data generation
from control.sequences import StaggeredSequence
if len(Scene.list('~/phi/data/value')) == 0:
scene = Scene.create('~/phi/data/value')
for frame in ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
002015c413482da7bc83b9a1f981f857cad976bb | 1,338 | py | Python | SimpleCrawler/main.py | swalter2/SimpleWebCrawler | 809d65f3796ef813e609defbb29de13a5abc78b9 | [
"MIT"
] | 1 | 2019-11-23T20:46:33.000Z | 2019-11-23T20:46:33.000Z | SimpleCrawler/main.py | swalter2/SimpleWebCrawler | 809d65f3796ef813e609defbb29de13a5abc78b9 | [
"MIT"
] | null | null | null | SimpleCrawler/main.py | swalter2/SimpleWebCrawler | 809d65f3796ef813e609defbb29de13a5abc78b9 | [
"MIT"
] | null | null | null | from queue import Queue
from spider import Spider
PROJECT_NAME = 'sebastianwalter'
HOMEPAGE = 'http://sebastianwalter.org'
DOMAIN_NAME = get_domain_name(HOMEPAGE)
QUEUE_FILE = PROJECT_NAME + '/queue.txt'
CRAWLED_FILE = PROJECT_NAME + '/crawled.txt'
NUMBER_OF_THREADS = 2
thread_queue = Queue()
# very first spider, crea... | 25.730769 | 98 | 0.707025 | import threading
from queue import Queue
from spider import Spider
from domain import *
from general import *
PROJECT_NAME = 'sebastianwalter'
HOMEPAGE = 'http://sebastianwalter.org'
DOMAIN_NAME = get_domain_name(HOMEPAGE)
QUEUE_FILE = PROJECT_NAME + '/queue.txt'
CRAWLED_FILE = PROJECT_NAME + '/crawled.txt'
NUMBER_OF_... | 0 | 0 | 0 | 0 | 0 | 512 | 0 | -6 | 154 |
117b244b1bb860223f57a6548aaf96d0c3c9bacb | 279 | py | Python | conferences/music-generation-with-magenta/code/constants.py | dubreuia/alexandredubreuil.com | 58e6001a59a8f89b7c47a1db136db5d2deecff8f | [
"MIT"
] | 5 | 2018-10-21T14:46:41.000Z | 2021-06-09T07:44:57.000Z | conferences/music-generation-with-magenta/code/constants.py | dubreuia/alexandredubreuil.com | 58e6001a59a8f89b7c47a1db136db5d2deecff8f | [
"MIT"
] | 25 | 2018-12-23T14:39:53.000Z | 2019-01-09T18:18:06.000Z | conferences/music-generation-with-magenta/code/constants.py | dubreuia/alexandredubreuil.com | 58e6001a59a8f89b7c47a1db136db5d2deecff8f | [
"MIT"
] | 4 | 2019-11-18T15:14:42.000Z | 2021-05-30T15:34:36.000Z | # MIDI input and output ports, on windows you'll have to
# start them manually using LoopMIDI or another software
MIDI_INPUT_PORT: str = "magenta_in"
MIDI_OUTPUT_PORT: str = "magenta_out"
# The server GUI for the app
WS_SERVER_HOST: str = "127.0.0.1"
WS_SERVER_PORT: int = 5000
| 31 | 56 | 0.763441 | # MIDI input and output ports, on windows you'll have to
# start them manually using LoopMIDI or another software
MIDI_INPUT_PORT: str = "magenta_in"
MIDI_OUTPUT_PORT: str = "magenta_out"
# The server GUI for the app
WS_SERVER_HOST: str = "127.0.0.1"
WS_SERVER_PORT: int = 5000
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e686935425f18c2e82734e79e80bde699dd8d70b | 47,167 | py | Python | toontown/catalog/CatalogGenerator.py | TheFamiliarScoot/open-toontown | 678313033174ea7d08e5c2823bd7b473701ff547 | [
"BSD-3-Clause"
] | 99 | 2019-11-02T22:25:00.000Z | 2022-02-03T03:48:00.000Z | toontown/catalog/CatalogGenerator.py | TheFamiliarScoot/open-toontown | 678313033174ea7d08e5c2823bd7b473701ff547 | [
"BSD-3-Clause"
] | 42 | 2019-11-03T05:31:08.000Z | 2022-03-16T22:50:32.000Z | toontown/catalog/CatalogGenerator.py | TheFamiliarScoot/open-toontown | 678313033174ea7d08e5c2823bd7b473701ff547 | [
"BSD-3-Clause"
] | 57 | 2019-11-03T07:47:37.000Z | 2022-03-22T00:41:49.000Z | from .CatalogFurnitureItem import CatalogFurnitureItem, nextAvailableCloset
from .CatalogAnimatedFurnitureItem import CatalogAnimatedFurnitureItem
from .CatalogClothingItem import CatalogClothingItem, getAllClothes
from .CatalogChatItem import CatalogChatItem, getChatRange
from .CatalogEmoteItem import CatalogEmoteItem... | 26.409295 | 1,142 | 0.675769 | from direct.directnotify import DirectNotifyGlobal
from . import CatalogItem
from . import CatalogItemList
from .CatalogFurnitureItem import CatalogFurnitureItem, nextAvailableCloset, getAllClosets, get50ItemCloset, getMaxClosets, get50ItemTrunk
from .CatalogAnimatedFurnitureItem import CatalogAnimatedFurnitureItem
fro... | 0 | 0 | 0 | 11,832 | 0 | 110 | 0 | 176 | 289 |
d7e685e25847c70888dc9247ac164cc4f73998bb | 1,908 | py | Python | app.py | CERTOS/OLD_CAR_PRICE_PRIDICTOR | 825fe70498758ab8fb8dc63aaad48ae3e7267063 | [
"MIT"
] | null | null | null | app.py | CERTOS/OLD_CAR_PRICE_PRIDICTOR | 825fe70498758ab8fb8dc63aaad48ae3e7267063 | [
"MIT"
] | null | null | null | app.py | CERTOS/OLD_CAR_PRICE_PRIDICTOR | 825fe70498758ab8fb8dc63aaad48ae3e7267063 | [
"MIT"
] | null | null | null | from flask import Flask
import pickle
app = Flask(__name__)
model = pickle.load(open("model.pkl", "rb"))
modelcol = pickle.load(open("modelcol.pkl", "rb"))
if __name__ == "__main__":
app.run(debug=True)
| 41.478261 | 163 | 0.654612 | import numpy as np
import pandas as pd
import traceback
from flask import Flask, request, jsonify, render_template
import pickle
app = Flask(__name__)
model = pickle.load(open("model.pkl", "rb"))
modelcol = pickle.load(open("modelcol.pkl", "rb"))
@app.route('/')
def home():
return render_template('home.html')
@app.... | 3 | 1,563 | 0 | 0 | 0 | 0 | 0 | 25 | 110 |
f5aed6199b492b830aa837be3309a538dcf238ac | 277 | py | Python | pyp/model/package_search.py | liying2008/PYP_Manager | fd006912e071a97c5682c402b16d42c15844fe95 | [
"MIT"
] | null | null | null | pyp/model/package_search.py | liying2008/PYP_Manager | fd006912e071a97c5682c402b16d42c15844fe95 | [
"MIT"
] | null | null | null | pyp/model/package_search.py | liying2008/PYP_Manager | fd006912e071a97c5682c402b16d42c15844fe95 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = 'liying'
| 18.466667 | 37 | 0.606498 | #!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = 'liying'
class SearchPackage(object):
def __init__(self):
self.package = None
self.version = None
self.is_installed = False
self.installed_version = None
self.summary = None
| 0 | 0 | 0 | 187 | 0 | 0 | 0 | 0 | 23 |
0d4b1fb3b25bb7d5c41da086fba874a625421aba | 983 | py | Python | backend/cabrenter/use_cases/driver_workspace.py | Sruinard/clean_architecture | 1e1af499c9503c525237c21a035ad62d9b286703 | [
"MIT"
] | null | null | null | backend/cabrenter/use_cases/driver_workspace.py | Sruinard/clean_architecture | 1e1af499c9503c525237c21a035ad62d9b286703 | [
"MIT"
] | null | null | null | backend/cabrenter/use_cases/driver_workspace.py | Sruinard/clean_architecture | 1e1af499c9503c525237c21a035ad62d9b286703 | [
"MIT"
] | null | null | null | # File containing the driver workspace usecase.
| 26.567568 | 93 | 0.603255 | # File containing the driver workspace usecase.
from typing import List
from cabrenter.entities.cab import Cab
from cabrenter.use_cases.driver_workspace_repo_interface import \
DriverWorkspaceRepoInterface
class DriverWorkspace:
def __init__(self, repo: DriverWorkspaceRepoInterface):
self.repo = repo... | 0 | 0 | 0 | 747 | 0 | 0 | 0 | 96 | 90 |
7325c9b36bfb425bfecf7e4b629a5231603b949b | 16,113 | py | Python | tests/depthai_feature_tracker_test.py | jonathandao0/depthai-frc | 9f1b4fc9e049f252e5f8fc53da02b9ed43d80b5a | [
"MIT"
] | 3 | 2021-11-23T17:00:55.000Z | 2022-02-17T20:23:50.000Z | tests/depthai_feature_tracker_test.py | jonathandao0/depthai-frc | 9f1b4fc9e049f252e5f8fc53da02b9ed43d80b5a | [
"MIT"
] | null | null | null | tests/depthai_feature_tracker_test.py | jonathandao0/depthai-frc | 9f1b4fc9e049f252e5f8fc53da02b9ed43d80b5a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import uuid
from pathlib import Path
import cv2
import depthai as dai
from common.config import NNConfig
# Create pipeline
pipeline = dai.Pipeline()
# Define sources and outputs
monoLeft = pipeline.create(dai.node.MonoCamera)
monoRight = pipeline.create(dai.node.MonoCamera)
# rgbCenter = pip... | 45.516949 | 179 | 0.695587 | #!/usr/bin/env python3
import uuid
from pathlib import Path
import cv2
import depthai as dai
from collections import deque
import numpy as np
from common.camera_info import H_CR
from common.config import NNConfig
class FeatureTrackerDrawer:
lineColor = (200, 0, 200)
pointColor = (0, 0, 255)
circleRadi... | 0 | 0 | 0 | 2,934 | 0 | 169 | 0 | 19 | 117 |
ee21d886c34500569b538bc7b95c98867b24da14 | 698 | py | Python | database_api/trans.py | shenhao-stu/2021_computer_design | 8729c1962a0aeaa12888092dda5d00723f62aad2 | [
"MIT"
] | 3 | 2021-03-29T08:25:29.000Z | 2021-09-17T22:45:18.000Z | database_api/trans.py | shenhao-stu/2021_computer_design | 8729c1962a0aeaa12888092dda5d00723f62aad2 | [
"MIT"
] | null | null | null | database_api/trans.py | shenhao-stu/2021_computer_design | 8729c1962a0aeaa12888092dda5d00723f62aad2 | [
"MIT"
] | 1 | 2022-02-22T02:15:51.000Z | 2022-02-22T02:15:51.000Z | # -*- coding: utf-8 -*-
POETRY_DIRECTORY = './add_poetry/'
if __name__ == "__main__":
main()
| 22.516129 | 58 | 0.643266 | # -*- coding: utf-8 -*-
import os
from zhconv import convert_for_mw
POETRY_DIRECTORY = './add_poetry/'
def trans(name):
file_path = os.path.join(POETRY_DIRECTORY, name)
raw = open(file_path, 'r', encoding='utf-8').read()
content = convert_for_mw(raw, 'zh-cn')
output_path = os.path.join('./simplify... | 0 | 0 | 0 | 0 | 0 | 506 | 0 | 0 | 90 |
b0026b2e12d68083a5ae7f36061f36b93208b27e | 766 | py | Python | day02/python/haro87/solution.py | clssn/aoc-2019 | a978e5235855be937e60a1e7f88d1ef9b541be15 | [
"MIT"
] | 22 | 2019-11-27T08:28:46.000Z | 2021-04-27T05:37:08.000Z | day02/python/haro87/solution.py | sancho1241/aoc-2019 | e0f63824c8250e0f84a42805e1a7ff7d9232002c | [
"MIT"
] | 77 | 2019-11-16T17:22:42.000Z | 2021-05-10T20:36:36.000Z | day02/python/haro87/solution.py | sancho1241/aoc-2019 | e0f63824c8250e0f84a42805e1a7ff7d9232002c | [
"MIT"
] | 43 | 2019-11-27T06:36:51.000Z | 2021-11-03T20:56:48.000Z | from enterprise import MontgomeryScott as Scotty
scotty = Scotty()
part_one()
part_two() | 26.413793 | 65 | 0.573107 | import random
from enterprise import MontgomeryScott as Scotty
scotty = Scotty()
def part_one():
with open('input.txt', "r") as commands:
trans = scotty.translate(commands.read())
res = scotty.execute(trans)
print('Part one, Scotty says: {0}'.format(res[0]))
def part_two():
with open... | 0 | 0 | 0 | 0 | 0 | 610 | 0 | -8 | 68 |
c99f7d28fc926a310b7c4b20fdf1a95a6f1ea5a6 | 3,189 | py | Python | challenge/tests/test_models.py | AlonViz/IML.HUJI | 107f7c20b8bd64d41452e4a5b66abe843af7eb18 | [
"MIT"
] | null | null | null | challenge/tests/test_models.py | AlonViz/IML.HUJI | 107f7c20b8bd64d41452e4a5b66abe843af7eb18 | [
"MIT"
] | null | null | null | challenge/tests/test_models.py | AlonViz/IML.HUJI | 107f7c20b8bd64d41452e4a5b66abe843af7eb18 | [
"MIT"
] | null | null | null |
import powerpuff.agoda_cancellation_prediction as agoda_cancellation_prediction
if __name__ == "__main__":
testBagging()
testEx4AdaBoost()
| 43.684932 | 119 | 0.698024 | import numpy as np
import pandas as pd
from sklearn.ensemble import BaggingClassifier, AdaBoostClassifier
from sklearn.metrics import f1_score
from sklearn.model_selection import train_test_split
from sklearn.tree import DecisionTreeClassifier
from IMLearn.metalearners import AdaBoost
from IMLearn.learners.classifiers ... | 0 | 0 | 0 | 0 | 0 | 2,602 | 0 | 165 | 268 |
b64c5b639d8371e5632dc38caecdddb678b0b98c | 348 | py | Python | schedules/views.py | zippy1981/student-course-management-system | f5b32695c4b67eb0b7697236e0d916712b5fe5e8 | [
"MIT"
] | null | null | null | schedules/views.py | zippy1981/student-course-management-system | f5b32695c4b67eb0b7697236e0d916712b5fe5e8 | [
"MIT"
] | 5 | 2019-03-04T12:23:58.000Z | 2021-06-10T21:15:42.000Z | schedules/views.py | zippy1981/student-course-management-system | f5b32695c4b67eb0b7697236e0d916712b5fe5e8 | [
"MIT"
] | null | null | null |
# Create your views here.
| 26.769231 | 64 | 0.775862 | from django.shortcuts import render
from django.http import HttpResponse
from scms import models
# Create your views here.
def index(request):
return HttpResponse("Welcome to the scheduler")
def get_schedule(request, schedule_id):
schedule = models.StudentCourseEnrollment.objects.filter('')
return HttpR... | 0 | 0 | 0 | 0 | 0 | 178 | 0 | 31 | 112 |
7ceb2f302eaee2850e7a46e0c53fed87c1eb1e44 | 3,134 | py | Python | scripts/convert-requirements-to-conda-yml.py | testacc-art/invest | 8f34712f89b8245ed7a4593b833d7d7a7d5e0c6e | [
"BSD-3-Clause"
] | 6 | 2020-02-26T16:31:42.000Z | 2022-02-28T21:10:25.000Z | scripts/convert-requirements-to-conda-yml.py | testacc-art/invest | 8f34712f89b8245ed7a4593b833d7d7a7d5e0c6e | [
"BSD-3-Clause"
] | 28 | 2020-04-09T23:39:38.000Z | 2020-04-17T00:30:47.000Z | scripts/convert-requirements-to-conda-yml.py | testacc-art/invest | 8f34712f89b8245ed7a4593b833d7d7a7d5e0c6e | [
"BSD-3-Clause"
] | 7 | 2020-02-26T16:31:47.000Z | 2022-03-14T12:06:21.000Z | # encoding=UTF-8
"""convert-requirements-to-conda-yml.py"""
import sys
import argparse
import pkg_resources
import requests
FEEDSTOCK_URL = 'https://github.com/conda-forge/{package}-feedstock'
YML_TEMPLATE = """channels:
- conda-forge
- defaults
dependencies:
{conda_dependencies}
{pip_dependencies}
"""
SCM_MAP = {... | 31.656566 | 79 | 0.600191 | # encoding=UTF-8
"""convert-requirements-to-conda-yml.py"""
import sys
import argparse
import pkg_resources
import requests
FEEDSTOCK_URL = 'https://github.com/conda-forge/{package}-feedstock'
YML_TEMPLATE = """channels:
- conda-forge
- defaults
dependencies:
{conda_dependencies}
{pip_dependencies}
"""
SCM_MAP = {... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1d189dbf5ee2d703ac3352a53f49729be3406d64 | 7,224 | py | Python | compiler.py | CoderDuino/PyVM | b230b0157b0c74350f982101c6a9f7677985e460 | [
"MIT"
] | null | null | null | compiler.py | CoderDuino/PyVM | b230b0157b0c74350f982101c6a9f7677985e460 | [
"MIT"
] | null | null | null | compiler.py | CoderDuino/PyVM | b230b0157b0c74350f982101c6a9f7677985e460 | [
"MIT"
] | null | null | null | # Higher Class Language compiler for PYVM
# transpiles a tiny language to ppvm for assembler
#
# By: Ari Stehney
#
import sys
import os
import crayons
at_compiler_tags = dict()
at_stack = dict()
at_functions = dict()
at_includes = dict()
filename1 = sys.argv[1]
filename2 = sys.argv[2]
print(crayons.cyan("opening..... | 44.592593 | 179 | 0.447536 | # Higher Class Language compiler for PYVM
# transpiles a tiny language to ppvm for assembler
#
# By: Ari Stehney
#
import sys
import os
import time
import crayons
at_compiler_tags = dict()
at_stack = dict()
at_functions = dict()
at_includes = dict()
def CompileCode(inputcode):
if not inputcode.count(';')>=(input... | 0 | 0 | 0 | 0 | 0 | 6,484 | 0 | -10 | 45 |
28a233230863b74a3a75556f507392efc0e36273 | 2,136 | py | Python | multiselect/multiselect_example.py | DovaX/multiselect | eff3e6c8959ade59760ebaf25fb2e09efcb896da | [
"MIT"
] | null | null | null | multiselect/multiselect_example.py | DovaX/multiselect | eff3e6c8959ade59760ebaf25fb2e09efcb896da | [
"MIT"
] | null | null | null | multiselect/multiselect_example.py | DovaX/multiselect | eff3e6c8959ade59760ebaf25fb2e09efcb896da | [
"MIT"
] | null | null | null | from multiselect_core import Multiselect
fruits=["Apple","Pear","Apricot","Banana","Orange","Raspberry","Blueberry","Kiwi","Pineapple"]
fruit_multiselect=[{"key":"Apple","value":False},{"key":"Pear","value":False},{"key":"Apricot","value":True},{"key":"Banana","value":False},
{"key":"Orange","value... | 44.5 | 301 | 0.669476 | from multiselect_core import Multiselect
fruits=["Apple","Pear","Apricot","Banana","Orange","Raspberry","Blueberry","Kiwi","Pineapple"]
fruit_multiselect=[{"key":"Apple","value":False},{"key":"Pear","value":False},{"key":"Apricot","value":True},{"key":"Banana","value":False},
{"key":"Orange","value... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0a94c0ab70cc9ecc06f54960ea05b5ab41ec04e6 | 100,345 | py | Python | game/content/ghplots/dd_roadedge_propp.py | fmunoz-geo/gearhead-caramel | 315835481d543420826439245be01460fe6dd81b | [
"Apache-2.0"
] | 74 | 2015-03-09T00:33:09.000Z | 2022-02-25T20:28:27.000Z | game/content/ghplots/dd_roadedge_propp.py | fmunoz-geo/gearhead-caramel | 315835481d543420826439245be01460fe6dd81b | [
"Apache-2.0"
] | 108 | 2017-12-30T20:26:12.000Z | 2021-01-16T12:37:00.000Z | game/content/ghplots/dd_roadedge_propp.py | CartoonFan/gearhead-caramel | 61995f382923695176ab7a65253f42e849e0c4d7 | [
"Apache-2.0"
] | 61 | 2018-03-03T09:55:31.000Z | 2022-03-18T17:28:33.000Z |
from game import memobrowser
Memo = memobrowser.Memo
# *****************************************
# *** ROAD EDGE PLOT DESCRIPTORS ***
# *****************************************
#
# For the basic "road is dangerous because of giant robots raiding convoys" plots, I'm going to use the random
# story techn... | 58.340116 | 357 | 0.697534 | import collections
import random
import game.content
import gears
import pbge
from game.content import gharchitecture
from game.content.ghplots import missionbuilder
from game.ghdialogue import context
from pbge.dialogue import Offer, ContextTag
from pbge.plots import Plot
from . import dd_customobjectives
from game ... | 0 | 572 | 0 | 94,110 | 2,030 | 0 | 0 | 66 | 1,416 |
55b7f0e163ddec5695f80f3757b1a0fc5f29815a | 1,367 | py | Python | Day1/Tower of Hanoi.py | manvi0308/IIEC-Rise | d2eb68ef60d95b2c1f5e6eb12d623a1fc20c1c99 | [
"MIT"
] | 34 | 2020-09-06T11:04:29.000Z | 2021-11-26T18:25:21.000Z | Day1/Tower of Hanoi.py | mehul523/100DaysOfAlgo | d0cbab7ac513010dcf9bf6045304b559669e713f | [
"MIT"
] | null | null | null | Day1/Tower of Hanoi.py | mehul523/100DaysOfAlgo | d0cbab7ac513010dcf9bf6045304b559669e713f | [
"MIT"
] | 10 | 2020-09-08T05:26:42.000Z | 2022-03-06T08:33:39.000Z | ''' Problem Tower of Hanoi:
About: Tower of Hanoi is a mathematical puzzle where we have three rods and n disks. The objective of the puzzle is to move the entire stack to another rod, obeying the following simple rules:
1) Only one disk can be moved at a time.
2) Each move consists of taking the upper disk from one of... | 54.68 | 192 | 0.733723 | ''' Problem Tower of Hanoi:
About: Tower of Hanoi is a mathematical puzzle where we have three rods and n disks. The objective of the puzzle is to move the entire stack to another rod, obeying the following simple rules:
1) Only one disk can be moved at a time.
2) Each move consists of taking the upper disk from one of... | 0 | 0 | 0 | 0 | 0 | 333 | 0 | 0 | 22 |
6814b5634f8d6bbbbd39edc3e1952b13d7077200 | 2,825 | py | Python | Scripts/simulation/whims/whim_modifiers.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | Scripts/simulation/whims/whim_modifiers.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | Scripts/simulation/whims/whim_modifiers.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | # uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\whims\whim_modifiers.py
# Compiled at: 2020-10-08 02:43:22
# Size of source mod 2**32: 3151 bytes
| 49.561404 | 224 | 0.720708 | # uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\whims\whim_modifiers.py
# Compiled at: 2020-10-08 02:43:22
# Size of source mod 2**32: 3151 bytes
fr... | 0 | 0 | 0 | 2,020 | 0 | 0 | 0 | 287 | 200 |
f43483984e6004e8a3d58af1c634394171917a55 | 9,326 | py | Python | pl_examples/domain_templates/imagenet.py | cuent/pytorch-lightning | b50ad528e69618d831aa01ee69f29b4f2a6a3e84 | [
"Apache-2.0"
] | 2 | 2021-06-24T11:46:53.000Z | 2021-06-24T13:29:50.000Z | pl_examples/domain_templates/imagenet.py | cuent/pytorch-lightning | b50ad528e69618d831aa01ee69f29b4f2a6a3e84 | [
"Apache-2.0"
] | null | null | null | pl_examples/domain_templates/imagenet.py | cuent/pytorch-lightning | b50ad528e69618d831aa01ee69f29b4f2a6a3e84 | [
"Apache-2.0"
] | 1 | 2022-03-21T18:37:54.000Z | 2022-03-21T18:37:54.000Z | """
This example is largely adapted from https://github.com/pytorch/examples/blob/master/imagenet/main.py
Before you can run this example, you will need to download the ImageNet dataset manually from the
`official website <http://image-net.org/download>`_ and place it into a folder `path/to/imagenet`.
Train on ImageN... | 34.540741 | 105 | 0.592644 | """
This example is largely adapted from https://github.com/pytorch/examples/blob/master/imagenet/main.py
Before you can run this example, you will need to download the ImageNet dataset manually from the
`official website <http://image-net.org/download>`_ and place it into a folder `path/to/imagenet`.
Train on ImageN... | 0 | 2,219 | 0 | 4,593 | 0 | 1,379 | 0 | 89 | 224 |
c01fa5121c03125800f80723022eac843d3bcdf4 | 5,732 | py | Python | depiction/interpreters/backprop/backpropeter.py | IBM/dl-interpretability-compbio | 3b13394f2dd9614736b4183b407a938a2c5924ac | [
"Apache-2.0"
] | 23 | 2019-07-10T08:35:11.000Z | 2019-11-20T13:53:01.000Z | depiction/interpreters/backprop/backpropeter.py | IBM/dl-interpretability-compbio | 3b13394f2dd9614736b4183b407a938a2c5924ac | [
"Apache-2.0"
] | 31 | 2019-07-03T17:08:31.000Z | 2019-11-21T12:45:56.000Z | depiction/interpreters/backprop/backpropeter.py | IBM/dl-interpretability-compbio | 3b13394f2dd9614736b4183b407a938a2c5924ac | [
"Apache-2.0"
] | 13 | 2019-07-12T18:45:19.000Z | 2019-11-20T16:25:20.000Z | """Backpropagation-like methods for interpretability
Wrapper around:
- (pytorch) Captum [1]
- (keras) DeepExplain [2]
References:
[1] https://captum.ai/
[2] https://arxiv.org/abs/1711.06104
"""
| 41.839416 | 138 | 0.643405 | """Backpropagation-like methods for interpretability
Wrapper around:
- (pytorch) Captum [1]
- (keras) DeepExplain [2]
References:
[1] https://captum.ai/
[2] https://arxiv.org/abs/1711.06104
"""
from captum.attr import IntegratedGradients, Saliency, DeepLift,\
DeepLiftShap, GradientShap... | 0 | 273 | 0 | 4,437 | 0 | 106 | 0 | 354 | 356 |
22256049dcfca1c7af345fd800b4907f4a380a80 | 4,385 | py | Python | honeywell_home/models/thermostat_settings_special_mode.py | dbarentine/udi-honeywellhome-poly | e89a3ff0e9a379d399813d42bf85e7c1215f6bc3 | [
"MIT"
] | 1 | 2019-12-19T18:57:17.000Z | 2019-12-19T18:57:17.000Z | honeywell_home/models/thermostat_settings_special_mode.py | dbarentine/udi-honeywellhome-poly | e89a3ff0e9a379d399813d42bf85e7c1215f6bc3 | [
"MIT"
] | 9 | 2020-03-01T19:51:06.000Z | 2021-09-27T21:16:36.000Z | honeywell_home/models/thermostat_settings_special_mode.py | dbarentine/udi-honeywellhome-poly | e89a3ff0e9a379d399813d42bf85e7c1215f6bc3 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Honeywell Home
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
| 31.546763 | 124 | 0.635576 | # coding: utf-8
"""
Honeywell Home
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
... | 0 | 1,322 | 0 | 2,720 | 0 | 0 | 0 | -31 | 105 |
444bba6b1ee4efb066d7ddc6272d1b7241bfc0d0 | 2,094 | py | Python | fn_digital_shadows_search/fn_digital_shadows_search/util/selftest.py | nickpartner-goahead/resilient-community-apps | 097c0dbefddbd221b31149d82af9809420498134 | [
"MIT"
] | 65 | 2017-12-04T13:58:32.000Z | 2022-03-24T18:33:17.000Z | fn_digital_shadows_search/fn_digital_shadows_search/util/selftest.py | nickpartner-goahead/resilient-community-apps | 097c0dbefddbd221b31149d82af9809420498134 | [
"MIT"
] | 48 | 2018-03-02T19:17:14.000Z | 2022-03-09T22:00:38.000Z | fn_digital_shadows_search/fn_digital_shadows_search/util/selftest.py | nickpartner-goahead/resilient-community-apps | 097c0dbefddbd221b31149d82af9809420498134 | [
"MIT"
] | 95 | 2018-01-11T16:23:39.000Z | 2022-03-21T11:34:29.000Z | # (c) Copyright IBM Corp. 2010, 2018. All Rights Reserved.
# -*- coding: utf-8 -*-
# pragma pylint: disable=unused-argument, no-self-use, line-too-long
"""Function implementation
test with: resilient-circuits selftest -l fn_digital_shadows_search
"""
import logging
import json
import requests
from requests.auth imp... | 30.347826 | 138 | 0.650907 | # (c) Copyright IBM Corp. 2010, 2018. All Rights Reserved.
# -*- coding: utf-8 -*-
# pragma pylint: disable=unused-argument, no-self-use, line-too-long
"""Function implementation
test with: resilient-circuits selftest -l fn_digital_shadows_search
"""
import logging
import json
import requests
from requests.auth imp... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ee8d6bdbc61700c123e8b8a143764159c53a10af | 1,038 | py | Python | tests/test_cli.py | gomjellie/gksdud | d157a6400c95abd2f9abb89c5fa5b8d617b5a99d | [
"MIT"
] | null | null | null | tests/test_cli.py | gomjellie/gksdud | d157a6400c95abd2f9abb89c5fa5b8d617b5a99d | [
"MIT"
] | 2 | 2019-12-31T13:49:51.000Z | 2019-12-31T13:49:51.000Z | tests/test_cli.py | gomjellie/gksdud | d157a6400c95abd2f9abb89c5fa5b8d617b5a99d | [
"MIT"
] | null | null | null | import unittest
if __name__ == '__main__':
unittest.main()
| 23.590909 | 83 | 0.594412 | import unittest
from click.testing import CliRunner
import gksdud
class CliTest(unittest.TestCase):
def setUp(self):
self.runner = CliRunner()
@classmethod
def output2str(cls, output):
return output.replace('\n', '')
@unittest.skip("kor2eng 가 먼저 구현되어야 가능함")
def test_cli_kor2eng(... | 90 | 720 | 0 | 148 | 0 | 0 | 0 | 6 | 68 |
537daa5e0bc09f4e93fc18a37ea5c8da376052d8 | 2,600 | py | Python | sandbox/graph-partition-separate.py | maarten1983/khmer | 417aaa57f0659685c01887a6910de1c08d0a73e5 | [
"BSD-3-Clause"
] | 1 | 2019-11-02T15:12:44.000Z | 2019-11-02T15:12:44.000Z | sandbox/graph-partition-separate.py | ibest/khmer | fbc307abd64363b329745709846d77444ce0c025 | [
"BSD-3-Clause"
] | null | null | null | sandbox/graph-partition-separate.py | ibest/khmer | fbc307abd64363b329745709846d77444ce0c025 | [
"BSD-3-Clause"
] | null | null | null | #! /usr/bin/env python2
#
# This file is part of khmer, http://github.com/ged-lab/khmer/, and is
# Copyright (C) Michigan State University, 2009-2013. It is licensed under
# the three-clause BSD license; see doc/LICENSE.txt.
# Contact: khmer-project@idyll.org
#
import sys
MAX_SIZE = 50000
if __name__ == '__main__':
... | 27.956989 | 77 | 0.58 | #! /usr/bin/env python2
#
# This file is part of khmer, http://github.com/ged-lab/khmer/, and is
# Copyright (C) Michigan State University, 2009-2013. It is licensed under
# the three-clause BSD license; see doc/LICENSE.txt.
# Contact: khmer-project@idyll.org
#
import sys
MAX_SIZE = 50000
def read_partition_file(fp)... | 0 | 0 | 0 | 0 | 569 | 0 | 0 | 0 | 23 |
b8da6bf98c68b5a2c55e89d035b8d0aac755d228 | 7,556 | py | Python | qLib/statistics.py | Patrolin/qLib | a3f4ea44eaec879d5f05c38e883351daab8ec1d2 | [
"Unlicense"
] | null | null | null | qLib/statistics.py | Patrolin/qLib | a3f4ea44eaec879d5f05c38e883351daab8ec1d2 | [
"Unlicense"
] | 9 | 2021-08-18T11:26:56.000Z | 2021-10-31T23:55:56.000Z | qLib/statistics.py | Patrolin/qLib | a3f4ea44eaec879d5f05c38e883351daab8ec1d2 | [
"Unlicense"
] | null | null | null |
# (sample mean, sample standard deviation)
def mean(X: list[int | float], weights: Optional[list[int | float]] = None):
'''return the population mean = sample mean of X in O(n)'''
if weights == None:
acc = 0.0
for x in X:
acc += x
return acc / len(X)
else:
acc = 0.0
for i in range(len(... | 29.865613 | 136 | 0.541689 | from collections import UserList
from typing import *
from .iterables import *
from .math import *
# (sample mean, sample standard deviation)
@overload
def mean(X: list[int | float]) -> float:
...
@overload
def mean(X: list[int | float], weights: list[int | float]) -> float:
...
def mean(X: list[int | float], we... | 0 | 266 | 0 | 2,073 | 0 | 498 | 0 | 11 | 385 |
8c6a92c14a6d1bdc3e7e8bd7a9571a056c234662 | 159 | py | Python | backend/posts/admin.py | Soumithri/website | de813cfd20f3b9e28b92c089524f998956ced3d9 | [
"MIT"
] | 2 | 2019-08-07T03:28:51.000Z | 2019-08-07T07:32:25.000Z | backend/posts/admin.py | Soumithri/website | de813cfd20f3b9e28b92c089524f998956ced3d9 | [
"MIT"
] | 7 | 2019-12-04T23:54:04.000Z | 2022-02-10T10:57:58.000Z | backend/posts/admin.py | Soumithri/website | de813cfd20f3b9e28b92c089524f998956ced3d9 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Post, Project, Author
admin.site.register(Post)
admin.site.register(Project)
admin.site.register(Author)
| 22.714286 | 41 | 0.811321 | from django.contrib import admin
from .models import Post, Project, Author
admin.site.register(Post)
admin.site.register(Project)
admin.site.register(Author)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6f36ba35f6ca8eafd9b9e3ea95ee5b99795aaf9a | 16,125 | py | Python | reinforcement_learning/rl_cartpole_ray_w_customDocker/common/sagemaker_rl/ray_launcher.py | yunzhe-tao/amazon-sagemaker-examples | a06d0d7f8aafa3e413770a98b542036c970bec99 | [
"Apache-2.0"
] | null | null | null | reinforcement_learning/rl_cartpole_ray_w_customDocker/common/sagemaker_rl/ray_launcher.py | yunzhe-tao/amazon-sagemaker-examples | a06d0d7f8aafa3e413770a98b542036c970bec99 | [
"Apache-2.0"
] | 1 | 2021-03-25T23:37:20.000Z | 2021-03-25T23:37:20.000Z | reinforcement_learning/rl_cartpole_ray_w_customDocker/common/sagemaker_rl/ray_launcher.py | yunzhe-tao/amazon-sagemaker-examples | a06d0d7f8aafa3e413770a98b542036c970bec99 | [
"Apache-2.0"
] | null | null | null |
TERMINATION_SIGNAL = "JOB_TERMINATED"
INTERMEDIATE_DIR = "/opt/ml/output/intermediate"
CHECKPOINT_DIR = "/opt/ml/input/data/checkpoint"
MODEL_OUTPUT_DIR = "/opt/ml/model"
| 45.041899 | 117 | 0.631318 | import json
import os
import subprocess
import sys
import time
from shutil import copyfile
from enum import Enum
import boto3
import ray
from ray.tune import run_experiments
from .tf_serving_utils import export_tf_serving, natural_keys, change_permissions_recursive
from .configuration_list import ConfigurationList
fr... | 0 | 126 | 0 | 15,355 | 0 | 0 | 0 | 114 | 356 |
7bb16459838f5f13c869407dcd03d8e30cf32c6c | 481 | py | Python | lino_book/projects/lydia/tests/dumps/18.12.0/cal_dailyplannerrow.py | lino-framework/lino_book | 4eab916832cd8f48ff1b9fc8c2789f0b437da0f8 | [
"BSD-2-Clause"
] | 3 | 2016-08-25T05:58:09.000Z | 2019-12-05T11:13:45.000Z | lino_book/projects/lydia/tests/dumps/18.12.0/cal_dailyplannerrow.py | lino-framework/lino_book | 4eab916832cd8f48ff1b9fc8c2789f0b437da0f8 | [
"BSD-2-Clause"
] | 18 | 2016-11-12T21:38:58.000Z | 2019-12-03T17:54:38.000Z | lino_book/projects/lydia/tests/dumps/18.12.0/cal_dailyplannerrow.py | lino-framework/lino_book | 4eab916832cd8f48ff1b9fc8c2789f0b437da0f8 | [
"BSD-2-Clause"
] | 9 | 2016-10-15T11:12:33.000Z | 2021-09-22T04:37:37.000Z | # -*- coding: UTF-8 -*-
logger.info("Loading 3 objects to table cal_dailyplannerrow...")
# fields: id, seqno, designation, start_time, end_time
loader.save(create_cal_dailyplannerrow(1,1,['AM', 'Vormittags', 'Avant-midi'],None,time(12,0,0)))
loader.save(create_cal_dailyplannerrow(2,2,['PM', 'Nachmittags', 'Apr\xe8s-mid... | 53.444444 | 103 | 0.735967 | # -*- coding: UTF-8 -*-
logger.info("Loading 3 objects to table cal_dailyplannerrow...")
# fields: id, seqno, designation, start_time, end_time
loader.save(create_cal_dailyplannerrow(1,1,['AM', 'Vormittags', 'Avant-midi'],None,time(12,0,0)))
loader.save(create_cal_dailyplannerrow(2,2,['PM', 'Nachmittags', 'Apr\xe8s-mid... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0faea056bf807dfa599bd58d15cc2e0acc6096d8 | 7,349 | py | Python | operations/facilities/views.py | kaizer88/emps | 2669b32c46befcf1a19390fb25013817e6b00980 | [
"MIT"
] | null | null | null | operations/facilities/views.py | kaizer88/emps | 2669b32c46befcf1a19390fb25013817e6b00980 | [
"MIT"
] | null | null | null | operations/facilities/views.py | kaizer88/emps | 2669b32c46befcf1a19390fb25013817e6b00980 | [
"MIT"
] | null | null | null |
from django.shortcuts import render
| 37.494898 | 154 | 0.679548 | import os
from django.shortcuts import render
from django.shortcuts import render, redirect, get_object_or_404, render_to_response
from django.template import RequestContext
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import login_required, user_passes_test
from django.contrib impo... | 0 | 6,261 | 0 | 0 | 0 | 0 | 0 | 426 | 624 |
e6d6a11efbfbf67bfca0735082e1fb05f28dffd7 | 4,730 | py | Python | recipes/sync_recipes.py | solvebio/solvebio-python | d21a70d77eb58502d76ca8f402967a3c15dd7ce1 | [
"MIT"
] | 14 | 2015-01-07T15:31:00.000Z | 2021-11-02T10:03:28.000Z | recipes/sync_recipes.py | solvebio/solvebio-python | d21a70d77eb58502d76ca8f402967a3c15dd7ce1 | [
"MIT"
] | 200 | 2015-01-26T17:12:21.000Z | 2022-01-14T08:59:30.000Z | recipes/sync_recipes.py | solvebio/solvebio-python | d21a70d77eb58502d76ca8f402967a3c15dd7ce1 | [
"MIT"
] | 9 | 2015-02-18T22:49:28.000Z | 2020-09-01T17:48:35.000Z |
__version__ = '1.0.0'
if __name__ == '__main__':
sync_recipes()
| 38.145161 | 97 | 0.64926 | import click
import recipes.sync_recipe_utils as sr
import solvebio as sb
__version__ = '1.0.0'
@click.group()
@click.option('--access-token', help='Manually provide a SolveBio Access Token')
@click.option('--api-host', help='Override the default SolveBio API host')
@click.option('--api-key', help='Manually provide ... | 0 | 3,546 | 0 | 0 | 0 | 895 | 0 | 8 | 204 |
8eb175734f521b6d49aacc1759a34433ce19c43e | 2,544 | py | Python | floodsystem/station.py | DhruvTrehan03/140IA-Flood-Warning-System | bf5440053546da120c3c7609ae713abae383ec0e | [
"MIT"
] | null | null | null | floodsystem/station.py | DhruvTrehan03/140IA-Flood-Warning-System | bf5440053546da120c3c7609ae713abae383ec0e | [
"MIT"
] | null | null | null | floodsystem/station.py | DhruvTrehan03/140IA-Flood-Warning-System | bf5440053546da120c3c7609ae713abae383ec0e | [
"MIT"
] | 1 | 2022-01-28T22:20:46.000Z | 2022-01-28T22:20:46.000Z | # Copyright (C) 2018 Garth N. Wells
#
# SPDX-License-Identifier: MIT
"""This module provides a model for a monitoring station, and tools
for manipulating/modifying station data
"""
# Task 1F
def inconsistent_typical_range_stations(stations):
"""Builds a list of stations with inconsistent typical ranges, i.e. no ... | 35.830986 | 114 | 0.627752 | # Copyright (C) 2018 Garth N. Wells
#
# SPDX-License-Identifier: MIT
"""This module provides a model for a monitoring station, and tools
for manipulating/modifying station data
"""
class MonitoringStation:
"""This class represents a river level monitoring station"""
def __init__(self, station_id, measure_id... | 0 | 0 | 0 | 1,884 | 0 | 0 | 0 | 0 | 23 |
cb1692199e755696ef91ada0140f7f20cc559873 | 832 | py | Python | test/PatternBuilderTest.py | bookdude13/domeshow-cherry | 981e32ade5cb789f45c0d9eec3bc7ceec39f280a | [
"MIT"
] | null | null | null | test/PatternBuilderTest.py | bookdude13/domeshow-cherry | 981e32ade5cb789f45c0d9eec3bc7ceec39f280a | [
"MIT"
] | 1 | 2017-11-20T20:02:45.000Z | 2017-11-20T20:02:45.000Z | test/PatternBuilderTest.py | bookdude13/domeshow-cherry | 981e32ade5cb789f45c0d9eec3bc7ceec39f280a | [
"MIT"
] | null | null | null | import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
test_build3()
| 43.789474 | 224 | 0.561298 | import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
import src.pattern.PatternBuilder as PB
def test_build3():
colorsA = [0, 0, 0, 10, 10, 10, 1, 1, 1, 11, 11, 11, 2, 2, 2, 12, 12, 12, 3, 3, 3, 13, 13, 13, 4, 4, 4, 14, 14, 14, 5, 5, 5, 15, 15, 15, 6, 6, 6, 16, 16, 16... | 0 | 0 | 0 | 0 | 0 | 653 | 0 | 18 | 46 |
8a06e90aea089e2875525aefc172f812701dac06 | 6,408 | py | Python | trac/ticket/tests/roadmap.py | wiraqutra/photrackjp | e120cba2a5d5d30f99ad084c6521e61f09694ee6 | [
"BSD-3-Clause"
] | null | null | null | trac/ticket/tests/roadmap.py | wiraqutra/photrackjp | e120cba2a5d5d30f99ad084c6521e61f09694ee6 | [
"BSD-3-Clause"
] | null | null | null | trac/ticket/tests/roadmap.py | wiraqutra/photrackjp | e120cba2a5d5d30f99ad084c6521e61f09694ee6 | [
"BSD-3-Clause"
] | null | null | null |
import unittest
if __name__ == '__main__':
unittest.main(defaultTest='suite')
| 46.100719 | 83 | 0.608926 | from trac.test import EnvironmentStub
from trac.ticket.roadmap import *
from trac.core import ComponentManager
import unittest
class TicketGroupStatsTestCase(unittest.TestCase):
def setUp(self):
self.stats = TicketGroupStats('title', 'units')
def test_init(self):
self.assertEqual... | 0 | 0 | 0 | 5,789 | 0 | 312 | 0 | 45 | 169 |
d867450e161c8b6b48ecd7fcba1c1e589b81ceb2 | 169 | py | Python | lambdata_pdugovich/__init__.py | Pdugovich/lambdata_ds8 | d30b594347f2b17ea155ef1571e806d9cb674480 | [
"MIT"
] | null | null | null | lambdata_pdugovich/__init__.py | Pdugovich/lambdata_ds8 | d30b594347f2b17ea155ef1571e806d9cb674480 | [
"MIT"
] | 2 | 2020-03-24T18:04:31.000Z | 2020-03-24T18:08:50.000Z | lambdata_pdugovich/__init__.py | Pdugovich/lambdata_pdugovich | d30b594347f2b17ea155ef1571e806d9cb674480 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
#sample code
ONES = pd.DataFrame(np)
ZEROES = pd.DataFrame(np.zeros(50))
#sample functions | 14.083333 | 35 | 0.710059 | import pandas as pd
import numpy as np
#sample code
ONES = pd.DataFrame(np)
ZEROES = pd.DataFrame(np.zeros(50))
#sample functions
def increment(x):
return(x + 1) | 0 | 0 | 0 | 0 | 0 | 14 | 0 | 0 | 22 |
9114baf7f1a01653308fac609b21964ca35706b0 | 5,650 | py | Python | custom_components/luxtronik/config_flow.py | BenPru/luxtronik | d5d160d7ab82d78a46310553f8f09cb2dd1c0c2b | [
"MIT"
] | 2 | 2021-11-16T19:43:45.000Z | 2021-11-29T11:30:49.000Z | custom_components/luxtronik/config_flow.py | BenPru/luxtronik | d5d160d7ab82d78a46310553f8f09cb2dd1c0c2b | [
"MIT"
] | 6 | 2021-10-30T16:07:57.000Z | 2021-11-18T14:27:38.000Z | custom_components/luxtronik/config_flow.py | BenPru/luxtronik | d5d160d7ab82d78a46310553f8f09cb2dd1c0c2b | [
"MIT"
] | null | null | null | """Config flow to configure the Luxtronik heatpump controller integration."""
# region Imports
from __future__ import annotations
# endregion Imports
| 37.171053 | 88 | 0.646549 | """Config flow to configure the Luxtronik heatpump controller integration."""
# region Imports
from __future__ import annotations
from typing import Any
import homeassistant.helpers.config_validation as cv
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.components.dhcp import HOST... | 0 | 149 | 2,494 | 2,061 | 0 | 0 | 0 | 524 | 269 |
55d979bebf0158e59c64f2d22022177f7acf650b | 1,385 | py | Python | djangocms_link/fields.py | donce/djangocms-link | 561e8475dd25cf299acd428829e758c3047f2e5e | [
"BSD-3-Clause"
] | null | null | null | djangocms_link/fields.py | donce/djangocms-link | 561e8475dd25cf299acd428829e758c3047f2e5e | [
"BSD-3-Clause"
] | null | null | null | djangocms_link/fields.py | donce/djangocms-link | 561e8475dd25cf299acd428829e758c3047f2e5e | [
"BSD-3-Clause"
] | null | null | null | from django.conf import settings
if 'django_select2' in settings.INSTALLED_APPS:
try:
except ImportError:
pass
| 35.512821 | 125 | 0.59639 | from django.conf import settings
if 'django_select2' in settings.INSTALLED_APPS:
try:
from django_select2.fields import AutoModelSelect2Field
class PageSearchField(AutoModelSelect2Field):
empty_values = []
search_fields = ['title_set__title__icontains', 'title_set__menu_tit... | 0 | 0 | 0 | 1,129 | 0 | 0 | 0 | 34 | 93 |
8d025c69cfed8c249f9ca208101f14321734307a | 3,981 | py | Python | RC49/CcGAN-based_KD/models/autoencoder_extract.py | UBCDingXin/cGAN-KD | c32a4b014fe024222101ff11d63de518448f7f8d | [
"MIT"
] | 1 | 2021-08-21T09:19:17.000Z | 2021-08-21T09:19:17.000Z | RC49/CcGAN-based_KD/models/autoencoder_extract.py | UBCDingXin/cGAN-KD | c32a4b014fe024222101ff11d63de518448f7f8d | [
"MIT"
] | null | null | null | RC49/CcGAN-based_KD/models/autoencoder_extract.py | UBCDingXin/cGAN-KD | c32a4b014fe024222101ff11d63de518448f7f8d | [
"MIT"
] | 2 | 2021-04-15T08:23:49.000Z | 2021-09-15T06:52:25.000Z | import torch
from torch import nn
if __name__=="__main__":
#test
net_encoder = encoder_extract(dim_bottleneck=64*64*3, ch=64).cuda()
net_decoder = decoder_extract(dim_bottleneck=64*64*3, ch=64).cuda()
net_encoder = nn.DataParallel(net_encoder)
net_decoder = nn.DataParallel(net_decoder)
x... | 31.595238 | 101 | 0.532781 | import torch
from torch import nn
class encoder_extract(nn.Module):
def __init__(self, dim_bottleneck=64*64*3, ch=64):
super(encoder_extract, self).__init__()
self.ch = ch
self.dim_bottleneck = dim_bottleneck
self.conv = nn.Sequential(
nn.Conv2d(3, ch, kernel_size=4, ... | 0 | 0 | 0 | 3,466 | 0 | 0 | 0 | 0 | 46 |
1a688412a3db94e5aa0c2e4f45550052b3d82fe6 | 7,019 | py | Python | windows/utils/winutils.py | sogeti-esec-lab/LKD | f388b5f8c08b7bba2a31c5a16ea64add6cc2dd1a | [
"BSD-3-Clause"
] | 102 | 2015-10-21T10:58:06.000Z | 2021-06-07T17:59:52.000Z | windows/utils/winutils.py | a1ext/LKD | f388b5f8c08b7bba2a31c5a16ea64add6cc2dd1a | [
"BSD-3-Clause"
] | 1 | 2019-09-24T20:45:57.000Z | 2019-09-24T20:45:57.000Z | windows/utils/winutils.py | w4kfu/LKD | f388b5f8c08b7bba2a31c5a16ea64add6cc2dd1a | [
"BSD-3-Clause"
] | 16 | 2015-10-29T14:10:14.000Z | 2019-10-27T18:58:52.000Z | import msvcrt
import os
import sys
from .. import winproxy
from ..generated_def import windef
# Function resolution !
def create_file_from_handle(handle, mode="r"):
"""Return a Python :class:`file` arround a windows HANDLE"""
fd = msvcrt.open_osfhandle(handle, os.O_TEXT)
return os.fdopen(fd, mode, 0)
... | 35.095 | 129 | 0.707366 | import ctypes
import msvcrt
import os
import sys
import code
import windows
from .. import winproxy
from ..generated_def import windef
from ..generated_def.winstructs import *
# Function resolution !
def get_func_addr(dll_name, func_name):
# Load the DLL
ctypes.WinDLL(dll_name)
modules = wind... | 0 | 0 | 0 | 1,371 | 0 | 2,026 | 0 | -6 | 272 |
3c885abd66e00ab0f13484522522acd705fc0407 | 1,450 | py | Python | scripts/common.py | phvalguima/bundle-kubeflow | e6097e8d4271f2dce634ec6763fd2587cf72714c | [
"Apache-2.0"
] | null | null | null | scripts/common.py | phvalguima/bundle-kubeflow | e6097e8d4271f2dce634ec6763fd2587cf72714c | [
"Apache-2.0"
] | null | null | null | scripts/common.py | phvalguima/bundle-kubeflow | e6097e8d4271f2dce634ec6763fd2587cf72714c | [
"Apache-2.0"
] | null | null | null | import os
import shutil
import subprocess
import sys
def run(*args, env: dict = None, check=True):
"""Runs command and exits script gracefully on errors."""
print(f'+ {" ".join(args)}')
if env is None:
env = os.environ
else:
env = {**env, **os.environ}
result = subprocess.run(ar... | 25.892857 | 94 | 0.609655 | import os
import shutil
import subprocess
import sys
def run(*args, env: dict = None, check=True):
"""Runs command and exits script gracefully on errors."""
print(f'+ {" ".join(args)}')
if env is None:
env = os.environ
else:
env = {**env, **os.environ}
result = subprocess.run(ar... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
200784d7ee7effded0239659e7b45333e901ccb3 | 1,418 | py | Python | model/investor.py | keremkoseoglu/Kifu | bed7a15f71e2345c654b1adab07a5edecdbae342 | [
"MIT"
] | null | null | null | model/investor.py | keremkoseoglu/Kifu | bed7a15f71e2345c654b1adab07a5edecdbae342 | [
"MIT"
] | 82 | 2020-06-25T09:45:01.000Z | 2022-03-31T09:35:31.000Z | model/investor.py | keremkoseoglu/Kifu | bed7a15f71e2345c654b1adab07a5edecdbae342 | [
"MIT"
] | null | null | null | """ Investment adviser module """
_INVEST_FILE = "invest.json"
| 31.511111 | 74 | 0.547955 | """ Investment adviser module """
import os
import json
import config
from model.bank_account import get_next_investment_account
_INVEST_FILE = "invest.json"
def _get_file_path() -> str:
return os.path.join(config.CONSTANTS["DATA_DIR_PATH"] + _INVEST_FILE)
class InvestmentAdviser:
""" Investment adviser cla... | 0 | 0 | 0 | 1,131 | 0 | 81 | 0 | 7 | 134 |
bf8cd270bf4d6917bb5c84e64ac1edd18df3c812 | 738 | py | Python | tests/checks/test_blank_header.py | jdaviscooke/goodtables-py | 7778d1e3630f4ab95dfb76d13106c9733d4ec4c0 | [
"MIT"
] | 243 | 2016-11-20T21:15:21.000Z | 2022-02-22T04:55:40.000Z | tests/checks/test_blank_header.py | jdaviscooke/goodtables-py | 7778d1e3630f4ab95dfb76d13106c9733d4ec4c0 | [
"MIT"
] | 235 | 2016-10-02T21:08:31.000Z | 2020-09-10T11:14:21.000Z | tests/checks/test_blank_header.py | jdaviscooke/goodtables-py | 7778d1e3630f4ab95dfb76d13106c9733d4ec4c0 | [
"MIT"
] | 49 | 2017-02-22T04:36:43.000Z | 2020-07-01T11:10:40.000Z | # -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
# Check
| 22.363636 | 58 | 0.676152 | # -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
from goodtables.checks.blank_header import blank_header
import goodtables.cells
# Check
def test_check_blank_header(log):
errors = []
c... | 0 | 0 | 0 | 0 | 0 | 427 | 0 | 36 | 91 |
0df6ceec0b1a1f15a22334ec4e936b287fcc97ab | 366 | py | Python | Python/Basics/py_R3/merging.py | ABPande/MyPythonRepo | 51de39aee6c99b6ea2eb47fb199925ee63ca3750 | [
"Apache-2.0"
] | null | null | null | Python/Basics/py_R3/merging.py | ABPande/MyPythonRepo | 51de39aee6c99b6ea2eb47fb199925ee63ca3750 | [
"Apache-2.0"
] | null | null | null | Python/Basics/py_R3/merging.py | ABPande/MyPythonRepo | 51de39aee6c99b6ea2eb47fb199925ee63ca3750 | [
"Apache-2.0"
] | null | null | null | import pandas as pd
d1 = {
'c1':[1,2,3,4],
'c2':[444,555,666,444],
'c3':'abc def hij lmn'.split()}
d2 = {
'c1':[1,2,3],
'c4':'x y z'.split()
}
print (d1)
df1 = pd.DataFrame(d1)
print (df1)
print(df1['c2'].unique())
df2 = pd.DataFrame(d2)
print (pd.merge(df1,df2,how="inner",on='c1'))
print (df1['c2'].value_counts(... | 17.428571 | 45 | 0.606557 | import numpy as np
import pandas as pd
d1 = {
'c1':[1,2,3,4],
'c2':[444,555,666,444],
'c3':'abc def hij lmn'.split()}
d2 = {
'c1':[1,2,3],
'c4':'x y z'.split()
}
print (d1)
df1 = pd.DataFrame(d1)
print (df1)
print(df1['c2'].unique())
df2 = pd.DataFrame(d2)
print (pd.merge(df1,df2,how="inner",on='c1'))
print (df1[... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 22 |
0c4507987bbe041cc2bdbe487c94ab7c04dde3de | 23 | py | Python | lager_cantools/version.py | lagerdata/cantools | d6d571ff2ddd55289d918155186f4d0271652f72 | [
"MIT"
] | 1 | 2021-01-23T14:11:44.000Z | 2021-01-23T14:11:44.000Z | lager_cantools/version.py | lagerdata/cantools | d6d571ff2ddd55289d918155186f4d0271652f72 | [
"MIT"
] | null | null | null | lager_cantools/version.py | lagerdata/cantools | d6d571ff2ddd55289d918155186f4d0271652f72 | [
"MIT"
] | null | null | null | __version__ = '36.1.0'
| 11.5 | 22 | 0.652174 | __version__ = '36.1.0'
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
052b077ebfa28832d4fca6bf0a9de9a5d100eebe | 780 | py | Python | script_migrate_maplet.py | gislite/maplet | eb2577eea96775861fd20b949cd4d88cbb6cd7d1 | [
"MIT"
] | 36 | 2017-04-04T15:20:33.000Z | 2021-06-30T09:37:42.000Z | script_migrate_maplet.py | gislite/maplet | eb2577eea96775861fd20b949cd4d88cbb6cd7d1 | [
"MIT"
] | null | null | null | script_migrate_maplet.py | gislite/maplet | eb2577eea96775861fd20b949cd4d88cbb6cd7d1 | [
"MIT"
] | 16 | 2017-02-26T01:01:43.000Z | 2021-03-17T07:47:57.000Z | # -*- coding: utf-8 -*-
'''
for database schema migration.
Memo for Usage:
migrate.migrate(torcms_migrator.rename_table('e_layout', 'mablayout'))
migrate.migrate(torcms_migrator.drop_column('tabtag', 'role_mask'))
'''
from playhouse import migrate
import config
def run_migrate(*args):
'''
running so... | 21.081081 | 88 | 0.691026 | # -*- coding: utf-8 -*-
'''
for database schema migration.
Memo for Usage:
migrate.migrate(torcms_migrator.rename_table('e_layout', 'mablayout'))
migrate.migrate(torcms_migrator.drop_column('tabtag', 'role_mask'))
'''
from playhouse import migrate
from playhouse.postgres_ext import BinaryJSONField
import conf... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 29 | 22 |
65137ad9cb8ed21ca53490be07665f9b8c6f200c | 2,149 | py | Python | pytype/tools/annotate_ast/annotate_ast_test.py | priyansh19/pytype | 44b1f6f7cddccb326abac4c21b4f26688369764e | [
"Apache-2.0"
] | 2 | 2019-07-25T12:53:02.000Z | 2019-08-18T16:26:16.000Z | pytype/tools/annotate_ast/annotate_ast_test.py | priyansh19/pytype | 44b1f6f7cddccb326abac4c21b4f26688369764e | [
"Apache-2.0"
] | null | null | null | pytype/tools/annotate_ast/annotate_ast_test.py | priyansh19/pytype | 44b1f6f7cddccb326abac4c21b4f26688369764e | [
"Apache-2.0"
] | null | null | null | from pytype.tests import test_base
test_base.main(globals(), __name__ == '__main__')
| 29.040541 | 80 | 0.63006 | import ast
import itertools
import textwrap
from pytype import config
from pytype.tests import test_base
from pytype.tools.annotate_ast import annotate_ast
import six
class AnnotaterTest(test_base.TargetIndependentTest):
def annotate(self, source):
source = textwrap.dedent(source.lstrip('\n'))
filename = ... | 0 | 0 | 0 | 1,905 | 0 | 0 | 0 | 0 | 156 |
6ad70d4913158b0de1cd1d5f537e156a79bc50eb | 1,339 | py | Python | chapter05/dcc.py | farispriadi/pelatihan-dash-plotly | 0b5d19457ee7b8a2ae3d6226eefcbb5bd1288c4e | [
"MIT"
] | null | null | null | chapter05/dcc.py | farispriadi/pelatihan-dash-plotly | 0b5d19457ee7b8a2ae3d6226eefcbb5bd1288c4e | [
"MIT"
] | null | null | null | chapter05/dcc.py | farispriadi/pelatihan-dash-plotly | 0b5d19457ee7b8a2ae3d6226eefcbb5bd1288c4e | [
"MIT"
] | null | null | null | import dash
import dash_core_components as dcc
import dash_html_components as html
# object Dash app
app = dash.Dash()
app.layout = html.Div([
# Div untuk Dropdown
html.Div([
html.Label(["Length Unit"]),
dcc.Dropdown(id='my-dropdown',
options=[{'label':'cm', 'value': 'centimeter'},
{'label':'m',... | 25.264151 | 69 | 0.572816 | import dash
import dash_core_components as dcc
import dash_html_components as html
# object Dash app
app = dash.Dash()
app.layout = html.Div([
# Div untuk Dropdown
html.Div([
html.Label(["Length Unit"]),
dcc.Dropdown(id='my-dropdown',
options=[{'label':'cm', 'value': 'centimeter'},
{'label':'m',... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0709136c65c19a457ce1e79f275f302e590174e3 | 305 | py | Python | twitter-api/tweet_fields.py | YusukeTokugawa/twitter-api | ca8f255990763c18509133fc91bdb50687d53051 | [
"MIT"
] | null | null | null | twitter-api/tweet_fields.py | YusukeTokugawa/twitter-api | ca8f255990763c18509133fc91bdb50687d53051 | [
"MIT"
] | null | null | null | twitter-api/tweet_fields.py | YusukeTokugawa/twitter-api | ca8f255990763c18509133fc91bdb50687d53051 | [
"MIT"
] | null | null | null | # coding: UTF-8
'''
Created on Nov 13, 2018
@author: Yusuke_Tokugawa
''' | 15.25 | 24 | 0.665574 | # coding: UTF-8
'''
Created on Nov 13, 2018
@author: Yusuke_Tokugawa
'''
import dataclasses
from typing import List
@dataclasses.dataclass
class TweetFields:
fullname: str
href: str
id: int
date: str
hashtags: List[str]
likes: int
replies: int
retweets: int
text: str | 0 | 166 | 0 | 0 | 0 | 0 | 0 | -1 | 67 |
24f316fad364552997dc369dd2acbc4eb744fea3 | 4,912 | py | Python | PasteJacker/Core/utils.py | TheRipperJhon/Paste_Jacker | 16ba7ad81c5ed999921092c1b4547ff5234dbb4d | [
"CNRI-Python",
"Linux-OpenIB"
] | null | null | null | PasteJacker/Core/utils.py | TheRipperJhon/Paste_Jacker | 16ba7ad81c5ed999921092c1b4547ff5234dbb4d | [
"CNRI-Python",
"Linux-OpenIB"
] | null | null | null | PasteJacker/Core/utils.py | TheRipperJhon/Paste_Jacker | 16ba7ad81c5ed999921092c1b4547ff5234dbb4d | [
"CNRI-Python",
"Linux-OpenIB"
] | null | null | null | # -*- encoding: utf-8 -*-
#Written by: Karim shoair - D4Vinci ( Cr3dOv3r )
import pkg_resources
banner = """{G}
/T /I
/ |/ | .-~/
T\ Y I |/ / _
/T | \I | I Y.-~/
I l /I T\ | | l | T ... | 40.595041 | 142 | 0.398208 | # -*- encoding: utf-8 -*-
#Written by: Karim shoair - D4Vinci ( Cr3dOv3r )
import os,time,subprocess,pkg_resources
from . import updater
from .color import *
banner = """{G}
/T /I
/ |/ | .-~/
T\ Y I |/ / _
/T ... | 147 | 0 | 0 | 0 | 0 | 1,890 | 0 | 18 | 251 |
621a9a60082fb8b10a97b7cd141a6116567a51df | 7,906 | py | Python | GPG/util/utils.py | HLTCHKUST/MulQG | 8e257f2d6c0f03c07ea8a0bf0e8f55b0cde60605 | [
"MIT"
] | 19 | 2020-10-05T16:28:13.000Z | 2022-02-22T12:16:27.000Z | GPG/util/utils.py | Iamfinethanksu/MulQG | 8e257f2d6c0f03c07ea8a0bf0e8f55b0cde60605 | [
"MIT"
] | 9 | 2021-01-20T15:15:53.000Z | 2021-09-07T09:07:56.000Z | GPG/util/utils.py | Iamfinethanksu/MulQG | 8e257f2d6c0f03c07ea8a0bf0e8f55b0cde60605 | [
"MIT"
] | 7 | 2020-10-16T14:18:24.000Z | 2021-11-09T05:46:00.000Z | import yaml
def read_config(path):
'''config'''
return AttrDict(yaml.load(open(path, 'r')))
| 33.218487 | 142 | 0.536175 | import os
import csv
import codecs
import yaml
import time
import numpy as np
import nltk
from nltk.translate import bleu_score
import pickle
import gzip
class AttrDict(dict):
def __init__(self, *args, **kwargs):
super(AttrDict, self).__init__(*args, **kwargs)
self.__dict__ = self
... | 12 | 0 | 0 | 129 | 0 | 7,163 | 0 | -56 | 532 |
5d090eb55bb69a6293474e9189a1449f588d5950 | 1,446 | py | Python | lektor_expression_type.py | dairiki/lektor-expression-type | f6840da291c0f7bb7edc453f31e0499bc54899a7 | [
"MIT"
] | 1 | 2021-12-17T20:26:06.000Z | 2021-12-17T20:26:06.000Z | lektor_expression_type.py | dairiki/lektor-expression-type | f6840da291c0f7bb7edc453f31e0499bc54899a7 | [
"MIT"
] | null | null | null | lektor_expression_type.py | dairiki/lektor-expression-type | f6840da291c0f7bb7edc453f31e0499bc54899a7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Add jinja-evaluated types to lektor.
"""
| 26.290909 | 72 | 0.670124 | # -*- coding: utf-8 -*-
"""Add jinja-evaluated types to lektor.
"""
import jinja2
from lektor.environment import (
Expression,
FormatExpression,
)
from lektor.pluginsystem import Plugin
from lektor.types import Type
class ExpressionDescriptor(object):
def __init__(self, pad, expr):
self.pad = ... | 0 | 0 | 0 | 1,098 | 0 | 0 | 0 | 72 | 203 |
47d9074575468008735489144ac6845135745e46 | 784 | py | Python | utils.py | jwustrack/climon | 0fca00a727c39de01c42162d42b193f326705892 | [
"MIT"
] | 3 | 2018-12-22T06:30:46.000Z | 2021-05-05T04:51:22.000Z | utils.py | jwustrack/climon | 0fca00a727c39de01c42162d42b193f326705892 | [
"MIT"
] | null | null | null | utils.py | jwustrack/climon | 0fca00a727c39de01c42162d42b193f326705892 | [
"MIT"
] | null | null | null | '''
Non-business-logic utility functions
'''
def firsts(rows):
'''
Returns the set of first elements of all rows:
>>> sorted(firsts([(7, 1, 2),\
[5, 4, 0, 3],\
[8, 4],\
[5, 4]]))
[5, 7, 8]
'''
return set(r[0] for r in rows)
def append_each(l, to_append):
'''
>>... | 21.189189 | 86 | 0.482143 | '''
Non-business-logic utility functions
'''
def firsts(rows):
'''
Returns the set of first elements of all rows:
>>> sorted(firsts([(7, 1, 2),\
[5, 4, 0, 3],\
[8, 4],\
[5, 4]]))
[5, 7, 8]
'''
return set(r[0] for r in rows)
def pack_by(l, n):
'''
Yields element... | 0 | 0 | 0 | 0 | 244 | 0 | 0 | 0 | 23 |
70a2317f1023e36a90a02c4f0ade61f4afe73e24 | 2,559 | py | Python | speccases/extrapolatecases2.py | alex1770/Covid-19 | 0212593bf5d9bcbb7009c7d1fb1710116ad8bf32 | [
"MIT"
] | 5 | 2021-06-26T09:22:45.000Z | 2021-12-20T21:29:22.000Z | speccases/extrapolatecases2.py | alex1770/Covid-19 | 0212593bf5d9bcbb7009c7d1fb1710116ad8bf32 | [
"MIT"
] | 1 | 2021-12-21T09:45:17.000Z | 2021-12-21T09:45:17.000Z | speccases/extrapolatecases2.py | alex1770/Covid-19 | 0212593bf5d9bcbb7009c7d1fb1710116ad8bf32 | [
"MIT"
] | 2 | 2021-06-25T18:27:56.000Z | 2021-12-12T17:49:31.000Z | import json, os
from requests import get
import numpy as np
from math import log
np.set_printoptions(precision=4,suppress=True)
np.set_printoptions(edgeitems=30, linewidth=100000)
adir='casesbyspecdate'
mindate='2021-02-24'# Can't get archive data earlier than 2021-02-24
now=datetime.datetime.utcnow().strftime('%Y-%m... | 28.120879 | 144 | 0.686987 | from stuff import *
import json,os
from requests import get
import numpy as np
from random import random
from math import sqrt,log
np.set_printoptions(precision=4,suppress=True)
np.set_printoptions(edgeitems=30, linewidth=100000)
adir='casesbyspecdate'
mindate='2021-02-24'# Can't get archive data earlier than 2021-02... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 44 |
42aa2f6ae401e038ba8cf92ad6a26fc1d78559e2 | 8,578 | py | Python | qiskit_metal/qlibrary/qubits/transmon_concentric.py | TomVethaak/qiskit-metal | 0fd3049b16a2b28dc6890b696d67329a91da70b9 | [
"Apache-2.0"
] | 167 | 2021-03-17T20:35:17.000Z | 2022-03-31T13:25:04.000Z | qiskit_metal/qlibrary/qubits/transmon_concentric.py | TomVethaak/qiskit-metal | 0fd3049b16a2b28dc6890b696d67329a91da70b9 | [
"Apache-2.0"
] | 307 | 2021-03-17T14:07:43.000Z | 2022-03-23T14:22:20.000Z | qiskit_metal/qlibrary/qubits/transmon_concentric.py | TomVethaak/qiskit-metal | 0fd3049b16a2b28dc6890b696d67329a91da70b9 | [
"Apache-2.0"
] | 122 | 2021-03-17T14:21:24.000Z | 2022-03-18T10:09:38.000Z | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | 41.240385 | 93 | 0.56097 | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | 0 | 0 | 0 | 7,887 | 0 | 0 | 0 | 42 | 112 |
8031c75efb463daa85a3b8255bc080c973495316 | 1,987 | py | Python | optimal/common.py | Azzukhan/optimal | 75c59742b3942f12b2dfca9b4d1a282e76a394c9 | [
"MIT"
] | 36 | 2017-09-08T14:47:27.000Z | 2022-03-31T02:12:31.000Z | optimal/common.py | Azzukhan/optimal | 75c59742b3942f12b2dfca9b4d1a282e76a394c9 | [
"MIT"
] | 1 | 2020-03-03T04:29:57.000Z | 2020-07-06T03:42:56.000Z | optimal/common.py | Azzukhan/optimal | 75c59742b3942f12b2dfca9b4d1a282e76a394c9 | [
"MIT"
] | 14 | 2017-10-03T12:45:20.000Z | 2021-12-16T01:48:00.000Z | ###############################################################################
# The MIT License (MIT)
#
# Copyright (c) 2014 Justin Lovinger
#
# 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 Softwar... | 42.276596 | 80 | 0.688978 | ###############################################################################
# The MIT License (MIT)
#
# Copyright (c) 2014 Justin Lovinger
#
# 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 Softwar... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3ff917c777f72277fd28e8ac7003422aca296956 | 3,594 | py | Python | RQ1_data_software/phase2_energy_detector/energy_to_csv/rosd_energy_to_csv.py | S2-group/msr-2021-robotics-green-architectural-tactics-replication-package | fc4a205b00abb0b096c472856002e440e73f2c5d | [
"MIT"
] | 2 | 2021-03-26T17:29:27.000Z | 2021-03-27T20:06:21.000Z | RQ1_data_software/phase2_energy_detector/energy_to_csv/rosd_energy_to_csv.py | S2-group/msr-2021-robotics-green-architectural-tactics-replication-package | fc4a205b00abb0b096c472856002e440e73f2c5d | [
"MIT"
] | null | null | null | RQ1_data_software/phase2_energy_detector/energy_to_csv/rosd_energy_to_csv.py | S2-group/msr-2021-robotics-green-architectural-tactics-replication-package | fc4a205b00abb0b096c472856002e440e73f2c5d | [
"MIT"
] | null | null | null | import csv
import json
from itertools import zip_longest
with open('../energy_detectors/data/ros-discourse_data.json') as f:
rosd_data = json.load(f)
rosd_url = [item.get('url') for item in rosd_data]
rosd_tcontents = [item.get('thread_contents')
for item in rosd_data]
rosd_tdetails = [item.get(... | 25.856115 | 67 | 0.640512 | import csv
import json
from itertools import zip_longest
with open('../energy_detectors/data/ros-discourse_data.json') as f:
rosd_data = json.load(f)
rosd_url = [item.get('url') for item in rosd_data]
rosd_tcontents = [item.get('thread_contents')
for item in rosd_data]
rosd_tdetails = [item.get(... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2aca6a7718320e83f4233372a60a2fc78adae9c3 | 4,535 | py | Python | core/wavenet/utils.py | rist-ro/argo | a10c33346803239db8a64c104db7f22ec4e05bef | [
"MIT"
] | 4 | 2020-12-07T19:13:13.000Z | 2022-01-30T18:52:18.000Z | core/wavenet/utils.py | rist-ro/argo | a10c33346803239db8a64c104db7f22ec4e05bef | [
"MIT"
] | 12 | 2020-09-25T22:41:28.000Z | 2022-02-09T23:46:34.000Z | core/wavenet/utils.py | rist-ro/argo | a10c33346803239db8a64c104db7f22ec4e05bef | [
"MIT"
] | 2 | 2021-03-02T18:31:04.000Z | 2021-03-02T21:56:43.000Z | import tensorflow as tf
import numpy as np
def mu_law(x, mu=255, int8=False):
"""A TF implementation of Mu-Law encoding.
Args:
x: The audio samples to encode between [-1, 1]
mu: The Mu to use in our Mu-Law.
int8: Use int8 encoding.
Returns:
out: The Mu-Law encoded int8 data [-128... | 29.835526 | 80 | 0.609041 | import tensorflow as tf
import numpy as np
def mu_law(x, mu=255, int8=False):
"""A TF implementation of Mu-Law encoding.
Args:
x: The audio samples to encode between [-1, 1]
mu: The Mu to use in our Mu-Law.
int8: Use int8 encoding.
Returns:
out: The Mu-Law encoded int8 data [-128... | 0 | 0 | 0 | 0 | 0 | 384 | 0 | 0 | 23 |
3b1cb9b4c99e4da7354a4da28dddc7745979a487 | 250 | py | Python | list01/exer_07.py | pedrolucas27/exercising-python | 4b30bbce6b860fb617baf4600d8da83b68023e82 | [
"MIT"
] | null | null | null | list01/exer_07.py | pedrolucas27/exercising-python | 4b30bbce6b860fb617baf4600d8da83b68023e82 | [
"MIT"
] | null | null | null | list01/exer_07.py | pedrolucas27/exercising-python | 4b30bbce6b860fb617baf4600d8da83b68023e82 | [
"MIT"
] | null | null | null | #Faa um Programa que calcule a rea de um quadrado,
# em seguida mostre o dobro desta rea para o usurio.
from decimal import Decimal
lado = Decimal(input("Informe o lado do quadrado:"))
a = lado ** 2
print("O dobro da rea do quadrado ",(a * 2)) | 41.666667 | 55 | 0.724 | #Faça um Programa que calcule a área de um quadrado,
# em seguida mostre o dobro desta área para o usuário.
from decimal import Decimal
lado = Decimal(input("Informe o lado do quadrado:"))
a = lado ** 2
print("O dobro da área do quadrado é",(a * 2)) | 12 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
de0d5a324575b0402bd8b86558dc69e727ac424a | 3,396 | py | Python | common/OpTestVIOS.py | rashijhawar/op-test | ccc1ced2a9dc0177a538f170b5e029ac3473c3ae | [
"Apache-2.0"
] | null | null | null | common/OpTestVIOS.py | rashijhawar/op-test | ccc1ced2a9dc0177a538f170b5e029ac3473c3ae | [
"Apache-2.0"
] | null | null | null | common/OpTestVIOS.py | rashijhawar/op-test | ccc1ced2a9dc0177a538f170b5e029ac3473c3ae | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# IBM_PROLOG_BEGIN_TAG
# OpenPOWER Automated Test Project
#
# Contributors Listed Below - COPYRIGHT 2022
# [+] International Business Machines Corp.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may o... | 36.12766 | 102 | 0.664016 | #!/usr/bin/env python3
# IBM_PROLOG_BEGIN_TAG
# OpenPOWER Automated Test Project
#
# Contributors Listed Below - COPYRIGHT 2022
# [+] International Business Machines Corp.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may o... | 0 | 0 | 0 | 2,367 | 0 | 0 | 0 | -20 | 135 |
1792a601d25a24087e8227af24b3f9f553e31f8b | 385 | py | Python | traktor_tester.py | DrLuke/VJPyree-GPN20 | dfe27c7c342de15cb10ff454b99732f13eca05b0 | [
"MIT"
] | 1 | 2022-03-30T21:28:52.000Z | 2022-03-30T21:28:52.000Z | traktor_tester.py | DrLuke/VJPyree-GPN20 | dfe27c7c342de15cb10ff454b99732f13eca05b0 | [
"MIT"
] | null | null | null | traktor_tester.py | DrLuke/VJPyree-GPN20 | dfe27c7c342de15cb10ff454b99732f13eca05b0 | [
"MIT"
] | null | null | null | from pythonosc import udp_client
import time
oscip = "127.0.0.1"
oscport = 31337
client = udp_client.SimpleUDPClient(oscip, oscport)
# Read from midi
#with mido.open_input() as inport:
# while True:
# for msg in inport:
# client.send_message("/traktor/beat", msg.type)
while True:
time.sle... | 19.25 | 59 | 0.680519 | import mido
from pythonosc import udp_client
import time
oscip = "127.0.0.1"
oscport = 31337
client = udp_client.SimpleUDPClient(oscip, oscport)
# Read from midi
#with mido.open_input() as inport:
# while True:
# for msg in inport:
# client.send_message("/traktor/beat", msg.type)
while True:
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -10 | 22 |
433541354c6056e9f1524970ecb5bba556957a14 | 12,259 | py | Python | mediagoblin/auth/views.py | stenwt/mediagoblin-quickstart-openshift | 4a728c4b3b988c59eb9a43ad1ae1ca5edf8bc3c2 | [
"CC0-1.0"
] | 1 | 2016-02-10T18:22:42.000Z | 2016-02-10T18:22:42.000Z | mediagoblin/auth/views.py | stenwt/mediagoblin-quickstart-openshift | 4a728c4b3b988c59eb9a43ad1ae1ca5edf8bc3c2 | [
"CC0-1.0"
] | 1 | 2016-04-19T13:03:17.000Z | 2016-04-19T13:03:17.000Z | mediagoblin/auth/views.py | stenwt/mediagoblin-quickstart-openshift | 4a728c4b3b988c59eb9a43ad1ae1ca5edf8bc3c2 | [
"CC0-1.0"
] | null | null | null | # GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either versio... | 34.532394 | 99 | 0.625907 | # GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either versio... | 0 | 0 | 0 | 0 | 0 | 127 | 0 | 35 | 23 |
81481a59f2f7e592b80b5ac6e993fd1db93b953a | 750 | py | Python | tf_netbuilder/utils.py | thunfischtoast/tf_netbuilder | 728826ac5e4e58a39ea862cecc86ad249a19e278 | [
"Apache-2.0"
] | 10 | 2020-11-06T13:44:44.000Z | 2021-11-20T11:20:23.000Z | tf_netbuilder/utils.py | thunfischtoast/tf_netbuilder | 728826ac5e4e58a39ea862cecc86ad249a19e278 | [
"Apache-2.0"
] | 2 | 2021-01-11T06:41:54.000Z | 2021-03-31T10:41:49.000Z | tf_netbuilder/utils.py | thunfischtoast/tf_netbuilder | 728826ac5e4e58a39ea862cecc86ad249a19e278 | [
"Apache-2.0"
] | 10 | 2020-11-12T23:02:28.000Z | 2022-01-29T12:07:41.000Z |
def round_channels(channels, multiplier=1.0, divisor=8, channel_min=None):
"""Round number of filters based on depth multiplier."""
if not multiplier:
return channels
channels *= multiplier
return make_divisible(channels, divisor, channel_min)
| 27.777778 | 79 | 0.646667 |
def make_divisible(v: int, divisor: int = 8, min_value: int = None):
min_value = min_value or divisor
new_v = max(min_value, int(v + divisor / 2) // divisor * divisor)
if new_v < 0.9 * v: # ensure round down does not go down by more than 10%.
new_v += divisor
return new_v
def round_channels... | 0 | 0 | 0 | 0 | 0 | 409 | 0 | 0 | 69 |
1b56d28081a5ccc2d9b201eb90aaaf5c059d79c3 | 1,064 | py | Python | tests/webpage_get_test.py | wasPrime/mini-spider | a6489834bfa4447acb1f167876519cdc94aa4e3a | [
"MIT"
] | null | null | null | tests/webpage_get_test.py | wasPrime/mini-spider | a6489834bfa4447acb1f167876519cdc94aa4e3a | [
"MIT"
] | null | null | null | tests/webpage_get_test.py | wasPrime/mini-spider | a6489834bfa4447acb1f167876519cdc94aa4e3a | [
"MIT"
] | null | null | null |
NORMAL_URL_LIST = ["http://www.baidu.com"]
ABNORMAL_URL_LIST = ["aaa"]
DEFAULT_TIMEOUT = 1
| 32.242424 | 78 | 0.693609 | import unittest
from module import webpage_get
NORMAL_URL_LIST = ["http://www.baidu.com"]
ABNORMAL_URL_LIST = ["aaa"]
DEFAULT_TIMEOUT = 1
class TestIsUrlAccessible(unittest.TestCase):
def test_normal(self):
for normal_url in NORMAL_URL_LIST:
ret = webpage_get.is_url_accessible(normal_url, DEF... | 0 | 0 | 0 | 877 | 0 | 0 | 0 | 3 | 90 |
351c0194af81465a2af9324be0bbf9d87b4d0893 | 4,467 | py | Python | src/eduid_action/tou/action.py | SUNET/eduid-action | 16c7c737de604ae7376d0b44ef4ff0f274810139 | [
"BSD-3-Clause"
] | null | null | null | src/eduid_action/tou/action.py | SUNET/eduid-action | 16c7c737de604ae7376d0b44ef4ff0f274810139 | [
"BSD-3-Clause"
] | 2 | 2018-09-11T06:06:30.000Z | 2018-12-20T15:02:52.000Z | src/eduid_action/tou/action.py | SUNET/eduid-action | 16c7c737de604ae7376d0b44ef4ff0f274810139 | [
"BSD-3-Clause"
] | 1 | 2018-09-11T10:11:55.000Z | 2018-09-11T10:11:55.000Z | #
# Copyright (c) 2015 NORDUnet A/S
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of ... | 42.141509 | 91 | 0.690172 | #
# Copyright (c) 2015 NORDUnet A/S
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of ... | 0 | 80 | 0 | 2,501 | 0 | 0 | 0 | 113 | 158 |
3560f4e8f134dcb8a39aec649cb2bc15d8b44924 | 4,864 | py | Python | throttle/zones/__init__.py | alimp5/django-throttle-requests | 9072b2570f1ce3c2e12f7590fc2596045ab528d7 | [
"MIT"
] | 1 | 2021-05-16T16:57:13.000Z | 2021-05-16T16:57:13.000Z | throttle/zones/__init__.py | alimp5/django-throttle-requests | 9072b2570f1ce3c2e12f7590fc2596045ab528d7 | [
"MIT"
] | null | null | null | throttle/zones/__init__.py | alimp5/django-throttle-requests | 9072b2570f1ce3c2e12f7590fc2596045ab528d7 | [
"MIT"
] | null | null | null | from django.conf import settings
THROTTLE_ENABLED = getattr(settings, 'THROTTLE_ENABLED', not settings.DEBUG)
_THROTTLE_ZONES = {}
| 40.533333 | 119 | 0.680304 | import time
from django.core.exceptions import ImproperlyConfigured
from django.conf import settings
from throttle.zones.remoteip import RemoteIP
from throttle.exceptions import ThrottleZoneNotDefined, ThrottleImproperlyConfigured, RateLimitExceeded
from throttle.utils import load_class_from_path, serialize_bucket_key... | 0 | 39 | 0 | 3,675 | 0 | 615 | 0 | 197 | 202 |
c584425081b5cf5b4c4ae2163f73660f6a7819ee | 2,602 | py | Python | brml/potvariables.py | herupraptono/pybrml | 42fa70f17c303943447816234a87b3c5815f12bb | [
"CNRI-Python"
] | 136 | 2015-02-15T15:10:56.000Z | 2022-03-09T10:08:17.000Z | brml/potvariables.py | tulcod/PyBRML | 55357ef60e394d7146af037dbfcab97f7b29d44b | [
"CNRI-Python"
] | null | null | null | brml/potvariables.py | tulcod/PyBRML | 55357ef60e394d7146af037dbfcab97f7b29d44b | [
"CNRI-Python"
] | 43 | 2015-02-15T15:11:25.000Z | 2021-07-16T15:08:10.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Mingjun Zhou <mingjun.zhou@gmail.com>
# Licence: BSD 3 clause
import numpy as np
def potvariables(pots):
"""Returns information about all variables in a set of potentials
Return the variables and their number of states.
If there is a dimension mi... | 34.236842 | 78 | 0.586088 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Mingjun Zhou <mingjun.zhou@gmail.com>
# Licence: BSD 3 clause
import numpy as np
def potvariables(pots):
"""Returns information about all variables in a set of potentials
Return the variables and their number of states.
If there is a dimension mi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0c76192008acbda76de5c6c98621f555a262cb8c | 2,601 | py | Python | app/utils/login/login_util.py | Hansybx/guohe3 | 53990b92f5d45bac1c2b903fd8df9cb97283697e | [
"Apache-2.0"
] | 1 | 2019-08-18T13:16:14.000Z | 2019-08-18T13:16:14.000Z | app/utils/login/login_util.py | Hansybx/guohe3 | 53990b92f5d45bac1c2b903fd8df9cb97283697e | [
"Apache-2.0"
] | 1 | 2019-08-19T02:05:32.000Z | 2022-02-11T07:27:37.000Z | app/utils/login/login_util.py | Hansybx/guohe3 | 53990b92f5d45bac1c2b903fd8df9cb97283697e | [
"Apache-2.0"
] | 1 | 2019-08-18T09:08:25.000Z | 2019-08-18T09:08:25.000Z | """
-*- coding: utf-8 -*-
Time : 2019/7/13 15:51
Author : Hansybx
"""
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36'
, 'Origin': 'https://vpn.just.edu.cn',
'Upgrade-Insecure-Requests': '1'
}
if __n... | 28.582418 | 135 | 0.657824 | """
-*- coding: utf-8 -*-
Time : 2019/7/13 15:51
Author : Hansybx
"""
import re
import requests
from bs4 import BeautifulSoup
from flask import jsonify
from app.models.error import PasswordFailed
from app.models.student_info import StudentInfo
from app.utils.common_utils import put_to_mysql
headers = {
'... | 18 | 0 | 0 | 0 | 0 | 1,891 | 0 | 68 | 249 |
db4010607e5a532af1db0ed8547b61b66ea92b78 | 947 | py | Python | sysinv/sysinv/sysinv/sysinv/db/sqlalchemy/migrate_repo/versions/039_rpm_to_idisk.py | albailey/config | 40ebe63d7dfc6a0a03216ebe55ed3ec9cf5410b9 | [
"Apache-2.0"
] | 10 | 2020-02-07T18:57:44.000Z | 2021-09-11T10:29:34.000Z | sysinv/sysinv/sysinv/sysinv/db/sqlalchemy/migrate_repo/versions/039_rpm_to_idisk.py | albailey/config | 40ebe63d7dfc6a0a03216ebe55ed3ec9cf5410b9 | [
"Apache-2.0"
] | 1 | 2021-01-14T12:01:55.000Z | 2021-01-14T12:01:55.000Z | sysinv/sysinv/sysinv/sysinv/db/sqlalchemy/migrate_repo/versions/039_rpm_to_idisk.py | albailey/config | 40ebe63d7dfc6a0a03216ebe55ed3ec9cf5410b9 | [
"Apache-2.0"
] | 10 | 2020-10-13T08:37:46.000Z | 2022-02-09T00:21:25.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (c) 2013-2016 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
ENGINE = 'InnoDB'
CHARSET = 'utf8'
| 23.675 | 74 | 0.697994 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (c) 2013-2016 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
from sqlalchemy import Column, MetaData, String, Table
from sysinv.common import constants
ENGINE = 'InnoDB'
CHARSET = 'utf8'
def _populate_rpm_type(idisk_table):
disks =... | 0 | 0 | 0 | 0 | 0 | 606 | 0 | 47 | 115 |