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
7172035429
"""SMPP client module""" import socket import select import struct import logging import os.path import binascii from . import smpp from . import exceptions from . import consts import pymysql.cursors import codecs import re from time import localtime , strftime from datetime import datetime logger = logging.getLogg...
arashkhavari/iot_communication
smpplib/client.py
client.py
py
15,276
python
en
code
10
github-code
2
[ { "api_name": "logging.getLogger", "line_number": 19, "usage_type": "call" }, { "api_name": "socket.socket", "line_number": 56, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 56, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREA...
946043791
import json import click import pandas as pd import requests from gsan.clean_df import strip_chars def get_crtsh(domain, timeout=30): try: crt_req = requests.get(f"https://crt.sh/?dNSName={domain}&output=json", timeout=timeout).json() except requests.exceptions.ConnectionError: click.secho("...
franccesco/getaltname
gsan/crtsh.py
crtsh.py
py
712
python
en
code
353
github-code
2
[ { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.exceptions", "line_number": 13, "usage_type": "attribute" }, { "api_name": "click.secho", "line_number": 14, "usage_type": "call" }, { "api_name": "json.dumps", "l...
11738834980
# Post spørring og få Pandas dataframe i retur # benytter biblioteket pyjstat for JSON-stat import requests from pyjstat import pyjstat # Demo: Salmon export POST_URL = "https://data.ssb.no/api/v0/no/table/03024" def fetch_data(): # API spørring, kan tas fra Konsoll - fryst og fersk laks siste 53 uker payl...
BergensTidende/bord4-analysis-templates
templates/etl_ssb_api.py
etl_ssb_api.py
py
940
python
no
code
0
github-code
2
[ { "api_name": "requests.post", "line_number": 28, "usage_type": "call" }, { "api_name": "pyjstat.pyjstat.Dataset.read", "line_number": 30, "usage_type": "call" }, { "api_name": "pyjstat.pyjstat.Dataset", "line_number": 30, "usage_type": "attribute" }, { "api_name"...
15282092124
import datetime from datetime import date import numpy as np import pandas as pd import matplotlib.pyplot as plt from sympy.solvers import solve from sympy import Symbol from ytm import ytm, recent_future_coupons, accured_interest from test import dirty_price x = Symbol('x') import math dates = ['2020-01-15', '20...
vshah99/APM466-Assignment-1
spot.py
spot.py
py
3,417
python
en
code
0
github-code
2
[ { "api_name": "sympy.Symbol", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 27, "usage_type": "call" }, { "api_name": "datetime.date.fromisoformat"...
24274189156
import json from tencentcloud.common import credential from tencentcloud.common.profile.client_profile import ClientProfile from tencentcloud.common.profile.http_profile import HttpProfile from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException from tencentcloud.cls.v20201016 impo...
evansastre/devops_best_practice
Infrastructure-as-code/TencentCloud/Interactive_with_tencent_cloud_api_for_log_topic/CreateLogTopic.py
CreateLogTopic.py
py
2,376
python
en
code
1
github-code
2
[ { "api_name": "tencentcloud.common.credential.Credential", "line_number": 20, "usage_type": "call" }, { "api_name": "tencentcloud.common.credential", "line_number": 20, "usage_type": "name" }, { "api_name": "tencentcloud.common.profile.http_profile.HttpProfile", "line_number"...
72327697326
from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.common.by import By import time obj = webdriver.ChromeOptions() driver = webdriver.Chrome(options=obj) driver.get("https://the-internet.herokuapp...
debarati0206/PythonSeleniumPart1
Python Selenium Automation/PythonProjectSelenium/switch_to_frame.py
switch_to_frame.py
py
717
python
en
code
0
github-code
2
[ { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 7, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 7, "usage_type": "name" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 8, "usage_type": "call" }, { "api_na...
34030281067
# -*- coding: utf-8 -*- """ Created on Sun Sep 18 13:59:06 2022 @FileName: 2529.py @author: YUNJUSEOK @Link:https://www.acmicpc.net/problem/2529 """ #Memory Out def t1(): N = int( input() ); Mn =( ''.join( ['9']*( N + 1 ) ) ) Mx = '0'; lst = [ i for i in range( 10 ) ]; comp = list( input().spl...
AMIVAYUN/codeTestPrac
BaekJoon/2529.py
2529.py
py
1,494
python
en
code
0
github-code
2
[ { "api_name": "itertools.permutations", "line_number": 24, "usage_type": "call" } ]
19281621696
from torch.utils.data import Dataset import pandas as pd import torch import numpy as np from vedo import * from scipy.spatial import distance_matrix class Mesh_Dataset(Dataset): def __init__(self, data_list_path, num_classes=15, patch_size=7000): """ Args: h5_path (string): Path to the...
s-triar/tooth-segmentation-meshsegnet
Mesh_dataset.py
Mesh_dataset.py
py
6,017
python
en
code
8
github-code
2
[ { "api_name": "torch.utils.data.Dataset", "line_number": 8, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.is_tensor", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.zeros",...
25044104820
from datetime import time class myVar(): USER_ID = "" USER_PASSWORD = "" USER_MEMBER = 1 USER_REVDATE = None USER_FMTIME = 0 USER_TOTIME = 0 USER_COURSE = 0 USER_SITE = "소노펠리체 컨트리클럽" USER_BROWSER = None USER_URL = 'https://www.sonofelicecc.com/main.dp/dmparse.dm' # USER_URL...
soonki-kang/sono
myvar.py
myvar.py
py
836
python
en
code
0
github-code
2
[ { "api_name": "datetime.time", "line_number": 21, "usage_type": "call" } ]
8956333945
from __future__ import annotations from datetime import datetime, timezone, timedelta from enum import IntEnum, unique from typing import Optional from typing_extensions import Final hk_timezone: Final = timezone(timedelta(hours=8)) def time_equals( time: datetime, *, weekday: Optional[int] = None, hour: O...
StarvinSon/innolens
packages/simulator/innolens_simulator/utils/time.py
time.py
py
674
python
en
code
0
github-code
2
[ { "api_name": "typing_extensions.Final", "line_number": 9, "usage_type": "name" }, { "api_name": "datetime.timezone", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.da...
42564674681
#-*- coding: utf-8 -*- ''' Created on 15 oct. 2022 @author: robert ''' from django.contrib.auth.decorators import login_required import locale from django.http import HttpResponse import json from datetime import datetime , timedelta, date from pytz import timezone from django.core import serializers from reserva...
RobertPastor/music-rungis
reservation/views/ManagePeriods.py
ManagePeriods.py
py
6,287
python
en
code
0
github-code
2
[ { "api_name": "json.JSONEncoder", "line_number": 33, "usage_type": "attribute" }, { "api_name": "pytz.timezone", "line_number": 35, "usage_type": "call" }, { "api_name": "gettingstarted.settings.TIME_ZONE", "line_number": 35, "usage_type": "argument" }, { "api_nam...
70321920686
from typing import List class SolutionBinarySearch: def binarySearch(self, nums: List[int], value: int): start = 0 end = len(nums) - 1 count = 0 while(start <= end): middle = round((start + end) / 2) kick = nums[middle] if (kick == val...
vitormfrey/algorithms-leet-code
binary_search.py
binary_search.py
py
549
python
en
code
0
github-code
2
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" } ]
34047257741
import aiohttp import asyncio from aiohttp import web @staticmethod def sort_by_value(dct): n = {} data = [] for i,d in enumerate(dct): n[i] = float(d["price"]) last = dict(sorted(n.items(), key=lambda item: item[1])) for i in last: data.append(dct[i]) return data @staticmethod ...
oktayozkan0/book-price-comparison
price_comp/comparison/utils.py
utils.py
py
943
python
en
code
1
github-code
2
[ { "api_name": "aiohttp.ClientSession", "line_number": 26, "usage_type": "call" }, { "api_name": "asyncio.gather", "line_number": 28, "usage_type": "call" } ]
40566827821
import cv2 import numpy as np import matplotlib.pyplot as plt #1.a) def rotate_image(mat, angle): """ Rotates an image (angle in degrees) and expands image to avoid cropping """ height, width = mat.shape[:2] # image shape has 3 dimensions image_center = (width/2, height/2) # getRotationMatrix2D ne...
deepakyadav810/Signal-Image-Processing-Sem5
Assignment3/Assignment3.py
Assignment3.py
py
4,829
python
en
code
0
github-code
2
[ { "api_name": "cv2.getRotationMatrix2D", "line_number": 14, "usage_type": "call" }, { "api_name": "cv2.warpAffine", "line_number": 29, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 32, "usage_type": "call" }, { "api_name": "cv2.imshow", "l...
3305119984
# Import statements import os import requests import json import datetime import random from flask import Flask, render_template, session, redirect, request, url_for, flash from flask_script import Manager, Shell from flask_wtf import FlaskForm from flask import jsonify #for AJAX from wtforms import StringField, Submit...
vinhluong274/364final
SI364final.py
SI364final.py
py
25,896
python
en
code
0
github-code
2
[ { "api_name": "os.environ", "line_number": 23, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path", "line_number": 24, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "l...
1403548320
import sys input = sys.stdin.readline from collections import deque ANS = [] for i in range(int(input())): input() n, m = map(int, input().split()) L = [] for j in range(m): x, w = map(int, input().split()) L.append((w, x, j)) L.sort() L = L[:2 * n] L.sort(key=lambda x: x[1]) L = deque(L) an...
NahidAkhtar84/Compititive-Coding
codeforces_contest/contest_776/c_saku.py
c_saku.py
py
562
python
en
code
0
github-code
2
[ { "api_name": "sys.stdin", "line_number": 2, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 16, "usage_type": "call" } ]
38177292760
import re import string import requests from bs4 import BeautifulSoup def get_all_players(): """ Function to get all players that have ever played to euroleague. Returns a dictionary containing the player name and the player code. """ players = {} for char in list(string.ascii_uppercase): ...
sakisbl/euroleague-scraper
players.py
players.py
py
1,259
python
en
code
0
github-code
2
[ { "api_name": "string.ascii_uppercase", "line_number": 13, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 14, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 18, "usage_type": "call" }, { "api_name": "re.findall...
14317089598
from flask import Flask from flask import redirect, render_template, request, session from flask_sqlalchemy import SQLAlchemy from os import getenv from werkzeug.security import check_password_hash, generate_password_hash from exceptions import RecipeError app = Flask(__name__) app.secret_key =getenv("SECRET_KEY") f...
jullebli/tietokantasovellus-S2020
app.py
app.py
py
6,864
python
en
code
0
github-code
2
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 16, "usage_type": "call" }, { "api_name": "exceptions.RecipeError", ...
44772874259
from skimage.transform import (hough_line, hough_line_peaks) from estatistics import moda, NULL_ANGLE from Rotation import rotate from skimage.feature import canny import numpy as np def hough_method(image): minima_amostragem = 5 #minima amostragem de picos factor = 1 #fator de ajuste do valor dos picos ...
ZanezZephyrs/Alinhamento_automatico_de_documentos
cleaned_code/Hough_transform.py
Hough_transform.py
py
848
python
en
code
1
github-code
2
[ { "api_name": "skimage.feature.canny", "line_number": 12, "usage_type": "call" }, { "api_name": "skimage.transform.hough_line", "line_number": 13, "usage_type": "call" }, { "api_name": "skimage.transform.hough_line_peaks", "line_number": 19, "usage_type": "call" }, { ...
19042862679
from typing import List from test_cases import test_cases class Solution: # def mergeTwoSortedLists(self, nums1: List[int], nums2: List[int]) -> List[int]: # res = [] # # first_ind = sec_ind = 0 # while first_ind < len(nums1) and sec_ind < len(nums2): # if nums1[first_ind]...
Failjak/leetcode_problems
merge_two_sorted_lists.py
merge_two_sorted_lists.py
py
1,759
python
en
code
0
github-code
2
[ { "api_name": "typing.List", "line_number": 31, "usage_type": "name" }, { "api_name": "test_cases.test_cases", "line_number": 54, "usage_type": "call" } ]
8384614702
from typing import List from utilities import TreeNode, listToBinaryTree """ Given the root of a binary tree, return the level order traversal of its nodes' values. (i.e., from left to right, level by level). Example: 3 / \ 9 20 / \ 15 7 Returns: [[3],...
SravanthiMalepati/Codepath
order_level_traversal.py
order_level_traversal.py
py
2,903
python
en
code
0
github-code
2
[ { "api_name": "utilities.TreeNode", "line_number": 64, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 64, "usage_type": "name" }, { "api_name": "utilities.listToBinaryTree", "line_number": 90, "usage_type": "call" }, { "api_name": "utilities.l...
879041358
import sys, os, logging, csv, subprocess from threading import Timer,Thread,Event from logging.handlers import RotatingFileHandler from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText import smtplib """Script para detectar la rotura de un HDD del RAID HP, gestionado por hpaucli """ #Var...
elPansi/Varios
controlaRaid.py
controlaRaid.py
py
3,348
python
en
code
0
github-code
2
[ { "api_name": "logging.Formatter", "line_number": 18, "usage_type": "call" }, { "api_name": "logging.handlers.RotatingFileHandler", "line_number": 20, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 22, "usage_type": "attribute" }, { "api_name...
19229812383
import pygame import objects import logger class Input(object): ''' Generic Input Class ''' def __init__(self): self.events = [] def update(self, game_object): pass class FireBallInput(Input): ''' FireBall Input class ''' def __init__(self, direction): sel...
g-mips/CS-290-Video-Game
game_input.py
game_input.py
py
5,323
python
en
code
0
github-code
2
[ { "api_name": "pygame.K_RIGHT", "line_number": 80, "usage_type": "attribute" }, { "api_name": "pygame.K_LEFT", "line_number": 80, "usage_type": "attribute" }, { "api_name": "pygame.K_DOWN", "line_number": 80, "usage_type": "attribute" }, { "api_name": "pygame.K_SP...
44432874221
#!/usr/bin/env python # # tournament.py -- implementation of a Swiss-system tournament # import psycopg2 def connect(): """Connect to the PostgreSQL database. Returns a database connection.""" return psycopg2.connect("dbname=tournament") def deleteMatches(): """Remove all the match records from the da...
dinker1462/Tournament-Planner
tournament.py
tournament.py
py
2,296
python
en
code
0
github-code
2
[ { "api_name": "psycopg2.connect", "line_number": 11, "usage_type": "call" } ]
20140215897
import logging import torch.nn.functional from torch.nn import Dropout, Linear from torch.nn.modules import Module LOG = logging.getLogger(__name__) class FCNetwork(Module): """ A simple implementation of a multilayer fully-connected feed-forward neural network. Args: in_dim: The number of inpu...
graphaaai/graphaaai
fc_network/fc_network.py
fc_network.py
py
3,036
python
en
code
0
github-code
2
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.nn.modules.Module", "line_number": 11, "usage_type": "name" }, { "api_name": "torch.nn.Dropout", "line_number": 39, "usage_type": "call" }, { "api_name": "torch.nn.fu...
4595685145
# -*- coding: utf-8 -*- from __future__ import print_function, division try: import cPickle as pickle except: import pickle import numpy as np from keras.models import Sequential from keras.optimizers import RMSprop, Adam, Adagrad from keras.layers import Dense, Dropout, Activation, Embedding from keras.laye...
shaozhefeng/RNN-GC
models/custom_lstm.py
custom_lstm.py
py
1,614
python
en
code
9
github-code
2
[ { "api_name": "keras.models.Sequential", "line_number": 24, "usage_type": "call" }, { "api_name": "keras.layers.LSTM", "line_number": 26, "usage_type": "call" }, { "api_name": "keras.regularizers.l1", "line_number": 26, "usage_type": "call" }, { "api_name": "keras...
36816384006
from collections import Counter def check(num): count=0 for i in freq: count+=i[0]//num if count>=k: return True return False n,k=map(int,input().split()) l=list(map(int,input().split())) c=Counter(l) freq=[] for i in c: freq.append((c[i],i)) freq.sort(reverse=True) low=1 high=10**6 while (low<high): mid=(l...
Naman18055/CF-Solutions
1077D.py
1077D.py
py
611
python
en
code
0
github-code
2
[ { "api_name": "collections.Counter", "line_number": 13, "usage_type": "call" } ]
24814924801
from typing import Any, Optional from pytorch_lightning.utilities.types import STEP_OUTPUT import torch from vgg_loss import VGGFeatures, style_loss, content_loss from model_architecture import Encoder, TransConvBlock, Decoder, VGGEncoder from torch import optim import pytorch_lightning as L from torchmetrics.image.fi...
AntonioDOrazio/dlai-texture-synthesis
model.py
model.py
py
6,474
python
en
code
0
github-code
2
[ { "api_name": "torch.manual_seed", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.device", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.cuda", ...
20832864086
#!/usr/bin/python # -*- coding: utf-8 -*- from ansible.module_utils.basic import AnsibleModule DOCUMENTATION = r''' --- module: healthcheck author: Pupkin V. short_description: healthcheck of site description: - healthcheck of site with or without TLS version_added: 1.0.0 requirements: - requests - python >= 3...
GlebovSemjon/tensor-school-devops
ansible/4.hometasks/custom_modules_hw/library/healthcheck_py.py
healthcheck_py.py
py
3,225
python
en
code
0
github-code
2
[ { "api_name": "requests.get", "line_number": 74, "usage_type": "call" }, { "api_name": "requests.exceptions", "line_number": 80, "usage_type": "attribute" }, { "api_name": "requests.exceptions", "line_number": 84, "usage_type": "attribute" }, { "api_name": "reques...
73738421486
import json, os, glob, random from pprint import pprint as pp NAME = "Just Buddha Beyond" DESC = 'What is the future world? Will religion influent people mind and living expectation. What will be beyond Buddha or Buddha beyond everthing. "Our NFT will be last for worship forever, Rafael" No Art, No Road, No Utilities...
diewland/special-eureka
020_just_buddha_beyond_revealed.py
020_just_buddha_beyond_revealed.py
py
1,527
python
en
code
0
github-code
2
[ { "api_name": "os.path.basename", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.path.basename", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_nu...
31990357320
from rest_framework import serializers from .models import AwardedMarks, SubtractMarks, Disciplinetype, StudentScore, Voice class AwardedMarksSerializer(serializers.ModelSerializer): class Meta: model=AwardedMarks fields='__all__' class SubtractMarksSerializer(serializers.ModelSerializer): #...
hgh-q/oa_system_master
studentScore/serializers.py
serializers.py
py
1,595
python
en
code
0
github-code
2
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 5, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 5, "usage_type": "name" }, { "api_name": "models.AwardedMarks", "line_number": 7, "usage_type": "name" }...
13730669507
import os import base64 from io import BytesIO from datetime import datetime from app import app import urllib.request from flask import Flask, flash, request, redirect, url_for, render_template from werkzeug.utils import secure_filename from PIL import Image import RPi.GPIO as GPIO import time from implementasi impo...
nailafadhilah/identification-of-dna-bands-from-electrophoresis-image-python-opencv
main.py
main.py
py
5,667
python
en
code
0
github-code
2
[ { "api_name": "RPi.GPIO.setmode", "line_number": 15, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_number": 15, "usage_type": "name" }, { "api_name": "RPi.GPIO.BOARD", "line_number": 15, "usage_type": "attribute" }, { "api_name": "RPi.GPIO.LOW", "lin...
24722410500
#------------------------------------------------------------------------------------------- # This script contains useful functions to compute the binned event distribution at JUNO #------------------------------------------------------------------------------------------- import numpy as np import scipy as sp impor...
Harvard-Neutrino/HeavenlyMCP
Scripts/JUNO_distribution.py
JUNO_distribution.py
py
2,835
python
en
code
6
github-code
2
[ { "api_name": "os.getcwd", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.genfromtxt", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.unique", "line_numb...
70476086448
import requests from bs4 import BeautifulSoup as BS import time from datetime import datetime, timedelta from tqdm import tqdm urls_data = [] result_data = [] main_url = "https://www.list.am" headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)' ' AppleWebKit/537.36 (KHTML, like G...
Frogleim/listam_telegram
get_data.py
get_data.py
py
2,521
python
en
code
0
github-code
2
[ { "api_name": "requests.get", "line_number": 21, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 22, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 33, "usage_type": "call" }, { "api_name": "datetime.da...
23830745434
import torch from torch.utils.data import Dataset, DataLoader, random_split import torchvision from torchvision.transforms import Compose, Resize, ToTensor, Normalize class DataInference(Dataset): def __init__(self, x: torch.Tensor, y: torch.Tensor, n_subnets: int): super(DataInference, self).__init__() ...
MilanKalkenings/small_machine_learning_projects
src/mimo_classification/data_handling.py
data_handling.py
py
2,525
python
en
code
0
github-code
2
[ { "api_name": "torch.utils.data.Dataset", "line_number": 7, "usage_type": "name" }, { "api_name": "torch.Tensor", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.repeat_interleave", "line_number": 10, "usage_type": "call" }, { "api_name": "torc...
5865962480
# coding:utf-8 import requests import random import os import re from multiprocessing.dummy import Pool # from fake_useragent import UserAgent from lxml import etree class LiVideoSpider: '''梨视频爬虫类''' def __init__(self): self.st_url = 'https://www.pearvideo.com/category_4' # 首页url self.p = P...
13779962543/PythonStudy
爬虫/高性能异步爬虫/3.线程池在爬虫案例中的应用.py
3.线程池在爬虫案例中的应用.py
py
2,996
python
en
code
1
github-code
27
[ { "api_name": "multiprocessing.dummy.Pool", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_number": 28, "usage_type": "attribute" }, { "api_name": "os.mkdir", ...
74444244526
from typing import Any, Dict, Optional from unittest.mock import Mock, patch from pygments.formatters import TerminalFormatter from pygments.lexers import PythonLexer from termcolor import colored from qwikstart.operations import echo from .. import helpers class TestEchoOperation: def test_string(self) -> Non...
tonysyu/qwikstart
tests/operations/test_echo.py
test_echo.py
py
2,828
python
en
code
0
github-code
2
[ { "api_name": "termcolor.colored", "line_number": 26, "usage_type": "call" }, { "api_name": "unittest.mock.Mock", "line_number": 29, "usage_type": "name" }, { "api_name": "pygments.lexers.PythonLexer", "line_number": 35, "usage_type": "argument" }, { "api_name": "...
24745272635
import oedge_plots import matplotlib.pyplot as plt import numpy as np from scipy.signal import savgol_filter plt.rcParams["font.family"] = "Century Gothic" plt.rc('axes', unicode_minus=False) # Some constants. #ring = 40 mz_amu = 183.84 md_amu = 2.01 mz = mz_amu * 1.66e-27 # Mass of W in kg md = md_amu * 1.66e-27 ...
shawnzamperini/d3dscripts
2021/03/nf_forces.py
nf_forces.py
py
2,020
python
en
code
0
github-code
2
[ { "api_name": "matplotlib.pyplot.rcParams", "line_number": 6, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 6, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.rc", "line_number": 7, "usage_type": "call" }, { "api_name": "m...
28939752146
import pygame import sys import os img_path = os.path.join('Wall.png') img_path = os.path.join('Blue.png') img_path = os.path.join('Yellow.png') class WallObj(object): def __init__(self): pygame.sprite.Sprite.__init__(self) WallObj.image = pygame.image.load('Wall.png') self.image = pyga...
code-in-the-schools/Pong_Benjamin-King
main.py
main.py
py
2,758
python
en
code
0
github-code
2
[ { "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.join", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, ...
25618583825
""" Visualizing the results of a classification model in streamlit. """ import numpy as np import pandas as pd import altair as alt import streamlit as st from sklearn.datasets import ( load_iris, load_wine, fetch_covtype ) from sklearn.model_selection import train_test_split from sklearn.ensemble import (...
PacktPublishing/Artificial-Intelligence-with-Python-Cookbook
chapter11/visualizing_model_results.py
visualizing_model_results.py
py
4,374
python
en
code
64
github-code
2
[ { "api_name": "sklearn.datasets.load_iris", "line_number": 25, "usage_type": "name" }, { "api_name": "sklearn.datasets.load_wine", "line_number": 26, "usage_type": "name" }, { "api_name": "sklearn.datasets.fetch_covtype", "line_number": 27, "usage_type": "name" }, { ...
11168369278
import torch def build_optimizer(cfg, net): params = [] cfg_cp = cfg.optimizer.copy() cfg_type = cfg_cp.pop('type') if cfg_type not in dir(torch.optim): raise ValueError("{} is not defined.".format(cfg_type)) _optim = getattr(torch.optim, cfg_type) return _optim(net.parameters(), **c...
Turoad/lanedet
lanedet/engine/optimizer.py
optimizer.py
py
327
python
en
code
489
github-code
2
[ { "api_name": "torch.optim", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.optim", "line_number": 12, "usage_type": "attribute" } ]
36878638678
import random import time import numpy as np import numdifftools as nd from typing import Tuple, List from numpy.linalg import LinAlgError def timed(method): def _timed(*args, **kwargs): start = time.time() result = method(*args, **kwargs) end = time.time() return result, end - ...
BartlomiejRasztabiga/WSI
1/minimizer.py
minimizer.py
py
4,163
python
en
code
1
github-code
2
[ { "api_name": "time.time", "line_number": 14, "usage_type": "call" }, { "api_name": "time.time", "line_number": 16, "usage_type": "call" }, { "api_name": "random.uniform", "line_number": 23, "usage_type": "call" }, { "api_name": "numdifftools.Gradient", "line_...
73139850605
from django.conf.urls import url from django.urls import path from miapp import views urlpatterns = [ path('', views.miindex, name="pag_principal" ), path('carga_csv', views.cargar_csv), path('csv', views.descargue_csv), path('hora', views.mi_vista_cacheada), path('autenticado', views.mi_vista_auto...
luisza/taller2020
src/miapp/urls.py
urls.py
py
500
python
es
code
0
github-code
2
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "miapp.views.miindex", "line_number": 6, "usage_type": "attribute" }, { "api_name": "miapp.views", "line_number": 6, "usage_type": "name" }, { "api_name": "django.urls.path",...
7716486299
from aiogram import types, Dispatcher from loguru import logger from common_obj import bot from keyboards import kb_action_bill_del from aiogram.dispatcher import FSMContext from aiogram.dispatcher.filters.state import State, StatesGroup from database.Postgres import Postgres from processes import common_handlers from...
orion951/financial_bot
processes/Category/delete_category.py
delete_category.py
py
1,969
python
en
code
0
github-code
27
[ { "api_name": "aiogram.dispatcher.filters.state.StatesGroup", "line_number": 13, "usage_type": "name" }, { "api_name": "aiogram.dispatcher.filters.state.State", "line_number": 14, "usage_type": "call" }, { "api_name": "aiogram.dispatcher.filters.state.State", "line_number": 1...
2512567977
from setuptools import setup, find_packages from os import path __version__ = "1.1.18" __author__ = "Hapsida @securisec" def read_requirements(): with open("requirements.txt") as f: return f.read().splitlines() this_directory = path.abspath(path.dirname(__file__)) with open(path.join(this_directory, "R...
securisec/saramPy
setup.py
setup.py
py
771
python
en
code
2
github-code
2
[ { "api_name": "os.path.abspath", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.join", "line_numb...
33049028429
from typing import Literal, Optional from fastapi import HTTPException, status from sqlalchemy import UnaryExpression, and_, or_, select from ..models.response import ( Classification, CtfImageNumberList, FullMovie, TomogramResponse, ) from ..models.table import ( CTF, CryoemInitialModel, ...
DiamondLightSource/pato-backend
src/pato/crud/autoproc.py
autoproc.py
py
4,611
python
en
code
0
github-code
2
[ { "api_name": "utils.database.db.session.execute", "line_number": 31, "usage_type": "call" }, { "api_name": "utils.database.db.session", "line_number": 31, "usage_type": "attribute" }, { "api_name": "utils.database.db", "line_number": 31, "usage_type": "name" }, { ...
39616991518
from __future__ import print_function, division from torch.autograd import Variable from spectral import SpectralNorm import torch import torch.nn as nn import torch.optim as optim from torch.optim import lr_scheduler import numpy as np import torchvision from torchvision import datasets, models, transforms import time...
wqynew/Enhanced-NeoNav
eva_checkpointd1.py
eva_checkpointd1.py
py
12,638
python
en
code
8
github-code
2
[ { "api_name": "torch.autograd.Variable", "line_number": 31, "usage_type": "name" }, { "api_name": "torch.autograd", "line_number": 31, "usage_type": "name" }, { "api_name": "torch.nn.Module", "line_number": 34, "usage_type": "attribute" }, { "api_name": "torch.nn"...
73327301165
# Python program to find current weather details of any city using openweathermap api import requests # Enter your API key here api_key = "Your_API_Key" # base_url variable to store url base_url = "http://api.openweathermap.org/data/2.5/weather?" # Give city name city_name = input("Enter city name : ") ...
Python-World/python-mini-projects
projects/Fetch_current_weather/fetch_current_weather.py
fetch_current_weather.py
py
1,076
python
en
code
13,393
github-code
2
[ { "api_name": "requests.get", "line_number": 14, "usage_type": "call" } ]
42315096400
import numpy as np from numpy.typing import ArrayLike from scipy import signal from scipy.fft import fft # Frequency-domain features FREQ_FEATURES = { "f1sc": lambda x, freqs: x[np.where(np.logical_and(freqs > 0.1, freqs < 0.2))].mean(), "f2sc": lambda x, freqs: x[np.where(np.logical_and(freqs > 0.2, freqs < 0...
obss/BIOBSS
biobss/edatools/eda_freqdomain.py
eda_freqdomain.py
py
1,813
python
en
code
66
github-code
2
[ { "api_name": "numpy.where", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.logical_and", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.logical_and", "line_...
3051399105
import argparse import numpy as np from tqdm import tqdm, trange from word2vec import load_model as load_word2vec from file_io import parse, read_file from preprocess import get_token_mapping, tokenize from evaluate import get_scores, write_predictions def one_hot_encode(n, depth): a = np.zeros([depth]) a[n] ...
kohjingyu/hidden-markov-model
part5/mlp.py
mlp.py
py
9,232
python
en
code
4
github-code
2
[ { "api_name": "numpy.zeros", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 17, "usage_type": "call" }, { "api_name": "preprocess.tokenize", "line_numbe...
5572647327
import requests import json import pprint import time import random # response = requests.get('https://opentdb.com/api.php?amount=15&category=9&difficulty=easy', headers = {'Authorization': 'Token token="855df50978dc9afd6bf86579913c9f8b"'}) # results = response.json() user_input = input('Would you like to play a triv...
PdxCodeGuild/class_swordfish
code/jose/Python_Labs/minicapstone.py
minicapstone.py
py
4,036
python
en
code
2
github-code
2
[ { "api_name": "time.sleep", "line_number": 15, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 17, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 19, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 21, ...
5442362644
import torch from torch.autograd import Variable import torch.nn as nn from torch.nn import functional as F from .networks import compute_same_padding2d, _pair, _triple class AdapCNN(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, stride=1, dilation=1, groups=1, bias=True, padding=1):...
liulingbo918/PANet_for_WildSketch
models/acnn.py
acnn.py
py
4,813
python
en
code
3
github-code
2
[ { "api_name": "torch.nn.Module", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 7, "usage_type": "name" }, { "api_name": "torch.nn.functional.conv3d", "line_number": 33, "usage_type": "call" }, { "api_name": "torch.nn.funct...
21844578555
# -*- coding: utf-8 -*- """ @author: Oluwayelu Ifeoluwa Leetcode 102: Binary Tree Level Order Traversal """ from collections import deque from data_structures.BinaryTree import TreeNode def levelTraversl(root): res = [] q = deque([root]) while q: level = [] for _ in ran...
Oluwayelu/Blind-75
Blind 64.py
Blind 64.py
py
682
python
en
code
0
github-code
2
[ { "api_name": "collections.deque", "line_number": 13, "usage_type": "call" }, { "api_name": "data_structures.BinaryTree.TreeNode", "line_number": 30, "usage_type": "call" } ]
69937931271
from django.http import HttpResponse import json class JsonHttpResponseBuilder(object): """ HttpReponse builder for JSON output """ def __init__(self, status, message, extras=None): if not extras: extras = dict() self.status = status self.message = message self.ext...
karllindmark/IsYourProjectUpToDate
backend/JsonHttpResponseBuilder.py
JsonHttpResponseBuilder.py
py
637
python
en
code
0
github-code
27
[ { "api_name": "django.http.HttpResponse", "line_number": 22, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 22, "usage_type": "call" } ]
38465924288
import json def filter_reviews(): """ Filters reviews, which will be read from models/stars_from_metadata.py. """ with open("yelp_dataset_challenge_round9/yelp_academic_dataset_review.json", "rb") as f: filtered_reviews = [] for i, line in enumerate(f): review = json.loads(line) filtered_re...
gnedivad/yelp
data/script.py
script.py
py
613
python
en
code
1
github-code
2
[ { "api_name": "json.loads", "line_number": 10, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 18, "usage_type": "call" } ]
15757086858
from sklearn.metrics import confusion_matrix, f1_score, precision_score, recall_score import tensorflow as tf import numpy as np # prec = tf.keras.metrics.Precison # rec = tf.keras.metrics.Recall def calc_confusion_matrix(y_true , y_pred): Ypred = np.argmax(y_pred, axis=1) Ytrue = np.argmax(y_true, axis=1) ...
fariba87/Docker-Django-Genre-Classification
FinalProject/MLcode/modules/evaluation.py
evaluation.py
py
754
python
en
code
0
github-code
2
[ { "api_name": "numpy.argmax", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.argmax", "line_number": 8, "usage_type": "call" }, { "api_name": "sklearn.metrics.confusion_matrix", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.argmax"...
35276544624
#!/usr/bin/python3 # Library containing useful functions for the generation of Truncated Pluri-Gaussian Simulations (TPG) import numpy as np from numpy.linalg import inv, norm, lstsq from scipy.spatial.distance import squareform, pdist from scipy.linalg import solve from scipy.special import erf from scipy.optimize i...
lamd91/plurigaussian
tpg.py
tpg.py
py
39,654
python
en
code
0
github-code
2
[ { "api_name": "numpy.hstack", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.newaxis", "line_number": 36, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.hstack", "line_...
6314119012
import statistics import common.constants as const from random import random from random import seed try: from matplotlib import pyplot except ModuleNotFoundError: print('matplotlib was not fund. \nPlease, run: \n\t\'pip install matplotlib\' or \'pip3 install matplotlib\' \nto install the library') exit(1) ...
elimarmacena/pso_minimizer
src/common/utils.py
utils.py
py
4,148
python
en
code
0
github-code
2
[ { "api_name": "random.seed", "line_number": 11, "usage_type": "call" }, { "api_name": "common.constants.USED_SEED", "line_number": 11, "usage_type": "attribute" }, { "api_name": "common.constants", "line_number": 11, "usage_type": "name" }, { "api_name": "random.r...
18626289363
import cv2 import qrcode cap = cv2.VideoCapture(0)#Abrir la web cam de mi computadora detector = cv2.QRCodeDetector() while True: success, img = cap.read() data, _ , _ =detector.detectAndDecode(img) #Si se encuntra algun dato en el código Qr mostrarlo if data != '': print (data) cv2.imshow(...
AlejandroRubioB/Qr
Leer Qr.py
Leer Qr.py
py
423
python
es
code
0
github-code
2
[ { "api_name": "cv2.VideoCapture", "line_number": 3, "usage_type": "call" }, { "api_name": "cv2.QRCodeDetector", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_...
71947599113
import os import logging class Config(object): _current_dir_path = os.path.dirname(os.path.realpath(__file__)) resources_path = '{}/resources'.format(_current_dir_path) books_path = '{}/books'.format(resources_path) logging_level = logging.INFO logging.basicConfig(format='%(asctime)s - %(name)s ...
THidja/daar_back
engine/__init__.py
__init__.py
py
449
python
en
code
0
github-code
27
[ { "api_name": "os.path.dirname", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.INFO", "line_n...
36057723491
from beir import util, LoggingHandler from beir.datasets.data_loader import GenericDataLoader from sentence_transformers import SentenceTransformer from torch.utils.data import DataLoader from sprint.train.dataloaders import MSMARCODataset from sprint.train import models, losses from datetime import datetime import l...
thakur-nandan/sprint
examples/train/splade/train_distilmax_1000bm25_negs.py
train_distilmax_1000bm25_negs.py
py
6,168
python
en
code
35
github-code
2
[ { "api_name": "logging.basicConfig", "line_number": 19, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 21, "usage_type": "attribute" }, { "api_name": "beir.LoggingHandler", "line_number": 22, "usage_type": "call" }, { "api_name": "argparse.Ar...
4447756757
from netCDF4 import Dataset import numpy as np import argparse #----------------------------------------------------------------------- def error_analysis_stress_divergence(testName, ignoreWeak=False): # taylor series terms: # 0: f(x0,y0) # 1: df/dx(x0,y0) \Delta x # 2: df/dy(x0,y0) \Delta y # 3:...
MPAS-Dev/MPAS-Seaice_standalone_framework
testcases/square/operators_stress_divergence/error_analysis_stress_divergence.py
error_analysis_stress_divergence.py
py
9,520
python
en
code
0
github-code
2
[ { "api_name": "netCDF4.Dataset", "line_number": 43, "usage_type": "call" }, { "api_name": "netCDF4.Dataset", "line_number": 99, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 110, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_...
31304687079
from pathlib import Path import os from PyQt5 import QtWidgets, QtCore, QtGui from PyQt5.QtWidgets import QWidget, QFileDialog, QMainWindow from PyQt5.QtCore import QPropertyAnimation, QRect, pyqtProperty, Qt, QEasingCurve, QUrl from Design.CustomWidgets.newToast import QToaster from Design.CustomWidgets.styleSheets....
newprev/PrevCliente
Design/CustomWidgets/newPopupCNIS.py
newPopupCNIS.py
py
4,807
python
en
code
0
github-code
2
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 16, "usage_type": "name" }, { "api_name": "Design.pyUi.wdgEnviaCNIS.Ui_wdgEnviaCNIS", "line_number": 16, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 18, "usage_type": "name" ...
23889659272
from django.test import TestCase, tag from django.urls import reverse from .models import Album, Artist, Contact, Booking @tag('home') class IndexPageTestCase(TestCase): @tag('200') def test_index_page(self): response = self.client.get(reverse('store:home')) self.assertEqual(response.status_co...
BabouZ17/disquaire
store/tests.py
tests.py
py
2,598
python
en
code
0
github-code
27
[ { "api_name": "django.test.TestCase", "line_number": 7, "usage_type": "name" }, { "api_name": "django.urls.reverse", "line_number": 10, "usage_type": "call" }, { "api_name": "django.test.tag", "line_number": 8, "usage_type": "call" }, { "api_name": "django.test.ta...
18378728582
from asyncore import write from dataclasses import field from datetime import timedelta from management.schedule_management.models import * from rest_framework import serializers class AppointmentTypeSerializer(serializers.ModelSerializer): class Meta: model = AppointmentType fields = '__all__' ...
shehrozkapoor/firstcare
firstcare-backend/management/schedule_management/api/serializers.py
serializers.py
py
1,952
python
en
code
1
github-code
2
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 8, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 8, "usage_type": "name" }, { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 16, ...
10168491241
import json while True: status = True number_plate = "" number_plates = {} with open('plate_info.json', 'r') as file, open('mokytoju_numeriai.json', 'r') as plate_file: json_mokytoju = json.load(plate_file) json_file = json.load(file) for i in json_file['results']: ...
Benas137/ALPR
ALPR_Project/inspecting.py
inspecting.py
py
718
python
en
code
0
github-code
27
[ { "api_name": "json.load", "line_number": 9, "usage_type": "call" }, { "api_name": "json.load", "line_number": 10, "usage_type": "call" } ]
6121187179
from itertools import permutations from Extra_File import get_primes_up_to numbers = list(permutations(list('0123456789'), 10)) numbers = list(map(lambda x: ''.join(x), numbers)) primes = list(get_primes_up_to(18)) primes.sort() total = 0 for num in numbers: check = True for i in range(1, len(num)-2): ...
LeeClayberg/Project-Euler
Problem_043.py
Problem_043.py
py
457
python
en
code
0
github-code
27
[ { "api_name": "itertools.permutations", "line_number": 4, "usage_type": "call" }, { "api_name": "Extra_File.get_primes_up_to", "line_number": 6, "usage_type": "call" } ]
20388570397
""" Developed by Projeto Continentais and Petrobras author: Rudi César Comiotto Modena email: rmodena@unisinos.br date: July, 2020 """ from continentalfuzzy.domain.definition.ControllerType import ControllerType from continentalfuzzy.service.MamdaniControllerService import MamdaniControllerService from continentalfuzzy...
rccmodena/ContinentalFuzzyPython
continentalfuzzy/applicationservice/FuzzyControlApplicationService.py
FuzzyControlApplicationService.py
py
7,716
python
en
code
0
github-code
27
[ { "api_name": "psutil.cpu_count", "line_number": 24, "usage_type": "call" }, { "api_name": "continentalfuzzy.dto.FuzzyControlCommandInput.FuzzyControlCommandInput", "line_number": 43, "usage_type": "name" }, { "api_name": "continentalfuzzy.dto.FuzzyControlCommandOutput.FuzzyContr...
23920408339
import ctypes import subprocess as sp import sys from ctypes import wintypes from datetime import datetime from hashlib import sha1 from os import path, remove from re import search from tkinter.filedialog import askopenfilename from psutil import process_iter, NoSuchProcess, AccessDenied from src.datas import * from...
GuillaumeMCK/PyPass-SAB
src/patcher.py
patcher.py
py
15,642
python
en
code
31
github-code
2
[ { "api_name": "ctypes.c_char", "line_number": 21, "usage_type": "attribute" }, { "api_name": "ctypes.wintypes.DWORD", "line_number": 22, "usage_type": "attribute" }, { "api_name": "ctypes.wintypes", "line_number": 22, "usage_type": "name" }, { "api_name": "ctypes....
18858215947
import bubblebuster.input as inp from bubblebuster.sound import SoundMan, SoundNames from bubblebuster.font import FontMan, FontNames import bubblebuster.scene.scene as sc import bubblebuster.player as pl import pygame class LMouseClickRectObserver(inp.InputObserver): # this is just for weapon carousels for now ...
abergie5b/BubbleBuster
bubblebuster/input/lmouseclickrectobserver.py
lmouseclickrectobserver.py
py
2,034
python
en
code
0
github-code
27
[ { "api_name": "bubblebuster.input.InputObserver", "line_number": 9, "usage_type": "attribute" }, { "api_name": "bubblebuster.input", "line_number": 9, "usage_type": "name" }, { "api_name": "pygame.Rect", "line_number": 14, "usage_type": "call" }, { "api_name": "bu...
24748516854
import pickle import random from time import time from typing import Union import numpy as np import torch from torch import nn, optim from torch.nn import functional as F from torch.nn.functional import mse_loss, l1_loss, binary_cross_entropy, cross_entropy from torch.optim import Optimizer class NBeatsNet(nn.Modul...
philipperemy/n-beats
nbeats_pytorch/model.py
model.py
py
12,802
python
en
code
773
github-code
2
[ { "api_name": "torch.nn.Module", "line_number": 14, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 14, "usage_type": "name" }, { "api_name": "torch.device", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.nn.ParameterList", ...
824870202
"""blockchain URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class...
picocn/blockchain
blockchain/urls.py
urls.py
py
1,963
python
en
code
0
github-code
27
[ { "api_name": "django.conf.urls.url", "line_number": 21, "usage_type": "call" }, { "api_name": "af.views.index", "line_number": 21, "usage_type": "attribute" }, { "api_name": "af.views", "line_number": 21, "usage_type": "name" }, { "api_name": "django.conf.urls.ur...
73310599752
import numpy as np from scipy.linalg import solve_toeplitz, solve from scipy.signal import fftconvolve from scipy.interpolate import Rbf from scorr import xcorr, xcorr_grouped_df, xcorrshift, fftcrop, corr_mat # Helpers # ===================================================================== def integrate(x...
felixpatzelt/priceprop
priceprop/propagator.py
propagator.py
py
10,872
python
en
code
20
github-code
27
[ { "api_name": "numpy.concatenate", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.cumsum", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.log", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.arange", "line_num...
9839399142
""" Support for MQTT lights. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/light.mqtt/ """ import logging import voluptuous as vol import homeassistant.components.mqtt as mqtt from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_RGB_...
NAStools/homeassistant
homeassistant/components/light/mqtt.py
mqtt.py
py
11,231
python
en
code
14
github-code
27
[ { "api_name": "logging.getLogger", "line_number": 23, "usage_type": "call" }, { "api_name": "homeassistant.components.mqtt.MQTT_RW_PLATFORM_SCHEMA.extend", "line_number": 45, "usage_type": "call" }, { "api_name": "homeassistant.components.mqtt.MQTT_RW_PLATFORM_SCHEMA", "line_...
31163516038
#!/usr/bin/env python """Django's command-line utility for administrative tasks.""" import os import sys PROJECT_ROOT = os.path.dirname(os.path.abspath(os.path.dirname(__file__))) sys.path.insert(0, PROJECT_ROOT) def main(): os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tests.settings') from django.core.m...
Borderless360/django-logic
tests/manage.py
manage.py
py
443
python
en
code
51
github-code
27
[ { "api_name": "os.path.dirname", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.path.insert", "line...
10353840209
from fastapi import FastAPI from todo_list.routers import auth, user from todo_list import database from fastapi.middleware.cors import CORSMiddleware app = FastAPI() origins = [ "http://localhost:8080", ] app.add_middleware( CORSMiddleware, allow_origins=origins, allow_credentials=True, allow_me...
barbieri97/todo_app_fullstack
backend/main.py
main.py
py
561
python
en
code
0
github-code
27
[ { "api_name": "fastapi.FastAPI", "line_number": 6, "usage_type": "call" }, { "api_name": "fastapi.middleware.cors.CORSMiddleware", "line_number": 13, "usage_type": "argument" }, { "api_name": "todo_list.routers.auth.router", "line_number": 21, "usage_type": "attribute" ...
14985605861
import os from pathlib import Path import shutil PARTICIPANTS = ["kairat", "mj", "doohoon", "hyun", "hyunjin", "dongchang", "beoms"] def touch(cur, top, participants): assert top in ('bitcoin', 'cookbook') dname = f'{top}/' for p in participants: path = f'{dname}/{p}' os.makedirs(path, e...
leedc0101/programming-bitcoin
manage.py
manage.py
py
1,293
python
en
code
0
github-code
27
[ { "api_name": "os.makedirs", "line_number": 14, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 15, "usage_type": "call" } ]
41900677775
import numpy as np import math from math import exp import constants as const from mpl_toolkits.mplot3d import axes3d import matplotlib.pyplot as plt from matplotlib import cm import numpy.linalg as lng def get_error(s, a=0, b=0, c=0, d=0): error = [si - a - b * ti - c * ti ** 2 - d * ti ** 3 for si in s for ti i...
terentyevkirill/intelligent-data-analysis
lab8/row_model.py
row_model.py
py
11,402
python
en
code
0
github-code
2
[ { "api_name": "constants.arange", "line_number": 12, "usage_type": "attribute" }, { "api_name": "numpy.power", "line_number": 15, "usage_type": "call" }, { "api_name": "constants.arange", "line_number": 19, "usage_type": "attribute" }, { "api_name": "numpy.power",...
16267003262
import logging import os import socket import subprocess import traceback import time from shlex import split from urwid import Text, raw_display, Pile, ListBox, SimpleListWalker from ucm.Widgets import ListView, ListItem from ucm.Registry import Registry from ucm.UserConfig import UserConfig from ucm.Dialogs import D...
rszabo50/ucm
src/ucm/SwarmListView.py
SwarmListView.py
py
6,038
python
en
code
1
github-code
2
[ { "api_name": "socket.getfqdn", "line_number": 21, "usage_type": "call" }, { "api_name": "socket.gethostname", "line_number": 24, "usage_type": "call" }, { "api_name": "socket.getaddrinfo", "line_number": 25, "usage_type": "call" }, { "api_name": "socket.getaddrin...
14296301616
import os import time import argparse import tensorflow as tf from prepare_data import build_dataset from config import NAME2OPTIMIZER, NAME2MODEL from utils import create_embedding_matrix, scheduler, plot_history def train(args): if not os.path.exists(args['work_dir']): os.mkdir(args['work_dir']) ...
tiennvcs/GIST_coding_interview
train.py
train.py
py
4,447
python
en
code
0
github-code
27
[ { "api_name": "os.path.exists", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number": 13, "usage_type": "call" }, { "api_name": "prepare_data.build_dataset", ...
23371105285
from api.filters import IngredientFilter, RecipeFilter from api.serializers import (CustomUserCreateSerializer, CustomUserSerializer, Favorite_Shopping_cartSerializer, IngredientSerializer, RecipeListSerializer, RecipeSerializer,...
comdastim/foodgram-project-react
backend/api/views.py
views.py
py
6,862
python
en
code
0
github-code
27
[ { "api_name": "djoser.views.UserViewSet", "line_number": 20, "usage_type": "name" }, { "api_name": "users.models.User.objects.all", "line_number": 21, "usage_type": "call" }, { "api_name": "users.models.User.objects", "line_number": 21, "usage_type": "attribute" }, { ...
6095699427
from threading import Thread import paho.mqtt.client as mqtt from tenacity import retry class Lamp: @retry() def __init__(self, room): self.room = room self.client = mqtt.Client(client_id=f"Lamp_{room.roomName}") thread = Thread(target=self.initialize_mqtt) thread.start() ...
Martina99188/SE4AS
ManagedResource/Lamp.py
Lamp.py
py
1,227
python
en
code
0
github-code
27
[ { "api_name": "paho.mqtt.client.Client", "line_number": 10, "usage_type": "call" }, { "api_name": "paho.mqtt.client", "line_number": 10, "usage_type": "name" }, { "api_name": "threading.Thread", "line_number": 11, "usage_type": "call" }, { "api_name": "tenacity.re...
16730961440
from flask import Flask, json, request, render_template import os import pymysql app = Flask(__name__) username = os.environ.get('CLOUD_SQL_USERNAME') password = os.environ.get('CLOUD_SQL_PASSWORD') name = os.environ.get('CLOUD_SQL_DATABASE_NAME') conn_name = os.environ.get('CLOUD_SQL_CONNECTION_NAME') def open_conn...
yogaprasetia/capstone-predix
web-api/main.py
main.py
py
1,698
python
en
code
0
github-code
27
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 7, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_nu...
42578385860
"""websocket-client bassd Socket Mode client * https://api.slack.com/apis/connections/socket * https://slack.dev/python-slack-sdk/socket-mode/ * https://pypi.org/project/websocket-client/ """ import logging from concurrent.futures.thread import ThreadPoolExecutor from logging import Logger from queue import Queue fro...
slackapi/python-slack-sdk
slack_sdk/socket_mode/websocket_client/__init__.py
__init__.py
py
10,565
python
en
code
3,729
github-code
27
[ { "api_name": "slack_sdk.socket_mode.client.BaseSocketModeClient", "line_number": 28, "usage_type": "name" }, { "api_name": "logging.Logger", "line_number": 29, "usage_type": "name" }, { "api_name": "slack_sdk.web.WebClient", "line_number": 30, "usage_type": "name" }, ...
70253079752
import vadvisor import pytest import webtest from prometheus_client import REGISTRY from vadvisor.store.collector import InMemoryStore as MetricStore from vadvisor.app.prometheus import LibvirtCollector @pytest.fixture def _app(): class Collector: def __init__(self): self.metrics = [] ...
kubevirt/vAdvisor
tests/app/test_metrics.py
test_metrics.py
py
1,386
python
en
code
14
github-code
27
[ { "api_name": "vadvisor.app", "line_number": 23, "usage_type": "attribute" }, { "api_name": "vadvisor.store.collector.InMemoryStore", "line_number": 25, "usage_type": "call" }, { "api_name": "prometheus_client.REGISTRY.register", "line_number": 26, "usage_type": "call" ...
22246080038
from __future__ import division from __future__ import print_function import time import os import tensorflow as tf import numpy as np import scipy.sparse as sp from sklearn.metrics import roc_auc_score from sklearn.metrics import average_precision_score from optimizer import OptimizerCAN from input_data import load_A...
mengzaiqiao/CAN
train.py
train.py
py
7,619
python
en
code
63
github-code
27
[ { "api_name": "os.environ", "line_number": 15, "usage_type": "attribute" }, { "api_name": "tensorflow.flags", "line_number": 17, "usage_type": "attribute" }, { "api_name": "input_data.load_AN", "line_number": 30, "usage_type": "call" }, { "api_name": "scipy.sparse...
19950815936
from concurrent.futures import ProcessPoolExecutor as Pool from Plugins.base import Base import sys, json, os print("Snake-Ping") plugins = os.listdir("Plugins") if len(sys.argv) < 3: exit("Missing params, e.g NL 1.1.1.1") origin = sys.argv[1] target = sys.argv[2] pluginToLoad = sys.argv[3] if len(sys.argv) == 4 else...
Ne00n/Snake-Ping
snake.py
snake.py
py
3,185
python
en
code
10
github-code
27
[ { "api_name": "os.listdir", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 8, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 10,...
27198340550
import random import time from app import app from flask import render_template, redirect, url_for, flash, request from flask_login import login_user, logout_user, login_required from app.forms import SignUpForm, LoginForm, ProblemForm, EditUserForm from app.models import User, Score @app.route('/') def index(): ...
terrykub80/Math-Mash
app/routes.py
routes.py
py
8,459
python
en
code
0
github-code
27
[ { "api_name": "flask.render_template", "line_number": 12, "usage_type": "call" }, { "api_name": "app.app.route", "line_number": 10, "usage_type": "call" }, { "api_name": "app.app", "line_number": 10, "usage_type": "name" }, { "api_name": "app.models.User.query.all...
38963114627
import logging from subprocess import PIPE from time import sleep from unittest import TestCase, mock from unittest.mock import call from hoststats.client import HostStats from hoststats.stats import FORWARD_HEADER from hoststats.validation import validate_csv_data class MockResponse: def __init__(self, text, js...
Shillaker/hoststats
hoststats/tests/test_client.py
test_client.py
py
5,490
python
en
code
3
github-code
27
[ { "api_name": "logging.debug", "line_number": 23, "usage_type": "call" }, { "api_name": "logging.debug", "line_number": 44, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 54, "usage_type": "name" }, { "api_name": "hoststats.client.HostSt...
11713385039
import nltk import os from nltk.tree.prettyprinter import TreePrettyPrinter class SyntaxTree: __JARS = ( "C:/Storage/Modules/Stanford NLP Core/stanford-corenlp-4.4.0.jar", "C:/Storage/Modules/Stanford NLP Core/stanford-corenlp-4.4.0-models.jar" ) os.environ['JAVAHOME'] = "C:/Program File...
karicotiza/natural_language_interface
Лабораторная 4/Код/nlp.py
nlp.py
py
2,129
python
en
code
4
github-code
27
[ { "api_name": "os.environ", "line_number": 13, "usage_type": "attribute" }, { "api_name": "nltk.parse.corenlp.CoreNLPServer", "line_number": 17, "usage_type": "call" }, { "api_name": "nltk.parse", "line_number": 17, "usage_type": "attribute" }, { "api_name": "nltk...
73135455433
import csv import calendar import datetime from collections import defaultdict from decimal import Decimal from io import StringIO from fastapi import status, Depends, HTTPException from sqlalchemy.orm import Session from exceptions import ExceptionDescription from storage import tables from storage.database import g...
ArturMalkov/avito_backend_2022_account_balance_microservice_python_version
services/reports.py
reports.py
py
2,824
python
en
code
0
github-code
27
[ { "api_name": "sqlalchemy.orm.Session", "line_number": 18, "usage_type": "name" }, { "api_name": "fastapi.Depends", "line_number": 18, "usage_type": "call" }, { "api_name": "storage.database.get_db_session", "line_number": 18, "usage_type": "argument" }, { "api_na...
42246160010
""" @author: David Lei @since: 19/10/2017 """ import functools def permuate(string, permutation_holder, call_num): """Order is important in permutations. For a string of length n there are n! permutations. Args: call_num: used to help understand the complexity of the algorithm for each call print...
qifanyyy/JupyterNotebook
new_algs/Sequence+algorithms/Selection+algorithm/permutations_of_a_string.py
permutations_of_a_string.py
py
1,692
python
en
code
8
github-code
27
[ { "api_name": "functools.reduce", "line_number": 36, "usage_type": "call" } ]
12833003384
from typing import Optional from .aws import Action as BaseAction from .aws import BaseARN service_name = "Database Query Metadata Service" prefix = "dbqms" class Action(BaseAction): def __init__(self, action: Optional[str] = None) -> None: super().__init__(prefix, action) class ARN(BaseARN): def ...
cloudtools/awacs
awacs/dbqms.py
dbqms.py
py
1,117
python
en
code
389
github-code
27
[ { "api_name": "aws.Action", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 11, "usage_type": "name" }, { "api_name": "aws.BaseARN", "line_number": 15, "usage_type": "name" } ]
13902208368
import unittest import invariants import networkx as nx import numpy as np import logging # Start the logger # logging.root.setLevel(logging.INFO) K4_prop = { "n_vertex": 4, "n_edge": 6, "automorphism_group_n": 24, "chromatic_number": 4, "diameter": 1, "is_strongly_regular": True, "radius"...
thoppe/Encyclopedia-of-Finite-Graphs
src/unit_tests.py
unit_tests.py
py
3,958
python
en
code
12
github-code
27
[ { "api_name": "networkx.complete_graph", "line_number": 53, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 82, "usage_type": "attribute" }, { "api_name": "logging.info", "line_number": 87, "usage_type": "call" }, { "api_name": "invariant...
38082510762
import torch import math from torch import nn from torch.nn import functional as F custom_config = {'base' : {'strategy': 'base_adam', 'batch': 8, }, 'customized': {'--abc': {'type': float, 'default': 0}, ...
moothes/SALOD
methods/edn.py
edn.py
py
16,575
python
en
code
38
github-code
27
[ { "api_name": "torch.nn.Module", "line_number": 15, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 15, "usage_type": "name" }, { "api_name": "torch.nn.BatchNorm2d", "line_number": 28, "usage_type": "attribute" }, { "api_name": "torch.nn", ...
70608533191
import argparse import os import time import torch import torch.nn as nn import torchvision.datasets as datasets import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torchvision import datasets, transforms from noname import * import numpy as np import json import os fr...
giscard88/hypothesis-building
MNIST/gen_association.py
gen_association.py
py
3,417
python
en
code
0
github-code
27
[ { "api_name": "argparse.ArgumentParser", "line_number": 25, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 46, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 46, "usage_type": "attribute" }, { "api_name": "torch...
16664531790
# encoding: utf8 from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('website', '0003_auto_20140601_1040'), ] operations = [ migrations.AlterField( model_name='voting', name='vo...
pskamburov/world-cup
worldcup/website/migrations/0004_auto_20140601_1224.py
0004_auto_20140601_1224.py
py
491
python
en
code
1
github-code
27
[ { "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.AlterField", "line_number": 14, "usage_type": "call" }, {...
27170622540
from __future__ import division import sys, pygame, spritesheet, wordwrap import random import numpy import math import cProfile from wordwrap import render_textrect WIDTH = HEIGHT = 300 TILE_SIZE = 20 VISIBLE_MAP_SIZE = 10 CHAR_XY = WIDTH / 2 GRAVITY = 1 MAP_SIZE_TILES = 20 MAP_SIZE_PIXELS = MAP_SIZE_TILES * TILE_SIZ...
johnfn/ld23
main.py
main.py
py
50,822
python
en
code
2
github-code
2
[ { "api_name": "pygame.display.set_mode", "line_number": 65, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 65, "usage_type": "attribute" }, { "api_name": "pygame.Surface", "line_number": 74, "usage_type": "call" }, { "api_name": "pygame.RLE...
38562724180
import importlib.util from typing import List, Iterator, Dict, Tuple, Any, Type from torch.utils.data import DataLoader import time from models import build_model import requests import pickle from utils import * def load_defender(model_name, student_id, name, task_folder, task, device, pretrained_file="models/lenet_m...
kamillesuayan/maestro-class
playground/defense_homework/Evaluator.py
Evaluator.py
py
7,098
python
en
code
2
github-code
27
[ { "api_name": "importlib.util.util.spec_from_file_location", "line_number": 11, "usage_type": "call" }, { "api_name": "importlib.util.util", "line_number": 11, "usage_type": "attribute" }, { "api_name": "importlib.util", "line_number": 11, "usage_type": "name" }, { ...
27777535021
import sqlite3 import datetime import os import json from scripts.artifacts.appCookies import get_appCookies from scripts.artifact_report import ArtifactHtmlReport from scripts.cleapfuncs import logfunc, tsv, timeline, is_platform_windows, open_sqlite_db_readonly def get_skype(files_found, report_folder, seeker, wrap...
markmckinnon/cLeapp
scripts/artifacts/skype.py
skype.py
py
2,981
python
en
code
34
github-code
27
[ { "api_name": "scripts.cleapfuncs.open_sqlite_db_readonly", "line_number": 15, "usage_type": "call" }, { "api_name": "scripts.cleapfuncs.open_sqlite_db_readonly", "line_number": 33, "usage_type": "call" }, { "api_name": "scripts.artifact_report.ArtifactHtmlReport", "line_numb...