hexsha stringlengths 40 40 | size int64 6 782k | ext stringclasses 7
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 237 | max_stars_repo_name stringlengths 6 72 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses list | max_stars_count int64 1 53k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 184 | max_issues_repo_name stringlengths 6 72 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses list | max_issues_count int64 1 27.1k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 184 | max_forks_repo_name stringlengths 6 72 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses list | max_forks_count int64 1 12.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 6 782k | avg_line_length float64 2.75 664k | max_line_length int64 5 782k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fa240300e75cb6eca438c180755c8904f14e35c3 | 1,028 | py | Python | Pytorch使用指南/pth转pt.py | yujmo/mlbt | 43c42e15e6a63aa05c7e564f508641bce3fbdf55 | [
"MIT"
] | null | null | null | Pytorch使用指南/pth转pt.py | yujmo/mlbt | 43c42e15e6a63aa05c7e564f508641bce3fbdf55 | [
"MIT"
] | null | null | null | Pytorch使用指南/pth转pt.py | yujmo/mlbt | 43c42e15e6a63aa05c7e564f508641bce3fbdf55 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision.models as models
from torchsummary import summary
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
self.conv1 = nn.Conv2d(1, 32, 5, 1)
self.conv2 = nn.Conv2d(32, 64, 5, 1)
... | 32.125 | 83 | 0.599222 |
d717e356c286614a75497b1246ce113ab30b4ffd | 134,987 | py | Python | lbry/lbry/schema/types/v2/claim_pb2.py | Nykseli/lbry-sdk | 07afc0aa0a1e6c0ef6aa284fb47513af940440c1 | [
"MIT"
] | null | null | null | lbry/lbry/schema/types/v2/claim_pb2.py | Nykseli/lbry-sdk | 07afc0aa0a1e6c0ef6aa284fb47513af940440c1 | [
"MIT"
] | 4 | 2020-10-27T21:53:05.000Z | 2022-02-11T03:10:54.000Z | lbry/lbry/schema/types/v2/claim_pb2.py | braveheart12/lbry-sdk | dc709b468f9dce60d206161785def5c7ace2b763 | [
"MIT"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: claim.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflect... | 37.853898 | 19,928 | 0.689259 |
d7555a650f65eb16d91a84587dea25ee5fdda75a | 1,332 | py | Python | cs/lambda_cs/05_hash_tables_and_blockchain/Sprint-Challenge--Hash-BC/hashtables/ex2/ex2_tests.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | cs/lambda_cs/05_hash_tables_and_blockchain/Sprint-Challenge--Hash-BC/hashtables/ex2/ex2_tests.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | 8 | 2020-03-24T17:47:23.000Z | 2022-03-12T00:33:21.000Z | cs/lambda_cs/05_hash_tables_and_blockchain/Sprint-Challenge--Hash-BC/hashtables/ex2/ex2_tests.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | import unittest
from ex2 import Ticket, reconstruct_trip
class TestEx2(unittest.TestCase):
def test_short_case(self):
ticket_1 = Ticket("NONE", "PDX")
ticket_2 = Ticket("PDX", "DCA")
ticket_3 = Ticket("DCA", "NONE")
tickets = [ticket_1, ticket_2, ticket_3]
expected = ["P... | 25.615385 | 82 | 0.527027 |
d16aeb5a130ad15456f4c65508684240ea83076c | 554 | py | Python | CodeStatistics/files/c54f7e2c-0728-439d-aa48-93e29cbac5c0/django_rbac/rbac/migrations/0003_auto_20181005_0807.py | zhangyafeii/Flask | 9c9a5ea282f77aabcda838796dad2411af9b519f | [
"MIT"
] | null | null | null | CodeStatistics/files/c54f7e2c-0728-439d-aa48-93e29cbac5c0/django_rbac/rbac/migrations/0003_auto_20181005_0807.py | zhangyafeii/Flask | 9c9a5ea282f77aabcda838796dad2411af9b519f | [
"MIT"
] | null | null | null | CodeStatistics/files/c54f7e2c-0728-439d-aa48-93e29cbac5c0/django_rbac/rbac/migrations/0003_auto_20181005_0807.py | zhangyafeii/Flask | 9c9a5ea282f77aabcda838796dad2411af9b519f | [
"MIT"
] | null | null | null | # Generated by Django 2.0.5 on 2018-10-05 00:07
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rbac', '0002_auto_20181005_0748'),
]
operations = [
migrations.AlterModelOptions(
name='action',
options={'verbose_n... | 23.083333 | 61 | 0.575812 |
0f40b89c2190d16c49ebe3097e8be2bcbd7293b4 | 192 | py | Python | Algorithms/Python/fibonacci.py | M-Usman-Tahir/Data-Structures-and-Algorithms | 08331182f0bbfd85fcdba50477dcf408b09a37cd | [
"Apache-2.0"
] | 2 | 2021-12-13T10:09:47.000Z | 2022-01-05T11:04:31.000Z | Algorithms/Python/fibonacci.py | M-Usman-Tahir/Data-Structures-and-Algorithms | 08331182f0bbfd85fcdba50477dcf408b09a37cd | [
"Apache-2.0"
] | 1 | 2021-10-15T17:55:47.000Z | 2021-10-17T20:43:15.000Z | Algorithms/Python/fibonacci.py | M-Usman-Tahir/Data-Structures-and-Algorithms | 08331182f0bbfd85fcdba50477dcf408b09a37cd | [
"Apache-2.0"
] | 4 | 2021-10-12T13:05:10.000Z | 2021-10-16T19:31:46.000Z | def fib(n,dic= {0:0,1:1}):
"""
Fibonacci with Memoization
"""
if n in dic.keys():
return dic[n]
else:
dic[n] = fib(n-1) + fib(n-2)
return dic[n]
| 14.769231 | 36 | 0.458333 |
7ea3ffe036e0bd3423d4db45e0f09347fd3bf829 | 2,552 | py | Python | Packs/Troubleshoot/Scripts/TroubleshootExecuteCommand/TroubleshootExecuteCommand.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Troubleshoot/Scripts/TroubleshootExecuteCommand/TroubleshootExecuteCommand.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Troubleshoot/Scripts/TroubleshootExecuteCommand/TroubleshootExecuteCommand.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | """
Command execute:
Executes command with debug-mode
"""
from CommonServerPython import *
def _execute_command(command: str, arguments: dict):
return demisto.executeCommand(command, arguments)
def get_errors(response: Union[list, dict]) -> List[str]:
errors = list()
if is_error(response):
i... | 29.674419 | 111 | 0.592476 |
7ed0bb1561b9d1daf581e026f0e26fc0172c7f9f | 891 | py | Python | comp/zenefits/skype/NumberofIslands_dfs.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | comp/zenefits/skype/NumberofIslands_dfs.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | comp/zenefits/skype/NumberofIslands_dfs.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution(object):
def numIslands(self, grid):
"""
:type grid: List[List[str]]
:rtype: int
"""
cnt = 0
visited = [[False for j in range(len(grid[0]))] for i in range(len(grid))]
for i in range(len(grid)):
for j in range(len(grid[0])):
... | 30.724138 | 82 | 0.451178 |
7ee71844496b7534b34c0c5e530ac23263fc5f52 | 2,274 | py | Python | deprecated/benchmark/reader/jpeg2base64.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 170 | 2020-08-12T12:07:01.000Z | 2022-03-07T02:38:26.000Z | deprecated/benchmark/reader/jpeg2base64.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 195 | 2020-08-13T03:22:15.000Z | 2022-03-30T07:40:25.000Z | deprecated/benchmark/reader/jpeg2base64.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 67 | 2020-08-14T02:07:46.000Z | 2022-03-28T10:05:33.000Z | """
Encoding jpeg images using base64.
Organize your directory in the following format:
ImageNet
| -- train
| -- dir1
| -- 1.jpeg
| -- ...
| -- dir2
| -- 10.jpeg
... | 34.984615 | 116 | 0.556728 |
adba99c3afded02fd6ec0ea9551bd6ba6a77237a | 735 | py | Python | kts/models/regression.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 18 | 2019-02-14T13:10:07.000Z | 2021-11-26T07:10:13.000Z | kts/models/regression.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 2 | 2019-02-17T14:06:42.000Z | 2019-09-15T18:05:54.000Z | kts/models/regression.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 2 | 2019-09-15T13:12:42.000Z | 2020-04-15T14:05:54.000Z | from kts.modelling.mixins import RegressorMixin, NormalizeFillNAMixin
from kts.models.common import XGBMixin, LGBMMixin, CatBoostMixin, all_estimators, BLACKLISTED_PARAMS
__all__ = []
class XGBRegressor(RegressorMixin, XGBMixin): pass
class LGBMRegressor(RegressorMixin, LGBMMixin): pass
class CatBoostRegressor(Regre... | 33.409091 | 100 | 0.74966 |
1db492094b9581bfade024c95d14aafd1b8525e7 | 141 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v7_0/re_route.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v7_0/re_route.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v7_0/re_route.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | from frappe.patches.v7_0.re_route import update_routes
def execute():
update_routes(['Item', 'Item Group', 'Sales Partner', 'Job Opening']) | 35.25 | 70 | 0.751773 |
aa9f6dc1eb902d3c874a8cfb81e1ca1bc6b618f8 | 667 | pyde | Python | sketches/forrest/forrest01/forrest01.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/forrest/forrest01/forrest01.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/forrest/forrest01/forrest01.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | import csv
import random as r
def setup():
size(800, 640)
tree1 = loadImage("laub.png")
tree2 = loadImage("nadel.png")
tree3 = loadImage("plant.png")
fire = loadImage("fire.png")
fileHandle = open("forrest.tsv")
trees = csv.DictReader(fileHandle, delimiter = "\t")
background(220)
f... | 27.791667 | 56 | 0.511244 |
630188a3bc6564fa838d6516cfc27cecee0a94cc | 436 | py | Python | Python/Courses/Python-Tutorials.Telusko/01.Object-Oriented-Programming/15.01-Multilevel-Inheritance.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Python-Tutorials.Telusko/01.Object-Oriented-Programming/15.01-Multilevel-Inheritance.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Python-Tutorials.Telusko/01.Object-Oriented-Programming/15.01-Multilevel-Inheritance.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | class A:
def feature1(self):
print("Feature 1 working")
def feature2(self):
print("Feature 2 working")
class B(A):
def feature3(self):
print("Feature 3 working")
def feature4(self):
print("Feature 4 working")
class C(B):
def feature5(self):
print("Featur... | 14.533333 | 34 | 0.580275 |
57c930166ed128c76f46a11c94d8a64faf9b80c7 | 392 | py | Python | Curso_Python/Secao4-Python-introducao-a-programacao-orientada-a-objetos-POO/115_poposta_de_projeto-calculando-redes-ipv4/main.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao4-Python-introducao-a-programacao-orientada-a-objetos-POO/115_poposta_de_projeto-calculando-redes-ipv4/main.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao4-Python-introducao-a-programacao-orientada-a-objetos-POO/115_poposta_de_projeto-calculando-redes-ipv4/main.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | import re
class CalcIPv4:...
if __name__ == '__main__':
calc_ipv4 = CalcIPv4(ip='192.168.0.25', cidr='26')
print(f'IP: {calc_ipv4.ip}')
print(f'Mascara: {calc_ipv4.mascara}')
print(f'calc_ipv4.rede')
print(f'calc_ipv4.broadcast')
print(f'calc_ipv4.cidr')
print(f'Número de IPs da rede: {cal... | 28 | 59 | 0.678571 |
1031f9a04d9316196b8635e1d9d4e587decb5865 | 91 | py | Python | frds/data/wrds/comp/__init__.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | 31 | 2020-06-17T13:19:12.000Z | 2022-03-27T08:56:38.000Z | frds/data/wrds/comp/__init__.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | null | null | null | frds/data/wrds/comp/__init__.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | 8 | 2020-06-14T15:21:51.000Z | 2021-09-29T06:28:53.000Z | from .funda import Funda
from .fundq import Fundq
from ..execucomp import Anncomp # alias
| 22.75 | 40 | 0.78022 |
eabfd8aad68168c7486af3eee25e1ee2c32a1169 | 25,603 | py | Python | Packs/WootCloud/Integrations/WootCloud/WootCloud_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/WootCloud/Integrations/WootCloud/WootCloud_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/WootCloud/Integrations/WootCloud/WootCloud_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from WootCloud import fetch_incidents, Client, fetch_single_alert
MOCK_URL = 'https://api_mock.wootcloud.com'
MOCK_START = '2019-06-25T08:00:00Z'
MOCK_END = '2019-06-27T08:00:00Z'
MOCK_HEADERS = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Host': 'api.wootuno.wootcloud.com'
}
MOCK... | 47.589219 | 125 | 0.376557 |
d801c94a746e1d33a751ceb656c4fe7c5130f2c2 | 1,930 | py | Python | emsite/emapp/models.py | thejeshpr/ExpenseManager | a3c452a87c9287a814247434ebb4039e164d7936 | [
"MIT"
] | null | null | null | emsite/emapp/models.py | thejeshpr/ExpenseManager | a3c452a87c9287a814247434ebb4039e164d7936 | [
"MIT"
] | null | null | null | emsite/emapp/models.py | thejeshpr/ExpenseManager | a3c452a87c9287a814247434ebb4039e164d7936 | [
"MIT"
] | null | null | null | from django.db import models
from django.urls import reverse
class BaseModel(models.Model):
created_date = models.DateTimeField(auto_now_add=True)
modified_date = models.DateTimeField(auto_now=True)
class Meta:
abstract = True
class Source(BaseModel):
SRC_TYPES = (
('S', 'Savings Acc... | 32.711864 | 103 | 0.688601 |
d828c7cd705a33188a182b11635e0afa73dab364 | 16,490 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/network/exos/exos_vlans.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/network/exos/exos_vlans.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/network/exos/exos_vlans.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#############################################
# WARNING #
#############################################
#
# This file is au... | 21.725955 | 157 | 0.423833 |
f4a2b8c0add20a5ec8b35d6559d4fffabcc54c01 | 1,031 | py | Python | backend/app/schemas/task_hint.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2022-02-20T12:45:04.000Z | 2022-02-20T12:45:04.000Z | backend/app/schemas/task_hint.py | JamesNeumann/learning-by-annotations | c2b5e4b653eeb1c973aa5a7dad35ac8be18cb1ad | [
"MIT"
] | 21 | 2021-11-01T10:13:56.000Z | 2021-12-02T10:02:13.000Z | backend/app/schemas/task_hint.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2021-12-16T18:20:55.000Z | 2021-12-16T18:20:55.000Z | from enum import IntEnum
from typing import List, Optional
from pydantic import BaseModel
from app.schemas.hint_image import HintImageBase, HintImage
class HintType(IntEnum):
TEXT = 0
IMAGE = 1
SOLUTION = 2
class TaskHintBase(BaseModel):
task_id: int
content: str
order_pos... | 20.62 | 60 | 0.677983 |
5ed72245a5c791c9841b1e6eee91905dc4c04f33 | 1,839 | py | Python | db_cleanup.py | ypislon/bachelorarbeit | 2e1d07d667d505a79d1adb9363cec5d21dafe832 | [
"MIT"
] | null | null | null | db_cleanup.py | ypislon/bachelorarbeit | 2e1d07d667d505a79d1adb9363cec5d21dafe832 | [
"MIT"
] | null | null | null | db_cleanup.py | ypislon/bachelorarbeit | 2e1d07d667d505a79d1adb9363cec5d21dafe832 | [
"MIT"
] | null | null | null | from db_connection import db_connection
from db_schema import Website, Article
db_connection.connect()
articles = Article.select()
for a in articles:
a.url = a.url.strip()
a.save()
## to get rid of dupliate entries:
# https://www.navicat.com/en/company/aboutus/blog/681-eliminating-duplicate-rows-using-select... | 36.78 | 165 | 0.739532 |
0d5b85c4d27765bf6900defb24a25cc0ee61bb93 | 152 | py | Python | 1913-maximum-product-difference-between-two-pairs/1913-maximum-product-difference-between-two-pairs.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 1913-maximum-product-difference-between-two-pairs/1913-maximum-product-difference-between-two-pairs.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 1913-maximum-product-difference-between-two-pairs/1913-maximum-product-difference-between-two-pairs.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def maxProductDifference(self, nums: List[int]) -> int:
snum = sorted(nums)
return snum[-1]*snum[-2]-snum[0]*snum[1] | 38 | 59 | 0.618421 |
df58365c283d8224f524b149e55cde0468310484 | 3,124 | py | Python | Project Euler Qusetions 61 - 70/Project Euler Question 61.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | 1 | 2020-02-11T02:03:02.000Z | 2020-02-11T02:03:02.000Z | Project Euler Qusetions 61 - 70/Project Euler Question 61.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | Project Euler Qusetions 61 - 70/Project Euler Question 61.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | #Project Euler Question 61
#Cyclical figurate numbers
def octagonal(n):
return (n * ((3 * n) - 2))
def heptagonal(n):
return int(n * ((5 * n) - 3) / 2)
def hexagonal(n):
return (n * ((2 * n) - 1))
def pentagonal(n):
return int(n * ((3 * n) - 1) / 2)
def sqaure(n):
return (n ** 2)
def triangle(n):
... | 31.24 | 74 | 0.483675 |
33a8fdd851483be97ecbe970999aad90ee32570b | 637 | py | Python | Interview Preparation Kits/Interview Preparation Kit/Greedy Algorithms/Max Min/max_min_fairness.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | 1 | 2021-02-22T17:37:45.000Z | 2021-02-22T17:37:45.000Z | Interview Preparation Kits/Interview Preparation Kit/Greedy Algorithms/Max Min/max_min_fairness.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | Interview Preparation Kits/Interview Preparation Kit/Greedy Algorithms/Max Min/max_min_fairness.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | #!/bin/python3
import math
import os
import random
import re
import sys
# Complete the maxMin function below.
def maxMin(k, arr):
n = len(arr)
arr = sorted(arr)
fairness = arr[n-1] - arr[0]
for i in range(n-k+1):
current = arr[i+k-1] - arr[i]
fairness = min(current, fairness)
ret... | 15.536585 | 47 | 0.571429 |
98b8029ecc2e663a7085692fe9f62fcf77d5e624 | 149 | py | Python | Exercicios/ex05v2.py | BoltzBit/LP | f84d36d1bdee9a20c197cebec2810234c5311fb8 | [
"MIT"
] | null | null | null | Exercicios/ex05v2.py | BoltzBit/LP | f84d36d1bdee9a20c197cebec2810234c5311fb8 | [
"MIT"
] | null | null | null | Exercicios/ex05v2.py | BoltzBit/LP | f84d36d1bdee9a20c197cebec2810234c5311fb8 | [
"MIT"
] | null | null | null | nome = input('Digite seu nome: ')
quarto = input('Informe o numero do quarto: ')
msg = 'Olá {0} seu quarto é o {1}'
print(msg.format(nome,quarto))
| 21.285714 | 46 | 0.657718 |
7f9bdb49b3d3a607b97827002dfae07ec215f1d6 | 60 | py | Python | python/coursera_python/MICHIGAN/WEB/Hello_World.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/coursera_python/MICHIGAN/WEB/Hello_World.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/coursera_python/MICHIGAN/WEB/Hello_World.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | # A program to print Hello World!
print("hello world!")
| 8.571429 | 33 | 0.666667 |
f6e797a81a0e54270a0ded149e7d6b5b0ec173be | 5,363 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/onyx/test_onyx_ptp_global.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/onyx/test_onyx_ptp_global.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/onyx/test_onyx_ptp_global.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | 38.582734 | 104 | 0.709118 |
1af2a431b71f26bbd0e8d901778ca36ed87975ff | 4,167 | py | Python | history/Others/Python/files/cookie.py | hengg/i-know-nothing-about-js | 2dc1af3303a8565dd5599f8803d4454121bfdbec | [
"MIT"
] | 2 | 2020-08-07T15:31:19.000Z | 2021-02-05T16:40:36.000Z | history/Others/Python/files/cookie.py | hengg/js-walker | 2dc1af3303a8565dd5599f8803d4454121bfdbec | [
"MIT"
] | 8 | 2020-04-07T00:56:00.000Z | 2020-09-15T02:21:42.000Z | history/Others/Python/files/cookie.py | hengg/i-know-nothing-about-js | 2dc1af3303a8565dd5599f8803d4454121bfdbec | [
"MIT"
] | null | null | null | # coding=utf-8
__author__ = 'wangliang'
import flask
import cookielib
import urllib2
import json
import re
import time
app = flask.Flask(__name__)
@app.route('/15days/<code>')
def fifteenDays(code):
json = get15DaysWeatherJson(code)
return json
def get15DaysWeatherJson(citycode):
req = urllib2.Request... | 34.155738 | 114 | 0.612191 |
2122230f2fd5c2e1c950bd366aa4753c56eff712 | 1,348 | py | Python | Packs/CommonScripts/Scripts/GetByIncidentId/GetByIncidentId.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CommonScripts/Scripts/GetByIncidentId/GetByIncidentId.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CommonScripts/Scripts/GetByIncidentId/GetByIncidentId.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
from functools import reduce
def get_by_incident_id(incident_id, get_key, set_key=""):
set_key = get_key if not set_key else set_key
keys = get_key.split('.')
try:
context = demisto.executeCommand(... | 34.564103 | 113 | 0.609792 |
21384b1a3f6981aac21687471b3a07ad50a3d2ac | 5,689 | py | Python | Packs/Qintel/Integrations/QintelQWatch/QintelQWatch_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Qintel/Integrations/QintelQWatch/QintelQWatch_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Qintel/Integrations/QintelQWatch/QintelQWatch_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | """Qintel QWatch Integration for Cortex XSOAR - Unit Tests file"""
import json
import io
MOCK_URL = 'https://this-is-only-a-test.local'
MOCK_CLIENT_ID = 'client-id'
MOCK_CLIENT_SECRET = 'client-secret'
def util_load_json(path):
with io.open(path, mode='r', encoding='utf-8') as f:
return json.loads(f.rea... | 29.476684 | 78 | 0.695025 |
371bb8befcdbf1aa68d07d3af12fc88864b01864 | 453 | py | Python | Licence 1/I11/TP6/ex3.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 8 | 2020-11-26T20:45:12.000Z | 2021-11-29T15:46:22.000Z | Licence 1/I11/TP6/ex3.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | null | null | null | Licence 1/I11/TP6/ex3.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 6 | 2020-10-23T15:29:24.000Z | 2021-05-05T19:10:45.000Z | from random import *
from math import *
from pocketgl import *
N = int(input("Difficulté: "))
size = int(sqrt(N))
init_window ("Pi graph", size, size)
n = 0
for i in range(N):
x, y = random(), random()
xx = (x - 0.5) ** 2
yy = (y - 0.5) ** 2
if sqrt(xx + yy) <= 0.5:
current_color("green")
... | 18.12 | 36 | 0.525386 |
37219d2fdf268b1ac8f4b47d83794e26d704f26c | 1,265 | py | Python | Python/Courses/Object-Oriented-Programming.Python-Engineer/03-Inheritance-and-Polymorphism.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Object-Oriented-Programming.Python-Engineer/03-Inheritance-and-Polymorphism.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Object-Oriented-Programming.Python-Engineer/03-Inheritance-and-Polymorphism.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | # inherits, extend, override
class Employee:
def __init__(self, name, age, salary):
self.name = name
self.age = age
self.salary = salary
def work(self):
print(f"{self.name} is working...")
class SoftwareEngineer(Employee):
def __init__(self, name, age, salary, level):
... | 19.765625 | 49 | 0.618972 |
25ff226e549f5ad41ffb1aa035aa5560db18cbed | 2,247 | py | Python | documentation_src/doc_examples/parse_json_python_class.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 2 | 2020-12-25T19:37:42.000Z | 2021-03-26T04:59:12.000Z | documentation_src/doc_examples/parse_json_python_class.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 6 | 2018-08-07T22:48:52.000Z | 2021-10-07T18:38:20.000Z | documentation_src/doc_examples/parse_json_python_class.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""JSON-parser-example from the DHParser-manual"""
import sys, re
from DHParser.parse import Grammar, Forward, Whitespace, Drop, NegativeLookahead, \
ZeroOrMore, RegExp, Option, TKN, DTKN, Text
class JSON_Grammar(Grammar):
# Parser-names must be assigned explicitly by calling the Parse... | 41.611111 | 104 | 0.597686 |
4c904af6868a263c812879f8b3a66fedea406bd5 | 2,286 | py | Python | DataStructure/U5/Lecture/Verschiebefunktion.py | qiaw99/Data-Structure | 3b1cdce96d4f35329ccfec29c03de57378ef0552 | [
"MIT"
] | 1 | 2019-10-29T08:21:41.000Z | 2019-10-29T08:21:41.000Z | DataStructure/U5/Lecture/Verschiebefunktion.py | qiaw99/Data-Structure | 3b1cdce96d4f35329ccfec29c03de57378ef0552 | [
"MIT"
] | null | null | null | DataStructure/U5/Lecture/Verschiebefunktion.py | qiaw99/Data-Structure | 3b1cdce96d4f35329ccfec29c03de57378ef0552 | [
"MIT"
] | null | null | null | """
f(j) := Länge k des längsten Präfixes b[0]...b[k-1] mit 0<=k<j,
der ein Suffix von b[0]...b[j-1] ist.
= max { k | 0<=k<j, b[:k] = b[j-k:j] }
für j=1,2,3,...,m
"""
def berechne_f(b):
# Berechnung der Verschiebefunktion nach Definition
# (in kubischer Zeit)
m=len(b)
return [None]+[max... | 22.86 | 65 | 0.439633 |
98136e293507e3baceda7c8af959acac5cde2f2c | 999 | py | Python | src/standard_module/functools_module.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/standard_module/functools_module.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/standard_module/functools_module.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
functools.partial
functools.update_wrapper
functools.wraps
functools.total_ordering
"""
from functools import partial
def add(a, b):
print("a=")
print(a)
print("b=")
print(b)
return a + b
print("partial的第一个参数必须是一个可调用对象,可以是clase或者function")
print("提... | 18.163636 | 69 | 0.611612 |
2c4d09e647c7832846b518b871a861eaf27a7bc2 | 2,645 | py | Python | PlaidCTF/2020/misc/BonziScheme/app/bonzi/routes.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | PlaidCTF/2020/misc/BonziScheme/app/bonzi/routes.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | PlaidCTF/2020/misc/BonziScheme/app/bonzi/routes.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | from flask import render_template, flash, redirect, url_for, request, send_from_directory
from bonzi import app
from bonzi.forms import ACSSubmitForm
from random import choice
import os
from bonzi.acsparse import *
from bonzi.acsutil import *
import uuid
'''
Bonz will give you some sage knowledge
'''
def p... | 35.266667 | 129 | 0.649905 |
390d7e8ddf1d805ec1484c7fb195d1e9a60d2e16 | 1,178 | py | Python | python/tutlibs/dl/3DMatch.py | Obarads/Point_Cloud_Tutorial | faf7ae8abf962ecea414cc7557dc35f4fca0e406 | [
"MIT"
] | 1 | 2021-11-22T10:32:49.000Z | 2021-11-22T10:32:49.000Z | python/tutlibs/dl/3DMatch.py | Obarads/Point_Cloud_Tutorial | faf7ae8abf962ecea414cc7557dc35f4fca0e406 | [
"MIT"
] | 1 | 2021-12-09T14:39:51.000Z | 2021-12-09T14:39:51.000Z | python/tutlibs/dl/3DMatch.py | Obarads/Point_Cloud_Tutorial | faf7ae8abf962ecea414cc7557dc35f4fca0e406 | [
"MIT"
] | null | null | null | import torch
from torch import nn
from torch.utils.data import Dataset
from ..constructing import point_to_voxel
class SiameseNetwork(nn.Module):
"""3D ConvNet for 3DMatch
Args:
in_channel: input channel size
patch: patch size
"""
def __init__(self, in_channel_size: int = 3):
... | 23.56 | 54 | 0.555178 |
1a9a4a2517b8b34333e893b12c5427a0e7e09f17 | 347 | py | Python | demo3.py | iSteveyang/bugWeb | 172dc202eaf4928c4b73ffe372e7e28b53e42e4f | [
"MIT"
] | null | null | null | demo3.py | iSteveyang/bugWeb | 172dc202eaf4928c4b73ffe372e7e28b53e42e4f | [
"MIT"
] | null | null | null | demo3.py | iSteveyang/bugWeb | 172dc202eaf4928c4b73ffe372e7e28b53e42e4f | [
"MIT"
] | null | null | null | # coding:utf-8
from selenium import webdriver
import time
driver = webdriver.Firefox()
driver.implicitly_wait(10)
driver.get("http://www.baidu.com")
time.sleep(1)
driver.find_element_by_id("kw").send_keys(u"博客")
# 获取百度输入框的
time.sleep(1)
bd = driver.find_elements_by_class_name("bdsug-overflow")
for i in bd:
print (i... | 26.692308 | 57 | 0.760807 |
1aab26f125262c8948e90c0067235dc376c569da | 49,417 | py | Python | modules/variables.py | metxchris/MMM-Explorer | 251b4d7af56241882611bc47e94ec2923e4be8da | [
"MIT"
] | null | null | null | modules/variables.py | metxchris/MMM-Explorer | 251b4d7af56241882611bc47e94ec2923e4be8da | [
"MIT"
] | null | null | null | modules/variables.py | metxchris/MMM-Explorer | 251b4d7af56241882611bc47e94ec2923e4be8da | [
"MIT"
] | null | null | null | """Handles all variables both needed for MMM input and produced as MMM output
The Variables class serves at the parent class to both InputVariables and
OutputVariables. All variable data here will be defined in terms of rmin
(or rho). The Variables class should never be instantiated directly; either
an InputVariable... | 52.79594 | 131 | 0.610984 |
1acf76e519b4a37d2895e28d69f9f2850f84ae48 | 75 | py | Python | oldp/apps/homepage/tests.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | 3 | 2020-06-27T08:19:35.000Z | 2020-12-27T17:46:02.000Z | oldp/apps/homepage/tests.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | oldp/apps/homepage/tests.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | from django.test import TestCase
class HomepageTests(TestCase):
pass
| 12.5 | 32 | 0.773333 |
200dbf844206986b636021f9ac3a8254f8ad3216 | 538 | py | Python | python_gui_tkinter/KALU/GARBAGE/mail/1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python_gui_tkinter/KALU/GARBAGE/mail/1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python_gui_tkinter/KALU/GARBAGE/mail/1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | import smtplib
import string
username = "" #"jimutbahanpal@yahoo.com"
password = ""
#server.login(username, password)
HOST = "mySMTP.server.com"
SUBJECT = "Test email from Python"
TO = "jimutbahanpal@yahoo.com"
FROM = "jimutbahanpal@gmail.com"
text = "Python rules them all!"
BODY = string.join((
"From: %s" ... | 24.454545 | 44 | 0.622677 |
204c90d4a834511f1fe02150b85f82c01ecb4015 | 525 | py | Python | Curso-Em-Video-Python/2Exercicios/082_Dividindo_valores_em_varias_linhas.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/082_Dividindo_valores_em_varias_linhas.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/082_Dividindo_valores_em_varias_linhas.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | c = 's'
par = []
impar = []
juntas = []
while c != 'N':
valor = int(input('Digite um numero: '))
c = str(input('Quer continuar? [S/N]')).upper()
juntas.append(valor)
if c == 'S':
print('', end='')
elif c == 'N':
c = 'N'
else:
print('Opção invalida')
for c, valor in enumer... | 23.863636 | 51 | 0.535238 |
6476a84aac968e3646c43a6d72c92d226a647863 | 1,076 | py | Python | scripts/fabsp/_internal_utils.py | swoiow/dsc | 5860e6bfaa70b700e025533c406a6bc52d4ab74b | [
"MIT"
] | null | null | null | scripts/fabsp/_internal_utils.py | swoiow/dsc | 5860e6bfaa70b700e025533c406a6bc52d4ab74b | [
"MIT"
] | null | null | null | scripts/fabsp/_internal_utils.py | swoiow/dsc | 5860e6bfaa70b700e025533c406a6bc52d4ab74b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import functools
import re
def pf(v=None):
if not v:
from fabric.api import run
v = run("python -c 'import platform; print(platform.platform())'")
v = v.lower()
if re.search(re.compile("(debian|ubuntu)+"), v):
return "debian"
eli... | 21.959184 | 77 | 0.562268 |
64a3f576b380528f99f443c6f1bbb20ac08368ca | 3,897 | py | Python | python/tutlibs/transformation.py | Obarads/Point_Cloud_Tutorial | faf7ae8abf962ecea414cc7557dc35f4fca0e406 | [
"MIT"
] | 1 | 2021-11-22T10:32:49.000Z | 2021-11-22T10:32:49.000Z | python/tutlibs/transformation.py | Obarads/Point_Cloud_Tutorial | faf7ae8abf962ecea414cc7557dc35f4fca0e406 | [
"MIT"
] | 1 | 2021-12-09T14:39:51.000Z | 2021-12-09T14:39:51.000Z | python/tutlibs/transformation.py | Obarads/Point_Cloud_Tutorial | faf7ae8abf962ecea414cc7557dc35f4fca0e406 | [
"MIT"
] | null | null | null | import numpy as np
from typing import List
class TransformationMatrix:
def __init__(self) -> None:
print("Note: this class is staticmethod only")
@staticmethod
def from_translation(vector_3:np.ndarray):
"""Convert a vector of translation to a 4x4 transformation matrix.
Arg... | 26.875862 | 87 | 0.514498 |
374bd7f9aea45875065f1424617bae9dfe11e162 | 9,313 | py | Python | src/onegov/activity/models/invoice_reference.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/activity/models/invoice_reference.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/activity/models/invoice_reference.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import re
import secrets
import string
from onegov.core.orm import Base
from onegov.core.orm.mixins import TimestampMixin
from onegov.core.orm.types import UUID
from onegov.core.utils import chunks, hash_dictionary
from sqlalchemy import Column
from sqlalchemy import ForeignKey
from sqlalchemy import Text
from sqlalch... | 30.237013 | 79 | 0.648878 |
03ce481966d76cfeadabfe5b67e7ca1c948d5513 | 754 | py | Python | pacman-arch/test/pacman/tests/upgrade-download-with-xfercommand.py | Maxython/pacman-for-termux | 3b208eb9274cbfc7a27fca673ea8a58f09ebad47 | [
"MIT"
] | 23 | 2021-05-21T19:11:06.000Z | 2022-03-31T18:14:20.000Z | source/pacman-6.0.1/test/pacman/tests/upgrade-download-with-xfercommand.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 11 | 2021-05-21T12:08:44.000Z | 2021-12-21T08:30:08.000Z | source/pacman-6.0.1/test/pacman/tests/upgrade-download-with-xfercommand.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "--upgrade remote packages with XferCommand"
self.option['XferCommand'] = ['/usr/bin/curl %u -o %o']
p1 = pmpkg('pkg1', '1.0-1')
self.addpkg(p1)
p2 = pmpkg('pkg2', '2.0-2')
self.addpkg(p2)
url = self.add_simple_http_server({
'/{}'.format(p1.filename()): p1.makepkg_bytes(),
'/{}'.format(p2... | 27.925926 | 80 | 0.685676 |
03e9477ccea669a1ca17033e87a35272928b906a | 348 | py | Python | exercises/pt/exc_02_05_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/pt/exc_02_05_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/pt/exc_02_05_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | import spacy
nlp = spacy.blank("pt")
# Importe a classe Doc
from ____ import ____
# Texto desejado: "Vamos lá, vamos começar!"
words = ["Vamos","lá", ",", "vamos", "começar", "!"]
spaces = [____, ____, ____, ____, ____, ____]
# Crie um Doc a partir das palavras words e espaçamento spaces
doc = ____(____, ____=____,... | 23.2 | 62 | 0.678161 |
443ff4c8f787102932c3e6d75ca41f828b5988f7 | 3,522 | py | Python | python/game/room.py | rissom/RC3MUD | d5ffb8b79a6a95e9389ee0576f52dfee1f52c4ee | [
"MIT"
] | 1 | 2020-09-29T17:44:31.000Z | 2020-09-29T17:44:31.000Z | python/game/room.py | rissom/RC3MUD | d5ffb8b79a6a95e9389ee0576f52dfee1f52c4ee | [
"MIT"
] | null | null | null | python/game/room.py | rissom/RC3MUD | d5ffb8b79a6a95e9389ee0576f52dfee1f52c4ee | [
"MIT"
] | null | null | null | import json
from system.serializer import Serializer
from system.log import log
from system.helper import i18n
from game.area import Area
class Room(object):
all_rooms = []
# class function to get a room by id
def get_room_by_id(roomid):
for room in Room.all_rooms:
if room.roo... | 36.309278 | 191 | 0.511641 |
92355e666f71485ed9d18ade51c344aefc09014f | 3,489 | py | Python | Flaskapp/app.py | gitskim/DnntalPrivate | 20f84782e9ab20c68b43f32efb16cd22262b8ceb | [
"MIT"
] | null | null | null | Flaskapp/app.py | gitskim/DnntalPrivate | 20f84782e9ab20c68b43f32efb16cd22262b8ceb | [
"MIT"
] | null | null | null | Flaskapp/app.py | gitskim/DnntalPrivate | 20f84782e9ab20c68b43f32efb16cd22262b8ceb | [
"MIT"
] | 2 | 2019-05-16T05:48:26.000Z | 2021-01-27T01:26:22.000Z | #Usage: python app.py
import os
from flask import Flask, render_template, request, redirect, url_for
from werkzeug import secure_filename
from keras.preprocessing.image import ImageDataGenerator, load_img, img_to_array
from keras.models import Sequential, load_model
import tensorflow as tf
import numpy as np
import a... | 32.009174 | 108 | 0.654342 |
a67363780907f4c9a90d569dc2fbaaea88fbcbc5 | 448 | py | Python | envs/rpg/entities/treasure.py | etigerstudio/zilong-on-fire | 5144a471b2d39ea38a47d394e648de00dd13cd8b | [
"MIT"
] | 2 | 2021-01-07T01:10:49.000Z | 2022-01-21T09:37:16.000Z | envs/rpg/entities/treasure.py | etigerstudio/zilong-on-fire | 5144a471b2d39ea38a47d394e648de00dd13cd8b | [
"MIT"
] | null | null | null | envs/rpg/entities/treasure.py | etigerstudio/zilong-on-fire | 5144a471b2d39ea38a47d394e648de00dd13cd8b | [
"MIT"
] | null | null | null | from envs.rpg.entity import Entity
class Treasure(Entity):
REPRESENTATION = 3
TREASURE_REWARD = 1
def start(self, world):
pass
def update(self, world):
actor = world.get_actor_entity()
if actor.position == self.position and \
actor.pose == actor.Pose.STANDING:... | 23.578947 | 50 | 0.609375 |
340a54231f80147e8e0c7f7232c7fd96835c4dfb | 394 | py | Python | 682-baseball-game/682-baseball-game.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 682-baseball-game/682-baseball-game.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 682-baseball-game/682-baseball-game.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def calPoints(self, ops: List[str]) -> int:
output = []
for op in ops:
if op=="C":
output.pop(-1)
elif op=="D":
output.append(output[-1]*2)
elif op=="+":
output.append(output[-1]+output[-2])
... | 30.307692 | 52 | 0.426396 |
cac3a77383e675ad21c5f598180c70f3d7064333 | 1,146 | py | Python | python_lessons/Textastic_Files/Python SQLite Tutorial - teclado/database.py | 1986MMartin/coding-sections-markus | e13be32e5d83e69250ecfb3c76a04ee48a320607 | [
"Apache-2.0"
] | null | null | null | python_lessons/Textastic_Files/Python SQLite Tutorial - teclado/database.py | 1986MMartin/coding-sections-markus | e13be32e5d83e69250ecfb3c76a04ee48a320607 | [
"Apache-2.0"
] | null | null | null | python_lessons/Textastic_Files/Python SQLite Tutorial - teclado/database.py | 1986MMartin/coding-sections-markus | e13be32e5d83e69250ecfb3c76a04ee48a320607 | [
"Apache-2.0"
] | null | null | null | import sqlite3
CREATE_BEANS_TABLE = ("""CREATE TABLE IF NOT EXISTS beans (
id INTEGER PRIMARY KEY,
name TEXT,
method TEXT,
rating INTEGER
);""")
INSERT_BEAN = "INSERT INTO beans (name, method, rating) VALUES (?, ?, ?);"
GET_ALL_BEANS = "SELECT * FROM beans;"
GET_BEANS_BY_NAME = "SELECT * FROM beans... | 23.387755 | 78 | 0.74171 |
9437bc57435b49b508202ed6def90169fd348b17 | 8,183 | py | Python | Templates/Integrations/Authentication/Authentication_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Templates/Integrations/Authentication/Authentication_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Templates/Integrations/Authentication/Authentication_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from pytest import raises
from Authentication import Client
from CommonServerPython import DemistoException
import demistomock as demisto
BASE_URL = 'https://example.com/v1/'
GET_CREDENTIALS = {
'credential': [
{'username': 'User1', 'password': 'mj54bk32gb', 'name': 'DBot Demisto'},
{'username': '... | 46.76 | 109 | 0.663815 |
f3f519bcc79dc3c694dd80417c1dd5f1b76ab34d | 2,836 | py | Python | 20-hs-redez-sem/groups/05-decentGames/src/logSync/database_transport.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-hs-redez-sem/groups/05-decentGames/src/logSync/database_transport.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-hs-redez-sem/groups/05-decentGames/src/logSync/database_transport.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | from logSync import database_sync as sync
import cbor2
"""
TRANSPORT PROTOCOL:
Device A Device B
- Creates "I HAVE"-list
- Serializes "I HAVE"-list
- Sends "I HAVE"-list
- Receives "I HAVE"-list
... | 36.358974 | 119 | 0.624471 |
f3fc09bca70329bd2a9cf5bf098be69ca49aeeb0 | 1,240 | py | Python | baccoapp/mysandwich/migrations/0002_auto_20190614_1713.py | msienkiewicz7/baccoapp | d647ca205fdf06fe57fda7b6db164ae7d3387dad | [
"MIT"
] | null | null | null | baccoapp/mysandwich/migrations/0002_auto_20190614_1713.py | msienkiewicz7/baccoapp | d647ca205fdf06fe57fda7b6db164ae7d3387dad | [
"MIT"
] | null | null | null | baccoapp/mysandwich/migrations/0002_auto_20190614_1713.py | msienkiewicz7/baccoapp | d647ca205fdf06fe57fda7b6db164ae7d3387dad | [
"MIT"
] | null | null | null | # Generated by Django 2.2 on 2019-06-14 17:13
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mysandwich', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='ingredient',
name='img',
),... | 28.837209 | 81 | 0.566935 |
6d092b4941e105d6e60846468caed7761afb70e2 | 1,921 | py | Python | Algorithms/Implementation/LarryArray.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | Algorithms/Implementation/LarryArray.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | Algorithms/Implementation/LarryArray.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | #coding:utf-8
#Puzzle of Fifteen
#https://www.cs.bham.ac.uk/~mdr/teaching/modules04/java2/TilesSolvability.html
#不需要做旋转操作,判断一下'可替换数'的奇偶即可
#并不快= =
T = int(raw_input())
for _ in xrange(T):
N = int(raw_input())
a_list = map(int, raw_input().split())
count = 0
for i in xrange(N):
for j in xra... | 23.426829 | 78 | 0.414888 |
b6b1b0fe4198993ccb11c0f9ed96ce5cb8b9f6b5 | 173 | py | Python | arithmetic.py | turutle/rep | 7932c6889021fa0359ffe3931e731ef5b940f257 | [
"MIT"
] | null | null | null | arithmetic.py | turutle/rep | 7932c6889021fa0359ffe3931e731ef5b940f257 | [
"MIT"
] | null | null | null | arithmetic.py | turutle/rep | 7932c6889021fa0359ffe3931e731ef5b940f257 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Mar 25 23:31:20 2021
@author: turtl
"""
ans = input( "4 * 100 - 54 = -->")
print( "Your answer: " + ans + "\nRight answer: 366") | 19.222222 | 53 | 0.549133 |
78836497a89f0826e59b411b56949cef7f11dddb | 2,932 | py | Python | FeatureEngineering/test.py | alex-ta/Fontinator | 7ca9effe3b61ded032176557520127e1d4b7a5ef | [
"Apache-2.0"
] | 6 | 2017-04-12T14:05:19.000Z | 2021-01-29T11:23:50.000Z | FeatureEngineering/test.py | alex-ta/Fontinator | 7ca9effe3b61ded032176557520127e1d4b7a5ef | [
"Apache-2.0"
] | null | null | null | FeatureEngineering/test.py | alex-ta/Fontinator | 7ca9effe3b61ded032176557520127e1d4b7a5ef | [
"Apache-2.0"
] | null | null | null | import cv2
import os
import numpy as np
import math
import pickle
import extractGlyphes
import extractFeatures
import classifier
# Load saved clasifier and label data
cla = classifier.Classifier()
cla.loadTrainedClassifier('./classie.pickle')
with open('labels.pickle', 'rb') as file_handle:
TRAIN_CHARS = pickle.l... | 29.616162 | 79 | 0.679741 |
e58bc32b132aa469731b7d916199f3057c132694 | 9,758 | py | Python | src/onegov/event/collections/occurrences.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/event/collections/occurrences.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/event/collections/occurrences.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from cached_property import cached_property
from datetime import date
from datetime import timedelta
from dateutil.relativedelta import relativedelta
from icalendar import Calendar as vCalendar
from onegov.core.collection import Pagination
from onegov.core.utils import get_unique_hstore_keys
from onegov.event.models im... | 31.579288 | 79 | 0.574503 |
e5db92b0d8f7ce5d5ff8d14635e53996dafb3ac3 | 2,169 | py | Python | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/applications/FootballAction/predict/action_detect/utils/config_utils.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 5 | 2022-01-30T07:35:58.000Z | 2022-02-08T05:45:20.000Z | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/applications/FootballAction/predict/action_detect/utils/config_utils.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 1 | 2022-01-14T02:33:28.000Z | 2022-01-14T02:33:28.000Z | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/applications/FootballAction/predict/action_detect/utils/config_utils.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 1 | 2022-03-07T10:51:21.000Z | 2022-03-07T10:51:21.000Z | """
config_utils
"""
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
# 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
#
# Unle... | 26.777778 | 75 | 0.605809 |
dae14aa8aa85846613dcde9c220fddc386f02fb3 | 11,621 | py | Python | warp/pipes/pipes.py | j-helland/warp | 2a71346f0ec4d4e6fd45ed3b5e972b683724287c | [
"Unlicense"
] | null | null | null | warp/pipes/pipes.py | j-helland/warp | 2a71346f0ec4d4e6fd45ed3b5e972b683724287c | [
"Unlicense"
] | null | null | null | warp/pipes/pipes.py | j-helland/warp | 2a71346f0ec4d4e6fd45ed3b5e972b683724287c | [
"Unlicense"
] | null | null | null | import functools
from abc import abstractmethod
import warp
import warp.constants as constants
from warp.pipes.attributes import Parameter, ParameterFile, Product
# types
from typing import Optional, List, Tuple, Dict, Any, Iterator
StrDict = Dict[str, Any]
SelfType = object
__all__ = [
'Pipe',
'Source']
... | 40.775439 | 159 | 0.606488 |
e72b811d51db6ce874e74cb6a5e608612a0134c8 | 9,636 | py | Python | zencad/interactive/assemble.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | 5 | 2018-04-11T14:11:40.000Z | 2018-09-12T19:03:36.000Z | zencad/interactive/assemble.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | zencad/interactive/assemble.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | import evalcache
import numpy
from zencad.settings import Settings
from zencad.geom.transformable import Transformable
from zencad.geom.trans import rotate, translate
from zencad.geom.exttrans import nulltrans
from zencad.interactive.line import arrow
from zencad.geom.trans import rotateZ, rotateY, rotate, translate
... | 28.258065 | 79 | 0.613429 |
e747d51862bb65e700ed65bc95786b1c0ff7944b | 84 | py | Python | Contests/CCC/CCC '04 J1 - Squares.py | MastaCoder/Projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 5 | 2018-10-11T01:55:40.000Z | 2021-12-25T23:38:22.000Z | Contests/CCC/CCC '04 J1 - Squares.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | null | null | null | Contests/CCC/CCC '04 J1 - Squares.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 1 | 2019-02-22T14:42:50.000Z | 2019-02-22T14:42:50.000Z | print("The largest square has side length " + str(int((int(input())**(1/2)))) + ".") | 84 | 84 | 0.595238 |
41c73991071b4ac8b8458727acde451fab92847a | 1,747 | py | Python | ipcs/2018/counting_rectangles.py | Loks-/competitions | 3bb231ba9dd62447048832f45b09141454a51926 | [
"MIT"
] | 4 | 2018-06-05T14:15:52.000Z | 2022-02-08T05:14:23.000Z | ipcs/2018/counting_rectangles.py | Loks-/competitions | 3bb231ba9dd62447048832f45b09141454a51926 | [
"MIT"
] | null | null | null | ipcs/2018/counting_rectangles.py | Loks-/competitions | 3bb231ba9dd62447048832f45b09141454a51926 | [
"MIT"
] | 1 | 2018-10-21T11:01:35.000Z | 2018-10-21T11:01:35.000Z | import array
import sys
sys.setrecursionlimit(10000)
MOD = 1000000007
_sj = []
for i in range(5001):
_sj.append(array.array('l', [-1] * (2 * i + 1)))
def surjections(m, n):
if n < 0 or 2 * m < n:
return 0
if m == 0:
return int(n == 0)
if _sj[m][n] == -1:
s = 0
s += su... | 19.197802 | 70 | 0.448197 |
68bb8889a577a772413b050be6b1d3991ae20981 | 1,379 | py | Python | Increment.py | Maxim01/Programmes | dbe5b83b3c65776ccc00049793fa85313fb76065 | [
"Apache-2.0"
] | null | null | null | Increment.py | Maxim01/Programmes | dbe5b83b3c65776ccc00049793fa85313fb76065 | [
"Apache-2.0"
] | null | null | null | Increment.py | Maxim01/Programmes | dbe5b83b3c65776ccc00049793fa85313fb76065 | [
"Apache-2.0"
] | null | null | null | import json
import time
import subprocess
from time import gmtime, strftime
HEURE_SCAN = 0
def stock_heure2():
with open('/home/Devismes_Bridge/JSON_List/Last_connected.json') as f:
dataa = json.load(f)
dataa["Heure_ref"]["DATE_MAX"] = strftime("%H:%M:%S %d/%m/%Y", time.localtime())
... | 23.372881 | 124 | 0.637418 |
6b7af7bdc7d163f43c04f29ed8d2b9053c373581 | 2,739 | py | Python | rawio/align/level.py | hdkai/Raw-IO | f0fa928d7ef59a363c6f4c876d642af6dede6ae4 | [
"Apache-2.0"
] | null | null | null | rawio/align/level.py | hdkai/Raw-IO | f0fa928d7ef59a363c6f4c876d642af6dede6ae4 | [
"Apache-2.0"
] | null | null | null | rawio/align/level.py | hdkai/Raw-IO | f0fa928d7ef59a363c6f4c876d642af6dede6ae4 | [
"Apache-2.0"
] | null | null | null | #
# RawIO
# Copyright (c) 2021 Yusuf Olokoba.
#
from cv2 import getRotationMatrix2D, warpPerspective
from lsd import line_segment_detector
from numpy import abs, array, asarray, arctan2, pi, rad2deg, vstack, zeros_like
from PIL import Image
from sklearn.linear_model import RANSACRegressor
from .constrain import ... | 39.128571 | 122 | 0.663381 |
6b8ea754c71a46393ba9d8e1deeabeb0798f8ff4 | 5,864 | py | Python | official_examples/Using_MXNet_to_Create_a_MNIST_Dataset_Recognition_Application/codes/train_mnist.py | hellfire0831/ModelArts-Lab | 3e826a5b388244c0588b7bb916184750997ab272 | [
"Apache-2.0"
] | 1,045 | 2019-05-09T02:50:43.000Z | 2022-03-31T06:22:11.000Z | official_examples/Using_MXNet_to_Create_a_MNIST_Dataset_Recognition_Application/codes/train_mnist.py | hellfire0831/ModelArts-Lab | 3e826a5b388244c0588b7bb916184750997ab272 | [
"Apache-2.0"
] | 1,468 | 2019-05-16T00:48:18.000Z | 2022-03-08T04:12:44.000Z | official_examples/Using_MXNet_to_Create_a_MNIST_Dataset_Recognition_Application/codes/train_mnist.py | hellfire0831/ModelArts-Lab | 3e826a5b388244c0588b7bb916184750997ab272 | [
"Apache-2.0"
] | 1,077 | 2019-05-09T02:50:53.000Z | 2022-03-27T11:05:32.000Z | import mxnet as mx
import argparse
import logging
import os
# load data
def get_mnist_iter(args):
train_image = os.path.join(args.data_url + 'train-images-idx3-ubyte')
train_label = os.path.join(args.data_url + 'train-labels-idx1-ubyte')
try:
import moxing.mxnet as mox
except:
assert os.... | 47.290323 | 115 | 0.616644 |
5cfc29885daabd72bd7e5d74a2904b6dbfab5b1f | 866 | py | Python | conftest.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 2,706 | 2018-04-05T18:28:50.000Z | 2022-03-29T16:56:59.000Z | conftest.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 242 | 2018-04-05T22:30:42.000Z | 2022-03-19T01:55:11.000Z | conftest.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 464 | 2018-04-05T19:10:34.000Z | 2022-03-28T13:33:32.000Z | import pytest
import retro.data
inttypes = {
'exp': retro.data.Integrations.EXPERIMENTAL_ONLY,
'contrib': retro.data.Integrations.CONTRIB_ONLY,
}
def pytest_collection_modifyitems(items):
def test(*args, **kwargs):
print(kwargs)
return False
for item in items:
if item.origina... | 32.074074 | 129 | 0.572748 |
cf73d0858ca37524ac3c0b6cb97d576455ebe07b | 2,382 | py | Python | Python/Buch_ATBS/Teil_1/Kapitel_05_Dictionary_und_Datenstrukturen/06_kapitel_5_repetitionsfragen.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Buch_ATBS/Teil_1/Kapitel_05_Dictionary_und_Datenstrukturen/06_kapitel_5_repetitionsfragen.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_ATBS/Teil_1/Kapitel_05_Dictionary_und_Datenstrukturen/06_kapitel_5_repetitionsfragen.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | # Repetitionsfragen des 5. Kapitels
def cls():
for i in range(15):
print('')
cls()
print('1. Wie sieht der Code für ein Leeres Dictionary aus?')
print('\n\n\n\n')
input()
print('\n\n\n\n')
print('Ein Dictionary definiert man mit "name={}"')
print('\n\n\n\n')
input()
cls()
print('2. Wie sieht ein Dictiona... | 29.407407 | 205 | 0.672124 |
d8725a369ac97c3276ae891b3da5d1b23c3846e6 | 4,386 | py | Python | Documentation/licenses.py | simonbredemeier/ds100bot | 1318b32b818891f4bc6d24f12fcf0ceae898f8bd | [
"Apache-2.0"
] | null | null | null | Documentation/licenses.py | simonbredemeier/ds100bot | 1318b32b818891f4bc6d24f12fcf0ceae898f8bd | [
"Apache-2.0"
] | null | null | null | Documentation/licenses.py | simonbredemeier/ds100bot | 1318b32b818891f4bc6d24f12fcf0ceae898f8bd | [
"Apache-2.0"
] | null | null | null | """Generates the copyright file with license information"""
from xml.etree import ElementTree as ET
from .markdowndoc import MarkdownDoc
from .generator import Generator
def add_source(target, source):
source_link = source.get('url', None)
source_element = ET.SubElement(target, 'span')
if source_link is n... | 38.814159 | 90 | 0.574555 |
d8ac68bcafd7e2139c624b1cf1eaf9ac32b7eada | 784 | py | Python | custom_components/stadtreinigung_hamburg/__init__.py | topic2k/sensor.stadtreinigung_hamburg | 32420374c5c3d46224d80abfa19c75e89835e9a3 | [
"MIT"
] | 17 | 2019-08-02T20:29:39.000Z | 2021-12-31T18:48:23.000Z | custom_components/stadtreinigung_hamburg/__init__.py | topic2k/sensor.stadtreinigung_hamburg | 32420374c5c3d46224d80abfa19c75e89835e9a3 | [
"MIT"
] | 10 | 2019-08-20T18:27:10.000Z | 2022-01-10T09:04:51.000Z | custom_components/stadtreinigung_hamburg/__init__.py | topic2k/sensor.stadtreinigung_hamburg | 32420374c5c3d46224d80abfa19c75e89835e9a3 | [
"MIT"
] | 7 | 2019-09-04T12:39:41.000Z | 2022-01-09T18:47:59.000Z | """The Stadtreinigung Hamburg integration"""
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import Config, HomeAssistant
DOMAIN = "stadtreinigung_hamburg"
async def async_setup(hass, config):
"""Do not allow config via configuration.yaml"""
return True
async def async_setup_en... | 31.36 | 85 | 0.76148 |
2b4e9b47d7a502618f8878db8334551ca7f3785e | 635 | py | Python | INBa/2015/Chinkirov_V_V/task_5_29.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Chinkirov_V_V/task_5_29.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Chinkirov_V_V/task_5_29.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача 5.Вариант 29.
#Напишите программу, которая бы при запуске случайным образом отображала имя одного из пяти членов экипажей программы "Союз - Апполон".
#Чинкиров В.В.
#28.03.2016
import random
print("Программа случайным образом отображает имя одного из пяти членов экипажа Союз-Апполон")
x = int (random.randint(... | 27.608696 | 135 | 0.661417 |
99982554ac208162fbedec0eee40c0d69008e258 | 212 | py | Python | Exercicios/ex09-4e.py | BoltzBit/LP | f84d36d1bdee9a20c197cebec2810234c5311fb8 | [
"MIT"
] | null | null | null | Exercicios/ex09-4e.py | BoltzBit/LP | f84d36d1bdee9a20c197cebec2810234c5311fb8 | [
"MIT"
] | null | null | null | Exercicios/ex09-4e.py | BoltzBit/LP | f84d36d1bdee9a20c197cebec2810234c5311fb8 | [
"MIT"
] | null | null | null | #Conversao de Kelvin para fahrenheit
kelvin = float(input('Informe a temperatura em Kelvin: '))
fahrenheit = ((kelvin - 273.15)*(9/5)) + 32
msg = 'Temperatura em Fahrenheit: {}'
print(msg.format(fahrenheit))
| 21.2 | 58 | 0.70283 |
511d6df69c9f877c27556b12e1aa4495c7c71a0e | 458 | py | Python | python/is_prime.py | daoxuewu/cheat_sheet | 4a164f7eccb85ca39b9a9ad58fe5d495862ecf44 | [
"MIT"
] | null | null | null | python/is_prime.py | daoxuewu/cheat_sheet | 4a164f7eccb85ca39b9a9ad58fe5d495862ecf44 | [
"MIT"
] | null | null | null | python/is_prime.py | daoxuewu/cheat_sheet | 4a164f7eccb85ca39b9a9ad58fe5d495862ecf44 | [
"MIT"
] | null | null | null | # 寫一程式,輸入兩個數字做為範圍最小值和最大值(兩數字介於2~500),輸出指定範圍內的質數。
# (Hint:質數的定義為因數只有1和自己)
# for 迴圈寫法
max = eval(input("max : "))
min = eval(input("min : "))
for num in range(min,max+1):
# 質數大於 1
# if num > 1:
if max>min and max<=500 and min>=2:
for i in range(2,num):
if (num % i) == 0:
... | 25.444444 | 49 | 0.484716 |
5abbcf00917de075974784354e060fe34484d9c9 | 5,792 | py | Python | Trie Implementation.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | Trie Implementation.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | Trie Implementation.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
'''
Implement a trie with insert, search, and startsWith methods.
Note:
You may assume that all inputs are consist of lowercase letters a-z.
'''
class TrieNode:
# Initialize your data structure here.
def __init__(self):
self.val = None
self.pointers={}
class Trie:
def __init__(self):
se... | 33.097143 | 938 | 0.724793 |
cfa8706bb43f537f088674431d9c46f0f2712e46 | 6,808 | py | Python | src/onegov/org/models/resource.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/models/resource.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/models/resource.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import sedate
from datetime import datetime
from libres.db.models import ReservedSlot
from onegov.core.orm.mixins import meta_property, content_property
from onegov.core.orm.types import UUID
from onegov.form.models import FormSubmission
from onegov.org.models.extensions import ContactExtension, \
ResourceValida... | 33.372549 | 79 | 0.668184 |
cfe7bb527736f6989bceaf10c2026b2e86988826 | 98 | py | Python | Road_safety/hackathon/apps.py | mukul54/xyz-bosch | 92a3f2d1e8c8308547b2e9de5d5b20ebdd6d925a | [
"Apache-2.0"
] | 3 | 2019-07-05T16:52:34.000Z | 2021-07-09T09:01:03.000Z | Road_safety/hackathon/apps.py | mukul54/xyz-bosch | 92a3f2d1e8c8308547b2e9de5d5b20ebdd6d925a | [
"Apache-2.0"
] | 5 | 2020-08-18T21:45:56.000Z | 2021-04-13T14:36:47.000Z | Road_safety/hackathon/apps.py | mukul54/xyz-bosch | 92a3f2d1e8c8308547b2e9de5d5b20ebdd6d925a | [
"Apache-2.0"
] | 2 | 2019-07-02T21:36:40.000Z | 2019-08-23T16:17:11.000Z | from django.apps import AppConfig
class HackathonConfig(AppConfig):
name = 'hackathon'
| 16.333333 | 34 | 0.72449 |
cfe88c8ab4944dcad9ba8fa6daf6a409ee7fe5de | 175 | py | Python | scratch/multiply_data.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 2 | 2020-12-25T19:37:42.000Z | 2021-03-26T04:59:12.000Z | scratch/multiply_data.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 6 | 2018-08-07T22:48:52.000Z | 2021-10-07T18:38:20.000Z | scratch/multiply_data.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | null | null | null | with open('tutorial_json_data.json', 'r') as f:
data = f.read()
for i in range(100):
f = open('tutorial_json_data_%i.json' % i, 'w')
f.write(data)
f.close()
| 21.875 | 52 | 0.594286 |
85b902a72a72f92bf36983d5f43aa451139f1f69 | 4,874 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/generateBidiDistricts.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 4 | 2020-11-13T02:35:56.000Z | 2021-03-29T20:15:54.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/generateBidiDistricts.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 9 | 2020-12-09T02:12:39.000Z | 2021-02-18T00:15:28.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/generateBidiDistricts.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | #!/usr/bin/env python
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2012-2020 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.ec... | 39.626016 | 112 | 0.638695 |
74ce696cb555cf1b43819233b3e42730f3195f8e | 1,959 | py | Python | task_1/data_investigation/wordclouds.py | strumswell/sentiment-apple-events | b6f4f7799374aba757874f5426b3a2c1bf7d29b5 | [
"MIT"
] | 1 | 2022-02-28T22:02:50.000Z | 2022-02-28T22:02:50.000Z | task_1/data_investigation/wordclouds.py | strumswell/sentiment-apple-events | b6f4f7799374aba757874f5426b3a2c1bf7d29b5 | [
"MIT"
] | null | null | null | task_1/data_investigation/wordclouds.py | strumswell/sentiment-apple-events | b6f4f7799374aba757874f5426b3a2c1bf7d29b5 | [
"MIT"
] | null | null | null | # %% Importing modules
import pandas as pd
from wordcloud import WordCloud
# %% Read Documents
events = ['2020_Nov_Post', '2020_Nov', '2020_Nov_Pre', '2020_Oct_Post', '2020_Oct', '2020_Oct_Pre', '2020_Sept_Post', '2020_Sept', '2020_Sept_Pre', '2020_Jun_Post', '2020_Jun', '2020_Jun_Pre', '2019_Sept_Post', '2019_Sept',... | 48.975 | 463 | 0.728433 |
2d10c05ac0e42ae885852c7f695d439267cdca9d | 756 | py | Python | redis_test.py | BogyMitutoyoCTL/Riesen-Tetris | 8bbbaf0b7aeae7890da724d3d72719a7d068237a | [
"MIT"
] | 1 | 2019-04-27T07:28:52.000Z | 2019-04-27T07:28:52.000Z | redis_test.py | BogyMitutoyoCTL/Riesen-Tetris | 8bbbaf0b7aeae7890da724d3d72719a7d068237a | [
"MIT"
] | null | null | null | redis_test.py | BogyMitutoyoCTL/Riesen-Tetris | 8bbbaf0b7aeae7890da724d3d72719a7d068237a | [
"MIT"
] | null | null | null | import redis
r = redis.StrictRedis(host='localhost', port=6379)
subscriptions = r.pubsub()
subscriptions.subscribe('game_action')
while True:
message = subscriptions.get_message()
if message:
command = message['data']
if isinstance(command, (bytes, bytearray)):
command = str(comman... | 29.076923 | 51 | 0.496032 |
74a26f82fcf80d8f1fe9178cf84cba450d6b130d | 5,821 | py | Python | jumeaux/addons/judgement/ignore.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 11 | 2017-10-02T01:29:12.000Z | 2022-03-31T08:37:22.000Z | jumeaux/addons/judgement/ignore.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 79 | 2017-07-16T14:47:17.000Z | 2022-03-31T08:49:14.000Z | jumeaux/addons/judgement/ignore.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 2 | 2019-01-28T06:11:58.000Z | 2021-01-25T07:21:21.000Z | # -*- coding:utf-8 -*-
from owlmixin import OwlMixin, TOption
from owlmixin.owlcollections import TList, TDict
from jumeaux.addons.judgement import JudgementExecutor
from jumeaux.utils import (
exact_match,
when_optional_filter,
get_jinja2_format_error,
get_by_diff_key,
)
from jumeaux.logger import Lo... | 32.160221 | 99 | 0.598694 |
bb5560afb0d8326165123934ca0dde41bb734474 | 1,537 | py | Python | handlemoursedata/com/aaron/dao/component_dao.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | handlemoursedata/com/aaron/dao/component_dao.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | 2 | 2021-03-25T22:00:07.000Z | 2022-01-20T15:51:48.000Z | handlemoursedata/com/aaron/dao/component_dao.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null |
from .base_dao import Component,ComponentProps
from .base_dao import Session
from com.aaron.bean.component_property import ComponentProperty
from com.aaron.bean.component_prop import ComponentProp
def addComponent(componentProperty):
'''添加component'''
if(componentProperty is None):
return 0;
# 创建... | 31.367347 | 154 | 0.720234 |
24e79f5582dcf7606098662a4f402e8c08f2d1d6 | 2,157 | py | Python | IVTa/2014/SHCHUKIN_F_O/python_games/snake.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | 1 | 2021-04-02T17:43:48.000Z | 2021-04-02T17:43:48.000Z | IVTa/2014/SHCHUKIN_F_O/python_games/snake.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | IVTa/2014/SHCHUKIN_F_O/python_games/snake.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | 1 | 2020-12-18T18:04:49.000Z | 2020-12-18T18:04:49.000Z | # Snake game
# Can you catch all apples?
#
# Fedya ivt
from sys import stdout as out
from time import sleep
size = 20 # size of game
snake_size = size // 3
# Grid building, vertical line first, then copying
# in to horizontals
grid = []
grid_vert = [0] * size
[grid.append(grid_vert[:]) for i in range(size)] # [:] ma... | 24.235955 | 74 | 0.529903 |
701b260fcc16164c82423cf204bd182c48cdc4a3 | 5,553 | py | Python | test/test_npu/test_network_ops/test_thnn_conv_depthwise2d_forward.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test_thnn_conv_depthwise2d_forward.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test_thnn_conv_depthwise2d_forward.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020, Huawei Technologies.All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law... | 42.068182 | 134 | 0.65154 |
701ba091e0d156fde4ca52f8bf2966719f492cf8 | 1,617 | py | Python | SBTK_League_Helper/src/security/exceptions.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | SBTK_League_Helper/src/security/exceptions.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | SBTK_League_Helper/src/security/exceptions.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | class PasswordError(Exception):
def __init__(self, message = ""):
self.description = "Invalid password."
if message:
self.description += " " + message
def __str__(self):
return repr(self.description)
class PasswordLengthError(PasswordError):
def __init__... | 35.152174 | 143 | 0.66543 |
3b4600d6f530b88fc44cd493ad6788e99c23ed88 | 6,678 | py | Python | src/img2imgDataset.py | misogil0116/Biscotti | 010ef0f29fbd5d33c9870ce249f1a9824f3471c4 | [
"Apache-2.0"
] | 10 | 2018-01-11T01:15:15.000Z | 2020-06-22T15:03:31.000Z | src/img2imgDataset.py | misogil0116/Biscotti | 010ef0f29fbd5d33c9870ce249f1a9824f3471c4 | [
"Apache-2.0"
] | null | null | null | src/img2imgDataset.py | misogil0116/Biscotti | 010ef0f29fbd5d33c9870ce249f1a9824f3471c4 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import cv2
import os
import pandas as pd
import argparse
"""
[WIP]
this class operates the dataset.
except for load_dataset() method, other method is used for making dataset.
csv/ => dumped DCT coeffs.
qopt_images/ => images made by guetzli, and this image is only optimized quantization table, but... | 41.222222 | 133 | 0.600329 |
3b4a7c67546ca3c55571d93849847bafa44db463 | 239 | py | Python | HackerRank/HackerRank-Python/Basic Data Types/List Comprehensions.py | tareqmahmud/Competitive-Programming | ad5e53300d70280bccbd5046ca01278fb246f314 | [
"MIT"
] | 2 | 2020-11-19T19:03:28.000Z | 2021-01-04T19:52:11.000Z | HackerRank-Python/Basic Data Types/List Comprehensions.py | tareqmahmud/HackerRank | e1b9facab6582f86ea6cc63afcc640e66ba3f67e | [
"MIT"
] | null | null | null | HackerRank-Python/Basic Data Types/List Comprehensions.py | tareqmahmud/HackerRank | e1b9facab6582f86ea6cc63afcc640e66ba3f67e | [
"MIT"
] | null | null | null | if __name__ == '__main__':
x = int(input())
y = int(input())
z = int(input())
n = int(input())
result = [[X, Y, Z] for X in range(x + 1) for Y in range(y + 1) for Z in range(z + 1) if X + Y + Z != n]
print(result)
| 26.555556 | 108 | 0.497908 |
8e5e51224cf3493e38b3b1e0fb40300874c678eb | 6,126 | py | Python | test/test_npu/test_network_ops/test_norm_ext.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test_norm_ext.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test_norm_ext.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020, Huawei Technologies.All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law... | 47.123077 | 107 | 0.607411 |
d9746739ed9a36e196f7f1fa3f07cd9a245e94f2 | 1,069 | py | Python | src/server/bo/Module.py | muenstermannmarius/ElectionSystem | a6e60d9147423787e869587b808def4771f89cb7 | [
"RSA-MD"
] | null | null | null | src/server/bo/Module.py | muenstermannmarius/ElectionSystem | a6e60d9147423787e869587b808def4771f89cb7 | [
"RSA-MD"
] | null | null | null | src/server/bo/Module.py | muenstermannmarius/ElectionSystem | a6e60d9147423787e869587b808def4771f89cb7 | [
"RSA-MD"
] | null | null | null | from server.bo.NamedBusinessObject import NamedBusinessObject
class Module(NamedBusinessObject):
"""The implementation of a exemplary module class.
"""
def __init__self(self):
super().__init__()
self._edv_number=""
def set_edv_number(self,edv_number):
"""Set the edv number"""... | 26.725 | 115 | 0.627689 |
796692d3e277cac0245c20d3d0053c142ed6d8e5 | 338 | py | Python | Chapter2_Python/Lists.py | thisisjako/UdemyTF | ee4102391ed6bd50f764955f732f5740425a9209 | [
"MIT"
] | null | null | null | Chapter2_Python/Lists.py | thisisjako/UdemyTF | ee4102391ed6bd50f764955f732f5740425a9209 | [
"MIT"
] | null | null | null | Chapter2_Python/Lists.py | thisisjako/UdemyTF | ee4102391ed6bd50f764955f732f5740425a9209 | [
"MIT"
] | null | null | null | grade_ben = 1
grade_jan = 2
grade_peter = 1
# 0, 1, 2
grades = [1, 2, 1]
grade_melissa = 4
print(grades)
grades.append(grade_melissa)
print(grades)
grades.pop()
print(grades)
print("Bens grade: ", grades[0])
print("Jans grade: ", grades[1])
print("Peters grade: ", grades[2])
grades.pop(1... | 15.363636 | 35 | 0.62426 |
799ab4e5e08897834615179a43efb2f33c4013f2 | 252 | py | Python | diversos/tres.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | 1 | 2021-12-18T15:29:24.000Z | 2021-12-18T15:29:24.000Z | diversos/tres.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | null | null | null | diversos/tres.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | 3 | 2021-08-23T22:45:20.000Z | 2022-02-17T13:17:09.000Z | base = altura = area = 0
while base <= 0: base = int(input("Entre com a Base do triangulo :-> "))
while altura <= 0: altura = int(input("Entre com a altura do triangulo:-> "))
area = (base* altura)/2
print (f"E a área do triangulo é de {area:.4f}")
| 31.5 | 77 | 0.634921 |
eb693f9176f09abb995e916f902f11baeef01dc5 | 322 | py | Python | noticias/urls.py | miglesias91/dt | 6e00f883ebdb581f87750852f18cf9e3058aae2f | [
"MIT"
] | null | null | null | noticias/urls.py | miglesias91/dt | 6e00f883ebdb581f87750852f18cf9e3058aae2f | [
"MIT"
] | null | null | null | noticias/urls.py | miglesias91/dt | 6e00f883ebdb581f87750852f18cf9e3058aae2f | [
"MIT"
] | null | null | null | from django.urls import path
from noticias.views import VistaNoticias, VistaNota
from noticias.models import Nota
noticias_vista = VistaNoticias.as_view()
nota_vista = VistaNota.as_view()
urlpatterns = [
path('noticias/<slug:slug>', nota_vista, name="nota"),
path('noticias/', noticias_vista, name="noticias"),... | 29.272727 | 58 | 0.757764 |
d66bd56a481784662ba0266f2ad29da8d091b53e | 2,456 | py | Python | demos/System_Dynamics/Compartment_Models/seird/model/parts/seird_model.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 56 | 2020-07-08T23:23:15.000Z | 2022-03-11T20:43:09.000Z | demos/System_Dynamics/Compartment_Models/seird/model/parts/seird_model.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 41 | 2020-07-11T23:24:06.000Z | 2022-01-28T13:28:07.000Z | demos/System_Dynamics/Compartment_Models/seird/model/parts/seird_model.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 39 | 2020-07-15T11:35:04.000Z | 2022-02-01T16:02:51.000Z | import numpy as np
## Policies
def p_exposed_growth(params, substep, state_history, prev_state):
exposed_population = params['infection_rate']*prev_state['infected']*(prev_state['susceptible']/(prev_state['susceptible']+ prev_state['exposed'] + prev_state['infected'] + prev_state['recovered']))
return {'exp... | 50.122449 | 235 | 0.769137 |
bafaff5300e2777698a8fbc57f1e899c1f305bd9 | 2,383 | py | Python | test/test_npu/test_network_ops/test_resize_.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test_resize_.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test_resize_.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020 Huawei Technologies Co., Ltd
# Copyright (c) 2019, Facebook CORPORATION.
# All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licen... | 34.536232 | 91 | 0.665128 |
2425f25098a14d25f116f92cd8a273c838b7e80a | 6,982 | py | Python | research/cv/Auto-DeepLab/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/Auto-DeepLab/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/Auto-DeepLab/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 40.593023 | 119 | 0.675451 |
79e84b6d7bf3fbc47abcc4cbbec0d6c9a0f2984b | 290 | py | Python | packages/watchmen-model/src/watchmen_model/console/utils.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/console/utils.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/console/utils.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from typing import Optional, Union
from watchmen_model.common import GraphicRect
def construct_rect(rect: Optional[Union[dict, GraphicRect]]) -> Optional[GraphicRect]:
if rect is None:
return None
elif isinstance(rect, GraphicRect):
return rect
else:
return GraphicRect(**rect)
| 22.307692 | 86 | 0.772414 |
03055b7162336228b99ee50e2415523f58a2fe63 | 997 | py | Python | backend/apps/accounts/views_staff.py | match4healthcare/match4healthcare | acf69e3b781d715f0a947c2a9df6646e94f1ca6b | [
"MIT"
] | 2 | 2020-03-28T13:56:39.000Z | 2020-03-29T10:16:12.000Z | backend/apps/accounts/views_staff.py | match4healthcare/match4healthcare | acf69e3b781d715f0a947c2a9df6646e94f1ca6b | [
"MIT"
] | 76 | 2020-03-27T21:53:04.000Z | 2020-03-30T20:27:43.000Z | backend/apps/accounts/views_staff.py | match4healthcare/match4healthcare | acf69e3b781d715f0a947c2a9df6646e94f1ca6b | [
"MIT"
] | null | null | null | from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.auth.decorators import login_required
from django.shortcuts import render
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.ticker import MaxNLocator
import mpld3
from .db_stats import DataBaseStats
matplotlib.... | 28.485714 | 100 | 0.721163 |
03503908974719e71f86f4a7b4aed1f4c9b4376f | 418 | py | Python | server/apps/recommendation/adminx.py | Mayandev/django_morec | 8d115f76ad69d7aa78b07dc06aa7047979ad134b | [
"MIT"
] | 129 | 2019-04-20T08:23:25.000Z | 2022-03-14T10:02:23.000Z | server/apps/recommendation/adminx.py | heartplus/django_morec | 8d115f76ad69d7aa78b07dc06aa7047979ad134b | [
"MIT"
] | 9 | 2019-05-19T15:06:17.000Z | 2021-12-14T06:47:14.000Z | server/apps/recommendation/adminx.py | heartplus/django_morec | 8d115f76ad69d7aa78b07dc06aa7047979ad134b | [
"MIT"
] | 34 | 2019-05-06T06:37:17.000Z | 2021-12-09T02:27:58.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019-04-26 19:24
# @Author : Mayandev
# @Site : https://github.com/Mayandev/
# @File : adminx.py
# @Software: PyCharm
import xadmin
from .models import Recommendation
class RecommendationAdmin(object):
list_display = ['user', 'doubanId', 'descrip... | 20.9 | 57 | 0.681818 |
306f51acfb5278fb14f38ac52f7925312ba6ec00 | 243 | py | Python | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pybedtools-0.7.6-py2.7-linux-x86_64.egg/pybedtools/version.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 1 | 2019-07-29T02:53:51.000Z | 2019-07-29T02:53:51.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pybedtools-0.7.6-py2.7-linux-x86_64.egg/pybedtools/version.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 1 | 2021-09-11T14:30:32.000Z | 2021-09-11T14:30:32.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pybedtools-0.7.6-py2.7-linux-x86_64.egg/pybedtools/version.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 2 | 2016-12-19T02:27:46.000Z | 2019-07-29T02:53:54.000Z |
# THIS FILE IS GENERATED FROM SETUP.PY
short_version = '0.7.6'
version = '0.7.6'
full_version = '0.7.6'
git_revision = 'b5da5b2ecf4d1ffb3c4bf0e668c18feae5b1e20b'
release = True
__version__ = version
if not release:
version = full_version | 22.090909 | 57 | 0.753086 |
06466807461d09e2048be565909dfbdf0c96112d | 10,670 | py | Python | BoxCoderV2.py | Xeit666h05t/BoxCoderV.2 | 029c5f61149a9f819b89223c5c0dfbae40d3b4dd | [
"Apache-2.0"
] | null | null | null | BoxCoderV2.py | Xeit666h05t/BoxCoderV.2 | 029c5f61149a9f819b89223c5c0dfbae40d3b4dd | [
"Apache-2.0"
] | null | null | null | BoxCoderV2.py | Xeit666h05t/BoxCoderV.2 | 029c5f61149a9f819b89223c5c0dfbae40d3b4dd | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python2
# Xeit666h05t
# Author: Xeit666h05t
# Email:xeitcyber@gmail.com
# Team: CoiZter_Team
# Hargai CopyRight Ya Bila Ingin Di Hargai
#*/kalau mau di hargain Hargai Copyright Yang Bikin
import os
import base64
os.system("clear")
print """
Xeit666h05t
Tools Box Sederhana
... | 36.666667 | 109 | 0.548547 |
9dc269b88e8a49a56d0a8fd2b3983afd8411204b | 4,041 | py | Python | Flask.py | FurySwordXD/MovieBuzz-Python | b68c2435729881d70e6e629f3e72961effe106c3 | [
"MIT"
] | null | null | null | Flask.py | FurySwordXD/MovieBuzz-Python | b68c2435729881d70e6e629f3e72961effe106c3 | [
"MIT"
] | null | null | null | Flask.py | FurySwordXD/MovieBuzz-Python | b68c2435729881d70e6e629f3e72961effe106c3 | [
"MIT"
] | null | null | null | from flask import Flask, render_template, request, session, jsonify
import pymysql.cursors
import os
app = Flask(__name__)
app.secret_key = os.urandom(24)
@app.route("/")
def index():
connection = pymysql.connect(host='localhost',user='root', password='', db='moviebuzz')
cursor = connection.cursor()
sql ... | 27.304054 | 146 | 0.547637 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.