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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
383f88810e1b95817a3295f34fb9a6efcdc82b4b | 93 | py | Python | code/5/global_variable_3.py | TeamLab/introduction_to_pythoy_TEAMLAB_MOOC | ebf1ff02d6a341bfee8695eac478ff8297cb97e4 | [
"MIT"
] | 65 | 2017-11-01T01:57:21.000Z | 2022-02-08T13:36:25.000Z | code/5/global_variable_3.py | TeamLab/introduction_to_pythoy_TEAMLAB_MOOC | ebf1ff02d6a341bfee8695eac478ff8297cb97e4 | [
"MIT"
] | 9 | 2017-11-03T15:05:30.000Z | 2018-05-17T03:18:36.000Z | code/5/global_variable_3.py | TeamLab/introduction_to_pythoy_TEAMLAB_MOOC | ebf1ff02d6a341bfee8695eac478ff8297cb97e4 | [
"MIT"
] | 64 | 2017-11-01T01:57:23.000Z | 2022-01-19T03:52:12.000Z |
s = "I love Paris!"
f()
print(s) | 11.625 | 24 | 0.505376 | def f():
global s
s = "I love London!"
print(s)
s = "I love Paris!"
f()
print(s) | 0 | 0 | 0 | 0 | 0 | 38 | 0 | 0 | 22 |
45903d740e562705ce7c9d36456bfb4a5697c834 | 333 | py | Python | Chapter02/ComputeAverage.py | ywyz/IntroducingToProgrammingUsingPython | 614d59eacb7e37aece871a00f7d1518f7de88708 | [
"Apache-2.0"
] | null | null | null | Chapter02/ComputeAverage.py | ywyz/IntroducingToProgrammingUsingPython | 614d59eacb7e37aece871a00f7d1518f7de88708 | [
"Apache-2.0"
] | null | null | null | Chapter02/ComputeAverage.py | ywyz/IntroducingToProgrammingUsingPython | 614d59eacb7e37aece871a00f7d1518f7de88708 | [
"Apache-2.0"
] | null | null | null | # Prompt the user to enter three numbers
number1 = eval(input("Enter the first number: "))
number2 = eval(input("Enter the second number: "))
number3 = eval(input("Enter the third number:"))
# Compute average
average = (number1 + number2 + number3)
# Display result
print("The average of", number1, number2, number3, "i... | 33.3 | 65 | 0.720721 | # Prompt the user to enter three numbers
number1 = eval(input("Enter the first number: "))
number2 = eval(input("Enter the second number: "))
number3 = eval(input("Enter the third number:"))
# Compute average
average = (number1 + number2 + number3)
# Display result
print("The average of", number1, number2, number3, "i... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a7d65cae36511b64e4eb7d3a8cba6933dc81c57a | 18,932 | py | Python | src/oci/cloud_guard/models/recommendation_summary.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 249 | 2017-09-11T22:06:05.000Z | 2022-03-04T17:09:29.000Z | src/oci/cloud_guard/models/recommendation_summary.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 228 | 2017-09-11T23:07:26.000Z | 2022-03-23T10:58:50.000Z | src/oci/cloud_guard/models/recommendation_summary.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 224 | 2017-09-27T07:32:43.000Z | 2022-03-25T16:55:42.000Z | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 32.982578 | 245 | 0.650697 | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 0 | 18,401 | 0 | 0 | 0 | 0 | 0 | 105 | 82 |
c315dd2dac0ad8c8f66daadde06bb6de0f603db9 | 11,405 | py | Python | src/ZTUtils/Zope.py | Mattlk13/Zope | b26ba322565f640f1c62b4a8d6b407cf5df5fdcd | [
"ZPL-2.1"
] | null | null | null | src/ZTUtils/Zope.py | Mattlk13/Zope | b26ba322565f640f1c62b4a8d6b407cf5df5fdcd | [
"ZPL-2.1"
] | 1 | 2020-11-11T07:11:31.000Z | 2020-11-11T07:11:31.000Z | src/ZTUtils/Zope.py | Mattlk13/Zope | b26ba322565f640f1c62b4a8d6b407cf5df5fdcd | [
"ZPL-2.1"
] | null | null | null | ##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... | 31.946779 | 79 | 0.578255 | ##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... | 0 | 0 | 0 | 3,747 | 0 | 516 | 0 | 185 | 432 |
c8a50b9459789ee60bac164f48f4af6098505bb5 | 2,436 | py | Python | VidBot.Core.py | GCStokum/oneohtrix-point-never-robot | b7e66d767786cae621d557aa2c1ea382662cba1a | [
"MIT"
] | null | null | null | VidBot.Core.py | GCStokum/oneohtrix-point-never-robot | b7e66d767786cae621d557aa2c1ea382662cba1a | [
"MIT"
] | null | null | null | VidBot.Core.py | GCStokum/oneohtrix-point-never-robot | b7e66d767786cae621d557aa2c1ea382662cba1a | [
"MIT"
] | null | null | null | import sys
import os
import RPi.GPIO as GPIO
import time
import pygame
DEBUG = False
RUNNING = True
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
pygame.init()
screen = pygame.display.set_mode([50,50])
ObjStep = 22
ObjDir = 27
SlideStep = 17
SlideDir = 4
LEDR = 24
LEDG = 18
LEDB = 23
#LEDRoll = 0
StepPause = 0.005 ... | 19.967213 | 41 | 0.521757 | import sys
import os
import RPi.GPIO as GPIO
import time
import pygame
DEBUG = False
RUNNING = True
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
pygame.init()
screen = pygame.display.set_mode([50,50])
ObjStep = 22
ObjDir = 27
SlideStep = 17
SlideDir = 4
LEDR = 24
LEDG = 18
LEDB = 23
#LEDRoll = 0
StepPause = 0.005 ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b86976e2760e9f2d99af91de031f84133666e77d | 4,295 | py | Python | test/testers/winforms/toolstriptextbox-regression.py | ABEMBARKA/monoUI | 5fda266ad2db8f89580a40b525973d86cd8de939 | [
"MIT"
] | 1 | 2019-08-13T15:22:12.000Z | 2019-08-13T15:22:12.000Z | test/testers/winforms/toolstriptextbox-regression.py | ABEMBARKA/monoUI | 5fda266ad2db8f89580a40b525973d86cd8de939 | [
"MIT"
] | null | null | null | test/testers/winforms/toolstriptextbox-regression.py | ABEMBARKA/monoUI | 5fda266ad2db8f89580a40b525973d86cd8de939 | [
"MIT"
] | 1 | 2019-08-13T15:22:17.000Z | 2019-08-13T15:22:17.000Z | #!/usr/bin/env python
##############################################################################
# Written by: Cachen Chen <cachen@novell.com>
# Date: 12/11/2008
# Description: Test accessibility of toolstriptextbox widget
# Use the toolstriptextboxframe.py wrapper script
# Test ... | 32.537879 | 80 | 0.721071 | #!/usr/bin/env python
##############################################################################
# Written by: Cachen Chen <cachen@novell.com>
# Date: 12/11/2008
# Description: Test accessibility of toolstriptextbox widget
# Use the toolstriptextboxframe.py wrapper script
# Test ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 12 | 67 |
05ad32155c5c810f311fb5d767ec0cb54f183d17 | 861 | py | Python | api/team_directory/users/admin.py | Hipo/team-directory | dfc999a6b464e88c020cfebe3b569b960b5d7e3d | [
"MIT"
] | null | null | null | api/team_directory/users/admin.py | Hipo/team-directory | dfc999a6b464e88c020cfebe3b569b960b5d7e3d | [
"MIT"
] | 2 | 2020-06-05T23:54:21.000Z | 2020-09-30T12:50:16.000Z | api/team_directory/users/admin.py | Hipo/team-directory | dfc999a6b464e88c020cfebe3b569b960b5d7e3d | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import User
admin.site.register(User, UserAdmin)
| 27.774194 | 84 | 0.689895 | from django.contrib import admin
from django.contrib import messages
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from .models import User
class UserAdmin(admin.ModelAdmin):
ordering = ['id']
list_display = ['id', 'email', 'first_name', 'last_name', 'is_staff']
actions = ["send_agora... | 0 | 0 | 0 | 638 | 0 | 0 | 0 | 57 | 67 |
f6509e45eb986decc148dd6b720f53b7c246910c | 152 | py | Python | Project/unet/misc.py | yusukekyokawa/unet | ddf80d4138eac6dfe367606904a07672d273ef6e | [
"MIT"
] | null | null | null | Project/unet/misc.py | yusukekyokawa/unet | ddf80d4138eac6dfe367606904a07672d273ef6e | [
"MIT"
] | null | null | null | Project/unet/misc.py | yusukekyokawa/unet | ddf80d4138eac6dfe367606904a07672d273ef6e | [
"MIT"
] | null | null | null | import cv2
if __name__ == "__main__":
img = cv2.imread("../ARC_DATAS/arcKG00001_00048/arcKG00001.jpg")
img = cv2.resize(img, (256, 256))
| 19 | 72 | 0.644737 | import cv2
if __name__ == "__main__":
img = cv2.imread("../ARC_DATAS/arcKG00001_00048/arcKG00001.jpg")
img = cv2.resize(img, (256, 256))
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
95a2e69dae1b2b8b0852c4ec774a2767745939a8 | 2,395 | py | Python | python/284.peeking-iterator.py | fengbaoheng/leetcode | 2b6ec9adea383503acc23622ca5623161f7ca520 | [
"MIT"
] | 1 | 2019-04-11T12:34:55.000Z | 2019-04-11T12:34:55.000Z | python/284.peeking-iterator.py | fengbaoheng/leetcode | 2b6ec9adea383503acc23622ca5623161f7ca520 | [
"MIT"
] | null | null | null | python/284.peeking-iterator.py | fengbaoheng/leetcode | 2b6ec9adea383503acc23622ca5623161f7ca520 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode.cn id=284 lang=python3
#
# [284]
#
# https://leetcode-cn.com/problems/peeking-iterator/description/
#
# algorithms
# Medium (65.89%)
# Total Accepted: 902
# Total Submissions: 1.4K
# Testcase Example: '["PeekingIterator","next","peek","next","next","hasNext"]\n[[[1,2,3]],[],[],[],[],[]]'
#
# n... | 24.191919 | 108 | 0.561587 | #
# @lc app=leetcode.cn id=284 lang=python3
#
# [284] 顶端迭代器
#
# https://leetcode-cn.com/problems/peeking-iterator/description/
#
# algorithms
# Medium (65.89%)
# Total Accepted: 902
# Total Submissions: 1.4K
# Testcase Example: '["PeekingIterator","next","peek","next","next","hasNext"]\n[[[1,2,3]],[],[],[],[],[]]'
... | 594 | 0 | 0 | 903 | 0 | 0 | 0 | 0 | 23 |
a916a9437925a8bc601e0ac70f47a7ef0eb04f40 | 3,598 | py | Python | handlePragram_PY/addNew.py | cxz66666/data-visualization-summerschool2020 | 329710e152414d01df93c5c1ed04231a066bb874 | [
"MIT"
] | null | null | null | handlePragram_PY/addNew.py | cxz66666/data-visualization-summerschool2020 | 329710e152414d01df93c5c1ed04231a066bb874 | [
"MIT"
] | null | null | null | handlePragram_PY/addNew.py | cxz66666/data-visualization-summerschool2020 | 329710e152414d01df93c5c1ed04231a066bb874 | [
"MIT"
] | null | null | null | datelist = [
'2020-01-25', '2020-01-26', '2020-01-27', '2020-01-28', '2020-01-29',
'2020-01-30', '2020-01-31', '2020-02-01', '2020-02-02', '2020-02-03',
'2020-02-04', '2020-02-05', '2020-02-06', '2020-02-07', '2020-02-08',
'2020-02-09', '2020-02-10', '2020-02-11', '2020-02-12', '2020-02-13',
'2020-0... | 54.515152 | 79 | 0.555309 | datelist = [
'2020-01-25', '2020-01-26', '2020-01-27', '2020-01-28', '2020-01-29',
'2020-01-30', '2020-01-31', '2020-02-01', '2020-02-02', '2020-02-03',
'2020-02-04', '2020-02-05', '2020-02-06', '2020-02-07', '2020-02-08',
'2020-02-09', '2020-02-10', '2020-02-11', '2020-02-12', '2020-02-13',
'2020-0... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4db67ba216daf224d65d3acfb9d0036aed9e5869 | 5,608 | py | Python | model.py | mikepieper/carnd-behavior-cloning | 4052aca0c43032f0e6f528b94b41e79dd828771c | [
"MIT"
] | null | null | null | model.py | mikepieper/carnd-behavior-cloning | 4052aca0c43032f0e6f528b94b41e79dd828771c | [
"MIT"
] | null | null | null | model.py | mikepieper/carnd-behavior-cloning | 4052aca0c43032f0e6f528b94b41e79dd828771c | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import cv2
import tensorflow as tf
from tensorflow.keras import datasets, layers, models
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Conv2D, Flatten, Dropout, MaxPooling2D, BatchNormalization, ReLU
from tensorflow.keras.preprocessing.i... | 37.139073 | 121 | 0.648181 | import pandas as pd
import numpy as np
import cv2
import tensorflow as tf
from tensorflow.keras import datasets, layers, models
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Conv2D, Flatten, Dropout, MaxPooling2D, BatchNormalization, ReLU
from tensorflow.keras.preprocessing.i... | 0 | 0 | 0 | 0 | 0 | 1,974 | 0 | 0 | 92 |
166af5fe4812b3287f25dbec0b381cc3f5bd0fc0 | 10,193 | py | Python | ccuapi/test.py | ScholzVolkmer/python-ccuapi | a823f5da158f7566945d38bf0049a91173f13781 | [
"BSD-3-Clause"
] | 7 | 2015-07-18T06:36:11.000Z | 2019-04-10T08:06:49.000Z | ccuapi/test.py | ScholzVolkmer/python-ccuapi | a823f5da158f7566945d38bf0049a91173f13781 | [
"BSD-3-Clause"
] | 4 | 2015-03-03T16:26:38.000Z | 2019-05-29T10:33:05.000Z | ccuapi/test.py | ScholzVolkmer/python-ccuapi | a823f5da158f7566945d38bf0049a91173f13781 | [
"BSD-3-Clause"
] | 5 | 2015-06-12T11:34:16.000Z | 2021-02-03T11:29:55.000Z | """
Unit tests for python ccuapi
"""
# pylint: disable=too-many-public-methods
# Define all the mocks we need here. We are disabling unused-argument for
# pylint on all the mocks. The way httmock works we have to mimic the
# signature with url, request, but we never use them. We disable it once
# at the top of this ... | 35.392361 | 79 | 0.584421 | """
Unit tests for python ccuapi
"""
from unittest import TestCase
from httmock import HTTMock, all_requests
from .purge import PurgeRequest
from .exceptions import AkamaiAuthorizationException
from .exceptions import AkamaiArlPurgeWithoutUrls
from .exceptions import AkamaiStatusRequestWithoutPurge
from .exceptions... | 0 | 4,012 | 0 | 5,083 | 0 | 0 | 0 | 218 | 361 |
793c77a917de86969d8f4ded73b3c5ffb45c934f | 10,754 | py | Python | web/ValidatePage.py | faithcomesbyhearing/dbp-etl | ffd849111e8e2d40e9b07663408d31b5a2d15ce7 | [
"MIT"
] | null | null | null | web/ValidatePage.py | faithcomesbyhearing/dbp-etl | ffd849111e8e2d40e9b07663408d31b5a2d15ce7 | [
"MIT"
] | 4 | 2021-03-10T22:20:29.000Z | 2022-03-23T22:18:00.000Z | web/ValidatePage.py | faithcomesbyhearing/dbp-etl | ffd849111e8e2d40e9b07663408d31b5a2d15ce7 | [
"MIT"
] | 1 | 2021-03-10T20:49:43.000Z | 2021-03-10T20:49:43.000Z | #!/usr/bin/python3
#
# ValidatePage.py
#
# This program presents an information page that can be used
# to validate the correctness of information about a Bible.
# It displays information about that Bible, and reports
# any errors that it finds.
#
# This class should be in the cgi-bin directory of a website.
# Where it... | 38 | 144 | 0.688395 | #!/usr/bin/python3
#
# ValidatePage.py
#
# This program presents an information page that can be used
# to validate the correctness of information about a Bible.
# It displays information about that Bible, and reports
# any errors that it finds.
#
# This class should be in the cgi-bin directory of a website.
# Where it... | 0 | 0 | 0 | 7,146 | 0 | 0 | 0 | -27 | 112 |
7089a18572e25f982ceb8ce01cb1de1ee57d09ad | 5,865 | py | Python | src/tools/blast2go/b2g4pipe.py | uct-cbio/galaxy-tools | b9422088dc41099fdde1edaf9c014825c8ee1cbf | [
"MIT"
] | null | null | null | src/tools/blast2go/b2g4pipe.py | uct-cbio/galaxy-tools | b9422088dc41099fdde1edaf9c014825c8ee1cbf | [
"MIT"
] | null | null | null | src/tools/blast2go/b2g4pipe.py | uct-cbio/galaxy-tools | b9422088dc41099fdde1edaf9c014825c8ee1cbf | [
"MIT"
] | null | null | null | #!/usr/bin/python
# Run console version of Blast2G0 (b2g4pipe)
# nohup time java -jar ~/blast2go/b2g4pipe/latest/pipeline/blast2go.jar -in blastp_nr.xml -out all_blastp_nr -prop blast2go.properties -annot -dat -v -ips interproscan/ -img -wiki ~/blast2go/b2g4pipe/latest/pipeline/wiki_arrayannot.txt > log.txt 2>&1 &
i... | 51.902655 | 253 | 0.695652 | #!/usr/bin/python
# Run console version of Blast2G0 (b2g4pipe)
# nohup time java -jar ~/blast2go/b2g4pipe/latest/pipeline/blast2go.jar -in blastp_nr.xml -out all_blastp_nr -prop blast2go.properties -annot -dat -v -ips interproscan/ -img -wiki ~/blast2go/b2g4pipe/latest/pipeline/wiki_arrayannot.txt > log.txt 2>&1 &
i... | 0 | 0 | 0 | 0 | 0 | 5,366 | 0 | 52 | 67 |
2b0cd337bd1b26b5bdfc9278c41c7ff439d0ad77 | 9,066 | py | Python | attacks.py | vv52/destitute-dreamscape | 9573c8f01c4c62fefa0fe005999a471754d5e006 | [
"Apache-2.0"
] | null | null | null | attacks.py | vv52/destitute-dreamscape | 9573c8f01c4c62fefa0fe005999a471754d5e006 | [
"Apache-2.0"
] | null | null | null | attacks.py | vv52/destitute-dreamscape | 9573c8f01c4c62fefa0fe005999a471754d5e006 | [
"Apache-2.0"
] | null | null | null |
SCREEN_WIDTH = 512
SCREEN_HEIGHT = 740
| 47.21875 | 110 | 0.59111 | from random import Random
import projectiles
SCREEN_WIDTH = 512
SCREEN_HEIGHT = 740
def CircleSpawner(loc, div, kind, offset, bullets, sprites):
bullet_counter = 0
angle = 360 / div
while bullet_counter < div:
if kind == "w":
new_bullet = projectiles.WarblyBullet(loc.x, lo... | 0 | 0 | 0 | 0 | 0 | 8,841 | 0 | 1 | 171 |
c899d9c67a861f2ed91a9324d84e51706f7fc097 | 21,209 | py | Python | QuadTree.py | esihaj/Map | 7de5d822f73182f9a01c9059b31e65451f62c619 | [
"MIT"
] | 1 | 2019-11-18T03:45:14.000Z | 2019-11-18T03:45:14.000Z | QuadTree.py | esihaj/Map | 7de5d822f73182f9a01c9059b31e65451f62c619 | [
"MIT"
] | null | null | null | QuadTree.py | esihaj/Map | 7de5d822f73182f9a01c9059b31e65451f62c619 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Dec 02 23:17:43 2014
@author: Ehsan
"""
import os
#import sys
LOGLEVEL = 0
LOG_GENERAL = 1
LOG_INTERSECT = 1.3
LOG_TREE = 2
LOG_GENERATE = 3
#utility : isFile
base_dir = os.path.dirname(__file__) + '/'
#assuming What Reza Keramti Told is True
... | 39.642991 | 150 | 0.54425 | # -*- coding: utf-8 -*-
"""
Created on Tue Dec 02 23:17:43 2014
@author: Ehsan
"""
import json
import os
#import sys
import pygame
import closestpoint
import pathfinder
import copy
LOGLEVEL = 0
LOG_GENERAL = 1
LOG_INTERSECT = 1.3
LOG_TREE = 2
LOG_GENERATE = 3
def LOG(string, level = LOG_GENERAL):
if level <= ... | 0 | 0 | 0 | 14,881 | 0 | 5,090 | 0 | -34 | 431 |
47934f145b887a0187ee32ae74d83c811f4fd231 | 488 | py | Python | python/load_data.py | Rubix982/Collaborative-Filtering | 7b7cadfdca1218dbacb696f1125fe9d6096be9e3 | [
"MIT"
] | null | null | null | python/load_data.py | Rubix982/Collaborative-Filtering | 7b7cadfdca1218dbacb696f1125fe9d6096be9e3 | [
"MIT"
] | null | null | null | python/load_data.py | Rubix982/Collaborative-Filtering | 7b7cadfdca1218dbacb696f1125fe9d6096be9e3 | [
"MIT"
] | null | null | null | import pandas as pd
from surprise import Dataset
from surprise import Reader
ratings_dict = {
"item": [1, 2, 1, 2, 1, 2, 1, 2, 1],
"user": ['A', 'A', 'B', 'B', 'C', 'C', 'D', 'D', 'E'],
"rating": [1, 2, 2, 4, 2.5, 4, 4.5, 5, 3],
}
df = pd.DataFrame(ratings_dict)
reader = Reader(rating_scale=(1, 5))
# Loa... | 27.111111 | 75 | 0.598361 | import pandas as pd
from surprise import Dataset
from surprise import Reader
ratings_dict = {
"item": [1, 2, 1, 2, 1, 2, 1, 2, 1],
"user": ['A', 'A', 'B', 'B', 'C', 'C', 'D', 'D', 'E'],
"rating": [1, 2, 2, 4, 2.5, 4, 4.5, 5, 3],
}
df = pd.DataFrame(ratings_dict)
reader = Reader(rating_scale=(1, 5))
# Loa... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
83bc673d4cae4f4087b69c2079bb0f39d4c924a3 | 2,929 | py | Python | deprecated/tests_vismesh_generator.py | rPoXoTauJIo/mesh-merger | a7630e8c080b6c7df9c5725495b3ce46fc0b429f | [
"MIT"
] | 2 | 2020-04-03T18:07:24.000Z | 2021-04-29T21:57:27.000Z | deprecated/tests_vismesh_generator.py | rPoXoTauJIo/mesh-merger | a7630e8c080b6c7df9c5725495b3ce46fc0b429f | [
"MIT"
] | 1 | 2018-01-16T04:53:06.000Z | 2018-01-16T07:13:59.000Z | deprecated/tests_vismesh_generator.py | rPoXoTauJIo/BF2Mesh | a7630e8c080b6c7df9c5725495b3ce46fc0b429f | [
"MIT"
] | 1 | 2019-10-28T14:36:20.000Z | 2019-10-28T14:36:20.000Z | import unittest
import tests.mock_mesh as mock_mesh
if __name__ == '__main__':
unittest.main() | 40.680556 | 138 | 0.610789 | import unittest
import copy
import os
import modmesh
from modmesh import D3DDECLTYPE, D3DDECLUSAGE
import tests.mock_mesh as mock_mesh
class TestVisMeshVertexGenerator(unittest.TestCase):
def test_can_serialize_vertices(self):
vmesh = mock_mesh.Box()
vertsize = int(vmesh.vertstride / vmesh.v... | 0 | 0 | 0 | 2,706 | 0 | 0 | 0 | -5 | 112 |
87206bb11233eb6d19365e090ddc6904ef0f525a | 1,333 | py | Python | laboratorium_10/zadanie_3.py | MiZych/wdi | da3f3128ed60a2fad22d85f2ef869068fcdd51ae | [
"MIT"
] | null | null | null | laboratorium_10/zadanie_3.py | MiZych/wdi | da3f3128ed60a2fad22d85f2ef869068fcdd51ae | [
"MIT"
] | null | null | null | laboratorium_10/zadanie_3.py | MiZych/wdi | da3f3128ed60a2fad22d85f2ef869068fcdd51ae | [
"MIT"
] | null | null | null | #Plansze
try:
height = int(input("Wprowad wysoko: "))
width = int(input("Wprowad szeroko: "))
list_of_lines = making_list(height)
redirect_and_create(list_of_lines, width)
except ValueError:
print("Wproawd poprawn liczb kolumn i wierszy") | 31 | 90 | 0.496624 | #Plansze
try:
height = int(input("Wprowadź wysokość: "))
width = int(input("Wprowadź szerokość: "))
def making_list(height):
#1 - first_line, 2 - width_line
how_many = []
how_many.append(1)
for i in range(1, height * 3):
if i % 2 == 0 and i % 3 == 0:
... | 18 | 0 | 0 | 0 | 0 | 1,006 | 0 | 0 | 54 |
0aa3e4350559f027634c8b52802a569853f5eecd | 2,700 | py | Python | tests/dsdl/conftest.py | subakio/pyuavcan | 4ec55a80f8fd3dd21a3d08102837c43d832b71a3 | [
"MIT"
] | 89 | 2015-06-10T11:42:06.000Z | 2022-03-28T08:34:06.000Z | tests/dsdl/conftest.py | subakio/pyuavcan | 4ec55a80f8fd3dd21a3d08102837c43d832b71a3 | [
"MIT"
] | 195 | 2015-06-10T12:02:44.000Z | 2022-03-28T15:30:50.000Z | tests/dsdl/conftest.py | subakio/pyuavcan | 4ec55a80f8fd3dd21a3d08102837c43d832b71a3 | [
"MIT"
] | 96 | 2016-02-29T07:47:15.000Z | 2022-03-19T06:05:44.000Z | # Copyright (c) 2019 UAVCAN Consortium
# This software is distributed under the terms of the MIT License.
# Author: Pavel Kirienko <pavel@uavcan.org>
from pathlib import Path
import pytest
# Please maintain these carefully if you're changing the project's directory structure.
SELF_DIR = Path(__file__).resolve().paren... | 36 | 115 | 0.707037 | # Copyright (c) 2019 UAVCAN Consortium
# This software is distributed under the terms of the MIT License.
# Author: Pavel Kirienko <pavel@uavcan.org>
import sys
import pickle
import typing
import shutil
import logging
import functools
import importlib
from pathlib import Path
import pytest
import pyuavcan.dsdl
# Ple... | 0 | 1,998 | 0 | 0 | 0 | 0 | 0 | -53 | 200 |
e5c07003c6f0c82482719c2d4d78e54f665b5ba4 | 132 | py | Python | __init__.py | 64-B1T/faser_path_planning | 743452a92f226f6ecb09dc812590b2e327587339 | [
"MIT"
] | null | null | null | __init__.py | 64-B1T/faser_path_planning | 743452a92f226f6ecb09dc812590b2e327587339 | [
"MIT"
] | null | null | null | __init__.py | 64-B1T/faser_path_planning | 743452a92f226f6ecb09dc812590b2e327587339 | [
"MIT"
] | null | null | null | import sys
import os
sys.path.append(os.path.dirname(__file__))
| 26.4 | 67 | 0.810606 | import sys
import os
sys.path.append(os.path.dirname(__file__))
from pathplanner import Tree6Node, PathNode, Graph, RRTStar, R6Tree
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 46 | 22 |
a9da23b02a106bf09f211285c1eadf1692b49b91 | 92 | py | Python | Introductory Problems/Two Knights.py | charlie219/CSES-Solutions | e082380cbb3ad74eaa9a55f71a2f9df904477ef2 | [
"MIT"
] | null | null | null | Introductory Problems/Two Knights.py | charlie219/CSES-Solutions | e082380cbb3ad74eaa9a55f71a2f9df904477ef2 | [
"MIT"
] | null | null | null | Introductory Problems/Two Knights.py | charlie219/CSES-Solutions | e082380cbb3ad74eaa9a55f71a2f9df904477ef2 | [
"MIT"
] | null | null | null | print(*[int(((x**2*(x**2-1))/2)-4*(x-1)*(x-2)) for x in range(1,int(input())+1)],sep='\n')
| 46 | 91 | 0.478261 | print(*[int(((x**2*(x**2-1))/2)-4*(x-1)*(x-2)) for x in range(1,int(input())+1)],sep='\n')
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d39e87e58566c92938de65c94cfb22a2ccdd7909 | 4,776 | py | Python | pytorch_model/Flask_App/predict.py | sankalp1999/Image_Captioning_With_Attention | 7f67bf515cc803f2bfb884da01403ab30bf08fac | [
"MIT"
] | 19 | 2020-12-05T19:12:09.000Z | 2022-03-30T13:34:54.000Z | pytorch_model/Flask_App/predict.py | sankalp1999/Image_Captioning_With_Attention | 7f67bf515cc803f2bfb884da01403ab30bf08fac | [
"MIT"
] | null | null | null | pytorch_model/Flask_App/predict.py | sankalp1999/Image_Captioning_With_Attention | 7f67bf515cc803f2bfb884da01403ab30bf08fac | [
"MIT"
] | 3 | 2021-05-23T17:34:24.000Z | 2021-12-27T14:18:32.000Z | import torch.nn as nn
import torch.optim as optim
import torchvision.transforms as transforms
import torchvision.models as models
device = 'cpu'
# image_path = 'flickr8k/Images/54501196_a9ac9d66f2.jpg'
| 27.448276 | 109 | 0.653476 | import pickle
from model import BahdanauAttention, EncoderCNN, Decoder
from vocab import Vocab_Builder
import torch
import torch.nn as nn
import torch.optim as optim
import torchvision.transforms as transforms
import torch.nn.functional as F
import torchvision.models as models
from torch.utils.tensorboard import Summar... | 0 | 0 | 0 | 2,055 | 0 | 2,157 | 0 | 54 | 291 |
c1c5b3471d4321eed9eb9f442c7528c8969866f5 | 19,487 | py | Python | behavior_comparisons.py | bartulem/KISN-pancortical-kinematics | a849a71a59143e432f5dc048cd0d700373082933 | [
"MIT"
] | 2 | 2022-02-11T00:45:46.000Z | 2022-03-16T15:00:50.000Z | behavior_comparisons.py | bartulem/KISN-pancortical-kinematics | a849a71a59143e432f5dc048cd0d700373082933 | [
"MIT"
] | null | null | null | behavior_comparisons.py | bartulem/KISN-pancortical-kinematics | a849a71a59143e432f5dc048cd0d700373082933 | [
"MIT"
] | 1 | 2022-03-08T07:12:59.000Z | 2022-03-08T07:12:59.000Z | """
Computes behavioral comparisons, e.g. between weight/no-weight.
@author: bartulem
"""
| 60.707165 | 183 | 0.528711 | """
Computes behavioral comparisons, e.g. between weight/no-weight.
@author: bartulem
"""
import os
import sys
import numpy as np
import matplotlib.pyplot as plt
from numba import njit
from scipy.stats import sem
import sessions2load
import make_ratemaps
@njit(parallel=False)
def get_bins(feature_arr, min_val, max_v... | 0 | 538 | 0 | 18,645 | 0 | 0 | 0 | -11 | 223 |
69b030e87854146c408a4e5dbe5817be9976d71f | 11,740 | py | Python | src/aceinna/devices/parsers/rtk330l_message_parser.py | lihaiyong827/acenav-cli | eb75332cbe1a658b017d62ecb8272a2bc7a406a3 | [
"Apache-2.0"
] | 1 | 2021-09-23T05:00:05.000Z | 2021-09-23T05:00:05.000Z | src/aceinna/devices/parsers/rtk330l_message_parser.py | lihaiyong827/acenav-cli | eb75332cbe1a658b017d62ecb8272a2bc7a406a3 | [
"Apache-2.0"
] | null | null | null | src/aceinna/devices/parsers/rtk330l_message_parser.py | lihaiyong827/acenav-cli | eb75332cbe1a658b017d62ecb8272a2bc7a406a3 | [
"Apache-2.0"
] | 1 | 2021-09-23T05:00:09.000Z | 2021-09-23T05:00:09.000Z |
MSG_HEADER = [0x55, 0x55]
PACKET_TYPE_INDEX = 2
INPUT_PACKETS = ['pG', 'uC', 'uP', 'uA', 'uB',
'sC', 'rD',
'gC', 'gA', 'gB', 'gP', 'gV', 'cA'
'\x15\x15', '\x00\x00',
'JI', 'JA', 'WA', 'CS', 'JS', 'JG'
'RE', 'WE', 'UE', 'LE', 'SR',
... | 38.116883 | 104 | 0.570954 | import collections
import operator
import time
from ..base.message_parser_base import MessageParserBase
from ...framework.utils import helper
from ...framework.context import APP_CONTEXT
from .rtk330l_packet_parser import (
match_command_handler, common_continuous_parser, other_output_parser)
MSG_HEADER = [0x55, 0... | 0 | 217 | 0 | 5,611 | 0 | 0 | 0 | 144 | 223 |
abbce0cdabbba36d6be8394deebe205c4fb56b71 | 7,565 | py | Python | train.py | alankashiwa/image-classifier-pytorch | adfed8ab7350c62e33882342d5e7a21dfb586381 | [
"MIT"
] | null | null | null | train.py | alankashiwa/image-classifier-pytorch | adfed8ab7350c62e33882342d5e7a21dfb586381 | [
"MIT"
] | null | null | null | train.py | alankashiwa/image-classifier-pytorch | adfed8ab7350c62e33882342d5e7a21dfb586381 | [
"MIT"
] | null | null | null | import argparse
import json
from collections import OrderedDict
import os
import torch
from torch import nn, optim
from torchvision import transforms, datasets, models
parser = argparse.ArgumentParser(description='Model Training')
parser.add_argument('data_dir', type=str, help='data directory')
parser.add_argument('-... | 35.683962 | 108 | 0.666755 | import argparse
import json
from collections import OrderedDict
import os
import torch
from torch import nn, optim
import torchvision
from torchvision import transforms, datasets, models
parser = argparse.ArgumentParser(description='Model Training')
parser.add_argument('data_dir', type=str, help='data directory')
par... | 0 | 0 | 0 | 0 | 0 | 2,132 | 0 | -3 | 89 |
67d6821143704459979c3c9b532d6d4f873d8cbb | 4,416 | py | Python | bartpy/samplers/unconstrainedtree/proposer.py | danielremo/bartpy | f299d8be9378daf75ee1a6b1527de5cb0f0ced89 | [
"MIT"
] | null | null | null | bartpy/samplers/unconstrainedtree/proposer.py | danielremo/bartpy | f299d8be9378daf75ee1a6b1527de5cb0f0ced89 | [
"MIT"
] | null | null | null | bartpy/samplers/unconstrainedtree/proposer.py | danielremo/bartpy | f299d8be9378daf75ee1a6b1527de5cb0f0ced89 | [
"MIT"
] | null | null | null | from operator import le, gt
from typing import Optional, Tuple
import numpy as np
from bartpy.errors import NoSplittableVariableException, NoPrunableNodeException
from bartpy.node import LeafNode, DecisionNode, split_node
from bartpy.split import SplitCondition
from bartpy.tree import Tree
def random_splittable... | 40.145455 | 114 | 0.702446 | from operator import le, gt
from typing import Callable, List, Mapping, Optional, Tuple
import numpy as np
from bartpy.errors import NoSplittableVariableException, NoPrunableNodeException
from bartpy.mutation import TreeMutation, GrowMutation, PruneMutation, ChangeMutation
from bartpy.node import LeafNode, DecisionNo... | 0 | 0 | 0 | 1,257 | 0 | 613 | 0 | 158 | 158 |
068c9570dbdb4bc20778101748ae1735840fd815 | 475 | py | Python | states.py | csitsociety/corporeal-bit | 727a133836aa582f9afb9558986ed4db678f78cb | [
"MIT"
] | null | null | null | states.py | csitsociety/corporeal-bit | 727a133836aa582f9afb9558986ed4db678f78cb | [
"MIT"
] | null | null | null | states.py | csitsociety/corporeal-bit | 727a133836aa582f9afb9558986ed4db678f78cb | [
"MIT"
] | null | null | null | # Keep track of the face state
IDLE = 'blink'
HAPPY = 'happy'
SAD = 'sad'
CRY = 'cry'
SHOCK = 'shock'
SLEEP = 'sleep'
WINK = 'wink'
CONFUSED = 'confused'
SMIRK = 'smirk'
DEAD = 'dead'
ANGRY = 'angry'
LAUGH = 'laugh'
LOL = 'lol'
BLUSH = 'blush'
KISS = 'kiss'
COOL = 'cool'
WORRIED = '... | 16.964286 | 31 | 0.572632 | # Keep track of the face state
IDLE = 'blink'
HAPPY = 'happy'
SAD = 'sad'
CRY = 'cry'
SHOCK = 'shock'
SLEEP = 'sleep'
WINK = 'wink'
CONFUSED = 'confused'
SMIRK = 'smirk'
DEAD = 'dead'
ANGRY = 'angry'
LAUGH = 'laugh'
LOL = 'lol'
BLUSH = 'blush'
KISS = 'kiss'
COOL = 'cool'
WORRIED = '... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
236afe383dc07cb5f528a888d4447cf255600c4a | 5,190 | py | Python | handlers/shell.py | alias-rahil/BroBot-1 | 058048a2ca9c9cb160fd4ce638dd673615adec4d | [
"MIT"
] | 1 | 2020-07-08T02:25:54.000Z | 2020-07-08T02:25:54.000Z | handlers/shell.py | alias-rahil/BroBot-1 | 058048a2ca9c9cb160fd4ce638dd673615adec4d | [
"MIT"
] | null | null | null | handlers/shell.py | alias-rahil/BroBot-1 | 058048a2ca9c9cb160fd4ce638dd673615adec4d | [
"MIT"
] | null | null | null | from telegram.ext import ConversationHandler, CommandHandler, MessageHandler, Filters
from misc.invalid_msg import wrong_option
sessions = {}
ssh_states = {0: [MessageHandler(Filters.text, run_command)]}
ssh_handler = ConversationHandler(
entry_points=[CommandHandler("shell", shell_session)],
states=ssh_... | 36.041667 | 86 | 0.592678 | from misc.text import (
empty_output,
repo_path,
file_name,
err_msg,
shell_msg,
not_admin,
key_api,
)
from telegram.ext import ConversationHandler, CommandHandler, MessageHandler, Filters
from misc.invalid_msg import wrong_option
from telegram import ForceReply
import subprocess
import threa... | 0 | 0 | 0 | 0 | 0 | 4,352 | 0 | 93 | 356 |
488d4d0ffb7f995806fbbc8a34b216bbe683b384 | 3,179 | py | Python | docs/examples/plot_presets.py | NumesSanguis/librosa | 571a2a0e6cc5e1f920d619f147d2a9d30f9e67c2 | [
"ISC"
] | 3 | 2017-12-24T16:40:46.000Z | 2020-02-13T05:38:34.000Z | docs/examples/plot_presets.py | NumesSanguis/librosa | 571a2a0e6cc5e1f920d619f147d2a9d30f9e67c2 | [
"ISC"
] | null | null | null | docs/examples/plot_presets.py | NumesSanguis/librosa | 571a2a0e6cc5e1f920d619f147d2a9d30f9e67c2 | [
"ISC"
] | 2 | 2022-01-28T06:40:44.000Z | 2022-02-06T19:03:58.000Z | # coding: utf-8
"""
=======
Presets
=======
This notebook demonstrates how to use the `presets` package to change the
default parameters for librosa.
"""
# Code source: Brian McFee
# License: ISC
##################################################
# We'll need numpy and matplotlib for this example
from __future__ imp... | 30.567308 | 77 | 0.677886 | # coding: utf-8
"""
=======
Presets
=======
This notebook demonstrates how to use the `presets` package to change the
default parameters for librosa.
"""
# Code source: Brian McFee
# License: ISC
##################################################
# We'll need numpy and matplotlib for this example
from __future__ imp... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b5fe544bb374eddfce2d6360375c3b38c2ebfc57 | 7,333 | py | Python | musicoop/api/auth/login.py | felipemaia02/musicoop | a6d1790236ffd17ba85414c688e4d30ecdeeec61 | [
"MIT"
] | null | null | null | musicoop/api/auth/login.py | felipemaia02/musicoop | a6d1790236ffd17ba85414c688e4d30ecdeeec61 | [
"MIT"
] | null | null | null | musicoop/api/auth/login.py | felipemaia02/musicoop | a6d1790236ffd17ba85414c688e4d30ecdeeec61 | [
"MIT"
] | null | null | null | """
Mdulo responsvel por aes de login e obteno do token do usurio
"""
from dotenv import load_dotenv
from fastapi import APIRouter
from fastapi.security import OAuth2PasswordBearer
from musicoop.settings.logs import logging
logger = logging.getLogger(__name__)
router = APIRouter()
oauth2_scheme = OAuth2PasswordBeare... | 31.472103 | 96 | 0.632211 | """
Módulo responsável por ações de login e obtenção do token do usuário
"""
import hashlib
from dotenv import load_dotenv
from fastapi import APIRouter, Depends, HTTPException, Body
from fastapi.security import OAuth2PasswordRequestForm, OAuth2PasswordBearer
from fastapi_login.exceptions import InvalidCredentialsExcep... | 116 | 6,159 | 0 | 0 | 0 | 0 | 0 | 377 | 379 |
28ba0aef9c225ee8e80d89956840ca3538edeab5 | 585 | py | Python | 3_insert_data.py | believeohiozua/python_mysql | 11fcc21c4672446e0a0b021eef72d3429b582aec | [
"MIT"
] | null | null | null | 3_insert_data.py | believeohiozua/python_mysql | 11fcc21c4672446e0a0b021eef72d3429b582aec | [
"MIT"
] | null | null | null | 3_insert_data.py | believeohiozua/python_mysql | 11fcc21c4672446e0a0b021eef72d3429b582aec | [
"MIT"
] | 2 | 2020-11-23T14:29:23.000Z | 2020-11-23T14:33:04.000Z | import pymysql
#database connection
connection = pymysql.connect(host="localhost", user="root", passwd="", database="databaseName")
cursor = connection.cursor()
# queries for inserting values
insert1 = "INSERT INTO Artists(NAME, TRACK) VALUES('Towang', 'Jazz' );"
insert2 = "INSERT INTO Artists(NAME, TRACK) VALUES('Sa... | 30.789474 | 95 | 0.748718 | import pymysql
#database connection
connection = pymysql.connect(host="localhost", user="root", passwd="", database="databaseName")
cursor = connection.cursor()
# queries for inserting values
insert1 = "INSERT INTO Artists(NAME, TRACK) VALUES('Towang', 'Jazz' );"
insert2 = "INSERT INTO Artists(NAME, TRACK) VALUES('Sa... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0e5b691acb033d9d9b8d544957ad064f238d578f | 334 | py | Python | Part_2_intermediate/mod_1/lesson_7/ex_2_from_star_import/school/promote.py | Mikma03/InfoShareacademy_Python_Courses | 3df1008c8c92831bebf1625f960f25b39d6987e6 | [
"MIT"
] | null | null | null | Part_2_intermediate/mod_1/lesson_7/ex_2_from_star_import/school/promote.py | Mikma03/InfoShareacademy_Python_Courses | 3df1008c8c92831bebf1625f960f25b39d6987e6 | [
"MIT"
] | null | null | null | Part_2_intermediate/mod_1/lesson_7/ex_2_from_star_import/school/promote.py | Mikma03/InfoShareacademy_Python_Courses | 3df1008c8c92831bebf1625f960f25b39d6987e6 | [
"MIT"
] | null | null | null |
# __all__ = ['check_promotion']
# FAILED_GRADE = 1
_FAILED_GRADE = 1
| 20.875 | 56 | 0.739521 |
# __all__ = ['check_promotion']
from estudent.school import promotion_status
# FAILED_GRADE = 1
_FAILED_GRADE = 1
def check_promotion(subjects_final_grades):
for subject, grade in subjects_final_grades.items():
if grade == _FAILED_GRADE:
return promotion_status.FAILED
return promotion_... | 0 | 0 | 0 | 0 | 0 | 193 | 0 | 23 | 46 |
13e25a6054645f2e3811dcbf12d352e76c541180 | 65,370 | py | Python | generate-GTFS-shapes/scripts/Step1_MakeShapesFC.py | d-wasserman/public-transit-tools | e9b2eb6e0a8ac81344fa144ff6333686349614f6 | [
"Apache-2.0"
] | 130 | 2015-11-04T21:19:37.000Z | 2022-03-05T20:36:33.000Z | generate-GTFS-shapes/scripts/Step1_MakeShapesFC.py | d-wasserman/public-transit-tools | e9b2eb6e0a8ac81344fa144ff6333686349614f6 | [
"Apache-2.0"
] | 101 | 2015-11-09T14:37:41.000Z | 2021-11-12T01:43:53.000Z | generate-GTFS-shapes/scripts/Step1_MakeShapesFC.py | d-wasserman/public-transit-tools | e9b2eb6e0a8ac81344fa144ff6333686349614f6 | [
"Apache-2.0"
] | 63 | 2015-11-10T18:01:35.000Z | 2022-03-27T19:20:51.000Z | ###############################################################################
## Tool name: Generate GTFS Route Shapes
## Step 1: Generate Shapes on Map
## Creator: Melinda Morang, Esri
## Last updated: 4 September 2019
###############################################################################
''' This too... | 46.165254 | 191 | 0.603365 | ###############################################################################
## Tool name: Generate GTFS Route Shapes
## Step 1: Generate Shapes on Map
## Creator: Melinda Morang, Esri
## Last updated: 4 September 2019
###############################################################################
''' This too... | 0 | 0 | 0 | 18 | 0 | 3,145 | 0 | 14 | 108 |
872d956308f0435fe1d78509a6dd8ca8ef69da0a | 119 | py | Python | backend/workers/admin.py | starmarek/organize-me-2 | bd9b73d3e6d9a4ebc4cbb8a20c97729bdc6b1377 | [
"MIT"
] | 1 | 2021-03-09T20:49:51.000Z | 2021-03-09T20:49:51.000Z | backend/workers/admin.py | starmarek/organize-me-2 | bd9b73d3e6d9a4ebc4cbb8a20c97729bdc6b1377 | [
"MIT"
] | 7 | 2021-05-08T11:05:15.000Z | 2021-05-08T11:12:27.000Z | backend/workers/admin.py | starmarek/organize-me-2 | bd9b73d3e6d9a4ebc4cbb8a20c97729bdc6b1377 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Worker
# Register your models here.
admin.site.register(Worker)
| 17 | 32 | 0.798319 | from django.contrib import admin
from .models import Worker
# Register your models here.
admin.site.register(Worker)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c0d8f0906416361ee78d472f0210bfa55f673398 | 940 | py | Python | 17_process_thread/32_1_multithread_condition.py | hemuke/python | bc99f2b5aee997083ae31f59a2b33db48c8255f3 | [
"Apache-2.0"
] | null | null | null | 17_process_thread/32_1_multithread_condition.py | hemuke/python | bc99f2b5aee997083ae31f59a2b33db48c8255f3 | [
"Apache-2.0"
] | null | null | null | 17_process_thread/32_1_multithread_condition.py | hemuke/python | bc99f2b5aee997083ae31f59a2b33db48c8255f3 | [
"Apache-2.0"
] | null | null | null | from threading import Condition
cond = Condition()
MyThread1('Thread1').start()
MyThread2('Thread2').start()
| 20 | 57 | 0.562766 | from threading import Thread, Condition
import time
cond = Condition()
class MyThread1(Thread):
def __init__(self, name):
super().__init__(name=name)
def run(self):
# time.sleep(1)
cond.acquire()
print('%s说:1' % self.name)
cond.notify()
cond.wait()
t... | 24 | 0 | 0 | 752 | 0 | 0 | 0 | -2 | 68 |
a1854af7fe6cc57a00d24596f4321d441dcb5980 | 1,347 | py | Python | src/olympia/blocklist/migrations/0008_kintoimport.py | dante381/addons-server | 9702860a19ecca1cb4e4998f37bc43c1b2dd3aa7 | [
"BSD-3-Clause"
] | null | null | null | src/olympia/blocklist/migrations/0008_kintoimport.py | dante381/addons-server | 9702860a19ecca1cb4e4998f37bc43c1b2dd3aa7 | [
"BSD-3-Clause"
] | null | null | null | src/olympia/blocklist/migrations/0008_kintoimport.py | dante381/addons-server | 9702860a19ecca1cb4e4998f37bc43c1b2dd3aa7 | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 2.2.9 on 2020-01-16 11:24
| 39.617647 | 219 | 0.597624 | # Generated by Django 2.2.9 on 2020-01-16 11:24
from django.db import migrations, models
import django.utils.timezone
import django_extensions.db.fields.json
import olympia.amo.models
class Migration(migrations.Migration):
dependencies = [
('blocklist', '0007_block_kinto_id'),
]
operations = [
... | 0 | 0 | 0 | 1,138 | 0 | 0 | 0 | 48 | 112 |
b3c47b2980082229f5d78ab1e97714b0bf2c5489 | 378 | py | Python | ffmpeg.py | ec500-software-engineering/exercise-2-ffmpeg-t-ahsan | 5d8d1050cd864cdecb5f80bfb3105b6b5dede65b | [
"MIT"
] | null | null | null | ffmpeg.py | ec500-software-engineering/exercise-2-ffmpeg-t-ahsan | 5d8d1050cd864cdecb5f80bfb3105b6b5dede65b | [
"MIT"
] | 1 | 2019-02-26T20:05:06.000Z | 2019-02-26T20:05:06.000Z | ffmpeg.py | ec500-software-engineering/exercise-2-ffmpeg-t-ahsan | 5d8d1050cd864cdecb5f80bfb3105b6b5dede65b | [
"MIT"
] | null | null | null | vids_path = './videos'
out = './processed'
if __name__ == "__main__":
main()
| 18.9 | 71 | 0.698413 | import queue
import threading
import os
import compute
vids_path = './videos'
out = './processed'
def main():
q = queue.Queue()
directory = os.listdir(vids_path)
for file in directory:
q.put(vids_path+"/"+file)
for i in range(3):
worker = threading.Thread(target=compute.process, args=(q,vids_path))
worker.st... | 0 | 0 | 0 | 0 | 0 | 221 | 0 | -33 | 111 |
276a4636e748b99f18221f91071d3636ac7852e7 | 1,221 | py | Python | src/tav/core.py | mudox/pytav | 4124628c45ffd3fc35913d781278eb349d9c8559 | [
"MIT"
] | null | null | null | src/tav/core.py | mudox/pytav | 4124628c45ffd3fc35913d781278eb349d9c8559 | [
"MIT"
] | null | null | null | src/tav/core.py | mudox/pytav | 4124628c45ffd3fc35913d781278eb349d9c8559 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
from . import settings as cfg
from . import tmux
from .fzf import FZFFormatter
logger = logging.getLogger(__name__)
model = None
def updateModel():
'''
steps:
- reload config.
- regenerate the model data
- save model in `core.model`
- comp... | 20.016393 | 63 | 0.637183 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
from . import settings as cfg
from . import tmux
from .fzf import FZFFormatter
logger = logging.getLogger(__name__)
model = None
def onTmuxEvent(event):
logger.info(f'o:{event}')
dirty = updateModel()
if dirty:
tmux.tavSession.swapYinYang(fo... | 0 | 0 | 0 | 0 | 0 | 112 | 0 | 0 | 23 |
81041516591bc2ff28ef7dc898a4a68ae4275230 | 5,280 | py | Python | banking/employee_operations.py | justmytwospence/banking-oop | 5639a9b58dcde8b0f19ff9eac55c56f62055c1c6 | [
"MIT"
] | null | null | null | banking/employee_operations.py | justmytwospence/banking-oop | 5639a9b58dcde8b0f19ff9eac55c56f62055c1c6 | [
"MIT"
] | null | null | null | banking/employee_operations.py | justmytwospence/banking-oop | 5639a9b58dcde8b0f19ff9eac55c56f62055c1c6 | [
"MIT"
] | null | null | null | import logging
logger = logging.getLogger(__name__)
| 35.2 | 95 | 0.608712 | import logging
import click
from sqlalchemy import and_, exc, select, update
from banking.models import Employee, Session
from banking.utils import split_name
logger = logging.getLogger(__name__)
@click.group(help="Employee operations")
def employee():
pass
@employee.command()
@click.option("--name", prompt=... | 0 | 4,937 | 0 | 0 | 0 | 0 | 0 | 56 | 228 |
5f1c74e7fd7221101991438e7333d6cd07b827e4 | 1,289 | py | Python | py/probe/functions/detachable_base_unittest.py | arccode/factory | a1b0fccd68987d8cd9c89710adc3c04b868347ec | [
"BSD-3-Clause"
] | 3 | 2022-01-06T16:52:52.000Z | 2022-03-07T11:30:47.000Z | py/probe/functions/detachable_base_unittest.py | arccode/factory | a1b0fccd68987d8cd9c89710adc3c04b868347ec | [
"BSD-3-Clause"
] | null | null | null | py/probe/functions/detachable_base_unittest.py | arccode/factory | a1b0fccd68987d8cd9c89710adc3c04b868347ec | [
"BSD-3-Clause"
] | 1 | 2021-10-24T01:47:22.000Z | 2021-10-24T01:47:22.000Z | #!/usr/bin/env python3
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
if __name__ == '__main__':
unittest.main()
| 35.805556 | 72 | 0.710628 | #!/usr/bin/env python3
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from unittest import mock
from cros.factory.probe.functions import detachable_base
def FakeCheckOutput(cmd, *unu... | 0 | 803 | 0 | 31 | 0 | 48 | 0 | 39 | 115 |
4dca44ebe62bb071fd3ddd906a68082649ada330 | 1,149 | py | Python | census_map_downloader/geotypes/places.py | datadesk/census-map-downloader | 8e3b73a1d4511c3bed35ff65365e66a637e0fc36 | [
"MIT"
] | 25 | 2019-08-13T17:28:28.000Z | 2022-03-04T02:27:28.000Z | census_map_downloader/geotypes/places.py | datadesk/census-map-downloader | 8e3b73a1d4511c3bed35ff65365e66a637e0fc36 | [
"MIT"
] | 22 | 2019-07-17T22:24:16.000Z | 2022-03-12T01:01:39.000Z | census_map_downloader/geotypes/places.py | datadesk/census-map-downloader | 8e3b73a1d4511c3bed35ff65365e66a637e0fc36 | [
"MIT"
] | 7 | 2019-08-14T02:00:00.000Z | 2021-03-24T03:25:52.000Z | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Logging
import logging
logger = logging.getLogger(__name__)
| 27.357143 | 117 | 0.681462 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import collections
from census_map_downloader.base import BaseStateDownloader, BaseStateListDownloader
# Logging
import logging
logger = logging.getLogger(__name__)
class StatePlacesDownloader(BaseStateDownloader):
"""
Download places for a single state.
"""... | 0 | 198 | 0 | 690 | 0 | 0 | 0 | 59 | 90 |
dcb6ee2d6b3f0bf66058ee39f5a9cc901d6f7e4c | 1,893 | py | Python | buildit/check/check.py | kate123wong/CTF_web | 3403bd6e1ea4fb7c5beba9d2cde9676e8a78d286 | [
"Apache-2.0"
] | null | null | null | buildit/check/check.py | kate123wong/CTF_web | 3403bd6e1ea4fb7c5beba9d2cde9676e8a78d286 | [
"Apache-2.0"
] | null | null | null | buildit/check/check.py | kate123wong/CTF_web | 3403bd6e1ea4fb7c5beba9d2cde9676e8a78d286 | [
"Apache-2.0"
] | null | null | null | import sys
import requests
import hashlib
host = sys.argv[1]
port=sys.argv[2]
username = sys.argv[3]
passwd = sys.argv[4]
url_login = "http://" + host + ":"+port+ "/login"
url_reg= "http://"+host+":"+port+"/register"
password = hashlib.md5(passwd.encode('utf8')).hexdigest()
if __name__ == '__main__':
print(check... | 27.838235 | 66 | 0.536714 | import sys
import requests
import hashlib,json
import requests
host = sys.argv[1]
port=sys.argv[2]
username = sys.argv[3]
passwd = sys.argv[4]
url_login = "http://" + host + ":"+port+ "/login"
url_reg= "http://"+host+":"+port+"/register"
password = hashlib.md5(passwd.encode('utf8')).hexdigest()
def login(url_login):
... | 249 | 0 | 0 | 0 | 0 | 1,394 | 0 | -1 | 90 |
76b71296e60e8f570c26fa3fa6ee17b2c0c0c544 | 3,136 | py | Python | src/leetcode_1688_count_of_matches_in_tournament.py | yurirocha15/coding_practice | 952506932c47414da689454853ee745637413160 | [
"MIT"
] | 2 | 2020-12-08T13:59:10.000Z | 2021-05-01T05:07:39.000Z | src/leetcode_1688_count_of_matches_in_tournament.py | yurirocha15/coding_practice | 952506932c47414da689454853ee745637413160 | [
"MIT"
] | null | null | null | src/leetcode_1688_count_of_matches_in_tournament.py | yurirocha15/coding_practice | 952506932c47414da689454853ee745637413160 | [
"MIT"
] | 1 | 2021-05-02T17:42:02.000Z | 2021-05-02T17:42:02.000Z | # @l2g 1688 python3
# [1688] Count of Matches in Tournament
# Difficulty: Easy
# https://leetcode.com/problems/count-of-matches-in-tournament
#
# You are given an integer n, the number of teams in a tournament that has strange rules:
#
# If the current number of teams is even,each team gets paired with another team.
# ... | 30.153846 | 96 | 0.658163 | # @l2g 1688 python3
# [1688] Count of Matches in Tournament
# Difficulty: Easy
# https://leetcode.com/problems/count-of-matches-in-tournament
#
# You are given an integer n, the number of teams in a tournament that has strange rules:
#
# If the current number of teams is even,each team gets paired with another team.
# ... | 0 | 0 | 0 | 150 | 0 | 0 | 0 | 0 | 45 |
b22ab5ddc81c6c6389b88e91895d397e8e1119f6 | 1,937 | py | Python | dev/sandbox/skyrmions/fftanalysis.py | davidcortesortuno/finmag | 9ac0268d2c0e45faf1284cee52a73525aa589e2b | [
"BSL-1.0"
] | 10 | 2018-03-24T07:43:17.000Z | 2022-03-26T10:42:27.000Z | dev/sandbox/skyrmions/fftanalysis.py | davidcortesortuno/finmag | 9ac0268d2c0e45faf1284cee52a73525aa589e2b | [
"BSL-1.0"
] | 21 | 2018-03-26T15:08:53.000Z | 2021-07-10T16:11:14.000Z | dev/sandbox/skyrmions/fftanalysis.py | davidcortesortuno/finmag | 9ac0268d2c0e45faf1284cee52a73525aa589e2b | [
"BSL-1.0"
] | 7 | 2018-04-09T11:50:48.000Z | 2021-06-10T09:23:25.000Z | import numpy as np
import pylab as plt
import matplotlib.cm as cm
npzfile = np.load('output_sinc.npz')
mx = npzfile['mx']
my = npzfile['my']
mz = npzfile['mz']
tsim = npzfile['tsim']
mx -= np.average(mx)
my -= np.average(my)
mz -= np.average(mz)
spx = []
spy = []
spz = []
for i in range(mx.shape[0]):
for j in r... | 19.565657 | 47 | 0.598864 | import numpy as np
import pylab as plt
import matplotlib.cm as cm
npzfile = np.load('output_sinc.npz')
mx = npzfile['mx']
my = npzfile['my']
mz = npzfile['mz']
tsim = npzfile['tsim']
mx -= np.average(mx)
my -= np.average(my)
mz -= np.average(mz)
spx = []
spy = []
spz = []
for i in range(mx.shape[0]):
for j in r... | 0 | 0 | 0 | 0 | 0 | 131 | 0 | 0 | 23 |
bc47f46ec700f63a55ca3652847fafa16d2bc82a | 811 | py | Python | docs/install.py | sharingcloud/docknv | 6eec6a576a32cb05278b7af045f90859066c9f1d | [
"MIT"
] | null | null | null | docs/install.py | sharingcloud/docknv | 6eec6a576a32cb05278b7af045f90859066c9f1d | [
"MIT"
] | null | null | null | docs/install.py | sharingcloud/docknv | 6eec6a576a32cb05278b7af045f90859066c9f1d | [
"MIT"
] | null | null | null | """Install docs."""
import os
import argparse
import shutil
from docknv.utils.prompt import prompt_yes_no
from docknv.logger import Logger
html_docs = os.path.join("_build", "html")
parser = argparse.ArgumentParser(description="install documentation to path")
parser.add_argument("output_path")
args = parser.parse_... | 26.16129 | 77 | 0.7164 | """Install docs."""
import os
import argparse
import shutil
from docknv.utils.prompt import prompt_yes_no
from docknv.logger import Logger
html_docs = os.path.join("_build", "html")
parser = argparse.ArgumentParser(description="install documentation to path")
parser.add_argument("output_path")
args = parser.parse_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1bd907b1b3ade56f37802b0b2464bb44cbc4022a | 4,951 | py | Python | tutorials/00 - PyTorch Basics/main.py | goodrahstar/pytorch-tutorial | 96acc3108d469e5b081f8a98f042306b40ac2342 | [
"MIT"
] | 1 | 2020-10-23T09:44:10.000Z | 2020-10-23T09:44:10.000Z | tutorials/00 - PyTorch Basics/main.py | DragonFive/pytorch-tutorial | 96acc3108d469e5b081f8a98f042306b40ac2342 | [
"MIT"
] | null | null | null | tutorials/00 - PyTorch Basics/main.py | DragonFive/pytorch-tutorial | 96acc3108d469e5b081f8a98f042306b40ac2342 | [
"MIT"
] | 2 | 2018-11-30T02:56:07.000Z | 2021-04-29T09:25:13.000Z | import torch
import torchvision
import torch.nn as nn
import numpy as np
import torch.utils.data as data
import torchvision.transforms as transforms
import torchvision.datasets as dsets
from torch.autograd import Variable
#========================== Table of Contents ==========================#
# 1. Basic autograd e... | 31.335443 | 81 | 0.586346 | import torch
import torchvision
import torch.nn as nn
import numpy as np
import torch.utils.data as data
import torchvision.transforms as transforms
import torchvision.datasets as dsets
from torch.autograd import Variable
#========================== Table of Contents ==========================#
# 1. Basic autograd e... | 0 | 0 | 0 | 428 | 0 | 0 | 0 | 0 | 23 |
b4db071afa3a7e5844b6a6ddac4eb55732f52747 | 33,690 | py | Python | tests/vdr/test_eventing.py | SmithSamuelM/keripy-wot | ec329f4e011026d655bf46d269792ac97f23276d | [
"Apache-2.0"
] | 10 | 2021-06-09T16:15:32.000Z | 2022-03-28T22:14:11.000Z | tests/vdr/test_eventing.py | SmithSamuelM/keripy-wot | ec329f4e011026d655bf46d269792ac97f23276d | [
"Apache-2.0"
] | 47 | 2021-06-17T20:00:02.000Z | 2022-03-31T20:20:44.000Z | tests/vdr/test_eventing.py | SmithSamuelM/keripy-wot | ec329f4e011026d655bf46d269792ac97f23276d | [
"Apache-2.0"
] | 6 | 2021-06-10T11:24:25.000Z | 2022-01-28T08:07:43.000Z | # -*- encoding: utf-8 -*-
"""
tests.vdr.eventing module
"""
import pytest
from keri.core import eventing as keventing
from keri.core.coring import MtrDex
from keri.vdr import eventing
from keri.vdr.eventing import rotate
def test_incept():
"""
Test incept utility function
"""
pre = "DntNTPnDFBnmlO6J... | 41.955168 | 114 | 0.601217 | # -*- encoding: utf-8 -*-
"""
tests.vdr.eventing module
"""
import pytest
from keri.app import habbing, keeping
from keri.core import coring
from keri.core import eventing as keventing
from keri.core.coring import Versify, Serials, Ilks, MtrDex, Prefixer, Serder, Signer, Seqner
from keri.db import basing
from keri.db... | 0 | 0 | 0 | 0 | 0 | 21,562 | 0 | 324 | 340 |
c4f25f8b9669a226a019b58a6b1bef01255699b9 | 458 | py | Python | Mini Project/Telegram_Bot_Part_1.py | HIMATEKTRO/KROENG | efcb952b078e2cf74f8e73127a9890bb7e1987c8 | [
"MIT"
] | null | null | null | Mini Project/Telegram_Bot_Part_1.py | HIMATEKTRO/KROENG | efcb952b078e2cf74f8e73127a9890bb7e1987c8 | [
"MIT"
] | null | null | null | Mini Project/Telegram_Bot_Part_1.py | HIMATEKTRO/KROENG | efcb952b078e2cf74f8e73127a9890bb7e1987c8 | [
"MIT"
] | null | null | null | # mengimport package pyTelegramBotAPI
import telebot
# inisialisasi Token Bot Kita
bot = telebot.TeleBot('TOKENBOT')
# Menghandle Pesan /start
# Menghandle Pesan hai
print('bot running!!!')
bot.polling()
| 21.809524 | 47 | 0.724891 | # mengimport package pyTelegramBotAPI
import telebot
# inisialisasi Token Bot Kita
bot = telebot.TeleBot('TOKENBOT')
# Menghandle Pesan /start
@bot.message_handler(commands=['start'])
def welcome(message):
# membalas pesan
bot.reply_to(message, 'Halo bro, ada apa?')
# Menghandle Pesan hai
@bot.message_handle... | 0 | 206 | 0 | 0 | 0 | 0 | 0 | 0 | 44 |
277783626e52b5a3b6d0ce92a6662e2d69b2f145 | 2,986 | py | Python | PLM/ui/base/BaseSplash.py | vtta2008/pipelineTool | 2431d2fc987e3b31f2a6a63427fee456fa0765a0 | [
"Apache-2.0"
] | 7 | 2017-12-22T02:49:58.000Z | 2018-05-09T05:29:06.000Z | PLM/ui/base/BaseSplash.py | vtta2008/pipelineTool | 2431d2fc987e3b31f2a6a63427fee456fa0765a0 | [
"Apache-2.0"
] | null | null | null | PLM/ui/base/BaseSplash.py | vtta2008/pipelineTool | 2431d2fc987e3b31f2a6a63427fee456fa0765a0 | [
"Apache-2.0"
] | 3 | 2019-03-11T21:54:52.000Z | 2019-11-25T11:23:17.000Z | # -*- coding: utf-8 -*-
"""
Script Name:
Author: Do Trinh/Jimmy - 3D artist.
Description:
"""
# -------------------------------------------------------------------------------------------------------------
""" Import """
# Python
# --------------------------------------------------------------------------------... | 29.27451 | 112 | 0.528466 | # -*- coding: utf-8 -*-
"""
Script Name:
Author: Do Trinh/Jimmy - 3D artist.
Description:
"""
# -------------------------------------------------------------------------------------------------------------
""" Import """
# Python
from math import ceil
from .SplashProperty ... | 2 | 0 | 0 | 2,409 | 0 | 0 | 0 | 70 | 68 |
e6b2a620e6c93567726ea72726a0ec155a4e7cec | 564 | py | Python | test_maximal-pairing-of-integers.py | jcgwt/foobar | 0eb13ea73c28456fde588acb0c1314ea5e413a21 | [
"CNRI-Python"
] | null | null | null | test_maximal-pairing-of-integers.py | jcgwt/foobar | 0eb13ea73c28456fde588acb0c1314ea5e413a21 | [
"CNRI-Python"
] | null | null | null | test_maximal-pairing-of-integers.py | jcgwt/foobar | 0eb13ea73c28456fde588acb0c1314ea5e413a21 | [
"CNRI-Python"
] | null | null | null | import unittest
import importlib
pairings = importlib.import_module('maximal-pairing-of-integers')
if __name__ == '__main__':
unittest.main()
| 35.25 | 77 | 0.664894 | import unittest
import importlib
pairings = importlib.import_module('maximal-pairing-of-integers')
class TestCases(unittest.TestCase):
def test_solution(self):
self.assertEqual(pairings.solution([]),0)
self.assertEqual(pairings.solution([1]),1)
self.assertEqual(pairings.solution([2 for _ i... | 0 | 0 | 0 | 369 | 0 | 0 | 0 | 0 | 23 |
a80bc3d9996a33cbbc9ec73d291783757d191c55 | 479 | py | Python | rating_counter.py | Santhoshkumard11/Learning-PySpark | 316571e709569d9c865198473674918d05d0fb04 | [
"Apache-2.0"
] | 2 | 2021-08-01T18:13:46.000Z | 2022-03-08T11:07:37.000Z | rating_counter.py | Santhoshkumard11/Learning-PySpark | 316571e709569d9c865198473674918d05d0fb04 | [
"Apache-2.0"
] | null | null | null | rating_counter.py | Santhoshkumard11/Learning-PySpark | 316571e709569d9c865198473674918d05d0fb04 | [
"Apache-2.0"
] | null | null | null | from pyspark import SparkConf, SparkContext
print("Starting Computation!!\n")
conf = SparkConf().setMaster("local").setAppName("RatingsHistogram")
sc = SparkContext(conf = conf)
lines = sc.textFile("file:///spark_course/ml-100k/u.data")
ratings = lines.map(lambda x: x.split()[2])
result = ratings.countByValue()
... | 20.826087 | 68 | 0.709812 | from pyspark import SparkConf, SparkContext
print("Starting Computation!!\n")
conf = SparkConf().setMaster("local").setAppName("RatingsHistogram")
sc = SparkContext(conf = conf)
lines = sc.textFile("file:///spark_course/ml-100k/u.data")
ratings = lines.map(lambda x: x.split()[2])
result = ratings.countByValue()
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f05b5aab70711ef0216375067c720b8b118f62ab | 1,687 | py | Python | scripts/tone_to_loop_count.py | xfgryujk/c51-play-music | d882ca571a1feba5c82f13c96d283fd74dbc5831 | [
"MIT"
] | 28 | 2018-11-21T18:38:27.000Z | 2022-01-19T12:07:35.000Z | scripts/tone_to_loop_count.py | xfgryujk/c51-play-music | d882ca571a1feba5c82f13c96d283fd74dbc5831 | [
"MIT"
] | 2 | 2019-03-05T03:36:14.000Z | 2020-07-06T10:26:36.000Z | scripts/tone_to_loop_count.py | xfgryujk/c51-play-music | d882ca571a1feba5c82f13c96d283fd74dbc5831 | [
"MIT"
] | 9 | 2019-02-22T02:01:32.000Z | 2022-02-22T09:33:27.000Z | # -*- coding: utf-8 -*-
"""
beep
"""
# (Hz)
CRYSTAL_FREQUENCY = 11059200
# (s)
COUNT_PERIOD = 1 / (CRYSTAL_FREQUENCY / 12)
#
COUNT_PER_LOOP = 38
# (ms)
MS_PER_LOOP = COUNT_PERIOD * 1000 * COUNT_PER_LOOP
if __name__ == '__main__':
main()
| 27.655738 | 112 | 0.585655 | # -*- coding: utf-8 -*-
"""
将beep谱(频率、持续时间)转换为循环次数
"""
import json
# 晶振频率(Hz)
CRYSTAL_FREQUENCY = 11059200
# 计数周期(机器周期)(s)
COUNT_PERIOD = 1 / (CRYSTAL_FREQUENCY / 12)
# 一次循环几个机器周期,通过定时器实验得到
COUNT_PER_LOOP = 38
# 一次循环时间(ms)
MS_PER_LOOP = COUNT_PERIOD * 1000 * COUNT_PER_LOOP
def tone_to_loop_count(notes, output_path)... | 261 | 0 | 0 | 0 | 0 | 1,294 | 0 | -10 | 69 |
1d3ea69b3e4a276b5c416f98c802081047762711 | 2,826 | py | Python | src/api2db/install/make_lab.py | TristenHarr/api2db | 8c8b14280441f5153ff146c23359a0eb91022ddb | [
"MIT"
] | 45 | 2021-05-05T01:34:20.000Z | 2021-11-02T08:41:34.000Z | src/api2db/install/make_lab.py | TristenHarr/api2db | 8c8b14280441f5153ff146c23359a0eb91022ddb | [
"MIT"
] | 1 | 2021-06-02T11:43:33.000Z | 2021-06-02T20:32:29.000Z | src/api2db/install/make_lab.py | TristenHarr/api2db | 8c8b14280441f5153ff146c23359a0eb91022ddb | [
"MIT"
] | 3 | 2021-05-08T21:49:24.000Z | 2021-05-13T23:14:09.000Z | import os
_lab_components = """from api2db.ingest import *
CACHE=True # Caches API data so that only a single API call is made if True
def import_target():
return None
def pre_process():
return None
def data_features():
return None
def post_process():
return None
if __name__ == "__main__":
... | 28.836735 | 100 | 0.381812 | import os
_lab_components = """from api2db.ingest import *
CACHE=True # Caches API data so that only a single API call is made if True
def import_target():
return None
def pre_process():
return None
def data_features():
return None
def post_process():
return None
if __name__ == "__main__":
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
150c00e46ae85dd0071bf6c358b9768630584a39 | 1,912 | py | Python | code/aesmc/math.py | jatucker4/DVRL | 6cf0708e417540672ceb8ac470ecc6b3b477387e | [
"Apache-2.0"
] | 115 | 2018-09-10T15:18:10.000Z | 2021-12-31T13:00:21.000Z | code/aesmc/math.py | jatucker4/DVRL | 6cf0708e417540672ceb8ac470ecc6b3b477387e | [
"Apache-2.0"
] | 4 | 2020-07-20T07:39:28.000Z | 2021-04-22T18:42:02.000Z | code/aesmc/math.py | jatucker4/DVRL | 6cf0708e417540672ceb8ac470ecc6b3b477387e | [
"Apache-2.0"
] | 22 | 2018-09-25T08:41:36.000Z | 2022-03-28T16:48:09.000Z | import numpy as np
import scipy.misc
import torch
def logsumexp(values, dim=0, keepdim=False):
"""Logsumexp of a Tensor/Variable.
See https://en.wikipedia.org/wiki/LogSumExp.
input:
values: Tensor/Variable [dim_1, ..., dim_N]
dim: n
output: result Tensor/Variable
[dim_1, ...... | 28.537313 | 78 | 0.562762 | import numpy as np
import scipy.misc
import torch
def logsumexp(values, dim=0, keepdim=False):
"""Logsumexp of a Tensor/Variable.
See https://en.wikipedia.org/wiki/LogSumExp.
input:
values: Tensor/Variable [dim_1, ..., dim_N]
dim: n
output: result Tensor/Variable
[dim_1, ...... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c2e883c561c244e7b446ef3322f92a4612152fad | 2,867 | py | Python | crawl.py | tingliaoxixi/gaokao | 15f1006dbb4c58355e6b0a4396994f87f40ecc5d | [
"MIT"
] | 1 | 2019-06-26T16:15:49.000Z | 2019-06-26T16:15:49.000Z | crawl.py | tingliaoxixi/gaokao | 15f1006dbb4c58355e6b0a4396994f87f40ecc5d | [
"MIT"
] | null | null | null | crawl.py | tingliaoxixi/gaokao | 15f1006dbb4c58355e6b0a4396994f87f40ecc5d | [
"MIT"
] | 3 | 2020-05-26T01:12:25.000Z | 2021-06-27T07:01:58.000Z | #!/usr/bin/env python
# coding: utf8
import sys
import json
import time
import requests
if __name__ == '__main__':
if len(sys.argv) > 1:
selector = sys.argv[1]
if selector in ['schoolspecialindex', 'school']:
exec 'crawl_%s()' % selector
exit(0)
print 'Invalid argument... | 29.255102 | 140 | 0.539588 | #!/usr/bin/env python
# coding: utf8
import sys
import json
import time
import requests
from config import *
def crawl(url, file_path):
while True:
try:
res = requests.get(url, timeout=3)
if res.status_code == 404:
return None
else:
with... | 0 | 0 | 0 | 0 | 0 | 2,426 | 0 | -1 | 92 |
52864c27dd6c40e4877009ee08401f78bc96da9e | 1,781 | py | Python | daemon/parsers.py | aadibajpai/ccextractor-web | 5a779ce8ff184ef45aff2f3c2458c10eda28d651 | [
"MIT"
] | null | null | null | daemon/parsers.py | aadibajpai/ccextractor-web | 5a779ce8ff184ef45aff2f3c2458c10eda28d651 | [
"MIT"
] | null | null | null | daemon/parsers.py | aadibajpai/ccextractor-web | 5a779ce8ff184ef45aff2f3c2458c10eda28d651 | [
"MIT"
] | null | null | null | """
ccextractor-web | parsers.py
Author : Saurabh Shrivastava
Email : saurabh.shrivastava54+ccextractorweb[at]gmail.com
Link : https://github.com/saurabhshri
"""
| 29.196721 | 81 | 0.633914 | """
ccextractor-web | parsers.py
Author : Saurabh Shrivastava
Email : saurabh.shrivastava54+ccextractorweb[at]gmail.com
Link : https://github.com/saurabhshri
"""
import json
import argparse
class ParseJob():
def __init__(self, job_file):
self.job_config = {}
with open(job_file, 'r', en... | 0 | 0 | 0 | 1,508 | 0 | 0 | 0 | -16 | 114 |
45af1d2bf218e2239fe83f6af2e3a1bb8615c57d | 1,317 | py | Python | various-plots-with-python/code.py | ELAYARANI-MURUGESAN/greyatom-python-for-data-science | 67b0ad011eee86bb0dff0ee704575293809301f4 | [
"MIT"
] | null | null | null | various-plots-with-python/code.py | ELAYARANI-MURUGESAN/greyatom-python-for-data-science | 67b0ad011eee86bb0dff0ee704575293809301f4 | [
"MIT"
] | null | null | null | various-plots-with-python/code.py | ELAYARANI-MURUGESAN/greyatom-python-for-data-science | 67b0ad011eee86bb0dff0ee704575293809301f4 | [
"MIT"
] | null | null | null | # --------------
import pandas as pd
import matplotlib.pyplot as plt
#df=pd.DataFrame()
data=pd.read_csv(path)
loan_status=data['Loan_Status'].value_counts().plot(kind="bar")
plt.show()
data.iloc[25,1]
data.iloc[53,9]
property_and_loan=data.groupby(['Property_Area', 'Loan_Status']).size().unstack().plot(kind... | 32.925 | 114 | 0.716781 | # --------------
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
#df=pd.DataFrame()
data=pd.read_csv(path)
loan_status=data['Loan_Status'].value_counts().plot(kind="bar")
plt.show()
data.iloc[25,1]
data.iloc[53,9]
property_and_loan=data.groupby(['Property_Area', 'Loan_Status']).size(... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 24 |
84fa72a574df3f5f1447d915ccb88abf966a52b7 | 45,951 | py | Python | pysnmp/H3C-IPSEC-MONITOR-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/H3C-IPSEC-MONITOR-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/H3C-IPSEC-MONITOR-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module H3C-IPSEC-MONITOR-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/H3C-IPSEC-MONITOR-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:09:33 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (def... | 136.353116 | 6,811 | 0.763705 | #
# PySNMP MIB module H3C-IPSEC-MONITOR-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/H3C-IPSEC-MONITOR-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:09:33 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (def... | 0 | 0 | 0 | 2,882 | 0 | 0 | 0 | 0 | 229 |
f47d4b2d1e8efc9fa9249e088b1abcf6eb0378c6 | 1,332 | py | Python | problem24.py | asuttles/euler | dfcacf7175e639c9a84ddd0e09a3de8f05ff4a23 | [
"Unlicense"
] | null | null | null | problem24.py | asuttles/euler | dfcacf7175e639c9a84ddd0e09a3de8f05ff4a23 | [
"Unlicense"
] | null | null | null | problem24.py | asuttles/euler | dfcacf7175e639c9a84ddd0e09a3de8f05ff4a23 | [
"Unlicense"
] | null | null | null | #
# A permutation is an ordered arrangement of objects.
# For example, 3124 is one possible permutation of the digits 1, 2, 3 and 4.
#
# If all of the permutations are listed numerically or alphabetically,
# we call it lexicographic order. The lexicographic permutations of 0, 1 and 2 are:
#
# 012 021 102 1... | 24.666667 | 84 | 0.563063 | #
# A permutation is an ordered arrangement of objects.
# For example, 3124 is one possible permutation of the digits 1, 2, 3 and 4.
#
# If all of the permutations are listed numerically or alphabetically,
# we call it lexicographic order. The lexicographic permutations of 0, 1 and 2 are:
#
# 012 021 102 1... | 0 | 0 | 0 | 0 | 0 | 342 | 0 | 0 | 23 |
9b6a7b6d314d6d7cc5e4e125b97d944804be84e5 | 2,147 | py | Python | soil/rpimodel/base.py | irahorecka/soil-moisture-display | f113658a646d86f5fbbb904f4c0bbb81e42ff337 | [
"MIT"
] | null | null | null | soil/rpimodel/base.py | irahorecka/soil-moisture-display | f113658a646d86f5fbbb904f4c0bbb81e42ff337 | [
"MIT"
] | null | null | null | soil/rpimodel/base.py | irahorecka/soil-moisture-display | f113658a646d86f5fbbb904f4c0bbb81e42ff337 | [
"MIT"
] | null | null | null | import platform
import sys
# for development purposes (I always use MacOS)
if platform.system() == "Darwin":
import fake_rpi
sys.modules["RPi"] = fake_rpi.RPi
sys.modules["RPi.GPIO"] = fake_rpi.RPi.GPIO
import RPi.GPIO as GPIO
| 33.546875 | 78 | 0.62925 | from . import lcd
import platform
import sys
# for development purposes (I always use MacOS)
if platform.system() == "Darwin":
import fake_rpi
sys.modules["RPi"] = fake_rpi.RPi
sys.modules["RPi.GPIO"] = fake_rpi.RPi.GPIO
import RPi.GPIO as GPIO
class BaseRPi:
""" Base class to be inherited by childr... | 0 | 865 | 0 | 999 | 0 | 0 | 0 | -4 | 45 |
16e5e9522d020895b5514f3eded1f4f2d60376b1 | 740 | py | Python | spacy/about.py | FallakAsad/spaCy | a0acb1b3cdfb3b37f5061f85d76ba55641f2cb74 | [
"MIT"
] | null | null | null | spacy/about.py | FallakAsad/spaCy | a0acb1b3cdfb3b37f5061f85d76ba55641f2cb74 | [
"MIT"
] | null | null | null | spacy/about.py | FallakAsad/spaCy | a0acb1b3cdfb3b37f5061f85d76ba55641f2cb74 | [
"MIT"
] | null | null | null | # inspired from:
# https://python-packaging-user-guide.readthedocs.org/en/latest/single_source_version/
# https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py
# fmt: off
__title__ = "spacy"
__version__ = "2.1.6"
__summary__ = "Industrial-strength Natural Language Processing (NLP) with Python and Cython... | 41.111111 | 104 | 0.787838 | # inspired from:
# https://python-packaging-user-guide.readthedocs.org/en/latest/single_source_version/
# https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py
# fmt: off
__title__ = "spacy"
__version__ = "2.1.6"
__summary__ = "Industrial-strength Natural Language Processing (NLP) with Python and Cython... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0205006513ae9a3ead478c5ffa81d46333993022 | 16,093 | py | Python | deepmos.py | BME-SmartLab/DeepMOS | 1fe3f7bf6119dd6bff6fc8388da2414d25066750 | [
"BSD-3-Clause"
] | null | null | null | deepmos.py | BME-SmartLab/DeepMOS | 1fe3f7bf6119dd6bff6fc8388da2414d25066750 | [
"BSD-3-Clause"
] | null | null | null | deepmos.py | BME-SmartLab/DeepMOS | 1fe3f7bf6119dd6bff6fc8388da2414d25066750 | [
"BSD-3-Clause"
] | null | null | null | # This is a modified version of the training script of https://github.com/nii-yamagishilab/mos-finetune-ssl
import torch.nn as nn
import torch.optim as optim
# from> https://jonathanbgn.com/2021/08/30/audio-augmentation.html
if __name__ == '__main__':
main()
| 38.685096 | 178 | 0.610017 | # This is a modified version of the training script of https://github.com/nii-yamagishilab/mos-finetune-ssl
import os
import argparse
import fairseq
import torch
import torchaudio
import torch.nn as nn
import torch.optim as optim
import time
import json
from torch.utils.data.dataset import Dataset
from torch.utils.dat... | 0 | 0 | 0 | 5,487 | 0 | 9,830 | 0 | -17 | 521 |
8cb4b875ff7ad5415a2134e7f92c4205449eceb5 | 2,249 | py | Python | Noted.py | Toughee/Noted | 3d60b4c47673b5a07657e89e7367b3f4583dfd2e | [
"MIT"
] | null | null | null | Noted.py | Toughee/Noted | 3d60b4c47673b5a07657e89e7367b3f4583dfd2e | [
"MIT"
] | null | null | null | Noted.py | Toughee/Noted | 3d60b4c47673b5a07657e89e7367b3f4583dfd2e | [
"MIT"
] | null | null | null | import tkinter as tk
# App functions
#Opening files
#Saving files
# Format functions
# def cut_line
# def copy_line
# def paste_line
window = tk.Tk()
window.title('Noted')
#app.iconbitmap('path/to/ico/icon.ico')
window.rowconfigure(0, minsize=700, weight=1)
window.columnconfigure(1, minsize=700, weight=1)
#... | 25.850575 | 96 | 0.666963 | import tkinter as tk
from tkinter.filedialog import askopenfilename, asksaveasfilename
# App functions
#Opening files
def open_file():
filepath = askopenfilename(
filetypes=[("Text Files", "*.txt"), ("Rich Text Format", "*.rtf"), ("All Files", "*.*")]
)
if not filepath:
return
txt_edit... | 0 | 0 | 0 | 0 | 0 | 719 | 0 | 44 | 66 |
840ef771f7aead7e9f0baee525b6a1c91310bd99 | 16,885 | py | Python | autoregressive/wave.py | cheind/autoregressive | e54c7f2cf66c6ffde706ea5839c747b5ab9b61c1 | [
"MIT"
] | 33 | 2021-11-30T12:32:40.000Z | 2022-03-17T22:17:43.000Z | autoregressive/wave.py | cheind/autoregressive | e54c7f2cf66c6ffde706ea5839c747b5ab9b61c1 | [
"MIT"
] | 13 | 2021-11-30T12:46:51.000Z | 2021-12-20T17:24:10.000Z | autoregressive/wave.py | cheind/autoregressive | e54c7f2cf66c6ffde706ea5839c747b5ab9b61c1 | [
"MIT"
] | 1 | 2021-12-11T23:44:40.000Z | 2021-12-11T23:44:40.000Z | import logging
import torch
import torch.nn
import torch.nn.init
_logger = logging.getLogger("pytorch_lightning")
_logger.setLevel(logging.INFO)
def wave_init_weights(m):
"""Initialize conv1d with Xavier_uniform weight and 0 bias."""
if isinstance(m, torch.nn.Conv1d):
torch.nn.init.xavier_uniform_(m.... | 35.622363 | 101 | 0.586615 | import dataclasses
import logging
from typing import Iterable, Optional
import pytorch_lightning as pl
import torch
import torch.nn
import torch.nn.functional as F
import torch.nn.init
from . import generators, sampling, encoding
_logger = logging.getLogger("pytorch_lightning")
_logger.setLevel(logging.INFO)
def w... | 0 | 295 | 0 | 15,702 | 0 | 155 | 0 | 55 | 250 |
ed31e3eeed7466b7df3ccf7892f16da82a1aab80 | 8,012 | py | Python | ui/mw.py | BurakEselik/calculator_gui | aa98ecde9b9fa759eef29b941051eab6eef5e6b4 | [
"MIT"
] | null | null | null | ui/mw.py | BurakEselik/calculator_gui | aa98ecde9b9fa759eef29b941051eab6eef5e6b4 | [
"MIT"
] | null | null | null | ui/mw.py | BurakEselik/calculator_gui | aa98ecde9b9fa759eef29b941051eab6eef5e6b4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'calculator.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
| 42.391534 | 117 | 0.651273 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'calculator.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, Q... | 0 | 0 | 0 | 7,652 | 0 | 0 | 0 | 21 | 46 |
45ef97e0090ed31b895ea67959340543c08c4c43 | 110 | py | Python | configs/__init__.py | devbruce/yolov3-tf2 | 2361685cc8a12f341de441bb3462eb3e7a825bc4 | [
"MIT"
] | null | null | null | configs/__init__.py | devbruce/yolov3-tf2 | 2361685cc8a12f341de441bb3462eb3e7a825bc4 | [
"MIT"
] | null | null | null | configs/__init__.py | devbruce/yolov3-tf2 | 2361685cc8a12f341de441bb3462eb3e7a825bc4 | [
"MIT"
] | null | null | null | from configs.base import Configs, ProjectPath
__all__ = ['Configs', 'ProjectPath', 'cfg']
cfg = Configs()
| 13.75 | 45 | 0.7 | from configs.base import Configs, ProjectPath
__all__ = ['Configs', 'ProjectPath', 'cfg']
cfg = Configs()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7553a87222ef40ffb691eec7456a83a20580129a | 2,339 | py | Python | 2020/Day4/main.py | limited/AdventOfCode | 36f92b9c42d7b81f23f4e14d07657a03a9a2beb3 | [
"Apache-2.0"
] | null | null | null | 2020/Day4/main.py | limited/AdventOfCode | 36f92b9c42d7b81f23f4e14d07657a03a9a2beb3 | [
"Apache-2.0"
] | null | null | null | 2020/Day4/main.py | limited/AdventOfCode | 36f92b9c42d7b81f23f4e14d07657a03a9a2beb3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
with open('game_input', 'r') as f:
#print([p for p in f.read().split('\n\n')])
#print([len(p.replace("\n", " ").split(" ")) for p in f.read().split('\n\n')])
#print([1 if len(p.replace("\n", " ").split(" ")) == 8 or \
# (len(p.replace("\n", " ").split(" ")) == 7 and ... | 28.52439 | 116 | 0.502779 | #!/usr/bin/env python3
with open('game_input', 'r') as f:
#print([p for p in f.read().split('\n\n')])
#print([len(p.replace("\n", " ").split(" ")) for p in f.read().split('\n\n')])
#print([1 if len(p.replace("\n", " ").split(" ")) == 8 or \
# (len(p.replace("\n", " ").split(" ")) == 7 and ... | 0 | 0 | 0 | 0 | 0 | 589 | 0 | 0 | 92 |
70f9dfd4026656a16aec7186979fcaf8d8cd7055 | 2,083 | py | Python | lib/python/treadmill/rest/api/authz/authz_base.py | vrautela/treadmill | 05e47fa8acdf8bad7af78e737efb26ea6488de82 | [
"Apache-2.0"
] | 133 | 2016-09-15T13:36:12.000Z | 2021-01-18T06:29:13.000Z | lib/python/treadmill/rest/api/authz/authz_base.py | vrautela/treadmill | 05e47fa8acdf8bad7af78e737efb26ea6488de82 | [
"Apache-2.0"
] | 108 | 2016-12-28T23:41:27.000Z | 2020-03-05T21:20:37.000Z | lib/python/treadmill/rest/api/authz/authz_base.py | evreng/treadmill | 05e47fa8acdf8bad7af78e737efb26ea6488de82 | [
"Apache-2.0"
] | 69 | 2016-09-23T20:38:58.000Z | 2020-11-11T02:31:21.000Z | """Base authorization API.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
from treadmill import webutils
_LOGGER = logging.getLogger(__name__)
_ROUTE = '/<user>/<action>/<resource>'
def regist... | 28.534247 | 77 | 0.651944 | """Base authorization API.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import json
import http.client
import flask
import flask_restplus as restplus
from treadmill import webutils
_LOGGER = l... | 0 | 0 | 0 | 1,265 | 0 | 0 | 0 | -10 | 112 |
caea43ac7c5ef61fe4b7bf0e1dbb876250f8d18e | 8,104 | py | Python | forte/data/readers/html_reader_test.py | atif93/forte | 2b70531abfb54fc5c2429ee26a501ad5c9094f3c | [
"Apache-2.0"
] | null | null | null | forte/data/readers/html_reader_test.py | atif93/forte | 2b70531abfb54fc5c2429ee26a501ad5c9094f3c | [
"Apache-2.0"
] | 13 | 2019-12-01T04:51:38.000Z | 2020-02-11T23:55:11.000Z | forte/data/readers/html_reader_test.py | gpengzhi/forte | 2b70531abfb54fc5c2429ee26a501ad5c9094f3c | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The Forte Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 33.90795 | 80 | 0.582428 | # Copyright 2019 The Forte Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 0 | 7,083 | 0 | 0 | 0 | 0 | 0 | 73 | 244 |
ebedea2519c6820b54c1b9d653e4df3b9b5e70c1 | 4,975 | py | Python | source.py | vibenOfficial/test | f2b4897de62b8a187a9165205381f5313a275a9f | [
"Apache-2.0"
] | null | null | null | source.py | vibenOfficial/test | f2b4897de62b8a187a9165205381f5313a275a9f | [
"Apache-2.0"
] | 4 | 2022-03-19T00:39:22.000Z | 2022-03-19T17:33:22.000Z | source.py | vibenOfficial/test | f2b4897de62b8a187a9165205381f5313a275a9f | [
"Apache-2.0"
] | null | null | null | choice = True
import random, string
import os
from termcolor import colored
from colorama import Fore
import requests
os.system("cls")
os.system("title NitroGen v1.3 ~ Made by viben#6633 [Menu]")
print('')
print('')
print(colored('', 'magenta'))
print(colored('', 'magenta'))
print(colored('', 'magenta'))
print(colo... | 37.126866 | 128 | 0.426734 | choice = True
import random, string
import os
from termcolor import colored
from colorama import Fore
import requests
os.system("cls")
os.system("title NitroGen v1.3 ~ Made by viben#6633 [Menu]")
print('')
print('')
print(colored('███╗░░██╗██╗████████╗██████╗░░█████╗░ ░██████╗░███████╗███╗░░██╗', 'magenta'))
print... | 4,680 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7de8f01dfca4e6fd92e565a45edc5131834e2d33 | 5,077 | pyw | Python | kindle.pyw | winsphinx/Kindle | 6fd7541d46d2d043b9ca0c72f379c2e888f9df0f | [
"MIT"
] | null | null | null | kindle.pyw | winsphinx/Kindle | 6fd7541d46d2d043b9ca0c72f379c2e888f9df0f | [
"MIT"
] | null | null | null | kindle.pyw | winsphinx/Kindle | 6fd7541d46d2d043b9ca0c72f379c2e888f9df0f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This is a ...
"""
from __future__ import unicode_literals
import codecs
import os
import re
import shutil
import sys
def get_path():
""" get Kindle path """
if sys.platform == "win32":
x = os.popen("wmic VOLUME WHERE Label='kindle' GET DriveLetter").... | 28.363128 | 87 | 0.565885 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This is a ...
"""
from __future__ import unicode_literals
import codecs
import os
import re
import shutil
import sys
import tkinter as T
def get_path():
""" get Kindle path """
if sys.platform == "win32":
x = os.popen("wmic VOLUME WHERE Label='kindle... | 0 | 0 | 0 | 2,986 | 0 | 109 | 0 | -2 | 68 |
96529c1832f64ae7beb90363072ca90c12a7e05f | 764 | py | Python | Python Course/Hashing/linear_probing.py | Satyam-Bhalla/Python-Scripts | 39c46a362acd63cc5d1b9ab57ecb7250eaff35f7 | [
"MIT"
] | 8 | 2018-09-25T16:30:12.000Z | 2022-03-25T05:13:43.000Z | Python Course/Hashing/linear_probing.py | Satyam-Bhalla/Python-Scripts | 39c46a362acd63cc5d1b9ab57ecb7250eaff35f7 | [
"MIT"
] | 1 | 2021-03-31T18:43:43.000Z | 2021-03-31T18:43:43.000Z | Python Course/Hashing/linear_probing.py | Satyam-Bhalla/Python-Scripts | 39c46a362acd63cc5d1b9ab57ecb7250eaff35f7 | [
"MIT"
] | 6 | 2018-01-29T19:00:42.000Z | 2022-03-25T05:13:47.000Z | from collections import defaultdict
table=defaultdict(str)
mod=26
insert('delhi',table)
insert('mumbai',table)
insert('kolkata',table)
insert('chennai',table)
insert('jalandhar',table)
insert('abcdefgh', table)
print(table)
search('mumbai',table)
search('varanasi',table)
search('abcdefgh',table)
| 20.648649 | 35 | 0.647906 | from collections import defaultdict
def hash_function(s):
global mod
return len(s)%mod
def insert(string,table):
global mod
index=hash_function(string)
while(table[index]!=""):
index=(index+1)%mod
table[index]=string
def search(string,table):
global mod
index = hash_function(s... | 0 | 0 | 0 | 0 | 0 | 392 | 0 | 0 | 69 |
b4687517d0367ebb1afb855a3e63c856b5baa439 | 7,860 | py | Python | torch/distributed/elastic/rendezvous/utils.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 60,067 | 2017-01-18T17:21:31.000Z | 2022-03-31T21:37:45.000Z | torch/distributed/elastic/rendezvous/utils.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 66,955 | 2017-01-18T17:21:38.000Z | 2022-03-31T23:56:11.000Z | torch/distributed/elastic/rendezvous/utils.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 19,210 | 2017-01-18T17:45:04.000Z | 2022-03-31T23:51:56.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import ipaddress
import random
import re
import socket
import time
from typing import Dict, Optional, Tuple, Unio... | 30 | 100 | 0.610941 | # Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import ipaddress
import random
import re
import socket
import time
import weakref
from datetime import timedelta
... | 0 | 297 | 0 | 2,774 | 0 | 0 | 0 | 31 | 89 |
53ea894fd97b2523a13799b8bbbede2a8052165a | 54,436 | py | Python | src/sage/combinat/rigged_configurations/kleber_tree.py | bopopescu/sage-5 | 9d85b34956ca2edd55af307f99c5d3859acd30bf | [
"BSL-1.0"
] | null | null | null | src/sage/combinat/rigged_configurations/kleber_tree.py | bopopescu/sage-5 | 9d85b34956ca2edd55af307f99c5d3859acd30bf | [
"BSL-1.0"
] | null | null | null | src/sage/combinat/rigged_configurations/kleber_tree.py | bopopescu/sage-5 | 9d85b34956ca2edd55af307f99c5d3859acd30bf | [
"BSL-1.0"
] | null | null | null | r"""
Kleber Trees
A Kleber tree is a tree of weights generated by Kleber's algorithm
[Kleber1]_. The nodes correspond to the weights in the positive Weyl chamber
obtained by subtracting a (non-zero) positive root. The edges are labeled by
the coefficients of the roots of the difference.
AUTHORS:
- Travis Scrimshaw (... | 38.994269 | 289 | 0.561871 | r"""
Kleber Trees
A Kleber tree is a tree of weights generated by Kleber's algorithm
[Kleber1]_. The nodes correspond to the weights in the positive Weyl chamber
obtained by subtracting a (non-zero) positive root. The edges are labeled by
the coefficients of the roots of the difference.
AUTHORS:
- Travis Scrimshaw (... | 0 | 6,768 | 0 | 39,692 | 0 | 0 | 0 | 350 | 360 |
65a2d0a88a0f66534623babf83d8ab6c93000c5f | 7,697 | py | Python | inpystem/tools/FISTA.py | etienne-monier/inpystem | 7914008374d0eb32362c447052de1af2b1ea9fa9 | [
"MIT"
] | 2 | 2020-04-29T21:45:58.000Z | 2020-06-12T04:39:18.000Z | inpystem/tools/FISTA.py | etienne-monier/inpystem | 7914008374d0eb32362c447052de1af2b1ea9fa9 | [
"MIT"
] | 8 | 2021-04-20T19:19:52.000Z | 2022-03-12T00:12:00.000Z | inpystem/tools/FISTA.py | etienne-monier/inpystem | 7914008374d0eb32362c447052de1af2b1ea9fa9 | [
"MIT"
] | 1 | 2020-10-02T20:54:05.000Z | 2020-10-02T20:54:05.000Z | # -*- coding: utf-8 -*-
"""
This module implements interfacing tools for the FISTA algorithm.
For further informations about the FISTA algorithm, have a look at [1]_.
.. [1] BECK, Amir et TEBOULLE, Marc. A fast iterative shrinkage-thresholding
algorithm for linear inverse problems. SIAM journal on imaging sciences... | 27.391459 | 78 | 0.506691 | # -*- coding: utf-8 -*-
"""
This module implements interfacing tools for the FISTA algorithm.
For further informations about the FISTA algorithm, have a look at [1]_.
.. [1] BECK, Amir et TEBOULLE, Marc. A fast iterative shrinkage-thresholding
algorithm for linear inverse problems. SIAM journal on imaging sciences... | 0 | 0 | 0 | 7,213 | 0 | 0 | 0 | -23 | 91 |
55dfbab92fe7add4c3af4e4492d2389bc0a05c45 | 404 | py | Python | desafio20.py | kelson-gs/Desafios-python | b40867a331c0dab84b4ceff5391c5dcd07c42da2 | [
"MIT"
] | null | null | null | desafio20.py | kelson-gs/Desafios-python | b40867a331c0dab84b4ceff5391c5dcd07c42da2 | [
"MIT"
] | null | null | null | desafio20.py | kelson-gs/Desafios-python | b40867a331c0dab84b4ceff5391c5dcd07c42da2 | [
"MIT"
] | null | null | null | import random
print('sorteando quatro alunos para apresentar=')
nomess = ('ariana', 'carlos', 'tnia', 'olivia')
n = random.choice(nomess)
print(n)
#
#import random
#n1 = str(input('primeiro aluno:')
#n2 = str(input('segundo aluno:')
#n3 = str(input('terceiro aluno:')
#n4 = str(input('quarto aluno:')
#lista = [n1, n2, n... | 26.933333 | 49 | 0.685644 | import random
print('sorteando quatro alunos para apresentar=')
nomess = ('ariana', 'carlos', 'tânia', 'olivia')
n = random.choice(nomess)
print(n)
#
#import random
#n1 = str(input('primeiro aluno:')
#n2 = str(input('segundo aluno:')
#n3 = str(input('terceiro aluno:')
#n4 = str(input('quarto aluno:')
#lista = [n1, n2, ... | 8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
69870787f618e2fb2bf6607f7094475fb319c4ae | 806 | py | Python | marvin/modules/Greeting.py | KonstantinKo/marvin | 4997814238694ec2fbac591485f7107b4a1881fe | [
"MIT"
] | null | null | null | marvin/modules/Greeting.py | KonstantinKo/marvin | 4997814238694ec2fbac591485f7107b4a1881fe | [
"MIT"
] | null | null | null | marvin/modules/Greeting.py | KonstantinKo/marvin | 4997814238694ec2fbac591485f7107b4a1881fe | [
"MIT"
] | null | null | null | # -*- coding: utf-8-*-
"""
Basic module template.
"""
import re
SENTENCES = [
"hello {P}", "hi {P}", "good morning {P}", "good afternoon {P}",
"good evening {P}", "good day {P}"
]
def handle(text, output, profile):
"""
Responds to user-input, typically speech text, by greeting the user.
... | 23.028571 | 76 | 0.585608 | # -*- coding: utf-8-*-
"""
Basic module template.
"""
import re
SENTENCES = [
"hello {P}", "hi {P}", "good morning {P}", "good afternoon {P}",
"good evening {P}", "good day {P}"
]
def handle(text, output, profile):
"""
Responds to user-input, typically speech text, by greeting the user.
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1f57207a247f3c693a17cbed82481b115dca92dd | 575 | py | Python | deciphon_api/core/events.py | EBI-Metagenomics/deciphon-api | d2435d84aaf4cc0ffe24b6ac7a01d8cb527b3ff2 | [
"MIT"
] | null | null | null | deciphon_api/core/events.py | EBI-Metagenomics/deciphon-api | d2435d84aaf4cc0ffe24b6ac7a01d8cb527b3ff2 | [
"MIT"
] | null | null | null | deciphon_api/core/events.py | EBI-Metagenomics/deciphon-api | d2435d84aaf4cc0ffe24b6ac7a01d8cb527b3ff2 | [
"MIT"
] | null | null | null |
__all__ = ["create_start_handler", "create_stop_handler"]
| 21.296296 | 58 | 0.728696 | from typing import Callable
from deciphon_sched.sched import sched_cleanup, sched_init
from loguru import logger
from deciphon_api.core.settings import Settings
__all__ = ["create_start_handler", "create_stop_handler"]
def create_start_handler(
settings: Settings,
) -> Callable:
async def start_app() -> No... | 0 | 50 | 100 | 0 | 0 | 155 | 0 | 73 | 136 |
c9a9e16a99790072e15c3ca9ecebfd28a4116b92 | 709 | py | Python | src/app/affair/affair.py | cla7aye15I4nd/zhiyuan-salon-Q | 3e7c91fc466f6aeef7950034d9ed84928e539cb9 | [
"MIT"
] | 2 | 2021-05-25T07:33:44.000Z | 2021-05-25T07:35:11.000Z | src/app/affair/affair.py | cla7aye15I4nd/zhiyuan-salon-Q | 3e7c91fc466f6aeef7950034d9ed84928e539cb9 | [
"MIT"
] | null | null | null | src/app/affair/affair.py | cla7aye15I4nd/zhiyuan-salon-Q | 3e7c91fc466f6aeef7950034d9ed84928e539cb9 | [
"MIT"
] | null | null | null |
from flask import Blueprint
affairs = Blueprint('affairs', __name__, template_folder='templates', url_prefix='/salon')
| 28.36 | 90 | 0.770099 | import os
from datetime import datetime
from flask import Blueprint
from flask import render_template, request, redirect, send_from_directory
from flask_login import login_required, current_user
from .export import export
from ..defines import names
affairs = Blueprint('affairs', __name__, template_folder='templates... | 0 | 318 | 0 | 0 | 0 | 0 | 0 | 90 | 179 |
bbf35eacaa82fb181b90705fbaae4d29efef81cb | 1,240 | py | Python | L12-platypus-tsp.py | jdherman/evolutionary-algorithms-course | 1632298de66c2e27afd1be1c538da040a2d97dcf | [
"MIT"
] | 14 | 2018-10-16T19:35:48.000Z | 2022-02-23T07:27:27.000Z | L12-platypus-tsp.py | jdherman/evolutionary-algorithms-course | 1632298de66c2e27afd1be1c538da040a2d97dcf | [
"MIT"
] | null | null | null | L12-platypus-tsp.py | jdherman/evolutionary-algorithms-course | 1632298de66c2e27afd1be1c538da040a2d97dcf | [
"MIT"
] | 5 | 2019-03-31T15:46:22.000Z | 2021-05-31T03:13:32.000Z | import numpy as np
from platypus import GeneticAlgorithm, Problem, Permutation, Insertion
# load the data for the USA 48 capital cities
# optimal value = 10628 (https://people.sc.fsu.edu/~jburkardt/datasets/tsp/tsp.html)
xy = np.loadtxt('data/tsp-48.txt')
num_cities = len(xy)
# Problem(number of decisions, number of ... | 32.631579 | 84 | 0.745968 | import numpy as np
from platypus import GeneticAlgorithm,Problem,Permutation,Insertion
def tour_distance(tour):
# index with list, and repeat the first city
tour = tour[0] # hack
x = np.append(tour, tour[0])
d = np.diff(xy[tour], axis=0)
return [np.sqrt((d**2).sum(axis=1)/10).sum()]
# load the data for the... | 0 | 0 | 0 | 0 | 0 | 186 | 0 | -3 | 23 |
8e70a0e409def6087d103be599b66d5f9cee2914 | 276 | py | Python | utils/__init__.py | eugene-yang/DESIRES18-QBD-Experiments | 8d46c833c13d8d4730d140d5f0411cad21319b9e | [
"MIT"
] | null | null | null | utils/__init__.py | eugene-yang/DESIRES18-QBD-Experiments | 8d46c833c13d8d4730d140d5f0411cad21319b9e | [
"MIT"
] | null | null | null | utils/__init__.py | eugene-yang/DESIRES18-QBD-Experiments | 8d46c833c13d8d4730d140d5f0411cad21319b9e | [
"MIT"
] | null | null | null | import pickle, json
from .logger import logger
__all__ = ["logger", "aslist", "load_pickle", "load_json"]
load_pickle = lambda x: pickle.load( open( str(x), "rb" ) )
load_json = lambda x: json.load( open( str(x) ) )
| 25.090909 | 59 | 0.673913 | import pickle, json
from .logger import logger
__all__ = ["logger", "aslist", "load_pickle", "load_json"]
load_pickle = lambda x: pickle.load( open( str(x), "rb" ) )
load_json = lambda x: json.load( open( str(x) ) )
def aslist(l):
return l if isinstance(l, list) else [l]
| 0 | 0 | 0 | 0 | 0 | 35 | 0 | 0 | 23 |
b5164a93e541511c9536f56267ed4c7169d290f8 | 1,763 | py | Python | pastepwn/analyzers/genericanalyzer.py | robotboyfriend/pastepwn | ca6dd87afd053b5032857eb0615a947c3b9dfad9 | [
"MIT"
] | 113 | 2018-09-06T22:14:52.000Z | 2022-02-17T01:32:29.000Z | pastepwn/analyzers/genericanalyzer.py | robotboyfriend/pastepwn | ca6dd87afd053b5032857eb0615a947c3b9dfad9 | [
"MIT"
] | 199 | 2018-09-15T22:17:58.000Z | 2022-01-23T23:45:09.000Z | pastepwn/analyzers/genericanalyzer.py | robotboyfriend/pastepwn | ca6dd87afd053b5032857eb0615a947c3b9dfad9 | [
"MIT"
] | 88 | 2018-09-09T13:02:06.000Z | 2022-01-23T22:56:09.000Z | # -*- coding: utf-8 -*-
| 35.979592 | 149 | 0.655133 | # -*- coding: utf-8 -*-
import logging
from .basicanalyzer import BasicAnalyzer
class GenericAnalyzer(BasicAnalyzer):
"""Analyzer to pass a function pointer to, in order to create an analyzer on the fly"""
name = "GenericAnalyzer"
def __init__(self, actions, match_func, verify_func=None):
super(... | 0 | 0 | 0 | 1,658 | 0 | 0 | 0 | 12 | 68 |
72a83e3b9017dd50c0d522701ee25b782b53731a | 6,037 | py | Python | accelbyte_py_sdk/api/legal/wrappers/_base_legal_policies.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | null | null | null | accelbyte_py_sdk/api/legal/wrappers/_base_legal_policies.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | 1 | 2021-10-13T03:46:58.000Z | 2021-10-13T03:46:58.000Z | accelbyte_py_sdk/api/legal/wrappers/_base_legal_policies.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | null | null | null | # Copyright (c) 2021 AccelByte Inc. All Rights Reserved.
# This is licensed software from AccelByte Inc, for limitations
# and restrictions contact your company contract manager.
#
# Code generated. DO NOT EDIT!
# template file: justice_py_sdk_codegen/__main__.py
# pylint: disable=duplicate-code
# pylint: disable=li... | 41.349315 | 172 | 0.787477 | # Copyright (c) 2021 AccelByte Inc. All Rights Reserved.
# This is licensed software from AccelByte Inc, for limitations
# and restrictions contact your company contract manager.
#
# Code generated. DO NOT EDIT!
# template file: justice_py_sdk_codegen/__main__.py
# pylint: disable=duplicate-code
# pylint: disable=li... | 0 | 3,888 | 0 | 0 | 0 | 0 | 0 | 586 | 742 |
d58cb39def8c8ed0b3688ec4ffcea3d2bb172a20 | 555 | py | Python | URI JUDGE ONLINE/2242.py | mee-akie/Desafios-de-programacao-JAVA | 8bfdd490ea7e17599c8cd3070b5750bb5c5c38a3 | [
"MIT"
] | null | null | null | URI JUDGE ONLINE/2242.py | mee-akie/Desafios-de-programacao-JAVA | 8bfdd490ea7e17599c8cd3070b5750bb5c5c38a3 | [
"MIT"
] | null | null | null | URI JUDGE ONLINE/2242.py | mee-akie/Desafios-de-programacao-JAVA | 8bfdd490ea7e17599c8cd3070b5750bb5c5c38a3 | [
"MIT"
] | null | null | null | entrada = str(input())
guardaVogais = ""
for i in entrada:
if i == "a" or i == "e" or i =="o" or i == "i" or i == "u":
guardaVogais = guardaVogais + " " + i
aux = guardaVogais
separa = aux.split(" ")
vogaisInvertidas = ""
for j in range(len(separa)-1 ,-1 , -1):
vogaisInvertidas = vogaisInvertidas ... | 21.346154 | 63 | 0.571171 | entrada = str(input())
guardaVogais = ""
for i in entrada:
if i == "a" or i == "e" or i =="o" or i == "i" or i == "u":
guardaVogais = guardaVogais + " " + i
aux = guardaVogais
separa = aux.split(" ")
vogaisInvertidas = ""
for j in range(len(separa)-1 ,-1 , -1):
vogaisInvertidas = vogaisInvertidas ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
419768391241b02c6ba32cb8f436eb2a0f4be4b1 | 262 | py | Python | social_fabric/__main__.py | social-fabric/social-fabric | 5b6adacf4717865a262bf4364fac62f945c52f41 | [
"Apache-2.0"
] | null | null | null | social_fabric/__main__.py | social-fabric/social-fabric | 5b6adacf4717865a262bf4364fac62f945c52f41 | [
"Apache-2.0"
] | null | null | null | social_fabric/__main__.py | social-fabric/social-fabric | 5b6adacf4717865a262bf4364fac62f945c52f41 | [
"Apache-2.0"
] | null | null | null |
if __name__ == '__main__':
main() | 23.818182 | 47 | 0.687023 | from gevent.pywsgi import WSGIServer
from social_fabric.app import app
def main():
host = app.config['HOST']
port = app.config['PORT']
http_server = WSGIServer((host, port), app)
http_server.serve_forever()
if __name__ == '__main__':
main() | 0 | 0 | 0 | 0 | 0 | 130 | 0 | 27 | 67 |
5350e859df8694754c5dbe893c5294114fc7763e | 142 | py | Python | givenergy_modbus/__init__.py | zaheerm/givenergy-modbus | db0cf5c6580737f157e1d0fdea4e471477eb04bd | [
"Apache-2.0"
] | null | null | null | givenergy_modbus/__init__.py | zaheerm/givenergy-modbus | db0cf5c6580737f157e1d0fdea4e471477eb04bd | [
"Apache-2.0"
] | null | null | null | givenergy_modbus/__init__.py | zaheerm/givenergy-modbus | db0cf5c6580737f157e1d0fdea4e471477eb04bd | [
"Apache-2.0"
] | null | null | null | """Top-level package for GivEnergy Modbus."""
__author__ = """Dewet Diener"""
__email__ = 'givenergy-modbus@dewet.org'
__version__ = '0.9.3'
| 23.666667 | 45 | 0.704225 | """Top-level package for GivEnergy Modbus."""
__author__ = """Dewet Diener"""
__email__ = 'givenergy-modbus@dewet.org'
__version__ = '0.9.3'
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
cdae861a30ba2bb3bd941147a704995ddbb3e7b8 | 4,894 | py | Python | pytest_ipynb/plugin.py | kevingerman/pytest-ipynb | 04b5fed4f280983f64254b01e3b24b7733e99224 | [
"BSD-3-Clause"
] | 104 | 2015-01-21T16:10:46.000Z | 2021-05-31T06:53:35.000Z | pytest_ipynb/plugin.py | kevingerman/pytest-ipynb | 04b5fed4f280983f64254b01e3b24b7733e99224 | [
"BSD-3-Clause"
] | 26 | 2015-04-09T04:12:48.000Z | 2018-12-22T18:41:33.000Z | pytest_ipynb/plugin.py | kevingerman/pytest-ipynb | 04b5fed4f280983f64254b01e3b24b7733e99224 | [
"BSD-3-Clause"
] | 21 | 2015-02-06T10:07:28.000Z | 2021-04-19T21:31:48.000Z | import pytest
import os, sys
import warnings
try:
from exceptions import Exception, TypeError, ImportError
except:
pass
from runipy.notebook_runner import NotebookRunner
wrapped_stdin = sys.stdin
sys.stdin = sys.__stdin__
sys.stdin = wrapped_stdin
try:
from Queue import Empty
except:
from queue import... | 32.845638 | 122 | 0.599918 | import pytest
import os,sys
import warnings
try:
from exceptions import Exception, TypeError, ImportError
except:
pass
from runipy.notebook_runner import NotebookRunner
wrapped_stdin = sys.stdin
sys.stdin = sys.__stdin__
sys.stdin = wrapped_stdin
try:
from Queue import Empty
except:
from queue import ... | 0 | 0 | 0 | 3,295 | 0 | 92 | 0 | -1 | 122 |
d08413ff1ef40cca49028cda8230b7842969fb46 | 3,522 | py | Python | dataset.py | zhang-zsf/mobilenetV2-arcfaceloss-keras-tflite | 437725dbe62a9a5f5f8223e7aa910eaad0038b90 | [
"MIT"
] | 7 | 2020-02-24T00:08:58.000Z | 2021-11-05T07:55:30.000Z | dataset.py | zhang-zsf/mobilenetV2-arcfaceloss-keras-tflite | 437725dbe62a9a5f5f8223e7aa910eaad0038b90 | [
"MIT"
] | 6 | 2020-09-25T22:33:17.000Z | 2022-02-09T23:41:35.000Z | dataset.py | zhang-zsf/mobilenetV2-arcfaceloss-keras-tflite | 437725dbe62a9a5f5f8223e7aa910eaad0038b90 | [
"MIT"
] | 4 | 2020-04-27T02:22:43.000Z | 2021-09-14T06:56:30.000Z | import tensorflow as tf
import cv2
def decode_jpeg(image_buffer, scope=None):
"""Decode a JPEG string into one 3-D float image Tensor.
Args:
image_buffer: scalar string Tensor.
scope: Optional scope for name_scope.
Returns:
3-D float Tensor with values ranging from [0, 1).
"""
with tf.name_scope(v... | 32.915888 | 133 | 0.66326 | import tensorflow as tf
import numpy as np
import cv2
def decode_jpeg(image_buffer, scope=None):
"""Decode a JPEG string into one 3-D float image Tensor.
Args:
image_buffer: scalar string Tensor.
scope: Optional scope for name_scope.
Returns:
3-D float Tensor with values ranging from [0, 1).
"""
w... | 42 | 0 | 0 | 0 | 485 | 1,286 | 0 | -3 | 91 |
ef15d6aec626b31f508e613ca8825134d645beed | 1,963 | py | Python | setup.py | NerdWalletOSS/versionalchemy | 89e482c405c420231e7f6b3c3650cea2ca0f81b0 | [
"MIT"
] | 16 | 2016-11-04T18:38:03.000Z | 2021-11-12T17:36:33.000Z | setup.py | NerdWallet/versionalchemy | 89e482c405c420231e7f6b3c3650cea2ca0f81b0 | [
"MIT"
] | 3 | 2016-08-26T18:03:21.000Z | 2016-08-26T18:08:36.000Z | setup.py | NerdWalletOSS/versionalchemy | 89e482c405c420231e7f6b3c3650cea2ca0f81b0 | [
"MIT"
] | 6 | 2017-07-06T07:45:10.000Z | 2019-04-19T13:13:33.000Z | from __future__ import absolute_import
from setuptools import setup
install_requires = [
"six>=1.12.0",
"SQLAlchemy>=1.0",
]
dev_requires = [
"autopep8>=1.4.4",
"coverage",
"flake8",
"ipdb",
"ipython",
"isort>=4.3.21",
'mock;python_version=="2.7"',
"nose",
"pip-tools",
... | 28.867647 | 86 | 0.676516 | from __future__ import absolute_import
from setuptools import setup
install_requires = [
"six>=1.12.0",
"SQLAlchemy>=1.0",
]
dev_requires = [
"autopep8>=1.4.4",
"coverage",
"flake8",
"ipdb",
"ipython",
"isort>=4.3.21",
'mock;python_version=="2.7"',
"nose",
"pip-tools",
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1606f22ceecc20c218c2a8c64206f7b8995357b9 | 699 | py | Python | Searching Algorithms/2.2-binary_search.py | neeveermoree/data_structures_and_algorithms | 8aa37cade53539909383fb9d4952b13ca19c931a | [
"MIT"
] | null | null | null | Searching Algorithms/2.2-binary_search.py | neeveermoree/data_structures_and_algorithms | 8aa37cade53539909383fb9d4952b13ca19c931a | [
"MIT"
] | null | null | null | Searching Algorithms/2.2-binary_search.py | neeveermoree/data_structures_and_algorithms | 8aa37cade53539909383fb9d4952b13ca19c931a | [
"MIT"
] | null | null | null |
a = [1, 2, 5, 7, 10, 12]
print(binary_search_recursive(a, 0, len(a)-1, -1))
| 22.548387 | 64 | 0.484979 | def binary_search_iterative(arr, key):
l = 0
r = len(arr) - 1
while l <= r:
m = (r - l // 2) + l
if arr[m] == key:
return m
elif arr[m] > key:
r = m - 1
else:
l = m + 1
return -1
def binary_search_recursive(arr, start, end, key):
... | 0 | 0 | 0 | 0 | 0 | 571 | 0 | 0 | 49 |
f8e4de95e54d8234108537130522df5ee4365937 | 2,305 | py | Python | src/simple_commander/game/invader.py | peterzdeb/WebGamepad | 62e55513803d1afbdf5a6a4e3a3757dcdd3e3449 | [
"MIT"
] | null | null | null | src/simple_commander/game/invader.py | peterzdeb/WebGamepad | 62e55513803d1afbdf5a6a4e3a3757dcdd3e3449 | [
"MIT"
] | null | null | null | src/simple_commander/game/invader.py | peterzdeb/WebGamepad | 62e55513803d1afbdf5a6a4e3a3757dcdd3e3449 | [
"MIT"
] | null | null | null | """This module describes Invader's behaviour. """
| 37.786885 | 120 | 0.634707 | """This module describes Invader's behaviour. """
import asyncio
import logging
from random import randint
from gamepad.unit import Unit
from simple_commander.utils.constants import DEFAULT_SPEED, STEP_INTERVAL, UNITS
from simple_commander.game.bullet import Bullet
class Invader(Unit):
def __init__(self, x, y... | 0 | 229 | 0 | 1,784 | 0 | 0 | 0 | 84 | 158 |
c5805ebd80f22ce08763c7b87c49cc79a903f2f0 | 4,511 | py | Python | collection_modules/btle_beacon/registeredClientRegistry.py | dbenge/SimpleSensor_contrib | f48c31d3a0e0e29531ac5b0b445dccafd4f1e1d9 | [
"Apache-2.0"
] | null | null | null | collection_modules/btle_beacon/registeredClientRegistry.py | dbenge/SimpleSensor_contrib | f48c31d3a0e0e29531ac5b0b445dccafd4f1e1d9 | [
"Apache-2.0"
] | null | null | null | collection_modules/btle_beacon/registeredClientRegistry.py | dbenge/SimpleSensor_contrib | f48c31d3a0e0e29531ac5b0b445dccafd4f1e1d9 | [
"Apache-2.0"
] | null | null | null | """
this file has three classes. All the classes are related to tracking clients that are in range
RegistryEvent
RegisteredClientRegistry
RegistryEventHandler
"""
import os
import logging
| 31.110345 | 139 | 0.684106 | """
this file has three classes. All the classes are related to tracking clients that are in range
RegistryEvent
RegisteredClientRegistry
RegistryEventHandler
"""
from simplesensor.shared import ThreadsafeLogger
from .btleRegisteredClient import BtleRegisteredClient
import os
import os.path
import logging
import lo... | 0 | 0 | 0 | 4,097 | 0 | 0 | 0 | 43 | 180 |
f721f9a0a04d2003639f19899e390e586887dfde | 1,478 | py | Python | tests/test_ctc1.py | madhurkashyap/boundary_detection | f7fb98c8bcbc204b1fcd0eb34a8699f16a8725a3 | [
"MIT"
] | null | null | null | tests/test_ctc1.py | madhurkashyap/boundary_detection | f7fb98c8bcbc204b1fcd0eb34a8699f16a8725a3 | [
"MIT"
] | null | null | null | tests/test_ctc1.py | madhurkashyap/boundary_detection | f7fb98c8bcbc204b1fcd0eb34a8699f16a8725a3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 26 15:15:55 2018
@author: Madhur Kashyap 2016EEZ8350
"""
import os
import sys
from keras.optimizers import Adam
prog = os.path.basename(__file__)
codedir = os.path.join(os.path.dirname(__file__),"..","code")
sys.path.append(codedir)
from SpeechCorpus impor... | 29.56 | 80 | 0.654263 | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 26 15:15:55 2018
@author: Madhur Kashyap 2016EEZ8350
"""
import os
import sys
import logging
from keras.optimizers import Adam
prog = os.path.basename(__file__)
codedir = os.path.join(os.path.dirname(__file__),"..","code")
sys.path.append(codedir)
from ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 48 |
10a3ee204b406dd38ede8300d7e3b32e947a1ce2 | 9,731 | py | Python | src/transformers_ernie/ernie_ctm/tokenization_ernie_ctm_fast.py | rogerdehe/transformers-ernie | df492d961f2a029faf6c0c7d79ccca6cb06ade3e | [
"Apache-2.0"
] | null | null | null | src/transformers_ernie/ernie_ctm/tokenization_ernie_ctm_fast.py | rogerdehe/transformers-ernie | df492d961f2a029faf6c0c7d79ccca6cb06ade3e | [
"Apache-2.0"
] | 1 | 2022-03-18T12:35:48.000Z | 2022-03-18T12:35:48.000Z | src/transformers_ernie/ernie_ctm/tokenization_ernie_ctm_fast.py | rogerdehe/transformers-ernie | df492d961f2a029faf6c0c7d79ccca6cb06ade3e | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
#
# 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/LICEN... | 50.947644 | 127 | 0.623882 | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
#
# 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/LICEN... | 0 | 0 | 0 | 8,004 | 0 | 0 | 0 | 221 | 202 |
dbea39546c7d196a900c1a04290fe49894bba3fb | 74 | py | Python | Chapter 08/Secction_code/spinbox.py | bpbpublications/Advance-Core-Python-Programming | 8902ceb270f55c04c12e818032f90d641c14d7b1 | [
"MIT"
] | null | null | null | Chapter 08/Secction_code/spinbox.py | bpbpublications/Advance-Core-Python-Programming | 8902ceb270f55c04c12e818032f90d641c14d7b1 | [
"MIT"
] | null | null | null | Chapter 08/Secction_code/spinbox.py | bpbpublications/Advance-Core-Python-Programming | 8902ceb270f55c04c12e818032f90d641c14d7b1 | [
"MIT"
] | null | null | null | mw = Tk()
mw = Spinbox(mw)
mw.pack()
mainloop()
| 12.333333 | 21 | 0.621622 | from tkinter import*
mw = Tk()
mw = Spinbox(mw)
mw.pack()
mainloop()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | -1 | 23 |
24121b13c1aa3f482799a091c51adfea87edc47e | 3,813 | py | Python | foreground_farm/foreground_farm.py | xandao6/clockworks-flyff-bots | 94f8d74093dd4044f6a6b9f3d2642ee851dd4d21 | [
"MIT"
] | null | null | null | foreground_farm/foreground_farm.py | xandao6/clockworks-flyff-bots | 94f8d74093dd4044f6a6b9f3d2642ee851dd4d21 | [
"MIT"
] | null | null | null | foreground_farm/foreground_farm.py | xandao6/clockworks-flyff-bots | 94f8d74093dd4044f6a6b9f3d2642ee851dd4d21 | [
"MIT"
] | null | null | null | """Foreground Farm
Farm aproach: Move the mouse in the screen and watch if the enemy life's bar appears, then
click in the mob to attack it. Doesn't work very well.
"""
# region Imports
import time
from pynput.mouse import Listener as MouseListener
# endregion
# Notas: objetos longes precisam ser analis... | 28.886364 | 91 | 0.644637 | """Foreground Farm
Farm aproach: Move the mouse in the screen and watch if the enemy life's bar appears, then
click in the mob to attack it. Doesn't work very well.
"""
# region Imports
import time
from pyfiglet import Figlet
from pynput.mouse import Listener as MouseListener
import keyboard
import pyautog... | 4 | 0 | 0 | 0 | 0 | 2,489 | 0 | -17 | 314 |
9edda214771863eead7efc8c10d218f84847d021 | 154 | py | Python | messenger/routing.py | lautarianoo/django_social_network | ec83af7267f830a2463cb591138dae1a088f9a4e | [
"BSD-3-Clause"
] | 3 | 2021-11-21T20:46:00.000Z | 2021-12-02T14:47:18.000Z | messenger/routing.py | lautarianoo/django_social_network | ec83af7267f830a2463cb591138dae1a088f9a4e | [
"BSD-3-Clause"
] | null | null | null | messenger/routing.py | lautarianoo/django_social_network | ec83af7267f830a2463cb591138dae1a088f9a4e | [
"BSD-3-Clause"
] | null | null | null | from django.urls import re_path
websocket_urlpatterns = [
re_path(r'ws/chat/(?P<room_id>\w+)/$', ChatConsumer.as_asgi()),
] | 22 | 67 | 0.707792 | from django.urls import re_path
from .consumers import *
websocket_urlpatterns = [
re_path(r'ws/chat/(?P<room_id>\w+)/$', ChatConsumer.as_asgi()),
] | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 23 |
4d4640095b250605de3ac0a783b82cf45f9fc587 | 11,815 | py | Python | sampling/base_sample.py | e-baumer/sampling | 83dcf2244cc273d01af11bf5d71e55ed3e0210b4 | [
"Apache-2.0"
] | 2 | 2016-12-01T21:43:47.000Z | 2016-12-02T00:06:08.000Z | sampling/base_sample.py | e-baumer/sampling | 83dcf2244cc273d01af11bf5d71e55ed3e0210b4 | [
"Apache-2.0"
] | null | null | null | sampling/base_sample.py | e-baumer/sampling | 83dcf2244cc273d01af11bf5d71e55ed3e0210b4 | [
"Apache-2.0"
] | null | null | null | from __future__ import division
| 40.462329 | 105 | 0.584173 | from __future__ import division
from itertools import combinations
import numpy as np
import pandas as pd
import scipy.integrate
from statsmodels.tools.tools import ECDF
from sklearn import preprocessing
import seaborn as sns
class BaseSample(object):
def __init__(self, data_frame, number_arms=2):
... | 0 | 0 | 0 | 11,554 | 0 | 0 | 0 | 40 | 177 |
df011d03f4c0c28317b09d99724955388da4fb9d | 2,161 | py | Python | src/Advent_of_Code/2020/Day_11/Day_11_1.py | phungj/MSOE_Comp_Prog_Py | 95e7521b28d3dbcb6279e7baf03067ca27acbe37 | [
"MIT"
] | null | null | null | src/Advent_of_Code/2020/Day_11/Day_11_1.py | phungj/MSOE_Comp_Prog_Py | 95e7521b28d3dbcb6279e7baf03067ca27acbe37 | [
"MIT"
] | null | null | null | src/Advent_of_Code/2020/Day_11/Day_11_1.py | phungj/MSOE_Comp_Prog_Py | 95e7521b28d3dbcb6279e7baf03067ca27acbe37 | [
"MIT"
] | null | null | null | import os
from copy import deepcopy
file_path = os.path.join(os.path.dirname(__file__), "input.txt")
with open(file_path, 'r') as input:
all_lines = input.readlines()
for i in range(len(all_lines)):
all_lines[i] = all_lines[i].strip('\n')
all_lines[i] = list(all_lines[i])
adjacencies = [(-1, -1), (-1... | 30.43662 | 153 | 0.536789 | import os
from copy import deepcopy
def simulate_step(previous_state, seating, adjacencies):
for r in range(len(seating)):
for c in range(len(seating[0])):
if previous_state[r][c] == "L":
for adjacency in adjacencies:
valid = True
try:
... | 0 | 0 | 0 | 0 | 0 | 1,335 | 0 | 0 | 46 |