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
35815294779
# -*- coding: utf-8 -* import os import re import numpy as np import six from PIL import Image from itertools import chain import glob import time import matplotlib.pylab as plt from sklearn.datasets import fetch_mldata import chainer import chainer.links as L import chainer.functions as F from chainer im...
switch004/DeepLearning
VGG.py
VGG.py
py
27,120
python
en
code
0
github-code
97
[ { "api_name": "numpy.zeros", "line_number": 42, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 48, "usage_type": "call" }, { "api_name": "numpy.random.permutation", "line_number": 52, "usage_type": "call" }, { "api_name": "numpy.random", "li...
2424515732
import asyncio from telegram import Update from telegram.ext import ApplicationBuilder, ContextTypes, MessageHandler, filters, CommandHandler TOKEN = '<token>' ADMIN_IDS = [123, 0, ] MAIN_ADMIN_ID = 0 async def do_echo(update: Update, context: ContextTypes.DEFAULT_TYPE): await update.message.reply_text( ...
webdevtoday/simple-python-telegram-bot
decorators/main.py
main.py
py
2,586
python
en
code
0
github-code
97
[ { "api_name": "telegram.Update", "line_number": 13, "usage_type": "name" }, { "api_name": "telegram.ext.ContextTypes.DEFAULT_TYPE", "line_number": 13, "usage_type": "attribute" }, { "api_name": "telegram.ext.ContextTypes", "line_number": 13, "usage_type": "name" }, { ...
9852006619
from django.db import models class Request(models.Model): method = models.CharField(max_length=16, verbose_name='Request Method') datetime = models.DateTimeField() date = models.DateField(null=True, blank=True) def __str__(self): return f"{self.method} request at {self.datetime}" # s...
bukh-sal/countViews
core/models.py
models.py
py
1,062
python
en
code
0
github-code
97
[ { "api_name": "django.db.models.Model", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 4, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 5, "usage_type": "call" }, { "api_name": "...
73849711677
import os import math import random import pygame as pg class Mars(pg.sprite.Sprite): """Planet that rotates and projects gravitational field.""" basedir = os.path.dirname(__file__) mars_img_path = os.path.join(basedir, 'assets/mars.png') water_img_path = os.path.join(basedir, 'assets/mars_water.png')...
yngtodd/orbiter
orbiter/bodies/planet.py
planet.py
py
1,846
python
en
code
0
github-code
97
[ { "api_name": "pygame.sprite", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.join", "line...
74464973117
from __future__ import unicode_literals import codecs import json import os.path import re FLAGS = re.UNICODE | re.IGNORECASE # Some examples dates from the data # ================================= # # Birth dates # =========== # "* 1122" # "* um 1480" # "geb. 10.11.1810" # "* 3o.9.1859" # # Death dates # ========...
CodeforKarlsruhe/streetnames
parse_raw_data.py
parse_raw_data.py
py
10,905
python
en
code
7
github-code
97
[ { "api_name": "re.UNICODE", "line_number": 9, "usage_type": "attribute" }, { "api_name": "re.IGNORECASE", "line_number": 9, "usage_type": "attribute" }, { "api_name": "re.search", "line_number": 76, "usage_type": "call" }, { "api_name": "re.match", "line_numbe...
25432852426
import socket import os import datetime import time HOST = '192.168.2.50' PORT = 8485 ip_port=(HOST,PORT) filename = "ghijkl" socket1 = socket.socket(socket.AF_INET, socket.SOCK_STREAM) socket1.connect((HOST, PORT)) socket1.sendto(filename.encode(encoding='utf-8'),ip_port) source="" with open('test.tx...
amircisco/stream-client
client.py
client.py
py
638
python
en
code
0
github-code
97
[ { "api_name": "socket.socket", "line_number": 11, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 11, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREAM", "line_number": 11, "usage_type": "attribute" }, { "api_name": "time.sleep"...
37524534184
# coding: UTF-8 """ Created on 2021/11/27 @author: Mark Hsu """ from shop.models import Item, Image, Category from shop.Serializer import ItemSerializer from rest_framework import status from rest_framework.views import APIView from rest_framework.response import Response from django.http import Http404, HttpResponse ...
markrsl/shop-demo
shop/api.py
api.py
py
4,477
python
en
code
0
github-code
97
[ { "api_name": "PIL.Image.open", "line_number": 20, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 20, "usage_type": "name" }, { "api_name": "PIL.Image.init", "line_number": 28, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number"...
31767318220
import pygraphviz as pgv import gol gol.init() TENSOR_GRAPH_ATTR = dict(fontname="Times-Roman", fontsize=14, shape="polygon", style="rounded", color="black", fixedsize=False) PARA_GRAPH_ATTR = dict(fontname="Times-Roman", fontsize=14, shape="polygon", ...
gsq7474741/bp
train_mlp_my_impl.py
train_mlp_my_impl.py
py
5,564
python
en
code
0
github-code
97
[ { "api_name": "gol.init", "line_number": 5, "usage_type": "call" }, { "api_name": "pygraphviz.AGraph", "line_number": 17, "usage_type": "call" }, { "api_name": "gol.set_value", "line_number": 24, "usage_type": "call" }, { "api_name": "gol.set_value", "line_num...
17673324105
import mplcursors import numpy as np import pandas as pd from matplotlib import pyplot as plt, cm from matplotlib.colors import Normalize from pyod.models.knn import KNN from sklearn import preprocessing from sklearn.metrics import mean_squared_error df = pd.read_csv("data/3D_spatial_network.csv").sample(n=500).reset_...
neemashahbazi/Distrust
code/regression.py
regression.py
py
4,296
python
en
code
0
github-code
97
[ { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.MinMaxScaler", "line_number": 13, "usage_type": "call" }, { "api_name": "sklearn.preprocessing", "line_number": 13, "usage_type": "name" }, { "api_name...
16519733748
import pandas as pd from nltk import re df = pd.read_csv("Dataset/covid19_tweets.csv", usecols=['text']) df = df.sample(frac = 0.001, replace = False, random_state=42) # Take %0.5 of total reviews print(df.describe()) for tweet in df['text']: print("\n", tweet) tweet = re.sub('((www\.[^\s]+)|(https?://[^...
yunusemre002/Data-Science
tweet_preprocessing.py
tweet_preprocessing.py
py
614
python
en
code
0
github-code
97
[ { "api_name": "pandas.read_csv", "line_number": 4, "usage_type": "call" }, { "api_name": "nltk.re.sub", "line_number": 10, "usage_type": "call" }, { "api_name": "nltk.re", "line_number": 10, "usage_type": "name" }, { "api_name": "nltk.re.sub", "line_number": 1...
27224265993
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license import tkinter import tkinter.messagebox import customtkinter from PIL import Image,ImageTk import os import tkinter as tk from tkinter import filedialog import cv2 import time from speednotification import * import tkinter import tkinter.messagebox import customtkinter fro...
UsmanNiz/Bal-Speed-Detection-Using-YOLO
detect.py
detect.py
py
14,673
python
en
code
0
github-code
97
[ { "api_name": "pathlib.Path", "line_number": 61, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 63, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 64, "usage_type": "call" }, { "api_name": "sys.path", "line_numbe...
73347078079
from pathlib import Path import json import logging import os from typing import Dict, Iterator from composer.efile.xmlio import JsonTranslator from concurrent.futures import ProcessPoolExecutor logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) root_dir: str = "/Volumes/Bulk/...
falconandy/composer
meta/debug/diagnose_filings_slowness.py
diagnose_filings_slowness.py
py
1,253
python
en
code
0
github-code
97
[ { "api_name": "logging.basicConfig", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_...
5822948746
# -*- coding: utf-8 -*- """ Created on Thu Nov 28 15:11:05 2019 @author: Allen """ import os #import tensorflow as tf import numpy as np #import random import csv import math #import matplotlib.pyplot as ma #import keras #from keras.utils import np_utils #from keras.models import Sequential #from keras.layers import D...
qiwueyrteywuqi/sample
Wavelet_Packet_Decomposition_analysis.py
Wavelet_Packet_Decomposition_analysis.py
py
14,059
python
en
code
0
github-code
97
[ { "api_name": "tkinter.filedialog.askdirectory", "line_number": 30, "usage_type": "call" }, { "api_name": "tkinter.filedialog", "line_number": 30, "usage_type": "name" }, { "api_name": "tkinter.END", "line_number": 40, "usage_type": "attribute" }, { "api_name": "o...
45527709212
import sys sys.path.insert(0, './utils') import numpy as np import matplotlib.pyplot as plt import math from cliffwalk import CliffWalk import time import sys import tracemalloc def policy_evaluation(P, R, policy, gamma=0.9, tol=1e-2): """ Args: P: np.array transition matrix (NsxNaxNs) ...
SamuelDiai/MVA_ReinforcementLearning
assignment1/vipi.py
vipi.py
py
7,832
python
en
code
0
github-code
97
[ { "api_name": "sys.path.insert", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "numpy.linalg.solve", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.linalg", "li...
72237809278
import torch import torch.nn as nn import torch.nn.init import torchvision.models as models from torch.autograd import Variable from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence from torch.nn.utils.weight_norm import weight_norm import torch.backends.cudnn as cudnn from torch.nn.utils.cli...
zhoqiah/MAADG
SCAttention.py
SCAttention.py
py
11,966
python
en
code
0
github-code
97
[ { "api_name": "torch.abs", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.div", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.pow", "line_number": 29, "usage_type": "call" }, { "api_name": "torch.div", "line_number": 30, ...
21388692926
import os import zipfile from pathlib import Path def build(): os.chdir("src/") x = Path('./') packs = list(filter(lambda y: y.is_dir(), x.iterdir())) packs = [pack for pack in packs if not str(pack).startswith((".", "__"))] print("Building packs...") for pack in packs: print("...
leonmelein/StickerAutomation
build.py
build.py
py
975
python
en
code
3
github-code
97
[ { "api_name": "os.chdir", "line_number": 7, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 8, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 17, "usage_type": "call" }, { "api_name": "zipfile.ZipFile", "line_number": 23,...
28950694502
import numpy as np def rescale_affine(input_affine, voxel_dims, target_center_coords=None): """ This function uses a generic approach to rescaling an affine to arbitrary voxel dimensions. It allows for affines with off-diagonal elements by decomposing the affine matrix into u,s,v (or rather the n...
cristinaperez9/research_project_metastasis
preprocessing/utils.py
utils.py
py
1,938
python
en
code
1
github-code
97
[ { "api_name": "numpy.linalg.svd", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.linalg", "line_number": 27, "usage_type": "attribute" }, { "api_name": "numpy.diag", "line_number": 33, "usage_type": "call" }, { "api_name": "skimage.img_as_float", ...
29388389824
from collections import deque MAX_CAFFEINE = 300 mg_caffeine = deque(map(int, input().split(', '))) # last energy_drinks = deque(map(int, input().split(', '))) # first initial_caffeine = 0 while mg_caffeine and energy_drinks: intake = mg_caffeine[-1] * energy_drinks[0] if initial_caffeine + intak...
kaloyangavrailov/SoftUni_Python_Advanced
Exam Prep/energy_drinks.py
energy_drinks.py
py
889
python
en
code
0
github-code
97
[ { "api_name": "collections.deque", "line_number": 3, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 5, "usage_type": "call" } ]
16303003219
from typing import Any, Dict, List, Type, TypeVar import attr from ..models.coach_sequence_group import CoachSequenceGroup T = TypeVar("T", bound="CoachSequence") @attr.s(auto_attribs=True) class CoachSequence: """ Attributes: groups (List[CoachSequenceGroup]): """ groups: List[CoachSequen...
glanch/bahnhofs-abfahrten-client
bahnhofs_abfahrten_client/models/coach_sequence.py
coach_sequence.py
py
1,113
python
en
code
0
github-code
97
[ { "api_name": "typing.TypeVar", "line_number": 7, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 17, "usage_type": "name" }, { "api_name": "models.coach_sequence_group.CoachSequenceGroup", "line_number": 17, "usage_type": "name" }, { "api_name...
70791694078
import sys sys.path.append("../") import torch.nn as nn from einops import rearrange from models.modules import ISAB, SAB, PMA from models.networks import build_mlp class SpatioTemporalLSTM(nn.Module): def __init__(self, dim_input=2, num_outputs=1, dim_output=128, dim_hidden=128, num_heads=4, ln=True): s...
gridgway/Astrometric_TSeries_ML
models/spatio_temporal.py
spatio_temporal.py
py
2,096
python
en
code
0
github-code
97
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "torch.nn.Module", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.nn", "line...
23375311724
import os import json import logging import logging.config import pickle import re import time from pickle import UnpicklingError from html import escape # noinspection PyPackageRequirements from typing import List from telegram import User, Message, InlineKeyboardMarkup, ChatMember, TelegramError, Audio from telegra...
zeroone2numeral2/stt-bot
bot/utilities/utilities.py
utilities.py
py
4,695
python
en
code
1
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 20, "usage_type": "call" }, { "api_name": "json.load", "line_number": 25, "usage_type": "call" }, { "api_name": "logging.config.dictConfig", "line_number": 27, "usage_type": "call" }, { "api_name": "logging.config"...
41948314510
#-*- coding:utf8 -*- ''' 朴素贝叶斯 ''' import operator import sys import math import numpy as np import logging import collections logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) class Bayes(object): DEFAULT_PROBE = 0.01 def __init__(self, lambda_=None, default_probe=None, with_log=False): ...
spiritwiki/codes
nbayes/naivebayes.py
naivebayes.py
py
2,963
python
en
code
26
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 14, "usage_type": "attribute" }, { "api_name": "collections.Counter", "line_number": 33, "usage_type": "call" }, { "api_name": "math.log", ...
15986842101
#!/usr/bin/python3 """Alta3 || Tracking ISS""" # notice we no longer need to import urllib.request or json try: import os import requests # import zachrequests except Exception as z: print("Oh i see you're trying to grab a module from team... go look at xyz location for that code!", z) exit() ## D...
rzfeeser/2021-02-08-pyansDB
reqests-ride-iss.py
reqests-ride-iss.py
py
1,024
python
en
code
0
github-code
97
[ { "api_name": "requests.get", "line_number": 19, "usage_type": "call" } ]
8317579511
import os from zipfile import ZipFile from PIL import Image from django.conf import settings from celery import shared_task @shared_task def remove_archive(zip_file): os.remove(os.path.abspath(os.path.join(settings.BASE_DIR, 'media', 'images', zip_file))) @shared_task def make_th...
oluwafenyi/thumbnailer
thumbnailer/tasks.py
tasks.py
py
1,221
python
en
code
1
github-code
97
[ { "api_name": "os.remove", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_numbe...
34389290770
""" api module for serving MySQL data as JSON Object by using Flask Rest library. """ from flask import Flask, jsonify, request from flask_restful import Resource, Api from peewee import MySQLDatabase from models import Car import settings as s app = Flask(__name__) database = MySQLDatabase(database=s.SCHEMA, user=s....
alcmrt/WebScraperAndRestApi
api.py
api.py
py
1,995
python
en
code
0
github-code
97
[ { "api_name": "flask.Flask", "line_number": 12, "usage_type": "call" }, { "api_name": "peewee.MySQLDatabase", "line_number": 13, "usage_type": "call" }, { "api_name": "settings.SCHEMA", "line_number": 13, "usage_type": "attribute" }, { "api_name": "settings.USER",...
16635056736
import numpy as np import matplotlib.pyplot as plt def EulerIntegrator(h, y0, f): return y0 + h * f(y0) def oneStepErrorPlot(f, y, integrator): eps = np.finfo(float).eps steps = np.logspace(-10, 0, 50) y0 = y(0) yPrecise = [y(t) for t in steps] yApproximate = [integrator(t, y0, f) for t in s...
StBalashov/Computational-and-Applied-Maths
computaional methods/4.py
4.py
py
4,440
python
en
code
0
github-code
97
[ { "api_name": "numpy.finfo", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.logspace", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.maximum", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.max", "line_number...
71293150399
import os, re import json import pdb import collections from bs4 import BeautifulSoup from django.utils.text import slugify sourceLink = 'http://www.cbeta.org/' source = 'CBETA' works = [] def jaggedListToDict(text): node = { str(i): t for i, t in enumerate(text) } node = collections.OrderedDict(sorted(node.items()...
cltk/chinese_text_cbeta_02
converter.py
converter.py
py
1,885
python
en
code
1
github-code
97
[ { "api_name": "collections.OrderedDict", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path", "line_number": 24, "usage_type": "attribute" }, { "api_name": "os.makedirs", ...
26727398739
from typing import Any, Union from types_ import * def empty_char(x): return x == ' ' or x == '\n' or x == '\t' def create_form(string: str) -> Form: form_list = [] # intermediatary var, will contain the argument list for final 'Form' temp = "" i = 0 while i < len(string): # print("form...
yattew/not-a-lisp
src/parser_.py
parser_.py
py
2,430
python
en
code
2
github-code
97
[ { "api_name": "typing.Union", "line_number": 52, "usage_type": "name" } ]
22101941132
import matx import multiprocessing as mp @matx.script def my_func(a: int) -> None: print("a: ", a) def t(): print("[multiprocessing] child begin", flush=True) matx.pmap(my_func, [1, 2, 3, 4]) print("pmap_threads", matx.pipeline.TXObject.default_sess.get_pmap_threads()) print("async_threads", mat...
bytedance/matxscript
test/trace/test_multiprocessing.py
test_multiprocessing.py
py
652
python
en
code
363
github-code
97
[ { "api_name": "matx.script", "line_number": 5, "usage_type": "attribute" }, { "api_name": "matx.pmap", "line_number": 12, "usage_type": "call" }, { "api_name": "matx.pipeline.TXObject.default_sess.get_pmap_threads", "line_number": 13, "usage_type": "call" }, { "ap...
42541949090
#! /usr/bin/env python import pandas as pd import numpy as np #from sklear.linear_model import LinearRegression as LR from pymer4.models import Lmer,Lm male_df = pd.read_csv('./male_df.csv') female_df = pd.read_csv('./female_df.csv') male_df = male_df[male_df['Aviary'] != 12] male_df = male_df[male_df['Aviary'] != ...
aperkes/AviaryAnalysis
individual_group.py
individual_group.py
py
2,762
python
en
code
0
github-code
97
[ { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "pymer4.models.Lmer", "line_number": 31, "usage_type": "call" }, { "api_name": "pymer4.models.Lmer"...
74291380799
from gui import Renderer import game_checkers as gm import pygame as pg from game import predictNextStep class Controller: def __init__(self, screen): self.game = gm.Checkers() self.handeled_checker_pos = None self.screen = screen def run_player2player_game(self): running = Tru...
MaksKuchuk/checkers-bot
py/controller.py
controller.py
py
2,870
python
en
code
0
github-code
97
[ { "api_name": "game_checkers.Checkers", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.event.get", "line_number": 15, "usage_type": "call" }, { "api_name": "pygame.event", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pygame.QUIT"...
22312355622
# -*- coding:utf-8 -*- import numpy as np import codecs import time import tools from keras.models import load_model # load training sentiment data # Input: @path of the sentiment data # Output:@sample list # @label list # @ID2label transition table def load_training_data_sentiment(path): ...
hz-wang/JD_comment_classification
sentiment_training.py
sentiment_training.py
py
8,139
python
en
code
0
github-code
97
[ { "api_name": "codecs.open", "line_number": 16, "usage_type": "call" }, { "api_name": "codecs.open", "line_number": 22, "usage_type": "call" }, { "api_name": "codecs.open", "line_number": 28, "usage_type": "call" }, { "api_name": "codecs.open", "line_number": ...
39980324038
import sqlite3 as sqlite class Consult: def __init__(self): pass def add_consult_in_database(self): con = sqlite.connect('test.db') con.execute("PRAGMA foreign_keys = 1") patient_id_local = [] with con: cur1 = con.cursor() cur...
narkia/Dental-Application-IuNiA_2019_python
DntlClnc_IuNiA_Consult.py
DntlClnc_IuNiA_Consult.py
py
1,754
python
en
code
0
github-code
97
[ { "api_name": "sqlite3.connect", "line_number": 11, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 32, "usage_type": "call" } ]
22102680794
import torch import torch.nn as nn ''' Append padding to keep concat size & input-output size ''' class DownBlock(nn.Module): def __init__(self, in_dim, out_dim): super(DownBlock, self).__init__() self.block = nn.Sequential( nn.MaxPool2d(kernel_size=2, stride=2), nn.Conv2d(...
kangyeolk/Segmentation-Pytorch
models/unet.py
unet.py
py
3,781
python
en
code
5
github-code
97
[ { "api_name": "torch.nn.Module", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 8, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.nn", "line_...
45069497339
import pandas as pd import matplotlib.pyplot as plt import sys if __name__ == "__main__": df = pd.read_csv(sys.argv[1]) counts = [] diff = df['AVAILABLE BIKES'].diff() for i in range(40): sub_df = df[df['AVAILABLE BIKES'].diff() > i] counts.append(len(sub_df)) plt.figure() x = ...
Neimhin/msc
machine-learning/final/src/delta.py
delta.py
py
525
python
en
code
0
github-code
97
[ { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 6, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplo...
31851219322
from django.urls import path from . import views app_name = "wongnork" urlpatterns = [ path("register/", views.register_request, name="register"), path("login/", views.login_request, name="login"), path("home-page/",views.index, name="home-page"), path("restaurants/",views.restaurants, name="restaura...
WongNork/wongnork
wongnork/urls.py
urls.py
py
965
python
en
code
1
github-code
97
[ { "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", "line_number": 10, "usage_type": "call" }, { "api_name": "django.urls.path", ...
19044137430
import pytest from fake_useragent import UserAgent from selenium import webdriver from selenium_stealth import stealth @pytest.fixture def browser(): useragent = UserAgent() options = webdriver.ChromeOptions() # options.add_argument("--headless") браузер без интерфейса options.add_experime...
Viacheslav-Trifonov/testing_citilink.ru_with_selenium
conftest.py
conftest.py
py
1,682
python
en
code
0
github-code
97
[ { "api_name": "fake_useragent.UserAgent", "line_number": 9, "usage_type": "call" }, { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 10, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 10, "usage_type": "name" }, { "api_n...
27108122588
# -*- coding: utf-8 -*- """ Created on Wed Dec 4 13:23:58 2019 @author: 佘建友 """ """ 基本模块分为4个模块: (1)存储模块、 (2)获取模块、 (3)检测模块、 (4)接口模块 (5)调度模块 """ MAX_SCORE = 100 MIN_SCORE = 0 INITIAL_SCORE = 10 REDIS_HOST = 'localhost' REDIS_PORT = '6379' REDIS_PASSWORD = 'None' REDIS_KEY = 'proxies' import redis...
shejianyou/data-news
anti-crawl/代理.py
代理.py
py
10,033
python
en
code
4
github-code
97
[ { "api_name": "redis.StricRedis", "line_number": 34, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 53, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 57, "usage_type": "call" }, { "api_name": "utils.get_page", "li...
2234975681
import logging from collections import namedtuple from distutils.util import strtobool from django.core.management.base import BaseCommand from django.db import transaction from pathlib import Path from psycopg2.extras import execute_values from psycopg2.sql import SQL from usaspending_api.common.csv_helpers import re...
fedspendingtransparency/usaspending-api
usaspending_api/references/management/commands/load_agencies.py
load_agencies.py
py
10,212
python
en
code
265
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 24, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 28, "usage_type": "call" }, { "api_name": "usaspending_api.common.etl.postgres.mixins.ETLMixin", "line_number": 56, "usage_type": "attribut...
16607583768
import numpy as np import matplotlib.pyplot as plt from collections import defaultdict from .utils import find_two_values_with_max_activations def supergauss(x,a,n=4): x = np.clip(x,-100.,100.) return np.exp(-(x/a)**(2*n)) def selective_activation(x,a=0.001): return a/(a+x**2) def double_selective_activa...
ericotjo001/explainable_ai
xaia/SQANN/src/model.py
model.py
py
10,913
python
en
code
4
github-code
97
[ { "api_name": "numpy.clip", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.clip", "line_number": 22, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_num...
26004299916
from flask import Flask, render_template,url_for,request,redirect,flash from werkzeug import secure_filename import os from fastai.basic_train import load_learner from fastai.vision import * from fastai.vision.image import open_image import warnings warnings.filterwarnings("ignore") UPLOAD_FOLDER = './static/image'...
sidharth-157/Cricket_Vs_Baseball_batsman
hello.py
hello.py
py
1,346
python
en
code
0
github-code
97
[ { "api_name": "warnings.filterwarnings", "line_number": 9, "usage_type": "call" }, { "api_name": "fastai.basic_train.load_learner", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 12, "usage_type": "call" }, { "api_name": "fl...
39253830322
from tir import Webapp import unittest from tir.technologies.apw_internal import ApwInternal import datetime import time DateSystem = datetime.datetime.today().strftime('%d/%m/%Y') DateVal = datetime.datetime(2120, 5, 17) """------------------------------------------------------------------- /*/{Protheus.doc} PLSA010T...
totvs/tir-script-samples
Protheus_WebApp/Modules/SIGAPLS/PLSA008TESTCASE.py
PLSA008TESTCASE.py
py
2,000
python
en
code
27
github-code
97
[ { "api_name": "datetime.datetime.today", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 7, "usage_type": "attribute" }, { "api_name": "datetime.datetime", "line_number": 8, "usage_type": "call" }, { "api_name": "unittes...
44414068122
import json import csv colunas_clam = ['tweet_id', 'tweet_username', 'tweet_text', 'id'] with open('temer.csv', 'a') as f: writer = csv.writer(f) writer.writerow(colunas_clam) for line in open('tweets_temer.json', 'r'): linha = json.loads(line) if not 'limit' in linha: valores = [linha['id_str...
lucashelfs/mac0499
códigos/clam/fix-tweets.py
fix-tweets.py
py
499
python
en
code
0
github-code
97
[ { "api_name": "csv.writer", "line_number": 6, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 10, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 15, "usage_type": "call" } ]
73939487997
""" The setup module. Responsible for CDK imports and versioning. """ import setuptools with open('README.md') as fp: long_description = fp.read() CDK_VERSION = None with open('.env.aws', 'r') as env_file: env_vars = env_file.read().split('\n') for env_var in env_vars: if env_var.startswith('C...
donkersgoed/graphql-playground
setup.py
setup.py
py
1,710
python
en
code
6
github-code
97
[ { "api_name": "setuptools.setup", "line_number": 24, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 35, "usage_type": "call" } ]
41865473268
import keyboard import mouse import time import random import pyperclip import tkinter as tk from tkinter import ttk import pyautogui from win32api import GetSystemMetrics import win32api r = tk.Tk() r.title('КлаваБот') r.resizable(False, False) rusLet = "йцукенгшщзхъфывапролджэячсмитьбюЙЦУКЕНГШЩЗХЪФЫВ...
RustamPython/KlavaBot-v1.0
KlavaBot.pyw
KlavaBot.pyw
pyw
6,367
python
ru
code
1
github-code
97
[ { "api_name": "tkinter.Tk", "line_number": 12, "usage_type": "call" }, { "api_name": "tkinter.BooleanVar", "line_number": 25, "usage_type": "call" }, { "api_name": "win32api.GetSystemMetrics", "line_number": 28, "usage_type": "call" }, { "api_name": "win32api.GetS...
35445634941
## Copyright (c) 2021 unSkript, Inc ## All rights reserved. ## import pprint from typing import Optional, Tuple from pydantic import BaseModel, Field from unskript.legos.utils import CheckOutput from unskript.legos.aws.aws_list_all_regions.aws_list_all_regions import aws_list_all_regions from unskript.legos.a...
unskript/Awesome-CloudOps-Automation
AWS/legos/aws_get_publicly_accessible_db_snapshots/aws_get_publicly_accessible_db_snapshots.py
aws_get_publicly_accessible_db_snapshots.py
py
2,771
python
en
code
258
github-code
97
[ { "api_name": "pydantic.BaseModel", "line_number": 12, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 13, "usage_type": "name" }, { "api_name": "pydantic.Field", "line_number": 13, "usage_type": "call" }, { "api_name": "unskript.legos.util...
2404722710
from gulper.request import Request import StringIO import logging logger = logging.getLogger(__name__) class Key(object): def __init__(self, **kwargs): self.id = None self.name = None self.credentials = None self.__dict__.update(kwargs) def _request(self, path, **kwargs): ...
lukaf/gulper
gulper/ssh_key.py
ssh_key.py
py
2,202
python
en
code
0
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "gulper.request.Request", "line_number": 23, "usage_type": "call" }, { "api_name": "StringIO.StringIO", "line_number": 45, "usage_type": "call" }, { "api_name": "StringIO.St...
75059452479
import math import keras.backend as K from keras.layers import Conv2D, BatchNormalization, Activation, Add, \ AveragePooling2D, Input, Dense, Flatten, UpSampling2D, Layer, Reshape, Concatenate, Lambda from keras.models import Model class Encoder(object): pass class Decoder(object): pass class ResnetEn...
danielvarga/repulsive-autoencoder
model_resnet.py
model_resnet.py
py
6,203
python
en
code
3
github-code
97
[ { "api_name": "keras.layers.Input", "line_number": 44, "usage_type": "call" }, { "api_name": "keras.models.Model", "line_number": 49, "usage_type": "call" }, { "api_name": "keras.layers.AveragePooling2D", "line_number": 58, "usage_type": "call" }, { "api_name": "k...
33181814378
from fastapi.testclient import TestClient from main import app import pandas as pd import json import pytest from starter.ml.model import compute_model_metrics, inference from starter.ml.data import process_data import pickle client = TestClient(app) @pytest.fixture(scope="module", params=["data/test-data.csv"]) def ...
Kyrillos-Botros/census-income-classification-using-dvc-github-actions-fastapi-heroku
test_model_api.py
test_model_api.py
py
3,557
python
en
code
0
github-code
97
[ { "api_name": "fastapi.testclient.TestClient", "line_number": 10, "usage_type": "call" }, { "api_name": "main.app", "line_number": 10, "usage_type": "argument" }, { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "pytest.fix...
5154091005
import torch.optim from manifolds import ManifoldParameter, Hyperboloid _default_manifold = Hyperboloid() def copy_or_set_(dest, source): """ A workaround to respect strides of :code:`dest` when copying :code:`source` (https://github.com/geoopt/geoopt/issues/70) Parameters ---------- dest : t...
layer6ai-labs/HGCF
rgd/rsgd.py
rsgd.py
py
5,707
python
en
code
42
github-code
97
[ { "api_name": "manifolds.Hyperboloid", "line_number": 4, "usage_type": "call" }, { "api_name": "torch.optim.optim", "line_number": 43, "usage_type": "attribute" }, { "api_name": "torch.optim", "line_number": 43, "usage_type": "name" }, { "api_name": "torch.optim.n...
30897730030
#Versione alternativa del bot in python from json import load import telebot from os import path DIRECTORY = path.dirname(path.abspath(__file__))+"/" def jread(file) -> dict: """Legge un file json e ritorna il dizionario corrispondente. Il nome deve essere fornito con path relativo rispetto al file py e senza est...
Pokemon-Millennium/MillenniumTronPy
bot.py
bot.py
py
669
python
it
code
1
github-code
97
[ { "api_name": "os.path.dirname", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "name" }, { "api_name": "os.path.abspath", "line_number": 6, "usage_type": "call" }, { "api_name": "json.load", "line_number": 1...
19241440781
import json import pandas as pd import numpy as np import plotly.plotly as py import plotly.graph_objs as go import plotly import json from pprint import pprint import os import sys import s3 import server_connect def parse_json_for_sprint_status(query_id): r = server_connect.fetch_data() sprints = json.loads(...
danish20/Austin
Milestone3/Python/Scripts/sprint_status.py
sprint_status.py
py
6,312
python
en
code
0
github-code
97
[ { "api_name": "server_connect.fetch_data", "line_number": 15, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 16, "usage_type": "call" }, { "api_name": "plotly.tools.set_credentials_file", "line_number": 82, "usage_type": "call" }, { "api_name":...
34950970838
import contextlib import functools def generator(func): @functools.wraps(func) @contextlib.asynccontextmanager async def wrapper(*args, **kwargs): gen = func(*args, **kwargs) try: yield gen finally: await gen.aclose() return wrapper
Enapter/python-sdk
enapter/async_/generator.py
generator.py
py
300
python
en
code
5
github-code
97
[ { "api_name": "functools.wraps", "line_number": 6, "usage_type": "call" }, { "api_name": "contextlib.asynccontextmanager", "line_number": 7, "usage_type": "attribute" } ]
40675688961
import pandas as pd import numpy as np from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.decomposition import TruncatedSVD from sklearn.neighbors import BallTree from sklearn.base import BaseEstimator from sklearn.pipeline import make_pipeline import warnings warnings.filterwarnings("igno...
hussainmustafa2190/Karl
features/bot1.py
bot1.py
py
2,515
python
en
code
1
github-code
97
[ { "api_name": "warnings.filterwarnings", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 16, "usage_type": "call" }, { "api_name": "sklearn.featu...
73836666879
import json import traceback from collections import OrderedDict, defaultdict import numpy as np import pandas as pd from scipy import stats import rrcf from django.core.serializers.json import DjangoJSONEncoder from django.utils import timezone from django_pandas.io import read_frame from django.core.exceptions impo...
playfulMIT/kimchi
dataprocessing/tasks.py
tasks.py
py
92,363
python
en
code
0
github-code
97
[ { "api_name": "dataprocessing.models.Task.objects.get_or_create", "line_number": 78, "usage_type": "call" }, { "api_name": "dataprocessing.models.Task.objects", "line_number": 78, "usage_type": "attribute" }, { "api_name": "dataprocessing.models.Task", "line_number": 78, ...
8202638498
#import necessary modules from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver.common.action_chains impor...
mehul-gupta/Whatsapp-web-Automation
scheduler.py
scheduler.py
py
2,200
python
en
code
0
github-code
97
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 12, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 12, "usage_type": "name" }, { "api_name": "selenium.webdriver.support.ui.WebDriverWait", "line_number": 17, "usage_type": "call" }, ...
28180251679
from flask_cors import CORS from flask import request, Flask from celery.result import AsyncResult from json import dumps import tasks app = Flask(__name__) app.config.update(dict(SECRET_KEY='your_secret_key', CSRF_ENABLED=True, )) cors = CORS(app, resources={r"/*": {"origins": "*"}}) @app.route('/search_person', met...
kemalcanbora/PublicStalker
app.py
app.py
py
1,437
python
en
code
0
github-code
97
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.request.args.get", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.request.args",...
39544043697
# 基本库 import random import tensorflow import matplotlib.pyplot as plt from model import * from tensorflow.keras.utils import to_categorical import os from helper import check_feature check_feature() def set_seeds(seed=666): random.seed(seed) os.environ['PYTHONHASHSEED'] = str(seed) np.random.seed(seed) ...
lian131622/Eatingsound
Eating sound.py
Eating sound.py
py
1,936
python
en
code
0
github-code
97
[ { "api_name": "helper.check_feature", "line_number": 10, "usage_type": "call" }, { "api_name": "random.seed", "line_number": 15, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 16, "usage_type": "attribute" }, { "api_name": "tensorflow.random.se...
73521559678
import numpy as np import scipy.signal as sg from matplotlib import pyplot as plt # load file data = np.load('FilterRecording2020_5_15_20_54.npz')['signals'] # get the signals outta there! # impulse response occurs between 4300 and 4500 fftChunk = data[4300:4500] fftChunk = sg.detrend(fftChunk) # detrend removes th...
costassoler/LunarSeismometer
fftSpring.py
fftSpring.py
py
1,691
python
en
code
1
github-code
97
[ { "api_name": "numpy.load", "line_number": 6, "usage_type": "call" }, { "api_name": "scipy.signal.detrend", "line_number": 11, "usage_type": "call" }, { "api_name": "scipy.signal", "line_number": 11, "usage_type": "name" }, { "api_name": "numpy.abs", "line_num...
21953367016
import pandas as pd import matplotlib.pyplot as plt df = pd.read_csv("./data/일별평균대기오염도_2022.csv", encoding="cp949") print(df.info()) print(df.columns) name_age_col = df.iloc[:, [0, 1]] print(name_age_col) sub_df = df.loc[(df['미세먼지농도(㎍/㎥)'] >= 30) & (df['오존농도(ppm)'] >= 0.001)] print(sub_df) sub_df = df.loc[df['미세먼...
Dnadit/Python
서울시일별대기오염정보/SeoulAir.py
SeoulAir.py
py
2,441
python
ko
code
0
github-code
97
[ { "api_name": "pandas.read_csv", "line_number": 4, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 29, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.bar", "line_number": 37, "usage_type": "call" }, { "api_name": "matplotlib.py...
24079680154
import logging import boto3 from botocore.exceptions import ClientError def create_bucket(bucket_name): try: s3_client = boto3.client('s3') s3_client.create_bucket(Bucket=bucket_name) print("Bucket successfully created!") except ClientError as e: logging.error(e) print('...
AltamashRafiq/video-based-nlp
finished/make_bucket.py
make_bucket.py
py
474
python
en
code
0
github-code
97
[ { "api_name": "boto3.client", "line_number": 7, "usage_type": "call" }, { "api_name": "botocore.exceptions.ClientError", "line_number": 10, "usage_type": "name" }, { "api_name": "logging.error", "line_number": 11, "usage_type": "call" } ]
15416204284
from collections import namedtuple """ The following tuples are defined to help store all types of expressions. For example, the Reference_constant tuple is defined to address the single_assignment of type (reference := constant). So it contains three elements: reference, constant and the line number in the alg file. ...
modelica/efmi-compliancechecker
complianceChecker/data/AlgorithmCodeData.py
AlgorithmCodeData.py
py
14,531
python
en
code
3
github-code
97
[ { "api_name": "collections.namedtuple", "line_number": 16, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 17, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 19, "usage_type": "call" }, { "api_name": "...
40378957829
import time from random import randint from sqlalchemy.orm import Session from . import models, schemas def get_user(db: Session, user_id: int): return db.query(models.User).filter(models.User.id == user_id).first() def get_user_by_email(db: Session, email: str): return db.query(models.User).filter(models....
chandu1263/phonebook
sql_app/crud.py
crud.py
py
4,444
python
en
code
1
github-code
97
[ { "api_name": "sqlalchemy.orm.Session", "line_number": 9, "usage_type": "name" }, { "api_name": "sqlalchemy.orm.Session", "line_number": 12, "usage_type": "name" }, { "api_name": "sqlalchemy.orm.Session", "line_number": 15, "usage_type": "name" }, { "api_name": "s...
9564241144
import unittest from typing import List class Solution: def sumPrefixScores(self, words: List[str]) -> List[int]: # get prefix map prefix_map = {} for word in words: prefix = "" for c in word: prefix += c if prefix in prefix_map: ...
EastonLee/leetcode_python_solutions
6183. Sum of Prefix Scores of Strings.py
6183. Sum of Prefix Scores of Strings.py
py
1,018
python
en
code
1
github-code
97
[ { "api_name": "typing.List", "line_number": 6, "usage_type": "name" }, { "api_name": "unittest.TestCase", "line_number": 29, "usage_type": "attribute" }, { "api_name": "unittest.main", "line_number": 41, "usage_type": "call" } ]
27923211385
from dataclasses import dataclass from itertools import chain, repeat from pprint import pformat from string import Template from textwrap import dedent from typing import ( AbstractSet, Iterable, Iterator, MutableMapping, MutableSequence, Optional, Sequence, Tuple, ) from uuid import uu...
solomankabir123/coq-nvim-test
coq/server/edit.py
edit.py
py
13,112
python
en
code
0
github-code
97
[ { "api_name": "uuid.uuid4", "line_number": 57, "usage_type": "call" }, { "api_name": "shared.types.NvimPos", "line_number": 63, "usage_type": "name" }, { "api_name": "shared.types.NvimPos", "line_number": 64, "usage_type": "name" }, { "api_name": "typing.Sequence"...
42216919077
import base64 import gzip import io from pathlib import Path import pandas as pd from mpu.excel_formats import (STOCK_COLUMNS_FORMAT, STOCK_WITH_NEW_PRICE_COLUMNS_FORMAT) from mpu.utils.pyopenxl_utils import EXCEL_ENGINE, format_excel_df def get_stock_file_path(folder_path: Path, csv:...
TanguyLe/MagicPriceUpdater
mpu/stock_io.py
stock_io.py
py
1,296
python
en
code
0
github-code
97
[ { "api_name": "pathlib.Path", "line_number": 13, "usage_type": "name" }, { "api_name": "base64.b64decode", "line_number": 23, "usage_type": "call" }, { "api_name": "gzip.decompress", "line_number": 24, "usage_type": "call" }, { "api_name": "pandas.read_csv", "...
8301662740
from django.contrib import admin from .models import Category, Product, ProductReview class ProductAdmin(admin.ModelAdmin): list_display=('title', 'slug', 'category', 'parent', 'is_featured', 'price', 'num_available', 'num_visits') list_filter=('category', 'is_featured', 'num_visits') prepopulated_fields...
jeromepacman/chem_project_todo_demo
apps/store/admin.py
admin.py
py
472
python
en
code
0
github-code
97
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 6, "usage_type": "name" }, { "api_name": "django.contrib.admin.site.register", "line_number": 13, "usage_type": "call" },...
30655188868
import os from pathlib import Path import shutil import asyncio import time from pkg_resources import resource_filename import pytest KIVY_STALL_TIMEOUT = 90 UI_CONF = '\n'.join([ '[main]', 'config_filename = {vidhub_conf}', '[osc]', 'enable = no', '', ]) IS_CI = os.environ.get('CI') == 'true' T...
nocarryr/vidhub-control
tests/kv/conftest.py
conftest.py
py
5,864
python
en
code
7
github-code
97
[ { "api_name": "os.environ.get", "line_number": 19, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 19, "usage_type": "attribute" }, { "api_name": "pathlib.Path.home", "line_number": 21, "usage_type": "call" }, { "api_name": "pathlib.Path", "...
41702892437
import os from flask import Flask, render_template, request, redirect from flask_sqlalchemy import SQLAlchemy # set the db folder and name relative to the application root folder project_dir = os.path.dirname(os.path.abspath(__file__)) database_file = f"sqlite:///{os.path.join(project_dir,'bookdatabase.db')}" print(f...
wiezmankimchi/flask-crud-basic
app.py
app.py
py
2,403
python
en
code
0
github-code
97
[ { "api_name": "os.path.dirname", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.join", "line_nu...
71722648960
import numpy as np import pandas as pd import matplotlib.pyplot as plt #%load_ext google.colab.data_table import pandas as pd import random from datetime import datetime, timedelta from functools import wraps first_names = [ "Maria Carmen", "Maria", "Carmen", "Josefa", "Isabel", "Ana Maria",...
EricLeeuwenburgh/WINC---Data-Analytics-with-Python
Exercises/Module5/9_setting_null_values/main.py
main.py
py
5,849
python
en
code
0
github-code
97
[ { "api_name": "random.random", "line_number": 162, "usage_type": "call" }, { "api_name": "functools.wraps", "line_number": 160, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 168, "usage_type": "call" }, { "api_name": "datetime.datet...
39126612190
#!/usr/bin/env python3 from wearebeautiful.scale import scale_mesh import click @click.command() @click.option('--cleanup', default=False, help='Clean the mesh before scaling') @click.option('--invert/--no-invert', default=False, help='Flip the normals on the STL file') @click.argument("len", nargs=1, type=float) @cl...
wearebeautiful/wearebeautiful-tools
scale_mesh.py
scale_mesh.py
py
700
python
en
code
2
github-code
97
[ { "api_name": "wearebeautiful.scale.scale_mesh", "line_number": 13, "usage_type": "call" }, { "api_name": "click.command", "line_number": 6, "usage_type": "call" }, { "api_name": "click.option", "line_number": 7, "usage_type": "call" }, { "api_name": "click.option...
72854806398
import torch class Args(): def __init__(self): self.max_length = 128 self.lr = 1e-5 self.num_epochs = 5 self.device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') self.batch_size = 8 self.model_name = "ai-forever/ruRoberta-large" self.random_...
v4ndi/ai_news_codenrock
src/args.py
args.py
py
361
python
en
code
0
github-code
97
[ { "api_name": "torch.device", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 8, "usage_type": "attribute" } ]
4603746601
"""A setuptools based setup module.""" from os import path from setuptools import setup, find_packages from io import open here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.md'), encoding='utf-8') as f: long_description = f.read() setup(...
cunyap/immunitor
setup.py
setup.py
py
1,779
python
en
code
1
github-code
97
[ { "api_name": "os.path.abspath", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_number": 6, "usage_type": "call" }, { "api_name": "io.open", "line_number": 9, ...
70800193278
import re import os import socket import time import struct import dpkt import dpkt.dns from threading import Thread, Event from tiny_test_fw import DUT import ttfw_idf # g_run_server = True # g_done = False stop_mdns_server = Event() esp_answered = Event() def get_dns_query_for_esp(esp_host): dns = dpkt.dns.DN...
kerwincui/wumei-iot
firmware/esp-idf/wumei-smart-firmware/examples/protocols/mdns/mdns_example_test.py
mdns_example_test.py
py
5,442
python
en
code
34
github-code
97
[ { "api_name": "threading.Event", "line_number": 15, "usage_type": "call" }, { "api_name": "threading.Event", "line_number": 16, "usage_type": "call" }, { "api_name": "dpkt.dns.DNS", "line_number": 20, "usage_type": "call" }, { "api_name": "dpkt.dns", "line_num...
34049428178
"""Altair charts definitions""" import altair as alt import pandas as pd def create_balance_chart(balance_df: pd.DataFrame) -> alt.Chart: """ Creates an interactive chart of absolute balance in time. Args: balance_df: Balance DataFrame including `date` and `balance` columns. Returns: ...
JuliaSzulc/finances
app/chart.py
chart.py
py
2,239
python
en
code
0
github-code
97
[ { "api_name": "pandas.DataFrame", "line_number": 6, "usage_type": "attribute" }, { "api_name": "altair.Chart", "line_number": 17, "usage_type": "call" }, { "api_name": "altair.X", "line_number": 20, "usage_type": "call" }, { "api_name": "altair.Axis", "line_nu...
73766767038
import os import wx import gimelstudio.constants as const class NodeGraphDropTarget(wx.DropTarget): def __init__(self, window, *args, **kwargs): super(NodeGraphDropTarget, self).__init__(*args, **kwargs) self._window = window self._composite = wx.DataObjectComposite() self._textDr...
GimelStudio/GimelStudio
src/gimelstudio/interface/nodegraph_dnd.py
nodegraph_dnd.py
py
3,035
python
en
code
601
github-code
97
[ { "api_name": "wx.DropTarget", "line_number": 7, "usage_type": "attribute" }, { "api_name": "wx.DataObjectComposite", "line_number": 11, "usage_type": "call" }, { "api_name": "wx.TextDataObject", "line_number": 12, "usage_type": "call" }, { "api_name": "wx.FileDat...
18431444122
import os import typing as tp import cv2 import numpy as np import scipy.ndimage import time import tqdm from PIL import Image KERNELS = [ np.array( [ [-1, 2, -1], [-1, 2, -1], [-1, 2, -1], ] ), np.array( [ [2, -1, -1], [-...
andresokol/masters
apply_filters.py
apply_filters.py
py
5,604
python
en
code
0
github-code
97
[ { "api_name": "numpy.array", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": ...
30638946613
import os from datetime import timedelta, timezone import discord from discord.ext import commands from dotenv import load_dotenv load_dotenv() utc = timezone.utc jst = timezone(timedelta(hours=9), "Asia/Tokyo") guild_id = int(os.environ["GUILD_ID"]) vc_log_channel = int(os.environ["VC_LOG_CHANNEL"]) class Logge...
sushi-chaaaan/sakamata-bot
Core/logger.py
logger.py
py
1,583
python
en
code
1
github-code
97
[ { "api_name": "dotenv.load_dotenv", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.timezone.utc", "line_number": 10, "usage_type": "attribute" }, { "api_name": "datetime.timezone", "line_number": 10, "usage_type": "name" }, { "api_name": "dateti...
23739080429
import numpy as np from scipy import signal from skimage.util import pad from skimage.measure import compare_ssim from timeit import default_timer as timer def compute_nrmse(im1, im2): """ Compute the Normalized Mean Square Error. A min-max normalized mean square error value and array are computed from ...
charparr/parr-thesis
similarity/similarity_tests/iqa_metrics.py
iqa_metrics.py
py
10,474
python
en
code
2
github-code
97
[ { "api_name": "timeit.default_timer", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.nanmax", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.nanmax", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.nanmin", "li...
34798881010
import cv2 import numpy as np # Comment: CV2 is based on static image analysis. # But videos are just a collection of several static images. So it works pretty similar with video or image # Using grayscale takes away different colors (3, being RGB) and +1 being Alpha (opacity) # it requires less processing using...
marcellovictorino/ImageRecognition
3)Image-Drawing.py
3)Image-Drawing.py
py
1,037
python
en
code
0
github-code
97
[ { "api_name": "cv2.imread", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.IMREAD_COLOR", "line_number": 12, "usage_type": "attribute" }, { "api_name": "cv2.line", "line_number": 14, "usage_type": "call" }, { "api_name": "cv2.rectangle", "line_n...
29399190130
""" Lhs functions are inspired by https://github.com/clicumu/pyDOE2/blob/ master/pyDOE2/doe_lhs.py """ import numpy as np from sklearn.utils import check_random_state from scipy import spatial from ..space import Space, Categorical from .base import InitialPointGenerator def _random_permute_matrix(h, random_state=Non...
scikit-optimize/scikit-optimize
skopt/sampler/lhs.py
lhs.py
py
5,689
python
en
code
2,684
github-code
97
[ { "api_name": "sklearn.utils.check_random_state", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.zeros_like", "line_number": 15, "usage_type": "call" }, { "api_name": "base.InitialPointGenerator", "line_number": 23, "usage_type": "name" }, { "api_...
5813913041
from ANNarchy import * import pylab as plt from scipy import signal, stats from model_neuronmodels import params, rng, Izhikevich2007RS, Izhikevich2007FS from extras import lognormalPDF, get_log_normal_fit, set_size ### create 1000 neurons of each neurontype corE = Population(1000, neuron=Izhikevich2007RS, name='CorE...
hamkerlab/Maith2021_ANNarchyBOLDmonitor
srcSim/get_weightDist.py
get_weightDist.py
py
4,642
python
en
code
1
github-code
97
[ { "api_name": "model_neuronmodels.Izhikevich2007RS", "line_number": 9, "usage_type": "name" }, { "api_name": "model_neuronmodels.Izhikevich2007FS", "line_number": 10, "usage_type": "name" }, { "api_name": "model_neuronmodels.rng", "line_number": 26, "usage_type": "argumen...
69988980798
from __future__ import annotations from sqlalchemy import Column, Integer, String from sqlalchemy.orm import relationship from .. import database class Organization(database.Base): __tablename__ = "organization" id = Column(Integer, primary_key=True) name = Column(String, nullable=False) slug = Col...
getsentry/integration-platform-example
backend-py/src/models/organization.py
organization.py
py
769
python
en
code
43
github-code
97
[ { "api_name": "sqlalchemy.Column", "line_number": 12, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer", "line_number": 12, "usage_type": "argument" }, { "api_name": "sqlalchemy.Column", "line_number": 13, "usage_type": "call" }, { "api_name": "sqlalchemy...
27979225205
import requests def download(url): print("开始下载:",url) response=requests.get(url,verify=False) print("下载完成") filename=url.split(r"/")[-1] with open(filename,mode='wb') as file_obj: file_obj.write(response.content) if __name__ == '__main__': url_list=[r"https://i.tuiimg.net/006/2522/2.jp...
kikiacc/TestGUI
download.py
download.py
py
499
python
en
code
0
github-code
97
[ { "api_name": "requests.get", "line_number": 5, "usage_type": "call" } ]
45125651096
import scrapy class Test(scrapy.Spider): name = 'xxx' start_urls = ['https://github.com/shiyanlou?tab=repositories'] def parse(self, r): for i in r.xpath('//li[contains(@class, "col-12")]'): yield { 'name': i.css('a::text').extract_first().strip(), 'upda...
Esun127/shiyanlou
week4/tiaozhan1/test.py
test.py
py
641
python
en
code
0
github-code
97
[ { "api_name": "scrapy.Spider", "line_number": 3, "usage_type": "attribute" } ]
25722186172
# Cow Beauty Pageant # Gold 5, BFS, DFS from collections import deque import sys input = sys.stdin.readline M = 5931 sys.setrecursionlimit(M) def dfs(x,y): grid[x][y] = k for nx,ny in ((x+1,y),(x-1,y),(x,y+1),(x,y-1)): if 0 <= nx < n and 0 <= ny < m and grid[nx][ny] == 'X': dfs(nx,ny) def...
kimdaegeon0918/baekjoon
5931 CowBeautyPageant.py
5931 CowBeautyPageant.py
py
1,158
python
en
code
0
github-code
97
[ { "api_name": "sys.stdin", "line_number": 6, "usage_type": "attribute" }, { "api_name": "sys.setrecursionlimit", "line_number": 8, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 17, "usage_type": "call" } ]
39161910367
import os from functools import cached_property from pandas import read_csv from app import DATA_DIRPATH GTZAN_DIRPATH = os.path.join(DATA_DIRPATH, "gtzan") GENRES_DIRPATH = os.path.join(GTZAN_DIRPATH, "genres_original") class AudioFile: def __init__(self, audio_filepath): self.audio_filepath = aud...
s2t2/ml-music-2023
app/gtzan_dataset.py
gtzan_dataset.py
py
2,383
python
en
code
2
github-code
97
[ { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "app.DATA_DIRPATH", "line_number": 11, "usage_type": "argument" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.join", "li...
36238246123
import requests import json import pandas as pd def OrientQuery(query,database): url = "http://localhost:2480/command/CustomerE2E/sql" payload = json.dumps({ "command": "select * from COLUMN" }) headers = { 'Authorization': 'Basic cm9vdDpyb290', 'Content-Type': 'application/...
ZacayDau/IICSProject
OrientDB.py
OrientDB.py
py
594
python
en
code
0
github-code
97
[ { "api_name": "json.dumps", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.request", "line_number": 20, "usage_type": "call" } ]
34799905820
from typing import List class Solution: def exist(self, board: List[List[str]], word: str) -> bool: def find(ix, i, j, readed): readed.append((i, j)) if ix == len(word): return True if board[i][j] != word[ix]: return False r...
wudangqibujie/jay_template
ST/79. 单词搜索.py
79. 单词搜索.py
py
1,200
python
en
code
0
github-code
97
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" } ]
42634668055
import torch import torch.nn as nn import torch.nn.functional as F from .TopicDistQuant import TopicDistQuant from .TSC import TSC class TSCTM(nn.Module): ''' Mitigating Data Sparsity for Short Text Topic Modeling by Topic-Semantic Contrastive Learning. EMNLP 2022 Xiaobao Wu, Anh Tuan Luu, Xinsh...
BobXWu/TopMost
topmost/models/basic/TSCTM/TSCTM.py
TSCTM.py
py
2,575
python
en
code
89
github-code
97
[ { "api_name": "torch.nn.Module", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
5486739099
import re import pandas as pd import draughts from draughts import * from draughts.PDN import PDNReader, _PDNGame import numpy as np import torch from torch import Tensor import torch.nn as nn import torch.nn.functional as F import torchvision import torch.utils.data from torch.utils.data import * import pickle file...
staadecker/deep-learning-checkers-engine
APS360DataParsing.py
APS360DataParsing.py
py
11,249
python
en
code
0
github-code
97
[ { "api_name": "re.search", "line_number": 53, "usage_type": "call" }, { "api_name": "re.split", "line_number": 59, "usage_type": "call" }, { "api_name": "re.search", "line_number": 82, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 108, ...
23536310918
from typing import Any, List from uuid import UUID from fastapi import APIRouter, Depends, HTTPException from sqlalchemy.orm import Session from app import crud, models, schemas from app.api import deps router = APIRouter() @router.get("/", response_model=List[schemas.Definition]) def read_definitions( db: Ses...
toslund/track-my-spanish-API
app/api/api_v1/endpoints/definitions.py
definitions.py
py
3,144
python
en
code
0
github-code
97
[ { "api_name": "fastapi.APIRouter", "line_number": 10, "usage_type": "call" }, { "api_name": "sqlalchemy.orm.Session", "line_number": 15, "usage_type": "name" }, { "api_name": "app.models.User", "line_number": 18, "usage_type": "attribute" }, { "api_name": "app.mod...
13593081046
from django.shortcuts import render, get_object_or_404, redirect import urllib # Create your views here. def oauth(request): code = request.GET['code'] print('code= ' + str(code)) client_id = '13839c3b390207f7c0c7eaa789139e34' redirect_uri = 'http://127.0.0.1:8000/account/login/kakao/callback' acce...
Leeseonha/ddabong
ddabong/account/views.py
views.py
py
1,627
python
en
code
0
github-code
97
[ { "api_name": "django.shortcuts.redirect", "line_number": 31, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "line_number": 42, "usage_type": "call" } ]
8027331160
from __future__ import absolute_import from __future__ import division from __future__ import print_function import math import REDACTED from absl import app from absl import flags from absl import logging import tensorflow.compat.v2 as tf from REDACTED.tf2_bert import optimization from REDACTED.tf2_bert.bert import ...
mlcommons/training_results_v0.7
Google/benchmarks/bert/implementations/bert-cloud-TF2.0-tpu-v3-32/bert/run_pretraining.py
run_pretraining.py
py
12,912
python
en
code
58
github-code
97
[ { "api_name": "absl.flags.DEFINE_string", "line_number": 23, "usage_type": "call" }, { "api_name": "absl.flags", "line_number": 23, "usage_type": "name" }, { "api_name": "absl.flags.DEFINE_integer", "line_number": 26, "usage_type": "call" }, { "api_name": "absl.fl...
37734195519
import matplotlib.pyplot as plt import matplotlib as mpl import numpy as np import time as ti import pandas as pd from scipy import stats import random as rd from matplotlib.font_manager import FontProperties from scipy import interpolate font = FontProperties(fname=r'C:/Users/user/Anaconda3/Lib/site-packages/...
shinakami/work_git
well_ELE_plot.py
well_ELE_plot.py
py
1,241
python
en
code
2
github-code
97
[ { "api_name": "matplotlib.font_manager.FontProperties", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.concatenate", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 14, "usage_type": "call" }, { "api_name": "n...
34489076361
import math from typing import List, Optional import numpy as np import rospy from soccer_common.camera import Camera from soccer_common.transformation import Transformation from soccer_common.utils import wrapToPi from soccer_pycontrol import path from soccer_strategy.ball import Ball from soccer_strategy.obstacle i...
utra-robosoccer/soccerbot
soccer_strategy/src/soccer_strategy/robot_controlled_2d.py
robot_controlled_2d.py
py
4,579
python
en
code
130
github-code
97
[ { "api_name": "soccer_strategy.robot_controlled.RobotControlled", "line_number": 17, "usage_type": "name" }, { "api_name": "soccer_common.camera.Camera.HORIZONTAL_FOV", "line_number": 19, "usage_type": "attribute" }, { "api_name": "soccer_common.camera.Camera", "line_number":...
16724787153
from datetime import datetime #Default spy details concept of classes is also used class Spy: def __init__(self, name, salutation, age, rating): self.name = name self.salutation = salutation self.age = age self.rating = rating self.is_online = True self.chats = [] self.current_status_mess...
ishaan001/SPY-CHAT
spychat/default_spy_details.py
default_spy_details.py
py
797
python
en
code
1
github-code
97
[ { "api_name": "datetime.datetime.now", "line_number": 28, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 28, "usage_type": "name" } ]
23919627927
import ee from ee_plugin import Map #Tradicional print print("Hola Mundo") #Earth Engine object print(ee.String('Hello World from Earth Engine!').getInfo()) #Area de estudio Cordi_blanca = ee.FeatureCollection('users/mastergis01/Cordil_Blanca') Map.addLayer(Cordi_blanca, {'color': 'red'}, 'Coordillera_B...
MasterGIScom/Geoprocesamiento-Python-QGIS
LST.py
LST.py
py
4,360
python
es
code
1
github-code
97
[ { "api_name": "ee.String", "line_number": 8, "usage_type": "call" }, { "api_name": "ee.FeatureCollection", "line_number": 11, "usage_type": "call" }, { "api_name": "ee_plugin.Map.addLayer", "line_number": 12, "usage_type": "call" }, { "api_name": "ee_plugin.Map", ...
74667661439
# coding: utf-8 # In[ ]: from scipy import sparse import numpy as np train_text_tfidf=sparse.load_npz("./npz/train_apitext_valuetext.npz") train_api_tfidf=sparse.load_npz("./npz/train_api_set_x.npz") train_value_tfidf=sparse.load_npz("./npz/train_value_set_x.npz") train_count_fea=np.load("./npy/train_count_fea_x.n...
bestpredicts/Ali_Security_Competition
tfidf+count_feature+lgb.py
tfidf+count_feature+lgb.py
py
4,116
python
en
code
4
github-code
97
[ { "api_name": "scipy.sparse.load_npz", "line_number": 10, "usage_type": "call" }, { "api_name": "scipy.sparse", "line_number": 10, "usage_type": "name" }, { "api_name": "scipy.sparse.load_npz", "line_number": 11, "usage_type": "call" }, { "api_name": "scipy.sparse...
36647392436
import sqlite3 import pandas as pd class App(tk.Frame): def __init__(self, master): super().__init__(master) self.pack() self.entrythingy = tk.Entry() self.entrythingy.pack() # Create the application variable. self.contents = tk.StringVar() # Set it to so...
JamesSibaja/TCU705
pruebas/plataforma.py
plataforma.py
py
1,993
python
en
code
0
github-code
97
[ { "api_name": "pandas.ExcelFile", "line_number": 72, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 73, "usage_type": "call" }, { "api_name": "pandas.read_excel", "line_number": 75, "usage_type": "call" } ]