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
19124700343
import logging import sys import shutil import click import subprocess import platform import re import os import errno import time import ast import math from anime_downloader import session from anime_downloader.sites import get_anime_class from anime_downloader.const import desktop_headers def check_in_path(app): ...
PradipH31/anime-downloader
anime_downloader/util.py
util.py
py
6,601
python
en
code
null
github-code
1
[ { "api_name": "shutil.which", "line_number": 24, "usage_type": "call" }, { "api_name": "click.style", "line_number": 30, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 32, "usage_type": "call" }, { "api_name": "logging.getLevelName", ...
42127689269
#!/usr/bin/env python3 from pathlib import Path, PurePath from nltk.corpus import wordnet as wn import os import common as cm used_language = 'all' # Analyze word classes, takes a list of words, returns a list of word classes: def printWordClasses(wordlist): for word in wordlist: line = word + ', ' ...
JKAbrams/SeedphrasePictogram
dictionary_table_maker.py
dictionary_table_maker.py
py
3,784
python
en
code
0
github-code
1
[ { "api_name": "nltk.corpus.wordnet.synsets", "line_number": 14, "usage_type": "call" }, { "api_name": "nltk.corpus.wordnet", "line_number": 14, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path"...
24631100750
import joblib from pickle import load import pandas as pd import numpy as np from sklearn.preprocessing import StandardScaler from sklearn.model_selection import train_test_split from sklearn.metrics import mean_absolute_error,r2_score,accuracy_score from preprocessing import for_evaluate from preprocessing import s...
pannawit2541/Forex-Trend-Prediction
Project/API/Evaluate_model.py
Evaluate_model.py
py
4,043
python
en
code
0
github-code
1
[ { "api_name": "numpy.convolve", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 22, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.polyfit", "line_...
12095789614
# -*- coding: utf-8 -*- import logging import pickle from pathlib import Path import matplotlib.pyplot as plt import optuna import torch from torch import nn, optim from torchvision import datasets, transforms from src.models.classifier import Classifier def train_model( data_filepath, trained_model_filepat...
ThordurPall/MLOpsExercises
src/models/train_model.py
train_model.py
py
7,265
python
en
code
0
github-code
1
[ { "api_name": "logging.basicConfig", "line_number": 31, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 31, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 32, "usage_type": "call" }, { "api_name": "src.models.cl...
70987912033
from flask import Flask, render_template from flask import jsonify, request from flask import Blueprint, abort from flask_mysqldb import MySQL from flask_cors import CORS from ..Config import Config as cfg from ..run import db kriteria = Blueprint('kriteria',__name__) # READ @kriteria.route('/kriteria', methods=['GET...
soyidwahyud/Proyek_3
Backend/objectClass/Kriteria/Kriteria.py
Kriteria.py
py
3,114
python
en
code
1
github-code
1
[ { "api_name": "flask.Blueprint", "line_number": 9, "usage_type": "call" }, { "api_name": "run.db.connection.cursor", "line_number": 14, "usage_type": "call" }, { "api_name": "run.db.connection", "line_number": 14, "usage_type": "attribute" }, { "api_name": "run.db...
18798952098
from gi.repository import Gtk, Gdk, Gedit from . import log try: debug_plugin_message = Gedit.debug_plugin_message except: # before gedit 3.4 debug_plugin_message = lambda fmt, *fmt_args: None CONTROL_MASK = Gdk.ModifierType.CONTROL_MASK CONTROL_SHIFT_MASK = Gdk.ModifierType.CONTROL_MASK | Gdk.ModifierType.SHIFT_...
jefferyto/gedit-control-your-tabs
controlyourtabs/keyinfo.py
keyinfo.py
py
2,285
python
en
code
91
github-code
1
[ { "api_name": "gi.repository.Gedit.debug_plugin_message", "line_number": 5, "usage_type": "attribute" }, { "api_name": "gi.repository.Gedit", "line_number": 5, "usage_type": "name" }, { "api_name": "gi.repository.Gdk.ModifierType", "line_number": 10, "usage_type": "attrib...
37429972971
''' This file contains functions and classes related to importing corpora into a script. ''' import os, re, sys from pavdhutils.cleaning import clean, toremove from pavdhutils.tokenize import Tokenize from sklearn.feature_extraction.text import TfidfVectorizer class Corpus: ''' This takes the path to a corpus fol...
vierth/pavut
pavdhutils/corpus.py
corpus.py
py
9,049
python
en
code
0
github-code
1
[ { "api_name": "pavdhutils.cleaning.toremove", "line_number": 18, "usage_type": "name" }, { "api_name": "os.walk", "line_number": 47, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 53, "usage_type": "call" }, { "api_name": "os.path", "line...
2032287182
import datetime import matplotlib.pyplot as plt import re import requests from urllib.request import urlopen from django.conf import settings as conf_settings from django.contrib.auth.decorators import login_required from django.shortcuts import render from django.templatetags.static import static from .forms import ...
zacniewski/weather-manager
weather/views.py
views.py
py
9,866
python
en
code
0
github-code
1
[ { "api_name": "django.conf.settings.WEATHER_API_KEY", "line_number": 15, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 15, "usage_type": "name" }, { "api_name": "django.conf.settings.DEFAULT_LOCATION", "line_number": 16, "usage_type": "...
17020636318
# In[ ]: discord_token = 'tokenhere' #@param {type:"string"} # ##Module installation # this will install all the necessary modules # In[ ]: # ##Download and load GPT NEO model. # It will take a little bit # In[3]: from transformers import GPTNeoForCausalLM, GPT2Tokenizer model = GPTNeoForCausalLM.from_pre...
graylan0/gpt5-ptt
gpt5discordloop.py
gpt5discordloop.py
py
3,939
python
en
code
4
github-code
1
[ { "api_name": "transformers.GPTNeoForCausalLM.from_pretrained", "line_number": 24, "usage_type": "call" }, { "api_name": "transformers.GPTNeoForCausalLM", "line_number": 24, "usage_type": "name" }, { "api_name": "transformers.GPT2Tokenizer.from_pretrained", "line_number": 25,...
6690963513
import re from django.db.models import Q from django.utils.text import smart_split from django.views.generic import ListView from home.models import Noticia from utils.mixinscomuns import ComunsNoticiasMixin class NoticiaListView(ComunsNoticiasMixin, ListView): model = Noticia template_name = "noticias/notic...
GustavoCruz12/educacao
src/noticias/views.py
views.py
py
1,638
python
en
code
0
github-code
1
[ { "api_name": "utils.mixinscomuns.ComunsNoticiasMixin", "line_number": 10, "usage_type": "name" }, { "api_name": "django.views.generic.ListView", "line_number": 10, "usage_type": "name" }, { "api_name": "home.models.Noticia", "line_number": 11, "usage_type": "name" }, ...
75172920353
import os import tensorflow as tf import dataset import numpy as np import matplotlib.pyplot as plt import math import yaml from django.conf import settings base_dir = os.path.dirname(__file__) root_dir = settings.CLASSIFIED_SETTING['app']['root'] import scipy.misc def visual_network(modelConfig,network): # load c...
yaakov300/finalProjectDeepLearning
src/classified/visualising_network.py
visualising_network.py
py
3,656
python
en
code
0
github-code
1
[ { "api_name": "os.path.dirname", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.conf.settings.CLASSIFIED_SETTING", "line_number": 10, "usage_type": "attribute" }, { "api_name"...
42245890561
from config import PMUS_SHEET from shared import clean_value, get_data, dump_data def model_pmu(row): # Transform a row into PMU object # according to the schema in /schemas/pmu.json # Make sure update /schemas/pmu.json while changing here return { "state": clean_value(row[0]), "name"...
coronasafe/10bedicu
scraper/src/pmu.py
pmu.py
py
680
python
en
code
4
github-code
1
[ { "api_name": "shared.clean_value", "line_number": 11, "usage_type": "call" }, { "api_name": "shared.clean_value", "line_number": 12, "usage_type": "call" }, { "api_name": "shared.clean_value", "line_number": 13, "usage_type": "call" }, { "api_name": "shared.clean...
43766192577
# mysql数据操作模块 from functools import wraps import logging import pymysql import time logging.basicConfig(level=logging.INFO, # format='%(asctime)s %(filename)s[line:%(lineno)d] %(levelname)s %(message)s', #返回值:Thu, 26 May 2016 15:09:31 t11.py[line:92] INFO format='[%...
Kewei-Lu/Scrapy_Project
Include/BUFF/BUFF/mysql_processor.py
mysql_processor.py
py
4,154
python
en
code
0
github-code
1
[ { "api_name": "logging.basicConfig", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 9, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "time.strftime",...
29182363036
# 预处理Node Extraction数据,生成字粒度标注序列 # 可配置生成: 有类别(E/V/T/VT) / 无类别(仅BIO) 的标签序列 import json import sys sys.path.append('../') from transformers import DebertaV2Tokenizer, RobertaTokenizer from tqdm import tqdm from annotation.preprocess import parse_sparql from QG.util import qg_tag2id # tokenizer标志空格的标志 TOKENIZER_START_...
AOZMH/Crake
src_main/NE/prepare_ne_data.py
prepare_ne_data.py
py
13,893
python
en
code
8
github-code
1
[ { "api_name": "sys.path.append", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 45, "usage_type": "call" }, { "api_name": "QG.util.qg_tag2id", "line_n...
8715524858
import pygame from random import randint, random pygame.init() pygame.mixer.init() pygame.mixer.music.load("Stuff/Music/music.ogg") pygame.mixer.music.play(-1) pygame.mixer.music.set_volume(0.5) #create screen screen = pygame.display.set_mode((1000, 800)) pygame.display.set_caption('Flappy by Motus') timer = pygame.t...
Motusdevop/Flappy
main.py
main.py
py
3,634
python
en
code
0
github-code
1
[ { "api_name": "pygame.init", "line_number": 3, "usage_type": "call" }, { "api_name": "pygame.mixer.init", "line_number": 4, "usage_type": "call" }, { "api_name": "pygame.mixer", "line_number": 4, "usage_type": "attribute" }, { "api_name": "pygame.mixer.music.load"...
31056606907
import logging import numpy as np from scipy.signal import hilbert from copy import deepcopy Logger = logging.getLogger(__name__) def linstack(streams, normalize=True): """ Compute the linear stack of a series of seismic streams of \ multiplexed data. :type streams: list :param streams: List o...
eqcorrscan/EQcorrscan
eqcorrscan/utils/stacking.py
stacking.py
py
5,526
python
en
code
155
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.argmax", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.mean", "line_numbe...
43200698161
import pandas as pd from .common_utils import json_to_dataframe from datetime import datetime import os import requests import cv2 import numpy as np import pydicom from pydicom.filereader import dcmread from pydicom.dataset import Dataset, FileMetaDataset from pydicom.pixel_data_handlers.numpy_handler import pack_bit...
mdai/mdai-client-py
mdai/utils/dicom_utils.py
dicom_utils.py
py
53,457
python
en
code
24
github-code
1
[ { "api_name": "warnings.filterwarnings", "line_number": 16, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 67, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 70, "usage_type": "call" }, { "api_name": "requests.get", ...
622199866
import torch.nn.functional as F import torch import numpy as np def to_crop_resize(img, bbox, landm, resize=128): buff = torch.zeros(img.size(0), img.size(1), resize, resize) landm_buff = torch.zeros_like(landm) for i, (box, mark) in enumerate(zip(bbox, landm)): # image cropping and resizing ...
blacknwhite5/privacy-preserving-v2
utils.py
utils.py
py
4,092
python
en
code
0
github-code
1
[ { "api_name": "torch.zeros", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.zeros_like", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.nn.functional.interpolate", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.nn.f...
30277322074
from __future__ import absolute_import from __future__ import print_function import os from collections import namedtuple, MutableMapping from copy import deepcopy, copy from itertools import ifilter import logging import pyros_utils import rospy import rosservice, rostopic, rosparam import re import ast import sock...
pyros-dev/pyros-rosinterface
pyros_interfaces_ros/ros_interface.py
ros_interface.py
py
25,186
python
en
code
1
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 23, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 42, "usage_type": "call" }, { "api_name": "baseinterface.BaseInterface", "line_number": 45, "usage_type": "name" }, { "api_name": "...
32310929702
import networkx as nx import matplotlib.pyplot as plt import random import itertools def get_signs_of_tris(triangle_list,G): #triangle_list=[[1,2,3][4,5,6][7,8,9]] #all_signs=[[1,2->'+',2,3->'-',1,3->'-'][][]] all_signs=[] for i in range(len(triangle_list)): temp=[] temp.append(G[ triangle_list[i][0]] [triangl...
harsimarsingh/iitroparProjects
BalancedTrianglesInGraph.py
BalancedTrianglesInGraph.py
py
5,608
python
en
code
0
github-code
1
[ { "api_name": "random.randint", "line_number": 35, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 41, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 71, "usage_type": "call" }, { "api_name": "networkx.Graph", "lin...
74767959713
#Importando Librerias import re import tkinter as tk from tkinter import messagebox from ply import lex, yacc from subprocess import call #Definir los tokens tokens = ( 'WHILE', 'SYSTEM', 'OUT', 'INT', 'ID', 'NUM', 'STRING', 'PLUS', 'SEMICOLON', 'LPAREN', ...
Marc-Zun/Compiladores
SUB4/Act. 4.1 Proyecto Final Analizadores/Proyecto Final Compiladores/sintactico.py
sintactico.py
py
5,654
python
es
code
0
github-code
1
[ { "api_name": "ply.lex.lex", "line_number": 79, "usage_type": "call" }, { "api_name": "ply.lex", "line_number": 79, "usage_type": "name" }, { "api_name": "ply.yacc.yacc", "line_number": 101, "usage_type": "call" }, { "api_name": "ply.yacc", "line_number": 101,...
13430338873
# Photo.py import io import os from enum import Enum, unique import hashlib from typing import List from datetime import datetime import base64 from mongoengine import ( Document, IntField, FloatField, StringField, ListField, ReferenceField, BooleanField, ImageField, DateTimeField, ...
ydethe/photomanagement
PhotoManagement/Photo.py
Photo.py
py
13,214
python
en
code
0
github-code
1
[ { "api_name": "PIL.Image.open", "line_number": 48, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 48, "usage_type": "name" }, { "api_name": "os.path.split", "line_number": 50, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5...
14089824645
from http import HTTPStatus class CouldNotLoginGnocchi(Exception): def __init__(self, id=None, secret=None): self.status_code = HTTPStatus.UNAUTHORIZED if id and secret: self.message = f'Could not login on OpenStack"' else: self.message = 'Could not get authenticatio...
OrwellMonitoring/orwell-middleware
middleware/app/gnocchi/gnocchi_exceptions.py
gnocchi_exceptions.py
py
434
python
en
code
0
github-code
1
[ { "api_name": "http.HTTPStatus.UNAUTHORIZED", "line_number": 5, "usage_type": "attribute" }, { "api_name": "http.HTTPStatus", "line_number": 5, "usage_type": "name" } ]
20791526735
from PyQt5.QtCore import Qt, QTimer, QTime from PyQt5.QtGui import QFont from PyQt5.QtWidgets import (QWidget, QApplication, QLabel, QPushButton, QLineEdit, QHBoxLayout, QHBoxLayout) from instr import * from final_win import * class Experiment(): ...
dannilkiba606/test
second_win.py
second_win.py
py
6,240
python
en
code
0
github-code
1
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 16, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QPushButton", "line_number": 27, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QPushButton", "line_number": 28, "usage_type": "call" }, { "a...
18323454254
import copy import logging import numpy as np import torch from d2go.data.dataset_mappers import ( D2GoDatasetMapper, D2GO_DATA_MAPPER_REGISTRY, ) from d2go.data.dataset_mappers.d2go_dataset_mapper import ( PREFETCHED_SEM_SEG_FILE_NAME, read_image_with_prefetch, ) from detectron2.data import detection_...
facebookresearch/sylph-few-shot-detection
sylph/data/dataset_mapper/meta_learn_dataset_mapper.py
meta_learn_dataset_mapper.py
py
10,913
python
en
code
54
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 24, "usage_type": "call" }, { "api_name": "d2go.data.dataset_mappers.D2GoDatasetMapper", "line_number": 28, "usage_type": "name" }, { "api_name": "copy.deepcopy", "line_number": 63, "usage_type": "call" }, { "api_n...
3178055024
# coding=utf-8 import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt import argparse import numpy as np from keras.models import Sequential from keras.layers import Conv2D, MaxPooling2D, UpSampling2D, BatchNormalization, Reshape, Permute, Activation, Input from keras.utils.np_utils import to_categori...
scrssys/semantic_segment_RSImage
temp/unet_train_binary.py
unet_train_binary.py
py
11,213
python
en
code
49
github-code
1
[ { "api_name": "matplotlib.use", "line_number": 4, "usage_type": "call" }, { "api_name": "keras.backend.set_image_dim_ordering", "line_number": 29, "usage_type": "call" }, { "api_name": "keras.backend", "line_number": 29, "usage_type": "name" }, { "api_name": "os.e...
14593750596
from django.shortcuts import render, get_object_or_404, redirect from django.contrib.auth.decorators import login_required from .models import Post, Comment from .forms import PostForm, CommentForm from authuser.models import USER_GROUPS from news_posts.models import POST_STATUSES # Create your views here. def post_...
Pragmatique/simple-news-site
simple_news_site/news_posts/views.py
views.py
py
1,895
python
en
code
0
github-code
1
[ { "api_name": "models.Post.published.all", "line_number": 12, "usage_type": "call" }, { "api_name": "models.Post.published", "line_number": 12, "usage_type": "attribute" }, { "api_name": "models.Post", "line_number": 12, "usage_type": "name" }, { "api_name": "djan...
7137304548
import pymc3 as pm import numpy as np import arviz as az import matplotlib.pyplot as plt x_size = 100 global x1,x2 x1 = np.random.randn(x_size) x2 = np.random.randn(x_size) def sim_model(a,b): #x_size = 10000 #x1 = np.random.randn(x_size) #x2 = np.random.randn(x_size) return x1*a + x2*b +3 ...
HITwanghaitao/bayes_test_model
test1.py
test1.py
py
783
python
en
code
0
github-code
1
[ { "api_name": "numpy.random.randn", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 7, "usage_type": "attribute" }, { "api_name": "numpy.random.randn", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.random", ...
70809880354
import json import sys, os import requests import urllib, urllib3 import time import threading import cv2 import kivy import cognitive_face as CF import numpy as np from kivy.app import App from kivy.cache import Cache from kivy.clock import Clock, mainthread from kivy.graphics import * from kivy.uix....
lukazd/DistributedAdvertisingBoard
rpi_software/IOT_Project/main.py
main.py
py
11,984
python
en
code
3
github-code
1
[ { "api_name": "urllib3.disable_warnings", "line_number": 29, "usage_type": "call" }, { "api_name": "kivy.require", "line_number": 30, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 35, "usage_type": "attribute" }, { "api_name": "cognitive_face....
38458045168
import requests from datetime import datetime import os APP_ID = os.environ["NT_APP_ID"] API_KEY = os.environ["NT_API_KEY"] headers = { "x-app-id": APP_ID, "x-app-key": API_KEY, "x-remote-user-id": "0" } exersise_param = { "query": input("Enter your Query: ") } exersise_endpoint = "https://trackapi....
Scienceloop/Workout_Tracking_Google_sheet
main.py
main.py
py
1,118
python
en
code
0
github-code
1
[ { "api_name": "os.environ", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 19, "usage_type": "attribute" }, { "api_name": "requests.post", "li...
14897569954
from creating_bot import bot, dp from aiogram import types, Dispatcher from aiogram.filters.command import Command from aiogram import md, F from aiogram.filters import Text from datetime import datetime @dp.message(Command('food')) async def button_creation(message: types.Message): # тут мы типа создали заготовки...
Markizoid/tg-bot-training
handlers/other.py
other.py
py
2,585
python
ru
code
0
github-code
1
[ { "api_name": "aiogram.types.Message", "line_number": 9, "usage_type": "attribute" }, { "api_name": "aiogram.types", "line_number": 9, "usage_type": "name" }, { "api_name": "aiogram.types.KeyboardButton", "line_number": 12, "usage_type": "call" }, { "api_name": "a...
17362831035
import os import pytest from hamcrest import * from .postgres import Postgres from .seeds import * release = 'sql/release/201901XX_solr_view/registry/namex/' migration = 'create.sql' def sut(): content = open(release + migration).read() target = content[content.find('@') + 1:] return open(release + targe...
bcgov/namex
nro-legacy/tests/test_solr_corp_vw.py
test_solr_corp_vw.py
py
3,931
python
en
code
6
github-code
1
[ { "api_name": "os.getenv", "line_number": 28, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 29, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 30, "usage_type": "call" }, { "api_name": "postgres.Postgres", "line_number": ...
42927270425
import requests url = "https://0a4f008504c83dafc07450e9003f007b.web-security-academy.net/my-account/change-email" data = { "email": "test@test2.com" } cookies = { "session": "ZVCrXoUWWZoIUkHRUsB8uxaA2ebMb7nr" } r = requests.post(url, data=data, cookies=cookies) print(r.text)
singha-brother/Web_Security_Notes
Portswigger/Labs_test_with_python/CSRF/lab01.py
lab01.py
py
282
python
en
code
1
github-code
1
[ { "api_name": "requests.post", "line_number": 13, "usage_type": "call" } ]
16823262942
import py_trees class GlobalBlackboard: _instance = None @staticmethod def get_instance(): if GlobalBlackboard._instance is None: GlobalBlackboard._instance = py_trees.blackboard.Client(name="Global") return GlobalBlackboard._instance def get_port_content(port_v...
JdeRobot/bt-studio
backend/tree_gardener/tree_gardener/tree_tools.py
tree_tools.py
py
1,286
python
en
code
21
github-code
1
[ { "api_name": "py_trees.blackboard.Client", "line_number": 11, "usage_type": "call" }, { "api_name": "py_trees.blackboard", "line_number": 11, "usage_type": "attribute" }, { "api_name": "py_trees.common", "line_number": 38, "usage_type": "attribute" } ]
17460026299
from . import views from django.urls import path """ Url paths extended from from django.urls """ app_name = 'products' urlpatterns = [ path('products/', views.product_list_view, name='products'), path('products/<int:id>/', views.product_get_view), ]
sgs22/needapc
products/urls.py
urls.py
py
269
python
en
code
0
github-code
1
[ { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" } ]
22584360544
darrc_template = """ --min-digits={settings.digits} --slice {settings.slice_size_KiB:0.0f}K # make crypto block size larger to reduce # likelihood of duplicate ciphertext --crypto-block 131072 # DO NOT specify the AES key here: this script is burned on every # backup disc, in the clear --key aes: # don't back up cache...
jaredjennings/darbrrb
darbrrb.py
darbrrb.py
py
64,180
python
en
code
9
github-code
1
[ { "api_name": "sys.argv", "line_number": 207, "usage_type": "attribute" }, { "api_name": "sys.stderr", "line_number": 208, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 213, "usage_type": "call" }, { "api_name": "os.chdir", "line_numbe...
25209477746
# import smbus import math import time import keyboard import os import json import matplotlib import random matplotlib.use("AGG") import matplotlib.pyplot as plt # from scipy.fftpack import fft # from pymongo import MongoClient # client = MongoClient('localhost', 27017) # db = client.test_database from pynput imp...
MPiorunn/Master-Thesis
Master/Raspberry/words.py
words.py
py
4,154
python
en
code
0
github-code
1
[ { "api_name": "matplotlib.use", "line_number": 10, "usage_type": "call" }, { "api_name": "pynput.keyboard.Listener", "line_number": 38, "usage_type": "call" }, { "api_name": "pynput.keyboard", "line_number": 38, "usage_type": "name" }, { "api_name": "math.sqrt", ...
31290217365
from filecmp import dircmp import os import argparse import easygui import pandas as pd from pathlib import Path import sys from PyQt5.QtWidgets import (QFileDialog, QAbstractItemView, QListView, QTreeView, QApplication, QDialog) def convert_bytes(num): #this function will convert byt...
thiloschild/FSDC
tests/dir_diff.py
dir_diff.py
py
1,769
python
en
code
0
github-code
1
[ { "api_name": "os.path.isfile", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.stat", "line_number": 22, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_numb...
70765234275
from PySide2 import QtWidgets, QtGui, QtCore from PySide2.QtWidgets import * from PySide2.QtCore import * from PySide2.QtGui import * import sys import os from data import * from Common_Object_def import Network bus = {} class Ui_Export_PT(object): def setupUi(self, Export_PT): bus["Export_PT"] = Export_...
farzad1132/NetPlanner
ExportPhysicalTopology.py
ExportPhysicalTopology.py
py
6,187
python
en
code
2
github-code
1
[ { "api_name": "PySide2.QtWidgets.QGridLayout", "line_number": 19, "usage_type": "call" }, { "api_name": "PySide2.QtWidgets", "line_number": 19, "usage_type": "name" }, { "api_name": "PySide2.QtWidgets.QPushButton", "line_number": 21, "usage_type": "call" }, { "api...
24653739965
import tkinter as tk from tkinter import font from PIL import Image, ImageTk from logic import * def app_gui(title, width, height): root = tk.Tk() app_theme = "default" #app_theme = pick_theme() ui_config_lst = theme_config(app_theme) global ui_config_dict ui_config_dict = { "text_colou...
HashBukhtiar/CubeTimer
gui.py
gui.py
py
5,523
python
en
code
0
github-code
1
[ { "api_name": "tkinter.Tk", "line_number": 7, "usage_type": "call" }, { "api_name": "tkinter.font.Font", "line_number": 31, "usage_type": "call" }, { "api_name": "tkinter.font", "line_number": 31, "usage_type": "name" }, { "api_name": "tkinter.font.Font", "lin...
41978066268
#开发人员 :Hongjian SU #开发时间 :4/19/2019 #开发工具 :PyCharm import datetime a = "Ericsson" b = "Hongjian SU" c = input("Note: ") c = "Note: " + c d = datetime.datetime.now() fp = open(r'Test_internal.txt', 'a+') print(a, b, "\n", c, "\n", d, file=fp) print(chr(38)) fp.close() ''' 就是 添加点 备注 '''
SUHONGJIAN/leisure-time
Python learning/Pycharm_project/Third.py
Third.py
py
339
python
en
code
0
github-code
1
[ { "api_name": "datetime.datetime.now", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 11, "usage_type": "attribute" } ]
22942125072
import json import logging import multiprocessing import os from typing import Any, Dict, Optional, Union import lib.infers import lib.trainers from monai.networks.nets import BasicUNet from monailabel.interfaces.config import TaskConfig from monailabel.interfaces.tasks.infer_v2 import InferTask from monailabel.inter...
Project-MONAI/MONAILabel
sample-apps/pathology/lib/configs/segmentation_nuclei.py
segmentation_nuclei.py
py
3,756
python
en
code
472
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "monailabel.interfaces.config.TaskConfig", "line_number": 19, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 20, "usage_type": "name" }, { "api_name": ...
40653074312
import os import sys #import matplotlib.pyplot as plt import numpy as np #import scipy.stats as stats import xlwt import subprocess import pathlib import pandas as pd import time from random import randint from vehicleClass import Vehicle from openSpaceClass import OpenSpace from oneLaneClass import oneLaneObject from ...
alexlssc/ProjectDegree
Code/main.py
main.py
py
3,670
python
en
code
0
github-code
1
[ { "api_name": "os.environ", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.environ", "line_numb...
38129824817
from flask import Flask,jsonify, Blueprint, render_template from sys import version import numpy import matplotlib.pyplot as plt from io import BytesIO import base64 from flask_login import login_required import os from pathogen_memo.controllers import countbyquery #Set word_count_site_name barplotbv = Blueprint('ba...
NajlaBioinfo/pathogen_memo_app
pathogen_memo/views/barplotb.py
barplotb.py
py
1,590
python
en
code
0
github-code
1
[ { "api_name": "flask.Blueprint", "line_number": 13, "usage_type": "call" }, { "api_name": "pathogen_memo.controllers.countbyquery.get_query_count", "line_number": 18, "usage_type": "call" }, { "api_name": "pathogen_memo.controllers.countbyquery", "line_number": 18, "usage...
43753328895
#!/usr/bin/env python3 # coding=utf-8 import rospy from math import * from sensor_msgs.msg import Image import cv2, cv_bridge import numpy as np from geometry_msgs.msg import Twist from yolo_new.msg import position_color as PositionMsg from yolo_new.msg import color_ik_result_new as color_ik_result_Msg from std_msgs.m...
Anxy02/Refuse-Classification-Machine
src/yolo_new/scripts/serialCom.py
serialCom.py
py
4,737
python
en
code
1
github-code
1
[ { "api_name": "serial.Serial", "line_number": 19, "usage_type": "call" }, { "api_name": "rospy.Subscriber", "line_number": 24, "usage_type": "call" }, { "api_name": "yolo_new.msg.Serial_RT", "line_number": 24, "usage_type": "argument" }, { "api_name": "rospy.Publi...
73501732514
""" Author: Brian Mascitello Date: 12/5/2017 Websites: http://adventofcode.com/2015/day/12 Info: --- Day 12: JSAbacusFramework.io --- --- Part Two --- """ import json data = json.load(open('Day12Q1 2015 Input.txt')) def calculate_sum(input_data): summation = 0 if not isinstance...
Brian-Mascitello/Advent-of-Code
Advent of Code 2015/Day 12 2015/Day12Q2 2015.py
Day12Q2 2015.py
py
833
python
en
code
0
github-code
1
[ { "api_name": "json.load", "line_number": 11, "usage_type": "call" } ]
37376977207
import json import subprocess import time import argparse import datetime def main(a): if not a.json: return data = json.load(open(a.json)) data = sorted(data, key=lambda x: x["score"] / x["g_cost"]) for result in data: print("{seed}:".format(seed=result["seed"])) print("S = {S...
kenkoooo/WanderingTheCity
python/analysis.py
analysis.py
py
1,114
python
en
code
0
github-code
1
[ { "api_name": "json.load", "line_number": 11, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 23, "usage_type": "call" } ]
1602438456
import pymysql db=pymysql.connect('localhost','root','123456','java1') cur=db.cursor() sql='SELECT * FROM node' try: cur.execute(sql) res=cur.fetchall() for i in res: number=i[0] xcoord=i[1] ycoord=i[2] print('number=%d xcoord=%d ycoord=%d'%(number,xcoord,ycoord)) except : ...
Lousm/Python
访问数据库/01.py
01.py
py
357
python
en
code
0
github-code
1
[ { "api_name": "pymysql.connect", "line_number": 3, "usage_type": "call" } ]
416318020
import csv import os from users_api.models import WdaeUser from django.core.management.base import BaseCommand, CommandError from .import_base import ImportUsersBase class Command(ImportUsersBase, BaseCommand): help = ( "Delete all users and adds new ones from csv. " "Required column names for the...
iossifovlab/gpf
wdae/wdae/users_api/management/commands/users_restore.py
users_restore.py
py
1,232
python
en
code
1
github-code
1
[ { "api_name": "import_base.ImportUsersBase", "line_number": 8, "usage_type": "name" }, { "api_name": "django.core.management.base.BaseCommand", "line_number": 8, "usage_type": "name" }, { "api_name": "os.path.exists", "line_number": 20, "usage_type": "call" }, { "...
538086250
#!/usr/bin/env python """Time tracking Usage: timetracking -p PROJECTNAME [-c] start timetracking [-p PROJECTNAME] end timetracking [-a] list timetracking report timetracking add timetracking -h Options: -p PROJECTNAME --project=PROJECTNAME project name -c --continue also cont...
teroyks/timetracking
timetracking.py
timetracking.py
py
2,164
python
en
code
0
github-code
1
[ { "api_name": "docopt.docopt", "line_number": 36, "usage_type": "call" }, { "api_name": "tracker.currently_tracked_projects", "line_number": 46, "usage_type": "call" }, { "api_name": "projects.names", "line_number": 48, "usage_type": "call" }, { "api_name": "track...
75004236192
from collections import OrderedDict from scipy.integrate import odeint from abstract_model import ModelABC import numpy as np class OdeModel(ModelABC): """Differential-based Models integrated with SciPy LSODA wrapper Attributes ---------- model : func (x0, t, xout, p) A callable function that...
FedericoV/SysBio_Modeling
model/ode_model.py
ode_model.py
py
6,931
python
en
code
2
github-code
1
[ { "api_name": "abstract_model.ModelABC", "line_number": 7, "usage_type": "name" }, { "api_name": "numba.jit", "line_number": 50, "usage_type": "call" }, { "api_name": "numba.jit", "line_number": 51, "usage_type": "call" }, { "api_name": "numba.jit", "line_numb...
73798956195
# -*- coding:utf-8 -*- import sys, pickle, os, random import numpy as np import io ## tags, BIO pre_tag2label = {"O": 0, "B-PER": 1, "I-PER": 2, "B-LOC": 3, "I-LOC": 4, "B-ORG": 5, "I-ORG": 6 } tag2label = {u'0': 0,u'1': 1} def read_corpus(corpus_path): """ ...
auas/granduate-project_auas
zh-NER-TF-master/data.py
data.py
py
5,594
python
en
code
2
github-code
1
[ { "api_name": "io.open", "line_number": 22, "usage_type": "call" }, { "api_name": "io.open", "line_number": 45, "usage_type": "call" }, { "api_name": "io.open", "line_number": 118, "usage_type": "call" }, { "api_name": "pickle.dump", "line_number": 119, "u...
4906137841
# coding: utf-8 import sys import torch import time import pickle import pandas as pd from gensim import corpora, models, similarities from sklearn.metrics import accuracy_score, recall_score, precision_score, f1_score def test_on(model, data_dl, output_path=None, checkpoint_path=None): print("loading model from {...
JinYang88/sentence-matching
utils/evaluator.py
evaluator.py
py
1,060
python
en
code
1
github-code
1
[ { "api_name": "torch.load", "line_number": 12, "usage_type": "call" } ]
5278882979
import json import requests from bs4 import BeautifulSoup import sys import os import os.path import shutil try : # Tries to create a folder called images os.mkdir('images') except: # If the image folder already exists it deletes the folder and creates a new one to get rid of residual images print("Image Fold...
GongCode/SocialMediaPG
image_scraper.py
image_scraper.py
py
3,056
python
en
code
0
github-code
1
[ { "api_name": "os.mkdir", "line_number": 10, "usage_type": "call" }, { "api_name": "shutil.rmtree", "line_number": 14, "usage_type": "call" }, { "api_name": "os.mkdir", "line_number": 15, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 21,...
12048268158
import pytest from flask_sqlalchemy import SQLAlchemy from sqlalchemy import MetaData from sqlalchemy.orm import clear_mappers from app import create_app from repositories.sql_alchemy.mapping.user_mapping import user_mapping from repositories.sql_alchemy.mapping.favorite_document_mapping import favorite_docum...
gerbless/clean-architecture-example-project
repositories/tests/pytest_fixture_db.py
pytest_fixture_db.py
py
1,380
python
en
code
0
github-code
1
[ { "api_name": "pytest.fixture", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pytest.fixture", "line_number": 20, "usage_type": "call" }, { "api_name": "app.create_app", "line_number": 31, "usage_type": "call" }, { "api_name": "app.config", "l...
23149056100
#!/usr/bin/env python ############################################################################### # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License...
donovan-h-parks/DBB
dbb/expand.py
expand.py
py
3,614
python
en
code
1
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 28, "usage_type": "call" }, { "api_name": "greedy.readSeqStatsForBins", "line_number": 33, "usage_type": "call" }, { "api_name": "re.search", "line_number": 63, "usage_type": "call" }, { "api_name": "greedy.Greedy....
13412598410
import sqlite3 # open the connection to the database connection = sqlite3.connect("C:\\Users\\User\\HW2database1.db") cursor = connection.cursor() def create_tables(): """ Creates tables Provider and Canteen """ # sql command to create table Provider sql_command = """ CREATE TA...
TslEdv/Python-Advanced
HW2/main.py
main.py
py
5,484
python
en
code
0
github-code
1
[ { "api_name": "sqlite3.connect", "line_number": 5, "usage_type": "call" } ]
14099855837
from django.urls import path from admin import views from admin.views import * urlpatterns = [ path('',views.Counts,name='admindash'), path('login', views.Login.as_view(), name='login'), path('hospital', views.Hospital_details, name='hospital_details'), path('hospital_approval/<int:id>', views.Hospita...
Nasim004/Project-easyDoc-Backend
admin/urls.py
urls.py
py
899
python
en
code
0
github-code
1
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "admin.views.Counts", "line_number": 6, "usage_type": "attribute" }, { "api_name": "admin.views", "line_number": 6, "usage_type": "name" }, { "api_name": "django.urls.path", ...
69847575393
from elasticsearch import Elasticsearch import pandas as pd import json import csv def indexTMDB(filename): f = open(filename,"r", encoding="UTF8") reader = csv.DictReader(f) for i,row in enumerate(reader): if i == 4553: continue movie = { "budget" : float(row["budget"]), ...
didrikmunther/DD2477-group-11
backend/dataloader.py
dataloader.py
py
1,971
python
en
code
2
github-code
1
[ { "api_name": "csv.DictReader", "line_number": 8, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 13, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 14, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 1...
44436368496
import os, time import zmq import zmq_helper import json, joblib import ast import training, inference class Node: """A peer-to-peer node that can act as client or server at each round""" def __init__(self, context, node_id, peers): self.context = context self.node_id = node_id self.pe...
alkaluqman/p2pFLsim
Device/peer/peer.py
peer.py
py
4,887
python
en
code
3
github-code
1
[ { "api_name": "zmq_helper.act_as_server", "line_number": 26, "usage_type": "call" }, { "api_name": "zmq_helper.act_as_client", "line_number": 29, "usage_type": "call" }, { "api_name": "joblib.dump", "line_number": 43, "usage_type": "call" }, { "api_name": "joblib....
15534518918
import gym from gym import Wrapper from gym import spaces import d4rl import torch import numpy as np from src.config import conf class SkillWrapper(gym.Wrapper): """ gym wrapper that augment the state with random chosen skill index """ def __init__(self, env, n_skills, max_steps=1000, ev=False, sample_freq=...
FaisalAhmed0/SLUSD
src/environment_wrappers/env_wrappers.py
env_wrappers.py
py
11,212
python
en
code
3
github-code
1
[ { "api_name": "gym.Wrapper", "line_number": 11, "usage_type": "attribute" }, { "api_name": "torch.randint", "line_number": 21, "usage_type": "attribute" }, { "api_name": "numpy.concatenate", "line_number": 23, "usage_type": "call" }, { "api_name": "gym.spaces.Box"...
34215681035
import torch from torch.nn import functional as F import numpy as np import torch.nn as nn from . import ramps class DiceLoss(nn.Module): def __init__(self, n_classes): super(DiceLoss, self).__init__() self.n_classes = n_classes def _one_hot_encoder(self, input_tensor): tensor_list = ...
Huiimin5/comwin
code/utils/losses.py
losses.py
py
1,934
python
en
code
11
github-code
1
[ { "api_name": "torch.nn.Module", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 8, "usage_type": "name" }, { "api_name": "torch.ones_like", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.cat", "line_num...
36959104536
""" A module to create gdf from df """ import warnings import geopandas as gpd def df_to_gdf(df, x='long', y='lat'): """ Transform raw Lat/Long data to GeoDataFrame Parameters ========== df: DataFrame x: Latitude y: Longitude Returns ======= gdf: Point GeoDataFrame (unprojected) """ gdf = gpd.GeoData...
shuai-zhou/gps2space
gps2space/geodf.py
geodf.py
py
425
python
en
code
3
github-code
1
[ { "api_name": "geopandas.GeoDataFrame", "line_number": 23, "usage_type": "call" }, { "api_name": "geopandas.points_from_xy", "line_number": 24, "usage_type": "call" } ]
44946984296
# Reference. # https://pypi.org/project/sumy/ # https://newsapi.org/docs/endpoints/top-headlines import requests from goose3 import Goose from transformers import TFAutoModelWithLMHead, AutoTokenizer def get_top_headlines(): print('Entered get_top_headlines.') # Get top headlines from API. respons...
karanasher/news_summarizer
wisk/articles/utils.py
utils.py
py
3,642
python
en
code
0
github-code
1
[ { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 13, "usage_type": "call" }, { "api_name": "goose3.Goose", "line_number": 18, "usage_type": "call" }, { "api_name": "transformers.TFAutoModelWithLM...
74826794272
from django.urls import path, include from rest_framework.routers import DefaultRouter from cams import views router = DefaultRouter() router.register(r'cams', views.ChannelViewSet) router.register(r'records', views.RecordViewSet) urlpatterns = [ path('image_stream/<int:channel_id>/', views.image_stream, name='i...
EL-BID/distancia2-api
cams/urls.py
urls.py
py
373
python
en
code
5
github-code
1
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 6, "usage_type": "call" }, { "api_name": "cams.views.ChannelViewSet", "line_number": 7, "usage_type": "attribute" }, { "api_name": "cams.views", "line_number": 7, "usage_type": "name" }, { "api_n...
2208901653
import argparse import csv import io import logging import pathlib import sys import tabulate from . import constants from . import util from . import psf def csv_line(data): """csv_line Generate a single line of CSV as a string. :param data: list of items constituting the record """ output = i...
charlesdaniels/pretor
pretor/export.py
export.py
py
4,212
python
en
code
0
github-code
1
[ { "api_name": "io.StringIO", "line_number": 21, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 22, "usage_type": "call" }, { "api_name": "csv.QUOTE_NONNUMERIC", "line_number": 22, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentPar...
21088567211
import torch def calc_psnr(img1, img2): # input: img1 (img2) # torch.Tensor, range in [0, 1.0] img1, img2 = img1 * 255.0, img2 * 255.0 mse = torch.mean((img1 - img2) ** 2) if mse == 0: return float('inf') return 20 * torch.log10(255.0 / torch.sqrt(mse)) class AverageMeter...
jzsherlock4869/denoise-ignet
utils.py
utils.py
py
645
python
en
code
2
github-code
1
[ { "api_name": "torch.mean", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.log10", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.sqrt", "line_number": 10, "usage_type": "call" } ]
29522467721
import numpy as np class GaussianNB: def __init__(self): """ _classes: ndarray, class labels (obtained from y) _mean, _var: ndarray, ndarray; mean and variance of the Gaussian distribution. Shape is (n_classes, n_features). Initialized to 0s. _priors: ndarray...
Duckchoy/AI-algos
ML/supervised/NaiiveBayes.py
NaiiveBayes.py
py
3,156
python
en
code
0
github-code
1
[ { "api_name": "numpy.unique", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.float64", "line_number": 31, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "line_n...
1777293937
# -*- coding: UTF-8 -*- # from __future__ import with_statement import urllib,re,random,json from google.appengine.api import files from google.appengine.ext import blobstore from google.appengine.ext import webapp from google.appengine.ext import db from google.appengine.ext.webapp import blobstore_handlers from goog...
usbuild/GAEBucket
disk/index.py
index.py
py
3,490
python
en
code
2
github-code
1
[ { "api_name": "google.appengine.ext.webapp.RequestHandler", "line_number": 14, "usage_type": "attribute" }, { "api_name": "google.appengine.ext.webapp", "line_number": 14, "usage_type": "name" }, { "api_name": "google.appengine.ext.webapp.template.render", "line_number": 25, ...
33574594955
# set module search path import os ast2pyast_path = os.path.abspath('../antlr2pyast/') import sys sys.path.append(ast2pyast_path) # system packages import argparse import re # AST tree generation/conversion packages from converter import antlr2pyast import ast ####### functions to print an AST tree def str_node(node...
ProgrammingEduBVI/JupyterVox
ASTVox_Antlr4/src/tests/test.py
test.py
py
5,802
python
en
code
0
github-code
1
[ { "api_name": "os.path.abspath", "line_number": 3, "usage_type": "call" }, { "api_name": "os.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_number...
29164305065
from termcolor import colored from random import randint shapes = [] shapes.append([(0,0), (1,0), (2,0), (3,0)]) shapes.append([(1,0), (0,1), (1,1), (2,1), (1,2)]) shapes.append([(2,2), (2,1), (0,0), (1,0), (2,0)]) shapes.append([(0,0), (0,1), (0,2), (0,3)]) shapes.append([(0,0), (1,0), (0,1), (1,1)]) colors = ["red"...
ericekstrm/advent-of-code
2022/17.py
17.py
py
4,856
python
en
code
0
github-code
1
[ { "api_name": "termcolor.colored", "line_number": 69, "usage_type": "call" } ]
73915807713
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Module to solve stochastic equations of motion.""" __name__ = 'qom.solvers.stochastic' __authors__ = ["Sampreet Kalita"] __created__ = "2023-08-13" __updated__ = "2023-09-14" # dependencies from copy import deepcopy import numpy as np import time # qom modules from ...
Sampreet/qom
qom/solvers/stochastic.py
stochastic.py
py
11,572
python
en
code
0
github-code
1
[ { "api_name": "time.time", "line_number": 105, "usage_type": "call" }, { "api_name": "base.get_all_times", "line_number": 116, "usage_type": "call" }, { "api_name": "io.Updater", "line_number": 119, "usage_type": "call" }, { "api_name": "base.validate_system", ...
3855367432
# FV ADI - HV scheme import numpy as np #import matplotlib.pyplot as plt from scipy.stats import beta import os import pickle import datetime def genMesh1d01(x0, m): X = np.zeros(m+1) xMax = m*x0 c = x0/5 dxi = ( np.arcsinh((xMax-x0)/c)-np.arcsinh(-x0/c) )/m for i in ...
dennis0004/modelGSL
FPK_FV_ADI_GSLm.py
FPK_FV_ADI_GSLm.py
py
24,292
python
en
code
0
github-code
1
[ { "api_name": "numpy.zeros", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.arcsinh", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.arcsinh", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.sinh", "line_number...
72729690593
from telegram.ext import Updater, MessageHandler, Filters, CommandHandler import csv with open("worldcities.csv", newline='', encoding = 'UTF-8') as csvfile: data = csv.reader(csvfile, quoting=csv.QUOTE_ALL) def start(bot, update): update.message.reply_text("Cities game. If you want to stop enter...
DonMaxon/Cities-game-bot
cityTest.py
cityTest.py
py
2,655
python
en
code
0
github-code
1
[ { "api_name": "csv.reader", "line_number": 4, "usage_type": "call" }, { "api_name": "csv.QUOTE_ALL", "line_number": 4, "usage_type": "attribute" }, { "api_name": "telegram.ext.Updater", "line_number": 59, "usage_type": "call" }, { "api_name": "telegram.ext.Command...
36105392593
# Licensed under a 3-clause BSD style license - see LICENSE.rst """This module implements the combiner class.""" import numpy as np from numpy import ma try: import bottleneck as bn except ImportError: HAS_BOTTLENECK = False else: HAS_BOTTLENECK = True from .core import sigma_func from astropy.nddata i...
astropy/ccdproc
ccdproc/combiner.py
combiner.py
py
38,231
python
en
code
86
github-code
1
[ { "api_name": "bottleneck.nanmedian", "line_number": 27, "usage_type": "attribute" }, { "api_name": "numpy.nanmedian", "line_number": 29, "usage_type": "attribute" }, { "api_name": "bottleneck.nanmean", "line_number": 34, "usage_type": "attribute" }, { "api_name":...
23612968205
from InternalControl import cInternalControl import tkinter.messagebox as tkMessageBox import tkinter as tk import tkinter.font as tkFont import cfdi_quart_excel_version as win_cfdi import postgresql as bd import utils as tool import datetime import os import threading import sys objControl= cInternalControl() registe...
gitquart/appCFDIMasivoSAT
login_window.py
login_window.py
py
12,745
python
en
code
0
github-code
1
[ { "api_name": "InternalControl.cInternalControl", "line_number": 13, "usage_type": "call" }, { "api_name": "utils.showMessage", "line_number": 34, "usage_type": "call" }, { "api_name": "postgresql.getQuery", "line_number": 39, "usage_type": "call" }, { "api_name":...
41181898812
#Window Server Code #2. server.py import cv2 import imagezmq share = imagezmq.ImageHub() while True: rasp,iamge = share.recv_image() cv2.imshow(rasp, image) if cv2.WaitKey(1) == ord('q'): break image.send_reply(b'ok')
Lime0/KSE_Practice
win_cam_server_week1.py
win_cam_server_week1.py
py
257
python
en
code
0
github-code
1
[ { "api_name": "imagezmq.ImageHub", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.WaitKey", "line_number": 12, "usage_type": "call" } ]
14195692388
#loading all the needed libraries import dash import dash_core_components as dcc from dash import html from dash.dependencies import Input, Output, State import dash_bootstrap_components as dbc # must add this line in order for the app to be deployed successfully on Heroku # from app import server from app import app ...
rcreddykovvuri/Military-plotly
index.py
index.py
py
2,636
python
en
code
0
github-code
1
[ { "api_name": "app.app.server", "line_number": 13, "usage_type": "attribute" }, { "api_name": "app.app", "line_number": 13, "usage_type": "name" }, { "api_name": "dash_bootstrap_components.DropdownMenu", "line_number": 15, "usage_type": "call" }, { "api_name": "da...
38583826955
""" App project """ from kivy.app import App from kivy.uix.label import Label from kivy.uix.image import Image from kivy.uix.button import Button from kivy.uix.boxlayout import BoxLayout from kivy.core.audio import SoundLoader try: import pygame pygame.mixer.init() except ModuleNotFoundError: pygame = None def play...
Sheer0wn/App
main.py
main.py
py
3,182
python
en
code
2
github-code
1
[ { "api_name": "pygame.mixer.init", "line_number": 12, "usage_type": "call" }, { "api_name": "pygame.mixer", "line_number": 12, "usage_type": "attribute" }, { "api_name": "pygame.mixer.Sound", "line_number": 20, "usage_type": "call" }, { "api_name": "pygame.mixer",...
39181025783
import requests from bs4 import BeautifulSoup from lxml import html from lxml import etree import pandas as pd import numpy as np from pprint import PrettyPrinter from re import sub # my pp pp = PrettyPrinter() # # This code is meant to import screenplays from imsdb.com (Futurama) and automatically import all of the...
rayyungdev/tf_benderbot
imdsb_scrape.py
imdsb_scrape.py
py
3,928
python
en
code
0
github-code
1
[ { "api_name": "pprint.PrettyPrinter", "line_number": 11, "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": "requests.get", ...
16120882343
import asyncio from aioauth_client import YandexClient import settings from datetime import datetime import ujson yandex = YandexClient( client_id=settings.client_id, client_secret=settings.client_secret, access_token=settings.access_token ) @asyncio.coroutine def get_counters(): current_date = date...
singulared/aiohttp-example
yandex.py
yandex.py
py
1,084
python
en
code
0
github-code
1
[ { "api_name": "aioauth_client.YandexClient", "line_number": 8, "usage_type": "call" }, { "api_name": "settings.client_id", "line_number": 9, "usage_type": "attribute" }, { "api_name": "settings.client_secret", "line_number": 10, "usage_type": "attribute" }, { "api...
21509245631
#!/usr/local/bin/python3 import os, sys, pprint, logging import Inventory_Modules import argparse, boto3 from colorama import init,Fore,Back,Style from botocore.exceptions import ClientError, NoCredentialsError init() parser = argparse.ArgumentParser( description="We\'re going to find all resources within any of th...
alincalinciuc/Inventory_Scripts
all_my_cfnstacksets.py
all_my_cfnstacksets.py
py
4,303
python
en
code
null
github-code
1
[ { "api_name": "colorama.init", "line_number": 9, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.ERROR", "line_number": 43, "usage_type": "attribute" }, { "api_name": "logging.CRITI...
191894094
import unittest import numpy import six import chainer from chainer import cuda from chainer import gradient_check from chainer import testing from chainer.testing import attr from chainer.testing import condition class TestAccuracy(unittest.TestCase): def setUp(self): self.x = numpy.random.uniform(-1,...
jem0101/BigSwag-SQA2022-AUBURN
TestOrchestrator4ML-main/resources/Data/supervised/GITLAB_REPOS/jamieoglindsey0@chainer/tests/chainer_tests/functions_tests/test_accuracy.py
test_accuracy.py
py
1,253
python
en
code
2
github-code
1
[ { "api_name": "unittest.TestCase", "line_number": 14, "usage_type": "attribute" }, { "api_name": "numpy.random.uniform", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 17, "usage_type": "attribute" }, { "api_name": "numpy.f...
7486883399
# -*- coding: utf-8 -*- """ Created on Mon Jul 26 12:27:48 2021 @author: bjorn Traininer and Evaluation loops functioning with WandB """ import torch import time from tqdm import tqdm import wandb import numpy as np from sklearn.metrics import confusion_matrix from model_utils import get_rri, plot_grad_flow def tra...
bh1995/AF-classification
src/models/train_eval.py
train_eval.py
py
4,761
python
en
code
32
github-code
1
[ { "api_name": "time.time", "line_number": 22, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 26, "usage_type": "call" }, { "api_name": "model_utils.get_rri", "line_number": 32, "usage_type": "call" }, { "api_name": "torch.tensor", "line_numb...
38897114939
""" Author: Jiajie Chen Date: Apr 24, 2016 """ import numpy as np from scipy.optimize import fmin_ncg class logisticRegression(object): def __init__(self, theta=None, lambd=0.0, cost=0.0, max_iter=100, tol=1e-5, solver='newton-cg', verbose=False): self.theta = th...
jiajiechen/Georgia-Tech-MS
CSE-6240-Web-Search/hw2/part1/logisticRegression.py
logisticRegression.py
py
2,214
python
en
code
0
github-code
1
[ { "api_name": "numpy.column_stack", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 23, "usage_type": "call" }, { "api_name": "scipy.optimize.fmin_ncg", ...
23643007351
from django.conf import settings from django.conf.urls import url from django.contrib.auth.views import LogoutView as logout, LoginView as login from django.urls import path from inc_mgmt import views as v app_name = 'inc_mgmt' urlpatterns = [ url(r'^register/$', v.self_register, name='register'), u...
mmanfro/djinn
inc_mgmt/urls.py
urls.py
py
1,376
python
en
code
0
github-code
1
[ { "api_name": "django.conf.urls.url", "line_number": 10, "usage_type": "call" }, { "api_name": "inc_mgmt.views.self_register", "line_number": 10, "usage_type": "attribute" }, { "api_name": "inc_mgmt.views", "line_number": 10, "usage_type": "name" }, { "api_name": ...
24916803132
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits import mplot3d fig = plt.figure() ax = plt.axes(projection='3d') z = np.linspace(0,1,100) x = z*np.sin(z) y = z*np.cos(z) ax.plot3D(x,y,z,'g') plt.show()
sa-y-an/datasets
AI_ML/Programs/plt.py
plt.py
py
222
python
en
code
0
github-code
1
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 4, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 4, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.axes", "line_number": 5, "usage_type": "call" }, { "api_name": "matplo...
30660429263
import sys import time from serial import Serial from serial.tools import list_ports from .config_handler import ConfigHandler class UtilityHandler: arduino = None def write(message): UtilityHandler.arduino.write(message.encode()) def init(): print(""" > Simulador ADS-B ...
caiorondon/ce2-final
handlers/utility_handler.py
utility_handler.py
py
1,583
python
pt
code
0
github-code
1
[ { "api_name": "serial.tools.list_ports.comports", "line_number": 27, "usage_type": "call" }, { "api_name": "serial.tools.list_ports", "line_number": 27, "usage_type": "name" }, { "api_name": "sys.exit", "line_number": 31, "usage_type": "call" }, { "api_name": "ser...
39271557738
from typing import Dict import requests from requests import Response BASE_URL = 'https://aw3.automationintesting.online' MESSAGE_ENDPOINT = f'{BASE_URL}/message' def create_message(payload: Dict) -> Response: response = requests.post(MESSAGE_ENDPOINT, json=payload) if not response.ok: raise Connect...
ElSnoMan/mot-automation-week
booker/message_service.py
message_service.py
py
398
python
en
code
0
github-code
1
[ { "api_name": "typing.Dict", "line_number": 10, "usage_type": "name" }, { "api_name": "requests.post", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.Response", "line_number": 10, "usage_type": "name" } ]
17446551912
''' Mob class. Classes Turret and Mob inherits from class Entity ''' # ------ Importations ------ import pygame import math from isometric import IsoSprite, isoutils import constants as cst from . import misc,entity # ------ Mob Class ------ class Mob(entity.Entity): ''' Classe de base des monstres traversant l...
florimondmanca/tower-defense
entities/mob.py
mob.py
py
4,238
python
en
code
1
github-code
1
[ { "api_name": "pygame.Rect", "line_number": 29, "usage_type": "call" }, { "api_name": "pygame.Rect", "line_number": 32, "usage_type": "call" }, { "api_name": "isometric.isoutils.iso_to_cart", "line_number": 32, "usage_type": "call" }, { "api_name": "isometric.isou...
42995752273
from django import forms class UserBookForm(forms.Form): CHOICES = [ ('te', 'Temporary Exchange'), ('pe', 'Permanent Exchange'), ('rt', 'Rental'), ('sl', 'Sale') ] health = forms.DecimalField(label='', required = True, widget=forms.TextInput( attr...
born-curious/OneBook
library/forms.py
forms.py
py
769
python
en
code
0
github-code
1
[ { "api_name": "django.forms.Form", "line_number": 3, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 3, "usage_type": "name" }, { "api_name": "django.forms.DecimalField", "line_number": 10, "usage_type": "call" }, { "api_name": "django.fo...
24512988407
import os import zipfile SOURCE_ZIP_NAME = 'source_code.zip' def zip_dir(directory: str, zip_file: str): with zipfile.ZipFile(zip_file, 'w', zipfile.ZIP_DEFLATED) as zipf: for root, dirs, files in os.walk(directory): for file in files: zipf.write(os.path.join(root, file)) de...
shemetz/Google_Hashcode_2022
src/zip_source.py
zip_source.py
py
638
python
en
code
0
github-code
1
[ { "api_name": "zipfile.ZipFile", "line_number": 8, "usage_type": "call" }, { "api_name": "zipfile.ZIP_DEFLATED", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.walk", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.join", "li...
72799878755
from django.db import models from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic from django.core.exceptions import ObjectDoesNotExist from django_extensions.db.fields import CreationDateTimeField, ModificationDateTimeField class DjangoManager(models.Manager): ...
genghisu/eruditio
eruditio/apps/core/models.py
models.py
py
5,912
python
en
code
0
github-code
1
[ { "api_name": "django.db.models.Manager", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 8, "usage_type": "name" }, { "api_name": "django.core.exceptions.ObjectDoesNotExist", "line_number": 15, "usage_type": "name" }, {...
15168732536
#!/usr/bin/env python def str2bool(v): import argparse if isinstance(v, bool): return v if v.lower() in ('yes', 'true', 't', 'y', '1'): return True elif v.lower() in ('no', 'false', 'f', 'n', '0'): return False else: raise argparse.ArgumentTypeError('Boolean value e...
crapula2010/file_copier
file_copier.py
file_copier.py
py
3,401
python
en
code
0
github-code
1
[ { "api_name": "argparse.ArgumentTypeError", "line_number": 13, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 19, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 52, "usage_type": "call" }, { "api_name": "pickl...
42390085323
import numpy as np import matplotlib.pyplot as plt from matplotlib import animation import matplotlib.patches as patches import cv2 # write your script here, we recommend the above libraries for making your animation from LucasKanadeBasis import LucasKanadeBasis from LucasKanade import LucasKanade # write your scrip...
danenigma/Traditional-Computer-Vision
LK-Tracking/code/testSylvSequence.py
testSylvSequence.py
py
1,992
python
en
code
0
github-code
1
[ { "api_name": "numpy.load", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 19...
14089437388
import pygame from .constants import BLACK, WHITE, BLUE, SQUARE_SIZE, ROWS, COLS, RED from othello.board import Board from .piece import Piece LEFT = (0, -1) TOP_LEFT = (-1, -1) TOP = (-1, 0) TOP_RIGHT = (-1, 1) RIGHT = (0, 1) BOTTOM_RIGHT = (1, 1) BOTTOM = (1, 0) BOTOTM_LEFT = (1, -1) DIRECTION...
GeorgeKonomi/Othello
Othello/othello/game.py
game.py
py
10,493
python
en
code
0
github-code
1
[ { "api_name": "pygame.display.update", "line_number": 28, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 28, "usage_type": "attribute" }, { "api_name": "othello.board.Board", "line_number": 32, "usage_type": "call" }, { "api_name": "constan...
12048367682
import os import argparse from langchain.llms import OpenAI from langchain import PromptTemplate from langchain.chains import LLMChain, SequentialChain import warnings from datasets import load_dataset from evaluate import load import numpy as np from wasabi import color import pyutils.io as io import tqdm.auto as tqdm...
zphang/llm_feedback
llm_feedback/old/quick_feedback.py
quick_feedback.py
py
6,218
python
en
code
5
github-code
1
[ { "api_name": "langchain.PromptTemplate", "line_number": 23, "usage_type": "call" }, { "api_name": "langchain.chains.LLMChain", "line_number": 27, "usage_type": "call" }, { "api_name": "langchain.PromptTemplate", "line_number": 38, "usage_type": "call" }, { "api_n...
73737563555
# -*- coding: utf-8 -*- """Config for the Trunk. """ __authors__ = "emenager, tnavez" __contact__ = "etienne.menager@inria.fr, tanguy.navez@inria.fr" __version__ = "1.0.0" __copyright__ = "(c) 2020, Inria" __date__ = "Jun 29 2022" import sys import pathlib sys.path.insert(0, str(pathlib.Path(__file__).parent.absolute...
SofaDefrost/CondensedFEMModel
Models/3ContactFinger/Config.py
Config.py
py
2,193
python
en
code
1
github-code
1
[ { "api_name": "sys.path.insert", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.path.insert", "lin...
21003778323
import time from elasticsearch_dsl import connections from protobuf_to_dict import dict_to_protobuf from protobufs.services.post import containers_pb2 as post_containers from protobufs.services.profile import containers_pb2 as profile_containers from protobufs.services.search.containers import entity_pb2 from protobuf...
getcircle/services
search/tests/test_search_v2.py
test_search_v2.py
py
19,015
python
en
code
0
github-code
1
[ { "api_name": "base.ESTestCase", "line_number": 22, "usage_type": "name" }, { "api_name": "services.test.mocks.mock_organization", "line_number": 27, "usage_type": "call" }, { "api_name": "services.test.mocks", "line_number": 27, "usage_type": "name" }, { "api_nam...
30080806891
from collections.abc import Iterator def get_diagnostic_code(input_list, list_of_inputs, logging=False): if not isinstance(list_of_inputs, Iterator): list_of_inputs = iter(list_of_inputs) input_list.extend([0] * 10000) i = 0 relative_base = 0 while True: op_code = input_list[i] ...
georgerouse/aoc_2019
day_13.py
day_13.py
py
4,470
python
en
code
4
github-code
1
[ { "api_name": "collections.abc.Iterator", "line_number": 4, "usage_type": "argument" } ]