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
28031031692
import cv2 import numpy as np def MNIST_Download(download_path, one_hot = True): from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets(download_path, one_hot=one_hot) return mnist if __name__ == '__main__': mnist = MNIST_Download("../../../Dataset/MNIST/", one_ho...
shjo-april/Tensorflow_MLP
Utils.py
Utils.py
py
957
python
en
code
0
github-code
90
24318659612
import numpy as np from scipy import stats from cached_property import cached_property from .core_utils import IdentifedCachedObject def nadaraya_watson_estimator(x, x_data, y_data, h): """ Calculate Nadaraya-Watson-Estimator. Parameters ---------- x: ndarray evaluation positions x_d...
Digusil/eventsearch
eventsearch/estimators.py
estimators.py
py
16,370
python
en
code
2
github-code
90
35183230664
import cv2 import numpy as np from matplotlib import pyplot img = cv2.imread('./win-screen.png') f= open("win.txt","w+") x = 90 y = 92 print ('RGB shape: ', img.shape) print (img[x, y]) # print((img[x, y][0] and img[x,y][1] and img[x,y][2]) == 0) for i in range(0,256): for j in range(0,256): q = img[j,i] if ((...
abrarzaman2003/connect4
extra files/pixelEncoder.py
pixelEncoder.py
py
559
python
en
code
1
github-code
90
21864647931
from math import factorial, pow, pi, acos, sqrt from euclid import Vector2, Vector3, Matrix4 ################################## # User Properties start = Vector2(861.369007, 537.722476) end = Vector2(930.775243, 503.483954) length = 77.500241 startCurvature = 1.0/500 endCurvature = 1.0/367 clockwise = False...
tumcms/Open-Infra-Platform
UserInterface/Data/DesignAutomation/clothoid.py
clothoid.py
py
4,834
python
en
code
44
github-code
90
18544292157
# ๋ฌธ์ œ # ์ •์ˆ˜ ์ง‘ํ•ฉ S๊ฐ€ ์ฃผ์–ด์กŒ์„๋•Œ, ๋‹ค์Œ ์กฐ๊ฑด์„ ๋งŒ์กฑํ•˜๋Š” ๊ตฌ๊ฐ„ [A, B]๋ฅผ ์ข‹์€ ๊ตฌ๊ฐ„์ด๋ผ๊ณ  ํ•œ๋‹ค. # A์™€ B๋Š” ์–‘์˜ ์ •์ˆ˜์ด๊ณ , A < B๋ฅผ ๋งŒ์กฑํ•œ๋‹ค. # A โ‰ค x โ‰ค B๋ฅผ ๋งŒ์กฑํ•˜๋Š” ๋ชจ๋“  ์ •์ˆ˜ x๊ฐ€ ์ง‘ํ•ฉ S์— ์†ํ•˜์ง€ ์•Š๋Š”๋‹ค. # ์ง‘ํ•ฉ S์™€ n์ด ์ฃผ์–ด์กŒ์„ ๋•Œ, n์„ ํฌํ•จํ•˜๋Š” ์ข‹์€ ๊ตฌ๊ฐ„์˜ ๊ฐœ์ˆ˜๋ฅผ ๊ตฌํ•ด๋ณด์ž. # ์ž…๋ ฅ # ์ฒซ์งธ ์ค„์— ์ง‘ํ•ฉ S์˜ ํฌ๊ธฐ L์ด ์ฃผ์–ด์ง„๋‹ค. ๋‘˜์งธ ์ค„์—๋Š” ์ง‘ํ•ฉ์— ํฌํ•จ๋œ ์ •์ˆ˜๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. ์…‹์งธ ์ค„์—๋Š” n์ด ์ฃผ์–ด์ง„๋‹ค. # ์ถœ๋ ฅ # ์ฒซ์งธ ์ค„์— n์„ ํฌํ•จํ•˜๋Š” ์ข‹์€ ๊ตฌ๊ฐ„์˜ ๊ฐœ์ˆ˜๋ฅผ ์ถœ๋ ฅํ•œ๋‹ค. import sys input = sys.stdin.rea...
goldapple-ce/Algorithm
python/backjoon/Silver5/1059.py
1059.py
py
956
python
ko
code
0
github-code
90
24191783148
import random def main(): numbers = [16.2, 75.1, 52.3] print(f"numbers {numbers}") # Call the append_random_numbers function to # add one random number to the numbers list. append_random_numbers(numbers) print(f"numbers {numbers}") # Call the append_random_numbers function to add # th...
byui-cse/cse111-course
docs/lesson07/teach_solution.py
teach_solution.py
py
2,598
python
en
code
2
github-code
90
18493394749
s=input() t=input() n=len(s) s=sorted(s) t=sorted(t) Lists={} nums=[] Listt={} numt=[] for i in range(n): Lists.setdefault(s[i], 0) Listt.setdefault(t[i], 0) Lists[s[i]]+=1 Listt[t[i]]+=1 for j in Lists.values(): nums.append(j) for j in Listt.values(): numt.append(j) #print(nums) #pri...
Aasthaengg/IBMdataset
Python_codes/p03252/s757076314.py
s757076314.py
py
455
python
kn
code
0
github-code
90
1111351728
from fpdf import FPDF # page 1 params: title = "DIAGNOS-IT" year = "2022" month = "Juin 5" child_name = "name 1" authored = "name 2" logo_path = 'images/logo_DI.png' logo_name = "Dvir" path = 'DejaVuSansCondensed.ttf' # notebooks/DejaVuSansCondensed.ttf # page 2 params: title_heading = "ื”ืกื‘ืจ ืขืœ ื”ื“ื•ื—"[::-1] sub_titl...
dvirbo/DIAGNOS-IT-report
tst.py
tst.py
py
4,919
python
en
code
0
github-code
90
3394526891
# -*- coding: utf-8 -*- # import lib import matplotlib.pyplot as plt # ๅญธ็ฟ’ๆ›ฒ็ทš from sklearn.learning_curve import learning_curve # ้ฉ—่ญ‰ๆ›ฒ็ทš from sklearn.learning_curve import validation_curve # ๆจ™ๆบ–ๅŒ– from sklearn.preprocessing import StandardScaler # ๆจ™็ฑค็ทจ็ขผ from sklearn.preprocessing import LabelEncoder # ่ณ‡ๆ–™ๅˆ†้›† from sklearn....
Lung-Yu/AI_Tutorial
chart/learing_curve/sample_2.py
sample_2.py
py
2,662
python
en
code
0
github-code
90
34787448357
from network.network import Network from link.link import Link from physical.tcp_server import Tcp_server from application import client_main def service(mylabel,shared_keys,Tx_queue,recv_shared_keys): #physical layer print("thread server") tcp_server = Tcp_server() while 1: # to_mac,to_label,str(myla...
evelynweng/NetworksOverNetworks
application/server_main.py
server_main.py
py
1,189
python
en
code
0
github-code
90
42288583297
""" The *listView* submodule ------------------------ The *listView* submodule provides a widget that can conveniently display Python lists_. .. _lists: https://docs.python.org/3/tutorial/introduction.html#lists """ import collections.abc from defcon import Font, Glyph from PyQt5.QtCore import QAbstractTableModel, ...
trufont/trufont
Lib/defconQt/controls/listView.py
listView.py
py
16,933
python
en
code
450
github-code
90
39934615406
import glfw from OpenGL.GL import * import numpy import pyrr # matrix, vector math from PIL import Image from math import * import shaderLoader cube_positions = [] cameraPos =pyrr.Vector3([0.0, 0.5, 2.0]) cameraFront =pyrr.Vector3([0.0, 0.0, -1.0]) cameraUp =pyrr.Vector3([0.0, 1.0, 0.0]) delta_time = 0.0 last_...
Zulbukharov/opengl_python
multiple_cube.py
multiple_cube.py
py
12,846
python
en
code
2
github-code
90
8383624080
from __future__ import annotations from workflow.abstract_workflow import AbstractTestMainWorkflow from workflow.utils import ( obtain_notification_information ) from workflow.test_workflow.sponsor.api import ( TestSponsorFindAssistor, TestSponsorMatchIdentifier, TestSponsorOutput ) from workflow.te...
Collaborative-AI/colda
package/colda/workflow/test_main_workflow.py
test_main_workflow.py
py
6,073
python
en
code
17
github-code
90
18031874139
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline in_n = lambda: int(readline()) in_nn = lambda: map(int, readline().split()) in_nl = lambda: list(map(int, readline().split())) in_na = lambda: map(int, read().split()) in_s = lambda: readline().rstrip().decode('utf-8') def main(): x1, ...
Aasthaengg/IBMdataset
Python_codes/p03836/s038444499.py
s038444499.py
py
653
python
en
code
0
github-code
90
31301275608
import sys,io sys.stdout=io.TextIOWrapper(sys.stdout.detach(),encoding='utf-8') sys.stderr=io.TextIOWrapper(sys.stderr.detach(),encoding='utf-8') class Warehouse: stcok_num=0 def __init__(self,name): self.name=name Warehouse.stcok_num+=1 def __del__(self): Warehouse.stcok_num-=1 U...
mju3356/Python_Section2-2
python_class_3.py
python_class_3.py
py
522
python
en
code
0
github-code
90
70390276456
#!/usr/bin/env python import numpy as np import copy import rospy import tf import tf2_ros from std_msgs.msg import Header, String from sensor_msgs.msg import Image as ImageMsg from sensor_msgs.msg import Imu, CameraInfo from sensor_msgs.msg import LaserScan from nav_msgs.msg import Odometry from geometry_msgs.msg im...
MIT-SPARK/VNAV-labs
lab3/tesse-ros-bridge/ROS/src/tesse_ros_bridge/tesse_ros_node.py
tesse_ros_node.py
py
46,052
python
en
code
47
github-code
90
38933327390
#!/usr/bin/env python3.4 """ Filename: LCSM.py Date Created: 2015-01-13 14:41 Author: dshea <danshea@iastate.edu> Description: Given: A collection of k (kโ‰ค100) DNA strings of length at most 1 kbp each in FASTA format. Return: A longest common substring of the collection. ...
danshea/python
bioinformatics/rosalind/LCSM/LCSM.py
LCSM.py
py
2,287
python
en
code
2
github-code
90
74024666216
import scenedetect scene_list = [] # Scenes will be added to this list in detect_scenes(). for i in range(10): scene_list = [] path = 'ACCEDE0000'+str(i)+'.mp4' # Path to video file. # Usually use one detector, but multiple can be used. detector_list = [ scenedetect.detectors.ThresholdDetector(thr...
amtvj/MINI_PROJECT
project/scr.py
scr.py
py
575
python
en
code
0
github-code
90
34141097845
import numpy as np import os def load_allChannels(fileName, channelNames=None): """ Load all data from an sio file """ return load_selection(fileName, -1, 0, -1, channelNames) def load_selection(fileName, sampleStart, numSamples, channels, channelNames=None): """ Load a section of...
nedlrichards/load_sio
load_sio/load_sio.py
load_sio.py
py
5,150
python
en
code
0
github-code
90
12227647611
# ่ฎพ่ฎก็›ธๅ…ณ็š„API import urllib PLATFORM_DOUYU = 1 # ๅนณๅฐ๏ผšๆ–—้ฑผ PLATFORM_HUYA = 2 # ๅนณๅฐ๏ผš่™Ž็‰™ PLATFORM_PANDA = 3 # ๅนณๅฐ๏ผš็†Š็Œซ URL_API_DOUYU_ROOM_INFO = "http://open.douyucdn.cn/api/RoomApi/room/" # ไธปๆ’ญๆˆฟ้—ดไฟกๆฏ URL_API_DOUYU_ROOM_LIST = "http://api.douyutv.com/api/v1/live" # ๅœจๆ’ญไธปๆ’ญๅˆ—่กจ # URL_DOUYU_ANCHOR_LIST_AJAX = "https://www.douyu.com/di...
Rano1/TvLive
project/zhanyutv/api/apiconstants.py
apiconstants.py
py
962
python
en
code
11
github-code
90
21886270073
from django.contrib import admin from .models import Listing # Register your models here. class ListingAdmin(admin.ModelAdmin): #admin_field_customization ##admin.ModelAdmin ke inherit kortaci. #ModelAdmin is a class class Meta...
m-sakib-h/django_workshop
dj_workshop/listings/admin.py
admin.py
py
959
python
en
code
0
github-code
90
13228572323
#ัั‡ะธั‚ะฐะตะผ ััƒะผะผัƒ ะดะฒั… ั‡ะธัะตะป, ะฟะตั€ะตะดะฐะตะผ ะทะฝะฐั‡ะตะฝะธะต ััƒะผะผั‹ ะฒ ัั‚ั€ะพะบัƒ, ะฒะฒะพะดะธะผ ะทะฝะฐั‡ะตะฝะธะต ััƒะผะผั‹-ัั‚ั€ะพะบะธ ะฒ ะฟะพะปะต #ะฐะฝัะฒะตั€ ะธ ะฝะฐะถะธะผะฐะตั‚ ัะฐะฑะผะธั‚c from selenium import webdriver from selenium.webdriver.common.by import By import time from selenium.webdriver.support.ui import Select try: link = "http://suninjuly.github.io/selects1.html"...
artyrshur/selenium_course
lesson6_step10.py
lesson6_step10.py
py
1,012
python
ru
code
0
github-code
90
5291574068
import math import re import warnings from typing import Callable, Optional import torch import torch.nn as nn from composer.models.efficientnetb0._layers import (DepthwiseSeparableConv, MBConvBlock, calculate_same_padding, round_channels) __all__ = ['EfficientNet'...
mosaicml/composer
composer/models/efficientnetb0/efficientnets.py
efficientnets.py
py
9,440
python
en
code
4,712
github-code
90
18164730549
import numpy as np s_ = input() s = np.array([int(s_[i]) for i in range(len(s_))]) k = 0 for n in s: k += n if k % 9 ==0: print("Yes") else: print("No")
Aasthaengg/IBMdataset
Python_codes/p02577/s523772042.py
s523772042.py
py
166
python
en
code
0
github-code
90
9469238218
import re def find_ssrf_vulnerabilities(code): pattern = r'requests\s*\.\s*(?:get|post|head|put|patch|delete)|' \ r'\b(urllib|httplib|http.client)\s*\.\s*(?:urlopen|request)' matches = re.finditer(pattern, code) vulnerabilities = [] for match in matches: vulnerab...
boloto1979/Code-Sentinel
vulnerabilities/ssrf/ssrf_vulnerabilities.py
ssrf_vulnerabilities.py
py
600
python
en
code
5
github-code
90
31074355126
#main game class from time import time as cTime from Car import * from Clock import * from Gear import * import Levels from Wall import * from Park import * from Popup import * #initialize music mixer.init() class Game(): def __init__(self,surface): # Setup initial surface and variables #read what level game i...
sirvar/fast-and-furious-parking
Game.py
Game.py
py
14,256
python
en
code
0
github-code
90
10531750556
from selenium import webdriver from selenium.webdriver.common.keys import Keys # ๅˆ›ๅปบไธ€ไธชChromeๆต่งˆๅ™จๅฎžไพ‹ driver = webdriver.Chrome() # ๆ‰“ๅผ€็™พๅบฆ้ฆ–้กต driver.get("https://www.baidu.com/") # ๅฎšไฝๆœ็ดขๆก†ๅนถ่พ“ๅ…ฅๅ…ณ้”ฎ่ฏ search_box = driver.find_element_by_xpath("//input[@id='kw']") search_box.send_keys("Python") # ๆจกๆ‹Ÿๅ›ž่ฝฆ้”ฎ search_box.send_keys(Keys.ENT...
fetter1991/develop-tool
Python/้ผ ๆ ‡็‚นๅ‡ป.py
้ผ ๆ ‡็‚นๅ‡ป.py
py
801
python
en
code
1
github-code
90
18064528049
import sys input = sys.stdin.readline sys.setrecursionlimit(10 ** 7) s = input().strip() if ('N' in s and 'S' not in s) or ('N' not in s and 'S' in s): print('No') sys.exit(0) if ('W' in s and 'E' not in s) or ('W' not in s and 'E' in s): print('No') sys.exit(0) print('Yes')
Aasthaengg/IBMdataset
Python_codes/p04019/s506717961.py
s506717961.py
py
294
python
en
code
0
github-code
90
37096264441
"""create centers Revision ID: ca9f929dd635 Revises: 6b6bd5f86431 Create Date: 2020-10-22 19:20:54.757635 """ import sqlalchemy as sa from alembic import op from sqlalchemy.dialects.mysql import ENUM revision = 'ca9f929dd635' down_revision = '6b6bd5f86431' branch_labels = None depends_on = None STATES = ('pending'...
tefenet/donaciones
alembic/versions/ca9f929dd635_create_centers.py
ca9f929dd635_create_centers.py
py
55,729
python
en
code
0
github-code
90
35486046585
from gwf import Workflow gwf = Workflow() def bwa_map(infiles, outfiles): options = { 'inputs': infiles, 'outputs': outfiles, 'memory': '4g', 'cores': '8', 'walltime': '240:00:00', 'account': 'NChain' } spec = "./map.sh "+" ".join(infiles+outfiles) ret...
MarniTausen/CloverAnalysisPipeline
PSMC/workflow.py
workflow.py
py
6,658
python
en
code
3
github-code
90
17927841079
S=input() T=["KIHBR","KIHBRA","KIHBAR","KIHBARA", "KIHABR","KIHABRA","KIHABAR","KIHABARA", "AKIHBR","AKIHBRA","AKIHBAR","AKIHABRA", "AKIHABR","AKIHABRA","AKIHABAR","AKIHABARA"] ans=0 for i in range(16): if(S==T[i]): ans=1 if(ans): print("YES") else: print("NO")
Aasthaengg/IBMdataset
Python_codes/p03523/s094972072.py
s094972072.py
py
279
python
en
code
0
github-code
90
33382197656
import os from os.path import join import tensorflow as tf from model import SourceSeparator from datetime import datetime as dt import pickle import shutil import argparse parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) # PATHS parser.add_argument("--checkpoin...
sveinnpalsson/sourceseparation
main.py
main.py
py
5,638
python
en
code
10
github-code
90
31661748973
#Tuples are ordered and immutable. Similar to list but it only cannot be changed/modified. #Oftenly used for objects that belong together. #a tuple is smaller than a list(uses less bytes), and faster hence it is more efficient mytuple = ("banana", "apple", "maembe", "avoc") mytuple2=tuple(["Max", 30, "Boston"])...
Timothy254/Playing-with-Python
Basics/2 Tuples.py
2 Tuples.py
py
1,051
python
en
code
0
github-code
90
12752138427
from flask import Flask,jsonify from flasgger import Swagger app = Flask(__name__) swagger =Swagger(app) @app.route('/colors/<palette>/') def colors(palette): """ Example endpoint returning a list of colors by palette This is using docstrings for specifications. --- parameters: ...
Locchuong96/backend
API-structure/flasgger_docstring/app.py
app.py
py
1,300
python
en
code
3
github-code
90
16363770168
#!/usr/bin/env python import unittest import os import tempfile from ct.client.db import sqlite_connection as sqlitecon from ct.client.db import sqlite_temp_db from ct.client.db import temp_db_test class SQLiteTempDBTest(unittest.TestCase, temp_db_test.TempDBTest): def setUp(self): self.database = sqlit...
google/certificate-transparency
python/ct/client/db/sqlite_temp_db_test.py
sqlite_temp_db_test.py
py
1,718
python
en
code
862
github-code
90
18054203829
def slove(): import sys input = sys.stdin.readline ls = list("CODEFESTIVAL2016") s = str(input().rstrip('\n')) cnt = 0 for i in range(len(s)): if ls[i] != s[i]: cnt += 1 print(cnt) if __name__ == '__main__': slove()
Aasthaengg/IBMdataset
Python_codes/p03970/s703254494.py
s703254494.py
py
270
python
en
code
0
github-code
90
40544069795
import matplotlib.pyplot as plt import matplotlib.patches as patches fig, ax = plt.subplots() triangle = patches.Polygon([[0.1, 0.2], [0.1, 0.7], [0.8, 0.2]], closed=True, facecolor='blue') ax.add_patch(triangle) circle = patches.Circle((0.5, 0.5), 0.3, facecolor='red') ax.add_patch(circle) recta...
jencyyyyy/CSE3222-Computer-Graaphics-Lab
hidden.py
hidden.py
py
492
python
en
code
0
github-code
90
39803173941
# -*- coding: utf-8 -*- # 20180430 import difflib import sys import argparse import parse_pdf # ่ฏปๅ–ๅปบ่กจ่ฏญๅฅๆˆ–้…็ฝฎๆ–‡ไปถ def read_file(file_name): try: file_desc = open(file_name, 'r',encoding='utf-8') # ่ฏปๅ–ๅŽๆŒ‰่กŒๅˆ†ๅ‰ฒ text = file_desc.read().splitlines() file_desc.close() return text exc...
suxiaoyu/compare-two-PDF-files
compare_two_files.py
compare_two_files.py
py
1,890
python
en
code
0
github-code
90
15977055685
# DFS # 1. recursive function import collections graph = collections.defaultdict(list) def recursive_dfs(v,discovered = []): discovered.append(v) for w in graph[v]: if w not in discovered: discovered = recursive_dfs(w,discovered) return discovered # 2. stack def iterative_dfs(star...
OnMyWave/Algorithm
code_snippets/DFS & BFS.py
DFS & BFS.py
py
1,137
python
en
code
0
github-code
90
25691826522
def numerals(number): count = number numeral = '' while count > 0: if count >= 1000: numeral += 'M' count -= 1000 elif count >= 500: numeral += 'D' count -= 500 elif count >= 100: numeral += 'C' count...
Revilloc/Roman-numerals
roman numerals.py
roman numerals.py
py
821
python
en
code
0
github-code
90
20151790506
# -*- coding: utf-8 -*- import yaml import json import logging import tempfile from raven.contrib.flask import Sentry from celery import Celery, Task from flask import jsonify, g, Flask, request # from flask_cors import CORS from flask_migrate import Migrate from flask_admin import Admin from flasgger import Swagger ...
kaecloud/console
console/app.py
app.py
py
8,887
python
en
code
4
github-code
90
24873095511
from shorty.common.exceptions.provider_exception import ProviderException def test_provider_exception_to_response(): # given exception = ProviderException("bitly") # when response = exception.to_response() # then assert response == { 'error': { 'status': 503, 'c...
iliasmentz/url-shortener
tests/test_common/test_exceptions/test_provider_exception.py
test_provider_exception.py
py
405
python
en
code
1
github-code
90
6249405142
import os import json import datetime import numpy as np import torch import utils import random from copy import deepcopy from arguments import get_args from tensorboardX import SummaryWriter from eval import evaluate from learner import setup_master from pprint import pprint import logging cuda_num= 2 np.set_printo...
wsg1873/MCCG
main.py
main.py
py
9,100
python
en
code
2
github-code
90
37763822913
import os def run(): os.system("cp v8.api v8.api.tmp") os.system("./v8tojsni.py v8.api.tmp") def check(): with open("v8.api.tmp") as v8: with open("jsni.api") as jsni: v8lines = v8.readlines() jsnilines = jsni.readlines() v8size = len(v8lines) jsnisize = len(jsnilines) assert (...
alibaba/jsni
tools/test_v8tojsni.py
test_v8tojsni.py
py
644
python
en
code
36
github-code
90
29502426801
import numpy as np from scipy.special import factorial from itertools import permutations, product from pysat.solvers import Minisat22, Minicard from pysat.pb import PBEnc from clauses import build_clauses, build_max_min_clauses from clauses import build_permutation_clauses from clauses import build_cardinality_lits,...
michaelpatrickpurcell/balanced-nontransitive-dice
utils.py
utils.py
py
11,203
python
en
code
0
github-code
90
72329154218
from django.shortcuts import get_object_or_404 # Create your views here. from rest_framework import viewsets from rest_framework.decorators import list_route, detail_route from rest_framework.permissions import IsAuthenticatedOrReadOnly, IsAuthenticated from rest_framework.response import Response from rest_framework....
BijoySingh/Washroom-Finder-Django
item/views.py
views.py
py
18,951
python
en
code
0
github-code
90
74796339496
# -*- coding: utf-8 -*- # # HPX - dashboard # # Copyright (c) 2020 - ETH Zurich # All rights reserved # # SPDX-License-Identifier: BSD-3-Clause """Module that defines a metaclass that allows for the creation of Singletons. Using the ``Singleton`` metaclass, it is possible to transform any ordinary class i...
jokteur/hpx-dashboard
src/hpx_dashboard/common/singleton.py
singleton.py
py
733
python
en
code
6
github-code
90
24447704287
## https://old.reddit.com/r/dailyprogrammer/comments/7qn07r/20180115_challenge_347_easy_how_long_has_the/ def active(hours): return len({h for d in hours for h in range(int(d.split()[0]), int(d.split()[1]))}) ex_inp = """1 3 2 3 4 5""" ch_inp_1 = """2 4 3 6 1 3 6 8""" ch_inp_2 = """6 8 5 8 8 9 5 7 4 7""" bonus...
oh2468/daily-programmer
challenges/347_HowLongHasTheLightBeenOn.py
347_HowLongHasTheLightBeenOn.py
py
568
python
en
code
0
github-code
90
18121690549
diceA = list(map(int, input().split())) diceB = [[1,2,3,5,4,2],[2,1,4,6,3,1],[3,1,2,6,5,1],[4,1,5,6,2,1],[5,1,3,6,4,1],[6,2,4,5,3,2]] q = int(input()) for i in range(q): quest = list(map(int, input().split())) ans = 0 for j in range(6): if quest[0] == diceA[j]: for k in range(6): if quest[1] ...
Aasthaengg/IBMdataset
Python_codes/p02384/s194985707.py
s194985707.py
py
455
python
en
code
0
github-code
90
43485912973
import logging from django.http import Http404 from django.shortcuts import get_object_or_404, render from django.urls import reverse from django.views import View from django.views.generic import UpdateView from dataworkspace.apps.datasets.models import DataSet, DataSetSubscription, ReferenceDataset from dataworkspa...
uktrade/data-workspace
dataworkspace/dataworkspace/apps/datasets/subscriptions/views.py
views.py
py
5,026
python
en
code
42
github-code
90
7738903872
import numpy as np import cv2 from skimage.measure import regionprops, find_contours import os def insertPoints(im, location=None,color='red'): im = np.array(im, dtype='int32') size = im.shape if len(size) == 2: imtest = np.dstack((im, im, im)) else: imtest = im color_number=-1 ...
moliq1/lung-segmentation
nn/draw_mask.py
draw_mask.py
py
1,798
python
en
code
3
github-code
90
32795605496
from django.urls import path, include from .views import * app_name = 'core' urlpatterns = [ path('menu/', Menu.as_view(),name='menu'), path('inscricao/', UsuarioInscricao.as_view(),name='usuario_inscricao'), path('sucesso/', SucessoInscricao.as_view(),name='sucesso_inscricao'), ]
pamaralifs/sisgg-2019-2-3INF-N
core/urls.py
urls.py
py
296
python
en
code
0
github-code
90
23795250164
#!/usr/bin/env python3 """Exports vCenter objects and imports them into Netbox via Python3""" import asyncio import atexit from socket import gaierror from datetime import date, datetime from ipaddress import ip_network import argparse import aiodns import requests from pyVim.connect import SmartConnectNoSSL, Disconne...
synackray/vcenter-netbox-sync
run.py
run.py
py
67,559
python
en
code
102
github-code
90
6937377939
#!/usr/bin/env python import rospy from geometry_msgs.msg import Twist import numpy as np def main(): rospy.init_node('topic_publisher') pub = rospy.Publisher('cmd_vel', Twist, queue_size=10) rate = rospy.Rate(2) while not rospy.is_shutdown(): v = np.random.rand(3) w = np.random.ran...
rafaelrojasmiliani/rosignite
rosbasics5days/unit03/src/topics_quiz/src/publisher.py
publisher.py
py
492
python
en
code
1
github-code
90
73608107496
import math #persoalan gerak lurus class GerakLurus(): #disini merupakan class yang digunakan untuk menghitung besaran fisis berdasarkan konsep gerak lurus def __init__(self,kecepatan,waktu,jarak=None): self.kecepatan = kecepatan self.waktu = waktu self.jarak = jarak def hitun...
AryaB29/Solved-Physics-Math-OOP
simple_physics_problem.py
simple_physics_problem.py
py
1,591
python
id
code
0
github-code
90
14285462633
# _*_ coding : UTF-8 _*_ # ๅผ€ๅ‘ไบบๅ‘˜ : ChangYw # ๅผ€ๅ‘ๆ—ถ้—ด : 2019/8/9 11:40 # ๆ–‡ไปถๅ็งฐ : processingDemo01.PY # ๅผ€ๅ‘ๅทฅๅ…ท : PyCharm ''' ๅˆ›ๅปบ่ฟ›็จ‹๏ผŒ ''' import multiprocessing import os import time sum = 0 def foo(num): print("in foo -->",os.getpid(),"-->>",os.getppid()) global sum for i in range(num) : ...
wenzhe980406/PythonLearning
day20/processingDemo01.py
processingDemo01.py
py
944
python
en
code
0
github-code
90
32814247280
import tweepy import time def login_to_twitter(consumer_key, consumer_secret, access_token, access_token_secret): auth = tweepy.OAuthHandler(consumer_key, consumer_secret) auth.set_access_token(access_token, access_token_secret) api = tweepy.API(auth) return api def post_tweets(): consumer_key ...
glanzerp15/twitterAPIWallner
twitterapi_wallner_ronaldo.py
twitterapi_wallner_ronaldo.py
py
1,279
python
en
code
0
github-code
90
74039021418
import os from typing import Tuple, Union, List import pickle import numpy as np from sklearn.model_selection import train_test_split from config.core import config def train_test_val_split(data: Union[np.ndarray, List]) -> Tuple: """Split input data into training, test, and validation Parameters -----...
elizastarr/image_caption_generator
src/data_utils/split_and_format.py
split_and_format.py
py
3,227
python
en
code
0
github-code
90
17278448182
import pathlib from src.repositories.actionBar.core import hasExoriCooldown from src.utils.image import loadFromRGBToGray currentPath = pathlib.Path(__file__).parent.resolve() def test_should_return_False_when_has_no_exori_cooldown(): screenshotImage = loadFromRGBToGray(f'{currentPath}/withoutExoriCooldown.png'...
lucasmonstrox/PyTibia
tests/unit/repositories/actionBar/core/hasExoriCooldown/test_hasExoriCooldown.py
test_hasExoriCooldown.py
py
738
python
en
code
214
github-code
90
72555420138
import math import numpy from vtkmodules.util import numpy_support from vtkmodules.vtkCommonCore import vtkLookupTable, vtkVersion from vtkmodules.vtkCommonDataModel import vtkImageData from vtkmodules.vtkImagingCore import vtkImageMapToColors from vtkmodules.vtkRenderingCore import ( vtkImageActor, vtkImageP...
invesalius/invesalius3
invesalius/data/cursor_actors.py
cursor_actors.py
py
11,674
python
en
code
536
github-code
90
20008997241
from logging import NullHandler import requests ''' NOT MY CODE This code comes from https://github.com/ravila4/abebooks/blob/master/abebooks.py ''' def getPriceByISBN(self, isbn): """ Parameters ---------- isbn (int) - a book's ISBN code """ payload = {'action': 'getPricingDataByISBN', ...
DKarneckij/Manga-Helper
func/abebooks.py
abebooks.py
py
1,018
python
en
code
0
github-code
90
18270619709
import sys readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines read = sys.stdin.buffer.read sys.setrecursionlimit(10 ** 7) INF = float('inf') N = int(input()) import collections d = collections.defaultdict(int) for _ in range(N): S = input() d[S] += 1 c = collections.Counter(d) cnt ...
Aasthaengg/IBMdataset
Python_codes/p02773/s719905144.py
s719905144.py
py
479
python
en
code
0
github-code
90
33359359555
# For sum of leaf nodes class Solution: def sumOfLeftLeaves(self, root: TreeNode) -> int: ans = 0 if root: if not root.left and not root.right: ans += root.val else: ans += self.sumOfLeftLeaves(root.left) ans += self.sumOfLeftLe...
Kritika-Suman/Trees
Leet Code - Sum of Left Leaves.py
Leet Code - Sum of Left Leaves.py
py
839
python
en
code
0
github-code
90
34871021120
import numpy as np import pytest import pandas as pd import pandas._testing as tm class BaseGetitemTests: """Tests for ExtensionArray.__getitem__.""" def test_iloc_series(self, data): ser = pd.Series(data) result = ser.iloc[:4] expected = pd.Series(data[:4]) tm.assert_series_...
pandas-dev/pandas
pandas/tests/extension/base/getitem.py
getitem.py
py
15,673
python
en
code
40,398
github-code
90
2601743462
"""server URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-base...
NhatPhan/alumni-portal
portal/urls.py
urls.py
py
1,954
python
en
code
0
github-code
90
71891892777
import pandas as pd import matplotlib.pyplot as plot metadata = pd.read_csv('CSV/Analyze.csv', low_memory=False) font1 = {'color': 'black', 'fontweight': 'bold'} groupByFaction = metadata["Faction"].value_counts() print(groupByFaction) groupByFaction.plot(kind='pie', autopct=lambda x: str(round(x, 2)) + '%') plot...
LoulouChabChab/BigDataOnePiece
stats.py
stats.py
py
2,536
python
en
code
0
github-code
90
42049982837
import speech_recognition as sr import pyttsx3 import pywhatkit listener = sr.Recognizer() engine = pyttsx3.init() voice = engine.getProperty('voices') engine.setProperty("voice", voice[2].id) engine.say('hey, I am your alexa') engine.say('how can i help you , master ' ) engine.runAndWait() def take_command(): ...
vipin-pkd/alexa_yt_play
Alexa.py
Alexa.py
py
925
python
en
code
0
github-code
90
41137876465
import sys n, w = map(int, sys.stdin.readline().split()) wt = [0] v = [0] for _ in range(n): a, b = map(int, sys.stdin.readline().split()) wt.append(a) v.append(b) dp = [[0]*(w+1) for _ in range(n+1)] for i in range(1, n+1): for j in range(1, w+1): if wt[i]<=j: dp[i][j]...
donburi82/ProblemSolving-BOJ
๋ฐฑ์ค€/Gold/12865.โ€…ํ‰๋ฒ”ํ•œโ€…๋ฐฐ๋‚ญ/ํ‰๋ฒ”ํ•œโ€…๋ฐฐ๋‚ญ.py
ํ‰๋ฒ”ํ•œโ€…๋ฐฐ๋‚ญ.py
py
428
python
en
code
0
github-code
90
72559225256
#!/usr/bin/env python # Testing Neopixel and FL3731 patterns from a thread # By Mike Cook November 2019 import Neo_Thread as ws import FL3731_Thread as fl ws.initIO() fl.initI2C() print("To quit just type return") print("To trigger FL3731 threads add 10 to the number you type") print("To stop animations and counts ty...
Grumpy-Mike/Mikes-Pi-Bakery
GraviTrax Part 2/Software/Pattern_Trigger.py
Pattern_Trigger.py
py
712
python
en
code
71
github-code
90
33378009406
print('ะ—ะฐะดะฐั‡ะฐ 5. ะะตะดะพะดะตะปะบะฐ 2') # ะฒะฐะผ ะฝัƒะถะฝะพ ะฑั‹ะปะพ ะฝะฐะฟะธัะฐั‚ัŒ ะบะพะด ะฟะพ ัะปะตะดัƒัŽั‰ะธะผ ัƒัะปะพะฒะธัะผ: # ะฟั€ะพะณั€ะฐะผะผะฐ ะฟะพะปัƒั‡ะฐะตั‚ ะฝะฐ ะฒั…ะพะด ะดะฒะฐ ั‡ะธัะปะฐ. # # ะ’ ะฟะตั€ะฒะพะผ ั‡ะธัะปะต ะดะพะปะถะฝะพ ะฑั‹ั‚ัŒ ะฝะต ะผะตะฝัŒัˆะต ั‚ั€ั‘ั… ั†ะธั„ั€, # ะฒะพ ะฒั‚ะพั€ะพะผ ั‡ะธัะปะต โ€” ะฝะต ะผะตะฝัŒัˆะต ั‡ะตั‚ั‹ั€ั‘ั…, # ะธะฝะฐั‡ะต ะฟั€ะพะณั€ะฐะผะผะฐ ะฒั‹ะดะฐั‘ั‚ ะพัˆะธะฑะบัƒ. # ะ•ัะปะธ ะฒัั‘ ะฝะพั€ะผะฐะปัŒะฝะพ, ั‚ะพ ะฒ ะบะฐะถะดะพะผ ั‡ะธัะปะต ะฟะตั€ะฒะฐั ะธ ะฟะพัะปะตะดะฝัั ั†ะธั„ั€ะฐ ะผะตะฝััŽั‚...
SergKrasilnikov/Skill_python
Python_Basic/ex13/task_5.py
task_5.py
py
3,729
python
ru
code
0
github-code
90
2573396318
# Time Complexity: The time complexity of Dijkstraโ€™s algorithm is O(V^2). This is because the algorithm uses two nested loops to traverse the graph and find the shortest path from the source node to all other nodes. # Space Complexity: The space complexity of Dijkstraโ€™s algorithm is O(V), where V is the number of ve...
FirefoxSRV/The_Code_Colosseum
Data Structures/dijisktra.py
dijisktra.py
py
2,233
python
en
code
0
github-code
90
24481926391
import pygame as pg import os, time from pygame.locals import * WIDTH = 1280 HEIGHT = 720 SIZE = [WIDTH, HEIGHT] TITLE = "SH mini game" WHITE = (255, 255, 255) FRAME = 120 BOX_POS = [150, 0] LINE_WIDTH = 110 def isin(v, a, b): if v > a and v < b: return True return False class set(): # ์ดˆ๊ธฐํ™” ๋ฐ ๋ณ€์ˆ˜ ์ง€์ • ...
yuyu0830/minigame
temp.py
temp.py
py
7,563
python
en
code
0
github-code
90
20097519605
import time import datetime while True: y = input('What year? ') m = input('What month? ') d = input('What day? ') h = input('What hour? ') mi = input('What minute? ') s = input('What second? ') user_date = datetime.datetime(int(y), int(m), int(d), int(h), int(mi), int(s)) today = dat...
QQ-88/Exercise-CountdownClock
countdownClock.py
countdownClock.py
py
626
python
en
code
0
github-code
90
18316882329
N=int(input()) alist=list(map(int,input().split())) slist=[0] for a in alist: slist.append(slist[-1]+a) #print(slist) answer=float("inf") for i in range(N+1): s1=slist[i] s2=slist[-1]-s1 answer=min(answer,abs(s1-s2)) print(answer)
Aasthaengg/IBMdataset
Python_codes/p02854/s066825854.py
s066825854.py
py
245
python
en
code
0
github-code
90
71026292777
import argparse import copy import os class ModuleTypes: executable = "executable" object_lib = "object_lib" shared_lib = "shared_lib" static_lib = "static_lib" interface = "interface" def get_module_target( module_type, name, output, msvc_import_lib=None, compile_flags=None,...
KasperskyLab/BuildMigrator
build_migrator/helpers.py
helpers.py
py
13,678
python
en
code
30
github-code
90
40370758477
import networkx as nx from scipy.stats import entropy #from scipy.stats import histogram import numpy as np import scipy.stats as stats import pylab as plt from collections import Counter graph_names= ['Facebook'] #'facebook','youtube','BlogCatalog''facebook(NIPS)' for graph_name in graph_names: f2= open('%...
fatemehsrz/Shortest_Distance
charts/draw_distribution_chart.py
draw_distribution_chart.py
py
1,891
python
en
code
3
github-code
90
41278579673
import allure from pages.header import Header NEW_PRODUCT = 'new product' @allure.description( """ Test to check "My List" is empty by default Test steps: 1. Open app 2. Click on action menu, choose My List option 3. Check "My List" is empty """) def test_my_list_empty(driver): heade...
arina909/mobile_app_testing_with_appium
my_list_menu_tests.py
my_list_menu_tests.py
py
1,547
python
en
code
0
github-code
90
17563036731
import os from termcolor import colored from .puppet_objects import PuppetObject from .puppet_objects.puppet_case_item import PuppetCaseItem from .puppet_objects.puppet_class import PuppetClass from .puppet_objects.puppet_include import PuppetInclude from .puppet_objects.puppet_resource import PuppetResource from .pu...
Catman155/puppet-tools
puppet_tools/validate.py
validate.py
py
11,416
python
en
code
0
github-code
90
74039295016
import numpy as np from kiam_astro import kiam from kiam_astro.trajectory import Trajectory t0 = 0.0 s0 = [2.0, 0.0, 0.0, 0.0, 1/np.sqrt(2.0), 0.0] s0.extend(list(kiam.eye2vec(6))) s0 = np.array(s0) jd0 = kiam.juliandate(2022, 4, 30, 0, 0, 0) tr = Trajectory(s0, t0, jd0, 'rv_stm', 'gcrs', 'earth') tr.set_model('rv_stm...
oygx210/KIAMToolbox
examples/N-body problem around Earth with variational equations.py
N-body problem around Earth with variational equations.py
py
716
python
en
code
0
github-code
90
71727295658
import csv import os import matplotlib.pyplot as plt import pandas as pd import numpy as np from stock.ultilities import * # from abcd_script.trading_bot.abcd.models.trade import Trade from abcd_script.trading_bot.abcd.models.trade import Trade from...
Rperez1988/abcd_server
stock/views.py
views.py
py
31,863
python
en
code
0
github-code
90
18531078959
N = int(input()) A = list(map(int, input().split())) B = [] C = [] B_append = B.append C_append = C.append #0ใ‚’ใฒใจใพใจใ‚ใซใ™ใ‚‹ count = 0 for a in A: if a != 0: if count != 0: B_append(0) C_append(count) B_append(a) C_append(1) count = 0 else: count += 1 i...
Aasthaengg/IBMdataset
Python_codes/p03340/s473081393.py
s473081393.py
py
927
python
ja
code
0
github-code
90
15182435151
__all__ = ["Process", "ProcessError"] import os import sys import shlex import queue import select import logging import subprocess import collections import threading from itertools import chain from dataclasses import dataclass from typing import Sequence, Mapping def poll(fd: int, stop_event: threading.Event, ...
kaniblu/vhda
utils/process.py
process.py
py
3,475
python
en
code
1
github-code
90
19182040126
from .file import File class Video(File): def __init__( self, file_id: str, file_unique_id: str, width: int, height: int, duration: int ): super().__init__(file_id, file_unique_id) self.width = width self.height = height self.dura...
python23g/telegram-bot
telegram/video.py
video.py
py
422
python
en
code
0
github-code
90
44242978587
import pandas as pd import matplotlib.pyplot as plt path = "/Users/yanchunyang/Documents/datafiles/Rfile/advance/" margin_file = "margin_total.csv" R_metrics_file = "R_metrics_advance_1.csv" margin = pd.read_csv(path + margin_file, header=0) margin = margin.drop(['Unnamed: 0'], axis=1) metrics = pd.read_csv(path + R_...
yanchundave/yanchunprojects
mmm_pystan/robyn_analysis.py
robyn_analysis.py
py
1,829
python
en
code
0
github-code
90
18440781039
n, a, b, c = list(map(int, input().split(' '))) ln = [None] * n for i in range(n): ln[i] = (int(input())) def dfs(i, ap, bp, cp): pattern = [ap, bp, cp] if i >= n and [] not in pattern: mp = 0 for p in pattern: mp += max([0, len(p) - 1]) * 10 mp += abs(a - sum(pattern[0...
Aasthaengg/IBMdataset
Python_codes/p03111/s630445990.py
s630445990.py
py
726
python
en
code
0
github-code
90
33346331884
import urllib.request import random """ =================================================================== This Function is used to load the data from the given URL =================================================================== """ def readFromURL(url, list_items): response = urllib.request.urlopen...
SIBTAIN-ASAD/Python-Bingo-Game
bingo.py
bingo.py
py
10,433
python
en
code
0
github-code
90
34915543387
import librosa import pandas as pd import numpy as np import csv import os from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelEncoder, StandardScaler import keras from scipy import signal from sklearn.neighbors import KNeighborsClassifier from sklearn.ensemble import RandomFore...
19wh1a0576/BVRITHYDERABAD
CSE/CSE Major Projects - 2017_21/Music Genre Classification using ML algorithms/music_genre_classification.py
music_genre_classification.py
py
6,779
python
en
code
0
github-code
90
38177771025
# from database import * from SeraRec.database import * import tqdm import pandas as pd from sklearn.neighbors import NearestNeighbors import numpy as np import collections from PythonSera.settings import BASE_DIR def selectSpecialElement(): connect, curs = connectMySQL() query = """SELECT distinct element_kor...
jihyeong2/PJT-Sera
exec/backend/PythonSera/SeraRec/knn.py
knn.py
py
25,433
python
en
code
1
github-code
90
40921223868
from tests.unit.lib.iml_unit_test_case import IMLUnitTestCase from chroma_core.models import LogMessage, MessageClass class TestLogMessage(IMLUnitTestCase): def test_classification(self): ''' Test the classification code correctly classfies messages. ''' test_messages = {'Lustre:...
GarimaVishvakarma/intel-chroma
chroma-manager/tests/unit/chroma_core/models/test_logmessage.py
test_logmessage.py
py
1,197
python
en
code
0
github-code
90
73530714858
import numpy as np from matplotlib import pyplot as plt import random import sys from scipy.sparse import csr_matrix, csc_matrix from scipy.sparse.linalg import inv from scipy.sparse.linalg import eigs sys.path.append("../util") C = 3e8 class DtN_Solver: def __init__(self, args, wl = 1050e-9, dL=6.25e-9): self....
ChenkaiMao97/MAML_EM_simulation
DDM/solver/DtN_solver.py
DtN_solver.py
py
5,446
python
en
code
3
github-code
90
39899623734
def gemstones(arr): # Complete this function a = "".join(arr) b = [] result = False for i in range(0, len(a)): if a[i] not in b: b.append(a[i]) count=0 for ele in b: for j in arr: if ele in j: result = True else: ...
PramodK929/Hackerrank-soultions
Strings/gem_stones.py
gem_stones.py
py
584
python
en
code
0
github-code
90
23765835019
# Guiding Center 3D integrator (u is projected with u = x' * b) # Specify the absttract method Lagrangian to implement this class from integrators.integrator import Integrator from particleUtils import z2p2 import numpy as np from integrators.explicitIntegratorFactory import explicitIntegratorFactory from particleUtils...
zontafil/guidingcenter-symplectic-python
src/integrators/guidingcenter3D.py
guidingcenter3D.py
py
3,225
python
en
code
1
github-code
90
73100035495
import os, cv2 from utils import coords from utils import ocr from utils import img_processing from picamera import PiCamera def main(): camera = PiCamera() video = cv2.VideoCapture(camera) while(True): ret, frame = video.read() # Our operations on the frame come here gray = cv2....
gtg7784/2020-Sunrin-IoT-Competition
demo.py
demo.py
py
1,376
python
en
code
3
github-code
90
40921005978
import mock import os import time import xmlrpclib from tests.services.supervisor_test_case import SupervisorTestCase class TestStartStop(SupervisorTestCase): """ Generic tests for things that all services should do """ def test_clean_stop(self): clean_services = set(self.programs) ...
GarimaVishvakarma/intel-chroma
chroma-manager/tests/services/test_startstop.py
test_startstop.py
py
1,194
python
en
code
0
github-code
90
6333873825
import bisect # This class is the brick of our hierarchical softmax implementation class Node: def __init__(self, key: int, frequency: int, right_child: "None|Node" = None, left_child: "None|Node" = None) -> None: self.key = key self.frequency = frequency self.rig...
sim2000dg/Word2VecPyNodeTF
pyscript/hierarchical_softmax.py
hierarchical_softmax.py
py
3,397
python
en
code
0
github-code
90
39377255400
import argparse from diaman.configuration.app import AppConfig from diaman.configuration import spark_config from diaman.pipeline import train_pipeline def cli(): """Run the complete application pipeline.""" # Configuration AppConfig() # Parse the cli arguments parser = argparse.ArgumentParser()...
Suraj7860/aidemo
bin/diaman/pipeline/cli.py
cli.py
py
2,482
python
en
code
0
github-code
90
18546038049
import bisect N = int(input()) Xs = list(map(int, input().split())) Ss = sorted(Xs) for i in range(N): j = bisect.bisect_left(Ss, Xs[i]) if j < N//2: print(Ss[N//2]) else: print(Ss[N//2-1])
Aasthaengg/IBMdataset
Python_codes/p03379/s017154868.py
s017154868.py
py
206
python
en
code
0
github-code
90
24906653339
""" Create Kafka topic(s) with 3 partitions and 1 replication factor """ from confluent_kafka.admin import AdminClient, NewTopic a = AdminClient({'bootstrap.servers': 'localhost:29092, localhost:29093'}) # Create a list of Topic objects topics = ["important-topic", "second-topic"] new_topics = [NewTopic(topic, num_...
michaelprice232/kafka-consumer
kafka_create_topic.py
kafka_create_topic.py
py
899
python
en
code
0
github-code
90
8456700779
from flask import Flask from bm25 import BM25 from flask import jsonify, request app = Flask(__name__) @app.route('/help') def help(): return 'This is Help! :D' @app.route('/idf', methods=['GET']) def idf(): word = request.args.get('word') bm25 = BM25() result = dict() result['word'] = word re...
mmsamiei/BS-Project
server.py
server.py
py
582
python
en
code
2
github-code
90
29314697001
from django.urls import path from django.contrib import admin from rango import views from django.conf.urls import url from django.conf.urls import include app_name = 'rango' urlpatterns = [ url(r'^$',views.index,name='index'), path('about/', views.about, name='about'), path('gallery/', views.gallery, na...
suenxw/zooweb
rango/urls.py
urls.py
py
1,310
python
en
code
0
github-code
90