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
72532789629
from datetime import datetime from enum import auto from typing import Final from uuid import uuid4 from models_library.users import UserID from models_library.utils.enums import StrAutoEnum from pydantic import BaseModel, NonNegativeInt, validator MAX_NOTIFICATIONS_FOR_USER_TO_SHOW: Final[NonNegativeInt] = 10 MAX_NO...
ITISFoundation/osparc-simcore
services/web/server/src/simcore_service_webserver/users/_notifications.py
_notifications.py
py
3,946
python
en
code
35
github-code
6
[ { "api_name": "typing.Final", "line_number": 10, "usage_type": "name" }, { "api_name": "pydantic.NonNegativeInt", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.Final", "line_number": 11, "usage_type": "name" }, { "api_name": "pydantic.NonNegativ...
32510456439
# -*- coding: utf-8 -*- """ Created on May 19 2020 @author: hpaliwal, edited by candisehenry """ import os import numpy as np from scipy.interpolate import griddata def interp_wind(folder, infile, outfile, step, coord): # Get wind power density file wd = os.getcwd() windfile = wd + '/Output...
candisehenry/SEERE_Henry_et_al_2021
c_interp_wind.py
c_interp_wind.py
py
1,439
python
en
code
0
github-code
6
[ { "api_name": "os.getcwd", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.genfromtxt", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.arange", "line_numb...
2279763110
from setuptools import setup, find_packages import platform import os data_files = [('/etc/cdmiproxy', ['vcdm-linux.conf', 'vcdm-defaults.conf', 'users.db', 'users.db.md5']), ('/etc/cdmiproxy/server_credentials', ['server_credentials/cer...
livenson/vcdm
setup.py
setup.py
py
1,221
python
en
code
14
github-code
6
[ { "api_name": "platform.system", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "setuptools.setup", "lin...
11924515899
""" Compute the transformation between odometry and map. Author: Annaleah Ernst """ import rospy import tf import numpy as np from ar_track_alvar_msgs.msg import AlvarMarkers from copy import deepcopy from geometry_msgs.msg import PointStamped, PoseStamped, Pose, QuaternionStamped, Point, Quaternion from math...
haelannaleah/autoturtle
localization.py
localization.py
py
14,074
python
en
code
2
github-code
6
[ { "api_name": "tf_transformer.TfTransformer", "line_number": 20, "usage_type": "name" }, { "api_name": "math.pi", "line_number": 41, "usage_type": "name" }, { "api_name": "tf_transformer.TfTransformer.__init__", "line_number": 46, "usage_type": "call" }, { "api_na...
16510594678
#!/usr/bin/env python3 ''' This script is for making communication between server and clients like : sending commands, encryption, decryption &... ''' from colorama import Fore import socket import re codes_list = { 'exec':'1', '1':'exec', '__comment__get_os':'cid=2, does not have second part (for reques...
nxenon/c2x
modules/communicator.py
communicator.py
py
4,032
python
en
code
13
github-code
6
[ { "api_name": "colorama.Fore.GREEN", "line_number": 55, "usage_type": "attribute" }, { "api_name": "colorama.Fore", "line_number": 55, "usage_type": "name" }, { "api_name": "colorama.Fore.RESET", "line_number": 56, "usage_type": "attribute" }, { "api_name": "color...
22050552907
#!/usr/bin/python import math as m import matplotlib.pyplot as plt fx = input("fx: ") fy = input("fy: ") Ax = input("Ax: ") Ay = input("Ay: ") phi = input("phi: ") dt = input("Delta t: ") N = input("N: ") t = [dt * i for i in range(0, N+1)] X = [Ax * m.cos(2 * m.pi * fx * i) for i in t] Y = [Ay * m.sin(2 * m.pi * f...
bryance-oyang/ph20
1/2_vanilla.py
2_vanilla.py
py
707
python
en
code
0
github-code
6
[ { "api_name": "math.cos", "line_number": 16, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 16, "usage_type": "attribute" }, { "api_name": "math.sin", "line_number": 17, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 17, "...
37577948452
# -*- coding: utf-8 -*- """ Created on Fri Jun 21 12:56:22 2019 @author: luanpo1234 """ import string from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.metrics.pairwise import cosine_similarity def preprocess(text): #Remove punctuation text = text.translate(str.maketrans('', '', string...
luanpo1234/tfidf_cosine_similarity
tfidf_similarity.py
tfidf_similarity.py
py
1,971
python
en
code
1
github-code
6
[ { "api_name": "string.punctuation", "line_number": 14, "usage_type": "attribute" }, { "api_name": "sklearn.feature_extraction.text.TfidfVectorizer", "line_number": 32, "usage_type": "call" }, { "api_name": "sklearn.metrics.pairwise.cosine_similarity", "line_number": 34, "...
29127916008
from django.core.urlresolvers import reverse from django.utils import timezone from annoying.functions import get_object_or_None from schedule.models import Event def querystring_for_date(date, num=3): query_string = '?' qs_parts = ['year=%d', 'month=%d', 'day=%d', 'hour=%d', 'minute=%d', 'second=%d'] qs...
TimBest/ComposersCouch
schedule/templatetags/ext.py
ext.py
py
1,895
python
en
code
1
github-code
6
[ { "api_name": "django.core.urlresolvers.reverse", "line_number": 17, "usage_type": "call" }, { "api_name": "django.core.urlresolvers.reverse", "line_number": 22, "usage_type": "call" }, { "api_name": "annoying.functions.get_object_or_None", "line_number": 29, "usage_type"...
34520195860
#imports import os, sys import traceback import pandas as PD import numpy as NP import logging file_name = __file__ + '.txt' logging.basicConfig( level = logging.DEBUG , filename = file_name , filemode = 'w', format = '%(asctime)s - %(message)s' ) #_text = 'I bought a Toyota Corala in January...
snehaliz/Sunware-Technologies-Projects
Question Answering applications.py
Question Answering applications.py
py
3,166
python
en
code
0
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 59, "usage_type": "attribute" }, { "api_name": "transformers.pi...
4485528029
# -*- coding: utf-8 -*- from userLogin import login from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import Select from selenium.common.exceptions import NoSuchElementException from selenium.common.except...
susanpray/python
webSelenium/del_Mining.py
del_Mining.py
py
1,474
python
en
code
0
github-code
6
[ { "api_name": "selenium.webdriver.Firefox", "line_number": 17, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 17, "usage_type": "name" }, { "api_name": "userLogin.login", "line_number": 21, "usage_type": "call" }, { "api_name": "time.sl...
37797882894
from cryptography.hazmat.primitives import serialization def savePrivateKeyAndCertificate(privateKey, certificate, certificateSubject): private_key_pem = privateKey.private_bytes( encoding=serialization.Encoding.PEM, format=serialization.PrivateFormat.PKCS8, encryption_algorithm=serializat...
cenkkg/SecureMessagingProtocol
Generator/SaveProvateKeyAndCertificate.py
SaveProvateKeyAndCertificate.py
py
781
python
en
code
0
github-code
6
[ { "api_name": "cryptography.hazmat.primitives.serialization.Encoding", "line_number": 6, "usage_type": "attribute" }, { "api_name": "cryptography.hazmat.primitives.serialization", "line_number": 6, "usage_type": "name" }, { "api_name": "cryptography.hazmat.primitives.serializatio...
15493745094
from imports import * from math import ceil import itertools, pylab import matplotlib.ticker as mticker sns.set_theme(context="talk", palette="bright", style="whitegrid") DESIGN_NAMES = [ "BG_L2_L4_00_L3_00_L2_00_DVAFS_0", "BG_L2_L4_00_L3_00_L2_10_DVAFS_0", "BG_L2_L4_00_L3_00_L2_11_DVAFS_0", "BG_L2_L4...
KULeuven-MICAS/PSMA-benchmark
auto_framework/plotting_functions.py
plotting_functions.py
py
18,862
python
en
code
5
github-code
6
[ { "api_name": "math.ceil", "line_number": 186, "usage_type": "call" }, { "api_name": "itertools.chain", "line_number": 263, "usage_type": "call" }, { "api_name": "matplotlib.ticker.ScalarFormatter", "line_number": 322, "usage_type": "call" }, { "api_name": "matplo...
22358684386
import re import collections import transition keywords = { "title": "raw", "source": "raw", "note": "raw", "init": "recurse", "view": "space", "show": "space", "hide": "space", "duration": "space", "select": "comma", ":": "raw", } com = ";" def parse(s, sep, com = None): # Separates a line on `sep`, skip...
showermat/pres
conffmt.py
conffmt.py
py
3,782
python
en
code
0
github-code
6
[ { "api_name": "re.match", "line_number": 40, "usage_type": "call" }, { "api_name": "re.match", "line_number": 41, "usage_type": "call" }, { "api_name": "re.split", "line_number": 59, "usage_type": "call" }, { "api_name": "re.match", "line_number": 77, "usa...
36633610498
from django.shortcuts import render, redirect from .models import Post, Category, Tag, Comment from django.views.generic import ListView, DetailView, CreateView, UpdateView from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin from django.core.exceptions import PermissionDenied from django.util...
SeowonPark001/Django_2022
blog/views.py
views.py
py
11,042
python
ko
code
0
github-code
6
[ { "api_name": "rest_framework.viewsets.ModelViewSet", "line_number": 17, "usage_type": "attribute" }, { "api_name": "rest_framework.viewsets", "line_number": 17, "usage_type": "name" }, { "api_name": "models.Post.objects.all", "line_number": 19, "usage_type": "call" }, ...
35074265850
from django.urls import path from .views import ( ArticleAdmin, ArticleWriter, Article_Tage, ArtticleViewCreate, CategoryAPIView,CategoryCreateView, CommentAPIView, CommentCreateAPI, DisLIke, LikeCreate, ListArticlePublish, TagAPIView, TagCreateView , health) app_name='blog' urlpatter...
pantaLuc/Block_Etech_backend
blog/urls.py
urls.py
py
1,587
python
en
code
1
github-code
6
[ { "api_name": "django.urls.path", "line_number": 13, "usage_type": "call" }, { "api_name": "views.ListArticlePublish.as_view", "line_number": 13, "usage_type": "call" }, { "api_name": "views.ListArticlePublish", "line_number": 13, "usage_type": "name" }, { "api_na...
3602688977
""" Description: 使用 Bokeh,基于各国家创建一个 CPI 和童工数据的散点图。 拓展: ①:Bokeh 有一个很好的示例库(http://bokeh.pydata.org/en/latest/docs/gallery.html)和可用的代 码来帮助你上手。建议你花些时间在图表上,尝试一下Bokeh。 """ from bokeh.plotting import ColumnDataSource, figure, show, output_file # 导入我们用过的主要的库,并导入 ColumnDataSource和HoverTool 类。 from bokeh.models import Hov...
lafitehhq/PythonBook
Python-03数据处理/Reference/code/chp10-presentation-数据展示/chart_bokeh_interactive_使用Bokeh绘图2.0.py
chart_bokeh_interactive_使用Bokeh绘图2.0.py
py
2,486
python
zh
code
2
github-code
6
[ { "api_name": "bokeh.plotting.figure", "line_number": 25, "usage_type": "call" }, { "api_name": "bokeh.plotting.output_file", "line_number": 28, "usage_type": "call" }, { "api_name": "bokeh.plotting.ColumnDataSource", "line_number": 31, "usage_type": "call" }, { "...
15883394393
#!/usr/bin/python # coding=utf-8 import mechanize from bs4 import BeautifulSoup company = '江苏龙灯化学有限公司' company = company.decode('utf8') company = company.encode('gb2312') url = 'http://www.chinapesticide.gov.cn/service/aspx/B2.aspx' ref = 'http://www.chinapesticide.gov.cn/service/aspx/' br = mechanize.Browser() br....
zjc-enigma/webscraping
1.py
1.py
py
936
python
en
code
0
github-code
6
[ { "api_name": "mechanize.Browser", "line_number": 14, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 32, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 38, "usage_type": "call" } ]
24840768794
from datetime import datetime import numpy as np import pandas_datareader.data as web import pandas as pd import os import time as t import sys #Go to Alpha Vantage website to recieve your free API key and fill in the key into the "" marks below API_Key = "" #Insert your API key here def FillDatar...
tylerpeller/Stock_Data_Import
Stock_Importer.py
Stock_Importer.py
py
2,464
python
en
code
1
github-code
6
[ { "api_name": "pandas_datareader.data.DataReader", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas_datareader.data", "line_number": 15, "usage_type": "name" }, { "api_name": "sys.exit", "line_number": 29, "usage_type": "call" }, { "api_name": "dat...
72784203387
# https://www.codewars.com/kata/53d2c97d7152a59b64001033 import sqlite3 conn = sqlite3.connect('/tmp/movies.db') cur = conn.cursor() cur.execute("""create table MOVIES (Id integer, Name varchar(100), Year integer, Rating integer)""") conn.commit() data = [(1, 'Rise of the Planet of the Apes', 2011, 77), (2, 'Dawn ...
blzzua/codewars
6-kyu/i_liked_the_sql_better.py
i_liked_the_sql_better.py
py
683
python
en
code
0
github-code
6
[ { "api_name": "sqlite3.connect", "line_number": 5, "usage_type": "call" } ]
37020303421
import nltk import csv from collections import defaultdict, Counter from nltk.corpus import movie_reviews from nltk.sentiment.vader import SentimentIntensityAnalyzer from bs4 import BeautifulSoup from dateutil import parser as dtparser from datetime import timedelta def get_stock_dates(ticker): dates = set() ...
lkgarrison/stock-prediction
scripts/naive_sentiment.py
naive_sentiment.py
py
3,744
python
en
code
0
github-code
6
[ { "api_name": "csv.DictReader", "line_number": 14, "usage_type": "call" }, { "api_name": "dateutil.parser.parse", "line_number": 16, "usage_type": "call" }, { "api_name": "dateutil.parser", "line_number": 16, "usage_type": "name" }, { "api_name": "nltk.download", ...
7923678967
import requests import os import csv def do_load_media(url, path, num, year): try: headers = { "User-Agent": "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Maxthon/4.3.2.1000 Chrome/30.0.1599.101 Safari/537.36"} pre_content_length = 0 # 循环...
Saxon-Huang/EECS498_presentation_rating_system
archive/crawl.py
crawl.py
py
4,757
python
en
code
0
github-code
6
[ { "api_name": "os.path.exists", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.getsize", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_numbe...
3499548879
from typing import List, Optional # Definition for a binary tree node. class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right class Solution: def sortedArrayToBST(self, nums: List[int]) -> Optional[TreeNode]: ...
maxpetretta/leetcode
convert-sorted-array-to-binary-search-tree.py
convert-sorted-array-to-binary-search-tree.py
py
1,014
python
en
code
1
github-code
6
[ { "api_name": "typing.List", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 13, "usage_type": "name" } ]
75112274108
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # @Date : 2018-2-9 # @Author : foodish # @File : year_report_gui.py import tkinter import urllib.request import urllib.parse import json import re from os import mkdir from os.path import exists import time pattern = re.compile(pattern='[0-9]{6}') headers = {'User...
foodish/FinanceTools
sh_sz_stock_report_downloader/year_report_gui.py
year_report_gui.py
py
6,827
python
en
code
21
github-code
6
[ { "api_name": "re.compile", "line_number": 16, "usage_type": "call" }, { "api_name": "tkinter.Tk", "line_number": 29, "usage_type": "call" }, { "api_name": "tkinter.Label", "line_number": 34, "usage_type": "call" }, { "api_name": "tkinter.W", "line_number": 35...
74158758589
import cv2 import numpy as np import os import matplotlib.pyplot as plt from functions import resize_img path = 'data' file_list = os.listdir(path) file_list.sort() X_train = [] y_train = [] for file_path in file_list: file_name, ext = os.path.splitext(file_path) print(file_name, ext) if (ext == '.npy...
ha4219/doggod
a.py
a.py
py
920
python
en
code
1
github-code
6
[ { "api_name": "os.listdir", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.splitext", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "numpy.load", "line_numbe...
13976988655
# coding: utf-8 # In[1]: # Preamble get_ipython().magic('matplotlib inline') import pandas as pd import matplotlib.pyplot as plt import numpy as np import os from bs4 import BeautifulSoup import requests, sys, codecs, re # Make the graphs a bit prettier, and bigger pd.set_option('display.mpl_style', 'default') # T...
iainharlow/English-Football-Managers
Manager Webscrape.py
Manager Webscrape.py
py
4,382
python
en
code
0
github-code
6
[ { "api_name": "pandas.set_option", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.set_option", "line_number": 20, "usage_type": "call" }, { "api_name": "pandas.set_option", "line_number": 21, "usage_type": "call" }, { "api_name": "matplotlib.pypl...
17723359773
# -*- coding: utf-8 -*- # Define here the models for your scraped items # # See documentation in: # https://doc.scrapy.org/en/latest/topics/items.html from scrapy import Field, Item class NewsItem(Item): collection = 'maoyan' rank = Field() movie_name = Field() actor = Field() time = Field() ...
zhangjuynag96/maoyan_webspider
scrapy_maoyan/items.py
items.py
py
339
python
en
code
0
github-code
6
[ { "api_name": "scrapy.Item", "line_number": 10, "usage_type": "name" }, { "api_name": "scrapy.Field", "line_number": 12, "usage_type": "call" }, { "api_name": "scrapy.Field", "line_number": 13, "usage_type": "call" }, { "api_name": "scrapy.Field", "line_number...
70091369468
from collections import Counter import datetime as dt import argparse import matplotlib.pyplot as plt import numpy as np import pandas as pd import pathlib import seaborn as sns from sklearn.cluster import AgglomerativeClustering from sklearn.cluster import KMeans from sklearn.metrics import silhouette_score from scipy...
A-baoYang/NCCU_MIS_thesis-OM_sequence_analysis
Cainiao/cainiao-clusterMetrics.py
cainiao-clusterMetrics.py
py
11,775
python
en
code
0
github-code
6
[ { "api_name": "warnings.filterwarnings", "line_number": 14, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 40, "usage_type": "call" }, { "api_name": "datetime.date.today", "line_number": 41, "usage_type": "call" }, { "api_name": "d...
1356138121
from typing import Any, Dict, List, Type, TypeVar, Union import attr from ..types import UNSET, Unset T = TypeVar("T", bound="QueryStatisticsStoreChunk") @attr.s(auto_attribs=True) class QueryStatisticsStoreChunk: """ Attributes: head_chunk_bytes (int): head_chunk_lines (int): decom...
expobrain/python-loki-client
grafana_loki_client/models/query_statistics_store_chunk.py
query_statistics_store_chunk.py
py
3,018
python
en
code
8
github-code
6
[ { "api_name": "typing.TypeVar", "line_number": 7, "usage_type": "call" }, { "api_name": "typing.Union", "line_number": 27, "usage_type": "name" }, { "api_name": "types.Unset", "line_number": 27, "usage_type": "name" }, { "api_name": "types.UNSET", "line_number...
45254767216
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Sep 26 2022 20:34:00 @author: Tom Kirsh """ # Import Useful Libraries import time start = time.time() from pathlib import Path import os import sys import pickle import json import scipy.io as sio import numpy as np import matplotlib.pyplot as plt from...
tk27182/masters-thesis
Code/run_test_nn.py
run_test_nn.py
py
6,563
python
en
code
0
github-code
6
[ { "api_name": "time.time", "line_number": 11, "usage_type": "call" }, { "api_name": "tensorflow.random.set_seed", "line_number": 38, "usage_type": "call" }, { "api_name": "tensorflow.random", "line_number": 38, "usage_type": "attribute" }, { "api_name": "dataproce...
922927114
import setuptools with open('readme.md', 'r') as readme: long_description = readme.read() setuptools.setup( name='cl_args', version='1.0.0', author='Senhung Wong <0x53656e@gmail.com>', description='A python command line interface package.', long_description=long_description, long_descripti...
5u4/command-line-args
setup.py
setup.py
py
624
python
en
code
1
github-code
6
[ { "api_name": "setuptools.setup", "line_number": 6, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 14, "usage_type": "call" } ]
42664211207
""" Zero Knowledge SLAM implementation in Python3 @author: nitrodegen @date: 9 July 2022. """ import cv2 import numpy as np import os,io,sys import sdl2 from multiprocessing import Process,Manager,Value,Array,Queue,Pipe from math import * import pygame from pygame.locals import * import m...
nitrodegen/TinySLAM
slam.py
slam.py
py
6,371
python
en
code
1
github-code
6
[ { "api_name": "multiprocessing.Queue", "line_number": 50, "usage_type": "call" }, { "api_name": "multiprocessing.Process", "line_number": 51, "usage_type": "call" }, { "api_name": "multiprocessing.Process", "line_number": 52, "usage_type": "call" }, { "api_name": ...
14469038013
''' Design a data structure that supports the following two operations: void addWord(word) bool search(word) search(word) can search a literal word or a regular expression string containing only letters a-z or .. A . means it can represent any one letter. Example: addWord("bad") addWord("dad") addWord("mad") search(...
loganyu/leetcode
problems/211_add_and_search_word-data_structure_design.py
211_add_and_search_word-data_structure_design.py
py
1,921
python
en
code
0
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 25, "usage_type": "call" } ]
13761753730
# # A script to analyse how the enjoyment changed between experiment 1 and 2. # # We're mainly interested in the game condition, as we made a bunch of game # design/interface/graphical improvements and want to see if they paid off. # However, there were no dramatic changes, so not expecting much. # # Overall, no signi...
davidgundry/intrinsic-elicitation-between
python/enjoyment_between.py
enjoyment_between.py
py
3,486
python
en
code
0
github-code
6
[ { "api_name": "seaborn.set", "line_number": 25, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 30, "usage_type": "call" }, { "api_name": "scipy.stats.mannwhitneyu", "line_number": 42, "usage_type": "call" }, { "api_name": "statistics.stdev...
32726057319
import json import numpy as np from functools import reduce import logging from umcog.confutils import extended_kwprop, KWProp as prop, xargs def LOG(): return logging.getLogger(__name__) def info(msg, extra=dict(tag="human", data={})): LOG().info(msg, extra=extra) def mean(l): return sum(l) / max(len(l...
wecacuee/floyd-warshal-rl
fwrl/game/metrics.py
metrics.py
py
7,453
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.quantile", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.quantile", "l...
7087887902
from django.shortcuts import render, redirect from django.http import HttpResponse from django.contrib.auth.models import User from django.contrib.auth import authenticate, login, logout from .forms import ImageForm, LoginForm from .models import Image from .cbsdanalyzer import * import json import os import csv import...
solomonnsumba/Necrosis-_Web_Server
necrosis/views.py
views.py
py
4,689
python
en
code
1
github-code
6
[ { "api_name": "os.path.dirname", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 14, "usage_type": "call" }, { "api_name": "django.shortcuts.render"...
50293691
from typing import * from collections import defaultdict class Solution: def maximumSum(self, nums: List[int]) -> int: def num2sum(num): ans = 0 while num > 0: ans += num % 10 num //= 10 return ans ans = -1 dt = de...
code-cp/leetcode
solutions/6164/main.py
main.py
py
758
python
en
code
0
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 13, "usage_type": "call" } ]
2484504392
import random from django.views.generic import View from django.views.generic.detail import DetailView from django.shortcuts import render # Create your views here. from utpshare.mixins import LoginRequiredMixin from products.models import Product from orders.models import Order class UserDashboardView(View): def...
mfrashad/utpshare2.0
src/user/views.py
views.py
py
2,006
python
en
code
0
github-code
6
[ { "api_name": "django.views.generic.View", "line_number": 13, "usage_type": "name" }, { "api_name": "products.models", "line_number": 16, "usage_type": "name" }, { "api_name": "products.models", "line_number": 26, "usage_type": "name" }, { "api_name": "products.mo...
23135793100
import smtplib from email.mime.application import MIMEApplication from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText def gmail(subject,content,attach): html = content msg = MIMEMultipart() # 使用多種格式所組成的內容 msg.attach(MIMEText(html, 'html', 'utf-8')) ...
GOCAR86353/certification_apply
mailwithattach_example.py
mailwithattach_example.py
py
1,069
python
en
code
0
github-code
6
[ { "api_name": "email.mime.multipart.MIMEMultipart", "line_number": 9, "usage_type": "call" }, { "api_name": "email.mime.text.MIMEText", "line_number": 10, "usage_type": "call" }, { "api_name": "email.mime.application.MIMEApplication", "line_number": 14, "usage_type": "cal...
73052160508
import csv import xlwt from django.contrib.auth.mixins import LoginRequiredMixin from django.http import HttpResponse from django.urls import reverse_lazy from django.views.generic import ListView, UpdateView, DeleteView, CreateView from .models import Permissao from django.views import View class PermissaoList(Logi...
fgomesc/csc_system
apps/permissao/views.py
views.py
py
2,069
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.auth.mixins.LoginRequiredMixin", "line_number": 12, "usage_type": "name" }, { "api_name": "django.views.generic.ListView", "line_number": 12, "usage_type": "name" }, { "api_name": "models.Permissao", "line_number": 13, "usage_type": "name" ...
30471374635
#!/usr/bin/env python3 import sklearn.datasets as datasets import numpy as np def predict(X, w, y = None): # X_new: Nsample x (d+1) # w: (d+1) x 1 # y_new: Nsample # print("\n\n") # print(y) numSamples = len(X) # y_hat = np.polyval(w, X) y_hat = np.dot(X, w) # print(y_hat) ...
yeungngai/cs466
A1/Q2a_TODO.py
Q2a_TODO.py
py
3,254
python
en
code
0
github-code
6
[ { "api_name": "numpy.dot", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 35, ...
16583916014
import datetime as dt from django.shortcuts import get_object_or_404 from rest_framework import serializers from rest_framework.validators import UniqueValidator from reviews.models import Category, Comment, Genre, Review, Title from users.models import CustomUser class UserSerializer(serializers.ModelSerializer): ...
Darel22/yamdb_final
api_yamdb/api/serializers.py
serializers.py
py
4,904
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 11, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 11, "usage_type": "name" }, { "api_name": "rest_framework.serializers.EmailField", "line_number": 13, "us...
374651197
#!/usr/bin/env python3 import sys import os import time import itertools class labrat(): def __init__(self): self.ssh_user = 'idfoster' self.debug = True def finger(self,import_id,server_id, server): #code for updating the IP #userless, uses current user and keys cmd = 'ssh -oConnectTimeou...
lanrat/halpz.me
labrat/crawl_test.py
crawl_test.py
py
3,194
python
en
code
0
github-code
6
[ { "api_name": "os.popen", "line_number": 22, "usage_type": "call" }, { "api_name": "itertools.groupby", "line_number": 40, "usage_type": "call" } ]
3821203011
# Код к задаче 1 import requests import json url = "https://akabab.github.io/superhero-api/api/all.json" resp = requests.get(url) with open('heroes.json', 'w') as h: h.write(resp.text) with open('heroes.json') as h: resp_text = json.load(h) comparing_heroes = {} for hero in resp_text: if hero['name'] in...
ArtemBalu/requests
main.py
main.py
py
1,711
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 7, "usage_type": "call" }, { "api_name": "json.load", "line_number": 13, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 35, "usage_type": "call" }, { "api_name": "requests.put", "line_number": ...
39380947851
# -*- coding: utf-8 -*- """ Created on Wed Mar 15 15:51:37 2017 @author: jtay """ # Imports import pandas as pd import numpy as np from sklearn.preprocessing import StandardScaler from sklearn.pipeline import Pipeline from helpers import nn_arch,nn_reg from matplotlib import cm from sklearn.neural_network import MLP...
SenRamakri/CS-7641-Assignment-3
PCA.py
PCA.py
py
2,713
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.cm.get_cmap", "line_number": 21, "usage_type": "call" }, { "api_name": "matplotlib.cm", "line_number": 21, "usage_type": "name" }, { "api_name": "numpy.random.seed", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.random",...
1489844568
from django.contrib import admin from django.urls import path from WhiteMarket.apps.products import views urlpatterns = [ path('products/', views.ProductList.as_view(), name=views.ProductList.name), path('products/like/<int:pk>', views.ProductLike.as_view(), name=views.ProductLike.name), path('products...
oscll/WhiteMarket
server/WhiteMarket/WhiteMarket/apps/products/urls.py
urls.py
py
669
python
en
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "WhiteMarket.apps.products.views.ProductList.as_view", "line_number": 6, "usage_type": "call" }, { "api_name": "WhiteMarket.apps.products.views.ProductList", "line_number": 6, "usage...
6231763116
import random from slackbot.bot import respond_to from sqlalchemy.orm import join from db import Session from haro.arg_validator import ( BaseArgValidator, ValidationError, register_arg_validator, ) from haro.botmessage import botsend, webapisend from haro.decorators import call_when_sls_haro_not_installed...
beproud/beproudbot
src/haro/plugins/create.py
create.py
py
12,839
python
ja
code
14
github-code
6
[ { "api_name": "haro.arg_validator.BaseArgValidator", "line_number": 42, "usage_type": "name" }, { "api_name": "db.Session", "line_number": 50, "usage_type": "call" }, { "api_name": "haro.plugins.create_models.CreateCommand", "line_number": 51, "usage_type": "argument" }...
80889751
# example from: https://pytorch-lightning.readthedocs.io/en/latest/notebooks/lightning_examples/mnist-hello-world.html # adds on from https://pytorch-lightning.readthedocs.io/en/latest/starter/introduction_guide.html import os import sys import torch from pytorch_lightning import LightningModule, LightningDataModule f...
Code-Cornelius/CorAI
corai/tests/pytorch_light/classes_mnist_with_comments.py
classes_mnist_with_comments.py
py
7,084
python
en
code
3
github-code
6
[ { "api_name": "os.environ.get", "line_number": 18, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 18, "usage_type": "attribute" }, { "api_name": "torch.cuda.device_count", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.cuda", ...
29389599209
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: daisuke """ import gym import numpy as np import math import random import matplotlib.pyplot as plt import operator def Policy_function(action, state, mu, sigma): """ 政策を表す関数 """ factor1 = 1 / (sigma * math.sqrt(2 * math.pi)) factor2 = - (action ...
tsumita/RL
Pendulum.py
Pendulum.py
py
5,230
python
en
code
0
github-code
6
[ { "api_name": "math.sqrt", "line_number": 16, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 16, "usage_type": "attribute" }, { "api_name": "numpy.dot", "line_number": 17, "usage_type": "call" }, { "api_name": "math.exp", "line_number": 18, ...
19400849039
# Based spiritually on "Emerging Images" by Niloy J. Mitra, Hung-Kuo Chu, # Tong-Yee Lee, Lior Wolf, Hezy Yeshurun, Daniel Cohen-Or. # Parts of the code are blatantly stolen from opencv sample code. # You are free to do whatever you like with this code, but nothing dirty ;) import cv2 import numpy as np impo...
yigals/livemerge
livemerge.py
livemerge.py
py
5,063
python
en
code
0
github-code
6
[ { "api_name": "cv2.namedWindow", "line_number": 31, "usage_type": "call" }, { "api_name": "cv2.WINDOW_NORMAL", "line_number": 31, "usage_type": "attribute" }, { "api_name": "cv2.namedWindow", "line_number": 32, "usage_type": "call" }, { "api_name": "cv2.WINDOW_NOR...
12547385401
import logging import os from django_q.models import Schedule from django.contrib import messages from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from django.utils.safestring import mark_safe from projects.models import Simulation from projects.requests import fetch_mvs_simulatio...
FredericHirschmueller/gui
app/projects/services.py
services.py
py
4,299
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 18, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 19, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": ...
23042409707
# -*- coding: utf-8 -*- # Author - Sam DeFrancisco """ Update mysql tables East_Standings West_Standings Update Games_Today table (scores, time left in games) My intention is for this to run often to keep website updated once integerated to db """ import sqlite3 import pandas as pd # own api's from utils from gs...
sjdefran1/GoSports
backend/db_scripts/game_standings.py
game_standings.py
py
1,343
python
en
code
1
github-code
6
[ { "api_name": "sqlite3.connect", "line_number": 20, "usage_type": "call" }, { "api_name": "gs_api.game_api.games_today", "line_number": 27, "usage_type": "call" }, { "api_name": "gs_api.game_api.get_standings", "line_number": 33, "usage_type": "call" }, { "api_nam...
73816591866
"""Contains all logic to handle changes to posts in the help forum.""" import textwrap from datetime import timedelta import arrow import discord from pydis_core.utils import members, scheduling import bot from bot import constants from bot.exts.help_channels import _stats from bot.log import get_logger log = get_lo...
python-discord/bot
bot/exts/help_channels/_channel.py
_channel.py
py
11,221
python
en
code
1,206
github-code
6
[ { "api_name": "bot.log.get_logger", "line_number": 14, "usage_type": "call" }, { "api_name": "bot.constants.Bot", "line_number": 28, "usage_type": "attribute" }, { "api_name": "bot.constants", "line_number": 28, "usage_type": "name" }, { "api_name": "bot.constants...
14894996823
import json import os from datetime import datetime, timedelta from bs4 import BeautifulSoup import requests as r URL = 'http://urgent.fm/' LIVE_URl = 'http://urgent.fm/listen_live.config' FILENAME = 'urgentfm/status.json' def get_program(): p = r.get(URL) b = BeautifulSoup(p.text, 'html.parser') return ...
daveromana2/hydra
scraper/urgentfm.py
urgentfm.py
py
922
python
en
code
null
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": "requests.get", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.dirname", "li...
30347126161
from django.urls import path from . import views urlpatterns = [ path('', views.ListPost.as_view()), path('<int:pk>/', views.DetailPost.as_view()), path('signup', views.SignUp), path('login', views.LogIn), path('study', views.EnterArticle), path('title/', views.title), path('Step1/', views...
GeulNoon/server
geulnoon/urls.py
urls.py
py
852
python
en
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", ...
21758391942
import torch from torch.nn import Sequential as Seq, Linear, ReLU import numpy as np from torch.utils.data import DataLoader from torch_geometric.utils import scatter_ from factor_graph import FactorGraph from sat_helpers.sat_data import parse_dimacs, SatProblems, build_factorgraph_from_SATproblem from utils import dot...
jkuck/BPNN
old_code/loopyBP_factorGraph_broken.py
loopyBP_factorGraph_broken.py
py
29,125
python
en
code
13
github-code
6
[ { "api_name": "factor_graph.numFactors", "line_number": 30, "usage_type": "attribute" }, { "api_name": "factor_graph.numVars", "line_number": 30, "usage_type": "attribute" }, { "api_name": "torch.index_select", "line_number": 53, "usage_type": "call" }, { "api_nam...
44762193314
import json import matplotlib.pyplot as plt import numpy as np if __name__ == '__main__': ###################File loading####################################### file=open('anonymized_project.json') data = json.load(file) file=open('references.json') reference = json.load(file) file.close() ...
lis55/bycycle_dataset
bycycle.py
bycycle.py
py
3,556
python
en
code
0
github-code
6
[ { "api_name": "json.load", "line_number": 9, "usage_type": "call" }, { "api_name": "json.load", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.hist", "line_number": 89, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "li...
31061111452
import subprocess from os import path, environ, makedirs from tempfile import gettempdir from struct import calcsize try: from os import getuid except: # Windows does not have getuid(), so define to simply return 'tmp' def getuid(): return 'tmp' def get_package_dir(): return path.abspath(path....
karolinedubin/parcels
parcels/compiler.py
compiler.py
py
2,731
python
en
code
null
github-code
6
[ { "api_name": "os.path.abspath", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.join", "line_numb...
1538805187
# Imports import cv2 import threading import numpy as np from mss import mss # Tensorflow import tensorflow as tf import tensorflow.keras.models as models import tensorflow.keras.layers as layers import tensorflow.keras.losses as losses import tensorflow.keras.optimizers as optimizers import tensorflow.keras.utils as u...
Ryguy-1/OverwatchCNN
trainer.py
trainer.py
py
6,318
python
en
code
0
github-code
6
[ { "api_name": "tensorflow.keras.models.Sequential", "line_number": 27, "usage_type": "call" }, { "api_name": "tensorflow.keras.models", "line_number": 27, "usage_type": "name" }, { "api_name": "tensorflow.keras.layers.Conv2D", "line_number": 31, "usage_type": "call" }, ...
36945443299
import constants.color as CC import constants.display as CD import engine.controller.hintViewController as hintViewController import engine.util.color as colorUtil import engine.util.draw as drawUtil import engine.util.text as textUtil import globals.gameState as GS import globals.subscriberMilestones as milestones imp...
StefanWinterfeldt/IdleBensch
engine/controller/achievementViewController.py
achievementViewController.py
py
2,977
python
en
code
1
github-code
6
[ { "api_name": "globals.gameState.currentMouseArea", "line_number": 20, "usage_type": "attribute" }, { "api_name": "globals.gameState", "line_number": 20, "usage_type": "name" }, { "api_name": "globals.gameState.currentMouseArea", "line_number": 21, "usage_type": "attribut...
30138288075
# !/usr/local/python/bin/python # -*- coding: utf-8 -*- # (C) Wu Dong, 2020 # All rights reserved # @Author: 'Wu Dong <wudong@eastwu.cn>' # @Time: '2020-05-26 10:50' from flask import Flask from pre_request import pre, Rule from pre_request import ParamsValueError app = Flask(__name__) app.config["TESTING"] = True cli...
Eastwu5788/pre-request
examples/example_flask/example_parse.py
example_parse.py
py
902
python
en
code
55
github-code
6
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "pre_request.Rule", "line_number": 18, "usage_type": "call" }, { "api_name": "pre_request.pre.fmt_resp", "line_number": 24, "usage_type": "call" }, { "api_name": "pre_request.pre...
26040893456
from __future__ import annotations from collections import defaultdict from dataclasses import dataclass from typing import Mapping from pants.backend.python.dependency_inference.module_mapper import ( PythonModuleOwners, PythonModuleOwnersRequest, ) from pants.backend.python.framework.stevedore.target_types ...
pantsbuild/pants
src/python/pants/backend/python/framework/stevedore/python_target_dependencies.py
python_target_dependencies.py
py
8,311
python
en
code
2,896
github-code
6
[ { "api_name": "pants.engine.target.AllTargets", "line_number": 55, "usage_type": "name" }, { "api_name": "pants.backend.python.framework.stevedore.target_types.AllStevedoreExtensionTargets", "line_number": 61, "usage_type": "call" }, { "api_name": "pants.backend.python.target_typ...
8303657610
import torch from torch import Tensor def l2_norm(embedding: Tensor) -> Tensor: """ L2 normalization technique implementation. Args: embedding (Tensor): Face image embedding represented as torch tensor. """ return embedding / torch.sqrt(torch.sum(torch.multiply(embedding, embedding))...
mdvdv/neuroface
neuroface/face/comparison/distance.py
distance.py
py
2,045
python
en
code
5
github-code
6
[ { "api_name": "torch.Tensor", "line_number": 5, "usage_type": "name" }, { "api_name": "torch.sqrt", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.sum", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.multiply", "line_number": ...
42468521706
import json import torch def trans_index(origin_dict): new_dict = {} for key in origin_dict: new_dict[int(key)] = origin_dict[key] return new_dict class DialogueManager: def __init__(self, config, rec, agent, user, convhis): with open(config.index2attribute_path, 'r') as f: ...
henrykasim/CS6101_CRS
dialoguemanager/DialogueManager.py
DialogueManager.py
py
9,591
python
en
code
0
github-code
6
[ { "api_name": "json.load", "line_number": 13, "usage_type": "call" }, { "api_name": "json.load", "line_number": 17, "usage_type": "call" }, { "api_name": "json.load", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.tensor", "line_number": 161, ...
20066252889
import os import properties from alignment import forced_alignment as fa from text import text_preprocess as tp from files import file_utils def run(): # If processing a lot of chapters, sometimes calculations finish with error (fail) at some chapter; # in that case, simply reset the starting book and chapte...
arnasRad/speech_dataset
alignment.py
alignment.py
py
1,617
python
en
code
0
github-code
6
[ { "api_name": "properties.book_list", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 27, "usage_type": "call" }, { "api_name": "files.file_utils.build_syncmap_dir", "line_number": 27, "usage_type": "call" }, { "api_name...
43108970424
from typing import Any, List, Optional, Dict, Union, Iterable from adagio.instances import TaskContext, WorkflowContext from adagio.specs import InputSpec, OutputSpec, TaskSpec, WorkflowSpec from triad.utils.assertion import assert_or_throw from triad.utils.hash import to_uuid from triad.collections import ParamDict f...
ofili/Wrangle-and-Analyze-Data
venv/Lib/site-packages/qpd/workflow.py
workflow.py
py
9,826
python
en
code
0
github-code
6
[ { "api_name": "adagio.instances.WorkflowContext", "line_number": 12, "usage_type": "name" }, { "api_name": "qpd.qpd_engine.QPDEngine", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 13, "usage_type": "name" }, { "api_name": ...
41735773781
# -*- coding: utf-8 -*- """ Test to check api calls """ import requests import pytest import json import socket URL = "http://localhost:8000" data = { "data": [{"key": "key1", "val": "val1", "valType": "str"}]} term_data= { "data": [{"key" : "terminate", "val": "val1", "valType": "str"}]} ...
sashkavyshka/salt_homework
testing/test_api.py
test_api.py
py
7,496
python
en
code
0
github-code
6
[ { "api_name": "requests.post", "line_number": 39, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 58, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 59, "usage_type": "call" }, { "api_name": "requests.post", "line_numbe...
21529370789
from django import forms from .form_view import FormView class InstanceForm(forms.Form): id = forms.IntegerField() class DeleteView(FormView): form_class = InstanceForm model = None instance_field = "id" def pre_save(self, form): return True def save(self, form): go_throug...
sajithak52/store-django-app
myproject/base_class/views/delete_view.py
delete_view.py
py
987
python
en
code
0
github-code
6
[ { "api_name": "django.forms.Form", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 6, "usage_type": "name" }, { "api_name": "django.forms.IntegerField", "line_number": 7, "usage_type": "call" }, { "api_name": "django.for...
7864291770
""" Stable Distributions ------------------------- """ # Author: F.J. Martinez-Murcia <fjesusmartinez@ugr.es>. Based on Levy Stable code by Paul F. Harrison import numpy as np import scipy.special as sp from sklearn.base import BaseEstimator __version__ = '0.5' _lower = np.array([-np.pi / 2 * 0.999, 0.5, -1.0]) _upp...
aavanian/pyStable
stable.py
stable.py
py
15,647
python
en
code
1
github-code
6
[ { "api_name": "numpy.array", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 13, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 1...
45189957116
import cv2 import numpy as np from matplotlib import pyplot as plt img1 = cv2.imread(r'C:\Users\miaojia.li\Desktop\111\11 (36).jpg',0) img2 = cv2.imread(r'C:\Users\miaojia.li\Desktop\111\111 (36).jpg',0) img3 = cv2.imread(r'C:\Users\miaojia.li\Desktop\111\1111(36).jpg',0) # mask1 = np.zeros(img.shape[:2],np.uin...
lijiajia96/MyPythonProjection
火焰识别/直方图绘制和分析.py
直方图绘制和分析.py
py
2,312
python
en
code
0
github-code
6
[ { "api_name": "cv2.imread", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.histogram", "line_number": 22...
37586663983
import numpy as np import matplotlib.pyplot as plt class Env(object): class Obstacle(object): def __init__(self,o_x,o_y,radius): self.o_x = o_x self.o_y = o_y self.radius = radius def __init__(self,start_node,goal_node,obstacle_list=[],max_x=10,max_y=10,sp...
dohyeoklee/RRT-python
src/rrt.py
rrt.py
py
5,781
python
en
code
1
github-code
6
[ { "api_name": "numpy.linspace", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.random.randint", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.random", ...
45572811
import streamlit as st import cowsay st.write("Ma super app !") text = st.text_input(label="Que veux tu faire dire à l'animal ?") cut_pet = st.selectbox(label="Quel animal doit parler ?", options=[pet for pet in cowsay.list_cows()]) if text and cut_pet: st.text(cowsay.cowthink(text, cut_pet))
gabigab117/my_children
main.py
main.py
py
302
python
en
code
0
github-code
6
[ { "api_name": "streamlit.write", "line_number": 5, "usage_type": "call" }, { "api_name": "streamlit.text_input", "line_number": 7, "usage_type": "call" }, { "api_name": "streamlit.selectbox", "line_number": 8, "usage_type": "call" }, { "api_name": "cowsay.list_cow...
33305948686
import requests import pytz from datetime import datetime, timedelta from google.cloud import bigquery from match_league_processor import get_brawler, get_season, get_day, get_datetime from match_league_processor import get_seasonday, get_player, get_timestamp, get_match_details from match_league_processor import get_m...
mathieugrasland/Brawlstar-Club-Dashboard
extract_upload_logs/BS_helper.py
BS_helper.py
py
5,640
python
en
code
1
github-code
6
[ { "api_name": "requests.get", "line_number": 30, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 59, "usage_type": "call" }, { "api_name": "pytz.timezone", "line_number": 67, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "...
3989648161
from typing import TYPE_CHECKING, Any, Dict, List, Self, Union from attrs import define as _attrs_define from attrs import field as _attrs_field from ..types import UNSET, Unset if TYPE_CHECKING: from ..schemas.batchadd_2_result_orders_item import Batchadd2ResultOrdersItem @_attrs_define class Batchadd2Result:...
tlg7c5/kraken-connector
kraken_connector/schemas/batchadd_2_result.py
batchadd_2_result.py
py
2,199
python
en
code
0
github-code
6
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 19, "usage_type": "name" }, { "api_name": "types.Unset", "line_number": 19, "usage_type": "name" }, { "api_name": "typing.List", "line_...
27581892356
import numpy as np import pandas as pd from keras.models import model_from_json file = open('classifier_breast.json', 'r') network_structure = file.read() file.close() classifier = model_from_json(network_structure) classifier.load_weights('classifier_breast.h5') new_register = np.array([[15.80, 8.34, 118, 900, 0.10...
hpeluzio/breast-cancer-base-neural-network
breast_cancer_loading_the_network.py
breast_cancer_loading_the_network.py
py
978
python
en
code
0
github-code
6
[ { "api_name": "keras.models.model_from_json", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 21, "usage_type": "call" }, { "api_name": "pandas.read_c...
30991677057
""" Author: Ibrahim Sherif Date: December, 2021 This script used for training model on the ingested data """ import os import sys import pickle import logging import pandas as pd from sklearn.linear_model import LogisticRegression from config import MODEL_PATH, DATA_PATH logging.basicConfig(stream=sys.stdout, level=l...
ibrahim-sheriff/Dynamic-Risk-Assessment-System
src/training.py
training.py
py
1,389
python
en
code
4
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 15, "usage_type": "attribute" }, { "api_name": "logging.INFO", "line_number": 15, "usage_type": "attribute" }, { "api_name": "logging.info", ...
14255791016
from __future__ import unicode_literals from _CAL import CAL from _MOM.import_MOM import * from _MOM.import_MOM import _A_Float_, _A_String_ from _TFL.I18N import _ from _TFL.pyk import pyk import _CAL.Delta import datetime _Ancestor_Ess...
xiaochang91/tapyr
_MOM/_Attr/Date_Time_Delta.py
Date_Time_Delta.py
py
2,987
python
en
code
0
github-code
6
[ { "api_name": "_TFL.I18N._", "line_number": 22, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 23, "usage_type": "attribute" }, { "api_name": "datetime.timedelta", "line_number": 39, "usage_type": "call" }, { "api_name": "_TFL.pyk.pyk.s...
4478967236
import os import os.path import requests import lxml.html import glob import config from parsers.rower import Rower class ActAgeParser: url_base = 'http://euskolabelliga.com' file_path = config.ACT_FILES_PATH staff = [] def get_main_page(self, year): main_page = requests.get(self.url_base) ...
ander2/estropadak-rowers-data
parsers/actageparser.py
actageparser.py
py
6,586
python
en
code
0
github-code
6
[ { "api_name": "config.ACT_FILES_PATH", "line_number": 13, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "l...
38603739642
""" ================================================================ ! ! Trasforma i file grib contenenti la precipitazione cumulata ! da radar (cosi' come codificati ad ARPA-SIMC) in file netdcf. ! !================================================================ """ import getopt import netCDF4 import numpy as np imp...
ARPA-SIMC/cosudo
radarconverter/radar_grib2netcdf/radar_grib2netcdf.py
radar_grib2netcdf.py
py
5,537
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime.strptime", "line_number": 43, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 43, "usage_type": "attribute" }, { "api_name": "netCDF4.Dataset", "line_number": 50, "usage_type": "call" }, { "api_name": "num...
86625778634
#! /usr/bin/env python import sys import os import numpy as np import time from PyQt4.QtCore import * from PyQt4.QtGui import * from enum import Enum from gui_utilities import * from datetime import datetime class QGraphicsPathItemModified(QGraphicsPathItem): # def __init__(self, path, parent=None, gscene=Non...
mistycheney/MouseBrainAtlas
gui/widgets/SignalEmittingItems.py
SignalEmittingItems.py
py
22,924
python
en
code
3
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 65, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 65, "usage_type": "name" }, { "api_name": "numpy.mean", "line_number": 103, "usage_type": "call" } ]
8189459040
#!/usr/bin/env python # coding: utf-8 # In[1]: import numpy as np import pandas as pd # In[2]: import urllib.request as webreq import os local_files = ["c:/Works/training_two_classes.svm", "c:/Works/test_two_classes.svm"] urls = ['http://bit.ly/37FTdmY', 'http://bit.ly/2tLzzqV'] for f_name, url in zip(local_...
JakeSifo/BootCamp
LabFiles/Solutions/py code/Lab 10 - The Random Forest Algorithm.py
Lab 10 - The Random Forest Algorithm.py
py
1,648
python
en
code
0
github-code
6
[ { "api_name": "os.path.exists", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "urllib.request.urlretrieve", "line_number": 23, "usage_type": "call" }, { "api_name": "urllib.request...
26529002101
import collections from functools import reduce import operator from oneview_redfish_toolkit.api.computer_system import ComputerSystem from oneview_redfish_toolkit.api.redfish_json_validator \ import RedfishJsonValidator from oneview_redfish_toolkit.api.resource_block_collection import \ ResourceBlockCollectio...
HewlettPackard/oneview-redfish-toolkit
oneview_redfish_toolkit/api/storage.py
storage.py
py
5,322
python
en
code
16
github-code
6
[ { "api_name": "oneview_redfish_toolkit.api.redfish_json_validator.RedfishJsonValidator", "line_number": 22, "usage_type": "name" }, { "api_name": "oneview_redfish_toolkit.api.computer_system.ComputerSystem.BASE_URI", "line_number": 79, "usage_type": "attribute" }, { "api_name": "...
20570592848
import sys import cocotb import logging from cocotb.triggers import Timer, RisingEdge, Combine, Join, First, with_timeout from ndk_core import NFBDevice import cocotbext.ofm.utils.sim.modelsim as ms import cocotb.utils e = cocotb.external st = cocotb.utils.get_sim_time async def get_dev_init(dut): dev = NFBDevi...
CESNET/ndk-app-minimal
tests/cocotb/cocotb_test.py
cocotb_test.py
py
5,517
python
en
code
17
github-code
6
[ { "api_name": "cocotb.external", "line_number": 11, "usage_type": "attribute" }, { "api_name": "cocotb.utils", "line_number": 12, "usage_type": "attribute" }, { "api_name": "ndk_core.NFBDevice", "line_number": 15, "usage_type": "call" }, { "api_name": "cocotb.trig...
33548048617
import pytest from costcenter.models import CostCenterAllocation, FundCenterManager, FundCenterAllocation, Fund, CostCenterManager from encumbrance.management.commands import populate, uploadcsv from django.db.models import Sum @pytest.mark.django_db class TestFundCenterAllocation: @pytest.fixture def setup(s...
mariostg/bft
costcenter/tests/test_fundcenterallocation.py
test_fundcenterallocation.py
py
2,315
python
en
code
0
github-code
6
[ { "api_name": "encumbrance.management.commands.populate.Command", "line_number": 11, "usage_type": "call" }, { "api_name": "encumbrance.management.commands.populate", "line_number": 11, "usage_type": "name" }, { "api_name": "encumbrance.management.commands.uploadcsv.Command", ...
19286631751
from flask import Flask, jsonify, request, Blueprint from services.cepService import buscaEndereco app = Flask(__name__) enderecoApp = Blueprint('enderecoApp', __name__) @enderecoApp.route('/endereco/<string:cep>', methods=['GET']) def getEndereco(cep): if(len(cep)!= 8): return jsonify({'error':'formato...
viiktordev/python-flask-agenda
api-cep/enderecoApi.py
enderecoApi.py
py
484
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask.Blueprint", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 11, "usage_type": "call" }, { "api_name": "services.cepService.buscaEnde...
25548495
# this is for looking up the SBERT embeddings, according to Documentation https://huggingface.co/sentence-transformers/bert-base-nli-mean-tokens (See Usage (HuggingFace Transformers)) import torch from transformers import AutoTokenizer, AutoModel model = AutoModel.from_pretrained('sentence-transformers/bert-base...
vinzenzzinecker98/blp_reproduction
lookupembs.py
lookupembs.py
py
1,299
python
en
code
0
github-code
6
[ { "api_name": "transformers.AutoModel.from_pretrained", "line_number": 6, "usage_type": "call" }, { "api_name": "transformers.AutoModel", "line_number": 6, "usage_type": "name" }, { "api_name": "torch.device", "line_number": 7, "usage_type": "call" }, { "api_name"...
17234000354
# coding: utf-8 """ Refinery Calc API Documentation Integrate the powerful Refinery Calc Engine into your process using this API. # noqa: E501 OpenAPI spec version: 1.0 Contact: support@refinerycalc.com.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint impor...
refinerycalc/sdk-example-python
python/refinerycalc/models/refinery_response.py
refinery_response.py
py
9,917
python
en
code
0
github-code
6
[ { "api_name": "six.iteritems", "line_number": 330, "usage_type": "call" }, { "api_name": "pprint.pformat", "line_number": 355, "usage_type": "call" } ]
29439560626
import argparse import os import sys try: import pkg_resources except Exception: print('pkg_resources cannot be imported probably because the pip package is not installed and/or using a ' 'legacy Python interpreter. Please refer to the Get Started section of the ESP-IDF Programming Guide for ' ...
espressif/ESP8266_RTOS_SDK
tools/check_python_dependencies.py
check_python_dependencies.py
py
4,315
python
en
code
3,148
github-code
6
[ { "api_name": "sys.exit", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.platform", "line_number": 15, "usage_type": "attribute" }, { "api_name": "sys.base_prefix", "line_number": 26, "usage_type": "attribute" }, { "api_name": "sys.prefix", "lin...
71732565308
import pytest from machine_common_sense.config_manager import Vector3d from generator import ( ImmutableObjectDefinition, MaterialChoice, ObjectDefinition, SizeChoice, TypeChoice, definitions, materials ) from generator.definitions import ( create_dataset, finalize_each_definition_c...
NextCenturyCorporation/mcs-scene-generator
tests/definitions_test.py
definitions_test.py
py
19,834
python
en
code
3
github-code
6
[ { "api_name": "generator.definitions.create_dataset", "line_number": 23, "usage_type": "call" }, { "api_name": "generator.ObjectDefinition", "line_number": 24, "usage_type": "call" }, { "api_name": "generator.ObjectDefinition", "line_number": 25, "usage_type": "call" },...
702309456
#!flask/bin/python from flask import Flask, jsonify, request import api app = Flask(__name__) cities = api.loadDB() @app.route('/') def root(): return "Hello, World!" @app.route('/all_cities', methods=['GET']) def list_all_countries(): return jsonify({'cities': cities}) @app.route('/city_by_name/<city_nam...
AnshuOnGit/FlaskSimpleREST
app.py
app.py
py
1,275
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "api.loadDB", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 16, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number":...
74489523706
import os import time import json import yaml import glob import logging import argparse import subprocess import typing as T import torch import torchaudio from tqdm import tqdm from scipy.signal import fftconvolve from torch.utils.data import DataLoader from torchmetrics.classification import BinaryAUROC from nvas3...
apple/ml-nvas3d
demo/test_demo.py
test_demo.py
py
20,425
python
en
code
33
github-code
6
[ { "api_name": "torch.nn", "line_number": 25, "usage_type": "attribute" }, { "api_name": "nvas3d.utils.utils.overlap_chunk", "line_number": 50, "usage_type": "call" }, { "api_name": "torch.stack", "line_number": 53, "usage_type": "call" }, { "api_name": "torch.no_g...
70766870587
from nbdler import Request as DlRequest, dlopen, HandlerError from helper.ctxtools import ctx from request import requester from pydantic import BaseModel from utils.model import DefaultField from utils.common import readable_file_size from typing import Dict, List import threading import requests import asyncio impor...
ZSAIm/VideoCrawlerEngine
request/download.py
download.py
py
6,464
python
en
code
420
github-code
6
[ { "api_name": "pydantic.BaseModel", "line_number": 16, "usage_type": "name" }, { "api_name": "utils.model.DefaultField", "line_number": 17, "usage_type": "call" }, { "api_name": "utils.model.DefaultField", "line_number": 18, "usage_type": "call" }, { "api_name": "...
8665360320
from selenium import webdriver import os import time # 引入鼠标驱动包 from selenium.webdriver.common.action_chains import ActionChains browser = webdriver.Chrome() # 定位文件的绝对路径 file_path = 'file:///'+os.path.abspath("E:/JavaWebCode/level_locate.html") browser.get(file_path) browser.maximize_window() time.sleep(3) # 定义Link1 br...
Zshuangshuang/Reload
2021_03_12自动化学习/src2021_03_12/testDemo21.py
testDemo21.py
py
607
python
zh
code
0
github-code
6
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 7, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 7, "usage_type": "name" }, { "api_name": "os.path.abspath", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", ...
71239333627
from time import sleep from kivymd.uix.screen import MDScreen from kivy.lang import Builder # from controllers.home import HomeScreen # from models.androidly import Sms from models.database import DatabaseManager # from kivy.app import App from models.today import today_date from widgets import notify # from...
Humarr/MoneyWatch
moneywatch - original/controllers/budget.py
budget.py
py
2,312
python
en
code
0
github-code
6
[ { "api_name": "kivymd.uix.screen.MDScreen", "line_number": 15, "usage_type": "name" }, { "api_name": "kivy.lang.Builder.load_file", "line_number": 17, "usage_type": "call" }, { "api_name": "kivy.lang.Builder", "line_number": 17, "usage_type": "name" }, { "api_name...
25298614858
#!/usr/bin/env python3 import hashlib import hmac import requests import time import uuid API_BASE = 'https://api.walutomat.pl' # Credentials api_key = None secret = None assert api_key is not None assert secret is not None # Get current offers print('Current best offers:') print(requests.get(f'{API_BASE}/api/v1/...
Currency-One/api-examples
v1-deprecated/python/example.py
example.py
py
1,574
python
en
code
5
github-code
6
[ { "api_name": "requests.get", "line_number": 21, "usage_type": "call" }, { "api_name": "time.time", "line_number": 26, "usage_type": "call" }, { "api_name": "hmac.new", "line_number": 27, "usage_type": "call" }, { "api_name": "hashlib.sha256", "line_number": 2...
26529343726
#이분 그래프 import sys from collections import deque input = sys.stdin.readline def bfs(start): queue = deque() queue.append(start) color[start] = 1 while queue: v = queue.popleft() for i in graph[v]: if color[i] == 0: queue.append(i) color[i] = -...
Jaeheon-So/baekjoon-algorithm
DFS, BFS/1707.py
1707.py
py
880
python
en
code
0
github-code
6
[ { "api_name": "sys.stdin", "line_number": 4, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 7, "usage_type": "call" } ]
12473133333
import abc from typing import Optional, TYPE_CHECKING, Type from sympl._core.factory import AbstractFactory from config import np if TYPE_CHECKING: from .advection import Advection from .boundary import Boundary from .diffusion import Diffusion class Stepper(AbstractFactory): def __init__( ...
stubbiali/burgers
python/numpy/stepper.py
stepper.py
py
4,157
python
en
code
0
github-code
6
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 8, "usage_type": "name" }, { "api_name": "sympl._core.factory.AbstractFactory", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.Type", "line_number": 21, "usage_type": "name" }, { "api_name": "c...
21689178312
import logging from typing import Any, Set import pyarrow.parquet as pq from pyarrow.lib import Table from s3fs import S3FileSystem from ..arrow_storage import ArrowProvider from ..storage_providers import TableName, UnstructuredStorageProvider class S3StructuredProvider(ArrowProvider): """This class allows you...
openwpm/OpenWPM
openwpm/storage/cloud_storage/s3_storage.py
s3_storage.py
py
3,213
python
en
code
1,286
github-code
6
[ { "api_name": "arrow_storage.ArrowProvider", "line_number": 12, "usage_type": "name" }, { "api_name": "s3fs.S3FileSystem", "line_number": 24, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 27, "usage_type": "name" }, { "api_name": "s3fs.S3FileS...
21107990294
import cv2 import os from os import listdir from os.path import isfile, join from skimage.morphology import erosion, dilation, opening, closing, white_tophat from skimage.morphology import disk # Threshold make mask selem = disk(8) import numpy as np import csv from PIL import Image, ImageOps import numpy f...
chenxun511happy/Cartilage-Net
detection/watershed.py
watershed.py
py
6,248
python
en
code
1
github-code
6
[ { "api_name": "skimage.morphology.disk", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.dilate", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.erode", "line_number": 19, "usage_type": "call" }, { "api_name": "cv2.distanceTransform", ...
39461287320
#!/usr/bin/env python import matplotlib.pyplot as plt import numpy as np import tensorflow as tf import tensorflow_datasets as tfds def plot_graphs(history, metric): fig = plt.figure(figsize=(8, 8)) ax = plt.subplot(1, 2, 1) ax.plot(history.history[metric]) ax.plot(history.history['val_' + metric], ...
jeremyagray/fcc-ml
imdb.py
imdb.py
py
3,291
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 10, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.subplot", "line_number": 12, "usage_type": "call" }, { "api_name": "...
39157390016
import json import os import subprocess import tempfile import pytest import torch @pytest.mark.parametrize("env", ["pytorch", "torchscript", "albumentations"]) def test_lcs(env: str) -> None: with tempfile.TemporaryDirectory() as tmpdir: img = ( torch.arange(10).reshape(1, 1, 1, 10).expand(-...
HiroakiMikami/benchmarks-of-deep-learning-libraries
test/cpu/test_flip.py
test_flip.py
py
1,136
python
en
code
0
github-code
6
[ { "api_name": "tempfile.TemporaryDirectory", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.arange", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.uint8", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.joi...