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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
38652739468 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 10 14:06:11 2018
Self Similar Neural Network, in PyTorch
NOTE: PyTorch for Windows runs only on Python 3. This script was written in
Python 3.6.
@author: Piotr Ozimek
"""
from __future__ import print_function
import matplotlib.pyplot as plt
import ... | Pozimek/RetinaVision | retinavision/ssnn.py | ssnn.py | py | 7,737 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "pickle.dump",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "torch.cuda.memory_allocated",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "torch.cuda.me... |
20406399625 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 과학창의재단 연수 신청에서 개인정보수정중 소속학교 찾기 및 선택 버튼이 보이지 않아 셀레니엄으로 해결함.
from selenium import webdriver
URL = 'http://lms.kofac.re.kr'
# 사이트 접속하기
driver = webdriver.Chrome('/Users/mac/Documents/coding_python/python_crawling/chromedriver_mac')
print('사이트에 접속중..')
driver.get(URL)
#... | 951237/python_crawling | 크롤링_과학창의재단_로그인/200823_크롤링_셀레니엄_보이지 않는 버튼 클릭하기.py | 200823_크롤링_셀레니엄_보이지 않는 버튼 클릭하기.py | py | 732 | python | ko | code | 0 | github-code | 18 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 11,
"usage_type": "name"
}
] |
6752997788 | from datetime import timedelta
from users.tasks import collect_user_reading_stats
import pytest
from django.contrib.auth import get_user_model
from django.urls import reverse
from django.utils import timezone
from rest_framework import status
from rest_framework.test import APIClient
from users.models import User
... | VTeteruk/reading_time_api | users/tests/test_users.py | test_users.py | py | 3,113 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "users.models.User",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "r... |
70924664680 | # -*- coding: utf-8 -*-
from numba import njit, types
from numba.extending import overload
from quartical.utils.numba import JIT_OPTIONS
import numpy as np
from collections import namedtuple
extent_tuple = namedtuple(
"extent_tuple",
(
"row_starts",
"row_stops",
"chan_starts",
... | ratt-ru/QuartiCal | quartical/gains/general/convenience.py | convenience.py | py | 3,704 | python | en | code | 6 | github-code | 18 | [
{
"api_name": "collections.namedtuple",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numba.njit",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "quartical.utils.numba.JIT_OPTIONS",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "nu... |
19398601883 | import os
import re
import sys
import time
from PyQt5 import QtCore, QtGui
from PyQt5.QtCore import QTimer
from PyQt5.QtGui import QIcon, QPainter, QColor, QFont
from PyQt5.QtWidgets import QApplication, QMainWindow, QFileDialog, QMessageBox
import method
import port
from sscom import Ui_MainWindow
c... | DockyJ/smart-hydrant-parameter-configuration-tool | main.py | main.py | py | 24,702 | python | zh | code | 0 | github-code | 18 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "sscom.Ui_MainWindow",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtGui.QIcon",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "PyQ... |
11919538389 | #mendapatkan daftar direktori dengan pathlib.Path.iterdir()
from pathlib import Path
import traceback as tb
folder = r"E:\TESTING"
try:
dirPath = Path(folder)
listDir = dirPath.iterdir()
except BaseException as be:
be = tb.format_exc()
print("Error: ", be)
else:
print("Listdir: ", listDir)
pr... | biokomub/bukupython38-39 | Bab 9/kode940.py | kode940.py | py | 389 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pathlib.Path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "traceback.format_exc",
"line_number": 12,
"usage_type": "call"
}
] |
11399491453 | import boto3
import botocore
import json
import os
from deepdiff import DeepDiff
from aws.utils import get_client, _backoff, _backoff2, key_val_search
class AbstractResource:
def __init__(self, resource_file, resource_dir):
# --> Directories
self.resource_dir = resource_dir
self.store_... | seakers/VASSAR_resources | aws/AbstractResource.py | AbstractResource.py | py | 3,007 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.join",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 2... |
24653729298 | import copy
import datetime
import json
from loguru import logger
from tweepipe import settings
def extract_likes(uid, tweet, db_conn):
like_relation = get_like_relation(uid, tweet)
db_conn.add_like_relation(like_relation)
tweet_doc = _format_tweet_doc(tweet)
db_conn.add_tweet(tweet_doc)
def get_l... | sachalevy/tweepipe | tweepipe/legacy/utils/extract.py | extract.py | py | 9,887 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "loguru.logger.info",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "loguru.logger",
"line_number": 52,
"usage_type": "name"
},
{
"api_name": "json.dumps",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptim... |
7046740486 | import datetime as d
print("-------------------------------------------------------",end = '\n')
print("-------------------------------------------------------",end = '\n')
print(" HEALTH MANAGEMENT SYSTEM ")
print("-------------------------------------------------------",end = '\n')
pri... | Vuvek/Task-in-Python | Health management system.py | Health management system.py | py | 1,905 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "datetime.datetime.now",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 19,
"usage_type": "attribute"
}
] |
22262962131 | # Splitting array
# Required modules
import numpy as np
import os
from sklearn.model_selection import train_test_split
def split_data(path, percentage_training, percentage_testing):
for arr_name in os.listdir(path):
# Creating the path to array
arr_path = os.path.join(path, arr_name)
# Load the array
ar... | BrewBrizzly/DSS | 4_Model_Preparation/Data_Split/split.py | split.py | py | 2,583 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "os.listdir",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.load",
"line_number": ... |
17937116645 | from main import get_temperature
from unittest import mock
from unittest.mock import patch
import pytest
'''
Valores a serem utilizados no teste off-line
lat = -14.235004
lng = -51.92528
temperature = 62
expected = 16
'''
'''
Função que define a chave que queremos acessar no JSON da Requisição
e atribui um valor es... | joaomxm/DesafiosAceleradevPython-Codenation | aceleradevPython_Desafio3/test_main.py | test_main.py | py | 2,292 | python | pt | code | 0 | github-code | 18 | [
{
"api_name": "main.get_temperature",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "unittest.mock.patch",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "unittest.mock",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "pytest.mark.pa... |
38558576115 | import os
from pickletools import optimize
import mlflow
from mlflow.tracking import MlflowClient
import pytorch_lightning as pl
import torch
from torch.nn import functional as F
from torch.utils.data import DataLoader
from torchvision import transforms
import torch.nn as nn
import torch.nn.functional as F
import torc... | takumi2786/MLFlow | examples/training/pytorch-model/train.py | train.py | py | 3,301 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "mlflow.set_tracking_uri",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
... |
11686772520 | from nltk.corpus import movie_reviews
from pymongo import MongoClient
client = MongoClient()
db = client.twitter
all_tweets = db.all
maga_tweets = db.maga
def movie_words(sentiment):
sentiment_words = movie_reviews.fileids(sentiment)
words = {}
for file_id in sentiment_words:
for word in movie_re... | esabelhaus/socially-distorted | process.py | process.py | py | 2,862 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.movie_reviews.fileids",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.movie_reviews",
"line_number": 11,
"usage_type": "name"
},
{
"ap... |
10246022052 |
from rest_framework.response import Response
from .models import Rating, User
from django.http import JsonResponse
from django.forms.models import model_to_dict
import json
from django.views.decorators.csrf import csrf_exempt
@csrf_exempt
def rate(request):
try:
data = json.loads(request.body)
us... | felgonmar/TFG_API | nba_backend/rating.py | rating.py | py | 3,488 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "json.loads",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.http.JsonResponse",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.http.JsonResponse",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "models.U... |
70511782120 | import functools as fnt
import importlib
import logging
import os
import weakref
from contextlib import contextmanager
from copy import deepcopy
import warnings
import confect.prop_type
from confect.error import (
ConfGroupExistsError,
FrozenConfGroupError,
FrozenConfPropError,
UnknownConfError,
P... | d2207197/confect | confect/conf.py | conf.py | py | 17,061 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "confect.error.ParameterError",
"line_number": 94,
"usage_type": "call"
},
{
"api_name": "warnings.warn",
"line_number": 99,
"usage_type": "call"
},
{
"api_name": "confect.... |
74909777961 | import pathlib
import re
from typing import List
def read_inputs(input_file: str) -> List[List[str]]:
with pathlib.Path(input_file).open() as fp:
lines = fp.readlines()
regex = re.compile(r"([a-g]+)")
return [
["".join(sorted(string)) for string in regex.findall(line)] for line in lines
... | ZeldaZach/AdventOfCode2021 | entries/day08/main.py | main.py | py | 7,543 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "pathlib.Path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 6,
"usage_type": "name"
}
] |
31137530450 | import os
from collections import Counter
import time
import argparse
import torch
from my_io import Vocabulary
def read_src_trg_files(opt, tag="train"):
'''
Read data according to the tag (train/valid/test), return a list of (src, trg, img) pairs
'''
if tag == "train":
src_file = opt.train_sr... | yuewang-cuhk/CMKP | unified_model/preprocess.py | preprocess.py | py | 8,145 | python | en | code | 21 | github-code | 18 | [
{
"api_name": "collections.Counter",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "my_io.Vocabulary",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "my_io.Vocabu... |
13260766844 | import matplotlib.pyplot as plt
#A
x = float()
y = float()
Xdots = []
Ydots = []
for x in range(-50, 50):
if x < 1:
Xdots.append(x)
y = x + 2
Ydots.append(y)
if x >= 1:
Xdots.append(x)
y = (x**2) - 6*x + 10
Ydots.append(y)
plt.plot(Xdots, Ydots, 'g.... | BoneSAWcoder/LABSINF1Kurs | lab5/LAB5EX2.py | LAB5EX2.py | py | 337 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.show",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "matpl... |
33489932755 | import pymongo
import os
from urllib.parse import urlparse
class __MongoUtil():
def __init__(self):
self.mongodbUri = os.environ.get('MONGODB_URI')
if not self.mongodbUri:
raise Exception()
self.client = pymongo.MongoClient(self.mongodbUri)
self.dbname = urlparse(self.mongodbUri).path[1:]
def... | cuhey3/mydsl | py/mydsl/dsl_mongo.py | dsl_mongo.py | py | 1,607 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.environ.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "urllib.parse.urlpars... |
31160476072 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 26 13:41:17 2019
@author: huyuemei
"""
import numpy as np
import pandas as pd
from scipy.stats import norm
import matplotlib.pylab as plt
from matplotlib.ticker import PercentFormatter
def DynamicHedge(stepN,paths=50000,S0=100,sigma=0.2,r=0.05,T=1... | Isabella-yuan/Isabella-Yuan | Stochastic Modelling in Finance/part4.py | part4.py | py | 3,148 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.linspace",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.c_",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.random.randn",
"li... |
25354888481 | #coding:utf-8
# 使用matplotlib绘制折线图
import matplotlib.pyplot as plt
import numpy as np
# 在一个图形中创建两条线
fig = plt.figure(figsize=(10,6))
ax1 =fig.add_subplot(1,1,1)
ax1.set_xlabel('number')
ax1.set_ylabel('rates')
ax1.set_title("Line chart")
ax1.plot([13, 14, 15, 16], [0.2, 0.8, 0.5, 0.4])
ax1.plot([13, 14, 15, 16], [0.... | binshenhoubaobao/scrapy_project | matplot/demo1.py | demo1.py | py | 416 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.savefig",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "ma... |
4429725489 | import sys
sys.path.append('./example/test-factories')
from controlplane_factory import ControlPlaneFactory
from dataplane_factory import DataPlaneFactory
from data_provider import DataProvider
from collections import namedtuple
import unittest
import sys
import logging
import ptf
import pytest
import allure
from ptf i... | AutomatedOwl/ptf-pytest | example/example-tests/ptf_example_testcase.py | ptf_example_testcase.py | py | 2,688 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "sys.path.append",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "unittest.TestCase",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "pytest.logger",
... |
21129250874 | # -*- coding: utf-8 -*-
"""
Created on Thu Mar 8 21:49:28 2018
@author: wuwangchuxin
"""
import os
os.chdir('D:/yh_min-mfactors')
from alphaFuncs_min_240 import *
from address_data import *
import pandas as pd
import feather as ft
################ 因子计算结果没有 '600485.SH'(停牌)
# 先验证分钟行情数据的时间范围,分钟和日范围
files = os.listdir... | wuwangchuxinybf/yh_min-mfactors | cal_min.py | cal_min.py | py | 1,173 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "os.chdir",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "feather.read_dataframe",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.read_excel",
"li... |
26144492421 | import os
import re
from threading import current_thread
import config
import random
import bs4
import requests
import zipfile
from urllib.parse import urljoin
#判断目标字串中是否包含给定串,若包含,返回最先出现的串,若不包含,返回None
def re_(link_str):
pattern = config.pattern
res = None
idx_res = len(link_str)
for p in pattern:
... | yhl1999/pcap_cothey | function.py | function.py | py | 3,954 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "config.pattern",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "urllib.parse.urljo... |
34292144649 | import logging
from fastapi import FastAPI, HTTPException
from typing import Optional, List
import traceback
from pydantic import BaseModel, ValidationError
import base64
import tcpclient
import tools
from tools import HOST, PORT
from messaging import MessageType
import asyncio
import aiohttp
import time
app = FastAPI... | kkonevets/vec_search | app/main.py | main.py | py | 3,756 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
... |
25096850303 | ##########################################################################
##########################################################################
##########################################################################
# NO LONGER USED - WRAPPED INTO OBJECT
########################################################... | metaopslabs/snowflake_deployer | src/wrangler/object_types/wrangle_column.py | wrangle_column.py | py | 1,978 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "json.loads",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "src.util.util.remove_prefix",
"line_number": 27,
"usage_type": "call"
}
] |
947628168 | import cv2
# For video
frameWidth = 640
frameHeight = 480
# read through default camera
capVideoCam = cv2.VideoCapture(0)
# 3 is default width & 4 is default height defined by openCV
capVideoCam.set(3, frameWidth)
capVideoCam.set(4, frameHeight)
# declare loop to read each frame
while True:
# success is a flag... | rohit-chandra/OpenCV | Code/ReadWebcam.py | ReadWebcam.py | py | 621 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_number": 24,
"usage_type": "call"
}
] |
37589637945 | import requests
from bs4 import BeautifulSoup
import csv
melon_url = 'https://www.melon.com/chart/index.htm'
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36'
}
# 1. 순위 / 가수 / 노래제목을 뽑아서 프린트
# 3. 2번에서 만든 데이터로 csv 작성
respo... | jung9156/studies | lecture/python/python_csv/melon_ranking.py | melon_ranking.py | py | 1,683 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "csv.DictWriter",
"line_number": 37,
"usage_type": "call"
}
] |
31501234588 | from django.shortcuts import render, redirect
from search.models import SearchHistory
def index(request):
CURRENT_USER = request.session.get('account')
search_history = SearchHistory.objects.filter(searcher_id=CURRENT_USER).order_by('-searched_at')[:5]
context = {'search_history': search_history}
#... | gilbertlim/121 | mysite/home/views.py | views.py | py | 1,309 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "search.models.SearchHistory.objects.filter",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "search.models.SearchHistory.objects",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "search.models.SearchHistory",
"line_number": 8,
"usage_... |
16748650604 | import pytest
import numpy as np
from cockatoo.belief import *
from joint_dependency.inference import (same_segment, likelihood_dependent,
likelihood_independent)
parametrize_n = pytest.mark.parametrize("n", [100, 1000, 10000])
@pytest.fixture
def belief_2d():
belief = Joi... | hildensia/cockatoo | tests/test_belief.py | test_belief.py | py | 3,524 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "pytest.mark.parametrize",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.array",
... |
160101081 | import os
from typing import List, Optional
class MaterialNotFound(Exception):
def __init__(self, label: str):
self.label = label
def __str__(self):
return "No material found"
class MissingMaterialPercentage(Exception):
def __init__(self, material: str, label: str):
self.label =... | Vestiis/clothing-rater | src/exceptions.py | exceptions.py | py | 2,297 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "typing.Optional",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"li... |
18561984985 | import boto3
import io
import base64
import requests
import json
def handler(event, context):
aws_access_key_id=os.environ['aws_access_key_id']
aws_secret_access_key=os.environ['aws_secret_access_key']
bucket_id = event['messages'][0]['details']['bucket_id']
object_id = event['messages'][0]['details... | Samurai9/YandexFaceDetection | vvot21-face-detection.py | vvot21-face-detection.py | py | 2,396 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "boto3.session.Session",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "boto3.session",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "io.BytesIO",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "base64.b64encode"... |
10655970074 | import torch
from torch import nn
from torch.autograd import Variable
import numpy as np
def get_wav(in_channels, pool=True):
"""wavelet decomposition using conv2d"""
harr_wav_L = 1 / np.sqrt(2) * np.ones((1, 2))
harr_wav_H = 1 / np.sqrt(2) * np.ones((1, 2))
harr_wav_H[0, 0] = -1 * harr_wav_... | CCECfgd/MSCDN-master | wave_u_net.py | wave_u_net.py | py | 10,603 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "numpy.sqrt",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 10,
... |
5329008800 | import numpy as np
import matplotlib.pyplot as plt
from Dense import Dense
from TanHFunc import Tanh
from LossFuncs import MSE, MSE_prim
from NetworkFuncs import predict, train
X = np.reshape([[0,0],[0,1],[1,0],[1,1]],(4,2,1))
Y = np.reshape([[0],[1],[1],[0]], (4,1,1))
network = [
Dense(2,3),
Tanh(),
Den... | Voland24/NeuralNet | XOR_solver.py | XOR_solver.py | py | 741 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.reshape",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "Dense.Dense",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "TanHFunc.Tanh",
"line_numb... |
12747662964 | # -*- coding: UTF-8 -*-
import os
import numpy as np
from PIL import Image
import tensorflow as tf
from captcha_setting import CGAN_BATCH_SIZE
from src.GAN.utils.one_hot_encoding import encode
class DatasetHelper:
def __init__(self, folder, height, width, letters=None):
self.height = height
self... | Alexander-Zadorozhnyy/CGAN_CAPTCHA_SOLVER | src/GAN/models/dataset_helper.py | dataset_helper.py | py | 2,289 | python | en | code | 5 | github-code | 18 | [
{
"api_name": "os.listdir",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
... |
40162257103 | from app import models
from app.database import get_db
from fastapi import Response,status,HTTPException,Depends,APIRouter
from app.schemas import UserCreate,UserOut
from typing import List
from sqlalchemy.orm import Session
from app.utils import hash
router =APIRouter(prefix="/users",tags=['Users'])
@router.get('/'... | minbala/example-fastapi | app/routers/user.py | user.py | py | 2,027 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "fastapi.Depends",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "app.database.... |
73540656360 | import pandas as pd
import numpy as np
import datetime as dt
import sys
from user_agents import parse
from geolite2 import geolite2
path = sys.argv[1]
saida = sys.argv[2]
puro = pd.read_fwf(path, header=None)
array = puro.loc[(puro[1].isnull())][0]
puro = pd.DataFrame({"linha":array })
dados = puro[~puro["linha"].str.c... | TiagoTiburcio/data-sets | notebooks/teste.py | teste.py | py | 3,130 | python | pt | code | 0 | github-code | 18 | [
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_fwf",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line... |
27524742178 | import qutip as qtp
import numpy as np
from typing import List
supported_solvers = ["mesolve"]
def integrate(
tlist: np.ndarray,
state_in: qtp.qobj.Qobj, # it can be given as ket or density matrix
hamil0: qtp.qobj.Qobj,
drive: List[qtp.qobj.Qobj],
pulse: List[np.ndarray], # we could add the opt... | cianibegood/pysqkit | pysqkit/solvers/solvkit.py | solvkit.py | py | 2,259 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "numpy.ndarray",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "qutip.qobj",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "qutip.qobj",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "typing.List",
"... |
12980041203 | import sys
import threading
from os.path import abspath
from os import system
from math import floor, ceil
from time import sleep
from itertools import zip_longest
import pygame
from pygame.display import init
from pygame.locals import *
from grid import Grid
from pygame_textinput import TextInput
if system("python -... | Agroovy/Animated-Addition | main.py | main.py | py | 8,643 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.system",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pygame.init",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pygame.time.Clock",
"line_number":... |
27729878888 | """
Peppercorn Notepad
Simple notepad using python and QtGui wrapper.
Author: Peppercorn
Version: 2020.April
"""
from PyQt5.QtWidgets import QWidget, QApplication, QMainWindow, QTextEdit, QVBoxLayout, QAction, QFileDialog
from PyQt5.QtWidgets import QMessageBox, QFontDialog
from PyQt5.QtGui import Q... | AnweshDahal/QNotepad | QtNotePad.py | QtNotePad.py | py | 6,838 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QMainWindow.__init__",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 20,
"usage_type": "name"
... |
6003421227 | from matplotlib import pyplot as plt
class Heat():
def __init__(self, dx, dt, x_end, t_end, coef, b, function_t0):
self.dx = dx
self.dt = dt
self.x_end = x_end
self.t_end = t_end
self.coef = coef
self.b = b
self.t0 = function_t0
self.t = []
self.x = []
# Allocating memory
... | jbarba87/heat_equation_python | heat.py | heat.py | py | 1,451 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "matplotlib.pyplot.ion",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 51,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.clf",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "matplot... |
43188127890 | #!/bin/env python3
import argparse
import os
import sys
from jinja_helpers import get_environment_secrets
try:
import jinja2
import requests
import yaml
from jinja2.meta import find_undeclared_variables
except ModuleNotFoundError as e:
print("Please install python modules requests, jinja2 and (ru... | SUNET/cnaas-nms | src/cnaas_nms/tools/generate_esi.py | generate_esi.py | py | 5,664 | python | en | code | 66 | github-code | 18 | [
{
"api_name": "sys.exit",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 23,... |
29079887501 | import re
import collections
f = open('text.txt', 'r')
filetext = f.read()
f.close()
# 2. Разбейте полученные текст на предложения.
# Примечание: Напоминаем, что в русском языке предложения заканчиваются на ., ! или ?.
# Решение:
li = re.split('\. |\.\n|\!|\?', filetext)
for item in li:
print(item)
# print(li)... | GrishinAnton/python-start | OOP-course/regExp/main.py | main.py | py | 2,139 | python | ru | code | 0 | github-code | 18 | [
{
"api_name": "re.split",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number... |
22922490948 | from setuptools import setup, find_packages
VERSION = '0.0.1'
DESCRIPTION = 'LazyBugged'
LONG_DESCRIPTION = 'Python package'
setup(
name="lazybugged",
version=VERSION,
author="Max Base and Tarunav.BA",
author_email="tarunavba@gmail.com",
description=DESCRIPTION,
long_... | LazyBugged/special-meme-webpage | setup.py | setup.py | py | 797 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "setuptools.setup",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 14,
"usage_type": "call"
}
] |
28493674630 | import nltk
import re
# all codes are run with python 3.7
# pretty print function for visualisation of the tree cannot be used with python 3.8
# install nltk using pip
# uncomment the two lines below for the first time you run the code
# nltk.download('punkt')
# nltk.download('averaged_perceptron_tagger')
# from cgi im... | Sandeep-Kothapalli/BTP | DP/main.py | main.py | py | 3,363 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "nltk.parse.corenlp.CoreNLPDependencyParser",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "nltk.stem.snowball.SnowballStemmer",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "nltk.parse.CoreNLPParser",
"line_number": 23,
"usage_type":... |
33498040420 | from django.urls import path
from .views import user, staff
app_name = "reviews"
urlpatterns = [
# User views
path("<slug:slug>/submit/", user.quiz_submit_for_review_view, name="submit"),
path(
"<slug:slug>/cancel_review/",
user.quiz_cancel_review_view,
name="cancel_review",
... | DirectDuck/django_quiz_app | apps/reviews/urls.py | urls.py | py | 1,064 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.urls.path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "views.user.quiz_submit_for_review_view",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "views.user",
"line_number": 10,
"usage_type": "name"
},
{
"api_name"... |
22180457220 | from collections import defaultdict, Counter
def open_input():
with open("input.txt") as fd:
array = [i.split("-") for i in fd.read().splitlines()]
array = [(x, y) for x, y in array]
return array
def check_point(path, cave):
cavecounts = Counter(path)
if cave == 'start':
return F... | anolivei/advent_of_code_2021 | day12_Passage_Pathing/day12.py | day12.py | py | 1,332 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "collections.Counter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 24,
"usage_type": "call"
}
] |
34224375479 | import os
from dotenv import load_dotenv
import datetime
import pandas as pd
import numpy as np
import plotly.graph_objs as go
import dash
from dash import dcc, html
from dash.dependencies import Input, Output
import requests
import yfinance as yf
import dash_bootstrap_components as dbc
from dash.exceptions import Prev... | Ollstar/CAPM-stock-dashboard | app.py | app.py | py | 12,342 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
... |
71969727719 | # coding: utf-8
from functools import update_wrapper
from django.conf import settings
from django.contrib import admin
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.shortcuts import get_object_or_404, redirect
from django.template.loader import render_to_string
from djan... | fcoelho/wict | submission/admin.py | admin.py | py | 3,746 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "functools.update_wrapper",
"line_number": 30,
"usage_type": "call"
},
{
... |
16068193491 | #!/usr/bin/env python
#coding=utf-8
# explain:从阿里云导出账单明细,根据账单明细计算汇总各产品明细,需要接收一个参数,参数为excel表名
# 导出阿里云账单:费用-->费用账单-->账单明细-->统计项(费用),统计周期(按天)-->导出账单csv
import openpyxl
import json
import sys
import datetime
import os
class statisticsAliyunBill():
def __init__(self, file_name):
self.name = file_name
# 根... | tanxiaoshu/python_script | get_aliyun_bill_pro_detail.py | get_aliyun_bill_pro_detail.py | py | 4,103 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "openpyxl.load_workbook",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_n... |
6035604459 | from django.urls import path
from . import views
urlpatterns = [
path('home/', views.home, name='home'),
path('cliente/', views.cliente, name='cliente'),
path('loja/', views.loja, name='loja'),
path('entregador/', views.entregador, name='entregador'),
path('loja/produto_add/', views.produto... | OnlyLemonsGameStudio/ProjetoFinal_IntensivoDev | projeto01/homeboy/urls.py | urls.py | py | 763 | python | pt | code | 0 | github-code | 18 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"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",
... |
3543392008 | import pandas as pd
import numpy as np
from collections import Counter
from math import sqrt
# Normalize
def normalize(value, minimum, maximum):
return (value - minimum) / (maximum - minimum)
# Calculate Euclidian Distance
def euclidean_distance(value1, value2):
edistance = 0.0
for x, y in np.nditer([va... | eichstaedtk/ke-python | k-nearest-neighbour.py | k-nearest-neighbour.py | py | 1,872 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.nditer",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"lin... |
25887295975 | """
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time:2022/3/31 10:30
# @Author:YiShouquan
# @File:generator_show.py
# @Update:
"""
import time
from collections import defaultdict
import datetime
# 统计一个文件的里面的单词数量
def count_words(filename):
counts = defaultdict(int)
time.sleep(1)
return counts
def ge... | SolYee/Python-Advanced-Programming | week01-02/generator_show.py | generator_show.py | py | 1,029 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "collections.defaultdict",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "datetime.d... |
24772681020 | import six
from .customeditor import AbstractCustomEditor
from ....core.qt import QtCore, QtWidgets, py_to_variant, variant_to_py
class LanguageEditor(QtWidgets.QComboBox, AbstractCustomEditor):
"""A ComboBox that shows a list of languages, the editor takes
as its value the ISO code of the language"""
ed... | Platanen/camelot | camelot/view/controls/editors/languageeditor.py | languageeditor.py | py | 2,546 | python | en | code | null | github-code | 18 | [
{
"api_name": "core.qt.QtWidgets.QComboBox",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "core.qt.QtWidgets",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "customeditor.AbstractCustomEditor",
"line_number": 6,
"usage_type": "name"
},
{
... |
2973690437 | import unittest
from irrf import Income
from exceptions import ValorRendimentoInvalidoException, DescricaoEmBrancoException
from parameterized import parameterized
class IncomeTestCase(unittest.TestCase):
@parameterized.expand([
(2500, 'Salary'),
(500, 'Rent'),
(25, 'Nubank Interest'),
... | durvalcarvalho/calculadora-irrf-tec-prog | irrf/test/test_income.py | test_income.py | py | 1,550 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "unittest.TestCase",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "irrf.Income",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "parameterized.parameterized.expand",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "... |
27376921305 | from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
def get_requirements():
req = []
for line in open('requirements.txt', 'r'):
... | x4121/SSHKeyDistribut0r | setup.py | setup.py | py | 2,363 | python | en | code | null | github-code | 18 | [
{
"api_name": "os.path.abspath",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_number":... |
15906578209 | from typing import Any, Callable, Dict, Optional, Union
import torch
import torch.nn.functional as F
from torch import nn
# Lit Diffusion DDPM
from lit_diffusion.ddpm.util import extract_into_tensor
from lit_diffusion.ddpm.constants import DDPMDiffusionTarget, DDPMLossType
# Lit Diffusion
from lit_diffusion.diffusi... | AlexanderLontke/lit-diffusion | src/lit_diffusion/ddpm/lit_ddpm.py | lit_ddpm.py | py | 7,255 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "lit_diffusion.diffusion_base.lit_diffusion_base.LitDiffusionBase",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "lit_diffusion.ddpm.constants.DDPMDiffusionTarget",
"line_number... |
41672267083 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is dis... | gunny26/pydedupfs | MetaStorage.py | MetaStorage.py | py | 12,937 | python | en | code | 5 | github-code | 18 | [
{
"api_name": "logging.debug",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 55,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_number"... |
39521916052 | from django.core.urlresolvers import reverse_lazy
from django.http import HttpResponseRedirect
from django.shortcuts import render, render_to_response
from django.views import generic
from .forms import UploadFileForm, SelectAlgorithmForm
from .utils import analyzer, utils
class IndexView(generic.TemplateView):
... | curioswati-zz/crypt-analyzer | cryptanalyzer/base/views.py | views.py | py | 6,547 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "django.views.generic.TemplateView",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.views.generic",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.views.generic.TemplateView",
"line_number": 14,
"usage_type": "attribu... |
18550850975 | import requests
import json
from PIL import Image
import shutil
num_of_quotes = 20
key = ''
api_url = 'https://api.breakingbadquotes.xyz/v1/quotes/{0}'.format(num_of_quotes)
print()
response = requests.get(api_url)
json_data = json.loads(response.text)
#json_data = []
quotes = {}
names = set()
question = None
for d... | andylewi/api-assignment | file.py | file.py | py | 2,011 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": ... |
39229098789 | import os
import base64
import boto3
from cryptography.fernet import Fernet
import sys
import click
@click.command()
@click.option('--input_file', default='test', help='path to file containing secret msg')
def encrypt(input_file):
cmk_id = os.environ["cmk"]
encrypted_secret_file_path = input_file.split(".")[0] + "_... | research-scife/secret-share | encrypt.py | encrypt.py | py | 921 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.environ",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "boto3.client",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "base64.b64encode",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "cryptography.fernet.Fer... |
29547234725 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from collections import defaultdict
import argparse
import cv2 # NOQA (Must import before importing caffe2 due to bug in cv2)
import glob
import logging
import os
import... | facebookresearch/Detectron | tools/infer_simple.py | infer_simple.py | py | 4,986 | python | en | code | 26,012 | github-code | 18 | [
{
"api_name": "detectron.utils.c2.import_detectron_ops",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "detectron.utils.c2",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "cv2.ocl.setUseOpenCL",
"line_number": 32,
"usage_type": "call"
},
{
"a... |
9061321836 | import pygame, random, time
FRAME_REFRESH_RATE = 30
DISPLAY_WIDTH = 600
DISPLAY_HEIGHT = 400
BLUE = (0, 0, 255)
WHITE = (255, 255, 255)
BACKGROUND = (0, 0, 0)
INITIAL_METEOR_Y_LOCATION = 10
INITIAL_NUMBER_OF_METEORS = 8
MAX_METEOR_SPEED = 5
STARSHIP_SPEED = 10
MAX_NUMBER_OF_CYCLES = 1000
NEW_METEOR_CYCLE_INTERVAL = ... | johnehunt/advancedpython3 | chapter12/StarshipMeteors.py | StarshipMeteors.py | py | 7,122 | python | en | code | 47 | github-code | 18 | [
{
"api_name": "pygame.image.load",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "pygame.Rect",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "random.randint",
... |
70029232999 | from django.core import validators
from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from core.serializers import NfcCardSerializer, SemesterSerializer, UserSimpleSerializer
from core.utils import get_semester_of_date
from voucher.models import (
CoffeeRegisterLog,
C... | cybernetisk/internsystem | voucher/serializers.py | serializers.py | py | 7,598 | python | en | code | 4 | github-code | 18 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "core.serializers.SemesterSerializer",
"line_number": 20,
"usag... |
31643479195 | # -*- coding: utf-8 -*-
import numpy as np
from collections import Counter
from contextlib import closing
from marisa_trie import Trie, RecordTrie
from multiprocessing.pool import Pool
from wiki_extractor import WikiExtractor
from wiki_dump_reader import WikiDumpReader
_extractor = None
class EntityDB(object):
... | studio-ousia/ntee | ntee/utils/entity_db.py | entity_db.py | py | 3,376 | python | en | code | 81 | github-code | 18 | [
{
"api_name": "wiki_dump_reader.WikiDumpReader",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "wiki_extractor.WikiExtractor",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 57,
"usage_type": "call"
},
{
"... |
10931974658 | import pytest
from fastapi.testclient import TestClient
from experiments.class_depends import app
client = TestClient(app)
def test_hello_class_attr():
resp = client.get("/class_attr")
assert resp.status_code == 200
assert resp.json() == "hello"
def test_init_attr():
resp = client.get("/init_attr"... | falkben/fastapi_experiments | experiments/test_class_depends.py | test_class_depends.py | py | 797 | python | en | code | 9 | github-code | 18 | [
{
"api_name": "fastapi.testclient.TestClient",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "experiments.class_depends.app",
"line_number": 6,
"usage_type": "argument"
},
{
"api_name": "pytest.mark",
"line_number": 21,
"usage_type": "attribute"
}
] |
39798453430 | import json
import random
class WordChain:
_source = "wordlist.json"
def __init__(self, match_length: int = 1):
with open(self._source) as words:
wordlist = json.load(words)
initial_word = random.choice(wordlist)
self.wordlist = set(wordlist)
self.chain = [... | hegyhati/ClassRoomExamples | SOE/ProgAlap2/20210514_ZH_Szolanc/wordchain.py | wordchain.py | py | 804 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "json.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 11,
"usage_type": "call"
}
] |
11360948961 | import os
import sys
import urllib
from PIL import Image
from bfs import proceed_bfs
from straightforward import proceed_straightforward
def proceed_from_url(url):
res_default, res_bfs = "", ""
try:
file_name = url.split("/")[-1]
urllib.urlretrieve(url, file_name)
img = Image.open(fi... | Lamzin/myPython | Some projects/Lun.ua - test/Project/classifier/proceed.py | proceed.py | py | 632 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "urllib.urlretrieve",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "straightforward.proceed_s... |
35910803634 | """
Created on Thu Oct 29 04:46:09 2015
cd Documents/GeneralAssembly/Data\ Science/DAT8_micah/project
@author: micah
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.cross_validation import train_test_split
from sklearn.ensemble import RandomForestRegressor... | micahmarkman/DAT8_micah | Project/modeling.py | modeling.py | py | 12,437 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pandas.factorize",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "pandas.factorize",
... |
21337666695 | from gpiozero import PWMLED
from gpiozero.pins.pigpio import PiGPIOFactory
from time import sleep
import RPi.GPIO as GPIO
class Air:
relays = PiGPIOFactory(host='192.168.1.20') #RELAY PINS
air_pin = PWMLED(18, pin_factory=relays)
def __init__(self):
self.data = []
def blow(self, time... | RajinTech/glass-robotics | classes/air.py | air.py | py | 514 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "gpiozero.pins.pigpio.PiGPIOFactory",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "gpiozero.PWMLED",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO.... |
44952248814 | """
Link: https://leetcode.com/problems/linked-list-cycle/
Topics: Linked List, Hash Table, Two Pointers
"""
from typing import Optional
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
def has_cycle(self, head: Optional[ListNode]) -> bool:
... | thameemk/SDE-PlacementQuestions | Linked List/linked-list-cycle/main.py | main.py | py | 592 | python | en | code | 4 | github-code | 18 | [
{
"api_name": "typing.Optional",
"line_number": 15,
"usage_type": "name"
}
] |
34760199097 | import logging
from itertools import count
from banal import ensure_list
from elasticsearch.helpers import bulk
from elasticsearch import TransportError
from aleph.core import es
from aleph.util import backoff
log = logging.getLogger(__name__)
# This means that text beyond the first 100 MB will not be indexed
INDEX_... | mcrouse911/findpeopleviadocument | aleph/index/util.py | util.py | py | 6,749 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "aleph.core.es.indices.refresh",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "aleph.core.es.indices",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_na... |
24052269436 | from gym import make
import numpy as np
import torch
import torch.nn as nn
from torch.optim import Adam
import random
from collections import deque
N_STEP = 200
GAMMA = 0.9
BETA = 1e-1
def transform_state(state):
return np.array(state)
class ActorA2C(nn.Module):
def __init__(self, state_d... | StanislavSychev/RL-Course-homework | hw03_pendulum/train.py | train.py | py | 5,571 | python | en | code | null | github-code | 18 | [
{
"api_name": "numpy.array",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "torch.nn.ReLU",
"line_n... |
27232672741 | """
Analyzing the Disputed Federalist Papers
"""
import pandas as pd
from sklearn import tree
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
# Import csv
df = pd.read_csv('federalist_papers_data.csv')
a = df[df['class'] == 1].count()
print(a)
# Separate the entire da... | efecomu1/Predictive-Modeling | federalist.py | federalist.py | py | 4,113 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sklearn.tree.DecisionTreeClassifier",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "sklearn.tree",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "skle... |
35449578929 | import torch
from conf import agents_cfgs
from fairdiplomacy.game import sort_phase_key
from fairdiplomacy.agents.base_agent import BaseAgent
from fairdiplomacy.agents.model_wrapper import ModelWrapper
from fairdiplomacy.models.consts import POWERS
from fairdiplomacy.utils.thread_pool_encoding import FeatureEncoder
... | facebookresearch/diplomacy_searchbot | fairdiplomacy/agents/model_sampled_agent.py | model_sampled_agent.py | py | 1,687 | python | en | code | 39 | github-code | 18 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "fairdiplomacy.agents.base_agent.BaseAgent",
"line_number": 14,
"usage_type": "name"
},
{
... |
36832203954 | from itertools import product
import sqlite3
# class Card:
#
# def __init__(self, name, rules_text, color, type_, subtype, cmc, power,
# toughness, mana_cost, rarity):
# self.name = name
# self.rules_text = rules_text
# self.color = color
# self.type_ = type_
# ... | Tjorriemorrie/cardgame | main.py | main.py | py | 2,447 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sqlite3.connect",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "itertools.product",
"line_number": 86,
"usage_type": "call"
}
] |
70988188520 | import sys
sys.path.append('..')
from MobileNetV2 import MobileNetV2
from torch.autograd import Variable
import torch.nn as nn
import torch
from data.config import cfg
from gcn.st_gcn import Model_G
class EventDetector(nn.Module):
def __init__(self, pretrain, width_mult, lstm_layers, lstm_hidden, bidirectional=Tr... | buptzqr/golfdbPipeline | skeleton_opt_streams/model_2_stream.py | model_2_stream.py | py | 3,551 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "sys.path.append",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Module",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line... |
26115566853 | from collections import deque
from tkinter import*
from menu import*
import random
class Board:
def __init__(self, gamemode, tk, menu): #konštruktor,deklaruje základné premenné a zapne funkcie create_board a create_buttons ktoré vytvoria hraciu plochu
self.m... | PatrikBacko/Game-Logik | logik.py | logik.py | py | 10,635 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "random.randint",
"line_number": 148,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 150,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 179,
"usage_type": "call"
}
] |
4040730141 | #-*- coding:utf-8 -*-
import json, urllib2
API_KEY = os.environ["REKOGNITION_API_KEY"]
API_SECRET = os.environ["REKOGNITION_API_SECRET"]
jobs = 'face_age_beauty'
pic_url = 'http://pic.prepics-cdn.com/smapphoto/12756846.jpeg'
url = 'http://rekognition.com/func/api/?api_key=' + API_KEY + '&api_secret=' + API_SECRET ... | litmon/ml-study | study0119/python/sample1.py | sample1.py | py | 513 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "urllib2.urlopen",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 12,
"usage_type": "call"
}
] |
39675741084 | #!/usr/bin/env python
import logging
from math import floor
import time
from csvkit import CSVKitReader
from django.conf import settings
from django.utils.translation import ugettext
from livesettings import config_value
from panda import solr, utils
from panda.exceptions import DataImportError
from panda.tasks.impo... | pandaproject/panda | panda/tasks/import_csv.py | import_csv.py | py | 4,572 | python | en | code | 204 | github-code | 18 | [
{
"api_name": "panda.tasks.import_file.ImportFileTask",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "panda.models.Dataset.objects.get",
"line_number": 44,
"usage_type": "call"
},
... |
41902399445 | # IMPORTING CONFIGURATIONS
import yaml
try:
with open('config.yaml', 'r') as configfile:
cfg = yaml.load(configfile)
except:
with open('../config.yaml', 'r') as configfile:
cfg = yaml.load(configfile)
# IMPORTING NECESSARY PACKAGES
from microsoftbotframework import ReplyToActivity
from helpe... | uvacw/CART | tasks.py | tasks.py | py | 5,742 | python | en | code | 11 | github-code | 18 | [
{
"api_name": "yaml.load",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "yaml.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "helpers.db_class.DB",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "helpers.rephrase.check_rephrase... |
4003478924 | import functools
import weakref
import numpy as np
from tensorflow.python.util import nest
def get_source_inputs(tensor, layer=None, node_index=None):
"""Returns the list of input tensors necessary to compute `tensor`.
Output will always be a list of tensors
(potentially with 1 element).
Args:
tenso... | tensorflow/tensorflow | tensorflow/python/keras/utils/layer_utils.py | layer_utils.py | py | 13,874 | python | en | code | 178,918 | github-code | 18 | [
{
"api_name": "tensorflow.python.util.nest.flatten",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "tensorflow.python.util.nest",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "numpy.prod",
"line_number": 83,
"usage_type": "call"
},
{
"api_na... |
73734946921 | from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
from bs4 import BeautifulSoup
import time
import json
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.... | sapg-dev/web-scraping | src/.selenium/test.py | test.py | py | 4,822 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "selenium.webdriver.chrome.service.Service",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "webdriver_manager.chrome.ChromeDriverManager",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 14,
"us... |
17005674551 | # -*- coding: utf-8 -*-
# This file is part of Viper - https://github.com/viper-framework/viper
# See the file 'LICENSE' for copying permission.
import os
from os.path import expanduser
import sys
import glob
import atexit
import logging
import readline
import traceback
from viper.common.out import print_error
# from... | viper-framework/viper | viper/core/ui/console.py | console.py | py | 13,406 | python | en | code | 1,527 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "viper.core.config.__config__",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "viper.common.version.__version__",
"line_number": 39,
"usage_type": "argument"
},
{
... |
22238529031 | import unittest
from typing import List, Optional
import pandas as pd
from kbc_pul.data_structures.pandas_kb import PandasKnowledgeBaseWrapper
from kbc_pul.data_structures.rule_wrapper import RuleWrapper
from kbc_pul.rule_metrics.prediction_cache_rule_metrics.rule_ipw_and_ipw_pca_confidences_from_cached_predictions... | ML-KULeuven/KBC-as-PU-Learning | kbc_pul/test/test_pandas_kb_rule_metrics_cached_predictions/test_calculate_pu_rule_metrics.py | test_calculate_pu_rule_metrics.py | py | 2,790 | python | en | code | 7 | github-code | 18 | [
{
"api_name": "unittest.TestCase",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "typing.List",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "pandas.DataFrame",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "kbc_pul.data... |
2712416120 | import numpy as np
import pandas as pd
from sklearn.metrics.pairwise import cosine_similarity
from tqdm import tqdm
def uar(userId, train_pt_df):
l = [x for x in list(train_pt_df.loc[userId]) if x != 0]
if len(l)==0:
return 2.5
else:
return sum(l)/len(l)
def iar(itemId, train_pt_df):
... | ShaneyWaris/Food_Recommendation_System | item_based.py | item_based.py | py | 4,524 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "tqdm.tqdm",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "pandas.pivot_table",
"line_number": 109,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 109,
"usage_type": "attribute"
},
{
"api_name": "pandas.DataFrame",
... |
33943493658 | from telebot.handler_backends import State, StatesGroup
from telebot.storage import StateMemoryStorage
from keyboards.inline.inline_button import Inline
from keyboards.reply.reply_button import Reply
from telebot.types import Message, CallbackQuery
from database.model_functions.user import UserMethods
from database.mo... | zxckey/tg_hotels_bot | states/all_states.py | all_states.py | py | 10,944 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "telebot.storage.StateMemoryStorage",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "api_parse.api_utils.API_UTILS",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "telebot.handler_backends.StatesGroup",
"line_number": 19,
"usage_type": ... |
14751535325 | #Anthony Guzman CIS2348 #1503239
#--Importing the required libraries-------
# import pandas as pd so we can leverage the pd function to read the csv files
import pandas as pd
pd.options.mode.chained_assignment = None # default='warn'
import datetime
#-----------Import the data... | guzmananthony37/Final-Project | Importing files.py | Importing files.py | py | 5,172 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.options",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
... |
38010937749 | from django.shortcuts import render
import datetime
# Create your views here.
def calc(request):
if request.method == "POST":
hidden_val = request.POST["val"]
period = request.POST["period"]
rate = request.POST["rate"]
interest_amount = request.POST["interest_amount"]
inves... | RajatCoding/mi | task2/myapp/views.py | views.py | py | 4,434 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 21,
"usage_type": "call"
},
{
"api_... |
43009019714 | #coding=utf-8
from collections import defaultdict
import torch.nn.functional as F
from loss import calc_loss
import time
import torch
from torch.utils.data import Dataset, DataLoader
from utils.lr_scheduler import adjust_learning_rate_poly
from utils.label2color import label_img_to_color, diff_label_img_to_color
from d... | boysunyingzhi/semantic-segmentation | HRnet/train.py | train.py | py | 14,995 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "cv2.setNumThreads",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
12583564801 | """
Main file for training Yolo model on Pascal VOC and COCO dataset
"""
"""
Scaler Note: The scaler is used for mixed precision training in PyTorch. It is a GradScaler object that helps scale up the gradients computed during the backward pass so that
they can be used to update the model's parameters. This is because... | Emanuele-n/surgical-copilot | camera/object_detection/train.py | train.py | py | 5,765 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "torch.backends",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "tqdm.tqdm",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "config.DEVICE",... |
32231816990 | # -*- coding: utf-8 -*-
"""
Created on Mon Jul 13 15:48:08 2020
@author: Austin
"""
import pandas as pd
from yahoofinancials import YahooFinancials
import datetime as dt
all_tickers = ["AAPL", "MSFT", "CSCO", "AMZN", "INTC"]
close_prices = pd.DataFrame()
end_date = (dt.date.today()).strftime('%Y-%m-%d... | austinlhx/algorithmic-trading | yahoofinancialscrpt.py | yahoofinancialscrpt.py | py | 924 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "pandas.DataFrame",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.date.today",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "datetime.date... |
16184226565 | #Rahman ve Rahim Olan Allah'ın Adıyla
"""
@Main Author: Yunus Emre Yiğit -yigity19
@Contributor: Muhammed Emin Hamamcı, Muhammed Veli Ünlü, Umut Gökdağ ?
"""
import rospy
import numpy as np
from State import *
from initializer_util import *
import time
import rospy
from GammaSwarm.msg import UavState
from GammaSwarm.s... | ITU-GammaTeam/GammaSwarm-Demo | src/GammaSwarm/src/GammaSwarm/mainSystem/Initializer.py | Initializer.py | py | 5,251 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "numpy.array",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number"... |
33544069099 | """Application with eligibility"""
import sys
import datetime
import logging
import mysql.connector
logging.basicConfig(filename='appLog.log', level=logging.DEBUG, format='%(asctime)s:%(message)s')
content = open('mysql.config').read()
details = eval(content) # pylint: disable=eval-used
mydb = mysql.connector.connect... | Gokul-nAth/ADF | Day5/application.py | application.py | py | 13,271 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "logging.basicConfig",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "mysql.connector.connector.connect",
"line_number": 10,
"usage_type": "call"
},
{
"api_name":... |
36503233018 | import docx
document = docx.Document()
p = document.add_paragraph('Gérer les styles', "Heading 1")
p = document.add_paragraph('Ce document Word a été créé avec python.')
p_run = p.add_run(' On peut mettre le texte en italique et gras')
p_run.italic = True
p_run.bold = True
p.add_run(' et celui-ci en gras uniquement')... | D-BookeR/Python-sans-detour | chapitre_fichier/docx/docx_cmd02.py | docx_cmd02.py | py | 906 | python | fr | code | 1 | github-code | 18 | [
{
"api_name": "docx.Document",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "docx.enum",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "docx.shared.Pt",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "docx.shared",
"line_nu... |
15389904609 | from __future__ import annotations
import logging
from smtplib import SMTPException, SMTPRecipientsRefused
from typing import List
from django.core import mail
from django.template.loader import render_to_string
from ..models import Status, Wichtelmember
logger = logging.getLogger(__name__)
class Email(object):
... | Cellebyte/wichtelit | wichtelit/wichtelit/logic/email.py | email.py | py | 3,869 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "models.Wichtelmember",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "models.Status.EMAI... |
13459652065 | """empty message
Revision ID: 7945566d9345
Revises: 77337317c6db
Create Date: 2019-01-08 13:06:47.536665
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '7945566d9345'
down_revision = '77337317c6db'
branch_labels = None
depends_on = None
def upgrade():
# ... | meshnesh/stock-management | migrations/versions/7945566d9345_.py | 7945566d9345_.py | py | 794 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "alembic.op.add_column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integer... |
23955370325 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('profiles', '0007_auto_20160319_1052'),
]
operations = [
migrations.AddField(
model_name='profile',
n... | danielliude/reismann_pub | profiles/migrations/0008_profile_profession.py | 0008_profile_profession.py | py | 671 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AddField",
"line_number": 14,
"usage_type": "call"
},
{
... |
32337552901 | from typing import List, Callable, Optional, Awaitable
from enum import Enum
from abc import abstractmethod
import time
import asyncio
from .future import IFuture
# Copy from parsl
class JobState(bytes, Enum):
"""Defines a set of states that a job can be in"""
def __new__(cls, value: int, terminal: bool, stat... | chenggroup/ai2-kit | ai2_kit/core/job.py | job.py | py | 1,991 | python | en | code | 31 | github-code | 18 | [
{
"api_name": "enum.Enum",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "future.IFuture",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
... |
17284826616 | from urllib.request import urlopen
import bs4
def extract_links_from_webpage(html):
soup = bs4.BeautifulSoup(html, features='lxml')
urls = []
link_tags = soup.find_all('a')
for link_tag in link_tags:
url = link_tag.attrs.get('href')
if url is not None:
urls.append(url)
r... | eecs110/winter2019 | course-files/lectures/lecture_14/web_crawler/03_get_all_links_in_webpage.py | 03_get_all_links_in_webpage.py | py | 549 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "urllib.request.urlopen",
"line_number": 15,
"usage_type": "call"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.