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
39650051725
from datetime import date from django.core.validators import MinLengthValidator from django.db import models from groups.validators import validate_start_date from teachers.models import Teacher class Group(models.Model): group_name = models.CharField( max_length=100, verbose_name='group name', ...
KulykDima/Django_lms_Kulyk
groups/models.py
models.py
py
1,400
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.db.models.CharField", "line_number": 11, "usage_type": "call" }, { "api_name"...
9938966584
from __future__ import print_function import os import sys import logging import argparse from importlib import import_module from multiprocessing import freeze_support from rdkit import Chem from . import Calculator, __version__, descriptors from ._base import get_descriptors_in_module from ._util import PathType, ...
mordred-descriptor/mordred
mordred/__main__.py
__main__.py
py
6,320
python
en
code
296
github-code
21
[ { "api_name": "rdkit.Chem.MolFromSmiles", "line_number": 29, "usage_type": "call" }, { "api_name": "rdkit.Chem", "line_number": 29, "usage_type": "name" }, { "api_name": "logging.warning", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path.splitext"...
18728482398
#!/usr/bin/env python import os import sys from datetime import datetime import logging from Github import GithubCommitExtractor import argparse import pandas as pd from sqlalchemy import create_engine import psycopg2 import psycopg2.extras import os from dotenv import load_dotenv def filter_json_records(json_com...
ganguvamshi/commit_etl
ETL/etl.py
etl.py
py
3,205
python
en
code
0
github-code
21
[ { "api_name": "dotenv.load_dotenv", "line_number": 35, "usage_type": "call" }, { "api_name": "psycopg2.connect", "line_number": 37, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 40, "usage_type": "call" }, { "api_name": "os.getenv", "line_n...
73767058291
import numpy as np import PIL as pil from tensorflow import keras dir = '/kaggle/input/unibuc-brain-ad/data/data/' np_images = [] images = [] for i in range(1, 22150): # read the image image = pil.Image.open(dir + str(i).zfill(6) + '.png').convert('L') # convert the image to numpy array np...
maria-ilinca/Artificial-Intelligence
CNN.py
CNN.py
py
6,113
python
en
code
0
github-code
21
[ { "api_name": "PIL.Image.open", "line_number": 11, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.array", "line_num...
73823319411
import discord from discord.ext import commands from dotenv import load_dotenv import os load_dotenv() TOKEN = os.getenv('TOKEN') # client = discord.Client() # @client.event # async def on_ready(): # print('We have logged in as {0.user}'.format(client)) # @client.event # async def on_message(message): # if me...
Bergan404/DiscordBot
bot.py
bot.py
py
2,868
python
en
code
1
github-code
21
[ { "api_name": "dotenv.load_dotenv", "line_number": 6, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 7, "usage_type": "call" }, { "api_name": "discord.ext.commands.Bot", "line_number": 33, "usage_type": "call" }, { "api_name": "discord.ext.comma...
73826571252
import torch import torch.nn as nn def conv3x3(in_channels, out_channels): return nn.Sequential( nn.Conv2d(in_channels, out_channels, kernel_size=3, stride=1), nn.BatchNorm2d(out_channels), nn.ReLU() ) class Flatten(nn.Module): def forward(self, x): return x.view(x.size(0),...
hnhoangdz/final_project
models/bknet.py
bknet.py
py
2,455
python
en
code
0
github-code
21
[ { "api_name": "torch.nn.Sequential", "line_number": 5, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 5, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 6, "usage_type": "call" }, { "api_name": "torch.nn", "line_number...
18719097166
import pymysql import copy from ..items import MatchItem from ..items import OuOddsItem from ..items import YaOddsItem from ..items import DxOddsItem from ..items import ImmOuOddsItem from ..items import ImmYaOddsItem from ..items import ImmDxOddsItem class DataPipeline(object): def __init__(self, connect, cursor...
mansoy/MsSpider
MsSpider/data/pipelines.py
pipelines.py
py
13,211
python
en
code
1
github-code
21
[ { "api_name": "pymysql.connect", "line_number": 19, "usage_type": "call" }, { "api_name": "pymysql.cursors", "line_number": 25, "usage_type": "attribute" }, { "api_name": "items.OuOddsItem", "line_number": 44, "usage_type": "argument" }, { "api_name": "items.YaOdd...
22589087009
from kafka import KafkaProducer, KafkaConsumer from services.penalty import calc_penalty_score import json import os from tinydb import TinyDB, Query, where db = TinyDB('db.json') def consume_messages_from_kafka(): try: print('Starting consumer', flush=True) consumer = KafkaConsumer( 'car_states', ...
chrisvel/fms
MSC/services/kafka.py
kafka.py
py
1,199
python
en
code
0
github-code
21
[ { "api_name": "tinydb.TinyDB", "line_number": 7, "usage_type": "call" }, { "api_name": "kafka.KafkaConsumer", "line_number": 12, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 14, "usage_type": "call" }, { "api_name": "os.environ", "lin...
8660866877
from django.urls import re_path from .views import * app_name = 'dkea' urlpatterns = [ re_path(r'^$', DkeaMain, name='main'), re_path(r'^list/(?P<list>c\d+)/$', DkeaListView, name='list'), re_path(r'^detail/(?P<detail>\d+)/$', DkeaDetailView, name='detail') ]
seongwonyang/prj_2st
dkea/urls.py
urls.py
py
273
python
en
code
0
github-code
21
[ { "api_name": "django.urls.re_path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.re_path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.re_path", "line_number": 9, "usage_type": "call" } ]
2920070801
# # BOT_TOKEN = '5880981869:AAGrRMEyP-Ty_KjwmjFOTh_qw5-VMiYvp2o' # # Replace these with your own values # api_id = 1909484 # api_hash = 'cc35d89e519babd93edee46b5292ab10' # TOKEN = '5880981869:AAGrRMEyP-Ty_KjwmjFOTh_qw5-VMiYvp2o' # destination_channel_username = 'NETFLY' import os import telegram TOKEN = '588...
menachem16/load
main.py
main.py
py
2,259
python
en
code
0
github-code
21
[ { "api_name": "telegram.Bot", "line_number": 13, "usage_type": "call" }, { "api_name": "telegram.ext.Updater", "line_number": 42, "usage_type": "call" }, { "api_name": "telegram.ext", "line_number": 42, "usage_type": "attribute" }, { "api_name": "telegram.ext.Comm...
42316713193
"""K-Means module, contain K-Means implementation inside KMeans classpfa.particles[0].centroids, pfa.particles[0]._predict(x), x """ import math import numpy import pandas as pd from scipy.spatial import distance_matrix from sklearn import metrics def intra_cluster_distance(centroids: numpy.ndarray,labels: numpy.nda...
akm7289/PFA-CLUS
kmeans.py
kmeans.py
py
8,643
python
en
code
0
github-code
21
[ { "api_name": "numpy.ndarray", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.where", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.linalg.norm", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.linalg", "...
21015208532
# -*- coding: utf-8 -*- """ Created on Fri Jan 5 23:57:52 2018 @author: navya """ import itertools; N=int(input()); s=input().split(); K=int(input()); sum1=0; l=list(itertools.combinations(s,K)); for i in l: if ('a' in i): sum1=sum1+1; print(sum1/len(l));
NavyaKola/PythonPractice1
HackerRank/PyPrac/Itertools/iterablesAndIterators.py
iterablesAndIterators.py
py
320
python
en
code
0
github-code
21
[ { "api_name": "itertools.combinations", "line_number": 12, "usage_type": "call" } ]
19857862755
import pandas as pd import gensim from gensim.utils import simple_preprocess from gensim.parsing.preprocessing import STOPWORDS from nltk.stem import WordNetLemmatizer, SnowballStemmer from nltk.stem.porter import * import numpy as np import nltk import pymongo from gensim.models.coherencemodel import CoherenceModel f...
mandoiwanaga/dreamjobber
dreamjobber_web/recommend.py
recommend.py
py
2,978
python
en
code
0
github-code
21
[ { "api_name": "pymongo.MongoClient", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 52, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 59, "usage_type": "call" } ]
72717801974
import requests as requests_original from .proxy import ProxyObject from typing import List, Tuple class defaults: @staticmethod def proxy_is_working(proxy: ProxyObject, timeout: int = 5) -> bool: try: res = requests_original.get("http://icanhazip.com/", proxies=proxy.to_dict(), timeout=ti...
Tortuginator/pyproxyroulette
pyproxyroulette/defaults.py
defaults.py
py
1,746
python
en
code
0
github-code
21
[ { "api_name": "proxy.ProxyObject", "line_number": 8, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "proxy.to_dict", "line_number": 10, "usage_type": "call" }, { "api_name": "proxy.response_time", ...
27692700354
import numpy as np import torch as T import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import os import gym from gym import wrappers from utils import * from main_classes import * import matplotlib.pyplot as plt import numpy as np from collections import deque from garage.envs.wr...
mariagraziaberni/Reinforcement_Learning
Pixel_Observation/main.py
main.py
py
3,264
python
en
code
0
github-code
21
[ { "api_name": "gym.make", "line_number": 22, "usage_type": "call" }, { "api_name": "garage.envs.wrappers.PixelObservationWrapper", "line_number": 26, "usage_type": "call" }, { "api_name": "garage.envs.wrappers.Grayscale", "line_number": 30, "usage_type": "call" }, { ...
19921091213
import io import os from typing import Tuple from avro.io import BinaryEncoder, DatumWriter from avro.schema import parse from confluent_kafka import Producer, schema_registry # type: ignore from dotenv import load_dotenv from etl_black_friday.constants import (AVRO_SCHEMA_SUBJECT_NAME, ...
rodrigofmcarvalho/black-friday-pipeline
collector/src/helpers/validator.py
validator.py
py
1,640
python
en
code
0
github-code
21
[ { "api_name": "dotenv.load_dotenv", "line_number": 17, "usage_type": "call" }, { "api_name": "avro.io.DatumWriter", "line_number": 28, "usage_type": "call" }, { "api_name": "io.BytesIO", "line_number": 29, "usage_type": "call" }, { "api_name": "avro.io.BinaryEncod...
19666178820
from flask import Flask, jsonify import datetime app = Flask(__name__) @app.route('/') def get_time(): now = datetime.datetime.now() time_str = now.strftime('%Y-%m-%d %H:%M:%S') return jsonify({'time': time_str}) if __name__ == '__main__': app.run(host='0.0.0.0', port=8000)
cosir888/api
python_time_api.py
python_time_api.py
py
294
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 8, "usage_type": "attribute" }, { "api_name": "flask.jsonify",...
17621143986
from collections import deque from math import prod with open("day11.in") as f: data = f.read().strip() ''' Iterate each monke Iterate each item 1. Execute operation on item's worry 2. Item's worry // 3 3. Test & throw to respective monke ''' class Monke: def __init__(self, s): ...
seetohjinwei/adventofcode
year2022/day11.py
day11.py
py
1,774
python
en
code
0
github-code
21
[ { "api_name": "collections.deque", "line_number": 18, "usage_type": "call" }, { "api_name": "math.prod", "line_number": 34, "usage_type": "call" } ]
18603814351
#!/usr/bin/env python2 import os import errno import sys import subprocess import shutil sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', '..', '..', 'xar')) import xar import xml.etree.ElementTree as ET # Check that the post installation action is not set for the package during the build process...
packagesdev/packages_tests
distribution/packages/settings/test_distribution_packages_settings_post-installation-behavior_do-nothing/test.py
test.py
py
1,441
python
en
code
1
github-code
21
[ { "api_name": "sys.path.append", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
30857453076
#! /usr/bin/env python3 from itertools import product, starmap, islice with open('./day11in') as f: data = [list(map(int, list(x))) for x in f.read().splitlines()] class Oct(): def __init__(self, energy): self.energy = energy self.charged = False self.has_flashed = False def __r...
michael1241/adventofcode21
day11.py
day11.py
py
2,269
python
en
code
0
github-code
21
[ { "api_name": "itertools.islice", "line_number": 21, "usage_type": "call" }, { "api_name": "itertools.starmap", "line_number": 21, "usage_type": "call" }, { "api_name": "itertools.product", "line_number": 21, "usage_type": "call" } ]
23144612442
import os from PIL import Image import numpy as np from keras.utils import np_utils from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation, Flatten from keras.optimizers import SGD from keras.layers import Conv2D, MaxPooling2D # 卷积层 池化层 """ cattrain就是为了训练训练集,生成权重文件.h5 """ #---...
lesenelir/Django-Cats-Classifier
cat/cattrain.py
cattrain.py
py
4,167
python
en
code
3
github-code
21
[ { "api_name": "os.listdir", "line_number": 18, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 22, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 22, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": ...
18569904296
import os import tensorflow as tf import tensorflow_hub as hub import numpy as np from matplotlib import pyplot as plt from PIL import Image def stylize_images(input_dir, output_dir): if not os.path.exists(output_dir): os.mkdir(output_dir) # Load pre-trained model hub_module = hub.load('https://tf...
MurikiGY/Art-Distortion-Detection
artGen.py
artGen.py
py
1,731
python
en
code
0
github-code
21
[ { "api_name": "os.path.exists", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number": 10, "usage_type": "call" }, { "api_name": "tensorflow_hub.load", "line_nu...
70945936052
import logging from qtpy.QtCore import QRect from hyperctui.parent import Parent from hyperctui.initialization.gui_initialization import GuiInitialization from hyperctui.setup_ob.get import Get as Step1Get from hyperctui.session.new_session import NewSession from hyperctui.session import SessionKeys from hyperctui.set...
ornlneutronimaging/HyperCTui
src/hyperctui/event_handler.py
event_handler.py
py
8,318
python
en
code
0
github-code
21
[ { "api_name": "hyperctui.parent.Parent", "line_number": 17, "usage_type": "name" }, { "api_name": "hyperctui.session.new_session.NewSession", "line_number": 20, "usage_type": "call" }, { "api_name": "hyperctui.initialization.gui_initialization.GuiInitialization", "line_number...
13944180292
import requests hostname = "http://35.158.219.60:5000" def create_job(): payload = { "from": { "address": "5 rue joseph riviere courbevoie", "zip_code": "92400" }, "to": { "address": "5 rue joseph riviere courbevoie", "zip_code": "92400" ...
jeremymaignan/WeLeave
api/tests.py
tests.py
py
1,791
python
en
code
0
github-code
21
[ { "api_name": "requests.post", "line_number": 19, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 28, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 37, "usage_type": "call" }, { "api_name": "requests.post", "line_num...
9018437819
from rest_framework.permissions import IsAuthenticatedOrReadOnly SAFE_METHODS = ('GET', 'HEAD', 'OPTIONS') class IsAuthenticatedAdmin(IsAuthenticatedOrReadOnly): def has_permission(self, request, view): """ Method to check Admin permission. """ return bool( request.meth...
kumarkiran12378/riktam
chatapp/user/permission.py
permission.py
py
460
python
en
code
0
github-code
21
[ { "api_name": "rest_framework.permissions.IsAuthenticatedOrReadOnly", "line_number": 5, "usage_type": "name" } ]
38006604292
import setuptools # read the contents of the README.md file to get a long_description from os import path this_directory = path.abspath(path.dirname(__file__)) with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f: readme = f.read() long_description = readme[:readme.find('## Contents')].str...
flordan/europar23
tests/gridsearch/application/dislib_nested/setup.py
setup.py
py
1,553
python
en
code
0
github-code
21
[ { "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": "os.path.join", "line_number"...
12569926543
import numpy as np import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages from scipy.io import wavfile pdf = [] pdfDoc = PdfPages('p06.pdf') sample_rate, signal = wavfile.read("p05.wav") # Ia pas de 1% step = int(len(signal) * 0.01) total_len = step * 100 - (step if step * 100 != len(si...
fredtux/PrelucrareaSemnalelor_Teme
Lab04/p06.py
p06.py
py
1,107
python
en
code
0
github-code
21
[ { "api_name": "matplotlib.backends.backend_pdf.PdfPages", "line_number": 7, "usage_type": "call" }, { "api_name": "scipy.io.wavfile.read", "line_number": 9, "usage_type": "call" }, { "api_name": "scipy.io.wavfile", "line_number": 9, "usage_type": "name" }, { "api_...
70899196853
from datetime import datetime from re import compile, match from string import Template from uuid import uuid4 from flask import * from src.database import commit_db def add_incident_route(error=None): """ Adds incident to system; return template :param error - message ot pass to user if any specified ...
hessmjr/resource-management-system
src/routes/add_incident.py
add_incident.py
py
3,171
python
en
code
1
github-code
21
[ { "api_name": "uuid.uuid4", "line_number": 18, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 73, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 74, "usage_type": "call" }, { "api_name": "re.match", "line_number": 76, ...
11773199742
#!/usr/bin/env python # -*- coding:utf-8 -*- # Author: Donny You(youansheng@gmail.com) # Loss function for Semantic Segmentation. import torch import torch.nn as nn import torch.nn.functional as F class CELoss(nn.Module): def __init__(self, configer=None): super(CELoss, self).__init__() self.con...
donnyyou/torchcv
model/det/loss/ce_loss.py
ce_loss.py
py
1,066
python
en
code
2,235
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 12, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 12, "usage_type": "name" }, { "api_name": "torch.FloatTensor", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.nn.functional.c...
71850831733
import cv2 import os # Defina o diretório de destino para salvar as imagens capturadas diretorio_destino = "imagens/" # Crie o diretório, se ele ainda não existir if not os.path.exists(diretorio_destino): os.makedirs(diretorio_destino) # Inicie a captura de vídeo a partir da webcam cap = cv2.VideoCapture(0) # D...
TonyRio/2023-Facial_Rec_drones
master/CapTela.py
CapTela.py
py
1,011
python
pt
code
0
github-code
21
[ { "api_name": "os.path.exists", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_num...
14474643001
""" This code can be modified to visualize predicts of any model. """ from __future__ import division import os from tqdm import tqdm import pandas as pd import extra_functions import tensorflow.keras from tensorflow.keras.layers import Input, concatenate, Conv2D, MaxPooling2D, UpSampling2D, Cropping2D, BatchNormaliz...
nrharbeck/U-Net-Satellite-Image-Segmentation
Code/modeling-visualization/make_prediction_cropped_buildings_structures.py
make_prediction_cropped_buildings_structures.py
py
9,043
python
en
code
1
github-code
21
[ { "api_name": "os.getcwd", "line_number": 25, "usage_type": "call" }, { "api_name": "tensorflow.keras.layers.Input", "line_number": 31, "usage_type": "call" }, { "api_name": "tensorflow.keras.layers.Conv2D", "line_number": 32, "usage_type": "call" }, { "api_name":...
22950787181
import json import os import subprocess import string import random from pathlib import Path from shutil import copy, rmtree from time import sleep from typing import List from brownie import project, network, accounts from pytest import fixture from src.contracts.secret.secret_contract import change_admin from src.l...
levackt/EthereumBridge
tests/integration/swap_token/conftest.py
conftest.py
py
6,150
python
en
code
0
github-code
21
[ { "api_name": "string.ascii_letters", "line_number": 30, "usage_type": "attribute" }, { "api_name": "string.digits", "line_number": 30, "usage_type": "attribute" }, { "api_name": "random.choice", "line_number": 31, "usage_type": "call" }, { "api_name": "src.util.c...
40986987013
import argparse def load_parser(): parser = argparse.ArgumentParser() logging = parser.add_argument_group("logging settings") logging.add_argument('-ld', '--log-dir', type=str, default=None) logging.add_argument('-ckpt', '--checkpoint', type=str, default=None) logging.add_argument('-v', '--verbosity', typ...
wcarvalho/ViralityPredictionModel
3_train_model/src/config.py
config.py
py
4,361
python
en
code
1
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 5, "usage_type": "call" } ]
86617206234
#First step is to import the libraries import os import random import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.autograd import Variable #Here Neural Network Class will be created. class Neural_Network(nn.Module): #This class will inherit all the metho...
sukhbir77/Self-Driving-Car-Using-AI
AI.py
AI.py
py
7,059
python
en
code
0
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 11, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 11, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.nn", "line_nu...
41752192486
import numpy as np import torch import torch.nn as nn import torch.functional as F from sklearn.metrics import accuracy_score class DMILoss: def __call__(self, *args, **kwargs): return self.forward(*args, **kwargs) def forward(self, output, target): outputs = torch.softmax(output, dim=-1) ...
gohsyi/PeerLoss
models/nn.py
nn.py
py
12,922
python
en
code
36
github-code
21
[ { "api_name": "torch.softmax", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.int64", "line_number": 14, "usage_type": "attribute" }, { "api_name": "torch.zeros", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.det", "line_numb...
12607091502
from __future__ import annotations from datetime import datetime, date from typing import Union, List import firefly as ff import firefly_integration.domain as domain import pandas as pd import numpy as np class SanitizeInputData(ff.DomainService): def __call__(self, data: Union[List[dict], dict, pd.DataFrame]...
firefly-framework/firefly-integration
src/firefly_integration/domain/service/sanitize_input_data.py
sanitize_input_data.py
py
2,423
python
en
code
0
github-code
21
[ { "api_name": "firefly.DomainService", "line_number": 13, "usage_type": "attribute" }, { "api_name": "typing.Union", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 14, "usage_type": "name" }, { "api_name": "pandas.DataFrame"...
29667972734
#coding=utf-8 #Version 1.0 #update 2015-11-25 import os import re import unittest import time from appium import webdriver from selenium.webdriver.support.ui import WebDriverWait from appium.webdriver.common.touch_action import TouchAction from appium.webdriver.common.multi_action import MultiAction from selenium.web...
lwcn01/appScript
Script/video.py
video.py
py
17,995
python
en
code
1
github-code
21
[ { "api_name": "unittest.TestCase", "line_number": 14, "usage_type": "attribute" }, { "api_name": "appium.webdriver.Remote", "line_number": 22, "usage_type": "call" }, { "api_name": "appium.webdriver", "line_number": 22, "usage_type": "name" }, { "api_name": "time....
18404590349
import itertools; import math; import operator; import random; import re; from bisect import *; from collections import deque, defaultdict, Counter, OrderedDict; from heapq import *; import unittest; from typing import List; def get_sol(): return Solution() class Solution: # see the solution below for better unders...
afzalsiddique/problem-solving
Problem_Solving_Python/leetcode/lc1726.py
lc1726.py
py
1,653
python
en
code
1
github-code
21
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" }, { "api_name": "collections.Counter", "line_number": 7, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 15, "usage_type": "name" }, { "api_name": "collections.Counter", "...
43818255057
import sys import argparse from os import listdir import string import pandas as pd sys.path.append("../") import evaluator from itertools import chain import nltk from sklearn.metrics import classification_report, confusion_matrix from sklearn.preprocessing import LabelBinarizer import sklearn import...
Evm7/AHLT
Session02/Learner.py
Learner.py
py
13,356
python
en
code
0
github-code
21
[ { "api_name": "sys.path.append", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 39, "usage_type": "call" }, { "api_name": "sklearn.preproces...
14019562169
from django.http import HttpResponse from datetime import date, datetime from poll.models import * from django.shortcuts import render from django.contrib.auth.models import User from django.contrib.auth import login, authenticate from django.contrib.auth.forms import UserCreationForm from django.shortcuts import ren...
DanPetrovich/WebSite_SHP_Project-15.02.21
project_for_github/simple-votings-_-develop/poll/views.py
views.py
py
19,701
python
ru
code
0
github-code
21
[ { "api_name": "django.http.HttpResponse", "line_number": 31, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 41, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 53, "usage_type": "call" }, { "api_name...
30486082
from flask import Flask, render_template, request, redirect, url_for, session app = Flask(__name__) app.secret_key = 'your_secret_key' # Simulated user data """ - These are some dummy usernames - For example, while logging in, use 'user1' as username - It will store the session of Alice and show their email ID """ u...
soubarno77/flask_projects
Flask_Assignment5/app.py
app.py
py
1,114
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 3, "usage_type": "call" }, { "api_name": "flask.session", "line_number": 19, "usage_type": "name" }, { "api_name": "flask.session", "line_number": 20, "usage_type": "name" }, { "api_name": "flask.render_template", "l...
70299152053
import json import os import requests from tabulate import tabulate from dotenv import load_dotenv import matplotlib.pyplot as plt class Service: def __init__(self) -> None: load_dotenv() self.URL_GET = os.getenv('URL_GET') self.URL_CREATE = os.getenv('URL_CREATE') def _get_data_fro...
Maksim-Burtsev/costs_bot
services.py
services.py
py
4,068
python
ru
code
0
github-code
21
[ { "api_name": "dotenv.load_dotenv", "line_number": 13, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 14, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 15, "usage_type": "call" }, { "api_name": "requests.get", "line_numbe...
10300957193
import json from gischain import base g_tools_mapping = { # "buffer": {"func":buffer, # "desc":“{ # name:buffer, # description:得到缓冲区, # inputs:{ # datafile:要求缓冲区的数据文件 # rad...
pampa0629/gischain
tools/define.py
define.py
py
3,101
python
zh
code
4
github-code
21
[ { "api_name": "gischain.base.update_kv_dict", "line_number": 30, "usage_type": "call" }, { "api_name": "gischain.base", "line_number": 30, "usage_type": "name" }, { "api_name": "multiprocessing.current_process", "line_number": 41, "usage_type": "call" } ]
28593266541
"""Define package constants.""" import logging from typing import Final from ecowitt2mqtt.helpers.typing import UnitSystemType __version__ = "2022.08.4" LOGGER = logging.getLogger(__package__) # Configuration keys: CONF_BATTERY_OVERRIDES: Final = "battery_override" CONF_CONFIG: Final = "config" CONF_DEFAULT_BATTER...
ryanm101/ecowitt2mqtt
ecowitt2mqtt/const.py
const.py
py
8,098
python
en
code
null
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "typing.Final", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.Final", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.Final", "line_...
12900188515
#encoding=utf-8 import os import jieba import math from collections import defaultdict #dic['saasd']不会报错 def jud(a,b,c): print(a,b,c) if a>b and a>c: print(1) if b>a and b>c: print(2) if c>a and c>b: print(3) def GetStopWords(name): Stop=[] with open("data\\"+name+"...
CColike/Soochow-University-CS
Information retrieval/实验/实验3(2)/柯骅2027405033SourceCode.py
柯骅2027405033SourceCode.py
py
3,934
python
en
code
3
github-code
21
[ { "api_name": "jieba.lcut", "line_number": 25, "usage_type": "call" }, { "api_name": "jieba.cut", "line_number": 34, "usage_type": "call" }, { "api_name": "math.log", "line_number": 81, "usage_type": "call" }, { "api_name": "math.log", "line_number": 94, "...
10235848600
import re from datetime import datetime from django.conf import settings from django.template import Context from django.template.loader import get_template from django.contrib.contenttypes.models import ContentType from tendenci.apps.invoices.models import Invoice from tendenci.apps.site_settings.utils import get_sett...
musasesay/membershiptemplet
tendenci/apps/forms_builder/forms/utils.py
utils.py
py
4,963
python
en
code
1
github-code
21
[ { "api_name": "django.template.Context", "line_number": 14, "usage_type": "call" }, { "api_name": "tendenci.apps.site_settings.utils.get_setting", "line_number": 15, "usage_type": "call" }, { "api_name": "django.template.loader.get_template", "line_number": 16, "usage_typ...
42152184723
import numpy as np import sys import logging def levenshtein(needle, haystack, case_sensitive = True, substring_match = "full"): # substring_match # full # substring # beginning # end assert substring_match in ["full", "substring", "beginning", "end"] size_x = len(needle) + 1 size_y =...
kocmitom/document_reconstruction
reconstruct.py
reconstruct.py
py
7,210
python
en
code
0
github-code
21
[ { "api_name": "numpy.zeros", "line_number": 22, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 54, "usage_type": "attribute" }, { "api_name": "logging.error", "line_number": 55, "usage_type": "call" }, { "api_name": "sys.argv", "line_number":...
42706784713
from django.db import models from django.db.models.deletion import CASCADE from django.contrib.postgres.fields import ArrayField import uuid # Create your models here. def create_directory(instance, filename): dirname = instance.id return "templates/{}/{}".format(dirname, filename) def create_imgs_directory(i...
VinhTruong2001/smart-points-back-end
template/models.py
models.py
py
2,624
python
en
code
0
github-code
21
[ { "api_name": "django.db.models.Model", "line_number": 15, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 15, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 16, "usage_type": "call" }, { "api_name"...
40176301718
from . import views from django.conf.urls import url app_name = 'myapp' \ '' urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^student/$', views.studentlogin, name='student'), url(r'^teacher/$', views.teacherlogin, name='teacher'), url(r'^zhuanjia/$', views.zhuanjialogin, name='z...
qq1014584725/web
project/myapp/urls.py
urls.py
py
1,865
python
en
code
0
github-code
21
[ { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "django.co...
13560570067
from flask import Flask, jsonify, request from flask_sqlalchemy import SQLAlchemy from flask_cors import CORS from flask_marshmallow import Marshmallow from sqlalchemy.sql.expression import Tuple from models import * from sqlalchemy.orm import load_only app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'my...
spiderdj/undefined-visaHack2019
backend/API/Controller.py
Controller.py
py
11,965
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 11, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 13, "usage_type": "call" }, { "api_name": "flask_marshmal...
28502347231
# 416. Partition Equal Subset Sum # Given a non-empty array containing only positive integers, find if the # array can be partitioned into two subsets such that the sum of # elements in both subsets is equal. # Note: # Each of the array element will not exceed 100. # The array size will not exceed 200. # Example 1: ...
DmitryVlaznev/leetcode
416-partition-equal-subset-sum.py
416-partition-equal-subset-sum.py
py
1,491
python
en
code
2
github-code
21
[ { "api_name": "typing.List", "line_number": 26, "usage_type": "name" } ]
28967284140
""" Distributed batch training of ATLAS RPV CNN Classifier """ # System import socket import argparse # Externals import horovod.keras as hvd # Locals from rpv import load_dataset, build_model, train_model # Argument parsing parser = argparse.ArgumentParser() parser.add_argument('--input-dir', default='/global/cscr...
sparticlesteve/cori-intml-examples
train_rpv.py
train_rpv.py
py
3,032
python
en
code
11
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 16, "usage_type": "call" }, { "api_name": "horovod.keras.init", "line_number": 37, "usage_type": "call" }, { "api_name": "horovod.keras", "line_number": 37, "usage_type": "name" }, { "api_name": "horovod.kera...
24400180617
from __future__ import print_function import json from flask import jsonify, request, Response from flask_mail import Message from app import mail from app import app from app.lsa import LSA from app.models import Recipe, Ricin, Ingredient from app.schema import RecipeSchema, IngredientSchema, FullIngredientSchema, Tit...
GiuseppeNappo/MagicPotBackend
app/routes.py
routes.py
py
3,297
python
en
code
0
github-code
21
[ { "api_name": "app.schema.RecipeSchema", "line_number": 12, "usage_type": "call" }, { "api_name": "app.schema.IngredientSchema", "line_number": 13, "usage_type": "call" }, { "api_name": "app.schema.FullIngredientSchema", "line_number": 14, "usage_type": "call" }, { ...
39066959162
import logging import json import datetime import requests import pyodbc import azure.functions as func from .connection_config import syn_sql_pool_conn_string, container_weather_dir_raw_data def main(req: func.HttpRequest) -> func.HttpResponse: logging.info("Python HTTP trigger function processed a request.") ...
rafalnac/weather-air-quality-poland
az-functions/http-trigger-get-gios-measurment-data/__init__.py
__init__.py
py
2,488
python
en
code
0
github-code
21
[ { "api_name": "azure.functions.HttpRequest", "line_number": 12, "usage_type": "attribute" }, { "api_name": "azure.functions", "line_number": 12, "usage_type": "name" }, { "api_name": "logging.info", "line_number": 13, "usage_type": "call" }, { "api_name": "pyodbc....
39432898609
import json import pandas as pd from pathlib import Path DATA_PATH = Path("/data/wr153") txt_list = [] for f in DATA_PATH.joinpath("text").iterdir(): if f.suffix == ".json": with open(f, "rb") as fp: d = json.load(fp) ch_title = d.pop(sorted(d, key=int)[0]) # remove ou...
lavaman131/graphic_memoir_analysis
generate_fine_tuning_data.py
generate_fine_tuning_data.py
py
905
python
en
code
0
github-code
21
[ { "api_name": "pathlib.Path", "line_number": 6, "usage_type": "call" }, { "api_name": "json.load", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 24, "usage_type": "call" } ]
1738442401
# -*- coding: utf-8 -*- import re from scrapy import Spider from dateutil import parser from artbot_scraper.items import EventItem from pytz import timezone class NationalArtSchoolSpider(Spider): name = 'National Art School' allowed_domains = ['nas.edu.au']...
coreymcdermott/artbot
artbot_scraper/spiders/nas_spider.py
nas_spider.py
py
1,330
python
en
code
2
github-code
21
[ { "api_name": "scrapy.Spider", "line_number": 9, "usage_type": "name" }, { "api_name": "artbot_scraper.items.EventItem", "line_number": 15, "usage_type": "call" }, { "api_name": "re.search", "line_number": 23, "usage_type": "call" }, { "api_name": "pytz.timezone",...
27911179467
from flask import request from . import user_app from apps.models.organizations import Organization from pkg.response.response import Response from exts import db @user_app.route("/organization/add", methods=['POST']) def organization_add(): """ 机构的新增 :return: """ title = request.fo...
Gscsd8527/FlaskProject
FlaskAdmin/apps/users/organization.py
organization.py
py
1,659
python
en
code
0
github-code
21
[ { "api_name": "flask.request.form.get", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.request.form", "line_number": 15, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 15, "usage_type": "name" }, { "api_name": "flask.re...
73350416372
import os from random import randrange from tqdm import tqdm PATH = "/home/heinecantor/Scaricati/HANDS_yolo" os.makedirs(PATH + "/train/images", exist_ok=True) os.makedirs(PATH + "/train/labels", exist_ok=True) os.makedirs(PATH + "/valid/images", exist_ok=True) os.makedirs(PATH + "/valid/labels", exist_ok=True) os....
HeineCantor/Handy
training/preprocessing/train_valid_test_splitter.py
train_valid_test_splitter.py
py
1,283
python
en
code
1
github-code
21
[ { "api_name": "os.makedirs", "line_number": 7, "usage_type": "call" }, { "api_name": "os.makedirs", "line_number": 8, "usage_type": "call" }, { "api_name": "os.makedirs", "line_number": 10, "usage_type": "call" }, { "api_name": "os.makedirs", "line_number": 11...
70310219574
from django.test import TestCase from . import xmlrpc from .constants import AmcrConstants as constants from . import helper from django.conf import settings from webamcr import helper_general from .models import Dokument #import html5lib import json import time import threading from shapely import wkb ...
ARUP-CAS/aiscr-amcr-pas-3d
webamcr/documents/tests.py
tests.py
py
17,166
python
en
code
1
github-code
21
[ { "api_name": "django.test.TestCase", "line_number": 18, "usage_type": "name" }, { "api_name": "django.conf.settings.AMCR_BACKEND_MOCK", "line_number": 21, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 21, "usage_type": "name" }, { ...
12338777449
# from PySide6.QtWidgets import QApplication, QWidget, QVBoxLayout, QTreeWidget, QTreeWidgetItem # class Example(QWidget): # def __init__(self): # super().__init__() # self.initUI() # def initUI(self): # vbox = QVBoxLayout() # tree = QTreeWidget() # tree.setColumnCount...
leateng/cutter
examples/tree.py
tree.py
py
3,800
python
en
code
0
github-code
21
[ { "api_name": "PySide6.QtWidgets.QWidget", "line_number": 52, "usage_type": "name" }, { "api_name": "PySide6.QtWidgets.QVBoxLayout", "line_number": 58, "usage_type": "call" }, { "api_name": "PySide6.QtWidgets.QTreeWidget", "line_number": 60, "usage_type": "call" }, { ...
37389714667
import pandas as pd import numpy as np import xgboost as xgb from xgboost.sklearn import XGBRegressor from sklearn import cross_validation, metrics from sklearn.grid_search import GridSearchCV from sklearn import preprocessing import matplotlib.pylab as plt from matplotlib.pylab import rcParams rcParams['figure.figsi...
thousandface/jdd_c
model2.py
model2.py
py
2,708
python
en
code
1
github-code
21
[ { "api_name": "matplotlib.pylab.rcParams", "line_number": 12, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 15, "usage_type": "call" }, { "api_name": "xgboost.skl...
40149737882
import click import pluggy from tree import leaf from tree import twig from tree.trunk import hooks def print_banner(): print(""" _-_ /~~ ~~\\ /~~ ~~\\ { } \ _- -_ / ~ \\\\ // ~ _- - | | _- _ _ - | | -_ // \\ """) @click.group() def cli() ->...
dmaljovec/tree-trunk
tree/trunk/main.py
main.py
py
797
python
en
code
0
github-code
21
[ { "api_name": "click.group", "line_number": 22, "usage_type": "call" }, { "api_name": "click.command", "line_number": 27, "usage_type": "call" }, { "api_name": "pluggy.PluginManager", "line_number": 37, "usage_type": "call" }, { "api_name": "tree.trunk.hooks", ...
45677981085
import os import sys from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter from typing import Dict, Optional, NamedTuple, List import numpy as np from common.constants import NAME, PATH, EXT, START_TIME from common.constants import STATS, MODELS, PARAMS, LOGS, CHECKPOINTS from data.data_io impor...
MattMcPartlon/AttnPacker
protein_learning/networks/config/global_config.py
global_config.py
py
48,675
python
en
code
50
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 62, "usage_type": "call" }, { "api_name": "argparse.ArgumentDefaultsHelpFormatter", "line_number": 64, "usage_type": "name" }, { "api_name": "scoring.loss.coord_loss.COORD_LOSS_TY_DESCS", "line_number": 197, "usage_t...
42815280396
import configparser from lib import emr_cluster if __name__ == "__main__": # Read in configurations parameters config_filepath = 'config.cfg' config = configparser.ConfigParser() config.read_file(open(config_filepath)) # Instantiate a EMRLoader cluster class emrCluster = emr_clust...
Antozamm/1week4
Udacity-DEND-capstone/home/.ipynb_checkpoints/emr_cluster_spark_submit-checkpoint.py
emr_cluster_spark_submit-checkpoint.py
py
1,730
python
en
code
0
github-code
21
[ { "api_name": "configparser.ConfigParser", "line_number": 11, "usage_type": "call" }, { "api_name": "lib.emr_cluster.EMRLoader", "line_number": 15, "usage_type": "call" }, { "api_name": "lib.emr_cluster", "line_number": 15, "usage_type": "name" } ]
34233392229
from django.db import models from django.contrib.auth.models import User TYPE =( ('Positive','Positive'), ('Negative', 'Negative') ) # Create your models here. class Profile(models.Model): user = models.ForeignKey(User,on_delete=models.CASCADE) income = models.FloatField() expenses = models.Fl...
Rahul27032000/DjangoExpenseApp
home/models.py
models.py
py
1,044
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.db.models.ForeignKey", "line_number": 11, "usage_type": "call" }, { "api_name...
13076176479
#construct NN Data Web Scrapping from google.com #save parameters so we can use many times for each obj #convert images to h5 dataset #scraping images data from web and save it #reshaping images (64,64,3) or other uniform shape and save it #web packs import requests #lib to perform HTTP request from any si...
roshdii/WNN
Web_scraping.py
Web_scraping.py
py
5,697
python
en
code
0
github-code
21
[ { "api_name": "os.path.join", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_number": 27, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path.exists", "line_...
74328301494
import os import argparse import tensorflow as tf import yaml import json """ HOW TO USE: 1) Create Python 3.8 venv: /usr/bin/python3.8 -m venv ~/py38_venv 2) Activate and install Tensorflow 2.7: cd py38_venv/ source bin/activate pip3 install tensorflow 3) ssh to hosts in ../distribute.yaml, note the index number t...
christian-westbrook/covid-19-and-weather-patterns
src/start_worker.py
start_worker.py
py
1,661
python
en
code
1
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 32, "usage_type": "call" }, { "api_name": "yaml.safe_load", "line_number": 38, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 48, "usage_type": "attribute" }, { "api_name": "json.dumps", ...
10294797175
import re import pandas as pd import numpy as np import sys import os import networkx as nx from datetime import datetime from collections import defaultdict import random import time import uuid def makehash(w=dict): """autovivification like hash in perl http://stackoverflow.com/questions/651794/whats-the-be...
anfoss/PCprophet
PCprophet/io_.py
io_.py
py
12,652
python
en
code
11
github-code
21
[ { "api_name": "collections.defaultdict", "line_number": 23, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 35, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 47, "usage_type": "call" }, { "api_name"...
27812962095
import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable from layers import * import torchvision.transforms as transforms import torchvision.models as models import torch.backends.cudnn as cudnn import torch.nn.init as init import os class L2Norm(nn.Module): '''L2Norm ...
LeileiCao/SFD_Pytorch
models/SFD_net.py
SFD_net.py
py
7,716
python
en
code
1
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 12, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 12, "usage_type": "name" }, { "api_name": "torch.nn.Parameter", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.nn", "line...
5108877987
# Pontificia Universidad Javeriana. Departamento de Electrónica # Authors: Juan Henao, Marian Fuentes; Estudiantes de Ing. Electrónica. # Procesamiento de Imagenes y video # 25/10/2020 # Import Librarys import numpy as np import cv2 import glob import os import json # Control the number of vertices findCh...
marianfuentes/calibration-and-3D-projection-camera-calibration
camera_calibration.py
camera_calibration.py
py
5,484
python
en
code
0
github-code
21
[ { "api_name": "cv2.TERM_CRITERIA_EPS", "line_number": 18, "usage_type": "attribute" }, { "api_name": "cv2.TERM_CRITERIA_MAX_ITER", "line_number": 18, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "line_number": 21, "usage_type": "call" }, { "api_name":...
73892331573
import zmq import json import copy class Matrix: "Leds matrix" def __init__(self): "Establish connection to matrix" self.width = 12 self.height = 10 self.__mat__ = [None]*10 for x in range(10): self.__mat__[x] = [None]*12 for y in range(12): ...
Cynerd/turris-tetris
turtetris_master/led_output.py
led_output.py
py
2,219
python
en
code
2
github-code
21
[ { "api_name": "zmq.Context", "line_number": 18, "usage_type": "call" }, { "api_name": "zmq.PUB", "line_number": 19, "usage_type": "attribute" }, { "api_name": "json.dumps", "line_number": 26, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number"...
15750308160
import logging import os from spinn_utilities.socket_address import SocketAddress from spinnman.messages.eieio import EIEIOType from spinn_front_end_common.abstract_models import ( AbstractSendMeMulticastCommandsVertex) from spinn_front_end_common.utility_models import LivePacketGather from spinn_front_end_common.u...
apdavison/sPyNNaker8
spynnaker8/external_devices/__init__.py
__init__.py
py
10,899
python
en
code
null
github-code
21
[ { "api_name": "spynnaker.pyNN.spynnaker_external_device_plugin_manager.SpynnakerExternalDevicePluginManager.add_database_socket_address", "line_number": 48, "usage_type": "attribute" }, { "api_name": "spynnaker.pyNN.spynnaker_external_device_plugin_manager.SpynnakerExternalDevicePluginManager", ...
31923287564
import os import sys import stat import argparse import calc from calc.interpreter import Interpreter, ParserError def interpret(text): """Pass input ``text`` to a new ``Interpreter``. Args: text (str): The text to be interpreted. """ interpreter = Interpreter(text) try: result =...
reillysiemens/calc
calc/__main__.py
__main__.py
py
1,172
python
en
code
0
github-code
21
[ { "api_name": "calc.interpreter.Interpreter", "line_number": 16, "usage_type": "call" }, { "api_name": "calc.interpreter.ParserError", "line_number": 20, "usage_type": "name" }, { "api_name": "argparse.ArgumentParser", "line_number": 25, "usage_type": "call" }, { ...
38057388802
import time import pandas import pygame grid_user = [[0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0...
SRingshandl/SudokuSolver
SudokuSolverVisual.py
SudokuSolverVisual.py
py
7,120
python
en
code
0
github-code
21
[ { "api_name": "pandas.DataFrame", "line_number": 15, "usage_type": "call" }, { "api_name": "pygame.Rect", "line_number": 75, "usage_type": "call" }, { "api_name": "pygame.draw.rect", "line_number": 76, "usage_type": "call" }, { "api_name": "pygame.draw", "line...
71894642294
from EntityModel.CompositeTask import CompositeTask from EntityModel.SimpleTask import SimpleTask from EntityModel.Deliverable import Deliverable from flask import Flask, jsonify, request import main_func import json import os.path import sys def createProject(name, date): #name = json_request['pname'] #date = jso...
yogeshdixit41/PyFlaskWebApp
Controller/ProjectController.py
ProjectController.py
py
2,222
python
en
code
1
github-code
21
[ { "api_name": "EntityModel.CompositeTask.CompositeTask", "line_number": 15, "usage_type": "call" }, { "api_name": "main_func.getId", "line_number": 15, "usage_type": "call" }, { "api_name": "main_func.project_objects", "line_number": 17, "usage_type": "attribute" }, {...
12265698391
import numpy as np import tensorflow as tf import cv2 import sys import utils import vgg19 import matplotlib.pyplot as plt import skimage.io vgg_height=224 vgg_width=224 class CNNfeature: def __init__(self): self.vgg = vgg19.Vgg19() self.sess = tf.Session() self.vgg_placeh...
plutojia/tracker-byVGG19Feature-python
CNNfeature.py
CNNfeature.py
py
2,478
python
en
code
5
github-code
21
[ { "api_name": "vgg19.Vgg19", "line_number": 15, "usage_type": "call" }, { "api_name": "tensorflow.Session", "line_number": 16, "usage_type": "call" }, { "api_name": "tensorflow.placeholder", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2.resize", ...
12900008464
import pygame, sys, objects from pygame.locals import * pygame.init() pygame.font.init() pygame.key.set_repeat(100, 50) screen = pygame.display.set_mode((640, 480)) pygame.display.set_caption('Asteroids') screenx = screen.get_width() screeny = screen.get_height() background = pygame.Surface((screen.get_size())) back...
Peter-Lande/asteroids
main.py
main.py
py
1,593
python
en
code
0
github-code
21
[ { "api_name": "pygame.init", "line_number": 4, "usage_type": "call" }, { "api_name": "pygame.font.init", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.font", "line_number": 5, "usage_type": "attribute" }, { "api_name": "pygame.key.set_repeat", ...
4088924048
import logging def get_logger(logger_name= __name__, log_base_level=logging.DEBUG, fh_name='Logging/logs/sys.log', fh_log_level=logging.DEBUG): logger = logging.getLogger(logger_name) print('F1, logger_name', logger_name, logger.handlers) logger.setLevel(log_base_level) formatter = logging.Formatter...
OlegBunseki/Python-Tutorials
Logging/utils_logger.py
utils_logger.py
py
637
python
en
code
0
github-code
21
[ { "api_name": "logging.DEBUG", "line_number": 3, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 5, "usage_type": "call" }, { "api_name": "logging.Formatter", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.FileHand...
69900042292
import os import base64 import hashlib import hmac import json from flask import Flask, request, jsonify, make_response app = Flask(__name__) API_KEY = os.environ['API_KEY'] API_SECRET = os.environ['API_SECRET'] @app.route('/') def top(): return 'hello' @app.route('/webhook', methods=['GET'], strict_slashes=F...
kairi003/twitter-aaapi-test
main.py
main.py
py
796
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 11, "usage_type": "attribute" }, { "api_name": "flask.request.args.get", ...
25465557813
# -*- coding: utf-8 -*- import re from flask import abort, render_template, redirect, request, url_for, flash from flask_login import login_user, logout_user, login_required, current_user from flask_babel import gettext from config import ( IsDebug, IsDeepDebug, IsTrace, IsPrintExceptions, errorlog, print_to, p...
ichar/tvmlivehealth.telegram
app/scenario/views.py
views.py
py
1,419
python
en
code
0
github-code
21
[ { "api_name": "flask_babel.gettext", "line_number": 47, "usage_type": "call" }, { "api_name": "flask_babel.gettext", "line_number": 48, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 56, "usage_type": "call" } ]
26556934021
import IRBEM import numpy as np import matplotlib.pylab as plt import spacepy.datamodel import dateutil.parser import copy from mpl_toolkits.mplot3d import Axes3D X = {} X['x1'] = 651 X['x2'] = 63 X['x3'] = 15.9 X['dateTime'] = '2015-02-02T06:12:43' X2 = copy.deepcopy(X) # Get TS04 field inputs omniLoc = '/home/mike...
mshumko/bouncing_microburst
event0/show_bounce_field.py
show_bounce_field.py
py
2,821
python
en
code
0
github-code
21
[ { "api_name": "copy.deepcopy", "line_number": 15, "usage_type": "call" }, { "api_name": "spacepy.datamodel.datamodel.fromHDF5", "line_number": 19, "usage_type": "call" }, { "api_name": "spacepy.datamodel.datamodel", "line_number": 19, "usage_type": "attribute" }, { ...
12714853077
import numpy as np import torch class gcn_layer(torch.nn.Module): """ layer http://tkipf.github.io/graph-convolutional-networks/ """ def __init__(self, indim, outdim): super(gcn_layer, self).__init__() self.indim = indim self.outdim = outdim self.weight = to...
ishanrai05/gnn
demo/gcn/layers.py
layers.py
py
1,074
python
en
code
0
github-code
21
[ { "api_name": "torch.nn", "line_number": 4, "usage_type": "attribute" }, { "api_name": "torch.nn.Parameter", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.FloatTensor", ...
31247481641
import os import subprocess import math import configparser from PIL import Image import requests import images if os.name == "nt" and not os.path.exists("ffmpeg.exe"): print("Downloading 7zr...") a = requests.get("https://www.7-zip.org/a/7zr.exe") open("7zr.exe", "wb").write(a.content) print("D...
stonedDiscord/ao-nds
converter/AO NDS converter.py
AO NDS converter.py
py
17,857
python
en
code
null
github-code
21
[ { "api_name": "os.name", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "requests.get", "line_num...
39687221971
from django.shortcuts import render, redirect from .models import Post, Author, Comment from django.views import generic from .forms import CommentForm, SearchForm from django.contrib.auth.decorators import login_required from django.shortcuts import get_object_or_404 from django.contrib import messages from django.vie...
deelaym/blog
blog/views.py
views.py
py
4,503
python
en
code
0
github-code
21
[ { "api_name": "models.Post.objects.all", "line_number": 19, "usage_type": "call" }, { "api_name": "models.Post.objects", "line_number": 19, "usage_type": "attribute" }, { "api_name": "models.Post", "line_number": 19, "usage_type": "name" }, { "api_name": "models.A...
10805802942
from __future__ import print_function, division import os import numpy as np from openmdao.api import Group, Problem, Group, IndepVarComp, Component from pointer.components import Trajectory, RHS, EOMComp, CollocationPhase from scipy import interpolate class TerrainElevationComp(EOMComp): ''' The terrain co...
jcchin/MagnePlane
src/hyperloop/Python/mission/terrain.py
terrain.py
py
3,101
python
en
code
1
github-code
21
[ { "api_name": "pointer.components.EOMComp", "line_number": 11, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_number": 28, "usage_type": "attribute" }, { "api_name": "os.path.realp...
315462077
"""Main class to handle Database connection.""" import logging import bleach import psycopg2 import psycopg2.extensions from conf import settings psycopg2.extensions.register_type(psycopg2.extensions.UNICODE) psycopg2.extensions.register_type(psycopg2.extensions.UNICODEARRAY) log = logging.getLogger() log.setLevel(...
gogasca/news_ml
api/version1_0/database/Db.py
Db.py
py
7,045
python
en
code
4
github-code
21
[ { "api_name": "psycopg2.extensions.register_type", "line_number": 10, "usage_type": "call" }, { "api_name": "psycopg2.extensions", "line_number": 10, "usage_type": "attribute" }, { "api_name": "psycopg2.extensions.register_type", "line_number": 11, "usage_type": "call" ...
43435061778
#!/usr/bin/env python3 """ Tool for creating a dictionary for a lecture. """ import os import lmh_harvest as harvest import import_graph as graph from make_dictionary import * import argparse parser = argparse.ArgumentParser(description="Script for generating a dictionary for a lecture") parser.add_argument("IN...
slatex/lmhtools
lecture_dictionary.py
lecture_dictionary.py
py
3,303
python
en
code
2
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 14, "usage_type": "call" }, { "api_name": "lmh_harvest.get_mathhub_dir", "line_number": 18, "usage_type": "call" }, { "api_name": "lmh_harvest.split_path_repo_doc", "line_number": 19, "usage_type": "call" }, { ...
13534054824
import os import torch import torch.nn as nn from matplotlib import pyplot as plt from torch import optim from tqdm import tqdm import logging from torch.utils.tensorboard import SummaryWriter logging.basicConfig(format="%(asctime)s - %(levelname)s: %(message)s", level=logging.INFO, datefmt="%I:%M:%S") class Diffusio...
abuzar08/ML
PyTorch/Diffusion/ddpm.py
ddpm.py
py
3,088
python
en
code
2
github-code
21
[ { "api_name": "logging.basicConfig", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.cumprod", "line_number": 29, "usage_type": "call" }, { "api_name": "torch.linspace", ...
73412273973
import re import scrapy from etherscan.items import EtherscanItem class EscanSpider(scrapy.Spider): name = 'escan' allowed_domains = ['cn.etherscan.com'] start_urls = ['https://cn.etherscan.com/token/0xf4cB3db185D11e1cD3eEFDe5FFA5dDF4976c3B2e'] token = '0xf4cB3db185D11e1cD3eEFDe5FFA5dDF4976c3B2e' ...
Alexshaneeee/Etherscan_data_crawler
spiders/escan.py
escan.py
py
2,233
python
en
code
1
github-code
21
[ { "api_name": "scrapy.Spider", "line_number": 6, "usage_type": "attribute" }, { "api_name": "scrapy.Request", "line_number": 22, "usage_type": "call" }, { "api_name": "re.search", "line_number": 29, "usage_type": "call" }, { "api_name": "re.search", "line_numb...
38793846242
from django.urls import path from . import views from django.conf.urls import url urlpatterns = [ path('post_list/', views.post_list, name='post_list'), path('post/<int:id>/', views.post_detail, name='post_detail'), path('post/new', views.post_new, name='post_new'), path('post/<int:id>/edit/', views.po...
jjisol/prerana
community/urls.py
urls.py
py
517
python
en
code
0
github-code
21
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", ...
27776569175
import requests from flask import Flask, request, jsonify from flask_restful import Resource, Api from flask_cors import CORS import json class ThingsToDo(Resource): def get(self): args = request.args url = request.url with open("thingstodo.json") as thingstodo: data ...
memetron/PackathonAPI
main.py
main.py
py
3,147
python
en
code
0
github-code
21
[ { "api_name": "flask_restful.Resource", "line_number": 7, "usage_type": "name" }, { "api_name": "flask.request.args", "line_number": 9, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 9, "usage_type": "name" }, { "api_name": "flask.reque...
74363470772
import requests def get_form(params: dict[str, str]): resp = requests.post("http://localhost:10000/api/v1/get_form", params=params) return resp.json()["result"] params_list = [ { "contact_number": "+7 999 999 99 99", "order_date": "1990-02-11" }, { "contact_number": "+7 ...
user0101010101/test_task
script_for_testing.py
script_for_testing.py
py
746
python
en
code
0
github-code
21
[ { "api_name": "requests.post", "line_number": 5, "usage_type": "call" } ]
7637340881
import csv from config import config from telethon import TelegramClient from telethon.tl.functions.contacts import ResolveUsernameRequest from telethon.tl.functions.channels import GetParticipantsRequest from telethon.tl.types import ChannelParticipantsSearch from telethon.tl.types import InputChannel def get_tel...
kleros/kleros-airdrop
tools/telegram.py
telegram.py
py
2,133
python
en
code
4
github-code
21
[ { "api_name": "config.config", "line_number": 15, "usage_type": "name" }, { "api_name": "config.config", "line_number": 16, "usage_type": "name" }, { "api_name": "config.config", "line_number": 17, "usage_type": "name" }, { "api_name": "telethon.TelegramClient", ...
23971268273
#!/usr/bin/env python3 from person import Person from numba import njit from time import perf_counter as pf import matplotlib import matplotlib.pyplot as pp def fib_python(n): if n <= 1: return n else: return(fib_python(n-1) + fib_python(n-2)) @njit def fib_python_numba(n): if n <= 1: return n else: retu...
olofjardfelt/prog2
MA4/MA4_Files/MA4_2.py
MA4_2.py
py
3,008
python
en
code
0
github-code
21
[ { "api_name": "numba.njit", "line_number": 15, "usage_type": "name" }, { "api_name": "person.Person", "line_number": 26, "usage_type": "call" }, { "api_name": "person.Person", "line_number": 31, "usage_type": "call" }, { "api_name": "time.perf_counter", "line_...
29747715186
#!/usr/bin/env python # -*- coding: cp1252 -*- # ============================================================================ # Project Name : iTrade # Module Name : itrade_import_yahoo_japan.py # # Description: Import quotes from http://quote.yahoo.co.jp/ # # The Original Code is iTrade code (http://itrade.so...
eternallyBaffled/itrade
ext/itrade_import_yahoo_japan.py
itrade_import_yahoo_japan.py
py
11,502
python
en
code
5
github-code
21
[ { "api_name": "itrade_logging.debug", "line_number": 64, "usage_type": "call" }, { "api_name": "itrade_connection.ITradeConnection", "line_number": 66, "usage_type": "call" }, { "api_name": "itrade_config.proxyHostname", "line_number": 66, "usage_type": "attribute" }, ...
70373125174
import requests import time import json from datetime import datetime import colorama from colorama import Fore colorama.init() def fetch_comments(article_id: int, user_id: int): url = 'https://sspai.com/api/v1/comment/user/article/hot/page/get' params = {'limit': 10, 'offset': 0, 'article_id': article_id, 'u...
chengluyu/crawlers
sspai/sspai.py
sspai.py
py
2,041
python
en
code
1
github-code
21
[ { "api_name": "colorama.init", "line_number": 8, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 24, "usage_type": "call" }, { "api_name": "requests.get", "line_number"...
6613889864
import librosa import os import _pickle as pickle import imageio imageio.plugins.ffmpeg.download() import moviepy.editor as MovieEditor import opinion.database.db as db from bson.binary import Binary from pathlib import Path from pydub import AudioSegment video_directory = '../data/videos/' mp4_extension = '.mp4' mp3...
diegosst/opinion-mining
src/extraction/audio.py
audio.py
py
4,418
python
en
code
2
github-code
21
[ { "api_name": "imageio.plugins.ffmpeg.download", "line_number": 5, "usage_type": "call" }, { "api_name": "imageio.plugins", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 27, "usage_type": "call" }, { "api_name": "pathlib....
9204679966
from sklearn.ensemble import RandomForestClassifier from sklearn.calibration import CalibratedClassifierCV def get_model(params, name, calibration=None, X=None, y=None): base_model = RandomForestClassifier(**params) if not calibration: model = base_model else: model = CalibratedClassifierCV...
Villux/world_cup
models/one_vs_all_model.py
one_vs_all_model.py
py
1,859
python
en
code
0
github-code
21
[ { "api_name": "sklearn.ensemble.RandomForestClassifier", "line_number": 5, "usage_type": "call" }, { "api_name": "sklearn.calibration.CalibratedClassifierCV", "line_number": 9, "usage_type": "call" } ]
73030670133
"""Implements the xonsh executer""" import re import os import types import inspect import builtins from collections import Iterable, Sequence, Mapping from xonsh import ast from xonsh.parser import Parser from xonsh.tools import subproc_toks from xonsh.built_ins import load_builtins, unload_builtins class Execer(ob...
LiuFang816/SALSTM_py_data
python/donnemartin_gitsome/gitsome-master/xonsh/execer.py
execer.py
py
8,496
python
en
code
9
github-code
21
[ { "api_name": "xonsh.parser.Parser", "line_number": 35, "usage_type": "call" }, { "api_name": "xonsh.ast.CtxAwareTransformer", "line_number": 39, "usage_type": "call" }, { "api_name": "xonsh.ast", "line_number": 39, "usage_type": "name" }, { "api_name": "xonsh.bui...
70346454454
#!/usr/bin/env python """The setup script.""" from setuptools import setup, find_packages with open('README.md') as readme_file: readme = readme_file.read() requirements = [ ] test_requirements = [ ] setup( author="Themi Megas", author_email='tcm4760@gmail.com', python_requires='>=3.8', classi...
Themis3000/lazy_db
setup.py
setup.py
py
1,206
python
en
code
1
github-code
21
[ { "api_name": "setuptools.setup", "line_number": 14, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 36, "usage_type": "call" } ]