repo_name stringlengths 7 111 | __id__ int64 16.6k 19,705B | blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 5 151 | content_id stringlengths 40 40 | detected_licenses list | license_type stringclasses 2
values | repo_url stringlengths 26 130 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 42 | visit_date timestamp[ns] | revision_date timestamp[ns] | committer_date timestamp[ns] | github_id int64 14.6k 687M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 12
values | gha_fork bool 2
classes | gha_event_created_at timestamp[ns] | gha_created_at timestamp[ns] | gha_updated_at timestamp[ns] | gha_pushed_at timestamp[ns] | gha_size int64 0 10.2M ⌀ | gha_stargazers_count int32 0 178k ⌀ | gha_forks_count int32 0 88.9k ⌀ | gha_open_issues_count int32 0 2.72k ⌀ | gha_language stringlengths 1 16 ⌀ | gha_archived bool 1
class | gha_disabled bool 1
class | content stringlengths 10 2.95M | src_encoding stringclasses 5
values | language stringclasses 1
value | is_vendor bool 2
classes | is_generated bool 2
classes | length_bytes int64 10 2.95M | extension stringclasses 19
values | num_repo_files int64 1 202k | filename stringlengths 4 112 | num_lang_files int64 1 202k | alphanum_fraction float64 0.26 0.89 | alpha_fraction float64 0.2 0.89 | hex_fraction float64 0 0.09 | num_lines int32 1 93.6k | avg_line_length float64 4.57 103 | max_line_length int64 7 931 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
FanciestW/UFO-Game | 2,001,454,802,555 | 65f3a77ba799eae077b8b71b7b04d065989eb2cd | 0a68e1311fed737738bf7ae806414d790967513f | /src/ufo_game/animation.py | 6799f20bfd39430ce3d050f90c26b4852cc147bf | [] | no_license | https://github.com/FanciestW/UFO-Game | a44fb593ae4ea0f3ac31ebbf561dbf6c34a0a6cd | 807bbfa0e3cce17d2c7661f61366150c5cd16875 | refs/heads/master | 2020-04-18T14:48:40.644483 | 2019-03-03T01:52:25 | 2019-03-03T01:52:25 | 167,598,427 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import time
import os
from . import ufo_animation
def ufo_win():
for frame in ufo_animation.win:
os.system('cls' if os.name == 'nt' else 'clear')
print(frame)
time.sleep(0.15)
def ufo_lose():
for frame in ufo_animation.lose:
os.system('cls' if os.name == 'nt' else 'clear')
... | UTF-8 | Python | false | false | 361 | py | 12 | animation.py | 9 | 0.592798 | 0.576177 | 0 | 15 | 23.133333 | 56 |
lastmayday/Euler | 8,478,265,452,857 | 6c664f6a38f0bc736f998f22fec707f382a58fa3 | 7a4f32606abf3cccab38764f0c04cb4b50007ebb | /32.py | 1cecc8a573e6a1cfb5ece91079b3a95896176d7d | [] | no_license | https://github.com/lastmayday/Euler | 8d464fb4b99d96aa43d2175b5851af22338ab51a | 297638039105c99a4765061378c8e9d6b1d76dbb | refs/heads/master | 2021-01-10T19:22:24.291197 | 2013-07-28T16:03:12 | 2013-07-28T16:03:12 | 6,731,722 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #-*- coding:utf-8 -*-
def isPandigital(s):
length = len(s)
if length > 9:
return False
for i in xrange(1,length+1):
if str(i) not in s:
return False
return True
def pandigital(a, b):
num = str(a) + str(b) + str(a*b)
if len(num) != 9:
return False
return... | UTF-8 | Python | false | false | 675 | py | 39 | 32.py | 39 | 0.466667 | 0.437037 | 0 | 33 | 19.454545 | 51 |
nihilus/idapatchwork | 8,761,733,288,010 | 79b6d1bff57dded2237b520d542165f23043fb50 | 575eb07b208e17c8f9a7ef4e600c2ce0eb323b02 | /examples/idapyemu_loop_code_segment.py | a2c9d6dcf92cc10a65a044e99ff8503bb0cc3f7a | [] | no_license | https://github.com/nihilus/idapatchwork | ffa425f0fd66fca098306534ab5cc1c2e49ae184 | 9a2f6519bb625d2fc32c289f9b7164e8e09ddcd0 | refs/heads/master | 2021-01-18T17:17:56.394784 | 2015-09-08T20:54:52 | 2015-09-08T20:54:52 | 42,138,430 | 2 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | #!/usr/bin/env python
import sys, os, time, struct, re, string
# !!! set your pyemu path plz2u !!!
sys.path.append(r'C:\Code\Python\pyemu')
sys.path.append(r'C:\Code\Python\pyemu\lib')
from PyEmu import *
textstart = SegByName(".text")
textend = SegEnd(textstart)
emu = IDAPyEmu()
print "[*] Loading text section b... | UTF-8 | Python | false | false | 703 | py | 40 | idapyemu_loop_code_segment.py | 39 | 0.688478 | 0.674253 | 0 | 31 | 21.709677 | 69 |
IamConstantine/LeetCodeFiddle | 18,837,726,593,478 | ea7d957ea70cbb79c4463a3fc3a443ed7089893e | 670c844e5cfa1cdf11212cc53972ecd8f7a25949 | /python/ShortestPathLength.py | fe183b49f1dab1c7e6b2a9a06446706055a79b09 | [] | no_license | https://github.com/IamConstantine/LeetCodeFiddle | 74d580a0741e40397f1283beadd023f9b9323abd | 5ec509505a394d53517fb005bbeb36745f06596a | refs/heads/master | 2022-05-31T05:25:14.273605 | 2022-05-23T02:46:47 | 2022-05-23T02:46:47 | 100,910,327 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # https://leetcode.com/problems/shortest-path-visiting-all-nodes
# Hard
# T = O(2**N * N ** 2) - 2 ** N - possible mask combinations,
# n ** 2 - worst case eeach node is connected to all other nodes
#
# S = O(2 ** N * N)
def shortestPathLength(graph):
n = len(graph)
cache = {}
ending_mask = (1 << n) - 1 #... | UTF-8 | Python | false | false | 1,022 | py | 313 | ShortestPathLength.py | 309 | 0.558708 | 0.544031 | 0 | 32 | 30.9375 | 119 |
lukehuang/appomatic | 13,202,729,484,361 | b25bc91f54872c984efbcd633099e07293d236ef | cfe03aecedaa085ffb63a376a1471b7805aec422 | /appomaticcore/appomatic/settings.py | 9b5950a4b243e9d1cc23e064333c12e1a8731af9 | [] | no_license | https://github.com/lukehuang/appomatic | 5ce46a33f2889ed638569af1d1d9c93f914249fc | 4e3cbf9ca43a6421f3953ca667607b1b1b0a28d2 | refs/heads/master | 2021-01-23T05:56:08.864264 | 2017-08-08T12:46:44 | 2017-08-08T12:46:44 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # -*- coding: utf-8 -*-
import os
import os.path
import sys
import itertools
import appomatic.utils.app
VIRTUALENV_DIR = os.environ['VIRTUAL_ENV']
PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
APP_DIR = os.path.join(VIRTUALENV_DIR, "apps")
sys.path.append(APP_DIR)
if os.environ.keys().count("PYTHONPATH") ... | UTF-8 | Python | false | false | 4,690 | py | 56 | settings.py | 48 | 0.705544 | 0.7 | 0 | 143 | 31.797203 | 92 |
fcchou/tensorflow_models | 13,469,017,454,585 | 65a73621413b9cf3892efef6c37946c8279a05d0 | 1baaa57322c398addbf912f97511d3b150a31fc8 | /tensorflow_models/rbm.py | 5bf2fd6165fc95a2b135f9c3b8b77cea113da1aa | [] | no_license | https://github.com/fcchou/tensorflow_models | 45f8c6373b4054e6f9eee35818c516c450926674 | 57246ae6ac504e601eef872681950cb2b74f6b23 | refs/heads/master | 2020-12-03T00:07:46.018218 | 2017-08-01T06:49:02 | 2017-08-01T06:49:02 | 95,992,536 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import tensorflow as tf
import numpy as np
from tensorflow_models.util import MiniBatchData
class RBM:
def __init__(
self,
rbm_layer,
learning_rate=0.001,
n_iter=5000,
batch_size=100,
negative_sample_size=100,
regularization=0.00001,
cd_k=1,
... | UTF-8 | Python | false | false | 8,380 | py | 10 | rbm.py | 9 | 0.591289 | 0.583174 | 0 | 225 | 36.248889 | 113 |
willdickson/path_integration_multi_launch | 4,277,787,456,204 | 837cb7989a3b233f2b5b08ef9bfc744c34c8a6f8 | bd4d014dea9be849cc2a0e562a64adea258e64bf | /read_yaml.py | 3a76ac1343eb2ed942cb30dc62f76530a4f7c7f9 | [] | no_license | https://github.com/willdickson/path_integration_multi_launch | 988909d2aa7e512c7cb6be0042fa966b9e795b76 | f1c52d1623f30bd37fca3949c4dbfe92a0076e52 | refs/heads/master | 2020-04-27T19:52:29.169192 | 2019-03-22T23:21:53 | 2019-03-22T23:21:53 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from __future__ import print_function
import sys
import yaml
filename = sys.argv[1]
with open(filename,'r') as f:
data = yaml.load(f)
print(data)
| UTF-8 | Python | false | false | 153 | py | 7 | read_yaml.py | 2 | 0.69281 | 0.686275 | 0 | 10 | 14.3 | 37 |
kamyh/master | 1,108,101,604,087 | 82cb8c7a9cb8785409839fa66ad60fdde771eb5a | 4aaf635a69a68ee4a41f8e289a51a4d7fcda06ea | /documents/sources/exemple_3/multiprocess_2.py | 816c50f80f1bb45e957aa2a5a6b9908a12345739 | [] | no_license | https://github.com/kamyh/master | 10c0f7c45763abd1af3c626be26a8114fce7f802 | b0ba6f846435edeebbaa2441f2a3a5205a9f3180 | refs/heads/master | 2021-01-19T22:04:54.732802 | 2017-03-08T10:14:31 | 2017-03-08T10:14:31 | 69,327,355 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from multiprocessing import Pool
def f(x, y):
return x+y
if __name__ == '__main__':
p = Pool(processes=5)
print(p.starmap(f, [[1,2],[3,4],[5,6]])) | UTF-8 | Python | false | false | 160 | py | 100 | multiprocess_2.py | 55 | 0.55 | 0.50625 | 0 | 8 | 19.125 | 44 |
phatCoding/PiCameraConnector | 2,405,181,712,083 | 941918f69bcfe27f11c93e8dd00f7d97fedf4d73 | 85a5dfc3a9c03fb2e810479aa3c5b93fc93b257b | /BrowserStream.py | d58467b042d0693fa596a500d53c068876c60ed9 | [] | no_license | https://github.com/phatCoding/PiCameraConnector | 0aff9274051ef74408aa7264a7ef2a993a9f4e49 | 72b089ac4bbcf5204aabc8f764f335017ec01a9a | refs/heads/master | 2023-07-05T22:05:31.873633 | 2021-08-01T14:14:08 | 2021-08-01T14:14:08 | 390,832,735 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import cv2 , socket
import numpy as np
import base64
import mediapipe as mp
from flask import Flask, render_template, Response
app = Flask(__name__)
BUFF_SIZE = 65536
UDP_IP_ADDRESS = '192.168.178.171'
UDP_PORT_NO = 6789
msg = "Desk".encode()
bytearray = bytearray(msg)
clientSock = socket.socket(socket.AF_INET, soc... | UTF-8 | Python | false | false | 1,944 | py | 4 | BrowserStream.py | 3 | 0.601852 | 0.579733 | 0 | 71 | 26.394366 | 116 |
jorgeamendezm/3D-visual-body-scan | 17,282,948,410,540 | 91df48cc2062097682a77eca8f79f9eb070562f5 | 1637f7ae81a7813fb688dc43a02daff8d5fe03bd | /background.py | 417f29901dc2cb68014783704afa06ce04d4931c | [] | no_license | https://github.com/jorgeamendezm/3D-visual-body-scan | d3858e9dfd385cc31243fc7b11df359c1cf6e4fa | eb32215e446c3e602b14bfdbff6242bdec00e1f8 | refs/heads/master | 2021-01-12T17:36:13.781378 | 2016-10-23T00:47:29 | 2016-10-23T00:47:29 | 71,614,919 | 2 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | import cv2
import numpy as np
from matplotlib import pyplot as plt
f = cv2.imread("image000.jpg")
bg = np.float32(f)
det_obj = []
img = []
i = 5
while(i <= 241):
title = "image%.3d.jpg" % (i)
print title
f = cv2.imread(title)
img.append(f)
f = np.float32(f)
cv2.accumulateWeighted(f,bg, 0.15)
... | UTF-8 | Python | false | false | 638 | py | 30 | background.py | 19 | 0.601881 | 0.532915 | 0 | 37 | 16.216216 | 41 |
papercodekl/MolecularGET | 3,023,657,004,512 | 8c98e1b74c155cb568c2e51c8cf1c81d33332daf | f925caeebc9357c146188655b7b16d20251ee61a | /onmt/GCN.py | fbdf3ea9911c718a6dbdffddb7eabcce919ac11d | [] | no_license | https://github.com/papercodekl/MolecularGET | 231c086c0e157007a079402c1971ffa5f4e2d7ff | 6fff202dc3c44802832c64a01b7f628c3173c741 | refs/heads/master | 2020-07-31T08:21:24.603522 | 2020-01-01T05:48:56 | 2020-01-01T05:48:56 | 210,543,189 | 8 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | import dgl
import dgl.function as fn
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import time
def gcn_reduce(nodes):
msgs = torch.cat((nodes.mailbox['h'], nodes.data['h'].unsqueeze(1)), dim = 1)
msgs = torch.mean(msgs, dim = 1)
return {'h': msgs}
def gcn_msg(edges... | UTF-8 | Python | false | false | 1,421 | py | 13 | GCN.py | 11 | 0.56228 | 0.545391 | 0 | 61 | 22.295082 | 81 |
dr-dos-ok/Code_Jam_Webscraper | 19,421,842,123,513 | 1808fb170b2e6d60975d3bd7dce90519ca0ccafd | 15f321878face2af9317363c5f6de1e5ddd9b749 | /solutions_python/Problem_138/1583.py | fe73d46d282090410abf40e4fec9bd3fc57c5c59 | [] | no_license | https://github.com/dr-dos-ok/Code_Jam_Webscraper | c06fd59870842664cd79c41eb460a09553e1c80a | 26a35bf114a3aa30fc4c677ef069d95f41665cc0 | refs/heads/master | 2020-04-06T08:17:40.938460 | 2018-10-14T10:12:47 | 2018-10-14T10:12:47 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
inputfile = 'D-large.in'
outputfile = 'outputfile.txt'
fi = open(inputfile)
fo = open(outputfile, 'w')
test_cases = int(fi.readline())
print test_cases
for case in range(test_cases):
N = int(fi.readline())
line = fi.readline()
line = line.strip('\n')
naomi = map(float, line.split(' '))
naomi.sort()
naomi_1 = m... | UTF-8 | Python | false | false | 1,607 | py | 60,747 | 1583.py | 60,742 | 0.611699 | 0.574362 | 0 | 70 | 21.9 | 99 |
isaacsorensen/tsunamibayes | 17,617,955,870,032 | 4b6e4464b95cfa65b2331ef497af6e2fdfa857e7 | 69df65414150d7a64061efa670b0dc667bf2e441 | /Model_Scripts/Scenarios/1852grl/Classes/Custom.py | af49bab2571b492fac85584c9db2ef449f9c818d | [] | no_license | https://github.com/isaacsorensen/tsunamibayes | af8c772e87f3bf3f50151492f233e33296be25e8 | a3a25438bd9b4c874e8db12d752bc04bcf19d115 | refs/heads/master | 2022-12-23T15:50:38.355970 | 2020-04-10T21:10:30 | 2020-04-10T21:10:30 | 264,291,140 | 0 | 0 | null | true | 2020-05-15T20:22:47 | 2020-05-15T20:22:46 | 2020-04-10T21:10:37 | 2020-05-14T18:09:23 | 177,994 | 0 | 0 | 0 | null | false | false | """
Created By Cody Kesler
Created 10/19/2018
Property of BYU Mathematics Dept.
"""
import pandas as pd
from scipy.stats import gaussian_kde
import numpy as np
from scipy import stats
from MCMC import MCMC
from Prior import Prior
from scipy.stats import truncnorm
class Custom(MCMC):
"""
Use this class to cre... | UTF-8 | Python | false | false | 15,557 | py | 67 | Custom.py | 42 | 0.587453 | 0.551777 | 0 | 406 | 37.317734 | 260 |
kingsdigitallab/gitan | 7,430,293,464,061 | d8cad94ea3c1ad9227ffd7e40d7defcf042b26c3 | 3d64cf48a9210a1848d9633c072b022efe43fd8f | /settings.py | fff9c8a4aa459e6d89693bed07bc77d670cb277d | [
"MIT"
] | permissive | https://github.com/kingsdigitallab/gitan | 502b0d93a87f273469d8ff8a3db47c3638a658e4 | 1c23ea16bb6373f4bbd92b4d7dc0b2a697069b23 | refs/heads/master | 2021-06-11T22:38:32.795895 | 2019-03-27T21:11:49 | 2019-03-27T21:11:49 | 178,069,433 | 0 | 0 | MIT | false | 2021-06-01T23:39:55 | 2019-03-27T20:25:04 | 2020-04-03T11:37:53 | 2021-06-01T23:39:52 | 176 | 0 | 0 | 1 | Python | false | false | # imported from local_settings
# DO NOT place secret keys in this file
DATA_PATH = 'data'
GIT_MODEL_QUERIES = [
'org:kcl-ddh filename:models.py',
'org:kingsdigitallab filename:models.py',
]
| UTF-8 | Python | false | false | 198 | py | 5 | settings.py | 3 | 0.712121 | 0.712121 | 0 | 7 | 27.285714 | 45 |
mariomitte/rpilinijapogona | 481,036,361,899 | 612a5f1518c8ba121e62929b244d4ba61253e029 | 823df2d441e1088ca58f6595899e69948942cca5 | /pogon1/api/urls.py | 59563f1b5c47796e3aeb1fb6e94c0115f8c54a1b | [] | no_license | https://github.com/mariomitte/rpilinijapogona | aa171b45bb371d98f972db191894a1ab7eae984d | 926a73b921e1c60e30f9dafaeff3524a366283bd | refs/heads/master | 2023-02-27T20:23:29.300413 | 2021-01-29T02:59:55 | 2021-01-29T02:59:55 | 111,656,336 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from django.conf.urls import url, include
from rest_framework.routers import DefaultRouter
from pogon1.api.views import UpravljanjeViewSet, CvorViewSet
# kreiranje url pogleda za API
router = DefaultRouter()
router.register(prefix='upravljanje', viewset=UpravljanjeViewSet)
urlpatterns = [
url(r'^cvor/$', CvorVie... | UTF-8 | Python | false | false | 367 | py | 41 | urls.py | 18 | 0.779292 | 0.776567 | 0 | 13 | 27.230769 | 65 |
aleadra/Spell-Check-Project | 7,902,739,833,849 | 86350e050bdb627297a6e80db9b8b54276698690 | 1ada788bf548000469c99687eba4e287af00d1a0 | /src/test_utils.py | 9ba07fd0cce3327dc66e199b1a8b0c993bda918f | [] | no_license | https://github.com/aleadra/Spell-Check-Project | 26781abee84c40fb40935b3883baa8e47b04ba08 | 023916820509c9147eb293f294f261a6fbcaa2c2 | refs/heads/master | 2023-07-08T06:33:27.946464 | 2012-11-28T13:45:31 | 2012-11-28T13:45:31 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #!/usr/bin/python
import utils
import unittest
import lexicon
from suggestion import Suggestion
class UtilsTest(unittest.TestCase):
def setUp(self):
# self.spell_checker = utils.SpellChecker()
self.lexicon = lexicon.Lexicon(word_list = [
'yo', 'boyz', 'foo',
'giant', 'cell'... | UTF-8 | Python | false | false | 6,470 | py | 28 | test_utils.py | 17 | 0.487326 | 0.443586 | 0 | 168 | 37.511905 | 89 |
viswanathgs/pantheon | 9,053,791,094,977 | b824ed4ad18ce59fb8a99591fb94c13c20c47c3b | 7e7190150e7eaba1d56a4c1ea9c0caa0fc6b55d7 | /src/analysis/analyze.py | 8269eef02254fec2274499fa14a564ed69a6f38d | [] | no_license | https://github.com/viswanathgs/pantheon | eea6656fadf8dba9b912af39a4e5e418466c6fb6 | 5937edc3c99309d8a84d545c33d08f5e45bbbfb5 | refs/heads/master | 2020-07-29T10:16:41.136091 | 2020-06-09T13:56:45 | 2020-06-09T13:56:45 | 209,759,714 | 1 | 1 | null | true | 2020-06-09T13:56:47 | 2019-09-20T09:56:23 | 2020-05-12T16:42:44 | 2020-06-09T13:56:46 | 2,920 | 0 | 1 | 0 | Python | false | false | #!/usr/bin/env python
from os import path
import arg_parser
import context
from helpers.subprocess_wrappers import check_call
def main():
args = arg_parser.parse_analyze()
analysis_dir = path.join(context.src_dir, 'analysis')
plot = path.join(analysis_dir, 'plot.py')
report = path.join(analysis_dir... | UTF-8 | Python | false | false | 760 | py | 49 | analyze.py | 43 | 0.597368 | 0.594737 | 0 | 33 | 22.030303 | 57 |
lx10077/fedavgpy | 18,519,898,988,103 | 32bbfa03548aacd23198eb2af85de2ac8cd0fb8d | c0852384a61eaade525ba60c0212dc81edffad34 | /main.py | 82bcba4043535db1cc586eba9fc546b37dfa4180 | [
"MIT"
] | permissive | https://github.com/lx10077/fedavgpy | 2993dcc035ad96923a08805f954394acdbac5ae1 | 400160899c4ca728da519d405e05e5210ba53d91 | refs/heads/master | 2022-12-11T16:02:05.961301 | 2022-12-07T01:14:28 | 2022-12-07T01:14:28 | 223,700,059 | 233 | 68 | MIT | false | 2022-12-06T13:34:14 | 2019-11-24T06:03:23 | 2022-12-01T20:52:01 | 2022-12-06T13:34:13 | 864 | 164 | 58 | 3 | Python | false | false | import numpy as np
import argparse
import importlib
import torch
import os
from src.utils.worker_utils import read_data
from config import OPTIMIZERS, DATASETS, MODEL_PARAMS, TRAINERS
def read_options():
parser = argparse.ArgumentParser()
parser.add_argument('--algo',
help='name of t... | UTF-8 | Python | false | false | 4,838 | py | 21 | main.py | 19 | 0.506408 | 0.500827 | 0 | 131 | 35.931298 | 91 |
moidshaikh/hackerranksols | 17,952,963,321,866 | 61afac15cba6461b0ffb3e2a58ad74af17b1d211 | 53a9e3b7f9e7dba6404c354d1e35496f198bb9dd | /hackerrank/designer_doormat.py | e2718bbf3c745ab8db1875af37dc4a06fb89e057 | [] | no_license | https://github.com/moidshaikh/hackerranksols | 25eafcb16721bd5ac9f9cd2d085c24ba3a1f67f5 | 0350d0968b0639bcae53d8e3f3e53d36e191d96a | refs/heads/master | 2023-01-23T22:21:48.077394 | 2023-01-16T20:49:15 | 2023-01-16T20:49:15 | 74,232,123 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # Enter your code here. Read input from STDIN. Print output to STDOUT
n,m = map(int,input().split())
# 3, 9, 15, 21, 27, 33
# 1, 3, 05, 07, 09, 11
li = list(range(1,n,2)) + [n] + list(range(n-2,-1,-2))
for i in li:
if i==n:
print("WELCOME".center(m, '-'))
else:
print((".|."*i).center(m, '-')) | UTF-8 | Python | false | false | 320 | py | 140 | designer_doormat.py | 130 | 0.525 | 0.446875 | 0 | 13 | 23.692308 | 69 |
ShenTonyM/LeetCode-Learn | 1,726,576,873,986 | e42e7ad6ddd5eb9e5c25c1a7a54a4b16a00161e4 | 85dd85a765e845f3c0ecd8d5a0b4cfe4685e44c5 | /Q617MergeTwoBinaryTrees.py | 9e4328a2d74d4b7747d892fde8e30c8ab92ef67c | [] | no_license | https://github.com/ShenTonyM/LeetCode-Learn | 674d4249369f0b534d5245bca11fa78218efe7e9 | 37ece0a8e92a41ced2b4ce0f2d8dda3826b915ae | refs/heads/master | 2020-03-31T06:58:16.474518 | 2019-07-30T05:22:23 | 2019-07-30T05:22:23 | 152,001,874 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from collections import deque
# Definition for a binary tree node.
class TreeNode(object):
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution(object):
def mergeTreesRecur(self, t1, t2, father, left_right_flag):
if t1 and t2:
t1.val ... | UTF-8 | Python | false | false | 2,714 | py | 156 | Q617MergeTwoBinaryTrees.py | 155 | 0.491157 | 0.470155 | 0 | 93 | 28.193548 | 75 |
davidandym/goodtoknow | 13,958,643,716,942 | b583761086797825d580d4ac89cf5064a3eb8d9f | ae9f03e5adff9bb1e96ff01163a57d92f8bde0f9 | /ctc/m/contiguous_seq.py | b21d17270f53d781839b4a9de2fcb77b2eed8526 | [] | no_license | https://github.com/davidandym/goodtoknow | f3d46d7f9ffd10f5bdf49364ee6d74b96dce9225 | 1dabb9f6a3a9dbdb90716c8d9b8ee40c669e6cb6 | refs/heads/master | 2017-12-22T09:43:35.387065 | 2017-12-19T01:46:46 | 2017-12-19T01:46:46 | 27,935,865 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # find contiguous seq with largest sum
def contiguous_seq(arr):
if len(arr) <= 1:
return arr[0], arr
max_sum = arr[0]
cur_sum = arr[0]
seq_beg = 0
seq_end = 0
max_seq_beg = 0
max_seq_end = 0
for i in xrange(0, len(arr)):
# special cases so we do the right thing for neg... | UTF-8 | Python | false | false | 1,158 | py | 20 | contiguous_seq.py | 18 | 0.482729 | 0.417098 | 0 | 39 | 28.717949 | 67 |
ThanksgivingChang/dangdang | 16,406,775,111,275 | daf445106009bce1d059684464ea86e2a6abaf9a | 270ddeb51d526feab3fedc2034c4e7ed8a714edd | /indent/migrations/0001_initial.py | 817cb303090f018615a0aa3877ec6316ab96c567 | [] | no_license | https://github.com/ThanksgivingChang/dangdang | aeccb3d40887cfce795aff3157aa89dce842631f | af8154a7bd4e9808f6f6b8d3c8624ef2eaad583b | refs/heads/master | 2020-04-14T11:22:43.853969 | 2019-01-02T08:04:11 | 2019-01-02T08:04:11 | 163,807,950 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # Generated by Django 2.0.2 on 2018-09-10 16:37
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('login', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Add... | UTF-8 | Python | false | false | 2,636 | py | 30 | 0001_initial.py | 20 | 0.538316 | 0.5239 | 0 | 65 | 39.553846 | 125 |
Leko25/SnapStitch | 16,192,026,732,853 | 21d41e7d52101e5a98796de4baaf52a794caa8db | 16c0fbf8bb17a0372dcb88c8c7ee5dd5f490a589 | /server.py | d1f79b1004972e7d057931d377d5e173030aa696 | [] | no_license | https://github.com/Leko25/SnapStitch | c40a83463f9828e91da977bcbc939f0168e6da25 | d19b552b190767a854c2768f3697dceb811852c2 | refs/heads/master | 2021-09-25T03:59:23.094640 | 2018-02-18T22:12:58 | 2018-02-18T22:12:58 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from flask import Flask, request, jsonify, render_template, abort, send_from_directory
from flask_cors import CORS, cross_origin
import time
import os
import random
import threading
from video_processing import main as video_processing
app = Flask(__name__)
ALLOWED_EXTENSIONS= set(["mp4"])
def allowed_file(filename)... | UTF-8 | Python | false | false | 1,882 | py | 17 | server.py | 9 | 0.703507 | 0.688629 | 0 | 64 | 28.40625 | 103 |
niksonbarth/sale | 14,259,291,426,071 | f980478e6fe6a284c38d4305d8db6ebfd13a122f | cf7300f764125f63452dee5e9aa78efcc3f58b3e | /catalog/admin.py | 830dfc0eeee8b57952f66b2f07b47faf3f5e4241 | [] | no_license | https://github.com/niksonbarth/sale | ade936c5ecaf292c85423b3abe2c626eb4a7b86b | 08feb285de44c75ac3f00c51e0f9587969fab728 | refs/heads/master | 2021-05-10T18:10:49.597640 | 2018-02-15T09:50:39 | 2018-02-15T09:50:39 | 118,531,963 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # coding=utf-8
from django.contrib import admin
from .models import Product, Category, SuperMarket, Ad
class CategoryAdmin(admin.ModelAdmin):
list_display = ['name', 'slug', 'created', 'modified']
search_fields = ['name', 'slug']
list_filter = ['created', 'modified']
class ProductAdmin(admin.ModelAdm... | UTF-8 | Python | false | false | 1,089 | py | 20 | admin.py | 14 | 0.675849 | 0.674931 | 0 | 36 | 29.25 | 77 |
shiroyagicorp/sitq | 13,245,679,182,129 | 775362506507717cdf0d8838217a5b544424ab47 | 0001b9bcd0050f70f1a9fb5edf30a5f4a7324c2f | /sitq/tests/tests_sitq.py | dd8978d3c95ad0acd1929a42e0a641f61e28c9bc | [
"MIT"
] | permissive | https://github.com/shiroyagicorp/sitq | ef11e0841c1c169217db0f005fab8afc14d0603c | b2c0b321df8450ecfce1183c0f229e87f0661679 | refs/heads/master | 2022-02-07T00:03:11.750667 | 2019-02-25T17:21:50 | 2019-02-25T17:21:50 | 171,209,711 | 12 | 0 | MIT | false | 2022-01-21T19:50:50 | 2019-02-18T03:40:03 | 2021-07-16T07:43:42 | 2022-01-21T19:50:50 | 51 | 8 | 0 | 5 | Python | false | false | import numpy as np
from sitq import Sitq
def test_sitq():
items = np.random.randn(10000, 50)
queries = np.random.randn(100, 50)
sitq = Sitq(signature_size=4).fit(items)
assert sitq.get_item_signatures(items).shape == (10000, 4)
assert sitq.get_query_signatures(queries).shape == (100, 4)
| UTF-8 | Python | false | false | 310 | py | 9 | tests_sitq.py | 6 | 0.680645 | 0.606452 | 0 | 10 | 30 | 63 |
oanc/Galaxy | 13,735,305,429,701 | 32153c59cf15d0ac84826d48bc5f382115d355b7 | 4a94c55bb070d383a9e933b65440e9c7a2277af0 | /lib/galaxy/web/__init__.py | 56a8ae9d4222cc5c88f1271e1a6597a8aa95a7fa | [
"CC-BY-3.0",
"LicenseRef-scancode-unknown-license-reference",
"CC-BY-2.5",
"AFL-2.1",
"AFL-3.0"
] | permissive | https://github.com/oanc/Galaxy | 3272ec7e447af471ef146c813650258b555e0767 | 34dda03a5bfccb8eacc21f5ec601e577c96bbf7e | refs/heads/master | 2021-01-18T21:08:05.254586 | 2016-11-13T16:41:48 | 2016-11-13T16:41:48 | 33,634,998 | 0 | 1 | null | false | 2015-06-03T16:08:27 | 2015-04-08T22:13:01 | 2015-04-13T22:24:58 | 2015-06-03T16:08:26 | 54,601 | 0 | 1 | 0 | Python | null | null | """
The Galaxy web application framework
"""
from framework import url_for
from framework.decorators import error
from framework.decorators import expose
from framework.decorators import json
from framework.decorators import json_pretty
from framework.decorators import require_login
from framework.decorators import re... | UTF-8 | Python | false | false | 1,620 | py | 28 | __init__.py | 13 | 0.768519 | 0.768519 | 0 | 37 | 42.783784 | 82 |
masyud303/histogramspecification | 8,778,913,196,333 | ffaeb97e086f18dcc6a2003767e435848a78a2d4 | f6d1c5c7bc98d6868feb92106d44c8b909d4d046 | /histogramspecification.py | 5903f0edc3829a1a75ff067ed1ed74155cb61a51 | [] | no_license | https://github.com/masyud303/histogramspecification | c33939e0cfce0429bd2a386acd8ed0fdad349e1e | 144bb0c6ca9d2cd92f0509cafcb3dd9bd16e5913 | refs/heads/master | 2022-12-06T23:51:16.173431 | 2020-08-02T07:21:08 | 2020-08-02T07:21:08 | 284,411,667 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | """
Created on Tue August 27 09:42:57 2019
@coded by: yudhiprabowo
"""
import cv2
import numpy as np
import calculation as calc
inp = "D:\\PYTHON\\input.jpg"
ref = "D:\\PYTHON\\reference.jpg"
out = "D:\\PYTHON\\output.jpg"
iarr = cv2.imread(inp)
rarr = cv2.imread(ref)
irow, icol, iband = iarr.shape
... | UTF-8 | Python | false | false | 453 | py | 2 | histogramspecification.py | 1 | 0.660044 | 0.622517 | 0 | 21 | 19.571429 | 72 |
edcross/knn | 4,844,723,111,282 | cbce247ada1c7951408c2a92b1bc312762fbe2c3 | 79902680f3466ad0ac13157f9111c5d85920eede | /find.py | d69a4976f3fc168ba6a61af0dff907d1285672ba | [] | no_license | https://github.com/edcross/knn | 21c623177d75f599c2e8ba7bb312aa9851ac8804 | f568e6b64f01bd6b64bf85bdc1ad1660f8a7f0cd | refs/heads/master | 2021-05-12T15:13:34.251999 | 2018-02-02T14:40:22 | 2018-02-02T14:40:22 | 116,978,413 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #import h5py
import numpy as np
from annoy import AnnoyIndex
import random
import csv
import os,sys
#--------------
c = [0,0,0,0,0,0,0,0,0,0]
def IndexFinding(inde):
cat=int(0)
with open('Index_Cat.csv') as csvfile:
#readCSV = csv.reader(csvfile, delimiter='\"')
readCSV = csv.reader(csvfi... | UTF-8 | Python | false | false | 3,072 | py | 10 | find.py | 10 | 0.385742 | 0.363607 | 0 | 116 | 25.439655 | 83 |
luamfmenezes/python-opencv-course | 19,112,604,486,808 | e10633ccaf3470c6b07b2c666c09c430fb0e9cdf | 460a2f0b2d11163d1dcff2e10671d45c704e65d4 | /24-WatershedSeeds.py | 7d26bbdb6198224626ea9d5e6686e709cd51af8f | [] | no_license | https://github.com/luamfmenezes/python-opencv-course | 0ee22b3bb9808c23efe998ee17c5f8642496cadb | b9aee4558f0b468c9ae47f9a9dd1e1a3e938bed4 | refs/heads/master | 2023-02-04T15:51:13.018078 | 2020-12-14T00:35:38 | 2020-12-14T00:35:38 | 318,673,852 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import numpy as np
from matplotlib import cm
import cv2
# ------------------------------------------------------- WaterShed
road = cv2.imread('assets/images/road_image.jpg')
roady_copy = np.copy(road)
road_shape = road.shape[:2]
marker_image = np.zeros(road_shape,dtype=np.int32)
segments = np.zeros(road.shape,dty... | UTF-8 | Python | false | false | 1,857 | py | 32 | 24-WatershedSeeds.py | 30 | 0.626279 | 0.6042 | 0 | 81 | 21.938272 | 75 |
spaethju/transmembrane-identifier | 3,109,556,352,450 | 12a7e884e30d129c9aca7cef492844e89cfb9dbc | c9cb6c3a08587b4d05385dc343a2c046e9fd9854 | /src/membrane_orientation/pdb_io.py | 12d54ce637db4f558a44307cf974dbd8ab8068ce | [] | no_license | https://github.com/spaethju/transmembrane-identifier | 3208479ab48a64d234d7dcb526fc5bf3d390bc5f | 3a4ab97bd6a61fc76b6684dcc5117a0476d2fdf9 | HEAD | 2018-10-06T17:35:37.691387 | 2018-06-26T08:21:51 | 2018-06-26T08:21:51 | 133,693,999 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from Bio.PDB import *
from Bio.PDB.PDBExceptions import PDBConstructionWarning
import numpy as np
import warnings
def parse_PDB(filepath):
"""
Parses a PDB file from a given filepath using PDB Parser.
Will check for Pilus & Virus proteins as well as DNA/RNA containing proteins.
If a PDB file contains... | UTF-8 | Python | false | false | 2,148 | py | 2,327 | pdb_io.py | 12 | 0.653631 | 0.646182 | 0 | 61 | 34.229508 | 102 |
Naganandhinisri/python-beginner | 9,431,748,202,400 | b054e67591020aecb4dab8fe5c3a5f6e4367a5ed | 2672ad4d130a01fe81e3291558babd8da23a997f | /hacker_rank/swapcase.py | cf79919567a6a7efa34c8bc3844e09203c35462f | [] | no_license | https://github.com/Naganandhinisri/python-beginner | 04d6a577ccb5a1d847ee302c310d866111a37b8a | 0cfa19077dfaf2f74f39c81062ee675e5659e02e | refs/heads/master | 2020-04-19T04:11:59.041153 | 2019-03-29T04:37:19 | 2019-03-29T04:37:19 | 167,956,299 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | def swap():
s = input("enter the word")
word = s.swapcase()
print(word)
while True:
swap() | UTF-8 | Python | false | false | 106 | py | 99 | swapcase.py | 99 | 0.566038 | 0.566038 | 0 | 6 | 16.833333 | 31 |
robot-lab/rcs-business-layer | 1,056,561,989,950 | 8eba4ab2004cf8d8bcfc3dffbbddc6158a86b943 | 7aedc086612772f4e514fadf7ad3c80439ea4910 | /Planner/planner.py | 431f73bc25d27387b2bdfc0e4ba7cb7aa6daba06 | [
"Apache-2.0",
"MIT"
] | permissive | https://github.com/robot-lab/rcs-business-layer | 78a37cbda0739ff44c8b85ee0e8a8fbb663972e4 | a312b92e71f17b3a02853d3fa55821887b4b24f2 | refs/heads/master | 2018-11-25T10:21:46.836491 | 2018-11-25T07:43:47 | 2018-11-25T07:43:47 | 141,130,975 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import logging
import json
import time
# ATTENTION! Before use this class configure your logging.
class Planner:
SPECIAL_SYMBOL = '$'
CONCAT_SYMBOL = '+'
SEPARATED_SYMBOL = '!'
EPS = 2000
def __init__(self, sock_rob_ad, sock_scene3d, robo_dict, buffer_size):
self.ROBO_DICT = robo_dict
... | UTF-8 | Python | false | false | 10,742 | py | 6 | planner.py | 4 | 0.53342 | 0.522342 | 0 | 278 | 37.640288 | 79 |
mountaindude/icon-font-to-png | 9,706,626,122,339 | b8d75b657a880e420e78c53e5a547a677ca34dbd | 8984f544709d74b84fa8f8826cd666ac370e26bd | /icon_font_to_png/test/test_icon_font_downloader.py | 4a71517f173c05f804e1a24a421865320626f77c | [
"MIT",
"Python-2.0"
] | permissive | https://github.com/mountaindude/icon-font-to-png | 6a39ca618ed749831a3b494995198e112ca27751 | c5546e899a034edfe5aa36de29dd8c0020350955 | refs/heads/master | 2022-07-17T21:41:58.559367 | 2020-05-20T04:44:50 | 2020-05-20T04:44:50 | 265,045,329 | 0 | 0 | MIT | true | 2020-05-18T19:47:59 | 2020-05-18T19:47:58 | 2020-05-17T02:56:02 | 2020-05-12T20:19:33 | 307 | 0 | 0 | 0 | null | false | false | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import os
import tempfile
import pytest
from flaky import flaky
from icon_font_to_png.icon_font_downloader import (
FontAwesomeDownloader, OcticonsDownloader
)
# Tests
@flaky
@pytest.mark.parametrize("downloader", [
FontAwesom... | UTF-8 | Python | false | false | 1,065 | py | 16 | test_icon_font_downloader.py | 10 | 0.71831 | 0.717371 | 0 | 45 | 22.666667 | 56 |
ANierbeck/WeConnect-python | 4,002,909,530,160 | 15f864dc9eb8656b610bf492a44b7b705b00fe9a | 93a22af9eecf565334dc4f2a4502ccb46c9e248f | /weconnect/elements/charging_station.py | 326735db775a2d69dcfee4485124e36f238dd8f6 | [
"MIT",
"Python-2.0"
] | permissive | https://github.com/ANierbeck/WeConnect-python | 00639fe4a5435b7213315e6f135734c2e8be6b6f | 993225fe261b1c03aa578ed1a5adbe37ba4737dc | refs/heads/main | 2023-07-11T14:49:02.013137 | 2021-08-11T08:34:17 | 2021-08-11T08:35:42 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import logging
from enum import Enum
from weconnect.util import toBool
from weconnect.addressable import AddressableObject, AddressableAttribute, AddressableList
LOG = logging.getLogger("weconnect")
class ChargingStation(AddressableObject): # pylint: disable=too-many-instance-attributes
def __init__(
... | UTF-8 | Python | false | false | 20,694 | py | 39 | charging_station.py | 31 | 0.564415 | 0.563835 | 0 | 423 | 47.921986 | 153 |
definename/py_samples | 7,610,682,076,504 | 939c5b471706a52992d5b722dfca635459a59419 | 1cdd197816a92587fb8ec4d0c79e6409ae49ddf4 | /11concurrency/py_gevent.py | b9ca51c88fa5fbc6c542b82c15ec730a97466a2d | [] | no_license | https://github.com/definename/py_samples | 614a31b94462828f8c85279bf1f7343c4569e9fb | 42f8af6c447acc517232c200010538ae59f8db94 | refs/heads/master | 2022-04-27T03:07:01.797979 | 2022-04-11T17:14:42 | 2022-04-11T17:14:42 | 170,145,807 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import gevent
from gevent import socket
hosts = ["www.google.com"]
jobs = [gevent.spawn(gevent.socket.gethostbyname, host) for host in hosts]
gevent.joinall(jobs, timeout=5)
for job in jobs:
print(job.value) | UTF-8 | Python | false | false | 213 | py | 181 | py_gevent.py | 177 | 0.746479 | 0.741784 | 0 | 9 | 22.777778 | 74 |
violaferrari/fruitoscopy | 10,161,892,671,078 | ccb2bf957edcf6170d99484dbb1f5699d831e72c | 6c4bd8124d149f4da5f550529d12af84e37d02c2 | /frutopy/tables/views.py | 32193519b5b45832f0137dafc4eef54fb729ba07 | [] | no_license | https://github.com/violaferrari/fruitoscopy | 2ff3b8dedaca87d59b9c95a1394cbf68276a28d0 | 0a1efe2a4343f9865b83cf64ed44c9cc892e3476 | refs/heads/master | 2021-01-16T21:59:35.735744 | 2016-07-07T13:39:36 | 2016-07-07T13:39:36 | 62,809,187 | 0 | 0 | null | true | 2016-07-07T13:32:58 | 2016-07-07T13:32:56 | 2016-07-07T13:32:57 | 2016-07-07T00:29:11 | 27,746 | 0 | 0 | 0 | JavaScript | null | null | from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.views.generic import View
from django.contrib import messages
from rest_framework import viewsets
from .tasks import process_file
from .models import ML_Model, SP_Model, Sample
from tables.choices import RIPENESS_LABELS
from .s... | UTF-8 | Python | false | false | 3,611 | py | 2 | views.py | 2 | 0.644143 | 0.644143 | 0 | 123 | 28.365854 | 89 |
bronzels/libpycommon | 15,470,472,227,915 | ab8d4ed4e5aa7f532853ab34524ab61c098b9c82 | c9c321847e52ba95ddc8258dfe03bd20afa9032f | /libpycommon/libpycommonkey/me.py | f4a548ea80364e9dde9d3cc9000947ca918e1d26 | [] | no_license | https://github.com/bronzels/libpycommon | 6f08d2c55be4d869c785f8f91e3a6031927a7eb9 | 3228829a8202b862717a4b47261fbc5c841e5385 | refs/heads/main | 2023-07-17T04:46:08.279240 | 2021-09-06T10:18:23 | 2021-09-06T10:18:23 | 403,574,967 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import key
key_path = key.__file__
package_key_abs_path = key_path[0:key_path.find('__init__.py')]
package_key_res_path = 'key'
| UTF-8 | Python | false | false | 129 | py | 37 | me.py | 33 | 0.658915 | 0.651163 | 0 | 5 | 24.8 | 63 |
jufrisk/BPGame | 4,148,938,446,109 | 7c0883cd9c98d2ec2de0aeeb4318b1a2d2d4fc94 | 6708b61fd246320c0f39e8fbac182d81a027e973 | /games_olio.py | 28cee79ea97fcdbb851df25f6ea2e3c01a07d17d | [] | no_license | https://github.com/jufrisk/BPGame | b7276810408cb222c163b06935562f60e82ed7c1 | d40b93649efc3b4e31654efce9954a8c7a69be2e | refs/heads/main | 2022-12-20T12:20:45.599146 | 2020-10-12T10:01:15 | 2020-10-12T10:01:15 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from bp_db import printplayers
from library import new_player
class playerStats(object):
def __init__(self, name):
self.name = name
self.points = 0
self.cupsfor = 0
self.cupsagainst = 0
self.cupdifference = self.cupsfor - self.cupsagainst
self.gamestotal = ... | UTF-8 | Python | false | false | 3,268 | py | 13 | games_olio.py | 9 | 0.602203 | 0.571603 | 0 | 121 | 25.008264 | 87 |
openweave/openweave-core | 8,237,747,275,441 | bc0b0a5bc17450617f33f624ac9ea73c12c5624c | edf4f46f7b473ce341ba292f84e3d1760218ebd1 | /src/test-apps/happy/test-templates/ServiceAccountManager.py | f63c46b498c6b43575a59323ffa5c00456a079c8 | [
"LicenseRef-scancode-proprietary-license",
"Apache-2.0"
] | permissive | https://github.com/openweave/openweave-core | 7e7e6f6c089e2e8015a8281f74fbdcaf4aca5d2a | e3c8ca3d416a2e1687d6f5b7cec0b7d0bf1e590e | refs/heads/master | 2022-11-01T17:21:59.964473 | 2022-08-10T16:36:19 | 2022-08-10T16:36:19 | 101,915,019 | 263 | 125 | Apache-2.0 | false | 2022-10-17T18:48:30 | 2017-08-30T18:22:10 | 2022-09-17T18:22:20 | 2022-08-10T16:36:19 | 54,162 | 222 | 111 | 78 | C++ | false | false | #!/usr/bin/env python3
# Copyright (c) 2020 Google LLC.
# Copyright (c) 2015-2017 Nest Labs, Inc.
# 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
#
#... | UTF-8 | Python | false | false | 10,263 | py | 2,082 | ServiceAccountManager.py | 1,761 | 0.61863 | 0.604209 | 0 | 273 | 36.593407 | 201 |
ClarkTheCoder/miles2km | 7,765,300,899,208 | 9d77a1e0a20e07d171f95666090abfe5c1c61ce2 | 59e8c00536168a64d017f9c7c82e516a14f5c333 | /milesToKM.py | e2bc257ea9c11877da7bd794582da797340acacf | [] | no_license | https://github.com/ClarkTheCoder/miles2km | b906b23f58c32531f03f25fd77a37bf2a8740c37 | 9a588f51b83d8f86225798617c64d0fa25661d8d | refs/heads/master | 2021-05-01T01:51:35.191216 | 2017-01-23T22:32:04 | 2017-01-23T22:32:04 | 79,855,227 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | def milesToKm(miles):
km=miles*1.60934
print(km, "km")
m=input("Please enter miles: ")
m=float(m)
milesToKm(m) | UTF-8 | Python | false | false | 113 | py | 1 | milesToKM.py | 1 | 0.690265 | 0.637168 | 0 | 7 | 15.285714 | 31 |
ScienceStacks/common_python | 2,585,570,325,525 | 4384564790abca63f25d9c13f8681a0d5642bde2 | a08bad949da6f1025157037bb395720d49da96b9 | /common_python/parallel/example_context_manager.py | 5b1d41b365ff87fcb44344fe8d27f54867c28340 | [
"MIT"
] | permissive | https://github.com/ScienceStacks/common_python | 9c078d290b2c3459f2d1b9ee5d9310afd7b845a3 | a57542245f117fe6c835cc9d7ad570b9853b7e6c | refs/heads/master | 2022-11-25T04:38:57.316907 | 2022-11-19T18:49:00 | 2022-11-19T18:49:00 | 177,683,814 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import concurrent.futures
import logging
import time
import numpy as np
class MyThreads(object):
def thread_function(self, args):
name1, name2 = args
print(name1, name2)
name = name1 + "-" + name2
logging.info("Thread %s: starting", name)
time.sleep(2)
logging.info("Thread %s: fi... | UTF-8 | Python | false | false | 691 | py | 105 | example_context_manager.py | 85 | 0.628075 | 0.616498 | 0 | 25 | 26.64 | 50 |
thinker007/freebase-utils | 14,482,629,762,734 | e8a03672a87f88b08785911b7b57679c66ea5868 | 59d8268e0db85e3de33859d84b03a75448c4fa6d | /src/nrhp-upload/id-load.py | a50049b78e20a059df3874f52a79502ac0c1858b | [] | no_license | https://github.com/thinker007/freebase-utils | c8ba92d5cb4b8eab5916902e9be1634087c85cb7 | f8fc5d0ebf77a3732bf33dd5181def5a20bfaf67 | refs/heads/master | 2021-01-02T09:15:38.118993 | 2010-09-15T19:32:18 | 2010-09-15T19:32:18 | 32,506,231 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | '''
Load missing NRIS ids into Freebase using FreeQ/Triple Loader. Input is a file of
Wikipedia ID / NRIS ref num tuples. This file is separately generated using
template/infobox data from BFG. Program creates triples to assign keys for the
reference number and add appropriate types to the existing topics.
Created... | UTF-8 | Python | false | false | 2,057 | py | 43 | id-load.py | 38 | 0.682547 | 0.645114 | 0 | 46 | 43.73913 | 161 |
Hog-Fillet/hammer | 6,158,983,113,515 | 5f81603fdc49c0c020428d1efa57252446d01ad3 | 5b5b97dcf51b8eba5682488cb1cba0a023919e68 | /python_scripts/mysql.py | d4c88005d9bdb8acddddc59bb8100f9f5d4246ae | [
"MIT"
] | permissive | https://github.com/Hog-Fillet/hammer | 4de60a0c7a77597d03492e4027b79c743d4308a7 | c42b48e764d667af4ed8b82ee094c9c03c0fb832 | refs/heads/master | 2023-05-04T14:36:24.619359 | 2021-05-29T20:36:35 | 2021-05-29T20:36:35 | 372,063,953 | 0 | 0 | MIT | true | 2021-05-29T20:36:59 | 2021-05-29T20:27:31 | 2021-05-29T20:36:37 | 2021-05-29T20:36:58 | 2,451 | 0 | 0 | 1 | Ruby | false | false | #!/usr/bin/python3
import pymysql
'''
This script selects the email address and users from users MySQL table
'''
db = pymysql.Connect("localhost", "<DB_USER>", "<DB_PASSWORD>", "<DB_NAME>" )
search = []
try:
with db.cursor() as cursor:
### Using a while loop
sql = "SELECT `users`.email, `users`.na... | UTF-8 | Python | false | false | 631 | py | 39 | mysql.py | 13 | 0.576862 | 0.575277 | 0 | 25 | 24.24 | 77 |
unbenchme/some-words-go-here | 14,972,256,042,264 | 19dce772a8b5de18b5b4e5790633848bae032f57 | 63b76daa02b495f653a9c5fb1b11f70773c5d4cc | /requests/models.py | ad03f720feaf52a37d555fa554ce75aa92e161bd | [
"MIT"
] | permissive | https://github.com/unbenchme/some-words-go-here | e71ec171a48c03c1ccb1fa2c031519a6ba9745b1 | f9fc089e9211895839319cd0136e66b5da085743 | refs/heads/master | 2020-03-30T11:29:36.717786 | 2015-04-08T13:15:13 | 2015-04-08T13:15:13 | 33,520,721 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from django.db import models
from django.conf import settings
from django.utils import timezone
from django.contrib.auth.models import User
# Create your models here.
#Category tracks broad skill-type categories (i.e. Python, Java, Tax, Excel, etc.)
class Category(models.Model):
username = models.ForeignKey(User,... | UTF-8 | Python | false | false | 2,217 | py | 13 | models.py | 11 | 0.638701 | 0.63419 | 0 | 39 | 55.846154 | 150 |
xubigshu/python_code | 188,978,592,338 | 61a1c97b21294e7c87bba455fe04ef217539812c | 9a3edffa407c63e64e12e216eed1c02f5d7c3a5a | /cookie用法/post-cookie.py | bdd150f10201e7d7ebd1067c28900da1ff9a8220 | [] | no_license | https://github.com/xubigshu/python_code | 9abbfa1a198d3c15128c0350fa66e1ba0c2a0264 | db59f631635ca32df251d7fe7d51961fa0f35d3e | refs/heads/master | 2016-09-14T15:31:11.731714 | 2016-08-08T02:18:05 | 2016-08-08T02:18:05 | 53,396,693 | 3 | 2 | null | null | null | null | null | null | null | null | null | null | null | null | null | #coding:utf-8
import urllib,urllib2,cookielib
cj = cookielib.LWPCookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
login_path = 'http://10.0.0.149:8080/login'
data = {"name":"xds","passwd":"xxxxxxxx"}
post_data = urllib.urlencode(data)
request = urllib2.Request(login_path,post_data)
html = op... | UTF-8 | Python | false | false | 388 | py | 261 | post-cookie.py | 177 | 0.739691 | 0.698454 | 0 | 14 | 26.785714 | 62 |
teja0009/Projects | 19,653,770,372,925 | 8eaef24e36e2460da11c01b075935368b5cc921c | d6b21db31c312ecb0da1b52b955eac1c93c373a9 | /Python_Projects/walmart/Script/scraper.py | e46b397df58a73ddf09aea37da01591a4917989e | [] | no_license | https://github.com/teja0009/Projects | 84b366a0d0cb17245422c6e2aad5e65a5f7403ac | 70a437a164cef33e42b65162f8b8c3cfaeda008b | refs/heads/master | 2023-03-16T10:10:10.529062 | 2020-03-08T06:22:43 | 2020-03-08T06:22:43 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException
from selenium.common.exceptions import NoSuchElementException
from b... | UTF-8 | Python | false | false | 5,675 | py | 1,401 | scraper.py | 787 | 0.52 | 0.51489 | 0 | 142 | 38.957746 | 131 |
sbook/jingo-minify | 4,501,125,774,000 | 3b2fff605598050aefe11dfd6bbae6ae3531a740 | 15c7f69c53ec8b46806e8126c4f7985a4de4751a | /jingo_minify/management/commands/compress_assets.py | a5afc0890dcb5ad4b22ba856df44bb6f0530c200 | [
"BSD-3-Clause"
] | permissive | https://github.com/sbook/jingo-minify | c5d5c2c6d51ef0f64a2041145d9085dc0e249b40 | 923ae25f5739d1cb8d2d13f635e51377040cab20 | refs/heads/master | 2017-04-28T21:10:26.412003 | 2011-04-14T10:06:51 | 2011-04-14T10:06:51 | 1,510,646 | 1 | 2 | null | null | null | null | null | null | null | null | null | null | null | null | null | import os
import hashlib
import yaml
import re
import shutil
from subprocess import call, PIPE
from django.conf import settings
from django.core.management.base import BaseCommand
path = lambda *a: os.path.join(settings.MEDIA_ROOT, *a)
CSS_ASSET_PATTERN = re.compile('(?P<url>url(\([\'"]?(?P<filename>[^)]+\.[a-z]{... | UTF-8 | Python | false | false | 5,349 | py | 7 | compress_assets.py | 4 | 0.472238 | 0.469994 | 0 | 141 | 36.943262 | 114 |
zaferyumruk/zyrad_asl | 14,920,716,432,356 | 52db127c9d2496f00fe76c964ab3c07f93a1ab17 | d498df6a90efff21faa96a606c63e6bb6e888118 | /zyradlib/utilities.py | 3c7537f9d65d4999b00e2d2229e6c83ae2182d86 | [] | no_license | https://github.com/zaferyumruk/zyrad_asl | 3172043bcb42972eba42f542c270eb4b0a237a93 | 06f49d82f256c9676184958553751bc91ed0fe5a | refs/heads/master | 2017-10-07T17:21:27.865976 | 2017-03-15T23:12:01 | 2017-03-15T23:12:01 | 81,299,879 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from matplotlib import pyplot as plt
from collections import Iterable as It
def pickfromrange(range, Data):
outData = []
if len(Data[0]) > 1:
for data in Data:
outData.append(data[range])
else:
outData.append(Data[range])
return outData
def peekData(x, y, ylegend=[''], ti... | UTF-8 | Python | false | false | 1,425 | py | 20 | utilities.py | 20 | 0.550175 | 0.541053 | 0 | 50 | 27.5 | 95 |
mateusrodc/bowling_kata | 6,837,587,975,477 | e0f497746e82f27e925173051ac19ef5af274536 | 4ea29df175697b87378738e367cd43bd0d96c3fc | /teste.py | 25f124c4798370dd37ea52ccb2cc7537d9083eb4 | [] | no_license | https://github.com/mateusrodc/bowling_kata | c6261cab1c70eee6143deea423618a857457a25a | 4e449083aab606fe7618d0d1e6f7f0c2e770d830 | refs/heads/master | 2021-02-10T02:48:24.053322 | 2020-03-02T14:34:04 | 2020-03-02T14:34:04 | 244,346,249 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import bowling_kata
nome=input("Digite o nome do jogador:")
while nome != 'sair':
jogador1 = bowling_kata.CalculadoraPontuacaoBoliche(nome)
jogador1.jogar(0)
nome=input("Digite o nome do jogador ou sair para finalizar:")
| UTF-8 | Python | false | false | 233 | py | 2 | teste.py | 2 | 0.733906 | 0.72103 | 0 | 6 | 37.833333 | 66 |
ZoraOswald/scRNAseq | 13,589,276,556,342 | ea57578cc31459de431c9a9896ce12db2a391606 | 8f7f212f4cb80616e34f084591ebb37f012919d6 | /src/network/network_dim_reduction.py | baf29e8b3d8a9023a5fd2d93f62a533fcca32c20 | [] | no_license | https://github.com/ZoraOswald/scRNAseq | d3843a63f6589df81a1686b1fbc1a3dd926034b7 | 03e52ed70334bb80945b63b9b57d47d9700ffe45 | refs/heads/master | 2020-04-11T08:02:20.876077 | 2018-12-13T11:31:57 | 2018-12-13T11:31:57 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun Dec 9 00:44:52 2018
@author: silus
"""
import numpy as np
import networkx as nx
import pandas as pd
import pygsp as pg
from helpers.gsp_helpers import graph_sampling, graph_filtering
from helpers.data_import import train_data_in_network
from scipy import sparse... | UTF-8 | Python | false | false | 1,438 | py | 14 | network_dim_reduction.py | 8 | 0.732267 | 0.718359 | 0 | 40 | 33.8 | 82 |
ThierryCols/hug-demo | 197,568,542,678 | f226ee9ad7f77322b597bd34c24c24e402c4b7b3 | 6f8c7a02175a832fc72ff28e6b71d0f5c7be0e34 | /tests.py | a6ae16a782e62b024303043bfa05c4d8fcd0264e | [] | no_license | https://github.com/ThierryCols/hug-demo | 8f7b241b3beeca8c1cf60559e0335f2e41ae099c | 4ea8df72253cde70982b9659e3eddfea391db1e6 | refs/heads/master | 2020-09-17T18:45:13.519490 | 2016-09-16T06:40:44 | 2017-04-01T14:19:42 | 67,332,970 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from demo_data import *
from main import *
def test_compute_scores():
expected_result = {1: 6, 2: 0, 3: 1}
assert compute_scores() == expected_result
def test_fetch_next_games():
assert len(fetch_next_games()) == 2
def test_add_prono():
assert len(pronos) == 5
add_prono({'id': 6, 'gameId': 3, ... | UTF-8 | Python | false | false | 597 | py | 4 | tests.py | 3 | 0.589615 | 0.547739 | 0 | 24 | 23.875 | 63 |
a1573595/Neural_Emotion_Intensity_Prediction | 5,248,450,080,532 | a9d97c953503d76fe9e67015fd652faaf02be524 | ab851af2448be6e1307ba5944ab6136b35954c6d | /intermediate_files/deepmoji/encode_texts.py | c446b8a06c4375cb7eb6db5a614845b062b584b3 | [] | no_license | https://github.com/a1573595/Neural_Emotion_Intensity_Prediction | 351589d51015a9fe548c6c94ac7640e40adb3dc4 | 28425e9e87c6b7eabef6609df0627f4b131e715d | refs/heads/master | 2020-07-14T04:09:54.013899 | 2019-08-29T20:11:50 | 2019-08-29T20:11:50 | 205,234,703 | 0 | 0 | null | true | 2019-08-29T19:18:35 | 2019-08-29T19:18:34 | 2019-08-14T01:37:26 | 2018-10-12T17:22:29 | 70 | 0 | 0 | 0 | null | false | false | # -*- coding: utf-8 -*-
""" Use DeepMoji to encode texts into emotional feature vectors.
"""
from __future__ import print_function, division
import example_helper
import json
import csv
import numpy as np
from deepmoji.sentence_tokenizer import SentenceTokenizer
from deepmoji.model_def import deepmoji_feature_encoding... | UTF-8 | Python | false | false | 1,310 | py | 36 | encode_texts.py | 5 | 0.755725 | 0.745802 | 0 | 42 | 30.190476 | 147 |
tomarint/procon | 17,093,969,855,547 | 0ede3eaa3329d430e6f7aaf1bd0e8c5029793b6a | 184ea0db92d3b2516be6a8df76db38a68d32b62d | /codeforces/cr555_3/c.py | d525c06417d1760fa6fed997a2c8ea9879828773 | [] | no_license | https://github.com/tomarint/procon | bc8b005bae24a122c82045f5c66071753e6b1af9 | c99bffd83d13278fa563489591a361ee74679f27 | refs/heads/master | 2020-04-20T16:53:53.542580 | 2020-04-19T04:15:55 | 2020-04-19T04:15:55 | 168,972,492 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import sys
import collections
def solve():
N = int(sys.stdin.readline().rstrip())
A = list(map(int,sys.stdin.readline().rstrip().split()))
q = collections.deque(A)
ans = []
old = 0
for i in range(N-1):
l = q.popleft()
r = q.pop()
if l < r:
if old < l:
... | UTF-8 | Python | false | false | 978 | py | 729 | c.py | 567 | 0.365031 | 0.362986 | 0 | 43 | 21.744186 | 60 |
chrisstianandres/almacen_yamaha | 8,400,956,070,152 | f173882d47b64e33fead1ec671e56d2947d65e97 | bb3ae8193289e98e01bea265646f7c77f20558af | /app/views.py | c636e63d7c2c1bf577e9d5dfaf93d731562ada3e | [] | no_license | https://github.com/chrisstianandres/almacen_yamaha | 4edbbc827bba7143f466d11c066e522cb8357b25 | 711096cd958e92cb6ec9423730a92120ac614337 | refs/heads/master | 2023-05-13T14:15:30.184461 | 2021-06-07T15:02:46 | 2021-06-07T15:02:46 | 370,217,067 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import json
from django.contrib.auth import authenticate, login
from django.http import HttpResponse
from django.shortcuts import render
# Create your views here.
from django.views.decorators.csrf import csrf_exempt
from app.producto.models import producto
from sistema_yamaha.settings import MEDIA_URL
def menu(req... | UTF-8 | Python | false | false | 1,227 | py | 142 | views.py | 114 | 0.660147 | 0.658517 | 0 | 39 | 30.461538 | 90 |
GregoryElliott/TGMA_NLP_Project | 12,970,801,263,071 | fc05caa53d75d0343684f8a9333473abc47eaad8 | 010bf55a456e8efb1fa01a5a8ecc9935586172b2 | /test_nom.py | df1f014f830108fd70eff4dc0d2d3d6675328f6d | [] | no_license | https://github.com/GregoryElliott/TGMA_NLP_Project | 4b8007b28ccdb78e5ec794683b3d904a1d6c8ce6 | 15bc517287f7d822b815c84528f7fe67aaa4dfb1 | refs/heads/master | 2021-01-10T17:41:33.627749 | 2016-02-22T22:58:53 | 2016-02-22T22:58:53 | 51,664,371 | 0 | 1 | null | false | 2016-02-22T22:58:54 | 2016-02-13T20:28:42 | 2016-02-13T20:29:40 | 2016-02-22T22:58:53 | 12,435 | 0 | 0 | 2 | Python | null | null | import gg_api
import json
with open('gg2013answers.json') as f:
j = json.load(f)
mine = gg_api.get_nominees(2013)
for award in mine:
if j['award_data'][award]['nominees'] != mine[award]:
print 'award: ' + award
print 'correct: ' + str(j['award_data'][award]['nominees'])
print 'mine: ' + str(mine[award])
| UTF-8 | Python | false | false | 316 | py | 12 | test_nom.py | 7 | 0.648734 | 0.623418 | 0 | 13 | 23.307692 | 61 |
amoux/david | 8,675,833,949,386 | d38a017589f11a094a85b2ac9b2d4e681b9f5001 | 7a3ef0e0643cbf23defd3d48b8496037b0373500 | /david/text/_proto_tokenizers.py | 47a50f21d15abf3698936e4b79403bd89f735e49 | [] | no_license | https://github.com/amoux/david | d1ef452ebdc31d99555cab15cbbb472c35612a94 | 825f30806696e5c77f669ec936fda0e8db7829f3 | refs/heads/master | 2023-08-03T22:42:51.332841 | 2021-10-06T18:57:37 | 2021-10-06T18:57:37 | 199,486,952 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | """
david.text._proto_tokenizers.
----------------------------
This module is a temporary hidden module to all the tokenizers
until all are optimized properly (And simplified!). In the meantime
the true tokenizers module will hold working Tokenizers. One by one.
"""
from __future__ import print_function, unicode_liter... | UTF-8 | Python | false | false | 12,674 | py | 73 | _proto_tokenizers.py | 53 | 0.577488 | 0.568799 | 0 | 343 | 35.909621 | 85 |
dhvalden/phd | 18,305,150,622,166 | 52b3ba434107633336a63e609f072b343bc92d50 | e9a73efe52ac851867f886f8a32f201a1e6fe3b5 | /2_data_preparation/4_filterbylang.py | 6d0bc882be72178e65b371fcbdfacccfe4bcf9f9 | [] | no_license | https://github.com/dhvalden/phd | b4104ca9d4e41eb0e252b73a4defd16ab6400f46 | dd9b32e6773aa422d17c50b6b38ea40c4d4fe8f6 | refs/heads/master | 2021-11-27T07:26:47.275561 | 2021-11-23T03:32:46 | 2021-11-23T03:32:46 | 252,271,068 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #!/usr/bin/env python3
import os
import sys
import argparse
import ujson
"""
This script receives json files seprated by social movement and outputs
json files with records on only the selected language.
"""
def validate_file(file_name):
"""
validate file name and path.
"""
MSG_INVALID_PATH = "Error... | UTF-8 | Python | false | false | 1,644 | py | 48 | 4_filterbylang.py | 37 | 0.591241 | 0.5882 | 0 | 69 | 22.826087 | 79 |
aayushmdr/financetracker | 6,640,019,452,106 | 51d21dfc7c6dde731e2f04158cf8e24d93d352ff | fbf677633c87280645ddb3f3c32e64bf4b01ca13 | /expense/views.py | 972a4b71d69b4074bf65c98d10dddb87522af69f | [] | no_license | https://github.com/aayushmdr/financetracker | f1a1b8ff8c020eab4287756f65bd88e180aa0292 | 85768885f7f619e7b7f30fed8293d94f624bb3e8 | refs/heads/master | 2023-04-11T05:00:08.390560 | 2021-04-23T10:59:19 | 2021-04-23T10:59:19 | 347,015,780 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from django.shortcuts import render, redirect
from .models import *
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from .forms import *
from .filters import *
def login_success(request):
samt = StartAmt.objects.filter(user=request.user)
if not samt:
r... | UTF-8 | Python | false | false | 6,922 | py | 15 | views.py | 7 | 0.612973 | 0.607917 | 0 | 260 | 25.626923 | 95 |
grantgasser/Task1b | 6,631,429,551,815 | 3a0be5876acabb9d94912c7173585fb6aa5c85f6 | 990fe671b2d83f5ee784b7f47484ca09974a1a8b | /task_1b_anna.py | ae5016db6bf1be58a597f2daefd7dd6a9cabbced | [] | no_license | https://github.com/grantgasser/Task1b | 1ffed9ba15e26e906ccbd592c8ea9645be1e786d | c498eeffb0f1eaa8e7f2007059a8fa99db77abd5 | refs/heads/master | 2021-09-10T12:44:28.427234 | 2018-03-26T13:40:17 | 2018-03-26T13:40:17 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import pandas as pd
import numpy as np
from sklearn.model_selection import KFold
from sklearn.linear_model import Ridge
from sklearn.metrics import mean_squared_error
from sklearn import linear_model
trainfilename = '/Users/Anna/polybox/IntroductionML/Tasks/01/task1b_ow9d8s/train.csv'
trainfile = pd.read_csv(trainfil... | UTF-8 | Python | false | false | 1,672 | py | 5 | task_1b_anna.py | 2 | 0.712919 | 0.670455 | 0 | 58 | 27.827586 | 85 |
torebre/bpl_python | 9,921,374,481,462 | c79022144cc95d0a6a2f3a1bc4188730d475ca58 | 7dec3fbe0e31e977a1a0dd7cdc80f01871e82dbe | /bpl/PS.py | 049f577ea6ed65cd400927eb0e02f2b069edcb5b | [] | no_license | https://github.com/torebre/bpl_python | 106872180ff4eed745d51cf91c60ceeb49360c6c | 9be76d0844feab7f518bbdfc81a9b35e3d02360f | refs/heads/master | 2020-03-07T00:59:24.864518 | 2018-04-05T20:09:59 | 2018-04-05T20:09:59 | 127,171,326 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null |
# function PM = defaultps
class PS:
# Library to use
libname = 'library'
# Model parameters
K = 5 # number of particles to use in search algorithm image model parameters
ink_ncon = 2 # number of convolutions
imsize = (105, 105) # image size
ink_pp = 2 # amount of ink per point
ink_max... | UTF-8 | Python | false | false | 1,811 | py | 31 | PS.py | 31 | 0.681944 | 0.651022 | 0 | 46 | 38.369565 | 122 |
firewut/data-transform-pipelines-api | 5,325,759,495,397 | a003f2715c0c7cc4a0597fc3f717fce88af1c360 | c1868c08b8a5e5754cf2ac35da2edf8a0b188459 | /src/projects/workers/random_image.py | 21c0c090b2d6057d908dd8eabc81f470f912003c | [
"MIT"
] | permissive | https://github.com/firewut/data-transform-pipelines-api | 336163cf86423be6b2ebaec73fccd2fb5294ef33 | 8c46bf72759478a1bdac3323c88ae7e9e1e7714b | refs/heads/master | 2022-02-05T10:20:19.697745 | 2022-01-26T19:02:11 | 2022-01-26T19:02:11 | 154,260,980 | 2 | 0 | MIT | false | 2018-11-27T20:35:22 | 2018-10-23T04:14:46 | 2018-11-27T12:10:16 | 2018-11-27T20:35:22 | 816 | 0 | 0 | 0 | Python | false | null | from PIL import Image
import numpy
from projects.workers.base import Worker
class RandomImage(Worker):
id = "random_image"
name = "random_image"
image = "https://upload.wikimedia.org/wikipedia/commons/e/e1/Ideal_chain_random_walk.png"
description = "Make a random Image"
ui_schema = {
... | UTF-8 | Python | false | false | 1,692 | py | 90 | random_image.py | 79 | 0.43026 | 0.421986 | 0 | 58 | 27.172414 | 93 |
mono-g/mayaTool | 10,230,612,145,711 | 79b7aacbd85109bc7c5a937378b970017feb4558 | d8133d7629d94c9d7f0837ec4ca4374024f570bb | /cleanup_preference/cleanup_preference.py | 1d408c5a5b33f6129dc13e4e9693e3902fa6fc2d | [] | no_license | https://github.com/mono-g/mayaTool | 1f3827b9f002e3c27a4c44629b3f805da4f4f159 | 5a73907480a5a630accd0878a03a796ca51d9f2c | refs/heads/master | 2021-04-09T10:45:17.758521 | 2019-12-13T11:07:43 | 2019-12-13T11:07:43 | 125,455,826 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
##########################################################
#
# @brief clean up preference
# @file cleanup_preference.py
# @author Satoshi Gonokami
#
# Copyright(C) 2018 Satoshi Gonokami.
#
# [log]\n
# 2018/03/22 作成\n
#
##############################################... | UTF-8 | Python | false | false | 6,046 | py | 9 | cleanup_preference.py | 6 | 0.507239 | 0.503535 | 0 | 192 | 29.9375 | 90 |
FYP-2018/Text-Processing | 15,607,911,197,356 | 920fcc22ecd02d0fee1621a5c640fcae660c5e5e | fc2c91e0fa20894323600787116e99a82c2df79d | /Corpus.py | ec8610543cf2940f2f2e068bc8633f02f9dbc2b3 | [] | no_license | https://github.com/FYP-2018/Text-Processing | 90fcb76589c325bc7db3fb63d712b0eea573837b | 1818475bd2d168a4368e2d8964b9bedeaab32eb4 | refs/heads/master | 2020-04-09T12:34:31.251533 | 2018-12-05T04:10:24 | 2018-12-05T04:10:24 | 160,355,844 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import thulac
from PreprocessUtils import readFile
class Corpus():
def __init__(self):
pass
def _load_thulac(self, user_dict=None):
print("initializing thulac...")
if user_dict == None:
self.thu = thulac.thulac(seg_only=True)
else:
self.thu = t... | UTF-8 | Python | false | false | 3,432 | py | 18 | Corpus.py | 6 | 0.508741 | 0.504371 | 0 | 85 | 39.376471 | 98 |
AkhilReddykasu/Functions | 11,166,914,992,843 | 264eb65ab2d0199b58db3489d3cf29f2854a7a4b | 0d1059d3195868be6feb0397d931fd5126f1bb65 | /10_Sum of all num in list.py | 18a85274094bd9754e347ded068a1197eea0272d | [] | no_license | https://github.com/AkhilReddykasu/Functions | 62b4b6fa9b62f172c1fdfd206a7365d7b8ad94cb | c1af8db1350152168b1a5ac61c990ed589a9e129 | refs/heads/master | 2022-11-20T15:43:18.769387 | 2020-07-17T15:51:01 | 2020-07-17T15:51:01 | 280,464,611 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | """Sum of all numbers in list"""
li = []
n = int(input("Enter the length of list:"))
for i in range(0, n):
ele = int(input('Enter the value:'))
li.append(ele)
print("Elements in the list:", li)
def add_list(l):
sum1 = 0
for j in l:
sum1 += j
return sum1
print("Sum of e... | UTF-8 | Python | false | false | 354 | py | 19 | 10_Sum of all num in list.py | 19 | 0.550847 | 0.536723 | 0 | 18 | 17.666667 | 47 |
Jelly815/housepage | 15,298,673,556,542 | aaca946f8e19de37d2a2004e450bb37676a5b0a8 | db3f9c53cc9e7005ce3a243f606d0723583532a9 | /python/function.py | f9909281542c83e4a85b6b6da161c8d7e465148a | [] | no_license | https://github.com/Jelly815/housepage | efbd79749017e4217a6bc94b2429a419b384cc8d | 0eca073fd4333fd53ad0868cb3751a612250fcaa | refs/heads/master | 2023-03-31T19:20:15.363506 | 2023-03-22T08:39:55 | 2023-03-22T08:39:55 | 154,009,771 | 0 | 0 | null | false | 2023-03-22T08:39:57 | 2018-10-21T13:12:13 | 2019-03-28T03:03:46 | 2023-03-22T08:39:55 | 5,004 | 0 | 0 | 0 | PHP | false | false | # -*- coding: utf-8 -*-
"""
Created on Sun Jan 13 00:58:08 2019
@author: Jelly
"""
from db_connect import DB_CONN
import setting
import math
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import datetime
from collections import defaultdict
class FUNC_CLASS(DB_CONN):
def __init__(self,use... | UTF-8 | Python | false | false | 42,837 | py | 60 | function.py | 39 | 0.430543 | 0.415221 | 0 | 1,032 | 39.09593 | 186 |
robintema/django-otp | 18,141,941,861,855 | b8a33c258ba23b7e9e27207f0b065558f1a9e4b9 | c9a43f2949def22860d95af52f8f49f780dee2c1 | /django_otp/plugins/otp_email/models.py | 6de901da120734dc39d64595b1f925621864d60c | [
"BSD-2-Clause"
] | permissive | https://github.com/robintema/django-otp | 111bcfb6401740b516a7045e4e614aebb0e33355 | 9928bc353c8a49787df2d5b7ee751afb9ac2ed6f | refs/heads/master | 2021-01-10T04:23:56.981408 | 2015-11-24T13:29:52 | 2015-11-24T13:29:52 | 46,793,279 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from binascii import unhexlify
from six import PY2
from django.core.mail import send_mail
from django.db import models
from django.template.loader import render_to_string
from django_otp.models import Device
from django_otp.oath import totp
from django_otp.util import hex_validator, random_hex
from .conf import sett... | UTF-8 | Python | false | false | 1,886 | py | 3 | models.py | 3 | 0.607635 | 0.600212 | 0 | 69 | 26.333333 | 89 |
Rizo-R/Risk | 19,301,583,061,867 | 6ad5168f4a91ccccfc2b8c7d2c50dbf3284e9839 | 54aaaa788d8c4ecb801a10fe7ba680212f7d815d | /player.py | d50375cd98027acf2103b494ef5a02e2b36d5c10 | [] | no_license | https://github.com/Rizo-R/Risk | bc18e11ac10d69b37c6b8d58d63bd0189053eaf3 | 568d9a93da3444afdfa979af2dfd06e9a8b184fa | refs/heads/master | 2023-04-05T08:07:08.753440 | 2021-04-08T16:34:03 | 2021-04-08T16:34:03 | 290,829,609 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | # from continent import *
from itertools import combinations
from color import Color
from card import Card, add_card, find_card, remove_card, total_wildcards
from troop import Troop
class Player():
def __init__(self, color, troops, cards=[]):
''' [color] is a Color object. [troops] is int. [cards] is a l... | UTF-8 | Python | false | false | 10,072 | py | 12 | player.py | 11 | 0.565131 | 0.553912 | 0 | 295 | 33.142373 | 112 |
Mohnish226/Computer-vision-learn | 3,049,426,811,537 | 63ab9387a4ccf06b4b92f5ab1aea56f1832457de | 0a082eb6f8350e77a99ebf87cde107edaa0e916e | /Mini Project/Photo restoration/Photo_restoration.py | 56a9692ef3a16387593d605f7e61ba1670796c62 | [] | no_license | https://github.com/Mohnish226/Computer-vision-learn | 7eb752a7cf98d093fdabf95fcfdd4502f0f70eb8 | 876a64b3ff001d2e881e11ae290266bb70fe9629 | refs/heads/master | 2021-01-20T06:11:46.735739 | 2017-07-01T18:50:31 | 2017-07-01T18:50:31 | 89,849,285 | 3 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Sat Jul 1 23:50:23 2017
@author: Mohnish_Devadiga
"""
import cv2
import numpy as np
# Load our damaged photo
image = cv2.imread('images/abraham.jpg')
cv2.imshow('Original Damaged Photo', image)
cv2.waitKey(0)
# Load the photo where we've marked the dam... | UTF-8 | Python | false | false | 1,078 | py | 37 | Photo_restoration.py | 36 | 0.730056 | 0.680891 | 0 | 41 | 25.292683 | 73 |
TOTOSOLEIL3/Minigames | 2,843,268,394,207 | 3c6ddfc614917ddfdd22d4feaa5a4e3939d0354d | 66929f9aed2bc9a9c7bca5879bcaa3073defc02d | /trouve le nombre.py | 055aa20980b18a914b674563816aab4039a69ec6 | [
"MIT"
] | permissive | https://github.com/TOTOSOLEIL3/Minigames | 2dc3e81a1634ed7094b0d516f68619a2e94116b5 | 45d067069afb0664c36cb2264ba3baffe590914d | refs/heads/main | 2023-07-04T16:24:19.417042 | 2021-08-12T15:11:51 | 2021-08-12T15:11:51 | 395,358,986 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import random, os, sys
from pyfade import Colors, Fade
from os import name
from pycenter import center
def clear():
if name == 'nt':
os.system('cls')
else:
os.system('clear')
def acueille_mode():
clear()
def main():
maxn = 100
n = random.randint(1, maxn)
Jeux... | UTF-8 | Python | false | false | 2,795 | py | 3 | trouve le nombre.py | 1 | 0.262073 | 0.25936 | 0 | 56 | 30.946429 | 110 |
MaiYunfei2000/trail-py-practice | 9,320,079,064,792 | 66f5f09717488ab4bf2a1d520b7d58fe4048e2a1 | f97c5a565f43a77a2c24fdf47a5cb7ec976f1c9e | /dlfr/ex060103.py | cc97b5fa2f398f62d9c9ecb318a7bbb3ec9bc411 | [] | no_license | https://github.com/MaiYunfei2000/trail-py-practice | 0dd6feb12c7b83c0569690d0818b195d4f0a603d | 56cb96b4633a7e355ea88292efc6488212ffa11a | refs/heads/master | 2020-04-22T04:15:20.133349 | 2020-04-12T07:43:14 | 2020-04-12T07:43:14 | 170,116,938 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | ##### 6.1 处理文本数据
#### 6.1.3 整合在一起:从原始文本到词嵌入
### 1. 下载IMDB数据的原始文本
### 6-8 处理IMDB原始数据的标签
import os
imdb_dir = 'aclImdb'
# [os.path --- 常用路径操作 — Python 3.8.2rc1 文档](https://docs.python.org/zh-cn/3/library/os.path.html?highlight=os%20path%20join#os.path.join)
# 然而到底是什么意思……?
train_dir = os.path.join(imdb_dir, 'train')
... | UTF-8 | Python | false | false | 1,443 | py | 135 | ex060103.py | 122 | 0.62033 | 0.596872 | 0 | 43 | 25.790698 | 137 |
rihardsbelinskis/d4_pr3fl0p_b0t_v2 | 12,893,491,864,361 | c5856ffe28cc07ffc4336d993f76a57513622d46 | 2dd087ef1a9cfacba47f6e427080656e6c31f310 | /v01/detectcards.py | 4089918e8a8fa09ca2ecd37301a88133a98345ea | [] | no_license | https://github.com/rihardsbelinskis/d4_pr3fl0p_b0t_v2 | 520445a765921cd53a219d22fd11446d818f07ff | 8c3579f666513beb82bbf29fcb53cc249a87de8c | refs/heads/master | 2022-04-16T22:27:52.174440 | 2020-04-18T12:02:28 | 2020-04-18T12:02:28 | 254,669,890 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import pyautogui
import time
#s=pyautogui.screenshot()
#a = s.getpixel((640, 350, 0)) #atrod konkreta piksela rgb datus
#s.save(r'screen.png')
# atrod visas vietas, kur uz ekrana atrodas bilde nba.png un uzraksta
# koordinates katrai bildei
#i = 0
#for pos in pyautogui.locateAllOnScreen('BOT1table.png'):
# i= i... | UTF-8 | Python | false | false | 3,230 | py | 17 | detectcards.py | 15 | 0.558824 | 0.471827 | 0 | 138 | 22.398551 | 81 |
tfang2/PythonEssentialTraining | 8,306,466,757,261 | f4225e7388ee29a3431a4aaf3f908268e38a7967 | 47cf62a20110780bafbaec86feabb765fc27a6fc | /Section 12/object_data.py | ae67902a51c5cc90a0152cf4301f0d7e6f981b0d | [] | no_license | https://github.com/tfang2/PythonEssentialTraining | 006973cb29290292ff20788ce991450d29484487 | ac1367cc037fb6a4f1fb40e3c15e697b76b5b0d5 | refs/heads/master | 2020-12-26T15:41:24.878834 | 2016-03-02T12:08:57 | 2016-03-02T12:08:57 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # classes.py by Bill Weinman [http://bw.org/]
# This is an exercise file from Python 3 Essential Training on lynda.com
# Copyright 2010 The BearHeart Group, LLC
class Duck:
def __init__(self, **kwargs):
print("The constructor has been called")
# assume the color assignment is being made via
... | UTF-8 | Python | false | false | 1,508 | py | 24 | object_data.py | 23 | 0.626658 | 0.622679 | 0 | 51 | 28.588235 | 72 |
gautamvij/Video-Summarization-using-ConvNet | 6,940,667,155,442 | 362950ed5aca7bbd8a13049f8fdeb661b737e4b0 | 7e821af9fee56ab51cfc4c4013198e0db5c9b121 | /code_top_layer/combine.py | 811ebf25cc2b016c583c87ba4ed824a6b914f32e | [] | no_license | https://github.com/gautamvij/Video-Summarization-using-ConvNet | b4bf3324c8092d7782cd54d33f6b9a8f9006ad98 | 5015cb6f4c51f9456d0ea515fee181d3aadbacdc | refs/heads/master | 2021-01-10T11:12:42.106588 | 2016-03-29T18:37:05 | 2016-03-29T18:37:05 | 48,489,634 | 0 | 2 | null | null | null | null | null | null | null | null | null | null | null | null | null | import theano.tensor as T
import numpy as np
from theano.tensor.signal import downsample
from collections import Counter
from copy import deepcopy
import cv2,sys
import cPickle
import random
import theano
" attention function receives list of 10 level segmentations , upsampled features from convnet, labels "
def atten... | UTF-8 | Python | false | false | 4,264 | py | 11 | combine.py | 10 | 0.57575 | 0.55652 | 0 | 130 | 31.761538 | 151 |
simon-Hero/flask_dz | 5,007,931,886,196 | 335fdb7d7fa2888c70340c10bcee04d792e17878 | cb27d3517627f13e995d8dd38c030793c08c0dc2 | /dz/v_1_0/index.py | 7b421f348b98a9394f4cfdac13bf6574dc587615 | [] | no_license | https://github.com/simon-Hero/flask_dz | 5df623de654bb07a42c85038a2796d128184a043 | f99ec51d790721679d75f25cf33554668be42e3c | refs/heads/master | 2020-12-05T19:29:40.088824 | 2020-02-27T02:55:24 | 2020-02-27T02:55:24 | 232,224,456 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from . import api
from flask import current_app, jsonify, session, request
from dz.utils.response_code import RET
from dz.models import Area, Order, House
from dz import redis_store
from config import settings
import json
from datetime import datetime
@api.route("/areas")
def get_area_info():
"""获取城区信息"""
# 查... | UTF-8 | Python | false | false | 6,878 | py | 28 | index.py | 25 | 0.60861 | 0.605263 | 0 | 211 | 30.14218 | 125 |
nbompetsis/AgentNMap | 17,884,243,851,333 | 5ff80e5c10b138ae9652fc6977829ed8c843d24b | 9e2fd5f8250d5499e452ea141a5cac078594d150 | /agent/agent.py | 34b371f282c17504f2cbe4bccc089745503dd567 | [] | no_license | https://github.com/nbompetsis/AgentNMap | 0c971aa904db810a29a7d180d80774c5d1c0d9ad | 6d0265b1557b7e7f2cd4b7a6a041a046a5e5f46f | refs/heads/master | 2021-01-10T07:02:15.489949 | 2015-10-27T20:04:40 | 2015-10-27T20:04:40 | 44,936,127 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from structures.NMapJobsStructure import NMapJobsStructure
class AgentNMap:
""" This is the AgentNmap class. The agent manipulates the nmap call """
name = ''
jobs = []
def __init__(self, name ):
self.name = name
def setJobs(self, jobs):
for job in jobs:
... | UTF-8 | Python | false | false | 544 | py | 6 | agent.py | 4 | 0.496324 | 0.496324 | 0 | 21 | 22.238095 | 76 |
betty29/code-1 | 8,555,574,900,682 | a713617e1ea39610d1cd2eef2cc1cce5fc7eb446 | 50008b3b7fb7e14f793e92f5b27bf302112a3cb4 | /recipes/Python/577414_8_queens_/recipe-577414.py | 484be149e406d1ff873010dcb40243943d2125d0 | [
"MIT"
] | permissive | https://github.com/betty29/code-1 | db56807e19ac9cfe711b41d475a322c168cfdca6 | d097ca0ad6a6aee2180d32dce6a3322621f655fd | refs/heads/master | 2023-03-14T08:15:47.492844 | 2021-02-24T15:39:59 | 2021-02-24T15:39:59 | 341,878,663 | 0 | 0 | MIT | false | 2021-02-24T15:40:00 | 2021-02-24T11:31:15 | 2021-02-24T12:00:22 | 2021-02-24T15:39:59 | 8,183 | 0 | 0 | 0 | Python | false | false | #!/usr/bin/env python
def back(path):
if reject(path): return None
if issolution(path):
print path
for brother in makebrothers(path):
if len(path)<8:
newpath = back(brother)
if newpath: return newpath
return None
def issolution(path):
return len(path)>7
... | UTF-8 | Python | false | false | 724 | py | 8,810 | recipe-577414.py | 3,493 | 0.527624 | 0.51105 | 0 | 30 | 23.133333 | 72 |
Fabio4651/TFC | 17,617,955,860,919 | d26148f94edefbcda96a5e38b221b1fcfed1d4c9 | e0be03b1dc323eb9ff4406b457c0f1f394844ad7 | /app.py | d6fbf0c8ab8a1cd22e664bf7bf019ccab3ab6884 | [] | no_license | https://github.com/Fabio4651/TFC | 834dac0a681e69b00295877340d2129435968478 | 993666972ba383f9ca462799632b178047a6d4fb | refs/heads/main | 2023-07-07T01:50:52.368684 | 2021-08-07T15:54:08 | 2021-08-07T15:54:08 | 393,724,467 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from flask import Flask, render_template, request, session, make_response, redirect, url_for, jsonify
from flask_qrcode import QRcode
from werkzeug.utils import secure_filename
from flask_sqlalchemy import SQLAlchemy
from flask_modals import Modal, render_template_modal
from flask_session import Session
from os.path ... | UTF-8 | Python | false | false | 24,718 | py | 16 | app.py | 2 | 0.611498 | 0.606683 | 0 | 687 | 34.957787 | 417 |
vigonotion/zha-device-handlers | 13,030,930,792,736 | f0bfef81f2d08cefec8c2464714c0b67d48a43b6 | aeaf548fba8ee9f88cd9254f2bc4ac0a3bbfb207 | /zhaquirks/samjin/button.py | a0f21836af935082e302ca0864a4e30dbf00bbe9 | [
"Apache-2.0"
] | permissive | https://github.com/vigonotion/zha-device-handlers | 6001aa812380a0540d76f68778ebade93f93928d | 6d0560655428e1f04626a7722febf492c4174e8b | refs/heads/dev | 2020-12-26T12:07:27.192810 | 2020-01-31T17:57:29 | 2020-01-31T17:57:29 | 237,504,327 | 1 | 0 | Apache-2.0 | true | 2020-01-31T22:49:11 | 2020-01-31T19:47:15 | 2020-01-31T19:47:17 | 2020-01-31T22:49:10 | 391 | 0 | 0 | 0 | null | false | false | """Samjin button device."""
import logging
from zigpy.profiles import zha
from zigpy.quirks import CustomCluster, CustomDevice
from zigpy.zcl.clusters.general import (
Basic,
Identify,
Ota,
PollControl,
PowerConfiguration,
)
from zigpy.zcl.clusters.measurement import TemperatureMeasurement
from zig... | UTF-8 | Python | false | false | 3,211 | py | 23 | button.py | 17 | 0.54687 | 0.53379 | 0 | 109 | 28.458716 | 77 |
fangpsh/cdn_support | 11,965,778,919,784 | b435f771391c36c513ef488d301b700170754c13 | d04d37a04ddb7e9680840d17519e4344a284a638 | /cdn.py | 3296c6be51d85d47bc424b4c888bab7d823a2868 | [] | no_license | https://github.com/fangpsh/cdn_support | 7f19919406347455b33a55da0c9df5cf0c4ba082 | 765f9be6075e652fee0fba9a12620dc6b0cb2751 | refs/heads/master | 2021-06-18T21:42:25.241131 | 2017-07-10T11:56:35 | 2017-07-10T11:56:35 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # -*- coding: utf-8 -*-
import sys
from pelican import signals
import os
import re
reload(sys)
sys.setdefaultencoding('utf8')
def replace_link(pelican):
cdn_type = pelican.settings['CDN_TYPE'] or [".css", ".js", ".jpeg", ".png", ".gif", ".jpg"]
cdn_domain = pelican.settings['CDN_DOMAIN']
for root, dir... | UTF-8 | Python | false | false | 1,144 | py | 3 | cdn.py | 2 | 0.473776 | 0.469406 | 0 | 37 | 29.918919 | 106 |
uvamiao/MyLeetcode | 8,581,344,675,107 | fc9d1c90120d4d913e07852cc5414901f35ce77f | 50441d932e8c7ad22cf43d4aa83237d55f10d759 | /528 Random Pick with Weight.py | d1f19b65195a8db9c9f52b7b8f9c6d739eac8b74 | [] | no_license | https://github.com/uvamiao/MyLeetcode | 845839649170094f9e10a0840bbbf04acd13af76 | 431aa7a2503a1205f9f8241e5de3ba4aeda9f44e | refs/heads/master | 2020-03-25T01:33:33.162780 | 2019-06-10T07:49:25 | 2019-06-10T07:49:25 | 143,243,341 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | """
528. Random Pick with Weight
Given an array w of positive integers, where w[i] describes the weight of index i, write a function pickIndex which randomly picks an index in proportion to its weight.
Note:
1 <= w.length <= 10000
1 <= w[i] <= 10^5
pickIndex will be called at most 10000 times.
Input:
["Solution","pic... | UTF-8 | Python | false | false | 2,187 | py | 18 | 528 Random Pick with Weight.py | 17 | 0.527206 | 0.497485 | 0 | 88 | 23.784091 | 168 |
andreynovikov/utilery | 11,957,188,986,638 | 6f1a9b59ecfcc6323f7eefda9cfce397406d0ff1 | cb333bc4f2f7a55653ff347d715576f6eba1dca1 | /utilery/core.py | f650f3ad02f6e1c17f680398f3bb310ce3a40904 | [] | no_license | https://github.com/andreynovikov/utilery | 43e7c6fff152ad7eff19276e9e904077f736a8d7 | ff9bdcd5a57660e4a1c864b8637b73f205f9a237 | refs/heads/master | 2017-10-07T14:19:53.382027 | 2017-02-16T11:00:50 | 2017-02-16T11:00:50 | 81,192,435 | 0 | 0 | null | true | 2017-02-07T09:48:33 | 2017-02-07T09:48:33 | 2016-10-27T15:04:50 | 2016-08-27T17:12:46 | 48 | 0 | 0 | 0 | null | null | null | import atexit
import logging
import time
import psycopg2
import psycopg2.extras
import yaml
from pathlib import Path
from . import config
from .plugins import Plugins
from .models import Recipe
logger = logging.getLogger(__name__)
if config.DEBUG:
logger.setLevel(logging.DEBUG)
logger.addHandler(logging.St... | UTF-8 | Python | false | false | 1,866 | py | 24 | core.py | 12 | 0.631297 | 0.625402 | 0 | 79 | 22.620253 | 78 |
morani80/collect_med_inst_cd_py | 10,093,173,162,978 | 0c0e103ca9bf17302bee14ba0a627d5be5919875 | b509ccd9c72b90bd7fd453d503c3b5a8c8c575e6 | /collect_med_inst_cd/inst_cd_crawler.py | c7e9155699650784ad49978bd9070ce87ddd2b27 | [] | no_license | https://github.com/morani80/collect_med_inst_cd_py | aae2f7e582a7e915bb1443bfad64fb688e7ef902 | 93434d55457ddba0898c0f48a8e5a6f51719a45c | refs/heads/master | 2022-12-18T12:26:47.947466 | 2022-09-03T11:44:47 | 2022-09-03T11:44:47 | 282,172,065 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import logging
import os
import re
import shutil
import zipfile
from typing import Callable
from urllib.parse import urljoin
import requests
from .consts import BRANCH_ALL, BRANCH_KYUSYU, BRANCH_LIST
from .excel_parser import ExcelParser
from .output_csv_handler import OutputCsvHandler
from .prefecture_finder import ... | UTF-8 | Python | false | false | 7,258 | py | 13 | inst_cd_crawler.py | 11 | 0.549802 | 0.545699 | 0 | 179 | 38.486034 | 153 |
jiajie999/space-personal | 14,199,161,910,455 | 6d5a76786a3ea6a9a10c8f4916446f7c6e0d5908 | d43ac30ac612557cbbdcd8384cf8eca043e1bbfd | /dofunctions.py | ad578336a8b37462400e8d5d5b725443fd3cd0d1 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | https://github.com/jiajie999/space-personal | fc19a5e8e564d78093fbe5e119266b13473b2851 | 81b2d7ec7a4d720402bfd37f5668e78d00fb1418 | refs/heads/master | 2021-01-18T08:02:04.120075 | 2015-02-13T06:57:24 | 2015-02-13T06:57:24 | 30,744,087 | 0 | 0 | null | true | 2015-02-13T06:45:00 | 2015-02-13T06:44:59 | 2015-02-13T04:43:24 | 2015-02-13T04:43:24 | 2,112 | 0 | 0 | 0 | null | null | null | import digitalocean
import data
from log import *
def get_token():
config = data.get_config()
return config['do_api_key']
def get_manager():
token = get_token()
try:
manager = digitalocean.Manager(token=token)
except Exception as e:
message = "Failed to get manager, DO API respond... | UTF-8 | Python | false | false | 7,764 | py | 10 | dofunctions.py | 7 | 0.569294 | 0.563756 | 0 | 227 | 33.202643 | 189 |
tonytanCoder/py-account-service | 2,310,692,420,693 | 1fe50b0e73524f13d69a0b598d01b09048df4f70 | 1a1f0cafd9c10fa95fe05aebaf82e60b6dcd9076 | /com/tan/account/sqlalchemydemo/userqry.py | 4b34ce82871d9d18a5b0b09789c50958d2f4802e | [] | no_license | https://github.com/tonytanCoder/py-account-service | c1f7da4a862eb1c21ab78cbfdea6857a6b4159f5 | 7be81552a2774a624687774904bf137570f60ece | refs/heads/master | 2020-09-14T10:08:31.958101 | 2019-11-21T06:02:38 | 2019-11-21T06:02:38 | 223,099,653 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # 导入:
from userservice import User
from userservice import DBSession
class UserQryService():
def qryAllUser(self):
# 创建Session:
session = DBSession()
# 创建Query查询,filter是where条件,最后调用one()返回唯一行,如果调用all()则返回所有行:
# user = session.query(User).filter(User.id == '5').one()
... | UTF-8 | Python | false | false | 633 | py | 5 | userqry.py | 4 | 0.578269 | 0.576427 | 0 | 19 | 27.263158 | 67 |
brechmos-stsci/crds | 5,111,011,121,639 | 5e84e243de00facdcf8ea37a73e02103b9433262 | 1b3a063dc1c619eb06eed51a4c00afc06df6adb9 | /crds/tests/__init__.py | 22e775fd41e82646b71a44576b56a8bf62ab943c | [
"BSD-2-Clause"
] | permissive | https://github.com/brechmos-stsci/crds | 7ca51852856a654647f646eb38b28b3d83d778ce | ffe7ee827c566b9e85de25863d31712e801f999a | refs/heads/master | 2021-01-16T13:41:17.441224 | 2016-06-21T16:47:41 | 2016-06-21T16:47:41 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from __future__ import division # confidence high
from __future__ import print_function
from __future__ import absolute_import
from .test_config import *
| UTF-8 | Python | false | false | 156 | py | 23 | __init__.py | 8 | 0.75 | 0.75 | 0 | 5 | 30 | 49 |
davidmunoz4185/dand_project4 | 8,366,596,305,371 | 919a1eb3923859e0377a61b0a5cc49ba3693cd98 | f62b3c80feab32848a71d823dd9a66002d992fd2 | /audit.py | 769cffb43bc42a404c2ab4c215b24529d416b723 | [] | no_license | https://github.com/davidmunoz4185/dand_project4 | beb006ea502f8b0aca741b89c159254dc704a577 | 3756e65b5369d779382d192a76fb457c7c912a8a | refs/heads/master | 2021-08-22T21:10:56.280071 | 2017-12-01T09:18:05 | 2017-12-01T09:18:05 | 112,719,516 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
tipo_via_set = [
'Avenida',
'Calle',
'Camino',
'Paseo',
'Plaza',
'Carrera',
'Ronda',
'Carretera',
'Pasaje'
]
POSTCODE_PATTERN = re.compile(r'^(E)?(28[0-9]{3})')
def split_by_char(string_in, char_in... | UTF-8 | Python | false | false | 1,071 | py | 8 | audit.py | 2 | 0.567694 | 0.550887 | 0 | 46 | 21.282609 | 71 |
ssh0/growing-string | 15,247,133,931,476 | 136c60fa61131bd58652fc11540c7d54da39f803 | 702574ec18a35258ce1a028c8ecf3dd91197b514 | /triangular_lattice/eden/eden_sticky.py | 26f2c52cf86e39fdd1f80a8efa08073dd54acefd | [
"MIT"
] | permissive | https://github.com/ssh0/growing-string | 4d5096225e4478913c654646d664f59d4bf0e88b | 2e43916e91157dfb4253775149b35ec9d81ef14d | refs/heads/master | 2020-04-12T03:10:44.130839 | 2017-03-24T07:51:44 | 2017-03-24T07:51:44 | 56,047,471 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# written by Shotaro Fujimoto
# 2016-09-23
"""Eden model on triangular lattice"""
from eden import Eden
import numpy as np
def print_debug(arg):
"""Print argument if needed.
You can use this function in any parts and its behavior is toggled here.
"""
# ... | UTF-8 | Python | false | false | 858 | py | 127 | eden_sticky.py | 84 | 0.628205 | 0.60373 | 0 | 35 | 23.485714 | 85 |
arunrock98/Amazon---Product-Analysis | 6,786,048,370,949 | 804a32f656886d29343cb8c9bfbd1903b38b34b7 | 6e774191a7778d684629db257ed10b42e391d236 | /create_search_urls.py | f9f21b1f07d243f4c0d13215441577c0fd9922e5 | [] | no_license | https://github.com/arunrock98/Amazon---Product-Analysis | aed90218bf52678a3763b4f4dc39e1b999001537 | f5c661a4e866f0056568ccc48f3ae78403af5c9f | refs/heads/main | 2023-05-14T00:42:42.442371 | 2021-06-03T14:27:22 | 2021-06-03T14:27:22 | 354,801,103 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | f = open('search_urls.txt', 'w+')
url = 'https://www.amazon.com/s?k=processor&i=computers&ref=nb_sb_noss_1'
f.write(url)
f.write('\n')
for i in range(2,401):
url = 'https://www.amazon.com/s?k=processor&i=computers&page=2' + str(i) + '&qid=1617019761&ref=sr_pg_' + str(i)
f.write(url)
f.write('\n')
f.close... | UTF-8 | Python | false | false | 322 | py | 10 | create_search_urls.py | 1 | 0.618012 | 0.568323 | 0 | 12 | 25.916667 | 116 |
harshays/solutions | 3,642,132,310,000 | 65de62a79a0a3f49ccd2a1d31a9955e1259e972a | 2cd6098bf2181b789ca0877ce5909bbca8d38d95 | /euler/py/036.py | 7e2169d48358459721e0c5a36c98a8da3dce9340 | [] | no_license | https://github.com/harshays/solutions | e48be3d20c1a0651a8a5d23684889261d3526071 | cb5fafb617a652d8f18f04b250851a917c92ca35 | refs/heads/master | 2021-01-21T14:09:22.623741 | 2016-05-09T18:23:17 | 2016-05-09T18:23:17 | 29,054,743 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # total of all palindromes in base 10 and 2
def tobinary(n): return str(bin(n))[2:]
def palindrome(n): return str(n) == str(n)[::-1]
total = 0
for n in range(1,1000000):
if palindrome(n) and palindrome(tobinary(n)): total += n
print (total) | UTF-8 | Python | false | false | 245 | py | 136 | 036.py | 131 | 0.669388 | 0.612245 | 0 | 8 | 29.75 | 60 |
alsomeb/Bankomat | 18,098,992,221,466 | b635ccb2ddb9764017615bee820d195b698cdb9e | 28770b64ded422d17fd7c0fe812d4f1c8b45415a | /bankomat.py | 465a9a93449d82651e5d2a26944914de51c930b3 | [] | no_license | https://github.com/alsomeb/Bankomat | 88ba531cbff9095bb02f247e9d89df189e50ea7d | 30c04a86ae1db7ed8d7a386e3ec70e3c359ad40b | refs/heads/main | 2023-08-16T20:50:35.468839 | 2021-10-03T19:09:17 | 2021-10-03T19:09:17 | 406,722,881 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import json
import datetime
import time
from functions import MainMenu
from functions import AccountMenu
from termcolor import colored,cprint #färger används för snygg "GUI"
accounts = {} #konton
log_list = {} #loggar transaktioner i trans.json
with open("log.json") as json_file: #öppnar fil för kontonr och tillhörand... | UTF-8 | Python | false | false | 6,103 | py | 2 | bankomat.py | 2 | 0.555335 | 0.550199 | 0 | 106 | 55.933962 | 171 |
kevinlondon/leetcode | 13,460,427,523,070 | b93404637f0df2fa515acedca525594eba5ea7d0 | 22717a981aded63f0f107d8fd4e25e58ee1db842 | /0000-0999/021_merge_sorted_lists.py | 84b4013ff39bff4f3b49af21d03927a331ddc31d | [] | no_license | https://github.com/kevinlondon/leetcode | f788daca8fa82f6eed1f58685cb232a3e804de0f | 47a24ab1fbc09cbcb8eaf2882db179b186a708dc | refs/heads/master | 2023-06-23T04:41:24.238953 | 2023-06-21T03:29:46 | 2023-06-21T03:29:46 | 124,432,928 | 3 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def mergeTwoLists(self, list1: Optional[ListNode], list2: Optional[ListNode]) -> Optional[ListNode]:
merged_head, node = None, None
... | UTF-8 | Python | false | false | 804 | py | 151 | 021_merge_sorted_lists.py | 150 | 0.477612 | 0.471393 | 0 | 29 | 26.724138 | 104 |
gauravkhandelwal140/Inventory-management-system-django | 11,768,210,411,891 | 5da3728d7c1fe3ca06834550d482b422803b3d52 | 6fb4116858b4906fb519ccaec3b3b4dcbe15b815 | /product/views.py | b47ad13a15e0076b88c0234e13513012af18cf54 | [] | no_license | https://github.com/gauravkhandelwal140/Inventory-management-system-django | cecb3b1c094bf75f24adcec0eccf5e23b300eb75 | a4c4f16c5d9af86fb1c766022663a2620e64753e | refs/heads/master | 2023-07-09T09:02:12.328422 | 2021-08-10T21:06:28 | 2021-08-10T21:06:28 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from django.shortcuts import redirect, HttpResponseRedirect, reverse
from django.contrib import messages
from django.db import transaction
from product.models import Product, StockIn, StockOut
from django.views.generic import ListView, DetailView, FormView, TemplateView
from django.core.cache import cache
from django.v... | UTF-8 | Python | false | false | 8,543 | py | 103 | views.py | 60 | 0.620859 | 0.619103 | 0 | 235 | 35.353191 | 91 |
skeptycal/pants | 403,726,932,577 | 12612ef3a6c7cc1e556c31561856f9b6acb946cc | 05ce8d3828ecdc3e4b92fd4533489e8e8ff2bf12 | /contrib/node/src/python/pants/contrib/node/tasks/node_resolve.py | 24a43879627a875c55b9015f58d599b41f58b00d | [
"Apache-2.0"
] | permissive | https://github.com/skeptycal/pants | 3c40c6f7e7ac7102c116aed6f2df06b4eab7e5e4 | 3bb513ce74aefe63fb683bd9b01cc514b7068961 | refs/heads/master | 2022-01-19T14:29:52.806823 | 2020-10-21T19:05:32 | 2020-10-21T19:05:32 | 212,719,141 | 1 | 0 | Apache-2.0 | true | 2022-03-27T05:18:01 | 2019-10-04T02:08:43 | 2020-10-21T19:05:36 | 2022-03-27T05:18:01 | 97,362 | 1 | 0 | 11 | Python | false | false | # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
from hashlib import sha1
from pants.base.build_environment import get_buildroot
from pants.base.fingerprint_strategy import DefaultFingerprintHashingMixin, FingerprintStrategy
f... | UTF-8 | Python | false | false | 7,026 | py | 654 | node_resolve.py | 419 | 0.700114 | 0.698975 | 0 | 163 | 42.104294 | 99 |
jmquintana79/utilsDS | 5,884,105,204,750 | 9b0ca16efbf248ed04c21eae5cd9f9f98cf067f4 | 0d9f12b352e8975dc9a5e937a3e005f27d034db3 | /scripts/analysis/ADA/tools.py | a301f53a855b40c1f0eafc001e45013b558c7c87 | [
"MIT"
] | permissive | https://github.com/jmquintana79/utilsDS | 4228c8af65d29ea2920b49632b456defccff6239 | aeef8e8d6f94cf9573164b5dcaa930004ed07ae7 | refs/heads/master | 2023-07-22T03:01:30.958181 | 2023-07-12T16:46:15 | 2023-07-12T16:46:15 | 143,678,150 | 0 | 1 | MIT | false | 2023-07-06T23:03:58 | 2018-08-06T04:54:09 | 2022-01-07T16:16:24 | 2023-07-06T23:03:57 | 36,869 | 0 | 1 | 7 | Jupyter Notebook | false | false | import numpy as np
import pandas as pd
from classes import Columns
## thresholds for metrics according level of exigence
def thresholds_according_level_exigence(level:str = 'normal')->dict:
"""
Thresholds for metrics according level of exigence.
Parameters
----------
level : str, optional
... | UTF-8 | Python | false | false | 2,443 | py | 201 | tools.py | 54 | 0.564061 | 0.557511 | 0 | 100 | 22.89 | 118 |
Akshay-s-raut/Python | 15,985,868,319,367 | 2c6ad1bfe30cb279a12f9fb175e521151afb6d74 | 1c8abb9e956ba76d3b7c8b0fa4968ec6161e40fd | /Maths tools/get_partitions.py | 142c27b7a317162938e1d5a46ece0261d4c24fd9 | [] | no_license | https://github.com/Akshay-s-raut/Python | 509d97e717720c9c49458d66412ead875eec82ce | b7ee9eb7342b956d1a2640f0c14c4b7bb2a41c1d | refs/heads/master | 2021-08-28T07:21:37.532063 | 2021-07-31T16:23:06 | 2021-07-31T16:23:06 | 218,053,941 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | print("Ferrers Diagram for all Partitions of N")
part=list()
partsi=list()
#try to memoize the recurrence for efficiency
def getPartitions(n,max):
sum = 0
if n==0:
partj=partsi.copy()
part.append(partj)
del partsi[-1]
return 1
elif n<0:
del partsi[:]
return 0
... | UTF-8 | Python | false | false | 923 | py | 78 | get_partitions.py | 74 | 0.512459 | 0.501625 | 0 | 43 | 20.465116 | 48 |
betoma/advent-2020-python | 3,925,600,109,523 | 8cbcbe7812237df46918fa38cfc51f10d1d6e837 | 10fe2707f9d266976be299db621b4ea5a5cbeedc | /11/advent-11.py | 40a381a3e1d78420da0210181733d3b82e76d0e6 | [] | no_license | https://github.com/betoma/advent-2020-python | 6db2c6f20ba63fcb4b6caafc5987a43cd185285e | 0e8b8a3287aed6f73aa583ac6e30138da24b8363 | refs/heads/master | 2023-08-15T15:29:29.170091 | 2021-10-14T12:10:12 | 2021-10-14T12:10:12 | 417,116,073 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from __future__ import annotations
import itertools
class Place:
def __init__(self, row: int, column: int):
self.location = (row, column)
def __repr__(self):
return self.symbol
def __str__(self):
return f"Seat({self.symbol}: {self.location})"
def __eq__(self, other):
... | UTF-8 | Python | false | false | 5,033 | py | 23 | advent-11.py | 23 | 0.505265 | 0.499305 | 0 | 176 | 27.596591 | 86 |
yekang-wu/omega-miya | 10,496,900,115,237 | ee66e9e0ab77ef04e5ab89b3e4ac3b7da43855ab | 691c70d88aa242ef97c2b5587de210e94854148a | /omega_miya/utils/bilibili_utils/data_classes.py | fb5fd76d0074c147c7567b6ff49fbfaf13190fd9 | [
"Python-2.0",
"MIT"
] | permissive | https://github.com/yekang-wu/omega-miya | bf632e28c788f06c74b61056142de23da9201282 | 53a6683fccb0618e306abe9e103cec78445f3796 | refs/heads/master | 2023-08-27T13:54:56.756272 | 2021-10-07T11:31:23 | 2021-10-07T11:31:23 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from dataclasses import dataclass
from typing import Optional, Dict, List
from omega_miya.database import Result
class BiliInfo(object):
@dataclass
class UserInfo:
user_id: int
name: str
sex: str
face: str
sign: str
level: int
@property
def uid(... | UTF-8 | Python | false | false | 2,375 | py | 152 | data_classes.py | 149 | 0.572211 | 0.572211 | 0 | 99 | 22.989899 | 106 |
aleph-im/py-libp2p | 17,325,898,072,187 | 1237b458645261f7d7ae6976b1d6075051a91965 | 09cc5321dc37b6ffefeac6c3e41d942264caaf25 | /libp2p/network/connection/raw_connection.py | 08d2205528124dbd980090e4b2eb0abef64e36ae | [
"Apache-2.0",
"MIT"
] | permissive | https://github.com/aleph-im/py-libp2p | 460af6347ce8f293f8a2eff8c0c4dcd8e51c6f0d | 3dfb5c49abf37fd95db12ae5766757332be70d08 | refs/heads/master | 2021-07-04T14:08:53.562330 | 2020-10-27T10:23:18 | 2020-10-27T10:23:18 | 212,055,838 | 0 | 2 | NOASSERTION | true | 2020-12-14T10:10:39 | 2019-10-01T09:16:19 | 2020-10-27T10:23:22 | 2020-12-14T10:08:35 | 1,673 | 0 | 0 | 1 | Python | false | false | import asyncio
from .exceptions import RawConnError
from .raw_connection_interface import IRawConnection
class RawConnection(IRawConnection):
reader: asyncio.StreamReader
writer: asyncio.StreamWriter
is_initiator: bool
_drain_lock: asyncio.Lock
def __init__(
self,
reader: asynci... | UTF-8 | Python | false | false | 1,780 | py | 55 | raw_connection.py | 52 | 0.629775 | 0.606742 | 0 | 55 | 31.363636 | 149 |
acoderly/mishell | 7,490,422,970,566 | c79b5aaaf211ed596bb331767406083f7fa05906 | c1ae685bbdad867cf42ac4b947f7b8bd8ecf08e8 | /src/mishell/shell_family/alpha.py | 0548dbdc5f67f25134d7eda2ae0fdd27e6d88b35 | [
"MIT"
] | permissive | https://github.com/acoderly/mishell | 85b523f90d3be00a6d30b9493dc52be62cf2d5fc | 035fc618cb1abfaeb9f0d519b6ff78c48494ff62 | refs/heads/main | 2023-04-22T05:31:40.470785 | 2021-04-29T03:11:36 | 2021-04-29T03:11:36 | 360,453,911 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import inspect
import mishell
import pkgutil
from os.path import isabs
class Alpha:
def __init__(self):
pass
def __init_subclass__(cls, **kwargs):
name = getattr(cls, "NAME", cls.__name__.lower())
file_and_name = inspect.getfile(cls) + "::" + name
ShellFamily.loaded_family[fi... | UTF-8 | Python | false | false | 1,952 | py | 15 | alpha.py | 11 | 0.61168 | 0.610656 | 0 | 74 | 25.378378 | 75 |
mcvayokay/symmv | 17,686,675,325,347 | 5adb085be0d2c3807274755a762e0ca63cbc65fb | e1eb5ebfc117f3f6532d88a378439101b9f337d2 | /symmv/logging.py | eeed0137b5728de4a09ab00452bb2bd3d7e2d848 | [] | no_license | https://github.com/mcvayokay/symmv | 6a7684ab799edbb8eb988df23b877d43c2586d39 | cad3f6ff15726deb9efd87eb748f0116cd4e957f | refs/heads/master | 2021-08-16T15:39:04.366333 | 2017-11-20T03:40:13 | 2017-11-20T03:40:13 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import logging
import logging.config
def configure_logging(level, filename):
logging.config.dictConfig(
{
'version' : 1,
'handlers' : {
'console' : {
'class' : 'logging.StreamHandler',
'formatter' : 'default',
... | UTF-8 | Python | false | false | 1,177 | py | 18 | logging.py | 18 | 0.383178 | 0.37808 | 0 | 40 | 28.4 | 74 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.