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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
24635977622 | from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from ProductListing import ProductListing
from ProductDetail import ProductDetail
import json
def crawl_links_from_listing_page(driver, url):
productListing = ProductListing(driver)
productListing.open_browser_with_link(url)
... | toanleviet95/crawl-asos-with-selenium | main.py | main.py | py | 2,018 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "ProductListing.ProductListing",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "ProductDetail.ProductDetail",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 46,
"usage_type": "call"
},
{
... |
36800921542 | """Database manager tool. """
import argparse
import textwrap
import os
import re
import bz2
import logging
import sys
from functools import total_ordering
# import pandas as pd
from database.db import ETGDatabase
from database.online import scry
from database.online.gcs import GCSConnection
@total_ordering
class ... | Squeemos/Eigen-the-Gathering | database/mgr.py | mgr.py | py | 8,214 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "re.split",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "functools.total_ordering",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "database.online.scry.download_default_cards",
"line_number": 52,
"usage_type": "call"
},
{
"api... |
22209339341 | import numpy as np
from unsupervised_learning.MDS.multiple_dimensional_scaling import MultipleDimensionalScaling
class Isomap:
""" Isomap,流形学习,非线性降维.
Attributes:
d: 降维后的维数/特征数
k: 计算测地距离矩阵时的邻域样本个数
"""
def __init__(self, d, k):
self.d = d
self.k = k
def _floyd(self, ... | chubbylhao/ML_Algorithms | unsupervised_learning/Isomap/isomap.py | isomap.py | py | 3,175 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.full_like",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.argsort",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number... |
18551108815 | from __future__ import annotations
import asyncio
import atexit
import threading
from multiprocessing.util import _exit_function # type: ignore[attr-defined]
from typing import TYPE_CHECKING, Any
import uvloop
from app.lib import settings
from .base import Queue, Worker
if TYPE_CHECKING:
from collections.abc ... | Sprint-Log/sprintlog-backend | src/app/lib/worker/commands.py | commands.py | py | 4,019 | python | en | code | 5 | github-code | 97 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "base.Queue",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "collections.abc.Collection",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "collection... |
20642320151 | from django.shortcuts import render
from Usuarios.models import Usuario
from django.http import HttpResponse
from Usuarios.serializers import UsuarioSerializer
from rest_framework.renderers import JSONRenderer
class JSONResponse(HttpResponse):
def __init__(self, data, **kwargs):
content = JSONRenderer().... | andreabadesso/Desapego | Usuarios/views.py | views.py | py | 1,022 | python | es | code | 0 | github-code | 97 | [
{
"api_name": "django.http.HttpResponse",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "rest_framework.renderers.JSONRenderer",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "Usuarios.models.Usuario.objects.get",
"line_number": 18,
"usage_type": "cal... |
24353142913 | # -*- coding: utf-8 -*-
#!/usr/bin/env python3
'''
Created on Wed Jan 16 17:50:59 CST 2019
@Mail: minnglee@163.com
@Author: Ming Li
'''
import sys,os,logging,click
logging.basicConfig(filename=os.path.basename(__file__).replace('.py','.log'),
format='%(asctime)s: %(name)s: %(levelname)s: %(message... | minglibio/Script | PanGenome/FilterSeq.py | FilterSeq.py | py | 1,498 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "logging.basicConfig",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.basename",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "logging.DEBUG",
... |
33701075788 | # 正規方程式
import numpy as np
import matplotlib.pyplot as plt
# 架空のデータセットの用意
# データは正規分布に従って生成
N = 100
mean1 = [1, 3] # クラス1の平均
mean2 = [3, 1] # クラス2の平均
cov = [[2.0,0.0], [0.0, 0.1]] # 共分散行列(2クラス共通)
class_1 = np.random.multivariate_normal(mean1, cov, N//2)
class_2 = np.random.multivariate_normal(mean2, cov, N//2)
bias_... | awkrail/hajipata | ch06/normal_equation.py | normal_equation.py | py | 1,104 | python | ja | code | 0 | github-code | 97 | [
{
"api_name": "numpy.random.multivariate_normal",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.multivariate_normal",
"line_number": 12,
"usage_type": "call"
},
{
... |
74971943997 | import os
import json
import logging
import typing
from logging import Logger
from datetime import datetime
class LogBase:
def __init__(self, log_name:str, file_share:str, identity:str = None):
self.file_share = file_share
self.log_name = log_name
self.identity = identity
def get_logge... | grecoe/osdu-data-load | seed-tno-dataset/containers/seedosdu/utils/logutil.py | logutil.py | py | 3,384 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.Logger",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "os.path.join",... |
2266532024 | import torch
import numpy
import pprint
import matplotlib.pyplot as plt
if __name__ == "__main__":
checkpoint = torch.load("loss_log_original_3x.pt")
x=checkpoint.numpy()
epochs=[]
loss=[]
rows=x.shape[0]
columns=x.shape[1]
print(x.shape)
for i in range(rows):
fo... | asfajamil/super-resolution | code/loss comparison/test.py | test.py | py | 1,007 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "torch.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.load",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
34059978277 | import re
import os
import pytesseract
from PIL import Image
from tqdm import tqdm
pytesseract.pytesseract.tesseract_cmd = (
r"/usr/local/Cellar/tesseract/5.1.0/bin/tesseract"
)
directory = ""
def preprocess_text(text):
text = text.lower().strip()
text = re.sub(re.escape("\n"), " ", text)
return text... | matiasrvazquez/lato | test_passer.py | test_passer.py | py | 1,241 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pytesseract.pytesseract",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "re.sub",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "re.escape",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line... |
30949138622 | from typing import Optional
from fastapi import APIRouter, Depends, Request, Response
from sqlalchemy.ext.asyncio import AsyncSession
from .dao import LandmarkDAO
from .service import DatabaseManager
from .schemas import LandmarkCreate, LandmarkBase, Landmark, LandmarkId
from ..database import get_async_session
rout... | leksBezdar/hakaton | src/api/routers.py | routers.py | py | 2,698 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "fastapi.Request",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "schemas.LandmarkCreate",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.e... |
42423016116 | #!/usr/bin/env python3
'''Wait for Cozmo to see a face, and then turn on his backpack light.
This is a script to show off faces, and how they are easy to use.
It waits for a face, and then will light up his backpack when that face is visible.
'''
import asyncio
import time
import cozmo
def light_when_face(robot: ... | skyrockprojects/cozmo | tasks/05/01_light_when_face.py | 01_light_when_face.py | py | 1,114 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "cozmo.robot",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "cozmo.robot",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "cozmo.lights",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "asyncio.TimeoutEr... |
22895388873 | import json
import os
from typing import Dict
from typing import List
from typing import Optional
from git import Repo
# Global Configuration
GIT_REPO_BASE_PATH = "./repo"
AUTHOR_LICENSE_FILE = "./config/author-licenses.txt"
PSEUDONYMS_FILE = "./config/pseudonyms.txt"
EXCLUDE_DIRS = [".git"]
def _load_pseudonyms(pa... | thehale/git-authorship | git_authorship/authorship_analyzer.py | authorship_analyzer.py | py | 6,988 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "os.path.exists",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
33762356721 | from six.moves.urllib.parse import urljoin, urlsplit, urlunsplit
from pywb.rewrite.wburl import WbUrl
from pywb.rewrite.cookie_rewriter import get_cookie_rewriter
#=================================================================
class UrlRewriter(object):
"""
Main pywb UrlRewriter which rewrites absolute an... | webrecorder/pywb | pywb/rewrite/url_rewriter.py | url_rewriter.py | py | 6,907 | python | en | code | 1,241 | github-code | 97 | [
{
"api_name": "pywb.rewrite.wburl.WbUrl",
"line_number": 27,
"usage_type": "argument"
},
{
"api_name": "pywb.rewrite.wburl.WbUrl",
"line_number": 119,
"usage_type": "call"
},
{
"api_name": "pywb.rewrite.cookie_rewriter.get_cookie_rewriter",
"line_number": 131,
"usage_type... |
9897427231 | """Resources related with fractals.
Refs:
- https://realpython.com/mandelbrot-set-python/
"""
from dataclasses import dataclass
import math
from typing import Union
import numpy as np
import matplotlib.pyplot as plt
def mandelbrot_sequence(c):
"""Returns generator of the Mandelbrot sequence given C"""
z =... | RicardoHS/numbers | src/fractals.py | fractals.py | py | 3,225 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.linspace",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "numpy.newaxis",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.sc... |
33094948844 | from gensim import corpora, models
from glob import glob
from operator import itemgetter
from scipy.sparse.csgraph import connected_components
from statistics import mean
import fasttext
import hdbscan
import collections
import umap
import os
import sys
import csv
import string
import codecs
import re
import time
impor... | sanskruthiya/MapNLP | tools/DocViz_FastText_JP.py | DocViz_FastText_JP.py | py | 9,579 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "MeCab.Tagger",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 47,
"usage_type": "attribute"
},
{
"api_name": "fasttext.train_unsupervised"... |
4729485273 | from itertools import permutations
def is_prime(s, primes):
if not s or int(s) in primes or int(s) <= 1:
return False
n = int(s)
if n == 2:
return True
for i in range(2, int(n**0.5)+1):
if n % i == 0:
return False
return True
def dfs(s, numbers, idx, primes):
... | welikeheon/little-by-little | (100) Programmers/Level2/find_prime.py | find_prime.py | py | 767 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "itertools.permutations",
"line_number": 27,
"usage_type": "call"
}
] |
13137201320 |
from Gwe_service.api.controller.CouponListObj import CouponListObj as TemplateController
from common.func import *
class CouponList(TemplateController):
"""根据优惠券名称和类型分页获取优惠券列表"""
def __init__(self, status=0, message='操作成功', **kwargs):
super(CouponList, self).__init__()
self.status = status # ... | chase001/chase_learning | Python接口自动化/auto_test/Gwe_service/api/service/CouponList.py | CouponList.py | py | 2,016 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "Gwe_service.api.controller.CouponListObj.CouponListObj",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "Gwe_service.data.status.ConsStatusCode.OK",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "Gwe_service.data.status.ConsStatusCode",
... |
73000947199 | import boto3
from django.conf import settings
SENDER_ID = 'CovidBeacon'
client = boto3.client('sns',
aws_access_key_id=settings.AWS_ACCESS_KEY_ID,
aws_secret_access_key=settings.AWS_SECRET_ACCESS_KEY,
region_name='eu-west-1')
def send_sms(phone, msg)... | jakubzadrozny/hackcrisis | users/sms.py | sms.py | py | 814 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "boto3.client",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.AWS_ACCESS_KEY_ID",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 7,
"usage_type": "name"
},
{
"api_na... |
5796094480 | import ctypes, pygame
class Resize:
def __init__(self, W, H):
self.w = W
self.h = H
self.Log = [(self.w, self.h), (self.w, self.h)]
self.user = ctypes.windll.user32
self.relW = self.user.GetSystemMetrics(0)
self.relH = int(self.user.GetSystemMetrics(1) - s... | SarperMakas/CarGame | resize.py | resize.py | py | 1,786 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "ctypes.windll",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "pygame.... |
4065195226 | import os
import subprocess as sp
from io import open
from setuptools import Extension, find_packages, setup
import versioneer
from compile_externals import compile_all
CONFIG_NAME = "gimmemotifs.cfg"
DESCRIPTION = "GimmeMotifs is a motif prediction pipeline."
with open("README.md", encoding="utf-8") as f:
long... | vanheeringen-lab/gimmemotifs | setup.py | setup.py | py | 5,038 | python | en | code | 106 | github-code | 97 | [
{
"api_name": "io.open",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "setuptools.Extension",
"li... |
29290167168 | import pygame
from ball import Ball
from random import randint
pygame.mixer.pre_init(44100, -16, 1, 512) # важно прописать до pygame.init()
pygame.init()
pygame.time.set_timer(pygame.USEREVENT, 2000)
pygame.mixer.music.load('sounds/bird.mp3')
pygame.mixer.music.play(-1)
s_catch = pygame.mixer.Sound('sounds/catch.... | TimPyg/pygame_kozaki | main.py | main.py | py | 2,746 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pygame.mixer.pre_init",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.mixer",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pygame.init",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.time.set_time... |
41674055600 | import json
import ast
from amadeus import Client, ResponseError, Location
from django.shortcuts import render
from django.contrib import messages
from .flight import Flight
from .booking import Booking
from django.http import HttpResponse
amadeus = Client()
def demo(request):
# Retrieve data from the UI form
... | amadeus4dev/amadeus-flight-booking-django | amadeus_demo_api/demo/views.py | views.py | py | 7,311 | python | en | code | 34 | github-code | 97 | [
{
"api_name": "amadeus.Client",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "amadeus.travel.predictions.trip_purpose.get",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "amadeus.travel",
"line_number": 42,
"usage_type": "attribute"
},
{
"ap... |
12193097477 | # For data wrangling
import pandas as pd
import numpy as np
# For visualization
import matplotlib.pyplot as plt
import seaborn as sns
# For data acquisition
from nba_api.stats.endpoints import playercareerstats, shotchartdetail
from nba_api.stats.static import players
# For plotting the court
from matplotlib import ... | brunopiato/NBADex | funcoes.py | funcoes.py | py | 8,934 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "seaborn.set_style",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "seaborn.set_color_codes",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pandas.options",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "matplot... |
23586511695 | import os
import json
class _JSONFile:
def __init__(self, file):
self.file = file
def open(self):
try:
with open(self.file, mode='r', encoding='utf-8') as f:
return json.load(f)
except FileNotFoundError as e:
print("Creating file...")
... | dextertechnology/Photoley | photoley/utilities/json_parser.py | json_parser.py | py | 1,630 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "json.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.mknod",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "json.decoder",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "json.dump",
"line_number": 3... |
40774113445 | #%%
import os
import shutil
import tqdm
import argparse
parser = argparse.ArgumentParser(description='Copy files with progress bar')
parser.add_argument('source', type=str, help='Source folder')
parser.add_argument('destination', type=str, help='Destination folder')
args = parser.parse_args()
source_dir = args.source... | agbld/data_backup | cp.py | cp.py | py | 1,710 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
38219380068 | import argparse
import os
import sys
import time
import github
import requests
from requests.packages import urllib3
import yaml
# Turn of warnings about bad SSL config.
# https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
urllib3.disable_warnings()
DESC_SUFFIX = ' Mirror of code maintained a... | openstack/project-config | playbooks/maintain-github-mirror/github_manager.py | github_manager.py | py | 9,698 | python | en | code | 112 | github-code | 97 | [
{
"api_name": "requests.packages.urllib3.disable_warnings",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "requests.packages.urllib3",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 52,
"usage_type": "call"
},
{
... |
966963434 | import pandas as pd
import sklearn.feature_extraction.text as sk
import retrieve_data
from sklearn import svm
from sklearn.neighbors import KNeighborsClassifier
from sklearn.naive_bayes import GaussianNB, MultinomialNB
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import VotingClassifier
from sk... | oyvinkm/DataScience | predict.py | predict.py | py | 3,429 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sklearn.feature_extraction.text.TfidfVectorizer",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sklearn.feature_extraction.text",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "sklearn.svm.SVC",
"line_number": 17,
"usage_type": "call"... |
4134056502 | from tkinter import *
from PIL import ImageTk, Image
root = Tk()
root.title('Learn to Code at Codem.com')
# png file 16 * 16, 32 * 32, 64 * 64
#root.iconbitmap('c:/gui/codemy.ico')
my_img = ImageTk.PhotoImage(Image.open("gui/tree.jpg"))
my_label = Label(image=my_img)
my_label.pack()
button_quit = Button(roo... | xuejiao-li/tkinter-practice | images.py | images.py | py | 399 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "PIL.ImageTk.PhotoImage",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "PIL.ImageTk",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"li... |
23958697455 | # utils.py
""" Proporciona funciones auxiliares para procesar el texto durante la generación de la grilla. """
from typing import List, Tuple
import math
import random
import re
from sachagrilla.utils.separasilabas import silabizer
def clean_text(text: str) -> str:
"""Toma un texto y lo devuelve en minúscula y... | gonzalezgbr/sachagrilla | src/sachagrilla/utils/utils.py | utils.py | py | 2,215 | python | es | code | 0 | github-code | 97 | [
{
"api_name": "re.sub",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "typing.Tuple",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "random.choice",
"line_number": 38,
... |
10791599372 | """
Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string.
Example 1:
Input: num1 = "2", num2 = "3"
Output: "6"
Example 2:
Input: num1 = "123", num2 = "456"
Output: "56088"
Note:
The length of both num1 and num2 is < 110.
Both num1 an... | swapnesh-chaubal/algorithms | others/multiply-strings.py | multiply-strings.py | py | 1,741 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "collections.deque",
"line_number": 31,
"usage_type": "call"
}
] |
26360038934 | """
Manipulate a time series
========================
"""
# %%
# The objective here is to create and manipulate a time series.
# A time series is a particular field where the mesh :math:`\mathcal{M}` 1-d and regular, eg a time grid :math:`(t_0, \dots, t_{N-1})`.
#
# It is possible to draw a time series, using interpola... | openturns/openturns | python/doc/examples/probabilistic_modeling/stochastic_processes/plot_timeseries_manipulation.py | plot_timeseries_manipulation.py | py | 2,671 | python | en | code | 198 | github-code | 97 | [
{
"api_name": "openturns.Log.Show",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "openturns.Log",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "openturns.RegularGrid",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "openturns... |
86457571239 | from webcam import Webcam
import cv2
from datetime import datetime
webcam = Webcam()
webcam.start()
i = 0
while True:
# get image from webcam
image = webcam.get_current_frame()
# display image
cv2.imshow('grid', image)
cv2.waitKey(3000)
# save image to file, if pattern found
ret, corners... | Junzhuodu/ar_python_object_showing | photo_produce/display.py | display.py | py | 641 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "webcam.Webcam",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "webcam.start",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "webcam.get_current_frame",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"l... |
44675283219 | #!/usr/bin/python3
import matplotlib.pyplot as plt
import random
import math
draw_arrows: bool = True
if draw_arrows:
print("Drawing arrows ON")
from matplotlib.patches import FancyArrowPatch, PathPatch
from matplotlib.path import Path
arrow_width = 2.
arrowstyle = "fancy,head_length={},head_widt... | k-kashapov/TrajectoryPlot | Traject.py | Traject.py | py | 2,130 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 69,
"usage_type": "name"
},
{
"api_name": "random.random",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "random.ran... |
73443681920 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import numpy as np
from numpy import append,size
import scipy.linalg as sp
import matplotlib.pyplot as plt
plt.ion() ; plt.close('all')
###----------------------------------------------------------------------------------------------
###-----------------------------------Quel... | nsaura/ML | codes_python/cases/SAURA_tac_code.py | SAURA_tac_code.py | py | 10,025 | python | fr | code | 1 | github-code | 97 | [
{
"api_name": "matplotlib.pyplot.ion",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.close",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotl... |
20794840500 | """
This module handles the assignment of file parameters for FragPELE.
"""
class FragInputFiles(object):
"""
Base class to assign the file parameters for FragPELE.
"""
def __init__(self, parameters, args):
"""
Given a Parameters object, it initializes the file parameters for
... | nostrumbiodiscovery/pele_platform | pele_platform/Frag/parameters/files.py | files.py | py | 3,865 | python | en | code | 9 | github-code | 97 | [
{
"api_name": "os.path.basename",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 76,
"usage_type": "attribute"
},
{
"api_name": "PPP.main.main",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "PPP.main",
"line_numb... |
30286742221 | from lib.actions import SingleVMAction
__all__ = [
'StartVMAction'
]
class StartVMAction(SingleVMAction):
api_type = 'compute'
def run(self, credentials, vm_id):
driver = self._get_driver_for_credentials(credentials=credentials)
node = self._get_node_for_id(node_id=vm_id, driver=driver)
... | StackStorm/st2contrib | packs/libcloud/actions/start_vm.py | start_vm.py | py | 630 | python | en | code | 154 | github-code | 97 | [
{
"api_name": "lib.actions.SingleVMAction",
"line_number": 8,
"usage_type": "name"
}
] |
1350737751 | from flask import Flask, render_template, request, Response, jsonify, Blueprint
from bson import json_util
import json
users_api = Blueprint('users_api', __name__)
@users_api.route('/users/signup', methods=["POST"])
def signup():
import app
form = request.json
UserID = form["UserID"]
Username = f... | nishanthbhat07/Healthnomics-Practo_Clone | Backend/users.py | users.py | py | 3,463 | python | en | code | 12 | github-code | 97 | [
{
"api_name": "flask.Blueprint",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.request.json",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "app.db",
"li... |
30155222780 | import numpy as np
from matplotlib import pyplot as plt
from scipy.stats import multivariate_normal
from sklearn.cluster import KMeans
import random
np.random.seed(7)
def initialization_kmeans(X, p, q, variance_level=None):
"""
X : dataset
p : number of clusters
q : dimension of the latent space
v... | yongjin-shin/prob_graphic_model | assn2 - Mixture PPCA/Mixture of PPCA/mppca.py | mppca.py | py | 7,826 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.random.seed",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.randint",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.random",... |
35341604566 | # %% If running in an IPYthon kernel (e.g. VSCode), the lines of code below are needed to add OUprocess functions to current Python path
from pathlib import Path
import os
import sys
sys.path.append(Path(os.getcwd()).parent)
# %%
import OUprocess_functions as OU
import utils
import numpy as np
from numpy.linalg import... | conorheins/bayesian-mechanics-sdes | old/scratch/scratch/inference_scratch.py | inference_scratch.py | py | 16,902 | python | en | code | 12 | github-code | 97 | [
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number"... |
33768678257 | from pathlib import PurePath, Path
from flask import Flask, url_for, render_template, request, abort, redirect, flash, make_response, session
from markupsafe import escape
from werkzeug.utils import secure_filename
app = Flask(__name__)
app.secret_key = b'5f214cacbd30c2ae4784b520f17912ae0d5d8c16ae98128e3f549546221265... | AlexPodarkin/Flask_FastAPI | lection/lection_2/app_12(session).py | app_12(session).py | py | 902 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.session",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "flask.session",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "flask.redirect",
"line_num... |
25388069261 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import tensorflow as tf
from tensorflow.python.framework.errors_impl import OutOfRangeError, \
InvalidArgumentError
args = argparse.ArgumentParser()
args.add_argument('-f', '--file', help="... | rhyspang/Sequence-Recognition | utils/find_invalid.py | find_invalid.py | py | 1,764 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tensorflow.train.string_input_producer",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tensorflow.train",
"line_number": 17,
"usage_type": "attribute"
},
{
... |
8760278112 | import os
import pandas as pd
import json
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session,sessionmaker
from sqlalchemy import create_engine, distinct
from sqlalchemy.sql import func
from flask import Flask, jsonify, render_template
from flask_sqlalchemy ... | cemoga/visualization-project | app.py | app.py | py | 13,939 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "config.UserName",
"lin... |
74554417598 | from NN import NN
from dataset.hosing import hosing
if __name__ == "__main__":
# load the train data
X,Y = hosing.load()
# data partition
test_X = X[-50:]
test_Y = Y[-50:]
train_X = X[:-50]
train_Y = Y[:-50]
# create nn model
nn = NN.NeuralNetwork([13,10,1],'ReLu')
# init
... | iYinST/mlbulletin | Boston Housing Problem/hosing_predict.py | hosing_predict.py | py | 668 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "dataset.hosing.hosing.load",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "dataset.hosing.hosing",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "NN.NN.NeuralNetwork",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "NN... |
32164214228 | """test_iptables_save.py
Unit tests for the iptables-save parser.
"""
import os, sys
import path_config
import subprocess
import tempfile
import socket
import json
import unittest
from TcSaveTestUtils import (
isLinux,
isRoot,
)
if isLinux() and isRoot():
from TcSaveTestUtils import (
setUpModu... | dentproject/petunia | test/test_iptables_save_linux.py | test_iptables_save_linux.py | py | 4,182 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "TcSaveTestUtils.isLinux",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "TcSaveTestUtils.isRoot",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": ... |
14484961302 | from pycoingecko import CoinGeckoAPI
from datetime import datetime
import psycopg2
cg = CoinGeckoAPI()
# print(cg.get_price(ids='bitcoin', vs_currencies='usd'))
data = cg.get_price(ids=['tron', 'gamestarter', 'dark-frontiers'], vs_currencies='usd')
print(data)
symbols = {"tron": "TRX", "gamestarter": "GAME", "dark-f... | Ali-Usama/Market-data | coingecko_data.py | coingecko_data.py | py | 1,475 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pycoingecko.CoinGeckoAPI",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "psycopg2.connect",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "dateti... |
15298436132 | #coding:utf-8
import json
class OpereJosn:
def __init__(self,file=None):
if file:
self.file=file
self.data=self.readJosn()
else:
self.file = "../data_config/testdata.json"
self.data = self.readJosn()
#读取json文件
def readJosn(s... | lovehuangCHeng/python-demo | util/open_json.py | open_json.py | py | 719 | python | zh | code | 0 | github-code | 97 | [
{
"api_name": "json.load",
"line_number": 14,
"usage_type": "call"
}
] |
32900461895 | import sys
from cx_Freeze import setup, Executable
class PyScript:
def compileExe(name,version,description,file,appType):
if appType == 'g':
setup(
name = name,
version = version,
description = description,
executables = [Executable... | PyScript-OpenSource/scrpy-Version-1.0 | compilePyScript.py | compilePyScript.py | py | 569 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "cx_Freeze.setup",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cx_Freeze.Executable",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cx_Freeze.setup",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cx_Freeze.Executa... |
29274925621 | """removed sort_order
Revision ID: 6fd78c6511a4
Revises: 4c2d3191f8f4
Create Date: 2023-04-03 12:34:32.710661
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '6fd78c6511a4'
down_revision = '4c2d3191f8f4'
branch_labels = None
depends_on = None
def upgrade():
... | bcgov/EPIC.track | epictrack-api/migrations/versions/6fd78c6511a4_removed_sort_order.py | 6fd78c6511a4_removed_sort_order.py | py | 866 | python | en | code | 4 | github-code | 97 | [
{
"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",... |
11644598378 | from collections import namedtuple
Node = namedtuple('Node', 'value L R LRng RRng')
def buildSegTree(arr, LRange, RRange):
curMin = min(arr)
len_arr = len(arr)
if len_arr == 1:
return Node(curMin, None, None, LRange, LRange)
else:
len_child = len_arr // 2
return Node(curMin,
... | heitorchang/learn-code | battles/challenges/caucusRace_spoiler_segmentTree.py | caucusRace_spoiler_segmentTree.py | py | 1,726 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "collections.namedtuple",
"line_number": 3,
"usage_type": "call"
}
] |
5649866162 | """
This file demonstrates two different styles of tests (one doctest and one
unittest). These will both pass when you run "manage.py test".
Replace these with more appropriate tests for your application.
"""
from django.test import TestCase
from submission_qr.models import QualityReview
from parsed_xforms.models im... | mvpdev/nmis | submission_qr/tests.py | tests.py | py | 1,119 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.test.TestCase",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.models.User",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.User",
"line_number": 19,
"usage_type": "call"
},
{
... |
25406740591 | # -*- coding: utf-8 -*-
"""
Created on Wed May 13 13:46:38 2015
@author: andric
"""
import os
import numpy as np
import pandas as pd
import networkx as nx
if __name__ == '__main__':
dat_dir = os.environ['pnd']
modularity_dir = dat_dir+'/modularity'
graph_dir = dat_dir+'/graphs'
dat_file = 'pandit_da... | michaelandric/pandit | get_mod_assignments.py | get_mod_assignments.py | py | 1,950 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.environ",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numb... |
17879318929 | #! /usr/bin/env python
"""
This script performs the main ingestion of data into the hstlc
filesystem and database, as well as creates output lightcurves for both
individual observations as well as 'composite' (i.e. aggregate)
observations of the same target. This script employs the following
algorithm:
1. Configu... | justincely/lightcurve_pipeline | lightcurve_pipeline/scripts/ingest_hstlc.py | ingest_hstlc.py | py | 15,370 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "matplotlib.use",
"line_number": 136,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 140,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 141,
"usage_type": "attribute"
},
{
"api_name": "logging.info",
... |
32369065793 | # SVG Path specification parser
import re
from . import path
import xml.etree.ElementTree as ET
import re
import math
COMMANDS = set('MmZzLlHhVvCcSsQqTtAa')
UPPERCASE = set('MZLHVCSQTA')
COMMAND_RE = re.compile("([MmZzLlHhVvCcSsQqTtAa])")
FLOAT_RE = re.compile("[-+]?[0-9]*\.?[0-9]+(?:[eE][-+]?[0-9]+)?")
SVG_COLORS ... | arpruss/gcodeplot | svgpath/parser.py | parser.py | py | 26,080 | python | en | code | 149 | github-code | 97 | [
{
"api_name": "re.compile",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 399,
"usage_type": "call"
},
{
"api_name": "re.split",
"line_number": 417,
... |
34912974592 | import binascii
import os
import sys
import click
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.ext.serializer import dumps, loads
from flask import current_app
from flask.cli import AppGroup
from linotp.lib.audit.SQLAudit import AuditTable
from linotp.model.config import Config
from linotp.model.realm imp... | LinOTP/LinOTP | linotp/cli/dbsnapshot_cmd.py | dbsnapshot_cmd.py | py | 10,635 | python | en | code | 484 | github-code | 97 | [
{
"api_name": "linotp.model.config.Config",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "linotp.model.token.Token",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "linotp.model.tokenRealm.TokenRealm",
"line_number": 26,
"usage_type": "name"
},
{... |
13823401484 | from django.contrib import messages
from django.shortcuts import render
from rest_framework.response import Response
from rest_framework.views import APIView
from .forms import CustomerForm, OrderForm
from .models import Customer, Order
def create_customer(request):
if request.method == "POST":
form = C... | Palibrix/cx_test | orders/views.py | views.py | py | 1,542 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "forms.CustomerForm",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "models.Customer.objects.create",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "models.Customer.objects",
"line_number": 15,
"usage_type": "attribute"
},
{
"ap... |
28924843645 | from spacy.language import Language
from spacy.tokens import Doc
@Language.component("sub_text")
def create_subtexts(doc):
# restore「,」index list
punct_idxs = [0]
subtexts = []
for token in doc:
if token.is_punct:
punctype = token.morph.get("PunctType")
punctype = "".jo... | lll-lll-lll-lll/sent-pattern | sent_pattern/pipelines/sub_texts.py | sub_texts.py | py | 590 | python | en | code | 6 | github-code | 97 | [
{
"api_name": "spacy.tokens.Doc.set_extension",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "spacy.tokens.Doc",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "spacy.language.Language.component",
"line_number": 5,
"usage_type": "call"
},
{
"... |
18879611613 | from django.urls import path
from hunt.views import *
app_name = 'hunt'
urlpatterns = [
path('', home,name='home'),
path('scanner/', scanner,name='scanner'),
path('manage_qr/', manage_qr,name='manage_qr'),
path('add_qr/', add_qr,name='add_qr'),
path('detail_qr/<int:qr_id>', detail_qr,name='qr_detai... | edcNITD-website/esummit-website | hunt/urls.py | urls.py | py | 446 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
15128008446 | from matplotlib import pyplot as plt
import numpy as np
import cv2
import torch
import os
import random
from PIL import Image
def count_parameters(model):
return sum(p.numel() for p in model.parameters() if p.requires_grad)
def imshow_tensor(image, ax=None, title=None):
"""Imshow for Tensor."""
if ax is ... | victorvargass/chilean_sign_language_recognizer | util/util.py | util.py | py | 6,575 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.array"... |
19502397722 |
from itertools import product
n,m,x=map(int,input().split())
ca=[list(map(int,input().split())) for _ in range(n)]
for i in range(1,m+1):
count=0
for j in range(n):
count+=ca[j][i]
if count<x:
print(-1)
exit()
ans=10**9
for z in product((0, 1), repeat=n):#bit全探索のくみあわせを勝手に作ってくれる... | kanekyo1234/AtCoder_solve | ABC/167/C.py | C.py | py | 685 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "itertools.product",
"line_number": 17,
"usage_type": "call"
}
] |
34892751218 | import telegram
import requests
from bs4 import BeautifulSoup
import schedule
import time
bot = telegram.Bot(token = "5433279502:AAF1snTj1bPTAjLwYj5BFfvgsZKDvN7tT84")
id = '@AlarmBotmadeEunbae'
eun_id = 5085254544
def create_soup(url) :
res = requests.get(url)
res.raise_for_status()
soup = BeautifulSoup(r... | Juneunbae/TelegramBot | MyBot.py | MyBot.py | py | 8,423 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "telegram.Bot",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_num... |
17541395790 | from ..io import get_input
class Question(object):
def __init__(self, name, series=None, message=None, default=None, key=None,
update_function=None, do_not_ask=False,
quote_user_input=True):
self.name = name
self._series = series
if series is not None:
... | jackmaney/pypt | pypt/question/question.py | question.py | py | 2,025 | python | en | code | 10 | github-code | 97 | [
{
"api_name": "io.get_input",
"line_number": 48,
"usage_type": "call"
}
] |
16755149146 | from dgl.data import DGLDataset
import json
import dgl
import torch
import os
from dgl import save_graphs, load_graphs
class NestDataset(DGLDataset):
""" 用于在DGL中自定义图数据集的模板:
Parameters
----------
file_graph_path : str, 文件级图。
func_graph_path : str, 函数级图。
name: 使用数据集的类型
type:训练或测试
ratio:... | coder644/MRN-GCN | DGLData/NestDataset.py | NestDataset.py | py | 6,532 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "dgl.data.DGLDataset",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "json.load",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "dgl.graph",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number":... |
38857189828 | from __future__ import print_function
import os, sys, time, weakref, binascii
import traceback
import collections
import six
from twisted.python import log as twisted_log
from twisted.python import failure
from foolscap import eventual
from foolscap.logging.interfaces import IIncidentReporter
from foolscap.logging.inci... | warner/foolscap | src/foolscap/logging/log.py | log.py | py | 20,109 | python | en | code | 50 | github-code | 97 | [
{
"api_name": "twisted.logger.LogLevel.debug",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "twisted.logger.LogLevel",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "twisted.logger.LogLevel.info",
"line_number": 24,
"usage_type": "attribute"
... |
28590282967 | import os, argparse
import sys
import scipy
import timeit
import gzip
import torch
from numpy import save
import numpy as np
from sys import stdout
import pickle as pkl
import scipy.io as scio
import torchvision
import torch.nn as nn
from torch.utils.data import TensorDataset, DataLoader, Dataset
def to_numpy(x):
if ... | lauramanduchi/DC-GMM | dataset/stl10/compute_stl_features.py | compute_stl_features.py | py | 1,714 | python | en | code | 23 | github-code | 97 | [
{
"api_name": "scipy.io.loadmat",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "scipy.io",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "scipy.io.loadmat",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "scipy.io",
"line_numbe... |
38506117925 | from __future__ import with_statement
import datetime
import os
import time
import threading
import traceback
from cStringIO import StringIO
from nevow import inevow
from nevow.testutil import FakeRequest
from twisted.python.components import registerAdapter
from gavo.helpers import testhelpers
from gavo import bas... | brianv0/gavo | tests/taptest.py | taptest.py | py | 21,396 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "nevow.testutil.FakeRequest",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "nevow.testutil.FakeRequest.__init__",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "nevow.testutil.FakeRequest",
"line_number": 39,
"usage_type": "name"
},
... |
31366637379 |
import numpy as np
from PIL import Image
# We can add more of these later...keeping it simple for now!
COLOR_CODES = {
"COLOR_1": [107, 174, 193],
"COLOR_2": [30,65,69],
"COLOR_3": [11,135,182],
"COLOR_4": [28,46,37],
"COLOR_5": [171,195,197],
"COLOR_6": [62,99,99],
"COLOR_7": [91,133,137],
"COLOR_8": [59,108,127],
}... | cairodasilva/M3_A_Markov_Distiction | TryThisToSeeSomeBadArt.py | TryThisToSeeSomeBadArt.py | py | 3,158 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.random.choice",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"... |
73624756480 |
import requests,json,random,string,os
from datetime import datetime
from captcha.image import ImageCaptcha
from PIL import Image
from PIL.ImageDraw import Draw
from PIL.ImageFont import truetype
import base64
from uuid import uuid4
from Crypto.Cipher import AES
try:
from cStringIO import StringIO as BytesIO
exce... | xiangchihui/flask | back/apps/utils/common.py | common.py | py | 3,980 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "captcha.image.ImageCaptcha",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "PIL.Image.new",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "PIL.ImageDraw.Draw... |
71483107838 | import tkinter as tk
from time import sleep
import numpy as np
UNIT = 18 # pixels
EXPAND = [(0,-1),(1,0),(0,1),(-1,0)]
class Vision(tk.Tk, object):
def __init__(self):
super(Vision, self).__init__()
self._MapData = []
self.parkingdict = dict()
self.robotdict = dict()
se... | Luliangeric/garage | env/vision.py | vision.py | py | 5,386 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "tkinter.Tk",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "tkinter.Canvas",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.inf",
"line_number": 88,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_... |
71026993279 | from nltk.stem import WordNetLemmatizer
from nltk.corpus import wordnet as wn
from nltk.corpus import sentiwordnet as swn
from nltk import sent_tokenize, word_tokenize, pos_tag
from sklearn import metrics
from sklearn.model_selection import train_test_split
from TSA.Preproc import Preproc
lemmatizer = WordNetLemmatize... | Brew8it/Twitter-SA-Project | TSA/Lexicon/Lexicon.py | Lexicon.py | py | 2,382 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "nltk.stem.WordNetLemmatizer",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.wordnet.ADJ",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "nltk.corpus.wordnet",
"line_number": 14,
"usage_type": "name"
},
{
"api_n... |
22281727282 | from flask import Blueprint, jsonify
from flask_restful import Api
from marshmallow import ValidationError
from src.api.resources import CompanyList, CompanyResource
from src.api.resources import PositionList, PositionResource
from src.api.resources import ReadingRuleResource, ReadingRuleList
from src.api.resources im... | DevOopsMonitoring/backend | src/api/views.py | views.py | py | 3,261 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Blueprint",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "flask_restful.Api",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "src.api.resources.UserResource",
"line_number": 20,
"usage_type": "argument"
},
{
"api_name": "... |
22784778718 | import numpy as np
import pandas
import r_squared
import scipy as sp
from ggplot import *
df = pandas.read_csv('/Users/aha/Documents/workspace/udacity/p1/turnstile_weather_v2.csv')
stationNames = pandas.unique(df['station'])
countName = 'ENTRIESn_hourly'
stationName = 'station'
colNames =[stationName,countName,'longi... | theagger/analyzing-the-new-york-subway-dataset | section3_scatter.py | section3_scatter.py | py | 2,508 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.unique",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_n... |
18261855803 | try:
from io import StringIO
except ImportError:
from StringIO import StringIO
import json
from subprocess import check_output, CalledProcessError, TimeoutExpired, STDOUT
import os
import re
from concurrent.futures import ThreadPoolExecutor
from threading import Event
from ipython_genutils.tempdir import Temp... | vidartf/jupyterlab_discovery | jupyterlab_discovery/handlers.py | handlers.py | py | 11,342 | python | en | code | 47 | github-code | 97 | [
{
"api_name": "jupyterlab.commands._AppHandler",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "re.compile",
... |
4602358641 | # ----- Sound card class -----------------------------------------------------------------------------------------------
import sounddevice as sd
import numpy as np
import scipy.signal as sg
class AudioCard:
def __init__(self):
self.device_list = sd.query_devices() # List th... | ethan1987-2/I-C | Sound_card_class.py | Sound_card_class.py | py | 3,314 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "sounddevice.query_devices",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sounddevice.stop",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sounddevice... |
74518904958 | # Disabled while refactoring:
# pylint: disable=missing-docstring
# pylint: disable=missing-function-docstring
# pylint: disable=no-member
import hashlib
import logging
from abc import abstractmethod
from datetime import datetime, timedelta
from django.apps import apps
from django.template.defaultfilters import slugify... | octue/django-gcp | django_gcp/tasks/tasks.py | tasks.py | py | 11,797 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "django.apps.apps.get_app_config",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "django.apps.apps",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "ha... |
71681900478 | # sample_hdf5_data_loadin.py
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 21 23:31:43 2019
@author: dschaffner
"""
import matplotlib.pylab as plt
from load_hdf5 import load_hdf5
import numpy as np
import spectrum_wwind as spec
import indexfinderfuncs as iff
########################################################... | dschaffner/BMPL | Sample Scripts/sample_bvector_plot.py | sample_bvector_plot.py | py | 3,050 | python | en | code | 5 | github-code | 97 | [
{
"api_name": "load_hdf5.load_hdf5",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "indexfinderfuncs.tindex_min",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "indexfinderfuncs.tindex_min",
"line_number": 37,
"usage_type": "call"
},
{
"api_n... |
71556060800 | import pygame as pg
import numpy as np
import logging, log
import threading
log = logging.getLogger("othello")
''' =================================================== color setting '''
GREEN = (34, 116, 28)
black = (0, 0, 0)
color = GREEN
''' =================================================== size setting '''
... | kangprog/BoB_othello | v0.1/main.py | main.py | py | 6,972 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pygame.image.load",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"li... |
39153399207 | from time import sleep
from MyMQTT import *
import paho.mqtt.client as PahoMQTT
import json
import time
import re
import subprocess
import signal
import sys, os
from threading import Thread
class pubsub():
def __init__(self, clientID):
self.client = MyMQTT(clientID, "test.mosquitto.org", 1883, self)
... | s282133/C4ES_ransomware | DELIVERY/NODE_DELIVERY/fs_creato/NEWNEWpubsub.py | NEWNEWpubsub.py | py | 6,654 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "re.compile",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 65,
... |
33452237416 | from flask import Flask, render_template, request, redirect, url_for, flash
from functions import get_db_connection, get_item
app = Flask(__name__)
app.config['SECRET_KEY'] = 'your secret key'
@app.route('/')
def stock():
conn = get_db_connection()
stock = conn.execute('SELECT * FROM stock ORDER BY lokasyon'... | Urusaiix/StockManagement | sm_taha/app.py | app.py | py | 4,237 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "functions.get_db_connection",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "function... |
73643923519 | from pathlib import Path
import h5py
from softnanotools.logger import Logger
logger = Logger(__name__)
from hydrogels.trajectory.core import ParticleTrajectory, TopologyTrajectory
FOLDER = Path(__file__).parent
H5 = FOLDER / '_test.h5'
def test_write_LAMMPS_dump():
try:
traj = ParticleTrajectory(H5)
... | debeshmandal/hydrogels | test/trajectory/test_lammps.py | test_lammps.py | py | 1,293 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "softnanotools.logger.Logger",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "hydrogels.trajectory.core.ParticleTrajectory",
"line_number": 13,
"usage_type": "call"
},
{
... |
35637149538 | #!/usr/bin/env python
import sys
import json
import subprocess as sp
P = sp.Popen(
"herbstclient --idle 'tag_changed|tag_flags'",
text=True, shell=True, stdout=sp.PIPE, encoding='UTF-8')
tags_icns = {
'WEB': '\uf0ac', 'DEV': '\uf5fc', 'TERM': '\uf120', 'DOCS': '\uf02d',
'GIMP': '\uf1fc', 'READ': '\uf5... | yousufinternet/config-files | .config/eww/scripts/herbstluftwm_workspaces.py | herbstluftwm_workspaces.py | py | 1,331 | python | en | code | 20 | github-code | 97 | [
{
"api_name": "subprocess.Popen",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "subprocess.getoutput",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "json.dumps",... |
14492802652 | from tkinter import N
import download_xml
import config
file = download_xml.get_file(3354,'2021-11-01','2021-11-02')
list = download_xml.parse_file(file)
df_prtg = download_xml.pd.DataFrame(list)
df_prtg.drop_duplicates(keep='first', inplace=True)
df_prtg.reset_index(drop=True, inplace=True)
print(df_prtg)
#print(df_p... | GregSueco/Python | training/SQLite/insert_prtg.py | insert_prtg.py | py | 1,886 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "download_xml.get_file",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "download_xml.parse_file",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "download_xml.pd.DataFrame",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "... |
44457638010 | from turtle import title
from unicodedata import category
from django.shortcuts import render, redirect
from django.http import HttpResponse
from .models import Category, Product
from django.urls import reverse
def main(request):
product_list = Product.objects.all()
return render(request, 'main.html', {'produ... | Kiboshik/exam | exam/register/views.py | views.py | py | 2,426 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "models.Product.objects.all",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "models.Product.objects",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "models.Product",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": ... |
40054802035 | from setuptools import setup, find_packages
import os
version = '1.0'
setup(name='allen.catalog.timeline',
version=version,
description="TImeline base catalog",
long_description=open("README.txt").read() + "\n" +
open(os.path.join("docs", "HISTORY.txt")).read(),
# Get mo... | avoinea/allen.catalog.timeline | setup.py | setup.py | py | 999 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "setuptools.setup",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "setuptools.find_packages",
... |
70878438399 | import argparse
import json
import os
import os.path as osp
import pickle
import random
import sys
from argparse import Namespace
import numpy as np
import cv2
import scipy.misc
import torch
import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.optim as optim
from torch.utils import data
import sco... | NVlabs/SCOPS | train.py | train.py | py | 10,876 | python | en | code | 220 | github-code | 97 | [
{
"api_name": "cv2.setNumThreads",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 203,
"usage_type": "call"
},
{
"api_name": "argparse.Namesp... |
9750488670 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# author:wangtaihe
# datetime:2020/12/3 13:15
# software: PyCharm
import yaml, os, re
import logging
from logging.handlers import TimedRotatingFileHandler
from logging import handlers
logger = logging.getLogger()
# format = logging.Formatter('%(asctime)s - %(filename)s[li... | ATai2/dmptest | common/util.py | util.py | py | 2,160 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.handlers.TimedRotatingFileHandler",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 25,
"usage_type": "call"
},
{
"api_name":... |
71115634238 | # 公主(举)包
from bs4 import BeautifulSoup
def set_attr(options: dict, attr: list, value: any) -> str:
i = 0
for x in attr:
if i == 0:
exec_str = "options['%s']" % x
i += 1
else:
exec_str += "['%s']" % x
exec_str += " = %s" % value
print(exec_str)
e... | xiaoqiaowoai/science-utils-k | science_utils_k/utils/princess.py | princess.py | py | 2,539 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 44,
"usage_type": "call"
}
] |
42391381715 | import re
import string
import collections
import math
import operator
import pickle
import jieba
from nltk import ngrams
from datetime import datetime, timedelta
# ---------------- Functions ----------------
# Given news, find out the keywords for them
# input:
# news_dataset,a dict with date as key and news arra... | rtyrt/2018bda_midterm | get_keyword.py | get_keyword.py | py | 7,676 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "pickle.dump",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "jieba.cut",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number":... |
11586591211 | # -*- coding: utf-8 -*-
"""
Created on Sat Dec 19 09:58:28 2020
@author: User
"""
import pygame , random, math
class Ball(pygame.sprite.Sprite):
dx=0
dy=0
x=0
y=0
def __init__(self,speed,srx,sry,radium,color):
pygame.sprite.Sprite.__init__(self)
self.x=srx
... | gary20081122/AE401-Python | AE402_9.py | AE402_9.py | py | 2,058 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pygame.sprite",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pygame.sprite.Sprite.__init__",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pygame.sprite",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "p... |
30245864988 | import praw
import os
import re
from collections import deque
import threading
import yaml
import time
import requests
#set globals
r=praw.Reddit('botbustNSFW_v2')
ME = r.user.me('botbust_NSFW_v2')
SUBREDDIT = r.subreddit('botbustNSFW_v2')
LOG_SUB = r.subreddit('botbustNSFW_v2_log')
LOG_TITLE = "/u/{0} banned from /... | Trooplee/botbust | botbust.py | botbust.py | py | 10,979 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "praw.Reddit",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "yaml.load",
"line... |
37017921109 | # Created for databucket2.py library
# Library rest_utils makes some ugly errors with Databucket :[
import json
import logging
import re
import socket
import traceback
from datetime import datetime
from http.client import responses
import requests
from requests import Response, Session
log = logging.getLogger()
cla... | databucket/databucket-python-client | src/old_rest_utils_databucket.py | old_rest_utils_databucket.py | py | 8,932 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "requests.Re... |
3617748703 | from argparse import ArgumentParser
import obspy
from mqs_reports.catalog import Catalog
from mqs_reports.utils import autocorrelation
from obspy import UTCDateTime as utct
def define_arguments():
helptext = 'Create Noise time evolution vs event amplitde overview plot'
parser = ArgumentParser(description=hel... | sstaehler/mqs_reports | mqs_reports/scripts/plot_AC.py | plot_AC.py | py | 1,870 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "obspy.read_inventory",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "mqs_reports.catalog.Catalog",
"line_number": 38,
"usage_type": "call"
},
{
"api_name... |
22433989315 | import os
import pprint
import re
from ast import literal_eval
from colorama import Back, Fore
from easydict import EasyDict as edict
from dl_lib.utils.config_helper import (_assert_with_logging,
_check_and_coerce_cfg_value_type,
diff_dic... | FateScript/CenterNet-better | dl_lib/configs/base_config.py | base_config.py | py | 9,355 | python | en | code | 545 | github-code | 97 | [
{
"api_name": "dl_lib.utils.config_helper.update",
"line_number": 94,
"usage_type": "call"
},
{
"api_name": "dl_lib.utils.config_helper.update",
"line_number": 98,
"usage_type": "call"
},
{
"api_name": "easydict.EasyDict",
"line_number": 102,
"usage_type": "call"
},
{... |
44987024584 | # DRP原则:Don't repeat youself
# 框架(framework):特指为解决一个开放性问题而设计的具有一定约束性的支撑结构
# 对于所有的Web应用,本质上其实就是一个socket服务端,用户的浏览器其实就是一个socket客户端。
# Python内置了一个WSGI服务器,这个模块叫wsgiref,application()函数必须由WSGI服务器来调用
# from wsgiref.simple_server import make_server
# def application(environ,start_response):
# #通过environ封装一个包含所有请求信息的(字典)对象... | MHLUNATIC/Python | study/demo7/框架.py | 框架.py | py | 2,735 | python | zh | code | 0 | github-code | 97 | [
{
"api_name": "time.ctime",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "wsgiref.simple_server.make_server",
"line_number": 43,
"usage_type": "call"
}
] |
19039782320 | import logging
import os
from pathlib import Path
from typing import List, Tuple
import cv2
import hydra
import imutils
import numpy as np
import pandas as pd
from omegaconf import DictConfig, OmegaConf
from PIL import Image, ImageFilter
from tqdm import tqdm
from src.data.utils import (
extract_body_part,
ex... | ViacheslavDanilov/hsi_analysis | src/inference_clustering.py | inference_clustering.py | py | 8,484 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarray",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "numpy.unique",... |
44961905416 | import json
import pytest
from factom_did.client.constants import ENTRY_SCHEMA_V100
from factom_did.client.did import DID, DIDKeyPurpose
@pytest.fixture
def did():
return (
DID()
.management_key("man-key1", 0)
.management_key("man-key2", 2)
.did_key("did-key1", DIDKeyPurpose.Auth... | factomatic/py-factom-did | tests/client/test_version_upgrader.py | test_version_upgrader.py | py | 1,294 | python | en | code | 5 | github-code | 97 | [
{
"api_name": "factom_did.client.did.DID",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "factom_did.client.did.DIDKeyPurpose.AuthenticationKey",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "factom_did.client.did.DIDKeyPurpose",
"line_number": 15,... |
33699074473 | #!/usr/bin/env python
from __future__ import print_function
import numpy as np
import time
from utils.pybullet_tools.kuka_primitives3 import BodyPose, BodyConf, Register
from utils.pybullet_tools.utils import WorldSaver, connect, dump_world, get_pose, set_pose, Pose, \
Point, set_default_camera, stable_z, disconn... | ttianyuren/eTAMP | PR2/TASK_cook/build_scenario.py | build_scenario.py | py | 6,982 | python | en | code | 12 | github-code | 97 | [
{
"api_name": "os.path.dirname",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "utils.pybullet_tools.ut... |
74739060159 | import sqlite3
class Database:
def __init__(self, path_to_db):
self.path_to_db = path_to_db
@staticmethod
def create_db_if_not_exists(path_to_db, execute_command):
"""
Creates database if it doesn't exist
:param execute_command:
:param path_to_db: path to database
... | kr1sta1l/Tg-Shopping | classes/databases/database.py | database.py | py | 512 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sqlite3.connect",
"line_number": 17,
"usage_type": "call"
}
] |
13273651615 | from PyQt5 import QtCore
from electrum.event import Event
from PyQt5.QtGui import QMovie
from electrum.util import resource_path
from PyQt5.QtWidgets import QHBoxLayout, QLabel, QWidget
from electrum.gui.qt.util import read_QImage
from threading import Timer
from PyQt5.QtCore import QSize
class DiceHeaderWidget(QWidge... | wagerr/Wagerr-Electrum | electrum/gui/qt/quick_games/dice/dice_header_widget.py | dice_header_widget.py | py | 3,510 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.pyqtSignal",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtGui.QMovie",
"line_number": 12,
"usage_type": "argument"
},
{
"api_name":... |
71400603839 | """
Autoencoders testing environment (ATE)
Related to the work:
Stable training of autoencoders for hyperspectral unmixing
Paper ID 10040
Source code for the review process of International Conference
on Computer Vision 2021
"""
if __name__ == "__main__":
import os
import sys
sys.path.insert(0, os.path.a... | iitis/ClusteringAE | ATE/ate_tests/test_ate_autoencoders.py | test_ate_autoencoders.py | py | 2,782 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "sys.path.insert",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.