blob_id large_string | language large_string | repo_name large_string | path large_string | src_encoding large_string | length_bytes int64 | score float64 | int_score int64 | detected_licenses large list | license_type large_string | text string | download_success bool |
|---|---|---|---|---|---|---|---|---|---|---|---|
279b088260c067f8a543a447aba03b853df67029 | Python | openscopeproject/InteractiveHtmlBom | /InteractiveHtmlBom/ecad/svgpath.py | UTF-8 | 20,709 | 3.265625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | """This submodule contains very stripped down bare bones version of
svgpathtools module:
https://github.com/mathandy/svgpathtools
All external dependencies are removed. This code can parse path strings with
segments and arcs, calculate bounding box and that's about it. This is all
that is needed in ibom parsers at the... | true |
a32a9a06bce52e05e359578cd902686254b7612d | Python | bgcho/Deep-Neural-Network | /source_code/load_mnist.py | UTF-8 | 1,711 | 3.265625 | 3 | [] | no_license | """ load_mnist.py
A module that loads the MNIST image data. load_data() loads the data
from the mnist.pkl.gz data and returns the training_data,
validation_data, and test_data.
Skeleton code from neuralnetworksanddeeplearning.com
Last modified: 9/10/2016 Ben Byung Gu Cho
"""
import numpy as np
import gzip
import cPick... | true |
20db49f2f42d9456cf4a6d8bdc7703069f810c4b | Python | madsbf/cv-kickstarter | /cv_kickstarter/models/user_cv_builder.py | UTF-8 | 2,965 | 2.578125 | 3 | [] | no_license | """Builds a User CV to display on the frontend."""
from werkzeug import cached_property
import re
from cv_kickstarter.models.user_cv import UserCV
from cv_kickstarter.course_repository import CourseRepository
from cv_kickstarter.dtu_skill_set import DtuSkillSet
from cv_kickstarter.models.exam_result_programme import Ex... | true |
b16f9ee866f88ec396882c6e89dc495d29feddde | Python | leifdenby/python-cloudmodel | /pyclouds/integration/parcel_initiation.py | UTF-8 | 3,603 | 2.515625 | 3 | [] | no_license | """
Contains a number of approaches for calculating the state a cloud-base which sets
the initial condition for cloud-profile integration.
"""
from .. import Var
from ..reference.constants import default_constants
from ..models.microphysics import MoistAdjustmentMicrophysics
from ..reference import parameterisations
... | true |
d8afbbebf07542fbf3cd30b2441a8feb32a9ffbb | Python | Gscsd8527/python | /杂项/选择排序.py | UTF-8 | 588 | 3.859375 | 4 | [] | no_license | # 对于一组关键字{K1,K2,…,Kn}, 首先从K1,K2,…,Kn中选择最小值,假如它是 Kz,则将Kz与 K1对换;
# 然后从K2,K3,… ,Kn中选择最小值 Kz,再将Kz与K2对换。
# 如此进行选择和调换n-2趟,第(n-1)趟,从Kn-1、Kn中选择最小值 Kz将Kz与Kn-1对换,
# 最后剩下的就是该序列中的最大值,一个由小到大的有序序列就这样形成。
lst=[7,2,3,8,11,22,5,1]
for i in range(0,len(lst)):
m=i
for j in range(i+1,len(lst)):
if lst[i]>lst[j]:
... | true |
75046cbc3720e4248367cb9dfb4ccce7ec4115d2 | Python | oguzhancelikarslan/griffin | /app/routes/auth.py | UTF-8 | 1,664 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | from flask import Blueprint, redirect, url_for, render_template, flash
from flask_login import current_user, login_user, logout_user
from app.models.user import User
from app.forms.auth import LoginForm, RegisterForm
auth = Blueprint('auth', __name__, url_prefix='/auth')
@auth.route('/')
@auth.route('/index')
def i... | true |
fab349eef822f5a254411662db98fd25375178b2 | Python | konradvoelkel/articlechurner | /annotate_randomly.py | UTF-8 | 1,828 | 3.484375 | 3 | [] | no_license | """
annotate_randomly
DEPRECATED; use serve_annotator
takes a csv file with four columns like "url","title",rating,"notes"
takes user input to edit a randomly chosen line
writes user input back to the line
csv dialect used: excel
"""
from sys import argv
from random import randint,choice
from time import strftime
i... | true |
1ae475731e1dab994912f6fbe6005df942195563 | Python | guilherme-gomes01/automacao-adb-python | /script_test_install_uninstall.py | UTF-8 | 1,863 | 2.671875 | 3 | [] | no_license | '''
Algoritmo script_test_install_uninstall.py
Autores: Diego Torres, Giovanna S. Teodoro e João Guilherme S. Gomes
Descrição: O algoritmo automatiza uma série de comandos adb (android debug bridge) que realizam em um device (os testes foram
realizados em um emulador android pixel 3 com Andro... | true |
143a611177585cbe236291d5cc0b368e93027ba5 | Python | maithili167/SearchEngine | /TFIDF.py | UTF-8 | 8,359 | 2.84375 | 3 | [] | no_license |
import os
from collections import Counter
import math
from nltk import FreqDist
from nltk.stem.porter import PorterStemmer
from nltk.corpus import stopwords
from nltk.tokenize import RegexpTokenizer
import datetime
tokens={}
documents={}
idf_dict={}
postingList={}
scored={}
length={}
query_vector={}
docVector={}
do... | true |
20385ce84c2b8381dbcc3733789afd8b4b3b6945 | Python | guptaayushi1293/py-algorithms | /arrays/exercise_8.py | UTF-8 | 1,156 | 4.25 | 4 | [] | no_license | # Create min-heap from array elements
# input = [3, 1, 6, 5, 2, 4]
class MinHeap:
def __init__(self, n):
self.input_list = [None] * n
def heapify_up(self, index):
if index <= 0:
return
parent = (index - 1) // 2
if self.input_list[index] >= self.input_list[parent]:
... | true |
e20237f7f3f25362747ff960e248696e9d49a3a1 | Python | odinfor/leetcode | /pythonCode/No51-100/no75.py | UTF-8 | 856 | 3.46875 | 3 | [] | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2021/6/16 11:12 上午
# @Site :
# @File : no75.py
# @desc :
class Solution:
def sortColors(self, nums: list) -> None:
"""
三指针:头尾指针不动,中间指针i遍历,nums[i]==0和头指针互换,nums[i]==2和尾指针互换。互换位置后头指针右移,尾指针左移。直到i>右指针
"""
p0, p2, i = 0,... | true |
ba507e653e3230883e05703543d427727ea04fbd | Python | marcusljx/python-sandbox | /PythonHax/CrossImport/ClassA.py | UTF-8 | 517 | 2.984375 | 3 | [] | no_license | """ Sandbox :: ClassA
Description:
Solution for problem at http://stackoverflow.com/questions/8980676/dynamically-bind-method-to-class-instance-in-python
Author:
marcusljx
Created:
2016-09-01
Doctests:
>>> A = ClassA()
>>> print(A.calling_method())
3
"""
class ClassA(object):
def __init__(self):
... | true |
2a731454f65aef9c1e65b19071b16261588444ac | Python | ashu20031994/HackerRank-Python | /Day-5-Math-Collections/10.Collections_counters.py | UTF-8 | 1,145 | 3.96875 | 4 | [] | no_license | """
Raghu is a shoe shop owner. His shop has X number of shoes.
He has a list containing the size of each shoe he has in his shop.
There are N number of customers who are willing to pay x_i amount of money only if they get the shoe of their desired size.
Your task is to compute how much money Raghu earned.
Input Form... | true |
912dc4f64e3d342c9406b80bd7cf3001e4059d8e | Python | valcal/python_practice | /python-function-practice-master/paper_doll.py | UTF-8 | 340 | 4.03125 | 4 | [
"MIT"
] | permissive | """
PAPER DOLL: Given a string, return a string where for every character in the original there are three characters
"""
#paper_doll('Hello') --> 'HHHeeellllllooo'
#paper_doll('Mississippi') --> 'MMMiiissssssiiippppppiii'
def paper_doll(text):
doll_text = ""
for letter in text:
doll_text += letter*3
... | true |
48f9ada16d3c436484a463bcd64d38995dc4b2eb | Python | sneakerheadz1/Cyber_Engineering-Labs | /Encryption & Decryption python | UTF-8 | 1,506 | 3.28125 | 3 | [] | no_license | #!/usr/bin/env python3
# Script Name ops challange 06- 401
# Author Dom Moore
# Date 10/7/20
# Description of purpose Encryption & Decryption python
# Import Libraries
from cryptography.fernet import Fernet
# Declaration of variables
usr_enc = input('Enter... | true |
180f5aeffe4355cb1cd5ea9eef2f87ec3a780746 | Python | adityag6994/random | /mnist_simple.py | UTF-8 | 1,643 | 2.671875 | 3 | [] | no_license | """
MNIST Test using trained Caffe model.
We are intrested in bacth size of one and
the over all accuracy.
Date : 16 April 2018
"""
import lmdb
import time
import math
import caffe
import timeit
import sys, os
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
from caffe.proto import caffe_pb... | true |
fcbd596c3adcb8011ccce192c10f9055773e6707 | Python | scholargj/Exploratory-Data-Analysis-Covid-19 | /CSE506_A1_2017040.py | UTF-8 | 69,694 | 3.234375 | 3 | [] | no_license | import pandas as pd
import json as js
import numpy as np
import matplotlib.pyplot as plt
states_arr=["an","ap","ar","as","br","ch","ct","dd","dl","dn","ga","gj","hp","hr","jh","jk","ka","kl","la","ld",
"mh","ml","mn","mp","mz","nl","or","pb","py","rj","sk","tg","tn","tr","up","ut","wb"]
# states_arr includes all ... | true |
2018f9af2aa6dccb565b49105c19fbe5349de71d | Python | rLoopTeam/eng-software-pod | /TEST_DATA/2016_11_17/filter_laser_data.py | UTF-8 | 6,240 | 3.140625 | 3 | [] | no_license | #!/usr/bin/env python
# File: filter_laser_data.py
# Purpose: Filter the and laser sensor data from accel_laser_data.csv and output original and filtered data
# Author: Ryan Adams (@ninetimeout)
# Date: 2016-Dec-18
# Running this file: python filter_laser_data.py -i accel_laser_data.csv
#################... | true |
04637a8b95fb28c3bd32b023f38158339dbcc5a4 | Python | botaklolol/Kattis | /exponial.py | UTF-8 | 1,100 | 3.3125 | 3 | [] | no_license | import sys,math
def sieve(n):
mark = [True for i in range(n+1)]
p=2
primes = []
while(p*p <= n ):
if (mark[p] == True):
for i in range(2*p,n+1,p):
mark[i] = False
p +=1
for i in xrange(2,n+1):
if mark[i]:
primes.append(i)
return p... | true |
e58f16f9fe5ac3499261c1a9f836e2136c85fd30 | Python | prashanthr11/Codevita-Practice | /Logic Pyramid.py | UTF-8 | 526 | 3.46875 | 3 | [] | no_license | from collections import defaultdict
def getlen(x):
s = list(map(str, x))
return len(s)
for i in range(int(input())):
n = int(input())
a, b = 3, 2
d = defaultdict(list)
for i in range(n + 1):
for j in range(i):
x = a * b
y = "0" * (5 - getlen(str(x)))
... | true |
3db2719171836d070d2a43a0061cc95140c83e77 | Python | dwagon/pydominion | /dominion/cards/old/Card_Mandarin.py | UTF-8 | 2,395 | 2.734375 | 3 | [] | no_license | #!/usr/bin/env python
import unittest
from dominion import Card, Game, Piles
###############################################################################
class Card_Mandarin(Card.Card):
def __init__(self):
Card.Card.__init__(self)
self.cardtype = Card.CardType.ACTION
self.base = Card.C... | true |
6c38904db35073eb3a7bc288248f3595dea75d69 | Python | princewang1994/markdown_image_uploader | /util.py | UTF-8 | 2,204 | 3.046875 | 3 | [
"MIT"
] | permissive | import os
import time
import random
import re
from PIL import Image
import errno
def mkdirs(newdir):
try:
os.makedirs(newdir)
except OSError as err:
# Reraise the error unless it's about an already existing directory
if err.errno != errno.EEXIST or not os.path.isdir(newdir):
... | true |
89e822d230637a2c2cc7f67738fcca56dd75c30b | Python | julian59189/ThePythonMegaCourse | /exercises/CodingExercise1.py | UTF-8 | 308 | 3.9375 | 4 | [] | no_license | import sys
usr_inp = int(input("Enter the temperature in Degree: "))
#print("You entered: " + usr_inp)
def cel_to_fahr(temp_in_celsius):
temp_in_fahrenheit = ((temp_in_celsius * 9) / 5) + 32
return temp_in_fahrenheit
usr_out = cel_to_fahr(usr_inp)
print("Temperature in Fahrenheit: %d" % usr_out)
| true |
942157adc65f868018c8ad3379449611a9d1574a | Python | vritser/leetcode | /python/374.guess_number_higher_or_lower.py | UTF-8 | 433 | 3.484375 | 3 | [] | no_license | # https://leetcode.com/problems/guess-number-higher-or-lower/
class Solution:
def guessNumber(self, n: int) -> int:
l , r = 1, n
while l <= r:
m = int((l + r) / 2)
cmp = guess(m)
if cmp == 0:
return m
elif cmp == 1:
l ... | true |
73fbb6e5969185fd9d6187d24502755880b359b5 | Python | skanin/NTNU | /Informatikk/Bachelor/H2018/Studass/ù7/slicing av strenger/õ7_slicing av strenger_a.py | UTF-8 | 107 | 3.265625 | 3 | [] | no_license | def sliStr(string):
return string[0:len(string):4]
x = str(input('Oppgi streng: '))
print(sliStr(x))
| true |
ea0a170095ef1de22227d32457f65a42bd2399d2 | Python | lmfit/lmfit-py | /lmfit/confidence.py | UTF-8 | 15,312 | 3.265625 | 3 | [
"MIT",
"BSD-3-Clause"
] | permissive | """Contains functions to calculate confidence intervals."""
from warnings import warn
import numpy as np
from scipy.optimize import root_scalar
from scipy.special import erf
from scipy.stats import f
from .minimizer import MinimizerException
CONF_ERR_GEN = 'Cannot determine Confidence Intervals'
CONF_ERR_STDERR = f... | true |
fceeee920da4b94d4bb7f56b2063ecaed6c0584d | Python | tClown11/Python-Student | /test/textday/days13(20180401)/第七章------变量作用域规则.py | UTF-8 | 98 | 2.6875 | 3 | [] | no_license | #书P159----160
b = 6
def f1(a):
global b
print(a)
print(b)
b = 9
f1(3)
print(b) | true |
0aec2f3842f7b20ea119ee2a28531669d9032ce6 | Python | mehulbhuradia/DIA-Pacman | /ReinforcementLearningExp2.py | UTF-8 | 1,681 | 2.765625 | 3 | [] | no_license | import matplotlib.pyplot as plt
from pacman import *
import ghostAgents
import layout
import textDisplay
import graphicsDisplay
import copy
## set up the parameters to newGame
timeout = 30
layout = layout.getLayout("mediumClassic")
pacmanType = loadAgent('ApproximateQLearningAgent', True)
numGhosts = 1... | true |
f5029fced993d28c2b663b373678054740cc2536 | Python | talitore/99-projects | /3/python.py | UTF-8 | 407 | 4.25 | 4 | [] | no_license | print("Find all prime factors of a number!")
print("Enter a number: (max 5000)")
digit = 0
while True:
digit = int(input())
if digit > 0 and digit < 5001:
break
print("Must be a number between 0 and 5001!")
print("Enter a number: ")
factors = []
for i in range(2,digit):
while digit % i == 0:
f... | true |
6290423028ead20e1fc99eb71854c212d0f3ebbb | Python | shravankumar0811/Coding_Ninjas | /Introduction to Python/4 Patterns 1/Character Pattern.py | UTF-8 | 301 | 3.828125 | 4 | [] | no_license | ##Print the following pattern for the given N number of rows.
##Pattern for N = 4
##A
##BC
##CDE
##DEFG
## Read input as specified in the question
## Print the required output in given format
n=int(input())
for i in range(n):
for j in range(i,i*2+1):
print(chr(65+j),end="")
print()
| true |
df3dbb1eadcf9b36caa9f829842ad777842490c5 | Python | JonathanMichaelEdwards/COSC-264--Wireless_Communications | /Labs/Lab 3/connection_setup_delay_1.py | UTF-8 | 929 | 3.015625 | 3 | [] | no_license | def connection_setup_delay(cableLength_km, speedOfLight_kms, dataRate_bps, messageLength_b, processingTimes_s):
"""
Let L stand for the length of one link in km, c stand for the speed of light on the cable (in km/s),
R stand for the data rate available on either of the links (in bps), M stand for the lengt... | true |
0687942cac93f9b6b91e86a24f9bda1c5c2cbc30 | Python | haalogen/LPTHW | /text_rpg.py | UTF-8 | 717 | 3.421875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Text console RPG
Stats:
* health
* strength (attack power)
* agility (evasion probability)
stat_list = []
Mobs
* Level 1 -- Crab -- 1 gold
* Level 2 -- Demon -- 2 gold
* Level 3 -- Dragon -- 4 gold
mobs_list = []
Levels -> stat upgrades
Lvl 1 exp (0/100)
* health 100
* gold 5
... | true |
b56632112d5343b986d535670d80127b60cc1b34 | Python | liucheng2912/py | /leecode/easy/208/657.py | UTF-8 | 500 | 3.53125 | 4 | [] | no_license | '''
思路:
字典存放 比较四个值是否相等
'''
def f(moves):
d={}
for i in moves:
if i not in d:
d[i]=1
else:
d[i]+=1
if len(d)==2:
if d.setdefault('L')==d.setdefault('R') or d.setdefault('U')==d.setdefault('D'):
return True
elif len(d)==4:
if d.setdefault... | true |
e3fccf439d56d39fa64ae27ba43c569654235d10 | Python | realansgar/Transfer_CNN_IMU | /preprocessing.py | UTF-8 | 12,984 | 2.890625 | 3 | [] | no_license | from argparse import ArgumentParser
import json
from glob import iglob
import os
import numpy as np
from config import *
from sliding_window import sliding_window
def delete_labels(data, label_mask):
"""
Deletes all rows with labels not in label_mask from data
:param data: 2darray with shape (rows, columns)
:... | true |
529fda6a0a852f162e90fdaeeb67ddd1cbb6100b | Python | CD3/pyErrorProp | /testing/test_errorpropagator.py | UTF-8 | 3,837 | 2.796875 | 3 | [
"BSD-2-Clause",
"MIT"
] | permissive | # -*- coding: utf-8 -*-
import pint, numpy
from pyErrorProp import *
import pytest
from Utils import Close
from inspect import signature
import sympy
ureg = pint.UnitRegistry()
Q_ = ureg.Quantity
UQ_ = ureg.Measurement
def test_error_prop_decorator_signatures():
@WithError
def func(x,y):
return x*y
a... | true |
73dc9222a9d2e12c03379decb6bb462104e0b64c | Python | mathvolcano/leetcode | /0095_generateTrees.py | UTF-8 | 1,095 | 3.828125 | 4 | [] | no_license | """
95. Unique Binary Search Trees II
https://leetcode.com/problems/unique-binary-search-trees-ii/
"""
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def ... | true |
d9c9592bcc6fe77b6271ddf7022f1bd647a83cfe | Python | vastus/qsck | /qsck/format_cli.py | UTF-8 | 531 | 2.890625 | 3 | [
"Unlicense"
] | permissive | """Module providing the `qs-format` command-line tool."""
import click
import ujson
from . import serialize
@click.command()
@click.argument('input_json_file', type=click.File())
def qs_format(input_json_file):
"""Reads JSON file with one record per line, outputs .qs records to stdout.
"""
for row in i... | true |
3e92ac93c33a5c99b3ef7efb55df5ecce20e2807 | Python | MrLYC/ycyc | /ycyc/ycollections/serial_list.py | UTF-8 | 1,025 | 3.09375 | 3 | [
"MIT"
] | permissive | from ycyc.ycollections.heap import Heap
class SerialListItem(object):
def __init__(self, sn, value):
self.sn = sn
self.value = value
class SerialList(object):
def __init__(self, sn=0, reverse=False):
self.next_sn = sn
self.heap = Heap(cmp_attrs=["sn"], reverse=False)
def... | true |
3b6a7eac548cc0a2a4f9ba53fa97397a0b4edb23 | Python | MatehElismar/file-uploader | /fs.py | UTF-8 | 2,530 | 2.78125 | 3 | [] | no_license | import os
import sys
count = 0
tabs = ''
json = {'name': 'dirObject'}
def dirToJSON(json, path):
look(json, path)
for prop in list(json):
parentPath = os.path.join(path, prop)
isDir = look(json[prop], parentPath)
if(isDir):
dirToJSON(json[prop], parentPath)
... | true |
452320e7b40a0d12f1ec9f13365623b78b135ef1 | Python | Nanthini10/Similar-Duo | /minHash.py | UTF-8 | 6,746 | 3.453125 | 3 | [] | no_license | '''
@author: nanthini, harshat
'''
import pandas as pd
import numpy as np
from numpy import random
import matplotlib.pyplot as plt
from scipy.sparse import find
import itertools
import numpy.matlib
# Our implementation to read in the csv file ,
# Due to computation time and memory constraints, we only consider the fir... | true |
8b26b543fc89b8becd2b22a3aa225ab46a75bd0d | Python | Rgveda/Riskfolio-Lib | /riskfolio/ParamsEstimation.py | UTF-8 | 17,502 | 3.203125 | 3 | [] | permissive | import numpy as np
import pandas as pd
import statsmodels.api as sm
import sklearn.covariance as skcov
def mean_vector(X, method="hist", d=0.94):
r"""
Calculate the expected returns vector using the selected method.
Parameters
----------
X : DataFrame of shape (n_samples, n_features)
Feat... | true |
d32cb01ca6b985146349f96219d1d6c07b9c5532 | Python | francoisdelarbre/DeepLearningProject | /predict_masks.py | UTF-8 | 2,873 | 2.5625 | 3 | [] | no_license | """predict masks and save them as files in the corresponding folders; this script predict masks from the validation
set, to predict masks from the test sets, see make_submission (that directly outputs .csv files for submission)"""
import argparse
import cv2
import random
from utils import split_train_val
from pathlib ... | true |
7053fc12a65739cd66faac579fc09b7d70a4ac35 | Python | alejom99/MECEE4520 | /lecture_4/airflow/docker-airflow/dags/airflow_example_1.py | UTF-8 | 1,006 | 2.8125 | 3 | [] | no_license |
#import time
#import logging
import airflow
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
from datetime import datetime, timedelta
#from pprint import pprint
# Create the DAG object
args = {
'owner': 'airflow',
'start_date': airflow.utils.dates.days_ago(2),
}
dag = DAG... | true |
ca0d70750aa6b8004d1f5561bf9f5a59c2f13da4 | Python | IgorFroehner/NEARPriceTwitterBot | /main.py | UTF-8 | 603 | 2.53125 | 3 | [
"MIT"
] | permissive | from time import sleep
from decouple import config
from bot import Near
from bot import Twitter
if __name__ == '__main__':
near = Near()
twitter = Twitter()
CURRENCY = config('CURRENCY_TO_CONVERT')
TEXT_LAST_24_HRS = config('TEXT_LAST_24_HRS')
sleep_time = 86400 / int(config('TWEETS_PER_DAY'))
... | true |
dcd1ef84a59bd012e4c350abe8fd3ef3bcf9b480 | Python | Wehrheimer/Neuro_Evolution_SUMO | /DDPG.py | UTF-8 | 23,388 | 2.75 | 3 | [] | no_license | import tensorflow as tf
import numpy as np
from tensorflow.keras.layers import Dense, BatchNormalization
from copy import copy
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from time import time
import time
class DDPG:
"""DDPG Controller. It uses an actor NN as policy pi(s|the... | true |
938a1327547be0312ebecdf2b9a588f9d3c86848 | Python | ssteo/websockets | /example/hello.py | UTF-8 | 270 | 2.78125 | 3 | [
"BSD-3-Clause"
] | permissive | #!/usr/bin/env python
import asyncio
from websockets.sync.client import connect
def hello():
with connect("ws://localhost:8765") as websocket:
websocket.send("Hello world!")
message = websocket.recv()
print(f"Received: {message}")
hello()
| true |
efe869ed872500fe5cee0eb846d109ecd79755e8 | Python | Vagacoder/Codesignal | /python/Arcade/Python/P04LanguageDifference.py | UTF-8 | 943 | 4.1875 | 4 | [] | no_license | #
# * Python 04, Language Difference
# * Easy
# * Your friend is an experienced coder who just started learning Python. Since
# * she is already proficient in Java and C++, she decided to write all of her
# * snippets in all three languages, in order to ensure the Python code was working
# * as expected. Here's the... | true |
8fbdb2d721c660151d56f8e6bec236a18c167eba | Python | met1366/FlowLens | /Security Tasks Evaluation/WFAnalysis/SingleWebsiteAnalysis/generateFigures.py | UTF-8 | 9,440 | 2.796875 | 3 | [] | no_license | import os
from decimal import Decimal
import numpy as np
import csv
import matplotlib
if os.environ.get('DISPLAY','') == '':
print('no display found. Using non-interactive Agg backend')
matplotlib.use('Agg')
import matplotlib.pyplot as plt
colors = ["0.8", "0.6", "0.2", "0.0"]
colors = ["salmon", "lightsteel... | true |
ad9b9c83abbd3b4d23832ecb0c1a868d625eefdc | Python | LBJ-Wade/microhalo-models | /examples/annihilation-suppression/profiles.py | UTF-8 | 9,939 | 2.546875 | 3 | [
"MIT"
] | permissive | import numpy as np
from scipy.special import spence
log2 = np.log(2)
log4 = np.log(4)
supported_params = [
[1,3,1], # NFW
[1,3,1.5], # Moore
[2,3,0], # cored
]
def density_norm(params):
if params == [1,3,1]:
return 1.
elif params == [1,3,1.5]:
return .5
elif params == [2,3,... | true |
5d8764a7a834e3faf3514021e5ab8218a355211e | Python | dencynluv/hackbright-project | /processing_notes_data.py | UTF-8 | 1,549 | 3.171875 | 3 | [] | no_license | """Function to save user's note"""
from model import db, User, Note
from flask import session as flask_session
def save_note(new_note):
user = User.query.get(flask_session.get('current_user'))
# user.notebooks returns a list of notebooks the user has,
# that is why I need to hard code for [0] to get th... | true |
52b1beda03b89c057bb612be027a73aafc330a56 | Python | zedz65/pythonweek1 | /scoreselif.py | UTF-8 | 218 | 3.359375 | 3 | [] | no_license | bio = float(input("input biology"))
chem = float(input("input chemistry"))
phy = float(input("input physics"))
score = (bio+chem+phy)/3
if score >= 40:
print("you have passed")
else:
print("you have failed") | true |
9267721ca295b18bd11a0f2140d4eae2f1bfaaa5 | Python | MohamedAli1995/Cifar-100-Classifier | /src/testers/tiny_vgg_tester.py | UTF-8 | 1,703 | 2.5625 | 3 | [
"MIT"
] | permissive | import tensorflow as tf
from src.base.base_test import BaseTest
from tqdm import tqdm
import numpy as np
import cv2
from src.data_loader.preprocessing import preprocess_input_image
class TinyVGGTester(BaseTest):
def __init__(self, sess, model, data, config, logger):
super().__init__(sess, model, data, confi... | true |
b4a3b2a1d23ee26a7674305f8967c5542881635f | Python | byung-u/HackerRank | /PYTHON/Itertools/product.py | UTF-8 | 237 | 3.140625 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python3
from itertools import product
if __name__ == '__main__':
x = list(map(int, (input().split())))
y = list(map(int, (input().split())))
for n in list(product(x, y)):
print(n, end=" ")
print()
| true |
0647a51ffe2ebc8f7ce33bb1e27e163b5f0f1af0 | Python | travisjungroth/algo-drills | /algorithms/dfs_components_grid.py | UTF-8 | 745 | 3.234375 | 3 | [
"MIT"
] | permissive | """
ID: ba4cc08e-3863-4e99-ab10-24cdf75c93a0
"""
from collections.abc import Iterable, Sequence
def dfs_components_grid(grid: Sequence[Sequence[int]]) -> Iterable[set[tuple[int, int]]]:
"""On a grid of 0s and 1s, find all the components of 1s."""
unseen = {(r, c) for r, row in enumerate(grid) for c, n in enum... | true |
ce610371e185b3c842c5cde73ee4e2383c256761 | Python | delecui/oneAPI-samples | /AI-and-Analytics/Getting-Started-Samples/IntelPyTorch_GettingStarted/PyTorch_Hello_World.py | UTF-8 | 5,071 | 2.84375 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #!/usr/bin/env python
# encoding: utf-8
'''
==============================================================
Copyright © 2019 Intel Corporation
SPDX-License-Identifier: MIT
==============================================================
'''
import torch
import torch.nn as nn
from torch.utils import mkldnn
from torch.... | true |
bf4c08a0089729641a8eca348f16e5c28ff24de6 | Python | daniel10012/python-onsite | /week_05/sqlalchemy/slack/slack_create.py | UTF-8 | 2,131 | 2.90625 | 3 | [] | no_license | '''
Building on the example more_APIs/00_slack, make a new database with two tables to model this object:
{
"link": "the fetched URL",
"description": "short blurb describing the resource (if available)",
"date_added": "when was it posted?",
"read": False # defaults to False, change to... | true |
9cf09dfaa0cce93740521c831079ff07891f1993 | Python | GamersElysia/kunkkas-plunder | /kunkkasplunder/processors/fogofwar.py | UTF-8 | 847 | 2.5625 | 3 | [] | no_license | import pygame
from ..components import Grid, Position
from ..config import *
from ..ecs import Processor
class FogOfWar(Processor):
def __init__(self, entity, radius=0):
super().__init__()
self.entity = entity
self.radius = radius
self.dirty_tile_tracker = None
def update(se... | true |
3753b19ac85641e6da096d517ef9694a169e8d9e | Python | primatera/py4e | /py4e/py4e.py | UTF-8 | 1,195 | 2.671875 | 3 | [] | no_license | ## Coursera - Python for Everybody Specialization [Course Audit]
## - University of Michigan
## - Instruction: Dr. Charles Russell Severance
## - IDE: Visual Studio Community 2019, v16.4.5
## - Python 3.7.5
print("Python for Everybody - Assignments\n")
# Course 1: Getting Started w... | true |
5c8ca94b9e88708641dd92ed4a905e88f00204ea | Python | mertys/PyhtonApp | /Depo/Files/friends.py | UTF-8 | 670 | 3.390625 | 3 | [] | no_license | import sqlite3
connection = sqlite3.connect('friend.db')
cursor = connection.cursor()
# cursor.execute("CREATE TABLE friends(first_name TEXT , last_name TEXT , age INTEGER)")
# cursor.execute("INSERT INTO friends VALUES ('Mert' , 'Yurtseven' , '29')")
# cursor.execute("SELECT * FROM friends WHERE first_name = 'Mahmut'... | true |
37317fd643ae0347da253848130af0796e71a05a | Python | jmg1297/thesis | /bl6_rna-seq_alignment/src/summarise_alignment.py | UTF-8 | 9,275 | 3.03125 | 3 | [] | no_license | '''
Script to summarise read mapping with STAR to produce two barcharts.
One barchart showing percentages, one showing number of reads.
Each sample will show number unmapped, number assigned to rRNA, number uniquely
mapped, and number mapping to multiple locations.
Also produce density plots of alignment scores
'''
im... | true |
f590565e2a90717847ff4d1e0c87ad024be87e49 | Python | LarisaOvchinnikova/python_codewars | /Reverse every other word in the string.py | UTF-8 | 170 | 3.015625 | 3 | [] | no_license | # https://www.codewars.com/kata/58d76854024c72c3e20000de
def reverse_alternate(s):
return " ".join([el if i % 2 == 0 else el[::-1] for i, el in enumerate(s.split())]) | true |
1956b67c83cb1b5277d10ad44829d8b2ac3803eb | Python | kevmo/flaskr | /app.py | UTF-8 | 3,349 | 2.75 | 3 | [] | no_license | import os
import sqlite3
## request = current request object
## g = general purpose variable associated with current app context
from flask import Flask, request, session, g, redirect, url_for, abort, render_template, flash
#create app
app = Flask(__name__)
# Load Default config
app.config.from_object(__name__)
# ... | true |
d179ac9133fe59b1c2e1b0270439746ee480c2cd | Python | forksbot/byceps | /byceps/services/seating/seat_group_service.py | UTF-8 | 5,727 | 2.53125 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | """
byceps.services.seating.seat_group_service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2021 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from typing import Optional, Sequence
from ...database import db
from ...typing import PartyID
from ..ticketing.dbmodels.tic... | true |
0866798f39d17769c0cf54a114b3129e2cb426c6 | Python | leandromarson/PythonWorks | /03 - operators/des6.py | UTF-8 | 127 | 3.78125 | 4 | [] | no_license | real = float(input("Digite quantos R$ tem na carteira: "))
dolar = real/3.27
print("R${} é igual a US${}".format(real,dolar)) | true |
267102703847de354f4219eff90e44db33f29883 | Python | malfaroe/Framework | /src/validation.py | UTF-8 | 2,277 | 2.53125 | 3 | [] | no_license | #Testing loading models and predict
import os
import config
import model_dispatcher
import argparse
import joblib
import pandas as pd
from sklearn import metrics
from sklearn import tree
import numpy as np
from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split
from s... | true |
0fb31408120c48343bf626fc9086d4c21ac2a450 | Python | MrOswaldDoring/Name-Generator | /script.py | UTF-8 | 740 | 3.875 | 4 | [] | no_license | import random
vowels = "aeiouy"
consonants = "bcdfghjklmnpqrstvwxz"
user_name = ""
inputs = []
user_input_1 = input("How many letters would you like the name to be?: ")
user_input_2 = input("How many names would you like to generate?: ")
name_length = int(user_input_1)
num_of_names = int(user_input_2)
for num in r... | true |
587562c9903c8c9f2118e958ac445af12b7a256d | Python | chinaylssly/mooc | /mysql.py | UTF-8 | 1,028 | 2.625 | 3 | [] | no_license | # _*_ coding:utf-8 _*_
from My_MySQL import MySQL
class mysql(MySQL):
def __init__(self,):
super(mysql,self).__init__(db='mooc')
def test(self,):
query='show tables'
data=self.execute(query)
def create_table_category(self,):
query='create table category(id bigi... | true |
cf62fdf6bd7b715458e0d10b9a4a76a2ab637f9d | Python | Lcxiv/TikTok | /Scripts/Tiktok.py | UTF-8 | 2,205 | 2.703125 | 3 | [] | no_license | from TikTokApi import TikTokApi
import pandas as pd
api = TikTokApi()
#collect videos from specific user
n_videos = 100
username = 'washingtonpost'
user_videos = api.byUsername(username, count=n_videos)
def simple_dict(tiktok_dict):
to_return = {}
to_return['user_name'] = tiktok_dict['author']['uniqueId']
to_... | true |
0c866223d8417bd7195b2b2641ab83760b3d90cf | Python | xuanmitang/jira-crawler | /jiraboard/spiders/story_status_spider.py | UTF-8 | 5,489 | 2.515625 | 3 | [] | no_license | import argparse
import json
from datetime import datetime
from http.cookiejar import MozillaCookieJar
import scrapy
from bs4 import BeautifulSoup
from scrapy.crawler import CrawlerProcess
class StoryStatusSpider(scrapy.Spider):
name = 'storyStatusSpider'
def __init__(self, cookies, jql, *args, **kwargs):
... | true |
70a74c767a335dd2520d7cfb7d6ef88440e9e768 | Python | picopoco/gongsi | /restServer/mysqlclient.py | UTF-8 | 678 | 2.875 | 3 | [] | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pymysql
# MySQL Connection 연결
conn = pymysql.connect(host='localhost', user='root', password='ggoggoma',
db='admin_console', charset='utf8')
# Connection 으로부터 Dictoionary Cursor 생성
curs = conn.cursor(pymysql.cursors.DictCursor)
# SQL문 실행
sq... | true |
d6e6e698723e6a7f33502eeddd543ee4f529968d | Python | mikewill4/interview-prep | /LeetCode/Solutions/#168/solution.py | UTF-8 | 392 | 3 | 3 | [] | no_license | class Solution:
def convertToTitle(self, n: int) -> str:
output_str = ""
while n > 26:
char_n = chr(n % 26 + 64)
if char_n == "@":
char_n = "Z"
n -= 1
output_str = char_n + output_str
n = n // 26
char_n = chr(n +... | true |
29c37aa57ec28fa450f31b8d3e5576946508698f | Python | scresante/codeeval | /filename_pattern.py2 | UTF-8 | 692 | 2.859375 | 3 | [] | no_license | #!/usr/bin/python
from sys import argv
try:
FILE = argv[1]
except NameError:
FILE = 'tests/169'
DATA = open(FILE, 'r').read().splitlines()
import re
for line in DATA:
if not line:
continue
words = line.split(' ')
rawRE = words.pop(0)
rawRE = rawRE.replace('.' , '\.')
rawRE = rawRE.... | true |
ac0d0a57f044185b8462c702d09e7f94e9264c18 | Python | philzook58/python | /python/numpy_files/mymeshpy.py | UTF-8 | 831 | 2.796875 | 3 | [] | no_license | from meshpy.triangle import MeshInfo, build, refine
import numpy as np
mesh_info = MeshInfo()
mesh_info.set_points([
(0,0),
(0,1),
(1,1),
(1,0)
])
mesh_info.set_facets([
[0,1],
[1,2],
[2,3],
[3,0]
])
def refinement_func(tri_points, area):
max_area=0.001
return bool(a... | true |
e988e48ef9a9586a0e87005f3cb0800db33bf61e | Python | mrs159/titanic | /titanic.py | UTF-8 | 3,393 | 3.296875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Sat Mar 21 00:14:54 2020
@author: Meng
"""
import pandas as pd #pandas处理数据
import seaborn as sb
import matplotlib.pyplot as plt
import numpy as np #numpy数学函数
from sklearn.linear_model import LinearRegression #导入线性回归
from sklearn.model_selection import KFold #导入交叉验证
... | true |
4986c87d67784746343be1c1584fe930817d1643 | Python | bachya/aiolookin | /aiolookin/sensor.py | UTF-8 | 961 | 2.828125 | 3 | [
"MIT"
] | permissive | """Define endpoints to manage sensor data."""
from typing import Any, Awaitable, Callable, Dict, List, cast
from .errors import SensorError
class SensorAPI:
"""Define a sensor data object."""
def __init__(self, async_request: Callable[..., Awaitable]) -> None:
"""Initialize."""
self._async_r... | true |
d821c036a95bcafbef2d4dfc49a511ae5d8a8437 | Python | Creatica2020/DiscordBot | /main.py | UTF-8 | 658 | 2.78125 | 3 | [] | no_license | # main.py
import os
import discord
from dotenv import load_dotenv
load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')
client = discord.Client()
@client.event
async def on_ready():
print(f'{client.user.name} has connected to Discord!')
@client.event
async def on_member_join(member):
await member.create_dm()
... | true |
440bceb9da097e3ba42e81ba0c6c45d9a3aec44e | Python | AndrewOleksy/Homework1 | /ProblemRegex.py | UTF-8 | 1,047 | 3.75 | 4 | [] | no_license | ##### Problem #####
##### CNS-380/597 - Ryan Haley####
##### Andrew Oleksy Homework #1 2018-04-01 #####
import re
#Write a regular expression to fit the following:
#1 Phone number in the format of
# xxx-xxx-xxxx
def phone1(num):
num = str(num)
regex = '\d{3}\-\d{3}\-\d{4}'
match = re.findall(regex,num)
... | true |
30e3a71b47cac4c72a6874ccfeec8a2306be3363 | Python | world9781/urwidx | /ux/menutest.py | UTF-8 | 1,163 | 2.59375 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"MIT"
] | permissive | #!/usr/bin/env python
import app, form, urwid, layout, edit, menu
def q (*a):
raise urwid.ExitMainLoop()
m = menu.Menu(text=None, contents=[
menu.MenuDivider(),
menu.MenuItem(text="Exit", function=q),
menu.MenuDivider(),
menu.MenuItem(text="Test 1"),
menu.SubMenu(text="Sub-... | true |
acfba1ed3459071644da359f6db0acdc8085dd56 | Python | L200170072/prak_asd_b | /MODUL 5/Nomor 01.py | UTF-8 | 1,280 | 2.890625 | 3 | [] | no_license | class MhsTIF(object):
def __init__(self, nama, umur, kota, NIM):
self.nama = nama
self.umur = umur
self.kotaTinggal = kota
self.nim = NIM
def __str__(self):
x = self.nim
return x
def getnim(self):
return self.nim
c0 = MhsTIF('pipo', 10... | true |
122fbca7aa4c49f5a348261caca7902aebb5bfd7 | Python | dliu18/ngram | /Web/ngram.py | UTF-8 | 5,136 | 2.875 | 3 | [] | no_license | from nltk.sentiment.vader import SentimentIntensityAnalyzer
import json
import sys
from flask import Flask
from flask import request
def detect(headline, keywords):
keyword_list = keywords.split('_')
headline_list = headline.split(' ')
for i in range(0, len(headline_list) - len(keyword_list) + 1):
if headline_li... | true |
0ce00a28e465cb7e537def5af56e9f923c91dbb6 | Python | xqinglin/SI507-HW03-xqinglin | /magic_eight.py | UTF-8 | 1,465 | 3.671875 | 4 | [] | no_license | from random import randint
def ask():
print("what is your question?")
que = input()
return que
def pick_an_answer():
answer_list = []
answer_list.append("It is certain.")
answer_list.append("It is decidedly so.")
answer_list.append("Without a doubt.")
answer_list.append("Yes - definit... | true |
f5847fac4826df8e87454a60e1352352a2b3d892 | Python | alejodeveloper/App-Weather | /weather_app/weather/exceptions.py | UTF-8 | 591 | 2.71875 | 3 | [
"MIT"
] | permissive | """
weather.exceptions
------------------
Exceptions for weather django app
"""
class CityDoesNotExistsException(Exception):
def __init__(self, message: str = None, *args, **kwargs):
if message is None:
message = "The queried city object doesn exists"
Exception.__init__(self, message,... | true |
d99d28f8368e9eb908f9453122c6b05c0481421b | Python | aorura/tensorProject | /DL/Day02_tfTest1.py | UTF-8 | 1,004 | 3.28125 | 3 | [] | no_license | # import tensorflow as tf
#
# # hello=tf.constant('hi')
# sess=tf.Session()
# # print(sess.run(hello))
# # print(str(sess.run(hello), encoding='utf-8'))
#
# # a=tf.constant(5)
# # b=tf.constant(3)
# # c=tf.multiply(a,b)
# # d=tf.add(a,b)
# # e=tf.add(c,d)
# # print(sess.run(e))
#
# # a=tf.constant([5])
# # b=tf.constan... | true |
19659da56dfd0eedaa8733afc339226df5c92677 | Python | juliakimchung/sets | /cars.py | UTF-8 | 893 | 3.34375 | 3 | [] | no_license | showroom = set()
showroom.add("Lexus")
showroom.add("CRV")
showroom.add("Highlander")
showroom.add("ZEN")
print(len(showroom))
showroom.add("Lexus")
showroom.update(["coupe", "BMW"])
print(len(showroom))
print(showroom)
showroom.add("Rangelover")
showroom.update(["Kia","Hyundai" ])
print(len(showroom))
print(showroom)
... | true |
2eae373b55ea8a156a656cc272e882c5b4cd57cf | Python | Joss-Briody/random | /async_web/async_client.py | UTF-8 | 1,611 | 2.609375 | 3 | [] | no_license | import time
from aiohttp import ClientSession, TCPConnector
import asyncio
import sys
from tqdm import tqdm
total_requests = int(sys.argv[1])
max_calls_in_flight = int(sys.argv[2])
port = sys.argv[3]
async def fetch(url, session):
async with session.get(url) as response:
return await response.read()
... | true |
ec68202dd4f24514bd77b65500423e2140d9ef39 | Python | zhourouke/PythonLearn | /Learn/Weather/WeatherTool.py | UTF-8 | 2,461 | 2.765625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
import requests
import json
# from city import *
# 1. 调用国外网站接口
# api = "http://freegeoip.net/json/%s" % ip
# 2. 百度地图
# address = "福建省"
# url = 'http://api.map.baidu.com/geocoder?output=json&kef247cdb5g2eb43ebac6ccd27f7g6e2d2&address='+str(address)
# 4. 这个最快,但是没有精确位置就是,返回GB2312编码的字符串,微笑
# api... | true |
26628525c7b933e62714a2cd8d76c367a61dc03a | Python | QuantumDimPap/AUEB-Invoicer | /classification_model_functions.py | UTF-8 | 1,536 | 3 | 3 | [] | no_license | #the packages we are gonna use for developing our model are:
import cv2 #for image manipulation
import numpy as np #for arrays
import os
from random import shuffle
#function for labeling an image
def label_img(tag):
if tag == 'KARAMIKOLA' : return [1,0,0,0,0]
elif tag == 'OTE' : return [0,1,0,0,... | true |
70d753f96c7a71648778c04bc7a1fe4acd77d070 | Python | supremepoison/python | /Day13/Code/mydeco.py | UTF-8 | 427 | 3.546875 | 4 | [] | no_license | #以下函数是装饰器函数,fn用来绑定被装饰函数
def mydeco(fn):
def fx():
print("-------------这是fn被调用之前--------------")
fn()
print("-------------这是fn被调用之后--------------")
return fx
# @mydeco
def myfunc():
print("myfunc 被调用!")
# 以上@mydeco 等同于在def myfunc之后加了如下语句
myfunc = mydeco(myfunc)
myfunc()
myfunc()
my... | true |
02b1d9e916842f7ab2d4495e79f2421bb0477a4a | Python | chrisortman/CIS-121 | /k0459866/Lessons/ex19.py | UTF-8 | 1,420 | 3.703125 | 4 | [
"MIT"
] | permissive | # M A T H
import math
import random
#SCIENTIFIC NOTATION
part1 = 7.04
part2 = (10^7)
big_num = part1 * part2
big_num2 = 7.04*10e6
print "part1 is equal to %s" % part1
print "part2 is equal to %s" % part2
print "big_num is equal to %s" % big_num
print "but big_num2 is equal to %s" % big_num2
print ""
###################... | true |
fc28044a89314b865c69c59f4c847c40b8a06be8 | Python | ronijpandey/Python-Apps | /Twitter-spider/twitterJoin.py | UTF-8 | 674 | 3.0625 | 3 | [] | no_license | # retrieve connections for user having id=2 from database
import sqlite3
conn=sqlite3.connect('friends.sqlite')
cur=conn.cursor()
cur.execute('SELECT * FROM People')
count=0
print 'People:'
for row in cur:
if count<5:
print row
count=count+1
print count,'rows.'
cur.execute('SELECT * FROM Follows')
co... | true |
f4b63c98c8f96edff54ced79a5f1e7a2fbc80f83 | Python | dinaramairambaeva/PP2_2021 | /week 5/vowels.py | UTF-8 | 156 | 2.890625 | 3 | [] | no_license | import re
s=input()
ans = re.findall(r"[^aeiuoAEIOU]([aeiuoAEIOU]{2,})(?=[^aeiuoAEIOU])",s)
if ans:
for x in ans:
print(x)
else:
print(-1) | true |
f130ab0b4c59b20f0fb2b06cf32e49742107994d | Python | dhk112/coding-for-office-workers | /week-01-python/gugu.py | UTF-8 | 346 | 3.6875 | 4 | [] | no_license | # dan = int(input("몇 단을 출력하시겠습니까?"))
# for num in range(1, 10):
# print("{} * {} = {}".format(dan, num, dan * num))
# print("구구단을 외자~! 구구단을 외자!")
# num1, num2 = 0, 0
# for num1 in range(2,10, 1):
# for num2 in range(1, 10, 1):
# print("{} * {} = {}".format(num1, num2, num1 * num2))
| true |
fe1d355e731644f935f6de1e44f700fb4f4ba9a5 | Python | bajajra30/PatientsLikeMeScrape | /PLM_depressed.6.10.15.py | UTF-8 | 15,732 | 2.78125 | 3 | [] | no_license |
# coding: utf-8
# In[77]:
import datetime
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.by import By
import os
import re
imp... | true |
ae0cb8335b62744a5565c1cf58c1990e4d5e5972 | Python | Villager-B/ShortcutCovid-19 | /w_corona_cheak.py | UTF-8 | 1,463 | 2.578125 | 3 | [
"MIT"
] | permissive | import requests
from bs4 import BeautifulSoup
import dialogs
import json
import datetime
headers = {
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36'}
url = "https://www.pref.wakayama.lg.jp/prefg/000200/covid19.html"
url2 = 'h... | true |
5e12a1a8358669ec2b3f7569986fd1457a95e091 | Python | melottii/notas | /MergeSort.py | UTF-8 | 2,715 | 3.578125 | 4 | [] | no_license | import pickle
def student(notas, alunos): #Função para somar a nota de cada aluno e chamar as ordenações das notas.
overall_grade, term = [], 0
for i in notas:
sum_of_assessments = notas[term][1] + notas[term][2] + notas[term][3] + notas[term][4]
overall_grade.append((term+1, sum_of_as... | true |
8b1a9ad132ee6a197fed845b241f32806e06dfaf | Python | walkeZ/Learning | /Python/1806/base_print_input.py | UTF-8 | 2,665 | 3.828125 | 4 | [] | no_license | # _*_ coding:utf-8 _*_
# 视频地址:https://v.qq.com/x/cover/9v3r1r0sdbyv41o/h01266d7rgp.html
print(10) # 控制台输出10 输出int数据
print(10.11) # 输出 10.11 float数据
print('H') # 输出 H char(字符)数据
print('Hello, World!,学习') # 输出 Hello, World! String 数据
print("H") # 输出 Hello char数据
print(... | true |
744b33f8b995dcc8355dacc4e86199ed9795ed68 | Python | ryan-c-edgar/functional-decomposition | /bin/fd_orthexp.py | UTF-8 | 2,136 | 2.625 | 3 | [] | no_license | #!/usr/bin/python
import os,argparse, ConfigParser
import numpy as np
import matplotlib.pyplot as plt
from Tools.OrthExp import ExpDecompFn
end = 10 # Maximum value to evaluate
Npt = int(1e6) # Number of points to use
Nbasis = 101 # Number of basis elements to evaluate
toplot ... | true |
4f6710879af0c46765f9b9129883ce0f85dd4063 | Python | elkin5/selenium-scripts | /login.py | UTF-8 | 574 | 2.890625 | 3 | [] | no_license | from selenium import webdriver
import time
driver = webdriver.Chrome(executable_path="drivers/chromedriver")
driver.maximize_window()
driver.get("https://opensource-demo.orangehrmlive.com/")
time.sleep(5)
# Se obtienen los elementos del login
username = driver.find_element_by_id("txtUsername")
password = driver.fin... | true |
1f48a70fcc98163caaf7a5fa6fbbc6ce01764a16 | Python | 425776024/Pythonic | /18.字典推导式.py | UTF-8 | 489 | 3.171875 | 3 | [] | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
mcase = {'a': 10, 'b': 34, 'A': 7, 'Z': 3}
print('mcase:', mcase)
print()
print('忽略key大小写,相加key的value,且过滤掉不是a,b的')
mcase_frequency = {
k.lower(): mcase.get(k.lower(), 0) + mcase.get(k.lower(), 0)
for k in mcase.keys()
if k.lower() in ['a', 'b']
}
print('mcase... | true |
a2394c4e1ed74b82b02ff3f44033bf72c3b784c8 | Python | meri-rtx/rtx | /sample/smp_googling.py | UTF-8 | 1,245 | 2.921875 | 3 | [] | no_license | from urllib.parse import quote_plus
from bs4 import BeautifulSoup
from selenium import webdriver
import pandas as pd
# $ pip install bs4
# $ pip install selenium
# $ pip install requests
# $ pip install pandas
baseUrl = 'https://www.google.com/search?q='
plusUrl = input('Search Keyword :')
url = baseUrl +... | true |