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
42066024116
import os import sys import glob import subprocess import tempfile from typing import List from PyQt5 import QtWidgets, uic from PyQt5.QtWidgets import QFileDialog, QMessageBox # Imports from this project from release import year, lstupdt, spath, curb, ver, settingsPath, audioDirDefault, videoDirDefault from Config imp...
Solo-Dragon/yt-dl
gui5.py
gui5.py
py
33,604
python
en
code
null
github-code
21
[ { "api_name": "sys.platform.startswith", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.platform", "line_number": 13, "usage_type": "attribute" }, { "api_name": "release.ver", "line_number": 15, "usage_type": "name" }, { "api_name": "ctypes.windll.s...
133596648
""" jsonrules.py JSON rules loader for the server handlers ___________________ by: Ayzurus """ import json _root_path = "./" def setup(path: str): """sets up the working path to find the json files""" global _root_path _root_path = path def get(proto: str): """obtain the json rules for the given...
Ayzurus/pryxy-server
src/handlers/jsonrules.py
jsonrules.py
py
472
python
en
code
2
github-code
21
[ { "api_name": "json.load", "line_number": 26, "usage_type": "call" } ]
15425576663
''' 通用时间计算装饰器 ''' import time from functools import wraps def timethis(func): @wraps(func) def wrapper(*args,**kwargs): start=time.time() func(*args,**kwargs) #装饰的函数可以传参数或不传参数,不限形式的参数 stop=time.time() print(func.__name__,stop-start) return wrapper @timethis def countdown(n...
TimberiWolf/Python
Python/NewProject/function/gene_timing.py
gene_timing.py
py
660
python
en
code
0
github-code
21
[ { "api_name": "time.time", "line_number": 10, "usage_type": "call" }, { "api_name": "time.time", "line_number": 12, "usage_type": "call" }, { "api_name": "functools.wraps", "line_number": 8, "usage_type": "call" } ]
43636295380
import os import sys from OpenLP.arguments import DataArguments, ModelArguments from OpenLP.arguments import DenseEncodingArguments as EncodingArguments from OpenLP.dataset import InferenceDataset from OpenLP.modeling import DenseModelForInference from OpenLP.retriever import Retriever from transformers import AutoCon...
PeterGriffinJin/Patton
src/OpenLP/driver/infer.py
infer.py
py
1,784
python
en
code
14
github-code
21
[ { "api_name": "transformers.HfArgumentParser", "line_number": 14, "usage_type": "call" }, { "api_name": "OpenLP.arguments.ModelArguments", "line_number": 14, "usage_type": "name" }, { "api_name": "OpenLP.arguments.DataArguments", "line_number": 14, "usage_type": "name" ...
1043747213
import networkx as nx import pandas as pd from leeuwarden_kennis.config_data import base_file_location import datetime import queue as Q # example line: 6;"2054";"2017-08-17 13:27:00";"646.0";994771 def parse_line(line): splitted_line = line.rstrip().split(";") visitor_id = splitted_line[4] s...
KennisnetwerkDataScience/Wifi-punten-in-Leeuwarden
Groep 2/network_lwd_store_routes.py
network_lwd_store_routes.py
py
2,478
python
en
code
4
github-code
21
[ { "api_name": "datetime.datetime.strptime", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 14, "usage_type": "attribute" }, { "api_name": "queue.PriorityQueue", "line_number": 20, "usage_type": "call" }, { "api_name": ...
74768469813
#!/usr/bin/env python3 from peewee import InterfaceError import psycopg2 as __driver from packaging import version as __version import models.db_globals as __DBglobals from models.db import DBdata, Users, Actions, Reactions def __ensureVersionSystem(): if not DBdata.table_exists(): __DBglobals.db.create_t...
luannbertaud/YEP-Area
api/controllers/area_db.py
area_db.py
py
2,343
python
en
code
2
github-code
21
[ { "api_name": "models.db.DBdata.table_exists", "line_number": 10, "usage_type": "call" }, { "api_name": "models.db.DBdata", "line_number": 10, "usage_type": "name" }, { "api_name": "models.db_globals.db.create_tables", "line_number": 11, "usage_type": "call" }, { ...
4257772837
# coding=utf-8 from unittest import TestCase from common import get_link_from_query class TestGet_link_from_query(TestCase): def simple(self): string = "http://s.aliexpress.com/R3Ij6Rr6" expected = string actual = get_link_from_query(string) if actual != expected: self.f...
blackbass1988/aliprice_bot
lib/test_common.py
test_common.py
py
816
python
ru
code
0
github-code
21
[ { "api_name": "unittest.TestCase", "line_number": 5, "usage_type": "name" }, { "api_name": "common.get_link_from_query", "line_number": 9, "usage_type": "call" }, { "api_name": "common.get_link_from_query", "line_number": 20, "usage_type": "call" } ]
18589993131
# Licensed under a 3-clause BSD style license - see LICENSE.rst # This module contains dictionaries that can be used to set a matplotlib # plotting style. It is no longer documented/recommended as of Astropy v3.0 # but is kept here for backward-compatibility. __all__ = ["astropy_mpl_style_1", "astropy_mpl_style"] # ...
astropy/astropy
astropy/visualization/mpl_style.py
mpl_style.py
py
2,122
python
en
code
4,015
github-code
21
[ { "api_name": "cycler.cycler", "line_number": 72, "usage_type": "call" } ]
8472957105
import requests import matplotlib.pyplot as plt import datetime now = datetime.datetime.now() skrg = now.hour # Ambil data dari API url = 'https://api.open-meteo.com/v1/forecast?latitude=-0.46&longitude=117.14&hourly=temperature_2m,precipitation_probability,surface_pressure,cloudcover,vapor_pressure_deficit&f...
rezhani/Grafik-Prediksi-Cuaca
3 Gambar Tergabung 3 Grafik Temperatur, Presipitasi dan tekanan Samarinda dari Open Meteo.py
3 Gambar Tergabung 3 Grafik Temperatur, Presipitasi dan tekanan Samarinda dari Open Meteo.py
py
2,366
python
en
code
0
github-code
21
[ { "api_name": "datetime.datetime.now", "line_number": 5, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 5, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.py...
26918687912
from django.contrib.auth.models import User from django.http import HttpRequest from django.test import Client, RequestFactory, TestCase from django.urls import reverse from store.models import Category, Product from store.views import all_products class TestViewResponses(TestCase): def setUp(self): self...
tqt97/awesome-python
Django/Ecommerce-Store/Part1/store/tests/test_views.py
test_views.py
py
2,038
python
en
code
1
github-code
21
[ { "api_name": "django.test.TestCase", "line_number": 10, "usage_type": "name" }, { "api_name": "django.test.Client", "line_number": 12, "usage_type": "call" }, { "api_name": "django.test.RequestFactory", "line_number": 13, "usage_type": "call" }, { "api_name": "dj...
34310398948
from django.conf import settings from datetime import * from django.utils.timezone import localtime import pytz class DatetimeHelper: default_timezone = settings.TIME_ZONE time_zone = '' state = '' time_formate = '%b %d, %Y, %I:%M %p %Z' date_formate = '%b %d, %Y' dt = None stat...
solarpermit/solarpermit
website/utils/datetimeUtil.py
datetimeUtil.py
py
2,510
python
en
code
4
github-code
21
[ { "api_name": "django.conf.settings.TIME_ZONE", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 7, "usage_type": "name" }, { "api_name": "pytz.timezone", "line_number": 31, "usage_type": "call" }, { "api_name": "...
20511855642
from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QLabel, QVBoxLayout, QMessageBox, QRadioButton, QHBoxLayout, QGroupBox from random import shuffle app = QApplication([]) mainWindow = QWidget() mainWindow.setWindowTitle('Memory Card') mainWindow.cur_question = -1 quest...
portalixs/memory-card
my_memory_card.py
my_memory_card.py
py
3,932
python
en
code
1
github-code
21
[ { "api_name": "PyQt5.QtWidgets.QApplication", "line_number": 5, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 6, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QLabel", "line_number": 9, "usage_type": "call" }, { "api_name...
41822041020
import pandas as pd import numpy as np from sklearn.metrics import classification_report def load_dataset(filepath, encoding='utf-8'): #データセットをロードするfunc 引数は、実際にロードするファイルが格納されているpathと、文字コード df = pd.read_csv(filepath, encoding=encoding, delim_whitespace=True, names=['id', 'cat', 'label', 't1', 't2']) mappin...
MasashiAkahori/RTE
utils.py
utils.py
py
831
python
ja
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.argmax", "line_number": 17, "usage_type": "call" }, { "api_name": "sklearn.metrics.classification_report", "line_number": 20, "usage_type": "call" } ]
8390804327
import re from enum import unique from pycsp3.classes.auxiliary.ptypes import auto, AbstractType, TypeXML from pycsp3.classes.main.constraints import ConstraintUnmergeable from pycsp3.classes.main.variables import Variable from pycsp3.tools.inspector import checkType from pycsp3.tools.utilities import flatten @uniqu...
xcsp3team/pycsp3
classes/main/annotations.py
annotations.py
py
6,351
python
en
code
49
github-code
21
[ { "api_name": "pycsp3.classes.auxiliary.ptypes.AbstractType", "line_number": 12, "usage_type": "name" }, { "api_name": "pycsp3.classes.auxiliary.ptypes.auto", "line_number": 13, "usage_type": "call" }, { "api_name": "enum.unique", "line_number": 11, "usage_type": "name" ...
4748323752
import tornado.web import imagehash from PIL import Image import numpy as np import glob class ConditionalSearch(tornado.web.RequestHandler): def post(self): imglist = [] category = self.get_argument("category") group_number = self.get_argument("group_number") number_index = self.g...
wangchufeng/Narrative-flow-web
handler/conditional_search.py
conditional_search.py
py
5,705
python
en
code
1
github-code
21
[ { "api_name": "tornado.web.web", "line_number": 7, "usage_type": "attribute" }, { "api_name": "tornado.web", "line_number": 7, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 94, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_...
8867929806
import pwn import string import time p = pwn.process("WINEDEBUG=fixme-all /usr/bin/wine asby.exe", shell=True) charset = [] for c in string.ascii_lowercase + string.ascii_uppercase + string.digits + string.punctuation: charset.append(c) i = 0 flag = charset[i] while(True): time.sleep(.1) print(p.recv(tim...
WCSC/writeups
sha2017/asby/sol.py
sol.py
py
588
python
en
code
19
github-code
21
[ { "api_name": "pwn.process", "line_number": 5, "usage_type": "call" }, { "api_name": "string.ascii_lowercase", "line_number": 8, "usage_type": "attribute" }, { "api_name": "string.ascii_uppercase", "line_number": 8, "usage_type": "attribute" }, { "api_name": "stri...
29398356728
import cv2 import numpy as np def find_length(img_name): img = cv2.imread(img_name) img = img_long[:600, :] hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV) blur = cv2.bilateralFilter(hsv, 11, 17, 17) lower = np.array([6.0, 50, 50], dtype = "uint8") upper = np.array([13.0, 255, 255], dtype = "uint8") mask = cv...
yichern/baxter-tool
physical/length_finder_working.py
length_finder_working.py
py
1,122
python
en
code
4
github-code
21
[ { "api_name": "cv2.imread", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2HSV", "line_number": 9, "usage_type": "attribute" }, { "api_name": "cv2.bilateralFilter", ...
34058690350
from typing import Any, Optional import time from netmiko.no_enable import NoEnable from netmiko.no_config import NoConfig from netmiko.cisco.cisco_ios import CiscoIosBase class KeymileSSH(NoEnable, NoConfig, CiscoIosBase): def __init__(self, **kwargs: Any) -> None: kwargs.setdefault("default_enter", "\r...
ktbyers/netmiko
netmiko/keymile/keymile_ssh.py
keymile_ssh.py
py
1,453
python
en
code
3,278
github-code
21
[ { "api_name": "netmiko.no_enable.NoEnable", "line_number": 9, "usage_type": "name" }, { "api_name": "netmiko.no_config.NoConfig", "line_number": 9, "usage_type": "name" }, { "api_name": "netmiko.cisco.cisco_ios.CiscoIosBase", "line_number": 9, "usage_type": "name" }, ...
29863987740
import statistics from .. import db import datetime from . import UserModel # Modelo de Poema class Poem(db.Model): id = db.Column(db.Integer, primary_key=True) title = db.Column(db.String(100), nullable=False) body = db.Column(db.String(100), nullable=False) user_id = db.Column(db.Integer, db.ForeignK...
NKAmazing/thepoetsinn
Backend/main/models/Poems.py
Poems.py
py
2,550
python
en
code
1
github-code
21
[ { "api_name": "datetime.datetime.now", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 12, "usage_type": "attribute" }, { "api_name": "statistics.mean", "line_number": 29, "usage_type": "call" } ]
15144383067
from sqlalchemy import create_engine # mysql # from sqlalchemy import create_engine # engine = create_engine('mysql://scott:tiger@localhost/foo') # postgreSQL # pip install psycopg2 # from sqlalchemy import create_engine # engine = create_engine('postgresql://ユーザー名:パスワード@ホスト:ポート/DB名') # sqlite # from sqlalchemy impo...
miyamotok0105/sqlalchemy_sample
002db_sample.py
002db_sample.py
py
1,432
python
en
code
0
github-code
21
[ { "api_name": "sqlalchemy.create_engine", "line_number": 17, "usage_type": "call" } ]
15728650973
from collections import deque import sys n, k = map(int, sys.stdin.readline().split()) MAX = 100000 visited = [0] * (MAX+1) def bfs(): q = deque() q.append(n) while q: x = q.popleft() if x == k: print(visited[x]) break for i in (x-1, x+1, 2*x): i...
rubenlee1998/Baekjoon
22.08.15~08.21/boj1697.py
boj1697.py
py
437
python
en
code
0
github-code
21
[ { "api_name": "sys.stdin.readline", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 4, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 9, "usage_type": "call" } ]
70285116212
import torch import torch.nn as nn import torchvision.datasets as dsets import torchvision.transforms as transforms from torch.autograd import Variable import torch.utils.data as Data import numpy as np # Hyper Parameters input_size = 52 hidden_size1 = 1024 hidden_size2 = 1024 num_classes = 23 num_epochs = 200 batch_s...
Youngyi/Users-sReadingLog_recomand
FBN.py
FBN.py
py
4,271
python
en
code
0
github-code
21
[ { "api_name": "numpy.array", "line_number": 25, "usage_type": "call" }, { "api_name": "torch.Tensor", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 37, "usage_type": "call" }, { "api_name": "torch.Tensor", "line_number"...
13501850058
from re import T import telebot from gtts import gTTS # txt = 'python developer' txt = 'студенты' audio = gTTS(text=txt, lang='ru') audio.save('audio2.mp3') token = '5116709006:AAExkfzjSV8EpNxUqloTgnpZF8Jj-w809DQ' bot = telebot.TeleBot(token=token) @bot.message_handler(commands=['start']) def send_message(message):...
123rus/text-to-mp3-bot
mybot.py
mybot.py
py
632
python
en
code
0
github-code
21
[ { "api_name": "gtts.gTTS", "line_number": 8, "usage_type": "call" }, { "api_name": "telebot.TeleBot", "line_number": 13, "usage_type": "call" } ]
31983570377
""" Python scrypt to use the coinmarketcap's API More info on https://coinmarketcap.com/api/ """ import requests import json def send_request_cmc(): """ Sends request to coinmarketcap's API. """ url = 'https://api.coinmarketcap.com/v1/ticker/garlicoin/' response = requests.get(url) output ...
smaillot/garlic-blockchain-tools
garlic-explorer/coinmarketcap_API.py
coinmarketcap_API.py
py
468
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 13, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 18, "usage_type": "call" } ]
11671221755
import os import requests from dotenv import load_dotenv load_dotenv() def market_costs(start_date, end_date, store): """ :param start_date: 2020-09-23 will be + 00:00:00 :param end_date: 2020-09-23 will be 23:59:59 :param store: market_moscow_store, market_green_house, market_saratov, market_internet...
ShashkinRoman/beauty_box_and_market_reports
market_reports/utils/moysklad.py
moysklad.py
py
2,033
python
en
code
0
github-code
21
[ { "api_name": "dotenv.load_dotenv", "line_number": 4, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 19, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 20, "usage_type": "call" }, { "api_name": "requests.get", "line_number...
17887905903
from asyncio.constants import LOG_THRESHOLD_FOR_CONNLOST_WRITES from bz2 import decompress import gzip import os from itertools import islice from natsort import natsorted def get_contents(intput_file): with gzip.open(intput_file, 'rb') as f: file_content = f.read() lines_of_content = f...
wenjie-hoo/gzip-split
gzip_split.py
gzip_split.py
py
7,873
python
en
code
0
github-code
21
[ { "api_name": "gzip.open", "line_number": 10, "usage_type": "call" }, { "api_name": "gzip.open", "line_number": 17, "usage_type": "call" }, { "api_name": "gzip.open", "line_number": 19, "usage_type": "call" }, { "api_name": "gzip.open", "line_number": 25, ...
29490357333
import os import pickle import pandas as pd import traceback from datetime import datetime import ray from ray import tune from ray.tune import CLIReporter from ray.tune.schedulers import ASHAScheduler from functools import partial import torch from torch import optim from Experiments.Rulebased.config_new import hanabi...
hellovertex/hanabi-pool-of-states
Experiments/Rulebased/train_eval_new.py
train_eval_new.py
py
9,956
python
en
code
1
github-code
21
[ { "api_name": "torch.no_grad", "line_number": 34, "usage_type": "call" }, { "api_name": "pickle.loads", "line_number": 36, "usage_type": "call" }, { "api_name": "torch.LongTensor", "line_number": 37, "usage_type": "call" }, { "api_name": "utils.to_int", "line_...
26303449768
"""Poor Man's Bar Chart""" import sys import pprint from collections import defaultdict ALPHABET = 'abcdefghijklmnopqrstuvwxyz' TEXT = sys.argv[1] def main(): """Compare common letters in a sentence with common letters in a dict, return bar chart.""" mapped_chars = defaultdict(list) for cha...
dcoy/impractical-projects
chapter1/practice_projects/bar_chart/main.py
main.py
py
555
python
en
code
0
github-code
21
[ { "api_name": "sys.argv", "line_number": 7, "usage_type": "attribute" }, { "api_name": "collections.defaultdict", "line_number": 13, "usage_type": "call" }, { "api_name": "pprint.pprint", "line_number": 21, "usage_type": "call" } ]
42339965554
import cv2 import numpy as np class KalmanFilter: # Output as postion and velocity with input as position kf = cv2.KalmanFilter(4, 2) kf.measurementMatrix = np.array([[1, 0, 0, 0], [0, 1, 0, 0]], np.float32) kf.transitionMatrix = np.array([[1, 0, 1, 0], [0, 1, 0, 1], [0, 0, 1, 0], [0, 0, 0, 1]], np.fl...
Visweswaran-2001/Differential-Drive-Bot
KalmanFilter.py
KalmanFilter.py
py
804
python
en
code
0
github-code
21
[ { "api_name": "cv2.KalmanFilter", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 8, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_...
26884360732
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Level', fields=[ ('id', models.AutoField(verbos...
RumorIO/healersource
apps/ambassador/migrations/0001_initial.py
0001_initial.py
py
1,372
python
en
code
0
github-code
21
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.CreateModel", "line_number": 13, "usage_type": "call" }, ...
43664927741
from rest_framework import status from rest_framework.views import APIView from rest_framework.response import Response from django.db.models import Count from django.db.models.functions import TruncDate from api.models import ( Transaction, Company, ) from api.serializers import ( SummaryCompanySerialize...
JuanDM93/plerk-django-transactions
api/views/summary/company.py
company.py
py
2,006
python
en
code
0
github-code
21
[ { "api_name": "rest_framework.views.APIView", "line_number": 22, "usage_type": "name" }, { "api_name": "api.serializers.SummaryCompanySerializer", "line_number": 24, "usage_type": "name" }, { "api_name": "api.models.Company.objects.get", "line_number": 34, "usage_type": "...
12974367956
from PyQt5.QtWidgets import QApplication import sys import subprocess from pathlib import Path import time from PyQt5.QtWidgets import QMainWindow, QPushButton, QLabel, QProgressBar from utils import Docker class MainWindow(QMainWindow): def __init__(self): super().__init__() self.title = '资金...
xx529/FdAnys-gui
src/app.py
app.py
py
4,985
python
en
code
0
github-code
21
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 15, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QPushButton", "line_number": 21, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QProgressBar", "line_number": 22, "usage_type": "call" }, { ...
25554798737
""" Get an authorized handle to google sheets' API. """ from functools import cache from googleapiclient.discovery import build from httplib2 import Http from oauth2client import client, file, tools # type: ignore __all__ = [ "sheets_handle", ] SCOPES = "https://www.googleapis.com/auth/spreadsheets" @cache d...
andrewsmike/jasmine
tools/jasmine_tracker/app_base.py
app_base.py
py
683
python
en
code
4
github-code
21
[ { "api_name": "oauth2client.file.Storage", "line_number": 20, "usage_type": "call" }, { "api_name": "oauth2client.file", "line_number": 20, "usage_type": "name" }, { "api_name": "oauth2client.client.flow_from_clientsecrets", "line_number": 23, "usage_type": "call" }, ...
18592223222
""" Methods for modeling diffraction patterns in PSF profiles. Classes ------- ApertureDiffraction Analytical solution to the diffraction pattern. BesselJ1 Wrapper to the scipy.special j1 function. DiffractionWithoutPhase: Adds a diffraction pattern to an underlying PSF where the diffraction spikes l...
bbergerud/galsyn
galsyn/star/diffraction.py
diffraction.py
py
7,951
python
en
code
0
github-code
21
[ { "api_name": "torch.autograd.Function", "line_number": 30, "usage_type": "name" }, { "api_name": "torch.Tensor", "line_number": 34, "usage_type": "attribute" }, { "api_name": "scipy.special.j1", "line_number": 36, "usage_type": "call" }, { "api_name": "torch.Tens...
28477760632
from azure.identity import DefaultAzureCredential, InteractiveBrowserCredential from azure.ai.ml import load_component from azure.ai.ml import MLClient import glob def main(): # Get the credential to feed to MLClient instantiation try: credential = DefaultAzureCredential() # Check if given cre...
pennsefton/anomaly-detection-azure-cli
components/src/register_components.py
register_components.py
py
1,045
python
en
code
0
github-code
21
[ { "api_name": "azure.identity.DefaultAzureCredential", "line_number": 10, "usage_type": "call" }, { "api_name": "azure.identity.InteractiveBrowserCredential", "line_number": 15, "usage_type": "call" }, { "api_name": "azure.ai.ml.MLClient.from_config", "line_number": 18, "...
72262090613
""" Author: David Walshe Date: 21 February 2021 """ import logging from collections import namedtuple from itertools import chain from queue import Queue from typing import List, Union import os import json import urllib as urllib from concurrent.futures import ThreadPoolExecutor, as_completed, Future impor...
DavidWalshe93/isic_cli
src/cli/commands/image/download.py
download.py
py
7,284
python
en
code
0
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 25, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 27, "usage_type": "call" }, { "api_name": "queue.Queue", "line_number": 52, "usage_type": "call" }, { "api_name": "itertools.chain....
36100007435
from builtins import NotImplementedError from absl import app, flags, logging from absl.flags import FLAGS import cv2 import os import shutil import numpy as np import tensorflow as tf from core.yolov4 import filter_boxes,decode from tensorflow.python.saved_model import tag_constants import core.utils as utils from tqd...
chiahuilin0531/yolov4-tflite
tobe_delete/evaluate.py
evaluate.py
py
8,694
python
en
code
0
github-code
21
[ { "api_name": "absl.flags.DEFINE_string", "line_number": 15, "usage_type": "call" }, { "api_name": "absl.flags", "line_number": 15, "usage_type": "name" }, { "api_name": "absl.flags.DEFINE_string", "line_number": 17, "usage_type": "call" }, { "api_name": "absl.fla...
1115761283
#!/usr/bin/python __author__ = 'espen1,ytay2' ''' Naive Classifier Module for NLP Project Written by Espen Albert, Tay Yi Usage - run Python naive.py in CLI (does not support argparser yet) Uses Naive Classifier for Sentiment Analysis Poor Accuracy - 60-70% :( ''' from nltk import word_tokenize import nltk import...
brightbird/Youtube2Sentiments
naive.py
naive.py
py
7,652
python
en
code
5
github-code
21
[ { "api_name": "nltk.word_tokenize", "line_number": 43, "usage_type": "call" }, { "api_name": "nltk.NaiveBayesClassifier.train", "line_number": 153, "usage_type": "call" }, { "api_name": "nltk.NaiveBayesClassifier", "line_number": 153, "usage_type": "attribute" }, { ...
9457954314
import torch import numpy as np from torch.utils.data import Dataset, DataLoader class Mesh_Dataset(Dataset): def __init__(self, data, device='cpu'): mesh_data = np.stack(tuple(data[0]), -1).reshape(-1, len(data[0])) comput_data = np.stack(tuple(data[1]), -1).reshape(-1, len(data[1])) ...
phy-ml/neural-solver
NET_Solver/mesh/mesh_data.py
mesh_data.py
py
1,916
python
en
code
2
github-code
21
[ { "api_name": "torch.utils.data.Dataset", "line_number": 6, "usage_type": "name" }, { "api_name": "numpy.stack", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.stack", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.from_numpy", ...
1324133979
import os import cv2 import uuid import numpy as np def save_image_cv2(save_file, target_frame): cv2.imwrite(save_file, target_frame) return save_file def read_image_cv2(image_path): return cv2.imread(image_path) def generate_random_color(): """Generate a random RGB color.""" return (np.random...
wladradchenko/wunjo.wladradchenko.ru
portable/src/deepfake/src/utils/imageio.py
imageio.py
py
1,762
python
en
code
404
github-code
21
[ { "api_name": "cv2.imwrite", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.random.randint", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.random", "line_n...
71154456372
#notes: removed ufo sightings with durations longer than 5 hours and shorter than 5 seconds from the csv. from math import log def csv_to_dict(file): # read csv into dictionary durs, lats, longs, commas = [],[],[],0 for line in open(file): commas = 0 dur, lat, lon = "", "", "" ...
oeschutz/cs_241_project
work.py
work.py
py
1,725
python
en
code
0
github-code
21
[ { "api_name": "math.log", "line_number": 20, "usage_type": "call" }, { "api_name": "pandas.DataFrame.from_dict", "line_number": 31, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 31, "usage_type": "attribute" }, { "api_name": "matplotlib....
32738034850
import os import csv import numpy as np import cv2 from zipfile import ZipFile from PIL import Image from shutil import copyfile import prepRetinaNet # # Update an image dictionary extracted from the trainingCSV, by looking in a set of directories, # and updating if dictionary if found # class ImageDescriptor: d...
tap22sf/CS221-Project
dataConditioning.py
dataConditioning.py
py
15,603
python
en
code
0
github-code
21
[ { "api_name": "PIL.Image.open", "line_number": 47, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 47, "usage_type": "name" }, { "api_name": "numpy.resize", "line_number": 78, "usage_type": "call" }, { "api_name": "os.path.exists", "line_numb...
42459565645
from django.conf.urls import url from . import views urlpatterns = [ # list all the reviews in the applications url(r'^$', views.review_list, name="review_list"), # detailing all the information about the reviews url(r'^reviews/(?P<review_id>[0-9]+)/$', views.review_detail, name="review_detail"), # listing a...
muhiza/reco
reviews/urls.py
urls.py
py
1,026
python
en
code
0
github-code
21
[ { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 11, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 14, "usage_type": "call" }, { "api_name": "django....
33899678903
from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar import attr if TYPE_CHECKING: from ..models.money import Money T = TypeVar("T", bound="OrderMetricsInterval") @attr.s(auto_attribs=True) class OrderMetricsInterval: r"""Contains order metrics. Attributes: interval (str): The int...
milyord/sp-api
sp/sales/models/order_metrics_interval.py
order_metrics_interval.py
py
3,429
python
en
code
1
github-code
21
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 5, "usage_type": "name" }, { "api_name": "typing.TypeVar", "line_number": 9, "usage_type": "call" }, { "api_name": "typing.Dict", "line_number": 34, "usage_type": "name" }, { "api_name": "typing.Any", "line_...
8743893904
from flask import flash, request, session from flask_app.config.mysqlconnection import connectToMySQL from flask_app import app from flask_app.models import user class Recipe: def __init__(self, data): self.id = data["id"] self.name = data["name"] self.description = data["descrip...
Rodvak/flask_app
models/recipee.py
recipee.py
py
3,570
python
en
code
0
github-code
21
[ { "api_name": "flask.request.form", "line_number": 23, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 23, "usage_type": "name" }, { "api_name": "flask.request.form", "line_number": 24, "usage_type": "attribute" }, { "api_name": "flask.r...
39321863478
import yaml config = yaml.load(open("bobuxserver.yaml", 'r')) requiredParams = [ 'dbpath', #bobuxserver.db 'certpath' #bobuxserver.websockets ] for i in requiredParams: if not (i in config): raise KeyError("Config value " + i + " was not found.")
ItsMajestiX/Bobux
BobuxServer/bobuxserver/config/__init__.py
__init__.py
py
270
python
en
code
0
github-code
21
[ { "api_name": "yaml.load", "line_number": 3, "usage_type": "call" } ]
39548019849
from django import forms from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.template.loader import render_to_string from django.utils.translation import get_language from django.utils.translation import ugettext from django.utils.translation import ugettext_lazy as _...
kaleidos/intranet
backend/autoreports/wizards.py
wizards.py
py
7,461
python
en
code
15
github-code
21
[ { "api_name": "django.forms.ModelForm", "line_number": 14, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 14, "usage_type": "name" }, { "api_name": "django.forms.CharField", "line_number": 16, "usage_type": "call" }, { "api_name": "djang...
10387365373
import skimage.io as io import numpy as np img = io.imread("C://Users//kamel//Music//misc//4.1.05.tiff") D=np.array([[50,100],[150,200]]) img=img.astype(float) q=img/85 x=q+(q-85*q) io.imshow(x) io.show()
KameliaZaman/DIP-Lab
RnD/Alasdair/task3.8.py
task3.8.py
py
207
python
en
code
0
github-code
21
[ { "api_name": "skimage.io.imread", "line_number": 4, "usage_type": "call" }, { "api_name": "skimage.io", "line_number": 4, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 5, "usage_type": "call" }, { "api_name": "skimage.io.imshow", "line_n...
20549720173
from typing import List, Dict, Any from hana04.apt.extensible.constants import HANA_META_PROPERTY_NAME from hana04.apt.extensible.hana_object_meta import HanaObjectMeta from hana04.apt.extensible.hana_property_spec import HanaPropertySpec from hana04.apt.extensible.property_type_spec import VariableTypeSpec from...
pkhungurn/hana04-python
src/hana04/apt/extensible/hana_late_deserializable_meta.py
hana_late_deserializable_meta.py
py
4,639
python
en
code
0
github-code
21
[ { "api_name": "hana04.apt.extensible.hana_object_meta.HanaObjectMeta", "line_number": 17, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 18, "usage_type": "name" }, { "api_name": "hana04.apt.extensible.hana_object_meta.HanaObjectMeta.assert_hana_object_can_be...
44273360010
import requests from bs4 import BeautifulSoup import csv file = 'cards2.csv' HOST = 'https://www.avito.ru' URL = 'https://www.avito.ru/saratov/avtomobili/toyota/camry-ASgBAgICAkTgtg20mSjitg3UoCg?cd=1&p=1&radius=200' HEADERS = {'User-Agent' : 'Mozilla/5.0 (windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gec...
Boris7739/Python
Parser-HTTP.py
Parser-HTTP.py
py
2,237
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 13, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 18, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 34, "usage_type": "call" } ]
71668880372
from collections import deque import logging from os import path import zmq from distladder3.utils import Match from distladder3.utils import unique_match_key from distladder3.utils import get_num_lines # AddMatch class MsgRequestAddMatch(object): def __init__(self): self.match_id = None self.players = [] ...
dachidahu/SC2AgentsZoo2
agent_TLeagueFormal14/DistLadder3/distladder3/cores/match_server.py
match_server.py
py
5,909
python
en
code
2
github-code
21
[ { "api_name": "zmq.Context", "line_number": 61, "usage_type": "call" }, { "api_name": "zmq.TCP_KEEPALIVE", "line_number": 62, "usage_type": "attribute" }, { "api_name": "zmq.TCP_KEEPALIVE_CNT", "line_number": 63, "usage_type": "attribute" }, { "api_name": "zmq.TCP...
6158994721
from constants.project_constants import * from exceptions.api_exception_handler import * import json import requests # @param {string} AUTH_TOKEN - The authentication token def ping_user(AUTH_TOKEN: str, APPLICATION_ID: str, USER_ID: str) -> dict: if not AUTH_TOKEN: raise Exception("Authentication token ...
Nomad-Media/samples
nomad-samples/portal/py/guest_registration/account/ping_user.py
ping_user.py
py
927
python
en
code
1
github-code
21
[ { "api_name": "requests.post", "line_number": 27, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 27, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 31, "usage_type": "call" } ]
20028734332
import torchvision.transforms as transforms input_size = (224,224) # once the images are loaded, how do we pre-process them before being passed into the network # by default, we resize the images to 64 x 64 in size # and normalize them to mean = 0 and standard-deviation = 1 based on statistics collected from data_tr...
khaoulabelahsen/MVA-RecVis
A3_belahsen_khaoula/data.py
data.py
py
1,033
python
en
code
1
github-code
21
[ { "api_name": "torchvision.transforms.Compose", "line_number": 9, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 9, "usage_type": "name" }, { "api_name": "torchvision.transforms.Resize", "line_number": 10, "usage_type": "call" }, { ...
29966272212
import sys, os, string, threading import paramiko from paramiko import SSHClient from scp import SCPClient cmd = "./led_show.sh" outlock = threading.Lock() def workon(host): ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect(host, username='pi', password='lux...
ZheyuHuang/rgb-led-matrix-display
pssh.py
pssh.py
py
1,103
python
en
code
0
github-code
21
[ { "api_name": "threading.Lock", "line_number": 7, "usage_type": "call" }, { "api_name": "paramiko.SSHClient", "line_number": 11, "usage_type": "call" }, { "api_name": "paramiko.AutoAddPolicy", "line_number": 12, "usage_type": "call" }, { "api_name": "scp.SCPClient...
42723799056
import matplotlib import pandas as pd import matplotlib.pyplot as plt import matplotlib.ticker as ticker import numpy as np import math class GraphBuilder (): def __init__(self, backend=None): if backend == None or backend == "": return else: matplotlib.use(backend) d...
corneel27/day-ahead
prog/da_graph.py
da_graph.py
py
2,946
python
en
code
36
github-code
21
[ { "api_name": "matplotlib.use", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 19, "usage_type": "name" }, { "api_name": "numpy.ara...
7421726622
from __future__ import unicode_literals from django.core.validators import RegexValidator from django.db import models from django.utils.translation import ugettext as _ # Create your models here. class Device(models.Model): class Meta(object): verbose_name = _("Meta") verbose_name_plural = _("M...
ljk4160/tsschecker-django
MetaManagement/models.py
models.py
py
5,174
python
en
code
0
github-code
21
[ { "api_name": "django.db.models.Model", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 10, "usage_type": "name" }, { "api_name": "django.utils.translation.ugettext", "line_number": 12, "usage_type": "call" }, { "ap...
36468822583
import pytest import requests import json @pytest.fixture() def fixture_dog_api_url(): return 'https://dog.ceo/api/' # Получение количества всех картинок по указанной подпороде LIST ALL SUB-BREED IMAGES @pytest.fixture() def fixture_number_all_subbreed_image(test_input, expected_result, fixture_dog_api_url): ...
antaresalex/DZ_OTUS_QA_June
DZ_lesson_4/dog_ceo_test/conftest.py
conftest.py
py
954
python
en
code
1
github-code
21
[ { "api_name": "pytest.fixture", "line_number": 6, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 16, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 12, "usage_type": "call" } ]
12556000330
#-- my_code_hw01.py #-- hw01 GEO1015.2020 #-- DANIEL DOBSON #-- 5152739 #-- DMITRI VISSER #-- 4279913 #-- import outside the standard Python library are not allowed, just those: import math import numpy as np import scipy.spatial import startin #----- #-- tmp import by us, will be removed before handing in the assi...
LouiseMerle/GEO1015_hw01
hw/01/code_daniel.py
code_daniel.py
py
11,139
python
en
code
0
github-code
21
[ { "api_name": "numpy.min", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.min", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 38, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 39, ...
26969588095
from collections import defaultdict, deque import functools import math import re def part1(data): rows = parse_data(data) r = rows[0] window = deque(r[:4]) i = 4 while len(set(window)) < 4: window.append(r[i]) i += 1 window.popleft() return i def part2(data): ro...
hckhilliam/programming
AdventOfCode/2022/06.py
06.py
py
578
python
en
code
0
github-code
21
[ { "api_name": "collections.deque", "line_number": 11, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 24, "usage_type": "call" } ]
32851878171
from datetime import datetime from corehq.apps.sms.models import CallLog, INCOMING, OUTGOING from corehq.apps.sms.mixin import VerifiedNumber from corehq.apps.smsforms.app import start_session, _get_responses from corehq.apps.smsforms.models import XFormsSession, XFORMS_SESSION_IVR from corehq.apps.app_manager.models i...
gmimano/commcaretest
corehq/apps/ivr/api.py
api.py
py
9,437
python
en
code
0
github-code
21
[ { "api_name": "dimagi.utils.web.get_url_base", "line_number": 23, "usage_type": "call" }, { "api_name": "corehq.apps.hqmedia.models.HQMediaMapItem.format_match_map", "line_number": 24, "usage_type": "call" }, { "api_name": "corehq.apps.hqmedia.models.HQMediaMapItem", "line_nu...
18341781625
import numpy as np from scipy.special import expit #---------------------------------------------------------- Defining Needed Functions --------------------------------------------------------------------------------------------------------------------- #-----------------------------------------------------...
AnonymousDeepDeducingCode/DeepDeducing
Run.py
Run.py
py
15,571
python
en
code
0
github-code
21
[ { "api_name": "numpy.zeros", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.random.randint", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 16, "usage_type": "attribute" }, { "api_name": "numpy.random.randi...
73888324532
""" Given an array of meeting time intervals where intervals[i] = [starti, endi], determine if a person could attend all meetings. """ from typing import List class Solution: def canAttendMeetings0(self, intervals: List[List[int]]) -> bool: for i in range(len(intervals)): for j in range(i+1, le...
xiaofanc/leetcode
0252-meeting-rooms.py
0252-meeting-rooms.py
py
1,684
python
en
code
0
github-code
21
[ { "api_name": "typing.List", "line_number": 7, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 18, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 30, "usage_type": "name" } ]
3827055411
import streamlit as st import pandas as pd import altair as alt import numpy as np from PIL import Image import plotly.graph_objs as go import requests from bs4 import BeautifulSoup # Set the title and icon of the app st.set_page_config(page_title="Masters 2023 Predictor", page_icon=":golf:", initial_sidebar_state="e...
andyuttley/Masters2023
mastersapp2023.py
mastersapp2023.py
py
10,950
python
en
code
1
github-code
21
[ { "api_name": "streamlit.set_page_config", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 19, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 22, "usage_type": "call" }, { "api_name": "pandas.DataF...
7301784907
# -*- coding: utf-8 -*- """ Created on Tue Oct 21 15:34:37 2014 @author: Lindsay This script is used to construct and test the generator function for a single Merkel cell-neurite connection. The input of the function is stress, and output is current. """ import numpy as np import os from scipy.interpolate import int...
yw5aj/PlosCompBiol
gen_function.py
gen_function.py
py
4,919
python
en
code
0
github-code
21
[ { "api_name": "os.path.join", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_number": 28, "usage_type": "attribute" }, { "api_name": "numpy.genfromtxt", "line_number": 29, "usage_type": "call" }, { "api_name": "model_constants.FE_NUM", ...
15302059927
#!/usr/bin/env python # -*- encoding: utf-8 -*- import pandas as pd import numpy as np from sklearn.metrics import mean_squared_error from sklearn.model_selection import GroupKFold import lightgbm as lgb import xgboost as xgb import catboost as cat def get_dictionary(s): try: d = eval(s) except: ...
bigangrybird/Kaggle
tmdb/func.py
func.py
py
11,693
python
en
code
0
github-code
21
[ { "api_name": "pandas.DataFrame", "line_number": 38, "usage_type": "call" }, { "api_name": "numpy.expm1", "line_number": 41, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 43, "usage_type": "call" }, { "api_name": "sklearn.metrics.mean_squared_...
2109339684
from concurrent.futures import ThreadPoolExecutor, as_completed from functools import partial import requests from resumable.version import user_agent from resumable.file import ResumableFile from resumable.chunk import resolve_chunk from resumable.util import CallbackDispatcher, Config MiB = 1024 * 1024 class Re...
acroz/resumable.py
resumable/core.py
core.py
py
4,231
python
en
code
5
github-code
21
[ { "api_name": "resumable.util.Config", "line_number": 54, "usage_type": "call" }, { "api_name": "requests.Session", "line_number": 64, "usage_type": "call" }, { "api_name": "resumable.version.user_agent", "line_number": 65, "usage_type": "call" }, { "api_name": "c...
6771846747
""" 메인 """ import os from fastapi import FastAPI from fastapi_sqlalchemy import DBSessionMiddleware from mangum import Mangum from server_modules.database import SQLALCHEMY_DATABASE_URL from server_modules.startup import apply_custom_openapi, apply_catch_internal_error, apply_alembic_startup, \ apply_include_route...
Kang-hadam/BreedCatcher
app/main.py
main.py
py
1,459
python
en
code
0
github-code
21
[ { "api_name": "os.getenv", "line_number": 16, "usage_type": "call" }, { "api_name": "fastapi.FastAPI", "line_number": 17, "usage_type": "call" }, { "api_name": "server_modules.startup.apply_alembic_startup", "line_number": 23, "usage_type": "call" }, { "api_name":...
20782004273
import yaml import argparse import numpy as np import torch import torch.backends.cudnn as cudnn from easydict import EasyDict as edict import random from datasets import * from models import * from experiments import * from utils.utils import setup_default_logging if __name__ == '__main__': #### Error: Initializ...
Celiali/FixMatch
run_load.py
run_load.py
py
2,342
python
en
code
9
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 20, "usage_type": "call" }, { "api_name": "yaml.safe_load", "line_number": 30, "usage_type": "call" }, { "api_name": "yaml.YAMLError", "line_number": 31, "usage_type": "attribute" }, { "api_name": "easydict.E...
8543607089
"""empty message Revision ID: f0d57b692961 Revises: a7cf62463ec8 Create Date: 2022-03-07 17:16:37.161813 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'f0d57b692961' down_revision = 'a7cf62463ec8' branch_labels = None depends_on = None def upgrade(): # ...
jessy523/os_test
migrations/versions/f0d57b692961_.py
f0d57b692961_.py
py
1,377
python
en
code
0
github-code
21
[ { "api_name": "alembic.op.create_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy.Integ...
23114167116
#!/usr/bin/env python from typing import List, Union import argparse from collections import OrderedDict from IPython.terminal.embed import InteractiveShellEmbed from ebird.api import get_species_observations, get_regions from geojson import Feature, Point, FeatureCollection from geojson import dump as geojson_dump fro...
brotherjack/CFL-MODU-GIS-Project
ebird_modu_sightings.py
ebird_modu_sightings.py
py
26,588
python
en
code
0
github-code
21
[ { "api_name": "unicodedata.lookup", "line_number": 35, "usage_type": "call" }, { "api_name": "unicodedata.lookup", "line_number": 36, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 40, "usage_type": "call" }, { "api_name": "logging.INFO"...
16085807658
from django.test import TestCase,Client from django.urls import reverse from blog.models import Book,Comment import json class TestViews(TestCase): def setUp(self): self.client = Client() self.home_url = reverse('blog-home') self.book_url = reverse('book-detail') def test_book_list_vi...
muhit009/muhit
django_project/blog/tests/test_views.py
test_views.py
py
710
python
en
code
0
github-code
21
[ { "api_name": "django.test.TestCase", "line_number": 6, "usage_type": "name" }, { "api_name": "django.test.Client", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.reverse", "line_number": 10, "usage_type": "call" }, { "api_name": "django.urls...
33695515969
#!/usr/bin/env python2 import sys import argparse import time import datetime import subprocess import re import math import socket import pickle import atexit import cmd import stats import cPickle as pickle def main(): parser = argparse.ArgumentParser(description="CATWOMAN benchmark program.") parser.add_ar...
jledet/catbench
catbench.py
catbench.py
py
7,504
python
en
code
1
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 18, "usage_type": "call" }, { "api_name": "atexit.register", "line_number": 38, "usage_type": "call" }, { "api_name": "ab.stop_slaves", "line_number": 38, "usage_type": "attribute" }, { "api_name": "atexit.re...
39648601643
import numpy as np import fluent_data_loader as fdl from scipy.optimize import minimize from sklearn.cluster import KMeans class SearchState: def __init__(self, val, hist=[]): self._val = val self._hist = hist def get_val(self): return self._val def get_hist(self): return ...
BinRoot/Fluent-Extractor
svm_rank_linux64/hierarchical_plan.py
hierarchical_plan.py
py
4,600
python
en
code
6
github-code
21
[ { "api_name": "numpy.var", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.random.standard_normal", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 27, "usage_type": "attribute" }, { "api_name": "numpy.linalg...
24411925330
from django.core.mail import send_mail from django.conf import settings from django.shortcuts import render from .models import signUp,itemDetail from .forms import signUpForm,ContactForm,itemDetailForm # Create your views here. def navbar(request): return render(request,"base.html",{}) def examplefluid(request): r...
sachinalok143/django-work
src/newsletter/views.py
views.py
py
2,335
python
en
code
0
github-code
21
[ { "api_name": "django.shortcuts.render", "line_number": 9, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 11, "usage_type": "call" }, { "api_name": "forms.signUpForm", "line_number": 19, "usage_type": "call" }, { "api_name": "model...
19492899784
from os import makedirs, path import time import warnings import sys from enum import Enum from typing import Dict, Optional, Union, List, Any, Callable from qarnot.retry_settings import RetrySettings from qarnot.forced_network_rule import ForcedNetworkRule from . import get_url, raise_on_error, _util from .status im...
qarnot/qarnot-sdk-python
qarnot/task.py
task.py
py
73,192
python
en
code
12
github-code
21
[ { "api_name": "typing.Any", "line_number": 31, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 32, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 33, "usage_type": "name" }, { "api_name": "pool.Pool", "line_number": 34, ...
40173189388
import platform from selenium import webdriver from common import constant from config import log def get_driver(dirver_type="chrome"): log.info("Chrome driver start begin.") global DRIVER_PATH, driver if dirver_type == "chrome": options = webdriver.ChromeOptions() if platform.uname().sys...
zouxianshi/UIautomate
common/driver_generator.py
driver_generator.py
py
1,597
python
en
code
0
github-code
21
[ { "api_name": "config.log.info", "line_number": 9, "usage_type": "call" }, { "api_name": "config.log", "line_number": 9, "usage_type": "name" }, { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 12, "usage_type": "call" }, { "api_name": "selenium.we...
72247945974
import numpy as np from scipy.optimize import minimize from optimz import Generator from model import Utils def quality_ratio(w, tc, pc, tn): multis_wtc = np.multiply(w, tc) sums_wtc = np.sum(multis_wtc, axis=1) + 1 multis_wpc = np.multiply(w, pc) sums_wpc = np.sum(multis_wpc, axis=1) + 1 divisi...
elviskoci/xtable_finder
optimz/tuner.py
tuner.py
py
6,591
python
en
code
2
github-code
21
[ { "api_name": "numpy.multiply", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.multiply", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number":...
1235221406
import json from typing import List, Tuple, Dict, DefaultDict from collections import defaultdict from dataclasses import dataclass, asdict from copy import deepcopy @dataclass class Trade: """Trade DTO""" price: float qty: int buy_id: str sell_id: str @dataclass class OrderRq: """Order Requ...
functional-specification-based-testing/translator
translator.py
translator.py
py
22,686
python
en
code
0
github-code
21
[ { "api_name": "dataclasses.dataclass", "line_number": 8, "usage_type": "name" }, { "api_name": "dataclasses.dataclass", "line_number": 17, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 47, "usage_type": "name" }, { "api_name": "typing.Default...
13333811137
import matplotlib.pyplot as plt x_values = [1, 2, 3, 4, 5] y_values = [1, 4, 9, 16, 25] plt.scatter(x_values, y_values) plt.title("square numbers", fontsize=20) plt.xlabel("input_numbers", fontsize=15) plt.ylabel("squares", fontsize=15) plt.tick_params(axis="both", labelsize=14) plt.show()
roohom/demo
matplotlib/mpl02.py
mpl02.py
py
294
python
uk
code
0
github-code
21
[ { "api_name": "matplotlib.pyplot.scatter", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 6, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.title", "line_number": 7, "usage_type": "call" }, { "api_name": "matp...
42633864282
from tap_kit import TapExecutor from tap_kit.utils import timestamp_to_iso8601, transform_write_and_count, \ format_last_updated_for_request import singer import base64 import time import datetime from bs4 import BeautifulSoup LOGGER = singer.get_logger() EXTRACTION_WINDOW = datetime.timedelta(hours=1) LOOKBACK_W...
Radico/tap-hudsonltd
tap_hudsonltd/executor.py
executor.py
py
4,333
python
en
code
2
github-code
21
[ { "api_name": "singer.get_logger", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 13, "usage_type": "call" }, { "api_name": "tap_kit.TapEx...
13026330685
from enum import Enum, auto from dpkt import ip, ethernet, tcp, udp, http, UnpackError, ip6 from dpkt.utils import mac_to_str, inet_to_str from datetime import datetime class PacketDirection(Enum): """ 表征网络流量的方向 """ UNKNOWN = auto() # 未知 FORWARD = auto() # 正向 REVERSE = auto() # 反向 class F...
zoeyyyzou/pcap-analyser
pcap_extractor/Flow.py
Flow.py
py
7,151
python
en
code
0
github-code
21
[ { "api_name": "enum.Enum", "line_number": 7, "usage_type": "name" }, { "api_name": "enum.auto", "line_number": 11, "usage_type": "call" }, { "api_name": "enum.auto", "line_number": 12, "usage_type": "call" }, { "api_name": "enum.auto", "line_number": 13, "...
44478111965
# !/usr/bin/env python3 # -*- encoding: utf-8 -*- # @author: condi # @file: CZWCrawl.py # @time: 19-7-17 上午11:10 import requests import pymongo import random from datetime import datetime, timedelta from time import strftime, localtime, sleep, time from urllib import parse from bs4 import BeautifulSoup from requests...
condilin/BMS
services/CZWCrawl/Crawl.py
Crawl.py
py
10,860
python
en
code
0
github-code
21
[ { "api_name": "pymongo.MongoClient", "line_number": 34, "usage_type": "call" }, { "api_name": "CZWCrawl.config.config.MONGO_HOST", "line_number": 34, "usage_type": "argument" }, { "api_name": "CZWCrawl.config.config.MONGO_PORT", "line_number": 34, "usage_type": "argument"...
40350820934
""" Django command to wait for the database to be available. """ import time import os import sys import shutil import subprocess from django.db.utils import OperationalError from django.core.management.base import BaseCommand class Command(BaseCommand): """Django command to wait for database.""" ...
Marak123/SoundTime
backend/apis/management/commands/migrate_all_models.py
migrate_all_models.py
py
3,022
python
en
code
0
github-code
21
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 14, "usage_type": "name" }, { "api_name": "os.listdir", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number": 28, "usage_type": "call" }, { "api_name": "os.p...
75197605813
import sys from collections import deque T = int(input()) for i in range(T): N = list(map(int, input().split())) N_list = deque(map(int, sys.stdin.readline().split())) cnt = 0 while N_list: max_num = max(N_list) p_num = N_list.popleft() N[1] -= 1 if max_num == p_num: ...
keeeeeey/baekjoon_algorithm
level18(queue, deque)/프린터 큐.py
프린터 큐.py
py
519
python
en
code
0
github-code
21
[ { "api_name": "collections.deque", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.stdin.readline", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 7, "usage_type": "attribute" } ]
1787502790
""" .. module:: get_data_galex :synopsis: Returns extracted GALEX spectral data as a JSON string. .. moduleauthor:: Scott W. Fleming <fleming@stsci.edu> """ import collections from astropy.io import fits from data_series import DataSeries from parse_obsid_galex import parse_obsid_galex #-------------------- def ...
spacetelescope/MASTDataDelivery
get_data_galex.py
get_data_galex.py
py
3,589
python
en
code
1
github-code
21
[ { "api_name": "collections.namedtuple", "line_number": 58, "usage_type": "call" }, { "api_name": "parse_obsid_galex.parse_obsid_galex", "line_number": 66, "usage_type": "call" }, { "api_name": "astropy.io.fits.open", "line_number": 77, "usage_type": "call" }, { "a...
37944379037
import inspect import io import httpx import pytest from async_asgi_testclient import TestClient from typing_extensions import Annotated from kui.asgi import ( Body, Cookie, Depends, Header, Kui, Path, Query, UploadFile, ) @pytest.mark.asyncio async def test_path(): app = Kui() ...
abersheeran/kui
tests/asgi/test_parameters.py
test_parameters.py
py
5,841
python
en
code
276
github-code
21
[ { "api_name": "kui.asgi.Kui", "line_number": 23, "usage_type": "call" }, { "api_name": "typing_extensions.Annotated", "line_number": 28, "usage_type": "name" }, { "api_name": "kui.asgi.Path", "line_number": 28, "usage_type": "call" }, { "api_name": "async_asgi_tes...
35597940460
import cv2 import numpy as np from collections import deque import tkinter as tk from tkinter import * import time import math yellowLower=(29,127,121) yellowHigher=(179,255,255) def isclose(a,b,maxi): if a <= b+maxi and a>=b-maxi: return True else: return False cap = cv2.VideoCapture("data/v...
Theophile-Wemaere/ball_tracking_cv2
temp.py
temp.py
py
3,411
python
en
code
0
github-code
21
[ { "api_name": "cv2.VideoCapture", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.GaussianBlur", "line_number": 38, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 39, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2HSV", ...
4231502117
# -*- coding: utf-8 -*- """ Created on Wed Sep 19 14:54:28 2018 @author: gydwo """ import csv import matplotlib.pyplot import random import operator import agentframework f = open('in.txt', newline='') #create the big, empty file i.e. 'environment environment = [] #read in the csv data reader = csv.reader(f, qu...
danialowen/Leeds_Day_3
I_O.py
I_O.py
py
1,465
python
en
code
0
github-code
21
[ { "api_name": "csv.reader", "line_number": 22, "usage_type": "call" }, { "api_name": "csv.QUOTE_NONNUMERIC", "line_number": 22, "usage_type": "attribute" }, { "api_name": "agentframework.Agent", "line_number": 49, "usage_type": "call" }, { "api_name": "matplotlib....
19608085676
import requests url = 'https://petstore.swagger.io/v2/user' payload = { "id": 25251717, "username": "LucasSosa", "firstName": "Lucas", "lastName": "Sosa", "email": "lucassosa83@gmail.com", "password": "123456123456", "phone": "44556677", "userStatus": 1 } response = requests.post(url, json=payload) ...
Asinatum/HiberusWikipedia
Ejercicio 2 - TEST API/create_user.py
create_user.py
py
531
python
en
code
0
github-code
21
[ { "api_name": "requests.post", "line_number": 15, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 23, "usage_type": "call" } ]
12378046154
import urllib2 import json def google_search(search_term): """ Searches for a `search_term` which should be a string or a value convertable to string. Parameters: - str `search_term`: a string to search for Returns a tuple (on success): - first value is a list of search results for t...
michaelpri10/WelcomeBot
google_search.py
google_search.py
py
1,336
python
en
code
11
github-code
21
[ { "api_name": "urllib2.Request", "line_number": 31, "usage_type": "call" }, { "api_name": "urllib2.urlopen", "line_number": 32, "usage_type": "call" }, { "api_name": "json.load", "line_number": 35, "usage_type": "call" } ]
14367860671
import os import logging import pickle5 as pickle import torch import torch.utils.data import trimesh import numpy as np from scipy.spatial import cKDTree as KDTree import core import core.errors as errors def select_samples(pts, values, num_samples=None, uniform_ratio=0.5): """ Randomly select a subset of ...
Terascale-All-sensing-Research-Studio/DeepJoin
deepjoin/python/core/data.py
data.py
py
33,618
python
en
code
9
github-code
21
[ { "api_name": "numpy.expand_dims", "line_number": 46, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 47, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 48, "usage_type": "call" }, { "api_name": "numpy.random.randint", ...
43095842019
# -*- coding: utf-8 -* from openpyxl import load_workbook from openpyxl.styles import Border, Side import sqlite3 import datetime import sys import glob, os import os.path import platform import shutil from datetime import datetime def main(): lerdata_identifica_qtde() def lerdata_identifica_qtde(): ...
msilva1610/lerexcel
Gera_Resumo_Projetos.py
Gera_Resumo_Projetos.py
py
4,054
python
pt
code
0
github-code
21
[ { "api_name": "os.path.dirname", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.join", "line...
73036594613
from __future__ import print_function import os import time import random import torch import torch.nn as nn import torch.optim as optim from torch.autograd import Variable from six.moves import xrange import data_utils from seq2seq import Seq2Seq, Seq2Tree criterion = nn.NLLLoss() def get_batch(data, encoder_size...
LiuFang816/SALSTM_py_data
python/popol1991_seq2seq-pytorch-example/seq2seq-pytorch-example-master/translate.py
translate.py
py
8,136
python
en
code
9
github-code
21
[ { "api_name": "torch.nn.NLLLoss", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 16, "usage_type": "name" }, { "api_name": "six.moves.xrange", "line_number": 21, "usage_type": "call" }, { "api_name": "random.choice", "line_...
41237573882
#This file implements a variational Bayesian Gaussian Mixture Model for clustering import numpy as np import math import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages import copy import cProfile as profile import time import scipy import scipy.special import copy import time from src imp...
JohnGBaker/xgmmvb
gmmvb.py
gmmvb.py
py
55,506
python
en
code
0
github-code
21
[ { "api_name": "math.log", "line_number": 45, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 45, "usage_type": "attribute" }, { "api_name": "math.log", "line_number": 46, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 46, "...
36564637778
from .pages.base_page import BasePage from .pages.product_page import ProductPage from .pages.basket_page import BasketPage from .pages.login_page import LoginPage from .pages.locators import BasePageLocators from .pages.url import Url import pytest @pytest.mark.authorized_user class TestUserAddToBasketFromProductPag...
motobeerx/RoadToTestDeveloper
test_product_page.py
test_product_page.py
py
3,332
python
en
code
0
github-code
21
[ { "api_name": "pages.login_page.LoginPage", "line_number": 15, "usage_type": "call" }, { "api_name": "pages.url.Url.LOGIN_PAGE_URL", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pages.url.Url", "line_number": 15, "usage_type": "name" }, { "api_na...
8371463314
from PyQt6.QtWidgets import QWidget, QHBoxLayout, QLabel, QLineEdit, QCheckBox, QSlider from PyQt6.QtCore import QSize, QLocale, Qt from PyQt6.QtGui import QFont, QDoubleValidator from models import Parameter from scipy.interpolate import interp1d # type: ignore from numpy import log10 # from time import time class ...
ZychuDev/relACs
views/ParameterSlider.py
ParameterSlider.py
py
6,597
python
en
code
0
github-code
21
[ { "api_name": "PyQt6.QtWidgets.QWidget", "line_number": 11, "usage_type": "name" }, { "api_name": "models.Parameter", "line_number": 14, "usage_type": "name" }, { "api_name": "PyQt6.QtWidgets.QHBoxLayout", "line_number": 16, "usage_type": "name" }, { "api_name": "...
71818457014
import logging import os from .expander import Expander class Config: def __init__(self, buildout, name, options): self.name = name self.options = options self.logger = logging.getLogger(self.name) self.clusters_conf = os.path.join( buildout['buildout']['directory']...
henryj885/flock
flock-conf/flock_conf/recipe.py
recipe.py
py
759
python
en
code
0
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "expander.Expander.from_fi...
27686698877
#!/usr/bin/python2 import cv import cv2 import copy import numpy import math import os # import matplotlib.pyplot as plt # crashes when using opencv windows import Gnuplot gp = Gnuplot.Gnuplot() gp("set style data lines") gost_width = [520.0, 408.0] gost_height = 112.0 gost_ratio = [gost_height / w for w in gost_wid...
herolover/ANPR
python/main.py
main.py
py
2,394
python
en
code
6
github-code
21
[ { "api_name": "Gnuplot.Gnuplot", "line_number": 12, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 24, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 31, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": ...
18405249399
import random from bisect import bisect_left from collections import deque, defaultdict, Counter from heapq import * import unittest from typing import List class TrieNode: def __init__(self): self.children = defaultdict(TrieNode) # self.children = {} self.end_node = False class WordDiction...
afzalsiddique/problem-solving
Problem_Solving_Python/leetcode/lc211.py
lc211.py
py
3,763
python
en
code
1
github-code
21
[ { "api_name": "collections.defaultdict", "line_number": 9, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 50, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 65, "usage_type": "name" }, { "api_name": "unittest.T...
17817287935
import sys from collections import defaultdict from heap.heapster import CustomHeap class FindConnectedComponents: def __init__(self, V: int): self.vertices = V self.graph = [[] * self.V] def add_edge(self, u, v): self.graph[u].append(v) self.graph[v].append(u) def dfs(s...
sephirot94/random_algos
euler/trees/graph.py
graph.py
py
28,175
python
en
code
0
github-code
21
[ { "api_name": "collections.defaultdict", "line_number": 57, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 106, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 241, "usage_type": "call" }, { "api_nam...