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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
17669758792 | """2020_02_18
Revision ID: 000001
Revises:
Create Date: 2020-02-18 03:57:38.958091
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "000001"
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic... | ichux/elog | migrations/versions/000001_2020_02_18.py | 000001_2020_02_18.py | py | 2,743 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "alembic.op.create_table",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.DateT... |
43266096059 | import discord
import os
from keep_alive import keep_alive
from discord.ext import commands
from better_profanity import profanity
os.system('python3 -m commands')
profanity.load_censor_words_from_file('./profanity.txt')
client = commands.Bot(command_prefix = '$')
money_registry = []
list1 = ['myself', 'me', 'i']
@... | LittlRayRay/Censorbot | main.py | main.py | py | 2,297 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.system",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "better_profanity.profanity.load_censor_words_from_file",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "better_profanity.profanity",
"line_number": 9,
"usage_type": "name"
},
... |
34879700956 | import re
from requests import get
from sys import argv as cla
from readabilipy import simple_json_from_html_string
from ebooklib import epub
def valid_url(url):
regex = re.compile(
r'^(?:http)s?://' # http:// or https://
r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.... | eklop/web2epub | web2epub.py | web2epub.py | py | 2,797 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "re.compile",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "re.IGNORECASE",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "re.match",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 20,... |
225940000 | from sqlalchemy import Column, Integer, String, ForeignKey
from app.routers.db import Base
class Task(Base):
__tablename__ = 'tasks'
id = Column(Integer, primary_key=True, index=True)
title = Column(String)
body = Column(String)
| gitdarsh/todo | todo/app/models/model.py | model.py | py | 248 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "app.routers.db.Base",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integer",
"line_number": 8,
"usage_type": "argument"
},
{
"api_name": "sqlalchemy.... |
30410142101 | import CryptoCurrency
import sqlite3 as sql
import requests
from datetime import datetime
import time
def get_crypto():
"""Récupères la liste des cryptomonnaies tradable sur le marché futures de Bybit
(!! 120 requests per second for 5 consecutive seconds maximum)
Returns:
list:liste des cryptomonn... | ArthurOnWeb/l-historique-du-prix-d-une-cryptomonnaie | Main.py | Main.py | py | 5,015 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.request",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 50,
"usage_type": "name"
},
{
"api_name": "time.sleep",... |
70396769467 | """ JAX functions to Calculate moving average.
Author: Toshinori Kitamura
Affiliation: NAIST & OSX
"""
from __future__ import annotations
import jax
from chex import Array
from jax import lax
@jax.jit
def calc_ma(lr: float, idx1: Array, idx2: Array, tb: Array, tb_targ: Array) -> Array:
"""Calculate moving averag... | omron-sinicx/ShinRL | shinrl/_calc/moving_average.py | moving_average.py | py | 1,289 | python | en | code | 42 | github-code | 6 | [
{
"api_name": "chex.Array",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "jax.lax.fori_loop",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "jax.lax",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "jax.jit",
"line_number": 12,... |
14572312600 | ############## THESE SPLINES ARE USING CATMULL SPLINES ##############
# https://en.wikipedia.org/wiki/Centripetal_Catmull%E2%80%93Rom_spline
#
# FOLLOWING javidx9's SPLINE VIDEOS:
# https://www.youtube.com/watch?v=9_aJGUTePYo&t=898s&ab_channel=javidx9
from typing import List
import pygame, math
from code_modules.spli... | EliasFredriksson/Tower_Defence_Reworked | code_modules/spline/spline.py | spline.py | py | 6,006 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.font.SysFont",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pygame.font",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "pygame.draw.circle",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "pygame.draw",... |
46525020186 | import pygame
from robot import Robot
from manual_robot import ManualRobot
from automated_robot import AutomatedRobot
from automated_robots.robots_concursantes import *
from automated_robots.robots_zimatek import *
from robot_hub import RobotHub
from coin import Coin
import numpy as np
import os
class Combat:
"""... | zimatek/RobotCombat | combat.py | combat.py | py | 11,303 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "robot.Robot",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "pygame.sprite.Group",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "pygame.sprite",
"line_number": 48,
"usage_type": "attribute"
},
{
"api_name": "pygame.sprite.Grou... |
17469039054 | from bs4 import BeautifulSoup
import requests
import requests.packages.urllib3
requests.packages.urllib3.disable_warnings()
fx=open('WEB.txt','r',encoding="utf-8") ## FILENAME me file ka name dalna
line=fx.readline()
l=open('email_mailto.txt','a',encoding='utf-8')
def web_imrove(url):
print(url)
... | akkiei/Web_Scrapper | Mail_to.py | Mail_to.py | py | 1,282 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.packages.urllib3.disable_warnings",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "requests.packages",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_... |
17086061072 | from datetime import datetime
#convert date from YYYY-MM-DD-T to Date, Month, Year (in words)
#dfdsf
#dsfds
datetime
def date_convert(date):
date=str(date)
data=date.split('-') #year/month/day+time all separated by dash
daydate=data[-1].split() #data[-1] is day+time, separated by a space
day=daydate[0]... | veliakiner/SmogonQDB | date_convert.py | date_convert.py | py | 1,428 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime",
"line_number": 6,
"usage_type": "name"
}
] |
19980146036 | from pytube import YouTube
from PySimpleGUI import PySimpleGUI as sg
sg.theme("reddit")
layout = [
[sg.Text("URL"), sg.Input(key="url")],
[sg.Button("Fazer o Download")]
],
janela = sg.Window("Video Downloader", layout)
while True:
eventos, valores = janela.read()
if eventos == sg.WINDOW_CLOSED:
... | jopsfernandes/video_downloader | youtube.py | youtube.py | py | 525 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PySimpleGUI.PySimpleGUI.theme",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.PySimpleGUI",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "PySimpleGUI.PySimpleGUI.Text",
"line_number": 6,
"usage_type": "call"
},
{
"a... |
11707381858 | #!/usr/bin/python
# coding: utf-8
from io import open
import os
import time
import re
import db
from sqlalchemy import or_, and_, not_, asc, desc, func
from datetime import datetime, timedelta
from functools import wraps # We need this to make Flask understand decorated routes.
import hashlib
import subprocess
fr... | retroherna/rhweb2 | rhforum.py | rhforum.py | py | 36,199 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime.utcnow",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "psycopg2.tz.FixedOffsetTimezone",
"line_number": 34,
"usage_type": "call"
},
{
"api_na... |
35445440233 | from dexy.common import OrderedDict
import dexy.database
import dexy.doc
import dexy.parser
import dexy.reporter
import inspect
import json
import logging
import logging.handlers
import os
import shutil
class Wrapper(object):
"""
Class that assists in interacting with Dexy, including running Dexy.
"""
... | gotosprey/dexy | dexy/wrapper.py | wrapper.py | py | 11,970 | python | en | code | null | github-code | 6 | [
{
"api_name": "logging.DEBUG",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "logging.INFO",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "logging.WARN",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "dexy.common.Or... |
38791493575 | from flask import Flask
from flask_restful import Resource, Api
import __init__
app=Flask(__name__)
api=Api(app)
class Quote(Resource):
@app.route('/wifi/<int:id>')
def get(id):
x=main.main_(id)
if x==-1:
return 'Not found', 404
else:
return x, 200
... | Kaedone/WI-FI_checker | api.py | api.py | py | 510 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask_restful.Api",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask_restful.Resource",
"line_number": 11,
"usage_type": "name"
}
] |
73027941309 | from google.cloud import storage
import os
input_folder = "../Crop_Reports/Bengal Gazettes Chunks/"
bucket_name = "calcutta-gazette"
def explicit(bucket_name, source_name, path):
# Explicitly use service account credentials by specifying the private key
# file.
storage_client = storage.Clie... | jgoman99/British-Bengal-Weekly-Crop-Reports | Python Code/splits_to_cloud.py | splits_to_cloud.py | py | 1,067 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "google.cloud.storage.Client.from_service_account_json",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "google.cloud.storage.Client",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "google.cloud.storage",
"line_number": 13,
"usage_t... |
40132948104 | import argparse
from math import sqrt
import Image
import ImageDraw
def color_map(v):
assert 0 <= v <= 255
if v == 0: return (0, 0, 0)
if v == 255: return (255, 255, 255)
if v < 4 * 8:
# 0 .. 31
return (0, 255 - (31 * 4) + v * 4, 0)
if v < 16 * 8:
# 32 .. 127
# 0 .. ... | nishio/binary_color | binary_color.py | binary_color.py | py | 1,161 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "Image.new",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "ImageDraw.Draw",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 43,
"usage_type": "call"
}
] |
39784068604 | import filecmp, os, sys
sys.path.append('c:\\dev\\pytWinc\\superpy')
sys.path.append('c:\\dev\\pytWinc\\superpy\\utils_superpy')
from utils.utils import calculate_inventory, get_path_to_directory_of_file
directory_of_testcase = "fn_calculate_inventory"
path_to_directory_of_testcase = get_path_to_directory_of_file(dir... | davidjfk/David_Sneek_Superpy | test_utils/fn_calculate_inventory/test_calculate_inventory.py | test_calculate_inventory.py | py | 2,936 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_numbe... |
43626494196 | # VIIRS packge
from __future__ import division, print_function
import datetime
import numpy as np
from osgeo import gdal
from scipy import ndimage
import core
import env
bumper = env.environment()
class viirs(core.raster):
def __init__(self):
core.raster.__init__(self,'viirs')
retur... | Servir-Mekong/bump | bump/viirs.py | viirs.py | py | 2,977 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "env.environment",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "core.raster",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "core.raster.__init__",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "core.raster",
... |
72579615228 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Nov 17 11:47:02 2019
@author: hwan - Took out relevant code from dolfin's plotting.py _plot_matplotlib code
- To enter dolfin's own plotting code, use dl.plot(some_dolfin_object) wheresome_dolfin_object is a 3D object and an error will be ... | cotran2/Thermal_Fin_Heat_Simulator | Utilities/plot_3D.py | plot_3D.py | py | 1,852 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.title",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.gca",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matpl... |
38365303311 | from datetime import datetime, timedelta
import logging
import os
import json
import pandas as pd
import requests
try:
from .exceptions import ApexApiException
except:
from exceptions import ApexApiException
class Apex_API:
def __init__(self, api_key: str):
self.api_key = api_key
loggin... | jyablonski/apex_api_scraper | src/utils.py | utils.py | py | 2,484 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "logging.g... |
40695061264 | """empty message
Revision ID: 41124ac6e47e
Revises: 57296b50c499
Create Date: 2014-11-30 17:08:44.396000
"""
# revision identifiers, used by Alembic.
revision = '41124ac6e47e'
down_revision = '57296b50c499'
from alembic import op
import sqlalchemy as sa
def upgrade():
### com... | StasEvseev/adminbuy | migrations/versions/41124ac6e47e_.py | 41124ac6e47e_.py | py | 800 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "alembic.op.add_column",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.String"... |
73785815229 | """empty message
Revision ID: 391b24b33343
Revises: e4338c095afb
Create Date: 2021-06-24 16:47:10.434392
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '391b24b33343'
down_revision = 'e4338c095afb'
branch_labels = None
depends_on = None
def upgrade():
# ... | composerben/flask-group-project | migrations/versions/20210624_164710_fix_migration.py | 20210624_164710_fix_migration.py | py | 1,640 | python | en | code | 13 | github-code | 6 | [
{
"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... |
33983748034 | from django.shortcuts import render, redirect
from django.views.generic import ListView, \
CreateView, DetailView, UpdateView, DeleteView
from .models import Post, Review
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
from accounts.models import UserFollows
from .forms import PostFo... | maximesoydas/maxweb | website/views.py | views.py | py | 6,223 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.template.defaulttags.register.filter",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "django.template.defaulttags.register",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "accounts.models.UserFollows.objects.filter",
"line_numb... |
25497427443 | import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
class TinyImageNet:
def __init__(self, root, train=True, transform=None, target_transform=None, test_transform=None, target_test_transform=None):
self.transform = transform
self.targe... | ruixiang-wang/Incremental-Learning-Research | PRE-master/TinyImageNet.py | TinyImageNet.py | py | 4,064 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "numpy.load",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.concatenate",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.concatenate",
"line... |
1478963521 | import numpy, math, itertools
from hashlib import sha1
from mbfit.exceptions import XYZFormatError, InvalidValueError, InconsistentValueError
from .fragment import Fragment
class Molecule(object):
"""
Stores the fragments of a Molecule
"""
def __init__(self, fragments):
"""
Creates a... | paesanilab/MB-Fit | mbfit/molecule/molecule.py | molecule.py | py | 44,981 | python | en | code | 14 | github-code | 6 | [
{
"api_name": "fragment.get_name",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "fragment.get_symmetry",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "fragment.get_name",
"line_number": 87,
"usage_type": "call"
},
{
"api_name": "fragment.ge... |
73750770109 | from operator import index
from meal import Meal
import json
import sqlite3
class Meal_Data:
"""Data layer to be used in conjunction with the Meal class"""
def __init__(self, filename = "foodinfo.json"):
"""Initializes Meal_Data"""
self.filename = filename
def meal_add(self, meal:Meal):
... | zaepho/DinnerDecider | mealdata.py | mealdata.py | py | 3,719 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "meal.Meal",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "meal.name",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "meal.name.title",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "meal.name",
"line_number... |
29827630738 | #This file will only be needed to run
import pandas as pd
import numpy as numpy
from datetime import date
import datetime
import os
class box:
def __init__(self):
self.task_done = ""
self.no_of_day = (datetime.date.today() - date(1997, 8, 21)).days
self.dest = ""
self.wake_up = "" #should change in future
s... | Geeks-Sid/habit_organizer | main.py | main.py | py | 4,237 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.date.today",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 100,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
40129830394 | """
Get Distances of Shortest Path (Dijkstra)
edges: dict<from:int, dict<to:int, cost:number>>
"""
from heapq import heappush, heappop
def one_to_one(
start, goal, num_vertexes, edges,
INF=9223372036854775807, UNREACHABLE=-1):
distances = [INF] * num_vertexes
distances[start] = 0
queue ... | nishio/atcoder | libs/dijkstra.py | dijkstra.py | py | 3,668 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "heapq.heappop",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "heapq.heappush",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "heapq.heappop",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "heapq.heappush",
"line... |
27330667755 | import requests
import time
from bs4 import BeautifulSoup
import urllib.request
import re
import json
start_time = time.time()
link_3 = []
link_4 = []
link_5 = []
link_6 = []
links = []
g = ""
b = ""
d = ""
y = ""
ya = ""
ask = ""
domain = ""
emails = []
new_emails = []
mails = []
def crawl(... | realchief/EmailScraping-BeautifulSoup | filter_crwl_dft_srchegn_updated.py | filter_crwl_dft_srchegn_updated.py | py | 2,298 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "time.time",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "urllib.request.request.Request",
... |
36282438996 | import datetime
import requests
from bs4 import BeautifulSoup as bs4
from flask import Flask
from flask_restful import Resource, Api
OYK_URL = "https://oulunkylanyhteiskoulu.fi/"
def get_food() -> list:
with requests.Session() as s:
g = s.get(OYK_URL)
bs = bs4(g.text, 'html.parser')
today = ... | drstuggels/oyk-food | main.py | main.py | py | 908 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.Session",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.date.today",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.date"... |
12056898935 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Code for this script is originally at:
https://github.com/dfm/george/blob/master/docs/_code/model.py
"""
from __future__ import division, print_function
import emcee
import triangle
import numpy as np
import cPickle
import matplotlib.pyplot as pl
import george
from ... | karenyyng/shear_gp | george_examples/model.py | model.py | py | 5,729 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "numpy.exp",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.inf",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "numpy.inf",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "numpy.inf",
"line_number"... |
39269323605 | from sqlalchemy import create_engine
from tests.util import RPCTest
class PDNSTest(RPCTest):
def cleanup_pdns_db(self, db_uri):
with create_engine(db_uri).begin() as conn:
conn.execute('delete from domains')
conn.execute('delete from domainmetadata')
conn.execute('dele... | 1and1/dim | dim-testsuite/tests/pdns_test.py | pdns_test.py | py | 631 | python | en | code | 39 | github-code | 6 | [
{
"api_name": "tests.util.RPCTest",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 8,
"usage_type": "call"
}
] |
74472078906 | import os
import pickle
import pandas as pd
import pyarrow as pa
import pyarrow.parquet as pq
from openpyxl import Workbook
def save_pickle(data, filename):
with open(filename, 'wb') as file:
pickle.dump(data, file)
def load_pickle(filename):
with open(filename, 'rb') as file:
dat... | Lisiozmur/Njpo | Ćwiczenie5/Zadanie1.py | Zadanie1.py | py | 2,117 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pickle.dump",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pyarrow.Table.from_pandas",
... |
6727912141 | """
Module for parsing arguments.
"""
import sys
import argparse
import os
from pathlib import Path
from typing import Any
__author__ = "Stijn Arends"
__version__ = "v0.1"
__data__ = "21-8-2022"
class ArgumentParser:
"""
Class to parse the input arguments.
"""
def __init__(self) -> None:
sel... | molgenis/benchmark-gwas-prio | prioritization_methods/NetWAS/arg_parser.py | arg_parser.py | py | 3,976 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "sys.stderr",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
... |
11458247441 | # 首先要导入一个Select类
from selenium.webdriver.support.select import Select
from selenium import webdriver
import time
# 打开浏览器,进入携程旅行官网
driver = webdriver.Chrome()
driver.get('https://www.ctrip.com/?sid=155952&allianceid=4897&ouid=index')
driver.maximize_window() # 最大化窗口
# 休眠5秒钟
time.sleep(5)
# 通过Select类选择下拉框选项,只能是控件类型(tag_... | Ailian482/WebSelenium | Auto_Test/20_下拉框选择处理.py | 20_下拉框选择处理.py | py | 1,363 | python | zh | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "selenium.webdri... |
37985935295 | #! /usr/bin/env python3
import audioInterface
import os
import yaml
import sys
from datetime import datetime
from gpiozero import Button
from signal import pause
from pydub import AudioSegment
from pydub.playback import play
try:
with open("config.yaml") as f:
config = yaml.load(f, Loader=yaml.FullLoader... | nickpourazima/rotary-phone-audio-guestbook | audioGuestBook.py | audioGuestBook.py | py | 1,781 | python | en | code | 13 | github-code | 6 | [
{
"api_name": "yaml.load",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "yaml.FullLoader",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "gpiozero.Button",
"line_n... |
39792208434 | from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import utils
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.as... | SieniAlessandro/E2E-Secure-Chat | Server/Security/Security.py | Security.py | py | 14,411 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "cryptography.hazmat.primitives.serialization.load_pem_private_key",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "cryptography.hazmat.primitives.serialization",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "cryptography.hazmat.backends.defau... |
26135102637 | import cv2 as cv
import numpy as np
img = cv.imread('/home/ai3/Desktop/common/ML/Day13/girl.jpg',0)
kernel = np.ones((2,2),np.uint8)
open1 = cv.morphologyEx(img,cv.MORPH_OPEN,kernel)
open2 = cv.morphologyEx(img,cv.MORPH_CLOSE,kernel)
open3 = cv.morphologyEx(open1,cv.MORPH_CLOSE,kernel)
img=np.hstack((open1,open2,ope... | 94akshayraj/AI-program | ML ans/day13/3.py | 3.py | py | 365 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.imread",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "cv2.morphologyEx",
"line_numb... |
74637154747 | import time
import redis
cache = redis.StrictRedis(host='redis', decode_responses=True, db=0, port=6379)
def update_and_get_hit_count():
""""""
print('In utils/update_and_get_hit_count')
retries = 5
while True:
try:
return cache.incr('hits')
except redis.exceptions.Connec... | ShukujiNeel13/composetest | utils.py | utils.py | py | 770 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "redis.StrictRedis",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "redis.exceptions",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "time.sleep",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "redis.exceptions",
... |
12688443618 | # https://leetcode.com/problems/reverse-linked-list/
from typing import Optional
class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
class Solution:
def reverseList_(self, head: Optional[ListNode]) -> ListNode: # input as list
# empty head
if ... | zvovov/competitive_coding | leetcode/neetcode_150/reverse_linked_list.py | reverse_linked_list.py | py | 1,637 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.Optional",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 40,
"usage_type": "name"
}
] |
21368489956 | import numpy as np
import matplotlib.pyplot as plt
import glob
import os
import ruamel.yaml
import matplotlib.colors as colors
import matplotlib.cm as cmx
from matplotlib import rc
rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
## for Palatino and other serif fonts use:
#rc('font',**{'fam... | physikier/magnetometer | src/analysis.py | analysis.py | py | 4,786 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.rc",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.rc",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.rc",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
70435413308 | import re
import emoji
def preprocess_string(text):
"""
입력받은 text 를 전처리 하는 함수.
:param text: str
:return : str
"""
# 이모티콘부터 제거
no_emoticon = ''
for char in text:
if char not in emoji.UNICODE_EMOJI:
no_emoticon += char
# 특수문자 기준 split
no_punctuation = re.sp... | teammatmul/project-purifier | purifier/preprocess.py | preprocess.py | py | 1,254 | python | ko | code | 78 | github-code | 6 | [
{
"api_name": "emoji.UNICODE_EMOJI",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "re.split",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "re.split",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "re.split",
"line_numbe... |
2501424452 | from os import listdir
from PIL import Image
#list src pic
DIR = 'pic'
#print listing of images
img_list = listdir("pic")
#enter and calculate ratio
sh_ent = int(input("Shakal ratio (compress ratio):"))
sh = 100 - sh_ent
#work with image
for filename in img_list:
outname = "out/" + filename
... | vakarianplay/Pic_tools | shakal (compress)/shak.py | shak.py | py | 505 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.listdir",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 19,
"usage_type": "name"
}
] |
29457010542 | #!/usr/bin/env python
import sys
import commands
import string
import datetime
import logging
import logging.handlers
from optparse import OptionParser
from random import choice
def print_error(ret, do_exit=False, msg=""):
"""
ret is the tuple returned by commands.getstatusoutput. If ret[0] is not 0,
t... | alvarolopez/egi-certool | run_tests.py | run_tests.py | py | 10,232 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "logging.error",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "logging.error",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number"... |
37601085068 |
from sqlwrapper import gensql, dbget, dbput
import json
import datetime
def HOTEL_FD_POST_UPDATE_CheckinGuestArrivals(request):
d = request.json
res_id = d.get("Res_id")
unique_id = d.get("Res_unique_id")
pf_id = d.get("pf_id")
a = {}
RES_Log_Time = datetime.datetime.utcnow()+datetime... | infocuittesting/hotel360-second-version | HOTEL_FD_POST_UPDATE_CheckinGuestArrivals.py | HOTEL_FD_POST_UPDATE_CheckinGuestArrivals.py | py | 3,531 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime.utcnow",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "datetime.timedelta",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "da... |
5285437188 | from ...robot import Robot
from stt_watson.SttWatsonLogListener import SttWatsonLogListener
from recording.Record import Record
from watson_client.Client import Client
from utils.SignalHandler import SignalHandler
import threading
import signal
import os
class WatsonRobot(Robot):
def __init__(self, config, speak... | lowdev/alfred | robot/stt/watson/watson.py | watson.py | py | 1,199 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "robot.Robot",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "stt_watson.SttWatsonLogListener.SttWatsonLogListener",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "threading.Event",
"line_number": 22,
"usage_type": "call"
},
{
"... |
10623814818 | from asyncio import sleep
from discord import Forbidden
from discord.ext import commands
from Utils.domain_tester import get_domain_embed
from Utils.file_tester import get_file_embed
class DmCommands(commands.Cog, name="Dm Commands"):
"""
Cog including all Commands that are dm only
"""
def __init__... | veni-vidi-code/VirusTotalDiscordBot | Cogs/DmCommands.py | DmCommands.py | py | 1,634 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "discord.Forbidden",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "... |
40071040492 | from collections import Counter
class Solution(object):
def findAnagrams(self, s, p):
"""
:type s: str
:type p: str
:rtype: List[int]
"""
# anagram: str with same histgram
res = []
lp = len(p) -1
ls = len(s)
pCount = Counter(p)
... | lucy9215/leetcode-python | 438_findAllAnagramsInAString.py | 438_findAllAnagramsInAString.py | py | 619 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.Counter",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 17,
"usage_type": "call"
}
] |
23932735079 | import torch
from torch import nn
from torch.autograd import Variable
import numpy as np
from util import get_data
from torch.utils.data import DataLoader
from torch.nn import functional as F
from torch.optim import Adam
from variables import*
from matplotlib import pyplot as plt
class MnistRegression(object):
def... | 1zuu/Pytroch-Examples | Mnist/mnist_regression.py | mnist_regression.py | py | 2,842 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
650532287 | #! /bin/python
import os
import sys
import json
import luigi
import numpy as np
import nifty.tools as nt
import nifty
import nifty.graph.rag as nrag
from vigra.analysis import relabelConsecutive
from elf.segmentation.clustering import mala_clustering, agglomerative_clustering
import cluster_tools.utils.volume_utils... | constantinpape/cluster_tools | cluster_tools/watershed/agglomerate.py | agglomerate.py | py | 8,389 | python | en | code | 32 | github-code | 6 | [
{
"api_name": "luigi.Task",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "luigi.Parameter",
"l... |
17424247870 | from setuptools import setup
import dorm
with open("README.md", "r") as readme:
long_description = readme.read()
setup(
name="dorm",
version=dorm.version,
description="A tiny SQLite ORM for Python.",
long_description=long_description,
long_description_content_type="text/markdown",
author=... | dcwatson/dorm | setup.py | setup.py | py | 804 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "setuptools.setup",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "dorm.version",
"line_number": 10,
"usage_type": "attribute"
}
] |
12814211947 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('student', '0002_userinfo_grade'),
]
operations = [
migrations.CreateModel(
name='Events',
... | asp3/StudentAccounts | student/migrations/0003_auto_20151025_1630.py | 0003_auto_20151025_1630.py | py | 906 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.CreateModel",
"line_number": 14,
"usage_type": "call"
},
... |
42483900439 | import pandas as pd
import networkx as nx
import json
hierarchy_df = pd.read_csv('hierarchy_table.csv', index_col=0, dtype=str)
graph_network = nx.from_pandas_edgelist(
hierarchy_df,
source='Parent',
target='Child',
)
json_graph = json.dumps(graph_network, default=nx.node_link_data)
# Using a JSON strin... | diegopintossi/graph_network | graph_network.py | graph_network.py | py | 398 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "networkx.from_pandas_edgelist",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "networkx.node_... |
35426908825 | #!/usr/bin/python
import numpy as np
import matplotlib.pyplot as plt
import scipy.integrate
a=0.7
b=0.6
X = np.arange(0,2.4,0.2)
Y = np.arange(0,2.4,0.2)
m,p = np.meshgrid(X,Y)
mdot = np.divide(1,1+np.square(p))- np.multiply(b,m)
pdot = np.subtract(m,np.multiply(a,p))
fig, ax = plt.subplots()
q=... | martinaoliver/GTA | ssb/m1a/numeric/Practical_full_solutions_jupyter/python_script_solutions/phase_portrait_autorinhib_20190926.py | phase_portrait_autorinhib_20190926.py | py | 991 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.arange",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.meshgrid",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.divide",
"line_num... |
34862433797 | from django import template
from django.urls import NoReverseMatch, reverse
from utilities.utils import get_viewname, prepare_cloned_fields
register = template.Library()
#
# Instance buttons
#
@register.inclusion_tag('buttons/clone.html')
def clone_button(instance):
url = reverse(get_viewname(instance, 'add'))... | Status-Page/Status-Page | statuspage/utilities/templatetags/buttons.py | buttons.py | py | 2,140 | python | en | code | 45 | github-code | 6 | [
{
"api_name": "django.template.Library",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.urls.reverse",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "utilities.u... |
34958652342 | import torch
import torch.nn as nn
import torch.nn.functional as F
def normalize_l2(x):
"""
Expects x.shape == [N, C, H, W]
"""
norm = torch.norm(x.view(x.size(0), -1), p=2, dim=1)
norm = norm.unsqueeze(-1).unsqueeze(-1).unsqueeze(-1)
return x / norm
def pair_cos_dist(x, y):
cos = nn.Cosin... | arthur-qiu/adv_vis | attack_methods/feature_targets.py | feature_targets.py | py | 2,092 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.norm",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.nn.CosineSimilarity",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "torch.clamp",
"line_... |
7002507231 | import json
from .db_utils import conn as db_conn
from enum import Enum
class NotificationType(Enum):
questionEndorse = 'question_endorsed'
answerEndorse = 'answer_endorsed'
answerUser = 'answer_user'
answerSaved = 'answer_saved'
NOTIFICATION_TEXT_BY_TYPE = {
NotificationType.questionEndorse: "end... | minupalaniappan/gradfire | daviscoursesearch/flaskapp/utils/notif_utils.py | notif_utils.py | py | 1,239 | python | en | code | 12 | github-code | 6 | [
{
"api_name": "enum.Enum",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "db_utils.conn.cursor",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "db_utils.conn",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "json.dumps",
"line_nu... |
24706158570 | #!/usr/bin/python2.4
import base64
import hmac
from google.appengine.api import urlfetch
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
import hashlib
class PlacesHandler(webapp.RequestHandler):
"""Handles requests to /places."""
def post(self):
"""Handle... | bilal-karim/gmaps-samples-v3 | devfest-2010/whereiscoffee/places.py | places.py | py | 1,627 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "google.appengine.ext.webapp.RequestHandler",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "google.appengine.ext.webapp",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "base64.urlsafe_b64decode",
"line_number": 38,
"usage_type": "... |
11552601944 | import csv
import getopt, sys
from moviepy.editor import VideoFileClip, concatenate_videoclips
folder = '/Videos/'
# file name of the video and config file
event = '20221002 PREECNLBVA'
output_file = None # Create a file for each segment
#output_file = 'check' # Compile the clips with a check flag
output_file = 'high... | jordiyeh/video-cut | create_highlight_videos.py | create_highlight_videos.py | py | 3,744 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "getopt.getopt",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "getopt.error",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "csv.DictReader",
"l... |
71270407548 | """
This question is asked by Apple. Given two binary strings
(strings containing only 1s and 0s) return their sum (also as a binary string).
Note: neither binary string will contain leading 0s unless the string itself is 0
Ex: Given the following binary strings...
"100" + "1", return "101"
"11" + "1", return "100"
... | lucasbivar/coding-interviews | the-daily-byte/week_01/day_05_add_binary.py | day_05_add_binary.py | py | 1,314 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 21,
"usage_type": "call"
}
] |
4234376251 | import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import odeint
from scipy.optimize import minimize
from sklearn.metrics import mean_squared_error as mse
def SIR():
def prediction(beta, gamma, population, i0, r0, d0, time_predict):
def SIR_model(y, t, beta, gamma, population):
... | FBWeimer/Plague-Doctor | Plague Doctor/plaguedoctor/__init__.py | __init__.py | py | 2,604 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "scipy.integrate.odeint",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.transpose",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "scipy.integrate.odeint",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "numpy.a... |
32111228276 | import numpy as np
import matplotlib.pyplot as plt
from scipy import fftpack, signal
# 고주파 성분만 날리는 fft
# def get_filtered_data(in_data, filter_value=0.004):
def del_high_freq(in_data, filter_value=0.004):
"""
:param in_data: 대상 시계열 신호
:param filter_value: filter_value이상의 주파수를 가지는 신호를 날림
:return: fft 결과... | HanNayeoniee/visual-fatigue-analysis | analysis/fft.py | fft.py | py | 6,952 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "scipy.fftpack.fft",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "scipy.fftpack",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "scipy.fftpack.fftfreq",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "scipy.fftpack",... |
5259664413 | import re
#import CMUTweetTagger
#import cPickle
from collections import defaultdict
import pickle
from nltk.corpus import wordnet as wn
from itertools import product
import spacy
from spacy.symbols import *
from nltk import Tree
import nltk
nlp=spacy.load('en')
np_labels=set(['nsubj','dobj','pobj','iobj','conj','nsu... | varun-manjunath/disaster-mitigation | matching/common_nouns.py | common_nouns.py | py | 7,549 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "spacy.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "nltk.Tree",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.wordnet.synsets",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.wordnet"... |
7545685477 | import psycopg2
DBNAME = "news"
def fetch_all(query, params):
"""
execute a query and fetch all result from it
:param query: the query to execute
:param params: parameters of the query
:return: result of this query
"""
# it's kind time consuming every time we open and close a connection
... | akudet/fsnd-proj3 | reporter_db.py | reporter_db.py | py | 2,454 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "psycopg2.connect",
"line_number": 14,
"usage_type": "call"
}
] |
29832128346 | import cv2
#Reading Image
img = cv2.imread('img46_gray_noise.png')
#Aplying filter
median = cv2.medianBlur(img,3)
#Showing image
cv2.imshow("Noised Image", img)
cv2.imshow("median", median)
cv2.waitKey()
cv2.destroyAllWindows()
#Save result
cv2.imwrite("denoised_image.png", median) | Digu62/computer_vision_challenges | Questao1/main.py | main.py | py | 286 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.imread",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.medianBlur",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 11... |
75118275066 | import sqlite3
with open("C:\\Users\Asmaa Samir\Desktop\Project\data.txt", "w") as myFile:
my_tuple1 = ('google.com ', '198.188.3.2 ', '255.255.255.0', '11:01 ')
my_tuple2 = ('youtube.com', '199.588.35.22', '255.255.255.0', '1:01')
my_tuple3 = ('google.com', '198.155.66.1', '255.255.255.0', '7:55')
... | AsmaaGHSamir/GProject | DB.py | DB.py | py | 926 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sqlite3.connect",
"line_number": 12,
"usage_type": "call"
}
] |
6814879797 | import pika, json
def upload(f, fs, channel, access):
# put file into mongodb database
try:
# get file if success
fid = fs.put(f)
except Exception as err:
return "internal server error", 500
# create message
message = {
"video_fid": str(fid),
"mp3_fid": None,
# who owns the file
"username": acc... | dawmro/testing_microservice_architectures | python/src/gateway/storage/util.py | util.py | py | 807 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.dumps",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pika.BasicProperties",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pika.PERSISTENT_DELIVERY_MODE",
"line_number": 28,
"usage_type": "attribute"
}
] |
10418352733 | from __future__ import annotations
import dataclasses
import typing
from randovania.game_description.db.resource_node import ResourceNode
from randovania.game_description.requirements.requirement_and import RequirementAnd
from randovania.game_description.requirements.resource_requirement import ResourceRequirement
fr... | randovania/randovania | randovania/game_description/db/teleporter_network_node.py | teleporter_network_node.py | py | 3,434 | python | en | code | 165 | github-code | 6 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "randovania.game_description.db.node.NodeContext",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Iterator",
"line_number": 17,
"usage_type": "attribute"
... |
1112499487 | """ VirtualMachineHandler provides remote access to VirtualMachineDB
The following methods are available in the Service interface:
- insertInstance
- declareInstanceSubmitted
- declareInstanceRunning
- instanceIDHeartBeat
- declareInstanceHalting
- getInstancesByStatus
- declareInstanc... | DIRACGrid/VMDIRAC | VMDIRAC/WorkloadManagementSystem/Service/VirtualMachineManagerHandler.py | VirtualMachineManagerHandler.py | py | 18,285 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "VMDIRAC.WorkloadManagementSystem.DB.VirtualMachineDB.VirtualMachineDB",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "DIRAC.Core.Utilities.ThreadScheduler.gThreadScheduler.addPeriodicTask",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "DIRAC... |
39261296650 | import os
import shutil
import zipfile
from base64 import b64decode
from utils.config import config
import requests
root_path = os.getcwd()
gat = (
"Z2l0aHViX3BhdF8xMUJBQkhHNkEwa1JRZEM1dFByczhVXzU0cERCS21URXRGYm"
"FYRElUWE5KVUk4VkUxVTdjb0dHbElMSWdhVnI2Qkc3QzVCN0lCWlhWdDJMOUo2"
)
def download_and_extract_zip(... | CHNZYX/Auto_Simulated_Universe | utils/update_map.py | update_map.py | py | 4,483 | python | en | code | 2,771 | github-code | 6 | [
{
"api_name": "os.getcwd",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": ... |
27070905288 | import datetime as dt
import random
import pytest
from scheduler import Scheduler, SchedulerError
from scheduler.base.definition import JobType
from scheduler.threading.job import Job
from ...helpers import DELETE_NOT_SCHEDULED_ERROR, foo
@pytest.mark.parametrize(
"n_jobs",
[
1,
2,
... | DigonIO/scheduler | tests/threading/scheduler/test_sch_delete_jobs.py | test_sch_delete_jobs.py | py | 2,653 | python | en | code | 51 | github-code | 6 | [
{
"api_name": "scheduler.Scheduler",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "helpers.foo",
"line_number": 28,
"usage_type": "argument"
},
{
"api_name": "datetime.datetime.now",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "datetime.da... |
24510539081 | import json
import frappe
from frappe.model.document import Document
from frappe.utils.safe_exec import get_safe_globals, safe_exec
from frappe.integrations.utils import make_post_request
from frappe.desk.form.utils import get_pdf_link
from frappe.utils.background_jobs import enqueue
def validate(self, method):
if s... | finbyz/whatsapp_erpnext | whatsapp_erpnext/whatsapp_erpnext/doc_events/notification.py | notification.py | py | 5,911 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "frappe.get_doc",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "frappe.get_all",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "frappe.utils.safe_exec.safe_exec",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "frappe... |
8097011811 | import pathlib
import PIL.Image
import PIL.ImageChops
import pyscreenshot
from sigsolve import imageutil, geometry
import numpy
def rehydrate(array):
# return PIL.Image.frombytes('RGB', array.shape[:2], array.astype(numpy.uint8).tobytes())
return PIL.Image.fromarray(array, 'RGB')
class Vision:
# How m... | dewiniaid/sigsolve | sigsolve/vision.py | vision.py | py | 3,821 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "PIL.Image.Image.fromarray",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "PIL.Image.Image",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "pathlib.Path... |
26234013938 | #!/usr/bin/python3
"""Starts a basic flask web application"""
from flask import Flask, render_template
from markupsafe import escape
from models import storage
from models.state import State
from models.city import City
app = Flask(__name__)
@app.teardown_appcontext
def teardown(self):
"""procedure to run after... | AndyMSP/holbertonschool-AirBnB_clone_v2 | web_flask/8-cities_by_states.py | 8-cities_by_states.py | py | 1,008 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "models.storage.close",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "models.storage",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "models.storage.all",
... |
35515894022 | import sys
sys.path.append('..')
from common.wrapped_input import wrapped_input
from common.clean_screen import clean_screen
__TERMINATE_MARKS__ = ['***', '****']
class Reader:
def __init__(self, args):
self.loop = True
def run(self, parser):
print("""
_ __ __, ... | ezPsycho/brainSpy-cli | src/readers/interactive.py | interactive.py | py | 881 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "common.wrapped_input.wrapped_input",
"line_number": 28,
"usage_type": "call"
}
] |
39269318225 | import logging
import os
import random
import sys
from functools import wraps
from pprint import pformat
from subprocess import Popen, PIPE
from threading import Thread
from dim import db
from dim.models.dns import OutputUpdate
from dim.rpc import TRPC
from tests.pdns_test import PDNSTest
from tests.pdns_util import c... | 1and1/dim | dim-testsuite/tests/pdns_changes.py | pdns_changes.py | py | 4,950 | python | en | code | 39 | github-code | 6 | [
{
"api_name": "dim.rpc.TRPC",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "functools.wraps",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "tests.pdns_util.compare_dim_pdns_zones",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "s... |
5119440044 | from netaddr import IPNetwork, IPAddress
import logging
from pymongo import MongoClient
logger = logging.getLogger( "ucn_logger" )
class VPNResolve(object):
def __init__( self, cidr, dbcfg):
self.logscollection = dbcfg['logscollection']
self.devicecollection = dbcfg['devicecollection']
self.db = dbcfg['db']
... | ucn-eu/ucnviz | vpnresolve.py | vpnresolve.py | py | 1,620 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "netaddr.IPAddress",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "netaddr.IPNetw... |
11545903852 |
import modules.processing_turn as m_turn
import modules.data_base as m_data
def click_cell(x,y):
# Умова першого рядка таблиці
if y < 100 and y > 0:
# Умова першої комірки по х
if x > -100 and x < 0 and m_data.list_cells[0] == 0:
m_turn.who_turn(-100, 100, 0)
# Умова друг... | BoiarkinaOryna/cross_zero_game | modules/checking_square_coordinates.py | checking_square_coordinates.py | py | 1,655 | python | uk | code | 0 | github-code | 6 | [
{
"api_name": "modules.data_base.list_cells",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "modules.data_base",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "modules.processing_turn.who_turn",
"line_number": 11,
"usage_type": "call"
},
{
... |
26807586503 | from src.utils.all_utils import read_yaml, create_directory
import argparse
import os
import shutil
from tqdm import tqdm
import logging
log_string = "[%(asctime)s: %(levelname)s: %(module)s]: %(message)s"
logs_dir = "Logs"
os.makedirs(logs_dir,exist_ok=True)
logging.basicConfig(filename=os.path.join(logs_dir,"Running... | vicharapubhargav/dvc_tensorflow_demo | src/stage_01_load_save.py | stage_01_load_save.py | py | 1,595 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.makedirs",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numb... |
6729300182 | #!/usr/bin/env python
#-*- coding: utf-8 -*-
"""
@file: oracle_cls.py
@author: ImKe at 2022/2/23
@email: tuisaac163@gmail.com
@feature: #Enter features here
"""
import torch.nn as nn
import torch
import datetime, os, copy, math, time, collections, argparse, nltk, json, sys
sys.path.append('../')
import numpy as np
from... | ImKeTT/AdaVAE | controlgen/oracle_cls.py | oracle_cls.py | py | 9,368 | python | en | code | 32 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module... |
39629119175 | import numpy as np
import glob
import os
import pandas as pd
from tqdm import tqdm
import nltk
import string
from nltk.tokenize import word_tokenize
import random
import pickle
from nltk.corpus import stopwords
from autocorrect import Speller
import re
from nltk.corpus import wordnet
from nltk.stem.wordnet import Wor... | kalyankumarp/Abstractive-Text-Summarization-using-Transformers | Models/preprocess.py | preprocess.py | py | 4,310 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "os.listdir",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.wordnet.ADJ",
"line_number": 60,
"usage_type": "attribute"
},
{
"api_name": "nltk.corpus.wordnet",
"line_number": 60,
"usage_type": "name"
},
{
"api_name": "nltk.corp... |
6460552932 | import sys
import click
import logging
from pprint import pprint
from ftmstore import get_dataset
from servicelayer.cache import get_redis, get_fakeredis
from servicelayer.logs import configure_logging
from servicelayer.jobs import Job, Dataset
from servicelayer import settings as sl_settings
from servicelayer.archive.... | alephdata/ingest-file | ingestors/cli.py | cli.py | py | 3,714 | python | en | code | 45 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "ingestors.worker.OP_ANALYZE",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "ingestors.worker.OP_INGEST",
"line_number": 19,
"usage_type": "name"
},
{
"api_name... |
36151078302 | import sqlite3 as lite
import sys
from bs4 import BeautifulSoup
import requests
import re
def site_parsing():
max_page = 10
pages = []
id_n = 0
id_n_price = 0
for x in range(1, max_page + 1):
pages.append(requests.get('https://moto.drom.ru/sale/+/Harley-Davidson+Softail/'))
for n in... | TatyanaKuleshova/lesson19-project- | db.py | db.py | py | 1,878 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "re.split",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 2... |
23948038488 | import torch.nn as nn
import torch_geometric.nn as pyg_nn
class iVGAE_Encoder(nn.Module):
def __init__(self, in_channels, hidden_channels, out_channels):
super().__init__()
self.conv0 = pyg_nn.GCNConv(in_channels, hidden_channels)
self.conv1 = pyg_nn.GCNConv(hidden_channels, hidden_channels... | DavidCarlyn/iVGAE | models.py | models.py | py | 1,705 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "torch_geometric.nn.GCNConv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch_geometric... |
17283528585 | from solver import Solver
from config import Config
if __name__ == '__main__':
cfg = Config()
cfg.data_dir = "/data/face/parsing/dataset/ibugmask_release"
cfg.model_args.backbone = "STDCNet1446"
cfg.model_args.pretrain_model = "snapshot/STDCNet1446_76.47.tar"
solver = Solver(cfg)
solver.sample... | killf/U2Net4FaceParsing | test.py | test.py | py | 409 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "config.Config",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "solver.Solver",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "solver.sample",
"line_number": 11,
"usage_type": "call"
}
] |
14335019516 | import numpy as np
import matplotlib.pyplot as plt
from mpi4py import MPI
from process_coordination import width_height, bool_boundaries, number_of_blocks
from streaming_functions import streaming, recalculate_functions
from plotting_functions import plot_velocity, plot_velocity_slice
# Initialize parallelization
com... | Dunitrie/HPC | main.py | main.py | py | 3,550 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "mpi4py.MPI.COMM_WORLD",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "mpi4py.MPI",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "process_coordination.number_of_blocks",
"line_number": 22,
"usage_type": "call"
},
{
"api_nam... |
33155203825 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-from telegram.ext import Updater, CommandHandler
from telegram.ext import Updater, CommandHandler
updater = Updater('TOKEN')
def start_method(bot, update):
bot.sendMessage(update.message.chat_id, "سلام")
start_command = CommandHandler('start', start_method)
updater.di... | rasoolhp/free-telegram-bot | bot.py | bot.py | py | 412 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "telegram.ext.Updater",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "telegram.ext.CommandHandler",
"line_number": 9,
"usage_type": "call"
}
] |
17913448581 | """Made email unique
Revision ID: ff6f0a832e3a
Revises: 876813ef988d
Create Date: 2022-08-09 16:32:43.590993
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'ff6f0a832e3a'
down_revision = '876813ef988d'
branch_labels = None
depends_on = None
def upgrade() -> ... | djangbahevans/wallet-clone | backend/alembic/versions/ff6f0a832e3a_made_email_unique.py | ff6f0a832e3a_made_email_unique.py | py | 667 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "alembic.op.create_unique_constraint",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "alembic.op.drop_constraint",
"line_number": 27,
"usage_type": "call"
},
{
"api_nam... |
715415024 | import pandas as pd
import pickle
def buildDataSet():
#Import Ingredients DF
print('Loaded Products...')
ewg_ing_df = pd.read_json('ingredients_products_keys_fixed/ewg_ingredients.json', orient = 'index')
#Build mapping between Ingredient ID and ingredient Name
ing_map = {}
for i in range(len(ewg_in... | SombiriX/w210_capstone | buildModel.py | buildModel.py | py | 8,443 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pandas.read_json",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.read_json",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame... |
6112251845 | import sys
#sys.path.append('/usr/local/Cellar/opencv3/3.2.0/lib/python2.7/site-packages')
sys.path.append("/usr/local/Cellar/opencv3/3.2.0/lib/python3.5/site-packages")
import cv2
import numpy as np
import os
import random
def show_image(im):
height, width = im.shape[:2]
res = cv2.resize(im,(2*width... | ltecot/humanMotionClassification | img_processing.py | img_processing.py | py | 3,562 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "cv2.resize",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.INTER_CUBIC",
"line_nu... |
36259278100 | import requests
from bs4 import BeautifulSoup
import json
import secrets
from requests_oauthlib import OAuth1
from operator import itemgetter
import sqlite3
import csv
import base64
import itertools
import plotly.plotly as py
import plotly.graph_objs as go
import webbrowser
spotifybase = "https://accounts.spotify.com/... | jntoma/finalproj206 | final_food.py | final_food.py | py | 33,382 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "secrets.client_id",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "secrets.client_secret",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 118,
"usage_type": "call"
},
{
"api_name": "json.lo... |
73574084347 | import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name = "Deuces Poker Client",
version = "1.0",
author = "Daniel Fonseca Yarochewsky",
description = ("A client to simulate a Texa Holdem Poker Table"),
license = "F... | yarochewsky/poker-client | setup.py | setup.py | py | 409 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "setuptools.setup",
"line_n... |
72699334907 | import pandas as pd
from sklearn.model_selection import train_test_split
from transformers import BertTokenizer, BertModel, AutoTokenizer, AutoModelForMaskedLM
from torch import nn
import numpy as np
from sklearn.model_selection import train_test_split, KFold, StratifiedKFold
from torch.optim import Adam
from tqdm impo... | zzhaire/dig-dig-books | code/train.py | train.py | py | 7,354 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.StratifiedKFold",
"line_number": 23,
"usage_type": "call... |
3929047732 | from .wav import write_sine_wave_wav_file
def test_sine():
import io
import time
buffer_size = io.DEFAULT_BUFFER_SIZE
filename = "test-5min-512hz-sr48khz-s24le-pcmdatagen.wav"
frequency = 512
sample_rate = 48000
duration = 5 * 60 * sample_rate # 5 minutes
bit_depth = 24
start_ti... | louie-github/morsel | morsel/test_sine.py | test_sine.py | py | 772 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "io.DEFAULT_BUFFER_SIZE",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "wav.write_sine_wave_wav_file",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tim... |
29818611165 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @File : get_content_data.py
# @Description: 获取去标签后的文本数据
# @Time : 2020-5-30 上午 11:09
# @Author : Hou
import os
import pandas as pd
import pymysql.cursors
def get_id_list():
original_data = pd.read_excel(os.path.join(os.path.abspath('../..'), 'data'... | Kidron-Hou/category_division | src/data/get_content_data.py | get_content_data.py | py | 1,684 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_excel",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"li... |
23609310998 | import selenium
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException
from bs4 import BeautifulSoup
import pymysql
from db_setting import db
# 페이지 로딩을 기다리는데 사용할 time 모듈 import
impo... | Ticket-Cinema/real-time-crawling | first_chart_crawling/actor_crawling.py | actor_crawling.py | py | 3,333 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.chrome.options.Options",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 22,
"usage_type": "name"
},
{... |
27535780328 | import time
from functools import wraps
from typing import Dict
import requests
from constants import GITHUB_ROOT, RENDER_ROOT
from logging_config import logger
from render_api.utils import get_headers, get_github_status
session = requests.Session()
# Decorator for logging and error handling
def log_and_handle_err... | Fyleek/render-api | render_api/services/deployment_status_service.py | deployment_status_service.py | py | 4,593 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.Session",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging_config.logger.error",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "logging_config.logger",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "fu... |
35614869771 | """
This will fetch database data from database
"""
from typing import List
from copy import deepcopy
from codegen.table.python_free_connex_table import PythonFreeConnexTable
from codegen.database import DatabaseDriver
from os import path
class DataFetcher:
def __init__(self, db_driver: DatabaseDriver):
"... | secyan/secyan_gen | codegen/utils/DataFetcher.py | DataFetcher.py | py | 1,945 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "codegen.database.DatabaseDriver",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "codegen.table.python_free_connex_table.PythonFreeConnexTable",
"line_number": 21,
"usage_type... |
45641177766 | import streamlit as st
import pandas as pd
import numpy as np
import umap
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
from scipy.cluster.hierarchy import dendrogram, linkage, fcluster
from sklearn.decomposition import PCA
import webbrowser
# Set width mode to wide to display plots better
st.se... | furmanlukasz/clusteringSchizphrenia | app.py | app.py | py | 9,731 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "streamlit.set_page_config",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "streamlit.set_option",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "streamlit.sidebar.header",
"line_number": 18,
"usage_type": "call"
},
{
"api_name"... |
10701337998 | import tensorflow as tf
import re
import time, datetime
import os
import data_helper
TOWER_NAME = 'tower'
class CNNClassify(object):
"""CNN图像分类
"""
def __init__(self, batch_size, num_classes, num_train_examples, initial_lr=0.1, lr_decay_factor=0.1,
moving_average_decay=0.9999, num_epochs_p... | mikuh/tf_code | cnn/cnn_model.py | cnn_model.py | py | 19,630 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "tensorflow.ConfigProto",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tensorflow.GPUOptions",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tensorflow.device",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "tensor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.