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
35691108201
import os import sys import hashlib from datetime import datetime from collections import namedtuple import pandas as pd Row = namedtuple('Row', 'path filename date_created date_modified byte_size hash') def get_directory_info(starting_directory=None, hash_flag=False): results = [] if not starting_directory:...
danshorstein/isaca_presentation_2018
services/__init__.py
__init__.py
py
1,495
python
en
code
0
github-code
97
[ { "api_name": "collections.namedtuple", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.walk", "lin...
23416718898
""" LOL - a bit underwhelming in the case of CLI output. """ from pathlib import Path from superhelp import gen_utils def display(formatted_help: str, file_path: Path): if file_path: raw_file_name = gen_utils.clean_path_name(file_path) file_name = f'{raw_file_name}.md' else: file_name ...
grantps/superhelp
superhelp/displayers/md_displayer.py
md_displayer.py
py
641
python
en
code
28
github-code
97
[ { "api_name": "pathlib.Path", "line_number": 8, "usage_type": "name" }, { "api_name": "superhelp.gen_utils.clean_path_name", "line_number": 10, "usage_type": "call" }, { "api_name": "superhelp.gen_utils", "line_number": 10, "usage_type": "name" }, { "api_name": "s...
7104238793
# -*- coding: utf-8 -*- # @Time : 8/17/22 6:00 PM # @FileName: Bot.py # @Software: PyCharm # @Github :sudoskys import os import shutil import time import joblib from Runner.DataParse import biliParse from Runner.EventLib import Tool from Runner.Network.Uploader import Upload class CallingCounter(object): d...
sudoskys/Tool-Asoul-Music
Runner/Bot.py
Bot.py
py
5,173
python
en
code
43
github-code
97
[ { "api_name": "time.strftime", "line_number": 21, "usage_type": "call" }, { "api_name": "time.localtime", "line_number": 21, "usage_type": "call" }, { "api_name": "joblib.load", "line_number": 38, "usage_type": "call" }, { "api_name": "joblib.dump", "line_numb...
26333749564
import os from mock import patch import pytest from opentrons.system import camera @pytest.fixture def mock_take_picture(): with patch( "robot_server.service.legacy.routers." "camera.camera.take_picture", spec=camera.take_picture, ) as m: yield m def test_camera_exception(mock_take_p...
Opentrons/opentrons
robot-server/tests/service/legacy/routers/test_camera.py
test_camera.py
py
1,235
python
en
code
363
github-code
97
[ { "api_name": "mock.patch", "line_number": 9, "usage_type": "call" }, { "api_name": "opentrons.system.camera.take_picture", "line_number": 11, "usage_type": "attribute" }, { "api_name": "opentrons.system.camera", "line_number": 11, "usage_type": "name" }, { "api_n...
28933648010
import json import os from HealthcheckHTTP import HealthcheckHTTP from HealthcheckPort import HealthcheckPort from HealthcheckPing import HealthcheckPing class Levande: def __init__(self): configFilePath = os.getenv("LEVANDE_CONFIG_FILE", 'config/levande.json') configFile = open(configFilePath) ...
patrickvogel/levande
src/python/Levande.py
Levande.py
py
1,223
python
en
code
0
github-code
97
[ { "api_name": "os.getenv", "line_number": 9, "usage_type": "call" }, { "api_name": "json.load", "line_number": 11, "usage_type": "call" }, { "api_name": "HealthcheckHTTP.HealthcheckHTTP", "line_number": 18, "usage_type": "call" }, { "api_name": "HealthcheckPort.He...
6706221011
from django import template register = template.Library() @register.assignment_tag(takes_context=True) def get_pretestupload(context, pretest): for pretestupload in pretest.pretestupload_set.all(): if context['request'].user == pretestupload.student.user: return pretestupload return None
mijara/adn3
students/templatetags/pretest.py
pretest.py
py
319
python
en
code
0
github-code
97
[ { "api_name": "django.template.Library", "line_number": 3, "usage_type": "call" }, { "api_name": "django.template", "line_number": 3, "usage_type": "name" } ]
14597992450
import random from functools import cmp_to_key import matplotlib.pyplot as plt import numpy as np import pandas as pd import scipy.cluster.hierarchy as hie import settings as st def calculateSimilarity(a, b): ref = -1 for i in range(0, st.AP_COUNT): if a[i] != 1 and b[i] != 1: ref = i ...
Simon-CN/EZIndoorLocPy
locselect.py
locselect.py
py
2,721
python
en
code
0
github-code
97
[ { "api_name": "settings.AP_COUNT", "line_number": 14, "usage_type": "attribute" }, { "api_name": "settings.AP_COUNT", "line_number": 25, "usage_type": "attribute" }, { "api_name": "scipy.cluster.hierarchy.distance.pdist", "line_number": 36, "usage_type": "call" }, { ...
37214640888
import json class Redirection: url = None method = None query_params = None body_params = None header_params = None def __init__(self, url: str, method: str, query_params: dict=None, body_params: dict=None, h...
meyt/payit
payit/redirection.py
redirection.py
py
773
python
en
code
14
github-code
97
[ { "api_name": "json.dumps", "line_number": 30, "usage_type": "call" } ]
20897313316
from django.test import Client, TestCase from django.urls import reverse from posts.models import Follow, Group, Post, User GROUP_SLUG = 'test_group' AUTHOR_USERNAME = 'test_user' FOLLOW_URL = reverse('follow_index') class PostPagesTests(TestCase): @classmethod def setUpClass(cls): super().setUpCla...
RomanK74/hw05_final
posts/tests/test_follow.py
test_follow.py
py
2,631
python
en
code
0
github-code
97
[ { "api_name": "django.urls.reverse", "line_number": 9, "usage_type": "call" }, { "api_name": "django.test.TestCase", "line_number": 12, "usage_type": "name" }, { "api_name": "posts.models.User.objects.create_user", "line_number": 16, "usage_type": "call" }, { "api...
7017674630
import logging import boto3 import json # Constants DEBUG = False MAX_KEYS = 1024 # Should be a power of two since it may get divided by two a couple of times. MAX_DATA_SIZE = 32000 # Max. result size: https://docs.aws.amazon.com/step-functions/latest/dg/service-limits.html SAFETY_MARGIN = 10.0 # Percent MAX_RESU...
aws-samples/sync-buckets-state-machine
lambda_functions/list_bucket.py
list_bucket.py
py
2,611
python
en
code
112
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 19, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 21, "usage_type": "attribute" }, { "api_name": "logging.INFO", "line_number": 23, "usage_type": "attribute" }, { "api_name": "boto3.client",...
34555487118
import os import dj_database_url from .base import * DEBUG = os.getenv('DEBUG') DATABASES = { 'default': dj_database_url.config( engine='django.contrib.gis.db.backends.postgis', default=os.environ['DATABASE_URL'] ) } CELERY_BROKER_URL = os.environ['REDIS_URL'], CELERY_RESULT_BACKEND = os.envi...
Livingstone99/proppexx-backend
propexx/settings/production.py
production.py
py
511
python
en
code
0
github-code
97
[ { "api_name": "os.getenv", "line_number": 5, "usage_type": "call" }, { "api_name": "dj_database_url.config", "line_number": 8, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.environ", "line...
11113379818
import os import keyboard import pyautogui import webbrowser from listen import Listen from speak import speak from time import sleep import datetime def Open(q): application_mapping = { "vscode": "Visual Studio Code", "chrome": "Google Chrome", "cmd": "Command Prompt", ...
Vigneshpalan/Jarvis-voice-Assistant
open.py
open.py
py
1,409
python
en
code
0
github-code
97
[ { "api_name": "webbrowser.open", "line_number": 26, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 30, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 30, "usage_type": "attribute" }, { "api_name": "speak.sp...
20110275811
import sys from datetime import date from typing import ( List, Optional, ) from pydantic import ( AnyUrl, BaseModel, Field, ) from selenium.webdriver.remote.webelement import WebElement from cr_kyoushi.simulation.util import now from ..core.config import ProbabilisticStateConfig from ..core.sel...
ait-aecid/kyoushi-statemachines
src/cr_kyoushi/statemachines/web_browser/config.py
config.py
py
5,770
python
en
code
1
github-code
97
[ { "api_name": "sys.version_info", "line_number": 26, "usage_type": "attribute" }, { "api_name": "pydantic.BaseModel", "line_number": 42, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 45, "usage_type": "name" }, { "api_name": "pydantic.AnyUrl"...
24885854331
from .common import PostProcessor import os class ComparePP(PostProcessor): def __init__(self, job, options): PostProcessor.__init__(self, job) if options.get("shallow"): self._compare = self._compare_size job.register_hooks({"file": ( self.enumerate i...
prodbydaniel245/gallery-dl
gallery_dl/postprocessor/compare.py
compare.py
py
1,559
python
en
code
3
github-code
97
[ { "api_name": "common.PostProcessor", "line_number": 5, "usage_type": "name" }, { "api_name": "common.PostProcessor.__init__", "line_number": 8, "usage_type": "call" }, { "api_name": "common.PostProcessor", "line_number": 8, "usage_type": "name" }, { "api_name": "...
33888041627
import gym, os import Env as envr from Env import Env import CS import setting as st import matplotlib.pyplot as plt from Graph import Graph_34 import datetime import random import itertools import numpy as np import gym import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim fro...
walkingholic/EV_ppo
main_ppo_ppangyo.py
main_ppo_ppangyo.py
py
10,538
python
en
code
1
github-code
97
[ { "api_name": "setting.N_REQ", "line_number": 24, "usage_type": "attribute" }, { "api_name": "torch.cuda.is_available", "line_number": 29, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 29, "usage_type": "attribute" }, { "api_name": "torch.devi...
27828440028
from django.shortcuts import render from .models import Data from django.views.generic import CreateView from .forms import ContactForm class ContactCreate(CreateView): # Модель куда выполняется сохранение model = Data # Класс на основе которого будет валидация полей form_class = ContactForm # Выве...
zaryava/contact_v.4
webcontact/contact/views.py
views.py
py
1,018
python
ru
code
0
github-code
97
[ { "api_name": "django.views.generic.CreateView", "line_number": 6, "usage_type": "name" }, { "api_name": "models.Data", "line_number": 8, "usage_type": "name" }, { "api_name": "forms.ContactForm", "line_number": 10, "usage_type": "name" }, { "api_name": "models.Da...
27923466892
from django.http import HttpResponseRedirect from django.urls import reverse from django.contrib import messages from django.utils.translation import ugettext_lazy as _ from annoying.decorators import render_to from blockexplorer.decorators import assert_valid_coin_symbol from blockexplorer.settings import BLOCKCYPHE...
blockcypher/explorer
blocks/views.py
views.py
py
5,478
python
en
code
962
github-code
97
[ { "api_name": "blockcypher.utils.is_valid_hash", "line_number": 35, "usage_type": "call" }, { "api_name": "django.utils.translation.ugettext_lazy", "line_number": 38, "usage_type": "call" }, { "api_name": "django.contrib.messages.warning", "line_number": 39, "usage_type":...
26167849232
from numpy import * import matplotlib matplotlib.use("TkAgg") from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg from matplotlib.figure import Figure from tkinter import * import reg_trees def re_draw(tol_s, tol_n): re_draw.f.clf() re_draw.a = re_draw.f.add_subplot(111) if chk_btn_var.get():...
raesnow/ML_Learn
09-tree_regression/tree_explore.py
tree_explore.py
py
2,328
python
en
code
1
github-code
97
[ { "api_name": "matplotlib.use", "line_number": 3, "usage_type": "call" }, { "api_name": "reg_trees.create_tree", "line_number": 17, "usage_type": "call" }, { "api_name": "reg_trees.model_leaf", "line_number": 17, "usage_type": "attribute" }, { "api_name": "reg_tre...
22684794105
import os import glob from datetime import datetime from flask import request, render_template, redirect, url_for from werkzeug.utils import secure_filename from snap_shopusingai.project import app from snap_shopusingai.project.com.controller.LoginController import adminLoginSession, adminLogoutSession from snap_shop...
veer-cyber/Research-methodology
snap_shopusingai/project/com/controller/MainController.py
MainController.py
py
5,399
python
en
code
0
github-code
97
[ { "api_name": "snap_shopusingai.project.app.config", "line_number": 16, "usage_type": "attribute" }, { "api_name": "snap_shopusingai.project.app", "line_number": 16, "usage_type": "name" }, { "api_name": "snap_shopusingai.project.com.controller.LoginController.adminLoginSession",...
39997472706
import numpy as np import gudhi from scipy.sparse import csr_matrix from gtda.time_series import SingleTakensEmbedding from gtda.graphs import GraphGeodesicDistance from gtda.homology import FlagserPersistence def persistence(time_series, emdim, tilay, homdim = [0]): ''' Berechnung des Persistenz Diagrams ein...
paulgerhard4/persistent-dynamics
persistent dynamics/change_point_det/functions.py
functions.py
py
2,508
python
de
code
0
github-code
97
[ { "api_name": "gtda.time_series.SingleTakensEmbedding", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.argsort", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 24, "usage_type": "call" }, { "api_name": "sci...
75103189118
#!/usr/bin/python """corgi is a simple utility for quick capture to an org-mode file (or any text file really), and sync between an org file and mobile devices. Command line options: - taskpapersync All tasks scheduled for today or tomorrow get written to `today.taskpaper` and `tomorrow.taskpaper` respectively, and al...
el-ethan/corgi
corgi.py
corgi.py
py
5,741
python
en
code
3
github-code
97
[ { "api_name": "kivy.uix.behaviors.EmacsBehavior", "line_number": 36, "usage_type": "name" }, { "api_name": "kivy.uix.behaviors.CodeNavigationBehavior", "line_number": 36, "usage_type": "name" }, { "api_name": "psutil.Process", "line_number": 51, "usage_type": "call" }, ...
29341944279
import simplemma import pymorphy3 import re from functools import lru_cache import unicodedata PYMORPHY_SUPPORT = [] morph = {} try: import pymorphy3_dicts_ru morph['ru'] = pymorphy3.MorphAnalyzer(path=pymorphy3_dicts_ru.get_path(), lang="ru") PYMORPHY_SUPPORT.append("ru") print("pymorphy3 is available...
FreeLanguageTools/vocabsieve
vocabsieve/lemmatizer.py
lemmatizer.py
py
3,052
python
en
code
216
github-code
97
[ { "api_name": "pymorphy3.MorphAnalyzer", "line_number": 11, "usage_type": "call" }, { "api_name": "pymorphy3_dicts_ru.get_path", "line_number": 11, "usage_type": "call" }, { "api_name": "pymorphy3.MorphAnalyzer", "line_number": 19, "usage_type": "call" }, { "api_n...
2843811456
#!/usr/bin/env python # coding=utf-8 """ 随机生成各种颜色的小方块 """ import numpy import matplotlib.pyplot N = 512 NSQUARES = 85 #初始化 img = numpy.zeros((N, N), numpy.uint8) centers = numpy.random.random_integers(0, N, size=(NSQUARES, 2)) radii = numpy.random.randint(0, N/9, size=NSQUARES) colors = numpy.random.randint(100, 255...
qiwsir/ApproachPython
mergeimages/load_image_memory.py
load_image_memory.py
py
1,038
python
en
code
63
github-code
97
[ { "api_name": "numpy.zeros", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 14, "usage_type": "attribute" }, { "api_name": "numpy.random.random_integers", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.rando...
29963694701
from django.shortcuts import render,redirect,get_object_or_404 from django.views.generic import ListView,View # https://docs.djangoproject.com/en/3.1/ref/class-based-views/generic-editing/ from django.views.generic.edit import CreateView,DeleteView,UpdateView from django.contrib.auth.mixins import LoginRequiredMixin fr...
manoj-mv/django-dj4e
autos_dj4e/views.py
views.py
py
4,512
python
en
code
0
github-code
97
[ { "api_name": "django.contrib.auth.mixins.LoginRequiredMixin", "line_number": 12, "usage_type": "name" }, { "api_name": "django.views.generic.ListView", "line_number": 12, "usage_type": "name" }, { "api_name": "models.Auto", "line_number": 13, "usage_type": "name" }, ...
37512141401
from captcha import get_Code import requests from lxml import etree import re,os,sys BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(BASE_DIR) from conf import settings import movie_list def captcha_way(): session = parse_captcha() movie_list.movice_lists(session) def pa...
foremostxiao/Reptile_training
captcha/test.py
test.py
py
2,378
python
en
code
1
github-code
97
[ { "api_name": "os.path.dirname", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path.append", "line...
70205875520
import cv2 import os import numpy as np import tkinter.filedialog from tkinter import * import shutil import corner_dets_methods import datetime import tkinter as tk from time import sleep from math import trunc from tkinter import ttk good_total = 0 class AutoApp: def __init__(self, master): self.master ...
ttruty/mmse_pentagon_project
automated_pentagons.py
automated_pentagons.py
py
3,575
python
en
code
0
github-code
97
[ { "api_name": "tkinter.filedialog.filedialog.askopenfilename", "line_number": 35, "usage_type": "call" }, { "api_name": "tkinter.filedialog.filedialog", "line_number": 35, "usage_type": "attribute" }, { "api_name": "tkinter.filedialog", "line_number": 35, "usage_type": "n...
38342062928
import pytest from pcapi.core.bookings.exceptions import CannotDeleteVenueWithBookingsException import pcapi.core.bookings.factories as bookings_factories from pcapi.core.bookings.models import Booking import pcapi.core.criteria.factories as criteria_factories import pcapi.core.criteria.models as criteria_models from ...
bruno-ebstein-pass-culture/pass-culture-main
api/tests/scripts/offerer/delete_cascade_venue_by_id_test.py
delete_cascade_venue_by_id_test.py
py
9,393
python
en
code
null
github-code
97
[ { "api_name": "pcapi.core.bookings.factories.BookingFactory", "line_number": 34, "usage_type": "call" }, { "api_name": "pcapi.core.bookings.factories", "line_number": 34, "usage_type": "name" }, { "api_name": "pytest.raises", "line_number": 38, "usage_type": "call" }, ...
15456578581
from bs4 import BeautifulSoup from icrawler.builtin import BingImageCrawler from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.firefox.firefox_binary import FirefoxBinary from selenium.webdriver.firefox.firefox_profile import FirefoxProfile from selenium.webdriver.support...
YA-androidapp/Selenium-Talent
main.py
main.py
py
18,701
python
en
code
0
github-code
97
[ { "api_name": "os.path.dirname", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_number": 23, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 23, "usage_type": "call" }, { "api_name": "os.chdir", "line_num...
6618642721
from collections import deque n = int(input()) num = list(map(int, input().split())) dp = [1 for i in range(n)] arr = [[x] for x in num] for i in range(n): for j in range(i): if num[i] > num[j] and dp[j] + 1 > dp[i]: dp[i] = dp[j] + 1 idx=dp.index(max(dp)) now=dp[idx] queue=deque() queue.appen...
AMYMEME/algorithm-study
common/2021.05.04/leesoeun98_baekjoon14002.py
leesoeun98_baekjoon14002.py
py
463
python
en
code
0
github-code
97
[ { "api_name": "collections.deque", "line_number": 14, "usage_type": "call" } ]
19656763328
# 15.1. 15.2. import matplotlib.pyplot as plt x_values = list(range(1, 5001)) y_values = [x**3 for x in x_values] plt.scatter(x_values, y_values, c=y_values, cmap='Greens', edgecolor='none', s=30) # Zdefiniowanie tytulu wykresu i etykiet osi. plt.title("Szesciany liczb", fontsize=24) plt.xlabel("Wartosc"...
wojcikkuba/python_datafun
mpl_cubes.py
mpl_cubes.py
py
478
python
pl
code
0
github-code
97
[ { "api_name": "matplotlib.pyplot.scatter", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 8, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.title", "line_number": 11, "usage_type": "call" }, { "api_name": "mat...
2862130304
import sys import csv import math from argparse import ArgumentParser from statsmodels.stats.power import FTestPower arguments = ArgumentParser() arguments.add_argument('--fstat', type=float, help='F-statistic (F0) reported') arguments.add_argument('--m', type=int, help='...
jerome-white/sakai-book
chapters/07/2waynorep.py
2waynorep.py
py
1,237
python
en
code
2
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 26, "usage_type": "call" }, { "api_name": "statsmodels.stats.power.FTestPower", "line_number": 34, "usage_type": "call" }, { "api_name": "m...
16891166341
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('stories', '0004_auto_20141129_1325'), ] operations = [ migrations.CreateModel( name='NounCount', fie...
mattwaite/CanvasStoryArchive
stories/migrations/0005_auto_20141129_1632.py
0005_auto_20141129_1632.py
py
1,148
python
en
code
6
github-code
97
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.CreateModel", "line_number": 14, "usage_type": "call" }, ...
70790698880
#사이킷런 데이터셋 이용 / LSTM 으로 모델링 / Dense와 성능 비교 / 회귀모델 import numpy as np from sklearn.datasets import load_diabetes #당뇨병 수준 #데이터 불러오고 , 이건 사이킷런의 데이터 불러오는 방법 dataset = load_diabetes() x = dataset.data y = dataset.target print(x.shape, y.shape) #(442, 10) (442,) #트레인 테스트 분리 from sklearn.model_selection import train_test_...
bughunt88/AI_Study
keras/keras33_LSTM2_diabetes.py
keras33_LSTM2_diabetes.py
py
2,669
python
en
code
4
github-code
97
[ { "api_name": "sklearn.datasets.load_diabetes", "line_number": 7, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 15, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 17, "usa...
26896134446
from django.shortcuts import render, redirect from django.contrib import messages from course.brain.stage_two import * from django.contrib.auth.decorators import login_required from course.brain.main import all_tables @login_required def index(request): return render(request, 'index.html') def login(request): ...
VladYura/Course-site
course/views.py
views.py
py
2,209
python
en
code
0
github-code
97
[ { "api_name": "django.shortcuts.render", "line_number": 10, "usage_type": "call" }, { "api_name": "django.contrib.auth.decorators.login_required", "line_number": 8, "usage_type": "name" }, { "api_name": "django.shortcuts.render", "line_number": 14, "usage_type": "call" ...
10724352062
import requests # API endpoint API_ENDPOINT = "http://127.0.0.1:5000/" # image path IMAGE_PATH = "test/tas.jpg" resp = requests.post(url = API_ENDPOINT, files={'file': open(IMAGE_PATH, 'rb')}) print(resp.json()) # import base64 # with open('test/lamp.JPG', "rb") as image_file: # ...
IndoVision-Team/deploy-model
test/test.py
test.py
py
763
python
en
code
0
github-code
97
[ { "api_name": "requests.post", "line_number": 8, "usage_type": "call" } ]
31679570378
import pandas as pd import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from sklearn.ensemble import RandomForestClassifier from sklearn.neighbors import KNeighborsClassifier from sklearn import preprocessing from sklearn.model_selection import cross_val_score import keras from keras.models imp...
tms1337/tensorflow-tutorial
noise-removal.py
noise-removal.py
py
4,193
python
en
code
0
github-code
97
[ { "api_name": "config.config.config", "line_number": 26, "usage_type": "name" }, { "api_name": "config.config.config", "line_number": 28, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 29, "usage_type": "call" }, { "api_name": "pandas.read...
9996911459
from django.shortcuts import render , HttpResponse import pandas as pd import requests from import_export.admin import ImportExportModelAdmin import openpyxl from geopy.geocoders import Nominatim import googlemaps def home(request): if request.method == "POST": file = request.FILES["myFile"] wb = ...
ankita1304/project_googlemap
location/location/views.py
views.py
py
1,470
python
en
code
0
github-code
97
[ { "api_name": "openpyxl.load_workbook", "line_number": 13, "usage_type": "call" }, { "api_name": "googlemaps.Client", "line_number": 21, "usage_type": "call" }, { "api_name": "pandas.read_excel", "line_number": 22, "usage_type": "call" }, { "api_name": "django.sho...
33321729297
#!/usr/bin/env python # -*- coding: utf-8 -*- from bs4 import BeautifulSoup; from pathlib import Path; from pprint import pprint; from buildstep import *; from pathsresolver import *; def importFilter(tag): if tag.name in ['html', 'body', 'head', 'title']: return False; if tag.name == 'link': if 'import' in t...
truefusion/PolymerBundler
welder.py
welder.py
py
2,839
python
en
code
0
github-code
97
[ { "api_name": "pathlib.Path", "line_number": 35, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 36, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 40, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_...
4902699747
import numpy as np import torch class OUNoise: def __init__(self, mu, sigma=0.4, theta=.6, dt=0.05, x0=None, noise_decay=0.0): self.theta = theta self.mu = mu self.sigma = sigma self.dt = dt self.x0 = x0 self.noise_decay = noise_decay*sigma self.reset() ...
chdiazguerra/autonomous-driving-RL
reinforcement/utils.py
utils.py
py
1,401
python
en
code
0
github-code
97
[ { "api_name": "numpy.sqrt", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.random.normal", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 15, "usage_type": "attribute" }, { "api_name": "numpy.zeros_like", ...
18543918445
from flask import Flask,render_template,request app = Flask(__name__,'/static') @app.route('/index') @app.route("/") def index_view(): return render_template('index.html')#接收一个模板页来响应浏览器 #路由函数默认只接收get请求 methods=['get','post']表示当前视图函数可以接收get和post请求 @app.route('/user/login',methods=['get','post']) def login_view()...
SpringSnowB/All-file
m3/d12/run.py
run.py
py
2,217
python
en
code
0
github-code
97
[ { "api_name": "flask.Flask", "line_number": 3, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.request.form", "line_number": 19, "usage_type": "attribute" }, { "api_name": "flask.request...
36730322489
from django.shortcuts import render from django.http import JsonResponse from .models import DatosFormularioRechazoMpInMe from django.http import HttpResponseRedirect from django.urls import reverse # Create your views here. def rechazo_mp_in_me(request): return render(request, 'rechazo_mp_in_me/r_informe_rechazo...
diegosaldiasq/SCG_Quinta
Back-end/SCG_Quinta/rechazo_mp_in_me/views.py
views.py
py
2,157
python
es
code
0
github-code
97
[ { "api_name": "django.shortcuts.render", "line_number": 10, "usage_type": "call" }, { "api_name": "models.DatosFormularioRechazoMpInMe", "line_number": 29, "usage_type": "call" }, { "api_name": "django.http.JsonResponse", "line_number": 46, "usage_type": "call" }, { ...
74206943358
#!/usr/bin/python #This script is being run on a Ubuntu virtual Machine ###Path for telegram api_id and api_hash, the file must be .py import sys sys.path.insert(2, "/path/to/file/containing/your_api_id_and_api_hash") ##mysql import mysql.connector #registration is the name of the database and user of the MySQL serv...
joaopedrolourencoaffonso/python_smallstep
1-version/registration.py
registration.py
py
3,072
python
en
code
4
github-code
97
[ { "api_name": "sys.path.insert", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "mysql.connector.connector.connect", "line_number": 12, "usage_type": "call" }, { "api_name": "mysql.c...
1784529755
from docarray import DocumentArray from jina import Flow from executor import OCRMyPDF # print-to-pdf of https://courses.cs.vt.edu/csonline/AI/Lessons/VisualProcessing/OCRscans_files/bowers.jpg docs = DocumentArray.from_files("./data/bowers*.pdf") flow = ( Flow() .add(uses=OCRMyPDF, name="ocrpdf") .add(us...
alexcg1/executor-ocrmypdf
test.py
test.py
py
564
python
en
code
0
github-code
97
[ { "api_name": "docarray.DocumentArray.from_files", "line_number": 6, "usage_type": "call" }, { "api_name": "docarray.DocumentArray", "line_number": 6, "usage_type": "name" }, { "api_name": "jina.Flow", "line_number": 9, "usage_type": "call" }, { "api_name": "execu...
72799878078
from models import Restaurant, db # from forms import RestaurantForm from sqlalchemy.exc import SQLAlchemyError from flask import abort, jsonify from forms import RestaurantForm, EditRestaurantForm from wtforms.validators import ValidationError def get_restaurants(): restaurants = Restaurant.query.all() return...
blwishom/lunchclubapp
FlaskApp/services/restaurant_services.py
restaurant_services.py
py
1,728
python
en
code
3
github-code
97
[ { "api_name": "models.Restaurant.query.all", "line_number": 9, "usage_type": "call" }, { "api_name": "models.Restaurant.query", "line_number": 9, "usage_type": "attribute" }, { "api_name": "models.Restaurant", "line_number": 9, "usage_type": "name" }, { "api_name"...
27093784804
import logging import sys import torch from x_temporal.utils.dist_helper import is_master_proc logs = set() def init_log(name, level=logging.INFO): if (name, level) in logs: return logs.add((name, level)) logger = logging.getLogger(name) logger.setLevel(level) ch = logging.StreamHandle...
Sense-X/X-Temporal
x_temporal/utils/log_helper.py
log_helper.py
py
1,402
python
en
code
466
github-code
97
[ { "api_name": "logging.INFO", "line_number": 11, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.StreamHandler", "line_number": 18, "usage_type": "call" }, { "api_name": "sys.stdout"...
3778279744
import dill from typing import List import os from fastapi import FastAPI, Query import pickle import sys sys.path.append("..") sys.setrecursionlimit(10000) from typing import Any from src.models.candidate_generation.generate_candidates_pipeline import candidate_generation_component from src.models.diversifaction.diver...
a-s-gorski/conseillify-research
serving/api.py
api.py
py
5,624
python
en
code
0
github-code
97
[ { "api_name": "sys.path.append", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "sys.setrecursionlimit", "line_number": 8, "usage_type": "call" }, { "api_name": "pickle.load", "l...
5666934213
from django.db import models class employees(models.Model): name = models.CharField(max_length=100) email = models.EmailField(max_length=100) address = models.TextField() phone = models.IntegerField() class Meta: db_table = "employe"
Vishnu2020MCA/crudappi
crview/models.py
models.py
py
274
python
en
code
0
github-code
97
[ { "api_name": "django.db.models.Model", "line_number": 3, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 3, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 4, "usage_type": "call" }, { "api_name": "...
14438943513
import webapp2 import spcoc import os import jinja2 import check from google.appengine.api import mail JINJA_ENVIRONMENT = jinja2.Environment( loader=jinja2.FileSystemLoader(os.path.dirname(__file__)), extensions=['jinja2.ext.autoescape'], autoescape=True) class MainPage(webapp2.RequestHandler): ...
pbourachot/spcoc
src/spcocMain.py
spcocMain.py
py
5,266
python
en
code
0
github-code
97
[ { "api_name": "jinja2.Environment", "line_number": 9, "usage_type": "call" }, { "api_name": "jinja2.FileSystemLoader", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", ...
30846130414
import tkinter from tkinter.messagebox import showinfo as alert from tkinter.messagebox import askyesno as question from tkinter.simpledialog import askstring as prompt import customtkinter ''' Enunciado: 2. El departamento de Construcción Rural requiere una herramienta que facilite el calculo de materiales necesario...
albana-meloni/Curso_de_ingreso_PYTHON
ejercicios/07_tps/03_ferretes_construccion/app.py
app.py
py
3,607
python
es
code
null
github-code
97
[ { "api_name": "customtkinter.CTk", "line_number": 39, "usage_type": "attribute" }, { "api_name": "customtkinter.CTkLabel", "line_number": 47, "usage_type": "call" }, { "api_name": "customtkinter.CTkEntry", "line_number": 50, "usage_type": "call" }, { "api_name": "...
70771787199
import hashlib import json from typing import List from zipfile import ZipFile import yaml from django.contrib import admin from django.core.files.base import ContentFile from django.db import models, transaction from django.db.models import QuerySet from django.forms import ModelForm, FileField, CharField from django...
hexfaker/image-eval
image_eval/models/questions.py
questions.py
py
7,850
python
en
code
1
github-code
97
[ { "api_name": "django.db.models.Model", "line_number": 17, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 17, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 23, "usage_type": "call" }, { "api_name"...
2936960727
from telethon import TelegramClient, events, Button import requests #from headers import headers #import urls import os import requests import cryptg import asyncio import shutil import subprocess from mega import Mega mega = Mega() m = mega.login() #from flask import request client = TelegramClient('anfghohn',1416135...
b0tTest/Stream-PD
bot.py
bot.py
py
5,185
python
en
code
0
github-code
97
[ { "api_name": "mega.Mega", "line_number": 12, "usage_type": "call" }, { "api_name": "mega.login", "line_number": 13, "usage_type": "call" }, { "api_name": "telethon.TelegramClient", "line_number": 16, "usage_type": "call" }, { "api_name": "shutil.disk_usage", ...
9358553022
import requests import secrets import json def find_id(firstname, lastname, affil): url = f'http://api.elsevier.com/content/search/author?query=AUTHFIRST({firstname})+AND+AUTHLASTNAME({lastname})+AND+AFFIL({affil})&apiKey={secrets.key}' response = requests.get(url, headers={'Accept': 'application/json'}) d...
sray0309/SI-507-final-project
scopus.py
scopus.py
py
1,235
python
en
code
0
github-code
97
[ { "api_name": "secrets.key", "line_number": 6, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 7, "usage_type": "call" }, { "api_name": "secrets.key", "line_number": 18, "usage_type": "attribute" }, { "api_name": "requests.get", "line...
25169261965
"""Metrics controller.""" import logging from datetime import date from datetime import timedelta as td from functools import wraps from sqlalchemy import func from booking_microservice.constants import BlockChainStatus, BookingStatus from booking_microservice.models import Booking logger = logging.getLogger(__name_...
7552-2020C2-grupo5/bookings-microservice
booking_microservice/controllers/metrics.py
metrics.py
py
1,912
python
en
code
0
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 13, "usage_type": "attribute" }, { "api_name": "datetime.date.fromisoformat", "line_number": 18, "usage_type": "call" }, { "api_name": "datet...
19814171453
# -*- coding: utf-8 -*- """ Created on Sun Mar 20 22:02:54 2022 @author: Karel """ import matplotlib.pyplot as plt import cv2 import os import kornia as K import kornia.feature as KF import numpy as np import torch import pydegensac from kornia_moons.feature import * import glob import pandas as pd ...
jan2nov/FDMinM
Python/HardNet/test_kornia_comparison.py
test_kornia_comparison.py
py
6,583
python
en
code
0
github-code
97
[ { "api_name": "numpy.array", "line_number": 25, "usage_type": "call" }, { "api_name": "torch.no_grad", "line_number": 28, "usage_type": "call" }, { "api_name": "kornia.color.rgb_to_grayscale", "line_number": 30, "usage_type": "call" }, { "api_name": "kornia.color"...
14591184022
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Apr 4 21:42:57 2020 @author: kurmich """ from boxcell import * from atom import AtomicForces epsilon = 0.000001 idsort = lambda af: af.id def get_interactions(filename, t_start, t_end, types, interacting = False, sortkey = idsort): assert t_star...
Kurmich/contactmd
src/dumpparser.py
dumpparser.py
py
9,981
python
en
code
0
github-code
97
[ { "api_name": "atom.AtomicForces", "line_number": 79, "usage_type": "call" } ]
39392241615
#Discord bot to kick members without roles + kick specified member #v2.0(20th Jan 2022)------------------------------------------------------------------------------------ #Bot logic: 0. Runs loop iterating over servers (list) # 1. Runs loop iterating over server(guild) members, checks each for roles an...
jhongidyon/Discord-Bots
KickBot/main.py
main.py
py
4,831
python
en
code
0
github-code
97
[ { "api_name": "json.load", "line_number": 20, "usage_type": "call" }, { "api_name": "discord.Intents.default", "line_number": 28, "usage_type": "call" }, { "api_name": "discord.Intents", "line_number": 28, "usage_type": "attribute" }, { "api_name": "discord.ext.co...
8938014480
import os import re from pprint import pprint import requests from bs4 import BeautifulSoup # Regex num_pattern = re.compile(r"#(?P<num>\d{3})") rel_url_pattern = re.compile(r"^/pokedex/\w+") class PokemonInfo: def __init__(self, img_url, number, name, type_list, full_url): self.img_url = img_url ...
greener2/pokedex-scraper
scraper.py
scraper.py
py
1,874
python
en
code
0
github-code
97
[ { "api_name": "re.compile", "line_number": 9, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 10, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 31, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_numbe...
27884795495
import sqlite3 import contextlib import datetime class OperationalException(Exception): pass class ShoppingListDB(): def __init__(self, sqlite_dbfile): self._db = sqlite3.connect(sqlite_dbfile) self._cursor = self._db.cursor() with contextlib.suppress(sqlite3.OperationalError): self._cursor.execute(""" ...
johndoe31415/pyslist
ShoppingListDB.py
ShoppingListDB.py
py
6,390
python
en
code
0
github-code
97
[ { "api_name": "sqlite3.connect", "line_number": 9, "usage_type": "call" }, { "api_name": "contextlib.suppress", "line_number": 12, "usage_type": "call" }, { "api_name": "sqlite3.OperationalError", "line_number": 12, "usage_type": "attribute" }, { "api_name": "cont...
10039206409
from __future__ import division import random from copy import deepcopy import matplotlib.pyplot as plt; plt.rcdefaults() import numpy as np import matplotlib.pyplot as plt import time numElements = 1000 numMin = -1000 numMax = 1000 arrElements = [] times = [] def ordenamientoPorInsercion(unaLista): moves = 0 ...
castledan1/master-python-exercises
Algoritmos/practica2/Algoritmos2.py
Algoritmos2.py
py
7,630
python
en
code
0
github-code
97
[ { "api_name": "matplotlib.pyplot.rcdefaults", "line_number": 4, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 4, "usage_type": "name" }, { "api_name": "random.randint", "line_number": 222, "usage_type": "call" }, { "api_name": "time.tim...
32912687940
from keras.applications.vgg16 import ( VGG16, preprocess_input, decode_predictions) from keras.preprocessing import image from tensorflow.python.framework import ops import keras.backend as K import tensorflow as tf import numpy as np import keras import cv2 import os def normalize(x): # utility function to n...
wawaku/grad-cam-keras
grad-cam.py
grad-cam.py
py
5,537
python
en
code
19
github-code
97
[ { "api_name": "keras.backend.sqrt", "line_number": 15, "usage_type": "call" }, { "api_name": "keras.backend", "line_number": 15, "usage_type": "name" }, { "api_name": "keras.backend.mean", "line_number": 15, "usage_type": "call" }, { "api_name": "keras.backend.squ...
40328506798
# implementation adapted from: # https://github.com/yabufarha/ms-tcn/blob/master/model.py import torch import torch.nn as nn import torch.nn.functional as F import copy class MultiStageModel(nn.Module): def __init__(self, hparams): self.num_stages = hparams.mstcn_stages # 4 #2 self.num_layers = h...
tobiascz/TeCNO
models/mstcn.py
mstcn.py
py
7,154
python
en
code
42
github-code
97
[ { "api_name": "torch.nn.Module", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.nn.ModuleList", "line_number": 26, "usage_type": "call" }, { "api_name": "torch.nn", "line_...
71722643520
import numpy as np import pandas as pd import matplotlib.pyplot as plt #%load_ext google.colab.data_table import random from datetime import datetime, timedelta first_names = [ "Maria Carmen", "Maria", "Carmen", "Josefa", "Isabel", "Ana Maria", "Maria Dolores", "Maria Pilar", "Mar...
EricLeeuwenburgh/WINC---Data-Analytics-with-Python
Exercises/Module5/5_column_operations/main.py
main.py
py
5,001
python
en
code
0
github-code
97
[ { "api_name": "datetime.datetime.now", "line_number": 153, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 153, "usage_type": "name" }, { "api_name": "datetime.datetime", "line_number": 155, "usage_type": "call" }, { "api_name": "datetime...
14062639409
import os, sys, json, time, base64 from flask import Flask, jsonify, request import requests import utils, load_balance, global_vars import logging import redis import cfg_tasks from utils import send_file_to_jobe #====================================================== # Flask app initializtion #=====================...
perryOnCrack/Reverse-Proxy-for-Jobe
reverse_proxy.py
reverse_proxy.py
py
9,675
python
en
code
3
github-code
97
[ { "api_name": "flask.Flask", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 21, "usage_type": "call" }, { "api_name": "cfg_tasks.get_data.delay", "line_number": 41, "usage_type": "call" }, { "api_name": "cfg_tasks.get_...
22967015460
from django.db import models from django.core.validators import RegexValidator from django.contrib.auth.models import AbstractBaseUser, BaseUserManager # Create your models here. class MasterKelas(models.Model): id_kelas = models.IntegerField(primary_key=True) category_kelas = ( ...
rizkyarmanto/absenvttv5
absenvttv3-main/master/models.py
models.py
py
2,371
python
en
code
0
github-code
97
[ { "api_name": "django.db.models.Model", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 8, "usage_type": "name" }, { "api_name": "django.db.models.IntegerField", "line_number": 9, "usage_type": "call" }, { "api_name"...
24963762151
from datetime import date import sys import math from database import session from attendnum import attendnum from sqlalchemy import func args = sys.argv input1 = int(args[1]) input2 = int(args[2]) input3 = int(args[3]) Y = input1 % 10000 M = Y % 100 dt = date(math.floor(input1 / 10000), math.floor((input1 % 10000...
HirotakaMoriwaki/Python_C
Kawamura/aquaattend.py
aquaattend.py
py
589
python
en
code
0
github-code
97
[ { "api_name": "sys.argv", "line_number": 8, "usage_type": "attribute" }, { "api_name": "datetime.date", "line_number": 18, "usage_type": "call" }, { "api_name": "math.floor", "line_number": 18, "usage_type": "call" }, { "api_name": "database.session.query", "l...
3532612854
from django.shortcuts import render from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseNotFound from django.core.exceptions import ObjectDoesNotExist import os import json from .models import Course from django.db.models import Q # Create your views here. TRUE_SET = {"true", "yes", "y", "t", "1"...
venkatesh-sivaraman/fireroad-server
catalog/views.py
views.py
py
7,487
python
en
code
13
github-code
97
[ { "api_name": "django.http.HttpResponseBadRequest", "line_number": 18, "usage_type": "call" }, { "api_name": "models.Course.public_courses", "line_number": 20, "usage_type": "call" }, { "api_name": "models.Course", "line_number": 20, "usage_type": "name" }, { "api...
19224047319
import torch import torch.nn as nn import torch.nn.functional as F class Head(nn.Module): ''' Author: Sungjun Han Description: FFN layers for encoder or decoder input_size : int output_size : int activation : str dropout : float < 1 ''' def __init__(self, input_size, output_size, activa...
hansungj/NLPLab
nli/models/StaticEmb.py
StaticEmb.py
py
8,015
python
en
code
0
github-code
97
[ { "api_name": "torch.nn.Module", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 6, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.nn", "line_...
27967467259
import os import numpy as np import matplotlib.pyplot as plt from scipy import io from ukf_functions import * from panorama import * from transforms3d import taitbryan def main(): ''' modify this part accordingly ''' # flags UKF = True # use UKF or just gyro data for estimate Panorama = True # generate...
MaxLing/ukf_orientation_estimation
state_estimation.py
state_estimation.py
py
5,583
python
en
code
6
github-code
97
[ { "api_name": "numpy.array", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.identity", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.identity", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.identity", "line_...
32513820158
from typing import Any from ..._group import project_add_group from ....task.task import Task from ....task.decorator import python_task from ....task.cmd_task import CmdTask from ....task.resource_maker import ResourceMaker from ....runner import runner from ....helper import util from ....helper.codemod.add_import_mo...
tamaya-id/zrb
src/zrb/builtin/generator/fastapp_crud/add.py
add.py
py
8,341
python
en
code
null
github-code
97
[ { "api_name": "os.path.dirname", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_number"...
1351595863
#!/usr/bin/env/python import cv2 import numpy as np import sys import random ################################################################## def add_chromatic_aberration(img): shift_x=random.randint(1,3) shift_y=random.randint(1,3) height, width, _ = img.shape r_channel = np.roll(img[:, :, 2], shift...
mtricolici/ai-study-2023
samples-ImageProcessing/without-ml/vhs-noise/main.py
main.py
py
7,735
python
en
code
2
github-code
97
[ { "api_name": "random.randint", "line_number": 9, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.roll", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.roll", "line_number...
73150242238
from selenium import webdriver import time from telegram.ext import Updater, CommandHandler import logging logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') def start(update, context): """Send a message when the command /start is i...
bugpoop/tatketcapbot
main.py
main.py
py
2,867
python
en
code
0
github-code
97
[ { "api_name": "logging.basicConfig", "line_number": 5, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 5, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.Firefox", "line_number": 12, "usage_type": "call" }, { "api_name": "selen...
2164204510
from random import randrange import pygame from settings import * lost = 0 won = 0 class Cell: mine = False clicked = False marked = False flagged = False neighbor_mines = 0 class Minesweeper: width = 10 height = 10 mineCount = 10 flagCount = 10 uncovere...
hitrustt/minesweeper-pygame
main.py
main.py
py
15,227
python
en
code
0
github-code
97
[ { "api_name": "random.randrange", "line_number": 133, "usage_type": "call" }, { "api_name": "random.randrange", "line_number": 134, "usage_type": "call" }, { "api_name": "pygame.time.get_ticks", "line_number": 211, "usage_type": "call" }, { "api_name": "pygame.tim...
70836630080
import pygame import powerup class Misille(pygame.sprite.Sprite): def __init__(self,x,y): super().__init__() self.image = pygame.image.load("resources/missile.png") self.rect = self.image.get_rect() self.rect.x = x self.rect.y = y - self.rect.height self.strenght =...
Javierppt/arkanoid
misil.py
misil.py
py
373
python
en
code
0
github-code
97
[ { "api_name": "pygame.sprite", "line_number": 4, "usage_type": "attribute" }, { "api_name": "pygame.image.load", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 8, "usage_type": "attribute" } ]
3693827278
# -*- coding: utf-8 -*- """ 时间: 2019/12/5 16:22 作者: nola2 更改记录: 重要说明: 摄像头捕获的视频,沿垂直方向旋转每一帧并保存 """ import cv2 cap = cv2.VideoCapture(0) fourcc = cv2.VideoWriter_fourcc(*'XVID') # FOURCC一个4字节码,确认视频编码格式 out = cv2.VideoWriter('output.avi', fourcc, 20.0, (640, 480)) while cap.isOpened(): ret, frame = cap.read() ...
nola222/opencv_tutorial
opencv_video/save_video.py
save_video.py
py
709
python
en
code
0
github-code
97
[ { "api_name": "cv2.VideoCapture", "line_number": 14, "usage_type": "call" }, { "api_name": "cv2.VideoWriter_fourcc", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.VideoWriter", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2.flip", ...
43141711571
import pickle import gym import numpy as np import glfw import time with open('bestAction.pkl', 'rb') as bestActionPkl: bestAction = pickle.load(bestActionPkl) print(bestAction) env = gym.make('Humanoid-v2') moves_taken = 0 cand_done = False total_reward = 0 env.render() time.sleep(5) env.seed(1) env.reset() ...
ndriker/mudocoProject
results/bestAction.py
bestAction.py
py
762
python
en
code
0
github-code
97
[ { "api_name": "pickle.load", "line_number": 8, "usage_type": "call" }, { "api_name": "gym.make", "line_number": 11, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 26,...
6154765625
import numpy as np import cv2 import os import shutil from PIL import Image from .superpixel_augmentation import superpixel_aug from tqdm import tqdm def selectimagefromdir(dir_name = 'bear', select_number = 10): image_dir = '/Users/chenxi/Desktop/Ali_projects/DATA/DAVIS/DAVIS480P/JPEGImages/480p/' + dir_name + '...
alibaba/ClickSEG
scripts/DAVIS585_datatset/generate_init_masks_480p.py
generate_init_masks_480p.py
py
3,956
python
en
code
32
github-code
97
[ { "api_name": "os.path.exists", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "shutil.rmtree", "line_number": 15, "usage_type": "call" }, { "api_name": "os.mkdir", "line_number...
43814647315
import copy import code import os import tkinter as tk import tkinter.filedialog import itertools from typing import List, Dict, Tuple import time import csv from dataclasses import dataclass from pywikibot import ( Site, ItemPage, Claim, WbTime, WbQuantity, ) from pywikibot.site import DataSite fr...
jd3main/wikidata-tw-politicians-bot
tw_politicians_bot/__init__.py
__init__.py
py
20,517
python
en
code
1
github-code
97
[ { "api_name": "pywikibot.WbTime.fromTimestr", "line_number": 43, "usage_type": "call" }, { "api_name": "pywikibot.WbTime", "line_number": 43, "usage_type": "name" }, { "api_name": "wb_time_utils.WbTimePrecision.DAY", "line_number": 43, "usage_type": "attribute" }, { ...
71131314560
from os import environ from selenium import webdriver HOST_HUB = environ.get('HOST_HUB', '127.0.0.1') PORT_HUB = environ.get('PORT_HUB', 4444) class WebDriverRemote(webdriver.Remote): def __init__(self): selenium_grid_url = f"{HOST_HUB}:{PORT_HUB}/wd/hub" capabilities = webdriver.DesiredCapabili...
jcdb/selenium_wrapper
component/webdriver/remote.py
remote.py
py
518
python
en
code
0
github-code
97
[ { "api_name": "os.environ.get", "line_number": 4, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 4, "usage_type": "name" }, { "api_name": "os.environ.get", "line_number": 5, "usage_type": "call" }, { "api_name": "os.environ", "line_number":...
73801619838
"""Records video and still images.""" import datetime import logging import os import sys import time import picamera def record_video_and_stills(seconds_per_video, seconds_between_stills): """Records video in chunks and still images until space runs out or another error occurs. Warning: the seconds cal...
bskari/eclipse-2017-hab
pi/record_video_and_stills.py
record_video_and_stills.py
py
3,920
python
en
code
0
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_number": 28, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_num...
5303305310
# -*- coding: utf-8 -*- """ Created on Wed Mar 17 14:28:57 2021 @author: tmali """ import numpy as np import matplotlib.pyplot as plt #This function exactly solves given a function, grid spacing and min error required def solve(rho,error,hx,hy=-1): if hy==-1: hy=hx solution=np.zeros_like(r...
3okhir/Tokhir_Malikov_4150
Exercise 5.21.py
Exercise 5.21.py
py
2,049
python
en
code
0
github-code
97
[ { "api_name": "numpy.zeros_like", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.zeros_like", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.abs", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.amax", "line_nu...
31843566310
import sys import json from pubcontrol import Item from gripcontrol import GripPubControl, WebSocketEvent, \ WebSocketMessageFormat, decode_websocket_events, encode_websocket_events pub = GripPubControl({'control_uri': 'http://localhost:5561'}) opening = False out_headers = [] out = [] for e in decode_websocket_e...
fanout/serverless-websocket
handler-microcule.py
handler-microcule.py
py
1,277
python
en
code
30
github-code
97
[ { "api_name": "gripcontrol.GripPubControl", "line_number": 7, "usage_type": "call" }, { "api_name": "gripcontrol.decode_websocket_events", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.stdin.read", "line_number": 12, "usage_type": "call" }, { "api_...
26365012744
import re import shutil import os import shlex import subprocess import sys debug = False default_encoding = sys.getdefaultencoding() def check_param(obj, obj_type): """Assert obj as type obj_type.""" try: obj_type(obj) except Exception: raise AssertionError( "error: paramete...
openturns/openturns
python/src/coupling_tools.py
coupling_tools.py
py
23,665
python
en
code
198
github-code
97
[ { "api_name": "sys.getdefaultencoding", "line_number": 9, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 97, "usage_type": "call" }, { "api_name": "os.remove", "line_number": 121, "usage_type": "call" }, { "api_name": "shutil.move", "line_n...
74948721599
import sys import time import mdi try: import numpy use_numpy = True except ImportError: use_numpy = False try: from mpi4py import MPI use_mpi4py = True except ImportError: use_mpi4py = False niterations = 10000 natoms = 10 get_coords = False # initialize MPI if use_mpi4py: mpi_world = MPI...
taylor-a-barnes/socket_timings
socket_timings/driver.py
driver.py
py
2,175
python
en
code
0
github-code
97
[ { "api_name": "mpi4py.MPI.COMM_WORLD", "line_number": 21, "usage_type": "attribute" }, { "api_name": "mpi4py.MPI", "line_number": 21, "usage_type": "name" }, { "api_name": "mdi.MDI_Conversion_Factor", "line_number": 26, "usage_type": "call" }, { "api_name": "mdi.M...
1351388728
import os import disnake from disnake.ext import tasks, commands from disnake import ApplicationCommandInteraction from helpers import checks from helpers.save import get_save import googleapiclient.discovery import json import datetime if not os.path.isfile("config.json"): sys.exit("'config.json' not found! Ple...
Trexounay/YoutubeAlert
cogs/task/youtube.py
youtube.py
py
7,925
python
en
code
0
github-code
97
[ { "api_name": "os.path.isfile", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 17, "usage_type": "call" }, { "api_name": "disnake.ext.commands.Cog", ...
6356687786
# Code written to reproduce and repurpose what I already found online at: # https://stackoverflow.com/questions/42329766/python-nlp-british-english-vs-american-english # https://gist.github.com/rcortini/0d05417339bc74300ce3a971442a4d3c # https://github.com/hyperreality/American-British-English-Translator/bl...
nishalsach/python_hacks
uk_to_us_spellings_code.py
uk_to_us_spellings_code.py
py
1,639
python
en
code
0
github-code
97
[ { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 24, "usage_type": "call" } ]
10636071602
# -*- coding: utf-8 -*- # + import requests import feast import pandas as pd from feast import Entity, Feature, FeatureView, FileSource, ValueType import torch import pymysql from datetime import date from sqlalchemy import create_engine import numpy as np pymysql.install_as_MySQLdb() import MySQLdb import math import...
juniroc/ML_ops
feast_nni_bentoml_db/inference_/online_inf.py
online_inf.py
py
3,758
python
en
code
1
github-code
97
[ { "api_name": "pymysql.install_as_MySQLdb", "line_number": 12, "usage_type": "call" }, { "api_name": "warnings.filterwarnings", "line_number": 17, "usage_type": "call" }, { "api_name": "pandas.read_parquet", "line_number": 23, "usage_type": "call" }, { "api_name":...
73471254719
import cv2 import numpy as np image_obj = cv2.imread(r"C:\Users\User\Desktop\Feature Maps\ALLSTIMULI\ALLSTIMULI\i1252592787.jpeg") gray = cv2.cvtColor(image_obj, cv2.COLOR_BGR2GRAY) kernel = np.ones((4, 4), np.uint8) dilation = cv2.dilate(gray, kernel, iterations=1) blur = cv2.GaussianBlur(dilation, (5, 5...
ilanazane/Brain-Inspired-Computing
Project/old files/triangle.py
triangle.py
py
909
python
en
code
1
github-code
97
[ { "api_name": "cv2.imread", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 6, "usage_type": "attribute" }, { "api_name": "numpy.ones", "line_n...
31013190176
import numpy as np import pandas as pd import os import math import matplotlib.pyplot as plt import csv import functions # Eastern / Central [0] # Tap Mun [1] # Tsuen Wan [2] # Tung Chung [3] # Yuen Long [4] # Kwai Chung [5] ###################### # Kwun Tong [6] # Macau [7] # Sha Tin [8] # Sham Shui...
phitecus/kzfilter
wind_direction.py
wind_direction.py
py
9,533
python
en
code
5
github-code
97
[ { "api_name": "pandas.read_csv", "line_number": 38, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.delete", "line_number": 49, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.scatter", ...
7992092198
import random import numpy as np import torch from torch import Tensor import torch.nn as nn from torch.nn import Parameter import torch.nn.functional as F from tqdm import tqdm class Node2Vec: def __init__(self, G, dim=128): self.G = G self.dim = dim self.device = torch.device("cuda:0" if ...
lym01803/EE359_LinkPrediction
src/encoder.py
encoder.py
py
3,883
python
en
code
2
github-code
97
[ { "api_name": "torch.device", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 14, "usage_type": "attribute" }, { "api_name": "torch.zeros", ...
22956069895
from os import name import sys import xml.etree.ElementTree as ET from xml.dom import minidom import warnings warnings.filterwarnings("ignore", category=DeprecationWarning) class DFA: Q = [[0, "q0"], [1, "q1"], [2, "q2"], [3, "q3"], [4, "q4"]] ## list of states as I...
BostonZero/beingastudent
Spring 2021/comp theory/hw2/dfaxml.py
dfaxml.py
py
2,521
python
en
code
0
github-code
97
[ { "api_name": "warnings.filterwarnings", "line_number": 7, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree.Element", "line_number": 31, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 31, "usage_type": "name" }, { "api_na...
40848233669
import pandas as pd from bokeh.models import BasicTicker, ColorBar, LinearColorMapper from bokeh.palettes import Blues from bokeh.plotting import figure from bokeh.transform import transform from sklearn import datasets from sklearn.metrics import confusion_matrix from dara.core import DataVariable, DerivedVariable, V...
causalens/dara_app_gallery
dara_interactivity/dara_interactivity/pages/expensive_calculations.py
expensive_calculations.py
py
9,301
python
en
code
1
github-code
97
[ { "api_name": "pandas.DataFrame", "line_number": 30, "usage_type": "call" }, { "api_name": "sklearn.metrics.confusion_matrix", "line_number": 30, "usage_type": "call" }, { "api_name": "bokeh.models.LinearColorMapper", "line_number": 35, "usage_type": "call" }, { "...
11351832223
from collections import namedtuple import numpy as np import math Move = namedtuple("Move", ["dest"]) Wait = namedtuple("Wait", []) STATE_GOING_UP = "up" STATE_GOING_DOWN = "down" STATE_EMPTY = "both" ControllerStatus = namedtuple("ControllerStatus", ["wait_up", "wait_down", ...
VoyagerYoshida/DQNmeetsElevator
lifcon.py
lifcon.py
py
2,520
python
en
code
0
github-code
97
[ { "api_name": "collections.namedtuple", "line_number": 5, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 6, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 12, "usage_type": "call" }, { "api_name": "co...
5030509764
import tensorflow as tf import keras def create_model(input_globalvars,input_cpf,input_npf,input_sv,nlabels): cpf = input_cpf for nfilters in [32,32,8]: cpf = keras.layers.Conv1D(nfilters,1,padding='same',activation='selu')(cpf) cpf = keras.layers.Dropout(0.1)(cpf) cpf = keras.layers.F...
matt-komm/pyhep20_tfpipeline
realistic_model.py
realistic_model.py
py
1,342
python
en
code
1
github-code
97
[ { "api_name": "keras.layers.Conv1D", "line_number": 8, "usage_type": "call" }, { "api_name": "keras.layers", "line_number": 8, "usage_type": "attribute" }, { "api_name": "keras.layers.Dropout", "line_number": 9, "usage_type": "call" }, { "api_name": "keras.layers"...
26335549174
import json import os from typing import Dict, Any, Union, Optional from typing_extensions import Literal from functools import lru_cache from .. import load_shared_data, get_shared_data_root from .pipette_definition import ( PipetteConfigurations, PipetteLiquidPropertiesDefinition, ) from .model_constants i...
Opentrons/opentrons
shared-data/python/opentrons_shared_data/pipette/load_data.py
load_data.py
py
9,179
python
en
code
363
github-code
97
[ { "api_name": "typing.Dict", "line_number": 26, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 26, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 26, "usage_type": "name" }, { "api_name": "typing_extensions.Literal", "...
12117586458
import os import traceback import copy import time import sys import subprocess from logging import handlers from multiprocessing import Pool, Process, Manager import shutil import logging import datetime root_path = os.path.dirname(os.path.abspath(__name__)) LOG_DIR = os.path.join(root_path, 'log') log_name = 'unpac...
Mr-liu-yang/daily_tools
Unpack/batch.py
batch.py
py
12,795
python
en
code
1
github-code
97
[ { "api_name": "os.path.dirname", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.join", "line...
37077692990
import requests from fastapi import APIRouter news = APIRouter() import requests import os from bson import json_util from datetime import datetime api_key = os.environ.get("API_key") import uuid from pydantic import BaseModel, Field from pymongo import MongoClient CONNECTION_STRING = 'mongodb://localhost:27017' clien...
shabanzadeh/restfulAPI_readiSchool
backend/routes/news.py
news.py
py
2,195
python
en
code
0
github-code
97
[ { "api_name": "fastapi.APIRouter", "line_number": 3, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 8, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pymongo.MongoClient", ...
42641382252
#DANILO COURA MOREIRA import time as time import numpy as np import matplotlib.pyplot as plt def normal_equation(points): points_x_with_1 = np.append(np.ones((len(points),1)),points[:,0:1],axis=1) #w = (H'H)-1 H'y return np.dot(np.dot(np.linalg.inv(np.dot(np.transpose(points_x_with_1),points_x_with_1)),np.transpo...
danilocoura/Aprendizagem-de-Maquina
Tarefa1/DANILO_COURA_regressao_linear_eq_normal.py
DANILO_COURA_regressao_linear_eq_normal.py
py
949
python
en
code
0
github-code
97
[ { "api_name": "numpy.append", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.linalg.inv", "line_number":...
10671948124
import sys, os, datetime import numpy as np import torch from torch.utils.tensorboard import SummaryWriter # add the path to the files from this project sys.path.append(os.path.dirname(__file__)) import world import utils import losses import mesh_utils from utils import * import data_utils import train_utils from p...
nmwsharp/learned-triangulation
src/main_train_model.py
main_train_model.py
py
6,935
python
en
code
100
github-code
97
[ { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number...
28920442758
#!/usr/bin/env python # coding: utf-8 # In[1]: from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense,Dropout,BatchNormalization from keras.callbacks import EarlyStopping,ModelCheckpoint import keras import pickle import numpy as np import tensorflow as tf import glob from tensorflo...
rgilconde/DS_Resources
src/anomaly_detection/Autoencoder_anomaly_detection.py
Autoencoder_anomaly_detection.py
py
3,838
python
en
code
0
github-code
97
[ { "api_name": "sklearn.preprocessing.StandardScaler", "line_number": 28, "usage_type": "call" }, { "api_name": "pickle.dump", "line_number": 31, "usage_type": "call" }, { "api_name": "tensorflow.keras.models.Sequential", "line_number": 44, "usage_type": "call" }, { ...
4640798708
#!/usr/bin/env python # coding: utf-8 # # Creación de Dataset de Municipios de Colombia # #### Tarea #1: Obtener la información para un municipio # In[1]: # Importar librerías principales import requests from bs4 import BeautifulSoup as bs import pandas as pd import numpy as np import pickle # In[3]: # Cargar...
roslch/municipios-colombia-project
municipios_colombia.py
municipios_colombia.py
py
23,431
python
es
code
0
github-code
97
[ { "api_name": "requests.get", "line_number": 24, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 27, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 101, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", ...