blob_id stringlengths 40 40 | language stringclasses 1
value | repo_name stringlengths 5 133 | path stringlengths 2 333 | src_encoding stringclasses 30
values | length_bytes int64 18 5.47M | score float64 2.52 5.81 | int_score int64 3 5 | detected_licenses listlengths 0 67 | license_type stringclasses 2
values | text stringlengths 12 5.47M | download_success bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|
0104d52964ed4a8be47f1adb264948bd6f41fbfa | Python | andresUnit/IconBack | /arquitectura/cognitoHandler/handler.py | UTF-8 | 1,751 | 2.75 | 3 | [] | no_license | import boto3
import os
def lambda_handler(event, context):
"""
Estas funciones estan diseñadas para que no pida verificar el usuario ya fue confirmado.
-------
event : dict
Contiene el formato de respuesta de api
"""
event['response']['autoConfirmUser'] = True
event['response']['... | true |
1abd5e4720ead2892dd3e3853800b6d8aceb4ee8 | Python | profMagija/anketiranje_public | /parser.py | UTF-8 | 7,735 | 3.078125 | 3 | [] | no_license | import anketiranje
TITLE = "title"
DESC = "desc"
PADEZI = {
"predavanje" : ("Predavanje", "predavanju"),
"aktivnost" : ("Aktivnost", "aktivnosti")
}
#? type samo sluzi da primi nepotreban parametar
#? ne koristimo to posle
def parse_title(red, _type, title):
"""
Vadi title iz fajla koji opisuje ank... | true |
fe5a8655dd8fddf0f2306c865cb355e9a7b5846c | Python | wuyou1102/HardwareAutomation | /libs/Utility/Common.py | UTF-8 | 3,622 | 2.53125 | 3 | [] | no_license | # -*- encoding:UTF-8 -*-
import subprocess
import logging
from libs import Command
import time
__logger = logging.getLogger(__name__)
class ExecuteResult(object):
def __init__(self, exit_code, outputs):
self._exit_code = exit_code
self._outputs = outputs
@property
def exit_code(self):
... | true |
44cac2fbc13303bbf7625f721304579ae9ed46a8 | Python | isakharam/Thirty-days-of-code-on-hackerrank | /day5.py | UTF-8 | 236 | 2.5625 | 3 | [] | no_license | #LOOPS
#!/bin/python3
import math
import os
import random
import re
import sys
if __name__ == '__main__':
n = int(input())
for i in range(1,11):
a=0
a=n*i
print("{} x {} = {}".format(n,i,a))
| true |
0579255ba7ef5cd28c44bdf25abc634d0a9871bd | Python | kescott027/s3upload | /rmxml.py | UTF-8 | 10,010 | 2.96875 | 3 | [] | no_license | #!/usr/bin/python
# coding=utf-8
"""rmxml.py - functions to handle parsing xml data
"""
import re
import xml.etree.ElementTree as ET
def delete_headers(source):
"""builds a replacement string discarding lines that have
header strings from the extracts dictionary"""
extracts = ['<result>', '<resultTotalRow... | true |
3866fcdb4c5109fac020df461606d6e43f90d14e | Python | alaxa27/AIPCloud_Platform | /app/src/aipcloud/statistics/regression.py | UTF-8 | 10,088 | 3.015625 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
# AIPCloud
#
# Author : Maxime Jumelle
# Date : 03/07/2017
import numpy as np
import math
from sklearn.svm import SVR
from sklearn.gaussian_process import GaussianProcessRegressor
import sklearn.gaussian_process.kernels as GPKernels
from ..exceptions import UnfittedException
from ..kernels im... | true |
6092ad378bb31da8c2007c53e98535c665de05e7 | Python | MyCodeBattle/LeetCode | /Valid Sudoku/solution.py | UTF-8 | 666 | 3.09375 | 3 | [] | no_license | class Solution(object):
def isValidSudoku(self, board):
"""
:type board: List[List[str]]
:rtype: bool
"""
vis1, vis2, vis3 = set(), set(), set()
for i in xrange(len(board)):
for j in xrange(len(board)):
if board[i][j] != '.':
... | true |
a12ef2729afcc2b980aa6b5d576fc8b773760776 | Python | zonanjaro86/atcoder | /python/src/abc136_b.py | UTF-8 | 196 | 3.328125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
n= int(input())
sum = 0
while (n > 0):
n_len = len(str(n))
cnt = n - 10 ** (n_len - 1) + 1
if n_len % 2 == 1:
sum += cnt
n -= cnt
print(sum)
| true |
457c82de72bfe292bba0169299313a3f7679ff35 | Python | Cu4rtas/TI_Unit_Tests | /unit_tests.py | UTF-8 | 1,519 | 3.53125 | 4 | [] | no_license | import unittest
import random
from program import exponencial
class ProgramTestMethods(unittest.TestCase):
def test_n_as_string(self):
"""
Test result when n is a number passed as a string
"""
x = random.randint(0,100)
exp = str(random.randint(0,100))
self.assertEqual... | true |
3f82c4440a0fcf581afb39d8f90eba08cdeea16c | Python | jonathanelbailey/PowerShell-Code-Samples | /Python/WikiScrape.py | UTF-8 | 665 | 2.703125 | 3 | [
"MIT"
] | permissive | ## This script was tested using Python 2.7.9
## The MWClient library was used to access the api. It can be found at:
## https://github.com/mwclient/mwclient
import mwclient
site = mwclient.Site(('https', 'en.wikipedia.org'))
site.login('$user', '$pass') # credentials are sanitized from the script.
listpage = site.Pag... | true |
b995d221e344d30f97168ffa9f9ede2bc5214d8e | Python | pythonanywhere/resolver_test | /resolver_test/__init__.py | UTF-8 | 1,543 | 2.578125 | 3 | [
"MIT"
] | permissive | # Copyright (c) 2011 Resolver Systems Ltd.
# All Rights Reserved
#
import unittest
from datetime import timedelta
from unittest.mock import call, MagicMock
class ResolverTestMixins(object):
def assertCalledOnce(self, mock, *args, **kwargs):
if mock.call_args_list == []:
self.fail('Not called... | true |
daf3942cf41c036f25aafa6913cb04dfd04152fe | Python | BeyouGo/IA_2018 | /pacman/testagent2.py | UTF-8 | 2,818 | 3.078125 | 3 | [] | no_license | # Complete this class for all parts of the project
from pacman_module.game import Agent
from pacman_module.pacman import Directions
from random import randint
import queue
class PacmanAgent(Agent):
reallySeen = []
path = queue.Queue()
def __init__(self, args):
"""
Arguments:
---... | true |
049c3408b5619e70cc22cf318ebeb9ddb5b6f3b6 | Python | jefftienchow/Facebook-Profile-Recognition | /webcam.py | UTF-8 | 403 | 3.03125 | 3 | [] | no_license | # Webcam
from cv2 import *
import numpy as np
import os
import time
def capture():
'''
Take a photo from webcam and save as filename.jpg
'''
# initialize the camera
cam = VideoCapture(0) # 0 -> index of camera
time.sleep(1.2)
s, img = cam.read()
if s:
#img = add(img,np.array([100.0]))
imwrite("fil... | true |
ac4263781c956c7bec2507cbed3377609d529c70 | Python | Bazhunga/GeospatialAvailabilityPredictor | /forsale/forsale_cat.py | UTF-8 | 1,911 | 2.65625 | 3 | [] | no_license | from __future__ import print_function
from craigslist import CraigslistForSale
from datetime import datetime
import json
import re
import time
from support import *
# Variant of the forsale scraper that gathers 35 postings
regionArray = ['tor']
# ['tor', 'drh', 'yrk', 'bra', 'mss', 'oak']
# ['sfc', 'sby', 'eby', 'pe... | true |
b18c3c064c1dcb3b428f0c78b0a6bdeb6f867834 | Python | stoimenoff/Algo-1 | /week1/1-Vector/vector.py | UTF-8 | 1,570 | 3.890625 | 4 | [] | no_license | class Vector:
def __init__(self, capacity):
self.items = [None] * capacity
self.capacity = capacity
self.size = 0
# Adds value at a specific index in the Vector.
# Complexity: O(n)
def insert(self, index, value):
if self.size == self.capacity:
self.items += se... | true |
58d136ba25055416bb646f28354e81891ab00690 | Python | biprodip/self_organizing_map | /SOM.py | UTF-8 | 2,318 | 2.75 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Sun May 6 10:25:28 2017
@author: biprodip
"""
import numpy as np
#input data (dx1 vector)
data = np.array(np.random.randint(0, 255, (3, 100)), dtype=float);
data.astype(float);
d = data.shape[0];
totSample = data.shape[1];
#define grid mxn (not more than totSample)
rMap=10;
cM... | true |
8a0ebadd12ef80df31281e78cb96a927bf83e348 | Python | arnaudpilato/Wild-Code-School | /France IOI/02 - Fundamentals 2/40 - Transport des bagages.py | UTF-8 | 127 | 3.1875 | 3 | [] | no_license | nombrePaquets = int(input())
poids = int(input())
resultat = nombrePaquets * poids
if resultat > 105:
print ("Surcharge !")
| true |
6d86f92f8dc49b8bcb86b4380a0e18a98156ef09 | Python | uncomputable/job-scheduling | /scheduling.py | UTF-8 | 8,864 | 2.875 | 3 | [] | no_license | from jobs import Job, Operation
from job_parser import read_jobs_from_file_merged, read_jobs_from_file_split
from typing import List, Tuple
import random
class SchedulingTask:
# Structural stuff
def __init__(self, jobs: List[Job] = None):
self.next_id = 1
self.jobs = []
if jobs is Non... | true |
80ac7db127243ef3c7b13f659d5fcb36e3855c43 | Python | gChenevert/CMPS-411 | /Python/piApiTest.py | UTF-8 | 1,787 | 2.515625 | 3 | [] | no_license | import requests, json
import numpy as np
import cv2
import io
import time
import sys
import base64
url = "http://api411-orbiter54321.c9users.io/411Api/image/getObject"
#PiCamera Class
class OpenCVCapture(object):
def read(self):
"""Read a single frame from the camera and return the data a... | true |
dddab59e1a71dc7ecd149b41b222ef57429f6258 | Python | Elvis2597/Python_Programs | /a.py | UTF-8 | 518 | 2.90625 | 3 | [] | no_license | ##string='CBSEONLINE'
##import random
##number=random.randint(0,3)
##n=9
##while string[n]!='L':
## print string[n]+string[number]+'#'
## number=number+1
## n=n-1
##class traveller:
## pnr=0
## def book(self,p):
## traveller.pnr=p
## traveller.pnr+=1
## def __del__(self):
## print... | true |
4b2c08686e2749af5ff373051e9c58576090193f | Python | SageBerg/Eventstamp_Project | /eventstamp_variables.py | UTF-8 | 5,727 | 2.9375 | 3 | [] | no_license | '''
eventstamp_variables.py
contains variables to be imported into programs in the eventstamp_project
Sage Berg
Created 07 March 2014
'''
#the first color is the activity color, second is the activity title color
event_list = [
('school','#FFD700', 'black', '#E6C200'),
('shopping','bisque', 'black', '#E6CDB0'),
... | true |
adf18afb5b0301581ff33af4e8177518f92d3522 | Python | VaibhavD143/Coding | /ib_max_sum_path_in_binary_tree.py | UTF-8 | 636 | 3.125 | 3 | [] | no_license | # Definition for a binary tree node
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
# @param A : root node of tree
# @return an integer
def maxPathSum(self, A):
res = float('-inf')
def maxSum(root):
... | true |
e26a370fb5b1e9888c0ec9eceb7060daf634db2f | Python | gdgdmh/python_rps | /rock_paper_scissors/judge.py | UTF-8 | 665 | 2.734375 | 3 | [] | no_license | #!/usr/bin/env python
"""ジャンケンの手ジャッジインターフェース."""
from abc import ABCMeta, abstractmethod
from rock_paper_scissors import players
from rock_paper_scissors import result_constant
class Judge(metaclass=ABCMeta):
"""ジャンケンの手ジャッジインターフェース."""
@abstractmethod
def set(self, players: players.Players):
"""... | true |
0e92c54ad47416558623fb870be7d374f223f7f4 | Python | hitochan777/kata | /atcoder/abc290/A.py | UTF-8 | 172 | 2.609375 | 3 | [] | no_license | N, M = (int(x) for x in input().split())
A = list(int(x) for x in input().split())
B = list(int(x)-1 for x in input().split())
ans = 0
for b in B:
ans += A[b]
print(ans) | true |
da3a75100d6b87bbfd6527aee96dea3d52c08d3c | Python | joswinc/CLR-Parser | /lexer.py | UTF-8 | 1,346 | 2.640625 | 3 | [] | no_license | from data import *
from parsertable import *
from prettytable import PrettyTable as pt
def lexer_analyser():
with open('code.txt', 'r') as myfile:
string = myfile.read().replace('\n', '')
KEYWORDS = symb + keywords
white_space = ' '
lexeme = ''
list = []
string = string.rep... | true |
8b50c61c4f8a0e28e9179d193ec9419d3ce1f54c | Python | krenzland/zebrafishBehaviour | /src/data.py | UTF-8 | 1,737 | 2.875 | 3 | [] | no_license | import numpy as np
import pandas as pd
import torch
from torch.utils import data
def process_df(df):
# Massage data:
# Put dt column last for both dfs.
# Otherwise reshaping will have weird results.
cols = list(df.columns)
cols.remove('dt')
df = df[cols + ['dt']]
y_labels = ['y_0', 'y_1']
... | true |
509adba89a94868187a30f1506909ec118926dc4 | Python | mnahajowski/Air-quality-website | /data_source/src/dao.py | UTF-8 | 2,164 | 3.125 | 3 | [
"CC-BY-4.0"
] | permissive | import psycopg2
def insert(table, data, columns=None):
"""
Database insert wrapper
:param table: table name
:param data: list of records
:param columns: list of columns, None for all columns
"""
if data:
connection = psycopg2.connect(dbname='air_data', user='docker', password='dock... | true |
9780b1b1d654914d3f5acbde5c0d675f30dfce50 | Python | Lonsofore/CoD2MapStats | /cod2mapstats/utility.py | UTF-8 | 1,072 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | import os
import sys
import inspect
from ruamel import yaml
def get_script_dir(follow_symlinks=True):
if getattr(sys, 'frozen', False): # py2exe, PyInstaller, cx_Freeze
path = os.path.abspath(sys.executable)
else:
path = inspect.getabsfile(get_script_dir)
if follow_symlinks:
... | true |
485f23a5cbc9edd56e138712bb7eb7bfedb40446 | Python | sbdzdz/project-euler | /problem_006.py | UTF-8 | 120 | 2.6875 | 3 | [] | no_license | def solve():
return sum(range(101))**2-sum(x**2 for x in range(101))
if __name__ == '__main__':
print(solve())
| true |
c2d9e39be1029abdb43c8c6850036534eb3add93 | Python | krnvst/python | /basic/variable.py | UTF-8 | 242 | 3.515625 | 4 | [] | no_license | string_one = "Собака съела "
string_two = "мою книгу!"
string_three = string_one + string_two
print(string_three) # Собака съела мою книгу!
add='%d %s, %d %s' % (6, 'bananas', 10, 'lemons')
print(add) | true |
a5b3725ba869e1d09a33cf9ec8a9fa4afd553d43 | Python | bigtrue87/BigTrue-Study | /Algorithm/CodeUp100/1065_1070 [기초-선택실행구조]/1067.py | UTF-8 | 91 | 3.65625 | 4 | [] | no_license | a = int(input())
print("minus" if a < 0 else "plus")
print("even" if a % 2 ==0 else "odd") | true |
b33c4b54c66d2556f9df45608bdc43ad15281150 | Python | BraneXZ/Minesweeper-DL | /models/policy_gradient_model.py | UTF-8 | 530 | 2.515625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Fri May 22 16:11:46 2020
@author: Wash
"""
from keras.layers.core import Dense, Flatten
from keras.layers.convolutional import Conv2D
from keras import Sequential
def get_model(encoder):
input_shape = encoder.shape()
model = Sequential()
model.add(Conv2D(... | true |
d0dd6c1c0b1e5ce54ea825d816cfc7006ead429a | Python | anyatran/school | /CG/SciPy/radio_1.py | UTF-8 | 911 | 2.953125 | 3 | [] | no_license | """
Program name: radiobuttons_1.py
Objective: How radiobuttons work - by mutual exclusion.
Keywords: canvas, radiobuttons, exclusion, validation
============================================================================79
Explanation: This is a basic radiobutton input program.
Author: Mike Ohls... | true |
9cab57ec9054ebe725a956099b3db24caa730d3a | Python | Mubashir-Saeed1/Race-Game | /main.py | UTF-8 | 8,894 | 3.109375 | 3 | [] | no_license | import pygame
import time
from pygame import *
import random
pygame.init()
crash_sound=pygame.mixer.Sound('Crash.wav')
pygame.mixer.music.load('Jazz_In_Paris.wav')
display_width=800
display_height=600
Help=True
black=(0,0,0)
white=(255,255,255)
red=(255,0,0)
green=(0,255,0)
blue=(0,0,255)
block_color... | true |
2d161fa14d2415428da42b9727b039408c77cbfa | Python | piyushjn08/DeepLearning_Archs_pytorch | /Object_Detection/YoloV1/Test.py | UTF-8 | 2,265 | 2.546875 | 3 | [] | no_license | #%% Imports and Declarations
from model import yolov1
import pandas as pd
import torch
import cv2
from tqdm import tqdm
import numpy as np
from utils import data_encoder_pytorch
import warnings
inchannels = 3
class_count = 1
GRID_DIM = (7, 7)
DATASET_PATH = '/media/crl/A33B-9070/Object_detection/Vision/Cats_dog_label... | true |
fa32d9dc952a7099a3122d5c20095352a70e3aaf | Python | lizhenggan/TwentyFour | /01_Language/01_Functions/python/fnmatch_func.py | UTF-8 | 176 | 2.9375 | 3 | [
"MIT"
] | permissive | # coding: utf-8
import fnmatch
colors = ["agray", "egrey", "aegraey"]
for c in colors:
if fnmatch.fnmatch(c, "*gr[ae]y"):
print(c, "=>", "some form of gray ...")
| true |
ace76e8d0b89bbe275da32f092da7f726f0e1919 | Python | staceysv/deep-drive | /src/pre_process.py | UTF-8 | 931 | 2.71875 | 3 | [] | no_license | # Pre-process BDD dataset: https://deepdrive.berkeley.edu/
# Segmentation mask code for "Void" updated from 255 to 19 for continuous sequence
# This script must only be run once on downloaded dataset
from pathlib import Path
from tqdm import tqdm
from fastai.vision import get_image_files
import PIL
# Load label image... | true |
4c526344f7234da7a83319629ca3b9aa601a6126 | Python | caterinalorente/mooc | /coursera/interactive-programming-in-python/week3/0_collatzConjeture.py | UTF-8 | 198 | 3.453125 | 3 | [] | no_license | def collatz(n):
if n % 2 == 0: n = n/2
else: n = (n*3) + 1
return n
n = 217
lista = []
while n != 1:
n = collatz(n)
lista.append(n)
print lista
print max(lista) | true |
99105a7b5531e97afb9466e8b7cb6e719ceb5d65 | Python | mikheilibtu/lecture-11 | /main.py | UTF-8 | 2,972 | 3.234375 | 3 | [] | no_license | import hashlib
from urllib.parse import urljoin, urlparse
from pathlib import Path
import requests
from bs4 import BeautifulSoup
class Crawler:
def __init__(self, url, allowed_domain, cache=True, cache_dir=None, print_stats=True):
self._url = url
self._allowed_domain = allowed_domain
sel... | true |
c50d3e63736a4ded0c6ca29f208971a062dd5559 | Python | ericsherlock/language_identifier | /lang_identifier.py | UTF-8 | 10,825 | 3.625 | 4 | [] | no_license | #! /usr/bin/env python
#Import Necessary Packages
import os
import os.path
import sys
import yaml
import heapq
import operator
#####################NGRAM ITERATOR###################################################
class LanguageFile:
#Class That Loops Through Characters In Each Language File
#Where Each Itera... | true |
d91b5bf81e2e96217ca11b5a090e2884f4962db8 | Python | swathivenkat1011/python | /fibo.py | UTF-8 | 171 | 3.9375 | 4 | [] | no_license | print("fibonacci series")
n=int(input('enter the range'))
a=0
b=1
print(0,1,end=" ")
for i in range(1,n-1):
fib=a+b
a=b
b=fib
print(fib,end=" ")
| true |
1e12c4a62176bdc4deb0f87499032affeea5aef3 | Python | SachinPitale/Python3 | /Python-2020/Chapter_13/10.doc_function.py | UTF-8 | 301 | 2.953125 | 3 | [] | no_license | # doc function is use to understand how much parameter, we will pass to function
# we have multiple build function
def add (a,b):
"this functin require two arguments"
print (add.__doc__)
print (len.__doc__)
print (sum.__doc__)
# help function: it's like linux help command
print(help(min)) | true |
5302c606965245fde0e32d2f47bd8dc5db0559e9 | Python | teopicca/metodi_algebrici | /server.py | UTF-8 | 4,087 | 3.140625 | 3 | [] | no_license | from flask import *
app = Flask(__name__)
def euclide(x, y):
while(y!=0):
r = x % y
x = y
y = r
return x
def bezout(a, b):
r = a
r1 = b
u = 1
v = 0
u1 = 0
v1 =1
while(r1 !=0):
q = int(r/r1)
rs = r
us = u
vs = v
... | true |
bfd34722cdbd78877c1ad1dfb9701edfb62a61a7 | Python | opusvar/tdd_project_0001 | /test/test_ner_client.py | UTF-8 | 3,677 | 2.609375 | 3 | [] | no_license | import unittest
from unittest.case import expectedFailure
from ner_client import NamedEntityClient
from .test_doubles import NerModelTestDouble
class TestNERClient(unittest.TestCase):
def test_get_ents_returns_dictionary_given_empty_string_returns_empty_spacy_doc_ents(self):
model = NerModelTestDouble('en... | true |
21c2ac11ab6fad6e1ef828afdc06831995242d9c | Python | peterdsharpe/AeroSandbox | /aerosandbox/dynamics/point_mass/common_point_mass.py | UTF-8 | 22,204 | 3.265625 | 3 | [
"MIT",
"LicenseRef-scancode-proprietary-license",
"LicenseRef-scancode-other-permissive"
] | permissive | import aerosandbox.numpy as np
from aerosandbox.common import AeroSandboxObject
from abc import ABC, abstractmethod, abstractproperty
from typing import Union, Dict, Tuple, List
from aerosandbox import MassProperties, Opti, OperatingPoint, Atmosphere, Airplane, _asb_root
from aerosandbox.tools.string_formatting import ... | true |
d4b2d261e7799155ac05dadf7b6004800ae074eb | Python | hudefeng719/uband-python-s1 | /homeworks/B20358/16(3).py | UTF-8 | 210 | 3.078125 | 3 | [] | no_license | #!/usr/bin/python
# -*- coding: utf-8 -*-
# @author: Anna
import calendar
def main():
cal = calendar.month(2016,1)
print '以下输出2016年1月份的日历:'
print cal
if __name__ == '__main__':
main() | true |
90f77a4b85a3f3feaf432c15bf73ad9e515ee209 | Python | ShaoxiongYuan/PycharmProjects | /1. Python语言核心编程/1. Python核心/Day06/exercise05.py | UTF-8 | 239 | 2.96875 | 3 | [] | no_license | manager = {"曹操", "刘备", "孙权"}
technician = {"曹操", "刘备", "关羽", "张飞"}
print(manager & technician)
print(manager - technician)
print(technician - manager)
print(len(manager | technician))
print("张飞" in manager)
| true |
12e0560f6ba3af2a02d4e63c894b9567f8b52871 | Python | kartverket/where | /where/ext/hf_eop_wrapper.py | UTF-8 | 3,315 | 2.546875 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python3
"""
Where wrapper for HF EOP functions
Description:
------------
The fortran function calc_hf_eop_xyu returns a 4x2 matrix with x, y, ut1, lod and their derivatives.
This simple wrapper is splitting this into two functions.
References:
-----------
.. [1] Notes from the high frequency... | true |
14138d43d85a6931d24c410ead5254ca34fdaf9d | Python | kevin-bot/Python-pythonPildorasInformaticas | /exepcionesII.py | UTF-8 | 539 | 3.90625 | 4 | [] | no_license |
def divide():
try:
op1=(float(input("Introduce el primer numero: ")))
op2=(float(input("Introduce el segundo numero: ")))
print("la division es: "+ str(op1/op2))
#en caso de que sean muchos errores posemos solo poner except: sin decirle que error es
except ValueError:
print(... | true |
52b71bf750e768350bf69f21d94a78ff9ca35090 | Python | aparnamogallapu/yelp | /project.py | UTF-8 | 6,028 | 2.8125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Wed Jul 17 12:48:17 2019
@author: HP
"""
import pandas as pd
import numpy as no
import matplotlib.pyplot as plt
dataset=pd.read_csv("C:\\Users\\HP\\Desktop\\YELP BUSINESS\\yelp_business.csv")
data=dataset.copy()
dataset.info()
dataset.describe()
dataset.isna().su... | true |
bfd8f32dbb9555a6fcbf711db8ed6029dbad2eef | Python | jfm44/TestsPython | /Exercices/Exo21_Multiprocessing2.py | UTF-8 | 335 | 2.6875 | 3 | [] | no_license | import multiprocessing as mp
import random
import time
def temp(city):
print("lance",city)
time.sleep(random.randint(0,3))
return random.randint(0,25)
if __name__ == "__main__":
with mp.Pool(3) as pool:
for city in ['Belgium','Australia','China']:
print(">",city,pool.apply_async(t... | true |
e057c25ccd25c70bf7db27301f3dae3ba7fbb9e3 | Python | sayaka71/Python | /Practice/pra_10.py | UTF-8 | 1,751 | 3.375 | 3 | [
"Apache-2.0"
] | permissive | # -*- coding: utf-8 -*-
# Import re for regex (正規表現) class
import re
class Regex():
def __init__(self, re_word="[pP]y", parse_args="hiyopy"):
self.re_word = re_word
self.parse_args = parse_args
def re_pattern_word(self):
"""patternを確認"""
print("\nParse: " + self.parse_args... | true |
99de4439d8552b392c7503b82b64ab3b326b8cef | Python | raghuprasadks/pythontutoriallatest | /sandbox/grades.py | UTF-8 | 660 | 3.46875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
name = input("Enter name")
tut_score = int(input("Enter tutorial marks"))
t_score = int(input("Enter test marks"))
f_score = 0
avg = (tut_score+t_score)/2
if (avg < 40):
print ('You are not eligibal for final exams')
else:
f_score = int(input("Enter final marks"))
c_marks = tut_score*.... | true |
5d3d0a577f74a89ab62b5e493fb3752b98c6076f | Python | captain-sysadmin/sentiment-analysis | /ratemet.py | UTF-8 | 1,988 | 2.703125 | 3 | [] | no_license | from flask import Flask, request
from flask_restful import Resource, Api
from senti_classifier import senti_classifier
import math
app = Flask(__name__)
api = Api(app)
swear_words = []
with open('swear/bad_words.txt') as fh:
for line in fh:
word = line.rstrip()
swear_words.append(word)
@app.after... | true |
485fc9abb13af982482cec5e405fbff0ed8da2ba | Python | ttsiodras/utils | /show_video_details.py | UTF-8 | 1,817 | 2.53125 | 3 | [] | no_license | #!/usr/bin/env python3
import os
import re
import sys
options = "-v quiet -print_format json -show_format -show_streams"
for fname in sorted(sys.argv[1:]):
quoted_single_quotes = "'\"'\"'"
shell_fname = fname.replace("'", quoted_single_quotes)
if 0 != os.system(f"ffprobe {options} '{shell_fname}' -o /dev... | true |
a616e41b2de561a1e298d4e9f1875f4cc0b11f23 | Python | dakusouru/Project-JADE | /chatbot.py | UTF-8 | 3,981 | 3.265625 | 3 | [] | no_license | import random
import time
def bot(*t):
r = float(random.randint(2,6))
time.sleep(r/4)
text = " ".join(t)
return print("Bot:",text)
def mult(*a):
r = random.randint(0,len(a)-1)
return (a[r])
history = []
def runcb():
birth = time.clock()
sex = ""
if random.random... | true |
9b0038afeaf6d1f74e43f3dd88cfe1cc64439246 | Python | mohammed299/TKH_Prework | /assignment_5.py | UTF-8 | 578 | 3.828125 | 4 | [] | no_license | def seperate_list(names_list):
even_list = []
odd_list = []
for i in names_list:
if len(i) % 2 == 0:
even_list.append(i)
else:
odd_list.append(i)
for even in range(len(even_list)):
even_list[even] = 'b' + even_list[even][1:]
for k in range... | true |
52104d944fc63ec2fb7be96b0d8574cc7ad29393 | Python | tusharnagrale/FTP_REMOTE_FILE_STORAGE | /ftpupload.py | UTF-8 | 3,064 | 2.96875 | 3 | [] | no_license | """problem: create a remote storage system
software required:
filezilla client and server
working:
1. create a flask application where user will upload an image by calling an api
user will also send type of method(normal or tls)
2. if all the conditions are satisfied, store that image in remote storage using ftp p... | true |
971da6dbbc338ae5e8c6c9d7de46a1cfa2c92728 | Python | vlnekrepkin/FinnocioBot | /settings.py | UTF-8 | 4,732 | 2.59375 | 3 | [] | no_license | class Settings:
def __init__(self):
# ------------------------------------ ГЛОБАЛЬНЫЕ НАСТРОЙКИ ----------------------------------------------------
# Токен Бота
self.token = ""
# -------------------------------------- ДАННЫЕ ДЛЯ КОНТЕНТА ------------------------------------------... | true |
391d6ab2b69c70b088e92c8e89642752c1b5f221 | Python | uddeshh/pyCodes | /yetinteger.py | UTF-8 | 267 | 2.90625 | 3 | [] | no_license | # import math
# t=int(input())
# for i in range(t):
# a,b=map(int,input().split())
# print(int(abs(b-a)/10)+math.ceil((abs(a-b)%10)/10))
print(ord('a')+ord('z')+ord('A')+ord('Z'))
print(ord('z')+ord('z')+ord('z')+ord('z')+ord('z')+ord('t'))
# print(chr(116))
| true |
bce8be16ae7cbd02f21c42b0ad8cc4b1bf8d45bb | Python | ShepherdCode/ShepherdML | /TumorII Brain Cancer/RandomForestUtil.py | UTF-8 | 2,250 | 2.984375 | 3 | [
"MIT"
] | permissive | import numpy as np
import pandas as pd
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import cross_val_score
from sklearn.metrics import confusion_matrix
class RF_Util:
def __init__(self):
self.model=RandomForestClassifier()
def get_model(self):
return self.mode... | true |
94a0678a0f7ecbf2ee5b614adedbeebb6610e674 | Python | nicky1503/Python-Advanced | /comprehensions/names_of_heroes.py | UTF-8 | 389 | 3.40625 | 3 | [] | no_license | names = input().split(", ")
items = input().split("-")
inventory = {key: {} for key in names}
while items[0] != "End":
name, item, price = items[0], items[1], items[2]
if item not in inventory[name]:
inventory[name][item] = int(price)
items = input().split('-')
[print(f"{key} -> Items: {len(value)},... | true |
660b0f27622a4d819aa6a4230fd169e929b038ad | Python | vitorrmazevedo/Lista-1 | /Exercicios_Apostila/String_1.py | UTF-8 | 93 | 3.765625 | 4 | [] | no_license |
frase = input("Escreva uma frase: ")
frase = frase.upper()
print(frase.replace(" ","")) | true |
d5b4d2bba5bb9dfa48e75724c1178f67a1ea8ae6 | Python | apache/impala | /shell/thrift_printer.py | UTF-8 | 6,399 | 2.984375 | 3 | [
"Apache-2.0",
"OpenSSL",
"bzip2-1.0.6",
"LicenseRef-scancode-openssl",
"LicenseRef-scancode-ssleay-windows",
"LicenseRef-scancode-google-patent-license-webrtc",
"PSF-2.0",
"BSD-3-Clause",
"dtoa",
"MIT",
"LicenseRef-scancode-mit-modification-obligations",
"Minpack",
"BSL-1.0",
"LicenseRef-s... | permissive | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | true |
e8c7cf91f551a9322cb4bca450a31650c28b4b48 | Python | xy990/bigdata | /wordcloud/map.py | UTF-8 | 219 | 2.71875 | 3 | [] | no_license | #!/usr/bin/python
import sys
import csv
reader = csv.reader(sys.stdin)
next(reader, None)
for entry in reader:
PD_DESC = str(entry[9])
if len(PD_DESC) == 3:
label = 'NULL'
else:
label = PD_DESC
print label
| true |
9bfe433bd0b1853f3208ca9db294824e5bc9e0cb | Python | david2999999/Python | /Archive/PDF/Handling_Error/Exception-Explanation.py | UTF-8 | 1,836 | 3.90625 | 4 | [] | no_license | def main():
fridge_content = {"egg" : 8, "mushrooom": 20, "pepper" : 3, "cheese" : 2, "tomato" : 4, "milk" : 13}
# Because there is no key in the fridge_contents dictionary for “ orange juice ” , a KeyError is
# raised by Python to let you know that no such key is available. In addition, you specified the ... | true |
86c221be9e02b1b2c6592315a1eb26276b9633b5 | Python | harlemnight/finance | /finance_analysis.py | UTF-8 | 4,898 | 2.796875 | 3 | [] | no_license | """
更新股票数据入口 数据都是基本根据
日期,季度,月份等时间
先删除后在插入
Created on 2018/05/14
@author: yudong chou
@contact: 33836858@qq.com
"""
import control_trade as ctrl
import control_logger as log
import control_classify as ify
import control_report as rpt
import control_winnerlist as win
import datetime as date
import mpl_finance as mpl
de... | true |
97afd830600520e989fbe7282e72b29c8fa7bc33 | Python | zhangshichen0/python3-study | /day09/socketservertst.py | UTF-8 | 779 | 2.84375 | 3 | [] | no_license | # socketServer是对socket的进一步封装,可使用simpleclint.py配合使用
# https://www.cnblogs.com/sean-yao/p/7836400.html
from socketserver import TCPServer, StreamRequestHandler
class MyTcpHandler(StreamRequestHandler):
'''
继承StreamRequestHandler,重写handler方法处理客户端请求
'''
def handle(self):
caddr = self.client_addr... | true |
d8d6e430edb313da927dd7a7b4d5cd11d00638b8 | Python | PSAlmighty/InterviewBit-Practices | /Strings/String parsing/Atoi.py | UTF-8 | 796 | 3.234375 | 3 | [] | no_license | class Solution:
# @param A : string
# @return an integer
def atoi(self, A):
A_split = A.split()
for i in A_split:
if not i: continue
output = 0
minus = False
if i[0] == "-": minus = True
for j in range(len(i)):
if j ... | true |
d361dc0eacc164f70ff1042643dae28a5c04a1ea | Python | jyelena/SimpleBankingSystem | /Topics/Load module/Not exactly random/main.py | UTF-8 | 148 | 2.625 | 3 | [] | no_license | from random import seed, randint
# don't modify this code or variable `n` may not be available
n = int(input())
seed(n)
print(randint(-100, 100))
| true |
05d92c083c68727b5bc00c98cbb6364a60a1dbd4 | Python | james1022/ComputerVision | /numpy_converter.py | UTF-8 | 1,528 | 2.53125 | 3 | [] | no_license | import sys
import numpy as np
import cv2
import matplotlib.pyplot as plt
import cv2.cv as cv
infile_name = 'video01_numpy_rough.npy'
outfile_name = 'video01_numpy_refined.npy'
outfile_text_name = 'video01_text_output_refined.txt'
outfile_name_trimmed = 'video01_numpy_refined_trimmed.npy'
outfile_text_name_trimmed = 'v... | true |
6d60cd1f880c099d01c6c2b178d803df5b83e7e7 | Python | payt0nc/jp-millage-challenge | /planner/date_util.py | UTF-8 | 219 | 3.046875 | 3 | [
"MIT"
] | permissive | from datetime import datetime
def parse_time(time_str: str) -> datetime:
return datetime.strptime(time_str, '%H:%M:%S')
def time_to_str(flight_time: datetime) -> str:
return flight_time.strftime('%H:%M:%S')
| true |
34634250245cf79660b045d676626c364cc7fbd0 | Python | smdelacruz/linkedin-python-codininterview | /2darray_chessboard.py | UTF-8 | 1,433 | 4.34375 | 4 | [] | no_license | # Input:
# chessboard: A 2-dimensional array that represents. Example below.
# [[1, 0, 0, 0],
# [0, 1, 0, 0],
# [0, 0, 0, 1],
# [0, 0, 0, 0]]
# Returns:
# True if none of the rooks can attack each other.
# False if there is at least one pair of rooks that can attack each other.
def rooks_are_safe(chessboard):
... | true |
78a8b7984edeb76c4b334bd9b8bca61fdf0830ac | Python | charlesfu4/VGG-like | /VGG-oxflower/VGG16f.py | UTF-8 | 3,344 | 2.609375 | 3 | [] | no_license | from __future__ import print_function
import numpy as np
import keras
from keras import backend as K
from keras.utils import np_utils
from keras.models import Sequential
from keras.layers import Dense, Activation, Conv2D, MaxPooling2D, Flatten,Dropout
from keras.optimizers import SGD
from keras.preprocessing.image imp... | true |
7ad247c59622c5b81cf725464cdaa122500d3b66 | Python | skishorekanna/PracticePython | /zeros_followed_by_ones.py | UTF-8 | 585 | 2.9375 | 3 | [] | no_license | #l = [1, 1, 0, 0, 0, 1, 0]
l = [ 1, 1, 0, 1, 1, 1, 0]
zero_index = 0
one_index = len(l)-1
for index in range(len(l)):
print(index)
print(zero_index)
print(one_index)
if zero_index+1 == one_index:
break
if zero_index<=one_index:
if l[index]==0:
l[zero_index],l[index]=l... | true |
b2a9f753235b4877b70169c1e2788b110f5c7b79 | Python | shen-huang/selfteaching-python-camp | /exercises/1901050056/1001S02E05_stats_text.py | UTF-8 | 1,441 | 3.375 | 3 | [] | no_license | text = '''
The Zen of Python, by Tim Peters
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although pr... | true |
67a4702aa3a75f5fc808b1ea1a2c97252154deb6 | Python | Aasthaengg/IBMdataset | /Python_codes/p03694/s663763023.py | UTF-8 | 178 | 2.703125 | 3 | [] | no_license | import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
n = readline().rstrip()
a = sorted(map(int,readline().split()))
print(a[-1] - a[0]) | true |
8f83e86ed2951f700497967001e6398ea9bc2035 | Python | mooreBrendan/portfolio | /python/clockBase/hardware.py | UTF-8 | 6,814 | 2.828125 | 3 | [] | no_license | #https://realpython.com/intro-to-python-threading/
#https://www.programiz.com/python-programming/time/sleep
#https://learn.sparkfun.com/tutorials/raspberry-gpio/all
import threading
import time
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
class dipSwitch:
def __init__(self,logicHigh = 0):
... | true |
98a55f01968f8623ee8dd0d53905ffa421f4f731 | Python | pchanial/pyoperators | /tests/test_partition.py | UTF-8 | 9,020 | 2.53125 | 3 | [
"LicenseRef-scancode-cecill-b-en",
"CECILL-B"
] | permissive | import numpy as np
import pytest
from numpy.testing import assert_equal
from pyoperators import (
AdditionOperator,
BlockColumnOperator,
BlockDiagonalOperator,
BlockRowOperator,
CompositionOperator,
DiagonalOperator,
HomothetyOperator,
I,
IdentityOperator,
MultiplicationOperator... | true |
f2c8ca60734110ce0cd56e4abc27066b8d84d3b9 | Python | DaHuO/Supergraph | /codes/CodeJamCrawler/16_0_1/Poldnev/A.py | UTF-8 | 581 | 3.265625 | 3 | [] | no_license | from functools import *
inf = open('A-large.in')
ouf = open('output.txt', 'w')
input = lambda: inf.readline().strip()
print = partial(print, file = ouf)
def f(x):
res = 0
digs = set()
cur = 0
while len(digs) < 10:
res += 1
cur += x
digs.update(str(cur))
ret... | true |
ac1159c885ae30721e5b1188ed6b9f8165bc9a92 | Python | carlos-gutier/DS-Unit-3-Sprint-1-Software-Engineering | /acme_report.py | UTF-8 | 1,406 | 3.09375 | 3 | [
"MIT"
] | permissive | from acme import Product
import random
ADJECTIVES = ['Awesome', 'Shiny', 'Impressive', 'Portable', 'Improved']
NOUNS = ['Anvil', 'Catapult', 'Disguise', 'Mousetrap', '???']
def generate_products(n=30):
product_lst = []
for _ in range(n):
adj_rand = random.choice(ADJECTIVES)
noun_rand= ... | true |
6547ed92da06a92c3573296c3fb6c3776d406db4 | Python | 24Savage/data_structure_python | /栈和队列/骑士周游回溯.py | UTF-8 | 1,814 | 3.578125 | 4 | [] | no_license | import turtle
turtle.setworldcoordinates(-0.5,-0.5,8,8)
def draw_block(x,y): # 绘制棋盘格的方块
turtle.goto(x+0.5,y-0.5)
turtle.pendown()
turtle.setheading(90)
for i in range(4):
turtle.forward(1)
turtle.left(90)
turtle.penup()
def draw_board(n): # 绘制n*n棋盘格
turtle.tracer(0)
tu... | true |
5f43432080247d90c56a07936fe40267e5fb61f7 | Python | hanksudo/leetcode | /python/125-valid-palindrome.py | UTF-8 | 368 | 3.453125 | 3 | [] | no_license | # https://leetcode.com/problems/valid-palindrome/submissions/
class Solution:
def isPalindrome(self, s: str) -> bool:
s = [c.lower() for c in s if c.isalnum()]
low = 0
high = len(s) - 1
while low < high:
if s[low] != s[high]:
return False
low ... | true |
d3c65303f92229b08138290607aa422eec9f7793 | Python | ReformerForFun/codesignal | /adjacentElementsProduct.py | UTF-8 | 158 | 2.890625 | 3 | [] | no_license | def adjacentElementsProduct(inputArray):
x = []
for i in range(len(inputArray)-1):
x.append(inputArray[i]*inputArray[i+1])
return max(x)
| true |
a5b89635e6d52969eafeaeb5359bd69495fc8a66 | Python | Blaza/downvoter | /model_scripts/test_final_model.py | UTF-8 | 1,306 | 2.921875 | 3 | [] | no_license | """
A script which tests the final stacked model on the test set.
Also gives classification reports for several threshold values for the logistic
regression predict_proba.
Note for Github. The final model is located in the folder ./final which isn't
present on Github as the models are ~800 MB in size and thus too big ... | true |
117f47e6d8068356e1b398d6bc7696272a4f6c74 | Python | EuniceChen1/MayaTools | /createCSV.py | UTF-8 | 2,164 | 2.640625 | 3 | [] | no_license | import os
from subprocess import call
import csv
projName = raw_input("Enter Project Name: ")
numOfScn = int(raw_input("Enter Number of Scenes: "))
scnName = []
for q in xrange(numOfScn): #number of scenes
q = q+1
scnName.append(os.path.join("sc"+'%03d'%q))
outputFileA = os.path.join("D:\\"+"proxy"+".csv")
... | true |
ee802b8795fade797d0259f5d6aeaaea2687d874 | Python | iansu81/Ian_play | /Chritmas_Play/chritmas.py | UTF-8 | 482 | 3.109375 | 3 | [] | no_license | from itertools import cycle
with open('input.txt') as f:
content = f.readlines()
# you may also want to remove whitespace characters like `\n` at the end of each line
content = [x.strip() for x in content]
result = 0
dup = set()
dup.add(result)
for x in cycle(content):
if x[0] == '+':
add_val = int(x[1... | true |
62fa91b8700fb8762ad7beddcbc8810396e8a059 | Python | mr-d-self-driving/aionr6_mpc_ros_updated | /ltvcmpc_controller/scripts/ltv_contouring_mpc.py | UTF-8 | 67,699 | 2.75 | 3 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
ltv_contouring_mpc
Created on Wed Aug 7 07:53:41 2019
Supporting functions for ltv contouring mpc
@author: khewk
"""
import osqp
import scipy.io
import matplotlib.pyplot as plt
import numpy as np
import math
from scipy import sparse
#import scipy a... | true |
030752ef6dc973994ec3b852f74226344fd5a497 | Python | ssinghaldev/30_days_of_code | /python/Day8/dictionaries.py | UTF-8 | 338 | 3.3125 | 3 | [] | no_license | from sys import stdin
num_entries = int(input())
phoneBook = {}
for i in range(0, num_entries):
[name, phone] = input().split();
phoneBook[name] = phone
lines = stdin.read().splitlines()
for query in lines:
if query in phoneBook:
print('{}={}'.format(query, phoneBook[query]))
else:
p... | true |
52cfd5af0e12f54fce050dd3936cd8b6c694029f | Python | chiennifer/Public-DSC291 | /notebooks/Section3-Kmeans-dim-reduction/GraphLaplacian/src/gen-data.py | UTF-8 | 1,599 | 2.53125 | 3 | [] | no_license | from math import exp, log, sqrt
K = 374750
eps = 0.5
delta = 0.01
expdelta = exp(delta)
data = []
with open("batch-log.txt") as f:
line = f.readline().strip()
while True:
if line == "end":
break
if line.startswith("Node"):
l = line.find('(')
r = line.find(')... | true |
de5c4153596f7785ebd51123175156800b38900e | Python | noozip2241993/basic-python | /task35.py | UTF-8 | 282 | 3.859375 | 4 | [] | no_license | def check_integers(n1,n2):
"""Write a Python program that will return true if the two given integer values are equal or their sum or difference is 5."""
if n1 ==n2 or n1+n2 == 5 or abs(n1-n2) ==5:
return True
else:
return False
print(check_integers(9,2)) | true |
1824a74ba69949da322a6bffe40ca8c933be0f51 | Python | Santhosh-babu-g/python-tkinter | /Calculator.py | UTF-8 | 7,883 | 3.21875 | 3 | [] | no_license | import tkinter
from tkinter import RIGHT,END,DISABLED,NORMAL
# defining the window
root = tkinter.Tk()
root.title('Calculator')
root.geometry('325x440')
root.resizable(0,0)
# defining the colors and fonts
root_color = '#FDE74C'
button_color = '#F93943'
func_color = '#80A4ED'
num_color = '#9BC53D'
button... | true |
623fafdeb3fddc5b627e581f8f68c79aa74c1eb7 | Python | sahilbadyal/imagenet_to_vre | /vre_globals.py | UTF-8 | 509 | 2.53125 | 3 | [] | no_license | location_ref = {
0: "on the top left",
1: "on the top",
2: "on the top right",
3: "to the left",
4: "in the middle",
5: "to the right",
6: "on the bottom left",
7: "on the bottom",
8: "on thebottom right"
}
bounding_boxes = {
0: [0,0, 300, 200],
1: [300,0, 300, 200],
2: ... | true |
777688db1b27530326526e78c4b3ac353129b654 | Python | RobertNguyen125/PY4E | /ex_05_loop/7_count_in_loop.py | UTF-8 | 352 | 4.0625 | 4 | [] | no_license | sum = 0
count = 0 #introduce a counter/sum variable that starts = 0 then add one to it each time through the loop
print ('Before ','Sum: ', sum, 'Count :', count)
for thing in [9, 12, 20, 48, 10]:
sum = sum + thing #this is to sum
count = count + 1
print (thing, sum, count)
print ('After', 'Sum:', sum, 'Cou... | true |
155a2cdd0eca1d0da80bd06c4d6be66bd558e66a | Python | ReinisZonne/PasswordHash | /Login.py | UTF-8 | 2,443 | 2.796875 | 3 | [] | no_license | import tkinter as tk
import hashlib as hs
from save import Message
class App(tk.Frame):
def __init__(self, master, ans):
super().__init__(master)
self.master = master
self.ans = ans
self.pack()
self.display = []
# self.email = None
self.password = None
self.hashPassword = None
self.labels = ['Emai... | true |
98a436da89edce84dd8f7025e90b61b640f90e49 | Python | roynozoa/AIML-Resources | /tensorflow/dicoding-simulator/SubmisisonA/Problem_A3.py | UTF-8 | 3,852 | 2.75 | 3 | [] | no_license | # ======================================================================================================
# PROBLEM A3
#
# Build a classifier for the Human or Horse Dataset with Transfer Learning.
# The test will expect it to classify binary classes.
# Note that all the layers in the pre-trained model are non-trainabl... | true |
20729bf7c9264bf034d28ff5d2b51b719a853f70 | Python | sanketb412/PythonBasic | /Datastructure/Dictonary/itterate.py | UTF-8 | 274 | 3.671875 | 4 | [] | no_license | # ''""
# @Author: Sanket Bagde
# @Date: 2021-08-08
# @Last Modified by:
# @Last Modified time:
# @Title :Write a Python program to iterate over dictionaries using for loops.
# '''
dt = {'a': 'juice', 'b': 'grill', 'c': 'corn'}
for key, value in dt.items():
print(key, value) | true |
73f6c3a3b49944a3c8dde27ae6995a30561cb625 | Python | RevathiRathi/Revat | /hunt130.py | UTF-8 | 138 | 3.09375 | 3 | [] | no_license | #r
n=int(input())
k=3
s=0
while k<n:
for i in range(2,k):
if k%i==0:
break
if i==k-1:
s=s+k
k=k+10
print(s)
| true |
6236319acaba260929684f165fb6274bd5786037 | Python | ASA11599/programs | /cli/web_crawler.py | UTF-8 | 1,478 | 2.984375 | 3 | [] | no_license | #!/usr/bin/python3
import requests as rqs
import os
import sys
import html.parser as hp
from queue import Queue
import re
regex = re.compile(
r'^(?:http|ftp)s?://' # http:// or https://
r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|' #domain...
r'localhost... | true |
c6832aa64efca9c74e97ccfb5d977b5b597a6c7d | Python | CodecoolBP20161/a-mentor-s-life-in-an-oo-way-padlab-2 | /student.py | UTF-8 | 3,253 | 2.921875 | 3 | [] | no_license | from person import Person
import csv
class Student(Person):
def __init__(self, first_name, last_name, year, gender, depend_level, knowledge_level,
is_bet_on_expected_result, table_football_level, energy_level):
super().__init__(first_name, last_name, year, gender)
self.depend_le... | true |