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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
nikaven/drake | 17,712,445,144,014 | 6ed6df63a6dfcb060da4c77640f42819e89bc176 | e6793e7eb54d2105c373a8af7ebc653b7ad94575 | /tools/workspace/drake_visualizer/repository.bzl | e43653f11b269aa4c1ef9e6a887078c04514266f | [
"BSD-3-Clause"
] | permissive | https://github.com/nikaven/drake | 5c59e88f79b530ddf62496452959abeaf8fff1e3 | 34bab4ecaa34ac09ade6dcb11cf7bc0d13c5bd4e | refs/heads/master | 2020-03-31T01:37:25.441270 | 2018-10-05T19:42:22 | 2018-10-05T19:42:22 | 151,788,663 | 7 | 0 | null | true | 2018-10-05T23:37:07 | 2018-10-05T23:37:07 | 2018-10-05T23:30:44 | 2018-10-05T23:27:34 | 338,938 | 0 | 0 | 0 | null | false | null | # -*- mode: python -*-
# vi: set ft=python :
"""
Downloads and unpacks a precompiled version of drake-visualizer (a subset of
Director, https://git.io/vNKjq) and makes it available to be used as a
dependency of shell scripts.
Archive naming convention:
dv-<version>-g<commit>-python-<python version>-qt-<qt version... | UTF-8 | Python | false | false | 4,525 | bzl | 279 | repository.bzl | 262 | 0.631602 | 0.575691 | 0 | 147 | 29.782313 | 103 |
keshav-c17/python | 755,914,284,463 | ea636cdefecef6b50ec8ba3ba777ac196f2f1784 | 130ac79a00e2ae323452a3229f1bd6961d6cf1c3 | /Hacker-rank/17_set_add().py | c7c1a33c1af3aec3fa805e36da65d21e048f9195 | [] | no_license | https://github.com/keshav-c17/python | 7c4bd1e11b359e131cc9ce2bed91e058b0a3ba54 | 067d4355912a27e512118aed6715113557c8b7e6 | refs/heads/master | 2023-05-01T15:15:41.605578 | 2021-05-27T00:16:11 | 2021-05-27T00:16:11 | 322,216,929 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | n = int(input("Enter no. of countries: "))
list_of_countries = set()
for i in range(n):
list_of_countries.add(str(input("Enter names of the countries: ")))
print(len(list_of_countries))
| UTF-8 | Python | false | false | 191 | py | 52 | 17_set_add().py | 52 | 0.680628 | 0.680628 | 0 | 5 | 37 | 71 |
42Paris/remote-challenges | 12,463,995,113,879 | d8d99efea4576155ac18120260c0174ad8c692a6 | cec0e621218352b3685358c697ecbe9c725e6131 | /chall02/hben-yah.py | f3ece231332d21de9edc99e8be282dce4cd57881 | [] | no_license | https://github.com/42Paris/remote-challenges | ecf76c101f5f070455e2f54128faebef18a9b000 | f9270e7981178243fccebeee2574e3dde91891fd | refs/heads/master | 2021-05-21T19:36:36.177086 | 2020-06-12T12:22:35 | 2020-06-12T12:22:35 | 252,772,141 | 74 | 209 | null | false | 2020-06-12T12:22:37 | 2020-04-03T15:33:34 | 2020-06-05T12:58:47 | 2020-06-12T12:22:36 | 1,920 | 63 | 133 | 1 | C | false | false | #!/usr/bin/python3
import sys
import re
morseDic = {
'a':'.-',
'b':'-...',
'c':'-.-.',
'd':'-..',
'e':'.',
'f':'..-.',
'g':'--.',
'h':'....',
'i':'..',
'j':'.---',
'k':'-.-',
'l':'.-..',
'm':'--',
'n':'-.',
'o':'---',
'p':'.--.',
'q':'--.-',
'r':'.-.',
's':'...',
't':'-',
'u':'..-',
'v':'...-',
'w':'.--',
'x':'-..-',... | UTF-8 | Python | false | false | 764 | py | 713 | hben-yah.py | 55 | 0.413613 | 0.40445 | 0 | 55 | 12.909091 | 59 |
stellakaniaru/hacker-rank | 9,577,777,085,166 | cc57b81aeff66ac4f143219c31cbca3298507570 | c2843304f68aaa18f6a3d55221061fb19422b3a6 | /anagram.py | 6a0a0053be79509679ff2ac7f16108842e7166b3 | [] | no_license | https://github.com/stellakaniaru/hacker-rank | 974ced2514d1ae3ed5afb027b392e2545614e648 | 8dd886c00e4c2522a728b3456d64c8d4712ca2c0 | refs/heads/master | 2021-06-06T21:52:54.630431 | 2018-11-15T07:10:21 | 2018-11-15T07:10:21 | 59,646,209 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | '''Given a a string which is a concatation of two substrings,
determine if the two are anagrams of each other'''
def anagram(word):
'''Should find out if a given word is an anagram or not'''
#check if the word can be divided into equal substrings
#return -1 if the word cant be divided into two equal strings
if le... | UTF-8 | Python | false | false | 791 | py | 15 | anagram.py | 14 | 0.677623 | 0.666245 | 0 | 29 | 26.310345 | 88 |
BlueMoon3000/newsapp | 11,630,771,466,199 | e2b568a56b7e8a4714e624ef59b4fc2dcb7288a5 | c42bf7ba6dc853ae6a4802a48cfaccdb8419ea8b | /core/migrations/0001_initial.py | db7c7052d61da06c122dc533c0f9dd495b65b20a | [] | no_license | https://github.com/BlueMoon3000/newsapp | 6c2b41f4ef9ac85128a3edf680842c04604496dd | 767f2265cff5896b364a9afd6945181602351f46 | refs/heads/master | 2021-01-15T11:49:20.804564 | 2015-12-20T01:34:30 | 2015-12-20T01:34:30 | 15,790,768 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'AppUser'
db.create_table(u'core_appuser', (
(... | UTF-8 | Python | false | false | 7,467 | py | 8 | 0001_initial.py | 5 | 0.582697 | 0.573323 | 0 | 121 | 60.719008 | 118 |
evaseemefly/gsconfig | 4,269,197,513,147 | 482a819837f765d2997d3f0ba74e7a677340fe5f | 64bf1b41a05673b3fe64f9a62619975d88bb5410 | /src/geoserver/customer_base.py | bbb84292a56f7c67daa4bbf9d646e571cbed2ecd | [
"MIT"
] | permissive | https://github.com/evaseemefly/gsconfig | ef1992dafe13268182acbf9a8b33d0e86b8702b6 | a10900bd256018edf00cd1b508a0d1eb6c3ecba6 | refs/heads/master | 2021-02-11T18:47:06.512853 | 2020-03-31T09:36:09 | 2020-03-31T09:36:20 | 244,520,389 | 4 | 1 | MIT | true | 2020-03-29T13:48:46 | 2020-03-03T02:12:25 | 2020-03-29T13:35:40 | 2020-03-29T13:48:45 | 1,877 | 1 | 1 | 0 | Python | false | false | from catalog import Catalog
# TODO:[-] 20-03-31 注意此处存在一个问题,由于修改了 gsconfig的源码,所以此处引用时是引用的系统环境中的 gsconfig(geoserver)
from geoserver.workspace import Workspace
# from workspace import Workspace
class BaseCatalog:
'''
所有 cusotmer 子类需要继承的父类
'''
def __init__(self, cat: Catalog, work_space: str):
... | UTF-8 | Python | false | false | 585 | py | 18 | customer_base.py | 12 | 0.637895 | 0.625263 | 0 | 17 | 26.823529 | 86 |
xuelei-code/test | 10,264,971,874,950 | 13cb93898351bd4b6c92ce89b852ee7b19809f79 | a4ff9458cbf1b69c2cc85e522c2f23fea34252f9 | /dataless.py | 3ab406de3b2e0764058ede8e23b70dc91c4ae703 | [] | no_license | https://github.com/xuelei-code/test | 06ace35f19375e728aeba857c5767019e80e78f4 | 0796565ce0a93ed600ca4346e628800e0d4623ac | refs/heads/master | 2020-11-26T23:40:09.485007 | 2019-12-20T09:22:37 | 2019-12-20T09:22:37 | 229,232,123 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Apr 23 15:48:47 2018
@author: lei
"""
import obspy
from obspy import read, read_inventory
from os import listdir
from obspy.core import UTCDateTime
# 读入时间
t0 = UTCDateTime("2018-04-22T16:30:00.000")
# 读入仪器响应文件
inv = read_inventory('F:/work/mycode/test/FJ.dataless.xml')
pre_... | UTF-8 | Python | false | false | 1,064 | py | 10 | dataless.py | 7 | 0.690661 | 0.633268 | 0 | 35 | 28.4 | 80 |
kishansharma3012/HistoNet | 2,602,750,187,633 | c4f2bf91df7e9ff0f59a7956427e802bb7263a46 | cf377c54bd6ea649703923cce924694e3747168b | /code/train.py | 3428603e403fa63b6725b3742356ae9c3b0de035 | [] | no_license | https://github.com/kishansharma3012/HistoNet | c2424028de90101f80b1e269f0e54855d355b4bc | 62bb9120027dfe13b0968af59ad49b0bf57ed836 | refs/heads/master | 2020-08-12T16:05:45.130289 | 2020-05-02T20:29:26 | 2020-05-02T20:29:26 | 214,796,600 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import lasagne
import pickle
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
plt.set_cmap('jet')
import sys,os,time,random
import numpy as np
import theano
import theano.tensor as T
from data_utils import import_data, import_data_dsn
seed = 0
random.seed(seed)
np.random.seed(seed)
lasagne.ran... | UTF-8 | Python | false | false | 50,094 | py | 7 | train.py | 5 | 0.647682 | 0.620533 | 0 | 905 | 54.352486 | 259 |
felipeumanzor/chilean_parliament_data | 18,004,502,937,562 | 3504c97d3d645fefe12a4423ef41eab5d0ee8442 | 36ab20069d9da6168df6e703c8fa35d19bcb6292 | /votoparlamentario/urls.py | a98f87c8d4387af91c3e17fba87cdb263e0268fe | [] | no_license | https://github.com/felipeumanzor/chilean_parliament_data | 86570f3bbedaa9968dc7c7e83b801c8c5fb69d68 | 4670db93f03eee9b71e3378b09ce9a200e9a4364 | refs/heads/master | 2020-08-27T12:02:08.428061 | 2019-11-12T05:53:08 | 2019-11-12T05:53:08 | 217,361,374 | 0 | 0 | null | false | 2020-06-06T00:28:52 | 2019-10-24T17:57:17 | 2019-11-12T05:53:14 | 2020-06-06T00:28:50 | 47 | 0 | 0 | 1 | Python | false | false | from api.views import (
get_diputados,
get_proyectos,
get_proyectos_by_author,
get_votos_by_diputado,
get_gastos_by_diputado,
get_diputado_by_id,
get_proyecto_by_id,
)
"""votoparlamentario URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
h... | UTF-8 | Python | false | false | 1,357 | py | 7 | urls.py | 6 | 0.689757 | 0.683861 | 0 | 38 | 34.710526 | 77 |
Steven-Ireland/ProfessorWho-Scraper | 3,599,182,619,290 | 3e81adf3653ab347045460be984c85f818a42a6c | 8425fb50a7f22d458875dd7154f4e7f8af8d2106 | /parse.py | fb3e8568e33c7c489d5844849db1e8c912bee2ca | [] | no_license | https://github.com/Steven-Ireland/ProfessorWho-Scraper | 2814cde9ab9a21326cea253ac6daa307aaf37afb | 39299f495cce0ea50bbea2349a9109c7ff1b4f48 | refs/heads/master | 2016-08-07T20:23:44.085160 | 2015-02-04T02:09:21 | 2015-02-04T02:09:21 | 29,502,390 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import re
class Parser: # works for 1-level html structures like table rows, but nesting breaks
def __init__(self, dom, attr="html"):
self.str = dom
self.attr= attr
def find(self, q):
tag = "<"+q+".*?>.*?</"+q+">" # <q.*?>.*?</q>
ret = []
for found in re.findall(tag, self.str, re.DOTALL|re.IGNORECASE):
... | UTF-8 | Python | false | false | 1,203 | py | 6 | parse.py | 6 | 0.612635 | 0.60266 | 0 | 43 | 27 | 99 |
faridrashidi/trisicell | 15,814,069,613,706 | 58bf0bff9b86d4fac731ba03505c9a1e3b529fb7 | 5e84c48158341afa34eae19a2e0db26b11d8a267 | /trisicell/pp/__init__.py | 5009d08d80e6a62d04e3c24c033248bc973eb7b2 | [
"BSD-3-Clause"
] | permissive | https://github.com/faridrashidi/trisicell | 53fbd97efd4121f717babd218661edbce48cb10e | eff50c7885053250656a60040612e8097c5032a1 | refs/heads/master | 2023-07-24T03:54:25.472928 | 2023-07-21T06:31:18 | 2023-07-21T06:31:18 | 342,698,508 | 6 | 2 | BSD-3-Clause | false | 2023-07-21T14:42:58 | 2021-02-26T20:54:06 | 2023-02-23T20:10:13 | 2023-07-21T14:42:57 | 162,366 | 8 | 2 | 0 | Python | false | false | """Pre/Post-Processing Module."""
from trisicell.pp._bifiltering import bifiltering
from trisicell.pp._binary import (
binarym_filter_clonal_mutations,
binarym_filter_nonsense_mutations,
binarym_filter_private_mutations,
binarym_statistics,
consensus_combine,
)
from trisicell.pp._readcount import (... | UTF-8 | Python | false | false | 1,348 | py | 220 | __init__.py | 180 | 0.712166 | 0.712166 | 0 | 47 | 27.680851 | 61 |
leeil525/Python | 3,341,484,604,058 | 5fe01d930661e24d8f856082989ba1534e0c6586 | 3bfc8c92a9aae68a7bd0aaf9fef7e208d0312cb1 | /selenium.py | 2cde1f255e67891265eec05ed7cf9fa0c75b396e | [] | no_license | https://github.com/leeil525/Python | 7abcfecdc86a55939affc0754c59f747bf3a8973 | cee85158428cc4922d2a4b9f14d56fada2e726a0 | refs/heads/master | 2021-01-20T09:06:51.671598 | 2021-01-20T06:30:31 | 2021-01-20T06:30:31 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from selenium import webdriver
from selenium.webdriver.common.keys import Keys #输入的键盘位键操作
from selenium.webdriver.support.ui import Select #选项卡操作
from selenium.webdriver import ActionChains #拖拽元素
from selenium.webdriver.chrome.options import Options #设置Chrome手机模式
from selenium.webdriver.common.desired_capabilities ... | UTF-8 | Python | false | false | 2,938 | py | 30 | selenium.py | 24 | 0.715066 | 0.69555 | 0 | 64 | 38.75 | 140 |
sirius9/Project | 6,124,623,389,661 | 1fa5fb75701bcae39f54eb46e8754039bfac04dc | 574e4f93ebc4b557f82599c5ce9558c0391ea5ba | /03_Premierleague/function.py | 738f34776f181b9fde6eeabceeee52f2f7caef4d | [] | no_license | https://github.com/sirius9/Project | 950696144748cba58bfc69bc8febbf0a0defcaff | 7f4de79ee722284396b7950b4d1e956c998bb7d9 | refs/heads/master | 2020-04-09T04:33:37.163893 | 2018-08-27T01:20:57 | 2018-08-27T01:20:57 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # 0. basic
import numpy as np
import pandas as pd
import warnings
warnings.filterwarnings('ignore')
# 1. EDA
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib as mpl
from matplotlib.pyplot import *
# Statistic
import scipy.stats as stats
import urllib
from statsmodels.formula.api import ols
from... | UTF-8 | Python | false | false | 2,505 | py | 40 | function.py | 4 | 0.794893 | 0.788196 | 0 | 81 | 28.493827 | 89 |
geedubey/soware | 13,297,218,788,514 | 678ddc56c064f14b6bbbefc1f985f9f9cc6eee63 | ece9ae460f93b877313c930af7d2e36219cd0942 | /link.py | e0e02b78adefa0aabb8aa5e4886bffd168e5823a | [] | no_license | https://github.com/geedubey/soware | c49ae6c740e8c0da3879856236eeb23d91c997d4 | 138a204f10cfc6f0926a6773a5540c7943ff9adf | refs/heads/master | 2020-03-23T09:29:40.880732 | 2018-09-09T17:57:44 | 2018-09-09T17:57:44 | 141,391,014 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # Credentials you get from registering a new application
client_id = '77xdxq5i655wrv'
client_secret = 'Ww37UQ9kcZ9Q9RVD'
# OAuth endpoints given in the LinkedIn API documentation
authorization_base_url = 'https://www.linkedin.com/uas/oauth2/authorization'
token_url = 'https://www.linkedin.com/uas/oauth2/accessToken'
f... | UTF-8 | Python | false | false | 1,761 | py | 6 | link.py | 5 | 0.755253 | 0.71891 | 0 | 42 | 40.952381 | 122 |
shantanu609/PreCourse_1 | 3,839,700,768,747 | 98919ef1f3ef37bfe8811dce5734a53a0ddf0783 | ce3418afa332e88827068bef0b996b820b144cba | /Exercise_3.py | 44ecfdaec6c167fdaedc2313104372c23ce34966 | [] | no_license | https://github.com/shantanu609/PreCourse_1 | e7d32108b594d6ff0ff09d4cb9e6b5fb690e7af7 | 68a0929bc183aea6f4063ebb5faaf67cbbe24794 | refs/heads/master | 2022-07-17T09:32:53.746587 | 2020-05-20T01:36:46 | 2020-05-20T01:36:46 | 265,414,617 | 0 | 0 | null | true | 2020-05-20T01:30:13 | 2020-05-20T01:30:13 | 2019-12-16T05:35:35 | 2020-05-20T01:14:40 | 20 | 0 | 0 | 0 | null | false | false | class ListNode:
"""
A node in a singly-linked list.
"""
def __init__(self, data=None, next=None):
self.data = data
self.next = None
class SinglyLinkedList:
def __init__(self):
"""
Create a new singly-linked list.
Takes O(1) time.
"""
self.hea... | UTF-8 | Python | false | false | 1,545 | py | 1 | Exercise_3.py | 1 | 0.487379 | 0.480906 | 0 | 65 | 22.784615 | 57 |
Mepond/bitcoin-abc | 6,914,897,364,399 | 97f6ecca5fc66149ff312c7b4d5af33dbf5a3520 | 781320936dfd058d70873d3e05a7780829267f49 | /test/functional/abc_p2p_avalanche_quorum.py | eba9b7c46a7a4928ed8211b89360720f3b55d00e | [
"MIT"
] | permissive | https://github.com/Mepond/bitcoin-abc | 38ac072f8e7832bc1e2bd6e395251e97d1beb4a1 | 47f7a91b4c8911fd1cd05102de1f7e622e8855d8 | refs/heads/master | 2022-03-27T17:56:18.927737 | 2022-03-24T03:11:48 | 2022-03-24T03:12:09 | 227,140,014 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2020-2022 The Bitcoin developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the quorum detection of avalanche."""
from time import time
from test_framework.avatools import (
... | UTF-8 | Python | false | false | 4,236 | py | 88 | abc_p2p_avalanche_quorum.py | 73 | 0.626534 | 0.60458 | 0 | 111 | 37.162162 | 90 |
kitoku-magic/user_registration_form | 7,524,782,746,933 | 3116871426f215153eed6efe827f350eaf3ac484 | b79b540921ba050ee1c12456890414a80c14e639 | /python/src/controller/user_registration/user_registration_common_controller.py | 4be97be970f6d711da18e92541b02763099255d7 | [] | no_license | https://github.com/kitoku-magic/user_registration_form | 13758138b4066eddda324693164702f609d1ff60 | f530cb9147c197635c3f057421ab26d579b29da0 | refs/heads/master | 2023-08-08T15:16:19.802530 | 2021-09-26T05:14:22 | 2021-09-26T05:14:22 | 173,554,653 | 0 | 0 | null | false | 2023-07-25T20:22:37 | 2019-03-03T09:26:29 | 2021-09-26T05:14:35 | 2023-07-25T20:22:34 | 2,642 | 0 | 0 | 5 | Python | false | false | from python_library.src.custom_flask.controller import controller
from src import abc
from src import os
from src.model.entity.birth_days_entity import birth_days_entity
from src.model.entity.contact_methods_entity import contact_methods_entity
from src.model.entity.jobs_entity import jobs_entity
from src.model.entity.... | UTF-8 | Python | false | false | 8,804 | py | 101 | user_registration_common_controller.py | 87 | 0.524547 | 0.523594 | 0 | 215 | 38.032558 | 119 |
damoncheng/Markdown | 18,150,531,823,079 | b4680538c614b4ad40555f684bf6e6f2d16f7dbe | 06682e4ce38bc10f215e0209e35442025748e381 | /Interpreter/Python/lib/metaclass.py | be7bd778fce27aa05484bd6c681bb549477fee8e | [] | no_license | https://github.com/damoncheng/Markdown | 6a9983baaf21bd7d67a3846e42fc136679e2a7d8 | ae7958aba91e21c4133222978e1028b91a2478cb | refs/heads/master | 2023-03-24T14:45:42.000592 | 2022-04-15T16:31:41 | 2022-04-15T16:31:41 | 65,825,196 | 0 | 2 | null | null | null | null | null | null | null | null | null | null | null | null | null | import inspect
print("1......")
class UpperMetaClass(type):
def __new__(upperattr_metaclass, future_class_name, future_class_parents, future_class_attr, **kwargs):
print("upperattr_metaclass : ", upperattr_metaclass)
print("future_class_name : ", future_class_name)
print("future_class_pa... | UTF-8 | Python | false | false | 1,888 | py | 476 | metaclass.py | 252 | 0.59428 | 0.585805 | 0 | 83 | 21.746988 | 154 |
Zapix/gym-backend | 1,898,375,569,024 | 117deed2b6cd7e89449ece003da80e29d38daea7 | 7c154a88605bf183c3134708d4f5d4de87c0c92f | /gym_backend/exercises/migrations/0001_initial.py | da1254ef04e321809f9118c20dcafca66a4d9f68 | [] | no_license | https://github.com/Zapix/gym-backend | faeae5f8e6447e47b6da1d69ff80585fdb2381f4 | e75cbe9fae9ff4b2bebeabe3113f644003b9aa59 | refs/heads/master | 2021-01-01T18:29:44.055588 | 2013-11-22T07:16:35 | 2013-11-22T07:16:35 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'MuscleGroup'
db.create_table(u'exercises_musclegroup', (
... | UTF-8 | Python | false | false | 2,339 | py | 19 | 0001_initial.py | 12 | 0.592988 | 0.584438 | 0 | 53 | 43.150943 | 154 |
TheEnbyperor/racing_sim | 15,805,479,667,501 | 22df2c29bdf3d0831f62dea4dda9dd07d0b10ee3 | 97fea2ec15c7a000313537c0c2be2cbe11f6fa24 | /game/wheel.py | 45758e79e319b58ecb9b4bf19fe83d10ac622a81 | [] | no_license | https://github.com/TheEnbyperor/racing_sim | 7ea6c0406728863348a134dd3a64bb1a8a7b24e3 | 1a083fb56792b562f888ea74d53b3eca3b059b3c | refs/heads/master | 2020-04-25T18:19:11.442235 | 2019-03-10T10:21:36 | 2019-03-10T10:21:36 | 172,980,411 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from inputs import devices
stick = devices.gamepads[0]
while True:
events = stick.read()
for event in events:
print(event.ev_type, event.code, event.state)
| UTF-8 | Python | false | false | 174 | py | 8 | wheel.py | 6 | 0.683908 | 0.678161 | 0 | 8 | 20.75 | 53 |
nub8p/2020-Summer-Jookgorithm | 7,224,134,992,671 | c2349685100e98ed4f0f580feb1b8799f2287f95 | 8fe5d1db11f5ed8c27fee2740c5dbe188d09f48b | /최민우/[20.07.12] 10825.py | d25363173765263d582c2f82b84252a32ff357fe | [] | no_license | https://github.com/nub8p/2020-Summer-Jookgorithm | ec0f9117be1cbadb1a64bc5a048a9f4efdddd0cd | 2bf0aeb3a60e05ab3762d0d54fe5f8c5eb2bdc3f | refs/heads/master | 2023-05-05T15:27:31.009599 | 2021-05-03T18:59:20 | 2021-05-03T18:59:20 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | people = []
for i in range(int(input())):
line = input().split()
name = line[0]
kor, eng, math = map(int, line[1:])
people.append({'name': name,
'kor': kor,
'eng': eng,
'math': math})
people.sort(key=lambda x: (-x['kor'], x['eng'], -x['math'], x['... | UTF-8 | Python | false | false | 373 | py | 419 | [20.07.12] 10825.py | 345 | 0.466488 | 0.461126 | 0 | 11 | 32.909091 | 71 |
ceos-seo/data_cube_utilities | 1,537,598,312,469 | 3c05cdbafd0f4389a2ea9cad91e0b0d89d0a1967 | 45ef0f26edc1fd1940267c3836c30e10b2fecd39 | /data_cube_utilities/dc_baseline.py | 76ea088c8375a5c5855b6c06b5639c3422e1e4c5 | [
"Apache-2.0"
] | permissive | https://github.com/ceos-seo/data_cube_utilities | 1834357348c36c2155968af15ceab87721e43d63 | 1979c2a160f2ad306582c60f9ad6be67dfc353ab | refs/heads/master | 2021-11-05T20:22:41.632698 | 2021-10-25T23:19:56 | 2021-10-29T15:45:10 | 77,079,324 | 16 | 22 | Apache-2.0 | false | 2021-02-05T19:51:59 | 2016-12-21T19:13:40 | 2021-02-03T16:50:42 | 2021-02-05T19:51:58 | 489 | 9 | 17 | 3 | Python | false | false | import numpy as np
import xarray
import xarray.core.ops as ops
import xarray as xr
from itertools import islice
def _window(seq, n=2):
"""Returns a sliding _window (of width n) over data from the iterable"
" s -> (s0,s1,...s[n-1]), (s1,s2,...,sn), ... """
it = iter(seq)
result = tu... | UTF-8 | Python | false | false | 2,116 | py | 67 | dc_baseline.py | 60 | 0.65879 | 0.653119 | 0 | 59 | 34.864407 | 102 |
CodeLogist/RAdam-PLSTM-FX-Trader | 2,645,699,879,420 | c8cf84b287bd890db802449599a8373a3819cff9 | 72789db2e7d27995fd364841d33808cdf4326da0 | /data.py | de171f00ac8210e5ff182d5caf55df67a6f8c924 | [] | no_license | https://github.com/CodeLogist/RAdam-PLSTM-FX-Trader | 3a8f5fa0c2a969d5f0a56959401d75a6b35956d5 | a38c25a0e49d50a35bd586c15c2b3a10b293b648 | refs/heads/master | 2021-05-18T19:03:47.494160 | 2020-03-30T17:02:45 | 2020-03-30T17:02:45 | 251,371,181 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | import numpy as np
import pandas as pd
import os
from datetime import datetime
from sklearn.preprocessing import MinMaxScaler
from sklearn.externals import joblib
output_scale = 100
def get_day(x):
try:
y = datetime.strptime(x,'%Y/%m/%d')
except:
try:
y = datetime... | UTF-8 | Python | false | false | 2,741 | py | 7 | data.py | 6 | 0.582999 | 0.574973 | 0 | 80 | 32.2625 | 100 |
FrankSauve/390AntennaPod | 4,483,945,899,145 | df4f4079423d660944750cc3295ae579baaca1e4 | bfdf7c033eec65e7d7393145c809d643cf0824e2 | /contributers.template.py | 3127baa0c063dfccb2dcd064bd91e2609b1e0bec | [
"MIT"
] | permissive | https://github.com/FrankSauve/390AntennaPod | 5c790aa58ccd7e06fe5772ca10de00504a13b44a | dbed5b9841fbfb32ab51b61ab6b83a1950c83796 | refs/heads/develop | 2021-09-12T18:13:27.484257 | 2018-04-19T14:47:21 | 2018-04-19T14:47:21 | 116,841,114 | 3 | 1 | MIT | false | 2019-03-17T20:50:07 | 2018-01-09T16:28:34 | 2018-11-20T12:37:32 | 2018-04-19T19:09:52 | 22,758 | 3 | 1 | 2 | Java | false | null | #!/usr/bin/env python3
import requests
import subprocess
TRANSIFEX_USER = ""
TRANSIFEX_PW = ""
print('DEVELOPERS\n==========\n')
p = subprocess.Popen("git log --format='%aN' | sort -fu", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
for line in p.stdout.readlines():
output = line.decode()
prin... | UTF-8 | Python | false | false | 14,394 | py | 461 | contributers.template.py | 358 | 0.529645 | 0.529297 | 0 | 454 | 30.687225 | 119 |
juancordoba00/carsapp | 6,665,789,292,244 | ed5c3975a1538dab371199856800e84145d82928 | 64204193d70c5ab855dc2d591ac656d5557f4b91 | /carsapp/migrations/0023_auto_20210705_1940.py | 0e01364c12993427b06d6fc917b680f245024541 | [] | no_license | https://github.com/juancordoba00/carsapp | 563150e5c381a10fd4cbac23bf3b58d69de4516c | 38d404a34cdaf5676c83ed6dcb0442e32a12a865 | refs/heads/master | 2023-06-16T22:49:43.558107 | 2021-07-07T15:20:37 | 2021-07-07T15:20:37 | 372,249,300 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # Generated by Django 3.1.4 on 2021-07-06 00:40
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('carsapp', '0022_auto_20210705_1437'),
]
operations = [
migrations.AlterField(
model_name='detallesfacturas',
name='p... | UTF-8 | Python | false | false | 569 | py | 55 | 0023_auto_20210705_1940.py | 26 | 0.579965 | 0.521968 | 0 | 23 | 23.73913 | 60 |
sanshitangmalaban/GraduationProject | 19,224,273,655,630 | d83965fb1fcb877c2f587d42b3725535fbd5a37d | 6c75f452e81c9b8106d4aafe02f16b76cfac0bd2 | /MyTest/tests.py | e4c241a501f00d169a6dcae330585a4716150d47 | [] | no_license | https://github.com/sanshitangmalaban/GraduationProject | 4aebe6226c1251a7ca4b2deddcf69a13f799e9be | b47ce4dc4a490017072c785261ccf0421500a4b0 | refs/heads/master | 2020-03-24T18:20:52.697395 | 2018-07-30T15:03:22 | 2018-07-30T15:03:22 | 142,889,763 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from django.test import TestCase
import sys,os
# Create your tests here.
# import time
# print(int(time.time()))
# url = '/images/ysu_logo.png'
# url_list = url.split('/')
# print(url_list)
import requests,json
# print(os.path.dirname(os.path.abspath(__file__)))
# print(sys.path.append(os.path.dirname(os.path.abspa... | UTF-8 | Python | false | false | 976 | py | 17 | tests.py | 12 | 0.671107 | 0.620902 | 0 | 34 | 27.735294 | 154 |
ryanmuller/quill-lightside | 1,511,828,508,187 | d0c28c04bab60b0e4fdf6d4c53085b6c6af95853 | f88750fd480330bf332b3567c54a4761899a957a | /lightbox.py | 5be44d5895224f8393b8f2240b6310e38427e58e | [] | no_license | https://github.com/ryanmuller/quill-lightside | ca76c37242c475fd4e37cbc467185960bfac3163 | 56f958933017eba1a9b06ed9a6ef916a33297488 | refs/heads/master | 2020-05-17T11:06:07.596998 | 2014-12-28T21:13:55 | 2014-12-28T21:13:55 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import requests
import urlparse
import json
import random
import operator
token = ""
with open('config/token', 'r') as f:
token = f.read().strip()
prompts = [
"Why did the United States declare independence?",
"How did the moon form?",
"In Macbeth, whose ambition is the driving force of th... | UTF-8 | Python | false | false | 10,327 | py | 8 | lightbox.py | 3 | 0.603079 | 0.589716 | 0 | 350 | 28.502857 | 110 |
Dingrongdeer/X-Village-2018-Exercise | 3,607,772,539,212 | 3d650702ee34f48dd1a42bd3d2a652bb41c40f69 | b69ae92ed6bf0d7fd73e73aeb6cdd04e4a024931 | /Lesson02-Python_basic/ex3.py | f90abfada8458201ae6120044931aabba465fa36 | [] | no_license | https://github.com/Dingrongdeer/X-Village-2018-Exercise | 2c68706b8e6cdabf967f8d73d35f09c77f8545c8 | 856209c28f82798a2ffeede96669ab703f9950e8 | refs/heads/master | 2020-03-23T07:44:45.888142 | 2018-07-17T14:06:23 | 2018-07-17T14:06:23 | 141,288,101 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | def guess_luckynumber():
import random
lucky_number=random.randint(1,100)
number=int(input("清輸入終極密碼:"))
while number!= lucky_number:
if number<lucky_number:
print ("再大一點")
number=int(input("Please enter an luncky number:"))
else:
print ("再小一點")
... | UTF-8 | Python | false | false | 467 | py | 1 | ex3.py | 1 | 0.571096 | 0.561772 | 0 | 15 | 27.666667 | 63 |
JoshuaGhost/e2expred | 5,394,478,939,405 | 0a36d847d1859685dc370564028951dc94cb1229 | a9a7c00fd287f4c33d58719f8ec53c17f8560486 | /latent_rationale/common/regularizers.py | b5fb2d89b25316e57577023b84988b84084edbf5 | [
"MIT"
] | permissive | https://github.com/JoshuaGhost/e2expred | f0ac2bf66c172aad9b47b6d4ebd9ad1ad7ed489b | f4dee47c41748a64509b68daee83d97919b6c978 | refs/heads/main | 2023-05-14T17:55:13.365088 | 2021-01-13T17:11:14 | 2021-01-13T17:11:14 | 329,074,920 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import torch
def l0_for_hardkuma(dists, mask):
batch_size = mask.size(0)
lengths = mask.sum(1).float()
# pre-compute for regularizers: pdf(0.)
if len(dists) == 1:
pdf0 = dists[0].pdf(0.)
else:
pdf0 = []
for t in range(len(dists)):
pdf_t = dists[t].pdf(0.)
... | UTF-8 | Python | false | false | 729 | py | 28 | regularizers.py | 21 | 0.541838 | 0.496571 | 0 | 26 | 27.076923 | 76 |
Eiriksak/Network_Security | 3,865,470,594,134 | 9ae42a74ff1b62f22bee91bcec4f82e72ccbb2c4 | 191353ac721faf66d17ae0a281ab9e0436a51e63 | /Assignment3/test_dsa.py | 2144bbbe21aca78d71a05291e9bf914c7362bbb3 | [] | no_license | https://github.com/Eiriksak/Network_Security | b9ff2f5356a2c70ceb63ceaefd9a75b6819217a6 | ada377298cf0f0d550c410f7f511e061cbef0a9b | refs/heads/master | 2023-01-07T00:20:21.748482 | 2020-11-03T19:53:23 | 2020-11-03T19:53:23 | 300,072,354 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import dsa
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--mode', choices=['normal', 'attacker'], required=True, help='Test DSA normally or as an attacker')
args = parser.parse_args()
if args.mode == 'normal':
p, q, g = dsa.gen_pubkeys(L=51... | UTF-8 | Python | false | false | 2,042 | py | 21 | test_dsa.py | 16 | 0.598433 | 0.587169 | 0 | 41 | 48.658537 | 124 |
morawi/TextGAN | 3,100,966,416,773 | 16f509a5afb52b503601e0694e395162ce25281d | 64a9b85e24f8c038384473df988a5a480d8db20b | /B_model.py | c8fc5834237c3d5d1d9cff4df6c5bb3c5506f926 | [
"LicenseRef-scancode-other-permissive",
"MIT"
] | permissive | https://github.com/morawi/TextGAN | 4a8af74e499b89a7ddded8637c53b1611df11b42 | 1633c7cf6ee60c624da6aa2248c41c264225fa8e | refs/heads/master | 2020-05-14T16:44:44.136345 | 2019-08-28T00:46:37 | 2019-08-28T00:46:37 | 181,877,666 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri May 17 11:41:03 2019
@author: Mohammed Al-Rawi
"""
from misc_functions import binarize_tensor
def get_loss_of_B_classify(real_A, real_B): # item is a string 'A', 'A_neg' of the sample
optimizer_classify.zero_grad()
B_ = binarize_... | UTF-8 | Python | false | false | 4,336 | py | 9 | B_model.py | 7 | 0.515913 | 0.502306 | 0 | 104 | 40.701923 | 129 |
danieltimko/aoc2020 | 9,431,748,189,525 | 0d9b0f26d355be4808c1b6ca3fd7cf0be277ad7f | 5a6aa88acebefcb79d7e33ed0898b9f841816119 | /2021/21.py | afd295bfcd248abb0a722ee107670e6be3e980ee | [] | no_license | https://github.com/danieltimko/aoc2020 | 396cc7ce1380f30f18dbb3523ad9a7b5025dc34f | 8961ec2774ed30cb49e8c479e9b6989d31557745 | refs/heads/master | 2023-02-07T05:23:01.748630 | 2022-12-25T06:14:02 | 2022-12-25T06:14:02 | 318,085,942 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from itertools import product
def task1(positions):
def roll():
n = 1
while True:
yield n
n = 1 if n == 100 else n+1
scores = [0, 0]
rolls = 0
gen = roll()
while True:
for i in range(2):
rollsum = next(gen) + next(gen) + next(gen)
... | UTF-8 | Python | false | false | 1,347 | py | 75 | 21.py | 74 | 0.499629 | 0.437268 | 0 | 52 | 24.903846 | 93 |
aajenkins/LTSPM | 14,826,227,125,581 | f4fe4554070b44c0b2e700d016e90bfa26f29804 | 4964e8c02053a9616c3fe4800cacd6d74acb2f34 | /cofeb_analysis/irmn/image_erosion_stripe_width.py | 64c6522110b9e9c7c92a291422ced4e22915e88e | [] | no_license | https://github.com/aajenkins/LTSPM | cbb714c68701fc47f196d29f383fa9fcd6a51f5c | 75f640e1b2a7173b083690ec4c84337199bd44ab | refs/heads/master | 2020-07-03T15:35:10.578245 | 2018-03-19T21:45:37 | 2018-03-19T21:45:37 | 74,162,494 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # @Author: Jenkins Alec <alec>
# @Date: 2017-02-15T11:26:35-08:00
# @Project: LTSPM analysis
# @Last modified by: alec
# @Last modified time: 2017-02-15T12:01:11-08:00
import matplotlib.pyplot as plt
import matplotlib.pylab as pylab
import numpy as np
from scipy.ndimage.morphology import binary_erosion
from scipy.... | UTF-8 | Python | false | false | 859 | py | 154 | image_erosion_stripe_width.py | 142 | 0.733411 | 0.67404 | 0 | 34 | 24.264706 | 79 |
styler00dollar/Colab-BasicSR | 16,741,782,554,234 | 7649bf53ad2b2c5763ff30b3460145cc11fa1683 | af94f63c4ba68c1e06e2550449569a11ee53bee6 | /code/scripts/fix_state_dict.py | adc8e1eb5f274a918680b2b43764a34d24d5f3cf | [] | no_license | https://github.com/styler00dollar/Colab-BasicSR | 4b79da57a7afaff32bf2d671442a5171e0cc1e87 | 626d93bf8d3d3db5447ae6946d4ba8bb3d00a482 | refs/heads/master | 2023-06-13T04:15:05.808917 | 2023-05-27T01:17:56 | 2023-05-27T01:17:56 | 321,114,389 | 4 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | import torch
# from this model
model1 = torch.load("team04_rlfn.pth")
# into this model
model2 = torch.load("Checkpoint_0_0_G.pth")
for k in model1.keys():
try:
if "upsampler.0" in k:
continue
print(f"setting {k}")
model2[k] = model1[k]
except Exception as e:
prin... | UTF-8 | Python | false | false | 385 | py | 106 | fix_state_dict.py | 95 | 0.587013 | 0.558442 | 0 | 21 | 17.333333 | 43 |
stereoliza/learning | 1,082,331,762,265 | 31a31325c86ce42de44fc7575a92def0b72ef878 | 7918b5e9997744e2a641c231c80dd257ee742460 | /main.py | e7a3602669d3d9221f0d46fac13caae3a28cf828 | [] | no_license | https://github.com/stereoliza/learning | cc72cd5d907ae06e01f73bbc30be3499fcd20e6c | 6268095ee02c6fcdda54dd86dc26f37a51ffc229 | refs/heads/main | 2023-09-06T02:24:00.169886 | 2021-11-11T23:41:24 | 2021-11-11T23:41:24 | 394,315,193 | 0 | 0 | null | false | 2021-11-11T23:41:25 | 2021-08-09T14:07:20 | 2021-10-30T20:22:19 | 2021-11-11T23:41:24 | 33 | 0 | 0 | 0 | Python | false | false | from location import find_location
import sys
ip = sys.argv[1]
location = find_location(str(ip))
print(location)
| UTF-8 | Python | false | false | 119 | py | 11 | main.py | 10 | 0.731092 | 0.722689 | 0 | 7 | 15.428571 | 34 |
BahruDa/alx-higher_level_programming-2 | 15,367,393,024,180 | cd7d96d55cb8b434fca5647acb17ec73ede09aa8 | b7f25449c2baae8823f1307e134a775d6ab64272 | /0x0F-python-object_relational_mapping/model_state.py | ff208ecad1588628c4dad4a3a23774bab485effb | [] | no_license | https://github.com/BahruDa/alx-higher_level_programming-2 | 85f5155328750430949d49e8d2d27761c71360fe | 047d1dd0dec5e942e9c638d0e4cc5fc985061b56 | refs/heads/main | 2023-08-15T03:07:14.699713 | 2021-09-22T23:30:52 | 2021-09-22T23:30:52 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #!/usr/bin/python3
"""
a python module that contains the class definition of
a State and an instance Base = declarative_base():
"""
from sqlalchemy import Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class State(Base):
'''
defines a state
Attr... | UTF-8 | Python | false | false | 679 | py | 123 | model_state.py | 95 | 0.67356 | 0.66322 | 0 | 26 | 25.038462 | 74 |
paulhodge/graveyard | 2,791,728,745,102 | a17ec3de4d11d39dde5b6e8c6e885ae0bcf9c060 | 16294f14ad0e8d2e29201fd1c3d132b7793481ca | /euler_11.py | aba69eb057fd15cdc072c27a6d66fbd35bf2e0a0 | [] | no_license | https://github.com/paulhodge/graveyard | 05fc3519a9c26be88947867d55980c8a11a573e7 | 9862a8ddc69bebb8f8df2a57647360d07da34efc | refs/heads/master | 2015-08-06T09:34:28.833025 | 2012-02-02T06:31:00 | 2012-02-02T06:31:00 | 2,037,445 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
def quadratic(a, b, c=None):
import math, cmath
if c: # (ax^2 + bx + c = 0)
a, b = b / float(a), c / float(a)
t = a / 2.0
r = t**2 - b
if r >= 0: # real roots
y1 = math.sqrt(r)
else: # complex roots
y1 = cmath.sqrt(r)
y2 = -y1
return y1 - t, y2 - t
def triangle_numbers():
i =... | UTF-8 | Python | false | false | 1,168 | py | 18 | euler_11.py | 4 | 0.527397 | 0.486301 | 0 | 60 | 18.45 | 50 |
kimlin20011/data_mining_assignment | 5,308,579,620,768 | 74e16a6b4a4df6ae972c01703c9a495263bca960 | c4cbbbeded13f7cfefbd9a40932bc083c6ae0e8d | /q2_6/test.py | 972f2d5b73acab962ad5f0037e51d457ff7d58ff | [] | no_license | https://github.com/kimlin20011/data_mining_assignment | e0e51d94b5822aa91b5d1c2d2317ba829ad1ef26 | 527463b1005877def75e5100ee9088b423016fb8 | refs/heads/main | 2023-06-24T04:54:33.078896 | 2021-07-28T07:08:58 | 2021-07-28T07:08:58 | 389,860,600 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from sklearn import tree
import pandas as pd
import graphviz
df = pd.read_csv("data.csv", encoding="utf-8")
print(df)
features = list(df.columns[1:21])
X = df[features]
y = df["class"]
classifier = tree.DecisionTreeClassifier()
classifier = classifier.fit(X, y)
tree.plot_tree(classifier)
dot_data = tree.export_graph... | UTF-8 | Python | false | false | 603 | py | 22 | test.py | 12 | 0.622222 | 0.615385 | 0 | 19 | 29.789474 | 80 |
kowoolim/youtube | 15,736,760,181,537 | c1fb57c8b8b67246e66583bc669d2c50b115faf0 | 8e8d193d504ce8b136efe8d8c451eb00629b9b7c | /address/admin.py | 99e45cb95ba198bb59a88bfd0effea5dfaff6069 | [] | no_license | https://github.com/kowoolim/youtube | b8a84e57f57b6ca5430a3f9b3186efa37a7aa06a | fd1bfe3870bb5770e9590dd767405c3e7e272567 | refs/heads/master | 2023-03-12T11:44:46.495748 | 2021-03-01T09:18:09 | 2021-03-01T09:18:09 | 343,347,541 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from django.contrib import admin
from address.models import Address
class AddressAdmin(admin.ModelAdmin):
#화면에 출력할 필드 목록을 튜플로 지정
list_display = ("name","tel","email","address")
admin.site.register(Address, AddressAdmin)
| UTF-8 | Python | false | false | 262 | py | 28 | admin.py | 18 | 0.747826 | 0.747826 | 0 | 8 | 27.75 | 51 |
csmith49/bach | 19,310,172,996,698 | 72ceac3369c60850c964cf69ec3b34904b7bdd6d | 1dcb9060349ac3136b39dc3bb552b9e8b39d66be | /tools/epee/epee.py | 2df0eec0854761b4bced94850e78dfaf5fe41ea9 | [] | no_license | https://github.com/csmith49/bach | 8b0b2c04a68f3a0155083d4f7997a279f5e3e4a5 | 80b0c1269de3786ab76d627c4fd85205d640ca12 | refs/heads/master | 2021-05-07T23:15:29.353469 | 2017-10-18T14:18:48 | 2017-10-18T14:18:48 | 107,418,191 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from argparse import ArgumentParser
from inspect import signature
from importlib import machinery
from csv import writer
import os
# store generators in a map, use decorator to tag them
# label them with add_generator anywhere after this section
_GENERATORS = {}
def add_generator(key):
def deco(f):
_GENER... | UTF-8 | Python | false | false | 5,411 | py | 107 | epee.py | 20 | 0.567548 | 0.55073 | 0 | 211 | 24.64455 | 85 |
pokuk76/HandsOnScikitLearnAndTensorflow | 12,275,016,560,309 | a30ea85709208cac42a6bc1e0f57b5137f71de4f | e1d133db78cac139e6fa9530f9431b6e81085a45 | /Classification/fold.py | bd6afd95fcaa89f2a6522b7662a0db313ba9007a | [] | no_license | https://github.com/pokuk76/HandsOnScikitLearnAndTensorflow | 0113dc5439ce91ee5426ac91e51b842a70f2d14e | 17b87108da2be980ec913fa1b344f9a5cab7c100 | refs/heads/master | 2020-12-15T08:07:00.039241 | 2019-12-05T13:40:04 | 2019-12-05T13:40:04 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import numpy as np
import pullMnist as pm
import split_train_test as stt
def foldMnistData(X_train, y_train):
shuffle_index = np.random.permutation(60000)
return X_train[shuffle_index], y_train[shuffle_index]
mnist = pm.pull_mnist()
X_train, X_test, y_train, y_test = stt.split_train_test(mnist)
X_tr... | UTF-8 | Python | false | false | 368 | py | 8 | fold.py | 8 | 0.711957 | 0.69837 | 0 | 11 | 31.454545 | 62 |
int-brain-lab/iblscripts | 8,280,696,963,030 | c426e4479613459ce98a25df744efc651919ee9c | 3c58e1d04473e8ec8b2c812a492bb7392d4dd5a8 | /deploy/serverpc/utils/scan_fix_passive_files.py | ec3cf9e21a4f7feaa4cd523a9746183a5fa7a3e6 | [
"MIT"
] | permissive | https://github.com/int-brain-lab/iblscripts | cf2d401ca555f20c0eea1a0d78c7e78330fb809b | 44e828c3c3607bb326569bbaf136951dfb1fabad | refs/heads/master | 2023-08-31T23:59:04.889864 | 2023-08-04T14:42:56 | 2023-08-04T14:42:56 | 187,838,029 | 3 | 9 | MIT | false | 2023-08-18T18:14:14 | 2019-05-21T13:00:12 | 2023-06-27T20:36:36 | 2023-08-18T18:14:14 | 11,950 | 3 | 8 | 7 | Jupyter Notebook | false | false | from pathlib import Path
import argparse
import logging
from ibllib.pipes.scan_fix_passive_files import execute
log = logging.getLogger('ibllib')
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Scan and fix badly transfered passive sessions')
parser.add_argument('root_data_folder', ... | UTF-8 | Python | false | false | 842 | py | 162 | scan_fix_passive_files.py | 110 | 0.67696 | 0.674584 | 0 | 21 | 39.095238 | 107 |
MrJVM/Python-Practice | 609,885,356,838 | 7a91052052d19dabd406fc8d5153002de1afe39b | a950c299e0aab8acde0540bb0efd66ffe66177a2 | /basics/prime_practice.py | 7a76fd92fab6d55d4dda60a6b718aab6a88e6c96 | [
"Apache-2.0"
] | permissive | https://github.com/MrJVM/Python-Practice | 3cb06a159e11f55179a5dcd2701f7125a9e49f94 | 2f8716b149afa18f6979329cc12036e63c515823 | refs/heads/master | 2021-04-24T00:26:52.442841 | 2020-04-08T17:26:32 | 2020-04-08T17:26:32 | 250,043,590 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from math import sqrt
value = 10
print(f'The value is {value}')
d = dict(tom='22',sam='50')
for k,v in d.items():
print("Key={} Value={}",k,v)
#Collection comprehension
def is_prime(x):
if x < 2:
return False
for i in range(2, int(sqrt(x))+1):
if x%i == 0:
return False
r... | UTF-8 | Python | false | false | 384 | py | 7 | prime_practice.py | 6 | 0.565104 | 0.53125 | 0 | 21 | 17.333333 | 43 |
vindafadilla/ta_backend | 11,252,814,315,618 | 222dae8bef272455ca93060e6e890e58f9c7cac9 | dea2639a56122d36624d7ab2687bff4a32c8cd90 | /datacleaning/dataCleaning.py | f875fd4e8e3ecbd24d497566d4218f6a8e038daf | [] | no_license | https://github.com/vindafadilla/ta_backend | 139bb8e4026f07ca4a6658683e466f0ce3fe486e | db4b819bda668c1531d12c49ca61454dec2b57bb | refs/heads/master | 2021-01-20T04:12:27.883453 | 2017-06-21T01:38:53 | 2017-06-21T01:38:53 | 89,660,284 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from ta_backend.datapreparation.dataTwitter import DataTwitter
from ta_backend.datapreparation.appropriateDataTweetFilter import AppropriateDataTweetFilter
from ta_backend.datacleaning.normalization import Normalization
class DataCleaning:
def dataCleaningProcess(self, listTweet):
try:
normaliz... | UTF-8 | Python | false | false | 2,380 | py | 29 | dataCleaning.py | 27 | 0.686134 | 0.685714 | 0 | 37 | 63.351351 | 130 |
wani-hackase/wani-writeup | 14,379,550,507,173 | 16f266b31fda360387ad509d4036acc0ab56e6f4 | bffb95af93d36ecff3ed7a7cd991a6a2b82b1d57 | /2020/03-b01lers/cry-safety/solve.py | 48bddd88f6632e100db13db3b0ad0351d9c701d0 | [
"MIT"
] | permissive | https://github.com/wani-hackase/wani-writeup | 287159907aa2bb54e119bbb907836574871fa455 | dd4ad0607d2f2193ad94c1ce65359294aa591681 | refs/heads/master | 2021-12-27T16:48:21.017138 | 2021-12-16T10:30:14 | 2021-12-16T10:30:14 | 170,531,761 | 26 | 1 | MIT | false | 2020-06-25T07:29:11 | 2019-02-13T15:32:43 | 2020-05-28T03:48:01 | 2020-06-25T07:27:17 | 55,790 | 17 | 0 | 0 | HTML | false | false | import gmpy2
e = 0x10001
with open('flag.enc', 'rb') as f:
flag = f.read()
flag = int.from_bytes(flag, byteorder='little')
m, exact = gmpy2.iroot(flag, e)
m = int(m)
if exact:
flag = m.to_bytes(m.bit_length()//8+1, byteorder='little')
print(flag)
else:
print('Failed')
| UTF-8 | Python | false | false | 289 | py | 235 | solve.py | 86 | 0.619377 | 0.584775 | 0 | 16 | 17.0625 | 62 |
HonglinChu/SiamTrackers | 9,603,546,880,003 | 99b4f1a19786ba49db6b026b9f543f6849c04de9 | abbc2d332bdfa036ac12438983e6d74cf4107e64 | /SiamFCpp/SiamFCpp-video_analyst/siamfcpp/evaluation/davis_benchmark/davis2017/results.py | 0c39580725cf40366e2e87f9096b7f733595fb2c | [] | permissive | https://github.com/HonglinChu/SiamTrackers | c494cff7543a433e8ec7dbf6d9439b1e7395b0c0 | 805208b5348346d35e64abcbe901a3829743e157 | refs/heads/master | 2023-08-29T06:50:59.532271 | 2023-03-06T09:13:53 | 2023-03-06T09:13:53 | 253,718,080 | 1,166 | 243 | Apache-2.0 | false | 2023-08-03T16:39:53 | 2020-04-07T07:24:00 | 2023-08-03T02:47:52 | 2023-08-03T16:39:53 | 67,076 | 1,054 | 227 | 86 | Python | false | false | import os
import numpy as np
from PIL import Image
import sys
class Results(object):
def __init__(self, root_dir):
self.root_dir = root_dir
def _read_mask(self, sequence, frame_id):
try:
mask_path = os.path.join(self.root_dir, sequence,
'{}.png... | UTF-8 | Python | false | false | 1,285 | py | 629 | results.py | 318 | 0.558755 | 0.554086 | 0 | 33 | 37.939394 | 98 |
Rapator-Tech-Academy/rapator-final-project | 335,007,452,715 | 6c79149ac877d2d8fc101ba38d8dd241d769e539 | 06d1a334cbf7c02db43ba3890a9ef8f1d862123e | /app/core/admin.py | d7d55b2b3cb3a3f3aedede5907f9255d711cf992 | [] | no_license | https://github.com/Rapator-Tech-Academy/rapator-final-project | 42a85b7229e7b68a806c48fb69e9a65f21f2fd62 | 63e6df63f7a16d5402a7b437da3939d93549ca8e | refs/heads/main | 2023-03-19T04:21:30.527519 | 2021-03-04T09:09:28 | 2021-03-04T09:09:28 | 322,076,812 | 0 | 2 | null | false | 2021-03-04T09:09:29 | 2020-12-16T19:06:10 | 2021-02-24T00:48:14 | 2021-03-04T09:09:28 | 31,204 | 0 | 1 | 0 | Python | false | false | from django.contrib import admin
from django.contrib.flatpages.admin import FlatPageAdmin
from django.contrib.flatpages.models import FlatPage
from django.db import models
from mptt.admin import MPTTModelAdmin
from ckeditor.widgets import CKEditorWidget
from mptt.admin import MPTTModelAdmin
from core.models import Cat... | UTF-8 | Python | false | false | 701 | py | 83 | admin.py | 37 | 0.810271 | 0.810271 | 0 | 27 | 24.925926 | 61 |
hugovk/EveryElection | 1,778,116,494,175 | f1e817b0dae2360b08971327f9c86d274decdb0c | d8c209163273688c9eb460674b89a10a951e4cb4 | /every_election/apps/organisations/constants.py | bb4ffe68603cb5280acb1724b7483e2bfd8bf24c | [
"MIT"
] | permissive | https://github.com/hugovk/EveryElection | 9fa51edee42de06ab8caff225c64dfed4c61211b | b79123347dbfe1f7610f3b092fb5418b8e12f393 | refs/heads/master | 2018-04-07T15:37:19.278115 | 2017-04-25T13:08:19 | 2017-04-25T13:08:19 | 89,626,719 | 0 | 0 | null | true | 2017-04-27T18:18:44 | 2017-04-27T18:10:16 | 2017-04-27T18:10:19 | 2017-04-27T18:12:30 | 32,698 | 0 | 0 | 1 | Python | null | null | PARENT_TO_CHILD_AREAS = {
'DIS': ['DIW',],
'MTD': ['MTW',],
'CTY': ['CED',],
'LBO': ['LBW',],
'CED': ['CPC',],
'UTA': ['UTW', 'UTE'],
'NIA': ['NIE',],
'COI': ['COP',],
}
CHILD_TO_PARENT_AREAS = {
'DIW': 'DIS',
'MTW': 'MTD',
'UTW': 'UTA',
'UTE': 'UTA',
'CED': 'CTY',
... | UTF-8 | Python | false | false | 4,209 | py | 5 | constants.py | 5 | 0.576146 | 0.235923 | 0 | 104 | 39.471154 | 81 |
peernode/offline_platform | 7,490,422,977,018 | 86b60e420087a6b9c9e82ffdd77831c6cb059dbc | 5c5e917a2ca20a2f3fdd6d1a01d66f3df0553a6c | /flashVoD/rate/connect_ratio_views.py | 0a7671df5d1fabbdbd7972fba15156d83f9755d2 | [
"Apache-2.0"
] | permissive | https://github.com/peernode/offline_platform | 9d384262c4aee2c626630d5c5e3a321a351bd00c | 3458dc3be422af3670776d35140b37b9f9637edd | refs/heads/master | 2020-05-26T21:45:44.997335 | 2015-01-27T02:04:58 | 2015-01-27T02:04:58 | 29,892,543 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # -*- coding: utf-8 -*-
import json
from django.http import HttpResponse
from rate.models import *
def update_connect_ratio(request):
result="ok"
if request.method=='POST':
decodes=json.loads(request.body)
try:
ver=version_info.get_version(decodes['ver'])
create_date='%s... | UTF-8 | Python | false | false | 2,442 | py | 65 | connect_ratio_views.py | 41 | 0.423423 | 0.418919 | 0 | 60 | 39.7 | 122 |
Gregorh98/PlanterCostCalculator | 6,597,069,783,886 | 0bc508fc1d5b5309cedead5f4aaf1026e189863f | 3210361298a54c2415ac9b70dc4fcd59051a1de9 | /planters.py | caa45fa9f84702a50fd273bc1beff0ce35a9f5ab | [] | no_license | https://github.com/Gregorh98/PlanterCostCalculator | dc6f421157fbd59c55e59791e3d9d245bdcc6012 | 24907112b8247f27d20819e34814c64c0aa3e696 | refs/heads/main | 2023-03-02T19:30:30.749010 | 2021-02-13T23:35:29 | 2021-02-13T23:35:29 | 336,054,569 | 0 | 0 | null | false | 2021-02-07T01:09:50 | 2021-02-04T19:02:03 | 2021-02-07T01:09:11 | 2021-02-07T01:09:09 | 49 | 0 | 0 | 0 | Python | false | false | import planks, linerRoll
import json, math
class Planter():
def __init__(self, dimensions, settings):
self.height, self.width, self.length = dimensions
self.settings = settings
self.markup = self.settings["general"]["markup"]
self.measurementType = self.settings["general"]["defaultUnitOfMeasurement"]
self... | UTF-8 | Python | false | false | 3,035 | py | 13 | planters.py | 7 | 0.739703 | 0.732784 | 0 | 94 | 31.255319 | 201 |
pgmac/aws_helpers | 9,818,295,246,684 | 5d35a462f29e03a62847aa0f129004d922ca6d28 | ca769b501ae3b5a9cc62c203aca749579eea5abf | /route_53.py | a29d69cffb0df7c123fb288b01a9332d082c1c3a | [] | no_license | https://github.com/pgmac/aws_helpers | 3fb8c08cf9f9acfbb53916c193eea0532cf15777 | ce0b7c22d2c1f78400dde758330cb2394751f19c | refs/heads/master | 2022-10-19T09:31:07.212200 | 2022-09-19T07:33:50 | 2022-09-19T07:33:50 | 123,996,034 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #!/usr/bin/python3
"""List the Route 53 DNS Entries"""
from pprint import pprint
import boto3
from botocore.exceptions import ClientError
def rr_display(client, rrset, level=0):
#print(rrset)
print("{}{}\t{}".format("\t"*level, rrset['Name'], rrset['Type']))
print("{}{}".format("\t"*(level+1), rrset['Reso... | UTF-8 | Python | false | false | 1,070 | py | 10 | route_53.py | 9 | 0.621495 | 0.605607 | 0 | 35 | 29.571429 | 93 |
SEA-group/wowp_scripts | 12,506,944,802,968 | fae8ae7215f5149ae378762fbc38b38ad1fe1590 | 3b504a983f1807ae7c5af51078bfab8c187fc82d | /client/fm/FMAvatarMethods.py | eae6f704f9f35b890ede8902abad6704e7ef4eda | [] | no_license | https://github.com/SEA-group/wowp_scripts | 7d35fd213db95ea6b3dbd1ec6d3e0f13de86ba58 | 2fe54a44df34f2dcaa6860a23b835dcd8dd21402 | refs/heads/master | 2021-09-07T23:10:13.706605 | 2018-03-02T17:23:48 | 2018-03-02T17:23:48 | 117,280,141 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # Embedded file name: scripts/client/fm/FMAvatarMethods.py
def fmEmpty(func):
return func
def fmAvatarMethods(decorator):
if decorator is None:
decorator = fmEmpty
def addFMAvatarMethods(objClass):
class decorated(objClass):
@decorator
def fmData(self, data):
... | UTF-8 | Python | false | false | 971 | py | 1,504 | FMAvatarMethods.py | 1,016 | 0.513903 | 0.513903 | 0 | 47 | 19.680851 | 65 |
lxtxl/aws_cli | 18,056,042,525,306 | f319c11571d96425064427abda317d1a87ac3181 | 91d1a6968b90d9d461e9a2ece12b465486e3ccc2 | /ec2_write_1/route-table_delete.py | bfb1a78ebfb2bfbaf6ac1d06ffec84059302e827 | [] | no_license | https://github.com/lxtxl/aws_cli | c31fc994c9a4296d6bac851e680d5adbf7e93481 | aaf35df1b7509abf5601d3f09ff1fece482facda | refs/heads/master | 2023-02-06T09:00:33.088379 | 2020-12-27T13:38:45 | 2020-12-27T13:38:45 | 318,686,394 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #!/usr/bin/python
# -*- codding: utf-8 -*-
import os
import sys
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
from common.execute_command import write_one_parameter
# url : https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/delete-route-table.html
if __name__ == '__ma... | UTF-8 | Python | false | false | 1,306 | py | 3,596 | route-table_delete.py | 3,594 | 0.686064 | 0.676876 | 0 | 26 | 49.038462 | 128 |
J-Pai/408DaisyJetson | 1,735,166,815,570 | 89ef5193ee265e22e2c4386e82a93a56dda47c42 | 12af2534582974d8f07ccde9deda54e4d8967a73 | /tests/pure_face_tracking.py | e89753a08f5c6f06d3fad38c5c20bb8818c9b58d | [
"MIT"
] | permissive | https://github.com/J-Pai/408DaisyJetson | 853d8a1f3b0f0350128f149295a150b360bd3008 | a873154325c790303f09ecfc03377066751cd601 | refs/heads/master | 2021-01-24T00:04:30.947233 | 2019-08-29T21:50:15 | 2019-08-29T21:50:15 | 122,752,585 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #!/usr/bin/env python3
import numpy as np
import cv2
import face_recognition
import sys
from multiprocessing import Queue
from multiprocessing.managers import SyncManager
from queue import Queue as ImageQueue
from pylibfreenect2 import Freenect2, SyncMultiFrameListener
from pylibfreenect2 import FrameType, Registrati... | UTF-8 | Python | false | false | 3,881 | py | 12 | pure_face_tracking.py | 10 | 0.679979 | 0.651121 | 0 | 140 | 26.707143 | 99 |
hglasser/phonebook-app | 5,076,651,379,539 | ea43b518c046b404e0da002ff7e1cf92b02fb659 | cc3bb2bf5dd9d20c3b7976a803313bd723d46ccd | /set_an_entry.py | 0f84d7707926c8971578953026ac7c1456175214 | [] | no_license | https://github.com/hglasser/phonebook-app | e7bab09b34e7cdffcd39d7abc13d847f84feaf8d | a49c8a03140de735fac84fb75c6653f17d8e8405 | refs/heads/master | 2020-03-22T05:57:24.027367 | 2018-07-09T13:24:30 | 2018-07-09T14:27:08 | 139,602,203 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | def set_an_entry(phonebook):
name = raw_input("Name: ")
phone_number = raw_input("Enter phone number formatted like this ###-###-####: ")
phonebook[name] = phone_number
return "Entry stored for %s" % name | UTF-8 | Python | false | false | 220 | py | 8 | set_an_entry.py | 7 | 0.631818 | 0.631818 | 0 | 5 | 43.2 | 85 |
ProkopHapala/SimpleSimulationEngine | 180,388,669,678 | ae192ac14dcb97fbb19fc7959b83ae087b52a8b4 | 07e6fc323f657d1fbfc24f861a278ab57338b80a | /python/pySimE/space/exp/pykep/lambert_Prokop.py | a9901e407553f656542150e379af6b6744fa6025 | [
"MIT"
] | permissive | https://github.com/ProkopHapala/SimpleSimulationEngine | 99cf2532501698ee8a03b2e40d1e4bedd9a12609 | 47543f24f106419697e82771289172d7773c7810 | refs/heads/master | 2022-09-05T01:02:42.820199 | 2022-08-28T10:22:41 | 2022-08-28T10:22:41 | 40,007,027 | 35 | 4 | null | null | null | null | null | null | null | null | null | null | null | null | null |
import numpy as np
import matplotlib as mpl
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from PyKEP import epoch, DAY2SEC, planet_ss, AU, MU_SUN, lambert_problem
from PyKEP.orbit_plots import plot_planet, plot_lambert
mpl.rcParams['legend.fontsize'] = 10
fig = plt.figure()
a... | UTF-8 | Python | false | false | 1,376 | py | 1,233 | lambert_Prokop.py | 875 | 0.621366 | 0.579942 | 0 | 55 | 22.945455 | 81 |
Muele93/Ndivhu | 16,338,055,628,387 | 6851cdc6e99a5c8cd429a19561186adeddb42896 | 0924cd1386c59dc746196b9a01a8dd817c9fc9cd | /Ndifunc/recursion.py | 02d03a179305c11d2e7e1c28e5593d57901f292c | [] | no_license | https://github.com/Muele93/Ndivhu | 2ef79771d6d3328bdb282dd10d8f2802754a3619 | 80c18b2c4f58bc25c59360eeeb7bfa6a62d44c47 | refs/heads/master | 2020-04-30T23:25:09.460560 | 2019-07-02T13:00:59 | 2019-07-02T13:00:59 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | def sum_array(array):
"""funtion returns the sum of all items in array"""
x= len(array)
if x == 1:
return array[0]
else:
return array[0] + sum_array(array[1:],)
def fibonacci(n):
""""Returns the nth term in a fibonacci sequence when n==0 and n==1"""
if n==0 or n==1:
re... | UTF-8 | Python | false | false | 918 | py | 6 | recursion.py | 3 | 0.600218 | 0.579521 | 0 | 36 | 24.5 | 98 |
fbartusch/travellingSalesperson | 2,216,203,154,597 | 5855d33f13431a9b0fdfb5ffa75d9c852d7196e3 | 12151fd50e483a8a68594eb795f7bc83d4e0a3ca | /tests/test_tspsolver.py | db92de8ea86a2b4f48d1e5ccb9eba91b0b264212 | [
"MIT"
] | permissive | https://github.com/fbartusch/travellingSalesperson | ece0b2abdedf777125aaa959a3f9ebb13eee25c7 | 94d8245a08b5c17612d00d8e4704bb08f595fc1c | refs/heads/master | 2022-11-13T23:07:52.911235 | 2020-07-02T20:01:33 | 2020-07-02T20:01:33 | 275,645,328 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from unittest import TestCase
import numpy as np
from tsp.tspsolver import NaiveTSPSolver
from tsp.tspsolver import NearestNeighbor
from tsp.tspsolver import Christofides
class TestTSPSolver(TestCase):
def __init__(self, *args):
super().__init__(*args)
# From: https://people.sc.fsu.edu/~jburkard... | UTF-8 | Python | false | false | 1,185 | py | 6 | test_tspsolver.py | 5 | 0.564557 | 0.504641 | 0 | 36 | 31.916667 | 74 |
gistable/gistable | 17,411,797,444,224 | 9ec3489c240813c984ad94fea4c0c5a8a07e8818 | 255e19ddc1bcde0d3d4fe70e01cec9bb724979c9 | /dockerized-gists/55c132a1941254e9ba899cbb28db8327/snippet.py | 61ec914bf1f4e288d229a009547a5cf7088e9510 | [
"MIT"
] | permissive | https://github.com/gistable/gistable | 26c1e909928ec463026811f69b61619b62f14721 | 665d39a2bd82543d5196555f0801ef8fd4a3ee48 | refs/heads/master | 2023-02-17T21:33:55.558398 | 2023-02-11T18:20:10 | 2023-02-11T18:20:10 | 119,861,038 | 76 | 19 | null | false | 2020-07-26T03:14:55 | 2018-02-01T16:19:24 | 2020-07-19T04:11:52 | 2018-03-19T15:12:34 | 12,234 | 64 | 16 | 1 | Python | false | false | """Python switch-statement pseudo-implementation
Mimics C-style switch statements
The following code blocks should be equivalent
-----------------------------------------------
switch(arg):
case 1:
// Handle case
case 2:
// Handle case
default:
// Handle default case
----------------... | UTF-8 | Python | false | false | 1,959 | py | 7,080 | snippet.py | 7,021 | 0.54926 | 0.529862 | 0 | 65 | 29.153846 | 63 |
sleao/ex_fastapi | 14,508,399,575,477 | f8d9a9965890bd2369975090861840129791648c | 3658eeaaa4906d44e11ad894af61534513dabb64 | /app/api/api_v1/endpoints/example.py | bbcaa03e383e22d2be4852b44cfe0ebb32f71c43 | [] | no_license | https://github.com/sleao/ex_fastapi | 8a95c043e5b3c77081256d28449f93a9b43f7a05 | 71459182eeccb4f0cf06cd881ce48a3083fbc9b4 | refs/heads/master | 2023-05-31T13:00:37.161891 | 2020-07-24T13:11:50 | 2020-07-24T13:11:50 | 282,109,949 | 1 | 0 | null | false | 2021-06-11T18:14:33 | 2020-07-24T03:08:01 | 2021-06-02T13:40:26 | 2021-06-11T18:14:32 | 7 | 1 | 0 | 4 | Python | false | false | from fastapi import APIRouter
from app.schemas import echo, hello
router = APIRouter()
@router.get('/hello', response_model=hello.Hello)
def hello_world():
return {'msg': 'Hello World'}
@router.post('/echo', response_model=echo.Echo)
def echo(msg_in: echo.Echo):
return {'msg': echo} | UTF-8 | Python | false | false | 295 | py | 7 | example.py | 5 | 0.701695 | 0.701695 | 0 | 13 | 21.769231 | 49 |
dragos-vacariu/Python-Exercises | 9,964,324,165,603 | 4692baa04d679ea559dd9cb93e41b121657c7499 | 9b262e9b291902abd7fa567a2edf50799c7952ac | /Basic Practice/program18 distance between circle point.py | b3513f720ef75b718ed5542e2f60e237e6ed8255 | [] | no_license | https://github.com/dragos-vacariu/Python-Exercises | 983ad571879cb24f9ae29f67d57adb94356bf1b1 | 1578cfb973409f40aa658fe59d967861eac6b070 | refs/heads/master | 2021-06-13T17:37:52.624589 | 2021-04-22T16:18:22 | 2021-04-22T16:18:22 | 172,189,766 | 0 | 2 | null | null | null | null | null | null | null | null | null | null | null | null | null | #clasa PUNCT cu 2 parametri x, y
#clasa CERC mosteneste PUNCT, si defineste o raza
#CERC are o metoda de calculul a ariei
class PUNCT:
#constructor
def __init__(self, xCoord, yCoord):
self.x=xCoord #non-static field
self.y=yCoord #non-static field
#public method
def calculateDistance(s... | UTF-8 | Python | false | false | 4,421 | py | 72 | program18 distance between circle point.py | 64 | 0.62271 | 0.612079 | 0 | 148 | 28.871622 | 96 |
Jirapongs55/CP3-Jirapong-Sirichottanawong | 12,515,534,751,432 | 0946c9e920fcd155dce100e652265b623c7e465c | a0bee93fa987d2ac5f7f8e4f830b5e8965326f52 | /Exercise11_Jirapong_S.py | 6cb8717ac8746253ed98af6801794a785b9abdc7 | [] | no_license | https://github.com/Jirapongs55/CP3-Jirapong-Sirichottanawong | 563bd855c31d77deb8b789a77b4cd5fccba094ca | 6ddbba0b4724cfe5fce7414d6850a440acf58d61 | refs/heads/main | 2023-07-09T03:45:28.207272 | 2021-08-09T15:06:50 | 2021-08-09T15:06:50 | 384,119,133 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | inputNumber = int(input("Input the pyramid level : "))
blankText = " "
text = input("Input the character for pyramid monomer : ")
for i in range(inputNumber):
print(blankText*(inputNumber-(i+1)),end=text*((2*i)+1))
print(blankText*(inputNumber-(i+1)))
print("-"*12,"The End","-"*12)
'''
# Pattern
print(" "*2,en... | UTF-8 | Python | false | false | 471 | py | 16 | Exercise11_Jirapong_S.py | 14 | 0.518047 | 0.488323 | 0 | 17 | 23.588235 | 59 |
LillyParker/Python_ExercisesNMNH | 9,612,136,855,826 | 01a8c08695a24f51467fcdcff90270287993eabe | 6faa1e9b3e5a149a0081b9387407bdb30ce72ef2 | /Week2Hmwk_calculator.py | 40482ac3b25d2075cea53e2d36c128090ce53f9e | [] | no_license | https://github.com/LillyParker/Python_ExercisesNMNH | 648d8647c63bb9f3769db40fbee0f03419a50c62 | 41a6d21e188a45f3f8ec7b98546de4ee38bb7008 | refs/heads/master | 2021-01-19T03:35:04.862394 | 2016-07-31T22:00:46 | 2016-07-31T22:00:46 | 63,359,777 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # Homework for Week2 of the Python course at NMNH
# Assignment: Make a program that will perform addition, subtraction, division or multiplication of two numbers. Use appropriate error messages.
print("Welcome to the calculator!","\nPlease enter two numbers, followed by the operator to use.")
try:
response1 = input(... | UTF-8 | Python | false | false | 1,169 | py | 6 | Week2Hmwk_calculator.py | 4 | 0.714286 | 0.686056 | 0 | 32 | 35.375 | 144 |
aegiacometti/netconf-backup | 7,086,696,075,229 | cf25934a294747155a97b9b8614d5f493c747282 | 86cf7b195564849ea73a405f32eaa732495d367a | /scripts/netconf-backup-f5.py | a6160a18d4041b2b493bff533ee5a0c61bebb207 | [
"Apache-2.0"
] | permissive | https://github.com/aegiacometti/netconf-backup | 10a26ba403dcaca3b9a434c56016df44f5913e2f | f0a890f8ba614a3fe33e6408665dac60fcbbab4c | refs/heads/master | 2021-03-16T15:13:42.035759 | 2020-10-22T13:21:20 | 2020-10-22T13:21:20 | 246,919,449 | 1 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | import sys
import time
import glob
import os
device_hostname = sys.argv[1]
historic_files_to_keep = sys.argv[2]
def remove_old_files():
list_files = glob.glob('./backups/{}*'.format(device_hostname))
if len(list_files) >= int(historic_files_to_keep):
list_files.sort()
for index in range(int(... | UTF-8 | Python | false | false | 736 | py | 11 | netconf-backup-f5.py | 3 | 0.634511 | 0.629076 | 0 | 30 | 23.533333 | 77 |
BrenoBaiardi/GSC | 10,943,576,675,657 | 602a7541fc08fde5a9fb7a81b5cf6dc85934de37 | 937c24b2d1df5731ed76d0254d7a8de495bfdd34 | /test_GSC.py | c90369b9c32e6704c9c06a3a24cd80dafeafd100 | [] | no_license | https://github.com/BrenoBaiardi/GSC | b3bdab288ecf4b88f5ce9ff22652d6d9a16bb62c | cd713e0925eebcd78242e319a17dd01d031667ce | refs/heads/master | 2020-07-01T23:03:35.391405 | 2019-08-08T21:05:55 | 2019-08-08T21:05:55 | 201,334,224 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # O sistema dos correios de Gotham City tiveram um problema e perderam seu validador de CEPs. Hoje, sua missão é criar um validador de CEPs baseados em algumas pequenas regras listadas abaixo:
#
# 1. O CEP é um número maior que 100.000 e menor que 999999
# 2. O CEP não pode conter nenhum nenhum dígito repetitivo altern... | UTF-8 | Python | false | false | 2,764 | py | 3 | test_GSC.py | 3 | 0.650909 | 0.599273 | 0 | 78 | 34.25641 | 192 |
vaibhavkollipara/URLShortener | 9,423,158,290,217 | 407b664999c2082c04f01709a0263b9e5fc0d6c2 | 626b4425852f5de011008b09bfda787133fd3e95 | /shortener/models.py | 5a2bae4e50825f00b57dcd1f69fb0c632ee4a95e | [] | no_license | https://github.com/vaibhavkollipara/URLShortener | ea789ac9a13354957fbe163a71a59acc52624bf9 | ac5ed774e02f962177fb7b1ee1a93f9869e83c7c | refs/heads/master | 2021-01-18T16:39:10.677863 | 2017-04-06T21:26:08 | 2017-04-06T21:26:08 | 86,754,016 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from django.db import models
from .utils import create_shortcode
from django.conf import settings
SHORTCODE_MAX = getattr(settings, "SHORTCODE_MAX",15)
class ShortURLManager(models.Manager):
def all(self,*args,**kwargs):
qs_main = super(ShortURLManager,self).all(*args,**kwargs)
qs = qs_main.filt... | UTF-8 | Python | false | false | 1,396 | py | 11 | models.py | 8 | 0.594556 | 0.588825 | 0 | 49 | 27.510204 | 65 |
wenshixiaoying/chapter7 | 3,908,420,283,988 | 5ba046d70ebc4dda8fe32b0919ab56b7c51d5ca1 | b315b0ee1ba44402c03035ca90c78e0cc3f1d3f1 | /modules/environment.py | bb4823618ef984522e3215b0a926df5970033e2a | [] | no_license | https://github.com/wenshixiaoying/chapter7 | c46717662635a89c0b0323141619eba540aaae7f | 82398e59eff845558e56dbacc4e3f92b00810c19 | refs/heads/master | 2023-02-02T17:03:25.409530 | 2020-12-21T11:26:03 | 2020-12-21T11:26:03 | 322,233,563 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #!/usr/bin/python3
#-*- coding: utf-8 -*-
import os
#返回木马所在主机的环境变量
def run(**kwargs):
print('This is environment module')
return str(os.environ)
| UTF-8 | Python | false | false | 181 | py | 3 | environment.py | 2 | 0.658065 | 0.645161 | 0 | 9 | 16.222222 | 39 |
luispedro/mahotas | 13,357,348,321,177 | 0d6a3fd3e72850d6ed26fbd7cf542f62f91dc23d | 829a7b38243821a1d3f274952fd7c4e5140c9f40 | /mahotas/edge.py | 18fbbee69a075d1035e39eb75e0ff13b24d01f19 | [
"MIT",
"BSL-1.0"
] | permissive | https://github.com/luispedro/mahotas | e6f9c1e21acaded80946ebf8b1c0366cbcd91d2f | f7edeb22a4b47e6c5200c008a8e7386067d72443 | refs/heads/master | 2023-08-23T22:38:05.018281 | 2023-06-09T12:57:00 | 2023-06-09T22:11:37 | 495,613 | 648 | 175 | NOASSERTION | false | 2023-05-26T18:46:28 | 2010-01-31T00:13:06 | 2023-05-15T13:09:07 | 2023-04-29T05:36:35 | 3,965 | 800 | 154 | 24 | Python | false | false | # -*- coding: utf-8 -*-
# Copyright (C) 2008-2014, Luis Pedro Coelho <luis@luispedro.org>
# vim: set ts=4 sts=4 sw=4 expandtab smartindent:
#
# License: MIT (see COPYING file)
from __future__ import division
import numpy as np
import mahotas as mh
from . import convolve, gaussian_filter
_hsobel_filter = np.array([
... | UTF-8 | Python | false | false | 5,678 | py | 160 | edge.py | 121 | 0.544382 | 0.521486 | 0 | 160 | 34.3 | 101 |
s-kyum/Python | 15,058,155,376,638 | f00d834a9033871d6e2e123e845479c0de705c18 | 27fc04a95b0d268adef4d4497c27ea9ae295d8a4 | /ch02/calcu.py | 47c677978bd91b50f959944e2d24735f47abff80 | [] | no_license | https://github.com/s-kyum/Python | 2b35b333557db0698a3fd305d550baaa5304f206 | e5b31036acd2bfb79f98ff02d59096a2429eb41f | refs/heads/master | 2023-07-09T18:45:26.179057 | 2021-08-23T03:07:57 | 2021-08-23T03:07:57 | 378,803,615 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #산술 연산자
print("7+4=",7+4)
print("7-4=",7-4)
print("7*4=",7*4)
print("7/4=",7/4)
print("7%4=",7%4)
print("7//4=",7//4) #몫
print("7**4=",7**4) #제곱
| UTF-8 | Python | false | false | 162 | py | 101 | calcu.py | 95 | 0.486301 | 0.294521 | 0 | 9 | 15.222222 | 23 |
Silentsoul04/FTSP_2020 | 9,405,978,385,334 | 31a4b5eaf14f1b5f16068cd1c527d2229da270b8 | c3d0a0b6336a3ff73724fe1615eb1809dbdaaed8 | /Forsk Pandas/baltimore.py | 9cc6cda3afb6fa44620494517d06203ed8625c01 | [] | no_license | https://github.com/Silentsoul04/FTSP_2020 | db0dae6cd9c371f3daa9219f86520dfa66348236 | 7e603af918da2bcfe4949a4cf5a33107c837894f | refs/heads/master | 2022-12-21T20:44:32.031640 | 2020-09-20T12:29:58 | 2020-09-20T12:29:58 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 2 18:01:43 2020
@author: Rajesh
"""
"""
Code Challenge
Name:
Baltimore City Analysis
Filename:
baltimore.py
Problem Statement:
Read the Baltimore_City_Employee_Salaries_FY2014.csv file
and perform the following task :
0. remove the dollar s... | UTF-8 | Python | false | false | 4,541 | py | 553 | baltimore.py | 450 | 0.590399 | 0.506276 | 0 | 162 | 26.876543 | 111 |
ronrest/deepQ_bananas | 17,566,416,275,950 | 9cc61b6dbf345cd5b710ece8fee67627a7e5c0d8 | 5fff6e387f47b564c8b3d214af459c72553e6eb2 | /model.py | 41b66330a2a2fb450c7cd2649701a397fbc5e72b | [] | no_license | https://github.com/ronrest/deepQ_bananas | 63a4ba9007d9f0a9f65587c3a8caceab0ea4eeca | 0ec3965140bcf399a209d63c9137ce65d5fb55a2 | refs/heads/master | 2020-03-27T11:41:45.220679 | 2018-08-28T20:41:29 | 2018-08-28T20:41:29 | 146,502,670 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
class QNetwork(nn.Module):
""" A neural network that represents the Q-action values for a
reinforcement learning agent.
Two fully connected hidden layers, with ReLu activations, followed by
a fully connected output layer.
... | UTF-8 | Python | false | false | 1,402 | py | 8 | model.py | 5 | 0.624108 | 0.617689 | 0 | 34 | 40.235294 | 91 |
AllenInstitute/bmtk | 7,980,049,266,364 | f13e67d855a181fd9f3a60adfe3b1b1a06af8c99 | d813a392c7cbc8dbbec273b3a2366a50f9df45c9 | /bmtk/utils/sonata/group.py | 589d5a6a8ba264783c0e20a106a65529e5436f62 | [
"BSD-3-Clause"
] | permissive | https://github.com/AllenInstitute/bmtk | 1496d6e0bd7cbef7b1b8cac64a8589d01548f897 | ae9c24c415a3fbd60397b4ead160b72b4b3e4e4f | refs/heads/develop | 2023-08-24T20:09:32.763686 | 2023-08-20T18:29:19 | 2023-08-20T18:29:19 | 104,507,294 | 253 | 111 | BSD-3-Clause | false | 2023-08-24T14:38:57 | 2017-09-22T18:42:44 | 2023-08-14T14:51:54 | 2023-08-24T13:29:55 | 201,704 | 239 | 79 | 37 | Python | false | false | # Copyright 2017. Allen Institute. All rights reserved
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
# following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the follow... | UTF-8 | Python | false | false | 19,742 | py | 625 | group.py | 329 | 0.625975 | 0.622581 | 0 | 457 | 42.199125 | 120 |
itdream-dev/python | 13,374,528,198,069 | b703be32bf63e0b44cc06559ad5e182fae9754cb | 079c07c5d97eb60d36269e27309e84b25ea0aaeb | /guidehero-backend/lib/models/answer.py | 8a8bf5de12fd00b9b80792ab04d4528620647756 | [] | no_license | https://github.com/itdream-dev/python | 3aa44329673f05e2a86e1cba56cb88101c777233 | eda81b802b99f45933bdf0d22b508837cfa538f0 | refs/heads/master | 2023-03-05T12:27:42.776870 | 2020-05-11T15:54:45 | 2020-05-11T15:54:45 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # -*- coding: utf-8 -*-
from tag import Tag # NOQA
from lib.registry import get_registry
db = get_registry()['DB']
relationship_table = db.Table(
'answer_association',
db.Column('tag_id', db.Integer, db.ForeignKey('tag.id')),
db.Column('answer_id', db.Integer, db.ForeignKey('answer.id'))
)
class Answe... | UTF-8 | Python | false | false | 532 | py | 221 | answer.py | 194 | 0.657895 | 0.650376 | 0 | 20 | 25.6 | 66 |
MBMunzi/Math_Algorithm | 4,750,233,871,073 | 6b923be428214cc757a10072a284b8662aa4c3a1 | 5668fc337f2365f3b5cf1efb98ba7d975ed5da20 | /Test.Polynomial.py | 279ae69a70405b794248fd7aa03a3ed26cdf101e | [] | no_license | https://github.com/MBMunzi/Math_Algorithm | c65a2d0698820301c8b3d6e06cf982227762a2f6 | 8f46c3c91535504fded01c13ce5f2d059ef8e878 | refs/heads/master | 2020-09-25T09:38:35.439611 | 2020-03-17T20:02:36 | 2020-03-17T20:02:36 | 225,976,873 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import unittest
from .Polynomio import Polynomial
class TestPolynomial(unittest.TestCase):
def test_evaluate_roots_about_polynomial(self):
roots = [-3.0, -2.0, 1.0]
self.assertEqual(roots, Polynomial([1, 4, 1, -6]))
def test_Evaluate_Polynomial(self):
self.assertEqual(0, Polynomial.e... | UTF-8 | Python | false | false | 394 | py | 2 | Test.Polynomial.py | 2 | 0.654822 | 0.624365 | 0 | 16 | 23.5 | 62 |
victor-nerd/finansez-python | 17,875,653,900,137 | bb962265c165fec97c34d6ab7c983d0a8f47a1d4 | b6b4a0f011f9fadcde3a800e73e0afbf2377ad79 | /finansez/finansez/api/serializers/category_view.py | 6ebf682e49a9649a0e10f3fa10ecb2c1d810b919 | [] | no_license | https://github.com/victor-nerd/finansez-python | c65a3a3369665176c8bd56ad993c9f0a9af78b41 | 48f83fc34d5ef534551f31c70c79e96e50ae2a74 | refs/heads/master | 2019-04-07T11:32:55.586359 | 2017-04-01T08:15:17 | 2017-04-01T08:15:17 | 86,661,342 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from rest_framework import serializers
from rest_framework.exceptions import ValidationError
from rest_framework.fields import empty
from finansez.api.responses.category_info import CategoryInfoResponse
from finansez.api.serializers.base import BaseApiSerializer
from finansez.core.models import Category
class Catego... | UTF-8 | Python | false | false | 1,020 | py | 90 | category_view.py | 77 | 0.729927 | 0.729927 | 0 | 26 | 35.846154 | 115 |
dr-dos-ok/Code_Jam_Webscraper | 7,997,229,131,612 | 9b6826e35989d84b628504b9d0e073131df53c2a | 15f321878face2af9317363c5f6de1e5ddd9b749 | /solutions_python/Problem_43/14.py | 96aa39bf1ca67c879035913bde0bf7096e818b9f | [] | 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 | execfile('utils.py')
def process(fn):
cases = [x.strip() for x in read1(fn)[1:]]
res = [processCase(x) for x in cases]
write2(fn+".out",res)
def processCase(case):
scase = set(case)
base = len(scase)
lencase = len(case)
res = 0
if base == 1:
base = 2
dig... | UTF-8 | Python | false | false | 597 | py | 60,747 | 14.py | 60,742 | 0.500838 | 0.482412 | 0 | 28 | 19.321429 | 49 |
Bikashbhaila/mycode | 16,844,861,745,760 | 6b4315768d7faa0acbfa75a4142351aaa32ac660 | cc4b04c90f9546f734efb938c5a4d6694b2f4b84 | /FizzBuzz/fizz_buzz01.py | 0db8d99df5e07c9bfd4ea868cf41df79b0536962 | [] | no_license | https://github.com/Bikashbhaila/mycode | f87befdca556c06815e8815c466c5f667a7f780b | cd82fb965f1c26480a07921ab391415919b27013 | refs/heads/main | 2023-07-10T16:15:11.907952 | 2021-08-13T21:01:54 | 2021-08-13T21:01:54 | 392,015,300 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #!/usr/bin/env python3
def readFile():
with open("numfile.txt", "r") as input_file:
numlist = []
for num in input_file:
numlist.append(int(num))
return numlist
def playGame(numlist):
fizz, buzz, fizzbuzz = 0, 0, 0
for num in numlist:
if num % 3 == 0 and num % 5 ... | UTF-8 | Python | false | false | 714 | py | 25 | fizz_buzz01.py | 22 | 0.483193 | 0.462185 | 0 | 31 | 22.032258 | 66 |
sala0320/Algorithm | 13,615,046,328,710 | b4e074fb1b50cc816971e7daff5823637235a6d8 | 75730862a05fe5f53655f784f299c542d9c55c37 | /BFS+DFS/BackJoon/1520.py | 32926ad64d601fc318798bfd321a5ca8c09a852b | [] | no_license | https://github.com/sala0320/Algorithm | 630404c0f053b0e87c0a16804245fa836a24e29b | c4abc8070b7e9c4cbee7e691b4e80c07efce0f3d | refs/heads/main | 2023-04-21T08:04:55.565437 | 2022-02-25T05:27:31 | 2022-02-25T05:27:31 | 365,438,662 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #DFS + DP
import sys
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
M, N = map(int, input().split())
board = [list(map(int, input().split())) for _ in range(M)]
dir = [[1,0], [0,1], [-1,0], [0,-1]]
dp = [[-1 for _ in range(N)] for _ in range(M)]
def dfs(x, y):
#끝점에 도달하면 1 반환(끝점에서 끝점까지 갈 수 있는 길은 하나니까)
... | UTF-8 | Python | false | false | 1,014 | py | 136 | 1520.py | 122 | 0.467312 | 0.438257 | 0 | 30 | 26.566667 | 77 |
tedrepo/go_bot | 16,338,055,601,612 | 830de61f6f095c8483fe03bca2f0e3675a33e5aa | f4406f32e727707cc787212520dd952f73afdcc7 | /slotfill.py | 0987323ede680629fe1554f39bb75b9e854c2434 | [] | no_license | https://github.com/tedrepo/go_bot | 3256b8c53e7f962bad801a9797587e10341d2a8a | 3f02f189346c0a8011c64b2a6ce25c65baf1e574 | refs/heads/master | 2020-03-28T03:47:27.421768 | 2018-09-09T12:18:44 | 2018-09-09T12:18:44 | 147,671,447 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | # -*- coding: utf-8 -*-
import json
from fuzzywuzzy import process
from overrides import overrieds
from math import exp
from collections import defaultdict
class DstcSlotFillingNetwork():
"""
"""
def __init__(self, threshold=0.8, **kwargs):
self.threshold = threshold
self.load()
def ... | UTF-8 | Python | false | false | 3,650 | py | 20 | slotfill.py | 19 | 0.532877 | 0.526575 | 0 | 107 | 33.093458 | 82 |
zhanglei1949/AttackSpeakerVerificationSystem | 11,175,504,908,020 | 3c2f3cc8b9708fd532a90c06d1019c6f43ea5728 | 56aba02e07581eb3de286fe361d3e590af5aee03 | /utils/copy_vad_clip.py | 4207858e078eff899d351e19d4ca4f2247af551a | [] | no_license | https://github.com/zhanglei1949/AttackSpeakerVerificationSystem | 51daf281a7fe9b919fd6ef85703a3ef0a2e664c9 | e698dec73132b420b16beb3ae544fe3eaffdddb8 | refs/heads/master | 2020-06-13T01:02:34.452105 | 2019-08-01T06:46:42 | 2019-08-01T06:46:42 | 194,480,818 | 5 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import glob
import numpy as np
import os
import soundfile
import sys
sys.path.append('../speakerVerificationSystem/')
from pre_process import read_audio
import constants as c
def VAD_and_save(source_path, target_path, target_len = 25840):
# do vad
audio = read_audio(source_path) # vad doneinside
if (len(... | UTF-8 | Python | false | false | 1,653 | py | 66 | copy_vad_clip.py | 30 | 0.61222 | 0.595886 | 0 | 52 | 30.788462 | 72 |
nilankh/LeetCodeProblems | 12,446,815,238,888 | 9d136cd73bb4c51c917d7f8f8cb86f7d1f51132d | 46dacdcbaca4f1a3eeb6cc69aba7f37460673200 | /Queue/QueueUsingTwoStacks#232.py | 42aee906279af3445f109e99d7d4fd078a2f23b5 | [] | no_license | https://github.com/nilankh/LeetCodeProblems | 668bcdc9736d89898fc39082f5271391d5e27395 | 3594ea53ccc9de69edfbc67e6eab6e3b20959f4d | refs/heads/master | 2023-06-24T13:09:45.809535 | 2021-07-22T16:36:12 | 2021-07-22T16:36:12 | 266,919,021 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #232
class QueueUsingTwoStacks:
def __init__(self):
self.__s1=[]
self.__s2=[]
def enqueue(self,data):
#(O(n))
while(len(self.__s1)!=0):
self.__s2.append(self.__s1.pop())
self.__s1.append(data)
while(len(self.__s2)!=0):
self.__s1.append(s... | UTF-8 | Python | false | false | 841 | py | 134 | QueueUsingTwoStacks#232.py | 134 | 0.485137 | 0.449465 | 0 | 47 | 16.702128 | 45 |
mdrohmann/txtemplates | 16,904,991,315,209 | 2c4e48653d564ab41273c9abe2a60f113c5ccf79 | b4687bd0817c6d00d8afde2721102416462cd73f | /tests/server_templates/test_server_templates.py | fd392113ed8a233092ec762e2013eaf4c2b6b26c | [] | no_license | https://github.com/mdrohmann/txtemplates | a8818b5213c38f1d27d497e3578129d07f764c06 | b346b15d3eb465ec828a31fea0a00df3ae582942 | refs/heads/master | 2020-06-02T21:37:31.690441 | 2015-04-21T16:00:41 | 2015-04-21T16:00:41 | 40,129,367 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # encoding: utf-8
import os
import argparse
import sys
import re
import pytest
from txtemplates import server_templates
import txtemplates
def test_get_parser_error(capsys):
parser = server_templates.get_parser()
with pytest.raises(SystemExit):
parser.parse_args([])
_, err = capsys.readouterr()
... | UTF-8 | Python | false | false | 3,487 | py | 53 | test_server_templates.py | 45 | 0.658159 | 0.657012 | 0 | 107 | 31.588785 | 78 |
haka913/programmers | 6,313,601,944,888 | ba5056e8cb541938e5f4463209523bc333afff21 | 0c95ba47207f85f1d0d8a500f174f459226695f3 | /p_3_단속카메라.py | ddb950a9dddb6be1497ea9c8afecae97646a185a | [] | no_license | https://github.com/haka913/programmers | 31cf37117ce220e3992ff2f3cb5a4c59f280c457 | 2cee9ef1a77fb7fe8a1b6aa738485720efafc254 | refs/heads/master | 2022-12-04T14:40:00.993494 | 2020-09-02T12:48:30 | 2020-09-02T12:48:30 | 255,633,491 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | def solution(routes):
routes.sort()
cam = 30000
answer = 0
for route in reversed(routes):
if cam > route[1]:
answer += 1
cam = route[0]
return answer
print(solution(routes=[[-20, 15], [-14, -5], [-18, -13], [-5, -3]]))
| UTF-8 | Python | false | false | 275 | py | 82 | p_3_단속카메라.py | 82 | 0.498182 | 0.418182 | 0 | 14 | 18.642857 | 68 |
vivekshah1801/Python-RPC-Demo | 9,904,194,634,430 | dcf9ffd7491cd6dcd51b3ddcf3e64d46bde58296 | 08cb94509796aae2a8b0ed4fd28bd51801ef157a | /client.py | 491d1c6d24268d5817a330f58dd44c52030d8f3a | [] | no_license | https://github.com/vivekshah1801/Python-RPC-Demo | 3f1e85fd18220aa24f11bb7485bddec91761d7a2 | 4dcd569c6c0cee634b43922f2a141a573fbfdb59 | refs/heads/master | 2022-12-11T05:24:50.142356 | 2020-08-31T05:04:08 | 2020-08-31T05:04:08 | 291,620,497 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import rpyc
host = "localhost"
port = 9876
r = rpyc.connect(host, port).root
print(r)
print(r.helloworld())
print("Done") | UTF-8 | Python | false | false | 125 | py | 3 | client.py | 2 | 0.688 | 0.656 | 0 | 11 | 10.454545 | 33 |
thohajati/scard-login | 4,209,067,982,147 | 10ebeb1e39f6a5659547b4a162ca14705268be89 | 2d8b7f7f5d59005966b7802089a5f6f6ba8fee03 | /SCardLogin_test.py | 3f71d8099f0a52c1709977be4f30c9e767910cb0 | [] | no_license | https://github.com/thohajati/scard-login | b1f9d37f80e94d0f4c50b3cc9e923e4d4e262149 | 04afa1e6bc981bd5e6faf74459005949ba768c38 | refs/heads/master | 2021-01-19T16:42:50.552786 | 2017-08-21T07:43:44 | 2017-08-21T07:43:44 | 101,021,172 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import SCardLogin
if __name__ == '__main__':
dict = {}
print("Insert your card!")
dict = SCardLogin.get_scard_login()
print(str(dict))
| UTF-8 | Python | false | false | 227 | py | 5 | SCardLogin_test.py | 3 | 0.387665 | 0.387665 | 0 | 8 | 19.625 | 43 |
devjaynemorais/tcc_gen_figures | 5,729,486,418,889 | 3dad758e817bc40522f5e92a650c2d9e47733873 | 287df5ff9d3f3384af2c9bb33126caf1df558858 | /bin/countstrategies.py | e9e1ec316fbb84703bd6186996456718ec2beaa6 | [] | no_license | https://github.com/devjaynemorais/tcc_gen_figures | eba58a6453c1f2a277ae0f79684c94c834f12cf5 | 07a1f7d0a060e797749926446546608a3bb14788 | refs/heads/master | 2022-07-07T19:22:02.479523 | 2020-05-12T00:27:55 | 2020-05-12T00:27:55 | 263,218,044 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # -*- coding: utf-8 -*-
import sys
import pandas as pd
from importlib import reload
reload(sys)
# Classe que contem todas as estrategias
# de contagem de acertos
class EstrategiasDeContagem:
def __init__(self):
self.pond_df = pd.read_csv(
'data/medidas_ponderadas.csv', encoding='utf-8', sep='... | UTF-8 | Python | false | false | 5,815 | py | 10 | countstrategies.py | 5 | 0.573001 | 0.556836 | 0 | 134 | 42.298507 | 154 |
doublevcodes/pyformatter | 16,853,451,672,749 | bc67a2474975ea4518c4cc1e4bb20392cf9f3b74 | 9738536bad6e3c7644ea99c0bae2ce8b41535ed1 | /formatter/pep8/statement/comparisons.py | 0df1d4ce8dbe777c8efb0ff47c6b71c1b91456b5 | [] | no_license | https://github.com/doublevcodes/pyformatter | 7788518dfda49d5d974b851ba9682ac5c8850df4 | 1a061c071e66b90cc4e7f1fd2ce11b3754729ad5 | refs/heads/master | 2023-06-23T07:29:15.691694 | 2021-07-21T16:05:01 | 2021-07-21T16:05:01 | 387,006,646 | 0 | 0 | null | false | 2021-07-18T23:45:35 | 2021-07-17T17:59:57 | 2021-07-18T21:17:21 | 2021-07-18T23:45:35 | 11 | 0 | 0 | 1 | Python | false | false | import ast
import itertools
from formatter.pep8.helpers import _reduce_module, _replace_tokens
class ComparisonParser:
def __init__(self, source: str) -> None:
self.source = source
return None
def get_comparisons(self):
for comp in self.get_none_comparisons():
yield comp
... | UTF-8 | Python | false | false | 2,271 | py | 12 | comparisons.py | 12 | 0.590489 | 0.588727 | 0 | 68 | 32.411765 | 132 |
Diego07101985/challenge-bravo | 15,762,529,996,549 | 9db29cfb82b4addee668d25baa3d1e729785e57d | 4dd53b57cb310428e07ad85e96f4ef5463e6f366 | /desafio/currency/repository.py | 24fa0cf6e1d583d1ac243ab382c9bf0e049d8fde | [] | no_license | https://github.com/Diego07101985/challenge-bravo | 91177ab13899dc492b59c0c7b713dfd7a07cd0a5 | f8df7e6663ce1ce13d1f7a670acbc85e205c788b | refs/heads/master | 2022-12-01T21:10:04.241867 | 2020-08-17T20:28:12 | 2020-08-17T20:28:12 | 285,547,846 | 0 | 0 | null | true | 2020-08-17T20:24:36 | 2020-08-06T11:01:34 | 2020-08-16T23:30:13 | 2020-08-17T20:24:35 | 74 | 0 | 0 | 0 | Python | false | false | from desafio.currency.model import Currency
from desafio.extensions import session_scope
class CurrencyRepository():
def get_all_currency(self):
with session_scope() as session:
return session.query(Currency).all()
def get_currency_by_simbol_currency(self, currency):
with session... | UTF-8 | Python | false | false | 1,923 | py | 29 | repository.py | 18 | 0.615185 | 0.615185 | 0 | 49 | 38.244898 | 77 |
nelli369/Data_Scraping | 14,018,773,298,266 | d511a695f575d9c7b1ac1ac8d137af4f5ed6ae69 | 1c789a24715863c405e194e6e4447cbb652d0737 | /BooksToScrape3.py | c4c28ff8d2c15cbe5c630029ceb74ce008a0370e | [] | no_license | https://github.com/nelli369/Data_Scraping | b14522a9089d7d52f575ed761c368b5f7d546692 | 60f27562660a54ac23a25e65a253c38b404c7f2e | refs/heads/master | 2022-11-14T10:08:18.497811 | 2020-07-01T14:05:13 | 2020-07-01T14:05:13 | 274,640,854 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # -*- coding: utf-8 -*-
"""DS hmk2 pr3.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/16q0T7UI1N82myYQ1iyOyCiLJKZ5j-pM_
"""
!pip install scrapy
import time
import requests
import numpy as np
import pandas as pd
from scrapy.http import TextRespo... | UTF-8 | Python | false | false | 1,635 | py | 9 | BooksToScrape3.py | 4 | 0.658104 | 0.644648 | 0 | 48 | 33.041667 | 142 |
wpovell/twitter-kov | 1,941,325,217,831 | 0776c314498d9efea6a0a49f365091f7382fe028 | 16d8ed403af2184c9db4026cc84b9fd040beeeea | /TwitterKov/util/recall.py | 67cb907bc1d69b0bbb67d387750abde4a84a5326 | [] | no_license | https://github.com/wpovell/twitter-kov | a51267e026aae983b0579d2f193d8c2e98f2f61b | 371a7894783d33e68d64d67feca9379ba166017a | refs/heads/master | 2016-09-06T15:13:55.346790 | 2014-10-11T04:04:57 | 2014-10-11T04:04:57 | 11,493,473 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import json
import os
import datetime
import inspect
import importlib
class recall:
def __init__(self, fname=None):
self.callingFile = inspect.stack()[1][1]
if fname is None:
self.fname = ''.join(self.callingFile.split('.')[:-1]) + '.log'
else:
self.fname = '/'.join(... | UTF-8 | Python | false | false | 2,152 | py | 31 | recall.py | 30 | 0.486524 | 0.480019 | 0 | 61 | 34.295082 | 86 |
AlanShea/Comsci_12700-Assignments | 5,686,536,727,560 | 4cc32122f62e64c88de7460ef3afa4d0c227dde3 | ae6f66a3d1e667ae94e282a039bd1cb140310dbb | /32. Air Pollution.py | 6a385332b1cc886a1698b2ee26a2bdad0b975ebe | [] | no_license | https://github.com/AlanShea/Comsci_12700-Assignments | f76dfd8a0af82b8d0a789bb01d8e882935237679 | 1bb67f2397f114919a1f36fd6826b64d1bcdb07e | refs/heads/master | 2023-02-06T01:10:25.500465 | 2020-12-19T01:02:07 | 2020-12-19T01:02:07 | 322,739,064 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #Name: Alan Q. Shea
#Email: alan.shea65@myhunter.cuny.edu
#Date: October 21, 2020
import pandas as pd
import matplotlib.pyplot as plt
fileIn = input("Enter name of input file: ")
fileOut = input("Enter name of output file: ")
data = pd.read_csv(fileIn)
avgAsthma = data.groupby("geo_entity_name").mean()["data_v... | UTF-8 | Python | false | false | 445 | py | 66 | 32. Air Pollution.py | 51 | 0.721348 | 0.698876 | 0 | 18 | 23.722222 | 71 |
DarthThanatos/QuantumSimulator | 11,647,951,338,360 | 2ed27490a2dab502938bf45becc51ea009a02d49 | 11e43f083afad6e84c947332bb60327a1539b836 | /view/ProbabilitiesTable.py | 59089e844d407cf43318d949b87be75248df3a44 | [] | no_license | https://github.com/DarthThanatos/QuantumSimulator | e33a226efc06e08ccda44a5ccb5727ae31dbfbab | 9f05113b9b0c980536afb9bddca6a9596afdb459 | refs/heads/master | 2020-04-02T15:23:45.380210 | 2019-06-02T08:26:23 | 2019-06-02T08:26:23 | 154,566,220 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import wx
import wx.grid
class ButtonRenderer(wx.grid.GridCellRenderer):
def __init__(self, state_details_fun):
wx.grid.GridCellRenderer.__init__(self)
self.down = False
self.click_handled = False
self.__state_details_fun = state_details_fun
def Draw(self, grid, attr, dc, rec... | UTF-8 | Python | false | false | 3,968 | py | 107 | ProbabilitiesTable.py | 93 | 0.612651 | 0.609375 | 0 | 110 | 35.081818 | 140 |
vishnun/python-programs | 8,744,553,434,865 | f85392f60b2534a32bfcdfcb32c28157917fe061 | c7ffca464ef7bef4f64df5b471c9b6eca2c80e29 | /string_to_int.py | 953d298b3ab4a492cbea341cf52caabb5c24b119 | [
"MIT"
] | permissive | https://github.com/vishnun/python-programs | 2f3f2d6fc4a8ec3268a111d134dd57bb8d32df77 | 8e27f88a2a7174a0ca10596a328c4031bedd602c | refs/heads/master | 2021-01-11T18:47:25.801435 | 2017-02-05T07:10:08 | 2017-02-05T07:10:08 | 79,625,310 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | def is_valid_digit(digit):
return 0 <= digit <= 9
def str_to_int(num_str):
num_str, sign = get_sign(num_str)
value = 0
for digit in num_str:
digit = ord(digit) - ord('0')
if is_valid_digit(digit):
value = value * 10 + digit
else:
return "Not a number"
if sign == '-':
value = -value
return value
... | UTF-8 | Python | false | false | 465 | py | 18 | string_to_int.py | 17 | 0.587097 | 0.565591 | 0 | 24 | 18.375 | 43 |
jordan-simonovski/seefood-slackbot | 17,265,768,555,272 | 69ff4ddd51adb54ba6453f0628f39fe6527bc071 | ce62f2bf8e6495d62223831611e6903f149f394e | /modules/slackMessage.py | 5e9ae0f544fab3c547e1aea5958d1c30ac2cf30b | [] | no_license | https://github.com/jordan-simonovski/seefood-slackbot | c3e57239fdbb206502509d9541d3c8a7867b1688 | be639afc91995cd088751544547a1eb29aff36e2 | refs/heads/master | 2021-01-21T11:37:39.572209 | 2017-05-23T12:45:31 | 2017-05-23T12:45:31 | 91,748,549 | 6 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import requests
import json
def buildSlackMessage(imageUrl, hotdogAnswer):
slackMessage = {
"response_type": "in_channel",
"attachments": [{
"title": hotdogAnswer,
"fallback": "This is going to rollback your deployment",
"color": "#3AA3E3",
"attachmen... | UTF-8 | Python | false | false | 799 | py | 8 | slackMessage.py | 5 | 0.634543 | 0.627034 | 0 | 25 | 31 | 70 |
princeofdatamining/django_celery_management | 16,621,523,441,809 | b5b40b1b1f6ffacf4b82a767b5af37927d636039 | 86e7f45989e4081fdc7d1676043839560e7dec72 | /django_celery_management/__init__.py | 80e48593a02c51b0b61679e79c600b2c387b6c26 | [] | no_license | https://github.com/princeofdatamining/django_celery_management | d861f537c91202a35cc2f7bed8a14ca4473552d8 | 9ef99a4ecb30d16f5bfe3d24141be617308e4308 | refs/heads/master | 2020-09-20T05:34:13.911441 | 2020-06-29T07:20:08 | 2020-06-29T07:20:08 | 94,501,014 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | __version__ = "1.0.0"
default_app_config = 'django_celery_management.apps.django_celery_managementAppConfig'
| UTF-8 | Python | false | false | 110 | py | 6 | __init__.py | 6 | 0.754545 | 0.727273 | 0 | 3 | 35.666667 | 86 |
peteranny/research | 18,554,258,728,692 | f3a0706a68857bc36d682b4b4ed2de90792c0f63 | 327ce897521087bf9a3d44dd0bc2377e85bb8425 | /lib/factory.py | 29606d6cf508e6094a2adea43cf88f1105275799 | [] | no_license | https://github.com/peteranny/research | 75f1fdefe322049c3344ececfd6405fbb562cd95 | f2674f536d0f758682a1dc195cadcd577205390a | refs/heads/master | 2021-01-23T08:39:58.492377 | 2015-01-18T17:07:07 | 2015-01-18T17:07:07 | 27,134,312 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | '''
@ Ting-Yi Shih
#Usage Example
from factory import Factory
Factory(source=[1,2,3], filename="factory_out", func=lambda x:str(x), num_workers=1).run()
source: a list/an iterator/a generator of items
filename: output filename
func: function that returns a string as the result of the item
can take either 1 argu... | UTF-8 | Python | false | false | 5,247 | py | 38 | factory.py | 22 | 0.611016 | 0.603202 | 0 | 150 | 33.973333 | 108 |
ruyfreire/python-introducao | 8,504,035,253,532 | 5168794c689ad3c0d48c2b75fa24d232a8267be6 | e2adbbc7512933027100747db1db79653b45a716 | /sessao4/02_metodos/get_set.py | 2589c60e6f9d39bb760a25e32024f1142d3103e3 | [] | no_license | https://github.com/ruyfreire/python-introducao | 128dfeb24f7981a3b16891bf8c421e7a2767fee9 | 9088d216de7fe940f523b2a3c817fcc340aba730 | refs/heads/master | 2023-05-29T10:13:58.801677 | 2021-04-18T18:29:15 | 2021-04-18T18:29:15 | 277,381,147 | 0 | 0 | null | false | 2021-06-09T00:41:30 | 2020-07-05T20:49:51 | 2021-06-09T00:41:07 | 2021-06-08T23:21:50 | 11,942 | 0 | 0 | 1 | Python | false | false | """
Métodos Getter e Setter
- Getter
Métodos getter obtém o valor de um atributo da instancia,
e possuem o decorador '@property'
ex:
class MinhaClasse:
def __init__(self, nome):
self.nome = nome
@property
def nome(self):
return self._nome
- Setter
Métodos setter inserem o valor de um atri... | UTF-8 | Python | false | false | 1,054 | py | 160 | get_set.py | 128 | 0.614286 | 0.605714 | 0 | 54 | 18.444444 | 59 |
FrauElster/ocr_test | 5,712,306,548,340 | 3d7035159fe5fc03521eb4d9a4dda4cbb640b702 | fe0d709d75885c2e0250c1fb1dd18b1945d7b7c9 | /ocr-test/create_pdf.py | 89e7a1824ace649682ae5750724622226c5f280e | [] | no_license | https://github.com/FrauElster/ocr_test | 2845ab0c0d73d274961f2d46c28dfe242d6a15b7 | 8d0cd2df411fd45f18dbee1d8ab1c02ce352d364 | refs/heads/master | 2022-02-13T20:44:14.378611 | 2019-07-31T10:50:43 | 2019-07-31T10:50:43 | 196,885,809 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import os
from fpdf import FPDF
import glob
from typing import List
from .FileHandler import FileHandler
FONTS = ['Courier', 'Arial', 'Times']
def main(min_font_size: int, max_font_size: int):
assert min_font_size <= max_font_size
lorem: str = FileHandler.load_file(FileHandler.get_path('../lorem.txt'))
c... | UTF-8 | Python | false | false | 2,003 | py | 186 | create_pdf.py | 5 | 0.614578 | 0.609086 | 0 | 59 | 32.949153 | 92 |
smautner/pig | 18,837,726,560,357 | 55452bd17fc5f1fac5f55683f85acdbf577409bd | 9419966d7debad3ed14738c90ad5020fe59713cf | /yoda/nanaman/milad_data.py | f70b7d8b556f4de4791357c364d6239e57fb1526 | [] | no_license | https://github.com/smautner/pig | 378ef98a8d90e60a8e304536495e5d9fc4664a2f | 784877db54d078b4ccca839ef9b3d77c3b032508 | refs/heads/master | 2023-08-30T23:44:05.986116 | 2023-08-16T12:10:21 | 2023-08-16T12:10:21 | 209,278,646 | 1 | 2 | null | false | 2020-11-09T13:26:13 | 2019-09-18T10:13:27 | 2020-11-04T14:41:59 | 2020-11-09T13:26:12 | 4,316 | 1 | 1 | 0 | Jupyter Notebook | false | false | from lmz import Map,Zip,Filter,Grouper,Range,Transpose
import yoda.filein
from yoda import filein, alignment, ali2graph , simpleMl
from ubergauss import tools as ut
import eden.graph as eg
def rfamOme_labeldistribution():
'''just looks at the distribution of labels in the rfamome dataset'''
import glob
f... | UTF-8 | Python | false | false | 1,609 | py | 38 | milad_data.py | 31 | 0.675575 | 0.66936 | 0 | 48 | 32.520833 | 91 |
payerhans/patienten | 5,987,184,412,324 | f79cb14a6318a44e33f4ada2c9ca0c241b264a1d | 66576843eff9f518131c27cd9c92504a0b6dbd5b | /vvt/apps.py | 7d47cbdee7d8951e8ecfeb0afdebf24ec27234ac | [] | no_license | https://github.com/payerhans/patienten | 431049d99e295e9d59f9516440fcdad46ae9bb9b | 3c490762a9dd666a35ba6619713780dc6515990f | refs/heads/master | 2020-03-11T03:14:12.796823 | 2018-05-28T14:41:23 | 2018-05-28T14:41:23 | 129,741,162 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from django.apps import AppConfig
class VvtConfig(AppConfig):
name = 'vvt'
| UTF-8 | Python | false | false | 81 | py | 36 | apps.py | 15 | 0.728395 | 0.728395 | 0 | 5 | 15.2 | 33 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.