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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
29275417891 | """Classes for specific report types."""
from datetime import timedelta
from flask import jsonify
from sqlalchemy import and_, func, or_
from sqlalchemy.dialects.postgresql import INTERVAL
from sqlalchemy.orm import aliased
from api.models import db
from api.models.ea_act import EAAct
from api.models.event import Eve... | bcgov/EPIC.track | epictrack-api/src/api/reports/anticipated_schedule_report.py | anticipated_schedule_report.py | py | 9,498 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "report_factory.ReportFactory",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "datetime.timedelta",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.aliased",
"line_number": 66,
"usage_type": "call"
},
{
"api_name":... |
23803909510 | import logging
import json
from typing import Dict, List
import urllib.request
import pandas as pd
from argparse import ArgumentTypeError
import os
from loguru import logger
# def get_all_symbols(type:str):
# # ctx = ssl.create_default_context()
# # ctx.check_hostname = False
# # ctx.verify_mode = ssl.CER... | Yisan-X/Crypto_Data | core/config/binance/symbol_config.py | symbol_config.py | py | 4,032 | python | en | code | 5 | github-code | 97 | [
{
"api_name": "urllib.request.request.urlopen",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 38,
"usage_type": "name"
},
{
"api_nam... |
1508277568 | import re
import os
from math import *
import subprocess
import time
import datetime
import shutil
from functools import *
import septa
home_dir="/home/med"
mail_dir=home_dir+"/mail"
icon_dir=home_dir+"/scripts/icons"
def cmd(c):
return subprocess.Popen(c,shell=False,stdout=subprocess.PIPE).communicate()[0].decode()... | medthehatta/nifty-scripts | statusbar.py | statusbar.py | py | 8,734 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "subprocess.Popen",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "re.compile",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "re.search",
"lin... |
17668148552 | import inspect
from typing import List, Tuple, Sequence
import calculator.core.tokens as tokens
import calculator.core.nodes as nodes
from calculator.core.constants import BinaryOperators, UnaryOperators, OperatorAffix, Separators, MATH_CONSTANTS
from calculator.core.structs import OperatorInfo
from calculator.... | James-N/Qt-Calculator | calculator/core/parser.py | parser.py | py | 12,248 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "calculator.core.constants.Separators.SEP_COMMA",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "calculator.core.constants.Separators",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "calculator.core.constants.BinaryOperators.OP_ADD",
"... |
24537281483 | from math import ceil, floor
from typing import List
def smallestDivisor(nums: List[int], threshold: int) -> int:
"""Return smallest divisor such that sum of `nums` normalised
with respect to the divisor is at most `threshold`."""
lo = 1
hi = max(nums)
while lo < hi:
mid = floor((lo +... | ansonmiu0214/dsa-worked-solutions | solutions/smallest_divisor_given_threshold/solution.py | solution.py | py | 623 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "typing.List",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "math.floor",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_number": 13,
"usage_type": "call"
}
] |
5613655986 | # (c) Nelen & Schuurmans. GPL licensed, see LICENSE.rst.
import logging
from itertools import tee
import numpy as np
logger = logging.getLogger(__name__)
BBOX_LEFT = 0
BBOX_TOP = 1
BBOX_RIGHT = 2
BBOX_BOTTOM = 3
class PKMapper:
"""
Solves the following situation:
content_pk[pk[i]] == to_map[i]
... | nens/threedigrid | threedigrid/admin/utils.py | utils.py | py | 7,474 | python | en | code | 9 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "numpy.concatenate",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"lin... |
34786899670 | '''
Created on 10 Jan 2019
@author: Amir Haziem Razali
Base code lifted from tkinter-opencv test project.
Added to repo
This is for solely controlling the conveyor safety feature at plate one of the conveyor belt
'''
'''
Created on 28 Dec 2018
@author: Solarian Programmer, Amir Haziem Razali
@source: ... | amirhaziemdev/testing-repo | test/src/conveyor_gui.py | conveyor_gui.py | py | 28,069 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pymodbus.client.sync.ModbusSerialClient",
"line_number": 197,
"usage_type": "call"
},
{
"api_name": "tkinter.Canvas",
"line_number": 204,
"usage_type": "call"
},
{
"api_name": "tkinter.Button",
"line_number": 208,
"usage_type": "call"
},
{
"api_name... |
24726477211 | import optparse
from werkzeug.serving import run_simple
from werkzeug.wsgi import DispatcherMiddleware
def simple(env, resp):
resp(b'200 OK', [(b'Content-Type', b'text/plain')])
return [b'You have to call the url_prefix']
def load_options(default_host="127.0.0.1",
default_port="5000", url_prefix=... | clemenstyp/SnackBar | flaskrun.py | flaskrun.py | py | 2,444 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "optparse.OptionParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "optparse.SUPPRESS_HELP",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "optparse.SUPPRESS_HELP",
"line_number": 38,
"usage_type": "attribute"
},
{
"api... |
3391799458 | import re
from bin.service import FavouriteStorage, ShoutOutStorage, UserStorage, Storage
from bin.entity import Card
import time
import pymongo
class CardStorage(Storage.Storage):
def __init__(self):
super().__init__()
self.so_storage = ShoutOutStorage.ShoutOutStorage()
self.add_text_in... | Skadisson/phoenix | bin/service/CardStorage.py | CardStorage.py | py | 11,938 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "bin.service.Storage.Storage",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "bin.service.Storage",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "bin.service.ShoutOutStorage.ShoutOutStorage",
"line_number": 13,
"usage_type": "call"
... |
21599645422 | from flask import (Blueprint, render_template, g, redirect, url_for, flash, request, jsonify)
from jpApp.db import (get_db, updateDB)
bp = Blueprint("main", __name__)
@bp.route('/wordList')
def wordList():
db = get_db()
jpWords = db.execute(
'SELECT id, jpWord, pronunciation, meaning, dateRevised FRO... | MrMagicPickle/Japanese-Kanji-Study-App | jpApp/main.py | main.py | py | 2,406 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Blueprint",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "jpApp.db.get_db",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.flash",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
... |
28775634761 | # Import requests, shutil python module.
import requests
import shutil
import io,pickle
import urllib.request
from multiprocessing import Pool
from concurrent import futures
from urllib.error import URLError, HTTPError
from PIL import Image
from threading import Lock, Thread
from socket import timeout
import time
impor... | alleriali/Mood-Image-Search | LoadImage.py | LoadImage.py | py | 3,611 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "PIL.Image.open",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "pickle.load",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "threading.Lock",
"line_numbe... |
72915533438 | import csv
import json
import datetime
eos_contract_address = '0xd0a6E6C54DbC68Db5db3A091B171A77407Ff7ccf'
eos_contract_file_name = 'txs_'+eos_contract_address+'.json'
cmcAssetsListFile = 'assetsList.json'
try:
with open(cmcAssetsListFile, 'r') as fAssets:
assets = json.load(fAssets)
fAssets.clos... | DolphinBlockchainIntelligence/bitcointalk-sentiment | parsers/coinmarketcap_json_to_csv.py | coinmarketcap_json_to_csv.py | py | 1,432 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "json.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 40,
"usage_type": "call"
}
] |
1772564688 | #!/bin/python3
import json
import datetime
import subprocess
today = datetime.datetime.today()
log_file_name = f'/var/log/{today.strftime("%Y-%m-%d-awesome-monitoring.log")}'
timestamp = today.strftime("%H-%M-%S")
print(log_file_name)
with open ('/proc/loadavg','r', encoding = 'utf-8') as info:
info_dict = info... | dotsenkois/devops-netology | 10-monitoring-01-base/monitor.py | monitor.py | py | 1,708 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "datetime.datetime.today",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "subprocess.Popen",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "subproc... |
6704596251 | from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
from django.shortcuts import redirect, render
from django.urls import reverse_lazy
from django.views import generic
from django.views import View
from adn3.services import preregistrations_open
from courses.models import Course
from misc.mo... | mijara/adn3 | flyins/views.py | views.py | py | 6,362 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.contrib.auth.mixins.UserPassesTestMixin",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "django.urls.reverse_lazy",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "adn3.services.preregistrations_open",
"line_number": 21,
"usage_t... |
74666575359 | import streamlit as st
import tensorflow as tf
import cv2
from PIL import Image, ImageOps
import numpy as np
import matplotlib.pyplot as plt
import numpy as np
import os
import PIL
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from tensorflow.keras.models import Sequential
#... | chuqudee/Streamlit-App-deployment | Home.py | Home.py | py | 5,514 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "streamlit.set_page_config",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.models.load_model",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.models",
"line_number": 28,
"usage_type": "attribute"
},
... |
29725234313 | from IPython.display import HTML, display
from tic_tac_toe.Player import Player
from tic_tac_toe.Board import Board, GameResult, CROSS, NAUGHT
import tensorflow as tf
def print_board(board):
display(HTML("""
<style>
.rendered_html table, .rendered_html th, .rendered_html tr, .rendered_html td {
bord... | fcarsten/tic-tac-toe | util.py | util.py | py | 3,332 | python | en | code | 50 | github-code | 97 | [
{
"api_name": "IPython.display.display",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "IPython.display.HTML",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tic_tac_toe.Board.Board",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "ti... |
4272925067 | '''
Este programa é parte dos trabalhos práticos do segundo bimestre
da disciplina de Processamento Digital de Imagens,
ministrada na FCT-UNESP em 2022.
Autores:
Carlos Eduardo Fernandes de Santana
Daniel Henrique Serezane Pereira
///
Aula 10.1
Prática:
1) Implementar o Laplaciano e o Laplaciano da Gaussiana (LoG)... | Salies/pdi-pratica-ii | pdi/pseudocores.py | pseudocores.py | py | 1,688 | python | pt | code | 0 | github-code | 97 | [
{
"api_name": "numpy.empty",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numba.njit",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number"... |
27890264265 | import sys
def decompress(compressed):
"""Decompress a list of output ks to a string."""
from io import StringIO
# Build the dictionary.
dict_size = 256
dictionary = dict((i, chr(i)) for i in range(dict_size))
# in Python 3: dictionary = {i: chr(i) for i in range(dict_size)}
compressed = ... | Soloman-IT/TheoryCoding | decoder.py | decoder.py | py | 1,449 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "io.StringIO",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 47,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 49,
"usage_type": "attribute"
}
] |
32401103747 | import requests
import RPi.GPIO as r
r.setmode(r.BOARD)
r.setup(7,r.OUT)
#r.setup(3,r.OUT)
while(1):
a=requests.get("https://api.thingspeak.com/channels/804611/feeds.json?api_key=JIHJ8WHJRM4SKPWD&results=1")
a=a.json()
b=a['feeds'][0]["field1"]
print(b)
if b=='on':
r.output(7,1)
#r.... | Dudurock/Home-automation | Home_auto.py | Home_auto.py | py | 396 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "RPi.GPIO.setmode",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "RPi.GPIO.BOARD",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "RPi.GPIO.setup",
"line... |
30667296475 | from flask import Flask, render_template, request, redirect, url_for
import csv
import os
app = Flask(__name__)
# Helper functions
def read_info():
subjs_info = []
curr_dir = os.path.dirname(os.path.abspath(__file__))
file_name = os.path.join(curr_dir, "static/data/subjects.csv")
with open(file_n... | frostfire-zp/GPA_Calculator_Full | app.py | app.py | py | 6,703 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_n... |
31019888227 | import sqlite3
import datetime
class db_creation:
def vehical_details(self):
conn = sqlite3.connect('Parking_Management_System.db')
conn.execute('''CREATE TABLE Vehical_details
(ID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
... | Radheshyamvaishnav/Parking-Mangement-Software-System | Database_operations.py | Database_operations.py | py | 6,443 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sqlite3.connect",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
... |
31334319683 | from fpdf import FPDF
def main():
name = input("Name")
pdf = FPDF()
pdf.add_page()
pdf.image("shirtificate.png")
pdf.set_font("helvetica", "B", 16)
pdf.cell(40, 10, name, align="C")
pdf.output("shirtificate.pdf")
if __name__ == "__main__":
main() | armandosouza/ossu-computer-science | cs50p/shirtificate/shirtificate.py | shirtificate.py | py | 281 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "fpdf.FPDF",
"line_number": 5,
"usage_type": "call"
}
] |
72554214719 | import scrapy
class QuotesSpider(scrapy.Spider):
name = "quotes"
def start_requests(self):
urls = [
'http://quotes.toscrape.com/'
]
for url in urls:
yield scrapy.Request(url=url, callback=self.parse)
def parse(self, response):
quotes = res... | arnab-api/Fake-News-Detection | Implementation/Scrappers/Scrapy Scrappers/news_crawler/news_crawler/spiders/QuotesSpider.py | QuotesSpider.py | py | 836 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "scrapy.Spider",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "scrapy.Request",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "scrapy.Request",
"line_number": 28,
"usage_type": "call"
}
] |
27818782851 | # opencv-python
import cv2
# mediapipe人工智能工具包
import mediapipe as mp
# 进度条库
from tqdm import tqdm
# 时间库
import time
# 导入python绘图matplotlib
import matplotlib.pyplot as plt
# 定义可视化图像函数
def look_img(img):
'''opencv读入图像格式为BGR,matplotlib可视化格式为RGB,因此需将BGR转RGB'''
img_RGB = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
plt... | DeepestWind/human_pose | 单张图像.py | 单张图像.py | py | 1,509 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "cv2.cvtColor",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2RGB",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.imshow",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotl... |
72560727038 | # encoding:utf8
import time
from appium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
# 2、desired创建字典
desired_caps = dict()
# 3、platformName
# desired_caps['platformName'] = 'Android'
# # 4、platformVersion
# desired_caps['platformVersion'] = '8.0.0'
# # 5、deviceName
# desired_caps['device... | C1240055602/Appium1 | appium_test/appium_toast.py | appium_toast.py | py | 3,637 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "appium.webdriver.Remote",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "appium.webdriver",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.support.wait.WebDriverWait",
"line_number": 70,
"usage_type": "call"
},
{... |
6710135005 | import math
from openpyxl import *
from functools import reduce
#Read data from file and create data structure
wb = load_workbook('class_1.xlsx')
#Activate a certain worksheet, in this case just a worksheet
ws = wb.active
#{'name' : score, 'name' : score}
raw_data = {}
g = ws.rows
for c1, c2 in g:
raw_data.update(... | suhjohn/Study-repo | practice-python/ClassScore/Sequential ClassScore.py | Sequential ClassScore.py | py | 1,272 | python | ko | code | 0 | github-code | 97 | [
{
"api_name": "functools.reduce",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 28,
"usage_type": "call"
}
] |
9798179636 | import cs_bot
from cs_bot import StartupConfig
from cs_bot.adapters import sop_bot
from dotenv import load_dotenv
import os
load_dotenv()
config = {
"adapter":{
"app_id": os.environ["APP_ID"],
"app_secret": os.environ["APP_SECRET"],
"signing_secret": os.environ["SIGNING_SECRET"]
}
}
cs... | aarontanjaya/seatalk-bot | main.py | main.py | py | 512 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"li... |
37550697124 | from wasabi import color, msg
from labby.cli.core import BaseArgumentParser, Command
class DevicesCommand(Command[BaseArgumentParser]):
TRIGGER: str = "devices"
def main(self, args: BaseArgumentParser) -> int:
list_devices_response = self.get_client().list_devices()
msg.divider("Registered D... | luizribeiro/labby | labby/cli/commands/devices.py | devices.py | py | 671 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "labby.cli.core.Command",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "labby.cli.core.BaseArgumentParser",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "labby.cli.core.BaseArgumentParser",
"line_number": 9,
"usage_type": "name"
},
... |
689169871 |
import datetime
import os.path
import yaml
import pymysql
import get_operating_num
import lk_tools
"""
杯量预测: 只取营业门店数
算法预测: 优先取售卖门店数, 若没有售卖门店数, 则取营业门店数
"""
with open('../conf/predictive_sql.yml', encoding='utf-8') as f:
yml_data = yaml.load(f, Loader=yaml.CLoader)
mysql_sql = yml_data['sql']
mysql_conf... | canon-jianeng/python-lkcoffee | plan_script/pred_analytics/predictive_analytics/shop_data/get_shop_num.py | get_shop_num.py | py | 1,845 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "yaml.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "yaml.CLoader",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "pymysql.connect",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "get_operating_num.cul_pre... |
43800371484 | from flask import Flask, request, render_template
from src.churn.pipeline.predict_pipeline import CustomData, PredictPipeline
app = Flask(__name__)
@app.route('/')
def index():
"""
Render the home page.
"""
return render_template('home.html')
@app.route('/predictdata', methods=['POST'])
def predict_d... | milanbeherazyx/customer_churn_prediction | app.py | app.py | py | 1,723 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.request.form.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask.request... |
24230556956 | import os
import re
import json
import pickle
import numpy as np
from pickle import load
from keras.utils import to_categorical
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
class Helpers():
@staticmethod
def dict_to_list(descriptions_dict):
all_... | sampathv95/image-captioning | helpers.py | helpers.py | py | 3,504 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "keras.preprocessing.sequence.pad_sequences",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "keras.utils.to_categorical",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 64,
"usage_type": "call"
},
{
... |
21690150552 | import pygame
import random
pygame.init()
#red green blue
white = (255,255,255)
black = (0,0,0)
red = (255,0,0)
green = (0,155,0)
display_width = 800
display_height = 600
gameDisplay = pygame.display.set_mode((display_width,display_height))
pygame.display.set_caption('Slither')
clock = pygame.time.Clock()
appleTh... | Wakarho/Slither | Slither.py | Slither.py | py | 4,427 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "pygame.init",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "pygame.display... |
25016897720 | import argparse
import sys
import os
import torch
from torch import nn, optim
from torch.utils.data import DataLoader
from torchvision import datasets, transforms, utils
from tqdm import tqdm
from dataset import DCFontStroke
from vqvae import VQVAE
def test(dataset, model, outpath, device):
for i in range(len(da... | LR32768/calligraphy_style | test_vae.py | test_vae.py | py | 2,172 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "torchvision.utils.save_image",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "torchvision.utils",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "torch.cat",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path.join... |
24095263331 | import torch
import torch.nn as nn
from timm.models.layers import trunc_normal_, DropPath, to_2tuple
from mmcv.runner import load_checkpoint
from mmdet.models.builder import BACKBONES
from mmdet.utils import get_root_logger
from torch.nn.functional import interpolate as interpolate
import torch.nn.functional as F
def... | NVlabs/GCVit | detection/models/gc_vit.py | gc_vit.py | py | 27,079 | python | en | code | 387 | github-code | 97 | [
{
"api_name": "torch.nn.Module",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "torch.nn.AdaptiveAvgPool2d",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "torch.nn",
... |
24790671415 | from account.models import User as User_Profile
from .models import Order, OrderItem
from movies.models import Movie, Genre
from account.models import User
from search.forms import SortForm
from django.shortcuts import render, redirect
from django.contrib.auth.models import User as Auth_User
from django.db.models impor... | MindTheGap1/Kino | orders/views.py | views.py | py | 5,723 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "django.shortcuts.redirect",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "account.models.User.objects.filter",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "account.models.User.objects",
"line_number": 20,
"usage_type": "attribute"
... |
35342492311 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# 查看3D点云
import numpy as np
import cv2
import time
def pc_trans_movz(tz): return pc_trans_mov(0,0,tz)
def pc_trans_rotx(b):
return np.array([[1, 0 , 0 ,0],
[0, np.cos(b),np.sin(b),0],
[0,-np.sin(b),np.cos(b),0],
... | seaside2mm/SLAM_3D_Study | 3D点云/00.配套资料(代码、讲义、作业、参考文献)/00.配套资料(代码、讲义、作业、参考文献)/01.3D感知技术介绍/作业/pc_view.py | pc_view.py | py | 4,677 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "numpy.array",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_number": 14,
... |
72907541438 | # Create your views here.
from django.views.generic import ListView, DetailView
from django.db.models import Q
from . models import Herb, Category
class HerbsListView(ListView):
model = Herb
template_name = 'home.html'
class HerbDetailView(DetailView):
model = Herb
template_name = 'herb.html'
cla... | hamidme/nijaherbs | nijaherbs/views.py | views.py | py | 1,218 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.views.generic.ListView",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "models.Herb",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.views.generic.DetailView",
"line_number": 13,
"usage_type": "name"
},
{
"api_name"... |
23506833946 | from django.contrib.auth import authenticate, login, logout
from django.db import IntegrityError
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from django.urls import reverse
from django.contrib.auth.decorators import login_required
from django import forms
from .model... | gracefour11/web-programming | commerce/auctions/views.py | views.py | py | 10,397 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.forms.Form",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "django.forms.CharField",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.for... |
4576184907 | from flask_blog import db, login_manager
from flask import current_app
from datetime import datetime
from flask_login import UserMixin
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
""" These are all the models used in the db
- The serializer is used to handle password
- Date time is use... | MontyWilliams/Flask-Blog | flask_blog/models.py | models.py | py | 2,463 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask_blog.login_manager.user_loader",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "flask_blog.login_manager",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "flask_blog.db.Model",
"line_number": 20,
"usage_type": "attribute"
}... |
3726502708 | import urllib.request
import re
import bs4 as bs
import time
import concurrent.futures
t1 = time.time()
def get_site_text(link):
source = urllib.request.urlopen(link.replace("\"", "")).read()
bs_source = bs.BeautifulSoup(source, 'lxml')
raw_text = str(bs_source).strip()
raw_text = " ".jo... | AndrzejMorawski00/Advanced_Python | List_7/task_1.py | task_1.py | py | 2,591 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "time.time",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "urllib.request.request.urlopen",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "u... |
10767281724 | import os
import gtk
import gobject
from common.consts import *
from common.gui import GuiWorker
from common.config import TweakSettings
from common.utils import set_label_for_stock_button
from common.factory import WidgetFactory
class PreferencesDialog:
def __init__(self):
self.worker = GuiWorker('prefere... | tualatrix/ubuntu-tweak-old | src/preferences.py | preferences.py | py | 6,074 | python | en | code | 9 | github-code | 97 | [
{
"api_name": "common.gui.GuiWorker",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "common.config.TweakSettings.get_window_size",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "common.config.TweakSettings",
"line_number": 23,
"usage_type": "name"
... |
23356976685 | import pandas as pd
import matplotlib.pylab as plt
import seaborn as sns
from scipy.optimize import curve_fit
import numpy as np
if __name__ == "__main__":
datas=pd.read_csv("2bDistancesTimings_2.dat",sep=" ",index_col=False)
print(datas)
cutOff=0;
for hue,data in datas.groupby("method"):
... | lucaparisi91/qmc4 | particleKernels/timers/analPerformanceData.py | analPerformanceData.py | py | 862 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pylab.plot",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.pylab",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "scipy.optimize... |
17969210661 | import unittest
from absl.testing import parameterized
from tensorflow_privacy.privacy.logistic_regression import datasets
from tensorflow_privacy.privacy.logistic_regression import single_layer_softmax
class SingleLayerSoftmaxTest(parameterized.TestCase):
@parameterized.parameters(
(5000, 500, 3, 40, 2, 0.... | tensorflow/privacy | tensorflow_privacy/privacy/logistic_regression/single_layer_softmax_test.py | single_layer_softmax_test.py | py | 948 | python | en | code | 1,824 | github-code | 97 | [
{
"api_name": "absl.testing.parameterized.TestCase",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "absl.testing.parameterized",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "tensorflow_privacy.privacy.logistic_regression.datasets.synthetic_linearly_sepa... |
40358602517 | import os
import time
import random
from tqdm import tqdm
from game import Connect4Game
from player import MinimaxAlphaBetaPlayer
import matplotlib.pyplot as plt
class MinimaxPlayerSettings:
def __init__(self, name, depth, heuristic):
self.name = f"{name} (d={depth},h={heuristic})"
self.depth = dep... | mshenoda/connect4 | evaluate.py | evaluate.py | py | 5,644 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.makedirs",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "player.MinimaxAlphaBetaPlayer",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "player.MinimaxAlphaBetaPlayer",
"line_number": 20,
"usage_type": "call"
},
{
"api_name"... |
24559215782 | import cv2
print(cv2.__version__)
import argparse
import os
import time
# parse values
ap = argparse.ArgumentParser()
ap.add_argument('--scale',required=True, help='scale value 0.5 = 50% 1 = 100% , 2 = 200%', type=float)
ap.add_argument("-i", "--image", required = True, help= "path to the image we want to increase re... | juanc07/ImageHelper | scaleImage.py | scaleImage.py | py | 1,785 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "cv2.__version__",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "time.time",
... |
6834934815 | from lib.response import Response
from rest_framework import status, permissions, views
from budget_app.models import BudgetIncome, TotalBudget
from budget_app.serializer.budget_income_serializer import BudgetIncomeSerializer
class EditAddIncome(views.APIView):
permissions = [permissions.IsAuthenticated]
se... | funsojoba/fintrak_backend | budget_app/views/edit_add_income.py | edit_add_income.py | py | 1,121 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "rest_framework.views.APIView",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.views",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "rest_framework.permissions",
"line_number": 10,
"usage_type": "name"
},
{
"a... |
13252919734 | import sys
import pandas as pd
from sqlalchemy import create_engine
import re
import nltk
import numpy as np
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
from nltk.stem.wordnet import WordNetLemmatizer
import warnings
from sklearn.pipeline import Pipeline
from sklearn.feature_extraction.te... | CapAllen/Disaster-Response-Pipelines | models/train_classifier.py | train_classifier.py | py | 4,801 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "nltk.download",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "nltk.download",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "nltk.download",
... |
2506679136 | from unittest import mock
import pytest
from trade_tariff_reference.documents.fta.tests.test_application import get_mfn_siv_product
from trade_tariff_reference.documents.mfn.application import Application
from trade_tariff_reference.documents.mfn.constants import CUCUMBER_COMMODITY_CODES, SCHEDULE
from trade_tariff_r... | uktrade/trade-tariff-reference | trade_tariff_reference/documents/mfn/tests/test_application.py | test_application.py | py | 3,831 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "pytest.mark",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "trade_tariff_reference.documents.mfn.application.Application",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "trade_tariff_reference.documents.mfn.constants.SCHEDULE",
"line... |
30288517621 | from lib.action import PyraxBaseAction
__all__ = [
'FindVMIdAction'
]
class FindVMIdAction(PyraxBaseAction):
def run(self, name):
cs = self.pyrax.cloudservers
vm_id = [vm for vm in cs.servers.list()
if vm.name == name][0].id
return vm_id
| StackStorm/st2contrib | packs/rackspace/actions/find_vm_id.py | find_vm_id.py | py | 291 | python | en | code | 154 | github-code | 97 | [
{
"api_name": "lib.action.PyraxBaseAction",
"line_number": 8,
"usage_type": "name"
}
] |
12732507001 | from django.conf import settings
from django.core.mail import send_mail, send_mass_mail
from urllib.parse import quote
from django.contrib.sites.shortcuts import get_current_site
from django.template.loader import render_to_string
# paypal email
def paypalSubscriptionsEmail(request):
data = request.data[... | Festorz/Tips-Predictions-Python-Django-Server | Predictions/emails.py | emails.py | py | 4,401 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.contrib.sites.shortcuts.get_current_site",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.EMAIL_HOST_USER",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 31,
"usag... |
30288237818 | import os
import inspect
import pandas as pd
from datetime import date, timedelta
import sys
import subprocess
from IPython.display import display, HTML
from tqdm import tqdm
import scipy
from scipy import *
def select_cases_from_package(df, package_name, additional_keywords=[]):
"""additional_keywords can accept ... | AlexanderProchnow/DLL_Testing_Tool | Packaged_Code/diffwatch/Extracting_commits.py | Extracting_commits.py | py | 10,476 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "datetime.timedelta",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "subprocess.run",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 66,
"usage_type": "attribute"
},
{
"api_name": "subprocess.run... |
34416868692 | from Xlib import display
from time import sleep
import math
from math import atan2, degrees, pi
import subprocess
import numpy
import random
import sys
import argparse
import colormath
from colormath.color_objects import XYZColor, sRGBColor, xyYColor, HSVColor
from colormath.color_conversions import convert_color
p... | koosc/pixel-utils | color_fade.py | color_fade.py | py | 2,756 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "subprocess.Popen",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"l... |
28214489968 | from datetime import datetime
from src.model.reservation_config import ReservationConfigV1
from src.model.campground_reservation_config import CampgroundReservationConfigV1
from src.model.notification_preference_config import NotificationPreferenceConfig
from src.model.auto_book_preference_config import AutoBookP... | stephen-terrell/rec-res-manager | src/factory/reservation_config_factory.py | reservation_config_factory.py | py | 2,325 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "src.model.reservation_config.ReservationConfigV1",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "src.model.reservation_config.ReservationConfigV1",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "src.model.campground_reservation_config.Campgro... |
6641160716 | import os
import glob
from torch.backends import cudnn
from parameters import get_parameters
from data_loader import Data_Loader
from model import get_dcgan
from utils import Logger
from gan import GanTrainer, BigGanTrainer
def main(config):
cudnn.benchmark = True
img_size = config.img_size
batch_size ... | rikenmehta03/gan_mine | main.py | main.py | py | 2,074 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "torch.backends.cudnn.benchmark",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.backends.cudnn",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "data_loader.Data_Loader",
"line_number": 26,
"usage_type": "call"
},
{
"... |
74623099518 | from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
from reportlab.pdfgen import canvas
pdfmetrics.registerFont(
TTFont(
'arial',
'arial.ttf')
)
c = canvas.Canvas("hello.pdf")
c.setFont('arial', 32)
c.drawString(10, 450, "Toned Avenue")
c.showPage()
c.save()
| czubik8805/ReportLabKerning | main.py | main.py | py | 316 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "reportlab.pdfbase.pdfmetrics.registerFont",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "reportlab.pdfbase.pdfmetrics",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "reportlab.pdfbase.ttfonts.TTFont",
"line_number": 7,
"usage_type": "... |
16342298736 | import argparse
import torch
from pathlib import Path
from torch import nn
from torch.optim import Adam
from torch.utils.data import DataLoader
import torch.backends.cudnn as cudnn
import util.utils as utils
from albumentations import (HorizontalFlip,
VerticalFlip,
... | xuhuaren/TDSNet | train.py | train.py | py | 3,893 | python | en | code | 20 | github-code | 97 | [
{
"api_name": "torch.utils.data.DataLoader",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "util.dataset.RoboticsDataset",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 26,
"usage_type": "call"
},
{
"... |
74562105600 | from typing import Optional, List
from lang.python.helper import TreeNode, print_tree
class Solution:
def binaryTreePaths(self, root: Optional[TreeNode]) -> List[str]:
if not root:
return []
stack = [root]
stackPath = [str(root.val)]
res = []
while stack:
... | HotHat/leetcode | lang/python/s257.py | s257.py | py | 764 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "typing.Optional",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "lang.python.helper.TreeNode",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 6,
"usage_type": "name"
}
] |
74987288958 | from flask import Blueprint, render_template, request, flash, redirect, url_for, jsonify
from flask_login import login_required, current_user
from .models import User, Post, RSVP#, Recommend
from . import db
import numpy as np
import pandas as pd
from scipy.sparse import csr_matrix
from sklearn.metrics.pairwise import... | shukor98/Event-Recommendation-System-website | website/views.py | views.py | py | 6,555 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Blueprint",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "models.Post.query.all",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "models.Post.query",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "models.P... |
39544880254 | # -- coding: utf-8 --
import requests
from bs4 import BeautifulSoup
import retrying
import datetime
project_pull_url = "https://github.com/tensorflow/tensorflow/pull/"
def get_html(url):
headers = {
"user-agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3... | crx934080895/GitHub-PR | fail_判断.py | fail_判断.py | py | 2,966 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "retrying.retry",
... |
3395398597 | import sys
from bs4.element import Tag
import requests
import warnings
from bs4 import BeautifulSoup
import json
import random
warnings.filterwarnings('ignore')
def obter_demonstrativo_de_parcelas(session, id_formatado):
request = session.get('https://sic.cav.receita.fazenda.gov.br/siefpar-internet/cons/api/priva... | toptalentdevteam/Codeigniter-QT-CNPJ- | CI3/application/libraries/scripts_python/buscar_parcelamentos_pert_rfb.py | buscar_parcelamentos_pert_rfb.py | py | 3,307 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup... |
74652742718 | #############
## Imports ##
#############
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import convolve2d
##############
## Settings ##
##############
plt.rcParams['toolbar'] = 'None'
plt.rcParams['keymap.xscale'] = 'None'
plt.rcParams['keymap.yscale'] = 'None'
plt.rcParams['axes.grid']=True
#... | flaport/mplgames | connect4/connect4.py | connect4.py | py | 8,081 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 13,
"usage_type": "attribute"
},
{
... |
6030256337 | import os.path
from telegraph import Telegraph
# setting
currentFile = __file__
realPath = os.path.realpath(currentFile)
dirPath = os.path.dirname(realPath)
telegraph = Telegraph()
telegraph.create_account(short_name='file-converter')
# calibre cmd
def calibrecommand(inputt,output):
cmd = f'ebook-convert "{input... | RAJANGAMAMMA/File-Converter-Bot | helperfunctions.py | helperfunctions.py | py | 4,550 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "os.path.path.realpath",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "os.path.path.dirname",
... |
18641920526 |
#!/bin/python3
'''
Project Name: Read Text File, Change Military Time to Standard Time,
Write to a New Text File and Validate the Data
Date: June 22, 2020
Author: Olga Lazarenko
Description: the purpose of the program:
- read csv file and convert the columns with dates expressed in military time to standard ... | OlgaLazarenko/Random_Projects | Convert_Time_Data_Validation.py | Convert_Time_Data_Validation.py | py | 9,998 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.argv",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_... |
72158942398 | import numpy as np
from scipy.stats import norm
from ._base import GraphWorld
class DecisionTree(GraphWorld):
"""Decision tree from aversive pruning experiments.
Attributes
----------
states : array, shape = (n,)
Indices of states.
n_states : int
Total number of states.
via... | ndawlab/seqanx | sisyphus/envs/_tree.py | _tree.py | py | 8,843 | python | en | code | 14 | github-code | 97 | [
{
"api_name": "_base.GraphWorld",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "numpy.ones",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.nan",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "numpy.arange",
"line_nu... |
36035457791 | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
def zatwierdz():
zatwierdz = driver.find_element_by_xpath("//*[contains(text(), ' Zatwierdź ')]")
driver.execute_script("arguments[0].click();", zatwierd... | marcin-em/Portfolio | JobFind/job_find.py | job_find.py | py | 2,124 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "selenium.webdriver.ChromeOptions",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.common.desired_capabilities.DesiredCapabilities.CHROME",
"line_number"... |
24201066451 | import os
import shutil
import datetime
import base64
import chardet
import codecs
from pathlib import Path
from tempfile import TemporaryDirectory, tempdir
from typing import List, Sequence, Union
from zipfile import ZipFile, ZIP_DEFLATED
from utilfuncs.common import *
def create_dir_if_not_exists(dirpath: PathLike... | karanveersp/python-utilfuncs | utilfuncs/file.py | file.py | py | 7,971 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.makedirs",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "base64.b64encode",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "os.replace",
"line_numb... |
39226567173 | import cloudvolume
import ncollpyde
import tqdm
import pymaid
import numpy as np
import pandas as pd
from concurrent import futures
from .. import utils
from .segmentation import locs_to_segments
try:
import mcubes
except ImportError:
mcubes = None
except BaseException:
raise
use_pbars = utils.use_pbar... | navis-org/fafbseg-py | fafbseg/google/meshes.py | meshes.py | py | 10,125 | python | en | code | 11 | github-code | 97 | [
{
"api_name": "cloudvolume.frontends",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarray",
"line_number": 58,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "numpy.array... |
14503390527 | import torch
import torch.nn as nn
from torch.autograd import Variable
import click
import numpy as np
from numpy import random
import torch.nn.functional as F
from torch import optim
import random
import sys
import pickle
import pdb
import time
import os
import platform
import cv2
import matplotlib.pyplot as plt
impo... | YuuZhao/pln | plastic_train(copy).py | plastic_train(copy).py | py | 16,469 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.listdir",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "matplotlib.image.imread",
"line... |
30941359105 | import os
import sys
import csv
import pandas as pd
from PIL import Image
from PIL import ImageStat
# modify root_dir according to your repo
root_dir = '/home/stuartsul/J6-Sampyo_SediNet'
gravel_dir_temp = root_dir+'/temp_images/gravel'
sand_dir_temp = root_dir+'/temp_images/sand'
image_dir = root_dir+'/images'
#bri... | StuartSul/SampyoNet | preprocess/labeling.py | labeling.py | py | 4,109 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "PIL.ImageStat.Stat",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "PIL.ImageStat",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sys.argv",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line... |
33027480953 | '''
python InteractiveRunner.py python judges/DigitBlocks.py 0 -- python solvers/DigitBlocks.py
python InteractiveRunner.py python judges/DigitBlocks.py 1 -- python DigitBlocks.py
'''
'''
tower_count = 20
blocks_per_tower = 15
Test Set 1: P = 860939810732536850 (approx. 8.6 * 10 ** 17)
Test Set 2: P = 9374677939087623... | SestrenExsis/CodeKatas | withgoogle/solvers/DigitBlocks.py | DigitBlocks.py | py | 3,593 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.basicConfig",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "logging.debug",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "sys.stdout.flush... |
35429147930 | # https://leetcode.com/problems/how-many-numbers-are-smaller-than-the-current-number/
from typing import List
from copy import deepcopy
class Solution:
# O (N lgN)
def smallerNumbersThanCurrent(self, nums: List[int]) -> List[int]:
nums_copy = deepcopy(nums)
nums_copy.sort()
map = {}
... | ahsan-007/Competitive-Programming | Hash Table/Easy/HowManyNumbersAreSmallerThanTheCurrentNumber.py | HowManyNumbersAreSmallerThanTheCurrentNumber.py | py | 1,165 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "typing.List",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "copy.deepcopy",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 20,
"usage_type": "name"
}
] |
13585546392 | import os
import shutil
import yaml
from argparse import ArgumentParser
from importlib import import_module
from typing import List, Text
import utils.constants as c
import utils.user_interfaces as ui
class Config:
'''configurations
'''
def __init__(self):
self.__swpdl_root = os.path.split(__fil... | reouno/swpdl | config.py | config.py | py | 6,886 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.path.split",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "typing.Text",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "os.path.exists",
"line_num... |
17632304299 | def test():
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QStackedLayout
from PyQt5.QtCore import pyqtSlot
from .choosetype import NewProjectWindow
from .setparameters import SetParametersWindow
app = QApplication(sys.argv)
window = QWidget()
ctw = NewProjectWindow(wind... | broadwaylamb/Swiftee | sources/newproject/__init__.py | __init__.py | py | 880 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "PyQt5.QtWidgets.QApplication",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "choo... |
36375411921 | import pandas as pd
import matplotlib.pyplot as plt
import scipy.stats as st
import numpy as np
import sympy
# ------------------------------------配置区------------------------------------------------------
# 数据
L = 33
D1 = 0.02
D2 = 15.7
R0 = 47.82
# 这里的路径都是相对路径,当然你也可以写绝对路径
# 原文件
FILE_INPUT = 'res/physical.xlsx'
# 处理后的文... | ggbondd/physical | 气体热导率的测量/fucking-physical.py | fucking-physical.py | py | 4,681 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "pandas.read_excel",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pandas.read_excel",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "sympy.Symbol",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "sympy.integrate",
... |
29806857020 | import os
import sys
import unittest
import unittest.mock
import io
class Test(unittest.TestCase):
def get_dir(folder_name):
cwd = os.getcwd()
basepath = ""
while True:
if os.path.exists(folder_name):
break
os.chdir("..")
basepath = os.pa... | Hjalmar-Thunberg/ml-stock-market-predictor | backend/api/models/test.py | test.py | py | 1,366 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "unittest.TestCase",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_nu... |
70695881918 | """SoftWebauthnDevice class tests"""
from fido2.server import Fido2Server
from fido2.webauthn import AttestationObject, AuthenticatorData, CollectedClientData, PublicKeyCredentialRpEntity
from soft_webauthn import SoftWebauthnDevice
def test_register():
"""test registering generated credential"""
device = ... | bodik/soft-webauthn | tests/test_interop.py | test_interop.py | py | 1,669 | python | en | code | 40 | github-code | 97 | [
{
"api_name": "soft_webauthn.SoftWebauthnDevice",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "fido2.server.Fido2Server",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "fido2.webauthn.PublicKeyCredentialRpEntity",
"line_number": 14,
"usage_type": "... |
72621654720 | import os
import slack
from get_firestore_tracked_cases import get_firestore_tracked_cases
def list_tracked_cases_all(channel_id, user_id):
"""
Display all the Google Cloud support cases being tracked in the Slack
worskpace to the user that submitted the command.
Parameters
----------
channel... | GoogleCloudPlatform/professional-services | tools/google-cloud-support-slackbot/list_tracked_cases_all.py | list_tracked_cases_all.py | py | 1,407 | python | en | code | 2,602 | github-code | 97 | [
{
"api_name": "slack.WebClient",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "get_firestore_tracked_... |
4152515320 | import torch
from torchvision.datasets import ImageFolder
from data.transforms import *
import settings.environment as env
import pandas as pd
from PIL import Image
import numpy as np
import matplotlib.pyplot as plt
from torch.utils.data import Dataset
from torch.utils.data import DataLoader
from torchvision import tra... | ernoult/custom_c3lt | data/utils_CelebA.py | utils_CelebA.py | py | 13,739 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "torch.tensor",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "typing.Tuple",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "typing.Tuple",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.transpose",
"li... |
43276692994 | import pyspark
from operator import add
import time
"""
Transactions layout
0 - block_number: Block number where this transaction was in
1 - from_address: Address of the sender
2 - to_address: Address of the receiver. null when it is a contract creation transaction
3 - value: Value transferred in Wei (the smallest den... | sriramvinn/etherum-analysis-spark-hadoop | PartD_ScamAnalysis/PartD_MonthlyScamTransactions.py | PartD_MonthlyScamTransactions.py | py | 2,169 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pyspark.SparkContext",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "time.strftime",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "time.gmtime",
"line_number": 50,
"usage_type": "call"
}
] |
42746574745 | from typing import List, Dict
from tools_for_graph import *
from tools_for_heuristics import *
from tools_for_plotting import *
from algs.test_single_alg import test_single_alg
from algs.alg_a_star_space_time import a_star_xyt
from environments.env_LL_MAPF import EnvLifelongMAPF
class ParObsPFPrPAgent:
"""
Pu... | Arseni1919/PotentialFields_in_Lifelong-MAPF | algs/alg_ParObs_PF_PrP_seq.py | alg_ParObs_PF_PrP_seq.py | py | 22,051 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "typing.List",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "algs.alg_a_star_space_time.a_star_xyt",
"line_number": 219,
"usage_type": "call"
},
{
"api_name": "environments.env_LL_MAPF.EnvLifelongMAPF",
"line_number": 281,
"usage_type": "name"
... |
71506786558 | import jsonpath
import requests
import json
# API URL
url = "https://regres.in/api/users?page2"
# send get request -74
response = requests.get(url)
# Parse response to Json format
json_response = json.loads(response.text)
print(json_response)
# Fetch value using json-path
pages = jsonpath.jsonpath(json_response,'t... | szlone/pythonAPITesting | GET_Request/ParseJsonFormat.py | ParseJsonFormat.py | py | 739 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "jsonpath.jsonpath",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "jsonpath.jsonpath",
"lin... |
74912379838 | import logging
from lxml import html
from joj.model.output_variable import OutputVariable
from joj.utils import constants
log = logging.getLogger(__name__)
class JulesOutputVariableParser(object):
"""
Parser for the Jules documentation
Parses the html output variables into the database objects
"""
... | NERC-CEH/jules-jasmin | majic/joj/websetup_jules_output_variables.py | websetup_jules_output_variables.py | py | 3,762 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "lxml.html.parse",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "lxml.html",
"line_number": 59,
"usage_type": "name"
},
{
"api_name": "joj.model.output_variable.... |
1288717025 | """This script creates the reverse complement of a sequence.
The reverse_complement() function is the default function to create the reverse complement.
The reverse_complement_mitos() function is the one that should be used when dealing with MITOS annotations.
The reverse_complement_annotation() function adjusts the a... | marcelauliano/MitoHiFi | src/reverse_complement.py | reverse_complement.py | py | 2,583 | python | en | code | 132 | github-code | 97 | [
{
"api_name": "Bio.SeqIO.read",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "Bio.SeqIO",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "Bio.SeqIO.write",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "Bio.SeqIO",
"line_number... |
17515725159 | import scrapy
class BakerySpider(scrapy.Spider):
name = 'bakery'
# start_urls = ['https://keewahsf.com/collections/in-store-pick-up-only',]
# scrapy crawl bakery -a category=in-store-pick-up-only
def __init__(self, category=None, *args, **kwargs):
super(BakerySpider, self).__init__(*args, **kwargs)
se... | gymgirlfun/Automation | bakery_spider.py | bakery_spider.py | py | 725 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "scrapy.Spider",
"line_number": 3,
"usage_type": "attribute"
}
] |
17349130690 | # Tests containing Python 3.5+ syntax, extracted from test_client_server.py.
# To avoid test discovery, this module's name must not start with test_.
import asyncio
from ..client import *
from ..server import *
from ..test_client_server import handler
class ClientServerContextManager:
def setUp(self):
... | DevStarSJ/Study | Blog/Python/DjangoGirls/SlackBot/myvenv/lib/python3.5/site-packages/websockets/py35/client_server.py | client_server.py | py | 959 | python | en | code | 62 | github-code | 97 | [
{
"api_name": "asyncio.new_event_loop",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "asyncio.set_event_loop",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "test_client_server.handler",
"line_number": 21,
"usage_type": "argument"
},
{
"api_... |
40122751387 | import torch
import torch.nn as nn
import numpy as np
from scipy.optimize import linear_sum_assignment
import os
import os.path
import torch.nn.functional as F
class TransformTwice:
def __init__(self, transform):
self.transform = transform
def __call__(self, inp):
out1 = self.transform(inp)
... | snap-stanford/orca | utils.py | utils.py | py | 2,715 | python | en | code | 74 | github-code | 97 | [
{
"api_name": "numpy.sum",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "numpy.int64",
"line_number": 57,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "numpy.int64",
"line_number... |
21154641451 | import random as rnd
import numpy as np
from Rain import Rain
import threading
from matplotlib import pyplot as plt
import time
class Soil:
LAYERS_SIZE = []
NUMBER_OF_LAYERS = 5
LAYERS_PENETRATION = []
TIME = 0
DAY_LIMIT_TIME = 20
DAY = 0
MONTH = 0
SEASON = 'spring'
SEASONS = ['win... | sepantabco/Smart-Irrigation | Soil.py | Soil.py | py | 4,991 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "numpy.random.rand",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.rand",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "numpy.random",
... |
21954908342 | # -*- coding: utf-8 -*-
"""
Created on Sat Dec 19 10:17:32 2020
@author: Medyan
"""
# coding: utf-8
"""
process-data.py is a group of functions which
deal with sqlite database and
make some manipulation for text
Author: Medyan AbdelHamid
Date: Dec. 2020
"""
import sqlite3
import numpy as np
import ... | Medan-AbdelHamid/Hate-Speech | Python/SoureCode/process-data.py | process-data.py | py | 4,870 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "re.compile",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "re.VERBOSE",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "re.IGNORECASE",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "re.compile",
"line_... |
73771406717 | from django.conf.urls import url
import student
import managementview
import teacher
urlpatterns = [
url(r'^studentlist$', student.studentlist, name='studentlist'),
url(r'^ajax/studentdata$', student.data, name='getstudentdata'),
url(r'^ajax/studentselectdata$', student.selectdata, name='getstudentselectd... | xiaohuanshu/OpenCLMS | school/urls.py | urls.py | py | 1,522 | python | en | code | 8 | github-code | 97 | [
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "student.studentlist",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.conf.urls.url",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "stude... |
40035869814 | from subscriptions.models import Subscription, SubscriptionCategory
from rest_framework import serializers
class SubscriptionSerializer(serializers.ModelSerializer):
"""Subscription serializer."""
class Meta:
"""Meta class."""
model = Subscription
fields = [
"id",
... | KiOui/kanikervanaf | website/subscriptions/api/v1/serializers.py | serializers.py | py | 1,062 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "subscriptions.models.Subscription",
"line_number": 11,
"usage_ty... |
3247709607 | from config import GOODREADS_DATABASE_NAME
from wsgi.exceptions import NotFoundException
from wsgi.goodreads_api import GoodreadsClient
from wsgi.models import Resume, ReadingList, ResumeSettings
from wsgi import create_app
app = create_app()
shelves_to_pull = {'read-to-share', 'read-to-share-work', 'to-read-work', '... | dredivaris/pluggable_resume | utils/sync_goodreads_to_resume.py | sync_goodreads_to_resume.py | py | 1,971 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "wsgi.create_app",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "config.GOODREADS_DATABASE_NAME",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "wsgi.goodreads_api.GoodreadsClient",
"line_number": 31,
"usage_type": "call"
},
{
"... |
29301973574 | import pygame
from constants import BALL_RADIUS, SCREEN_HEIGHT, SCREEN_WIDTH, FPS
from support import Support
from math import sin, pi, cos
import numpy as np
import matplotlib.pyplot as plt
def pendulum_func(parameters):
return np.array([parameters[1], -gravity*sin(parameters[0])/length])
def runge_kutta_step(... | kenji-yamane/college | fundamentals/fis-26/simple_pendulum/main.py | main.py | py | 1,900 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.array",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "math.sin",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 23,
... |
21773949397 | from os import F_OK, access, sep
try:
from subprocess import PIPE, Popen
except ImportError:
PIPE, Popen = None, None
# relax module imports.
from lib.compat import SYSTEM
import lib.structure.internal.object
from status import Status; status = Status()
version = "repository commit"
repo_head = None
repo_typ... | nmr-relax/relax | version.py | version.py | py | 3,570 | python | en | code | 10 | github-code | 97 | [
{
"api_name": "subprocess.PIPE",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "subprocess.Popen",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "status.Status",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "subprocess.Popen",
"... |
73702060478 | import cv2
import cv
import sklearn
import numpy as np
import os
from Images import Images
from matplotlib import pyplot as plt
from sklearn.cluster import KMeans
from sklearn.decomposition import PCA
from sklearn import metrics
import lasagne
import theano
import theano.tensor as T
theano.config.exception_verbosity='h... | karnajitsen/Handwriting-Segmentation | HWSegment_v4.py | HWSegment_v4.py | py | 4,725 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "theano.config",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "theano.config",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "Images.Images",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "Images.Images",
... |
10318587081 | import matplotlib.pyplot as plt
import numpy as np
from matplotlib.colors import ListedColormap
from pycompss.api.api import compss_wait_on
from sklearn.datasets import make_moons, make_circles, make_classification
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
im... | bsc-wdc/dislib | examples/classifier_comparison.py | classifier_comparison.py | py | 4,870 | python | en | code | 41 | github-code | 97 | [
{
"api_name": "dislib.classification.CascadeSVM",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "dislib.classification.CascadeSVM",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "dislib.classification.RandomForestClassifier",
"line_number": 21,
"usag... |
19353788709 | import pygame
from bullet import Bullet
import game_functons as gf
# 游戏中玩家控制的主体
class Player():
# 初始化
def __init__(self, screen, settings):
self.screen = screen
# images 用来存放飞机的不同状态,目前有normal和up的特殊状态
self.images = {}
self.images["normal"] = pygame.image.load("./images/life.png... | Mochigo/HomeworkSet | python/final/Player.py | Player.py | py | 2,359 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pygame.image.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "game_functons.load_image",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "bullet.B... |
15015216826 | from flask import Flask, render_template, request
app = Flask(__name__)
notes = []
@app.route("/", methods=["GET", "POST"])
def index():
if request.method == "POST":
note = request.form.get('note')
notes.append(note)
return render_template("index.html", notes=notes)
# Here every note will be shown up to e... | KaranSingh07/lecture2 | Sessions/notes without sessions/application.py | application.py | py | 415 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "flask.request.form.g... |
36079372039 | import logging
import numpy as np
import turtle
import time
import sched
class Display:
def __init__(self):
self.window = turtle.Screen()
self.trt = turtle.Turtle(visible=False)
self.drawables = []
self.trt.speed(speed = 0)
self.updates = []
self.sch = sched.schedule... | Squid-oid/physics-fun | Sidelined_Code/trtle_imp/Gfx.py | Gfx.py | py | 1,509 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "turtle.Screen",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "turtle.Turtle",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sched.scheduler",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_numb... |
6678333782 | """Parse response parameters."""
from enum import Enum, auto
from typing import List, NamedTuple, Optional, Union
class LinkedParams:
def __init__(self, link_url: str, deep: int = 1):
self.link = link_url
self.deep = deep
def __repr__(self):
return 'Link: {link}'.format(link=self.li... | dicomgrid/sdk-python | parser/parse_response.py | parse_response.py | py | 7,625 | python | en | code | 9 | github-code | 97 | [
{
"api_name": "typing.Optional",
"line_number": 113,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 117,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 117,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_... |
74633791357 | import torch
from models.svqvae import SVQVAE
from torchvision import transforms
from torchvision.datasets import ImageFolder
from torch.utils.data import DataLoader, ConcatDataset, WeightedRandomSampler
import torch.nn as nn
import os, shutil, datetime
import logging
from data.stats import data
import numpy as np
impo... | davidw0311/svqvae | step0-2_check_mask_loader.py | step0-2_check_mask_loader.py | py | 5,027 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "torch.clamp",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "torch.utils.data.Dataset",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "os.listdir",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"l... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.