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
37754251360
import json import requests key = "AIzaSyA-" cx = "" def getimage(query): url = f"https://www.googleapis.com/customsearch/v1?q={query}_logo&num=1&cx={cx}&alt=json&key={key}&searchType=image" response = requests.get(url) text = response.text data = json.loads(text) image_link = data['items'][0]['l...
juntaosh/USHospitalandHotelShowCaseRepo
flask-frontend/getimage.py
getimage.py
py
1,719
python
en
code
0
github-code
7
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 21, "usage_type": "call" }, { "api_name": "json.loads", "line_number": ...
12746561390
from decimal import Decimal from typing import Optional from hummingbot.client.config.config_validators import ( validate_bool, validate_decimal, validate_exchange, validate_int, validate_market_trading_pair, ) from hummingbot.client.config.config_var import ConfigVar from hummingbot.client.setting...
supercrytoking/hummingbot
hummingbot/strategy/fixed_grid/fixed_grid_config_map.py
fixed_grid_config_map.py
py
7,026
python
en
code
4
github-code
7
[ { "api_name": "hummingbot.client.settings.AllConnectorSettings.get_example_pairs", "line_number": 17, "usage_type": "call" }, { "api_name": "hummingbot.client.settings.AllConnectorSettings", "line_number": 17, "usage_type": "name" }, { "api_name": "hummingbot.client.config.config...
40669014397
import numpy as np from collections import Counter import operator import os from sklearn.neighbors import KNeighborsClassifier as knn train_digits='./digits/trainingDigits' test_digits='./digits/testDigits' def classify0(inx,dataset,labels,k): dist=np.sum((inx-dataset)**2,axis=1)**0.5 k_labels=[labels[i] for...
whyang78/machineLearning-base
KNN/手写数字识别.py
手写数字识别.py
py
2,580
python
en
code
3
github-code
7
[ { "api_name": "numpy.sum", "line_number": 10, "usage_type": "call" }, { "api_name": "operator.itemgetter", "line_number": 16, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 40, "usage_type": "call" }, { "api_name": "os.path.join", "line_num...
24855383933
import time import datetime from ffpyplayer.player import MediaPlayer import numpy as np import torch import pandas as pd import cv2 video_urls = { "Pjaca": "https://ch-fra-n12.livespotting.com/vpu/ggazg0ll/g98s254r_720.m3u8", "Burkovo": "https://ch-fra-n9.livespotting.com/vpu/ggazg0ll/taelb29k_1080.m3u8", ...
hellvetica42/JelsaWebcam
TrafficLogger.py
TrafficLogger.py
py
2,853
python
en
code
0
github-code
7
[ { "api_name": "cv2.VideoCapture", "line_number": 29, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 33, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 37, "usage_type": "call" }, { "api_name": "time.sleep", "line_number"...
11597366636
import time from typing import List import numpy as np import torch from matplotlib import pyplot as plt from mpi4py import MPI from sklearn.datasets import load_boston from torch import nn from FedProx_sim import (CentralizedModel, agent_trainer, co_aggregation, data_splitter) from utils imp...
farzad1132/federated-emulation
FedProx_emu.py
FedProx_emu.py
py
13,378
python
en
code
0
github-code
7
[ { "api_name": "seaborn.set", "line_number": 15, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 36, "usage_type": "name" }, { "api_name": "torch.Tensor", "line_number": 36, "usage_type": "attribute" }, { "api_name": "mpi4py.MPI.Intercomm", ...
32171048849
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging import sys import traceback import os import importlib import yaml from . import defaults logger = logging.getLogger(__name__) project_path = os.path.dirname(os.path.dirname(__file__)) def update_recursively(d, ud, overwrite=True): f...
marcinguy/checkmate-ce
checkmate/settings/base.py
base.py
py
4,487
python
en
code
3
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "importlib.import_modul...
71340907744
from django.apps import apps import json class Metadata: """ """ def __init__(self, parent, metadata=None): self.parent = parent self.metadata = json.loads(metadata) if metadata else {} def get_metadata(self, metadata_type, names=None): metadata_model = apps.get_model("vb_dja...
kurtw555/vb_django
vb_django/app/metadata.py
metadata.py
py
1,916
python
en
code
1
github-code
7
[ { "api_name": "json.loads", "line_number": 11, "usage_type": "call" }, { "api_name": "django.apps.apps.get_model", "line_number": 14, "usage_type": "call" }, { "api_name": "django.apps.apps", "line_number": 14, "usage_type": "name" }, { "api_name": "django.apps.ap...
72423925342
# -*- coding: utf-8 -*- """ language.py Author: Gilson, K. """ from typing import Any from .mixin import JSONableMixin class Language(JSONableMixin): """Language: inherit from 'JSONableMixin'. Attributes: name (str): language name. irl_scale (str, optional): IRL Scale level of competence. D...
gilsonk/cv_builder
cv/language.py
language.py
py
2,808
python
en
code
1
github-code
7
[ { "api_name": "mixin.JSONableMixin", "line_number": 12, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 35, "usage_type": "name" } ]
2325721972
from django.shortcuts import render from polls.models import Poll, Alert from django.db.models import Q def index(request): if not request.user.is_authenticated: return render(request, "welcome.html") query = request.GET.get("q") polls = Poll.objects.all() alerts = Alert.objects.filter(is_act...
reo6/surveys
core/views.py
views.py
py
612
python
en
code
0
github-code
7
[ { "api_name": "django.shortcuts.render", "line_number": 8, "usage_type": "call" }, { "api_name": "polls.models", "line_number": 11, "usage_type": "name" }, { "api_name": "polls.models.Poll.objects.all", "line_number": 11, "usage_type": "call" }, { "api_name": "pol...
1067474465
import requests import json def test_insecure_plugin_design(base_url, api_key, plugin_endpoint): # Lista de payloads que podrían explotar un diseño inseguro en plugins malicious_payloads = [ "<script>alert('XSS')</script>", "'; DROP TABLE users;--", "admin' OR '1'='1", ...
grupooruss/Pentesting-LLM
Insecure Plugin Design.py
Insecure Plugin Design.py
py
1,483
python
en
code
2
github-code
7
[ { "api_name": "json.dumps", "line_number": 21, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 25, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 33, "usage_type": "call" } ]
71106300385
# !/usr/bin/env python # -*- coding: utf-8 -*- """ main algorithm support bot """ import logging from config import BotConfig from telegram import (ReplyKeyboardMarkup, Bot) from telegram.ext import (Updater, CommandHandler, MessageHandler, Filters, RegexHandler, ConversationHandler) import ...
adeljavad/hackathon
poshtiban.py
poshtiban.py
py
8,604
python
fa
code
0
github-code
7
[ { "api_name": "os.path.join", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path", "line_number": 33, "usage_type": "attribute" }, { "api_name": "django.conf.settings.configure", "line_number": 38, "usage_type": "call" }, { "api_name": "django.conf....
74428912544
from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.common.exceptions import TimeoutException from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.support import expected_conditions as EC from urllib.parse impo...
zifeiyu0531/Internet-worm-WeChat
mainpage.py
mainpage.py
py
5,445
python
en
code
1
github-code
7
[ { "api_name": "selenium.webdriver.chrome.options.Options", "line_number": 14, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 20, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 20, "usage_type": "name" }, {...
70001063584
import cv2 import numpy as np from editor.utils import memoize @memoize def getVideoCapture(filePath: str)->cv2.VideoCapture: return cv2.VideoCapture(filePath) @memoize def readCapture(cap:cv2.VideoCapture, frame)->np.ndarray: cursor = cap.get(cv2.CAP_PROP_POS_FRAMES) if frame!=cursor: cap.set(c...
zalavariandris/editor
read.py
read.py
py
1,040
python
en
code
1
github-code
7
[ { "api_name": "cv2.VideoCapture", "line_number": 8, "usage_type": "call" }, { "api_name": "editor.utils.memoize", "line_number": 6, "usage_type": "name" }, { "api_name": "cv2.VideoCapture", "line_number": 7, "usage_type": "attribute" }, { "api_name": "cv2.VideoCap...
18195993123
from discord.ext import commands class Owner(commands.Cog): "Just for Djarrah's eyes" def __init__(self, bot): self.bot = bot @commands.command(help="unloads a cog", hidden=True, aliases=["unload"]) @commands.is_owner() async def unload_cog(self, ctx, cogname: str): try: ...
Djarrah/LudiBot
cogs/owner.py
owner.py
py
1,590
python
en
code
0
github-code
7
[ { "api_name": "discord.ext.commands.Cog", "line_number": 4, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 4, "usage_type": "name" }, { "api_name": "discord.ext.commands.command", "line_number": 11, "usage_type": "call" }, { "api...
37955186378
import numpy as np import matplotlib matplotlib.use('agg') import matplotlib.pyplot as plt plt.style.use('ggplot') import seaborn from scipy.stats import kurtosis from lambertw.gaussianize import gaussianize def normalize(y): return (y - np.mean(y)) / np.std(y) n = 500000 y_laplace_1 = np.random.laplace(0, 4, ...
jmnel/neuralsort
src/analysis/flat_gaussianize.py
flat_gaussianize.py
py
1,495
python
en
code
2
github-code
7
[ { "api_name": "matplotlib.use", "line_number": 3, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style.use", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 5, "usage_type": "attribute" }, { "api_name": "...
21024374797
from design_baselines.data import StaticGraphTask from design_baselines.logger import Logger from design_baselines.utils import spearman from design_baselines.utils import soft_noise, cont_noise, disc_noise from design_baselines.safeweight_latent.trainers import Trainer from design_baselines.safeweight_latent.nets impo...
sihyun-yu/RoMA
design_baselines/safeweight_latent/__init__.py
__init__.py
py
7,737
python
en
code
12
github-code
7
[ { "api_name": "numpy.mean", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 22, "usage_type": "attribute" }, { "api_name": "numpy.std", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.float32", "line_num...
31028960778
import collections import os.path import subprocess import numpy as np from . import utils UCHAR = 'B' DOUBLE = '>d' INT = '>i' class BibarchReader: def __init__(self, filename): self.chapter_readers = { 'VERSION': self._ch_version, 'TITRE': self._ch_title, 'GLOBAL'...
pierreXVI/post_processing
postprocess_package/postprocess/bibarch.py
bibarch.py
py
18,242
python
en
code
0
github-code
7
[ { "api_name": "collections.defaultdict", "line_number": 40, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 41, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 42, "usage_type": "call" }, { "api_name"...
30267973285
""" There is some tool which sends request to the switch/router. When device take this request it sends the file (e.g. configuration) to the TFTP as a response. Server is needed to confirm and to prove vulnerability. """ import logging import socket import os import select import time from threading import Event, Lock...
FCG-LLC/aucote
utils/tftp.py
tftp.py
py
10,532
python
en
code
1
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "select.epoll", "line_number": 87, "usage_type": "call" }, { "api_name": "threading.Lock", "line_number": 91, "usage_type": "call" }, { "api_name": "threading.Event", "...
16449486324
import machine from time import sleep from rulib import * from config import c display = Display(c) info(str(display) + ' initialized') try: ip = Wifi(c).connect() except RuntimeError as e: display.error() error(e) sleep(60) machine.reset() info('connected to ' + c.wifi_ssid + ', got IP ' + ip) ...
tmsmr/RUC
unicorn/main.py
main.py
py
782
python
en
code
0
github-code
7
[ { "api_name": "config.c", "line_number": 8, "usage_type": "argument" }, { "api_name": "config.c", "line_number": 12, "usage_type": "argument" }, { "api_name": "time.sleep", "line_number": 16, "usage_type": "call" }, { "api_name": "machine.reset", "line_number"...
5202975616
from django.db.utils import IntegrityError from api.modules.users.models import User from django.contrib.auth import authenticate from rest_framework import status from rest_framework import serializers from rest_framework.views import APIView from rest_framework.response import Response from rest_framework.authtoken.m...
petrut22/FestivalWatch-backend
backend/api/modules/authentication/register/views.py
views.py
py
2,310
python
en
code
0
github-code
7
[ { "api_name": "rest_framework.views.APIView", "line_number": 11, "usage_type": "name" }, { "api_name": "rest_framework.response.Response", "line_number": 15, "usage_type": "call" }, { "api_name": "rest_framework.status.HTTP_200_OK", "line_number": 15, "usage_type": "attri...
8654097613
import json import os import requests from urllib.parse import urlparse from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass setUpModule, SlapOSInstanceTestCase = makeModuleSetUpAndTestCaseClass( os.path.abspath( os.path.join(os.path.dirname(__file__), '..', 'software.cfg'))) class HTML5...
SlapOS/slapos
software/html5as/test/test.py
test.py
py
5,396
python
en
code
37
github-code
7
[ { "api_name": "slapos.testing.testcase.makeModuleSetUpAndTestCaseClass", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { ...
36051346851
from socket import * import rsa client_socket = socket(AF_INET, SOCK_STREAM) client_socket.connect(("127.0.0.1", 8001)) # receive server's public key server_public_key_bytes = client_socket.recv(1024) server_public_key = rsa.PublicKey.load_pkcs1(server_public_key_bytes, "PEM") print(server_public_key) msg = input("...
gprok-esc-courses/advanced-python-spring-23
03-sockets/simple_encrypted/client.py
client.py
py
565
python
en
code
0
github-code
7
[ { "api_name": "rsa.PublicKey.load_pkcs1", "line_number": 10, "usage_type": "call" }, { "api_name": "rsa.PublicKey", "line_number": 10, "usage_type": "attribute" }, { "api_name": "rsa.encrypt", "line_number": 16, "usage_type": "call" } ]
33773963209
from keras.optimizers import Optimizer from keras.legacy import interfaces from keras import backend as K import tensorflow as tf class AAdam (Optimizer): #AADAM optimizer which implemets the aspect of acceleration in normal ADAM algorithm. def __init__(self, learning_rate=0.001, beta_1=0.9, beta_2=0.999, ...
kushagradarkdk/OML_Project
code/accelarated_aadam.py
accelarated_aadam.py
py
4,016
python
en
code
0
github-code
7
[ { "api_name": "keras.optimizers.Optimizer", "line_number": 6, "usage_type": "name" }, { "api_name": "keras.backend.name_scope", "line_number": 11, "usage_type": "call" }, { "api_name": "keras.backend", "line_number": 11, "usage_type": "name" }, { "api_name": "kera...
31894309714
#!/usr/bin/python3 import pywikibot from pywikibot import pagegenerators as pg import urllib.parse import requests import requests.exceptions bot = pywikibot.bot.WikidataBot() with open('pka-query.rq', 'r') as query_file: QUERY = query_file.read() wikidata_site = pywikibot.Site("wikidata", "wikidata") generator...
ysangkok/fix-wiki-links
wikidata_ft-dk_id.py
wikidata_ft-dk_id.py
py
2,324
python
en
code
0
github-code
7
[ { "api_name": "pywikibot.bot.WikidataBot", "line_number": 9, "usage_type": "call" }, { "api_name": "pywikibot.bot", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pywikibot.Site", "line_number": 14, "usage_type": "call" }, { "api_name": "pywikibot.p...
72200397343
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^new/$', views.new_user, name='new'), url(r'^edit/(?P<user_id>[0-9]+)/$', views.edit_user, name='edit'), url(r'^delete/(?P<user_id>[0-9]+)/$', views.delete_user, name='delete'), url(r...
grubberr/milo_django_task
users/urls.py
urls.py
py
371
python
en
code
0
github-code
7
[ { "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.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "django.co...
8291585139
from __future__ import print_function import json import boto3 print('Loading function') def lambda_handler(event, context): sensorValue=event['sensorValue'] if sensorValue=='unstable': message='ALERT! Someone is in your house!' # Parse the JSON message eventText = json.dumps(event) prin...
RETELLIGENCE-IWEN/IoT_TeamProject
aws/homeblackbox_lambdacode_backup1.py
homeblackbox_lambdacode_backup1.py
py
602
python
en
code
4
github-code
7
[ { "api_name": "json.dumps", "line_number": 14, "usage_type": "call" }, { "api_name": "boto3.client", "line_number": 19, "usage_type": "call" } ]
33212630294
import numpy as np import scipy.sparse as sp from ..simulation import BaseSimulation from ..survey import BaseSurvey from ..maps import IdentityMap from ..utils import validate_list_of_types, validate_type from ..props import HasModel import itertools import warnings class MetaSimulation(BaseSimulation): """Comb...
simpeg/simpeg
SimPEG/meta/simulation.py
simulation.py
py
16,768
python
en
code
438
github-code
7
[ { "api_name": "simulation.BaseSimulation", "line_number": 13, "usage_type": "name" }, { "api_name": "warnings.warn", "line_number": 92, "usage_type": "call" }, { "api_name": "survey.BaseSurvey", "line_number": 101, "usage_type": "call" }, { "api_name": "survey._vn...
32204539254
from django.shortcuts import render from difflib import SequenceMatcher # Create your views here. from rest_framework import viewsets from rest_framework.decorators import api_view from rest_framework.response import Response from finger.models import UserData from finger.serializer import UserDataSerializer import jso...
bityob/cookieless-monster-presentation
app/finger/views.py
views.py
py
1,712
python
en
code
3
github-code
7
[ { "api_name": "difflib.SequenceMatcher", "line_number": 15, "usage_type": "call" }, { "api_name": "rest_framework.viewsets.ModelViewSet", "line_number": 18, "usage_type": "attribute" }, { "api_name": "rest_framework.viewsets", "line_number": 18, "usage_type": "name" }, ...
20422554547
from random import shuffle from django.conf import settings try: # python >=3.8 from importlib.metadata import version as get_version except ModuleNotFoundError: # python < 3.8 from pkg_resources import get_distribution as get_version _VERSION = get_version('django-infinite-scroll') PAGINATION_STEPS = int(geta...
gsteixeira/django-infinite-scroll
infscroll/utils.py
utils.py
py
2,955
python
en
code
1
github-code
7
[ { "api_name": "pkg_resources.get_distribution", "line_number": 8, "usage_type": "call" }, { "api_name": "django.conf.settings", "line_number": 9, "usage_type": "argument" }, { "api_name": "django.conf.settings", "line_number": 10, "usage_type": "argument" }, { "ap...
25723533110
import pandas as pd from sklearn.preprocessing import LabelEncoder,StandardScaler from sklearn.model_selection import KFold,cross_val_score,train_test_split from sklearn.utils import shuffle import xgboost as xgb from sklearn.metrics import accuracy_score kfold=KFold(n_splits=5) data = pd.read_csv("otu.csv", d...
Kuroin/executable-finger
xgBoost.py
xgBoost.py
py
1,708
python
en
code
0
github-code
7
[ { "api_name": "sklearn.model_selection.KFold", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.LabelEncoder", "line_number": 14, "usage_type": "call" }, { "ap...
13591520131
import pygame, sys, random from pygame.locals import * # VARIÁVEIS screen_width = 14 * 77 screen_height = 8 * 77 # Define a taxa de atualização clock = pygame.time.Clock() camera_y = 0 #mapa mapa = [] tile={} # Usando dicionário # Jogador player_size = 50 player_x = screen_width // 2 - player_siz...
JudyFaria/Projeto_PratProg
Jogo_Pratica/main.py
main.py
py
7,139
python
pt
code
0
github-code
7
[ { "api_name": "pygame.time.Clock", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.time", "line_number": 9, "usage_type": "attribute" }, { "api_name": "random.randint", "line_number": 90, "usage_type": "call" }, { "api_name": "pygame.draw.rect", ...
14956326502
# Fun in the Sun Challenge from cmath import acos, pi from numpy import dot, cross from numpy.linalg import norm from skyfield.api import load, wgs84 ts = load.timescale() import os, sys from time import sleep from timeout import timeout, TimeoutError time = int(os.getenv("TIMEOUT",90)) # Challenge Intro def render_i...
cromulencellc/hackasat-qualifier-2022
sunfun/challenge/challenge.py
challenge.py
py
3,265
python
en
code
15
github-code
7
[ { "api_name": "skyfield.api.load.timescale", "line_number": 6, "usage_type": "call" }, { "api_name": "skyfield.api.load", "line_number": 6, "usage_type": "name" }, { "api_name": "os.getenv", "line_number": 11, "usage_type": "call" }, { "api_name": "time.sleep", ...
24561679067
"""Test MosaicML API wrapper.""" import re import pytest from langchain_community.llms.mosaicml import PROMPT_FOR_GENERATION_FORMAT, MosaicML def test_mosaicml_llm_call() -> None: """Test valid call to MosaicML.""" llm = MosaicML(model_kwargs={}) output = llm("Say foo:") assert isinstance(output, st...
langchain-ai/langchain
libs/community/tests/integration_tests/llms/test_mosaicml.py
test_mosaicml.py
py
2,739
python
en
code
68,990
github-code
7
[ { "api_name": "langchain_community.llms.mosaicml.MosaicML", "line_number": 11, "usage_type": "call" }, { "api_name": "langchain_community.llms.mosaicml.MosaicML", "line_number": 19, "usage_type": "call" }, { "api_name": "langchain_community.llms.mosaicml.MosaicML", "line_numb...
15781449131
import seaborn as sns import numpy as np from matplotlib import rc import matplotlib as mpl import matplotlib.pyplot as plt # rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']}) # for Palatino and other serif fonts use: sns.set_context(rc={'lines.markeredgewidth': 0.1}) sns.set_style("white", {'axes.grid'...
srydblom/srydblom-licthesis
scripts/style.py
style.py
py
5,052
python
en
code
1
github-code
7
[ { "api_name": "seaborn.set_context", "line_number": 10, "usage_type": "call" }, { "api_name": "seaborn.set_style", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.rc", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.rc", ...
14570865
''' This document is hosted on github and is the source for a Streamlit App. The following code is broken into sections based on the user experience of the app. The sections are as follows: - Data Setup - Section 1: Intro & Welcome Text - Section 2: Dropdown pick lists and data filtering - Section 3: Map Setup - Secti...
ninaksweeney/flight_emissions
flight_emissions_app.py
flight_emissions_app.py
py
16,199
python
en
code
2
github-code
7
[ { "api_name": "streamlit.set_page_config", "line_number": 25, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 29, "usage_type": "call" }, { "api_name": "streamlit.secrets", "line_number": 35, "usage_type": "attribute" }, { "api_name": "...
24855381243
import time import cv2 SCREEN_REZ = (2560, 1440) if __name__ == '__main__': url = "https://ch-fra-n9.livespotting.com/vpu/ggazg0ll/taelb29k_1080.m3u8" cap = cv2.VideoCapture(url) cap.set(cv2.CAP_PROP_BUFFERSIZE, 100) lastImage = cap.read()[1] lastRead = time.perf_counter() while True: ...
hellvetica42/JelsaWebcam
SingleCam.py
SingleCam.py
py
624
python
en
code
0
github-code
7
[ { "api_name": "cv2.VideoCapture", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.CAP_PROP_BUFFERSIZE", "line_number": 8, "usage_type": "attribute" }, { "api_name": "time.perf_counter", "line_number": 11, "usage_type": "call" }, { "api_name": "time.pe...
25801306298
import csv import tweepy from textblob import TextBlob import json import pandas as pd import re with open('twitter_credentials.json') as cred_data: info = json.load(cred_data) consumer_key = info['CONSUMER_KEY'] consumer_secret = info['CONSUMER_SECRET'] access_key = info['ACCESS_KEY'] access_secre...
bha6kar/DataAnalyticsProject
twitter_scrubbing/twitter_analysis.py
twitter_analysis.py
py
1,698
python
en
code
0
github-code
7
[ { "api_name": "json.load", "line_number": 9, "usage_type": "call" }, { "api_name": "tweepy.OAuthHandler", "line_number": 15, "usage_type": "call" }, { "api_name": "tweepy.API", "line_number": 19, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 3...
8546721031
from collections import deque def solution(n, computers): answer = 0 visit = [0 for i in range(n)] def bfs(a): queue = deque() queue.append(a) visit[a] = 1 while queue: x = queue.popleft() for i in range(n): ...
kimkihoon0515/CodingTest
프로그래머스/lv3/43162. 네트워크/네트워크.py
네트워크.py
py
553
python
en
code
3
github-code
7
[ { "api_name": "collections.deque", "line_number": 9, "usage_type": "call" } ]
24173619573
import sys from PyQt5.QtWidgets import QApplication, QMainWindow, QDialog, QPushButton from PyQt5.QtCore import QObject, Qt, pyqtSignal # cls stand for class here. class MySignal(QObject): """ 信号类 """ instance = None signal = pyqtSignal() @classmethod def my_signal(cls): if cls.ins...
judeqshan/pythontest
pyq_test/mul_share_sig.py
mul_share_sig.py
py
1,858
python
en
code
0
github-code
7
[ { "api_name": "PyQt5.QtCore.QObject", "line_number": 6, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 11, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 25, "usage_type": "name" }, { "api_name"...
15179211838
from secrets import Secrets import json import requests import jinja2 import re class WPT: secrets = None wp_key = None wp_site = None wp_oauth_header = None wp_template_title = None wp_template_body = None template_vars = None post_response = None oauth_url = "https://public-a...
KabitTarah/wordpress_templates
wpt.py
wpt.py
py
6,246
python
en
code
0
github-code
7
[ { "api_name": "secrets.Secrets", "line_number": 21, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 31, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 32, "usage_type": "call" }, { "api_name": "requests.get", "line_num...
37448196550
import threading import time import shutil from itertools import groupby from multiprocessing import Pool,cpu_count import numpy as np import face_recognition import subprocess from flask import Flask, request, redirect, jsonify from PIL import Image from flask_cors import CORS, cross_origin import math import os impor...
xordex28/facialProyect
facial.py
facial.py
py
13,514
python
en
code
0
github-code
7
[ { "api_name": "os.path.dirname", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 19, "usage_type": "call" }, { "api_name": "flask.Flask", "line_...
41689358203
import cv2 from PIL import Image from detectron2.utils.visualizer import Visualizer from detectron2.data import MetadataCatalog from detectron2.config import get_cfg from detectron2.utils.visualizer import ColorMode from detectron2.engine import DefaultPredictor from d2detector.config import add_d2test_config from dete...
vnk8071/detectron2-object-detection
inference.py
inference.py
py
7,167
python
en
code
2
github-code
7
[ { "api_name": "argparse.ArgumentParser", "line_number": 22, "usage_type": "call" }, { "api_name": "detectron2.config.get_cfg", "line_number": 47, "usage_type": "call" }, { "api_name": "d2detector.config.add_d2test_config", "line_number": 48, "usage_type": "call" }, { ...
27769259189
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals from googlecloudsdk.api_lib.privateca import base from googlecloudsdk.api_lib.privateca import constants as api_constants from googlecloudsdk.api_lib.privateca import locations from googlecloudsdk.calliope im...
twistedpair/google-cloud-sdk
google-cloud-sdk/lib/googlecloudsdk/command_lib/privateca/resource_args.py
resource_args.py
py
16,245
python
en
code
55
github-code
7
[ { "api_name": "googlecloudsdk.calliope.concepts.deps.PropertyFallthrough", "line_number": 21, "usage_type": "call" }, { "api_name": "googlecloudsdk.calliope.concepts.deps", "line_number": 21, "usage_type": "name" }, { "api_name": "googlecloudsdk.core.properties.VALUES", "line...
39022441040
import timm import torch import torch.nn as nn from src import register from src.typing import TensorDict __all__ = ['PoseNet'] @register('pose') class PoseNet(nn.Module): """Relative pose prediction network. From SfM-Learner (https://arxiv.org/abs/1704.07813) This network predicts the relative pose be...
jspenmar/monodepth_benchmark
src/networks/pose.py
pose.py
py
2,733
python
en
code
83
github-code
7
[ { "api_name": "torch.nn.Module", "line_number": 12, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 12, "usage_type": "name" }, { "api_name": "timm.create_model", "line_number": 36, "usage_type": "call" }, { "api_name": "torch.nn.Sequential",...
23148326023
#!/usr/bin/env python # Converts an image (png, jpeg, ....) to FabGL Bitmap structure # # usage: # python img2bitmap.py filename [-t x y] [-s width height] [-d] [-f0 | -f1 | -f2] [-o0 | -o1] # # -t = pixel where to take transparent color # -s = resize to specified values # -d = enable dithering # -f0 = format is...
fdivitto/FabGL
tools/img2bitmap/img2bitmap.py
img2bitmap.py
py
4,495
python
en
code
1,255
github-code
7
[ { "api_name": "sys.argv", "line_number": 44, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 58, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 61, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 62...
18299515088
import ipaddress import json from .CloudRanges import CloudRanges # https://www.cloudflare.com/ips/ class CloudFlare(CloudRanges): def download(self, fp): self._cache = {} for v in ('v4', 'v6'): url = 'https://www.cloudflare.com/ips-{}'.format(v) self._logger.info('Download...
dlenski/what-cloud
what_cloud/cloudflare.py
cloudflare.py
py
1,184
python
en
code
0
github-code
7
[ { "api_name": "CloudRanges.CloudRanges", "line_number": 7, "usage_type": "name" }, { "api_name": "json.dump", "line_number": 14, "usage_type": "call" }, { "api_name": "json.load", "line_number": 27, "usage_type": "call" }, { "api_name": "ipaddress.IPv4Network", ...
12654073961
import enum from src.common.SimulationClock import * from src.common.UniqueID import UniqueID class TaskStatus(enum.Enum): SUBMITTED = 1 BEING_PROCESSED = 2 SOLVED = 3 PROCESSING_FAILED = 4 TASK_TIMED_OUT = 5 FAILED_TO_FIND_SOLVER = 6 class Task: def __init__(self, vehicle=None, solver=...
AdamPetik/bc-autonomous-cars
NFTAutonomousVehicles/taskProcessing/Task.py
Task.py
py
1,764
python
en
code
1
github-code
7
[ { "api_name": "enum.Enum", "line_number": 6, "usage_type": "attribute" }, { "api_name": "src.common.UniqueID.UniqueID", "line_number": 23, "usage_type": "call" } ]
40619219803
from functions import * from create_raw_data import * from performance_metrics import * import sklearn.preprocessing import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from sklearn import svm from sklearn.model_selection import GridSearchCV,PredefinedSplit #from sklearn.grid_se...
alexadal/FYS-STK-4155-Project3
test_svr.py
test_svr.py
py
2,590
python
en
code
0
github-code
7
[ { "api_name": "os.environ", "line_number": 15, "usage_type": "attribute" }, { "api_name": "numpy.random.seed", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.concatenate", "line_number": 44, "usage_type": "call" }, { "api_name": "numpy.concatenate...
17581459933
import addons from arambadge import badge from eeprom import EEPROM from eepromvfs import mount_eeprom import os import storage import struct import supervisor # Floppy Add-on data binary format: # # Offset Size Description # ------ ---- ----------- # 0 byte Flags. Reserved and must be 0 # 1 byt...
aramcon-badge/aramcon-firmware
drivers/floppy.py
floppy.py
py
3,209
python
en
code
8
github-code
7
[ { "api_name": "struct.pack", "line_number": 24, "usage_type": "call" }, { "api_name": "struct.pack", "line_number": 25, "usage_type": "call" }, { "api_name": "os.stat", "line_number": 32, "usage_type": "call" }, { "api_name": "os.stat", "line_number": 38, ...
11421540016
import uuid import html2text from pyspark.sql.types import * from azure.ai.textanalytics import TextAnalyticsClient from azure.core.credentials import AzureKeyCredential """ The following section of code will have to be removed when integrated as a notebook in Synapse analytics, because the parameters will be passe...
microsoftgraph/dataconnect-solutions
solutions/conversation-lineage/conversations_text_analytics/src/interactions_sentiment_and_entities_retriever.py
interactions_sentiment_and_entities_retriever.py
py
13,707
python
en
code
38
github-code
7
[ { "api_name": "azure.ai.textanalytics.TextAnalyticsClient", "line_number": 90, "usage_type": "call" }, { "api_name": "azure.core.credentials.AzureKeyCredential", "line_number": 90, "usage_type": "call" }, { "api_name": "html2text.HTML2Text", "line_number": 91, "usage_type...
7510180641
import asyncio import Intcode import Tiles if __name__ == '__main__': with open('input', 'r') as f: ASCII = [int(x) for x in f.read().strip().split(',')] comp = Intcode.Intcode() comp.memory = ASCII comp.increase_memory(10) loop = asyncio.get_event_loop() loop.run_until_complete(comp.ru...
simonsandell/advent-of-code-2019
17/1.py
1.py
py
485
python
en
code
0
github-code
7
[ { "api_name": "Intcode.Intcode", "line_number": 8, "usage_type": "call" }, { "api_name": "asyncio.get_event_loop", "line_number": 11, "usage_type": "call" }, { "api_name": "Tiles.Tiles", "line_number": 14, "usage_type": "call" } ]
11245447297
#!/usr/bin/env python # Andrew Lytle # March 2015 import os import re import subprocess import sys from itertools import product from multiprocessing import Pool from time import time import numpy as np REGEX = re.compile('correlator_key:') # Pattern signaling end of header. #T = 48 def sort_argv(argv): "Sort...
atlytle/build-from-tar
extract_milc_corrs.py
extract_milc_corrs.py
py
3,502
python
en
code
2
github-code
7
[ { "api_name": "re.compile", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.basename", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_numb...
19375046878
############################################################################# # zlib License # # (C) 2023 Cristóvão Beirão da Cruz e Silva <cbeiraod@cern.ch> # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the ...
cbeiraod/ETROC-Analysis-Scripts
reprocess_etroc1_charge_injection_data_dir.py
reprocess_etroc1_charge_injection_data_dir.py
py
7,020
python
en
code
0
github-code
7
[ { "api_name": "lip_pps_run_manager.RunManager", "line_number": 35, "usage_type": "attribute" }, { "api_name": "logging.Logger", "line_number": 36, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 37, "usage_type": "name" }, { "api_name": "...
403033769
# *************** HOMEWORK 3 *************** # GOOD LUCK! # ************************ QUESTION 1 ************************** import collections def sudoku_is_legal(board): """ defaultdict means that if a key is not found in the dictionary, then instead of a KeyError being thrown, a new entry is created. ...
OrSimhon/Python-course-cs-BGU
HW_3_Strings_Dictionaries/Q1.py
Q1.py
py
3,395
python
en
code
0
github-code
7
[ { "api_name": "collections.defaultdict", "line_number": 20, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 21, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 22, "usage_type": "call" } ]
26315798477
#!/usr/bin/python3 import random, argparse, string, sys class shuf: # Initialize with infile, echo, and input_range # Constructor should create a string with words to be shuffled def __init__(self, infile, echo, input_range): self.lines=[] if infile and infile != "-": for line ...
EvanYZhao/CS35L
assignment2/shuf.py
shuf.py
py
3,157
python
en
code
1
github-code
7
[ { "api_name": "random.choice", "line_number": 46, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 50, "usage_type": "call" }, { "api_name": "random.sample", "line_number": 53, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", ...
37259385447
# -*- coding:utf-8 -*- import jieba # 导入jieba模块 import pymysql import re jieba.load_userdict("my_words_dict.txt") # 加载自定义词典 from_connect = pymysql.connect(host='localhost', port=3306, user='root', password='echo', db='tbs_data', charset='utf8') from_cursor = from_connect.cursor() to_connect = pymysql.connect(host=...
My-captain/Foodrink
去停用词/cut_stop_words.py
cut_stop_words.py
py
3,230
python
en
code
0
github-code
7
[ { "api_name": "jieba.load_userdict", "line_number": 6, "usage_type": "call" }, { "api_name": "pymysql.connect", "line_number": 8, "usage_type": "call" }, { "api_name": "pymysql.connect", "line_number": 11, "usage_type": "call" }, { "api_name": "jieba.enable_parall...
33978279464
from flask import Flask, jsonify, request import sqlite3 app = Flask(__name__) @app.route('/', methods=['GET']) def index(): db = sqlite3.connect('posts.db') cursor = db.cursor() # cursor.execute('CREATE TABLE products(id: INTEGER PRIMARY KEY, item: TEXT NOT NULL, price: TEXT NOT NULL)') cursor.e...
Qay-Tekkie/Flask-Api-project
api-sql/sqlquery.py
sqlquery.py
py
1,497
python
en
code
0
github-code
7
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 17, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_n...
4514841341
from typing import List import pymongo from datetime import datetime from bson import ObjectId from pymongo.collection import Collection from app.controllers import db_controllers from app.helpers.excepitons import NotFoundError from app.models.activity_models import ActivityInfo, ActivityUserDB from app.settings impo...
nuruddinsayeed/sports_monitor
app/Activity/activity_db.py
activity_db.py
py
3,475
python
en
code
0
github-code
7
[ { "api_name": "app.settings.mongo_conf.get_nosql_client", "line_number": 16, "usage_type": "call" }, { "api_name": "app.settings.mongo_conf", "line_number": 16, "usage_type": "name" }, { "api_name": "app.settings.configs.SETTINGS.spm_mongo_db_name", "line_number": 17, "us...
72046342622
# -*- coding: utf-8 -*- import datetime import json import logging import time import requests from requests import ReadTimeout from odoo import api, fields, models from odoo.exceptions import UserError _logger = logging.getLogger(__name__) class DinDinCalendarEvent(models.Model): _inherit = 'calendar.event' ...
LuoChao-aleo/odoo-DingDing
dindin_calendar/models/calendar.py
calendar.py
py
3,920
python
en
code
7
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "odoo.models.Model", "line_number": 14, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 14, "usage_type": "name" }, { "api_name": "odoo.fields.Char...
30772138463
import pandas as pd import xgboost as xgb from sklearn.preprocessing import LabelEncoder from sklearn.model_selection import train_test_split FEATURE = ['MinTemp', 'MaxTemp', 'Rainfall', 'WindGustDir', 'WindGustSpeed', 'WindDir9am', 'WindDir3pm', 'WindSpeed9am', 'WindSpeed3pm', 'Humidity9am',...
trannam710/Rain-in-Australia
Phát triển mô hình/DEMO/model.py
model.py
py
3,138
python
en
code
0
github-code
7
[ { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 22, "usage_type": "call" }, { "api_name": "xgboost.XGBClassifier", "line_number": 39, "usage_type": "call" }, { "ap...
24995689047
from sklearn.preprocessing import PolynomialFeatures from sklearn.pipeline import make_pipeline from sklearn.linear_model import LinearRegression import matplotlib.pyplot as plt import numpy as np # xSRP = [873.15, 973.15, 1073.15] # ySRP = [7.89, 17.10, 21.70] x = [873.15, 973.15, 1073.15] y = [7.89, 17.10, 21.70] ...
jbchemE/RxnEng
test.py
test.py
py
920
python
en
code
0
github-code
7
[ { "api_name": "sklearn.preprocessing.PolynomialFeatures", "line_number": 19, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LinearRegression", "line_number": 24, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 28, "usage_type"...
8189082744
from pytube import YouTube def Download(link): youtubeObject = YouTube(link) youtubeObject = youtubeObject.streams.get_highest_resolution() try: youtubeObject.download() except: print("An error has occurred") print("Download is completed successfully and thank you for downl...
Ankitrj3/PYTHON
youtubevideodownloader.py
youtubevideodownloader.py
py
415
python
en
code
0
github-code
7
[ { "api_name": "pytube.YouTube", "line_number": 4, "usage_type": "call" } ]
31680548779
import numpy as np from ipywidgets import interact, interactive, fixed from IPython.display import display, Math from matplotlib.pyplot import subplots, show from .lib.lens import Lens import numpy as np def ir_range_sensor_demo1_plot(r=50, d=20, f=10, rays=False): X = 50 Hl = 15 Ht = 20 x0 = X ...
mph-/dsp-notebooks
intro/demos/ir_range_sensor_demo1.py
ir_range_sensor_demo1.py
py
1,601
python
en
code
3
github-code
7
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 34, "usage_type": "call" }, { "api_name": "lib.lens.Lens", "line_number": 39, "usage_type": "call" }, { "api_name": "lib.lens.Lens", "line_number": 40, "usage_type": "call" }, { "api_name": "IPython.displa...
29319683668
import logging import os WORKING_DIRECTORY = os.path.dirname(os.path.realpath(__file__)) log_filename = "sreality.log" log_filename = os.path.join(WORKING_DIRECTORY, log_filename) logging.basicConfig( filename=log_filename, level=logging.INFO, format="%(asctime)s %(levelname)s %(message)s", )...
grdddj/My-codebase
Python/Real estate checker/logger.py
logger.py
py
501
python
en
code
0
github-code
7
[ { "api_name": "os.path.dirname", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path.join", "line_n...
37343515255
from __future__ import print_function import pickle import numpy as np from scipy.optimize import curve_fit # Reference each pick to a station index def getPickStaIdxs(pickSet,staNames): pickStas,pickIdx=np.unique(pickSet[:,0],return_inverse=True) pickStaIdxs=np.ones(len(pickIdx),dtype=int)*-1 for pos in ...
AndrewReynen/Lazylyst
lazylyst/Plugins/GlobalLocate.py
GlobalLocate.py
py
8,158
python
en
code
16
github-code
7
[ { "api_name": "numpy.unique", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": ...
43264261684
from spsdk.image.images import BootImgRT def test_parse_xmcd(data_dir): with open(f"{data_dir}/evkmimxrt1170_xmcd.bin", "rb") as f: data = f.read() image = BootImgRT.parse(data) assert image.xmcd assert "XMCD" in image.info() def test_parse_no_xmcd(data_dir): with open(f"{data_dir}/iled_...
kaposh/spsdk
tests/image/segments/test_xmcd.py
test_xmcd.py
py
479
python
en
code
null
github-code
7
[ { "api_name": "spsdk.image.images.BootImgRT.parse", "line_number": 7, "usage_type": "call" }, { "api_name": "spsdk.image.images.BootImgRT", "line_number": 7, "usage_type": "name" }, { "api_name": "spsdk.image.images.BootImgRT.parse", "line_number": 15, "usage_type": "call...
41745272489
#coding=utf-8 import numpy as np from basic_classify_by_app import * from sklearn.feature_extraction.text import CountVectorizer import lda import matplotlib.pyplot as plt import seaborn as sns def get_lda_input(chapters): corpus = [" ".join(word_list) for word_list in chapters] vectorizer = CountVectorizer() ...
little-Icey/ThemeClassification
code/lda_topic_classify_by_app.py
lda_topic_classify_by_app.py
py
1,360
python
en
code
0
github-code
7
[ { "api_name": "sklearn.feature_extraction.text.CountVectorizer", "line_number": 11, "usage_type": "call" }, { "api_name": "lda.LDA", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 26, "usage_type": "call" }, { "api_name": "n...
31771503001
import json import requests import argparse parser = argparse.ArgumentParser(description='Disables or Enables specific pool under CloudFlare Load Balancer') parser.add_argument('--pool', required=True, help='name of the pool to be updated') parser.add_argument('--lbname', required=True, help='name of the load balancer...
jbbriel/cloudflare-py
src/cloudflare.py
cloudflare.py
py
2,879
python
en
code
4
github-code
7
[ { "api_name": "argparse.ArgumentParser", "line_number": 5, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 22, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 23, "usage_type": "call" }, { "api_name": "requests.put", "li...
19493132500
#!/usr/bin/env python2.7 # -*- coding: UTF-8 -*- from aip import AipImageSearch from aip import AipOcr import requests import json import sys import base64 # from urllib.parse import quote requests.packages.urllib3.disable_warnings() IMG_APP_ID = '21552210' IMG_API_KEY = 'dHqG78qSi8HRdEQMwGipXlLS' IMG_SECRET_KEY = 'X9...
1993gc/wx-helper
baidu.py
baidu.py
py
1,405
python
en
code
0
github-code
7
[ { "api_name": "requests.packages.urllib3.disable_warnings", "line_number": 10, "usage_type": "call" }, { "api_name": "requests.packages", "line_number": 10, "usage_type": "attribute" }, { "api_name": "aip.AipImageSearch", "line_number": 20, "usage_type": "call" }, { ...
17314765173
import os from apscheduler.jobstores.sqlalchemy import SQLAlchemyJobStore basedir = os.path.abspath(os.path.dirname(__file__)) HEROKU_URI = 'postgres://iwcxypoullcotd:344b3734ff9c793c50bceeb5314efa108e80e4675c7081f53dab5f6c04907c5a@ec2-184-73-189-190.compute-1.amazonaws.com:5432/dfq6o8fr8mc2bb' HEROKU_DEV_URI = 'post...
Guardia-Dev/Cucumis
config.py
config.py
py
1,744
python
en
code
1
github-code
7
[ { "api_name": "os.path.abspath", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 4, "usage_type": "call" }, { "api_name": "os.environ.get", "line_...
5393172067
import logging from functools import wraps from typing import Any, Callable, List, Optional, Sequence from ..data.data_utils import TensorWrapper logger = logging.getLogger(__name__) def set_hook(f: Callable[[Any], Any]) -> Callable[[Any], Any]: """Sets the status of the attribution model associated to the func...
inseq-team/inseq
inseq/attr/attribution_decorators.py
attribution_decorators.py
py
2,588
python
en
code
223
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "typing.Callable", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 10, "usage_type": "name" }, { "api_name": "functools.wraps", "li...
11598251646
import numpy as np import os import yaml import networkx as nx from shutil import copyfile # url = 'https://github.com/numpy/numpy/blob/master/numpy/random/mtrand.pyx#L778' # a threshold for floating point arithmetic error handling accuracy = np.sqrt(np.finfo(np.float64).eps) def normalize_scheduling_probabilities(i...
farzad1132/GSC
common/common_functionalities.py
common_functionalities.py
py
4,492
python
en
code
0
github-code
7
[ { "api_name": "numpy.sqrt", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.finfo", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.float64", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number...
43041365744
from tqdm import tqdm from typing import Tuple, List, Optional, Union, Callable, ClassVar, Dict import pandas as pd import json from collections import defaultdict from dataclasses import dataclass, field from pprint import pprint from snscrape.modules import twitter from datetime import date from copy import deepcopy ...
bobgroks/twitterisbitter
fun.py
fun.py
py
9,981
python
en
code
0
github-code
7
[ { "api_name": "snscrape.modules.twitter.Tweet", "line_number": 17, "usage_type": "attribute" }, { "api_name": "snscrape.modules.twitter", "line_number": 17, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 19, "usage_type": "name" }, { "api_name...
34660823927
import numpy as np import itertools from jiwer import wer from scipy.io import wavfile from IPython import display import matplotlib.pyplot as plt import numpy as np def chr_mapping(): character_map = {' ': 0, 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8, 'i': 9, 'j': 10, 'k': 11,...
parkerhuynh/DeepSpeech2
utils.py
utils.py
py
3,598
python
en
code
0
github-code
7
[ { "api_name": "numpy.argmax", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 22, "usage_type": "call" }, { "api_name": "itertools.groupby", "line_number": 22, "usage_type": "call" }, { "api_name": "jiwer.wer", "line_numb...
6743339557
import re import urllib.request import sys import time import datetime #function to import strings into a log def redirect_to_file(text): original = sys.stdout sys.stdout = open('log.txt','a') print(text) sys.stdout = original #function to stamp time for logging def timestamper(): ts = time.time() timesta...
13oldb/pythonCrawlers
mycoins/mycoins.py
mycoins.py
py
5,518
python
en
code
0
github-code
7
[ { "api_name": "sys.stdout", "line_number": 9, "usage_type": "attribute" }, { "api_name": "sys.stdout", "line_number": 10, "usage_type": "attribute" }, { "api_name": "sys.stdout", "line_number": 12, "usage_type": "attribute" }, { "api_name": "time.time", "line_...
36078919298
# -*- coding: utf-8 -*- """ Created on Mon Nov 16 23:59:36 2020 @author: Mayur Vishwasrao """ import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score,confusion_m...
MayurV6/Fake-News
fakenews.py
fakenews.py
py
4,291
python
en
code
0
github-code
7
[ { "api_name": "pandas.read_csv", "line_number": 24, "usage_type": "call" }, { "api_name": "nltk.download", "line_number": 43, "usage_type": "call" }, { "api_name": "nltk.stem.porter.PorterStemmer", "line_number": 46, "usage_type": "call" }, { "api_name": "re.sub",...
72898646944
import cv2 as cv import os import imutils modelo = 'FotosElon' ruta1 = '/Users/davidlopez/PycharmProjects/Curso_deteccion_objetos/reconocimiento_contornos/reconocimientofacial1' rutacompleta = ruta1 + '/' + modelo if not os.path.exists(rutacompleta): os.makedirs(rutacompleta) ruidos = cv.CascadeClassifier('/User...
ujaque/reconcimiento_caras
capaentrada.py
capaentrada.py
py
1,415
python
es
code
0
github-code
7
[ { "api_name": "os.path.exists", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.CascadeClassifier", "li...
36690544598
# -*- coding: utf-8 -*- import random from datetime import datetime from django.core.management.base import BaseCommand from transport_routes.models import ( Route, Transport ) from stilsoft_test import constants class Command(BaseCommand): def handle(self, *args, **options): route_objects = Route.o...
SuperLalka/stilsoft-test
transport_routes/management/commands/fill_db.py
fill_db.py
py
1,469
python
en
code
0
github-code
7
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 12, "usage_type": "name" }, { "api_name": "transport_routes.models.Route.objects.count", "line_number": 15, "usage_type": "call" }, { "api_name": "transport_routes.models.Route.objects", "line_number": 15...
38823273440
# -*- coding: utf-8 -*- # @Time : 2021/12/23 11:09 # @Author : JingYang # @File : test_SetMeterTariff.py import datetime import time import requests from common.marker import * class Test_Set_Meter_Tariff: @asyncTest def test_SetMeterTariff(self, requestMessage, dbConnect,device, caseData): """使用异步...
NeonJ/hes-auto-test
testCase/HESIntegration/Tariff/test_set_meter_tariff.py
test_set_meter_tariff.py
py
2,626
python
en
code
0
github-code
7
[ { "api_name": "datetime.datetime.now", "line_number": 23, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 23, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 24, "usage_type": "call" }, { "api_name": "da...
72955632224
import sqlite3 import os import logging import struct #------------------------------------------------------------------------------- # Creating a logging with timestamp and regex #------------------------------------------------------------------------------- logging_str = "[%(asctime)s: %(levelname)s: %(module)...
SiddharthaShandilya/Dementia_detection_using_AI
src/utils/databse.py
databse.py
py
3,152
python
en
code
3
github-code
7
[ { "api_name": "os.makedirs", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_numb...
38427461513
import torch import torch.nn as nn import torch.nn.functional as F from collections import OrderedDict class TemplateBank(nn.Module): def __init__(self, num_templates, output_channels, kernel_size): super(TemplateBank,self).__init__() self.num_templates = num_templates templates = [torch.T...
smonsays/contrastive-meta-learning
fewshot/model.py
model.py
py
7,277
python
en
code
9
github-code
7
[ { "api_name": "torch.nn.Module", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 7, "usage_type": "name" }, { "api_name": "torch.Tensor", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.nn.Parameter", "li...
18430275840
# -*- coding: utf-8 -*- from rqalpha import run_file from datetime import datetime import os import sys, getopt start = "2007-01-01" end = datetime.now().strftime("%Y-%m-%d") stocklist_path = "" opts, args = getopt.getopt(sys.argv[1:], "s:e:f:") for op, value in opts: if op == "-s": start = value elif op == ...
wanhanwan/FactorLib
scripts/strategy_bttest_templates/run.py
run.py
py
968
python
en
code
6
github-code
7
[ { "api_name": "datetime.datetime.now", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 9, "usage_type": "name" }, { "api_name": "getopt.getopt", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.argv", "l...
72349254943
import sys import json import re import datetime import github from github import Github from common.Instance import get_github_token, get_github_repo, Instance """ TODO! """ def usage(): print("python collect_milestones.py ") print(" TODO") def do_the_thing(instance, simple=False): ...
zadjii/github-analytics
collect_milestones.py
collect_milestones.py
py
5,777
python
en
code
1
github-code
7
[ { "api_name": "github.Github", "line_number": 22, "usage_type": "call" }, { "api_name": "common.Instance.get_github_token", "line_number": 22, "usage_type": "call" }, { "api_name": "common.Instance.get_github_repo", "line_number": 23, "usage_type": "call" }, { "ap...
71140380385
import re import math from datetime import datetime from random import randint, random from unittest import TestCase from enum import IntEnum from functools import partial __author__ = 'hisehyin' __datetime__ = '15/12/25 上午10:50' OPTION_SIGN = {0: '+', 1: '-', 2: '*', 3: '/'} OPTION_PRINT = {'+': ' + ', '-': ' - ',...
hiseh/yinanan
app/kousuan.py
kousuan.py
py
7,414
python
en
code
0
github-code
7
[ { "api_name": "math.modf", "line_number": 32, "usage_type": "call" }, { "api_name": "math.modf", "line_number": 33, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 37, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 39...
15709418994
from lib.GImage import GImage, Anchors, Algin, ImageAnchors from PIL import Image, ImageFont, ImageDraw def _get_rounded_rectangle(size: tuple[int, int], radius: float, color: tuple[int, int, int, int]): base = Image.new(mode="RGBA", size=size) box = ImageDraw.Draw(base) box.rounded_rectangle( xy=...
nikawamikan/sky_profile_generator
api/lib/profile_generator.py
profile_generator.py
py
1,675
python
en
code
0
github-code
7
[ { "api_name": "PIL.Image.new", "line_number": 6, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 6, "usage_type": "name" }, { "api_name": "PIL.ImageDraw.Draw", "line_number": 7, "usage_type": "call" }, { "api_name": "PIL.ImageDraw", "line_num...
5081635190
# from lxml import etree # import requests # # url = 'http://tieba.baidu.com/f?ie=utf-8&kw=%E7%A7%91%E6%8A%80&fr=search&red_tag=s1890224318' # html = requests.get(url).text # print(html) # pare = etree.HTML(html).xpath('//div[@class="search_main_wrap"]/h3/a/@href') # # print(pare) #-*- coding: UTF-8 -*- from lxml ...
hehewzq0131/test-py
autoSendEmail-master/autoSendEmail-master/test_case/Test_etree.py
Test_etree.py
py
1,046
python
en
code
0
github-code
7
[ { "api_name": "lxml.etree.HTML", "line_number": 25, "usage_type": "call" }, { "api_name": "lxml.etree", "line_number": 25, "usage_type": "name" } ]
37046740946
from urllib.parse import urlparse from django.conf import settings from django.contrib import admin, messages from django.utils.translation import ngettext from import_export import resources from import_export.admin import ImportExportActionModelAdmin from phonebank.models import Agent, TelnyxCredential, Room, Voter...
daradib/boran
phonebank/admin.py
admin.py
py
3,965
python
en
code
3
github-code
7
[ { "api_name": "import_export.resources.ModelResource", "line_number": 12, "usage_type": "attribute" }, { "api_name": "import_export.resources", "line_number": 12, "usage_type": "name" }, { "api_name": "phonebank.models.Agent", "line_number": 15, "usage_type": "name" }, ...
11503824580
import aes import base64 import cbc_mac import os import util m = "alert('MZA who was that?');\n" k = "YELLOW SUBMARINE" iv = '\0'*16 tag = cbc_mac.cbc_mac_tag(m, k, iv) assert(tag.encode('hex') == "296b8d7cb78a243dda4d0a61d33bbdd1") target = "alert('Ayo, the Wu is back!');" def collide_hash(target): # Put comment...
AdrS/cryptopals
p50.py
p50.py
py
913
python
en
code
0
github-code
7
[ { "api_name": "cbc_mac.cbc_mac_tag", "line_number": 10, "usage_type": "call" }, { "api_name": "os.urandom", "line_number": 19, "usage_type": "call" }, { "api_name": "cbc_mac.cbc_mac_tag", "line_number": 20, "usage_type": "call" }, { "api_name": "aes.add_pkcs7_padd...
37018019872
from pathlib import Path import solara from solara.alias import rv from solara.components.title import Title from solara.routing import route_level_context from ..components import Header, Hero directory = Path(__file__).parent # md file md = open(directory / "README.md").read() title = "Home" route_order = ["/",...
civvic/solara
solara/website/pages/__init__.py
__init__.py
py
9,878
python
en
code
null
github-code
7
[ { "api_name": "pathlib.Path", "line_number": 10, "usage_type": "call" }, { "api_name": "solara.GridFixed", "line_number": 22, "usage_type": "call" }, { "api_name": "solara.Markdown", "line_number": 23, "usage_type": "call" }, { "api_name": "solara.component", ...
17393173236
from .planner import Planner, save_model import torch import torch.optim as optim import torch.utils.tensorboard as tb import numpy as np from .utils import load_data from . import dense_transforms def train(args): from os import path # Initialize the model model = Planner() optimizer = optim.Adam(mod...
abmueller2000/DeepLhomework5
homework/train.py
train.py
py
2,193
python
en
code
0
github-code
7
[ { "api_name": "planner.Planner", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.optim.Adam", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.optim", "line_number": 13, "usage_type": "name" }, { "api_name": "torch.nn.MSELoss", "...
75129087583
from django.shortcuts import render, redirect from django.http import HttpResponse #Import Category model from rango.models import Category, Page, UserProfile from rango.forms import CategoryForm, PageForm, UserForm, UserProfileForm from django.contrib.auth import authenticate, login, logout from django.http import ...
JamesSab1/rango_project_play
tang_with_django_project/rango/views.py
views.py
py
11,319
python
en
code
0
github-code
7
[ { "api_name": "rango.models.Category.objects.order_by", "line_number": 24, "usage_type": "call" }, { "api_name": "rango.models.Category.objects", "line_number": 24, "usage_type": "attribute" }, { "api_name": "rango.models.Category", "line_number": 24, "usage_type": "name"...
73652893342
from enum import Enum class Station(Enum): """ Station ids ranged as below; - 1 xx xxx - CUrW (stationId: curw_<SOMETHING>) - 2 xx xxx - Megapolis (stationId: megapolis_<SOMETHING>) - 3 xx xxx - Government (stationId: gov_<SOMETHING>. May follow as gov_irr_<SOMETHING>) - 4 xx xxx - Public (st...
gihankarunarathne/CurwMySQLAdapter
curwmysqladapter/station.py
station.py
py
2,229
python
en
code
1
github-code
7
[ { "api_name": "enum.Enum", "line_number": 4, "usage_type": "name" } ]
31410362579
""" math_object Provides helper functions for pulling the LaTeX show_template_manager from the equations database update method: https://stackoverflow.com/questions/34774409/build-a-dynamic-update-query-in-psycopg2 https://www.psycopg.org/docs/sql.html# Type Hinting Tuple: https://stackoverflow.com/questions/47533787/...
wdeshazer/equation_database
math_object.py
math_object.py
py
19,735
python
en
code
0
github-code
7
[ { "api_name": "psycopg2.sql.SQL", "line_number": 51, "usage_type": "call" }, { "api_name": "psycopg2.sql.Identifier", "line_number": 51, "usage_type": "call" }, { "api_name": "config.config", "line_number": 53, "usage_type": "call" }, { "api_name": "psycopg2.conne...
72867732382
import torch.nn as nn import torch.nn.functional as F import torch if torch.__version__ >= "1.8": import torch_npu from torch.autograd import Variable from collections import OrderedDict from torchvision.models.resnet import resnet18, resnet34, resnet50 import apex import torch.npu import os import torch.npu impor...
Ascend/ModelZoo-PyTorch
PyTorch/dev/cv/detection/SSD-ResNet34_ID0411_for_PyTorch/base_model.py
base_model.py
py
7,666
python
en
code
31
github-code
7
[ { "api_name": "torch.__version__", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.getenv", "line_number": 16, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.npu.current_device", ...
41220208850
# coding: utf-8 import requests from config import data import argparse def sendSubmission(answerfile, name='answer.csv', desc=''): files={'files': open(answerfile,'rb')} data["filename"] = name data["description"] = desc url = 'https://biendata.com/competition/kdd_2018_submit/' response = re...
csielee/dsai2018_midterm
api_submit.py
api_submit.py
py
963
python
en
code
0
github-code
7
[ { "api_name": "config.data", "line_number": 11, "usage_type": "name" }, { "api_name": "config.data", "line_number": 12, "usage_type": "name" }, { "api_name": "requests.post", "line_number": 16, "usage_type": "call" }, { "api_name": "config.data", "line_number"...
70272485344
__author__ = 'sbouhman' import logging from tests_framework.ui_building_blocks.KSTB.dvrbooking import DVRBooking def test_01_tuner_conflict(): num_of_tuner = 4 test = DVRBooking("test_tuner_conflict") test.ve_test.begin(screen=test.ve_test.screens.fullscreen) test.ve_test.screens.playback.dca(1,time...
anshsaikia/GSSDeliverables-YesProject
VE-Tests/tests/KSTB/android/e2e_tests/test_tuner_conflict.py
test_tuner_conflict.py
py
1,459
python
en
code
0
github-code
7
[ { "api_name": "tests_framework.ui_building_blocks.KSTB.dvrbooking.DVRBooking", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 19, "usage_type": "call" }, ...
32978605525
from flask import Flask, render_template, redirect, url_for, request, session, flash, send_file from flask_sqlalchemy import SQLAlchemy from sqlalchemy.exc import IntegrityError import re import mysql.connector # from flask_login import current_user from flask_login import login_user from flask_login import current_use...
Dr-savant21/AchievoDash
index.py
index.py
py
57,391
python
en
code
0
github-code
7
[ { "api_name": "flask.Flask", "line_number": 17, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 20, "usage_type": "call" }, { "api_name": "mysql.connector.connector.connect", "line_number": 22, "usage_type": "call" }, { "api_nam...
22021845540
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np import os import time from adc_dac_bram import AdcDacBram from koheron import connect import matplotlib matplotlib.use('TKAgg') from matplotlib import pyplot as plt from matplotlib.lines import Line2D host = os.getenv('HOST', '192.168.1.113') client = ...
Koheron/koheron-sdk
examples/alpha15/adc-dac-bram/test_clkout_dec.py
test_clkout_dec.py
py
2,206
python
en
code
91
github-code
7
[ { "api_name": "matplotlib.use", "line_number": 11, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 15, "usage_type": "call" }, { "api_name": "koheron.connect", "line_number": 16, "usage_type": "call" }, { "api_name": "adc_dac_bram.AdcDacBram", ...
74165408224
# -*- coding: utf-8 -*- """ Created on Mon Nov 12 20:28:17 2018 @author: Alexandre """ ############################################################################### import numpy as np ############################################################################### from pyro.dynamic import cartpole from pyro.control...
alx87grd/AlexRobotics
examples/by_systems/cartpole/cartpole_with_rrt_and_computed_torque.py
cartpole_with_rrt_and_computed_torque.py
py
1,893
python
en
code
15
github-code
7
[ { "api_name": "pyro.dynamic.cartpole.RotatingCartPole", "line_number": 17, "usage_type": "call" }, { "api_name": "pyro.dynamic.cartpole", "line_number": 17, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 21, "usage_type": "call" }, { "api_name...
26043260979
from optparse import make_option from django.core.management.base import BaseCommand from common.utils import replace_media_urls class Command(BaseCommand): option_list = BaseCommand.option_list + ( make_option('--old-path', '-o', dest='oldpath', default='st...
modamania/otdohni
apps/common/management/commands/replace_media_urls.py
replace_media_urls.py
py
1,009
python
en
code
0
github-code
7
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 6, "usage_type": "name" }, { "api_name": "django.core.management.base.BaseCommand.option_list", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.core.management.base.BaseCommand", "lin...