hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
baae399e16885bab5c4b2cf2013734a4f919c6bf | 363 | py | Python | poll/migrations/0004_auto_20210321_1554.py | Rob-T-98/take-home-poll | 14420971620b440309f7366f5999d61ab7b50598 | [
"MIT"
] | null | null | null | poll/migrations/0004_auto_20210321_1554.py | Rob-T-98/take-home-poll | 14420971620b440309f7366f5999d61ab7b50598 | [
"MIT"
] | null | null | null | poll/migrations/0004_auto_20210321_1554.py | Rob-T-98/take-home-poll | 14420971620b440309f7366f5999d61ab7b50598 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-03-21 15:54
from django.db import migrations
| 19.105263 | 47 | 0.584022 | # Generated by Django 3.1.7 on 2021-03-21 15:54
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('poll', '0003_auto_20210321_1553'),
]
operations = [
migrations.RenameField(
model_name='answers',
old_name='question3',
... | 0 | 257 | 23 |
483c671c235ba40f66ada5cfd2fb839eba9b02e9 | 74 | py | Python | src/camtasia/__init__.py | olaldiko/python-camtasia | 708da6e48976b812b17055c60a130b8be0cbcdf0 | [
"MIT"
] | 7 | 2019-06-14T13:55:22.000Z | 2022-02-09T15:57:01.000Z | src/camtasia/__init__.py | olaldiko/python-camtasia | 708da6e48976b812b17055c60a130b8be0cbcdf0 | [
"MIT"
] | 18 | 2019-06-11T08:23:04.000Z | 2022-02-28T13:59:06.000Z | src/camtasia/__init__.py | olaldiko/python-camtasia | 708da6e48976b812b17055c60a130b8be0cbcdf0 | [
"MIT"
] | 4 | 2019-10-01T19:37:35.000Z | 2022-02-10T03:34:28.000Z | from .project import load_project, new_project, use_project # noqa: F401
| 37 | 73 | 0.797297 | from .project import load_project, new_project, use_project # noqa: F401
| 0 | 0 | 0 |
8653d2c4f477b86bb5a0e7de6a44b76b495a36ca | 3,528 | py | Python | src/Python/GeometricObjects/ColoredLines.py | ajpmaclean/vtk-examples | 1a55fc8c6af67a3c07791807c7d1ec0ab97607a2 | [
"Apache-2.0"
] | 81 | 2020-08-10T01:44:30.000Z | 2022-03-23T06:46:36.000Z | src/Python/GeometricObjects/ColoredLines.py | ajpmaclean/vtk-examples | 1a55fc8c6af67a3c07791807c7d1ec0ab97607a2 | [
"Apache-2.0"
] | 2 | 2020-09-12T17:33:52.000Z | 2021-04-15T17:33:09.000Z | src/Python/GeometricObjects/ColoredLines.py | ajpmaclean/vtk-examples | 1a55fc8c6af67a3c07791807c7d1ec0ab97607a2 | [
"Apache-2.0"
] | 27 | 2020-08-17T07:09:30.000Z | 2022-02-15T03:44:58.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# noinspection PyUnresolvedReferences
import vtkmodules.vtkInteractionStyle
# noinspection PyUnresolvedReferences
import vtkmodules.vtkRenderingOpenGL2
from vtkmodules.vtkCommonColor import vtkNamedColors
from vtkmodules.vtkCommonCore import (
vtkPoints,
vtkUnsigne... | 31.783784 | 104 | 0.719671 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# noinspection PyUnresolvedReferences
import vtkmodules.vtkInteractionStyle
# noinspection PyUnresolvedReferences
import vtkmodules.vtkRenderingOpenGL2
from vtkmodules.vtkCommonColor import vtkNamedColors
from vtkmodules.vtkCommonCore import (
vtkPoints,
vtkUnsigne... | 2,889 | 0 | 23 |
3ecd03a67aac58e122fe61f0feed59498b397041 | 741 | py | Python | arvestust/views/file_list.py | lehvitus/arvestust | 2d508317b744eaf12a643a398ff95723893a046a | [
"BSD-3-Clause"
] | 1 | 2021-09-17T23:45:27.000Z | 2021-09-17T23:45:27.000Z | arvestust/views/file_list.py | lehvitus/arvestust | 2d508317b744eaf12a643a398ff95723893a046a | [
"BSD-3-Clause"
] | 3 | 2020-07-25T05:40:54.000Z | 2020-08-11T04:01:19.000Z | arvestust/views/file_list.py | lehvitus/arvestust | 2d508317b744eaf12a643a398ff95723893a046a | [
"BSD-3-Clause"
] | null | null | null | from django.utils import timezone
from django.views.generic import ListView
from django.contrib.auth.mixins import LoginRequiredMixin
from django.urls import path
from .urls import urlpatterns
from ..models import File
urlpatterns.append(
path('files/', FileListView.as_view(), name='file-list')
)
| 25.551724 | 60 | 0.704453 | from django.utils import timezone
from django.views.generic import ListView
from django.contrib.auth.mixins import LoginRequiredMixin
from django.urls import path
from .urls import urlpatterns
from ..models import File
class FileListView(LoginRequiredMixin, ListView):
model = File
context_object_name = 'files... | 222 | 191 | 23 |
652072ad69b540b291928fe7404d455c42057cf1 | 5,380 | py | Python | chatbot/routes.py | Karan-Malik/Chatbot | 93a7b8180f0c6832211a7444eb4b4e2dc6c31c95 | [
"MIT"
] | 30 | 2020-06-16T08:46:36.000Z | 2022-03-23T20:03:25.000Z | chatbot/routes.py | TharukRenuja/Chatbot | 93a7b8180f0c6832211a7444eb4b4e2dc6c31c95 | [
"MIT"
] | 2 | 2020-09-15T08:43:33.000Z | 2021-12-17T15:50:25.000Z | chatbot/routes.py | TharukRenuja/Chatbot | 93a7b8180f0c6832211a7444eb4b4e2dc6c31c95 | [
"MIT"
] | 15 | 2020-11-15T16:18:28.000Z | 2022-03-23T12:33:52.000Z | from chatbot import app
from flask import render_template,flash, request
from chatbot.forms import chatbotform
from chatbot.__init__ import model,words,classes,intents
import nltk
import pickle
import json
import numpy as np
from keras.models import Sequential,load_model
import random
from datetime import datetime
imp... | 29.398907 | 108 | 0.596654 | from chatbot import app
from flask import render_template,flash, request
from chatbot.forms import chatbotform
from chatbot.__init__ import model,words,classes,intents
import nltk
import pickle
import json
import numpy as np
from keras.models import Sequential,load_model
import random
from datetime import datetime
imp... | 4,497 | 0 | 180 |
36319251989eaeef405b48ab8e7967cfc386441b | 173 | py | Python | appr/models/kv/etcd/__init__.py | sergeyberezansky/appr | 03168addf05c3efd779dad5168fb0a80d0512100 | [
"Apache-2.0"
] | 31 | 2017-07-05T07:25:31.000Z | 2021-01-18T22:21:57.000Z | appr/models/kv/etcd/__init__.py | sergeyberezansky/appr | 03168addf05c3efd779dad5168fb0a80d0512100 | [
"Apache-2.0"
] | 48 | 2017-06-27T15:48:29.000Z | 2021-01-26T21:02:27.000Z | appr/models/kv/etcd/__init__.py | sergeyberezansky/appr | 03168addf05c3efd779dad5168fb0a80d0512100 | [
"Apache-2.0"
] | 17 | 2017-07-05T07:25:38.000Z | 2021-01-20T14:52:29.000Z | import os
import etcd
ETCD_HOST = os.getenv("ETCD_HOST", "localhost")
etcd_client = EtcdClient(host=ETCD_HOST, port=2379)
| 15.727273 | 51 | 0.751445 | import os
import etcd
class EtcdClient(etcd.client.Client):
pass
ETCD_HOST = os.getenv("ETCD_HOST", "localhost")
etcd_client = EtcdClient(host=ETCD_HOST, port=2379)
| 0 | 25 | 23 |
4ba27d800bbac38bf2cb7bead5520cf5c049bafa | 8,293 | py | Python | app.py | sharksmhi/flask_station_app | b1e0e712c5a5bdd5a51b2667f61946d2d8063387 | [
"MIT"
] | null | null | null | app.py | sharksmhi/flask_station_app | b1e0e712c5a5bdd5a51b2667f61946d2d8063387 | [
"MIT"
] | null | null | null | app.py | sharksmhi/flask_station_app | b1e0e712c5a5bdd5a51b2667f61946d2d8063387 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2022 SMHI, Swedish Meteorological and Hydrological Institute.
# License: MIT License (see LICENSE.txt or http://opensource.org/licenses/mit).
"""
Created on 2022-02-24 14:51
@author: johannes
"""
import flask
from flask import (
Flask,
render_template,
flash,
reque... | 29.512456 | 79 | 0.611118 | #!/usr/bin/env python
# Copyright (c) 2022 SMHI, Swedish Meteorological and Hydrological Institute.
# License: MIT License (see LICENSE.txt or http://opensource.org/licenses/mit).
"""
Created on 2022-02-24 14:51
@author: johannes
"""
import flask
from flask import (
Flask,
render_template,
flash,
reque... | 397 | 0 | 44 |
b11e4b4580cf808a4345f7aaca4c42893d85f11c | 6,243 | py | Python | app.py | leigh-jewell/dnaspaces-iot-services-demo | ddd95cc09cf3885605c903fb1eb112093ba48da3 | [
"MIT"
] | null | null | null | app.py | leigh-jewell/dnaspaces-iot-services-demo | ddd95cc09cf3885605c903fb1eb112093ba48da3 | [
"MIT"
] | null | null | null | app.py | leigh-jewell/dnaspaces-iot-services-demo | ddd95cc09cf3885605c903fb1eb112093ba48da3 | [
"MIT"
] | 1 | 2021-12-13T04:11:39.000Z | 2021-12-13T04:11:39.000Z | from flask import Flask, render_template, request
import requests
import json
from datetime import datetime
import csv
from activate import process_activation
app = Flask(__name__)
global_token = ""
@app.route('/activate', methods=['GET', 'POST'])
@app.route('/', methods=['GET', 'POST'])
if __name__ == '__main... | 47.295455 | 119 | 0.527791 | from flask import Flask, render_template, request
import requests
import json
from datetime import datetime
import csv
from activate import process_activation
app = Flask(__name__)
global_token = ""
@app.route('/activate', methods=['GET', 'POST'])
def activate_app():
global global_token
api_token = ""
if... | 5,814 | 0 | 90 |
5f60ed9e46ebba4eb6da68dd7f5c6a67d8f02b34 | 6,431 | py | Python | spydrnet_tmr/utils/load_primitive_info.py | byuccl/spydrnet-tmr | ca9f026db70be96d57aa3604447abecb68670c56 | [
"BSD-3-Clause"
] | null | null | null | spydrnet_tmr/utils/load_primitive_info.py | byuccl/spydrnet-tmr | ca9f026db70be96d57aa3604447abecb68670c56 | [
"BSD-3-Clause"
] | 6 | 2021-08-13T18:39:59.000Z | 2022-03-04T22:20:44.000Z | spydrnet_tmr/utils/load_primitive_info.py | byuccl/spydrnet-tmr | ca9f026db70be96d57aa3604447abecb68670c56 | [
"BSD-3-Clause"
] | null | null | null | import os
| 39.697531 | 87 | 0.5304 | import os
def load_primitive_info(netlist, vendor):
from spydrnet_tmr import base_dir
primitive_info = dict()
import json
primitive_info_db = json.load(
open(
os.path.join(
base_dir,
"support_files",
"primitive_databases",
... | 6,397 | 0 | 23 |
f1af4232977e54da754fef857ae2acf42d6a1cde | 13,928 | py | Python | geoevents/operations/urls.py | mcenirm/geoevents | f78cc09b8bcc8c6e4eee0d1de14e5becad7d49e6 | [
"MIT"
] | null | null | null | geoevents/operations/urls.py | mcenirm/geoevents | f78cc09b8bcc8c6e4eee0d1de14e5becad7d49e6 | [
"MIT"
] | null | null | null | geoevents/operations/urls.py | mcenirm/geoevents | f78cc09b8bcc8c6e4eee0d1de14e5becad7d49e6 | [
"MIT"
] | null | null | null | # This technical data was produced for the U. S. Government under Contract No. W15P7T-13-C-F600, and
# is subject to the Rights in Technical Data-Noncommercial Items clause at DFARS 252.227-7013 (FEB 2012)
from django.conf.urls import patterns, url
from django.core.urlresolvers import reverse_lazy
from django.contrib.... | 72.921466 | 136 | 0.461086 | # This technical data was produced for the U. S. Government under Contract No. W15P7T-13-C-F600, and
# is subject to the Rights in Technical Data-Noncommercial Items clause at DFARS 252.227-7013 (FEB 2012)
from django.conf.urls import patterns, url
from django.core.urlresolvers import reverse_lazy
from django.contrib.... | 0 | 0 | 0 |
5d46e541daebb08b6177b57997de8690e59f69c8 | 1,307 | py | Python | step2.py | theIsaacLim/hakdPizza | 0471dc6ee9fc049bd10f0a8aa9d707f2c0388fc5 | [
"MIT"
] | null | null | null | step2.py | theIsaacLim/hakdPizza | 0471dc6ee9fc049bd10f0a8aa9d707f2c0388fc5 | [
"MIT"
] | null | null | null | step2.py | theIsaacLim/hakdPizza | 0471dc6ee9fc049bd10f0a8aa9d707f2c0388fc5 | [
"MIT"
] | null | null | null | # ===STEP 2=== #
from selenium import webdriver
from time import sleep # Sleep will pause the program
import os # for getting the local path
dirpath = os.getcwd() # gets local path
driver = webdriver.Chrome(dirpath + "/chromedriver")
driver.get("http://www.dominos.com.cn/menu/menu.html?menuIndex=0&RNDSEED=c429056... | 40.84375 | 128 | 0.751339 | # ===STEP 2=== #
from selenium import webdriver
from time import sleep # Sleep will pause the program
import os # for getting the local path
dirpath = os.getcwd() # gets local path
driver = webdriver.Chrome(dirpath + "/chromedriver")
driver.get("http://www.dominos.com.cn/menu/menu.html?menuIndex=0&RNDSEED=c429056... | 0 | 0 | 0 |
cdf32b378197c2978d914ebd74942abb2cc9a4ce | 965 | py | Python | project/staticpages/migrations/0001_initial.py | NIEHS/orio-web | 3ad29fa80cf8d19bbe0f60e2aa85a2edf2d504bc | [
"MIT"
] | null | null | null | project/staticpages/migrations/0001_initial.py | NIEHS/orio-web | 3ad29fa80cf8d19bbe0f60e2aa85a2edf2d504bc | [
"MIT"
] | 5 | 2017-02-21T19:52:08.000Z | 2021-08-24T15:12:06.000Z | project/staticpages/migrations/0001_initial.py | shapiromatron/orio-web | 3ad29fa80cf8d19bbe0f60e2aa85a2edf2d504bc | [
"MIT"
] | 1 | 2021-04-21T10:39:37.000Z | 2021-04-21T10:39:37.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-07 15:40
from __future__ import unicode_literals
from django.db import migrations, models
| 30.15625 | 114 | 0.572021 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-07 15:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Page',... | 0 | 786 | 23 |
65d503903b8bec3ab20bd1915618dbd467710207 | 211 | py | Python | python-package/insightface/thirdparty/face3d/mesh_numpy/__init__.py | qaz734913414/insightface | 4101fe608ca1d38604a23d53f32314ce8a28fe79 | [
"MIT"
] | 12,377 | 2017-12-04T02:46:57.000Z | 2022-03-31T16:48:31.000Z | python-package/insightface/thirdparty/face3d/mesh_numpy/__init__.py | qaz734913414/insightface | 4101fe608ca1d38604a23d53f32314ce8a28fe79 | [
"MIT"
] | 1,851 | 2017-12-05T05:41:23.000Z | 2022-03-30T13:06:22.000Z | python-package/insightface/thirdparty/face3d/mesh_numpy/__init__.py | qaz734913414/insightface | 4101fe608ca1d38604a23d53f32314ce8a28fe79 | [
"MIT"
] | 4,198 | 2017-12-05T02:57:19.000Z | 2022-03-30T10:29:37.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from . import io
from . import vis
from . import transform
from . import light
from . import render
| 19.181818 | 38 | 0.815166 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from . import io
from . import vis
from . import transform
from . import light
from . import render
| 0 | 0 | 0 |
c8a5ed968723e875f0ecf76315b11f6f69a23263 | 1,174 | py | Python | saddle.py | JustGk/fds | 3ea5017df8f51d7adf4af1ad07dcf5e4ea55fef9 | [
"Apache-2.0"
] | null | null | null | saddle.py | JustGk/fds | 3ea5017df8f51d7adf4af1ad07dcf5e4ea55fef9 | [
"Apache-2.0"
] | null | null | null | saddle.py | JustGk/fds | 3ea5017df8f51d7adf4af1ad07dcf5e4ea55fef9 | [
"Apache-2.0"
] | null | null | null |
# Driver method
if __name__ == '__main__':
mat = [[1, 2, 3],
[4, 5, 6],
[7, 18, 14]];
n = 3;
if (findSaddlePoint(mat, n) ==
False):
print("No Saddle Po"); | 23.959184 | 44 | 0.437819 | def findSaddlePoint(mat, n):
# Process all rows one
# by one
for i in range(n):
# Find the minimum element
# of row i.
# Also find column index of
# the minimum element
min_row = mat[i][0];
col_ind = 0;
for j in range(1, n):
if... | 927 | 0 | 23 |
af5f2f732ebea62c2d2cb5e8a7664705f1035022 | 2,001 | py | Python | core/consumer/consumer.py | ayushkalani/bitcoin-streamer | ed66e25fac661c7ed239b8c32ef7ae916f514d3a | [
"MIT"
] | null | null | null | core/consumer/consumer.py | ayushkalani/bitcoin-streamer | ed66e25fac661c7ed239b8c32ef7ae916f514d3a | [
"MIT"
] | null | null | null | core/consumer/consumer.py | ayushkalani/bitcoin-streamer | ed66e25fac661c7ed239b8c32ef7ae916f514d3a | [
"MIT"
] | null | null | null | import sys
import os
import time, traceback
import json
PACKAGE_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.insert(0,PACKAGE_ROOT)
from commons.logger import Logger
from config.initializers import KAFKA_BROKER, KAFKA_TOPIC,KAFKA_CONSUMER_GROUP_ID
from kafka import KafkaC... | 38.480769 | 115 | 0.61969 | import sys
import os
import time, traceback
import json
PACKAGE_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.insert(0,PACKAGE_ROOT)
from commons.logger import Logger
from config.initializers import KAFKA_BROKER, KAFKA_TOPIC,KAFKA_CONSUMER_GROUP_ID
from kafka import KafkaC... | 29 | 853 | 23 |
78d8cf0b5c8877caa217dd7c395e5220313a7566 | 5,178 | py | Python | launch_testing/launch_testing/legacy/output.py | pal-robotics-forks/launch | 9a0a01924cd88f832c5a50903553ddcec6ef648d | [
"Apache-2.0"
] | 67 | 2015-06-12T21:17:24.000Z | 2022-03-30T07:19:52.000Z | launch_testing/launch_testing/legacy/output.py | pal-robotics-forks/launch | 9a0a01924cd88f832c5a50903553ddcec6ef648d | [
"Apache-2.0"
] | 516 | 2015-03-20T02:22:59.000Z | 2022-03-30T12:33:33.000Z | launch_testing/launch_testing/legacy/output.py | pal-robotics-forks/launch | 9a0a01924cd88f832c5a50903553ddcec6ef648d | [
"Apache-2.0"
] | 101 | 2016-01-12T16:56:54.000Z | 2022-03-09T12:35:37.000Z | # Copyright 2018 Open Source Robotics Foundation, Inc.
#
# 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... | 37.79562 | 94 | 0.715527 | # Copyright 2018 Open Source Robotics Foundation, Inc.
#
# 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... | 1,753 | 0 | 202 |
374532031f4115e45e4ec9177352aa150bf5a649 | 615 | py | Python | src/vbr/api/status.py | a2cps/python-vbr | 9d5d4480386d0530450d59157e0da6937320f928 | [
"BSD-3-Clause"
] | 1 | 2021-05-26T19:08:29.000Z | 2021-05-26T19:08:29.000Z | src/vbr/api/status.py | a2cps/python-vbr | 9d5d4480386d0530450d59157e0da6937320f928 | [
"BSD-3-Clause"
] | 7 | 2021-05-04T13:12:39.000Z | 2022-03-09T21:04:33.000Z | src/vbr/api/status.py | a2cps/python-vbr | 9d5d4480386d0530450d59157e0da6937320f928 | [
"BSD-3-Clause"
] | 2 | 2021-04-20T14:46:52.000Z | 2021-06-07T20:28:28.000Z | from vbr.tableclasses import Status
__all__ = ["StatusApi"]
| 32.368421 | 82 | 0.621138 | from vbr.tableclasses import Status
__all__ = ["StatusApi"]
class StatusApi(object):
def get_status(self, pkid: str) -> Status:
"""Retrieve a Status by primary identifier."""
return self._get_row_from_table_with_id("status", pkid)
def get_status_by_name(self, name: str) -> Status:
""... | 0 | 530 | 23 |
2ec0b542963219116fb259b3f3a069857678c2a5 | 1,573 | py | Python | tflmlib/ProgressBar.py | bjascob/SmartLMVocabs | 9989cccc67387d38fc829f34022c66a7d9bba415 | [
"Apache-2.0"
] | 10 | 2019-04-10T09:44:10.000Z | 2021-05-03T21:13:44.000Z | tflmlib/ProgressBar.py | bjascob/SmartLMVocabs | 9989cccc67387d38fc829f34022c66a7d9bba415 | [
"Apache-2.0"
] | null | null | null | tflmlib/ProgressBar.py | bjascob/SmartLMVocabs | 9989cccc67387d38fc829f34022c66a7d9bba415 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Brad Jascob
#
# 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, s... | 32.770833 | 74 | 0.621742 | # Copyright 2018 Brad Jascob
#
# 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, s... | 81 | 0 | 26 |
e307a3308b0e34af808256803ed6a23eacd61291 | 10,455 | py | Python | Algorithm.Python/stubs/QuantConnect/Data/__Fundamental_43.py | gaoxiaojun/Lean | 9dca43bccb720d0df91e4bfc1d363b71e3a36cb5 | [
"Apache-2.0"
] | 2 | 2020-12-08T11:27:20.000Z | 2021-04-06T13:21:15.000Z | Algorithm.Python/stubs/QuantConnect/Data/__Fundamental_43.py | gaoxiaojun/Lean | 9dca43bccb720d0df91e4bfc1d363b71e3a36cb5 | [
"Apache-2.0"
] | null | null | null | Algorithm.Python/stubs/QuantConnect/Data/__Fundamental_43.py | gaoxiaojun/Lean | 9dca43bccb720d0df91e4bfc1d363b71e3a36cb5 | [
"Apache-2.0"
] | 1 | 2020-12-08T11:27:21.000Z | 2020-12-08T11:27:21.000Z | from .__Fundamental_44 import *
import typing
import System.IO
import System.Collections.Generic
import System
import QuantConnect.Data.Fundamental.MultiPeriodField
import QuantConnect.Data.Fundamental
import QuantConnect.Data
import QuantConnect
import datetime
class NetLongTermDebtIssuanceCashFlowStatement(QuantCon... | 29.367978 | 167 | 0.732281 | from .__Fundamental_44 import *
import typing
import System.IO
import System.Collections.Generic
import System
import QuantConnect.Data.Fundamental.MultiPeriodField
import QuantConnect.Data.Fundamental
import QuantConnect.Data
import QuantConnect
import datetime
class NetLongTermDebtIssuanceCashFlowStatement(QuantCon... | 2,766 | 0 | 960 |
e300b0e6276c0569cc88bd35916647f237e326a9 | 20,675 | py | Python | du/denv/App.py | spiricn/DevUtils | 58a035a08a7c58035c25f992c1b8aa33cc997cd2 | [
"MIT"
] | 1 | 2021-12-21T13:18:08.000Z | 2021-12-21T13:18:08.000Z | du/denv/App.py | spiricn/DevUtils | 58a035a08a7c58035c25f992c1b8aa33cc997cd2 | [
"MIT"
] | null | null | null | du/denv/App.py | spiricn/DevUtils | 58a035a08a7c58035c25f992c1b8aa33cc997cd2 | [
"MIT"
] | null | null | null | import argparse
import logging
import sys
import os
import traceback
import time
import subprocess
import getpass
import datetime
from inspect import getfullargspec
from argparse import RawTextHelpFormatter
from du.denv.Denv import Denv
from du.denv.Denv import ErrCodes
# Host platform string for Windows
PLATFORM_OS_... | 33.672638 | 142 | 0.603869 | import argparse
import logging
import sys
import os
import traceback
import time
import subprocess
import getpass
import datetime
from inspect import getfullargspec
from argparse import RawTextHelpFormatter
from du.denv.Denv import Denv
from du.denv.Denv import ErrCodes
# Host platform string for Windows
PLATFORM_OS_... | 442 | 17,741 | 46 |
62f0422e7fc485af770292e413ed7fd5dcb4d569 | 622 | py | Python | stunning/constants.py | Ahuge/stunning-barnacle | b672521ba3f901f87dd1bdecb1c886bd575ddb5e | [
"MIT"
] | 1 | 2018-09-11T11:15:10.000Z | 2018-09-11T11:15:10.000Z | stunning/constants.py | Ahuge/stunning-barnacle | b672521ba3f901f87dd1bdecb1c886bd575ddb5e | [
"MIT"
] | null | null | null | stunning/constants.py | Ahuge/stunning-barnacle | b672521ba3f901f87dd1bdecb1c886bd575ddb5e | [
"MIT"
] | null | null | null | # For tokens
ONE_OR_MORE = "+"
OR = "|"
# Reserved is a generic keyword type.
# Meant to be a builtin for the TCL syntax.
RESERVED = "RESERVED"
# Ignore is a flag for characters that don't have functional impact on the TCL source.
# We are using it quite liberally to ignore all whitespace and newline characters.
IGNO... | 27.043478 | 86 | 0.728296 | # For tokens
ONE_OR_MORE = "+"
OR = "|"
# Reserved is a generic keyword type.
# Meant to be a builtin for the TCL syntax.
RESERVED = "RESERVED"
# Ignore is a flag for characters that don't have functional impact on the TCL source.
# We are using it quite liberally to ignore all whitespace and newline characters.
IGNO... | 0 | 0 | 0 |
9d2aa63e47154382cafdd20eab87bb534ccd872b | 43 | py | Python | LiBis/test/test.py | biobai/LiBis | e334cd14de2d365943c2f4edbc36505901f01df1 | [
"MIT"
] | null | null | null | LiBis/test/test.py | biobai/LiBis | e334cd14de2d365943c2f4edbc36505901f01df1 | [
"MIT"
] | null | null | null | LiBis/test/test.py | biobai/LiBis | e334cd14de2d365943c2f4edbc36505901f01df1 | [
"MIT"
] | null | null | null | import os
print(os.path.abspath(__file__))
| 14.333333 | 32 | 0.790698 | import os
print(os.path.abspath(__file__))
| 0 | 0 | 0 |
b672251263d4b6c2f9b360b0bc4c1c3a484696e6 | 2,300 | py | Python | craid/eddb/base/Aware.py | HausReport/ClubRaiders | 88bd64d2512302ca2b391b48979b6e88b092eb92 | [
"BSD-3-Clause"
] | null | null | null | craid/eddb/base/Aware.py | HausReport/ClubRaiders | 88bd64d2512302ca2b391b48979b6e88b092eb92 | [
"BSD-3-Clause"
] | 2 | 2020-05-28T13:30:08.000Z | 2020-06-02T14:12:04.000Z | craid/eddb/base/Aware.py | HausReport/ClubRaiders | 88bd64d2512302ca2b391b48979b6e88b092eb92 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020 Club Raiders Project
# https://github.com/HausReport/ClubRaiders
#
# SPDX-License-Identifier: BSD-3-Clause
#
# SPDX-License-Identifier: BSD-3-Clause
from typing import Dict
from craid.eddb.base.NamedItem import NamedItem
| 34.848485 | 80 | 0.675217 | # Copyright (c) 2020 Club Raiders Project
# https://github.com/HausReport/ClubRaiders
#
# SPDX-License-Identifier: BSD-3-Clause
#
# SPDX-License-Identifier: BSD-3-Clause
from typing import Dict
from craid.eddb.base.NamedItem import NamedItem
class Aware(NamedItem):
systemsDict: Dict[int, object] = None ... | 1,352 | 672 | 23 |
18a0cb575f06214c39e6f97e6762b267a6604bf3 | 66 | py | Python | genre/__init__.py | radusuciu/genre.py | 50615a86a4fbd6c886853fd5096bb395b675d0ea | [
"Apache-2.0"
] | null | null | null | genre/__init__.py | radusuciu/genre.py | 50615a86a4fbd6c886853fd5096bb395b675d0ea | [
"Apache-2.0"
] | 1 | 2021-06-01T21:47:11.000Z | 2021-06-01T21:47:11.000Z | genre/__init__.py | radusuciu/genre.py | 50615a86a4fbd6c886853fd5096bb395b675d0ea | [
"Apache-2.0"
] | null | null | null | from .version import __version__
from .genre import main, process
| 22 | 32 | 0.818182 | from .version import __version__
from .genre import main, process
| 0 | 0 | 0 |
5d84ce0016ef2ab7533abc3790d6943d1685bb5e | 2,190 | py | Python | rest_framework_social_oauth2/backends.py | amolc2iq/rest_oauth_social | 155087d04866f08dd3fae3ec27ec6710bd9895f8 | [
"MIT"
] | null | null | null | rest_framework_social_oauth2/backends.py | amolc2iq/rest_oauth_social | 155087d04866f08dd3fae3ec27ec6710bd9895f8 | [
"MIT"
] | null | null | null | rest_framework_social_oauth2/backends.py | amolc2iq/rest_oauth_social | 155087d04866f08dd3fae3ec27ec6710bd9895f8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
try:
from django.urls import reverse
except ImportError: # Will be removed in Django 2.0
from django.core.urlresolvers import reverse
from social_core.backends.oauth import BaseOAuth2
from .settings import DRFSO2_PROPRIETARY_BACKEND_NAME, DRFSO2_URL_NAMESPACE
from oauth2_provider.mod... | 39.107143 | 147 | 0.634247 | # -*- coding: utf-8 -*-
try:
from django.urls import reverse
except ImportError: # Will be removed in Django 2.0
from django.core.urlresolvers import reverse
from social_core.backends.oauth import BaseOAuth2
from .settings import DRFSO2_PROPRIETARY_BACKEND_NAME, DRFSO2_URL_NAMESPACE
from oauth2_provider.mod... | 759 | 0 | 54 |
360b8523764af851cd61d83a77e2c5dc4be8e3d9 | 5,363 | py | Python | tests/unit/test_CXDataFrameData.py | docinfosci/canvasxpress-python | 532a981b04d0f50bbde1852c695117a6220f4589 | [
"MIT"
] | 4 | 2021-03-18T17:23:40.000Z | 2022-02-01T19:07:01.000Z | tests/unit/test_CXDataFrameData.py | docinfosci/canvasxpress-python | 532a981b04d0f50bbde1852c695117a6220f4589 | [
"MIT"
] | 8 | 2021-04-30T20:46:57.000Z | 2022-03-10T07:25:31.000Z | tests/unit/test_CXDataFrameData.py | docinfosci/canvasxpress-python | 532a981b04d0f50bbde1852c695117a6220f4589 | [
"MIT"
] | 1 | 2022-02-03T00:35:14.000Z | 2022-02-03T00:35:14.000Z | import json
from copy import copy, deepcopy
from io import StringIO
import pandas
from pandas import DataFrame # Required for eval
FORCE_INCLUDE_DATAFRAME_IN_PYCHARM = DataFrame() # Prevents clean=up removal
import pytest
from deepdiff import DeepDiff
from hypothesis import given
from hypothesis.extra.pandas impor... | 29.146739 | 79 | 0.716763 | import json
from copy import copy, deepcopy
from io import StringIO
import pandas
from pandas import DataFrame # Required for eval
FORCE_INCLUDE_DATAFRAME_IN_PYCHARM = DataFrame() # Prevents clean=up removal
import pytest
from deepdiff import DeepDiff
from hypothesis import given
from hypothesis.extra.pandas impor... | 4,133 | 0 | 273 |
ba8a7b5e41582cc51a9237727b454acf501ca6df | 490 | py | Python | fin_model_course/gradetools/config.py | whoopnip/fin-model-course | e6c5ae313bba601c4aca0f334818b61cc0393118 | [
"MIT"
] | 5 | 2020-08-29T15:28:39.000Z | 2021-12-01T16:53:25.000Z | fin_model_course/gradetools/config.py | whoopnip/fin-model-course | e6c5ae313bba601c4aca0f334818b61cc0393118 | [
"MIT"
] | 16 | 2020-02-26T16:03:47.000Z | 2021-06-15T15:17:37.000Z | fin_model_course/gradetools/config.py | whoopnip/fin-model-course | e6c5ae313bba601c4aca0f334818b61cc0393118 | [
"MIT"
] | 3 | 2021-01-22T19:38:36.000Z | 2021-09-28T08:14:00.000Z | import os
from gradetools.py.execute2.insert import InsertConfig
PYTHON_EXTENSIONS = ('ipynb', 'py')
EXCEL_EXTENSIONS = ('xlsx', 'xls', 'xlsm')
PYTHON_FOLDER = os.path.sep.join(['Grading', 'Python'])
PYTHON_PLAGIARISM_FOLDER = os.path.sep.join([PYTHON_FOLDER, 'Plagiarism'])
EXCEL_FOLDER = os.path.sep.join(['Grading',... | 25.789474 | 74 | 0.644898 | import os
from gradetools.py.execute2.insert import InsertConfig
PYTHON_EXTENSIONS = ('ipynb', 'py')
EXCEL_EXTENSIONS = ('xlsx', 'xls', 'xlsm')
PYTHON_FOLDER = os.path.sep.join(['Grading', 'Python'])
PYTHON_PLAGIARISM_FOLDER = os.path.sep.join([PYTHON_FOLDER, 'Plagiarism'])
EXCEL_FOLDER = os.path.sep.join(['Grading',... | 0 | 0 | 0 |
6a58d9ece833fd04526901d65cd8db9a3c1ebcf5 | 363 | py | Python | 008 Selection Sort/Selection_Sort.py | Iftakharpy/AlgoExpert-Questions | f4aef449bfe0ee651d84a92487c3b3bedb3aa739 | [
"Apache-2.0"
] | 3 | 2021-11-19T07:32:27.000Z | 2022-03-22T13:46:27.000Z | 008 Selection Sort/Selection_Sort.py | Iftakharpy/AlgoExpert-Questions | f4aef449bfe0ee651d84a92487c3b3bedb3aa739 | [
"Apache-2.0"
] | null | null | null | 008 Selection Sort/Selection_Sort.py | Iftakharpy/AlgoExpert-Questions | f4aef449bfe0ee651d84a92487c3b3bedb3aa739 | [
"Apache-2.0"
] | 5 | 2022-01-02T11:51:12.000Z | 2022-03-22T13:53:32.000Z | # time O(n^2)
# space O(1)
| 33 | 78 | 0.600551 | # time O(n^2)
# space O(1)
def selectionSort(array):
for swap_with in range(len(array)-1):
smallest = swap_with
for finder in range(swap_with, len(array)):
if array[finder] < array[smallest]:
smallest = finder
array[swap_with], array[smallest] = array[smal... | 311 | 0 | 23 |
609f70b6266c3554f665f6c1366c16fe9b9c160b | 881 | py | Python | aula19.py | GantzLorran/Python | ce6073754318443345973471589cceb4a24ed832 | [
"Apache-2.0"
] | 1 | 2020-03-26T13:23:17.000Z | 2020-03-26T13:23:17.000Z | aula19.py | GantzLorran/Python | ce6073754318443345973471589cceb4a24ed832 | [
"Apache-2.0"
] | null | null | null | aula19.py | GantzLorran/Python | ce6073754318443345973471589cceb4a24ed832 | [
"Apache-2.0"
] | null | null | null | '''pessoas = {'nome': 'Lorran', 'sexo': 'M', 'idade': 22}
#pessoas['peso'] = '100.0' #Esse comando adiciona uma linha
for k, v in pessoas.items():
print(f'{k} = {v}')'''
#print(pessoas.items())
#print(pessoas.values())
#print(pessoas.keys())
#print(f'O {pessoas["nome"]} tem {pessoas["idade"]} anos')
'... | 31.464286 | 115 | 0.591373 | '''pessoas = {'nome': 'Lorran', 'sexo': 'M', 'idade': 22}
#pessoas['peso'] = '100.0' #Esse comando adiciona uma linha
for k, v in pessoas.items():
print(f'{k} = {v}')'''
#print(pessoas.items())
#print(pessoas.values())
#print(pessoas.keys())
#print(f'O {pessoas["nome"]} tem {pessoas["idade"]} anos')
'... | 0 | 0 | 0 |
1c53295c4fb30a7a4a7939833a9f4c27c638986b | 228 | py | Python | Hash_SHA3.py | Ottothebull/tcc_pos_pucpr2019 | 628bd376a4adf213261464eb3c10b29732681a2e | [
"CC0-1.0"
] | 1 | 2021-07-10T03:14:27.000Z | 2021-07-10T03:14:27.000Z | Hash_SHA3.py | Ottothebull/tcc_pos_pucpr2019 | 628bd376a4adf213261464eb3c10b29732681a2e | [
"CC0-1.0"
] | null | null | null | Hash_SHA3.py | Ottothebull/tcc_pos_pucpr2019 | 628bd376a4adf213261464eb3c10b29732681a2e | [
"CC0-1.0"
] | 1 | 2021-03-24T01:10:46.000Z | 2021-03-24T01:10:46.000Z |
import hashlib
str = "String_senha" #Senha em texto aberto
hash_sha3_512 = hashlib.new("sha3_512", str.encode()) #Algoritimo de Hash selecionado e executado
print(hash_sha3_512)
print(hash_sha3_512.hexdigest())#Hash gerada
| 20.727273 | 97 | 0.780702 |
import hashlib
str = "String_senha" #Senha em texto aberto
hash_sha3_512 = hashlib.new("sha3_512", str.encode()) #Algoritimo de Hash selecionado e executado
print(hash_sha3_512)
print(hash_sha3_512.hexdigest())#Hash gerada
| 0 | 0 | 0 |
5bb0e1f796bbdc4ab51efba22f9764886d516521 | 2,204 | py | Python | pyglet/libs/x11/xinerama.py | bitcraft/pyglet | 144257c365ca85528c6a4c5bed8141e683d7a9b6 | [
"BSD-3-Clause"
] | 15 | 2015-01-21T12:29:01.000Z | 2018-12-09T09:17:33.000Z | pyglet/libs/x11/xinerama.py | bitcraft/pyglet | 144257c365ca85528c6a4c5bed8141e683d7a9b6 | [
"BSD-3-Clause"
] | null | null | null | pyglet/libs/x11/xinerama.py | bitcraft/pyglet | 144257c365ca85528c6a4c5bed8141e683d7a9b6 | [
"BSD-3-Clause"
] | 9 | 2015-12-12T09:12:46.000Z | 2021-12-26T13:29:14.000Z | """Wrapper for Xinerama
Generated with:
tools/genwrappers.py xinerama
Do not modify this file.
"""
import ctypes
from ctypes import *
import pyglet.lib
_lib = pyglet.lib.load_library('Xinerama')
_int_types = (c_int16, c_int32)
if hasattr(ctypes, 'c_int64'):
# Some builds of ctypes apparently do not have c_int... | 27.209877 | 78 | 0.72686 | """Wrapper for Xinerama
Generated with:
tools/genwrappers.py xinerama
Do not modify this file.
"""
import ctypes
from ctypes import *
import pyglet.lib
_lib = pyglet.lib.load_library('Xinerama')
_int_types = (c_int16, c_int32)
if hasattr(ctypes, 'c_int64'):
# Some builds of ctypes apparently do not have c_int... | 0 | 345 | 46 |
ed2796ca9ae2551a10aa26fb1c81d8d1243c594c | 626 | py | Python | localsearch/metropolis.py | jguhh/Prostheoinf | 335b2e8a832e082f36043117090077db4195eb39 | [
"MIT"
] | null | null | null | localsearch/metropolis.py | jguhh/Prostheoinf | 335b2e8a832e082f36043117090077db4195eb39 | [
"MIT"
] | null | null | null | localsearch/metropolis.py | jguhh/Prostheoinf | 335b2e8a832e082f36043117090077db4195eb39 | [
"MIT"
] | null | null | null | #%%
from localsearch.local_search import NeighborhoodRelation
from localsearch.simulated_annealing import SimulatedAnnealing
from typing import Callable
import networkx as nx
| 28.454545 | 74 | 0.64377 | #%%
from localsearch.local_search import NeighborhoodRelation
from localsearch.simulated_annealing import SimulatedAnnealing
from typing import Callable
import networkx as nx
class Metropolis(SimulatedAnnealing):
def __init__(self, relation: NeighborhoodRelation, cost_fn: Callable):
super().__init__(relati... | 355 | 16 | 80 |
b61859d21e9a775417fba5a41035235b2600a012 | 301 | py | Python | hdcp_app/views.py | joakimzhang/qa_study | ff8930e674d45c49bea4e130d14d73d17b090e48 | [
"Apache-2.0"
] | null | null | null | hdcp_app/views.py | joakimzhang/qa_study | ff8930e674d45c49bea4e130d14d73d17b090e48 | [
"Apache-2.0"
] | null | null | null | hdcp_app/views.py | joakimzhang/qa_study | ff8930e674d45c49bea4e130d14d73d17b090e48 | [
"Apache-2.0"
] | null | null | null | from django.shortcuts import render
from hdcp_app.models import test_table
# Create your views here.
| 27.363636 | 70 | 0.747508 | from django.shortcuts import render
from hdcp_app.models import test_table
# Create your views here.
def test(request):
test_obj = test_table.objects.all()
return render(request,'hdcp_app/index.html',{'test_obj':test_obj})
#return HttpResponse("hello world")
def login(request):
pass
| 155 | 0 | 45 |
5780c7f487cb347c8be134f0e57ce423bccf201d | 10,634 | py | Python | plot_scripts/metrics/plot_nsn_metric_WFD_summary.py | LSSTDESC/sn_pipe | d42c7490ba5ff8c52f62e70a20c922172a6baff1 | [
"BSD-3-Clause"
] | null | null | null | plot_scripts/metrics/plot_nsn_metric_WFD_summary.py | LSSTDESC/sn_pipe | d42c7490ba5ff8c52f62e70a20c922172a6baff1 | [
"BSD-3-Clause"
] | 3 | 2020-07-16T09:43:49.000Z | 2020-10-06T11:46:05.000Z | plot_scripts/metrics/plot_nsn_metric_WFD_summary.py | LSSTDESC/sn_pipe | d42c7490ba5ff8c52f62e70a20c922172a6baff1 | [
"BSD-3-Clause"
] | 2 | 2019-10-22T13:39:33.000Z | 2020-07-23T20:42:07.000Z | import numpy as np
import sn_plotter_metrics.nsnPlot as nsn_plot
import matplotlib.pylab as plt
import argparse
from optparse import OptionParser
import glob
# from sn_tools.sn_obs import dataInside
import healpy as hp
import numpy.lib.recfunctions as rf
import pandas as pd
import os
import multiprocessing
def proces... | 27.127551 | 89 | 0.614256 | import numpy as np
import sn_plotter_metrics.nsnPlot as nsn_plot
import matplotlib.pylab as plt
import argparse
from optparse import OptionParser
import glob
# from sn_tools.sn_obs import dataInside
import healpy as hp
import numpy.lib.recfunctions as rf
import pandas as pd
import os
import multiprocessing
def proces... | 551 | 0 | 23 |
0ce0a029a9e1728b59978c0ab41c22e40a7ba118 | 1,265 | py | Python | raw/day06/part1.py | aesdeef/advent-of-code-2021 | 4561bcf12ac03d360f5b28c48ef80134f97613b9 | [
"MIT"
] | 2 | 2021-12-03T06:18:27.000Z | 2021-12-06T11:28:33.000Z | raw/day06/part1.py | aesdeef/advent-of-code-2021 | 4561bcf12ac03d360f5b28c48ef80134f97613b9 | [
"MIT"
] | null | null | null | raw/day06/part1.py | aesdeef/advent-of-code-2021 | 4561bcf12ac03d360f5b28c48ef80134f97613b9 | [
"MIT"
] | null | null | null | import re
from collections import Counter
INPUT_FILE = "../../input/06.txt"
# pre-written code starts here
with open(INPUT_FILE) as f:
input_ = f.read()
blocks = [block.split("\n") for block in input_.split("\n\n")]
lines = [line.strip() for line in input_.split("\n")]
wordlines = [line.split() for line in lin... | 24.326923 | 88 | 0.601581 | import re
from collections import Counter
INPUT_FILE = "../../input/06.txt"
# pre-written code starts here
def intify(line: list[str]):
return [int(x) if re.match(r"^[+-]?\d+$", x) else x for x in line]
with open(INPUT_FILE) as f:
input_ = f.read()
blocks = [block.split("\n") for block in input_.split("\n\... | 78 | 0 | 22 |
5dc800295ce6f984ccde4e096af09e845fce5058 | 2,466 | py | Python | app/data.py | Trupal00p/polymer-template | d16ea08557792c3681dce5cd69bfe321237a0b18 | [
"BSD-3-Clause"
] | null | null | null | app/data.py | Trupal00p/polymer-template | d16ea08557792c3681dce5cd69bfe321237a0b18 | [
"BSD-3-Clause"
] | null | null | null | app/data.py | Trupal00p/polymer-template | d16ea08557792c3681dce5cd69bfe321237a0b18 | [
"BSD-3-Clause"
] | null | null | null | from google.appengine.ext import ndb
from rest_gae.users import User as RESTUser
class User(RESTUser):
"""Our own user class"""
organization = ndb.KeyProperty(kind='Organization')
role = ndb.KeyProperty(kind='Role', repeated=True)
# # This is optional, but if we use a RESTMeta - we must inherit it (... | 34.732394 | 80 | 0.679238 | from google.appengine.ext import ndb
from rest_gae.users import User as RESTUser
class User(RESTUser):
"""Our own user class"""
organization = ndb.KeyProperty(kind='Organization')
role = ndb.KeyProperty(kind='Role', repeated=True)
# # This is optional, but if we use a RESTMeta - we must inherit it (... | 0 | 1,314 | 77 |
3c05cd8880f21cd7a2172a05c937173dd00dcd35 | 8,284 | py | Python | lib/devtool/cache.py | shift-left-test/meta-shift | effce9bea894f990703cc047157e3f30d53d9365 | [
"MIT"
] | 2 | 2022-01-19T02:39:43.000Z | 2022-02-07T01:58:17.000Z | lib/devtool/cache.py | shift-left-test/meta-shift | effce9bea894f990703cc047157e3f30d53d9365 | [
"MIT"
] | null | null | null | lib/devtool/cache.py | shift-left-test/meta-shift | effce9bea894f990703cc047157e3f30d53d9365 | [
"MIT"
] | null | null | null | """
Copyright (c) 2020 LG Electronics Inc.
SPDX-License-Identifier: MIT
"""
import bb
import json
import logging
import os
import re
import shutil
import subprocess
import sys
import tempfile
from devtool import setup_tinfoil, DevtoolError
logger = logging.getLogger("devtool")
logger.setLevel(logging.WARNING)
cla... | 34.373444 | 115 | 0.577378 | """
Copyright (c) 2020 LG Electronics Inc.
SPDX-License-Identifier: MIT
"""
import bb
import json
import logging
import os
import re
import shutil
import subprocess
import sys
import tempfile
from devtool import setup_tinfoil, DevtoolError
logger = logging.getLogger("devtool")
logger.setLevel(logging.WARNING)
clas... | 4,661 | 9 | 439 |
d284f6b254fd2a97325bbed799ee2bc0e25a76be | 45,021 | py | Python | elixir/entity.py | peggygao1988/elixir | 47f4e6e999f3925546c27fb386b079654ee45f6e | [
"Apache-2.0"
] | 1 | 2015-08-25T14:24:17.000Z | 2015-08-25T14:24:17.000Z | elixir/entity.py | peggygao1988/elixir | 47f4e6e999f3925546c27fb386b079654ee45f6e | [
"Apache-2.0"
] | null | null | null | elixir/entity.py | peggygao1988/elixir | 47f4e6e999f3925546c27fb386b079654ee45f6e | [
"Apache-2.0"
] | null | null | null | '''
This module provides the ``Entity`` base class, as well as its metaclass
``EntityMeta``.
'''
from py23compat import sorted
import sys
import types
import warnings
from copy import deepcopy
import sqlalchemy
from sqlalchemy import Table, Column, Integer, desc, ForeignKey, and_, \
ForeignKe... | 38.056636 | 94 | 0.590769 | '''
This module provides the ``Entity`` base class, as well as its metaclass
``EntityMeta``.
'''
from py23compat import sorted
import sys
import types
import warnings
from copy import deepcopy
import sqlalchemy
from sqlalchemy import Table, Column, Integer, desc, ForeignKey, and_, \
ForeignKe... | 15,322 | 607 | 1,341 |
96c99159ef8e92061aedca8669c571d1a49943c6 | 224 | py | Python | styletransfer/models/networks/transformers/__init__.py | jaeyeun97/MusicalStyleTransfer | 0aa9e8763597bf86ff0c13ae96dee75d165c4fc2 | [
"BSD-3-Clause"
] | 1 | 2020-04-14T14:11:14.000Z | 2020-04-14T14:11:14.000Z | styletransfer/models/networks/transformers/__init__.py | jaeyeun97/MusicalStyleTransfer | 0aa9e8763597bf86ff0c13ae96dee75d165c4fc2 | [
"BSD-3-Clause"
] | null | null | null | styletransfer/models/networks/transformers/__init__.py | jaeyeun97/MusicalStyleTransfer | 0aa9e8763597bf86ff0c13ae96dee75d165c4fc2 | [
"BSD-3-Clause"
] | null | null | null | from .lstm import LSTMTransformer
from .resnet1d import Resnet1dTransformer
from .resnet2d import Resnet2dTransformer
from .gated_resnet1d import GatedResnet1dTransformer
from .gated_resnet2d import GatedResnet2dTransformer
| 37.333333 | 52 | 0.888393 | from .lstm import LSTMTransformer
from .resnet1d import Resnet1dTransformer
from .resnet2d import Resnet2dTransformer
from .gated_resnet1d import GatedResnet1dTransformer
from .gated_resnet2d import GatedResnet2dTransformer
| 0 | 0 | 0 |
05543f6c9e36f83b41641ae76f708b5b45f66748 | 15,231 | py | Python | source/Userdocs/NML2_examples/tune-izhikevich.py | NeuroML/Documentation | 06e355a8268c848b872b4e4c44d990b77b1fcb37 | [
"CC-BY-4.0"
] | 5 | 2020-09-28T20:47:04.000Z | 2021-08-23T16:46:30.000Z | source/Userdocs/NML2_examples/tune-izhikevich.py | NeuroML/Documentation | 06e355a8268c848b872b4e4c44d990b77b1fcb37 | [
"CC-BY-4.0"
] | 86 | 2020-11-05T12:32:01.000Z | 2022-03-30T22:45:00.000Z | source/Userdocs/NML2_examples/tune-izhikevich.py | NeuroML/Documentation | 06e355a8268c848b872b4e4c44d990b77b1fcb37 | [
"CC-BY-4.0"
] | 2 | 2021-08-23T16:46:34.000Z | 2022-03-25T00:43:11.000Z | #!/usr/bin/env python3
"""
Example file showing the tuning of an Izhikevich neuron using pyNeuroML.
File: source/Userdocs/NML2_examples/tune-izhikevich.py
Copyright 2021 NeuroML contributors
"""
from pyneuroml.tune.NeuroMLTuner import run_optimisation
import pynwb # type: ignore
import numpy as np
from pyelectro.u... | 35.013793 | 138 | 0.646576 | #!/usr/bin/env python3
"""
Example file showing the tuning of an Izhikevich neuron using pyNeuroML.
File: source/Userdocs/NML2_examples/tune-izhikevich.py
Copyright 2021 NeuroML contributors
"""
from pyneuroml.tune.NeuroMLTuner import run_optimisation
import pynwb # type: ignore
import numpy as np
from pyelectro.u... | 0 | 0 | 0 |
4d89301af6fa6b1c5046c610d2de1c47a8dbbf0c | 3,158 | py | Python | supervised/data_collector.py | gthd/supervised_learning | 183c6b67031a506bb130a2ca5b091225aaa26112 | [
"MIT"
] | null | null | null | supervised/data_collector.py | gthd/supervised_learning | 183c6b67031a506bb130a2ca5b091225aaa26112 | [
"MIT"
] | null | null | null | supervised/data_collector.py | gthd/supervised_learning | 183c6b67031a506bb130a2ca5b091225aaa26112 | [
"MIT"
] | null | null | null | import robot
import robot2
import numpy as np
policy = Policy()
policy.collect_training_data()
| 31.267327 | 84 | 0.60228 | import robot
import robot2
import numpy as np
class Policy:
def __init__(self):
self.robot = robot.VrepCommunication()
self.termination_height = 0.13
self.script = ''
def start_vrep(self, again=False):
if again:
self.robot.end_communication()
self.robot... | 2,529 | 510 | 23 |
088d45a21edc44b0a63398d3e36433350352c431 | 896 | py | Python | teleope_twist_keyboard.py | masamasa9841/mouserobot_ros | 6838693be1289d456cf8e6cff1e94d7889e5bb34 | [
"BSD-3-Clause"
] | null | null | null | teleope_twist_keyboard.py | masamasa9841/mouserobot_ros | 6838693be1289d456cf8e6cff1e94d7889e5bb34 | [
"BSD-3-Clause"
] | null | null | null | teleope_twist_keyboard.py | masamasa9841/mouserobot_ros | 6838693be1289d456cf8e6cff1e94d7889e5bb34 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import rospy
from geometry_msgs.msg import Twist
if __name__ == '__main__':
rospy.init_node('keyboard_cmd_vel')
keyboard_cmd_vel = KeyTwist()
keyboard_cmd_vel.main()
| 28 | 76 | 0.543527 | #!/usr/bin/env python
import rospy
from geometry_msgs.msg import Twist
class KeyTwist(object):
def __init__(self):
self._twist_pub = rospy.Publisher('/cmd_vel', Twist, queue_size=100)
def main(self):
while not rospy.is_shutdown():
twist = Twist()
direction = raw_input(... | 615 | 2 | 76 |
56a1f57503621c1b5223a878a4331ddc6ee9b4ac | 263 | py | Python | pyfilter/distributions/typing.py | tingiskhan/pyfilter | 2d7ef0638c0c0fe70d8e01d6bcf8131d901144fd | [
"MIT"
] | 61 | 2018-07-12T17:17:37.000Z | 2022-03-19T17:37:59.000Z | pyfilter/distributions/typing.py | tingiskhan/pyfilter | 2d7ef0638c0c0fe70d8e01d6bcf8131d901144fd | [
"MIT"
] | 12 | 2018-08-26T20:01:03.000Z | 2021-12-04T16:42:48.000Z | pyfilter/distributions/typing.py | tingiskhan/pyfilter | 2d7ef0638c0c0fe70d8e01d6bcf8131d901144fd | [
"MIT"
] | 9 | 2019-01-20T16:31:03.000Z | 2021-12-24T07:10:04.000Z | from torch.distributions import Distribution
import torch
from typing import Type, Callable, Sequence, Union
HyperParameters = Union[torch.Tensor, float, int]
DistributionOrBuilder = Union[Type[Distribution], Callable[[Sequence[HyperParameters]], Distribution]]
| 37.571429 | 102 | 0.821293 | from torch.distributions import Distribution
import torch
from typing import Type, Callable, Sequence, Union
HyperParameters = Union[torch.Tensor, float, int]
DistributionOrBuilder = Union[Type[Distribution], Callable[[Sequence[HyperParameters]], Distribution]]
| 0 | 0 | 0 |
c51030fc61c2b97bd82d27a033e7fef59d3c609f | 1,440 | py | Python | scripts/mkegglistindex.py | mjfwest/OpenMDAO-Framework | a5521f47ad7686c25b203de74e1c7dff5fd7a52b | [
"Apache-2.0"
] | 69 | 2015-01-02T19:10:08.000Z | 2021-11-14T04:42:28.000Z | scripts/mkegglistindex.py | jcchin/OpenMDAO-Framework | 038e89b06da1c74f00918f4c6fbd8bd365e25657 | [
"Apache-2.0"
] | 3 | 2015-01-15T23:08:18.000Z | 2015-03-11T16:57:35.000Z | scripts/mkegglistindex.py | jcchin/OpenMDAO-Framework | 038e89b06da1c74f00918f4c6fbd8bd365e25657 | [
"Apache-2.0"
] | 31 | 2015-09-16T00:37:35.000Z | 2022-01-10T06:27:55.000Z | """
This creates an index.html file for the find-links directory on the openmdao.org site.
"""
import sys
import os.path
import hashlib
import fnmatch
def find_files(startdir, pats):
"""Return a list of files (using a generator) that match
the given list of glob patterns. Walks an entire directory structure... | 25.263158 | 86 | 0.571528 | """
This creates an index.html file for the find-links directory on the openmdao.org site.
"""
import sys
import os.path
import hashlib
import fnmatch
def find_files(startdir, pats):
"""Return a list of files (using a generator) that match
the given list of glob patterns. Walks an entire directory structure... | 468 | 0 | 23 |
74284982f0805ee428f4f93c11149908b0a346bc | 1,583 | py | Python | pyPLM/Core/Process.py | vtta2008/pipelineTool | 2431d2fc987e3b31f2a6a63427fee456fa0765a0 | [
"Apache-2.0"
] | 7 | 2018-09-09T01:14:34.000Z | 2020-01-26T10:06:08.000Z | pyPLM/Core/Process.py | vtta2008/pipelineTool | 2431d2fc987e3b31f2a6a63427fee456fa0765a0 | [
"Apache-2.0"
] | null | null | null | pyPLM/Core/Process.py | vtta2008/pipelineTool | 2431d2fc987e3b31f2a6a63427fee456fa0765a0 | [
"Apache-2.0"
] | 3 | 2019-03-11T21:54:52.000Z | 2019-11-25T11:23:17.000Z | # -*- coding: utf-8 -*-
"""
Script Name: Process.py
Author: Do Trinh/Jimmy - 3D artist.
Description:
"""
# -------------------------------------------------------------------------------------------------------------
import os
from PySide2.QtCore import QProcess
# ---------------------------------... | 28.267857 | 114 | 0.51295 | # -*- coding: utf-8 -*-
"""
Script Name: Process.py
Author: Do Trinh/Jimmy - 3D artist.
Description:
"""
# -------------------------------------------------------------------------------------------------------------
import os
from PySide2.QtCore import QProcess
class Process(QProcess):
Type ... | 764 | 310 | 23 |
edc11b374a127df07419ec92b94954b31dc4e57b | 601 | py | Python | pdf_playground/pdf.py | dukagjinramosaj1/python_exercises | 7585f483f5061ad22acf5ec9a3ae237403fa1c58 | [
"MIT"
] | null | null | null | pdf_playground/pdf.py | dukagjinramosaj1/python_exercises | 7585f483f5061ad22acf5ec9a3ae237403fa1c58 | [
"MIT"
] | null | null | null | pdf_playground/pdf.py | dukagjinramosaj1/python_exercises | 7585f483f5061ad22acf5ec9a3ae237403fa1c58 | [
"MIT"
] | null | null | null |
import PyPDF2
import sys
#inputs from command
inputs = sys.argv[1:]
#merging PDF
#call the function
pdf_merger(inputs)
#ROTATE PDFs
# with open('dummy.pdf', 'rb') as file:
# reader = PyPDF2.PdfFileReader(file)
# page = reader.getPage(0)
# page.rotateClockwise(90)
# writer = PyPDF2.PdfFileWri... | 17.171429 | 46 | 0.643927 |
import PyPDF2
import sys
#inputs from command
inputs = sys.argv[1:]
#merging PDF
def pdf_merger(pdf_list):
merger = PyPDF2.PdfFileMerger()
for pdf in pdf_list:
print(pdf)
merger.append(pdf)
merger.write('super.pdf')
#call the function
pdf_merger(inputs)
#ROTATE PDFs
# with open('... | 141 | 0 | 22 |
377cace65f0288d47a5c627af6e029b919f9ee87 | 826 | py | Python | robot_test.py | KyleDev008/AlphaBot2-Pi-Core | 4b6ec9bd7f760fd2a41edb05a10b1b1b4750a61a | [
"MIT"
] | 1 | 2022-02-13T18:10:23.000Z | 2022-02-13T18:10:23.000Z | robot_test.py | KyleDev008/AlphaBot2-Pi-Core | 4b6ec9bd7f760fd2a41edb05a10b1b1b4750a61a | [
"MIT"
] | null | null | null | robot_test.py | KyleDev008/AlphaBot2-Pi-Core | 4b6ec9bd7f760fd2a41edb05a10b1b1b4750a61a | [
"MIT"
] | null | null | null | from time import sleep
from LEDStrip import LEDStrip
from Wheels import Wheels
from Servos import Servos
from Joystick import Joystick
if __name__ == "__main__":
print("> Testing Robot <")
print(" > Testing LEDs...")
led = LEDStrip(0.5)
led.led_test()
print(" > LED Testing Complete!")
... | 18.772727 | 42 | 0.59322 | from time import sleep
from LEDStrip import LEDStrip
from Wheels import Wheels
from Servos import Servos
from Joystick import Joystick
if __name__ == "__main__":
print("> Testing Robot <")
print(" > Testing LEDs...")
led = LEDStrip(0.5)
led.led_test()
print(" > LED Testing Complete!")
... | 0 | 0 | 0 |
d101cf6bb24a02017604ba63c91029a4ec28843a | 2,818 | py | Python | reasoner/json2f2.py | shiv-io/blawx | 2fef1fbc26f7c4479714e3fa291660964672b612 | [
"MIT"
] | 1 | 2020-06-21T02:19:54.000Z | 2020-06-21T02:19:54.000Z | reasoner/json2f2.py | shiv-io/blawx | 2fef1fbc26f7c4479714e3fa291660964672b612 | [
"MIT"
] | null | null | null | reasoner/json2f2.py | shiv-io/blawx | 2fef1fbc26f7c4479714e3fa291660964672b612 | [
"MIT"
] | null | null | null | # Script to Take a JSON object, convert it into a Python structure, and convert the Python structure into Flora-2 code.
# Jason Morris
import sys, json, types
# Get the data from the command line
filename = sys.argv[1]
file = open(filename, "r")
# Convert from JSON to Python structure
dictionary = json.load(file)
#p... | 28.18 | 119 | 0.562811 | # Script to Take a JSON object, convert it into a Python structure, and convert the Python structure into Flora-2 code.
# Jason Morris
import sys, json, types
def json2flora(key,value,parentname="data",root=False):
retstr = ""
# If this is not a leaf:
if isinstance(value, (list,dict,tuple)):
# for each of t... | 2,133 | 0 | 48 |
020d633565e9ec12c078b859df25d05c02e5b784 | 2,757 | py | Python | src/loaders.py | dchevell/sourcepy | 069e1d2f7d5de3f18947871a099156105d218848 | [
"MIT"
] | 6 | 2022-03-07T11:34:13.000Z | 2022-03-31T13:04:11.000Z | src/loaders.py | dchevell/sourcepy | 069e1d2f7d5de3f18947871a099156105d218848 | [
"MIT"
] | null | null | null | src/loaders.py | dchevell/sourcepy | 069e1d2f7d5de3f18947871a099156105d218848 | [
"MIT"
] | null | null | null | import importlib.machinery
import importlib.util
import inspect
import sys
from pathlib import Path
from types import ModuleType
from typing import Callable, Iterator, List, Optional, Tuple, TypedDict
MemberDefinitions = Iterator[_MemberDef]
Members = List[Tuple[str, object]]
| 33.621951 | 92 | 0.670294 | import importlib.machinery
import importlib.util
import inspect
import sys
from pathlib import Path
from types import ModuleType
from typing import Callable, Iterator, List, Optional, Tuple, TypedDict
class _MemberDef(TypedDict):
name: str
type: str
value: object
MemberDefinitions = Iterator[_MemberDef... | 2,256 | 53 | 161 |
e3bae06f8864e2fbc2f533aaba84197ffb142a0b | 130 | py | Python | tests/Test.py | DHI/mikecore-python | 04c36b1ee3dc6c81905d75ff8c39d7b8a8411bd7 | [
"BSD-3-Clause"
] | 2 | 2021-06-01T21:06:48.000Z | 2021-06-16T03:49:35.000Z | tests/Test.py | DHI/mikecore-python | 04c36b1ee3dc6c81905d75ff8c39d7b8a8411bd7 | [
"BSD-3-Clause"
] | 6 | 2021-05-27T10:26:13.000Z | 2022-03-07T09:44:19.000Z | tests/Test.py | DHI/mikecore-python | 04c36b1ee3dc6c81905d75ff8c39d7b8a8411bd7 | [
"BSD-3-Clause"
] | null | null | null | # To run all test in a Python environment:
import sys; sys.path.insert(0, "C:\Work\python\mikecore"); import tests.test_run_all
| 26 | 84 | 0.746154 | # To run all test in a Python environment:
import sys; sys.path.insert(0, "C:\Work\python\mikecore"); import tests.test_run_all
| 0 | 0 | 0 |
8a9a022a4798a08a47dab8f9aba8fa0bd3446c38 | 11,481 | py | Python | emotion_inferring/model/modules.py | thuhcsi/IJCAI2019-DRL4SER | 66c26d838ed56347474a7b8255cc3595727bb389 | [
"MIT"
] | 21 | 2019-08-12T02:50:07.000Z | 2022-03-12T08:05:11.000Z | emotion_inferring/model/modules.py | thuhcsi/IJCAI2019-DRL4SER | 66c26d838ed56347474a7b8255cc3595727bb389 | [
"MIT"
] | 2 | 2019-08-22T11:32:15.000Z | 2021-05-25T08:15:37.000Z | emotion_inferring/model/modules.py | thuhcsi/IJCAI2019-DRL4SER | 66c26d838ed56347474a7b8255cc3595727bb389 | [
"MIT"
] | 6 | 2019-08-14T02:56:57.000Z | 2021-05-18T06:34:51.000Z | import numpy as np
import tensorflow as tf
import sys
from emotion_inferring.model.GCALSTM import GCALSTMCell
from emotion_inferring.model.MALSTM import MALSTMCell
from emotion_inferring.model.GCM import GCAttention
from emotion_inferring.model.SelfAttention import *
| 41.749091 | 102 | 0.523299 | import numpy as np
import tensorflow as tf
import sys
from emotion_inferring.model.GCALSTM import GCALSTMCell
from emotion_inferring.model.MALSTM import MALSTMCell
from emotion_inferring.model.GCM import GCAttention
from emotion_inferring.model.SelfAttention import *
def Creat_CNN_layer(input,
fi... | 10,972 | 0 | 230 |
10e989c9013462f2a694b06e0d9d7052327fda62 | 16,350 | py | Python | datalad_metalad/extractors/studyminimeta/ldcreator.py | christian-monch/datalad-metalad | 75dd34f71d1fa6d03ccd8cb64d8b438593519226 | [
"MIT"
] | null | null | null | datalad_metalad/extractors/studyminimeta/ldcreator.py | christian-monch/datalad-metalad | 75dd34f71d1fa6d03ccd8cb64d8b438593519226 | [
"MIT"
] | null | null | null | datalad_metalad/extractors/studyminimeta/ldcreator.py | christian-monch/datalad-metalad | 75dd34f71d1fa6d03ccd8cb64d8b438593519226 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from collections import namedtuple
from typing import Dict, List, Union
LDCreatorResult = namedtuple("LDCreatorResult", ["success", "json_ld_object", "keys", "messages"])
DATALAD_SCHEMA_BASE = "https://schema.datalad.org"
# Automatically translated study-element properties
STUDY_TRAN... | 39.97555 | 115 | 0.606972 | # -*- coding: utf-8 -*-
from collections import namedtuple
from typing import Dict, List, Union
LDCreatorResult = namedtuple("LDCreatorResult", ["success", "json_ld_object", "keys", "messages"])
DATALAD_SCHEMA_BASE = "https://schema.datalad.org"
class SMMProperties:
AFFILIATION = "affiliation"
AUTHOR = "... | 11,526 | 2,399 | 542 |
1ce2f037cb7ebb16ab14d294169a96c2ea1f8804 | 1,784 | py | Python | src/utils.py | MiVaVo/Antispoof-3d | 03ee614f4daf85069ce22c80cb6ed4642bdf762e | [
"CC0-1.0"
] | 1 | 2020-06-01T13:24:06.000Z | 2020-06-01T13:24:06.000Z | src/utils.py | MiVaVo/Antispoof-3d | 03ee614f4daf85069ce22c80cb6ed4642bdf762e | [
"CC0-1.0"
] | null | null | null | src/utils.py | MiVaVo/Antispoof-3d | 03ee614f4daf85069ce22c80cb6ed4642bdf762e | [
"CC0-1.0"
] | null | null | null | import os
import pickle
import re
from datetime import datetime as dt
import cv2
import numpy as np
from functools import wraps
from time import time
@timing
| 29.733333 | 133 | 0.645179 | import os
import pickle
import re
from datetime import datetime as dt
import cv2
import numpy as np
from functools import wraps
from time import time
def timing(f):
@wraps(f)
def wrapper(*args, **kwargs):
function_name=f.__name__
start=dt.now()
result = f(*args, **kwargs)
end=... | 1,504 | 0 | 114 |
054f6f37e1c84c6edd0b73fb1733fa8f36342414 | 1,904 | py | Python | suanfa/binary_tree.py | nciefeiniu/python-test | d81fcfff8cdec724c3010d6b7a77aabad7f90595 | [
"Apache-2.0"
] | null | null | null | suanfa/binary_tree.py | nciefeiniu/python-test | d81fcfff8cdec724c3010d6b7a77aabad7f90595 | [
"Apache-2.0"
] | null | null | null | suanfa/binary_tree.py | nciefeiniu/python-test | d81fcfff8cdec724c3010d6b7a77aabad7f90595 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import Queue
# 先序遍历
# 递归实现先序遍历
# 递归实现中序遍历
if __name__ == '__main__':
b = BinaryTree()
b.add(1)
b.add(2)
b.add(3)
b.add(4)
b.add(5)
b.add(6)
b.add(7)
# b.p_traversal()
b.recursion_p(b.root)
print '========================='
b.rec... | 22.666667 | 55 | 0.480567 | # -*- coding: utf-8 -*-
import Queue
class Node:
def __init__(self, value=None):
self.value = value
self.left = None
self.right = None
class BinaryTree:
def __init__(self, root=None):
self.root = root
def add(self, value):
node = Node(value=value)
if sel... | 1,377 | -14 | 203 |
cfba7b41cedad63952f82913214af852abe6da30 | 1,940 | py | Python | test/rfcn_box_split_test.py | engineer1109/TensorFlow-R-FCN-for-primary-students | 66be2133052cacc04b5b04054624333c2c17ebd2 | [
"MIT"
] | 12 | 2017-12-23T12:03:36.000Z | 2020-04-28T09:37:30.000Z | test/rfcn_box_split_test.py | engineer1109/TensorFlow-R-FCN-for-primary-students | 66be2133052cacc04b5b04054624333c2c17ebd2 | [
"MIT"
] | 6 | 2017-12-27T12:30:52.000Z | 2021-05-02T11:01:59.000Z | test/rfcn_box_split_test.py | engineer1109/TensorFlow-R-FCN-for-primary-students | 66be2133052cacc04b5b04054624333c2c17ebd2 | [
"MIT"
] | 3 | 2018-08-22T08:47:17.000Z | 2019-10-10T07:53:40.000Z | import numpy as np
import tensorflow as tf
if __name__ == '__main__':
np.random.seed(0)
img = np.random.randn(1, 10, 10, 1)
tf_img = tf.convert_to_tensor(img)
print(img[0, :, :, 0])
rois = np.array([[0, 0, 6, 6],
[2, 2, 8, 8]], dtype=np.float32)
tf_rois = tf.convert_to_... | 30.793651 | 102 | 0.570103 | import numpy as np
import tensorflow as tf
def _normalize(rois, height, width):
xmin, ymin, xmax, ymax = tf.unstack(rois, axis=1)
xmin = xmin/width
ymin = ymin/height
xmax = xmax/width
ymax = ymax/height
return tf.stack([xmin, ymin, xmax, ymax], axis=1)
def _grid_features(imgs, tf_rois):
... | 1,197 | 0 | 46 |
bba2c2461f1e70c70314af3caaf13dce05c68df3 | 1,615 | py | Python | operations/fleet_management/migrations/0090_auto_20181109_1214.py | kaizer88/emps | 2669b32c46befcf1a19390fb25013817e6b00980 | [
"MIT"
] | null | null | null | operations/fleet_management/migrations/0090_auto_20181109_1214.py | kaizer88/emps | 2669b32c46befcf1a19390fb25013817e6b00980 | [
"MIT"
] | null | null | null | operations/fleet_management/migrations/0090_auto_20181109_1214.py | kaizer88/emps | 2669b32c46befcf1a19390fb25013817e6b00980 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-11-09 10:14
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import lib.fields
| 40.375 | 199 | 0.671207 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-11-09 10:14
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import lib.fields
class Migration(migrations.Migration):
dependencies = [
migrations... | 0 | 1,352 | 23 |
00ad8d618caebd164eab17de29236acc964c1ed6 | 4,715 | py | Python | shutit_unikernel_walkthrough.py | ianmiell/shutit-unikernel-walkthrough | 91e62dc58931fcd35a25885292c58916f8d04a13 | [
"MIT"
] | 6 | 2016-07-21T19:55:03.000Z | 2021-01-14T12:30:15.000Z | shutit_unikernel_walkthrough.py | ianmiell/shutit-unikernel-walkthrough | 91e62dc58931fcd35a25885292c58916f8d04a13 | [
"MIT"
] | null | null | null | shutit_unikernel_walkthrough.py | ianmiell/shutit-unikernel-walkthrough | 91e62dc58931fcd35a25885292c58916f8d04a13 | [
"MIT"
] | null | null | null | import random
import string
from shutit_module import ShutItModule
| 40.646552 | 244 | 0.721739 | import random
import string
from shutit_module import ShutItModule
class shutit_unikernel_walkthrough(ShutItModule):
def build(self, shutit):
vagrant_image = shutit.cfg[self.module_id]['vagrant_image']
vagrant_provider = shutit.cfg[self.module_id]['vagrant_provider']
gui = shutit.cfg[self.module_id]['gui']
... | 4,403 | 28 | 214 |
e1e5da328bcac61d876a8562733e6cb63390217a | 1,212 | py | Python | day22/guidos-gorgeous-lasagna/lasagna.py | Akankshasharmaa/100DaysOfCode | 395bd8bd063495af7d04ec7b2f819923f502059f | [
"MIT"
] | 2 | 2021-12-22T07:43:14.000Z | 2021-12-24T12:07:33.000Z | day22/guidos-gorgeous-lasagna/lasagna.py | Akankshasharmaa/100DaysOfCode | 395bd8bd063495af7d04ec7b2f819923f502059f | [
"MIT"
] | null | null | null | day22/guidos-gorgeous-lasagna/lasagna.py | Akankshasharmaa/100DaysOfCode | 395bd8bd063495af7d04ec7b2f819923f502059f | [
"MIT"
] | 1 | 2021-12-22T07:43:26.000Z | 2021-12-22T07:43:26.000Z | """Time taken when baking lasagna
"""
EXPECTED_BAKE_TIME = 40
PREPARATION_TIME = 2
def bake_time_remaining(elapsed_bake_time):
"""Calculate the bake time remaining.
:param elapsed_bake_time: int baking time already elapsed.
:return: int remaining bake time derived from 'EXPECTED_BAKE_TIME'.
Function... | 34.628571 | 94 | 0.765677 | """Time taken when baking lasagna
"""
EXPECTED_BAKE_TIME = 40
PREPARATION_TIME = 2
def bake_time_remaining(elapsed_bake_time):
"""Calculate the bake time remaining.
:param elapsed_bake_time: int baking time already elapsed.
:return: int remaining bake time derived from 'EXPECTED_BAKE_TIME'.
Function... | 0 | 0 | 0 |
8496ca6e11555c92788c1c363227b112e67a3fe5 | 1,054 | py | Python | core-python/Core_Python/socketpkg/TCPSendRcvServer_3.py | theumang100/tutorials-1 | 497f54c2adb022c316530319a168fca1c007d4b1 | [
"MIT"
] | 9 | 2020-04-23T05:24:19.000Z | 2022-02-17T16:37:51.000Z | core-python/Core_Python/socketpkg/TCPSendRcvServer_3.py | theumang100/tutorials-1 | 497f54c2adb022c316530319a168fca1c007d4b1 | [
"MIT"
] | 5 | 2020-10-01T05:08:37.000Z | 2020-10-12T03:18:10.000Z | core-python/Core_Python/socketpkg/TCPSendRcvServer_3.py | theumang100/tutorials-1 | 497f54c2adb022c316530319a168fca1c007d4b1 | [
"MIT"
] | 9 | 2020-04-28T14:06:41.000Z | 2021-10-19T18:32:28.000Z | import socket as s
try:
server_soc = s.socket(family=s.AF_INET,type=s.SOCK_STREAM)
server_soc.bind(('localhost',9999))
server_soc.listen(1)
print("<---- Server side ---->")
while True:
(clien_soc,(c_addr)) = server_soc.accept()
print("Connection Established from {0} with {1} port".... | 42.16 | 130 | 0.640417 | import socket as s
try:
server_soc = s.socket(family=s.AF_INET,type=s.SOCK_STREAM)
server_soc.bind(('localhost',9999))
server_soc.listen(1)
print("<---- Server side ---->")
while True:
(clien_soc,(c_addr)) = server_soc.accept()
print("Connection Established from {0} with {1} port".... | 0 | 0 | 0 |
6884847afa89a68ef7373968d978010939107441 | 2,762 | py | Python | graph/word_search_in_matrix.py | mantoshkumar1/interview_preparation | c7e5b6692ad6772b38de8be029bddf0e273e0bce | [
"MIT"
] | 1 | 2020-05-28T19:14:56.000Z | 2020-05-28T19:14:56.000Z | graph/word_search_in_matrix.py | mantoshkumar1/interview_preparation | c7e5b6692ad6772b38de8be029bddf0e273e0bce | [
"MIT"
] | null | null | null | graph/word_search_in_matrix.py | mantoshkumar1/interview_preparation | c7e5b6692ad6772b38de8be029bddf0e273e0bce | [
"MIT"
] | null | null | null | """
79. Word Search
------------------
https://leetcode.com/problems/word-search/
Given a 2D board and a word, find if the word exists in the grid.
The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically neighboring. The same letter cell may ... | 26.557692 | 197 | 0.530413 | """
79. Word Search
------------------
https://leetcode.com/problems/word-search/
Given a 2D board and a word, find if the word exists in the grid.
The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically neighboring. The same letter cell may ... | 1,736 | -6 | 130 |
4e42d038f853e11ca382a5c7456212889054d2ab | 7,027 | py | Python | Mini Project/Mini Project/mini_project_v4.py | gyalpodongo/g_lab | 48d4bc19c7cfbaeb486c6ddbd5cafd8dfc3ca81b | [
"MIT"
] | null | null | null | Mini Project/Mini Project/mini_project_v4.py | gyalpodongo/g_lab | 48d4bc19c7cfbaeb486c6ddbd5cafd8dfc3ca81b | [
"MIT"
] | null | null | null | Mini Project/Mini Project/mini_project_v4.py | gyalpodongo/g_lab | 48d4bc19c7cfbaeb486c6ddbd5cafd8dfc3ca81b | [
"MIT"
] | null | null | null | """
The purpose of this mini project for ES 8.01/8.012 is to show the orbit of
two objects in a bynary system using Newton's Gravitational Law, Conservation
of Momentum and Newton's 2nd Law. The visualization will be produced using the
different features of vpython.
Before running the code, in the command pro... | 45.335484 | 126 | 0.659741 | """
The purpose of this mini project for ES 8.01/8.012 is to show the orbit of
two objects in a bynary system using Newton's Gravitational Law, Conservation
of Momentum and Newton's 2nd Law. The visualization will be produced using the
different features of vpython.
Before running the code, in the command pro... | 0 | 0 | 0 |
a782537e0b90194833ff57c752abddc47a9d1c34 | 5,248 | py | Python | workflow/migrations/0001_initial.py | uktrade/approval-firebreak | 77ab80eb26509681efadbe559f2a234e22b39a54 | [
"MIT"
] | 1 | 2021-08-10T14:37:53.000Z | 2021-08-10T14:37:53.000Z | workflow/migrations/0001_initial.py | uktrade/approval-firebreak | 77ab80eb26509681efadbe559f2a234e22b39a54 | [
"MIT"
] | null | null | null | workflow/migrations/0001_initial.py | uktrade/approval-firebreak | 77ab80eb26509681efadbe559f2a234e22b39a54 | [
"MIT"
] | 1 | 2021-08-05T16:41:47.000Z | 2021-08-05T16:41:47.000Z | # Generated by Django 3.2 on 2021-04-12 10:10
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django_fsm
import uuid
| 73.915493 | 253 | 0.664634 | # Generated by Django 3.2 on 2021-04-12 10:10
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django_fsm
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH... | 0 | 5,040 | 23 |
b7c2ca37bcc69a1116c0188f0f06973f2d847ba2 | 7,761 | py | Python | scripts/patch_potentials/plot_patch_potential_sim.py | charlesblakemore/opt_lev_analysis | 704f174e9860907de349688ed82b5812bbb07c2d | [
"MIT"
] | null | null | null | scripts/patch_potentials/plot_patch_potential_sim.py | charlesblakemore/opt_lev_analysis | 704f174e9860907de349688ed82b5812bbb07c2d | [
"MIT"
] | null | null | null | scripts/patch_potentials/plot_patch_potential_sim.py | charlesblakemore/opt_lev_analysis | 704f174e9860907de349688ed82b5812bbb07c2d | [
"MIT"
] | 1 | 2019-11-27T19:10:25.000Z | 2019-11-27T19:10:25.000Z | import numpy as np
import matplotlib.pyplot as plt
import scipy.interpolate as interp
import scipy.constants as constants
import scipy.signal as signal
import sys, time, os
import bead_util as bu
fac = 425 * constants.elementary_charge
base_path = '/processed_data/comsol_data/patch_potentials/'
fnames = bu.find... | 32.609244 | 95 | 0.615513 | import numpy as np
import matplotlib.pyplot as plt
import scipy.interpolate as interp
import scipy.constants as constants
import scipy.signal as signal
import sys, time, os
import bead_util as bu
fac = 425 * constants.elementary_charge
base_path = '/processed_data/comsol_data/patch_potentials/'
fnames = bu.find... | 0 | 0 | 0 |
2bbd71138203e58a16908ec4f881133eccc489f7 | 18,868 | py | Python | models/records.py | alaashaalan/flaskLocus | 71d6347c6961ae999c894f96e7a49cba9999844f | [
"MIT"
] | null | null | null | models/records.py | alaashaalan/flaskLocus | 71d6347c6961ae999c894f96e7a49cba9999844f | [
"MIT"
] | null | null | null | models/records.py | alaashaalan/flaskLocus | 71d6347c6961ae999c894f96e7a49cba9999844f | [
"MIT"
] | null | null | null | import numpy as np
import copy
from datetime import datetime, timedelta
import pandas as pd
from sklearn.neural_network import MLPClassifier
from sklearn import svm
from sklearn.neighbors import KNeighborsClassifier
from sklearn.model_selection import GridSearchCV
from sklearn.model_selection import StratifiedShuffleS... | 31.871622 | 159 | 0.728217 | import numpy as np
import copy
from datetime import datetime, timedelta
import pandas as pd
from sklearn.neural_network import MLPClassifier
from sklearn import svm
from sklearn.neighbors import KNeighborsClassifier
from sklearn.model_selection import GridSearchCV
from sklearn.model_selection import StratifiedShuffleS... | 11,672 | 2,201 | 357 |
60b85edf927478abb74878a6c6e7914d73182692 | 147 | py | Python | src/testcase/GN_Y201H/input_case/GN_Y201H_Smart_Link.py | maiyajj/AutoTest_script-Appium_Connect | f9c2c42c281a9e2f984acb4a72dda0694b053f22 | [
"Apache-2.0"
] | 28 | 2017-11-10T00:19:16.000Z | 2022-02-19T16:42:05.000Z | src/testcase/GN_Y201H/input_case/GN_Y201H_Smart_Link.py | maiyajj/AutoTest_script-Appium_Connect | f9c2c42c281a9e2f984acb4a72dda0694b053f22 | [
"Apache-2.0"
] | null | null | null | src/testcase/GN_Y201H/input_case/GN_Y201H_Smart_Link.py | maiyajj/AutoTest_script-Appium_Connect | f9c2c42c281a9e2f984acb4a72dda0694b053f22 | [
"Apache-2.0"
] | 23 | 2017-08-22T06:12:19.000Z | 2021-09-18T05:45:41.000Z | # coding=utf-8
try:
from src.testcase.GN_Y201H.case.GN_Y201H_SMART_LINK.GN_Y201H_SMART_LINK_001 import *
except ImportError as e:
print(e)
| 24.5 | 88 | 0.77551 | # coding=utf-8
try:
from src.testcase.GN_Y201H.case.GN_Y201H_SMART_LINK.GN_Y201H_SMART_LINK_001 import *
except ImportError as e:
print(e)
| 0 | 0 | 0 |
35c2a2b8c0988124e2ad7496f66286e5e4b24a30 | 622 | py | Python | validate.py | goord/xios-grib-compare | 28e51d1340a8a30e63252aeed07d490770cea6be | [
"Apache-2.0"
] | null | null | null | validate.py | goord/xios-grib-compare | 28e51d1340a8a30e63252aeed07d490770cea6be | [
"Apache-2.0"
] | null | null | null | validate.py | goord/xios-grib-compare | 28e51d1340a8a30e63252aeed07d490770cea6be | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import argparse
import complib
if __name__ == "__main__":
main()
| 24.88 | 118 | 0.665595 | #!/usr/bin/env python
import argparse
import complib
def main(args=None):
if args is None:
pass
parser = argparse.ArgumentParser(description="Automatic comparison IFS GRIB and XIOS NetCDF output")
parser.add_argument("--grb", required=True, type=str, metavar="FILE", help="IFS output grib files (... | 503 | 0 | 23 |
20cb302b8b180db47f4ae76c8a3526731a431ce3 | 943 | py | Python | dumbledore/server.py | mashrikt/grpc-microservices | b5812cdb96b222713ace2c0e3cbc69b3e5708e51 | [
"MIT"
] | null | null | null | dumbledore/server.py | mashrikt/grpc-microservices | b5812cdb96b222713ace2c0e3cbc69b3e5708e51 | [
"MIT"
] | null | null | null | dumbledore/server.py | mashrikt/grpc-microservices | b5812cdb96b222713ace2c0e3cbc69b3e5708e51 | [
"MIT"
] | null | null | null | from concurrent import futures
import logging
import csv
import grpc
import meter_usage_pb2
import meter_usage_pb2_grpc
if __name__ == '__main__':
logging.basicConfig()
serve()
| 26.194444 | 79 | 0.660657 | from concurrent import futures
import logging
import csv
import grpc
import meter_usage_pb2
import meter_usage_pb2_grpc
class MeterUsage(meter_usage_pb2_grpc.MeterUsage):
def ListUsages(self, request, context):
response_data = []
with open('meterusage.csv', 'r') as read_obj:
next(rea... | 651 | 29 | 73 |
f4667ce36e667681468c5868884829de284b6f4c | 668 | py | Python | tests/test_day17.py | emauton/aoc2015 | f321571b623a0e7acaa173be57506e64bd32765f | [
"MIT"
] | null | null | null | tests/test_day17.py | emauton/aoc2015 | f321571b623a0e7acaa173be57506e64bd32765f | [
"MIT"
] | null | null | null | tests/test_day17.py | emauton/aoc2015 | f321571b623a0e7acaa173be57506e64bd32765f | [
"MIT"
] | null | null | null | from aoc2015.day17 import packings, minimal_packings
| 29.043478 | 52 | 0.449102 | from aoc2015.day17 import packings, minimal_packings
def test_packings():
containers = [20, 15, 10, 5, 5]
solutions = list(packings(containers, 25))
assert sorted(solutions) == sorted([(15, 10),
(20, 5),
(20, 5),
... | 567 | 0 | 46 |
cf0179ee6562ea0d063f80d0b0f2b70dfff2c83a | 1,279 | py | Python | wm_metrics/fdc/indicator.py | Commonists/wm_metrics | 4837861fa8a17b13618d701cddef9c3ef199ea96 | [
"MIT"
] | 3 | 2015-06-29T21:17:22.000Z | 2016-01-22T11:39:52.000Z | wm_metrics/fdc/indicator.py | Commonists/wm_metrics | 4837861fa8a17b13618d701cddef9c3ef199ea96 | [
"MIT"
] | 9 | 2015-02-09T07:42:44.000Z | 2018-06-16T12:57:00.000Z | wm_metrics/fdc/indicator.py | Commonists/wm_metrics | 4837861fa8a17b13618d701cddef9c3ef199ea96 | [
"MIT"
] | 4 | 2015-07-02T23:17:39.000Z | 2020-09-10T08:18:47.000Z | """Indicator model."""
class Indicator(object):
"""Indicator for FDC report.
Indicator for FDC reports have values for Q1, Q2, Q3, Q4 or/and a value.
it allows to follow the evolution of an indicator during the quarters and have its final value
or to follow an indicator with only a single value.
... | 36.542857 | 98 | 0.591087 | """Indicator model."""
class Indicator(object):
"""Indicator for FDC report.
Indicator for FDC reports have values for Q1, Q2, Q3, Q4 or/and a value.
it allows to follow the evolution of an indicator during the quarters and have its final value
or to follow an indicator with only a single value.
... | 0 | 0 | 0 |
5bd03e81670ac13c04e16816e61ae996a75620ba | 2,026 | py | Python | easypypi/shared_functions.py | JayKayAce/easypypi | 23109bf8c4fce9c91667ade437c6431eb6132ddc | [
"MIT"
] | null | null | null | easypypi/shared_functions.py | JayKayAce/easypypi | 23109bf8c4fce9c91667ade437c6431eb6132ddc | [
"MIT"
] | null | null | null | easypypi/shared_functions.py | JayKayAce/easypypi | 23109bf8c4fce9c91667ade437c6431eb6132ddc | [
"MIT"
] | null | null | null | """
Functions shared by easypypi.py and licenses.py
Check: Separate file required to avoid circular import?
"""
import os
def create_file(filepath, content, **kwargs):
"""
Create a new file using writelines, and backup if filepath==setup.py.
Returns "file exists" if filepath already exists and overwrite ... | 39.72549 | 101 | 0.579467 | """
Functions shared by easypypi.py and licenses.py
Check: Separate file required to avoid circular import?
"""
import os
def create_file(filepath, content, **kwargs):
"""
Create a new file using writelines, and backup if filepath==setup.py.
Returns "file exists" if filepath already exists and overwrite ... | 0 | 0 | 0 |
8c0b36bc0176569b3857bd5837fb2987cf54269f | 2,875 | py | Python | ToDo-GUI/todo.py | Aayush-hub/Amazing-Python-Scripts | 5488454b16fa969d32ad7a56618e62e64291c052 | [
"MIT"
] | 3 | 2021-01-14T13:54:22.000Z | 2021-11-15T11:26:51.000Z | ToDo-GUI/todo.py | Aayush-hub/Amazing-Python-Scripts | 5488454b16fa969d32ad7a56618e62e64291c052 | [
"MIT"
] | 1 | 2021-01-26T02:12:47.000Z | 2021-01-26T02:12:47.000Z | ToDo-GUI/todo.py | Aayush-hub/Amazing-Python-Scripts | 5488454b16fa969d32ad7a56618e62e64291c052 | [
"MIT"
] | null | null | null | '''ToDo List GUI'''
import tkinter
from tkinter import END,ANCHOR
count=0
'''Defining root window'''
root=tkinter.Tk()
root.title('ToDo-GUI')
root.iconbitmap('todo.ico')
root.geometry('400x400')
root.resizable(0,0)
'''Define fonts and colors'''
my_font=('Times New Roman',12)
root_color='green'
button_color='#e2cff4... | 28.186275 | 130 | 0.72 | '''ToDo List GUI'''
import tkinter
from tkinter import END,ANCHOR
count=0
'''Defining root window'''
root=tkinter.Tk()
root.title('ToDo-GUI')
root.iconbitmap('todo.ico')
root.geometry('400x400')
root.resizable(0,0)
'''Define fonts and colors'''
my_font=('Times New Roman',12)
root_color='green'
button_color='#e2cff4... | 615 | 0 | 114 |
5918a6f4139b12cc844271ffd363f2ab46161537 | 566 | py | Python | examples/sanic_example.py | Hanaasagi/throttle | c80aa6266e36f8ff0b99fbedac1c4e28e305f91d | [
"MIT"
] | null | null | null | examples/sanic_example.py | Hanaasagi/throttle | c80aa6266e36f8ff0b99fbedac1c4e28e305f91d | [
"MIT"
] | null | null | null | examples/sanic_example.py | Hanaasagi/throttle | c80aa6266e36f8ff0b99fbedac1c4e28e305f91d | [
"MIT"
] | null | null | null | from sanic import Sanic
from sanic.response import json, text
from throttle import AsyncThrottle
from throttle.storage import RedisStorage
app = Sanic()
@app.route("/")
@AsyncThrottle("5/m", "request.remote_addr",
callback=lambda *args, **kwargs:
text('tirgger the throttle', status... | 25.727273 | 60 | 0.611307 | from sanic import Sanic
from sanic.response import json, text
from throttle import AsyncThrottle
from throttle.storage import RedisStorage
app = Sanic()
@app.route("/")
@AsyncThrottle("5/m", "request.remote_addr",
callback=lambda *args, **kwargs:
text('tirgger the throttle', status... | 39 | 0 | 22 |
54c2080e5645618306574034c2f0f322d70362eb | 1,573 | py | Python | mergedataset.py | yecfly/DEPRESSIONEST | 21b72906aac9f310e264f7a5eea348480a647197 | [
"Unlicense"
] | null | null | null | mergedataset.py | yecfly/DEPRESSIONEST | 21b72906aac9f310e264f7a5eea348480a647197 | [
"Unlicense"
] | null | null | null | mergedataset.py | yecfly/DEPRESSIONEST | 21b72906aac9f310e264f7a5eea348480a647197 | [
"Unlicense"
] | null | null | null | import os, pickle, time, sys, traceback
import DataSetPrepare as DSP
datalist=[]
#dfile='./Datasets/D10_CKplus_10groups_groupedbythe_CKplus-group-details_preprocessdata_with_calibRotation_rescaleimg_geometricfeatures_facepatches_weberface_skip-contempV2.pkl'
#datalist.append(dfile)
#dfile='./Datasets/D33_KDEF_10... | 43.694444 | 178 | 0.830896 | import os, pickle, time, sys, traceback
import DataSetPrepare as DSP
datalist=[]
#dfile='./Datasets/D10_CKplus_10groups_groupedbythe_CKplus-group-details_preprocessdata_with_calibRotation_rescaleimg_geometricfeatures_facepatches_weberface_skip-contempV2.pkl'
#datalist.append(dfile)
#dfile='./Datasets/D33_KDEF_10... | 0 | 0 | 0 |
637b1a66ab7ccaa84634ce06e0fafc07547a4c82 | 695 | py | Python | tests.py | GitHistoryDigger/multibranch | 9eb9d80f358538df8c43eb986b3c7b7047be8756 | [
"MIT"
] | null | null | null | tests.py | GitHistoryDigger/multibranch | 9eb9d80f358538df8c43eb986b3c7b7047be8756 | [
"MIT"
] | null | null | null | tests.py | GitHistoryDigger/multibranch | 9eb9d80f358538df8c43eb986b3c7b7047be8756 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The tests."""
from unittest import TestCase
from fzbz import FizzBuzz
class FzBzTest(TestCase):
"""Fizz Buzz Test."""
def setUp(self):
"""Setup."""
self.obj = FizzBuzz()
def test_num(self):
"""The return value should be based of F... | 26.730769 | 68 | 0.471942 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The tests."""
from unittest import TestCase
from fzbz import FizzBuzz
class FzBzTest(TestCase):
"""Fizz Buzz Test."""
def setUp(self):
"""Setup."""
self.obj = FizzBuzz()
def test_num(self):
"""The return value should be based of F... | 0 | 0 | 0 |
7cbed2da338d7fbd8abddd673accd3d3819c36d7 | 8,007 | py | Python | firexkit/chain.py | FireXStuff/firexk | e00907691bdfd39981dd7c10314972241f759ee1 | [
"BSD-3-Clause"
] | 3 | 2019-01-11T22:58:14.000Z | 2019-09-17T18:18:16.000Z | firexkit/chain.py | FireXStuff/firexk | e00907691bdfd39981dd7c10314972241f759ee1 | [
"BSD-3-Clause"
] | 4 | 2019-02-07T21:07:56.000Z | 2022-01-06T22:33:34.000Z | firexkit/chain.py | FireXStuff/firexkit | e00907691bdfd39981dd7c10314972241f759ee1 | [
"BSD-3-Clause"
] | null | null | null | import inspect
from inspect import signature, getfullargspec
from functools import wraps
from typing import Union
from celery.canvas import chain, Signature
from celery.local import PromiseProxy
from celery.result import AsyncResult
from celery.utils.log import get_task_logger
from firexkit.result import wait_on_asyn... | 34.965066 | 114 | 0.659548 | import inspect
from inspect import signature, getfullargspec
from functools import wraps
from typing import Union
from celery.canvas import chain, Signature
from celery.local import PromiseProxy
from celery.result import AsyncResult
from celery.utils.log import get_task_logger
from firexkit.result import wait_on_asyn... | 2,718 | 26 | 271 |
02d4055328774f4b18373ca4cc802f8e80a90b34 | 6,366 | py | Python | src/tweetengine/model.py | Arachnid/tweetengine | 2e111a8cfb5316c868f644a10536e25edca9a179 | [
"Apache-2.0"
] | 2 | 2017-09-03T20:55:23.000Z | 2020-05-31T17:07:57.000Z | src/tweetengine/model.py | Arachnid/tweetengine | 2e111a8cfb5316c868f644a10536e25edca9a179 | [
"Apache-2.0"
] | null | null | null | src/tweetengine/model.py | Arachnid/tweetengine | 2e111a8cfb5316c868f644a10536e25edca9a179 | [
"Apache-2.0"
] | null | null | null | import datetime
import time
from google.appengine.api import urlfetch
from google.appengine.api.labs import taskqueue
from google.appengine.ext import db
from google.appengine.ext.db import polymodel
from tweetengine import oauth
from tweetengine.i18n import _
ROLE_ANYONE = 0
ROLE_USER = 1
ROLE_ADMINISTRATOR = 2
R... | 32.151515 | 84 | 0.635407 | import datetime
import time
from google.appengine.api import urlfetch
from google.appengine.api.labs import taskqueue
from google.appengine.ext import db
from google.appengine.ext.db import polymodel
from tweetengine import oauth
from tweetengine.i18n import _
class UserAccount(polymodel.PolyModel):
def get_usern... | 3,389 | 2,282 | 210 |
d3db459d0a2ed54062bd6a03184579f6b9684a06 | 5,943 | py | Python | tools/utilities/pythonlibs/audio/training/make_training_list.py | dashesy/ELL | b4a2b852fc0479d8f0854b1133ee324e14c66bf8 | [
"MIT"
] | null | null | null | tools/utilities/pythonlibs/audio/training/make_training_list.py | dashesy/ELL | b4a2b852fc0479d8f0854b1133ee324e14c66bf8 | [
"MIT"
] | null | null | null | tools/utilities/pythonlibs/audio/training/make_training_list.py | dashesy/ELL | b4a2b852fc0479d8f0854b1133ee324e14c66bf8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
###################################################################################################
#
# Project: Embedded Learning Library (ELL)
# File: make_training_list.py
# Authors: Chris Lovett
#
# Requires: Python 3.x
#
#############################################################... | 34.352601 | 117 | 0.604913 | #!/usr/bin/env python3
###################################################################################################
#
# Project: Embedded Learning Library (ELL)
# File: make_training_list.py
# Authors: Chris Lovett
#
# Requires: Python 3.x
#
#############################################################... | 1,005 | 0 | 115 |
9065db250c8ed5f5e06d1a4881dfa2624929cdfc | 27,792 | py | Python | tests/opencl/test_update_statuses_kernel.py | manluow/RAMP-UA | 45ddd280b16c81c42431a61121a8e0cdb941c4f4 | [
"MIT"
] | null | null | null | tests/opencl/test_update_statuses_kernel.py | manluow/RAMP-UA | 45ddd280b16c81c42431a61121a8e0cdb941c4f4 | [
"MIT"
] | null | null | null | tests/opencl/test_update_statuses_kernel.py | manluow/RAMP-UA | 45ddd280b16c81c42431a61121a8e0cdb941c4f4 | [
"MIT"
] | null | null | null | import numpy as np
from matplotlib import pyplot as plt
import scipy.stats
from microsim.opencl.ramp.params import Params
from microsim.opencl.ramp.simulator import Simulator
from microsim.opencl.ramp.snapshot import Snapshot
from microsim.opencl.ramp.disease_statuses import DiseaseStatus
nplaces = 8
npeople = 50000
n... | 43.222395 | 112 | 0.787457 | import numpy as np
from matplotlib import pyplot as plt
import scipy.stats
from microsim.opencl.ramp.params import Params
from microsim.opencl.ramp.simulator import Simulator
from microsim.opencl.ramp.snapshot import Snapshot
from microsim.opencl.ramp.disease_statuses import DiseaseStatus
nplaces = 8
npeople = 50000
n... | 27,126 | 0 | 322 |
8034452f95fd18ccdac09ca778179ad9c4e7fbce | 3,474 | py | Python | chef_validator/tests/unit/clients/test_glance_client.py | ging/fi-ware-chef_validator | eaeb72801f3f2dba7f933740b033687dcb02e5c8 | [
"Apache-2.0"
] | 1 | 2015-08-27T08:49:28.000Z | 2015-08-27T08:49:28.000Z | chef_validator/tests/unit/clients/test_glance_client.py | ging/fiware-chef_validator | eaeb72801f3f2dba7f933740b033687dcb02e5c8 | [
"Apache-2.0"
] | null | null | null | chef_validator/tests/unit/clients/test_glance_client.py | ging/fiware-chef_validator | eaeb72801f3f2dba7f933740b033687dcb02e5c8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# 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 ... | 38.175824 | 76 | 0.681635 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# 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 ... | 0 | 0 | 0 |
e20b6ca1ff328d0294cf0c005e0d57809d34ef75 | 10,494 | py | Python | osint/seek-leak/seek-leak.py | skateforever/pentest-scripts | 7adc08af2bdf4801bc20a0c6f578cc8a417b2712 | [
"MIT"
] | 18 | 2020-06-03T02:06:43.000Z | 2022-03-22T01:29:09.000Z | osint/seek-leak/seek-leak.py | skateforever/pentest-scripts | 7adc08af2bdf4801bc20a0c6f578cc8a417b2712 | [
"MIT"
] | 11 | 2020-03-16T22:27:45.000Z | 2021-12-15T10:03:03.000Z | osint/seek-leak/seek-leak.py | skateforever/pentest-scripts | 7adc08af2bdf4801bc20a0c6f578cc8a417b2712 | [
"MIT"
] | 6 | 2020-07-11T19:37:06.000Z | 2022-03-28T13:42:56.000Z | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import os
import re
import socket
import sys
# Colors
from argparse import Namespace
green = '\033[32m'
red = '\033[31m'
reset = '\033[0m'
yellow = '\033[33m'
banner = """
██████ ▓█████ ▓█████ ██ ▄█▀ ██▓ ▓█████ ▄▄▄ ██ ▄█▀
▒██ ▒ ▓█ ▀ ▓█ ... | 49.037383 | 102 | 0.487993 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import os
import re
import socket
import sys
# Colors
from argparse import Namespace
green = '\033[32m'
red = '\033[31m'
reset = '\033[0m'
yellow = '\033[33m'
banner = """
██████ ▓█████ ▓█████ ██ ▄█▀ ██▓ ▓█████ ▄▄▄ ██ ▄█▀
▒██ ▒ ▓█ ▀ ▓█ ... | 8,876 | 0 | 23 |
1394d09693b613c70face0e83170631b221b95ff | 18,746 | py | Python | surface_distance/lookup_tables.py | taznux/surface-distance | 6225355f2a6111479d39ce8260a9db3d506c11b6 | [
"Apache-2.0"
] | 3 | 2022-01-18T19:25:46.000Z | 2022-02-05T18:53:24.000Z | surface_distance/lookup_tables.py | taznux/surface-distance | 6225355f2a6111479d39ce8260a9db3d506c11b6 | [
"Apache-2.0"
] | null | null | null | surface_distance/lookup_tables.py | taznux/surface-distance | 6225355f2a6111479d39ce8260a9db3d506c11b6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 66.007042 | 101 | 0.428998 | # Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 0 | 0 | 0 |
facce2690a51d8bb88db15bf7b483d978bb4ab36 | 5,434 | py | Python | keras_tuner.py | newcodevelop/DL-Adventures | 76d4fcaf7c7b53cb1a2241a03d6d32bcd4406e92 | [
"MIT"
] | null | null | null | keras_tuner.py | newcodevelop/DL-Adventures | 76d4fcaf7c7b53cb1a2241a03d6d32bcd4406e92 | [
"MIT"
] | null | null | null | keras_tuner.py | newcodevelop/DL-Adventures | 76d4fcaf7c7b53cb1a2241a03d6d32bcd4406e92 | [
"MIT"
] | 1 | 2020-08-04T15:22:37.000Z | 2020-08-04T15:22:37.000Z | # -*- coding: utf-8 -*-
!pip uninstall tensorflow
!pip install tensorflow-gpu==2.0.0
!pip install keras-tuner==1.0.0 --no-dependencies
!pip install terminaltables colorama
import tensorflow as tf
import kerastuner as kt
import matplotlib.pyplot as plt
(train_images, train_labels), (test_images, test_labels) =\
... | 31.593023 | 100 | 0.647957 | # -*- coding: utf-8 -*-
!pip uninstall tensorflow
!pip install tensorflow-gpu==2.0.0
!pip install keras-tuner==1.0.0 --no-dependencies
!pip install terminaltables colorama
import tensorflow as tf
import kerastuner as kt
import matplotlib.pyplot as plt
(train_images, train_labels), (test_images, test_labels) =\
... | 3,210 | 77 | 299 |
79c92f9c2d73536cf58ec055fd4f77c5b661cbba | 2,056 | py | Python | src/preprocessing/config.py | varunnathan/NLP | 4183fed8105c6986d2471fc87129054e7a47d0f8 | [
"MIT"
] | null | null | null | src/preprocessing/config.py | varunnathan/NLP | 4183fed8105c6986d2471fc87129054e7a47d0f8 | [
"MIT"
] | null | null | null | src/preprocessing/config.py | varunnathan/NLP | 4183fed8105c6986d2471fc87129054e7a47d0f8 | [
"MIT"
] | null | null | null | LOCAL_DATA_ROOT = '/Users/varunn/Documents/projects/Sentence_Embeddings/'
INP_PATH = LOCAL_DATA_ROOT + 'raw_data/'
INT_PATH = LOCAL_DATA_ROOT + 'inter_data/'
PRE_PATH = LOCAL_DATA_ROOT + 'preprocessed_data/'
MODEL_PATH = LOCAL_DATA_ROOT + 'modelling/'
RESULTS_PATH = LOCAL_DATA_ROOT + 'results/'
INP_TICKETS_FN = INP_PAT... | 28.957746 | 81 | 0.718385 | LOCAL_DATA_ROOT = '/Users/varunn/Documents/projects/Sentence_Embeddings/'
INP_PATH = LOCAL_DATA_ROOT + 'raw_data/'
INT_PATH = LOCAL_DATA_ROOT + 'inter_data/'
PRE_PATH = LOCAL_DATA_ROOT + 'preprocessed_data/'
MODEL_PATH = LOCAL_DATA_ROOT + 'modelling/'
RESULTS_PATH = LOCAL_DATA_ROOT + 'results/'
INP_TICKETS_FN = INP_PAT... | 0 | 0 | 0 |
b925f16e10230bea2c43f15d825d3146909e7b2c | 16,094 | py | Python | pse/dm_control/utils/env_utils.py | pedersor/google-research | 6fa751dd261b3f6d918fd2cd35efef5d8bf3eea6 | [
"Apache-2.0"
] | null | null | null | pse/dm_control/utils/env_utils.py | pedersor/google-research | 6fa751dd261b3f6d918fd2cd35efef5d8bf3eea6 | [
"Apache-2.0"
] | null | null | null | pse/dm_control/utils/env_utils.py | pedersor/google-research | 6fa751dd261b3f6d918fd2cd35efef5d8bf3eea6 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | 35.844098 | 80 | 0.739095 | # coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | 1,893 | 0 | 50 |
0e9bb0d47c6df249c7d70ec86c2ef9cb3a6ebbb5 | 3,328 | py | Python | ad-joining/register-computer/kerberos/password.py | jeremyje/gce-automated-ad-join | 28c1ef58fedb18752683c3f61bf6fa06cc5892f4 | [
"Apache-2.0"
] | 4 | 2020-01-30T09:45:57.000Z | 2021-10-09T03:09:01.000Z | ad-joining/register-computer/kerberos/password.py | jeremyje/gce-automated-ad-join | 28c1ef58fedb18752683c3f61bf6fa06cc5892f4 | [
"Apache-2.0"
] | 16 | 2020-07-30T14:50:56.000Z | 2022-01-11T17:24:25.000Z | ad-joining/register-computer/kerberos/password.py | jeremyje/gce-automated-ad-join | 28c1ef58fedb18752683c3f61bf6fa06cc5892f4 | [
"Apache-2.0"
] | 9 | 2020-08-06T11:58:17.000Z | 2021-10-09T03:08:51.000Z | #
# Copyright 2019 Google LLC
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 ... | 32.627451 | 132 | 0.672476 | #
# Copyright 2019 Google LLC
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 ... | 2,208 | 142 | 99 |
d975243f07d914c6bdc558254af84a6224c99789 | 1,185 | py | Python | elpis/test/test_model.py | guillaume-wisniewski/elpis | 550c350fd0098751b9a502a253bc4066f15c47db | [
"Apache-2.0"
] | 118 | 2018-11-25T22:00:11.000Z | 2022-03-18T10:18:33.000Z | elpis/test/test_model.py | guillaume-wisniewski/elpis | 550c350fd0098751b9a502a253bc4066f15c47db | [
"Apache-2.0"
] | 189 | 2019-01-25T01:37:59.000Z | 2022-02-16T02:31:23.000Z | elpis/test/test_model.py | guillaume-wisniewski/elpis | 550c350fd0098751b9a502a253bc4066f15c47db | [
"Apache-2.0"
] | 34 | 2018-11-28T20:31:38.000Z | 2022-01-27T12:20:59.000Z | import pytest
from elpis.wrappers.objects.interface import KaldiInterface
@pytest.fixture
def pipeline_upto_step_1(tmpdir):
"""
PyTest Fixture: returns a pipeline that executes once per session up to step 1.
"""
# Step 0
# ======
# Create a Kaldi interface directory (where all the associated ... | 25.76087 | 95 | 0.674262 | import pytest
from elpis.wrappers.objects.interface import KaldiInterface
@pytest.fixture
def pipeline_upto_step_1(tmpdir):
"""
PyTest Fixture: returns a pipeline that executes once per session up to step 1.
"""
# Step 0
# ======
# Create a Kaldi interface directory (where all the associated ... | 0 | 0 | 0 |
a58cb61b6e17fac902f8b9a24179ad124c17833e | 24 | py | Python | datathief/__init__.py | sciris/datathief | d2790f74468a78b3c1198cabfb8641d3aee81808 | [
"MIT"
] | null | null | null | datathief/__init__.py | sciris/datathief | d2790f74468a78b3c1198cabfb8641d3aee81808 | [
"MIT"
] | 1 | 2020-12-13T18:56:13.000Z | 2020-12-15T07:58:22.000Z | datathief/__init__.py | sciris/datathief | d2790f74468a78b3c1198cabfb8641d3aee81808 | [
"MIT"
] | null | null | null | from .datathief import * | 24 | 24 | 0.791667 | from .datathief import * | 0 | 0 | 0 |
366b38c3b778f81d2b1774b20dd1eb950f229b52 | 1,379 | py | Python | member_manager/tests/availability.py | 4sfc/django-member-manager | b9ad955786b6ac7253f0d07d8784ff5b5d3371f8 | [
"MIT"
] | null | null | null | member_manager/tests/availability.py | 4sfc/django-member-manager | b9ad955786b6ac7253f0d07d8784ff5b5d3371f8 | [
"MIT"
] | 21 | 2020-07-29T18:43:23.000Z | 2020-10-23T02:46:07.000Z | member_manager/tests/availability.py | 4sfc/django-member-manager | b9ad955786b6ac7253f0d07d8784ff5b5d3371f8 | [
"MIT"
] | null | null | null | """AvailabilityTest class"""
from django.contrib.auth.models import User
from django.test import TestCase
from member_manager.models import Availability
from member_manager.models import Profile
class AvailabilityTest(TestCase):
"""Test Availability model"""
@classmethod
def test_str(self):
""... | 41.787879 | 77 | 0.478608 | """AvailabilityTest class"""
from django.contrib.auth.models import User
from django.test import TestCase
from member_manager.models import Availability
from member_manager.models import Profile
class AvailabilityTest(TestCase):
"""Test Availability model"""
@classmethod
def setUpTestData(cls):
... | 509 | 0 | 26 |
419fd05fe1c60f9a3396a7634f44c4ad51453e94 | 16,494 | py | Python | tests/film_model.py | BaptisteLefebvre/pyalp | 05cb8ff9e66f95ed9c70a8ab8a91c78794f7350a | [
"MIT"
] | 1 | 2020-11-09T09:23:11.000Z | 2020-11-09T09:23:11.000Z | tests/film_model.py | BaptisteLefebvre/pyalp | 05cb8ff9e66f95ed9c70a8ab8a91c78794f7350a | [
"MIT"
] | null | null | null | tests/film_model.py | BaptisteLefebvre/pyalp | 05cb8ff9e66f95ed9c70a8ab8a91c78794f7350a | [
"MIT"
] | 1 | 2020-11-09T09:23:19.000Z | 2020-11-09T09:23:19.000Z | # /* BitCompression
# This sample is provided as-is, without any warranty.
#
# (c) 2007 ViALUX GmbH. All rights reserved.
# */
#
# // BlackWhiteSample.cpp : Defines the entry point for the console application.
# //
#
# #include <TCHAR.h>
# #include <windows.h>
# #include <conio.h>
# #include <stdio.h>
# #include <stdli... | 28.05102 | 159 | 0.587789 | # /* BitCompression
# This sample is provided as-is, without any warranty.
#
# (c) 2007 ViALUX GmbH. All rights reserved.
# */
#
# // BlackWhiteSample.cpp : Defines the entry point for the console application.
# //
#
# #include <TCHAR.h>
# #include <windows.h>
# #include <conio.h>
# #include <stdio.h>
# #include <stdli... | 0 | 0 | 0 |
16c038ca9e1bb6afd758d6fec4f738a2eedd0e7b | 1,128 | py | Python | KartAI/Controls.py | eritzyg/KartAI | 5c49ca29148aea19f80d6635b0799d0d32b9c053 | [
"MIT"
] | 10 | 2017-10-18T21:20:16.000Z | 2020-04-07T17:02:55.000Z | KartAI/Controls.py | Garnica1999/Self-Driving-Car-Reinforcement-Learning | f7f5d2e7ce912f708a1c82fb40bb0d8b645ecb8a | [
"MIT"
] | null | null | null | KartAI/Controls.py | Garnica1999/Self-Driving-Car-Reinforcement-Learning | f7f5d2e7ce912f708a1c82fb40bb0d8b645ecb8a | [
"MIT"
] | 5 | 2017-10-18T21:12:27.000Z | 2020-04-17T08:44:57.000Z | # KartAI https://github.com/eritzyg/KartAI/
# Copyright (c) 2017 Eritz Yerga Gutierrez and Iker García Ferrero
# MIT License https://github.com/eritzyg/KartAI/blob/master/LICENSE
import Global as glv
import Player as player
import TrackManager as tm
import Timer as timer
import Points as points | 26.857143 | 67 | 0.653369 | # KartAI https://github.com/eritzyg/KartAI/
# Copyright (c) 2017 Eritz Yerga Gutierrez and Iker García Ferrero
# MIT License https://github.com/eritzyg/KartAI/blob/master/LICENSE
import Global as glv
import Player as player
import TrackManager as tm
import Timer as timer
import Points as points
def turnLeft():
if... | 705 | 0 | 127 |
045b5d6e14d47c33554f39fd440f545aac334083 | 6,213 | py | Python | test.py | ChetWei/yolov3_pytorch | bfdac113c8c458790bff48466df1a6d662e3bd41 | [
"MIT"
] | 1 | 2021-12-17T14:34:13.000Z | 2021-12-17T14:34:13.000Z | test.py | ChetWei/yolov3_pytorch | bfdac113c8c458790bff48466df1a6d662e3bd41 | [
"MIT"
] | null | null | null | test.py | ChetWei/yolov3_pytorch | bfdac113c8c458790bff48466df1a6d662e3bd41 | [
"MIT"
] | 1 | 2021-12-17T14:34:15.000Z | 2021-12-17T14:34:15.000Z | # -*- coding: utf-8 -*-
import argparse
import tqdm
import torch
from torch.utils.data import DataLoader
from torch.autograd import Variable
import numpy as np
import yaml
from terminaltables import AsciiTable
from models.Yolo3Body import YOLOV3
from utils.util import xywh2xyxy, non_max_suppression, get_batch_stat... | 36.333333 | 117 | 0.68067 | # -*- coding: utf-8 -*-
import argparse
import tqdm
import torch
from torch.utils.data import DataLoader
from torch.autograd import Variable
import numpy as np
import yaml
from terminaltables import AsciiTable
from models.Yolo3Body import YOLOV3
from utils.util import xywh2xyxy, non_max_suppression, get_batch_stat... | 3,733 | 0 | 67 |
9ae544722a4952573427811c9f33c38828daf98f | 7,250 | py | Python | functions/todo.py | knightelvis/teambot | fc25f528b51ee820b572c73bb978ba32cbf60876 | [
"BSD-2-Clause"
] | null | null | null | functions/todo.py | knightelvis/teambot | fc25f528b51ee820b572c73bb978ba32cbf60876 | [
"BSD-2-Clause"
] | null | null | null | functions/todo.py | knightelvis/teambot | fc25f528b51ee820b572c73bb978ba32cbf60876 | [
"BSD-2-Clause"
] | null | null | null | import datetime as dt
import random
import functions.models as models
#import sys
def create_task(from_user, from_user_id,
owner, content, priority=3):
'''
Create a task with given params.
'''
models.database.connect()
db_task = models.Task.create(from_user = from_user,
... | 27.992278 | 76 | 0.522897 | import datetime as dt
import random
import functions.models as models
#import sys
def is_valid_task_index(task_num, indices):
return all((index >= 1) and
(index <= task_num)
for index in indices)
def create_task(from_user, from_user_id,
owner, content, priority=3):
... | 2,668 | 0 | 254 |
5d29c43217d2da5336d97d31d5e11e9b2aa49314 | 1,046 | py | Python | Chapter 09/9.02_lock_demo.py | ACsBlack/Tkinter-GUI-Application-Development-Blueprints-Second-Edition | c6a045fbf5ba3ece5e8a02bbe33ac13bb57b2b8e | [
"MIT"
] | 120 | 2018-03-04T07:17:00.000Z | 2022-01-25T08:09:57.000Z | Chapter 09/9.02_lock_demo.py | ACsBlack/Tkinter-GUI-Application-Development-Blueprints-Second-Edition | c6a045fbf5ba3ece5e8a02bbe33ac13bb57b2b8e | [
"MIT"
] | 3 | 2019-03-24T09:32:43.000Z | 2020-07-28T07:35:49.000Z | Chapter 09/9.02_lock_demo.py | ACsBlack/Tkinter-GUI-Application-Development-Blueprints-Second-Edition | c6a045fbf5ba3ece5e8a02bbe33ac13bb57b2b8e | [
"MIT"
] | 81 | 2018-04-18T06:51:46.000Z | 2022-03-30T01:31:35.000Z | """
Code illustration: 9.02
Lock Demo
Tkinter GUI Application Development Blueprints
"""
import threading
if __name__ == "__main__":
for i in range(100):
LockDemo()
| 24.325581 | 72 | 0.600382 | """
Code illustration: 9.02
Lock Demo
Tkinter GUI Application Development Blueprints
"""
import threading
class LockDemo():
def __init__(self):
self.shared_var = 0
self.total_count = 100000
self.lock = threading.Lock()
self.demo_of_lock_to_avoid_race_condition()
def incr... | 735 | -4 | 131 |
4e317bb16ab4c4726c2e00a8ecc565e100aa6ca0 | 75 | py | Python | tables/shiftLeftTable.py | pangqianjin/py-des | 75330f9f74a2e66ae9882d5dbf0e34fb5a9ab414 | [
"MIT"
] | null | null | null | tables/shiftLeftTable.py | pangqianjin/py-des | 75330f9f74a2e66ae9882d5dbf0e34fb5a9ab414 | [
"MIT"
] | null | null | null | tables/shiftLeftTable.py | pangqianjin/py-des | 75330f9f74a2e66ae9882d5dbf0e34fb5a9ab414 | [
"MIT"
] | null | null | null | shiftLeftTable = [
1, 1, 2, 2, 2, 2, 2, 2,
1, 2, 2, 2, 2, 2, 2, 1
] | 18.75 | 27 | 0.4 | shiftLeftTable = [
1, 1, 2, 2, 2, 2, 2, 2,
1, 2, 2, 2, 2, 2, 2, 1
] | 0 | 0 | 0 |
fca21e622fd5b3beaa3970bb5a1cb7af43c8cad0 | 5,247 | py | Python | excel_output.py | xiaodongtidy/tools | 7555a955f65489f56e1568796c5f264cb9dff6c9 | [
"MIT"
] | null | null | null | excel_output.py | xiaodongtidy/tools | 7555a955f65489f56e1568796c5f264cb9dff6c9 | [
"MIT"
] | null | null | null | excel_output.py | xiaodongtidy/tools | 7555a955f65489f56e1568796c5f264cb9dff6c9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import io
from xlwt import *
class BaseExcelOutput:
"""
基础单表数据导出
"""
def run(self, data: [dict, dict], format_data: dict) -> bytes:
"""
:param data: example——[
{'number': '123', 'status': 1, 'is_pay': False},
... | 38.29927 | 120 | 0.515342 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import io
from xlwt import *
class BaseExcelOutput:
"""
基础单表数据导出
"""
def run(self, data: [dict, dict], format_data: dict) -> bytes:
"""
:param data: example——[
{'number': '123', 'status': 1, 'is_pay': False},
... | 2,153 | 0 | 52 |
024fcd188d62dbbe3b60066e49ecae193201d391 | 3,637 | py | Python | src/main.py | whklwhkl/CenterNet | a87f1e972528081505f89c9ede4d3bdd9aadb2ce | [
"MIT"
] | null | null | null | src/main.py | whklwhkl/CenterNet | a87f1e972528081505f89c9ede4d3bdd9aadb2ce | [
"MIT"
] | null | null | null | src/main.py | whklwhkl/CenterNet | a87f1e972528081505f89c9ede4d3bdd9aadb2ce | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import _init_paths
import os
import torch
import torch.utils.data
from opts import opts
from models.model import create_model, load_model, save_model
from logger import Logger
from datasets.dataset_factory im... | 32.473214 | 99 | 0.675832 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import _init_paths
import os
import torch
import torch.utils.data
from opts import opts
from models.model import create_model, load_model, save_model
from logger import Logger
from datasets.dataset_factory im... | 3,102 | 0 | 23 |
dc04bb9107acd8c90b00b3591f7df76c29f25f8a | 1,775 | py | Python | search/__init__.py | YangXuepei/ime-eval | e47d05e15aef9f10bf9e906f0622699fd1613db4 | [
"WTFPL"
] | null | null | null | search/__init__.py | YangXuepei/ime-eval | e47d05e15aef9f10bf9e906f0622699fd1613db4 | [
"WTFPL"
] | null | null | null | search/__init__.py | YangXuepei/ime-eval | e47d05e15aef9f10bf9e906f0622699fd1613db4 | [
"WTFPL"
] | null | null | null | # -*- coding:utf-8 -*-#
import gradient_descend_optimization as gd
import eval.eval_by_effort as ebe
import eval.layout as lyt
import time as timestamp
import process_layout as pl
#import genetic_optimization as gen
import simulated_annealing_optimization as sa
#import neural_network_optimization as nn
import sys
# p... | 29.583333 | 77 | 0.598873 | # -*- coding:utf-8 -*-#
import gradient_descend_optimization as gd
import eval.eval_by_effort as ebe
import eval.layout as lyt
import time as timestamp
import process_layout as pl
#import genetic_optimization as gen
import simulated_annealing_optimization as sa
#import neural_network_optimization as nn
import sys
# p... | 1,136 | 0 | 23 |
edc9a067daf242d5858b3b9bad7b8836b6035a7f | 195 | py | Python | lib/cfg.py | martj001/13fscrub | 1489395fd26520b146581a2a0b943b2b7e8bbe35 | [
"MIT"
] | null | null | null | lib/cfg.py | martj001/13fscrub | 1489395fd26520b146581a2a0b943b2b7e8bbe35 | [
"MIT"
] | null | null | null | lib/cfg.py | martj001/13fscrub | 1489395fd26520b146581a2a0b943b2b7e8bbe35 | [
"MIT"
] | null | null | null | URL_COMPANY_FILING_SEARCH = 'https://www.sec.gov/cgi-bin/browse-edgar?CIK=[cik]&action=getcompany'
URL_13F_QR_XML = 'https://www.sec.gov/Archives/edgar/data/[cik]/[acc_no]/form13fInfoTable.xml'
| 48.75 | 98 | 0.774359 | URL_COMPANY_FILING_SEARCH = 'https://www.sec.gov/cgi-bin/browse-edgar?CIK=[cik]&action=getcompany'
URL_13F_QR_XML = 'https://www.sec.gov/Archives/edgar/data/[cik]/[acc_no]/form13fInfoTable.xml'
| 0 | 0 | 0 |
fcf2ff018ffecdfa03c59dbf3df8d9f0456c5e07 | 8,107 | py | Python | setup.py | sergiorochalopes/oci-utils | 527db595b148762742fcc0091513e28f9de3b4ff | [
"UPL-1.0"
] | 1 | 2020-07-20T14:23:34.000Z | 2020-07-20T14:23:34.000Z | setup.py | sergiorochalopes/oci-utils | 527db595b148762742fcc0091513e28f9de3b4ff | [
"UPL-1.0"
] | null | null | null | setup.py | sergiorochalopes/oci-utils | 527db595b148762742fcc0091513e28f9de3b4ff | [
"UPL-1.0"
] | null | null | null | # Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
""" Build an rpm from oci-utils.
"""
import os
import subprocess
import sys
from distutils.core import Command
from distutils.errors import DistutilsExecError
from distutils import log
sys.path.insert(0, os.path.abspath('lib'))
try:
f... | 33.920502 | 140 | 0.543604 | # Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
""" Build an rpm from oci-utils.
"""
import os
import subprocess
import sys
from distutils.core import Command
from distutils.errors import DistutilsExecError
from distutils import log
sys.path.insert(0, os.path.abspath('lib'))
try:
f... | 769 | 378 | 23 |
69f7e6bcb279ed4d01370d81c6d619d5436c2505 | 542 | py | Python | nengo_lasagne/utils.py | Seanny123/rnn-comparison | fab64ed929e8a5838d5e82a3697e5c1bab92c664 | [
"MIT"
] | 6 | 2016-11-05T16:05:45.000Z | 2020-07-27T13:28:05.000Z | nengo_lasagne/utils.py | Seanny123/rnn-comparison | fab64ed929e8a5838d5e82a3697e5c1bab92c664 | [
"MIT"
] | null | null | null | nengo_lasagne/utils.py | Seanny123/rnn-comparison | fab64ed929e8a5838d5e82a3697e5c1bab92c664 | [
"MIT"
] | 1 | 2019-11-19T05:21:40.000Z | 2019-11-19T05:21:40.000Z | import nengo
import numpy as np
| 24.636364 | 64 | 0.697417 | import nengo
import numpy as np
def default_config():
config = nengo.Config(nengo.Ensemble, nengo.Connection)
config[nengo.Ensemble].neuron_type = nengo.RectifiedLinear()
config[nengo.Ensemble].gain = nengo.dists.Uniform(0.9, 1.1)
config[nengo.Ensemble].bias = nengo.dists.Choice([0])
config[nengo... | 462 | 0 | 46 |