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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
928620310 | from logging import exception
import os
import platform
import random
from selenium import webdriver
import csv
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
import time
import subprocess
#
# get current ... | pranv11/send-bulk-personalized-whatsapp | send.py | send.py | py | 4,452 | python | en | code | 1 | github-code | 13 |
5262923352 | # -*- coding: utf-8 -*-
# Problem Set 3: Simulating robots
# Name: Tuo Sun
# Collaborators (discussion): None
# Time: 4:30
import math
import random
import matplotlib
matplotlib.use("TkAgg")
import ps3_visualize
import pylab
from ps3_verify_movement3 import test_robot_movement
# === Provided class Position
class P... | sunt727/Data-Analysis-by-Python | ps3/ps3.py | ps3.py | py | 19,620 | python | en | code | 0 | github-code | 13 |
35997243786 | from azure.core.exceptions import ResourceNotFoundError
from azure.mgmt.network import NetworkManagementClient
import utils
@utils.Decorator()
def create(cli_args, nsg):
resource_client = NetworkManagementClient(cli_args.credential, cli_args.subscription_id)
async_create = resource_client.virtual_networks.begi... | crodriguezde/reimage | vnet.py | vnet.py | py | 1,591 | python | en | code | 0 | github-code | 13 |
37985659498 | from Digitization.DigitizationFlags import jobproperties
from AthenaCommon.BeamFlags import jobproperties
from AthenaCommon import CfgMgr
from AthenaCommon.AppMgr import ToolSvc, ServiceMgr
# The earliest bunch crossing time for which interactions will be sent
# to the sTGCDigitizationTool.
def sTGC_FirstXing():
... | rushioda/PIXELVALID_athena | athena/MuonSpectrometer/MuonDigitization/sTGC_Digitization/python/sTGC_DigitizationConfig.py | sTGC_DigitizationConfig.py | py | 1,834 | python | en | code | 1 | github-code | 13 |
31412235728 | from fpdf import FPDF
import qrcode
from PIL import Image
import os
import subprocess
from src.PDF_creator.BaseTicket import BaseTicket
class NationalTicket(BaseTicket):
""" Class for ticket from vote to National concil """
def __init__(self,data: dict) -> None:
"""
Constructor for saving vo... | tp17-2021/vt | backend/src/PDF_creator/NationalTicket.py | NationalTicket.py | py | 1,865 | python | en | code | 0 | github-code | 13 |
20905421301 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='MegabetMatchOdds',
fields=[
('id', models.AutoF... | almeynman/arbitragedjangoscrapy | arbitrage_web/matches/migrations/0001_initial.py | 0001_initial.py | py | 1,026 | python | en | code | 0 | github-code | 13 |
23442093802 | import torch
from torch import nn
from torch_scatter import scatter_mean, scatter_max, scatter_add
from torch_scatter.composite import scatter_softmax
from mot_neural_solver.models.mlp import MLP
from mot_neural_solver.models.cnn import CNN, MaskRCNNPredictor
class MetaLayer(torch.nn.Module):
"""
Core Messa... | ocetintas/MPNTrackSeg | src/mot_neural_solver/models/mpn.py | mpn.py | py | 17,463 | python | en | code | 15 | github-code | 13 |
41932763853 | #!/usr/bin/env python3
import re
import requests
def google(keywords):
url = "https://www.google.com/search"
headers = {"User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:106.0) Gecko/20100101 Firefox/106.0"}
return_data = []
for keyword in keywords:
params = {"tbm": "bks", 'q': ke... | bruno-1337/guiagen-spark | trusted_sources/books.py | books.py | py | 1,604 | python | en | code | 0 | github-code | 13 |
19527939362 | from flask_restful import Resource, Api, reqparse
import bcrypt
from flask import Flask, request, Response, jsonify, Blueprint
from bson import json_util
from bson.objectid import ObjectId
import pymongo
import jwt
import datetime
import json
from functools import wraps
from Database.Database import Database as mydb
#... | OmarNashat01/Back-End-Twitter-Clone | Routes/update_user/update_user.py | update_user.py | py | 2,865 | python | en | code | 2 | github-code | 13 |
31288998845 | #!/usr/bin/env python
# coding: utf-8
# ## Description
# This is an acronym generator that produces abbreviations using the first letter of each word in a phrase.
# The first line of the code uses the input function which allows the user to input whatever phrase they want.
# Then an empty string is initialized and sto... | Storerun/acronym_generator | acronym_generator.py | acronym_generator.py | py | 669 | python | en | code | 0 | github-code | 13 |
25938854965 | import sys
from color import Color
#
#
# class Color:
# COLORS = {
# "BLACK": 0,
# "RED":1,
# "GREEN":2,
# "YELLOW":3,
# "BLUE":4
# }
#
# MODES = {
# "FOREGROUND": 3
# }
#
# def __init__(self):
# # "\u001b[31mRed Text\u001b[0m"
# self.... | clairebearz32bit/colors | main.py | main.py | py | 781 | python | en | code | 0 | github-code | 13 |
73874619859 | import os
import numpy as np
def read_file_toList(file, startingLine = 0):
# index i is the i-th line of the file
values = []
with open(file, 'r') as of:
lines = of.readlines()
data = [line.lstrip() for line in lines if line != ""]
for line in data[startingLine:]:
lineVa... | Clegrandlixon/data_itor2023 | generate_tables.py | generate_tables.py | py | 8,530 | python | en | code | 0 | github-code | 13 |
10809673767 | import torch.nn as nn
from torch.nn.utils import clip_grad_norm_
from .basics import *
from .dqn import DQN
MonteCarloUpdateTuple = namedtuple('MonteCarloUpdateTuple', ('state', 'action', 'return_', 'weight'))
class MonteCarloContext(DiscreteRLContext):
def __init__(self, layer_size, soft_is, soft_is_decay, **kw... | streifenfrei/control-force-provider | control_force_provider/src/control_force_provider/rl/monte_carlo.py | monte_carlo.py | py | 9,890 | python | en | code | 1 | github-code | 13 |
15496729574 | ##list##
a=[]
a.append('a') ##****
a.insert(5,'a') ###this will be the latest position ****
a.pop() ##return the last item in the list *****
a.pop(i) ##return i th item in the list
a.sort() ##Modifies a list to be sorted
a.reverse() ##reverse the list
del a[i] ##delete i the element
a.index("a") ##return the... | Jinchili/Leetcode | data structure/basic_o.py | basic_o.py | py | 3,096 | python | en | code | 0 | github-code | 13 |
31955346814 | #有 n 个气球,编号为0 到 n-1,每个气球上都标有一个数字,这些数字存在数组?nums?中。
#现在要求你戳破所有的气球。如果你戳破气球 i ,就可以获得?nums[left] * nums[i] * nums[right]?个硬币。?
#这里的?left?和?right?代表和?i?相邻的两个气球的序号。注意当你戳破了气球 i 后,气球?left?和气球?right?就变成了相邻的气球。
#求所能获得硬币的最大数量。
#来源:力扣(LeetCode)
#链接:https://leetcode-cn.com/problems/burst-balloons
class Solution:
def maxCoins... | Youyouz/testgit | leetcode/pokeBalloons.py | pokeBalloons.py | py | 948 | python | zh | code | 2 | github-code | 13 |
27458296182 | from __future__ import annotations
import os
import numpy as np
from gym.envs.classic_control import rendering
from collections import deque
from typing import Union
from .planet import Planet
from .helpers import angle_to_unit_vector
MAX_SCREEN_SIZE = 600
SHIP_BODY_RADIUS = 15
class Renderer:
def __init__(
... | MIMUW-RL/space-gym | gym_space/rendering.py | rendering.py | py | 7,418 | python | en | code | 6 | github-code | 13 |
2686753199 | ''' Py_unittest.py
Author: BSS9395
Update: 2022-10-23T17:30:00+08@China-Shanghai+08
Design: Python Standard Library: unittest
'''
from To_Test import *
import unittest
class Test(unittest.TestCase):
@classmethod
def setUpClass(cls):
print("=" * 10 + "setUpClass" + "=" * 10)
@classmethod
def t... | bss9395/bss9395.github.io | _en/Computer/Operating_System/Python_Programming/Py_unittest/Py_unittest.py | Py_unittest.py | py | 1,338 | python | en | code | 0 | github-code | 13 |
20883484264 | import datetime
from typing import List
from common.auth import FirebaseAuthentication
from common.logger import StructuredLogger
from discovery.api.schema import FeedItemSchema
from django.db.models import Q
from django.views.decorators import csrf
from episode.models import Episode
from ninja import Router
from ninj... | bluejay9676/moka | moka/discovery/api/v1.py | v1.py | py | 3,267 | python | en | code | 3 | github-code | 13 |
73726270098 | import requests
import time
import logging
logger = logging.getLogger(__name__)
s = requests.Session()
search_url = 'https://inberlinwohnen.de/wp-content/themes/ibw/skript/search-flats.php'
result_url = 'https://inberlinwohnen.de/suchergebnis/'
search_headers = {
'accept': '*/*',
'origin': 'https://inberlin... | benediktkr/wohnen | inberlinwohnen/scraper.py | scraper.py | py | 2,902 | python | en | code | 1 | github-code | 13 |
3188669649 | from gensim.models import word2vec
import pandas as pd
import jieba.posseg as psg
import logging
import os
from nltk.tokenize import WordPunctTokenizer
stopwords = [line.strip() for line in open('eng_stopwords.txt').readlines()]
def preprocess(text):
result = ""
words = WordPunctTokenizer().tokenize(text)
... | GGGWX/Some-Informatics | TopicModeling/eng_wordTovec.py | eng_wordTovec.py | py | 3,042 | python | en | code | 0 | github-code | 13 |
74888825936 | import math
class Solution(object):
def myAtoi(self, str):
str = str.lstrip()
flag = True
result = 0
length = len(str)
times = 1
if len(str) == 0:
return 0
if str[0] == "-":
flag = False
str = str[1:lengt... | jiselectric/leet-code-solutions | stringToInteger.py | stringToInteger.py | py | 1,124 | python | en | code | 0 | github-code | 13 |
27175305389 | import cv2
import numpy as np
from flask import current_app
def rotate(img, angle=0):
"""
Applies angular Rotationn to the input image
Args:
img: Input image to be augmented
angle(float): Angle of Rotation for image
Output:
timg: Roatated Image
Source:
ht... | dsgiitr/BOSCH-TRAFFIC-SIGN-RECOGNITION | utils/augmentations.py | augmentations.py | py | 6,657 | python | en | code | 12 | github-code | 13 |
41249285961 | from django.core.urlresolvers import resolve
from django.test import TestCase, Client
from django.http import HttpRequest
from django.template.loader import render_to_string
from users.models import ServiceUser, ServiceUserManager
from blog.views import post_list, blog_post, post_edit
from blog.models import Post
im... | FadiAlnabolsi/Blog | serviceblog/blog/tests/test_views.py | test_views.py | py | 5,666 | python | en | code | 0 | github-code | 13 |
73924062419 | """"
Learning better flow control
"""
year = int(input("Which year do you want to check? "))
if year % 4 == 0:
if year % 100 != 0 and year % 4 == 0:
print("Leap year.")
else:
print("Not leap year.")
else:
print("Not leap year.")
# ===========================================================... | kvngdre/100DaysofPythonCode | Day3.py | Day3.py | py | 3,820 | python | en | code | 0 | github-code | 13 |
37875428782 | import time
import openpyxl
from selenium import webdriver
from openpyxl import load_workbook
from selenium.webdriver.common.by import By
from selenium.webdriver import ActionChains
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from selenium.webdriver.support.u... | unnamed-idea/scrapper-yok_tez_extract | scrapper_ilk.py | scrapper_ilk.py | py | 6,937 | python | en | code | 0 | github-code | 13 |
26925337336 | class Solution:
def merge(self, intervals: List[List[int]]) -> List[List[int]]:
intervals.sort()
ans = []
index = 0
while index < len(intervals):
a = intervals[index]
if index == len(intervals) - 1:
ans.append(a)
break
... | hwngenius/leetcode | learning/merge_intervals/56.py | 56.py | py | 977 | python | zh | code | 1 | github-code | 13 |
35514125355 | import numpy as np
import torch
import torch.nn as nn
from easydict import EasyDict
import os
import sys
src_dir = os.path.dirname(os.path.realpath(__file__))
while not src_dir.endswith("AR3D"):
src_dir = os.path.dirname(src_dir)
if src_dir not in sys.path:
sys.path.append(src_dir)
from utils.a... | weiyangdaren/ER3D | model/det_head.py | det_head.py | py | 4,161 | python | en | code | 0 | github-code | 13 |
23185699145 | import pandas as pd
'''
@alt(表データ=[データフレーム|データフレーム|表[データ|]])
@alt(カラム=[列|列|カラム])
@alt(インデックス|行)
@alt(欠損値|NaN|未入力値)
@alt(変更する|増やす|減らす)
@alt(抽出する|取り出す|[選択する|選ぶ])
@alt(全ての|すべての|全)
@alt(の名前|名)
@alt(の一覧|一覧|[|の]リスト)
@prefix(df;[データフレーム|表データ])
@prefix(ds;[データ列|データフレームの[列|カラム]])
@prefix(column;[列|カラム];[列|カラム])
@prefix(value;[... | KuramitsuLab/multiese | new_corpus/_pandas_groupby.py | _pandas_groupby.py | py | 3,498 | python | ja | code | 1 | github-code | 13 |
73859750738 | """Add error column to swaps
Revision ID: 92f28a2b4f52
Revises: 9b8ae51c5d56
Create Date: 2021-08-17 03:46:21.498821
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "92f28a2b4f52"
down_revision = "9b8ae51c5d56"
branch_labels = None
depends_on = None
def upgrad... | flashbots/mev-inspect-py | alembic/versions/92f28a2b4f52_add_error_column_to_swaps.py | 92f28a2b4f52_add_error_column_to_swaps.py | py | 459 | python | en | code | 750 | github-code | 13 |
34341129142 | import school_scores
lists = school_scores.get_all()
#1st element in data set
#print(lists)
#print(lists[0])
#each state and year
#for i in range(len(lists)):
#print(lists[i]["State"])
#print(lists[i]["Year"])
#same, but for each row
#for row in lists:
#info = row["State"]
#print(info[... | jjefferson34/projects | projects/schoolscores/schoolscores.py | schoolscores.py | py | 578 | python | en | code | 0 | github-code | 13 |
1949397494 | import pytest
from os import environ
@pytest.fixture(autouse=True)
def env_setup(monkeypatch):
if environ.get('GOM_GITHUB_TOKEN') is None:
monkeypatch.setenv('GOM_GITHUB_TOKEN', 'some-fake-token-123456')
if environ.get('GOM_ORG') is None:
monkeypatch.setenv('GOM_ORG', 'tinwhiskersband')
@pyte... | ianchesal/github-organization-manager | tests/conftest.py | conftest.py | py | 517 | python | en | code | 0 | github-code | 13 |
26925245876 | from typing import List
class Solution:
def findMin(self, nums: List[int]) -> int:
l,r=0,len(nums)-1
if nums[l]<=nums[r]:return nums[l]
while l<=r:
mid=(l+r)//2
if nums[mid+1]<nums[mid]:return nums[mid+1]
if nums[mid-1]>nums[mid]:return nums[mid]
... | hwngenius/leetcode | learning/Modified_Binary_Search/153.py | 153.py | py | 567 | python | zh | code | 1 | github-code | 13 |
9209658987 | import base64
import hashlib
import hmac
import json
import os
import time
import requests
lfasr_host = 'http://raasr.xfyun.cn/api'
# 请求的接口名
api_prepare = '/prepare'
api_upload = '/upload'
api_merge = '/merge'
api_get_progress = '/getProgress'
api_get_result = '/getResult'
# 文件分片大小10M
file_piece_sice = 10485760
# —... | hzeyuan/100-Python | lol语音转文字.py | lol语音转文字.py | py | 8,952 | python | en | code | 8 | github-code | 13 |
29860826649 |
from distutils.core import setup
from iterutils import iterutils_version
classifiers = [
'Development Status :: 4 - Beta',
'Natural Language :: English',
'Programming Language :: Python :: 2.6',
'Topic :: Software Development :: Libraries :: Python Modules']
# This seems like a stan... | argriffing/iterutils | setup.py | setup.py | py | 800 | python | en | code | 3 | github-code | 13 |
42659483394 | import socket
skt = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
host = '127.0.0.1'
port= 4500
str= input('Give the value to be encrypted --> \n')
temp = input('Give the value to encrypt --> \n')
def generateKey(string, key):
key = list(key)
if len(string) == len(key):
return(key)
else:
... | AatirNadim/Socket-Programming | vigenere_cipher_v2/client.py | client.py | py | 1,135 | python | en | code | 0 | github-code | 13 |
1472998304 | from django.contrib.auth import get_user_model
from django.contrib.auth.forms import UserCreationForm
from django import forms
from SU_Transportation.accounts.models import SuUser
user_model = get_user_model()
class SuUserCreateForm(UserCreationForm):
class Meta(UserCreationForm):
model = user_model
... | Mihail0708/SU_Transport_inc | SU_Transportation/accounts/forms.py | forms.py | py | 774 | python | en | code | 0 | github-code | 13 |
25041245109 | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Use pretrained networks to detect cells in the images.
https://www.pyimagesearch.com/2017/09/11/object-detection-with-deep-learning-and-opencv/
First create a new train data, where each data point represent only ONE cell.
This data is programmatically generated usin... | tylerhslee/kaggle2018 | main.py | main.py | py | 2,881 | python | en | code | 0 | github-code | 13 |
28076971980 | import os
import torch
import torchvision
from torch import nn
from torch.utils.data import DataLoader
from torchvision.transforms import ToTensor
import torch.nn.functional as F
from ml.models.MNIST import MNIST
# class Network(nn.Module):
# def __init__(self):
# super().__init__()
#
# # define layers
# ... | ThomasWerthenbach/Sybil-Resilient-Decentralized-Learning | scripts/MNIST_trainer.py | MNIST_trainer.py | py | 3,263 | python | en | code | 0 | github-code | 13 |
19119121340 | # Input system to ask for heads or tails
# match user action for "heads" or "tails" response
# store the two words into variables and assign them
# stores the heads or tails in a .txt file
# the test is calculated based on the amount of times head is counted
while True:
with open("sides.txt", "r") as file:
... | akira-kujo/python101 | assessments/exercise8.py | exercise8.py | py | 732 | python | en | code | 0 | github-code | 13 |
72423644178 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operat... | LEDS/jediteca | jediteca/emprestimo/migrations/0001_initial.py | 0001_initial.py | py | 1,319 | python | en | code | 0 | github-code | 13 |
5615808224 | from chainer import training
import chainer.functions as F
import chainer.links as L
from chainer import Chain
from chainer import datasets, iterators, optimizers
from chainer import training
from chainer.training import extensions
train, test = datasets.mnist.get_mnist()
batchsize = 128
train_iter = iterators.Seria... | hackmylife/ml-study | flameworks/chainer/mnist.py | mnist.py | py | 1,352 | python | en | code | 0 | github-code | 13 |
25889012052 | from django.shortcuts import get_object_or_404
from rest_framework import status
from rest_framework.response import Response
from rest_framework.views import APIView
from webapp.models import Tracker
from api.serializers import TrackerSerializer
from webapp.models import Project
from api.serializers import Project... | Novel1/homework_70_desyatskii_roman | source/api/views.py | views.py | py | 1,733 | python | en | code | 0 | github-code | 13 |
26039945350 | """
Created on May 23rd, 2021
This script handles the GET and POST requests to the register API endpoint http://localhost:8000/api/places/
'GET':
Returns the html for the search form.
'POST':
Using the location information provided by the user, first connects to the Google's Geocode API
... | bounswe/2021SpringGroup4 | practice-app/api/places/places.py | places.py | py | 3,106 | python | en | code | 2 | github-code | 13 |
34005530314 | from agenda.Agenda import Agenda
agenda = Agenda()
dados = {}
dados['loja'] = 'Lojas XYZ'
dados['cnpj'] = '123456879'
dados['inicio_dia'] = '20'
dados['inicio_mes'] = '4'
dados['inicio_ano'] = '2022'
dados['inicio_hora'] = '8'
dados['inicio_minuto'] = '30'
dados['erp'] = 'ERP1'
dados['tempo_estimado'] = 60
dados['pro... | orlandosaraivajr/agenda | main.py | main.py | py | 2,415 | python | pt | code | 0 | github-code | 13 |
26952804833 | import cv2
import threading
import numpy as np
import time
import os
import camera
import counter
class VideoRecorder:
def __init__(self, width, height, brightness, contrast, saturation, hue, gain, exposure, gamma, backlight, temperature, sharpness):
self._running = True
self.width = width
self.height = height... | euxcet/record | backend/record.py | record.py | py | 1,812 | python | en | code | 0 | github-code | 13 |
71876016657 | """
This module takes care of starting the API Server, Loading the DB and Adding the endpoints
"""
import os
from flask import Flask, request, jsonify, url_for, json
from flask_migrate import Migrate
from flask_swagger import swagger
from flask_cors import CORS
from utils import APIException, generate_sitemap
from admi... | Binkitubo/Rick-And-Morty-REST-API | src/main.py | main.py | py | 9,806 | python | en | code | 0 | github-code | 13 |
20451628978 | #%%importiamo le librerie
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.preprocessing import MinMaxScaler
from keras.models import Sequential
from keras.layers import LSTM, Dense, Dropout, Flatten, Bidirectional
from sklearn.cluster import KMeans
#%%carichiamo il file e diamogli u... | Hitomamacs/Web1 | cazzate/Terromoti/Rete.py | Rete.py | py | 7,188 | python | it | code | 0 | github-code | 13 |
9024299157 | #!/usr/bin/env python3
from flask import Flask, request, render_template, Response
import os, pickle, base64
from flask_limiter.util import get_remote_address
from flask_limiter import Limiter
app = Flask(__name__)
app.secret_key = os.urandom(32)
INFO = ['name', 'username', 'password']
limiter = Limiter(
get_rem... | giangnamG/CTF-WriteUps | CookieArenaCTFWriteUps/Escape the session/source.py | source.py | py | 1,625 | python | en | code | 1 | github-code | 13 |
39448997985 | import pandas as pd
import requests
from bs4 import BeautifulSoup
def get_sp500_details():
wikiurl="https://en.wikipedia.org/wiki/List_of_S%26P_500_companies"
table_class="wikitable sortable jquery-tablesorter"
response=requests.get(wikiurl)
soup = BeautifulSoup(response.text, 'html.parser')
sp500=... | tallalUsman/NLP_alternative_googlenews_reddit_data | data_get_sp500.py | data_get_sp500.py | py | 501 | python | en | code | 0 | github-code | 13 |
11510512823 | #!/usr/bin/env python
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "lib"))
import dns.resolver
from dns import reversename
from collections import OrderedDict
from splunklib.searchcommands import \
dispatch, StreamingCommand, Configuration, Option, validators
resolver =... | seunomosowon/SA-dnslookup | bin/dnslookup.py | dnslookup.py | py | 4,810 | python | en | code | 0 | github-code | 13 |
18788950824 | from transcoding_cluster import task
from .task_view import TaskHumanView, TaskJsonView
from .task_list_view import TaskListListView, TaskListJsonView, TaskListTableView
class TaskManager( object ):
def __init__(self, client):
self.client = client
self.task = None
def loadTask( self, ... | ObviusOwl/transcoding-cluster | transcoding_cluster_cli/task_manager.py | task_manager.py | py | 2,542 | python | en | code | 0 | github-code | 13 |
36294911301 | import json, os, argparse, time
import numpy as np
from numpy import append
import torch
from utils.train import train_iter, save_model_ckp, validate
from utils.general import get_optimizer, get_scheduler, build_model, set_device, seed_everything, get_loss_func, initialize_epoch_info, load_dict
from utils.plots impor... | shoopshoop/OMC | models/swin_pyramid/main_train_swin.py | main_train_swin.py | py | 6,420 | python | en | code | 2 | github-code | 13 |
20215048755 | #-*- coding: utf-8 -*-
#word2vec.py
#this script uses gensim library to implement word2vec algorithm
import os
import re
import locale
from collections import Counter
import numpy as np
import gensim
#iteration class which will be used to train word2vec algorithm. Returns sentences as a list of words
class SentenceIt... | semihakbayrak/ConvolutionalNeuralNetworks | word2vec.py | word2vec.py | py | 1,975 | python | en | code | 2 | github-code | 13 |
15039289798 | from django.shortcuts import render
from funciones import analiticas, productos_por_categoria
# Create your views here.
def categoriaBuscada(request):
top5 = analiticas()
categorias = ["Electronicos", "Electrodomesticos", "Hogar"]
if request.method == 'POST':
categoria = request.POST.get("categori... | msosav/Lookup | categorias/views.py | views.py | py | 583 | python | es | code | 2 | github-code | 13 |
35511123226 | import time
start_time = time.time()
md={}
def comb(n,k):
if (n,k) in md:
return md[(n,k)]
if n==0:
if k ==0:
return 1
else:
return 0
if n <k:
return 0
ret = comb(n-1,k-1)+comb(n-1,k)
md[(n,k)]=ret
return ret
print(comb(700,100))
print (ti... | rui1/leetcode | combination.py | combination.py | py | 355 | python | en | code | 0 | github-code | 13 |
18274192336 | #!/usr/bin/env python
import os
def install(alsi):
remote_cfr = 'cfr/cfr.jar'
local_cfr = os.path.join(alsi.alroot, 'support/cfr/cfr.jar')
alsi.fetch_package(remote_cfr, local_cfr)
alsi.install_oracle_java8()
alsi.milestone("Espresso install complete.")
if __name__ == '__main__':
from assemb... | deeptechlabs/cyberweapons | assemblyline/alsvc_espresso/installer.py | installer.py | py | 388 | python | en | code | 78 | github-code | 13 |
46108614944 | from __future__ import print_function
import os
import subprocess
class CommandExecutor(object):
filename = None
def __init__(self, exepath):
if not exepath:
self.exe = self._find_default_exepath()
self.root = os.path.dirname(self.exe)
elif self._matches_and_isfile(exe... | garytyler/maxpytest | maxpytest/maxcom.py | maxcom.py | py | 3,413 | python | en | code | 6 | github-code | 13 |
34892369422 | __author__ = 'spotapov'
def count_units(number):
n=0
R=0
bin_num = bin(number)
print (bin_num)
for i in bin_num:
if i == "b":
print("nothing")
else:
i = int(i)
#print(i)
if i == 1:
R = R+1
n = n +1
#print(n)
... | sergiypotapov/EoC | Mission1.py | Mission1.py | py | 366 | python | en | code | 0 | github-code | 13 |
26995465443 | import crypto_helpers as cr
def crypto_caesar(message,shift):
'''
Returns given message shifted by
given number of characters along alphabet
(str,int)-->str
>>>crypto_caesar("klm",-10)
'abc'
>>> crypto_caesar("cats and dogs",4)
'gexw erh hskw'
>>> crypto_caesar("cow!!!",4)... | mgraiver/ciphers | ciphers.py | ciphers.py | py | 3,772 | python | en | code | 0 | github-code | 13 |
36325768105 | import os
from collections import Counter
from multiprocessing import Pool
from PlatformNlp import utils
class Dictionary(object):
"""A mapping from symbols to consecutive integers"""
def __init__(
self,
*, # begin keyword-only arguments
begin="[CLS]",
pad="[PAD]",
s... | jd-aig/aves2_algorithm_components | src/nlp/PlatformNlp/data/dictionary.py | dictionary.py | py | 4,770 | python | en | code | 2 | github-code | 13 |
32561600092 | import socket
import os
import subprocess
import glob
s = socket.socket()
#host=raw_input("enter the host address")
host = '167.172.235.115'
#host='192.168.0.7'
#host="192.168.43.244"
port = 9899
s.connect((host, port))
print("connected")
def filer():
os.chdir("/home/pratik/Desktop/test")
filename=raw... | bhavika022/Antivirus-Software-with-VPN | client.py | client.py | py | 1,430 | python | en | code | 0 | github-code | 13 |
25746592780 | # coding=utf-8
"""
Created on 2017-07-14
@Filename: requests_toolbelt_demo
@Author: Gui
"""
import requests
from requests_toolbelt.multipart.encoder import MultipartEncoder
multipart_data = MultipartEncoder(
fields={
# a file upload field
'file1': ('file.py', open(r'..\files\笔记.xls', 'rb... | gy890/ep_test | tmp/requests_toolbelt_demo.py | requests_toolbelt_demo.py | py | 869 | python | en | code | 0 | github-code | 13 |
33081698040 | class Solution:
def longestPalindrome(self, s: str) -> str:
if len(s) == 0: return ""
max_length = 0
max_left = None
max_right = None
for i in range(len(s)):
left = i
right = i
while left-1>=0 and right+1 <= len(s)-1:
if s[l... | LNZ001/Analysis-of-algorithm-exercises | leetcode_ex/ex5-最长回文子串.py | ex5-最长回文子串.py | py | 1,133 | python | en | code | 0 | github-code | 13 |
32111458078 | # Import a library of functions called 'pygame'
import pygame
import random
# Initialize the game engine
pygame.init()
BLACK = [0, 0, 0]
WHITE = [255, 255, 255]
# Set the height and width of the screen
display_width = 800
display_height = 600
screen = pygame.display.set_mode((display_width,display... | HightopJamal/Python | Bug Game/starScroller.py | starScroller.py | py | 1,901 | python | en | code | 0 | github-code | 13 |
35975906891 | import tensorflow as tf
import os
import numpy as np
from housing_3_minibatch_saver_tensorboard import reset_graph
## hiding warnings
tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR)
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
##data for file managment
from datetime import datetime
now = datetime.utcnow()... | MateuszKozakGda/My-Data-Science-repository | Tensorflow Sandbox/Simple Examples/modulowosc1.py | modulowosc1.py | py | 1,165 | python | en | code | 0 | github-code | 13 |
14645584085 | from sqlalchemy import Column, Identity, Integer, Table
from . import metadata
DeletedExternalAccountJson = Table(
"deleted_external_accountjson",
metadata,
Column("id", Integer, primary_key=True, server_default=Identity()),
)
__all__ = ["deleted_external_account.json"]
| offscale/stripe-sql | stripe_openapi/deleted_external_account.py | deleted_external_account.py | py | 285 | python | en | code | 1 | github-code | 13 |
7321004695 | import random
rock = '''
_______
---' ____)
(_____)
(_____)
(____)
---.__(___)
'''
paper = '''
_______
---' ____)____
______)
_______)
_______)
---.__________)
'''
scissors = '''
_______
---' ____)____
______)
__________)
(____)
... | sugengpriyanto/rock-paper-scissors | main.py | main.py | py | 1,013 | python | en | code | 0 | github-code | 13 |
852611674 | #!/bin/python3.6
import subprocess,sys, os
from etcdgetpy import etcdget as get
from etcdput import etcdput as put
from broadcasttolocal import broadcasttolocal
from socket import gethostname as hostname
def delcifs(*args):
vol = args[0]
ipaddr = args[1]
cmdline = 'docker ps -f volume='+vol
print(cmdline)
do... | YousefAllam221b/TopStorDevOld | VolumeDockerChange.py | VolumeDockerChange.py | py | 940 | python | en | code | 0 | github-code | 13 |
14792904523 | from kubernetes import client, config
def main():
config.load_kube_config()
api_instance = client.ExtensionsV1beta1Api()
dep = client.ExtensionsV1beta1Deployment()
container = client.V1Container(name="pocket-datanode-dram", image="anakli/pocket-datanode-dram", ports=[client.V1ContainerPort(contain... | anakli/pocket-controller | kubernetes/modify_datanode_deployment.py | modify_datanode_deployment.py | py | 943 | python | en | code | 0 | github-code | 13 |
24749057393 | from pymatgen.core import Structure
import numpy as np,os, pandas as pd,sys, shutil
import matplotlib.pyplot as plt
from elastemp.base.strain_analysis import get_curvature,check_convergence,get_energy_volume,fit_parabola_bulk,plot_parabola
from elastemp.base.symmetry import get_symmetry,get_num_constants
from elastemp.... | Karthik-Balas/elastemp | elastemp/input/make_dynamic_input.py | make_dynamic_input.py | py | 11,922 | python | en | code | 2 | github-code | 13 |
42232427256 | #import recog_value
import cv2
def capture():
# image_quality = int(input("画質を選択=> 0: 最高, 1: 通常, 2: 低画質 = "))
img_size = [[3200, 1800], [1920, 1080], [1280, 960]]
cap = cv2.VideoCapture(0)
if not cap.isOpened():
return
# cap.set(cv2.CAP_PROP_FRAME_WIDTH, img_size[1][0])
... | kolbe-ryo/RecognitionVal | camera.py | camera.py | py | 508 | python | en | code | 0 | github-code | 13 |
32043460449 | from functools import partial
import elasticsearch
from models import v1, v2
es = elasticsearch.Elasticsearch(['leetroutwrw2-9200.terminal.com:80'])
# ES partials
es_search = partial(es.search, index="pizzas")
es_get_customer = partial(es.get, index="pizzas", doc_type="customer")
es_get_pizza = partial(es.get, inde... | leetrout/escapnprotojunk | giovannis.py | giovannis.py | py | 1,293 | python | en | code | 0 | github-code | 13 |
71549591378 | import sys
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
class FormPendaftaran(QWidget):
def __init__(self):
super().__init__()
self.setupUi()
def setupUi(self):
self.resize(350, 200)
self.move(300, 300)
self.setWindowTitle('Form Pendaftaran')
self... | erpambudi/Pemrograman-GUI | Challange/FormPendaftaran.py | FormPendaftaran.py | py | 2,901 | python | en | code | 0 | github-code | 13 |
17314911334 | # -*- coding:utf-8 -*-
"""
__title__ = ''
__author__ = 'Administrator'
__time__ = '2018/6/7'
"""
from shapely.geometry import MultiPoint
from shapely.geometry import Point
import numpy as np
import pandas as pd
out_df = pd.DataFrame()
data = pd.read_csv('outPut/6MonthIMOxibo-singaporePOI', header=None)
da... | Jondamer/MarineTraffic | python/泊位提取相关/按照簇号生成多个文件.py | 按照簇号生成多个文件.py | py | 699 | python | en | code | 0 | github-code | 13 |
27311933183 | ''' Contains functions for the logic needed to run the GUI of the application '''
import PySimpleGUI as sg
import os
from typing import List, AnyStr
from playsound import playsound
from utils.real_time_voice_cloning import main_tts
def filter_voice_sample_file_names(voice_sample_dir: AnyStr) -> List:
'''
Giv... | stephenhgregory/ReadToMe | ReadToMeApp/scripts/utils/gui_logic.py | gui_logic.py | py | 6,162 | python | en | code | 0 | github-code | 13 |
7831432190 | import socket
import environ
from ..django import DATABASES, INSTALLED_APPS, TESTING
from ..third_party.aws import AWS_S3_CUSTOM_DOMAIN
from ..third_party.sentry import SENTRY_REPORT_URI
env = environ.FileAwareEnv()
DEVELOPMENT = env.bool("DEVELOPMENT", default=True)
ALLOWED_HOSTS: list[str] = env(
"ALLOWED_HOS... | freelawproject/courtlistener | cl/settings/project/security.py | security.py | py | 3,874 | python | en | code | 435 | github-code | 13 |
38658103012 | # -*- coding: cp936 -*-
"""
Created on Fri Apr 24 16:05:13 2015
@author: shuaiyi
"""
# from sklearn.base import BaseEstimator
from sklearn.base import TransformerMixin
import numpy as np
import cv2
class SiftFeature(TransformerMixin):
"""
extract sift desc;
input is a img patch: size = 16*... | understar/CNN-detection-tracking | LULC/sift.py | sift.py | py | 1,985 | python | en | code | 26 | github-code | 13 |
37438755790 |
# time: o(n) ; space: o(n)
def maxSubsetSumNoAdjacent_sol1(array):
# Write your code here.
dp = array[:]
if not len(array):
return 0
elif len(array) == 1:
return array[0]
dp[1] = max(dp[0], dp[1])
for i in range(2,len(array)):
dp[i] = max(dp[i-1], dp[i-2] + array[i])
... | robinfelix25/DSA-with-python | Blind75/Dynamic_Programming/AlgoExpert/max_sum_non_adjacent.py | max_sum_non_adjacent.py | py | 819 | python | en | code | 0 | github-code | 13 |
3022180066 | from sys import *
from time import *
def chrput(c=0):
l=True
i=138
stdout.write(" ")
while l:
stdout.write("\b"+chr(i)+chr(131)+"\b")
g=getkey()
if g==" [A":
if i<255:
i+=1
if i==143:
i=162
elif g==" [B":
if i>=34:
i-=1
if i==161:
i=142
... | Manerr/TI-PYTHON-KEYPAD-LIBRARY | old_version_TIKEYLIB.py | old_version_TIKEYLIB.py | py | 1,284 | python | en | code | 0 | github-code | 13 |
16447738825 | from graph import Graph
from tarjans_biconnectivity import TarjansBiconnectivity
from polynomial_time_algorithm import PolynomialTimeAlgorithm
from graph_parser import GraphParser
import sys
def main(argv):
file_path = None
num_of_vertices = None
num_of_edges = None
edges = None
AT_free_graph = ... | DimitrisSintos/AT-Free-Graphs_3-Colouring | src/main.py | main.py | py | 1,053 | python | en | code | 0 | github-code | 13 |
30589577322 | # paura_lite:
# An ultra-simple command-line audio recorder with real-time
# spectrogram visualization
import numpy as np
import pyaudio
import struct
import scipy.fftpack as scp
import termplotlib as tpl
import os
# get window's dimensions
rows, columns = os.popen('stty size', 'r').read().split()
buff_size = 0.2 ... | tyiannak/paura | paura_lite.py | paura_lite.py | py | 2,191 | python | en | code | 209 | github-code | 13 |
31234020539 | # -*- coding: utf-8 -*-
"""
Feature Extraction
Christian Rodriguez
crodriguez0874@gmail.com
07/10/19
Summary - In this script, we try multiple dimension reduction methods on the
base stats of the pokemon (HP, Attack, Sp. Attack, Defense, Sp. Defense,
Speed). The methods implemented are PCA, polynomial-kernal PCA, RB... | crodriguez0874/Legendary-Pokemon | Feature_Extraction/Feature_Extraction.py | Feature_Extraction.py | py | 20,921 | python | en | code | 0 | github-code | 13 |
27542342545 | """Contains transformer configuration information
"""
# The version number of the transformer
TRANSFORMER_VERSION = '2.1'
# The transformer description
TRANSFORMER_DESCRIPTION = 'PLY to LAS conversion'
# Short name of the transformer
TRANSFORMER_NAME = 'terra.3dscanner.ply2las'
# The sensor associated with the tran... | AgPipeline/transformer-ply2las | configuration.py | configuration.py | py | 805 | python | en | code | 0 | github-code | 13 |
73210186898 | from fractions import Fraction
from sys import stdin, stdout
def main():
[n, q] = [int(z) for z in stdin.readline().split(' ')]
temp = {}
for i in range(n):
[a, b] = [int(z) for z in stdin.readline().split(' ')]
temp[i + 1] = (a, b)
for _ in range(q):
[a, b, c] = [int(z) for z in stdin.readline().split('... | heiseish/Competitive-Programming | kattis/set9/thermostat.py | thermostat.py | py | 632 | python | en | code | 5 | github-code | 13 |
2346261073 | import collections
from babel.messages import pofile
import cStringIO
import copy
import errno
import os
import shutil
import tempfile
import zipfile
default_external_to_babel_locales = collections.defaultdict(list)
builtin_locales = {
'en-GB': 'en_GB',
'es-419': 'es_419',
'fr-CA': 'fr_CA',
'iw': 'he_... | Yzupnick/grow | grow/pods/importers.py | importers.py | py | 4,929 | python | en | code | null | github-code | 13 |
20533380765 | import crypt
import base64
import json
import datetime
import logging
import uuid
from testrunner import testcase
from testutils import mock
from conary import conarycfg
from upsrv import config, app, db
from upsrv.views import records
class DatabaseTest(testcase.TestCaseWithWorkDir):
def testMigrate(self):
... | sassoftware/rbm | upsrv_test/record_test.py | record_test.py | py | 16,697 | python | en | code | 1 | github-code | 13 |
33641185953 | #!/usr/bin/python3
# https://www.hackerrank.com/challenges/python-division/problem
# Task
# Read two integers and print two lines. The first line should contain integer division, a//b. The second line should contain float division, a/b.
# You don't need to perform any rounding or formatting operations.
def division(a,... | nasaa0528/hackerRank | Python/Introduction/pythonDivision.py | pythonDivision.py | py | 431 | python | en | code | 0 | github-code | 13 |
31532825735 | import importlib
import operator
from django.utils.html import format_html
def tuple_index_elements(theset, elemnum=1):
"""gets tuple of each element(default=1)
within nested list/tuple/etc of lists/tuples
"""
get = operator.getitem
return tuple([get(get(theset,each),elemnum)
for ... | cometsong/jaxid_generator | generator/utils.py | utils.py | py | 3,910 | python | en | code | 2 | github-code | 13 |
14277723796 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program 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 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | Tilapiatsu/blender-custom_config | scripts/addon_library/local/uvpackmaster3/box_utils.py | box_utils.py | py | 10,137 | python | en | code | 5 | github-code | 13 |
15224673728 | import typing
import re
import logging
from collections import namedtuple
from urllib.parse import urljoin, quote, unquote, urlsplit, urlunsplit
import lxml.etree
import lxml.html
from lxml.html import soupparser
from lxml.html.defs import safe_attrs as lxml_safe_attrs
from lxml.html.clean import Cleaner
from readabil... | s1368816131/PY-rssant | rssant_feedlib/processor.py | processor.py | py | 20,320 | python | en | code | 1 | github-code | 13 |
20659762434 | import numpy as np
import math
from sklearn.naive_bayes import GaussianNB
from sklearn.discriminant_analysis import QuadraticDiscriminantAnalysis
from teste import gaussClf
class NaiveBayesGaussiano():
def __init__(self):
self.medias = {}
self.variancias = {}
def separar_classes(self, X, y):
... | brunopinho321/ML_Codigos | NaiveBayes/naive_bayes.py | naive_bayes.py | py | 3,590 | python | en | code | 0 | github-code | 13 |
15396459823 | from BaseHandler import BaseHandler, authenticated
from orm import QuestionNaireInfoTable
from typing import Text
import json
import datetime
from config import DEBUG
import time
class UserQuestionnaireListHandler(BaseHandler):
@authenticated
async def get(self, *args, **kwargs):
# 获取当前用户问卷列表
... | Wh1isper/QuestionnaireSystemBackend | APIHandler/UserQuestionnaire/UserQuestionnaireHandler.py | UserQuestionnaireHandler.py | py | 1,679 | python | en | code | 4 | github-code | 13 |
327300591 | import matplotlib
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(0.0, 2.0, 0.01) # data for plotting
y = 1 + np.sin(x)
fig, ax = plt.subplots()
ax.plot(x, y)
ax.set(xlabel='time (s)', ylabel='1+sin(x)', title='basic matplotlib example')
ax.grid()
fig.savefig("example1.png")
plt.show()
| grexor/python-plotting-tutorial | examples/example1.py | example1.py | py | 308 | python | en | code | 0 | github-code | 13 |
29523481815 | import csv
import os
from googletrans import Translator
INPUT_DIR = 'csvs'
OUTPUT_DIR = 'csvs'
COLUMN_LIST = ['fath', 'name']
INPUT_LANGUAGE = 'hindi'
class GoogleTranslator:
def __init__(self,
input_file=None,
output_file=None,
column_list=COLUMN_LIST,
... | in-rolls/table_cell_level_translator | google_translator.py | google_translator.py | py | 3,913 | python | en | code | 1 | github-code | 13 |
27632715680 | import cv2
import time
import numpy as np
from HandTrackingModule import HandDetector
from face_detection_video import FaceDetection
kernel = np.ones((5, 5), np.uint8)
wCam, hCam = 1280, 720
cap = cv2.VideoCapture(1)
cap.set(3, wCam)
cap.set(4, hCam)
detector = HandDetector(detectionCon=0.8, maxHands=2)
while cap.... | benanxio/HANDFACE | Principal_HF.py | Principal_HF.py | py | 2,297 | python | en | code | 0 | github-code | 13 |
1945010019 | pos = input()
#(수평 수직) 움직일 수 있는 모든 경우의 수
move = [[1, 2], [1, -2], [-1, 2], [-1, -2], [2, 1], [2, -1], [-2, 1], [-2, -1]]
x_a = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
row = x_a.index(pos[0]) # index를 활용해 좌표 찾기
col = int(pos[1]) - 1
count =0
for i in move:
dx = row + i[0]
dy = col + i[1]
#범위 체크
if d... | wndjs803/Algorithm_with_Python | Implementaion/knight.py | knight.py | py | 480 | python | ko | code | 0 | github-code | 13 |
24283259685 | from dataclasses import dataclass
from datetime import datetime
from typing import List
from models.errors import BaseError
import psycopg2
from contextlib import contextmanager
from config import conf
connection_info = {
'database': conf.db.database,
'user': conf.db.user,
'password': conf.db.password,
... | whisust/jellynote-backend | api/persist/__init__.py | __init__.py | py | 2,343 | python | en | code | 1 | github-code | 13 |
3371901581 | '''
#not all test cases pass- 310 out 0f 313 passed- O(n**3)
resultList = list()
nums = sorted(nums)
print(nums)
for i in range(0,len(nums)):
loopVar1 = i + 1
for j in range(loopVar1, len(nums)):
loopVar2 = j + 1
for k in range(loopVar2, le... | akshayyd/ltcSolutions | 3Sum.py | 3Sum.py | py | 1,422 | python | en | code | 0 | github-code | 13 |
34601370607 | from __future__ import annotations
import json
import logging
import pathlib
import typing as t
from dataclasses import dataclass
import aiofiles
from analytix.types import SecretT
_log = logging.getLogger(__name__)
@dataclass(frozen=True)
class Secrets:
"""A dataclass representing a set of secrets for a Goog... | 81CuongVn/analytix | analytix/secrets.py | secrets.py | py | 3,374 | python | en | code | 0 | github-code | 13 |
72429894737 | #!/usr/bin/env python
__author__ = "Isidor Nygren"
__copyright__ = "Copyright 2018, Isidor Nygren"
__license__ = "MIT"
__version__ = "1.0"
__maintainer__ = "Isidor Nygren"
__email__ = "admin@isidor.co.uk"
import math
from .basesort import victorylap
def heapify(array, n, i):
end = i
l = 2*i + 1 # Left
r ... | isidornygren/sortware | algorithms/heapsort.py | heapsort.py | py | 930 | python | en | code | 1 | github-code | 13 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.