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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
f980dfbc632b7e60f97ff731f198bf443b075311 | Python | MelHiour/pyneng | /exercises/17_serialization/task_17_1.py | UTF-8 | 4,129 | 3.375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
'''
Задание 17.1
В этом задании нужно:
* взять содержимое нескольких файлов с выводом команды sh version
* распарсить вывод команды с помощью регулярных выражений и получить информацию об устройстве
* записать полученную информацию в файл в CSV формате
Для выполнения задания нужно создать две ... | true |
01e92656dd29da492a0dfbc774b4acf61e7203dd | Python | queirozfcom/statistical-learning | /dynamic-programming/src/plot.py | UTF-8 | 615 | 3.359375 | 3 | [] | no_license |
import numpy as np
def plotv(v):
float_formatter = lambda x: " %06.3f "%x
np.set_printoptions(formatter={'float_kind':float_formatter})
v = v.reshape((5,5))
print(v)
def plotpi(pi):
copy = np.copy(pi).ravel()
moves = np.array(list(map(_index_to_move,copy)))
moves = moves.reshape((5,5))
... | true |
776ff0c5c9089c979723db4aecbd6a4936ef614a | Python | trychiOO/python_all | /learn/python_all/Demo_ut/exe/re_exe.py | UTF-8 | 590 | 2.609375 | 3 | [] | no_license | #-*- coding:utf8 -*-
import requests#导入request模块
import json
url = 'http://apis.juhe.cn/simpleWeather/query?key= 1b43db481985a3748772c8a336ecf5a2&city=北京'
# url = 'https://azero.soundai.cn/v20190530/directives'
headers = {"Connection":'keep-alive',"Host":"httpbin.org"}#值以字典的形式传入
response = requests.post(url=url,heade... | true |
72f1600638e03eaf7e8420eefa4d7b0bdcb68ff2 | Python | jsh2333/pyml | /day1_python/01_python200_src/014.py | UTF-8 | 104 | 3.296875 | 3 | [] | no_license | x = 0
while x < 10:
x = x+1
if x < 3:
continue
print(x)
if x > 7:
break
| true |
7682fa60f22d3fd0fe5c191f308a2165f7dac745 | Python | Suyash906/DataStructures | /Python3/DynamicProgramming/02_Longest_Common_Subsequence.py | UTF-8 | 1,200 | 3.25 | 3 | [] | no_license | class Solution:
def longestCommonSubsequenceDP(self, s1, s2):
l1 = len(s1)+1
l2 = len(s2)+1
dp = [[0 for _ in range(l2)] for _ in range(l1)]
for i in range(1, l1):
for j in range(1,l2):
if s1[i-1] == s2[j-1]:
dp[i][j] ... | true |
c6dd47bd8e5743f9088b1794b11ab07d8d5fdcec | Python | geetha79/pythonprograms | /dicefun.py | UTF-8 | 215 | 3.71875 | 4 | [] | no_license | #!/usr/bin/python3
import random
i=0
def myroll():
return random.randint(1,6)
while(i<=100):
n=input("press r ro roll the dice")
if(n=='r'):
r=myroll()
i=i+r
print("u got ",r)
print("new position is",i)
| true |
46cf97ebe2fe16a207569d1aa6d0685e7eae6e46 | Python | EBone/py_littools | /py_lit/cppaddf.py | UTF-8 | 395 | 2.59375 | 3 | [] | no_license |
import os
filedirs=os.listdir(os.getcwd())
for wafile in filedirs:
with open(wafile,"r") as wahfile:
contentlist=wahfile.readlines()
for x,line in enumerate(contentlist):
if "." not in line:
line=line.strip()+".0"
contentlist[x]=line.strip()+"f;\n"
with open(wafile,"w") ... | true |
894df06d09873db695c8410421ad30b053c4a678 | Python | BethanyG/pystudy | /blackjack/blackjack.py | UTF-8 | 1,534 | 4.1875 | 4 | [] | no_license | # -*- coding: utf-8 -*-
class Player:
def __init__(self, name):
self.hand = []
self.name = name
def take(self, card):
"""Take a card and place it in the hand"""
self.hand.append(card)
def show_hand(self):
"""Returns a string representing the player's hand"""
... | true |
c703d5d4c309a6d4db423068fce4f074533bb5da | Python | yuichimukai/python-procon | /algorism-practice/chapter3-3.py | UTF-8 | 298 | 3.125 | 3 | [] | no_license | #バブルソート
n = int(input())
A = list(map(int, input().split()))
cnt = 0
flg = 1
while flg:
flg = 0
for i in range(n - 1, 0, -1):
if A[i] < A[i - 1]:
A[i], A[i - 1] = A[i - 1], A[i]
cnt += 1
flg = 1
print(' '.join(map(str, A)))
print(cnt) | true |
8153036b51b833aaacb317b4693a6acebf79e450 | Python | Eric-Wonbin-Sang/CS110Manager | /2020F_hw5_submissions/rouxjake/JakeRouxP2.py | UTF-8 | 289 | 3.78125 | 4 | [] | no_license | #I pledge my honor that I have abided by the Stevens Honor System. Jake Roux
def main():
print("This program will return the sum of numbers you enter")
num=eval(input("Separated by commas, enter your numbers:"))
sum=0
for i in num:
sum+= int(i)
print(sum)
main()
| true |
c7311c287ace04d3f7dab951e5fd85bef4a577f9 | Python | FrancoGBenedetti/KingFish | /DQ-Backend/pyScripts/table_comparation.py | UTF-8 | 2,505 | 2.84375 | 3 | [] | no_license | import dash
import dash_core_components as dcc
import dash_admin_components as dac
import dash_html_components as html
import dash_bootstrap_components as dbc
import pandas as pd
import numpy as np
def reconciliation(df,df1):
# Retorna 2 DataFrames en donde se encontró diferencias
dfs_dictionary = {'DF':df,'D... | true |
8888d46889946f988eb20fc501f535f5c8b0bd90 | Python | brandonartner/algorithms-python | /mcs-tree/kruskal.py | UTF-8 | 2,178 | 3.34375 | 3 | [] | no_license | import pprint
import re
import sys
import math
def has_edge(edges,start,end):
contains_edge = 0
for edge in edges:
if edge[0] == start and edge[1] == end:
contains_edge = 1
break
return contains_edge
def display(T, n):
for i in range(n):
if i > 0:
... | true |