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
16275076473
import json import sys import argparse import os APPROX = 0.1 def isNumber(num): isNum = False try: float(num) isNum = True except Exception as e: isNum = False return isNum nameList = list() def compareAny(self, other): diff = list() for att in self.attScalarList: ...
Priyankajaiswalintel/gramine
latest/bin64/gma/MAAT/compare.py
compare.py
py
10,364
python
en
code
null
github-code
36
[ { "api_name": "json.load", "line_number": 206, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 210, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number": 253, "usage_type": "call" }, { "api_name": "os.path", "lin...
23268928678
#import sys, os #sys.path.append(os.path.abspath("")) from functionsDB.ConnectionDB import abrirconexion, cerrarconexion from functionsDB.entity.comentario import Comentario from datetime import datetime def altacomentario(comentario): cur,con = abrirconexion() sql = "insert into comentario(fecha,hora,conteni...
exegonzalez/Taller-de-Integracion
App/src/functionsDB/ABMComentario.py
ABMComentario.py
py
2,295
python
es
code
1
github-code
36
[ { "api_name": "functionsDB.ConnectionDB.abrirconexion", "line_number": 9, "usage_type": "call" }, { "api_name": "functionsDB.ConnectionDB.cerrarconexion", "line_number": 12, "usage_type": "call" }, { "api_name": "functionsDB.ConnectionDB.abrirconexion", "line_number": 15, ...
2762523271
from flask import Flask, request, abort from linebot import ( LineBotApi, WebhookHandler ) from linebot.exceptions import ( InvalidSignatureError ) from linebot.models import ( MessageEvent, TextMessage, TextSendMessage, ) app = Flask(__name__) line_bot_api = LineBotApi('1l6c8hOlVNiLh23YRFrdl1TxJxK4KUZpp...
vacharich1/testme
bot_test.py
bot_test.py
py
1,126
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 13, "usage_type": "call" }, { "api_name": "linebot.LineBotApi", "line_number": 15, "usage_type": "call" }, { "api_name": "linebot.WebhookHandler", "line_number": 16, "usage_type": "call" }, { "api_name": "flask.request.h...
15672169459
from datetime import datetime import logging logging.getLogger().setLevel(logging.INFO) logging.getLogger('discord').setLevel(logging.INFO) dt_fmt = '%Y-%m-%d %H:%M:%S' logging.basicConfig(format='[{asctime}] [{levelname:<8}] [{name:<15}]: {message}', style='{', datefmt='%Y-%m-...
nERD8932/LVSF1Bot
scripts/f1module.py
f1module.py
py
4,985
python
en
code
1
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 4, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 4, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 5, "usage_type": "call" }, { "api_name": "logging.INFO", ...
150466023
from django.shortcuts import render, get_object_or_404 from django.http import HttpResponse, HttpResponseRedirect from django.urls import reverse, reverse_lazy from django.views import generic from django.views import View from django.views.generic.edit import CreateView, UpdateView, DeleteView from .models import Pla...
edbranson/scorekeeping
scorekeeping/play/views.py
views.py
py
3,501
python
en
code
0
github-code
36
[ { "api_name": "django.views.View", "line_number": 13, "usage_type": "name" }, { "api_name": "play.forms.PlayCreateForm", "line_number": 17, "usage_type": "call" }, { "api_name": "play.forms", "line_number": 20, "usage_type": "name" }, { "api_name": "models.Play", ...
1467605788
# from PIL import Image # # def abrirImagem(): # im = Image.open("sample-image.png") # # import csv import sqlite3 from PIL import Image def abrir_imagem(imagem): #im = Image.open("sample-image.png") im = Image.open(imagem) im.show() def consultar_imagem(item): try: con ...
marcelocaon/gerador_catalogo_produtos
main.py
main.py
py
9,572
python
pt
code
1
github-code
36
[ { "api_name": "PIL.Image.open", "line_number": 14, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 14, "usage_type": "name" }, { "api_name": "sqlite3.connect", "line_number": 19, "usage_type": "call" }, { "api_name": "sqlite3.Error", "line_nu...
18515443128
from sets import Set from collections import defaultdict class MagicDictionary(object): def __init__(self): """ Initialize your data structure here. """ def buildDict(self, dict): """ Build a dictionary through a list of words :type dict: List[str] :rtyp...
jimmy623/LeetCode
Solutions/Implement Magic Dictionary.py
Implement Magic Dictionary.py
py
1,413
python
en
code
0
github-code
36
[ { "api_name": "collections.defaultdict", "line_number": 16, "usage_type": "call" }, { "api_name": "sets.Set", "line_number": 17, "usage_type": "call" } ]
2521012317
import configparser import html from pathlib import Path from pprint import pformat from urllib.parse import urlparse import boto3 import botocore.model import botocore.utils from IPython.core.display import HTML from jinja2 import Environment, FileSystemLoader from pygments import highlight from pygments.formatters i...
kernelpanek/jupyterlab-starter-notebooks
helper/aws_functions.py
aws_functions.py
py
6,575
python
en
code
0
github-code
36
[ { "api_name": "configparser.ConfigParser", "line_number": 78, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 79, "usage_type": "call" }, { "api_name": "boto3.session.Session", "line_number": 91, "usage_type": "call" }, { "api_name": "boto3.se...
22265028586
from mensajes import separador_chats from usuarios import inicio_sesion from parametros import VOLVER_FRASE, ABANDONAR_FRASE from datetime import datetime, date def lista_grupos(): #lee el archivo with open('grupos.csv', 'rt') as archivo_grupos: lista_grupos = archivo_grupos.readlines() for x in ra...
Alzvil/IIC2233-Progra-Avanzada-Tareas-2021-1
Tareas/T0/grupos.py
grupos.py
py
6,884
python
es
code
0
github-code
36
[ { "api_name": "mensajes.separador_chats", "line_number": 46, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 73, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 73, "usage_type": "name" }, { "api_name": "date...
29403005622
import rooms import asyncio from asgiref.sync import async_to_sync import json as encoder class WebsocketFireClass(): @async_to_sync async def new_chat_message(self, state): encoded_state = encoder.dumps({'type': 'new_chat_message', 'data': state}) print("NEW CHAT MESSAGE, START FIRING...") ...
anotherrandomnickname/ffms-websocket-py
wsfire.py
wsfire.py
py
532
python
en
code
0
github-code
36
[ { "api_name": "json.dumps", "line_number": 11, "usage_type": "call" }, { "api_name": "rooms.chat", "line_number": 13, "usage_type": "attribute" }, { "api_name": "asyncio.wait", "line_number": 14, "usage_type": "call" }, { "api_name": "rooms.chat", "line_number...
17774181352
from rest_framework.permissions import BasePermission from noticeboard.utils.notices import ( user_allowed_banners, has_super_upload_right, ) class IsUploader(BasePermission): """ A custom Django REST permission layer to check authorization over different actions on notices. """ def has_...
IMGIITRoorkee/omniport-app-noticeboard
permissions/uploader.py
uploader.py
py
1,591
python
en
code
6
github-code
36
[ { "api_name": "rest_framework.permissions.BasePermission", "line_number": 9, "usage_type": "name" }, { "api_name": "noticeboard.utils.notices.user_allowed_banners", "line_number": 35, "usage_type": "call" }, { "api_name": "noticeboard.utils.notices.has_super_upload_right", "l...
939034143
from datetime import datetime from src.app import db, app import uuid from src.models.mixins import BaseMixin from src.helpers import * from sqlalchemy import exc class BookRating(BaseMixin, db.Model): __tablename__ = "book_ratings" rating_id = db.Column(db.String(50), primary_key=True, default=lambda: uuid.u...
Aaronh3k/book-status-api
src/models/book_ratings.py
book_ratings.py
py
7,769
python
en
code
0
github-code
36
[ { "api_name": "src.models.mixins.BaseMixin", "line_number": 8, "usage_type": "name" }, { "api_name": "src.app.db.Model", "line_number": 8, "usage_type": "attribute" }, { "api_name": "src.app.db", "line_number": 8, "usage_type": "name" }, { "api_name": "src.app.db....
5049475129
# Configuration file for the Sphinx documentation builder. # # For the full list of built-in configuration values, see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master...
NVIDIA/TensorRT-LLM
docs/source/conf.py
conf.py
py
2,943
python
en
code
3,328
github-code
36
[ { "api_name": "sys.path.insert", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_num...
28090834284
import pytest import config import random from datetime import datetime from flask.testing import FlaskClient from webapp import create_app, db from flask import current_app from webapp.models import Theme, Timebox, Task, Project @pytest.fixture(scope='function') def models(): return {'timebox': Timebox} @pytest....
thekitbag/todoodleoo-server
tests/conftest.py
conftest.py
py
5,630
python
en
code
0
github-code
36
[ { "api_name": "webapp.models.Timebox", "line_number": 12, "usage_type": "name" }, { "api_name": "pytest.fixture", "line_number": 10, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 14, "usage_type": "call" }, { "api_name": "webapp.create_app...
18745919637
from telegram import Bot, Update, ParseMode from telegram.ext import run_async import time from bot.modules.helper_funcs.extraction import extract_user from bot import dispatcher from bot.modules.disable import DisableAbleCommandHandler @run_async def gdpr(bot: Bot, update: Update): message = update.effective_...
koppiesttiajaykumar/bot
bot/modules/gdpr.py
gdpr.py
py
914
python
en
code
0
github-code
36
[ { "api_name": "telegram.Bot", "line_number": 9, "usage_type": "name" }, { "api_name": "telegram.Update", "line_number": 9, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 15, "usage_type": "call" }, { "api_name": "time.sleep", "line_number":...
71075117545
import collections class Solution: def removeStones(self, stones: List[List[int]]) -> int: stones = list(map(tuple, stones)) s = set(stones) dx = collections.defaultdict(set) dy = collections.defaultdict(set) for i,j in s: dx[i].add(j) ...
nango94213/Leetcode-solution
0947-most-stones-removed-with-same-row-or-column/0947-most-stones-removed-with-same-row-or-column.py
0947-most-stones-removed-with-same-row-or-column.py
py
879
python
en
code
2
github-code
36
[ { "api_name": "collections.defaultdict", "line_number": 8, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 9, "usage_type": "call" } ]
73202442984
from datetime import datetime from shapely.geometry import Point import numpy as np from typing import List GEODATUM_MAPPING = { "WGS 1984": "epsg:4326", "Ordnance Survey Great Britain 1936": "epsg:4277", "TWD 1967": "epsg:3828", "Gauss Krueger Meridian2": None, "Gauss Krueger Meridian3": None, ...
d2hydro/fewspy
src/fewspy/utils/conversions.py
conversions.py
py
3,271
python
en
code
2
github-code
36
[ { "api_name": "datetime.datetime.fromisoformat", "line_number": 75, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 75, "usage_type": "name" }, { "api_name": "datetime.datetime", "line_number": 58, "usage_type": "name" }, { "api_name": "d...
75138929384
from loja.models import Produto from loja.models import Pedido from loja.models import CATEGORIAS from rest_framework import serializers class ProdutoSerializer(serializers.ModelSerializer): class Meta: model = Produto fields = ( 'id', 'nome', 'descricao', ...
jonasfsilva/desafio_intmed
loja/serializers.py
serializers.py
py
1,298
python
pt
code
0
github-code
36
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 7, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 7, "usage_type": "name" }, { "api_name": "loja.models.Produto", "line_number": 10, "usage_type": "name" ...
41224759283
''' Created on 15-Oct-2013 @author: Kashaj ''' import re, sqlite3,os db = sqlite3.connect('Train_Database.db') db.text_factory = str db.row_factory = sqlite3.Row db.execute('drop table if exists TrainStationNode') db.execute('create table TrainStationNode(Train_Num char[6],stn_code char[6],route int,arr_time text,dep...
ShaikAsifullah/Indian-Railways-Informal
getEdges.py
getEdges.py
py
2,447
python
en
code
1
github-code
36
[ { "api_name": "sqlite3.connect", "line_number": 7, "usage_type": "call" }, { "api_name": "sqlite3.Row", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 41, "usage_type": "call" }, { "api_name": "os.path", "line_numbe...
2671289236
import os import shutil from fastapi import UploadFile # UPLOAD_DIR = "model_upload_dir" def upload_file(upload_dirname: str, file: UploadFile, filename: str): if file and filename: fileobj = file.file target_path = os.path.join(upload_dirname, filename) target_dir = os.path.dirname(targe...
w-okada/voice-changer
server/restapi/mods/FileUploader.py
FileUploader.py
py
1,402
python
en
code
12,673
github-code
36
[ { "api_name": "fastapi.UploadFile", "line_number": 8, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "li...
20780721557
import os #to access files from PIL import Image #to open JPEGs import numpy as np #-------------------------------Custom INCLUDES------------------------------- import lookupTables as lT #-------------------------------Function DEFINITIONS---------------------------- def fittingEstimator(inDir, file_name, ...
nowaythatsok/GNU_lapser
version_01/estimators.py
estimators.py
py
1,924
python
en
code
0
github-code
36
[ { "api_name": "PIL.Image.open", "line_number": 24, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 24, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.array", "line_number":...
24401528809
"""Handles the creating of obstacles within the game instance.""" import pygame from src.scripts.coordinate import Coordinate class Obstacle: """Class for handling the creating of obstables.""" def __init__(self) -> None: self.size = (50, 300) self.position = [ Coordinate(700, 400)...
Carson-Fletcher/PY_Flappy_Bird
src/scripts/obstacle.py
obstacle.py
py
1,007
python
en
code
0
github-code
36
[ { "api_name": "src.scripts.coordinate.Coordinate", "line_number": 11, "usage_type": "call" }, { "api_name": "src.scripts.coordinate.Coordinate", "line_number": 12, "usage_type": "call" }, { "api_name": "pygame.Rect", "line_number": 19, "usage_type": "call" }, { "a...
24925255734
import pygame pygame.init() screen_width = 480 screen_height = 640 screen = pygame.display.set_mode((screen_width, screen_height)) background = pygame.image.load("D:/coding/python/pygame_basic/background.png") pygame.display.set_caption("offRo") running = True while running: for event in pygame.event.get(): ...
pla2n/python_practice
python/pygame_basic/2_background.py
2_background.py
py
496
python
en
code
0
github-code
36
[ { "api_name": "pygame.init", "line_number": 3, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pygame.image.loa...
656371734
#!/usr/bin/env python import json import pickle import os import pytest import numpy as np import mercantile as merc import inspect import rasterio import untiler from untiler.scripts import tile_utils def test_templating_good_jpg(): print("") expectedMatch = 'tarbase/jpg/\d+/\d+/\d+.jpg' expectedInterp...
mapbox/untiler
tests/test_untiler_funcs.py
test_untiler_funcs.py
py
13,079
python
en
code
39
github-code
36
[ { "api_name": "untiler.scripts.tile_utils.parse_template", "line_number": 22, "usage_type": "call" }, { "api_name": "untiler.scripts.tile_utils", "line_number": 22, "usage_type": "name" }, { "api_name": "inspect.stack", "line_number": 29, "usage_type": "call" }, { ...
41560046268
# -*- coding: utf-8 -*- # @Time : 2018/5/6 20:21 # @Author : Narata # @Project : android_app # @File : insert_comment.py # @Software : PyCharm import pymysql import json db = pymysql.connect('localhost', 'root', 'narata', 'android', charset='utf8') cursor = db.cursor() with open('../dataset/review.json',...
narata/android_app
databases/mysql/insert_comment.py
insert_comment.py
py
874
python
en
code
0
github-code
36
[ { "api_name": "pymysql.connect", "line_number": 12, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 18, "usage_type": "call" }, { "api_name": "pymysql.escape_string", "line_number": 22, "usage_type": "call" } ]
16321882534
import logging from mmpose.apis.inference import inference_top_down_pose_model, init_pose_model, vis_pose_result from mmpose.datasets import DatasetInfo logger = logging.getLogger(__name__) def loadModel(configPath, ckptPath, device, half): model = init_pose_model(configPath, ckptPath, str(device).lower()) da...
ideguchi92/assignment
src/vitposeModule.py
vitposeModule.py
py
1,323
python
en
code
0
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "mmpose.apis.inference.init_pose_model", "line_number": 11, "usage_type": "call" }, { "api_name": "mmpose.datasets.DatasetInfo", "line_number": 22, "usage_type": "call" }, { ...
17697981558
import os import sys from time import time, sleep from itertools import permutations import pickle import matplotlib.pyplot as plt import cv2 import numpy as np import pandas as pd import mediapipe as mp from sklearn.tree import DecisionTreeClassifier from PIL import Image, ImageDraw, ImageFont from t...
fukumoto1998/fingerspelling
word5/main.py
main.py
py
8,588
python
en
code
0
github-code
36
[ { "api_name": "numpy.array", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 18, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 19, "usage_type": "call" }, { "api_name": "PIL.Image.fromarray", "l...
41483919268
import json import requests from MGP_SDK import process from MGP_SDK.auth.auth import Auth class Pipelines: def __init__(self, auth: Auth): self.auth = auth self.api_version = self.auth.api_version self.base_url = f'{self.auth.api_base_url}/ordering/{self.api_version}/pipelines' ...
Maxar-Corp/maxar-geospatial-platform
src/MGP_SDK/ordering_service/pipelines.py
pipelines.py
py
3,242
python
en
code
2
github-code
36
[ { "api_name": "MGP_SDK.auth.auth.Auth", "line_number": 10, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 25, "usage_type": "call" }, { "api_name": "MGP_SDK.process._response_handler", "line_number": 26, "usage_type": "call" }, { "api_name": ...
14963550829
import shutil import logging from logging.config import fileConfig import sys import socket fileConfig('log.ini', defaults={'logfilename': 'bee.log'}) logger = logging.getLogger('health') # get hard drive space total, used, free = shutil.disk_usage("/") percent_used = used / total * 100.0 percent_used = '{:0.2f}'.fo...
jenkinsbe/hivekeepers
get_server_health.py
get_server_health.py
py
1,049
python
en
code
0
github-code
36
[ { "api_name": "logging.config.fileConfig", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "shutil.disk_usage", "line_number": 12, "usage_type": "call" }, { "api_name": "mysql.con...
23923499833
import tensorflow as tf from tensorflow.keras.models import Model from tensorflow.keras.layers import Input, concatenate, Conv2D, UpSampling2D from tensorflow.keras.layers import GlobalAveragePooling2D, Dense, LeakyReLU from tensorflow.keras import backend as K from keras.layers.core import Activation from keras.utils....
vosps/tropical_cyclone
wgan_no_rain/models.py
models.py
py
15,850
python
en
code
8
github-code
36
[ { "api_name": "tensorflow.keras.layers.Input", "line_number": 30, "usage_type": "call" }, { "api_name": "tensorflow.keras.layers.Input", "line_number": 34, "usage_type": "call" }, { "api_name": "blocks.const_upscale_block_100", "line_number": 39, "usage_type": "call" },...
22169474472
import memcache, random, string mc = memcache.Client(['127.0.0.1:11211'], debug=0) HEAD_KEY = "mqueueheadpointer" TAIL_KEY = "mqueuetailpointer" SEPARATOR = "___" VALUE_KEY = "value" LINK_KEY = "link" def random_id(): rid = '' for x in range(8): rid += random.choice(string.ascii_letters + string.digits) return ri...
codescrapper/mqueue
mqueue.py
mqueue.py
py
1,142
python
en
code
1
github-code
36
[ { "api_name": "memcache.Client", "line_number": 2, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 13, "usage_type": "call" }, { "api_name": "string.ascii_letters", "line_number": 13, "usage_type": "attribute" }, { "api_name": "string.digits"...
18792168810
import sys from fractions import Fraction prog, name, reps, lead = sys.argv[:4] lead, reps = int(lead), int(reps) L = [Fraction(s) for s in sys.argv[4:]] L = L * reps pL = [] def add_invert(n,d): p = 1/d q = n + p pL.append((str(d), str(p), str(n), str(q))) return q def evaluate(L): d = L.pop() ...
telliott99/short_takes
contd_fracs.py
contd_fracs.py
py
604
python
en
code
0
github-code
36
[ { "api_name": "sys.argv", "line_number": 4, "usage_type": "attribute" }, { "api_name": "fractions.Fraction", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 6, "usage_type": "attribute" } ]
32489489942
#-*-coding:utf-8 -*- from django.db import models from django.utils.translation import ugettext_lazy as _ __all__ = ['Department'] class Department(models.Model): name = models.CharField(max_length=30,unique=True,blank=False,default='guest',verbose_name=_('Department')) # principal = models.ManyToManyField(U...
opnms/opnms
users/models/department.py
department.py
py
614
python
en
code
0
github-code
36
[ { "api_name": "django.db.models.Model", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 8, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 9, "usage_type": "call" }, { "api_name": "...
71362096425
import os import logging from logging.handlers import RotatingFileHandler #Bot token @Botfather TG_BOT_TOKEN = os.environ.get("TG_BOT_TOKEN", "") #Your API ID from my.telegram.org APP_ID = int(os.environ.get("APP_ID", "")) #Your API Hash from my.telegram.org API_HASH = os.environ.get("API_HASH", "") #Your db channe...
RymOfficial/HackerFileShare
config.py
config.py
py
3,331
python
en
code
2
github-code
36
[ { "api_name": "os.environ.get", "line_number": 6, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 9, "usage_type": "call" }, { "api_name": "os.environ", "line_num...
71578859943
#!/usr/bin/env python import vtk def main(): font_size = 24 # Create the text mappers and the associated Actor2Ds. # The font and text properties (except justification) are the same for # each single line mapper. Let's create a common text property object singleLineTextProp = vtk.vtkTextProperty...
lorensen/VTKExamples
src/Python/Annotation/MultiLineText.py
MultiLineText.py
py
7,461
python
en
code
319
github-code
36
[ { "api_name": "vtk.vtkTextProperty", "line_number": 12, "usage_type": "call" }, { "api_name": "vtk.vtkTextProperty", "line_number": 21, "usage_type": "call" }, { "api_name": "vtk.vtkNamedColors", "line_number": 28, "usage_type": "call" }, { "api_name": "vtk.vtkTex...
11045288759
from datetime import datetime from django.shortcuts import get_object_or_404 from rest_framework import status from rest_framework.response import Response from rest_framework.permissions import IsAuthenticated from rest_framework.decorators import action from rest_framework.viewsets import GenericViewSet, ModelViewSet...
mohsen-hassani-org/teamche
todo_list/api.py
api.py
py
3,846
python
en
code
0
github-code
36
[ { "api_name": "rest_framework.viewsets.GenericViewSet", "line_number": 16, "usage_type": "name" }, { "api_name": "rest_framework.mixins.RetrieveModelMixin", "line_number": 16, "usage_type": "name" }, { "api_name": "rest_framework.mixins.ListModelMixin", "line_number": 16, ...
13670330701
import random from random import choice import discord import asyncio from discord.ext import commands import requests bot = commands.Bot(command_prefix='.') class games(commands.Cog): def __init__(self, bot): self.bot = bot determine_flip = [1, 0] @commands.command() async d...
BrandonLee28/Cardinal4
games.py
games.py
py
4,082
python
en
code
0
github-code
36
[ { "api_name": "discord.ext.commands.Bot", "line_number": 8, "usage_type": "call" }, { "api_name": "discord.ext.commands", "line_number": 8, "usage_type": "name" }, { "api_name": "discord.ext.commands.Cog", "line_number": 9, "usage_type": "attribute" }, { "api_name...
9045055933
from typing import Optional from xml.etree.ElementTree import Element, Comment from api.mvc.model.data.content_model import ContentModel from api.mvc.model.data.data_model import DataModel from api.mvc.model.data.data_type import DataType from api_core.exception.api_exception import ApiException from api_core.helper.f...
seedbaobab/alfresco_helper
api/mvc/model/service/file/content_model_service.py
content_model_service.py
py
30,329
python
en
code
0
github-code
36
[ { "api_name": "api_core.mvc.service.file.xml_file_service.XmlFileService", "line_number": 13, "usage_type": "name" }, { "api_name": "xml.etree.ElementTree.Element", "line_number": 30, "usage_type": "name" }, { "api_name": "api_core.helper.file_folder_helper.FileFolderHelper.extra...
35398230138
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement, print_function, unicode_literals) import os import subprocess from contextlib import closing from StringIO import StringIO from twitter.common.collections import maybe_list from pants.backend.core.t...
fakeNetflix/square-repo-pants
tests/python/pants_test/tasks/test_base.py
test_base.py
py
8,440
python
en
code
0
github-code
36
[ { "api_name": "subprocess.call", "line_number": 26, "usage_type": "call" }, { "api_name": "os.devnull", "line_number": 26, "usage_type": "attribute" }, { "api_name": "subprocess.STDOUT", "line_number": 26, "usage_type": "attribute" }, { "api_name": "pants_test.bas...
73225167144
from extra_streamlit_tools._logging import logging as logger import streamlit as st from typing import Any, Optional def clear_cache(keep_keys: Optional[list[str]] = None) -> None: """ Resets the Streamlit cache. Parameters ---------- keep_keys:Optional[list[str]] Keys to not be c...
sTomerG/extra-streamlit-tools
src/extra_streamlit_tools/utils.py
utils.py
py
2,324
python
en
code
0
github-code
36
[ { "api_name": "typing.Optional", "line_number": 6, "usage_type": "name" }, { "api_name": "extra_streamlit_tools._logging.logging.debug", "line_number": 16, "usage_type": "call" }, { "api_name": "extra_streamlit_tools._logging.logging", "line_number": 16, "usage_type": "na...
20756086605
""" Created on Thu Sep 8 14:37:34 2016 @author: Patrick Trainor @course: Artificial Intelligence @title: Project 2 Code for embedding of figure in tk credited to: http://matplotlib.org/examples/user_interfaces/embedding_in_tk.html Code for labeling points on figure credited to "unknown" @ http://stackov...
trainorp/srch
TSP_BFS_DFS.py
TSP_BFS_DFS.py
py
6,501
python
en
code
0
github-code
36
[ { "api_name": "Tkinter.Tk", "line_number": 29, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 33, "usage_type": "attribute" }, { "api_name": "re.findall", "line_number": 43, "usage_type": "call" }, { "api_name": "numpy.matrix", "line_number":...
36779117268
# NOTE: mini function for testing your UDP connection w the computer running the server and MAX from pythonosc import udp_client PORT_TO_MAX = 5002 IP = "192.168.2.2" global client client = udp_client.SimpleUDPClient(IP, PORT_TO_MAX) input("hello") while True: print("sent") client.send_message("/point", 1) ...
mshen63/RoboticMusicianship_CV_Project
oldReferenceFiles/socketTrial.py
socketTrial.py
py
336
python
en
code
0
github-code
36
[ { "api_name": "pythonosc.udp_client.SimpleUDPClient", "line_number": 8, "usage_type": "call" }, { "api_name": "pythonosc.udp_client", "line_number": 8, "usage_type": "name" } ]
75034732264
import logging from handlers.detectors import detect_is_admin from keyboards.default.start import start_admin from keyboards.inline.admin.success_payment import withdraw_money_balance from loader import dp, bot, db from data.config import ADMINS from keyboards.default.back import back from states.balance import Balan...
uzbsobirov/Money-grow-bot
handlers/users/balance/withdraw_money.py
withdraw_money.py
py
6,079
python
en
code
0
github-code
36
[ { "api_name": "aiogram.types.CallbackQuery", "line_number": 17, "usage_type": "attribute" }, { "api_name": "aiogram.types", "line_number": 17, "usage_type": "name" }, { "api_name": "aiogram.dispatcher.FSMContext", "line_number": 17, "usage_type": "name" }, { "api_...
8890345896
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Jan 20 15:50:56 2018 @author: vitorhadad """ # import numpy as np import networkx as nx import os from tqdm import trange from matching.solver.kidney_solver2 import optimal, greedy, get_two_cycles from matching.utils.data_utils import clock_seed, evalu...
halflearned/organ-matching-rl
matching/temp/temp.py
temp.py
py
3,852
python
en
code
2
github-code
36
[ { "api_name": "networkx.write_edgelist", "line_number": 32, "usage_type": "call" }, { "api_name": "os.system", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 42, "usage_type": "call" }, { "api_name": "pdb.set_trace", "li...
15066809328
# This file is part of ZNC-Signal <https://github.com/poppyschmo/znc-signal>, # licensed under Apache 2.0 <http://www.apache.org/licenses/LICENSE-2.0>. import pytest from copy import deepcopy from collections import namedtuple from conftest import signal_stub, signal_stub_debug, all_in signal_stub = signal_stub # qui...
poppyschmo/znc-signal
tests/test_hooks.py
test_hooks.py
py
13,691
python
en
code
1
github-code
36
[ { "api_name": "conftest.signal_stub", "line_number": 8, "usage_type": "name" }, { "api_name": "conftest.signal_stub_debug", "line_number": 9, "usage_type": "name" }, { "api_name": "os.environ", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.envi...
41198927211
import logging import json from lxml import etree def get_field_text(tree, path): nsmap = {"n1": tree.getroot().nsmap['n1']} node = tree.xpath(path, namespaces=nsmap) if len(node) > 0: return node[0].text return '' def parse_metadata(scene, xml_filename, json_filename): logger = logging.ge...
amy-langley/irma-import
xml_operations.py
xml_operations.py
py
1,267
python
en
code
0
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "lxml.etree.parse", "line_number": 18, "usage_type": "call" }, { "api_name": "lxml.etree", "line_number": 18, "usage_type": "name" }, { "api_name": "json.loads", "line_...
15955214108
#! python3 # sendDuesReminders.py - sends emails based on payment status in spreadsheet import smtplib import openpyxl wb = openpyxl.load_workbook('C:\\Users\\daize\\Desktop\\pythontest\\Automate\\duesRecords.xlsx') sheet = wb.get_sheet_by_name('Sheet1') lastCol = sheet.max_column latestMonth = sheet.cell(row=1, col...
sdz0716/myPython
act16-email_message/sendDuesReminders.py
sendDuesReminders.py
py
1,218
python
en
code
0
github-code
36
[ { "api_name": "openpyxl.load_workbook", "line_number": 7, "usage_type": "call" }, { "api_name": "smtplib.SMTP", "line_number": 21, "usage_type": "call" } ]
13015450298
import asyncio import websockets HOST = '0.0.0.0' WS_PORT = 3333 TCP_PORT = 8888 loop = asyncio.get_event_loop() websocket_connections = [] tcp_connections = [] async def send_status(status: str): data = status.encode() for c in tcp_connections: try: writer = c[1] writer.write(data) await writer.drai...
DeadMorose777/UE4_SpeechController
speech_controller-main/host2.py
host2.py
py
2,119
python
en
code
0
github-code
36
[ { "api_name": "asyncio.get_event_loop", "line_number": 8, "usage_type": "call" }, { "api_name": "websockets.exceptions", "line_number": 65, "usage_type": "attribute" }, { "api_name": "websockets.serve", "line_number": 88, "usage_type": "call" }, { "api_name": "asy...
7535403822
from __future__ import print_function # # -*- coding: utf-8 -*-# # eso.org # Copyright 2011 ESO # Authors: # Lars Holm Nielsen <lnielsen@eso.org> # Dirk Neumayer <dirk.neumayer@gmail.com> # # # Mantis 12175: Fix release dates for images and videos # # # Find wrong release_dates: # 1) Check id with release_date - e....
esawebb/esawebb
scripts/correct_dates.py
correct_dates.py
py
4,493
python
en
code
0
github-code
36
[ { "api_name": "future.standard_library.install_aliases", "line_number": 28, "usage_type": "call" }, { "api_name": "future.standard_library", "line_number": 28, "usage_type": "name" }, { "api_name": "hubblesite.get_release_date", "line_number": 58, "usage_type": "call" }...
21787505234
import json from datetime import date,timedelta path = '/Users/evcu/GitHub/evcu.github.io//assets/nyc365blog/data.json' data = {} newel = {} newel[u'date'] = str(date.today()-timedelta(days=365)) newel[u'mood'] = str(input("Enter mood -1/0/1:\n")) print(newel) newel[u'high'] = str(input("Highlights\n")) newel[u'low'] ...
evcu/evcu.github.io
assets/nyc365blog/newDay.py
newDay.py
py
704
python
en
code
1
github-code
36
[ { "api_name": "datetime.date.today", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 7, "usage_type": "name" }, { "api_name": "datetime.timedelta", "line_number": 7, "usage_type": "call" }, { "api_name": "json.load", "li...
19856862641
# -*-- encoding=utf-8 --*- import pandas as pd import xlsxwriter import os import platform from pandas import ExcelWriter from util import main_function,plot_trend def __read_one_csv_file(inCsvFileName): try: callFailData=pd.read_csv(inCsvFileName, dtype={'呼叫对方号码': ob...
sundaygeek/bigdata-cloud-analysis
cloud_in_callfail.py
cloud_in_callfail.py
py
18,222
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_n...
10535469198
import pygame import os from sys import exit WIDTH, HEIGHT = 1600, 900 pygame.init() WIN = pygame.display.set_mode((WIDTH, HEIGHT)) pygame.display.set_caption("Buildings") WHITE = (255, 255, 255) FPS = 60 indx = 0 font = pygame.font.Font(None, 50) class Building(): def __init__(self, name, offset_x, offset_y): ...
Hemant-29/pygame-project
building.py
building.py
py
2,913
python
en
code
0
github-code
36
[ { "api_name": "pygame.init", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pygame.display.s...
25404288175
# -*- coding: utf-8 -*- import torch.nn as nn from network import Decomposition,MultiscaleDiscriminator,downsample from utils import gradient from ssim import SSIM import torch import torch.optim as optim import torchvision import os import torch.nn.functional as F from contiguous_params import ContiguousParams class...
thfylsty/ImageFusion_DeepDecFusion
model.py
model.py
py
11,325
python
en
code
5
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 14, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 14, "usage_type": "name" }, { "api_name": "network.Decomposition", "line_number": 17, "usage_type": "call" }, { "api_name": "network.Multiscal...
34898939242
import numpy as np import librosa from typing import List import matplotlib.pyplot as plt from scipy import signal from scipy.fft import rfft, rfftfreq import os TECHNIQUES = ['High', 'Tasto', 'Bend', 'Harm', 'Strum', 'Pont', 'Ord', 'Chord', 'Smack', 'Palm', 'TEST', 'SILENCE'] #TECHNIQUES = os.listdir("samples/manual...
trian-gles/ai-technique-classification
utilities/analysis.py
analysis.py
py
4,193
python
en
code
0
github-code
36
[ { "api_name": "numpy.ndarray", "line_number": 14, "usage_type": "attribute" }, { "api_name": "librosa.onset.onset_strength", "line_number": 17, "usage_type": "call" }, { "api_name": "librosa.onset", "line_number": 17, "usage_type": "attribute" }, { "api_name": "li...
19567593432
import requests import csv from bs4 import BeautifulSoup import json from collections import namedtuple from typing import List, Dict TOPICS_NUMBER = 6 LEVELS_NUMBER = 5 MIN_LEVEL_CONTEST_ID = "030813" MAX_LEVEL_CONTEST_ID = "030817" TABLE_URL = ("https://ejudge.lksh.ru/standings/dk/stand.php" "?from={}&t...
daniil-konovalenko/Cprime-practice-results
load_results.py
load_results.py
py
3,803
python
en
code
0
github-code
36
[ { "api_name": "collections.namedtuple", "line_number": 16, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 21, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 22, "usage_type": "call" }, { "api_name": "bs4.BeautifulSo...
18692006503
import json import logging import sys from z3 import z3 from teether.constraints import check_model_and_resolve from teether.evm.exceptions import IntractablePath from teether.evm.state import LazySubstituteState, SymRead from teether.project import Project from teether.util.z3_extra_util import concrete def set_bala...
t-hermanns/coercer
bin/set_balanceOf.py
set_balanceOf.py
py
4,086
python
en
code
1
github-code
36
[ { "api_name": "z3.z3.Array", "line_number": 13, "usage_type": "call" }, { "api_name": "z3.z3", "line_number": 13, "usage_type": "name" }, { "api_name": "z3.z3.BitVecSort", "line_number": 13, "usage_type": "call" }, { "api_name": "z3.z3.Store", "line_number": 1...
11704013339
# -*- coding: utf-8 -*- """Translator module""" from __future__ import division from data import NUMBERS class Translator(object): """Translator class""" @classmethod def translate(cls, data): """The method for converting a input data to number instance """ if isinstance(data, str): ...
russtanevich/num_converter
translator.py
translator.py
py
2,596
python
en
code
0
github-code
36
[ { "api_name": "data.NUMBERS", "line_number": 33, "usage_type": "name" }, { "api_name": "data.NUMBERS", "line_number": 35, "usage_type": "name" }, { "api_name": "data.NUMBERS", "line_number": 36, "usage_type": "name" }, { "api_name": "data.NUMBERS", "line_numbe...
6679921790
#!/usr/bin/env python """ Download the given htmx version and the extensions we're using. """ import argparse import subprocess from typing import List, Optional def main(argv: Optional[List[str]] = None) -> int: parser = argparse.ArgumentParser() parser.add_argument("version", help="e.g. 1.0.1") args = p...
hernantz/django-htmx-demo
download_htmx.py
download_htmx.py
py
1,146
python
en
code
5
github-code
36
[ { "api_name": "typing.Optional", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 10, "usage_type": "name" }, { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "subprocess.run", ...
23597687031
import sieve from typing import Dict, List import os from dotenv import load_dotenv load_dotenv() api_key = os.environ.get('SIEVE_API_KEY') sieve.SIEVE_API_KEY = os.getenv('SIEVE_API_KEY') sieve.SIEVE_API_URL = os.getenv('SIEVE_API_URL') @sieve.Model( name="deepface-emotion-detector", gpu = True, python_pack...
GauravMohan1/sieve_emotion_face_tracker
main.py
main.py
py
3,571
python
en
code
0
github-code
36
[ { "api_name": "dotenv.load_dotenv", "line_number": 7, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 8, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 8, "usage_type": "attribute" }, { "api_name": "sieve.SIEVE_API_KEY", ...
20078827999
from django.urls import reverse from rest_framework import status from rest_framework.test import APITestCase from api.serializers import BookSerializer from books.models import Book, PublicationLanguage, Author from django.test import Client client = Client() class TestBookList(APITestCase): def setUp(self) ->...
tomasz-rzesikowski/books_poc
api/tests/tests_views.py
tests_views.py
py
2,504
python
en
code
0
github-code
36
[ { "api_name": "django.test.Client", "line_number": 9, "usage_type": "call" }, { "api_name": "rest_framework.test.APITestCase", "line_number": 12, "usage_type": "name" }, { "api_name": "books.models.PublicationLanguage.objects.get_or_create", "line_number": 14, "usage_type...
14521287997
#imports the os package and inotify import os from inotify_simple import INotify, flags #pulls in the package inotify = INotify() #runs the below command so this script will keep running once it's finished os.system("while :; do python3 File-Changes.py; done") #creates the watch flags watch_flags = flags.CREATE | flags...
Splixxy/Cron-Job
File-Changes.py
File-Changes.py
py
907
python
en
code
0
github-code
36
[ { "api_name": "inotify_simple.INotify", "line_number": 5, "usage_type": "call" }, { "api_name": "os.system", "line_number": 7, "usage_type": "call" }, { "api_name": "inotify_simple.flags.CREATE", "line_number": 9, "usage_type": "attribute" }, { "api_name": "inotif...
32413884802
import pytest import torch from renate.benchmark.models.transformer import HuggingFaceSequenceClassificationTransformer @pytest.mark.parametrize("model_name", ["distilbert-base-uncased", "bert-base-uncased"]) def test_init(model_name): HuggingFaceSequenceClassificationTransformer( pretrained_model_name_o...
awslabs/Renate
test/renate/benchmark/models/test_text_transformer.py
test_text_transformer.py
py
844
python
en
code
251
github-code
36
[ { "api_name": "renate.benchmark.models.transformer.HuggingFaceSequenceClassificationTransformer", "line_number": 9, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 7, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 7, "u...
74260920742
import numpy as np import torch import copy from pathlib import Path from torch_scatter import scatter from typing import Dict, Tuple from pcdet.datasets.v2x_sim.v2x_sim_dataset_ego import V2XSimDataset_EGO, get_pseudo_sweeps_of_1lidar, get_nuscenes_sensor_pose_in_global, apply_se3_ from pcdet.datasets.v2x_sim.v2x_sim...
quan-dao/practical-collab-perception
pcdet/datasets/v2x_sim/v2x_sim_dataset_ego_late.py
v2x_sim_dataset_ego_late.py
py
6,411
python
en
code
5
github-code
36
[ { "api_name": "pcdet.datasets.v2x_sim.v2x_sim_dataset_ego.V2XSimDataset_EGO", "line_number": 12, "usage_type": "name" }, { "api_name": "torch.load", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.device", "line_number": 19, "usage_type": "call" }, { ...
73339180903
import asyncio import json from datetime import datetime import aiohttp from pydantic import BaseModel, Field, NonNegativeFloat from faststream import ContextRepo, FastStream, Logger from faststream.kafka import KafkaBroker broker = KafkaBroker("localhost:9092") app = FastStream(broker) class CryptoPrice(BaseMode...
airtai/faststream-gen
docs_src/tutorial/retrieve-publish-crypto/app/application.py
application.py
py
2,687
python
en
code
19
github-code
36
[ { "api_name": "faststream.kafka.KafkaBroker", "line_number": 12, "usage_type": "call" }, { "api_name": "faststream.FastStream", "line_number": 13, "usage_type": "call" }, { "api_name": "pydantic.BaseModel", "line_number": 16, "usage_type": "name" }, { "api_name": ...
16483457321
from flask import Blueprint, g from flask_graphql import GraphQLView from flask_cors import CORS from .schema import schema api = Blueprint('api', __name__) CORS(api, supports_credentials=True) # Enables CORS with cross origin cookies class CustomGraphQlView(GraphQLView): def dispatch_request(self): resp...
AlexEshoo/poll_app_graphql
poll_app_graphql/api/__init__.py
__init__.py
py
672
python
en
code
0
github-code
36
[ { "api_name": "flask.Blueprint", "line_number": 6, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 7, "usage_type": "call" }, { "api_name": "flask_graphql.GraphQLView", "line_number": 9, "usage_type": "name" }, { "api_name": "flask.g.get", ...
26236313252
import csv import json # Save .csv file from dict List [{}] def save_file(results, filename, format): if(format=='csv'): if(len(results) > 0): with open(f'{filename}.csv', 'w', encoding='utf8', newline='') as output_file: output_file.write('sep=,\n') ...
cristianmacedo/crawliexpress
crawliexpress/lib/helpers.py
helpers.py
py
648
python
en
code
8
github-code
36
[ { "api_name": "csv.DictWriter", "line_number": 11, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 16, "usage_type": "call" } ]
35196657682
import os import dataclasses import unittest import torch import math import copy import numpy as np import lpips from dataset.co3d_dataset import Co3dDataset, FrameData from dataset.dataset_zoo import DATASET_ROOT from tools.utils import dataclass_to_cuda_ from evaluation.evaluate_new_view_synthesis import eval_batc...
eldar/snes
3rdparty/co3d/tests/test_evaluation.py
test_evaluation.py
py
10,050
python
en
code
59
github-code
36
[ { "api_name": "unittest.TestCase", "line_number": 19, "usage_type": "attribute" }, { "api_name": "torch.manual_seed", "line_number": 22, "usage_type": "call" }, { "api_name": "dataset.dataset_zoo.DATASET_ROOT", "line_number": 24, "usage_type": "name" }, { "api_nam...
71656889065
import torch import torchaudio from torchaudio.transforms import MelSpectrogram, Spectrogram def load_wav_to_torch(full_path, hop_size=0, slice_train=False): wav, sampling_rate = torchaudio.load(full_path, normalize=True) if not slice_train: p = (wav.shape[-1] // hop_size + 1) * hop_size - wav.shape[...
jisang93/VISinger
utils/audio/mel_processing.py
mel_processing.py
py
2,724
python
en
code
13
github-code
36
[ { "api_name": "torchaudio.load", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.nn.functional.pad", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 11, "usage_type": "attribute" }, { "api_name": "torch.nn", "...
3585781734
from __future__ import absolute_import, division, print_function # Local Imports from modeling import ArgStrModel from arguments import TrainingArguments from training import ArgStrTrainer from processors import get_datasets from utils import Data_Collator, set_seed # Standard Imports import os import random # Third...
The-obsrvr/ArgStrength
Hyper-parameter-optimization/src/retraining.py
retraining.py
py
6,077
python
en
code
0
github-code
36
[ { "api_name": "os.environ", "line_number": 24, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 38, "usage_type": "call" }, { "api_name": "torch.device", "line_number": 45, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", ...
10680492541
import time import tensorflow.compat.v1 as tf # tf.disable_eager_execution() tf.config.run_functions_eagerly(True) tf.enable_eager_execution() from utils import * from models import RGCN import random import pandas as pd from sklearn.gaussian_process import GaussianProcessClassifier from sklearn.gaussian_process.kernel...
zzheng18/CSPC680RGCNV
src/train_gpc.py
train_gpc.py
py
4,973
python
en
code
0
github-code
36
[ { "api_name": "tensorflow.compat.v1.config.run_functions_eagerly", "line_number": 4, "usage_type": "call" }, { "api_name": "tensorflow.compat.v1.config", "line_number": 4, "usage_type": "attribute" }, { "api_name": "tensorflow.compat.v1", "line_number": 4, "usage_type": "...
15506027054
# https://medium.com/analytics-vidhya/computer-vision-and-deep-learning-part-2-586b6a0d3220 --- main # https://github.com/Esri/raster-deep-learning/blob/master/docs/writing_deep_learning_python_raster_functions.md import cv2 import numpy as np from matplotlib import pyplot as plt cv_image= cv2.imread("/home/jameshu...
hssaccord/myTEST
main.py
main.py
py
1,348
python
en
code
0
github-code
36
[ { "api_name": "cv2.imread", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.adaptiveThreshold", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.ADAPTIVE_THRESH_MEAN_C", "line_number": 10, "usage_type": "attribute" }, { "api_name": "cv2.T...
3206852190
""" Provides the different Bounds that are used by the Table to determine the Cells that are adjacent to the Table. """ from __future__ import annotations from _operator import attrgetter from itertools import cycle from typing import Callable, cast, Iterable, NamedTuple, Protocol, TypeVar from pdf2gtfs.config impor...
heijul/pdf2gtfs
src/pdf2gtfs/datastructures/table/bounds.py
bounds.py
py
13,748
python
en
code
1
github-code
36
[ { "api_name": "typing.TypeVar", "line_number": 16, "usage_type": "call" }, { "api_name": "typing.Protocol", "line_number": 19, "usage_type": "name" }, { "api_name": "typing.Iterable", "line_number": 21, "usage_type": "name" }, { "api_name": "pdf2gtfs.datastructure...
74147866345
import pygame, humans, sys, menu from random import randint scan_delay = 300 coll_delay = 300 move_delay = 300 menu.valmynd() skra = open("settings/exit.txt", "r") for line in skra: if line == "True": sys.exit() skra.close() settings = (open("settings/settings.txt", "r").read()).split() fps = int(setting...
Zepeacedust/skolasim
main.py
main.py
py
1,408
python
en
code
1
github-code
36
[ { "api_name": "menu.valmynd", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 12, "usage_type": "call" }, { "api_name": "pygame.init", "line_number": 19, "usage_type": "call" }, { "api_name": "humans.student", "line_number": ...
4705152598
import numpy as np import pandas as pd import logging logging.getLogger(__name__).addHandler(logging.NullHandler()) logger = logging.getLogger(__name__) try: from sklearn.base import TransformerMixin, BaseEstimator except ImportError: msg = "scikit-learn not installed" logger.warning(msg) try: from ...
skerryvore/pyrolite
pyrolite/util/skl/impute.py
impute.py
py
6,714
python
en
code
null
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 5, "usage_type": "call" }, { "api_name": "logging.NullHandler", "line_number": 5, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "sklearn.base.Bas...
42037688043
""" Signal characteristics animation """ import os import numpy as np import matplotlib import matplotlib.pyplot as plt from matplotlib.animation import FuncAnimation from matplotlib import gridspec matplotlib.use('TkAgg') class sigCharacterAnimation: ''' Animation for signal characteristics ''' # si...
PenroseWang/SimGPS
code/utils/signal_characteristic.py
signal_characteristic.py
py
6,216
python
en
code
11
github-code
36
[ { "api_name": "matplotlib.use", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 35, "usage_type": "attribute" }, { "api_name": "numpy.arange", "line_number": 42, "usage_type": "call" }, { "api_name": "numpy.sin", "line_numbe...
15000533019
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Fri Jan 12 15:36:15 2018 @author: chrelli added unix time stamps to the first camera! Ways to slim down the data: no unix time stamps? no color frame showing? - yes, helps a lot! no png compression? Totally fine at 30 fps! Majow to do list: ...
chrelli/3DDD_social_mouse_tracker
recording/record_calib_npy.py
record_calib_npy.py
py
15,418
python
en
code
5
github-code
36
[ { "api_name": "sys.path.append", "line_number": 50, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 50, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 68, "usage_type": "call" }, { "api_name": "argparse.Argume...
11952114818
from datetime import datetime import backtrader as bt import tushare as ts import pandas as pd class MyStrategy1(bt.Strategy): params = (('maperiod', 20), ('printlog', False),) def __init__(self): # 指定价格序列 self.dataclose = self.datas[0].close # 初始化交易指令、买卖价格和...
Cui-Yusong/NUS_proj
backtest_sma.py
backtest_sma.py
py
8,940
python
en
code
1
github-code
36
[ { "api_name": "backtrader.Strategy", "line_number": 7, "usage_type": "attribute" }, { "api_name": "backtrader.indicators.SimpleMovingAverage", "line_number": 20, "usage_type": "call" }, { "api_name": "backtrader.indicators", "line_number": 20, "usage_type": "attribute" ...
74434198503
import json #to impost post.json from blog.models import Post # instance of opening and loading json data with open('post.json') as f: posts_json = json.load(f) # Loop through JSON data for post in posts_json: """ input: title: the title of the json element content: the cotent of the json ...
YusufBritton1990/Django_tutorial_backup
django_project/shell_posting.py
shell_posting.py
py
837
python
en
code
0
github-code
36
[ { "api_name": "json.load", "line_number": 6, "usage_type": "call" }, { "api_name": "blog.models.Post", "line_number": 23, "usage_type": "call" } ]
1923472018
#!/usr/bin/env python #coding=utf-8 import json from lib.sqs import zhihufav_sqs from lib.tasks import add_note def get_sqs_queue(): sqs_info = zhihufav_sqs.get_messages(10) for sqs in sqs_info: sqs_body = sqs.get_body() receipt_handle = sqs.receipt_handle sqs_json = json.loads(sqs_bo...
youqingkui/zhihufav
do_tasks.py
do_tasks.py
py
553
python
en
code
0
github-code
36
[ { "api_name": "lib.sqs.zhihufav_sqs.get_messages", "line_number": 10, "usage_type": "call" }, { "api_name": "lib.sqs.zhihufav_sqs", "line_number": 10, "usage_type": "name" }, { "api_name": "json.loads", "line_number": 14, "usage_type": "call" }, { "api_name": "lib...
11342229951
import io import os import random from PIL import Image import imageio import requests import seventv def get_response(message: str): p_message = message.lower() if p_message[:3] == ("add"): url = p_message.split(" ")[1] return addGif(url) if p_message == "help": return helpText(...
JimenezJC/discord-7tv-emoji-app
responses.py
responses.py
py
1,667
python
en
code
1
github-code
36
[ { "api_name": "seventv.get_webp_url", "line_number": 28, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 30, "usage_type": "call" }, { "api_name": "requests.exceptions", "line_number": 31, "usage_type": "attribute" }, { "api_name": "seventv.ge...
18391614264
import requests from bs4 import BeautifulSoup import wikipedia class unotes: def __init__(self,*args): self.data_list = [a.replace(' ','_')for a in args] self.content = {} self.links = {} def __str__(self): return f"unotes for {self.data_list}" def search(self): co...
UtsabKafle/unotes
src/unotes.py
unotes.py
py
4,021
python
en
code
0
github-code
36
[ { "api_name": "wikipedia.search", "line_number": 20, "usage_type": "call" }, { "api_name": "wikipedia.summary", "line_number": 23, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 27, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", ...
19250130553
import http import requests import tenacity from bs4 import BeautifulSoup from tenacity import retry_if_exception_type, stop_after_attempt from .exceptions import BadRequest, NetworkError, NotClientError, NotFound, ServerError from .utils import cache @tenacity.retry( reraise=True, retry=retry_if_exception_...
macoyshev/weather_CLI
weather/weather_parser.py
weather_parser.py
py
1,336
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 28, "usage_type": "call" }, { "api_name": "requests.exceptions", "line_number": 32, "usage_type": "attribute" }, { "api_name": "http.HTTPStatus", "line_number": 35, "usage_type": "attribute" }, { "api_name": "exceptions...
72718761064
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Created on Fri Mar 10 12:54:45 2023 """ import numpy as np from pyGITR.math_helper import * from typing import Callable import matplotlib.pyplot as plt import pydoc import netCDF4 import os def Gaussian(x: np.ndarray = np.linspace(-15000, 15000, 100000), sigma: float =...
audide12/DIIIDsurface_pyGITR
pyGITR/importance_sampling_1.py
importance_sampling_1.py
py
2,626
python
en
code
1
github-code
36
[ { "api_name": "numpy.ndarray", "line_number": 13, "usage_type": "attribute" }, { "api_name": "numpy.linspace", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.pi", "line_num...
28981514805
from django.conf.urls import patterns, url, include from django.contrib import admin admin.autodiscover() urlpatterns = patterns( 'sokoban.views', url(r'^$', 'index', name='index'), url(r'^dashboard/$', 'dashboard', name='dashboard'), url(r'^home/$', 'home', name='home'), url(r'^403/$', 'alert_log...
BusyJay/sokoban
src/sokoban/urls.py
urls.py
py
978
python
en
code
3
github-code
36
[ { "api_name": "django.contrib.admin.autodiscover", "line_number": 4, "usage_type": "call" }, { "api_name": "django.contrib.admin", "line_number": 4, "usage_type": "name" }, { "api_name": "django.conf.urls.patterns", "line_number": 6, "usage_type": "call" }, { "api...
26613636857
import numpy as np import cv2 from imgutil import read_img from scipy.optimize import minimize from mathutil import Rx, Ry, Rz in_size = (1080//2, 1920//2) fov_factor = 1 marks = [ (1, 2, [((925, 1080//2 - 338), (1131 - 1920//2, 1080//2 - 383)), ((946, 1080//2 - 321), (1156 - 1920//2, 1080//2 - 375)),...
42Ar/cube_mapper
marker_calc.py
marker_calc.py
py
2,039
python
en
code
0
github-code
36
[ { "api_name": "numpy.array", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.linalg.norm", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.linalg", "line_nu...
74246420903
import pandas as pd import glob from openpyxl import load_workbook import os class DataFile: def __init__(self, file_path): self.file_path = file_path @staticmethod def read_csv_file(file_path): """ reads a *.csv file and returns a pandas DataFrame of the file :param fil...
DimaZimin/invoice_status_check
datafile.py
datafile.py
py
2,386
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 21, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 30, "usage_type": "call" }, { "api_name": "pandas.concat", "line_number": 31, "usage_type": "call" }, { "api_name": "openpyxl.load_workbook", ...
39399879426
from pyspark import SparkConf, SparkContext import random import numpy as np import time def mapper1(line): matrix_name, row, col, num = line.split(",") row, col, num = int(row), int(col), int(num) mapList = [] for idx in range(MATRIX_SIZE): if matrix_name == 'M': key = (row, idx, ...
uuuChen/NTHU-Course-BIGDATA
bigData_hw1/hw1.py
hw1.py
py
2,829
python
en
code
0
github-code
36
[ { "api_name": "pyspark.SparkConf", "line_number": 38, "usage_type": "call" }, { "api_name": "pyspark.SparkContext", "line_number": 39, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 54, "usage_type": "call" }, { "api_name": "random.randint"...
30144105909
import os from playhouse.sqlite_ext import CSqliteExtDatabase from peewee import DatabaseProxy class PDatabaseFactory: def __init__(self, config): self.cfg = config self.instances = {} self.defaut_instance = self.cfg.get('db', 'database') self.sqlite_db_path = self.cfg.get('sqlite...
prise6/medias-trends
mediastrends/database/peewee/PDatabaseFactory.py
PDatabaseFactory.py
py
1,277
python
en
code
2
github-code
36
[ { "api_name": "peewee.DatabaseProxy", "line_number": 13, "usage_type": "call" }, { "api_name": "playhouse.sqlite_ext.CSqliteExtDatabase", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 22, "usage_type": "call" }, { "api_...
2962500565
from prettytable import PrettyTable import sympy as sp sp.init_printing(use_unicode=True) def raices_multiples(x0, tolerancia, niter): x = sp.symbols('x') #f = x**4 - 18*x**2+81 f = x**3 - x**2 - x + 1 + sp.sin(x-1)**2 tabla = PrettyTable(['i', 'xn', 'f(xn)', 'df(xn)', 'ddf(xn)', 'ErrorAbs', 'ErrorRel...
jvalen92/Analisis-Numerico
SolucionEcuancionesUnaVariable/raices_multples.py
raices_multples.py
py
1,051
python
en
code
1
github-code
36
[ { "api_name": "sympy.init_printing", "line_number": 4, "usage_type": "call" }, { "api_name": "sympy.symbols", "line_number": 7, "usage_type": "call" }, { "api_name": "sympy.sin", "line_number": 9, "usage_type": "call" }, { "api_name": "prettytable.PrettyTable", ...
27688934832
import sys import pandas as pd import numpy as np from sklearn.preprocessing import RobustScaler from sklearn.tree import DecisionTreeClassifier from evaluate_model import evaluate_model dataset = sys.argv[1] num_param_combinations = int(sys.argv[2]) random_seed = int(sys.argv[3]) np.random.seed(random_seed) pipelin...
rhiever/sklearn-benchmarks
model_code/random_search/DecisionTreeClassifier.py
DecisionTreeClassifier.py
py
1,283
python
en
code
204
github-code
36
[ { "api_name": "sys.argv", "line_number": 8, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 10, "usage_type": "attribute" }, { "api_name": "numpy.random.seed", "line...
37362500325
import os import sys from pathlib import Path from typing import Optional import tempfile import time import queue import subprocess import threading class IPythonInterpreter: _END_MESSAGE = "__ INTERPRETER END OF EXECUTION __" _INTERPRETER_PROMPT = ">>> " _LAST_VAR = "_INTERPRETER_last_val" def __in...
silvanmelchior/IncognitoPilot
services/services/interpreter/ipython_interpreter.py
ipython_interpreter.py
py
5,216
python
en
code
364
github-code
36
[ { "api_name": "pathlib.Path", "line_number": 20, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 21, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 27, "usage_type": "call" }, { "api_name": "sys.executable", "line_num...
8060696161
# Lint as: python3 """CoQA: A Conversational Question Answering Challenge""" # partially taken from https://github.com/NTU-SQUAD/transformers-coqa/blob/2dfd58b70956e935e370989fa421f34bb83bff08/data/processors/coqa.py from __future__ import absolute_import, division, print_function import json import logging import os...
HLTCHKUST/CAiRE_in_DialDoc21
utils/coqa.py
coqa.py
py
9,844
python
en
code
11
github-code
36
[ { "api_name": "datasets.GeneratorBasedBuilder", "line_number": 62, "usage_type": "attribute" }, { "api_name": "datasets.Version", "line_number": 64, "usage_type": "call" }, { "api_name": "datasets.BuilderConfig", "line_number": 67, "usage_type": "call" }, { "api_n...
33873457342
import tkinter as tk import tkinter.font as font from PIL import Image, ImageTk import QuikSpace as qs import Add_Task_School_Work as atsw import Review_Task_School_Work as rtsw window="" def quikSpace(): global window window.destroy() qs.quikspace() def ADD_Task_School_Work(): global window wind...
math12345678/QuikSpace
School_Work.py
School_Work.py
py
2,133
python
en
code
0
github-code
36
[ { "api_name": "QuikSpace.quikspace", "line_number": 13, "usage_type": "call" }, { "api_name": "Add_Task_School_Work.add_task_school_work", "line_number": 18, "usage_type": "call" }, { "api_name": "Review_Task_School_Work.review_task_school_work", "line_number": 23, "usage...
1379120770
import os import cv2 import dlib import numpy as np from eye import Eye from calibration import Calibration class EyeTracking(object): """ This class tracks the user's gaze. It provides useful information like the position of the eyes and pupils and allows to know if the eyes are open or closed ""...
dead4s/SpaHeron_MachineLearning_UXIS
eye_tracking/eye_tracking.py
eye_tracking.py
py
9,108
python
en
code
3
github-code
36
[ { "api_name": "calibration.Calibration", "line_number": 18, "usage_type": "call" }, { "api_name": "dlib.get_frontal_face_detector", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 32, "usage_type": "call" }, { "api_name":...
35411324967
from requests import get from webapp.db import db from webapp.question_service.models import Question_answer def get_question_jservice(questions_quantity: int=1) -> dict: """ После получения колличества запрашиваемых вопросов сервис, в свою очередь, запрашивает с публичного API (англоязычные во...
Straigan/webapp_question_service
webapp/services/jservice_service.py
jservice_service.py
py
2,084
python
ru
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "webapp.question_service.models.Question_answer", "line_number": 23, "usage_type": "call" }, { "api_name": "webapp.db.db.session.add", "line_number": 29, "usage_type": "call" }, { ...
34141163457
from flask_restful import Resource from pymongo import MongoClient from api.starta_flode import MONGODB_CONNECTION from statistics import median class Statistik(Resource): def getFlodeStatistics(self, subjects, flode=None): allData = [r for r in subjects.find(flode and {'flode': flode} or {})] tid...
svanis71/fkhack-back
api/statistik.py
statistik.py
py
1,059
python
en
code
0
github-code
36
[ { "api_name": "flask_restful.Resource", "line_number": 7, "usage_type": "name" }, { "api_name": "statistics.median", "line_number": 14, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 23, "usage_type": "call" }, { "api_name": "api.start...
8648504297
from django.shortcuts import render, HttpResponse from .forms import UserForm from sms_alert.models import User def index(request): if request.method == 'POST': name = request.POST.get('name') phone_number = request.POST.get('phone_number') country = request.POST.get('country') ...
prajjwalsinghzz14/Amnesia--Twilio-Notifiactions
Amnesia/sms_alert/views.py
views.py
py
2,300
python
en
code
0
github-code
36
[ { "api_name": "forms.UserForm", "line_number": 11, "usage_type": "call" }, { "api_name": "sms_alert.models.User", "line_number": 16, "usage_type": "call" }, { "api_name": "django.shortcuts.HttpResponse", "line_number": 23, "usage_type": "call" }, { "api_name": "fo...
29290165497
import glob import os import subprocess import tempfile rescompilerPath = 'build-desktop/bin/rescompiler.exe' containerPath = 'data/build/game.dat' excludeFiles = glob.glob('data/build/**/*', recursive=True) + glob.glob('data/sources/**/*', recursive=True) dataFiles = [os.path.abspath(f) for f in glob.glob('data/**/*...
Valax321/GAWFramework
rescompile.py
rescompile.py
py
777
python
en
code
0
github-code
36
[ { "api_name": "glob.glob", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "glob.glob", "line_number": ...
37272086828
# https://blog.csdn.net/qq_32149483/article/details/112056845 import imgaug as ia from imgaug import augmenters as iaa import numpy as np from typing import Tuple, List class Img_Aug: def __init__(self, prob=0.2, crop=True, blur=True, superpixel=True, space_trans=True, sharpen=True, embo...
SuperbTUM/machine-learning-practice
Text Recognition/data_aug.py
data_aug.py
py
3,722
python
en
code
0
github-code
36
[ { "api_name": "imgaug.augmenters.Affine", "line_number": 24, "usage_type": "call" }, { "api_name": "imgaug.augmenters", "line_number": 24, "usage_type": "name" }, { "api_name": "imgaug.augmenters.Crop", "line_number": 28, "usage_type": "call" }, { "api_name": "img...
29024831808
from src.algo import rpq from src import Config from tests.simple_test import simple_test import json import pytest import os import random MAIN_TEST_DIR = \ os.path.join(os.path.dirname(os.path.abspath(__file__)), 'tests') TEST_DIRS = list(map( lambda dir_name: os.path.join(MAIN_TEST_DIR, dir_name), ...
SergeyKuz1001/formal_languages_autumn_2020
tests/rpq/test.py
test.py
py
2,155
python
en
code
0
github-code
36
[ { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.abspath", "line...