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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
kolodnikovm/django | 16,552,803,969,138 | 9159a387e2d994021ffb81d2dfbd4eecc1ad9cbb | 4236f19ced3a54e397803bed055c25d913a63c5e | /appdir/photogal/__init__.py | 49a85de60e561d5849e5584f6dc3080d365aa01c | [] | no_license | https://github.com/kolodnikovm/django | 70c2512d79ae89a03d9b4362e7c55ea7440cb3b6 | 30d65d85190bba8d7c43334a00a213ce90ca8233 | refs/heads/master | 2021-09-11T05:54:29.070754 | 2018-01-25T11:38:49 | 2018-01-25T11:38:49 | 115,706,950 | 0 | 0 | null | false | 2018-02-26T10:38:21 | 2017-12-29T09:08:53 | 2018-01-20T14:45:19 | 2018-02-26T10:36:11 | 7,285 | 0 | 0 | 3 | Python | false | null | default_app_config = 'photogal.apps.PhotogalConfig' | UTF-8 | Python | false | false | 51 | py | 21 | __init__.py | 14 | 0.823529 | 0.823529 | 0 | 1 | 51 | 51 |
Yuandiaodiaodiao/toolman | 532,575,950,290 | 3bde0c7b265653ea221f539d7731ae89fb72fea6 | 6fac6f096812ba0b38dace94e894b96318767b4b | /botCore/plugins/voteBan.py | 17cc3e2ae0b72c0f5623935855b0f68eb4167b8b | [] | no_license | https://github.com/Yuandiaodiaodiao/toolman | fa3d8c61abc332eb1781bff63823609905c0e9da | a268f018d28236c04ccca1f84803888baeffc1bf | refs/heads/master | 2020-09-11T04:13:22.363883 | 2020-07-24T09:05:20 | 2020-07-24T09:05:20 | 221,935,488 | 9 | 2 | null | null | null | null | null | null | null | null | null | null | null | null | null | import aiohttp
from nonebot.message import Message, MessageSegment
import nonebot
from nonebot import on_command, CommandSession
from nonebot.natural_language import on_natural_language, NLPSession, NLPResult, IntentCommand
from nonebot.permission import *
banList = {}
banConfig = {
'967636480': 3
}
@on_natural_... | UTF-8 | Python | false | false | 1,964 | py | 42 | voteBan.py | 34 | 0.599066 | 0.590768 | 0 | 60 | 31.133333 | 100 |
zhwdzh/Graph-WaveNet-RUL | 11,364,483,475,520 | 1ab207f7a4b48b64c71759e36e1f10ce27859898 | 0eee776169885dde972193066e97cbe037a063b9 | /util.py | 51408b3f41975925ec65efe96771041a9e834b55 | [] | no_license | https://github.com/zhwdzh/Graph-WaveNet-RUL | 8b46b2f31a4670c6d2f057b2eab70f06525c8847 | 30d971e06e57289148121303ae61849b0ea34ab5 | refs/heads/master | 2022-04-05T08:59:25.897413 | 2020-02-13T05:49:14 | 2020-02-13T05:49:14 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import pickle
import numpy as np
import os
import scipy.sparse as sp
import torch
from scipy.sparse import linalg
from cmapssdata import CMAPSSDataset
class DataLoader(object):
def __init__(self, xs, ys, batch_size, pad_with_last_sample=True):
"""
:param xs:
:param ys:
:param batch_... | UTF-8 | Python | false | false | 7,184 | py | 3 | util.py | 3 | 0.596464 | 0.587138 | 0 | 216 | 32.25 | 113 |
ganhan999/ForLeetcode | 11,613,591,586,913 | 1251fdd8040010169e97a3232704c814db865898 | 3ba2d4091332b9d0a2b053f15a4d4ce4ae1c1ef0 | /108、将有序数组转换为二叉搜索树.py | 172c2b4da8e58cc8b27e5b4b94b058a2b9fca913 | [] | no_license | https://github.com/ganhan999/ForLeetcode | 126272d34250035abda6c2d67222c2c186a3f80b | 9980a9e4bf448b2cf3fed98891a54b6d202a64db | refs/heads/master | 2023-05-01T14:21:49.883692 | 2021-05-12T08:59:51 | 2021-05-12T08:59:51 | 348,708,572 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | """
将一个按照升序排列的有序数组,转换为一棵高度平衡二叉搜索树。
本题中,一个高度平衡二叉树是指一个二叉树每个节点的左右两个子树的高度差的绝对值不超过 1。
示例:
给定有序数组: [-10,-3,0,5,9],
一个可能的答案是:[0,-3,9,-10,null,5],它可以表示下面这个高度平衡二叉搜索树:
0
/ \
-3 9
/ /
-10 5
"""
"""
思路分析:
DFS,递归,用二分的思想。
"""
#我的做法
class Solution:
def sortedArrayToBST(self, nums: List[int]) -> TreeN... | UTF-8 | Python | false | false | 904 | py | 184 | 108、将有序数组转换为二叉搜索树.py | 184 | 0.543478 | 0.506211 | 0 | 36 | 16.75 | 60 |
dheerajgoudb/Big-Data | 10,127,532,907,127 | 3c5086a26da1d751928c35bd9a22fea0f43f081e | 7904fb38c7e9f930bef0a1b1899b24e800491873 | /Assignment4/Part2/Section2.py | 86ff4eb61e1f98aa7f8c4442da6a4a3988dc0da5 | [] | no_license | https://github.com/dheerajgoudb/Big-Data | d14ac621cc8be6949537166e204769dabead2891 | 7bfc21fa351307bdb3ea162acab76b6143c9c3d5 | refs/heads/master | 2021-01-23T04:19:46.950833 | 2018-11-22T04:14:14 | 2018-11-22T04:14:14 | 86,184,975 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # Databricks notebook source
# MAGIC %md
# MAGIC ### ***PART-III (Section 2: Clustering)***
# MAGIC In this section, we cluster the dataset into K different clusters using clustering techniques like 'K-Means' Clustering.
# COMMAND ----------
# MAGIC %md
# MAGIC ##### ***User Knowledge Modeling Data Set***
# MAGIC Abs... | UTF-8 | Python | false | false | 1,878 | py | 14 | Section2.py | 5 | 0.715655 | 0.702343 | 0 | 48 | 38.125 | 185 |
oscm/devops | 386,547,100,759 | 3183cabf8efe4e649566d38469d1c9900a6a3fcc | 3519864c86fbf9de185c74e42fc37404dc0491ee | /bin/merge | 4f98e51b7deccc127111203064fbb69a350991e8 | [
"MIT"
] | permissive | https://github.com/oscm/devops | 21acdeb46619ac5a9c01c58762716037cf5b7c9f | 012eb08eceefa500e40d7fedf63f25ef858474ed | refs/heads/master | 2022-08-22T16:24:11.371104 | 2022-08-22T03:38:23 | 2022-08-22T03:38:23 | 18,361,108 | 26 | 22 | null | true | 2015-03-03T09:50:16 | 2014-04-02T09:24:39 | 2015-02-04T08:13:02 | 2015-03-03T09:50:16 | 539 | 2 | 3 | 0 | Python | null | null | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
###################################
# git branch merge
# Author: netkiller@msn.com
# Home: http://www.netkiller.cn
###################################
try:
import os,io,sys,subprocess
import logging, configparser
from logging import getLogger
# import threading
from o... | UTF-8 | Python | false | false | 5,901 | 195 | merge | 94 | 0.677851 | 0.673784 | 0 | 162 | 35.432099 | 169 | |
jimmy623/LeetCode | 85,899,380,808 | 88638b0a0aa2e66daf392c252780daf397925ecb | ac47f86e4fbd46c641575b2a8ccc401fd70c98e9 | /Solutions/Reverse Nodes in k-Group.py | 6e4a3248666245684319cfca8be503642a0f5033 | [] | no_license | https://github.com/jimmy623/LeetCode | 0a19f6e32c29e087e2d808153cb7a6e3794e2b67 | c4c1838bcde53484d3df654714bbbf6589c03c37 | refs/heads/master | 2021-07-12T06:02:14.973878 | 2021-03-14T16:03:26 | 2021-03-14T16:03:26 | 25,859,418 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # Definition for singly-linked list.
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
def __repr__(self):
string = "val:" + str(self.val) + " next:"
if self.next == None:
string += "None"
else:
string += str(self.next.val)
... | UTF-8 | Python | false | false | 1,827 | py | 317 | Reverse Nodes in k-Group.py | 316 | 0.472359 | 0.463054 | 0 | 88 | 19.772727 | 59 |
HeftyB/code-challenge | 7,129,645,721,015 | 978ba9dc15a409864713a72e77538d1ffe0fb331 | 152243a8a816f588c1a59c4fd92493c0f7736f3b | /queue-using-stacks/queue-using-stacks.py | 3aa90808299f3897282944ca67551cd03dca9faa | [
"MIT"
] | permissive | https://github.com/HeftyB/code-challenge | 442de7adddd00c3dbefadb919e567aa56f5dc5b6 | e23d9182f1da9bbd9bf3d2d97a22652513ec1b7d | refs/heads/master | 2023-05-01T17:16:24.294954 | 2021-05-20T02:16:34 | 2021-05-20T02:16:34 | 297,471,495 | 0 | 0 | MIT | false | 2021-01-29T04:54:26 | 2020-09-21T22:04:56 | 2021-01-27T04:59:17 | 2021-01-29T04:54:26 | 68 | 0 | 0 | 0 | Python | false | false | """
Implement the following operations of a queue using stacks.
push(x) -- Push element x to the back of queue.
pop() -- Removes the element from in front of queue.
peek() -- Get the front element.
empty() -- Return whether the queue is empty.
Example:
MyQueue queue = new MyQueue();
queue.push(1);
queue.push(2);
q... | UTF-8 | Python | false | false | 1,200 | py | 42 | queue-using-stacks.py | 36 | 0.611667 | 0.6025 | 0 | 56 | 20.285714 | 66 |
nrocco/smeterd | 2,284,922,630,860 | 2a760a551a64b0c36530ae4508038503b836a29c | 815cbff2d660a04880be8ead0becfe5e20b30fbb | /smeterd/cli/__init__.py | 83ad8783824275d44d7f61c9a456281cf53c913f | [
"MIT"
] | permissive | https://github.com/nrocco/smeterd | e697721b31de9b18e2be782e986de607c82759d5 | d0f6b5f5028bb0cd3ee7fedbe5c5753cfc8394cb | refs/heads/master | 2023-03-12T08:29:47.689970 | 2023-03-02T11:35:42 | 2023-03-02T11:35:42 | 9,798,114 | 40 | 19 | MIT | false | 2023-03-02T11:35:43 | 2013-05-01T19:11:22 | 2023-01-27T08:10:43 | 2023-03-02T11:35:42 | 362 | 31 | 19 | 3 | Python | false | false | import click
import logging
from smeterd import __version__
from .read_meter import read_meter
logging.basicConfig(format='[%(asctime)-15s] %(levelname)s %(message)s')
@click.group()
@click.version_option(version=__version__)
def cli():
"""Read smart meter P1 packets"""
pass
cli.add_command(read_meter)
| UTF-8 | Python | false | false | 319 | py | 17 | __init__.py | 10 | 0.705329 | 0.695925 | 0 | 18 | 16.722222 | 72 |
sainad2222/my_cp_codes | 15,736,760,179,858 | bc4d2b56b063197d9c4e1b61a7d604a977f6a4d4 | dfcadafb9b7aee820a6eebba7b67dc31c0cabda5 | /codeforces/233/A.py | 778e10fff806c8a80f6802a593e85d0dd7bb34e0 | [] | no_license | https://github.com/sainad2222/my_cp_codes | 0b631872e96ff84897dd498caf4a6ed5ba4f9c15 | 4621a2b6d80ea5dc36401481bba58096192e0822 | refs/heads/master | 2023-02-15T20:42:03.524179 | 2021-01-12T09:14:00 | 2021-01-15T07:45:41 | 324,394,919 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | n = int(input())
if(n&1):
print(-1)
else:
for i in range(n//2):
print(2*(i+1),2*(i+1)-1,end=" ") | UTF-8 | Python | false | false | 117 | py | 375 | A.py | 372 | 0.435897 | 0.367521 | 0 | 6 | 17.833333 | 40 |
CharlieCorner/pymage_downloader | 6,863,357,757,017 | bc86229237d294dc0b98a8c1b3c3394e60e3f916 | 8599d454d4deb84648a6695afd2bf700ffcaa7cf | /downloaders/reddit_downloader.py | 7fcb2a1cb9b8957aa2d4ad5be13f4bc9f99dd4d7 | [
"Apache-2.0"
] | permissive | https://github.com/CharlieCorner/pymage_downloader | c3516e155e65c3828570ebcdd389108d71b73d65 | 797cac0afffc235aa966c88342fe378b964b5ed9 | refs/heads/master | 2023-05-27T20:38:24.505796 | 2023-05-23T17:45:19 | 2023-05-23T17:45:19 | 97,399,927 | 0 | 0 | Apache-2.0 | false | 2023-05-23T17:45:20 | 2017-07-16T17:41:02 | 2020-12-14T04:58:41 | 2023-05-23T17:45:19 | 53 | 0 | 0 | 6 | Python | false | false | import glob
import logging
import os
from argparse import Namespace
import praw
from downloaders.downloader import Downloader
from exceptions.pymage_exceptions import NotAbleToDownloadException
from parsers.parser_factory import ParserFactory
from utils.utils import download_images
LOGGER = logging.getLogger(__name_... | UTF-8 | Python | false | false | 3,530 | py | 22 | reddit_downloader.py | 19 | 0.613314 | 0.612181 | 0 | 93 | 36.956989 | 121 |
greatabel/PythonRepository | 19,292,993,102,808 | 74258dbd1674fa955c347fa60ea1c4aecd951dfe | 52585c8d95cef15199c18ba1a76899d2c31329f0 | /05PythonCookbook/ch10ModulesAndPackages/i1graphics/primitive/line.py | bdf1a8a1c5a0a9cf408976d0581c424538e85b21 | [] | no_license | https://github.com/greatabel/PythonRepository | c7a952257303a21083ed7d535274c339362bd126 | 836fcdd3f5c1b150122302685104fe51b5ebe1a3 | refs/heads/master | 2023-08-30T15:56:05.376391 | 2023-08-26T03:34:14 | 2023-08-26T03:34:14 | 29,392,599 | 33 | 6 | null | false | 2023-02-14T13:33:21 | 2015-01-17T13:54:58 | 2022-10-31T09:32:22 | 2023-02-14T13:33:20 | 76,526 | 23 | 7 | 9 | Python | false | false | print('I am line.py') | UTF-8 | Python | false | false | 21 | py | 895 | line.py | 620 | 0.666667 | 0.666667 | 0 | 1 | 21 | 21 |
duanzhihua/StudyNote | 11,562,051,998,466 | 9aef358d6208dc7931a5e9f7ea895f39a7b468df | 28a901654360df732be05106a5a7435399b41438 | /pythonWebCrawler/ArticleSpider/main.py | 12cc1829cc9e4058fc35b81205d963ddf5af3971 | [] | no_license | https://github.com/duanzhihua/StudyNote | 39879a9c8c526df0017f12e0d31ebba91d77cec8 | 1e6532a1f5ff5b401bceadf4ec46b3b7e7505668 | refs/heads/master | 2021-09-09T16:32:28.306324 | 2018-03-18T02:26:09 | 2018-03-18T02:26:09 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from scrapy.cmdline import execute
import sys
import os
def main():
print(os.path.abspath(__file__))
print(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
execute(['scrapy','crawl','jobbole'])
if __name__=='__main__':
main() | UTF-8 | Python | false | false | 300 | py | 179 | main.py | 91 | 0.643333 | 0.643333 | 0 | 10 | 29.1 | 63 |
nwhitehead1/multithreaded-python-sockets | 13,443,247,660,430 | f6c34241dbe651f5b1276859dcff51680656ffd5 | a799b8f0fb8b00ecd31b6170b76ef725c5dece27 | /client.py | 9f054d5805e39498c14f688d93348035e9a9cf59 | [] | no_license | https://github.com/nwhitehead1/multithreaded-python-sockets | 1081070496bb145d59b35906e75d06213c8a4856 | 4a702bad8c56f90cceb057b169a7cd6a70b3543d | refs/heads/master | 2023-08-18T12:04:49.340473 | 2021-10-17T17:05:04 | 2021-10-17T17:05:04 | 213,256,977 | 2 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | #!/usr/bin/python3
import socket
import sys
import crypto
BUFFER_SIZE = 1024
# File Not Found -> Throw this to end execution on empty server send.
class FileNotFoundException(Exception):
pass
def main():
HOST = sys.argv[1] # Server IP address
PORT = int(sys.argv[2]) # Port used by the server
#H... | UTF-8 | Python | false | false | 2,384 | py | 4 | client.py | 3 | 0.641359 | 0.625839 | 0 | 64 | 36.25 | 95 |
marekborowiec/seq_extractor | 7,249,904,803,251 | 7720131eceaa7298f10cfa61a9239a89e6ec6ca0 | 63f55805b743cd72a3cd4b27c5c5d312ffd4f703 | /seq_extractor.py | 9eae13459d89424b613d87a1f1ae222792ba8cdc | [] | no_license | https://github.com/marekborowiec/seq_extractor | 2b0b6b469c83d2b23ec657c5a11ef1ed2f20e6a2 | aac82025ffc1c67b9dd58271c60be7bba43badd7 | refs/heads/master | 2015-08-09T07:57:06 | 2014-01-07T20:04:50 | 2014-01-07T20:04:50 | 13,912,553 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #! /usr/bin/env python
# seq_extractor.py by Marek Borowiec
# This program reads a multiple sequence alignment (so far only NEXUS supported) and extracts a partition given by user
import sys
from sys import argv
import re
# Throwing an error if no input file is provided
if len(sys.argv) < 2:
print "Use: seq_splitte... | UTF-8 | Python | false | false | 3,179 | py | 2 | seq_extractor.py | 2 | 0.677257 | 0.673482 | 0 | 133 | 22.902256 | 119 |
hamishesham/Companion | 2,233,383,012,766 | 6f008f1fb2eef0b0d1e811644b50cbed10255741 | 6a4c85f492e65b9a67f56ec5ca6a4b5fc59f1e16 | /output.py | 59f8e1ea5590882e68854682f10c4a05222ba0ea | [] | no_license | https://github.com/hamishesham/Companion | e21ea9a64aeb0070c2bec4ff84c0faf8ce8e070a | 80ebfa78ac7e4d39b9a8bfac2e9d7801497bbae4 | refs/heads/master | 2020-03-29T20:07:10.312805 | 2018-09-23T16:39:59 | 2018-09-23T16:39:59 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | TRAIN_DATA = [
('we are meeting ten thirty a m today', {'entities':[(15, 29, 'TIME'),(30, 35, 'DATE'),]}),
('the boys will meet nine fifty a m tomorrow', {'entities':[(19, 33, 'TIME'),(34, 42, 'DATE'),]}),
('they will be there by one twenty a m', {'entities':[(22, 36, 'TIME'),]}),
] | UTF-8 | Python | false | false | 286 | py | 10 | output.py | 7 | 0.56993 | 0.5 | 0 | 5 | 56.4 | 99 |
jaydee220/PCSII_Sapienza | 3,934,190,071,849 | bf8e23a302376df1102b424422f3a52ae8294667 | f19664bda4bb0fd5d6427ceffeec941ec172af14 | /Ex12.py | d586181dd3c57771317bac7a4cef8b1fce335ab3 | [] | no_license | https://github.com/jaydee220/PCSII_Sapienza | 44b5212a8932fbc9882fc3183cdc4b5b6965b4e1 | 198906ff69c5bc9103c449c71cc70c2b5e6d0f3d | refs/heads/master | 2021-07-21T08:47:28.535596 | 2017-10-31T09:34:32 | 2017-10-31T09:34:32 | 107,376,613 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | classgrades= []
if __name__ == '__main__':
for _ in range(int(input())):
names = input()
scores = float(input())
classgrades.append([names,scores])
gradesonly = list(set(scores for names,scores in classgrades))
gradesonly.sort()
names_lst = list(names for names,scores in classgra... | UTF-8 | Python | false | false | 421 | py | 44 | Ex12.py | 43 | 0.612827 | 0.610451 | 0 | 12 | 34.083333 | 86 |
vanslar/ecggenerator | 14,164,802,156,999 | a7a4819aa9aa0c7218040b9266278f3894ffcd93 | 8df9a0bc66bb63d8d2c31d7dbf04859470cc4b89 | /genEcg.py | db97dd02fd07fc29a9f93f32b8fdffceb372c404 | [] | no_license | https://github.com/vanslar/ecggenerator | b00607b076980baa2ee9155d7fa3f109b7413cde | adc8701105271b465baf7481ca4c84859f656215 | refs/heads/master | 2020-06-05T06:32:36.103693 | 2019-06-21T11:38:02 | 2019-06-21T11:38:02 | 192,346,078 | 3 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #!/usr/bin/python
#import modelCharRnn
import modelV3 as model
import wfdb
import tensorflow as tf
import matplotlib.pyplot as plt
sig, field = wfdb.rdsamp('Data/1201_5')
#data = sig[:, 0]
data = sig[:, 0]
pre_data = data[18750:18750+1000]
batch_count = 1
#seq_length = field['fs']*3
seq_length = field['fs']*2
featur... | UTF-8 | Python | false | false | 801 | py | 5 | genEcg.py | 4 | 0.689139 | 0.606742 | 0 | 29 | 26.655172 | 89 |
zhuoxiaojian/SemSupport | 13,125,420,094,266 | c5c4b599f9fff00125c54cc7cb2a7ee3b3b35869 | 0a94e12fc91815bdf510d748f37fdfccabe8c9d4 | /apps/citys/models.py | 71a911d9f579a5eeb0771ebec775179d0f2355b7 | [] | no_license | https://github.com/zhuoxiaojian/SemSupport | 0cb47e2612373b90e4a6b95165bc39d49a9bd0ac | 4dd4582c03daf43b589298c6061846d40aa3666f | refs/heads/master | 2022-12-23T15:18:35.411711 | 2019-09-26T12:16:08 | 2019-09-26T12:16:08 | 129,690,135 | 1 | 0 | null | false | 2022-12-07T23:51:23 | 2018-04-16T05:38:27 | 2020-07-30T12:51:39 | 2022-12-07T23:51:21 | 5,004 | 0 | 0 | 18 | JavaScript | false | false | from django.db import models
# Create your models here.
class FormRegionCity(models.Model):
name = models.CharField(max_length=255, unique=True, verbose_name='城市')
class Meta:
db_table = 'ys_city'
verbose_name = '城市信息'
verbose_name_plural = verbose_name
def __str__(self):
... | UTF-8 | Python | false | false | 1,462 | py | 79 | models.py | 73 | 0.638054 | 0.629471 | 0 | 49 | 27.530612 | 115 |
Sishan/LeetCode | 1,417,339,219,433 | e3340a51ef78dddf37c0e445b9896030d7376aa3 | 4d49d1665f6f385c08f292b728da6eba563ee400 | /Easy/RemoveElement.py | 874638fd228808957e45f6c9968c5d084e734fa8 | [] | no_license | https://github.com/Sishan/LeetCode | 4ac3c10cd65e395be68e66d0cb1f26d8ac0f5ea0 | 8c2f4af2fd30ca93daca8f7007b41e1f33c8f147 | refs/heads/master | 2020-05-22T01:39:09.459822 | 2020-01-24T05:32:19 | 2020-01-24T05:32:19 | 57,013,043 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | """
Given an array and a value, remove all instances of that value in place and return the new length.
Do not allocate extra space for another array, you must do this in place with constant memory.
The order of elements can be changed. It doesn't matter what you leave beyond the new length.
"""
class Solutio... | UTF-8 | Python | false | false | 694 | py | 228 | RemoveElement.py | 217 | 0.56196 | 0.557637 | 0 | 23 | 27.826087 | 98 |
batterseapower/untangle | 7,902,739,869,091 | 45ecd6ab8cdec114739384a89805a0f641d0061b | 1504eac0717a76250379f5d2507e4d3664dc134d | /untangle.py | 31f28cc56c66a3b243154a1a12a2cccf0d06596e | [
"MIT"
] | permissive | https://github.com/batterseapower/untangle | 81f91b1a15627e8c127f763636685b147636c78d | 0a3830a6f25f1b64044ae6f60f61c72a5a751e77 | refs/heads/master | 2021-01-22T01:10:27.435685 | 2017-09-02T14:10:24 | 2017-09-02T14:10:24 | 102,200,796 | 0 | 0 | null | true | 2017-09-02T14:07:25 | 2017-09-02T14:07:25 | 2017-08-30T08:20:43 | 2017-07-31T18:37:06 | 111 | 0 | 0 | 0 | null | null | null | #!/usr/bin/env python
"""
untangle
Converts xml to python objects.
The only method you need to call is parse()
Partially inspired by xml2obj
(http://code.activestate.com/recipes/149368-xml2obj/)
Author: Christian Stefanescu (http://0chris.com)
License: MIT License - http://www.opensource.org/licenses/mit-li... | UTF-8 | Python | false | false | 10,153 | py | 1 | untangle.py | 1 | 0.606323 | 0.599921 | 0 | 296 | 33.300676 | 163 |
chiaradinardo/algoritmos-I-FIUBA | 18,545,668,804,472 | 0c4050187026958d89c3945b3db544f23d2e49a3 | 444fa16e7463e8b5c828bbaea4ced1253cc0ed13 | /TP3/pilas_colas.py | 82d2743b93b0e9a62549f1326ac6c38bfdde2193 | [] | no_license | https://github.com/chiaradinardo/algoritmos-I-FIUBA | adb1e377918b9535ec46500fbcd20836ea470f5c | afae33a4296d2d04fde754c7363cf471bc7b45a7 | refs/heads/master | 2023-05-14T19:20:05.018533 | 2021-06-09T15:32:36 | 2021-06-09T15:32:36 | 290,336,937 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | '''
Clase del 27/10/2019.
'''
class Pila:
'''
Representa una pila con operaciones de apilar, desapilar y
verificar si está vacía.
'''
def __init__(self):
'''
Crea una pila vacía.
'''
self.items = []
def esta_vacia(self):
'''
Devuelve True si la ... | UTF-8 | Python | false | false | 1,490 | py | 10 | pilas_colas.py | 5 | 0.527495 | 0.519348 | 0 | 60 | 23.533333 | 64 |
BodenmillerGroup/bbwidgets | 10,350,871,230,746 | 8b69a7ee222912fd63659ebb1ecfd930a117d96a | 684b46b1e1d6a9e4c6fb579eeba548a653f55484 | /setup.py | db9f8581cb9d2a981327642817205c2d7c859cde | [
"MIT"
] | permissive | https://github.com/BodenmillerGroup/bbwidgets | de092ef528a828255a7d6f357a0b1560a4b5d249 | 9ce5867b19868baae16b5690a4c3d1c7b9267b74 | refs/heads/master | 2020-05-29T21:46:11.928149 | 2019-06-03T11:24:11 | 2019-06-03T11:24:11 | 189,392,083 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from setuptools import setup
with open('README.md', 'r') as f:
long_description = f.read()
setup(
name='bbwidgets',
version='0.1.1',
packages=['bbwidgets'],
url='https://github.com/BodenmillerGroup/bbwidgets',
license='MIT',
author='Jonas Windhager',
author_email='jonas.windhager@uzh.c... | UTF-8 | Python | false | false | 770 | py | 4 | setup.py | 3 | 0.650649 | 0.645455 | 0 | 25 | 29.8 | 86 |
Infinidat/infi.registry | 1,949,915,166,276 | 3b5dc1e4e8fa3e0fb33aff0ad1ee275c17a49a41 | 1e29869aca0233c33a99321c48cafa50c34c0a07 | /src/infi/registry/interface/tests.py | 6370bba9810d190026deee02431128495661fe50 | [
"BSD-3-Clause"
] | permissive | https://github.com/Infinidat/infi.registry | 00d3d09073c6106faee63b932b1e40df22d907f4 | 9ad1a17625c30c37c0f32641e0e8f837446f9d77 | refs/heads/master | 2023-05-27T02:25:23.125253 | 2019-02-18T11:23:14 | 2019-02-18T11:23:14 | 4,346,622 | 1 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null |
# -*- coding: utf-8 -*-
import logging
import unittest
import mock
import os
from .. import interface, constants, dtypes, errors, funcs, c_api
from ..dtypes import LPWSTR, LPCWSTR
class BaseTestCase(unittest.TestCase):
def _get_tested_function(self):
return getattr(interface, self.__class__.__name__, No... | UTF-8 | Python | false | false | 16,763 | py | 13 | tests.py | 12 | 0.633598 | 0.627871 | 0.000537 | 452 | 36.081858 | 106 |
tdemsoy/phytn | 9,921,374,494,209 | 5a153def1fe71b3b58a6c55415d3a4b2d1c76b0a | 0e40118260fd7f4806390aafa8ced03527a54e01 | /phytnkopek | e28ad5f62ea72578b10026b3a4ae8510b53953e0 | [] | no_license | https://github.com/tdemsoy/phytn | 50175f3b3f274136df6e02c3c69dbdb7d4c23e8a | d3539d00bd7b63bcb541f8aed0e5ccd4c659f88e | refs/heads/master | 2021-09-27T17:06:03.794565 | 2018-11-09T20:24:55 | 2018-11-09T20:24:55 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #!/bin/python3
from turtle import *
from random import randint
penup()
ivy = Turtle()
ivy.shape('turtle')
ivy.color('green')
ivy.penup()
ivy.goto(-160, 40)
ivy.pendown()
jim = Turtle()
jim.shape('turtle')
jim.color('orange')
jim.penup()
jim.goto(-160, 10)
jim.pendown()
for turn in range(100):
ivy.forward(r... | UTF-8 | Python | false | false | 364 | 1 | phytnkopek | 1 | 0.664835 | 0.615385 | 0 | 30 | 11.033333 | 27 | |
bersace/dotfiles | 3,650,722,221,365 | a71d20cf3231bc6a17c42f0321927e162aa51b32 | f3ac506b164a8aa979785b0efdb4bf8021d3c426 | /bin/inventory | 0324b97d2bde829d11ba52c7ba119107fe4012ea | [] | no_license | https://github.com/bersace/dotfiles | 1d5f419c8e7aaddf905c1c891ec842a8748258f1 | 019ceb838a2d8114a90810403c4929e17842c4ed | refs/heads/master | 2016-09-26T01:39:04.960608 | 2016-09-08T09:05:05 | 2016-09-10T20:56:51 | 41,423,518 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #!/usr/bin/env python
import base64
import os
import json
import socket
import subprocess
TARGET = os.environ.get('TARGET', 'localhost')
CONNECTION = os.environ.get('CONNECTION', 'local')
SHCMD = os.environ.get('SHCMD', '')
if 'localhost' == TARGET:
TARGET = socket.gethostname()
inventory = {
'all': {
... | UTF-8 | Python | false | false | 535 | 33 | inventory | 5 | 0.566355 | 0.560748 | 0 | 32 | 15.71875 | 50 | |
timostrating/ponypicpy | 188,978,565,591 | ae68b2e0e10ce7badc806f6868cd7f990b222616 | 7163271868c14e7fc2fde82b6958a6c2c53ecbbe | /scrapers/nieuws/spiders/meppelercourant.py | bd1320342345fca48f2213993dfc1d185696dcf7 | [] | no_license | https://github.com/timostrating/ponypicpy | 32ea8677d5c741a0d34e8e05b67ef3e8ba5dd8a2 | 14e4427ae3e1bc047f7b747b07eb65201643892d | refs/heads/master | 2020-03-18T11:50:20.706974 | 2018-07-02T14:20:58 | 2018-07-02T14:20:58 | 134,693,941 | 1 | 0 | null | false | 2018-06-27T16:11:32 | 2018-05-24T09:38:10 | 2018-06-27T14:45:39 | 2018-06-27T16:11:32 | 742 | 2 | 0 | 0 | CSS | false | null | import scrapy
from datetime import timedelta, date
import urllib2
class MeppelercourantSpider(scrapy.Spider):
name = "meppelercourant"
start_urls = []
def daterange(self, start_date, end_date):
for n in range(int ((end_date - start_date).days)):
yield start_date + timedelta(n)
def... | UTF-8 | Python | false | false | 1,556 | py | 89 | meppelercourant.py | 60 | 0.613753 | 0.604113 | 0 | 34 | 44.794118 | 152 |
mrbirl/PiCloud | 4,844,723,155,834 | 269a82e06c48ba131b06bb1e8c34d3cba1e0a5b3 | e8bb08b43628242669dbf97a738b2c54e0ff7063 | /Server App/auth.py | a76df03187b1eac6dce74389ca8a5b264fa16e78 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | https://github.com/mrbirl/PiCloud | 16e6b422142dd15ee78542b37bae94cd187a8817 | 98a4ab5abaff63d10ec51253af007d910f058329 | refs/heads/master | 2020-12-31T07:32:16.002906 | 2016-04-15T16:24:38 | 2016-04-15T16:24:38 | 56,333,945 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from dropbox import client, session
import webbrowser
# Authorise Dropbox - creates & returns Dropbox client object
def getClient():
APP_KEY = 'theappkey'
APP_SECRET = 'thesecret'
ACCESS_TYPE = 'dropbox'
try:
# See if there is a text file with the tokens already
TOKENS... | UTF-8 | Python | false | false | 1,659 | py | 22 | auth.py | 21 | 0.629898 | 0.629898 | 0 | 43 | 36.581395 | 80 |
Tarnal12/AoC2020 | 15,487,652,073,622 | 1935b374c3f4482390b91aa80e1fddd3507f4410 | 083c008397f7ba3f67168da8d366e0683a98dda9 | /Day4Soln.py | 9bfddeb21a738a8fb6369167c9d75f30c16a675a | [] | no_license | https://github.com/Tarnal12/AoC2020 | 205544c00531dc87da4db4daf133e6177fa33e9d | 2d6c10df2d8e0c8fd8eff11d990d01e64f5b6653 | refs/heads/master | 2023-02-05T01:32:23.026898 | 2020-12-16T11:25:45 | 2020-12-16T11:25:45 | 318,761,591 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import re
class Passport():
def __init__(self, data: str):
data = data.replace('\n', ' ')
self.data_map = {}
for data_item in data.split(' '):
(data_key, data_value) = data_item.split(':')
self.data_map[data_key] = data_value
#print(f"{data} is valid? {self... | UTF-8 | Python | false | false | 2,277 | py | 15 | Day4Soln.py | 15 | 0.475187 | 0.452789 | 0 | 67 | 32.985075 | 93 |
Gastd/motion_ctrl | 15,092,515,085,070 | 0926b1b89d4c64a02a35a980d13ba3a523c2ea35 | 6b20c1fb1b9cbc117f4de21e8a24259d1031100e | /scripts/timer.py | f45e325bbaf11a1b7bcde7199c8649c97f9e2d3a | [] | no_license | https://github.com/Gastd/motion_ctrl | 4e943fe35df0b4551712211d3d0130e611975e22 | 646e4ae933dcc3f658010753aa74f4f00767452f | refs/heads/main | 2023-07-11T08:04:24.722041 | 2021-08-05T02:12:42 | 2021-08-05T02:12:42 | 301,256,131 | 1 | 1 | null | false | 2020-10-08T19:07:24 | 2020-10-05T00:31:23 | 2020-10-05T08:28:34 | 2020-10-08T19:07:23 | 166 | 1 | 1 | 0 | CMake | false | false | from abc import abstractmethod
class Timer:
def __init__(self):
pass
@abstractmethod
def now(self):
pass
class PseudoTimer(Timer):
def now(self):
return 0.0
| UTF-8 | Python | false | false | 200 | py | 27 | timer.py | 7 | 0.595 | 0.585 | 0 | 13 | 14.384615 | 30 |
ncrnkovich/NeutronTransport | 7,361,573,968,545 | ab2a1e377874bc3b8182c4c3ac1f6afdefffe0ea | 267a5422bf5039c18264fea9a9708902c42257e8 | /motion1Dfunction.py | 06c3e22a398679277986d345a50da7e765bd6a6a | [] | no_license | https://github.com/ncrnkovich/NeutronTransport | 39d29866e1e58f575cb724ef1c1b9a3a0a1a35ce | 8ec3bcd34d758ccd148bd39f5148a5870027b07d | refs/heads/main | 2023-06-20T03:22:32.770185 | 2021-07-19T14:50:32 | 2021-07-19T14:50:32 | 371,237,396 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #%%
# nonuniform sweep function
# import libraries
from os import write
import numpy as np
import math as math
import matplotlib.pyplot as plt
from numpy.core.numeric import Inf
import scipy as scipy
from scipy.constants import constants
import scipy.special
# import crossSections
from crossSections import reedsProbl... | UTF-8 | Python | false | false | 8,544 | py | 13 | motion1Dfunction.py | 11 | 0.459621 | 0.405431 | 0 | 283 | 29.194346 | 159 |
HuyaneMatsu/hata | 17,454,747,102,724 | 9dacd81806f3ada278b8f5cd51cd42eaf0fa7a40 | df7f13ec34591fe1ce2d9aeebd5fd183e012711a | /hata/discord/sticker/sticker_pack/tests/test__parse_banner_id.py | e2a1a34306a8b3bba09ac2800be8fc42a0a587d7 | [
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | https://github.com/HuyaneMatsu/hata | 63e2f6a2d7a7539fd8f18498852d9d3fe5c41d2e | 53f24fdb38459dc5a4fd04f11bdbfee8295b76a4 | refs/heads/master | 2023-08-20T15:58:09.343044 | 2023-08-20T13:09:03 | 2023-08-20T13:09:03 | 163,677,173 | 3 | 3 | Apache-2.0 | false | 2019-12-18T03:46:12 | 2018-12-31T14:59:47 | 2019-12-14T22:03:20 | 2019-12-18T03:46:11 | 2,362 | 2 | 1 | 0 | Python | false | false | import vampytest
from ..fields import parse_banner_id
def test__parse_banner_id():
"""
Tests whether ``parse_banner_id`` works as intended.
"""
banner_id = 202301050003
for input_data, expected_output in (
({}, 0),
({'banner_asset_id': None}, 0),
({'banner_asset_id': ... | UTF-8 | Python | false | false | 454 | py | 2,953 | test__parse_banner_id.py | 2,919 | 0.590308 | 0.559471 | 0 | 18 | 24.222222 | 57 |
abdallawi/PythonBasic | 3,444,563,780,552 | 607c8c78aa052df12d97f00921084a218295ef0e | 8eb2bf527539608070c5ff783a1e370f8e69bb6b | /data-structures/list/Functions/ZipFunction.py | e6b2a3ec56dcdb4623eb90489f9101a2e8652485 | [] | no_license | https://github.com/abdallawi/PythonBasic | a7e170f99e1719540e42ba795adf9b66ffa11f46 | 82d4b3cfb08ab68776d796caa901ea970bb22b33 | refs/heads/master | 2020-09-10T08:32:19.969355 | 2019-11-14T14:50:23 | 2019-11-14T14:50:23 | 221,703,467 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | products = ['Xiaomi Mi Electric Pro Scooter',
'AMD Ryzen 7 3700X socket AM4 processor',
'Bowers & Wilkins PX5 hoofdtelefoon',
'Blue Microphones Yeti USB microfoon',
]
prices = [549, 359, 299, 129, 253 , 255]
list_combined = list(zip(products, prices, 'ABCDERHGF'))
prin... | UTF-8 | Python | false | false | 412 | py | 98 | ZipFunction.py | 91 | 0.640777 | 0.575243 | 0 | 14 | 28.357143 | 56 |
cvhs-cs-2017/practice-exam-Narfanta | 3,315,714,802,549 | a295e4877041c05c283bddc6e6d48da27a5e6bdd | 8e1c1f10127509c66d01bbdd7972693398f07ea2 | /Functions.py | aec5fc5d802360bd96e8811006166cc53d1e2575 | [] | no_license | https://github.com/cvhs-cs-2017/practice-exam-Narfanta | 6495ad68acc7bde6b2f2c7ad7ea30dff0a75c1ee | 98f48071a47d0f2ca1af41115e912eef7e60933a | refs/heads/master | 2021-01-11T17:44:12.801073 | 2017-01-25T19:22:27 | 2017-01-25T19:22:27 | 79,831,363 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | """1. Write a function that will double any integer (n) and return the result"""
def double(n):
n = int(n)*2
return n
print(double(1890))
"""2. Write a program that will (1) ask the user for an input value, (2) take
that and double it and (3) print the result.
Include necessary print statements and address ... | UTF-8 | Python | false | false | 415 | py | 6 | Functions.py | 6 | 0.708434 | 0.684337 | 0 | 11 | 36.727273 | 80 |
pororodl/LeetCode | 9,182,640,082,213 | 861442998c3a539201435e39d1ac371c5233dcd1 | c3a968a0fe4efe0a4addc69069c76098c8023fa0 | /gcd.py | 45f8053adc1f2827dceefc0655d36af48e8ebac4 | [] | no_license | https://github.com/pororodl/LeetCode | 207f7ed7d24af1563365c32cf1efd07ed4895da2 | 0e093db4990f56d883f124e4c5a4b7317825049b | refs/heads/master | 2020-09-01T16:11:34.064338 | 2020-04-10T12:59:22 | 2020-04-10T12:59:22 | 219,001,937 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import numpy as np
# 最大公倍数,最小公约数
# def gcd(a,b):
# a, b = (a, b) if a >=b else (b, a)
# if a%b == 0:
# return b
# else :
# return gcd(b,a%b)
#
# def lcm(a,b):
# return a*b//gcd(a,b)
#
# a = 25
# b = 65
# print(gcd(a,b))
# print(lcm(a,b))
# print('{:.2f}'.format(12.1))
if __name__ == '__... | UTF-8 | Python | false | false | 669 | py | 135 | gcd.py | 135 | 0.474498 | 0.42813 | 0 | 30 | 20.6 | 70 |
dr-dos-ok/Code_Jam_Webscraper | 18,554,258,748,154 | 138dc376e6f10998dbd8ee25b55acaa0604d756f | 15f321878face2af9317363c5f6de1e5ddd9b749 | /solutions_python/Problem_203/572.py | 3212ccd8510291e20e0c8615047939abbdbfa006 | [] | 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 | import numpy as np
def main():
fname = 'A-large.in'
fname_out = 'A-large.out'
fout = open(fname_out, 'wt')
with open(fname) as fin:
T = int(fin.readline().strip())
print("num of test: %d" % T)
for t in range(1, T+1):
R, C = map(int, fin.readline().strip().split(' '))
cakes = []
for r in ... | UTF-8 | Python | false | false | 2,377 | py | 60,747 | 572.py | 60,742 | 0.459403 | 0.440892 | 0 | 84 | 26.297619 | 139 |
mtsolmn/lantz-drivers | 10,187,662,433,067 | 1aca2013d76a3dc469cad9da4daa5f3d2824b022 | 571ad4ef5f3eab79a3a061fc94e86bb99b7d48fb | /lantz/drivers/allied_vision/tests/vimbatest.py | 9268f4a1b96e10507f21449e3eadacde420105cb | [
"BSD-3-Clause"
] | permissive | https://github.com/mtsolmn/lantz-drivers | d155e1887c91fbbe927aea848a178341b98345b9 | f48caf9000ddd08f2abb837d832e341410af4788 | refs/heads/master | 2023-03-01T14:46:09.555086 | 2021-02-11T22:05:41 | 2021-02-11T22:05:41 | 288,908,250 | 0 | 0 | NOASSERTION | true | 2020-08-20T04:44:18 | 2020-08-20T04:44:17 | 2020-06-26T09:15:19 | 2019-01-21T17:38:48 | 651 | 0 | 0 | 0 | null | false | false | from lantz.drivers.allied_vision import list_cameras
if __name__ == '__main__':
print(list_cameras())
| UTF-8 | Python | false | false | 107 | py | 49 | vimbatest.py | 48 | 0.663551 | 0.663551 | 0 | 4 | 25.75 | 52 |
aayushmittal16/Bioinformatics | 3,925,600,109,501 | 8ac0f5c9e7d27cc0ca536f98c6a21daa589d1515 | 89b12d553700347201436c9edab79c0cd80bc1b0 | /FastestClumpFinder.py | 5e017e526881b01f9d8f29a26e0b0547981ae19f | [] | no_license | https://github.com/aayushmittal16/Bioinformatics | 5260f54f6b6e7f3d419ee91f9a53bc642abf378c | b889c75e345b5a9791b10a09fbc750429e9baae9 | refs/heads/master | 2019-08-05T23:27:13.096249 | 2016-05-29T18:39:20 | 2016-05-29T18:39:20 | 59,925,102 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from time import time
def toString(list):
result = ""
for i in list:
result = result + (str)(i) + " "
result = result[0:len(result) - 1]
return result
#Caches all of the k-mer counts in a hashmap and returns the map with max count
def frequencyComputerTwo(text, k):
map = {}
for i in ra... | UTF-8 | Python | false | false | 1,839 | py | 2 | FastestClumpFinder.py | 1 | 0.614464 | 0.60087 | 0 | 62 | 28.66129 | 79 |
jdiasn/lidarSuit | 6,975,026,929,308 | f5d5697d8ce931ea8faf1d23a46bab561c14d4d6 | 4a4941456ffb6aac9fc2007f2db065de8ef006a7 | /tests/test_wind_prop_retrieval_6_beam.py | bad65c867d9232b0c1e639dffff322622be6e91a | [
"BSD-3-Clause"
] | permissive | https://github.com/jdiasn/lidarSuit | d0f1d0ae995c3e277fe674d82990371ac7fb7b96 | b6121bfe3a9dca0cbd6b19884372d5eefeea085f | refs/heads/main | 2023-04-16T19:39:05.227399 | 2023-01-04T15:53:46 | 2023-01-04T15:56:51 | 355,915,578 | 11 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | import pytest
import numpy as np
import xarray as xr
import lidarSuit as lst
def test_six_beam_method_input():
with pytest.raises(TypeError):
lst.SixBeamMethod(data=xr.DataArray(np.array([0, 1])))
def test_get_dummy_six_beam_obj():
elv = np.array([75, 75, 90, 75, 75, 75])
data_elv = xr.DataAr... | UTF-8 | Python | false | false | 2,740 | py | 40 | test_wind_prop_retrieval_6_beam.py | 22 | 0.603285 | 0.573723 | 0 | 109 | 24.137615 | 73 |
Sefaria/Sefaria-Data | 15,187,004,405,958 | d7b9e72af90ceaea361260b6192ca9c31c888226 | 1b9bd441c500e79042c48570035071dc20bfaf44 | /sources/Chatam Sofer on TOrah/match.py | f3bf4bed1039ab37af739b682ad556fc7622dfda | [] | no_license | https://github.com/Sefaria/Sefaria-Data | ad2d1d38442fd68943535ebf79e2603be1d15b2b | 25bf5a05bf52a344aae18075fba7d1d50eb0713a | refs/heads/master | 2023-09-05T00:08:17.502329 | 2023-08-29T08:53:40 | 2023-08-29T08:53:40 | 5,502,765 | 51 | 52 | null | false | 2023-08-29T11:42:31 | 2012-08-22T00:18:38 | 2023-07-28T05:31:47 | 2023-08-29T11:42:30 | 3,978,297 | 75 | 59 | 7 | null | false | false | #encoding=utf-8
import django
django.setup()
import codecs
from sefaria.model import *
from sources.functions import *
import csv
from sefaria.system.exceptions import InputError
from linking_utilities.dibur_hamatchil_matcher import *
from sefaria.system.database import db
def dh_func(dh):
dh = dh.replace("*", ""... | UTF-8 | Python | false | false | 2,636 | py | 56,261 | match.py | 1,252 | 0.555513 | 0.549005 | 0 | 69 | 36.855072 | 138 |
mikewoudenberg/AOC-2019 | 9,998,683,898,569 | 216bcb7164d27d8b61e28d34d051a6326e82f8aa | 5bf45a590693f3088e86d5074869d56da4683c66 | /assignment24.py | 6be8b23988b44588576af8abb4a0e16f39212425 | [] | no_license | https://github.com/mikewoudenberg/AOC-2019 | 271cbd2a4b26308e30a0a524cffe3830330ecafe | 5295f9aff5cf2c6d4d5d562409aa7f8583d000ae | refs/heads/master | 2020-09-30T21:57:58.080610 | 2019-12-25T10:38:43 | 2019-12-25T10:38:43 | 227,382,822 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from functools import lru_cache
data = """##.#.
##.#.
##.##
.####
.#...
"""
def buildGrid(data):
grid = [0] * 49
data = data.replace('#', '1').replace('.', '0')
for y, line in enumerate(data.split('\n')):
for x, char in enumerate(line):
grid[toCoord(x, y)] = int(char)
return grid
... | UTF-8 | Python | false | false | 1,431 | py | 28 | assignment24.py | 28 | 0.536688 | 0.518519 | 0 | 64 | 21.359375 | 59 |
iwabuchiken/WS_Others_prog_D-7_2_2_VIRTUAL.20180918_143948 | 1,906,965,519,632 | bcff78f6b12d61fc2abbc58304db87cbb2afb588 | 60031a174ade98bae9bb3cd15c15abfdb7621b46 | /Admin_Projects/mm/libs_mm/cons_fx.py | b44b76a63449e17d41f3cd76725a574f55126faa | [] | no_license | https://github.com/iwabuchiken/WS_Others_prog_D-7_2_2_VIRTUAL.20180918_143948 | 3f5e8569005b3928e525a4a3638b3281fb374025 | cb51878e90cbe3b172e3d30f103759c9e75a344b | refs/heads/master | 2020-03-28T22:27:53.633793 | 2018-09-18T13:42:00 | 2018-09-18T13:42:00 | 149,234,591 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #!C:\WORKS_2\Programs\Python\Python_3.5.1\python.exe
from enum import Enum
from Admin_Projects.definitions import ROOT_DIR
from Admin_Projects.definitions import DPATH_ROOT_CURR
TypeOf_Data_OpenClose = "OpenClose"
'''###################
Used in :
libfx : def get_HighLowDiffs(aryOf_BarDatas, id_Start, i... | UTF-8 | Python | false | false | 8,442 | py | 7 | cons_fx.py | 3 | 0.526297 | 0.41566 | 0 | 230 | 35.704348 | 121 |
menxinren/OFO_intern | 18,837,726,585,271 | 1c301a5eb8a590086c34597316d33794cd87e081 | e09fd6bd63eacb9ae17cd4cd0fcc5bbc0d06644b | /Factor10/Template/factor3.py | c6a8bac6343efd9d198e71951a3b069aa8d00cf0 | [] | no_license | https://github.com/menxinren/OFO_intern | 35d522346a9fc17e9faa927e4bd2715bd3255998 | 2e821547b67ba9a4d0bbdf0eeff7005b618286ca | refs/heads/master | 2020-03-12T05:28:25.832521 | 2018-05-02T02:40:57 | 2018-05-02T02:40:57 | 130,463,933 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #type3 - the intermediate variable of the factor is also a factor
def run_formula(dv):
import pandas as pd
import numpy as np
#计算过去n日最低价和最高价距离今日的天数
t = dv.get_ts('quarter')
t = t.replace([3,6,9,12],np.nan)
temp = dv.get_ts('low')
temp = temp.reset_index([x for x in range(len(temp))])
n = 5
days_min= ... | UTF-8 | Python | false | false | 1,351 | py | 21 | factor3.py | 18 | 0.642803 | 0.630617 | 0 | 37 | 34.459459 | 314 |
Yan199405/Python_note | 11,235,634,450,937 | c353b656f707a90451d1f77d7ba7a47d9c5e78df | 61459ef393c252cc52dc56d5ebafff7e055579aa | /图灵学院/v20.py | 53a3c4bfb9b21ba76bd6febe15b8b9078ebce56e | [] | no_license | https://github.com/Yan199405/Python_note | 5e56824b6ec347ab8af4f04b5070bdc5e6685b80 | d8fd0a83da280f80e7a3e9c535787afa7722e140 | refs/heads/master | 2020-06-13T01:17:33.696802 | 2019-08-12T00:28:17 | 2019-08-12T00:28:17 | 194,485,922 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | '''
爬取豆瓣电影数据
了解ajax的基本
'''
from urllib import request
import json
url = 'https://movie.douban.com/j/chart/top_list?type=11&interval_id=100%3A90&action=&start=0&limit=1'
rsp = request.urlopen(url)
data = rsp.read().decode()
data = json.loads(data)
print(data) | UTF-8 | Python | false | false | 302 | py | 61 | v20.py | 38 | 0.684783 | 0.648551 | 0 | 15 | 16.533333 | 102 |
aiddata/cambodia_ndvi_eval | 11,587,821,786,559 | c0186476b78a661c8d767537a27f1d973abd3f80 | 233aa254e724f21a0bdd8b85a690d71e9995cf74 | /build_panel.py | c2cde931988f2e847492c290a1045a8f5173ed43 | [] | no_license | https://github.com/aiddata/cambodia_ndvi_eval | 1fe06b7e36cdf492dd568767f446581c18e039c0 | cdc229af965ec037d5401b334f255993c125f944 | refs/heads/master | 2021-08-01T19:04:46.100048 | 2021-07-30T18:31:40 | 2021-07-30T18:31:40 | 182,141,664 | 1 | 0 | null | false | 2019-10-04T18:34:29 | 2019-04-18T18:55:37 | 2019-08-26T15:00:18 | 2019-10-04T18:34:28 | 69 | 1 | 0 | 0 | Python | false | false |
# set a directory to store output data. I dont specify Box as the filepath because the
# output file is too large to store in Box. You will have to make sure
# in your temporary directory, you must have the dissolved buffered village shapefile,
# the Hansen treecover raster, NDVI raster data for 1999-2018 (separate f... | UTF-8 | Python | false | false | 19,740 | py | 25 | build_panel.py | 14 | 0.686424 | 0.661905 | 0 | 465 | 41.445161 | 543 |
Einere/boostcamp_study | 13,365,938,240,339 | 173296a52c59895d33773e2fed773b3908526dbe | 18c241e02f09a40ace628531605ffceab65184f9 | /lgy/algorithm/10799 쇠막대기.py | 30919e44834b1e1aa0585fb622813e3b0dcae740 | [
"MIT"
] | permissive | https://github.com/Einere/boostcamp_study | 54b18de2205dbfb9b9f532008e951d82cac8313f | 63a52253c0ee01354a81dcac6349cc84d738b9ca | refs/heads/master | 2020-06-08T22:37:24.675128 | 2019-07-05T06:24:38 | 2019-07-05T06:24:38 | 193,319,107 | 2 | 1 | MIT | false | 2019-07-05T05:08:50 | 2019-06-23T07:30:51 | 2019-07-03T06:03:27 | 2019-07-05T05:08:50 | 46 | 1 | 1 | 0 | Java | false | false | def main():
ans = 0
mystack = []
flag = False
paren = input()
intstack = []
answer = 0
last = 0
for idx, ch in enumerate(paren): # O(n)
if ch == '(':
mystack.append(ch)
intstack.append(1)
flag = True
if ch == ')':
mystack.... | UTF-8 | Python | false | false | 653 | py | 61 | 10799 쇠막대기.py | 54 | 0.382848 | 0.37366 | 0 | 33 | 18.818182 | 44 |
matibraun/mercadolibre_scrapper | 4,088,808,909,600 | 2d06d762aa331b32a596a25a30d9125f37a318cb | 65d975314010207027ebd50e733af53df2dc4d4f | /create_database.py | 01d9335bb79eab551e4108e32faa62e03f88b952 | [] | no_license | https://github.com/matibraun/mercadolibre_scrapper | e167984994e328f7c5f2b3f9044f8cb6f2370c21 | 178f640669e586435963fb034c1b80fcc4aa045c | refs/heads/master | 2023-07-21T12:17:53.207525 | 2021-08-01T13:00:53 | 2021-08-01T13:00:53 | 292,346,991 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import sqlite3
def create_database():
try:
import sqlite3
ml_scrapper = sqlite3.connect('ml_scrapper.db')
cursor = ml_scrapper.cursor()
cursor.execute("CREATE TABLE ESCOBAR (index_ INTEGER, geographic_area TEXT, price_symbol VARCHAR (10), price INTEGER, surface_description TEXT, s... | UTF-8 | Python | false | false | 584 | py | 7 | create_database.py | 6 | 0.683219 | 0.669521 | 0 | 17 | 33.411765 | 258 |
lostsquirrel/python_test | 5,025,111,748,757 | 332c28f9fa580ef835e4e3652a47abb93947e380 | fc629dba07e98bfd44a671112f47091ad8935631 | /read_books/edu/hit/guide/test.py | a520402d5cdd27d94728ffe0c9696f2e63cfff5d | [] | no_license | https://github.com/lostsquirrel/python_test | c990e0c29bdf2eecae9411983b68d1f984afac84 | eb171b45bbf2f29cd1307aefd8e4609b683773d8 | refs/heads/master | 2022-09-01T11:30:16.847626 | 2022-05-18T07:43:49 | 2022-05-18T07:43:49 | 9,890,003 | 0 | 1 | null | false | 2022-05-18T07:43:49 | 2013-05-06T15:35:24 | 2021-12-02T10:04:35 | 2022-05-18T07:43:49 | 315 | 0 | 1 | 0 | Python | false | false | '''
Created on May 12, 2015
@author: lisong
'''
def gcd(m, n):
r = m % n
if r == 0:
return n
else:
r = m % n
return gcd(n, r)
print gcd(384, 84)
if __name__ == '__main__':
pass | UTF-8 | Python | false | false | 213 | py | 216 | test.py | 208 | 0.455399 | 0.399061 | 0 | 15 | 13.266667 | 26 |
alex4814/algo-solution | 6,657,199,331,794 | 8517581eb3f5dbec30b25eb484b51888cb9f69eb | 7babdd66023024927ef33ea9685f14b7732cac5e | /project-euler/python2/022.py | 4fcfeb79153908ed918aaaa5d00cbbf147a74df7 | [] | no_license | https://github.com/alex4814/algo-solution | 2f458961b02e4e0348d4283f2ed034b7fca4f537 | f3478bad3a36fe6eff8665718b63f3475370f028 | refs/heads/master | 2021-01-21T04:35:18.212839 | 2020-08-02T03:27:18 | 2020-08-02T03:27:18 | 24,101,204 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | def name_score(name):
return sum(ord(c) - ord('A') + 1 for c in name)
with open('p022_names.txt') as f:
names = f.read().split(',')
names = [name.strip('"') for name in names]
names.sort()
print sum((i+1) * name_score(name) for i, name in enumerate(names))
| UTF-8 | Python | false | false | 275 | py | 518 | 022.py | 486 | 0.603636 | 0.585455 | 0 | 9 | 29.555556 | 67 |
brianshen1990/KeepLearning | 14,267,881,388,276 | 6befa83ec00a47fea96c3b58c379b3b686943157 | 6ef9dff586c4411251710396c27b97c6a5c701ee | /Coursera/Python_IT_Google/T06/C04/changeImage.py | 8053b8fb7fac27986428d5b8a8e811caaa8019e1 | [
"MIT"
] | permissive | https://github.com/brianshen1990/KeepLearning | 57ecba54705d389b6ae6067daa1aad03c2ddf10b | e15092fc639cc14cd191b6748e4ee0e23f02930e | refs/heads/master | 2022-05-29T08:33:50.693135 | 2022-05-28T12:48:57 | 2022-05-28T12:48:57 | 252,941,917 | 4 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #!/usr/bin/env python3
from PIL import Image
import os
import re
src = "./supplier-data/images/"
dst = "./supplier-data/images/"
def main():
# read all images
fileslist = []
for root, dirs, files in os.walk(src):
for name in files:
if str(name).endswith(".tiff"):
fileslist.append(name)
# p... | UTF-8 | Python | false | false | 634 | py | 1,325 | changeImage.py | 1,188 | 0.599369 | 0.588328 | 0 | 28 | 21.571429 | 64 |
AakashJaswal/Python | 7,971,459,332,668 | 7ffaf7e9092a6ba0cd20785efbe3cef5ecaea5e8 | c5b8ed383f09ede5ed238dd316986a80d4a97300 | /CCPractice/1.Recursion/recusive.py | 5ef8820fd3cb71982d9375bf026011a4c8e2f921 | [] | no_license | https://github.com/AakashJaswal/Python | 3d4f49fc37c946191856d91058636836045f332f | fec47f235e089c980c944480e27ecefe5366685c | refs/heads/master | 2023-01-30T22:33:50.575415 | 2022-10-07T03:15:18 | 2022-10-07T03:15:18 | 296,155,681 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | def rec(n):
if n < 1:
return 1
else:
return n * rec(n - 1)
def fib(counter, final, a=0, b=1):
if counter >= final:
print("")
return 1
else:
print(a, end=" ")
a, b, counter = b, a + b, counter + 1
fib(counter, final, a, b)
def fib_hard_counter(f... | UTF-8 | Python | false | false | 747 | py | 29 | recusive.py | 28 | 0.534137 | 0.519411 | 0 | 36 | 19.777778 | 70 |
lamielle/iegen | 5,334,349,416,629 | a7213c54a06f606b38cdb2d6ea12070f062c867a | 07aa9b5a07df2a80b7d899da1da63c84b1060fec | /src/iegen/ast/visitor/_trans_visitor.py | 6e912b59c68098ac2632c6438b39c345eeccba05 | [] | no_license | https://github.com/lamielle/iegen | f26da812a01557daca086e0a1c76a62af8fe7cd4 | 0f48edad8d14ae18c907d705751552cf6eb53c8e | refs/heads/master | 2016-09-05T12:48:23.698779 | 2010-12-14T19:17:13 | 2010-12-14T19:17:13 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from iegen.ast.visitor import DFVisitor
#Translation Visitor: Translate the visited Set or Relation into
# a matrix representing a domain or scattering function in
# CLooG format.
#
#Briefly, this format is a matrix that represents a polyhedron.
#Each row of the matrix is one constraint, either equality or inequality.... | UTF-8 | Python | false | false | 4,734 | py | 225 | _trans_visitor.py | 164 | 0.739332 | 0.731517 | 0 | 140 | 32.814286 | 109 |
ChadShoeby/baseballBot | 5,935,644,810,455 | 51d07e2c0c3a5d7819adc60b56466b77de6ec9fd | deb32700ef636086754b8b60ff55a9cd18de08f6 | /baseballBot/frontoffice/models/ManagerProfile.py | b68ec6d9167aaf2e67180e255ebca2a3ea5c1b76 | [] | no_license | https://github.com/ChadShoeby/baseballBot | 3adbdd67648d3b62ccfedbe93f16dcef49ed6631 | fbaf4095a3d08355587b7b8b33bff3683be63ebc | refs/heads/master | 2022-12-19T19:10:53.900648 | 2020-10-15T00:04:35 | 2020-10-15T00:04:35 | 261,327,302 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from django.db import models
from django.contrib.auth.models import User
from frontoffice.models import League
class ManagerProfile(models.Model):
user = models.OneToOneField(User, related_name='manager_profile', on_delete=models.CASCADE)
league = models.ForeignKey(League, related_name='manager_profile', on_d... | UTF-8 | Python | false | false | 352 | py | 108 | ManagerProfile.py | 83 | 0.792614 | 0.792614 | 0 | 8 | 43 | 106 |
MICC/MICC | 6,914,897,363,974 | 58b6eb7286c905617cb6ecfa756617ad998545c0 | e19ca1786b1e32bc0537984923f6f94c19ba57eb | /micc/curves.py | 87122f4754ce3f486fa48f4c27d8398ac8459493 | [
"MIT"
] | permissive | https://github.com/MICC/MICC | 136939f72daa94613645fcc814618ef8564f6944 | 6b220b29e11cbe05e797bf4dd663f594979cc78b | refs/heads/master | 2023-07-19T20:41:33.652707 | 2015-01-12T18:59:38 | 2015-01-12T18:59:38 | 20,266,752 | 0 | 1 | MIT | false | 2023-07-06T21:04:09 | 2014-05-28T17:46:51 | 2015-01-12T18:59:38 | 2023-07-06T21:04:09 | 590 | 1 | 2 | 2 | C++ | false | false | # Give curve pairs class structure in preparation for public access
import numpy as np
from itertools import product, izip
from copy import deepcopy
import re
def fix_matrix_signs(M):
'''
:param M: The matrix with incorrect signs.
:type M: numpy.array(dtype=float64) of shape (2,n,4)
:returns: The matri... | UTF-8 | Python | false | false | 35,397 | py | 27 | curves.py | 18 | 0.554962 | 0.538887 | 0 | 1,176 | 29.098639 | 182 |
hnoson/writeups | 2,070,174,259,004 | 46c8ed83b3f90d48bd85c7c5e2067c445e6e7f21 | 0f9b6a33a5e2ce627db75d1bcc34bc3f3674335b | /contrailctf/2019/babyheap/exploit.py | f190231f314a8665a0aba24bb9c33edeb99474a0 | [] | no_license | https://github.com/hnoson/writeups | 359a33b03286bab19359ad9b089e6f3bfe4fb708 | 05550e3c462108f6c5ba0b69f65694e2eb1dc9b3 | refs/heads/master | 2021-10-07T18:21:26.041101 | 2021-10-03T10:22:31 | 2021-10-03T10:22:31 | 119,823,623 | 7 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #!/usr/bin/env python
from pwn import *
def write(size, data):
s.sendlineafter('>', '1')
s.sendlineafter('size :', str(size))
s.sendlineafter('data :', data)
def read(index):
s.sendlineafter('>', '2')
s.sendlineafter('index :', str(index))
return s.recvuntil('1. ')[:-3]
def free(index):
s... | UTF-8 | Python | false | false | 1,420 | py | 219 | exploit.py | 200 | 0.607746 | 0.51831 | 0 | 52 | 26.307692 | 98 |
benjcleveland/python | 8,959,301,818,881 | 1ec1e3fed8dc7a1b0697cea11a6429afb661f029 | 65247ead0579a21f980911f19fb66c5ddda77954 | /assignment1/libsocket.py | d818ed47ec8a4a5aac21522dcf9bc473a284eb53 | [] | no_license | https://github.com/benjcleveland/python | e8169e696768b835800a09e529a1af69da0755c2 | 992f62d451f0ee8537dcdce6fa7155cfba46b639 | refs/heads/master | 2021-01-18T19:22:21.555804 | 2011-03-15T02:04:23 | 2011-03-15T02:04:23 | 1,244,221 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #!/usr/bin/python
'''
Module for socket functions that are shared between the client and server
Author - Ben Cleveland
'''
import socket
HEADER_LENGTH = 16
def create_listen_socket(host, port):
'''
Creates a listen socket on the given hostname and port
returns the created socket
'''
# create the... | UTF-8 | Python | false | false | 2,682 | py | 14 | libsocket.py | 10 | 0.591723 | 0.585011 | 0 | 119 | 21.537815 | 104 |
hiddenman/voip_utils | 12,189,117,215,408 | 6a14404967f3f34f625b1ec103c9bed5dbd3ae4f | 59558f38a9f05222f441a8ffd702d6e699e30e38 | /urls.py | b3df94e31a33051e441a303c0928f75e89032879 | [] | no_license | https://github.com/hiddenman/voip_utils | 5a92481be3b2951b049cf3d66ff07869af388bb9 | 9047a62233cb6a1526f21555968bee5fd4f6581d | refs/heads/master | 2022-01-18T17:55:06.712536 | 2019-06-01T22:52:23 | 2019-06-01T22:52:23 | 113,439,683 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from django.conf import settings
from django.conf.urls.defaults import *
from django.contrib import databrowse
from django.contrib.admin.views.decorators import staff_member_required
from rates.models import *
# The next two lines enable the admin and load each admin.py file:
from django.contrib import admin
admin.aut... | UTF-8 | Python | false | false | 1,145 | py | 50 | urls.py | 16 | 0.675983 | 0.675983 | 0 | 27 | 41.37037 | 108 |
MedIAIA/MedApp | 5,153,960,779,188 | f14a686b37121e4897449d31b9a62428d4a81c74 | e73ee0c73bbbd53db55fe5293e90532f5a82b160 | /digiez_api/views/web.py | 291382249798514c70eff3f0672c2cb55f8e931b | [] | no_license | https://github.com/MedIAIA/MedApp | ec7c81e4dd1661eaa197a9e58d12acfafc62fdc0 | 8dd1df1060cda108a53c534aa32ef81bb7b08168 | refs/heads/master | 2023-03-03T01:23:17.871688 | 2021-02-21T22:03:58 | 2021-02-21T22:03:58 | 341,014,421 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from flask import Blueprint, url_for, render_template
web = Blueprint('web', __name__, static_folder='../../front/templates')
@web.route('/')
def home():
return web.send_static_file('index.html')
| UTF-8 | Python | false | false | 205 | py | 30 | web.py | 22 | 0.663415 | 0.663415 | 0 | 9 | 21.666667 | 71 |
DancingOnAir/Leetcode_Python_Solution | 4,827,543,246,238 | 3bd38d5529f50f87620b9d417590088cb278034e | 122d1dae77e7e62d0bcdc42dbdf7d79d96df03ea | /DP/0818_race_car.py | 7bb133ebee76e67be1a2e79f500f46e300e0198f | [] | no_license | https://github.com/DancingOnAir/Leetcode_Python_Solution | fd26e012b90a1dab7afbfd10d2ce6dfffdd62799 | 238c6dcf791987d1070979f8f4dbc5aa6af17eda | refs/heads/master | 2023-04-11T14:58:07.859130 | 2023-04-10T16:05:49 | 2023-04-10T16:05:49 | 283,797,446 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from bisect import bisect_left
from collections import deque
class Solution:
# simple dfs solution
def racecar(self, target: int) -> int:
# initialize as 0 moves, 0 position, +1 velocity
q = deque([(0, 0, 1)])
res = float('inf')
while q:
# (m) moves, (p) position, (... | UTF-8 | Python | false | false | 3,066 | py | 798 | 0818_race_car.py | 793 | 0.469341 | 0.444879 | 0 | 100 | 29.66 | 120 |
Talos-Laboratories/caramel | 7,687,991,486,600 | 1907c52b69bb62b097955ed064b59874853925e1 | e82d4b791fd21d7057944bcf9440401198008c27 | /caramel_test_suite.py | 7f4cc5fbfc196ffbf6c9c1de1aaf0b01f020edd4 | [
"MIT"
] | permissive | https://github.com/Talos-Laboratories/caramel | e21e788be22c50789253b7ece42ff66af7016692 | 77464c68077fe0c646f71b30ea3c6da0ae2c2ef9 | refs/heads/master | 2016-09-13T18:05:23.213812 | 2016-05-16T04:50:00 | 2016-05-16T04:50:00 | 58,902,829 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from os import remove
import unittest
from caramel import Caramel
from caramel import DataConverterFactory
from caramel import DataFromList
from caramel import DataFromText
from caramel import DataFromFile
class CaramelTestSuite(unittest.TestCase):
def setUp(self):
self.sut = Caramel()
self.test_l... | UTF-8 | Python | false | false | 8,874 | py | 3 | caramel_test_suite.py | 2 | 0.590376 | 0.573022 | 0 | 250 | 34.496 | 66 |
perseas/Pyrseas | 7,078,106,141,582 | ec4feb2d3729fd79b141a0f5631351cc6a5f74ba | 851c22930898a3050e0881b9e9b9705d1e22849e | /pyrseas/dbobject/extension.py | 8c4733f77d032e431ec3add9e30122eb6cb7ce76 | [
"BSD-3-Clause"
] | permissive | https://github.com/perseas/Pyrseas | d54d71c3aafe70f65e38d9c568cfcd3ee9346b0b | ec682513d5256e383647f38f7fba29530cfb9fbe | refs/heads/master | 2023-07-06T01:51:37.469775 | 2023-07-05T15:38:22 | 2023-07-05T15:43:08 | 1,546,410 | 323 | 61 | BSD-3-Clause | false | 2023-04-27T18:58:06 | 2011-03-30T14:23:28 | 2023-04-27T00:36:44 | 2023-04-27T18:58:05 | 3,196 | 362 | 62 | 45 | Python | false | false | # -*- coding: utf-8 -*-
"""
pyrseas.dbobject.extension
~~~~~~~~~~~~~~~~~~~~~~~~~~
This module defines two classes: Extension derived from DbObject,
and ExtensionDict derived from DbObjectDict.
"""
from . import DbObjectDict, DbObject
from . import quote_id, commentable
class Extension(DbObject):
... | UTF-8 | Python | false | false | 4,528 | py | 132 | extension.py | 83 | 0.576634 | 0.57553 | 0 | 137 | 32.051095 | 83 |
Moeinh77/pyERA | 10,136,122,829,274 | 60e443d44f6a37bb825a70142a66a500db3a9235 | e300c72f9641743ca610703b5fec141b978374da | /examples/ex_icub_trust_cognitive_architecture/speech_recognition.py | 2948b407d83f2244d3fd900ca57017d548e845ff | [
"MIT"
] | permissive | https://github.com/Moeinh77/pyERA | 7db4403081944417f1f1f487be5b808b0c87b9d2 | 9597fb0b234e6ad212f768b0bc47bb84ba4bd50e | refs/heads/master | 2020-05-31T09:56:00.917967 | 2019-04-22T13:10:49 | 2019-04-22T13:10:49 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #!/usr/bin/python
# The MIT License (MIT)
#
# Copyright (c) 2017 Massimiliano Patacchiola
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation ... | UTF-8 | Python | false | false | 8,346 | py | 27 | speech_recognition.py | 24 | 0.647017 | 0.637191 | 0 | 160 | 51.1625 | 145 |
Polarts/UEMarketplaceAlertsBot | 9,216,999,834,992 | ce4443548013e3c8d85a483bf9c6e8c78be31c04 | 7d6a9e5dbbecd69c33b2e6c42ce2fd3c5057b715 | /bot/functions.py | c74e53ac8d04c4eb3393ab241e19ef93bed6e20b | [
"MIT"
] | permissive | https://github.com/Polarts/UEMarketplaceAlertsBot | 2d81f26b4bb3fefc8506a3a49f7b094e397e4532 | 5f32690e64cf8ac582427f99e8669f1e716f818d | refs/heads/main | 2023-08-15T11:21:56.535797 | 2021-09-28T09:43:28 | 2021-09-28T09:43:28 | 405,038,207 | 1 | 0 | MIT | false | 2021-09-24T10:22:37 | 2021-09-10T10:11:59 | 2021-09-23T06:31:46 | 2021-09-24T10:22:37 | 40 | 0 | 0 | 0 | Python | false | false | import functools
import json
import os
from typing import Sequence
import requests
import facebook
from datetime import datetime, timezone
from bs4 import BeautifulSoup
from django.utils import timezone
from .models import AppState, AssetSource, Asset, LogEntry
BASE_URL = 'https://www.unrealengine.com'
... | UTF-8 | Python | false | false | 8,124 | py | 25 | functions.py | 13 | 0.529542 | 0.526096 | 0 | 254 | 29.984252 | 140 |
NISH1001/youtube-pauser | 7,241,314,911,170 | 3899226245fd717a4108ea98dd0be98c26f7ace2 | b4a29c887ba71677c6f7eccf7e587dad6627aa4f | /xdotool.py | 2ec63e835017ecd7cdb29d43f72f3192199d4479 | [] | no_license | https://github.com/NISH1001/youtube-pauser | edd36c85fd766c0f3dc6004c27224a500c8a344b | cf0c21d600928e91e2825ab0c17211a59c8805c1 | refs/heads/master | 2021-01-23T09:35:35.119068 | 2017-09-07T11:21:35 | 2017-09-07T11:21:35 | 102,584,205 | 3 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #!/usr/bin/env python3
"""
A wrapper over Linux's xdotool
"""
from sysutils import exe
def get_window_name(id):
"""
Fetch name of the window with corresponding id
"""
command = "xdotool getwindowname {}".format(id)
output, error = exe(command)
return output.strip()
def get_window_act... | UTF-8 | Python | false | false | 1,209 | py | 6 | xdotool.py | 4 | 0.615385 | 0.614557 | 0 | 55 | 20.963636 | 60 |
jacobstr/crusher | 9,912,784,563,453 | 6e29f5bf337aa67f1f2f4e149dcec62cd7994358 | 49719e9882fae16e20df64c142e11d882ca1dccb | /server/app.py | f297b0bcd820de942679f01bb00894213c75ff54 | [] | no_license | https://github.com/jacobstr/crusher | 27cac8fce9c0fb20f23df3e83faf08fad7bf7b60 | a09d67d666f18fcac66d956f7bfcaf3b3346260c | refs/heads/master | 2023-02-06T22:11:04.370165 | 2022-10-19T15:24:22 | 2022-10-19T15:24:22 | 150,933,573 | 2 | 5 | null | false | 2023-02-02T06:16:01 | 2018-09-30T05:26:19 | 2022-11-03T15:21:23 | 2023-02-02T06:15:59 | 147 | 3 | 5 | 8 | Python | false | false | import hashlib
import hmac
import itertools
import json
import logging
import os
import random
import shelve
import textwrap
import arrow
import flask
import humanhash
from slackclient import SlackClient
logging.basicConfig(level=logging.DEBUG)
LOGGER = logging.getLogger(__name__)
app = flask.Flask(__name__)
#: Url... | UTF-8 | Python | false | false | 20,161 | py | 27 | app.py | 5 | 0.540697 | 0.531224 | 0 | 661 | 29.500756 | 106 |
ashkan18/like-api | 481,036,372,826 | fd1018993b41db600da666ac3a35c485dcfe45b3 | f7a088759f35a08e492ea66f625bda2426163a76 | /services/level_service.py | caea6c2a5a758dd599555e682150e891bc9341d8 | [] | no_license | https://github.com/ashkan18/like-api | dc82587e57145e16b28884a773eae3b8ac24c73f | f2c4074d05fb8e5766463dc50736e1fe71a40637 | refs/heads/master | 2016-08-03T14:19:15.399546 | 2014-05-12T22:23:29 | 2014-05-12T22:23:29 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from models.comment_model import CommentModel
from models.level_model import LevelModel
from models.user_model import UserModel
from services import user_service
__author__ = 'root'
def get_level_stats(level_id):
"""
This method will get the total number of likes for specific level
@param level_id: integ... | UTF-8 | Python | false | false | 2,095 | py | 10 | level_service.py | 9 | 0.6821 | 0.681623 | 0 | 62 | 32.790323 | 99 |
wyaadarsh/LeetCode-Solutions | 6,777,458,441,493 | c4cd383f6875abd08cd613d65b6fe9735cce945a | fcc88521f63a3c22c81a9242ae3b203f2ea888fd | /Python3/1258-Synonymous-Sentences/soln.py | 8f3b59d4ac4a188bd1e24f702beec4862215187d | [
"MIT"
] | permissive | https://github.com/wyaadarsh/LeetCode-Solutions | b5963e3427aa547d485d3a2cb24e6cedc72804fd | 3719f5cb059eefd66b83eb8ae990652f4b7fd124 | refs/heads/master | 2022-12-06T15:50:37.930987 | 2020-08-30T15:49:27 | 2020-08-30T15:49:27 | 291,811,790 | 0 | 1 | MIT | true | 2020-08-31T19:57:35 | 2020-08-31T19:57:34 | 2020-08-30T15:49:37 | 2020-08-30T15:49:34 | 7,769 | 0 | 0 | 0 | null | false | false | class Solution:
def generateSentences(self, synonyms: List[List[str]], text: str) -> List[str]:
sets = []
words = set()
for u, v in synonyms:
if u not in words and v not in words:
sets.append({u, v})
else:
for s in sets:
... | UTF-8 | Python | false | false | 956 | py | 3,904 | soln.py | 3,904 | 0.443515 | 0.443515 | 0 | 27 | 34.407407 | 86 |
XinnuoXu/AggGen | 15,891,379,024,134 | af13616d9e89ec60b6fcdfda49ccc2563613b08c | f599d89129aee1ca1e5c9e845c2643c2242a4caa | /data_webnlg/evaluation_annotation.py | 0e1ea7a9024aaa4a23f2e06bdc9874c033c69db8 | [] | no_license | https://github.com/XinnuoXu/AggGen | f6b034e95b24859f6bd4d6c5594edf64af5ee215 | df05a9d1ab99d48c9a7ff8f73d6645a2c7596d64 | refs/heads/master | 2023-05-14T05:07:01.509324 | 2021-05-31T07:32:57 | 2021-05-31T07:32:57 | 294,522,221 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #coding=utf8
import os, sys
from sklearn.metrics.cluster import normalized_mutual_info_score
from scipy.stats import kendalltau
from scipy.stats import spearmanr
GT_PATH = './data-rst/webnlg_ann_gt_plan.jsonl'
SRC_PATH = './data-rst/webnlg_ann_src.jsonl'
ANN_PATH = './data-alg/webnlg_ann_tgt.jsonl'
class Percision(ob... | UTF-8 | Python | false | false | 1,945 | py | 175 | evaluation_annotation.py | 88 | 0.497172 | 0.493573 | 0 | 67 | 28.029851 | 64 |
CSI-BennettUniversity/Sample-Project-1 | 6,914,897,378,682 | 28a5014fea8d35301e2e0d5ef80841b0fad4fae2 | 25ad0b1a056c6fb988fa8c8718bb7cd55388ee5f | /interactions/functions/questions.py | 8eb6f911499398574032e1e9d5484be19fc91f95 | [
"MIT"
] | permissive | https://github.com/CSI-BennettUniversity/Sample-Project-1 | eeab14a36eeae8d65cdd85efaf54c85732985dcf | 23197352372b7ad00a026683477b5a95a4178e35 | refs/heads/master | 2023-05-13T17:25:26.652317 | 2021-06-05T14:53:15 | 2021-06-05T14:53:15 | 374,136,065 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import json
import random
from os import path
def return_questions(model: str) -> list:
""" This loads the questions from ``interactions/static/data/*.json`` as
per requirement and raises an ``Exception`` if the requested question
is not among the ones available. """
if model == 'SelfAnswerGroup':
... | UTF-8 | Python | false | false | 810 | py | 130 | questions.py | 74 | 0.630864 | 0.630864 | 0 | 24 | 32.75 | 76 |
zhu2014yi/CRPN | 14,422,500,191,338 | cfed43e15e8c7224d446cd7bba36c7d0d6b13591 | 196b1bb1a3d6b4bc85bc72c055a6c6acb2fc3269 | /lib/dataset/siamrpn.py | 1e029654d13250f61e54de40be113a2a79f253ba | [
"MIT"
] | permissive | https://github.com/zhu2014yi/CRPN | 9dd1b016af54c41de98fc080185453fb98e189e0 | 5da5bf42eb8c86a17bdff52680c3827a2ef18590 | refs/heads/master | 2023-03-07T21:50:22.931776 | 2021-02-17T04:09:44 | 2021-02-17T04:09:44 | 262,253,242 | 15 | 2 | null | null | null | null | null | null | null | null | null | null | null | null | null | # ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by Zhipeng Zhang (zhangzhipeng2017@ia.ac.cn)
# Details: siamrpn dataset generator
# Reference: SiamRPN [Li]
# -----------------------------------------------------------... | UTF-8 | Python | false | false | 16,349 | py | 198 | siamrpn.py | 27 | 0.551844 | 0.532085 | 0 | 437 | 36.398169 | 142 |
navill/2-1_Project_repo | 17,265,768,546,824 | 7b3c0dd77b16898f8cc3274f14c5d0c40cc5673c | 280f650e91c675f471121b8a4a13c2bb5a0a5e6c | /apps/config/urls.py | 376ae4c5e9a9968770ab098b6787cd368433759f | [] | no_license | https://github.com/navill/2-1_Project_repo | a8e089c657e44034152df30a85220675f2c31084 | 3f62bca9f52799d9f877f2d01259bb51038c0cc4 | refs/heads/master | 2022-12-31T18:32:45.471261 | 2020-10-26T10:54:39 | 2020-10-26T10:54:39 | 303,907,042 | 0 | 0 | null | false | 2020-10-26T10:54:40 | 2020-10-14T04:57:03 | 2020-10-19T13:47:14 | 2020-10-26T10:54:39 | 44 | 0 | 0 | 1 | Python | false | false | from django.contrib import admin
from django.urls import path, include
from accounts.views.staff_view import list_staff_user
from accounts.views.views import create_normal_user, list_normal_user, login_view, logout_view
urlpatterns = [
path('admin/', admin.site.urls, name='admin'),
path('create/', create_norm... | UTF-8 | Python | false | false | 717 | py | 21 | urls.py | 18 | 0.694561 | 0.694561 | 0 | 17 | 41.176471 | 94 |
N-e1/pyinaturalist | 8,581,344,701,238 | 64798a9aa5574c8095e60b6db83c9ba08ebf0154 | 450cc0c4c36cdc2bf18b93bd0d03e864b43ef7c9 | /pyinaturalist/models/observation_field.py | 33a0449eb5341f6a5cf57ca693584c679cabdd5f | [
"MIT"
] | permissive | https://github.com/N-e1/pyinaturalist | 2ed8f0ae7760c7f4e9eeacff738e680bdaba3183 | 3bcbc5187514733947e6385108fdcb5dafc2a4f8 | refs/heads/main | 2023-04-25T18:31:11.884578 | 2021-06-08T23:52:39 | 2021-06-08T23:52:39 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from datetime import date, datetime
from typing import List, Union
from attr import field
from pyinaturalist.models import (
BaseModel,
LazyProperty,
Taxon,
User,
datetime_now_attr,
define_model,
kwarg,
)
from pyinaturalist.response_format import safe_split, try_int_or_float
# Mappings fr... | UTF-8 | Python | false | false | 2,182 | py | 32 | observation_field.py | 24 | 0.670486 | 0.670027 | 0 | 76 | 27.710526 | 111 |
boobpoop/SVM | 2,525,440,778,017 | af1541a9c7e660e293daa8ae41f275b29f8be0c2 | 402afeec0807beb709a4e7bcc00ed49965fb459a | /svm/Platt-SMO/Platt-SMO.py | f9e3abea458679a5fd2575f112750be91439b108 | [] | no_license | https://github.com/boobpoop/SVM | 5c0df957bcf37e18d479a700b0c29e4fff44e279 | b4acbaffdbbecac51aa21551672b22fd084047a0 | refs/heads/master | 2020-04-11T02:56:43.176337 | 2018-12-12T09:31:57 | 2018-12-12T09:31:57 | 161,462,284 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import numpy as np
import random as rd
import matplotlib.pyplot as plt
import time
FILE_PATH = "testSet.txt"
class Data():
def load_data(self, path):
data_list = open(path, "r").readlines()
self.data = []
self.label = []
for data_line in data_list:
split_data = ... | UTF-8 | Python | false | false | 6,959 | py | 5 | Platt-SMO.py | 2 | 0.489438 | 0.475212 | 0 | 186 | 36.413978 | 192 |
CoderDream/Algorithmic-Trading-Tutorial | 2,817,498,592,563 | 68bba440b64655ab783e49ef557349a3860db070 | 2ae09be65f5ac40ace5b11352f9c79d9824b70e8 | /01. Programs/Tutorial 04 CN - Get intraday.py | 574b2d274fa90429775ce85f78d93a3dd1663b68 | [] | no_license | https://github.com/CoderDream/Algorithmic-Trading-Tutorial | 05d49503c327629886fb83ee023e9d16128e9eb3 | 57b6d0c8af0cb6e818fd0dcd6ad89c92a16f6b9a | refs/heads/master | 2020-08-13T21:40:44.725775 | 2019-10-14T16:38:17 | 2019-10-14T16:38:17 | 215,042,112 | 0 | 0 | null | true | 2019-10-14T12:46:26 | 2019-10-14T12:46:26 | 2019-10-06T13:44:43 | 2018-08-30T15:44:40 | 2,161 | 0 | 0 | 0 | null | false | false | import tushare
import pandas
import datetime
import os
def stockPriceIntraday(ticker, folder):
# Step 1. Get intraday data online
intraday = tushare.get_hist_data(ticker, ktype='5')
# Step 2. If the history exists, append
file = folder + '/' + ticker + '.csv'
if os.path.exists(file):
hist... | UTF-8 | Python | false | false | 1,220 | py | 355 | Tutorial 04 CN - Get intraday.py | 2 | 0.668033 | 0.654098 | 0 | 43 | 27.372093 | 71 |
iyashikagoyal/Data-Science | 15,874,199,148,054 | 0b1d97c0bb57ba8531eb4b3ca85776777ef4b5b0 | b05422c89f37121fa5b7acc3198c477375465d97 | /DataCleaningAndAnalysis/query.py | 29dcc22074d436954e3f69c249cdecdb3195efe3 | [] | no_license | https://github.com/iyashikagoyal/Data-Science | f6beea90a2759b06d659a1a0ac698b389b26cb3c | cacf8fe0c16cb05e0ebe6fc9508e29004be7d4b3 | refs/heads/master | 2021-05-02T16:17:54.756621 | 2018-06-27T03:09:13 | 2018-06-27T03:09:13 | 120,672,232 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import sys
class_file = open(sys.argv[1],"r").read()
def q1():
count = 0
courseslist = list()
courses = list()
count = dict()
number_of_courses = 0
l1 = class_file.strip().split("\n")
for line in l1:
courseslist.append(line.split("-")[1].strip())
for c in courseslist:
... | UTF-8 | Python | false | false | 2,028 | py | 28 | query.py | 20 | 0.512327 | 0.485207 | 0 | 78 | 25 | 64 |
mainissues/TRACLUS_IMPLEMENTATION | 9,053,791,092,578 | 50ebc0efa37d1def307599857d1263aff154d1e5 | f5983701c7fda9cb56420e8d13343ee2a07a98d5 | /traclus-api/app/api/algorithm_api/base/distance_functions.py | 3156c8be490aada0064c2f8eb6773a74283bc4e0 | [
"MIT"
] | permissive | https://github.com/mainissues/TRACLUS_IMPLEMENTATION | 03926ea0a06655b6332ecb96f980e7bc3fa3a550 | 9f4443f96a06bddf69854584bc2f53589956bc12 | refs/heads/master | 2023-03-27T14:47:57.677894 | 2022-04-25T14:31:57 | 2022-04-25T14:31:57 | 230,099,474 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import math
# 确定长短线段
def determine_longer_and_shorter_lines(line_a, line_b):
if line_a.length < line_b.length:
return line_b, line_a
else:
return line_a, line_b
def get_total_distance_function(perp_dist_func, angle_dist_func, parrallel_dist_func):
def __dist_func(line_a, line_b, perp_fun... | UTF-8 | Python | false | false | 2,497 | py | 34 | distance_functions.py | 27 | 0.67746 | 0.671648 | 0 | 65 | 36.061538 | 105 |
mikexie360/UTD_CS | 11,063,835,785,286 | e53e9942b96d2ce6c27ccfec37bd7e902045ab1a | 09c976bf8d942bb30e284fff9f76db1845c2aa6a | /UTD_CS_6375/HW5/mlhw5/solution/p4.py | acec6febf9938ab16741e928ede544f5a506aa42 | [] | no_license | https://github.com/mikexie360/UTD_CS | 232d62ca992b43c8f4917f5525fc006fdc7132df | 23f7a6266841f6c25dd649d56060b961343869f7 | refs/heads/master | 2023-04-30T06:40:55.272767 | 2021-05-25T00:48:02 | 2021-05-25T00:48:02 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # coding:utf-8
import numpy as np
from copy import deepcopy
def import_data(fname):
fh = open(fname,'r')
content = fh.readlines()
fh.close()
X=[];Y=[]
for line in content:
values = line.strip().split(',')
X.append(values[0:-1])
Y.append(values[-1])
X= np.array(X,dtype='float').T
Y= np.array([Y],dtype='flo... | UTF-8 | Python | false | false | 1,585 | py | 216 | p4.py | 190 | 0.58612 | 0.572871 | 0 | 69 | 21.985507 | 77 |
brl1906/twitterbot-dgs | 12,506,944,811,267 | e67bcb10cd2861a51371b8d989601550b8c1afe5 | b70591c38af95bb94e0c431fba0657e2d2122b94 | /tests/test_data.py | 4531726cb1dca1bba03de0e0d2216a3c671ab77f | [] | no_license | https://github.com/brl1906/twitterbot-dgs | 7f1afda7386038af7f6df12b507587c25574e5c2 | f6f4aff6b28f1aee7f3cafabde1b6962a10b7e96 | refs/heads/master | 2020-04-27T03:50:06.605750 | 2019-06-06T02:04:06 | 2019-06-06T02:04:06 | 146,484,249 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from configparser import ConfigParser
import os
import unittest
from data_handler import get_data
import pandas as pd
class TestConfigFileExistence(unittest.TestCase):
def setUp(self):
self.file = os.path.join(os.pardir, 'configuration', 'config.ini')
self.config = ConfigParser()
self.con... | UTF-8 | Python | false | false | 1,689 | py | 8 | test_data.py | 6 | 0.629959 | 0.629959 | 0 | 56 | 29.160714 | 85 |
Bierkaai/python-mp-preprocessor-old | 11,441,792,923,911 | 3086725164617de92d4ec93a0170ea69e6cd44df | f449847dd1f93d28448e6d7699e04f709c463269 | /enhancedmp/toytest.py | b1c54d3037da3ad5cd45f01175cb5408aae2bd3b | [
"MIT"
] | permissive | https://github.com/Bierkaai/python-mp-preprocessor-old | e76b9683c1c1477979878d36543867e7c74a33b8 | 61717acf74da7e4bb373d5922c1b2e1d3795e634 | refs/heads/master | 2020-05-03T03:33:51.205803 | 2014-09-30T08:03:36 | 2014-09-30T08:03:36 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | __author__ = 'coen'
import sys
import time
import random
from enhancedprocessors import *
from multiprocessing import Pipe
from stoppablemultiprocessing import Message, STOP
class RandomLogger(StoppableLoggingProcess):
def __init__(self, logqueue, message_conn, name):
super(RandomLogger, self).__init_... | UTF-8 | Python | false | false | 1,249 | py | 7 | toytest.py | 6 | 0.629303 | 0.620496 | 0 | 57 | 20.859649 | 80 |
arjonatorres/alarma | 15,315,853,420,704 | 6ef4dc09a1fdf7e271d799d89de9550901b3407e | 0601dae2296d36728c57d940de89d49a7fab444a | /home/pertest.py | 3c94407affcf9783d7afcb47a6b87551061dc7db | [] | no_license | https://github.com/arjonatorres/alarma | 50efa583616424ea12e3aab48d79875f90a9e513 | 6758f483e49e638510abf15889b4fc15a9bf078a | refs/heads/master | 2021-04-28T02:53:42.583834 | 2021-02-03T14:51:37 | 2021-02-03T14:51:37 | 122,125,985 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import serial
import time
ser = serial.Serial('/dev/ttyUSB0',9600,bytesize=8,parity='N',stopbits=1,timeout=1)
#ser.close()
#ser.open()
time.sleep(0.25)
ser.setRTS(True)
time.sleep(0.03)
ser.write("\x14\x6A")
time.sleep(0.03)
ser.flushInput()
ser.setRTS(False)
state=ser.read(8)
time.sleep(0.1)
print state.encode('hex'... | UTF-8 | Python | false | false | 743 | py | 116 | pertest.py | 107 | 0.58681 | 0.545087 | 0.002692 | 31 | 22.935484 | 83 |
mdrago98/Seal-Counting | 5,686,536,715,779 | 77fff26c1272356fb6791765cddf2686cc0d4ccc | ac1a76db0627dbc797898bc991915f614c5e9bd0 | /yolo/layers.py | 03593c278991d94b7c631664badd6ac62b4d94df | [] | no_license | https://github.com/mdrago98/Seal-Counting | d529dbbfce4f5111ee865d46a67e59cfda3d8f9a | 03d4b5cf8f21a8d1817e34e3e94db3091e32c7ef | refs/heads/master | 2022-12-12T16:01:40.123786 | 2020-08-25T14:01:24 | 2020-08-25T14:01:24 | 274,442,444 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from tensorflow.keras.layers import (
Add,
Concatenate,
Conv2D,
Input,
Lambda,
LeakyReLU,
UpSampling2D,
ZeroPadding2D,
BatchNormalization,
)
from tensorflow.keras.regularizers import l2
from tensorflow.python.keras.models import Model
import tensorflow as tf
import numpy as np
def ... | UTF-8 | Python | false | false | 5,994 | py | 39 | layers.py | 24 | 0.59693 | 0.578078 | 0 | 194 | 29.896907 | 116 |
abzer0x/training | 4,604,204,953,115 | 4a9d0b3fe7fdb925ac22a74164d5176b11deeff4 | d8c1cae31ac0d10266e340905528afd9be16e458 | /training/ticketing_system/forms.py | 37782c253a42e1698ab30a247efda541defb1bbd | [
"MIT"
] | permissive | https://github.com/abzer0x/training | 1c3065d774c0507df781f34a981ca3a931eb92cb | 7f418d563280b9d1ab939935206b023e4206cb54 | refs/heads/master | 2021-07-17T22:19:18.483633 | 2017-10-23T12:07:03 | 2017-10-23T12:07:03 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # -*- coding: utf-8 -*-
from django import forms
from .models import User
from .models import Ticket
CLASSES_INPUT_FIELD = {
'class': 'form-control'
}
class SignInForm(forms.Form):
email = forms.EmailField(
widget=forms.EmailInput(attrs=CLASSES_INPUT_FIELD),
max_length=150,
label='Em... | UTF-8 | Python | false | false | 2,347 | py | 29 | forms.py | 5 | 0.550064 | 0.544525 | 0 | 80 | 28.3375 | 77 |
isse-augsburg/ROSSi | 12,747,462,964,015 | 6d9aa8e1e74bcfec8c5493899df1ece7807984fd | 53760bc15c89e0867739f91e8ea185dfaa4cc59c | /ROSSi_workspace/rossi_plugin/src/rossi_plugin/Ros2UI/UI/Editors/LiveDiagram/GraphEntities/RosRunningTopicGraphEntity.py | 13755d6250f9fea55610ead36ee2ee2d160d7dca | [
"MIT"
] | permissive | https://github.com/isse-augsburg/ROSSi | 4af85c9febeda19f837a1685121ed5c373011dec | 66a23b6c133069325096d6e199e53d293e42d61b | refs/heads/main | 2023-07-15T08:44:54.524001 | 2021-08-31T14:42:24 | 2021-08-31T14:42:24 | 401,715,071 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from typing import Dict, List
from PyQt5 import QtCore, QtGui
from PyQt5.QtCore import QRectF
from PyQt5.QtWidgets import QGraphicsItem
from .RosRunningNodeGraphEntity import RosRunningNodeGraphEntity
from ...RosNodeEditor.utils import getAllFieldsOfTopic
from ....BaseGraphEntities.GraphMultipleEntryPort import Graph... | UTF-8 | Python | false | false | 4,430 | py | 54 | RosRunningTopicGraphEntity.py | 52 | 0.644921 | 0.637923 | 0 | 113 | 38.212389 | 140 |
shengqiu/scrap | 6,408,091,234,519 | 9c86feae80332fd0bbdeb6f4936808fb3ab3b141 | 26abbca72c670b15995455dc3913172b8640d305 | /test/nameScript.py | 5d7be89579f1fa99e034d6a64cc52e91fb17e143 | [] | no_license | https://github.com/shengqiu/scrap | eca4550d5f5d5506feabd6a98be42cc214dc8ceb | 64a1730b6c40a64feeb83f9f0606dce196ffdb57 | refs/heads/master | 2019-12-18T16:10:03.535858 | 2017-04-21T01:38:15 | 2017-04-21T01:38:15 | 88,935,543 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | brandDict = [
{'url': 'https://rq.rogerstrade.com/devices/manufacturer/1?&p=1', 'brand': u'Acer'},
{'url': 'https://rq.rogerstrade.com/devices /manufacturer/1?&p=2', 'brand': u'Acer'},
{'url': 'https://rq.rogerstrade.com/devices /manufacturer/279', 'brand': u'Advantech'},
{'url': 'https://rq.rogerstrade.com/d... | UTF-8 | Python | false | false | 38,761 | py | 70 | nameScript.py | 61 | 0.663605 | 0.628493 | 0 | 454 | 84.378855 | 111 |
xixi2/mal_domain_detection | 12,446,815,239,780 | 270a5fe0d3e0142f0be44e12dc77003024e137df | b5c3b8c1f8888d9acfe5a99ed4b6b786e45e468d | /active_node/remove_duplicate.py | bc251e519a814bb0e0a8b849a538c540005712a6 | [] | no_license | https://github.com/xixi2/mal_domain_detection | c6b1bb8a84ee7e8e54ea2e9f991e4e5a2ac54f33 | 84c2c853d1c5df183e6f8fdea464ebbed20cb41a | refs/heads/master | 2020-04-26T02:12:51.891086 | 2019-05-20T03:41:14 | 2019-05-20T03:41:14 | 173,228,166 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import time
from common.database_op import connect_db, query_db, delete_db
conn = connect_db()
def remove_double():
sql = "select DISTINCT(domain_name) from dns_answer"
res = query_db(conn, sql)
affected_ids = []
for item in res:
domain =item[0]
sql = 'select id from (select id from d... | UTF-8 | Python | false | false | 1,463 | py | 70 | remove_duplicate.py | 39 | 0.546822 | 0.539303 | 0 | 40 | 35.6 | 108 |
Raghav-Sao/Places | 13,469,017,455,081 | b8c3a0d66b4ca304d2adb0016d2c132f1622b397 | e04dbf0a3fd4caee19161ed4c65c8eb4ba78db09 | /places/urls.py | c7fcc030f3e8a210dfe8c26aba67d07a2ce4df70 | [] | no_license | https://github.com/Raghav-Sao/Places | 76633d73d5ce8fabe32ef0d2a07387ddadd13894 | ad815681944278b6eaa72e6991788d654f051404 | refs/heads/master | 2021-01-19T02:39:09.264944 | 2016-07-15T07:44:05 | 2016-07-15T07:44:05 | 62,582,934 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from django.conf.urls import include, url
import views
urlpatterns = [
url('add-place', views.add_place, name="add-place"),
url(r'^(?P<place_id>[0-9]+)/$', views.place_details, name="place-details"),
url('^$', views.places, name="places"),
] | UTF-8 | Python | false | false | 251 | py | 6 | urls.py | 6 | 0.649402 | 0.641434 | 0 | 8 | 30.5 | 79 |
sand8080/helixbilling | 1,743,756,764,272 | dd276bb1a4e7ac1658be41ef1ce996e5f1a176ca | b52ac748b10f003301fd53499a71a584f6ef27db | /src/patches/4.py | 637775dea0679cf2f4538aada4503801ef81c0d8 | [] | no_license | https://github.com/sand8080/helixbilling | 2ff8bb0bdb67d19920b04f4435c4cbc412d3eb16 | 17e2c61bab8be8299d9ea2c4ef84a0789b2d5a5a | refs/heads/master | 2016-09-06T11:16:10.565134 | 2012-07-13T13:39:49 | 2012-07-13T13:41:40 | 1,605,061 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | def apply(curs):
print 'Creating table balance'
curs.execute(
'''
CREATE TABLE balance (
id serial,
PRIMARY KEY(id),
environment_id integer NOT NULL,
is_active boolean NOT NULL DEFAULT True,
user_id integer NOT NULL,
currency_id... | UTF-8 | Python | false | false | 1,807 | py | 39 | 4.py | 35 | 0.65855 | 0.656336 | 0 | 51 | 34.411765 | 91 |
yofn/pyacm | 755,914,289,108 | a51a259899cbd8338b5217a6a03b5618c4a177ab | a4456d808b4c72574a11c88282920a917b076f5b | /codeforces/matrix矩阵/1900/222E基因编码.py | 5dd4c560f30d353f348cca03966c4d80da017bf2 | [
"Apache-2.0"
] | permissive | https://github.com/yofn/pyacm | 635f3b17cc08d9e702b561f9582fec4d694458b1 | e573f8fdeea77513711f00c42f128795cbba65a6 | refs/heads/master | 2023-07-09T02:11:31.044020 | 2021-08-10T02:02:24 | 2021-08-10T02:02:24 | 270,663,600 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #!/usr/bin/env python3
#https://codeforces.com/problemset/problem/222/E
q = int(1e9)+7
mul=lambda A,B,r:[[sum([(A[i][k]*B[k][j])%q for k in r]) for j in r] for i in r]
def binpower(A,e):
r = range(len(A))
B = A
e -= 1
while True:
if e &1: B = mul(B,A,r)
e =e>>1
if e==0: br... | UTF-8 | Python | false | false | 742 | py | 712 | 222E基因编码.py | 703 | 0.491914 | 0.448787 | 0 | 32 | 22.15625 | 80 |
Claayton/ExerciciosPython | 14,250,701,492,780 | 7647ab5aa96186ff744481a8398c4877840e3dbe | 69e828d2675c0d677daf2b98ed49367fa4c4a68b | /reworked exercices/ex061.2.py | 27d118338b33dece54c31682cb77e683382b5854 | [
"MIT"
] | permissive | https://github.com/Claayton/ExerciciosPython | 42f9978fffdb350799c1e6756bbfcf1f9f82bd6c | 696cdb16983638418bd0d0d4fe44dc72662b9c97 | refs/heads/master | 2023-03-08T03:21:25.364757 | 2021-08-04T15:07:20 | 2021-08-04T15:07:20 | 331,656,108 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # Ex061.2
"""Redo challenge 061, reading the first term and the ratio of an PA
Showing the first 10 terms of the progression using the while function."""
cont = 0
pa = 0
print(f'\033[7:40m{"="}\033[m' * 40)
print(f'{"10 TERMS OF A PA":^40}')
print(f'\033[7:40m{"="}\033[m' * 40)
first = int(input('What is the first ter... | UTF-8 | Python | false | false | 562 | py | 253 | ex061.2.py | 250 | 0.601423 | 0.494662 | 0 | 19 | 28.578947 | 74 |
WitalyK/CHA | 10,093,173,183,364 | 22be173e34ead61935a747c6aa534f89176f19fd | ec261cffed94d54c1c8f0140ed046d2d24b21e8f | /92/Click_me_NEW.py | fc13be301fd30a8128029522a839dfb937ba6cc2 | [] | no_license | https://github.com/WitalyK/CHA | 7dd51e82b07a6c9cdee08ff7a1625b9976c24ecd | ce20d2501c2174dfde1be2320ccc459262fcf09c | refs/heads/master | 2020-09-08T01:43:23.845841 | 2020-03-02T06:14:28 | 2020-03-02T06:14:28 | 220,974,443 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # -*- coding: utf-8 -*-
from datetime import datetime, timedelta
from re import finditer
from shutil import copy
from subprocess import run, PIPE
d_corr = False
zag = '''wait operator 0 * * * * *
wait operator 0
'''
while not d_corr:
d = input('Введите дату необходимого отработанного плейлиста в формате ДД.ММ.Г... | UTF-8 | Python | false | false | 1,431 | py | 128 | Click_me_NEW.py | 105 | 0.554064 | 0.510067 | 0 | 38 | 34.289474 | 99 |
ncss/projects-2017-7 | 11,287,174,059,345 | 306077130e6a81690c7744f5f44a67f1083e67d8 | e967478ad1d27981b5bd01992f7c7067dfc3cd63 | /BLAA/Robot Scorer.py | fe2841418c616ac6b57fc4aa44fda0ff3cf4d17d | [] | no_license | https://github.com/ncss/projects-2017-7 | fc26c01c69e3377566dd31792b03d4a5e12b74da | d996f26ffa611f57182be99290ba7e395067f3b2 | refs/heads/master | 2021-01-11T18:20:11.668950 | 2017-02-01T03:54:38 | 2017-02-01T03:54:38 | 75,157,337 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from microbit import *
import radio
def forward():
pin0.write_digital(1)
pin16.write_digital(0)
pin12.write_digital(0)
pin8.write_digital(1)
def backward():
pin0.write_digital(0)
pin16.write_digital(1)
pin12.write_digital(1)
pin8.write_digital(0)
def left():
pin0.write_digital(1)... | UTF-8 | Python | false | false | 904 | py | 24 | Robot Scorer.py | 17 | 0.625 | 0.547566 | 0 | 46 | 18.652174 | 29 |
hcliu08/competition | 11,965,778,904,437 | 8d3fff0c91efea618100538fa16177a6e1b23539 | 6f9d082ab5a9875c7b13531d6b13f9274f1ba3eb | /Data Scope/Kaggle Competition Outlier Z-score.py | 7e4cc44698813b75c243299b9f9f053f59166dfb | [] | no_license | https://github.com/hcliu08/competition | 5b5c2f3a182442b19332cf33667a3c5b3f7fb4ab | a8e0e3ad678ab14c25c29451e29a9a93cc8299cf | refs/heads/master | 2020-04-27T03:35:52.508077 | 2019-03-29T00:02:43 | 2019-03-29T00:02:43 | 174,028,929 | 0 | 2 | null | null | null | null | null | null | null | null | null | null | null | null | null |
# coding: utf-8
# In[1]:
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
# In[2]:
#Import Data
df_train = pd.read_csv('/Users/yuzhenhe/Desktop/train.csv')
df_test = pd.read_csv('/Users/yuzhenhe/Desktop/test.csv')
# In[7]:
#Drop Columns Target and ID_code
train_X... | UTF-8 | Python | false | false | 1,289 | py | 4 | Kaggle Competition Outlier Z-score.py | 4 | 0.649341 | 0.636928 | 0 | 79 | 15.291139 | 59 |
jiesen-zhang/ds-algorithms | 3,221,225,474,432 | 70513ca4c74195dbbabc8dcbc87deb6b2a810bfc | 88a1dbcbd3ef9f5b4b2168133d0fbb24c5ab05e9 | /search-algo/binary-search.py | 3e92c6d94fb05b80474f413661fe2478c6d67961 | [] | no_license | https://github.com/jiesen-zhang/ds-algorithms | 845acd61041da6be50f5a42c307b859503a1aad3 | c1463b4b319c467483e374cd9291952e5db281b3 | refs/heads/main | 2023-06-28T14:36:57.979276 | 2021-07-22T17:35:41 | 2021-07-22T17:35:41 | 388,284,417 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | '''
Binary Search
Returns the index for the target element. If target element is not found, returns index of where it would be in sorted array.
Time: O(n)
Space: O(1)
'''
def binarySearch(nums: [int], target: int) -> int:
if len(nums) == 1:
return 0 if target <= nums[0] else 1
left, right = 0, len(nums) - 1... | UTF-8 | Python | false | false | 593 | py | 2 | binary-search.py | 1 | 0.595278 | 0.569983 | 0 | 28 | 20.178571 | 125 |
nistpenning/calc | 17,549,236,386,207 | 27182bac3d830c5a13377852ffd4f8ac3b0b2b80 | aff5cc92f38213a45323d7dede291dd918e96519 | /analysis/Angular_Momentum/Triangle.py | cf8750235f9b1cf5d8201a085e33bb020020e234 | [] | no_license | https://github.com/nistpenning/calc | bd475b75a36ba93e74356a37529d0f9dac30a083 | 15d651bcc5c067032041b5ad9cf0be38169bb750 | refs/heads/master | 2021-01-18T22:59:31.619436 | 2015-11-03T23:44:05 | 2015-11-03T23:44:05 | 32,483,830 | 3 | 1 | null | false | 2015-06-17T16:58:16 | 2015-03-18T20:54:43 | 2015-06-10T02:53:48 | 2015-06-17T16:58:16 | 482 | 2 | 0 | 0 | Matlab | null | null | """
Tests the triangle inequalities in Messiah, A. "Quantum Mechanics" v. 2,
pg. 1062 (North-Holland, Amsterdam) 1962. Returns True if the inequalities
are satisfied, false if not. Also tests if the triad sums to an integer
Written: KAE University at Albany Physics Department 26 Oct 08
"""
from numpy import *
de... | UTF-8 | Python | false | false | 476 | py | 122 | Triangle.py | 52 | 0.653361 | 0.62605 | 0 | 18 | 25.444444 | 75 |
wengyuanwy/Generative-Adversarial-User-Model-for-Reinforcement-Learning-Based-Recommendation-System-Pytorch | 5,085,241,319,587 | 587858b491e17bae3a6398c8dd075d777c33ffa4 | 53081aae2779bb4d5253a18fc2c7126081050445 | /data_utils.py | 97d802a8375e24e1f65ac01b14c7c74397db9c53 | [
"MIT"
] | permissive | https://github.com/wengyuanwy/Generative-Adversarial-User-Model-for-Reinforcement-Learning-Based-Recommendation-System-Pytorch | 630bf76ad383679345cb427cf6170ee69ba5eb4f | 4e5479c4ff4c200fc3171c2c058893cb0bebe73d | refs/heads/master | 2023-02-22T03:23:26.526124 | 2021-01-30T12:55:44 | 2021-01-30T12:55:44 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
from past.builtins import xrange
import pickle
import numpy as np
import os
# almost similar to the original implementations
class Dataset(object):
"""docstring for Dataset"""
def __init__(self, args):
super(Dataset, self).__init__()
self.data_folder = args.data_folder
... | UTF-8 | Python | false | false | 19,330 | py | 8 | data_utils.py | 6 | 0.494413 | 0.478427 | 0 | 445 | 41.429213 | 199 |
vijayjag-repo/LeetCode | 8,632,884,315,610 | 2f727b0d0a852b60a1e78a3f21e8acbc5e2e68a5 | 9c63f6d39a6085674ab42d1488476d0299f39ec9 | /Python/LC_Balanced_Binary_Tree.py | c57c1e3b2bae5d2db27ba76a6f3dd287ba6760ef | [] | no_license | https://github.com/vijayjag-repo/LeetCode | 2237e3117e7e902f5ac5c02bfb5fbe45af7242d4 | 0a5f47e272f6ba31e3f0ff4d78bf6e3f4063c789 | refs/heads/master | 2022-11-14T17:46:10.847858 | 2022-11-08T10:28:30 | 2022-11-08T10:28:30 | 163,639,628 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def isBalanced(self, root):
"""
:type root: TreeNode
:rtype: bool
Approach:
Find... | UTF-8 | Python | false | false | 1,572 | py | 219 | LC_Balanced_Binary_Tree.py | 217 | 0.506361 | 0.498728 | 0 | 56 | 27.071429 | 78 |
dolphin-in-a-coma/python-course | 7,499,012,933,376 | b8ecde6100d505e4a95c792e07950886b3624cf6 | 772915fc1d85ba50892d6aadcff9d5d55e1a62b5 | /2-9_Rest_subjects/6_Time_complexity/6.2.3.py | cca46721a19d18ce0cf767483f1e1ac4ae358d07 | [] | no_license | https://github.com/dolphin-in-a-coma/python-course | eb90b9797e4ef397acd1577b30c31e372ffb6ed7 | c5dd67c3e699a62eb5f9594bc13dabbed830fecc | refs/heads/master | 2020-04-15T19:24:53.277011 | 2019-01-09T22:48:04 | 2019-01-09T22:48:04 | 164,948,718 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #функция возвращает сумму цифр
#сложность = O(N)
def foo(s):
# s - строка
val = 0
for c in s:
if c.isdigit():
val += int(c)
return val
| UTF-8 | Python | false | false | 213 | py | 232 | 6.2.3.py | 188 | 0.511628 | 0.505814 | 0 | 10 | 16.2 | 30 |
medision/dtwa_bbgky_fermions | 19,043,885,016,852 | 05b516c47d708288965f48a963c1000bd35add11 | b389b7f2f38f370cfc8cb92d49fe7d8a4f76c767 | /main.py | ee6f1601c0cddb39775bfd7ccd2e88b4504a6265 | [] | no_license | https://github.com/medision/dtwa_bbgky_fermions | 3cba385124e1a1ca7941f82ab00fa3ec025db788 | 75454ce5f94a43ec9a82181c89126dea370060bd | refs/heads/main | 2023-03-18T23:30:42.647050 | 2020-12-08T10:36:22 | 2020-12-08T10:36:22 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | from ginSODA.ginsoda import *
from pylab import *
import os
if __name__ == '__main__':
os.chdir('./ginSODA')
# Example of Enzyme Kinetics
GS = ginSetup()
GS.add_variables(["Substrate", "Enzyme", "Complex", "Product"])
GS.add_parameters(["k0", "k1", "z2"])
GS.add_equations([
"-k0*Substra... | UTF-8 | Python | false | false | 1,895 | py | 29 | main.py | 22 | 0.583113 | 0.545119 | 0 | 56 | 32.839286 | 107 |
benwei/Learnings | 12,506,944,792,559 | c9e4d212d9f5192042c0263db83fd853c1afd71d | 10e3f9659affb4c74280ee27a6e485c8d7e86c56 | /pySamples/test08_any_in_list.py | 394161f3b7b1510442110023279a046f28cfeec3 | [] | no_license | https://github.com/benwei/Learnings | a52a751e6ba9bbbbf7b51b0e6b6ac5e839a87cd3 | e020698c2be16bf7eb1c7fb9bf19276165cc0400 | refs/heads/master | 2023-02-04T22:27:00.182020 | 2023-01-19T16:52:31 | 2023-01-19T16:57:43 | 1,994,139 | 4 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
some_list = ['abc-123', 'def-456', 'ghi-789', 'abc-456']
def string_in_list(token, alist):
if any(token in s for s in some_list):
print("%s in" % token)
return 1
print("%s not in" % token)
return 0
string_in_list('abc', some_list)
string_in_list('546', some_list)
string_in_list('ooo', ... | UTF-8 | Python | false | false | 331 | py | 593 | test08_any_in_list.py | 308 | 0.592145 | 0.540785 | 0 | 15 | 21 | 56 |
Hagen013/presidentwatches | 13,778,255,108,366 | 6174f3b52dfbec9865f94c640e884ec9d87e472f | d210853ba6d1f3b5383a09e1b553c19083d78014 | /server/api/views/__init__.py | e6f3f66aa7aaa70a6b01e17435ed6ce2cb7a37fb | [] | no_license | https://github.com/Hagen013/presidentwatches | f252c7995e39f6cffb6608e43f555abc32f6a9fc | b9ca72aef1db01262675274c83a5c5dff4d6e2da | refs/heads/master | 2022-12-17T08:45:15.541869 | 2019-12-29T17:48:56 | 2019-12-29T17:48:56 | 162,160,435 | 0 | 0 | null | false | 2022-12-08T01:49:45 | 2018-12-17T16:36:05 | 2019-12-29T17:49:10 | 2022-12-08T01:49:45 | 8,814 | 0 | 0 | 22 | HTML | false | false | from .viewsets import ModelViewSet, ListViewMixin
| UTF-8 | Python | false | false | 50 | py | 451 | __init__.py | 267 | 0.86 | 0.86 | 0 | 1 | 49 | 49 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.