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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
42967705080 | from django.contrib.auth import get_user_model
from rest_framework import serializers
from users.models import PersonalCharacteristics, PhysicalActivityLevel, BackPainLevel, Diseases, DecisionLevel2
import logging
logger = logging.getLogger(__name__)
class UserSerializer(serializers.ModelSerializer):
class Meta... | sjuggernaut/smartback | users/serializers.py | serializers.py | py | 4,103 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 10,
"usage_type": "name"
}... |
31068831754 | from functools import total_ordering
from config import config
from alignment import AlignedResult
from threading import Lock
import csvHelper as csvh
from parameter import params
from PySide6.QtGui import QStandardItem
result_node_write_lock = Lock()
@total_ordering
class ResultNode(QStandardItem):
def __init__(s... | RaoboXu/Lipidwizard | resultnode.py | resultnode.py | py | 9,351 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "threading.Lock",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PySide6.QtGui.QStandardItem",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "alignment.AlignedResult",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "ali... |
18831206638 | # PYTHON LIBRARIES
# WORKING WITH FILES, DIRECTORIES AND PATHS
# --------------PATHS---------------
# PATH CLASS - FOUNDATION TO WORK WITH FILES AND DIRECTORIES
import subprocess # Module help in running other programs
from string import Template
from email.mime.image import MIMEImage # Attaching Image to the m... | Balvinder10/Python-Tutorials | Part_8.py | Part_8.py | py | 17,081 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "pathlib.Path.home",
"line_... |
3325309511 | import PySimpleGUI as gu
label1 = gu.Text("Enter feet: ")
input1 = gu.Input()
label2 = gu.Text("Enter inches: ")
input2 = gu.Input()
button1 = gu.Button("Convert")
window = gu.Window("Convertor",
layout=[[label1, input1],
[label2, input2],
[b... | ramhors/todo-app | A-MegaPython/exercises/cuiexercise1.py | cuiexercise1.py | py | 360 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PySimpleGUI.Text",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.Input",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.Text",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.Input",
... |
25107092309 | # -*- coding: utf-8 -*-
"""
Name:
white_light.py
Purpose:
干渉データを解析してpeaks distanceを計算
Specification:
モジュール
Environment:
Python 3.5.1
"""
import numpy as np
from scipy import signal
from scipy import fftpack
from scipy import interpolate
import matplotlib.pyplot as plt
import sys
from scipy.optimize... | shumasud/WLI_simulator | white_light.py | white_light.py | py | 12,224 | python | ja | code | 1 | github-code | 6 | [
{
"api_name": "scipy.fftpack.fft",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "scipy.fftpack",
"line_number": 57,
"usage_type": "name"
},
{
"api_name": "numpy.max",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "numpy.argmin",
"line_nu... |
18598158535 | from __future__ import annotations
from data_access.dto import SneakerDTO
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from fake_lib.providers import (
WordProvider,
PriceProvider,
RandomValueFromListProvider,
ColorProvider
)
class SneakerFactory:
def __init__(
... | pyteacher123/py35-onl | sports_db_project/populate_db/factories/sneaker.py | sneaker.py | py | 988 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "fake_lib.providers.WordProvider",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "fake_lib.providers.PriceProvider",
"line_number": 17,
"usage_type": "name"
},
{
... |
9544116074 | # utils
from sklearn.model_selection import train_test_split
import timeit
# models
from sklearn import svm
# Data sets
from sklearn.datasets import fetch_openml
topo = fetch_openml(name='topo_2_1', version=1)
print('SVM for topo_2_1 dataset (for regression)')
test_size_ratio = 0.3
print('Size: ', topo.data.shape)
... | BlancaCC/learning_machine_learning | random_features_for_large_scale_kernel_machine/entrega/Code/experiments/topo/SVM.py | SVM.py | py | 811 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sklearn.datasets.fetch_openml",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sklearn.svm.SVR",
"line_number": 21,
"usage_type": "call"
},
{
... |
29002828249 | import pytest
from tral.repeat_list import repeat_list as rl
from tral.repeat import repeat
from tral.repeat_list import repeat_list_io as rl_io
from tral.sequence import sequence
TEST_REPEATS = [["AA", "AA"], ["AAA", "AAA"]]
TEST_SEQUENCE = "MAAAAKAAAAAAL"
TEST_SCORE = "phylo_gap01"
TEST_SCORE_VALUE_LIST = [0.0, 0.5... | acg-team/tral | tral/repeat_list/test/repeat_list_io_test.py | repeat_list_io_test.py | py | 995 | python | en | code | 24 | github-code | 6 | [
{
"api_name": "tral.repeat.repeat.Repeat",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "tral.repeat.repeat",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "tral.sequence.sequence.Sequence",
"line_number": 21,
"usage_type": "call"
},
{
"api_... |
18846553087 | # coding: utf-8
# Created by Jakob Lautrup Nysom @ May 14th 2014
import codecs
import sys
import os
from roads import Road, Inter, Loader
from dbtool import IntersectionDB
from argparse import ArgumentParser
def create_intersection_database(interfile, dbname, cachelimit=200):
"""Creates a database with all the int... | glennneiger/First-year-project | src/resources/krak_converter.py | krak_converter.py | py | 3,540 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "dbtool.IntersectionDB",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "roads.Inter",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "roads.Road",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"li... |
24543677191 | from argparse import ArgumentParser
import yaml
from pprint import pprint as p
from jinja2 import Environment, FileSystemLoader
import os
def add_1(x):
return str(int(x) + 1)
func_dict = {
"add_1": add_1
}
if __name__ == '__main__':
parser = ArgumentParser()
parser.add_argument("--experiment_name"... | FMELab/ssdgm | scripts/generate_hyp_templates.py | generate_hyp_templates.py | py | 2,115 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
... |
16943071356 | import csv
import requests
from pprint import pprint
from decouple import config
from datetime import datetime, timedelta
# 제일 마지막에 csv 파일 생성에 사용될 빈 딕셔너리 생성
result = {}
# url의 targetDt를 변경하며 50회 반복하며 url요청
for i in range(50):
key = config('KEY')
targetDt = datetime(2019, 7, 13) - timedelta(weeks=i)
targe... | chajk811/pjt_01 | 01.py | 01.py | py | 1,640 | python | ko | code | 0 | github-code | 6 | [
{
"api_name": "decouple.config",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "requests.get",
... |
11762144874 | import requests
from itertools import permutations
from bs4 import BeautifulSoup
def check_word(word):
URL = "https://dexonline.ro/definitie/" + word
page = requests.get(URL)
soup = BeautifulSoup(page.content, "html.parser")
response = soup.find("h3", class_="")
if "Niciun rezultat pentru" in re... | TataruDan/Laboratoare_Python | Problema/Cautarea de anagrame.py | Cautarea de anagrame.py | py | 870 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "itertools.permutations",
"line_number": 26,
"usage_type": "call"
}
] |
10175375790 | import shapefile
from shapely.geometry import Point, shape
from geopy.geocoders import Nominatim
geolocator = Nominatim(user_agent="Chicago Action")
def address_search(address):
try:
location = geolocator.geocode(address)
except:
return None
point = (location.longitude,location.latitud... | joelsewhere/chicago-action | app/src/ward.py | ward.py | py | 851 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "geopy.geocoders.Nominatim",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "shapefile.Reader",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "shapely.geometry.Point",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "shap... |
34038290358 | from aio_proxy.search.helpers.elastic_fields import get_elasticsearch_field_name
from elasticsearch_dsl import query
def search_bilan(
search,
search_params,
bilan_filters_to_include,
):
search_options = []
bilan_filters = []
for filter in bilan_filters_to_include:
filter_value = searc... | etalab/annuaire-entreprises-search-api | aio/aio-proxy/aio_proxy/search/queries/bilan.py | bilan.py | py | 1,199 | python | en | code | 13 | github-code | 6 | [
{
"api_name": "aio_proxy.search.helpers.elastic_fields.get_elasticsearch_field_name",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "elasticsearch_dsl.query.Q",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "elasticsearch_dsl.query",
"line_number": 33,
... |
12173386627 | # -*- coding: utf-8 -*-
"""
==========================================
pipeline1-data_generation
第一步,生成一维随机数据,并对其做小波变换,存储成文件
==========================================
"""
import numpy as np
# from wavelet.wavelet import wavelet # 老方法
from wavelet.plot import wavelet # 新方法
from utils.utils import f1calc
import time
d... | MarcWong/wavelet | data_generation.py | data_generation.py | py | 3,605 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.random.normal",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.normal",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.rando... |
74934509627 | from os import path
from mock import patch
import dotfiles
from config import get_dotfiles_backup_dir, get_home_dir, get_user
@patch('dotfiles.get_dot_files')
@patch('dotfiles.copy_files')
def test_backup(copy_files_mock, dotfiles_mock):
files = ['.no_file']
dotfiles_mock.return_value = files
dotfiles.bac... | clintmod/macprefs | test_dotfiles.py | test_dotfiles.py | py | 1,215 | python | en | code | 289 | github-code | 6 | [
{
"api_name": "dotfiles.backup",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "config.get_dotfiles_backup_dir",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "mock.patch",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "mock.patch",... |
12098007515 | from keras.models import Model
from keras.layers import Input, Conv2D, BatchNormalization, Activation, Concatenate, AvgPool2D, Dense, GlobalAvgPool2D, Reshape
from keras.layers import DepthwiseConv2D
def ghost_block(inputs, dw_channels, out_channels, ratio=2):
init_channels = int(out_channels / ratio)
... | hggzjx/modules-on-cnn | ghost_block.py | ghost_block.py | py | 1,349 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "keras.layers.DepthwiseConv2D",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "keras.layers.BatchNormalization",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "keras.layers.Activation",
"line_number": 12,
"usage_type": "call"
},
{
... |
26042074366 | from __future__ import annotations
import textwrap
from typing import List, NewType
import pytest
from pants.backend.terraform import tool
from pants.backend.terraform.lint.tffmt import tffmt
from pants.backend.terraform.lint.tffmt.tffmt import TffmtRequest
from pants.backend.terraform.target_types import TerraformF... | pantsbuild/pants | src/python/pants/backend/terraform/lint/tffmt/tffmt_integration_test.py | tffmt_integration_test.py | py | 6,813 | python | en | code | 2,896 | github-code | 6 | [
{
"api_name": "typing.NewType",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "pants.core.util_rules.external_tool.ExternalToolVersion.decode",
"line_number": 27,
"usage_type": "call"
},
... |
38047283552 | import requests
import json
import win32com.client
speaker = win32com.client.Dispatch("SAPI.SpVoice")
city = input("Enter your city: ")
url = f"https://api.weatherapi.com/v1/current.json?key=969d99c6a8c041399e0131648231309&q={city}"
r = requests.get(url)
wd = json.loads(r.text)
temp = (wd["current"]["temp_c"])
tempfl ... | AbhiStark9/WeatherApp | main.py | main.py | py | 649 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "win32com.client.client.Dispatch",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "win32com.client.client",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "win32com.client",
"line_number": 5,
"usage_type": "name"
},
{
"api_name... |
29578926720 | # -*- coding: utf-8 -*-
"""
https://github.com/STO-OTZ/my_gcForest/
Created on Thu Nov 8 14:26:05 2018
@author: Akitaka
"""
import numpy as np
from sklearn.ensemble import RandomForestClassifier
from sklearn.cross_validation import cross_val_predict as cvp
import random
from functools import reduce
cl... | nakanishi-akitaka/python2018_backup | 1108/my_gcForest-master/my_gcForest.py | my_gcForest.py | py | 11,638 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "functools.reduce",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_numb... |
38804400195 | import tkinter, requests, os, datetime, subprocess, time, pathlib, glob, os
import urllib.request as req
from PIL import Image, ImageTk
print('Sleeping 15 seconds')
time.sleep(15)
if os.environ.get('DISPLAY','') == '':
print('No display found. Using :0.0')
os.environ.__setitem__('DISPLAY', ':0.0')
lastImage... | Kaediin/NASA_APOD | nasa.py | nasa.py | py | 6,310 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "time.sleep",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.environ.__setitem__",
"... |
7002601381 | import requests
from bs4 import BeautifulSoup
from ..flaskapp.utils.db_utils import conn as db_conn
import logging
import psycopg2
import re
STORE_ENDPOINT = "http://ucdavisstores.com/SelectCourses.aspx"
# http://ucdavisstores.com/SelectCourses.aspx?src=2&type=2&stoid=192&trm=Spring%2016&cid=49592
class TextbooksTbdE... | minupalaniappan/gradfire | daviscoursesearch/scraper/storescraper.py | storescraper.py | py | 2,937 | python | en | code | 12 | github-code | 6 | [
{
"api_name": "requests.Session",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "requests.Request",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "re.match",
"l... |
14986357290 | # -*- coding: utf-8 -*-
import os
import random
import string
from typing import Any
import tensorflow as tf
from langml import TF_KERAS
if TF_KERAS:
import tensorflow.keras.backend as K
else:
import keras.backend as K
from langml.tensor_typing import Models
from langml.log import info, warn
from langml impo... | ant-research/TDEER | langml/langml/model.py | model.py | py | 3,130 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "langml.TF_KERAS",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "random.choice",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "string.ascii_lowercase",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "os.path.exi... |
41572267505 | import xgboost as xgb
import pandas as pd
from sklearn.metrics import accuracy_score
import os
import numpy as np
import config
df = pd.read_csv(config.values['transformed_data_path'] + config.values['train_file'])
y = df[config.values['target_column']]
# Get all files that we want to blend for the final prediction
... | ryanwhetstone/python | Kaggle/Titanic/_stack.py | _stack.py | py | 1,605 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "config.values",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "config.values",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "config.values",
... |
27030832360 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import rospy
import cv2
from sensor_msgs.msg import CompressedImage, Image
import numpy as np
import time
import sys
fourcc = cv2.VideoWriter_fourcc(*'XVID')
name = time.time()
compressed_out = cv2.VideoWriter("/home/hll/code_space/videos/"+ str(name) + "_compressed_output.av... | weihaoysgs/bike-xuan | bike_xuan_vision/bike_vision/scripts/record_video.py | record_video.py | py | 2,186 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "cv2.VideoWriter_fourcc",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.VideoWriter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.VideoWriter",
... |
17650460729 | # threeD_dataLoader.py: Chuẩn bị train và val dataset
import os
import h5py
import numpy as np
import torch
from torch.utils.data import Dataset
import logging
import pickle
import glob
from utils import normalize
from heatmap_from_keypoint3D import heatmap_from_keypoint
# Trả về 1 đoạn input signal có size là 2 * win... | hieultse150560/SwinTranUnet | threeD_dataLoader.py | threeD_dataLoader.py | py | 2,481 | python | vi | code | 1 | github-code | 6 | [
{
"api_name": "numpy.mean",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "torch.utils.data.Dataset",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "glob.glob",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"lin... |
37762428648 | import csv
import torch
import matplotlib.pyplot as plt
from DataLoader import NominalMNISTImageDataset, AnomalousMNISTImageDataset, NominalCIFAR10ImageDataset, \
AnomalousCIFAR10ImageDataset, NominalCIFAR10AutoencoderDataset, AnomalousCIFAR10AutoencoderDataset, \
NominalMNISTAutoencoderDataset, AnomalousMNIST... | DennisWeiss/soft-tukey-depth-experiments | max-variance-encoder.py | max-variance-encoder.py | py | 15,081 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "DataLoader.NominalCIFAR10AutoencoderDataset",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "DataLoader.AnomalousCIFAR10AutoencoderDataset",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "torch.autograd.set_detect_anomaly",
"line_number": ... |
719783650 | import socket
import asyncore
import random
import pickle
import time
from server_utils import handle_message
BUFFERSIZE = 512
global outgoing
outgoing = []
class Minion:
def __init__(self, ownerid, health= 100):
self.x = 50
self.y = 50
self.ownerid = ownerid
self.Class = 0
self.health = health... | McStevenss/pygame | server.py | server.py | py | 1,443 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pickle.loads",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "server_utils.handle_message",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "asyncore.dispatcher",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "asy... |
41598909385 | from bs4 import BeautifulSoup
import numpy as np
import os
import pymorphy2
import re
from stop_words import get_stop_words
import pickle
AllowedWords = '[а-я]+'
wordNormal = pymorphy2.MorphAnalyzer()
stop_words = {wordNormal.normal_forms(i)[0] for i in get_stop_words('ru')}
MODEL_NAME = 'finaleModel.bin'
#Here we... | MaximArtemev/old_croc_search_module | ModelCreate.py | ModelCreate.py | py | 3,156 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pymorphy2.MorphAnalyzer",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "stop_words.get_stop_words",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.mkdirs",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.mkdir"... |
8562171920 | import numpy as np
import cv2
def rgb2grayscale(rgb):
return rgb[:, :, 0] * 0.2989 + rgb[:, :, 1] * 0.587 + rgb[:, :, 2] * 0.114
class DenseToSparse:
def __init__(self):
pass
def dense_to_sparse(self, rgb, depth):
pass
def __repr__(self):
pass
class DSOSampling(DenseToSpa... | maaft/sparse-to-dense.pytorch | dense_to_sparse.py | dense_to_sparse.py | py | 6,927 | python | en | code | null | github-code | 6 | [
{
"api_name": "numpy.asfarray",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "cv2.Laplacian",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "cv2.CV_64F",
"line_number": 69,
"usage_type": "attribute"
},
{
"api_name": "numpy.full",
"line_n... |
29210057896 | # Self Organizing Map for fraud detection from customers' applications
# Goal: Identify patterns int he high-dim dataset to predict fraud likelyhood
# The dataset is from UCI Machine Learning Repository. It is "Statlog (Aus Credit Approval) Data Set".
# All atribute names have been changed to meaningless symbols for co... | dessytto/Fraud_Detection | MiniSOM/MiniSOM_fraud_detection.py | MiniSOM_fraud_detection.py | py | 3,548 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.MinMaxScaler",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "minisom.MiniSom",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "py... |
72014605628 | import argparse
import col_data as cd
from tabulate import tabulate
import os
def get_flat(sent):
labels = []
for token in sent.tokens:
scopes = token.scope
if len(scopes) > 0:
label = scopes[-1][-1]
else:
label = "O"
labels.append(label)
return labe... | jerbarnes/semeval22_structured_sentiment | baselines/graph_parser/src/F1_scorer.py | F1_scorer.py | py | 14,788 | python | en | code | 71 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 337,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 371,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 371,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
... |
72705250427 | import torch
import torch.nn as nn
# import dgl
# from dgl.nn.pytorch import GraphConv, GATConv, GINConv
from torch_geometric.nn.conv import GINConv
# from embedding.mlp import MLP
import torch.nn.functional as F
from typing import Callable, Optional, Union
from torch import Tensor
from torch_geometric.utils.conve... | icecream126/3DPE | dig/threedgraph/embedding/GIN.py | GIN.py | py | 5,668 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "torch.nn.ModuleList",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"lin... |
11881228416 | import bpy, datetime, mathutils, math
def export_xlmaterial(context, filepath, use_some_setting):
scene = bpy.context.scene
world = scene.world
material = bpy.context.active_object.active_material
stream = open(filepath, 'w')
# Metadata
stream.write('type material\n')
stream.write('name \n')
stream.write('... | hrdzkj/openxl | tools/blender/io_export_xlmaterial.py | io_export_xlmaterial.py | py | 2,334 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "bpy.context",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "bpy.context",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "datetime.date.today",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.date",
... |
24998747181 | import time
import locale
import datetime
from report import report_sxw
import time
import pooler
import rml_parse
import mx.DateTime
from mx.DateTime import RelativeDateTime, now, DateTime, localtime
class employees_salary_report(rml_parse.rml_parse):
def __init__(self, cr, uid, name, context):
super... | factorlibre/openerp-extra-6.1 | hr_payroll/report/report_employees_detail.py | report_employees_detail.py | py | 9,777 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "rml_parse.rml_parse",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pooler.get_pool",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "pooler.get_poo... |
23314694200 | import requests
import pandas as pd
import pathlib
URL_NORRIS = "https://www.itl.nist.gov/div898/strd/lls/data/LINKS/DATA/Norris.dat"
FILENAME_NORRIS = "norris.dat"
path = pathlib.Path(FILENAME_NORRIS)
if not path.exists():
body = requests.get(URL_NORRIS).text.replace("\r\n", "\n").replace("\r","")
path.write_t... | epogrebnyak/multiple-regression-revisited | python/norris.py | norris.py | py | 536 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
}
] |
9841974386 | from bs4 import BeautifulSoup
import requests
import random
def get_ip_list(url, headers):
web_data = requests.get(url, headers=headers)
soup = BeautifulSoup(web_data.text, 'lxml')
ips = soup.find_all('tr')
ip_list = []
for i in range(1, len(ips)):
ip_info = ips[i]
tds = ip_info.fin... | woat1314/first_scrapy | 02 招聘/proxy_ip.py | proxy_ip.py | py | 1,508 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_n... |
35334816675 | from django.db import models
from noc.models import Noc
class Athlete(models.Model):
name = models.CharField(max_length=255)
sex = models.CharField(max_length=1)
age = models.FloatField(blank=True, null=True)
height = models.FloatField(blank=True, null=True)
weight = models.FloatField(blank=True, n... | abelsco/django-rest-athlete | athlete/models.py | models.py | py | 817 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.db.models.Model",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "... |
23352547877 | from django.urls import path
from . import views
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('', views.index),
path('login/', views.login_auth),
path('sign-up/', views.sign_up),
path('add-new-movie/', views.newMovie, name='newMovie'),
path('sear... | remycyuzuzo/cinemania | cinemaapp/urls.py | urls.py | py | 868 | 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",
... |
26530903931 | import json
from oneview_redfish_toolkit.api.ethernet_interface import EthernetInterface
from oneview_redfish_toolkit.tests.base_test import BaseTest
class TestResourceBlockEthernetInterface(BaseTest):
"""Tests for ResourceBlockEthernetInterface class"""
def setUp(self):
"""Tests preparation"""
... | HewlettPackard/oneview-redfish-toolkit | oneview_redfish_toolkit/tests/api/test_resource_block_ethernet_interface.py | test_resource_block_ethernet_interface.py | py | 1,594 | python | en | code | 16 | github-code | 6 | [
{
"api_name": "oneview_redfish_toolkit.tests.base_test.BaseTest",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "json.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "j... |
2533777012 | from typing import Iterable
from iota import ProposedBundle
from iota.exceptions import with_context
from iota.multisig.types import MultisigAddress
__all__ = [
'ProposedMultisigBundle',
]
class ProposedMultisigBundle(ProposedBundle):
"""
A collection of proposed transactions, with multisig inputs.
Note: a... | iotaledger/iota.py | iota/multisig/transaction.py | transaction.py | py | 3,342 | python | en | code | 344 | github-code | 6 | [
{
"api_name": "iota.ProposedBundle",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Iterable",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "iota.multisig.types.MultisigAddress",
"line_number": 39,
"usage_type": "name"
},
{
"api_name"... |
42895112672 | import math
import jax.numpy as jnp
import jax.random
import numpy as np
from coupled_rejection_sampling.coupled_rejection_sampler import coupled_sampler
from coupled_rejection_sampling.rejection_sampler import rejection_sampler, accept_proposal_and_acceptance_ratio
_LOG_HALF = math.log(0.5)
def coupled_parallel_r... | AdrienCorenflos/coupled_rejection_sampling | coupled_rejection_sampling/coupled_parallel_resampler.py | coupled_parallel_resampler.py | py | 3,822 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "math.log",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "jax.numpy.ndarray",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "jax.numpy",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "jax.numpy.ndarray",
"li... |
29173842379 | from editor.nodes.core import BaseNode
from editor.nodes.utils import draw_trigger_port
class EngineGetGameSizeNode(BaseNode):
__identifier__ = "PE4.Engine"
NODE_NAME = "Get Game Size"
def __init__(self):
super().__init__()
self.add_input("Trigger", painter_func=draw_trigger_port)
... | Lycos-Novation/PyEngine4-EditorVS | editor/nodes/nodes/pe4_engine_nodes/get_game_size_node.py | get_game_size_node.py | py | 447 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "editor.nodes.core.BaseNode",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "editor.nodes.utils.draw_trigger_port",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "editor.nodes.utils.draw_trigger_port",
"line_number": 15,
"usage_type": "n... |
31261384641 | import unittest
class FixtureTestCase(unittest.TestCase):
def _make(self, rows, min_zoom_fn, props_fn, relations=[],
layer_name='testlayer', label_placement_layers={}):
from tilequeue.query.common import LayerInfo
from tilequeue.query.fixture import make_fixture_data_fetcher
... | thanhnghiacntt/tilequeue | tests/test_query_fixture.py | test_query_fixture.py | py | 13,016 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "tilequeue.query.common.LayerInfo",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tilequeue.query.fixture.make_fixture_data_fetcher",
"line_number": 11,
"usage_type... |
22493353807 | import os
import sys
from bs4 import BeautifulSoup
def replace_img_urls(directory, old_host, new_host):
for root, dirs, files in os.walk(directory):
for file in files:
if file.endswith('.html'):
file_path = os.path.join(root, file)
with open(file_path, 'r') as f:
soup = BeautifulS... | webp-sh/docs.webp.sh | convert.py | convert.py | py | 1,368 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.walk",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number":... |
26408032729 | from flask import Flask, request, Response
import base64
import json
import os
node = Flask(__name__)
# 打开Debug
node.debug = True
# POST实现JSON RPC
@node.route('/cmd', methods=['POST'])
def rpc_cmd():
# 提取POST请求数据中的JSON数据
client_post_data = request.json
# 如果存在JSON数据,进行后续的操作
if client_post_data:
... | Prin-Meng/NetDevOps | devnet_http/task_day2/json_rpc_service.py | json_rpc_service.py | py | 3,144 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.request.json",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "flask.Response",
... |
72255287228 | from __future__ import annotations
from typing import TYPE_CHECKING
import discord
from discord.ext import commands
from discord.utils import escape_markdown
from utils import human_timedelta
from ._base import CogBase
if TYPE_CHECKING:
from bot import Bot
from cogs.context import Context
class AfkComman... | LeoCx1000/fish | src/cogs/tools/afk.py | afk.py | py | 2,534 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "_base.CogBase",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "bot.Bot",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "cogs.context.Context",
... |
15826982361 | import pymysql
import re
from config import Config
from feeds.channelnewsasia_feed import ChannelNewsAsiaFeed
from feeds.mothershipsg_feed import MotherShipSGFeed
from feeds.nytimes_feed import NYTimesFeed
from feeds.scmp_feed import SCMPFeed
from feeds.straitstimes_feed import StraitsTimesFeed
from feeds.theguardianuk... | R4m4n/Scrap-news-with-keyword-filter | runner.py | runner.py | py | 3,628 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "feeds.straitstimes_feed.StraitsTimesFeed",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "feeds.mothershipsg_feed.MotherShipSGFeed",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "feeds.theonlinecitizen_feed.TheOnlineCitizenFeed",
"line_nu... |
8125654972 | from matplotlib import pyplot as plt
import pandas as pd
import datetime
from datetime import timedelta
import matplotlib.dates as mdates
def main():
fig, ax = plt.subplots()
do_plot(ax,'today','office')
do_plot(ax,'today','cassian_room')
do_plot(ax,'yesterday','office')
do_plot(ax,'yesterday','cassian_room')
... | jeremyjones1017/Mirror | plot_temp.py | plot_temp.py | py | 1,216 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "matplotlib.dates.DateFormatter",
"line_number": 15,
"usage_type": "call"
},
{
"api_nam... |
14317574869 | from discord.ext import commands
import discord
TOKEN = "TOKEN"
modules = [
"Main"
]
client = commands.Bot(
command_prefix='!',
owner_id=[
703196906700144752, # filepile#2856
434549321216688128, # 샤프#8720
480977114980417538 # 잠ㅅ갊#3497
],
# intents=discord.flags.Intents.al... | sihyun1741/PowderEden | Modules/Main.py | Main.py | py | 820 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "discord.ext.commands.Bot",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "discord.ext.commands.Cog",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_n... |
30138535555 | # !/usr/local/python/bin/python
# -*- coding: utf-8 -*-
# (C) Wu Dong, 2020
# All rights reserved
# @Author: 'Wu Dong <wudong@eastwu.cn>'
# @Time: '2020-04-08 09:19'
# sys
import typing as t
import json
# 3p
from flask import Flask
from pre_request import BaseResponse
from pre_request import pre, Rule, ParamsValueError... | Eastwu5788/pre-request | tests/test_flask/test_resp.py | test_resp.py | py | 2,114 | python | en | code | 55 | github-code | 6 | [
{
"api_name": "pre_request.BaseResponse",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "typing.Callable",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "fl... |
21565841850 | import requests
import pandas
import urllib
import sys
import traceback
from timeit import default_timer
from .settings import settings
from .utils import download_file_from_stream
import time
logger = settings.logger
def download_result(key, output):
url = f"{settings.API_URL}query/result/{key}"
if isinsta... | Inria-Chile/oceania-fasta-query-client | package/src/oceania/main/client.py | client.py | py | 3,953 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "settings.settings.logger",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "settings.settings",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "settings.settings.API_URL",
"line_number": 16,
"usage_type": "attribute"
},
{
"ap... |
17339163101 | from datetime import date, datetime
import math
from flask_app.config.mysqlconnection import conectarMySQL
class Mensaje:
db = "muroprivado"
def __init__(self, datosMensaje):
self.id = datosMensaje['id']
self.contenido = datosMensaje['contenido']
self.usuarioIdDe = datosMensaje['usuario... | danielgavilanestorres/MuroPrivado_Deploy | flask_app/models/mensaje.py | mensaje.py | py | 2,761 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "math.floor",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "math.floor",
"... |
2655114957 | import logging
from random import randrange
import apache_beam as beam
import click
from apache_beam.io import WriteToText
from apache_beam.options.pipeline_options import PipelineOptions, SetupOptions
from apache_beam.pvalue import AsList, AsSingleton
def create_groups(group_ids, corpus, word, ignore_corpus, ignore... | vrcadore/apache-beam-examples | src/pipelines/side_input_example/pipeline.py | pipeline.py | py | 3,623 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "random.randrange",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "random.randrange",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "apache_beam.FlatMap",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "apache_beam.pva... |
4219680827 | import argparse
from utlis import *
from tqdm import tqdm
def ZhangCameraCalib():
parser = argparse.ArgumentParser(
description="Provide the folder path containing the calibration images and output files path"
)
parser.add_argument(
"--CalibrationImgsPath",
type=str,
m... | kumar-sanjeeev/camera-calibration-zhang-Method | src/main.py | main.py | py | 4,113 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 7,
"usage_type": "call"
}
] |
36115196319 | from keras.callbacks import Callback
from kardashigans.simple_experiment import SimpleExperiment
from kardashigans.trainer import BaseTrainer
class ZeroWeightsCallback(Callback):
"""A Callback that sets the given values to 0.0 on every epoch.
This is equivalent to removing the given weights.
"""
def ... | dorimedini/robustness_properties | winnery_ticket_experiment.py | winnery_ticket_experiment.py | py | 3,510 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "keras.callbacks.Callback",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "kardashigans.simple_experiment.SimpleExperiment",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "kardashigans.trainer.BaseTrainer.prune_model",
"line_number": 68,
... |
16541034717 | __revision__ = "src/engine/SCons/CacheDir.py 2014/07/05 09:42:21 garyo"
__doc__ = """
CacheDir support
"""
import os.path
import stat
import sys
import SCons.Action
cache_enabled = True
cache_debug = False
cache_force = False
cache_show = False
cache_readonly = False
def CacheRetrieveFunc(target, source, env):
... | Nuitka/Nuitka | nuitka/build/inline_copy/lib/scons-2.3.2/SCons/CacheDir.py | CacheDir.py | py | 6,970 | python | en | code | 10,019 | github-code | 6 | [
{
"api_name": "SCons.Action.Action",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "SCons.Action",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "stat.S_IMODE",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "stat.ST_MODE",
... |
30883146315 | # -*- coding: utf-8 -*-
from collective.calltoaction.portlets import calltoactionportlet
from collective.calltoaction.testing import COLLECTIVE_CALLTOACTION_INTEGRATION_TESTING # noqa
from plone import api
from plone.app.portlets.storage import PortletAssignmentMapping
from plone.app.testing import login
from plone.ap... | collective/collective.calltoaction | src/collective/calltoaction/tests/test_portlet.py | test_portlet.py | py | 5,888 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "collective.calltoaction.testing.COLLECTIVE_CALLTOACTION_INTEGRATION_TESTING",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "plone.app.testing.login",
"line_number": 2... |
9086856422 | #!/usr/bin/python
import os
import click
import subprocess
# Importing rich for rich text rendering
from rich.console import Console
# Create a console object to print colored and formatted text
console = Console()
@click.group()
def notes():
"""Manage your files and notes."""
pass
@notes.command()
@click... | Stefanomarton/NotesManager | Notes.py | Notes.py | py | 11,909 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rich.console.Console",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "click.group",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.expanduser",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path",
"li... |
16159926344 | import ast
import operator as op
from argparse import ArgumentParser
class MacroParser(object):
# supported operators for our safe parser
_operators = {
# binary arithmetic operators
ast.Add: op.add,
ast.Sub: op.sub,
ast.Mult: op.mul,
ast.Div: op.floordiv,
ast.M... | FreeRTOS/iot-reference-stm32u5 | tools/macro_to_kvfile.py | macro_to_kvfile.py | py | 3,244 | python | en | code | 36 | github-code | 6 | [
{
"api_name": "ast.Add",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "ast.Sub",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "ast.Mult",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "ast.Div",
"line_number": ... |
19757836249 | # scraper.base.py
import asyncio
import datetime as dtt
import time
from abc import ABC, abstractmethod
from typing import List, Type
import debug.logger as clog
from config.base import APP_CONFIG_REPO
from network import messenger as msn
from network.connection import Request, Tools, Session
logger = clog.getLogger(... | dbyte/WebtomatorPublicEdition | webtomator/scraper/base.py | base.py | py | 8,233 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "debug.logger.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "debug.logger",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "abc.ABC",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
... |
28805998256 | from io import TextIOWrapper
from typing import Any
from typing import Dict
from typing import List
from rich.console import Console
from rich.table import Table
from ..plugin import BaseFormatter
class Formatter(BaseFormatter):
@classmethod
def get_file_extension(cls) -> str:
return "txt"
def ... | coddingtonbear/jira-select | jira_select/formatters/table.py | table.py | py | 1,061 | python | en | code | 22 | github-code | 6 | [
{
"api_name": "plugin.BaseFormatter",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "rich.table.Table",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "io.TextIOWrapper",
... |
28859577792 | import pandas as pd
import numpy as np
import psycopg2
import sys, csv, unidecode, pyodbc, os, time
from sqlalchemy import create_engine, Table, MetaData
from sqlalchemy.dialects import postgresql
from contextlib import closing
from sqlalchemy import create_engine
from typing import Iterable, Optional, Tuple
f... | duyvanda/airflow-localEX | stack/dags/utils/df_handle.py | df_handle.py | py | 17,464 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.concat",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pandas.Series",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "unidecode.unidecode",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "pandas.Series",
"... |
71052686908 | import time
import pymysql
def get_time():
time_str = time.strftime("%Y{}%m{}%d{} %X")
return time_str.format("年","月","日")
def get_conn():
# 建立连接
conn = pymysql.connect(host="localhost", user="root", password="root", db="cov", charset="utf8")
# c创建游标A
cursor = conn.cursor()
return conn, c... | ch1762/cov | utils.py | utils.py | py | 1,779 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "time.strftime",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pymysql.connect",
"line_number": 11,
"usage_type": "call"
}
] |
653741457 | import os
import numpy as np
import argparse
import vigra
import h5py
import json
from skunkworks.datasets.cremi.loaders import RawVolumeWithDefectAugmentation
from skunkworks.inference import SimpleInferenceEngine
from skunkworks.postprocessing import local_affinity_multicut_from_wsdt2d
from inferno.trainers.basic im... | constantinpape/inferno-experiments | experiments/cremi/loss-experiments/predict_and_eval.py | predict_and_eval.py | py | 3,512 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cremi.Volume",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "cremi.evaluation.NeuronIds",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "cremi.Volume",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.join",
... |
14395108739 | from django.conf.urls import url
from hangowang import views
urlpatterns = [
url(r'^$',views.index,name='index'), # 首页
url(r'^login/$',views.login,name='login'), # 登录
url(r'^register/$',views.register,name='register'), # 注册
url(r'^details/(\d+)/$',views.details,name='details'), # 商品详情页面
url(r'... | zhuzhangjun/python1809 | hangowang/urls.py | urls.py | py | 647 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "hangowang.views.index",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "hangowang.views",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.c... |
25981420318 | import pytest
from policyglass import Action
ACTION_LT_SCENARIOS = {
"smaller": ["s3:get*", "s3:*"],
"smaller_mismatching_case": ["s3:get*", "S3:*"],
}
@pytest.mark.parametrize("_, scenario", ACTION_LT_SCENARIOS.items())
def test_action_less_than(_, scenario):
assert Action(scenario[0]) < Action(scenari... | CloudWanderer-io/PolicyGlass | tests/unit/less_or_greater_than/test_action.py | test_action.py | py | 637 | python | en | code | 55 | github-code | 6 | [
{
"api_name": "policyglass.Action",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "policygla... |
24769346669 | from pickle import load
import matplotlib.pyplot as plt
with open('logs_2.txt') as f: #We read from a file saved to disc by pyserial-test.py.
b = load(f)
b = [c for c in b if c!='']
b = [int(k)/10.0 for k in b]
x = [i for i in range(len(b))]
# y = b[:9000]
# x = x[:9000]
plt.figure(figsize=(20,2))
plt.plot(x,b,... | apan64/Solenoid-Engine-Control | RotaryEncoderDataParsing.py | RotaryEncoderDataParsing.py | py | 346 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pickle.load",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "matplotlib.pypl... |
33010992814 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.main_page, name='main_page'),
url(r'^search/$', views.search, name='search'),
url(r'^new_image/$', views.new_image, name='new image'),
url(r'^images/$', views.i... | evgenyvmi/pressfoto_task | mysite/urls.py | urls.py | py | 575 | python | en | code | 0 | 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... |
13861915882 | import config as cf
from App import model as m
import csv
from DISClib.ADT import list as lt
from DISClib.DataStructures import liststructure as lt
from DISClib.DataStructures import listiterator as it
"""
El controlador se encarga de mediar entre la vista y el modelo.
Existen algunas operaciones en las que se necesi... | YuneLotus/Reto2-202020-Template | App/controller.py | controller.py | py | 3,132 | python | es | code | null | github-code | 6 | [
{
"api_name": "App.model.loadCSVFile",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "App.model",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "App.model.compareRecordIds",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "DISCl... |
27024354766 |
# coding: utf-8
# In[2]:
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import seaborn as sns
# Input data files are available in the "../input/" directory.
# For example, running this (by clicking run or pressing Shift+Enter) will list the files in the in... | Harshubh-Meherishi/Starter-logistic-regression | MODEL.py | MODEL.py | py | 1,598 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.listdir",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "seaborn.countplot",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.show",... |
41434827409 | from datetime import timedelta
from django.utils.datetime_safe import date
from django.utils.timezone import now
from django.db import models
from django.contrib.auth.models import AbstractUser
from django.db.models.signals import post_save
from django.dispatch import receiver
# Create your models here.
class User... | MrWindmark/mercuryShop | authapp/models.py | models.py | py | 1,827 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.contrib.auth.models.AbstractUser",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "django.db.models.ImageField",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.db.models",
"line_number": 15,
"usage_type": "name"
},
{
... |
12776799359 |
from datetime import datetime, timezone
from typing import Any
from jose import jwt
from jose.exceptions import JWTError
from pydantic.error_wrappers import ValidationError
from starlette.authentication import (AuthCredentials, AuthenticationBackend,
AuthenticationError, BaseUser... | lifeavg/another_chat | chat/chat/authentication.py | authentication.py | py | 5,106 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "jose.jwt.decode",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "jose.jwt",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "starlette.authentication.BaseUser... |
1609528048 | import json
from langchain.schema import BaseOutputParser, OutputParserException
from langchain.chains.query_constructor.parser import get_parser
from typing import Any, Callable, Optional, Sequence
from langchain.chains.query_constructor.ir import (
Comparator,
Operator,
StructuredQuery,
)
class Structu... | CharlesSQ/product-search-bot | search_agent/tools/custom_self_query_retriever/structure_output_parser.py | structure_output_parser.py | py | 1,725 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "langchain.schema.BaseOutputParser",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "langchain.chains.query_constructor.ir.StructuredQuery",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"line_number": 16,
"usage_type"... |
36994667608 | import requests
import pytest # БИБЛИОТЕКА ИСПОЛЬЗУЕТСЯ ДЛЯ ПАРАМЕТРИЗАЦИИ ТЕСТА
class TestUserAuth:
# ПАРАМЕТРЫ ДЛЯ НЕГАТИВНОГО ТЕСТА НА АВТОРИЗАЦИЮ
exclude_params = [
("no cookies"), # ПАРАМЕТР ЗАПУСКАЕТ ТЕСТ, ГДЕ ПРОВЕРЯЕТСЯ АВТОРИЗАЦИЯ БЕЗ auth_sid
("no_token") # ПАРАМЕТР ЗАПУСКАЕТ ТЕСТ... | shnopiqa/Test_API_Build_2_0 | Тесты без фрэймворка/test_user_auth_with_setup.py | test_user_auth_with_setup.py | py | 9,830 | python | ru | code | 0 | github-code | 6 | [
{
"api_name": "requests.post",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 110,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_num... |
73769955066 | import collections
import itertools
import os
import argparse
import json
import numpy
##### "Plain old data" classes representing the elements inside a gene info file
class Gene:
"""Representation of a gene, including it's transcripts.
start, end coordinates indicate the min/max of the start/end coordinates... | itmat/CAMPAREE | camparee/annotation_info.py | annotation_info.py | py | 23,976 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "collections.defaultdict",
"line_number": 135,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 137,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 137,
"usage_type": "attribute"
},
{
"api_nam... |
31245688491 | import json
import requests
def api_get_request(url):
# In this exercise, you want to call the last.fm API to get a list of the
# top artists in Spain. The grader will supply the URL as an argument to
# the function; you do not need to construct the address or call this
# function in your grader submis... | diegoami/data_science_course_udacity | lastfm/last_fm_api.py | last_fm_api.py | py | 907 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 15,
"usage_type": "call"
}
] |
18044766309 | # -*- coding: utf-8 -*-
import numpy as np
import tensorflow as tf
print('TensorFlow version: %s' % tf.__version__)
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data', validation_size=0, one_hot=False)
img = mnist.train.images[2... | wangyarui/deep-learning | AutoEncoder/basicAE.py | basicAE.py | py | 2,037 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "tensorflow.__version__",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.examples.tutorials.mnist.input_data.read_data_sets",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tensorflow.examples.tutorials.mnist.input_data",
"li... |
25177944216 | import pickle, codecs, json, sys
def to_uni(stri):
try:
return stri.decode('unicode-escape')
except:
print(stri)
return None
def fixu_san(something):
if type(something) is dict:
new_something = {}
for key, value in something.items():
k = to_uni(key)
if k is None:
continue
new_something[k] = ... | mikahama/keinoleino | keinoleino/data/pickle2json.py | pickle2json.py | py | 850 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "pickle.load",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_number": ... |
32832804520 | from appium import webdriver
desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '9'
desired_caps['automationName'] = 'UiAutomator2'
desired_caps['deviceName'] = 'moto x4'
desired_caps['app'] = ('/home/candi/Downloads/PgConnect_release_1.7.0_270820_1004.apk')
desired_caps['appP... | candi-project/Automation_framework_Android | Appiumpython/AndroidDriver/DriverMethods.py | DriverMethods.py | py | 769 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "appium.webdriver.Remote",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "appium.webdriver",
"line_number": 12,
"usage_type": "name"
}
] |
33068123097 | import multiprocessing
import argparse
import cv2
import json
import numpy as np
import os
import tqdm
from functools import partial
def compute_char_height(file_name: str, inverse: bool):
if not os.path.exists(file_name):
raise Exception("File does not exist at {}".format(file_name))
img = cv2.imre... | OMMR4all/ommr4all-page-segmentation | ocr4all_pixel_classifier/scripts/compute_image_normalizations.py | compute_image_normalizations.py | py | 3,030 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "os.path.exists",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_GRAYSCALE",
"li... |
44296113157 | import pandas as pd #pip install pandas
import pyautogui as pg #pip install pyautogui
import time
import keyboard #pip install keyboard
import clipboard #pip install clipboard
from PIL import ImageGrab
import pytesseract #pip install pytesseract #pip install openpyxl
#file -> open -> ilgum -> ok클릭 -> "NEW WINDOW"... | WOOSEUNGHEE/ILBAN | main.py | main.py | py | 44,944 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pytesseract.pytesseract",
"line_number": 52,
"usage_type": "attribute"
},
{
"api_name": "pandas.DataFrame",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "pandas.read_excel",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "panda... |
2793736036 | # DOG & CAT DATASET USING CONVNET
import os, shutil
from keras import layers
from keras import models
from keras import optimizers
from keras.preprocessing.image import ImageDataGenerator
import matplotlib.pyplot as plt
original_dataset_dir = "C:/Users/david/Documents/Deep Learning Examples/dogs-vs-cats_Original/train... | davidruizhidalgo/unsupervisedRemoteSensing | 0_MATLAB/0_Initial Codes/codeBaseExamples Python/deepNetworksExamples/DogandCat.py | DogandCat.py | py | 3,393 | python | en | code | 13 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 1... |
32554298060 | import os
import base64
from urllib import quote_plus
import oauthlib.oauth1
from oauthlib.common import urldecode
import zope.interface
import zope.schema
from zope.component.hooks import getSite
from Products.CMFCore.utils import getToolByName
from pmr2.oauth.interfaces import OAuth1Error
from pmr2.oauth.interfac... | PMR2/pmr2.oauth | pmr2/oauth/utility.py | utility.py | py | 10,893 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "oauthlib.oauth1.oauth1",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "oauthlib.oauth1",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "zope.interface.interface.implements",
"line_number": 31,
"usage_type": "call"
},
{
"a... |
40020931063 | # Code to log 3 representative images for each class of (mnist, fashion_mnist) datasets in a wandb table
from keras.datasets import fashion_mnist, mnist
import wandb
datasets = [fashion_mnist, mnist]
names = ["fashion_mnist", "mnist"]
# label names for fashion_mnist and mnist respectively are added
fashion_mnist_label... | vikram-kv/cs6910_assignment1 | explore_dataset.py | explore_dataset.py | py | 1,782 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "keras.datasets.fashion_mnist",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "keras.datasets.mnist",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "wandb.init",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "wandb.Tabl... |
9650242020 | from sqlalchemy import Column, Integer, String, DATETIME, TEXT
from domain.database import Base
# Reply跟帖
class Reply(Base):
# 表的名字
__tablename__ = 'reply'
# 表的结构
replyId = Column(Integer(), primary_key=True, autoincrement=True)
content = Column(TEXT())
replyTime = Column(DATETIME()... | zhuxiyulu/sugar | domain/reply.py | reply.py | py | 1,381 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "domain.database.Base",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integer",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.C... |
35727190715 | import requests
from bs4 import BeautifulSoup
import csv
import re
headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:107.0) Gecko/20100101 Firefox/107.0",
"Accept-Language": "ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3"}
URL = 'https://sushishop.ru/'
def get_soup(url):
response = request... | katyammah/parsing | sushikatalog/parser_of_all.py | parser_of_all.py | py | 3,502 | python | ru | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "re.split",
"line_number... |
2083403876 | import copy
import datetime
import math
import os
import time
from typing import Any, Callable, Dict, List, Optional, Tuple
from pytorch_lightning.callbacks import ProgressBarBase
def n_lines(text: str) -> int:
return text.count("\n") + 1
def text_color(
style: Optional[int] = None, color: Optional[int] = ... | gorodnitskiy/yet-another-lightning-hydra-template | src/callbacks/light_progress_bar.py | light_progress_bar.py | py | 12,009 | python | en | code | 128 | github-code | 6 | [
{
"api_name": "typing.Optional",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_numbe... |
41555212912 | import os
import numpy as np
import librosa
import math
import json
from sklearn.model_selection import train_test_split
# Songdateiattribute
SAMPLE_RATE = 22050
DURATION = 30 # in sec
SAMPLES_PER_TRACK = SAMPLE_RATE * DURATION
# Iteriert den ganzen GTZAN-Datensatz, augmentiert diesen in num_segments, berechnet
#... | OfenPower/MusicGenreClassification | file_processor.py | file_processor.py | py | 13,525 | python | de | code | 1 | github-code | 6 | [
{
"api_name": "math.ceil",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 57,
"... |
22092331298 | from AIDetector_pytorch import Detector
import imutils
import cv2
import os
from collections import defaultdict
import tracker as tracker
import math
os.environ['KMP_DUPLICATE_LIB_OK']='True'
def main():
name = 'demo'
dict_box=dict()
global frames
#cap = cv2.VideoCapture('E:/视频/行人监控/test01.mp4'... | gonchild777/deepsort_speed | demo.py | demo.py | py | 3,141 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_PROP_FRAME_COUNT",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "AIDetec... |
7953677894 | import speech_recognition as sr
class SpeechToText:
def __init__(self):
self.r = sr.Recognizer()
self.m = sr.Microphone()
self.r.pause_threshold = 0.5
self.r.energy_threshold = 1500
self.value = None
self.changed = False
def listen(self):
try:
m = self.m
r = self.r
print("A moment of silence... | UmassHack/PyLingo | SpeechToText.py | SpeechToText.py | py | 1,470 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "speech_recognition.Recognizer",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "speech_recognition.Microphone",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "speech_recognition.UnknownValueError",
"line_number": 34,
"usage_type": "attrib... |
33123052896 | # -*- coding: utf-8 -*-
"""
Éditeur de Spyder
Ceci est un script temporaire.
"""
from sklearn import metrics
import matplotlib.pyplot as plt
from scipy import io
import bisect
import numpy as np
def readfile(file, test=True):
mat_file = io.loadmat(file)
X = mat_file['X']
if test:
Y = mat_file['pai... | florianriche/metric-learning-Challenge | utils.py | utils.py | py | 2,273 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "scipy.io.loadmat",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "scipy.io",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "sklearn.metrics.roc_curve",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics",... |
3661191052 | # Given an array nums and a target value k, find the maximum length of a subarray that sums to k. If there isn't one, return 0 instead.
# Note:
# The sum of the entire nums array is guaranteed to fit within the 32-bit signed integer range.
# Example 1:
# Input: nums = [1, -1, 5, -2, 3], k = 3
# Output: 4
# Explanat... | mrkr188/Interview-prep | Algorithms/Hash/325. Maximum Size Subarray Sum Equals k.py | 325. Maximum Size Subarray Sum Equals k.py | py | 1,194 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.defaultdict",
"line_number": 25,
"usage_type": "call"
}
] |
18847639844 | import json
import logging
import os
import re
import subprocess
import tempfile
import time
import uuid
import pytest
import requests
import yatest.common as yatest_common
from cloud.blockstore.config.server_pb2 import TServerConfig, \
TServerAppConfig, TKikimrServiceConfig
from cloud.blockstore.config.storage_pb... | ydb-platform/nbs | cloud/blockstore/tests/mount/test.py | test.py | py | 10,110 | python | en | code | 32 | github-code | 6 | [
{
"api_name": "yatest.common.binary_path",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "yatest.common",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "yatest.common.binary_path",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "yat... |
71840164989 | # coding=utf-8
import socket
import struct
from om.proxy import Salt
from om.models import SaltMinion
from ActionSpace.settings import logger, OM_ENV
from utils.models import Activity
import requests
def sh_zs():
ip = '10.17.144.44' if OM_ENV == 'PRD' else '10.25.161.122'
url = f'http://{ip}:8080/quotation/v1... | cash2one/ActionSpace | utils/util.py | util.py | py | 11,123 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "ActionSpace.settings.OM_ENV",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "utils.models.Activity.objects.filter",
"line_number": 18,
"usage_type": "call"
},
{
"api... |
41115747607 |
from sklearn import preprocessing
from sklearn.cluster import MiniBatchKMeans, DBSCAN
from sklearn.decomposition import PCA
import funs
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
if __name__ == '__main__':
########################################################################
# ... | jurajpaska8/SUNS2 | SUNS4.py | SUNS4.py | py | 8,768 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "funs.load_data",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "funs.load_data",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.merge",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "funs.load_data",
"line... |
37913434421 | from webapp import db
from sqlalchemy.sql.expression import and_
class AutoPilotHandlerModel(db.Model):
__tablename__ = 'auto_pilot_messages'
id = db.Column(db.BigInteger, primary_key=True)
timestamp = db.Column(db.DateTime)
current_task = db.Column(db.String(100))
memory = db.Column(db.String(40... | nocap69nautica/twilio_autopilot_sms_bot | src/models/auto_pilot_handler.py | auto_pilot_handler.py | py | 4,364 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "webapp.db.Model",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "webapp.db",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "webapp.db.Column",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "webapp.db",
"line_nu... |
25005628195 | """
irayalina.utils
===============
"""
from flask import request
from flask import render_template as render
def templated(template=None):
"""
https://flask.palletsprojects.com/patterns/viewdecorators.html#templating-decorator
Decorate view with this insted of returning render_template obj
"""
... | DENE-dev/dene-dev | RQ1-data/exp2/33-Unviray@1Alina-54f96961011bd209f0e5a08909d2adeccf3ad994/irayalina/utils.py | utils.py | py | 846 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.request.endpoint.replace",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "flask.request.endpoint",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 22,
"usage_type": "name"
},
{
"api_name... |
34479350900 | from enum import Enum
class DirectionKeyEnum(str, Enum):
UP = "Up"
DOWN = "Down"
LEFT = "Left"
RIGHT = "Right"
def decodeKeyPress(e: object) -> DirectionKeyEnum | None:
key: str = e.keysym
try:
return DirectionKeyEnum(key)
except:
return None
| Andrew-Hird/py-snake | key_press_util.py | key_press_util.py | py | 304 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "enum.Enum",
"line_number": 3,
"usage_type": "name"
}
] |
809234218 | import json
import os
# Prepare a txt file to insert the data into the database
db = open('db_inserts.sql', 'a')
# get a list of all json files
files = []
directory = 'outputs\\'
j = 0
for fname in os.listdir(directory):
if fname.endswith(".txt"):
files.append(fname)
j += 1
# open ... | AndrewVCoding/cv-corpus-script-generator | data_entry.py | data_entry.py | py | 1,613 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.listdir",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "json.decoder",
"line_number": 41,
"usage_type": "attribute"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.