blob_id
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
b8921efca1e829226764888eba5ec2d2c1dd086b
Honny1/School_Programing_Python
/Kun.py
UTF-8
557
3.203125
3
[]
no_license
class Kun: #vlastnosti: jmeno, rok_narozeni, pocet_vitezstvi def __init__(self, jmeno, rok_narozeni): self.jmeno = jmeno self.rok_narozeni = rok_narozeni self.pocet_vitezstvi = 0 def __str__(self): vystup = "Kun " + self.jmeno + ", narozen: " + str(self.rok_n...
true
5e44997e90ade32e41e87055e2dd1556417e59fb
rasisbuldan/halma_game
/halma_game/working/halma_player_04_A.py
UTF-8
13,311
3.1875
3
[ "MIT" ]
permissive
# -*- coding: utf-8 -*- """ Gen 3 - Group Recursive minimax with alpha-beta pruning Evaluation: - """ import random import time from halma_player import HalmaPlayer class HalmaStateNode: val = 0 def __init__(self, turn, parent=None, current=None, move=None): # Store attributes value ...
true
2d847f03310483029ff27f54a7fb441fb65a662d
BiOmicsLab/AVPIden
/utils.py
UTF-8
1,210
3.1875
3
[ "MIT" ]
permissive
import pandas as pd from Bio import Seq, SeqIO def write_fasta(df, file_path, abbr_columns=None): """ Save dataframe to a .fasta file, the df should contain at least columns named "Id" and "Sequence" df: dataframe for saving .fasta file_path: path(string) for saving the fasta file abbr_column...
true
2f7959ee1998d9b3e784d04ef46e27384aa48ef2
saswat0/TextAttack
/textattack/transformations/word_swap_masked_lm.py
UTF-8
9,802
3.03125
3
[ "MIT" ]
permissive
import itertools import numpy as np import torch from transformers import AutoModelForMaskedLM, AutoTokenizer from textattack.shared import utils from textattack.transformations.word_swap import WordSwap class WordSwapMaskedLM(WordSwap): """ Generate potential replacements for a word using BERT-Masked LM. ...
true
8637915b875b50a9c7398cf6c7f07eeb6e545cc3
Aldisugiarto/Data-Science
/Pekan 2/TugasPythonLanjutan_Hari_8_AldiSugiarto.py
UTF-8
3,977
3.015625
3
[]
no_license
import tweepy as tw import re import pandas as pd import matplotlib.pyplot as plt import numpy as np consumer_key = *Your consumer key* consumer_secret = *Your consumer secret* access_token = *Your token* access_token_secret = *your token secret* auth = tw.OAuthHandler(consumer_key,consumer_secret) auth.set_access_to...
true
6c18edfa8490add280f017d823c59ca99bf846d2
divyeshpydev/python_coders_arena
/comments.py
UTF-8
558
3.5625
4
[]
no_license
name='divyesh' age=23 #jkfdblabf #there is name and age present age=marks=kt=23 ''' qualification="post graduate" qualification="post graduate" qualification="post graduate" ''' print("hello my name is ",name," My age is ",age) # String formatting - concatination full_name = "hello My Name is "+name...
true
747f36615b918e77fbc2cc6d25737646c4b6454e
VictoriayLorena/fa.py
/fa.py
UTF-8
306
3.1875
3
[]
no_license
#!/usr/bin/env pyhton # __*__ coding:utf-8 __*__ def main(): C = float(input("Grados Celsius: 4")) F = (( 9.0 / 5.0)) media = (celsius + fahrenheit) / 2 print("La media aritmética de {9.0} y {5.0} es {}".format(numero_1,numero_2,media)) if __name__ == "__main__": main()
true
bc50b646cb559b6dcec3052b64e757d17c1de543
gamapedro77/he4rtoberfest-2020
/challenges/8-fibonacci/python/mateusgundel/fibonacci.py
UTF-8
786
3.859375
4
[]
no_license
import sys # Lê o número inteiro inteiro_N = int(sys.argv[1]) if inteiro_N <= 0 or inteiro_N >= 46: print("O número deve ser maior que 0 e menor que 46") exit() # inicializa as variáveis de controle e a string de saída ultimo_numero = 1 numero = 1 string_resposta = "" for index in range(inteiro_N): # Ad...
true
9f0be70df9224c84b75d9fb7a89bf911f153c75d
olgatsiouri1996/biomisc
/src/fasta_manipulation/retrieve_full_fasta_headers.py
UTF-8
640
2.734375
3
[ "MIT" ]
permissive
# python3 import argparse from pyfaidx import Fasta # input parameters ap = argparse.ArgumentParser(description="retrieve fasta identifiers and their descriptions") ap.add_argument("-in", "--input", required=True, help="input multi-fasta file") ap.add_argument("-headers", "--headers", required=True, help="1-column txt ...
true
22579f7fbf8c835d7c2d0a3ff90c94f2f5d66b3c
rohitrango/Reward-bias-in-GAIL
/src/imitation/policies/serialize.py
UTF-8
5,558
2.5625
3
[ "MIT" ]
permissive
"""Load serialized policies of different types.""" import contextlib import os import pickle from typing import Callable, ContextManager, Iterator, Optional, Type from stable_baselines.common.base_class import BaseRLModel from stable_baselines.common.policies import BasePolicy from stable_baselines.common.vec_env imp...
true
c271b29cfe659728e3d8cfc9c39218c2b7861209
btg1998/Information-Systems
/Eigen Values and Eigen Vectors.py
UTF-8
587
3.34375
3
[]
no_license
# -*- coding: utf-8 -*- """ Created on Wed Aug 23 19:22:15 2017 @author: bharg """ import scipy from scipy import linalg import numpy as np a=np.array([[1,8,-9,7,5], [0,1,0,4,4], [0,0,1,2,5], [0,0,0,1,-5], [0,0,0,0,1]]) print("Determinant: ") print(scipy.li...
true
bfee54297e30f905b68062ce218f00c0cc9e74aa
dotrungkien/face_recognition
/predict.py
UTF-8
2,269
2.671875
3
[ "MIT" ]
permissive
# -*- coding: utf-8 -*- import sys from datetime import datetime import math import time import numpy as np import tensorflow as tf import cifar10 FLAGS = tf.app.flags.FLAGS tf.app.flags.DEFINE_string("checkpoint_dir", "tmp/cifar10_train", """Directory where to read model checkpoints."""...
true
478b8cede5f5253521baad797a196647697edede
rdilip/Project-Euler
/problem2v2.py
UTF-8
317
3.484375
3
[]
no_license
import time def fib_sum(n): fib = [1,2] n1,n2 = 1,2 while n2<n: fib.append(n1+n2) n1,n2 = n2,n1+n2 return sum(fib[1::3]) start = time.time() for i in range(1000000):fibsum = fib_sum(4000000) elapsed = (time.time() - start) print "result %s returned after %s seconds (1 million iterations)" % (fibsum,elapsed)
true
032b8796f04caf87ed0c63625b950e773d120d94
UCLA-LACC-2018/Graph-Theory-and-Social-Network
/CycleGen_E.py
UTF-8
890
3.640625
4
[]
no_license
#Extra Exercise for detecting cycles in a graph containing multiple components #Input: adj. matrix def detect_cycle_gen(mat): conncomp=[] cycle=[] ############################# #Add your codes here #You should compute the values of two variables #Suppose the graph contains k connected components G1,...,Gk #connc...
true
e93fc60921fb06ac67f25ae3d8ef387474a253e8
bionanofluidics/cell_image_machine_learning
/DATA_generating/cell.py
UTF-8
7,067
2.953125
3
[]
no_license
# Daniel Karkhut # represents cell object import math import scipy.signal import statistics import cv2 import os import numpy as np from matplotlib import pyplot as plt from detectors import Detectors from tracker import Tracker from input import Input class Cell: def __init__(self, id, directory): self...
true
17699985509aeb0ac45698d8d1bf696674522239
vasily-esipenko/Kata
/Python/7kyu/initials.py
UTF-8
793
4
4
[]
no_license
# 7 kyu kata # C.Wars # Link: https://www.codewars.com/kata/55968ab32cf633c3f8000008 # Description: # Normally we have firstname, middle and the last name but there may be more than one word in a name like a South Indian one. # Similar to those kinda names we need to initialize the names. # See the pattern below: # i...
true
5a014ce74c93ca2fb05b4f7bb7a4b44eb6bc86d6
manuelsanchez9/ComputerVision
/paraParcial2/funciones.py
UTF-8
5,468
2.953125
3
[]
no_license
# -*- coding: utf-8 -*- """ Created on Tue Aug 28 16:39:39 2018 @author: Manuel Andres Sanchez Muñoz Funciones """ import numpy as np import scipy.signal as sg import math def my_gamma(image,gamma): Im_ga = np.double(image) Im2 = Im_ga**gamma #gamma image Im2 = np.uint8(255*Im2/Im2.max()) return Im2...
true
c2ffe63f9c391d7f692e938eb0da7d7dbbf68e13
py-ay/py-ay
/weekly_report_jy.py
UTF-8
1,096
2.75
3
[]
no_license
#-*- encoding:utf-8-*- import sys import datetime import re if len(sys.argv) == 3: original_file = sys.argv[1] # 주간보고 텍스트 파일 pattern_file = sys.argv[2] # 주간보고 변환 규칙 파일 elif len(sys.argv) == 2: original_file = sys.argv[1] pattern_file = "pattern.txt" else: original_file = str(datetime.date.today()) + ".txt" # 없으면...
true
d0b2783df4a0ffb5f088f7074a2ac2debdeb2a8e
hejusl/My_Learn
/pythonbase/03_循环/hm_11_九九乘法表.py
UTF-8
415
3.390625
3
[]
no_license
# !/usr/local/Cellar/python3/3.6.3/bin # coding=utf-8 # 在控制台连续输出5行 * ,每一行星号数量依次递增 # * # ** # *** # **** # ***** # 1、 完成 5 行内容的简单输出 # 2、 分析每行内部的 * 应该如何处理 row = 1 while row <= 9: col = 1 while col <= row: print('%d x %d = %d' % (col, row, row * col), end='\t') col += 1 print('') row += ...
true
bb04c53f6d4126d7805c93090594b4499ea1be74
rendg80/sharat-cbcl
/cf/word-to-num.py
UTF-8
799
3
3
[]
no_license
INPUT_FILE="tags-cleaned.txt" NUM_FILE="numeric-tags.txt" MAP_FILE="tag-map.txt" tags=dict() cmap=dict() #get unique words for line in open(INPUT_FILE).readlines(): words=line[:-1].split(",") cmap[words[0]]=0 for w in words[1:]: tags[w]=0 #assign numbers to tags count=1 for k in tags: tags[k]=count count=count...
true
9c8d0c4f912181994ce7cebe54facd12b03ea73a
davidcortesortuno/finmag
/src/finmag/normal_modes/eigenmodes/eigensolvers_test.py
UTF-8
13,348
2.78125
3
[ "BSD-3-Clause", "BSL-1.0" ]
permissive
from __future__ import division import pytest import numpy as np import itertools from eigensolvers import * from eigenproblems import * from helpers import normalise_rows np.set_printoptions(precision=3) # NOTE: Don't change this list without adapting the "known_failures" below! sample_eigensolvers = [ ScipyLina...
true
4b37cb0282323523b7c419fc0b87f55944a76ff7
sjf546339672/demo
/secondstage/tests/fixture内置参数.py
UTF-8
5,566
2.875
3
[]
no_license
# coding:utf-8 ''' cache Return a cache object that can persist state between testing sessions. cache.get(key, default) cache.set(key, value) Keys must be a ``/`` separated value, where the first part is usually the name of your plugin or application to avoid clashes with other cache user...
true
b49523b683247ee296f87eccf7c98169ba6f890c
lequangit99/PyCode
/b5_3.py
UTF-8
514
3.15625
3
[]
no_license
from collections import Counter import matplotlib.pyplot as plt if __name__ == "__main__": f = open("news.txt", "r") fileData = f.read() count={} s = fileData.lower() chars = "abcdefghijklmnopqrstuvwxyz" c = Counter(s) cotX = [] cotY = [] sort_orders = sorted(c.items(), key=lambda x...
true
f1f1932a671eccb0e9c0f5e1ccab02ee7565a3c0
crazywook/start-python
/day4/while.py
UTF-8
153
3.8125
4
[]
no_license
prompt = """ 1.Add 2.Del 4.Quit Enter number: """ number = 0 while number != 4: print(prompt) number = int(input()) print('choice', number)
true
fccd228d28654654130dc703967336e3040b9b8e
shashbhat/Internship_Data_Analytics
/Day 10/5.py
UTF-8
91
2.5625
3
[]
no_license
import re data = "192.168.2.1" res = re.findall(r"\d{3}.\d{3}.\d+.\d+", data) print(res)
true
efe3cb7c785bf7dda17097bd454fe7a532543014
guadalupeaceves-lpsr/class-samples
/o.py
UTF-8
2,338
4.21875
4
[]
no_license
# This will most likely allow the user to type in something that can be recorded. import sys # This will print, "Welcome to PumaPix!" print("Welcome to PumaPix!") # This will print, "Enter your 5 favorite shows." print("Enter your 5 favorite shows.") # This is assigning values to variables. # x is assigned to the valu...
true
d85764f697d3cd7a713388770bd40d0fa1f09c71
tvanderplas/goblin-care
/game/overworld.py
UTF-8
3,936
2.640625
3
[]
no_license
import pygame as pg from pygame.constants import ( # pylint: disable=no-name-in-module MOUSEBUTTONDOWN, KEYDOWN, QUIT, K_ESCAPE, K_SPACE, K_TAB, K_UP, K_DOWN, K_LEFT, K_RIGHT, K_w, K_a, K_s, K_d ) from OpenGL.GL import glClear, glEnable, GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_DEPTH_TEST from game import ui from...
true
7a6fa56eb9027b3eb211b44c49a0051e0c708676
shg9411/algo
/algo_py/boj/bj1157.py
UTF-8
267
2.9375
3
[]
no_license
s = input().upper() x = list(set(s)) d = dict() for i in range(len(x)): d[x[i]] = s.count(x[i]) mx = max(d.values()) many = [] for key in d.keys(): if mx == d.get(key): many.append(key) if len(many)>1: print('?') else: print(many[0])
true
31f5f5e97c8514e9884a99594d8e9fc9da725a0a
ldj5123/Linux
/PYTHON/chapter5/chap5_lab2_rectangle.py
UTF-8
891
3.546875
4
[]
no_license
def rectangleCheck(rect): if rect[0][0] < rect[2][0] < rect[1][0] or rect[0][0] < rect[3][0] < rect[1][0]: print('두개의 사각형이 겹침!') elif rect[0][1] < rect[2][1] < rect[1][1] or rect[0][1] < rect[3][1] < rect[1][1]: print('두개의 사각형이 겹침!') else: print('두개의 사각형 안겹침!') rect = [[0,0]...
true
b5f65bb47059ce734562c1a66652c24919b6b61a
lindseyanderson/ChallengeMODE
/challenge8.py
UTF-8
2,345
2.984375
3
[]
no_license
#!/usr/bin/python """ Challenge 8: Write a script that will create a static webpage served out of Cloud Files. The script must create a new container, cdn enable it, enable it to serve an index file, create an index file object, upload the object to the container, and create a CNAME record pointing to the CDN URL of th...
true
a7a481adce2e3b2244f2029757dffa6b762af6a6
sarmistha1619/Convert-in-grayscale-of-video
/b_vdgrayscale_chnging.py
UTF-8
1,084
2.65625
3
[]
no_license
import numpy as np import cv2 capture = cv2.VideoCapture('VideoFromCamera.mp4') def nothing(x): pass cv2.namedWindow('sketch') cv2.createTrackbar('a', 'sketch', 0, 10, nothing) cv2.createTrackbar('b', 'sketch', 50, 100, nothing) cv2.createTrackbar('c', 'sketch', 0, 300, nothing) cv2.createTrackbar('d', '...
true
990784c1d7448b03359b7b68ded9a445a67ade0f
Wyq-wyx/Machine-Learning
/machineLearning_in_action/AdaBoost/AdaBoost.py
UTF-8
6,922
3.078125
3
[]
no_license
#!/usr/bin/env python # -*- coding:UTF-8 -*- from numpy import * def loadSimpData(): dataMat = matrix([[1., 2.1], [1.5, 1.6], [1.3, 1.], [1., 1.], [2., 1.]]) classLabels = [1.0, 1.0, -1.0, -1.0, 1.0] return dataMat,classLabels # datMat, classLabel = loadSimpData() #通过阈值比较对数据进行分类 def stumpClassify(dataMat...
true
7d91b455d74745e708062a92847257c3c86def32
roussel-ryan/Accelerator_MOBO
/bo.py
UTF-8
4,959
2.796875
3
[]
no_license
#base BayesianOptimizer class import numpy as np import pandas as pd import logging import time import pickle import tensorflow as tf import gpflow from . import utilities class BayesianOptimizer: """Bayesian optimizer class This class serves as the base class for single and multiple objective bayesian ...
true
e6202fb887710e7f10847e2d243b5a08c79797bb
BabakAbdzadeh/Python-Class-Spring2019
/ClassWorks/Class work - zip function.py
UTF-8
263
3.546875
4
[]
no_license
from typing import Tuple def zip_(a, b): i = 0 zipped = [] while i != len(a): zipped: object first_input = (a[i], b[i]) zipped.append(first_input) i += 1 return zipped print(zip_([1, 2, 3, 4], [5, 6, 7, 8]))
true
048b0a0b741948ea130f592a511d7d07c74568c6
Ramiiyan/password_manager
/password_manager_flask/Service/deepHashService.py
UTF-8
1,890
2.796875
3
[]
no_license
from cryptography.exceptions import InvalidSignature from cryptography.fernet import Fernet, InvalidToken def deep_hash_auth_init(h1, m_key, salt1): mkey_s1_h1 = h1.encode(m_key, salt1) print(mkey_s1_h1) auth1 = h1.decode(mkey_s1_h1)['hash'] # 1st encoded hash print(f'auth1 ={auth1}') mkey_auth...
true
6c1af79866f6e74500b78fbc1bae00e005ed66dc
ghydric/05-Python-Programming
/Class_Practice_Exercises/Lists/List_Functions_Review/append_list.py
UTF-8
673
5.03125
5
[]
no_license
## Append to list # This function demonstrates how the append method # can be usesd to add items to a list def main(): # initialize empty list name_list = [] # create a variable to control our loop again = 'y' # add some names to the list while again == 'y': # get a name from the user...
true
b00b5efeeed627ec36b58a1468c35fb828a5946a
AkshayManchanda/Machine_Learning_with_Python_Training
/day2/fibonacci_series.py
UTF-8
170
3.515625
4
[ "MIT" ]
permissive
a=0 b=1 n=input("enter the number of terms: ") n=int(n) print(a," ",end='') print(b," ",end='') for i in range(n-2): c=a+b a=b b=c print(b," ",end='')
true
977c929ca3f9c8f1087ef94877be503aec77c123
ladysilverberg/GGJ21-Zoom
/game_server.py
UTF-8
1,878
2.75
3
[]
no_license
#!/usr/bin/env python3 import socket import select import json from lobby import Lobby HOST = '158.39.200.234' MGMT_PORT = 1337 MAX_LOBBIES = 25 LOBBY_CONNECTING = 1 LOBBY_READY = 2 LOBBY_RUNNING = 3 LOBBY_CLOSED = 4 # Set Up Management Socket lobby_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) lobby_...
true
72f8c3c7072f66b86dc131b0aee2d5391ae63b27
wolf019/DD1318-Programming-techniques-and-technical-calculations
/v2.0_FINAL/stock_pick.py
UTF-8
16,715
3.5
4
[]
no_license
import csv import os import datetime import FundamentalAnalysis as fa import yfinance as yf from pandas_datareader import data as pdr # # stock_pick.py v.2 # DD 1318 @ KTH # For P-assignment 2020 # # The program needs two folders in the same file as where the program exists. # One folder named data_files_in ...
true
30a28508007e77bcc8ba703065199da0903cfa4b
tizbac/Pytasserver
/cmds/mybattlestatus.1.py
UTF-8
1,640
2.96875
3
[]
no_license
# -*- coding: utf-8 -*- ####MYBATTLESTATUS battlestatus myteamcolor ###Description ##Sent by a client to the server telling him his status in the battle changed. ##battlestatus: An integer but with limited range: 0..2147483647 (use signed int and consider only positive values and zero). Number is sent as text. Each bi...
true
1834fdb966d212a14c88ab0ccd46d401d8d16093
shutterberg/css-beautifer
/v 1.0/commandlinereader.py
UTF-8
240
2.859375
3
[]
no_license
import sys def iscss(checkbfile): ext=checkbfile.split('.') ext=ext[-1].lower() if(ext=="css"): return True else: return False bfile=str(sys.argv[1]) if(iscss(bfile)): print("Opening "+bfile)
true
a787ce5e38c8240205cd3feb2cf0391508339efb
domgoodwin/DivisibilityTestPrograms
/div_4.py
UTF-8
224
3.71875
4
[]
no_license
import sys number=0 if(len(sys.argv) < 2): number=input("Choose a number: ") else: number = sys.argv[1] if (int(number) % 4 == 0): print("This is divisible by 4!") else: print("This is not divisible by 4.")
true
8edd8af442f0c046952d4b97c6b957678afab1b0
dr-dos-ok/Code_Jam_Webscraper
/solutions_python/Problem_200/3016.py
UTF-8
440
3.03125
3
[]
no_license
t = input() tc = 1 while t: t -= 1 n = input() a = map(int, list(str(n))) n = len(a) done = 1 i = 0 while i+1 < n and done: if a[i] > a[i+1]: a[i] -= 1 done = 0 mark = i while i - 1 >= 0: if a[i-1] > a[i]: a[i-1] -= 1 mark = i - 1 else: break i -= 1 i += 1 if not done:...
true
da144f11e889854deff291a6a588fdf5ddac8db5
JulienDoerner/GitPlayground
/UsefullPythonScripts/Massdistributions/Importierbar/Cordes.py
UTF-8
258
2.65625
3
[ "MIT" ]
permissive
import numpy as np #Konstanten ne1 = 0.025 ne2 = 0.2 H1 = 1.0 H2 = 0.15 A1 = 20 A2 = 2 R2 = 4. def n_HII(R,z): R=abs(R) P1 = ne1 * np.exp(-abs(z)/H1)*np.exp(-(R/A1)**2) P2 = ne2 * np.exp(-abs(z)/H2)*np.exp(-((R-R2)/A2)**2) return P1+P2
true
c5d65090efa03351ee79411e8409a1e8e1d12585
valentinPertierra/DSP_UTN
/TP4/TP4_E6.py
UTF-8
8,274
2.65625
3
[]
no_license
# -*- coding: utf-8 -*- """ Created on Wed Dec 5 14:56:03 2018 @author: Valentin """ import numpy as np from pandas import DataFrame from IPython.display import HTML from scipy import signal as sig import scipy.io as sio from scipy.fftpack import fft from funciones import * from time import time f...
true
520c089f1c488b400b1b3a9a022942650c2df4d5
peterkabai/python
/snippets/whitney_permits.py
UTF-8
4,391
2.8125
3
[]
no_license
import calendar import os import set_environ import re import sys import time import send_email as gmail from datetime import datetime from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.keys import Keys def get_element(browser, name, elem_type="id", inde...
true
5ca6bbe91f1570b0cfddf95a5b4fa56e6a3f2bcd
kjh03160/Algorithm_Basic
/practice/Priority_Queue/Nth_largest_2075.py
UTF-8
407
3
3
[]
no_license
# https://www.acmicpc.net/problem/2075 import heapq import sys input = sys.stdin.readline n = int(input()) q = [] for _ in range(n): x = list(map(int, input().split())) for k in range(len(x)): if not len(q): heapq.heappush(q, x[k]) if x[k] > q[0]: if len(q) >= n: ...
true
114350fe85e08bfe368d3b0eeeada7570e62f863
Jruing/Python-Spider
/qq轰炸机.py
UTF-8
4,053
2.859375
3
[]
no_license
# encoding:utf-8 import win32gui import win32con import win32clipboard as w import time import random import linecache,os def getText(): """获取剪贴板文本""" w.OpenClipboard() d = w.GetClipboardData(win32con.CF_UNICODETEXT) w.CloseClipboard() return d def setText(aString): """设置剪贴板文本""" w.OpenClip...
true
f4a583b1ffbddb9a9fe687ebbdbd449515e8fcfb
Sicilat/random-codes
/main.py
UTF-8
480
2.90625
3
[ "MIT" ]
permissive
import os import doors def clear(): os.system('clear||cls') def menu(codes_list): clear() i = 0 for p in codes_list: i += 1 print(str(i) + ' - ' + p) c_id = int(input('> ')) while c_id <= 0 or c_id >= len(codes_list) + 1: print('Wrong input !') c_id = int(input('> ')) print('') launch_code(c_id) def ...
true
a5738b422d3e3ee1fb19020b6eafb383266a0f60
kerokero0507/PdfOcrReader
/PdfOcrReader/main.py
UTF-8
2,867
2.546875
3
[]
no_license
import pdf2image import OcrModules.OcrReader as Reader, FolderControl import PdfToImage.ImageConverter as Converter import csv import json import os import time from watchdog.events import FileSystemEventHandler from watchdog.observers.polling import PollingObserver def getext(filename): return os.path.splitext(...
true
6c2f8fe030dc29c96b23428865b87ea0e9830751
ThyagoFRTS/power-eletric
/power_sizing.py
UTF-8
1,591
3.40625
3
[ "MIT" ]
permissive
import math def calculate_power_luminance(ambient_area): #area in m^2 potency = 0 if ambient_area <= 6: print('Lighting Potency: '+ str(100) +' (VA)') potency = 100 else: print('extra potency: ' + str((ambient_area - 6))) potency = 100 + 60 * int((ambient_area - 6)/4) print('Lighting Poten...
true
6e50212c20e8fd6b44d2e3cb49d535755299b14d
21jun/steam-data-collector-v2
/src/crawler/SteamAppParser.py
UTF-8
9,016
2.75
3
[]
no_license
from selenium import webdriver from bs4 import BeautifulSoup from src.utills.dateFormatter import get_full_date from src.utills.MonthConverter import month_converter import logging as log import pymysql import time class SP_DataBaseConnector: def __init__(self): connect = pymysql.connect(host='localhost'...
true
d51f8a20c48c727d6780039893936516f7f1b717
chancejiang/tiddlyweb
/test/test_serialize_bag.py
UTF-8
3,427
2.65625
3
[ "BSD-3-Clause" ]
permissive
""" Test turning a bag into other forms. """ import simplejson from tiddlyweb.serializer import Serializer from tiddlyweb.model.bag import Bag from tiddlyweb.config import config from fixtures import bagfour, tiddler_collection, reset_textstore def setup_module(module): reset_textstore() module.serializer...
true
dbf23a5463edb81bda94ed7d96f40a1a304ebacc
fernandoferreiratbe/gpsweek-converter
/gpsweekconverter/converter.py
UTF-8
641
3.5625
4
[]
no_license
# _*_ encoding: utf-8 _*_ class Converter: # noinspection PyMethodMayBeStatic def convert_julian_date_to_gps_week(self, julian_date: float): gps_week = ((julian_date - 2444245) // 7) return int(gps_week) # noinspection PyMethodMayBeStatic def convert_gps_week_to_julian_date(self, gp...
true
7f015b74bebc8085d212a5d997bf6251cc130082
daniellujanv/HandRecognition_prototypes
/HandGestureRecognition_prototypes/HandRecognition.py
UTF-8
19,842
2.75
3
[]
no_license
import cv2 import numpy as np import os from Tools import RegionProps import Tools as tools global regionProps regionProps = RegionProps() ''' - image in YCrCb - restrict channels - biggest contour as hand 77 < Cb < 127 133 < Cr < 173 ''' def approach1(img): #print img.shape #Y, Cb, Cr = cv2.split(img) #p...
true
efc069d7339c027126b0a8bd3adf4a9c8ffbabf1
NianZheChao/Coding_Practice
/Code/searchEngine/ex04_shingle.py
UTF-8
1,634
3
3
[]
no_license
import os import tkinter as tk from tkinter import filedialog def getShingle(s, k): dic = dict() for i in range(0, len(s) - k + 1): s1 = s[i:i + k] # 拆分词 j = dic.get(s1) if j: dic[s1] += 1 else: dic[s1] = 1 # print(dic) return dic def getSimil...
true
8e3294cdd7c83d34bd1740c1b6971169b86b7f82
kumararun2002/Dragons-and-Terminators-Game-Python-
/dragons/characters/dragons/thrower_dragon.py
UTF-8
2,328
3.421875
3
[]
no_license
from .dragon import Dragon from utils import random_or_none class ThrowerDragon(Dragon): """ThrowerDragon throws a stone each turn at the nearest Terminator in its range.""" name = 'Thrower' implemented = True damage = 1 # ADD/OVERRIDE CLASS ATTRIBUTES HERE food_cost=3 armor=1 min_ra...
true
2cdafafc247fef51eb9fc2f914f4f82ba8060191
acRnR/homeworks2015-16
/Simonyan_152_V3_Dz10.py
UTF-8
589
3.046875
3
[]
no_license
# Ася Симонян, БКЛ-152-итал, Вариант 3 import re def add_to_file(result): f = open('В_ПредложномПадеже.txt', 'a', encoding = 'UTF-8') f.write(result) f.close() def reads_file(): f = open('rur.txt', 'r', encoding = 'UTF-8') string = f.read() f.close() return string def find_collocation(st...
true
1e4dc7df8d84bb1b71761bfc9871b1e0f634ad95
alexguillamon/flask_project_starter
/src/database/models.py
UTF-8
435
2.5625
3
[]
no_license
from database import db class BaseModel(db.Model): """ This abstract class implements common methods that you would see in a SQL alchemy model. """ __abstract__ = True def insert(self): db.session.add(self) db.session.commit() def update(self): db.session.commit() ...
true
3d2cb48b00914b9da9510b5aa1c1dbfe8e185162
astrojhgu/rt1d
/tests/test_physics_secondary_ionization.py
UTF-8
979
2.515625
3
[ "MIT", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
""" test_physics_secondary_ionization.py Author: Jordan Mirocha Affiliation: University of Colorado at Boulder Created on: Wed Dec 26 18:37:48 2012 Description: Compare results of RT06 #2 using 4 different methods of secondary ionization/heating. """ import rt1d import matplotlib.pyplot as pl cm_per_kpc = rt1d.p...
true
4f201ed56c832ff3f7b9c9f5fb9311a0da06a63d
benmechen/Pacman
/PATMAN_CNN/main.py
UTF-8
1,598
2.78125
3
[]
no_license
# -*- coding: utf-8 -*- # @Author: Ben # @Date: 2017-09-09 21:31:42 # @Last Modified by: Ben # @Last Modified time: 2017-09-11 20:41:12 import numpy as np from tools.COLLECT_DATA import CollectData from tools.TRAIN_MODEL import TrainModel from tools.TEST_MODEL import TestModel WINDOW_SIZE = (420, 420) WIDTH = 80 ...
true
212ffc13c01068805410a8ec6b6675c5bded59f4
saurabhdhupar/streaming-algorithms
/tests/approx_counting/morris_extension_one_test.py
UTF-8
434
3.15625
3
[]
no_license
import unittest from approx_counting.morris_extension_one import MorrisPlusAlgorithm class MorrisPlusAlgorithmTest(unittest.TestCase): def test_morris_algorithm(self): count_approx = MorrisPlusAlgorithm(5) for i in range(1000000): count_approx.increment() if i % 1000 == 0...
true
dd812623fdf97d3df0676254df535ec0c30ed3ed
REFunction/Japanese-Song-Romaji
/utils.py
UTF-8
1,626
3.671875
4
[]
no_license
def is_alpha(c): alphabet = 'abcdefghijklmnopqrstuvwxyz' return c in alphabet def has_space_char(romaji): for i in range(len(romaji) - 1): if romaji[i] == ' ' and not is_alpha(romaji[i + 1]): return True return False def separate_a_romaji(romaji): result = '' ...
true
f916fdce62828996538baf2e6483043445a35b2a
Susmita-Karmakar/HKR_ProblemSolving
/Day1.py
UTF-8
144
3.03125
3
[]
no_license
i = 4 d = 4.0 s = "HackerRank " c = "" a = int(input()) b = float(input()) c = input() print(i + a) print(b + d) print(s + c)
true
57becc9c9834562278156c375809df675684801f
wozy7/oirds
/gen_file_patches.py
UTF-8
8,414
2.6875
3
[]
no_license
#!/usr/bin/env python # Get an OIRDS data subset with single-object images. # Create the train.txt, val.txt and label.txt files. import glob import itertools import os import pandas as pd import random import sys import img_tools from PIL import Image import numpy import shapely.geometry imagePathColName = 'Image Path...
true
dcedf1143fa472438b42f690c7d81d095d68e61d
Lilili821/Leetcode
/173_Binary Search Tree Iterator.py
UTF-8
1,132
4.09375
4
[]
no_license
# 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 BSTIterator: # Use a stack to store nodes; if it is not empty, then it has Next # Initialize: get all left nodes...
true
91d3bcfc227daefe1a9a29e52970a6e165d91b2f
winterburn/aoc_2016
/day4/day4.py
UTF-8
2,190
3.65625
4
[]
no_license
from collections import defaultdict import re def letter_count(words): """Count the letters in the room name""" count = defaultdict(int) for word in words: letters = list(word) for letter in letters: count[letter] += 1 return sorted(sorted(count.items(), key=lambda x: x[0])...
true
f4957ad85ce3bc42815dd1c7b90c7ad4b759f4a6
JerryJack121/House_price_regression
/stacking/XGB.py
UTF-8
1,896
2.6875
3
[ "MIT" ]
permissive
import xgboost as xgb from xgboost import XGBRegressor import pandas as pd from sklearn.metrics import r2_score, mean_squared_error, mean_absolute_error from preprocessing import preprocessing as pre # 讀取預處理資料 train_val, train_x, val_x, test_x, train_y, val_y, ss_x, ss_y = pre() # 將資料轉換為xgb格式 trn_data = xgb.DMatrix(t...
true
5a0ba8ae23a57b6439f93f66c21a75b64d93c8c5
buddly27/stylish
/source/stylish/transform.py
UTF-8
8,558
3.46875
3
[]
no_license
# :coding: utf-8 """The image transformation network is a deep residual convolutional neural network parameterized by weights. The network body consists of five residual blocks. All non-residual convolutional layers are followed by an instance normalization and ReLU non-linearities with the exception of the output la...
true
49d1d3cb8ba0996f53c3419957f29029528fa241
avborup/Kat
/commands/read.py
UTF-8
1,191
2.515625
3
[]
no_license
import requests from helpers.auth import login from helpers.config import getConfig from bs4 import BeautifulSoup from commands.web import webCommand from helpers.webutils import checkProblemExistence def readCommand(arg, options): session = requests.Session() config = getConfig() problemName = arg pr...
true
abcd00cb4062808f0f97355c9d05a1ceaf040ab6
allamberto/cse-30872-fa18-assignments
/challenge21/program.py
UTF-8
764
3.921875
4
[]
no_license
#!/usr/bin/env python3 # Citation: Class Example import sys # Functions def sieve(n): primes = set(range(2, n + 1)) for i in range(2, n + 1): for m in range(i*2, n + 1, i): try: primes.remove(m) except KeyError: pass return primes def findC...
true
04d84821299cb1f77e9a0071c345dab8ec86ec0f
kpj/clypper
/clypper/clypper.py
UTF-8
2,136
2.671875
3
[ "MIT" ]
permissive
"""Main module.""" import datetime from pytimeparse.timeparse import timeparse from moviepy.editor import concatenate_videoclips, TextClip, CompositeVideoClip from tqdm import tqdm from .video_sources import auto_video_source def get_duration(string): """Convert time string to proper object.""" secs = tim...
true
3ca9dd96fadedaa2856152ddcbb8eaea016ba2e3
dt99jay/League-Tables
/Complete University Guide/Subjects/cug_subjects.py
UTF-8
3,306
3.203125
3
[ "MIT" ]
permissive
import urllib import requests import pandas as pd from bs4 import BeautifulSoup def get_cols(table): header = table.find_all("th") cols = [] for column in header: try: col = column.find("a").get_text() except AttributeError: col = column.get_text() cols.ap...
true
44a75ae41d46985983db72ba9e6a999d9ccc49e2
afwu/M7-04
/m7-04.py
UTF-8
764
2.546875
3
[]
no_license
# coding=utf-8 import os from lib.banner import show_banner from lib.input_parser import input_parse from flash_xss_scanner import FlashXSSScanner from flash_csrf_scanner import FlashCSRFScanner def main(): show_banner() params = input_parse() # 识别扫描类型,根据输入选择进行Flash XSS或Flash CSRF扫描 if params.type.l...
true
4e13b23410e8d5da45092fb165977c2c6b95db0b
al3Co/ANN-Design
/scripts/usrInput.py
UTF-8
1,309
2.671875
3
[]
no_license
# -*- coding: utf-8 -*- """ Created on Thu May 10 16:05:10 2018 @author: Aldo Contreras """ import pandas as pd from scripts import dataBaseClass def kindOfDataFnc(): while True: try: prompt = ('[0]All [1]COMBO [2]CRUZEXT [3]CRUZINT [4]ELEFRONT [5]LATERAL [6]ROTZ \nTest: ') kindOf...
true
00e7647ffe2e499821e926409d46f3b06e11e1b6
santhoshchn/PyEuler
/problem11.py
UTF-8
923
3.28125
3
[]
no_license
from itertools import product f = open('numbergrid.txt', 'r') nList = f.read().rstrip().split('\n') for (n,list) in enumerate(nList): nList[n]=map(int, list.split(' ')) print nList max = 0 ## Horitzontal iterator for i, j in product(xrange(20), xrange(17)): prod = nList[i][j] * nList[i][j+1] * nList[i][j+2] ...
true
3df6b5fcc6df1ea154bd2b074d738fb52a8ff486
gh0jhs/TIL
/0812/1979_어디에단어가들어갈수있을까/1979_어디에단어가들어갈수있을까.py
UTF-8
977
2.859375
3
[]
no_license
import sys sys.stdin = open('input.txt') # tc = int(input()) result = [] for _ in range(tc): val = 0 arr = [] n, k = map(int, input().split()) for _ in range(n): arr.append(list(map(int, input().split()))) for i in range(n): cnt = 0 for j in range(n): if arr[i][j]...
true
a1fdd68a080a1000751629bb99d44062ede81a12
aliameen786/Ai-Chatbot
/training.py
UTF-8
2,447
2.6875
3
[]
no_license
import random import json import pickle import numpy as np import os import nltk from nltk.stem import WordNetLemmatizer import tensorflow as tf from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, Activation, Dropout from tensorflow.keras.optimizers import SGD lem...
true
13ae1f53e42f2690692492ce77b1d970aa0a3c12
wesenu/PythonforHackers
/10_Python_Scripting/hack.py
UTF-8
2,215
3.78125
4
[]
no_license
""" Loading things from files are very useful. In Brutespray password lists are defined per protocol Brutespray examples https://github.com/x90skysn3k/brutespray/blob/master/brutespray.py#L334 """ import subprocess import os PROTOCOLS = {"postgressql": "sql", "pop3": "email"} PEOPLE_PROTOCOL = [["Stev...
true
5b7f804771a3342c27f65d80489aeff00b11cf89
shevcdim/DisasterResponseUdacity
/data/process_data.py
UTF-8
3,017
3.296875
3
[]
no_license
# -*- coding: utf-8 -*- """ Created on Thu Jul 30 17:27:24 2020 @author: shevcdim """ import sys import pandas as pd from sqlalchemy import create_engine def load_data(messages_filepath, categories_filepath): ''' Load messages and categories dataset, merge them to Pandas dataframe ''' # load messages...
true
d3d26d87cc152d2dd19356620156c6ce6bdd323c
victor-gil-sepulveda/PhD-ANMPythonHelpers
/anmichelpers/parsers/imods.py
UTF-8
1,786
3.09375
3
[ "MIT" ]
permissive
""" Created on 5/2/2015 @author: victor """ import numpy class ImodServerFilesParser(object): """ Reads eigenvalues/vectors generated from http://imods.chaconlab.org/ """ def __init__(self, params): pass @classmethod def read(cls, file_path): """ TODO: Us...
true
9f7c4589a1caab3f309447f13737282696b63d42
WonderAndMaps/CodeStorage
/kaggle/safe_driver/safe_driver_lgb.py
UTF-8
3,424
2.5625
3
[]
no_license
# -*- coding: utf-8 -*- """ Created on Wed Oct 11 16:01:31 2017 @author: dell """ import lightgbm as lgb from lightgbm.sklearn import LGBMClassifier import os import pandas as pd from sklearn import metrics import datetime from scipy.sparse import coo_matrix from tffm import TFFMClassifier import tensorflow as tf os....
true
36a8c1ad9866eaf0d904b94d29918982d2a5ef45
anaskhan28/Python-practice-codes
/Chapter 8/03_default_arguments.py
UTF-8
84
2.890625
3
[]
no_license
def greet(name = "stranger"): print("Good Day, " + name) greet("Anas") greet()
true
83c75f6158003814a0f32db82d5b982d2c5db534
masterdon/algorithms
/src/com/nastra/algorithms/inversions.py
UTF-8
2,682
4.25
4
[]
no_license
''' Counts the number of inversions in a given list by using the Mergesort algorithm. If a list is already sorted, then the number of inversions is 0. If the list is sorted in reverse order, then the number of inversions is at its maximum. The number of possible inversions can be expressed by n * (n - 1) / 2 where n ...
true
e00846fc7461c83e71653fee6e59f67133b1888f
MoodswingKS/Backend-exercises
/while/main.py
UTF-8
1,280
3.109375
3
[]
no_license
from hashlib import new from helpers import random_koala_fact __winc_id__ = 'c0dc6e00dfac46aab88296601c32669f' __human_name__ = 'while' def unique_koala_facts(num): fact = '' factList = [] while num > 0: fact = random_koala_fact() if fact not in factList: factList.append(fact) ...
true
67df01ae10cfc18f6cea406f2f965a2240a0eac7
juhansmn/artigoClienteServidor
/src/server/server.py
UTF-8
2,070
3.390625
3
[]
no_license
import socket import threading #Classe genérica de um cliente class Cliente: conexao = None endereco = None def __init__(self, conexao, endereco): self.conexao = conexao self.endereco = endereco #Localhost IP = socket.gethostbyname(socket.gethostname()) PORTA = 2350 #Bytes de mensagem TAMANHO = 64 #Tipo de ...
true
5ecb5acfee4bcafdd46e3f867464205689ad32e8
JuanSergio/DI
/EjerciciosListas/ejercicio05.py
UTF-8
1,616
4.4375
4
[]
no_license
""" Escriba un programa que permita crear dos listas de palabras y que, a continuación, elimine de la primera lista los nombres de la segunda lista. Dígame cuántas palabras tiene la lista: 5 Dígame la palabra 1: Carmen Dígame la palabra 2: Carmen Dígame la palabra 3: Alberto Dígame la palabra 4: Benito Dígame l...
true
22738b143d994130b1bbc5f7849bbf53cf58e1f8
wneto2020/Process-Automation
/AutomationFace.py
UTF-8
1,253
2.75
3
[]
no_license
from selenium import webdriver from webdriver_manager.chrome import ChromeDriverManager from selenium.webdriver.common.keys import Keys from selenium.common.exceptions import WebDriverException class AutomationFace: def __init__(self): try: self.driver = webdriver.Chrome(ChromeDrive...
true
3bef3fcd4227bba40f00f4b239a5ef8bdd373bff
josooik/linear_algebra
/선형대수 1일차/수업 자료/소스코드/6장/6.14/6.14-310.py
UTF-8
1,949
3.578125
4
[]
no_license
import numpy as np import csv # 숫자로 주어지는 y값을 길이 vector_length인 one-hot 벡터로 변환합니다. def convert_y_to_one_hot_vector(y, vector_length): y_vect = np.zeros((len(y), vector_length)) for i in range(len(y)): y_vect[i, y[i]] = 1 return y_vect # 붓꽃 품종을 딕셔너리로 정의하여 문자열로된 라벨을 숫자값 라벨로 변환하는데 사용합니다. ...
true
0b93eeb53e382df6d6ff26a79b183c92df10fe1a
Smoss/AOCode2020
/AOC_DAY_2.py
UTF-8
579
2.984375
3
[]
no_license
from collections import defaultdict input_file = open('Inputs/Input_2.txt', 'r') valid_counts = 0 valid_indexes = 0 for val in input_file: policy, pw = val.split(':') counts, target = policy.split(' ') lo, hi = counts.split('-') counts = defaultdict(int) for char in pw: counts[char] += 1 ...
true
a13a02474ccb7e371c6667b4f29407a67a7a4aa5
AdamZhouSE/pythonHomework
/Code/CodeRecords/2275/60667/259923.py
UTF-8
742
2.75
3
[]
no_license
n = int(input()) board = [] for i in range(n): board.append(list(map(int, input().split(',')))) if any(board[0][0] ^ board[i][0] ^ board[0][j] ^ board[i][j] for i in range(n) for j in range(n)): print(-1) quit() row = sum(board[0]) col = sum(board[i][0] for i in range(n)) r = sum(board[0][i] != i % 2 for i...
true
9e2c470d6fd8b0cf2c0d52ea2d5057389ab0c996
renaldyresa/Kattis
/height.py
UTF-8
449
2.859375
3
[]
no_license
def main (): for i in range(int(input())): dt = list(map(int,input().split())) k = dt.pop(0) i,j,byk = 19,19,0 while True : if j == 1 : break if i == 0 : j-=1 i = j if dt[j] < dt[i-1] : ...
true
a81fdee50777b28e669d5e5ee2f49513c7edafd5
EbukahJoseph/haddock3
/src/haddock/data/topology.py
UTF-8
478
2.734375
3
[ "Apache-2.0" ]
permissive
"""HADDOCK topologies""" from haddock.defaults import Default class Topology: @staticmethod def get_supported(): """Read the topology file and identify which data is supported""" supported = [] with open(Default.TOPOLOGY_FILE) as input_handler: for line in input_handler: ...
true
564c97b88cef50a4a154b8713178cd538585cced
paix26875/DEDprogram
/calibration/Multiple_regression_analysis/twocolor_convert.py
UTF-8
7,166
2.9375
3
[]
no_license
""" 色情報を温度配列に 温度配列 を色情報に変換する """ from PIL import Image import cv2 import numpy as np from icecream import ic import gravitypoint as gp import trimming as tr import time def convertTtoC(temp): """ 温度値をRGBのカラーマップに変換する Parameters ----------- temp : float 温度 Returns ----------- ...
true
6434d0afe6fefb1c20a1722d4dfae322b40206d4
tim-fan/office_bot
/office_bot_navigation/scripts/odom_blender.py
UTF-8
2,193
2.671875
3
[]
no_license
#!/usr/bin/env python # Problem: I want an odom message which uses the pose from cartographer (which is good) # and the velocity from the create (which is also good) # Solution: this node subs to the create odom and cartographer pose (from tf), and fuses the two in a # single output odom message import rospy from ge...
true
ef6f14ec39ac2b9dea794363717f81d14d9a4366
fakhruddinbharmal/PythonRestAPIPost
/app.py
UTF-8
1,953
2.640625
3
[]
no_license
import os import shelve # Import the framework from flask import Flask, g from flask_restful import Resource, Api, reqparse # Create an instance of Flask app = Flask(__name__) app.config["DEBUG"] = True # Create the API api = Api(app) app.config["TEMPLATES_AUTO_RELOAD"] = True def get_db(): db = getattr(g, '_dat...
true
1e9e0360b49196fc73bad0d3809c2f8552365b23
PNPiquin/Sculpture3D
/KinectOutputProcessing.py
UTF-8
3,197
3.4375
3
[]
no_license
import numpy as np import cv2 def depth_array_to_matrix(depth_arr, width=512, height=424): """Create a 2D matrix image from a 1D array :param depth_arr: 1D array :param width: depth camera width :param height: depth camera height :return: 2D matrix """ depth_matrix = np.array(...
true
e1b99191a2d3a0dcb5911678e0c874d283e417d0
niki4/leetcode_py3
/easy/876_middle_of_linked_list.py
UTF-8
3,747
4.34375
4
[ "MIT" ]
permissive
""" Given a non-empty, singly linked list with head node head, return a middle node of linked list. If there are two middle nodes, return the second middle node. Example 1: Input: [1,2,3,4,5] Output: Node 3 from this list (Serialization: [3,4,5]) The returned node has value 3. (The judge's serialization of this node...
true
d53c57911e3916a7f7165c25ebc310235be91721
Bngzifei/PythonNotes
/Python数据可视化/Python Matplotlib time、xlabel、ylabel、xticks、yticks函数:设置坐标轴.py
UTF-8
1,588
4.0625
4
[ "MIT" ]
permissive
""" 可以调用 xlable() 和 ylabel() 函数分别设置 X 轴、Y 轴的名称,也可以通过 title() 函数设置整个数据图的标题,还可以调用 xticks()、yticks() 函数分别改变 X 轴、Y 轴的刻度值(允许使用文本作为刻度值)。 例如,如下程序为数据图添加了名称,标题和坐标轴刻度值: """ import matplotlib.pyplot as plt x_data = ['2011', '2012', '2013', '2014', '2015', '2016', '2017'] # 定义2个列表分别作为两条折线的Y轴数据 y_data = [58000, 60200, 63000, 7100...
true
58480e5740359cf0a175306c6886a89c45316d73
rafaelperazzo/programacao-web
/moodledata/vpl_data/437/usersdata/348/94418/submittedfiles/funcoes1.py
UTF-8
850
3.5625
4
[]
no_license
# -*- coding: utf-8 -*- #escreva o código da função crescente aqui def crescente1(n): lista1 = [] if lista1[0] < lista1[1] < lista1[2] < lista1[3] < lista[4]: return S else: return N #escreva as demais funções def ad1(n): lista1 = [] for i in range (0,n,1): l...
true