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
6198013132
import pandas as pd import itertools import os os.chdir('C:/Users/Shubham Kaushik/projects/workproject/weatherapp/weatherapp/') df = pd.read_csv('Final_wunderground.csv') latlong = pd.read_csv('latlongmapping.csv') df = (df.set_index(['geocode']) .apply(lambda x: x.str.split(',').explode()) .reset_index()) d...
skaushik-05/Weatherapp
weatherapp/cleaning_data.py
cleaning_data.py
py
1,244
python
en
code
0
github-code
18
[ { "api_name": "os.chdir", "line_number": 4, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 5, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_...
34467578216
from globsim.meteorology import emissivity_clear_sky, boltzmann, pressure_from_elevation from typing import Union from pysolar import solar import numpy as np import warnings from typing import Optional def emissivity_all_sky(lw: "Union[float, np.ndarray]", t: "Union[float, np.ndarray]") -> "U...
geocryology/globsim
globsim/scale/toposcale.py
toposcale.py
py
12,416
python
en
code
18
github-code
18
[ { "api_name": "globsim.meteorology.boltzmann", "line_number": 18, "usage_type": "name" }, { "api_name": "numpy.power", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.atleast_1d", "line_number": 59, "usage_type": "call" }, { "api_name": "globsim.me...
4465935655
"""Advent of Code 2021 - Day 2 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is dist...
iiMaXii/advent_of_code_2021
day_02/main.py
main.py
py
2,648
python
en
code
0
github-code
18
[ { "api_name": "dataclasses.dataclass", "line_number": 24, "usage_type": "name" }, { "api_name": "enum.Enum", "line_number": 33, "usage_type": "name" }, { "api_name": "enum.auto", "line_number": 34, "usage_type": "call" }, { "api_name": "enum.auto", "line_numbe...
28224497095
from .serializers import QRCodeSerializer from rest_framework.response import Response from rest_framework.views import APIView from rest_framework import status class QRCodeAPIView(APIView): serializer_class = QRCodeSerializer def post(self, request): serializer = QRCodeSerializer(data=request...
rakibulislam8226/Qr-and-Bar-code
qr_code/views.py
views.py
py
796
python
en
code
0
github-code
18
[ { "api_name": "rest_framework.views.APIView", "line_number": 6, "usage_type": "name" }, { "api_name": "serializers.QRCodeSerializer", "line_number": 7, "usage_type": "name" }, { "api_name": "serializers.QRCodeSerializer", "line_number": 9, "usage_type": "call" }, { ...
5892004185
""" title: bys_rating_describe.py author: Chengyu Wu (chengyu2) data: 05-DEC-20 description: Create histogram of both Bayesian and non-Bayesian rating. """ import seaborn as sns import matplotlib.pyplot as plt import numpy as np import pandas as pd def hist_graph(): df = pd.read_csv('../data_collecti...
jtxtina/dfp-airbnb-zerorisk
data_collection/bys_rating_describe.py
bys_rating_describe.py
py
1,067
python
en
code
0
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.hist", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 17, "usage_type": "name" }, { "api_name": "matplotlib.p...
23387869093
#!/usr/bin/env python # -*- coding: utf-8 -*- import pygame from math import sqrt, radians, cos, sin import json import os import time WIDTH, HEIGHT = 800, 800 class Vec: def __init__(self, x=0, y=0, z=0): self.x = x self.y = y self.z = z def __add__(self, v): try: ...
LordBaryhobal/mc-create-ponder
ponder.py
ponder.py
py
14,015
python
en
code
1
github-code
18
[ { "api_name": "math.sqrt", "line_number": 60, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 94, "usage_type": "call" }, { "api_name": "pygame.image.load", "line_number": 96, "usage_type": "call" }, { "api_name": "pygame.image", "line_numbe...
75257938599
from colorama import init from colorama import Fore, Back, Style import pyowm init() print(Fore.BLACK ) print(Back.CYAN ) owm = pyowm.OWM('7c9f41e4faf7b9046a78088c174938b8', language = "ru" ) def check_city(place): try: observation = owm.weather_at_place(place) w = observation.get_weather() te...
gesti9/Wather--
python.py
python.py
py
776
python
en
code
0
github-code
18
[ { "api_name": "colorama.init", "line_number": 5, "usage_type": "call" }, { "api_name": "colorama.Fore.BLACK", "line_number": 7, "usage_type": "attribute" }, { "api_name": "colorama.Fore", "line_number": 7, "usage_type": "name" }, { "api_name": "colorama.Back.CYAN"...
11033826135
#!/usr/bin/env python import sys import matplotlib import matplotlib.pyplot as plt import numpy as np from cycler import cycler # Create cycler object. Use any styling from above you please bar_cycle = (cycler('hatch', ['///', '--', '...', '\///', 'xxx', '\\\\']) * cycler('color', 'w')*...
enriquefynn/move-protocol
burrow-client/logs-processing/comparison/plot_comparison.py
plot_comparison.py
py
2,425
python
en
code
1
github-code
18
[ { "api_name": "cycler.cycler", "line_number": 11, "usage_type": "call" }, { "api_name": "cycler.cycler", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 31, "usage_type": "call" }, { "api_name": "matplotlib.pyp...
10083683332
import os import re import json import boto3 import local.config as conf class OpenAlex: def __init__(self): self.s3_client = boto3.client('s3') self.bucket = "openalex" self.root_save_path = f"{conf.links.local_root}/openalex/" def read_s3_contents(self, prefix): bucket = se...
jerlanger/mcc
pgETL/downloadData/download-openalex.py
download-openalex.py
py
2,052
python
en
code
0
github-code
18
[ { "api_name": "boto3.client", "line_number": 11, "usage_type": "call" }, { "api_name": "local.config.links", "line_number": 13, "usage_type": "attribute" }, { "api_name": "local.config", "line_number": 13, "usage_type": "name" }, { "api_name": "re.search", "li...
8651957635
################################################ #https://docs.chainer.org/en/stable/glance.html ################################################ import matplotlib matplotlib.use('Agg') import chainer import chainer.functions as F import chainer.links as L from chainer import datasets from chainer import training from...
minatu2d/minatu2d_old.github.io
python-ml-dl/play_with_chainer/mushroom_classification.py
mushroom_classification.py
py
3,714
python
en
code
2
github-code
18
[ { "api_name": "matplotlib.use", "line_number": 5, "usage_type": "call" }, { "api_name": "chainer.__version__", "line_number": 14, "usage_type": "attribute" }, { "api_name": "numpy.genfromtxt", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.unique"...
30999643738
""" System Module """ from django.test import TestCase from .models import NewsletterUser, Newsletter class SetupModelTestCase(TestCase): """ Base test case to be used in all models tests """ def setUp(self): """ Setup for testing models """ self.email = 'joe@email.com'...
nandabritto/Regional_Taste
newsletter/test_models.py
test_models.py
py
1,109
python
en
code
0
github-code
18
[ { "api_name": "django.test.TestCase", "line_number": 6, "usage_type": "name" }, { "api_name": "models.NewsletterUser.objects.create", "line_number": 17, "usage_type": "call" }, { "api_name": "models.NewsletterUser.objects", "line_number": 17, "usage_type": "attribute" }...
38869752455
# Work with Python 3.6 import discord TOKEN = 'NjgxNzAwODQ0OTgyMzcwMzM0.XlSS_g.5idFeXgNwPdhwOQdmFdRtAkXWmI' client = discord.Client() import dota import team_parser dota_obj = dota.dota("appname") players = dota_obj.get_players() #player_details = dota_obj.get_player_info('Miracle-',True) #team_details = dota_obj.g...
Miklagard06/LiqupediaDiscordBot
bot.py
bot.py
py
3,736
python
en
code
0
github-code
18
[ { "api_name": "discord.Client", "line_number": 5, "usage_type": "call" }, { "api_name": "dota.dota", "line_number": 10, "usage_type": "call" }, { "api_name": "discord.Embed", "line_number": 64, "usage_type": "call" }, { "api_name": "team_parser.parse", "line_n...
37882293805
import datetime from aiogram import Bot from bot.services.repo import SQLAlchemyRepo, GameRepo, TeamRepo, ProtocolRepo IS_NOT_SCHEDULE = "Проведение игры разделено на 2 этапа\n\n" \ "<b>\U0001F539 Этап №1.</b> <i>Заранее перед игрой</i>\n" \ "Необходимо <b>ЗАПЛАНИРОВАТЬ ИГРУ</b>\n" ...
AgafonovSiberia/game_engine
bot/texts/private/control_game/tx_control_game.py
tx_control_game.py
py
8,701
python
ru
code
0
github-code
18
[ { "api_name": "bot.services.repo.SQLAlchemyRepo", "line_number": 56, "usage_type": "name" }, { "api_name": "bot.services.repo.GameRepo", "line_number": 57, "usage_type": "argument" }, { "api_name": "bot.services.repo.SQLAlchemyRepo", "line_number": 68, "usage_type": "name...
7517466206
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.mainPage, name='mainPage'), url(r'^setdata/', views.setData), url(r'^viewdata/', views.viewData), url(r'^searchdata/(?P<mType>.+);(?P<mySearchData>.*);', views.searchData), ]
smin5506/HBTModel
HBTServer/urls.py
urls.py
py
270
python
en
code
0
github-code
18
[ { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "django.co...
74601226598
""" This file implements the basic logic of the operation of the support vector machine """ from math import exp from typing import TypeVar import matplotlib.pyplot as plt import utility import minimization from kernels import * class SVM: """ This class implements the basic logic of SVM """ kern...
istimaldar/SVM
svm.py
svm.py
py
5,759
python
en
code
0
github-code
18
[ { "api_name": "minimization.minimize", "line_number": 73, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 129, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 129, "usage_type": "name" }, { "api_name": "matp...
213664357
from PIL import Image def add_margin(pil_img, top, right, bottom, left, color): width, height = pil_img.size new_width = width + right + left new_height = height + top + bottom result = Image.new(pil_img.mode, (new_width, new_height), color) result.paste(pil_img, (left, top)) return result
neurobiology-ut/PHILOW
src/napari_philow/segmentation/utils.py
utils.py
py
316
python
en
code
22
github-code
18
[ { "api_name": "PIL.Image.new", "line_number": 8, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 8, "usage_type": "name" } ]
20255576532
from django.shortcuts import render,redirect from django.contrib import messages from .models import Message, Comment from login_app.models import User import datetime def index(request): if 'user_email' in request.session: context = { 'all_messages': Message.objects.all(), 'message_...
wijdan1995/the-wall-django
wall_app/views.py
views.py
py
2,097
python
en
code
0
github-code
18
[ { "api_name": "models.Message.objects.all", "line_number": 9, "usage_type": "call" }, { "api_name": "models.Message.objects", "line_number": 9, "usage_type": "attribute" }, { "api_name": "models.Message", "line_number": 9, "usage_type": "name" }, { "api_name": "da...
13625412481
import os import random import numpy as np import torch import config from tqdm import tqdm import cv2 import time """ Seeding the randomness """ def seeding(seed): random.seed(seed) os.environ["PYTHONHASHSEED"] = str(seed) np.random.seed(seed) torch.manual_seed(seed) torch.cuda.manual_seed(seed) ...
Giurzo/Virtual-Try-On
__Utils/utils.py
utils.py
py
1,586
python
en
code
0
github-code
18
[ { "api_name": "random.seed", "line_number": 12, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 13, "usage_type": "attribute" }, { "api_name": "numpy.random.seed", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.random", "lin...
515901998
from typing import List import colorsys import random import cv2 import rclpy from rclpy.node import Node from cv_bridge import CvBridge from vision_msgs.msg import Detection2D, Detection2DArray from sensor_msgs.msg import Image from video_io.video_publisher import VIDEO_DIR QUEUE_LEN = 10 class VisualizeDetecti...
fede98unibo/AIrDrone_Security
video_io/video_io/visualize_detections.py
visualize_detections.py
py
3,626
python
en
code
1
github-code
18
[ { "api_name": "rclpy.node.Node", "line_number": 19, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 22, "usage_type": "name" }, { "api_name": "vision_msgs.msg.Detection2D", "line_number": 22, "usage_type": "name" }, { "api_name": "vision_msgs.m...
27789914314
import random import re import time from CommonLib_version_01 import os, pd, create_csv, Command_line_arg, Checking_Process, open_html_file, create_log, send_msg import inspect import requests class Get_campus_data: def __init__(self, html_files_path, visited_files): self.visited_files = visited_files ...
Murugesan18/checking6
Studies in Australia/00 - Tab - Campus/Check kk/01 - Fetch data/get_campus_data.py
get_campus_data.py
py
6,166
python
en
code
0
github-code
18
[ { "api_name": "CommonLib_version_01.os.listdir", "line_number": 32, "usage_type": "call" }, { "api_name": "CommonLib_version_01.os", "line_number": 32, "usage_type": "name" }, { "api_name": "CommonLib_version_01.open_html_file", "line_number": 38, "usage_type": "call" }...
9423742942
import pygame pygame.init() display_width = 800 display_height = 600 black = (0,0,0) white = (255,255,255) red = (255,0,0) green = (0,255,0) blue = (0,0,255) gameDisplay = pygame.display.set_mode((display_width,display_height)) pygame.display.set_caption('Screen2') clock = pygame.time.Clock() carImg...
Platforuma/Beginner-s_Python_Codes
11_Game_Development/2_Pygame/1_Car-_crash/3-pygame_moving-an-image.py
3-pygame_moving-an-image.py
py
1,413
python
en
code
1
github-code
18
[ { "api_name": "pygame.init", "line_number": 2, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 13, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pygame.display...
20558064515
''' Inference for the DreamBooth model. ''' import os import zipfile import predictor import runpod from runpod.serverless.utils import download, upload, rp_cleanup MODEL = predictor.Predictor() MODEL.setup() def run(job): ''' Run inference using the dreambooth model. Job input: { "id": st...
runpod/serverless-workers
workers/DreamBooth-v1/cog_example/runpod_infer.py
runpod_infer.py
py
6,551
python
en
code
47
github-code
18
[ { "api_name": "predictor.Predictor", "line_number": 10, "usage_type": "call" }, { "api_name": "runpod.serverless.utils.download.download_input_objects", "line_number": 79, "usage_type": "call" }, { "api_name": "runpod.serverless.utils.download", "line_number": 79, "usage_...
53872982
''' Created on Dec 3, 2011 @author: gpleiss ''' import networkx as nx import matplotlib.pyplot as plt from meshgraph import MeshGraph from algorithm import Algorithm from DSRalgorithm import DSRalgorithm from BATMANalgorithm import BATMANalgorithm from OWNalgorithm import OWNalgorithm from GLSRalgorithm import GLSRalg...
gpleiss/OlinMeshNetwork
simulation.py
simulation.py
py
2,101
python
en
code
1
github-code
18
[ { "api_name": "algorithm.Algorithm", "line_number": 29, "usage_type": "argument" }, { "api_name": "matplotlib.pyplot.ion", "line_number": 37, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 37, "usage_type": "name" }, { "api_name": "matpl...
37152410888
import sqlite3 import os import docx import discord from discord.ext import commands # Again, we need this imported import random import asyncio class AgentChatCommands(commands.Cog): """Commands for agent""" client = discord.Client() def __init__(self, bot: commands.Bot): self.bot...
AnastasiadisLoukas/flexible_learning_discord_bot
agentchatcommands.py
agentchatcommands.py
py
42,790
python
el
code
0
github-code
18
[ { "api_name": "discord.ext.commands.Cog", "line_number": 10, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 10, "usage_type": "name" }, { "api_name": "discord.Client", "line_number": 12, "usage_type": "call" }, { "api_name": "dis...
7715342770
from flask import make_response from ..connect_to_aws import database from ..model.create_database import Gifts # def show_good_sales_gift_method(): # output_message = { # "message": "Information waiting for confirmation" # } # gifts = Gifts.query.order_by(Gifts.gift_sales.desc()).limit(2) # ...
COMP5703-CS57-3/Online-Gift-Shop
backend/main/service/dashboard_show_good_sales_gift.py
dashboard_show_good_sales_gift.py
py
2,333
python
en
code
0
github-code
18
[ { "api_name": "model.create_database.Gifts.query.order_by", "line_number": 27, "usage_type": "call" }, { "api_name": "model.create_database.Gifts.query", "line_number": 27, "usage_type": "attribute" }, { "api_name": "model.create_database.Gifts", "line_number": 27, "usage...
30626893126
# -*- coding: utf-8 -*- import scrapy from scrapy import Request from urllib import parse from VideoSpider.items import TvItem class TencentVarietySpider(scrapy.Spider): name = 'Tencent_variety' allowed_domains = ['v.qq.com'] start_urls = ['http://v.qq.com/x/list/variety'] def parse(self, response): ...
guanshilong/Scrapy-spiders
VideoSpider/spiders/Tencent_variety.py
Tencent_variety.py
py
2,995
python
en
code
3
github-code
18
[ { "api_name": "scrapy.Spider", "line_number": 7, "usage_type": "attribute" }, { "api_name": "urllib.parse.urljoin", "line_number": 17, "usage_type": "call" }, { "api_name": "urllib.parse", "line_number": 17, "usage_type": "name" }, { "api_name": "scrapy.Request", ...
73342366121
#!/usr/bin/env python import requests as r from pyquery import PyQuery as pq import os url = 'http://dict.youdao.com/fsearch?q=%s' try: html = r.get(url % os.sys.argv[1]).content d = pq(html) if not len([print(v.text) for v in d('phonetic-symbol,content')]): print("can't find word") except: pr...
shidenggui/di
di3.py
di3.py
py
347
python
en
code
0
github-code
18
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "os.sys", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pyquery.PyQuery", "line_number": 10, "usage_type": "call" } ]
3687210177
""" Unit tests for RFI simulation """ import os import logging import unittest import astropy.units as u import numpy import numpy.testing from astropy.coordinates import SkyCoord from rascil.data_models import PolarisationFrame, rascil_path from rascil.processing_components import ( create_blockvisibility, ...
NLESC-quantum/rascil
tests/processing_components/test_rfi_regression.py
test_rfi_regression.py
py
5,738
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 27, "usage_type": "call" }, { "api_name": "logging.WARNING", "line_number": 28, "usage_type": "attribute" }, { "api_name": "unittest.TestCase", "line_number": 31, "usage_type": "attribute" }, { "api_name": "os.gete...
42178960859
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import re import time import urllib3 import requests import datetime import argparse urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) # CHANGE THIS # PRE = "' OR" # string to put before each payload POST = '--' # string to after before each pay...
physics-sec/MySQLi
MySQLi.py
MySQLi.py
py
13,187
python
en
code
0
github-code
18
[ { "api_name": "urllib3.disable_warnings", "line_number": 12, "usage_type": "call" }, { "api_name": "urllib3.exceptions", "line_number": 12, "usage_type": "attribute" }, { "api_name": "requests.post", "line_number": 32, "usage_type": "call" }, { "api_name": "time.t...
29705925824
from gui import Ui_MainWindow import sys from PyQt5.QtWidgets import * from PyQt5.QtCore import QTimer, pyqtSignal import os import threading import shutil import datetime class APKSoupMain(QMainWindow): injectSignal = pyqtSignal() progressSignal = pyqtSignal(int) def __init__(self): super()....
SuperTavor/APKSoup
main.py
main.py
py
5,749
python
en
code
2
github-code
18
[ { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 12, "usage_type": "call" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 13, "usage_type": "call" }, { "api_name": "gui.Ui_MainWindow", "line_number": 18, "usage_type": "call" }, { "api_name": "PyQ...
14342937705
import numpy as np from pymongo import MongoClient import pyaudio import click from bunch import Bunch db = MongoClient("sqwak.kingofthestack.com") def get_unrated_sample(): result = db.sqwaks.sounds.find_one({ "rating": None }) db_amps = np.array(result["amplitudes"]) return Bunch({ ...
dharness/sqwak
similarity-service/ratings.py
ratings.py
py
2,023
python
en
code
1
github-code
18
[ { "api_name": "pymongo.MongoClient", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 14, "usage_type": "call" }, { "api_name": "bunch.Bunch", "line_number": 15, "usage_type": "call" }, { "api_name": "pyaudio.PyAudio", "lin...
24130650731
from collections.abc import Callable, Iterable, Sequence import pytest # not ideal, but for now access this member. # TODO: find out if it's ok for the fetcher to have the API as # a dependency, b/c that is where this function belongs. from cmk.fetchers._snmpscan import _evaluate_snmp_detection from cmk.agent_based....
bbayersva/checkmk
tests/unit/cmk/base/api/agent_based/test_agent_based_utils.py
test_agent_based_utils.py
py
4,927
python
en
code
null
github-code
18
[ { "api_name": "collections.abc.Callable", "line_number": 24, "usage_type": "name" }, { "api_name": "collections.abc.Callable", "line_number": 27, "usage_type": "name" }, { "api_name": "collections.abc.Iterable", "line_number": 35, "usage_type": "name" }, { "api_na...
38440103128
import json import pytest import logging def load_configurations(): with open("configurations/config.json") as f: configurations = json.load(f) # loop dictionary and store in list of tuples list_tuples = [] for config in configurations: tuple_config = (config["config_id"...
ujwal-aerialarts/python-with-jenkins
test_configurations.py
test_configurations.py
py
879
python
en
code
0
github-code
18
[ { "api_name": "json.load", "line_number": 7, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 19, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 19, "usage_type": "attribute" } ]
23873957404
from pprint import pprint import yaml from netmiko import (ConnectHandler, NetmikoAuthenticationException, NetmikoTimeoutException) def send_show_command(device, commands): result = {} try: with ConnectHandler(**device) as ssh: ssh.enable() for command in ...
natenka/pyneng-examples-exercises
examples/18_ssh_telnet/4_netmiko.py
4_netmiko.py
py
779
python
en
code
234
github-code
18
[ { "api_name": "netmiko.ConnectHandler", "line_number": 11, "usage_type": "call" }, { "api_name": "netmiko.NetmikoTimeoutException", "line_number": 17, "usage_type": "name" }, { "api_name": "netmiko.NetmikoAuthenticationException", "line_number": 17, "usage_type": "name" ...
22458834556
import unittest from collections import Counter import numpy as np import scipy.sparse as sparse import torch from metal.utils import pred_to_prob, rargmax, recursive_merge_dicts, split_data class UtilsTest(unittest.TestCase): def test_rargmax(self): x = np.array([2, 1, 2]) np.random.seed(1) ...
HazyResearch/metal
tests/metal/test_utils.py
test_utils.py
py
3,235
python
en
code
418
github-code
18
[ { "api_name": "unittest.TestCase", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.random", ...
2408126008
""" Abstract class that takes care of a lot of the boiler plate code. """ import os import cv2 import numpy as np import torch from PIL import Image, ImageFile ImageFile.LOAD_TRUNCATED_IMAGES = True class AbstractDataset(torch.utils.data.Dataset): def __init__(self, name, split, data_root): # dataset pa...
mbanani/unsupervisedRR
unsupervisedRR/datasets/abstract.py
abstract.py
py
2,913
python
en
code
131
github-code
18
[ { "api_name": "PIL.ImageFile.LOAD_TRUNCATED_IMAGES", "line_number": 11, "usage_type": "attribute" }, { "api_name": "PIL.ImageFile", "line_number": 11, "usage_type": "name" }, { "api_name": "torch.utils", "line_number": 14, "usage_type": "attribute" }, { "api_name"...
34812204950
import torch # Load the question-answering pipeline from transformers import pipeline question_answerer = pipeline('question-answering') device=torch.device("mps") print(f"device={device}") # Define a context and question context = "The quick brown fox jumps over the lazy dog" question = "What animal jumps over the la...
leejw51crypto/CodingNote
test-m1/answer.py
answer.py
py
571
python
en
code
2
github-code
18
[ { "api_name": "transformers.pipeline", "line_number": 4, "usage_type": "call" }, { "api_name": "torch.device", "line_number": 6, "usage_type": "call" } ]
30756639899
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('problempost', '0003_user'), ] operations = [ migrations.AddField( model_name='user', name='councilID...
asadahmedtech/Devathon17
dev17/problempost/migrations/0004_user_councilid.py
0004_user_councilid.py
py
478
python
en
code
0
github-code
18
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AddField", "line_number": 14, "usage_type": "call" }, { ...
28409235698
# -*-coding:utf-8 -*- u""" :创建时间: 2022/3/18 2:31 :作者: 苍之幻灵 :我的主页: https://cpcgskill.com :QQ: 2921251087 :爱发电: https://afdian.net/@Phantom_of_the_Cang :aboutcg: https://www.aboutcg.org/teacher/54335 :bilibili: https://space.bilibili.com/351598127 """ from __future__ import unicode_literals, print_function import maya.c...
cpcgskill/CPMel
src/CPMel/_command/commands.py
commands.py
py
4,768
python
en
code
5
github-code
18
[ { "api_name": "maya.cmds.ls", "line_number": 71, "usage_type": "call" }, { "api_name": "maya.cmds", "line_number": 71, "usage_type": "name" }, { "api_name": "maya.cmds", "line_number": 74, "usage_type": "argument" }, { "api_name": "maya.cmds", "line_number": 7...
33962119139
import random from utility import cross_first_sim, cross_second_sim import matplotlib.pyplot as plt NS_CROSS_TIME = 10 EW_CROSS_TIME = 10 NS_BLOCK_TIME = 50 # this value has no implications on the final result, it is constant between both scenarios NS_LIGHT_TIME = 0 EW_LIGHT_TIME = 0 MIN_GO_TIME = 5 if __name__ =...
elinsooon/StreetCrosser
main.py
main.py
py
1,494
python
en
code
0
github-code
18
[ { "api_name": "utility.cross_first_sim", "line_number": 27, "usage_type": "call" }, { "api_name": "utility.cross_second_sim", "line_number": 28, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 35, "usage_type": "call" }, { "api_name"...
18988029782
from common.crawler import * from bs4 import BeautifulSoup from bs4.element import NavigableString, Tag from common.utils import * categoryTypeDic={"0":"All", "1":"Unsorted", "2":"Album", "3":"EP", "4":"Single", "5":"Bootleg", ...
wmenjoy/music_manger
myzcloud/parser.py
parser.py
py
8,723
python
en
code
0
github-code
18
[ { "api_name": "bs4.BeautifulSoup", "line_number": 76, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 146, "usage_type": "call" }, { "api_name": "bs4.element.Tag", "line_number": 158, "usage_type": "argument" } ]
72690308520
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ imports """ import threading import logging import signal import sys import configparser import os # add more supported sensors #import SensorSPISTM32 import SensorI2CBME280 # add more API's import APISensor #import APIMotor #import APIRelais from flask import Flas...
janhieber/WaterCtrl
RaspberryPi/scripts/WebServiceSensor.py
WebServiceSensor.py
py
2,537
python
en
code
6
github-code
18
[ { "api_name": "flask.Flask", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 36, "usage_type": "call" }, { "api_name": "os.path", "line_number": 36, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_...
21263888139
#!/usr/bin/env python3 import rospy from std_msgs.msg import Float32MultiArray from geometry_msgs.msg import TwistStamped, Twist from nav_msgs.msg import Odometry from geometry_msgs.msg import PoseStamped from mavros_msgs.msg import State import signal from mavros_msgs.srv import CommandBool, SetMode, SetModeRequest, C...
Kyriece/uav
scripts/objectTracking.py
objectTracking.py
py
6,588
python
en
code
0
github-code
18
[ { "api_name": "mavros_msgs.msg.State", "line_number": 17, "usage_type": "call" }, { "api_name": "cv_bridge.CvBridge", "line_number": 32, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 38, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2G...
3531798190
import torch.nn as nn import torch.nn.functional as F from collections import OrderedDict defaultcfg = [64, 64, 'M', 128, 128, 'M', 256, 256, 256, 'M', 512, 512, 512, 'M', 512, 512, 512] # [50, 50, 101, 101, 202, 202, 202, 128, 128, 128, 128, 128, 512] # [0.79, 0.79, 0.79, 0....
geyao-c/my_experience
models/selfsupcon_supcon_adapter_vgg.py
selfsupcon_supcon_adapter_vgg.py
py
4,239
python
en
code
0
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 24, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 24, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 39, "usage_type": "call" }, { "api_name": "torch.nn", "lin...
27987142251
# string = "01:45" # # print("changing : -> -") # newStr = string[:2] + "-" + string[-2:] # print(newStr) # # print("some other tests") # print(string[:2]) # print(string[-3:]) # print(string[0]) # # print(int(string[0]) + 2) # # print(str(int(string[0:2]) + 2) + "hello") # TO generate uid import datetime name = "Al ...
Nasir-6/thm-pwa
time_converter_scripts/playground.py
playground.py
py
539
python
en
code
0
github-code
18
[ { "api_name": "datetime.datetime.strptime", "line_number": 20, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 20, "usage_type": "attribute" } ]
4888133775
#!/usr/bin/env python3 from pymongo import MongoClient from pprint import pprint import datetime import numpy as np client = MongoClient("mongodb+srv://mary_martin:If6was9then%3F@lp-cluster-jdvpa.mongodb.net/?authSource=admin") db = client.Staffing # server status command and results serverStatusResult=db.command("s...
Mengchen-G/Schedule-System
data.py
data.py
py
5,353
python
en
code
0
github-code
18
[ { "api_name": "pymongo.MongoClient", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 123, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 136, "usage_type": "call" }, { "api_name": "numpy.array", "lin...
40595753367
import sqlite3 import sys from PyQt5 import uic, QtCore from PyQt5.QtWidgets import QApplication from PyQt5.QtWidgets import QMainWindow, QTableWidgetItem, QTableWidget, QPushButton class DBSample(QMainWindow): def __init__(self): super().__init__() uic.loadUi('UI1.ui', self) se...
kumys777/Git
main.py
main.py
py
1,479
python
ru
code
0
github-code
18
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 8, "usage_type": "name" }, { "api_name": "PyQt5.uic.loadUi", "line_number": 11, "usage_type": "call" }, { "api_name": "PyQt5.uic", "line_number": 11, "usage_type": "name" }, { "api_name": "sqlite3.connect...
14198078682
# encoding: utf-8 from django.contrib import admin, messages from django.contrib.contenttypes.generic import GenericTabularInline from treebeard.admin import TreeAdmin from django.utils.text import capfirst from django.utils.translation import ugettext_lazy as _ from django.forms import formsets from django.forms.model...
starbeast/CottageClub
Cottage_Club/main/admin.py
admin.py
py
12,847
python
en
code
0
github-code
18
[ { "api_name": "pymorphy.get_morph", "line_number": 24, "usage_type": "call" }, { "api_name": "django.conf.settings.PYMORPHY_DICTS", "line_number": 24, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 24, "usage_type": "name" }, { "...
15856611537
import numpy as np import h5py """ source: https://gis.stackexchange.com/questions/127165/more-accurate-way-to-calculate-area-of-rasters The computed area is the surface of the ring from the equator to the latitude f. As a validation, if f = 90deg, we have the half of the total surface of the earth. Computing the rad...
aspyk/vegeo_trend_analysis
test_scripts/TEST_compute_pixel_surface.py
TEST_compute_pixel_surface.py
py
2,438
python
en
code
0
github-code
18
[ { "api_name": "numpy.sqrt", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.radians", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 27,...
32457693678
""" Test suite to ensure codepath coverage """ import json import os import random from datetime import datetime from urllib.parse import urlencode from typing import Dict, List, Optional, Callable import pytest from pytz import timezone from flask import Response from flask.testing import FlaskClient from app.core i...
scanner-research/tv-news-viewer
tests/test_app.py
test_app.py
py
8,167
python
en
code
3
github-code
18
[ { "api_name": "os.path.join", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path.realpath", "lin...
27505210093
import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt sns.set_style("darkgrid") sns.set_style("darkgrid") base_temperatures = pd.read_json('json/temperature_modis.json') base_temperatures.sort_index(inplace=True) temperatures = base_temperatures.copy() print(base_temperatures.h...
owerko/NASA
MODIS_Terra/modis_explore.py
modis_explore.py
py
5,362
python
en
code
0
github-code
18
[ { "api_name": "seaborn.set_style", "line_number": 6, "usage_type": "call" }, { "api_name": "seaborn.set_style", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.read_json", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot....
34931549484
#COURSEWORK import pygame import pygame_menu from sprites import * pygame.init() screen_width = 460 screen_height = 690 win = pygame.display.set_mode((screen_width,screen_height)) #walkRight = [pygame.image.load('R1.png'), pygame.image.load('R2.png'), pygame.image.load('R3.png'), pygame.image.load('R4.png')...
Mqdkip/Mqdkip
Coursework.py
Coursework.py
py
6,373
python
en
code
0
github-code
18
[ { "api_name": "pygame.init", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 10, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pygame.image.l...
36991720954
import wx import os from gui.preferenceView import PreferenceView from gui.bitmapLoader import BitmapLoader import gui.mainFrame import service import gui.globalEvents as GE class PFHTMLExportPref ( PreferenceView): title = "HTML Export" desc = "HTML Export (File > Export HTML) allows you to export your en...
blitzmann/pyfa-chinese
gui/builtinPreferenceViews/pyfaHTMLExportPreferences.py
pyfaHTMLExportPreferences.py
py
6,223
python
en
code
0
github-code
18
[ { "api_name": "gui.preferenceView.PreferenceView", "line_number": 12, "usage_type": "name" }, { "api_name": "gui.preferenceView.mainFrame.MainFrame.getInstance", "line_number": 25, "usage_type": "call" }, { "api_name": "gui.preferenceView.mainFrame", "line_number": 25, "u...
37869529752
import json from channels.generic.websocket import AsyncWebsocketConsumer import asyncio from channels.consumer import AsyncConsumer from channels.db import database_sync_to_async # from account.models import User from django.contrib.auth.models import User from asgiref.sync import async_to_sync from channels.layers i...
niteshsinha17/GameZilla
ticTacToe/consumer.py
consumer.py
py
11,261
python
en
code
1
github-code
18
[ { "api_name": "channels.layers.get_channel_layer", "line_number": 28, "usage_type": "call" }, { "api_name": "asyncio.sleep", "line_number": 29, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 33, "usage_type": "call" }, { "api_name": "game.model...
11310573505
import numpy as np import pandas as pd import pickle import re import os import sys import torch from torchmodels import TorchMLP from snorkel.labeling.model import LabelModel from scipy import sparse from sklearn.metrics import roc_auc_score from sklearn.metrics import log_loss from sklearn.feature_extraction.text imp...
benbo/interactive-weak-supervision
utils.py
utils.py
py
29,151
python
en
code
29
github-code
18
[ { "api_name": "re.compile", "line_number": 20, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 21, "usage_type": "call" }, { "api_name": "sklearn.feature_extraction.text.CountVectorizer", "line_number": 74, "usage_type": "call" }, { "api_name": ...
3241079055
#!/usr/bin/python # -*- coding: utf-8 -*- import os import re import simplejson as json from kodi_six import xbmcplugin, xbmcgui, xbmcvfs from kodi_six.utils import py2_encode, py2_decode from . import Settings from .Helpers import * def showDialog(title, description): xbmcgui.Dialog().notification(title, descr...
s0faking/plugin.video.orftvthek
resources/lib/Base.py
Base.py
py
9,829
python
en
code
36
github-code
18
[ { "api_name": "kodi_six.xbmcgui.Dialog", "line_number": 15, "usage_type": "call" }, { "api_name": "kodi_six.xbmcgui", "line_number": 15, "usage_type": "name" }, { "api_name": "kodi_six.xbmcgui.ListItem", "line_number": 45, "usage_type": "call" }, { "api_name": "ko...
31037553908
import numpy as np import matplotlib.pyplot as plt def main(): filepath = "../processed/correct_within_1_try2.npy" Y = np.load(filepath)[:,1:] Y = np.absolute(Y - 1) print(np.shape(Y)) M = np.mean(Y, axis=0) print(np.shape(M)) plt.plot(M) plt.xlabel("Timestep") plt.ylabel(...
raejoon/cs230-bnr
integrate/scripts/data_balance.py
data_balance.py
py
424
python
en
code
1
github-code
18
[ { "api_name": "numpy.load", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.absolute", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.shape", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 10...
23043802052
import aiohttp import json import logging logger = logging.getLogger(__name__) __pokemon_url = "https://pokeapi.co/api/v2/pokemon/{}" async def get_pokemon(pokedex_id): """Asynchronous API call to get the information for a Pokemon by its Pokedex ID number Parameters ---------- pokedex_id : int ...
dlrocker/pikamon-py
pikamon/pokeapi/api.py
api.py
py
843
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "aiohttp.ClientSession", "line_number": 24, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 29, "usage_type": "call" } ]
15530080602
"""track datasets with W&B. https://docs.wandb.ai/tutorials/artifacts""" import torch import pandas as pd import wandb from typing import Dict, Any, Optional, Tuple import os import sys import json from LANAM.config.default import defaults from LANAM.data.base import LANAMDataset, LANAMSyntheticDataset cfg = defa...
D2phus/Reproduced-LA-NAM
LANAM/utils/wandb.py
wandb.py
py
8,412
python
en
code
0
github-code
18
[ { "api_name": "LANAM.config.default.defaults", "line_number": 15, "usage_type": "call" }, { "api_name": "LANAM.data.base.LANAMDataset", "line_number": 17, "usage_type": "name" }, { "api_name": "LANAM.data.base.LANAMDataset", "line_number": 26, "usage_type": "argument" }...
19734004532
import os import sys from PIL import Image if len(sys.argv) != 4: print("usage: python img2fmem.py image_file colour_bits output_format") print(" image_file: source image file name") print(" colour_bits: number of colour bits per pixel: 4, 6, or 8") print(" output_format: mem, coe or ...
NEO-JAMMA/Altair8800_Mister
graphics/img2fmem.py
img2fmem.py
py
4,378
python
en
code
2
github-code
18
[ { "api_name": "sys.argv", "line_number": 5, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.splitext", "line_numb...
22585512036
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Jul 23 21:42:48 2020 @author: yochai_yemini """ import numpy as np import soundfile as sf from utils import stft, normalize_mc, update_max, update_min import pathlib import pickle import argparse # number of microphones used for recording MICS_NUM = 8...
yochaiye/scene_agnostic_dereverberation
data/prepare_dataset.py
prepare_dataset.py
py
7,625
python
en
code
5
github-code
18
[ { "api_name": "numpy.exp", "line_number": 25, "usage_type": "call" }, { "api_name": "soundfile.read", "line_number": 67, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 68, "usage_type": "call" }, { "api_name": "numpy.abs", "line_number": 68,...
19501658298
#-*- coding=utf-8 -*- #written by Hacden 2020/03/25 import socket import os import random import sys import uuid import struct mac = uuid.UUID(int=uuid.getnode()).hex[-12:] myaddr = "_".join([mac[e:e+2] for e in range(0,11,2)]) class CRYPT_FILE(): def __init__(self): #key文件名 self.key_file = [myadd...
hacden/vultools
加密文件代码/加密.py
加密.py
py
4,097
python
en
code
9
github-code
18
[ { "api_name": "uuid.UUID", "line_number": 11, "usage_type": "call" }, { "api_name": "uuid.getnode", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 19, "usage_type": "attribute" }, { "api_name": "random.shuffle", "line_numbe...
274345473
from django.shortcuts import render, HttpResponse from studentApp.forms import StudentForm, CourseEnrollmentForm from studentApp.models import Student # Create your views here. def addStudent_view(request): if request.POST: form = StudentForm(request.POST) if form.is_valid: form.save(...
MohtasimNuran/ClassRoutineDjango
studentApp/views.py
views.py
py
1,370
python
en
code
0
github-code
18
[ { "api_name": "studentApp.forms.StudentForm", "line_number": 10, "usage_type": "call" }, { "api_name": "django.shortcuts.HttpResponse", "line_number": 13, "usage_type": "call" }, { "api_name": "django.shortcuts.HttpResponse", "line_number": 15, "usage_type": "call" }, ...
40085288136
from binance.client import Client class Connection: def __init__(self, api_key, api_secret): self.api_key = api_key self.api_secret = api_secret def connection(self): api_key = 'ZdALDrmOIrO8udP9eohld8iiW7wCWUVvE4giKOfc7uVO0OevAmBG3aEUM3n8w35N' api_secret = 'BgDuuRchRE7cubNZ9y...
mossaddak/BinanceSpndanBhai
binance_action/binance_connection.py
binance_connection.py
py
525
python
en
code
0
github-code
18
[ { "api_name": "binance.client.Client", "line_number": 14, "usage_type": "call" } ]
38481658248
import time import subprocess import os import sys from termcolor import colored def spawn_server(): os.system("killall CAV_server > /dev/null 2>&1") os.system("killall -9 vlc > /dev/null 2>&1") time.sleep(1) from util import resource_path proc = subprocess.Popen( resource_path("CAV_serv...
Harsh14901/AudioShare
CLI/cli/osx_util.py
osx_util.py
py
1,321
python
en
code
2
github-code
18
[ { "api_name": "os.system", "line_number": 9, "usage_type": "call" }, { "api_name": "os.system", "line_number": 10, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 11, "usage_type": "call" }, { "api_name": "subprocess.Popen", "line_number": 1...
20928714134
import numpy as np from tqdm import tqdm class Hamiltonian(): ''' Parameters: ''' def __init__(self, logp, grad_logp, ndim, initial_position, T, eps, tau): self._logp = logp # potential energy self._dHdq = grad_logp self._ndim = ndim self._T = T self._eps = ep...
JohnYKiyo/kernel_method_numpy
nukernelmtd/sampling/MCMC/hamiltonian.py
hamiltonian.py
py
2,124
python
en
code
0
github-code
18
[ { "api_name": "numpy.atleast_1d", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.square", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.atleast_1d", "line_number": 41, "usage_type": "call" }, { "api_name": "numpy.random.normal", ...
37911878501
#!/usr/bin/env python # -*- coding:utf-8 -*- """ File Name: data_prepare.py Description: Created by YongBai on 2020/12/2 5:04 PM. """ import scanpy as sc import numpy as np import scipy as sp import pandas as pd import logging class STSimpleData: def __init__(self, adata): self.adata = ada...
y-bai/bgi-deep_st
data/data_prepare.py
data_prepare.py
py
1,631
python
en
code
0
github-code
18
[ { "api_name": "scanpy.datasets.visium_sge", "line_number": 27, "usage_type": "call" }, { "api_name": "scanpy.datasets", "line_number": 27, "usage_type": "attribute" }, { "api_name": "scanpy.pp.calculate_qc_metrics", "line_number": 29, "usage_type": "call" }, { "ap...
18082231385
import click import logging import math import json import threading import RPi.GPIO as GPIO import aqi from signal import pthread_kill, SIGTSTP from time import sleep from xmlrpc.server import SimpleXMLRPCServer import xmlrpc.client """ Simple client/server to count sensor clicks and compute wind speed. """ HA...
crashfrog/Homebridge-AQI-Anemometer
python/station/anemometer.py
anemometer.py
py
2,644
python
en
code
0
github-code
18
[ { "api_name": "math.pi", "line_number": 31, "usage_type": "attribute" }, { "api_name": "aqi.get", "line_number": 50, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 54, "usage_type": "call" }, { "api_name": "click.group", "line_number": 60, ...
70587092521
import json import unittest import requests from lib.recruit_career.authentication import Authenticate from lib.recruit_career.rc_client import RecruitClient class YahooAPITestCase(unittest.TestCase): def test_for_successful_response(self): result = requests.get("http://www.yahoo.com") self.asser...
EllieSky/APIAutomation_Summer2020
tests/my_test.py
my_test.py
py
2,247
python
en
code
1
github-code
18
[ { "api_name": "unittest.TestCase", "line_number": 9, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 18, "usage_type": "attribute" }, { "api_name": "lib.recruit...
74738640360
import pytest from core_framework_lib.selenium_wrapper import Driver from core_framework_lib.project_paths import ProjectPath from core_framework_lib.logger import SetLogger from core_framework_lib.setup import FrameworkConfiguration @pytest.fixture(scope="function") # Possible values for scope are: function, class,...
pankajbi/autobot
core_framework_lib/common_fixtures.py
common_fixtures.py
py
1,081
python
en
code
0
github-code
18
[ { "api_name": "core_framework_lib.selenium_wrapper.Driver", "line_number": 14, "usage_type": "call" }, { "api_name": "core_framework_lib.setup.FrameworkConfiguration.selenium_implicit_wait", "line_number": 14, "usage_type": "attribute" }, { "api_name": "core_framework_lib.setup.F...
27483972445
from time import sleep import netaddr as netaddr from netaddr import IPNetwork from routeros_api import RouterOsApiPool from common import get_config, setup_logging, heartbeat ROUTE_DISTANCE = 39 hot_lists = { 'google', 'com.instagram', 'com.netflix', 'youtube', 'facebook', 'net.fbcdn', ...
phntom/fused_home
fused_home/router.py
router.py
py
3,613
python
en
code
1
github-code
18
[ { "api_name": "netaddr.cidr_merge", "line_number": 45, "usage_type": "call" }, { "api_name": "netaddr.IPNetwork", "line_number": 45, "usage_type": "call" }, { "api_name": "common.setup_logging", "line_number": 92, "usage_type": "call" }, { "api_name": "common.get_...
34706049473
from typing import List from fastapi import FastAPI, Body from db import * create_logs_table(); app = FastAPI() @app.get("/logs") async def fetch_logs(): return get_logs(); @app.post("/logs") async def create_log(log: str = Body(...)): save_log(log) @app.delete("/logs") async def delete_logs(): truncate...
TurboGoose/grid-and-cloud-computing
Docker/server/main.py
main.py
py
334
python
en
code
0
github-code
18
[ { "api_name": "fastapi.FastAPI", "line_number": 6, "usage_type": "call" }, { "api_name": "fastapi.Body", "line_number": 13, "usage_type": "call" } ]
73645769319
import numpy as np from joblib import Parallel, delayed from matplotlib import pyplot as plt import datasets, prior_sample, optimizers, classifiers def run(sample_size = 50, simulation_num = 200, scale = 1, step_size = 0.1, iterations = 100, data_name = 'cancer', nnodes = 32, prior_method = 'n...
HoangNguyenM/anchored-langevin-dynamics
NN.py
NN.py
py
4,817
python
en
code
0
github-code
18
[ { "api_name": "datasets.get_data", "line_number": 23, "usage_type": "call" }, { "api_name": "optimizers.vanilla_LD_Gauss_smooth", "line_number": 31, "usage_type": "call" }, { "api_name": "optimizers.vanilla_anchored_LD_Gauss_smooth", "line_number": 32, "usage_type": "call...
70287224361
#!/usr/bin/python3 from collections import namedtuple Instruction = namedtuple("Instruction", ["op", "address", "value"]) class VMachine: def __init__(self, version=1): self.memory = dict() self.mask = "X" * 36 self.or_mask = int("0" * 36, 2) self.and_mask = int("1" * 36, 2) ...
julminen/aoc-2020
day_14.py
day_14.py
py
3,330
python
en
code
0
github-code
18
[ { "api_name": "collections.namedtuple", "line_number": 5, "usage_type": "call" } ]
26088427268
import cv2 import numpy as np import os import random paths = { 'images_dir': os.path.join(os.getcwd(), 'data', 'images'), 'videos_dir': os.path.join(os.getcwd(), 'data', 'videos'), # 'class_names': os.path.join(os.getcwd(), 'data', 'obj.names'), 'tiny_yolo_config': os.path.join(os.getcwd(), 'trained_m...
AmarCodes-22/nfs_object_detection
detection.py
detection.py
py
2,288
python
en
code
1
github-code
18
[ { "api_name": "os.path.join", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 8,...
74619528038
import httplib import unittest import urllib2 import mock from apimethods.system.proxy import AVProxy class TestAVProxy(unittest.TestCase): """ Tests for av_proxy module """ simple_proxy = "proxy = http://testproxy.com" proxy_with_port = "proxy = http://testproxy.com:1234" proxy_with_port...
jpalanco/alienvault-ossim
alienvault-api/alienvault-api-core/tests/test_lib/test_apimethods/test_system/test_av_proxy.py
test_av_proxy.py
py
4,518
python
en
code
114
github-code
18
[ { "api_name": "unittest.TestCase", "line_number": 9, "usage_type": "attribute" }, { "api_name": "mock.patch", "line_number": 21, "usage_type": "call" }, { "api_name": "apimethods.system.proxy.AVProxy", "line_number": 32, "usage_type": "call" }, { "api_name": "apim...
36663099721
import os import cubework import torch from cubework.distributed import ParallelManager as pm from cubework.distributed import all_reduce from cubework.utils import get_current_device, get_logger from tqdm import trange cubework.initialize_distributed() logger = get_logger() dim = int(os.environ["DIM"]) num_steps =...
kurisusnowdeng/Cubework
benchmark/common/bandwidth_test.py
bandwidth_test.py
py
1,167
python
en
code
3
github-code
18
[ { "api_name": "cubework.initialize_distributed", "line_number": 10, "usage_type": "call" }, { "api_name": "cubework.utils.get_logger", "line_number": 12, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 14, "usage_type": "attribute" }, { "api_nam...
23604909054
#!/usr/bin/env python2 # -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import import logging import pickle from angr import AngrTranslationError from farnsworth.models import Test, Exploit, RopCache import rex import tracer from simuvex import SimUnsatError from . import CRSTracerCacheMana...
mechaphish/worker
worker/workers/rex.py
rex.py
py
7,223
python
en
code
10
github-code
18
[ { "api_name": "worker.workers.workers.LOG.getChild", "line_number": 17, "usage_type": "call" }, { "api_name": "worker.workers.workers", "line_number": 17, "usage_type": "attribute" }, { "api_name": "worker.workers", "line_number": 17, "usage_type": "name" }, { "ap...
20464315224
from random import random as rand import cv2 import numpy as np import math import copy def draw_points(im, points, point_color=None): color = (rand() * 255, rand() * 255, rand() * 255) if point_color is None else point_color for i in range(points.shape[0]): cv2.circle(im, (int(points[i, 0]), int(poin...
Lakerszjb/CentereNet-C
src/lib/utils/image_draw.py
image_draw.py
py
15,649
python
en
code
0
github-code
18
[ { "api_name": "random.random", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.circle", "line_number": 11, "usage_type": "call" }, { "api_name": "random.random", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.rectangle", "line_numbe...
3807353815
from flask import jsonify class CustomException(Exception): def __init__(self, status_code, name = "Custom Error", description = 'Error'): super().__init__() self.status_code = status_code self.name = name self.description = description def get_response(self): respons...
marcosdflores/Integrador-22-Backend
api/models/exceptions.py
exceptions.py
py
1,509
python
en
code
0
github-code
18
[ { "api_name": "flask.jsonify", "line_number": 12, "usage_type": "call" } ]
21482923998
from selenium import webdriver from selenium.webdriver.common.keys import Keys from openpyxl import load_workbook #엑셀 읽기용 from openpyxl import Workbook #엑실 쓰기용 import time class List: url = '주소' title = '제목' contents = '내용' comments = '댓글' date = '날짜' viewCount = 0 def _...
wonheeejeong/myRepository
SK브로드밴드/고객자연어 크롤링/webCrawling.py
webCrawling.py
py
4,691
python
en
code
0
github-code
18
[ { "api_name": "openpyxl.load_workbook", "line_number": 22, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 26, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 26, "usage_type": "name" } ]
25609007401
# Authored by Tiantian Liu, Taichi Graphics. import math import taichi as ti ti.init(arch=ti.gpu) # global control paused = ti.field(ti.i32, ()) # gravitational constant 6.67408e-11, using 1 for simplicity G = 1 # number of planets N = 3000 # unit mass m = 1 M = 5000 # big planet # galaxy size galaxy_size = 0.5 #...
logic-three-body/Taichi_Course_Files
code/HW1/NoBody.py
NoBody.py
py
3,652
python
en
code
1
github-code
18
[ { "api_name": "taichi.init", "line_number": 6, "usage_type": "call" }, { "api_name": "taichi.gpu", "line_number": 6, "usage_type": "attribute" }, { "api_name": "taichi.field", "line_number": 9, "usage_type": "call" }, { "api_name": "taichi.i32", "line_number":...
21461632723
"""MambuLoan entity: a MambuEntity struct for credit Loans. .. autosummary:: :nosignatures: :toctree: _autosummary """ import copy import datetime import json from dateutil.tz import tzlocal from .entities import (MambuEntity, MambuEntityWritable, MambuEntityAttachable, ...
jstitch/MambuPy
MambuPy/api/mambuloan.py
mambuloan.py
py
7,957
python
en
code
3
github-code
18
[ { "api_name": "entities.MambuEntity", "line_number": 26, "usage_type": "name" }, { "api_name": "entities.MambuEntityWritable", "line_number": 27, "usage_type": "name" }, { "api_name": "entities.MambuEntityAttachable", "line_number": 28, "usage_type": "name" }, { "...
3272463451
import io import numpy as np from torch import nn import torch.utils.model_zoo as model_zoo import torch.onnx import torch.nn as nn import torch.nn.init as init from gen_data import gen_np_args, args_adaptor import onnx def box_xyxy_to_cxcywh(x): x0, y0, x1, y1 = x.unbind(-1) b = [(x0 + x1) / 2, (y0 + y1) / ...
DeepLink-org/DLOP-Bench
bench/samples/long_tail/box_xyxy_to_cxcywh/tvm/op.py
op.py
py
914
python
en
code
38
github-code
18
[ { "api_name": "torch.stack", "line_number": 16, "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": "gen_data.args_adaptor", ...
6878884492
from django.urls import path from . import views urlpatterns = [ path('', views.index, name='index'), path('tanner', views.tanner, name='tanner'), path('eric', views.eric, name='eric'), path('amanda', views.amanda, name='amanda'), path('sawyer', views.sawyer, name='sawyer'), path('<slug:cls>',...
steelcowboy/dontpass
dontpass/pass_app/urls.py
urls.py
py
434
python
en
code
9
github-code
18
[ { "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", ...
1836121639
import random import matplotlib.pyplot as plt import numpy as np import math class City(object): def __init__(self,x,y): self.x=x self.y=y class Country(object): def __init__(self,cities): self.cities=cities class Genetic: def __init__(self,individual): self.individual=indivi...
nimagarshasebi/TSP-Genetic
TSP_Genetic.py
TSP_Genetic.py
py
5,007
python
en
code
0
github-code
18
[ { "api_name": "numpy.random.permutation", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 17, "usage_type": "attribute" }, { "api_name": "numpy.sqrt", "line_number": 29, "usage_type": "call" }, { "api_name": "random.choices"...
16600210849
import json import os import re import urllib.request from bs4 import BeautifulSoup def save_to_dir(parsed_entry): folder = re.sub(r'\W+', '', parsed_entry['title']) directory = './out/' + folder os.makedirs(directory) with open(directory + '/body.html', 'w', encoding='utf8') as f: f.write(p...
mixamlv/livejournal-export
app.py
app.py
py
2,123
python
en
code
0
github-code
18
[ { "api_name": "re.sub", "line_number": 10, "usage_type": "call" }, { "api_name": "os.makedirs", "line_number": 12, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 18, "usage_type": "call" }, { "api_name": "urllib.request.request.urlopen", "li...
4585979519
from cProfile import label import queue from turtle import color, distance import matplotlib.pyplot as plt def getHeuristics(): heuristics = {} f = open("heuristics.txt") for i in f.readlines(): node_hetristics_val = i.split() heuristics[node_hetristics_val[0]] = int(node_hetristi...
phucnguyen20110276/Nhap-mon-AI---Tuan-3
main.py
main.py
py
5,431
python
en
code
0
github-code
18
[ { "api_name": "queue.PriorityQueue", "line_number": 65, "usage_type": "call" }, { "api_name": "queue.PriorityQueue", "line_number": 77, "usage_type": "call" }, { "api_name": "queue.Queue", "line_number": 87, "usage_type": "call" }, { "api_name": "queue.PriorityQue...
2023418443
import getopt import json import sys def get_default_options(options_file): """get default program options from json file""" try: with open(options_file, "r") as f: config = json.load(f) except ValueError as err: print(f"Can`t read config file: {options_file}, with error: {err}...
trofimowova/Client_Server_chat
lesson3/options.py
options.py
py
1,041
python
en
code
0
github-code
18
[ { "api_name": "json.load", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 13, "usage_type": "call" }, { "api_name": "getopt.getopt", "line_number": 20, "usage_type": "call" }, { "api_name": "getopt.GetoptError", "line_numbe...
30093654350
from django.conf import settings from maria.client import HTTPAPIClient class PayMongoClient(HTTPAPIClient): BASE_URL = settings.PAYMONGO_API_URL def __init__(self): super(PayMongoClient, self).__init__(base_url=self.BASE_URL) self.SECRET_KEY = settings.PAYMONGO_SECRET_KEY self.PUBL...
vbanasihan/sample_code
paymongo/client.py
client.py
py
2,592
python
en
code
0
github-code
18
[ { "api_name": "maria.client.HTTPAPIClient", "line_number": 6, "usage_type": "name" }, { "api_name": "django.conf.settings.PAYMONGO_API_URL", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 8, "usage_type": "name" }, ...
19792186545
from PyPDF2 import PdfReader import json def convert_pdf_to_word_list(pdf_path): word_list = [] # Abrir o arquivo PDF with open(pdf_path, 'rb') as file: pdf_reader = PdfReader(file) # Iterar pelas páginas do PDF for page in pdf_reader.pages: text = page.extract_text() ...
solitariewolf/alice-1.0
pdfconv.py
pdfconv.py
py
799
python
pt
code
0
github-code
18
[ { "api_name": "PyPDF2.PdfReader", "line_number": 9, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 30, "usage_type": "call" } ]
70291052201
from django.db import models class Results(models.Model): sport = models.CharField('Вид спорта',max_length=100) tournament = models.CharField('Турнир',max_length=100) team_1 = models.CharField('Команда 1',max_length=100) team_2 = models.CharField('Команда 2',max_length=100) score_1 = models.Integer...
RinatM73/MyFirstProject
results/models.py
models.py
py
717
python
ru
code
0
github-code
18
[ { "api_name": "django.db.models.Model", "line_number": 3, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 3, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 4, "usage_type": "call" }, { "api_name": "...
1170435586
import datetime import os from string import capwords import nonebot import aiohttp from bs4 import BeautifulSoup from nonebot.adapters.cqhttp.bot import Bot from nonebot.adapters.cqhttp.event import MessageEvent from nonebot.plugin import on_command from utils import HEADERS from utils.image import FONT, Draw, ImgDra...
syhanjin/chizi_bot
src/plugins/chinese_almanac/__init__.py
__init__.py
py
6,978
python
en
code
0
github-code
18
[ { "api_name": "os.path.join", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 1...
38899649285
import os import psycopg2 import random import sqlite3 import telebot import time types_dict = { 0: 'Отжимания', 10: 'Бег', 20: 'Пресс' } push_ups = { 1: 'Узким хватом', 2: 'Средним хватом', 3: 'Широким хватом', 4: 'Задние', } def get_key(my_dict, val): for key, value in my_dict.items...
toxic1488/statistic_bot
bot.py
bot.py
py
3,759
python
en
code
0
github-code
18
[ { "api_name": "telebot.types.ReplyKeyboardMarkup", "line_number": 28, "usage_type": "call" }, { "api_name": "telebot.types", "line_number": 28, "usage_type": "attribute" }, { "api_name": "telebot.types.ReplyKeyboardMarkup", "line_number": 29, "usage_type": "call" }, {...
26434955930
from flask import request from flasgger.utils import swag_from from flask import Blueprint from usersServiceApp.core.report_logic import validate_and_create_report, get_reports_info, \ validate_and_update_report_status, get_report_status_dataset from usersServiceApp.errors.usersException import usersException from...
TDP2-G1/users-service
usersServiceApp/api/report.py
report.py
py
4,314
python
en
code
0
github-code
18
[ { "api_name": "flask.Blueprint", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.request.get_json", "line_number": 56, "usage_type": "call" }, { "api_name": "flask.request", "line_number": 56, "usage_type": "name" }, { "api_name": "usersServiceApp....
10155452536
#User function Template for python3 from typing import List class Solution: def numberOfEnclaves(self, grid: List[List[int]]) -> int: if not grid: return 0 def dfs(row, col): stack = [(row, col)] count = 0 while stack: r...
Devamchangani/python-DSA
GFG/Problem of the day/Number Of Enclaves.py
Number Of Enclaves.py
py
1,910
python
en
code
1
github-code
18
[ { "api_name": "typing.List", "line_number": 6, "usage_type": "name" } ]
15805359064
"""Provides a UPNP discovery method that mimics Hue hubs.""" import threading import socket import logging import select from aiohttp import web from homeassistant import core from homeassistant.components.http import HomeAssistantView from .utility import * _LOGGER = logging.getLogger(__name__) class DescriptionX...
charleyzhu/HomeAssistant_Components
service/emulated_hue_charley/upnp.py
upnp.py
py
5,099
python
en
code
101
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "homeassistant.components.http.HomeAssistantView", "line_number": 16, "usage_type": "name" }, { "api_name": "aiohttp.web.Response", "line_number": 55, "usage_type": "call" }, {...
41661854265
from unittest import mock import pytest from pyda import data def test__PropertyUpdateResponse__init__fails(): with pytest.raises( AssertionError, match='"header" and "exception" ' 'are mutually exclusive arguments', ): data.PropertyUpdateResponse( query=mock.MagicMock(),...
jfpatrick/pyda
pyda/tests/data/test_PropertyUpdateResponse.py
test_PropertyUpdateResponse.py
py
1,677
python
en
code
0
github-code
18
[ { "api_name": "pytest.raises", "line_number": 9, "usage_type": "call" }, { "api_name": "pyda.data.PropertyUpdateResponse", "line_number": 13, "usage_type": "call" }, { "api_name": "pyda.data", "line_number": 13, "usage_type": "name" }, { "api_name": "unittest.mock...
31659788665
import os import time from math import inf from threading import Thread, Lock from pathlib import Path from codes import config, utility, congestion_manager class AckChecker: def __init__(self, ack_pipe, parent): self.there_is_ack = False self.ack_data = None self.parent = parent ...
faryabimm/2017-fall-Computer-Networks
hw2/codes/sender.py
sender.py
py
18,659
python
en
code
0
github-code
18
[ { "api_name": "threading.Thread", "line_number": 17, "usage_type": "call" }, { "api_name": "codes.utility.read_pipe_blocking", "line_number": 27, "usage_type": "call" }, { "api_name": "codes.utility", "line_number": 27, "usage_type": "name" }, { "api_name": "threa...
13710758114
from tempfile import TemporaryDirectory import numpy as np import pytest from karabo_bridge.server import ServerInThread, SimServerInThread @pytest.fixture(params=['1.0', '2.2']) def protocol_version(request): yield request.param @pytest.fixture(scope='function') def sim_server(protocol_version): with Tem...
European-XFEL/karabo-bridge-py
karabo_bridge/tests/conftest.py
conftest.py
py
2,236
python
en
code
8
github-code
18
[ { "api_name": "pytest.fixture", "line_number": 9, "usage_type": "call" }, { "api_name": "tempfile.TemporaryDirectory", "line_number": 16, "usage_type": "call" }, { "api_name": "karabo_bridge.server.SimServerInThread", "line_number": 18, "usage_type": "call" }, { "...