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
3020745085
import os import pandas as pd from injector import inject import estimize.config as cfg from estimize.pandas import dfutils from estimize.services import ReleasesService, CacheService, AssetInfoService class ReleasesServiceDefaultImpl(ReleasesService): @inject def __init__(self, cache_service: CacheService,...
Estimize/estimize-research-py
estimize/services/impl/releases_service_default_impl.py
releases_service_default_impl.py
py
1,453
python
en
code
10
github-code
6
[ { "api_name": "estimize.services.ReleasesService", "line_number": 10, "usage_type": "name" }, { "api_name": "estimize.services.CacheService", "line_number": 13, "usage_type": "name" }, { "api_name": "estimize.services.AssetInfoService", "line_number": 13, "usage_type": "n...
10395877739
import math import torch from .make_dataloader import Make_DataLoader class Predict(object): def __init__(self): self.np_score = 0 def soft_max(self, n, p): sum_exp_np = math.exp(n)+math.exp(p) changed_n = math.exp(n)/sum_exp_np changed_p = math.exp(p)/sum_exp_np ret...
karakuri-ai/hottopi-san
sentiment_analytics/negapoji_analytics/src/modules/predict.py
predict.py
py
2,578
python
en
code
0
github-code
6
[ { "api_name": "math.exp", "line_number": 13, "usage_type": "call" }, { "api_name": "math.exp", "line_number": 14, "usage_type": "call" }, { "api_name": "math.exp", "line_number": 15, "usage_type": "call" }, { "api_name": "math.log", "line_number": 25, "usa...
26112918325
__authors__ = ["V.A. Sole", "T. Rueter", "T. Vincent"] __license__ = "MIT" __data__ = "16/10/2017" import logging import weakref import numpy from .. import qt, colors from ..widgets.LegendIconWidget import LegendIconWidget from . import items _logger = logging.getLogger(__name__) class LegendIcon(LegendIconWid...
silx-kit/silx
src/silx/gui/plot/LegendSelector.py
LegendSelector.py
py
37,722
python
en
code
106
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "widgets.LegendIconWidget.LegendIconWidget", "line_number": 19, "usage_type": "name" }, { "api_name": "weakref.ref", "line_number": 53, "usage_type": "call" }, { "api_name"...
15748348327
#!/usr/bin/env python import argparse parser = argparse.ArgumentParser(description="Attach a disk image to a .bin firmware.", formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('-f', dest='firmware_file', nargs='?', default='enstix.bin', help='Path to firmware file.') parser.add_argument('-i'...
flabbergast/enstix
sources/scripts/attach-img-to-bin.py
attach-img-to-bin.py
py
1,056
python
en
code
38
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 5, "usage_type": "call" }, { "api_name": "argparse.ArgumentDefaultsHelpFormatter", "line_number": 5, "usage_type": "attribute" } ]
72739050428
import datetime from rest_framework.response import Response from rest_framework import status from rest_framework.views import APIView from rest_framework.authtoken.models import Token import random from django.contrib.auth.models import User from django.contrib.auth import authenticate from rest_framework.authent...
kothawleprem/MedConnect
core/patients/views.py
views.py
py
11,056
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.views.APIView", "line_number": 23, "usage_type": "name" }, { "api_name": "random.randint", "line_number": 28, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.User.objects.filter", "line_number": 30, "usage_type": "call" },...
34254523388
import cv2 captura = cv2.VideoCapture(0) ancho = int(captura.get(cv2.CAP_PROP_FRAME_WIDTH)) alto = int(captura.get(cv2.CAP_PROP_FRAME_HEIGHT)) # MAC #codigo = cv2.VideoWriter_fourcc(*'MJPG') #grabador = cv2.VideoWriter('video.avi',codigo,20,(ancho,alto)) # WINDOWS codigo = cv2.VideoWriter_fourcc(*'DIVX') grabador =...
AlexPoma/OpenCV-Tutorial-and-EZ-FaceRecognition
video.py
video.py
py
593
python
en
code
0
github-code
6
[ { "api_name": "cv2.VideoCapture", "line_number": 3, "usage_type": "call" }, { "api_name": "cv2.CAP_PROP_FRAME_WIDTH", "line_number": 5, "usage_type": "attribute" }, { "api_name": "cv2.CAP_PROP_FRAME_HEIGHT", "line_number": 6, "usage_type": "attribute" }, { "api_na...
440706906
import pandas as pd import numpy as np from multiprocessing import Pool, cpu_count FLOAT_TYPE = np.float32 def get_freq(x): if len(x) == 0: return np.NaN return pd.Series(x).value_counts().idxmax() def map_arr(x, value_map): return pd.Series(x).map(value_map).values def value_counts(x): r...
kqdmqx/kaggle-Elo-Merchant-Category-Recommendation
my_preprocessing.py
my_preprocessing.py
py
4,562
python
en
code
1
github-code
6
[ { "api_name": "numpy.float32", "line_number": 5, "usage_type": "attribute" }, { "api_name": "numpy.NaN", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pandas.Series", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.Series", "l...
37639143186
import pytest from db.dbi.db_interface import DBInterface from db.body_styles import body_styles from config import DevConfig import string import random from random import choice DB_URI = DevConfig.POSTGRES_DATABASE_URI WEBSITE_NAMES = ["autotrader", "cargurus", "usnews", "driveway", "capitolone"] LISTING_CHANGES = [...
HenrySpeaker/Car-Listing-Tracker
tests/utils/db_utils.py
db_utils.py
py
10,247
python
en
code
0
github-code
6
[ { "api_name": "config.DevConfig.POSTGRES_DATABASE_URI", "line_number": 9, "usage_type": "attribute" }, { "api_name": "config.DevConfig", "line_number": 9, "usage_type": "name" }, { "api_name": "random.choices", "line_number": 17, "usage_type": "call" }, { "api_nam...
26185572484
"""Group Anagrams Given an array of strings strs, group the anagrams together. You can return the answer in any order. An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once. Example 1: Input: strs = ["eat","tea","tan","a...
01o91939/leetcode
groupAnagrams.py
groupAnagrams.py
py
2,976
python
en
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 31, "usage_type": "name" }, { "api_name": "collections.defaultdict", "line_number": 32, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 46, "usage_type": "name" }, { "api_name": "collections.defaultdi...
16948669318
from selenium import webdriver from config.VarConfig import chromeDriverPath from config.VarConfig import firefoxDriverPath from util.ObjectMap import getElement from util.ClipboardUtil import Clipboard from util.KeyBoardUtil import KeyboardKeys from util.DirAndTime import * from util.WaitUtil import WaitUtil from sele...
liumengren/KeyWordsFrameWork
action/PageAction.py
PageAction.py
py
4,457
python
en
code
0
github-code
6
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 21, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 21, "usage_type": "name" }, { "api_name": "config.VarConfig.chromeDriverPath", "line_number": 21, "usage_type": "name" }, { "ap...
16813034187
from django.urls import path from .controller.articles.articles_controller import ArticleController, ArticleDetailView, ArticlePreview from .controller.authors.authors_controller import AuthorController from .controller.categories.categories_controller import CategoryController from .controller.search.search_controlle...
zzolfaghari/tech-news
tech_news/base/urls.py
urls.py
py
1,144
python
en
code
2
github-code
6
[ { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" }, { "api_name": "controller.articles.articles_controller.ArticleController.as_view", "line_number": 10, "usage_type": "call" }, { "api_name": "controller.articles.articles_controller.ArticleController", ...
41241975860
from PIL import Image images = [Image.open(x) for x in ['Temp/Combined_PC.png', 'Temp/Combined_SP.png']] New_Image_X = images[0].size[0] New_Image_Y = images[0].size[1] layer1 = Image.new('RGBA', (New_Image_X, New_Image_Y)) layer2 = Image.new('RGBA', (New_Image_X, New_Image_Y)) width_SP, height_SP = images[1].size ...
MatheusRuggeri/Repository-Cover-Image-Creator
Img Combine.py
Img Combine.py
py
557
python
en
code
1
github-code
6
[ { "api_name": "PIL.Image.open", "line_number": 3, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 3, "usage_type": "name" }, { "api_name": "PIL.Image.new", "line_number": 8, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 8,...
42303791603
import numpy as np import matplotlib.pyplot as plt import sys """ Kjøres i terminal. x mu(valgfri) Uten friksjon: > python oppgave_f.py 0.6 Med friksjon: > python oppgave_f.py 0.75 0.05 """ m = 5 # kg k = 500 # N/m l0 = 0.5 # m h = 0.3 # m g = 9.81 # m/s^2 dt = 0.01 N = int(n...
willidu/FYS-MEK1110
Oblig 3/oppgave_f.py
oppgave_f.py
py
1,170
python
en
code
0
github-code
6
[ { "api_name": "numpy.ceil", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.zeros_like", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.zeros_like", "li...
10249353369
from molecule import Molecule import genmethods, sys, os from config import ROOT_DIRECTORY import copy def shiftIndicesNotAtm(molecule, changeMatrix): # shift the atom indexes referenced in bonds for a in molecule.getBonds(): a.setAtmAPos(changeMatrix[a.getAtmAPos()]) a.setAtmBPos(changeMatrix...
iwelsh47/MAGIC
reordering.py
reordering.py
py
4,048
python
en
code
0
github-code
6
[ { "api_name": "molecule.getBonds", "line_number": 9, "usage_type": "call" }, { "api_name": "molecule.getAngles", "line_number": 13, "usage_type": "call" }, { "api_name": "molecule.getImpropers", "line_number": 18, "usage_type": "call" }, { "api_name": "molecule.ge...
26906920193
from django.conf import settings from rest_framework.response import Response from rest_framework.decorators import api_view, permission_classes from rest_framework.permissions import IsAuthenticated from rest_framework.pagination import PageNumberPagination from django.shortcuts import render, redirect from django.ut...
mshenoy87/HonestHive
Waggles/api/views.py
views.py
py
4,005
python
en
code
0
github-code
6
[ { "api_name": "django.conf.settings.ALLOWED_HOSTS", "line_number": 14, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 14, "usage_type": "name" }, { "api_name": "serializers.WaggleCreateSerializer", "line_number": 19, "usage_type": "call"...
37186951571
from flask import render_template, session, redirect, url_for, current_app, request, flash from . import admin from .forms import LoginForm, RegistrationForm, ProductForm, ProductEditForm from ..models import Admin, Product from flask_login import login_user, logout_user, login_required, \ current_user from flask_l...
omamazainab/resturant-management-system-flask
app/admin/views.py
views.py
py
4,738
python
en
code
0
github-code
6
[ { "api_name": "forms.LoginForm", "line_number": 20, "usage_type": "call" }, { "api_name": "models.Admin.query.filter_by", "line_number": 22, "usage_type": "call" }, { "api_name": "models.Admin.query", "line_number": 22, "usage_type": "attribute" }, { "api_name": "...
7397937227
from task.models import teacher,schedule import time import requests import json from time import strftime from apscheduler.schedulers.background import BackgroundScheduler from django.core.mail import send_mail from django_apscheduler.jobstores import DjangoJobStore, register_events, register_job scheduler = Backgrou...
punitpandey/djangotask
task/jobs.py
jobs.py
py
4,221
python
en
code
0
github-code
6
[ { "api_name": "apscheduler.schedulers.background.BackgroundScheduler", "line_number": 10, "usage_type": "call" }, { "api_name": "django_apscheduler.jobstores.DjangoJobStore", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 24, "usa...
34681657731
from typing import Union, Optional, Any, cast import json import os import PySide2.QtCore as QtCore import PySide2.QtWidgets as QtWidgets import PySide2.QtGui as QtGui from undo_commands import ( AddNodeCommand, RemoveNodeFromFrameCommand, AddGrpNodeCommand, ResolveGrpNodeCommand, MoveNodesCommand, RemoveNode...
j8sr0230/codelink
src/codelink/editor_widget.py
editor_widget.py
py
42,845
python
en
code
2
github-code
6
[ { "api_name": "PySide2.QtWidgets.QGraphicsView", "line_number": 27, "usage_type": "attribute" }, { "api_name": "PySide2.QtWidgets", "line_number": 27, "usage_type": "name" }, { "api_name": "PySide2.QtCore.Signal", "line_number": 28, "usage_type": "attribute" }, { ...
41758030952
from __future__ import print_function import sys import ply.yacc as yacc import ply.lex as lex import io tokens = ( "INC", "DEC", "SHL", "SHR", "OUT", "IN", "OPEN_LOOP", "CLOSE_LOOP", ) t_INC = r'5' t_DEC = r'6' t_SHL = r'10' t_SHR = r'9' t_OUT = r'12' t_IN = r'11' t_OPEN_LOOP = r'7' t...
Saket-Upadhyay/wisdom
writerscript/interpreter.py
interpreter.py
py
3,801
python
en
code
5
github-code
6
[ { "api_name": "ply.lex.lex", "line_number": 95, "usage_type": "call" }, { "api_name": "ply.lex", "line_number": 95, "usage_type": "name" }, { "api_name": "ply.yacc.yacc", "line_number": 96, "usage_type": "call" }, { "api_name": "ply.yacc", "line_number": 96, ...
15640116130
import requests import os import re from bs4 import BeautifulSoup import sys sys.path.append('../common') from cleanup import cleanup imgur_regex = r'http[s]?://(?:.*\.)?imgur\.com/[^\s]+' # Print GitHub link so people can report issues or visit the repo. print('https://github.com/DexrnZacAttack/ImgurScraper' ) # Se...
DexrnZacAttack/ImgurScraper
MFFScraper/main.py
main.py
py
1,782
python
en
code
2
github-code
6
[ { "api_name": "sys.path.append", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 32, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "lin...
32205580024
from kafka import KafkaConsumer from json import loads from flask import Flask, escape, request app = Flask(__name__) consumer = KafkaConsumer( 'page_views-page_views-changelog', bootstrap_servers=['kafka:9092'], auto_offset_reset='earliest', enable_auto_commit=True, group_id='my-group') @ap...
celsocrivelaro/arquitetura-bigdata
aula07/consumer.py
consumer.py
py
603
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "kafka.KafkaConsumer", "line_number": 8, "usage_type": "call" } ]
29422387546
import os import json config_file = 'config.json' class Config: def __init__(self): self.values = { 'image_path': '', 'video_path': '', 'ffmpeg_path': '', 'image_resx': 1920, 'image_resy': 1080, 'video_codec': 'prores', '...
emartirequena/rationalmodel
src/rationalmodel/viewRationals/config.py
config.py
py
1,523
python
en
code
0
github-code
6
[ { "api_name": "os.path.exists", "line_number": 37, "usage_type": "call" }, { "api_name": "os.path", "line_number": 37, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 39, "usage_type": "call" } ]
21230786214
"""GraphQL demo app.""" from flask import Flask from flask_graphql import GraphQLView import graphene as g ################################################ app = Flask(__name__) with app.app_context(): app.config.from_object('config.main-config.DevConfig') from gqlmodels import Query import dbmodels as mdb...
maddevsio/graphql-demo
demoapp.py
demoapp.py
py
1,579
python
en
code
4
github-code
6
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "dbmodels.db.init_app", "line_number": 13, "usage_type": "call" }, { "api_name": "dbmodels.db", "line_number": 13, "usage_type": "attribute" }, { "api_name": "flask_graphql.GraphQ...
30938920891
import matplotlib.pyplot as plt import pandas as pd import numpy import requests #import cv2 from PIL import Image, ImageOps, ImageChops from io import BytesIO import os apikey = "AIzaSyA2BEmbwVbpINCm_w6PSCnysZnlJDAr7oM" # These functions are taken from streetview.py: def sendRequest(url, to=15): r = False ...
klekkala/usc_navigate
mapmaker.py
mapmaker.py
py
9,803
python
en
code
2
github-code
6
[ { "api_name": "requests.get", "line_number": 18, "usage_type": "call" }, { "api_name": "requests.exceptions", "line_number": 19, "usage_type": "attribute" }, { "api_name": "requests.exceptions", "line_number": 21, "usage_type": "attribute" }, { "api_name": "reques...
24038406352
import json from django.views.generic import ListView, DetailView, TemplateView, View, CreateView # noqa from django.views.generic.edit import FormMixin from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidden, JsonResponse # noqa from .models import Post from django.db.models import Q from dja...
philabug/gamersijuan
blog/views.py
views.py
py
7,356
python
en
code
0
github-code
6
[ { "api_name": "models.Post.objects.filter", "line_number": 15, "usage_type": "call" }, { "api_name": "models.Post.objects", "line_number": 15, "usage_type": "attribute" }, { "api_name": "models.Post", "line_number": 15, "usage_type": "name" }, { "api_name": "json....
15846721582
import pandas as pd import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from sklearn.ensemble import RandomForestClassifier from sklearn.tree import export_graphviz from subprocess import call from IPython.display import Image import numpy as np from sklearn.metrics import confu...
XinShuaiTeng/RandomForest
RandomForest.py
RandomForest.py
py
3,426
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 22, "usage_type": "call" }, { "api_name": "sklearn.ensemble.RandomForestClassifier", "line_number": 24, "usage_type": "call...
70968291707
import numpy as np import cv2 import pandas as pd faceCascade = cv2.CascadeClassifier('haarcascade_frontalface_alt.xml') # to save the face pic to path path = "dataset" face_id = input("\n Type the face ID number: ") count = 0 # READ VIDEO capture = cv2.VideoCapture(0) # READ CAPTURE FROM VIDEO while True: re...
awesomegusS/cv
detector.py
detector.py
py
1,047
python
en
code
0
github-code
6
[ { "api_name": "cv2.CascadeClassifier", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 22, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY...
13317626553
import csv import re import didYouMean import autoComplete from sys import exit import os from nltk.stem.wordnet import WordNetLemmatizer class Retrival: def __init__(self): self.searchList = [] self.originalQuery = '' self.stopWords = [] self.links = {} # variables exist for historical purpose # This is ...
pncnmnp/search-engine
retrival.py
retrival.py
py
3,126
python
en
code
0
github-code
6
[ { "api_name": "os.chdir", "line_number": 21, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 25, "usage_type": "call" }, { "api_name": "nltk.stem.wordnet.WordNetLemmatizer", "line_number": 28, "usage_type": "call" }, { "api_name": "os.chdir", ...
35574455275
from collections import defaultdict def createGraph(tickets): g=defaultdict(list) for src,des in tickets: if src in g: g[src].append(des) else: g[src]=[des] print(g) for i in g.keys(): g[i].sort(reverse=True) return g def reconstructRoute...
goyalgaurav64/Graph
reconstruct-itinerary.py
reconstruct-itinerary.py
py
745
python
en
code
1
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 3, "usage_type": "call" } ]
39476649905
import json from py2neo import Graph,Node graph = Graph( host="127.0.0.1", # neo4j 搭载服务器的ip地址,ifconfig可获取到 http_port=7474, # neo4j 服务器监听的端口号 user="neo4j", # 数据库user name,如果没有更改过,应该是neo4j password="123") # graph = Graph( # host="154.8.214.203", # ...
zhang8929/zhangyuguang
zhangyuan/db/import_data/import_39surgery.py
import_39surgery.py
py
4,618
python
zh
code
0
github-code
6
[ { "api_name": "py2neo.Graph", "line_number": 4, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 19, "usage_type": "call" }, { "api_name": "py2neo.Node", "line_number": 33, "usage_type": "call" }, { "api_name": "py2neo.Node", "line_number": 5...
71804901628
from sklearn import datasets, svm, metrics import sklearn from config import opt def load_data(): # The digits dataset digits = datasets.load_digits() n_samples = len(digits.images) x = digits.images.reshape((n_samples, -1)) y = digits.target x, y = sklearn.utils.shuffl...
hoxmark/Deep_reinforcement_active_learning
reinforcement/datasets/digit/dataset.py
dataset.py
py
696
python
en
code
17
github-code
6
[ { "api_name": "sklearn.datasets.load_digits", "line_number": 7, "usage_type": "call" }, { "api_name": "sklearn.datasets", "line_number": 7, "usage_type": "name" }, { "api_name": "sklearn.utils.shuffle", "line_number": 12, "usage_type": "call" }, { "api_name": "skl...
31126744653
print(__name__) from distance_sensors.distance_emitter import distance_emitter from behaviours.WallFollowing import WallFollowing import asyncio from event_emitter_asyncio.EventEmitter import EventEmitter wall_follower = WallFollowing() wall_follower.start() async def main(): distance_task = asyncio.create_t...
gregorianrants/technic-bot
technic/run_wall_following.py
run_wall_following.py
py
482
python
en
code
0
github-code
6
[ { "api_name": "behaviours.WallFollowing.WallFollowing", "line_number": 11, "usage_type": "call" }, { "api_name": "asyncio.create_task", "line_number": 15, "usage_type": "call" }, { "api_name": "distance_sensors.distance_emitter.distance_emitter.start", "line_number": 15, ...
73799766909
from django.conf.urls import include, url from django.contrib import admin urlpatterns = [ url(r'^Administrador/', include(admin.site.urls)), url('^Biblia/', include('biblia.urls')), url('^Hermanos/', include('hermanos.urls')), url('^Culto/', include('culto....
dibiro/IglesiaAdministrador
Iglesia/urls.py
urls.py
py
331
python
en
code
0
github-code
6
[ { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "django.conf.urls.include", "line_number": 6, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 6, "usage_type": "attribute" }, { "api_nam...
73014849787
import json import logging try: import Queue except ImportError: import queue as Queue import threading from collections import deque import os try: from urllib.parse import unquote, quote except ImportError: from urllib2 import quote from urlparse import unquote log = logging.getLogger(__name__) ...
hansec/fortran-language-server
fortls/jsonrpc.py
jsonrpc.py
py
8,257
python
en
code
282
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "os.name", "line_number": 23, "usage_type": "attribute" }, { "api_name": "os.path.normpath", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_n...
30316002856
""" Overview ======== The `grizzled.os` module contains some operating system-related functions and classes. It is a conceptual extension of the standard Python `os` module. """ __docformat__ = "markdown" # --------------------------------------------------------------------------- # Imports # ----------------------...
bmc/grizzled-python
grizzled/os.py
os.py
py
10,175
python
en
code
22
github-code
6
[ { "api_name": "os.devnull", "line_number": 46, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 59, "usage_type": "call" }, { "api_name": "os.name", "line_number": 86, "usage_type": "attribute" }, { "api_name": "typing.Sequence", ...
26581591640
from functions import InstagramBot from mongoConnect import connect import json import os import time import random from dotenv import load_dotenv from selenium.common.exceptions import NoSuchElementException def SearchByHashTag_main(): with open("hashtags.json") as dataJson: data = json.load(dataJson) for getHas...
LeandroGelain/PersonalGit
2020/ProjetoMarketing/instaBot/mainTest.py
mainTest.py
py
2,185
python
en
code
0
github-code
6
[ { "api_name": "json.load", "line_number": 12, "usage_type": "call" }, { "api_name": "dotenv.load_dotenv", "line_number": 46, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 47, "usage_type": "call" }, { "api_name": "os.getenv", "line_number":...
40787844791
'''Objectives: * Connect to GCP pub-sub for IoT Core * Subscribe to a topic * Publish events to a topic Fred T. Dunaway Jan 3, 2020 Source: https://cloud.google.com/iot/docs/how-tos/mqtt-bridge ''' import ssl import jwt import datetime import time import paho.mqtt.client as mqtt # Variables that should be move to a...
mrncmoose/smart_controller
pi-code/gcp_pubsub_test.py
gcp_pubsub_test.py
py
5,663
python
en
code
3
github-code
6
[ { "api_name": "datetime.datetime.utcnow", "line_number": 57, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 57, "usage_type": "attribute" }, { "api_name": "datetime.datetime.utcnow", "line_number": 59, "usage_type": "call" }, { "api_name...
71994843068
"""General use functions. """ import time import argparse import numpy as np from scipy.optimize import nnls ################################################################################ def sync(i, start_time, timestep): """Syncs the stepped simulation with the wall-clock. Function `sync` calls time.slee...
kaustubhsridhar/Constrained_Models
Drones/gym-pybullet-drones/gym_pybullet_drones/utils/utils.py
utils.py
py
5,211
python
en
code
15
github-code
6
[ { "api_name": "time.time", "line_number": 27, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 29, "usage_type": "call" }, { "api_name": "argparse.ArgumentTypeError", "line_number": 54, "usage_type": "call" }, { "api_name": "numpy.abs", "line...
2976709832
import os from typing import List import torch from torch.utils.data import Dataset from PIL import Image from pathlib import Path from torchvision import transforms class MVTecDataset(Dataset): def __init__(self, path: str, train: bool, piece: str, states: List[str], transform:callable = None): self.tra...
NilsB98/Diffusion-Based-AD
loader/loader.py
loader.py
py
3,007
python
en
code
1
github-code
6
[ { "api_name": "torch.utils.data.Dataset", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 12, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 25, "usage_type": "name" }, { "api_name": "pathlib.Path", "...
28324614693
import pygame import random import math pygame.init() class DrawInformation: BLACK = 0, 0, 0 WHITE = 255, 255, 255 GREEN = 0, 255, 0 RED = 255, 0, 0 GREY = 128, 128, 128 BACKGROUND_COLOR = WHITE SIDE_PAD = 100 TOP_PAD = 150 GRADIENT = [ (207, 159, 255), (224, 176, ...
sanjaysaahu/sorting-alogorithm-visualizer
main.py
main.py
py
7,058
python
en
code
0
github-code
6
[ { "api_name": "pygame.init", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.font.SysFont", "line_number": 23, "usage_type": "call" }, { "api_name": "pygame.font", "line_number": 23, "usage_type": "attribute" }, { "api_name": "pygame.font.SysFont",...
1432020370
#!/usr/bin/env python3.7 from typing import List, Optional, Callable, Tuple, Any, Dict import fabio from datetime import datetime import argparse import numpy as np from utils import get_format import h5py def main(): parser = argparse.ArgumentParser( description="Make a list .lst of diffraction patterns...
anananacr/p09-utils
scripts/algorithms/list_hits.py
list_hits.py
py
1,191
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "h5py.File", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.array", "line...
18602688384
#User admin classes #Django from django.contrib.auth.admin import UserAdmin as BaseUserAdmin #combinar datos de profile y user from django.contrib import admin #Models from django.contrib.auth.models import User from users.models import Profile #Register your models here. #by convention 'admin' is always added to ...
SilviaAlarcon/Fitgram
users/admin.py
admin.py
py
2,166
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 14, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 14, "usage_type": "name" }, { "api_name": "django.contrib.admin.register", "line_number": 13, "usage_type": "call" }, ...
38050713302
import pandas as pd from datetime import datetime def preprocess(data): listings = pd.DataFrame(data, columns=["id", "listing_url", 'title', 'location', 'price', 'price_currency', 'listing_date', 'properties', 'description', 'scraped_date']) listings = pd.concat([listings, listings['properties'].apply(pd.Serie...
Adeeshaj/carvestor-analyzer
services/preprocess.py
preprocess.py
py
1,564
python
en
code
0
github-code
6
[ { "api_name": "pandas.DataFrame", "line_number": 5, "usage_type": "call" }, { "api_name": "pandas.concat", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.Series", "line_number": 6, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now"...
18917361962
# Inspired / borrowed from the `click-logging` python package. import logging import sys import traceback from enum import IntEnum from pathlib import Path from typing import IO, Any, Dict, Optional, Union import click class LogLevel(IntEnum): ERROR = logging.ERROR WARNING = logging.WARNING SUCCESS = log...
ApeWorX/ape
src/ape/logging.py
logging.py
py
8,244
python
en
code
736
github-code
6
[ { "api_name": "enum.IntEnum", "line_number": 12, "usage_type": "name" }, { "api_name": "logging.ERROR", "line_number": 13, "usage_type": "attribute" }, { "api_name": "logging.WARNING", "line_number": 14, "usage_type": "attribute" }, { "api_name": "logging.INFO", ...
22950183060
import pandas as pd import seaborn as sns from sklearn.model_selection import train_test_split from sklearn.metrics import mean_absolute_error, r2_score from sklearn.preprocessing import LabelEncoder, StandardScaler from sklearn.ensemble import RandomForestRegressor, AdaBoostRegressor from sklearn.tree import Dec...
WG983/Twitter-Sentiment-Analysis
compare-regressions.py
compare-regressions.py
py
5,915
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "seaborn.histplot", "line_number": 42, "usage_type": "call" }, { "api_name": "seaborn.histplot", ...
15361789827
import requests from bs4 import BeautifulSoup def get_ciphertext(url): response = requests.get(url) soup = BeautifulSoup(response.text, 'html.parser') data = soup.find_all('pre')[0].get_text().split('\n') ciphertext = [line for line in data if len(line) == 32] return ciphertext def find_first_byt...
95/ilc
w7/ctfcbc.py
ctfcbc.py
py
912
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 5, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 6, "usage_type": "call" } ]
2655279047
# Blurring Techinques import cv2 as cv img = cv.imread('photos/bhagsu.jpg') cv.imshow('Bhagsu', img) # Averaging average = cv.blur(img, (3,3)) cv.imshow('Average', average) # Gaussian blur gauss = cv.GaussianBlur(img, (3,3), 0) cv.imshow('Gaussian blur', gauss) # Median Blur median = cv.medianBlur(...
TenzinTsundue/Computer-Vision-task
OpenCV-Related/smoothing.py
smoothing.py
py
514
python
en
code
0
github-code
6
[ { "api_name": "cv2.imread", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.blur", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 10, "...
1796168362
import sqlite3 as sql class Data: def __init__(self, temperature: float, light: int, humidity: float, heat_index: float, ground_temperature: float, ground_moisture: float, microcontroller_id: int, microcontroller_user_id: int, data_id: int = None, timestamp: sql...
Akoens/GCMCSWebserver
models/data.py
data.py
py
1,705
python
en
code
0
github-code
6
[ { "api_name": "sqlite3.Timestamp", "line_number": 9, "usage_type": "attribute" } ]
10424195301
#-*- coding: utf-8 -*- u""" .. moduleauthor:: Martí Congost <marti.congost@whads.com> """ import cherrypy import os from tempfile import mkdtemp from zipfile import ZipFile from shutil import copyfileobj from cocktail.modeling import cached_getter from cocktail import schema from cocktail.persistence import datastore ...
marticongost/woost
woost/controllers/backoffice/uploadfilescontroller.py
uploadfilescontroller.py
py
3,237
python
en
code
0
github-code
6
[ { "api_name": "woost.controllers.backoffice.basebackofficecontroller.BaseBackOfficeController", "line_number": 26, "usage_type": "name" }, { "api_name": "cocktail.schema.Schema", "line_number": 34, "usage_type": "call" }, { "api_name": "cocktail.schema", "line_number": 34, ...
35800921046
import unittest import contextlib import io f = io.StringIO() with contextlib.redirect_stdout(f): from task import img output = f.getvalue().split('\n') class TestCase(unittest.TestCase): def test_ndim(self): expected, actual = str(img.ndim), output[1] self.assertEqual(expected, actual, msg="...
jetbrains-academy/Python-Libraries-NumPy
Projects/SVD/Load Image/tests/test_task.py
test_task.py
py
590
python
en
code
1
github-code
6
[ { "api_name": "io.StringIO", "line_number": 5, "usage_type": "call" }, { "api_name": "contextlib.redirect_stdout", "line_number": 6, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 11, "usage_type": "attribute" }, { "api_name": "task.img....
73022293948
import time import pickle import matplotlib.pyplot as plt from scipy.integrate import odeint import phys_funs as pf import channel_funs as cf import dynamics_funs as df from cfg import * from constants import * # =========== parameters =========== file = open("nexus_point_neuron_parameters.pkl",'rb') nexus...
amirdud/ca_spike_modulation
Fig4_3_two_variables.py
Fig4_3_two_variables.py
py
6,846
python
en
code
1
github-code
6
[ { "api_name": "pickle.load", "line_number": 13, "usage_type": "call" }, { "api_name": "time.time", "line_number": 53, "usage_type": "call" }, { "api_name": "scipy.integrate.odeint", "line_number": 64, "usage_type": "call" }, { "api_name": "dynamics_funs.compute_de...
41134496979
import os from dotenv import load_dotenv import openai import discord # Add intents intents = discord.Intents.default() intents.message_content = True client = discord.Client(intents = intents) # Get token and key load_dotenv() BOT_TOKEN = os.getenv('BOT_TOKEN') OPENAI_KEY = os.getenv('OPENAI_KEY') # Send prompt to ...
Zuha-SB/LangChain
discord-chatbot/main.py
main.py
py
1,075
python
en
code
0
github-code
6
[ { "api_name": "discord.Intents.default", "line_number": 7, "usage_type": "call" }, { "api_name": "discord.Intents", "line_number": 7, "usage_type": "attribute" }, { "api_name": "discord.Client", "line_number": 9, "usage_type": "call" }, { "api_name": "dotenv.load_...
72827959227
# a working prototype has been finally created ! from kivy.app import App # from kivy.uix.label import Label ;this import was not used from kivy.properties import ObjectProperty from kivy.uix.screenmanager import ScreenManager, Screen from kivy.lang import Builder Builder.load_file("design.kv") # focus_nex...
ilprofessore/python_kivy_gui_2.0
main.py
main.py
py
1,594
python
en
code
0
github-code
6
[ { "api_name": "kivy.lang.Builder.load_file", "line_number": 9, "usage_type": "call" }, { "api_name": "kivy.lang.Builder", "line_number": 9, "usage_type": "name" }, { "api_name": "kivy.uix.screenmanager.Screen", "line_number": 13, "usage_type": "name" }, { "api_nam...
27609107080
import re from datetime import datetime, timedelta import requests from bs4 import BeautifulSoup class Weather: def __init__(self): self.location_name: str = "" # 風向,單位 度,一般風向 0 表示無風 self.wind_direction: str = "" # 風速,單位 公尺/秒 self.wind_speed: int = 0 # 小時最大陣風風速,單位 ...
FawenYo/Eatender
project/weather/main.py
main.py
py
5,471
python
en
code
6
github-code
6
[ { "api_name": "requests.get", "line_number": 44, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 104, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 104, "usage_type": "name" }, { "api_name": "requests.get",...
73235161789
import spacy from spacy.tokens import Doc import pandas as pd from spacy.pipeline.dep_parser import DEFAULT_PARSER_MODEL from PartC import PartC import csv config = { "moves": None, "update_with_oracle_cut_size": 100, "learn_tokens": False, "min_action_freq": 30, "model": DEFAULT_PARSER_MODEL, } # def ...
jgrguric96/uni-Natural_Language_processing
Assignment_2/PartB.py
PartB.py
py
4,730
python
en
code
0
github-code
6
[ { "api_name": "spacy.pipeline.dep_parser.DEFAULT_PARSER_MODEL", "line_number": 13, "usage_type": "name" }, { "api_name": "pandas.read_table", "line_number": 36, "usage_type": "call" }, { "api_name": "csv.QUOTE_NONE", "line_number": 36, "usage_type": "attribute" }, { ...
38583960030
import logging # logging.basicConfig(level=logging.DEBUG) logger = logging.getLogger('test') import os from slack_sdk import WebClient import datetime as dt from slack_sdk.errors import SlackApiError TOKEN = "xoxb-3304749042240-3295636403457-PND6zGxAgmSk7NhoQYSnINeF" def get_channel_id(client, channel_name): "...
ssy0061/BODA-JUDA
trainingServer/AEye02/slack_post.py
slack_post.py
py
1,356
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 3, "usage_type": "call" }, { "api_name": "slack_sdk.errors.SlackApiError", "line_number": 44, "usage_type": "name" } ]
39697348269
import numpy as np import matplotlib.pyplot as plt data = np.loadtxt("time_series_K_fb=0,35_phi=1,5.txt") time = data[:, 0] intensity_1_1 = data[:, 1] intensity_1_2 = data[:, 2] intensity_1_3 = data[:, 3] intensity_1_4 = data[:, 4] data = np.loadtxt("time_series_K_fb=0,328_phi=2.86.txt") i...
sir-aak/microscopically-derived-rate-equations
plotscripts/mdre_plotscript_network_time_series.py
mdre_plotscript_network_time_series.py
py
4,736
python
en
code
1
github-code
6
[ { "api_name": "numpy.loadtxt", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_nu...
29717001734
from enum import Enum from math import inf from random import choice import numpy as np import collections import itertools from basePlayer import BasePlayer from controller import Controller from board import Board from minimaxPlayer import MiniMaxPlayer from randomPlayer import RandomPlayer from qlearnin...
Gbor97/TicTacToe
trainer.py
trainer.py
py
14,707
python
en
code
0
github-code
6
[ { "api_name": "board.Board", "line_number": 23, "usage_type": "call" }, { "api_name": "controller.Controller", "line_number": 24, "usage_type": "call" }, { "api_name": "generals.save", "line_number": 66, "usage_type": "call" }, { "api_name": "generals.save", "...
22633572797
from storytime import app import storytime.config as config import storytime.dbtools as dbtools from flask.ext.script import Manager def create_app(cfg=None): if cfg=='debug': app.config.from_object(config.debugConfig) elif cfg=='production': app.config.from_object(config.productionConfig) ...
Noura/storytime
run_app.py
run_app.py
py
651
python
en
code
0
github-code
6
[ { "api_name": "storytime.app.config.from_object", "line_number": 9, "usage_type": "call" }, { "api_name": "storytime.app.config", "line_number": 9, "usage_type": "attribute" }, { "api_name": "storytime.app", "line_number": 9, "usage_type": "name" }, { "api_name": ...
70941512829
from itertools import islice from typing import Dict, List import pandas as pd from instaloader import Post, Profile from loguru import logger from tqdm import tqdm from src import get_profile def generate_post_metadict(post: Post, full_metadata: bool = False ) ...
RickArko/Instagram
src/posts.py
posts.py
py
2,094
python
en
code
1
github-code
6
[ { "api_name": "instaloader.Post", "line_number": 12, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 14, "usage_type": "name" }, { "api_name": "instaloader.Profile", "line_number": 50, "usage_type": "name" }, { "api_name": "loguru.logger.debug"...
25940895514
from django.db import models from django.contrib.auth.models import AbstractUser # Create your models here. # User models that includes employee and employers class User(AbstractUser): is_email_verified = models.BooleanField(default=False) email = models.EmailField(unique=True) # log in with email instea...
Kjeff24/FileServer
myapp/models.py
models.py
py
1,822
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.auth.models.AbstractUser", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.models.BooleanField", "line_number": 8, "usage_type": "call" }, { "api_name": "django.db.models", "line_number": 8, "usage_type": "name" }, { ...
72217060668
#!/usr/bin/python3 """Test module for base model""" from models import storage from models.base_model import BaseModel import unittest import json class TestFileStorage(unittest.TestCase): """Test module for base class""" def test_new_object(self): """test_new_object function Tests that when...
Ayo-Awe/AirBnB_clone
tests/test_models/test_engine/test_file_storage.py
test_file_storage.py
py
1,631
python
en
code
0
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 10, "usage_type": "attribute" }, { "api_name": "models.base_model.BaseModel", "line_number": 19, "usage_type": "call" }, { "api_name": "models.storage.all", "line_number": 21, "usage_type": "call" }, { "api_name": ...
71107402109
# import the necessary packages import requests import numpy as np import pandas as pd import json import time from time import localtime, strftime import traceback import cv2 # initialize the Keras REST API endpoint URL KERAS_REST_API_URL = "http://127.0.0.1:5001/predict" #KERAS_REST_API_URL = "http://app02-stg.inwi...
inwini/plant-monitor
API_request_test.py
API_request_test.py
py
2,010
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 20, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 26, "usage_type": "call" }, { "api_name": "time.time", "line_number": 28, "usage_type": "call" }, { "api_name": "requests.post", "line_number...
69877651388
""" 287. Find the Duplicate Number src: https://leetcode.com/problems/find-the-duplicate-number/ Given an array of integers nums containing n + 1 integers where each integer is in the range [1, n] inclusive. There is only one repeated number in nums, return this repeated number. You must solve the problem without mo...
awave1/leetcode
solutions/medium/find_duplicate_number.py
find_duplicate_number.py
py
2,388
python
en
code
1
github-code
6
[ { "api_name": "typing.Optional", "line_number": 19, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 16, "usage_type": "name" } ]
22575363842
import os, wandb import wandb.apis.reports as wr assert os.getenv('WANDB_API_KEY'), 'You must set the WANDB_API_KEY environment variable' def get_baseline_run( entity: str, project: str, tag: str ): """ The function get_baseline_run retrieves the baseline run from a project using tags. Parameters...
kaustubhbhavsar/issue-driven-model-comparison-wandb
generate_reports.py
generate_reports.py
py
3,082
python
en
code
1
github-code
6
[ { "api_name": "os.getenv", "line_number": 4, "usage_type": "call" }, { "api_name": "wandb.Api", "line_number": 25, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 51, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 52, "...
34597815853
''' @author: Terry Ruas 2018-03-12 ''' #general libraries import re import numpy as np from nltk.tokenize import RegexpTokenizer from stop_words import get_stop_words #self-packages import wordnet_module.my_data as md def build_word_data(words, trained_model, recurrent_flag): import wordnet_module.synset_tracker ...
truas/MSSA
text_module/text_process.py
text_process.py
py
3,461
python
en
code
2
github-code
6
[ { "api_name": "wordnet_module.synset_tracker.build_synset_data", "line_number": 18, "usage_type": "call" }, { "api_name": "wordnet_module.synset_tracker", "line_number": 18, "usage_type": "name" }, { "api_name": "wordnet_module.my_data.WordsData", "line_number": 20, "usag...
42976625048
import pytest import copy import os import torch import torch.nn as nn from fl_simulation.client.update import ControlVarDiff, FedAvgModelUpdate, ModelDiff, ScaffoldModelUpdate from fl_simulation.server.aggregation import AggregatorWithDropouts, FedAvgAggregator, ScaffoldAggregator torch.manual_seed(0) device = torc...
microsoft/fl-simulation
tests/fl_simulation/server/test_aggregation.py
test_aggregation.py
py
5,606
python
en
code
11
github-code
6
[ { "api_name": "torch.manual_seed", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.device", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.cuda", ...
40635224910
from dra import dra from clustering import clustering, analyze_clusters import numpy as np import mlrose_hiive as ml from util import plt, plot, set_seed, start_time from sklearn.metrics import accuracy_score from data import yoga_labels_count, get_yoga_data, get_stock_data, stock_labels_count from clustering import km...
duttaoindril/omscs_7641
3/nn.py
nn.py
py
4,293
python
en
code
0
github-code
6
[ { "api_name": "mlrose_hiive.NeuralNetwork", "line_number": 14, "usage_type": "call" }, { "api_name": "util.start_time", "line_number": 27, "usage_type": "call" }, { "api_name": "data.loss", "line_number": 31, "usage_type": "attribute" }, { "api_name": "sklearn.met...
36783545761
from flask import request from ora_adapter import Oracle from server import app from server.model import ErrorHandlerAndSend @app.endpoint("vftae") @ErrorHandlerAndSend(app) def vftae(): _id = request.form.get('id') name = request.form.get('name') # type: str variable_type = request.form.get('variable_t...
AzaubaevViktor/gibdd_db
server/controller/vehicleFeatureType.py
vehicleFeatureType.py
py
1,111
python
en
code
0
github-code
6
[ { "api_name": "flask.request.form.get", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.request.form", "line_number": 11, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 11, "usage_type": "name" }, { "api_name": "flask.re...
25963948816
import tensorflow as tf import tensorflow_hub as hub import matplotlib.pyplot as plt import numpy as np import os import pandas as pd import re import seaborn as sns # 디렉토리 안에 모든 파일들을 DataFrame 형태로 읽어옵니다. # 구체적으로 문장(sentence)과 문장의 감정상태의 확신정도(sentiment=1~10)를 읽어옵니다. def load_directory_data(directory): data = {} ...
2019-graduation-work/keras-modeling
testPy.py
testPy.py
py
6,753
python
ko
code
1
github-code
6
[ { "api_name": "os.listdir", "line_number": 17, "usage_type": "call" }, { "api_name": "tensorflow.gfile.GFile", "line_number": 18, "usage_type": "call" }, { "api_name": "tensorflow.gfile", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.path.join"...
72531842109
"""Adds priority col Revision ID: c3c564121364 Revises: 2ca532b0831f Create Date: 2022-11-15 13:51:16.928575+00:00 """ import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision = "c3c564121364" down_revision = "2ca532b0831f" branch_labels = None depends_on = None def upgrade(...
ITISFoundation/osparc-simcore
packages/postgres-database/src/simcore_postgres_database/migration/versions/c3c564121364_adds_priority_col.py
c3c564121364_adds_priority_col.py
py
721
python
en
code
35
github-code
6
[ { "api_name": "alembic.op.add_column", "line_number": 20, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 20, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer...
21971418424
from pgmpy.readwrite import BIFReader from pgmpy.inference import VariableElimination #Las nuevas variables var={ "age":["Adulto","AdultoJoven","AdultoMayor"], "sex":['1.0','0.0'], "cp":['1.0','2.0','3.0','4.0'], #OJO HAY QUE ANIADIR HIPOTENSION AL TRESTBPS "trestbps":["TensionNormal","Hipertensi...
SantiagoZub/repoACTDproyecto2
ModelosYEstadisticas/mundo.py
mundo.py
py
3,370
python
es
code
0
github-code
6
[ { "api_name": "pgmpy.readwrite.BIFReader", "line_number": 29, "usage_type": "call" }, { "api_name": "pgmpy.readwrite.BIFReader", "line_number": 30, "usage_type": "call" }, { "api_name": "pgmpy.readwrite.BIFReader", "line_number": 31, "usage_type": "call" }, { "api...
39263211856
from django.contrib.auth.models import User from unittest import TestCase from eums.models.users import UserProfile class UserProfileTest(TestCase): def test_user_fields(self): user_profile = UserProfile() fields = [str(item.attname) for item in user_profile._meta.fields] self.assertEqual...
unicefuganda/eums
eums/test/models/test_users_model.py
test_users_model.py
py
695
python
en
code
9
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 7, "usage_type": "name" }, { "api_name": "eums.models.users.UserProfile", "line_number": 9, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.User.objects.create", "line_number": 16, "usage_type": "call" ...
25573645904
from flask import Flask, jsonify, request from flask_sqlalchemy import SQLAlchemy from datetime import datetime from models import Hospital, Doctor, Patient, Appointment, PatientsReports import os db = SQLAlchemy() app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql://root:Auca%402020@localhost/ho...
makuachteny/MEDCONNECT
Back-end/models/app.py
app.py
py
5,193
python
en
code
2
github-code
6
[ { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "models.Patient.query.all", "line_number": 81, "usage_type": "call" }, { "api_name": "mode...
71498170748
from django import http from django import forms as django_forms from django.views import generic from . import forms, models from .domain import gm_descriptions, player_descriptions class Home(generic.TemplateView): template_name = "home.html" def get_context_data(self, **kwargs: object) -> dict[str, objec...
LomaxOnTheRun/ChatRPG
src/game/views.py
views.py
py
4,740
python
en
code
0
github-code
6
[ { "api_name": "django.views.generic.TemplateView", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.views.generic", "line_number": 9, "usage_type": "name" }, { "api_name": "django.views.generic.FormView", "line_number": 20, "usage_type": "attribute" ...
11239354134
from django.contrib.auth.forms import UserChangeForm, UserCreationForm from django import forms from .models import * class MyUserChangeForm(UserChangeForm): class Meta: model = User fields = '__all__' class MyUserCreationForm(UserCreationForm): class Meta: model = User field...
amaguri-star/cross_book
cross_book/forms.py
forms.py
py
2,130
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.auth.forms.UserChangeForm", "line_number": 6, "usage_type": "name" }, { "api_name": "django.contrib.auth.forms.UserCreationForm", "line_number": 12, "usage_type": "name" }, { "api_name": "django.forms.ModelForm", "line_number": 18, "usage_typ...
8499193704
class StockAnalysis(object): def __init__(self, order_history, owned_stocks, dates_arr, date_keyed, buy_conditions, sell_conditions): self.order_history = order_history self.owned_stocks = owned_stocks self.dates_arr = dates_arr self.date_keyed = date_keyed self.buy_conditions = buy_conditions self.sell_co...
MikeDombo/Stock_Backtester
StockAnalysis.py
StockAnalysis.py
py
7,253
python
en
code
3
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", ...
71474373307
# A small example of training an SVM and classifying an input data import cv2 import numpy as np import matplotlib.pyplot as plt def get_human_label(raw_label): return 'red' if raw_label == 0 else 'blue' def main(): # Create a sample training data and associated labels train_data = np.array([[1, 1], [2,...
gkostadinov/py-pil-imageprocessing
10-opencv/3.svm.py
3.svm.py
py
1,548
python
en
code
5
github-code
6
[ { "api_name": "numpy.array", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 15, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.int", "line_numb...
9274497487
#Dylan import pygame import random pygame.init() pygame.mixer.init() # para cargar los audios que se usan fondo = pygame.image.load('assets/fondo.png') laser_sonido = pygame.mixer.Sound('laser.wav') explosion_sonido = pygame.mixer.Sound('explosion.wav') golpe_sonido = pygame.mixer.Sound('golpe.wav') explosion_list...
dylanbarajas/kodlan-Pygame
main.py
main.py
py
7,421
python
es
code
0
github-code
6
[ { "api_name": "pygame.init", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.mixer.init", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.mixer", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pygame.image.load", ...
27593499704
import logging import os import sys client_logger = logging.getLogger('client') PATH = os.path.dirname(os.path.abspath(__file__)) PATH = os.path.join(PATH, 'client.log') formatter = logging.Formatter('%(asctime)s %(levelname)-8s %(funcName)s ' '%(message)s',datefmt='%Y %b %d %H:%M:%S',) f...
ide007/DB_and_PyQT
Lesson_1/logs/client_log_config.py
client_log_config.py
py
733
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "li...
72408778428
from flask import Flask, request from datetime import datetime import simplejson as json app = Flask(__name__) db = {} # key: value -> "foo": "hello world" db_history = {} # key: [{value1, timestamp1}, {value2, timestamp2}] @app.route("/<key>", methods = ["GET", "PUT", "DELETE"]) def main(key): # retr...
aytanyz/key-value-store
main.py
main.py
py
1,980
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 13, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 13, "usage_type": "name" }, { "api_name": "flask.request.meth...
3233569816
from __future__ import (absolute_import, division, print_function, unicode_literals) import argparse import datetime # The above could be sent to an independent module import backtrader as bt import alpaca_backtrader_api class TestStrategy(bt.Strategy): params = dict( smaperiod=...
alpacahq/alpaca-backtrader-api
sample/strategy_sample_code.py
strategy_sample_code.py
py
17,537
python
en
code
547
github-code
6
[ { "api_name": "backtrader.Strategy", "line_number": 13, "usage_type": "attribute" }, { "api_name": "backtrader.Order", "line_number": 18, "usage_type": "attribute" }, { "api_name": "backtrader.indicators.MovAv.SMA", "line_number": 39, "usage_type": "call" }, { "ap...
32617478205
import numpy as np from time import time from sklearn.utils import check_random_state from textwrap import dedent def pp(problem, user, max_iters=100, verbose=False, rng=None, timeout=None, improve_margins=None, use_mean_margin=False): rng = check_random_state(rng) print(dedent('''\ elici...
unitn-sml/pcl
parts/coactive.py
coactive.py
py
1,971
python
en
code
1
github-code
6
[ { "api_name": "sklearn.utils.check_random_state", "line_number": 10, "usage_type": "call" }, { "api_name": "textwrap.dedent", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 17, "usage_type": "call" }, { "api_name": "time.tim...
38777236576
import utils from datetime import datetime,timedelta,date from cn_stock_holidays.zipline.default_calendar import shsz_calendar import tushare as ts import click import pandas as pd import matplotlib.pyplot as plt import matplotlib matplotlib.style.use('ggplot') #today = datetime.now().date() #checkday = today-timedelt...
maxwell-lv/MyQuant
cixinindex.py
cixinindex.py
py
2,110
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.style.use", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.style", "line_number": 9, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 22, "usage_type": "call" }, { "api_name": "dateti...
4068002481
import gcsfs import pickle import pandas as pd from google.cloud import storage class GCSUtil: def __init__(self, bucket_name): self.client = storage.Client() self.bucket = self.client.get_bucket(bucket_name) self.bucket_name = bucket_name self.datapath = "gcs://{}/".format(bucket_n...
SamarthGupta93/gcp-utils
gcsutil.py
gcsutil.py
py
1,158
python
en
code
0
github-code
6
[ { "api_name": "google.cloud.storage.Client", "line_number": 8, "usage_type": "call" }, { "api_name": "google.cloud.storage", "line_number": 8, "usage_type": "name" }, { "api_name": "gcsfs.GCSFileSystem", "line_number": 12, "usage_type": "call" }, { "api_name": "pa...
23678285402
from django import forms from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit, Layout, Row, Column from django.core.exceptions import ValidationError from django.utils import timezone class TagSettingsForm(forms.Form): formula = forms.ChoiceField(choices=[("mean", "Mean"), ("median", ...
Bhavatu/oura_tag
oura_tag_app/oura_tag_app/forms.py
forms.py
py
2,138
python
en
code
0
github-code
6
[ { "api_name": "django.forms.Form", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 8, "usage_type": "name" }, { "api_name": "django.forms.ChoiceField", "line_number": 9, "usage_type": "call" }, { "api_name": "django.form...
12932566568
import json from django.contrib.staticfiles import finders from django.shortcuts import render from django.urls import re_path as url def jslicenses(request): jslicenses_file = finders.find("jssources/jslicenses.json") jslicenses_data = {} if jslicenses_file is not None: jslicenses_data = json.lo...
SoftwareHeritage/swh-web
swh/web/jslicenses/urls.py
urls.py
py
617
python
en
code
11
github-code
6
[ { "api_name": "django.contrib.staticfiles.finders.find", "line_number": 9, "usage_type": "call" }, { "api_name": "django.contrib.staticfiles.finders", "line_number": 9, "usage_type": "name" }, { "api_name": "json.load", "line_number": 12, "usage_type": "call" }, { ...
17569857503
import pygame import math from game import Game pygame.init() clock = pygame.time.Clock() FPS = 60 # generer la fenetre de notre jeu pygame.display.set_caption("shooter_game") screen = pygame.display.set_mode((1080, 720)) runnig = True background = pygame.image.load('PygameAssets-main/bg.jpg', ) banner = ...
Baptiste-Bachelier/shooter_pygame
main.py
main.py
py
1,884
python
en
code
0
github-code
6
[ { "api_name": "pygame.init", "line_number": 4, "usage_type": "call" }, { "api_name": "pygame.time.Clock", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.time", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pygame.display.set_captio...
14024991711
import json from typing import Dict, Any import config import events from custom_types import AlexaResponse def log_event_to_cloudwatch(event: Dict[str, Any]) -> None: print(json.dumps(event)) def validate_application_id(event: Dict[str, Any]) -> None: application_id: str = ( event["session"]["app...
ChristChurchMayfair/ccm-alexa-skill
src/alexa_main.py
alexa_main.py
py
949
python
en
code
null
github-code
6
[ { "api_name": "typing.Dict", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 10, "usage_type": "name" }, { "api_name": "json.dumps", "line_number": 11, "usage_type": "call" }, { "api_name": "typing.Dict", "line_number": 14...
25987408258
import os from pathlib import Path from testcase import CT_PROFILE, CT_API_KEY, PROP_MODIFIED from testcase import TestCase class TestRun(TestCase): def test_run_inheritance_env_only(self): base_cmd = self.get_cli_base_cmd() cmd_env = self.get_cmd_env() proj_name = self.make_name("run-env...
cloudtruth/cloudtruth-cli
integration-tests/test_run.py
test_run.py
py
7,142
python
en
code
4
github-code
6
[ { "api_name": "testcase.TestCase", "line_number": 8, "usage_type": "name" }, { "api_name": "testcase.CT_API_KEY", "line_number": 82, "usage_type": "name" }, { "api_name": "testcase.CT_PROFILE", "line_number": 83, "usage_type": "argument" }, { "api_name": "testcase...
14453535538
from icalendar import Calendar, Event from typing import List def create_calendar(lst_event: List[Event]) -> Calendar: """Create calendar Args: lst_event (List[Event]): list of events Returns: Calendar Create calendar from list of events""" cal = Calendar() cal.add("prodid", "-//FREDLE09/...
fredle09/UIT-VNU_UniversityScheduleConversionTool
utils/create_calendar.py
create_calendar.py
py
426
python
en
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" }, { "api_name": "icalendar.Event", "line_number": 5, "usage_type": "name" }, { "api_name": "icalendar.Calendar", "line_number": 11, "usage_type": "call" }, { "api_name": "icalendar.Calendar", ...
40441098304
from flask import Flask, request from flask_restx import Api, Resource from flask_sqlalchemy import SQLAlchemy from marshmallow import Schema, fields # Создаем приложение Flask app = Flask(__name__) # Настраиваем работу с базой данных app.config['SQLALCHEMY_DATABASE_URI'] = "sqlite:///test.db" app.config['SQLALCHEMY_...
namazovanton/homework_17
main.py
main.py
py
17,296
python
ru
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 14, "usage_type": "call" }, { "api_name": "marshmallow.Schema", "line_number": 45, "usage_type": "name" }, { "api_name": "marshmallow...
18604315833
import pyarrow import pandas as pd import numpy as np import seaborn import matplotlib.pylab as plt from scipy.stats import gaussian_kde import math class ProcessGameState: def __init__(self, game_data): self.state = pd.read_parquet(game_data, engine='pyarrow') def in_boundaries(self, x_bound, y_bound,...
swayamrana/Evil-Genius-SWE-Intern-Assessment
GameState/ProcessGameState.py
ProcessGameState.py
py
4,027
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_parquet", "line_number": 11, "usage_type": "call" }, { "api_name": "seaborn.heatmap", "line_number": 67, "usage_type": "call" }, { "api_name": "scipy.stats.gaussian_kde", "line_number": 70, "usage_type": "call" }, { "api_name": "numpy.li...
73785814269
"""testing removal of post_reactions Revision ID: 1c2eab9014ec Revises: 02f37635144e Create Date: 2021-06-23 14:18:01.564901 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '1c2eab9014ec' down_revision = '02f37635144e' branch_labels = None depends_on = None d...
composerben/flask-group-project
migrations/versions/20210623_141801_testing_removal_of_post_reactions.py
20210623_141801_testing_removal_of_post_reactions.py
py
1,184
python
en
code
13
github-code
6
[ { "api_name": "alembic.op.drop_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "alembic.op.create_table", "line_number": 27, "usage_type": "call" }, { "api_name": "alembic.op",...
75316051386
import os import wx from wx.lib.pubsub import pub import pandas as pd from boautil.file import open_file from ..model.project import Project from ..form.file import NewProjectDialog, OpenProjectDialog, SaveProjectDialog, SaveAsProjectDialog, CloseProjectDialog from ..form.about import AboutDialog from ..form.settin...
JoenyBui/boa-gui
boaui/controller/dlg.py
dlg.py
py
5,457
python
en
code
0
github-code
6
[ { "api_name": "form.file.NewProjectDialog", "line_number": 66, "usage_type": "call" }, { "api_name": "wx.lib.pubsub.pub.sendMessage", "line_number": 69, "usage_type": "call" }, { "api_name": "config.EVT_CHANGE_PROJECT", "line_number": 69, "usage_type": "argument" }, {...
3607194607
'''# -*- coding: utf-8 -*- """ Created on Tue Nov 17 21:40:41 2020 @author: win10 """ # 1. Library imports import uvicorn from fastapi import FastAPI from HeartDiseases import HeartDisease import numpy as np import pickle import pandas as pd # 2. Create the app object app = FastAPI() pickle_in = ope...
paudel-sandesh/heart_disease_detection
app.py
app.py
py
3,285
python
en
code
4
github-code
6
[ { "api_name": "flask.Flask", "line_number": 87, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 88, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 92, "usage_type": "call" }, { "api_name": "flask.request.form.valu...
38456706936
# Machine Learning Practical (INFR11119), # Pawel Swietojanski, University of Edinburgh import numpy import logging from mlp.layers import Layer, max_and_argmax from numpy.lib.stride_tricks import as_strided as ast from numpy import newaxis logger = logging.getLogger() logger.setLevel(logging.INFO) ''' from distuti...
stathislempesis/convolution_neural_network_msc_assignment
conv.py
conv.py
py
19,061
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 12, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "line_number": 51, "usage_type": "call" }, { "api_name": "numpy.array", "li...
2182199459
from vertex import Vertex import logging import json class Graph: def __init__(self): """ Constructor for a Graph Object """ self.vertex_list = {} self.graph_size = 0 def __iter__(self): """ Iterator :return: Returns the iterative of the values ...
ahchang6/web_scraping
graph.py
graph.py
py
4,154
python
en
code
0
github-code
6
[ { "api_name": "logging.info", "line_number": 48, "usage_type": "call" }, { "api_name": "vertex.Vertex", "line_number": 57, "usage_type": "call" }, { "api_name": "vertex.add_neighbor", "line_number": 76, "usage_type": "call" }, { "api_name": "json.dumps", "line...
10899935319
from keras.callbacks import CSVLogger, ModelCheckpoint, EarlyStopping from keras.callbacks import ReduceLROnPlateau from keras.preprocessing.image import ImageDataGenerator from keras.layers import Activation, Convolution2D, Dropout, Conv2D from keras.layers import AveragePooling2D, BatchNormalization from keras.layers...
hassanahmed95/My_True_Face
ML_training/mini_xeption_model.py
mini_xeption_model.py
py
5,644
python
en
code
1
github-code
6
[ { "api_name": "keras.regularizers.l2", "line_number": 18, "usage_type": "call" }, { "api_name": "keras.layers.Input", "line_number": 21, "usage_type": "call" }, { "api_name": "keras.layers.Conv2D", "line_number": 22, "usage_type": "call" }, { "api_name": "keras.la...
74743635386
from camelot.view.model_thread import post from choiceseditor import ChoicesEditor class OneToManyChoicesEditor(ChoicesEditor): def __init__(self, parent, target=None, nullable=True, **kwargs): super(OneToManyChoicesEditor, self).__init__(parent, **kwargs) assert target!=None self._targe...
kurtraschke/camelot
camelot/view/controls/editors/onetomanychoiceseditor.py
onetomanychoiceseditor.py
py
836
python
en
code
4
github-code
6
[ { "api_name": "choiceseditor.ChoicesEditor", "line_number": 4, "usage_type": "name" }, { "api_name": "camelot.view.model_thread.post", "line_number": 11, "usage_type": "call" } ]