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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
36255805376 | import boto3
import json
import os
dynamodb = boto3.resource('dynamodb')
client = boto3.client('dynamodb')
USERS_TABLE = dynamodb.Table(os.environ['USERS_TABLE'])
def delete_user_service(event, context):
try:
response = USERS_TABLE.update_item(
Key={
'userId': event['pathParam... | Glendid/glendid-app-users | src/services/DeleteUser.py | DeleteUser.py | py | 875 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "boto3.resource",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "json.dumps",
"line_numbe... |
73084758907 | import pandas as pd
# import requests
import sys
import collections
# import urllib.request
import json
# url = 'http://loterias.caixa.gov.br/wps/portal/loterias/landing/lotofacil/!ut/p/a1/04_Sj9CPykssy0xPLMnMz0vMAfGjzOLNDH0MPAzcDbz8vTxNDRy9_Y2NQ13CDA0sTIEKIoEKnN0dPUzMfQwMDEwsjAw8XZw8XMwtfQ0MPM2I02-AAzgaENIfrh-FqsQ9w... | daklima/bootcamp-engdados-oct22 | A001/main.py | main.py | py | 3,954 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.read_html",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"l... |
37616517604 | from time import sleep
from signal import pause
from gpiozero import LED
from gpiozero import Button
from pygame import mixer
mixer.init()
placeholder = mixer.Sound('placeholder.wav')
ph_len = placeholder.get_length()
led = LED(25)
btn = Button(4)
while True:
btn.wait_for_press()
print("Initialized")
b... | Aahil52/animatronics2022 | testscripts/soundandlightstest.py | soundandlightstest.py | py | 516 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.mixer.init",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.mixer",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "pygame.mixer.Sound",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pygame.mixer",
"li... |
30513158454 | import os
import datetime
from django.conf import settings
date = datetime.datetime.now()
filename_secrets_bx24 = os.path.join(settings.BASE_DIR, 'reports', 'report.txt')
class Report:
def __init__(self):
self.date = None
self.filename = None
self.fields = None
# self.encoding = '... | Oleg-Sl/Quorum_merge_contacts | merge_contacts/api_v1/service/report/report_to_html.py | report_to_html.py | py | 7,159 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
26596833071 | # -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
# Import libraries
import matplotlib.pyplot as plt
import matplotlib.animation as animate
import matplotlib.lines as mlines
import agentframework
import csv
# Request input from user for number of heroes and enemies
print("Welcome to the h... | emilyjcoups/Agent_Based_Model | model.py | model.py | py | 5,535 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.gca",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "matp... |
30023024204 | import os
import glob
import numpy as np
from scipy.stats import norm
import json
class WarpedSpace:
# takes a prior as a dict and returns a scipy normal distribution
@staticmethod
def create_distribution(prior):
means = []
stds = []
ranges = []
for key in sorted(prior... | piboauthors/PiBO-Spearmint | spearmint/warping.py | warping.py | py | 3,633 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.inf",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "scipy.stats.norm.rvs",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "scipy.stats.norm",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "scipy.stats.norm... |
3910734213 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Fri 14 09:34:03 2018
@author: MariusD
"""
#Server
from flask import Flask, jsonify
server = Flask("phonebook")
phonebook={"Mum":"0173240", "Dad":"01717374", "Pepe":"01773849", "IE":"01"}
# Add contact
@server.route("/add_contact/<number>/<name>",... | Mariusxz/Indidivdual_Assignment_3 | Individual-Assignment-3/Phonebook/Server.py | Server.py | py | 1,759 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_num... |
3238675482 | """Contains the class single_object.
Used to compute single thermal objects.
"""
from .. import solvers
from . import Object
import matplotlib.pyplot as plt
import numpy as np
class SingleObject:
"""Single_object class.
This class solves numerically the heat conduction equation for 1 dimension
of a si... | djsilva99/heatrapy | heatrapy/dimension_1/objects/single.py | single.py | py | 17,265 | python | en | code | 51 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 93,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 93,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 104,
"usage_type": "call"
},
{
"api_name": "numpy.array",... |
9002196810 | from ast import parse
import pathlib
import configparser
import shutil
import enum
from sre_constants import CATEGORY
output = pathlib.Path("./.out")
shutil.rmtree(output, ignore_errors=True)
output.mkdir(exist_ok=True)
book_counter = 0
cfg = configparser.ConfigParser()
cfg.read(".input.ini", encoding="utf-8")
wit... | diraven/zomegen | books/__main__.py | __main__.py | py | 1,440 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "shutil.rmtree",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "configparser.ConfigParser",
"line_number": 15,
"usage_type": "call"
}
] |
25969778046 | import requests
from bs4 import BeautifulSoup
import pandas as pd
#程式欢迎语
print("**欢迎来到UCAR爬虫程式**")
print("\n")
#将资料存入建立好的list
titles = []
date = []
url_list = []
clicks =[]
replys = []
#自定义查询关键字及日期区间
x = str(input("请输入想爬取的关键字:"))
print("日期格式输入范例(YYYYMMDD):20200715")
print("\n")
start_date = int(input("请输入想爬取的起始日期:"... | weiweibro87777/UCAR_web-crawler | ucar.py | ucar.py | py | 3,533 | python | zh | code | 1 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 111,
"usage_type": "call"
}
] |
5782054342 | from django.contrib import admin
from .models import Listing
# change Register your models data's list views attribite.
class ListingAdmin(admin.ModelAdmin):
list_display = ('id', 'title', 'is_published', 'price', 'list_date', 'realtor') # display items
list_display_links = ('id', 'title', 'realtor') #clic... | MonadWizard/django_HouseSellRealEstate_project | listings/admin.py | admin.py | py | 671 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.site.register",
"line_number": 14,
"usage_type": "call"
},... |
5073225844 | import urllib, urllib.request
from datetime import datetime
def get_data(province_id): # Отримання тестових даних із WEB-сторінки
url = 'https://www.star.nesdis.noaa.gov/smcd/emb/vci/VH/get_TS_admin.php?country=UKR&provinceID={}&year1=1981&year2=2020&type=Mean'.format(province_id)
# Відкриття WEB-сторінки м... | DJeik7/lab2 | Ad1.py | Ad1.py | py | 1,504 | python | uk | code | 0 | github-code | 6 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "urllib.request",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "dateti... |
23156107935 | from flask import Flask
from main import main
from mypage import mypage
from challengedetail import challengedetail
from flask import Flask, render_template, jsonify, request, session, redirect, url_for
from db import db
app = Flask(__name__)
# JWT 토큰을 만들 때 필요한 비밀문자열입니다. 아무거나 입력해도 괜찮습니다.
# 이 문자열은 서버만 알고있기 때문에, 내 서버에서... | cchloe0927/Mallenge | app.py | app.py | py | 6,984 | python | ko | code | 2 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "main.main",
"line_number": 24,
"usage_type": "argument"
},
{
"api_name": "mypage.mypage",
"line_number": 25,
"usage_type": "argument"
},
{
"api_name": "challengedetail.challenged... |
10423084443 | from __future__ import annotations
import dataclasses
from typing import TYPE_CHECKING
from unittest.mock import MagicMock, PropertyMock
import pytest
from randovania.exporter import pickup_exporter
from randovania.game_description import default_database
from randovania.game_description.assignment import PickupTarg... | randovania/randovania | test/games/dread/exporter/test_dread_patch_data_factory.py | test_dread_patch_data_factory.py | py | 12,949 | python | en | code | 165 | github-code | 6 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "randovania.interface_common.players_configuration.PlayersConfiguration",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "randovania.layout.layout_description.LayoutDescriptio... |
13415300522 | # -*- coding: utf-8 -*-
"""
@author: Taoting
将用coco格式的json转化成labeime标注格式的json
"""
import json
import cv2
import numpy as np
import os
#用一个labelme格式的json作为参考,因为很多信息都是相同的,不需要修改。
def reference_labelme_json():
ref_json_path = './bin/25.json'
data=json.load(open(ref_json_path))
return data
def labe... | Tommy-Bie/Logistics-Package-Separation-Software | DatasetUtils/coco2labelme.py | coco2labelme.py | py | 2,887 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 70,
... |
9658653690 | import matplotlib.pyplot as plt
import scipy.signal as ss
import numpy as np
import math
window_size = 55
'------------------------------------------------------------------------------'
# opis: oblicza i zwraca pochodna sygnalu.
# nazwa funkcji: FUNC_diff
# parametry:
# ecg_filtered - numpy 1D array
#... | sebastianczuma/r_peaks | R_PEAKS_old.py | R_PEAKS_old.py | py | 9,657 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "numpy.ones",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "scipy.signal.lfilter",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "scipy.signal",
"line_number": 52,
"usage_type": "name"
},
{
"api_name": "scipy.signal.medfilt",
... |
22093759735 | import pandas as pd
from sklearn import svm
import statistics
data = pd.read_csv('cleaned_LaptopDataset.csv')
t = statistics.median(data['latest_price'])
h = []
from sklearn import preprocessing
le = preprocessing.LabelEncoder()
for x in data.latest_price:
if (x >= t):
h.append(1... | mohamedezzeldeenhassanmohamed/Data-Mining-Project | svm.py | svm.py | py | 1,007 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "statistics.median",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sk... |
14475582891 | from django import forms
from django.forms import modelformset_factory
from dashboard.forms.educator_account_form import EducatorAccountForm
from dashboard.models.educator_model import Educator
class EducatorForm(forms.ModelForm):
class Meta:
model = Educator
fields = ['photo', 'name', 'title', '... | EslamTK/Students-Performance-System | dashboard/forms/educator_form.py | educator_form.py | py | 1,367 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "dashboard.models.educator_model.Educator",
"line_number": 10,
"usage_type": "name"
},
{
"a... |
44633342253 | from typing import List
from torch import optim
from torch.optim.optimizer import Optimizer
from torch_geometric.data.data import Data
from src.dataset import citeSeer
from src.model import GAT
import torch
import torch.nn.functional as F
from torch_geometric.data import Dataset
EPOCH = 200
# --- da... | February24-Lee/gnn_research | test_gat_exmaple.py | test_gat_exmaple.py | py | 1,645 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "src.dataset.citeSeer",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "src.model.GAT",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "torch.device",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_availab... |
36076011155 |
# -*- coding: utf-8 -*-
from flask import Flask, render_template, request,jsonify, redirect,url_for
from json import dumps
import celery , sys
from celeryconfig import appcelery
from Buscador import tasks
import time, json
app = Flask(__name__)
@app.route('/datos', methods=['GET', 'POST'])
def recibirInformacion():
... | AntonioAlcM/tfg_ugr | backend/tratamientoDatos.py | tratamientoDatos.py | py | 2,620 | python | pt | code | 1 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.request.args.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "flask.reque... |
2500816506 | from bokeh.layouts import column
from bokeh.models.widgets import RadioButtonGroup,Select, Div, Button,PreText
from bokeh.models import TextInput, RadioGroup
from bokeh.plotting import curdoc
button_group = RadioButtonGroup(labels=["Physical parameters", "Geometric parameters", "Initial conditions"], active=1)
## A... | sduarte09/Module5 | Exercise/Group5/BWC.py | BWC.py | py | 2,455 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "bokeh.models.widgets.RadioButtonGroup",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "bokeh.models.TextInput",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "bokeh.models.widgets.Select",
"line_number": 14,
"usage_type": "call"
},
... |
18732949012 | import json
import numpy as np
import util
class AudfprintAligner:
matches = {}
def __init__(self, matchfile):
with open(matchfile) as f:
for x, ys in json.load(f).iteritems():
for y, m in ys.iteritems():
m = m[0]
if "Matched" in m:
... | grateful-dead-live/meta-alignment | audfprint_aligner.py | audfprint_aligner.py | py | 1,407 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "util.get_duration",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "util.get_duration",
"line_number": 33,
"usage_type": "call"
}
] |
31472363916 | # Code adapted from https://www.codeproject.com/Articles/5297227/Deep-Learning-for-Fashion-Classification
# import tensorflow.keras as keras
import os
import matplotlib.pyplot as plt
import matplotlib.image as img
import tensorflow as tf
import keras
import numpy as np
from keras.preprocessing.image import ImageDataGe... | nnanna217/msc-image-search | func/my_samples/cp_fashion-classifier.py | cp_fashion-classifier.py | py | 4,162 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tensorflow.compat.v1.ConfigProto",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tensorflow.compat",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.compat.v1.keras.backend.set_session",
"line_number": 15,
"usage_type":... |
10713768489 | from scipy import stats, signal
from collections import defaultdict
import numpy as np
from tqdm.notebook import tqdm
import pandas as pd
from src import config
from src.FFT import FFTAnalysis as FFT
def _extractTimeDomainFeatures(sig):
''' Extracts time domain features from one vibration signal'''
# Get ti... | Miltos-90/Bearing_Fault_Classification | src/feature_extraction.py | feature_extraction.py | py | 4,432 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.sqrt",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.square",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.std",
"line_number": 28,
... |
40678810913 | import argparse
import json
import os
import platform
import subprocess
from typing import List
HOST_MAGMA_ROOT = '../../../.'
def main() -> None:
""" Run main"""
args = _parse_args()
if args.mount:
_run(['up', '-d', 'test'])
_run(['exec', 'test', 'bash'])
_down(args)
elif a... | magma/magma | feg/gateway/docker/build.py | build.py | py | 4,696 | python | en | code | 1,605 | github-code | 6 | [
{
"api_name": "json.dumps",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 55,
"usage_type": "name"
},
{
"api_name": "subprocess.run",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "subprocess.CalledProcessError",... |
13300386404 | #!/usr/bin/python3
import _thread
import re, time, cv2, serial
'''
ServoController interfaces with the arduino board to control the servo motor over
USB serial coms
'''
class ServoController:
def __init__(self):
self.ser = serial.Serial('com3', 9600, timeout=0.5)
def __enter__(s... | bradys/cat-cam | Cat_Cam.py | Cat_Cam.py | py | 6,213 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "serial.Serial",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_number": 5... |
20651798683 | import math
import random
import numpy as np
from itertools import combinations
from copy import deepcopy
class Node:
def __init__(self):
self.parent = None
self.state = []
self.children = []
self.fully_expanded = False
self.Q = 0
self.N = 0
def... | shaido987/riskloc | algorithms/hotspot.py | hotspot.py | py | 8,100 | python | en | code | 93 | github-code | 6 | [
{
"api_name": "numpy.sqrt",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.power",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.copy",
"line_number": 30,
... |
5991002670 | from collections import OrderedDict
from itertools import chain
from .types import Vsn, MatrixID, PacketClass
from .patches import patch
from .cache import from_page, get_page
from .sources import version_urls
from .parsers import pre_versions, pre_packets, rel_version, rel_packets
from .parsers import first_heading
... | joodicator/mc-dev-data | mcdevdata/matrix.py | matrix.py | py | 7,498 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "collections.OrderedDict",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sources.version_urls.items",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "sources.version_urls",
"line_number": 26,
"usage_type": "name"
},
{
"api_name"... |
14872333572 | import torch
from torch import nn
import torch.nn.functional as F
from torch import optim
from torchvision import datasets, transforms, models
from workspace_utils import active_session
from collections import OrderedDict
import numpy as np
from PIL import Image
import argparse
import json
parser = argparse.Argument... | OmarMohy/Image-Classifier-with-Deep-Learning | predict.py | predict.py | py | 3,922 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "torch.load",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "torch.load",
"line_n... |
40160808434 | import openpyxl
import os
from setting import get_file_path, get_file_name
file_path = get_file_path()
file_name = get_file_name()
# 切換到指定路徑
os.chdir(file_path)
# 讀進Excel檔案
wb = openpyxl.load_workbook(file_name)
# 取的Excel的第一個工作表
sheet = wb.worksheets[0]
etf_all = dict()
# 彙整全部的ETF清單
for columnNum in range(1, she... | ShengUei/Stock | etf_analysis.py | etf_analysis.py | py | 1,419 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "setting.get_file_path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "setting.get_file_name",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "openpyxl.load_workb... |
37169471952 | from flask import request
from flask_restx import Resource
from ..service.auth_service import Auth
from ..util.decorator import admin_token_required
from ..service.user_service import save_new_user, get_a_user
from ..util.dto import AuthDto
api = AuthDto.api
user_auth = AuthDto.user_auth
user_token = AuthDto.user_tok... | miteshnath/flask-admin-jwt | app/main/controller/auth_controller.py | auth_controller.py | py | 2,367 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "util.dto.AuthDto.api",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "util.dto.AuthDto",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "util.dto.AuthDto.user_auth",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name... |
811036516 | '''Process Restricted Friend Requests
https://leetcode.com/problems/process-restricted-friend-requests/
You are given an integer n indicating the number of people in a network. Each person is labeled from 0 to n - 1.
You are also given a 0-indexed 2D integer array restrictions, where restrictions[i] = [xi, yi] means ... | Saima-Chaity/Leetcode | Graph/Process Restricted Friend Requests.py | Process Restricted Friend Requests.py | py | 2,945 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 54,
"usage_type": "call"
}
] |
74281107067 | from typing import Any, List
from fastapi import APIRouter, HTTPException, Depends
from apps.auth.model import User
from apps.bank.cruds import invoice
from apps.bank.schemas.invoice import InvoiceUpdate, InvoiceView, InvoiceCreate, InvoiceViewFull
from core.security import current_user_is_banker, get_current_user
r... | MojsaKirill/CRUD | app/api/api_v1/endpoints/invoices.py | invoices.py | py | 2,101 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "apps.bank.cruds.invoice.get_list",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "apps.bank.cruds.invoice",
"line_number": 16,
"usage_type": "name"
},
{
"api_na... |
17007776735 | import requests
import bs4
import urllib
def spider(max_pages):
for page in range(1, max_pages + 1):
query = urllib.parse.urlencode({'query':u'대선후보'})
url = 'http://news.naver.com/main/search/search.nhn?query=' + '%B4%EB%BC%B1%C8%C4%BA%B8'
source_code = requests.get(url)
plain_text ... | masonHong/INU-Study | C Team(Hong, Heo)/Crowaling/Practice 1.py | Practice 1.py | py | 668 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "urllib.parse.urlencode",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "urllib.parse",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup"... |
23468677797 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('tapp', '0005_comment_end_i'),
]
operations = [
migrations.AlterModelOptions(
name='essay',
options={... | rihakd/textAnalyticsDjango | TA/tapp/migrations/0006_auto_20151119_1941.py | 0006_auto_20151119_1941.py | py | 386 | python | en | code | 0 | 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.AlterModelOptions",
"line_number": 14,
"usage_type": "call"
... |
8694936867 | from django.urls import path
from . import views
urlpatterns = [
path("", views.index, name="index"),
path("login", views.login_view, name="login"),
path("logout", views.logout_view, name="logout"),
path("register", views.register, name="register"),
path("newListing", views.newForm, name="new"),
... | SHorne41/Project-2-Commerce | auctions/urls.py | urls.py | py | 1,046 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
72112922749 | import numpy as np
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.nn.functional as F
# import snntorch
import pandas as pd
import tqdm
import argparse
from . import p_snu_layer
class SNN_Net(torch.nn.Module):
def __init__(self, inputs_num = 4, hidden_num = 4, outputs_num = 3 ,l_tau... | GTAKAGI/PSNN | snn_model/network.py | network.py | py | 3,693 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "torch.empty",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "torch.empty",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "torch.empty",
"line_number"... |
32170276466 | #
# demo.py
#
import argparse
import os
import numpy as np
import time
from modeling.deeplab import *
from dataloaders import custom_transforms as tr
from PIL import Image
from torchvision import transforms
from dataloaders.utils import *
from torchvision.utils import make_grid, save_image
torch.set_prin... | AlisitaWeb/SSRN | ceshi_label.py | ceshi_label.py | py | 3,929 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms.Compose",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 60,
"usage_type": "name"
},
{
"api... |
16986332004 | import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.ticker import LinearLocator
from numpy.lib.shape_base import split
import math
import cmath
def get_MSI (matrix, f, tau, iterCnt): #method of simple iterations
n = np.size(f)
B = np.diagflat([1] * n) - tau * matrix
... | Nevtod/Labs | ComputingMath/lab1/Computing_math.py | Computing_math.py | py | 3,874 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.size",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.diagflat",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.size",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number":... |
11547913275 | # This file is part of RADAR.
# Copyright (C) 2019 Cole Daubenspeck
#
# RADAR is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later versio... | Sevaarcen/RADAR | cyber_radar/helpers/target_prioritizer.py | target_prioritizer.py | py | 4,715 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "re.search",
"line_number": 146,
"usage_type": "call"
},
{
"api_name": "typing.Tuple",
"line_number": 109,
"usage_type": "name"
}
] |
650459657 | #! /bin/python
import os
import sys
import json
import luigi
import nifty.tools as nt
import elf.skeleton.io as skelio
from elf.skeleton import skeletonize as skel_impl, get_method_names
import cluster_tools.utils.volume_utils as vu
import cluster_tools.utils.function_utils as fu
from cluster_tools.cluster_tasks im... | constantinpape/cluster_tools | cluster_tools/skeletons/skeletonize.py | skeletonize.py | py | 7,301 | python | en | code | 32 | github-code | 6 | [
{
"api_name": "luigi.Task",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "luigi.Parameter",
"l... |
38217727284 |
from utils import pickle_load
from matplotlib import cm
import matplotlib.pyplot as plt
import collections
def show_results(res_paths):
results = {}
for path in res_paths:
result = pickle_load(path)
for k, v in result.items():
if k not in results.keys():
results[k... | stomachacheGE/bofmp | tracking/scripts/show_best_parameter.py | show_best_parameter.py | py | 2,753 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "utils.pickle_load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "... |
73549612348 | import pandas as pd
import numpy as np
import io
import requests
from sklearn.tree import DecisionTreeClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble import RandomForestClassifier, GradientBoostingClassifier
from sklearn.neural_network import MLPClassifier
from sklearn.preprocessing... | aslakey/CBM_Encoding | lead_scoring_computation_time.py | lead_scoring_computation_time.py | py | 3,159 | python | en | code | 18 | github-code | 6 | [
{
"api_name": "xgboost.XGBClassifier",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "beta_encoder.BetaEncoder",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.OneHotEncoder",
"line_number": 89,
"usage_type": "call"
},
{
... |
35379120975 | import math
import boto3
from aws_cdk import (
core,
aws_ec2 as ec2,
aws_ecs as ecs,
aws_cloudwatch as cw
)
from cdklocust.locust_container import locustContainer
class CdklocustStack(core.Stack):
def __init__(self, scope: core.Construct, id: str, vpc, **kwargs) -> None:
super().__ini... | tynooo/cdklocust | cdklocust/cdklocust_stack.py | cdklocust_stack.py | py | 3,687 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "aws_cdk.core.Stack",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "aws_cdk.core",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "aws_cdk.core.Construct",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "aws_... |
75132007548 | from sklearn.datasets import load_boston
from sklearn.model_selection import train_test_split # model_selection模型选择过程中各种数据分割的类与函数
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LinearRegression, SGDRegressor, LogisticRegression # 线性回归
# externals是外部的、外部扩展的意思
fr... | hahahei957/NewProject_Opencv2 | 机器学习/19_线性回归.py | 19_线性回归.py | py | 5,679 | python | zh | code | 0 | github-code | 6 | [
{
"api_name": "sklearn.datasets.load_boston",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 28,
"usage_ty... |
10422637903 | from __future__ import annotations
import dataclasses
from typing import TYPE_CHECKING
from randovania.bitpacking import bitpacking
from randovania.bitpacking.bitpacking import BitPackDecoder, BitPackValue
from randovania.game_description import default_database
if TYPE_CHECKING:
from collections.abc import Iter... | randovania/randovania | randovania/layout/base/ammo_pickup_state.py | ammo_pickup_state.py | py | 3,973 | python | en | code | 165 | github-code | 6 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "randovania.bitpacking.bitpacking.BitPackValue",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "randovania.game_description.pickup.ammo_pickup.AmmoPickupDefinition",
"lin... |
8600407692 | from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from .routers import post, user, auth, vote
############################################
#models.Base.metadata.create_all(bind=engine)
app = FastAPI()
origins = ["*"]
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
... | Mattia921/example-fastapi | app/main.py | main.py | py | 1,524 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "fastapi.middleware.cors.CORSMiddleware",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": "routers.post.router",
"line_number": 21,
"usage_type": "attribute"
},
{
... |
2055718392 | # USAGE
# python knn.py --dataset ../../SolutionDL4CV/SB_code/datasets/animals
from sklearn.neighbors import KNeighborsClassifier
from sklearn.preprocessing import LabelEncoder
from sklearn.model_selection import train_test_split
from sklearn.metrics import classification_report
from pyimagesearch.preprocessing import ... | lykhahaha/Mine | StarterBundle/chapter07-first_image_classifier/knn.py | knn.py | py | 1,583 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "imutils.paths.list_images",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "imutils.paths",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "pyima... |
4709876834 | import numpy as np
import matplotlib.pyplot as plt
import activation_functions as acfunc
inp_a = np.arange(-1.0, 1.0, 0.2)
inp_b = np.arange(-1.0, 1.0, 0.2)
outputs = np.zeros((10, 10))
weight_a = 2.5
weight_b = 3
bias = 0.1
for i in range(10):
for j in range(10):
u_single = inp_a[i] * weight_a + inp_b... | tsubamon55/pyailesson | single_neuron.py | single_neuron.py | py | 471 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.arange",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "activation_functions.sigmoid_func"... |
18849850963 | import os
import random
import math
import seaborn
import matplotlib.pyplot as plt
num_train_samples = 1
threshold = 0.25
dtw_window = 50
# thresholds: 0.15, 0.2, ...
def read_gesture(path):
with open(path, "r") as file:
lines = [line.rstrip() for line in file]
gesture = [[float(value) for value... | xrgman/ColorMatchingBracelet | arduino/GestureRecorder/evaluate.py | evaluate.py | py | 5,392 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "os.listdir",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "random.shuffle",
"line_number": 119,
"usage_type": "call"
},
{
"api_name": "random.shuffle",
"line_numbe... |
42174278814 | # import transformers
# import datasets
# from pprint import pprint
# # with pipeline
# model = transformers.AutoModelForSequenceClassification.from_pretrained("") # load model from local directory
# tokenizer = transformers.AutoTokenizer.from_pretrained("TurkuNLP/bert-base-finnish-cased-v1")
# test_pipe = transfo... | TurkuNLP/register-qa | predict.py | predict.py | py | 4,037 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "pprint.PrettyPrinter",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "pandas.DataFr... |
14478011852 | '''
Loss functions.
'''
import copy
import torch
import torch.nn as nn
from torch.autograd import Variable
import numpy as np
import utils
class NLLLoss(nn.Module):
"""Self-Defined NLLLoss Function
Args:
weight: Tensor (num_class, )
"""
def __init__(self, weight):
super(NLLLoss, se... | TalkToTheGAN/REGAN | loss.py | loss.py | py | 5,235 | python | en | code | 42 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "torch.autograd.Variable",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "torch.zeros",
... |
36920706174 | #-------------------------------------------------------------------------
# Script en python que se encarga de conectarse a un recurso Event Hub de
# Microsoft Azure y leer todos los mensajes disponibles, al mismo tiempo
# que deja un checkpoint de lo que ha leído para no repetir mensajes
# la siguiente vez que ... | NoeCampos22/Ejercicio_Azure_Databricks | Mini-Ejercicios/1_Enviar_Recibir_Eventos_EventHub/EPH.py | EPH.py | py | 5,351 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "azure.eventprocessorhost.AbstractEventProcessor",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "json.loads",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": ... |
34668621923 | from django.urls import path
from django.conf.urls import url
from . import views
app_name = 'choistick'
urlpatterns = [
path('', views.index, name='index'),
path('map/', views.map, name='map'),
path('join/', views.signup, name='join'),
path('pick/', views.pick, name='pick'),
path('warn/', views.warn, name='warn... | jaemin8852/Search_Location | choistick/urls.py | urls.py | py | 421 | python | en | code | 0 | github-code | 6 | [
{
"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",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
71570292029 | from django import forms
from django.core.exceptions import ValidationError
from semester.models import Semester, CourseOffered, CourseDistribution, DistributedSectionDetail
from tempus_dominus.widgets import TimePicker, DatePicker
from django.contrib import messages
from django.shortcuts import redirect
class Semest... | Emad-ahmed/luRoutine | semester/forms.py | forms.py | py | 4,085 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.forms.DateField",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.... |
17137130653 | import requests
import re
from bs4 import BeautifulSoup
from openpyxl import load_workbook
DIRECTORY_URL = "https://directory.tufts.edu/searchresults.cgi"
WORKBOOK_NAME = "DirectoryResults_2017-2018.xlsx"
NAME_SHEET = "DirectoryResults"
# This script works on Excel Sheets with a single column in the A column of
# a ... | jGowgiel/fec-donation-aggregator | scripts/DirectoryScrape.py | DirectoryScrape.py | py | 1,261 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.post",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "openpyxl.load_workbook",
... |
40182196672 | from anomaly_detection import Amean
from multiprocessing import Process, Queue
from database import DataBase
from datetime import datetime, timedelta
import time
import traceback
class AnomalyDomain (Process):
# initilize data
def __init__(self, name, host) :
super(AnomalyDomain, self).__init__(... | DUCQUAN7850/warning_service_master | warning_service-master/anomaly_domain.py | anomaly_domain.py | py | 4,642 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "multiprocessing.Process",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "database.DataBase",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "anomaly_detection.Amean",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "anom... |
21806540252 | from jetracer.nvidia_racecar import NvidiaRacecar
import time
import sys
from multiprocessing import Process, Value
import zmq
import Jetson.GPIO as GPIO
pinrun = 'DAP4_SCLK' #12
pinbouton = 'SPI2_SCK' #13
pinau = 'SPI2_CS1' #16
autrepin = 'SPI2_CS0' #18
GPIO.setmode(GPIO.TEGRA_SOC)
GPIO.setup(pinrun, GPIO.OUT)
GPIO... | SpaceLabsfr/BlockApp | serveur-blockapp.py | serveur-blockapp.py | py | 2,553 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "Jetson.GPIO.setmode",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "Jetson.GPIO",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "Jetson.GPIO.TEGRA_SOC",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "Jetson.GPI... |
41774127803 | import hearts.model.game as m
from hearts.game_master import GameMaster
import logging
class GameBackend(object):
def __init__(self, player_svc):
self._next_game_id = 1
self._game_masters = {}
self._players = {}
self._player_mapping = {}
self._player_svc = player_svc
... | MHeasell/hearts-server | hearts/game_backend.py | game_backend.py | py | 1,880 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "hearts.model.game.HeartsGame",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "hearts.model.game",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "hear... |
27456097150 | from pathlib import Path
from sphinx.directives import SphinxDirective
from docutils.parsers.rst import directives
from docutils import nodes
from sphinx.util.logging import getLogger
import yaml
import json
logger = getLogger(__name__)
class PyConfig(SphinxDirective):
has_content = True
def run(self):
... | yoblee/docs | sphext/sphinx_pyscript/pys_directives/__init__.py | __init__.py | py | 2,360 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sphinx.util.logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sphinx.directives.SphinxDirective",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "json.dumps",
"line_number": 19,
"usage_type": "call"
},
{
"api_nam... |
31329871933 | #%%
import pandas as pd
import numpy as np
import datetime as dt
import xarray as xr
import cftime
import dask
from glob import glob
#%%
'''SUBSET RH DATA'''
data = pd.read_csv("preprocessing/inputdata/AMF_US-MBP_BASE_HH_2-5.csv",
skiprows = 2,
na_values = -9999)
data['TIMESTAMP_START'] = ... | mwdjones/clm_frost | preprocessing/forcings/Add_RH_to_Forcings.py | Add_RH_to_Forcings.py | py | 3,217 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv... |
23435779102 | from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import QMessageBox
import sys
import json
import mainwindow, mystock, recepe, compute
class MyMainWindow(mainwindow.Ui_MainWindow):
def setupUi(self, mw, database):
super().setupUi(mw)
self.tabWidget = QtWidgets.QTabWidget()
mw... | bernard169/open-breware | mymainwindow.py | mymainwindow.py | py | 1,084 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "mainwindow.Ui_MainWindow",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets.QTabWidget",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 10,
"usage_type": "name"
},
{
"api_name"... |
30367868751 | from numpy import linspace, sin
from chaco.api import ArrayPlotData, Plot
from chaco.tools.api import PanTool, ZoomTool
from enable.api import ComponentEditor
from traits.api import Enum, HasTraits, Instance
from traitsui.api import Item, Group, View
class PlotEditor(HasTraits):
plot = Instance(Plot)
plot_t... | enthought/chaco | examples/tutorials/scipy2008/ploteditor.py | ploteditor.py | py | 2,299 | python | en | code | 286 | github-code | 6 | [
{
"api_name": "traits.api.HasTraits",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "traits.api.Instance",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "chaco.api.Plot",
"line_number": 12,
"usage_type": "argument"
},
{
"api_name": "traits.ap... |
5223556496 | import os
import time
import requests
import functools
from concurrent.futures import ThreadPoolExecutor
import click
import yaml
def _get_connection_urls(workload_yaml):
with open(workload_yaml) as f:
workload = yaml.safe_load(f)
uris = workload.get("EnvironmentDetails", {}).get("MongosyncConnectionU... | mongodb/genny | src/cast_python/src/mongosync_actor.py | mongosync_actor.py | py | 4,300 | python | en | code | 42 | github-code | 6 | [
{
"api_name": "yaml.safe_load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_numb... |
1448273356 | """This file is to run the model inference here's the command
python run_inference.py -i trainval/images/image_000000001.jpg -m model/model.pt"""
# import the necessary packages
import argparse
import cv2
import numpy as np
from PIL import Image
import torch
from torchvision import transforms
import config
from utils... | Pradhunmya/pytorch_faster_rcnn | run_inference.py | run_inference.py | py | 3,143 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "cv2.cvtColor",
"... |
9591325686 | from rest_framework.authentication import TokenAuthentication
from rest_framework.exceptions import AuthenticationFailed
from .models import AuthToken
from utils.exceptions import *
def expire_token(user):
try:
for auth_token in user.auth_tokens.all():
auth_token.delete()
except AuthToken... | danghh-1998/django_rest_boilerplate | auth_tokens/services.py | services.py | py | 1,418 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "models.AuthToken.DoesNotExist",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "models.AuthToken",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "models.AuthToken.objects.deleted_only",
"line_number": 19,
"usage_type": "call"
},
... |
8898957294 | import telebot
import config
from ibm_watson import LanguageTranslatorV3
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
import json
from telebot import types
import pyowm
owm = pyowm.OWM('c8548689b28b1916f78403fb9c92e4f3', language='ru')
bot = telebot.TeleBot(config.TOKEN)
authenticator =... | IgorSopronyuk/translate_IBM_bot | translater_IBM_bot.py | translater_IBM_bot.py | py | 17,771 | python | ru | code | 0 | github-code | 6 | [
{
"api_name": "pyowm.OWM",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "telebot.TeleBot",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "config.TOKEN",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "ibm_cloud_sdk_core.authent... |
4391450776 | from flask import Flask, render_template, request
import sqlite3
app = Flask(__name__)
@app.route('/',methods = ['POST', 'GET'])
def home():
if request.method == 'GET':
return render_template('index.html')
@app.route('/thankyou',methods = ['POST', 'GET'])
def thankyou():
if request.metho... | senthil-kumar-n/Subscribe_email | subscribe.py | subscribe.py | py | 1,004 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "flask.render_templat... |
20918248522 | import pandas as pd
import numpy as np
from scipy.sparse import csr_matrix
from sklearn.neighbors import NearestNeighbors
from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer
from sklearn.metrics.pairwise import cosine_similarity, linear_kernel
def GetMoviesByDescription(movieName):
movie_... | InsiyaKanjee/Project4 | initdb.py | initdb.py | py | 7,073 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sklearn.feature_extraction.text.TfidfVectorizer",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.pairwise.linear_kernel",
"line_number": 20,
"usage_type":... |
24150609056 | import requests
import random
from utils.others import get_atitle, get_genre, get_t_from_u, get_urls
from utils.anilist import Anilist
from utils.techzapi import TechZApi
def get_genre_html(li):
x = """<a>{}</a>"""
html = ""
for i in li:
html += x.format(i.strip())
return html
def get_eps_... | TechShreyash/AnimeDex | utils/html_gen.py | html_gen.py | py | 10,463 | python | en | code | 186 | github-code | 6 | [
{
"api_name": "utils.techzapi.TechZApi",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "utils.others.get_atitle",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "utils.others.get_urls",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": ... |
16021983077 | import numpy as np
import matplotlib.pyplot as plt
from cartoplot import cartoplot
import imageio
from netCDF4 import Dataset
import pickle
def get(string):
"""
"Lakes":0,
"Oceans":1,
"Okhotsk":2,
"Bering":3,
"Hudso... | robbiemallett/custom_modules | mask.py | mask.py | py | 3,596 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "netCDF4.Dataset",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "netCDF4.Dataset",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_n... |
19240250728 | import tensorflow as tf
import tensorflow_datasets as tfds
config = tf.compat.v1.ConfigProto()
config.gpu_options.allow_growth = True
session = tf.compat.v1.Session(config=config)
def load_celeba_dataset(args, shuffle_files=False, batch_size=128):
ds_train, ds_test = tfds.load(name='celeb_a', split=['train', 'tes... | UCSC-REAL/fair-eval | celeba/experiments/data.py | data.py | py | 452 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "tensorflow.compat.v1.ConfigProto",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "tensorflow.compat",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.compat.v1.Session",
"line_number": 7,
"usage_type": "call"
},
{
... |
2893376277 | # -*- encoding: UTF-8 -*-
from django.http import Http404
from django.db.models.loading import get_model
from django.contrib.staticfiles.storage import staticfiles_storage
from django.contrib.admin.views.decorators import staff_member_required
from django.core.urlresolvers import reverse
from django.shortcuts import re... | revolunet/django-picocms | picocms/views.py | views.py | py | 1,926 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "django.db.models.loading.get_model",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "models.CMSModel",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "django.http.Http404",
"line_number": 17,
"usage_type": "name"
},
{
"api_n... |
8352755533 | from __future__ import absolute_import, unicode_literals
import base64
import json
import random
import warnings
import websocket
from c8 import constants
from c8.api import APIWrapper
from c8.apikeys import APIKeys
from c8.c8ql import C8QL
from c8.collection import StandardCollection
from c8.exceptions import (
... | Macrometacorp/pyC8 | c8/fabric.py | fabric.py | py | 56,104 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "c8.api.APIWrapper",
"line_number": 77,
"usage_type": "name"
},
{
"api_name": "c8.constants.STREAM_PORT",
"line_number": 96,
"usage_type": "attribute"
},
{
"api_name": "c8.constants",
"line_number": 96,
"usage_type": "name"
},
{
"api_name": "c8.c8ql.... |
12900539476 | from fastapi import APIRouter
from pydantic import BaseModel
from starlette.requests import Request
from ozz_backend import app_logger
from ozz_backend.persistence_layer import User
router = APIRouter(
prefix="/user",
tags=["user"],
# dependencies=[Depends(get_token_header)],
)
class UserOngoingOut(Bas... | honeybeeveloper/plat_back | ozz_backend/api/user.py | user.py | py | 895 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "ozz_backend.app_logger.info",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "ozz_b... |
13160016876 | from django.shortcuts import render
from subscribers.models import subscriberForm
from subscribe.settings import EMAIL_HOST_USER
from django.core.mail import send_mail,BadHeaderError
# Create your views here.
def index(request):
form=subscriberForm()
return render(request,"index.html",{"form":form})
... | pawankushwah850/Emailsubscriber | subscribers/views.py | views.py | py | 1,862 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "subscribers.models.subscriberForm",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "subscribers.models.subscriberForm",
"line_number": 14,
"usage_type": "call"
},
... |
44496456290 | import json
import logging
import os
import random
import time
from datetime import datetime
from uuid import uuid4
import paho.mqtt.client as mqtt
# MQTT broker details
BROKER_ADDRESS = os.getenv("BROKER_HOST")
BROKER_PORT = 1883
# Configuring file handler for logging
log_file = f"{__file__}.log"
# Logging setup
lo... | SudeepKumarS/mqtt-sensor-api | mqtt-publisher/mqtt_publisher.py | mqtt_publisher.py | py | 2,912 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.getenv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
... |
15143757328 | from atelier_4_ex1 import gen_list_random_int
import matplotlib.pyplot as plt
import numpy as np
import time ,random
def extract_elements_list(list_in_which_to_choose,int_nbr_of_element_to_extract=10):
list_in_which_to_choose_length,mix_length = len(list_in_which_to_choose),0
mixList = list()
while ... | K-Ilyas/python | atelier_4/atelier_4_ex4.py | atelier_4_ex4.py | py | 2,594 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "atelier_4_ex1.gen_list_random_int",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "time.perf_counter",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "time.perf_counter",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": ... |
71855094268 | import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn import datasets
from sklearn import linear_model
import matplotlib.pyplot as plt
def sigmoid(z):
return 1/(1+np.exp(-z))
def costfunction(X, y, w):
cost = 0
size = y.shape[0]... | Fred199683/Logistic-Regression | LR.py | LR.py | py | 2,556 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.exp",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.log",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.log",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.mat",
"line_number": 19,
"... |
29756907883 | # Author: Sirui Feng
'''
This file splits each review on periods and conjuctions.
'''
import re
import json
from textblob import TextBlob
from textblob.sentiments import NaiveBayesAnalyzer
import csv
from word_stemmer import word_stemmer
public_utilities_path = 'data/public_utilities.json'
def split_period(review):
... | vi-tnguyen/textinsighters | gen_sentences.py | gen_sentences.py | py | 1,757 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "re.compile",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "re.split",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "csv.DictWriter",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 48... |
40449109187 | import argparse
import json
EXAMPLE_USAGE = """
Example Usage via RLlib CLI:
rllib rollout /tmp/ray/checkpoint_dir/checkpoint-0 --run DQN
--env CartPole-v0 --steps 1000000 --out rollouts.pkl
Example Usage via executable:
./rollout.py /tmp/ray/checkpoint_dir/checkpoint-0 --run DQN
--env CartPole-v0 --st... | tud-amr/AC-LCP | utils/parse_args_rollout.py | parse_args_rollout.py | py | 8,847 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "argparse.RawDescriptionHelpFormatter",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 67,
"usage_type": "attribute"
}
] |
40483417494 | import tkinter, threading
from tkinter import ttk
from interface.onglets.onglets_map import OngletsMap
from interface.onglets.onglets_packets import OngletsPackets
from interface.onglets.onglets_personnage import OngletsPersonnage
from interface.onglets.onglets_sorts import OngletsSorts
import time
class MainInterfac... | Azzary/LeafMITM | interface/main_interface.py | main_interface.py | py | 3,458 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "threading.Thread",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "threading.Thread",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
... |
11356022056 | from netCDF4 import Dataset
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
import argodb as argo
import research_tools as research
plt.ion()
plt.close('all')
dirtopo = '/datawork/fsi2/mars/DATA/BATHY/ETOPO2'
topofile = 'etopo2.nc'
dirtopo = '/net/alpha/expo... | pvthinker/pargopy | pargopy_v0/define_landmask.py | define_landmask.py | py | 2,984 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.ion",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.close",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotl... |
70818525628 | #import Library
import speech_recognition as sr
# Initialize recognizer class
r = sr.Recognizer()
# Reading Audio file as source
# listening the audio file and store in audio_text variable
# The path should be correct
with sr.AudioFile('Sample.wav') as source:
audio = r.listen(source)
# Using exception... | CHAODENG/Project4 | SpeechToText.py | SpeechToText.py | py | 632 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "speech_recognition.Recognizer",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "speech_recognition.AudioFile",
"line_number": 11,
"usage_type": "call"
}
] |
18677212205 | import argparse
import logging
import random
import sys
import time
from copy import deepcopy
import numpy as np
import torch
from scipy.stats import kendalltau
from datasets.dataloader import get_dataloader
from models.cell_operations import NAS_BENCH_201
from models.supernet import Supernet201
from utils import obt... | ShunLu91/PA-DA | nasbench201/train_baselines_201.py | train_baselines_201.py | py | 14,254 | python | en | code | 29 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "torch... |
71718726268 | from . import Funktioner
import datetime
import MyModules.GUIclasses2 as GUI
import numpy as np
import os
from . import FileOps
#fix 14.04.10, simlk. Changed "centering error", which should make the test more forgiving at small distances - at large distances it has no effect.
# Last edit: 2012-01-09 fixed mtl t... | SDFIdk/nivprogs | MyModules/FBtest.py | FBtest.py | py | 9,922 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.sqrt",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "numpy.append",
"line_number": 8... |
74535524027 | from django.conf.urls import url
from . import views
app_name = 'api'
urlpatterns = [
url(r'^device/',views.device,name='api_device'),
url(r'^light/',views.light,name='api_light'),
url(r'^temperature/',views.temperature,name='api_temperature'),
url(r'^humidity/',views.humidity,name='api_hum... | CreeperSan/Graduation-Project | Web/field/api/urls.py | urls.py | py | 699 | python | en | code | 50 | github-code | 6 | [
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.c... |
72067319869 | import numpy as np
import cv2
def compute_perspective_transform(corner_points,width,height,image):
""" Compute the transformation matrix
@ corner_points : 4 corner points selected from the image
@ height, width : size of the image
"""
# Create an array out of the 4 corner points
corner_points_array = n... | basileroth75/covid-social-distancing-detection | src/bird_view_transfo_functions.py | bird_view_transfo_functions.py | py | 1,517 | python | en | code | 123 | github-code | 6 | [
{
"api_name": "numpy.float32",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.getPerspectiveTransform",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.warpPersp... |
40205551139 | # encoding: utf-8
"""
GraphicInterface.py
Displays the op amp calculator
Dario Marroquin 18269 (dariomarroquin)
Pablo Ruiz 18259 (PingMaster99)
Version 1.0
Updated March 4, 2020
"""
from tkinter import *
from CalculationsModule import *
import matplotlib.pyplot as plt
import nu... | PingMaster99/MNOpampCalculator | GraphicInterface.py | GraphicInterface.py | py | 4,699 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.clf",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "numpy.linspace",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyp... |
23660254288 | # -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
""" A Python logging library with super powers """
import sys
import textwrap
from os import getcwd, path as p
from argparse import RawTextHelpFormatter, ArgumentParser
from pickle import dump, load
from io import open
from functools import partial, lru_cache
from s... | reubano/chakula | chakula/main.py | main.py | py | 7,603 | python | en | code | null | github-code | 6 | [
{
"api_name": "redisworks.Root",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "os.path.basename",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "os.getcwd",
"line_number... |
28470996419 | import os
import sys
from lockdoors import main
from lockdoors import sanitize
from lockdoors import shrts
from pathlib import Path
from datetime import datetime
from time import sleep
#VAR
yes = set(['yes', 'y', 'ye', 'Y'])
no = set(['no', 'n', 'nop', 'N'])
cwd = os.getcwd()
null = ""
###Cheatsheets
def revsh():
s... | SofianeHamlaoui/Lockdoor-Framework | lockdoors/reverse.py | reverse.py | py | 7,496 | python | en | code | 1,248 | github-code | 6 | [
{
"api_name": "os.getcwd",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "lockdoors.shrts.clscprilo",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "lockdoors.shrts",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "os.system",
"... |
18230626408 | # Tim Marder
# SoftDev1 pd06
# K#13 -- Echo Echo Echo
# 2018-09-28
from flask import Flask, render_template, request
app = Flask(__name__) #create instance of class Flask
@app.route("/") #assign fxn to route
def hello_world():
return render_template("home.html")
@app.route("/auth", methods = ["GET", "POST"... | TimMarder/SoftDev-Office | 13_formation/app.py | app.py | py | 701 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.request",
"line_number": 16,
"usage_type": "argument"
},
{
"api_name": "flask.request.args... |
33390551810 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import gzip
from collections import defaultdict
import math
import scipy.optimize
import numpy
import string
import random
from sklearn import linear_model
import sklearn
# In[2]:
# This will suppress any warnings, comment out if you'd like to preserve them
import w... | vivianchen04/Master-Projects | WebMining&RecommenderSystems/midterm.py | midterm.py | py | 14,655 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 70,
"usage_type": "call"
},
{
"api_name"... |
9878964651 | #!/usr/bin/python
# disk monitor
import logging as l
l.basicConfig(filename='disk_log.txt',filemode='a',level=l.DEBUG,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
datefmt='%c')
# modes
# r -> read -> you can only read the file.
# a -> append -> you can only append the contents to the file... | tuxfux-hlp-notes/python-batches | batch-68/14-logging/third.py | third.py | py | 900 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "logging.info",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "logging.warning",
... |
71077185467 | import Gmail_API_Lib
import Track_API_Lib
import Slack_API_Lib
import importlib
import json
import csv
import lovely_logger as log
import datetime
import time
late_checkin_alert_hour = 21
unclean_property_alert_hour = 14
regular_check_interval_minutes = 15
check_checkin_interval_minutes = 15
reload = 1#dummy variable ... | mammalwithashell/scott-heyman-gcp-functions | Daily_Checks_v1.0.py | Daily_Checks_v1.0.py | py | 7,843 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "datetime.timedelta",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datet... |
70514119229 | from collections import defaultdict
from github import Github
def get_git_skills(username):
g = Github()
user = g.get_user(username)
tags = defaultdict()
languages = defaultdict(int)
for repo in user.get_repos():
# new_repo_languages = repo.get_languages()
# for lang in new_repo_... | HackRU/teamRU | src/matching/git_skill_finder.py | git_skill_finder.py | py | 593 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "github.Github",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 10,
"usage_type": "call"
}
] |
37122760097 | # Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
# useful for handling different item types with a single interface
from fanza.items import ImageItem
from fanza.common import download_image
from fan... | takiya562/Adult_video_scrapy | fanza/pipelines.py | pipelines.py | py | 2,876 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "scrapy.Spider",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "urllib.request.build_opener",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "urllib.request.ProxyHandler",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": ... |
12461550259 | from preprocess import *
import os
import argparse
from csv import writer
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Process pcap file and integer data.")
parser.add_argument("-pcap", nargs="+", help="The pcap file. Multiple pcaps can be added when separated by a space.")
pars... | mayakapoor/palm | src/preprocessing/main.py | main.py | py | 1,391 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_n... |
24502646621 | from utils import *
from fastapi import FastAPI, Query, Path, Body, Cookie, Header
from pydantic import BaseModel, Required, Field, HttpUrl
app = FastAPI()
@app.get('/')
def read_root():
return {'Hello': 'World'}
# Examplos com path params
class ModelName(str, Enum):
name1 = 'Phelipe'
name2 = 'Marcos... | williamelias/Fast-Api-Quiz | code/app/main.py | main.py | py | 5,446 | python | pt | code | 0 | github-code | 6 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 72,
"usage_type": "name"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 95,
"usage_type": "name"
},
{
"api_name": "fastapi.Query",
... |
34993256569 | import requests
from bs4 import BeautifulSoup
def extract_teok_jobs(keyword):
results = []
url = f"https://remoteok.com/remote-{keyword}-jobs"
request = requests.get(url, headers={"User-Agent": "Kimchi"})
if request.status_code == 200:
soup = BeautifulSoup(request.text, "html.parser")
... | hoseel/job-scrapper | extractors/teok.py | teok.py | py | 1,444 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 11,
"usage_type": "call"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.