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
27483741105
import asyncio import json from typing import Optional from mattermostdriver.exceptions import NotEnoughPermissions from mmpy_bot import Plugin, Message from mmpy_bot.driver import Driver from mmpy_bot.plugins import PluginManager from mmpy_bot.settings import Settings class ExtendedPlugin(Plugin): seq = 1 d...
phntom/chadbot
chadbot/extended_plugin.py
extended_plugin.py
py
1,947
python
en
code
1
github-code
18
[ { "api_name": "mmpy_bot.Plugin", "line_number": 12, "usage_type": "name" }, { "api_name": "mmpy_bot.driver.Driver", "line_number": 16, "usage_type": "name" }, { "api_name": "mmpy_bot.plugins.PluginManager", "line_number": 16, "usage_type": "name" }, { "api_name": ...
11376736575
from typing import final import gi gi.require_version('Handy', '1') gi.require_version('Gtk', '3.0') from gi.repository import Gtk, Handy, GLib, Gdk from datetime import date, datetime from time import sleep from .custom_widgets import * from . import utils from uuid import uuid4 import threading import logging log...
hezral/keystrokes
src/window.py
window.py
py
31,867
python
en
code
16
github-code
18
[ { "api_name": "gi.require_version", "line_number": 3, "usage_type": "call" }, { "api_name": "gi.require_version", "line_number": 4, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.INFO"...
17025696300
import torch from torch import nn class EmptyBatch(Exception): pass class RankingLoss(nn.Module): def __init__(self): super(RankingLoss, self).__init__() self.relu = nn.ReLU() self.delta = 10.0 def forward(self, pred, target): pred = pred.squeeze() target = target.squeeze() batch_size = pred.size(0) ...
lupoglaz/DeepProteinDocking2D
Models/EQInteraction.py
EQInteraction.py
py
1,631
python
en
code
5
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 7, "usage_type": "name" }, { "api_name": "torch.nn.ReLU", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.nn", "line_number...
74625428841
from Identifiers import GameType import json from myGame import Game PLAYER_1 = "PLAYER_1" PLAYER_2 = "PLAYER_2" SET_NAME = "SET_NAME" GET_NAME = "GET_NAME" WAIT = "WAIT" START = "START" PLAY = "PLAY" UPDATE = "UPDATE" QUIT = "QUIT" END = "END" HOST = '127.0.0.1' PORT = 5000 class TicTacToeClient: def __init_...
AliMert/MultiGames
MultiGames/Clients/TicTacToeClient.py
TicTacToeClient.py
py
3,664
python
en
code
0
github-code
18
[ { "api_name": "myGame.Game", "line_number": 24, "usage_type": "call" }, { "api_name": "Identifiers.GameType.TicTacToe", "line_number": 26, "usage_type": "attribute" }, { "api_name": "Identifiers.GameType", "line_number": 26, "usage_type": "name" }, { "api_name": "...
22277286456
from itertools import combinations import copy def dfs(x, y): # 바이러스 걸린 구역일 때만 상하좌우 보기 for i in range(4): nx = x + dx[i] ny = y + dy[i] # 범위 넘어가면 넘어감 if nx < 0 or ny < 0 or nx >= n or ny >= m: continue # 벽 말고 빈공간일때만 전파 if temp_graph[nx][ny] == 0: ...
cheon4050/CodingTest-Study
09주차/14502/seongeun_14502.py
seongeun_14502.py
py
2,524
python
en
code
0
github-code
18
[ { "api_name": "itertools.combinations", "line_number": 34, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 39, "usage_type": "call" } ]
21655802311
import spotipy import pandas as pd import json def getTop50(token): sp = spotipy.Spotify(auth=token) #######Testing # results = spotify.search(q='artist:' + 'Kendrick Lamar', type='artist') # playlists = sp.user_playlists(username) ####### Get US Top 50 ID ################## # playlists_US=...
danielrockwell/Spotify_API
spotify_scripts/spotify.py
spotify.py
py
1,210
python
en
code
0
github-code
18
[ { "api_name": "spotipy.Spotify", "line_number": 7, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 31, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 32, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_num...
10408629862
from flask import Flask, render_template, redirect, session app = Flask(__name__) app.secret_key = 'jnnuuhuhuh216546ihuohuuhgiygiygyi' @app.route('/') def sessions(): if 'count' not in session: session['count'] = 0 session['count']+=1 return render_template("index.html", count= session['count']) @...
AbomiDaba/Python
flask/fundamentals/counter/server.py
server.py
py
588
python
en
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 2, "usage_type": "call" }, { "api_name": "flask.session", "line_number": 7, "usage_type": "name" }, { "api_name": "flask.session", "line_number": 8, "usage_type": "name" }, { "api_name": "flask.session", "line_number...
74610653800
from PyQt5.QtCore import * from PyQt5.QtWidgets import * from PyQt5 import QtGui from PyQt5.QtGui import QImage,QPalette, QBrush import csv from key_solver import * class Window(QMainWindow): def __init__(self): super().__init__() reader=self.readConfig() self.title = "Welcome To The Game"...
GetMoon2EZ/BobDylan
gui_v1.py
gui_v1.py
py
59,095
python
en
code
0
github-code
18
[ { "api_name": "PyQt5.QtGui.QPixmap", "line_number": 195, "usage_type": "call" }, { "api_name": "PyQt5.QtGui", "line_number": 195, "usage_type": "name" }, { "api_name": "PyQt5.QtGui.QIcon", "line_number": 196, "usage_type": "call" }, { "api_name": "PyQt5.QtGui", ...
16784833619
import numpy as np from sklearn import svm from sklearn import metrics from sklearn.metrics import zero_one_score X = [[14.5], [5.5], [7.5], [10.5], [15.5], [13.5], [9.5], [8.5], [10.5], [16.5], [14.5], [11.5], [13.5], [11.5], [16.5], [13.5], [18.5], [10.5]] y = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
simka999/patternrecognition
SVM.py
SVM.py
py
653
python
en
code
0
github-code
18
[ { "api_name": "sklearn.svm.SVC", "line_number": 11, "usage_type": "call" }, { "api_name": "sklearn.svm", "line_number": 11, "usage_type": "name" }, { "api_name": "numpy.sqrt", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number":...
20952224742
#!/usr/bin/env python # coding: utf-8 from sqlalchemy import create_engine import pandas as pd import os import requests import json import config import datetime import time dataDir='Kaggle_csvData' column_names=['ISBN', 'Name', 'Authors', 'Description', 'Language...
DMadonko/ETL-Project
02-ETL_Scripts/transform_and_load.py
transform_and_load.py
py
11,212
python
en
code
0
github-code
18
[ { "api_name": "pandas.DataFrame", "line_number": 26, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 33, "usage_type": "call" }, { "api_name": "os.fsdecode", "line_number": 34, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_n...
22496268523
# -*- coding: utf-8 -*- """ Created on Fri Sep 07 17:48:41 2018 @author: ScanningLabAnalysis """ # -*- coding: utf-8 -*- """ Created on Thu Jun 07 15:46:51 2018 @author: rustyn """ import tifffile import os import numpy as np #import skimage.filters as filt def genBkgdImg(bkgdImage): with tifffile.TiffFile(b...
AllenInstitute/AIBSOPT
Software/DataProcessing/stackToPlanes.py
stackToPlanes.py
py
6,115
python
en
code
15
github-code
18
[ { "api_name": "tifffile.TiffFile", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.amin", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.amax", "line_number": 26, "usage_type": "call" }, { "api_name": "tifffile.TiffFile", "line...
37294389094
# Django Imports from django import template from django.utils.safestring import mark_safe # WaW Imports from wawmembers import utilities ''' Text manipulation for the military policies page. ''' register = template.Library() def combobasepower(homelist, staginglist, target): home = utilities.militarypower(ta...
heidi666/WorldsAtWar
wawmembers/templatetags/mildisplay.py
mildisplay.py
py
1,264
python
en
code
11
github-code
18
[ { "api_name": "django.template.Library", "line_number": 12, "usage_type": "call" }, { "api_name": "django.template", "line_number": 12, "usage_type": "name" }, { "api_name": "wawmembers.utilities.militarypower", "line_number": 17, "usage_type": "call" }, { "api_na...
4001620134
import collections import contextlib import os import re import threading import time import weakref from six.moves import queue from tensorflow.python.distribute.coordinator import coordinator_context from tensorflow.python.distribute.coordinator import metric_utils from tensorflow.python.distribute.coordinator impo...
tensorflow/tensorflow
tensorflow/python/distribute/coordinator/cluster_coordinator.py
cluster_coordinator.py
py
77,633
python
en
code
178,918
github-code
18
[ { "api_name": "tensorflow.python.distribute.coordinator.remote_value.RemoteValueStatus", "line_number": 53, "usage_type": "attribute" }, { "api_name": "tensorflow.python.distribute.coordinator.remote_value", "line_number": 53, "usage_type": "name" }, { "api_name": "tensorflow.pyt...
16950454230
import numpy as np from rtree import RTree from node import Node import time from bb_utils import dist, min_dist start_time = time.time() n = 50000 dim = 8 per_page = 8000//(dim*2*4 + 4) # per_page = 20 print(per_page, 'entries per page') tree = RTree(per_page,dim) for i in range(n): tree.ins...
HanwenX/A-Quantative-Analysis-for-VA-in-HD-Database
rtree/test.py
test.py
py
1,053
python
en
code
1
github-code
18
[ { "api_name": "time.time", "line_number": 8, "usage_type": "call" }, { "api_name": "rtree.RTree", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.random.rand", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.random", "line_numbe...
74637041320
#!/usr/bin/python # # Mountain ridge finder # Based on skeleton code by D. Crandall, Oct 2016 #1) Formulation and description: # a) The simple model does not account the previous or the subsequent states. Hence we maximise the edge strength on each column and paint the image. # # b) This method uses MCMC ...
bharadwajanup/AI_Probability
part2/mountain.py
mountain.py
py
7,397
python
en
code
0
github-code
18
[ { "api_name": "scipy.ndimage.filters.sobel", "line_number": 47, "usage_type": "call" }, { "api_name": "scipy.ndimage.filters", "line_number": 47, "usage_type": "name" }, { "api_name": "sys.argv", "line_number": 66, "usage_type": "attribute" }, { "api_name": "PIL.I...
34704058880
from nltk.classify import PositiveNaiveBayesClassifier import json import math import process.machinelearning.label_twitter_data as ltd def features(sentence): words = sentence.lower().split() return dict(('contains(%s)' % w, True) for w in words) def get_model(): new_list = [] with open('sandy.json'...
sardinachanx/S1REN
backend/process/process/machinelearning/build_model.py
build_model.py
py
2,435
python
en
code
1
github-code
18
[ { "api_name": "process.machinelearning.label_twitter_data.label_data", "line_number": 14, "usage_type": "call" }, { "api_name": "process.machinelearning.label_twitter_data", "line_number": 14, "usage_type": "name" }, { "api_name": "nltk.classify.PositiveNaiveBayesClassifier.train...
3680700545
from django.shortcuts import render from django.http import HttpResponse from privateApp import database_fetcher from .models import Match, Player import time # Create your views here. def home(request): matches = Match.objects.all() return render(request, "privateApp/home.html") def search(request...
shaurya-gupta24/Dota2PrivateSearcher
dota2Private/privateApp/views.py
views.py
py
733
python
en
code
0
github-code
18
[ { "api_name": "models.Match.objects.all", "line_number": 10, "usage_type": "call" }, { "api_name": "models.Match.objects", "line_number": 10, "usage_type": "attribute" }, { "api_name": "models.Match", "line_number": 10, "usage_type": "name" }, { "api_name": "djang...
26457498132
import logging import discord from discord.ext import commands from discord_bot.commands.volleyball_commands import * from discord_bot.exceptions.volleyball_exceptions import ImageNotFoundException, DateNotFoundException class volleyball(commands.Cog): def __init__(self, bot): self.bot = bot @commands...
Javier-Tan/discord_bot
discord_bot/cogs/volleyball_cog.py
volleyball_cog.py
py
1,203
python
en
code
0
github-code
18
[ { "api_name": "discord.ext.commands.Cog", "line_number": 7, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 7, "usage_type": "name" }, { "api_name": "logging.info", "line_number": 14, "usage_type": "call" }, { "api_name": "discord...
39249943598
import requests import sys __author__ = 'Andres Torti' if __name__ == '__main__': # Check if octoprint is available host = 'localhost' s = requests.Session() s.headers.update({'X-Api-Key': 'B0BE78429FCA477DA8399CE75928E093', 'Content-Type': 'application/json'}) try: data = s.get('http://'...
dragondgold/TmaxMicro
test_octo.py
test_octo.py
py
707
python
en
code
0
github-code
18
[ { "api_name": "requests.Session", "line_number": 9, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 17, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 19, "usage_type": "call" } ]
32156911420
import os from datetime import datetime from http.cookies import SimpleCookie from typing import AsyncGenerator, Optional, Iterator import pytest_asyncio from aiohttp import ClientSession from aioresponses import aioresponses from yarl import URL from pymultimatic.api import Connector, urls from pymultimatic.model im...
thomasgermain/pymultiMATIC
tests/conftest.py
conftest.py
py
8,166
python
en
code
53
github-code
18
[ { "api_name": "aiohttp.ClientSession", "line_number": 32, "usage_type": "call" }, { "api_name": "pytest_asyncio.fixture", "line_number": 30, "usage_type": "call" }, { "api_name": "typing.AsyncGenerator", "line_number": 31, "usage_type": "name" }, { "api_name": "ai...
13353203392
#!/usr/bin/env python # -*- coding: UTF-8 -*- import email import smtplib import logging import traceback from email import encoders from email.header import Header from email.mime.text import MIMEText from email.utils import parseaddr, formataddr from common.utils.config import SysConfig logger = logging.getLogger(...
yyukai/oneops
apps/common/utils/email_api.py
email_api.py
py
3,658
python
en
code
18
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "common.utils.config.SysConfig", "line_number": 21, "usage_type": "call" }, { "api_name": "email.utils.parseaddr", "line_number": 33, "usage_type": "call" }, { "api_name": ...
74497231080
# render_template:参照するテンプレートを指定 # jsonify:json出力 from random import * from flask_cors import CORS from flask import Flask, render_template, jsonify # CORS:Ajax通信するためのライブラリ # static_folder:vueでビルドした静的ファイルのパスを指定 # template_folder:vueでビルドしたindex.htmlのパスを指定 app = Flask(__name__, static_folder="../frontend/dist/...
YoshiYoshiPro/HACK_U_Meijo_2022
backend/app.py
app.py
py
1,422
python
ja
code
3
github-code
18
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 16, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 31, "usage_type": "call" }, { "api_name": "flask.jsonify", ...
73086578279
import streamlit as st import pandas as pd import plotly.graph_objects as go from PIL import Image st.set_page_config(layout="wide") from streamlit_autorefresh import st_autorefresh # update every 5 seconds limited to 100 refreshes. add (limit=100) if required, st_autorefresh(interval=15000, key="dataframerefr...
DashSaurav/Streamlit-IOT
app.py
app.py
py
10,562
python
en
code
1
github-code
18
[ { "api_name": "streamlit.set_page_config", "line_number": 5, "usage_type": "call" }, { "api_name": "streamlit_autorefresh.st_autorefresh", "line_number": 9, "usage_type": "call" }, { "api_name": "streamlit.sidebar.container", "line_number": 12, "usage_type": "call" }, ...
12019224410
from pathlib import Path from datetime import datetime import matplotlib.pyplot as plt import csv path = Path('chapter16\san_francisco (16.3)\san_francisco_weather_2021.csv') lines = path.read_text().splitlines() reader = csv.reader(lines) header_column = next(reader) for index, column in enumerate(header...
jteengfo/pythonCrashCourse3rdEd
PythonCrashCourse/chapter16/san_francisco (16.3)/san_fran_weather.py
san_fran_weather.py
py
1,210
python
en
code
0
github-code
18
[ { "api_name": "pathlib.Path", "line_number": 6, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.datetime", ...
19696643120
import pandas as pd import matplotlib.pyplot as plt import numpy as np data = pd.ExcelFile("obes-phys-acti-diet-eng-2017-tab.xlsx") data_age = data.parse('Table 6', skiprows=7, skipfooter=12) data_age.rename(columns={u'Year4': u'Year', u'All persons5': u'Total'}, inplace=True) data_age.drop(axis=1, columns={u'Unnamed...
Sk3ggox/obesity-in-england
obesity.py
obesity.py
py
1,271
python
en
code
0
github-code
18
[ { "api_name": "pandas.ExcelFile", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.polyfit", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.poly1d", "line_number": 21, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", ...
32520367986
# Importa as bibliotecas requests e json import requests import json # Inicia uma sessão com o servidor session = requests.session() # Cria um dicionário com a chave "palpite" inicializada com 0 dados = {"palpite": 0} # Define o cabeçalho da solicitação com "content-type" como "application/json" header = ...
Claudio-Prates/Exercicios---CySource
MeuAPI/cliente.py
cliente.py
py
1,638
python
pt
code
1
github-code
18
[ { "api_name": "requests.session", "line_number": 6, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 26, "usage_type": "call" } ]
11787911314
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import os import PIL from PIL import Image import scipy.io as sio from sklearn.utils import extmath import numpy.random as npr os.environ['DISENTANGLEMENT_LIB_DATA'] = '/proj/sml/usr/yixinwan...
yixinwang/representation-causal-public
disentanglement_expms/sec3-4-ioss_vae/src/load_data.py
load_data.py
py
21,166
python
en
code
37
github-code
18
[ { "api_name": "os.environ", "line_number": 12, "usage_type": "attribute" }, { "api_name": "numpy.random.RandomState", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 30, "usage_type": "name" }, { "api_name": "numpy.random.Ra...
28373563517
from nltk.tokenize import * import nltk.data from nltk.corpus import inaugural from nltk import FreqDist from nltk.corpus import swadesh class Preprocessor(object): def __init__(self, text, text_id): """reads the file text as a string""" self.text = text self.text_id = text_id @classm...
mzoesch/SymProg
20221115/hw05_preprocessing/preprocessorRecSol.py
preprocessorRecSol.py
py
4,808
python
en
code
0
github-code
18
[ { "api_name": "nltk.corpus.inaugural.raw", "line_number": 19, "usage_type": "call" }, { "api_name": "nltk.corpus.inaugural", "line_number": 19, "usage_type": "name" }, { "api_name": "nltk.tokenize.WordNetLemmatizer", "line_number": 44, "usage_type": "call" }, { "a...
41651855437
from os import getenv from dotenv import load_dotenv, find_dotenv if not find_dotenv(): exit('Переменные окружения не загружены т.к отсутствует файл .env') else: load_dotenv() API_HOST = "hotels4.p.rapidapi.com" BOT_TOKEN = getenv('BOT_TOKEN') RAPID_API_KEY = getenv('RAPID_API_KEY') DEFAULT_COMMANDS = ( (...
agurinv/travelic-bot
config_data/config.py
config.py
py
823
python
ru
code
0
github-code
18
[ { "api_name": "dotenv.find_dotenv", "line_number": 4, "usage_type": "call" }, { "api_name": "dotenv.load_dotenv", "line_number": 7, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 10, "usage_type": "call" }, { "api_name": "os.getenv", "line_n...
26290669622
import sys import websockets import asyncio import threading import json from Resources.ThreadedService import ThreadStatus from Resources.ServiceType import ServiceType import logging _log = logging.getLogger("PingRelay") class ControlServer(threading.Thread): def __init__(self, application, config): t...
FlyingKiwiBird/PingRelay
ControlServer.py
ControlServer.py
py
5,099
python
en
code
1
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 14, "usage_type": "attribute" }, { "api_name": "threading.Thread.__init__", "line_number": 16, "usage_type": "call" }, { "api_name": "thr...
19411591895
import math import os import re import docx from docxcompose.composer import Composer from src.logic.pathes import main_path, out_path from .paragraph_replace_text import paragraph_replace_text ALL_DOCUMENTS = { "BaseEquipment": os.path.join(main_path, "templates", "template_equipment.docx"), } def find_and_r...
lks-hrsch/ffwgeraetewart
src/template_processing/compose_equipment.py
compose_equipment.py
py
3,266
python
en
code
0
github-code
18
[ { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "src.logic.pathes.main_path", "line_number": 13, "usage_type": "argument" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "docx.Documen...
25947226480
from pathlib import Path import pandas as pd from prefect import flow, task from prefect_gcp.cloud_storage import GcsBucket from prefect_gcp import GcpCredentials @task(retries=3) def extract_from_gcs(color: str, year: int, month: int) -> Path: """Download trip data from GCS""" gcs_path = f"data/{color}/{color...
mojafa/data-engineering-zoomcamp
week_2_workflow_orchestration/homework/etl_gcs_to_bq.py
etl_gcs_to_bq.py
py
1,712
python
en
code
1
github-code
18
[ { "api_name": "prefect_gcp.cloud_storage.GcsBucket.load", "line_number": 11, "usage_type": "call" }, { "api_name": "prefect_gcp.cloud_storage.GcsBucket", "line_number": 11, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 13, "usage_type": "call" }, ...
41844201125
""" [ref]: https://github.com/dsgiitr/d2l-pytorch/blob/master/d2l/data/fashion_mnist.py * Download Fashion-MNIST dataset * Get labels * Show the dataset """ import sys sys.path.insert(0, '..') import os import os.path as osp import logging import coloredlogs import torchvision from torchvision import transforms...
DoranLyong/Awesome_PyTorch_Tutorial
libs/data/fashion_mnist.py
fashion_mnist.py
py
2,259
python
en
code
0
github-code
18
[ { "api_name": "sys.path.insert", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "coloredlogs.install", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.join", "l...
69963154599
from flask import Flask, request, redirect, url_for, render_template, flash, session from os import environ import requests from flask_sqlalchemy import SQLAlchemy from rq import Queue from rq.job import Job from worker import conn import json import hmac import hashlib import base64 app = Flask(__name__) app.config["...
YoungInHan/Shopify-slack-integration
hello.py
hello.py
py
7,961
python
en
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 13, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 17, "usage_type": "call" }, { "api_name": "rq.Queue", "line_number": 19, "usage_type": "call" }, { "api_name": "worker.conn", "l...
39719501934
import numpy as np from gym.envs.mujoco import mujoco_env from gym import utils DEFAULT_CAMERA_CONFIG = {} class SwimmerEnv(mujoco_env.MujocoEnv, utils.EzPickle): def __init__(self, xml_file='swimmer.xml', forward_reward_weight=1.0, ctrl_cost_weight=1e-4, ...
AI4Finance-Foundation/FinRL-Tutorials
DQN-DDPG_Stock_Trading/gym/envs/mujoco/swimmer_v3.py
swimmer_v3.py
py
2,975
python
en
code
599
github-code
18
[ { "api_name": "gym.envs.mujoco.mujoco_env.MujocoEnv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "gym.envs.mujoco.mujoco_env", "line_number": 9, "usage_type": "name" }, { "api_name": "gym.utils.EzPickle", "line_number": 9, "usage_type": "attribute" }, ...
41771939728
"""ajax_django URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') ...
shubhamjain31/demorepo
ajax_django/ajax_django/urls.py
urls.py
py
1,252
python
en
code
0
github-code
18
[ { "api_name": "django.urls.path", "line_number": 21, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 21, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 21, "usage_type": "name" }, { "api_name": "...
21100841954
import logging import math import os import statistics import timeit import numpy import torch from benchmark_helper import Precision from gpt2_helper import Gpt2Helper, Gpt2Inputs logger = logging.getLogger(__name__) class Gpt2Metric: def __init__(self, treatment_name, baseline_name="Torch", top_k=20): ...
microsoft/onnxruntime
onnxruntime/python/tools/transformers/models/gpt2/gpt2_tester.py
gpt2_tester.py
py
19,218
python
en
code
9,700
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.FloatTensor", "line_number": 27, "usage_type": "attribute" }, { "api_name": "torch.FloatTensor", "line_number": 28, "usage_type": "attribute" }, { "api_name": "stati...
12517845502
# -*- coding: UTF-8 -*- # Author: Perry # @Create Time: 2020/5/21 14:16 import os import abc import math import torch from .util import ContinualTrain from ..core import Runner class _CheckBase(metaclass=abc.ABCMeta): @abc.abstractmethod def check2save(self, cls:Runner, epoch: int): pass clas...
iyupan/torcherry
torcherry/utils/checkpoint.py
checkpoint.py
py
1,937
python
en
code
3
github-code
18
[ { "api_name": "abc.ABCMeta", "line_number": 19, "usage_type": "attribute" }, { "api_name": "core.Runner", "line_number": 21, "usage_type": "name" }, { "api_name": "abc.abstractmethod", "line_number": 20, "usage_type": "attribute" }, { "api_name": "math.inf", "...
23598173296
import os import glob from my_project import app, db from flask import render_template, redirect, request, url_for, flash, abort from flask_login import login_user, login_required, logout_user from my_project.models import User from my_project.forms import LoginForm, RegistrationForm ALLOWED_EXTENSIONS = set(['txt', ...
sourcecode369/login-registration-flask
app.py
app.py
py
2,925
python
en
code
0
github-code
18
[ { "api_name": "flask.render_template", "line_number": 15, "usage_type": "call" }, { "api_name": "my_project.app.route", "line_number": 13, "usage_type": "call" }, { "api_name": "my_project.app", "line_number": 13, "usage_type": "name" }, { "api_name": "flask.rende...
42621853224
from platformio.managers.platform import PlatformBase class Picorv32Platform(PlatformBase): def get_boards(self, id_=None): result = PlatformBase.get_boards(self, id_) if not result: return result if id_: return self._add_dynamic_options(result) else: ...
nekomona/platform-picorv32
platform.py
platform.py
py
1,663
python
en
code
0
github-code
18
[ { "api_name": "platformio.managers.platform.PlatformBase", "line_number": 3, "usage_type": "name" }, { "api_name": "platformio.managers.platform.PlatformBase.get_boards", "line_number": 6, "usage_type": "call" }, { "api_name": "platformio.managers.platform.PlatformBase", "lin...
43027507988
import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F from random import sample, randrange from collections import deque from numpy.random import default_rng, randint from numpy import expand_dims, ndarray, stack, arange, argmax, array, repeat, tile from models.legacy.network im...
Trenza1ore/doombot
models/legacy/dqn_agent.py
dqn_agent.py
py
5,332
python
en
code
1
github-code
18
[ { "api_name": "torch.device", "line_number": 12, "usage_type": "attribute" }, { "api_name": "models.legacy.network.DQNv2", "line_number": 14, "usage_type": "name" }, { "api_name": "torch.nn.MSELoss", "line_number": 35, "usage_type": "call" }, { "api_name": "torch....
294114113
from typing import Callable, Optional, List, Dict, Iterable, Tuple from agglomerate.agglomerate_3d import Agglomerate3D, TREE_SCORE_OPTIONS from itertools import product from data.data_loader import DataLoader import multiprocessing as mp import pandas as pd import numpy as np from tqdm import tqdm class BatchAgglome...
nbingo/3dtrees
agglomerate/batch_agglomerate_3d.py
batch_agglomerate_3d.py
py
6,127
python
en
code
2
github-code
18
[ { "api_name": "typing.List", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.Callable", "line_numbe...
28458621243
from flask import Flask, request, jsonify, Response app = Flask(__name__) app.config['PRESERVE_CONTEXT_ON_EXCEPTION'] = False app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False app.config['PRESERVE_CONTEXT_ON_EXCEPTION'] = False class HTTPError(Exception): def __init__(self, status_code, message): Exc...
HEPData/hepdata-explore
kv-server/kv_server/app.py
app.py
py
1,086
python
en
code
3
github-code
18
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask.request.remote_addr", "line_number": 18, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 18, "usage_type": "name" }, { "api_name": "flask.request...
73516815399
import timm import torch.nn as nn from torchinfo import summary import config class SETIModel(nn.Module): def __init__(self, model_name: str, pretrained: bool = True) -> None: super(SETIModel, self).__init__() self.model_name = model_name self.model = timm.create_model( model_...
LakshyaMalhotra/seti-breakthrough-listen
src/seti_model.py
seti_model.py
py
1,776
python
en
code
0
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 8, "usage_type": "name" }, { "api_name": "timm.create_model", "line_number": 12, "usage_type": "call" }, { "api_name": "config.MODEL_NAME.start...
15329707792
import logging logging.basicConfig(filename="constructor.log", level=logging.INFO, format='%(levelname)s %(asctime)s %(name)s %(message)s') class ineuron: logging.info("ineuron class conrtructor") try: def __int__(self,sunny,sudhanshu): self.sunny=sunny self.sudhanshu=sudhanshu ...
vipinjanghu/Ineuron_tasks
oops2/constructor_oops/constructor1.py
constructor1.py
py
1,445
python
en
code
0
github-code
18
[ { "api_name": "logging.basicConfig", "line_number": 3, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 3, "usage_type": "attribute" }, { "api_name": "logging.info", "line_number": 5, "usage_type": "call" }, { "api_name": "logging.info", "l...
16045500646
# ----------------------------------------------------------------------------- # xml.py # # Author: Francesco Racciatti (racciatti.francesco@gmail.com) # # This module contains the interpreting services for AML. # ----------------------------------------------------------------------------- import abc import enum im...
francescoracciatti/aml
aml/interpreter/interpreter.py
interpreter.py
py
5,183
python
en
code
0
github-code
18
[ { "api_name": "abc.ABCMeta", "line_number": 16, "usage_type": "attribute" }, { "api_name": "abc.abstractclassmethod", "line_number": 21, "usage_type": "attribute" }, { "api_name": "model.types.SymbolTable", "line_number": 57, "usage_type": "attribute" }, { "api_na...
71427115240
# This Python 3 environment comes with many helpful analytics libraries installed # It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python # For example, here's several helpful packages to load in import numpy as np # linear algebra import pandas as pd # data processing, CSV fil...
aorursy/new-nb-3
hemilshah_xgboost.py
hemilshah_xgboost.py
py
4,568
python
en
code
0
github-code
18
[ { "api_name": "os.walk", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_number": 27, "usage_type": "attribute" }, { "api_name": "warnings.filterwarnings", "line...
9061528966
import fintech.accounts as accounts import pymysql def write_account_transaction_to_db(filename, account): print('Starting write of DB example') # Open database connection connection = pymysql.connect('localhost', 'user', 'password', 'accounts') # prepare a cursor object using cursor() method cur...
johnehunt/advancedpython3
chapter24/exercise/write_account_info.py
write_account_info.py
py
1,602
python
en
code
47
github-code
18
[ { "api_name": "pymysql.connect", "line_number": 8, "usage_type": "call" }, { "api_name": "fintech.accounts.CurrentAccount", "line_number": 45, "usage_type": "call" }, { "api_name": "fintech.accounts", "line_number": 45, "usage_type": "name" } ]
14353038825
import pandas as pd import wget import multiprocessing def run_process(url, output_path): wget.download(url, out=output_path) if __name__ == '__main__': cpus = multiprocessing.cpu_count() max_pool_size = 4 pool = multiprocessing.Pool(cpus if cpus < max_pool_size else max_pool_size) df = pd.read_j...
lazarus/nft
get_images.py
get_images.py
py
734
python
en
code
0
github-code
18
[ { "api_name": "wget.download", "line_number": 6, "usage_type": "call" }, { "api_name": "multiprocessing.cpu_count", "line_number": 9, "usage_type": "call" }, { "api_name": "multiprocessing.Pool", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.rea...
40864473606
import datetime from yahooquery import Ticker import matplotlib.pyplot as plt import pandas as pd today = datetime.datetime.strptime(str(datetime.date.today()),'%Y-%m-%d').date() from_date = datetime.datetime.strptime("2021-01-06", "%Y-%m-%d").date() print(f'Collecting data from {from_date} - {today}') #end_date = d...
gmihalik/bollinger_strategy
yahoo.py
yahoo.py
py
769
python
en
code
0
github-code
18
[ { "api_name": "datetime.datetime.strptime", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 6, "usage_type": "attribute" }, { "api_name": "datetime.date.today", "line_number": 6, "usage_type": "call" }, { "api_name": "da...
73024051879
# !/usr/bin/python # -*- coding: utf-8 -*- """Run the main body of this code to execute experiments.""" from __future__ import absolute_import from __future__ import print_function import os import os.path import autograd.numpy as np import autograd.numpy.random as npr import pickle from autograd import grad from autog...
lorraine2/hypernet-hypertraining
code/learn_vs_true_loss_scatter.py
learn_vs_true_loss_scatter.py
py
17,728
python
en
code
23
github-code
18
[ { "api_name": "autograd.numpy.linalg.norm", "line_number": 30, "usage_type": "call" }, { "api_name": "autograd.numpy.linalg", "line_number": 30, "usage_type": "attribute" }, { "api_name": "autograd.numpy", "line_number": 30, "usage_type": "name" }, { "api_name": "...
19157698758
from flask import Flask, jsonify, render_template import pandas as pd belly_data = pd.read_excel("belly_data.xlsx", index=None) samples = pd.read_csv("belly_button_biodiversity_samples.csv") meta = pd.read_csv("Belly_Button_Biodiversity_Metadata.csv") app = Flask(__name__) @app.route("/") def home(): return rend...
michaeljdurst12/bio_diversity
app.py
app.py
py
1,246
python
en
code
0
github-code
18
[ { "api_name": "pandas.read_excel", "line_number": 4, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 5, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.Flask", "lin...
71803298280
# File: test_cc.py # Purpose: test the central controller backend # Based on: ../test_hybrid.py, ../test_uniform_sched.py import openql as ql import os import unittest from config import json_dir, output_dir from typing import List, Tuple config_fn = os.path.join(json_dir, 'test_cfg_cc.json') platf...
QuTech-Delft/OpenQL
test/v1x/python/test_cc.py
test_cc.py
py
25,416
python
en
code
91
github-code
18
[ { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "config.json_dir", "line_number": 13, "usage_type": "argument" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "unittest.TestCase", ...
6007926971
from datetime import datetime from django.contrib.auth.decorators import login_required from django.shortcuts import render, redirect from virtualbarcamp.accounts.forms import AcceptCodeOfConductForm from virtualbarcamp.accounts.models import Account def login(request): return render(request, "registration/logi...
cnorthwood/virtualbarcamp
virtualbarcamp/accounts/views.py
views.py
py
1,066
python
en
code
8
github-code
18
[ { "api_name": "django.shortcuts.render", "line_number": 11, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "line_number": 20, "usage_type": "call" }, { "api_name": "virtualbarcamp.accounts.forms.AcceptCodeOfConductForm", "line_number": 23, "usage_type"...
34790886794
from datetime import datetime as dt from threading import Lock, Thread from ..customtypes import PowermeterMonitorDict from ..hardware import S0interface, ZeroW def _calcPower(_time: dt) -> float: global currentTime delta_t_sec: float = (_time - currentTime).total_seconds() currentTime = _time return...
ccrissccross/stromzaehler
monitoring/src/main/threads/powermeter.py
powermeter.py
py
1,788
python
en
code
0
github-code
18
[ { "api_name": "datetime.datetime", "line_number": 8, "usage_type": "name" }, { "api_name": "datetime.datetime", "line_number": 15, "usage_type": "name" }, { "api_name": "customtypes.PowermeterMonitorDict", "line_number": 15, "usage_type": "name" }, { "api_name": "...
14849575072
from PyQt5.QtWidgets import ( QPushButton, QDialog, QLabel, QFileDialog, QLineEdit, QDialogButtonBox, QFormLayout, QVBoxLayout, QWidget, QSpinBox ) from .common_gui import accept_and_finish from logic.train_network import train class TrainWindow(QDialog): def __init__(self, parent): super().__init__(parent...
nerearoher/Phrygian
src/gui/train_gui.py
train_gui.py
py
2,642
python
en
code
6
github-code
18
[ { "api_name": "PyQt5.QtWidgets.QDialog", "line_number": 9, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QFormLayout", "line_number": 13, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 20, "usage_type": "call" }, { "api_na...
595127804
import os import json import sys import findspark from IPython.core.display import display import pyspark.sql.functions as psf from pyspark.sql.functions import get_json_object from pyspark.sql.types import ArrayType, StructType, StructField, StringType, IntegerType, DecimalType, DateType, \ DoubleType, LongType ...
pradeepsalunke/Kafka-Spark-Streaming-Django-Cassandra
MeetUp/Spark_Stream.py
Spark_Stream.py
py
5,657
python
en
code
0
github-code
18
[ { "api_name": "findspark.init", "line_number": 12, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 30, "usage_type": "attribute" }, { "api_name": "pyspark.sql.types.StructType", "line_number": 33, "usage_type": "call" }, { "api_name": "pyspark.s...
42489405763
from datetime import datetime end_time = datetime(2021, 2, 12, 20) sites_to_block = ['www.facebook.com', 'facebook.com'] hosts_path = "/etc/hosts" redirect = "127.0.0.1" def block_sites(): if datetime.now() < end_time: print("block sites") # write all web-sites from our list to hostsfile ...
Niksscoder/Block-Websites-with-python
main.py
main.py
py
973
python
en
code
0
github-code
18
[ { "api_name": "datetime.datetime", "line_number": 3, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 12, "usage_type": "name" } ]
42025948282
from types import SimpleNamespace import torch from torch import nn from datasets import SentenceClassificationDataset from multitask_classifier import MultitaskBERT, process_batch from optimizer import AdamW from tokenizer import BertTokenizer from torch.utils.data import DataLoader from tqdm import tqdm import torch...
yaskh/dl-nlp
project/CrossEncoder.py
CrossEncoder.py
py
2,746
python
en
code
0
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 13, "usage_type": "name" }, { "api_name": "torch.optim", "line_number": 20, "usage_type": "attribute" }, { "api_name": "types.SimpleNamespace"...
2566002204
import cx_Freeze executables = [cx_Freeze.Executable("main.py", targetName="Floppy.exe", icon="icon.ico")] #base = "Win32GUI", #icon = "assets/bobi_icon.png")] build_exe_option...
CimaDeLosVientos/covid_game_jam
setup.py
setup.py
py
608
python
en
code
0
github-code
18
[ { "api_name": "cx_Freeze.Executable", "line_number": 3, "usage_type": "call" }, { "api_name": "cx_Freeze.setup", "line_number": 12, "usage_type": "call" } ]
27589592604
import pickle from hyperopt import fmin, tpe, hp, STATUS_OK, Trials import matplotlib.pyplot as plt import numpy as np import pandas as pd from fastsklearnfeature.candidates.CandidateFeature import CandidateFeature from fastsklearnfeature.candidates.RawFeature import RawFeature from fastsklearnfeature.transformations.O...
BigDaMa/DFS
new_project/fastsklearnfeature/interactiveAutoML/complexity_vs_accuracy.py
complexity_vs_accuracy.py
py
4,481
python
en
code
12
github-code
18
[ { "api_name": "numpy.arange", "line_number": 15, "usage_type": "call" }, { "api_name": "hyperopt.Trials", "line_number": 28, "usage_type": "name" }, { "api_name": "pickle.load", "line_number": 28, "usage_type": "call" }, { "api_name": "typing.List", "line_numb...
11354853498
import logging import sqlalchemy as sa from datetime import datetime, timedelta from pyramid.threadlocal import get_current_request from sqlalchemy.dialects.postgresql import JSON from ziggurat_foundations.models.base import BaseModel from appenlight.models import Base, get_db_session, Datastores from appenlight.lib...
AppEnlight/appenlight
backend/src/appenlight/models/report_group.py
report_group.py
py
9,758
python
en
code
35
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "appenlight.models.Base", "line_number": 19, "usage_type": "name" }, { "api_name": "ziggurat_foundations.models.base.BaseModel", "line_number": 19, "usage_type": "name" }, { ...
36656380103
from web3 import Web3 import time # enter your private key. Be careful with your private key private_key = "YOURPRIVATEKEY" # add your blockchain connection information infura_url = 'ADDYOURINFURAKEY' web3 = Web3(Web3.HTTPProvider(infura_url)) print(web3.isConnected()) # enter the account that the crypto is being s...
Tinycl/web3_tool
airdrop.py
airdrop.py
py
1,345
python
en
code
0
github-code
18
[ { "api_name": "web3.Web3", "line_number": 9, "usage_type": "call" }, { "api_name": "web3.Web3.HTTPProvider", "line_number": 9, "usage_type": "call" }, { "api_name": "web3.isConnected", "line_number": 10, "usage_type": "call" }, { "api_name": "web3.eth.get_balance"...
31917108584
# Random Forest Module # -------------------- from sklearn.ensemble import RandomForestClassifier # -------------------- def model_select(model_selector): model = None if model_selector == 'Random_Forest': model = RandomForestClassifier(min_samples_leaf=2, n_estimators=1000, random_state=0, verbose=1...
Cing-Chen/Introduction-to-Data-Science-Course
Final_Project/model.py
model.py
py
575
python
en
code
0
github-code
18
[ { "api_name": "sklearn.ensemble.RandomForestClassifier", "line_number": 11, "usage_type": "call" } ]
2972582157
from django.urls import path from store import views app_name = 'store' urlpatterns = [ path('', views.store_view, name='store-view'), path('product/<int:pk>/', views.product_detail_view, name='product-detail-view'), path('cart/', views.cart_view, name='cart-view'), path('checkout/', views.checkout_v...
durvalcarvalho/django-projects
ecommerce-website/store/urls.py
urls.py
py
507
python
en
code
1
github-code
18
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "store.views.store_view", "line_number": 8, "usage_type": "attribute" }, { "api_name": "store.views", "line_number": 8, "usage_type": "name" }, { "api_name": "django.urls.pat...
35252025248
import netCDF4 as nc import numpy as np import matplotlib.pyplot as plt import cartopy.crs as ccrs import cartopy.mpl.ticker as mticker import cartopy.feature from cartopy.util import add_cyclic_point from matplotlib import colors emiss1 = np.zeros([12,192,288]) nc1 = nc.Dataset('F:/SOAGx1.5_anthro_surface...
ChanJeunlam/geoscience-code
2pic_1colorbar.py
2pic_1colorbar.py
py
4,038
python
en
code
0
github-code
18
[ { "api_name": "numpy.zeros", "line_number": 11, "usage_type": "call" }, { "api_name": "netCDF4.Dataset", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 18, "usage_type": "call" }, { "api_name": "cartopy.util.add_cyclic_point"...
24281037866
from fastapi import status, HTTPException, Depends, APIRouter, Response from sqlalchemy.orm import Session from .. import schemas, database, models, oauth2 router = APIRouter(prefix='/likes', tags=['Likes']) @router.post('/', status_code=status.HTTP_201_CREATED) def like(like: schemas.Like, db: Ses...
jpdotdev/adventshare-backend
app/routers/likes.py
likes.py
py
1,565
python
en
code
0
github-code
18
[ { "api_name": "fastapi.APIRouter", "line_number": 5, "usage_type": "call" }, { "api_name": "sqlalchemy.orm.Session", "line_number": 9, "usage_type": "name" }, { "api_name": "fastapi.Depends", "line_number": 9, "usage_type": "call" }, { "api_name": "fastapi.Depends...
2120026934
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import spotipy import os #D:\PythonProjects\SpotifyRecommendationSystem spotify_data = pd.read_csv("D:\PythonProjects\SpotifyRecommendationSystem\\data.csv") genre_data = pd.read_csv("D:\PythonProjects\SpotifyRecommendationSy...
Shreyashpatel2701/SpotifyRecommendationSystem
main.py
main.py
py
2,504
python
en
code
1
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "plotly.express.line",...
4819872332
""" 682. Baseball Game You are keeping the scores for a baseball game with strange rules. At the beginning of the game, you start with an empty record. You are given a list of strings operations, where operations[i] is the i-th operation you must apply to the record and is one of the following: - An integer x => Recor...
tkwang0530/LeetCode
0682.py
0682.py
py
3,426
python
en
code
4
github-code
18
[ { "api_name": "typing.List", "line_number": 62, "usage_type": "name" }, { "api_name": "unittest.TestCase", "line_number": 83, "usage_type": "attribute" }, { "api_name": "unittest.main", "line_number": 101, "usage_type": "call" } ]
22078834397
import argparse import os import setproctitle import numpy as np import torch import torch.nn as nn import torch.optim as optim from segmentron.data import DATASETS, PREPROCS, prepare_data, prepare_loader from segmentron.model import ARCHS, BACKBONES, HEADS, prepare_model from segmentron.metrics import LossMeter from...
rsl18/294-82
segmentron-master/train.py
train.py
py
3,841
python
en
code
1
github-code
18
[ { "api_name": "setproctitle.setproctitle", "line_number": 20, "usage_type": "call" }, { "api_name": "segmentron.util.setup_output", "line_number": 22, "usage_type": "call" }, { "api_name": "segmentron.util.setup_logging", "line_number": 23, "usage_type": "call" }, { ...
2976396674
from django.shortcuts import render, redirect from .models import Fstock from .forms import FstockForm # Create your views here. def products(request): products = Fstock.objects.all() context = { 'products' : products } return render(request, template_name='fstock.html', context= context) d...
joseff-regmi/office
fstock/views.py
views.py
py
637
python
en
code
0
github-code
18
[ { "api_name": "models.Fstock.objects.all", "line_number": 8, "usage_type": "call" }, { "api_name": "models.Fstock.objects", "line_number": 8, "usage_type": "attribute" }, { "api_name": "models.Fstock", "line_number": 8, "usage_type": "name" }, { "api_name": "djang...
34302990729
from django.forms.widgets import ChoiceWidget from django.shortcuts import render,redirect from django.views.generic import TemplateView,ListView from random import choice from django.db.models import F from RockPaperScissor.forms import NameForm,MoveForm from core.models import Player,Rounds from django.urls import r...
neelarya19/Rock-Paper-Scissor
core/views.py
views.py
py
7,331
python
en
code
0
github-code
18
[ { "api_name": "django.views.generic.TemplateView", "line_number": 15, "usage_type": "name" }, { "api_name": "django.shortcuts.render", "line_number": 18, "usage_type": "call" }, { "api_name": "core.models.Player.objects.get", "line_number": 21, "usage_type": "call" }, ...
21061193947
# Third-party modules import PyQt5.QtWidgets as QtWid import PyQt5.QtCore as QtCore import numpy as np # filters-tool project modules from app.designer.aux_widgets.cells_settings import Ui_CellsSettings from app.designer.aux_widgets.comp_par_block_imp import CompParBlock from app.cells.sallen_key import SallenKey, Ce...
grupo-tc-volcan/filters-tool
app/designer/aux_widgets/cells_settings_imp.py
cells_settings_imp.py
py
8,902
python
en
code
0
github-code
18
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 14, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidgets", "line_number": 14, "usage_type": "name" }, { "api_name": "app.designer.aux_widgets.cells_settings.Ui_CellsSettings", "line_number": 14, "usage_type": ...
1595667997
from __future__ import print_function import requests import pandas as pd import matplotlib as plt from StringIO import StringIO from ipywidgets import interact, interactive, fixed, interact_manual from ipykernel.pylab.backend_inline import flush_figures from resultWidget import ResultWidget class ComparisonEngine:...
jvsoest/PBDW2018_hackathon
notebooks/comparisonEngine.py
comparisonEngine.py
py
3,225
python
en
code
7
github-code
18
[ { "api_name": "requests.get", "line_number": 25, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 27, "usage_type": "call" }, { "api_name": "StringIO.StringIO", "line_number": 27, "usage_type": "call" }, { "api_name": "pandas.read_sql_query"...
8881070411
import tableauserverclient as TSC import os import json import shutil from google.cloud import storage from pathlib import Path from os.path import exists tableau_server_url = "https://tableau....net" tableau_user = "...Tableau" tableau_password = "6..." tableau_site_id = "P..." base_path = Path(__file__).resolve()....
rrpizzano/business_intelligence
general_code/tableau/Tableau to PDF to GCP bucket/tableau_to_pdf_to_GCP_bucket.py
tableau_to_pdf_to_GCP_bucket.py
py
3,261
python
en
code
1
github-code
18
[ { "api_name": "pathlib.Path", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "json.load", "line_number":...
28075438813
import json from django.http import JsonResponse from django.shortcuts import render from django.views.decorators.csrf import csrf_exempt from rouge import Rouge from datasets import load_metric # Create your views here. def index(request): return render(request, 'main/index.html') i = 2 def demo(request):...
Jhj9/HLILab_Evaluation_Demo
main/views.py
views.py
py
1,669
python
en
code
2
github-code
18
[ { "api_name": "django.shortcuts.render", "line_number": 14, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 23, "usage_type": "call" }, { "api_name": "rouge.Rouge", "line_number": 26, "usage_type": "call" }, { "api_name": "datasets....
28584758032
from bs4 import BeautifulSoup import requests import pandas as pd import numpy as np from collections import Counter import matplotlib.pyplot as plt pd.set_option('display.max_rows', 100000) from termcolor import colored from docx import Document import re def import_and_clean_data(file_name): file = open(file_...
berrythought/latvian_vocab_tool
vocab_tool_functions.py
vocab_tool_functions.py
py
9,757
python
en
code
0
github-code
18
[ { "api_name": "pandas.set_option", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 18, "usage_type": "call" }, { "api_name": "docx.Document", "line_number": 73, "usage_type": "call" }, { "api_name": "re.sub", "line_nu...
22940546304
# This is a sample commands.py. You can add your own commands here. # # Please refer to commands_full.py for all the default commands and a complete # documentation. Do NOT add them all here, or you may end up with defunct # commands when upgrading ranger. # A simple command for demonstration purposes follows. # ---...
magnacore/Productivity-Tools
Linux/config/ranger/commands.py
commands.py
py
34,337
python
en
code
3
github-code
18
[ { "api_name": "ranger.api.commands.Command", "line_number": 68, "usage_type": "name" }, { "api_name": "ranger.ext.get_executables.get_executables", "line_number": 82, "usage_type": "call" }, { "api_name": "ranger.ext.get_executables.get_executables", "line_number": 87, "u...
2835967822
import warnings from collections import Iterable, OrderedDict from functools import partial import torch import torchvision from torch import nn from neuralpredictors import regularizers from neuralpredictors.layers.activations import AdaptiveELU from neuralpredictors.layers.affine import Bias2DLayer, Scale2DLayer f...
GuanLab/Sensorium2022_Challenge
sensorium/cores/conv2d.py
conv2d.py
py
13,024
python
en
code
0
github-code
18
[ { "api_name": "base.Core", "line_number": 21, "usage_type": "name" }, { "api_name": "torch.nn.Module", "line_number": 21, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 21, "usage_type": "name" }, { "api_name": "neuralpredictors.regularizers...
37712549497
from __future__ import print_function from __future__ import print_function from __future__ import print_function from __future__ import print_function from __future__ import print_function from __future__ import print_function from __future__ import print_function from __future__ import print_function import os import...
juanfonsecasolis/ARAPSUAA
src/alertSignalAndScenarios/alertSignal.py
alertSignal.py
py
10,369
python
en
code
0
github-code
18
[ { "api_name": "scenarios.lengthContour", "line_number": 23, "usage_type": "name" }, { "api_name": "scenarios.lengthContour", "line_number": 31, "usage_type": "name" }, { "api_name": "numpy.linspace", "line_number": 33, "usage_type": "call" }, { "api_name": "scenar...
24413983145
from tkinter import * from tkinter import ttk, messagebox, filedialog as fd from tkinter.ttk import Combobox import requests window = Tk() window.title("Шишкин Кирилл Сергеевич") window.geometry('700x700') tab_control = ttk.Notebook(window) # Калькулятор tab_calc = ttk.Frame(tab_control) tab_control.add(tab_calc, ...
kirillwiwkin/sovremennye-tehnologyy-razrabotky
10-11/10(11).py
10(11).py
py
3,655
python
en
code
0
github-code
18
[ { "api_name": "tkinter.ttk.Notebook", "line_number": 11, "usage_type": "call" }, { "api_name": "tkinter.ttk", "line_number": 11, "usage_type": "name" }, { "api_name": "tkinter.ttk.Frame", "line_number": 15, "usage_type": "call" }, { "api_name": "tkinter.ttk", ...
16922935605
#import libraries import os import zipfile import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.preprocessing import StandardScaler from sklearn.model_selection import train_test_split from sklearn.linear_model import LogisticRegression from sklearn.metrics import classification_report, c...
CodeDroid999/eyetrackerpy
eyetracker.py
eyetracker.py
py
3,740
python
en
code
5
github-code
18
[ { "api_name": "os.path.join", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 20, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_numb...
29122669333
from collections import defaultdict #inp = [l.strip() for l in open('dec22ex.txt')] inp = [l.strip() for l in open('22.txt')] #print(inp) m = defaultdict(int) def coord(x, y): return "{};{}".format(x, y) CLEAN = 0 WEAKENED = 1 INFECTED = 2 FLAGGED = 3 for y in range(len(inp)): for x in range(len(inp[y])): ...
jhogstrom/adventofcode
2017/dec22.py
dec22.py
py
952
python
en
code
0
github-code
18
[ { "api_name": "collections.defaultdict", "line_number": 7, "usage_type": "call" } ]
26377349409
from lxml import etree FILE_NAME = 'besiktas-speed-40/osm.net.xml' SPEED_SCALE = 2 root = etree.parse(FILE_NAME) for elt in root.iter(): if "speed" in elt.attrib: current_speed = float(elt.attrib["speed"]) elt.attrib["speed"] = str(current_speed * SPEED_SCALE) if "limitTurnSpeed" in elt.attrib...
onurklngc/drone-network-onos-and-mininet
configs/change_speed.py
change_speed.py
py
617
python
en
code
1
github-code
18
[ { "api_name": "lxml.etree.parse", "line_number": 6, "usage_type": "call" }, { "api_name": "lxml.etree", "line_number": 6, "usage_type": "name" }, { "api_name": "lxml.etree.tostring", "line_number": 17, "usage_type": "call" }, { "api_name": "lxml.etree", "line_...
21504968554
import tensorflow as tf import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import csv from sklearn.preprocessing import MinMaxScaler from sklearn import metrics NUM_MODEL_RUNS = 1 #abs(int(input("Enter the number of times to train model and store metrics: "))) NUM_EP...
jarod-acanfrio/RecessionNET
RecessionNET_v3.py
RecessionNET_v3.py
py
11,699
python
en
code
0
github-code
18
[ { "api_name": "sklearn.preprocessing.MinMaxScaler", "line_number": 29, "usage_type": "call" }, { "api_name": "tensorflow.keras.optimizers.Adam", "line_number": 31, "usage_type": "call" }, { "api_name": "tensorflow.keras", "line_number": 31, "usage_type": "attribute" }, ...
72552844519
from setuptools import setup, Extension from setuptools.command.install import install from codecs import open import os, os.path, struct, re, platform import numpy try: from setuptools._distutils import _msvccompiler _msvccompiler.PLAT_TO_VCVARS['win-amd64'] = 'amd64' except: pass if os.environ.get('TOM...
bab2min/tomotopy
setup.py
setup.py
py
5,801
python
en
code
515
github-code
18
[ { "api_name": "setuptools._distutils._msvccompiler.PLAT_TO_VCVARS", "line_number": 10, "usage_type": "attribute" }, { "api_name": "setuptools._distutils._msvccompiler", "line_number": 10, "usage_type": "name" }, { "api_name": "os.environ.get", "line_number": 14, "usage_ty...
18126632522
#! /usr/bin/python import pandas as pd import numpy as np from itertools import repeat import matplotlib.pyplot as plt import seaborn as sns import itertools # load guppy data df = {} barcode_list = ['01','02','03','04','05','06','08','09','10','11'] for barcode_number in barcode_list: df[barcode_number] = pd.Dat...
hanzhang2000/Plasmodium_falciparum_ONT_5mC_calling
guppy_scatter_plot.py
guppy_scatter_plot.py
py
4,130
python
en
code
1
github-code
18
[ { "api_name": "pandas.DataFrame", "line_number": 14, "usage_type": "call" }, { "api_name": "seaborn.set_style", "line_number": 66, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rc", "line_number": 67, "usage_type": "call" }, { "api_name": "matplotlib.py...
71439807400
''' utils.py Utility functions used by multiple scripts. ''' import os import gzip import json import logging import csv import itertools import numpy as np import string from operator import itemgetter def gen_shares(filepath): with open(filepath, 'r') as f: shares = json.loads(f.read()) for ui...
osome-iu/misinfo-partisanship-hksmisinforeview-2021
scripts/utils.py
utils.py
py
2,907
python
en
code
3
github-code
18
[ { "api_name": "json.loads", "line_number": 20, "usage_type": "call" }, { "api_name": "string.printable", "line_number": 41, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 75, "usage_type": "call" }, { "api_name": "os.path", "line_n...
34537542425
import sys from collections import Counter # +++your code here+++ # Define print_words(filename) and print_top(filename) functions. # You could write a helper utility function that reads a file # and builds and returns a word/count dict for it. # Then print_words() and print_top() can just call the utility function. d...
mukeshkhattar/python-basics
utilities/word-frequency.py
word-frequency.py
py
776
python
en
code
0
github-code
18
[ { "api_name": "collections.Counter", "line_number": 16, "usage_type": "call" } ]
33507910123
from scrapy.crawler import CrawlerProcess from scrapy.utils.project import get_project_settings from .spiders import DocScraperSpider def crawl(domains, start_urls=[], directory='./output', extensions=['.pdf', '.docx', '.doc', '.txt'], robotstxt_obey=True, download_d...
pjryan126/docscraper
docscraper/api.py
api.py
py
1,936
python
en
code
0
github-code
18
[ { "api_name": "scrapy.utils.project.get_project_settings", "line_number": 28, "usage_type": "call" }, { "api_name": "scrapy.crawler.CrawlerProcess", "line_number": 49, "usage_type": "call" }, { "api_name": "spiders.DocScraperSpider", "line_number": 50, "usage_type": "argu...
18862748403
#!/usr/bin/env python # coding: utf-8 # In[168]: import matplotlib.pyplot as plt import numpy as np import random from cat import Cat # In[169]: MAXROW = 20 MAXCOL = 30 # In[170]: def processline(linelist): newlist = [(int(l.split(",")[0]),int(l.split(",")[1])) for l in linelist[1:]] return newlist ...
UmeendraFranciscus/Game_Simulation
Game_03/main.py
main.py
py
7,541
python
en
code
0
github-code
18
[ { "api_name": "numpy.zeros", "line_number": 41, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 46, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 47, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.scatter", ...
73652739880
from typing import List def minimumOperations(nums: List[int]) -> int: cont = 0 while sum(nums) != 0: print(nums) min_number = min(elem for elem in nums if elem != 0) nums = list(map(lambda x: x - min_number if x != 0 else 0, nums)) cont += 1 return cont if...
fdzr/DSA
array/67.py
67.py
py
379
python
en
code
0
github-code
18
[ { "api_name": "typing.List", "line_number": 4, "usage_type": "name" } ]
25793552335
# %% from typing import Optional, Union import pandas as pd import numpy as np import requests, re, os from concurrent.futures import ProcessPoolExecutor class Decrypter: """Simple MCMC decryption algorithm using random walk""" def __init__(self, text_url: str, allowable_chars: str = r...
cesaregarza/Python-Playground
practice/mcmc/mcmc_decoder.py
mcmc_decoder.py
py
13,472
python
en
code
1
github-code
18
[ { "api_name": "typing.Optional", "line_number": 14, "usage_type": "name" }, { "api_name": "os.cpu_count", "line_number": 20, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 32, "usage_type": "call" }, { "api_name": "re.search", "line_numbe...
23572532142
import subprocess import os import re import abc import datetime class BaseBackend(object): __metaclass__=abc.ABCMeta @abc.abstractmethod def create_tmp_file(self, version_dir): return @abc.abstractmethod def get_parsed_commit(self): return class SVNBackend(BaseBackend): ...
pmoliva/Commits-Plots
backend.py
backend.py
py
2,017
python
en
code
1
github-code
18
[ { "api_name": "abc.ABCMeta", "line_number": 9, "usage_type": "attribute" }, { "api_name": "abc.abstractmethod", "line_number": 12, "usage_type": "attribute" }, { "api_name": "abc.abstractmethod", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.ch...
6628321745
from django.urls import path from .views import * app_name = 'expenses' urlpatterns = [ # Admin Site URLs # Client Site URLs # Api Urls path('expense/list/', ExpenseListAPIView.as_view(), name="expenses"), path('expense/<int:id>/', ExpenseDetailAPIView.as_view(), name="expense"), ]
alish-xeno/incomeexpensesapi
expenses/urls.py
urls.py
py
315
python
en
code
0
github-code
18
[ { "api_name": "django.urls.path", "line_number": 15, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 16, "usage_type": "call" } ]
24437412876
from django.conf import settings from django.conf.urls import patterns, include, url from django.conf.urls.static import static from filebrowser.sites import site from django.contrib import admin admin.autodiscover() urlpatterns = patterns( '', url(r'^$', 'pmsal.core.views.home', name='home'), # url(r'^...
klebercode/pmsal
pmsal/urls.py
urls.py
py
1,420
python
en
code
0
github-code
18
[ { "api_name": "django.contrib.admin.autodiscover", "line_number": 8, "usage_type": "call" }, { "api_name": "django.contrib.admin", "line_number": 8, "usage_type": "name" }, { "api_name": "django.conf.urls.patterns", "line_number": 11, "usage_type": "call" }, { "ap...
26516955105
import dataclasses from typing import Any, Dict, List from acme import core from acme import types from acme.multiagent import types as ma_types LearnerState = Any @dataclasses.dataclass class SynchronousDecentralizedLearnerSetState: """State of a SynchronousDecentralizedLearnerSet.""" # States of the learners...
deepmind/acme
acme/agents/jax/multiagent/decentralized/learner_set.py
learner_set.py
py
2,425
python
en
code
3,100
github-code
18
[ { "api_name": "typing.Any", "line_number": 9, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 16, "usage_type": "name" }, { "api_name": "acme.multiagent.types.AgentID", "line_number": 16, "usage_type": "attribute" }, { "api_name": "acme.multiag...
9672331221
from django.test import TestCase from django.utils.translation import override from modeltrans.manager import transform_translatable_fields from modeltrans.utils import ( build_localized_fieldname, get_instance_field_value, get_language, get_model_field, split_translated_fieldname, ) from .app.mod...
zostera/django-modeltrans
tests/test_utils.py
test_utils.py
py
2,975
python
en
code
47
github-code
18
[ { "api_name": "django.test.TestCase", "line_number": 16, "usage_type": "name" }, { "api_name": "modeltrans.utils.get_language", "line_number": 18, "usage_type": "call" }, { "api_name": "django.utils.translation.override", "line_number": 20, "usage_type": "call" }, { ...
40605590617
from copy import deepcopy from pathlib import Path class FileFamily(): def __init__(self): r'''A file family collects multiple asset names sharing the same path. ''' self.path = b"" self.assets = [] def set_path(self, path): self.path = path def add_as...
r00142/NEA
file_handlers/file_family.py
file_family.py
py
2,082
python
en
code
0
github-code
18
[ { "api_name": "pathlib.Path", "line_number": 38, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 40, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 47, "usage_type": "call" } ]
72777841001
from django.contrib.auth import get_user_model from django.shortcuts import get_object_or_404 from rest_framework import serializers from .models import Referral from .referral import attach_referral #------------------------------------------------------------------------------ class ReferralSerializer(serializers.M...
alexsheets/Revibe-Referrals-Microservice
Service-Referrals/referrals/serializer.py
serializer.py
py
1,638
python
en
code
1
github-code
18
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 9, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 9, "usage_type": "name" }, { "api_name": "rest_framework.serializers.CharField", "line_number": 10, "usage...