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
23552489654
from re import I import numpy as np import gym import random """ 常に観測値として1を返す環境 環境に対して取るべき行動が周期的に切り替わり、 それに応じて報酬が決定される。 """ class StaticCyclicEnv0(gym.Env): def __init__(self, cycle, cycle_cnt_max, action_num, noise): super().__init__() self.cycle = cycle assert self.cycle % action_num == ...
kato-mahiro/periodic_task_experiment
myenvs/myenvs.py
myenvs.py
py
2,339
python
en
code
0
github-code
36
[ { "api_name": "gym.Env", "line_number": 12, "usage_type": "attribute" }, { "api_name": "gym.spaces.Discrete", "line_number": 22, "usage_type": "call" }, { "api_name": "gym.spaces", "line_number": 22, "usage_type": "attribute" }, { "api_name": "gym.spaces.Box", ...
21098832887
#!/usr/bin/python3 import os import sys import argparse import re if __name__ == '__main__': infile_format = '' cmd_opts = [] id_pat = r'' alt_id_pat = r'' parser = argparse.ArgumentParser(description = """ """) parser.add_argument('-i', '--infile', help = f'Speciefies path to input...
jonasfreimuth/dbp-exercises
templates/cli_template.py
cli_template.py
py
1,556
python
en
code
0
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path", "line_number": 32, "usage_type": "attribute" }, { "api_name": "sys.exit", "l...
16774999516
from django_cas_ng import views as cas_views from django_cas_ng.models import ProxyGrantingTicket, SessionTicket from django_cas_ng.utils import get_protocol, get_redirect_url, get_cas_client from django_cas_ng.signals import cas_user_logout from django.http import JsonResponse, HttpRequest, HttpResponse, HttpResponseR...
ferenica/sipraktikum-backend
authentication/cas_wrapper.py
cas_wrapper.py
py
3,330
python
en
code
0
github-code
36
[ { "api_name": "rest_framework_jwt.settings.api_settings.JWT_PAYLOAD_HANDLER", "line_number": 14, "usage_type": "attribute" }, { "api_name": "rest_framework_jwt.settings.api_settings", "line_number": 14, "usage_type": "name" }, { "api_name": "rest_framework_jwt.settings.api_settin...
11934438668
from collections import Counter from typing import Counter def main(): t = int(input()) for i in range(t): n = int(input()) nums = list(map(int, input().split())) count = Counter(nums) print(count) main()
Misganaw-Berihun/CONTESTS
After_study_contest_4/Equalize_the_Array.py
Equalize_the_Array.py
py
245
python
en
code
0
github-code
36
[ { "api_name": "typing.Counter", "line_number": 8, "usage_type": "call" } ]
36189617286
import requests url_f = "https://shiqianjiang.cn/home/image/bg" url_e = ".webp" headers = { 'Accept': 'image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8', 'Accept-Language': 'zh-CN,zh;q=0.9', 'Connection': 'keep-alive', 'Referer': 'https://shiqianjiang.cn/home/', 'Sec-Fetch-Dest': '...
wuheyouzi/code
PycharmProjects/test/shiqianjiang/shiqianjiang.py
shiqianjiang.py
py
1,346
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 25, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 30, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 35, "usage_type": "call" } ]
36584541657
import logging from datetime import datetime from pymongo import MongoClient, UpdateOne class UrlRepository: def __init__(self): mongo_client = MongoClient('mongodb://mongodb:27017/') mongo_db = mongo_client['crawler_db'] self.collection = mongo_db['urls'] try: self.co...
HarrYoha/url_explorer
src/repositories/url_repository.py
url_repository.py
py
838
python
en
code
0
github-code
36
[ { "api_name": "pymongo.MongoClient", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 21, "usage_type": "name" }, { "api_name": "pymongo.Up...
74537088743
# stdlib imports import asyncio import time # project imports import asyncio_cpu import asyncio_io if __name__ == "__main__": start_time = time.time() loop = asyncio.get_event_loop() io_start = time.time() api_data = loop.run_until_complete(asyncio_io.get_data()) print(f"\nDone. IO bound time: {...
bdelate/talk-python-async
src/asyncio_main.py
asyncio_main.py
py
592
python
en
code
2
github-code
36
[ { "api_name": "time.time", "line_number": 11, "usage_type": "call" }, { "api_name": "asyncio.get_event_loop", "line_number": 12, "usage_type": "call" }, { "api_name": "time.time", "line_number": 14, "usage_type": "call" }, { "api_name": "asyncio_io.get_data", ...
26336332994
import pytest from ui.locators import basic_locators from base import BaseCase class Test_Target(BaseCase): @pytest.mark.UI def test_login(self): self.log_in('alena1997999@gmail.com', 'tWz+H@&Gws#Yj7L') assert 'Кампании' in self.driver.title @pytest.mark.UI def test_logout(self): ...
penguin7707/demo
code/test_hm1.py
test_hm1.py
py
1,317
python
en
code
0
github-code
36
[ { "api_name": "base.BaseCase", "line_number": 6, "usage_type": "name" }, { "api_name": "pytest.mark", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pytest.mark", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pytest.mark", "line...
37941848319
from kivy.uix.screenmanager import ScreenManager, Screen from tasks.tsks import A class Scrn_manger: sm = ScreenManager() name = "" sc = Screen(name="tasks") # main.right.dodBtn.bind(on_press=main.dod) def to_lists(self, sc, a): self.sm.current = "lists" self.sm.remove_widget(sc)...
domenSedlar/ToDoAppClient
scrn_mangr.py
scrn_mangr.py
py
874
python
en
code
0
github-code
36
[ { "api_name": "kivy.uix.screenmanager.ScreenManager", "line_number": 6, "usage_type": "call" }, { "api_name": "kivy.uix.screenmanager.Screen", "line_number": 8, "usage_type": "call" }, { "api_name": "tasks.tsks.A", "line_number": 24, "usage_type": "call" } ]
40047690606
import csv import os import datetime from datetime import date, datetime, timedelta import matplotlib.pyplot as plt from rich.console import Console console = Console() current_date = date.today().strftime("%d/%m/%Y") # Generates unique ID for each new line in each csv file def generate_id(file_name): with open(...
Juliazijd/winc_superpy
superpy/helpers/buy_sell_products.py
buy_sell_products.py
py
6,563
python
en
code
0
github-code
36
[ { "api_name": "rich.console.Console", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.date.today", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 10, "usage_type": "name" }, { "api_name": "csv.reader", ...
18659247749
import numpy as np import pandas as pd from sklearn.model_selection import KFold, train_test_split from sklearn.preprocessing import LabelEncoder,OneHotEncoder from keras.utils import np_utils import tensorflow as tf from MB_nn import MB_nn from keras.utils.np_utils import to_categorical from sklearn.metrics import ...
EricXue92/MB_NN
main.py
main.py
py
5,247
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 46, "usage_type": "call" }, { "api_name": "numpy.isnan", "line_number": 49, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 55, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.One...
15130212540
# A brief script to convert GIF files to RAW with Vector's screen dimensions. Use GIF files that are 184x96 for best results. # Expected Python Version is 3.9. import os,sys #import struct import array from PIL import Image #import Image SCREEN_WIDTH,SCREEN_HEIGHT = 184,96 #240,240 #180,240 SIZE = (SCREEN_WIDTH,SCREE...
digital-dream-labs/oskr-owners-manual
examples/change_boot_anim/gif_to_raw.py
gif_to_raw.py
py
2,400
python
en
code
35
github-code
36
[ { "api_name": "array.array", "line_number": 45, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 49, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 49, "usage_type": "name" }, { "api_name": "os.path.basename", "line_num...
15058607422
# Importing the ChoiceMC class import sys import os try: from ChoiceMC import ChoiceMC, loadResult except ModuleNotFoundError: sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))) from ChoiceMC import ChoiceMC, loadResult import matplotlib.pyplot as plt import time import num...
AndrewBright34/ChoiceMC
Parametric_Sweeps/ChoiceMC_Sweep_Entanglement.py
ChoiceMC_Sweep_Entanglement.py
py
6,148
python
en
code
0
github-code
36
[ { "api_name": "sys.path.append", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number...
37728423811
from tkinter import * import pyttsx3 import PIL.ImageOps from PIL import Image import numpy as np from PIL import EpsImagePlugin import tensorflow as tf import matplotlib.pyplot as plt import threading import random import time oldtext = "" physical_devices = tf.config.experimental.list_physical_devices('GPU') if len(...
galbb12/quick-draw-full-python-tkinter
quick draw.py
quick draw.py
py
10,113
python
en
code
1
github-code
36
[ { "api_name": "tensorflow.config.experimental.list_physical_devices", "line_number": 14, "usage_type": "call" }, { "api_name": "tensorflow.config", "line_number": 14, "usage_type": "attribute" }, { "api_name": "tensorflow.config.experimental.set_memory_growth", "line_number":...
27182569232
import asyncio async def num(number): print("before calling coroutine") await asyncio.sleep(1) print('after calling coroutine') return str(number) loop = asyncio.get_event_loop() # n = num(5) l= loop.run_until_complete(num(5)) print(l) loop = asyncio.get_event_loop() # c = loop.create_task(num(5)) #...
sivanagarajumolabanti/Chromata
asyncbasic/asyncfuture.py
asyncfuture.py
py
364
python
en
code
0
github-code
36
[ { "api_name": "asyncio.sleep", "line_number": 6, "usage_type": "call" }, { "api_name": "asyncio.get_event_loop", "line_number": 10, "usage_type": "call" }, { "api_name": "asyncio.get_event_loop", "line_number": 15, "usage_type": "call" } ]
38985342452
######################################################### ### Train & Register Insurance Claims Model ### ######################################################### ################### ### Credentials ### ################### import keyring import getpass import runpy import os from pathlib import Path import...
christopher-parrish/sas_viya
python/tweedie_regressor_python/insurance_claims_auto/pure_premium_python_insuranceclaimsauto.py
pure_premium_python_insuranceclaimsauto.py
py
17,181
python
en
code
1
github-code
36
[ { "api_name": "urllib3.disable_warnings", "line_number": 15, "usage_type": "call" }, { "api_name": "runpy.run_path", "line_number": 20, "usage_type": "call" }, { "api_name": "keyring.get_password", "line_number": 21, "usage_type": "call" }, { "api_name": "keyring....
11672647873
import numpy as np import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import random fig = plt.figure(figsize=(16,12)) ax = fig.add_subplot(111,projection='3d') x1 = np.arange(-5,5,0.5) x2 = np.arange(-5,5,0.5) x1,x2 = np.meshgrid(x1,x2) ax.set_xlim(-5,5) ...
akaranjkar/PSO
plot.py
plot.py
py
929
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.use", "line_number": 3, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 8, "usage_type": "name" }, { "api_name": "numpy.arange",...
16002420757
#!/usr/bin/python3 import os import cv2 def Smoothing(image_name): res_dir = os.environ["PY_IMG"] if res_dir is None: print("[ERROR] Resources path isn't defined") # Convertimos a escala de grises original_image = cv2.imread(res_dir + "/" + image_name, cv2.IMREAD_GRAYSCALE) if original_ima...
Madophs/Image-Processsing
filters/Smoothing.py
Smoothing.py
py
1,790
python
en
code
0
github-code
36
[ { "api_name": "os.environ", "line_number": 6, "usage_type": "attribute" }, { "api_name": "cv2.imread", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.IMREAD_GRAYSCALE", "line_number": 11, "usage_type": "attribute" }, { "api_name": "cv2.imshow", ...
30391214782
from django.contrib.auth import authenticate, login from django.contrib.auth.decorators import login_required from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin from django.core.exceptions import PermissionDenied from django.shortcuts import render, get_object_or_404 from .models import * fr...
sikkzz/cloudprogramming
shop/views.py
views.py
py
3,758
python
en
code
0
github-code
36
[ { "api_name": "django.shortcuts.get_object_or_404", "line_number": 22, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 24, "usage_type": "call" }, { "api_name": "django.shortcuts.get_object_or_404", "line_number": 34, "usage_type": "call" ...
24556338376
import hashlib import json import os import argparse import sys import hmac import re import signal from multiprocessing import Process from flask import request import requests from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes from cryptography.hazmat.primitives.ciphers.algorithms import AES...
tolojo/bank-SA-22-23
Phase 1/Client/Client.py
Client.py
py
12,283
python
en
code
0
github-code
36
[ { "api_name": "re.compile", "line_number": 17, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 18, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 19, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_...
21518532065
""" Script for converting json annotations in to csv format for training Only takes into consideration tool boundary boxes # Re-implementation from new git clone surgery tool detection # """ import csv import json import argparse from pathlib import Path from PIL import Image DATA_DIR = str(Path(__file__).resolve(...
egoodman92/semi-supervised-surgery
MULTITASK_FILES/RETINANET_FILES/src/util/convert_data2.py
convert_data2.py
py
5,607
python
en
code
0
github-code
36
[ { "api_name": "pathlib.Path", "line_number": 14, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 46, "usage_type": "call" }, { "api_name": "json.load", "line_number": 48, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number":...
28956742527
import argparse from pickle import NONE import random from wordfreq import zipf_frequency from constants import * def get_difficulty_to_words_map(difficulty=None): difficulty_to_words_map = {} for word in WORDS: difficulty = get_word_difficulty(word) if difficulty not in difficulty_to_words_map...
ravaan/wordle
utils.py
utils.py
py
3,121
python
en
code
0
github-code
36
[ { "api_name": "wordfreq.zipf_frequency", "line_number": 21, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 34, "usage_type": "call" }, { "api_name": "pickle.NONE", "line_number": 36, "usage_type": "name" }, { "api_name": "random.choice", ...
26458087607
import unittest import sys import importlib from math import sqrt import BaseTypes import model class TestChromosome(unittest.TestCase): def setUp(self): self.naturalNumberN = model.Nucleotide(domain=BaseTypes.IntInterval(0,9)) self.lessThan100N = model.Nucleotide(domain=BaseTypes.IntInterval(0,99)...
rtorres19/pyevalres
test_Chromosome.py
test_Chromosome.py
py
1,705
python
en
code
0
github-code
36
[ { "api_name": "unittest.TestCase", "line_number": 8, "usage_type": "attribute" }, { "api_name": "model.Nucleotide", "line_number": 10, "usage_type": "call" }, { "api_name": "BaseTypes.IntInterval", "line_number": 10, "usage_type": "call" }, { "api_name": "model.Nu...
2594269249
# This is purely the result of trial and error. import os import sys import codecs import subprocess from setuptools import setup from setuptools import find_packages import aiowrpr INSTALL_REQUIRES = [ 'aiodns==2.0.0', 'aiohttp[speedups]>=3.7.4', 'aiohttp-apispec==2.1.0', 'apispec==3.2.0', 'asyn...
ishirshov/aiowrpr
setup.py
setup.py
py
2,821
python
en
code
0
github-code
36
[ { "api_name": "sys.version_info", "line_number": 35, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 36, "usage_type": "call" }, { "api_name": "sys.version_info", "line_number": 37, "usage_type": "attribute" }, { "api_name": "codecs.open", ...
38555784326
import os import sys import docx2python # Program to convert MS-Word pastes into a less # annoying text file layout. # Certain unicode symbols can be annoying to work with. TRANSLATION_TABLE = [ ("“", "\""), ("”", "\""), ("„", "\""), ("’", "'"), ("–", "-"), ("…", "..."), ("•", "*"), ] def write_output(...
TeilzeitTaco/flesh-network-blog
src/tools/indenter.py
indenter.py
py
4,906
python
en
code
0
github-code
36
[ { "api_name": "os.path.exists", "line_number": 97, "usage_type": "call" }, { "api_name": "os.path", "line_number": 97, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 99, "usage_type": "call" }, { "api_name": "os.path", "line_number": 105...
7971934328
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from nnAudio import Spectrogram from .constants import * from .Unet_blocks import * import sys import abc from .normalization import Normalization from torchvision.models import resnet18 batchNorm_momentum = 0.1 num_instruments = 1 ...
w4k2/automatic_music_transcription
model/instrument_recognition_model.py
instrument_recognition_model.py
py
6,038
python
en
code
0
github-code
36
[ { "api_name": "nnAudio.Spectrogram.CQT1992v2", "line_number": 21, "usage_type": "call" }, { "api_name": "nnAudio.Spectrogram", "line_number": 21, "usage_type": "name" }, { "api_name": "nnAudio.Spectrogram.MelSpectrogram", "line_number": 25, "usage_type": "call" }, { ...
30800487358
import time, datetime from screener import Screener import os, yaml def log(msg): print(f"[{datetime.datetime.now()}] - {msg}") config = yaml.safe_load(open("config.yaml","r")) folder_left = config['folder_left'] folder_substats = config['folder_substats'] sec_between_screenshot = co...
FrenchieTucker/RPGgearDetection
main_scraper.py
main_scraper.py
py
1,035
python
en
code
0
github-code
36
[ { "api_name": "datetime.datetime.now", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 9, "usage_type": "attribute" }, { "api_name": "yaml.safe_load", "line_number": 12, "usage_type": "call" }, { "api_name": "os.makedirs...
8365459714
import pytest from .. import * # this is not necessary but mypy complains if it's not included from .. import CompileOptions options = CompileOptions() def test_cond_one_pred(): expr = Cond([Int(1), Int(2)]) assert expr.type_of() == TealType.uint64 cond1, _ = Int(1).__teal__(options) pred1, _ = In...
gconnect/voting-dapp-pyteal-react
venv/lib/python3.8/site-packages/pyteal/ast/cond_test.py
cond_test.py
py
3,458
python
en
code
6
github-code
36
[ { "api_name": "pytest.raises", "line_number": 112, "usage_type": "call" }, { "api_name": "pytest.raises", "line_number": 115, "usage_type": "call" }, { "api_name": "pytest.raises", "line_number": 118, "usage_type": "call" }, { "api_name": "pytest.raises", "lin...
21217260203
import sqlite3 as sq from others import funcs as f def sql_start(): global base, cur base = sq.connect('bd_crypto_users.db') cur = base.cursor() if base: print('BD connected') base.execute('CREATE TABLE IF NOT EXISTS {}(id PRIMARY KEY, USDT,BTC,ETH)'.format('data')) base.commit() def...
AKAMElmf/crypto_trade_bot
database/sqlite_bd.py
sqlite_bd.py
py
2,756
python
en
code
0
github-code
36
[ { "api_name": "sqlite3.connect", "line_number": 7, "usage_type": "call" }, { "api_name": "others.funcs.check_crypto_name", "line_number": 42, "usage_type": "call" }, { "api_name": "others.funcs", "line_number": 42, "usage_type": "name" }, { "api_name": "others.fun...
13870980492
# 수집할 정보에 대응하는 CSS선택자를 각각 문자열 하나로 만들고, 이들을 딕셔너리 객체에 모아서 BeautifulSoup select함수와 사용하는 기법 # Content는 \ import requests from bs4 import BeautifulSoup class Content: ''' 글/페이지 전체에 사용할 기반 클래스 ''' def __init__(self, url, title, body): self.url = url self.title = title self.body = body...
hye0ngyun/PythonPractice
books/webScraping/chap04/chap04Ex2.py
chap04Ex2.py
py
2,936
python
ko
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 42, "usage_type": "call" }, { "api_name": "requests.exceptions", "line_number": 43, "usage_type": "attribute" }, { "api_name": "bs4.BeautifulSoup", "line_number": 45, "usage_type": "call" } ]
6554352748
from __future__ import annotations # IMPORTS # =======> # noinspection PyUnresolvedReferences import typing from util.formatter.TextColor import * from util.formatter.TextEffects import * from dataclasses import dataclass, field from copy import deepcopy # EXPORTS # =======> __all__ = [ 'FormatString' ] # MAI...
ButterSus/KiwiPreview
util/formatter/FormatString.py
FormatString.py
py
6,736
python
en
code
0
github-code
36
[ { "api_name": "typing.Any", "line_number": 56, "usage_type": "attribute" }, { "api_name": "dataclasses.field", "line_number": 56, "usage_type": "call" }, { "api_name": "typing.Iterable", "line_number": 57, "usage_type": "attribute" }, { "api_name": "dataclasses.fi...
38666647232
from requests.adapters import BaseAdapter from requests.compat import urlparse, unquote from requests import Response, codes import errno import os import stat import locale import io from six import BytesIO class FileAdapter(BaseAdapter): def __init__(self, set_content_length=True): super(FileAdapter, s...
JimmXinu/FanFicFare
included_dependencies/requests_file.py
requests_file.py
py
4,729
python
en
code
664
github-code
36
[ { "api_name": "requests.adapters.BaseAdapter", "line_number": 13, "usage_type": "name" }, { "api_name": "requests.compat.urlparse", "line_number": 30, "usage_type": "call" }, { "api_name": "requests.Response", "line_number": 36, "usage_type": "call" }, { "api_name...
2248843568
import os import glob import subprocess import pandas as pd from PIL import Image import datetime datetime.timedelta.min def get_date_taken(path): return Image.open(path)._getexif()[36867] #enter in the directory of your images in the line below os.chdir('D:/mgickdemo/images') cwd = os.getcwd() #unfortunately yo...
Owen-Duncan/LeafAreaQuant
Main.py
Main.py
py
2,123
python
en
code
0
github-code
36
[ { "api_name": "datetime.timedelta", "line_number": 9, "usage_type": "attribute" }, { "api_name": "PIL.Image.open", "line_number": 11, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 11, "usage_type": "name" }, { "api_name": "os.chdir", "line_...
26222486814
import json from datetime import datetime from . import calc_func from .db_queries_source import * from .connection_to_database import create_connection conn = '' def insert_to_db(city_sender, city_recipient, urgency, type_of_cargo, weight, delivery_type, lenght, width, height, declared_value_rate...
DamirF/IB
database_admin/psg_cse_api/psg_cse_api_tools/cse_to_db.py
cse_to_db.py
py
4,246
python
en
code
0
github-code
36
[ { "api_name": "datetime.datetime.now", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 14, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 37, "usage_type": "call" }, { "api_name": "datetim...
19294805910
import discord from discord.ext import commands from cogs.errors import WegbotException @commands.command(hidden=False, name="pin", brief="Pin a message.", rest_is_raw=True) @commands.guild_only() async def pin_that(self, ctx, message_id: int, *, addition=None): """ Pins the message with the given ID. You ma...
ChaoticWeg/wegbot2-discord
cogs/messaging/pin.py
pin.py
py
1,566
python
en
code
1
github-code
36
[ { "api_name": "cogs.errors.WegbotException", "line_number": 20, "usage_type": "call" }, { "api_name": "discord.Embed", "line_number": 22, "usage_type": "call" }, { "api_name": "cogs.errors.WegbotException", "line_number": 28, "usage_type": "name" }, { "api_name": ...
324210528
import yaml from airflow.models import DAG from airflow.operators.python_operator import PythonOperator from airflow.operators.bash_operator import BashOperator def run(script): execFile('/root/airflow/runtime/{}'.format(script)) def create_python_task(task, dag): if 'executor_config' in task: t = P...
Nanjo-Naoto/450
parser.py
parser.py
py
1,565
python
en
code
0
github-code
36
[ { "api_name": "airflow.operators.python_operator.PythonOperator", "line_number": 13, "usage_type": "call" }, { "api_name": "airflow.operators.python_operator.PythonOperator", "line_number": 16, "usage_type": "call" }, { "api_name": "airflow.operators.bash_operator.BashOperator", ...
34715529563
from torchvision import datasets, transforms from base import BaseDataLoader from torch.utils.data import Dataset, ConcatDataset from data_loader import EcalDataIO import torch import random from pathlib import Path import numpy as np from collections import Counter CSV_LEN = 25410 # --------------------------------...
elihusela/LUXE-project-master
data_loader/data_loaders_backup.py
data_loaders_backup.py
py
15,351
python
en
code
0
github-code
36
[ { "api_name": "base.BaseDataLoader", "line_number": 17, "usage_type": "name" }, { "api_name": "torchvision.transforms.Compose", "line_number": 24, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 24, "usage_type": "name" }, { "api_nam...
40631353290
import json from odata import ODataHandler def test_service_endpoint(service, endpoint="", urlparams={}, sap_client = '100', print_result=False): """Simple test function for odata service""" odatahandler = ODataHandler() slash = "" if endpoint == "" else "/" service_endpoint = "/%s%s%s" % (service, sl...
asumansuenbuel/ewm-access
src/test_ewm_connection.py
test_ewm_connection.py
py
1,617
python
en
code
0
github-code
36
[ { "api_name": "odata.ODataHandler", "line_number": 7, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 17, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 19, "usage_type": "call" } ]
7814426661
from django.core.cache import cache from kavenegar import * from redis.exceptions import ConnectionError as RedisServerConnectionError KEY_KAVENEGAR = '4442494F6A77766776746B3444575466373961693741335956544F6B45683669556B6C7731493538534A413D' SENDER = '1000596446' def send_smd(code, phone): api = KavenegarAPI(KEY...
atefesharifi/login-register-and-dashboard
common/utilities.py
utilities.py
py
683
python
en
code
0
github-code
36
[ { "api_name": "django.core.cache.cache.set", "line_number": 17, "usage_type": "call" }, { "api_name": "django.core.cache.cache", "line_number": 17, "usage_type": "name" }, { "api_name": "redis.exceptions.ConnectionError", "line_number": 18, "usage_type": "name" }, { ...
31454265122
import argparse import subprocess import os # Create argument parser parser = argparse.ArgumentParser(description='Create and build base UFS case') parser.add_argument("--project", default=None, help='Project to charge', required=True) parser.add_argument("--tag", default=None, help='Model tag', required=True) parser....
benjamin-cash/ufs_utils
ufs_cold_start.py
ufs_cold_start.py
py
2,759
python
en
code
0
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 6, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 26, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 26, "usage_type": "attribute" }, { "api_name": "os.chdir", ...
22280407323
from django.shortcuts import render, redirect from django.http import HttpResponse from django.http import JsonResponse # Create your views here. from server.settings import TENCENT_KEY from app01.models import User def index(request): is_login = request.session.get('is_login', None) print(f'is_login: {is_lo...
LincolnBurrows/my-wechat-mini-program
server/app01/views.py
views.py
py
2,661
python
en
code
0
github-code
36
[ { "api_name": "django.shortcuts.redirect", "line_number": 14, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 15, "usage_type": "call" }, { "api_name": "app01.models.User", "line_number": 27, "usage_type": "call" }, { "api_name": "d...
28418721166
# Implementation of Selenium WebDriver with Python using PyTest import pytest from selenium import webdriver from webdriver_manager.chrome import ChromeDriverManager from selenium.webdriver.common.by import By import sys from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.keys import Ke...
syedsair/rateer-automated-tests
UI/rate.py
rate.py
py
4,624
python
en
code
0
github-code
36
[ { "api_name": "faker.Faker", "line_number": 12, "usage_type": "call" }, { "api_name": "selenium.webdriver.common.by.By.XPATH", "line_number": 23, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.common.by.By", "line_number": 23, "usage_type": "name" }, {...
36748147361
import string import requests from fudge import __version__ from fudge.utils import FudgeException def get_repository_name(repo_url): repo_url = repo_url.rstrip('/') repo_name = repo_url.split('/')[-1].rstrip('.git') whitelist = set([char for char in string.ascii_letters + string.digits + '-_']) if...
QuantamKawts/fudge
fudge/protocol.py
protocol.py
py
3,209
python
en
code
0
github-code
36
[ { "api_name": "string.ascii_letters", "line_number": 13, "usage_type": "attribute" }, { "api_name": "string.digits", "line_number": 13, "usage_type": "attribute" }, { "api_name": "fudge.utils.FudgeException", "line_number": 15, "usage_type": "call" }, { "api_name"...
2920768004
from flask_smorest import Blueprint from flask.views import MethodView from src.contextmanager import DatabaseContextManager from src.models import Chama import uuid from src.schema import ( ChamaSchema, ChamaDisplaySchema, ChamaCreateSchema ) chama_router = Blueprint('chama endpoints', __name__) @chama_r...
kenreagan/ChamaYetuBackend
src/Chama/__init__.py
__init__.py
py
1,904
python
en
code
0
github-code
36
[ { "api_name": "flask_smorest.Blueprint", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.views.MethodView", "line_number": 15, "usage_type": "name" }, { "api_name": "src.contextmanager.DatabaseContextManager", "line_number": 18, "usage_type": "call" }, ...
586765290
import os import sys import argparse import numpy as np import pdb sys.path.append("../datasets") from trainDataset import volume_loader def parse_args(): parser = argparse.ArgumentParser(description="Deep Learning Model") parser.add_argument("--root", required=True, type=str, help="roo...
trainsn/TSR-TVD
eval/lerp.py
lerp.py
py
1,736
python
en
code
1
github-code
36
[ { "api_name": "sys.path.append", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.join", ...
14950275682
from flask import Flask, render_template, render_template, request, redirect, session from . import auth, queries, uploads from .utils import Settings app = Flask(__name__) app.secret_key = Settings().secret_key API_BASE_URL = "http://app:8080" # Replace with the actual base URL of your API # Register blueprints ap...
talhaanwarch/openai-chatbot
frontend/app.py
app.py
py
551
python
en
code
3
github-code
36
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "utils.Settings", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 17, "usage_type": "call" } ]
74523493544
import matplotlib.pyplot as plt import glob import os import argparse # File select index out of range exception class ValueOutOfRange(Exception): def __str__(self): return 'Value out of range' data_path = None parser = argparse.ArgumentParser() parser.add_argument('--data', '-d', nargs='?', action='st...
EHAerospace/EHA-TestStand
graph/graph.py
graph.py
py
2,669
python
en
code
1
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "os.path.abspath"...
70806707943
import datetime from django.http import HttpResponse from django.shortcuts import get_object_or_404, redirect, render from .models import * from .functions import method from django.http import JsonResponse # Create your views here. def index(request): current_time = datetime.datetime.now() formatted_time = c...
umleeho1/sugangapply
sugang/views.py
views.py
py
2,242
python
en
code
0
github-code
36
[ { "api_name": "datetime.datetime.now", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 11, "usage_type": "attribute" }, { "api_name": "django.shortcuts.render", "line_number": 14, "usage_type": "call" }, { "api_name": "...
4867507385
#!/usr/bin/python3 import numpy as np import pickle import matplotlib.pyplot as plt from matplotlib.patches import FancyArrowPatch from mpl_toolkits.mplot3d import proj3d from mpl_toolkits.mplot3d import axes3d # defining the class for later 3D arrow plots class Arrow3D(FancyArrowPatch): def __init__(self, xs, y...
Schlabonski/LennardJonesGas
plotting.py
plotting.py
py
4,026
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.patches.FancyArrowPatch", "line_number": 12, "usage_type": "name" }, { "api_name": "matplotlib.patches.FancyArrowPatch.__init__", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.patches.FancyArrowPatch", "line_number": 14, "u...
33677649557
from fastapi.routing import APIRouter from typing import Annotated from fastapi import Depends from app.main.factories import ( make_db_list_videos, make_db_list_my_videos, make_db_list_friends_videos ) from app.schemas.video import VideosListOut from app.infra.auth import JwtBearer from app.main.config imp...
Mauricio-Silva/backend-user
app/main/routes/video.py
video.py
py
1,610
python
en
code
0
github-code
36
[ { "api_name": "fastapi.routing.APIRouter", "line_number": 14, "usage_type": "call" }, { "api_name": "app.main.config.PREFIX", "line_number": 14, "usage_type": "name" }, { "api_name": "app.main.factories.make_db_list_videos", "line_number": 26, "usage_type": "call" }, ...
19365768268
import telebot import re import pymongo from datetime import datetime from telebot import types from bson.objectid import ObjectId from config import * bot = telebot.TeleBot(TOKEN) db = pymongo.MongoClient('mongodb://localhost:27017/').kunyn_team working_obj = {} for player in db.players.find(): working_obj[play...
andrii-porokhnavets/telegram_bots
scoring/main.py
main.py
py
11,279
python
en
code
0
github-code
36
[ { "api_name": "telebot.TeleBot", "line_number": 9, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 11, "usage_type": "call" }, { "api_name": "telebot.types.ReplyKeyboardMarkup", "line_number": 65, "usage_type": "call" }, { "api_name": "...
22995979758
from time import sleep import pytest #找到测试用例,执行 import requests #发送请求的包 from common.send_request import SendRequest #导入公共的请求类 from common.yaml_util import write_yaml, read_yaml #yaml文件的操作 # scope="function"-为函数级别 scope="class"-类级别 scope="session"-表示回话 autouse=False-不自动执行 params-数据驱动 ids-数据驱动的别名 name-别名 # @pytes...
xmtxy/pytest
test_case/bzx_test_api.py
bzx_test_api.py
py
4,370
python
zh
code
0
github-code
36
[ { "api_name": "common.send_request.SendRequest", "line_number": 45, "usage_type": "call" }, { "api_name": "common.yaml_util.write_yaml", "line_number": 48, "usage_type": "call" } ]
36539454569
# -*- coding:utf-8 -*- #Name: #Descripton: #Author: smartwy #Date: #Version: import os # print('Process (%s) start ...'%os.getpid()) # # pid = os.fork() # windows 没有fork调用,linux unix Mac支持fork调用 # # if pid == 0: # print('I am child process (%s) and my parent is %s .'%(os.getpid(),os.getppid())) ...
smartwy/python_test
练习文件/多进程.py
多进程.py
py
2,102
python
en
code
0
github-code
36
[ { "api_name": "os.getpid", "line_number": 43, "usage_type": "call" }, { "api_name": "time.time", "line_number": 44, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 45, "usage_type": "call" }, { "api_name": "random.random", "line_number": 45,...
2583396106
import yaml def get_latest_jdk(distroJdks): latest = None latestInt = 0 for jdk in distroJdks: if jdk == "latest": latest = jdk latestInt = 999 elif int(jdk) > latestInt: latest = jdk latestInt = int(jdk) return latest def get_lts_jdk(jdk...
basicimg/images
basicimg-actions-generator/jdk.py
jdk.py
py
2,187
python
en
code
0
github-code
36
[ { "api_name": "yaml.safe_load", "line_number": 26, "usage_type": "call" } ]
34948989285
import torch import os import logging import datetime import argparse import json import pandas as pd import numpy as np from tqdm import tqdm from generative_utils import load_model, load_context, process_outputs def inference(model, tokenizer, question, context, no_ans_threshold, ans_threshold, max_length=4096, s...
Kreik2809/Open-Book-Question-Answering
inference/src/generative_inference.py
generative_inference.py
py
12,340
python
en
code
0
github-code
36
[ { "api_name": "tqdm.tqdm", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.tensor", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.no_grad", "line_number": 25, "usage_type": "call" }, { "api_name": "generative_utils.process_outputs...
21694229487
import numpy as np import re from io import StringIO def GetChunkFromTextFile(FileName, StartStr, StopStr, skip_header=0, skip_footer=0, LastHit=True, DataType='array'): # DataType means we can extract the chunk and then turn it into: # 1) Numpy table 'numpy' # 2) return the raw text 'raw' DataType = D...
ZGainsforth/QEScripts
IR/GetChunkFromTextFile.py
GetChunkFromTextFile.py
py
1,560
python
en
code
4
github-code
36
[ { "api_name": "re.compile", "line_number": 20, "usage_type": "call" }, { "api_name": "re.S", "line_number": 20, "usage_type": "attribute" }, { "api_name": "numpy.float", "line_number": 39, "usage_type": "call" }, { "api_name": "numpy.genfromtxt", "line_number"...
20883522665
from unittest import result from django.shortcuts import render from django.http import Http404, HttpResponseRedirect from results.models import WeatherStation from .apps import ResultsConfig import pmdarima as pm import pandas as pd import numpy as np from datetime import date # Create your views here. def results(re...
shaner13/Ivy
results/views.py
views.py
py
9,431
python
en
code
0
github-code
36
[ { "api_name": "django.shortcuts.render", "line_number": 19, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 21, "usage_type": "call" }, { "api_name": "django.http.HttpResponseRedirect", "line_number": 23, "usage_type": "call" }, { "...
16445576901
""" Author: Daniel J. Sawtelle *** Purpose: Bombard the given URL with randomized form return data *** *** Source: https://www.youtube.com/watch?v=UtNYzv8gLbs """ import os import random import string import json import time import requests """ Function - Return a string object of a date formatted as specified *** s...
DSawtelle/ScammerSpammer
scammerSpammer.py
scammerSpammer.py
py
7,010
python
en
code
0
github-code
36
[ { "api_name": "time.mktime", "line_number": 23, "usage_type": "call" }, { "api_name": "time.strptime", "line_number": 23, "usage_type": "call" }, { "api_name": "time.mktime", "line_number": 24, "usage_type": "call" }, { "api_name": "time.strptime", "line_numbe...
39279700922
from plot_model import plot_results import glob from astropy.io import fits import tensorflow as tf import numpy as np import time def weight_variable(shape): initial = tf.truncated_normal(shape, stddev=0.1) return tf.Variable(initial) def bias_variable(shape): initial = tf.constant(0.1, shape = shape) return t...
grd349/LearningLAMOST
Matt/ClassifierNN/Old_Models/model_LAMOST_conv.py
model_LAMOST_conv.py
py
3,910
python
en
code
1
github-code
36
[ { "api_name": "tensorflow.truncated_normal", "line_number": 11, "usage_type": "call" }, { "api_name": "tensorflow.Variable", "line_number": 12, "usage_type": "call" }, { "api_name": "tensorflow.constant", "line_number": 15, "usage_type": "call" }, { "api_name": "t...
20063508538
from django.urls import path from api import views from rest_framework_simplejwt.views import ( TokenRefreshView, ) app_name = 'api' urlpatterns = [ path('', views.getRoutes,name='routes'), path('token/', views.MyTokenObtainPairView.as_view(), name='token_obtain_pair'), path('token/refresh/', TokenR...
Hack-Weekly/lavender-snake-password-manager
api/urls.py
urls.py
py
647
python
en
code
1
github-code
36
[ { "api_name": "django.urls.path", "line_number": 12, "usage_type": "call" }, { "api_name": "api.views.getRoutes", "line_number": 12, "usage_type": "attribute" }, { "api_name": "api.views", "line_number": 12, "usage_type": "name" }, { "api_name": "django.urls.path"...
2666772723
import pandas as pd from matplotlib import pyplot as plt data = pd.read_csv("countries.csv") print(data) #Compare population growth in the US and China us = data[data.country == "United States"] china = data[data.country == "China"] print(us) print(china) #Plot US and China population growth plt.plot(us.year, u...
CharlesIvia/data-visualization
pop_growth.py
pop_growth.py
py
486
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 19, "usage_type": "name" }, { "api_name": "matplotlib.py...
10532200845
import requests from datetime import datetime USERNAME = "kristijan" TOKEN = "hafdaga134312" pixela_endpoint = "https://pixe.la/v1/users" user_params = { "token": "hafdaga134312", "username": "kristijan", "agreeTermsOfService": "yes", "notMinor": "yes", } #response = requests.post(url=pixela_endpoint...
Kvidakovic1/Python-Exercises
Habit_Tracking/main.py
main.py
py
1,106
python
en
code
0
github-code
36
[ { "api_name": "datetime.datetime.now", "line_number": 30, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 30, "usage_type": "name" }, { "api_name": "requests.post", "line_number": 51, "usage_type": "call" } ]
1674184175
from django.db import models, connection # Create your models here. class News(models.Model): news_id = models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID') news_title = models.CharField(max_length=200) news_source = models.CharField(max_length=50) news_content = models.Tex...
chundonghan/pysite
portal/models.py
models.py
py
3,193
python
en
code
0
github-code
36
[ { "api_name": "django.db.models.Model", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 4, "usage_type": "name" }, { "api_name": "django.db.models.AutoField", "line_number": 5, "usage_type": "call" }, { "api_name": "...
28876927609
# 配置信息---将用户自定义配置文件及默认配置文件合成一个 import importlib import os from lib.conf import global_settings class Settings(): def __init__(self): # 获取默认配置文件的内容写入到Settings类的名称空间 for name in dir(global_settings): if name.isupper(): value = getattr(global_settings, name) ...
Zhu-GF/AutoGatheringAsserts
lib/conf/config.py
config.py
py
915
python
en
code
0
github-code
36
[ { "api_name": "lib.conf.global_settings", "line_number": 11, "usage_type": "argument" }, { "api_name": "lib.conf.global_settings", "line_number": 13, "usage_type": "argument" }, { "api_name": "os.environ.get", "line_number": 16, "usage_type": "call" }, { "api_name...
15295704029
from django.urls import include, path from rest_framework import routers from . import views app_name = 'articles' router = routers.DefaultRouter() router.register(r'articles', views.ArticleViewSet) urlpatterns = [ # path('', views.article_list, name="list"), path('', include(router.urls)), path('api-aut...
Dban1/myDjangoTraining
cynoblog/articles/urls.py
urls.py
py
698
python
en
code
0
github-code
36
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 7, "usage_type": "call" }, { "api_name": "rest_framework.routers", "line_number": 7, "usage_type": "name" }, { "api_name": "django.urls.path", "line_number": 12, "usage_type": "call" }, { "api_na...
36164549179
from blog.models import Post from django.urls import path from . import views # using django view # from .views import PostListView, PostDetailView, PostCreateView, PostUpdateView, PostDeleteView, post # urlpatterns = [ # path("", PostListView.as_view(), name="blog-home"), # path("post/<int:pk>", PostDetailVi...
nubcakee/django-basic-template
blog/urls.py
urls.py
py
996
python
en
code
1
github-code
36
[ { "api_name": "django.urls.path", "line_number": 19, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 20, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 21, "usage_type": "call" }, { "api_name": "django.urls.path",...
4014075302
# 문제 출처 : https://programmers.co.kr/learn/courses/30/lessons/42839?language=python3 from itertools import permutations import math def solution(numbers): answer = 0 ''' 오류코드 arr = list(map(int, list(numbers))) for per in permutations(list(numbers)): arr.append(int(''.join(per))) print...
ThreeFive85/Algorithm
Programmers/level2/findPrime/find_prime.py
find_prime.py
py
1,102
python
en
code
1
github-code
36
[ { "api_name": "itertools.permutations", "line_number": 19, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 38, "usage_type": "call" } ]
39752425383
import MySQLdb class InsertsEmprestimo: def __init__(self): self.con = "" def conecta(self): host = "localhost" user = "ProjetoFinal" password = "123456" db = "db_biblioteca" port = 3306 self.con = MySQLdb.connect(host, user, password, db, port) de...
DavidDevOps2000/ProgramaBibliotecaPython
inserts.py
inserts.py
py
2,226
python
pt
code
0
github-code
36
[ { "api_name": "MySQLdb.connect", "line_number": 14, "usage_type": "call" } ]
33501403446
import sys from lxml import etree from math import sqrt from GammaPipeCommon.utility import * from conf import get_resultsdb_conf from conf import get_pipedb_conf import mysql.connector as mysql import re import time import os import subprocess class ImportResults: def import_results(results_xml,check_alert): ...
cta-rta/ctoolsint
ImportResults.py
ImportResults.py
py
8,133
python
en
code
1
github-code
36
[ { "api_name": "os.getcwd", "line_number": 22, "usage_type": "call" }, { "api_name": "conf.get_pipedb_conf", "line_number": 24, "usage_type": "call" }, { "api_name": "conf.get_resultsdb_conf", "line_number": 32, "usage_type": "call" }, { "api_name": "mysql.connecto...
34050456586
import shadow.utils shadow.utils.set_seed(0, cudnn_deterministic=True) # set seeds for reproducibility #%matplotlib inline import matplotlib.pyplot as plt from sklearn import datasets import numpy as np import random import math as m n_samples = 1000 # number of samples to generate noise = 0.05 # noise to add to sa...
alalba221/Advanced-Machine-Learning
Final23F/Q4.py
Q4.py
py
3,742
python
en
code
0
github-code
36
[ { "api_name": "shadow.utils.utils.set_seed", "line_number": 2, "usage_type": "call" }, { "api_name": "shadow.utils.utils", "line_number": 2, "usage_type": "attribute" }, { "api_name": "shadow.utils", "line_number": 2, "usage_type": "name" }, { "api_name": "sklearn...
20244284451
#!/usr/bin/env python import os import sys from lib.util import rm_rf SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) def main(): os.chdir(SOURCE_ROOT) rm_rf('node_modules') rm_rf('dist') rm_rf('out') rm_rf('spec/node_modules') rm_rf('vendor/brightray/vendor/download/libchrom...
brave/muon
script/clean.py
clean.py
py
482
python
en
code
970
github-code
36
[ { "api_name": "os.path.abspath", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 9, "usage_type": "call" }, { "api_name": "os.chdir", "line_number...
30132799933
from collections import defaultdict from typing import Tuple, Union import cv2 import distinctipy import matplotlib.pylab as plt import numpy as np from PIL import Image def preprocess_image_draw(image: Union[Image.Image, np.ndarray]): image = np.array(image) # Convert if PIL, copy if numpy if len(image.sh...
Radio-Memory/radiomemory-ai-api-demo
vis.py
vis.py
py
10,117
python
en
code
0
github-code
36
[ { "api_name": "typing.Union", "line_number": 11, "usage_type": "name" }, { "api_name": "PIL.Image.Image", "line_number": 11, "usage_type": "attribute" }, { "api_name": "PIL.Image", "line_number": 11, "usage_type": "name" }, { "api_name": "numpy.ndarray", "line...
31748626437
import matplotlib.pyplot as plt from random_walk import RandomWalk """make a random walk and plot points as long as the program is active""" while True: rw = RandomWalk() rw.fill_walk() """set size of plot window""" plt.figure(figsize=(10, 6)) point_numbers = list(range(rw.num_points))...
Javataru/data_visualizations
data_graph/data_visualizations/rw_display.py
rw_display.py
py
876
python
en
code
0
github-code
36
[ { "api_name": "random_walk.RandomWalk", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 11, "usage_type": "name" }, { "api_name": "matp...
34481978389
from datetime import datetime import matplotlib.pyplot as plt """ Please read the README file before running this code In order to fully understand the purpose and the execution of this code """ def clean_line(line): cleaned_line = line.strip() cleaned_line = cleaned_line[1:] if cleaned_line.st...
andrea-gentilini/InstagramUnFollowers
main.py
main.py
py
4,840
python
en
code
0
github-code
36
[ { "api_name": "datetime.datetime", "line_number": 29, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 30, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 59, "usage_type": "call" }, { "api_name": "datetime.da...
37428725368
from __future__ import division from pyglet import image, text from tdgl.gl import * from tdgl import part, picking from tdgl.stylesheet import border_points __all__ = ('Panel','LabelPanel') class Panel(part.ScalePart): """Base class for things with a bordered panel behind""" _default_style = dict( ...
scavpy/Scav-Team-Pyweek-Aug-2010
gamelib/tdgl/panel.py
panel.py
py
9,576
python
en
code
3
github-code
36
[ { "api_name": "tdgl.part.ScalePart", "line_number": 11, "usage_type": "attribute" }, { "api_name": "tdgl.part", "line_number": 11, "usage_type": "name" }, { "api_name": "tdgl.picking.label", "line_number": 37, "usage_type": "call" }, { "api_name": "tdgl.picking", ...
17744150099
import sys import argparse import pdb import os import time import getpass import yaml import random import string from watchdog.observers import Observer from watchdog.events import PatternMatchingEventHandler from parse_rest.connection import register from parse_rest.datatypes import Object from parse_rest.query im...
mkhairul/codeMonitor
src/agent.py
agent.py
py
4,886
python
en
code
1
github-code
36
[ { "api_name": "watchdog.events.PatternMatchingEventHandler", "line_number": 17, "usage_type": "name" }, { "api_name": "os.path.abspath", "line_number": 43, "usage_type": "call" }, { "api_name": "os.path", "line_number": 43, "usage_type": "attribute" }, { "api_name...
18264517083
from django.contrib import admin # 장고에서 제공하는 Admin 기능 사용을 위한 임포트 from .models import Post # 직접 작성한 Post 모델 사용을 위한 임포트 @admin.register(Post) # 어드민 사용을 위한 모델 연결 class PostAdmin(admin.ModelAdmin): # 모델기반의 어드민 사용을 위한 상속 list_display = ['id', 'title', 'content', 'created_at'] # 리스트 화면의 출력 필드 정의 list_editable ...
3chamchi/likelion-seoul-6th
week5/blog-app/posts/admin.py
admin.py
py
721
python
ko
code
3
github-code
36
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 6, "usage_type": "name" }, { "api_name": "django.contrib.admin.register", "line_number": 5, "usage_type": "call" }, { ...
7934166631
''' Description: Definitions of functions Author: Nan Li Contact: linan.lqq0@gmail.com ''' # import packages import re import time import pandas as pd from headers import headers from datetime import datetime from seleniumwire import webdriver # short names dictionary address_dict = ({'road':'rd', 'street':'st', 'plac...
linan-1990/RealestateCrawler
functions.py
functions.py
py
6,379
python
en
code
1
github-code
36
[ { "api_name": "pandas.read_excel", "line_number": 23, "usage_type": "call" }, { "api_name": "re.search", "line_number": 44, "usage_type": "call" }, { "api_name": "re.search", "line_number": 48, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 50,...
29748242745
#server import os import tkinter as tk import sqlite3 import random from tkinter import ttk from tkinter import messagebox as mbox import PIL from PIL import Image from tkinter import * from PIL import Image, ImageTk from PIL import ImageGrab import socket #from gtts import gTTS #import pyttsx3 from fu...
shetyeanuja/python-mini-projects
Client Server Chat/server.py
server.py
py
3,275
python
en
code
0
github-code
36
[ { "api_name": "datetime.datetime.now", "line_number": 20, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 20, "usage_type": "name" }, { "api_name": "socket.socket", "line_number": 36, "usage_type": "call" }, { "api_name": "socket.AF_INET"...
12520460708
#!/usr/bin/python3 ''' Select data from states table and filter it by the names that contain an a then print it. ''' import sys from model_state import Base, State from sqlalchemy import (create_engine) from sqlalchemy.orm import Session if __name__ == "__main__": engine = create_engine('mysql+mysqldb://{}:{}@l...
sebastiancalleu/holbertonschool-higher_level_programming
0x0F-python-object_relational_mapping/9-model_state_filter_a.py
9-model_state_filter_a.py
py
706
python
en
code
0
github-code
36
[ { "api_name": "sqlalchemy.create_engine", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 17, "usage_type": "attribute" }, { "api_name": "model_state.Base.metadata.create_all", "line_number": 19, "usage_type": "call" }, { "api_n...
72776117224
import requests import bs4 from bs4 import BeautifulSoup import pandas as pd import time import csv import simplejson as json import threading def extract_job_title_from_result(soup): jobs = [] for div in soup.find_all(name="div", attrs={"class":"row"}): for a in div.find_all(name="a", attr...
arthimj/Web-Scrapping-Python
web_scrapping.py
web_scrapping.py
py
3,426
python
en
code
2
github-code
36
[ { "api_name": "requests.get", "line_number": 60, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 61, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 68, "usage_type": "call" }, { "api_name": "threading.Thread", ...
29495477058
from pathlib import Path from my_scientific_profile.papers.papers import ( fetch_all_paper_authors, fetch_all_paper_infos, ) papers = fetch_all_paper_infos() paper_authors = fetch_all_paper_authors() print(f"fetched {len(papers)} papers and {len(paper_authors)} authors") from my_scientific_profile.database.a...
tbereau/tbereau
scripts/fetch_papers.py
fetch_papers.py
py
963
python
en
code
0
github-code
36
[ { "api_name": "my_scientific_profile.papers.papers.fetch_all_paper_infos", "line_number": 8, "usage_type": "call" }, { "api_name": "my_scientific_profile.papers.papers.fetch_all_paper_authors", "line_number": 9, "usage_type": "call" }, { "api_name": "my_scientific_profile.databas...
13239290421
"""Notes on the different columns of the csv files PSNR: Peak Signal-to-Noise Ratio SSIM: Structural Similarity Loss_D: Discriminator Loss; Used to train Discriminator Loss_G: Generator Loss; Used to train Discriminator; Composed of img perception and disc Loss Score_D: Discriminator score given to the real image Sc...
PierreSp/DL4CV_2017_Final_Project
srgan/plots.py
plots.py
py
1,509
python
en
code
0
github-code
36
[ { "api_name": "os.listdir", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number...
23747786249
""" Khinshan Khan - oss.py. This module implements a God class for OS simulation. """ from collections import deque import itertools from mcm_oss import memory from mcm_oss import disk class OSS: """An OS mimicker.""" def __enter__(self): return self def __exit__(self, exc_type, exc_value, tra...
shan-memery/mcm-oss
mcm_oss/oss.py
oss.py
py
4,275
python
en
code
0
github-code
36
[ { "api_name": "mcm_oss.memory.Memory", "line_number": 23, "usage_type": "call" }, { "api_name": "mcm_oss.memory", "line_number": 23, "usage_type": "name" }, { "api_name": "mcm_oss.disk.Disk", "line_number": 24, "usage_type": "call" }, { "api_name": "mcm_oss.disk",...
26796000187
import requests from bs4 import BeautifulSoup import pprint def stocks_gainers(): res = requests.get('https://www.google.com/finance/markets/gainers?hl=en') soup = BeautifulSoup(res.text, 'html.parser') stocks_container_gainers = soup.find('div', {'class': 'Sy70mc'}) stocks_listing_gainers = st...
Prasadk1234/Project
Stock_monitoring.py
Stock_monitoring.py
py
1,420
python
en
code
1
github-code
36
[ { "api_name": "requests.get", "line_number": 6, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 7, "usage_type": "call" }, { "api_name": "pprint.pprint", "line_number": 16, "usage_type": "call" }, { "api_name": "requests.get", "line_n...
15351976065
import os import sys import torchvision.models as models import torch import cv2 import argparse import os import time import json import sys import dlib import pandas as pd import numpy as np import imutils from imutils.face_utils import FaceAligner from tensorflow.keras.models import load_model, model_from_json root...
Freja1122/ERFramework
models/face/facePredictions_faceAPI.py
facePredictions_faceAPI.py
py
4,195
python
en
code
1
github-code
36
[ { "api_name": "os.path.abspath", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number"...
15150949741
""" Generic Kedro Nodes """ import logging import json from sklearn.ensemble import IsolationForest from sklearn.covariance import EllipticEnvelope from sklearn.neighbors import LocalOutlierFactor from .plugin import hooks import pandas as pd from .views import ADAlgorithms, create_samples_os_view iso_params = { ...
TU-Berlin-SNET/Waldo-Kedro-Plugin
waldo_kedro_plugin/nodes.py
nodes.py
py
7,196
python
en
code
1
github-code
36
[ { "api_name": "pandas.DataFrame", "line_number": 47, "usage_type": "attribute" }, { "api_name": "views.create_samples_os_view", "line_number": 58, "usage_type": "call" }, { "api_name": "views.ADAlgorithms.IsolationForest", "line_number": 58, "usage_type": "attribute" },...
10080595644
#! /usr/bin/python3 import os import boto3 import json import logging import random import traceback from datetime import datetime from python.opentelemetry import trace from python.opentelemetry.semconv.trace import SpanAttributes CUSTOM_OTEL_SPAN_EVENT_NAME = 'LambdaUpdateEvent' SQS_MESSAGE_GROUP_ID = 'otel' # Re...
utr1903/monitoring-lambda-with-opentelemetry
python/apps/update/lambda_function.py
lambda_function.py
py
4,368
python
en
code
2
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 22, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 22, "usage_type": "attribute" }, { "api_name": "boto3.client"...
32925227061
import sqlite3 import sys import colorama connection = sqlite3.connect("rubiksql.db") cursor = connection.cursor() colorama.init() def selectTop (cantidad = 10, direction = "ASC", campos = "*"): global cursor, connection cursor.execute("SELECT "+campos+" FROM layouts ORDER BY distance "+ ...
jonoreilly/python
rubik/rubikLooker.py
rubikLooker.py
py
2,605
python
en
code
0
github-code
36
[ { "api_name": "sqlite3.connect", "line_number": 5, "usage_type": "call" }, { "api_name": "colorama.init", "line_number": 7, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 38, "usage_type": "call" }, { "api_name": "sqlite3.connect", "li...
21620485761
from __future__ import absolute_import import sys from typing import ByteString from typing import Mapping from typing import NamedTuple from typing import Optional from typing import Sequence from uuid import uuid4 import numpy as np from past.builtins import unicode from apache_beam.portability.api import schema_p...
a0x8o/kafka
sdks/python/apache_beam/typehints/schemas.py
schemas.py
py
6,240
python
en
code
59
github-code
36
[ { "api_name": "numpy.int8", "line_number": 45, "usage_type": "attribute" }, { "api_name": "apache_beam.portability.api.schema_pb2.BYTE", "line_number": 45, "usage_type": "attribute" }, { "api_name": "apache_beam.portability.api.schema_pb2", "line_number": 45, "usage_type"...
34451715981
import arff import pandas as pd import numpy as np import json import data_utils import os def load_data(use_data=None): data_load = np.load('dataset/'+use_data+str('.npy')) print(data_load.shape) return np.asarray(data_load).astype(np.float) def creat_dataset(directory): if not os.path.exists(dir...
mvisionai/FedLimited
convert_to_arff.py
convert_to_arff.py
py
1,605
python
en
code
1
github-code
36
[ { "api_name": "numpy.load", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.float", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_n...
8306618656
from django.contrib import admin from .models import Topic, Course, Student, Order, Review from decimal import Decimal def decrease_price(modeladmin, request, queryset): for obj in queryset: obj.price = obj.price*Decimal(0.9) obj.save() class CourseAdmin(admin.ModelAdmin): fields = [('title'...
krunal1998/Course-Registration
myapp/admin.py
admin.py
py
1,417
python
en
code
0
github-code
36
[ { "api_name": "decimal.Decimal", "line_number": 8, "usage_type": "call" }, { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 12, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 12, "usage_type": "name" }, { "api_name...
28297108867
#!/usr/bin/env python3 from collections import namedtuple from datetime import datetime import os, sys, time import xml.etree.ElementTree as ET import logging import yaml import requests import re import twitter import nltk import argparse parser = argparse.ArgumentParser() parser.add_argument('--offset', type=int...
zouharvi/arxiv-twitter
run.py
run.py
py
5,360
python
en
code
0
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 18, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 22, "usage_type": "call" }, { "api_name": "logging.Formatter", "line_number": 23, "usage_type": "call" }, { "api_name": "logging.F...
22769347103
#!/bin/python import requests from bs4 import BeautifulSoup from urllib.parse import urlencode, parse_qs # Facebook #ACCESS_TOKEN = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRlX2lzc3VlZCI6IjIwMTUtMTEtMjFUMTg6NTc6MzAuNTQ4MDk3IiwiY2xpZW50X2lkIjoiaHR0cDovL2V4YW1wbGUuY29tLyIsInNpdGUiOjQzLCJzY29wZSI6InBvc3QiLCJtZSI6Imh...
kylewm/silo.pub
scripts/do_local_micropub_flickr.py
do_local_micropub_flickr.py
py
1,961
python
en
code
27
github-code
36
[ { "api_name": "requests.post", "line_number": 16, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 31, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 40, "usage_type": "call" } ]
33028130226
from xml.etree import ElementTree from blog import app import sys import requests import sys from bs4 import BeautifulStoneSoup as Soup def analyze_site_map(): r = requests.get('{}{}sitemap.xml'.format(app.config['WEB_PROTOCOL'], app.config['DOMAIN'])) soup = Soup(r.content) locs = soup.findAll('loc') ...
mkmoisen/blog
verify_sitemap.py
verify_sitemap.py
py
888
python
en
code
2
github-code
36
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "blog.app.config", "line_number": 10, "usage_type": "attribute" }, { "api_name": "blog.app", "line_number": 10, "usage_type": "name" }, { "api_name": "bs4.BeautifulStoneSoup", ...
11292852216
import os from msgraph import api, sites authority_host_uri = 'https://login.microsoftonline.com' tenant = 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' resource_uri = 'https://graph.microsoft.com' client_id = 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' client_thumbprint = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' client_certifi...
WMInfoTech/python-msgraph
examples/sites_lists.py
sites_lists.py
py
1,261
python
en
code
4
github-code
36
[ { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "msgraph.api.GraphAPI.from_certificate", "line_number": 12, "usage_type": "call" }, { "api_name": "msgraph...
34482110199
import bpy import math bpy.context.scene.frame_end = 180 # add a cube bpy.ops.mesh.primitive_cube_add() cube = bpy.context.active_object # insert keyframe at frame one start_frame = 1 cube.keyframe_insert("rotation_euler", frame=start_frame) bpy.context.scene.frame_current = 180 # change the rotation of the cube ar...
ambivalenzia/BlenderPythonProjects
cube_rotation_animation.py
cube_rotation_animation.py
py
655
python
en
code
0
github-code
36
[ { "api_name": "bpy.context", "line_number": 4, "usage_type": "attribute" }, { "api_name": "bpy.ops.mesh.primitive_cube_add", "line_number": 7, "usage_type": "call" }, { "api_name": "bpy.ops", "line_number": 7, "usage_type": "attribute" }, { "api_name": "bpy.contex...
30395093762
from rest_framework import status from rest_framework.decorators import api_view from rest_framework.response import Response from blog.models import Blog, BlogCategory from blog.api.serializers import BlogApi, BlogCategoryApi @api_view(['GET',]) def api_blog_view(request): try: blog = Blog.objects.all(...
siklerdaniiii/astral
blog/api/views.py
views.py
py
1,731
python
en
code
0
github-code
36
[ { "api_name": "blog.models", "line_number": 13, "usage_type": "name" }, { "api_name": "blog.models.Blog.objects.all", "line_number": 13, "usage_type": "call" }, { "api_name": "blog.models.Blog.objects", "line_number": 13, "usage_type": "attribute" }, { "api_name":...
20060032970
import matplotlib.pyplot as plt import matplotlib.collections as mcoll from collections import defaultdict from matplotlib import colors from matplotlib.lines import Line2D import warnings import seaborn as sns import math import numpy as np import pandas as pd def deCasteljau(b, t): N = len(b) a = np.copy(b...
Thopic/chordialement
chordialement/core.py
core.py
py
17,468
python
en
code
1
github-code
36
[ { "api_name": "numpy.copy", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.array", "line_number"...
12553103859
import requests import json import time url = 'https://formulae.brew.sh/api/formula.json' response = requests.get(url) packages_json = response.json() results = [] t1 = time.perf_counter() for package in packages_json: package_name = package['name'] package_desc = package['desc'] package_url = f'h...
iampaavan/Pure_Python
How to Write Python Scripts to Analyze JSON APIs and Sort Results.py
How to Write Python Scripts to Analyze JSON APIs and Sort Results.py
py
1,406
python
en
code
1
github-code
36
[ { "api_name": "requests.get", "line_number": 7, "usage_type": "call" }, { "api_name": "time.perf_counter", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 19, "usage_type": "call" }, { "api_name": "json.dumps", "line_num...