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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
17040080901 | import requests
import time
from bs4 import BeautifulSoup
def ProfessorLunkedInScrapper(
ProfessorName,CollegeName
):
#ProfessorName = "Roel Verstappen"
#CollegeName = "University of Groningen"
query = 'https://google.com/search?q=site:linkedin.com/in AND "'+ProfessorName+'" AND "'+CollegeName+'"'
respo... | brucema94/Expertfinder | LinkedinUrl_From_Name.py | LinkedinUrl_From_Name.py | py | 664 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 20,
"usage_type": "call"
}
] |
10137589364 | '''
File name: /ciphers/block_ciphers/anu/cipher.py
Author: Cesar Cruz
Project: cryptofeather
Python Version: 2.7
'''
import numpy
from constants import BLOCK_LENGTH, KEY_LENGTH, NUMBER_OF_ROUNDS, SBOX, PBOX, SBOX_INV
from utils.logic_operations import xor
from utils.crypto import sbox_operation, permutation_... | ccruz182/Lightweight-Cryptography | cryptofeather/ciphers/block_ciphers/anu/cipher.py | cipher.py | py | 3,372 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "constants.BLOCK_LENGTH",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "constants.BLOCK_LENGTH",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "constants.NUMBER_OF_ROUNDS",
"line_number": 21,
"usage_type": "argument"
},
{
"api_... |
22113638832 | import numpy as np
from grabscreen import grab_screen
import cv2
import time
from directkeys import PressKey, ReleaseKey, W, A, S, D
from grabkeys import key_check
import os
from keras.models import load_model
from scanner import process_img
#loading model
model = load_model('model.h5')
#W key press-time bounds
PRES... | pashok3d/GTA_AutoPilot | predictor.py | predictor.py | py | 2,723 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "keras.models.load_model",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "directkeys.ReleaseKey",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "directkeys.D",
"line_number": 21,
"usage_type": "argument"
},
{
"api_name": "direct... |
10719487359 | import time
import xml.etree.ElementTree as Et
import random
import pathlib
import shutil
from zipfile import ZipFile
def name_for_ik():
"""
:return: выдает имена формата ###-###-###-###-### в шестнадцатиричной системе для интеграционных конвертов
"""
first_part = str(hex(random.randint(1000000000, 99... | Steelglowhawk/updateTool | generator_func.py | generator_func.py | py | 11,827 | python | ru | code | 1 | github-code | 6 | [
{
"api_name": "random.randint",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "random.randint",
"li... |
71888723067 | import numpy
from sklearn.metrics import cohen_kappa_score, classification_report
import torch
from torch.autograd import Variable
from tqdm import tqdm
import torch.nn as nn
from sklearn.metrics import cohen_kappa_score, classification_report
from models import FitNet_4
from torch import optim
import numpy as np
def... | Fivethousand5k/Pytorch-implemented-ECNN | eval.py | eval.py | py | 1,542 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "tqdm.tqdm",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.no_grad",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.autograd.Variable",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.autograd.Variab... |
30165255260 | # Name: Milou Bisseling
# Studentnumber: 10427538
'''
This program converts CSV to JSON
'''
import csv
import json
import sys
inputfile = 'totalbirths.csv'
outputfile = 'totalbirths.json'
fieldnames = ("Perioden", "Enkelvoudige geboorten", "Tweelinggeboorten", "Drie- of meervoudige geboorten")
# Open and read CSV ... | miloubis/DataProcessing | Homework/week-6/convertCSV2JSON.py | convertCSV2JSON.py | py | 559 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "csv.DictReader",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 22,
"usage_type": "call"
}
] |
43755877766 | '''
Measures the square area of colonies in an image file.
Written by George Walters-Marrah
Last updated: 6/26/2019
'''
# import needed packages
import imageio
import matplotlib.pyplot as plt
import scipy.ndimage as ndi
import numpy as np
from skimage import morphology as morph
import os.path
from os ... | gwmarrah/colony-measurer | colSizeMeasurer.py | colSizeMeasurer.py | py | 9,835 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "scipy.ndimage.generate_binary_structure",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "scipy.ndimage",
"line_number": 77,
"usage_type": "name"
},
{
"api_name": "numpy.zeros_like",
"line_number": 78,
"usage_type": "call"
},
{
"api_name":... |
8317691335 | # A script for checking triangular arbitrage opportunities (Forward + Reverse)
# Using a general formula. (Pairs NEED to match the formula)
# ETH/USDT, BTC/USDT, BTC/ETH
# a/b, c/b, c/a
import ccxt
# Insert exchange
testexchange = ccxt.kucoin({
'enableRateLimit': True,
})
# Choose whatever 3 pairs match the g... | AgenP/AgenP-triangular-arb-cex-scanner-v1 | arb_ku_test.py | arb_ku_test.py | py | 2,318 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "ccxt.kucoin",
"line_number": 10,
"usage_type": "call"
}
] |
15805513471 | from tkinter import N
import pygame
from pygame.locals import *
from Car import Car
import sys
import neat
import time
def on_init():
pygame.init()
on_init()
screen_width = 1920
screen_height = 1080
_running = True
screen = pygame.display.set_mode((screen_width, screen_height), pygame.HWSURFACE | pygame.DOUB... | styyxofficial/NEAT-AI-Racecar | Moving_Car.py | Moving_Car.py | py | 4,216 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.init",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "pygame.HWSURF... |
11245689019 | import torch
from torch.utils.data import DataLoader
from transformers import AdamW
from core.qa.utils import (
read_squad,
add_end_idx,
add_token_positions,
tokenizer,
model,
)
train_contexts, train_questions, train_answers = read_squad(
"squad-style-answers.json"
)
train_encodings = tokeni... | expectopatronm/FAQ-Generation-and-SQuaD-Style-QA-Answering-System | core/qa/trainer.py | trainer.py | py | 1,760 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "core.qa.utils.read_squad",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "core.qa.utils.tokenizer",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "core.qa.utils.add_end_idx",
"line_number": 22,
"usage_type": "call"
},
{
"api_na... |
40677441703 | """empty message
Revision ID: 37bd12af762a
Revises: fa12c537244a
Create Date: 2022-09-06 21:29:41.287889
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '37bd12af762a'
down_revision = 'fa12c537244a'
branch_labels = None... | magma/magma | dp/cloud/python/magma/db_service/migrations/versions/020_remove_cpi_related_fields.py | 020_remove_cpi_related_fields.py | py | 1,747 | python | en | code | 1,605 | github-code | 6 | [
{
"api_name": "alembic.op.drop_column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "alembic.op.drop_column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "alembic.op",... |
18128239741 | from django.conf.urls import url, include
from . import views
#app_name = 'dmlpolls'
urlpatterns = [
url(r'^$', views.index, name='poll_index'),
url(r'^(?P<question_id>[0-9]+)/$', views.detail, name='poll_detail'),
url(r'^(?P<question_id>[0-9]+)/results/$', views.results, name='poll_results'),
url(r'^(?P<question... | Yobmod/dmlsite | dmlpolls/urls_old.py | urls_old.py | py | 457 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.co... |
38463867669 | from django.urls import path, re_path
from app import views
urlpatterns = [
# Matches any html file - to be used for gentella
# Avoid using your .html in your resources.
# Or create a separate django app.
re_path(r'^.*\.html', views.gentella_html, name='index'),
# The home page
path('', views.... | pennng/Django-gentella | app/urls.py | urls.py | py | 752 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.re_path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "app.views.gentella_html",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "app.views",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.urls.p... |
41163745392 | import os.path
from compiler import compile_file
from interpreter import VirtualMachine
import sys
if __name__ == '__main__':
if len(sys.argv) < 2:
raise RuntimeError("Not enough argument to start the compiler")
else:
if sys.argv[1] == "--version":
print("0.2.0-dev")
else:
... | blitpxl/soil | soil/soil.py | soil.py | py | 509 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "compiler.compile_file",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line... |
6849069742 | #三方库 xlrd /xlwt / xlutils
import xlrd
import xlwt
import xlutils
wb = xlrd.open_workbook('table/阿里巴巴2020年股票数据.xls')
#获取所有工作表的名字
# print(wb.sheet_names())
# sheet1 = wb.sheet_names('表格1') #通过工作表名获取
sheet = wb.sheet_by_index(0) #通过工作表的下标ID获取工作表
#获取工作表的行数,列数
# print(sheet.nrows,sheet.ncols)
#获取单元格数据 第一行的第一列
for ... | twlaladelala/pytest | 办公自动化.py | 办公自动化.py | py | 732 | python | zh | code | 0 | github-code | 6 | [
{
"api_name": "xlrd.open_workbook",
"line_number": 5,
"usage_type": "call"
}
] |
72592324348 | import configparser
import os
from core.constants import CONFIG_FILE_PATH
__all__ = [
'BotConfigurator'
]
class BotConfigurator(object):
""" Объект-конфигуратор приложения. """
def __new__(cls, *args, **kwargs):
if not hasattr(cls, 'instance'):
cls.instance = super(BotConfigurator,... | balandin-nick/smart-telegram-bot | core/configurator.py | configurator.py | py | 1,174 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "core.constants.CONFIG_FILE_PATH",
"line_number": 21,
"usage_type": "argument"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.path... |
36464449846 | #!/usr/bin/env python
"""
Usage:
python detectface.py -i image.jpg
"""
from argparse import ArgumentParser
import boto3
from pprint import pprint
import sys
def get_client(endpoint):
client = boto3.client('rekognition')
return client
def get_args():
parser = ArgumentParser(description='Detect... | wwwins/aws-utils | detectface.py | detectface.py | py | 830 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "boto3.client",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pprint.pprint",
"li... |
19880677789 | # cython:language_level=3
import numpy as np
from scipy import optimize
import matplotlib.pyplot as plt
deltas = 2000
a = 215
r = 290
def fx(n):
global deltas, a, r
x1 = a+n
x2 = a-n
return deltas - (area(x2, r) - area(x1, r))
def fx1(n):
a = 215
r = 290
x1 = a+n
x2 = a-n
return... | rzyfrank/Internship | cal_deltaArea.py | cal_deltaArea.py | py | 1,006 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.arccos",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "scipy.optimize.bisect",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "scipy.optimize",
"l... |
7795403561 | from data_loader import SimpleDataset
import string
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.optim as optim
import torch.nn.functional as F
from torch.nn.utils.rnn import pack_padded_sequence
from torch.nn.utils.rnn import pad_packed_sequence
import numpy as np
# from run_exp... | geenen124/nlp_project | gru_regression.py | gru_regression.py | py | 12,316 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "torch.nn.Embedding",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line... |
13864700033 | #!/usr/bin/python3.5
# -*-coding:Utf-8 -*
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import make_moons
from sklearn.decomposition import PCA
from matplotlib.ticker import FormatStrFormatter
from RBFKernelPCA import RBF_Kernel_PCA
# We create a dataset of two half moons and project them on... | PiggyGenius/MachineLearning | NoLibraries/RBFKernelPCA/ProjectNewDataPoints.py | ProjectNewDataPoints.py | py | 1,809 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sklearn.datasets.make_moons",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "RBFKernelPCA.RBF_Kernel_PCA",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "n... |
31622032831 | import os
from flask import Flask, flash, request, redirect, url_for, send_from_directory, jsonify
from werkzeug.utils import secure_filename
from excel import Excel
from translator import Translator
UPLOAD_FOLDER = './text_files'
DOWNLOAD_FOLDER = './excel_files'
ALLOWED_EXTENSIONS = {'txt'}
app = Flask(__name__, st... | atakanzen/terminolator.web | app.py | app.py | py | 2,579 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "flask.request.files",
... |
7002219401 | import sendgrid
from ...common import config
sg = sendgrid.SendGridClient(config.sendgrid_api_key)
def send(name, email, subject, html):
message = sendgrid.Mail()
message.add_to('{}'.format(email))
message.set_subject(subject)
message.set_html(html)
message.set_from(config.from_header)
status, msg = sg.sen... | minupalaniappan/gradfire | daviscoursesearch/flaskapp/service/email.py | email.py | py | 330 | python | en | code | 12 | github-code | 6 | [
{
"api_name": "sendgrid.SendGridClient",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "common.config.sendgrid_api_key",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "common.config",
"line_number": 4,
"usage_type": "name"
},
{
"api_name":... |
28128126397 | '''
Count the nodes in the global phylogeny
python3 count_nodes.py after_usher_optimized_fasttree_iter6.tree
'''
import sys
from ete3 import Tree
t = Tree(sys.argv[1])
ct = 0
for node in t.traverse('postorder'):
if node.is_leaf():
ct += 1
print(ct)
| bpt26/parsimony | 2_optimize_starting_tree/results/2.3.5/count_nodes.py | count_nodes.py | py | 270 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "ete3.Tree",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 9,
"usage_type": "attribute"
}
] |
24082328734 | #!/usr/bin/python3
"""
Make petitions to the Reddit API
"""
from requests import get
def number_of_subscribers(subreddit):
"""
Takes a subreddit and compute the quantity of subs
"""
base_url = 'https://www.reddit.com/r/{}/about.json'.format(subreddit)
header = {
'User-Agent': 'Linux:api... | WardenCode/holbertonschool-system_engineering-devops | 0x16-api_advanced/0-subs.py | 0-subs.py | py | 584 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 20,
"usage_type": "call"
}
] |
24025809080 | __author__ = 'sivvaidyanathan'
from urllib2 import urlopen
from bs4 import BeautifulSoup
import codecs, sys
filename = sys.argv[0]
reader = open(filename, 'r')
writer = codecs.open(filename + "_canonical", 'w', 'utf-8')
for line in reader:
url = line.strip()
if url.find("http") == -1:
url = "http://... | sivaramakrishnanvaidyanathan/crawler | histogram/link_canonical.py | link_canonical.py | py | 520 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "codecs.open",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "urllib2.urlopen",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line... |
436459396 | from gensim.corpora import TextCorpus, TextDirectoryCorpus
from gensim.models.doc2vec import TaggedDocument
from trec.treccorpus import TrecCorpus
def test_get_texts():
path = "F:/Corpus/trectest/"
file = path + "fr881.dat"
# with open(file, 'r') as fp:
# print(fp.read())
trecc = TrecCorpus... | kongyq/Project-Arcs | trec/test_treccorpus.py | test_treccorpus.py | py | 2,325 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "trec.treccorpus.TrecCorpus",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "trec.treccorpus",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "gensim.models.doc2vec.TaggedDocument",
"line_number": 46,
"usage_type": "call"
},
{
"a... |
26327096081 | import money
from exceptions import *
from tkinter import *
from datetime import *
from decimal import Decimal
import math
import re
from tkinter import messagebox
from dateutil.rrule import *
from parkomat_interface import ParkomatInterface
class ParkomatFunctions:
""" Klasa realizująca funkcjonalności programu ... | DZietara/parkomat | main/parkomat_functions.py | parkomat_functions.py | py | 18,188 | python | pl | code | 0 | github-code | 6 | [
{
"api_name": "datetime.now",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "decimal.Decimal",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "parkomat_interface.ParkomatInterface",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "tki... |
26538911991 | import hashlib
import os.path
from typing import List, Optional
import requests
from connectors.Triage.const import TRIAGE_URL, TRIAGE_LAST_100_RESULTS_FROM_NOW, TRIAGE_HEADER, OUTPUT_FOLDER
from connectors.utils import upload_file_to_malstream
def get_last_100_analysis() -> List:
r = requests.get(f"{TRIAGE_URL... | CorraMatte/malstream | connectors/Triage/connector.py | connector.py | py | 1,374 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "connectors.Triage.const.TRIAGE_URL",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "connectors.Triage.const.TRIAGE_LAST_100_RESULTS_FROM_NOW",
"line_number": 12,
"usage_type... |
5292164947 | #right now, I am using this script to play around w/ differnt definitions of signal and control regions
import ROOT
from TIMBER.Analyzer import HistGroup, CutGroup
from TIMBER.Tools.Common import CompileCpp
from argparse import ArgumentParser
from XHYbbWW_class import XHYbbWW
from collections import OrderedDict
def K... | michaelhesford/XHYbbWW_semileptonic | MXvsMY_studies.py | MXvsMY_studies.py | py | 8,394 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "TIMBER.Analyzer.HistGroup",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 117,
"usage_type": "call"
},
{
"api_name": "ROOT.TFile.Open",
"line_number": 127,
"usage_type": "call"
},
{
"api_name": "R... |
18464680736 | #!/usr/bin/python3
#encoding: utf-8
import requests
import re
from bs4 import BeautifulSoup
import json
#登录获取cookie
login_url = "http://210.30.1.140/index.php/Public/checkLogin"
#登录信息
logindata={
"txtName":"2015083216",
"txtPass":"2015083216",
"txtCheck":"no",
}
#获取cookie
logind = requests.p... | chinazhenzhen/PythonLearn | RE4/5+.py | 5+.py | py | 1,019 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.post",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 38,
"usage_type": "call"
}
] |
15260123974 | import datetime
import hashlib
import json
from flask import Flask, jsonify
# Building a Blockchain
class Blockchain:
def __init__(self):
"""
Create Blockchain and a genesis block
"""
self.chain = []
self.create_block(proof=1, previous_hash='0')
def create_block(self, ... | imnishant/Blockchain | main.py | main.py | py | 3,966 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "hashlib.sha256",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "json.dump... |
71916477308 | # coding:utf-8
from PyQt5.QtWidgets import QWidget, QGridLayout, QVBoxLayout, QSizePolicy, QListWidgetItem, QAbstractItemView
from PyQt5.QtCore import pyqtSignal
from qfluentwidgets import ListWidget, PrimaryPushButton, PillPushButton, FluentIcon, InfoBar
from common.style_sheet import StyleSheet
from common.config ... | xfz329/pk4adi_calculator | view/operate_interface.py | operate_interface.py | py | 10,462 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.pyqtSignal",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtCore.pyqtSignal",
"line_number": 19,
"usage_type": "call"
},
{
"api_name"... |
72532296829 | # pylint:disable=unused-argument
# pylint:disable=redefined-outer-name
from contextlib import contextmanager
from typing import Any, AsyncIterable, Callable, Iterator
from unittest.mock import AsyncMock
import pytest
from faker import Faker
from fastapi import FastAPI, status
from httpx import HTTPError, Response
fro... | ITISFoundation/osparc-simcore | services/director-v2/tests/unit/test_modules_dynamic_sidecar_client_api_public.py | test_modules_dynamic_sidecar_client_api_public.py | py | 11,510 | python | en | code | 35 | github-code | 6 | [
{
"api_name": "pydantic.parse_obj_as",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "pydantic.AnyHttpUrl",
"line_number": 39,
"usage_type": "argument"
},
{
"api_name": "pytest.fixture",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "pyd... |
39610762661 | from nltk.corpus import brown
import nltk
cfd = nltk.ConditionalFreqDist(
(genre,word)
for genre in brown.categories()
for word in brown.words(categories=genre))
genre_word = [(genre, word)
for genre in ['news']
for word in brown.words(categories=genre)]
print(len(genre_word))
print(genre_word[:5]) | milliongashawbeza/PublicNLPA | counting_words.py | counting_words.py | py | 319 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "nltk.ConditionalFreqDist",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.brown.categories",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.brown",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "... |
33186103812 | from simplejson import dumps
from webob import Response
from pycurl import Curl
from subprocess import Popen, PIPE
from multiprocessing import Queue
from traceback import format_exc
from time import sleep
import logging
import tarfile
import os
import os.path
import urllib
import uuid
import sys
import os
from config... | JeremyGrosser/repoman | repoman/buildbot.py | buildbot.py | py | 7,178 | python | en | code | 84 | github-code | 6 | [
{
"api_name": "os.chdir",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "logging.debug",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "subprocess.Popen",
"line_number"... |
926386452 | import os
from unittest.mock import patch
import pytest
from rotkehlchen.db.dbhandler import DBHandler
from rotkehlchen.externalapis.etherscan import Etherscan
from rotkehlchen.tests.utils.mock import MockResponse
from rotkehlchen.typing import ExternalService, ExternalServiceApiCredentials
@pytest.fixture(scope='f... | fakecoinbase/rotkislashrotki | rotkehlchen/tests/external_apis/test_etherscan.py | test_etherscan.py | py | 2,080 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rotkehlchen.db.dbhandler.DBHandler",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "rot... |
38544511106 |
import cv2
import mss
from PIL import Image
import numpy as np
import time
import json
import math
with open('Crypt.json', 'r') as json_file:
data = json.load(json_file)
with open('ItemGroups.json', 'r') as json_file:
item_data = json.load(json_file)
# record video of screen using cv2
fps = 30
fourcc = cv2.Vi... | debug-it/DarkAndDarker-MapHelper | record.py | record.py | py | 4,278 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.VideoWriter_fourcc",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.VideoWriter",
"lin... |
9345182500 | from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
import lib.db
from lib.helper import remove_tags, open_selenium
from lib.log import log_text as log
url = "https://2e.aonprd.com/Ancestries.aspx"
def upload_heritage_data():
log("S... | sean-francis113/pf2edatascraper | lib/heritages.py | heritages.py | py | 13,500 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "lib.log.log_text",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "lib.log.log_text",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "lib.log.log_text",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "lib.db.db.query_da... |
16312524711 | import jax.numpy as np
from jax import grad, nn, random, jit
from jax.experimental import stax, optimizers
from jax.experimental.optimizers import l2_norm
from jax.numpy import linalg
from jax.experimental.stax import Dense, Relu, Tanh, Conv, MaxPool, Flatten, Softmax, LogSoftmax, Sigmoid
from jax.tree_util import tree... | ChrisWaites/data-deletion | src/d2d/projected_mnist/debug_for_seth.py | debug_for_seth.py | py | 2,756 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "jax.nn.log_sigmoid",
"line_number": 16,
"usage_type": "argument"
},
{
"api_name": "jax.experimental.stax.serial",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "jax.experimental.stax.Relu",
"line_number": 22,
"usage_type": "argument"
},
{
... |
14852849903 | from collections import ChainMap
import yaml
with open('eve_static_data/invFlags.yaml') as flags_file:
INV_FLAGS = {item['flagID']: item for item in yaml.full_load(flags_file)}
INVENTORY_POSITIONS = [
*range(92, 99+1), # Rigs
*range(27, 34+1), # High Slots
*range(19, 26+1), # Med Slots
*range(... | DeForce/py_killboard | helpers/static.py | static.py | py | 386 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "yaml.full_load",
"line_number": 6,
"usage_type": "call"
}
] |
70383323069 | import copy
from typing import List, Optional
def deep_merge_dicts(original: dict, new_dict: dict) -> dict:
"""
Overview:
Merge two dicts by calling ``deep_update``
Arguments:
- original (:obj:`dict`): Dict 1.
- new_dict (:obj:`dict`): Dict 2.
Returns:
- merged_dict (:o... | opendilab/GoBigger | gobigger/utils/config_utils.py | config_utils.py | py | 2,978 | python | en | code | 483 | github-code | 6 | [
{
"api_name": "copy.deepcopy",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line... |
73500508668 | import argparse
import copy
import csv
import os
import warnings
import numpy
import torch
import tqdm
import yaml
from torch.utils import data
from nets import nn
from utils import util
from utils.dataset import Dataset
warnings.filterwarnings("ignore")
def learning_rate(args, params):
def fn(x):
retu... | jahongir7174/YOLOv5-pt | main.py | main.py | py | 14,941 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "nets.nn.yolo_v5_n",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "nets.nn",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "torch.nn",
"lin... |
34961662452 | import pandas as pd
import matplotlib.pyplot as plt
import warnings
warnings.filterwarnings('ignore')
class DynamicEvolutionStats:
def __init__(self, seeds, specialist_type):
self.seeds = seeds
self.specialist_type = specialist_type
self.init_data()
def init_data(self):
self.da... | arthur-plautz/curriculum-learning | models/specialist/stats/dynamic_evolution_stats.py | dynamic_evolution_stats.py | py | 2,023 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.concat... |
43967691056 | #!/usr/bin/env python
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="split blast results by organism")
parser.add_argument("blast", type=argparse.FileType("r"))
args = parser.parse_args()
blast = [x.split("\t") for x in args.blast.readlines()]
for row in ... | TAMU-CPT/galaxy-tools | tools/blast/split_blast.py | split_blast.py | py | 576 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "argparse.FileType",
"line_number": 6,
"usage_type": "call"
}
] |
31877451015 | import os
import math
import copy
import codecs
import numpy as np
import srt
import subprocess
import datetime
from utils import mkdir, basename_without_ext
from voice_detector import VoiceDetector
from tqdm import tqdm
def shift_by_delay(bin_arr2, delay_by_frames):
if delay_by_frames < 0:
return bin_arr... | derrick56007/getsub | src/get_sub.py | get_sub.py | py | 6,510 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "numpy.concatenate",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "numpy.concatenate",
... |
41714902184 | from Crypto.Util.number import getPrime
from Crypto.Util.number import inverse
import hashlib
import socket
from threading import Thread
host = 'localhost'
port = 6000
mysocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try :
mysocket.connect((host, port))
except socket.error :
print("connexio... | samyberkane23/chat_s-curis- | client.py | client.py | py | 2,458 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "socket.socket",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREAM",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "socket.erro... |
11214657296 | import pika
import sys
conn = pika.BlockingConnection(pika.URLParameters('amqp://guest:guest@localhost:25672/%2F'))
channel = conn.channel()
channel.exchange_declare(exchange='direct_logs', exchange_type='direct')
severity = sys.argv[1] if len(sys.argv) > 1 else 'info'
message = ' '.join(sys.argv[2:]) or "Hello Worl... | lamida/rabbit-hole | 04-routing/emit_log_direct.py | emit_log_direct.py | py | 465 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pika.BlockingConnection",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pika.URLParameters",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
... |
4397925600 | from multiprocessing import Process,Array
from time import time
import sqlite3
from .config import KASTEN_ANZ,VOK_DIR
class vokabelKartei(Process):
def __init__(self):
self.conn = sqlite3.connect(VOK_DIR+"kartei.sqlite")
self.conn.text_factory = str
self.c = self.conn.cursor()
self... | tuxor1337/voktrainer | vok/core/kartei.py | kartei.py | py | 7,065 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "multiprocessing.Process",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "sqlite3.connect",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "config.VOK_DIR",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "config.KASTEN_ANZ... |
30543883588 | from . import pblm
import sys
import torch
import torch.nn as nn
class CNN_A(pblm.PrebuiltLightningModule):
def __init__(self, classes):
super().__init__(self.__class__.__name__)
# Model Layer Declaration
self.conv1 = nn.Conv1d(1, 16, kernel_size=5, stride=2)
self.conv2 = nn.Conv1... | kendreaditya/heart-auscultation | src/models/modules/CNN/CNN.py | CNN.py | py | 1,135 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "torch.nn.Conv1d",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv1d",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number"... |
22397762010 | import cv2
import pandas as pd
import numpy as np
from PIL import Image
from torch.utils.data import Dataset
class COVIDChestXRayDataset(Dataset):
def __init__(self, path, size=128, augment=None):
super(COVIDChestXRayDataset, self).__init__()
print('{} initialized with size={}, augment={}'.format(s... | defeatcovid19/defeatcovid19-net-pytorch | datasets/covid_chestxray_dataset.py | covid_chestxray_dataset.py | py | 2,205 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "pandas.read_csv",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.concat... |
30709482723 |
import cv2 as cv
import numpy as np
from process import Resize, NormalizeImage
class PicoDetProcess():
def __init__(self,
trainsize=[320,320],
mean=[0.485,0.456,0.406],
std=[0.229,0.224,0.225],
score_threshold=0.4,
nms_thres... | guojin-yan/Automatic_aiming | aiming/person_process.py | person_process.py | py | 6,767 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "process.Resize",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "process.NormalizeImage",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"... |
35782338526 | #%%
import numpy as np
import matplotlib.pyplot as plt
#%%
x = np.arange(0, 6 * np.pi, 0.025)
y_true = np.sin(x)
y = y_true + np.random.normal(scale=1, size=len(x))
plt.scatter(x, y, color="k")
plt.plot(x, y_true, color="red")
#%%
np.random.seed(42)
from sklearn.ensemble import HistGradientBoostingRegressor
from sk... | moritzwilksch/DataScienceEducation | ML-Basics/fancy_gif.py | fancy_gif.py | py | 1,801 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "numpy.arange",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "numpy.sin",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.random.normal",
"line_num... |
73979398907 | #!/usr/bin/env python3
import telebot
from telebot import types
import sqlite3
sqll = [0]
bot = telebot.TeleBot("TOKEN", parse_mode=None)
conn = sqlite3.connect('SQLdb.db', check_same_thread=False)
cursor = conn.cursor()
def updateUserBalance (id: int, balans: int):
cursor.execute('UPDATE users SET balans=? WH... | thebilderberg/telegram_bot_github | star_bot.py | star_bot.py | py | 10,747 | python | ru | code | 0 | github-code | 6 | [
{
"api_name": "telebot.TeleBot",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "telebot.types.ReplyKeyboardRemove",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "tele... |
10918154737 | import os
import ast
import subprocess
import uuid
import json
import hashlib
import socket
import psutil
from ipykernel.ipkernel import IPythonKernel
def make_except_safe(code):
code = code.replace('\n', '\n ')
code = 'try:\n ' + code
code = code + '\nexcept: pass\n'
try:
ast.parse(code)
... | depaul-dice/sciunit-NBv1 | __main__.py | __main__.py | py | 4,282 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "ast.parse",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.expanduser",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_nu... |
23061764300 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import urllib.request
import re
import os
import random
import time
from time import sleep
import json
from collections import OrderedDict
def dropSameListEle(inList):
outList=[]
for x in inList:
if x not in outList and x != '':
outList.append(x)
... | pplost/for-test | tools/新建文件夹/fetch - 副本.py | fetch - 副本.py | py | 3,180 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "urllib.request.request.Request",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 30,
"usage_type": "name"
},
{
"api_nam... |
32505732795 | # -*- coding: utf-8 *-
import pprint
import re
import sys
import importlib
from Symfopy.Component.HttpFoundation import Request, Response
class Router(object):
var_regex = re.compile(r'\{(\w+)(?::([^}]+))?\}')
def __init__(self, routes = {}):
self.routes = dict()
for name in routes:
... | alculquicondor/Symfopy | vendor/Symfopy/Component/Routing.py | Routing.py | py | 3,380 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "re.compile",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "importlib.import_module",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "re.escape",
"line_n... |
41860678548 | import logging
log = logging.getLogger(__name__)
import re
import requests
from bs4 import BeautifulSoup
try:
# Python 2 has a standard urlparse library
from urlparse import urlparse, ParseResult
except:
# Python 3 has the same library hidden in urllib.parse
from urllib.parse import urlparse, ParseRes... | xethorn/metadata_parser | metadata_parser/__init__.py | __init__.py | py | 25,325 | python | en | code | null | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "re.I",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "re.compile",
"line_number":... |
25226116736 | from sklearn import datasets
import pandas as pd
iris = datasets.load_iris()
iris_df = pd.DataFrame(iris.data)
iris_df.columns = iris.feature_names
iris_df['target'] = iris.target
# original target = 0,1,2 int32
print(iris_df.target)
# changing them by using DF.astype(type)
print(iris_df.target.astype(float)) | HawkingLaugh/Data-Processing-Using-Python | Week4/28. inconsistent_data_handling.py | 28. inconsistent_data_handling.py | py | 313 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sklearn.datasets.load_iris",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "pandas.DataFrame",
"line_number": 5,
"usage_type": "call"
}
] |
34197263982 | import sys, math
from math import pi as pi
import numpy as np
import cv2
from PyQt5.QtCore import QPoint, QRect, QSize, Qt, QPointF, QRectF, pyqtSignal, QTimer
from PyQt5.QtGui import (QBrush, QConicalGradient, QLinearGradient, QPainter, QPainterPath, QPalette, QPen, QPixmap, QPolygon, QRadialGradient, QColor, QTransfo... | RoboticsLabURJC/2016-tfg-irene-lope | AutoPark_Practice/referee.py | referee.py | py | 19,643 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.pyqtSignal",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QGridLayout",
"line_number": 20,
"usage_type": "call"
},
{
"api_n... |
41646398531 | """ Module containing routines to setup the training of policies.
"""
import argparse
from typing import Optional, Sequence
from aizynthfinder.training.utils import Config
from aizynthfinder.training.keras_models import (
train_expansion_keras_model,
train_filter_keras_model,
train_recommender_keras_model,... | AlanHassen/modelsmatter | aizynthfinder/training/training.py | training.py | py | 1,085 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "typing.Optional",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.Sequence",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "aizynthfinder... |
3116557557 |
import torch
import torch.nn as nn
from torch.optim import Adam
import torch.nn.functional as F
from random import randint
import numpy as np
# import subprocess
# import multiprocessing
# import concurrent.futures
from time import time
from math import sqrt
CHANNEL = 256
BLOCKNUM = 40
BOARDSIZE = 8
BATCH = 50
EPOCHS... | wxwoo/yanxue | train_py.py | train_py.py | py | 12,641 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"lin... |
35425394354 | from yaml_parser import parse_yaml
from voluptuous import Schema,Object, Range, Coerce, All, Any, Optional, Lower, Invalid
import re
import sys
import argparse
"""
Python YAML validator
"""
list_of_ints = All([Coerce(int)], msg='invalid list of ints')
from datetime import datetime
def check_date(datestring):
try... | philippmack/europython2015-pmack | config/validator.py | validator.py | py | 1,633 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "voluptuous.All",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "voluptuous.Coerce",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.... |
2736199577 | import keras
from keras import backend as K
from keras.callbacks import Callback
import numpy as np
class BitsLogger(Callback):
def __init__(self, nConvs=9, **kwargs):
self.norm = 1./np.log(float(nConvs))
self.bits_history=[]
self.filterLayers=[]
super(BitsLogger, self).__init__(**kwargs)
def o... | twoev/APEMEN | utils/callbacks.py | callbacks.py | py | 2,012 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "keras.callbacks.Callback",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "numpy.log",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "keras.backend.flatten",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "keras.backend... |
3749581806 | import glob
import platform
import setuptools
import Cython.Build
# By compiling this separately as a C library, we avoid problems
# with passing C++-specific flags when building the extension
lrslib = ('lrslib', {'sources': glob.glob("solvers/lrs/*.c")})
cppgambit = setuptools.Extension(
"pygambit.lib.libgambit"... | vignesh7056/gambit | src/setup.py | setup.py | py | 2,265 | python | en | code | null | github-code | 6 | [
{
"api_name": "glob.glob",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "setuptools.Extension",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number"... |
36090200838 | """Some useful functions to deal with GitHub."""
import datetime
from github import Github
from github import UnknownObjectException
import click
class GitHubMux:
"""Class that let's you operate in multiple repos of the same org at the same time."""
def __init__(self, organization, token, exclude):
... | napalm-automation/tooling | gh_tools/github_helpers.py | github_helpers.py | py | 13,728 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "github.Github",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "github.UnknownObjectException",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "click.secho",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "click.secho",... |
43256048913 | import os
import xlsxwriter
# Change basepath if applicable
basepath = "C:\\Users\\AYuen\\Environmental Protection Agency (EPA)\\ECMS - Documents\\newfiles\\"
workbook = xlsxwriter.Workbook(basepath+'fileandid.xlsx')
worksheet = workbook.add_worksheet("Sheet 1")
# Start from the first cell.
# Rows and columns are z... | USEPA/Document_Processing_Scripts | getidfilename.py | getidfilename.py | py | 827 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "xlsxwriter.Workbook",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": ... |
18598274205 | import requests
from data_access.openWeatherMap.client import OpenWeatherMap
from business_logic.services import GetWeatherService
from config import OWM_API_KEY, OWM_BASE_URL
from .server import Request, Response
def get_weather_controller(request: Request) -> Response:
cities = request.params.get('query')[0]
... | pyteacher123/py35-onl | weather_app_refactored/presentation/web/application.py | application.py | py | 2,199 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "server.Request",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "requests.Session",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "data_access.openWeatherMap.client.OpenWeatherMap",
"line_number": 11,
"usage_type": "call"
},
{
"a... |
14835956764 | import torch
import torchaudio
import numpy as np
import opensmile
from collections import namedtuple
from .scan_data import scan_rootdir, CHANNELS
from .load_data import load_anno_tensor, load_vad_df
from .segment_data import SegmentEgs
class ChunkOpenSmileDataSet:
def __init__(self, rootdir,
... | medbar/maga_sis | 3/ULM/utils/chunk_opensmile_dataset.py | chunk_opensmile_dataset.py | py | 3,414 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "scan_data.CHANNELS",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "opensmile.Smile",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "opensmile.FeatureSet",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "opensmil... |
73787039549 | """
Code to explore the PDF and CDF of weight distributions.
We use truncated lognormals to define the distribution of excitatory connections.
We scale that by -8 for inhibitory connections.
We represent the inhibitory connections with a negative number as a convention to be consistent
with the network simulator (NEST... | comp-neural-circuits/tctx | tctx/analysis/wdist.py | wdist.py | py | 4,725 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "numpy.linspace",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.diff",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "scipy.interpolate.interpolate.interp1d",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "scip... |
32605878813 | import discord
import youtube_dl
from bot_token import TOKEN
if not TOKEN:
raise ValueError("Please add your token to bot_token.py")
client = discord.Client()
@client.event
async def on_message(message):
if message.author== client.user :
return
elif message.content.startswith("*l"):
msg =... | F3YoD/Bot-python | tamer2.py | tamer2.py | py | 669 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "bot_token.TOKEN",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "discord.Client",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bot_token.TOKEN",
"line_number": 29,
"usage_type": "argument"
}
] |
74142898108 | from django.http import JsonResponse
from django.shortcuts import render
# Create your views here.
from django.views.generic import View
from django_redis import get_redis_connection
from redis import StrictRedis
from apps.goods.models import GoodsSKU
from utils.common import LoginRequiredViewMixin, BaseCartView
cl... | xmstu/dailyfresh2 | dailyfresh/apps/cart/views.py | views.py | py | 4,266 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "utils.common.BaseCartView",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "django_redis.get_redis_connection",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "django.http.JsonResponse",
"line_number": 39,
"usage_type": "call"
},
{
... |
43529823665 | # -*- coding: utf-8 -*-
"""
Created on Fri Mar 22 11:51:37 2019
@author: javie
"""
import plotly_express as px
from plotly.offline import plot
def pl(df, r, var):
tmp = df[df.randomSeed.isin(r)]
plot(px.line(tmp, height=300 * len(r), x="tick",
y = var,
color="FirmNumID"... | javiergarciasanchez/businessCycles | businessCycles/exploreData/Python/Graphs_plotly.py | Graphs_plotly.py | py | 871 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "plotly.offline.plot",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "plotly_express.line",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "plotly.offline.plot",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "plotly_ex... |
14003038546 | from app.custom_queue import CustomQueue
from app.logger import get_logger
from datetime import datetime, timedelta
LOGGER = get_logger(__name__)
QUEUE_MAX_SIZE = 20
class Queues():
def __init__(self):
self.LS = CustomQueue(QUEUE_MAX_SIZE, 'LeftSingle')
self.LT = CustomQueue(QUEUE_MAX_SIZE, 'Left... | ViniciusLinharesAO/ski-slope-problem-uece-ppc | app/queues.py | queues.py | py | 3,005 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "app.logger.get_logger",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "app.custom_queue.CustomQueue",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "app.custom_queue.CustomQueue",
"line_number": 12,
"usage_type": "call"
},
{
"ap... |
6066153310 | import pygame
from _draw import *
from _utils import *
class gui():
def __init__(self,
white,
screen,
width,
height,
smallNokiaFont,
hugeNokiaFont,
font,
bigFont,
hugeFont,
smallFont,
nanoFont,
themeColo... | murchie85/bumdee | _gui.py | _gui.py | py | 12,565 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.image.load",
"line_number": 103,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 103,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.load",
"line_number": 104,
"usage_type": "call"
},
{
"api_name": "pygame.image... |
42539411350 | from django.shortcuts import render, redirect
from .models import *
import os
from django.conf import settings
from django.http import HttpResponse
import json
# Create your views here.
def cargarInicio(request):
productos = Producto.objects.all()
producto_perros = Producto.objects.filter(categoria_id=1)
... | GuillermoVillacuraTorres/PGY3121-012D | django/apps/Tienda/views.py | views.py | py | 2,897 | python | es | code | null | github-code | 6 | [
{
"api_name": "django.shortcuts.render",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 41,
"usage_type": "call"
},
{
"api_nam... |
39255343614 | from django.conf.urls import url
from network.views import views_auth
from network.views import views_app
urlpatterns = [
# Main page
url(r'^home/(?P<msg>.*)$', views_auth.main_page, name="Home"),
# url(r'$', views_auth.main_page, name="Home"),
# Auth urls
url(r'^login/(?P<info>.*)$', views_aut... | Sipleman/Course-work_SocialNetwork | network/urls.py | urls.py | py | 1,612 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.conf.urls.url",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "network.views.views_auth.main_page",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "network.views.views_auth",
"line_number": 11,
"usage_type": "name"
},
{
... |
10422164463 | from __future__ import annotations
import traceback
from PySide6 import QtWidgets
from randovania.games.prime2.patcher.claris_randomizer import ClarisRandomizerExportError
def create_box_for_exception(val: Exception) -> QtWidgets.QMessageBox:
box = QtWidgets.QMessageBox(
QtWidgets.QMessageBox.Critical,... | randovania/randovania | randovania/gui/lib/error_message_box.py | error_message_box.py | py | 1,513 | python | en | code | 165 | github-code | 6 | [
{
"api_name": "PySide6.QtWidgets.QMessageBox",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "PySide6.QtWidgets",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "PySide6.QtWidgets.QMessageBox",
"line_number": 12,
"usage_type": "attribute"
},
{
... |
75342220666 | from django.shortcuts import render
from .forms import getData, getTraningInfo
import requests
from bs4 import BeautifulSoup
from datetime import date, datetime
import folium
import geocoder
# Create your views here.
runs = {}
def calculate_difference(key):
run_date_str = runs[key]["date"][:10] + " 0:0:0"
t... | kaczorwarka/Running-Events-Search-Engine-and-Traning-Plan-Generator | runsite/views.py | views.py | py | 26,067 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "da... |
34493734325 | from typing import Dict, List, Optional, Tuple, Union
from flask import (
abort, g, jsonify, render_template, request, make_response, Response
)
from werkzeug.exceptions import (
BadRequest, Forbidden, HTTPException, InternalServerError, NotFound
)
from plot_weather import (BAD_REQUEST_IMAGE_DATA,
... | pipito-yukio/plot_weather_flaskapp | src/plot_weather/views/app_main.py | app_main.py | py | 26,178 | python | ja | code | 0 | github-code | 6 | [
{
"api_name": "plot_weather.app.config",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "plot_weather.app",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "plot_weather.app.config",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_na... |
21051188362 | from django.db import models
from django_countries.fields import CountryField
from product.models import product, product_version
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
from django.contrib.auth import get_user_model
User = get_user_model()
from decimal import Decimal
from django.con... | Shafag42/SuperB_E-commerce | order/models.py | models.py | py | 7,334 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.db.models.Model",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 11,
"usage_type": "name"
},
{
"ap... |
1360579310 | import pandas as pd
import pathlib as pl
import numpy as np
import RootPath
from abc import abstractmethod
from Utils.Data.Features.RawFeatures import *
from Utils.Data.Dictionary.MappingDictionary import *
def map_column_single_value(series, dictionary):
mapped_series = series.map(dictionary).astype(np.int32)
... | MaurizioFD/recsys-challenge-2020-twitter | Utils/Data/Features/MappedFeatures.py | MappedFeatures.py | py | 8,608 | python | en | code | 39 | github-code | 6 | [
{
"api_name": "numpy.int32",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pandas.DataFrame",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.NA",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"l... |
9179526990 | import os
import stat
import string
from absl.testing import absltest
from src.test.py.bazel import test_base
# pylint: disable=g-import-not-at-top
if os.name == 'nt':
import win32api
class LauncherTest(test_base.TestBase):
def _buildJavaTargets(self, bazel_bin, binary_suffix):
self.RunBazel(['build', '//fo... | bazelbuild/bazel | src/test/py/bazel/launcher_test.py | launcher_test.py | py | 26,523 | python | en | code | 21,632 | github-code | 6 | [
{
"api_name": "os.name",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "src.test.py.bazel.test_base.TestBase",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "src.test.py.bazel.test_base",
"line_number": 12,
"usage_type": "name"
},
{
... |
10242082365 | # -*- coding: utf-8 -*-
"""The Simulator takes in a :obj:`seagull.Board`, and runs a simulation given a
set number of iterations and a rule. For each iteration, the rule is applied to
the Board in order to evolve the lifeforms. After the simulation, run
statistics are returned.
.. code-block:: python
import seag... | ljvmiranda921/seagull | seagull/simulator.py | simulator.py | py | 6,209 | python | en | code | 167 | github-code | 6 | [
{
"api_name": "board.Board",
"line_number": 74,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"line_number": 86,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 115,
"usage_type": "name"
},
{
"api_name": "numpy.ndarray",
"line_n... |
1592231392 | import asyncio
from flask import Blueprint, abort, flash, redirect, render_template, request, jsonify, url_for, Response
from werkzeug.utils import secure_filename
import socket
from flask_socketio import SocketIO, emit
from app import app, db, socketio
import os
import time
HOST = "127.0.1.1"
WEBSOCKET_PORT = 9999
CH... | isaacbrasil/My-youtube-flask | app/blueprints/client.py | client.py | py | 5,180 | python | pt | code | 0 | github-code | 6 | [
{
"api_name": "flask.Blueprint",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "app.db.Model",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "app.db",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "app.db.Column",
"line_nu... |
35049082181 | """
3D convolutions using GPU accelereration for Theano (using conv2d)
https://github.com/jaberg/TheanoConv3d2d
"""
import theano
from theano.gradient import DisconnectedType
from theano.gof import Op, Apply
from theano import tensor
import theano.sandbox.cuda as cuda
def get_diagonal_subtensor_view(x, i0, i1):
... | lpigou/Theano-3D-ConvNet | convnet3d/conv3d2d.py | conv3d2d.py | py | 10,163 | python | en | code | 83 | github-code | 6 | [
{
"api_name": "theano.gof.Op",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "theano.tensor.as_tensor_variable",
"line_number": 97,
"usage_type": "call"
},
{
"api_name": "theano.tensor",
"line_number": 97,
"usage_type": "name"
},
{
"api_name": "theano.t... |
70337573629 | import math
import copy
import numpy as np
import pprint
import torch
import torch.nn as nn
import torch.nn.functional as F
from fvcore.nn.precise_bn import get_bn_modules, update_bn_stats
import slowfast.models.losses as losses
import slowfast.models.optimizer as optim
import slowfast.utils.checkpoint as cu
import sl... | alimottaghi/slowfast | tools/train_mme.py | train_mme.py | py | 22,644 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "slowfast.utils.logging.get_logger",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "slowfast.utils.logging",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "slowfast.models.optimizer.get_epoch_lr",
"line_number": 88,
"usage_type": "call"... |
14731423365 | from datetime import datetime
import pandas as pd
import pydash as _
from bs4 import BeautifulSoup
from Base import NSEBase
class NSE(NSEBase):
"""
A class to interact with NSE (National Stock Exchange) API.
Attributes:
valid_pcr_fields : list of valid fields for put-call ratio calc... | Sampad-Hegde/Bharat-SM-Data | Bharat_sm_data/Derivatives/NSE.py | NSE.py | py | 13,281 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "Base.NSEBase",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
"line_number": 48,
"usage_type": "name"
},
{
"api_name": "pandas.DataFrame",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "pandas.json_normalize... |
17388621437 | # Import necessary Tkinter and sqlite3 libraries.
import tkinter as tk
import sqlite3
from sqlite3 import Error
from PIL import Image, ImageTk
import tkinter.messagebox as messagebox
# Making things object oriented, define a class.
class School_Data:
'''Constructor to initialize the GUI window'''
def __init__(... | rohan-sahuji/Repo1 | Tkinter_GUI.py | Tkinter_GUI.py | py | 17,391 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tkinter.Tk",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tkinter.Menu",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "tkinter.Menu",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "tkinter.Menu",
"line_number"... |
44042814684 | import pandas as pd
import re
import graphlab as gl
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.decomposition import NMF
from nltk.stem.wordnet import WordNetLemmatizer
from helper import *
class Registries(object):
def __init__(self, filepath):
self.filepath = filepath
... | vynguyent/Expecting-the-unexpected | Model/registries.py | registries.py | py | 4,677 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "nltk.stem.wordnet.WordNetLemmatizer",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "re.spli... |
34711984830 | # Coding Math Episode 2
# Display a sine wave
import pygame
import math
import numpy as np
pygame.init()
RED = pygame.color.THECOLORS['red']
screen = pygame.display.set_mode((800, 600))
screen_rect = screen.get_rect()
print(f"Size of the screen ({screen_rect.width}, {screen_rect.height})")
screen_fonts = pygame.font... | piquesel/coding-math | ep2.py | ep2.py | py | 1,397 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.init",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.color",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygame.display",
... |
75079239548 | from dal import autocomplete
from django import forms
from .models import Tag
class TForm(forms.ModelForm):
class Meta:
model = Tag
fields = ('Tag_name')
widgets = {
'Tag_name': autocomplete.ModelSelect2(url='test')
}
| codebottlehun/WithMe | tag/forms.py | forms.py | py | 270 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "models.Tag",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "dal.autocomplete.Mo... |
70281053308 | from typing import Dict, Any, Union, Optional, List
import torch
import numpy as np
from overrides import overrides
from transformers import ViltProcessor
from PIL import Image
from allennlp.data.fields.field import DataArray
from allennlp.data.fields.metadata_field import MetadataField
class ViltField(MetadataFiel... | esteng/ambiguous_vqa | models/allennlp/data/fields/vilt_field.py | vilt_field.py | py | 1,820 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "allennlp.data.fields.metadata_field.MetadataField",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "transformers.ViltProcessor",
"line_number": 21,
"usage_type": "name"
},
... |
9369376357 | import pyodbc
cnxn = pyodbc.connect("DRIVER={ODBC Driver 17 for SQL Server};"
"Server=DESKTOP-0A2HT13;"
"Database=Databricks;"
"UID=prajwal;"
"PWD=Prajwal082;"
"Trusted_Connection=yes;")
cursor = cnxn.cursor... | Prajwal082/Main | postgres.py | postgres.py | py | 814 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pyodbc.connect",
"line_number": 3,
"usage_type": "call"
}
] |
36079540438 | import atexit
import json
import logging
import os
# needs install
import websocket
from log.timeutil import *
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
handler = logging.StreamHandler()
handler.setLevel(logging.DEBUG)
logger.addHandler(handler)
import log.encoder
try:
import thread
except I... | yasstake/mmf | log/bitws.py | bitws.py | py | 6,831 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.DE... |
73675802426 | # This script fills the newly created point geofield
# coding=utf-8
import os, sys
proj_path = "/home/webuser/webapps/tigaserver/"
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tigaserver_project.settings")
sys.path.append(proj_path)
os.chdir(proj_path)
from django.core.wsgi import get_wsgi_application
applicati... | Mosquito-Alert/mosquito_alert | util_scripts/create_aimsurv_experts.py | create_aimsurv_experts.py | py | 5,288 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "os.environ.setdefault",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"li... |
38776144324 | import os
import webbrowser
from shutil import copyfile
import random
import cv2
import pickle
from moviepy.editor import *
from flask import Flask, render_template, redirect, url_for, request
from flaskwebgui import FlaskUI
pickle_base = "C:\\Users\\AI\\AIVideo_Player\\data\\"
image_directory = 'C:\\Users\... | olusegvn/VideoPlayer | engine/AIVideoPlayerBackend.py | AIVideoPlayerBackend.py | py | 7,987 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.isfile",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "pickle.load",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pickle.dump",
"line_numbe... |
31272615348 | # -*- coding: utf-8 -*-
"""Image transformation test meant to be run with pytest."""
import sys
import pytest
from confmap import ImageTransform
from confmap import HyperbolicTiling
sys.path.append("tests")
def test_tilesAndTransform():
im=ImageTransform('./examples/sample1.png',0,data=None
... | FCoulombeau/confmap | tests/test_tilesAndTransforms.py | test_tilesAndTransforms.py | py | 1,016 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "confmap.ImageTransform",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "confmap.Hyperbol... |
11415062176 | """
[
[
[
"M: How long have you been teaching in this middle school?",
"W: For ten years. To be frank, I'm tired of teaching the same textbook for so long though I do enjoy being a teacher. I'm considering trying something new."
],
[
{
"questio... | nli-for-qa/conversion | qa2nli/qa_readers/dream.py | dream.py | py | 4,251 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "reader.DatasetReader",
"line_number": 51,
"usage_type": "name"
},
{
"api_name": "re.compile",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
... |
5671705163 | import random
import uuid
import pytest
from aws.src.database.domain.dynamo_domain_objects import Tenure, HouseholdMember, TenuredAsset, Asset, AssetTenure, \
Patch, Person, PersonTenure
def test_generates_tenure(tenure_dict: dict):
tenure = Tenure.from_data(tenure_dict)
assert isinstance(tenure, Tenur... | LBHackney-IT/mtfh-scripts | aws/tests/domain/test_dynamo_domain_objects.py | test_dynamo_domain_objects.py | py | 8,127 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "aws.src.database.domain.dynamo_domain_objects.Tenure.from_data",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "aws.src.database.domain.dynamo_domain_objects.Tenure",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "aws.src.database.domain.dynam... |
26095879865 | import os
import sys
import torch
import torch.nn.functional as F
from torch.utils.tensorboard import SummaryWriter
import Optimizer
writer = SummaryWriter('./runs')
grad_clip = 1.0 # clip gradients at an absolute value of
save_prefix=''
def clip_gradient(optimizer, grad_clip):
# """
# 剪辑反向传播期间计算的梯度,以避免梯度爆炸。
#
# p... | dubochao/CNN-sentiment-analysis | train.py | train.py | py | 5,496 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.utils.tensorboard.SummaryWriter",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "os.ma... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.