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
24826567222
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for sub-module et_md2.interactions.""" import sys sys.path.insert(0,'.') import pytest import numpy as np from et_md2.atoms import Atoms import et_md2.interactions.lj as LJ import et_md2.interactions import et_md2.verletlist def test_compute_forces_vl(): a...
etijskens/et-MD2
tests/et_md2/interactions/test_interactions.py
test_interactions.py
py
2,779
python
en
code
0
github-code
21
[ { "api_name": "sys.path.insert", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "et_md2.atoms.Atoms", "line_number": 18, "usage_type": "call" }, { "api_name": "et_md2.interactions.lj...
2540718847
from contextlib import closing from datetime import datetime, timedelta from copy import deepcopy from airflow.providers.postgres.hooks.postgres import PostgresHook from psycopg2 import ProgrammingError, DatabaseError POSTGRES_CONN_ID = 'curso_postgres_conn' def get_default_args() -> dict: default_args = { ...
CristianUrcuqui/taller_de_esp
mnt/airflow/dags/settings.py
settings.py
py
5,566
python
en
code
0
github-code
21
[ { "api_name": "datetime.timedelta", "line_number": 20, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 22, "usage_type": "call" }, { "api_name": "airflow.providers.postgres.hooks.postgres.PostgresHook", "line_number": 25, "usage_type": "call" }, ...
13164898056
from FA_Accents import FA_Accents as Accents import FA_LanguageSelect as LanguageSelect from FA_LanguageSelect import Language from FA_Save import load_saved_entries, save_new_entry, load_active_language from FA_Translation import Translation from FA_Translator import FA_Translator as Translator from FA_WordList import...
CharlesWithall/FrancApp
FA_Window.py
FA_Window.py
py
6,938
python
en
code
0
github-code
21
[ { "api_name": "enum.Enum", "line_number": 18, "usage_type": "name" }, { "api_name": "FA_LanguageSelect.get_active_language", "line_number": 23, "usage_type": "call" }, { "api_name": "FA_LanguageSelect.Language.French", "line_number": 24, "usage_type": "attribute" }, {...
24305239847
from tkinter import* from tkinter import messagebox as ms import sqlite3 from PIL import Image , ImageTk #import enail conn=sqlite3.connect('address_book.db') c = conn.cursor() c.execute("""CREATE TABLE IF NOT EXISTS`Paymentpayfast` (`payment_id` INT(10) , `mode_of_payment` varchar(255), `amount_payable` varchar(...
Rutujarrajhans/Movie_booking_system
rohit.py
rohit.py
py
7,337
python
en
code
0
github-code
21
[ { "api_name": "sqlite3.connect", "line_number": 10, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 70, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 124, "usage_type": "call" }, { "api_name": "PIL.Image.open", ...
2565480207
import json from typing import Union from .song import Song from .spotify import create_playlist, remove_playlist, add_songs_to_playlist, remove_songs_from_playlist, get_playlist_items from .package_logging import logger from .config import settings PLAYLIST_IDS = {} class Playlist: def __init__(self, name: str...
henski-pl/radio_tops_spotify
radio_tops/playlist.py
playlist.py
py
3,993
python
en
code
0
github-code
21
[ { "api_name": "spotify.get_playlist_items", "line_number": 19, "usage_type": "call" }, { "api_name": "spotify.create_playlist", "line_number": 32, "usage_type": "call" }, { "api_name": "config.settings.playlist_ids_file", "line_number": 47, "usage_type": "attribute" }, ...
37713837969
import discord from cogs import DonationCog from discord.ext import commands class DonationLogging(DonationCog): role_100 = 794295747800465428 role_250 = 794295625365192704 role_500 = 820295774927323156 role_1000 = 820295730601918494 role_2500 = 820295144788066375 special_role =...
Sibi-Agilan-17/Oasis
cogs/giveaways.py
giveaways.py
py
9,796
python
en
code
0
github-code
21
[ { "api_name": "cogs.DonationCog", "line_number": 7, "usage_type": "name" }, { "api_name": "discord.Colour.random", "line_number": 21, "usage_type": "call" }, { "api_name": "discord.Colour", "line_number": 21, "usage_type": "attribute" }, { "api_name": "discord.ext...
2142908107
from typing import List, Union, Tuple import numpy as np import cv2 from ..utils import ( normalize_image, add_padding, trim_padding, darken, median_mask, trim_flip, fill_small_black_blobs, fill_small_white_blobs, fill_lower_max, get_thumbnail, rotate_image) def get_complete_body_mask(image: np.ndarray, width...
LucaCappelletti94/covidxpert
covidxpert/body_cut/body_cut.py
body_cut.py
py
3,907
python
en
code
2
github-code
21
[ { "api_name": "numpy.ndarray", "line_number": 9, "usage_type": "attribute" }, { "api_name": "utils.get_thumbnail", "line_number": 25, "usage_type": "call" }, { "api_name": "utils.normalize_image", "line_number": 27, "usage_type": "call" }, { "api_name": "utils.med...
71342567413
"""Datasets.""" import os from torch.utils.data import Dataset from torchvision import datasets from torchvision import transforms BASEPATH = os.path.abspath( os.path.join(os.path.dirname(__file__), '..', '..', 'data')) class STL10(datasets.STL10): """STL10 dataset.""" transforms = transforms.Compose([...
BorgwardtLab/topological-autoencoders
src/datasets/stl10.py
stl10.py
py
1,260
python
en
code
120
github-code
21
[ { "api_name": "os.path.abspath", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9...
17364875842
from flask import Flask, request, jsonify from time import sleep import telepot from alsong_parse import alsong from m_net_parse.m_net import Mnet app = Flask(__name__) @app.route('/keyboard') def Keyboard(): dataSend = { "type": "buttons", "buttons": ["시작하기", "도움말"] } return jsonify(da...
mgh3326/MusicKaKaoBot
kakao.py
kakao.py
py
2,139
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 18, "usage_type": "call" }, { "api_name": "flask.request.get_json", "line_number": 23, "usage_type": "call" }, { "api_name": "flask.request", "...
8177412185
import torch from torch import nn from dense_coattn_layer import DCNLayer import torch.nn.functional as F class EMDCANet(nn.Module): def __init__(self, length): super().__init__() """ EEGNet of EEG1 """ self.conv1 = torch.nn.Conv2d(1, 8, (1, 125), padding=(0, 62...
mufengjun260/DMEFNet
DMEFNet.py
DMEFNet.py
py
7,798
python
en
code
0
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 7, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
5209833597
from monclass import Pokemon from urllib.request import Request, urlopen from game_vals import * import random import json class Actions: def __init__(self, user): self.typecolors = TYPECOLORS self.allmoves = PERMA_MOVEDICT url="http://deckofcardsapi.com/api/deck/new/" req = Requ...
aacontreras20/pokegame
app/gamerules.py
gamerules.py
py
4,201
python
en
code
2
github-code
21
[ { "api_name": "urllib.request.Request", "line_number": 13, "usage_type": "call" }, { "api_name": "urllib.request.urlopen", "line_number": 14, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 15, "usage_type": "call" }, { "api_name": "monclass.Pok...
19769633621
from pathlib import Path import logging shelf_path = "data" shelf_name = "shelf" shelf = shelf_path + "/" + shelf_name def create_directory(filepath): if not Path(filepath).is_dir(): logging.info(f"Creating shelf directory {filepath}") Path(filepath).mkdir(parents=True, exist_ok=True)
rdillens/Fintech_Portfolio
utils/helpers.py
helpers.py
py
308
python
en
code
0
github-code
21
[ { "api_name": "pathlib.Path", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 10, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 11, "usage_type": "call" } ]
19115161919
# -*- coding: utf-8 -*- """ Created on Tue Apr 27 16:41:01 2021 @author: Ivan """ import requests import json import pandas as pd import time import matplotlib.pyplot as plt all_data = pd.DataFrame() i = 0 doit = True while doit: try: # 要抓取的网址 url = 'https://api.hiskio.com/v2/cou...
Ivan-Crawler/hiskio_crawler
HiSkio爬蟲.py
HiSkio爬蟲.py
py
1,286
python
zh
code
0
github-code
21
[ { "api_name": "pandas.DataFrame", "line_number": 13, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 21, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 23, "usage_type": "call" }, { "api_name": "json.loads", "line...
13292277716
import spacy nlp = spacy.blank("en") doc = nlp("Hello word, this is a greate day to work on NLP and machine learning. 100% new to spacy. What about you 40-30%?") for token in doc: # print(token) # print(token.i) if token.like_num: # get the next token next_token = doc[token.i + 1] ...
Princekrampah/NLP_with_Spacy
basics/basic_03.py
basic_03.py
py
413
python
en
code
0
github-code
21
[ { "api_name": "spacy.blank", "line_number": 3, "usage_type": "call" } ]
31051910487
import os os.environ["CUDA_VISIBLE_DEVICES"]="0" os.environ["WANDB_DISABLED"] = "true" import torch import torch.nn as nn import bitsandbytes as bnb from peft import PeftModel, PeftConfig from transformers import AutoModelForCausalLM, AutoTokenizer hf_peft_repo = "/media/onetbssd/llama/StableVicuna/7Btrained" peft_con...
ssainz/llm-study
stable_vicuna_fine_tuning/stablevicuna_trained_infer.py
stablevicuna_trained_infer.py
py
1,079
python
en
code
0
github-code
21
[ { "api_name": "os.environ", "line_number": 2, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 3, "usage_type": "attribute" }, { "api_name": "peft.PeftConfig.from_pretrained", "line_number": 11, "usage_type": "call" }, { "api_name": "peft.Pe...
8972242531
from functools import reduce import operator import math def product(iterable): """ Returns the product of an iterable If the list is empty, returns 1 """ product = reduce(operator.mul, iterable, 1) return product def prime_check(num): """ Checks if a number is prime. A simple function, no...
maddieankur/simple-maths
functions.py
functions.py
py
3,445
python
en
code
null
github-code
21
[ { "api_name": "functools.reduce", "line_number": 11, "usage_type": "call" }, { "api_name": "operator.mul", "line_number": 11, "usage_type": "attribute" }, { "api_name": "math.sqrt", "line_number": 23, "usage_type": "call" }, { "api_name": "math.sqrt", "line_nu...
42641595168
from django.urls import path from . import views app_name = 'travello' urlpatterns = [ path('',views.index,name='index'), path('thankyou/',views.thankyou,name='thankyou'), path('about/',views.about,name='about'), path('destination/',views.destination,name='destination'), ]
callingsandesh/ComeOn
travello/urls.py
urls.py
py
292
python
en
code
0
github-code
21
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", ...
10285643103
from rest_framework import serializers,exceptions from rest_framework.response import Response from rest_framework.authtoken.models import Token from rest_framework.views import APIView from rest_framework.status import HTTP_200_OK, HTTP_400_BAD_REQUEST from rest_framework.generics import ( CreateAPIView, ListA...
myworkcircle/Ecommerce_Book_Store
project/books/views.py
views.py
py
1,211
python
en
code
0
github-code
21
[ { "api_name": "rest_framework.generics.CreateAPIView", "line_number": 27, "usage_type": "name" }, { "api_name": "serializers.BookSerializer", "line_number": 28, "usage_type": "name" }, { "api_name": "models.Book.objects.all", "line_number": 29, "usage_type": "call" }, ...
4123259209
# adapted from: # https://github.com/ptone/pyosc/blob/master/examples/knect-rcv.py from datetime import datetime import pickle from core.OSC import OSCServer from data_processing import change_dict_to_list class Tester(object): def __init__(self): self.server = "" self.ip = "localhost" ...
noemiko/myo_classify
receiver_for_tests.py
receiver_for_tests.py
py
4,610
python
en
code
1
github-code
21
[ { "api_name": "data_processing.change_dict_to_list", "line_number": 53, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 68, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 69, "usage_type": "call" }, { "api_name": "pickle.lo...
9504733415
#!/usr/bin/env python # # Title: geodetic_survey.py # Description: Mean a fixed number of GPS points to survey base station position. # import rospy import roslib.packages from piksi_rtk_msgs.srv import * from piksi_rtk_msgs.msg import PositionWithCovarianceStamped import std_srvs.srv from sensor_msgs.msg i...
ethz-asl/ethz_piksi_ros
piksi_multi_rtk_ros/src/piksi_multi_rtk_ros/geodetic_survey.py
geodetic_survey.py
py
16,598
python
en
code
81
github-code
21
[ { "api_name": "rospy.init_node", "line_number": 28, "usage_type": "call" }, { "api_name": "rospy.loginfo", "line_number": 29, "usage_type": "call" }, { "api_name": "rospy.get_name", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.array", "line_...
43028097147
import imp from django.urls import path from .views import Coach_add, Coach_addForm, CoachCreateView, CoachDeleteView, CoachUpdateView, HomePage, ListCoach, ListStudent, details_coach, details_student, list_project, register urlpatterns=[ path('home',HomePage,name="Hub_home"), path('listCoach',ListCoach,name=...
FirasKhadraoui/InnovationHub
Hub/urls.py
urls.py
py
1,236
python
en
code
0
github-code
21
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "views.HomePage", "line_number": 7, "usage_type": "argument" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "views.ListCoach", ...
39172027965
from discord.ext import commands from datetime import datetime from flegelapi import command import discord import os import platform class Information(commands.Cog): def __init__(self, bot): self.bot = bot self.fmt = '{0:%Y/%m/%d - %H:%M:%S}' @commands.group() async def info...
himo1101/NFlegel
cogs/information.py
information.py
py
5,578
python
en
code
0
github-code
21
[ { "api_name": "discord.ext.commands.Cog", "line_number": 9, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 9, "usage_type": "name" }, { "api_name": "flegelapi.command.not_subcommand", "line_number": 16, "usage_type": "call" }, { ...
13190931785
from collections import deque def bfs(n, k, dist): q = deque([n]) moves = ['+', '-', '*'] while q: node = q.popleft() if node == k: break for move in moves: if move == '+': nn = node + 1 elif move == '-': nn = ...
Eui9179/algorithm-study
programmers/python/score_kit/dfsbfs/boj1697.py
boj1697.py
py
610
python
en
code
0
github-code
21
[ { "api_name": "collections.deque", "line_number": 5, "usage_type": "call" } ]
71077998772
from enum import IntEnum from pycrate_core.utils import * from pycrate_core.elt import * from pycrate_core.base import * #------------------------------------------------------------------------------# # IETF RFC 1661: The Point-to-Point Protocol (PPP) # section 5: LCP packet format #------------------------------...
P1sec/pycrate
pycrate_mobile/PPP.py
PPP.py
py
12,117
python
en
code
363
github-code
21
[ { "api_name": "enum.IntEnum", "line_number": 61, "usage_type": "name" }, { "api_name": "enum.IntEnum", "line_number": 148, "usage_type": "name" }, { "api_name": "enum.IntEnum", "line_number": 185, "usage_type": "name" }, { "api_name": "enum.IntEnum", "line_num...
37223666253
#!/usr/bin/python3 '''This is a module''' from api.v1.views import app_views from flask import jsonify, request from models.place import Place from models.city import City from models.user import User from flask import abort from models import storage @app_views.route('/cities/<city_id>/places', methods=['GET', 'PO...
mazi-kunle/AirBnB_clone_v3
api/v1/views/places.py
places.py
py
2,190
python
en
code
null
github-code
21
[ { "api_name": "models.storage.get", "line_number": 18, "usage_type": "call" }, { "api_name": "models.city.City", "line_number": 18, "usage_type": "argument" }, { "api_name": "models.storage", "line_number": 18, "usage_type": "name" }, { "api_name": "flask.abort", ...
36689437632
#### Use BiLSTM_CRF to do name entity recognition #### BiLSTM generation features as the input of CRF(conditional random field) #### CRF makes the transition matrix more reasonable than just using BiLSTM alone import torch import torch.nn as nn import torch.optim as optim torch.manual_seed(1) class BiLSTM_...
Qinghua88/machine-learning
Bi_LSTM_CRF.py
Bi_LSTM_CRF.py
py
6,683
python
en
code
0
github-code
21
[ { "api_name": "torch.manual_seed", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.nn.Module", "line_number": 11, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 11, "usage_type": "name" }, { "api_name": "torch.nn.Embedding", ...
40795884126
########################## ## ## Code by Susan ## padath314 ## ########################## import asyncio from UAP import Message,UAP from Network import Client import random import time sID = random.getrandbits(32) seq = 0 isRunning = False timerStart = 0 timeout = 10 STATES = { "Hello wait": 0, ...
unniisme/Networking
UDPcommunicator/AsyncUAPClient.py
AsyncUAPClient.py
py
3,883
python
en
code
0
github-code
21
[ { "api_name": "random.getrandbits", "line_number": 15, "usage_type": "call" }, { "api_name": "Network.Client", "line_number": 32, "usage_type": "name" }, { "api_name": "UAP.Message", "line_number": 32, "usage_type": "name" }, { "api_name": "asyncio.to_thread", ...
4118070199
import io import os import httplib2 import googleapiclient from googleapiclient import discovery import oauth2client from oauth2client import client from oauth2client import tools from oauth2client import file import postgresql import utils_Json_Postgres from postgresql import exceptions import time import datetime try...
noemieSP/projet_LDS_A
DriveConnexion_insert_postgreSQL.py
DriveConnexion_insert_postgreSQL.py
py
7,221
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 17, "usage_type": "call" }, { "api_name": "oauth2client.tools.argparser", "line_number": 17, "usage_type": "attribute" }, { "api_name": "oauth2client.tools", "line_number": 17, "usage_type": "name" }, { "api_...
33732923108
""" Convert the json output file in caps_out.json as csv file author : soojung.hong@here.com """ import json import csv import pandas as pd import matplotlib.pyplot as plt from datetime import datetime def convert_json_to_csv(json_file_name, csv_file_name): # Opening JSON file and loading the data into the var...
SoojungHong/Geolocation-data-analysis
convert_json_to_csv.py
convert_json_to_csv.py
py
1,872
python
en
code
0
github-code
21
[ { "api_name": "json.load", "line_number": 18, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 24, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 50, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_numb...
14633691854
from django import forms # from django.utils.translation import gettext_lazy as _ from .models import Device, ActiveDevice #Configuration from sys import stderr NETWORKMODE_CHOICES = ( ('static', 'Static'), ('dhcp', 'DHCP'), ) P2PMODE_CHOICES = ( ('MODE1', 'Mode One'), ('MODE2', 'Mode Two'), ('...
rmonyer/uap-device-manager
forms.py
forms.py
py
8,536
python
en
code
0
github-code
21
[ { "api_name": "sys.stderr", "line_number": 26, "usage_type": "name" }, { "api_name": "django.forms.ModelForm", "line_number": 28, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 28, "usage_type": "name" }, { "api_name": "django.forms.Char...
13610717139
#!/usr/bin/env python from setuptools import setup, find_packages import platform TEST_REQUIRES = [ 'flexmock>=0.9.7', 'nose', 'coverage', 'unittest2' ] INSTALL_REQUIRES = [ 'requests>=1.0.0', ] INSTALL_REQUIRES_CPYTHON = [ 'lxml>=3.0', ] # lxml 3.3.x is broken with pypy. lets see how this pl...
siddhanthgupta/BoxLinux
box.py-master/setup.py
setup.py
py
1,345
python
en
code
0
github-code
21
[ { "api_name": "platform.python_implementation", "line_number": 24, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_number": 30, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 38, "usage_type": "call" } ]
7519497277
#!/usr/bin/env python import sys from multiprocessing import Process, JoinableQueue as Queue import time import datetime import random class Feeder(Process): def __init__(self,inputqueue,outputqueue, threads): self.inputqueue = inputqueue self.outputqueue = outputqueue super().__init__() ...
proycon/nlpsandbox
multiproctest.py
multiproctest.py
py
2,353
python
en
code
2
github-code
21
[ { "api_name": "multiprocessing.Process", "line_number": 9, "usage_type": "name" }, { "api_name": "random.randint", "line_number": 16, "usage_type": "call" }, { "api_name": "multiprocessing.Process", "line_number": 32, "usage_type": "name" }, { "api_name": "random....
6178881891
""" The brain translates trades stored in the collector database into timeframes. A timeframe is similar to a candle but it stores a bit more data about the trades in thet interval. Notably it stores the linear regression against the log10 value of price. """ import fatstack as fs import logging, sys # import time br...
nomad-networks/FATStack
src/fatstack/brain.py
brain.py
py
466
python
en
code
0
github-code
21
[ { "api_name": "sys.modules", "line_number": 11, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "fatstack.ROOT", "line_number": 17, "usage_type": "attribute" } ]
73315790134
import cv2 def start_detectvelocity(input_video_path, fps, output_width, output_height, V, output_path='outputs/velocity.mp4'): print("Detecting velocity...") # Load the output video velocity_video = cv2.VideoCapture(input_video_path) # Define the codec and create a VideoWriter object fourcc = cv2...
RohaanA/-VTX-Experiencing-Tennis-Virtually-in-3D-from-2D-Stream
detect_velocity.py
detect_velocity.py
py
1,985
python
en
code
0
github-code
21
[ { "api_name": "cv2.VideoCapture", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.VideoWriter_fourcc", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.VideoWriter", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.CAP_PROP_PO...
14614999041
from aiogram import types from aiogram.dispatcher import FSMContext from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton import db from data.xjetapi import api def extract_unique_code(text, ): # Extracts the unique_code from the sent /start command. return text.split()[1] if len(text.split()) ...
dmitriypy/auction
auction/handlers/text/start.py
start.py
py
2,951
python
en
code
0
github-code
21
[ { "api_name": "aiogram.types.Message", "line_number": 12, "usage_type": "attribute" }, { "api_name": "aiogram.types", "line_number": 12, "usage_type": "name" }, { "api_name": "aiogram.dispatcher.FSMContext", "line_number": 12, "usage_type": "name" }, { "api_name":...
43290154345
''' Created on May 22, 2012 @author: Nich ''' from utils.coroutine import coroutine from command.command_matcher import match_command from command.commands import * from map.game_map import show_map commands = { "say":{"function":say, "num_args":"unlimited"}, "move":{"function":mov...
shmup/another-python-mud
src/MessagePassingMud/command/command_handler.py
command_handler.py
py
1,018
python
en
code
1
github-code
21
[ { "api_name": "map.game_map.show_map", "line_number": 16, "usage_type": "name" }, { "api_name": "command.command_matcher.match_command", "line_number": 21, "usage_type": "name" }, { "api_name": "command.command_matcher", "line_number": 29, "usage_type": "name" }, { ...
12336391418
from torch.utils.data import Dataset, DataLoader from torchvision import transforms import pandas as pd import numpy as np import cv2 import os import torch import albumentations as A import imageio.v2 as imageio class SAR2OpticalDataset(Dataset): """ Custom dataset class for SAR (Synthetic Aperture Radar) an...
MuhammedM294/SAR2Optical
src/data/dataset.py
dataset.py
py
4,954
python
en
code
2
github-code
21
[ { "api_name": "torch.utils.data.Dataset", "line_number": 12, "usage_type": "name" }, { "api_name": "imageio.v2.imread", "line_number": 88, "usage_type": "call" }, { "api_name": "imageio.v2", "line_number": 88, "usage_type": "name" }, { "api_name": "imageio.v2.imre...
40901342710
#!/usr/bin/env python3 import asyncio from mavsdk import System async def run(local =True): drone = System() #await drone.connect(system_address="udp://:14540") await drone.connect(system_address="serial:///dev/{}:{}".format("ttyUSB0", 57600)) status_text_task = asyncio.ensure_future(print_status_te...
alaamaalouf/FollowAnything
DRONE/take_of_and_land.py
take_of_and_land.py
py
1,646
python
en
code
294
github-code
21
[ { "api_name": "mavsdk.System", "line_number": 9, "usage_type": "call" }, { "api_name": "asyncio.ensure_future", "line_number": 12, "usage_type": "call" }, { "api_name": "asyncio.sleep", "line_number": 37, "usage_type": "call" }, { "api_name": "asyncio.CancelledErr...
27037257563
import requests from bs4 import BeautifulSoup url = 'https://news.naver.com/main/read.nhn?mode=LSD&mid=sec&sid1=105&oid=030&aid=0002700985' # Response [403]은 access denied headers={'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36/87.0.4280.88 Safari/537.36'} res = requests.get(url, headers=h...
dobbytk/NLP_study
Multicampus/crawling/naver_news_crawling.py
naver_news_crawling.py
py
3,247
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 8, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 10, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 21, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "l...
73729641652
import pathlib import sys from collections import defaultdict import argparse import numpy as np import torch from torch.utils.data import DataLoader from dataset import KneeDataDev from architecture import networkwithunet import h5py from tqdm import tqdm from data import transforms as T from evaluate import Metrics,h...
sriprabhar/HyperCoil-Recon
src/valid_measures.py
valid_measures.py
py
7,037
python
en
code
2
github-code
21
[ { "api_name": "evaluate.mse", "line_number": 17, "usage_type": "name" }, { "api_name": "evaluate.nmse", "line_number": 18, "usage_type": "name" }, { "api_name": "evaluate.psnr", "line_number": 19, "usage_type": "name" }, { "api_name": "evaluate.ssim", "line_nu...
73257810291
import numpy as np import cv2 as cv def Gradient(img): img = cv.Canny(img, 100, 200) cv.imshow('img', img) cv.waitKey(0) cv.destroyAllWindows() def Pyramind(img): layer = img for i in range(6): layer = cv.pyrDown(layer) cv.imshow(str(i), layer) cv.waitKey(0) cv.destr...
XxRogueNerdxX/ComputerVisionBasics
Basics/Gradient.py
Gradient.py
py
706
python
en
code
0
github-code
21
[ { "api_name": "cv2.Canny", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.destroyAllWindows", "line_numbe...
72154923574
import multiprocessing import math from numpy import mean def cosine_worker( working_q, output_q, bgc_name_id_dict, bgc_hmm_ids, bgc_hmm_values, imputation="zero" ): bgc_imputation_values = {} for bgc_id in bgc_hmm_values: if imputation == "zero": bgc_imputation_val...
adraismawur/thesis-scripts
predictions/distances/cosine_corrected.py
cosine_corrected.py
py
4,417
python
en
code
0
github-code
21
[ { "api_name": "math.sqrt", "line_number": 66, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 67, "usage_type": "call" }, { "api_name": "multiprocessing.Queue", "line_number": 100, "usage_type": "call" }, { "api_name": "multiprocessing.Queue", ...
7012098631
import numpy as np import matplotlib.pyplot as plt from WuEnDa.week3.testCases import * import sklearn import sklearn.datasets import sklearn.linear_model from WuEnDa.week3.planar_utils import plot_decision_boundary, sigmoid, load_planar_dataset, load_extra_datasets np.random.seed(1) # set a seed so that the results a...
YangYaoCD/MyPython
WuEnDa/week3/week3.py
week3.py
py
6,618
python
en
code
1
github-code
21
[ { "api_name": "numpy.random.seed", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.random.seed", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.random", ...
23153430353
from aiogram import types from aiogram.dispatcher.filters.builtin import CommandStart from aiogram.dispatcher import FSMContext from loader import dp from api import * from keyboards.default.buttons import * from states.languages import Language @dp.message_handler(CommandStart()) async def bot_start(message: types....
komronbek-tufliyev/django-aiogram-bot
bot/handlers/users/start.py
start.py
py
4,019
python
en
code
1
github-code
21
[ { "api_name": "aiogram.types.Message", "line_number": 12, "usage_type": "attribute" }, { "api_name": "aiogram.types", "line_number": 12, "usage_type": "name" }, { "api_name": "states.languages.Language.language.set", "line_number": 38, "usage_type": "call" }, { "a...
20604808685
import re import json import itertools import threading import supybot.utils as utils from supybot.commands import * import supybot.plugins as plugins import supybot.ircutils as ircutils import supybot.callbacks as callbacks try: from supybot.i18n import PluginInternationalization _ = PluginInternationalizatio...
progval/Supybot-plugins
Bitoduc/plugin.py
plugin.py
py
2,947
python
en
code
107
github-code
21
[ { "api_name": "supybot.i18n.PluginInternationalization", "line_number": 13, "usage_type": "call" }, { "api_name": "supybot.callbacks.Plugin", "line_number": 21, "usage_type": "attribute" }, { "api_name": "supybot.callbacks", "line_number": 21, "usage_type": "name" }, ...
26227274525
# -*- coding: utf-8 -*- """ Created on Wed Feb 23 17:43:59 2022 @author: dina """ import cv2 image_resized = cv2.imread(r'C:\Users\idan\Desktop\resized_roze.jpg') h, w, c = image_resized.shape print("resized Height and Width:", h,"x", w) #rotate matrix from the center of the image size rotate_matrix = cv2.getRotat...
idan5510/project
augmentation_models/rotate_image.py
rotate_image.py
py
897
python
en
code
0
github-code
21
[ { "api_name": "cv2.imread", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.getRotationMatrix2D", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.warpAffine", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.imshow", "l...
22430998571
import json import os from pprint import pprint import requests from bs4 import BeautifulSoup def fetch_raw_definition(productUrl): res = requests.get(productUrl, headers={ "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/53...
AviralDhingra/Archive
wordlist_dictionary/main.py
main.py
py
965
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "requests.exceptions", "line_number": 16, "usage_type": "attribute" }, { "api_name": "bs4.BeautifulSoup", "line_number": 20, "usage_type": "call" }, { "api_name": "json.loads", ...
30048112863
import tkinter as tk import tkinter.scrolledtext import logging from os import remove from helpers import mObject, getHotkeys, saveHotkeys, updateLabel from editGUI import editGUI from win32gui import EnumWindows, IsWindowVisible from win32process import GetWindowThreadProcessId from psutil import Process # GUI clas...
danielarlt/AutoMidiKey
Source/mainGUI.py
mainGUI.py
py
13,039
python
en
code
0
github-code
21
[ { "api_name": "helpers.mObject", "line_number": 25, "usage_type": "call" }, { "api_name": "tkinter.Frame", "line_number": 29, "usage_type": "call" }, { "api_name": "tkinter.StringVar", "line_number": 31, "usage_type": "call" }, { "api_name": "tkinter.Label", "...
31357357386
from configparser import ConfigParser config = ConfigParser() config.read('config.ini') title = config.get('DEFAULT', 'title') print('title', type(title), title) username = config.get('database', 'user') port = config.getint('database', 'port') keep_alive = config.getboolean('database', 'keep-alive') timeout = config...
parisnakitakejser/video-tutorial-python-code
Configparser/3-working-with-data-types-in-config-parser/app.py
app.py
py
528
python
en
code
29
github-code
21
[ { "api_name": "configparser.ConfigParser", "line_number": 2, "usage_type": "call" } ]
15097897085
from __future__ import absolute_import, division, print_function import numbers import collections import numpy as np imle = None # the imle package will be imported at the first class instanciation. from .. import learner from .. import tools defcfg = learner.Learner.defcfg._deepcopy() defcfg.classname = 'learner...
benureau/learners
learners/algorithms/imle_model.py
imle_model.py
py
2,037
python
en
code
3
github-code
21
[ { "api_name": "numbers.Real", "line_number": 15, "usage_type": "attribute" }, { "api_name": "numbers.Real", "line_number": 17, "usage_type": "attribute" }, { "api_name": "collections.Iterable", "line_number": 17, "usage_type": "attribute" }, { "api_name": "numbers...
44572315941
#!/usr/bin/env python # coding: utf-8 import argparse import os def reduce_pdf_size(): try: os.system("gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite \ -dCompatibilityLevel=1.4 -dPDFSETTINGS={} \ -sOutputFile={} {}".format(args.settings, args.output, ...
kalak-io/reduce_pdf_size
reduce_pdf_size.py
reduce_pdf_size.py
py
1,071
python
en
code
0
github-code
21
[ { "api_name": "os.system", "line_number": 10, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 19, "usage_type": "call" } ]
34622923140
from mend import application # Version - 1.0.0 # Date - 12/13/20 def start_ngrok(): from pyngrok import ngrok url = ngrok.connect(5000) print("\n * Tunnel URL:", url) if __name__ == "__main__": #start_ngrok() application.run()
jakeee51/CS351
application.py
application.py
py
251
python
en
code
0
github-code
21
[ { "api_name": "pyngrok.ngrok.connect", "line_number": 9, "usage_type": "call" }, { "api_name": "pyngrok.ngrok", "line_number": 9, "usage_type": "name" }, { "api_name": "mend.application.run", "line_number": 14, "usage_type": "call" }, { "api_name": "mend.applicati...
17132187983
import paramiko import sys from paramiko import SSHClient, AutoAddPolicy from scp import SCPClient def ssh_connect(OT2_IP): """Call to set connection with remote client.""" try: ssh = SSHClient() ssh.load_system_host_keys() # ssh.set_missing_host_key_policy(AutoAddPolicy()...
PV-Lab/2s986_class
Week11/Color_Mixing_Example/ssh_command.py
ssh_command.py
py
3,752
python
en
code
8
github-code
21
[ { "api_name": "paramiko.SSHClient", "line_number": 11, "usage_type": "call" }, { "api_name": "paramiko.AuthenticationException", "line_number": 18, "usage_type": "attribute" }, { "api_name": "paramiko.ssh_exception", "line_number": 19, "usage_type": "attribute" }, { ...
19741364235
import json import sys import os import shutil import tomli import tomli_w import zipfile root_dir = os.path.abspath(sys.argv[0]).split("/build-scripts/mmc.py")[0] print("root_dir: " + str(root_dir)) setup_persistent_dir = f"{root_dir}/.setup-persistent" print("setup_persistent_dir:", setup_persistent_dir) data_dir = ...
Ecorous/packs
build-scripts/mmc.py
mmc.py
py
2,501
python
en
code
1
github-code
21
[ { "api_name": "os.path.abspath", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.chdir", "line_number":...
4737216825
import types import configuration as conf from tools import UsefulFunctions as uf class Sequence_modifiers(object) : """Abtract Class. All sequence must inherit from me""" def __init__(self, sources = {}) : self.sources = sources def addSource(self, name, snp) : "Optional, you can keep a dict that records th...
tariqdaouda/pyGeno
pyGeno/SNPFiltering.py
SNPFiltering.py
py
4,665
python
en
code
299
github-code
21
[ { "api_name": "types.ListType", "line_number": 20, "usage_type": "attribute" }, { "api_name": "tools.UsefulFunctions.encodePolymorphicNucleotide", "line_number": 21, "usage_type": "call" }, { "api_name": "tools.UsefulFunctions", "line_number": 21, "usage_type": "name" }...
27416367415
from selenium import webdriver from selenium.webdriver.common.keys import Keys print("Enter Web Site URL like( https://sahildholpuria.tech/ ) to Get HTML Source Code. \n") WebName = str(input("Enter URL here : ")) browser = webdriver.Chrome(executable_path="./drivers\chromedriver.exe") browser.get(WebName) f = open...
Sahildholpuria/GetWebSource
main.py
main.py
py
394
python
en
code
5
github-code
21
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 8, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 8, "usage_type": "name" } ]
19081407885
import os, datetime, traceback, pprint def init(): global log; log = logger() class logger: def __init__(self): self.level = "default" self.pp = pprint.PrettyPrinter(indent=2) #Create Logfile dir if it doesn't exist if not os.path.exists("logs"): os.makedirs("logs") #Create Log filename = str(d...
Fwuffie/GPT3IsAGoodSoftwareEngineer
logger.py
logger.py
py
2,622
python
en
code
3
github-code
21
[ { "api_name": "pprint.PrettyPrinter", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.makedirs", "l...
11502870706
import numpy as np import librosa import pygame import time NOTES = ['a4', 'b4', 'c4', 'd4', 'e4', 'f4', 'g4', 'a5', 'b5', 'c5', 'd5', 'e5', 'f5', 'g5', 'a6', 'b6', 'c6', 'd6', 'e6', 'f6', 'g6', 're'] PITCHES = [-15, -13, -12, -10, -8, -7, -5, -3, -1, 0, 2, 4, 5, 7, 9, 11, 12, 14, 16, 17, 19] LENGTH_STRINGS =...
charlie-coleman/borkical-music
functions.py
functions.py
py
2,620
python
en
code
0
github-code
21
[ { "api_name": "librosa.load", "line_number": 17, "usage_type": "call" }, { "api_name": "librosa.effects.pitch_shift", "line_number": 20, "usage_type": "call" }, { "api_name": "librosa.effects", "line_number": 20, "usage_type": "attribute" }, { "api_name": "librosa...
8999002741
#%% Import import numpy as np import sympy from matplotlib import pyplot as plt from scipy import integrate #%% sympy define symbols and functions t,tau_l0,Chi = sympy.symbols("t, τ_l^0, χ") Pi0,beta_Pi,C_a0, C_l0 = sympy.symbols("Π^0, β_Π, C_a^0, C_l^0") gam,k_a,kappa_0,EC,delta = sympy.symbols ("γ,k_a,κ_0,ηC,δ") t...
icodeworld/ESM
box_mode..py
box_mode..py
py
5,221
python
en
code
0
github-code
21
[ { "api_name": "sympy.symbols", "line_number": 9, "usage_type": "call" }, { "api_name": "sympy.symbols", "line_number": 10, "usage_type": "call" }, { "api_name": "sympy.symbols", "line_number": 11, "usage_type": "call" }, { "api_name": "sympy.symbols", "line_nu...
13170974766
# Display Module for Shmup # Import Modules import pygame import consts from os import path # Load Background Graphics background_img = pygame.image.load(path.join(consts.img_dir, 'background.png')).convert() background = pygame.transform.scale(background_img, (consts.GAME_WIDTH, consts.GAME_HEIGHT)) background_rect ...
ccurtis7/gamejam2022
v11ShieldsLives/display.py
display.py
py
2,598
python
en
code
0
github-code
21
[ { "api_name": "pygame.image.load", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_num...
25064131884
import functools import hashlib from OpenSSL import crypto from datetime import datetime import os import struct import base64 import db_API import CA_API from json.decoder import JSONDecodeError from cryptography import x509 from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives....
appseclabepfl/project
webserver/login_server/auth.py
auth.py
py
11,707
python
en
code
0
github-code
21
[ { "api_name": "flask.Blueprint", "line_number": 17, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 24, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 24, "usage_type": "name" }, { "api_name": "flask.request...
2133068094
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import numpy as np import sympy as sp from vofotensors.numbers import z, sqrt_two, two from vofotensors.abc import ( rho1, rho2, rho3, d1, d2, d3, d4, d5, d6, d7, d8, d9, ) from vofotensors import substitutions import vofote...
JulianKarlBauer/vofotensors
vofotensors/deviators_4.py
deviators_4.py
py
5,450
python
en
code
4
github-code
21
[ { "api_name": "numpy.array", "line_number": 29, "usage_type": "call" }, { "api_name": "sympy.S", "line_number": 31, "usage_type": "call" }, { "api_name": "vofotensors.numbers.z", "line_number": 31, "usage_type": "name" }, { "api_name": "sympy.S", "line_number"...
33133561605
from __future__ import annotations import httpx from starlette import status from schemas import User from tests.endpoints import Route class TestCurrentRoute(Route[User]): __url__ = "/login/current/" __method__ = "GET" __response__ = User async def test_unauthorized_failed(self, client: httpx.Asyn...
kbondar17/fast-api-eshop-template
tests/endpoints/login/test_current.py
test_current.py
py
1,276
python
en
code
0
github-code
21
[ { "api_name": "tests.endpoints.Route", "line_number": 10, "usage_type": "name" }, { "api_name": "schemas.User", "line_number": 10, "usage_type": "name" }, { "api_name": "schemas.User", "line_number": 13, "usage_type": "name" }, { "api_name": "httpx.AsyncClient", ...
14405187202
import voluptuous as vol from homeassistant.helpers import config_validation as cv from homeassistant.helpers.script import SCRIPT_MODE_CHOICES, DEFAULT_SCRIPT_MODE CONDITION_SCHEMA = vol.Schema({ vol.Required('key'): cv.string, vol.Required('value'): cv.string, }) BLUEPRINT_ACTION_SCHEMA = vol.Schema(...
Sian-Lee-SA/Home-Assistant-Switch-Manager
custom_components/switch_manager/schema.py
schema.py
py
2,897
python
en
code
140
github-code
21
[ { "api_name": "voluptuous.Schema", "line_number": 5, "usage_type": "call" }, { "api_name": "voluptuous.Required", "line_number": 6, "usage_type": "call" }, { "api_name": "voluptuous.Required", "line_number": 7, "usage_type": "call" }, { "api_name": "homeassistant....
31710530084
from PyQt5.QtWidgets import QApplication, QWidget from PyQt5.QtCore import QUrl, pyqtSlot from PyQt5.QtMultimedia import QMediaPlayer, QMediaContent from PyQt5.uic import loadUi from remix.audio import * import datetime import time INITIAL_VOL = 40 def modify_text(string): """ A function to modify a string ...
Engineering-Final-Project/musicRemixApp
remix/GUI/channel_widget.py
channel_widget.py
py
6,644
python
en
code
0
github-code
21
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 31, "usage_type": "name" }, { "api_name": "PyQt5.uic.loadUi", "line_number": 42, "usage_type": "call" }, { "api_name": "PyQt5.QtMultimedia.QMediaPlayer", "line_number": 63, "usage_type": "call" }, { "api_name...
29333665000
import requests from pprint import PrettyPrinter from datetime import date class Currencies: api_key = '61c1b237d2-e6ccb4d475-rrvc6b' url = 'https://api.fastforex.io' printer = PrettyPrinter() def all_currencies(self): endpoint = f"{self.url}/currencies?api_key={self.api_key}" respon...
ironz1/My_page_object
Python_excercices/forex.py
forex.py
py
3,349
python
en
code
0
github-code
21
[ { "api_name": "pprint.PrettyPrinter", "line_number": 10, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 14, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.date.today", ...
70190515254
import cv2 as cv import numpy as np img = cv.imread('Resources/Photos/cats 2.jpg') #translate img(shift img along x and y axis) def translate(img, x, y): transMat = np.float32([[1, 0, x], [0, 1, y]]) #matrix dimensions = (img.shape[1], img.shape[0]) #width and height return cv.warpAffine(img, transMat...
aoko-code/Python
openCv/transformImg.py
transformImg.py
py
1,112
python
en
code
1
github-code
21
[ { "api_name": "cv2.imread", "line_number": 3, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.warpAffine", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number":...
40296894504
#!/usr/bin/env python # coding: utf-8 # In[34]: import pandas as pd import requests from bs4 import BeautifulSoup import numpy as np # In[41]: xlsx_file = pd.read_excel('Input.xlsx') # In[42]: df['URL'][0] # In[44]: headers={'User-Agent':'Mozilla/5.0 (Windows NT 6.3; Win 64 ; x64) Apple WeKit /537.36(KHT...
StellarShounak/Text-Extraction-and-Analysis-NLP-Project
scrapping.py
scrapping.py
py
1,782
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_excel", "line_number": 16, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 34, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 35, "usage_type": "call" }, { "api_name": "requests.get", "...
2393123842
import os import argparse from tqdm.auto import tqdm import numpy as np import torch from torch import nn from torch.cuda.amp import GradScaler, autocast from torch.nn import CrossEntropyLoss, Conv2d, BatchNorm2d import torch.nn.functional as F from torch.optim import SGD, lr_scheduler import torchvision import warning...
KellerJordan/features-not-bugs
main.py
main.py
py
7,090
python
en
code
1
github-code
21
[ { "api_name": "warnings.filterwarnings", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.nn.Module", "line_number": 19, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 19, "usage_type": "name" }, { "api_name": "torch.nn.Module...
41880056166
from flask import Blueprint, request, render_template, \ redirect, url_for, flash, Response, jsonify from pyelasticsearch import ElasticSearch from collections import Counter, defaultdict from celery.result import AsyncResult from math import ceil import requests import StringIO import csv import zipfile from .fac...
UUDigitalHumanitieslab/LoCMiner
LoCMiner/views.py
views.py
py
9,495
python
en
code
0
github-code
21
[ { "api_name": "flask.Blueprint", "line_number": 15, "usage_type": "call" }, { "api_name": "pyelasticsearch.ElasticSearch", "line_number": 27, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 35, "usage_type": "call" }, { "api_name": "f...
16038035948
import functools import decimal def lamb(p, q): p = p - 1 q = q -1 value = lcm(p, q) return value def gcd(*numbers): """Return the greatest common divisor of the given integers""" from fractions import gcd return functools.reduce(gcd, numbers) def lcm(*numbers): """Return lowest common multi...
monkeyboy107/RSAKeyGenInPythonForLearningRSAWorks
RSA Key example3.0 - now hard coded.py
RSA Key example3.0 - now hard coded.py
py
1,720
python
en
code
0
github-code
21
[ { "api_name": "functools.reduce", "line_number": 13, "usage_type": "call" }, { "api_name": "fractions.gcd", "line_number": 13, "usage_type": "argument" }, { "api_name": "fractions.gcd", "line_number": 18, "usage_type": "call" }, { "api_name": "functools.reduce", ...
73653399091
import torch from torch.autograd import Variable import torch.nn.functional as F import torchvision.transforms as transforms import torch.nn as nn import torch.utils.data import numpy as np from opt import opt from dataloader import VideoLoader, DataWriter, crop_from_dets, Mscoco from yolo.darknet import D...
bigh2000/human_tracking
video_demo.py
video_demo.py
py
7,737
python
en
code
0
github-code
21
[ { "api_name": "opt.opt.video", "line_number": 38, "usage_type": "attribute" }, { "api_name": "opt.opt", "line_number": 38, "usage_type": "name" }, { "api_name": "opt.opt.outputpath", "line_number": 41, "usage_type": "attribute" }, { "api_name": "opt.opt", "lin...
73728192373
"""Default settings.""" import logging import os # # Development mode or production mode # If DEBUG is True, then auto-reload is enabled, i.e., when code is modified, server will be # reloaded immediately # DEBUG = True # # Static Assets # # The web UI is a single page app. All javascripts/css files should be in ST...
Nextdoor/ndscheduler
ndscheduler/default_settings.py
default_settings.py
py
2,491
python
en
code
1,071
github-code
21
[ { "api_name": "os.path.join", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.realpath", "lin...
70988241014
import wikipedia #pip3 install wikipedia from functools import lru_cache class WikipediaSearch: def __init__(self, language="en"): if language is not None: self.set_language(language) def set_language(self, language): """ Sets _language of wikipedia client API :par...
hasnafoundation/InterestingCodes
Python/Wikipedia/wikipedia_search.py
wikipedia_search.py
py
1,582
python
en
code
8
github-code
21
[ { "api_name": "wikipedia.set_lang", "line_number": 18, "usage_type": "call" }, { "api_name": "wikipedia.summary", "line_number": 30, "usage_type": "call" }, { "api_name": "functools.lru_cache", "line_number": 20, "usage_type": "call" }, { "api_name": "wikipedia.pa...
73025387573
import requests import json import random import pandas as pd from sklearn.preprocessing import MinMaxScaler from keras.models import Sequential from keras.layers import Dense from keras.layers import LSTM from keras.layers import GRU,Bidirectional from keras.models import load_model import tensorflow as tf ...
liuhengjing-sudo/test-flask
predict.py
predict.py
py
3,837
python
en
code
0
github-code
21
[ { "api_name": "pandas.DataFrame", "line_number": 22, "usage_type": "call" }, { "api_name": "pandas.concat", "line_number": 38, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 47, "usage_type": "call" }, { "api_name": "sklearn.preprocessing....
43377229468
# File encoding: utf-8 from django.http import HttpResponseRedirect, Http404 from django.shortcuts import render_to_response from django.template import RequestContext from django.contrib.auth.decorators import login_required from models import Bug, Company, Project, Tester from forms import BugForm, ProjectForm, Tes...
Lopic/urtest
bugtracker/views.py
views.py
py
2,937
python
en
code
1
github-code
21
[ { "api_name": "models.Bug.objects.all", "line_number": 13, "usage_type": "call" }, { "api_name": "models.Bug.objects", "line_number": 13, "usage_type": "attribute" }, { "api_name": "models.Bug", "line_number": 13, "usage_type": "name" }, { "api_name": "django.shor...
13375982271
from __future__ import absolute_import from __future__ import division from __future__ import print_function import torch import torch.nn as nn from models import pose_resnet # from core.loss import PerJointMSELoss from models.mvp_decoder import MvPDecoderLayer, MvPDecoder from models.ops.modules import ProjAttn fro...
sail-sg/mvp
lib/models/multi_view_pose_transformer.py
multi_view_pose_transformer.py
py
33,893
python
en
code
296
github-code
21
[ { "api_name": "torch.nn.functional.binary_cross_entropy_with_logits", "line_number": 53, "usage_type": "call" }, { "api_name": "torch.nn.functional", "line_number": 53, "usage_type": "name" }, { "api_name": "torch.nn.Module", "line_number": 65, "usage_type": "attribute" ...
22690486646
from django.urls import path from . import views urlpatterns = [ path('', views.main_page, name='home'), path('contact/', views.contact_page, name='contact'), path('about/', views.about_page), path('portfolio/', views.portfolio_page), # Enter the app name in following syntax for this to work ]
mrseyfi/django-prj-1402
freelancer/home/urls.py
urls.py
py
316
python
en
code
0
github-code
21
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", ...
42752167791
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import tempfile import subprocess import urllib.request import zipfile from os import path OPENRCT2_VERSIONS = ["0.1.2", "0.1.1", "0.1.0", "0.0.8", "0.0.7", "0.0.6", "0.0.5", "0.0.4", "0.0.3", "0.0.2", "0.0.1"] OPENRCT2_ORG_URLS = {"windows":"http://cdn.l...
rwjuk/OpenRCT2-utils
launch-by-commit.py
launch-by-commit.py
py
1,402
python
en
code
1
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 21, "usage_type": "call" }, { "api_name": "urllib.request.request.urlretrieve", "line_number": 36, "usage_type": "call" }, { "api_name": "urllib.request.request", "line_number": 36, "usage_type": "attribute" }, {...
4275045148
""" File that calls the model of your preference to segmentate the first frame and that saves it into the output folder we want. """ from argparse import ArgumentParser import numpy as np from os import path import os from PIL import Image from seg_detectron2 import get_mask_detectron2 import cv2 import warnings """ ...
aliciafmachado/stcn-video-segmentation
code/segmentation/seg_first_frame.py
seg_first_frame.py
py
5,291
python
en
code
1
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 18, "usage_type": "call" }, { "api_name": "seg_detectron2.get_mask_detectron2", "line_number": 46, "usage_type": "name" }, { "api_name": "warnings.warn", "line_number": 51, "usage_type": "call" }, { "api_name...
72675436533
import numpy as np import cv2 #DATA PROCESSING def read_data(data_name : str, label_name : str): # reads in data from the dataset data = np.load(f'data/{data_name}.npy') labels = np.load(f'data/{label_name}.npy') # separates the data into training data/labels and returns them return data, labels d...
akshatat777/SiLT-Project
data_processing.py
data_processing.py
py
3,924
python
en
code
0
github-code
21
[ { "api_name": "numpy.load", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.random.shuffle", "line_num...
17530673994
#!/usr/bin/python3 """ Like 101 except we also display what films each character has appeared in """ import requests import sys if __name__ == "__main__": search_letters = sys.argv[1] url = "https://swapi.co/api/people/?search=" + search_letters r = requests.get(url) if r == {}: print("No resul...
davidknoppers/holbertonschool-higher_level_programming
0x10-python-network_1/102-starwars.py
102-starwars.py
py
1,137
python
en
code
0
github-code
21
[ { "api_name": "sys.argv", "line_number": 10, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 23, "usage_type": "call" }, { "api_name": "requests.get", "line_numb...
39842932702
import bpy import bmesh from .consts import fur_mask_fixed_operator_id class MaskFixedOperator(bpy.types.Operator): bl_idname = fur_mask_fixed_operator_id bl_label = 'Mask fixed points for sculpting' def maskVertices(self, object:bpy.types.Object): Om = object.data if "FixedPoints" no...
deep-ar/blender_fur_tools
mask_fixed_operator.py
mask_fixed_operator.py
py
1,151
python
en
code
0
github-code
21
[ { "api_name": "bpy.types", "line_number": 6, "usage_type": "attribute" }, { "api_name": "consts.fur_mask_fixed_operator_id", "line_number": 7, "usage_type": "name" }, { "api_name": "bpy.types", "line_number": 10, "usage_type": "attribute" }, { "api_name": "bmesh.n...
14075783160
from django.urls import path from .views import Attendance, video_feed, CropFace, AttendanceInformation, SelectAttendance urlpatterns = [ path("", Attendance.as_view(), name='attendance_students'), path("thong-tin-diem-danh/", AttendanceInformation.as_view(), name='attendance_information_students'), path("...
namchuminh/StudentAI
attendance/urls.py
urls.py
py
517
python
en
code
0
github-code
21
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "views.Attendance.as_view", "line_number": 5, "usage_type": "call" }, { "api_name": "views.Attendance", "line_number": 5, "usage_type": "name" }, { "api_name": "django.urls.p...
74326823094
import os import string import random from PIL import Image from PIL import ImageFont from PIL import ImageDraw # 40% will be damaged, 60% okay damaged_intact_ratio = 0.4 # Specify the number of images you want to create. Depending on your computer, one image pair can take between 2 and 10 minutes to render num_image...
christian-vorhemus/procedural-3d-image-generation
pipeline.py
pipeline.py
py
1,888
python
en
code
27
github-code
21
[ { "api_name": "os.path.exists", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.join", "line_num...
3806874861
''' - This server store record pair of shortURL:longURL - Redirect website after receive GET request (shortURL in param) ex: localhost:8000/abc_xyz (abc_xyz is shortURL stored in record) ''' from http.server import BaseHTTPRequestHandler from http.server import HTTPServer from urllib.parse import parse_qs...
linhng98/basic-http-server-python
7_BookmarkServer/bookmark_server.py
bookmark_server.py
py
3,832
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 45, "usage_type": "call" }, { "api_name": "requests.RequestException", "line_number": 47, "usage_type": "attribute" }, { "api_name": "http.server.BaseHTTPRequestHandler", "line_number": 51, "usage_type": "name" }, { "ap...
40314583854
from gettext import find from time import sleep from random import randint, random import argparse from stimulation import * from bluepy.btle import Scanner, DefaultDelegate, Peripheral class ScanDelegate(DefaultDelegate): def __init__(self): DefaultDelegate.__init__(self) def handleDiscovery(self, ...
DavideLiCalsi/CHARM
Code/stimulation/UseCaseStimulator.py
UseCaseStimulator.py
py
1,773
python
en
code
0
github-code
21
[ { "api_name": "bluepy.btle.DefaultDelegate", "line_number": 10, "usage_type": "name" }, { "api_name": "bluepy.btle.DefaultDelegate.__init__", "line_number": 12, "usage_type": "call" }, { "api_name": "bluepy.btle.DefaultDelegate", "line_number": 12, "usage_type": "name" ...
19525421797
from datetime import datetime import time import random odds = [ 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59 ] randNum = random.randint(1, 60) for i in range(5): time.sleep(randNum) right_this_minute = datetime.today().min...
Pascal0397/vsearch4web
vsearch4web/HeadsFirst/PythonGrundlagen.py
PythonGrundlagen.py
py
449
python
en
code
0
github-code
21
[ { "api_name": "random.randint", "line_number": 9, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime.today", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetime", ...
1078359439
# -*- coding: utf-8 -*- # FOGLAMP_BEGIN # See: http://foglamp.readthedocs.io/ # FOGLAMP_END """ FogLAMP package updater API support""" from aiohttp import web import datetime from foglamp.services.core import server from foglamp.common import logger from foglamp.services.core.scheduler.entities import ManualSchedul...
foglamp/FogLAMP
python/foglamp/services/core/api/update.py
update.py
py
2,935
python
en
code
70
github-code
21
[ { "api_name": "foglamp.common.logger.setup", "line_number": 17, "usage_type": "call" }, { "api_name": "foglamp.common.logger", "line_number": 17, "usage_type": "name" }, { "api_name": "foglamp.services.core.server.Server.scheduler.get_schedules", "line_number": 56, "usage...
23320242540
# !/usr/bin/env python """Test adding objects""" from __future__ import absolute_import import os.path import sys # Make sure we import from working tree okconfig_base = os.path.dirname(os.path.realpath(__file__ + "/..")) sys.path.insert(0, okconfig_base) import unittest2 as unittest import okconfig from pynag impo...
opinkerfi/okconfig
tests/test_host.py
test_host.py
py
3,354
python
en
code
45
github-code
21
[ { "api_name": "os.path.path.dirname", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path", "line_number": 10, "usage_type": "name" }, { "api_name": "os.path.path.realpath"...
71836040692
''' Module contain PathEntity and PathEntity classes ''' from typing import List from typing import Dict import re from oapi3 import exceptions from .base import Entity from .parameters import ParametersEntity from .operations import OperationEntity from .operations import METHODS class PathEntity(Entity): ''' ...
SmartTeleMax/oapi3
oapi3/entities/paths.py
paths.py
py
2,626
python
en
code
0
github-code
21
[ { "api_name": "base.Entity", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 28, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 30, "usage_type": "name" }, { "api_name": "re.Pattern", "line_number": 3...
28178511582
from flask import Flask, render_template import datetime as dt import requests now = dt.datetime.now() year_now = now.year app = Flask(__name__) @app.route('/') def home(): return render_template("index.html", year=year_now) @app.route("/guess/<name_input>") def guess(name_input): name_title = name_input.t...
JasonW25/Classes
100daypython/blog-jinja/server.py
server.py
py
822
python
en
code
0
github-code
21
[ { "api_name": "datetime.datetime.now", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 6, "usage_type": "attribute" }, { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.render_te...
33630213531
import string import time import requests from bs4 import BeautifulSoup from datetime import datetime import json import re import smtplib def checkPrice(data_dict,shop,token): response_to_shopify = [] headers = {} headers["User-Agent"] = data_dict["user_agent"] if data_dict["website"] == "amazon": ...
mayankchauhan96/shopify_price_automation
shopify_cli/backend/tracker.py
tracker.py
py
7,881
python
en
code
2
github-code
21
[ { "api_name": "requests.get", "line_number": 19, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 32, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 43, "usage_type": "call" }, { "api_name": "requests.get", "line_number...
22728114282
import os import pygame import random pygame.init() BLUE = (0, 0, 200) PINK = (200, 0, 200) RED = (200, 0, 0) GREEN = (0, 100, 0) WHITE = (255, 255, 255) class Port: def __init__(self, Color: tuple[int, int, int], Pos: tuple[int, int]) -> None: self.x = Pos[0] self.y = Pos[1] self.w = 10...
CriticalHex/WireCross
wirecross.py
wirecross.py
py
3,609
python
en
code
0
github-code
21
[ { "api_name": "pygame.init", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.draw.rect", "line_number": 24, "usage_type": "call" }, { "api_name": "pygame.draw", "line_number": 24, "usage_type": "attribute" }, { "api_name": "pygame.draw.line", "...
22941412445
''' Server that controls LEDs and sends LED state to client To exit server, use CTRL + C SW1/Red LED blinks once per second, SW2/Green LED blinks twice per second Releasing the button will turn off the LED immediately ''' import RPi.GPIO as gpio import time import threading import logging import os import socket impor...
aaroncpascua/ECE-592
LEDServer.py
LEDServer.py
py
7,620
python
en
code
0
github-code
21
[ { "api_name": "RPi.GPIO.setwarnings", "line_number": 31, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_number": 31, "usage_type": "name" }, { "api_name": "RPi.GPIO.setmode", "line_number": 32, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_n...
11841660070
from django.urls import path from . import views from django.contrib import admin from django.urls import path from django.conf import settings from django.conf.urls.static import static urlpatterns = [ path('', views.index, name='index'), path('home', views.home, name='home'), path('addnotice', vi...
SupunSSW/web_portal
myapp/urls.py
urls.py
py
1,187
python
en
code
1
github-code
21
[ { "api_name": "django.urls.path", "line_number": 14, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 15, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 16, "usage_type": "call" }, { "api_name": "django.urls.path",...
20449536419
#!/usr/bin/env python import cv2 import numpy as np import matplotlib.pyplot as plt import sys def meanFilter(im): img = im w = 2 for i in range(2,im.shape[0]-2): for j in range(2,im.shape[1]-2): block = im[i-w:i+w+1, j-w:j+w+1] m = np.mean(block,dtype=np.float32) ...
Claire-Hough/CS4650-DIP-backend
hw2.py
hw2.py
py
1,945
python
en
code
0
github-code
21
[ { "api_name": "numpy.mean", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 14, "usage_type": "attribute" }, { "api_name": "numpy.uint8", "line_number": 20, "usage_type": "attribute" }, { "api_name": "cv2.imread", "line...
9120332325
import numpy as np import pytest import xarray as xr from xarray.core import merge from . import raises_regex from .test_dataset import create_test_data class TestMergeInternals(object): def test_broadcast_dimension_size(self): actual = merge.broadcast_dimension_size( [xr.Variable('x', [1]),...
timothyyu/ml_monorepo
xarray/xarray/tests/test_merge.py
test_merge.py
py
9,051
python
en
code
59
github-code
21
[ { "api_name": "xarray.core.merge.broadcast_dimension_size", "line_number": 13, "usage_type": "call" }, { "api_name": "xarray.core.merge", "line_number": 13, "usage_type": "name" }, { "api_name": "xarray.Variable", "line_number": 14, "usage_type": "call" }, { "api_...
18590442361
# Licensed under a 3-clause BSD style license - see LICENSE.rst import os import pickle from contextlib import nullcontext import numpy as np import pytest from numpy.testing import assert_array_almost_equal from astropy import wcs from astropy.io import fits from astropy.tests.helper import PYTEST_LT_8_0 from astro...
astropy/astropy
astropy/wcs/tests/test_pickle.py
test_pickle.py
py
5,048
python
en
code
4,015
github-code
21
[ { "api_name": "astropy.wcs.WCS", "line_number": 25, "usage_type": "call" }, { "api_name": "astropy.wcs", "line_number": 25, "usage_type": "name" }, { "api_name": "pickle.dumps", "line_number": 26, "usage_type": "call" }, { "api_name": "pickle.loads", "line_num...
26915718153
import os import uuid import json import glob from glitches import glitch_replace from report import GlitchReport, GlitchReportAwareEncoder CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) # All JPG files in sources will be glitched ! SOURCE_DIR = os.path.join(CURRENT_DIR, "sources") DESTINATION_DIR = os.pa...
niconoe/photos-glitch-experiment
glitch.py
glitch.py
py
1,595
python
en
code
0
github-code
21
[ { "api_name": "os.path.dirname", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.join", "line_nu...