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
40134161700
import gevent.monkey # If gevent is installed, it needs to monkey-patch the python sockets to cooperate (see documentation or this # github issue https://github.com/gevent/gevent/issues/941). gevent.monkey.patch_all() import requests import json import urllib.parse as urlparse from urllib.parse import parse_qs """ Bas...
NHSDigital/gp-connect-access-record-fhir-api
mediation_service/tests/performance/common/auth.py
auth.py
py
3,435
python
en
code
2
github-code
7
[ { "api_name": "gevent.monkey.monkey.patch_all", "line_number": 4, "usage_type": "call" }, { "api_name": "gevent.monkey.monkey", "line_number": 4, "usage_type": "attribute" }, { "api_name": "gevent.monkey", "line_number": 4, "usage_type": "name" }, { "api_name": "r...
5282760959
""" 通用工具函数 """ import subprocess import functools import os def _filepath_(surf: str = None): """ 将参数名中带 path 的参数都换成据对路径 检查 outpath 的后缀名是不是 surf :param surf: 后缀名字符串 ".mp4", ".m3u8", ".mov" 等 :return: 函数装饰器 """ def ck_surf(fn): """ 本装饰器的作用就是将函数中使用的路径变为绝对路径 """ ...
i-crux/x264codec
x264codec/_models/utils/utils_common.py
utils_common.py
py
4,018
python
zh
code
35
github-code
7
[ { "api_name": "os.path.abspath", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_number": 27, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path", "line_numb...
40131584587
"""This script implements a simplified map reduce solution for the purpose of comparing performance between using threads and multiprocessing""" def map_func(x): """ Simple occurrence mapper """ return x, 1 def shuffle(mapper_out): """ Organise the mapped values by key """ data = {} for k, v in ...
hilariie/MapReduce
src/simple.py
simple.py
py
2,889
python
en
code
0
github-code
7
[ { "api_name": "os.path.dirname", "line_number": 44, "usage_type": "call" }, { "api_name": "os.path", "line_number": 44, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 44, "usage_type": "call" }, { "api_name": "os.path.join", "line...
72719244062
import pandas as pd import scipy.stats as ss import sklearn.metrics as skmet import numpy as np def get_explanatory_indices(index, min_lag, max_lag): # In append mode, the start index can always be 0 if max_lag is None: start_idx = 0 else: start_idx = max(index-max_lag, ...
jiawu/Roller
Swing/util/utility_module.py
utility_module.py
py
6,107
python
en
code
0
github-code
7
[ { "api_name": "numpy.setdiff1d", "line_number": 25, "usage_type": "call" }, { "api_name": "sklearn.metrics.explained_variance_score", "line_number": 33, "usage_type": "call" }, { "api_name": "sklearn.metrics", "line_number": 33, "usage_type": "name" }, { "api_name...
71570731743
import re from orderedset import OrderedSet from flask import Markup from notifications_utils.columns import Columns from notifications_utils.formatters import ( unescaped_formatted_list, strip_html, escape_html, strip_dvla_markup, ) class Placeholder: def __init__(self, body): # body sh...
govau/notify
utils/notifications_utils/field.py
field.py
py
5,378
python
en
code
17
github-code
7
[ { "api_name": "re.compile", "line_number": 52, "usage_type": "call" }, { "api_name": "notifications_utils.formatters.strip_html", "line_number": 77, "usage_type": "name" }, { "api_name": "notifications_utils.formatters.escape_html", "line_number": 78, "usage_type": "name"...
3611208466
import psycopg2 from app.db_handler.db_setup import Database_handler #create insatnce of the Database_handler db = Database_handler() class Text: """ This will help in the saving of text """ def __init__(self, text, sentiment): """ Initialize text and it's sentiment """ ...
peterwade153/sniffy
app/db_handler/db_helper.py
db_helper.py
py
740
python
en
code
1
github-code
7
[ { "api_name": "app.db_handler.db_setup.Database_handler", "line_number": 5, "usage_type": "call" }, { "api_name": "psycopg2.Error", "line_number": 29, "usage_type": "attribute" } ]
1875625937
from flask import escape def view_the_log() -> str: with open('vsearch.log') as log: contents = log.read() four_strings = contents.split('|') list_test= [] for i in range(4): list_test.append(four_strings[i]) return print(escape(list_test)) view_the_log()
niceasitaka/vsearch-by-flask
webapp/test.py
test.py
py
272
python
en
code
0
github-code
7
[ { "api_name": "flask.escape", "line_number": 10, "usage_type": "call" } ]
72910837982
#Boa:Frame:wxAtomClient __author__ = "Joe Gregorio <http://bitworking.org/>" __version__ = "Revision: 1.00" __copyright__ = "Copyright (c) 2003 Joe Gregorio" __license__ = """All Rights Reserved""" from wxPython.wx import * import atomClientAPI import libxml2 from xml.sax.saxutils import escape import St...
cdent/st-clients
atom/pyatom/wxAtomClientFrame.py
wxAtomClientFrame.py
py
6,293
python
en
code
4
github-code
7
[ { "api_name": "atomClientAPI.interface", "line_number": 85, "usage_type": "call" }, { "api_name": "xml.sax.saxutils", "line_number": 110, "usage_type": "name" }, { "api_name": "xml.sax.saxutils.escape", "line_number": 117, "usage_type": "call" }, { "api_name": "xm...
27179479378
import requests import pandas as pd START_DATE = "2022-04-15" END_DATE = "2023-01-01" from yahoo_fin.stock_info import get_data as get_stock_data from yahoo_fin.stock_info import tickers_sp500 as get_sp500 def collect_api(url, is_stock = False): # Make a get request. response = requests.get(url) response_d = r...
galmercado/AnotherStockInTheWall
BackEnd/src/stockApi.py
stockApi.py
py
4,383
python
en
code
0
github-code
7
[ { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.read_json", "line_number": 18, "usage_type": "call" }, { "api_name": "yahoo_fin.stock_info.g...
34149390371
import itertools from AF import AF class AFND(AF): """ Uma classe usada para representar autômatos finitos não-determinísticos Extends ---------- classe AF Attributes ---------- vertices: list lista com os estados do autômato transitions: dict dicionário de transições do autômato initial:...
Bredstone/Linguagens-Formais
src/AFND.py
AFND.py
py
3,552
python
pt
code
2
github-code
7
[ { "api_name": "AF.AF", "line_number": 4, "usage_type": "name" }, { "api_name": "AF.AF.vertices", "line_number": 32, "usage_type": "attribute" }, { "api_name": "AF.AF", "line_number": 32, "usage_type": "name" }, { "api_name": "AF.AF.transitions", "line_number":...
43296057635
from tkinter import * import PIL from PIL import Image, ImageDraw import numpy as np import cv2 from feed_forward import feed_forward_two CIRCLE = 0 EGG = 1 HOUSE = 2 MICKEY = 3 QUESTION = 4 SAD = 5 SMILEY = 6 SQUARE = 7 TREE = 8 TRIANGLE = 9 types = ['circulo', 'huevo', 'casa', 'mickey', 'signo', 'triste', 'feliz'...
jav-ram/RN
canvas.py
canvas.py
py
2,113
python
en
code
0
github-code
7
[ { "api_name": "PIL.Image.open", "line_number": 29, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 29, "usage_type": "name" }, { "api_name": "PIL.Image", "line_number": 32, "usage_type": "attribute" }, { "api_name": "numpy.asarray", "line_num...
71314552542
from itertools import permutations def solution(expression): answer = 0 opers = ["+", "-", "*"] priorities = [*map(list, permutations(opers))] for priority in priorities: first = expression.split(priority[0]) tmp = [] for item in first: second = item.split(priorit...
ddb8036631/algorithm
src/프로그래머스_Level2/programmers_67257.py
programmers_67257.py
py
607
python
en
code
0
github-code
7
[ { "api_name": "itertools.permutations", "line_number": 7, "usage_type": "call" } ]
21561648346
""" 评估确定性策略π:若总点数之和>=20时不再要牌,即选择action=0;在总点数<20时要牌,即选择action=1 """ import gym from collections import defaultdict import numpy as np import sys sys.path.append('..') from utils import ob2state, plot_blackjack_values env = gym.make('Blackjack-v1') def generate_episode_from_policy(env, policy): """ 执行以下策略π生成e...
hongliw/Reinforcement-Learning
Machine_Learning_Book/Chapter_16-4_model-free/16-4-1_monte_carlo/on-policy/monte_carlo_evaluate.py
monte_carlo_evaluate.py
py
1,989
python
en
code
0
github-code
7
[ { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "gym.make", "line_number": 11, "usage_type": "call" }, { "api_name": "utils.ob2state", "line_numbe...
29396111949
import typing from sqlalchemy import ( create_engine, MetaData ) from databases import Database, DatabaseURL metadata = MetaData() class CustomDatabase(Database): def __init__(self, url: typing.Union[str, "DatabaseURL"], *, force_rollback: bool = False, **options: typing.Any): super().__init__(...
Mansur-Ashrapov/bot_for_dudes_on_sport
app/database/db.py
db.py
py
560
python
en
code
0
github-code
7
[ { "api_name": "sqlalchemy.MetaData", "line_number": 10, "usage_type": "call" }, { "api_name": "databases.Database", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 14, "usage_type": "attribute" }, { "api_name": "typing.Any",...
73861589984
#We will create a bot that opens Zoom at the time of our meeting #pip3 install schedule # If you have buttons to click on the screen, you jave to leverage another module that we have to import with "pyautogui" import schedule import time import webbrowser def open_link(link): webbrowser.open(link) def intro_to_...
debbycosoi/Zoombot
Zoombot.py
Zoombot.py
py
818
python
en
code
0
github-code
7
[ { "api_name": "webbrowser.open", "line_number": 10, "usage_type": "call" }, { "api_name": "webbrowser.open", "line_number": 14, "usage_type": "call" }, { "api_name": "webbrowser.open", "line_number": 17, "usage_type": "call" }, { "api_name": "schedule.every", ...
18565190156
"""@package docstring Model file that corresponds to all the data related logic """ from app import db from sqlalchemy.dialects.postgresql import JSON import enum # Owner of datamap can be a farm or a user class OwnerType(enum.Enum): FARM = "farm" USER = "user" class EquipmentModel(db.Model): id = db.Co...
dassico/StripeFarm
MappingService/app/models.py
models.py
py
4,660
python
en
code
0
github-code
7
[ { "api_name": "enum.Enum", "line_number": 10, "usage_type": "attribute" }, { "api_name": "app.db.Model", "line_number": 15, "usage_type": "attribute" }, { "api_name": "app.db", "line_number": 15, "usage_type": "name" }, { "api_name": "app.db.Column", "line_num...
31224491649
from sklearn.metrics import accuracy_score, f1_score, precision_score, recall_score, roc_auc_score from sklearn.svm import SVC from preprocess import preprocess X,Y = preprocess(dataset='lucene', do_smote = True) sv1 = SVC(kernel='rbf') sv1.fit(X['train'],Y['train']) Y_predict = sv1.predict(X['test']) print("F1 score...
gurudarshan266/FSS-HW-Group-P
Project/code/order.py
order.py
py
808
python
en
code
1
github-code
7
[ { "api_name": "preprocess.preprocess", "line_number": 5, "usage_type": "call" }, { "api_name": "sklearn.svm.SVC", "line_number": 7, "usage_type": "call" }, { "api_name": "sklearn.metrics.f1_score", "line_number": 10, "usage_type": "call" }, { "api_name": "sklearn....
18327786899
import streamlit as st from pymongo import MongoClient from descriptions.reindex_descr import ReindexDescr __version__ = 'v2.2' class AddWidgetsRu(): ''' Создание Streamlit-интерфейса. ''' def __init__(self, version, authors): with st.form(key='reindex'): st.header(...
PlatonB/high-perf-bio
gui_streamlit/reindex_gui.py
reindex_gui.py
py
3,176
python
ru
code
8
github-code
7
[ { "api_name": "streamlit.form", "line_number": 14, "usage_type": "call" }, { "api_name": "streamlit.header", "line_number": 15, "usage_type": "call" }, { "api_name": "streamlit.expander", "line_number": 16, "usage_type": "call" }, { "api_name": "streamlit.text", ...
5679514496
import datetime import ipaddress import json import os import requests import signal import sys import time import calculate_acf as myacf import trans import detect_abnormal as ab import utils # from pprint import pprint class Blocking(): def __init__(self, ip): self.path_all_json = "./all.json" s...
taka8poyo/ssh_attack_firewall
firewall/blocking.py
blocking.py
py
8,374
python
en
code
0
github-code
7
[ { "api_name": "trans.transform_log", "line_number": 28, "usage_type": "call" }, { "api_name": "trans.sys_trans_dict", "line_number": 28, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 32, "usage_type": "call" }, { "api_name": "dateti...
5117554669
import logging import os import pytest import sdk_cmd import sdk_tasks import sdk_utils import spark_utils as utils from tests.integration.fixture_kafka import KERBERIZED_KAFKA, KAFKA_PACKAGE_NAME, KAFKA_SERVICE_NAME, KEYTAB_SECRET from tests.integration.fixture_kafka import get_kerberized_kafka_spark_conf, upload_jaa...
mesosphere/spark-build
tests/integration/test_kafka.py
test_kafka.py
py
3,496
python
en
code
53
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.path.abspath", ...
267979566
import pandas as pd import numpy as np from sklearn.model_selection import train_test_split from sklearn.linear_model import LinearRegression from sklearn.tree import DecisionTreeRegressor from sklearn.ensemble import RandomForestRegressor from sklearn.svm import SVR from sklearn.metrics import r2_score, mean_squared_e...
samyakkhatua/intelliSunBackend
newMain.py
newMain.py
py
2,085
python
en
code
0
github-code
7
[ { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 18, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LinearRegression", "line_number": 21, "usage_type": "call" ...
15269550107
import networkx as nx import pandas as pd import numpy as np from active_semi_clustering.exceptions import EmptyClustersException class AHCC: def __init__(self, n_clusters=2): self.n_clusters = n_clusters def fit(self, X, y=None, ml=[], cl=[]): if isinstance(X, pd.DataFrame): ...
heriosousa/active-constrained-clustering
active_semi_clustering/semi_supervised/pairwise_constraints/ahcc.py
ahcc.py
py
3,403
python
en
code
null
github-code
7
[ { "api_name": "pandas.DataFrame", "line_number": 12, "usage_type": "attribute" }, { "api_name": "active_semi_clustering.exceptions.EmptyClustersException", "line_number": 22, "usage_type": "name" }, { "api_name": "networkx.number_connected_components", "line_number": 25, ...
8864127426
import loguru from dataclasses import dataclass from typing import Any, Callable, Optional, Tuple, TypeVar, Self from autoboot.args import get_env_name from autoboot.logging import Logging from autoboot.plugin import AppPlugin from autoboot.process import load_env_file, load_yaml_file from autoboot.event import Applic...
yizzuide/autoboot
autoboot/applications.py
applications.py
py
4,339
python
en
code
0
github-code
7
[ { "api_name": "typing.TypeVar", "line_number": 13, "usage_type": "call" }, { "api_name": "typing.TypeVar", "line_number": 15, "usage_type": "call" }, { "api_name": "dataclasses.dataclass", "line_number": 17, "usage_type": "name" }, { "api_name": "typing.Optional",...
32808557323
# (c) AlenPaulVarghese # -*- coding: utf-8 -*- from pathlib import Path from typing import Set import fitz from tools.scaffold import AbstractTask class Extractor(AbstractTask): def __init__(self, chat_id: int, message_id: int): super().__init__(chat_id, message_id) self.input_file: Path ...
alenpaulvarghese/pdf_bot
pdf_bot/tools/extractor.py
extractor.py
py
1,248
python
en
code
1
github-code
7
[ { "api_name": "tools.scaffold.AbstractTask", "line_number": 12, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.Set", "line_number": 17, "usage_type": "name" }, { "api_name": "pathlib.Path", ...
1203803671
import requests import json followers_file = open("followers.txt", "w+", encoding="utf-8") following_file = open("following.txt", "w+", encoding="utf-8") brief_dict = {} cookie = '' #Here Paste Your Twitter Cookie authorization = '' #Here Paste your Authoriaztion Token csrf_token = '' #Here Paste you...
Samarth-2561/Twitter-Follower-Following-Scraper
twitter_data.py
twitter_data.py
py
7,667
python
en
code
1
github-code
7
[ { "api_name": "json.dumps", "line_number": 31, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 39, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 63, "usage_type": "call" }, { "api_name": "requests.get", "line_number": ...
20306451363
# tif to png convert from PIL import Image import glob import os Image.MAX_IMAGE_PIXELS = None for name in glob.glob('*.tif'): im = Image.open(name) region = im.crop((0, 0, 16304, 16304)) name = str(name).rstrip(".tif") region.save(name + '.png', 'PNG') def crop_to_selection(src, dst, na...
nayemabs/keras_segmentation
utils/resize_img.py
resize_img.py
py
515
python
en
code
1
github-code
7
[ { "api_name": "PIL.Image.MAX_IMAGE_PIXELS", "line_number": 5, "usage_type": "attribute" }, { "api_name": "PIL.Image", "line_number": 5, "usage_type": "name" }, { "api_name": "glob.glob", "line_number": 7, "usage_type": "call" }, { "api_name": "PIL.Image.open", ...
7818782725
from flask import Flask, render_template, request from flask_sqlalchemy import SQLAlchemy from datetime import datetime app = Flask(__name__) number = 0 @app.get('/') def index(): return render_template('index.html') @app.route('/submit', methods=['POST', 'GET']) def submit(): number = request.form...
RonnieJohnston/Flask-Exercises
exercise-02/app.py
app.py
py
557
python
en
code
0
github-code
7
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.request.form.get", "line_number": 16, "usage_type": "call" }, { "api_name": "flask.request...
15567639770
# -*- coding: utf-8 -*- """ Created on 20190612 @author: dell """ """======================== 1. 将同一个Excel中的不同的sheet页,汇总到一个新的表格中 ================================""" import os def file_name(file_dir): file_name_lst=[] for root,dirs,files in os.walk(file_dir): file_name_lst.extend(files) return fi...
shanggeshihun/prw
合并工作表及工作簿.py
合并工作表及工作簿.py
py
1,342
python
en
code
0
github-code
7
[ { "api_name": "os.walk", "line_number": 16, "usage_type": "call" }, { "api_name": "xlrd.open_workbook", "line_number": 30, "usage_type": "call" }, { "api_name": "xlsxwriter.Workbook", "line_number": 44, "usage_type": "call" } ]
74415646944
import random from myhdl import StopSimulation, block, enum, always, instance, Signal, intbv, delay from mux import mux random.seed(5) randrange = random.randrange t_state = enum('0', '1') @block def test_mux(): a = Signal(intbv(4)) b = Signal(intbv(6)) z = Signal(intbv(0)) sel = Signal(intbv(0)) ...
JoseK21/HLS_MyHDL
_Project/MUX2x1/test_mux.py
test_mux.py
py
978
python
en
code
0
github-code
7
[ { "api_name": "random.seed", "line_number": 5, "usage_type": "call" }, { "api_name": "random.randrange", "line_number": 6, "usage_type": "attribute" }, { "api_name": "myhdl.enum", "line_number": 8, "usage_type": "call" }, { "api_name": "myhdl.Signal", "line_nu...
16072560783
import logging as log import ming import argparse import madsenlab.axelrod.utils as utils import madsenlab.axelrod.data as data import madsenlab.axelrod.analysis as analysis import madsenlab.axelrod.rules as rules import uuid def setup(): global args, simconfig parser = argparse.ArgumentParser() parse...
mmadsen/axelrod-ct
simulations/sim-extensible-single.py
sim-extensible-single.py
py
4,184
python
en
code
5
github-code
7
[ { "api_name": "argparse.ArgumentParser", "line_number": 17, "usage_type": "call" }, { "api_name": "madsenlab.axelrod.utils.AxelrodExtensibleConfiguration", "line_number": 34, "usage_type": "call" }, { "api_name": "madsenlab.axelrod.utils", "line_number": 34, "usage_type":...
34874006579
import logging import os import torch logger = logging.getLogger(__name__) class Checkpointer: """A simple pytorch checkpointer. Parameters ---------- model : torch.nn.Module Network model, eventually loaded from a checkpointed file optimizer : :py:mod:`torch.optim`, Optional ...
bioidiap/bob.ip.binseg
src/deepdraw/utils/checkpointer.py
checkpointer.py
py
2,899
python
en
code
1
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path.realpath", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path", "line_number": 32, "usage_type": "attribute" }, { "api_name": "os.path.join", "li...
33090178804
import re import helper # Sample public reports as a single string reports = "Critical water shortage in our town demands immediate attention. Ministry of Environment, we need assistance night safety street" # Define ministry agencies and their associated keywords ministries = { "Kementerian Pendidikan, Kebudayaa...
fmaulll/natural_language_processing
nlp.py
nlp.py
py
2,355
python
en
code
0
github-code
7
[ { "api_name": "helper.generate_keyword", "line_number": 9, "usage_type": "call" }, { "api_name": "helper.generate_keyword", "line_number": 10, "usage_type": "call" }, { "api_name": "helper.generate_keyword", "line_number": 11, "usage_type": "call" }, { "api_name":...
3622129954
from cursor.path import Path from cursor.position import Position from cursor.collection import Collection from cursor.bb import BoundingBox def test_bb_center(): bb = BoundingBox(100, 200, 300, 400) cx, cy = bb.center() assert cx == 200 assert cy == 300 def test_bb_center2(): bb = BoundingBox(-...
schwittlick/cursor
cursor/tests/test_bb.py
test_bb.py
py
1,808
python
en
code
4
github-code
7
[ { "api_name": "cursor.bb.BoundingBox", "line_number": 8, "usage_type": "call" }, { "api_name": "cursor.bb.BoundingBox", "line_number": 15, "usage_type": "call" }, { "api_name": "cursor.bb.BoundingBox", "line_number": 22, "usage_type": "call" }, { "api_name": "curs...
38552691719
import pathlib import zipfile from io import BytesIO import pandas as pd import requests from disentanglement_lib.config.unsupervised_study_v1.sweep import get_config configs = get_config() def get_model_info(): """Retrieve information about the pre-trained models of "Challenging Common Assumptions in the Unsup...
bonheml/tc_study
tc_study/utils/models.py
models.py
py
2,669
python
en
code
0
github-code
7
[ { "api_name": "disentanglement_lib.config.unsupervised_study_v1.sweep.get_config", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 20, "usage_type": "call" }, { "api_name": "pandas.DataFrame.from_dict", "line_number": 29, "usage_...
13365761782
import requests from bs4 import BeautifulSoup import time import csv import Sendmail from datetime import date urls = ["https://finance.yahoo.com/quote/AAPL?p=AAPL", "https://finance.yahoo.com/quote/AMZN?p=AMZN&ncid=yahooproperties_peoplealso_km0o32z3jzm" , "https://finance.yahoo.com/quote/GOOG?p=GOOG&ncid=yahooproper...
Prathamesh-Rathi/Web-Scrape-Bot
Scrape.py
Scrape.py
py
1,632
python
en
code
2
github-code
7
[ { "api_name": "datetime.date.today", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 11, "usage_type": "name" }, { "api_name": "csv.writer", "line_number": 13, "usage_type": "call" }, { "api_name": "requests.get", "line...
4609082800
from django.urls import path from .views import ( index, CarListView, CarDetailView, CarCreateView, CarUpdateView, CarDeleteView, assign_user_to_car, delete_user_from_car, DriverListView, DriverDetailView, DriverCreateView, ManufacturerListView, ManufacturerCreateVie...
Y-Havryliv/taxi-service
taxi/urls.py
urls.py
py
2,012
python
en
code
0
github-code
7
[ { "api_name": "django.urls.path", "line_number": 24, "usage_type": "call" }, { "api_name": "views.index", "line_number": 24, "usage_type": "argument" }, { "api_name": "django.urls.path", "line_number": 25, "usage_type": "call" }, { "api_name": "views.ManufacturerL...
42831591389
import json ds = ['ganesh', {'k1': {'k2': [1,2,3]}}, 'a', 13.4, 15] print(json.dumps(ds)) # Dump as a string to screen # Dump the DataStructure to a File with open('json_out.json', 'w') as fh: json.dump(ds, fh) # Load the json from the File to Memory ds1 = None with open('json_out.json') as fh: ds1 = json.l...
kvsrsastry/Docs_and_Code
Python/python_session_consolidated_scripts/json_play.py
json_play.py
py
659
python
en
code
0
github-code
7
[ { "api_name": "json.dumps", "line_number": 5, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 9, "usage_type": "call" }, { "api_name": "json.load", "line_number": 14, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 20, ...
14099464757
#!/usr/bin/env python3 import minimalmodbus import config import signal import sys import paho.mqtt.client as mqtt import time import binascii import RPi.GPIO as GPIO import serial def signal_handler(sig, frame): client.loop_stop() #stop the loop print(time.strftime("%y%m%d%H%M%S") + "by, by...") sys.exit...
sgersing73/Home-Automation
Powerstation/Scripts/Epever_ModbusToMqtt.py
Epever_ModbusToMqtt.py
py
7,360
python
en
code
0
github-code
7
[ { "api_name": "time.strftime", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 16, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 30, "usage_type": "call" }, { "api_name": "time.strftime", "line_number": ...
17102607562
''' File used to extract members of UNEP FI. From the extracted list, this file will determine whether a company is a member of UNEP FI ''' # Install Relevant Libraries # pip install openpyxl --upgrade --pre # pip install fuzzywuzzy # Import Libraries and UNEP FI data import requests import fuzzywuzzy as fw fro...
putridar/esg-dashboard
Scripts/unep_fi.py
unep_fi.py
py
1,330
python
en
code
12
github-code
7
[ { "api_name": "requests.get", "line_number": 17, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 18, "usage_type": "call" }, { "api_name": "fuzzywuzzy.fuzz.partial_ratio", "line_number": 50, "usage_type": "call" }, { "api_name": "fuzzywuz...
7268427646
# -*- coding: utf-8 -*- """ Input nom de jeu """ import tkinter as tk import numpy as n import pygame as p import pygame.mixer as pm import pygame.mixer_music as pmm global Lmap Lmap=[] Map_dispo=10 # # Fonctions pour les menus # # def Menu_principal(): global Menu Menu = tk.Tk() Menu.geometry("800x500")...
bperreyon/Projets-perso
Python/Escaping Game/Jeuv9.py
Jeuv9.py
py
49,256
python
en
code
0
github-code
7
[ { "api_name": "tkinter.Tk", "line_number": 19, "usage_type": "call" }, { "api_name": "tkinter.Frame", "line_number": 25, "usage_type": "call" }, { "api_name": "tkinter.GROOVE", "line_number": 25, "usage_type": "attribute" }, { "api_name": "tkinter.TOP", "line_...
6326298188
import numpy as np np.random.seed(0) from bokeh.io import curdoc from bokeh.layouts import widgetbox, row, column, gridplot from bokeh.models import ColumnDataSource, Select, Slider from bokeh.plotting import figure from bokeh.palettes import Greys256 from bokeh.models.callbacks import CustomJS from skimage.feature i...
holmgroup/BokehAppDemo
Flask_parameter_update/main.py
main.py
py
5,662
python
en
code
0
github-code
7
[ { "api_name": "numpy.random.seed", "line_number": 2, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 2, "usage_type": "attribute" }, { "api_name": "skimage.io.imread", "line_number": 26, "usage_type": "call" }, { "api_name": "skimage.color.rgb...
72859249182
import argparse import logging import os import sys from pathlib import Path import numpy as np import torch sys.path.append(".") from config import cfg from train_ctl_model import CTLModel from inference_utils import ( ImageDataset, ImageFolderWithPaths, calculate_centroids, create_pid_path_index, ...
Ascend/ModelZoo-PyTorch
PyTorch/contrib/cv/classification/Centroids-reid/inference/create_embeddings.py
create_embeddings.py
py
3,057
python
en
code
31
github-code
7
[ { "api_name": "sys.path.append", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "logging.basicConfig", "line_number": 25, "usage_type": "call" }, { "api_name": "os.environ.get", ...
73911081182
from collections import deque from typing import List class Solution: def removeStones(self, stones: List[List[int]]) -> int: visited = set() points_by_row = {} points_by_col = {} for stone in stones: points_by_row.setdefault(stone[0], set()).add(tuple(stone)) ...
cs-cordero/interview-prep
leetcode/0947_most_stones_removed_with_same_row_or_column.py
0947_most_stones_removed_with_same_row_or_column.py
py
1,266
python
en
code
9
github-code
7
[ { "api_name": "typing.List", "line_number": 6, "usage_type": "name" }, { "api_name": "collections.deque", "line_number": 22, "usage_type": "call" } ]
72685155424
from typing import List from itertools import combinations, product class Solution: def beautifulSubsets(self, nums: List[int], k: int) -> int: answer = len(nums) for i in range(2, len(nums) + 1): for comb in combinations(nums, i): is_beautiful = True fo...
daviddwlee84/LeetCode
Contest/LeetCodeWeeklyContest/WeeklyContest337/3/Naive_TLE.py
Naive_TLE.py
py
614
python
en
code
15
github-code
7
[ { "api_name": "typing.List", "line_number": 6, "usage_type": "name" }, { "api_name": "itertools.combinations", "line_number": 9, "usage_type": "call" }, { "api_name": "itertools.product", "line_number": 11, "usage_type": "call" } ]
5986158358
from flask import Flask, render_template, redirect, request from flask_wtf import FlaskForm from wtforms import StringField, SubmitField, SelectField, RadioField from wtforms.validators import DataRequired from datetime import datetime app = Flask(__name__) app.config["SECRET_KEY"] = '1234' class q1Form(FlaskForm): ...
NCNU-Project/FlaskHW
exam_1.py
exam_1.py
py
7,575
python
zh
code
0
github-code
7
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "flask_wtf.FlaskForm", "line_number": 10, "usage_type": "name" }, { "api_name": "wtforms.RadioField", "line_number": 90, "usage_type": "call" }, { "api_name": "wtforms.RadioField"...
15850544373
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # @Time : 2021/3/8 18:37 # @Author : hzy # @File : 14_最长公共前缀.py # @Software: PyCharm """ 编写一个函数来查找字符串数组中的最长公共前缀。 如果不存在公共前缀,返回空字符串""。 示例 1: 输入:strs = ["flower","flow","flight"] 输出:"fl" 示例 2: 输入:strs = ["dog","racecar","car"] 输出:"" 解释:输入不存在公共前缀。 提示: 0 <= str...
hzy0809/leetcode
leetcode/14_最长公共前缀.py
14_最长公共前缀.py
py
1,180
python
zh
code
0
github-code
7
[ { "api_name": "typing.List", "line_number": 38, "usage_type": "name" } ]
71667059103
import requests from bs4 import BeautifulSoup import codecs headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 5.1; rv:47.0) Gecko/20100101 Firefox/47.0', 'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'} session = requests.Session() urls = [] jobs = [] def get_html(url): req = ses...
amyard/Django-Tests
Job_Parsing/scripts_parsing/work.py
work.py
py
1,437
python
en
code
0
github-code
7
[ { "api_name": "requests.Session", "line_number": 8, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 21, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 30, "usage_type": "call" } ]
73171140384
from django.urls import path from . import views urlpatterns = [ path('test/', views.Test, name='test'), path('sign-up/', views.SignUp, name='signup'), path('login/', views.Login, name='login'), path('logout/', views.Logout, name='logout'), path('donar-list/', views.DonorList, name='donor-list...
tayson13/BloodNet
project/urls.py
urls.py
py
326
python
en
code
0
github-code
7
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 11, "usage_type": "call" }, { "api_name": "django.urls.path", ...
22023811869
import math import pandas as pd import matplotlib.pyplot as plt import networkx as nx import numpy as np from data_manager import DataManager JRCODE = 11 class JRMap: def __init__(self): self.data_manager = DataManager(JRCODE) self.graph = nx.Graph() self.construct_graph() def constru...
Njima1572/bluespring18
scripts/jrmap.py
jrmap.py
py
3,997
python
en
code
0
github-code
7
[ { "api_name": "data_manager.DataManager", "line_number": 12, "usage_type": "call" }, { "api_name": "networkx.Graph", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.scatter", "line_number": 48, "usage_type": "call" }, { "api_name": "mat...
25888822760
#!/usr/bin/python3 from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import pandas as pd import os import sys if __name__=="__main__": parser = argparse.ArgumentParser(description='Filter for value stocks.') parser.add_argument('stock...
alessandroferrari/StockCrawler
filter_bargains.py
filter_bargains.py
py
2,688
python
en
code
2
github-code
7
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.expanduser", "line_number": 31, "usage_type": "call" }, { "api_name": "os.path", "line_number": 31, "usage_type": "attribute" }, { "api_name": "os.path.exist...
70959818782
import threading import json import logging # see https://stackoverflow.com/a/2390997 class SafeFileDict(dict): # dicts take a mapping or iterable as their optional first argument def __init__(self, *args, **kwargs): self.lock = threading.Lock() self.update(*args, **kwargs) self.doJournal = False se...
bhautikj/jobChomper
jobChomper/safeFileDict.py
safeFileDict.py
py
1,895
python
en
code
0
github-code
7
[ { "api_name": "threading.Lock", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.warning", "line_number": 20, "usage_type": "call" }, { "api_name": "json.dumps", "line_num...
5155158178
import numpy as np import pandas as pd from sklearn.model_selection import train_test_split from sklearn.feature_extraction.text import TfidfTransformer, CountVectorizer from sklearn.linear_model import LinearRegression from sklearn.preprocessing import PolynomialFeatures from sklearn.pipeline import Pipeline import pi...
SergeyZinkovich/rucode5
main.py
main.py
py
2,484
python
en
code
0
github-code
7
[ { "api_name": "sklearn.pipeline.Pipeline", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 22, "usage_type": "call" }, { "api_name": "sklearn.feature_extraction.text.CountVectorizer", "line_number": 31, "usage_type": "call" }, ...
26331731255
import pandas as pd import numpy as np import matplotlib import random from matplotlib import pyplot as plt matplotlib.use("Agg") np.random.seed(42) class Scaler(): def __call__(self,features, is_train=False): ''' Arguments : features N X D all are numeric ''' min=features.min(0) ptp=features.ptp(0) feat...
NihalSargaiya9/FML
LR.py
LR.py
py
6,330
python
en
code
0
github-code
7
[ { "api_name": "matplotlib.use", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.power", "li...
16970114396
import datetime from models import Record from settings import celery, db from utils import get_response_status, parse_yml_files @celery.on_after_configure.connect def setup_periodic_tasks(sender, **kwargs): for parsed_data in parse_yml_files()['urls']: sender.add_periodic_task(parsed_data['delay'], ...
fiddlest1ck/Grabby
grabby.py
grabby.py
py
615
python
en
code
0
github-code
7
[ { "api_name": "utils.parse_yml_files", "line_number": 9, "usage_type": "call" }, { "api_name": "settings.celery.on_after_configure", "line_number": 7, "usage_type": "attribute" }, { "api_name": "settings.celery", "line_number": 7, "usage_type": "name" }, { "api_na...
11754820317
# -*- coding: utf-8 -*- import os import cv2 import shutil import copy import json from mbhk_get_eye import get_label from PIL import Image,ImageDraw import numpy as np labelDst = {"close_eyes": "闭眼", "yawn": "打哈欠", "phone": "打电话", "smoking": "吸烟", "sunglasses_block": "红外阻断", "drink_water": "喝水", "toothpick...
124451/eye_copen_close_other
show_label_on_image.py
show_label_on_image.py
py
20,338
python
en
code
1
github-code
7
[ { "api_name": "os.walk", "line_number": 71, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 73, "usage_type": "call" }, { "api_name": "os.path", "line_number": 73, "usage_type": "attribute" }, { "api_name": "os.path.splitext", "line_number...
20298938200
from functools import partial from front.crude import Crudifier mall = dict( a=dict(one=1, two=2), b=dict(three=3, four=4), foo_output=dict(), bar_output=dict(), ) crudifier = partial(Crudifier, mall=mall, include_stores_attribute=True) @crudifier(param_to_mall_map=['a', 'b'], output_store='foo_output') def foo(...
otosense/plunk
plunk/vf/extrude/crude/__init__.py
__init__.py
py
546
python
en
code
1
github-code
7
[ { "api_name": "functools.partial", "line_number": 7, "usage_type": "call" }, { "api_name": "front.crude.Crudifier", "line_number": 7, "usage_type": "argument" } ]
12659187644
import pytest from .factories import NotificationFactory pytestmark = pytest.mark.django_db def test_user_can_query_notifications_unread_count(django_user_client, graphql_user_client): NotificationFactory(recipient=django_user_client.user) response = graphql_user_client("query { me { notificationsUnreadCou...
silverlogic/baseapp-backend
baseapp-notifications/baseapp_notifications/tests/test_graphql_queries.py
test_graphql_queries.py
py
1,098
python
en
code
2
github-code
7
[ { "api_name": "pytest.mark", "line_number": 5, "usage_type": "attribute" }, { "api_name": "factories.NotificationFactory", "line_number": 9, "usage_type": "call" }, { "api_name": "factories.NotificationFactory", "line_number": 17, "usage_type": "call" }, { "api_na...
70745109023
''' NGram Language Model ''' from collections import Counter from math import log10 from os import linesep from itertools import product import re import random class NGram(object): ''' Implements an n-gram language model. Arguments: -N: the size of the word tuple -trainingdata: the file-like ...
mreese3/ngrams
ngram-master/NGram/NGram.py
NGram.py
py
9,647
python
en
code
0
github-code
7
[ { "api_name": "collections.Counter", "line_number": 19, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 20, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 46, "usage_type": "call" }, { "api_name": "re.findall", "...
17709818575
import urllib import webapp2 import jinja2 import os import datetime from google.appengine.ext import ndb from google.appengine.api import users from google.appengine.api import search jinja_environment = jinja2.Environment( loader=jinja2.FileSystemLoader(os.path.dirname(__file__) + "/templates")) # This part fo...
jials/RollingGo
rollinggo.py
rollinggo.py
py
8,538
python
en
code
0
github-code
7
[ { "api_name": "jinja2.Environment", "line_number": 11, "usage_type": "call" }, { "api_name": "jinja2.FileSystemLoader", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", ...
43049901021
""" URL configuration for CaclPy project. The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/4.2/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home'...
Bishesh-Khanal/CalcPy
CaclPy/urls.py
urls.py
py
1,302
python
en
code
1
github-code
7
[ { "api_name": "django.urls.path", "line_number": 21, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 21, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 21, "usage_type": "name" }, { "api_name": "...
23080594563
import time from copy import deepcopy import tqdm import torch from torch import nn, optim from torch.nn import functional as F from cope import CoPE from model_utils import * from eval_utils import * def train_one_epoch(model, optimizer, train_dl, delta_coef=1e-5, tbptt_len=20, va...
FDUDSDE/CoPE
trainer.py
trainer.py
py
3,524
python
en
code
5
github-code
7
[ { "api_name": "tqdm.tqdm", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.no_grad", "line_number": 68, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 69, "usage_type": "call" }, { "api_name": "cope.CoPE", "line_number": 77, ...
12944566910
# this is a correlation analysis using python to show how corrlation between two numerical values is done import pandas as pd import seaborn as sns import numpy as np import matplotlib import matplotlib.pyplot as plt plt.style.use('ggplot') from matplotlib.pyplot import figure matplotlib.rcParams[...
holdendata/Data_analyst_project
correlation_in_python.py
correlation_in_python.py
py
2,850
python
en
code
1
github-code
7
[ { "api_name": "matplotlib.pyplot.style.use", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 11, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 11, "usage_type": "name" }, { "api_na...
257833041
#coding: utf-8 #Salut Jean-Hugues! J'ai choisi de "moissonner" la page de la Chambre des communes du Canada, qui contient les informations des 338 députés fédéraux. #Je chercherai à obtenir quatre (parfois cinq) informations pour chacun de ces 338 députés : leur nom, parti politique, circonscription et la provincipe d...
sandrinevieira/edm4466-devoir3
devoir3.py
devoir3.py
py
3,473
python
fr
code
0
github-code
7
[ { "api_name": "requests.get", "line_number": 26, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 29, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 64, "usage_type": "call" } ]
72868390622
from torchvision import datasets, transforms import torch import numpy as np from torchvision import transforms import os from PIL import Image, ImageOps import torch.npu import os NPU_CALCULATE_DEVICE = 0 if os.getenv('NPU_CALCULATE_DEVICE') and str.isdigit(os.getenv('NPU_CALCULATE_DEVICE')): NPU_CALCULATE_DEVICE ...
Ascend/ModelZoo-PyTorch
PyTorch/dev/cv/image_classification/CDAR_ID2747_for_PyTorch/data_loader.py
data_loader.py
py
2,069
python
en
code
31
github-code
7
[ { "api_name": "os.getenv", "line_number": 10, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.npu.current_device", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.npu", "line_nu...
39056286616
from flask import Flask, render_template, request from settings import Common from flask_mail import Mail, Message from smtplib import SMTPException import yaml, os, re import stripe application = Flask(__name__) application.config.from_object(Common) mail = Mail(application) stripe.api_key = application.config['STRI...
abdallahsoliman/FRN
app.py
app.py
py
3,946
python
en
code
2
github-code
7
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "settings.Common", "line_number": 9, "usage_type": "argument" }, { "api_name": "flask_mail.Mail", "line_number": 11, "usage_type": "call" }, { "api_name": "stripe.api_key", "l...
7152967374
import csv import sys from statistics import mean input_file = sys.argv[1] # customer_finance.csv output_file = sys.argv[2] # output_files/2_output_p.csv packages = {} # structuring formatted data to dictionary counters = {} mean_value_package = {} header_for_dict = ['소득', '금융자산', '부채', '순자산'] with open(input_f...
Meengkko/bigdata_python2019
04_bigdata/02_Standardization_Analysis/4.APP/2_calculate_statistic_by_category_v1.01.py
2_calculate_statistic_by_category_v1.01.py
py
2,972
python
en
code
0
github-code
7
[ { "api_name": "sys.argv", "line_number": 6, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 7, "usage_type": "attribute" }, { "api_name": "csv.reader", "line_number": 16, "usage_type": "call" }, { "api_name": "statistics.mean", "line_numb...
74736372381
import sys from tqdm import tqdm import math import torch import numpy as np import matplotlib.pyplot as plt import torch.cuda #from sklearn.preprocessing import StandardScaler from torch import nn from torchvision.datasets import CIFAR10 from torch.utils.tensorboard import SummaryWriter from ResNet_ import * from clr...
theNNAx/Projects
ResNet50/main.py
main.py
py
4,647
python
en
code
0
github-code
7
[ { "api_name": "math.ceil", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.utils.tensorboard.SummaryWriter", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.device", "line_number": 26, "usage_type": "call" }, { "api_name": "tqdm.tqd...
38156979270
import mysql.connector import yaml import threading from datetime import datetime from transaction_state_enum import TransactionState db = yaml.safe_load(open("yamls/db.yaml")) class TransactionTable: def __init__(self): self.lock = threading.Lock() transactions_db = mysql.connector.connect( ...
nikolaJov2605/DRS_CryptoMenjacnica
CryptoMenjacnica/transactions_db.py
transactions_db.py
py
3,166
python
en
code
0
github-code
7
[ { "api_name": "yaml.safe_load", "line_number": 9, "usage_type": "call" }, { "api_name": "threading.Lock", "line_number": 13, "usage_type": "call" }, { "api_name": "mysql.connector.connector.connect", "line_number": 14, "usage_type": "call" }, { "api_name": "mysql....
40058688271
# Sanjay Santokee 81600051 from random import randrange, getrandbits from socket import * from itertools import repeat def serverSetup(): c = socket(AF_INET, SOCK_STREAM) host = gethostbyname('127.0.0.1') port = 12346 host_addr = (host, port) c.bind(host_addr) c.listen(10) pri...
SanjaySantokee/EncryptionAlgorithms
Miller-Rabin/Bob_Server.py
Bob_Server.py
py
2,845
python
en
code
0
github-code
7
[ { "api_name": "itertools.repeat", "line_number": 42, "usage_type": "call" }, { "api_name": "random.randrange", "line_number": 43, "usage_type": "call" }, { "api_name": "random.getrandbits", "line_number": 47, "usage_type": "call" }, { "api_name": "random.getrandbi...
3762472635
import multiprocessing import queue def worker_func(worker_index, input_queue, output_queue): import time while True: try: input = input_queue.get(timeout=5) print("worker_index:" + str(worker_index) + " ") print(input) output_queue.put((worker_inde...
projectmayuki/AI
Sample/SimpleMultiProcess/SimpleMultiProcess.py
SimpleMultiProcess.py
py
1,802
python
en
code
0
github-code
7
[ { "api_name": "time.sleep", "line_number": 14, "usage_type": "call" }, { "api_name": "queue.Empty", "line_number": 15, "usage_type": "attribute" }, { "api_name": "multiprocessing.Manager", "line_number": 23, "usage_type": "call" }, { "api_name": "multiprocessing.P...
74447289183
# -*- coding: utf-8 -*- """ Created on Tue Nov 10 13:57:18 2020 @author: NCJ """ import numpy as np import pandas as pd from matplotlib import pyplot as plt from sklearn.datasets.samples_generator import make_blobs from sklearn.cluster import KMeans import struct import cv2 def intensity(img): ...
DGJonna97/Median_Cut_Algorithm
Python/test.py
test.py
py
2,292
python
en
code
0
github-code
7
[ { "api_name": "numpy.shape", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.shape", "line_number": 33, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 40, "usage_type": "call" }, { "api_name": "cv2.IMREAD_COLOR", "line_numbe...
14345349500
from flask import Flask, request, jsonify from pymongo import MongoClient import pandas as pd from flask_cors import CORS import analytics app = Flask(__name__) CORS(app) # Configure MongoDB connection client = MongoClient('MONGO_URL') db = client['MichiganTeachers'] collection = db['FormTeachers'] collection1 = db['...
harshitakalva/TeacherSalaryAnalytics
my-app/backend/app.py
app.py
py
3,501
python
en
code
0
github-code
7
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 8, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.request.get_json"...
21971136345
import gradio as gr import numpy as np import torch import requests import random import os import sys import pickle from PIL import Image from tqdm.auto import tqdm from datetime import datetime import diffusers from diffusers import DDIMScheduler from transformers import CLIPTextModel, CLIPTokenizer import torch.n...
naver-ai/DenseDiffusion
gradio_app.py
gradio_app.py
py
14,628
python
en
code
364
github-code
7
[ { "api_name": "diffusers.__version__", "line_number": 25, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 27, "usage_type": "call" }, { "api_name": "diffusers.StableDiffusionPipeline.from_pretrained", "line_number": 79, "usage_type": "call" }, { ...
33984568833
from django.contrib.auth.models import AbstractUser from django.db import models from django.utils.translation import gettext_lazy as _ class User(AbstractUser): class Role_choices(models.TextChoices): USER = 'user', _('Пользователь') ADMINISTRATOR = 'admin', _('Администратор') username = mode...
Osolodkov1/foodgram-project-react
backend/foodgram/users/models.py
models.py
py
1,234
python
en
code
0
github-code
7
[ { "api_name": "django.contrib.auth.models.AbstractUser", "line_number": 6, "usage_type": "name" }, { "api_name": "django.db.models.TextChoices", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 7, "usage_type": "name" }, ...
74465653024
""" This file is a part of the 'Unnamed' source code. The source code is distributed under the MIT license. """ from typing import Callable, Optional import pygame class FadeTransition: def __init__(self, fade_in: bool, fade_speed: float, size: tuple[int, int]): self.fade_in = fade_in self.init_...
blankRiot96/pglib
pglib/transition.py
transition.py
py
1,787
python
en
code
3
github-code
7
[ { "api_name": "pygame.Surface", "line_number": 16, "usage_type": "call" }, { "api_name": "typing.Optional", "line_number": 41, "usage_type": "name" }, { "api_name": "typing.Callable", "line_number": 41, "usage_type": "name" }, { "api_name": "pygame.Surface", "...
41349514454
""" Title: Timeseries classification from scratch Author: [hfawaz](https://github.com/hfawaz/) Date created: 2020/07/21 Last modified: 2020/08/21 Description: Training a timeseries classifier from scratch on the FordA dataset from the UCR/UEA archive. """ """ ## Introduction This example shows how to do timeseries cl...
Snaags/HPO-keras
TEPS-processing.py
TEPS-processing.py
py
4,392
python
en
code
0
github-code
7
[ { "api_name": "numpy.load", "line_number": 55, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 56, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 57, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 60...
34068440343
import scrapy from datetime import datetime import locale locale.setlocale(locale.LC_ALL, 'esp_esp') class MalditaBulosSpdier(scrapy.Spider): name = 'malditaBulosSpider' start_urls = [ 'https://maldita.es/malditobulo/1' ] def parse(self, response): for titularbulo in response.xpath(...
georgicacristianciobanoiu/Analisis-de-tendencias-y-opiniones-en-redes-sociales
tfg_python/spiders/spiders/spiders/malditabulos.py
malditabulos.py
py
1,748
python
en
code
0
github-code
7
[ { "api_name": "locale.setlocale", "line_number": 5, "usage_type": "call" }, { "api_name": "locale.LC_ALL", "line_number": 5, "usage_type": "attribute" }, { "api_name": "scrapy.Spider", "line_number": 8, "usage_type": "attribute" }, { "api_name": "scrapy.Request", ...
2332993189
import torch import torch.nn.functional as F from explaignn.heterogeneous_answering.graph_neural_network.answering.answering_factory import ( AnsweringFactory, ) from explaignn.heterogeneous_answering.graph_neural_network.encoders.encoder_factory import ( EncoderFactory, ) class HeterogeneousGNN(torch.nn.Mod...
saitouhao/srtp-gnn-explain
EXPLAIGNN-main/explaignn/heterogeneous_answering/graph_neural_network/hgnn.py
hgnn.py
py
6,229
python
en
code
1
github-code
7
[ { "api_name": "torch.nn", "line_number": 12, "usage_type": "attribute" }, { "api_name": "explaignn.heterogeneous_answering.graph_neural_network.encoders.encoder_factory.EncoderFactory.get_encoder", "line_number": 29, "usage_type": "call" }, { "api_name": "explaignn.heterogeneous_...
7096375247
import sqlite3 data = [('Yphe', 'Yphe@compote.com', 0), ('Zirak', 'Zirak34@hibou.fr', 100), ('Tikal', 'twouini@music.fr', 50), ('Nyse', 'Niz@patate.com', 0)] def main(): conn = sqlite3.connect('baseDonnees.db') cur = conn.cursor() cur.execute( "CREATE TABLE IF NOT EXISTS J...
ARKANYOTA/Cours2022Git
notes/Nsi/TP3/main.py
main.py
py
1,721
python
en
code
1
github-code
7
[ { "api_name": "sqlite3.connect", "line_number": 10, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 23, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 34, "usage_type": "call" }, { "api_name": "sqlite3.connect", ...
6312670557
import logging from utils import logger from PyInquirer import prompt from FeatureExtraction.main import featureExtractor from FramesExtraction.frameExtractor import frameExtractor modules = ['Frame Extraction', 'Visual Features Extraction'] def getUserInput(): questions = [ { 'type': 'list',...
RecSys-lab/Multimodal-music-recommender
main.py
main.py
py
892
python
en
code
3
github-code
7
[ { "api_name": "PyInquirer.prompt", "line_number": 19, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 25, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 25, "usage_type": "attribute" }, { "api_name": "utils.logger"...
45357810677
from django.urls import path from posts import views urlpatterns = [ path('',views.post_list), path('login/', views.login), path('posts/', views.post_list), path('posts/<int:pk>/', views.post_detail), path('posts/create', views.post_create), path('posts/update', views.post_update), path('po...
pirogramming/4th-assignment-saturday
posts/urls.py
urls.py
py
500
python
en
code
0
github-code
7
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "posts.views.post_list", "line_number": 5, "usage_type": "attribute" }, { "api_name": "posts.views", "line_number": 5, "usage_type": "name" }, { "api_name": "django.urls.path...
71039913823
import numpy from .skimage import compare_ssim import sys ## ======================= ## ## class MetricSSIM: ## ======================= ## ## @staticmethod def compute_metrics(image1, image2): image1 = image1.convert("RGB") image2 = image2.convert("RGB") np_...
golemfactory/clay
apps/blender/resources/images/entrypoints/scripts/verifier_tools/ssim.py
ssim.py
py
920
python
en
code
2,915
github-code
7
[ { "api_name": "numpy.array", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 19, "usage_type": "call" }, { "api_name": "skimage.compare_ssim", "line_number": 21, "usage_type": "call" }, { "api_name": "sys.argv", "line_num...
5442135385
import cv2 import keyboard # haar files (face and smile) face_detector_file = r"haarcascade_frontalface_default.xml" face_detector = cv2.CascadeClassifier(face_detector_file) smile_detector_file = r"haarcascade_smile.xml" smile_detector = cv2.CascadeClassifier(smile_detector_file) # access the webcam. webcam= cv2.V...
Himanshu584/smile_detector
detector.py
detector.py
py
1,775
python
en
code
0
github-code
7
[ { "api_name": "cv2.CascadeClassifier", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.CascadeClassifier", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.CAP_DS...
16209565170
""" Tests SparkML StringIndexer converter. """ import unittest from pyspark.ml.feature import VectorAssembler from onnxmltools import convert_sparkml from onnxmltools.convert.common.data_types import FloatTensorType from onnxmltools.utils import dump_data_and_sparkml_model from sparkml import SparkMlTestCase class Te...
Riponsayf/onnxmltools
tests/sparkml/test_vector_assembler.py
test_vector_assembler.py
py
1,591
python
en
code
null
github-code
7
[ { "api_name": "sparkml.SparkMlTestCase", "line_number": 12, "usage_type": "name" }, { "api_name": "pyspark.ml.feature.VectorAssembler", "line_number": 17, "usage_type": "call" }, { "api_name": "onnxmltools.convert_sparkml", "line_number": 19, "usage_type": "call" }, {...
9418219068
#coding:utf-8 ''' 创建者:liu 作用:从jmeter脚本中提取url,头文件,发送的json数据,发送的方法等 使用方法:实例化的时候传入jmeter脚本。 创建日期:2017/7/20 ''' import os import re import json import sys from log import * import logging reload(sys) sys.setdefaultencoding('utf8') __dir__ = os.path.dirname(os.path.abspath(__file__)) jmeter_path = __dir__+...
liuchang6/API-test
AnalysisJmeter.py
AnalysisJmeter.py
py
3,463
python
en
code
1
github-code
7
[ { "api_name": "sys.setdefaultencoding", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.path.abspath",...
1990695923
import torch import os class Policy(torch.nn.Module): def __init__(self): super().__init__() self.hidden1 = torch.nn.Sequential( torch.nn.Linear(in_features=110, out_features=256, bias=True), torch.nn.Tanh() ) self.hidden2 = torch.nn.Sequential( ...
navidmdn/f1tenth_rl
scripts/custom_policy.py
custom_policy.py
py
1,400
python
en
code
2
github-code
7
[ { "api_name": "torch.nn", "line_number": 4, "usage_type": "attribute" }, { "api_name": "torch.nn.Sequential", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn.Linear", "l...
32354544363
from datetime import datetime from flask import Flask, render_template, request, redirect from flask_sqlalchemy import SQLAlchemy from app.commands import add, subtract, multiply, divide from app.validations import validate_number app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///database/calc...
Marius-prog/calculator
app/program.py
program.py
py
2,642
python
en
code
0
github-code
7
[ { "api_name": "app.commands", "line_number": 9, "usage_type": "name" }, { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "app.commands.config", "line_number": 10, "usage_type": "attribute" }, { "api_name": "app.commands", "l...
2668210231
from dataclasses import dataclass from os.path import relpath, abspath from .const import ( LIMITED, NORMAL, FULL, ) from .utils import formatted_current_time, File, Directory class Colors: DARK_GRAY = "\x1b[38;5;8m" LIGHT_GRAY = "\x1b[38;5;249m" GREEN = "\x1b[38;5;40m" YELLOW = "\x1b[38;...
michalpokusa/file-directory-watcher
src/file_directory_watcher/cli.py
cli.py
py
4,097
python
en
code
0
github-code
7
[ { "api_name": "dataclasses.dataclass", "line_number": 32, "usage_type": "name" }, { "api_name": "utils.formatted_current_time", "line_number": 49, "usage_type": "call" }, { "api_name": "utils.File", "line_number": 54, "usage_type": "name" }, { "api_name": "utils.D...
30308226536
import dash_bootstrap_components as dbc import dash import json import pandas as pd import requests import datetime import plotly.express as px from dash import html, dcc, Input, Output, callback, State, no_update, dash_table from auth import authenticate_user, validate_login_session from flask import session # Info ...
DMGochoa/final_prog102
UI_web/pages/reports.py
reports.py
py
6,190
python
en
code
2
github-code
7
[ { "api_name": "utils.data.Data_carrier", "line_number": 15, "usage_type": "call" }, { "api_name": "dash.html.Div", "line_number": 48, "usage_type": "call" }, { "api_name": "dash.html", "line_number": 48, "usage_type": "name" }, { "api_name": "dash.html.H2", "l...
25833809509
# 1.keywords 3个都有, 2.按长度排序 import re import scrapy from copy import deepcopy import tldextract from scrapy.linkextractors import LinkExtractor import xlrd import io,sys class SchoolspiderSpider(scrapy.Spider): name = 'schoolspider' allowed_domains = [''] # sys.stdout = io.TextIOWrapper(sys.stdout.buffe...
zbuhui/anjuke
school_518/school/spiders/schoolspider.py
schoolspider.py
py
14,419
python
en
code
0
github-code
7
[ { "api_name": "scrapy.Spider", "line_number": 11, "usage_type": "attribute" }, { "api_name": "xlrd.open_workbook", "line_number": 20, "usage_type": "call" }, { "api_name": "scrapy.Request", "line_number": 63, "usage_type": "call" }, { "api_name": "copy.deepcopy", ...
26176854597
import pytest import torch from torch.utils.data import DataLoader from torchvision import transforms from torchvision.datasets import CIFAR10 from modeling.diffusion import DiffusionModel from modeling.training import train_step from modeling.unet import UnetModel @pytest.fixture def train_dataset(): tf = trans...
mryab/efficient-dl-systems
week02_management_and_testing/homework/tests/test_pipeline.py
test_pipeline.py
py
1,296
python
en
code
467
github-code
7
[ { "api_name": "torchvision.transforms.Compose", "line_number": 14, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 14, "usage_type": "name" }, { "api_name": "torchvision.transforms.ToTensor", "line_number": 14, "usage_type": "call" }, { ...
17129825080
import os import time import json from google.cloud import datastore os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "./firstdemo-a214cb88e8b0.json" dbclient = datastore.Client(project='firstdemo-207206') kind = "Books" def get_data(id): '''Get data by Id''' key = dbclient.key(kind, str(id)) return (dbc...
SouravAggarwal/gc_appengine
firebase_datastore/gcdatastore.py
gcdatastore.py
py
667
python
en
code
0
github-code
7
[ { "api_name": "os.environ", "line_number": 7, "usage_type": "attribute" }, { "api_name": "google.cloud.datastore.Client", "line_number": 10, "usage_type": "call" }, { "api_name": "google.cloud.datastore", "line_number": 10, "usage_type": "name" }, { "api_name": "g...
14367897020
import pytest pytestmark = pytest.mark.asyncio async def test_webhook_flow(test_cli_user): guild = await test_cli_user.create_guild() channel = await test_cli_user.create_guild_channel(guild_id=guild.id) resp = await test_cli_user.post( f"/api/v6/channels/{channel.id}/webhooks", json={"name": "a...
dolfies/patchcord
tests/test_webhooks.py
test_webhooks.py
py
1,018
python
en
code
39
github-code
7
[ { "api_name": "pytest.mark", "line_number": 3, "usage_type": "attribute" } ]
75026562143
def applyRegexsToDirOfXML(directoryPath,stringPhraseList,fieldsSelect,caseSensitive=False): """ Applies a regex search to the list of inputTexts and a dictionary wherein the keys are a tuple of the string phrase and the file name and the values are booleans indicating whether the string phrase was found in the ...
DanNBullock/USG_grants_crawl
src/daskFuncs.py
daskFuncs.py
py
19,126
python
en
code
1
github-code
7
[ { "api_name": "os.listdir", "line_number": 29, "usage_type": "call" }, { "api_name": "dask.bag.from_sequence", "line_number": 39, "usage_type": "call" }, { "api_name": "dask.bag", "line_number": 39, "usage_type": "name" }, { "api_name": "os.path.join", "line_n...
41345218528
#!/usr/bin/env python3 """ Usage: git-cloner [ -n ] [ --workspace <folder> ] <url> Options: --workspace <folder> The default folder we extract sites to [default: ~/projects] -n Dry run - show what you would do """ # ~/.gitconfig # [alias] # cloner = !~/bin/git-cloner.py import s...
rbuckland/workstation
HOME/bin/git-cloner.py
git-cloner.py
py
1,269
python
en
code
0
github-code
7
[ { "api_name": "urllib.parse.urlparse", "line_number": 27, "usage_type": "call" }, { "api_name": "urllib.parse.urlparse", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path",...
14131602097
####################################################################### ## (C)Copyright 2023 Hewlett Packard Enterprise Development LP ## Licensed under the Apache License, Version 2.0 (the "License"); you may ## not use this file except in compliance with the License. You may obtain ## a copy of the License at ##...
HewlettPackard/swarm-learning
lib/src/python-client/swarmlearning/com/bridge.py
bridge.py
py
9,747
python
en
code
286
github-code
7
[ { "api_name": "typing.Union", "line_number": 29, "usage_type": "name" }, { "api_name": "swarmlearning.com.swifrpc_pb2.Status", "line_number": 30, "usage_type": "attribute" }, { "api_name": "swarmlearning.com.swifrpc_pb2", "line_number": 30, "usage_type": "name" }, { ...
72869771742
from torch import nn from torch.autograd import Function from torch.autograd.function import once_differentiable from tensormask import _C class _SwapAlign2Nat(Function): @staticmethod def forward(ctx, X, lambda_val, pad_val): ctx.lambda_val = lambda_val ctx.input_shape = X.size() Y ...
Ascend/ModelZoo-PyTorch
PyTorch/dev/cv/image_classification/SlowFast_ID0646_for_PyTorch/detectron2/projects/TensorMask/tensormask/layers/swap_align2nat.py
swap_align2nat.py
py
2,032
python
en
code
31
github-code
7
[ { "api_name": "torch.autograd.Function", "line_number": 8, "usage_type": "name" }, { "api_name": "tensormask._C.swap_align2nat_forward", "line_number": 14, "usage_type": "call" }, { "api_name": "tensormask._C", "line_number": 14, "usage_type": "name" }, { "api_nam...
2644067387
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html from pymongo import MongoClient client = MongoClient() collection = client["douban"]["movie"] class DoubanPipeline(object):...
Xiao-X-Qiang/Python_Coding
Spider/douban_work/douban/pipelines.py
pipelines.py
py
491
python
en
code
2
github-code
7
[ { "api_name": "pymongo.MongoClient", "line_number": 10, "usage_type": "call" } ]
36759247256
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- from utils import connection_util class DataCollection(object): def __init__(self): self._target_url = 'https://www.scrapingbee.com/blog/' self._init_connection = connection_util.ProcessConnection() def main(self): # 连接目标网站,获取内容 ...
sycct/Scrape_1_1
data_collection.py
data_collection.py
py
1,302
python
en
code
4
github-code
7
[ { "api_name": "utils.connection_util.ProcessConnection", "line_number": 10, "usage_type": "call" }, { "api_name": "utils.connection_util", "line_number": 10, "usage_type": "name" } ]
28901170930
import data import question_model import quiz_brain question_bank = [] for question in data.question_data: q = question_model.Question(question["question"], question["correct_answer"]) question_bank.append(q) quiz = quiz_brain.QuizBrain(question_bank) while quiz.still_has_questions(): quiz.next_questio...
arsovskidev/100-days-of-code
day-017/project/main.py
main.py
py
422
python
en
code
4
github-code
7
[ { "api_name": "data.question_data", "line_number": 7, "usage_type": "attribute" }, { "api_name": "question_model.Question", "line_number": 8, "usage_type": "call" }, { "api_name": "quiz_brain.QuizBrain", "line_number": 11, "usage_type": "call" } ]