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
16462145161
import cv2 import numpy as np # np.set_printoptions(threshold=np.inf) import time from collections import deque import threading # Low Quality # PAUSE_INDICATOR = (-1, 0) # RESOLUTION = "480p15" # FPS = 15 # Production quality PAUSE_INDICATOR = (-1, 0) RESOLUTION = "1440p60" FPS = 60 cv2.namedWindow("Frame", 0); cv...
bsamseth/masters-presentation
player.py
player.py
py
5,552
python
en
code
2
github-code
6
[ { "api_name": "cv2.namedWindow", "line_number": 19, "usage_type": "call" }, { "api_name": "cv2.resizeWindow", "line_number": 20, "usage_type": "call" }, { "api_name": "cv2.namedWindow", "line_number": 21, "usage_type": "call" }, { "api_name": "cv2.WND_PROP_FULLSCR...
15191375755
from collections import defaultdict, deque class Solution: def isBipartite(self, graph: List[List[int]]) -> bool: color = defaultdict(int) seen = set() q = deque() for node1 in range(len(graph)): if node1 in seen: continue color[node1] = 1 ...
Dumbris/leetcode
medium/785.is-graph-bipartite.py
785.is-graph-bipartite.py
py
1,085
python
en
code
0
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 5, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 7, "usage_type": "call" } ]
43724375221
import sys from PySide6.QtGui import QGuiApplication from PySide6.QtQml import * from ppt import Maker if __name__ == "__main__": app = QGuiApplication(sys.argv) qmlRegisterType(Maker, "ppt", 1, 0, "Maker") engine = QQmlApplicationEngine() engine.load('main.qml') if not engine.rootObjects(): ...
JunTae90/MinChae
main.py
main.py
py
400
python
en
code
0
github-code
6
[ { "api_name": "PySide6.QtGui.QGuiApplication", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 7, "usage_type": "attribute" }, { "api_name": "ppt.Maker", "line_number": 8, "usage_type": "argument" }, { "api_name": "sys.exit", ...
8397431053
import os from wsgiref.simple_server import make_server from pyramid.config import Configurator from colander import ( Boolean, Integer, Length, MappingSchema, OneOf, SchemaNode, SequenceSchema, String ) from deform import ( Form, ValidationFailure, widget ) here = os.p...
tennisracket/bonkh
bonkh/bonkh/app.py
app.py
py
1,227
python
en
code
0
github-code
6
[ { "api_name": "os.path.dirname", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 25, "usage_type": "call" }, { "api_name": "colander.MappingSchema",...
2845548081
from django.shortcuts import render from .models import Directores, Peliculas def index (request): directores = Directores.objects.all() return render(request, 'index.html', context={ 'directores': directores, }) # Capturando la variable ids pasada en la url # El nombre de la variable debe coinc...
Ranset/django_openbootcamp_exercise12
directores/views.py
views.py
py
1,805
python
es
code
0
github-code
6
[ { "api_name": "models.Directores.objects.all", "line_number": 6, "usage_type": "call" }, { "api_name": "models.Directores.objects", "line_number": 6, "usage_type": "attribute" }, { "api_name": "models.Directores", "line_number": 6, "usage_type": "name" }, { "api_n...
27250414296
import django from django.contrib import admin from django.urls import path, include from django.conf.urls.static import static from django.conf import settings from drf_yasg.views import get_schema_view from rest_framework.permissions import AllowAny from drf_yasg import openapi schema_url_v1_patterns = [ path(...
moon-hy/lunch-recommendation
config/urls.py
urls.py
py
1,754
python
en
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 12, "usage_type": "call" }, { "api_name": "django.urls.include", "line_number": 12, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 13, "usage_type": "call" }, { "api_name": "django.urls.inc...
41417945016
#!/usr/bin/env python3 # Cryptopals Challenge, Set 2, Challenge 12 # CJ Guttormsson # 2017-01-03 import sys sys.path.append('..') from common import (get_random_key, base64_to_bytes, aes_128_ecb_encrypt, guess_mode, pkcs7_pad) import random import itertools ############# # CONSTANTS # ##########...
cjguttormsson/cryptopals
set2/challenge12.py
challenge12.py
py
3,257
python
en
code
1
github-code
6
[ { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "common.get_random_key", "line_number": 20, "usage_type": "call" }, { "api_name": "common.base64_to_by...
1112432236
import numpy as np from PIL import Image import re from wordcloud import WordCloud, ImageColorGenerator, STOPWORDS import matplotlib.pyplot as plt import matplotlib.pyplot as plt mask= plt.imread('b.jpg') #准备utf-8编码的文本文件file fo=open('input.txt', 'r', encoding='utf-8') strThousand = fo.read().lower() fo.close() #print(...
Wang993/code_
code/ENGLISH WORD FRUQUECY_wordcloud.py
ENGLISH WORD FRUQUECY_wordcloud.py
py
1,768
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.pyplot.imread", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 7, "usage_type": "name" }, { "api_name": "wordcloud.WordCloud", "line_number": 56, "usage_type": "call" }, { "api_name": "matplotl...
1492499597
import pymysql from pymysql import connect # from baiyu.function.zudai_to_fumudai import * from baiyu.models import * import datetime class OpenDB(object): def __init__(self): # 初始化 self.conn = connect(host='localhost', port=3306, user='root', password='123456', database='forecastsystem', charset=...
Suefly/BoyarForecastSystem
baiyu/db.py
db.py
py
45,424
python
en
code
0
github-code
6
[ { "api_name": "pymysql.connect", "line_number": 11, "usage_type": "call" } ]
71888988667
""" 需要备份的文件和目录由一个列表指定。 备份应该保存在主备份目录中。 文件备份成一个zip文件。 zip存档的名称是当前的日期和时间。 我们使用标准的zip命令,它通常默认地随Linux/Unix发行版提供。Windows用户可以使用Info-Zip程序。注意你可以使用任何地存档命令, 只要它有命令行界面就可以了,那样的话我们可以从我们的脚本中传递参数给它。 """ import zipfile def zip_files(files, zip_name): zip = zipfile.ZipFile( zip_name, 'w') for file in files: print (...
fivespeedasher/Pieces
重要文件创建备份.py
重要文件创建备份.py
py
874
python
zh
code
0
github-code
6
[ { "api_name": "zipfile.ZipFile", "line_number": 16, "usage_type": "call" } ]
43633665683
# pylint: disable=no-self-use,invalid-name from __future__ import division from __future__ import absolute_import import pytest from allennlp.data.dataset_readers.conll2003 import Conll2003DatasetReader from allennlp.common.util import ensure_list from allennlp.common.testing import AllenNlpTestCase class TestConll...
plasticityai/magnitude
pymagnitude/third_party/allennlp/tests/data/dataset_readers/conll2003_dataset_reader_test.py
conll2003_dataset_reader_test.py
py
1,471
python
en
code
1,607
github-code
6
[ { "api_name": "allennlp.data.dataset_readers.conll2003.Conll2003DatasetReader", "line_number": 16, "usage_type": "call" }, { "api_name": "allennlp.common.testing.AllenNlpTestCase.FIXTURES_ROOT", "line_number": 17, "usage_type": "attribute" }, { "api_name": "allennlp.common.testin...
20573212978
from flask import Flask, send_file app = Flask(__name__) from tools.sound_file_generator import sound_generator from tools.interval import Interval @app.route("/") def index (): return "MusicApp is active" @app.route("/audiofile/<note>") def get_note_sound(note): generator = sound_generator() sound_url = ...
DanieleSpera/EarTraningAPI
__init__.py
__init__.py
py
822
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 3, "usage_type": "call" }, { "api_name": "tools.sound_file_generator.sound_generator", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.send_file", "line_number": 16, "usage_type": "call" }, { "api_name": ...
21217863407
import cgi from http.server import BaseHTTPRequestHandler,HTTPServer from db_setup import Base,Restaurant,MenuItem from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker engine = create_engine('sqlite:///restaurantmenu.db') Base.metadata.bind = engine DBSession = sessionmaker(bind=engine) sess...
SelbayevAlmas/fullstack_foundations_example
myserver.py
myserver.py
py
7,756
python
en
code
1
github-code
6
[ { "api_name": "sqlalchemy.create_engine", "line_number": 10, "usage_type": "call" }, { "api_name": "db_setup.Base.metadata", "line_number": 11, "usage_type": "attribute" }, { "api_name": "db_setup.Base", "line_number": 11, "usage_type": "name" }, { "api_name": "sq...
27009683508
from sklearn.gaussian_process import GaussianProcessRegressor def run(x_train, y_train, x_test, y_test, kernel, alpha, optimizer, n_restarts_optimizer, normalize_y, copy_X_train, random_state ): reg = GaussianProcessRegressor(kernel=kernel, alpha=alpha, ...
lisunshine1234/mlp-algorithm-python
machine_learning/regression/gaussian_processes/GaussianProcessRegressor/run.py
run.py
py
1,133
python
en
code
0
github-code
6
[ { "api_name": "sklearn.gaussian_process.GaussianProcessRegressor", "line_number": 7, "usage_type": "call" } ]
30107078628
""" Python Package Imports """ # Not Applicable """ Django Package Support """ from django.contrib import admin """ Internal Package Support """ """ -- IMPORTED AT APPROPRIATE SUBSECTION -- """ """ event/admin.py Author: Matthew J Swann Version: 1.0 Last Update: 2014-06-05 Update b...
mjs0031/view_trials
Event/admin.py
admin.py
py
1,197
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 24, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 24, "usage_type": "name" }, { "api_name": "django.contrib.admin.site.register", "line_number": 42, "usage_type": "call" ...
36052032500
import cv2 cap = cv2.VideoCapture(1,cv2.CAP_DSHOW) if not cap.isOpened: print('Cant open camera') exit(0) cap.set(3,480) cap.set(4,720) cnt = 80 path = "Main_picture/" ret,frame = cap.read() H,W,_ = frame.shape while True: ret,frame = cap.read() cv2.circle(frame,(W//2,H//2),5,(0,255,0),-1) ...
HieunnUTE/Rubik-solver-with-Image-processing
capture.py
capture.py
py
628
python
en
code
3
github-code
6
[ { "api_name": "cv2.VideoCapture", "line_number": 2, "usage_type": "call" }, { "api_name": "cv2.CAP_DSHOW", "line_number": 2, "usage_type": "attribute" }, { "api_name": "cv2.circle", "line_number": 14, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_...
9074380203
import requests import pandas as pd from pytube import YouTube, Search import os from pathlib import Path from .serializers import * # Youtube credentials YOUTUBE_KEY_API = 'YOUR_YOUTUBE_KEY_API' # Setting url for videos and searching list SEARCH_URL = 'https://www.googleapis.com/youtube/v3/search' VIDEOS_URL = 'htt...
nikavgeros/DJ-Studio
backend/dj_studio/utils.py
utils.py
py
9,608
python
en
code
0
github-code
6
[ { "api_name": "pathlib.Path.home", "line_number": 17, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 17, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 70, "usage_type": "call" }, { "api_name": "requests.json", "line...
42483090749
# pylint: disable=redefined-outer-name, unused-argument """ test src/config.py """ from contextlib import contextmanager import pytest from src.config import ConfigLoader @contextmanager def mock_open(config_content): """ Create config from mock file """ try: yield config_content finally...
dom38/secret-distribution-operator
tests/config_test.py
config_test.py
py
1,161
python
en
code
0
github-code
6
[ { "api_name": "contextlib.contextmanager", "line_number": 12, "usage_type": "name" }, { "api_name": "pytest.fixture", "line_number": 23, "usage_type": "attribute" }, { "api_name": "src.config.ConfigLoader", "line_number": 44, "usage_type": "call" }, { "api_name": ...
26555794429
from django.test import TestCase from django.contrib.contenttypes.models import ContentType from .models import RootObject, Uri class ModelTestCase(TestCase): def setUp(cls): # Set up data for the whole TestCase user_type = ContentType.objects.get(app_label="auth", model="user") RootObjec...
acdh-oeaw/apis-core-rdf
apis_core/apis_metainfo/test_models.py
test_models.py
py
778
python
en
code
3
github-code
6
[ { "api_name": "django.test.TestCase", "line_number": 7, "usage_type": "name" }, { "api_name": "django.contrib.contenttypes.models.ContentType.objects.get", "line_number": 10, "usage_type": "call" }, { "api_name": "django.contrib.contenttypes.models.ContentType.objects", "line...
2831089261
import threading from time import time from time import sleep import asyncio import tornado.web import tracemalloc from hoverbotpy.controllers.constants import PORT from hoverbotpy.drivers.driver_dummy import DummyHovercraftDriver from hoverbotpy.drivers.threading_dummy import ThreadingDummy from hoverbotpy.drivers....
olincollege/hoverbois
hoverbotpy/src/hoverbotpy/controllers/web_controller.py
web_controller.py
py
5,781
python
en
code
0
github-code
6
[ { "api_name": "tracemalloc.start", "line_number": 16, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 21, "usage_type": "call" }, { "api_name": "hoverbotpy.drivers.driver_dummy.DummyHovercraftDriver", "line_number": 45, "usage_type": "call"...
28960969271
import gpudb import collections import time import pandas as pd pd.options.display.max_columns = 100 pd.set_option('display.width', 10000) # init TABLE = "risk_inputs" COLLECTION = "RISK" NEW_TABLE = "bs_stream" HOST = "<ipaddress>" ENCODING = "binary" PORT = "9191" DATA_PACK = 1 INGEST_FREQ = 3 "Execute python scrip...
nickalonso/Utilities
stream.py
stream.py
py
5,101
python
en
code
0
github-code
6
[ { "api_name": "pandas.options", "line_number": 5, "usage_type": "attribute" }, { "api_name": "pandas.set_option", "line_number": 6, "usage_type": "call" }, { "api_name": "gpudb.GPUdb", "line_number": 23, "usage_type": "call" }, { "api_name": "gpudb.GPUdb", "li...
15932153331
""" A simple cache system for storing such things as project hierarchies and templates. By default uses diskcache for simpler setup and backward compatibility unless 'memcached' is set in the 'cache' section of the config, in which case use that. """ import logging from hydra_base import config as hydr...
hydraplatform/hydra-base
hydra_base/lib/cache.py
cache.py
py
1,015
python
en
code
8
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "hydra_base.config.get", "line_number": 15, "usage_type": "call" }, { "api_name": "hydra_base.config", "line_number": 15, "usage_type": "name" }, { "api_name": "diskcache.C...
30513785226
from gaesessions import get_current_session import logging import levr_classes as levr import levr_encrypt as enc import base64 from google.appengine.api import urlfetch,taskqueue import json import urllib from datetime import datetime, timedelta def login_check(self): ''' for merchants ONLY check if logged in, and...
holmesal/levr-2
merchant_utils.py
merchant_utils.py
py
4,377
python
en
code
0
github-code
6
[ { "api_name": "gaesessions.get_current_session", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.debug", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 18, "usage_type": "call" }, { "api_name": "logging.in...
24582961875
import os # accessible as a variable in index.html: from sqlalchemy import * from sqlalchemy.pool import NullPool from flask import Flask, request, render_template, g, redirect, Response from flask import redirect, url_for tmpl_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'templates') a...
YueWang417/w4111-proj1-group69
webserver/server.py
server.py
py
9,229
python
en
code
0
github-code
6
[ { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_nu...
72698063549
# -*- coding: utf-8 -*- """ Created on Fri Sep 21 10:29:50 2018 @author: qwzhou """ """ ======================================= plot line and dash ======================================= ASM across the site """ import numpy as np import matplotlib.pyplot as plt import sys from matplotlib.backends.backend_pdf import P...
ZhouQiangwei/MethHaploScripts
plotASM-expressiongene.py
plotASM-expressiongene.py
py
5,901
python
en
code
0
github-code
6
[ { "api_name": "numpy.linspace", "line_number": 48, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 70, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 70, "usage_type": "name" }, { "api_name": "matplotli...
30414879190
"""SQLAlchemy models for quiz and quiz questions""" from datetime import datetime from models.model import db from models.quiz_attempt import QuestionAttempt import sys sys.path.append('../') from generator.generator import create_quiz def search_slug(context): """Turns the plant slug into a string suitable for ...
lauramoon/capstone-1
models/quiz.py
quiz.py
py
3,101
python
en
code
0
github-code
6
[ { "api_name": "sys.path.append", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "models.model.db.Model", "line_number": 25, "usage_type": "attribute" }, { "api_name": "models.model.d...
30217438684
import seaborn as sns import matplotlib.pyplot as plt #%matplotlib inline tips = sns.load_dataset('tips') fluege = sns.load_dataset('flights') ###Matrixplots### #Heatmap #Damit die Heatmap gut funktioniert sollten eure Daten bereits in Matrixform vorliegen. Die sns.heatmatp() übernimmt dann die Einfärbung dieser Date...
ThePeziBear/MyPythonLibrary
Visualizing_Python/Seaborn/2_matrix_regression_function_seaborn.py
2_matrix_regression_function_seaborn.py
py
2,082
python
de
code
0
github-code
6
[ { "api_name": "seaborn.load_dataset", "line_number": 4, "usage_type": "call" }, { "api_name": "seaborn.load_dataset", "line_number": 5, "usage_type": "call" }, { "api_name": "seaborn.heatmap", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.py...
10294260342
__url__ = "$URL: svn://gizmojo.org/pub/evoque/trunk/domain.py $" __revision__ = "$Id: domain.py 1153 2009-01-20 11:43:21Z mario $" import sys, logging from evoque.collection import Collection from evoque.evaluator import set_namespace_on_dict, xml def get_log(): logging.basicConfig(level=logging.INFO, f...
phonybone/Rnaseq
ext_libs/evoque/domain.py
domain.py
py
7,129
python
en
code
3
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 10, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "evoque.collec...
29699780347
import pandas as pd import numpy as np import geopandas as gpd import matplotlib.pyplot as plt from scipy import ndimage import geoplot import matplotlib.pylab as pylab # import geoplot as gp from models import Simulation, NTAGraphNode, DiseaseModel def read_hospital_data(filename): df = pd.read_csv(filename,...
cwaldron97/Comp-Epi-Project
hospitals.py
hospitals.py
py
2,990
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 17, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 32, "usage_type": "call" }, { "api_name": "geoplot.polyplot", "line_number": 58, "usage_type": "call" }, { "api_name": "geoplot.crs.AlbersEq...
1706295460
import numpy as np from sklearn import datasets from sklearn.model_selection import train_test_split import matplotlib.pyplot as plt import numpy as np from sklearn.model_selection import train_test_split # MED分类器 class Medclass: def __init__(self): self.center_dict = {} # 分类中心点,以类别标签为键 label: center_po...
suudeer/iris-su2021
iris-su2021/iris/main.py
main.py
py
11,704
python
en
code
0
github-code
6
[ { "api_name": "numpy.dot", "line_number": 46, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 105, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 105, "usage_type": "name" }, { "api_name": "matplotlib.pyp...
45180348436
#判断一个视频是否属于幽默类还是实用类 import numpy as np import operator from matplotlib import pyplot as plt def traindataset(): datagroup=np.loadtxt('C:\\Users\\Dell\Desktop\\classification\\diabetes_train.txt',dtype=float,delimiter=',') dataset=datagroup[:,1:] label=datagroup[:,0] return dataset,label def testdat...
lijiaming666/Python_demo
K近邻法+ROC.py
K近邻法+ROC.py
py
2,540
python
zh
code
0
github-code
6
[ { "api_name": "numpy.loadtxt", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.tile", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "l...
2373356170
from huggingface_hub import login from transformers import AutoTokenizer, AutoModelForCausalLM, LlamaTokenizer login(token='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') tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-2-13b-chat-hf") model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-2-13b-chat-hf")...
mario872/Isaac-Voice-Assistant
main/Llama2.py
Llama2.py
py
612
python
en
code
0
github-code
6
[ { "api_name": "huggingface_hub.login", "line_number": 4, "usage_type": "call" }, { "api_name": "transformers.AutoTokenizer.from_pretrained", "line_number": 6, "usage_type": "call" }, { "api_name": "transformers.AutoTokenizer", "line_number": 6, "usage_type": "name" }, ...
4357761100
from flask_wtf import Form from wtforms import StringField, TextAreaField, SelectField from wtforms import SubmitField, validators # from wtforms.ext.sqlalchemy.fields import QuerySelectField from ..models import Department, Service class RequestForm(Form): '''This class creates an RequestForm object. '''...
bazanovam/smartIT
app/request/forms.py
forms.py
py
1,819
python
en
code
0
github-code
6
[ { "api_name": "flask_wtf.Form", "line_number": 8, "usage_type": "name" }, { "api_name": "wtforms.StringField", "line_number": 13, "usage_type": "call" }, { "api_name": "wtforms.validators.Required", "line_number": 14, "usage_type": "call" }, { "api_name": "wtforms...
17767255083
from datetime import datetime import uuid class Order(): def __init__(self, order): self.__dict__ = order self.id = str(uuid.uuid4()) class RenderDishInfo(): def __init__(self, id, name, shelf, value, isPicked, isDecayed): self.id = id self.name = name self.shelf = shelf self.value = value self.isPic...
purifier1990/PythonLearn
kitchen/order.py
order.py
py
363
python
en
code
1
github-code
6
[ { "api_name": "uuid.uuid4", "line_number": 7, "usage_type": "call" } ]
73758139386
"""Docstring""" import os import ezdxf from .file_utilities import check_file def check_file_and_folder( path, save_path, save=True ) -> list[ezdxf.document.Drawing] | None: """ Handle file or folder to apply the cleaning process """ if os.path.isdir(path): list_dir = os.listdir(path) ...
ldevillez/pySwTools
pyswtools/ready_dxf/dxf_utilities.py
dxf_utilities.py
py
1,326
python
en
code
3
github-code
6
[ { "api_name": "os.path.isdir", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 16, "usage_type": "call" }, { "api_name": "os.mkdir", "line_number": 1...
21485752439
# import heapq from collections import deque class Solution: def ladderLength(self, beginWord: str, endWord: str, wordList: List[str]) -> int: wordList = set(wordList) if endWord not in wordList:return 0 n = len(wordList) # def getdist(x, y): # count = 0 ...
bboychencan/Algorithm
leetcode/127.py
127.py
py
2,238
python
zh
code
0
github-code
6
[ { "api_name": "collections.deque", "line_number": 17, "usage_type": "call" } ]
26447487026
import os import json from PIL import Image import numpy as np from numpy.core.numeric import full import torch from torch.utils.data import Dataset from tqdm import tqdm import sys from pcl_generator import PointCloudGenerator from lidar_generator import PseudoLidarGenerator def load_pose(extrinsics: dict) -> np.a...
jonathsch/multisensor
pseudolidar/pseudo_lidar_dataset.py
pseudo_lidar_dataset.py
py
18,526
python
en
code
0
github-code
6
[ { "api_name": "numpy.sin", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 23, "usage_type": "attribute" }, { "api_name": "numpy.cos", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 24, ...
18417538437
from typing import List from functools import lru_cache class Solution: def canJump_top_down(self, nums: List[int]) -> bool: n = len(nums) @lru_cache(None) def can_jump(i): if i < 0 or i >= n: return False if i + nums[i] >= n - 1: ret...
ace-wu/oj
leetcode/0055-jump-game.py
0055-jump-game.py
py
850
python
en
code
3
github-code
6
[ { "api_name": "typing.List", "line_number": 6, "usage_type": "name" }, { "api_name": "functools.lru_cache", "line_number": 8, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 17, "usage_type": "name" } ]
42667622123
from models import db from flask import Flask, request, jsonify from bson.json_util import dumps def getPacientes(): con = db.get_connection() dbejercicios = con.ModeloEjercicios try: pacientes = dbejercicios.pacientes retorno = dumps(pacientes.find({})) return jsonify(retorno) ...
andres94091/projectEjerciciosBackend
models/pacientes.py
pacientes.py
py
2,139
python
es
code
0
github-code
6
[ { "api_name": "models.db.get_connection", "line_number": 7, "usage_type": "call" }, { "api_name": "models.db", "line_number": 7, "usage_type": "name" }, { "api_name": "bson.json_util.dumps", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.jsonify",...
41366711164
# -*- encoding: utf-8 -*- import sys, argparse, json, ovh, re, datetime,configparser from urllib import parse def main(argv): parser = argparse.ArgumentParser() parser.add_argument('--url','-u', help='Url recu par email du type https://www.ovh.com/manager/#/useraccount/contacts/123456?tab=REQUESTS&token=monsupe...
FlorianKronos/ovh-api-scripts
acceptTranfert.py
acceptTranfert.py
py
2,376
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 5, "usage_type": "call" }, { "api_name": "ovh.Client", "line_number": 9, "usage_type": "call" }, { "api_name": "urllib.parse.parse_qs", "line_number": 22, "usage_type": "call" }, { "api_name": "urllib.parse",...
25002494348
#author Duc Trung Nguyen #2018-01-06 #Shopify Back End Challenge from Menu import Menu import json def parse_menu(menu, py_menus): this_id = menu['id'] this_data = menu['data'] this_child = menu['child_ids'] if not 'parent_id' in menu: py_menus.append(Menu(this_id, this_data...
suphuvn/Shopify-Back-End-Challenge
Shopify Back End Challenge.py
Shopify Back End Challenge.py
py
1,426
python
en
code
0
github-code
6
[ { "api_name": "Menu.Menu", "line_number": 16, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 27, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 34, "usage_type": "call" } ]
42727324036
import os import csv import numpy as np import sys from PIL import Image class DataBuilder: def __init__(self, image_dir, label_file, output_dir,output_file, output_label_file, target_size): self.image_dir = image_dir self.label_file = label_file self.target_size = target_size self....
maximiliann97/TIF360-project-GIF-emotion-flipper
generate_data/DataBuilder.py
DataBuilder.py
py
4,326
python
en
code
0
github-code
6
[ { "api_name": "csv.reader", "line_number": 21, "usage_type": "call" }, { "api_name": "os.makedirs", "line_number": 29, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 33, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 36,...
22857897162
#!/usr/bin/env python """ Parses information from aql and outputs them to one JSON input: stdin: json aql output e.g. aql -c "SHOW SETS" -o json | head -n -3 return: JSON string [[{...], {...}]] - for each server list of stats (e.g for each set) """ import sys import json data = [] json_in...
tivvit/aerospike-tools-parsers
parse_aql.py
parse_aql.py
py
598
python
en
code
0
github-code
6
[ { "api_name": "sys.stdin", "line_number": 21, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 26, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 31, "usage_type": "call" } ]
24764641791
# -*- coding: utf-8 -*- import numpy as np import matplotlib.pyplot as plt from .module import Module from ...autograd import Variable, Backward class Regression(Module): '''Base loss function class for Regression task\n Regression is the task of approximating a mapping function (f) from input variable...
Kashu7100/Qualia
qualia/nn/modules/loss.py
loss.py
py
10,787
python
en
code
3
github-code
6
[ { "api_name": "module.Module", "line_number": 7, "usage_type": "name" }, { "api_name": "numpy.mean", "line_number": 24, "usage_type": "call" }, { "api_name": "autograd.Variable", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.mean", "line_numb...
12061356200
import tweepy from textblob import TextBlob consumer_key = 'EjXTChxrOmEWULyuuJ8iDXdyQ' consumer_secret = 'NrtHvELXi0i6dtue39icLkrT3rrrUVHKWOlHWWGJm46LQGell5' access_token = '1425159876-T5yoGiyxFk2sAdsZNjGVLRa94988APPcV4TI7R6' access_token_secret = 'JsCnvZPbnn93qefEM187dPnUcdCn5pby220IiU3D1aKam' auth =tweepy.OAuthHan...
HirdyaNegi/Senti2weet
test.py
test.py
py
803
python
en
code
0
github-code
6
[ { "api_name": "tweepy.OAuthHandler", "line_number": 10, "usage_type": "call" }, { "api_name": "tweepy.API", "line_number": 13, "usage_type": "call" }, { "api_name": "textblob.TextBlob", "line_number": 22, "usage_type": "call" } ]
24370435806
from setuptools import setup, find_packages VERSION = "0.1" DESCRIPTION = "A Lagrangian Particle Tracking package" LONG_DESCRIPTION = "Includes a set of tools for Lagrangian Particle Tracking like search, interpolation, etc." # Setting up setup( # name must match the folder name name="project-arrakis", ve...
kalagotla/project-arrakis
setup.py
setup.py
py
946
python
en
code
1
github-code
6
[ { "api_name": "setuptools.setup", "line_number": 8, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 16, "usage_type": "call" } ]
29673725009
import flask import flask_login from flask_dance.contrib.google import make_google_blueprint, google from flask_dance.consumer import oauth_authorized import iou.config as config from iou.models import User google_blueprint = make_google_blueprint( scope=["email"], **config.googleAuth ) login_manager = flask...
komackaj/flask-iou
iou/login.py
login.py
py
1,382
python
en
code
0
github-code
6
[ { "api_name": "flask_dance.contrib.google.make_google_blueprint", "line_number": 9, "usage_type": "call" }, { "api_name": "iou.config.googleAuth", "line_number": 11, "usage_type": "attribute" }, { "api_name": "iou.config", "line_number": 11, "usage_type": "name" }, { ...
2799581400
import streamlit as st import pandas_ta as ta import pandas as pd import yfinance as yf import pandas as pd; import numpy as np st.title("Volatility Dashboard") st.sidebar.title("selection") option = st.sidebar.selectbox("options",('long signal', 'short signal', 'data frame', 'Important dates', 'implinks')) st.subhead...
carolinedlu/volatility-dashboard
dashboard.py
dashboard.py
py
7,458
python
en
code
0
github-code
6
[ { "api_name": "streamlit.title", "line_number": 7, "usage_type": "call" }, { "api_name": "streamlit.sidebar.title", "line_number": 8, "usage_type": "call" }, { "api_name": "streamlit.sidebar", "line_number": 8, "usage_type": "attribute" }, { "api_name": "streamlit...
20546896703
from typing import Tuple from PIL import ImageColor from PIL.ImageDraw import ImageDraw from PIL.ImageFont import FreeTypeFont from PIL import ImageFont def wrap_text(text: str, width: int, font: FreeTypeFont) -> Tuple[str, int, int]: text_lines = [] text_line = [] words = text.split() line_height =...
realmayus/imbot
image/manipulation_helper.py
manipulation_helper.py
py
3,154
python
en
code
0
github-code
6
[ { "api_name": "PIL.ImageFont.FreeTypeFont", "line_number": 9, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 9, "usage_type": "name" }, { "api_name": "PIL.ImageFont.truetype", "line_number": 35, "usage_type": "call" }, { "api_name": "PIL.Imag...
71602794748
# # # Key-Holding-Macro made by JngVedere # Github : https://github.com/JngVedere # version 0.1.0 - Released on 03-06-2023 # # from tkinter import messagebox, ttk from tendo import singleton try: singleton.SingleInstance() except SystemExit as e: messagebox.showerror("ERROR", e) import tkint...
JngVedere/Key-Holding-Macro
main.py
main.py
py
7,540
python
en
code
0
github-code
6
[ { "api_name": "tendo.singleton.SingleInstance", "line_number": 12, "usage_type": "call" }, { "api_name": "tendo.singleton", "line_number": 12, "usage_type": "name" }, { "api_name": "tkinter.messagebox.showerror", "line_number": 14, "usage_type": "call" }, { "api_n...
11779785900
from scripts.util import read_supertopics, SuperTopic, get_spottopics, DateFormat, read_temp_dist from typing import Literal import numpy as np import json from prettytable import PrettyTable DATASET = 'climate2' LIMIT = 7000000 DATE_FORMAT: DateFormat = 'monthly' NORM: Literal['abs', 'col', 'row'] = 'abs' BOOST = ['r...
TimRepke/twitter-climate
code/figures/supertopics/spot_topic_stats.py
spot_topic_stats.py
py
3,415
python
en
code
1
github-code
6
[ { "api_name": "scripts.util.DateFormat", "line_number": 9, "usage_type": "name" }, { "api_name": "typing.Literal", "line_number": 10, "usage_type": "name" }, { "api_name": "scripts.util.read_temp_dist", "line_number": 28, "usage_type": "call" }, { "api_name": "scr...
314481349
# imports import os import numpy as np import pandas as pd import pymysql from pandas.plotting import table import matplotlib.pyplot as plt from datetime import datetime from util.Event import Event from matplotlib import rc font = {'family' : 'DejaVu Sans', 'weight' : 'normal', 'size' : 12} rc('font'...
noahfranz13/IOU
util/IO.py
IO.py
py
8,566
python
en
code
1
github-code
6
[ { "api_name": "matplotlib.rc", "line_number": 16, "usage_type": "call" }, { "api_name": "pymysql.connect", "line_number": 26, "usage_type": "call" }, { "api_name": "pandas.read_sql", "line_number": 48, "usage_type": "call" }, { "api_name": "util.Event.Event", ...
36146924870
from PIL import Image from DiamondDash.screenshot import Capturer from DiamondDash.mouse import Mouse import time import random colors = {} C = Capturer(1048, 341) M = Mouse(1048, 341) def get_color(RGB): if all(val < 60 for val in RGB): return "B" elif RGB in colors: return colors[RGB] ...
rndczn/DiamondDashBot
brain.py
brain.py
py
5,654
python
en
code
0
github-code
6
[ { "api_name": "DiamondDash.screenshot.Capturer", "line_number": 9, "usage_type": "call" }, { "api_name": "DiamondDash.mouse.Mouse", "line_number": 10, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 141, "usage_type": "call" }, { "api_name": ...
74078752188
# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but ...
lalamax3d/FloorPlanCreator
__init__.py
__init__.py
py
2,177
python
en
code
0
github-code
6
[ { "api_name": "bpy.types", "line_number": 35, "usage_type": "attribute" }, { "api_name": "bpy.props.PointerProperty", "line_number": 35, "usage_type": "call" }, { "api_name": "bpy.props", "line_number": 35, "usage_type": "attribute" }, { "api_name": "fpc.FpcPropGr...
9062401747
def matrixplot(start_date,end_date,type,term,flag=True): # Configure plotting in Jupyter from matplotlib import pyplot as plt # get_ipython().run_line_magic('matplotlib', 'inline') # plt.rcParams.update({ # 'figure.figsize': (26, 15), # 'axes.spines.right': False, # 'axes.spines.left...
ljiaqi1994/Pledge-Repo
质押式回购_类别矩阵_删减mysql.py
质押式回购_类别矩阵_删减mysql.py
py
6,632
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.pyplot.rcParams", "line_number": 11, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 11, "usage_type": "name" }, { "api_name": "numpy.random.seed", "line_number": 15, "usage_type": "call" }, { "api_name": "n...
35161911497
from dhooks import Webhook from dhooks import Embed from datetime import date,datetime import json embed=Embed( title="Sucessful Checout!", url="https://twitter.com/_thecodingbunny?lang=en", color=65280, timestamp="now" ) hook=Webhook("https://discordapp.com/api/webhooks/715950160185786399...
1mperfectiON/TCB-Project1
fake_bot_webhook.py
fake_bot_webhook.py
py
1,445
python
en
code
0
github-code
6
[ { "api_name": "dhooks.Embed", "line_number": 6, "usage_type": "call" }, { "api_name": "dhooks.Webhook", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime", ...
14550843664
import pytest from single_number import Solution from typing import List @pytest.mark.parametrize( 'nums, expected', [ ([2, 2, 1], 1), ([4, 1, 2, 1, 2], 4), ([1], 1), ] ) def test_single_number(nums: List[int], expected: int): solution = Solution() assert expected == soluti...
franciscoalface/leet-code
src/136.single_number/test_single_number.py
test_single_number.py
py
343
python
en
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 14, "usage_type": "name" }, { "api_name": "single_number.Solution", "line_number": 15, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 6, "usage_type": "call" }, { "api_name": "pytest.mark...
38460841413
import pygame pygame.init() font = pygame.font.Font(pygame.font.get_default_font(), 18) class Components: def __init__(self, window: pygame.Surface) -> None: self.window = window self.buttons = list() def Button(self, name: str): text = font.render(name, False, (0, 0, 0)) rec...
legit-programmer/bit-texture
ui.py
ui.py
py
1,642
python
en
code
0
github-code
6
[ { "api_name": "pygame.init", "line_number": 3, "usage_type": "call" }, { "api_name": "pygame.font.Font", "line_number": 4, "usage_type": "call" }, { "api_name": "pygame.font", "line_number": 4, "usage_type": "attribute" }, { "api_name": "pygame.font.get_default_fo...
37983159283
from fastapi import FastAPI, Response, status,HTTPException from fastapi.params import Body from pydantic import BaseModel from typing import Optional from random import randrange app = FastAPI() class Post(BaseModel): title: str content: str published: bool = True rating: Optional[int] = None m...
RahimUllah001/FastAPI_PROJECT
main.py
main.py
py
2,278
python
en
code
0
github-code
6
[ { "api_name": "fastapi.FastAPI", "line_number": 11, "usage_type": "call" }, { "api_name": "pydantic.BaseModel", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 17, "usage_type": "name" }, { "api_name": "random.randrange",...
8592665762
from django.urls import path from App import views from django.urls import path from django.contrib.auth import views as g urlpatterns = [ path('',views.home,name="hm"), path('abt/',views.about,name="ab"), path('ap/',views.products,name="pro"), path('vege/',views.vegetables,name="veg"), path('fru/',views.fruits,n...
TataTejaswini/Django-Project
App/urls.py
urls.py
py
831
python
en
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "App.views.home", "line_number": 7, "usage_type": "attribute" }, { "api_name": "App.views", "line_number": 7, "usage_type": "name" }, { "api_name": "django.urls.path", "l...
4927702164
# -*- coding: utf-8 -*- import json import pickle import numpy as np import random def preprocess_train_data(): """ Convert JSON train data to pkl :param filename: :return: """ f = open('train.json', 'r') raw_data = json.load(f) f.close() def get_record(x): band_image...
wondervictor/KaggleIceberg
data/data_process.py
data_process.py
py
2,431
python
en
code
0
github-code
6
[ { "api_name": "json.load", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.stack", "line_number": 28...
40276526905
import cv2 import random import numpy as np from PIL import Image from compel import Compel import torch from diffusers import StableDiffusionInpaintPipeline, StableDiffusionUpscalePipeline from transformers import CLIPSegProcessor, CLIPSegForImageSegmentation def seed_everything(seed): random.seed(seed) np...
Anears/SHIFT
models/shift.py
shift.py
py
4,678
python
en
code
0
github-code
6
[ { "api_name": "random.seed", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 15, "usage_type": "attribute" }, { "api_name": "torch.manual_seed", ...
74557703866
from django.shortcuts import render, redirect, get_object_or_404 from board.models import Post, Comment from board.forms import PostForm, SignupForm, CommentForm from django.http import HttpResponse from django.contrib.auth.models import User from django.views.generic import TemplateView, ListView from django.utils i...
Xiorc/Concofreeboard
board/views.py
views.py
py
3,289
python
en
code
0
github-code
6
[ { "api_name": "django.views.generic.ListView", "line_number": 17, "usage_type": "name" }, { "api_name": "board.models.Post", "line_number": 18, "usage_type": "name" }, { "api_name": "board.models.Post.objects.order_by", "line_number": 21, "usage_type": "call" }, { ...
74118711867
#!/usr/bin/env python3 """ test_utils.py contains the tests for the functions in the utils.py file defined in the current directory """ from parameterized import parameterized from utils import access_nested_map, get_json, memoize from unittest.mock import patch, Mock import unittest class TestAccessNestedMap(unitte...
PC-Ngumoha/alx-backend-python
0x03-Unittests_and_integration_tests/test_utils.py
test_utils.py
py
2,308
python
en
code
0
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 14, "usage_type": "attribute" }, { "api_name": "utils.access_nested_map", "line_number": 25, "usage_type": "call" }, { "api_name": "parameterized.parameterized.expand", "line_number": 18, "usage_type": "call" }, { ...
41776384713
# An ETL Reads and processes files from song_data and log_data and loads them into dimensional and fact tables #=========================================================== #Importing Libraries import os import glob import psycopg2 import pandas as pd from sql_queries import * #========================================...
Marvykalu/DataEngineering
data-modeling-postgresql/etl.py
etl.py
py
6,006
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_json", "line_number": 21, "usage_type": "call" }, { "api_name": "psycopg2.Error", "line_number": 29, "usage_type": "attribute" }, { "api_name": "psycopg2.Error", "line_number": 39, "usage_type": "attribute" }, { "api_name": "pandas.read_...
70128470908
# 1.парсим; headers берём из бразуера консоли разработчика (Network->Request) # 2.сохраняем локально в файл # 3.работаем с локальными данными import json import requests from bs4 import BeautifulSoup import csv from time import sleep import random import local_properties as lp url = lp.HEALTH_DIET_URL headers = { ...
ildar2244/EdScraping
health_diet.py
health_diet.py
py
6,067
python
en
code
0
github-code
6
[ { "api_name": "local_properties.HEALTH_DIET_URL", "line_number": 13, "usage_type": "attribute" }, { "api_name": "local_properties.HEADER_USER_AGENT", "line_number": 17, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 47, "usage_type": "call" }, ...
17838892540
import numpy as np import cv2 # import ipdb import opts def computeH(x1, x2): #Q2.2.1 #Compute the homography between two sets of points num_of_points = x1.shape[0] # Construct A matrix from x1 and x2 A = np.empty((2*num_of_points,9)) for i in range(num_of_points): # Form A Ai = np.array([[-x2[i,0], -x2[i,...
blakerbuchanan/computer_vision
augmented_reality/code/planarH.py
planarH.py
py
5,340
python
en
code
0
github-code
6
[ { "api_name": "numpy.empty", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.linalg.svd", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.linalg", "line_num...
37136495284
from keras.engine.saving import load_model from argparse import ArgumentParser import utils def build_parser(): par = ArgumentParser() par.add_argument('--word_features_path', type=str, dest='word_features_path', help='filepath to save/load word features', default='feature_word') par...
cindyyao/image_search
index.py
index.py
py
2,983
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "utils.load_glove_vectors", "line_number": 36, "usage_type": "call" }, { "api_name": "utils.load_paired_img_wrd", "line_number": 37, "usage_type": "call" }, { "api_nam...
35126198992
from unittest.mock import patch from uuid import UUID, uuid4 import pytest from pasqal_cloud import SDK, Workload from pasqal_cloud.errors import ( WorkloadCancellingError, WorkloadCreationError, WorkloadFetchingError, WorkloadResultsDecodeError, ) from tests.test_doubles.authentication import FakeAut...
pasqal-io/pasqal-cloud
tests/test_workload.py
test_workload.py
py
6,862
python
en
code
11
github-code
6
[ { "api_name": "uuid.UUID", "line_number": 19, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 17, "usage_type": "attribute" }, { "api_name": "uuid.UUID", "line_number": 23, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_nu...
2908163256
from __future__ import annotations from typing import TYPE_CHECKING, Any, Dict, List, Union from supertokens_python.normalised_url_path import NormalisedURLPath from supertokens_python.querier import Querier if TYPE_CHECKING: from .utils import JWTConfig from .interfaces import CreateJwtResult from super...
starbillion/supertokens_python
supertokens_python/recipe/jwt/recipe_implementation.py
recipe_implementation.py
py
2,016
python
en
code
0
github-code
6
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 8, "usage_type": "name" }, { "api_name": "supertokens_python.recipe.jwt.interfaces.RecipeInterface", "line_number": 20, "usage_type": "name" }, { "api_name": "supertokens_python.querier.Querier", "line_number": 22, "usa...
70767464828
"""empty message Revision ID: 4fa0d71e3598 Revises: bdcfc99aeebf Create Date: 2021-07-31 23:47:02.420096 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql # revision identifiers, used by Alembic. revision = '4fa0d71e3598' down_revision = 'bdcfc99aeebf' branch_labels = None...
AbundantSalmon/judo-techniques-bot
judo_techniques_bot/migrations/versions/2021-07-31_4fa0d71e3598_.py
2021-07-31_4fa0d71e3598_.py
py
891
python
en
code
8
github-code
6
[ { "api_name": "alembic.op.add_column", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 21, "usage_type": "call" }, { "api_name": "sqlalchemy.dialect...
75341512506
"""Script to run antsBrainExtraction on meningioma T1-contrast data. """ import os.path as op from nipype import Node, Workflow, DataGrabber, DataSink, MapNode from nipype.interfaces import ants # Node to grab data. grab = Node(DataGrabber(outfields=['t1c']), name='grabber') grab.inputs.base_directory = op.abspath('da...
kaczmarj/meningioma
scripts/run_ants_brainextraction.py
run_ants_brainextraction.py
py
1,750
python
en
code
1
github-code
6
[ { "api_name": "nipype.Node", "line_number": 8, "usage_type": "call" }, { "api_name": "nipype.DataGrabber", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_numbe...
17012330786
from flask import Flask, render_template, request, redirect, url_for from pymongo import MongoClient client = MongoClient( "<mongo db cluter url>") NameListDatabase = client.NameListDatabase CollectionList = NameListDatabase.CollectionList app = Flask(__name__) def getallnames(): namelist = [] names = C...
smartkeerthi/Python-MongoDB-Flask-Projects
Flask and pymongo/main.py
main.py
py
953
python
en
code
0
github-code
6
[ { "api_name": "pymongo.MongoClient", "line_number": 4, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 23, "usage_type": "attribute" }, { "api_name": "flask.request...
28830646732
"""Constants for the WiHeat Climate integration.""" import logging API_URL = 'https://wi-heat.com/' ID = 'home-assistant' SESSION = 'A2B3C4D5E6' DOMAIN = "wiheat" CONF_CODE_FORMAT = "code_format" CONF_CODE = "code" CONF_TEMP = "temp" UPDATE_INTERVAL = "timesync" MIN_SCAN_INTERVAL = 60 API_ENDPOINT = { 'getUser...
kimjohnsson/wiheat
custom_components/wiheat/const.py
const.py
py
861
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 51, "usage_type": "call" } ]
5423305185
''' @author:KongWeiKun @file: follower_crawler.py @time: 18-2-13 下午3:57 @contact: 836242657@qq.com ''' from multiprocessing import Pool,cpu_count,Lock,Manager import pandas as pd import threading import csv import requests from bs4 import BeautifulSoup import re try: from functools import namedtuple except: fro...
Winniekun/spider
github/follower_crawler.py
follower_crawler.py
py
4,422
python
en
code
139
github-code
6
[ { "api_name": "collections.namedtuple", "line_number": 22, "usage_type": "call" }, { "api_name": "multiprocessing.Manager", "line_number": 23, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 24, "usage_type": "call" }, { "api_name": "threa...
38046142992
from cffi import FFI as _FFI import numpy as _np import glob as _glob import os as _os __all__ = ['BloscWrapper'] class BloscWrapper: def __init__(self, plugin_file=""): this_module_dir = _os.path.dirname(_os.path.realpath(__file__)) # find the C library by climbing the directory tree ...
ActivisionGameScience/ags_example_py_wrapper
ags_py_blosc_wrapper.py
ags_py_blosc_wrapper.py
py
4,277
python
en
code
3
github-code
6
[ { "api_name": "os.path.dirname", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.join", "lin...
32907694123
# 1 Add the usual reports from sklearn.metrics import classification_report y_true = [1, 0, 0, 2, 1, 0, 3, 3, 3] y_pred = [1, 1, 0, 2, 1, 0, 1, 3, 3] target_names = ['Class-0', 'Class-1', 'Class-2', 'Class-3'] print(classification_report(y_true, y_pred, target_names=target_names)) # 2 Run the code and see # Instead of...
IbrahimOued/Python-Machine-Learning-cookbook
2 Constructing a Classifier/performance_report.py
performance_report.py
py
447
python
en
code
0
github-code
6
[ { "api_name": "sklearn.metrics.classification_report", "line_number": 6, "usage_type": "call" } ]
10543642062
from redis.commands.search.field import GeoField, NumericField, TextField, VectorField REDIS_INDEX_NAME = "benchmark" REDIS_PORT = 6380 H5_COLUMN_TYPES_MAPPING = { "int": NumericField, "int32": NumericField, "keyword": TextField, "text": TextField, "string": TextField, "str": TextField, "...
myscale/vector-db-benchmark
engine/clients/redis/config.py
config.py
py
687
python
en
code
13
github-code
6
[ { "api_name": "redis.commands.search.field.NumericField", "line_number": 8, "usage_type": "name" }, { "api_name": "redis.commands.search.field.NumericField", "line_number": 9, "usage_type": "name" }, { "api_name": "redis.commands.search.field.TextField", "line_number": 10, ...
13295958598
import vtk import numpy as np import struct # def save_vf(self, filename): # """ Write the vector field as .vf file format to disk. """ # if not np.unique(self.resolution).size == 1: # raise ValueError("Vectorfield resolution must be the same for X, Y, Z when exporting to Unity3D.") # ...
maysie0110/COSC6344-FinalProject
write_raw_file.py
write_raw_file.py
py
2,862
python
en
code
0
github-code
6
[ { "api_name": "vtk.vtkMetaImageReader", "line_number": 38, "usage_type": "call" }, { "api_name": "vtk.vtkDataSetReader", "line_number": 43, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 49, "usage_type": "call" }, { "api_name": "struct.pack",...
27035685049
"""Json module""" import json def handler(event, _context): """ Lambda Handler Parameters ---------- event : dict An event Returns ------- dict The response object """ print(f"request: {json.dumps(event)}") return { "statusCode": 200, "heade...
jhonrocha/aws-cdk-explorations
lambda/play-py/main.py
main.py
py
464
python
en
code
0
github-code
6
[ { "api_name": "json.dumps", "line_number": 18, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 22, "usage_type": "call" } ]
14582545322
# Visualisation of Parkes beam pattern: Shows position of beams for a given HDF file # Input: fname (location of HDF dataset) # V.A. Moss (vmoss.astro@gmail.com) __author__ = "V.A. Moss" __date__ = "$18-sep-2018 17:00:00$" __version__ = "0.1" import os import sys import tables as tb import numpy as np from matplotli...
cosmicpudding/ParkesBeamPattern
plot_beampattern.py
plot_beampattern.py
py
4,867
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.rcParams", "line_number": 15, "usage_type": "attribute" }, { "api_name": "datetime.datetime.strptime", "line_number": 33, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 33, "usage_type": "attribute" }, { "api_na...
28256315705
from PyQt5.QtWidgets import QMainWindow, QApplication, QFileDialog, QMessageBox, QListWidgetItem from PyQt5.QtCore import pyqtSlot, QDir, Qt, QSettings, QFileInfo from SettingsDialog import SettingsDialog from ui_MainWindow import Ui_MainWindow import math import Settings def areaOfPolygon(vertices): verti...
claudiomattera/graph-extractor
MainWindow.py
MainWindow.py
py
6,147
python
en
code
1
github-code
6
[ { "api_name": "math.sqrt", "line_number": 15, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 19, "usage_type": "name" }, { "api_name": "ui_MainWindow.Ui_MainWindow", "line_number": 23, "usage_type": "call" }, { "api_name": "PyQ...
3714759753
from unittest import TestCase from datetime import datetime from uuid import uuid4 from sh import git, rm, gitlint, touch, echo, ErrorReturnCode class BaseTestCase(TestCase): pass class IntegrationTests(BaseTestCase): """ Simple set of integration tests for gitlint """ tmp_git_repo = None @classmet...
Hawatel/gitlint
qa/integration_test.py
integration_test.py
py
2,991
python
en
code
null
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 7, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 18, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 18, "usage_type": "name" }, { "api_name": "sh.git", ...
72489561467
import pdb import sys sys.path.append( '..' ) from copy import copy, deepcopy import kivy.graphics as kg from kivy.lang import Builder from kivy.properties import * from kivy.uix.boxlayout import BoxLayout from kivy.uix.label import Label #KV Lang files from pkg_resources import resource_filename path = resource_fil...
curzel-it/kivy-material-ui
material_ui/flatui/labels.py
labels.py
py
4,448
python
en
code
67
github-code
6
[ { "api_name": "sys.path.append", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "pkg_resources.resource_filename", "line_number": 15, "usage_type": "call" }, { "api_name": "kivy.lang...
24506022571
from mock import Mock, patch, ANY, sentinel from nose.tools import ok_, eq_, raises, timed from noderunner.client import Client, Context, Handle from noderunner.connection import Connection from noderunner.protocol import Protocol class TestClient(object): @patch("noderunner.client.get_sockets") @patch("node...
williamhogman/noderunner
tests/test_client.py
test_client.py
py
5,456
python
en
code
6
github-code
6
[ { "api_name": "mock.Mock", "line_number": 15, "usage_type": "call" }, { "api_name": "noderunner.client.Client", "line_number": 16, "usage_type": "call" }, { "api_name": "mock.patch", "line_number": 10, "usage_type": "call" }, { "api_name": "mock.patch", "line_...
37583094466
import pyvista as pv axes = pv.Axes() axes.origin # Expected: ## (0.0, 0.0, 0.0) # # Set the origin of the camera. # axes.origin = (2.0, 1.0, 1.0) axes.origin # Expected: ## (2.0, 1.0, 1.0)
pyvista/pyvista-docs
version/dev/api/plotting/_autosummary/pyvista-Axes-origin-1.py
pyvista-Axes-origin-1.py
py
190
python
en
code
1
github-code
6
[ { "api_name": "pyvista.Axes", "line_number": 2, "usage_type": "call" } ]
41766786793
from collections import deque s = input().split() n = int(s[0]) m = int(s[1]) a = list(map(int, input().split())) result = ['0']*m d = {} for i in range(m): c = None if a[i] in d: c = d[a[i]] else: c = deque() d[a[i]] = c c.append(i) while True: found = ...
gautambp/codeforces
1100-B/1100-B-48361896.py
1100-B-48361896.py
py
626
python
en
code
0
github-code
6
[ { "api_name": "collections.deque", "line_number": 15, "usage_type": "call" } ]
72066928509
from flask import Flask, flash, redirect, render_template from form import LoginForm app = Flask(__name__) app.config['SECRET_KEY'] = "secret" @app.route("/home") def home(): return "Hello Mines ParisTech" @app.route("/", methods=['GET', 'POST']) def login(): form = LoginForm() if form.validate_on_submi...
basileMarchand/ProgrammeCooperants
flask_demo/demo5/app.py
app.py
py
754
python
en
code
1
github-code
6
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "form.LoginForm", "line_number": 14, "usage_type": "call" }, { "api_name": "form.validate_on_submit", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.redirect", ...
11317226884
import pathlib from setuptools import find_packages, setup import codecs import os.path def read(rel_path): here = os.path.abspath(os.path.dirname(__file__)) with codecs.open(os.path.join(here, rel_path), 'r') as fp: return fp.read() def get_version(rel_path): for line in read(rel_path).splitlin...
nlp-uoregon/trankit
setup.py
setup.py
py
2,223
python
en
code
693
github-code
6
[ { "api_name": "os.path.path.abspath", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path", "line_number": 8, "usage_type": "name" }, { "api_name": "os.path.path.dirname", ...
74337793468
# Name : Jiazhao Li Unique name: jiazhaol import numpy as np from sklearn import preprocessing import sys from sklearn import tree def load_train_data(filename): SBD_traindata_list = [] with open(filename, 'r') as f: for line in f: line = line.strip('\n') word = line.split(' '...
JiazhaoLi/Assignment
EECS595/Assignment1/hw1/SBD.py
SBD.py
py
5,015
python
en
code
0
github-code
6
[ { "api_name": "sklearn.preprocessing.OneHotEncoder", "line_number": 115, "usage_type": "call" }, { "api_name": "sklearn.preprocessing", "line_number": 115, "usage_type": "name" }, { "api_name": "sys.argv", "line_number": 149, "usage_type": "attribute" }, { "api_na...
33561062837
""" moving_avg_demo.py """ import numpy as np import scipy as sp import scipy.signal import plot import signal_generator def moving_average_builder(length): filt = np.array([1.0/length]*length) return filt def moving_average_demo1(): filt = moving_average_builder(5) sig = signal_generator.sinusoid(1...
Chris93Hall/filtering_presentation
moving_avg_demo.py
moving_avg_demo.py
py
730
python
en
code
0
github-code
6
[ { "api_name": "numpy.array", "line_number": 13, "usage_type": "call" }, { "api_name": "signal_generator.sinusoid", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 18, "usage_type": "attribute" }, { "api_name": "plot.stem", "...
42818754446
from tkinter import * from PIL import ImageTk, Image import string import random root = Tk() root.title("Я люблю BRAWL STARS") root.geometry("1200x675") def clicked(): exit = "" for j in range(3): n = 5 letters = 0 integers = 0 for i in range(n): if ...
nelyuboov/Lab-4
main (2).py
main (2).py
py
1,483
python
en
code
null
github-code
6
[ { "api_name": "random.randint", "line_number": 18, "usage_type": "call" }, { "api_name": "random.sample", "line_number": 20, "usage_type": "call" }, { "api_name": "string.ascii_letters", "line_number": 20, "usage_type": "attribute" }, { "api_name": "random.randint...
12198804557
from iskanje_v_sirino import Graph import collections import winsound duration = 3000 freq = 440 ''' NxP_start = [ ['', '', '', '', ''], ['', '', '', '', ''], ['B', '', '', '', ''], ['A', 'C', 'D', 'E', 'F'] ] NxP_end = [ ['', 'C', '', '', ''], ['', 'E', '', '', ''], ['F', 'D', '', '', ''...
martin0b101/UI
robotizirano_skladisce.py
robotizirano_skladisce.py
py
3,070
python
en
code
0
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 108, "usage_type": "call" }, { "api_name": "iskanje_v_sirino.Graph", "line_number": 155, "usage_type": "call" } ]
26436874912
#mandelbrot by KB for CS550 #inspired by work done with wikipedia example code from PIL import Image import random from PIL import ImageFilter #set image size imgx = 500 imgy = 500 xa, xb = -0.75029467235117, -0.7478726919928045 ya, yb = 0.06084172052354717, 0.06326370066585434 image = Image.new("RGB",(imgx,imgy)) ...
gbroady19/CS550
mandelbrot2.py
mandelbrot2.py
py
1,058
python
en
code
0
github-code
6
[ { "api_name": "PIL.Image.new", "line_number": 13, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 13, "usage_type": "name" }, { "api_name": "PIL.ImageFilter.CONTOUR", "line_number": 40, "usage_type": "attribute" }, { "api_name": "PIL.ImageFilter"...
10543655506
from datetime import datetime, time, timedelta import iso8601 import logging import pytz import requests import sys from django.conf import settings from django.core.cache import cache from django.shortcuts import render logger = logging.getLogger(__name__) uk_tz = pytz.timezone('Europe/London') utc_tz = pytz.utc ...
SmartCambridge/tfc_web
tfc_web/smartpanel/views/widgets/rss_reader.py
rss_reader.py
py
2,242
python
en
code
3
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "pytz.timezone", "line_number": 15, "usage_type": "call" }, { "api_name": "pytz.utc", "line_number": 16, "usage_type": "attribute" }, { "api_name": "django.core.cache.cache...
43370134393
""" Tests for :module:`statics.markdown`.""" import unittest __all__ = ["TestMarkdownItem"] class TestMarkdownItem(unittest.TestCase): def createFile(self, content): import tempfile f = tempfile.NamedTemporaryFile() f.write(content) f.flush() return f def test_it(se...
andreypopp/statics
statics/tests/test_markdown.py
test_markdown.py
py
1,089
python
en
code
2
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 8, "usage_type": "attribute" }, { "api_name": "tempfile.NamedTemporaryFile", "line_number": 12, "usage_type": "call" }, { "api_name": "statics.markdown.MarkdownItem", "line_number": 20, "usage_type": "call" }, { "a...
27615694777
""" Get information about how many adult movies/series etc. there are per region. Get the top 100 of them from the region with the biggest count to the region with the smallest one. Получите информацию о том, сколько фильмов/сериалов для взрослых и т. д. есть на область, край. Получите 100 лучших из них из региона с н...
Tetyana83/spark
task5.py
task5.py
py
4,199
python
en
code
0
github-code
6
[ { "api_name": "pyspark.sql.SparkSession.builder.master", "line_number": 17, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 17, "usage_type": "attribute" }, { "api_name": "pyspark.sql.SparkSession", "line_number": 17, "usage_type":...
8515938890
import numpy as np from matplotlib import cm import matplotlib.pyplot as plt from matplotlib import gridspec from scipy.optimize import curve_fit from scipy.interpolate import interp1d from pandas import unique import csv import h5py from astropy import constants as const from astropy import units as u I_units = u...
jonasrth/MSc-plots
SED_EMISSA_plots.py
SED_EMISSA_plots.py
py
6,655
python
en
code
0
github-code
6
[ { "api_name": "astropy.units.erg", "line_number": 17, "usage_type": "attribute" }, { "api_name": "astropy.units", "line_number": 17, "usage_type": "name" }, { "api_name": "astropy.units.cm", "line_number": 17, "usage_type": "attribute" }, { "api_name": "astropy.un...
32927804563
#!/usr/bin/python # -*- coding: utf-8 -*- """ Construct templates and categories for Tekniska museet data. """ from collections import OrderedDict import os.path import csv import pywikibot import batchupload.listscraper as listscraper import batchupload.common as common import batchupload.helpers as helpers from bat...
Vesihiisi/TEKM-import
info_tekniska.py
info_tekniska.py
py
8,639
python
en
code
0
github-code
6
[ { "api_name": "batchupload.make_info.MakeBaseInfo", "line_number": 24, "usage_type": "name" }, { "api_name": "pywikibot.ItemPage", "line_number": 31, "usage_type": "call" }, { "api_name": "pywikibot.Site", "line_number": 47, "usage_type": "call" }, { "api_name": "...
27944232660
""" This modules defines the base class for all machine learning models to analyse reusability rate. Last updated: MB 29/08/2020 - created module. """ # import external libraries. import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import numpy as np import scipy.stats as stats from sklearn.model...
reusability/research
model/base_model.py
base_model.py
py
5,759
python
en
code
1
github-code
6
[ { "api_name": "utils.data_loader.get_normalization_params", "line_number": 32, "usage_type": "call" }, { "api_name": "utils.data_loader", "line_number": 32, "usage_type": "name" }, { "api_name": "pandas.Series", "line_number": 44, "usage_type": "call" }, { "api_na...