seq_id string | text string | repo_name string | sub_path string | file_name string | file_ext string | file_size_in_byte int64 | program_lang string | lang string | doc_type string | stars int64 | dataset string | pt string | api list |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
46519762964 | from django import template
from deliverables.models import Deliverable
from deliverables.forms import DeliverableForm
register = template.Library()
def get_deliverable_form(deliverable):
try:
d = Deliverable.objects.get(id=deliverable)
except Deliverable.DoesNotExist:
return ''
f = DeliverableForm(instance=... | onia/django-project-management | branches/rest-api-branch/django-project-management/deliverables/templatetags/deliverable_tags.py | deliverable_tags.py | py | 389 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "django.template.Library",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "deliverables.models.Deliverable.objects.get",
"line_number": 11,
"usage_type": "call"
},
{
... |
31189789217 | #
# @lc app=leetcode.cn id=815 lang=python3
#
# [815] 公交路线
#
# @lc code=start
from typing import List
class Solution:
def numBusesToDestination(self, routes: List[List[int]], source: int, target: int) -> int:
from collections import deque, defaultdict
stop_buses = defaultdict(set) # 每个车站能乘坐的公交车
... | Interesting6/FuckLeetCode | 815.公交路线.py | 815.公交路线.py | py | 1,893 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.List",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "collections.defaultdict",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 17,
"usage_type": "call"
}
] |
71958457012 | from collections import namedtuple, deque
import numpy as np
import gym
import torch
import random
from argparse import ArgumentParser
import os
import pandas as pd
import matplotlib.pyplot as plt
plt.style.use('ggplot')
from scipy.ndimage.filters import gaussian_filter1d
def arguments():
parser = Argument... | DudnikovAndrei/CAS_AI | RL/BranchingDQN_LunarLander_Discret/utils.py | utils.py | py | 4,733 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 12,
"usage_type": "name"
},
{
"api_na... |
71137637494 | import requests
import tarfile
import time
import random
import json
from utils import getFilesInDir, getJsonFromURL, get_list_of_past_dates, call_and_retry
def update_data(nDays, data_dir):
dates = get_list_of_past_dates(nDays)
download_km_files_for_dates(dates, data_dir)
check_eventual_updates_of_files(d... | Diddy42/eve_killmails_graph | EveRefUtils.py | EveRefUtils.py | py | 3,704 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "utils.get_list_of_past_dates",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "utils.call_and_retry",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "utils.getJsonFromURL",
"line_number": 14,
"usage_type": "argument"
},
{
"api_nam... |
9203397014 | import YB_Pcb_Car
import time
import pygame
import curses
import Ultrasonic
pygame.init()
win = pygame.display.set_mode((100,100))
car = YB_Pcb_Car.YB_Pcb_Car()
car.Car_Run(150,150)
time.sleep(0.2)
car.Car_Stop()
def getKey(keyName):
ans = False
for eve in pygame.event.get():pass
keyInput = pygame.key.get_presse... | oguzerkara/Raspberry-pi-prototype-device | Key_Control2.py | Key_Control2.py | py | 852 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pygame.init",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "YB_Pcb_Car.YB_Pc... |
17157716080 | # -*- coding: utf-8 -*-
import argparse
from ..orbit import orbit
def cli_orbit(argv=None):
parser = argparse.ArgumentParser(
description="""Get Titan (Saturn's moon) orbital constrains""")
parser.add_argument('values', nargs='+', type=str, metavar='date|Ls',
help='Calendar da... | seignovert/python-titan-moon | titan/cli/orbit.py | orbit.py | py | 1,173 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "orbit.orbit.date",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "orbit.orbit",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "orbit.orbit.Ls",
... |
33273086615 | import pygame as py
import math
from point import Point
import sys, pygame
class Hexagon():
def __init__(self,origin,length):
self.origin = origin
self.length = length
self.pA , self.pB , self.pC, self.pD, self.pE , self.pF = self.calcHexPoints()
self.points = [self.pA , self.pB , s... | joshdijkstra/Hexagons | Hex.py | Hex.py | py | 2,240 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "point.Point",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "point.Point",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "point.Point",
"line_number": 16... |
19035957469 | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
UPLOAD_FOLDER='./app/static/uploads'
app=Flask(__name__)
app.config['UPLOAD_FOLDER']=UPLOAD_FOLDER
app.config['SECRET_KEY']="Xz9am$hu7gry"
app.config['SQLALCHEMY_DATABASE_URI']=DATABASE_URL='postgresql://ljbxsvxojiuslh:18dc0343fac9a78f606ae0d46485550e3b74... | daamorgan/info3180-project1-messed-up | app/__init__.py | __init__.py | py | 600 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 10,
"usage_type": "call"
}
] |
2965572157 | import os
from PIL import Image
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
def colour2single(im):
# Float is needed for when subtracting 128 (else overflow as it is uint8)
c = np.mean(np.abs(im.astype(float) - 128), axis=-1, keepdims=True) # negative gray, then abs, then ave... | infelane/lamb-segmentation | junk_scripts/overlay_olivier.py | overlay_olivier.py | py | 2,794 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "numpy.mean",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "matplotlib.cm.viridis",
"line_... |
25057353177 | import openpyxl
from openpyxl.chart import BarChart,Reference,Series
workBook=openpyxl.load_workbook("日別店舗別クロス集計表.xlsx")#エクセルブックを開く
sheet=workBook.active#アクティブなワークシートを選択
chartSheet=workBook.create_chartsheet("日別店舗別売上グラフ")#アクティブなワークシートのファイルにグラフシートを作成
#グラフの描画対象になるセル範囲を設定
values=Reference(sheet,min_col=2,min_row=1,m... | jun-yoshiyoshi/python_for_excel | p160.py | p160.py | py | 970 | python | ja | code | 0 | github-code | 21 | [
{
"api_name": "openpyxl.load_workbook",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "openpyxl.chart.Reference",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "openpyxl.chart.BarChart",
"line_number": 8,
"usage_type": "call"
}
] |
41148144911 | from django.contrib.auth.models import User
from rest_framework import serializers
from rest_framework.exceptions import ValidationError
from currency.models import Currency
from user.models import UserSetting
class UserSettingSerializer(serializers.ModelSerializer):
class Meta:
model = UserSetting
... | n0rr7882/coinance | coinance_backend/user/serializers.py | serializers.py | py | 2,225 | python | en | code | 7 | github-code | 21 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "user.models.UserSetting",
"line_number": 11,
"usage_type": "name... |
43791056557 | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# to run Random forest
from sklearn.ensemble import RandomForestRegressor
# -------------------------
# Random forest
# load data
# ------------
dataset = pd.read_csv('../data/Position_Salaries.csv')
# https://stackoverflow.com/questions/509211... | warpalatino/public | Machine learning/ML/traditional_ML/regressions/AI2_sk_random_forest.py | AI2_sk_random_forest.py | py | 1,067 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sklearn.ensemble.RandomForestRegressor",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 38,
"usage_type": "call"
},
{
"... |
70636628533 | import os
import torch
from torch.utils.data import Dataset
from transformers import VisionEncoderDecoderModel, PreTrainedTokenizerFast, AutoFeatureExtractor
from PIL import Image
import pandas as pd
from torchmetrics import CharErrorRate
import numpy as np
# Specify the path to the OcciGen repository
repository_path... | EstebanGarces/OcciGen | src/inference.py | inference.py | py | 3,985 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 1... |
16152350182 | import cv2
from simple_facerec import SimpleFacerec
import webbrowser
sfr = SimpleFacerec()
sfr.load_encoding_images("image/")
cap = cv2.VideoCapture(0)
while True:
ret, frame = cap.read()
#Dectact Face
face_location,face_name = sfr.detect_known_faces(frame)
for face_loc,name in zip(face_location,fa... | imteajsajid12/pythonProject | img_racognize.py | img_racognize.py | py | 900 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "simple_facerec.SimpleFacerec",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.putText",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cv2.FONT_HERS... |
74368621812 | from django.urls import path
from django.contrib.auth import views as auth_views
from . import views
urlpatterns = [
path('register', views.register, name='register'),
path('login', views.login_user, name='login'),
path('profile/', views.profile, name='profile'),
path('profile/orders', views.profile_o... | XPoZiTiVeZ/altprogrammer | login/urls.py | urls.py | py | 758 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
1263824358 | import datetime
from django.http import JsonResponse
from users.models import User
from exercises.models import UserFolder, ClubFolder, AdminFolder, UserExercise, ClubExercise, AdminExercise, ExerciseVideo
from exercises.models import UserExerciseParam, UserExerciseParamTeam
from references.models import ExsGoal, ExsBa... | NickG0od/client_system_python_django | exercises/v_api.py | v_api.py | py | 65,320 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "references.models.ExsGoal.objects.filter",
"line_number": 120,
"usage_type": "call"
},
{
"api_name": "references.models.ExsGoal.objects",
"line_number": 120,
"usage_type": "attribute"
},
{
"api_name": "references.models.ExsGoal",
"line_number": 120,
"usage_... |
9793892192 | # -*- coding: utf-8 -*-
"""
Workflow for adding new datasets to `neuromaps`
"""
from base64 import b64encode
import hashlib
import os
from pathlib import Path
import warnings
import nibabel as nib
import requests
from neuromaps.datasets import _osf
from neuromaps.datasets.annotations import MATCH, available_annotati... | netneurolab/neuromaps | neuromaps/datasets/contributions.py | contributions.py | py | 7,838 | python | en | code | 184 | github-code | 21 | [
{
"api_name": "os.environ.get",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 58,
"usage_type": "attribute"
},
{
"api_name": "neuromaps.datasets.utils._get_token",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "os... |
24932144260 | from sklearn.cluster import KMeans
from sklearn.preprocessing import StandardScaler
import random
import numpy as np
import matplotlib.pyplot as plt
x = [random.randint(18, 70) for x in range(15)]
y = [int(random.random() * 10000) for x in range(15)]
scaler = StandardScaler()
base = np.array([[a, b] for a, b in zip... | lucas404x/estudos_machine_learning | aprendizagem_nao_supervisionada/k_means/k_means.py | k_means.py | py | 597 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "random.randint",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "random.random",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "nump... |
7555895666 | # -*- coding: utf-8 -*-
"""
Created on Sun Jul 21 17:14:23 2019
@author: smorandv
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
def rm_ext_and_nan(CTG_features, extra_feature):
"""
:param CTG_features: Pandas series of CTG features
:param extra_feature: A feature to be remov... | mlh-master/hw1_mlh-shachar-shay | clean_data.py | clean_data.py | py | 5,765 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.to_numeric",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pandas.to_numeric",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "numpy.isnan",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "numpy.random.choice",... |
42616906350 | import argparse
import collections
import io
import json
import sys
# python construct_vocab.py --data datasets/wikitext-103/wiki.train.tokens -t 50 -s datasets/wikitext-103/vocab.t50.json # NOQA
parser = argparse.ArgumentParser()
parser.add_argument('--data', '-d', required=True)
parser.add_argument('--threshold', '... | soskek/efficient_softmax | construct_vocab.py | construct_vocab.py | py | 1,664 | python | en | code | 12 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "io.open",
... |
29917225535 | import json
from flask import Flask, request
from flask_cors import CORS
app = Flask(__name__)
CORS(app)
products = []
@app.route("/products", methods=["GET"])
def get_product():
response = json.dumps(products)
return response, 200
@app.route("/products", methods=["POST"])
def post_product():
try:
... | DeVerMyst/DEVIA2023 | E_g_API_REST_GETPOST/server.py | server.py | py | 2,141 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.request.get_json",
"li... |
5365571324 | import json
import requests
def readweb(url):
"""从指定网址读取关注者列表
注意:一定要使用User-Agent
"""
html = requests.get(url, headers = {
'User-Agent': "User-Agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36"})
print(html.text)
... | hikerIC/spider | pyhon_1.py | pyhon_1.py | py | 517 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 10,
"usage_type": "call"
}
] |
72163986292 | from typing import Dict, List
import json
import networkx as nx
import datautils
import graphsutils
import numpy as np
from utils import get_by_indices
from datautils import DatasetT
from tqdm import tqdm
import torch
from torch import nn
SENTENCE_EMB_FILENAME = 'sentences_emb.json'
OUTPUT_FILENAME = 'similarities.js... | disi-unibo-nlp/ddegk | src/sentence_similarity/sentsim.py | sentsim.py | py | 5,807 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "torch.nn.Module",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"lin... |
34700282253 | """
Module for working with polarization to get LWA and VLA into the same frame.
"""
import os
import sys
import time
import ephem
import numpy
from lsl.common.paths import DATA as dataPath
from lsl.misc.lru_cache import lru_cache
__version__ = '0.4'
__all__ = ['get_lwa_antenna_gain', 'get_matrix_lwa', 'get_matrix_v... | lwa-project/eLWA | jones.py | jones.py | py | 4,815 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "numpy.load",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "lsl.common.paths.DATA",
"line_number": 21,
"usage_type": "argument"
},
{
"api_name": "os.path",
"line... |
9933072963 | import pandas as pd
from sklearn.preprocessing import LabelEncoder
def preprocess_dataset_cars():
df = pd.read_csv("../preprocessing/cars.data", header = 0, delimiter = ',')
df = df.sample(frac=1)
ydf = df[['class']]
df.drop(columns=['class'], inplace=True)
xdf = df
xdf = pd.get_dummies(dat... | jkwiatk1/Random-forest-id3-naivyBayes | preprocessing/cars.py | cars.py | py | 636 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pandas.get_dummies",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pandas.to_numeric",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "sklearn.prep... |
4580174544 | from contextlib import asynccontextmanager
from sqlalchemy.exc import SQLAlchemyError
from sqlalchemy.ext.asyncio import async_sessionmaker, create_async_engine
from .logger import logger
from .settings import settings
async_engine = create_async_engine(
settings.DB_URI,
pool_pre_ping=True,
echo=setting... | PrVrSs/aflpp-server | aflpp_server/db.py | db.py | py | 687 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sqlalchemy.ext.asyncio.create_async_engine",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "settings.settings.DB_URI",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "settings.settings",
"line_number": 11,
"usage_type": "name"
},... |
5128194874 | from django.contrib import admin
from django.urls import path
from . import views
urlpatterns = [
path('profile/', views.home, name='worker.home'),
path('registerWorker/',views.registerWorker, name='worker.registerWorker'),
path('workersList/',views.WorkersList.as_view(), name='worker.workersList'),
pa... | Reyano132/Saptshrungi | worker/urls.py | urls.py | py | 781 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
31928016674 | import numpy as np
import curses
from curses import wrapper
import time
data = [line.rstrip() for line in open('test_input2.txt')]
coords_lists = [d.split(' -> ') for d in data]
max_width = 0
min_width = 500
max_depth = 0
for coord in coords_lists:
for c in coord:
curr_height = int(c.split(',... | kyle-98/AdventOfCode | 2022/day_14/day14_part1_visual.py | day14_part1_visual.py | py | 2,648 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.full",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 77... |
70445152693 | import pickle
from sympy import *
from binarize_features import *
import json
import pandas as pd
def get_all_rules(h, background):
all_rules = []
for rule in h:
if rule not in background:
expr = sstr(rule)
all_rules.append(expr)
#print(expr)
return all_rules
de... | ZofieB/MT_UiB | re_eval_methods.py | re_eval_methods.py | py | 5,455 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pickle.load",
"line_number": 110,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 115,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 138,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_nu... |
31508841955 | from typing import Union
from battle.construct.enum import Stat, EventType
from battle.construct.enum.state import State
from battle.construct import Champion, Buff
import simpy
class StateManager:
def __init__(self, env: simpy.Environment):
self.env: simpy.Environment = env
def put_state(self, cha... | TikaWorld/TFT-simulator | src/battle/action/state.py | state.py | py | 2,778 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "simpy.Environment",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "simpy.Environment",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "battle.construct.Champion",
"line_number": 14,
"usage_type": "name"
},
{
"api_name"... |
17642055957 | import os
import pew
import supervisor
import board
import displayio
import terminalio
def _wait_keys():
try:
while True:
keys = pew.keys()
if keys:
break
for i in range(5):
if not pew.keys():
break
pew.tick(0.0625)
... | pypewpew/pewpew-lcd | python/main.py | main.py | py | 2,261 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "pew.keys",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pew.keys",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pew.tick",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pew.keys",
"line_number": 20,
"usa... |
17550797706 | from datetime import date
from PyQt5.QtWidgets import(QWidget,
QComboBox,
QPushButton,
QLabel,
QMessageBox,
QFormLayout )
from QueryTool import QueryTool
class SportlerEdit(QWi... | k0rmarun/Kinderolympiade | SportlerEdit.py | SportlerEdit.py | py | 5,435 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QLabel",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "QueryTool.QueryTool",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "Py... |
9204889786 | import functools
import random
import numpy as np
import pandas as pd
class GroupTable():
def __init__(self, match_df):
self.table = self.build_group_table(match_df)
def build_group_table(self, match_df):
data = []
for key, value in match_df.groupby('group')['home_team'].unique().to_di... | Villux/world_cup | simulation/group_table.py | group_table.py | py | 3,618 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.DataFrame",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "numpy.unique",
... |
33982813430 | # coding=utf-8
import HTMLTestRunner
import time
from ddt import ddt
import comall
from setting.zx_test import setting
from logs.tests.members.zx_test.web_test import CommonLogin
__author__ = 'zhangxue'
import unittest
@ddt
class MyTestCase(unittest.TestCase):
apilogin = CommonLogin()
def test_a_login(s... | huiboSong/tester | tests/members/zx_test/web_test/api_test/api_order.py | api_order.py | py | 3,268 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "unittest.TestCase",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "logs.tests.members.zx_test.web_test.CommonLogin",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "setting.zx_test.setting.api_uri",
"line_number": 27,
"usage_type":... |
15228453463 | import statistics as st
from pprint import pprint
from matplotlib import pyplot
from scipy import stats
import numpy as np
import matplotlib.pyplot as plt
from database.session import Session
def parse_int(playlist_string):
return int(''.join(filter(str.isdigit, playlist_string)))
abbreviations = {
"Prob... | abansagi/GroupRecommendationThesis | Experiment Processing/experiment2/periodic_effects.py | periodic_effects.py | py | 10,938 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.locator_params",
"line_number": 42,
"usage_type": "call"
},
{
"api... |
10871595042 | """ A better version of graphical_limits.py, a GUI program to display limit sets of groups in the Riley slices.
Inspired by the schottky software written by Danny Calegari and Alden Walker (https://github.com/dannycalegari/schottky).
"""
import riley
import farey
import kleinian
import mpmath as mp
import sys
fr... | aelzenaar/riley | explorer/explorer.py | explorer.py | py | 3,361 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "PyQt5.QtWidgets.QApplication",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 17,
"usage_type": "call"
},
{
"api_name":... |
24075131869 | from django.conf.urls import patterns, url, include
SLUG_REGEX = r'(?P<slug>[\w-]+)'
urlpatterns = patterns(
'blogs.views',
url(r'^{slug}/!/'.format(slug=SLUG_REGEX), include('blogs.urls.backend')),
url(r'^{slug}/'.format(slug=SLUG_REGEX), include('blogs.urls.frontend'))
)
| uranusjr/relog | blogs/urls/__init__.py | __init__.py | py | 289 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.conf.urls.patterns",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.include",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "... |
40683745922 | import csv
import datetime
from time import time
import matplotlib.pyplot as plt
import random
import winsound
# website used for debugging
# https://timestamp.online/
core_count = []
runtime = []
cpu_utilization = []
mem_utilization = []
# timestamp = []
lines_used = 0
lines_total = 0
interval_count = 24
def calc_... | moriabmc/KubernetesScheduler | benchmark_scripts/workload_generator/Archive/old/workloadPredictionv2.py | workloadPredictionv2.py | py | 2,934 | python | en | code | null | github-code | 21 | [
{
"api_name": "csv.reader",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 57,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.fromtimestamp",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "datetime.datetim... |
21290677812 | from typing import List
from presidio_analyzer import EntityRecognizer, RecognizerResult, AnalysisExplanation
from presidio_analyzer.nlp_engine import NlpArtifacts
from hebsafeharbor.common.terms_recognizer import TermsRecognizer
class LexiconBasedRecognizer(EntityRecognizer):
"""
A class which extends the E... | 8400TheHealthNetwork/HebSafeHarbor | hebsafeharbor/identifier/signals/lexicon_based_recognizer.py | lexicon_based_recognizer.py | py | 2,759 | python | en | code | 14 | github-code | 21 | [
{
"api_name": "presidio_analyzer.EntityRecognizer",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "hebsafeharb... |
28084044335 | # import relevant modules
from flask import Flask, request, redirect, render_template
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import desc
# define your app
app = Flask(__name__)
app.config['DEBUG'] = True
# configure it to connect to the database
# user is build-a-blog, database is named build-a-blog, ... | jeffmorice/build-a-blog | main.py | main.py | py | 3,480 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "flas... |
375244554 | from unittest.mock import Mock
import pytest
from novelsave_sources import (
locate_metadata_source,
locate_novel_source,
metadata_source_types,
novel_source_types,
UnknownSourceException,
)
from novelsave_sources.sources import MetaSource, Source
def test_novel_source_types():
sources = nov... | m-haisham/novelsave_sources | tests/utils/test_sources.py | test_sources.py | py | 1,519 | python | en | code | 27 | github-code | 21 | [
{
"api_name": "novelsave_sources.novel_source_types",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "novelsave_sources.sources.Source",
"line_number": 20,
"usage_type": "argument"
},
{
"api_name": "unittest.mock.Mock",
"line_number": 24,
"usage_type": "call"
... |
74164916534 | import numpy as np
import matplotlib.pyplot as plt
def img2mat(img):
# flatten image
d1, d2, d3 = img.shape
out = img.reshape(d1*d2, d3)
return out
def get_color_transfered_centers(T, input_centers, ref_centers, a):
# calculate new color centroids base on the Transport Matrix T
X = np.zeros(i... | jelfes/ColorTransportFW | image_processing.py | image_processing.py | py | 1,074 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.zeros",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"l... |
9430526993 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 9 15:23:31 2016
@author: Adrian Ahne
For the function 1/|x-y| we find a parametrisation at the point (-1,-1) of the triangle
A = (-1, -1) , B = (1, 0), C = (-1,2)
USE THIS PROGRAM ONLY FOR THIS TRIANGLE
"""
import numpy as np
from numpy.linalg im... | Adahn/FastQuad | GL_Tria_Sing.py | GL_Tria_Sing.py | py | 5,104 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.exp",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.norm",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.norm",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line... |
1814346134 | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
with open('requirements.txt') as f:
install_requires = f.read().strip().split('\n')
# get version from __version__ variable in selcohr/__init__.py
from selcohr import __version__ as version
setup(
name='selcohr',
version=version,
description='se... | thispl/selcohr | setup.py | setup.py | py | 497 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "setuptools.setup",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "selcohr.__version__",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "setuptools.find_packages",
"line_number": 16,
"usage_type": "call"
}
] |
74683447732 | import requests
from bs4 import BeautifulSoup
from club import Club, Player
clubs = []
source = requests.get('http://www.euroleague.net/competition/teams?seasoncode=E2017').text
soup = BeautifulSoup(source, 'lxml')
teams = soup.findAll('div', {"class": 'item'})
for team in teams:
club_name = team.find('div', {... | lazarstajcic/euroleague-stats- | collect.py | collect.py | py | 1,572 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_nu... |
73015726133 | from AST import *
from token_ya import Token
from lexer import Lexer
from type import TokenType, tokenTypes
from symbol import *
from typing import Union
from copy import deepcopy
import math
class Parser(object):
def __init__(self, tokens):
self.tokens = tokens
self.pos = 0
self.scope = dict()
def find(sel... | danil-cpu/YabadaLang | parser_new.py | parser_new.py | py | 12,183 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "type.name",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "typing.Union",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "token_ya.Token",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "token_ya.Token",
"line... |
6260641834 | # Adapted from: https://www.geeksforgeeks.org/python-convert-speech-to-text-and-text-to-speech/
import speech_recognition as sr
import pyttsx3
from threading import Thread
COMMANDS = {"silence alarm", "snooze alarm"}
# Function to convert text to speech
def speak_text(command):
# Initialize the engine
engin... | athena-mit/SmartAlarm | voice_commands.py | voice_commands.py | py | 2,182 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pyttsx3.init",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "threading.Thread.__init__",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "threading.Thr... |
23924263219 | import sqlite3
import datetime
connection = sqlite3.connect('database.db')
database = connection.cursor()
def getAll():
query = "SELECT * FROM bills"
cursor = database.execute(query)
result = cursor.fetchall()
connection.commit()
return result
def add(data):
try:
query = "INSERT INTO... | alltimenoob/Billing-System | api/bills.py | bills.py | py | 902 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sqlite3.connect",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 18,
"usage_type": "attribute"
}
] |
8048692993 | # a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.factory.bridge.near
import requests
import json
import pickle
import humanize
from pprint import pprint
url = "https://archival-rpc.mainnet.near.org/"
USDC = "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.factory.bridge.near"
USDT = "dac17f958d2ee523a2206206994597c13d831ec7.facto... | mfornet/blockchain-scripts-python | explore_balance.py | explore_balance.py | py | 2,658 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "pickle.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pickle.dumps",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pickle.dump",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": ... |
27482977197 | # coding=utf-8
from flask import Flask
from flask.ext.jsonpify import jsonify
from py2neo import Graph
app = Flask(__name__)
graph = Graph()
def buildNodes(aNodeRecord):
data = {"id": str(aNodeRecord.n._id)}
data.update(aNodeRecord.n.properties)
labelSet = aNodeRecord.n.labels
if 'Movie' in labelSet:... | zhongzhu/cytoscape_py2neo | app.py | app.py | py | 2,524 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "py2neo.Graph",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.ext.jsonpify.jsonify",
"line_number": 87,
"usage_type": "call"
}
] |
3437223127 | import collections
import logging
import numpy as np
import os
import sys
import pandas as pd
import matplotlib.pyplot as plt
import tqdm
from sklearn import mixture
import skimage.transform as sktransform
import config
def validate_with_lamoda(
validation_dataset_path,
face_processor,
fashion_item_proce... | roma1n/face_clothes_matching | lib/utils/pipeline.py | pipeline.py | py | 4,898 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "logging.info",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number"... |
31138560766 | # Databricks notebook source
# MAGIC %pip install dtw-python
# COMMAND ----------
from sklearn.cluster import dbscan
import numpy as np
from dtw import *
import json
import matplotlib.pyplot as plt
from sklearn.cluster import DBSCAN
#from scipy.cluster.hierarchy import linkage
# COMMAND ----------
df = spark.sql(f'... | natalisgp/customer_dashboard | Cluster jobs.py | Cluster jobs.py | py | 5,968 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.array",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 3... |
13515509962 | from typing import Callable, Generic, overload, TypeVar, Type, Union
T = TypeVar('T')
V = TypeVar('V')
A = TypeVar('A')
class setter(Generic[T, V, A]):
"""Modify instance attributes only when they are set, not when they are get.
Usage::
@setter
def source(self, source: str|Path) -> Path:
... | robotframework/robotframework | src/robot/utils/setter.py | setter.py | py | 2,558 | python | en | code | 8,521 | github-code | 21 | [
{
"api_name": "typing.TypeVar",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "typing.TypeVar",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "typing.TypeVar",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "typing.Generic",
"line_... |
23737752069 | """Landlab component that simulates potential evapotranspiration rate.
Potential Evapotranspiration Component calculates spatially distributed
potential evapotranspiration based on input radiation factor (spatial
distribution of incoming radiation) using chosen method such as constant
or Priestly Taylor. Ref: ASCE-EW... | David-Loibl/landlab | landlab/components/pet/potential_evapotranspiration_field.py | potential_evapotranspiration_field.py | py | 17,326 | python | en | code | null | github-code | 21 | [
{
"api_name": "landlab.Component",
"line_number": 99,
"usage_type": "name"
},
{
"api_name": "numpy.pi",
"line_number": 293,
"usage_type": "attribute"
},
{
"api_name": "utils.decorators.use_file_name_or_kwds",
"line_number": 242,
"usage_type": "name"
},
{
"api_name... |
28959362265 | """
Creates a colored network of author collaboration.
- Info:
- Nodes are identified by the respective author's names.
- Edges are identified by the key of the paper that it represents collaboration on, with an
integer suffix to distinguish the many edges resulting from one paper collaboration. For ... | Riib11/SocialNetworks | systems-papers/python/network_collaboration/make_net.py | make_net.py | py | 4,542 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "utils.data.systems_papers_directory",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "utils.data",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "net.net.NET",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "autho... |
21660195039 | import time
import zmq
import cv2
import model_utils as MU
import bounding_box as BB
from keras.models import load_model, Model
context = zmq.Context()
socket = context.socket(zmq.REP)
socket.bind("tcp://*:5555")
print('Loading haar cascade classifier')
cascade_classifier = cv2.CascadeClassifier('../rc/cars.xml')
... | cfcv/DeepStance | scripts/server.py | server.py | py | 3,427 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "zmq.Context",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "zmq.REP",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "cv2.CascadeClassifier",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "keras.models.load_model... |
3564761498 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
@Author : Tian
@File : BKtree.py
@Time : 2020/8/3 10:21 PM
@Desc : BKTree class for keywords search
@Version : 1.0
"""
"""
reference: 刘树春等, 深度实践OCR:基于深度学习的文字识别, 9.1.1节
"""
from Levenshtein import distance
import os
class Node(object): # 🌲的结点
def __i... | tiantian91091317/OCR-Corrector | corrector/utils/BKtree.py | BKtree.py | py | 2,431 | python | en | code | 432 | github-code | 21 | [
{
"api_name": "Levenshtein.distance",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 76,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
... |
26900212995 | from control.game_player import Research
from control.game_tile import Terrain
from control.game_tokens import BuildingToken, PlayerToken, ResourceToken
from control.phase.common import load_goods, load_transporter, unload_goods
from .phase import Phase
building_resource = {
BuildingToken.WOODCUTTER: { ResourceTok... | orbli/roads_and_boats | control/phase/building.py | building.py | py | 13,703 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "control.game_tokens.BuildingToken.WOODCUTTER",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "control.game_tokens.BuildingToken",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "control.game_tokens.BuildingToken.QUARRY",
"line_number": 9... |
72734244852 | import os
import torch
from torch import nn
from torch.utils.data import Dataset, DataLoader
import time
import traceback
import numpy as np
from anndata import AnnData
import scanpy as sc
from typing import List, Tuple, Dict, Optional
from scgpt.tokenizer import tokenize_and_pad_batch, random_mask_value
from scgpt im... | bowang-lab/scGPT | scgpt/trainer.py | trainer.py | py | 23,698 | python | en | code | 537 | github-code | 21 | [
{
"api_name": "scgpt.tokenizer.random_mask_value",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "scgpt.tokenizer.random_mask_value",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "torch.from_numpy",
"line_number": 65,
"usage_type": "call"
},
{
... |
1057466294 | import os
import cv2
import numpy as np
import matplotlib.pyplot as plt
###############
# stereo depth
###############
def load_params(path):
'''
Loads camera matrix and distortion coefficients
'''
cv_file = cv2.FileStorage(path, cv2.FILE_STORAGE_READ)
camera_matrix = cv_file.getNode("K").mat... | UcefMountacer/Roots_Point_Cloud | libraries/depth/stereo_depth.py | stereo_depth.py | py | 6,623 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "cv2.FileStorage",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "cv2.FILE_STORAGE_READ",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "cv2.StereoSGBM_create",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "cv2.... |
30641674722 | import argparse
import os
import shutil
import numpy as np
import yaml
from tdw.add_ons.collision_manager import CollisionManager
from tdw.add_ons.object_manager import ObjectManager
from tdw.add_ons.third_person_camera import ThirdPersonCamera
from tdw.controller import Controller
from tdw.tdw_utils import TDWUtils
... | yutianRen/slb_interactive_causality | simulator.py | simulator.py | py | 22,316 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.random.RandomState",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "yaml.full_load",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "tdw.control... |
40699022510 | import numpy as np
from PIL import Image
from cv2 import cv2
image = Image.open("CharacterDetection/1.png", "r")
pix_val = list(image.getdata())
i = 0
row = []
rows= []
el = 0
for element in pix_val:
if element[0] == 255:
el = 0
else:
el = 1
if i % image.size[0] == 0 and i != 0:#image.size returns a tuple ... | voirtimid/IS-Final-Proekt | PythonScripts/segment_characters.py | segment_characters.py | py | 1,346 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "PIL.Image.open",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 5,
"usage_type": "name"
}
] |
37502799400 | from time import sleep
import numpy as np
import io
import serial
import sys
ser = serial.Serial(
"/dev/cu.usbserial-1410", 115200
) # Establish the connection on a specific port
with open("PythonAttempt/img/sent.png", "rb") as img_file:
img_file.seek(0, 2) # seek the end
num_bytes = img_file.tell() # ... | queens-satellite-team/mock-sat | src/comms/Tutorials/pySerial_BytesIO.py | pySerial_BytesIO.py | py | 1,018 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "serial.Serial",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "io.BytesIO",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 30,
"usage_type": "call"
}
] |
38593032191 | import numpy as np
from tqdm import tqdm
import matplotlib.pyplot as plt
from sklearn.neighbors import KNeighborsClassifier
from sklearn.cluster import KMeans, DBSCAN, SpectralClustering
from sklearn.metrics.cluster import v_measure_score
def cluster_distances(embedding, labels):
""" Get 10-th percentile of distan... | Andrew-Draganov/GiDR-DUN | GDR/experiment_utils/metrics.py | metrics.py | py | 3,009 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "numpy.min",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.unique",
"line_number": 15,... |
12164938971 | from flask import Flask
from flask_login import LoginManager
import logging
import views
from database import Database
from user import get_user
lm = LoginManager()
@lm.user_loader
def load_user(user_id):
return get_user(user_id)
def create_app():
app = Flask(__name__)
app.config.from_object("config.D... | marifdemirtas/beevibe | server.py | server.py | py | 3,124 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask_login.LoginManager",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "user.get_user",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "views.index",
"... |
42744974736 | """
Author of the following code:
https://github.com/falsedev
"""
from enum import Enum
from typing import Callable, List, Optional, Type, Union
from discord import (
CategoryChannel,
Color,
Embed,
Emoji,
Invite,
Member,
Message,
PartialEmoji,
Reaction,
Role,
TextChannel,
... | CaffeineDuck/PeaceBot | bot/utils/convert.py | convert.py | py | 2,715 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "typing.Union",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "discord.User",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "discord.Member",
"line_number... |
70921632693 | """pokemon_api URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-b... | magocod/pokemon | pokemon_api/urls.py | urls.py | py | 1,535 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.urls.path",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "... |
40520094470 | from rest_framework import serializers
from applications.rooms.models import HotelRooms,RoomImage
class RoomImageSerializer(serializers.ModelSerializer):
class Meta:
model = RoomImage
fields = '__all__'
class HotelRoomsSerializer(serializers.ModelSerializer):
images = RoomImageSeriali... | Tommy16y/TEAM_8 | applications/rooms/serializers.py | serializers.py | py | 1,195 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "applications.rooms.models.RoomImage",
"line_number": 8,
"usage_t... |
10740906686 | from setuptools import setup
with open('README.md') as readme:
long_description = readme.read()
setup(
name='netschoolapi',
version='11.0.5',
description='Асинхронный API-клиент для «Сетевого города»',
long_description=long_description,
long_description_content_type='text/markdown',
auth... | nm17/netschoolapi | setup.py | setup.py | py | 918 | python | en | code | 79 | github-code | 21 | [
{
"api_name": "setuptools.setup",
"line_number": 8,
"usage_type": "call"
}
] |
41917070572 | from rest_framework import serializers
from rest_framework.exceptions import ValidationError
from apps.forms.models import Form, Component, Choice, Submit, Answer
class ChoiceSerializer(serializers.ModelSerializer):
class Meta:
model = Choice
fields = ["id", "component", "text", "order"]
class ... | taptorestart/forms | backend/apis/v1/forms/serializers.py | serializers.py | py | 3,392 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "apps.forms.models.Choice",
"line_number": 9,
"usage_type": "name... |
70845138292 | #
#
# # ЛЕТАЮЩИЙ ШАРИК
#
# import tkinter as tk
# from random import randint
#
# height = 500
# width = 700
#
#
# class BALL:
# def __init__(self):
# self.R = randint(20, 50)
# self.x = randint(self.R, width - self.R)
# self.y = randint(self.R, height - self.R)
# self.dx, self.dy = r... | Gavrevdokimov/infa_2020_evdokimov | training.py | training.py | py | 2,559 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pygame.init",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 67,
"usage_type": "attribute"
},
{
"api_name": "pygame.draw.p... |
25743784686 | # 01
# Medium
# Given an array of integers that can be both +ve and -ve, find the contiguous subarray
# with the largest sum.
# For example: [1,2,-1,2,-3,2,-5] -> first 4 elements have the largest sum. Return (0,3)
# Actually no: just return the sum (4), contiguous subarray can't be found here
# --------------... | dannynoonan/interview-prep | ic/02_subarrays/01_kadanes.py | 01_kadanes.py | py | 818 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pytest.main",
"line_number": 35,
"usage_type": "call"
}
] |
4466882502 | from datetime import datetime
y = int(input('Informe o ano de nascimento do atleta: '))
dy = datetime.now().year - y
if dy <= 9:
print('MIRIM')
elif 9 < dy <= 14:
print('INFANTIL')
elif 14 < dy <= 19:
print('JUNIOR')
elif 19 < dy <= 25:
print('SÊNIOR')
elif dy > 25:
print('MASTER') | themegazord/CursoEmVideo---Python | CursoEmVideo/Exercicios/desafio41.py | desafio41.py | py | 304 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "datetime.datetime.now",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 3,
"usage_type": "name"
}
] |
23388315687 | # -*- coding: utf-8 -*-
"""
Created on Wed Jun 22 16:16:38 2016
@author: raul
"""
import Linear2Polar as l2p
import numpy as np
import numpy.ma as ma
import matplotlib.pyplot as plt
import xpol_tta_analysis as xta
try:
x09
except NameError:
x09=xta.process(case=[9])
#cx = np.arange(-58, 45.5, 0.5)
#cy =... | rvalenzuelar/xpol_vis | edit_in_polar.py | edit_in_polar.py | py | 1,631 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "xpol_tta_analysis.process",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.ma.mask... |
39734122296 | import datetime
import pathlib
from typing import Optional
import typer
from rich import print
from rich.console import Console
from rich.table import Table
from sqlalchemy import select
from trapdata import logger, ml
from trapdata.cli import settings
from trapdata.cli.queue import status as queue_status
from trapda... | RolnickLab/ami-data-companion | trapdata/cli/show.py | show.py | py | 8,472 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "typer.Typer",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "rich.console.Console",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "rich.print",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "trapdata.cli.settings",
... |
35627818286 | import speech_recognition as sr
from googletrans import LANGUAGES, Translator
from Body.Speak import Speak
from Body.Listen import Listen
def translator1():
def listen_1():
translator = Translator()
# Initialize the recognizer
r = sr.Recognizer()
# Use the microph... | Dreamstartn/MAYA | translator.py | translator.py | py | 1,963 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "googletrans.Translator",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "speech_recognition.Recognizer",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "speech_recognition.Microphone",
"line_number": 16,
"usage_type": "call"
},
{
... |
18354628979 | # -*- coding: utf-8 -*-
from enum import Enum
from sklearn.metrics.pairwise import check_pairwise_arrays
import numpy as np
import gc
class Metric(Enum):
#correl = 1
#chisqr = 2
intersect = 3
#bhattacharyya = 4
#reference for implementation: http://docs.opencv.org/2.4/doc/tutorials/imgproc/histogra... | AtsushiHashimoto/hyper_feature_coding | hyper_feature_coding/main.py | main.py | py | 3,481 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "enum.Enum",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "sklearn.metrics.pairwise.check_pairwise_arrays",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "n... |
13026327995 | from dpkt import ethernet
from pcapfex.core.FileScanner import FileScanner, FileObject
from pcap_extractor.Extractor import Extractor
from datetime import datetime
class FileHashObject:
def __init__(self, fileObject: FileObject):
self.src = fileObject.source
self.dst = fileObject.destination
... | zoeyyyzou/pcap-analyser | pcap_extractor/FileHashExtractor.py | FileHashExtractor.py | py | 1,396 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pcapfex.core.FileScanner.FileObject",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.fromtimestamp",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 25,
"usage_type": "name"
},
{
... |
14700476395 | # -*- coding: UTF-8 -*-
import smtplib
import logging
import os
import configparser
import re
import time
import datetime
from filecmp import dircmp
import socket
from ctypes import *
import shutil
VERSION = "Ver: 20180626 "
SMTP_SERVER = ""
WORK_DIR = ""
SMTP_USER = ""
SMTP_PWD = ""
SMTP_SENDER = ""
long_date = tim... | openjason/automail | folder_update_detect/folder_detect.py | folder_detect.py | py | 16,928 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "time.strftime",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "time.localtime",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "time.strftime",
"line_numb... |
73030836213 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=W0703
# pylint messes up on readline for some reason
# pylint: disable=no-member
# pylint is silly with relative imports
# pylint: disable=relative-import
# decomposing comprehensions would be bad
# pylint: disable=line-too-long
# all code is client-si... | LiuFang816/SALSTM_py_data | python/ergonomica_ergonomica/ergonomica-master/ergonomica/ergo.py | ergo.py | py | 9,355 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "sys.stdout.write",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 68,
"usage_type": "attribute"
},
{
"api_name": "lib.lang.environment.Environment",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "lib... |
74346975091 | from enum import Enum
from pyspades.cards import Card, Deck, CARD_SUITS, CARD_RANKS
class GAME_STATES(Enum):
PREGAME = 1
DEALING = 2
BETTING = 3
PLAYING = 4
POSTGAME = 5
class PLAYER_ACTIONS(Enum):
DEAL = 1
BET = 2
PLAY = 3
class BETS(Enum):
ONE = 1
TWO = 2
THREE = 3
... | lbuckalew/PythonSpades | pyspades/game.py | game.py | py | 17,469 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "enum.Enum",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "pyspades.cards.Deck",
"line_number":... |
12338755929 | from __future__ import annotations
from typing import Iterable, Sequence
import math
import os
import sys
import time
from PySide6 import QtWidgets as qw, QtCore as qc, QtGui as qg
from PySide6 import QtGui
from PySide6.QtWidgets import (
QApplication,
QFileDialog,
QInputDialog,
QMessageBox,
QTable... | leateng/cutter | examples/main2.py | main2.py | py | 13,304 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "PySide6.QtWidgets.QMainWindow",
"line_number": 68,
"usage_type": "attribute"
},
{
"api_name": "PySide6.QtWidgets",
"line_number": 68,
"usage_type": "name"
},
{
"api_name": "ezdxf.addons.drawing.config.Configuration",
"line_number": 69,
"usage_type": "name"
... |
23919725181 | from direct.showbase.DirectObject import DirectObject
from direct.task import Task
from panda3d.core import PointLight, AmbientLight, VBase4
from scenes.zoneMaker import ZoneMaker
import hud.game
from ul_core.factions import templars, mariners, thieves, fae
import hud.templarHud as templarHud
import hud.marinerHud as m... | hpoggie/underlord-client | scenes/game.py | game.py | py | 4,249 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "direct.showbase.DirectObject.DirectObject",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "ul_core.factions.templars.Templar",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "ul_core.factions.templars",
"line_number": 19,
"usage_ty... |
20993634730 | #This program finds the sum of the individual digits of the factorial
#of the input variable
#=============================================================================
import numpy as np
import argparse
#initialising argparse to use external variable
#argparse allows the direct use of an integer variable
parser = ... | MrDoctorZA/Docker_sum_factorial | Main.py | Main.py | py | 1,261 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.math.factorial",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.math",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "numpy.arr... |
23343322662 | #============================================================================
# Copyright (c) 2018 Nghia T. Vo. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#... | nghia-vo/sarepy | sarepy/prep/stripe_removal_improved.py | stripe_removal_improved.py | py | 7,986 | python | en | code | 34 | github-code | 21 | [
{
"api_name": "numpy.transpose",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "numpy.pad",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "scipy.signal.windows.gaussian",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "numpy.power",... |
40319108436 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Predictor(nn.Module):
"""
input:
e1
output:
some prediction target
"""
def __init__(self, e1_dim=100, num_classes=38):
super(Predictor, self).__init__()
self.pred_bn1 = nn.BatchNorm1d(e1_dim)
... | jiazhi412/strong_attribute_bias | models_eval/module/Predictor.py | Predictor.py | py | 2,061 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.nn.BatchNorm1d",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line... |
2764335854 | import yaml
from pathlib import Path
class Subvariant:
"""A class to represent a theme subvariant."""
def __init__(self, name: str, properties: dict):
self.name = name
self.properties = properties
self.plugin_properties = {}
self.parent_variant = None
# Making sure pl... | risiIndustries/rtheme | rthemelib/theme_classes.py | theme_classes.py | py | 5,601 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pathlib.Path",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "yaml.safe_load",
"line_number": 92,
"usage_type": "call"
},
{
"api_name": "yaml.parser",
"line_number": 93,
"usage_type": "attribute"
}
] |
4415541333 | import json
import os
import openai
from dotenv import find_dotenv, load_dotenv
from flask import Flask, redirect, render_template, request, url_for
from .src.openaifuncs import get_completion
# Load Environment Variables
_ = load_dotenv(find_dotenv())
app = Flask(__name__)
openai.api_key = os.getenv("OPENAI_API_K... | misclassified/Moka | slack-copywriter/app.py | app.py | py | 3,723 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "dotenv.find_dotenv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "openai.api_key",
... |
18377897391 | import time
import os
import scipy
import torch
import torchtext
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from torch.autograd import Variable
from torch import nn
from torch import optim
from torchvision import datasets
from torchvision import transforms
from torch.utils.data import Da... | ZJUCAGD/DNN | Functional_Network_Of_DNN/src/FCN.py | FCN.py | py | 8,336 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.nn.Module",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"lin... |
73884473972 | #coding:utf-8
import pandas as pd
import numpy as np
from sklearn import tree
def oracle_data():
f = open('x_data.csv')
df = pd.read_csv(f)
x_data = np.array(df)
f = open('y_data.csv')
df = pd.read_csv(f)
y_data_temp = np.array(df)
y_data = np.zeros(1)
for temp in y_data_temp:
... | jaysonzhao/pythonmisc | decisiontree.py | decisiontree.py | py | 998 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_n... |
23174659658 | from __future__ import print_function
import os
import sys
import logging
from . import _stringio
from .tokens import Tokens
logger = logging.getLogger(__name__)
class Formatter(object):
def __init__(self):
self.logger = logger.getChild(self.__class__.__name__)
def __call__(self, input_file, see... | wolph/python-formatter | formatter2/formatter.py | formatter.py | py | 2,321 | python | en | code | 11 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tokens.Tokens.from_fh",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "tokens.Tokens",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "tokens.Tokens.f... |
6918169292 | import os
import glob
import h5py
import numpy as np
import cv2
from random import shuffle
def _get_images_address(subdir_path):
"""
:param subdir_path:
:return:
"""
# TODO: sanity check for White list formats : {'png', 'jpg', 'jpeg', 'bmp'}
path_format = subdir_path + '/*.jpg'
return g... | pallavi2146-zz/save_images | src/hdf5/hdf5_file_generator.py | hdf5_file_generator.py | py | 2,731 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "glob.glob",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "cv2.INTER_CUBIC",
"line_number": ... |
11794345743 | """Forms for adopt app."""
from flask_wtf import FlaskForm
from wtforms import StringField, TextAreaField, SelectField, BooleanField
from wtforms.validators import InputRequired, Optional, URL
class AddPetForm(FlaskForm):
"""Form for adding pets."""
name = StringField("Pet Name",
validators=[Inpu... | alex-rutan/flask-adopt | forms.py | forms.py | py | 1,082 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask_wtf.FlaskForm",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "wtforms.StringField",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "wtforms.validators.InputRequired",
"line_number": 11,
"usage_type": "call"
},
{
"api_name"... |
73552808371 | #!/usr/bin/env python
from PIL import Image
import fastzbarlight as zbarlight
import sys
file_path = sys.argv[1]
with open(file_path, 'rb') as image_file:
image = Image.open(image_file)
image.load()
codes = zbarlight.scan_codes('qrcode', image)
codes = [s.decode("utf-8") for s in codes]
print('QR codes: %s' ... | eugeneai/marcds | marcds/importer/scanning.py | scanning.py | py | 330 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image.open",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "fastzbarlight.scan_codes",
"l... |
28230052156 | '''
Given a string s and a set of n substrings. You are supposed to remove every instance of those n substrings from s so that s is of the minimum length and output this minimum length.
Have you met this question in a real interview?
Example
Given s = ccdaabcdbb, substrs = ["ab", "cd"]
Return 2
Explanation:
ccdaabc... | zsmountain/lintcode | python/bfs/624_remove_substrings.py | 624_remove_substrings.py | py | 1,372 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.deque",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "math.inf",
"line_number": 27,
"usage_type": "attribute"
}
] |
30347367200 | import json
import boto3
import csv
import datetime
from dateutil.tz import tzutc
import re
import botocore.exceptions
import os
SOURCE_REGION = 'eu-west-1'
IMAGE_ID = 'ami-016a0380xxxxxx'
source_client = boto3.resource('ec2', region_name=SOURCE_REGION)
# Function for getting Ec2 and their instance details
def copy_... | hem4nth/aws_ami_copy | lambda_function.py | lambda_function.py | py | 3,171 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "boto3.resource",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_num... |
33268782523 | from pyautogui import *
import pyautogui
import time
import keyboard
import cv2
import pytesseract as pyt
from pytesseract import Output
import numpy as np
import math
import time
import copy
from extractData import preprocessCheckedBank
def getActiveWords(roi_col):
active_words = []
myconfig = ... | chloehb/word-search-bot | notfound.py | notfound.py | py | 8,277 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pytesseract.image_to_data",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pytesseract.Output.DICT",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "pytesseract.Output",
"line_number": 17,
"usage_type": "name"
},
{
"api_nam... |
23105782208 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
"""
"""
import numpy as np
import tornado.web
import tornado.ioloop
from fedb import driver
from fedb import sql_router_sdk
import json
import lightgbm as lgb
bst = lgb.Booster(model_file='model.txt')
options = driver.DriverOptions("127.0.0.1:2181", ... | michaeljuntian/SparkSQLWithFeDB | predict_server.py | predict_server.py | py | 4,443 | python | en | code | null | github-code | 21 | [
{
"api_name": "lightgbm.Booster",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "fedb.driver.DriverOptions",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "fedb.driver",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "fedb.driver.Dr... |
17413322653 | import cv2
import time
import datetime
import numpy as np
_resolution = 800, 600
# _resolution = 1280, 720
cap = cv2.VideoCapture(0)
cap.set(cv2.CAP_PROP_FRAME_WIDTH, _resolution[0])
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, _resolution[1])
face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + "haarcascade_frontalf... | meoook/security-system | src/tutorial.py | tutorial.py | py | 2,283 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_PROP_FRAME_WIDTH",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "cv2.CAP_PROP_FRAME_HEIGHT",
"line_number": 12,
"usage_type": "attribute"
},
{
"api... |
27037007393 | import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.metrics import mean_squared_error
from sklearn.ensemble import GradientBoostingRegressor
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelEncoder
# 데이터를 읽어온다.
house_df = ... | dobbytk/NLP_study | Multicampus/ML/day6/GBM_AD_boston.py | GBM_AD_boston.py | py | 2,774 | python | ko | code | 0 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "sk... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.