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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
18078551502 | from flask import Flask, render_template
import utils
app = Flask(__name__)
@app.route("/")
def index_page():
candidates = utils.load_candidates()
return render_template("list.html", candidates=candidates)
@app.route("/candidate/<int:id_>")
def candidate_page(id_):
candidate = utils.get_candidate(id_)
... | PetrGurev/Lesson_111_homework | app.py | app.py | py | 977 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "utils.load_candidates",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "utils.get_candi... |
30247737677 | import os
import sys
import argparse
from engine import *
from objects import *
def main(dt, ratio, v, viz):
left = Block(mass=100**0, shape=(1,1), start_v=0., start_x=3)
right = Block(mass=100**ratio, shape=(1,1), start_v=v, start_x=6)
wall = Wall(position=0, width=1)
engine = PhysicsEngine(tim... | mortenvester1/collision | collision/simulate.py | simulate.py | py | 1,237 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "engine.run",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 26,
"usage_type": "call"
}
] |
73749821173 | import numpy as np
import matplotlib.pyplot as plt
import math
def kosi(v0, theta):
lista_dometa = []
lista_visina = []
dt = 0.01
x = 0
y = 0
g = 9.81
Vx = np.cos(theta*np.pi/180)*v0
Vy = np.sin(theta*np.pi/180)*v0
while y >= 0:
x = x+Vx*dt
Vy = Vy-g*dt
... | IvanKalajzic/PAF | Vjezbe2/modul_4zdk.py | modul_4zdk.py | py | 2,716 | python | sh | code | 0 | github-code | 21 | [
{
"api_name": "numpy.cos",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.sin",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 14,
... |
24728774878 |
import requests
from io import BytesIO
import random
# display on screen
print("____________________________________________________________\n")
print(" SUPERHERO TOP TRUMPS ")
print("_____________________________________________________________\n")
print('Welcome To The SuperHero Top Trump Game... | claire-oe/superherotoptrumpgame | superherotoptrump.py | superherotoptrump.py | py | 1,951 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "random.randint",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 25,
"usage_type": "call"
}
] |
37452313563 | from animal import Animal
from lib.test_helpers import Bunch, create_test_world
from world import WorldCell
def test_size():
world = create_test_world()
assert world.size == 10
def test_get_cell_success():
world = create_test_world()
cell = world.get_cell(3, 3)
assert cell == WorldCell(world, 3,... | jkclark/EcoSim | tests/test_world.py | test_world.py | py | 1,567 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "lib.test_helpers.create_test_world",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "world.size",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "lib.test_helpers.create_test_world",
"line_number": 12,
"usage_type": "call"
},
{
... |
34625433002 | import tweepy
from api.tweet import Tweet
from datetime import datetime
from os import getenv
CONSUMER_KEY = getenv("TWITTER_CONSUMER_KEY")
CONSUMER_SECRET = getenv("TWITTER_CONSUMER_SECRET")
ACCESS_TOKEN = getenv("TWITTER_ACCESS_TOKEN")
ACCESS_TOKEN_SECRET = getenv("TWITTER_ACCESS_TOKEN_SECRET")
# Tweepy authentica... | Jiaaa-yang/orbital-to-the-moon | api/twitter_api.py | twitter_api.py | py | 2,254 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "os.getenv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 10,
"us... |
38859861357 | import copy
from components.episode_buffer import EpisodeBatch
from modules.critics.facmac import FACMACDiscreteCritic
from components.action_selectors import multinomial_entropy
import torch as th
from torch.optim import RMSprop, Adam
from modules.mixers.vdn import VDNMixer
from modules.mixers.qmix import QMixer
from ... | oxwhirl/facmac | src/learners/facmac_learner_discrete.py | facmac_learner_discrete.py | py | 10,260 | python | en | code | 68 | github-code | 21 | [
{
"api_name": "copy.deepcopy",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "modules.critics.facmac.FACMACDiscreteCritic",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 25,
"usage_type": "call"
},
{
"api_name"... |
16422127685 | from pycaw.pycaw import AudioUtilities, IAudioEndpointVolume
from comtypes import CLSCTX_ALL
from ctypes import cast, POINTER
class VolumeApi:
def __init__(self):
self.vol_obj = self.CreateVolumeInstance()
def CreateVolumeInstance(self):
audio_util = AudioUtilities.GetSpeakers()
... | krisnadharma1412/Adjusting-Volume-Levels-Using-Mediapipe | volume_api.py | volume_api.py | py | 783 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pycaw.pycaw.AudioUtilities.GetSpeakers",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pycaw.pycaw.AudioUtilities",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "comtypes.CLSCTX_ALL",
"line_number": 14,
"usage_type": "argument"
},
... |
25189044642 | """
👔 Igor Perković
âš™ CREATED: 2021-09-18 12:11:52
📆 CHANGED: 2022-04-01 00:13:57
"""
import sys
from tabulate import tabulate
if len(sys.argv):
# First, join all arguments into one string
tmp = ' '.join(sys.argv[1:])
# Then, replace raw string '\n' with some exotic character,... | igorp74/Python_utils | Fancy_table.py | Fancy_table.py | py | 1,369 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "tabulate.tabulate",
"line_number": 36,
"usage_type": "call"
}
] |
618003604 | __author__ = 'nmew'
__version__ = 0.1
import sys
sys.path.insert(0,'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages')
import os
import logging
import numpy as np
from graph_tool.all import *
from analyzegraph import *
def main():
parser = arguments()
# single dimension
... | schoolacct/DissimilarityGraphAnalysis | create_analysis_graph.py | create_analysis_graph.py | py | 5,181 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.path.insert",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "logging.basicConfig",
"... |
26848949487 | from datetime import datetime
from lxml import etree, html
from pytz import timezone
from pathlib import Path
import os
def adjustTimeZone(time):
melbourneZone = timezone('Australia/Melbourne')
localizedTime = melbourneZone.localize(datetime.strptime(time[6:25], '%Y-%m-%dT%H:%M:%S'))
if(localizedTime.strft... | rickyaut/mysite | ui.content/src/main/python/PostProcess.py | PostProcess.py | py | 1,904 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pytz.timezone",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "pathlib.Path"... |
71252704374 | from root.raspradio.config.configuration import get_user_config_path
import configparser
from root.raspradio.config import configuration
def save_user_settings(reqargs):
configPath = get_user_config_path()
config = configparser.ConfigParser()
# This prevents that config-keys get toLowerCase automatically
... | hawkpatrick/raspradio | app/src/root/raspradio/config/user_settings.py | user_settings.py | py | 872 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "root.raspradio.config.configuration.get_user_config_path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "configparser.ConfigParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "root.raspradio.config.configuration.on_user_config_update",
... |
72283441974 | import requests
from bs4 import BeautifulSoup
url = ''
def downloader_uzmovi(url: str):
if url.startswith('http://uzmovi.com/') or url.startswith('https://uzmovi.com/'):
response = requests.get(url=url)
parser_data = BeautifulSoup(response.text, features='html.parser')
data ={}
... | azamat684/Uzmovi_Video_Downloader | uzmovi_downloader.py | uzmovi_downloader.py | py | 1,070 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 10,
"usage_type": "call"
}
] |
40170432137 | import boto3
dynamodb = boto3.resource('dynamodb', region_name='eu-west-3')
table = dynamodb.create_table(
TableName='info_empresasFinal',
KeySchema=[
{
'AttributeName': 'empresa_id',
'KeyType': 'HASH'
},
{
'AttributeName': 'ventas',
... | v0st0k1/Scraperpy | ScraperPy/crea_tabla.py | crea_tabla.py | py | 793 | python | ca | code | 2 | github-code | 21 | [
{
"api_name": "boto3.resource",
"line_number": 3,
"usage_type": "call"
}
] |
16869434332 | import statistics
import librosa
import numpy as np
import scipy.stats
class DataProcessing:
"""
The DataProcessing class is used to prepare audio data for analysis
"""
def __init__(self, target_sr: int = 8000) -> None:
"""
Initialize the class with the destination path, and target s... | Aketirani/AudioMNIST | src/data_processing.py | data_processing.py | py | 5,747 | python | en | code | 5 | github-code | 21 | [
{
"api_name": "numpy.ndarray",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "numpy.issubdtype",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.floating",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "numpy.float32... |
409663277 | import logging
import sys
from local.io import ProjectFolders
from constants import Constants
__all__ = ["command_response_logger", "whatsapp_sending_logger", "command_action_logger"]
# This module is meant to almost never change anyway, let it be like that for now...
command_response_logger = logging.Logger("comma... | marcosdly/insalubre-bot | src/log.py | log.py | py | 1,719 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "logging.Logger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.Logger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.Logger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.Formatter",
... |
1006097973 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import six as _six
# pylint: disable=unused-import,line-too-long
from tensorflow.contrib.tensorrt.wrap_conversion import add_test_value
from tensorflow.contrib.tensorrt.wrap_conversion import calib_convert
from... | kendryte/kendryte-tensorflow | tensorflow/contrib/tensorrt/python/trt_convert.py | trt_convert.py | py | 17,770 | python | en | code | 58 | github-code | 21 | [
{
"api_name": "six.PY2",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.core.protobuf.rewriter_config_pb2.RewriterConfig",
"line_number": 91,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.core.protobuf.rewriter_config_pb2",
"line_number": 9... |
34058475150 | from typing import Any, Optional
from abc import ABC, abstractmethod
import paramiko
import telnetlib
import serial
from netmiko.utilities import write_bytes
from netmiko.netmiko_globals import MAX_BUFFER
from netmiko.exceptions import ReadException, WriteException
class Channel(ABC):
@abstractmethod
def __i... | ktbyers/netmiko | netmiko/channel.py | channel.py | py | 5,619 | python | en | code | 3,278 | github-code | 21 | [
{
"api_name": "abc.ABC",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_... |
70619889014 | from django.db import models
import os
import spine_detection
from django.core.files.base import File
import scrap_book
import random
def bookshelf_image_path(instance, filepath):
base_name = os.path.basename(filepath)
name, ext = os.path.splitext(base_name)
new_filename = 'bookshelf'
new_filename = "... | LakshyaKhatri/Bookshelf-Reader-API | detect_spines/models.py | models.py | py | 4,667 | python | en | code | 36 | github-code | 21 | [
{
"api_name": "os.path.basename",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.splitext",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_nu... |
17703253541 | #-----------interfacs/functions ----
import os,platform
import wx
from Main import *
from rc.gradientimages import *
from rc.toolbarimages import getToolBar_exportImage, getToolBar_open_folderImage
APP_PLATFORM = platform.system()
#-----------global event--------
EVT_OBJS_SELECT = 9001
EVT_OBJS_UNSELECT = 9002
#----... | GeoDaCenter/CAST | stars/__init__.py | __init__.py | py | 7,216 | python | en | code | 21 | github-code | 21 | [
{
"api_name": "platform.system",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "wx.WXK_COMMAND",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "wx.BLACK",
"line_number": 69,
"usage_type": "attribute"
},
{
"api_name": "wx.Colour",
"lin... |
27594332346 | # MinStartUpLoader: 关闭后程序隐藏到托盘里。
# recompile to exe: pyinstaller -w -i pic/code.ico ./src_code/startUpLoader.py
# -w: no console shown. -F: compress to single exe file. May fail.
from PyQt5 import QtWidgets
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from upLoader import upLoade... | iPwnXX/myIpv6 | src/startUpLoader.py | startUpLoader.py | py | 1,774 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "example_ui.Ui_MainWindow",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets.QApplication",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 52,
"usage_type": "name"
},
{
"api_na... |
23002628861 | #IMPORTING MODULES
import pandas
from fractions import Fraction
#FUNCTIONS
#string checker function
def string_checker(item, checker, options, error):
#set variabes
is_valid = ""
chosen = ""
#running the string checker when not checking a string is in a list
if checker == "not list":
# i... | peterssophie51/Recipe-CostCalculator | 00_RCC_base_v5.py | 00_RCC_base_v5.py | py | 13,661 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "fractions.Fraction",
"line_number": 102,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 426,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 429,
"usage_type": "call"
}
] |
33958635717 | import pymongo
from flask import Flask, jsonify, request
conn = pymongo.MongoClient('localhost', 27017)
db = conn['KEYWORDS']
t = db.keyword_list
app = Flask(__name__)
# @app.route("/keyword", methods = ['POST'])
# def postkeyword():
# data = re quest.get_json()
# category = data["category"]
# ... | Yogesh-eazr/keywordFlask | mongodbb.py | mongodbb.py | py | 2,297 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.request.get_json",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "flask.request",
... |
39409006206 | import datetime
import json
import sys
import requests
'''
.Name
-CrewAllocationDelta.py
.Description
-Automate Crew Allocations for Click Schedule. Will delete oldest allocation, create the next newest allocation,
and assign crew leader to the newest allocation if present.
.Version
-Original Releas... | dalenhurtt/PythonWork | CrewAllocation.py | CrewAllocation.py | py | 7,041 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.argv",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number... |
73397773492 | import cv2
from tkinter import *
from tkinter import messagebox
def handsome_cam():
cam = cv2.VideoCapture(0)
while True:
_, frame = cam.read()
cv2.imshow("DateWithMe: some name", frame)
if cv2.waitKey(10) == ord('q'):
break
date = Tk()
date.title("D... | Abul-Aiman-Shaa/dateWithPython | meet.py | meet.py | py | 473 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_number": 11,
"usage_type": "call"
}
] |
25375233077 | from asgiref.sync import sync_to_async
from catalog.models import WriteOff, WriteOffItem
from tg_bot.services.sells import get_product_modification
# создание объекта Inventory и его элементов
async def create_write_off(user_data, telegram_user):
modification_sku = user_data.get('choosingModification', '')
pr... | zharuk/django-deva7 | deva7km/tg_bot/services/write_off.py | write_off.py | py | 1,279 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "tg_bot.services.sells.get_product_modification",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "catalog.models.WriteOff",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "asgiref.sync.sync_to_async",
"line_number": 22,
"usage_type": "cal... |
18627693652 | from gym import utils
from gym_cenvs.envs.base import MujocoBase
from gym.envs.mujoco import mujoco_env
import numpy as np
import os
class Kendama(mujoco_env.MujocoEnv, utils.EzPickle, MujocoBase):
def __init__(self, transparent_rope=False):
self.done = False
# Number of links in chain link approx... | ishank-juneja/Online-Model-Selection | gym_cenvs/envs/kendama.py | kendama.py | py | 6,015 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "gym.envs.mujoco.mujoco_env.MujocoEnv",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "gym.envs.mujoco.mujoco_env",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "gym.utils.EzPickle",
"line_number": 8,
"usage_type": "attribute"
},
... |
12043870233 | import os
from time import sleep
from datetime import datetime
count = 0
totalpingCount = 0
while True:
hostname = "211.20.149.130" #example
response = os.system("ping " + hostname)
totalpingCount = totalpingCount+1
#and then check the response...
if response == 0:
print(hostname, 'is up!')... | pengzhen80/hello_py | http_server/ping_server.py | ping_server.py | py | 598 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.system",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"li... |
37786449312 | from typing import Dict, Any
from datetime import timedelta
import logging
import aiohttp
import async_timeout
from plugp100 import (
TapoApiClient,
TapoApiClientConfig,
TapoException,
TapoError,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from hom... | jamiegardiner/home-assistant-config | custom_components/tapo/common_setup.py | common_setup.py | py | 4,260 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "homeassistant.core.HomeAssistant",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "typing... |
70840138934 | import os
from sqlite3 import DatabaseError
from typing import List, Literal
import boto3
import numpy as np
from summarizer.domain.model.face import FaceClustering
from summarizer.domain.model.image import Image
from summarizer.domain.model.video import Video
from summarizer.infrastructure.repository import (Feature... | bambbam/summarizer-worker | summarizer/service/command.py | command.py | py | 2,826 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "summarizer.service.base.Command",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "typing.Literal",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "summarizer.infrastructure.repository.FeatureRepository",
"line_number": 27,
"usage_type": ... |
33937043086 | import re
from typing import TypeAlias
import disnake
from disnake.ext import commands
from helper import Cog, CogMetaData, DatBot, Settings
from helper.csettings import PistonConfig
from helper.models import PistonEvalResponse
FORMATTED_CODE_REGEX = re.compile(
# https://github.com/onerandomusername/monty-python... | Stinky-c/DatBot | src/cogs/piston_cog.py | piston_cog.py | py | 2,918 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "re.compile",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "re.DOTALL",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "re.IGNORECASE",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "helper.Cog",
"line_n... |
73256170612 | from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from your_database_models import Restaurant, Customer, Review # Import your database models
DATABASE_FILE = "models.db"
engine = create_engine(f"sqlite:///{DATABASE_FILE}")
Session = sessionmaker(bind=engine)
session = Session()
res... | shukri26/Phase--3--SQLAlchemy--Code--Challenge-Restaurants | seeds.py | seeds.py | py | 1,038 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.sessionmaker",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "your_database_models.Restaurant",
"line_number": 36,
"usage_type": "call"
},
{
... |
34309118508 | from datetime import datetime
from django.http import HttpRequest, HttpResponse
from django.utils import simplejson as json
from django.conf import settings
from django.db.models import Q
from website.utils.httpUtil import HttpRequestProcessor
from website.utils.geoHelper import GeoHelper
from website.utils.ma... | solarpermit/solarpermit | website/services/jurisdiction_services.py | jurisdiction_services.py | py | 2,989 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "website.utils.httpUtil.HttpRequestProcessor",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "website.models.AnswerReference.objects.order_by",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "website.models.AnswerReference.objects",
"line_nu... |
12165100371 | import sqlite3
conn = sqlite3.connect('database.db') # auto commit -> isolation_level=None
cursor = conn.cursor()
nome = 'JOSÉ DA SILVA'
# cursor.execute('UPDATE cliente SET nome=? WHERE id=3', (nome,))
cursor.execute('UPDATE cliente SET nome=:nome WHERE id=3', {'nome': nome})
# read
cursor.execute('SELECT * FROM c... | MarioGN/python | db_api/consulta_parametrizada.py | consulta_parametrizada.py | py | 725 | python | pt | code | 0 | github-code | 21 | [
{
"api_name": "sqlite3.connect",
"line_number": 4,
"usage_type": "call"
}
] |
22926660665 | # encoding: utf-8
#
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Contact: Kyle Lahnakoski (kyle@lahnakoski.com)
#
# THIS THREADING MODULE IS PERMEATED BY THE pl... | mozilla/jx-sqlite | vendor/mo_threads/lock.py | lock.py | py | 3,735 | python | en | code | 35 | github-code | 21 | [
{
"api_name": "mo_logs.Log",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "mo_logs.exceptions.Except",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "mo_threads.threads.Thread",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "mo_lo... |
7478472003 | from flask import Flask, request, jsonify
from flask_cors import CORS
import requests
from dotenv import load_dotenv
load_dotenv()
import os
app = Flask(__name__)
CORS(app)
@app.route("/getTicket")
def getTicket():
url = 'https://zendeskcodingchallenge4412.zendesk.com/api/v2/tickets.json?per_page=25'
user = o... | weide97/zendesk-coding-challenge | flask-services/server.py | server.py | py | 2,139 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"lin... |
9628774695 | #!/usr/bin/env python
import wx
import sqlite3
import time
import datetime
class clippyDB():
def __init__(self):
# connect to db and do stuff here...
self.dbConnection = sqlite3.connect('clippy.sqlite')
self.dbCursor = self.dbConnection.cursor()
def ClipExists(self, snippet):
... | webgear/clippy | DB.py | DB.py | py | 1,426 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "sqlite3.connect",
"line_number": 11,
"usage_type": "call"
}
] |
33692974097 | from django.conf.urls import patterns, url
from . import views
from rest_framework.urlpatterns import format_suffix_patterns
api_urlpatterns = patterns('',
url(r'^project/api/(?P<pk>[0-9]+)$', views.project_json_detail),
url(r'^project/api/$', views.project_json_list),
)
api_urlpatterns = format_suffix_patterns... | AncientSwordRage/gAnttlr | gantt_charts/urls.py | urls.py | py | 912 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.conf.urls.patterns",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "rest... |
39177036651 | from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User, Group
from app import models
class MarkForm(forms.ModelForm):
class Meta:
model = models.Mark
fields = ['subject', 'assignment', 'student', 'value']
widgets = {
... | jstarzyk/python-lab | deanery/app/forms.py | forms.py | py | 1,376 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "app.models.Mark",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "app.model... |
9951671627 |
from asyncio.tasks import wait
from itertools import repeat
import discord
import os
import asyncio
import datetime
import time
import random
import re
import threading
from discord import user
from discord import message
from discord.ext import commands
from discord.utils import get
from random import randint
from ... | Bleusou/56734256341246179846379814691 | Fragbot.py | Fragbot.py | py | 4,577 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "javascript.require",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "javascript.require",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "discord.Intents",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "discord.ext.com... |
29546118425 | import numpy as np
from project_heart.utils.vector_utils import *
from collections import deque
import pyvista as pv
def create_rim_circunference(
center: np.ndarray,
radius: float,
height: float,
normal: np.ndarray,
cross_normal: np.ndarray,
radial_resolution: int = 64,
rim_angles: np.nda... | Nobregaigor/Project-Heart | project_heart/utils/spatial_points.py | spatial_points.py | py | 3,728 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "numpy.ndarray",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarray",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarray",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarray... |
671093618 | import numpy as np
import pandas as pd
import logging
import torch
import torch.nn as nn
import torch.utils.data as D
import torch.nn.functional as F
import torch_xla
import torch_xla.distributed.data_parallel as dp
import torch_xla.utils.utils as xu
import torch_xla.core.xla_model as xm
import os, time, random, ar... | leigh-plt/kaggle-rsna | src/inference.py | inference.py | py | 2,862 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.empty",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.concatenate",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.round_",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "torch_xla.core.xla_model.g... |
24341950191 | import numpy
from sklearn.svm import SVC
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
from sklearn.model_selection import cross_val_score
from sklearn.model_selection import RandomizedSearchCV
from sklearn.svm import LinearSVC
from sklearn.model_selection import GridSe... | mmsamiei/machine-learning-final-project | models/svm.py | svm.py | py | 2,131 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sklearn.svm.SVC",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.RandomizedSearchCV",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.cross_val_score",
"line_number": 43,
"usage_type": "ca... |
32340315576 | from django.urls import path
from . import views
app_name = 'frontend'
urlpatterns = [
path('change-home-image/', views.change_home_image, name='change_home_image'),
path('change-home-pdf/', views.change_home_pdf, name='change_home_pdf'),
path('change-stats/', views.change_stats, name='change_stats'),
... | jsparmani/JPIET | frontend/urls.py | urls.py | py | 4,685 | python | en | code | 0 | github-code | 21 | [
{
"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",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
2221865160 | import pandas as pd
import numpy as np
import tensorflow as tf
from transformers import BertTokenizer, TFBertModel
# BERT model transforma propozitiile intr un vector de numere
df = pd.read_csv("all-data.csv", encoding="ISO-8859-1")
#print(df.head(5))
tokenizer = BertTokenizer.from_pretrained("bert-base-uncased")
... | ancamariac/Twinvest | ML_model/embeddings.py | embeddings.py | py | 1,481 | python | ro | code | 0 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "transformers.BertTokenizer.from_pretrained",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "transformers.BertTokenizer",
"line_number": 12,
"usage_type": "name"
},
{
... |
37449413742 | from collections import Counter
def solution(clothes):
answer = 1
c = Counter([x[1] for x in clothes])
print(c)
for v in c.values():
answer *= (v+1)
answer -= 1
return answer | sunsu2737/algorithm | programmers/위장.py | 위장.py | py | 216 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.Counter",
"line_number": 5,
"usage_type": "call"
}
] |
25763496914 | from django.shortcuts import render,redirect
from .models import *
from django.http import HttpResponse
# from django.contrib.auth.forms import UserCreationForm
from .forms import CreateUserForm
from django.contrib import messages
from django.contrib.auth import authenticate,login,logout
from django.contrib.auth.decora... | Eugin-Paul/Ecommerce-Store | ecommerce/views.py | views.py | py | 5,183 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.shortcuts.redirect",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "forms.CreateUserForm",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "forms.CreateUserForm",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "d... |
29546575720 | from flask import render_template, request, send_from_directory, redirect
from app.flask_app import app
import os
import shutil
import datetime
import requests
import pandas as pd
# All of the html files were supposed to be inherited from the index html file, which would have contained a task bar
# on the top of the s... | slaviotshouto/Biodiversity_Flask_app | app/routes.py | routes.py | py | 3,798 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.render_template",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "app.flask_app.app.route",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "app.flask_app.app",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "flask... |
42258585074 | #!usr/bin/env python
from flask import Flask, request, make_response, jsonify
app = Flask(__name__)
@app.route('/', methods=['GET'])
def index():
with open('./test.html', 'r') as file:
index = file.read()
response = make_response(index, 200)
return response
@app.route('/main.js', methods=['GET'])
def... | hoodoer/rickRollAddressBarPayload | testServer.py | testServer.py | py | 763 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.make_response",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask.make_response",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "flask.make_respons... |
28981630083 | from __future__ import division
import sys, os
import numpy as np
import itertools
# Use named tuple for replay buffer
import collections
import tensorflow as tf
from policy_grad import PolicyEstimator, ValueEstimator
import gym
env = gym.make('CartPole-v0')
env.seed(1) # reproducible, general Policy gradient h... | kvzhao/tensorflow-practices | policy_gradient/naive_reinforce_ac/train.py | train.py | py | 3,106 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "gym.make",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tensorflow.app.flags.DEFINE_bool",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tensorflow.app",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "tensorf... |
42057983531 | from django.core.exceptions import MiddlewareNotUsed
from django.core.management.color import no_style
from django.db.backends.creation import BaseDatabaseCreation
from django.db import connection
from models import AccessControl, ExtendedGroup, IP_BASED_GROUP
import logging
class AccessOnStart:
def __init__(sel... | knabar/fynbos | rooibos/access/middleware.py | middleware.py | py | 2,538 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "django.db.backends.creation.BaseDatabaseCreation",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.db.connection",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "models.AccessControl",
"line_number": 17,
"usage_type": "argume... |
13267779880 | from typing import List, Tuple
from functools import partial
from pathlib import Path
import shutil
from typing import Any, Dict, Optional
from torch.utils.tensorboard import SummaryWriter
from quant.common.metrics import Metric
class Visualizer:
"""TensorBoard visualizer."""
def __init__(
self,
... | yangelides3/testDependency | quant/utils/visualization.py | visualization.py | py | 3,954 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pathlib.Path",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "torch.utils.tensorboard.SummaryWriter",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "typin... |
17519190291 | from flask import make_response, abort
from config import db
from models import Directors, Movies, MoviesSchema
import datetime
def read_all():
# Create the list of movies from our data
movies = Movies.query.order_by(db.desc(Movies.id)).limit(5)
# Serialize the data for the response
movie_schema = Mov... | lukaslynch/OCBC-H8-Python | h8ocbc_Milestone1/movies.py | movies.py | py | 4,224 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "models.Movies.query.order_by",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "models.Movies.query",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "models.Movies",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "conf... |
73101196852 | from bs4 import BeautifulSoup
import urllib.request
import json
domain = "http://127.0.0.1:8000" # input
urls = ["http://127.0.0.1:8000"] # available links
data = {}
i = 0
while 5 > urls.count(urls[-1]): # break if last argument in url list is looping
title = {}
links = {}
title["title"] = []
links["links"] = []... | kevinikos/Clearcode-exercise | WEB/Requests.py | Requests.py | py | 1,127 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "urllib.request.request.urlopen",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 19,
"usage_type": "name"
},
{
"api_nam... |
32541277406 | #!/usr/bin/env python2
import sys
import rospy
import numpy as np
import time
from pathos.pools import ProcessPool
import message_filters
from structs import two_agents
from mambo_fly.srv import *
from std_msgs.msg import String
from std_msgs.msg import Bool
from geometry_msgs.msg import PoseStamped
from geometry_msg... | declanburk/mambo_swarm | scripts/central_client.py | central_client.py | py | 11,227 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "rospy.Rate",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "structs.two_agents",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "rospy.get_param",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "rospy.get_param_names",... |
27772999635 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import cv2, sys, os, rawpy
from PIL import Image
import numpy as np
import scipy.stats as stats
######### Local Vars
FOCAL_CODE = 37386
ORIEN_CODE = 274
IMG_EXTENSIONS =... | ceciliavision/zoom-learn-zoom | utils.py | utils.py | py | 14,000 | python | en | code | 306 | github-code | 21 | [
{
"api_name": "scipy.stats.truncnorm",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "scipy.stats",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"lin... |
72947093492 | import re
import os
import sys
import time
import threading
import subprocess
import customtkinter as ctk
ctk.set_appearance_mode("light")
ctk.set_default_color_theme("blue")
root_pt = 'D:/juice/'
pwds = ['宅方社', 'zfshe.com', 'zfshegame',
'梅子糯米饭团', 'falesti.me',
'yhsxsx10月',
]
bmds = ['存档'... | liaoyinuo/juice | juice.py | juice.py | py | 4,940 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "customtkinter.set_appearance_mode",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "customtkinter.set_default_color_theme",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "customtkinter.CTk",
"line_number": 22,
"usage_type": "attribute"
... |
71276977652 | import tkinter as tk
from tkinter import font
import requests
h = 500
w = 600
def format_response(geo_value):
try:
name = geo_value[0]['name']
name_hindi = geo_value[0]['local_names']['hi']
name_french = geo_value[0]['local_names']['fr']
latitude = geo_value[0]['lat']
longi... | Arpit-Srivastav/Python-GUI-Geo-App | GeoCodingApp.py | GeoCodingApp.py | py | 2,311 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "tkinter.Tk",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "tkinter.Canvas",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "tkinter.PhotoImage",
"line... |
28524698440 | # importing packages
import sqlite3
import pandas as pd
from selenium import webdriver
from bs4 import BeautifulSoup
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
""""
This is a list of functions to be used in the main script that contains the g... | GiovannyJ/Web-Scrape-Gui-PyQt5 | WebScrapeFunctions.py | WebScrapeFunctions.py | py | 2,942 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.chrome.service.Service",
"line_number": 14,
"usage_type": "call"
},
{... |
13765631637 | from keras.models import Sequential
from keras.layers import Dense
# Define the model
model = Sequential()
model.add(Dense(32, input_dim=500, activation='relu'))
model.add(Dense(1, activation='sigmoid'))
# Compile the model
model.compile(optimizer='adam', loss='binary_crossentropy', metrics=['accuracy'])
# Train the... | Marqui-13/simpleNeuralNet | feedForwardNN.py | feedForwardNN.py | py | 457 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "keras.models.Sequential",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "keras.layers.Dense",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "keras.layers.Dense",
"line_number": 7,
"usage_type": "call"
}
] |
40109369134 | # coding:utf-8
import cv2
import os
import glob
import numpy as np
import argparse
from tqdm import tqdm
def parse_args():
parser = argparse.ArgumentParser('video to pics')
parser.add_argument('video_in', type=str, help='video path')
parser.add_argument('pics_dir', type=str, help='output pic dir')
arg... | SuperEver/wav_tools | video2pics.py | video2pics.py | py | 943 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
... |
73041838133 | from future import standard_library
standard_library.install_aliases()
from builtins import next
from builtins import object
import csv
import io
import sys
from functools import reduce
from retriever.lib.cleanup import *
class Table(object):
"""Information about a database table."""
def __init__(self, nam... | LiuFang816/SALSTM_py_data | python/weecology_retriever/retriever-master/lib/table.py | table.py | py | 6,202 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "future.standard_library.install_aliases",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "future.standard_library",
"line_number": 2,
"usage_type": "name"
},
{
"api_name": "builtins.object",
"line_number": 14,
"usage_type": "name"
},
{
"api... |
74967690611 | from tqdm import tqdm
import pickle
import torch
from torch.optim import AdamW
from torch.utils.data import DataLoader
from transformers import (
AutoModelForSequenceClassification,
get_linear_schedule_with_warmup,
BitsAndBytesConfig,
LlamaForCausalLM,
LlamaTokenizer
)
from peft import (
LoraCon... | ykwon0407/DataInf | src/lora_model.py | lora_model.py | py | 11,190 | python | en | code | 10 | github-code | 21 | [
{
"api_name": "transformers.AutoModelForSequenceClassification.from_pretrained",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "transformers.AutoModelForSequenceClassification",
"line_number": 47,
"usage_type": "name"
},
{
"api_name": "peft.LoraConfig",
"line_numbe... |
21626403434 | from rest_framework import permissions
class IsSafeRequest(permissions.BasePermission):
def has_permission(self, request, view):
authorization = request.META.get("HTTP_AUTHORIZATION")
if authorization and authorization == "herren-recruit-python":
return True
return False
| nab5m/herren_coding_test | api/v1/permissions.py | permissions.py | py | 315 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "rest_framework.permissions.BasePermission",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.permissions",
"line_number": 4,
"usage_type": "name"
}
] |
41808644820 | from math import sin, pi
import datetime
dia = int(input("Introduce el día en el que naciste: "))
mes = int(input("Introduce el mes en el que naciste: "))
año = int(input("Introduce el año en el que naciste (formato XXXX): "))
dias_de_vida = (datetime.datetime.now() - datetime.datetime(año, mes, dia)).dias_de_vida
c... | Serguipe28/SGE | Bloque2/Bloque2Rubrica3/biorritmos.py | biorritmos.py | py | 631 | python | es | code | 0 | github-code | 21 | [
{
"api_name": "datetime.datetime.now",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "math.sin",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "math.pi",
"li... |
27705811326 | # -*- coding: utf-8 -*-
from AccessControl import Unauthorized
from copy import deepcopy
from DateTime import DateTime
from imio.helpers.cache import get_current_user_id
from plone import api
from plone.z3cform.layout import wrap_form
from Products.CMFCore.permissions import ModifyPortalContent
from Products.CMFCore.u... | IMIO/Products.PloneMeeting | src/Products/PloneMeeting/browser/advicechangedelay.py | advicechangedelay.py | py | 14,796 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "Products.Five.browser.BrowserView",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "Products.Five.browser.BrowserView",
"line_number": 27,
"usage_type": "argument"
},
{
"api_name": "plone.api.portal.get",
"line_number": 34,
"usage_type": "call"
... |
21636399384 | #!/usr/bin/env python
import os
import tomlkit
CI_DEPS = ["pytest", "pytest-cov", "requests"]
with open("poetry.lock") as f:
lock = tomlkit.parse(f.read())
for p in lock["package"]:
if not p["category"] == "dev":
print(f"{p['name']}=={p['version']}")
if os.getenv("CI"):
... | dazza-codes/aio-aws | scripts/poetry_requirements.py | poetry_requirements.py | py | 405 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "tomlkit.parse",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 17,
"usage_type": "call"
}
] |
32722239088 | # coding=utf-8
import base64
import json
import requests
from google.appengine.api import urlfetch
def run(keyConfig, message, totalResults=1):
requestText = str(message)
fullVoice = ['en-GB-Standard-B']
for voice in fullVoice:
languageCode = voice.split('-')[0] + '-' + voice.split('-')[1]
... | SalamiArmy/InfoBoet | web_commands/say.py | say.py | py | 1,248 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "base64.b64decode",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "google.appengine.api.urlfetch.fetch",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "google.appengine.api.urlfetch",
"line_number": 33,
"usage_type": "name"
},
{
... |
5227630638 | import logging
from typing import Dict, List
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from hprl.policy.policy import MultiAgentPolicy
from hprl.typing import (Action, MultiAgentSampleBatch, State, Transition,
TransitionTuple)
logger = logging.getLogger... | AmoyZhp/traffic_light_control | traffic_light_control/hprl/policy/multi/vdn.py | vdn.py | py | 8,101 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "hprl.policy.policy.MultiAgentPolicy",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "typ... |
31824607694 | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 30 07:24:41 2020
@author: rullyudin234@gmail.com
"""
# =============================================================================
# Melakukan peramalan 7 bulan ke depan terhadap data inflasi
# menggunakan metode RBFNN (Radial Basis Function Neural Network)
# =======... | saifudnm/jagoan_hosting | inflasi/inflasi.py | inflasi.py | py | 6,026 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.DataFrame",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pandas.read_excel",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "pandas.DataFram... |
23977783450 | import numpy as np
from scipy.ndimage.filters import maximum_filter
from scipy.ndimage.morphology import distance_transform_edt
import mahotas
import waterz
def get_segmentation(affinities, threshold):
fragments = watershed_from_affinities(affinities)[0]
thresholds = [threshold]
segmentations = waterz.ag... | funkelab/i2k_gunpowder_tutorial | exercise_2/watershed_helpers.py | watershed_helpers.py | py | 2,786 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "waterz.agglomerate",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.uint64",
... |
26862216565 | from django.shortcuts import render, redirect
import tweepy
import logging
import re
import pprint
from django.http import HttpResponseRedirect
from django.urls import reverse
from .models import Tweet
from datetime import datetime
import pytz
# Create your views here.
def index(request):
return render(request, "d... | mi8150jo/twittervideodownloader | download/views.py | views.py | py | 4,957 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.shortcuts.render",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tweepy.OAuthHandler",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "tweepy.API",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "re.search",
... |
37945296327 | #!python3
import fileinput
import re
from collections import defaultdict, Counter
from enum import Enum
from itertools import islice, product
lines = map(lambda x: x.strip(), fileinput.input())
heatmap = {}
assigned = {}
unassigneds = []
basin = Counter()
w = 0
h = 0
for y, line in enumerate(lines):
for x, n i... | abersnaze/advent | 2021/day9/part2.py | part2.py | py | 1,317 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "fileinput.input",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 15,
"usage_type": "call"
}
] |
2380825164 | import logging
from discord.ext import commands
log = logging.getLogger(__name__)
class LemonStats(commands.Cog):
"""A cog for generating useful lemon-related statistics."""
def __init__(self, bot):
self.bot = bot
@commands.command()
async def lemoncount(self, ctx: commands.Context):
... | Bobsledman65656565/seasonalbot | bot/seasons/evergreen/lemonstats.py | lemonstats.py | py | 802 | python | en | code | null | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands.Cog",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "dis... |
73910850612 | from sklearn.datasets import fetch_mldata
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn.externals import joblib
from sklearn.metrics import accuracy_score
from sklearn.decomposition import PCA
import time
def without_pca(x_train, x_test, y_train,... | Dayzpd/Tensorflow-and-Sklearn-Projects | Principal Component Analysis and Random Forest/pca_rf.py | pca_rf.py | py | 1,586 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sklearn.ensemble.RandomForestClassifier",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sklearn.m... |
16642427924 | from pytorch_med_imaging.scripts import remap_label
from pytorch_med_imaging.utils.preprocessing import make_mask_from_dir
from pytorch_med_imaging.logger import Logger
from . import resample_to_standard_spacing
import os
import re
import fnmatch
import multiprocessing as mpi
from typing import AnyStr, List, Union, Pat... | alabamagan/maxillary_sinus_diagnosis_toolkit | msdtk/img_proc/preprocessing.py | preprocessing.py | py | 5,016 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.AnyStr",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "typing.AnyStr",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.AnyStr",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Pattern",
"line_... |
23881777267 | from selenium import webdriver
chrome_driver_path = 'chromedriver.exe'
driver = webdriver.Chrome(executable_path=chrome_driver_path)
target_url = "https://www.seedtable.com/startups-london"
driver.get(target_url)
companies = driver.find_elements_by_class_name('mt-0')
all_names = [print(company.text) for company in c... | arjunbrara123/web_scraper | main.py | main.py | py | 363 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 4,
"usage_type": "name"
}
] |
1812336872 | from fastapi import APIRouter,Header
from typing import List
from fastapi import Depends, HTTPException
from sqlalchemy.orm import Session
from ..dependencies import get_db
from Apps.Users_router import schemas,models
from Apps.Users_router.dependencies import User
from Apps.Users_router.dependencies.User import ve... | XiaoLing-git/Opentrons_Server | Apps/Users_router/app.py | app.py | py | 4,955 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "Apps.Users_router.models.Base.metadata.create_all",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "Apps.Users_router.models.Base",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "Apps.Users_router.models",
"line_number": 15,
"usage... |
34142569841 | import argparse, os, csv, glob, random
def write_list(data_list, path, ):
with open(path, 'w') as f:
writer = csv.writer(f, delimiter=',')
for row in data_list:
print(row)
if row: writer.writerow(row)
print('split saved to %s' % path)
parser = argparse.ArgumentParser(de... | abhinavdhall/deepfake | ACM_MM_2020/write_csv.py | write_csv.py | py | 2,949 | python | en | code | 37 | github-code | 21 | [
{
"api_name": "csv.writer",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_nu... |
13695664642 | from colorama import Fore, Back, Style
class cell:
def __init__(self,game,name,x_coord,y_coord):
self.game = game
self.name = name
self.x_start = x_coord
self.y_start = y_coord
class building(cell):
def __init__(self,game,name,health,strength,color,symbol,x_start,y_start,h... | LokeshVenkatachalam/Clash-of-Clans-Terminal-Version | src/Build_buildings.py | Build_buildings.py | py | 2,051 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "colorama.Fore.GREEN",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "colorama.Fore",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "colorama.Fore.YELLOW",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "colo... |
6022482597 | __author__ = 'Artur'
import sys
import json
encode_text = False
def get_hashtags(tweet_file):
hashtags = {}
for line in tweet_file:
tweet = json.loads(line)
if 'entities' in tweet:
if 'hashtags' in tweet['entities']:
if len(tweet['entities']['hashtags']) > 0:
... | akhalikov/datasci | assignment1/top_ten.py | top_ten.py | py | 923 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "json.loads",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 25,
"usage_type": "attribute"
}
] |
43633263666 | import pygame as pg
import sys
from settings import *
from map import *
from player import *
from raycasting import *
from object_renderer import *
from sprite_object import *
from object_handler import *
from weapon import *
from sound import *
from pathfinding import *
#In the run() method, the StartScreen is display... | Chiragbachani1608/Steel-Sentinel | main2.py | main2.py | py | 3,411 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pygame.font.Font",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pygame.font",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "pygame.event.get",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pygame.event",
... |
22916449330 | # -*- coding: utf-8 -*-
import re
import sys
import os
from pyquery import PyQuery as pq
from lxml import etree
from dictmaster.util import FLAGS
from dictmaster.pthread import PluginThread
from dictmaster.fetcher import Fetcher, UrlFetcher
from dictmaster.postprocessor import HtmlContainerProcessor
from dictmaster.... | richfan/dictmaster | dictmaster/plugins/zeno.py | zeno.py | py | 5,424 | python | en | code | null | github-code | 21 | [
{
"api_name": "dictmaster.pthread.PluginThread",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "sys.exit",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "os.path.join",
... |
71836682613 | """
Tests for the JSONObject package
"""
import json
import datetime
import pytest
from . import JSONObject, MissingKeyError, SchemaError
def test_exception_subclassing():
assert isinstance(MissingKeyError(), KeyError)
def test_schema_generation():
with pytest.raises(SchemaError):
JSONObject('not a ... | emman27/json_object | json_obj/test_all.py | test_all.py | py | 3,153 | python | el | code | 1 | github-code | 21 | [
{
"api_name": "pytest.raises",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pytest.raises",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number"... |
72748290934 | import gettext
import time
import os
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
class Init:
def __init__(self, config, browser):
self.config = config
self.browser = browser
... | jvandongen/ticket | steps.py | steps.py | py | 3,994 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "gettext.translation",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "gettext.translation",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "gettext.translation",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "gettext.t... |
70309691574 | """Matplotlib Plot posterior densities."""
from numbers import Number
import matplotlib.pyplot as plt
import numpy as np
from ....stats import hdi
from ....stats.density_utils import get_bins
from ...kdeplot import plot_kde
from ...plot_utils import (
_scale_fig_size,
calculate_point_estimate,
format_sig_... | arviz-devs/arviz | arviz/plots/backends/matplotlib/posteriorplot.py | posteriorplot.py | py | 10,091 | python | en | code | 1,461 | github-code | 21 | [
{
"api_name": "plot_utils._scale_fig_size",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "numpy.ravel",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.show",
"line_number": 105,
"usage_type": "call"
},
{
"api_name": "matplo... |
20713484591 | from keras.models import *
from keras.layers import *
from keras.applications import *
from keras.preprocessing.image import *
from keras.callbacks import *
from keras.utils import np_utils
from sklearn.utils import shuffle
from keras.utils import plot_model
import numpy as np
import csv
import h5py
# file_name = 'mid... | HeWenjie/retina_OCT_images_classification | oct_classification.py | oct_classification.py | py | 3,193 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "h5py.File",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "h5py.File",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 51,
... |
71099273972 | """file model added
Revision ID: 75ca5295cbb0
Revises: 56fa093c6c89
Create Date: 2019-07-17 15:57:12.954449
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '75ca5295cbb0'
down_revision = '56fa093c6c89'
branch_labels = N... | vrcompugo/EV-Manager-Data-API | migrations/versions/75ca5295cbb0_file_model_added.py | 75ca5295cbb0_file_model_added.py | py | 2,569 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "alembic.op.create_table",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integ... |
7813796811 | from collections import defaultdict
def main():
with open('input.txt') as f:
nums = list(map(int, f.readline().split(",")))
for part, count_to in enumerate((2020, 30000000)):
last_seen = defaultdict(lambda: i, {n: i for i, n in enumerate(nums[:-1])})
prev = nums[-1]
... | schovancova/adventOfCode2020 | 15/solutions.py | solutions.py | py | 524 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.defaultdict",
"line_number": 8,
"usage_type": "call"
}
] |
38536838173 | from django.conf.urls import patterns, include, url
from django.contrib import admin
import recordlist.urls
import blog.urls
import views
admin.autodiscover()
urlpatterns = patterns(
'',
url(r'^$', views.MainPageView.as_view(), name="index"),
url(r'^login/', views.LoginView.as_view(), name="login"),
... | rbrt/PunkVinyl | punkvinyl/urls.py | urls.py | py | 807 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.contrib.admin.autodiscover",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.conf.urls.patterns",
"line_number": 10,
"usage_type": "call"
},
{
"ap... |
21447007245 | import ROOT
from rootutils import PDFPrinting
from plotting import *
ROOT.gStyle.SetOptStat(0)
ROOT.gROOT.SetBatch(True)
path1 = "/nfs/dust/cms/user/kschweig/Code/scriptcollection/bjetRegression/"
files = ["BReg_0329_newVars.root","BReg_0329_oldVars.root","BReg_0330_newVars.root","BReg_0330_oldVars.root"]
regpt_lis... | kschweiger/scriptcollection | bjetRegression/plotscripts/fastplotting_2.py | fastplotting_2.py | py | 3,921 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "ROOT.gStyle.SetOptStat",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "ROOT.gStyle",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "ROOT.gROOT.SetBatch",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "ROOT.gROOT",... |
1740871645 | import torch
from models import get_model
from util import tensor2var
class DummyConfig:
imsize = 64
z_dim = 100
g_conv_dim = 64
d_conv_dim = 64
channels = 3
device = "cpu"
noise = tensor2var(torch.randn(4, DummyConfig.z_dim), DummyConfig.device)
DummyConfig.model = "dcgan_upsample"
G, D ... | stevebottos/gans | check_model.py | check_model.py | py | 398 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "util.tensor2var",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.randn",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "models.get_model",
"line_number": 20,
"usage_type": "call"
}
] |
34667157423 | import os
import zipfile
from flask import flash, request, redirect, url_for, render_template
from werkzeug.utils import secure_filename
from vary import app, ALLOWED_EXTENSIONS
from vary.model.overleaf_util import fetch_overleaf
from vary.model.files.directory import clear_directory
from vary.model.files.dictionnari... | diverse-project/varylatex | vary/views/index.py | index.py | py | 1,956 | python | en | code | 7 | github-code | 21 | [
{
"api_name": "flask.render_template",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "vary.app.route",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "vary.app",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "flask.request.files",
... |
6922855360 | import os
import sys
PROJECT_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(PROJECT_PATH)
from measurement import Stopwatch
class Solution(Stopwatch):
def __init__(self):
super().__init__()
def execute(self):
answer = 2
a, b = 1,... | ony3000/project-euler | problems_001to025/problem_025/solution.py | solution.py | py | 527 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.path.dirname",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line... |
40477805071 | # -*- coding: utf-8 -*-
# Created by qeelyn on 18-5-8
from datetime import datetime, timedelta
import pytz
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
from airflow.operators.spider_plugin import SpiderJobSensor
from fund_cn_etl.fund_nav import fund_nav_std, fund_nav_rtn, fund... | MaGuiSen/fund_data_alarm | dags/fund_nav_tt_ms.py | fund_nav_tt_ms.py | py | 6,778 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pytz.timezone",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "datetime.timede... |
74317517492 | import unittest
from sklearn.datasets import make_regression, make_classification
from glmnet import LogitNet, ElasticNet
from glmnet.tests.util import sanity_check_logistic, sanity_check_regression
pd = None
try:
import pandas as pd
except:
pass
class TestElasticNetPandas(unittest.TestCase):
@unittes... | civisanalytics/python-glmnet | glmnet/tests/test_pandas.py | test_pandas.py | py | 1,058 | python | en | code | 255 | github-code | 21 | [
{
"api_name": "unittest.TestCase",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "sklearn.datasets.make_regression",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 20,
"usage_type": "call"
},
{
"api_name... |
23320681106 | # -*- coding: utf-8 -*-
## 时间: 2015-02-13
## 跟新内容:
## 增加URL请求时间计算
## 时间: 2015-04-01
## 跟新内容:
## 将指定的测试文件名写入配置文件中,同时增加一个获取当前路径的类
##
import urllib.request
import urllib.parse
import urllib.error
from pathlib import Path
import json
import io
import sys
import traceback
import os
import os.path
import time
import ... | ttlmtang123/HttpInterfaceTesting | lib/handleurl.py | handleurl.py | py | 10,121 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "os.path.normcase",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 60,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
... |
13447272821 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
from matplotlib import gridspec
import pressure as Pr
import vegf as Ve
from build import (G, in_nodes, out_nodes, F_mult_ox, F_mult,
c2, dt, dt_ox, dth, boundary_edges, d... | karol-lukanowski/symulacja-krwi | draw_net.py | draw_net.py | py | 11,585 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.axis",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "mat... |
16732007442 | import os
import openai
from flask import Flask, request, jsonify
from dotenv import load_dotenv
from langchain.embeddings.openai import OpenAIEmbeddings
from langchain.vectorstores.redis import Redis
from langchain.text_splitter import CharacterTextSplitter
from langchain.llms import OpenAI
from langchain.document_loa... | dhanush77777/langchain-FAQ-bot | app2.py | app2.py | py | 8,022 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "redis.Redis",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "dotenv.load_dotenv",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "openai.api_key",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "os.getenv",
"l... |
18410866027 | #!/usr/bin/python3
"""
把markdown文件里的本地图片转成Base64嵌入md文件
"""
import base64
import os
# 将md文件里的图片相对路径改成图片数据
def convertImg():
# 读取原文件内容
lstPath = os.path.split(os.path.abspath(__file__))
toConvertMDFile = lstPath[0] + "./Readme.md"
originalFile = open(toConvertMDFile, 'r', encoding='UTF-8')
original... | huang134/PythonDemo | ConvertImg.py | ConvertImg.py | py | 1,295 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.path.split",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "base64.b64encode",
"li... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.