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
40960705633
import seaborn as sns import matplotlib.pyplot as plt import split from sklearn.naive_bayes import MultinomialNB from sklearn.metrics import classification_report, confusion_matrix, accuracy_score def NB_training_testing(): y,matrix_X =split.splitting() #train model NB_model = Mult...
frost64/FYP
Codes/naive_bayes.py
naive_bayes.py
py
1,331
python
en
code
0
github-code
21
[ { "api_name": "split.splitting", "line_number": 14, "usage_type": "call" }, { "api_name": "sklearn.naive_bayes.MultinomialNB", "line_number": 16, "usage_type": "call" }, { "api_name": "sklearn.metrics.confusion_matrix", "line_number": 22, "usage_type": "call" }, { ...
29583487991
from django.db import models from django.test import TestCase from localized_text_field import LocalizedTextField, LocaleContext class LocalizationTestClass(models.Model): hello = LocalizedTextField() class Meta(object): app_label='localized_text_field' class LocalizedTextFieldTests(TestCase): ...
emily-bain/localized_field
localized_text_field/test.py
test.py
py
1,295
python
en
code
0
github-code
21
[ { "api_name": "django.db.models.Model", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 6, "usage_type": "name" }, { "api_name": "localized_text_field.LocalizedTextField", "line_number": 7, "usage_type": "call" }, { ...
10322996533
import os import json import pickle class cdmss: def __init__(self, argv): self.parameters = argv[1] # 超参数列表 json格式 self.info_path = argv[2] # 输入信息与输出结果保存地址 json格式 self.info_dict = self.read_json(self.info_path) # 与输出相关的信息 self.parameters_dict = self.read_json(self.parameters...
cooling-down/NLM
cdmss.py
cdmss.py
py
7,492
python
en
code
0
github-code
21
[ { "api_name": "os.path.join", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path", "line_number": 2...
39913305887
try: from tqdm import tqdm_notebook except ImportError: tqdm_notebook = lambda x: x from collections import defaultdict from optparse import OptionParser import os.path import re import src.preprocess as preprocess import src.knntools as knntools def get_emails_from_text(email_body): ""...
GeoffNN/ALTEGRADEnron
src/manualprocessingtools.py
manualprocessingtools.py
py
4,157
python
en
code
0
github-code
21
[ { "api_name": "tqdm.tqdm_notebook", "line_number": 4, "usage_type": "name" }, { "api_name": "re.compile", "line_number": 20, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 24, "usage_type": "call" }, { "api_name": "tqdm.tqdm_notebook", "lin...
24569629100
import json import datetime # function to sort out the episodes def sort_out(json): # loop through the json for movie_id in json: ts = json[movie_id][0] # after 2022-11-07 only if(ts > 1667775600): print((7-len(movie_id)) * ' ' + str(movie_id) + ' at ' + str(datetime.datetim...
McBaumwolle/trakt-data-restore
sort_movies_localstorage.py
sort_movies_localstorage.py
py
479
python
en
code
6
github-code
21
[ { "api_name": "datetime.datetime.fromtimestamp", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 11, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 17, "usage_type": "call" } ]
6501251665
from datetime import datetime from typing import Any, Dict, List, Optional, Union import uuid from sqlalchemy import select from sqlalchemy.ext.asyncio.session import AsyncSession from fastapi.encoders import jsonable_encoder from app.crud.base import CRUDBase from app.models.transfer_status import TransferStatus from ...
pxuanbach/agri
app/crud/crud_transfer_status.py
crud_transfer_status.py
py
2,451
python
en
code
0
github-code
21
[ { "api_name": "app.crud.base.CRUDBase", "line_number": 15, "usage_type": "name" }, { "api_name": "app.models.transfer_status.TransferStatus", "line_number": 15, "usage_type": "name" }, { "api_name": "app.schemas.transfer.TransferStatusCreate", "line_number": 15, "usage_ty...
24771849849
#coding:utf-8 # py3.5+tensorflow-1.0.1+keras-2.0.6 # seq2seq bilstm+cnn+crf # pip install keras==2.0.6 # keras_contrib==2.0.8 pip install git+https://www.github.com/keras-team/keras-contrib.git # pip install gensim # 如缺少其它模块,看报错自行安装 import os,re import codecs import pickle import time import gc impor...
FanhuaandLuomu/BiLstm_CNN_CRF_CWS
simple_bilstm_model/bilstm__cnn_crf.py
bilstm__cnn_crf.py
py
12,590
python
en
code
378
github-code
21
[ { "api_name": "numpy.random.seed", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 17, "usage_type": "attribute" }, { "api_name": "keras_contrib.layers.CRF", "line_number": 69, "usage_type": "call" }, { "api_name": "codecs.o...
39361610923
import yfinance as yf import pandas as pd from datetime import datetime import csv import math import quandl NASDAQ_API_KEY = "mMdxxnhaxfXQ-UqNCyZ_" quandl.ApiConfig.api_key = NASDAQ_API_KEY def explore_api(symbol): msft = yf.Ticker(symbol) # get stock info # msft.info # msft_var = json.loads(msft...
stevehemingway/yfinance_tests
scan_values.py
scan_values.py
py
3,033
python
en
code
0
github-code
21
[ { "api_name": "quandl.ApiConfig", "line_number": 11, "usage_type": "attribute" }, { "api_name": "yfinance.Ticker", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 33, "usage_type": "call" }, { "api_name": "date...
20427752797
from geometry import get_angles import matplotlib.pyplot as plt from matplotlib.colors import LinearSegmentedColormap from matplotlib.patches import Arc import numpy as np def visualize(b, theta, bo, ro, res=4999): # Find angles of intersection kappa, lam, xi, code = get_angles(b, theta, np.cos(theta), np.si...
rodluger/starrynight
python/viz.py
viz.py
py
10,915
python
en
code
7
github-code
21
[ { "api_name": "geometry.get_angles", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.cos", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number":...
22998956925
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import networkx as nx import matplotlib.pyplot as plt g = nx.read_weighted_edgelist('edgelist.txt') degree = nx.degree(g) # then, pull out each of these connected components # and sort them by the number of nodes in them graphs = list(nx.connected_component_subgraphs(g)...
megansquire/patternflyConference
nxexamples/nx1.py
nx1.py
py
821
python
en
code
0
github-code
21
[ { "api_name": "networkx.read_weighted_edgelist", "line_number": 7, "usage_type": "call" }, { "api_name": "networkx.degree", "line_number": 8, "usage_type": "call" }, { "api_name": "networkx.connected_component_subgraphs", "line_number": 12, "usage_type": "call" }, { ...
5880862174
import matplotlib.pyplot as plt import numpy as np def preprocess(filename): with open(filename, 'r') as f: data = [] for line in f: row = line.strip().split() data.append(row) data = np.array(data, dtype=np.float) return data # plot of data poin...
ebele66/ML_Basics
kmeans.py
kmeans.py
py
2,506
python
en
code
0
github-code
21
[ { "api_name": "numpy.array", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.float", "line_number": 11, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 20, "usage_type": "call" }, { "api_name": "matplotlib.pypl...
20500487796
''' Name: Allison Sharpe Date: 10/2/15 Class: Design Patters for Web Programming Assignment: Simple Form ''' import webapp2 #use webapp2 library class MainHandler(webapp2.RequestHandler): #declaring a class def get(self): #function that starts everything. Catalyst - starts reaction page_head = '''<!DOCTYP...
allisondsharpe/dpwp
Practice/simple-login-2/main.py
main.py
py
1,293
python
en
code
0
github-code
21
[ { "api_name": "webapp2.RequestHandler", "line_number": 10, "usage_type": "attribute" }, { "api_name": "webapp2.WSGIApplication", "line_number": 42, "usage_type": "call" } ]
36129032628
from particles import ParticleSystem, drawParticles import pygame if __name__=="__main__": screenDim = 400 pygame.init() screen = pygame.display.set_mode((screenDim, screenDim)) Beta = 0.01 friction = 0.04 rMax = 0.5 # max distance dt = 0.05 nColors = 6 particleSystem = Particle...
PeterWaIIace/ParticleLife
Python/main_simulation.py
main_simulation.py
py
859
python
en
code
7
github-code
21
[ { "api_name": "pygame.init", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 9, "usage_type": "attribute" }, { "api_name": "particles.Partic...
29141233072
import tensorflow as tf import numpy as np import cv2 import pdb import pickle import matplotlib.pyplot as plt import pickle import json import os, glob import copy from utils import * ##################################################################### ## Write down the net we want to use ##########################...
guoqi1123/focaltrack
extra/run_nets_py.py
run_nets_py.py
py
5,625
python
en
code
3
github-code
21
[ { "api_name": "pickle.load", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.concatenate", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.concatenate", "line_number": 41, "usage_type": "call" }, { "api_name": "pickle.load", "li...
6675135866
from Bio import SeqIO from Bio import AlignIO import sys import argparse def parse_args(): parser = argparse.ArgumentParser(description='Clean up coding consensus.') parser.add_argument("-a", action="store", type=str, dest="alignment") parser.add_argument("-o", action="store", type=str, dest="output_seq")...
polio-nanopore/realtime-polio
rampart/pipelines/process_sample/rules/curate_indels.py
curate_indels.py
py
3,422
python
en
code
2
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "Bio.AlignIO.read", "line_number": 117, "usage_type": "call" }, { "api_name": "Bio.AlignIO", "line_number": 117, "usage_type": "name" } ]
5862188277
import json import requests from os.path import exists from selenium import webdriver from bs4 import BeautifulSoup from selenium.webdriver.common.by import By from aiogram import Bot, Dispatcher, executor, types bot = Bot(token="5385147452:AAEQHoHBmcQnsrQLy7Ikw1bDztuSAcq4T9w") dp = Dispatcher(bot) def creator(data)...
huyumniy/studentTable
Scripts/studentTable.py
studentTable.py
py
4,093
python
en
code
1
github-code
21
[ { "api_name": "aiogram.Bot", "line_number": 9, "usage_type": "call" }, { "api_name": "aiogram.Dispatcher", "line_number": 10, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.exists", "line_nu...
10896049926
#! /usr/bin/env python # -*- coding: utf-8 -*- import csv import urllib import json from time import sleep from datetime import datetime, timedelta import os import sys sys.path.insert(0,'..') from cfg import access_token import requests def get_json(url): getjson = urllib.request.urlopen(url).read().decode('ut...
Skvortsovg/AGT_skvortsov
part2/scripts/groups_info.py
groups_info.py
py
5,232
python
en
code
0
github-code
21
[ { "api_name": "sys.path.insert", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "urllib.request.urlopen", "line_number": 18, "usage_type": "call" }, { "api_name": "urllib.request",...
185053478
import pygame, os, tkinter from MechanismInterface import MechanismInterface from QualityAppraiser import QualityAppraiser from Utility import Utility from tkinter import filedialog lowerKbBound = 20 upperKbBound = 10240 clientId = 'rWlrkeV8HRJ6FvoBfPrhzR1TdqNuY9vMN856YZ8v' clientSecret = 'wY8pwK2J7FrqVGZx2oL...
accurtis1/CS345-Quality-Appraiser
Mechanism.py
Mechanism.py
py
5,215
python
en
code
0
github-code
21
[ { "api_name": "MechanismInterface.MechanismInterface", "line_number": 13, "usage_type": "name" }, { "api_name": "Utility.Utility", "line_number": 15, "usage_type": "call" }, { "api_name": "tkinter.Tk", "line_number": 18, "usage_type": "call" }, { "api_name": "Qual...
23097620753
#from skimage import color, io import os import numpy as np import torch import cv2 from utils import util import math from model.loss import * from collections import defaultdict #import pickle from utils import util, string_utils, error_rates from datasets.hw_dataset import PADDING_CONSTANT #THRESH=0.5 def getCor...
herobd/handwriting_line_generation
evaluators/styleworddataset_eval.py
styleworddataset_eval.py
py
6,848
python
en
code
59
github-code
21
[ { "api_name": "math.cos", "line_number": 26, "usage_type": "call" }, { "api_name": "math.sin", "line_number": 26, "usage_type": "call" }, { "api_name": "math.cos", "line_number": 27, "usage_type": "call" }, { "api_name": "math.sin", "line_number": 27, "usa...
18956131721
# # Copyright (c) 2011, EPFL (Ecole Politechnique Federale de Lausanne) # All rights reserved. # # Created by Marco Canini, Daniele Venzano, Dejan Kostic, Jennifer Rexford # Contributed to this file: Peter Peresini # # Redistribution and use in source and binary forms, with or without # modification, are permit...
mcanini/nice
model_checker/lib/strategies/heuristicconstctrldelay.py
heuristicconstctrldelay.py
py
3,717
python
en
code
3
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 36, "usage_type": "call" }, { "api_name": "lib.strategies.strategy.Strategy", "line_number": 40, "usage_type": "name" }, { "api_name": "lib.strategies.strategy.Strategy.__init__", "line_number": 42, "usage_type": "call" ...
72356686132
import os import random import gymnasium as gym import imageio import numpy as np import torch from envwrapper import EnvWrapper def fix_random_seeds(seed): torch.manual_seed(seed) torch.use_deterministic_algorithms(True) np.random.seed(seed) random.seed(seed) def save_gif(frames, fname): if n...
jerrykal/box2d-car-racing-ppo
util.py
util.py
py
1,080
python
en
code
3
github-code
21
[ { "api_name": "torch.manual_seed", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.use_deterministic_algorithms", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 15, "usage_type": "call" }, { "api_name":...
2808798955
import os, json from elasticsearch import Elasticsearch, helpers ES_CLUSTER_END_POINT = "http://elasticsearch.local-learning:9200" print(f"ES_CLUSTER_END_POINT {ES_CLUSTER_END_POINT}") source_index = 'image-index' es = Elasticsearch([ES_CLUSTER_END_POINT], use_ssl=False, verify_certs=False, # in...
rjshree/python-elasticsearch-client
search_query.py
search_query.py
py
1,123
python
en
code
0
github-code
21
[ { "api_name": "elasticsearch.Elasticsearch", "line_number": 6, "usage_type": "call" }, { "api_name": "elasticsearch.helpers.scan", "line_number": 13, "usage_type": "call" }, { "api_name": "elasticsearch.helpers", "line_number": 13, "usage_type": "name" } ]
467481963
from typing import Optional import telebot def check_int(value: any): try: int_number = int(value) except ValueError: return None return int_number def delete_message_by_handling( new_message: telebot.types.Message, bot: telebot.TeleBot, message_for_deleting: telebot.typ...
KozlovKV/anki-bot
bot/utils.py
utils.py
py
1,360
python
en
code
1
github-code
21
[ { "api_name": "telebot.types", "line_number": 15, "usage_type": "attribute" }, { "api_name": "telebot.TeleBot", "line_number": 15, "usage_type": "attribute" }, { "api_name": "telebot.types", "line_number": 16, "usage_type": "attribute" }, { "api_name": "telebot.Te...
36169014097
from django.utils.translation import ugettext_lazy as _ NONE = _('Unique') EXTRA_SMALL = _('x-Small') SMALL = _('Small') MEDIUM = _('Medium') LARGE = _('Large') EXTRA_LARGE = _('x-Large') COMBO = _('Meal') PERSONAL = _('Personal') MEDIANA = _('Mediana') FAMILIAR = _('Familiar') SHOT = _('Shot') MEDIA = _('Media') BOTE...
camrom8/digimenu
menus/helpers/choices.py
choices.py
py
1,760
python
en
code
0
github-code
21
[ { "api_name": "django.utils.translation.ugettext_lazy", "line_number": 3, "usage_type": "call" }, { "api_name": "django.utils.translation.ugettext_lazy", "line_number": 4, "usage_type": "call" }, { "api_name": "django.utils.translation.ugettext_lazy", "line_number": 5, "u...
22328557996
#Mo's Algorithm SPOJ DQUERY import math import functools from collections import defaultdict n=int(input()) block_size=int(math.sqrt(n-1)) answer={} #stores the answer for each query freq={} #contains freqs of elements in a freq=defaultdict(lambda:0,freq) def cmp(a,b): x=a[0]//block_size y=b[0]//block_s...
thecodearrow/Algorithms
Other neat hacks/Square Root Decomposition/Mo'sAlgo.py
Mo'sAlgo.py
py
1,706
python
en
code
2
github-code
21
[ { "api_name": "math.sqrt", "line_number": 7, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 11, "usage_type": "call" }, { "api_name": "functools.cmp_to_key", "line_number": 42, "usage_type": "call" } ]
24275276021
''' /*CHANGE HISTORY --CREATED BY--------CREATION DATE--------VERSION--------PURPOSE---------------------- Mehul Vaghela 11-Oct-2021 1.0 Initial Version. */ ''' import pandas as pd import json import re import logging import traceback import datetime from database import * from common.ut...
deaasazure/Webapp
MS/main/profile/utils/player.py
player.py
py
14,090
python
en
code
0
github-code
21
[ { "api_name": "common.utils.logger_handler.custom_logger.LogClass", "line_number": 27, "usage_type": "call" }, { "api_name": "common.utils.logger_handler.custom_logger", "line_number": 27, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 30, "usag...
30018611457
import tkinter from tkinter import IntVar from tkinter.ttk import Separator,Label,Frame,Radiobutton,Entry,Scale from ttkthemes import ThemedStyle class mainWindow(tkinter.Tk): def __init__(self, screenName: str | None = None, baseName: str | None = None, className: str = "Tk", useTk: bool = True, sync: bool = Fal...
MaxKindaNUBa/WordSearch
wordSearchMenu.py
wordSearchMenu.py
py
4,989
python
en
code
0
github-code
21
[ { "api_name": "tkinter.Tk", "line_number": 7, "usage_type": "attribute" }, { "api_name": "ttkthemes.ThemedStyle", "line_number": 10, "usage_type": "call" }, { "api_name": "tkinter.ttk.Label", "line_number": 14, "usage_type": "call" }, { "api_name": "tkinter.ttk.Se...
36464755299
from django.conf.urls import url from . import views app_name = 'myblog' urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^register/$', views.register, name='register'), url(r'^do_register/$', views.do_register, name='do_register'), url(r'^register_suc/$', views.register_suc, name='regist...
yangruihan/KeepBlog
myblog/urls.py
urls.py
py
1,319
python
en
code
2
github-code
21
[ { "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.conf.urls.url", "line_number": 10, "usage_type": "call" }, { "api_name": "django.c...
10841278833
from telethon import events import asyncio #from userbot.utils import admin_cmd from userbot.events import register from userbot import bot, CMD_HELP from telethon.errors.rpcerrorlist import YouBlockedUserError import os try: import subprocess except: os.system("pip install instantmusic") os.system("rm -rf *.mp3"...
THESANSKARILADKA/Sanskari
userbot/plugins/songss.py
songss.py
py
1,519
python
en
code
4
github-code
21
[ { "api_name": "os.system", "line_number": 11, "usage_type": "call" }, { "api_name": "os.system", "line_number": 15, "usage_type": "call" }, { "api_name": "os.system", "line_number": 20, "usage_type": "call" }, { "api_name": "userbot.bot.conversation", "line_nu...
7074958630
import requests url="https://pic4.zhimg.com/80/v2-a2619db4605c37d19f5437bcd430e107_hd.jpg" path=url.split('/')[-1] r=requests.get(url) with open(path,'wb') as f: f.write(r.content)
warm-nova/BIT_Python
getpictures.py
getpictures.py
py
191
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" } ]
30484008442
''' Usage: python graphcrunch.py [z]f1|[z]m1 ARGS where f1 args are one crunchFileName followed by parameters to graph, or where m1 args are one parameter to graph followed by multiple crunchFiles. A 'z' in front of f1 or m1 forces the y axis to start at 0. ''' # graphcrunch.py # Graph data from one or more...
jonjones22/project
graphcrunch_line.py
graphcrunch_line.py
py
3,971
python
en
code
0
github-code
21
[ { "api_name": "matplotlib.use", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 26, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 27, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_numbe...
24580593543
from dataclasses import dataclass from typing import Any, Tuple import numpy as np from nlp.dataset import TextDataset @dataclass class SupervisedNNModelTrainConfig: binary_out: bool = False epoch: int = 1 # total # of training epochs train_batch_size: int = 64 # batch size during training eval_ba...
charliemorning/mlws
nlp/trainer.py
trainer.py
py
2,092
python
en
code
0
github-code
21
[ { "api_name": "dataclasses.dataclass", "line_number": 9, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 38, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 38, "usage_type": "name" }, { "api_name": "typing.Tuple", "line...
26581305422
import sys import os from utils.Constants import SHAREPOINT_DIRECTORY, SPRINT_FOLDER_FORMAT def print_with_progress(prefix: str, current: float, total: float, force_new: bool, dp: int = 0) -> str: if force_new: print() sys.stdout.write(f'\r{prefix} {format_percentage(current, total, dp)}') sys.std...
olliesharplin12/liquid-planner-analyzer
utils/Utils.py
Utils.py
py
1,114
python
en
code
0
github-code
21
[ { "api_name": "sys.stdout.write", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 9, "usage_type": "attribute" }, { "api_name": "sys.stdout.flush", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.stdout", "lin...
9126817922
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' __kupfer_name__ = _("Chromium Bugs") __kupfer_sources__ = ("BugsSource", ) __kupfer_actions__ = () __description__ = _("Index of a Chromium bookmarks folder") __version__ = "2017.1" __author__ = "Khurshid Alam" ''' import os import re import sys import json import su...
khurshid-alam/Kupfer-Plugins-Extra
chromium/chromium.py
chromium.py
py
3,413
python
en
code
2
github-code
21
[ { "api_name": "sys.path.append", "line_number": 22, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path", "line_number...
26700811366
# Created by Yuexiong Ding # Date: 2018/9/26 # Description: 画图工具 import numpy as np import matplotlib.pyplot as plt from statsmodels.graphics.tsaplots import plot_acf from MyModule import data def draw_time_series(df_raw, cols): """ 画时序图 :param df_raw: :param cols: :return: """ for c in co...
dyxm/PM2.5TransferLearning
MyModule/draw.py
draw.py
py
2,058
python
en
code
1
github-code
21
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 18, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 18, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 19, "usage_type": "call" }, { "api_name": "mat...
17115897421
import queue import time import PyQt5.QtWidgets as qtw import PyQt5.QtGui as qtg import PyQt5.QtNetwork as qtn import PyQt5.QtCore as qtc import numpy as np from epyqtwidgets.ip4validator import IP4Validator import epyqtsettings.settings_widgets as sw from epyqtsettings.settings import Settings from epyqtwidgets.indi...
ecpoppenheimer/dispense
src/dispense/dispenser_tcp_controller.py
dispenser_tcp_controller.py
py
67,121
python
en
code
0
github-code
21
[ { "api_name": "numpy.arange", "line_number": 172, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 188, "usage_type": "call" }, { "api_name": "epyqtsettings.settings.Settings", "line_number": 216, "usage_type": "call" }, { "api_name": "numpy.on...
11761476724
#Project 3 | Linear Classification #Layth Yassin and Husam Almanakly import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl from sklearn.metrics import roc_curve mpl.use('TkAgg') print('#### Synthetic Data Classification... ####') print() #Set up subplot figure figure, axarr =...
husam-6/Projects
BayesianML/Project3.py
Project3.py
py
7,568
python
en
code
0
github-code
21
[ { "api_name": "matplotlib.use", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 15, "usage_type": "name" }, { "api_name": "matplotlib...
6637147773
import os from chain.common.enum import StoreType from chain.common.util import store_upload, chain_logger from fate_arch.common import file_utils import datetime from fate_flow.web_server.db.db_models import StudioModelInfoExtend, StudioSampleInfo, StudioAuthUser, \ StudioProjectInfo, StudioProjectCanvas, StudioPa...
Seceum/SeceumFL
fateflow/python/chain/chain_start.py
chain_start.py
py
1,649
python
en
code
15
github-code
21
[ { "api_name": "chain.common.util.chain_logger.info", "line_number": 14, "usage_type": "call" }, { "api_name": "chain.common.util.chain_logger", "line_number": 14, "usage_type": "name" }, { "api_name": "fate_flow.web_server.utils.common_util.datetime_format", "line_number": 14...
11925276033
import torch import torch.nn.functional as F from torch import nn from transformers.models.bert import BertModel, BertPreTrainedModel class LSTM_SST2(nn.Module): def __init__(self, input_dim, embedding_dim, hidden_dim, output_dim, n_layers, bidirectional, dropout, batch_size): super(LSTM_...
HJHGJGHHG/NLPPapers
Edge intelligence(NLP)/Knowledge Distillation/DistilLSTM/code/models.py
models.py
py
2,760
python
en
code
3
github-code
21
[ { "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.Embedding", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.nn", "line_n...
4522100126
import nltk import random from nltk.corpus import movie_reviews documents = [(list(movie_reviews.words(fileid)), category) for category in movie_reviews.categories() for fileid in movie_reviews.fileids(category)] ##documents can be used for training ##documents = [] ##for category in movie_re...
lightsalsa251/NLP-with-NLTK
text classification.py
text classification.py
py
1,115
python
en
code
0
github-code
21
[ { "api_name": "nltk.corpus.movie_reviews.words", "line_number": 5, "usage_type": "call" }, { "api_name": "nltk.corpus.movie_reviews", "line_number": 5, "usage_type": "name" }, { "api_name": "nltk.corpus.movie_reviews.categories", "line_number": 6, "usage_type": "call" }...
72223731894
""" # Author: Yinghao Li # Modified: October 27th, 2023 # --------------------------------------- # Description: GUI for Minesweeper """ import numpy as np import logging from .core import MineField, ActionFeedback from PyQt6.QtWidgets import QMainWindow, QPushButton from PyQt6.QtCore import QSize, Qt, pyqtSignal fro...
Yinghao-Li/Minesweeper-for-LLM
src/game/gui.py
gui.py
py
7,364
python
en
code
1
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "PyQt6.QtGui.QColor", "line_number": 20, "usage_type": "call" }, { "api_name": "PyQt6.QtGui.QColor", "line_number": 21, "usage_type": "call" }, { "api_name": "PyQt6.QtGui.Q...
15177892303
import tensorflow as tf import tensorflow.contrib.layers as layers import numpy as np import random from common.schedules import LinearSchedule from common.replay_buffer import ReplayBuffer class DQNAgent(object): """ refs: https://github.com/skumar9876/Hierarchical-DQN/blob/master/dqn.py """ def __i...
GongXudong/DRL_IMPL
DQN/DQNAgent.py
DQNAgent.py
py
11,711
python
en
code
1
github-code
21
[ { "api_name": "common.schedules.LinearSchedule", "line_number": 45, "usage_type": "call" }, { "api_name": "tensorflow.train.AdamOptimizer", "line_number": 56, "usage_type": "call" }, { "api_name": "tensorflow.train", "line_number": 56, "usage_type": "attribute" }, { ...
75213214773
import json from functools import partial import re import FrameAPI import os import importlib PluginList = [] # 默认config.json目录:../../PyPluginConfig/AsoulFansCounting # 或者 ./PyPluginConfig def CheckCommand(MessageType, MessageContain,CommandMap): for x in CommandMap.keys(): t = json.loads(x) Mat...
dreagonm/DgmBot
MainProcess.py
MainProcess.py
py
1,703
python
en
code
0
github-code
21
[ { "api_name": "json.loads", "line_number": 15, "usage_type": "call" }, { "api_name": "re.match", "line_number": 16, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 43, "usage_type": "call" }, { "api_name": "importlib.import_module", "line_nu...
22644724362
import logging from selenium import webdriver import chromedriver_autoinstaller from pyvirtualdisplay import Display ######################## # Logging functionality ######################## class FilterLogging(object): def __init__(self, level): self.__level = level def filter(self, logRecord): ...
ActurialCapital/openresa-bot
bot/utils.py
utils.py
py
1,878
python
en
code
0
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 20, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 21, "usage_type": "attribute" }, { "api_name": "logging.FileHandler", "line_number": 22, "usage_type": "call" }, { "api_name": "logging.Forma...
29275568900
""" Unit tests for DatasetFinder class. """ import unittest from hdf5reader.dataset_finder import DatasetFinder import h5py class TestDatasetFinder(unittest.TestCase): """ Unit tests for FileFinder class. """ def test_dataset_finder(self): files = ["/mnt/space1/pospelov/data/d3hack/ver1/hdf5/d...
gpospelov/python-sandbox
hdf5reader/test/test_dataset_finder.py
test_dataset_finder.py
py
579
python
en
code
0
github-code
21
[ { "api_name": "unittest.TestCase", "line_number": 9, "usage_type": "attribute" }, { "api_name": "hdf5reader.dataset_finder.DatasetFinder", "line_number": 15, "usage_type": "call" }, { "api_name": "h5py.Dataset", "line_number": 18, "usage_type": "attribute" }, { "a...
1146537492
from django.contrib.auth import forms as auth_forms, login from django import forms from project.accounts.models import Profile from project.common.helpers import BootstrapFormMixin, DisabledFieldsFormMixin UserModel = auth_forms.get_user_model() class CreateProfileFormAbstract(BootstrapFormMixin, auth_forms.UserC...
a-angeliev/helpy
project/accounts/forms.py
forms.py
py
3,644
python
en
code
0
github-code
21
[ { "api_name": "django.contrib.auth.forms.get_user_model", "line_number": 8, "usage_type": "call" }, { "api_name": "django.contrib.auth.forms", "line_number": 8, "usage_type": "name" }, { "api_name": "project.common.helpers.BootstrapFormMixin", "line_number": 11, "usage_ty...
8044609396
import random import time from typing import Optional, Union import uuid import warnings from z3 import ( ArithRef, Array, Int, IntSort, Optimize, Or, Solver, SolverFor, Store, Sum, get_param, unsat, unknown, set_option, ) from processscheduler.objective import ...
tpaviot/ProcessScheduler
processscheduler/solver.py
solver.py
py
29,521
python
en
code
46
github-code
21
[ { "api_name": "typing.Optional", "line_number": 43, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 44, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 45, "usage_type": "name" }, { "api_name": "typing.Optional", ...
35216116567
from blspy import AugSchemeMPL, PrivateKey from chia.util.ints import uint16, uint64 from chia.types.blockchain_format.program import Program, SerializedProgram from chia.wallet.wallet import Wallet from chia.types.blockchain_format.coin import Coin from chia.types.coin_solution import CoinSolution from chia.types.spen...
deanrobin/easy_chia
wallet_example.py
wallet_example.py
py
7,613
python
en
code
4
github-code
21
[ { "api_name": "blspy.PrivateKey.from_bytes", "line_number": 35, "usage_type": "call" }, { "api_name": "blspy.PrivateKey", "line_number": 35, "usage_type": "name" }, { "api_name": "chia.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle.puzzle_for_pk", "line_number": 37, ...
12400195529
#========================================================================== # Program: NetworkAllocations.py ---- CLASS --- # Author: Jorge E. Rodriguez # Date Created: May-25-2018 # Date Last Modified: May-25-2018 # Summary: This is Class to for the NetworkAllocations #==========================================...
jorgeerodriguez/BVAnalytics
NetworkAllocations.py
NetworkAllocations.py
py
78,456
python
en
code
0
github-code
21
[ { "api_name": "sys.version_info", "line_number": 24, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 42, "usage_type": "call" }, { "api_name": "Utils.Get_Values", "line_number": 61, "usage_type": "call" }, { "api_name": "Utils.Get_ODBC_Name",...
12038656926
from django.urls import path from . import views app_name = 'myapp' urlpatterns = [ path('', views.listView, name='list'), path('add', views.addMovie, name='add'), path('random', views.randomMovie, name='random'), path('movies', views.selectMovie, name='movies'), path('discover', views.discoverMovi...
ThePowerfulProgrammer/Old-django-projects
myapp/urls.py
urls.py
py
399
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", ...
73030798133
''' This module implements the Locality Sensitive Hashing index with MinHash (MinHash LSH) and Weighted MinHash (Weighted MinHash LSH) Both indexes supports query with Jaccard similarity threshold. Reference: Chapter 3, Mining of Massive Datasets (http://www.mmds.org/) ''' from collections import defaultdict _inte...
LiuFang816/SALSTM_py_data
python/ekzhu_datasketch/datasketch-master/datasketch/lsh.py
lsh.py
py
6,215
python
en
code
9
github-code
21
[ { "api_name": "scipy.integrate.quad", "line_number": 26, "usage_type": "name" }, { "api_name": "scipy.integrate.quad", "line_number": 31, "usage_type": "call" }, { "api_name": "scipy.integrate.quad", "line_number": 37, "usage_type": "call" }, { "api_name": "collec...
19478360331
import pandas as pd import pdb import os import re import requests import io from alpha_vantage.timeseries import TimeSeries from time import sleep api_key = 'KDDTQTNE9OTMD4V4.' symbols = ['EURUSD','GBPJPY','GBPUSD','NZDJPY','USDCAD','USDJPY','EURGBP','EURJPY','GBPAUD'] time_window = 'daily' def main(): ts = Tim...
chanmoto/chanmoto.github.io
crawl.py
crawl.py
py
931
python
en
code
0
github-code
21
[ { "api_name": "alpha_vantage.timeseries.TimeSeries", "line_number": 16, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 19, "usage_type": "call" } ]
12566496795
from keras.models import Sequential from keras.layers import Dense, Activation from keras.optimizers import Adam import random import gym from gym.wrappers.monitoring import Monitor import numpy as np from collections import deque DEBUG = False # https://keon.io/deep-q-learning class DQNAgent: def __init__(self, ...
hsgui/interest-only
deeplearning/openai-gym/cartpole_dqn_1.py
cartpole_dqn_1.py
py
4,124
python
en
code
0
github-code
21
[ { "api_name": "collections.deque", "line_number": 17, "usage_type": "call" }, { "api_name": "keras.models.Sequential", "line_number": 35, "usage_type": "call" }, { "api_name": "keras.layers.Dense", "line_number": 39, "usage_type": "call" }, { "api_name": "keras.la...
9395287990
import sys import pygame from pygame.locals import * pygame.init() gameMode_audio = pygame.mixer.Sound('gameMoswAudio.mp3') gameMode_audio.play() screen_width = 1000 screen_height = 800 BACKGROUND = pygame.image.load('img/background.png') screen = pygame.display.set_mode((screen_width, screen_height)) pygame.display....
NishilNayak/FlappyBird-hand-controlled-computer-vision
textbutton.py
textbutton.py
py
2,217
python
en
code
0
github-code
21
[ { "api_name": "pygame.init", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.mixer.Sound", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.mixer", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pygame.image.load", ...
8446320723
from django.http import HttpResponseRedirect, HttpResponse from django.shortcuts import render, redirect, get_object_or_404 from django.views.generic.base import View from django.contrib.auth import logout, login, authenticate from django.contrib.auth.decorators import login_required from rest_framework.response import...
Jrxxs/Web-Chat
Messenger/views.py
views.py
py
10,383
python
en
code
0
github-code
21
[ { "api_name": "django.views.generic.base.View", "line_number": 21, "usage_type": "name" }, { "api_name": "django.shortcuts.redirect", "line_number": 27, "usage_type": "call" }, { "api_name": "models.User.objects.filter", "line_number": 28, "usage_type": "call" }, { ...
73190218291
# -*- coding: utf-8 -*- from ludaweb.api.apps import App __version__ = '0.1' from flask import Flask from flask_restful import Api, Resource from celery import Celery app = Flask('ludaWeb') app.debug = True # app.config['CELERY_BROKER_URL'] = 'redis://47.92.37.219:6379/0' # app.config['CELERY_RESULT_BACKEND'] = 'red...
Jetzzzzz/luda
ludaweb/__init__.py
__init__.py
py
2,036
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path", "line_number": 29, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_...
34639603927
# author: nilput <github.com/nilput> # to install dependencies: # pip install capstone # pip install pyelftools from capstone import * from elftools.elf.elffile import ELFFile from types import SimpleNamespace as Namespace import argparse import functools opts = Namespace(**{ 'print_disassembly' : False, ...
nilput/objcpuid
main.py
main.py
py
7,989
python
en
code
0
github-code
21
[ { "api_name": "types.SimpleNamespace", "line_number": 12, "usage_type": "call" }, { "api_name": "functools.cmp_to_key", "line_number": 42, "usage_type": "call" }, { "api_name": "elftools.elf.elffile.ELFFile", "line_number": 164, "usage_type": "call" }, { "api_name...
10603012081
from typing import Dict, List, Any from overrides import overrides import logging import torch from allennlp.data import TextFieldTensors, Vocabulary from allennlp.models.model import Model from allennlp.modules import Seq2VecEncoder, TextFieldEmbedder, Embedding from allennlp.nn.util import get_text_field_mask from a...
jjzha/kompetencer
mtp/machamp/models/machamp_model.py
machamp_model.py
py
12,106
python
en
code
5
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "allennlp.models.model.Model", "line_number": 16, "usage_type": "name" }, { "api_name": "allennlp.data.Vocabulary", "line_number": 22, "usage_type": "name" }, { "api_name":...
42442026933
import numpy as np import scipy.stats as ss import scipy.special as sp from .poisson_kalman_recursions import nl_univariate_KFS, nld_univariate_KFS from .family import Family from .flat import Flat from .normal import Normal from .gas_recursions import gas_recursion_poisson_orderone, gas_recursion_poisson_ordertwo fr...
RJT1990/pyflux
pyflux/families/poisson.py
poisson.py
py
13,640
python
en
code
2,066
github-code
21
[ { "api_name": "family.Family", "line_number": 17, "usage_type": "name" }, { "api_name": "numpy.ones", "line_number": 70, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 71, "usage_type": "call" }, { "api_name": "numpy.array", "line_number":...
15398609410
########################## # Authors: Nate Welch & David Jennings # Version: 12/14/2021 # Purpose: Uses BS4 to scrape data from the web ########################## import time from multiprocessing import Pipe, Process import selenium.common.exceptions from bs4 import BeautifulSoup import urllib.request import html5lib ...
nat3423/WCU_Alexa_Skill
web_scraper.py
web_scraper.py
py
9,476
python
en
code
0
github-code
21
[ { "api_name": "multiprocessing.Pipe", "line_number": 21, "usage_type": "call" }, { "api_name": "multiprocessing.Process", "line_number": 26, "usage_type": "call" }, { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 66, "usage_type": "call" }, { "api...
2895433002
"""mysite URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-base...
TomatoFish666/RecSystem
mysite/mysite/urls.py
urls.py
py
1,366
python
en
code
15
github-code
21
[ { "api_name": "django.conf.urls.url", "line_number": 21, "usage_type": "call" }, { "api_name": "InfoRec.views.home", "line_number": 21, "usage_type": "attribute" }, { "api_name": "InfoRec.views", "line_number": 21, "usage_type": "name" }, { "api_name": "django.con...
5267493831
import os import numpy as np import sys import multiprocessing import time import pandas as pd import tensorflow as tf import cv2 from utils import detector_utils as detector_utils from utils import label_map_util class FasterRCNN(multiprocessing.Process): def __init__(self, input_pipe, kcf_pipe, gpu_id, num_clas...
UDC-GAC/HybridTracker
object_detection/faster_rcnn_tracker.py
faster_rcnn_tracker.py
py
3,370
python
en
code
0
github-code
21
[ { "api_name": "multiprocessing.Process", "line_number": 13, "usage_type": "attribute" }, { "api_name": "multiprocessing.Process.__init__", "line_number": 15, "usage_type": "call" }, { "api_name": "multiprocessing.Process", "line_number": 15, "usage_type": "attribute" },...
2462862094
import json from cmd import Cmd import requests class NodesInfo: def __init__(self): self.node_ip = "" self.nodes_ip = [] nodes_info = NodesInfo() class MinerCLI(Cmd): prompt = "miner_cli: " def __init__(self): Cmd.__init__(self) def check_state_of_server(self, node): try: if node != '': url =...
oriabyi/Blockchain
miner_functions/miner_cli.py
miner_cli.py
py
4,509
python
en
code
0
github-code
21
[ { "api_name": "cmd.Cmd", "line_number": 14, "usage_type": "name" }, { "api_name": "cmd.Cmd.__init__", "line_number": 18, "usage_type": "call" }, { "api_name": "cmd.Cmd", "line_number": 18, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 24...
33930974441
from django.shortcuts import render from django.views.generic.base import TemplateView, View from catalyst_count.redis import redis from upload_data.models import CompanyModel from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.views.generic.list import ListView from django.core.e...
SleepinNinja/catalyst-count
query_builder/views.py
views.py
py
1,927
python
en
code
0
github-code
21
[ { "api_name": "django.contrib.auth.mixins.LoginRequiredMixin", "line_number": 11, "usage_type": "name" }, { "api_name": "django.views.generic.base.TemplateView", "line_number": 11, "usage_type": "name" }, { "api_name": "catalyst_count.redis.redis.sort", "line_number": 16, ...
20177138949
import os from os.path import join, exists import pandas as pd import numpy as np import transformers import surprisal from surprisal import AutoHuggingFaceModel import json import copy from transformers import BertTokenizer, BertForMaskedLM, GPT2Tokenizer from src.utils import configuration, transformers_bert_complet...
smeylan/child-directed-listening
src/utils/load_models.py
load_models.py
py
13,475
python
en
code
2
github-code
21
[ { "api_name": "src.utils.configuration.Config", "line_number": 12, "usage_type": "call" }, { "api_name": "src.utils.configuration", "line_number": 12, "usage_type": "name" }, { "api_name": "copy.copy", "line_number": 31, "usage_type": "call" }, { "api_name": "copy...
27506208037
# -*- coding: utf-8 -*- import sys import six import numpy as np from tqdm import tqdm from preparation import * class Preprocess(object): def __init__(self, word_seg_config={}, doc_filter_config={}, word_filter_config={}, word_index_config={} ...
zhuwenbo1988/nlp
text_similarity/matchpyramid/preprocess/preprocess.py
preprocess.py
py
6,133
python
en
code
3
github-code
21
[ { "api_name": "six.MAXSIZE", "line_number": 21, "usage_type": "attribute" }, { "api_name": "six.MAXSIZE", "line_number": 24, "usage_type": "attribute" }, { "api_name": "tqdm.tqdm", "line_number": 67, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_num...
32503531416
import os import xml.etree.ElementTree import zipfile import re BENIGN_DIR = '/mnt/ssd/dku-apk/dku20_decoded/benign' MALWARE_DIR = '/mnt/ssd/dku-apk/dku20_decoded/malware' def extract_perm(apk): filepath = os.path.join(apk, 'AndroidManifest.xml') str = "" tree = xml.etree.ElementTree.parse(filepath) root = tr...
euicheon123/school
extract_team03.py
extract_team03.py
py
2,508
python
en
code
0
github-code
21
[ { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "xml.etree.ElementTree.etree.ElementTree.parse", "line_number": 12, "usage_type": "call" }, { "api_name"...
7079418744
''' ### BEGIN NODE INFO [info] name = DAC AD660 Server version = 1.0 description = instancename = DAC AD660 Server [startup] cmdline = %PYTHON% %FILE% timeout = 20 [shutdown] message = 987654321 timeout = 20 ### END NODE INFO ''' from labrad.server import LabradServer, setting, Signal, inlineCallbacks from api import ...
johnpalsberg/John-Palsberg
QsimMaster/servers/dacAD660/dacAD660server.py
dacAD660server.py
py
6,347
python
en
code
0
github-code
21
[ { "api_name": "config.dac_ad660_config.hardwareConfiguration.pulseTriggered", "line_number": 47, "usage_type": "attribute" }, { "api_name": "config.dac_ad660_config.hardwareConfiguration", "line_number": 47, "usage_type": "name" }, { "api_name": "config.dac_ad660_config.hardwareC...
21151327821
from typing import Callable, Iterable, Optional, Tuple import numpy as np import torch import torch.nn as nn import torch.nn.functional as F LayerSize = int def hidden_init(layer) -> Tuple[float, float]: fan_in = layer.weight.data.size()[0] lim = 1.0 / np.sqrt(fan_in) return -lim, lim class NeuralNet...
trentondelahaye/deep-rl-tennis
agents/networks.py
networks.py
py
4,064
python
en
code
0
github-code
21
[ { "api_name": "numpy.sqrt", "line_number": 14, "usage_type": "call" }, { "api_name": "typing.Tuple", "line_number": 12, "usage_type": "name" }, { "api_name": "torch.nn.Module", "line_number": 18, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_num...
70309694774
"""KDE and histogram plots for multiple variables.""" import warnings from ..data import convert_to_dataset from ..labels import BaseLabeller from ..sel_utils import ( xarray_var_iter, ) from ..rcparams import rcParams from ..utils import _var_names from .plot_utils import default_grid, get_plotting_function # p...
arviz-devs/arviz
arviz/plots/densityplot.py
densityplot.py
py
10,895
python
en
code
1,461
github-code
21
[ { "api_name": "data.convert_to_dataset", "line_number": 188, "usage_type": "call" }, { "api_name": "data.convert_to_dataset", "line_number": 190, "usage_type": "call" }, { "api_name": "labels.BaseLabeller", "line_number": 196, "usage_type": "call" }, { "api_name":...
42956494722
import socket import select import sys import queue import re import datetime # create socket sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.setblocking(0) # bind socket ip_addr = sys.argv[1] port_number = int(sys.argv[2]) sock.bind((ip_addr, port_number)) # Echo server h2 = ('10.10.1.100', 8888) # fi...
Shaun7heSheep/computerNetwork
rdp.py
rdp.py
py
9,671
python
en
code
1
github-code
21
[ { "api_name": "socket.socket", "line_number": 9, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 9, "usage_type": "attribute" }, { "api_name": "socket.SOCK_DGRAM", "line_number": 9, "usage_type": "attribute" }, { "api_name": "sys.argv", ...
8223973300
## Import library import numpy as np import pandas as pd import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.optim.lr_scheduler import LambdaLR, StepLR, MultiStepLR from torch.utils.data import DataLoader from torch.utils.data import sampler import torchvision.data...
yurayli/pytorch-cifar-10
models.py
models.py
py
14,841
python
en
code
0
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 16, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 16, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.nn", "lin...
11383604178
import smtplib import time import imaplib import email import traceback import json def mail_create(mailaddres,pw,author): latestmail = gatherMail(mailaddres, pw) try: cassio = open("database.json", "r") db = json.load(cassio) cassio.close() #db[author] = {"creds": ["try", "...
josefpython/discord_mail
mail_fetcher.py
mail_fetcher.py
py
1,573
python
en
code
0
github-code
21
[ { "api_name": "json.load", "line_number": 15, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 22, "usage_type": "call" }, { "api_name": "traceback.print_exc", "line_number": 29, "usage_type": "call" }, { "api_name": "imaplib.IMAP4_SSL", "line...
15864969502
import base64 import altair as alt import streamlit as st import pandas as pd import plotly.express as px import matplotlib.pyplot as plt import json import os from bokeh.plotting import figure from bokeh.palettes import Category20c from math import pi from bokeh.transform import cumsum # Chargement des images def get...
DorianSanjivy/DataVizProject
main.py
main.py
py
12,787
python
fr
code
0
github-code
21
[ { "api_name": "base64.b64encode", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.path.realpath", ...
72075240373
#!/usr/bin/env python3 import urllib.request import urllib.parse import sys import xml.etree.ElementTree URL = 'http://api.bart.gov/api/bsa.aspx' KEY = 'MW9S-E7SL-26DU-VV8V' def do_command(cmd, **args): args['cmd'] = cmd args['key'] = KEY uu = URL + '?' + urllib.parse.urlencode(args) res = urllib.request.u...
squeed/muni-countdown
pylib/municountdown/bart.py
bart.py
py
746
python
en
code
3
github-code
21
[ { "api_name": "urllib.request.parse.urlencode", "line_number": 18, "usage_type": "call" }, { "api_name": "urllib.request.parse", "line_number": 18, "usage_type": "attribute" }, { "api_name": "urllib.request", "line_number": 18, "usage_type": "name" }, { "api_name"...
23134097322
# -*- coding:utf-8 -*- # @Author : Cheng # @Time : 2022/5/7 17:04 from collections import deque from typing import List class Solution: def minMutation(self, start: str, end: str, bank: List[str]) -> int: if start == end: return 0 bank = set(bank) if end not in bank: ...
chengcct/Algorithmic-exercises
leetcode/433. 最小基因变化.py
433. 最小基因变化.py
py
1,035
python
en
code
0
github-code
21
[ { "api_name": "typing.List", "line_number": 9, "usage_type": "name" }, { "api_name": "collections.deque", "line_number": 15, "usage_type": "call" } ]
74813025971
import collections class Solution(object): def numBusesToDestination(self, routes, S, T): """ :type routes: List[List[int]] :type S: int :type T: int :rtype: int """ if S == T: return 0 stop_bus = collections.defaultdict(set) for bus in range(l...
kduan005/Leetcode
leetcode815.py
leetcode815.py
py
1,104
python
en
code
0
github-code
21
[ { "api_name": "collections.defaultdict", "line_number": 11, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 16, "usage_type": "call" } ]
70460117814
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.test import TestCase from api.models import Event, Attempt from django.contrib.auth.models import User from api import serializers import datetime """ Tests all parameters and fields of AttemptSerializer """ def create_event(): return E...
Fanner487/fyp-django
fyp/api/tests/serializers/test_attempt_serializer.py
test_attempt_serializer.py
py
4,261
python
en
code
0
github-code
21
[ { "api_name": "api.models.Event.objects.create", "line_number": 16, "usage_type": "call" }, { "api_name": "api.models.Event.objects", "line_number": 16, "usage_type": "attribute" }, { "api_name": "api.models.Event", "line_number": 16, "usage_type": "name" }, { "ap...
3214270638
""" Routines to perform fits """ import numpy as np from scipy import special def fit_discrete_powerlaw(xval:np.ndarray, xmin:int, alph_mnx:tuple, npts=1000): """Perform a power-law fit to a distribution of discrete (integer) values See https://www.jstor.org/stable/pdf/25662336....
profxj/mhw_analysis
papers/MHWS/Analysis/py/fitting.py
fitting.py
py
1,591
python
en
code
1
github-code
21
[ { "api_name": "numpy.ndarray", "line_number": 5, "usage_type": "attribute" }, { "api_name": "numpy.linspace", "line_number": 22, "usage_type": "call" }, { "api_name": "scipy.special.zeta", "line_number": 25, "usage_type": "call" }, { "api_name": "scipy.special", ...
17172572948
from subprocess import Popen from subprocess import PIPE import os from os import path import sys import argparse import configparser import errno import time import json from fiodb import * FIO_DEBUG = 1 buildconfig = "" fiosql_db = "" fiosql_column = "" Threads = [1, 2, 4, 8, 12, 16, 24] Bursts = ["4K", "1M"] de...
riteshharjani/fioperf
fioperf.py
fioperf.py
py
6,050
python
en
code
2
github-code
21
[ { "api_name": "os.makedirs", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path", "line_number": 30, "usage_type": "argument" }, { "api_name": "errno.EEXIST", "line_number": 32, "usage_type": "attribute" }, { "api_name": "os.path.isdir", "line_n...
5755979009
# -*- coding: utf-8 -*- from odoo import api, fields, models from datetime import timedelta, date import dateutil.parser from datetime import timedelta, date import dateutil.parser import datetime class CashBankWizard(models.TransientModel): _name = "cash.bank.wizard" _description = "Cash Bank Wizard" d...
intisoft22/2023-Triyudha
accounting_excel_report/wizard/cash_bank.py
cash_bank.py
py
3,041
python
en
code
0
github-code
21
[ { "api_name": "odoo.models.TransientModel", "line_number": 11, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 11, "usage_type": "name" }, { "api_name": "odoo.fields.Date", "line_number": 15, "usage_type": "call" }, { "api_name": "odoo.fie...
10695074474
#modules to request server stuff from urllib.request import urlopen from urllib.parse import urlencode import matplotlib.pyplot as plot import json, random, math, os, sys #be able to call commands import subprocess as cmd #import matrix repr from numpy import mat #import numpy for errors import numpy as numpy #imp...
whaatt/TrailblazerServer
processing/trailblazer.py
trailblazer.py
py
25,703
python
en
code
0
github-code
21
[ { "api_name": "os.path.abspath", "line_number": 50, "usage_type": "call" }, { "api_name": "os.path", "line_number": 50, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 51, "usage_type": "call" }, { "api_name": "os.path", "line_numb...
5686466716
import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable from utils import * class BatchTreeEncoder(nn.Module): def __init__(self, vocab_size, embedding_dim, encode_dim, batch_size, use_gpu, pretrained_weight=None): super(BatchTreeEncoder, self).__init__() ...
pkt-attn/pkt-attn
models/astnn/model.py
model.py
py
7,849
python
en
code
3
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 8, "usage_type": "name" }, { "api_name": "torch.nn.Embedding", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.nn", "line_n...
71447982452
import requests import json url='https://fanyi.baidu.com/basetrans' qury_string=input('请输入中文内容:') data={'query': qury_string, 'from': 'zh', 'to': 'en'} headers={'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/...
haunledeshuchang/baidufanyi
json文件处理(百度翻译).py
json文件处理(百度翻译).py
py
609
python
en
code
0
github-code
21
[ { "api_name": "requests.post", "line_number": 9, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 11, "usage_type": "call" } ]
33900738937
import torch from torchmetrics import Accuracy from utils import AverageMeter from tqdm import tqdm device = 'cuda' if torch.cuda.is_available() else 'cpu' # Train Function def train_one_epoch(model, train_loader, loss_fn, optimizer, epoch=None): model.train() loss_train = AverageMeter() acc_train = Accu...
Ebimsv/Train_CUB-200
train_val_functions.py
train_val_functions.py
py
1,614
python
en
code
2
github-code
21
[ { "api_name": "torch.cuda.is_available", "line_number": 6, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 6, "usage_type": "attribute" }, { "api_name": "utils.AverageMeter", "line_number": 12, "usage_type": "call" }, { "api_name": "torchmetrics...
44094555803
from typing import Any, Optional, List, Dict, Generator import time import tempfile import statistics import gradio import faceswap.globals from faceswap import wording from faceswap.vision import count_video_frame_total from faceswap.core import limit_resources, conditional_process from faceswap.uis.typing import Upd...
GiladLeef/faceswap
faceswap/uis/components/benchmark.py
benchmark.py
py
4,441
python
en
code
1
github-code
21
[ { "api_name": "typing.Optional", "line_number": 14, "usage_type": "name" }, { "api_name": "gradio.Dataframe", "line_number": 14, "usage_type": "attribute" }, { "api_name": "typing.Optional", "line_number": 15, "usage_type": "name" }, { "api_name": "gradio.Checkbox...
28421227673
import csv import datetime import matplotlib.pyplot as plt def parse_time(text): return datetime.datetime.strptime(text, '%Y-%m-%d %H:%M:%S.%f') def load_csv(filename): with open(filename, encoding='utf8') as f: return list(csv.reader(f, delimiter=',')) # id, task, variant, group, time messages = ...
SAleksanyaS/python
34.py
34.py
py
1,171
python
en
code
0
github-code
21
[ { "api_name": "datetime.datetime.strptime", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 7, "usage_type": "attribute" }, { "api_name": "csv.reader", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib...
28623206323
from dbnd._core.parameter import PARAMETER_FACTORY as parameter from dbnd._core.task import Config class HistogramConfig(Config): _conf__task_family = "histogram" spark_parquet_cache_dir = parameter( default=None, description="Enables pre-cache DF using .parquet store at `spark_temp_dir`", ...
kalebinn/dbnd
modules/dbnd/src/dbnd/_core/settings/histogram.py
histogram.py
py
621
python
en
code
null
github-code
21
[ { "api_name": "dbnd._core.task.Config", "line_number": 5, "usage_type": "name" }, { "api_name": "dbnd._core.parameter.PARAMETER_FACTORY", "line_number": 8, "usage_type": "call" }, { "api_name": "dbnd._core.parameter.PARAMETER_FACTORY", "line_number": 13, "usage_type": "ca...
74424862454
from rest_framework import serializers from api.models import Employment from rest_flex_fields.serializers import FlexFieldsSerializerMixin class EmploymentSerializer( FlexFieldsSerializerMixin, serializers.ModelSerializer, ): """ Serializer for Employment model. """ class Meta: model...
utchchhwas/hrxcelerate
backend/api/serializers/employment_serializers.py
employment_serializers.py
py
1,767
python
en
code
1
github-code
21
[ { "api_name": "rest_flex_fields.serializers.FlexFieldsSerializerMixin", "line_number": 7, "usage_type": "name" }, { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 8, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_numbe...
73360943732
from flask import jsonify from flask import request import requests from flask import Blueprint create_api = Blueprint('create_api', __name__) @create_api.route('/create_schedule', methods=['POST', 'GET']) def create_schedule(): if request.method == 'POST': json_data = request.get_json() instance...
anshul-shaive/AWS-Instance-Scheduler
app/api/create.py
create.py
py
1,386
python
en
code
0
github-code
21
[ { "api_name": "flask.Blueprint", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 11, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 11, "usage_type": "name" }, { "api_name": "flask.request....
74677465331
import telebot import constants import requests import pickle import os #from flask import Flask, request import logging #----------------- API_TOKEN = constants.token appid = constants.appid units = "metric" bot = telebot.TeleBot(API_TOKEN) bot.delete_webhook() #server = Flask(__name__) def deserialize(file_name)...
tenebranum/telegramWeatherBot
main.py
main.py
py
4,085
python
en
code
0
github-code
21
[ { "api_name": "constants.token", "line_number": 10, "usage_type": "attribute" }, { "api_name": "constants.appid", "line_number": 11, "usage_type": "attribute" }, { "api_name": "telebot.TeleBot", "line_number": 16, "usage_type": "call" }, { "api_name": "pickle.load...
18846175365
import numpy as np from scipy.optimize import curve_fit ''' Miscellaneous functions used for data reduction/calibration. ''' def damped_osc_amp(f, A, f0, g): '''Fitting function for AMPLITUDE of a damped harmonic oscillator INPUTS: f [Hz], frequency A, amplitude f...
stanfordbeads/OptLevAnalysis
lib/funcs.py
funcs.py
py
5,044
python
en
code
0
github-code
21
[ { "api_name": "numpy.pi", "line_number": 17, "usage_type": "attribute" }, { "api_name": "numpy.pi", "line_number": 18, "usage_type": "attribute" }, { "api_name": "numpy.pi", "line_number": 19, "usage_type": "attribute" }, { "api_name": "numpy.sqrt", "line_numb...
932545386
import pandas as pd import sklearn.metrics as sm from sklearn import tree from sklearn.model_selection import train_test_split from sklearn.ensemble import RandomForestClassifier class Prediction : RF_tree = None def __init__(self): self.chd_data = pd.read_csv("./dataset/framingham1.csv") ...
omkumbhar/heart-diseases-prediction
classification.py
classification.py
py
1,480
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_name": "sklearn.ensemble.RandomForestClassifier", "line_number": 35, "usage_type": "call" } ]
30337395374
import pandas as pd import numpy as np from sklearn.decomposition import PCA from sklearn.preprocessing import StandardScaler from sklearn.linear_model import LogisticRegression from sklearn.svm import SVC from sklearn.ensemble import RandomForestClassifier, GradientBoostingClassifier from sklearn.model_sele...
ganjiajiat/FIT3162_GIT
Machine Learning/pca_experiment.py
pca_experiment.py
py
4,374
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.isnull", "line_number": 19, "usage_type": "call" }, { "api_name": "pandas.isnull", "line_number": 23, "usage_type": "call" }, { "api_name": "pandas.get_dummies", ...
15710652180
import asyncio from typing import Collection, List, Text from unittest.mock import Mock import pytest import rasa.shared.utils.common def test_all_subclasses(): class TestClass: pass subclasses = [type(f"Subclass{i}", (TestClass,), {}) for i in range(10)] sub_subclasses = [ type(f"Sub-s...
xiaolinpeter/rasa2.0_nlu
tests/shared/utils/test_common.py
test_common.py
py
3,582
python
en
code
30
github-code
21
[ { "api_name": "rasa.shared.utils.common.shared.utils.common.all_subclasses", "line_number": 21, "usage_type": "call" }, { "api_name": "rasa.shared.utils.common.shared", "line_number": 21, "usage_type": "attribute" }, { "api_name": "rasa.shared.utils.common", "line_number": 21...
12923174742
from .models import Teams, Round from django.http import JsonResponse def get_ranklist(request): try: _round = request.GET.get('round') team_infos = [i.current_info(_round) for i in Teams.objects.all()] rsp = dict( code=0, data=dict(round=Round.get_round(), team_infos=team_info...
Sindgein/GAC
game2/api.py
api.py
py
2,423
python
en
code
0
github-code
21
[ { "api_name": "models.Teams.objects.all", "line_number": 8, "usage_type": "call" }, { "api_name": "models.Teams.objects", "line_number": 8, "usage_type": "attribute" }, { "api_name": "models.Teams", "line_number": 8, "usage_type": "name" }, { "api_name": "models.R...
15375647650
import matplotlib.pyplot as plt import io import lldb import debugger import base64 import numpy as np import matplotlib matplotlib.use('agg') def show(): image_bytes = io.BytesIO() plt.savefig(image_bytes, format='png', bbox_inches='tight') document = '<html><img src="data:image/png;base64,%s"></html>' %...
vadimcn/codelldb
debuggee/debugvis.py
debugvis.py
py
1,847
python
en
code
2,112
github-code
21
[ { "api_name": "matplotlib.use", "line_number": 8, "usage_type": "call" }, { "api_name": "io.BytesIO", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.savefig", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot"...
43168612077
import argparse import logging import os import shutil import sqlite3 import sys import tempfile from datetime import datetime from zope.component import provideUtility # type: ignore from . import VERSION from .aip import process as aipprocess from .constants import HASH_ALGORITHMS from .sip import addsiparguments ...
NASA-PDS/deep-archive
src/pds2/aipgen/main.py
main.py
py
4,432
python
en
code
8
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 54, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 63, "usage_type": "call" }, { "api_name": "argparse.RawDescriptionHelpFormatter", "line_number": 63, "usage_type": "attribute" }, { ...
14187469192
from datetime import datetime import uuid import json from db import db class Event(db.Model): __tablename__ = 'events' id = db.Column(db.String, primary_key=True, default=str(uuid.uuid4()), unique=True, nullable=False) name = db.Column(db.String) date = db.Column(db.DateTime) picture = db.Colum...
adhiravishankar/countdown-organizer
flaskProject/models.py
models.py
py
620
python
en
code
0
github-code
21
[ { "api_name": "db.db.Model", "line_number": 9, "usage_type": "attribute" }, { "api_name": "db.db", "line_number": 9, "usage_type": "name" }, { "api_name": "db.db.Column", "line_number": 11, "usage_type": "call" }, { "api_name": "db.db", "line_number": 11, ...
36342075248
from dataclasses import dataclass, asdict from typing import List, Optional @dataclass class ProspectorLauncherRequestBody: """ Helper class to create a proper request to Waterfall API for Prospector Launcher endpoint. Detailed documentation here: https://docs.waterfall.to/waterfall-v1-1/endpoints/pr...
matejch/waterfall
models.py
models.py
py
3,738
python
en
code
0
github-code
21
[ { "api_name": "typing.Optional", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 16, "usage_type": "name" }, { "api_name": "typing.Optional", ...