hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
07d4f9a14c293cf66370cfbbd6fc78a6c0de576f | 2,432 | py | Python | src/calcSentimentStats.py | dsp-uga/team-jigsaw-final | cf934123c78353aa726afca9a50d6a21d7d721e3 | [
"MIT"
] | null | null | null | src/calcSentimentStats.py | dsp-uga/team-jigsaw-final | cf934123c78353aa726afca9a50d6a21d7d721e3 | [
"MIT"
] | null | null | null | src/calcSentimentStats.py | dsp-uga/team-jigsaw-final | cf934123c78353aa726afca9a50d6a21d7d721e3 | [
"MIT"
] | null | null | null |
"""
This script reads in a list of all words and generates a file for each word in
subdirectories of a target directory:
words
and then calculates all the statistics for each word and generates a file
storing the statistics calculated in the direcotry:
wordStats
This script will make the directory if needed.
"... | 30.78481 | 78 | 0.574013 | import statistics
import os
from scipy.stats import skew, mode
"""
This script reads in a list of all words and generates a file for each word in
subdirectories of a target directory:
words
and then calculates all the statistics for each word and generates a file
storing the statistics calculated in the direcotry:... | 0 | 0 | 0 | 0 | 0 | 2,024 | 0 | -3 | 88 |
62f22c6de4a79576ff32d9983890259bfb3d5b7d | 4,202 | py | Python | src/sts_unsupervised.py | yukiar/distil_wic | 1f9c5c7252105dd9f4f264f8533753f0cd08ca5b | [
"MIT"
] | null | null | null | src/sts_unsupervised.py | yukiar/distil_wic | 1f9c5c7252105dd9f4f264f8533753f0cd08ca5b | [
"MIT"
] | null | null | null | src/sts_unsupervised.py | yukiar/distil_wic | 1f9c5c7252105dd9f4f264f8533753f0cd08ca5b | [
"MIT"
] | null | null | null | '''
STS-{2012,2013,2014,2015,2016} (monolingual) and
STS-2017 (cross-lingual)
'''
| 38.550459 | 91 | 0.528082 | '''
STS-{2012,2013,2014,2015,2016} (monolingual) and
STS-2017 (cross-lingual)
'''
import io
import numpy as np
class STSEval(object):
def loadFile(self, fpath):
self.data = {}
self.samples = []
for dataset in self.datasets:
sent1, sent2 = zip(*[l.split("\t") for l in
... | 0 | 0 | 0 | 3,923 | 0 | 0 | 0 | -15 | 205 |
b77ec5ff12c2137c5b6142af142ee89aaaf66b04 | 56 | py | Python | tpfancod_simple/__init__.py | striges/tpfancod-simple | a67f3eb8752c98836e83e033612fabe4aa2bb5c9 | [
"BSD-3-Clause"
] | null | null | null | tpfancod_simple/__init__.py | striges/tpfancod-simple | a67f3eb8752c98836e83e033612fabe4aa2bb5c9 | [
"BSD-3-Clause"
] | null | null | null | tpfancod_simple/__init__.py | striges/tpfancod-simple | a67f3eb8752c98836e83e033612fabe4aa2bb5c9 | [
"BSD-3-Clause"
] | null | null | null | __author__ = 'sugar'
__all__ = ['Sensor', 'Controller'] | 18.666667 | 34 | 0.678571 | __author__ = 'sugar'
__all__ = ['Sensor', 'Controller'] | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ec475ee85f45b9ee15a098f5a71ca2fdd5f99a0d | 29,885 | py | Python | util/image_input_transformer.py | gwenniger/multi-hare | fb3f655cbbf4af6ccbfc77d587b8ea2924b300cd | [
"Apache-2.0"
] | 7 | 2019-12-04T05:58:40.000Z | 2021-08-04T07:19:55.000Z | util/image_input_transformer.py | gwenniger/multi-hare | fb3f655cbbf4af6ccbfc77d587b8ea2924b300cd | [
"Apache-2.0"
] | null | null | null | util/image_input_transformer.py | gwenniger/multi-hare | fb3f655cbbf4af6ccbfc77d587b8ea2924b300cd | [
"Apache-2.0"
] | 4 | 2019-12-03T23:42:00.000Z | 2020-12-19T19:48:04.000Z |
__author__ = "Dublin City University"
__copyright__ = "Copyright 2019, Dublin City University"
__credits__ = ["Gideon Maillette de Buy Wenniger"]
__license__ = "Dublin City University Software License (enclosed)"
if __name__ == "__main__":
main() | 52.707231 | 126 | 0.641392 | import torch
from util.utils import Utils
from torch.autograd import Variable
__author__ = "Dublin City University"
__copyright__ = "Copyright 2019, Dublin City University"
__credits__ = ["Gideon Maillette de Buy Wenniger"]
__license__ = "Dublin City University Software License (enclosed)"
class ImageInputTransforme... | 0 | 25,612 | 0 | 3,701 | 0 | 193 | 0 | 12 | 112 |
0c1c3572b091d65c3cdf3443f24df022ebec5906 | 576 | py | Python | imhotep/reporters/printing.py | justinabrahms/imhotep | d50833977a4ea18d4d21176e1437899d890e89ff | [
"MIT"
] | 76 | 2015-01-09T23:07:26.000Z | 2021-10-01T21:55:20.000Z | imhotep/reporters/printing.py | justinabrahms/imhotep | d50833977a4ea18d4d21176e1437899d890e89ff | [
"MIT"
] | 39 | 2015-03-16T14:22:09.000Z | 2022-03-26T01:04:37.000Z | imhotep/reporters/printing.py | justinabrahms/imhotep | d50833977a4ea18d4d21176e1437899d890e89ff | [
"MIT"
] | 20 | 2015-03-17T20:22:07.000Z | 2022-03-10T22:57:28.000Z | import logging
log = logging.getLogger(__name__)
| 30.315789 | 77 | 0.534722 | import logging
from .reporter import Reporter
log = logging.getLogger(__name__)
class PrintingReporter(Reporter):
def report_line(self, commit, file_name, line_number, position, message):
print("Would have posted the following: \n"
"commit: %(commit)s\n"
"position: %(position)... | 0 | 0 | 0 | 471 | 0 | 0 | 0 | 9 | 45 |
e13d62a9247f1be91bdb403069bdb9702e82ad2e | 1,453 | py | Python | python/l0435.py | daidaifan/leetcode-problem-solver | 1793eada501a2a18d05f118a98ac52e2edd12ef8 | [
"MIT"
] | null | null | null | python/l0435.py | daidaifan/leetcode-problem-solver | 1793eada501a2a18d05f118a98ac52e2edd12ef8 | [
"MIT"
] | null | null | null | python/l0435.py | daidaifan/leetcode-problem-solver | 1793eada501a2a18d05f118a98ac52e2edd12ef8 | [
"MIT"
] | null | null | null | """
Given a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping.
Note:
You may assume the interval's end point is always bigger than its start point.
Intervals like [1,2] and [2,3] have borders "touching" but they don't overlap each other.
... | 28.490196 | 139 | 0.620785 | """
Given a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping.
Note:
You may assume the interval's end point is always bigger than its start point.
Intervals like [1,2] and [2,3] have borders "touching" but they don't overlap each other.
... | 0 | 0 | 0 | 535 | 0 | 0 | 0 | 0 | 23 |
4525f811f831e44d932e73dd985ca7b29740e3ec | 23,304 | py | Python | seamless/core/manager/cachemanager.py | sjdv1982/seamless | 1b814341e74a56333c163f10e6f6ceab508b7df9 | [
"MIT"
] | 15 | 2017-06-07T12:49:12.000Z | 2020-07-25T18:06:04.000Z | seamless/core/manager/cachemanager.py | sjdv1982/seamless | 1b814341e74a56333c163f10e6f6ceab508b7df9 | [
"MIT"
] | 110 | 2016-06-21T23:20:44.000Z | 2022-02-24T16:15:22.000Z | seamless/core/manager/cachemanager.py | sjdv1982/seamless | 1b814341e74a56333c163f10e6f6ceab508b7df9 | [
"MIT"
] | 6 | 2016-06-21T11:19:22.000Z | 2019-01-21T13:45:39.000Z | from ... import get_dict_hash
import logging
logger = logging.getLogger("seamless")
RECOMPUTE_OVER_REMOTE = int(100e6) # after this threshold, better to recompute than to download remotely
# TODO: have some dynamic component based on:
# - stored recomput... | 41.173145 | 120 | 0.611526 | import weakref
import copy
from ..cache.buffer_cache import buffer_cache
from ... import get_dict_hash
import json
import asyncio
import logging
logger = logging.getLogger("seamless")
def print_info(*args):
msg = " ".join([str(arg) for arg in args])
logger.info(msg)
def print_warning(*args):
msg = " ".j... | 0 | 0 | 9,676 | 11,955 | 0 | 398 | 0 | 291 | 515 |
f47d64177ab7a4e65e3eca040e4d0f6066f38fcd | 828 | py | Python | 12_Google_Vision/1_Vision_API/Vision_API.py | Roger-Takeshita/Python-Course | 5b0b1b13bec4a8ba5a02a06fd20cb2717bc897cf | [
"MIT"
] | 1 | 2020-03-14T20:34:03.000Z | 2020-03-14T20:34:03.000Z | 12_Google_Vision/1_Vision_API/Vision_API.py | Roger-Takeshita/Python-Course | 5b0b1b13bec4a8ba5a02a06fd20cb2717bc897cf | [
"MIT"
] | 7 | 2021-04-06T18:22:04.000Z | 2022-03-12T00:52:08.000Z | 12_Google_Vision/1_Vision_API/Vision_API.py | Roger-Takeshita/Python | 5b0b1b13bec4a8ba5a02a06fd20cb2717bc897cf | [
"MIT"
] | null | null | null | import os
import io
from google.cloud import vision
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = 'serviceAccountKey.json'
client = vision.ImageAnnotatorClient()
FILE_NAME = 'images/002.jpeg'
with io.open(FILE_NAME, 'rb') as image_file:
content = image_file.read()
image = vision.Image(content=content)
response... | 27.6 | 71 | 0.689614 | import os
import io
from google.cloud import vision
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = 'serviceAccountKey.json'
client = vision.ImageAnnotatorClient()
FILE_NAME = 'images/002.jpeg'
with io.open(FILE_NAME, 'rb') as image_file:
content = image_file.read()
image = vision.Image(content=content)
response... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9399e090bf4ce6a6ba20b45562fc2e61aacb3f95 | 105 | py | Python | tests/urls.py | hmleal/django-podcast | 0ad832b577f36ef02ac0290d7a976f0e4b5c15ea | [
"MIT"
] | 14 | 2017-12-26T13:17:11.000Z | 2021-12-09T10:24:26.000Z | tests/urls.py | jgmartinss/django-podcast | 98fb87b3d78dd4286fb197aa09dcc219d2ba88f2 | [
"MIT"
] | 9 | 2017-12-28T16:12:06.000Z | 2021-07-14T17:54:19.000Z | tests/urls.py | jgmartinss/django-podcast | 98fb87b3d78dd4286fb197aa09dcc219d2ba88f2 | [
"MIT"
] | 4 | 2018-10-30T20:56:49.000Z | 2021-02-08T16:55:30.000Z | from django.urls import include, path
urlpatterns = [
path('podcasts/', include('podcast.urls')),
] | 17.5 | 47 | 0.685714 | from django.urls import include, path
urlpatterns = [
path('podcasts/', include('podcast.urls')),
] | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
cd4a96e62a73e56eddc0a9393274d5843bc00335 | 113 | py | Python | Algorithms/canUpdate.py | hectorip/ProjectsLearnPython | 885037d6e855573e58440a1eae7cdc6449f1ba3b | [
"Unlicense"
] | null | null | null | Algorithms/canUpdate.py | hectorip/ProjectsLearnPython | 885037d6e855573e58440a1eae7cdc6449f1ba3b | [
"Unlicense"
] | null | null | null | Algorithms/canUpdate.py | hectorip/ProjectsLearnPython | 885037d6e855573e58440a1eae7cdc6449f1ba3b | [
"Unlicense"
] | null | null | null | canUpdate = lambda n, o, c, u: l(n) == l(o) or not(c or re.search('\W', n) or l(n) in map(l,u))
l = unicode.lower | 56.5 | 95 | 0.575221 | canUpdate = lambda n, o, c, u: l(n) == l(o) or not(c or re.search('\W', n) or l(n) in map(l,u))
l = unicode.lower | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b4cc5f704826342c7ee84491d983a471f3db5aba | 1,233 | py | Python | ROS/dextrobot_ws/src/dextrobot_controller/src/script/imu_raw_subscriber.py | AntoBrandi/Dextro-Bot | 533f873485b1c8d816c6ed368b63c03e476102b9 | [
"MIT",
"Unlicense"
] | 3 | 2021-07-02T15:40:32.000Z | 2022-01-09T15:09:51.000Z | ROS/dextrobot_ws/src/dextrobot_controller/src/script/imu_raw_subscriber.py | AntoBrandi/DextroBot | 533f873485b1c8d816c6ed368b63c03e476102b9 | [
"MIT",
"Unlicense"
] | null | null | null | ROS/dextrobot_ws/src/dextrobot_controller/src/script/imu_raw_subscriber.py | AntoBrandi/DextroBot | 533f873485b1c8d816c6ed368b63c03e476102b9 | [
"MIT",
"Unlicense"
] | 1 | 2021-05-22T09:14:18.000Z | 2021-05-22T09:14:18.000Z | #!/usr/bin/env python
import rospy
pub = None
if __name__ == '__main__':
while not rospy.is_shutdown():
configure() | 26.804348 | 89 | 0.707218 | #!/usr/bin/env python
import rospy
from std_msgs.msg import String
from sensor_msgs.msg import Imu
from tf.transformations import quaternion_from_euler
import math
pub = None
def callback(data):
global pub
readings = data.data.split(",")
sensor_imu = Imu()
# compose the message
sensor_imu.header... | 0 | 0 | 0 | 0 | 0 | 921 | 0 | 41 | 138 |
e59eea894704bd10b2a8fb2bc5f07368e755f37c | 487 | py | Python | mmfewshot/utils/local_seed.py | BIGWangYuDong/mmfewshot | dac097afc92df176bc2de76b7c90968584865197 | [
"Apache-2.0"
] | 376 | 2021-11-23T13:29:57.000Z | 2022-03-30T07:22:14.000Z | mmfewshot/utils/local_seed.py | BIGWangYuDong/mmfewshot | dac097afc92df176bc2de76b7c90968584865197 | [
"Apache-2.0"
] | 51 | 2021-11-23T14:45:08.000Z | 2022-03-30T03:37:15.000Z | mmfewshot/utils/local_seed.py | BIGWangYuDong/mmfewshot | dac097afc92df176bc2de76b7c90968584865197 | [
"Apache-2.0"
] | 56 | 2021-11-23T14:02:27.000Z | 2022-03-31T09:01:50.000Z | # Copyright (c) OpenMMLab. All rights reserved.
| 23.190476 | 59 | 0.679671 | # Copyright (c) OpenMMLab. All rights reserved.
from contextlib import contextmanager
from typing import Optional
import numpy as np
@contextmanager
def local_numpy_seed(seed: Optional[int] = None) -> None:
"""Run numpy codes with a local random seed.
If seed is None, the default random state will be used.
... | 0 | 329 | 0 | 0 | 0 | 0 | 0 | 19 | 90 |
cb53872413fdc9c915d86c2c2593d37658d9a199 | 1,862 | py | Python | getIntrinsics/main.py | EmilRyberg/P7Tiago-PersonFollowing | 5007aa4e0743513c608c734c0a9d1460602e7bce | [
"MIT"
] | 1 | 2020-10-05T10:37:19.000Z | 2020-10-05T10:37:19.000Z | getIntrinsics/main.py | EmilRyberg/P7Tiago-PersonFollowing | 5007aa4e0743513c608c734c0a9d1460602e7bce | [
"MIT"
] | null | null | null | getIntrinsics/main.py | EmilRyberg/P7Tiago-PersonFollowing | 5007aa4e0743513c608c734c0a9d1460602e7bce | [
"MIT"
] | null | null | null | import cv2 as cv
# termination criteria
criteria = (cv.TERM_CRITERIA_EPS + cv.TERM_CRITERIA_MAX_ITER, 30, 0.001)
# Calibrates according to images of a chessboard
if __name__ == "__main__":
get_calibration_matrix(0.017, 6, 8) | 45.414634 | 151 | 0.660043 | import numpy as np
import cv2 as cv
import glob
# termination criteria
criteria = (cv.TERM_CRITERIA_EPS + cv.TERM_CRITERIA_MAX_ITER, 30, 0.001)
# Calibrates according to images of a chessboard
def get_calibration_matrix(calibrationSquareDimension, width, height): #sqaure size in meters, width/height: amount of inter... | 0 | 0 | 0 | 0 | 0 | 1,580 | 0 | -13 | 66 |
acefb4ab14a2e5022543f770a0f9e9dc25121d19 | 11,017 | py | Python | src/k8s-configuration/azext_k8s_configuration/validators.py | calvin197/azure-cli-extensions | 65fac44b8dd0e1523c3866be5ec92eeb9b3a54f5 | [
"MIT"
] | 1 | 2022-02-18T00:16:47.000Z | 2022-02-18T00:16:47.000Z | src/k8s-configuration/azext_k8s_configuration/validators.py | calvin197/azure-cli-extensions | 65fac44b8dd0e1523c3866be5ec92eeb9b3a54f5 | [
"MIT"
] | null | null | null | src/k8s-configuration/azext_k8s_configuration/validators.py | calvin197/azure-cli-extensions | 65fac44b8dd0e1523c3866be5ec92eeb9b3a54f5 | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 35.885993 | 102 | 0.659163 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 0 | 0 | 0 | 0 | 0 | 9,628 | 0 | 239 | 679 |
647f7e6e3f38b64ed9016fcb6d248bcae33939f2 | 3,932 | py | Python | _site/tomat/apps/checkout/views.py | Lisaveta-K/lisaveta-k.github.io | 96306c4d2634d62e6d0ac504aee8ca91f8b3de11 | [
"MIT"
] | null | null | null | _site/tomat/apps/checkout/views.py | Lisaveta-K/lisaveta-k.github.io | 96306c4d2634d62e6d0ac504aee8ca91f8b3de11 | [
"MIT"
] | null | null | null | _site/tomat/apps/checkout/views.py | Lisaveta-K/lisaveta-k.github.io | 96306c4d2634d62e6d0ac504aee8ca91f8b3de11 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import logging
logger = logging.getLogger(__name__)
| 28.70073 | 110 | 0.660224 | # -*- coding: utf-8 -*-
import logging
import requests
import hashlib
from django.http.response import Http404, HttpResponse, HttpResponseRedirect
from django.shortcuts import redirect, render
from django.views.decorators.csrf import csrf_exempt
from django.core.urlresolvers import reverse
from django.conf import set... | 300 | 2,990 | 0 | 0 | 0 | 0 | 0 | 305 | 403 |
6744940fa998af76f0cd406958b718778b9130b8 | 537 | py | Python | shell_.py | Tarkman/Python | d0f4f35460a0a364555220ea7734f660d264fad9 | [
"Apache-2.0"
] | null | null | null | shell_.py | Tarkman/Python | d0f4f35460a0a364555220ea7734f660d264fad9 | [
"Apache-2.0"
] | null | null | null | shell_.py | Tarkman/Python | d0f4f35460a0a364555220ea7734f660d264fad9 | [
"Apache-2.0"
] | null | null | null |
main()
| 23.347826 | 45 | 0.534451 | import os
import shutil
from os import path
def main():
if path.exists("file1.txt"):
src = path.realpath("file1.txt")
head, tail = path.split(src)
print(head)
print(tail)
print(src)
print("making copy of file")
dst=src + ".bak"
shutil.cop... | 0 | 0 | 0 | 0 | 0 | 451 | 0 | -22 | 94 |
07f91f3fabf47cc50b562d68296b25f9dd533c8d | 3,502 | py | Python | anchore_engine/services/simplequeue/__init__.py | bjwschaap/anchore-engine | 0aba1d12d79f63c5919ad301cecc5bd5cc09325a | [
"Apache-2.0"
] | null | null | null | anchore_engine/services/simplequeue/__init__.py | bjwschaap/anchore-engine | 0aba1d12d79f63c5919ad301cecc5bd5cc09325a | [
"Apache-2.0"
] | null | null | null | anchore_engine/services/simplequeue/__init__.py | bjwschaap/anchore-engine | 0aba1d12d79f63c5919ad301cecc5bd5cc09325a | [
"Apache-2.0"
] | null | null | null | import time
# anchore modules
import anchore_engine.services.common
import anchore_engine.subsys.simplequeue
import anchore_engine.subsys.servicestatus
from anchore_engine.subsys import logger
import anchore_engine.subsys.metrics
# A regular queue configuration with no extra features enabled
default_queue_config = {... | 36.479167 | 298 | 0.684752 | import time
# anchore modules
import anchore_engine.services.common
import anchore_engine.subsys.simplequeue
import anchore_engine.subsys.servicestatus
from anchore_engine.subsys import logger
import anchore_engine.subsys.metrics
from anchore_engine.service import ApiService, LifeCycleStages
# A regular queue config... | 0 | 0 | 0 | 822 | 0 | 650 | 0 | 41 | 68 |
db0b3564911ea3a9b83bf1dec13c56b560b1023c | 958 | py | Python | OneRepMax.py | 0rion5/PyHealth | a4fb069a0b97ca057dd279a594b845db6da724f1 | [
"MIT"
] | null | null | null | OneRepMax.py | 0rion5/PyHealth | a4fb069a0b97ca057dd279a594b845db6da724f1 | [
"MIT"
] | null | null | null | OneRepMax.py | 0rion5/PyHealth | a4fb069a0b97ca057dd279a594b845db6da724f1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Dec 6 16:12:04 2019
@author: 0rion
"""
if __name__ == '__main__' :
rm_upper= round(OneRepMax.upper(int(input("Upper Body 4-6 Rep Max in kg: "))))
rm_lower= round(OneRepMax.lower(int(input("Lower Body 4-6 Rep Max in kg: "))))
print("""Recommend... | 29.9375 | 99 | 0.58977 | # -*- coding: utf-8 -*-
"""
Created on Fri Dec 6 16:12:04 2019
@author: 0rion
"""
class OneRepMax:
def __init__(self):
self.data= []
__doc__ = """
This class calculates one rep max for upper body and lower boddy using the users
4-6 rep max in kg.
... | 0 | 0 | 0 | 536 | 0 | 0 | 0 | 0 | 25 |
b16850a8d1daf4f5f1e7f8a68d46747a61fd31ed | 410 | py | Python | main.py | alexandrehsd/em-algorithm | 92b638efd341192af93c39c044e295a89e79a67f | [
"MIT"
] | null | null | null | main.py | alexandrehsd/em-algorithm | 92b638efd341192af93c39c044e295a89e79a67f | [
"MIT"
] | null | null | null | main.py | alexandrehsd/em-algorithm | 92b638efd341192af93c39c044e295a89e79a67f | [
"MIT"
] | null | null | null | import utils
import em
if __name__ == '__main__':
data_seed = 1
X = utils.gen_sample(mean=[-5, 1, 8], std=[1.1, 1.1, 1.2], seed=data_seed, N=600, K=3, dims=1)
model_seed = 2
k = 3 # Number of mixture components (clusters)
gaussian_mixture, responsibilities = utils.init(X, K=k, seed=model_seed)
... | 34.166667 | 98 | 0.680488 | import utils
import em
if __name__ == '__main__':
data_seed = 1
X = utils.gen_sample(mean=[-5, 1, 8], std=[1.1, 1.1, 1.2], seed=data_seed, N=600, K=3, dims=1)
model_seed = 2
k = 3 # Number of mixture components (clusters)
gaussian_mixture, responsibilities = utils.init(X, K=k, seed=model_seed)
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7d7df10c76647aa75c10190225e3db63cdb95128 | 7,597 | py | Python | qiskit/circuit/library/evolved_operator_ansatz.py | Roshan-Thomas/qiskit-terra | 77219b5c7b7146b1545c5e5190739b36f4064b2f | [
"Apache-2.0"
] | 1,456 | 2017-08-05T16:33:05.000Z | 2018-06-05T04:15:35.000Z | qiskit/circuit/library/evolved_operator_ansatz.py | Roshan-Thomas/qiskit-terra | 77219b5c7b7146b1545c5e5190739b36f4064b2f | [
"Apache-2.0"
] | 365 | 2017-08-04T06:09:16.000Z | 2018-06-05T08:33:37.000Z | qiskit/circuit/library/evolved_operator_ansatz.py | Roshan-Thomas/qiskit-terra | 77219b5c7b7146b1545c5e5190739b36f4064b2f | [
"Apache-2.0"
] | 463 | 2017-08-05T04:10:01.000Z | 2018-06-05T06:43:21.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | 35.834906 | 103 | 0.642754 | # This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | 0 | 2,355 | 0 | 3,536 | 0 | 927 | 0 | 78 | 184 |
4be85b2f4312e613d3507600f64670370fdd27f8 | 3,206 | py | Python | code/k_folds_prepare_data.py | krzysztoffiok/MPD-dataset | a130181cefec86415b3b913425fd7cb0c896f6c1 | [
"MIT"
] | null | null | null | code/k_folds_prepare_data.py | krzysztoffiok/MPD-dataset | a130181cefec86415b3b913425fd7cb0c896f6c1 | [
"MIT"
] | null | null | null | code/k_folds_prepare_data.py | krzysztoffiok/MPD-dataset | a130181cefec86415b3b913425fd7cb0c896f6c1 | [
"MIT"
] | 1 | 2021-08-30T04:50:51.000Z | 2021-08-30T04:50:51.000Z | import pandas as pd
import numpy as np
import os
import argparse
"""
The script creates 10 directories with data for subject classification.
The script creates a Monte Carlo Cross Validation split (the same test set for all train/val splits).
Example use:
for preparing MPD data:
python3 k_folds_prepare_data.py --k_f... | 29.412844 | 122 | 0.717405 | import pandas as pd
import numpy as np
from sklearn.model_selection import KFold
import os
import argparse
"""
The script creates 10 directories with data for subject classification.
The script creates a Monte Carlo Cross Validation split (the same test set for all train/val splits).
Example use:
for preparing MPD d... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 20 | 22 |
c57df19131e72c9cca8da9643b0923d371d13ab4 | 1,862 | py | Python | src/cifar.py | bcrafton/speed_read | 3e9c0c873e49e4948a216aae14ec0d4654d1a62c | [
"MIT"
] | null | null | null | src/cifar.py | bcrafton/speed_read | 3e9c0c873e49e4948a216aae14ec0d4654d1a62c | [
"MIT"
] | null | null | null | src/cifar.py | bcrafton/speed_read | 3e9c0c873e49e4948a216aae14ec0d4654d1a62c | [
"MIT"
] | 2 | 2020-11-08T12:51:23.000Z | 2021-12-02T23:16:48.000Z |
################
################
################
################
| 23.56962 | 132 | 0.642857 |
import numpy as np
import tensorflow as tf
from layers import *
from conv import *
from block import *
from model import *
################
def load_inputs(num_example, input_shape, xlow, xhigh):
h, w = input_shape
(_, _), (x_test, y_test) = tf.keras.datasets.cifar10.load_data()
scale = (np.max(x_t... | 0 | 0 | 0 | 0 | 0 | 1,573 | 0 | -9 | 203 |
d14e5af4404d70aff3b642b6d89c4b0e9fb89139 | 9,119 | py | Python | sh-2a.py | DowJhob/renesas-bootmode | 4b2c40cc7d0ba27d73e47dbe008b21d9cbac6ed9 | [
"MIT"
] | 25 | 2018-10-17T19:07:24.000Z | 2022-03-08T04:06:04.000Z | sh-2a.py | DowJhob/renesas-bootmode | 4b2c40cc7d0ba27d73e47dbe008b21d9cbac6ed9 | [
"MIT"
] | 1 | 2021-04-18T23:30:31.000Z | 2021-04-18T23:30:31.000Z | sh-2a.py | gregjhogan/renesas-bootmode | 4b2c40cc7d0ba27d73e47dbe008b21d9cbac6ed9 | [
"MIT"
] | 20 | 2018-10-17T15:19:34.000Z | 2022-01-03T16:27:30.000Z | import serial
SERIALPORT = '/dev/ttyUSB0'
BAUDRATE = 9600
DEBUG = False
if __name__ == "__main__":
# example usage
with serial.Serial(SERIALPORT, BAUDRATE, timeout=0.2) as ser:
handshake(ser)
devices = device_inquiry(ser)
#print("devices: {}".format(devices))
device_select(ser... | 32.222615 | 158 | 0.623862 | import sys
import time
import struct
import serial
from hexdump import hexdump
from tqdm import tqdm
SERIALPORT = '/dev/ttyUSB0'
BAUDRATE = 9600
DEBUG = False
def handshake(ser):
print('[HANDSHAKE]')
ser.reset_input_buffer()
ser.reset_output_buffer()
ser.write(b'\x00' * 30)
get_response(ser, b'\... | 0 | 0 | 0 | 0 | 0 | 6,033 | 0 | -23 | 524 |
c88a1cbff12e05859294a579aa5923a087878f34 | 1,171 | py | Python | services/files/files/__init__.py | Open-EO/openeo-openshift-driver | 822dbd3ccee25180cc48efd2f891504b6b5edc14 | [
"Apache-2.0"
] | 6 | 2018-10-02T15:04:11.000Z | 2019-12-13T11:36:49.000Z | services/files/files/__init__.py | Open-EO/openeo-openshift-driver | 822dbd3ccee25180cc48efd2f891504b6b5edc14 | [
"Apache-2.0"
] | 54 | 2019-01-09T17:14:29.000Z | 2020-10-02T11:39:38.000Z | services/files/files/__init__.py | Open-EO/openeo-openshift-driver | 822dbd3ccee25180cc48efd2f891504b6b5edc14 | [
"Apache-2.0"
] | 6 | 2018-07-03T15:58:05.000Z | 2019-07-03T07:20:46.000Z | """The jobs package is a :py:mod:`nameko` microservice which handles user file management.
This service manages all file interactions. This includes both explicit user interaction with his/her files and managing
files generated by jobs.
To run this microservice it needs to connect to a message broker - `RabbitMQ`_ is... | 58.55 | 121 | 0.796755 | """The jobs package is a :py:mod:`nameko` microservice which handles user file management.
This service manages all file interactions. This includes both explicit user interaction with his/her files and managing
files generated by jobs.
To run this microservice it needs to connect to a message broker - `RabbitMQ`_ is... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
44b9aad3ad2bd7df92bf1f9b118caa586e65014b | 499 | py | Python | MITx-6.00.1x-EDX-Introduction-to-Computer-Science/Quiz/problem5.py | lilsweetcaligula/MIT6.00.1x | ee2902782a08ff685e388b2f40c09ea8c9c5fcfe | [
"MIT"
] | null | null | null | MITx-6.00.1x-EDX-Introduction-to-Computer-Science/Quiz/problem5.py | lilsweetcaligula/MIT6.00.1x | ee2902782a08ff685e388b2f40c09ea8c9c5fcfe | [
"MIT"
] | null | null | null | MITx-6.00.1x-EDX-Introduction-to-Computer-Science/Quiz/problem5.py | lilsweetcaligula/MIT6.00.1x | ee2902782a08ff685e388b2f40c09ea8c9c5fcfe | [
"MIT"
] | null | null | null | """
Quiz Problem 5
Write a Python function that returns the sublist of strings in aList
that contain fewer than 4 characters. For example, if
aList = ["apple", "cat", "dog", "banana"]
- your function should return: ["cat", "dog"]
This function takes in a list of strings and returns a list of
strings. Your func... | 23.761905 | 69 | 0.655311 | """
Quiz Problem 5
Write a Python function that returns the sublist of strings in aList
that contain fewer than 4 characters. For example, if
aList = ["apple", "cat", "dog", "banana"]
- your function should return: ["cat", "dog"]
This function takes in a list of strings and returns a list of
strings. Your func... | 0 | 0 | 0 | 0 | 0 | 122 | 0 | 0 | 23 |
c2095b6cfe756bec4502b30e87823befc015ec75 | 311 | py | Python | PycharmProjects/cursoemVideo/aula017b.py | Pablodias147/Python3-Curso | 486db10e9ffb69aa60aaf36f32d764c1b5585c8b | [
"MIT"
] | null | null | null | PycharmProjects/cursoemVideo/aula017b.py | Pablodias147/Python3-Curso | 486db10e9ffb69aa60aaf36f32d764c1b5585c8b | [
"MIT"
] | null | null | null | PycharmProjects/cursoemVideo/aula017b.py | Pablodias147/Python3-Curso | 486db10e9ffb69aa60aaf36f32d764c1b5585c8b | [
"MIT"
] | null | null | null | valores = list()
valores.append(5)
for cont in range(0, 5):
valores.append(int(input("Digite um valor:")))
for v, c in enumerate(valores):
print(f'Na posio {v} encontrei o valor {c}')
print("Chegeui no final da lista")
a = [1, 4, 6, 8]
b = a[:]
b[2] = 8
print(f'Lista A: {a}')
print(f'Lista B: {b}') | 22.214286 | 50 | 0.617363 | valores = list()
valores.append(5)
for cont in range(0, 5):
valores.append(int(input("Digite um valor:")))
for v, c in enumerate(valores):
print(f'Na posição {v} encontrei o valor {c}')
print("Chegeui no final da lista")
a = [1, 4, 6, 8]
b = a[:]
b[2] = 8
print(f'Lista A: {a}')
print(f'Lista B: {b}') | 4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f887baa8ff58cc1b1a320f803b94918a332c8f44 | 85 | py | Python | dev.py | wabscale/tandon.singles | 5d83b5c5d3b6aa8e67d781223e99512c78165c22 | [
"MIT"
] | 1 | 2022-02-25T02:12:18.000Z | 2022-02-25T02:12:18.000Z | dev.py | wabscale/tandon.singles | 5d83b5c5d3b6aa8e67d781223e99512c78165c22 | [
"MIT"
] | null | null | null | dev.py | wabscale/tandon.singles | 5d83b5c5d3b6aa8e67d781223e99512c78165c22 | [
"MIT"
] | null | null | null | from web import app
app.run(
debug=True,
host='127.0.0.1',
port=5000,
)
| 10.625 | 21 | 0.576471 | from web import app
app.run(
debug=True,
host='127.0.0.1',
port=5000,
)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
27b2424e09f54bdb240533385118175b4893ec1b | 5,300 | py | Python | COT/vm_description/ovf/utilities.py | morneaup/cot | 3d4dc7079a33aa0c09216ec339b44f84ab69ff4b | [
"MIT"
] | 81 | 2015-01-18T22:31:42.000Z | 2022-03-14T12:34:33.000Z | COT/vm_description/ovf/utilities.py | morneaup/cot | 3d4dc7079a33aa0c09216ec339b44f84ab69ff4b | [
"MIT"
] | 67 | 2015-01-05T15:24:39.000Z | 2021-08-16T12:44:58.000Z | COT/vm_description/ovf/utilities.py | morneaup/cot | 3d4dc7079a33aa0c09216ec339b44f84ab69ff4b | [
"MIT"
] | 20 | 2015-07-09T14:20:25.000Z | 2021-09-18T17:59:57.000Z | #!/usr/bin/env python
#
# utilities.py - Module providing utility functions for OVF/OVA handling
#
# February 2017, Glenn F. Matthews
# Copyright (c) 2013-2017 the COT project developers.
# See the COPYRIGHT.txt file at the top-level directory of this distribution
# and at https://github.com/glennmatthews/cot/blob/mast... | 31.176471 | 78 | 0.640377 | #!/usr/bin/env python
#
# utilities.py - Module providing utility functions for OVF/OVA handling
#
# February 2017, Glenn F. Matthews
# Copyright (c) 2013-2017 the COT project developers.
# See the COPYRIGHT.txt file at the top-level directory of this distribution
# and at https://github.com/glennmatthews/cot/blob/mast... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
96193d258d8ae4c1b88cb6642d581c3527dc14cb | 8,128 | py | Python | nn/unittest_nn_modifier_class.py | DRealArun/nasbot | 6eb26ee44bf171205b9df2fe29af90ecbd2abb65 | [
"MIT"
] | null | null | null | nn/unittest_nn_modifier_class.py | DRealArun/nasbot | 6eb26ee44bf171205b9df2fe29af90ecbd2abb65 | [
"MIT"
] | null | null | null | nn/unittest_nn_modifier_class.py | DRealArun/nasbot | 6eb26ee44bf171205b9df2fe29af90ecbd2abb65 | [
"MIT"
] | null | null | null | """
Unit tests for the class NNModifier in nn_modifiers.py
-- kandasamy@cs.cmu.edu
"""
# pylint: disable=invalid-name
from copy import deepcopy
import numpy as np
import os
# Local imports
from nn.neural_network import NeuralNetwork
from nn.nn_visualise import visualise_nn
from utils.base_test_class import execut... | 42.554974 | 90 | 0.700172 | """
Unit tests for the class NNModifier in nn_modifiers.py
-- kandasamy@cs.cmu.edu
"""
# pylint: disable=invalid-name
from copy import deepcopy
import numpy as np
import os
import six
from shutil import rmtree
# Local imports
from nn import nn_constraint_checkers
from nn import nn_modifiers
from nn.neural_network... | 0 | 0 | 0 | 5,716 | 0 | 0 | 0 | 99 | 133 |
acade4bc7d6d5678e24e0c5d4046c54e09fc9b97 | 647 | py | Python | bluebottle/time_based/migrations/0022_auto_20201102_1559.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 10 | 2015-05-28T18:26:40.000Z | 2021-09-06T10:07:03.000Z | bluebottle/time_based/migrations/0022_auto_20201102_1559.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 762 | 2015-01-15T10:00:59.000Z | 2022-03-31T15:35:14.000Z | bluebottle/time_based/migrations/0022_auto_20201102_1559.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 9 | 2015-02-20T13:19:30.000Z | 2022-03-08T14:09:17.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2020-11-02 14:59
from __future__ import unicode_literals
| 23.107143 | 50 | 0.590417 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2020-11-02 14:59
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('activities', '0027_contributionvalue'),
('time_based', '0021_auto_20201102_1357'),
]
... | 0 | 0 | 0 | 475 | 0 | 0 | 0 | 11 | 46 |
6a270d12f46525f51c519074201496993fbce011 | 208 | py | Python | 3 - Strings/1871.py | andrematte/uri-submissions | 796e7fee56650d9e882880318d6e7734038be2dc | [
"MIT"
] | 1 | 2020-09-09T12:48:09.000Z | 2020-09-09T12:48:09.000Z | 3 - Strings/1871.py | andrematte/uri-submissions | 796e7fee56650d9e882880318d6e7734038be2dc | [
"MIT"
] | null | null | null | 3 - Strings/1871.py | andrematte/uri-submissions | 796e7fee56650d9e882880318d6e7734038be2dc | [
"MIT"
] | null | null | null | # URI Online Judge 1871
while True:
entrada = [int(i) for i in input().split()]
if entrada[0] == 0 and entrada[1] == 0:
break
soma = str(sum(entrada)).replace('0','')
print(soma) | 23.111111 | 47 | 0.557692 | # URI Online Judge 1871
while True:
entrada = [int(i) for i in input().split()]
if entrada[0] == 0 and entrada[1] == 0:
break
soma = str(sum(entrada)).replace('0','')
print(soma) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bea2da066580bb5e7317a50f7b8c2adf5b500efb | 1,407 | py | Python | hippy/module/spl/arrayiter.py | shendel/hippyvm | 26cc6675612e4ddc4d1b425d2731d34c97355c45 | [
"MIT"
] | 1 | 2021-07-28T01:10:41.000Z | 2021-07-28T01:10:41.000Z | hippy/module/spl/arrayiter.py | shendel/hippyvm | 26cc6675612e4ddc4d1b425d2731d34c97355c45 | [
"MIT"
] | null | null | null | hippy/module/spl/arrayiter.py | shendel/hippyvm | 26cc6675612e4ddc4d1b425d2731d34c97355c45 | [
"MIT"
] | null | null | null | from hippy.klass import def_class
from hippy import consts
k_ArrayIterator = def_class('ArrayIterator', [
ArrayIterator_construct,
ArrayIterator_current,
ArrayIterator_next,
ArrayIterator_key,
ArrayIterator_rewind,
ArrayIterator_valid],
[('storage', consts.AC... | 24.258621 | 63 | 0.7285 | from hippy.builtin_klass import wrap_method
from hippy.builtin import ThisUnwrapper, Optional
from hippy.klass import def_class
from hippy.objects.base import W_Root
from hippy.objects.instanceobject import W_InstanceObject
from hippy import consts
class W_ApplevelArrayIterator(W_InstanceObject):
pass
@wrap_met... | 0 | 613 | 0 | 36 | 0 | 0 | 0 | 102 | 249 |
f568ff1095d2b9d5726ac3f3a52e30492b21e162 | 928 | py | Python | baker/main.py | guidodizi/NLPEconomyIndicator | ee7e9dd06fa3f9277ad81128010ba093087b0ed8 | [
"Apache-2.0"
] | 1 | 2019-04-10T14:05:32.000Z | 2019-04-10T14:05:32.000Z | baker/main.py | guidodizi/NLPEconomyIndicator | ee7e9dd06fa3f9277ad81128010ba093087b0ed8 | [
"Apache-2.0"
] | null | null | null | baker/main.py | guidodizi/NLPEconomyIndicator | ee7e9dd06fa3f9277ad81128010ba093087b0ed8 | [
"Apache-2.0"
] | 1 | 2018-05-26T04:45:55.000Z | 2018-05-26T04:45:55.000Z | # -*- coding: utf-8 -*-
import news_processor
import results_processor
import settings
import time
# MAIN (Baker method)
print_presentation()
settings.init()
# Input sections
option = options_input_section()
if (option == "generar_epu"):
# Generate EPU index from individual newspaper results
start_time = tim... | 26.514286 | 93 | 0.751078 | # -*- coding: utf-8 -*-
import news_processor
import results_processor
import settings
import time
from helper_methods import *
# MAIN (Baker method)
print_presentation()
settings.init()
# Input sections
option = options_input_section()
if (option == "generar_epu"):
# Generate EPU index from individual newspaper... | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | 22 |
967c5b09b7e100ecc5b75046dbb3d498517ca5e5 | 1,847 | py | Python | python/phonenumbers/data/region_HN.py | chronossc/python-phonenumbers | 2ea483bfa9ac19144183dadaa7cafb2772a72bfe | [
"Apache-2.0"
] | 1 | 2016-11-20T00:50:06.000Z | 2016-11-20T00:50:06.000Z | python/phonenumbers/data/region_HN.py | chronossc/python-phonenumbers | 2ea483bfa9ac19144183dadaa7cafb2772a72bfe | [
"Apache-2.0"
] | null | null | null | python/phonenumbers/data/region_HN.py | chronossc/python-phonenumbers | 2ea483bfa9ac19144183dadaa7cafb2772a72bfe | [
"Apache-2.0"
] | null | null | null | """Auto-generated file, do not edit by hand. HN metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_HN = PhoneMetadata(id='HN', country_code=504, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[237-9]\\d{7}', possible_number_pattern=... | 97.210526 | 356 | 0.743909 | """Auto-generated file, do not edit by hand. HN metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_HN = PhoneMetadata(id='HN', country_code=504, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[237-9]\\d{7}', possible_number_pattern=... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
63a86525a1590320f8c66ae6d0db37f32f31ca9e | 1,754 | py | Python | tests/report_tests.py | Alexceptional/jpmorgan-technical-test | 74fcfbdb9cc3c52215111bf7c34ce29859d8e46c | [
"MIT"
] | null | null | null | tests/report_tests.py | Alexceptional/jpmorgan-technical-test | 74fcfbdb9cc3c52215111bf7c34ce29859d8e46c | [
"MIT"
] | null | null | null | tests/report_tests.py | Alexceptional/jpmorgan-technical-test | 74fcfbdb9cc3c52215111bf7c34ce29859d8e46c | [
"MIT"
] | null | null | null | import unittest
if __name__ == '__main__':
unittest.main()
| 22.487179 | 88 | 0.604333 | import unittest
from report import Instruction
import datetime
class TestInstruction(unittest.TestCase):
# Default data:
data = {
'entity': 'test',
'buy_sell': 'B',
'agreed_fx': 1.5,
'currency': 'GBP',
'instr_date': '01-Jan-17',
'settle_date': '02-Jan-17',
... | 0 | 0 | 0 | 1,617 | 0 | 0 | 0 | 3 | 68 |
1fe7ee4e2a396e2d0d83bca2394f0b87d21b88b5 | 9,165 | py | Python | test.and.py | aws-lumberyard-dev/o3de-azslc | bafacbe822da625da22ceba09e8fcdcf18d8d09b | [
"Apache-2.0",
"MIT"
] | 13 | 2021-07-23T00:11:20.000Z | 2022-02-09T07:59:20.000Z | test.and.py | aws-lumberyard-dev/o3de-azslc | bafacbe822da625da22ceba09e8fcdcf18d8d09b | [
"Apache-2.0",
"MIT"
] | 10 | 2021-09-14T12:12:22.000Z | 2022-03-30T21:27:10.000Z | test.and.py | aws-lumberyard-dev/o3de-azslc | bafacbe822da625da22ceba09e8fcdcf18d8d09b | [
"Apache-2.0",
"MIT"
] | 5 | 2021-07-19T23:49:51.000Z | 2021-12-02T05:13:35.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import sys
import os
import platform
import subprocess
import os.... | 42.827103 | 164 | 0.599564 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import sys
import os
import platform
import datetime
import subpr... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 | 140 |
83215c049f0937f6b28fa3695b199e334b96dc9c | 6,904 | py | Python | axonius_api_client/api/api_endpoint.py | kf-careem/axonius_api_client | 27767c896ca446e74ca5d69e087e1a0dcf7157ec | [
"MIT"
] | 11 | 2020-01-31T00:28:26.000Z | 2022-03-25T20:27:08.000Z | axonius_api_client/api/api_endpoint.py | kf-careem/axonius_api_client | 27767c896ca446e74ca5d69e087e1a0dcf7157ec | [
"MIT"
] | 83 | 2020-01-22T12:52:38.000Z | 2022-02-07T16:20:18.000Z | axonius_api_client/api/api_endpoint.py | kf-careem/axonius_api_client | 27767c896ca446e74ca5d69e087e1a0dcf7157ec | [
"MIT"
] | 16 | 2019-08-23T17:44:31.000Z | 2022-01-06T00:57:34.000Z | # -*- coding: utf-8 -*-
"""Models for API requests & responses."""
| 33.192308 | 99 | 0.600666 | # -*- coding: utf-8 -*-
"""Models for API requests & responses."""
import dataclasses
import logging
from typing import List, Optional, Union
from ..exceptions import ApiError, InvalidCredentials, JsonInvalid, ResponseNotOk
from ..http import Http
from ..logs import get_obj_log
from ..tools import combo_dicts, json_re... | 0 | 6,532 | 0 | 0 | 0 | 0 | 0 | 104 | 200 |
96ed00c3ac935b09eaf134a4e91a7b9b0e4ca2a9 | 2,367 | py | Python | GameOfLife/functions.py | Renanrbsc/Intro_Pygame | cca4b01189bbc57d00fea2dac83b8386bdaed2e3 | [
"MIT"
] | null | null | null | GameOfLife/functions.py | Renanrbsc/Intro_Pygame | cca4b01189bbc57d00fea2dac83b8386bdaed2e3 | [
"MIT"
] | null | null | null | GameOfLife/functions.py | Renanrbsc/Intro_Pygame | cca4b01189bbc57d00fea2dac83b8386bdaed2e3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
def cell_check(section):
'''
Executa as regras do game of life em um recorte 3x3 para
saber o estado da clula central
'''
# contador de vizinhos
neighbors = 0
# referncia para o centro do recorte
center = section[1][1]
# somando todos os elementos do grupo
... | 31.986486 | 76 | 0.653992 | # -*- coding: utf-8 -*-
def cell_check(section):
'''
Executa as regras do game of life em um recorte 3x3 para
saber o estado da célula central
'''
# contador de vizinhos
neighbors = 0
# referência para o centro do recorte
center = section[1][1]
# somando todos os elementos do grupo... | 84 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
77dc8ee430589ef0a492839854051a50daaad8eb | 2,241 | py | Python | extractor/sample_project/main.py | eddieir/Signure_extraction_detection | 1ae68946833abbf9f805826444891d43a1b1889f | [
"MIT"
] | 291 | 2018-11-27T05:06:38.000Z | 2022-03-25T08:45:50.000Z | sample_project/main.py | maky-hnou/signature_extractor | ca9b456df7bde9fbd55ab9fe6f882672da848dbf | [
"MIT"
] | 10 | 2019-04-30T16:01:44.000Z | 2021-12-18T02:57:24.000Z | sample_project/main.py | maky-hnou/signature_extractor | ca9b456df7bde9fbd55ab9fe6f882672da848dbf | [
"MIT"
] | 109 | 2018-11-18T03:40:14.000Z | 2022-03-04T08:56:03.000Z | #!/usr/bin/python
"""Python main file."""
# -*- coding: utf-8 -*-
# -----------------------------------------
# author : Ahmet Ozlu
# mail : ahmetozlu93@gmail.com
# date : 05.05.2019
# -----------------------------------------
import color_correlation
import cv2
import dewapper
import signature_extr... | 38.637931 | 76 | 0.652387 | #!/usr/bin/python
"""Python main file."""
# -*- coding: utf-8 -*-
# -----------------------------------------
# author : Ahmet Ozlu
# mail : ahmetozlu93@gmail.com
# date : 05.05.2019
# -----------------------------------------
import color_correlation
import cv2
import dewapper
import signature_extr... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d2a0669971a9e125187002c71d73fdd34eab2aed | 1,889 | py | Python | scripts/05_modules/lod_object/lodobject_objectlist_r19.py | youdiaozi/cinema4d_py_sdk_extended | 2ac9af05d450bda3351c776a3a75e0993c01a5cc | [
"Apache-2.0"
] | 1 | 2019-12-27T13:53:18.000Z | 2019-12-27T13:53:18.000Z | scripts/05_modules/lod_object/lodobject_objectlist_r19.py | ZeusbasePython/cinema4d_py_sdk_extended | 2ac9af05d450bda3351c776a3a75e0993c01a5cc | [
"Apache-2.0"
] | null | null | null | scripts/05_modules/lod_object/lodobject_objectlist_r19.py | ZeusbasePython/cinema4d_py_sdk_extended | 2ac9af05d450bda3351c776a3a75e0993c01a5cc | [
"Apache-2.0"
] | 1 | 2020-01-28T15:16:28.000Z | 2020-01-28T15:16:28.000Z | """
Copyright: MAXON Computer GmbH
Author: Yannick Puech
Description:
- Configures the active LOD object to use "Manual Groups".
- The selected objects referenced in the objects list are moved under the LOD object and are referenced in each group.
Class/method highlighted:
- LodObject.GetManualModeObjectL... | 26.985714 | 122 | 0.670725 | """
Copyright: MAXON Computer GmbH
Author: Yannick Puech
Description:
- Configures the active LOD object to use "Manual Groups".
- The selected objects referenced in the objects list are moved under the LOD object and are referenced in each group.
Class/method highlighted:
- LodObject.GetManualModeObjectL... | 0 | 0 | 0 | 0 | 0 | 1,430 | 0 | -11 | 45 |
017373f0fa06e092f135c929c4c616517b8d9e22 | 1,261 | py | Python | blogvlog/blog/urls.py | subrat82/all-in-one | e13c46334b8d02cb3e7fc5038ed747cee90d06ab | [
"0BSD"
] | null | null | null | blogvlog/blog/urls.py | subrat82/all-in-one | e13c46334b8d02cb3e7fc5038ed747cee90d06ab | [
"0BSD"
] | null | null | null | blogvlog/blog/urls.py | subrat82/all-in-one | e13c46334b8d02cb3e7fc5038ed747cee90d06ab | [
"0BSD"
] | null | null | null | from django.urls import path, include
from . import views
urlpatterns = [
path('', views.Homepage.as_view(), name='homepage'),
path('aboutus', views.AboutUs.as_view(), name="aboutus"),
path('post/<int:pk>', views.PostDetail, name='postdetail'),
path('newpost', views.newpost, name='newpost'),
path('... | 52.541667 | 103 | 0.689136 | from django.urls import path, include
from blog import urls
from . import views
urlpatterns = [
path('', views.Homepage.as_view(), name='homepage'),
path('aboutus', views.AboutUs.as_view(), name="aboutus"),
path('post/<int:pk>', views.PostDetail, name='postdetail'),
path('newpost', views.newpost, name=... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 22 |
526b029239bfd2c27a8df38184e0ef3650b6a195 | 115 | py | Python | tests/conftest.py | kocunop/puresnmp | 737cb2eebacff7fa6a94de824fbd53e2ec742e47 | [
"MIT"
] | 66 | 2016-09-10T16:38:50.000Z | 2022-03-24T12:04:56.000Z | tests/conftest.py | kocunop/puresnmp | 737cb2eebacff7fa6a94de824fbd53e2ec742e47 | [
"MIT"
] | 91 | 2016-09-12T03:02:08.000Z | 2022-01-20T11:52:42.000Z | tests/conftest.py | kocunop/puresnmp | 737cb2eebacff7fa6a94de824fbd53e2ec742e47 | [
"MIT"
] | 22 | 2016-09-12T03:53:41.000Z | 2021-07-15T06:40:45.000Z | """
Global configuration for pytest
"""
collect_ignore = [
"test_aio_pythonized.py",
"test_aio_raw.py",
]
| 12.777778 | 31 | 0.669565 | """
Global configuration for pytest
"""
collect_ignore = [
"test_aio_pythonized.py",
"test_aio_raw.py",
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9260a284b3d4385c9877b1f4886c06a29a2ecdab | 1,880 | py | Python | credential.py | HeshamBahgat/VLANs-Tool | 6b35b289b3abcf4f7d37c2b1a831329d3fdff920 | [
"MIT"
] | null | null | null | credential.py | HeshamBahgat/VLANs-Tool | 6b35b289b3abcf4f7d37c2b1a831329d3fdff920 | [
"MIT"
] | null | null | null | credential.py | HeshamBahgat/VLANs-Tool | 6b35b289b3abcf4f7d37c2b1a831329d3fdff920 | [
"MIT"
] | null | null | null | from colorama import init
init()
# Getting user Credentials
| 32.413793 | 105 | 0.560638 | from valid_ip import Validate_IP
import getpass
from colorama import init, deinit, Fore, Style
init()
# Getting user Credentials
class Get_Credential(Validate_IP):
def __init__(self):
print(Fore.MAGENTA + f"Getting IP Address, UserName, Password for all Switches & MySQL Database")
def switches_creden... | 0 | 0 | 0 | 1,726 | 0 | 0 | 0 | 25 | 66 |
44cc718695991f468403d5a5a1180ff73670ab23 | 360 | py | Python | dashboard_scripts/date.py | fgrando/Dashboard | fe93bf1cf2e171cb98dbbbac62326c0db3fd4abc | [
"MIT"
] | null | null | null | dashboard_scripts/date.py | fgrando/Dashboard | fe93bf1cf2e171cb98dbbbac62326c0db3fd4abc | [
"MIT"
] | null | null | null | dashboard_scripts/date.py | fgrando/Dashboard | fe93bf1cf2e171cb98dbbbac62326c0db3fd4abc | [
"MIT"
] | null | null | null | # DASHBOARD SCRIPT - do not use print()
RESULT = []
# - - - - - - - - - - - - - - - - - - - - - - - - - -
# put your code below:
RESULT= get_win_date()
| 25.714286 | 77 | 0.536111 | # DASHBOARD SCRIPT - do not use print()
RESULT = []
# - - - - - - - - - - - - - - - - - - - - - - - - - -
# put your code below:
import subprocess
def get_win_date():
ret = subprocess.run(['date', '/T'], stdout=subprocess.PIPE, shell=True)
txt = ret.stdout.decode("utf-8").strip()
#print(txt)
... | 0 | 0 | 0 | 0 | 0 | 156 | 0 | -4 | 48 |
29aabc344b88b707f5742307137f2a4607425fb3 | 482 | py | Python | for python/data/dzhan/pframe.py | aerolalit/Auto-Testing-Python-Programs | dd49ab266c9f0fd8e34278f68f8af017711942e3 | [
"MIT"
] | 4 | 2019-10-03T21:16:51.000Z | 2019-10-04T01:28:08.000Z | for python/data/dzhan/pframe.py | aerolalit/Auto-Testing | dd49ab266c9f0fd8e34278f68f8af017711942e3 | [
"MIT"
] | null | null | null | for python/data/dzhan/pframe.py | aerolalit/Auto-Testing | dd49ab266c9f0fd8e34278f68f8af017711942e3 | [
"MIT"
] | null | null | null | # 350111
# a3_p10.py
# Dazhi Zhan
# d.zhan@jacobs-university.de
x = input('please enter the length ')
x = int(x)
y = input('please enter the width ')
y = int(y)
z = input('please enter a character ')
z = str(z)
print_frame(x, y, z)
| 21.909091 | 41 | 0.454357 | # 350111
# a3_p10.py
# Dazhi Zhan
# d.zhan@jacobs-university.de
x = input('please enter the length ')
x = int(x)
y = input('please enter the width ')
y = int(y)
z = input('please enter a character ')
z = str(z)
def print_frame(n, m, c):
i = 1
while i <= n:
if i == 1:
print(c * ... | 0 | 0 | 0 | 0 | 0 | 204 | 0 | 0 | 23 |
10bee7529efdc2f7be085d16b8cfaceec627b2f4 | 262 | py | Python | model_raisim/LISM_1D/urdf/BlackPanther_V5/__init__.py | Stylite-Y/XArm-Simulation | 654dca390e635b6294a8b5066727d0f4d6736eb1 | [
"MIT"
] | null | null | null | model_raisim/LISM_1D/urdf/BlackPanther_V5/__init__.py | Stylite-Y/XArm-Simulation | 654dca390e635b6294a8b5066727d0f4d6736eb1 | [
"MIT"
] | null | null | null | model_raisim/LISM_1D/urdf/BlackPanther_V5/__init__.py | Stylite-Y/XArm-Simulation | 654dca390e635b6294a8b5066727d0f4d6736eb1 | [
"MIT"
] | null | null | null | import os
__BLACKPANTHER_V5_RESOURCE_DIRECTORY__ = os.path.dirname(os.path.abspath(__file__)) + '/urdf'
# For compilation, this is not necessary.
# When writing your own training program, you need the default configuration to use this
| 37.428571 | 93 | 0.79771 | import os
from _raisim_gym import *
__BLACKPANTHER_V5_RESOURCE_DIRECTORY__ = os.path.dirname(os.path.abspath(__file__)) + '/urdf'
# For compilation, this is not necessary.
# When writing your own training program, you need the default configuration to use this
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 22 |
8a9d3b64d42c5747e8c92733cd39eb3f1fa583a7 | 1,442 | py | Python | gps_nav/transform_geo_to_carla_xyz.py | heng2j/delamain | 9eb522358fa4c253d74bca185b654522fc63f7f7 | [
"MIT"
] | 2 | 2021-02-07T19:19:45.000Z | 2021-05-04T14:28:28.000Z | gps_nav/transform_geo_to_carla_xyz.py | DevGlitch/delamain | 9eb522358fa4c253d74bca185b654522fc63f7f7 | [
"MIT"
] | null | null | null | gps_nav/transform_geo_to_carla_xyz.py | DevGlitch/delamain | 9eb522358fa4c253d74bca185b654522fc63f7f7 | [
"MIT"
] | 1 | 2021-05-15T18:37:33.000Z | 2021-05-15T18:37:33.000Z | """
Transforming Geolocation (altitude, longitude, altitude) to Carla Location (x, y, z)
Based on the carla function _location_to_gps
https://github.com/carla-simulator/scenario_runner/blob/master/srunner/tools/route_manipulation.py
Adapted by DevGlitch
"""
import math
def from_gps_to_xyz(latitude: float, longitud... | 29.428571 | 102 | 0.679612 | """
Transforming Geolocation (altitude, longitude, altitude) to Carla Location (x, y, z)
Based on the carla function _location_to_gps
https://github.com/carla-simulator/scenario_runner/blob/master/srunner/tools/route_manipulation.py
Adapted by DevGlitch
"""
import math
def from_gps_to_xyz(latitude: float, longitud... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
829d66835f230ecf45d8bc2533038f05664f6cad | 2,003 | py | Python | kitsune/questions/marketplace.py | jgmize/kitsune | 8f23727a9c7fcdd05afc86886f0134fb08d9a2f0 | [
"BSD-3-Clause"
] | 2 | 2019-08-19T17:08:47.000Z | 2019-10-05T11:37:02.000Z | kitsune/questions/marketplace.py | jgmize/kitsune | 8f23727a9c7fcdd05afc86886f0134fb08d9a2f0 | [
"BSD-3-Clause"
] | null | null | null | kitsune/questions/marketplace.py | jgmize/kitsune | 8f23727a9c7fcdd05afc86886f0134fb08d9a2f0 | [
"BSD-3-Clause"
] | null | null | null | import logging
from django.conf import settings
from django.utils.datastructures import SortedDict
from statsd import statsd
from tower import ugettext_lazy as _lazy
from zendesk import Zendesk, ZendeskError
log = logging.getLogger('k.questions.marketplace')
MARKETPLACE_CATEGORIES = SortedDict([
('payments', ... | 29.028986 | 68 | 0.690464 | import logging
from django.conf import settings
from django.utils.datastructures import SortedDict
from statsd import statsd
from tower import ugettext_lazy as _lazy
from zendesk import Zendesk, ZendeskError
log = logging.getLogger('k.questions.marketplace')
MARKETPLACE_CATEGORIES = SortedDict([
('payments', ... | 0 | 0 | 0 | 62 | 0 | 0 | 0 | 0 | 23 |
d5a16f01d25f1d75d0106a9d5767ae7ded408496 | 639 | py | Python | data/mat.py | loadder/skiprnn_pytorch | f718da9ab5d4af0ff2cfe6e4288601972c273e54 | [
"MIT"
] | null | null | null | data/mat.py | loadder/skiprnn_pytorch | f718da9ab5d4af0ff2cfe6e4288601972c273e54 | [
"MIT"
] | null | null | null | data/mat.py | loadder/skiprnn_pytorch | f718da9ab5d4af0ff2cfe6e4288601972c273e54 | [
"MIT"
] | null | null | null | import numpy as np
import scipy.io as sio
npy_root = '../../skating/c3d_feat/'
f = open("annotations.txt").readlines()
max_feats = []
avr_feats = []
scores = []
for line in f:
items = line.strip().split(' ')
scores.append(float(items[1]))
feat_file = items[0] + '.npy'
feat = np.load(npy_root + feat_file... | 26.625 | 61 | 0.665102 | import numpy as np
import scipy.io as sio
import os
npy_root = '../../skating/c3d_feat/'
f = open("annotations.txt").readlines()
max_feats = []
avr_feats = []
scores = []
for line in f:
items = line.strip().split(' ')
scores.append(float(items[1]))
feat_file = items[0] + '.npy'
feat = np.load(npy_root +... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -12 | 22 |
f4fe90855e531278c3766da444ddc3b17e83e8ba | 1,220 | py | Python | mergeH5.py | greatofdream/pmtTest | d8f1fc8e94c3999516b6eef01e228311e6135053 | [
"MIT"
] | null | null | null | mergeH5.py | greatofdream/pmtTest | d8f1fc8e94c3999516b6eef01e228311e6135053 | [
"MIT"
] | null | null | null | mergeH5.py | greatofdream/pmtTest | d8f1fc8e94c3999516b6eef01e228311e6135053 | [
"MIT"
] | null | null | null | import h5py, argparse, numpy as np
psr = argparse.ArgumentParser()
psr.add_argument('-i', dest='ipt', nargs='+', help='input h5 file')
psr.add_argument('-o', dest='opt', help='output h5 file')
args = psr.parse_args()
length = 0
dtype = []
length = []
index = []
info = []
with h5py.File(args.ipt[0], 'r') as ipt:
key... | 32.972973 | 76 | 0.592623 | import h5py, argparse, numpy as np
psr = argparse.ArgumentParser()
psr.add_argument('-i', dest='ipt', nargs='+', help='input h5 file')
psr.add_argument('-o', dest='opt', help='output h5 file')
args = psr.parse_args()
length = 0
dtype = []
length = []
index = []
info = []
with h5py.File(args.ipt[0], 'r') as ipt:
key... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9257ecb9f1fb4a86a3678372ffac3403ccf74fc8 | 960 | py | Python | python/cendalytics/wikipedia/scripts/run_spacy_ner.py | jiportilla/ontology | 8a66bb7f76f805c64fc76cfc40ab7dfbc1146f40 | [
"MIT"
] | null | null | null | python/cendalytics/wikipedia/scripts/run_spacy_ner.py | jiportilla/ontology | 8a66bb7f76f805c64fc76cfc40ab7dfbc1146f40 | [
"MIT"
] | null | null | null | python/cendalytics/wikipedia/scripts/run_spacy_ner.py | jiportilla/ontology | 8a66bb7f76f805c64fc76cfc40ab7dfbc1146f40 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
IS_DEBUG = True
IGNORE_CACHE = True
ONTOLOGY_NAME = "biotech"
if __name__ == "__main__":
import plac
plac.call(main)
| 26.666667 | 136 | 0.613542 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import spacy
IS_DEBUG = True
IGNORE_CACHE = True
ONTOLOGY_NAME = "biotech"
def main():
nlp = spacy.load("en_core_web_sm")
# doc = nlp("Apple is looking at buying U.K. startup for $1 billion")
# for token in doc:
# print(token.text, token.lemma_, tok... | 0 | 0 | 0 | 0 | 0 | 748 | 0 | -9 | 46 |
b42afe9cca241f838c883a88847120c7cb6fd46d | 1,258 | py | Python | tdc/multi_pred/drugsyn.py | ypapanik/TDC | 3739a918cf3bbb4fc2ef8d6c96d8b809dd8c4d2a | [
"MIT"
] | 577 | 2020-11-17T01:09:15.000Z | 2022-03-31T22:45:34.000Z | tdc/multi_pred/drugsyn.py | ypapanik/TDC | 3739a918cf3bbb4fc2ef8d6c96d8b809dd8c4d2a | [
"MIT"
] | 70 | 2020-11-18T09:35:33.000Z | 2022-03-25T11:28:38.000Z | tdc/multi_pred/drugsyn.py | ypapanik/TDC | 3739a918cf3bbb4fc2ef8d6c96d8b809dd8c4d2a | [
"MIT"
] | 106 | 2020-11-17T01:47:02.000Z | 2022-03-25T03:34:46.000Z | # -*- coding: utf-8 -*-
# Author: TDC Team
# License: MIT
import warnings
warnings.filterwarnings("ignore") | 31.45 | 105 | 0.643879 | # -*- coding: utf-8 -*-
# Author: TDC Team
# License: MIT
import warnings
warnings.filterwarnings("ignore")
import sys
from ..utils import print_sys
from . import bi_pred_dataset, multi_pred_dataset
from ..metadata import dataset_names
class DrugSyn(multi_pred_dataset.DataLoader):
"""Data loader class to load d... | 0 | 0 | 0 | 998 | 0 | 0 | 0 | 40 | 112 |
8e1963222f2d0db4ae72dbd900696ac30ac2e35a | 3,245 | py | Python | share/search/__init__.py | CenterForOpenScience/SHARE | c7715af2881f6fa23197d4e7c381d90169a90ed1 | [
"Apache-2.0"
] | 87 | 2015-01-06T18:24:45.000Z | 2021-08-08T07:59:40.000Z | share/search/__init__.py | fortress-biotech/SHARE | 9c5a05dd831447949fa6253afec5225ff8ab5d4f | [
"Apache-2.0"
] | 442 | 2015-01-01T19:16:01.000Z | 2022-03-30T21:10:26.000Z | share/search/__init__.py | fortress-biotech/SHARE | 9c5a05dd831447949fa6253afec5225ff8ab5d4f | [
"Apache-2.0"
] | 67 | 2015-03-10T16:32:58.000Z | 2021-11-12T16:33:41.000Z | import logging
from share.search.messages import MessageType
__all__ = ('SearchIndexer', 'MessageType')
logger = logging.getLogger(__name__)
| 37.732558 | 103 | 0.63359 | import logging
from contextlib import ExitStack
from share.search.elastic_manager import ElasticManager
from share.search.messages import MessageType
__all__ = ('SearchIndexer', 'MessageType')
logger = logging.getLogger(__name__)
class SearchIndexer:
retry_policy = {
'interval_start': 0, # First re... | 0 | 0 | 0 | 2,986 | 0 | 0 | 0 | 45 | 68 |
e68c17431fb13a37f2a5bf02ed29945f08372ad8 | 1,389 | py | Python | algos/patterns/heaps/k_way_merge/mergeKsortedLists.py | iamlmn/PyDS | 11b00629a91e8231eea7f8feb7c3c6065fdb1ce5 | [
"MIT"
] | null | null | null | algos/patterns/heaps/k_way_merge/mergeKsortedLists.py | iamlmn/PyDS | 11b00629a91e8231eea7f8feb7c3c6065fdb1ce5 | [
"MIT"
] | null | null | null | algos/patterns/heaps/k_way_merge/mergeKsortedLists.py | iamlmn/PyDS | 11b00629a91e8231eea7f8feb7c3c6065fdb1ce5 | [
"MIT"
] | null | null | null | # Given an array of K sorted LinkedLists, merge them into one sorted list.
# Example 1:
# Input: L1=[2, 6, 8], L2=[3, 6, 7], L3=[1, 3, 4]
# Output: [1, 2, 3, 3, 4, 6, 6, 7, 8]
# Example 2:
# Input: L1=[5, 8, 9], L2=[1, 7]
# Output: [1, 5, 7, 8, 9]
if __name__ == '__main__':
l1 = ListNode(2)
l1.ne... | 21.045455 | 76 | 0.537797 | # Given an array of ‘K’ sorted LinkedLists, merge them into one sorted list.
# Example 1:
# Input: L1=[2, 6, 8], L2=[3, 6, 7], L3=[1, 3, 4]
# Output: [1, 2, 3, 3, 4, 6, 6, 7, 8]
# Example 2:
# Input: L1=[5, 8, 9], L2=[1, 7]
# Output: [1, 5, 7, 8, 9]
from heapq import *
class ListNode:
def __init__(self, value... | 6 | 0 | 0 | 141 | 0 | 443 | 0 | -2 | 69 |
6dfdab7e58d66249755e432d7cd8edc5027f6ff0 | 832 | py | Python | generate_test_case.py | shadlyd15/TinyTest | d410ae76ca992f9bc468c1b5b2da5226cbf12bde | [
"MIT"
] | 6 | 2019-01-17T06:47:02.000Z | 2020-12-11T13:51:56.000Z | generate_test_case.py | shadlyd15/tinytest | c29da09366bace64dc83f8ffab201a71617c7528 | [
"MIT"
] | 1 | 2019-05-15T15:34:36.000Z | 2019-05-15T15:34:36.000Z | generate_test_case.py | shadlyd15/tinytest | c29da09366bace64dc83f8ffab201a71617c7528 | [
"MIT"
] | 2 | 2019-01-17T06:47:03.000Z | 2019-05-09T06:01:10.000Z | for number in range(50):
print("ADD_TINY_TEST(test_" + str(number) + "){")
print(" int i = rand()%50;")
print(" ASSERT_TEST_RESULT(i != " + str(number + 1) + ");")
# print(" ASSERT_TEST_RESULT(i != " + str(number + 2) + ");")
# print(" ASSERT_TEST_RESULT(i != " + str(number + 3) + ");")
# print(" ASSERT_TEST_RESU... | 48.941176 | 63 | 0.55649 | for number in range(50):
print("ADD_TINY_TEST(test_" + str(number) + "){")
print(" int i = rand()%50;")
print(" ASSERT_TEST_RESULT(i != " + str(number + 1) + ");")
# print(" ASSERT_TEST_RESULT(i != " + str(number + 2) + ");")
# print(" ASSERT_TEST_RESULT(i != " + str(number + 3) + ");")
# print(" ASSERT_TEST_RESU... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
71a86f1e397fb08fac63f6a37f435896f3c87f7e | 8,586 | py | Python | tests/components/knx/conftest.py | PiotrMachowski/core | b9d7d0cae2ccd2d88e90e49cc09e154a27ed809b | [
"Apache-2.0"
] | 3 | 2020-11-27T06:26:27.000Z | 2020-12-09T14:55:16.000Z | tests/components/knx/conftest.py | PiotrMachowski/core | b9d7d0cae2ccd2d88e90e49cc09e154a27ed809b | [
"Apache-2.0"
] | 25 | 2021-11-24T06:24:10.000Z | 2022-03-31T06:23:06.000Z | tests/components/knx/conftest.py | PiotrMachowski/core | b9d7d0cae2ccd2d88e90e49cc09e154a27ed809b | [
"Apache-2.0"
] | 3 | 2022-01-02T18:49:54.000Z | 2022-01-25T02:03:54.000Z | """Conftest for the KNX integration."""
from __future__ import annotations
| 38.16 | 98 | 0.652108 | """Conftest for the KNX integration."""
from __future__ import annotations
import asyncio
from unittest.mock import DEFAULT, AsyncMock, Mock, patch
import pytest
from xknx import XKNX
from xknx.core import XknxConnectionState
from xknx.dpt import DPTArray, DPTBinary
from xknx.io import DEFAULT_MCAST_GRP, DEFAULT_MCAS... | 0 | 937 | 4,857 | 1,820 | 0 | 0 | 0 | 491 | 403 |
baf1b2d489ebe0f3dca2a556cf2b9248c0edfa0c | 495 | py | Python | 12 - The Python Programmer Bootcamp/9_Classes/8_Practical exercise 2 (1:25)/9.6_practical_questions_1_&_2_UNSOLVED.py | olayinka04/365-data-science-courses | 7d71215432f0ef07fd3def559d793a6f1938d108 | [
"Apache-2.0"
] | null | null | null | 12 - The Python Programmer Bootcamp/9_Classes/8_Practical exercise 2 (1:25)/9.6_practical_questions_1_&_2_UNSOLVED.py | olayinka04/365-data-science-courses | 7d71215432f0ef07fd3def559d793a6f1938d108 | [
"Apache-2.0"
] | null | null | null | 12 - The Python Programmer Bootcamp/9_Classes/8_Practical exercise 2 (1:25)/9.6_practical_questions_1_&_2_UNSOLVED.py | olayinka04/365-data-science-courses | 7d71215432f0ef07fd3def559d793a6f1938d108 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Oct 30 15:17:56 2019
@author: giles
"""
'''
Question 1
Create a class to represent a bank account. It will need to have a balance,
a method of withdrawing money, depositing money and displaying the balance to
the screen. Create an instance of the bank account an... | 20.625 | 78 | 0.688889 | # -*- coding: utf-8 -*-
"""
Created on Wed Oct 30 15:17:56 2019
@author: giles
"""
'''
Question 1
Create a class to represent a bank account. It will need to have a balance,
a method of withdrawing money, depositing money and displaying the balance to
the screen. Create an instance of the bank account an... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
36d87bd45c15c3db309a7ec7daf5cdaa9558d489 | 1,226 | py | Python | print_structure.py | kangjingyao/FaceAging-by-cycleGAN | b9b8f056ee00d550139db64fa8b0f58ea60e4cdf | [
"MIT"
] | 126 | 2018-12-17T02:51:59.000Z | 2022-03-14T02:12:44.000Z | print_structure.py | kangjingyao/FaceAging-by-cycleGAN | b9b8f056ee00d550139db64fa8b0f58ea60e4cdf | [
"MIT"
] | 5 | 2019-04-01T12:50:26.000Z | 2020-08-01T08:28:56.000Z | print_structure.py | kangjingyao/FaceAging-by-cycleGAN | b9b8f056ee00d550139db64fa8b0f58ea60e4cdf | [
"MIT"
] | 49 | 2018-11-12T01:02:56.000Z | 2022-01-22T10:18:54.000Z | import models.networks as net
# image channels
input_nc_a, input_nc_b = 3, 3
output_nc_a, output_nc_b = 3, 3
# number of gen filters in first conv layer
ngf_a, ngf_b = 64, 64
# number of discrim filters in first conv layer
ndf_a, ndf_b = 64, 64
# generator: 'resnet_9blocks', 'resnet_6blocks', 'unet_128', ... | 38.3125 | 72 | 0.623165 | import models.networks as net
# image channels
input_nc_a, input_nc_b = 3, 3
output_nc_a, output_nc_b = 3, 3
# number of gen filters in first conv layer
ngf_a, ngf_b = 64, 64
# number of discrim filters in first conv layer
ndf_a, ndf_b = 64, 64
# generator: 'resnet_9blocks', 'resnet_6blocks', 'unet_128', ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2124f834744448e10790f61e5fabcaacc984a9d3 | 13,548 | py | Python | bin/atmospheric.py | CristianICS/gee-atmcorr-S2 | a45e3aa517d9c7af8653ecf14f3a5f76ef07db46 | [
"Apache-2.0"
] | null | null | null | bin/atmospheric.py | CristianICS/gee-atmcorr-S2 | a45e3aa517d9c7af8653ecf14f3a5f76ef07db46 | [
"Apache-2.0"
] | null | null | null | bin/atmospheric.py | CristianICS/gee-atmcorr-S2 | a45e3aa517d9c7af8653ecf14f3a5f76ef07db46 | [
"Apache-2.0"
] | null | null | null | """
atmospheric.py, Sam Murphy (2016-10-26)
Atmospheric water vapour, ozone and AOT from GEE
Usage
H2O = Atmospheric.water(geom,date)
O3 = Atmospheric.ozone(geom,date)
AOT = Atmospheric.aerosol(geom,date)
"""
| 34.125945 | 121 | 0.566726 | """
atmospheric.py, Sam Murphy (2016-10-26)
Atmospheric water vapour, ozone and AOT from GEE
Usage
H2O = Atmospheric.water(geom,date)
O3 = Atmospheric.ozone(geom,date)
AOT = Atmospheric.aerosol(geom,date)
"""
import ee
import geemap
from Py6S import *
import os, sys, time, math, datetime
class Atmospheric():
d... | 0 | 0 | 0 | 13,207 | 0 | 0 | 0 | -8 | 136 |
b22def74e4bbcac5d0fab101d0e1ddf08cb8b8c9 | 483 | py | Python | text/_elisp/key/_gi.py | jedhsu/text | 8525b602d304ac571a629104c48703443244545c | [
"Apache-2.0"
] | null | null | null | text/_elisp/key/_gi.py | jedhsu/text | 8525b602d304ac571a629104c48703443244545c | [
"Apache-2.0"
] | null | null | null | text/_elisp/key/_gi.py | jedhsu/text | 8525b602d304ac571a629104c48703443244545c | [
"Apache-2.0"
] | null | null | null | """
*Gi*
An atomic key.
From the japanese *kagi*,
"""
__all__ = ["Gi"]
| 13.054054 | 47 | 0.590062 | """
*Gi*
An atomic key.
From the japanese *kagi*,
"""
from dataclasses import dataclass
from typing import Optional
from .base import BaseKey
from .modifier import ModifierKey
__all__ = ["Gi"]
@dataclass
class Gi:
base: BaseKey
modifier: Optional[ModifierKey]
@classmethod
def create... | 0 | 248 | 0 | 0 | 0 | 0 | 0 | 34 | 114 |
c790a37870989d19dcf9537f93da9c89493848bf | 3,467 | py | Python | tools/nntool/importer/tflite2/handlers/backend/tflite_detection_postprocess.py | bot-motion/gap_sdk | bd117a8a4b5384b2b889f72effbfed4f7f938a88 | [
"Apache-2.0"
] | null | null | null | tools/nntool/importer/tflite2/handlers/backend/tflite_detection_postprocess.py | bot-motion/gap_sdk | bd117a8a4b5384b2b889f72effbfed4f7f938a88 | [
"Apache-2.0"
] | null | null | null | tools/nntool/importer/tflite2/handlers/backend/tflite_detection_postprocess.py | bot-motion/gap_sdk | bd117a8a4b5384b2b889f72effbfed4f7f938a88 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2020 GreenWaves Technologies, SAS
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# This progr... | 41.771084 | 122 | 0.686184 | # Copyright (C) 2020 GreenWaves Technologies, SAS
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# This progr... | 0 | 2,161 | 0 | 0 | 0 | 0 | 0 | 354 | 245 |
a440841ff52cda66f42d8cc57ae7572c2c92939f | 24 | py | Python | test/__init__.py | yannikschaelte/jabbar | 56c315714a54d0bf1dd1991ecd3926c536a6b5b5 | [
"MIT"
] | 7 | 2020-07-30T23:11:29.000Z | 2021-04-22T09:29:26.000Z | test/__init__.py | yannikschaelte/jabbar | 56c315714a54d0bf1dd1991ecd3926c536a6b5b5 | [
"MIT"
] | 5 | 2020-07-31T09:36:16.000Z | 2022-01-01T08:38:39.000Z | test/__init__.py | yannikschaelte/jabbar | 56c315714a54d0bf1dd1991ecd3926c536a6b5b5 | [
"MIT"
] | null | null | null | """Tests for jabbar."""
| 12 | 23 | 0.583333 | """Tests for jabbar."""
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bcbcdea0d792ae926ac4dc93ad022ccd5a54092d | 458 | py | Python | combine.py | oskarstucki/pdfCombiner | 75114c2a8e65617b310c4522b09e6df51f1f4e37 | [
"MIT"
] | null | null | null | combine.py | oskarstucki/pdfCombiner | 75114c2a8e65617b310c4522b09e6df51f1f4e37 | [
"MIT"
] | null | null | null | combine.py | oskarstucki/pdfCombiner | 75114c2a8e65617b310c4522b09e6df51f1f4e37 | [
"MIT"
] | null | null | null | from PyPDF2 import PdfFileMerger
files_array = read_files()
merger = PdfFileMerger()
for pdf in files_array:
merger.append(pdf)
merger.write("result.pdf")
merger.close()
| 16.357143 | 44 | 0.652838 | from PyPDF2 import PdfFileMerger
def read_files():
try:
import tkinter as tk
from tkinter import filedialog
root = tk.Tk()
root.withdraw()
return filedialog.askopenfilenames()
except FileNotFoundError:
print("File couldn't be found")
return 0
files_... | 0 | 0 | 0 | 0 | 0 | 255 | 0 | 0 | 23 |
a0338715d10c7b067fd633233d43cb31ae889e1c | 2,732 | py | Python | opencv_demos/asyncio_test/afile_read.py | perfectbullet/albumy | 6e0fa1bef31f470c19fd6bcf6751d0be6510d864 | [
"MIT"
] | null | null | null | opencv_demos/asyncio_test/afile_read.py | perfectbullet/albumy | 6e0fa1bef31f470c19fd6bcf6751d0be6510d864 | [
"MIT"
] | null | null | null | opencv_demos/asyncio_test/afile_read.py | perfectbullet/albumy | 6e0fa1bef31f470c19fd6bcf6751d0be6510d864 | [
"MIT"
] | null | null | null | import asyncio
import numpy as np
import cv2
def bytes2np(bytesarray):
"""
bytes two numpy->array
:param bytesarray:
:return:
"""
nparr = np.frombuffer(bytesarray, np.uint8)
img_np = cv2.imdecode(nparr, cv2.IMREAD_COLOR) # cv2.IMREAD_COLOR in OpenCV 3.1
return img_np
if __name__... | 28.757895 | 88 | 0.565154 | import fcntl
import os
import asyncio
import numpy as np
import cv2
def bytes2np(bytesarray):
"""
bytes two numpy->array
:param bytesarray:
:return:
"""
nparr = np.frombuffer(bytesarray, np.uint8)
img_np = cv2.imdecode(nparr, cv2.IMREAD_COLOR) # cv2.IMREAD_COLOR in OpenCV 3.1
return... | 0 | 0 | 140 | 1,961 | 0 | 0 | 0 | -21 | 90 |
a7dcafe24bcf1ab60270afef93f4ffcc7be51012 | 139 | py | Python | exercicios/ex043.py | ArthurLopesMagalhaes/Python-CursoEmVideo | de9006f620a7308c3001fa486b1a4bcd789f7a49 | [
"MIT"
] | null | null | null | exercicios/ex043.py | ArthurLopesMagalhaes/Python-CursoEmVideo | de9006f620a7308c3001fa486b1a4bcd789f7a49 | [
"MIT"
] | null | null | null | exercicios/ex043.py | ArthurLopesMagalhaes/Python-CursoEmVideo | de9006f620a7308c3001fa486b1a4bcd789f7a49 | [
"MIT"
] | null | null | null | peso = float(input('Qual o seu peso? (Kg) '))
altura = float(input('Qual a sua altura? (m) '))
imc = peso / altura ** 2
print(imc)
if imc < | 27.8 | 48 | 0.618705 | peso = float(input('Qual o seu peso? (Kg) '))
altura = float(input('Qual a sua altura? (m) '))
imc = peso / altura ** 2
print(imc)
if imc < | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ccd95221ade5d3a7df7f0fadb058b59c1810fb8f | 16,760 | py | Python | tensorcircuit/applications/layers.py | refraction-ray/tensorcircuit | 666154f4dbdb25164c0e778a96ee56ac22323a6c | [
"MIT"
] | 21 | 2020-04-19T23:29:11.000Z | 2022-03-12T12:12:57.000Z | tensorcircuit/applications/layers.py | refraction-ray/tensorcircuit | 666154f4dbdb25164c0e778a96ee56ac22323a6c | [
"MIT"
] | 3 | 2020-10-19T12:18:44.000Z | 2022-02-10T01:24:46.000Z | tensorcircuit/applications/layers.py | refraction-ray/tensorcircuit | 666154f4dbdb25164c0e778a96ee56ac22323a6c | [
"MIT"
] | 7 | 2020-07-15T18:08:00.000Z | 2021-12-30T08:17:13.000Z | """
module for functions adding layers of circuits
"""
import sys
import itertools
import numpy as np
import cirq
import tensorflow as tf
from typing import Union, Any
from ..circuit import Circuit
thismodule = sys.modules[__name__]
Tensor = Any # tf.Tensor
Graph = Any # nx.Graph
Symbol = Any # sympy.Symbol
de... | 33.32008 | 106 | 0.583294 | """
module for functions adding layers of circuits
"""
import sys
import itertools
import numpy as np
import cirq
import networkx as nx
import tensorflow as tf
from typing import Sequence, Union, Callable, Any, Optional, Tuple, List
from ..circuit import Circuit
from ..densitymatrix import DMCircuit
from ..gates impo... | 0 | 0 | 0 | 0 | 0 | 11,726 | 0 | 123 | 591 |
a4dce47baf8120bed38e1a1d7431dc6696c910a7 | 1,524 | py | Python | edm_web1/django_weixin/views/menu.py | zhouli121018/nodejsgm | 0ccbc8acf61badc812f684dd39253d55c99f08eb | [
"MIT"
] | null | null | null | edm_web1/django_weixin/views/menu.py | zhouli121018/nodejsgm | 0ccbc8acf61badc812f684dd39253d55c99f08eb | [
"MIT"
] | 18 | 2020-06-05T18:17:40.000Z | 2022-03-11T23:25:21.000Z | edm_web1/django_weixin/views/menu.py | zhouli121018/nodejsgm | 0ccbc8acf61badc812f684dd39253d55c99f08eb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Created on 04 11, 2016
@author: tolerious
'''
# from django_weixin.ierror import *
| 35.44186 | 142 | 0.644357 | # -*- coding: utf-8 -*-
'''
Created on 04 11, 2016
@author: tolerious
'''
from django_weixin.models import *
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response, render, redirect
from django.views.decorators.csrf import csrf_exempt
from django.core.paginator imp... | 81 | 918 | 0 | 0 | 0 | 57 | 0 | 207 | 201 |
bd4b411f13b7ac1fe9c075555fcde6cdd0abac2a | 1,049 | py | Python | analysis.py | jinmel/speechless | 0a7c1a0ad78ac6712b0702dc87210d2128f788ae | [
"Apache-2.0"
] | null | null | null | analysis.py | jinmel/speechless | 0a7c1a0ad78ac6712b0702dc87210d2128f788ae | [
"Apache-2.0"
] | null | null | null | analysis.py | jinmel/speechless | 0a7c1a0ad78ac6712b0702dc87210d2128f788ae | [
"Apache-2.0"
] | null | null | null | """Audio file(wav) feature extractor."""
from absl import app
from absl import flags
flags.DEFINE_string('wav_dir', '', 'Directory to audio files.')
flags.DEFINE_string('csv_output', '', 'Path to csv output.')
FLAGS = flags.FLAGS
if __name__ == '__main__':
app.run(main)
| 22.804348 | 75 | 0.684461 | """Audio file(wav) feature extractor."""
import concurrent
import glob
import os
from absl import app
from absl import flags
from absl import logging
import pandas
import tqdm
import feature
flags.DEFINE_string('wav_dir', '', 'Directory to audio files.')
flags.DEFINE_string('csv_output', '', 'Path to csv output.')... | 0 | 0 | 0 | 0 | 0 | 613 | 0 | -48 | 202 |
7677ca0f66f1d28cba7a3012c06b9edb78bc0c54 | 1,289 | py | Python | backend/ordering/order.py | rsimmons/massif | d97ee63f618e0d05308722158992f804e2c54fa5 | [
"MIT"
] | 24 | 2021-06-20T16:54:14.000Z | 2022-03-31T03:46:13.000Z | backend/ordering/order.py | rsimmons/massif | d97ee63f618e0d05308722158992f804e2c54fa5 | [
"MIT"
] | 6 | 2021-07-04T14:49:38.000Z | 2022-03-27T09:19:58.000Z | backend/ordering/order.py | rsimmons/massif | d97ee63f618e0d05308722158992f804e2c54fa5 | [
"MIT"
] | 1 | 2021-08-25T14:31:22.000Z | 2021-08-25T14:31:22.000Z | import argparse
from sudachi import analyze_single
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('knowntext', help='known text, in whatever format')
parser.add_argument('sortedtoks', help='tsv of (text, toks) sorted by descending goodness')
parser.add_argument('word... | 37.911765 | 113 | 0.674942 | import argparse
from sudachi import analyze_single
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('knowntext', help='known text, in whatever format')
parser.add_argument('sortedtoks', help='tsv of (text, toks) sorted by descending goodness')
parser.add_argument('word... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
20ef1992a5c9ca61d0b515703f85b4c0cd43e1e9 | 12,922 | py | Python | kbbq/compare_reads.py | adamjorr/kbbq-py | a1b6049458ec03d305c4f4148aad325a3867d627 | [
"MIT"
] | null | null | null | kbbq/compare_reads.py | adamjorr/kbbq-py | a1b6049458ec03d305c4f4148aad325a3867d627 | [
"MIT"
] | 2 | 2020-11-09T20:21:36.000Z | 2021-06-02T00:07:35.000Z | kbbq/compare_reads.py | adamjorr/kbbq-py | a1b6049458ec03d305c4f4148aad325a3867d627 | [
"MIT"
] | 1 | 2021-06-01T01:53:33.000Z | 2021-06-01T01:53:33.000Z | """
A mish-mash of functions for recalibration. Should probably be renamed in the near future.
"""
import pysam
import numpy as np
import os
import matplotlib
matplotlib.use('Agg')
import scipy.stats
import kbbq.recaltable as recaltable
import kbbq.plot
import datetime
def tstamp():
"""
Return the current tim... | 37.894428 | 213 | 0.662436 | """
A mish-mash of functions for recalibration. Should probably be renamed in the near future.
"""
import pysam
import numpy as np
import sklearn
from sklearn.linear_model import LogisticRegression as LR
from sklearn.isotonic import IsotonicRegression as IR
import os
import os.path
import sys
import re
import matplotl... | 0 | 475 | 0 | 2,476 | 0 | 3,057 | 0 | 30 | 564 |
a595b68f53d3f4c95c64924238201179248d6fc9 | 878 | py | Python | toy-evolve/relaxation_burgers_imex222.py | IanHawke/toy-evolve | a1490327dd19492e2c0bb0d9c6909abe8b167135 | [
"MIT"
] | null | null | null | toy-evolve/relaxation_burgers_imex222.py | IanHawke/toy-evolve | a1490327dd19492e2c0bb0d9c6909abe8b167135 | [
"MIT"
] | 1 | 2017-08-18T09:38:36.000Z | 2017-08-22T16:03:04.000Z | toy-evolve/relaxation_burgers_imex222.py | IanHawke/toy-evolve | a1490327dd19492e2c0bb0d9c6909abe8b167135 | [
"MIT"
] | null | null | null | # Relaxation system: relaxes to Burgers as tau->0
#
import numpy
from models import relaxation_burgers
from bcs import outflow
from simulation import simulation
from methods import weno3_upwind
from rk import imex222
from grid import grid
from matplotlib import pyplot
Ngz = 4
Npoints = 200
tau = 1.0
tau2 = 0.01
L = 1... | 25.823529 | 104 | 0.773349 | # Relaxation system: relaxes to Burgers as tau->0
#
import numpy
from models import relaxation_burgers
from bcs import outflow
from simulation import simulation
from methods import weno3_upwind
from rk import imex222
from grid import grid
from matplotlib import pyplot
Ngz = 4
Npoints = 200
tau = 1.0
tau2 = 0.01
L = 1... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d23f9e1b7e0768d8cbe7019c0769ea6285c6b758 | 3,636 | py | Python | tool/taint_analysis/utils.py | MageWeiG/karonte | 2ffe649557adccdd3c2c77c0ae0a5f27a385fdcb | [
"BSD-2-Clause"
] | 1 | 2021-04-15T12:00:56.000Z | 2021-04-15T12:00:56.000Z | tool/taint_analysis/utils.py | MageWeiG/karonte | 2ffe649557adccdd3c2c77c0ae0a5f27a385fdcb | [
"BSD-2-Clause"
] | null | null | null | tool/taint_analysis/utils.py | MageWeiG/karonte | 2ffe649557adccdd3c2c77c0ae0a5f27a385fdcb | [
"BSD-2-Clause"
] | 1 | 2021-09-16T07:44:55.000Z | 2021-09-16T07:44:55.000Z | import archinfo
ordered_argument_regs = {
'ARMEL': [
archinfo.ArchARMEL.registers['r0'][0],
archinfo.ArchARMEL.registers['r1'][0],
archinfo.ArchARMEL.registers['r2'][0],
archinfo.ArchARMEL.registers['r3'][0],
archinfo.ArchARMEL.registers['r4'][0],
archinfo.ArchARMEL.... | 29.803279 | 110 | 0.637514 | import archinfo
ordered_argument_regs = {
'ARMEL': [
archinfo.ArchARMEL.registers['r0'][0],
archinfo.ArchARMEL.registers['r1'][0],
archinfo.ArchARMEL.registers['r2'][0],
archinfo.ArchARMEL.registers['r3'][0],
archinfo.ArchARMEL.registers['r4'][0],
archinfo.ArchARMEL.... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e6d3d7a6ba75e5933c82856861d35af13100ec94 | 46,593 | py | Python | reloading_tabview.py | philipbjorge/osc-spy | 1047d1a4984a3af4f87bd6575e99a63e85c532da | [
"MIT"
] | null | null | null | reloading_tabview.py | philipbjorge/osc-spy | 1047d1a4984a3af4f87bd6575e99a63e85c532da | [
"MIT"
] | null | null | null | reloading_tabview.py | philipbjorge/osc-spy | 1047d1a4984a3af4f87bd6575e99a63e85c532da | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
""" tabview.py -- View a tab-delimited file in a spreadsheet-like display.
Scott Hansen <firecat four one five three at gmail dot com>
Based on code contributed by A.M. Kuchling <amk at amk dot ca>
"""
from __future__ import print_function, division, unicode_literals
import csv
import cur... | 34.184153 | 81 | 0.532698 | # -*- coding: utf-8 -*-
""" tabview.py -- View a tab-delimited file in a spreadsheet-like display.
Scott Hansen <firecat four one five three at gmail dot com>
Based on code contributed by A.M. Kuchling <amk at amk dot ca>
"""
from __future__ import print_function, division, unicode_literals
import csv
import _cu... | 3 | 309 | 0 | 36,262 | 0 | 990 | 0 | 2 | 541 |
d9c997e65872a3e2c3a4647fdc981495ea7d6e76 | 5,197 | py | Python | weather/test_weather.py | ironss/micropython-lib | 61719636dad9aaa581c8e39e71ccc515e75c2d43 | [
"MIT"
] | null | null | null | weather/test_weather.py | ironss/micropython-lib | 61719636dad9aaa581c8e39e71ccc515e75c2d43 | [
"MIT"
] | null | null | null | weather/test_weather.py | ironss/micropython-lib | 61719636dad9aaa581c8e39e71ccc515e75c2d43 | [
"MIT"
] | 2 | 2019-09-24T13:36:55.000Z | 2020-04-18T02:05:38.000Z | """
Extract forecasts from weatherbit.io and darksky.net forecast data.
* Single function
Data sources
============
weatherbit.io
-------------
* curl 'http://api.weatherbit.io/v2.0/current?key=d3fc630d26bb4a84b0392029a4c90ba0&lat=-43.49391&lon=172.57900' > test/weatherbit-currently.json
* curl 'http://api.weatherb... | 34.879195 | 180 | 0.717145 | """
Extract forecasts from weatherbit.io and darksky.net forecast data.
* Single function
Data sources
============
weatherbit.io
-------------
* curl 'http://api.weatherbit.io/v2.0/current?key=d3fc630d26bb4a84b0392029a4c90ba0&lat=-43.49391&lon=172.57900' > test/weatherbit-currently.json
* curl 'http://api.weatherb... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
81db93c0c7f315907f47a686f8dd253bb3d414cf | 16,961 | py | Python | lifesospy/__main__.py | rorr73/LifeSOSpy | 5d887892999e942da7bc89b3be547a3781916069 | [
"MIT"
] | 2 | 2019-08-09T17:50:28.000Z | 2019-09-29T02:14:13.000Z | lifesospy/__main__.py | rorr73/LifeSOSpy | 5d887892999e942da7bc89b3be547a3781916069 | [
"MIT"
] | null | null | null | lifesospy/__main__.py | rorr73/LifeSOSpy | 5d887892999e942da7bc89b3be547a3781916069 | [
"MIT"
] | null | null | null | """
This module allows the library to be run as an interactive command line
application, primarily to assist with testing the library.
"""
import argparse
import asyncio
import logging
import sys
from lifesospy.baseunit import BaseUnit
from lifesospy.const import (PROJECT_VERSION, PROJECT_DESCRIPTION)
_LOGGER = loggi... | 41.368293 | 100 | 0.548258 | """
This module allows the library to be run as an interactive command line
application, primarily to assist with testing the library.
"""
import argparse
import asyncio
import logging
import sys
import traceback
from typing import Optional, Union
from lifesospy.baseunit import BaseUnit
from lifesospy.const import (
... | 0 | 0 | 5,844 | 0 | 0 | 8,760 | 0 | 130 | 135 |
298559319681667be1cf57323ad9356b350d710b | 3,991 | py | Python | riiid/core/transformers.py | fabien-vavrand/kaggle-riiid | 3302955980e0d4bb2dbc72bcd369000b0724f1e7 | [
"MIT"
] | null | null | null | riiid/core/transformers.py | fabien-vavrand/kaggle-riiid | 3302955980e0d4bb2dbc72bcd369000b0724f1e7 | [
"MIT"
] | null | null | null | riiid/core/transformers.py | fabien-vavrand/kaggle-riiid | 3302955980e0d4bb2dbc72bcd369000b0724f1e7 | [
"MIT"
] | null | null | null |
# not used
| 28.92029 | 132 | 0.592583 | import logging
import numpy as np
import pandas as pd
from sklearn.base import BaseEstimator, TransformerMixin
class ColumnsSelector(BaseEstimator, TransformerMixin):
def __init__(self, columns_to_drop=None, validate=False):
self.columns_to_drop = columns_to_drop
self.validate = validate
... | 0 | 0 | 0 | 3,725 | 0 | 0 | 0 | 23 | 225 |
52227d48a22a65f94f57e09e6fc75c8bf0a02319 | 14,092 | py | Python | principal_dnn_mnist.py | Koowah/Deep_neural_networks | 7cadda555692c482afc34196b2c43c4d3f27f5c5 | [
"MIT"
] | null | null | null | principal_dnn_mnist.py | Koowah/Deep_neural_networks | 7cadda555692c482afc34196b2c43c4d3f27f5c5 | [
"MIT"
] | null | null | null | principal_dnn_mnist.py | Koowah/Deep_neural_networks | 7cadda555692c482afc34196b2c43c4d3f27f5c5 | [
"MIT"
] | null | null | null |
# import torch
# from torchvision import datasets, transforms
######################################################################
######################### HELPER FUNCTIONS #########################
######################################################################
# one_hot encodes numerical labels
# used... | 41.325513 | 184 | 0.540378 | import time
import pickle # to load data
# import torch
# from torchvision import datasets, transforms
import numpy as np
import matplotlib.pyplot as plt
from principal_dbn_alpha import DBN
######################################################################
######################### HELPER FUNCTIONS #########... | 0 | 298 | 0 | 5,977 | 0 | 6,628 | 0 | 3 | 288 |
8264e1809090dc467d6caaa46321330e48b9fc4a | 432 | py | Python | bokehExer/selecterExer/selecter.py | terasakisatoshi/pythonCodes | baee095ecee96f6b5ec6431267cdc6c40512a542 | [
"MIT"
] | null | null | null | bokehExer/selecterExer/selecter.py | terasakisatoshi/pythonCodes | baee095ecee96f6b5ec6431267cdc6c40512a542 | [
"MIT"
] | null | null | null | bokehExer/selecterExer/selecter.py | terasakisatoshi/pythonCodes | baee095ecee96f6b5ec6431267cdc6c40512a542 | [
"MIT"
] | null | null | null |
main()
| 24 | 90 | 0.699074 | from bokeh.io import output_file, show, curdoc
from bokeh.layouts import widgetbox
from bokeh.models.widgets import Select
def update_something(attr, old, new):
print(attr, old, new)
def main():
select = Select(title="Select me", value="foo", options=["foo", "bar", "baz", "quit"])
select.on_change('valu... | 0 | 0 | 0 | 0 | 0 | 253 | 0 | 57 | 112 |
2ecbeee57c0a2618f4543422f393ecca565c0417 | 8,885 | py | Python | cah/cah/game.py | viktorErasmusHogeschool/artificial-intelligence | 84d97bac83f074b2c16d531e4fc9d917a16cd0ce | [
"MIT"
] | null | null | null | cah/cah/game.py | viktorErasmusHogeschool/artificial-intelligence | 84d97bac83f074b2c16d531e4fc9d917a16cd0ce | [
"MIT"
] | null | null | null | cah/cah/game.py | viktorErasmusHogeschool/artificial-intelligence | 84d97bac83f074b2c16d531e4fc9d917a16cd0ce | [
"MIT"
] | null | null | null | import sys
sys.path.append("../")
| 40.386364 | 158 | 0.567361 | import pygame
import numpy as np
from . import Network
from . import Player
from . import Canvas
from . import Button
from _thread import *
import sys
sys.path.append("../")
from speech.speech_synthesis import say
from gans.image_synthesis import gen_image
class Game:
def __init__(self, width, height):
s... | 0 | 274 | 0 | 8,330 | 0 | 0 | 0 | 25 | 221 |
6c67bb6f21a71cd57952f7b9ef3b6bde17f6f970 | 1,138 | py | Python | install_key.py | hyperia-inc/hyperia_python_sdk | 73ade4ab892f9e40242c0311843e2675ef4f25cb | [
"Apache-2.0"
] | 1 | 2022-01-06T06:22:47.000Z | 2022-01-06T06:22:47.000Z | install_key.py | hyperia-inc/hyperia-python-sdk | 73ade4ab892f9e40242c0311843e2675ef4f25cb | [
"Apache-2.0"
] | null | null | null | install_key.py | hyperia-inc/hyperia-python-sdk | 73ade4ab892f9e40242c0311843e2675ef4f25cb | [
"Apache-2.0"
] | null | null | null |
if __name__ == '__main__':
"""
Writes the API key to api_key.txt file. It will create the file if it doesn't exist.
This function is intended to be called from the Python command line using: python hyperia YOUR_API_KEY
If you don't have an API key yet, register for one at: https://hyperia.net/api/regis... | 34.484848 | 111 | 0.594903 |
if __name__ == '__main__':
"""
Writes the API key to api_key.txt file. It will create the file if it doesn't exist.
This function is intended to be called from the Python command line using: python hyperia YOUR_API_KEY
If you don't have an API key yet, register for one at: https://hyperia.net/api/regis... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ab64e5d5e5707692dcadca7007ca359e5e0709dd | 1,145 | py | Python | tests/has_attr_tests.py | TakenBrandi/python-precisely | 7fad8a7e38fb626dfd42f9f788a0d92dc38ccdee | [
"BSD-2-Clause"
] | 238 | 2018-02-26T14:38:58.000Z | 2022-03-02T06:49:53.000Z | tests/has_attr_tests.py | TakenBrandi/python-precisely | 7fad8a7e38fb626dfd42f9f788a0d92dc38ccdee | [
"BSD-2-Clause"
] | 14 | 2018-01-17T14:35:55.000Z | 2022-02-14T22:45:57.000Z | tests/has_attr_tests.py | TakenBrandi/python-precisely | 7fad8a7e38fb626dfd42f9f788a0d92dc38ccdee | [
"BSD-2-Clause"
] | 7 | 2018-01-17T15:05:14.000Z | 2021-03-26T00:12:07.000Z | import collections
User = collections.namedtuple("User", ["username"])
| 23.854167 | 85 | 0.70917 | import collections
from nose.tools import istest, assert_equal
from precisely import has_attr, equal_to
from precisely.results import matched, unmatched
User = collections.namedtuple("User", ["username"])
@istest
def matches_when_property_has_correct_value():
assert_equal(matched(), has_attr("username", equal... | 0 | 815 | 0 | 0 | 0 | 0 | 0 | 68 | 183 |
7f529b1f4c6325e152ca78bdc9993c55a586359f | 770 | py | Python | genomics_gans/tests/test_data_modules.py | Unique-Divine/GANs-for-Genomics | e023455ae7c18d5e624bb618184c41e91261a0e4 | [
"MIT"
] | 1 | 2022-03-10T00:12:52.000Z | 2022-03-10T00:12:52.000Z | genomics_gans/tests/test_data_modules.py | Unique-Divine/GANs-for-Genomics | e023455ae7c18d5e624bb618184c41e91261a0e4 | [
"MIT"
] | null | null | null | genomics_gans/tests/test_data_modules.py | Unique-Divine/GANs-for-Genomics | e023455ae7c18d5e624bb618184c41e91261a0e4 | [
"MIT"
] | 1 | 2021-10-04T12:49:47.000Z | 2021-10-04T12:49:47.000Z | import warnings; warnings.filterwarnings("ignore")
try:
import genomics_gans
except:
exec(open('__init__.py').read())
# type imports
| 29.615385 | 64 | 0.707792 |
import os, sys
import numpy as np
import pandas as pd
import warnings; warnings.filterwarnings("ignore")
try:
import genomics_gans
except:
exec(open('__init__.py').read())
import genomics_gans
from genomics_gans.prepare_data import data_modules
# type imports
from torch.utils.data import Dataset, DataLoad... | 0 | 0 | 0 | 416 | 0 | 0 | 0 | 44 | 160 |
ed46f8f841c8c4ac332bf2b7ebc37f7dce5a8cdd | 970 | py | Python | app/api/v1/models/products.py | owezzy/StoreManager | 821856c0d502b55bd499cfe9188cd4951c5b0b75 | [
"MIT"
] | null | null | null | app/api/v1/models/products.py | owezzy/StoreManager | 821856c0d502b55bd499cfe9188cd4951c5b0b75 | [
"MIT"
] | 2 | 2018-10-10T22:32:35.000Z | 2021-06-01T22:50:56.000Z | app/api/v1/models/products.py | owezzy/StoreManager | 821856c0d502b55bd499cfe9188cd4951c5b0b75 | [
"MIT"
] | 1 | 2018-10-25T12:42:41.000Z | 2018-10-25T12:42:41.000Z | products = []
| 29.393939 | 109 | 0.656701 | products = []
class ProductsModel:
def __init__(self, product_name, price, stock):
# We will automatically generate the new id
self.id = len(products) + 1
self.product_name = product_name
self.price = price
self.stock = stock
# adds a product to a list of products
... | 0 | 345 | 0 | 587 | 0 | 0 | 0 | 0 | 23 |
ff35b4af8946fe9e1b7664e92b07bce053217015 | 32,606 | py | Python | script.py | khttemp/dend-comic-script-gui | 709d8db735cdbdcc7b782a67807646ba68c7836a | [
"MIT"
] | null | null | null | script.py | khttemp/dend-comic-script-gui | 709d8db735cdbdcc7b782a67807646ba68c7836a | [
"MIT"
] | null | null | null | script.py | khttemp/dend-comic-script-gui | 709d8db735cdbdcc7b782a67807646ba68c7836a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from tkinter import ttk
imgList = []
seList = []
bgmList = []
comicDataList = []
copyComicData = []
indexList = []
max_param = 0
byteArr = []
file_path = ""
frame = None
cmd = [
"Tx",
"TxSize",
"Alpha",
"End",
"Pos",
"ColorALL",
"Move",
"ST... | 27.916096 | 129 | 0.584616 | # -*- coding: utf-8 -*-
import os
import struct
import copy
from tkinter import *
from tkinter import filedialog as fd
from tkinter import ttk
from tkinter import messagebox as mb
from tkinter import simpledialog as sd
imgList = []
seList = []
bgmList = []
comicDataList = []
copyComicData = []
indexLi... | 1,872 | 0 | 0 | 7,397 | 0 | 9,552 | 0 | 17 | 563 |
d22e18d656a10df1b0ec68cf2b112a715b92b3ee | 5,503 | py | Python | pipeline/storage.py | peopledoc/django-pipeline | 59865e1387a2b785a3948244639d1827fd4f2c99 | [
"MIT"
] | null | null | null | pipeline/storage.py | peopledoc/django-pipeline | 59865e1387a2b785a3948244639d1827fd4f2c99 | [
"MIT"
] | null | null | null | pipeline/storage.py | peopledoc/django-pipeline | 59865e1387a2b785a3948244639d1827fd4f2c99 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
default_storage = DefaultStorage()
| 32.370588 | 112 | 0.648737 | from __future__ import unicode_literals
import gzip
from io import BytesIO
from django.contrib.staticfiles import finders
from django.contrib.staticfiles.storage import CachedStaticFilesStorage, StaticFilesStorage
from django.contrib.staticfiles.utils import matches_patterns
from django.core.exceptions import Impro... | 0 | 0 | 0 | 4,711 | 0 | 0 | 0 | 250 | 455 |
2217f9a0f1a7a00924f261930ed240130c06182e | 297 | py | Python | project/web/app/website/urls.py | jroeland/projectlead | b62dddc9d2aee13c66fa9a1f7788362078143979 | [
"MIT"
] | null | null | null | project/web/app/website/urls.py | jroeland/projectlead | b62dddc9d2aee13c66fa9a1f7788362078143979 | [
"MIT"
] | null | null | null | project/web/app/website/urls.py | jroeland/projectlead | b62dddc9d2aee13c66fa9a1f7788362078143979 | [
"MIT"
] | null | null | null | from django.conf.urls import url, include
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^api/customers/', include('customers.urls')),
url(r'^api/products/', include('products.urls')),
url(r'^api/discounts/', include('discounts.urls'))
]
| 29.7 | 55 | 0.676768 | from django.conf.urls import url, include
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^api/customers/', include('customers.urls')),
url(r'^api/products/', include('products.urls')),
url(r'^api/discounts/', include('discounts.urls'))
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9a0f829dc0b9a2e0e000cdd8ed2bd63092702af5 | 509 | py | Python | tbs/helper/download.py | ODEX-TOS/tos-build-system | 019de4d7b47a55123802f5aea4ac0c12d3660f2d | [
"MIT"
] | 1 | 2021-05-06T23:06:41.000Z | 2021-05-06T23:06:41.000Z | tbs/helper/download.py | ODEX-TOS/tos-build-system | 019de4d7b47a55123802f5aea4ac0c12d3660f2d | [
"MIT"
] | null | null | null | tbs/helper/download.py | ODEX-TOS/tos-build-system | 019de4d7b47a55123802f5aea4ac0c12d3660f2d | [
"MIT"
] | null | null | null | import tbs.helper.filedescriptor as fd
import tbs.logger.log as logger
import os
def downloadRepo(subpath="toslive"):
"""
Try to download the tos image repository and make that the current directory
"""
result = fd.CMD(["git", "clone", "https://github.com/ODEX-TOS/tos-live.git"]).execute(True)
if no... | 46.272727 | 131 | 0.713163 | import tbs.helper.filedescriptor as fd
import tbs.logger.log as logger
import os
def downloadRepo(subpath="toslive"):
"""
Try to download the tos image repository and make that the current directory
"""
result = fd.CMD(["git", "clone", "https://github.com/ODEX-TOS/tos-live.git"]).execute(True)
if no... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1bd50100799ee5d890cc8d78734bdd3b575acd59 | 1,345 | py | Python | Max/Max_0034_20200303.py | Morek999/OMSCS_Taiwan_Leetcode | 8ec18e08e9313bc3326846ca6ef6e569380a133f | [
"MIT"
] | 1 | 2020-01-08T14:10:24.000Z | 2020-01-08T14:10:24.000Z | Max/Max_0034_20200303.py | Morek999/OMSCS_Taiwan_Leetcode | 8ec18e08e9313bc3326846ca6ef6e569380a133f | [
"MIT"
] | null | null | null | Max/Max_0034_20200303.py | Morek999/OMSCS_Taiwan_Leetcode | 8ec18e08e9313bc3326846ca6ef6e569380a133f | [
"MIT"
] | null | null | null | """
34. Find First and Last Position of Element in Sorted Array
https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/
Time complexity: O()
Space complexity: O()
"""
ans = [
{'nums': [5,7,7,8,8,10], 'target': 8}, # output: [3,4]
{'nums': [5,7,7,8,8,10], 'target':... | 32.804878 | 87 | 0.536803 | """
34. Find First and Last Position of Element in Sorted Array
https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/
Time complexity: O()
Space complexity: O()
"""
from typing import List
class Solution:
def searchRange(self, nums: List[int], target: int) -> List[int]:
... | 0 | 0 | 0 | 853 | 0 | 0 | 0 | 2 | 73 |
50e41fde265ef24d0d4b67344d65c242cb26a176 | 2,995 | py | Python | detection/ga/geneticalgorithm.py | MasumBhuiyan/Object-Detection-Using-Principle-Component-Analysis-and-Fuzzy-Inference-System | e9a3584f99de4aa922ac47b74a8f0a2d8a74c2e3 | [
"MIT"
] | null | null | null | detection/ga/geneticalgorithm.py | MasumBhuiyan/Object-Detection-Using-Principle-Component-Analysis-and-Fuzzy-Inference-System | e9a3584f99de4aa922ac47b74a8f0a2d8a74c2e3 | [
"MIT"
] | null | null | null | detection/ga/geneticalgorithm.py | MasumBhuiyan/Object-Detection-Using-Principle-Component-Analysis-and-Fuzzy-Inference-System | e9a3584f99de4aa922ac47b74a8f0a2d8a74c2e3 | [
"MIT"
] | 2 | 2021-03-26T15:00:53.000Z | 2021-06-11T17:08:32.000Z | last_fitness = 0
| 33.277778 | 160 | 0.635726 |
import pygad
import numpy
from fis import fuzzification
last_fitness = 0
def Run2(testset_size,test_weight):
print("GA run\n")
def Run(testset_size,test_weight):
desired_output = 100
def fitness_func(solution, solution_idx):
output = fuzzification.Run(so... | 0 | 0 | 0 | 0 | 0 | 2,854 | 0 | -10 | 129 |
5ec42dabab8a9c46baeaec63ba93044c5bc9612a | 28,721 | py | Python | src/app.py | UBC-MDS/safe_vancity | f26b522af7dd56d748761ba4cf187f352ed5d98e | [
"MIT"
] | 1 | 2022-02-15T23:15:32.000Z | 2022-02-15T23:15:32.000Z | src/app.py | UBC-MDS/safe_vancity | f26b522af7dd56d748761ba4cf187f352ed5d98e | [
"MIT"
] | 22 | 2022-02-15T23:36:44.000Z | 2022-03-18T20:21:41.000Z | src/app.py | UBC-MDS/safe_vancity | f26b522af7dd56d748761ba4cf187f352ed5d98e | [
"MIT"
] | null | null | null | import plotly.express as px
from dash import Dash, dcc, html
import dash_bootstrap_components as dbc
import pandas as pd
import altair as alt
alt.data_transformers.disable_max_rows()
# ---------------------------------------------------------------------------------------------------#
crime = pd.read_csv("data/proce... | 38.603495 | 1,262 | 0.36005 | import plotly.express as px
from dash import Dash, dcc, html, Input, Output, State, no_update
from pyproj import Transformer
import dash_bootstrap_components as dbc
import pandas as pd
import altair as alt
import os
alt.data_transformers.disable_max_rows()
# -----------------------------------------------------------... | 0 | 868 | 0 | 0 | 0 | 0 | 0 | 30 | 136 |
c906a3844040ec8eb0f09fbc5caf35ea0aa58c7c | 225 | py | Python | conversejs/admin.py | TracyWebTech/django-conversejs | cd9176f007ef3853ea6321bf93b466644d89305b | [
"Apache-2.0"
] | 17 | 2015-01-15T14:54:20.000Z | 2019-07-22T19:01:21.000Z | conversejs/admin.py | TracyWebTech/django-conversejs | cd9176f007ef3853ea6321bf93b466644d89305b | [
"Apache-2.0"
] | 10 | 2015-01-22T11:34:25.000Z | 2015-12-29T06:49:51.000Z | conversejs/admin.py | TracyWebTech/django-conversejs | cd9176f007ef3853ea6321bf93b466644d89305b | [
"Apache-2.0"
] | 7 | 2015-02-01T10:51:46.000Z | 2019-07-22T05:14:38.000Z |
from django.contrib import admin
from .models import XMPPAccount
admin.site.register(XMPPAccount, XMPPAccountAdmin)
| 20.454545 | 50 | 0.817778 |
from django.contrib import admin
from .models import XMPPAccount
from .forms import XMPPAccountForm
class XMPPAccountAdmin(admin.ModelAdmin):
form = XMPPAccountForm
admin.site.register(XMPPAccount, XMPPAccountAdmin)
| 0 | 0 | 0 | 47 | 0 | 0 | 0 | 13 | 46 |
8d382f07c1a6d909c7b7e5fd74c1dac59a425241 | 4,430 | py | Python | tests/test_weather_shopper.py | rahul-qxf2/pom_weather_shopper | 04d2b1fbdc156cfea34a379ce0856d578e8ba75e | [
"MIT"
] | null | null | null | tests/test_weather_shopper.py | rahul-qxf2/pom_weather_shopper | 04d2b1fbdc156cfea34a379ce0856d578e8ba75e | [
"MIT"
] | 1 | 2021-03-19T07:34:36.000Z | 2021-03-19T07:34:36.000Z | tests/test_weather_shopper.py | rahul-qxf2/pom_weather_shopper | 04d2b1fbdc156cfea34a379ce0856d578e8ba75e | [
"MIT"
] | null | null | null | """
This class runs all tests
"""
import os, sys, time
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from page_objects.PageFactory import PageFactory
from utils.Option_Parser import Option_Parser
import conf.product_payment_conf as conf
def test_weather_shopper_form(base_url,browser,bro... | 36.916667 | 133 | 0.651693 | """
This class runs all tests
"""
import os,sys,time,pytest
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from page_objects.PageFactory import PageFactory
from utils.Option_Parser import Option_Parser
import conf.product_payment_conf as conf
from page_objects.product_object import Product... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 38 | 22 |
6df8ae084c1668c3cef690f614a8cd5c1eea5e74 | 14,499 | py | Python | gbpservice/nfp/core/event.py | ashutosh-mishra/my-test | 51c82af293f291b9182204392e7d21bda27786d1 | [
"Apache-2.0"
] | null | null | null | gbpservice/nfp/core/event.py | ashutosh-mishra/my-test | 51c82af293f291b9182204392e7d21bda27786d1 | [
"Apache-2.0"
] | null | null | null | gbpservice/nfp/core/event.py | ashutosh-mishra/my-test | 51c82af293f291b9182204392e7d21bda27786d1 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 31.113734 | 78 | 0.596869 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 0 | 0 | 0 | 12,254 | 0 | 0 | 0 | 29 | 227 |
5329f4bfa01428003def7b44560c6d5db9d5fd28 | 1,674 | py | Python | misc/pythontools/processors/FileGlob.py | grassofsky/modules | fe51de837fed6887228f2d3f8a455d5f4602d786 | [
"BSD-2-Clause"
] | 6 | 2019-01-31T09:38:31.000Z | 2021-05-23T18:39:13.000Z | misc/pythontools/processors/FileGlob.py | grassofsky/modules | fe51de837fed6887228f2d3f8a455d5f4602d786 | [
"BSD-2-Clause"
] | 65 | 2019-01-28T20:17:35.000Z | 2022-02-25T08:08:03.000Z | misc/pythontools/processors/FileGlob.py | grassofsky/modules | fe51de837fed6887228f2d3f8a455d5f4602d786 | [
"BSD-2-Clause"
] | 7 | 2019-09-15T20:06:03.000Z | 2021-11-23T14:59:37.000Z | # Name: FileGlob
| 31 | 94 | 0.588411 | # Name: FileGlob
import inviwopy as ivw
from inviwopy.properties import FileProperty, FilePatternProperty, ButtonProperty, IntProperty
class FileGlob(ivw.Processor):
def __init__(self, id, name):
try:
ivw.Processor.__init__(self, id, name)
self.slider = IntProperty("slider", "sli... | 0 | 252 | 0 | 1,262 | 0 | 0 | 0 | 74 | 68 |
9f6e19376c686d204a4b90de34c636e11671594f | 6,330 | py | Python | supervisor/supervisor/medusa/default_handler.py | jzmq/minos | 510b6e30758f4900a72fee1a5e6258bdc7c83f17 | [
"Apache-2.0"
] | 365 | 2015-01-26T13:56:42.000Z | 2022-03-28T06:36:31.000Z | supervisor/medusa/default_handler.py | justinfx/supervisor | 9b22fe758dbc1ce99af857bb05813dd766d10a42 | [
"ZPL-2.1"
] | 3 | 2015-12-29T07:44:24.000Z | 2021-03-18T06:13:07.000Z | supervisor/medusa/default_handler.py | justinfx/supervisor | 9b22fe758dbc1ce99af857bb05813dd766d10a42 | [
"ZPL-2.1"
] | 135 | 2015-01-31T00:46:51.000Z | 2022-03-03T06:31:09.000Z | # -*- Mode: Python -*-
#
# Author: Sam Rushing <rushing@nightmare.com>
# Copyright 1997 by Sam Rushing
# All Rights Reserved.
#
RCS_ID = '$Id: default_handler.py,v 1.8 2002/08/01 18:15:45 akuchling Exp $'
# standard python modules
import re
# medusa modules
... | 29.305556 | 84 | 0.546919 | # -*- Mode: Python -*-
#
# Author: Sam Rushing <rushing@nightmare.com>
# Copyright 1997 by Sam Rushing
# All Rights Reserved.
#
RCS_ID = '$Id: default_handler.py,v 1.8 2002/08/01 18:15:45 akuchling Exp $'
# standard python modules
import mimetypes
import re
i... | 0 | 0 | 0 | 4,558 | 0 | 163 | 0 | -27 | 201 |
844deefbf0f5beda9892ce1c25788f5fb6a6be2c | 1,066 | py | Python | Python/RoadLineDetector/RoadLineDetector.py | thefool76/hacktoberfest2021 | 237751e17a4fc325ded29fca013fb9f5853cd27c | [
"CC0-1.0"
] | 448 | 2021-10-01T04:24:14.000Z | 2022-03-06T14:34:20.000Z | Python/RoadLineDetector/RoadLineDetector.py | Chanaka-Madushan-Herath/hacktoberfest2021 | 8473df9e058ccb6049720dd372342e0ea60f0e59 | [
"CC0-1.0"
] | 282 | 2021-10-01T04:29:06.000Z | 2022-03-07T12:42:57.000Z | Python/RoadLineDetector/RoadLineDetector.py | Chanaka-Madushan-Herath/hacktoberfest2021 | 8473df9e058ccb6049720dd372342e0ea60f0e59 | [
"CC0-1.0"
] | 1,807 | 2021-10-01T04:24:02.000Z | 2022-03-28T04:51:25.000Z | import cv2
import numpy as np
from matplotlib import pyplot as plt
img=cv2.imread("roads.jpg")
img=cv2.cvtColor(img,cv2.COLOR_BGR2RGB)
print(img.shape,img.dtype)
height=img.shape[0]
width=img.shape[1]
region_of_interest_vertices=[(0,height),(height/2,width/2),(width,height)]
gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
... | 28.810811 | 100 | 0.736398 | import cv2
import numpy as np
from matplotlib import pyplot as plt
def roi(image,vertices):
mask=np.zeros_like(image)
cv2.fillPoly(mask,vertices,255)
masked_image=cv2.bitwise_and(image,mask)
return masked_image
def image_with_lines(image,lines):
image=np.copy(image)
blank_image=np.zeros((image.... | 0 | 0 | 0 | 0 | 0 | 433 | 0 | 0 | 45 |
e22d3f18818a24293c91c312a74407eefa8a88ab | 6,846 | py | Python | ccash_python_client/fn.py | FearlessDoggo21/CCashPythonClient | afe6043f2544c7d49e8dfcef83fb54a18e0b3689 | [
"MIT"
] | 1 | 2021-06-11T17:38:27.000Z | 2021-06-11T17:38:27.000Z | ccash_python_client/fn.py | FearlessDoggo21/CCashPythonClient | afe6043f2544c7d49e8dfcef83fb54a18e0b3689 | [
"MIT"
] | null | null | null | ccash_python_client/fn.py | FearlessDoggo21/CCashPythonClient | afe6043f2544c7d49e8dfcef83fb54a18e0b3689 | [
"MIT"
] | null | null | null | #!/bin/python3
# ccash_python_client - ccash python client
# Copyright (C) 2021 FearlessDoggo21
# see LICENCE for licensing information
| 29.765217 | 80 | 0.49182 | #!/bin/python3
# ccash_python_client - ccash python client
# Copyright (C) 2021 FearlessDoggo21
# see LICENCE for licensing information
from requests import get, post, delete, patch, Response
from .inc import User
class CCash:
'''The CCash client class'''
def __init__(self, domain: str, timeout=20):
... | 0 | 0 | 0 | 6,607 | 0 | 0 | 0 | 34 | 68 |
384dc2e423601edf6ce4d7b45f7f867a40b688ac | 31,583 | py | Python | causalnex/structure/data_generators/core.py | jeffchiou/causalnex | b063d379ff026189f5a98be0cf6bcd172b0c89c9 | [
"Apache-2.0"
] | null | null | null | causalnex/structure/data_generators/core.py | jeffchiou/causalnex | b063d379ff026189f5a98be0cf6bcd172b0c89c9 | [
"Apache-2.0"
] | null | null | null | causalnex/structure/data_generators/core.py | jeffchiou/causalnex | b063d379ff026189f5a98be0cf6bcd172b0c89c9 | [
"Apache-2.0"
] | 1 | 2021-06-05T10:53:01.000Z | 2021-06-05T10:53:01.000Z | # Copyright 2019-2020 QuantumBlack Visual Analytics Limited
#
# 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
#
# THE SOFTWARE IS PROVIDED "AS IS"... | 37.332151 | 119 | 0.641073 | # Copyright 2019-2020 QuantumBlack Visual Analytics Limited
#
# 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
#
# THE SOFTWARE IS PROVIDED "AS IS"... | 0 | 0 | 0 | 0 | 0 | 5,398 | 0 | 90 | 252 |
a746ae8fd3aa30bc1b0f5823cfacf3f8bf6d2994 | 4,980 | py | Python | bazel/emscripten_toolchain/link_wrapper.py | lewing/emsdk | db872c7baedcaf94c6cbcc0270eaf663dee747df | [
"MIT"
] | 5 | 2020-11-22T17:29:08.000Z | 2021-05-28T23:05:33.000Z | bazel/emscripten_toolchain/link_wrapper.py | lewing/emsdk | db872c7baedcaf94c6cbcc0270eaf663dee747df | [
"MIT"
] | null | null | null | bazel/emscripten_toolchain/link_wrapper.py | lewing/emsdk | db872c7baedcaf94c6cbcc0270eaf663dee747df | [
"MIT"
] | 1 | 2021-03-25T00:55:55.000Z | 2021-03-25T00:55:55.000Z | #!/usr/bin/env python
"""wrapper around emcc link step.
This wrapper currently serves the following purposes.
1. Ensures we always link to file with .js extension. The upstream default
it to link to an llvm bitcode file which is never (AFAICT) want to do that.
2. When building with --config=wasm the final output ... | 33.877551 | 79 | 0.682932 | #!/usr/bin/env python
"""wrapper around emcc link step.
This wrapper currently serves the following purposes.
1. Ensures we always link to file with .js extension. The upstream default
it to link to an llvm bitcode file which is never (AFAICT) want to do that.
2. When building with --config=wasm the final output ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
37b5ca65506d025e6aad49698d7d40396425e95d | 3,726 | py | Python | experiment/mutual_information.py | dizcza/EmbedderSDR | 52e48efcddab44ed5040ea98e7e886a600cc0632 | [
"MIT"
] | 11 | 2018-09-17T02:15:40.000Z | 2022-02-24T11:03:19.000Z | experiment/mutual_information.py | dizcza/EmbedderSDR | 52e48efcddab44ed5040ea98e7e886a600cc0632 | [
"MIT"
] | null | null | null | experiment/mutual_information.py | dizcza/EmbedderSDR | 52e48efcddab44ed5040ea98e7e886a600cc0632 | [
"MIT"
] | 1 | 2020-05-20T06:38:41.000Z | 2020-05-20T06:38:41.000Z | import torch
import torch.utils.data
from mighty.monitor.mutual_info.gcmi import micd
from mighty.utils.common import set_seed
def synthesize_log_softmax_data(n_samples=50000, n_classes=10, p_argmax=0.95, onehot=False):
"""
Simulates a typical trained neural network softmax output probabilities.
Paramete... | 37.26 | 108 | 0.71256 | import math
import random
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.utils.data
from mighty.monitor.mutual_info.gcmi import micd
from mighty.monitor.mutual_info.kmeans import MutualInfoKMeans
from mighty.monitor.mutual_info.neural_estimation import MINE_Net, MINE_Trainer
from mighty.u... | 0 | 0 | 0 | 0 | 0 | 1,419 | 0 | 114 | 223 |