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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
155a982259d92158c49e4960fd467efe1222f00e | Python | saka0045/create_bed_file | /parseAlamut.py | UTF-8 | 2,876 | 3.046875 | 3 | [] | no_license | ####
## Purpose:
##
## Usage:
##
## @author JRWalsh 12/13/2018
####
import sys
import argparse
"""
Main
"""
def main(args):
excludedList = parseExcluded(args["exclude"])
allowedList = parseAllowed(args["allow"])
parseAlamut(args["inputAlamutFile"], excludedList, allowedList)
####
## Parse a 1 ... | true |
9bc72b4688e8c0a35b1d154e72b8f8a601b14412 | Python | vinaycheruku123/My_Python_Practice | /Local_Global_Varibles.py | UTF-8 | 254 | 3.875 | 4 | [] | no_license | print('Learning Local and Global Variables ')
print('=====================================')
a = 0
x = input('Enter a number')
if int(x) == 10:
print ('Inside if condition ', end = '')
print(a)
a = 1
print(a)
print(a)
| true |
c26d1aeaf3bd97d128ce52e26c42471caa0a89ac | Python | rrtucci/Entanglish | /entanglish/SymNupState.py | UTF-8 | 3,941 | 3.546875 | 4 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | import itertools as it
import numpy as np
import entanglish.utilities as ut
class SymNupState:
"""
This class is designed to perform tasks related to a SymNupState.
SymNupState is an abbreviation for Symmetrized N-qubits-up State,
which is a special, very convenient for testing purposes, type of
q... | true |
28dfda698884f126ef9eddbfa2d69e191425ad24 | Python | asc3ndr/zoom-meetings | /eksamen/eksamen2019/oppg_8.py | UTF-8 | 157 | 3.296875 | 3 | [] | no_license | def find_number(string):
number = [int(symbol) for symbol in string if symbol.isnumeric()]
return sum(number)
print(find_number("Ab23s249ttu21"))
| true |
bff226b4f086f88c9dfb361f030cba2444d6aedb | Python | awwilliams/tconfig | /tconfig/tests/core/algorithms/recursive/test_field.py | UTF-8 | 2,347 | 2.890625 | 3 | [
"MIT"
] | permissive | """
Created on Sep 20, 2017
@author: Alan Williams
"""
import pytest
from tconfig.core.algorithms.recursive.intmod import IntMod
from tconfig.core.algorithms.recursive.rem_poly import RemainderPoly
from tconfig.core.algorithms.recursive.field import Field
# pylint: disable=invalid-name
def test_field_2():
f =... | true |
d6591dc34fcf6f4fd9457e34acf7ad9a63381c42 | Python | aeciovc/sda_python_ee4 | /SDAPythonIntermediateGeneratorsAndIterators/iterating_sample.py | UTF-8 | 174 | 3.703125 | 4 | [] | no_license | a = [1, 2, 3, 4]
for item in a:
print(item)
a = "Alice has a cat"
for item in a:
print(item)
a = {'name': "Adam", 'surname': "Smith"}
for item in a:
print(item) | true |
ae9cd6c493344926048dea7f400f10ba1e005b28 | Python | Cardmonitor/card-scanner | /compare_images.py | UTF-8 | 3,657 | 2.890625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
from glob import glob
from cv_utils import compare_images
from scipy.misc import imread, imresize, imshow
import cv2
import numpy as np
import scipy
import timeit
import json
import os.path
def dhash(image, hashSize=8):
image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
# resize the inpu... | true |
bc0f747fd19ce1da90a4fe6afcbe7ca1c9cabafa | Python | kaustubsinha/Python-Fundamentals-For-Machine-Learning- | /6. Using Rest Api/Rest Api Get and Post method.py | UTF-8 | 534 | 2.578125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Sun Jun 24 23:08:47 2018
@author: Kaustub Sinha
"""
import requests as rq
data = {
"Phone_Number":"9983654545",
"Name":"Kaustub Sinha",
"College_Name":"Manipal University Jaipur",
"Branch":"Jaipur"
}
Req_send_url="http://13.1... | true |
523cb3a37707d0e03bd033708ba1899b51dfd5b6 | Python | euctrl-pru/rt-python | /tests/test_HorizontalPath.py | UTF-8 | 1,702 | 2.6875 | 3 | [
"MIT",
"LicenseRef-scancode-other-permissive"
] | permissive | #!/usr/bin/env python
#
# Copyright (c) 2018 Via Technology Ltd. All Rights Reserved.
# Consult your license regarding permissions and restrictions.
import unittest
import numpy as np
import json
from numpy.testing import assert_array_almost_equal
from pru.HorizontalPath import HorizontalPath
GOLDEN_ANGLE = np.rad2de... | true |
1defbcbd0378f9e8c913ed7c1d4c7b8b60aee5e5 | Python | cescara/aoc2019 | /day12.py | UTF-8 | 3,551 | 3.140625 | 3 | [] | no_license | from util import get_input
from itertools import count
from math import gcd
import re
def read_input(file):
return [Vector.from_string(x.strip()) for x in file]
def cmp(i, j):
return (i < j) - (i > j)
def lcm(x, y, z):
gcd_yz = gcd(y, z)
lcm_yz = y * z // gcd_yz
lcm_xyz = x * lcm_yz // gcd(x, ... | true |
a9b1d2762cf09d71584c48094888a5096c372115 | Python | yugov/tceh_homeworks | /homework2/homework2_6.py | UTF-8 | 254 | 4 | 4 | [] | no_license | # Функция принимает матрицу ( список списков ) и выводит в консоль построчно
matrix = [ [1,2,3], [4,5,6], [7,8,9]]
def matrix_out(m):
for row in m:
print(row)
matrix_out(matrix)
| true |
08a2f4835304ec7600be31a69f1600847e0752dc | Python | Wallacexwav/camiseta | /camiseta/utils.py | UTF-8 | 1,706 | 2.765625 | 3 | [
"MIT"
] | permissive | from camiseta.tempfile import *
import pathlib, os
from http.server import HTTPServer, BaseHTTPRequestHandler
import webbrowser
class Save:
def __init__(self, path='', file_name = ''):
self.path = path
self.name = file_name
if not os.path.isdir(self.path) and self.path != '':
... | true |
bcd83510c9e7203c3bd99e0c18498aabf5170913 | Python | francico4293/Kuba | /kuba_game.py | UTF-8 | 50,544 | 3.28125 | 3 | [] | no_license | # Author: Colin Francis
# Description: This file contains all logic used to play the game of Kuba. This file also contains all logic used
# to configure and update the game board using Pygame.
import pygame
from settings import *
import copy
class KubaGame(object):
"""Represents the board game Kuba"""
def _... | true |
8ef6e90a599738d1c899f040403d1808cdab35b5 | Python | DFTF-PConsole/AED-Labs-Algoritmos-LEI-2020 | /Arvore AVL (TP3 A1)/mainA1AVL-v3.py | UTF-8 | 12,940 | 3.15625 | 3 | [
"MIT"
] | permissive | # v3 - Melhoramentos: Retirei "in" em "x in array"; implementei pesquisa binaria; print_array; etc.
# v3 Abordagem Ate as folhas, depois de Baixo-para-Cima, Recursiva
# pai.direcao = return no filho da recursividade
# #### BIBLIOTECAS ####
import sys
# #### CONSTANTES ####
CMD_IN_LINHAS = "LINHAS"
CMD_OUT_NULO = "-... | true |
b969069ac299f0e6b3058a2361e9230d0026b20a | Python | DAI-Lab/SteganoGAN | /steganogan/critics.py | UTF-8 | 1,578 | 2.84375 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
import torch
from torch import nn
class BasicCritic(nn.Module):
"""
The BasicCritic module takes an image and predicts whether it is a cover
image or a steganographic image (N, 1).
Input: (N, 3, H, W)
Output: (N, 1)
"""
def _conv2d(self, in_channels, out_channels... | true |
cbfe581d394cd6d7fd543ddab38741aeb4441aa3 | Python | simonpf/llrte | /test/surface/plot_results_reflecting.py | UTF-8 | 1,177 | 2.8125 | 3 | [] | no_license | import numpy as np
import matplotlib.pyplot as plt
import xarray
#
# Lambertian surface
#
data = xarray.open_dataset("surface_lambertian.nc")
out = np.array(data.outgoing_directions)
outp = np.array(data.outgoing_positions)
inc = np.array(data.incoming_directions)
incp = np.array(data.incoming_positions)
thetas = np... | true |
2d684b367956a8f20b9cd89f20c219c4aad2c76d | Python | rst-workbench/rst-converter-service | /src/rstconverter/dis/codra.py | UTF-8 | 1,231 | 2.671875 | 3 | [
"BSD-3-Clause"
] | permissive |
import argparse
import os
import re
import sys
from rstconverter.dis.distree import DisRSTTree
EDU_START_RE = re.compile("^_!")
EDU_END_RE = re.compile("_!$")
TRIPLE_ESCAPE_RE = re.compile(r'\\\\\\"') # string contains a " char
class CodraRSTTree(DisRSTTree):
"""A CodraRSTTree is basically just a DisRSTTree wi... | true |
0314a0e54cbaa7e2f90de2f2e7aec4418ac48403 | Python | shige-horiuchi/auto | /Python自動処理sample/chapter07/show_many_columns.py | UTF-8 | 257 | 2.90625 | 3 | [] | no_license | import pandas as pd
pat = 'display.expand_frame_repr'
pd.set_option(pat, False) #←1行に含まれる列を改行せずに表示
df = pd.read_csv('e-stat-10102.csv', encoding='utf-8', header=0)
print(df[:3]) #←先頭から3行だけ表示 | true |
e4eec6d7f73c275ff143f234847522ffbe65acfd | Python | EnochEronmwonsuyiOPHS/Y11Python | /Selection006.py | UTF-8 | 264 | 3.671875 | 4 | [] | no_license | #Selection006.py
#Enoch
age = int(input("Enter your age"))
if age >= 18:
print("You can vote")
if age == 17:
print("You can learn how to drive")
if age == 16:
print("You can buy a lottery ticket")
if age < 16:
print("You can go trick or treating")
| true |
c6bae881b4333fdb533a4da6f1126328b9ec0ebf | Python | AdamZhouSE/pythonHomework | /Code/CodeRecords/2341/60896/293160.py | UTF-8 | 298 | 2.734375 | 3 | [] | no_license | a=eval(input())
for i in range(0,a):
n=input()
temp=input().split(' ')
b=map(eval,temp)
list1=list(b)
temp=input().split(' ')
b=map(eval,temp)
list2=list(b)
list1+=list2
list1.sort()
for t in range(0,len(list1)):
print(list1[t],end=' ')
print('') | true |
4fb751a31bb0f3ae966bf859f3175d372f9e4a6e | Python | parasthiti/AI | /MachineLearning/Regression_Stock.py | UTF-8 | 1,753 | 2.59375 | 3 | [] | no_license | import pandas as pd
import quandl
import math, datetime
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import style
import pickle
from sklearn import preprocessing, svm
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
style.use('ggplot')
quand... | true |
f6f8caa68425d0f006a7176766eeb2c1325d6257 | Python | log2timeline/plaso | /plaso/parsers/fish_history.py | UTF-8 | 3,556 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | # -*- coding: utf-8 -*-
"""Parser for fish history files."""
import os
import re
import yaml
from dfdatetime import posix_time as dfdatetime_posix_time
from dfvfs.helpers import text_file
from plaso.containers import events
from plaso.lib import errors
from plaso.parsers import manager
from plaso.parsers import in... | true |
8ae6581b6921f02ef5fc0f049b5f6814d19d3532 | Python | sensiTelemetria/telegram | /ruuvi/specified_tags.py | UTF-8 | 915 | 3.015625 | 3 | [] | no_license | from ruuvitag_sensor.ruuvi import RuuviTagSensor
import os
import datetime
# List of macs of sensors which data will be collected
# If list is empty, data will be collected for all found sensors
macs = ['D7:05:12:28:73:D9',]
# get_data_for_sensors will look data for the duration of timeout_in_sec
timeout_in_sec = 4
w... | true |
cfd4ec2fd6b4051f0947c8dc3f82b005c746a70b | Python | AadeshSalecha/HackerRank---Python-Domain | /Strings/What'sYourName.py | UTF-8 | 249 | 3.53125 | 4 | [] | no_license | '''
Title : What's Your Name
Subdomain : Strings
Domain : Python
Author : Aadesh Salecha
Created : August 2016
'''
first = str(raw_input())
last = str(raw_input())
print "Hello " + first + " " + last + "! You just delved into python." | true |
07f76f4f6c59841f11b463d44ca565ed9988a67b | Python | zcgu/leetcode | /codes/31. Next Permutation.py | UTF-8 | 871 | 2.875 | 3 | [] | no_license | class Solution(object):
def nextPermutation(self, nums):
"""
:type nums: List[int]
:rtype: void Do not return anything, modify nums in-place instead.
"""
pos = -1
for i in reversed(range(1, len(nums))):
if nums[i] > nums[i-1]:
pos = i
... | true |
1471c6cca03a4ebe67ac6215d98fa87ee50d4322 | Python | Nox7atra/SimpleBuildsServer | /data_structures.py | UTF-8 | 1,357 | 2.828125 | 3 | [
"MIT"
] | permissive | import os
from datetime import datetime
time_pattern = "%H:%M:%S %d/%m/%Y"
default_iconsPath = "/icons/"
def format_bytes(size):
# 2**10 = 1024
power = 2**10
n = 0
power_labels = {0 : 'B', 1: 'KB', 2: 'MB', 3: 'GB', 4: 'TB'}
while size > power:
size /= power
n += 1
return "%.0f"... | true |
fbee51ecd723559225a59ac2a9c2560bed06bc2b | Python | apurvTri123/pythonCardGame | /pythonCardGame.py | UTF-8 | 13,167 | 3.234375 | 3 | [] | no_license | import random
count = 1
discardedDeck = []
class Game:
def __init__(self):
self.Name = "" # make it cpu for computer
self.playerNumber = 0
self.score = 0
self.cardDeck = []
self.spellGod = True
self.spellRes = True
self.chance = False
... | true |
6948d1b12cdca304d36d358405a8ae99d1903cd7 | Python | DesertBot/DesertBot | /desertbot/modules/commands/RSS.py | UTF-8 | 9,879 | 2.546875 | 3 | [
"MIT",
"BSD-3-Clause"
] | permissive | import datetime
import dateutil.parser as dparser
import feedparser
from twisted.plugin import IPlugin
from zope.interface import implementer
from desertbot.message import IRCMessage
from desertbot.moduleinterface import IModule
from desertbot.modules.commandinterface import admin, BotCommand
from desertbot.response ... | true |
c08522fb490170ebd41a314640c0242585d532ab | Python | zihuaweng/leetcode-solutions | /leetcode_python/360.Sort_Transformed_Array.py | UTF-8 | 824 | 3.65625 | 4 | [] | no_license | # https://leetcode.com/problems/sort-transformed-array/
class Solution:
def sortTransformedArray(self, nums: List[int], a: int, b: int,
c: int) -> List[int]:
nums = [a * x * x + b * x + c for x in nums]
p1 = 0
p2 = len(nums) - 1
# decide which side to st... | true |
956196898857f0c27106b98806d49843d7542545 | Python | NonBorn/TensorFlow | /Logistic_Regression.py | UTF-8 | 3,497 | 3.140625 | 3 | [] | no_license | import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("/tmp/data/", one_hot=True)
learning_rate = 0.01
training_epochs = 10
batch_size = 100
display_step = 1
def categorical_cross_entropy_loss(y,pred):
# # Minimize error using cross entropy
# # ... | true |
67fd5fcd6e55e23d8c79ff7b868cefd526783486 | Python | SteveDoyle2/cpylog | /cpylog/html_utils.py | UTF-8 | 1,971 | 3.375 | 3 | [
"BSD-3-Clause"
] | permissive | """
defines:
- str_to_html(log_type, filename, lineno, msg)
"""
import datetime
import html
#message colors
DARK_ORANGE = '#EB9100'
COLORS = {
'COMMAND' : 'blue',
'ERROR' : 'Crimson',
'DEBUG' : DARK_ORANGE,
'WARNING' : 'purple',
'INFO' : 'green',
'EXCEPTION' : 'Crimson',
'CRITICAL' : 'C... | true |
786f6950521560b1af4d31646176724adb1f4321 | Python | simonesenechal/python-codes-2 | /Exerc.48.py | UTF-8 | 316 | 4.03125 | 4 | [] | no_license | # Exercicio 48
# 048: Faça um programa que calcule a soma entre
# todos os números que são múltiplos de três e que se encontram no intervalo de 1 até 500.
soma = 0
count = 0
for c in range(1, 501, 2):
if c % 3 == 0:
soma += c
count += 1
print(f'A soma total é de {count, soma}')
| true |
b2907c85bde903868e0f1d53ece858e3cbeb58e4 | Python | UelitonFreitas/TDD-BECK-KENT | /Python/test_framework.py | UTF-8 | 535 | 3.28125 | 3 | [] | no_license | class CasoDeTeste:
def __init__(self, nome):
self.nome = nome
def executa(self):
metodo = getattr(self, self.nome)
metodo()
class FoiTestado(CasoDeTeste):
def __init__(self, nome):
self.foiTestado = None
CasoDeTeste.__init__(self, nome)
def metodoDeTeste(self):
self.foiTestado = 1
class TesteDoC... | true |
0f11fe14d836b243af56f3dbf2fb4e9ab226547b | Python | zinking/acmcatchups | /leetcode/remove-duplicate-letter.py | UTF-8 | 1,069 | 3.21875 | 3 | [] | no_license | __author__ = 'awang'
class Solution(object):
def removeDuplicateLetters(self, s):
"""
:type s: str
:rtype: str
"""
d={}
n=len(s)
if n==0:return ""
for i in range(n):
c = s[i]
if d.has_key(c):
d[c].append(i)
... | true |
2f73a01e51a34936b5e955e1b81f775e55127b08 | Python | khodwe56/kaggle-birdsong-recognition | /src/loss/noisy_controlled_loss.py | UTF-8 | 1,874 | 2.609375 | 3 | [
"MIT"
] | permissive | import torch
from torch import nn
import torch.nn.functional as F
EPSILON_FP16 = 1e-5
class LSoftLoss(nn.Module):
def __init__(self):
super().__init__()
def forward(self, y_pred, y_true, beta):
with torch.no_grad():
y_true_updated = (beta*y_true+(1-beta)*y_pred) * y_true
r... | true |
a72fa101eca7aa98b781a599cfbc04daca16f20d | Python | augmentedfabricationlab/afab_course | /02_python_basics/examples/02_lists_tuples_dictionaries/ex1_lists.py | UTF-8 | 385 | 3.40625 | 3 | [] | no_license | number_list = [1, 3, 4, 6, 8, 11, 13]
string_list = ["hello", "goodbye", "no more ideas", "etc."]
mixed_list = ["strings", 5, 6, 6.7, True, "etc."]
a = range(1,10)
print(list(a))
print(list(range(1,100,5)))
print(list(range(100, -10, -20)))
print(len(string_list))
print(string_list + number_list)
print(string_list*3... | true |
0ebba8dded479336373a14a97796454df9bfd905 | Python | Alexan101/oop | /calling_methods.py | UTF-8 | 1,982 | 3 | 3 | [] | no_license | import student as st
import mentor as mr
def separator():
print('=' * 60)
student1 = st.Student('Vasya', 'Pupkin', 'male')
student2 = st.Student('Pupka', 'Vasina', 'female')
lecturer1 = mr.Lecturer('Mr', 'Prepod')
lecturer2 = mr.Lecturer('Mrs', 'Uchilka')
reviewer1 = mr.Reviewer('Mr', 'Review1')
reviewer2 = mr... | true |
68750313474a6bdfc74bf1df70b029fa3c56eac6 | Python | sgriffith3/2020-12-07-PyNDE | /learning_dictionaries.py | UTF-8 | 651 | 3.890625 | 4 | [
"MIT"
] | permissive | #!/usr/bin/env python3
# key: value
# basic_dictionary = {"key": "value"}
# random_word = {"aglet": "the tip of a shoelace"}
# print(random_word)
# print(random_word["aglet"])
# myform = {"name": "Sam", "State": "PA"}
# print(myform)
# print(f"My name is {myform['name']} and I live in {myform['State']}")
my_car = {... | true |
a791bec6fadb29bf62dd6a7544800791ad93e7ce | Python | KoffieNu/slimmemeter-rpi | /rspiWebServer-1/appWebserver.py | UTF-8 | 1,201 | 2.546875 | 3 | [] | no_license | import datetime
import re
from flask import Flask, render_template, request
import sqlite3
import json
app = Flask(__name__)
numSamples = 100
def getDatetimeObject(iso_string):
timestamp = re.sub(r"[:]|([-](?!((\d{2}[:]\d{2})|(\d{4}))$))", '', iso_string)
dt = datetime.datetime.strptime(timestamp, "%Y%m%dT%... | true |
8ae659e405e6e426bf3832af780d600c48005c43 | Python | tnakaicode/jburkardt-python | /disk/disk_sample.py | UTF-8 | 3,455 | 2.921875 | 3 | [] | no_license | #! /usr/bin/env python3
#
def disk_sample ( center, r, n, seed ):
#*****************************************************************************80
#
## DISK_SAMPLE uniformly samples the unit disk.
#
# Licensing:
#
# This code is distributed under the GNU LGPL license.
#
# Modified:
#
# 05 July 2018
#
# Autho... | true |
4da9e865d9043b4582214f77d71a79c69f37da66 | Python | sgosline/SAMNet | /src/parseinput_samnet.py | UTF-8 | 9,644 | 2.6875 | 3 | [
"MIT"
] | permissive | '''
parseinput_samnet.py
SAMNet module handles pre-processing of SAMNet files
Copyright (c) 2012 Sara JC Gosline
sgosline@mit.edu
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 restricti... | true |
55d288204671710dc6d8ec17a7b905f9ce1cfb6d | Python | loganyu/leetcode | /problems/2491_divide_players_into_teams_of_equal_skill.py | UTF-8 | 1,515 | 4.125 | 4 | [] | no_license | '''
You are given a positive integer array skill of even length n where skill[i] denotes the skill of the ith player. Divide the players into n / 2 teams of size 2 such that the total skill of each team is equal.
The chemistry of a team is equal to the product of the skills of the players on that team.
Return the sum... | true |
606b7466b96e57536079fe159dfe6c74a8744133 | Python | shen-huang/selfteaching-python-camp | /exercises/1901040018/1001S02E05_array.py | UTF-8 | 102 | 2.671875 | 3 | [] | no_license | l=list(range(10))
l.reverse()
l1=(str(i) for i in l)
l2=''.join(l1)
l3=l2[1:8]
l4=l3[::,-1]
print(l4)
| true |
66d2d5858a8b30c5beee56f1f64147e19e2b05d6 | Python | Sree-Vandana/AI-final-project | /Expectimax/main_2048game.py | UTF-8 | 3,955 | 3.40625 | 3 | [] | no_license | from game_board import GameBoard
from ai import AI
from random import randint, seed
import numpy as np
dirs = {
0: "UP",
1: "DOWN",
2: "LEFT",
3: "RIGHT"
}
# python main_cli > output.txt
stepCount_256Arr = []
stepCount_512Arr = []
stepCount_1024Arr = []
stepCount_2048Arr = []
stepCount_4096Arr = []
ga... | true |
2c6d859adb5cfdf64e7abd8ff608ece3210a9308 | Python | seekever/VideoSummary | /video_summary/models/model_interface.py | UTF-8 | 4,151 | 2.890625 | 3 | [
"MIT"
] | permissive | """ The module for the model's interface."""
import logging
from PyQt5 import QtCore
# Logger
LOGGER_NAME = 'App.Models.Interface'
LOG = logging.getLogger(LOGGER_NAME)
class ModelInterface:
"""
The model's interface.
...
Attributes
----------
next : signal
the signal to change to t... | true |
cb2829fc637598496730137cc7ebffda93865dd8 | Python | SuyashVerma2311/micromouse_maze_solver | /pkg_tf_micromouse/scripts/obstacle.py | UTF-8 | 1,664 | 2.71875 | 3 | [
"MIT"
] | permissive | import rospy
from sensor_msgs.msg import LaserScan
from geometry_msgs.msg import Twist
from nav_msgs.msg import Odometry
from tf import transformations
import numpy as np
class Obstacle(object):
def __init__(self, delta_err=3):
self.sub = rospy.Subscriber('/my_mm_robot/laser/scan', LaserScan, self.clbk_las... | true |
5fc72ff4256225dfaa0e0aca91ad58b5deaba226 | Python | stonecoldhughes/dare | /data_analysis/analyze.py | UTF-8 | 6,950 | 2.625 | 3 | [] | no_license | #The purpose of this file is to obtain data runs and then call
#another script to run a simple statistical analysis
import xml.etree.ElementTree as xml
import subprocess
import argparse
import sys
import os
#Use autogen.py to build an executable
def make_test_executable(config, mode):
if(mode == 'trace'):
... | true |
c771c6d7cb1e614227672e92a4cd696d113e4654 | Python | won-hyw/CodingTest | /문제05.py | UTF-8 | 704 | 3.828125 | 4 | [] | no_license | # 1부터 number까지 몇 번 박수를 쳐야 하는지 반환
def solution(number):
count = 0
for i in range(1, number + 1): # for(int i=1; i<number+1)
current = i
temp = count
while current != 0:
if current % 10 % 3 == 0 and current % 10 != 0:
count += 1
current = current //... | true |
660f8eb80cab70da9fd2b49ef7b98952508f84d0 | Python | Labbeti/MLU | /mlu/utils/typing_/classes.py | UTF-8 | 1,118 | 3 | 3 | [
"MIT"
] | permissive |
from abc import ABC
from torch.utils.data.dataset import Dataset
from typing import Iterable, Protocol, Sized, Union, runtime_checkable
class SizedIterable(Sized, Iterable, Protocol):
"""
Class that inherit from Sized and Iterable protocols classes.
Subclasses must implements '__iter__' and '__len__' methods.
... | true |
6e23a1e76ce536e3d085ac58025565da14d15a05 | Python | mnot/tarawa | /http/lib/header/registry.py | UTF-8 | 3,211 | 2.65625 | 3 | [] | no_license | """
http.header.registry - HTTP Header Field Registry
This module provides a metaclass and functions that together implement a
centralised registry of HTTP header field names and the implementations
for their values.
"""
__license__ = """
Copyright (c) 1999-2006 Mark Nottingham <mnot@pobox.com>
Permission is hereb... | true |
1c1a31e99cdd455bdee709276e7c4ab1bb0211ef | Python | AxelSiliezar/ME021-Python | /Me021-Python/HW02/HW02_01.py | UTF-8 | 477 | 4.28125 | 4 | [] | no_license | import math
Ang_1 = input ("Enter value for first angle: ") #value in degrees
Ang_1 = float (Ang_1)
Ang_2 = input ("Enter value for second angle: ") #value in degrees
Ang_2 = float (Ang_2)
ang_1 = Ang_1*(math.pi/180) #convert to radians
ang_2 = Ang_2*(math.pi/180) #convert to radians
cos1 = math.cos(ang_1)
cos... | true |
15ad768be6c1fc726c275642673b7329365646be | Python | jg1141/nzpug20210721 | /setup.py | UTF-8 | 4,765 | 2.828125 | 3 | [
"MIT"
] | permissive | # setup.py
# Created 20210524 1537
# Invoke with %run "C:\\setup.py"
# Modified (see version)
VERSION = "20210720 2217 "
import datetime
import humanize
import numpy as np
import os
import pandas as pd
import plotly.express as px
import pyperclip
import re
import sidetable
import snowflake.connector
import time
from... | true |
789d9cfad51ba0bda57a449592832b86c40dfef1 | Python | psnakhwa/Python-Exercises | /Python Coding Exercises/zeromatrix.py | UTF-8 | 622 | 3.75 | 4 | [] | no_license | #Zero Matrix in python
#ctci 1.8
def nullifyRow(matrix,row):
for j in range(len(matrix[0])):
matrix[row][j]=0
def nullifyCol(matrix,col):
for i in range(len(matrix)):
matrix[i][col]=0
def setZeros(matrix):
row = [None]*len(matrix)
col = [None]*len(matrix[0])
for i in range(len(row)):
for j in range(len(... | true |
6b0c2d402071557bddbf0375a5b517dd3e363575 | Python | sevenreek/mysterious-complete | /TimerServer/roomController.py | UTF-8 | 6,529 | 2.71875 | 3 | [] | no_license | from CONFIGURATION import CFG_DEFAULT_TIME
from logger import Logger
import datetime
STATE_READY = 0
STATE_RUNNING = 1
STATE_PAUSED = 2
STATE_STOPPED = 3
# All events(RoomEvent) are passed to the roomcontroller which handles them calling appropriate public functions in gpio, display and timer.
# The room co... | true |
1368279a837198f403b0e7724ceb6a0c86e0afe9 | Python | anastas-ananas/itstep | /lesson6/prime42.py | UTF-8 | 256 | 3.59375 | 4 | [] | no_license | result = []
for number in range(2, 300):
for i in range(2, number):
if number % i == 0:
break
else:
result.append(number)
if len(result) == 42:
break
print(result)
print(f"Number of digits: {len(result)}")
| true |
b6b1a120a10fc378ba6e1c94694394c068a7e221 | Python | bobbecooper/congenial-engine | /main.py | UTF-8 | 265 | 2.921875 | 3 | [] | no_license | from Cycle import Cycle
my_cycle = Cycle()
# main input loop
my_cycle.print_options()
user_input = int(input())
while user_input != 0:
my_cycle.update_cycle(user_input)
my_cycle.print_new_idea()
my_cycle.print_options()
user_input = int(input())
| true |
fe36a0fd14e0479356d2261a86c2cad02bbdd8f8 | Python | Aasthaengg/IBMdataset | /Python_codes/p03576/s816034475.py | UTF-8 | 709 | 3.09375 | 3 | [] | no_license | n, k = map(int, input().split())
x_y = []
x = []
y = []
for i in range(n):
a,b = map(int, input().split())
x.append(a)
y.append(b)
x_y.append([a,b])
ans = 10**19
def check(a,b,c,d):
count = 0
for i in range(n):
s,t = x_y[i]
if a <= s <= b and c <= t <= d:
count += 1
... | true |
e0e53cdbe1da00a5936c23f9c132ed916c3682fe | Python | ifrit98/tf_dataset | /tf_dataset/metadata.py | UTF-8 | 4,615 | 2.71875 | 3 | [] | no_license | import os
import numpy as np
import pandas as pd
from .dataset_sql import signal_dataset
from .dataset_prepare_signal import dataset_prepare_signal_for_ml
from .dataset_slice_windows import dataset_signal_slice_windows
from .dataset_complex import dataset_signal_apply_analytic
from .dataset_normalize import dataset_si... | true |
a312a2275cbc178d68918bced66b68f3d191495c | Python | EsriJapan/gcf2018-arcpy-demo | /source/forum_ArcPy_arcgispro.py | UTF-8 | 2,884 | 2.640625 | 3 | [
"Apache-2.0"
] | permissive | # coding:utf-8
###############################################################
# CSVファイルを読込み、フィーチャ クラスを作成するスクリプト #
###############################################################
"""
data フォルダをCドライブ直下に配置すればそのまま動作します。
任意の場所に配置する場合はデータの配置場所に合わせて変数の値を変更してください。
"""
import arcpy
import os
import datetime
... | true |
b30e054ecff2299dd39a31a1682bf22953ce1437 | Python | sourav-coder/Python-Code-Challanges | /Python Code Challenges/100-plus-Python-programming-exercises-extended-master/solutions/Day-16/64.py | UTF-8 | 157 | 3.375 | 3 | [] | no_license | def gen(n):
for i in range(0,n+1):
if i%5==0 and i%7==0:
yield str(i)
a=list(gen(int(input())))
print(','.join(a))
| true |
fffcd0fbd6bd234bc8e22a572734c85ef9a28d03 | Python | mickwar/leetcode | /medium/minimum_path_sum.py | UTF-8 | 2,062 | 3.90625 | 4 | [] | no_license | # https://leetcode.com/problems/minimum-path-sum/
# At time of submission
# performed 78% faster
# used less than 17% memory
# than other solutions
# Thanks to this article for help: https://www.geeksforgeeks.org/min-cost-path-dp-6/
# Using dynamic programming (DP), allocating memory so we don't do unnecessary
# c... | true |
11043f399a2f35456aacd9ca2cc12576610d4e5a | Python | whitepaper2/data_beauty | /leetcode/100_is_sametree.py | UTF-8 | 1,832 | 3.546875 | 4 | [] | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018/11/18 下午5:32
# @Author : pengyuan.li
# @Site :
# @File : 100_is_sametree.py
# @Software: PyCharm
from common import timeit
# Definition for a binary tree node.
class TreeNode:
def __init__(self, x):
self.val = x
self.left = N... | true |
10cf88102f04a2393c230257135c9a83e850fa87 | Python | Yash-Dabhade/Automatic-File-Handler | /FileCleaner.py | UTF-8 | 1,839 | 2.671875 | 3 | [] | no_license | import os
files = os.listdir()
files.remove("FileCleaner.py")
def createfolder(foldername):
if not os.path.exists(foldername):
os.makedirs(foldername)
def sortfiles(fileslist, ext):
for file in files:
if os.path.splitext(file)[1].lower() in ext:
fileslist.append(file... | true |
80bde3b43be525795f6feba464e3aa0302386488 | Python | MinSu-Kim/python_tutorial | /mysql_tutorial/coffee_sale/connection_pool_test.py | UTF-8 | 354 | 2.734375 | 3 | [] | no_license | from mysql_tutorial.coffee_sale.connection_pool import DatabaseConnectionPool
connection = DatabaseConnectionPool.get_instance().get_connection()
cursor = connection.cursor()
cursor.execute("select * from product")
rows = cursor.fetchall()
print('Total Row(s):', cursor.rowcount)
for row in rows:
print(type(row),... | true |
75094d0082644d028368f28fdc4e81a7bf9adbcd | Python | Savirman/Python_lesson01 | /example05.py | UTF-8 | 1,563 | 4.28125 | 4 | [] | no_license | # Программа расчета основных показателей деятельности фирмы
# Запрос основных показателей фирмы: выручки (proceeds) и издержек (costs)
# с целью определения прибыли (profit)
proceeds = float(input("Какова выручка Вашей компании?: "))
costs = float(input("Каковы издержки Вашей компании?: "))
profit = proceeds - c... | true |
0e38c2901d7673db20a4660daa6134e7dd7f6e7a | Python | shashi278/DataCommunication | /codes/ssb_sc.py | UTF-8 | 1,528 | 3.109375 | 3 | [
"MIT"
] | permissive | import numpy as np
from numpy import *
from scipy.signal import butter, lfilter, freqz
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
from ampMod import AmplitudeModulation
class SSBSC(AmplitudeModulation):
def createSignals(self):
'''
Note:
==========
creates 'carrier', 'me... | true |
a9e039ea4d34ef0b8cb46f79f4fe59755833b7f3 | Python | kimberlybone/python-course | /conditional.py | UTF-8 | 434 | 4.1875 | 4 | [] | no_license | x = 20
# CONDITIONAL 1 (Basic)
# if x > 2 :
# print('Bigger')
# else :
# print('Smaller')
# print('All done')
# CONDITIONAL 2 (Multi-way)
# if x < 2 :
# print('small')
# elif x < 10 :
# print('Medium')
# else :
# print('LARGE')
# print('All done')
# CONDITIONAL 3 (Used to catch errors)
astr... | true |
c13fc5fb06c18048eb1a6e3952e6d088f27c9e9c | Python | AsaneZeto/Image-Process | /hw2.py | UTF-8 | 7,848 | 2.953125 | 3 | [] | no_license | import sys
sys.path.append("../hw1")
import hw1
import numpy as np
import cv2
import queue
def processImage(path, color='gray'):
img = cv2.imread(path,1)
if color == 'gray':
img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
elif color == 'rgb':
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
retur... | true |
9918ee3844c1f33d9a1e8a89b30ec4a45530651c | Python | hub4mani/ProjectEuler | /016.py | UTF-8 | 132 | 3.046875 | 3 | [] | no_license | num_str = str(2**1000)
print num_str
sum = 0
length = len(num_str)
for i in range(length):
sum = sum + int(num_str[i])
print sum
| true |
2baee35c5fcd1523e6a2ef9683be61e0000925e2 | Python | MayhemMark/project-mayhem | /tests/die_rolls.py | UTF-8 | 548 | 4.21875 | 4 | [] | no_license | import random
def roll_dice():
list1 = []
sides = int(input("how many sides does the die have?: "))
times = int(input("how many times do you want to roll? "))
print(f"\nRolling a {sides} sided die, rolling it {times} times")
print("These are the results:\n")
for i in range(0, times):
l... | true |
a170be88d09386d33e40e62f5029c215ffffaf8f | Python | lyft/salt | /salt/modules/win_servermanager.py | UTF-8 | 4,100 | 2.59375 | 3 | [
"Apache-2.0",
"MIT",
"BSD-2-Clause"
] | permissive | # -*- coding: utf-8 -*-
'''
Manage Windows features via the ServerManager powershell module
'''
from __future__ import absolute_import
import logging
# Import python libs
try:
from shlex import quote as _cmd_quote # pylint: disable=E0611
except ImportError:
from pipes import quote as _cmd_quote
# Import salt... | true |
9520bf2d1900bb8188141cd0b1539d046f8f0856 | Python | zhangqizky/LearnOpenCV_Chinese | /HighDynamicRange/HDR.py | UTF-8 | 2,056 | 2.765625 | 3 | [] | no_license | import os
import cv2
import numpy as np
def readImagesAndTimes():
"""[读取时间和图像]
Returns:
[list of images] -- [图像]
[list of times] -- [时间]
"""
times = np.array([1/30,0.25,2.5,15],dtype=np.float32)
filenames = ["img_0.033.jpg","img_0.25.jpg","img_2.5.jpg","img_15.jpg"]
images ... | true |
4e4ab7d6fd76ab5364cf9595c7c4e5a390ecdc0a | Python | vladstulov/SFact | /Krest-nol_4x4.py | UTF-8 | 1,845 | 3.703125 | 4 | [] | no_license |
def show_field(f):
num =' 0 1 2 3'
print(num)
#zip
for row,i in zip(f,num.split()):
print (f"{i} {' '.join(str(j) for j in row)}")
def users_input(f,user):
while True:
place=input(f"Ходит {user} Введите координаты строка столбец:").split()
if len(place... | true |
f08be0440ad50529c44157826fb19b9ab6055d7e | Python | gerrymandr/graphmaker | /graphmaker/reports/splitting.py | UTF-8 | 3,337 | 2.984375 | 3 | [
"MIT"
] | permissive | import numpy
from graphmaker.constants import fips_to_state_name
from graphmaker.resources import BlockAssignmentFile, BlockPopulationShapefile
def splitting_report_for_fips(fips, unit, part, function_for_splitting_energy=numpy.log):
df = load_matching_dataframe(fips, unit, part)
return splitting_report(df, u... | true |
861c40b22fe484eb33d51933f54f871d987219df | Python | cleancoindev/Qurry | /qurry/libraries/standard_library/constructs/bernoulli.py | UTF-8 | 276 | 2.609375 | 3 | [
"MIT"
] | permissive | from ..library.controlled import bernoulli as _bern
def bernoulli(p, q, rot='RX', kernel=None):
'''
Exploit an RX gate to create a simple bernoulli trial
(bernoulli 0.5 0) # Create the 0.5 state on qubit 0
'''
p = float(p)
return _bern(p, q, rot=rot)
| true |
c3f5693ba33bf1565e5ce9ca43f4ee0554dfe4b3 | Python | NeqroMa/DiceRollTest | /random_example.py | UTF-8 | 421 | 3.65625 | 4 | [] | no_license | import random
# pick a random number from 0 to n-1
n = 10
my_rand = random.randrange(n)
print(my_rand)
a = 2
b = 5
my_rand2 = random.randint(a,b)
my_rand3 = random.randrange(a,b)
print( f'{my_rand2} vs {my_rand3}')
my_rand4 = random.randrange(10) + 1
print(my_rand4)
"""
randint enables a result to be the biggest... | true |
926492d26e22064e078a07f45221036f24f85168 | Python | atseng202/flask-blogly | /app.py | UTF-8 | 8,804 | 2.546875 | 3 | [] | no_license | """Blogly application."""
from flask import Flask, request, redirect, render_template, flash
from models import db, connect_db, User, Post, Tag, PostTag
from form_validation import is_form_invalid
from flask_debugtoolbar import DebugToolbarExtension
app = Flask(__name__)
app.config["SECRET_KEY"] = "SECRET!"
debug = ... | true |
c89e7b321275288b358d0c23c1015cde8febbfb8 | Python | Kamala16/python-fais | /zestaw_03/poprawnoscKodu1.py | UTF-8 | 304 | 4.1875 | 4 | [] | no_license | # I Część - jest poprawny
x = 2 ; y = 3;
if (x > y):
result = x;
else:
result = y;
#II Część - nie jest poprawny
#for i in "qwerty": if ord(i) < 100: print (i)
#III Część - nie jest poprawny w python 3 (trzeba dodać nawiasy)
#for i in "axby": print ord(i) if ord(i) < 100 else i
| true |
adc3d2e74a9fec4f31fd1816320ee6128b78d7af | Python | lychengrex/Image-Denoising-with-Deep-CNNs | /src/nntools.py | UTF-8 | 12,684 | 3.15625 | 3 | [
"MIT"
] | permissive | """
Neural Network tools developed for UCSD ECE285 MLIP.
Copyright 2019. Charles Deledalle, Sneha Gupta, Anurag Paul, Inderjot Saggu.
"""
import os
import time
import torch
from torch import nn
import torch.utils.data as td
from abc import ABC, abstractmethod
class NeuralNetwork(nn.Module, ABC):
"""An abstract ... | true |
1a710ac65bb0e17b3d95b8f7a62bde205077ec1f | Python | Mundhey/Code-Monk-Hacker-Earth | /Basic Programming/Product.py | UTF-8 | 153 | 2.765625 | 3 | [] | no_license | N=int(raw_input())
numArray = map(int, raw_input().split())
prod=1
for i in range(0,N):
prod=prod*numArray[i]
prod=prod % (pow(10,9)+7)
print prod | true |
9bd3128d732ff27d680306a05cad5db621fd03e4 | Python | lpr014/omega | /Divide.py | UTF-8 | 636 | 3.421875 | 3 | [] | no_license | # Created by Lorantz on 9/28/17 6:15 PM
# Last edit by Lorantz on 9/29/17 5:20 PM
def divide(num1, num2):
# divide by zero error check
if num2 == 0:
print("CANNOT DIVIDE BY ZERO")
return
else:
ans=num1/num2
return ans
# remainder using the % symbol
def mod(num1, num2):... | true |
27fbc6e39f543885d4d2e07e8d91546d7bc8e4bd | Python | luggroo/224u_dating_classical_chinese | /crawl.py | UTF-8 | 458 | 2.796875 | 3 | [] | no_license | import codecs
import re
f = codecs.open('Chinese Text Project.html', encoding='utf-8')
lines = []
file = open("booktitles.txt","wb")
for line in f:
if ("class=\"sprite-expand\" title=\"+\">+<div style=\"display: inline;\"></div></a></div><a" in line):
a = re.findall(r'href=\"([^\"]*?)\">([^<]*?)</a... | true |
f04c2d56ef665c621770043d0ae9fb1df65ab746 | Python | nabetama/gimei | /tests/test_name.py | UTF-8 | 1,224 | 3.53125 | 4 | [
"MIT"
] | permissive | # coding: utf-8
from gimei import Gimei
from gimei import Name
class TestName(object):
def test_kanji_name_in_data(self):
name = Gimei().name
assert Name.find_name_by_kanji(name.kanji)
def test_hiragana_name_in_data(self):
name = Gimei().name
assert Name.find_name_by_hiragana(... | true |
81956b102ab0fca330fa7d1f8945afef81b6b6ce | Python | Brunochavesg/Guanabara | /ex009.py | UTF-8 | 423 | 3.75 | 4 | [
"MIT"
] | permissive | n1 = int(input ("Digite um numero: "))
print ("=" * 15)
print (f"{n1} x {1:2} = {n1 * 1}")
print (f"{n1} x {2:2} = {n1 * 2}")
print (f"{n1} x {3:2} = {n1 * 3}")
print (f"{n1} x {4:2} = {n1 * 4}")
print (f"{n1} x {5:2} = {n1 * 5}")
print (f"{n1} x {6:2} = {n1 * 6}")
print (f"{n1} x {7:2} = {n1 * 7}")
print (f"{n1} x {8:... | true |
49a596c4cd34e0437ded60748d9a51726f83837b | Python | mdukat/anonupload | /config.py | UTF-8 | 1,175 | 2.78125 | 3 | [
"MIT"
] | permissive | #!/usr/bin/python3
import os
home = os.environ['HOME']
config_file = open(home + '/.config/anonupload', 'w')
print("Hi! I will ask you some questions, read carefully!")
print("What server do you want to use? [anonfile, megaupload, bayfiles, none]")
server = input()
if(server not in ('anonfile', 'megaupload', 'bayfiles'... | true |
43ec17d54890a8190a0b5d1eb8b5e669823633d7 | Python | uyth/pu | /test_environment.py | UTF-8 | 1,866 | 3.5 | 4 | [] | no_license | from course_schedule.course_details import *
def stars():
print("*" * 69)
def print_stuff(code, program):
print()
print()
stars()
print("*" * 20 + " PARRY'S METHOD TESTER " + "*" * 20)
stars()
print("Current course: " + code.upper())
print("Current program: " + program.upper())... | true |
2a224b1e9320afebe4fb1a783b4cba7ab57387f7 | Python | undugy/2017182020_2Dproject | /final project/game/CPlayer.py | UTF-8 | 4,699 | 2.578125 | 3 | [] | no_license | from pico2d import *
import gfw
import win32api
from gobj import *
import CBullet
import CHyperion
class Player():
playertype=0
def __init__(self):
self.x, self.y = 0, 90
self.image = load_image('Resource/Player_T.png')
self.image2 = load_image('Resource/Player_T2.png')
self.im... | true |
0fec682b8002a70fc1ed644337dafcbcf46f7b88 | Python | victortd/GeometricMethods_CS | /code_mapreduce/job1_mapper.py | UTF-8 | 349 | 3.359375 | 3 | [] | no_license | #!/usr/bin/env python
#job 1
#mapper_1
import os
import sys
value=[0,0]
for line in sys.stdin:
"""
the input line is "key x y z"
the output is (key, "x y z")
"""
#we get the key
value[0] = line.split(' ')[0]
#we get the three coordinates
value[1] = line[line.find(' '):-1]
#we print the output
print '{},{}... | true |
ffd046de296ab75cf6eaca0581cbc51c68772cfd | Python | g573179240/spider | /scrapy/Douyu/Douyu/spiders/douyu.py | UTF-8 | 1,383 | 2.75 | 3 | [] | no_license | # -*- coding: utf-8 -*-
import scrapy
import json
from Douyu.items import DouyuItem
class DouyuSpider(scrapy.Spider):
name = 'douyu'
allowed_domains = ['capi.douyucdn.cn']
baseUrl = "http://capi.douyucdn.cn/api/v1/getVerticalRoom?limit=20&offset="
offset = 0
start_urls = [ baseUrl + str(offset) ]... | true |
0f3d4662274f5bf16eff984ad7128d0ebd06c995 | Python | mgorgei/codeeval | /Easy/c93 Capitalize Words.py | UTF-8 | 543 | 4.21875 | 4 | [] | no_license | '''CAPITALIZE WORDS
Write a program which capitalizes the first letter of each word in a sentence.
INPUT SAMPLE:
Your program should accept as its first argument a path to a filename. Input
example is the following
Hello world
javaScript language
a letter
1st thing
OUTPUT SAMPLE:
Print capitalized words in the foll... | true |
4ca937367afe64a053529d837edd527a940ab19b | Python | ZwangaMukwevho/Design | /APIcode/driver.py | UTF-8 | 4,335 | 2.8125 | 3 | [
"MIT"
] | permissive | import os
import subprocess
import fileManager
import time
import fileTransfer
import admin
FM = fileManager.fileManager()
FT = fileTransfer.fileTransfer()
AD = admin.admin()
class runner:
def welcome():
os.system('clear')
print(" _________ _____ ")
print("| ... | true |
56ff946586cb43995aafbdf4eebc9fa1a23a8725 | Python | VladBaryliuk/my_start_tasks | /new/src/06.02.2021/to letter i.py | UTF-8 | 347 | 3.328125 | 3 | [
"Apache-2.0"
] | permissive | alfabet ="абвгдеёжзийклмнопрстуфхцчшщъыьэюя"
human_string = str(input("enter your string in the russian language"))
def before_letter_i():
global human_string
for i in human_string:
if i < "и":
human_string = human_string.replace(i, "")
return human_string
print(before_letter_i()) | true |
f797f8730edfe2335659c4e0cc2e6477848e3206 | Python | rbyrne08/QuantCreation | /APIPull.py | UTF-8 | 1,562 | 2.890625 | 3 | [] | no_license | import requests
import time
import pandas as pd
from config import client_id
import plotly.graph_objects as go
#The daily prices endpoints
def pricehistory():
#Define endpoint
endpoint = r"https://api.tdameritrade.com/v1/marketdata/{}/pricehistory".format('AMD')
#Define payload
payload = {'apikey':cli... | true |
fa74fbccddc048dda2f1d625e0835ba8fbee90e5 | Python | hmbtl/ejob_parser | /ejob/spiders/bossFull.py | UTF-8 | 5,278 | 2.65625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
import scrapy, dateparser
class BossFullSpider(scrapy.Spider):
name = 'bossFull'
allowed_domains = ['boss.az']
start_urls = ['http://boss.az']
def parse(self, response):
# create empty dict
categories = [];
sub_categories = [];
# for each option in categories
for c... | true |
26b57d020f887da5f240723961e123b0244394fa | Python | El-anqiao/program-diary | /Python/keyword/t2.py | UTF-8 | 896 | 2.671875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from snownlp import normal
from snownlp import seg
from snownlp.summary import textrank
import re
from html.parser import HTMLParser
import html
text='''
Children Kids Rain Proof Wear-resisting Anti-Slip Shoe Cove... | true |
123a9ee7376f106bf0a70c2dbda59365e7c8225b | Python | benjyar123/Developers-Institute | /Week 4 - Python/Day 3 - Dictionaries/Dictionaries/W4D3DC.py | UTF-8 | 619 | 4.0625 | 4 | [] | no_license | def encrypt(string):
message = ""
for letters in string:
new = chr(ord(letters) + 14)
message += str(new)
print(message)
def decrypt(string):
message = ""
for letters in string:
new = chr(ord(letters) - 14)
message += str(new)
print(message)
quit = False
while q... | true |
6ee561658e3a7370439679228a6db6ec362019c3 | Python | mtleis/Bioinformatics-Specialisation-UC | /01_Replication/02_SkewArrayAndHammingDistance/03_MinimumSkew.py | UTF-8 | 877 | 3.765625 | 4 | [] | no_license | # Input: A DNA string Genome
# Output: A list containing all integers i minimizing Skew(Prefix_i(Text)) over all values of i (from 0 to |Genome|)
def MinimumSkew(Genome):
positions = [] # output variable
array = SkewArray(Genome)
print('array, ', array)
minimum = min(array)
print('minimum', minimum... | true |
d650a206d5e06601c71e354017dbf6ace03706cd | Python | Sushanta-Ghosh/Smart-Cross | /matcode/traffic_control.py | UTF-8 | 7,749 | 2.671875 | 3 | [] | no_license | import time
import scipy.io as sio
import sys
def main():
data_list = ['self_distance', 'v2_distance', 'v2_cmd', 'self_cmd', 'offset_theta', 'sensor_distance']
local_data = {'self_distance': 0.0, 'v2_distance':0.0, 'v2_cmd': 3.0, 'self_cmd': 3.0}
#initialize mat file values to begin
sio.s... | true |
116519e71b1e8c91c498496dbb6b096f4208c838 | Python | alrusdi/bg.alrusdi.ru | /chooser/tests/test_helpers.py | UTF-8 | 712 | 2.640625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
import fudge
from django.test import TestCase
from chooser import helpers
class BaseTestCase(TestCase):
pass
class ChooseNewGameToPlayTest(BaseTestCase):
@fudge.patch('chooser.helpers._choose_random')
def test_chooses_random_game_from_lowest_by_play(self, choose_random_stub):
... | true |
1bbdcc4790dcd5e62fe44ffbe13da095f64bf9f3 | Python | PlumpMath/jafp3dd | /tests/recurseTest.py | UTF-8 | 1,693 | 3.140625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Wed Dec 21 09:47:48 2011
@author: shawn
"""
import random
from panda3d.core import Vec3, Quat
class BranchNode():
def __init__(self,l=1,rad=1,Q=Quat(),pos=Vec3(0,0,0)):
self.length = l # MOVE TO GENERATION ROUTINE. DON'T NEED LENGTHS, ONLY POSITIONS
... | true |