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
9326307274
import asyncio import functools import json import os import subprocess from git import Repo, Actor from importlib import resources from mimetypes import guess_type from shutil import rmtree from tornado import web, websocket async def render(basepath: str): """Render the project at the given basepath.""" in...
mmh352/ou-content-author
ou_content_author/handlers.py
handlers.py
py
13,433
python
en
code
0
github-code
70
[ { "api_name": "asyncio.create_subprocess_exec", "line_number": 16, "usage_type": "call" }, { "api_name": "asyncio.create_subprocess_exec", "line_number": 18, "usage_type": "call" }, { "api_name": "subprocess.PIPE", "line_number": 18, "usage_type": "attribute" }, { ...
17365224360
from itertools import product # Biblioteca que realiza arranjos de análise combinatória import time # Classe que representa o grafo e realiza todas as operações com ele class Grafo: # Método que inicializa a classe def __init__(self, matriz): self.matriz = matriz self.tamanhoCaminho = 0 ...
LuanBorges1998/brute_force_mixed_graph_python
grafo.py
grafo.py
py
4,867
python
pt
code
0
github-code
71
[ { "api_name": "time.time", "line_number": 39, "usage_type": "call" }, { "api_name": "itertools.product", "line_number": 42, "usage_type": "call" }, { "api_name": "time.time", "line_number": 122, "usage_type": "call" } ]
29250254903
# USB VCP example. # This example shows how to use the USB VCP class to send an image to PC on demand. # # WARNING: # This script should NOT be run from the IDE or command line, it should be saved as main.py # Note the following commented script shows how to receive the image from the host side. # # #!/usr/bin/env pyth...
FRC7891/INOV8_2020
vision/openmv_usb_vcp.py
openmv_usb_vcp.py
py
2,900
python
en
code
0
github-code
71
[ { "api_name": "sensor.reset", "line_number": 26, "usage_type": "call" }, { "api_name": "sensor.set_pixformat", "line_number": 27, "usage_type": "call" }, { "api_name": "sensor.RGB565", "line_number": 27, "usage_type": "attribute" }, { "api_name": "sensor.set_frame...
33054084372
from dateutil import tz import datetime import pytz import re pattern = r'^\b(.{4})[:-](.{2})[:-](.{2})\s+(.{2}):(.{2}):(.{2})(Z|([+-])(.{2}):(.{2}))?.*\b$' class Text2Time: def __init__(self, text): match = re.search(pattern, text) if match: groups = match.groups() year...
asarangaram/image_repo
src/utils/text2date.py
text2date.py
py
2,068
python
en
code
0
github-code
71
[ { "api_name": "re.search", "line_number": 12, "usage_type": "call" }, { "api_name": "dateutil.tz.tzlocal", "line_number": 38, "usage_type": "call" }, { "api_name": "dateutil.tz", "line_number": 38, "usage_type": "name" }, { "api_name": "pytz.utc", "line_number...
42803728529
from typing import List class Solution: def merge(self, nums1: List[int], m: int, nums2: List[int], n: int) -> None: '''合并两个有序数组 @Note: 类似归并排序,从后往前 ''' i, j, k = m - 1, n - 1, m + n - 1 if n == 0: return while True: if n...
staillyd/leetcode
leetcode/array/88.py
88.py
py
1,008
python
en
code
0
github-code
71
[ { "api_name": "typing.List", "line_number": 6, "usage_type": "name" } ]
28508931252
# -*- coding: utf-8 -*- # @Author: Ruban # @License: Apache Licence # @File: icdar2013_convert.py import os import re import codecs import argparse import numpy as np parser = argparse.ArgumentParser() parser.add_argument('--data_dir', type=str, default=r'D:\data\ICDAR2013') FLAGS = parser.parse_args()...
RubanSeven/CRAFT_keras
converts/icdar2013_convert.py
icdar2013_convert.py
py
3,039
python
en
code
165
github-code
71
[ { "api_name": "argparse.ArgumentParser", "line_number": 12, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path", "line_n...
6910654847
#!/usr/bin/env python # encoding: utf-8 """ @author: Mingjun Lei @file: test_wework.py @time: 2021/2/26 16:07 @desc: This py file is to test different login scenarios without PO """ import json from time import sleep import pytest from selenium import webdriver from selenium.webdriver.common.by import By class TestWe...
junevision/WechatWorkTest
Web/testcases/test_wework.py
test_wework.py
py
2,590
python
en
code
0
github-code
71
[ { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 19, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 19, "usage_type": "name" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 22, "usage_type": "call" }, { "api...
19541490763
import requests import json from random import sample, randint from datetime import datetime, timedelta import logging logging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)s %(name)s: %(message)s') if __name__ == "__main__": logins = ['alex', 'john', 'mike', 'nadya', 'sasha', 'peter', 'fox', 'c...
ml-workteam/de
simulations/generate_users.py
generate_users.py
py
1,477
python
en
code
0
github-code
71
[ { "api_name": "logging.basicConfig", "line_number": 6, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 6, "usage_type": "attribute" }, { "api_name": "random.sample", "line_number": 32, "usage_type": "call" }, { "api_name": "random.sample", ...
10515757874
import scipy.spatial.distance import numpy as np def distance(data): total = 0 num_obs = data.shape[0] for i in range(num_obs): for j in range(i+1,num_obs): total += scipy.spatial.distance.euclidean(data[i],data[j]) return total def correlation(data): total = 0 with np.errstate(divide='ign...
theislab/AutoGeneS
autogenes/objectives.py
objectives.py
py
735
python
en
code
53
github-code
71
[ { "api_name": "scipy.spatial.distance.spatial.distance.euclidean", "line_number": 11, "usage_type": "call" }, { "api_name": "scipy.spatial.distance.spatial", "line_number": 11, "usage_type": "attribute" }, { "api_name": "scipy.spatial.distance", "line_number": 11, "usage_...
40303306283
import argparse import tempfile from pathlib import Path DEFAULT_DIR = Path(tempfile.gettempdir()) / "ya-drone-swarm" DEFAULT_PROVIDERS = 2 DEFAULT_CPU_QUOTA = 1024 DEFAULT_CPU_SHARES = 0.5 # core percentage DEFAULT_MEM = 512 # MB def arg_parser(): parser = argparse.ArgumentParser(prog="ya-drone-swarm") p...
mfranciszkiewicz/ya-drone-swarm
ya_drone_swarm/cli.py
cli.py
py
2,560
python
en
code
0
github-code
71
[ { "api_name": "pathlib.Path", "line_number": 5, "usage_type": "call" }, { "api_name": "tempfile.gettempdir", "line_number": 5, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 14, "usage_type": "call" } ]
19122759978
from enum import Enum import os import re Test.Summary = 'Exercise HTTP CONNECT Method' Test.ContinueOnFail = True class ConnectTest: class State(Enum): """ State of process """ INIT = 0 RUNNING = 1 def __init__(self): self.state = self.State.INIT sel...
apache/trafficserver
tests/gold_tests/connect/connect.test.py
connect.test.py
py
9,590
python
en
code
1,664
github-code
71
[ { "api_name": "enum.Enum", "line_number": 11, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 77, "usage_type": "call" }, { "api_name": "os.path", "line_number": 77, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number":...
38224622231
from environments.music_world import MusicWorld, CompositionState from typing import List, Dict from constants.note import Note, Symbol from models.music_world_nn import MusicWorldNN from random import random, choice import numpy as np import time import joblib import os import torch import torch.optim as optim fr...
franciscovilchezv/eurydice.rl
source/visualizer/music_visualizer.py
music_visualizer.py
py
9,903
python
en
code
0
github-code
71
[ { "api_name": "environments.music_world.MusicWorld", "line_number": 21, "usage_type": "name" }, { "api_name": "environments.music_world.MusicWorld", "line_number": 22, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 23, "usage_type": "name" }, { ...
19698282701
#!/usr/bin/python3 import os, sys import time from numpy.random import random import re import csv import json import requests from bs4 import BeautifulSoup as bs ##### # UTILS ##### def parse_url( url:str ): ''' Dado un url devuelve objeto parseado de BeautifulSoup ''' n_attempts=5 for _ ...
vearcon/TDP-espacios-publicos-origenes
scrapers/scraper_meli.py
scraper_meli.py
py
6,227
python
en
code
1
github-code
71
[ { "api_name": "requests.get", "line_number": 24, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 30, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 72, "usage_type": "call" }, { "api_name": "re.compile", "line_numb...
31444407288
import json from tqdm import tqdm print("opening all nodes") with open("all-nodes.json", "r") as tmp: allNodes = json.load(tmp) # shard the giant graph.json file print("opening graph.json") with open("graph.json", "r") as tmp: graph = json.load(tmp) print("opened graph.json") assert len(graph.keys()) ...
amanj120/wikilink-coloring
analysis/phase3.py
phase3.py
py
787
python
en
code
0
github-code
71
[ { "api_name": "json.load", "line_number": 6, "usage_type": "call" }, { "api_name": "json.load", "line_number": 11, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 16, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 21, "...
73976664549
import matplotlib.pyplot as plt import numpy as np from torch import nn, torch from src.implem.ConvolutionalNeuralFabrics import ConvolutionalNeuralFabric, Out_Layer from src.networks.StochasticSuperNetwork import StochasticSuperNetwork from src.utils.drawers.BSNDrawer import BSNDrawer plt.switch_backend('agg') cla...
TomVeniat/bsn
src/implem/BudgetedSuperNetwork.py
BudgetedSuperNetwork.py
py
3,470
python
en
code
25
github-code
71
[ { "api_name": "matplotlib.pyplot.switch_backend", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 9, "usage_type": "name" }, { "api_name": "src.networks.StochasticSuperNetwork.StochasticSuperNetwork", "line_number": 12, "usage_t...
6092421412
from setuptools import setup, find_packages README = open('README.rst').read() setup(name="tornwamp", author="Tatiana Al-Chueyr Martins", author_email="tatiana.alchueyr@gmail.com", classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Intended A...
ef-ctx/tornwamp
setup.py
setup.py
py
1,240
python
en
code
7
github-code
71
[ { "api_name": "setuptools.setup", "line_number": 7, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 27, "usage_type": "call" } ]
30453456925
import os import json import requests import time import storage OPEN_WEATHER_KEY = os.getenv('OPEN_WEATHER_KEY') AIRNOW_API_KEY = os.getenv('AIRNOW_API_KEY') FINHUB_API_KEY = os.getenv('FINHUB_API_KEY') def time_since_last_fetch(): if "last_fetch" in storage.cache: return time.time() - float(storage.cac...
timboldt/epaper-display
rpi/python/net.py
net.py
py
4,239
python
en
code
2
github-code
71
[ { "api_name": "os.getenv", "line_number": 8, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 9, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 10, "usage_type": "call" }, { "api_name": "storage.cache", "line_number": 13, ...
10231804257
from rest_framework import serializers from apps.users.models import User class UserSerializerToken(serializers.ModelSerializer): class Meta: model = User fields = ('username', 'email', 'name', 'last_name') class UserSerializer(serializers.ModelSerializer): class Meta: model = Use...
sebasflorez16/agro-rest
apps/users/api/serializers.py
serializers.py
py
1,087
python
en
code
0
github-code
71
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 9, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 9, "usage_type": "name" }, { "api_name": "apps.users.models.User", "line_number": 11, "usage_type": "name"...
19726083848
import numpy as np import scipy.linalg as sla import time import matplotlib.pyplot as plt def sweep(n, a, b, c, f): alpha = np.zeros(n + 1) beta = np.zeros(n + 1) x = np.zeros(n) for i in range(n): d = a[i] * alpha[i] + b[i] alpha[i + 1] = -c[i] / d beta[i + 1] = (f[i] - a[i] * beta[i]) / d x[n - 1] = bet...
NaylyaZh99/numeric_methods
lab1/sweep.py
sweep.py
py
1,420
python
en
code
0
github-code
71
[ { "api_name": "numpy.zeros", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 20,...
10970860330
import matplotlib.pyplot as plt import numpy as np import time class DynamicUpdate(): plt.ion() #Suppose we know the x range min_x = 0 max_x = 2*3.1415926536 min_y = -1.5 max_y = 1.5 def on_launch(self): #Set up plot self.figure, self.ax = plt.subplots() ...
msarvinen/python-examples
plot-dynamic/dynaplot.py
dynaplot.py
py
1,733
python
en
code
0
github-code
71
[ { "api_name": "matplotlib.pyplot.ion", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 6, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 15, "usage_type": "call" }, { "api_name": "matp...
31072980158
import pymongo from utils.nextButton import processManage from utils.db import mongo_client def getWebSiteNameList(database): myclient = pymongo.MongoClient("mongodb://localhost:27017") dblist = myclient.list_database_names() if "cloud_academic" not in dblist: print("数据库不存在!") return 0 ...
defender-dhy/News-data-acquisition-system
mongo/utils.py
utils.py
py
2,094
python
en
code
0
github-code
71
[ { "api_name": "pymongo.MongoClient", "line_number": 7, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 27, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 47, "usage_type": "call" }, { "api_name": "pymongo.Mo...
38110076648
from django.shortcuts import render, get_object_or_404, redirect, reverse from .forms import ReviewForm from .models import Reviews from django.contrib.auth.decorators import login_required from django.contrib import messages def reviews(request): reviews = Reviews.objects.filter(status=1) template = 'reviews...
ViktorMathe/roxys-cakes
reviews/views.py
views.py
py
1,659
python
en
code
0
github-code
71
[ { "api_name": "models.Reviews.objects.filter", "line_number": 9, "usage_type": "call" }, { "api_name": "models.Reviews.objects", "line_number": 9, "usage_type": "attribute" }, { "api_name": "models.Reviews", "line_number": 9, "usage_type": "name" }, { "api_name": ...
4711897447
#!/usr/bin/env python # coding: utf-8 # In[1]: # Dependencies from bs4 import BeautifulSoup as bs import requests import pymongo import pandas as pd from splinter import Browser import time # In[20]: #master function def scrape_info(): executable_path = {'executable_path': 'chromedriver.exe'} browser = Bro...
SMC380013/Web-Scraping-Project
scrape_mars.py
scrape_mars.py
py
4,124
python
en
code
0
github-code
71
[ { "api_name": "splinter.Browser", "line_number": 20, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 40, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 42, "usage_type": "call" }, { "api_name": "time.sleep", "line_...
18221943450
from PyQt5 import Qt import pathlib from skimage import io as skio for function in ('imread', 'imsave', 'imread_collection'): skio.use_plugin('freeimage', function) import time class DeathFluorescence(Qt.QObject): def __init__(self, root, timeInterval, outPath, imagePrefix, rw=None, runCount=None): sup...
erikhvatum/zplab
acquisition_scripts/non_rpc/deathfluorescence.py
deathfluorescence.py
py
3,367
python
en
code
0
github-code
71
[ { "api_name": "skimage.io.use_plugin", "line_number": 5, "usage_type": "call" }, { "api_name": "skimage.io", "line_number": 5, "usage_type": "name" }, { "api_name": "PyQt5.Qt.QObject", "line_number": 8, "usage_type": "attribute" }, { "api_name": "PyQt5.Qt", "l...
40291104440
"""demo URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based vi...
15851826258/ReadRecommend_By_LIM
COMP9900/urls.py
urls.py
py
2,254
python
en
code
0
github-code
71
[ { "api_name": "django.urls.path", "line_number": 25, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 25, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 25, "usage_type": "name" }, { "api_name": "...
74168843110
from django.http import JsonResponse from django.shortcuts import render,redirect from django.contrib.auth.decorators import login_required import requests from datetime import datetime from django.contrib import messages # Create your views here. def apphome(request): return render(request, 'agricapp...
nelsonfai/farmsocial
agricapps/views.py
views.py
py
2,990
python
en
code
0
github-code
71
[ { "api_name": "django.shortcuts.render", "line_number": 11, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 14, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 24, "usage_type": "call" }, { "api_name": "datetime...
25742694052
from django.urls import include, path from rest_framework.routers import DefaultRouter from reviews.views import ( CategoryViewSet, CommentViewSet, GenreViewSet, ReviewViewSet, TitleViewSet, ) from users.views import UserSignUpAPIView, UserViewSet, token_obtain router = DefaultRouter() router.regi...
igorbaryshev/api_yamdb
api_yamdb/api/v1/urls.py
urls.py
py
988
python
en
code
0
github-code
71
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 13, "usage_type": "call" }, { "api_name": "users.views.UserViewSet", "line_number": 14, "usage_type": "argument" }, { "api_name": "reviews.views.CategoryViewSet", "line_number": 16, "usage_type": "argume...
41709751257
import collections def sideView(root): #Level Order becauase we want the right most values of each level q = collections.deque([root]) res = [] for i in range(len(q)): while q: node = q.popleft() if node: riteSide = None #initially set to None...
shirinyamani/neetcode
tree/sideview.py
sideview.py
py
505
python
en
code
1
github-code
71
[ { "api_name": "collections.deque", "line_number": 5, "usage_type": "call" } ]
1314276630
""" URL configuration for contract_manager project. The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/4.2/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, n...
V0lodimirV/contracts_and_projects
contract_manager/urls.py
urls.py
py
1,636
python
en
code
0
github-code
71
[ { "api_name": "django.urls.path", "line_number": 24, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 24, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 24, "usage_type": "name" }, { "api_name": "...
34162692457
import numpy as np import scipy.io as sio import matplotlib.pyplot as plt from sklearn.preprocessing import MinMaxScaler import unicodedata import pdb import cv2 import matplotlib def makeArraysEqual(gt_file, pred_file): new_array = np.zeros([len(gt_file), 1]) for i in range(len(pred_file)): new_a...
Ziyad07/Video-Summarisation
code/TvSum50/plot_results.py
plot_results.py
py
6,570
python
en
code
0
github-code
71
[ { "api_name": "numpy.zeros", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 23, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 43, "usage_type": "call" }, { "api_name": "matplotlib.pyplot",...
25070223550
import matplotlib.pyplot as plt import numpy as np import pandas as pd from particle import Particle from pid import PID acc = [] pos = [] vel = [] # particle init condition weight = 10.0 position = 10.0 velocity = 0.0 # time condition init_time = 0.0 final_time = 100 dt = 0.01 # pid param target = 0.0 kp = 100 k...
jeongleo/MyJupyter
PID/control.py
control.py
py
1,642
python
en
code
0
github-code
71
[ { "api_name": "particle.Particle", "line_number": 37, "usage_type": "call" }, { "api_name": "pid.PID", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 44, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_n...
40816031041
from django.contrib.auth import get_backends, login from django.contrib.auth.models import User from django.utils.deprecation import MiddlewareMixin USERNAME = 'user' class AutoLoginMiddleware(MiddlewareMixin): """ Middleware to login user automatically when the application is running as part of ...
uktrade/data-explorer
explorer/middleware.py
middleware.py
py
758
python
en
code
1
github-code
71
[ { "api_name": "django.utils.deprecation.MiddlewareMixin", "line_number": 8, "usage_type": "name" }, { "api_name": "django.contrib.auth.models.User.objects.filter", "line_number": 18, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.User.objects", "line_number...
9818238184
import json import logging from pyannotate.annotation_object import BoxAnnotation # load logger logger = logging.getLogger("AnnotationLoader") class AnnotationLoader: """ Basically a BoxAnnotationLoader, since load detected boxes by default """ def __init__(self, annotation_class=BoxAnnotation): self.annot...
miikama/pyvideoannotate
pyannotate/annotation_loader.py
annotation_loader.py
py
2,289
python
en
code
2
github-code
71
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "pyannotate.annotation_object.BoxAnnotation", "line_number": 15, "usage_type": "name" }, { "api_name": "json.load", "line_number": 25, "usage_type": "call" }, { "api_name": ...
39363194135
# run_study.py """This script is necessary for using subprocessing. In \power-system-tools\interface_tools\gui_classes\widget_classes.py, the line subprocess.run([INTERPERTER_PATHS[script_type], r'run_study.py', self.project_id, script_type, study], check=True) effectively runs this script as if from the command l...
lightmanrsa/Power_systems
run_study.py
run_study.py
py
2,616
python
en
code
0
github-code
71
[ { "api_name": "importlib.import_module", "line_number": 28, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 38, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 39, "usage_type": "attribute" }, { "api_name": "sys.argv", "l...
72413232550
import copy import numpy as np import torch from torch import optim, nn from tqdm import tqdm from Datasets.public_dataset import get_public_dataset from Sever.utils.sever_methods import SeverMethod from utils.utils import row_into_parameters class FLTrustSever(SeverMethod): NAME = 'FLTrustSever' def __in...
WenkeHuang/MarsFL
Sever/FLTrustSever.py
FLTrustSever.py
py
4,119
python
en
code
17
github-code
71
[ { "api_name": "Sever.utils.sever_methods.SeverMethod", "line_number": 14, "usage_type": "name" }, { "api_name": "Datasets.public_dataset.get_public_dataset", "line_number": 25, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 36, "usage_type": "call" ...
33869409824
import json def load_candidates(): # Загрузит данные из файла """ Загружает из файла список кандидатов Возвращает list[dict] """ with open('candidates.json', encoding='utf-8') as file: candidates = json.load(file) return candidates def get_all(): # Покажет всех канд...
Sergo1613/Hw_10
utils.py
utils.py
py
2,114
python
ru
code
0
github-code
71
[ { "api_name": "json.load", "line_number": 10, "usage_type": "call" } ]
37020661524
# coding=utf-8 import bottle from bottle import html_escape def escape_value(value): if str(type(value)) == "<class 'bson.objectid.ObjectId'>": value = str(value) elif type(value) == str: value = html_escape(value) return value class Types: HIDDEN_TYPE = "hidden" MULTI_HIDDEN_TYPE = "multihidden" INT_TYPE...
iamcm/shared
FormBinder/__init__.py
__init__.py
py
11,548
python
en
code
0
github-code
71
[ { "api_name": "bottle.html_escape", "line_number": 9, "usage_type": "call" }, { "api_name": "bottle.request.params.get", "line_number": 376, "usage_type": "call" }, { "api_name": "bottle.request", "line_number": 376, "usage_type": "attribute" }, { "api_name": "bot...
6906703417
import sys import os sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import dgl import math import torch import torch.nn as nn import torch.nn.functional as F from model.copy_transformer import EncoderTransformer, CopyDecoderTransformer from model.hgt import HGTEncoder, HGTLayer, flatten...
zkcpku/HGT-HPG
model/varmisuse_model.py
varmisuse_model.py
py
18,034
python
en
code
9
github-code
71
[ { "api_name": "sys.path.append", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path", "line_number...
15398508689
import base64 from enum import auto from terra_sdk.client.lcd import LCDClient from terra_sdk.key.mnemonic import MnemonicKey from terra_sdk.core.wasm import MsgStoreCode, MsgInstantiateContract, MsgExecuteContract, msgs from terra_sdk.core.auth.data.tx import StdFee from terra_sdk.client.lcd.api.bank import BankAPI ...
gachouchani1999/terra_testing
contract.py
contract.py
py
1,976
python
en
code
1
github-code
71
[ { "api_name": "terra_sdk.client.lcd.LCDClient", "line_number": 11, "usage_type": "call" }, { "api_name": "terra_sdk.key.mnemonic.MnemonicKey", "line_number": 17, "usage_type": "call" }, { "api_name": "base64.b64encode", "line_number": 22, "usage_type": "call" }, { ...
32385422907
import os, gc, requests, subprocess def Check_dependencies(): # Dependencies already installed ? print("Installing dependencies... This will take few minutes...", end='') try: subprocess.run(["pip", "install", "-r", "requirements.txt"], text=True, capture_output=True, check=True) print("\rInstallation done...
Captain-FLAM/KaraFan
App/setup.py
setup.py
py
3,311
python
en
code
40
github-code
71
[ { "api_name": "subprocess.run", "line_number": 9, "usage_type": "call" }, { "api_name": "subprocess.CalledProcessError", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 32, "usage_type": "call" }, { "api_name": "os.pa...
7929118616
#----------------------------------------------------------------------------# # Procesamiento de grandes volumenes de datos 2020-2 # # Proyecto 1 (data cleaning + MLlib) # # Alejandro Ayala Gil # # ...
Taniaobando/PYSPARK--data-cleaning-MLlib-
Proyecto1.py
Proyecto1.py
py
30,190
python
en
code
0
github-code
71
[ { "api_name": "findspark.init", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.boxplot", "line_number": 234, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 234, "usage_type": "name" }, { "api_name": "matplotl...
12142454768
import matplotlib.pyplot as plt from crystal_lattice import * from matplotlib.figure import Figure def saxs_plot(files, strucs, first_peaks, sample_names, log=True, begin=0, end=0, graph=True): f = Figure() a = f.add_subplot(111) files = np.array(files) strucs = np.array(strucs) first_peaks = np.ar...
raphaeldc/saxs_ratio_gui
saxs_ratio_analyser.py
saxs_ratio_analyser.py
py
1,373
python
en
code
0
github-code
71
[ { "api_name": "matplotlib.figure.Figure", "line_number": 6, "usage_type": "call" } ]
36750816868
# -*- coding: utf-8 -*- import json import requests import base64 from odoo import http from odoo import models from woocommerce import API from odoo.addons.woocommerce_integration.models.tools import wcapi class OdooController(http.Controller): @http.route('/odoo_controller/odoo_controller/', auth='public') ...
angelavts/woocommerce_integration
woocommerce_integration/controllers/controllers.py
controllers.py
py
7,097
python
en
code
1
github-code
71
[ { "api_name": "odoo.http.Controller", "line_number": 11, "usage_type": "attribute" }, { "api_name": "odoo.http", "line_number": 11, "usage_type": "name" }, { "api_name": "odoo.http.route", "line_number": 12, "usage_type": "call" }, { "api_name": "odoo.http", "...
6225108436
import tkinter as tk import math from CheatChecks import CheatChecks from tkinter import Image from tkinter import filedialog from tkinter import messagebox from tkinter.filedialog import askopenfile from PIL import ImageTk root = tk.Tk(); # root.attributes('-fullscreen', True) background_image=tk.PhotoImage("727.gif"...
kkc028/osu-ucisd-cheat-analyzer
GUI.py
GUI.py
py
2,193
python
en
code
1
github-code
71
[ { "api_name": "tkinter.Tk", "line_number": 10, "usage_type": "call" }, { "api_name": "tkinter.PhotoImage", "line_number": 12, "usage_type": "call" }, { "api_name": "tkinter.Frame", "line_number": 14, "usage_type": "attribute" }, { "api_name": "tkinter.Frame.__init...
15797815162
from pytube import YouTube from moviepy.editor import AudioFileClip import pandas as pd def download(url, fname): yt = YouTube(url) #print(yt.streams.filter(only_video=True, subtype='mp4', res='360p').all()) print('Downloading: ' + fname, str(yt.streams.filter(only_video=True, subtype='mp4', res='360p')....
kalo37/AMATH482
hw4/download_yt.py
download_yt.py
py
801
python
en
code
0
github-code
71
[ { "api_name": "pytube.YouTube", "line_number": 8, "usage_type": "call" } ]
40821341097
import requests import pandas as pd from datetime import datetime from datetime import timedelta import os for i in range(-1, 0): ayer = datetime.today() + timedelta(days=i) fecha = str(ayer.day) + '/' + str(ayer.month) + '/' + str(ayer.year) + ' 0:00:00' resultado = requests.get("https://www.datos.gov.c...
ceao1/proyecto_covid
etl_bd.py
etl_bd.py
py
2,378
python
es
code
1
github-code
71
[ { "api_name": "datetime.datetime.today", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 8, "usage_type": "name" }, { "api_name": "datetime.timedelta", "line_number": 8, "usage_type": "call" }, { "api_name": "requests.ge...
21191238081
from astropy.io import fits import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import LogNorm # hdulist = fits.open('A1_mosaic.fits') # pixelData = hdulist[0].data # # testData = pixelData[1878:2168, 1598:1961] # small slice # # testData = pixelData[1963:2446, 1591:2244] # testData = pixelData[...
stanleyycheung/astronomicalImageProcessing
makedata.py
makedata.py
py
642
python
en
code
0
github-code
71
[ { "api_name": "astropy.io.fits.open", "line_number": 13, "usage_type": "call" }, { "api_name": "astropy.io.fits", "line_number": 13, "usage_type": "name" }, { "api_name": "astropy.io.fits.open", "line_number": 14, "usage_type": "call" }, { "api_name": "astropy.io....
73303389671
from typing import Optional import requests from src.exceptions.provider import ProviderErrorException from src.schemas.user import UserOutput from src.providers import IProvider from src.settings import GITHUB_BASE_URL class Github(IProvider): def get_user(self, username: str) -> Optional[UserOutput]: ...
HectorMenezes/GitCollector
src/providers/github.py
github.py
py
784
python
en
code
0
github-code
71
[ { "api_name": "src.providers.IProvider", "line_number": 11, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 14, "usage_type": "call" }, { "api_name": "src.settings.GITHUB_BASE_URL", "line_number": 14, "usage_type": "name" }, { "api_name": "req...
8217314456
import datetime as dt import cx_Oracle from src.app.externalOutages.getReasonId import getReasonId from typing import List, Tuple, Any import datetime as dt def updateRtoRevivalData(pwcDbConnStr: str, rtoId: int, revivalDt: dt.datetime, remarks: str) -> bool: isEditSuccess = True # ch...
nagasudhirpulla/wrldc_codebook
src/app/externalOutages/updateRtoRevivalData.py
updateRtoRevivalData.py
py
2,082
python
en
code
0
github-code
71
[ { "api_name": "datetime.datetime", "line_number": 8, "usage_type": "attribute" }, { "api_name": "typing.List", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.Any", "line...
4917789865
#Python Exercise: Creating a cash machine with bank account (using a file with client data) #Check the json file "bank_account.json" import json import time with open('bank_account.json', 'r') as info: account_data= json.loads(info.read()) print ('Initializing the cash machine...') time.sleep(2) print ('Use...
stellamoraes/python-beginner
cash_machine.py
cash_machine.py
py
1,179
python
en
code
0
github-code
71
[ { "api_name": "json.loads", "line_number": 8, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 11, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 33, "usage_type": "call" } ]
27455505819
import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.data import DataLoader from torch.utils.data import Dataset from torchvision import transforms from torch.optim import Adam from tools.utils import * from tools.unprocess import * class LoadData(Dataset): def __init__(self, root...
SenseBrainTech/overexposure-mask-reverse-ISP
tools/dataloader.py
dataloader.py
py
1,819
python
en
code
4
github-code
71
[ { "api_name": "torch.utils.data.Dataset", "line_number": 13, "usage_type": "name" }, { "api_name": "torch.from_numpy", "line_number": 35, "usage_type": "call" }, { "api_name": "torch.from_numpy", "line_number": 54, "usage_type": "call" } ]
40526194120
import cv2 import numpy as np # 画像を読み込む img = cv2.imread('./tmp/maru.png') print(img.shape) print(img.dtype) # グレースケールに変換 img_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) # 二値化する(白黒反転させた) th,img_otu = cv2.threshold(img_gray, 128, 255,cv2.THRESH_BINARY_INV) print(th) # 輪郭を抽出する # image, contours, hierarchy = cv2.find...
etckanikama/Congnition-for-OpenCV
sample.py
sample.py
py
585
python
ja
code
0
github-code
71
[ { "api_name": "cv2.imread", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 11, "usage_type": "attribute" }, { "api_name": "cv2.threshold", "l...
41852364205
from flask import Flask, render_template from flask_mysqldb import MySQL app = Flask(__name__) # Konfigurasi alamat ke database app.config["MYSQL_HOST"] = "localhost" app.config["MYSQL_USER"] = "root" app.config["MYSQL_PASSWORD"] = "" app.config["MYSQL_DB"] = "flask_latihan" # Sesuaikan dengan nama database yang di...
Prawirdani/Pemrograman-Web-Praktik-IX
BAB IV - Integrasi Flask dan MySQL/app.py
app.py
py
1,055
python
en
code
0
github-code
71
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask_mysqldb.MySQL", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 35, "usage_type": "call" }, { "api_name": "flask.render_tem...
72259059109
import unicodedata from typing import Union import sentencepiece as spm import springs as sp from cached_path import cached_path @sp.dataclass class SentencePieceEvalConfig: model_path: str = sp.MISSING normalization: Union[str, None] = sp.field( default="NFC", help="Choose between NFC (default), NFK...
RAIVNLab/MatFormer-OLMo
tokenizer/src/olmo_tokenizer/spm/eval.py
eval.py
py
1,159
python
en
code
2
github-code
71
[ { "api_name": "springs.MISSING", "line_number": 11, "usage_type": "attribute" }, { "api_name": "typing.Union", "line_number": 12, "usage_type": "name" }, { "api_name": "springs.field", "line_number": 12, "usage_type": "call" }, { "api_name": "springs.dataclass", ...
21950143569
import os import requests from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from models import ( Airport, Base, City, Continent, Country, ) from skyscanner_facade import ( API_KEY, API_URL, ) def _prepare_db(): # Initialize the database :: Connection & Meta...
skarzi/starthack
populate_db.py
populate_db.py
py
2,471
python
en
code
1
github-code
71
[ { "api_name": "os.path.abspath", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy.create_engine...
24509745818
from multiprocessing.dummy import Array from typing import List, Optional, Union from co2al_method.query_strategy import * import numpy as np import torch import os import xgboost as xgb from ray.tune.schedulers import ASHAScheduler from ray import tune from ray.tune.integration.xgboost import TuneReportCheckpointCallb...
longnguyenQB/Luanvan
Co2Al/co2al_method/ssl.py
ssl.py
py
9,848
python
en
code
0
github-code
71
[ { "api_name": "typing.Optional", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 15, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 15, "usage_type": "attribute" }, { "api_name": "torch.Tensor", "lin...
23083524053
import datetime import io import time import threading from types import ModuleType from typing import Union, Callable ALLOWED_DTYPES = [ int.__name__, float.__name__, bool.__name__, list.__name__, datetime.__name__, str.__name__ ] class Setpoint(object): """ A class to provide ...
aqueductfluidics/example_projects
aqueduct/setpoint.py
setpoint.py
py
2,266
python
en
code
0
github-code
71
[ { "api_name": "datetime.__name__", "line_number": 14, "usage_type": "attribute" }, { "api_name": "typing.Union", "line_number": 34, "usage_type": "name" }, { "api_name": "datetime.datetime", "line_number": 34, "usage_type": "attribute" }, { "api_name": "typing.Cal...
70649399589
from fastapi import FastAPI, APIRouter from ..services.email_service import create_token app = FastAPI() router = APIRouter() @router.post("/submit-email") def submit_email(email: dict = {}): to = email["email"] verification_link = create_token(to) print(verification_link) return {"message": "Em...
pag0dy/new-speecho
app/routers/email.py
email.py
py
376
python
en
code
0
github-code
71
[ { "api_name": "fastapi.FastAPI", "line_number": 4, "usage_type": "call" }, { "api_name": "fastapi.APIRouter", "line_number": 6, "usage_type": "call" }, { "api_name": "services.email_service.create_token", "line_number": 12, "usage_type": "call" } ]
31061647002
# -*- coding: utf-8 -*- """ Created on Fri Jan 18 14:38:39 2019 @author: Partha Kuila """ import pandas as pd #import numpy as np import datetime from pymongo import MongoClient #import pprint #import time #Client = MongoClient('mongodb://10.0.0.14:27017', # username = 'spectaus...
parthakuila/Python-Script-for-dump-excel-file-within-Database.
Invoice.py
Invoice.py
py
6,071
python
en
code
1
github-code
71
[ { "api_name": "pandas.read_excel", "line_number": 50, "usage_type": "call" }, { "api_name": "datetime.datetime.utcnow", "line_number": 59, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 59, "usage_type": "attribute" }, { "api_name": "dat...
2829459569
import os import xlrd import numpy as np import pandas as pd from sklearn.model_selection import train_test_split from keras.models import Sequential from keras.layers import Dense, Input def extract_data(type): book = xlrd.open_workbook('data.xlsx') sheet = book.sheet_by_name('Sheet1') data = [[sheet.cel...
Lahav1/human-agent-interaction-model
neural_net.py
neural_net.py
py
2,972
python
en
code
0
github-code
71
[ { "api_name": "xlrd.open_workbook", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.get_dummies", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 21, "usage_type": "call" }, { "api_name": "keras.models.Sequen...
19672520663
import dash from dash import html, dcc import dash_bootstrap_components as dbc app = dash.Dash(__name__,suppress_callback_exceptions = True, use_pages = True, external_stylesheets=[dbc.themes.SPACELAB]) server = app.server sidebar = dbc.Nav([ dbc.NavLink([ html.Div(page['name']...
DeyozJP/Rock-Analytics
rockapp.py
rockapp.py
py
1,495
python
en
code
0
github-code
71
[ { "api_name": "dash.Dash", "line_number": 7, "usage_type": "call" }, { "api_name": "dash_bootstrap_components.themes", "line_number": 8, "usage_type": "attribute" }, { "api_name": "dash_bootstrap_components.Nav", "line_number": 10, "usage_type": "call" }, { "api_n...
6995454409
import cv2 as cv import numpy as np # 均值模糊 def blur_demo(image): dst = cv.medianBlur(image,(5,5)) cv.imshow("blur_demo",dst) # 中值模糊(消除椒盐噪声) def median_demo(image): dst = cv.blur(image,5) cv.imshow("blur_demo",dst) # 自定义模糊 def custom_demo(image): kernel = np.ones([5,5],np.float32)/2...
zw161917/python-Study
Opencv学习/学习6.py
学习6.py
py
752
python
en
code
0
github-code
71
[ { "api_name": "cv2.medianBlur", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.blur", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 12, ...
1285875789
import time import h5py import json import sys import os import six import copy import argparse import torch import torchfields import numpy as np from pathlib import Path from tqdm import tqdm from cloudvolume import CloudVolume def get_dset_path(dst_folder, x_offset, y_offset, ...
seung-lab/metroem
metroem/download_field.py
download_field.py
py
9,607
python
en
code
5
github-code
71
[ { "api_name": "numpy.float32", "line_number": 53, "usage_type": "attribute" }, { "api_name": "h5py.File", "line_number": 72, "usage_type": "call" }, { "api_name": "h5py.File", "line_number": 99, "usage_type": "call" }, { "api_name": "numpy.transpose", "line_nu...
7525922410
from nst_zoo.nst_main import main from nst_zoo.config import NSTConfig import json import itertools import click from redis import Redis redis_connection = None def _get_redis_connection(host, port): global redis_connection if not redis_connection: redis_connection = Redis(host=host, port=port) r...
Nick-Morgan/nst-zoo
nst_zoo/batch_processing/io.py
io.py
py
2,830
python
en
code
0
github-code
71
[ { "api_name": "redis.Redis", "line_number": 14, "usage_type": "call" }, { "api_name": "click.group", "line_number": 18, "usage_type": "call" }, { "api_name": "redis.lpop", "line_number": 50, "usage_type": "call" }, { "api_name": "nst_zoo.nst_main.main", "line_...
39641426305
from functools import lru_cache from rdflib import URIRef, Literal, BNode, Graph from rdflib.store import Store as RdflibStore from rdflib.term import Identifier from six import iteritems from . import _PyQStore, _PyQStoreNode class ClassProperty(object): def __init__(self, fn): self.fn = fn def __g...
Rust-Linked-Data/qstore
pyqstore/pyqstore/memory.py
memory.py
py
13,060
python
en
code
5
github-code
71
[ { "api_name": "rdflib.store.Store", "line_number": 21, "usage_type": "name" }, { "api_name": "six.iteritems", "line_number": 52, "usage_type": "call" }, { "api_name": "rdflib.URIRef", "line_number": 110, "usage_type": "call" }, { "api_name": "rdflib.Literal", ...
22612077429
import unittest import numpy as np from scipy.io import wavfile import pyroomacoustics as pra np.random.seed(0) # We use several sound samples for each source to have a long enough length wav_files = [ [ "examples/input_samples/cmu_arctic_us_axb_a0004.wav", "examples/input_samples/cmu_arctic_us_...
LCAV/pyroomacoustics
pyroomacoustics/bss/tests/test_bss.py
test_bss.py
py
5,647
python
en
code
1,226
github-code
71
[ { "api_name": "numpy.random.seed", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pyroomacoustics.ShoeBox", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.conca...
73347728869
import streamlit as st from streamlit_webrtc import webrtc_streamer , WebRtcMode import av import cv2 st.title("My first Streamlit app") st.write("Hello, world") threshold1 = st.slider("Threshold1", min_value=0, max_value=1000, step=1, value=100) threshold2 = st.slider("Threshold2", min_value=0, max_value=...
mnojksyp28/My-first-Streamlit-app
app.py
app.py
py
893
python
en
code
0
github-code
71
[ { "api_name": "streamlit.title", "line_number": 7, "usage_type": "call" }, { "api_name": "streamlit.write", "line_number": 8, "usage_type": "call" }, { "api_name": "streamlit.slider", "line_number": 10, "usage_type": "call" }, { "api_name": "streamlit.slider", ...
477818441
import json from pathlib import Path not_show = [] with Path("智库website_all-website_list.txt", mode="r", encoding="utf-8").open() as f: for line in f: not_show.append(line.strip()) off_line = [] with Path("下线excel.txt", mode="r", encoding="utf-8").open() as f: for line in f: off_line.append(li...
fangtiansheng/test
test.py
test.py
py
512
python
en
code
0
github-code
71
[ { "api_name": "pathlib.Path", "line_number": 5, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 10, "usage_type": "call" } ]
27766986297
from inspect import * from pygraphviz import AGraph from collections import defaultdict from itertools import chain from relations import * def is_container(var): return isinstance(var, list) or isinstance(var, dict) or isinstance(var, set) def itercontainer(c): assert is_container(c) if isinstance(c, li...
windhaunting/Data_integration_graph-database_query
CreateGraph/GraphMatching/SpydeWks/Codes/lib/pycana/code_analyzer.py
code_analyzer.py
py
6,225
python
en
code
1
github-code
71
[ { "api_name": "collections.defaultdict", "line_number": 31, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 55, "usage_type": "call" }, { "api_name": "pygraphviz.AGraph", "line_number": 120, "usage_type": "call" }, { "api_name": "it...
10544920260
from urllib.parse import urlparse from core.libs import alert_bug , random_str, urlencoder, insert_to_params_name, Http from wordlists import XSS from modules import Scan class XssParam(Scan): def __init__(self, opts: dict, http: Http): super().__init__(opts, http) self.payloads = XSS(opts['blindxss...
Transmetal/scant3r
modules/python/xss_param/xss_param.py
xss_param.py
py
1,263
python
en
code
0
github-code
71
[ { "api_name": "modules.Scan", "line_number": 5, "usage_type": "name" }, { "api_name": "core.libs.Http", "line_number": 6, "usage_type": "name" }, { "api_name": "wordlists.XSS", "line_number": 8, "usage_type": "call" }, { "api_name": "core.libs.random_str", "li...
14120565099
import streamlit as st num = int(st.number_input("Input Number: ",value=0)) totalSum = 0 for i in range(1, num+1): totalSum += i st.write(f"Sum is: {totalSum}")
Sukury/2023BLA_XueqingHu_W3
W3_Q5.py
W3_Q5.py
py
168
python
en
code
0
github-code
71
[ { "api_name": "streamlit.number_input", "line_number": 3, "usage_type": "call" }, { "api_name": "streamlit.write", "line_number": 10, "usage_type": "call" } ]
27797415484
import importlib import torch import torch.nn as nn from torch.nn import init import torch.nn.functional as F from collections import OrderedDict from copy import deepcopy import wandb import numpy as np from os import path as osp from methods import networks as networks from methods.base_model import BaseModel from u...
ihaeyong/SoftNet-FSCIL
methods/AANet_topic_model.py
AANet_topic_model.py
py
21,889
python
en
code
6
github-code
71
[ { "api_name": "importlib.import_module", "line_number": 19, "usage_type": "call" }, { "api_name": "methods.base_model.BaseModel", "line_number": 21, "usage_type": "name" }, { "api_name": "methods.networks.define_net_g", "line_number": 36, "usage_type": "call" }, { ...
74159341350
import json import re from gensim.models import LdaModel from gensim.corpora import Dictionary from nltk.corpus import stopwords from textblob import TextBlob import os import json folder_path = "reddit_posts" combined_data = [] for filename in os.listdir(folder_path): if filename.endswith(".json"): file...
evelynforkhands/medical-AI
sentiment-topics.py
sentiment-topics.py
py
3,090
python
en
code
0
github-code
71
[ { "api_name": "os.listdir", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 1...
281499548
# This example demonstrates simple PCA-computation using CUDA-Solver library. import pycuda.autoinit from pycuda import gpuarray import numpy as np from skcuda import linalg vals = [np.float32([10, 0, 0, 0, 0, 0, 0, 0, 0, 0]), np.float32([0, 10, 0, 0, 0, 0, 0, 0, 0, 0])] for i in range(3000): vals.append(vals[0]...
sfefilatyev/cuda_python_examples
chapter7/pca_example.py
pca_example.py
py
687
python
en
code
2
github-code
71
[ { "api_name": "numpy.float32", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.random.randn", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.random.randn"...
70987203750
#!/usr/bin/env python # -*- coding: utf-8 -*- import urllib2 import flask def geturl (url): handle = urllib2.urlopen(url) buff = '' while True: chunk = handle.read(4096) if not chunk: break buff += chunk return buff app = flask.Flask(__name__) @app.route("/get", ...
osp/osp.work.the-riddle
html2print/proxy/proxy.py
proxy.py
py
589
python
en
code
0
github-code
71
[ { "api_name": "urllib2.urlopen", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 18, "usage_type": "call" }, { "api_name": "flask.request", "line_number": 22, "usage_type": "attribute" } ]
18925585666
import csv import os from twilio.rest import Client #TwilioRestClient import openpyxl AUTH_SID = '##########' # Twilio SID TEST_SID = '#########' # AUTH_TOKEN = '###########' # Twilio Token, --take out of public repo-- TEST_TOKEN = '###########' # test_mode = True if test_mode == False: token = AUTH_TOKEN ...
JapandrewM/MassText-with-GUI
main.py
main.py
py
1,209
python
en
code
0
github-code
71
[ { "api_name": "twilio.rest.Client", "line_number": 17, "usage_type": "call" }, { "api_name": "openpyxl.load_workbook", "line_number": 25, "usage_type": "call" } ]
74715660390
import csv, json abridged_data = [] with open('brazilstates.json','r') as file1: data = file1.read() brazil_data = json.loads(data) states_data = brazil_data['data'] for index, state in enumerate(states_data): if index != 0: state_dict = { 'weight': int(state['latest']) } ...
calvang/covid19-heatmap
src/dataset/processBrazilShort.py
processBrazilShort.py
py
864
python
en
code
0
github-code
71
[ { "api_name": "json.loads", "line_number": 7, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 18, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 27, "usage_type": "call" } ]
392252319
import torchvision from torchvision import transforms as T from torch.utils.data import DataLoader from torch.utils.tensorboard import SummaryWriter dataset_transform = T.Compose([ T.ToTensor(), T.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5)) ]) train_set = torchvision.datasets.CIFAR10('./dataset', tr...
Yuqi-Miao/learn_pytorch
study/6.py
6.py
py
1,043
python
en
code
0
github-code
71
[ { "api_name": "torchvision.transforms.Compose", "line_number": 6, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 6, "usage_type": "name" }, { "api_name": "torchvision.transforms.ToTensor", "line_number": 7, "usage_type": "call" }, { ...
26272513577
from django import forms from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.utils.translation import gettext_lazy as _ from .models import ApplicantProfile, CustomUser class ApplicantProfileForm(forms.ModelForm): phone_number = forms.IntegerField( required=False,...
xbandrade/py-4djobz
users/admin.py
admin.py
py
1,748
python
en
code
0
github-code
71
[ { "api_name": "django.forms.ModelForm", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 9, "usage_type": "name" }, { "api_name": "django.forms.IntegerField", "line_number": 10, "usage_type": "call" }, { "api_name": "djan...
40689732670
from flask import Flask, render_template, request app = Flask(__name__, template_folder = 'templates') @app.route("/") def index(): return render_template("index.html") @app.route("/hello", methods=["GET","POST"]) # This page can only be accessed after post. def hello(): if request.method == "GET": r...
bipinbohara/WEB
Flask/forms/application.py
application.py
py
464
python
en
code
0
github-code
71
[ { "api_name": "flask.Flask", "line_number": 3, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 12, "usage_type": "attribute" }, { "api_name": "flask.reque...
9075182361
import logging from event_matchs import EventMatchs from models.pos_models import PosReceiptEvent from helpers.datadog_helper import DatadogHelper from helpers.lambda_helper import LambdaHelper matcher = EventMatchs() logger = logging.getLogger() logger.setLevel(logging.INFO) def function_handler(event, _): print...
collicesar/poc-sbo2premia
lambdas/pos-receipt-event/handler.py
handler.py
py
943
python
en
code
0
github-code
71
[ { "api_name": "event_matchs.EventMatchs", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 9, "usage_type": "attribute" }, { "api_name": "models.pos_...
6644702619
import os from random import randint import telebot bot = telebot.TeleBot(os.environ["BOT_TOKEN"]) @bot.message_handler(commands=["start", "help"]) def send_welcome(message): return bot.reply_to( message, "Напишите мне размеры картинки через пробел\n" "Числа должны быть натуральными, не ...
fmgoncharov/PhaseWatch
phase_watch_bot.py
phase_watch_bot.py
py
1,566
python
ru
code
0
github-code
71
[ { "api_name": "telebot.TeleBot", "line_number": 6, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 6, "usage_type": "attribute" }, { "api_name": "random.randint", "line_number": 35, "usage_type": "call" } ]
11343896082
''' Given a binary tree, return the vertical order traversal of its nodes' values. (ie, from top to bottom, column by column). If two nodes are in the same row and column, the order should be from left to right. Examples 1: Input: [3,9,20,null,null,15,7] 3 /\ / \ 9 20 /\ / \ 15 7 Output: [ ...
chutianwen/LeetCodes
LeetCodes/facebook/BinaryTreeVerticalOrderTraversal.py
BinaryTreeVerticalOrderTraversal.py
py
3,602
python
en
code
0
github-code
71
[ { "api_name": "collections.deque", "line_number": 91, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 194, "usage_type": "call" } ]
26976045414
from typing import List import numpy as np import pandas as pd from sklearn.model_selection import GroupKFold from tqdm import tqdm from vivid.featureset.atoms import AbstractAtom class TargetEncodingAtom(AbstractAtom): n_fold = 10 def __init__(self, use_columns: List[str]): super(TargetEncodingAtom...
nyk510/kaggle-days-tokyo-2019
kaggle_days/atoms/encoding.py
encoding.py
py
2,030
python
en
code
3
github-code
71
[ { "api_name": "vivid.featureset.atoms.AbstractAtom", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 13, "usage_type": "name" }, { "api_name": "sklearn.model_selection.GroupKFold", "line_number": 21, "usage_type": "call" }, { ...
39191278925
__package__ = "tica" __author__ = 'Michael Fausnaugh' import logging import platform import locale import sys import os.path fstem = os.path.abspath(os.path.dirname(__file__) + '/../') with open(os.path.join(fstem, 'VERSION'),'r') as infile: version = infile.read() def platform_info(): lines = [] lines.a...
mmfausnaugh/tica
tica/__init__.py
__init__.py
py
1,380
python
en
code
5
github-code
71
[ { "api_name": "os.path.path.abspath", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path", "line_number": 10, "usage_type": "name" }, { "api_name": "os.path.path.dirname",...
71397890150
import torch from mmselfsup.models.heads import (ClsHead, ContrastiveHead, LatentClsHead, LatentPredictHead, MultiClsHead, SwAVHead) def test_cls_head(): # test ClsHead head = ClsHead() fake_cls_score = [torch.rand(4, 3)] fake_gt_label = torch.randint(0, 2, (4, )) ...
cliangyu/CSVAL
selection/tests/test_models/test_heads.py
test_heads.py
py
2,027
python
en
code
30
github-code
71
[ { "api_name": "mmselfsup.models.heads.ClsHead", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.rand", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.randint", "line_number": 11, "usage_type": "call" }, { "api_name": "mmselfsup.mode...
18400893096
import os from typing import List import matplotlib.pyplot as plt import numpy as np import pandas as pd from pandas import DataFrame from domain.contracts.abstract_output_graphs_plot import AbstractOutputGraphsPlot from domain.models.evaluation_job_parameters import EvaluationJobParameters class HistogramPlot(Abst...
BMW-InnovationLab/SORDI-AI-Evaluation-GUI
src/application/output_graphs/plots/histogram_plot.py
histogram_plot.py
py
3,286
python
en
code
69
github-code
71
[ { "api_name": "domain.contracts.abstract_output_graphs_plot.AbstractOutputGraphsPlot", "line_number": 13, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 14, "usage_type": "attribute" }, { "api_name": "domain.models.evaluation_job_parameters.EvaluationJobParam...
13684432708
import sys import argparse import datetime import logging import subprocess from pathlib import Path from typing import Optional, Tuple from mbed_tools_ci_scripts.license_files import add_licence_header from mbed_tools_ci_scripts.generate_docs import generate_documentation from mbed_tools_ci_scripts.generate_news imp...
ARMmbed/mbed-tools-ci-scripts
mbed_tools_ci_scripts/tag_and_release.py
tag_and_release.py
py
7,377
python
en
code
2
github-code
71
[ { "api_name": "logging.getLogger", "line_number": 29, "usage_type": "call" }, { "api_name": "mbed_tools_ci_scripts.utils.definitions.CommitType", "line_number": 32, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 32, "usage_type": "name" }, { ...
3802690811
# import the MongoClient class from pymongo import MongoClient import json # build a new client instance of MongoClient mongo_client = MongoClient('mongodb+srv://research-project:cGeNVHwDOQBIjXAM@cluster0.mrfjn.mongodb.net/clients?retryWrites=true&w=majority') # create new database and collection instance db = mongo_...
Concussion-Research-Project/Applied-Project-and-Minor-Dissertation
Development Research/Project_Database/deleteClient.py
deleteClient.py
py
704
python
en
code
1
github-code
71
[ { "api_name": "pymongo.MongoClient", "line_number": 6, "usage_type": "call" } ]
7714817080
##This has been made by M Dhruv and Pabitra Sharma for NNLS final term project #Import Statements import pandas as pd import numpy as np import re from sklearn import svm data = pd.read_csv('database_UCI.csv',encoding = 'unicode_escape',keep_default_na=False) #Making Inputs lst = [] unwanted = ['=','http','@','ly','__...
DhruvMeduri/NNLS-Project
spam_filter_demo.py
spam_filter_demo.py
py
3,732
python
en
code
0
github-code
71
[ { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.random.shuffle", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 17, "usage_type": "attribute" }, { "api_name": "re.split", ...
70028863589
import argparse from typing import List, Dict, Tuple import torch from numpy.typing import NDArray import numpy as np class QuantizedTensor: def __init__(self, input_tensor: torch.Tensor, bits: int = 8): self.bits = bits self.min_val = input_tensor.min() self.max_val = input_tensor.max() ...
BurakGurbuz97/SHARP-Continual-Learning
Source/memory.py
memory.py
py
4,128
python
en
code
2
github-code
71
[ { "api_name": "torch.Tensor", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.round", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.uint8", "line_number": 23, "usage_type": "attribute" }, { "api_name": "torch.float32", "l...
39960150864
# -*- coding: utf-8 -*- """ Created on Sat Apr 22 02:22:14 2017 original source: https://github.com/lazyprogrammer/machine_learning_examples/tree/master/linear_regression_class @author: tsann """ import numpy as np import matplotlib.pyplot as plt import pandas as pd #loadd data X = [] Y = [] df = pd.r...
ytphua/neural-network-journey
10_linear_regression/10-linear-regression-poly-blood.py
10-linear-regression-poly-blood.py
py
983
python
en
code
0
github-code
71
[ { "api_name": "pandas.read_excel", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.scatter", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 19, "usage_type": "name" }, { "api_name": "matplot...
44577587163
from flask import request, render_template, current_app, jsonify, send_file, flash from app import app from app.library.controller import DownloadBook @app.route("/search-books") def search_books(): base_url = current_app.config["BASE_URI"] search_url = current_app.config["SEARCH_URI"] search_query = requ...
hashims/bookberry
app/library/views.py
views.py
py
1,212
python
en
code
0
github-code
71
[ { "api_name": "flask.current_app.config", "line_number": 8, "usage_type": "attribute" }, { "api_name": "flask.current_app", "line_number": 8, "usage_type": "name" }, { "api_name": "flask.current_app.config", "line_number": 9, "usage_type": "attribute" }, { "api_na...
73156573671
import pytest # type: ignore import unittest.mock as mock import sys import datetime from decimal import Decimal import os # import urllib.parse # from bs4 import BeautifulSoup # type: ignore sys.path.append(os.path.realpath(os.path.dirname(__file__) + "/../src")) # import app # noqa: E402 # import sigprobs # noq...
AntiCompositeNumber/signatures
tests/test_datasources.py
test_datasources.py
py
4,210
python
en
code
1
github-code
71
[ { "api_name": "sys.path.append", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_nu...
23024327819
import scipy import numpy as np import os import os.path import pandas import scipy.ndimage import matplotlib.pyplot as plt import matplotlib.patches as patches from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from tiling import TileCounter from functools import reduce from label import * d...
aregic/license_plate_recognition
inspect_images.py
inspect_images.py
py
15,303
python
en
code
0
github-code
71
[ { "api_name": "numpy.shape", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.shape", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.shape", "line_number": ...
535863261
# Name: RenameVideo.py # # file traversal was based on work by # Author: Brian Klug (@nerdtalker / brian@brianklug.org) #https://gist.github.com/nerdtalker/4187084 # Purpose: #Rename still images as yyyy-mm-dd-hh-mm-ss-#### where #### is the existing sequence no # using EXIF data # # rename movie files to V##_start da...
ghillebrand/PhotoTransfer
Rename&TransferMedia.py
Rename&TransferMedia.py
py
27,249
python
en
code
0
github-code
71
[ { "api_name": "datetime.datetime", "line_number": 89, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 101, "usage_type": "call" }, { "api_name": "exifread.process_file", "line_number": 128, "usage_type": "call" }, { "api_name": "datetime.datetim...
2591822280
"""Tests for root marathon specific to frameworks and readinessChecks """ import apps import time import shakedown from datetime import timedelta from dcos import marathon from dcos.errors import DCOSUnprocessableException def test_deploy_custom_framework(): """Launches an app that has necessary elements to cre...
shendabin/marathon
tests/system/dcos_service_marathon_tests.py
dcos_service_marathon_tests.py
py
3,307
python
en
code
0
github-code
71
[ { "api_name": "dcos.marathon.create_client", "line_number": 17, "usage_type": "call" }, { "api_name": "dcos.marathon", "line_number": 17, "usage_type": "name" }, { "api_name": "apps.fake_framework", "line_number": 18, "usage_type": "call" }, { "api_name": "shakedo...
8732080745
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ Created on Mon Apr 9 17:31:52 2018 @author: zhangp """ import cv2 import numpy as np import os def total_number_function(input_path, cut_off, area_data, screen_ratio): input_file_path = os.path.dirname(input_path) input_file_name = os.path.basename(input_path...
zpeng1989/Cell_number
MAIN/cellnumber.py
cellnumber.py
py
2,585
python
en
code
5
github-code
71
[ { "api_name": "os.path.dirname", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.path.basename", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_num...
1190940310
from cozmohttpclient import CozmoHttpClient import cozmo import asyncio class CozmoAlexa: def __init__(self): self._client = CozmoHttpClient() async def run(self, coz_conn:cozmo.conn.CozmoConnection): self._robot = await coz_conn.wait_for_robot() self._robot.set_robot_volume(1...
Wizards-of-Coz/Alexa-Playground
cozmoSrc/cozmoalexa.py
cozmoalexa.py
py
1,271
python
en
code
0
github-code
71
[ { "api_name": "cozmohttpclient.CozmoHttpClient", "line_number": 8, "usage_type": "call" }, { "api_name": "cozmo.conn", "line_number": 10, "usage_type": "attribute" }, { "api_name": "asyncio.sleep", "line_number": 16, "usage_type": "call" }, { "api_name": "cozmo.an...
6063756772
from typing import Tuple, List import warnings from collections import OrderedDict, defaultdict from typing import Union import abc from tqdm import tqdm import numpy as np from scipy.optimize import minimize from scipy.special import logit as safe_logit import torch import torch.nn as nn from torch.utils.data import...
EFS-OpenSource/calibration-framework
netcal/scaling/AbstractLogisticRegression.py
AbstractLogisticRegression.py
py
39,684
python
en
code
286
github-code
71
[ { "api_name": "netcal.AbstractCalibration", "line_number": 27, "usage_type": "name" }, { "api_name": "torch.float16", "line_number": 101, "usage_type": "attribute" }, { "api_name": "torch.float32", "line_number": 102, "usage_type": "attribute" }, { "api_name": "to...