seq_id stringlengths 4 11 | text stringlengths 113 2.92M | repo_name stringlengths 4 125 โ | sub_path stringlengths 3 214 | file_name stringlengths 3 160 | file_ext stringclasses 18
values | file_size_in_byte int64 113 2.92M | program_lang stringclasses 1
value | lang stringclasses 93
values | doc_type stringclasses 1
value | stars int64 0 179k โ | dataset stringclasses 3
values | pt stringclasses 78
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
71271302377 | for linha in range(1, 4):
for j in range(1, 4):
print(linha, '*', j, linha * j)
# List comprehencio
quadrados_impares = [x**2 for x in range(10) if x % 2 != 0]
print(quadrados_impares)
# Em um for "normal" ficaria assim:
quadrado_x = []
for x in range(10):
if x % 2 != 0:
quadrado_x.append(x... | zeer0e1/pydev | Lรณgica de programaรงรฃo/iteracao/for_nested.py | for_nested.py | py | 629 | python | pt | code | 0 | github-code | 90 |
4016304325 | import ipaddress
from enum import Enum
from typing import Dict
from ssh.output_consumer import OutputConsumer
from ssh.ssh_command import SSHCommand
from ssh.string_util import StringUtil
from topo.node import Node
from topo.service import Service
class InterfaceState(Enum):
UNKNOWN, UP, DOWN = range(3)
class ... | FriwiDev/new_testbed | src/ssh/ip_addr_ssh_command.py | ip_addr_ssh_command.py | py | 2,926 | python | en | code | 1 | github-code | 90 |
7319489749 | import time
import requests
import pandas as pd
from prometheus_client import start_http_server, Gauge
class Binance():
def __init__(self):
self.api_url = 'https://api.binance.com'
self.prom_gauge = Gauge('price_spread_delta',
'Price spread delta value of the symbols', ['sy... | acardak/binance-api-exploration | main.py | main.py | py | 4,006 | python | en | code | 0 | github-code | 90 |
32535953178 | import os.path
from google.auth.transport.requests import Request
from google.oauth2.credentials import Credentials
from google_auth_oauthlib.flow import InstalledAppFlow
from googleapiclient.discovery import build
from googleapiclient.errors import HttpError
# If creating for first time download the OAuth Client Ids... | marklindsey11/Archiver-Belingcat | create_update_test_oauth_token.py | create_update_test_oauth_token.py | py | 2,743 | python | en | code | 0 | github-code | 90 |
13100469295 | # -*- coding: UTF-8 -*-
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
import pickle
import os
import asyncio
from collections import Counter
import time
import sqlite3
import numpy as np
import pandas as pd
from telethon import TelegramClient, errors
from telethon.tl.types import C... | gaius-gracchus/telegram_network | scripts/get_messages_round1.py | get_messages_round1.py | py | 5,636 | python | en | code | 0 | github-code | 90 |
18478016019 | n = int(input())
l = list(map(int,input().split()))
ave=sum(l)/n
for i in range(n):
l[i]=abs(l[i]-ave)
#print(l)
print(l.index(min(l)))
| Aasthaengg/IBMdataset | Python_codes/p03214/s786815703.py | s786815703.py | py | 141 | python | en | code | 0 | github-code | 90 |
10135341402 | def loggu(n):
if n == 1:
return 0
elif n == 0:
return 1
# ๋จ์๋ ๋ฐฐ์ ์ค์์น๋ฅผ ๋ก๊พธ๊บผ
def boy(sw):
for i in range(N):
if (i + 1) % sw == 0:
switchs[i] = loggu(switchs[i])
# ์ฌ์๋ ์ข์ฐ ๋์นญ ๊ฐ์ฅ ๋จผ๊ฒ ๋ก๊พธ๊บผ
def girl(sw):
q = sw - 1
idx = 0
max_idx = 0
# ์ ์์ ๊ฐ์๊ฒ ์๋ค๋ฉด ํ๋๋ง ๋ฐ๋
if... | jjin134518/TIL | algorithms/bj_1244_์ค์์น์ผ๊ณ ๋๊ธฐ2.py | bj_1244_์ค์์น์ผ๊ณ ๋๊ธฐ2.py | py | 1,358 | python | ko | code | 0 | github-code | 90 |
33032876872 |
from sys import prefix
from tkinter import E
import pandas as pd
import datetime as dt
from pylib.py_lib import bulkInsert, deleteDataToSql, excecute_query, excutionTime, insertDataToSql_Alchemy, removeColumnsIn, workDirectory, parameters, stringConnect
ROOT = workDirectory()
DST = 'ppt_Excel_test'
def read_con... | AmarelleDiArgento/UpAllExcelToSQL | settings_budget_file.py | settings_budget_file.py | py | 3,240 | python | es | code | 0 | github-code | 90 |
1250236352 | import scrapy
import re
import html
from tpdb.BaseSceneScraper import BaseSceneScraper
class siteLukesPOVSpider(BaseSceneScraper):
name = 'LukesPOV'
network = 'Lukes POV'
parent = 'Lukes POV'
start_urls = [
'https://lukespov.com/',
]
selector_map = {
'title': '//span[@class=... | SFTEAM/scrapers | scenes/siteLukesPOV.py | siteLukesPOV.py | py | 1,626 | python | en | code | null | github-code | 90 |
21847302809 | def permute(arr):
if len(arr) in [0, 1]:
return [arr]
res = []
for i in range(len(arr)):
rest_arr = arr[:i] + arr[i + 1:]
for other in permute(rest_arr):
res.append([arr[i]] + other)
return res
| DM-09/PythonCode | Baekjoon/์์ด.py | ์์ด.py | py | 249 | python | en | code | 0 | github-code | 90 |
22339145182 | from art import text2art
from bot.processors.abstcract_process.abstract_process import AbstractProcess
class HelpCommand(AbstractProcess):
def __init__(self):
super().__init__()
def process_message(self, message):
art = text2art("Bot")
help_message = '\n<b>Here you can</b>: ' \
... | Denlnnk/Denis_telebot | bot/processors/command_processors/command_help.py | command_help.py | py | 634 | python | en | code | 0 | github-code | 90 |
36891692788 | # Definition for singly-linked list.
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
def hasCycle(self, head) -> bool:
if not head or not head.next:
return False
first = head
second = head.next
while fi... | melegithubyit/competitive-programming | LinkedListCycle.py | LinkedListCycle.py | py | 505 | python | en | code | 1 | github-code | 90 |
27002881568 | from PIL import Image
import sys
import random
percent = 0.8
MAX = 255
def random_color():
return (random.randint(0,255),random.randint(0,255),random.randint(0,255))
def imageplus(a,b):
return (a+b) % MAX
if __name__ == "__main__":
image = Image.open(sys.argv[1])
width = image.size[0]
height = image.size[1]... | zhangxm99/picture_encryption | CipherPhotos.py | CipherPhotos.py | py | 1,247 | python | en | code | 0 | github-code | 90 |
20767028481 | # https://www.acmicpc.net/problem/11816
import sys
input = sys.stdin.readline
x = str(input().rstrip())
hexcode = {'a':10, 'b':11, 'c':12, 'd':13, 'e':14, 'f': 15}
res = 0
if x[0] == '0':
if x[1] == 'x':
for idx, num in enumerate(x[2:][::-1]):
if num in hexcode:
res += hexcod... | feVeRin/Algorithm | problems/11816.py | 11816.py | py | 560 | python | en | code | 0 | github-code | 90 |
3760323771 | "Estimate model curvature using the power method"
import os
import logging
from typing import Tuple
import argparse
import datetime as dt
import random
import torch
import torch.nn.functional as F
# Logging commands
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
def curvature_hessian_estimator... | Olivia-fsm/ALFA-lc | curvature_estimation.py | curvature_estimation.py | py | 5,682 | python | en | code | 1 | github-code | 90 |
18119584279 | import math
# ๆจๆบๅๅทฎใๆฑใใ
def standard_deviation():
average = sum(s) / n # ๅนณๅๅคใๆฑใใ
total_deviation = 0
for element in s:
total_deviation += (element - average)**2 # ๅๅทฎใฎๅ่จใๆฑใใ
return math.sqrt(total_deviation / n) # ๆจๆบๅๅทฎใๆฑใใ
while True:
n = int(input())
if n == 0: break
s = [int(s) ... | Aasthaengg/IBMdataset | Python_codes/p02381/s589142018.py | s589142018.py | py | 460 | python | en | code | 0 | github-code | 90 |
25044023412 | import base64
from typing import List
from fastapi import HTTPException
from geoalchemy2.shape import from_shape
from geojson import dump
from loguru import logger as log
from osm_rawdata.postgres import PostgresClient
from shapely.geometry import shape
from sqlalchemy import column, select, table
from sqlalchemy.orm ... | hotosm/fmtm | src/backend/app/tasks/tasks_crud.py | tasks_crud.py | py | 12,057 | python | en | code | 27 | github-code | 90 |
43843903560 | """
็ปๅฎไธไธชไบๅๆ ๏ผๆฃๆฅๅฎๆฏๅฆๆฏ้ๅๅฏน็งฐ็ใ
ไพๅฆ๏ผไบๅๆ [1,2,2,3,4,4,3] ๆฏๅฏน็งฐ็ใ
1
/ \
2 2
/ \ / \
3 4 4 3
ไฝๆฏไธ้ข่ฟไธช [1,2,2,null,3,null,3] ๅไธๆฏ้ๅๅฏน็งฐ็:
1
/ \
2 2
\ \
3 3
่ฏดๆ:
ๅฆๆไฝ ๅฏไปฅ่ฟ็จ้ๅฝๅ่ฟญไปฃไธค็งๆนๆณ่งฃๅณ่ฟไธช้ฎ้ข๏ผไผๅพๅ ๅใ
"""
# ่งฃ็ญ๏ผๅฉ็จ้ๅ่ฟ่ก่ฟญไปฃๅใๅฐๅทฆๅณๅญๆ ๅๅซๆพๅ
ฅไธคไธช้ๅ๏ผๅค็ฉบๅค็ญ๏ผ็ถๅๅๅฐๅทฆๅณๅญๆ ๅๅณๅทฆๅญๆ ๅๅซๆพๅ
ฅไธคไธช้ๅ
# Definition for a binary tree node.
# class Tree... | wtrnash/LeetCode | python/101ๅฏน็งฐไบๅๆ /101ๅฏน็งฐไบๅๆ .py | 101ๅฏน็งฐไบๅๆ .py | py | 1,462 | python | zh | code | 2 | github-code | 90 |
8178390535 | # File name: get_jason_size.py
# Author: Oscar A. Rangel
# Creation date: 2023-04-17
# Last modified date: 2023-04-17
# Description: A Python script that gets the JSON file.
# License: MIT
import json
file_path = 'alpaca_english_data.json'
with open(file_path, 'r') as f:
data = json.load(f)
# Determine the type... | TheStoneMX/Guanaco | get_jason_size.py | get_jason_size.py | py | 892 | python | en | code | 0 | github-code | 90 |
4423408845 | def countApplesAndOranges(s,t,a,b,apples,oranges):
'''
A function to presents you with the width of a house [s,t], and apple and orange
tree positions, a and b. The entries in apples and oranges refer to the distance
an apple and orange fall relative to their position (positive means movement to
the right, ... | jd1618/Python-Codes | Hackerrank/Problem_Solving_Easy/Count_apples_and_oranges.py | Count_apples_and_oranges.py | py | 807 | python | en | code | 1 | github-code | 90 |
12483821772 | class Node:
def __init__(self,data):
self.data=data
self.next=None
class singlelinkedlist:
def __init__(self):
self.head=None
def push(self,new_data):
new_node=Node(new_data)
new_node.next=self.head
self.head=new_node
def append(self,new_data):
new_node=Node(new_data)
if self.head is None:
self.h... | krsatyam7/niet_codetantra | Data Structures Lab using Python/7. LinkedList/singlelinkedlist.py | singlelinkedlist.py | py | 857 | python | en | code | 25 | github-code | 90 |
43952544515 | import logging
class Log():
def __init__(self,filename):
logging.basicConfig(
level=logging.INFO ,
format='%(asctime)s%(levelname)s%(message)s',
datefmt='%Y-%m-%d %H %M %S',
filename=filename,
filemode='a'
)
# './../report/log/2021... | chenlan77/CyberDataHub_UI | untils/log.py | log.py | py | 442 | python | en | code | 0 | github-code | 90 |
22967316671 | import photobooth
import pi3d
import constants
class EndScene(photobooth.Scene):
def on_create(self):
background = pi3d.ImageSprite("resources/end.jpg", shader=self.SHADER, x = 0, y = 0, z=1, w = self.display.width, h = self.display.height)
self.add_shape(background)
def on_show(self):
... | brandonzweifel/photobooth | EndScene.py | EndScene.py | py | 556 | python | en | code | 1 | github-code | 90 |
17468232900 | import random
# ะะฐะดะฐะตะผ ัะฐะดะธััั ะฒะฝัััะตะฝะฝะตะณะพ ะธ ะฒะฝะตัะฝะตะณะพ ะบััะณะพะฒ
k = 10
n = 50
# ะะพะปะธัะตััะฒะพ ะธัะฟััะฐะฝะธะน
num_trials = 10**6
# ะกัะตััะธะบ ะบะพะปะธัะตััะฒะฐ ัะฐะท, ะบะพะณะดะฐ ะฑัะปะพ ัะพะปัะบะพ ะพะดะฝะพ ะฟะพะฟะฐะดะฐะฝะธะต ะฒ ะบััะณ ัะฐะดะธััะฐ k
num_hits = 0
# ะะตะฝะตัะฐัะธั ัะปััะฐะนะฝัั
ัะพัะตะบ ะธ ะฟัะพะฒะตัะบะฐ ะฟะพะฟะฐะดะฐะฝะธั
for i in range(num_trials):
x1 = random.uniform(-n, n)
... | Ristavor/sem4_probability_model | 4.19.py | 4.19.py | py | 921 | python | ru | code | 1 | github-code | 90 |
35349289827 | from recognize import Recognizer
from ai import AI
from voice import Voice
from speech_recognition import UnknownValueError, RequestError
from commands.cmds import voca_commands
import string
class Core:
def __init__(self):
self.voice = Voice()
self.brain = AI()
self.recognizer = Recognize... | Sreyas-Sreelal/Voca | core.py | core.py | py | 1,725 | python | en | code | 1 | github-code | 90 |
35142356047 |
from rest_framework import status
from rest_framework.decorators import api_view
# from api.models import Profile
# from api.serializers import ProfileSerializer
from rest_framework.response import Response
import requests
@api_view(['GET'])
def users(request):
gameIds = []
gameList = []
api_key = "R... | kimchansong/lol-bigdata-pjt | backend/api/views/user_views.py | user_views.py | py | 2,003 | python | en | code | 0 | github-code | 90 |
30799203246 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
convert.py
Script containing functions:
- haversine(lat1, lon1, lat2, lon2, bearing=False)
- convert(lat1, lon1, lat2, lon2, out_units='km')
- rotate(pivot, point, angle)
Functions to convert lat/lon coordinates to xy-coordinates using the
haversine form... | rcjcruz/tropomi | wind_analysis/convert.py | convert.py | py | 4,587 | python | en | code | 0 | github-code | 90 |
71957153257 | """Main code for brunt http."""
from __future__ import annotations
import json
import logging
from abc import abstractmethod, abstractproperty
from datetime import datetime
from typing import Final
import requests
from aiohttp import ClientSession
from .const import COOKIE_DOMAIN, DT_FORMAT_STRING
from .utils import... | eavanvalkenburg/brunt-api | src/brunt/http.py | http.py | py | 5,580 | python | en | code | 8 | github-code | 90 |
4739639947 | # ์คํจ ์ผ์ด์ค ์กด์ฌ
array_a = [1, 2, 3, 5]
array_b = [4, 6, 7, 8]
def merge(array1: list, array2: list):
# ์ค์ฒฉ ์ํ
newArray = []
while len(array2) != 0:
outer = array2.pop(0)
while len(array1) != 0:
inner = array1.pop(0)
if outer > inner:
newArray.append(inner)... | arch-spatula/technical-interview-for-FE | academy/3st_week/03_04_merge_01.py | 03_04_merge_01.py | py | 850 | python | ko | code | 2 | github-code | 90 |
37775438491 | import streamlit as st
import requests
import json
import pickle
from models.data import Data
import re
import time
from time import sleep
import sys
URL = "https://api.quantumcat.io/openQuantum"
filename = 'openpickle.pk'
# Use the full page instead of a narrow central column
quantumcat_logo_url = "https://raw.gith... | artificial-brain/qc-apps | qc-apps/apps/openquantum/main.py | main.py | py | 5,079 | python | en | code | 2 | github-code | 90 |
18060014229 | from collections import defaultdict
H,W,N = map(int,input().split())
ab = [tuple(map(int,input().split())) for _ in range(N)]
d = defaultdict(lambda:0)
def count(a,b):
for dx1 in [-1,0,1]:
for dy1 in [-1,0,1]:
x,y = a+dx1,b+dy1
if 2<=x<H and 2<=y<W:
d[(x,y)] += 1
fo... | Aasthaengg/IBMdataset | Python_codes/p04000/s911667830.py | s911667830.py | py | 524 | python | en | code | 0 | github-code | 90 |
18463729429 | import sys
# ่จฑๅฎนใใๅๅธฐๅฆ็ใฎๅๆฐใๅคๆด
sys.setrecursionlimit(10**5+10)
def f(i, e, dp):
if dp[i] is not None:
return dp[i]
val = 0
for nxt in e[i]:
val = max(val, f(nxt, e, dp) + 1)
dp[i] = val
return dp[i]
def edu_dp_g_longest_path():
n, m = map(int, input().split())
e = [[] for _ in... | Aasthaengg/IBMdataset | Python_codes/p03166/s045509915.py | s045509915.py | py | 596 | python | en | code | 0 | github-code | 90 |
40108195727 | #!/usr/bin/python3
import requests
import os
import argparse
import subprocess
import sys
class SubdomainFuzzer():
def __init__(self, url, wordlist, rp, responseMode):
self.check_ffuf()
self.responseMode = responseMode
if self.responseMode == True:
self.response_codes = rp
... | Kyander/Dolan-Pentesting-Automation | subdomain_fuzzer.py | subdomain_fuzzer.py | py | 2,770 | python | en | code | 0 | github-code | 90 |
18454666819 | s = int(input())
def f(n):
if n%2: return 3*n+1
else: return n//2
A = {s}
for ans in range(2, 10**6+10):
if f(s) in A:
print(ans)
break
A.add(f(s))
s = f(s)
| Aasthaengg/IBMdataset | Python_codes/p03146/s845134866.py | s845134866.py | py | 195 | python | en | code | 0 | github-code | 90 |
1849684096 | def solution(user_id, banned_id):
answer = 1
ban_list = [[] for _ in range(len(banned_id))]
checked = [0]*len(user_id)
for banID, ban in enumerate(banned_id):
for userID, user in enumerate(user_id):
if len(user) != len(ban):
continue
for i in range(len(ban... | GANGESHOTTEOK/yaman-algorithm | 19_programmers_2019_kakao_winter_internship/AN/invalid_user.py | invalid_user.py | py | 572 | python | en | code | 2 | github-code | 90 |
29878316565 | import json
import rapidjson
import numpy as np
from rapidjson import Encoder as JSONEncoder
from datetime import datetime
from decimal import Decimal
from asyncdb.utils.encoders import EnumEncoder
class DefaultEncoder(JSONEncoder):
def default(self, obj):
if isinstance(obj, datetime):
return s... | phenobarbital/asyncdb | examples/test_json.py | test_json.py | py | 2,922 | python | en | code | 23 | github-code | 90 |
72869812137 | import os
import sys
import json
import subprocess
broot = os.getenv('ANDROID_BUILD_TOP')
def croot():
global broot
if (broot is None):
sys.stderr.write('setup build first\n')
sys.exit(-1)
os.chdir(broot)
def jsondecode(f):
args = 'r+'
if (not os.path.exists(f)) :
sys.std... | hmgeorge/dsa | utils.py | utils.py | py | 2,209 | python | en | code | 0 | github-code | 90 |
44147526472 | # datatime.timedelta e dateutil.relativetimedelta(calculando datas)
# Docs
# https://dateutil.readthedocs.io/en/stable/relativedelta.html
# https://docs.python.org/3/library/datetime.html#timedelta-objects
from datetime import datetime
from dateutil.relativedelta import relativedelta
fmt = '%d/%m/%Y %H:%M:%S'
data_in... | Murilo4/estudos_python | modulos_python/data_time_and_calender/timedelta_modulo.py | timedelta_modulo.py | py | 644 | python | en | code | 0 | github-code | 90 |
18118753069 | import math
a,b,C = map(int, input().split())
c = math.radians(C)
h = b * math.sin(c)
s = a * h / 2
a2 = a - b * math.cos(c)
c2 = math.sqrt(h**2 + a2**2)
l = a + b + c2
print("%f" % s)
print("%f" % l)
print("%f" % h) | Aasthaengg/IBMdataset | Python_codes/p02380/s563139177.py | s563139177.py | py | 217 | python | en | code | 0 | github-code | 90 |
17622340318 | #!/usr/bin/python3
"""
queries the Reddit API
parses the title of all hot articles
prints a sorted count of given keywords
"""
import requests
def count_words(subreddit, word_list=None, after=None, word_counts=None):
if word_counts is None:
word_counts = {}
if after is None:
after = ""
u... | Grace-ngigi/alx-system_engineering-devops | 0x16-api_advanced/100-count.py | 100-count.py | py | 1,925 | python | en | code | 0 | github-code | 90 |
27818322630 | import abc, shlex, subprocess
DEFAULT = "default"
FIREFOX = "firefox"
CHROME = "chrome"
LYNX = "lynx"
class Browser(abc.ABC):
cli_name = None
@classmethod
@abc.abstractmethod
def open_via_cli(cls, url):
raise NotImplementedError("'open_file' not implemented")
class GUIBrowser(Browser):
@c... | dgilroy/dag | src/dag/lib/browsers.py | browsers.py | py | 1,001 | python | en | code | 0 | github-code | 90 |
27956010442 | from django.urls import path
from . import views
app_name = 'users'
urlpatterns = [
path(r'register/', views.register, name='register'),
path(r'login/', views.login, name='login'),
path(r'user/(?P<pk>\d+)/profile/', views.profile, name='profile'),
path(r'user/(?P<pk>\d+)/profile/update/', views... | pink-pig-pig/login_register | mysite/users/urls.py | urls.py | py | 497 | python | en | code | 0 | github-code | 90 |
32900284235 | from typing import Tuple
from finq import FINQ, T, T2, TList
def extract_key(self: FINQ[Tuple[T, T2]]) -> Tuple[T, TList[T2]]:
value_list = []
key = None
for k, v in self:
if not key:
key = k
value_list.append(v)
return key, value_list
| FacelessLord/web-dhtml-project | server/finq_extensions.py | finq_extensions.py | py | 284 | python | en | code | 0 | github-code | 90 |
25254620826 | import json
from tkinter import *
from tkinter import messagebox
from random import choice
FONT = ("aerial", 15)
PARAGRAPH_FONT= ("aerial", 12)
MIN = 1
# SEC = MIN * 60
SECOND = 60
#========= Functions ============
def choose_paragraph():
with open("data.json") as data:
all_paragraphs = json.load(data)
... | abey-asmare/speed-test-tkinter | main.py | main.py | py | 2,582 | python | en | code | 0 | github-code | 90 |
904345390 | import yaml, requests, random, time, datetime, json, sys
from logger import Logger
from session import Session
from URL import URL
requests.packages.urllib3.disable_warnings()
WAIT_SERVER_RESPONSE_TIME = 10 # how long to wait for a server response // 10s a 30s
class InstaBot(object):
def __init__(self, config_pa... | bmpasini/instabot | src/instabot.py | instabot.py | py | 11,485 | python | en | code | 8 | github-code | 90 |
25023184058 | #!/usr/bin/env python3
import sys
from sodacomm.tools import testwrapper
digit_en = ['Zero','One','Two','Three','Four','Five','Six','Seven','Eight','Nine']
en_10_to_19 = {
10: 'Ten', 11: 'Eleven', 12: 'Twelve', 13: 'Thirteen', 14: 'Fourteen',
15: 'Fifteen', 16: 'Sixteen', 17: 'Seventeen', 18: 'Eighteen', 19: ... | missingjs/soda | works/zcy2/c9/q20.py | q20.py | py | 2,928 | python | en | code | 0 | github-code | 90 |
73430366378 | #Lambda function to print square:
y=lambda x : x**2
print(y(4),"is the square of the number")
#lambda function to find the larger of 2 numbers
y = lambda a,b : a if a>b else b
print(y(9,7),"is the greater number")
#Sorting names based on length:
names=["bob","brittany","timm","gilly"]
names.sort(key... | Biancaa-R/Lambda-list-comprehension-recursion | lambda/lamdafns.py | lamdafns.py | py | 1,576 | python | en | code | 0 | github-code | 90 |
19627560540 | from setuptools import setup
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='closingbrace_calibre_magazine_importer',
version='0.1.0',
description='A script to import digital magazines into a Calibre library',
long_description=long_description,
long_description_c... | ClosingBrace/calibre-magazine-importer | setup.py | setup.py | py | 1,151 | python | en | code | 0 | github-code | 90 |
42606207736 | import ledfont
# Cached info. Map letters to array of bit columns and width
LETTER_TO_BITCOLS = None
LETTER_TO_WIDTH = None
LETTER_HEIGHT = 8
# Get width of a word, in bit columns, including inter-letter space
def get_word_width(word):
word_width = 0
for c in word:
word_width += get_letter_width(c)
... | jhinsdale/arduino-rgb-matrix | font/font_util.py | font_util.py | py | 2,478 | python | en | code | 3 | github-code | 90 |
11043625203 | import os
import numpy as np
import pandas as pd
def read_json(path, metrics_path, branch):
try:
df = pd.read_json(os.path.join(metrics_path, path), orient="index")
df = df.reset_index()
df.rename(columns={0: branch, "index": "Metric"}, inplace=True)
return df
except: # noqa:... | ourownstory/neural_prophet | tests/metrics/compareMetrics.py | compareMetrics.py | py | 2,153 | python | en | code | 3,415 | github-code | 90 |
3485760850 | from time import sleep
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException
import csv
options = webdriver.ChromeOptions()
options.add_experimental_option('excludeSwitches', ['enable-logging'])
driver = webdriver.Chrome(executable_pat... | Prabhjeet93/Python_Projects | Basic_Projects/automation/medium_excel.py | medium_excel.py | py | 1,039 | python | en | code | 2 | github-code | 90 |
5665863281 | from pytubev3 import Pytube
import os
if __name__ == '__main__':
API_KEY = os.environ.get("YOUTUBE_DATA_API2")
pT = Pytube(API_KEY, region_code = "US", lang = "en")
vid_cat = pT.country_video_cat()
print(vid_cat) | mm-mazhar/pytubev3 | examples/video_categories.py | video_categories.py | py | 235 | python | en | code | 1 | github-code | 90 |
18245753349 | def main():
N, X, Y = map(int, input().split())
G = [[i] for i in range(1,N+1)]
ans=[0]*(N-1)
for i in range(1,N+1):
for j in range(i+1,N+1):
d = min(j-i, abs(X-i)+1+abs(j-Y), abs(Y-i)+1+abs(j-X))
#print(i,j,d)
ans[d-1]+=1
for a in ans:
print(a)
if __name__=='__main__':
main() | Aasthaengg/IBMdataset | Python_codes/p02726/s939567430.py | s939567430.py | py | 316 | python | en | code | 0 | github-code | 90 |
37777969780 | from django.core.management.base import BaseCommand
from datetime import date, timedelta
from paypal.standard.ipn import models
from subscription.models import Subscription, UserSubscription, Transaction
from astrobin_apps_premium.services.premium_service import SubscriptionName
class Command(BaseCommand):
def... | astrobin/astrobin | astrobin/management/commands/migrate_donors_to_premium.py | migrate_donors_to_premium.py | py | 2,704 | python | en | code | 100 | github-code | 90 |
26381542681 | from random import randint
#Introductory Message
print("Welcome to Guess the number by Vithushan Elangovan \nGuess a number between 1 and 100")
#name of user
name = input("Who is playing today? \n")
#starts off play
play = input("Would you like to start the game? Y/N\n").lower()
while play not in ["y","n","yes",... | Vite94/pythondepo | Guess the number game.py | Guess the number game.py | py | 1,429 | python | en | code | 0 | github-code | 90 |
3794669851 | #!/usr/bin/python3
# This file is part of Marcel.
#
# Marcel is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or at your
# option) any later version.
#
# Marcel is distributed ... | geophile/marcel | bin/farcel.py | farcel.py | py | 7,848 | python | en | code | 290 | github-code | 90 |
25340004186 | import socket
HEADER = 64
PORT = 5050
FORMAT = "utf-8"
DISCONNECT_MESSAGE = "!DISCONNECT"
SERVER = "192.168.43.233"
ADDRESS = (SERVER, PORT)
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect(ADDRESS)
def send(msg):
message = msg.encode(FORMAT)
msg_length = len(message)
send_lengt... | nizar-dev01/cyber-py | socket/client.py | client.py | py | 697 | python | en | code | 0 | github-code | 90 |
42699085215 | from django.urls import path, re_path
from django.conf import settings
from django.conf.urls.static import static
from . import views
from . import viewsFilings
urlpatterns = [
# ex: /polls/
path('', views.index, name='index'),
# ex: /polls/5/
path('<int:question_id>/', views.detail, name='... | ps1544/mysite | polls/urls.py | urls.py | py | 2,677 | python | en | code | 0 | github-code | 90 |
38229488815 | import torch
import torch.nn as nn
import torch.nn.intrinsic as nni
import torch.nn.intrinsic.quantized as nniq
import torch.nn.quantized as nnq
import torch.nn.quantized._reference as nnqr
from torch.nn.quantized.modules.utils import ReferenceableQuantizedModule
from . import subgraph_rewriter_FORKED_DO_NOT_USE
from .... | fengbingchun/PyTorch_Test | src/pytorch/torch/ao/quantization/fx/_lower_to_native_backend.py | _lower_to_native_backend.py | py | 6,897 | python | en | code | 14 | github-code | 90 |
37926234428 | # 04 - Desenvolva um cรณdigo em que o usuรกrio vai entrar vรกrios nรบmeros e no final vai apresentar a
# soma deles (o usuรกrio vai dizer quantos nรบmeros serรฃo informados antes de comeรงar)
quantidade = int(input('Quantos nรบmeros serรฃo somados? '))
lista = []
for i in range(quantidade) :
num1 = int(input('Qual o nรบmero ... | GarconeAna/aulasBlue | aula06-exercicios/exercicio4.py | exercicio4.py | py | 447 | python | pt | code | 0 | github-code | 90 |
40545178075 | import os
import shutil
import random
pth_1 = '/newdata/fucongliu/xxx------็ฎๆ ๆไปถๅคน--ๅปๆ้กน--ไบๆฌกๆทปๅ '
# pth_2 = '/home/xht/danhe_zq'
filenames_1 = os.listdir(pth_1)
print(len(filenames_1))
for i in filenames_1:
if '.' in i.split('_') or '.DS' in i.split('_'):
print(i)
enumerate | jeepmeng/all_test_file | delete_dot_file.py | delete_dot_file.py | py | 321 | python | en | code | 0 | github-code | 90 |
20138491146 | Possible_Agents = ["A2C", "DQN", "PPO", "ARS", "MaskablePPO", "QRDQN", "TRPO"]
AGENT_NAME = "ARS"
import os
import game_interface
if AGENT_NAME == "A2C":
from stable_baselines3 import A2C as ALGO
elif AGENT_NAME == "DQN":
from stable_baselines3 import DQN as ALGO
elif AGENT_NAME == "PPO":
from stable_bas... | Akashg475/Burger-Dog-AI | train.py | train.py | py | 1,631 | python | en | code | 0 | github-code | 90 |
18429940339 | N = int(input())
bridge = []
for i in range(1, N):
for j in range(i + 1, N + 1):
if(N % 2 == 0):
if(i + j == N + 1):
# print("skip = [{}, {}]".format(i,j))
continue
else:
if(i + j == N):
# print("skip = [{}, {}]".format(i,j))
... | Aasthaengg/IBMdataset | Python_codes/p03090/s138455681.py | s138455681.py | py | 447 | python | en | code | 0 | github-code | 90 |
18104054909 | import math
def isprime(num):
if num == 2:
return True
if num == 1 or num % 2 == 0:
return False
i = 3
for i in range(3, math.floor(math.sqrt(num))+1, 2):
if num % i == 0:
return False
return True
def count_prime_numbers(number_list):
cnt = 0
for target... | Aasthaengg/IBMdataset | Python_codes/p02257/s328179045.py | s328179045.py | py | 485 | python | en | code | 0 | github-code | 90 |
43922271329 | #!/usr/bin/env python3
from contextlib import redirect_stderr
import click
import gc
import pickle as pkl
import sys
import time as timer
import dateutil as du
import numpy as np
import numpy.random as ran
import cupy as cp
import pandas as pd
import xarray as xr
PATHBASE = "/scratch/snx3000/hbanderi/data"
def ks(a... | hbanderier/cosmo-sp | scripts/old/one_ks-smallEns.py | one_ks-smallEns.py | py | 7,975 | python | en | code | 2 | github-code | 90 |
18235391469 | n=int(input())
s=input()
r=s.count('R')
g=s.count('G')
b=s.count('B')
ans=r*g*b
for i in range(len(s)):
for j in range(i+1,len(s)):
if s[i]!=s[j]:
k=j+j-i
if k>=len(s):
break
else:
if s[i]!=s[k] and s[j]!=s[k]:
ans-=1
pr... | Aasthaengg/IBMdataset | Python_codes/p02714/s092390742.py | s092390742.py | py | 330 | python | en | code | 0 | github-code | 90 |
24605214549 | #! /bin/python
import random
import subprocess
import socket, struct, fcntl
import string
import os
import sys
class ipGen():
def IPDetermine(self):
subprocess.call(['./sniffer.sh'])
def Generate(self):
f2 = open('IPs.txt', 'r')
line2 = f2.read()
randomoctet=random.randint(... | l0gan/autoRedTeam | ipGen.py | ipGen.py | py | 2,481 | python | en | code | 4 | github-code | 90 |
32251563685 | #!/usr/bin/python3
"""urllib exploration
"""
if __name__ == "__main__":
import urllib.request
import sys
""" Implementation """
url = sys.argv[1]
data = 'email={}'.format(sys.argv[2])
data = data.encode('ascii')
req = urllib.request.Request(url, data)
with urllib.request.urlopen(req) as ... | Soulsaw/alx-higher_level_programming | 0x11-python-network_1/2-post_email.py | 2-post_email.py | py | 405 | python | en | code | 0 | github-code | 90 |
18389668349 | # -*- coding: utf-8 -*-
"""
Created on Sun Sep 13 12:37:37 2020
@author: liang
"""
"""
ใใฃใใใใๆฐๅ็ๆ
ใDP(?)ใใ: ้
ๅใไฝฟ็จใใใใจใง่จ็ฎ้ใ็็บใใใฎใ้ฒใ
ใๅฐใใใใฎใใ่จ็ฎใใใใฎๅๅ
ใๆน้ใ
ใ้ๅธธใฎ้
ๅใ็จใใใใฃใใใใๆฐๅใฎ็ๆๆนๆณใฎๅฟ็จ็
ๅฃใใ้ๆฎตใฎใใฃใใใใๆฐๅใฎๅคใใ0 ใซใใใใจใงใๅฎ่ณช้ท็งปใๆญขใใใใจใๅบๆฅใใ
"""
key = 10**9 + 7
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]+[-... | Aasthaengg/IBMdataset | Python_codes/p03013/s245323335.py | s245323335.py | py | 856 | python | ja | code | 0 | github-code | 90 |
794017807 | import numpy as np
import os
import random
import glob
import argparse
from shutil import copyfile
from pathlib import Path
def split_train_test(train_radio=0.9):
'''
split the dataset to trainset and testset according to the train_radio.
And saving train.txt and test.txt into root+'Main'.
'''
img... | ko440124/CVTeamTools | xml2yolo/split_train_test.py | split_train_test.py | py | 3,848 | python | en | code | 1 | github-code | 90 |
13454392598 | # https://leetcode.com/problems/contains-duplicate/
class Solution:
def containsDuplicate(self, nums: List[int]) -> bool:
didNumberExist = dict()
for num in nums:
if num in didNumberExist:
return True
didNumberExist[num] = True
return False
| petercrackthecode/LeetcodePractice | containsDuplicate/my_solution.py | my_solution.py | py | 311 | python | en | code | 1 | github-code | 90 |
74792605096 | """
Collection of key-value pair records, implemented as a linked list.
"""
# Name of class MUST be Dictionary
class Dictionary:
"""
Represents a single item within the linked list.
"""
class Node:
# Initialize dictionary
def __init__(self, key, value):
self.key = key
... | Jokten/Prog2 | skrap/linked_list_dict.py | linked_list_dict.py | py | 3,944 | python | en | code | 0 | github-code | 90 |
44214512930 |
# coding: utf-8
# In[1]:
import h5py
import numpy as np
np.random.seed(1337)
# In[2]:
h5f = h5py.File('preprocessed_data_winSize100_winShift10.h5','r')
training_data = h5f['training_data'][:]
training_output = h5f['training_output'][:]
testing_data = h5f['testing_data'][:]
testing_output = h5f['testing_output'][:... | a2tm7a/ActivityRecognition | Recognition-Saving+mean+and+sd.py | Recognition-Saving+mean+and+sd.py | py | 809 | python | en | code | 8 | github-code | 90 |
16326876821 | from tkinter import *
from tkinter import ttk #theme of tk
from tkinter import messagebox
from datetime import datetime
import csv
def writecsv(datalist):
with open('data.csv','a',encoding='utf-8',newline='') as file:
fw = csv.writer(file) #fw = file writer
fw.writerow(datalist)
def readc... | Jae2434/Python101 | EP.4/code.py | code.py | py | 1,575 | python | th | code | 0 | github-code | 90 |
11029268673 | from app import avatar
from data import model
from .permission_models_interface import (
DeleteException,
PermissionDataInterface,
Role,
SaveException,
TeamPermission,
UserPermission,
)
class PreOCIModel(PermissionDataInterface):
"""
PreOCIModel implements the data model for Permissio... | quay/quay | endpoints/api/permission_models_pre_oci.py | permission_models_pre_oci.py | py | 5,754 | python | en | code | 2,281 | github-code | 90 |
18555913039 | INF = float("inf") #const
MOD = 10**9+7 #const
MAX = 510000 #const
import fractions
import itertools
def main():
n = int(input())
ab = [list(map(int,input().split())) for _ in range(n)]
ab = sorted(ab,key=lambda x:x[1],reverse=True)
cd = [list(map(int,input().split())) for _ in range(n)]
cd = sort... | Aasthaengg/IBMdataset | Python_codes/p03409/s234569944.py | s234569944.py | py | 587 | python | en | code | 0 | github-code | 90 |
70032322218 | import json
import pandas as pd
import scraper as sc
import data as dt
import numpy as np
import time
queries = ["vvd", "pvv", "groenlinks | pvda | groenlinks pvda", "d66", "cda"]
def get_relevant_video_data(queries):
for query in queries:
sc.search_videos(query)
sc.search_comments(query)
query = query... | movieminer/TxMM | project/main.py | main.py | py | 1,262 | python | en | code | 0 | github-code | 90 |
72207884778 | '''
็ปๅฎไธไธชๅญ็ฌฆไธฒ๏ผ่ฏทไฝ ๆพๅบๅ
ถไธญไธๅซๆ้ๅคๅญ็ฌฆ็ย ๆ้ฟๅญไธฒย ็้ฟๅบฆใ
ย
็คบไพย 1:
่พๅ
ฅ: s = "abcabcbb"
่พๅบ: 3
่งฃ้: ๅ ไธบๆ ้ๅคๅญ็ฌฆ็ๆ้ฟๅญไธฒๆฏ "abc"๏ผๆไปฅๅ
ถ้ฟๅบฆไธบ 3ใ
็คบไพ 2:
่พๅ
ฅ: s = "bbbbb"
่พๅบ: 1
่งฃ้: ๅ ไธบๆ ้ๅคๅญ็ฌฆ็ๆ้ฟๅญไธฒๆฏ "b"๏ผๆไปฅๅ
ถ้ฟๅบฆไธบ 1ใ
็คบไพ 3:
่พๅ
ฅ: s = "pwwkew"
่พๅบ: 3
่งฃ้: ๅ ไธบๆ ้ๅคๅญ็ฌฆ็ๆ้ฟๅญไธฒๆฏย "wke"๏ผๆไปฅๅ
ถ้ฟๅบฆไธบ 3ใ
ย ่ฏทๆณจๆ๏ผไฝ ็็ญๆกๅฟ
้กปๆฏ ๅญไธฒ ็้ฟๅบฆ๏ผ"pwke"ย ๆฏไธไธชๅญๅบๅ๏ผไธๆฏๅญไธฒใ
็คบไพ 4:
่พๅ
ฅ: s = ""
่พๅบ: 0
ย
ๆ็คบ๏ผ
0 <= s.lengt... | Asunqingwen/LeetCode | Cookbook/String/ๆ ้ๅคๅญ็ฌฆ็ๆ้ฟๅญไธฒ.py | ๆ ้ๅคๅญ็ฌฆ็ๆ้ฟๅญไธฒ.py | py | 1,430 | python | zh | code | 0 | github-code | 90 |
25495862864 | import json
import random
import datetime
import requests
username = "admin"
password = "cmdbcmdb"
url_prefix = "http://cmdb.mmtweb.xyz"
# url_prefix = "http://localhost:8000"
record_count = 0
def get_token():
response = requests.post(url_prefix+"/api/v1/token", json.dumps({"username": username, "password": pa... | open-cmdb/cmdb | tools/physical_server.py | physical_server.py | py | 4,808 | python | en | code | 966 | github-code | 90 |
35092739148 | '''
Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.
An input string is valid if:
Open brackets must be closed by the same type of brackets.
Open brackets must be closed in the correct order.
Input: s = "()"
Output: true
Input: s = "()[]{}"
Out... | freeDevdh/python_algorithm | leetcode/stack_and_queue/valid-parentheses.py | valid-parentheses.py | py | 774 | python | en | code | 0 | github-code | 90 |
18260029179 | n, p = map(int, input().split())
S = list(map(int, list(input())))
if p == 2 or p == 5:
ans = 0
for i, x in enumerate(S[::-1]):
if x % p == 0:
ans += n - i
else:
mods = [0 for _ in range(p)]
mods[0] = 1
num = 0
digit = 1
for s in S[::-1]:
num = (s * digit + num) % p
mods[num] += 1
... | Aasthaengg/IBMdataset | Python_codes/p02757/s639591473.py | s639591473.py | py | 415 | python | en | code | 0 | github-code | 90 |
38218102121 | import numpy as np
import gc
import logging
from scipy.interpolate import interp2d
from SWESimulators import Common, SimWriter, SimReader
from SWESimulators import Simulator
from SWESimulators import WindStress
from SWESimulators import OceanStateNoise
from SWESimulators import OceanographicUtilities
# Needed for the... | metno/gpu-ocean | gpu_ocean/SWESimulators/CDKLM16.py | CDKLM16.py | py | 37,916 | python | en | code | 10 | github-code | 90 |
20411114424 | from __future__ import division
from ctypes import util
from datetime import datetime
import os
import seaborn as sns
# aspose used for converting docx to txt
import aspose.words as aw
# nltk used for preprocessing
import nltk
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.gridspec import Grid... | Unknown39825/Resume-Shortlist | shortlist.py | shortlist.py | py | 8,793 | python | en | code | 0 | github-code | 90 |
24100212708 | import pyshorteners
s = pyshorteners.Shortener(
api_key='', #API KEY
user_id='', #USUARIO ID
domain='ad.fly',
group_id=12,
type='int')
link = input("Escribe la url: ")
url = s.adfly.short(f'{link}')
print(f"{url}")
| jose89fcb/generar-link-adfly-en-python | adfly.py | adfly.py | py | 252 | python | en | code | 0 | github-code | 90 |
74004249577 | """
Module serves for restoring all the initial conditions, that was before the
appropriate setup of nfs server-client system, made by `set_up.py` module.
Includes `Suite` class with all it's methods, serving for teardown on a test
class level, and `Case` class, serving for teardown on a test method level
"""
from pl... | itallmakesense/QA-Automation | NFS_test/tear_down.py | tear_down.py | py | 2,608 | python | en | code | 0 | github-code | 90 |
35654825252 | import sys
import os
from PyQt5 import QtWidgets
from lib.YouViewer import Ui_MainWindow
from lib.AuthDialog import AuthDialog
from PyQt5 import QtCore
from PyQt5 import uic
from datetime import datetime
import re
from PyQt5.QtCore import pyqtSlot, pyqtSignal, QUrl
# pip install PyQtWebEngine
# form_class ... | cuzai/pythonStudy | QT/main.py | main.py | py | 4,416 | python | en | code | 0 | github-code | 90 |
75220222 | '''
์ ์ ์งํฉ S๊ฐ ์ฃผ์ด์ก์๋, ๋ค์ ์กฐ๊ฑด์ ๋ง์กฑํ๋ ๊ตฌ๊ฐ [A, B]๋ฅผ ์ข์ ๊ตฌ๊ฐ์ด๋ผ๊ณ ํ๋ค.
A์ B๋ ์์ ์ ์์ด๊ณ , A < B๋ฅผ ๋ง์กฑํ๋ค.
A โค x โค B๋ฅผ ๋ง์กฑํ๋ ๋ชจ๋ ์ ์ x๊ฐ ์งํฉ S์ ์ํ์ง ์๋๋ค.
์งํฉ S์ n์ด ์ฃผ์ด์ก์ ๋, n์ ํฌํจํ๋ ์ข์ ๊ตฌ๊ฐ์ ๊ฐ์๋ฅผ ๊ตฌํด๋ณด์.
'''
L = int(input())
S = list(map(int, input().split(' ')))
n = int(input())
S.sort()
count = 0
for i in range(1,len(S)):
if (S[i-1]<n) & (S[i]>n):... | YeongHyeon-Kim/BaekJoon_study | ~0412/1059.py | 1059.py | py | 643 | python | ko | code | 1 | github-code | 90 |
21641251502 | import time, datetime
import urllib3
print("Importing OpenShift/Kubernetes packages ...")
import kubernetes
import ocp_resources
import openshift
import ocp_resources.node
import ocp_resources.machine
import openshift.dynamic
print("Importing AWS boto3 ...")
import boto3
import botocore
client_k8s = None
client_... | openshift-psap/ci-artifacts-tooling | sno-snapshot/src/common.py | common.py | py | 3,779 | python | en | code | 0 | github-code | 90 |
4958054341 | '''
1375. Substring With At Least K Distinct Characters
Description
Given a string S with only lowercase characters.
Return the number of substrings that contains at least k distinct characters.
10 โค length(S) โค 1,000,000
1 โค k โค 26
Have you met this question in a real interview?
Example
Example 1:
Inp... | boxu0001/practice | py3/L1374_kDistinctSubString.py | L1374_kDistinctSubString.py | py | 2,066 | python | en | code | 0 | github-code | 90 |
36492227788 | # ๆณจๆ๏ผ้ๅๅ๏ผไป
ๅจๆฅ่ช http://yuncode.net/code/c_5c1476152418f82 ไบไปฃ็ ็ๅบ็กไธไฟฎๆน
# -*- coding: utf-8 -*-
from tkinter import *
import random
from tkinter.messagebox import askquestion
# ๅฐ้ๆน่ฟ๏ผๆๅพ
ๆ้ซ
# ๅ็งๆนๅ็่กจ็คบ๏ผไธๅ่ๆนๅ็็ธๅฏนไฝ็ฝฎ
shapedic = {1: ((0, 0), (1, 0), (0, -1), (1, -1)), # ๆญฃๆนๅฝข
2: ((0, 0), (0, -1), (0, -2), (0, ... | bmjoy/tetris_ai | tetris_ai_cn.py | tetris_ai_cn.py | py | 21,011 | python | en | code | 2 | github-code | 90 |
18336123899 | # ๅ็ญใ่ฆใฆไฝๆ๏ผไธ่ดๆค็ดขใฏsort๏ผไธ่ดใงๆ้ใใใใ๏ผ
n = int(input())
a = [int(x.strip()) for x in input().split()]
b = []
ans = str('')
for i in enumerate(a):
b.append(i)
b.sort(key=lambda x:x[1])
for i in b:
print(i[0]+1) | Aasthaengg/IBMdataset | Python_codes/p02899/s892579434.py | s892579434.py | py | 253 | python | en | code | 0 | github-code | 90 |
12458110748 | def solution(s):
dict={}
en=['zero','one','two','three','four','five','six','seven','eight','nine']
for i in range(10):
dict[en[i]]=i
print(dict)
#๋์
๋๋ฆฌ์ ํค์ ๊ฐ์ผ๋ก ๋ฃ์ด์ฃผ์๋ค
result=''
eng=''
for i in s: #๋ฌธ์์ด ํ๋์ฉ ํ์ธ
if i.isdigit():
result = result+i
elif i.isal... | hansun-hub/python_codingTest_ | AA/programers/์ซ์๋ฌธ์์ด๊ณผ ์๋จ์ด.py | ์ซ์๋ฌธ์์ด๊ณผ ์๋จ์ด.py | py | 679 | python | ko | code | 0 | github-code | 90 |
73188252457 | from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Div, Submit
from django import forms
from registration.forms import RegistrationForm
from accounts.models import Profile
from main.models import Category, Offer, CommunityProduct, OfferImage
class OfferForm(forms.ModelForm):
class... | artemyel/AMBA | accounts/forms.py | forms.py | py | 3,445 | python | en | code | 0 | github-code | 90 |
7346704475 | import sublime
import sublime_plugin
from . import ipy_view, ipy_connection
manager = ipy_view.manager
class SublimeINListener(sublime_plugin.EventListener):
def on_selection_modified(self, view):
nbview = manager.get_nb_view(view)
if nbview:
nbview.on_sel_modified()
def on_modi... | maximsch2/SublimeIPythonNotebook | subl_ipy_notebook.py | subl_ipy_notebook.py | py | 9,679 | python | en | code | 96 | github-code | 90 |
17970504479 | n = int(input())
a = [int(i) for i in input().split()]
con =0
ex = -1
for i in range(n):
if a[i] % 4 == 0:
con +=1
elif a[i] % 2 == 0:
ex +=1
if ex == -1:
ex = 0
if (n-ex)//2 <= con:
print('Yes')
else:
print('No') | Aasthaengg/IBMdataset | Python_codes/p03637/s994173123.py | s994173123.py | py | 254 | python | it | code | 0 | github-code | 90 |
18431769539 | from collections import defaultdict
M = 10**9 + 7
N = int(input())
C = [0]*N
for i in range(N):
C[i] = int(input())
class increment:
def __init__(self, start=0):
self.index = start-1
def __call__(self):
self.index += 1
return self.index
ui = defaultdict(increment())
clists = []
N... | Aasthaengg/IBMdataset | Python_codes/p03096/s460742635.py | s460742635.py | py | 735 | python | en | code | 0 | github-code | 90 |
38933803520 | #!/usr/bin/env python3
'''
Author: djs
Date: 2012-07-11
Description: Simple example of a Read Eval Print Loop
'''
import sys
def REPL():
print('Simple shell, \\ is the line continuation character.')
print('Ctrl-C exits')
try:
lines = ''
print('$ ', end='')
while True:
... | danshea/python | python3/repl.py | repl.py | py | 765 | python | en | code | 2 | github-code | 90 |
11141646110 | # OOP ASSIGNMENT SHELL (Bank Account Manager)
#Your code here for 3 classes
class Accounts(object):
def __init__(self,balance):
self.balance = balance
class Checking(Accounts):
def __init__(self,Checking):
Checking >= 100
class Savings(Accounts):
def __init__(self,Savings):
int... | KellyHanley/Finished | Kelly_Hanley OOP2.py | Kelly_Hanley OOP2.py | py | 1,311 | python | en | code | 0 | github-code | 90 |
72447318377 | import requests
from packages.api.env import SECRET_AUTHORIZATION_HEADER
def send_email_request(email: str):
"""Background task to send an e-mail to a newly registered user
Args:
email (str): User's e-mail
"""
URL = "http://localhost:5518"
response = requests.get(
f"{URL}/email/... | asynched/py-webhook | packages/api/tasks/send_email.py | send_email.py | py | 677 | python | en | code | 1 | github-code | 90 |
36842191407 | from cmd.main import run_conversation
from rich.console import Console
from rich.table import Table
from rich.progress import track
from colorama import Fore, Style, init
import textwrap
console = Console()
def main():
init(autoreset=True)
while True:
user_input = console.input("[yellow]Enter a claim ... | silasnevstad/verifi | main.py | main.py | py | 1,640 | python | en | code | 0 | github-code | 90 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.