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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
81ce19d9fe67509f03e75e87e8dd190ac5b67ad4 | 22 | py | Python | Analysis/CardioVascularLab/ExVivo/uniaxanalysis/testcode.py | sassystacks/TissueMechanicsLab | 0f881a57ebf7cbadfeb2041daabd4e4b79b25b91 | [
"MIT"
] | null | null | null | Analysis/CardioVascularLab/ExVivo/uniaxanalysis/testcode.py | sassystacks/TissueMechanicsLab | 0f881a57ebf7cbadfeb2041daabd4e4b79b25b91 | [
"MIT"
] | null | null | null | Analysis/CardioVascularLab/ExVivo/uniaxanalysis/testcode.py | sassystacks/TissueMechanicsLab | 0f881a57ebf7cbadfeb2041daabd4e4b79b25b91 | [
"MIT"
] | null | null | null | print(type(range(3)))
| 11 | 21 | 0.681818 | print(type(range(3)))
| 0 | 0 | 0 |
644fe1bdc1784b3685dc77a0f3cf83ee128c893e | 4,183 | py | Python | mylib/ext/pyside2/layout.py | fakegit/mo-han-toolbox | 9d5bbc1fe7f12040715d3a0d3f320a1ad617aed8 | [
"MIT"
] | 24 | 2019-12-08T03:56:32.000Z | 2021-10-02T13:26:37.000Z | mylib/ext/pyside2/layout.py | fakegit/mo-han-toolbox | 9d5bbc1fe7f12040715d3a0d3f320a1ad617aed8 | [
"MIT"
] | 2 | 2020-04-27T14:20:01.000Z | 2020-07-17T06:05:33.000Z | mylib/ext/pyside2/layout.py | fakegit/mo-han-toolbox | 9d5bbc1fe7f12040715d3a0d3f320a1ad617aed8 | [
"MIT"
] | 10 | 2019-08-06T01:11:28.000Z | 2021-07-19T08:45:11.000Z | #!/usr/bin/env python3
from PySide2.QtCore import *
from PySide2.QtWidgets import *
from mylib.easy import T
| 32.679688 | 113 | 0.586421 | #!/usr/bin/env python3
from PySide2.QtCore import *
from PySide2.QtWidgets import *
from mylib.easy import T
class EzQtLayoutWrapper:
def __init__(self, layout_class, owner_widget=None, parent=None):
self.widget = owner_widget or QWidget(parent)
self.layout = layout_class(self.widget)
sel... | 3,501 | 124 | 445 |
ab41279e52d1c7490b8a00addbab8e7f44970e0f | 471 | py | Python | leetcode/jumpGame.py | kokuraxc/play-ground | 48b5291f3cca117e0cd0a17bf9255ec4dc1a5cdd | [
"MIT"
] | null | null | null | leetcode/jumpGame.py | kokuraxc/play-ground | 48b5291f3cca117e0cd0a17bf9255ec4dc1a5cdd | [
"MIT"
] | null | null | null | leetcode/jumpGame.py | kokuraxc/play-ground | 48b5291f3cca117e0cd0a17bf9255ec4dc1a5cdd | [
"MIT"
] | null | null | null | # https://leetcode.com/problems/jump-game/
nums = [2, 3, 1, 1, 4]
print(Solution().canJump(nums))
nums = [3, 2, 1, 0, 4]
print(Solution().canJump(nums)) | 23.55 | 49 | 0.526539 | # https://leetcode.com/problems/jump-game/
class Solution:
def canJump(self, nums: list[int]) -> bool:
last = 0
for index in range(len(nums)):
if index > last:
return False
last = max(last, index + nums[index])
if last >= len(nums) - 1:
... | 272 | -6 | 49 |
8cc6993d3105afbe975cd32ccd39f9f479e03924 | 769 | py | Python | Python/contains-duplicate-iii.py | se77enn/LeetCode-Solution | d29ef5358cae592b63952c3d293897a176fb75e1 | [
"MIT"
] | 1 | 2020-10-27T03:22:31.000Z | 2020-10-27T03:22:31.000Z | Python/contains-duplicate-iii.py | se77enn/LeetCode-Solution | d29ef5358cae592b63952c3d293897a176fb75e1 | [
"MIT"
] | null | null | null | Python/contains-duplicate-iii.py | se77enn/LeetCode-Solution | d29ef5358cae592b63952c3d293897a176fb75e1 | [
"MIT"
] | 1 | 2021-03-22T18:58:23.000Z | 2021-03-22T18:58:23.000Z | # Time: O(n * t)
# Space: O(max(k, t))
import collections
# @param {integer[]} nums
# @param {integer} k
# @param {integer} t
# @return {boolean}
| 27.464286 | 90 | 0.507152 | # Time: O(n * t)
# Space: O(max(k, t))
import collections
class Solution:
# @param {integer[]} nums
# @param {integer} k
# @param {integer} t
# @return {boolean}
def containsNearbyAlmostDuplicate(self, nums, k, t):
if k < 0 or t < 0:
return False
window = collections.O... | 561 | -6 | 49 |
822e39476188e66046cf0c4f379b55ffbd63e9f2 | 243 | py | Python | jp.atcoder/abc151/abc151_b/9487259.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-09T03:06:25.000Z | 2022-02-09T03:06:25.000Z | jp.atcoder/abc151/abc151_b/9487259.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-05T22:53:18.000Z | 2022-02-09T01:29:30.000Z | jp.atcoder/abc151/abc151_b/9487259.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | null | null | null | import sys
n, k, m, *a = map(int, sys.stdin.read().split())
if __name__ == '__main__':
ans = main()
print(ans)
| 17.357143 | 49 | 0.506173 | import sys
n, k, m, *a = map(int, sys.stdin.read().split())
def main():
s = sum(a)
target = m * n
res = target - s
return -1 if res > k else max(0, res)
if __name__ == '__main__':
ans = main()
print(ans)
| 91 | 0 | 25 |
c51b2727a642fcdae1ef0dfe860bfde918487509 | 5,795 | py | Python | instana/instrumentation/sanic_inst.py | rlopes-ki/python-sensor | 07e827f9982b2a0c482e8eab82d1a420923efd5e | [
"MIT"
] | 61 | 2017-09-27T02:50:17.000Z | 2022-03-22T12:13:37.000Z | instana/instrumentation/sanic_inst.py | rlopes-ki/python-sensor | 07e827f9982b2a0c482e8eab82d1a420923efd5e | [
"MIT"
] | 82 | 2017-07-11T13:47:33.000Z | 2022-03-22T10:10:38.000Z | instana/instrumentation/sanic_inst.py | rlopes-ki/python-sensor | 07e827f9982b2a0c482e8eab82d1a420923efd5e | [
"MIT"
] | 27 | 2017-09-11T16:22:32.000Z | 2022-03-11T17:21:49.000Z | # (c) Copyright IBM Corp. 2021
# (c) Copyright Instana Inc. 2021
"""
Instrumentation for Sanic
https://sanicframework.org/en/
"""
try:
import sanic
import wrapt
import opentracing
from ..log import logger
from ..singletons import async_tracer, agent
from ..util.secrets import strip_secrets_from... | 40.243056 | 110 | 0.574806 | # (c) Copyright IBM Corp. 2021
# (c) Copyright Instana Inc. 2021
"""
Instrumentation for Sanic
https://sanicframework.org/en/
"""
try:
import sanic
import wrapt
import opentracing
from ..log import logger
from ..singletons import async_tracer, agent
from ..util.secrets import strip_secrets_from... | 4,619 | 0 | 169 |
7718bc5b6795c32070b2414d0002493a461a1604 | 437 | py | Python | smooth-topk/src/losses/ml.py | locuslab/lml | cf8251e56332bfe89d2078b06c92d8d489352266 | [
"MIT"
] | 47 | 2019-06-21T12:44:10.000Z | 2021-09-28T14:07:47.000Z | smooth-topk/src/losses/ml.py | locuslab/lml | cf8251e56332bfe89d2078b06c92d8d489352266 | [
"MIT"
] | null | null | null | smooth-topk/src/losses/ml.py | locuslab/lml | cf8251e56332bfe89d2078b06c92d8d489352266 | [
"MIT"
] | 2 | 2019-06-23T02:19:53.000Z | 2020-10-04T23:36:57.000Z | import torch
from torch import nn
| 27.3125 | 66 | 0.622426 | import torch
from torch import nn
class MLLoss(nn.Module):
def __init__(self, n_classes):
super(MLLoss, self).__init__()
self.n_classes = n_classes
self.tau = 1.0
def forward(self, x, y):
n_batch = x.shape[0]
y_onehot = torch.zeros(n_batch, self.n_classes).type_as(x)
... | 324 | 3 | 76 |
e2ef5d35d03c3493f6abc49abfaf537ea5ca37f1 | 4,717 | py | Python | prod/stock_em02_rpc02/run_service.py | liuying3013/vnpy | e1cc1ea4af5fa6ec9a31e5b954c19cfaa0a3130e | [
"MIT"
] | 323 | 2015-11-21T14:45:29.000Z | 2022-03-16T08:54:37.000Z | prod/stock_em02_rpc02/run_service.py | liuying3013/vnpy | e1cc1ea4af5fa6ec9a31e5b954c19cfaa0a3130e | [
"MIT"
] | 9 | 2017-03-21T08:26:21.000Z | 2021-08-23T06:41:17.000Z | prod/stock_em02_rpc02/run_service.py | liuying3013/vnpy | e1cc1ea4af5fa6ec9a31e5b954c19cfaa0a3130e | [
"MIT"
] | 148 | 2016-09-26T03:25:39.000Z | 2022-02-06T14:43:48.000Z | # flake8: noqa
import os
import sys
import multiprocessing
from time import sleep
from datetime import datetime, time
from logging import DEBUG
# 将repostory的目录i,作为根目录,添加到系统环境中。
ROOT_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))
if ROOT_PATH not in sys.path:
sys.path.append(ROOT_PATH)... | 29.48125 | 108 | 0.640025 | # flake8: noqa
import os
import sys
import multiprocessing
from time import sleep
from datetime import datetime, time
from logging import DEBUG
# 将repostory的目录i,作为根目录,添加到系统环境中。
ROOT_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))
if ROOT_PATH not in sys.path:
sys.path.append(ROOT_PATH)... | 729 | 2,693 | 23 |
f16fd565b9f0d2be746b6a8e694c011af883804e | 7,509 | py | Python | deflicker.py | gondsm/timelapse_deflickerer | c5b8d28a76bac0258ac9276352c1363094240e7c | [
"MIT"
] | 4 | 2019-09-30T14:52:56.000Z | 2021-06-29T08:25:56.000Z | deflicker.py | gondsm/timelapse_deflickerer | c5b8d28a76bac0258ac9276352c1363094240e7c | [
"MIT"
] | null | null | null | deflicker.py | gondsm/timelapse_deflickerer | c5b8d28a76bac0258ac9276352c1363094240e7c | [
"MIT"
] | 3 | 2020-08-18T17:15:14.000Z | 2021-01-08T21:16:09.000Z | #!/usr/bin/env python2
# Futures
from __future__ import print_function, division
# Standard
import os
import multiprocessing
# Non-standard
import cv2
import numpy as np
import matplotlib.pyplot as plt
def list_images(input_dir):
""" Produces a list of all the filenames in the input directory. """
# List the fil... | 27.708487 | 120 | 0.745239 | #!/usr/bin/env python2
# Futures
from __future__ import print_function, division
# Standard
import os
import multiprocessing
# Non-standard
import cv2
import numpy as np
import matplotlib.pyplot as plt
def list_images(input_dir):
""" Produces a list of all the filenames in the input directory. """
# List the fil... | 0 | 0 | 0 |
cd0f6818280b452ff518dc257d018138dbe2e39c | 7,696 | py | Python | Cura/Cura/plugins/LegacyProfileReader/tests/TestLegacyProfileReader.py | TIAO-JI-FU/3d-printing-with-moveo-1 | 100ecfd1208fe1890f8bada946145d716b2298eb | [
"MIT"
] | null | null | null | Cura/Cura/plugins/LegacyProfileReader/tests/TestLegacyProfileReader.py | TIAO-JI-FU/3d-printing-with-moveo-1 | 100ecfd1208fe1890f8bada946145d716b2298eb | [
"MIT"
] | null | null | null | Cura/Cura/plugins/LegacyProfileReader/tests/TestLegacyProfileReader.py | TIAO-JI-FU/3d-printing-with-moveo-1 | 100ecfd1208fe1890f8bada946145d716b2298eb | [
"MIT"
] | null | null | null | # Copyright (c) 2018 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import configparser # An input for some functions we're testing.
import os.path # To find the integration test .ini files.
import pytest # To register tests with.
import unittest.mock # To mock the application, plug-in and ... | 39.265306 | 138 | 0.664761 | # Copyright (c) 2018 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import configparser # An input for some functions we're testing.
import os.path # To find the integration test .ini files.
import pytest # To register tests with.
import unittest.mock # To mock the application, plug-in and ... | 4,887 | 0 | 110 |
20b0142c5622d0f930bb32afa0c65e81dad89d2d | 144 | py | Python | ava/messenger/routing.py | patrickporto/elearning | b746fcfa5dadc77eaa0b3e20ff006f386b9dae67 | [
"MIT"
] | null | null | null | ava/messenger/routing.py | patrickporto/elearning | b746fcfa5dadc77eaa0b3e20ff006f386b9dae67 | [
"MIT"
] | null | null | null | ava/messenger/routing.py | patrickporto/elearning | b746fcfa5dadc77eaa0b3e20ff006f386b9dae67 | [
"MIT"
] | null | null | null | from django.urls import path
from .consumers import ChatConsumer
websocket_urlpatterns = [
path(r'ws/chat/<room_name>/', ChatConsumer),
]
| 18 | 48 | 0.75 | from django.urls import path
from .consumers import ChatConsumer
websocket_urlpatterns = [
path(r'ws/chat/<room_name>/', ChatConsumer),
]
| 0 | 0 | 0 |
b4a62fa78d114a5fef3257984a2187a7f92a4b28 | 1,436 | py | Python | examples/fonteffects/sample05_shearedshadow.py | chromia/wandplus | 815127aeee85dbac3bc8fca35971d2153b1898a9 | [
"ImageMagick",
"MIT"
] | null | null | null | examples/fonteffects/sample05_shearedshadow.py | chromia/wandplus | 815127aeee85dbac3bc8fca35971d2153b1898a9 | [
"ImageMagick",
"MIT"
] | null | null | null | examples/fonteffects/sample05_shearedshadow.py | chromia/wandplus | 815127aeee85dbac3bc8fca35971d2153b1898a9 | [
"ImageMagick",
"MIT"
] | null | null | null | #!/usr/bin/env python
from wand.image import Image
from wand.drawing import Drawing
from wand.color import Color
import math
# http://www.imagemagick.org/Usage/fonts/
# original imagemagick command:
# convert -size 320x115 xc:lightblue -font Candice -pointsize 72 \
# -fill Navy -annotate 0x0+12+55 'An... | 33.395349 | 91 | 0.611421 | #!/usr/bin/env python
from wand.image import Image
from wand.drawing import Drawing
from wand.color import Color
import math
# http://www.imagemagick.org/Usage/fonts/
# original imagemagick command:
# convert -size 320x115 xc:lightblue -font Candice -pointsize 72 \
# -fill Navy -annotate 0x0+12+55 'An... | 0 | 0 | 0 |
6b538ea5a2d6c17e0ce87f91a574df111adba4be | 1,394 | py | Python | tests/zeus/utils/test_revisions.py | conrad-kronos/zeus | ddb6bc313e51fb22222b30822b82d76f37dbbd35 | [
"Apache-2.0"
] | 221 | 2017-07-03T17:29:21.000Z | 2021-12-07T19:56:59.000Z | tests/zeus/utils/test_revisions.py | conrad-kronos/zeus | ddb6bc313e51fb22222b30822b82d76f37dbbd35 | [
"Apache-2.0"
] | 298 | 2017-07-04T18:08:14.000Z | 2022-03-03T22:24:51.000Z | tests/zeus/utils/test_revisions.py | conrad-kronos/zeus | ddb6bc313e51fb22222b30822b82d76f37dbbd35 | [
"Apache-2.0"
] | 24 | 2017-07-15T13:46:45.000Z | 2020-08-16T16:14:45.000Z | import pytest
from zeus.exceptions import UnknownRevision
from zeus.utils.revisions import identify_revision
| 31.681818 | 87 | 0.643472 | import pytest
from zeus.exceptions import UnknownRevision
from zeus.utils.revisions import identify_revision
def test_identify_revision_database(default_repo, default_revision, mock_vcs_server):
result = identify_revision(default_repo, ref=default_revision.sha)
assert result == default_revision
def test_id... | 1,212 | 0 | 69 |
ed8188e0283065e5a9b4dfb109976da6b588a208 | 1,607 | py | Python | setup.py | thu2thu2/redstone | 5f3722cefb19ac336486018454d8bf813e8add0e | [
"Apache-2.0"
] | null | null | null | setup.py | thu2thu2/redstone | 5f3722cefb19ac336486018454d8bf813e8add0e | [
"Apache-2.0"
] | null | null | null | setup.py | thu2thu2/redstone | 5f3722cefb19ac336486018454d8bf813e8add0e | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Mathew Odden
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 33.479167 | 74 | 0.671437 | # Copyright 2021 Mathew Odden
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 0 | 0 | 0 |
7a95b2f8928109e0fca8d545ed19193b682ae4f4 | 1,606 | py | Python | writehtml.py | gmaterni/teimed2html | 6e273a502a30eaf2b975808660f93fc9fa87f326 | [
"MIT"
] | 1 | 2021-01-17T00:42:49.000Z | 2021-01-17T00:42:49.000Z | writehtml.py | gmaterni/teixml2html | 6e273a502a30eaf2b975808660f93fc9fa87f326 | [
"MIT"
] | null | null | null | writehtml.py | gmaterni/teixml2html | 6e273a502a30eaf2b975808660f93fc9fa87f326 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from pdb import set_trace
import sys
import argparse
import os
from teixml2lib.ualog import Log
import teixml2lib.file_utils as fut
__date__ = "'4-01-2021"
__version__ = "0.1.0"
__author__ = "Marta Materni"
logerr = Log("a")
if __name__ == "__main__":
logerr.open(... | 30.301887 | 71 | 0.466999 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from pdb import set_trace
import sys
import argparse
import os
from teixml2lib.ualog import Log
import teixml2lib.file_utils as fut
__date__ = "'4-01-2021"
__version__ = "0.1.0"
__author__ = "Marta Materni"
logerr = Log("a")
if __name__ == "__main__":
logerr.open(... | 0 | 0 | 0 |
33ac5961ad6572d51bc56be7d8bd09fd475c0e85 | 541 | py | Python | helpingnetwork/volunteer/models.py | neopentane/Techathon_19 | defaea24e55bdc4a26138a7a8c8813f5b12156f2 | [
"MIT"
] | null | null | null | helpingnetwork/volunteer/models.py | neopentane/Techathon_19 | defaea24e55bdc4a26138a7a8c8813f5b12156f2 | [
"MIT"
] | 22 | 2020-02-12T00:01:41.000Z | 2022-03-11T23:44:42.000Z | helpingnetwork/volunteer/models.py | neopentane/Techathon_19 | defaea24e55bdc4a26138a7a8c8813f5b12156f2 | [
"MIT"
] | 2 | 2019-04-03T18:01:54.000Z | 2019-04-04T03:57:55.000Z | from django.db import models
from django.contrib.auth.models import User
#hello this is priyaa
# Create your models here.
| 27.05 | 66 | 0.783734 | from django.db import models
from django.contrib.auth.models import User
#hello this is priyaa
# Create your models here.
class City(models.Model):
name=models.CharField(max_length=100)
def __str__(self):
return self.name
class Volunteer(models.Model):
user=models.OneToOneField(User,on_delete=models.CASCADE)
my_... | 47 | 322 | 44 |
4cccd4facf20028d9bf7d2fa78ee4b4d92dbcb78 | 4,036 | py | Python | timings/plot.py | bml1g12/benchmarking_video_reading_python | 6447f0a434fbde1e21781e1150b6f41062737759 | [
"MIT"
] | 19 | 2021-03-28T19:40:34.000Z | 2022-03-09T07:37:02.000Z | timings/plot.py | bml1g12/bechmarking_video_reading_python | 6447f0a434fbde1e21781e1150b6f41062737759 | [
"MIT"
] | 1 | 2022-01-02T20:05:52.000Z | 2022-01-05T20:08:18.000Z | timings/plot.py | bml1g12/bechmarking_video_reading_python | 6447f0a434fbde1e21781e1150b6f41062737759 | [
"MIT"
] | 3 | 2021-09-10T15:51:45.000Z | 2021-12-30T02:42:27.000Z | """Plots graphs of timings"""
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from matplotlib.lines import Line2D
def fps_plot(df, title):
"""plots graphs of timings"""
df = df[~df.groupname.str.contains("ffmpeg_unblocked_decoding_speed")]
df["groupname"] = df.groupname.str.spl... | 41.608247 | 101 | 0.645937 | """Plots graphs of timings"""
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from matplotlib.lines import Line2D
def fps_plot(df, title):
"""plots graphs of timings"""
df = df[~df.groupname.str.contains("ffmpeg_unblocked_decoding_speed")]
df["groupname"] = df.groupname.str.spl... | 194 | 0 | 23 |
18783b3d975baa8ad44a386df095f05645c38ceb | 672 | py | Python | isy994/items/devices/zwave/device_zwave_controller.py | BurntTech/ISY994v5 | 47d5c750367d36f2ae31435859d24cefcb617f06 | [
"MIT"
] | null | null | null | isy994/items/devices/zwave/device_zwave_controller.py | BurntTech/ISY994v5 | 47d5c750367d36f2ae31435859d24cefcb617f06 | [
"MIT"
] | null | null | null | isy994/items/devices/zwave/device_zwave_controller.py | BurntTech/ISY994v5 | 47d5c750367d36f2ae31435859d24cefcb617f06 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
from ..common.device_base import Device_Base
from .device_zwave_base import Device_ZWave_Base
paddle_events = {"DON", "DOF", "DIM", "BRT", "DFON", "DFOF"}
| 29.217391 | 80 | 0.705357 | #! /usr/bin/env python
from ..common.device_base import Device_Base
from .device_zwave_base import Device_ZWave_Base
paddle_events = {"DON", "DOF", "DIM", "BRT", "DFON", "DFOF"}
class Device_ZWave_Controller(Device_Base, Device_ZWave_Base):
def __init__(self, container, device_info):
Device_Base.__init... | 372 | 41 | 76 |
9925342de64029f3fac13e04c741c59e684cc1a8 | 947 | py | Python | database.py | Zanice/Flashcards-Project | ea5c457794a532f7a364ad8e6a98419df3bbf1bf | [
"MIT"
] | null | null | null | database.py | Zanice/Flashcards-Project | ea5c457794a532f7a364ad8e6a98419df3bbf1bf | [
"MIT"
] | null | null | null | database.py | Zanice/Flashcards-Project | ea5c457794a532f7a364ad8e6a98419df3bbf1bf | [
"MIT"
] | null | null | null | # native imports
# project imports
# external imports
import sqlalchemy
import sqlalchemy.ext.declarative
Base = sqlalchemy.ext.declarative.declarative_base()
Session = sqlalchemy.orm.scoped_session(sqlalchemy.orm.sessionmaker())
| 32.655172 | 82 | 0.810982 | # native imports
# project imports
# external imports
import sqlalchemy
import sqlalchemy.ext.declarative
Base = sqlalchemy.ext.declarative.declarative_base()
Session = sqlalchemy.orm.scoped_session(sqlalchemy.orm.sessionmaker())
def init_db(username, password, database):
connection_url = sqlalchemy.engine.url.mak... | 340 | 327 | 46 |
7fed79f013fe5d4b9895a03d5104f0513bbec085 | 575 | py | Python | SimplE/main.py | dertilo/knowledge-graph-reasoning | e36d57ee34aa2b532f4dfa98a1e1d222037337cc | [
"MIT"
] | null | null | null | SimplE/main.py | dertilo/knowledge-graph-reasoning | e36d57ee34aa2b532f4dfa98a1e1d222037337cc | [
"MIT"
] | null | null | null | SimplE/main.py | dertilo/knowledge-graph-reasoning | e36d57ee34aa2b532f4dfa98a1e1d222037337cc | [
"MIT"
] | null | null | null | from trainer import Trainer
from tester import Tester
from dataset import Dataset, Params
if __name__ == "__main__":
args = Params()
dataset = Dataset(args.dataset)
#
print("~~~~ Training ~~~~")
trainer = Trainer(dataset, args)
trainer.train()
print("~~~~ Select best epoch on validation se... | 26.136364 | 64 | 0.655652 | from trainer import Trainer
from tester import Tester
from dataset import Dataset, Params
if __name__ == "__main__":
args = Params()
dataset = Dataset(args.dataset)
#
print("~~~~ Training ~~~~")
trainer = Trainer(dataset, args)
trainer.train()
print("~~~~ Select best epoch on validation se... | 0 | 0 | 0 |
8a8b40e8bde95c87541e533631eb83cd809c2077 | 7,386 | py | Python | citylearn.py | pkj415/CityLearn | 912d1e28270fba2d11a713dc7f0445d59d620511 | [
"MIT"
] | null | null | null | citylearn.py | pkj415/CityLearn | 912d1e28270fba2d11a713dc7f0445d59d620511 | [
"MIT"
] | null | null | null | citylearn.py | pkj415/CityLearn | 912d1e28270fba2d11a713dc7f0445d59d620511 | [
"MIT"
] | null | null | null | import gym
from gym.utils import seeding
import numpy as np
import pandas as pd
| 46.1625 | 205 | 0.644733 | import gym
from gym.utils import seeding
import numpy as np
import pandas as pd
class CityLearn(gym.Env):
def __init__(self, demand_file, weather_file, buildings = None, time_resolution = 1, simulation_period = (3500,6000)):
self.action_track = {}
self.buildings = buildings
for building i... | 6,953 | 4 | 349 |
0f04702e198d35c03b1c07014214ccd509c9428d | 534 | py | Python | process/subreddit/subreddit.py | koders-in/kourage | 65e683bd6127666020eb5c9265b8e1cce9df93bb | [
"MIT"
] | 7 | 2020-11-28T19:01:17.000Z | 2021-06-07T17:14:01.000Z | process/subreddit/subreddit.py | koders-in/kourage | 65e683bd6127666020eb5c9265b8e1cce9df93bb | [
"MIT"
] | 22 | 2020-11-28T02:45:57.000Z | 2022-03-12T01:04:19.000Z | process/subreddit/subreddit.py | koders-in/kourage | 65e683bd6127666020eb5c9265b8e1cce9df93bb | [
"MIT"
] | 20 | 2021-02-16T05:59:51.000Z | 2021-08-19T08:06:17.000Z | import os
from helper.reddit import RedditConfig
import random
import json
| 26.7 | 73 | 0.734082 | import os
from helper.reddit import RedditConfig
import random
import json
def fetch_meme_url():
reddit = RedditConfig().initialize()
meme_channels = json.loads(os.environ.get('MEME_CHANNELS'))
meme_channel = random.choice(meme_channels)
memes_submissions = reddit.subreddit(meme_channel).hot()
p... | 435 | 0 | 23 |
ff73f7bb1a8876967e5ed028d6dda998826de55e | 5,476 | py | Python | src/backend/socialapp/tests/REST.py | shouyang/group-CMPUT404-project | a8d114b493ad2786c90e8b1f10c087fa4d5c81de | [
"MIT"
] | 2 | 2019-02-04T17:55:48.000Z | 2019-03-11T23:22:14.000Z | src/backend/socialapp/tests/REST.py | shouyang/group-CMPUT404-project | a8d114b493ad2786c90e8b1f10c087fa4d5c81de | [
"MIT"
] | 7 | 2019-02-27T17:16:19.000Z | 2019-03-19T20:13:56.000Z | src/backend/socialapp/tests/REST.py | shouyang/group-CMPUT404-project | a8d114b493ad2786c90e8b1f10c087fa4d5c81de | [
"MIT"
] | 2 | 2019-04-10T17:01:07.000Z | 2019-04-17T01:08:16.000Z | from django.test import TestCase
from django.contrib.auth import get_user_model
from socialapp import models
from rest_framework.test import APIClient
from socialapp import urls
class TestREST(TestCase):
@classmethod
"""
def testGetAuthorRemoveFriend(self):
client = APIClient()
temp1 = s... | 34.012422 | 124 | 0.606465 | from django.test import TestCase
from django.contrib.auth import get_user_model
from socialapp import models
from rest_framework.test import APIClient
from socialapp import urls
class TestREST(TestCase):
@classmethod
def setUpTestData(cls):
User = get_user_model()
cls.user1 = User.objects.cre... | 2,813 | 0 | 245 |
9d3cfdf8742ef81d8c79c44fd152a9fbfc29c41c | 3,967 | py | Python | yowsup/layers/auth/layer_authentication.py | rihbyne/yowsup | 06581618fdba54aa51041624e19d5dce64b054ef | [
"MIT"
] | 1 | 2019-12-16T11:00:06.000Z | 2019-12-16T11:00:06.000Z | yowsup/layers/auth/layer_authentication.py | pasinit/yowsup | 894007650bf3d75ef7af4a0e57e84dc7cccc4dfe | [
"MIT"
] | null | null | null | yowsup/layers/auth/layer_authentication.py | pasinit/yowsup | 894007650bf3d75ef7af4a0e57e84dc7cccc4dfe | [
"MIT"
] | 3 | 2017-08-18T21:24:46.000Z | 2018-09-07T21:07:39.000Z | from yowsup.layers import YowLayer, YowLayerEvent, YowProtocolLayer
from .keystream import KeyStream
from yowsup.common.tools import TimeTools
from .layer_crypt import YowCryptLayer
from yowsup.layers.network import YowNetworkLayer
from .autherror import AuthError
from .protocolentities import *
import base64
| 35.738739 | 117 | 0.692463 | from yowsup.layers import YowLayer, YowLayerEvent, YowProtocolLayer
from .keystream import KeyStream
from yowsup.common.tools import TimeTools
from .layer_crypt import YowCryptLayer
from yowsup.layers.network import YowNetworkLayer
from .autherror import AuthError
from .protocolentities import *
import base64
class Yow... | 2,994 | 638 | 22 |
6508dc62493f24decad7a75cf87c2ff3c2c78fc7 | 43 | py | Python | gym_aima/envs/__init__.py | wegfawefgawefg/gym-aima | 79efa263f90bee9a8c18140a8320d5d98245c665 | [
"MIT"
] | 5 | 2020-03-08T04:58:25.000Z | 2022-01-28T13:19:50.000Z | gym_aima/envs/__init__.py | wegfawefgawefg/gym-aima | 79efa263f90bee9a8c18140a8320d5d98245c665 | [
"MIT"
] | null | null | null | gym_aima/envs/__init__.py | wegfawefgawefg/gym-aima | 79efa263f90bee9a8c18140a8320d5d98245c665 | [
"MIT"
] | 4 | 2020-04-11T14:02:21.000Z | 2022-03-27T15:38:17.000Z | from gym_aima.envs.aima_env import AIMAEnv
| 21.5 | 42 | 0.860465 | from gym_aima.envs.aima_env import AIMAEnv
| 0 | 0 | 0 |
80b5ae0ecb12a7c8f4a3c1c86f5197e223dbb87f | 12,384 | py | Python | actin/actin.py | j-faria/ACTIN | f16d597472ccabb7627753179032e18ae21e83a2 | [
"MIT"
] | null | null | null | actin/actin.py | j-faria/ACTIN | f16d597472ccabb7627753179032e18ae21e83a2 | [
"MIT"
] | null | null | null | actin/actin.py | j-faria/ACTIN | f16d597472ccabb7627753179032e18ae21e83a2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# compatibility with python 2/3:
from __future__ import print_function
from __future__ import division
import sys, os
import glob
import time
import datetime
import numpy as np
import astropy.io.fits as pyfits
import argparse
import pkg_resources
import appdirs
# Directory of this file
path =... | 35.791908 | 251 | 0.621286 | #!/usr/bin/env python
# compatibility with python 2/3:
from __future__ import print_function
from __future__ import division
import sys, os
import glob
import time
import datetime
import numpy as np
import astropy.io.fits as pyfits
import argparse
import pkg_resources
import appdirs
# Directory of this file
path =... | 0 | 0 | 0 |
072168f662e41ab278d8f3557efd63418a24e18b | 6,647 | py | Python | devito/ir/equations/algorithms.py | kenhester/devito | 4d60cfca76b90daaaca71a1407e7311ad238ddd5 | [
"MIT"
] | 204 | 2020-01-09T11:27:58.000Z | 2022-03-20T22:53:37.000Z | devito/ir/equations/algorithms.py | kenhester/devito | 4d60cfca76b90daaaca71a1407e7311ad238ddd5 | [
"MIT"
] | 835 | 2019-12-30T08:12:25.000Z | 2022-03-29T04:52:55.000Z | devito/ir/equations/algorithms.py | kenhester/devito | 4d60cfca76b90daaaca71a1407e7311ad238ddd5 | [
"MIT"
] | 131 | 2020-01-08T17:43:13.000Z | 2022-03-27T11:36:47.000Z | from collections.abc import Iterable
from operator import attrgetter
from sympy import sympify
from devito.symbolics import (retrieve_functions, retrieve_indexed, split_affine,
uxreplace)
from devito.tools import PartialOrderTuple, filter_sorted, flatten, as_tuple
from devito.types impor... | 39.1 | 87 | 0.608094 | from collections.abc import Iterable
from operator import attrgetter
from sympy import sympify
from devito.symbolics import (retrieve_functions, retrieve_indexed, split_affine,
uxreplace)
from devito.tools import PartialOrderTuple, filter_sorted, flatten, as_tuple
from devito.types impor... | 839 | 0 | 27 |
e57a0cfa01980be52ea2a6d6cca342f80711bdd6 | 118 | py | Python | ObjectDetection/importPaths.py | eMSiBi/LeraBots | 50cd0241ec1f8eb2fc2eb47fb56fac8ba056e054 | [
"BSD-4-Clause"
] | null | null | null | ObjectDetection/importPaths.py | eMSiBi/LeraBots | 50cd0241ec1f8eb2fc2eb47fb56fac8ba056e054 | [
"BSD-4-Clause"
] | null | null | null | ObjectDetection/importPaths.py | eMSiBi/LeraBots | 50cd0241ec1f8eb2fc2eb47fb56fac8ba056e054 | [
"BSD-4-Clause"
] | null | null | null | # https://docs.python.org/3/tutorial/modules.html#standard-modules
import sys
sys.path.append("../ImageManupilation")
| 29.5 | 66 | 0.779661 | # https://docs.python.org/3/tutorial/modules.html#standard-modules
import sys
sys.path.append("../ImageManupilation")
| 0 | 0 | 0 |
e0c9d608de91d5242c7f7c6dda4bd36d286585d7 | 12,260 | py | Python | dev/Tools/build/waf-1.7.13/waflib/Tools/tex.py | brianherrera/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | [
"AML"
] | 1,738 | 2017-09-21T10:59:12.000Z | 2022-03-31T21:05:46.000Z | dev/Tools/build/waf-1.7.13/waflib/Tools/tex.py | olivier-be/lumberyard | 3d688932f919dbf5821f0cb8a210ce24abe39e9e | [
"AML"
] | 427 | 2017-09-29T22:54:36.000Z | 2022-02-15T19:26:50.000Z | dev/Tools/build/waf-1.7.13/waflib/Tools/tex.py | olivier-be/lumberyard | 3d688932f919dbf5821f0cb8a210ce24abe39e9e | [
"AML"
] | 671 | 2017-09-21T08:04:01.000Z | 2022-03-29T14:30:07.000Z | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006-2010 (ita)
"""
TeX/LaTeX/PDFLaTeX/XeLaTeX support
Example::
def configure(conf):
conf.load('tex')
if not conf.env.LATEX:
conf.fatal('The program LaTex is required')
def build(bld):
bld(
features = 'tex',
type = 'latex', # pdflatex or x... | 28.37963 | 158 | 0.659135 | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006-2010 (ita)
"""
TeX/LaTeX/PDFLaTeX/XeLaTeX support
Example::
def configure(conf):
conf.load('tex')
if not conf.env.LATEX:
conf.fatal('The program LaTex is required')
def build(bld):
bld(
features = 'tex',
type = 'latex', # pdflatex or x... | 1,005 | 604 | 186 |
a330e647e287874cf96765db50d5198e6c97ec4b | 863 | py | Python | migrations/0001_initial.py | redditnfl/draft-cards | 63779107a731ad741c8cf02b98a4b3d74cdcc3ac | [
"Apache-2.0",
"0BSD"
] | null | null | null | migrations/0001_initial.py | redditnfl/draft-cards | 63779107a731ad741c8cf02b98a4b3d74cdcc3ac | [
"Apache-2.0",
"0BSD"
] | 10 | 2020-06-05T20:27:08.000Z | 2022-02-10T10:47:58.000Z | migrations/0001_initial.py | redditnfl/draft-cards | 63779107a731ad741c8cf02b98a4b3d74cdcc3ac | [
"Apache-2.0",
"0BSD"
] | 1 | 2021-06-06T01:11:32.000Z | 2021-06-06T01:11:32.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-25 21:34
from __future__ import unicode_literals
from django.db import migrations, models
| 31.962963 | 199 | 0.568946 | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-25 21:34
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Player',... | 0 | 686 | 23 |
b411b79557c7c7bdd88f52280dcd9b14b3d35b8d | 2,945 | py | Python | treecode/telemetry.py | Dvakote/LSS-sim | c1e43222f82bf1d6751b906b264f93b050abebb4 | [
"MIT"
] | null | null | null | treecode/telemetry.py | Dvakote/LSS-sim | c1e43222f82bf1d6751b906b264f93b050abebb4 | [
"MIT"
] | null | null | null | treecode/telemetry.py | Dvakote/LSS-sim | c1e43222f82bf1d6751b906b264f93b050abebb4 | [
"MIT"
] | 1 | 2018-05-22T08:19:33.000Z | 2018-05-22T08:19:33.000Z | # -*- coding: utf-8 -*-
import numpy as np
import treecode.energy_and_momentum as EM
| 37.278481 | 77 | 0.650594 | # -*- coding: utf-8 -*-
import numpy as np
import treecode.energy_and_momentum as EM
def is_gravity_field_weak(particles, C_2):
# Функция, выдающая ошибку, если гравитационное поле становится
# слишком сильным для применения используемой модели
ERROR_NAME = ''
# Считаем величину phi / c^2, ... | 3,589 | 0 | 75 |
2f50591ead8cefee497b16687fd3de622854c324 | 1,407 | py | Python | run.py | hoshinohikari/stereo-target-detection-and-ranging | 7bdd7be7da999466d2cb2ff58303a2dcf3c76b8d | [
"MIT"
] | null | null | null | run.py | hoshinohikari/stereo-target-detection-and-ranging | 7bdd7be7da999466d2cb2ff58303a2dcf3c76b8d | [
"MIT"
] | null | null | null | run.py | hoshinohikari/stereo-target-detection-and-ranging | 7bdd7be7da999466d2cb2ff58303a2dcf3c76b8d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import argparse
from yolo import YOLO
from cache import detect_cam ,detect_video
FLAGS = None
if __name__ == '__main__':
parser = argparse.ArgumentParser(argument_default=argparse.SUPPRESS)
'''
Command line options
'''
parser.add_argument(
"--camera", nargs='?', type=int, requir... | 28.14 | 95 | 0.665956 | # -*- coding: utf-8 -*-
import argparse
from yolo import YOLO
from cache import detect_cam ,detect_video
FLAGS = None
if __name__ == '__main__':
parser = argparse.ArgumentParser(argument_default=argparse.SUPPRESS)
'''
Command line options
'''
parser.add_argument(
"--camera", nargs='?', type=int, requir... | 0 | 0 | 0 |
c5e5b88e1ce1523a785665937a25b4744cedc2da | 199 | py | Python | tp/ui/__init__.py | chinapnr/agbot | 9739ce1c2198e50111629db2d1de785edd06876e | [
"MIT"
] | 2 | 2018-06-23T06:48:46.000Z | 2018-06-23T10:11:50.000Z | tp/ui/__init__.py | chinapnr/agbot | 9739ce1c2198e50111629db2d1de785edd06876e | [
"MIT"
] | 5 | 2020-01-03T09:33:02.000Z | 2021-06-02T00:49:52.000Z | tp/ui/__init__.py | chinapnr/agbot | 9739ce1c2198e50111629db2d1de785edd06876e | [
"MIT"
] | 1 | 2021-07-07T07:17:27.000Z | 2021-07-07T07:17:27.000Z | from agbot.core.model.context import VerticalContext
from .tp_ui import UiTestPoint
| 28.428571 | 57 | 0.834171 | from agbot.core.model.context import VerticalContext
from .tp_ui import UiTestPoint
def run(tp_conf_dict, vertical_context: VerticalContext):
return UiTestPoint(tp_conf_dict, vertical_context)
| 91 | 0 | 23 |
bfada3b7a4b39829017c4beaa8920cd0ff89c9d0 | 722 | py | Python | pycture/constants.py | joaopalmeiro/pycture | 408de3cda5773f6c1808f92f44658c3fe0d5c6e5 | [
"MIT"
] | 1 | 2021-04-30T14:49:23.000Z | 2021-04-30T14:49:23.000Z | pycture/constants.py | joaopalmeiro/pycture | 408de3cda5773f6c1808f92f44658c3fe0d5c6e5 | [
"MIT"
] | 7 | 2021-04-30T17:11:08.000Z | 2022-01-06T14:22:16.000Z | pycture/constants.py | joaopalmeiro/pycture | 408de3cda5773f6c1808f92f44658c3fe0d5c6e5 | [
"MIT"
] | null | null | null | from typing import Callable, Dict, List
# CLI
OUTPUT_DIR_HELP: str = "The path to the output directory."
PRETTY_HELP: str = "Pretty-print the SVG code."
SOURCE_HELP: str = "The source of the emoji to obtain."
SOURCES: List[str] = ["Twemoji", "OpenMoji"]
# URLs
TWEMOJI_URL: str = (
"https://raw.githubusercontent.... | 27.769231 | 87 | 0.691136 | from typing import Callable, Dict, List
# CLI
OUTPUT_DIR_HELP: str = "The path to the output directory."
PRETTY_HELP: str = "Pretty-print the SVG code."
SOURCE_HELP: str = "The source of the emoji to obtain."
SOURCES: List[str] = ["Twemoji", "OpenMoji"]
# URLs
TWEMOJI_URL: str = (
"https://raw.githubusercontent.... | 0 | 0 | 0 |
2d924bd43b11a497c1e53e3d109d145b3f7e2648 | 8,976 | py | Python | agents/common.py | Frana-0/minerl-treechop | 3b862bd91a0e194302f9c541b1f46ed4d70834f5 | [
"MIT"
] | null | null | null | agents/common.py | Frana-0/minerl-treechop | 3b862bd91a0e194302f9c541b1f46ed4d70834f5 | [
"MIT"
] | null | null | null | agents/common.py | Frana-0/minerl-treechop | 3b862bd91a0e194302f9c541b1f46ed4d70834f5 | [
"MIT"
] | null | null | null | from typing import Union, List, Tuple
import math
from abc import ABC, abstractmethod
import numpy as np
import torch
from torch import nn
from torch.nn import functional as F
from utils.gen_args import Arguments
from memory.common import ReplayBufferAbstract
from agents.resnet_head import IMPALAResnet
| 37.714286 | 109 | 0.668895 | from typing import Union, List, Tuple
import math
from abc import ABC, abstractmethod
import numpy as np
import torch
from torch import nn
from torch.nn import functional as F
from utils.gen_args import Arguments
from memory.common import ReplayBufferAbstract
from agents.resnet_head import IMPALAResnet
class NoisyL... | 7,816 | 158 | 684 |
3644df109aa6864369da59cd9c4baa3e482a3f56 | 62 | py | Python | ytmdl/__version__.py | philodavies/ytmdl | 7ba7f2e38e4602b73aca5cbaddcf4de4badce07e | [
"MIT"
] | 2,495 | 2018-06-20T07:17:15.000Z | 2022-03-31T18:50:44.000Z | ytmdl/__version__.py | philodavies/ytmdl | 7ba7f2e38e4602b73aca5cbaddcf4de4badce07e | [
"MIT"
] | 204 | 2018-07-10T13:48:59.000Z | 2022-03-21T22:04:33.000Z | ytmdl/__version__.py | philodavies/ytmdl | 7ba7f2e38e4602b73aca5cbaddcf4de4badce07e | [
"MIT"
] | 175 | 2018-06-20T07:17:54.000Z | 2022-03-26T00:17:58.000Z | # Store the version of the package
__version__ = "2021.08.01"
| 20.666667 | 34 | 0.741935 | # Store the version of the package
__version__ = "2021.08.01"
| 0 | 0 | 0 |
8c64684af6441ce6479eb4599d84489030382d45 | 3,854 | py | Python | utils/database_tester.py | ax-rwnd/E-dot | b1b64fcce43c5d6f54dc38959498cdba95e757b1 | [
"BSD-3-Clause"
] | null | null | null | utils/database_tester.py | ax-rwnd/E-dot | b1b64fcce43c5d6f54dc38959498cdba95e757b1 | [
"BSD-3-Clause"
] | 1 | 2015-12-05T02:04:35.000Z | 2015-12-11T02:47:28.000Z | utils/database_tester.py | ax-rwnd/E-dot | b1b64fcce43c5d6f54dc38959498cdba95e757b1 | [
"BSD-3-Clause"
] | null | null | null | DATABASE = 'db_edot'
# mysql
HOST = 'localhost'
PORT = 3306
USER = 'root'
PASSWD = ''
SQLDB = 'db_edot'
from flask import Flask, render_template, request, g
app = Flask(__name__)
# DB support
import MySQLdb
# returns a database connection for MySQL
# set this line to define database connection
DBFUNC = connect_to_d... | 37.057692 | 303 | 0.669694 | DATABASE = 'db_edot'
# mysql
HOST = 'localhost'
PORT = 3306
USER = 'root'
PASSWD = ''
SQLDB = 'db_edot'
from flask import Flask, render_template, request, g
app = Flask(__name__)
# DB support
import MySQLdb
# returns a database connection for MySQL
def connect_to_database_mysql(database=None):
if database:
... | 1,331 | 0 | 98 |
f1d7041877ea2e8ed70c2dea2746ce74d5e4cdaa | 364 | py | Python | plugins/_template/admin.py | adlerosn/corpusslayer | d3dea2e2d15e911d048a39f6ef6cb2d5f7b33e58 | [
"MIT"
] | null | null | null | plugins/_template/admin.py | adlerosn/corpusslayer | d3dea2e2d15e911d048a39f6ef6cb2d5f7b33e58 | [
"MIT"
] | 1 | 2019-07-06T20:43:45.000Z | 2019-07-06T20:43:45.000Z | plugins/unitexgramlab/admin.py | adlerosn/corpusslayer | d3dea2e2d15e911d048a39f6ef6cb2d5f7b33e58 | [
"MIT"
] | null | null | null | import os
pluginName = os.path.abspath(__file__).split(os.path.sep)[-2]
importline = 'import '+('.'.join(['plugins',pluginName,'models'])+' as models')
exec(importline) #import plugins.thisplugin.models as models
from corpusslayer.adminModelRegister import registerForMe
from django.contrib import admin
# Register your... | 33.090909 | 79 | 0.777473 | import os
pluginName = os.path.abspath(__file__).split(os.path.sep)[-2]
importline = 'import '+('.'.join(['plugins',pluginName,'models'])+' as models')
exec(importline) #import plugins.thisplugin.models as models
from corpusslayer.adminModelRegister import registerForMe
from django.contrib import admin
# Register your... | 0 | 0 | 0 |
a74e9a74a8de6e000dccedacec1d6592c951e8b2 | 2,176 | py | Python | checkio/Scientific Expedition/Seven Segment/test_seven_segment.py | KenMercusLai/checkio | c7702221e1bc0b0b30425859ffa6c09722949d65 | [
"MIT"
] | 39 | 2015-02-09T13:24:12.000Z | 2019-05-16T17:51:19.000Z | checkio/Scientific Expedition/Seven Segment/test_seven_segment.py | KenMercusLai/checkio | c7702221e1bc0b0b30425859ffa6c09722949d65 | [
"MIT"
] | 1 | 2019-10-21T16:18:14.000Z | 2019-10-21T16:18:14.000Z | checkio/Scientific Expedition/Seven Segment/test_seven_segment.py | KenMercusLai/checkio | c7702221e1bc0b0b30425859ffa6c09722949d65 | [
"MIT"
] | 22 | 2015-01-30T18:00:05.000Z | 2021-05-22T02:57:23.000Z | import unittest
from seven_segment import possible_numbers, seven_segment
# class Tests(unittest.TestCase):
# TESTS = {
# "Basics": [
# {
# "input": [['B', 'C', 'b', 'c'],
# ['A']],
# "answer": 2,
# },
# {
# ... | 32 | 94 | 0.318015 | import unittest
from seven_segment import possible_numbers, seven_segment
def test_possible_numbers():
first_digit = ['A', 'B', 'C', 'D', 'E', 'F', 'G']
second_digit = ['a', 'b', 'c', 'd', 'e', 'f', 'g']
assert possible_numbers({'B', 'C', 'b', 'c'}, {'A'}, first_digit) == [1, 7]
assert possible_numbe... | 527 | 0 | 23 |
992c227f02553d386028502f3a575c857d25a1ac | 1,494 | py | Python | query/draw.py | TheLurkingCat/Database-term-project | c9fb99151c70fb5c3547051df7b4e478e2681bc7 | [
"MIT"
] | null | null | null | query/draw.py | TheLurkingCat/Database-term-project | c9fb99151c70fb5c3547051df7b4e478e2681bc7 | [
"MIT"
] | null | null | null | query/draw.py | TheLurkingCat/Database-term-project | c9fb99151c70fb5c3547051df7b4e478e2681bc7 | [
"MIT"
] | null | null | null | from datetime import date
from enum import Enum
from typing import List, Tuple
import matplotlib.pyplot as plt
import numpy as np
from dateutil.relativedelta import relativedelta
from . import query
| 30.489796 | 151 | 0.638554 | from datetime import date
from enum import Enum
from typing import List, Tuple
import matplotlib.pyplot as plt
import numpy as np
from dateutil.relativedelta import relativedelta
from . import query
def get_data(start: date, end: date, isglobal: bool, qtype: Enum, use_month: bool, place=None) -> Tuple[List[float]]:... | 1,245 | 0 | 46 |
60eb4c2205f9969008f6b282fbddedb495463094 | 559 | py | Python | docs/tutorial/curves_and_surfaces/curve_from_line.py | Sam-Bouten/compas | 011c7779ded9b69bb602568b470bb0443e336f62 | [
"MIT"
] | null | null | null | docs/tutorial/curves_and_surfaces/curve_from_line.py | Sam-Bouten/compas | 011c7779ded9b69bb602568b470bb0443e336f62 | [
"MIT"
] | null | null | null | docs/tutorial/curves_and_surfaces/curve_from_line.py | Sam-Bouten/compas | 011c7779ded9b69bb602568b470bb0443e336f62 | [
"MIT"
] | null | null | null | from compas.geometry import Point
from compas.geometry import Line
from compas.geometry import NurbsCurve
from compas.artists import Artist
from compas.colors import Color
line = Line(Point(0, 0, 0), Point(3, 3, 0))
curve = NurbsCurve.from_line(line)
# ================================================================... | 24.304348 | 80 | 0.538462 | from compas.geometry import Point
from compas.geometry import Line
from compas.geometry import NurbsCurve
from compas.artists import Artist
from compas.colors import Color
line = Line(Point(0, 0, 0), Point(3, 3, 0))
curve = NurbsCurve.from_line(line)
# ================================================================... | 0 | 0 | 0 |
f9903ecf48f6f358c06e87554cc8ee21241c5f64 | 146 | py | Python | parinx/errors.py | rahulrrixe/parinx | 6493798ceba8089345d970f71be4a896eb6b081d | [
"Apache-2.0"
] | 8 | 2015-04-10T10:13:12.000Z | 2018-07-14T18:01:22.000Z | parinx/errors.py | coyo8/parinx | 6493798ceba8089345d970f71be4a896eb6b081d | [
"Apache-2.0"
] | 7 | 2015-08-29T18:34:44.000Z | 2018-05-10T18:55:56.000Z | parinx/errors.py | rahulrrixe/parinx | 6493798ceba8089345d970f71be4a896eb6b081d | [
"Apache-2.0"
] | 13 | 2015-04-10T10:31:08.000Z | 2018-07-30T06:49:46.000Z | # -*- coding:utf-8 -*-
try:
import simplejson as json
except ImportError:
import json
| 14.6 | 40 | 0.69863 | # -*- coding:utf-8 -*-
try:
import simplejson as json
except ImportError:
import json
class MethodParsingException(Exception):
pass
| 0 | 28 | 23 |
2230036f34e6a4796565d09f05f6e7cc52515d80 | 318 | py | Python | opentech/apply/activity/tests/test_models.py | JakabGy/hypha | 32634080ba1cb369f07f27f6616041e4eca8dbf2 | [
"BSD-3-Clause"
] | null | null | null | opentech/apply/activity/tests/test_models.py | JakabGy/hypha | 32634080ba1cb369f07f27f6616041e4eca8dbf2 | [
"BSD-3-Clause"
] | null | null | null | opentech/apply/activity/tests/test_models.py | JakabGy/hypha | 32634080ba1cb369f07f27f6616041e4eca8dbf2 | [
"BSD-3-Clause"
] | null | null | null | from django.test import TestCase
from .factories import CommentFactory
from ..models import Activity
| 26.5 | 54 | 0.767296 | from django.test import TestCase
from .factories import CommentFactory
from ..models import Activity
class TestActivityOnlyIncludesCurrent(TestCase):
def test_doesnt_include_non_current(self):
CommentFactory()
CommentFactory(current=False)
self.assertEqual(Activity.comments.count(), 1)
| 139 | 27 | 49 |
e9d95111913e6f09119904ef1e1a8752c93866d6 | 2,881 | py | Python | tests/extension/thread_/ram_rtl/thread_ram_rtl.py | akmaru/veriloggen | 74f998139e8cf613f7703fa4cffd571bbf069bbc | [
"Apache-2.0"
] | null | null | null | tests/extension/thread_/ram_rtl/thread_ram_rtl.py | akmaru/veriloggen | 74f998139e8cf613f7703fa4cffd571bbf069bbc | [
"Apache-2.0"
] | null | null | null | tests/extension/thread_/ram_rtl/thread_ram_rtl.py | akmaru/veriloggen | 74f998139e8cf613f7703fa4cffd571bbf069bbc | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import print_function
import sys
import os
# the next line can be removed after installation
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))))
from veriloggen import *
import ve... | 22.685039 | 69 | 0.600139 | from __future__ import absolute_import
from __future__ import print_function
import sys
import os
# the next line can be removed after installation
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))))
from veriloggen import *
import ve... | 2,304 | 0 | 46 |
f33ca650165f32138a6621797c89f7f562536ba6 | 8,084 | py | Python | multi_classification.py | facebookresearch/mpcfp | cb29797aa4f2ce524dd584ecf47c863fd9f414a6 | [
"MIT"
] | 5 | 2020-11-18T23:55:17.000Z | 2022-01-14T07:15:35.000Z | multi_classification.py | facebookresearch/mpcfp | cb29797aa4f2ce524dd584ecf47c863fd9f414a6 | [
"MIT"
] | null | null | null | multi_classification.py | facebookresearch/mpcfp | cb29797aa4f2ce524dd584ecf47c863fd9f414a6 | [
"MIT"
] | 2 | 2021-11-06T14:06:13.000Z | 2022-01-14T07:16:29.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import logging
import os
import time
import torch
import numpy as np
from shared import SharedTensor
... | 36.414414 | 79 | 0.584117 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import logging
import os
import time
import torch
import numpy as np
from shared import SharedTensor
... | 6,307 | 0 | 69 |
9cc80b7f123e331cc2a308a3863cef6b0c5ec77d | 4,097 | py | Python | calamari_ocr/ocr/text_processing/text_synchronizer.py | Nesbi/calamari | 25eb872118d15d0740f702ef42ef6f785e1a5858 | [
"Apache-2.0"
] | 5 | 2021-02-12T16:22:46.000Z | 2021-03-08T13:04:15.000Z | calamari_ocr/ocr/text_processing/text_synchronizer.py | Nesbi/calamari | 25eb872118d15d0740f702ef42ef6f785e1a5858 | [
"Apache-2.0"
] | 1 | 2020-05-06T15:03:17.000Z | 2020-05-07T15:22:01.000Z | calamari_ocr/ocr/text_processing/text_synchronizer.py | Nesbi/calamari | 25eb872118d15d0740f702ef42ef6f785e1a5858 | [
"Apache-2.0"
] | null | null | null | import numpy as np
if __name__ == "__main__":
synclist = synchronize(["AbcdEfG", "cdEFG"])
print([s.get_text() for s in synclist])
| 28.65035 | 104 | 0.51257 | import numpy as np
class Sync:
def __init__(self, texts, substr=None, match=None):
self.texts = texts
if substr:
assert(substr.shape[0] == len(self.texts))
self.substr = substr
else:
self.substr = np.zeros((len(texts), 3), dtype=int)
self.match... | 3,595 | -10 | 369 |
8f227b81ea11fb48fca3308db245e1fd002d3e63 | 4,466 | py | Python | src/bones-core/bones/tests/test_fits.py | DangerMouseB/coppertop | 26e9b01034b29fa8ec0e41bf1fa2b81c7c7bb34d | [
"BSD-3-Clause"
] | null | null | null | src/bones-core/bones/tests/test_fits.py | DangerMouseB/coppertop | 26e9b01034b29fa8ec0e41bf1fa2b81c7c7bb34d | [
"BSD-3-Clause"
] | null | null | null | src/bones-core/bones/tests/test_fits.py | DangerMouseB/coppertop | 26e9b01034b29fa8ec0e41bf1fa2b81c7c7bb34d | [
"BSD-3-Clause"
] | null | null | null | # *******************************************************************************
#
# Copyright (c) 2019-2021 David Briant. All rights reserved.
#
# *******************************************************************************
from coppertop.pipe import *
from coppertop.core import Missing
from coppertop.std imp... | 32.129496 | 95 | 0.572324 | # *******************************************************************************
#
# Copyright (c) 2019-2021 David Briant. All rights reserved.
#
# *******************************************************************************
from coppertop.pipe import *
from coppertop.core import Missing
from coppertop.std imp... | 3,615 | 0 | 137 |
dcc5be5722f0d8300f130394f59f56a4040133a6 | 3,593 | py | Python | trend_analyze/src/fetch_data.py | popper2710/Trend_Analyze | 0c98bcd7986bdb2d2b9bdc8022bfa08ddf0e7b0f | [
"MIT"
] | null | null | null | trend_analyze/src/fetch_data.py | popper2710/Trend_Analyze | 0c98bcd7986bdb2d2b9bdc8022bfa08ddf0e7b0f | [
"MIT"
] | 2 | 2020-09-26T14:58:33.000Z | 2021-03-31T20:01:40.000Z | trend_analyze/src/fetch_data.py | popper2710/Trend_Analyze | 0c98bcd7986bdb2d2b9bdc8022bfa08ddf0e7b0f | [
"MIT"
] | null | null | null | import logging
import logging.config
import datetime
import GetOldTweets3 as Got
from typing import List
from trend_analyze.src.convert_to_model import ConvertTM
from trend_analyze.src.scraping_tweet import TwitterScraper
from trend_analyze.config import *
from trend_analyze.src.model import *
class TwitterFetcher:... | 33.896226 | 116 | 0.597829 | import logging
import logging.config
import datetime
import GetOldTweets3 as Got
from typing import List
from trend_analyze.src.convert_to_model import ConvertTM
from trend_analyze.src.scraping_tweet import TwitterScraper
from trend_analyze.config import *
from trend_analyze.src.model import *
class TwitterFetcher:... | 171 | 0 | 27 |
7f476ff034ee0499e8cb4ca6060ddc10a61ebbab | 42 | py | Python | Python/Book Assignments/calc1.py | AungWinnHtut/CStutorial | 4b57721b814e9c2d288af64a979704dd70f14ddb | [
"MIT"
] | null | null | null | Python/Book Assignments/calc1.py | AungWinnHtut/CStutorial | 4b57721b814e9c2d288af64a979704dd70f14ddb | [
"MIT"
] | null | null | null | Python/Book Assignments/calc1.py | AungWinnHtut/CStutorial | 4b57721b814e9c2d288af64a979704dd70f14ddb | [
"MIT"
] | 1 | 2022-03-15T12:20:26.000Z | 2022-03-15T12:20:26.000Z | a=123*456
b=(34*99)+22
print(a)
print(b)
| 7 | 12 | 0.619048 | a=123*456
b=(34*99)+22
print(a)
print(b)
| 0 | 0 | 0 |
eb82951b7423ded8bfd349910cd8eac73c4109a2 | 2,457 | py | Python | shub_workflow/utils/__init__.py | curita/shub-workflow | 5450da1502f8c300be242609dc6ae67bd3702079 | [
"BSD-3-Clause"
] | 8 | 2019-01-03T14:40:16.000Z | 2022-03-04T03:23:09.000Z | shub_workflow/utils/__init__.py | curita/shub-workflow | 5450da1502f8c300be242609dc6ae67bd3702079 | [
"BSD-3-Clause"
] | 10 | 2019-02-12T12:28:39.000Z | 2022-02-18T17:43:21.000Z | shub_workflow/utils/__init__.py | curita/shub-workflow | 5450da1502f8c300be242609dc6ae67bd3702079 | [
"BSD-3-Clause"
] | 8 | 2018-11-03T20:29:08.000Z | 2022-02-18T01:27:48.000Z | import logging
import json
import os
from typing import Optional
from retrying import retry
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
def resolve_project_id(project_id=None) -> Optional[int]:
"""
Gets project id from following sources in following order of precedence:
- default... | 28.569767 | 118 | 0.708181 | import logging
import json
import os
from typing import Optional
from retrying import retry
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
def resolve_project_id(project_id=None) -> Optional[int]:
"""
Gets project id from following sources in following order of precedence:
- default... | 834 | 0 | 69 |
719e474631df8629a094702959a31661c8607c9f | 349 | py | Python | centralreport/cr/entities/webservices.py | haiyangd/CentralReport | 421447f31d07321f65198c5b5746baa16c9d9725 | [
"Apache-2.0"
] | 8 | 2015-08-17T20:25:12.000Z | 2019-03-04T04:42:31.000Z | centralreport/cr/entities/webservices.py | haiyangd/CentralReport | 421447f31d07321f65198c5b5746baa16c9d9725 | [
"Apache-2.0"
] | 3 | 2015-03-29T01:33:45.000Z | 2016-01-15T22:44:08.000Z | centralreport/cr/entities/webservices.py | haiyangd/CentralReport | 421447f31d07321f65198c5b5746baa16c9d9725 | [
"Apache-2.0"
] | 3 | 2016-08-06T19:49:42.000Z | 2018-03-28T09:42:58.000Z | # -*- coding: utf-8 -*-
"""
CentralReport - Webservices module
Contains all entities used with webservices.
https://github.com/CentralReport/
"""
class Answer:
"""
This entity contains the result of a webservice
"""
| 16.619048 | 55 | 0.570201 | # -*- coding: utf-8 -*-
"""
CentralReport - Webservices module
Contains all entities used with webservices.
https://github.com/CentralReport/
"""
class Answer:
"""
This entity contains the result of a webservice
"""
def __init__(self):
self.code = 0
self.headers ... | 69 | 0 | 27 |
fa2bc6d2e6eec067fced03803a68cd7f14feebea | 3,001 | py | Python | openfl-workspace/keras_cnn_mnist/code/keras_cnn.py | nalinigans/federated-inference | 919be633ebe24525f5606fe60428e46344fb654f | [
"Apache-2.0"
] | null | null | null | openfl-workspace/keras_cnn_mnist/code/keras_cnn.py | nalinigans/federated-inference | 919be633ebe24525f5606fe60428e46344fb654f | [
"Apache-2.0"
] | null | null | null | openfl-workspace/keras_cnn_mnist/code/keras_cnn.py | nalinigans/federated-inference | 919be633ebe24525f5606fe60428e46344fb654f | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2020-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""You may copy this file as the starting point of your own model."""
import tensorflow.keras as ke
import os.path
from tensorflow.keras import Sequential
from tensorflow.keras.layers import Conv2D, Flatten, Dense
from openfl.federated... | 32.268817 | 92 | 0.584805 | # Copyright (C) 2020-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""You may copy this file as the starting point of your own model."""
import tensorflow.keras as ke
import os.path
from tensorflow.keras import Sequential
from tensorflow.keras.layers import Conv2D, Flatten, Dense
from openfl.federated... | 0 | 0 | 0 |
4cbc7ecf383a11b61e7c715113558046bb0918f1 | 902 | py | Python | Python3/153.py | rakhi2001/ecom7 | 73790d44605fbd51e8f7e804b9808e364fcfc680 | [
"MIT"
] | 854 | 2018-11-09T08:06:16.000Z | 2022-03-31T06:05:53.000Z | Python3/153.py | rakhi2001/ecom7 | 73790d44605fbd51e8f7e804b9808e364fcfc680 | [
"MIT"
] | 29 | 2019-06-02T05:02:25.000Z | 2021-11-15T04:09:37.000Z | Python3/153.py | rakhi2001/ecom7 | 73790d44605fbd51e8f7e804b9808e364fcfc680 | [
"MIT"
] | 347 | 2018-12-23T01:57:37.000Z | 2022-03-12T14:51:21.000Z | __________________________________________________________________________________________________
sample 28 ms submission
__________________________________________________________________________________________________
sample 13016 kb submission
_______________________________________________________________________... | 36.08 | 98 | 0.644124 | __________________________________________________________________________________________________
sample 28 ms submission
class Solution:
def findMin(self, nums: List[int]) -> int:
left = 0
right = len(nums) - 1
while left < right:
mid = (left + right) // 2
... | 470 | -12 | 96 |
f78c1f45818b976cea5fcc85490e55bbf431a264 | 900 | py | Python | tests/snapshots/snap_test_definition_parser.py | mirumee/ariadne-graphql-modules | f95a48f428a49aa39d41ec91a2dac647b6869f86 | [
"BSD-3-Clause"
] | null | null | null | tests/snapshots/snap_test_definition_parser.py | mirumee/ariadne-graphql-modules | f95a48f428a49aa39d41ec91a2dac647b6869f86 | [
"BSD-3-Clause"
] | null | null | null | tests/snapshots/snap_test_definition_parser.py | mirumee/ariadne-graphql-modules | f95a48f428a49aa39d41ec91a2dac647b6869f86 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# snapshottest: v1 - https://goo.gl/zC4yUc
from __future__ import unicode_literals
from snapshottest import GenericRepr, Snapshot
snapshots = Snapshot()
snapshots['test_definition_parser_raises_error_schema_str_contains_multiple_types 1'] = GenericRepr("<ExceptionInfo ValueError('MyType clas... | 60 | 285 | 0.817778 | # -*- coding: utf-8 -*-
# snapshottest: v1 - https://goo.gl/zC4yUc
from __future__ import unicode_literals
from snapshottest import GenericRepr, Snapshot
snapshots = Snapshot()
snapshots['test_definition_parser_raises_error_schema_str_contains_multiple_types 1'] = GenericRepr("<ExceptionInfo ValueError('MyType clas... | 0 | 0 | 0 |
34607f9df96b05f23dcfea48484d77ae5a99f755 | 5,015 | py | Python | seqseek/chromosome.py | 23andMe/seqseek | 24c15a6eb410f500c352d578e8448d83a0047f26 | [
"MIT"
] | 57 | 2016-03-06T20:48:32.000Z | 2021-06-03T00:08:39.000Z | seqseek/chromosome.py | 23andMe/seqseek | 24c15a6eb410f500c352d578e8448d83a0047f26 | [
"MIT"
] | 5 | 2017-02-07T20:04:23.000Z | 2021-04-28T16:22:22.000Z | seqseek/chromosome.py | 23andMe/seqseek | 24c15a6eb410f500c352d578e8448d83a0047f26 | [
"MIT"
] | 18 | 2016-02-26T18:33:08.000Z | 2022-02-17T16:43:49.000Z | import os
from .exceptions import TooManyLoops, MissingDataError
from .lib import (BUILD37, BUILD38, get_data_directory, sorted_nicely,
BUILD37_ACCESSIONS, BUILD38_ACCESSIONS, ACCESSION_LENGTHS,
RCRS_ACCESSION, MITOCHONDRIA_NAMES)
| 36.875 | 91 | 0.606381 | import os
from .exceptions import TooManyLoops, MissingDataError
from .lib import (BUILD37, BUILD38, get_data_directory, sorted_nicely,
BUILD37_ACCESSIONS, BUILD38_ACCESSIONS, ACCESSION_LENGTHS,
RCRS_ACCESSION, MITOCHONDRIA_NAMES)
class Chromosome(object):
ASSEMBLY_CHROMOSOME... | 3,317 | 1,406 | 23 |
f306580096564e00743b86848f93c6971401fe64 | 4,423 | py | Python | code/data_analysis.py | Jackylinelein/MLinPractice | b4bf560cc14b52a7676ed338a01e5aed4cab7d3a | [
"MIT"
] | 1 | 2021-10-04T07:31:34.000Z | 2021-10-04T07:31:34.000Z | code/data_analysis.py | Jackylinelein/MLinPractice | b4bf560cc14b52a7676ed338a01e5aed4cab7d3a | [
"MIT"
] | 2 | 2021-10-05T12:19:49.000Z | 2021-10-05T14:16:38.000Z | code/data_analysis.py | Jackylinelein/MLinPractice | b4bf560cc14b52a7676ed338a01e5aed4cab7d3a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 7 13:01:20 2021
@author: Hendrik Timm
"""
# plotting with matplotlib
import pickle
from matplotlib import pyplot as plt
import numpy as np
# create graphs for every extracted feature
| 39.491071 | 118 | 0.494461 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 7 13:01:20 2021
@author: Hendrik Timm
"""
# plotting with matplotlib
import pickle
from matplotlib import pyplot as plt
import numpy as np
# create graphs for every extracted feature
def plot():
plot_str = "No"
plot_str = input("Do ... | 4,106 | 0 | 22 |
f692c27647947a0c2ee520a78b2fc624cbefe6b8 | 109 | py | Python | config.py | ZemlyakovDmitry/vaccine-gorzdrav-bot | 2021ee0ffef84a0955aa1fe5c3d71250edb97885 | [
"MIT"
] | null | null | null | config.py | ZemlyakovDmitry/vaccine-gorzdrav-bot | 2021ee0ffef84a0955aa1fe5c3d71250edb97885 | [
"MIT"
] | null | null | null | config.py | ZemlyakovDmitry/vaccine-gorzdrav-bot | 2021ee0ffef84a0955aa1fe5c3d71250edb97885 | [
"MIT"
] | null | null | null | lpu = "LPU"
speciality = "SPECIALLITY"
token = "TOKEN"
chat_id = "CHAT_NAME" # if u re planing to send
| 21.8 | 50 | 0.651376 | lpu = "LPU"
speciality = "SPECIALLITY"
token = "TOKEN"
chat_id = "CHAT_NAME" # if u re planing to send
| 0 | 0 | 0 |
9ae91868ce8670a647081e0309878b37496c7def | 1,795 | py | Python | weakly-supvervized-temp/baseline/data_analysis.py | nileshkulkarni/vlr-project | 9393aeb5c7134662caf2951318e310692f5dfc51 | [
"MIT"
] | null | null | null | weakly-supvervized-temp/baseline/data_analysis.py | nileshkulkarni/vlr-project | 9393aeb5c7134662caf2951318e310692f5dfc51 | [
"MIT"
] | null | null | null | weakly-supvervized-temp/baseline/data_analysis.py | nileshkulkarni/vlr-project | 9393aeb5c7134662caf2951318e310692f5dfc51 | [
"MIT"
] | null | null | null | import torch
import torch.nn
import os.path as osp
from baseline.utils.parser import get_opts
from baseline.nnutils.stream_modules import ActionClassification
from baseline.data.ucf101 import UCF101Temporal, split
from baseline.logger import Logger
from tqdm import tqdm
import pdb
from tensorboardX import SummaryWriter... | 26.397059 | 79 | 0.697493 | import torch
import torch.nn
import os.path as osp
from baseline.utils.parser import get_opts
from baseline.nnutils.stream_modules import ActionClassification
from baseline.data.ucf101 import UCF101Temporal, split
from baseline.logger import Logger
from tqdm import tqdm
import pdb
from tensorboardX import SummaryWriter... | 1,199 | 0 | 69 |
7baee6bc9e1d94ff7ccd0aa6e5c40df0e073f3a6 | 1,275 | py | Python | LED/welcome.py | longyuxi/2019-genas-china-smart-device | fbe21bb28fac8ee756b83848dbfd701664317fe6 | [
"MIT"
] | 2 | 2019-09-23T01:47:14.000Z | 2020-09-18T21:55:44.000Z | LED/welcome.py | longyuxi/2019-genas-china-smart-device | fbe21bb28fac8ee756b83848dbfd701664317fe6 | [
"MIT"
] | null | null | null | LED/welcome.py | longyuxi/2019-genas-china-smart-device | fbe21bb28fac8ee756b83848dbfd701664317fe6 | [
"MIT"
] | null | null | null | import RPi.GPIO as GPIO # Import GPIO Module
from time import sleep # Import sleep Module for timing
BUTTON_PIN = 21
LED_PIN = 20
GPIO.setmode(GPIO.BCM) # Configures pin numbering to Broadcom reference
GPIO.setwarnings(False) # Disable Warnings
GPIO.setup(LED_PIN, GPIO.OUT) #Set our GPIO pin to output
GPIO.outp... | 33.552632 | 107 | 0.65098 | import RPi.GPIO as GPIO # Import GPIO Module
from time import sleep # Import sleep Module for timing
BUTTON_PIN = 21
LED_PIN = 20
GPIO.setmode(GPIO.BCM) # Configures pin numbering to Broadcom reference
GPIO.setwarnings(False) # Disable Warnings
GPIO.setup(LED_PIN, GPIO.OUT) #Set our GPIO pin to output
GPIO.outp... | 577 | 0 | 23 |
c4f7a125dec4c2a39d52ca2a5b70b271d15ae08d | 19,965 | py | Python | tests/utils/test_task_group.py | yang040840219/airflow | c73d9e09cc650374e975ba287e9ed8ea59cde51a | [
"Apache-2.0"
] | 2 | 2020-10-23T18:55:03.000Z | 2021-07-13T04:45:49.000Z | tests/utils/test_task_group.py | yang040840219/airflow | c73d9e09cc650374e975ba287e9ed8ea59cde51a | [
"Apache-2.0"
] | 14 | 2019-12-03T02:54:42.000Z | 2020-02-27T16:08:10.000Z | tests/utils/test_task_group.py | yang040840219/airflow | c73d9e09cc650374e975ba287e9ed8ea59cde51a | [
"Apache-2.0"
] | 2 | 2020-10-23T18:55:05.000Z | 2022-02-16T21:53:10.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 35.524911 | 94 | 0.515753 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 7,139 | 0 | 222 |
7c582f53490ad6632ef4134d570f8bb6a3d1e257 | 4,632 | py | Python | aspen/network_engines/tornado_.py | marcusrbrown/aspen | 5229bef0d9c76ec1c990532e8d4f8e8a858d3724 | [
"MIT"
] | 1 | 2021-07-07T11:49:35.000Z | 2021-07-07T11:49:35.000Z | aspen/network_engines/tornado_.py | marcusrbrown/aspen | 5229bef0d9c76ec1c990532e8d4f8e8a858d3724 | [
"MIT"
] | null | null | null | aspen/network_engines/tornado_.py | marcusrbrown/aspen | 5229bef0d9c76ec1c990532e8d4f8e8a858d3724 | [
"MIT"
] | null | null | null | import collections
import time
from aspen.network_engines import CooperativeEngine
from aspen.sockets import packet
from aspen.sockets.loop import Die
import tornado.ioloop
import tornado.httpserver
import tornado.wsgi
class TornadoBuffer(collections.deque):
"""Model a buffer of items.
There are two of thes... | 27.903614 | 78 | 0.604491 | import collections
import time
from aspen.network_engines import CooperativeEngine
from aspen.sockets import packet
from aspen.sockets.loop import Die
import tornado.ioloop
import tornado.httpserver
import tornado.wsgi
class TornadoBuffer(collections.deque):
"""Model a buffer of items.
There are two of thes... | 1,045 | 222 | 181 |
19d646ea28592ea79a40625b2731656f2fa3a9e0 | 20,542 | py | Python | keras_layers/keras_layer_AnchorBoxes.py | xuannianz/ssd_keras | 681e936b834b6a3786562ee8d22f7b07b409bd17 | [
"Apache-2.0"
] | 1 | 2019-10-30T06:53:48.000Z | 2019-10-30T06:53:48.000Z | keras_layers/keras_layer_AnchorBoxes.py | lylaaa/ssd_keras | 681e936b834b6a3786562ee8d22f7b07b409bd17 | [
"Apache-2.0"
] | null | null | null | keras_layers/keras_layer_AnchorBoxes.py | lylaaa/ssd_keras | 681e936b834b6a3786562ee8d22f7b07b409bd17 | [
"Apache-2.0"
] | 1 | 2019-11-17T07:02:26.000Z | 2019-11-17T07:02:26.000Z | """
A custom Keras layer to generate anchor boxes.
Copyright (C) 2018 Pierluigi Ferrari
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 requir... | 52.403061 | 120 | 0.616931 | """
A custom Keras layer to generate anchor boxes.
Copyright (C) 2018 Pierluigi Ferrari
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 requir... | 1,419 | 0 | 81 |
97e245ed5f521186c9e3a2d569108a49c82accc8 | 1,943 | py | Python | python/protectFlashblade/flashBladeProtectionStatus.py | ped998/scripts | 0dcaaf47f9676210e1c972a5d59d8d0de82a1d93 | [
"Apache-2.0"
] | null | null | null | python/protectFlashblade/flashBladeProtectionStatus.py | ped998/scripts | 0dcaaf47f9676210e1c972a5d59d8d0de82a1d93 | [
"Apache-2.0"
] | null | null | null | python/protectFlashblade/flashBladeProtectionStatus.py | ped998/scripts | 0dcaaf47f9676210e1c972a5d59d8d0de82a1d93 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Show FlashBlade Protection Status"""
# usage:
# ./flashBladeProtectionStatus.py -v mycluster \
# -u myuser \
# -d mydomain.net \
# -f flashblad01
# import pyhesity wrapper module
from pyhesity impo... | 33.5 | 108 | 0.683479 | #!/usr/bin/env python
"""Show FlashBlade Protection Status"""
# usage:
# ./flashBladeProtectionStatus.py -v mycluster \
# -u myuser \
# -d mydomain.net \
# -f flashblad01
# import pyhesity wrapper module
from pyhesity impo... | 0 | 0 | 0 |
7633f200fcfd7368b83bc146f6bff707f24c4998 | 505 | py | Python | fos/shader/shaderlib.py | fos/fos-legacy | db6047668781a0615abcebc7d55a7164f3105047 | [
"BSD-3-Clause"
] | 2 | 2016-08-03T10:33:08.000Z | 2021-06-23T18:50:14.000Z | fos/shader/shaderlib.py | fos/fos-legacy | db6047668781a0615abcebc7d55a7164f3105047 | [
"BSD-3-Clause"
] | null | null | null | fos/shader/shaderlib.py | fos/fos-legacy | db6047668781a0615abcebc7d55a7164f3105047 | [
"BSD-3-Clause"
] | null | null | null | """ Meaningful composition of shader programs exposed as a library """
__author__ = 'Stephan Gerhard'
from .shaders import Shader
from .lib import get_shader_code
import pyglet.gl as gl
# load the vary-line-width-shader
| 36.071429 | 99 | 0.69703 | """ Meaningful composition of shader programs exposed as a library """
__author__ = 'Stephan Gerhard'
from .shaders import Shader
from .lib import get_shader_code
import pyglet.gl as gl
# load the vary-line-width-shader
def get_vary_line_width_shader():
return Shader( [get_shader_code('propagatevertex130.vert')],... | 261 | 0 | 22 |
18dd335cf5cb8e93aa05da1e231e4638bd6752ac | 2,704 | py | Python | ems/migrations/0006_auto_20170924_2037.py | abhi20161997/Oasis-17 | 80618af478beb256502bf1b6c05e0a22068577c9 | [
"BSD-3-Clause"
] | null | null | null | ems/migrations/0006_auto_20170924_2037.py | abhi20161997/Oasis-17 | 80618af478beb256502bf1b6c05e0a22068577c9 | [
"BSD-3-Clause"
] | null | null | null | ems/migrations/0006_auto_20170924_2037.py | abhi20161997/Oasis-17 | 80618af478beb256502bf1b6c05e0a22068577c9 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-09-24 15:07
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
| 25.509434 | 108 | 0.494453 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-09-24 15:07
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('ems', '0005_bitsian'),
]
operations = [
mi... | 0 | 2,492 | 23 |
befb9c12d9e5239ce20c5cc400ffd5ab90b3bd0d | 1,934 | py | Python | experimental/survey_of_surveys.py | TheMTank/arxiv-summariser | db4f1e42bcc9185e197a00a18e280a4a3011453c | [
"MIT"
] | 17 | 2018-11-26T23:06:20.000Z | 2022-01-18T21:43:17.000Z | experimental/survey_of_surveys.py | TheMTank/arxiv-summariser | db4f1e42bcc9185e197a00a18e280a4a3011453c | [
"MIT"
] | 3 | 2018-11-27T12:17:20.000Z | 2019-02-05T11:40:44.000Z | experimental/survey_of_surveys.py | TheMTank/arxiv-summariser | db4f1e42bcc9185e197a00a18e280a4a3011453c | [
"MIT"
] | 3 | 2019-03-06T10:14:08.000Z | 2020-01-21T17:26:20.000Z | import argparse
import re
import pickle
import numpy as np
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split
# import stopwords
parser = argparse.ArgumentParser(description='')
parser.add_argument('--db-... | 32.233333 | 99 | 0.729576 | import argparse
import re
import pickle
import numpy as np
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split
# import stopwords
parser = argparse.ArgumentParser(description='')
parser.add_argument('--db-... | 0 | 0 | 0 |
e643d9f6daf265d5cae46719f9ebaa464934a8c2 | 3,979 | py | Python | finetuning_model.py | remstef/naacl_transfer_learning_tutorial | 909f00c2b69fe223f1c532945809e6290fa36b12 | [
"MIT"
] | 5 | 2019-05-08T09:51:49.000Z | 2020-12-18T03:42:25.000Z | finetuning_model.py | singleheart/naacl_transfer_learning | 68884a0842cac32c41273c9bc36260080b9d2148 | [
"MIT"
] | 1 | 2019-06-06T09:50:42.000Z | 2019-06-06T09:50:42.000Z | finetuning_model.py | singleheart/naacl_transfer_learning | 68884a0842cac32c41273c9bc36260080b9d2148 | [
"MIT"
] | 1 | 2020-11-13T13:45:21.000Z | 2020-11-13T13:45:21.000Z | import importlib
import torch
import torch.nn as nn
from pretraining_model import Transformer, TransformerWithLMHead
| 50.367089 | 127 | 0.62101 | import importlib
import torch
import torch.nn as nn
from pretraining_model import Transformer, TransformerWithLMHead
class TransformerWithAdapters(Transformer):
def __init__(self, adapters_dim, embed_dim, hidden_dim, num_embeddings, num_max_positions, num_heads, num_layers, dropout):
""" Transformer with ... | 0 | 3,814 | 46 |
b0a2725c61a27da930e348c8c1fbac609ad62a87 | 128 | py | Python | effnet/__init__.py | Burf/EfficientNet-Lite-Tensorflow2 | d1026d80fb8f23f7c213b28d546df5a8f6ba60b3 | [
"MIT"
] | null | null | null | effnet/__init__.py | Burf/EfficientNet-Lite-Tensorflow2 | d1026d80fb8f23f7c213b28d546df5a8f6ba60b3 | [
"MIT"
] | null | null | null | effnet/__init__.py | Burf/EfficientNet-Lite-Tensorflow2 | d1026d80fb8f23f7c213b28d546df5a8f6ba60b3 | [
"MIT"
] | null | null | null | from .effnet import efficientnet_lite_b0, efficientnet_lite_b1, efficientnet_lite_b2, efficientnet_lite_b3, efficientnet_lite_b4 | 128 | 128 | 0.90625 | from .effnet import efficientnet_lite_b0, efficientnet_lite_b1, efficientnet_lite_b2, efficientnet_lite_b3, efficientnet_lite_b4 | 0 | 0 | 0 |
f7f8f3bfd951108aa64a2bda82e8cf60541c50a4 | 3,942 | py | Python | FER_osc.py | jaegonlee/fer | 628651d88568103f5b2b3e081d5c6b5dab39267d | [
"MIT"
] | null | null | null | FER_osc.py | jaegonlee/fer | 628651d88568103f5b2b3e081d5c6b5dab39267d | [
"MIT"
] | null | null | null | FER_osc.py | jaegonlee/fer | 628651d88568103f5b2b3e081d5c6b5dab39267d | [
"MIT"
] | null | null | null | #!/usr/local/bin/python3
from keras.models import model_from_json
import numpy as np
import cv2
import argparse
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import math
from pythonosc import udp_client
#parser = argparse.ArgumentParser()
#parser.add_argument("source")
#parser.add_argument("fps")
#args = parser.p... | 36.841121 | 112 | 0.637494 | #!/usr/local/bin/python3
from keras.models import model_from_json
import numpy as np
import cv2
import argparse
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import math
from pythonosc import udp_client
class FacialExpressionModel(object):
EMOTIONS_LIST = ["Angry", "Disgust", "Fear", "Happy", "Sad", "Surprise... | 2,508 | 157 | 69 |
84b66a37064604881c5102d6378ffcbfd4e2dbf0 | 3,077 | py | Python | scripts/tests/py_onnx/keras/export_scripts/lstm_keras_export.py | lauracanalini/eddl | c5efac642e8e1f99b31dfaaacd0a5a058b09923b | [
"MIT"
] | 30 | 2019-10-11T21:03:43.000Z | 2022-02-17T19:56:15.000Z | scripts/tests/py_onnx/keras/export_scripts/lstm_keras_export.py | lauracanalini/eddl | c5efac642e8e1f99b31dfaaacd0a5a058b09923b | [
"MIT"
] | 151 | 2019-10-16T06:47:23.000Z | 2022-03-07T15:15:58.000Z | scripts/tests/py_onnx/keras/export_scripts/lstm_keras_export.py | lauracanalini/eddl | c5efac642e8e1f99b31dfaaacd0a5a058b09923b | [
"MIT"
] | 20 | 2019-10-16T09:37:37.000Z | 2022-02-22T09:47:14.000Z | import os
import argparse
import keras2onnx
from tensorflow.keras.preprocessing import sequence
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Embedding, Input
from tensorflow.keras.layers import LSTM
from tensorflow.keras.datasets import imdb
# Training settings
parser = arg... | 41.026667 | 101 | 0.690933 | import os
import argparse
import keras2onnx
from tensorflow.keras.preprocessing import sequence
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Embedding, Input
from tensorflow.keras.layers import LSTM
from tensorflow.keras.datasets import imdb
# Training settings
parser = arg... | 0 | 0 | 0 |
46c760009b32acc461c93e6810212059ac4fd7de | 2,005 | py | Python | plugins/suspicious_constants/plugin.py | 4k4xs4pH1r3/flashmingo | bb905ff757805a5a832977d44991152c8aa8771a | [
"Apache-2.0"
] | 124 | 2019-04-15T17:32:11.000Z | 2021-09-11T21:41:29.000Z | plugins/suspicious_constants/plugin.py | 4k4xs4pH1r3/flashmingo | bb905ff757805a5a832977d44991152c8aa8771a | [
"Apache-2.0"
] | 3 | 2019-04-18T05:32:22.000Z | 2021-06-12T02:04:22.000Z | plugins/suspicious_constants/plugin.py | 4k4xs4pH1r3/flashmingo | bb905ff757805a5a832977d44991152c8aa8771a | [
"Apache-2.0"
] | 37 | 2019-04-16T01:22:54.000Z | 2021-07-31T21:03:25.000Z | # coding: utf-8
# Copyright(C) 2019 FireEye, Inc. All Rights Reserved.
#
# FLASHMINGO!
# This finds suspicious constants in the constant pool(s)
import os
import logging
import logging.handlers
class Plugin:
"""
All plugins work on a SWFObject passed
as an argument
"""
def _init_logging(self):
... | 26.038961 | 77 | 0.608479 | # coding: utf-8
# Copyright(C) 2019 FireEye, Inc. All Rights Reserved.
#
# FLASHMINGO!
# This finds suspicious constants in the constant pool(s)
import os
import logging
import logging.handlers
class Plugin:
"""
All plugins work on a SWFObject passed
as an argument
"""
def __init__(self, swf=No... | 339 | 0 | 54 |
dc6d15ce816999763d04b32f5abd83ba6236a0f7 | 546 | py | Python | magz/lagrange1.py | bru32/magz | 541e0a5774d51251ce25bf326cdce0c615f347c3 | [
"MIT"
] | null | null | null | magz/lagrange1.py | bru32/magz | 541e0a5774d51251ce25bf326cdce0c615f347c3 | [
"MIT"
] | null | null | null | magz/lagrange1.py | bru32/magz | 541e0a5774d51251ce25bf326cdce0c615f347c3 | [
"MIT"
] | null | null | null | """
1D interpolation by Lagrange method.
Bruce Wernick
10 June 2021
"""
def lagrange1d(X, Y):
"1D Lagrange interpolation"
n = len(X)
return f
# ---------------------------------------------------------------------
if __name__ == '__main__':
x = [1,2,3,4,5]
y = [2,4,6,8,10]
fx = lagran... | 18.2 | 72 | 0.408425 | """
1D interpolation by Lagrange method.
Bruce Wernick
10 June 2021
"""
def lagrange1d(X, Y):
"1D Lagrange interpolation"
n = len(X)
def f(x):
s = 0.0
for i in range(n):
q = 1.0
for j in range(n):
if i == j: continue
q *= (x - X[j]) / (X[i] - X[j])
s += Y... | 171 | 0 | 25 |
af94ac9b2fa3ebdaa065476a938eec3047602959 | 1,698 | py | Python | mfw/crawler.py | leishufei/JS-Crack | 6a4a6c3b5dfee23ea9524da1e5521cece0098562 | [
"MIT"
] | 53 | 2021-04-02T08:20:15.000Z | 2022-03-25T06:51:50.000Z | mfw/crawler.py | wenxuefeng3930/JS-Crack-Records | 6a4a6c3b5dfee23ea9524da1e5521cece0098562 | [
"MIT"
] | 1 | 2021-11-15T05:36:24.000Z | 2021-11-15T05:36:24.000Z | mfw/crawler.py | wenxuefeng3930/JS-Crack-Records | 6a4a6c3b5dfee23ea9524da1e5521cece0098562 | [
"MIT"
] | 17 | 2021-04-06T01:49:41.000Z | 2022-03-29T15:13:54.000Z | #!usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2021/2/5
# @Author : Shufei Lei
# @Software : PyCharm
import hashlib
import requests
import execjs
import re
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4144.2 Safari/537.36'
}
... | 26.123077 | 140 | 0.596584 | #!usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2021/2/5
# @Author : Shufei Lei
# @Software : PyCharm
import hashlib
import requests
import execjs
import re
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4144.2 Safari/537.36'
}
de... | 1,223 | 0 | 92 |
9e89d30b44b07189ada456351e9b8c9da13fbe37 | 2,213 | py | Python | python/src/hsd/common.py | bhourahine/hsdparser | 766898c224fe0ed192e25d75e2e5c656407c8473 | [
"BSD-2-Clause"
] | null | null | null | python/src/hsd/common.py | bhourahine/hsdparser | 766898c224fe0ed192e25d75e2e5c656407c8473 | [
"BSD-2-Clause"
] | null | null | null | python/src/hsd/common.py | bhourahine/hsdparser | 766898c224fe0ed192e25d75e2e5c656407c8473 | [
"BSD-2-Clause"
] | null | null | null | HSDATTR_PROC = "processed"
HSDATTR_EQUAL = "equal"
HSDATTR_FILE = "file"
HSDATTR_LINE = "lines"
class HSDException(Exception):
"""Base class for exceptions in the HSD packages."""
pass
class HSDQueryError(HSDException):
"""Base class for errors detected by the HSDQuery object.
Attributes:
... | 32.072464 | 78 | 0.668775 | HSDATTR_PROC = "processed"
HSDATTR_EQUAL = "equal"
HSDATTR_FILE = "file"
HSDATTR_LINE = "lines"
class HSDException(Exception):
"""Base class for exceptions in the HSD packages."""
pass
class HSDQueryError(HSDException):
"""Base class for errors detected by the HSDQuery object.
Attributes:
... | 274 | 196 | 164 |
6a2f6817affb30277f8e1d7ea2b313b1926dc9c3 | 4,049 | py | Python | app/Sentences.py | opensourcedefense/slackov | 38c7ea65678f0ab63bc7a9fdf5c931801d1f0e5e | [
"Apache-2.0"
] | 4 | 2018-06-21T13:34:40.000Z | 2019-05-04T19:40:52.000Z | app/Sentences.py | opensourcedefense/slackov | 38c7ea65678f0ab63bc7a9fdf5c931801d1f0e5e | [
"Apache-2.0"
] | null | null | null | app/Sentences.py | opensourcedefense/slackov | 38c7ea65678f0ab63bc7a9fdf5c931801d1f0e5e | [
"Apache-2.0"
] | 1 | 2020-03-28T19:25:50.000Z | 2020-03-28T19:25:50.000Z | import re
from sqlalchemy import (
Column,
DateTime,
String,
Integer,
JSON,
Text,
Float,
ForeignKey,
insert
)
from app.Database import Base, Session
| 29.992593 | 82 | 0.587306 | import re
from sqlalchemy import (
Column,
DateTime,
String,
Integer,
JSON,
Text,
Float,
ForeignKey,
insert
)
from app.Database import Base, Session
class Sentences(Base):
__tablename__ = 'sentences'
id = Column(Integer(), primary_key=True, autoincrement=True)
body = C... | 3,097 | 743 | 23 |
82d094555b5d2ac3f61eb59320ce7decb7f7eb46 | 471 | py | Python | simple/views.py | taranjeet/todo-app-backend | a0d98efd78c4d4de6284fc238d525b44faa402d0 | [
"MIT"
] | 1 | 2018-07-04T14:41:32.000Z | 2018-07-04T14:41:32.000Z | simple/views.py | taranjeet/todo-app-backend | a0d98efd78c4d4de6284fc238d525b44faa402d0 | [
"MIT"
] | null | null | null | simple/views.py | taranjeet/todo-app-backend | a0d98efd78c4d4de6284fc238d525b44faa402d0 | [
"MIT"
] | null | null | null | from rest_framework import generics
from .models import Todo
from .serializers import TodoSerializer
| 24.789474 | 56 | 0.764331 | from rest_framework import generics
from .models import Todo
from .serializers import TodoSerializer
class TodoList(generics.ListCreateAPIView):
queryset = Todo.objects.all()
serializer_class = TodoSerializer
authentication_classes = ()
permission_classes = ()
class TodoDetail(generics.RetrieveUpda... | 0 | 321 | 46 |
ce9b658e8978a05af30c1fe0f27167faec4c473f | 93 | py | Python | git_stalk/__init__.py | aashutoshrathi/git-stalk-cli | 556b4873ca2aec1db43c7a190e4ee4add903c3f3 | [
"MIT"
] | 49 | 2018-06-01T18:47:22.000Z | 2020-10-12T12:56:16.000Z | git_stalk/__init__.py | aashutoshrathi/git-stalk-cli | 556b4873ca2aec1db43c7a190e4ee4add903c3f3 | [
"MIT"
] | 63 | 2018-06-01T18:49:23.000Z | 2020-09-25T23:12:52.000Z | git_stalk/__init__.py | aashutoshrathi/git-stalk-cli | 556b4873ca2aec1db43c7a190e4ee4add903c3f3 | [
"MIT"
] | 47 | 2018-06-06T12:37:15.000Z | 2020-03-17T18:12:41.000Z | __version__ = '1.6.0'
__author__ = 'Aashutosh Rathi <aashutoshrathi@gmail.com>'
__all__ = []
| 23.25 | 57 | 0.72043 | __version__ = '1.6.0'
__author__ = 'Aashutosh Rathi <aashutoshrathi@gmail.com>'
__all__ = []
| 0 | 0 | 0 |
63b4af9976d9e3a7e21f04f174376781c27379c3 | 502 | py | Python | software/perception/mfallon_sandbox/python/matchShapes.py | liangfok/oh-distro | eeee1d832164adce667e56667dafc64a8d7b8cee | [
"BSD-3-Clause"
] | 92 | 2016-01-14T21:03:50.000Z | 2021-12-01T17:57:46.000Z | software/perception/mfallon_sandbox/python/matchShapes.py | liangfok/oh-distro | eeee1d832164adce667e56667dafc64a8d7b8cee | [
"BSD-3-Clause"
] | 62 | 2016-01-16T18:08:14.000Z | 2016-03-24T15:16:28.000Z | software/perception/mfallon_sandbox/python/matchShapes.py | liangfok/oh-distro | eeee1d832164adce667e56667dafc64a8d7b8cee | [
"BSD-3-Clause"
] | 41 | 2016-01-14T21:26:58.000Z | 2022-03-28T03:10:39.000Z | # http://docs.opencv.org/trunk/doc/py_tutorials/py_imgproc/py_contours/py_contours_more_functions/py_contours_more_functions.html
import cv2
import numpy as np
img1 = cv2.imread('a.jpg',0)
img2 = cv2.imread('a.jpg',0)
ret, thresh = cv2.threshold(img1, 127, 255,0)
ret, thresh2 = cv2.threshold(img2, 127, 255,0)
contour... | 29.529412 | 129 | 0.760956 | # http://docs.opencv.org/trunk/doc/py_tutorials/py_imgproc/py_contours/py_contours_more_functions/py_contours_more_functions.html
import cv2
import numpy as np
img1 = cv2.imread('a.jpg',0)
img2 = cv2.imread('a.jpg',0)
ret, thresh = cv2.threshold(img1, 127, 255,0)
ret, thresh2 = cv2.threshold(img2, 127, 255,0)
contour... | 0 | 0 | 0 |
87a5a831556aefcaa4c8b4bcfe5a267413fb571a | 7,055 | py | Python | tests/test_mergeSTR/test_mergeSTR.py | richyanicky/TRTools | 6582912ad3fade6e905b78b08c991a08baca8649 | [
"MIT"
] | null | null | null | tests/test_mergeSTR/test_mergeSTR.py | richyanicky/TRTools | 6582912ad3fade6e905b78b08c991a08baca8649 | [
"MIT"
] | null | null | null | tests/test_mergeSTR/test_mergeSTR.py | richyanicky/TRTools | 6582912ad3fade6e905b78b08c991a08baca8649 | [
"MIT"
] | null | null | null | import argparse
import os, sys
import numpy as np
import pytest
sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), '..','..'))
from mergeSTR import *
TESTDIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "test_files")
COMMDIR = os.path.join(os.path.dirname(os.path.abspath(__file_... | 35.631313 | 106 | 0.676967 | import argparse
import os, sys
import numpy as np
import pytest
sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), '..','..'))
from mergeSTR import *
TESTDIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "test_files")
COMMDIR = os.path.join(os.path.dirname(os.path.abspath(__file_... | 4,998 | -3 | 273 |
aff464b48f2685ff86f5b7706c81eb8989162cf0 | 1,479 | py | Python | pilot/eventservice/esprocess/esmanager.py | anisyonk/pilot2 | f06cbf903e3f235d6fc504b54faa02006b95256d | [
"Apache-2.0"
] | 6 | 2018-05-09T12:08:51.000Z | 2021-12-22T06:45:11.000Z | pilot/eventservice/esprocess/esmanager.py | anisyonk/pilot2 | f06cbf903e3f235d6fc504b54faa02006b95256d | [
"Apache-2.0"
] | 133 | 2017-03-09T09:41:08.000Z | 2022-03-04T08:03:14.000Z | pilot/eventservice/esprocess/esmanager.py | anisyonk/pilot2 | f06cbf903e3f235d6fc504b54faa02006b95256d | [
"Apache-2.0"
] | 30 | 2017-01-17T09:29:02.000Z | 2022-03-03T21:27:33.000Z | #!/usr/bin/env python
# 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
#
# Authors:
# - Wen Guan, wen.guan@cern.ch, 2017
import logging
from pilot.... | 27.388889 | 78 | 0.657877 | #!/usr/bin/env python
# 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
#
# Authors:
# - Wen Guan, wen.guan@cern.ch, 2017
import logging
from pilot.... | 0 | 944 | 23 |
a79fbe9df49dcf4b912ee55b577fb517ca0ae760 | 3,649 | py | Python | Python/Canvas/LogWidget.py | yoann01/FabricUI | d4d24f25245b8ccd2d206aded2b6c5f2aca09155 | [
"BSD-3-Clause"
] | null | null | null | Python/Canvas/LogWidget.py | yoann01/FabricUI | d4d24f25245b8ccd2d206aded2b6c5f2aca09155 | [
"BSD-3-Clause"
] | null | null | null | Python/Canvas/LogWidget.py | yoann01/FabricUI | d4d24f25245b8ccd2d206aded2b6c5f2aca09155 | [
"BSD-3-Clause"
] | null | null | null | """
The LogWidget receives and saves logging output from the ScriptEditor.
"""
from PySide import QtCore, QtGui
from FabricEngine.FabricUI import DFG, Actions
| 29.666667 | 81 | 0.642916 | """
The LogWidget receives and saves logging output from the ScriptEditor.
"""
from PySide import QtCore, QtGui
from FabricEngine.FabricUI import DFG, Actions
class AppendingTextWidget(QtGui.QTextEdit):
def __init__(self):
QtGui.QTextEdit.__init__(self)
self.setReadOnly(True)
self.prevCur... | 2,883 | 104 | 502 |
0a0e2d01bc07af337808eebccab3d04f8a9067af | 1,464 | py | Python | model/.ipynb_checkpoints/model-checkpoint.py | arnoldasjan/AirbnbPricePredictor | fae36ba25d3bb4163c69b1f4544270a1474b8d87 | [
"MIT"
] | null | null | null | model/.ipynb_checkpoints/model-checkpoint.py | arnoldasjan/AirbnbPricePredictor | fae36ba25d3bb4163c69b1f4544270a1474b8d87 | [
"MIT"
] | null | null | null | model/.ipynb_checkpoints/model-checkpoint.py | arnoldasjan/AirbnbPricePredictor | fae36ba25d3bb4163c69b1f4544270a1474b8d87 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from sklearn.preprocessing import OneHotEncoder
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_absolute_error
from sklearn.linear_model import ... | 40.666667 | 110 | 0.782787 | import pandas as pd
import numpy as np
from sklearn.preprocessing import OneHotEncoder
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_absolute_error
from sklearn.linear_model import ... | 387 | 0 | 23 |
0a05958af13d63a69624d83850d7a7a0bac43498 | 25,118 | py | Python | sdks/python/apache_beam/io/textio.py | Juta/beam | 1ba94354310ce1529195916344079f7fc90a25d1 | [
"Apache-2.0"
] | 4 | 2018-09-25T16:10:54.000Z | 2020-07-13T23:52:12.000Z | sdks/python/apache_beam/io/textio.py | Juta/beam | 1ba94354310ce1529195916344079f7fc90a25d1 | [
"Apache-2.0"
] | 41 | 2018-08-16T23:54:04.000Z | 2022-01-24T20:27:19.000Z | sdks/python/apache_beam/io/textio.py | Juta/beam | 1ba94354310ce1529195916344079f7fc90a25d1 | [
"Apache-2.0"
] | 2 | 2019-04-16T15:29:22.000Z | 2020-03-30T18:43:34.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 41.177049 | 97 | 0.697349 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 8,868 | 357 | 370 |
7923320b4ba1798c84a2c2297cf6c576554f4aee | 7,051 | py | Python | tests/test___init__.py | kade-robertson/config-better | c14638da3fe95a669a04db2602e1f6ea15591c36 | [
"MIT"
] | 1 | 2019-05-21T15:15:48.000Z | 2019-05-21T15:15:48.000Z | tests/test___init__.py | kade-robertson/config-better | c14638da3fe95a669a04db2602e1f6ea15591c36 | [
"MIT"
] | 8 | 2019-03-19T14:18:43.000Z | 2020-01-10T20:30:09.000Z | tests/test___init__.py | kade-robertson/config-better | c14638da3fe95a669a04db2602e1f6ea15591c36 | [
"MIT"
] | null | null | null | import os
import shutil
import sys
import tempfile
import unittest
import configbetter
if __name__ == '__main__':
unittest.main()
| 33.736842 | 85 | 0.665579 | import os
import shutil
import sys
import tempfile
import unittest
import configbetter
class TestMakedirs(unittest.TestCase):
@classmethod
def setUpClass(cls):
configbetter.sys.platform = sys.platform
cls.tempdir = tempfile.mkdtemp()
if sys.platform in ['linux', 'darwin']:
... | 5,415 | 1,325 | 169 |
bdca1a02efa1d9d3e62b35cade2f5f3f64bedbd3 | 499 | py | Python | menu/create_account.py | vlegoff/mud | 88c9b6f020148e3fc9f3a58c372a0907e89384ff | [
"BSD-3-Clause"
] | null | null | null | menu/create_account.py | vlegoff/mud | 88c9b6f020148e3fc9f3a58c372a0907e89384ff | [
"BSD-3-Clause"
] | null | null | null | menu/create_account.py | vlegoff/mud | 88c9b6f020148e3fc9f3a58c372a0907e89384ff | [
"BSD-3-Clause"
] | null | null | null | """
This module contains the 'create_account' node menu.
"""
from textwrap import dedent
def create_account(caller):
"""Create a new account.
This node simply prompts the user to enter a username.
The input is redirected to 'create_username'.
"""
text = "Enter your new account's name."
opt... | 20.791667 | 58 | 0.589178 | """
This module contains the 'create_account' node menu.
"""
from textwrap import dedent
def create_account(caller):
"""Create a new account.
This node simply prompts the user to enter a username.
The input is redirected to 'create_username'.
"""
text = "Enter your new account's name."
opt... | 0 | 0 | 0 |
72b336222491d2716908ae84ae574e1e2421bc43 | 4,420 | py | Python | Day07/Day7_Prob2_Amplification_Feedback.py | guilhermebaos/AoC-2020-Python-Solution | 4d473e254b88bacd728338f94788d5592776c4ff | [
"MIT"
] | null | null | null | Day07/Day7_Prob2_Amplification_Feedback.py | guilhermebaos/AoC-2020-Python-Solution | 4d473e254b88bacd728338f94788d5592776c4ff | [
"MIT"
] | null | null | null | Day07/Day7_Prob2_Amplification_Feedback.py | guilhermebaos/AoC-2020-Python-Solution | 4d473e254b88bacd728338f94788d5592776c4ff | [
"MIT"
] | null | null | null | from IntCode import intcode_day7
from time import sleep
memory_puzzle = [3, 8, 1001, 8, 10, 8, 105, 1, 0, 0, 21, 34, 47, 72, 93, 110, 191, 272, 353, 434, 99999, 3, 9, 102, 3, 9, 9, 1001, 9, 3, 9, 4, 9, 99, 3, 9, 102, 4, 9, 9, 1001, 9, 4, 9, 4, 9, 99, 3, 9, 101, 3, 9, 9, 1002, 9, 3, 9, 1001, 9, 2, 9, 1002, 9, 2, 9, 101... | 72.459016 | 1,761 | 0.479638 | from IntCode import intcode_day7
from time import sleep
memory_puzzle = [3, 8, 1001, 8, 10, 8, 105, 1, 0, 0, 21, 34, 47, 72, 93, 110, 191, 272, 353, 434, 99999, 3, 9, 102, 3, 9, 9, 1001, 9, 3, 9, 4, 9, 99, 3, 9, 102, 4, 9, 9, 1001, 9, 4, 9, 4, 9, 99, 3, 9, 101, 3, 9, 9, 1002, 9, 3, 9, 1001, 9, 2, 9, 1002, 9, 2, 9, 101... | 0 | 0 | 0 |
7b4a50239e715500cec44783d36cfa5729203f8d | 6,385 | py | Python | nodes.py | rpav/io_scene_consmodel | 3d7ff8a729f0f51f66829e0c664a2368295a9d8e | [
"BSD-2-Clause"
] | null | null | null | nodes.py | rpav/io_scene_consmodel | 3d7ff8a729f0f51f66829e0c664a2368295a9d8e | [
"BSD-2-Clause"
] | 1 | 2018-05-05T16:31:07.000Z | 2018-05-05T16:40:05.000Z | nodes.py | rpav/io_scene_consmodel | 3d7ff8a729f0f51f66829e0c664a2368295a9d8e | [
"BSD-2-Clause"
] | null | null | null | __all__ = ["make_node", "CM_Node"]
import bpy
import bpy.types
import bpy_types
import bmesh
import bmesh.ops
import math
import mathutils
import pyconspack as cpk
from array import array
from pyconspack import Conspack
from mathutils import Matrix
import io_scene_consmodel.consmodel as consmodel
from io_scene_con... | 30.995146 | 120 | 0.568677 | __all__ = ["make_node", "CM_Node"]
import bpy
import bpy.types
import bpy_types
import bmesh
import bmesh.ops
import math
import mathutils
import pyconspack as cpk
from array import array
from pyconspack import Conspack
from mathutils import Matrix
import io_scene_consmodel.consmodel as consmodel
from io_scene_con... | 5,355 | 81 | 360 |
b7a4de2cb7220d8755bba2064bfcf5e1f8ac90f1 | 4,362 | py | Python | trame/assets/remote.py | Kitware/trame | 41c4d62e7a6f5dba41fd9305b314c87fa8ed7b6f | [
"Apache-2.0"
] | 42 | 2021-09-24T22:10:32.000Z | 2022-03-30T19:39:25.000Z | trame/assets/remote.py | Kitware/trame | 41c4d62e7a6f5dba41fd9305b314c87fa8ed7b6f | [
"Apache-2.0"
] | 31 | 2021-10-01T21:19:56.000Z | 2022-03-04T00:14:28.000Z | trame/assets/remote.py | Kitware/trame | 41c4d62e7a6f5dba41fd9305b314c87fa8ed7b6f | [
"Apache-2.0"
] | 7 | 2021-11-17T16:12:06.000Z | 2022-03-26T21:08:40.000Z | import os
from urllib.error import HTTPError
from urllib.request import urlretrieve
class AbstractRemoteFile:
"""
AbstractRemoteFile provide infrastructure for RemoteFile where
only the method fetch() needs to be defined for a concreate implementation.
"""
@property
def local(self):
... | 30.71831 | 83 | 0.636864 | import os
from urllib.error import HTTPError
from urllib.request import urlretrieve
def download_file_from_google_drive(id, destination):
import requests
URL = "https://docs.google.com/uc"
session = requests.Session()
response = session.get(
URL, params={"id": id, "confirm": "t", "export": "... | 2,174 | 0 | 150 |
6941116b411cdfad70c28ec31c51954f694f69ef | 107 | py | Python | timus-online-judge/1068.py | aofleejay/coding-challenges | 2f29a173850fd544d3fbdc9c27369af792dc77fd | [
"MIT"
] | 1 | 2021-06-14T07:23:27.000Z | 2021-06-14T07:23:27.000Z | timus-online-judge/1068.py | aofleejay/coding-challenges | 2f29a173850fd544d3fbdc9c27369af792dc77fd | [
"MIT"
] | null | null | null | timus-online-judge/1068.py | aofleejay/coding-challenges | 2f29a173850fd544d3fbdc9c27369af792dc77fd | [
"MIT"
] | 1 | 2019-08-29T09:00:18.000Z | 2019-08-29T09:00:18.000Z | from sys import stdin
number = stdin.read()
print sum(range(min(int(number), 1), max(int(number), 1) + 1))
| 26.75 | 62 | 0.682243 | from sys import stdin
number = stdin.read()
print sum(range(min(int(number), 1), max(int(number), 1) + 1))
| 0 | 0 | 0 |
abf17cd4c4bea113a92e5f082165a9ff3892c00f | 1,580 | py | Python | py_tools/decorators.py | HAL-42/AlchemyCat | ca924755ff48e2ff74543bb0e446376eb2b1f150 | [
"Apache-2.0"
] | 8 | 2020-01-08T19:42:01.000Z | 2021-12-28T08:30:56.000Z | py_tools/decorators.py | HAL-42/AlchemyCat | ca924755ff48e2ff74543bb0e446376eb2b1f150 | [
"Apache-2.0"
] | 2 | 2020-09-10T12:22:57.000Z | 2022-02-17T05:21:22.000Z | py_tools/decorators.py | HAL-42/AlchemyCat | ca924755ff48e2ff74543bb0e446376eb2b1f150 | [
"Apache-2.0"
] | 1 | 2021-05-12T01:50:27.000Z | 2021-05-12T01:50:27.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Author : Xiaobo Yang
@Contact : hal_42@zju.edu.cn
@Time : 2021/11/8 21:16
@File : decorators.py
@Software: PyCharm
@Desc :
"""
from warnings import warn
from .timer import Timer
from .color_print import *
__all__ = ['deprecated', 'func_runtime_timer']
de... | 30.384615 | 92 | 0.501899 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Author : Xiaobo Yang
@Contact : hal_42@zju.edu.cn
@Time : 2021/11/8 21:16
@File : decorators.py
@Software: PyCharm
@Desc :
"""
from warnings import warn
from .timer import Timer
from .color_print import *
__all__ = ['deprecated', 'func_runtime_timer']
de... | 1,165 | 0 | 50 |
265806e2d143392ab143781cc6ee9477e654eb6d | 1,328 | py | Python | utility_sqs_reader/receiver.py | Antrikshy/Assisted-Living | 6f0c757de022c469ee9ab4a8cc8ea7fd7d2ed6b1 | [
"MIT"
] | 3 | 2018-03-15T08:09:15.000Z | 2021-08-10T17:21:28.000Z | utility_sqs_reader/receiver.py | Antrikshy/Assisted-Living | 6f0c757de022c469ee9ab4a8cc8ea7fd7d2ed6b1 | [
"MIT"
] | null | null | null | utility_sqs_reader/receiver.py | Antrikshy/Assisted-Living | 6f0c757de022c469ee9ab4a8cc8ea7fd7d2ed6b1 | [
"MIT"
] | null | null | null | import json, os
import boto3
from awake import wol
battlestation_mac_address = os.environ['DESKTOP_MAC_ADDR']
sqs = boto3.client('sqs')
utility_q_url = os.environ['UTILITY_Q_URL']
while True:
response = sqs.receive_message(
QueueUrl=utility_q_url,
MaxNumberOfMessages=10,
MessageAttribute... | 34.051282 | 120 | 0.605422 | import json, os
import boto3
from awake import wol
battlestation_mac_address = os.environ['DESKTOP_MAC_ADDR']
sqs = boto3.client('sqs')
utility_q_url = os.environ['UTILITY_Q_URL']
while True:
response = sqs.receive_message(
QueueUrl=utility_q_url,
MaxNumberOfMessages=10,
MessageAttribute... | 0 | 0 | 0 |
8e451a8319e4bc794ee95093598a40edd61c393c | 203 | py | Python | material/frontend/forms.py | kaajavi/itsventory | 0543f402e124828c2af662f73361c68fc45002a2 | [
"Apache-2.0"
] | null | null | null | material/frontend/forms.py | kaajavi/itsventory | 0543f402e124828c2af662f73361c68fc45002a2 | [
"Apache-2.0"
] | null | null | null | material/frontend/forms.py | kaajavi/itsventory | 0543f402e124828c2af662f73361c68fc45002a2 | [
"Apache-2.0"
] | null | null | null | from django import forms
from django.forms import BaseFormSet
| 22.555556 | 39 | 0.753695 | from django import forms
from django.forms import BaseFormSet
class DatatableRequestForm(forms.Form):
draw = forms.IntegerField()
start = forms.IntegerField()
length = forms.IntegerField()
| 0 | 117 | 23 |
9fbcf37a8d0f6495faa44a76b5b01c21ad5490fb | 327 | py | Python | Part_2_intermediate/mod_4/lesson_5/homework_1/shop/delivery.py | Mikma03/InfoShareacademy_Python_Courses | 3df1008c8c92831bebf1625f960f25b39d6987e6 | [
"MIT"
] | null | null | null | Part_2_intermediate/mod_4/lesson_5/homework_1/shop/delivery.py | Mikma03/InfoShareacademy_Python_Courses | 3df1008c8c92831bebf1625f960f25b39d6987e6 | [
"MIT"
] | null | null | null | Part_2_intermediate/mod_4/lesson_5/homework_1/shop/delivery.py | Mikma03/InfoShareacademy_Python_Courses | 3df1008c8c92831bebf1625f960f25b39d6987e6 | [
"MIT"
] | null | null | null |
import random
| 17.210526 | 71 | 0.495413 |
import random
def products_delivery():
available_products = [
"chleb",
"ciastka",
"jabłka",
"dżem",
"pomarańcze",
"marchew",
"bułki",
"ziemniaki",
"ser",
"mleko"
]
return [available_products[random.randint(0, 9)] for _ in ran... | 292 | 0 | 23 |
2da11889607a5d0774a1c832f1737a12b9752905 | 20,075 | py | Python | src/ezdxf/proxygraphic.py | luoyu-123/ezdxf | 40963a2010028f87846241e08434f43ab421f3fb | [
"MIT"
] | 1 | 2021-06-05T09:15:15.000Z | 2021-06-05T09:15:15.000Z | src/ezdxf/proxygraphic.py | luoyu-123/ezdxf | 40963a2010028f87846241e08434f43ab421f3fb | [
"MIT"
] | null | null | null | src/ezdxf/proxygraphic.py | luoyu-123/ezdxf | 40963a2010028f87846241e08434f43ab421f3fb | [
"MIT"
] | null | null | null | # Copyright (c) 2020, Manfred Moitzi
# License: MIT License
from typing import TYPE_CHECKING, Optional, Iterable, Tuple, List, Dict, cast
import struct
import math
from enum import IntEnum
from itertools import repeat
from ezdxf.lldxf import const
from ezdxf.tools.binarydata import bytes_to_hexstr, ByteStream, BitStrea... | 37.038745 | 94 | 0.601146 | # Copyright (c) 2020, Manfred Moitzi
# License: MIT License
from typing import TYPE_CHECKING, Optional, Iterable, Tuple, List, Dict, cast
import struct
import math
from enum import IntEnum
from itertools import repeat
from ezdxf.lldxf import const
from ezdxf.tools.binarydata import bytes_to_hexstr, ByteStream, BitStrea... | 17,472 | 827 | 1,117 |
ff90b178feae769cf57bc105900d9930b14a200a | 5,062 | py | Python | xView/Train.py | zippo92/yoloesa | 9faccd1171667a3e7e458260aa6ac1cff86a23ff | [
"Apache-2.0"
] | null | null | null | xView/Train.py | zippo92/yoloesa | 9faccd1171667a3e7e458260aa6ac1cff86a23ff | [
"Apache-2.0"
] | null | null | null | xView/Train.py | zippo92/yoloesa | 9faccd1171667a3e7e458260aa6ac1cff86a23ff | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
import tensorflow as tf
import matplotlib.pyplot as plt
import os
from dataset import Dataset
from Yolo import Yolo
import ConfigParser
if __name__ == '__main__':
tf.app.run() | 42.898305 | 147 | 0.638878 | from __future__ import absolute_import
import tensorflow as tf
import matplotlib.pyplot as plt
import os
from dataset import Dataset
from Yolo import Yolo
import ConfigParser
class Train():
def __init__(self):
train_path = "./data/xview_train_t1.record"
# val_path = "./data/eurosatTest.tfrecord"... | 4,747 | -7 | 99 |
1c4c77be1fcbdb2dfb985b57137edbad1931a01b | 6,693 | py | Python | tensorflow/lite/micro/tools/project_generation/create_tflm_tree.py | AdaAlarm/tensorflow | e0db063159751276a92d88a4ad6d481b1199318c | [
"Apache-2.0"
] | 10 | 2021-05-25T17:43:04.000Z | 2022-03-08T10:46:09.000Z | tensorflow/lite/micro/tools/project_generation/create_tflm_tree.py | AdaAlarm/tensorflow | e0db063159751276a92d88a4ad6d481b1199318c | [
"Apache-2.0"
] | 1,056 | 2019-12-15T01:20:31.000Z | 2022-02-10T02:06:28.000Z | tensorflow/lite/micro/tools/project_generation/create_tflm_tree.py | AdaAlarm/tensorflow | e0db063159751276a92d88a4ad6d481b1199318c | [
"Apache-2.0"
] | 6 | 2016-09-07T04:00:15.000Z | 2022-01-12T01:47:38.000Z | # Copyright 2021 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... | 39.839286 | 84 | 0.733453 | # Copyright 2021 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... | 3,589 | 0 | 137 |
a520210f9814cf9399ab3eebd37a9b44c72db535 | 3,760 | py | Python | sippyart/utilz.py | anandijain/audio | 1990de57ebc760cf6c5cc7132119b389cfd2dbfb | [
"MIT"
] | 1 | 2020-03-24T06:20:19.000Z | 2020-03-24T06:20:19.000Z | sippyart/utilz.py | anandijain/audio | 1990de57ebc760cf6c5cc7132119b389cfd2dbfb | [
"MIT"
] | null | null | null | sippyart/utilz.py | anandijain/audio | 1990de57ebc760cf6c5cc7132119b389cfd2dbfb | [
"MIT"
] | 1 | 2021-01-09T00:19:13.000Z | 2021-01-09T00:19:13.000Z | import os
import glob
import torch
import numpy as np
import torchaudio
from torch.nn import functional as F
import sippyart
PROJ_DIR = sippyart.__path__[0] + "/"
PARENT_DIR = PROJ_DIR + "../"
# TODO sync_n sample rates
| 24.258065 | 80 | 0.58484 | import os
import glob
import torch
import numpy as np
import torchaudio
from torch.nn import functional as F
import sippyart
PROJ_DIR = sippyart.__path__[0] + "/"
PARENT_DIR = PROJ_DIR + "../"
# TODO sync_n sample rates
def pct_crop(w: torch.tensor, start_pct: float, end_pct: float) -> torch.tensor:
wave_len... | 3,199 | 0 | 322 |
17c4ce473b54a1ca1bc78a91f53b132f7ba9b69a | 4,761 | py | Python | gentea/python/config_files/fap_config.py | BrettPWRE/HDB | be7cd4f20064f3f0599810ebf4c6fe85e67ccfac | [
"Apache-2.0"
] | null | null | null | gentea/python/config_files/fap_config.py | BrettPWRE/HDB | be7cd4f20064f3f0599810ebf4c6fe85e67ccfac | [
"Apache-2.0"
] | null | null | null | gentea/python/config_files/fap_config.py | BrettPWRE/HDB | be7cd4f20064f3f0599810ebf4c6fe85e67ccfac | [
"Apache-2.0"
] | null | null | null | '''Configuration file for gentea.py with basemap FAP_teacup_base'''
database = {
'user' : 'app_user',
'passwd' : 'ecohdb',
'host' : 'XXX.XXX.XX.200',
'port' : '1521',
'sid' : 'ecohdb'
}
input_image = (r'../work/FAP_teacup_base.png')
# Both of these are optional. They default to size 11 'Arial.t... | 26.597765 | 79 | 0.490863 | '''Configuration file for gentea.py with basemap FAP_teacup_base'''
database = {
'user' : 'app_user',
'passwd' : 'ecohdb',
'host' : 'XXX.XXX.XX.200',
'port' : '1521',
'sid' : 'ecohdb'
}
input_image = (r'../work/FAP_teacup_base.png')
# Both of these are optional. They default to size 11 'Arial.t... | 0 | 0 | 0 |
c4e30af68e4e8ce81cfb386cf506161cc9e61263 | 3,253 | py | Python | game_state_detector.py | Vandervir/PyLetterQuest | 91809bbd6c4e6a16e129f92ba5b339ef4dae91d9 | [
"MIT"
] | null | null | null | game_state_detector.py | Vandervir/PyLetterQuest | 91809bbd6c4e6a16e129f92ba5b339ef4dae91d9 | [
"MIT"
] | 3 | 2018-06-14T22:42:19.000Z | 2018-06-27T21:23:35.000Z | game_state_detector.py | Vandervir/PyLetterQuest | 91809bbd6c4e6a16e129f92ba5b339ef4dae91d9 | [
"MIT"
] | null | null | null | import time
from image_recognition import ImageRecognition
from text_recognition import TextRecognition
| 39.670732 | 112 | 0.688595 | import time
from image_recognition import ImageRecognition
from text_recognition import TextRecognition
class GameStateDetector:
STATE_PAUSE = 'pause'
STATE_MONSTER_BATTLE = 'monster_battle'
STATE_CHEST_MINIGAME = 'chest_minigame_letters'
STATE_CHEST_MINIGAME_PRIZE = 'chest_minigame_prize'
STATE_... | 2,627 | 497 | 23 |
93ca9ac23865d92f4b6c981e13635088c1df2c9e | 462 | py | Python | Chapter_01/1_14_SortingWithoutNativeCompare.py | winterpadding/python_cookbook | b60fd50f02895ac8dd292581c4713d596ea06277 | [
"Apache-2.0"
] | null | null | null | Chapter_01/1_14_SortingWithoutNativeCompare.py | winterpadding/python_cookbook | b60fd50f02895ac8dd292581c4713d596ea06277 | [
"Apache-2.0"
] | null | null | null | Chapter_01/1_14_SortingWithoutNativeCompare.py | winterpadding/python_cookbook | b60fd50f02895ac8dd292581c4713d596ea06277 | [
"Apache-2.0"
] | null | null | null | from operator import attrgetter
if __name__ == '__main__':
users = [User(23), User(3), User(99)]
print(users)
sorted_users_lambda = sorted(users, key=lambda u: u.user_id)
print(sorted_users_lambda)
sorted_users_attr = sorted(users, key=attrgetter('user_id'))
print(sorted_users_attr) | 22 | 64 | 0.67316 | from operator import attrgetter
class User:
def __init__(self, user_id):
self.user_id = user_id
def __repr__(self):
return 'User({})'.format(self.user_id)
if __name__ == '__main__':
users = [User(23), User(3), User(99)]
print(users)
sorted_users_lambda = sorted(users, key=lamb... | 83 | -10 | 76 |