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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1b1411cce49c72236bdd9177ff371f184182f1da | 195 | py | Python | PYTHON/practice/day7_arrays.py | Web-Dev-Collaborative/DS-ALGO-OFFICIAL | 6d7195d33c28a0fe22f12231efffb39f4bf05c97 | [
"Apache-2.0"
] | 13 | 2021-03-11T00:25:22.000Z | 2022-03-19T00:19:23.000Z | PYTHON/practice/day7_arrays.py | Web-Dev-Collaborative/DS-ALGO-OFFICIAL | 6d7195d33c28a0fe22f12231efffb39f4bf05c97 | [
"Apache-2.0"
] | 162 | 2021-03-09T01:52:11.000Z | 2022-03-12T01:09:07.000Z | PYTHON/practice/day7_arrays.py | Web-Dev-Collaborative/DS-ALGO-OFFICIAL | 6d7195d33c28a0fe22f12231efffb39f4bf05c97 | [
"Apache-2.0"
] | 12 | 2021-04-26T19:43:01.000Z | 2022-01-31T08:36:29.000Z | #!/bin/python3
import sys
n = int(input().strip())
arr = [int(arr_temp) for arr_temp in input().strip().split(" ")]
arr.reverse()
arrstring = " ".join(str(e) for e in arr)
print(arrstring)
| 13.928571 | 64 | 0.641026 | #!/bin/python3
import sys
n = int(input().strip())
arr = [int(arr_temp) for arr_temp in input().strip().split(" ")]
arr.reverse()
arrstring = " ".join(str(e) for e in arr)
print(arrstring)
| 0 | 0 | 0 |
b85f19d29b79defa10493bdbaa4a1b237cb2a9ee | 12,282 | py | Python | tensorflow/contrib/image/python/kernel_tests/distort_image_ops_test.py | ryorda/tensorflow-viennacl | 054b515feec0a3fca4cfb1f29adbf423c9027c3a | [
"Apache-2.0"
] | 522 | 2016-06-08T02:15:50.000Z | 2022-03-02T05:30:36.000Z | tensorflow/contrib/image/python/kernel_tests/distort_image_ops_test.py | ryorda/tensorflow-viennacl | 054b515feec0a3fca4cfb1f29adbf423c9027c3a | [
"Apache-2.0"
] | 48 | 2016-07-26T00:11:55.000Z | 2022-02-23T13:36:33.000Z | tensorflow/contrib/image/python/kernel_tests/distort_image_ops_test.py | ryorda/tensorflow-viennacl | 054b515feec0a3fca4cfb1f29adbf423c9027c3a | [
"Apache-2.0"
] | 108 | 2016-06-16T15:34:05.000Z | 2022-03-12T13:23:11.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 36.230088 | 80 | 0.631168 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 8,578 | 1,664 | 364 |
95c2f07b380f0c4b8b9d19f4830a901ce4565f44 | 3,486 | py | Python | droplet.py | uggla/lab_droplet | 5fb6388e16aa84215f7329b5972a8a5b49ff9308 | [
"Apache-2.0"
] | null | null | null | droplet.py | uggla/lab_droplet | 5fb6388e16aa84215f7329b5972a8a5b49ff9308 | [
"Apache-2.0"
] | null | null | null | droplet.py | uggla/lab_droplet | 5fb6388e16aa84215f7329b5972a8a5b49ff9308 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import digitalocean
import os
import random
import sys
import time
import requests
if __name__ == "__main__":
main()
| 29.05 | 113 | 0.60786 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import digitalocean
import os
import random
import sys
import time
import requests
def wait_completion(droplet):
status = ''
actions = droplet.get_actions()
while status != 'completed':
for action in actions:
action.load()
# o... | 3,099 | 0 | 207 |
d96fb1766b3fdbe37f5f71ba68a3f3e2ccd7f180 | 5,158 | py | Python | src/batch.py | IlyaGusev/-remotion | ebff21653e0fcd30c31e1fd726821d5e89ec3f95 | [
"Apache-2.0"
] | 1 | 2019-08-09T07:53:45.000Z | 2019-08-09T07:53:45.000Z | src/batch.py | IlyaGusev/-remotion | ebff21653e0fcd30c31e1fd726821d5e89ec3f95 | [
"Apache-2.0"
] | null | null | null | src/batch.py | IlyaGusev/-remotion | ebff21653e0fcd30c31e1fd726821d5e89ec3f95 | [
"Apache-2.0"
] | null | null | null | import torch
from torch.autograd import Variable
| 43.711864 | 107 | 0.657038 | import torch
from torch.autograd import Variable
class Batch:
def __init__(self, enable_gram=True, enable_word_indices=True,
enable_char_indices=True, enable_additional=True):
self.enable_word_indices = enable_word_indices
self.enable_gram = enable_gram
self.enable_char_in... | 4,865 | -15 | 256 |
fd962f9e7ad42b09b67340105b8f90ccce386457 | 1,147 | py | Python | embedding/embedding_base.py | newbiesitl/DRL | 799211933f27400f34c32b4ab136d8b3c06b1f28 | [
"Apache-2.0"
] | null | null | null | embedding/embedding_base.py | newbiesitl/DRL | 799211933f27400f34c32b4ab136d8b3c06b1f28 | [
"Apache-2.0"
] | null | null | null | embedding/embedding_base.py | newbiesitl/DRL | 799211933f27400f34c32b4ab136d8b3c06b1f28 | [
"Apache-2.0"
] | null | null | null | from abc import ABC, abstractmethod | 19.440678 | 56 | 0.604185 | from abc import ABC, abstractmethod
class EmbeddingBase(ABC):
def __init__(self, *args, **kwargs):
pass
@abstractmethod
def get_encoder_input_shape(self, *args, **kwargs):
pass
@abstractmethod
def get_encoder_output_shape(self, *args, **kwargs):
pass
@abstractmethod
... | 446 | 643 | 23 |
2979379a733be8b57c4e99b8fbc80ddb8dd53dfe | 197 | py | Python | src/services/response.py | LeonardoHabitzreuter/oh-py | 579366627b41d8bb2e12fec7efee000f90cdc1a6 | [
"MIT"
] | null | null | null | src/services/response.py | LeonardoHabitzreuter/oh-py | 579366627b41d8bb2e12fec7efee000f90cdc1a6 | [
"MIT"
] | null | null | null | src/services/response.py | LeonardoHabitzreuter/oh-py | 579366627b41d8bb2e12fec7efee000f90cdc1a6 | [
"MIT"
] | null | null | null | from flask import jsonify | 21.888889 | 44 | 0.695431 | from flask import jsonify
class Response:
def __init__(self, data="Ok", status=200):
self.data = data
self.status = status
def toJson(self):
return jsonify(self.data), self.status | 106 | -6 | 72 |
65aa8985d3cd69459f96af819b973939e8a56f79 | 750 | py | Python | tests/s3_dataset_scanner/test_extract_datasets_from_s3_metadata.py | oslokommune/dataplatform-batch-jobs | c6f2a31d86676dae62bbdcd8822c6f9320c9aec2 | [
"MIT"
] | null | null | null | tests/s3_dataset_scanner/test_extract_datasets_from_s3_metadata.py | oslokommune/dataplatform-batch-jobs | c6f2a31d86676dae62bbdcd8822c6f9320c9aec2 | [
"MIT"
] | 2 | 2022-01-10T08:22:50.000Z | 2022-02-08T10:32:36.000Z | tests/s3_dataset_scanner/test_extract_datasets_from_s3_metadata.py | oslokommune/dataplatform-batch-jobs | c6f2a31d86676dae62bbdcd8822c6f9320c9aec2 | [
"MIT"
] | null | null | null | from datetime import date
from batch.models import DatasetOnDate
from batch.s3_dataset_scanner.extract_datasets_from_s3_metadata import (
extract_datasets_from_s3_metadata,
)
from tests.util import csv_file_to_parquet_source
| 30 | 86 | 0.734667 | from datetime import date
from batch.models import DatasetOnDate
from batch.s3_dataset_scanner.extract_datasets_from_s3_metadata import (
extract_datasets_from_s3_metadata,
)
from tests.util import csv_file_to_parquet_source
def test_extract_datasets_from_s3_metadata(test_db_session):
input_source = csv_file... | 496 | 0 | 23 |
955895afd045d781683f82efa084c45a5f4f4fe8 | 3,852 | py | Python | build/lib.win-amd64-3.8/kitconc/py_wordlist.py | ilexistools/kitconc | 695c01cef606d7b03e725b91d101ae2152f60f43 | [
"MIT"
] | 3 | 2018-07-07T00:36:10.000Z | 2021-11-21T13:49:42.000Z | build/lib.win-amd64-3.8/kitconc/py_wordlist.py | ilexistools/kitconc | 695c01cef606d7b03e725b91d101ae2152f60f43 | [
"MIT"
] | null | null | null | build/lib.win-amd64-3.8/kitconc/py_wordlist.py | ilexistools/kitconc | 695c01cef606d7b03e725b91d101ae2152f60f43 | [
"MIT"
] | 1 | 2022-02-21T10:04:48.000Z | 2022-02-21T10:04:48.000Z | # -*- coding: utf-8 -*-
# Author: jlopes@usp.br
import os
import pickle
import numpy as np
import re
| 35.666667 | 110 | 0.566978 | # -*- coding: utf-8 -*-
# Author: jlopes@usp.br
import os
import pickle
import numpy as np
import re
def load_dict(dict_path):
with open(dict_path,'rb') as fh:
d = pickle.load(fh)
return d
def save_dict(dict_d,dict_path):
with open(dict_path,'wb') as fh:
pickle.dump(dict_d,fh)
def co... | 3,638 | 0 | 99 |
ca0fd0bd727c9ca0972ec2632e4b64584db611e2 | 2,454 | py | Python | stickerfinder/telegram/callback_handlers/menu.py | fan-tom/sticker-finder | b917c99871740ec3c11511ffb0062837f57ec8d6 | [
"MIT"
] | null | null | null | stickerfinder/telegram/callback_handlers/menu.py | fan-tom/sticker-finder | b917c99871740ec3c11511ffb0062837f57ec8d6 | [
"MIT"
] | null | null | null | stickerfinder/telegram/callback_handlers/menu.py | fan-tom/sticker-finder | b917c99871740ec3c11511ffb0062837f57ec8d6 | [
"MIT"
] | null | null | null | from stickerfinder.i18n import i18n
from stickerfinder.logic.tag import handle_next
from stickerfinder.enum import TagMode
from stickerfinder.helper.display import (
get_settings_text,
get_help_text_and_keyboard,
)
from stickerfinder.telegram.keyboard import (
get_main_keyboard,
get_donation_keyboard,
... | 27.573034 | 85 | 0.706601 | from stickerfinder.i18n import i18n
from stickerfinder.logic.tag import handle_next
from stickerfinder.enum import TagMode
from stickerfinder.helper.display import (
get_settings_text,
get_help_text_and_keyboard,
)
from stickerfinder.telegram.keyboard import (
get_main_keyboard,
get_donation_keyboard,
... | 228 | 0 | 23 |
085fe9cb161cf08d62956278d903a7b9610003db | 870 | py | Python | src/whiten.py | PacktPublishing/Cleaning-Data-for-Effective-Data-Science | e1a0a12158183cdcd15bc2cc8d987a59db41a797 | [
"MIT"
] | 54 | 2021-04-09T04:29:07.000Z | 2022-03-26T03:15:21.000Z | src/whiten.py | miteng1211/Cleaning-Data-for-Effective-Data-Science | e1a0a12158183cdcd15bc2cc8d987a59db41a797 | [
"MIT"
] | 1 | 2021-05-05T20:57:36.000Z | 2021-05-05T20:57:36.000Z | src/whiten.py | miteng1211/Cleaning-Data-for-Effective-Data-Science | e1a0a12158183cdcd15bc2cc8d987a59db41a797 | [
"MIT"
] | 32 | 2021-04-13T19:52:08.000Z | 2022-02-27T15:12:31.000Z | import numpy as np
import matplotlib.pyplot as plt
data = make_data(angle=-np.pi/4)
| 22.894737 | 58 | 0.562069 | import numpy as np
import matplotlib.pyplot as plt
def cart2pol(x, y):
rho = np.sqrt(x**2 + y**2)
phi = np.arctan2(y, x)
return rho, phi
def pol2cart(rho, phi):
x = rho * np.cos(phi)
y = rho * np.sin(phi)
return x, y
def rotate(x, y, angle=-np.pi/4):
rho, phi = cart2pol(x, y)
phi += a... | 666 | 0 | 119 |
3aad77cd13312174e8a2573277301c981e0c635e | 795 | py | Python | setup.py | david-luk4s/pandabase | 422d4c39b39dbf507efabff70163bae9f657d821 | [
"MIT"
] | 27 | 2019-09-11T18:54:13.000Z | 2021-05-25T12:43:45.000Z | setup.py | david-luk4s/pandabase | 422d4c39b39dbf507efabff70163bae9f657d821 | [
"MIT"
] | 9 | 2019-10-28T06:36:36.000Z | 2020-09-12T04:56:27.000Z | setup.py | david-luk4s/pandabase | 422d4c39b39dbf507efabff70163bae9f657d821 | [
"MIT"
] | 6 | 2019-09-17T16:22:30.000Z | 2021-06-17T08:53:07.000Z | from setuptools import setup
with open("README.md", "r") as readme:
long_description = readme.read()
setup(
version='0.5.0',
author='Sam Beck',
author_email='notsambeck@gmail.com',
name='pandabase',
packages=['pandabase'],
description="pandabase links pandas DataFrames to SQL databases. Up... | 29.444444 | 110 | 0.63522 | from setuptools import setup
with open("README.md", "r") as readme:
long_description = readme.read()
setup(
version='0.5.0',
author='Sam Beck',
author_email='notsambeck@gmail.com',
name='pandabase',
packages=['pandabase'],
description="pandabase links pandas DataFrames to SQL databases. Up... | 0 | 0 | 0 |
78f9f5591e4633016e6b644429d34f17d234a397 | 25,594 | py | Python | will/backends/io_adapters/slack.py | peterstarback/will | 949f9c821578865d08a907e5937e94a5e8a9a6db | [
"MIT"
] | null | null | null | will/backends/io_adapters/slack.py | peterstarback/will | 949f9c821578865d08a907e5937e94a5e8a9a6db | [
"MIT"
] | null | null | null | will/backends/io_adapters/slack.py | peterstarback/will | 949f9c821578865d08a907e5937e94a5e8a9a6db | [
"MIT"
] | null | null | null | import json
import logging
import random
import re
import requests
import sys
import time
import traceback
from websocket import WebSocketConnectionClosedException
from markdownify import MarkdownConverter
from will import settings
from .base import IOBackend
from will.utils import Bunch, UNSURE_REPLIES, clean_for_pi... | 40.754777 | 160 | 0.529851 | import json
import logging
import random
import re
import requests
import sys
import time
import traceback
from websocket import WebSocketConnectionClosedException
from markdownify import MarkdownConverter
from will import settings
from .base import IOBackend
from will.utils import Bunch, UNSURE_REPLIES, clean_for_pi... | 22,113 | 1,104 | 127 |
3fc0ea60ecc6683dedc199b2299d804886ef2777 | 2,213 | py | Python | Taller-de-Estrucuras-de-Control-Repeticion/ejercicio 11-12.py | Davidpadilla1234/Taller-de-Estrucuras-de-Control-Repeticion | 5fd3f058a8007e6e6d886959149c7d5e42f26a3a | [
"MIT"
] | null | null | null | Taller-de-Estrucuras-de-Control-Repeticion/ejercicio 11-12.py | Davidpadilla1234/Taller-de-Estrucuras-de-Control-Repeticion | 5fd3f058a8007e6e6d886959149c7d5e42f26a3a | [
"MIT"
] | null | null | null | Taller-de-Estrucuras-de-Control-Repeticion/ejercicio 11-12.py | Davidpadilla1234/Taller-de-Estrucuras-de-Control-Repeticion | 5fd3f058a8007e6e6d886959149c7d5e42f26a3a | [
"MIT"
] | null | null | null | consumir = int ( input ( "¿Consumir licor? Digite 1 para si y 2 para No: " ))
agr = 0
Ron = 0
cuello uterino = 0
teq = 0
whi = 0
otro = 0
licor = 0
listaco = []
listaco . agregar ( consumir )
listalicor = []
listaa ños = [ ]
listacv = []
listawhi = []
listam = []
listaf = []
listap = []
mientras que e... | 34.578125 | 131 | 0.445097 | consumir = int ( input ( "¿Consumir licor? Digite 1 para si y 2 para No: " ))
agr = 0
Ron = 0
cuello uterino = 0
teq = 0
whi = 0
otro = 0
licor = 0
listaco = []
listaco . agregar ( consumir )
listalicor = []
listaa ños = [ ]
listacv = []
listawhi = []
listam = []
listaf = []
listap = []
mientras que e... | 0 | 0 | 0 |
9aff1aaf0f46707dc885d8762f4b23af8d11c443 | 25,962 | py | Python | toontown/toonbase/UserFunnel.py | SuperM0use24/TT-CL-Edition | fdad8394f0656ae122b687d603f72afafd220c65 | [
"MIT"
] | null | null | null | toontown/toonbase/UserFunnel.py | SuperM0use24/TT-CL-Edition | fdad8394f0656ae122b687d603f72afafd220c65 | [
"MIT"
] | 1 | 2021-06-08T17:16:48.000Z | 2021-06-08T17:16:48.000Z | toontown/toonbase/UserFunnel.py | SuperM0use24/TT-CL-Edition | fdad8394f0656ae122b687d603f72afafd220c65 | [
"MIT"
] | 3 | 2021-06-03T05:36:36.000Z | 2021-06-22T15:07:31.000Z | import os, sys, socket, random
from urllib import quote_plus
from panda3d.core import HTTPClient, HTTPCookie, URLSpec, Ramfile, Ostream, HTTPDate, DocumentSpec
from direct.task.Task import Task
from direct.directnotify.DirectNotifyGlobal import directNotify
notify = directNotify.newCategory('UserFunnel')
... | 36.982906 | 432 | 0.555042 | import os, sys, socket, random
from urllib import quote_plus
from panda3d.core import HTTPClient, HTTPCookie, URLSpec, Ramfile, Ostream, HTTPDate, DocumentSpec
from direct.task.Task import Task
from direct.directnotify.DirectNotifyGlobal import directNotify
notify = directNotify.newCategory('UserFunnel')
class UserFun... | 24,418 | -6 | 1,228 |
294b59e064ef5c00d57978ef15c6acfd16e1da33 | 672 | py | Python | budgets/admin.py | thomasmeagher/Casper | 8a5d332f317694eb627bdac132acb4547d6fdb4b | [
"Apache-2.0"
] | null | null | null | budgets/admin.py | thomasmeagher/Casper | 8a5d332f317694eb627bdac132acb4547d6fdb4b | [
"Apache-2.0"
] | null | null | null | budgets/admin.py | thomasmeagher/Casper | 8a5d332f317694eb627bdac132acb4547d6fdb4b | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from .models import Budget, Category, Transaction
admin.site.register(Budget, BudgetAdmin)
admin.site.register(Category, CategoryAdmin)
admin.site.register(Transaction, TransactionAdmin)
| 26.88 | 81 | 0.703869 | from django.contrib import admin
from .models import Budget, Category, Transaction
class BudgetAdmin(admin.ModelAdmin):
list_display = ('user', 'amount', 'category',)
class CategoryAdmin(admin.ModelAdmin):
list_display = ('name',)
class TransactionAdmin(admin.ModelAdmin):
fieldsets = [
(None,... | 0 | 378 | 69 |
6bcf03d748c44a411fd363cf11bba71ec75d569a | 377 | py | Python | Leetcode/Python/reverseInteger.py | abdzitter/Daily-Coding-DS-ALGO-Practice | 26ddbf7a3673608039a07d26d812fce31b69871a | [
"MIT"
] | 289 | 2021-05-15T22:56:03.000Z | 2022-03-28T23:13:25.000Z | Leetcode/Python/reverseInteger.py | abdzitter/Daily-Coding-DS-ALGO-Practice | 26ddbf7a3673608039a07d26d812fce31b69871a | [
"MIT"
] | 1,812 | 2021-05-09T13:49:58.000Z | 2022-01-15T19:27:17.000Z | Leetcode/Python/reverseInteger.py | abdzitter/Daily-Coding-DS-ALGO-Practice | 26ddbf7a3673608039a07d26d812fce31b69871a | [
"MIT"
] | 663 | 2021-05-09T16:57:58.000Z | 2022-03-27T14:15:07.000Z |
#Problem link : https://leetcode.com/problems/reverse-integer/
num = int(input())
print(reverse(num))
#Example test case
# Input : 123
# Output : 321
# Input : - 123
# Output : -321
| 16.391304 | 62 | 0.554377 |
#Problem link : https://leetcode.com/problems/reverse-integer/
def reverse(x):
s = str(abs(x))
ans = int (s[::-1])
if (ans > (pow(2,31)-1) or ans < pow(2,-31)):
return 0
elif (x >= 0):
return ans
return ans - 2*ans
num = int(input())
print(reverse(num))
#Example test case
# Inp... | 166 | 0 | 22 |
b97c913eda9106e216b0d13bff667793a2fa5ac0 | 1,105 | py | Python | how-to-use-azureml/work-with-data/datadrift-tutorial/get_data.py | lobrien/MachineLearningNotebooks | a56b69448c070b243125b66c303ba670a5a157c7 | [
"MIT"
] | 3,074 | 2018-09-22T18:05:18.000Z | 2022-03-31T10:20:53.000Z | how-to-use-azureml/work-with-data/datadrift-tutorial/get_data.py | vijetajo/MachineLearningNotebooks | 7e2c1ca152e280dc544f3c9654e9906a7f17c89b | [
"MIT"
] | 1,328 | 2018-09-25T19:18:22.000Z | 2022-03-30T22:56:38.000Z | how-to-use-azureml/work-with-data/datadrift-tutorial/get_data.py | vijetajo/MachineLearningNotebooks | 7e2c1ca152e280dc544f3c9654e9906a7f17c89b | [
"MIT"
] | 2,154 | 2018-09-21T21:29:21.000Z | 2022-03-31T18:20:38.000Z | # import packages
import os
import pandas as pd
from calendar import monthrange
from datetime import datetime, timedelta
from azureml.core import Dataset, Datastore, Workspace
from azureml.opendatasets import NoaaIsdWeather
# get workspace and datastore
ws = Workspace.from_config()
dstore = ws.get_default_datastore()
... | 35.645161 | 87 | 0.667873 | # import packages
import os
import pandas as pd
from calendar import monthrange
from datetime import datetime, timedelta
from azureml.core import Dataset, Datastore, Workspace
from azureml.opendatasets import NoaaIsdWeather
# get workspace and datastore
ws = Workspace.from_config()
dstore = ws.get_default_datastore()
... | 0 | 0 | 0 |
83b3e46a39d58cdc9dab0c86420d4c6bea23750c | 13,228 | py | Python | src/PreProcessing.py | lingluodlut/PPIAC | f3d2b9af6e5a6797455832195200d61d8e894a0d | [
"Apache-2.0"
] | 4 | 2018-03-20T03:40:54.000Z | 2020-12-20T12:30:59.000Z | src/PreProcessing.py | lingluodlut/PPIAC | f3d2b9af6e5a6797455832195200d61d8e894a0d | [
"Apache-2.0"
] | null | null | null | src/PreProcessing.py | lingluodlut/PPIAC | f3d2b9af6e5a6797455832195200d61d8e894a0d | [
"Apache-2.0"
] | 2 | 2018-08-23T03:12:15.000Z | 2019-08-12T09:02:23.000Z | #encoding=utf-8
'''
Created on 2017年6月1日
@author: Administrator
'''
import xml.dom.minidom
from _codecs import encode
import random
import nltk
# parse trainingset from xml to text
# if t<2:
# print(relevant)
# print(abstract)
# break
# def nltk_token():
# infile='H:/PHDwork/Bi... | 37.68661 | 133 | 0.646054 | #encoding=utf-8
'''
Created on 2017年6月1日
@author: Administrator
'''
import xml.dom.minidom
from _codecs import encode
import random
import nltk
# parse trainingset from xml to text
def parse_xml_trainingset():
infile='H:/PHDwork/BioCreative VI/track4_PM/data/test gold/PMtask_Triage_TestSet.xml'
outfile='H:/PHD... | 11,301 | 0 | 314 |
16cdfe94aaa511d5803c99896509edd3fceeb923 | 1,578 | py | Python | MpsiSpider/Producer.py | gongzhe1/MpsiSpider | 4cfc3e9e3ee363ae1f0983b23a3d51eb28afb0d2 | [
"MIT"
] | null | null | null | MpsiSpider/Producer.py | gongzhe1/MpsiSpider | 4cfc3e9e3ee363ae1f0983b23a3d51eb28afb0d2 | [
"MIT"
] | null | null | null | MpsiSpider/Producer.py | gongzhe1/MpsiSpider | 4cfc3e9e3ee363ae1f0983b23a3d51eb28afb0d2 | [
"MIT"
] | 2 | 2019-08-18T15:15:58.000Z | 2020-04-13T12:48:26.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018/9/9/009 23:01
# @Author : Woe
# @Site :
# @File : Producer.py
# @Software: PyCharm
import asyncio
from MpsiSpider.Request import Request
import threading
import time
| 28.178571 | 98 | 0.483523 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018/9/9/009 23:01
# @Author : Woe
# @Site :
# @File : Producer.py
# @Software: PyCharm
import asyncio
from MpsiSpider.Request import Request
import threading
import time
class Producer:
def __init__(self, requests_queue, mid_queue):
""... | 1,080 | 234 | 23 |
46b1c1f213fc4750364b2750413775d7ba621d95 | 1,261 | py | Python | forum/models.py | rafimuhammad01/mtf-hackathon | 83ab410239a93ff04e57d7ceb2d1d292ba365866 | [
"Unlicense"
] | null | null | null | forum/models.py | rafimuhammad01/mtf-hackathon | 83ab410239a93ff04e57d7ceb2d1d292ba365866 | [
"Unlicense"
] | null | null | null | forum/models.py | rafimuhammad01/mtf-hackathon | 83ab410239a93ff04e57d7ceb2d1d292ba365866 | [
"Unlicense"
] | null | null | null | from datetime import datetime
from django.db import models
from JWTAuth.models import Employee
# Create your models here.
| 35.027778 | 125 | 0.73751 | from datetime import datetime
from django.db import models
from JWTAuth.models import Employee
# Create your models here.
class Forum(models.Model):
title = models.CharField(max_length=50)
question = models.TextField(max_length=500)
owner = models.ForeignKey(Employee, on_delete=models.CASCADE, related_na... | 73 | 995 | 69 |
fb2e472b516fa2dece54502216daadcb8f75753e | 17,080 | py | Python | causallearn/utils/Fas.py | softsys4ai/causal-config-labyrinth | 4f50f9ff15429b0ac6ad0a99fbe4cfdd17e360fc | [
"MIT"
] | 15 | 2022-01-20T12:35:35.000Z | 2022-03-24T16:25:24.000Z | causallearn/utils/Fas.py | softsys4ai/unicorn | 4f50f9ff15429b0ac6ad0a99fbe4cfdd17e360fc | [
"MIT"
] | 14 | 2022-01-23T00:20:00.000Z | 2022-02-22T01:40:43.000Z | causallearn/utils/Fas.py | softsys4ai/causal-config-labyrinth | 4f50f9ff15429b0ac6ad0a99fbe4cfdd17e360fc | [
"MIT"
] | 1 | 2022-02-23T08:59:24.000Z | 2022-02-23T08:59:24.000Z | from copy import deepcopy
from tqdm.auto import tqdm
from causallearn.graph.Edges import Edges
from causallearn.graph.GeneralGraph import GeneralGraph
from causallearn.utils.ChoiceGenerator import ChoiceGenerator
from causallearn.utils.cit import *
from causallearn.utils.PCUtils.BackgroundKnowledge import BackgroundK... | 44.829396 | 126 | 0.577986 | from copy import deepcopy
from tqdm.auto import tqdm
from causallearn.graph.Edges import Edges
from causallearn.graph.GeneralGraph import GeneralGraph
from causallearn.utils.ChoiceGenerator import ChoiceGenerator
from causallearn.utils.cit import *
from causallearn.utils.PCUtils.BackgroundKnowledge import BackgroundK... | 11,677 | 0 | 165 |
6c0988a99c95b883ca9be80c0820141c187aafcf | 1,362 | py | Python | prepare_data.py | johndmendonca/voxceleb_pt | ecb7c7cbda7cb8d13e979891d4471006d00304c2 | [
"MIT"
] | null | null | null | prepare_data.py | johndmendonca/voxceleb_pt | ecb7c7cbda7cb8d13e979891d4471006d00304c2 | [
"MIT"
] | null | null | null | prepare_data.py | johndmendonca/voxceleb_pt | ecb7c7cbda7cb8d13e979891d4471006d00304c2 | [
"MIT"
] | 1 | 2021-03-09T00:28:25.000Z | 2021-03-09T00:28:25.000Z | import re
import sys
import argparse
import subprocess as sp
parser = argparse.ArgumentParser(description='Process captions file.')
parser.add_argument('--vid','-v',required=True,help='.mp4 video file')
parser.add_argument('--rt','-t',required=True,help='Transcription file')
parser.add_argument('--poi',required=True,h... | 26.705882 | 115 | 0.625551 | import re
import sys
import argparse
import subprocess as sp
parser = argparse.ArgumentParser(description='Process captions file.')
parser.add_argument('--vid','-v',required=True,help='.mp4 video file')
parser.add_argument('--rt','-t',required=True,help='Transcription file')
parser.add_argument('--poi',required=True,h... | 0 | 0 | 0 |
19ebe461183e58fa4ce0f7ef848f2d53d61c39f3 | 1,959 | py | Python | weddingwebsite/auth/utils.py | KGB33/Wedding-Website | ba97db5de59369e62c359ef179362211ea8afcd3 | [
"MIT"
] | null | null | null | weddingwebsite/auth/utils.py | KGB33/Wedding-Website | ba97db5de59369e62c359ef179362211ea8afcd3 | [
"MIT"
] | 1 | 2021-05-13T16:05:23.000Z | 2021-05-13T16:05:23.000Z | weddingwebsite/auth/utils.py | KGB33/Wedding-Website | ba97db5de59369e62c359ef179362211ea8afcd3 | [
"MIT"
] | 1 | 2019-08-27T23:24:13.000Z | 2019-08-27T23:24:13.000Z | from functools import wraps
from flask_login import current_user
from flask import redirect, url_for
from weddingwebsite import login_manager
from .exceptions import NoRolesProvided
def requires_roles(*roles):
"""
Implements role biased authentication over Flask-login
:param roles: Required Roles for a... | 26.472973 | 75 | 0.607453 | from functools import wraps
from flask_login import current_user
from flask import redirect, url_for
from weddingwebsite import login_manager
from .exceptions import NoRolesProvided
def requires_roles(*roles):
"""
Implements role biased authentication over Flask-login
:param roles: Required Roles for a... | 1,300 | 0 | 54 |
0e65285dc614d87b5590f0639d08f5c2d3456d3c | 92 | py | Python | parameters_9000.py | zhangjiannan/easyflow | 2c9906d3cc2088ed367f887da842a46db5d903ed | [
"BSD-3-Clause"
] | null | null | null | parameters_9000.py | zhangjiannan/easyflow | 2c9906d3cc2088ed367f887da842a46db5d903ed | [
"BSD-3-Clause"
] | null | null | null | parameters_9000.py | zhangjiannan/easyflow | 2c9906d3cc2088ed367f887da842a46db5d903ed | [
"BSD-3-Clause"
] | 1 | 2021-05-20T10:48:34.000Z | 2021-05-20T10:48:34.000Z | password="pbkdf2(1000,20,sha512)$aa925206b00a7043$28115a6960f48c6f11bd00bc838e9f2d622c0262"
| 46 | 91 | 0.891304 | password="pbkdf2(1000,20,sha512)$aa925206b00a7043$28115a6960f48c6f11bd00bc838e9f2d622c0262"
| 0 | 0 | 0 |
dca38314cf20a1104cf1fbd7e6cdd801aa1f561a | 1,997 | py | Python | dwio/nyu/algos/crt.py | danielwalt-io/nyu-python | be706940eb06d69dd331cf96d3327bbd5963d28b | [
"MIT"
] | null | null | null | dwio/nyu/algos/crt.py | danielwalt-io/nyu-python | be706940eb06d69dd331cf96d3327bbd5963d28b | [
"MIT"
] | null | null | null | dwio/nyu/algos/crt.py | danielwalt-io/nyu-python | be706940eb06d69dd331cf96d3327bbd5963d28b | [
"MIT"
] | null | null | null |
from dwio.nyu.algos import eGCD
| 32.737705 | 83 | 0.370556 |
from dwio.nyu.algos import eGCD
def CRT(*eqns, show_work=False):
def inner(t1, t2, _show=False):
# Single CRT iter
a1 = t1[0]
a2 = t2[0]
n1 = t1[1]
n2 = t2[1]
if n1 < n2:
n1, n2 = n2, n1
a1, a2 = a2, a1
gcd, m1, m2 = eGCD(n1, n2)
... | 1,940 | 0 | 23 |
0b0b87f2c78e46f76cd233d83174181c79f9fd75 | 970 | py | Python | setup.py | yrangana/csv-to-table | ab941663f35b862b7fec82c1569b7c50ccb9c81a | [
"MIT"
] | 9 | 2015-03-15T23:12:20.000Z | 2020-06-25T03:16:47.000Z | setup.py | yrangana/csv-to-table | ab941663f35b862b7fec82c1569b7c50ccb9c81a | [
"MIT"
] | 2 | 2018-06-27T22:40:58.000Z | 2021-06-10T11:19:57.000Z | setup.py | yrangana/csv-to-table | ab941663f35b862b7fec82c1569b7c50ccb9c81a | [
"MIT"
] | 1 | 2020-05-17T09:07:52.000Z | 2020-05-17T09:07:52.000Z | from setuptools import find_packages, setup
requirements = []
with open("requirements.txt") as f:
for line in f:
line = line.strip()
requirements.append(line)
setup(
name="csv_to_table",
version="0.0.3",
description="Generates a CREATE TABLE statement from a CSV file by guessing at co... | 33.448276 | 97 | 0.636082 | from setuptools import find_packages, setup
requirements = []
with open("requirements.txt") as f:
for line in f:
line = line.strip()
requirements.append(line)
setup(
name="csv_to_table",
version="0.0.3",
description="Generates a CREATE TABLE statement from a CSV file by guessing at co... | 0 | 0 | 0 |
28bee283f0ded6548b821e3f9359b3df48de2dbb | 2,434 | py | Python | tosh/command.py | javitonino/tosh | e096ee435264849ab644c6b27d643352446d2b2a | [
"BSD-3-Clause"
] | 1 | 2017-09-23T09:30:49.000Z | 2017-09-23T09:30:49.000Z | tosh/command.py | javitonino/tosh | e096ee435264849ab644c6b27d643352446d2b2a | [
"BSD-3-Clause"
] | null | null | null | tosh/command.py | javitonino/tosh | e096ee435264849ab644c6b27d643352446d2b2a | [
"BSD-3-Clause"
] | null | null | null | """Base class and task for commands."""
import traceback
from .tasks import Task
class CommandFailedException(BaseException):
"""Class to represent a failure in a command. Used to avoid printing multiple tracebacks on nested commands."""
pass
class _CommandMeta(type):
"""
Metaclass (object that rep... | 29.682927 | 115 | 0.633114 | """Base class and task for commands."""
import traceback
from .tasks import Task
class CommandFailedException(BaseException):
"""Class to represent a failure in a command. Used to avoid printing multiple tracebacks on nested commands."""
pass
class _CommandMeta(type):
"""
Metaclass (object that rep... | 15 | 0 | 26 |
52e92f76d996568aa122976250a449ab411f7ea3 | 815 | py | Python | neural_network_covid/model.py | j2zhao/federated_learning | b45cdc633a6f0178bd11e7f11324c54ca4319fdd | [
"MIT"
] | null | null | null | neural_network_covid/model.py | j2zhao/federated_learning | b45cdc633a6f0178bd11e7f11324c54ca4319fdd | [
"MIT"
] | null | null | null | neural_network_covid/model.py | j2zhao/federated_learning | b45cdc633a6f0178bd11e7f11324c54ca4319fdd | [
"MIT"
] | null | null | null | import tensorflow as tf
import keras | 32.6 | 74 | 0.580368 | import tensorflow as tf
import keras
def gen_net():
base_model = tf.keras.applications.ResNet50V2(weights='imagenet',
input_shape=(200, 200, 3),
include_top=False)
for layer in base_model.layers:
layer.trai... | 756 | 0 | 23 |
f50b27ddd52770ec4a09ebfa8389918ca04fc9e5 | 1,487 | py | Python | wrappers/python/indy/blob_storage.py | absltkaos/indy-sdk | bc14c5b514dc1c76ce62dd7f6bf804120bf69f5e | [
"Apache-2.0"
] | 636 | 2017-05-25T07:45:43.000Z | 2022-03-23T22:30:34.000Z | wrappers/python/indy/blob_storage.py | Nick-1979/indy-sdk | e5f812e14962f0d51cf96f843033754ff841ce30 | [
"Apache-2.0"
] | 731 | 2017-05-29T07:15:08.000Z | 2022-03-31T07:55:58.000Z | wrappers/python/indy/blob_storage.py | Nick-1979/indy-sdk | e5f812e14962f0d51cf96f843033754ff841ce30 | [
"Apache-2.0"
] | 904 | 2017-05-25T07:45:49.000Z | 2022-03-31T07:43:31.000Z | from .libindy import do_call, create_cb
from ctypes import *
import logging
| 29.156863 | 78 | 0.585071 | from .libindy import do_call, create_cb
from ctypes import *
import logging
async def open_reader(type_: str, config: str) -> int:
logger = logging.getLogger(__name__)
logger.debug("open_reader: >>> type_: %r, config: %r",
type_,
config)
if not hasattr(open_reader, "c... | 1,362 | 0 | 46 |
49754122e8daf2e07c1f16c0e965d77185ba91b3 | 4,237 | py | Python | handlers.py | iticus/picamweb | 7cb0f009120d6484cb03d89707e3770c08c7a650 | [
"MIT"
] | null | null | null | handlers.py | iticus/picamweb | 7cb0f009120d6484cb03d89707e3770c08c7a650 | [
"MIT"
] | null | null | null | handlers.py | iticus/picamweb | 7cb0f009120d6484cb03d89707e3770c08c7a650 | [
"MIT"
] | null | null | null | """
Created on Aug 28, 2018
@author: ionut
"""
import datetime
import logging
from tornado.web import RequestHandler
from tornado.websocket import WebSocketHandler
import camera
class HomeHandler(RequestHandler):
"""
Handler for / - render index.html
"""
class ImageHandler(WebSocketHandler):
"""
... | 33.626984 | 115 | 0.640548 | """
Created on Aug 28, 2018
@author: ionut
"""
import datetime
import logging
from tornado.web import RequestHandler
from tornado.websocket import WebSocketHandler
import camera
class HomeHandler(RequestHandler):
"""
Handler for / - render index.html
"""
def get(self):
camset = self.applic... | 1,974 | 0 | 243 |
762dbed9bdbb47e172dd66be94398f945456a2cf | 64,196 | py | Python | morse-stf/stensorflow/basic/basic_class/base.py | qizhi-zhang/Antchain-MPC | f551170f68b0baff328e6594484e9832230fe719 | [
"Apache-2.0"
] | 2 | 2021-12-02T05:04:32.000Z | 2021-12-02T05:34:17.000Z | morse-stf/stensorflow/basic/basic_class/base.py | qizhi-zhang/Antchain-MPC | f551170f68b0baff328e6594484e9832230fe719 | [
"Apache-2.0"
] | null | null | null | morse-stf/stensorflow/basic/basic_class/base.py | qizhi-zhang/Antchain-MPC | f551170f68b0baff328e6594484e9832230fe719 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
"""
Ant Group
Copyright (c) 2004-2020 All Rights Reserved.
------------------------------------------------------
File Name : base
Author : Qizhi Zhang
Email: qizhi.zqz@antgroup.com
Create Time : 2020-05-14 19:58
Description : description what the main functi... | 42.65515 | 149 | 0.602545 | #!/usr/bin/env python
# coding=utf-8
"""
Ant Group
Copyright (c) 2004-2020 All Rights Reserved.
------------------------------------------------------
File Name : base
Author : Qizhi Zhang
Email: qizhi.zqz@antgroup.com
Create Time : 2020-05-14 19:58
Description : description what the main functi... | 20,851 | 0 | 1,431 |
6924b2eb90cbefb401e9b7b62120da2079242449 | 2,299 | py | Python | apps/empleado/serializers.py | WilliamColmenares/Access_control | 6c4d07a55307fe9f876a796d3e7273188b7569d4 | [
"MIT"
] | 2 | 2017-06-22T13:50:56.000Z | 2021-09-16T14:07:50.000Z | apps/empleado/serializers.py | WilliamColmenares/Access_control | 6c4d07a55307fe9f876a796d3e7273188b7569d4 | [
"MIT"
] | null | null | null | apps/empleado/serializers.py | WilliamColmenares/Access_control | 6c4d07a55307fe9f876a796d3e7273188b7569d4 | [
"MIT"
] | 2 | 2017-06-08T17:18:29.000Z | 2021-04-17T22:20:34.000Z | from django.contrib.auth.models import User, Group
from rest_framework import serializers
from apps.archivo.serializers import FotoEmpleadoSerializer
from apps.comun.serializers import DireccionSerializer
from apps.empleado.models import Empleado, DatosUsuarioEmpleado
from apps.punto_control.serializers import... | 33.318841 | 93 | 0.683341 | from django.contrib.auth.models import User, Group
from rest_framework import serializers
from apps.archivo.serializers import FotoEmpleadoSerializer
from apps.comun.serializers import DireccionSerializer
from apps.empleado.models import Empleado, DatosUsuarioEmpleado
from apps.punto_control.serializers import... | 136 | 1,594 | 125 |
4a4b2d4de6681f78e822341fcf5f2b6715501fec | 2,614 | py | Python | kratos/stmts.py | IanBoyanZhang/kratos | 4865e71e657c770fdc86528fcd56918e6f2103a1 | [
"BSD-2-Clause"
] | 39 | 2019-10-07T16:42:00.000Z | 2022-03-31T20:33:28.000Z | kratos/stmts.py | IanBoyanZhang/kratos | 4865e71e657c770fdc86528fcd56918e6f2103a1 | [
"BSD-2-Clause"
] | 164 | 2019-06-29T03:43:19.000Z | 2021-11-16T06:37:13.000Z | kratos/stmts.py | IanBoyanZhang/kratos | 4865e71e657c770fdc86528fcd56918e6f2103a1 | [
"BSD-2-Clause"
] | 11 | 2019-07-13T19:24:30.000Z | 2022-01-21T22:52:18.000Z | import _kratos
from .util import const
from typing import Union, List
from _kratos import get_fn_ln
| 29.044444 | 79 | 0.630069 | import _kratos
from .util import const
from typing import Union, List
from _kratos import get_fn_ln
class IfStmt:
def __init__(self, predicate: _kratos.Var):
self._stmt = _kratos.IfStmt(predicate)
self.__generator = predicate.generator
if self.__generator.debug:
self._stmt.add_... | 2,032 | -13 | 490 |
d7c0a0bc2bc9a0e264a4d3c56b926cc5351fcc2e | 12,280 | py | Python | lstm/ilab/models/LSTM.py | ucrscholar/HandWashNet | 2a01099b9d054956fd335ec4de6aff2064d5ef4e | [
"MIT"
] | 1 | 2020-06-17T12:49:34.000Z | 2020-06-17T12:49:34.000Z | lstm/ilab/models/LSTM.py | ucrscholar/HandWashNet | 2a01099b9d054956fd335ec4de6aff2064d5ef4e | [
"MIT"
] | null | null | null | lstm/ilab/models/LSTM.py | ucrscholar/HandWashNet | 2a01099b9d054956fd335ec4de6aff2064d5ef4e | [
"MIT"
] | null | null | null | from tensorflow_core.python.keras.engine.sequential import Sequential
from tensorflow_core.python.keras.layers import ConvLSTM2D, Flatten, Dense, Dropout, concatenate
from tensorflow_core.python.keras.layers.normalization import BatchNormalization
from tensorflow_core.python.keras.models import Sequential, Model
from ... | 46.339623 | 117 | 0.65342 | from tensorflow_core.python.keras.engine.sequential import Sequential
from tensorflow_core.python.keras.layers import ConvLSTM2D, Flatten, Dense, Dropout, concatenate
from tensorflow_core.python.keras.layers.normalization import BatchNormalization
from tensorflow_core.python.keras.models import Sequential, Model
from ... | 11,497 | 0 | 184 |
cbecca321f5f624b5df0a146dbdf52a9ade8a9d6 | 2,345 | py | Python | check-pruned-model.py | yeyun11/netslim | e46a62ab6229c3e68d13b9a6de9b339369950b8f | [
"MIT"
] | 44 | 2020-03-11T02:07:53.000Z | 2022-03-31T13:37:16.000Z | check-pruned-model.py | cloudlounger/netslim | 7954f2af9ab955faf4cbc42b43e6e96eb4c26b01 | [
"MIT"
] | null | null | null | check-pruned-model.py | cloudlounger/netslim | 7954f2af9ab955faf4cbc42b43e6e96eb4c26b01 | [
"MIT"
] | 14 | 2020-03-12T13:53:03.000Z | 2021-08-23T06:09:52.000Z | import os
import argparse
import torch
import torch.nn as nn
import torch.optim as optim
from torchvision import transforms
from torchvision.datasets import cifar
from networks import cifar_archs, ilsvrc12_archs
from networks import weights_init
from netslim import prune, load_pruned_model, update_bn, update_bn_by_nam... | 39.083333 | 128 | 0.670789 | import os
import argparse
import torch
import torch.nn as nn
import torch.optim as optim
from torchvision import transforms
from torchvision.datasets import cifar
from networks import cifar_archs, ilsvrc12_archs
from networks import weights_init
from netslim import prune, load_pruned_model, update_bn, update_bn_by_nam... | 0 | 0 | 0 |
23bac2369ea1dc8626da543ba2843e95ff9cf28e | 6,601 | py | Python | test.py | Felix3qH4/Mobiliteit.lu | 30a81ac4b119ae629b74e4c497e4f4f8ceab5bce | [
"Unlicense"
] | null | null | null | test.py | Felix3qH4/Mobiliteit.lu | 30a81ac4b119ae629b74e4c497e4f4f8ceab5bce | [
"Unlicense"
] | null | null | null | test.py | Felix3qH4/Mobiliteit.lu | 30a81ac4b119ae629b74e4c497e4f4f8ceab5bce | [
"Unlicense"
] | null | null | null | import pygame as pg
import math
run : bool = True
pg.init()
pg.font.init()
WINDOW_W : int = 1600
WINDOW_H : int = 1000
fps : int = 60
clock = pg.time.Clock()
drag_allowed : bool = False
zoom : float = 1
GREEN : tuple = (220, 230, 190)
window = pg.display.set_mode((WINDOW_W, WINDOW_H))
pg.disp... | 36.672222 | 147 | 0.538252 | import pygame as pg
import math
run : bool = True
pg.init()
pg.font.init()
WINDOW_W : int = 1600
WINDOW_H : int = 1000
fps : int = 60
clock = pg.time.Clock()
drag_allowed : bool = False
zoom : float = 1
GREEN : tuple = (220, 230, 190)
window = pg.display.set_mode((WINDOW_W, WINDOW_H))
pg.disp... | 756 | -9 | 134 |
638aab68f9be0ea0dab220aa18f58617df9c8f03 | 576 | py | Python | Xiecheng/Gevent.py | scottyyf/MultiWorker | 4abd361c3053140be6453d6e6e30f5c31a189e79 | [
"Apache-2.0"
] | null | null | null | Xiecheng/Gevent.py | scottyyf/MultiWorker | 4abd361c3053140be6453d6e6e30f5c31a189e79 | [
"Apache-2.0"
] | null | null | null | Xiecheng/Gevent.py | scottyyf/MultiWorker | 4abd361c3053140be6453d6e6e30f5c31a189e79 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
File: Gevent.py
Author: Scott Yang(Scott)
Email: yangyingfa@skybility.com
Copyright: Copyright (c) 2021, Skybility Software Co.,Ltd. All rights reserved.
Description:
"""
import gevent
import time
from gevent import monkey
monkey.patch_all()
if __name__ == '__mai... | 15.567568 | 79 | 0.605903 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
File: Gevent.py
Author: Scott Yang(Scott)
Email: yangyingfa@skybility.com
Copyright: Copyright (c) 2021, Skybility Software Co.,Ltd. All rights reserved.
Description:
"""
import gevent
import time
from gevent import monkey
monkey.patch_all()
def test(n):
num = ... | 197 | 0 | 46 |
20c9cf866825c0fcfbf0879f6c03959c6221ad26 | 387 | py | Python | testPlateLocate.py | jedcua/spear | ac114aaa9cca5d3198516661c3d8abd636435bb1 | [
"CNRI-Python"
] | 3 | 2019-04-28T02:40:03.000Z | 2021-05-16T18:15:02.000Z | testPlateLocate.py | jedcua/spear | ac114aaa9cca5d3198516661c3d8abd636435bb1 | [
"CNRI-Python"
] | 1 | 2015-05-08T12:50:06.000Z | 2015-05-08T12:50:06.000Z | testPlateLocate.py | jedcua/spear | ac114aaa9cca5d3198516661c3d8abd636435bb1 | [
"CNRI-Python"
] | 1 | 2015-06-04T18:29:19.000Z | 2015-06-04T18:29:19.000Z | #!/usr/bin/python
import spear.LPR.plateLocate, sys
import spear.LPR.imageProcessing
input_image_path = str(sys.argv[1])
img = spear.SimpleCV.Image(input_image_path)
cropped_img = spear.LPR.imageProcessing.cropToROI(img)
eq_img = spear.LPR.imageProcessing.equalize(cropped_img)
rect_obj_list = spear.LPR.plateLocate... | 25.8 | 102 | 0.813953 | #!/usr/bin/python
import spear.LPR.plateLocate, sys
import spear.LPR.imageProcessing
input_image_path = str(sys.argv[1])
img = spear.SimpleCV.Image(input_image_path)
cropped_img = spear.LPR.imageProcessing.cropToROI(img)
eq_img = spear.LPR.imageProcessing.equalize(cropped_img)
rect_obj_list = spear.LPR.plateLocate... | 0 | 0 | 0 |
462c4d841e5fb44ede4c97e016596297ef6b96b3 | 5,936 | py | Python | direct/src/distributed/GridChild.py | cmarshall108/panda3d-python3 | 8bea2c0c120b03ec1c9fd179701fdeb7510bb97b | [
"PHP-3.0",
"PHP-3.01"
] | 3 | 2020-01-02T08:43:36.000Z | 2020-07-05T08:59:02.000Z | direct/src/distributed/GridChild.py | cmarshall108/panda3d-python3 | 8bea2c0c120b03ec1c9fd179701fdeb7510bb97b | [
"PHP-3.0",
"PHP-3.01"
] | 20 | 2021-05-03T18:02:23.000Z | 2022-03-12T12:01:04.000Z | Lib/site-packages/direct/distributed/GridChild.py | fochoao/cpython | 3dc84b260e5bced65ebc2c45c40c8fa65f9b5aa9 | [
"bzip2-1.0.6",
"0BSD"
] | 1 | 2020-03-11T17:38:45.000Z | 2020-03-11T17:38:45.000Z | from direct.distributed.DistributedSmoothNodeBase import DistributedSmoothNodeBase
from direct.distributed.GridParent import GridParent
class GridChild:
"""
Any object that expects to be parented to a grid should inherit from this.
It works with GridParent to manage its grid cell hierarchy in the scenegrap... | 37.808917 | 98 | 0.616914 | from direct.distributed.DistributedSmoothNodeBase import DistributedSmoothNodeBase
from direct.distributed.GridParent import GridParent
class GridChild:
"""
Any object that expects to be parented to a grid should inherit from this.
It works with GridParent to manage its grid cell hierarchy in the scenegrap... | 4,568 | 0 | 427 |
a28764c2592f90d3b7d6bcb024126bba74d9d0d4 | 3,639 | py | Python | melody_generation/utils/midifile.py | janzuiderveld/MIDialogue | eabb49459857b8bad54cfa5602c917d04390a4c0 | [
"MIT"
] | null | null | null | melody_generation/utils/midifile.py | janzuiderveld/MIDialogue | eabb49459857b8bad54cfa5602c917d04390a4c0 | [
"MIT"
] | null | null | null | melody_generation/utils/midifile.py | janzuiderveld/MIDialogue | eabb49459857b8bad54cfa5602c917d04390a4c0 | [
"MIT"
] | null | null | null | "Transform functions for raw midi files"
from enum import Enum
import music21
PIANO_TYPES = list(range(24)) + list(range(80, 96)) # Piano, Synths
PLUCK_TYPES = list(range(24, 40)) + list(range(104, 112)) # Guitar, Bass, Ethnic
BRIGHT_TYPES = list(range(40, 56)) + list(range(56, 80))
PIANO_RANGE = (21, 109)
type2... | 34.009346 | 117 | 0.68233 | "Transform functions for raw midi files"
from enum import Enum
import music21
PIANO_TYPES = list(range(24)) + list(range(80, 96)) # Piano, Synths
PLUCK_TYPES = list(range(24, 40)) + list(range(104, 112)) # Guitar, Bass, Ethnic
BRIGHT_TYPES = list(range(40, 56)) + list(range(56, 80))
PIANO_RANGE = (21, 109)
class Tra... | 2,500 | 179 | 322 |
d8f56fdc34bf3ce9aa587528d0c8c72856345ba1 | 3,370 | py | Python | apps/music/adminx.py | chenyifaerfans/fafaer-apis | 896db11116fc78c597ebc1a90f547dc15004438d | [
"MIT"
] | null | null | null | apps/music/adminx.py | chenyifaerfans/fafaer-apis | 896db11116fc78c597ebc1a90f547dc15004438d | [
"MIT"
] | null | null | null | apps/music/adminx.py | chenyifaerfans/fafaer-apis | 896db11116fc78c597ebc1a90f547dc15004438d | [
"MIT"
] | 1 | 2019-03-17T12:46:20.000Z | 2019-03-17T12:46:20.000Z | # _*_ coding:utf-8 _*_
__author__ = 'WANGY'
__date__ = '2018/8/9 12:42'
import xadmin
from .models import Singer, Album, Audio, Song, AlbumDetail, AudioDetail
from .forms import SingerAdminForm, AlbumAdminForm, SongAdminForm
from common.base import CommonAdmin
xadmin.site.register(Singer, SingerAdmin)
xadmi... | 32.403846 | 144 | 0.667062 | # _*_ coding:utf-8 _*_
__author__ = 'WANGY'
__date__ = '2018/8/9 12:42'
import xadmin
from .models import Singer, Album, Audio, Song, AlbumDetail, AudioDetail
from .forms import SingerAdminForm, AlbumAdminForm, SongAdminForm
from common.base import CommonAdmin
class AlbumDetailInline(object):
model = AlbumDetai... | 1,028 | 1,621 | 184 |
8dab83884af015102b728d30a457e43b569c1494 | 10,826 | py | Python | PageBotNano-005-TextBox/pagebotnano_005/elements.py | juandelperal/PageBotNano | 7f0d82755d6eb6962f206e5dd0d08c40c0947bde | [
"MIT"
] | null | null | null | PageBotNano-005-TextBox/pagebotnano_005/elements.py | juandelperal/PageBotNano | 7f0d82755d6eb6962f206e5dd0d08c40c0947bde | [
"MIT"
] | null | null | null | PageBotNano-005-TextBox/pagebotnano_005/elements.py | juandelperal/PageBotNano | 7f0d82755d6eb6962f206e5dd0d08c40c0947bde | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# -----------------------------------------------------------------------------
#
# P A G E B O T N A N O
#
# Copyright (c) 2020+ Buro Petr van Blokland + Claudia Mens
# www.pagebot.io
# Licensed under MIT conditions
#
# Supporting DrawBot, www.drawbot.com
# ---... | 43.82996 | 97 | 0.615925 | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# -----------------------------------------------------------------------------
#
# P A G E B O T N A N O
#
# Copyright (c) 2020+ Buro Petr van Blokland + Claudia Mens
# www.pagebot.io
# Licensed under MIT conditions
#
# Supporting DrawBot, www.drawbot.com
# ---... | 798 | 0 | 53 |
5297ff910764477d5f5be9bd13a24497e591d63b | 3,738 | py | Python | rotations.py | syed343/matrix-rotations-demo | baf080ea41357c21a19885f2da5cbe61e43c7341 | [
"MIT"
] | 1 | 2020-10-06T16:55:29.000Z | 2020-10-06T16:55:29.000Z | rotations.py | syed343/matrix-rotations-demo | baf080ea41357c21a19885f2da5cbe61e43c7341 | [
"MIT"
] | null | null | null | rotations.py | syed343/matrix-rotations-demo | baf080ea41357c21a19885f2da5cbe61e43c7341 | [
"MIT"
] | null | null | null | # Aim: to rotate a point P by θ°:, centre O.
# MIT License
# Copyright (c) 2020 syed343 (GitHub username)
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including wit... | 35.264151 | 87 | 0.64473 | # Aim: to rotate a point P by θ°:, centre O.
# MIT License
# Copyright (c) 2020 syed343 (GitHub username)
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including wit... | 547 | 0 | 92 |
956b790695c6d732d4902c158ee358dc0065d9bb | 4,406 | py | Python | hrl_fabric_based_tactile_sensor/src/hrl_fabric_based_tactile_sensor/pr2_tactile_sleeve_gripper_and_forearm_driver_node.py | gt-ros-pkg/hrl-haptic-manip | 6458187075033ecd3a22fbcdc1a632df39b0cba1 | [
"Apache-2.0"
] | 1 | 2017-07-13T14:58:35.000Z | 2017-07-13T14:58:35.000Z | hrl_fabric_based_tactile_sensor/src/hrl_fabric_based_tactile_sensor/pr2_tactile_sleeve_gripper_and_forearm_driver_node.py | gt-ros-pkg/hrl-haptic-manip | 6458187075033ecd3a22fbcdc1a632df39b0cba1 | [
"Apache-2.0"
] | null | null | null | hrl_fabric_based_tactile_sensor/src/hrl_fabric_based_tactile_sensor/pr2_tactile_sleeve_gripper_and_forearm_driver_node.py | gt-ros-pkg/hrl-haptic-manip | 6458187075033ecd3a22fbcdc1a632df39b0cba1 | [
"Apache-2.0"
] | 2 | 2017-03-08T14:44:22.000Z | 2019-07-15T23:46:35.000Z | #!/usr/bin/python
import sys
import math, numpy as np
import roslib; roslib.load_manifest('hrl_fabric_based_tactile_sensor')
import rospy
from hrl_msgs.msg import FloatArray
import hrl_lib.util as ut
import hrl_lib.transforms as tr
import hrl_fabric_based_tactile_sensor.adc_publisher_node as apn
from m3skin_ros.ms... | 38.649123 | 109 | 0.688606 | #!/usr/bin/python
import sys
import math, numpy as np
import roslib; roslib.load_manifest('hrl_fabric_based_tactile_sensor')
import rospy
from hrl_msgs.msg import FloatArray
import hrl_lib.util as ut
import hrl_lib.transforms as tr
import hrl_fabric_based_tactile_sensor.adc_publisher_node as apn
from m3skin_ros.ms... | 0 | 0 | 0 |
fd7fb50af4300ac68460aae6ba1f2780f20d6dfb | 4,200 | py | Python | test_parser.py | sbreitenbach/market-trends | 7a2efa06204a1f302e6daa7ba559a293367581cc | [
"Apache-2.0"
] | null | null | null | test_parser.py | sbreitenbach/market-trends | 7a2efa06204a1f302e6daa7ba559a293367581cc | [
"Apache-2.0"
] | 9 | 2021-01-31T17:25:03.000Z | 2021-02-28T00:47:39.000Z | test_parser.py | sbreitenbach/market-trends | 7a2efa06204a1f302e6daa7ba559a293367581cc | [
"Apache-2.0"
] | null | null | null | import demoji
import parser
demoji.download_codes()
| 23.333333 | 80 | 0.684762 | import demoji
import parser
demoji.download_codes()
def test_is_valid_dollar_sign_match():
a = "$GME"
b = parser.is_dollar_sign_match(a)
assert(b == True)
def test_not_valid_dollar_sign_match():
a = "GME"
b = parser.is_dollar_sign_match(a)
assert(b == False)
def test_not_valid_dollar_sign... | 3,454 | 0 | 667 |
52183764426604df24e234ea127a5b9d154137b1 | 68 | py | Python | boxofficemojo/boxofficemojo.py | pnivlek/red-cogs | 6700c4d6e1df229802af25c27571b8f57ffdcddd | [
"MIT"
] | null | null | null | boxofficemojo/boxofficemojo.py | pnivlek/red-cogs | 6700c4d6e1df229802af25c27571b8f57ffdcddd | [
"MIT"
] | null | null | null | boxofficemojo/boxofficemojo.py | pnivlek/red-cogs | 6700c4d6e1df229802af25c27571b8f57ffdcddd | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Yackback 2018
# Red cog for scraping BOM
| 17 | 27 | 0.691176 | #!/usr/bin/env python
# Yackback 2018
# Red cog for scraping BOM
| 0 | 0 | 0 |
1adc09aa33fafe6ec789cf91efa9aaaa434031e2 | 2,134 | py | Python | TranskribusDU/dataGenerator/listGenerator.py | Transkribus/TranskribusDU | 61028ee5f5f39f435bf9c461f8073e75bca344ac | [
"BSD-3-Clause"
] | 20 | 2017-01-24T20:08:25.000Z | 2021-10-30T15:20:44.000Z | TranskribusDU/dataGenerator/listGenerator.py | Transkribus/TranskribusDU | 61028ee5f5f39f435bf9c461f8073e75bca344ac | [
"BSD-3-Clause"
] | 11 | 2017-06-27T11:41:42.000Z | 2020-10-12T04:59:25.000Z | TranskribusDU/dataGenerator/listGenerator.py | Transkribus/TranskribusDU | 61028ee5f5f39f435bf9c461f8073e75bca344ac | [
"BSD-3-Clause"
] | 5 | 2017-01-12T15:55:34.000Z | 2019-10-10T05:13:20.000Z | # -*- coding: utf-8 -*-
"""
Generator.py
create (generate) annotated data
H. Déjean
copyright Xerox 2017
READ project
Developed for the EU project READ. The READ project has received funding
from the European Union's Horizon 2020 research and innovation programme
... | 27.714286 | 78 | 0.616214 | # -*- coding: utf-8 -*-
"""
Generator.py
create (generate) annotated data
H. Déjean
copyright Xerox 2017
READ project
Developed for the EU project READ. The READ project has received funding
from the European Union's Horizon 2020 research and innovation programme
... | 1,080 | 0 | 127 |
2c42890db6031cc677c08ff723065a333ef5d90f | 606 | py | Python | examples/wagsley/posts/query.py | Blogsley/blogsley | 0ca17397af5d53c2fac3affb5eacec2f8d941d37 | [
"MIT"
] | null | null | null | examples/wagsley/posts/query.py | Blogsley/blogsley | 0ca17397af5d53c2fac3affb5eacec2f8d941d37 | [
"MIT"
] | null | null | null | examples/wagsley/posts/query.py | Blogsley/blogsley | 0ca17397af5d53c2fac3affb5eacec2f8d941d37 | [
"MIT"
] | null | null | null | from channels.db import database_sync_to_async
from wagsley.schema.base import query
#from .models import Post
from puput.models import EntryPage as Post
from .schema import PostConnection, PostEdge, PostNode
@query.field("allPosts")
@database_sync_to_async
@query.field("post")
@database_sync_to_async
| 26.347826 | 72 | 0.744224 | from channels.db import database_sync_to_async
from wagsley.schema.base import query
#from .models import Post
from puput.models import EntryPage as Post
from .schema import PostConnection, PostEdge, PostNode
@query.field("allPosts")
@database_sync_to_async
def resolve_all_posts(root, info, after='', before='', firs... | 254 | 0 | 44 |
b8e1786b80dbf630895bde9a5cc7acb6bc8a4ded | 175 | py | Python | data_analysis/study_numpy/_test.py | 2581676612/python | b309564a05838b23044bb8112fd4ef71307266b6 | [
"MIT"
] | 112 | 2017-09-19T17:38:38.000Z | 2020-05-27T18:00:27.000Z | data_analysis/study_numpy/_test.py | tomoncle/Python-notes | ce675486290c3d1c7c2e4890b57e3d0c8a1228cc | [
"MIT"
] | null | null | null | data_analysis/study_numpy/_test.py | tomoncle/Python-notes | ce675486290c3d1c7c2e4890b57e3d0c8a1228cc | [
"MIT"
] | 56 | 2017-09-20T01:24:12.000Z | 2020-04-16T06:19:31.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2017/9/5 22:35
# @Author : Tom.lee
# @Site :
# @File : _test.py
# @Software: PyCharm
# import numpy as np
| 15.909091 | 27 | 0.548571 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2017/9/5 22:35
# @Author : Tom.lee
# @Site :
# @File : _test.py
# @Software: PyCharm
# import numpy as np
| 0 | 0 | 0 |
13494d88fb6de4017af3bfc9d93581ec15819874 | 1,298 | py | Python | release/stubs.min/Autodesk/Revit/DB/Structure/__init___parts/StructuralInstanceUsage.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 182 | 2017-06-27T02:26:15.000Z | 2022-03-30T18:53:43.000Z | release/stubs.min/Autodesk/Revit/DB/Structure/__init___parts/StructuralInstanceUsage.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 28 | 2017-06-27T13:38:23.000Z | 2022-03-15T11:19:44.000Z | release/stubs.min/Autodesk/Revit/DB/Structure/__init___parts/StructuralInstanceUsage.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 67 | 2017-06-28T09:43:59.000Z | 2022-03-20T21:17:10.000Z | class StructuralInstanceUsage(Enum,IComparable,IFormattable,IConvertible):
"""
Represents the structural usage of a family instance.
enum StructuralInstanceUsage,values: Automatic (10),Brace (7),Column (2),Girder (3),HorizontalBracing (8),Joist (4),KickerBracing (9),Other (6),Purlin (5),TrussChord (11),Tru... | 27.617021 | 215 | 0.684129 | class StructuralInstanceUsage(Enum,IComparable,IFormattable,IConvertible):
"""
Represents the structural usage of a family instance.
enum StructuralInstanceUsage,values: Automatic (10),Brace (7),Column (2),Girder (3),HorizontalBracing (8),Joist (4),KickerBracing (9),Other (6),Purlin (5),TrussChord (11),Tru... | 78 | 0 | 168 |
00cf6396a61cbc100d6351dde2489c0a8ce7f50f | 13,553 | py | Python | regular_language/common_substring_reducer.py | ShoYamanishi/nlpregex | 795b36d5a2fad8bc25264b2093ffa9c3723b282b | [
"MIT"
] | 1 | 2021-12-03T07:20:18.000Z | 2021-12-03T07:20:18.000Z | regular_language/common_substring_reducer.py | ShoYamanishi/nlpregex | 795b36d5a2fad8bc25264b2093ffa9c3723b282b | [
"MIT"
] | null | null | null | regular_language/common_substring_reducer.py | ShoYamanishi/nlpregex | 795b36d5a2fad8bc25264b2093ffa9c3723b282b | [
"MIT"
] | null | null | null | #!/usr/local/bin/python
# -*- coding: utf-8 -*-
import nlpregex.abs_graph.double_link
import nlpregex.abs_graph.node
import nlpregex.abs_graph.edge
import nlpregex.abs_graph.graph
# @brief
# @param token_pairs: list of tuple of (first token, second token)
# @brief main public function to find and re... | 32.501199 | 155 | 0.556261 | #!/usr/local/bin/python
# -*- coding: utf-8 -*-
import nlpregex.abs_graph.double_link
import nlpregex.abs_graph.node
import nlpregex.abs_graph.edge
import nlpregex.abs_graph.graph
class CommonSubstringReducer():
def __init__(self, forrest, min_num_subtrees = 2, min_num_terms = 2 ):
self.forrest = forr... | 12,815 | 10 | 372 |
e30d9de8870f769f29de694a9fc15e01e27ecccb | 167 | py | Python | ixnetwork_restpy/assistants/sessions/__init__.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | 20 | 2019-05-07T01:59:14.000Z | 2022-02-11T05:24:47.000Z | ixnetwork_restpy/assistants/sessions/__init__.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | 60 | 2019-04-03T18:59:35.000Z | 2022-02-22T12:05:05.000Z | ixnetwork_restpy/assistants/sessions/__init__.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | 13 | 2019-05-20T10:48:31.000Z | 2021-10-06T07:45:44.000Z | from ixnetwork_restpy.assistants.statistics.statviewassistant import StatViewAssistant
from ixnetwork_restpy.assistants.ports.portmapassistant import PortMapAssistant
| 55.666667 | 86 | 0.916168 | from ixnetwork_restpy.assistants.statistics.statviewassistant import StatViewAssistant
from ixnetwork_restpy.assistants.ports.portmapassistant import PortMapAssistant
| 0 | 0 | 0 |
dc8662cf532e452beb1d3b6f6b8cc74146d1672a | 969 | py | Python | benchmarking/PresentInfo.py | jagoPG/ud-videogames | c6e614f2a71778fb98381786d3eff0558c411708 | [
"MIT"
] | null | null | null | benchmarking/PresentInfo.py | jagoPG/ud-videogames | c6e614f2a71778fb98381786d3eff0558c411708 | [
"MIT"
] | null | null | null | benchmarking/PresentInfo.py | jagoPG/ud-videogames | c6e614f2a71778fb98381786d3eff0558c411708 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- encoding: utf-8 -*-
| 33.413793 | 115 | 0.74613 | #!/usr/bin/python3
# -*- encoding: utf-8 -*-
class PresentInfo:
def __init__(self, time_in_seconds, ms_between_presents, ms_between_display_change, ms_until_render_complete, \
ms_until_displayed):
self.time_in_seconds = time_in_seconds
self.ms_between_presents = ms_between_presents
s... | 717 | -3 | 210 |
38b05d8021a693948318f342e4e7b59291e8e2c5 | 5,846 | py | Python | pgd_eval.py | sungyoon-lee/LossLandscapeMatters | b805939c56eea33beda86560a1289c35878d93de | [
"BSD-2-Clause"
] | 3 | 2021-11-19T12:05:57.000Z | 2021-12-10T08:17:33.000Z | pgd_eval.py | sungyoon-lee/LossLandscapeMatters | b805939c56eea33beda86560a1289c35878d93de | [
"BSD-2-Clause"
] | null | null | null | pgd_eval.py | sungyoon-lee/LossLandscapeMatters | b805939c56eea33beda86560a1289c35878d93de | [
"BSD-2-Clause"
] | 1 | 2021-11-24T01:37:41.000Z | 2021-11-24T01:37:41.000Z | import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
from torchvision import datasets, transforms
from torch.optim.lr_scheduler import StepLR, MultiStepLR
import torch.nn.functional as F
from torch import autograd
from torch.utils.data import Dataset, Da... | 35.865031 | 100 | 0.5857 | import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
from torchvision import datasets, transforms
from torch.optim.lr_scheduler import StepLR, MultiStepLR
import torch.nn.functional as F
from torch import autograd
from torch.utils.data import Dataset, Da... | 5,138 | 0 | 199 |
bf9d6bb330a85c9caacb44ac44cc1acd59ccad8f | 5,211 | py | Python | allink_core/core_apps/allink_image/migrations/0001_initial.py | allink/allink-core | cf2727f26192d8dee89d76feb262bc4760f36f5e | [
"BSD-3-Clause"
] | 5 | 2017-03-13T08:49:45.000Z | 2022-03-05T20:05:56.000Z | allink_core/core_apps/allink_image/migrations/0001_initial.py | allink/allink-core | cf2727f26192d8dee89d76feb262bc4760f36f5e | [
"BSD-3-Clause"
] | 28 | 2019-10-21T08:32:18.000Z | 2022-02-10T13:16:38.000Z | allink_core/core_apps/allink_image/migrations/0001_initial.py | allink/allink-core | cf2727f26192d8dee89d76feb262bc4760f36f5e | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 2.1.8 on 2019-07-02 17:18
import cms.models.fields
from django.conf import settings
import django.contrib.postgres.fields
from django.db import migrations, models
import django.db.models.deletion
import djangocms_attributes_field.fields
import filer.fields.file
import filer.fields.image
| 89.844828 | 362 | 0.700058 | # Generated by Django 2.1.8 on 2019-07-02 17:18
import cms.models.fields
from django.conf import settings
import django.contrib.postgres.fields
from django.db import migrations, models
import django.db.models.deletion
import djangocms_attributes_field.fields
import filer.fields.file
import filer.fields.image
class M... | 0 | 4,876 | 23 |
d37dfdf7e792fb037230bc307744cd1ee0f4b8a5 | 1,077 | py | Python | src/enemy.py | NishanthRachakonda/mario-bash | ad5b053edca5a69df3741d4fe1b4ec87b6e5f5b4 | [
"Apache-2.0"
] | null | null | null | src/enemy.py | NishanthRachakonda/mario-bash | ad5b053edca5a69df3741d4fe1b4ec87b6e5f5b4 | [
"Apache-2.0"
] | null | null | null | src/enemy.py | NishanthRachakonda/mario-bash | ad5b053edca5a69df3741d4fe1b4ec87b6e5f5b4 | [
"Apache-2.0"
] | null | null | null | from colorama import Fore, Style
from player import *
class Enemy(Mario_reddy):
"""docstring for Enemy."""
| 31.676471 | 77 | 0.543175 | from colorama import Fore, Style
from player import *
class Enemy(Mario_reddy):
"""docstring for Enemy."""
def create_person(self, win):
win.matrix[self.x][self.y] = Style.BRIGHT + Fore.CYAN + ']'
win.matrix[self.x][self.y - 1] = Style.BRIGHT + Fore.CYAN + '['
win.matrix[self.x + 1][s... | 856 | 0 | 108 |
fa38ce881e00b5e17e68260f234ebf43190433fe | 3,119 | py | Python | gallery/gravmag/imaging_geninv.py | XuesongDing/fatiando | 57a0e0802fde2e53628511d3a7a2964e69bb309a | [
"BSD-3-Clause"
] | 179 | 2015-03-08T08:50:45.000Z | 2022-03-20T08:19:05.000Z | gallery/gravmag/imaging_geninv.py | XuesongDing/fatiando | 57a0e0802fde2e53628511d3a7a2964e69bb309a | [
"BSD-3-Clause"
] | 207 | 2015-01-12T17:04:57.000Z | 2021-01-08T23:36:11.000Z | gallery/gravmag/imaging_geninv.py | XuesongDing/fatiando | 57a0e0802fde2e53628511d3a7a2964e69bb309a | [
"BSD-3-Clause"
] | 114 | 2015-01-29T18:51:22.000Z | 2022-03-25T12:35:43.000Z | """
Potential field imaging through the Generalized Inverse method
---------------------------------------------------------------
Module :mod:`fatiando.gravmag.imaging` has functions for imaging methods in
potential fields. These methods produce an image of the subsurface without
doing an inversion. However, there is... | 34.274725 | 79 | 0.663354 | """
Potential field imaging through the Generalized Inverse method
---------------------------------------------------------------
Module :mod:`fatiando.gravmag.imaging` has functions for imaging methods in
potential fields. These methods produce an image of the subsurface without
doing an inversion. However, there is... | 0 | 0 | 0 |
9c2707ab8a78d0dd7187a30e4310a84c6269eaff | 1,647 | py | Python | scripts/FlowByActivity_Crosswalks/write_Crosswalk_Blackhurst_IO.py | JohnAndrewTaylor/flowsa | 21b14b19f08370db574bdd59219a2773983c6f95 | [
"CC0-1.0"
] | null | null | null | scripts/FlowByActivity_Crosswalks/write_Crosswalk_Blackhurst_IO.py | JohnAndrewTaylor/flowsa | 21b14b19f08370db574bdd59219a2773983c6f95 | [
"CC0-1.0"
] | null | null | null | scripts/FlowByActivity_Crosswalks/write_Crosswalk_Blackhurst_IO.py | JohnAndrewTaylor/flowsa | 21b14b19f08370db574bdd59219a2773983c6f95 | [
"CC0-1.0"
] | null | null | null | # write_Crosswalk_Blackhurst.py (scripts)
# !/usr/bin/env python3
# coding=utf-8
"""
Create a crosswalk linking BEA to NAICS
"""
import pandas as pd
from flowsa.common import datapath, load_bea_crosswalk
from scripts.common_scripts import unique_activity_names, order_crosswalk
if __name__ == '__main__':
# sele... | 32.94 | 110 | 0.704311 | # write_Crosswalk_Blackhurst.py (scripts)
# !/usr/bin/env python3
# coding=utf-8
"""
Create a crosswalk linking BEA to NAICS
"""
import pandas as pd
from flowsa.common import datapath, load_bea_crosswalk
from scripts.common_scripts import unique_activity_names, order_crosswalk
def assign_naics(df):
cw_load = l... | 605 | 0 | 23 |
aa38a4f4514466968318503364c137f48336f7a3 | 456 | py | Python | geohash-tool/scripts/gp_get_geohash.py | fabanc/sig-2021-demos | 20152ca7827d9e4d4db9c443ca8dbf07ccebf74f | [
"Apache-2.0"
] | null | null | null | geohash-tool/scripts/gp_get_geohash.py | fabanc/sig-2021-demos | 20152ca7827d9e4d4db9c443ca8dbf07ccebf74f | [
"Apache-2.0"
] | null | null | null | geohash-tool/scripts/gp_get_geohash.py | fabanc/sig-2021-demos | 20152ca7827d9e4d4db9c443ca8dbf07ccebf74f | [
"Apache-2.0"
] | null | null | null | import arcpy
if __name__ == '__main__':
process(
feature_class=arcpy.GetParameterAsText(0),
field=arcpy.GetParameterAsText(1)
) | 24 | 75 | 0.616228 | import arcpy
def process(feature_class, field, precision=8):
with arcpy.da.UpdateCursor(feature_class, ['SHAPE@', field]) as cursor:
for row in cursor:
geom = row[0]
geohash = geom.getGeohash(precision)
row[1] = geohash
cursor.updateRow(row)
return
if... | 279 | 0 | 23 |
e28df365921b7d1a374d02bb373b246faaa78a26 | 2,997 | py | Python | download_images.py | osteele/matrix-archive | a35e70a76ecd36290cafd53ed10e5a54fd969e7d | [
"MIT"
] | 15 | 2019-04-25T00:29:45.000Z | 2022-03-09T21:11:52.000Z | download_images.py | osteele/matrix-archive | a35e70a76ecd36290cafd53ed10e5a54fd969e7d | [
"MIT"
] | 8 | 2019-09-01T22:12:15.000Z | 2021-06-17T05:55:03.000Z | download_images.py | osteele/matrix-archive | a35e70a76ecd36290cafd53ed10e5a54fd969e7d | [
"MIT"
] | 11 | 2019-05-10T16:19:56.000Z | 2021-03-30T07:24:50.000Z | from pathlib import Path
from urllib.parse import urlparse
import click
import requests
import database_connection # noqa: F401
from matrix_connection import get_download_url
from schema import Message
def run_downloads(messages, download_dir, prefer_thumbnails):
"""Run downloads
:param messages: List of... | 36.54878 | 93 | 0.627628 | from pathlib import Path
from urllib.parse import urlparse
import click
import requests
import database_connection # noqa: F401
from matrix_connection import get_download_url
from schema import Message
def download_stem(message, prefer_thumbnails):
image_url = (message.thumbnail_url if prefer_thumbnails else N... | 175 | 0 | 23 |
72dc1e0e69e79c0cdc49e1e8f93793fc10b1a765 | 30,701 | py | Python | AppServer/google/appengine/api/datastore_distributed.py | UCSB-CS-RACELab/eager-appscale | d58fe64bb867ef58af19c1d84a5e1ec68ecddd3d | [
"Apache-2.0"
] | 3 | 2016-06-12T01:18:49.000Z | 2018-07-16T18:20:23.000Z | AppServer/google/appengine/api/datastore_distributed.py | davgit/appscale | 17d35a14fa5a56975de1e3517bec9e7f9047d82a | [
"Apache-2.0"
] | null | null | null | AppServer/google/appengine/api/datastore_distributed.py | davgit/appscale | 17d35a14fa5a56975de1e3517bec9e7f9047d82a | [
"Apache-2.0"
] | 1 | 2020-05-25T02:59:15.000Z | 2020-05-25T02:59:15.000Z | #!/usr/bin/env python
#
# Copyright 2007 Google 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 o... | 35.167239 | 80 | 0.682193 | #!/usr/bin/env python
#
# Copyright 2007 Google 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 o... | 0 | 0 | 0 |
e46248d0242007e8df950020ac9375faae04e301 | 14,089 | py | Python | eikon/Profile.py | tschm/eikon-docker | a72a13591b4f560442ba37d11021133434425848 | [
"Apache-2.0"
] | 3 | 2020-05-10T22:15:49.000Z | 2021-04-05T19:29:52.000Z | eikon/Profile.py | tschm/eikon-docker | a72a13591b4f560442ba37d11021133434425848 | [
"Apache-2.0"
] | null | null | null | eikon/Profile.py | tschm/eikon-docker | a72a13591b4f560442ba37d11021133434425848 | [
"Apache-2.0"
] | 1 | 2020-07-22T16:54:32.000Z | 2020-07-22T16:54:32.000Z | # coding: utf-8
__all__ = ['set_app_key', 'get_app_key',
'set_timeout', 'get_timeout',
'set_port_number', 'get_port_number',
'set_log_level', 'set_log_path',
#'set_app_id', 'get_app_id',
'set_on_state_callback', 'set_on_event_callback',
'Profile', 'get_... | 30.364224 | 126 | 0.616864 | # coding: utf-8
__all__ = ['set_app_key', 'get_app_key',
'set_timeout', 'get_timeout',
'set_port_number', 'get_port_number',
'set_log_level', 'set_log_path',
#'set_app_id', 'get_app_id',
'set_on_state_callback', 'set_on_event_callback',
'Profile', 'get_... | 3,017 | 5,270 | 92 |
9e1e9d1675eb861dcc87b5d65cb7fecdba59657d | 4,986 | py | Python | src/config.py | erramuzpe/ruber | cf510a4cf9b0b15d870b6506a1593c3b2b00a3b7 | [
"MIT"
] | 2 | 2018-11-07T07:54:34.000Z | 2022-01-13T13:06:06.000Z | src/config.py | erramuzpe/ruber | cf510a4cf9b0b15d870b6506a1593c3b2b00a3b7 | [
"MIT"
] | null | null | null | src/config.py | erramuzpe/ruber | cf510a4cf9b0b15d870b6506a1593c3b2b00a3b7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Configuration manager for workflow definitions.
This works over Kaptan:https://github.com/emre/kaptan
The global configuration registry is declared in the bottom of this file.
"""
import os.path as op
from nipype.pipeline.engine import Node, MapNode, JoinNode
from nipype.interfaces.bas... | 31.1625 | 98 | 0.623546 | # -*- coding: utf-8 -*-
"""
Configuration manager for workflow definitions.
This works over Kaptan:https://github.com/emre/kaptan
The global configuration registry is declared in the bottom of this file.
"""
import os.path as op
from nipype.pipeline.engine import Node, MapNode, JoinNode
from nipype.interfaces.bas... | 920 | 0 | 92 |
d01dbd301a5cd072753908fa21e832c254f059a3 | 300 | py | Python | tests/test_format_as_si.py | l-johnston/toolbag | 1bd6ca61bfaf5856e5de320926d5593291e39e9c | [
"MIT"
] | null | null | null | tests/test_format_as_si.py | l-johnston/toolbag | 1bd6ca61bfaf5856e5de320926d5593291e39e9c | [
"MIT"
] | null | null | null | tests/test_format_as_si.py | l-johnston/toolbag | 1bd6ca61bfaf5856e5de320926d5593291e39e9c | [
"MIT"
] | null | null | null | from toolbag import format_as_si
| 30 | 57 | 0.63 | from toolbag import format_as_si
def test_some_values():
assert format_as_si(0, "m") == "0 m"
assert format_as_si(999, "Hz") == "999 Hz"
assert format_as_si(10000, "Hz") == "10 kHz"
assert format_as_si(0.001, "m") == "1 mm"
assert format_as_si(1.000001, "m", 6) == "1.000001 m"
| 243 | 0 | 23 |
e27dd9bddb4d99147e7d7179527777741f69f83d | 149 | py | Python | siamese-net/config.py | sanjayram97/siamese-neuralnet | 1f7db1d0f92fb48a4acfcc8d7e1f06d51f1b4589 | [
"MIT"
] | null | null | null | siamese-net/config.py | sanjayram97/siamese-neuralnet | 1f7db1d0f92fb48a4acfcc8d7e1f06d51f1b4589 | [
"MIT"
] | null | null | null | siamese-net/config.py | sanjayram97/siamese-neuralnet | 1f7db1d0f92fb48a4acfcc8d7e1f06d51f1b4589 | [
"MIT"
] | null | null | null | import os
TRAIN_IMG_PATH = r"C:\Users\ASUS\Documents\Projects\Siamese_network\package\output"
IMG_SHAPE = (28, 28, 1)
BATCH_SIZE = 64
EPOCHS = 100
| 18.625 | 83 | 0.758389 | import os
TRAIN_IMG_PATH = r"C:\Users\ASUS\Documents\Projects\Siamese_network\package\output"
IMG_SHAPE = (28, 28, 1)
BATCH_SIZE = 64
EPOCHS = 100
| 0 | 0 | 0 |
c7ea799de142f79dec8a794644bed0d00d4affbf | 1,420 | py | Python | app/make_requests.py | tagg7/battlesnake2019-ml | 87641b5b83bfd79cbbccb27f8ff29e1b966ea3fa | [
"MIT"
] | null | null | null | app/make_requests.py | tagg7/battlesnake2019-ml | 87641b5b83bfd79cbbccb27f8ff29e1b966ea3fa | [
"MIT"
] | null | null | null | app/make_requests.py | tagg7/battlesnake2019-ml | 87641b5b83bfd79cbbccb27f8ff29e1b966ea3fa | [
"MIT"
] | 1 | 2022-02-24T21:57:52.000Z | 2022-02-24T21:57:52.000Z | import requests
import json
import sys
from time import sleep
if __name__ == '__main__':
iterations = 50
if len(sys.argv) > 1:
iterations = int(sys.argv[1])
for x in xrange(iterations):
game_id = createGame()
startGame(game_id)
waitForGameEnd(game_id)
print("Game Ended: %d - %s" % (x + 1, game_id)) | 24.912281 | 66 | 0.685211 | import requests
import json
import sys
from time import sleep
def createGame():
url = "http://localhost:3005/games"
headers = {'Content-type': 'text/plain', 'Accept': 'text/plain'}
payload = {
"width":15,
"height":15,
"food":1,
"MaxTurnsToNextFoodSpawn":0,
"snakes":[{"name":"Test","url":"http://localhost... | 1,035 | 0 | 69 |
c237b75115000b9c36d090703eab5d288d0772de | 5,650 | py | Python | python/pumapy/__init__.py | dalexa10/puma | ca02309c9f5c71e2e80ad8d64155dd6ca936c667 | [
"NASA-1.3"
] | null | null | null | python/pumapy/__init__.py | dalexa10/puma | ca02309c9f5c71e2e80ad8d64155dd6ca936c667 | [
"NASA-1.3"
] | null | null | null | python/pumapy/__init__.py | dalexa10/puma | ca02309c9f5c71e2e80ad8d64155dd6ca936c667 | [
"NASA-1.3"
] | null | null | null | """
Copyright @ 2017, 2020, 2021 United States Government as represented by the Administrator of the National Aeronautics and Space Administration. All Rights Reserved.
This software may be used, reproduced, and provided to others only as permitted under the terms of the agreement under which it was acquired from the U... | 78.472222 | 1,062 | 0.835398 | """
Copyright @ 2017, 2020, 2021 United States Government as represented by the Administrator of the National Aeronautics and Space Administration. All Rights Reserved.
This software may be used, reproduced, and provided to others only as permitted under the terms of the agreement under which it was acquired from the U... | 0 | 0 | 0 |
ce0a37cec027e541fb330fc73670de84f0db2080 | 1,839 | py | Python | scripts/log.py | mfkiwl/higgs_sdr_rev2 | 12f8174b0f385dce4f0da943bba0dde2732d96b5 | [
"BSD-3-Clause"
] | 1 | 2021-07-04T05:19:32.000Z | 2021-07-04T05:19:32.000Z | scripts/log.py | mfkiwl/higgs_sdr_rev2 | 12f8174b0f385dce4f0da943bba0dde2732d96b5 | [
"BSD-3-Clause"
] | null | null | null | scripts/log.py | mfkiwl/higgs_sdr_rev2 | 12f8174b0f385dce4f0da943bba0dde2732d96b5 | [
"BSD-3-Clause"
] | 2 | 2021-07-04T05:19:36.000Z | 2022-03-11T09:16:27.000Z | ###############################################################################
###############################################################################
# Name: log.py
# Coder: Janson Fang
# Description:
# This module contains a method used create a logger
######################################################... | 38.3125 | 79 | 0.405111 | ###############################################################################
###############################################################################
# Name: log.py
# Coder: Janson Fang
# Description:
# This module contains a method used create a logger
######################################################... | 0 | 0 | 0 |
1477cdbe428472416cd3c9c6110b1c3bcd58e5a1 | 2,491 | py | Python | branching_iteration.py | gtsofa/yt | 82a41a9de5be8b45905f9251cbc4240ad7299d79 | [
"MIT"
] | null | null | null | branching_iteration.py | gtsofa/yt | 82a41a9de5be8b45905f9251cbc4240ad7299d79 | [
"MIT"
] | null | null | null | branching_iteration.py | gtsofa/yt | 82a41a9de5be8b45905f9251cbc4240ad7299d79 | [
"MIT"
] | null | null | null | # branching_iteration.py
# name = "tsofa"
# greeting = "hi " + name
# print(greeting)
# #text = raw_input("type anything please")
# text = str(input("type anything please"))
# print(5*text)
# # if true prog ends and doesn't look at other conditions.
# x = float(input("Enter a value for x: "))
# y = float(input("Ente... | 23.951923 | 102 | 0.602168 | # branching_iteration.py
# name = "tsofa"
# greeting = "hi " + name
# print(greeting)
# #text = raw_input("type anything please")
# text = str(input("type anything please"))
# print(5*text)
# # if true prog ends and doesn't look at other conditions.
# x = float(input("Enter a value for x: "))
# y = float(input("Ente... | 0 | 0 | 0 |
f92cdd22cf4844b160d0d875a200886844e27e74 | 1,111 | py | Python | anchore_engine/subsys/events/__init__.py | rbrady/anchore-engine | 5a5c492d76b5f911e60be422912fe8d42a74872b | [
"Apache-2.0"
] | 1,484 | 2017-09-11T19:08:42.000Z | 2022-03-29T07:47:44.000Z | anchore_engine/subsys/events/__init__.py | rbrady/anchore-engine | 5a5c492d76b5f911e60be422912fe8d42a74872b | [
"Apache-2.0"
] | 913 | 2017-09-27T20:37:53.000Z | 2022-03-29T17:21:28.000Z | anchore_engine/subsys/events/__init__.py | rbrady/anchore-engine | 5a5c492d76b5f911e60be422912fe8d42a74872b | [
"Apache-2.0"
] | 294 | 2017-09-12T16:54:03.000Z | 2022-03-14T01:28:51.000Z | """
Holds event definitions to be used by services for generating events
"""
from .base import EventBase
from .types import (
ActivePolicyBundleContentChanged,
ActivePolicyBundleIdChanged,
FeedGroupSyncCompleted,
FeedGroupSyncFailed,
FeedGroupSyncStarted,
FeedSyncCompleted,
FeedSyncFailed,
... | 25.837209 | 113 | 0.766877 | """
Holds event definitions to be used by services for generating events
"""
from .base import EventBase
from .types import (
ActivePolicyBundleContentChanged,
ActivePolicyBundleIdChanged,
FeedGroupSyncCompleted,
FeedGroupSyncFailed,
FeedGroupSyncStarted,
FeedSyncCompleted,
FeedSyncFailed,
... | 0 | 0 | 0 |
8ca45349b1eb064280c58e148b0a0e9c51b9dece | 442 | py | Python | ambari-agent/src/main/python/resource_management/core/resources/packaging.py | flipkart-incubator/incubator-ambari | bf747346312170834c6beb89a60c8624b47aa288 | [
"Apache-2.0"
] | 2 | 2015-07-29T22:50:10.000Z | 2021-11-10T16:05:59.000Z | ambari-agent/src/main/python/resource_management/core/resources/packaging.py | boydos/incubator-ambari | e10d85756dd55729c20aeda2baa0d6c93c4ca31d | [
"Apache-2.0"
] | 1 | 2021-11-04T13:31:30.000Z | 2021-11-04T13:31:30.000Z | ambari-agent/src/main/python/resource_management/core/resources/packaging.py | isabella232/incubator-ambari | bf747346312170834c6beb89a60c8624b47aa288 | [
"Apache-2.0"
] | 9 | 2016-01-08T21:11:06.000Z | 2021-11-10T16:05:51.000Z | __all__ = ["Package"]
from resource_management.core.base import Resource, ForcedListArgument, ResourceArgument
| 34 | 88 | 0.773756 | __all__ = ["Package"]
from resource_management.core.base import Resource, ForcedListArgument, ResourceArgument
class Package(Resource):
action = ForcedListArgument(default="install")
package_name = ResourceArgument(default=lambda obj: obj.name)
location = ResourceArgument(default=lambda obj: obj.package_name)
... | 0 | 306 | 23 |
e324e7c1b36c5460061a6797dbb9a6ac44adb3a8 | 1,391 | py | Python | embedding.py | hyunahOh/mlflow-hyperopts-keras | 05cee0dcbeb03b469b60f495e7806946690f76bf | [
"Apache-2.0"
] | null | null | null | embedding.py | hyunahOh/mlflow-hyperopts-keras | 05cee0dcbeb03b469b60f495e7806946690f76bf | [
"Apache-2.0"
] | 11 | 2020-03-24T18:22:22.000Z | 2022-02-10T00:43:58.000Z | embedding.py | hyunahOh/mlflow-hyperopts-keras | 05cee0dcbeb03b469b60f495e7806946690f76bf | [
"Apache-2.0"
] | null | null | null | '''This code is for Embedding face
author : Hyunah Oh
data : 2020.01.22
flow : Detection -> Alignment -> Normalization -> Embedding(load pretrained) -> Training Classification
'''
import numpy as np
import cv2
from data import load_metadata
from model import create_model
from align import AlignDlib
from sklearn.ext... | 31.613636 | 104 | 0.721783 | '''This code is for Embedding face
author : Hyunah Oh
data : 2020.01.22
flow : Detection -> Alignment -> Normalization -> Embedding(load pretrained) -> Training Classification
'''
import numpy as np
import cv2
from data import load_metadata
from model import create_model
from align import AlignDlib
from sklearn.ext... | 301 | 0 | 45 |
db311a44bf39043a873564ab0bc6931596f93a37 | 713 | py | Python | pbesa/engine/rational/ActionExe.py | scottwedge/pbesa | 21b161538aa0c508088dc47a3a88413b6fd6504d | [
"MIT"
] | 2 | 2020-10-22T22:23:40.000Z | 2021-09-14T01:18:01.000Z | pbesa/engine/rational/ActionExe.py | scottwedge/pbesa | 21b161538aa0c508088dc47a3a88413b6fd6504d | [
"MIT"
] | 2 | 2020-05-27T13:59:42.000Z | 2022-03-02T14:58:12.000Z | pbesa/engine/rational/ActionExe.py | scottwedge/pbesa | 21b161538aa0c508088dc47a3a88413b6fd6504d | [
"MIT"
] | 1 | 2020-05-27T13:50:40.000Z | 2020-05-27T13:50:40.000Z | from threading import Thread
import time
import random | 20.371429 | 54 | 0.548387 | from threading import Thread
import time
import random
class ActionExe(Thread):
let = None
pool = None
alive = None
action = None
def __init__(self, pool):
self.let = False
self.pool = pool
self.alive = True
super().__init__()
def run(self):
while self... | 404 | 232 | 23 |
b879f1e8e657c94441abdc0112a00c1c4aba52e5 | 3,979 | py | Python | pw_console/py/text_formatting_test.py | curtin-space/pigweed | fe2e1743e03fabd2676f01d9de0ac9d34a426076 | [
"Apache-2.0"
] | 86 | 2021-03-09T23:49:40.000Z | 2022-03-30T08:14:51.000Z | pw_console/py/text_formatting_test.py | curtin-space/pigweed | fe2e1743e03fabd2676f01d9de0ac9d34a426076 | [
"Apache-2.0"
] | 4 | 2021-07-27T20:32:03.000Z | 2022-03-08T10:39:07.000Z | pw_console/py/text_formatting_test.py | curtin-space/pigweed | fe2e1743e03fabd2676f01d9de0ac9d34a426076 | [
"Apache-2.0"
] | 22 | 2021-03-11T15:15:47.000Z | 2022-02-09T06:16:36.000Z | # Copyright 2021 The Pigweed 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 41.884211 | 79 | 0.520483 | # Copyright 2021 The Pigweed 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 0 | 0 | 0 |
4b3cb441266c341a2e56d44ffcb1690ec5abff9b | 4,327 | py | Python | FirstQT/main.py | BlackIQ/Cute | 5835e989d661f23b04b6e436589c6e844167522e | [
"Apache-2.0"
] | 5 | 2021-11-21T10:59:47.000Z | 2022-01-16T11:57:14.000Z | FirstQT/main.py | BlackIQ/Cute | 5835e989d661f23b04b6e436589c6e844167522e | [
"Apache-2.0"
] | null | null | null | FirstQT/main.py | BlackIQ/Cute | 5835e989d661f23b04b6e436589c6e844167522e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'amir.ui'
#
# Created by: PyQt5 UI code generator 5.14.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
if __name__ == "__main__":
import sys
app = QtWidgets.QAp... | 40.820755 | 121 | 0.629073 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'amir.ui'
#
# Created by: PyQt5 UI code generator 5.14.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
... | 3,665 | 7 | 168 |
6d7f765d388547e0941cf83e32109d3d03464cd6 | 23,382 | py | Python | zhmccli/_cmd_cpc.py | mhartmay/zhmccli | 9cb627406c38cf32b0a07cea6d50ac6b6a505802 | [
"Apache-2.0"
] | null | null | null | zhmccli/_cmd_cpc.py | mhartmay/zhmccli | 9cb627406c38cf32b0a07cea6d50ac6b6a505802 | [
"Apache-2.0"
] | null | null | null | zhmccli/_cmd_cpc.py | mhartmay/zhmccli | 9cb627406c38cf32b0a07cea6d50ac6b6a505802 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016-2019 IBM Corp. 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... | 36.195046 | 80 | 0.67274 | # Copyright 2016-2019 IBM Corp. 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... | 9,414 | 0 | 230 |
13fa62ca2dc5b21125cd0a56d545b18d469c9039 | 3,766 | py | Python | test/integration/python/tornado/vanilla_server.py | ariasheets-wk/frugal | 81d41af7fb573c1f97afea99a1b4dfa6ccae29e8 | [
"Apache-2.0"
] | 144 | 2017-08-17T15:51:58.000Z | 2022-01-14T21:36:55.000Z | test/integration/python/tornado/vanilla_server.py | ariasheets-wk/frugal | 81d41af7fb573c1f97afea99a1b4dfa6ccae29e8 | [
"Apache-2.0"
] | 930 | 2017-08-17T17:53:30.000Z | 2022-03-28T14:04:49.000Z | test/integration/python/tornado/vanilla_server.py | ariasheets-wk/frugal | 81d41af7fb573c1f97afea99a1b4dfa6ccae29e8 | [
"Apache-2.0"
] | 77 | 2017-08-17T15:54:31.000Z | 2021-12-25T15:18:34.000Z | from __future__ import print_function
import argparse
import sys
import thread
sys.path.append('..')
sys.path.append('gen-py')
from frugal.context import FContext
from frugal.provider import FScopeProvider
from frugal.server.http_server import FHttpServer
from frugal.tornado.transport import FNatsPublisherTransportF... | 37.66 | 130 | 0.745088 | from __future__ import print_function
import argparse
import sys
import thread
sys.path.append('..')
sys.path.append('gen-py')
from frugal.context import FContext
from frugal.provider import FScopeProvider
from frugal.server.http_server import FHttpServer
from frugal.tornado.transport import FNatsPublisherTransportF... | 2,518 | 0 | 67 |
519d7183b21627a78c8944fde84e92d25f4bd3ef | 2,986 | py | Python | src/module/embedding.py | wangqi1996/joeynmt_test | b9d1cd1038a9e9d3ba378eb2d1efaefbdbfba800 | [
"MIT"
] | null | null | null | src/module/embedding.py | wangqi1996/joeynmt_test | b9d1cd1038a9e9d3ba378eb2d1efaefbdbfba800 | [
"MIT"
] | null | null | null | src/module/embedding.py | wangqi1996/joeynmt_test | b9d1cd1038a9e9d3ba378eb2d1efaefbdbfba800 | [
"MIT"
] | null | null | null | # coding=utf-8
import math
import torch
from torch import Tensor
from torch import nn
from src.util.model_util import freeze_params
class Embeddings(nn.Module):
"""
simple embedding class
"""
def __init__(self, embedding_dim: int = 64, scale: bool = False, vocab_size: int = 0,
... | 30.161616 | 118 | 0.566644 | # coding=utf-8
import math
import torch
from torch import Tensor
from torch import nn
from src.util.model_util import freeze_params
class Embeddings(nn.Module):
"""
simple embedding class
"""
def __init__(self, embedding_dim: int = 64, scale: bool = False, vocab_size: int = 0,
... | 131 | 0 | 29 |
daefbbe84e3a59594d63abdc51c61cbd5d4cd301 | 14,103 | py | Python | IRIS_data_download/IRIS_download_support/obspy/io/shapefile/core.py | earthinversion/Fnet_IRIS_data_automated_download | 09a6e0c992662feac95744935e038d1c68539fa1 | [
"MIT"
] | 2 | 2020-03-05T01:03:01.000Z | 2020-12-17T05:04:07.000Z | IRIS_data_download/IRIS_download_support/obspy/io/shapefile/core.py | earthinversion/Fnet_IRIS_data_automated_download | 09a6e0c992662feac95744935e038d1c68539fa1 | [
"MIT"
] | 4 | 2021-03-31T19:25:55.000Z | 2021-12-13T20:32:46.000Z | IRIS_data_download/IRIS_download_support/obspy/io/shapefile/core.py | earthinversion/Fnet_IRIS_data_automated_download | 09a6e0c992662feac95744935e038d1c68539fa1 | [
"MIT"
] | 2 | 2020-09-08T19:33:40.000Z | 2021-04-05T09:47:50.000Z | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from future.builtins import * # NOQA
from future.utils import native_str
import datetime
import re
import warnings
from obspy import Catalog, UTCDateTime
from obspy.core.event import O... | 39.726761 | 79 | 0.582287 | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from future.builtins import * # NOQA
from future.utils import native_str
import datetime
import re
import warnings
from obspy import Catalog, UTCDateTime
from obspy.core.event import O... | 3,122 | 0 | 69 |
b40d5bee8e900dbc24a46b079720cea40ee58eaa | 2,768 | py | Python | app/requests.py | KiyaiB/News-App | a4baa1757ed80076d0084f96b50d0882d7c9a421 | [
"MIT"
] | 1 | 2022-01-08T17:28:06.000Z | 2022-01-08T17:28:06.000Z | app/requests.py | KiyaiB/News-App | a4baa1757ed80076d0084f96b50d0882d7c9a421 | [
"MIT"
] | null | null | null | app/requests.py | KiyaiB/News-App | a4baa1757ed80076d0084f96b50d0882d7c9a421 | [
"MIT"
] | 1 | 2021-11-01T16:37:32.000Z | 2021-11-01T16:37:32.000Z | import urllib.request,json
from .models import NewsSource,NewsArticle
from datetime import date
#getting api key
api_key = None
#getting news base url
base_url = None
#getting articles url
articles_url = None
def get_news_source(category):
'''
Function that gets the json response to our url request
'''
get_news... | 29.446809 | 87 | 0.78685 | import urllib.request,json
from .models import NewsSource,NewsArticle
from datetime import date
#getting api key
api_key = None
#getting news base url
base_url = None
#getting articles url
articles_url = None
def configure_request(app):
global api_key,base_url,articles_url
api_key = app.config['NEWS_API_KEY']
ba... | 174 | 0 | 23 |
d3d9620abca9eca6b0c21af810fb2fc16fb001fa | 16,151 | py | Python | tests/test_services/test_set_207.py | yangyimincn/ucloud-sdk-python3 | 9732d67f32ec5f46467458ba655c44c193a6bbff | [
"Apache-2.0"
] | 37 | 2019-06-19T09:41:34.000Z | 2022-02-18T08:06:00.000Z | tests/test_services/test_set_207.py | yangyimincn/ucloud-sdk-python3 | 9732d67f32ec5f46467458ba655c44c193a6bbff | [
"Apache-2.0"
] | 90 | 2019-08-09T09:27:33.000Z | 2022-03-30T15:54:55.000Z | tests/test_services/test_set_207.py | yangyimincn/ucloud-sdk-python3 | 9732d67f32ec5f46467458ba655c44c193a6bbff | [
"Apache-2.0"
] | 19 | 2019-06-13T02:46:01.000Z | 2021-11-01T07:22:18.000Z | """ Code is generated by ucloud-model, DO NOT EDIT IT. """
import pytest
import logging
from ucloud.core import exc
from ucloud.testing import env, funcs, op, utest
logger = logging.getLogger(__name__)
scenario = utest.Scenario(207)
@pytest.mark.skipif(env.is_ut(), reason=env.get_skip_reason())
@scenario.step(... | 26.261789 | 78 | 0.611046 | """ Code is generated by ucloud-model, DO NOT EDIT IT. """
import pytest
import logging
from ucloud.core import exc
from ucloud.testing import env, funcs, op, utest
logger = logging.getLogger(__name__)
scenario = utest.Scenario(207)
@pytest.mark.skipif(env.is_ut(), reason=env.get_skip_reason())
def test_set_207(... | 9,240 | 0 | 484 |
beac2ac8e5d1ff955264ee8cc1c57261d7898f3e | 758 | py | Python | cryptorip/cryptorip.py | bradagy/cryptorip | 648b12eccfea1edebb4ce53fa1b613d4b1bdf581 | [
"MIT"
] | null | null | null | cryptorip/cryptorip.py | bradagy/cryptorip | 648b12eccfea1edebb4ce53fa1b613d4b1bdf581 | [
"MIT"
] | 1 | 2021-06-02T00:45:30.000Z | 2021-06-02T00:45:30.000Z | cryptorip/cryptorip.py | bradagy/cryptorip | 648b12eccfea1edebb4ce53fa1b613d4b1bdf581 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
from crfunctions import btcprice
from crfunctions import ltcprice
from crfunctions import ethprice
parser = argparse.ArgumentParser()
parser.add_argument('--btc', dest='btcprice', help='Displays the current price of Bitcoin.',default=False,
action='store_... | 28.074074 | 108 | 0.69657 | #!/usr/bin/env python3
import argparse
from crfunctions import btcprice
from crfunctions import ltcprice
from crfunctions import ethprice
parser = argparse.ArgumentParser()
parser.add_argument('--btc', dest='btcprice', help='Displays the current price of Bitcoin.',default=False,
action='store_... | 0 | 0 | 0 |
db03e1b39c004920badabccacdedf74580b585a4 | 97 | py | Python | profileuser/apps.py | brunoemori/UEM-ProgrammingContest | 30e80d9cd49bca74d9e4d5a10a5a8f22e6883820 | [
"MIT"
] | null | null | null | profileuser/apps.py | brunoemori/UEM-ProgrammingContest | 30e80d9cd49bca74d9e4d5a10a5a8f22e6883820 | [
"MIT"
] | 2 | 2021-06-10T17:38:50.000Z | 2021-09-07T23:39:47.000Z | profileuser/apps.py | brunoemori/UEM-ProgrammingContest | 30e80d9cd49bca74d9e4d5a10a5a8f22e6883820 | [
"MIT"
] | 4 | 2018-03-08T14:28:09.000Z | 2018-06-07T12:55:46.000Z | from django.apps import AppConfig
| 16.166667 | 35 | 0.773196 | from django.apps import AppConfig
class ProfileuserConfig(AppConfig):
name = 'profileuser'
| 0 | 39 | 23 |
dd58cfb203f483892b3faa9c4ab5ed2f674592f6 | 151 | py | Python | 0x03-python-data_structures/8-multiple_returns.py | malu17/alx-higher_level_programming | 75a24d98c51116b737f339697c75855e34254d3a | [
"MIT"
] | null | null | null | 0x03-python-data_structures/8-multiple_returns.py | malu17/alx-higher_level_programming | 75a24d98c51116b737f339697c75855e34254d3a | [
"MIT"
] | null | null | null | 0x03-python-data_structures/8-multiple_returns.py | malu17/alx-higher_level_programming | 75a24d98c51116b737f339697c75855e34254d3a | [
"MIT"
] | null | null | null | #!/usr/bin/python3
| 21.571429 | 43 | 0.622517 | #!/usr/bin/python3
def multiple_returns(sentence):
if not sentence:
return (0, None)
else:
return (len(sentence), sentence[0])
| 110 | 0 | 22 |
a97180fa0444208f232dbc128ac2eaf607fa559a | 1,747 | py | Python | common/mongo_client.py | fangcode/DoubanSpider | fed60f449d441a0470b90f29038477525391fffa | [
"MIT"
] | 1 | 2017-02-25T10:15:58.000Z | 2017-02-25T10:15:58.000Z | common/mongo_client.py | fangcode/DoubanSpider | fed60f449d441a0470b90f29038477525391fffa | [
"MIT"
] | null | null | null | common/mongo_client.py | fangcode/DoubanSpider | fed60f449d441a0470b90f29038477525391fffa | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*_
"""
@author: Fang Wang
@date: 2017.02.25
@desc: mongodb client
"""
import pymongo
from pymongo import MongoClient
if __name__ == "__main__":
print insert_data({"a": 1})
print query_data({"a": 1})
| 22.688312 | 70 | 0.616485 | # -*- coding:utf-8 -*_
"""
@author: Fang Wang
@date: 2017.02.25
@desc: mongodb client
"""
import pymongo
from pymongo import MongoClient
def get_client():
try:
client = MongoClient(host="localhost", port=27017)
return client
except Exception, e:
print "get mongodb client failed", str... | 1,397 | 0 | 115 |
6a3071fc9f2b13e0a963c688d7c2a721ed226989 | 3,435 | py | Python | icscalendar.py | minrk/DnDTools | 3884f7812d1f4d758764fb63580176b79c832c06 | [
"Unlicense"
] | 2 | 2018-10-23T12:22:04.000Z | 2021-02-11T02:32:38.000Z | icscalendar.py | minrk/DnDTools | 3884f7812d1f4d758764fb63580176b79c832c06 | [
"Unlicense"
] | null | null | null | icscalendar.py | minrk/DnDTools | 3884f7812d1f4d758764fb63580176b79c832c06 | [
"Unlicense"
] | 1 | 2016-05-13T18:03:34.000Z | 2016-05-13T18:03:34.000Z | #!/usr/bin/env python
"""Simple Python script to generate iCalendar from the D&D content calendar.
This depends on BeautifulSoup and icalendar, both of which are easy_install-able."""
import urllib2
from BeautifulSoup import BeautifulSoup
from datetime import date, timedelta
from icalendar import Event, Calendar
bas... | 31.227273 | 84 | 0.602038 | #!/usr/bin/env python
"""Simple Python script to generate iCalendar from the D&D content calendar.
This depends on BeautifulSoup and icalendar, both of which are easy_install-able."""
import urllib2
from BeautifulSoup import BeautifulSoup
from datetime import date, timedelta
from icalendar import Event, Calendar
bas... | 0 | 0 | 0 |
cf0ddbc109a1f7862e90c770ce9be0da781c9aee | 671 | py | Python | webdispatch/paster.py | aodag/WebDispatch | 55f8658a2b4100498e098a80303a346c3940f1bc | [
"MIT"
] | 1 | 2016-09-03T00:32:47.000Z | 2016-09-03T00:32:47.000Z | webdispatch/paster.py | aodag/WebDispatch | 55f8658a2b4100498e098a80303a346c3940f1bc | [
"MIT"
] | 15 | 2017-07-25T08:00:38.000Z | 2019-02-21T03:23:42.000Z | webdispatch/paster.py | aodag/WebDispatch | 55f8658a2b4100498e098a80303a346c3940f1bc | [
"MIT"
] | 1 | 2018-03-05T17:37:18.000Z | 2018-03-05T17:37:18.000Z | """ entry points to pastescript
"""
import sys
from .urldispatcher import URLDispatcher
def make_urldispatch_application(_, **settings):
""" paste.app_factory interface for URLDispatcher"""
patterns = [p.split("=", 1)
for p in settings['patterns'].split('\n')
if p]
applicat... | 26.84 | 57 | 0.597615 | """ entry points to pastescript
"""
import sys
from .urldispatcher import URLDispatcher
def make_urldispatch_application(_, **settings):
""" paste.app_factory interface for URLDispatcher"""
patterns = [p.split("=", 1)
for p in settings['patterns'].split('\n')
if p]
applicat... | 0 | 0 | 0 |
0f7476dc0e0aaee7c86f377089ec592d656f5cb3 | 7,309 | py | Python | dcdi/models/flows.py | romain-lopez/dcdi | 594d328eae7795785e0d1a1138945e28a4fec037 | [
"MIT"
] | 2 | 2022-02-15T00:24:58.000Z | 2022-03-10T23:59:59.000Z | dcdi/models/flows.py | romain-lopez/dcdi | 594d328eae7795785e0d1a1138945e28a4fec037 | [
"MIT"
] | null | null | null | dcdi/models/flows.py | romain-lopez/dcdi | 594d328eae7795785e0d1a1138945e28a4fec037 | [
"MIT"
] | null | null | null | import torch
from torch.autograd import Variable
from ..torchkit import log_normal, SigmoidFlow
from .base_model import BaseModel
class FlowModel(BaseModel):
"""
Abstract class for normalizing flow model
"""
def compute_log_likelihood(self, x, weights, biases, extra_params,
... | 53.350365 | 120 | 0.647695 | import torch
from torch.autograd import Variable
from ..torchkit import log_normal, SigmoidFlow
from .base_model import BaseModel
class FlowModel(BaseModel):
"""
Abstract class for normalizing flow model
"""
def __init__(self, num_vars, num_layers, hid_dim, num_params, nonlin="leaky-relu",
... | 923 | 5,188 | 76 |
c02846eafc893b6b0c4883474c7b02dc9f427261 | 214 | py | Python | main/enum/createdFileStatus.py | pinfort/ts-videos-processor | 1aafbcad75081fa6bf4eaf95906f1ffbb177fba1 | [
"MIT"
] | null | null | null | main/enum/createdFileStatus.py | pinfort/ts-videos-processor | 1aafbcad75081fa6bf4eaf95906f1ffbb177fba1 | [
"MIT"
] | 3 | 2021-10-20T18:04:26.000Z | 2022-01-14T06:37:05.000Z | main/enum/createdFileStatus.py | pinfort/ts-videos-processor | 1aafbcad75081fa6bf4eaf95906f1ffbb177fba1 | [
"MIT"
] | null | null | null | from enum import Enum, auto
| 16.461538 | 31 | 0.551402 | from enum import Enum, auto
class CreatedFileStatus(Enum):
REGISTERED = auto()
ENCODE_SUCCESS = auto()
"""
エンコードが成功した
"""
FILE_MOVED = auto()
"""
ファイルはNASに移動された
"""
| 0 | 202 | 25 |
4e94765b0abe3fd42a5ec6aabbab770ed0fe8545 | 5,571 | py | Python | api/serializers.py | GtPsSd/klazor-heroku | 7d284a1f15216a8da2da4ca6772b0dfda7715e5e | [
"MIT"
] | null | null | null | api/serializers.py | GtPsSd/klazor-heroku | 7d284a1f15216a8da2da4ca6772b0dfda7715e5e | [
"MIT"
] | 8 | 2020-02-12T00:31:24.000Z | 2022-02-10T08:41:34.000Z | api/serializers.py | GtPsSd/klazor-heroku | 7d284a1f15216a8da2da4ca6772b0dfda7715e5e | [
"MIT"
] | 1 | 2019-07-15T01:33:27.000Z | 2019-07-15T01:33:27.000Z | from rest_framework import serializers
from rest_framework.fields import ReadOnlyField
from klazor.models import *
| 32.770588 | 111 | 0.688925 | from rest_framework import serializers
from rest_framework.fields import ReadOnlyField
from klazor.models import *
class FileItemSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = FileItem
fields = ('id', 'title', 'file',)
class PropositionSerializer(serializers.ModelSerial... | 1,490 | 3,461 | 483 |
76acd632d5d8c015c5bce720b4f37d1a4d51789d | 2,619 | py | Python | login.py | RFYoung/swjtu-course-schedule-kit | d8718b4b28526b68aabce91063344b2f649f2c2d | [
"Apache-2.0"
] | null | null | null | login.py | RFYoung/swjtu-course-schedule-kit | d8718b4b28526b68aabce91063344b2f649f2c2d | [
"Apache-2.0"
] | null | null | null | login.py | RFYoung/swjtu-course-schedule-kit | d8718b4b28526b68aabce91063344b2f649f2c2d | [
"Apache-2.0"
] | null | null | null | import logging
import cv2
import numpy
import pytesseract
import requests
from config import DEAN_URL, STUDENT_ID, PASSWORD
DEAN_INDEX_PATH = "service/login.html"
POST_LOGIN_FORM_PATH = "vatuu/UserLoginAction"
POST_USER_LOADING_PATH = "vatuu/UserLoadingAction"
GET_CAPTCHA_IMG_PATH = "vatuu/GetRandomNumberToJPEG"
| 36.375 | 109 | 0.600611 | import logging
import cv2
import numpy
import pytesseract
import requests
from config import DEAN_URL, STUDENT_ID, PASSWORD
DEAN_INDEX_PATH = "service/login.html"
POST_LOGIN_FORM_PATH = "vatuu/UserLoginAction"
POST_USER_LOADING_PATH = "vatuu/UserLoadingAction"
GET_CAPTCHA_IMG_PATH = "vatuu/GetRandomNumberToJPEG"
d... | 2,254 | 0 | 46 |
d3bd63e9437d8eb28b34e235c9dc8f6143fac59f | 1,961 | py | Python | secretpy/ciphers/zigzag.py | tigertv/crypt | e464f998e5540f52e269fe360ec9d3a08e976b2e | [
"MIT"
] | 51 | 2019-01-09T02:38:03.000Z | 2022-03-19T19:08:02.000Z | secretpy/ciphers/zigzag.py | tigertv/crypt | e464f998e5540f52e269fe360ec9d3a08e976b2e | [
"MIT"
] | 7 | 2019-10-03T19:50:32.000Z | 2021-05-28T22:52:09.000Z | secretpy/ciphers/zigzag.py | tigertv/crypt | e464f998e5540f52e269fe360ec9d3a08e976b2e | [
"MIT"
] | 13 | 2019-04-16T16:39:44.000Z | 2021-06-01T21:50:12.000Z | #!/usr/bin/python
# -*- encoding: utf-8 -*-
class Zigzag:
"""
The Zigzag Cipher (Rail-Fence)
"""
def encrypt(self, text, key, alphabet=None):
"""
Encryption method
:param text: Text to encrypt
:param key: Encryption key
:param alphabet: unused
:type te... | 25.141026 | 53 | 0.470678 | #!/usr/bin/python
# -*- encoding: utf-8 -*-
class Zigzag:
"""
The Zigzag Cipher (Rail-Fence)
"""
def encrypt(self, text, key, alphabet=None):
"""
Encryption method
:param text: Text to encrypt
:param key: Encryption key
:param alphabet: unused
:type te... | 0 | 0 | 0 |
dbbdd8aca5974ecad38b1c6a9316c9f382b5a73d | 20 | py | Python | pyugt/_version.py | teristam/pyugt | 20f1da6ce7fde5595473061a49e3d38435eaeab1 | [
"MIT"
] | 12 | 2020-03-12T13:49:54.000Z | 2022-02-16T10:58:09.000Z | pyugt/_version.py | teristam/pyugt | 20f1da6ce7fde5595473061a49e3d38435eaeab1 | [
"MIT"
] | 2 | 2020-03-18T16:32:08.000Z | 2021-04-05T09:54:48.000Z | pyugt/_version.py | teristam/pyugt | 20f1da6ce7fde5595473061a49e3d38435eaeab1 | [
"MIT"
] | 2 | 2022-02-14T11:34:44.000Z | 2022-02-16T10:59:59.000Z | __version__="0.5.3"
| 10 | 19 | 0.7 | __version__="0.5.3"
| 0 | 0 | 0 |
e28d8266a59a00b4d0388682ded3b651e5b4aed9 | 21,705 | py | Python | JDjango/dialogs/dialogViews/dialogViews.py | JIYANG-PLUS/JDjango | 57cbb13b2b4c07f34d546c0c637c22f60c1e692a | [
"MIT"
] | 3 | 2020-12-28T05:09:02.000Z | 2021-06-23T10:02:03.000Z | JDjango/dialogs/dialogViews/dialogViews.py | JIYANG-PLUS/JDjango | 57cbb13b2b4c07f34d546c0c637c22f60c1e692a | [
"MIT"
] | null | null | null | JDjango/dialogs/dialogViews/dialogViews.py | JIYANG-PLUS/JDjango | 57cbb13b2b4c07f34d546c0c637c22f60c1e692a | [
"MIT"
] | null | null | null | from ..common import *
"""
### 使用者自定义视图模板并为此模板编辑逻辑的步骤:【后期补全】
"""
###
"""
### 路由默认写入根urls.py文件,也可用新的别名替代第一个名字(不推荐这么做,因为随之改动的地方会很多,除非你很熟悉Django,否则不建议更改urls.py在别名中的位置)。
### 存在隐患,在用户创建路由时应当判断路由明是否冲突,反向名称是否冲突。这将在未来版本中修复。
### urlpatterns参数必须要有一个空行,否则会错误处理。这将在未来版本中修复。
"""
LABEL_COL_LEN = 200
| 47.49453 | 169 | 0.675144 | from ..common import *
"""
### 使用者自定义视图模板并为此模板编辑逻辑的步骤:【后期补全】
"""
###
"""
### 路由默认写入根urls.py文件,也可用新的别名替代第一个名字(不推荐这么做,因为随之改动的地方会很多,除非你很熟悉Django,否则不建议更改urls.py在别名中的位置)。
### 存在隐患,在用户创建路由时应当判断路由明是否冲突,反向名称是否冲突。这将在未来版本中修复。
### urlpatterns参数必须要有一个空行,否则会错误处理。这将在未来版本中修复。
"""
LABEL_COL_LEN = 200
class ViewGenerateDialog(wx... | 470 | 22,260 | 23 |
65d9c4d17d4ac1aa35f82159a47deab8779faa3c | 475 | py | Python | findost/foundation/enum.py | BongOST/FindOST | bef3c8991b7494ad08c06ed1c9fb0bc41996ec8b | [
"Apache-2.0"
] | 1 | 2017-11-12T03:10:25.000Z | 2017-11-12T03:10:25.000Z | findost/foundation/enum.py | BongOST/FindOST | bef3c8991b7494ad08c06ed1c9fb0bc41996ec8b | [
"Apache-2.0"
] | null | null | null | findost/foundation/enum.py | BongOST/FindOST | bef3c8991b7494ad08c06ed1c9fb0bc41996ec8b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
__author__ = 'LexusLee'
"""
构造枚举类
"""
class Enum:
"""
枚举类
"""
if __name__ == '__main__':
print 'Test begin.'
print 'Test end.' | 19 | 65 | 0.593684 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
__author__ = 'LexusLee'
"""
构造枚举类
"""
class Enum:
"""
枚举类
"""
def __setattr__(self, key, value):
if key in self.__dict__.keys():
raise AttributeError("don't allow to set attribute.")
self.__dict__[key] = value
def __delattr_... | 226 | 0 | 53 |
18b19543364b6e55110f32e50888b9fa59094bdb | 2,234 | py | Python | networks/nms/nms.py | lesleelichong/Detection2D | 196ad66610dca63fe48d5ca3e32629f8b654fd38 | [
"Apache-2.0"
] | null | null | null | networks/nms/nms.py | lesleelichong/Detection2D | 196ad66610dca63fe48d5ca3e32629f8b654fd38 | [
"Apache-2.0"
] | null | null | null | networks/nms/nms.py | lesleelichong/Detection2D | 196ad66610dca63fe48d5ca3e32629f8b654fd38 | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
"""
@author: Chong Li
@time: 2021/06/25 16:35
@desc:
"""
import torch
import numpy as np
| 34.369231 | 109 | 0.520143 | # encoding: utf-8
"""
@author: Chong Li
@time: 2021/06/25 16:35
@desc:
"""
import torch
import numpy as np
class nms(object):
def __init__(self, score_thresh, nms_thresh):
self.score_thresh = score_thresh
self.nms_thresh = nms_thresh
def _score_filter(self, res):
mask = res[...... | 1,375 | 729 | 23 |
d7a058974abb063f40cff8426a789352e5b7f894 | 1,939 | py | Python | 08_Introduction to Data Visualization with Matplotlib/02_Plotting time-series/08_Plotting time-series putting it all together.py | mohd-faizy/DataScience-With-Python | 13ebb10cf9083343056d5b782957241de1d595f9 | [
"MIT"
] | 5 | 2021-02-03T14:36:58.000Z | 2022-01-01T10:29:26.000Z | 08_Introduction to Data Visualization with Matplotlib/02_Plotting time-series/08_Plotting time-series putting it all together.py | mohd-faizy/DataScience-With-Python | 13ebb10cf9083343056d5b782957241de1d595f9 | [
"MIT"
] | null | null | null | 08_Introduction to Data Visualization with Matplotlib/02_Plotting time-series/08_Plotting time-series putting it all together.py | mohd-faizy/DataScience-With-Python | 13ebb10cf9083343056d5b782957241de1d595f9 | [
"MIT"
] | 3 | 2021-02-08T00:31:16.000Z | 2022-03-17T13:52:32.000Z | '''
08 - Plotting time-series: putting it all together
In this exercise, you will plot two time-series with different scales on the
same Axes, and annotate the data from one of these series.
The CO2/temperatures data is provided as a DataFrame called climate_change. You
should also use the function that we have ... | 42.152174 | 152 | 0.731305 | '''
08 - Plotting time-series: putting it all together
In this exercise, you will plot two time-series with different scales on the
same Axes, and annotate the data from one of these series.
The CO2/temperatures data is provided as a DataFrame called climate_change. You
should also use the function that we have ... | 0 | 0 | 0 |
0cea399a3f97b0c5b1dc8e465e607ed1a17fe943 | 967 | py | Python | projectCode/__init__.py | TheBrokenEstate/dbcoursework | 0016f820ca8b0ea862e929337d8f7ad0fbfcf863 | [
"MIT"
] | null | null | null | projectCode/__init__.py | TheBrokenEstate/dbcoursework | 0016f820ca8b0ea862e929337d8f7ad0fbfcf863 | [
"MIT"
] | null | null | null | projectCode/__init__.py | TheBrokenEstate/dbcoursework | 0016f820ca8b0ea862e929337d8f7ad0fbfcf863 | [
"MIT"
] | null | null | null | # Initialization file contains the server settings and config options. It also
# builds the app and initializes the server.
import os
import secrets
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_bcrypt import Bcrypt
from flask_login import LoginManager
from flask_mail import Mail
secret_k... | 30.21875 | 78 | 0.784902 | # Initialization file contains the server settings and config options. It also
# builds the app and initializes the server.
import os
import secrets
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_bcrypt import Bcrypt
from flask_login import LoginManager
from flask_mail import Mail
secret_k... | 0 | 0 | 0 |
0e57229c81e2c0c4409d2a451e2cf30f26b6cd8d | 15,325 | py | Python | discordbot.py | Farrule/discordpy-startup | 015304f16add15cd362827cc273877cf82545e08 | [
"MIT"
] | null | null | null | discordbot.py | Farrule/discordpy-startup | 015304f16add15cd362827cc273877cf82545e08 | [
"MIT"
] | null | null | null | discordbot.py | Farrule/discordpy-startup | 015304f16add15cd362827cc273877cf82545e08 | [
"MIT"
] | null | null | null | """
_/_/_/_/_/_/_/_/
_/ ver 1.0.2 _/
_/_/_/_/_/_/_/_/
"""
import asyncio
import discord
from discord.ext import commands
import re
import sys
import os
# TODO:os.environ['DISCORD_BOT_TOKEN']
TOKEN = os.environ['DISCORD_BOT_TOKEN']
# TODO:コマンド変更時
bot = commands.Bot(command_prefix='!')
Emcompre = '!'
# TODO:バージョ... | 32.815846 | 80 | 0.490114 | """
_/_/_/_/_/_/_/_/
_/ ver 1.0.2 _/
_/_/_/_/_/_/_/_/
"""
import asyncio
import discord
from discord.ext import commands
import re
import sys
import os
# TODO:os.environ['DISCORD_BOT_TOKEN']
TOKEN = os.environ['DISCORD_BOT_TOKEN']
# TODO:コマンド変更時
bot = commands.Bot(command_prefix='!')
Emcompre = '!'
# TODO:バージョ... | 13,170 | 0 | 177 |
2959e4d34d8c4e6f04454c48f10372abc485be57 | 81 | py | Python | jp.atcoder/arc025/arc025_1/30797423.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-09T03:06:25.000Z | 2022-02-09T03:06:25.000Z | jp.atcoder/arc025/arc025_1/30797423.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-05T22:53:18.000Z | 2022-02-09T01:29:30.000Z | jp.atcoder/arc025/arc025_1/30797423.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | null | null | null | print(sum(map(max, zip(map(int, input().split()), map(int, input().split())))))
| 40.5 | 80 | 0.604938 | print(sum(map(max, zip(map(int, input().split()), map(int, input().split())))))
| 0 | 0 | 0 |