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
17760743772
# -*- coding: utf-8 -*- import sqlite3 from sys import exc_info import io import os class bancoDeDados: ''' Classe para banco de dados mysql''' def __init__(self, nome='itsm.sqlite3'): self.nome, self.conexao = nome, None def conecta(self): '''Metodo para conectar''' self.conexao ...
mborcari/catalogitsm
sqllite.py
sqllite.py
py
3,566
python
pt
code
1
github-code
97
[ { "api_name": "sqlite3.connect", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.exc_info", "line_number": 29, "usage_type": "call" }, { "api_name": "sys.exc_info", "line_number": 38, "usage_type": "call" }, { "api_name": "sys.exc_info", "line_nu...
13274028217
#!/usr/bin/env python # coding: utf-8 # In[1]: # The address of the metadata server SERVER_IP = "128.2.204.215" # The port of the metadata server SERVER_PORT = 8080 # the path to the input file ipath = '/Users/gxchris/Desktop/m.csv' # the path to the output file opath1 = '/Users/gxchris/Desktop/meta_user.csv' opath...
gxchris95/se4ai
Movie Recommender.py
Movie Recommender.py
py
6,355
python
en
code
0
github-code
97
[ { "api_name": "kafka.KafkaConsumer", "line_number": 38, "usage_type": "call" }, { "api_name": "whylogs.get_or_create_session", "line_number": 80, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 82, "usage_type": "call" }, { "api_name": "os....
28325933975
import numpy as np import matplotlib.pyplot as plt if __name__ == '__main__': t = np.arange(0, np.pi * 10, 0.01) x = t * np.cos(t) y = t * np.sin(t) plt.plot(x, y, color="blue") plt.grid(True) plt.show()
ayoshimatsu/geometry_test
interpolation_book/parametric_spline3/archimedean.py
archimedean.py
py
230
python
en
code
0
github-code
97
[ { "api_name": "numpy.arange", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 5, "usage_type": "attribute" }, { "api_name": "numpy.cos", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 7, ...
44763687342
import pygame from pygame.locals import * from cmath import * import math import sys import time #Inicialização de todos os módulos pygame.init() pygame.mixer.pre_init(44100, -16, 2, 2048) pygame.mixer.init() pygame.mixer.music.load('tokyo.wav') pygame.mixer.music.play(-1) pygame.font.init() my_font = pygame.font.get_...
MzGrisotti/carroPy
carro.py
carro.py
py
8,812
python
en
code
0
github-code
97
[ { "api_name": "pygame.init", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.mixer.pre_init", "line_number": 10, "usage_type": "call" }, { "api_name": "pygame.mixer", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pygame.mixer.init"...
2447684780
import os import random import time import pytest from set_top_box.test_settings import Settings from set_top_box.client_api.VOD.conftest import * from set_top_box.client_api.Menu.conftest import setup_cleanup_parental_and_purchase_controls, setup_enable_video_window from set_top_box.client_api.my_shows.conftest impo...
ErnstXperi/ErnstXperi
tests/test_witbe_vod.py
test_witbe_vod.py
py
3,055
python
en
code
0
github-code
97
[ { "api_name": "pytest.skip", "line_number": 42, "usage_type": "call" }, { "api_name": "pytest.mark.timeout", "line_number": 21, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 21, "usage_type": "attribute" }, { "api_name": "set_top_box.test_set...
3519353876
""" 383.赎金信 https://leetcode.cn/problems/ransom-note/ 给你两个字符串:ransomNote和magazine, 判断ransomNote能不能由magazine里面的字符构成。 如果可以,返回true;否则返回false。 magazine中的每个字符只能在ransomNote中使用一次。 """ import collections def canConstruct(self, ransomNote: str, magazine: str) -> bool: if set(ransomNote) > set(magazine): ...
Sihan-A/LeetCode-questions-Python
leetcode-easy/0383-ransom-note.py
0383-ransom-note.py
py
715
python
en
code
1
github-code
97
[ { "api_name": "collections.Counter", "line_number": 16, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 17, "usage_type": "call" } ]
74140380159
import pandas as pd import matplotlib.pyplot as plt xrd = pd.read_csv('LCCu1.txt', skipinitialspace=True, skiprows=134) xrd.dropna(axis=1, inplace=True) fig, ax = plt.subplots() ax.plot(xrd['Angle'], xrd['Det1Disc1'], label='experimental data') plt.legend() plt.show()
cfilomeno/Tutoriais
Tutorial Jupyter Notebook/notebook/fitdrx.py
fitdrx.py
py
272
python
en
code
2
github-code
97
[ { "api_name": "pandas.read_csv", "line_number": 4, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 7, "usage_type": "name" }, { "api_name": "matplotlib....
1473452783
import pandas as pd import statsmodels.api as sm import matplotlib.pyplot as plt import seaborn as sns from scipy import stats from sklearn.linear_model import LinearRegression from statsmodels.stats.diagnostic import linear_rainbow from scipy.stats import shapiro from sklearn.model_selection import train_test_split f...
Alyssasorensen/datasci_7_regressions
regression_simple.py
regression_simple.py
py
2,687
python
en
code
0
github-code
97
[ { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 32, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LinearRegression", "line_number": 34, "usage_type": "call" ...
38505808575
import math import re from gavo.utils import codetricks from gavo.utils import excs from gavo.utils import mathtricks from gavo.utils import misctricks from gavo.utils.mathtricks import DEG _TRAILING_ZEROES = re.compile("0+(\s|$)") def removeTrailingZeroes(s): """remove zeroes in front of whitespace or the string en...
brianv0/gavo
gavo/utils/pgsphere.py
pgsphere.py
py
10,708
python
en
code
1
github-code
97
[ { "api_name": "re.compile", "line_number": 10, "usage_type": "call" }, { "api_name": "gavo.utils.excs.ExecutiveAction", "line_number": 22, "usage_type": "attribute" }, { "api_name": "gavo.utils.excs", "line_number": 22, "usage_type": "name" }, { "api_name": "re.co...
69954575039
#!/usr/bin/env python # coding: utf-8 # # 控制论 # ## 实数域的微分方程 # In[1]: import sympy as sp from sympy.abc import t # In[2]: f = sp.Function('f')(t) A, B = sp.symbols('A B') equ0 = sp.Eq(sp.Derivative(f, t, 2), A * f + B * sp.Derivative(f, t, 1)) display(equ0) result0 = sp.dsolve(equ0, f) display(result0) M, N = ...
ColorlessBoy/hemingwei
hemingway/_build/jupyter_execute/notes/taste_controller.py
taste_controller.py
py
3,098
python
en
code
0
github-code
97
[ { "api_name": "sympy.abc.t", "line_number": 18, "usage_type": "argument" }, { "api_name": "sympy.Function", "line_number": 18, "usage_type": "call" }, { "api_name": "sympy.symbols", "line_number": 19, "usage_type": "call" }, { "api_name": "sympy.Eq", "line_num...
31428558450
from bs4 import BeautifulSoup from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.firefox.options import Options from selenium.webdriver.firefox.service import Service from selenium.common.exceptions import NoSuchElementException,ElementClickInterceptedException import pan...
freckledMe/web_scraping
scripts/gazeta_uz.py
gazeta_uz.py
py
2,021
python
en
code
0
github-code
97
[ { "api_name": "selenium.webdriver.firefox.options.Options", "line_number": 11, "usage_type": "call" }, { "api_name": "selenium.webdriver.Firefox", "line_number": 16, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 16, "usage_type": "name" }, ...
792702631
import pygame import random pygame.init() WIDTH = 500 HEIGHT = 500 BG_COLOR = (125, 125, 125) RED = (255, 0, 0) ORANGE = (255, 125, 0) GREEN = (0, 255, 0) BLUE = (0, 0, 255) YELLOW = (255, 255, 0) COLORS = [RED, ORANGE] FPS = 60 screen = pygame.display.set_mode((WIDTH, HEIGHT)) clock = pygame.time.C...
eliyahumasinter/classic-brick
brick.py
brick.py
py
4,935
python
en
code
0
github-code
97
[ { "api_name": "pygame.init", "line_number": 4, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 17, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 17, "usage_type": "attribute" }, { "api_name": "pygame.time.Cl...
20524081243
import pytest from io import BytesIO from flask_annex import Annex from .helpers import AbstractTestAnnex, assert_key_value, get_upload_info # ----------------------------------------------------------------------------- @pytest.fixture def file_annex_path(tmpdir): return tmpdir.join("annex").mkdir().strpath ...
4Catalyzer/flask-annex
tests/test_file.py
test_file.py
py
2,306
python
en
code
8
github-code
97
[ { "api_name": "pytest.fixture", "line_number": 11, "usage_type": "attribute" }, { "api_name": "helpers.AbstractTestAnnex", "line_number": 19, "usage_type": "name" }, { "api_name": "flask_annex.Annex", "line_number": 22, "usage_type": "call" }, { "api_name": "pytes...
42041552648
from django import template from django.utils.translation import ugettext as _ from django.utils import safestring from django.template.defaultfilters import stringfilter import re import random import json as jsonlib register = template.Library() @register.filter def likerttext(value): likertdict = { -3: "Strong...
govtrack/govtrack.us-web
website/templatetags/govtrack_utils.py
govtrack_utils.py
py
3,766
python
en
code
350
github-code
97
[ { "api_name": "django.template.Library", "line_number": 9, "usage_type": "call" }, { "api_name": "django.template", "line_number": 9, "usage_type": "name" }, { "api_name": "django.utils.translation.ugettext", "line_number": 32, "usage_type": "call" }, { "api_name"...
1715033690
""" Constants values used in schemas functions. """ import pulp as pl from ortools.sat.python import cp_model STRING_TYPE = "String" BOOLEAN_TYPE = "Boolean" INTEGER_TYPE = "Integer" FLOAT_TYPE = "Float" BASIC_TYPES = [STRING_TYPE, BOOLEAN_TYPE, INTEGER_TYPE, FLOAT_TYPE] JSON_TYPES = { "string": STRING_TYPE, ...
baobabsoluciones/cornflow-client
cornflow_client/constants.py
constants.py
py
3,211
python
en
code
3
github-code
97
[ { "api_name": "ortools.sat.python.cp_model.OPTIMAL", "line_number": 74, "usage_type": "attribute" }, { "api_name": "ortools.sat.python.cp_model", "line_number": 74, "usage_type": "name" }, { "api_name": "ortools.sat.python.cp_model.FEASIBLE", "line_number": 75, "usage_typ...
40099832670
from __future__ import absolute_import, division, print_function import argparse from Datasets.datasets import get_dataset import datetime from Other.utility_functions import str2bool, particle_tracing from Models.models import load_model, create_model, save_model import torch import torch.optim as optim import torch.d...
skywolf829/NeuralStreamFunction
Code/train.py
train.py
py
12,332
python
en
code
4
github-code
97
[ { "api_name": "os.path.dirname", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.join", "line...
26108542717
""" This file contains the code to do the calculation. Each resolver receives a model and outputs the calculated result, which can be a model or just a matrix. """ from datetime import date, datetime import pandas as pd import warnings import numpy as np import os import sys import re import matplotlib.pyplot as plt f...
Johnlky/DC-Boxjelly
app/core/resolvers.py
resolvers.py
py
22,148
python
en
code
0
github-code
97
[ { "api_name": "warnings.filterwarnings", "line_number": 19, "usage_type": "call" }, { "api_name": "pandas.CategoricalIndex", "line_number": 81, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 107, "usage_type": "call" }, { "api_name": "os.path...
26758928227
# encoding=utf-8 import os import web import xtemplate import xutils import xconfig C_TEMPLATE = """ #include <stdio.h> #include <string.h> #include <stdlib.h> int main(int argc, char* argv) { printf("hello,world!"); return 0; } """ class TccHandler: def GET(self): args = web.input(code=None, jso...
gotonking/miniNote
handlers/tools/tools.py
tools.py
py
1,555
python
en
code
0
github-code
97
[ { "api_name": "web.input", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_number": 28, "usage_type": "attribute" }, { "api_name": "xconfig.TMP_DIR", "line_numbe...
73771376957
# coding=utf-8 from models import Lesson, Homeworkcommit, Course, Studentcourse, Coursehomework from school.models import Student from constant import * from django.http import HttpResponse from django.core.urlresolvers import reverse from django.shortcuts import redirect, render import json from course.auth import has...
xiaohuanshu/OpenCLMS
course/control.py
control.py
py
6,925
python
en
code
8
github-code
97
[ { "api_name": "models.Lesson.objects.get", "line_number": 17, "usage_type": "call" }, { "api_name": "models.Lesson.objects", "line_number": 17, "usage_type": "attribute" }, { "api_name": "models.Lesson", "line_number": 17, "usage_type": "name" }, { "api_name": "co...
262565416
import logging from . import logger, verify_apps, run, vbox def main(): import argparse parser = argparse.ArgumentParser() parser.add_argument('apps', nargs='+') args = parser.parse_args() handler = logging.StreamHandler() logger.addHandler(handler) logger.setLevel(logging.DEBUG) logg...
autumnjolitz/virtualboxapp
virtualboxapp/__main__.py
__main__.py
py
596
python
en
code
0
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.StreamHandler", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 13, "usage_type": "attribute" }, { "api_name": "loggi...
16606959688
from ..utils import * from ..trainval import manage_dirs_drybean from .ax import AugEplanation, compute_co_score, softmax DEBUG_TOGGLES = { 'val_iter': 0, 'vis_iter': 0, } import warnings warnings.filterwarnings('ignore') # remove warning about captum removing forward, backward hooks def ax_drybean_test(darg...
ericotjo001/explainable_ai
gax/src/axpackage/ax_drybean.py
ax_drybean.py
py
3,210
python
en
code
4
github-code
97
[ { "api_name": "warnings.filterwarnings", "line_number": 11, "usage_type": "call" }, { "api_name": "trainval.manage_dirs_drybean", "line_number": 18, "usage_type": "call" }, { "api_name": "other_data.DryBeanDataset", "line_number": 22, "usage_type": "call" }, { "ap...
12665439879
from sqlalchemy import Column, ForeignKey, Integer, String from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship from sqlalchemy import create_engine from flask_login import UserMixin from flask_dance.consumer.backend.sqla import OAuthConsumerMixin Base = declarative_ba...
FerasAloudah/fsnd-catalog-app
create_database.py
create_database.py
py
1,519
python
en
code
0
github-code
97
[ { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 8, "usage_type": "call" }, { "api_name": "flask_login.UserMixin", "line_number": 11, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 14, "usage_type": "call" }, { ...
14405778418
# -*- coding: utf-8 -*- """ Module provides game itself. \n It is enough to execute main to get game working\n """ import random as r import time from random import shuffle from typing import List import numpy import pygame from pygame.math import Vector2 from scipy.interpolate import interp1d from background import...
kornel45/rocket_game
game.py
game.py
py
24,893
python
en
code
0
github-code
97
[ { "api_name": "rocket.Rocket", "line_number": 33, "usage_type": "name" }, { "api_name": "background.Background", "line_number": 33, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 33, "usage_type": "name" }, { "api_name": "pygame.Surface", ...
24537313763
from typing import Callable, List, TypeVar StringFunc = Callable[[], str] T = TypeVar('T') Constructor = Callable[[], T] def get(of: Constructor[T], *, stdin: StringFunc = input, strip: bool = True) -> T: """Get value of type 'of' from 'stdin'.""" raw_input = stdin().strip() if strip else std...
ansonmiu0214/dsa-worked-solutions
solutions/utils/io.py
io.py
py
727
python
en
code
0
github-code
97
[ { "api_name": "typing.Callable", "line_number": 3, "usage_type": "name" }, { "api_name": "typing.TypeVar", "line_number": 4, "usage_type": "call" }, { "api_name": "typing.Callable", "line_number": 5, "usage_type": "name" }, { "api_name": "typing.List", "line_n...
36375266736
import numpy as np import matplotlib.pyplot as plt from copy import deepcopy class MotionPrimitive(): """ A motion primitive that defines a trajectory from a over a time T. Put functions that all MPs should have in this base class. If the implementation is specific to the subclass, raise a NotImplem...
ljarin/dispersion_motion_planning
motion_primitives_py/motion_primitives_py/motion_primitive_types/motion_primitive.py
motion_primitive.py
py
6,415
python
en
code
6
github-code
97
[ { "api_name": "numpy.array", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": ...
18428584647
import logging import os import datetime import socket import copy from stellar_base.keypair import Keypair from ..design import Node log = logging.getLogger(__name__) def subparser(subparser): parser = subparser.add_parser( 'fix-design', help='fix the incorrect design', ) parser.set_d...
spikeekips/stellar-nice-body
src/tnb/command/fix_design.py
fix_design.py
py
1,001
python
en
code
0
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 26, "usage_type": "call" }, { "api_name": "design.Node.get_defaults_design", "line_number": 29, "usage_type": "call" }, { "api_name": "desig...
12270114788
# Exercise: Convolution and ReLU # Introduction # In this exercise, you'll work on building some intuition around feature extraction. # irst, we'll walk through the example we did in the tutorial again, but this time, with a kernel you choose yourself. # We've mostly been working with images in this course, but what...
vbloise3/kaggle
exercise-Convolution-and-ReLU.py
exercise-Convolution-and-ReLU.py
py
7,282
python
en
code
3
github-code
97
[ { "api_name": "learntools.core.binder.bind", "line_number": 13, "usage_type": "call" }, { "api_name": "learntools.core.binder", "line_number": 13, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.rc", "line_number": 20, "usage_type": "call" }, { "api_name"...
5902166604
import sqlite3 from som_logg import (LoginCreate, Prof, helper) conn = sqlite3.connect('sample.db') cur = conn.cursor() cur.execute('''CREATE TABLE IF NOT EXISTS users(login TEXT, pasw TEXT, alternative TEXT)''') conn.commit() cmd = input('Введите команду, которую хотите использовать: \n') command_dict = {'/help': h...
ar4angeel/try_logg
info_inside.py
info_inside.py
py
711
python
en
code
0
github-code
97
[ { "api_name": "sqlite3.connect", "line_number": 3, "usage_type": "call" }, { "api_name": "som_logg.helper", "line_number": 11, "usage_type": "name" }, { "api_name": "som_logg.LoginCreate", "line_number": 12, "usage_type": "name" }, { "api_name": "som_logg.Prof", ...
23757227169
# mod parser 3d-news for TorrentPier-II 2.1.5 alpha # ver 1.0 by dr_brown from urllib.request import Request, urlopen from urllib.error import HTTPError from urllib.parse import quote from bs4 import BeautifulSoup from time import sleep import pymysql.cursors import urllib import time import re '''If use...
DrBrown777/parser3dnews
main.py
main.py
py
5,869
python
en
code
2
github-code
97
[ { "api_name": "pymysql.cursors.cursors", "line_number": 29, "usage_type": "attribute" }, { "api_name": "pymysql.cursors", "line_number": 29, "usage_type": "name" }, { "api_name": "pymysql.cursors.connect", "line_number": 31, "usage_type": "call" }, { "api_name": "...
38234530099
import numpy as np from sklearn.metrics import jaccard_similarity_score import os from os import listdir from os.path import isfile, join import cv2 def load_image(img_org,INPUT_SIZE): h, w, c = img_org.shape img = cv2.resize(img_org, (INPUT_SIZE, INPUT_SIZE)) img = np.array(img, dtype=np.float32) x = ...
guybenyosef/densecrf_rnn
deepLabV2/eval_output.py
eval_output.py
py
1,755
python
en
code
0
github-code
97
[ { "api_name": "cv2.resize", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.expand_dims", "li...
29048158619
import os import hashlib import argparse # Grab command line arguments for directory and signature file parser = argparse.ArgumentParser() parser.add_argument('--directory', '-d', help="The directory to scan for viruses in", required=True) parser.add_argument('--signatures', '-s', help="The signature file", required...
priyjan5/A-Simple-Virus-Scanner-in-Python
scanner.py
scanner.py
py
1,062
python
en
code
1
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "os.walk", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_numbe...
72901673920
##################################################### # Introspective Variational Autoencoder Config File # ##################################################### # A Brock, 2016 import numpy as np import matplotlib.pyplot as plt from keras.utils.visualize_util import plot from keras.models import Model from keras impo...
hope-yao/VAE_SAL
3DVAE_config.py
3DVAE_config.py
py
14,749
python
en
code
1
github-code
97
[ { "api_name": "keras.backend.set_image_dim_ordering", "line_number": 19, "usage_type": "call" }, { "api_name": "keras.backend", "line_number": 19, "usage_type": "name" }, { "api_name": "keras.backend.image_dim_ordering", "line_number": 44, "usage_type": "call" }, { ...
73189923840
# -*- coding: utf-8 -*- import serial.tools.list_ports as ports import subprocess import argparse import psutil import yaml import os def get_com_by_sn(serial = ''): com_ports = list(ports.comports()) for i in com_ports: if serial == '' or serial == i.serial_number: return i.device def ge...
filcuk/PyHelpers
deej_helper/deej_helper.py
deej_helper.py
py
2,412
python
en
code
0
github-code
97
[ { "api_name": "serial.tools.list_ports.comports", "line_number": 11, "usage_type": "call" }, { "api_name": "serial.tools.list_ports", "line_number": 11, "usage_type": "name" }, { "api_name": "serial.tools.list_ports", "line_number": 13, "usage_type": "name" }, { "...
39966935826
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('vegetation', '0001_initial'), ] operations = [ migrations.AddField( model_name='vegetationstate', na...
inmagik/greenmanager
greenmanager/vegetation/migrations/0002_auto_20140716_1421.py
0002_auto_20140716_1421.py
py
874
python
en
code
0
github-code
97
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AddField", "line_number": 14, "usage_type": "call" }, { ...
26318263234
from __future__ import annotations import asyncio import contextlib from concurrent.futures.thread import ThreadPoolExecutor from functools import partial from typing import Optional, AsyncGenerator, Union from typing_extensions import Literal from serial import Serial, serial_for_url # type: ignore[import] Timeout...
Opentrons/opentrons
api/src/opentrons/drivers/asyncio/communication/async_serial.py
async_serial.py
py
5,178
python
en
code
363
github-code
97
[ { "api_name": "typing.Union", "line_number": 12, "usage_type": "name" }, { "api_name": "typing_extensions.Literal", "line_number": 12, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 23, "usage_type": "name" }, { "api_name": "typing.Optiona...
70732742400
# Problem 54 - Poker Hands #The file, poker.txt, contains one-thousand random hands dealt to two players. # Each line of the file contains ten cards (separated by a single space): # the first five are Player 1's cards and the last five are Player 2's cards. # You can assume that all hands are valid (no invalid chara...
Frederik-N/projecteuler
problem54/problem54.py
problem54.py
py
8,489
python
en
code
0
github-code
97
[ { "api_name": "collections.defaultdict", "line_number": 23, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 37, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 53, "usage_type": "call" }, { "api_name"...
30925595654
# Databricks notebook source # MAGIC %pip install pydantic # COMMAND ---------- from pydantic import BaseSettings class Settings(BaseSettings): SPARK_MASTER: str = "local[*]" AZURE_ACC_1: str = "" AZURE_CLIENT_ID_1: str = "" AZURE_CLIENT_SECRET_1: str = "" AZURE_TENANT_ID_1: str = "" AZU...
4dori/Data-Engineering
module_2/Spark_Databricks/notebooks/MetadataCreate.py
MetadataCreate.py
py
5,659
python
en
code
0
github-code
97
[ { "api_name": "pydantic.BaseSettings", "line_number": 7, "usage_type": "name" } ]
72714866558
# Adds support for obtaining property types from docstring signatures, and # improves formatting by PyProperty of type annotations. import re from typing import Tuple, Optional, List import docutils.nodes import docutils.parsers.rst.directives import sphinx.addnodes import sphinx.domains import sphinx.domains.python ...
ep-infosec/50_google_tensorstore
docs/tensorstore_sphinx_material/sphinx_material/autodoc_property_type.py
autodoc_property_type.py
py
2,515
python
en
code
0
github-code
97
[ { "api_name": "re.compile", "line_number": 14, "usage_type": "call" }, { "api_name": "typing.Optional", "line_number": 17, "usage_type": "name" }, { "api_name": "sphinx.addnodes.ext", "line_number": 32, "usage_type": "attribute" }, { "api_name": "sphinx.addnodes",...
70825552639
from numpy import genfromtxt import numpy as np import matplotlib.pyplot as plt import glob, os, shutil # os.chdir("C:\\RugJelmertModelingOutput\\test\\") cities = ["1x10_ingroup.half","1x10_ingroup"] #cities = ["heerde","diemen","schiedam","emmen","breda","groningen","almere","rotterdam"] #cities = ["01_Heerde","02...
foarsitter/master-thesis
Python/line.py
line.py
py
2,207
python
en
code
0
github-code
97
[ { "api_name": "os.chdir", "line_number": 8, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 16, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 17, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 18, "usag...
32123770074
from flask import Flask, request, make_response, abort, Response from flask_cors import cross_origin import json from redis import Redis import boto3 import botocore from config import S3_BUCKET from tasks import makePacket app = Flask(__name__) app.config.from_object('config') redis = Redis() @app.route('/') de...
datamade/metro-pdf-merger
app.py
app.py
py
1,956
python
en
code
1
github-code
97
[ { "api_name": "flask.Flask", "line_number": 13, "usage_type": "call" }, { "api_name": "redis.Redis", "line_number": 16, "usage_type": "call" }, { "api_name": "flask.abort", "line_number": 30, "usage_type": "call" }, { "api_name": "deployment.DEPLOYMENT_ID", "l...
43023833046
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import subprocess from sys import platform import sys import requests import gzip import shutil import os.path # Credit goes to Sumit Ghosh: https://sumit-ghosh.com/articles/python-download-progress-bar/ def download(url, filename): with open(filename, 'wb') as f: ...
ycm-core/lsp-examples
crystal/install.py
install.py
py
3,274
python
en
code
76
github-code
97
[ { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.stdout.write", "line_number": 27, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 27, "usage_type": "attribute" }, { "api_name": "sys.stdout.flush", ...
24524286133
import openpyxl def dataGenerator(): wb = openpyxl.load_workbook("/Users/navaneeth/Downloads/Flightz.xlsx") sh = wb['Sheet1'] row = sh.max_row outer_list =[] inner_list = [] for i in range(1, row+1): inner_list = [] source = sh.cell(i,1) destination = sh.cell(i,2) ...
Navaneeth311/DataDrivenFramework
DataGeneraator/DataGen.py
DataGen.py
py
469
python
en
code
0
github-code
97
[ { "api_name": "openpyxl.load_workbook", "line_number": 5, "usage_type": "call" } ]
5690770262
from django.http.response import HttpResponse from rest_framework.response import Response from rest_framework.decorators import api_view from .serializers import TasksSerializer from .models import Tasks # Create your views here. @api_view(['GET']) def apiOverview(request): api_urls = { 'List':'/task-list/', ...
AshutoshMaleti/DRF-CRUD-api
base/views.py
views.py
py
1,470
python
en
code
0
github-code
97
[ { "api_name": "rest_framework.response.Response", "line_number": 20, "usage_type": "call" }, { "api_name": "rest_framework.decorators.api_view", "line_number": 10, "usage_type": "call" }, { "api_name": "models.Tasks.objects.all", "line_number": 24, "usage_type": "call" ...
4523659923
#! /usr/bin/env python from __future__ import print_function import os import sys import logging import argparse sys.path.append( os.path.realpath( os.path.join( os.path.dirname(__file__), ".."))) from mykatlas.version import __version__ from mykatlas.base import ArgumentParserWi...
Phelimb/atlas
mykatlas/atlas_main.py
atlas_main.py
py
8,067
python
en
code
5
github-code
97
[ { "api_name": "sys.path.append", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_numb...
24998794023
from pip._vendor import pkg_resources from jupyter_client.kernelspecapp import KernelSpecManager from pip._vendor import pkg_resources from ipykernel.kernelspec import install class Kernel(): def __init__(self): location = None for pkg in pkg_resources.working_set: if pkg.project_name ...
as-sher/nbschedule
nbschedule/worker/_kernel.py
_kernel.py
py
880
python
en
code
1
github-code
97
[ { "api_name": "pip._vendor.pkg_resources.working_set", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pip._vendor.pkg_resources", "line_number": 10, "usage_type": "name" }, { "api_name": "jupyter_client.kernelspecapp.KernelSpecManager", "line_number": 17, ...
32032487614
import requests from homeBlogData import extractBlogData from singleTableDataExtraxtor import tableDataExtractor from singleXpathDataExtractor import extractSinglePath def getHomeBlogData(key, content, pathData, finalResult): print(pathData) if pathData.get('blogMainDivPath') and pathData.get('blogPath...
dsairam143/webscrapingFramework
xpathsDataExtractor/runDataExtractor_V1_1.py
runDataExtractor_V1_1.py
py
3,196
python
en
code
0
github-code
97
[ { "api_name": "homeBlogData.extractBlogData", "line_number": 9, "usage_type": "call" }, { "api_name": "singleTableDataExtraxtor.tableDataExtractor", "line_number": 12, "usage_type": "call" }, { "api_name": "singleXpathDataExtractor.extractSinglePath", "line_number": 16, "...
2233246011
from abc import abstractmethod, ABCMeta from django.utils.functional import cached_property from typing import List, Optional from usaspending_api.common.etl.postgres.etl_object_base import ETLObjectBase from usaspending_api.common.etl.postgres.primatives import ColumnOverrides, DataTypes, KeyColumns class ETLWritabl...
fedspendingtransparency/usaspending-api
usaspending_api/common/etl/postgres/etl_writable_object_base.py
etl_writable_object_base.py
py
3,685
python
en
code
265
github-code
97
[ { "api_name": "usaspending_api.common.etl.postgres.etl_object_base.ETLObjectBase", "line_number": 8, "usage_type": "name" }, { "api_name": "abc.ABCMeta", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 11, "usage_type": "name" }...
35704582488
import pyodbc import unittest from RentRepository import * from Rent import * class RentRepositoryTests(unittest.TestCase): def test_Save_Rent(self): cnxn = pyodbc.connect( 'DRIVER={ODBC Driver 17 for SQL Server};SERVER=USER-KOMPUTER\SQLEXPRESS;DATABASE=BikeRents;Trusted_Connection=yes') ...
orzecheudezet/BikeRentDB
Tests/TestRentRepository.py
TestRentRepository.py
py
833
python
en
code
0
github-code
97
[ { "api_name": "unittest.TestCase", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pyodbc.connect", "line_number": 9, "usage_type": "call" }, { "api_name": "pyodbc.connect", "line_number": 22, "usage_type": "call" } ]
33167013991
import requests import json import pandas as pd import numpy as np main_link = 'http://ws.audioscrobbler.com/2.0/' api_key = '2f02c90c31c2e91b33a8ced8162ec51e' headers = {'user-agent': 'GeekBrains'} params = { 'api_key': api_key, 'method': 'chart.gettopartists', 'format': 'json', 'page': 1 } get_link =...
roknikrol/GeekBrains_data_parsing
Lesson_1/lesson_1_Last_FM_API.py
lesson_1_Last_FM_API.py
py
1,256
python
en
code
0
github-code
97
[ { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 28, "usage_type": "call" }, { "api_name": "json.dump", "line_number...
4843974362
from PySide6.QtCore import Slot from data.ui.widgets.shikimori import Ui_Form from nlightreader.consts import LibList from nlightreader.dialogs import FormAuth from nlightreader.items import Manga, User from nlightreader.parsers import ShikimoriLib from nlightreader.utils import translate from nlightreader.widgets.Nli...
brandonzorn/Nlight
nlightreader/widgets/NlightTemplates/Shikimori.py
Shikimori.py
py
2,861
python
en
code
13
github-code
97
[ { "api_name": "nlightreader.widgets.NlightTemplates.BaseWidget.MangaItemBasedWidget", "line_number": 14, "usage_type": "name" }, { "api_name": "data.ui.widgets.shikimori.Ui_Form", "line_number": 17, "usage_type": "call" }, { "api_name": "nlightreader.widgets.NlightContainers.mang...
20381715641
import numpy as np import matplotlib.pyplot as plt class HMM(): def __init__(self): pass def train(self, pi, A, B): self.pi = pi self.A = A self.B = B def setO(self, O): self.O = O self.K = self.O.shape[0] def setI(self, I): self.I = ...
baowj-678/Machine-Learning
Hidden Markov Model/HMM.py
HMM.py
py
6,977
python
en
code
3
github-code
97
[ { "api_name": "numpy.dot", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.multiply", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.multiply", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number"...
7965937328
import gi import pathlib from ventanagrafico import VentanaGrafico from nuevo_simulacion import ejecutar import matplotlib.pyplot as plt gi.require_version(namespace='Gtk', version='4.0') gi.require_version(namespace='Adw', version='1') from gi.repository import Adw, Gtk, Gio, Pango, GObject Adw.init() def crear_gr...
ricardomacaya/proyecto-programacion
proyecto programacion/nuevo_main.py
nuevo_main.py
py
5,515
python
en
code
0
github-code
97
[ { "api_name": "gi.require_version", "line_number": 7, "usage_type": "call" }, { "api_name": "gi.require_version", "line_number": 8, "usage_type": "call" }, { "api_name": "gi.repository.Adw.init", "line_number": 12, "usage_type": "call" }, { "api_name": "gi.reposit...
144985560
import numpy as np import matplotlib.pylab as plt import torch from torch.nn import functional as F xs = np.asarray([[-10], [-8], [-6], [-4], [-2], [0], [2], [4], [6], [8], [10]]) ys = 0.5 * xs + 7 xs = np.hstack((xs, np.ones([xs.shape[0], 1]))) xs = torch.tensor(xs).float() ys = torch.tensor(ys).float() ins = 1...
bluescreen/diy-gpt
nn1.py
nn1.py
py
987
python
en
code
0
github-code
97
[ { "api_name": "numpy.asarray", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.hstack", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.tensor", "line_number"...
17290607093
# -*- coding: utf-8 -*- import wx def click_b1(event): frame.SetStatusText('clicked') frame.Refresh() frame.Update() application = wx.App() frame = wx.Frame(None, wx.ID_ANY, u"results", size=(900, 600), pos=(0, 0)) frame.CreateStatusBar() frame.SetStatusText("python-izm.com") #icon = wx.Icon("./Analize...
f3rctokyo/Recorder
Analizer/visualize.py
visualize.py
py
1,810
python
en
code
0
github-code
97
[ { "api_name": "wx.App", "line_number": 10, "usage_type": "call" }, { "api_name": "wx.Frame", "line_number": 11, "usage_type": "call" }, { "api_name": "wx.ID_ANY", "line_number": 11, "usage_type": "attribute" }, { "api_name": "wx.Notebook", "line_number": 19, ...
71427160000
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Aug 11 23:40:28 2021 @author: EmilioMartinez """ import os import tweepy import pandas as pd # Authenticate to Twitter twitter_authentication = tweepy.OAuthHandler("API Key", "API Secret") #API Key, API Secret are generated twitter_authentic...
EmilioCMartinez/TwitterBot
TermSearch.py
TermSearch.py
py
1,345
python
en
code
0
github-code
97
[ { "api_name": "tweepy.OAuthHandler", "line_number": 15, "usage_type": "call" }, { "api_name": "tweepy.API", "line_number": 23, "usage_type": "call" }, { "api_name": "tweepy.Cursor", "line_number": 39, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "...
11157159616
import argparse import os import readline import sys from optparse import make_option from time import sleep, time import etcd3 import grpc import requests from cmd2 import Cmd, options from consul import Consul from google.protobuf.empty_pb2 import Empty from simplejson import dumps from cli.device import DeviceCli ...
opencord/voltha
cli/main.py
main.py
py
34,455
python
en
code
77
github-code
97
[ { "api_name": "voltha.protos.third_party", "line_number": 26, "usage_type": "name" }, { "api_name": "os.environ.get", "line_number": 31, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 31, "usage_type": "attribute" }, { "api_name": "os.environ.g...
20499190706
import numpy as np import sys import csv import matplotlib.pyplot as plt def print_hi(name): # Use a breakpoint in the code line below to debug your script. print(f'Hi, {name}') # Press Ctrl+F8 to toggle the breakpoint. def printPic(x,y,name): plt.title('pic') colors=['red','yellow','green','blue','c...
DevilInChina/Bench_Scripts
drawer/draw.py
draw.py
py
1,128
python
en
code
0
github-code
97
[ { "api_name": "matplotlib.pyplot.title", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 11, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.scatter", "line_number": 15, "usage_type": "call" }, { "api_name": "m...
29152498339
from pyspark.sql import SparkSession from pyspark.sql import Row spark = SparkSession.builder.appName('filter-example').getOrCreate() sc = spark.sparkContext sc.setLogLevel("ERROR") def run(): print() student = spark.createDataFrame([ Row(name='Song', subject='English', term='Spring', score=80), ...
BigMountainTiger/aws-terraform-examples
glue-example/local-example/pyspark/dataframe/e-repartition-coalesce.py
e-repartition-coalesce.py
py
1,565
python
en
code
0
github-code
97
[ { "api_name": "pyspark.sql.SparkSession.builder.appName", "line_number": 4, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 4, "usage_type": "attribute" }, { "api_name": "pyspark.sql.SparkSession", "line_number": 4, "usage_type": "...
73045185919
import numpy as np import matplotlib.pyplot as plt #data generation X1, Y1 = np.random.multivariate_normal([4,4], [[1,0], [0, 1]], 100).T X2, Y2 = np.random.multivariate_normal([-3,3], [[1.5,0], [0, .5]], 100).T X3, Y3 = np.random.multivariate_normal([0,-3], [[1,0], [0, .75]], 100).T X = np.append(X1, X2) X = np.app...
jrexmo/K-Means
K-means.py
K-means.py
py
2,023
python
en
code
1
github-code
97
[ { "api_name": "numpy.random.multivariate_normal", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 6, "usage_type": "attribute" }, { "api_name": "numpy.random.multivariate_normal", "line_number": 7, "usage_type": "call" }, { "...
27841881921
from datetime import datetime import pykrige import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from sklearn.metrics import mean_squared_error import h5py import xarray as xr from sklearn.preprocessing import StandardScaler from sklearn.preprocessing import MinMaxScaler from sk...
big-data-lab-umbc/big-data-reu
2023-projects/team-1/Model Used/statistical approaches/UK_FirstPass_Final.py
UK_FirstPass_Final.py
py
11,535
python
en
code
2
github-code
97
[ { "api_name": "numpy.sqrt", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.argsort", "line_number": 31, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 35, "usage_type": "call" }, { "api_name": "matplotlib.pyplot...
20934316955
import unittest from mock import patch, MagicMock from rawes.elastic import Elastic from requests.models import Response from rawes.http_connection import HttpConnection class TestConnectionPooling(unittest.TestCase): """Connection pooling was added on top of Rawes, it wasn't designed from the beggingin. We ...
humangeo/rawes
tests/integration/connection_pool_integration_tests.py
connection_pool_integration_tests.py
py
1,839
python
en
code
107
github-code
97
[ { "api_name": "unittest.TestCase", "line_number": 9, "usage_type": "attribute" }, { "api_name": "rawes.elastic.Elastic", "line_number": 22, "usage_type": "call" }, { "api_name": "mock.patch", "line_number": 23, "usage_type": "call" }, { "api_name": "mock.MagicMock...
27995919395
from sklearn.metrics import mean_absolute_error,mean_squared_error def test_mean_absolute_error(): y_true=[1,1,1,1,1,2,2,2,0,0] y_pred=[0,0,0,1,1,1,0,0,0,0] print("Mean Absolute Error:",mean_absolute_error(y_true,y_pred)) def test_mean_squared_error(): y_true=[1,1,1,1,1,2,2,2,0,0] y_pred=[0,0,0,...
JasonK93/ML-note
12. Model evaluation/12.7 regression_metrics.py
12.7 regression_metrics.py
py
558
python
en
code
8
github-code
97
[ { "api_name": "sklearn.metrics.mean_absolute_error", "line_number": 8, "usage_type": "call" }, { "api_name": "sklearn.metrics.mean_absolute_error", "line_number": 14, "usage_type": "call" }, { "api_name": "sklearn.metrics.mean_squared_error", "line_number": 15, "usage_typ...
36462791270
#!../.env/bin/python3 import argparse import os import requests import http.server import socketserver import re from pathlib import Path from creds import TOKEN def handler_from_argparse(PATH): class HandleAll(http.server.SimpleHTTPRequestHandler): def __init__(self, *args, **kwargs): os.chdi...
robb666/nn
YOLOv5_cars/import_tasks.py
import_tasks.py
py
2,909
python
en
code
0
github-code
97
[ { "api_name": "http.server.server", "line_number": 13, "usage_type": "attribute" }, { "api_name": "http.server", "line_number": 13, "usage_type": "name" }, { "api_name": "os.chdir", "line_number": 15, "usage_type": "call" }, { "api_name": "creds.TOKEN", "line_...
41521231320
import argparse import colorsys import glob import json import os import shutil import sys import tqdm import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as patches import pycocotools.mask as rletools from PIL import Image from multiprocessing import Pool # from mots_common.io import load_se...
YangLiu14/AI-LearningBook
tracking/visualization.py
visualization.py
py
28,807
python
en
code
0
github-code
97
[ { "api_name": "os.path.dirname", "line_number": 34, "usage_type": "call" }, { "api_name": "os.path", "line_number": 34, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 34, "usage_type": "call" }, { "api_name": "json.load", "line_nu...
26463942824
# -*- coding: utf-8 -*- # @Time : 2020/8/24 9:22 # @Author : Bo Hu # @Email : hubosist@mail.ustc.edu.cn # @File : test_merge.py # @Software: PyCharm import os import cupy as cp import SimpleITK as sitk from tqdm import tqdm import numpy as np import time from skimage import morphology from merge...
liuxy1103/EMADS
Full_Brain_Soma_Segmentation_Pipeline/full_data_process2.0_seg/merge_func/test_merge.py
test_merge.py
py
1,350
python
en
code
5
github-code
97
[ { "api_name": "os.path.join", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 1...
2982378768
from fastapi.testclient import TestClient from utils.auth_utils import ADMIN_HEADER, BASIC_HEADER, MANAGER_HEADER category = {"name": "test", "description": "test"} def test_put_category_as_admin(client: TestClient): response = client.put( "/categoria/1", json=category, headers=ADMIN_HEA...
fga-eps-mds/2022-1-schedula-detalhador-de-chamados
tests/test_put_category.py
test_put_category.py
py
1,709
python
en
code
2
github-code
97
[ { "api_name": "fastapi.testclient.TestClient", "line_number": 8, "usage_type": "name" }, { "api_name": "utils.auth_utils.ADMIN_HEADER", "line_number": 12, "usage_type": "name" }, { "api_name": "fastapi.testclient.TestClient", "line_number": 20, "usage_type": "name" }, ...
29507185599
import pika import json from class_types import Endpoint import requests #connection = pika.BlockingConnection(pika.ConnectionParameters('localhost')) #channel = connection.channel() endpoints = {} with open("endpoints.json") as endpoints_config: data = json.load(endpoints_config) for idx,ep in enumerate(data[...
asriram1/Microservices-Python-Auction-Application
email_service/test_email_client.py
test_email_client.py
py
990
python
en
code
0
github-code
97
[ { "api_name": "json.load", "line_number": 10, "usage_type": "call" }, { "api_name": "class_types.Endpoint", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 21, "usage_type": "call" }, { "api_name": "json.dumps", "line_n...
42634767585
import numpy as np import torch from torch.optim.lr_scheduler import StepLR from collections import defaultdict from tqdm import tqdm from topmost.utils import static_utils # transform tensor list to numpy list def to_nparray(tensor_list): return np.asarray([item.detach().cpu().numpy() for item in tensor_list], d...
BobXWu/TopMost
topmost/trainers/hierarchical/hierarchical_trainer.py
hierarchical_trainer.py
py
3,967
python
en
code
89
github-code
97
[ { "api_name": "numpy.asarray", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.optim.Adam", "line_number": 31, "usage_type": "call" }, { "api_name": "torch.optim", "line_number": 31, "usage_type": "attribute" }, { "api_name": "torch.optim.lr_schedu...
14591202855
from typing import Union, Dict, List, AnyStr, Any, TextIO, Literal import tempfile import xmltodict from commons import * from varvault import ResourceNotFoundError vault_file_new = f"{DIR}/new-vault.xml" existing_vault = f"{DIR}/existing-vault.xml" class XmlResource(varvault.BaseResource): KEY = "VAULT" ...
data-ductus/varvault
tests/test_xml_vault.py
test_xml_vault.py
py
4,427
python
en
code
3
github-code
97
[ { "api_name": "varvault.BaseResource", "line_number": 13, "usage_type": "attribute" }, { "api_name": "typing.Literal", "line_number": 17, "usage_type": "name" }, { "api_name": "typing.TextIO", "line_number": 22, "usage_type": "name" }, { "api_name": "varvault.Reso...
23734284203
#Библиотеки import pygame import random import sys import time #Чтобы сделать задержку #Размер экрана MAX_X = 1366 MAX_Y = 768 #Количество снежинок MAX_SNOW = 150 #Размер снежинки SNOW_SIZE = 64 #В пикселях #Класс снежинки class Snow(): def __init__(self, x, y): #x и y - координаты снежинки """Инициализ...
froland-git/Python
ADV-IT_Lessons/For_beginners/PyGame/Lesson-28-SnowFall.py
Lesson-28-SnowFall.py
py
3,227
python
ru
code
0
github-code
97
[ { "api_name": "random.randint", "line_number": 23, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 24, "usage_type": "call" }, { "api_name": "pygame.image.load", "line_number": 26, "usage_type": "call" }, { "api_name": "pygame.image", "l...
12265773210
import torch from distributed_auto_differentiation.utils import dprint def power_iteration_BC(B, C, rank=3, numiterations=1, device='cuda', tol=1e-3, compute_sigma=True): """This function is the main workhorse of rank-dAD. The original function was written by Sergey Plis in numpy, then translated into...
bbradt/catalyst-dad
distributed_auto_differentiation/utils/power_iteration_BC.py
power_iteration_BC.py
py
3,994
python
en
code
0
github-code
97
[ { "api_name": "torch.mm", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.mm", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.mm", "line_number": 26, "usage_type": "call" }, { "api_name": "torch.mm", "line_number": 27, "usa...
32091764461
""" const $ = new Env("统计东哥历史红包"); 统计东哥历史红包 """ import requests import sys import re import time import os def gettimestamp(): return str(int(time.time() * 1000)) def printf(text): print(text) sys.stdout.flush() def getinfo(ck): isNext = True page = 1 sum = 0 usedsum = 0 count = 0...
JDWXX/jd_job
py/jd_hbtj.py
jd_hbtj.py
py
2,236
python
en
code
196
github-code
97
[ { "api_name": "time.time", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.stdout.flush", "line_number": 19, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 19, "usage_type": "attribute" }, { "api_name": "requests.get", "line_n...
74818885439
#MAP and REDUCE are very effective ways to handle data structure. Here are #Some examples. # 1. I have an array of Temperature in Degree F. I want to convert them to # Degree C. Use map to convert the temperature unit. DegreeF = [-40, 0,0,20,30,40, 50, 60, 70, 80, 90, 100, 110, 120, 320] def convert_F_to_C(T): ...
bhattaraiprabhat/Core_CS_Concepts_Using_Python
arrays/python_list_MAP_REDUCE.py
python_list_MAP_REDUCE.py
py
1,961
python
en
code
0
github-code
97
[ { "api_name": "random.randint", "line_number": 33, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 47, "usage_type": "call" }, { "api_name": "functools.reduce", "line_number": 52, "usage_type": "call" }, { "api_name": "functools.reduce", ...
35163472817
from fbs_runtime.application_context import ApplicationContext import sys import os import logging from PyQt5 import QtWidgets, QtGui, QtCore from PyQt5.QtWidgets import QMainWindow from PyQt5.QtCore import Qt, QThread, pyqtSignal, pyqtSlot from PIL import Image from fysom import FysomError from ayab.ayab_gui impor...
AllYarnsAreBeautiful/ayab-desktop
src/main/python/ayab/ayab.py
ayab.py
py
19,717
python
en
code
45
github-code
97
[ { "api_name": "logging.basicConfig", "line_number": 26, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 27, "usage_type": "attribute" }, { "api_name": "logging.StreamHandler", "line_number": 30, "usage_type": "call" }, { "api_name": "logging....
41921107844
from Birds.models import Finch from django.views.generic import TemplateView from django.shortcuts import render, get_object_or_404 from django.http import HttpResponseRedirect, HttpResponse from django.urls import reverse from django.template import loader from django.views import generic from django.views.ge...
dherc323/SoberDB
SoberDB/Birds/views.py
views.py
py
2,041
python
en
code
0
github-code
97
[ { "api_name": "django.shortcuts.render", "line_number": 15, "usage_type": "call" }, { "api_name": "django.views.generic.ListView", "line_number": 18, "usage_type": "attribute" }, { "api_name": "django.views.generic", "line_number": 18, "usage_type": "name" }, { "a...
24280997153
from pycountry import countries from webapp.services.import_services.models import LocationUpdate, BusinessUpdate, EvseUpdate, ConnectorUpdate, RegularHoursUpdate, \ ExceptionalPeriodUpdate, ImageUpdate from webapp.services.import_services.ocpi.ocpi_validators import LocationInput, EvseInput, ConnectorInput, Busin...
binary-butterfly/ocpdb
webapp/services/import_services/ocpi/ocpi_mapper.py
ocpi_mapper.py
py
4,966
python
en
code
3
github-code
97
[ { "api_name": "webapp.services.import_services.ocpi.ocpi_validators.LocationInput", "line_number": 10, "usage_type": "name" }, { "api_name": "webapp.services.import_services.models.LocationUpdate", "line_number": 11, "usage_type": "call" }, { "api_name": "pycountry.countries.get"...
20415596185
import os import PySimpleGUI as sg sg.theme('DarkAmber') close_window_action = "Ja!" print("Vilka snälla kollegor jag har") file_selector_column = [ [ sg.Text("File Browser"), sg.In(size=(25,1), enable_events=True, key="-FOLDER-"), sg.FolderBrowse(), ], [ sg.Listbox( ...
hankOlofs/KSLPythonCourse
gui/pdf_tool.py
pdf_tool.py
py
1,457
python
en
code
0
github-code
97
[ { "api_name": "PySimpleGUI.theme", "line_number": 4, "usage_type": "call" }, { "api_name": "PySimpleGUI.Text", "line_number": 10, "usage_type": "call" }, { "api_name": "PySimpleGUI.In", "line_number": 11, "usage_type": "call" }, { "api_name": "PySimpleGUI.FolderBr...
32477967806
from setuptools import setup with open("README.md", "r") as fh: long_description = fh.read() setup( name='django-bazaar-of-wonders', author='https://github.com/Bazaar-Trader', version='0.1.40', description='Bazaar of Wonders is a Django-based web application that aggregates card details and p...
dorianmeade/Bazaar_Of_Wonders
setup.py
setup.py
py
1,116
python
en
code
0
github-code
97
[ { "api_name": "setuptools.setup", "line_number": 6, "usage_type": "call" } ]
6537259498
from selenium import webdriver # http://pythonclub.com.br/selenium-parte-1.html from selenium.webdriver.common.keys import Keys # https://stackoverflow.com/questions/1629053/typing-enter-return-key-in-selenium from selenium.webdriver.common.by import By # https://selenium-python.readthedocs.io/waits.html#explicit-waits...
luizfgnmaia/FDS-Homeworks
hw1/scrape_scholar.py
scrape_scholar.py
py
2,371
python
en
code
0
github-code
97
[ { "api_name": "selenium.webdriver.Firefox", "line_number": 11, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 11, "usage_type": "name" }, { "api_name": "selenium.webdriver.support.ui.WebDriverWait", "line_number": 15, "usage_type": "call" }, ...
25959573249
import itertools import os.path import torch from data import * from models import * from sklearn.metrics import confusion_matrix from tqdm import tqdm device = torch.device('cuda' if torch.cuda.is_available() else "cpu") print(f'Using {device}') generator = torch.Generator() generator.manual_seed(5757) def train...
dirisiom/cse803final
train.py
train.py
py
5,502
python
en
code
1
github-code
97
[ { "api_name": "torch.device", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 11, "usage_type": "attribute" }, { "api_name": "torch.Generator"...
8403035426
import logging import os import subprocess from datetime import date from flask import Flask,render_template,request from logging.handlers import RotatingFileHandler app=Flask(__name__) @app.route('/') def main_page(): # will display main game page year = date.today().year return render_template('index.ht...
ps/tic_tac_toe
__init__.py
__init__.py
py
2,074
python
en
code
0
github-code
97
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.date.today", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 13, "usage_type": "name" }, { "api_name": "flask.render_template", ...
6879236429
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Audio solving module. """ import os import random import shutil import tempfile from asyncio import TimeoutError, CancelledError from aiohttp.client_exceptions import ClientError from nonocaptcha import util from nonocaptcha.speech import Amazon, Azure, Sphinx, Deep...
mikeyy/nonoCAPTCHA
nonocaptcha/audio.py
audio.py
py
4,567
python
en
code
893
github-code
97
[ { "api_name": "nonocaptcha.base.Base", "line_number": 19, "usage_type": "name" }, { "api_name": "nonocaptcha.exceptions.DownloadError", "line_number": 33, "usage_type": "name" }, { "api_name": "nonocaptcha.exceptions.ReloadError", "line_number": 35, "usage_type": "name" ...
1780131653
import requests from bs4 import BeautifulSoup import pandas as pd import re import click from datetime import date, datetime import os HEADERS={ 'Referrer-Policy':'origin-when-cross-origin', 'User-Agent': "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005....
reoneo97/gb-menu-scrape
scrape.py
scrape.py
py
2,644
python
en
code
0
github-code
97
[ { "api_name": "click.echo", "line_number": 16, "usage_type": "call" }, { "api_name": "click.echo", "line_number": 17, "usage_type": "call" }, { "api_name": "click.prompt", "line_number": 18, "usage_type": "call" }, { "api_name": "click.echo", "line_number": 19...
72009852478
import pytest from decorator import name, greeting_decorator, nickname, farewell_decorator def test_name_decorator(): actual = name('bob') expected = 'Hello there, bob' assert actual == expected def test_nicknname_farewell(): actual = nickname('Tim') expected = 'Well, Tim, It\'s been real. Take c...
kmangub/pythonisms
test_decorator.py
test_decorator.py
py
355
python
en
code
0
github-code
97
[ { "api_name": "decorator.name", "line_number": 5, "usage_type": "call" }, { "api_name": "decorator.nickname", "line_number": 11, "usage_type": "call" } ]
33942944451
from pyramid.config import Configurator from sqlalchemy import engine_from_config from pyramid.authentication import AuthTktAuthenticationPolicy from pyramid.authorization import ACLAuthorizationPolicy from models import * from pyramid.session import SignedCookieSessionFactory from pyramid.security import Allow, Deny, ...
Hasuni/Kursovaya-Rabota
pyramid_blogr/__init__.py
__init__.py
py
1,751
python
en
code
0
github-code
97
[ { "api_name": "pyramid.session.SignedCookieSessionFactory", "line_number": 9, "usage_type": "call" }, { "api_name": "pyramid.security.Allow", "line_number": 14, "usage_type": "name" }, { "api_name": "pyramid.security.Everyone", "line_number": 14, "usage_type": "name" },...
42141378575
import logging from django.conf import settings from slack_sdk import WebClient from slack_sdk.errors import SlackApiError from avanan.slack.models import SQSQueue logger = logging.getLogger(__name__) def get_slack_webclient(): return WebClient(token=settings.SLACK_USER_TOKEN) def produce_sqs(message): ...
elyak123/avanan-home-assignment
avanan/slack/utils.py
utils.py
py
849
python
en
code
1
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "slack_sdk.WebClient", "line_number": 14, "usage_type": "call" }, { "api_name": "django.conf.settings.SLACK_USER_TOKEN", "line_number": 14, "usage_type": "attribute" }, { "...
11946779481
from sentence_transformers.losses import CosineSimilarityLoss from setfit import SetFitModel, SetFitTrainer from setup_utils import seed_everything, MODEL_SEED def do_setfit(args, train_ds, val_ds, config_dict=None): if len(set(train_ds['labels'])) != 2: metric = 'f1' else: metric = 'ap' i...
UKPLab/lagonn
use_setfit.py
use_setfit.py
py
1,783
python
en
code
24
github-code
97
[ { "api_name": "setup_utils.MODEL_SEED", "line_number": 13, "usage_type": "name" }, { "api_name": "setup_utils.seed_everything", "line_number": 17, "usage_type": "call" }, { "api_name": "setup_utils.MODEL_SEED", "line_number": 17, "usage_type": "argument" }, { "api...
71698474879
#!/usr/bin/env python3 # Based on https://python101.readthedocs.io/pl/latest/pygame/pong/# import pygame from typing import Type import skfuzzy as fuzz import skfuzzy.control as fuzzcontrol FPS = 30 class Board: def __init__(self, width: int, height: int): self.surface = pygame.display.set_mode((width, h...
moginski01/ArtificialIntelligence-basics
9/zad9.py
zad9.py
py
13,209
python
en
code
0
github-code
97
[ { "api_name": "pygame.display.set_mode", "line_number": 13, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pygame.display.set_caption", "line_number": 14, "usage_type": "call" }, { "api_name":...
29400266127
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Tue Mar 20 21:14:04 2018 @author: Paris """ import numpy as np import matplotlib.pyplot as plt from pyDOE import lhs from scipy.interpolate import griddata from models_tf import DarcyNet2D np.random.seed(1234) if __name__ == "__main__": datase...
paraklas/DarcyNets
main.py
main.py
py
2,707
python
en
code
8
github-code
97
[ { "api_name": "numpy.random.seed", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 16, "usage_type": "attribute" }, { "api_name": "numpy.load", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.random.choice", ...
29698845451
from typing import Optional from db.models.user import User from sqlalchemy import ( select, ) from app.crud.base import CRUDBase from app.schemas.user import ( UserFiltersSchema, UserOrderingSchema, UserOrderingAsc, UserOrderingDesc, UserOrderingRoleAsc, UserOrderingRoleDesc, ) from sqlalc...
SergioMustang/bsl_pdp_api
app/crud/user_crud.py
user_crud.py
py
3,408
python
en
code
0
github-code
97
[ { "api_name": "app.crud.base.CRUDBase", "line_number": 25, "usage_type": "name" }, { "api_name": "sqlalchemy.select", "line_number": 31, "usage_type": "call" }, { "api_name": "db.models.user.User", "line_number": 31, "usage_type": "argument" }, { "api_name": "db.m...
73346603519
import os import matplotlib.pyplot as plt from wordcloud import WordCloud, STOPWORDS from PIL import Image import requests import copy import traceback # import paddle # paddle.enable_static import jieba # jieba.enable_paddle() from nonebot import on_command, CommandSession, scheduler, get_bot, MessageSegment from ut...
falcon-hayaki/nonebot_plugins
plugins/wordcloud/main.py
main.py
py
4,734
python
en
code
0
github-code
97
[ { "api_name": "nonebot.get_bot", "line_number": 33, "usage_type": "call" }, { "api_name": "os.system", "line_number": 36, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 36, "usage_type": "call" }, { "api_name": "os.path", "line_number": 3...
39497716442
''' ComboBox ======= Based on Spinner ''' __all__ = ('ComboBox', 'ComboBoxOption') from kivy.properties import ListProperty, ObjectProperty, BooleanProperty from kivy.uix.button import Button from kivy.uix.dropdown import DropDown from kivy.lang import Builder Builder.load_string(''' <ComboBoxOption>: size_hin...
AXErunners/electrum-axe
electrum_axe/gui/kivy/uix/combobox.py
combobox.py
py
2,490
python
en
code
224
github-code
97
[ { "api_name": "kivy.lang.Builder.load_string", "line_number": 16, "usage_type": "call" }, { "api_name": "kivy.lang.Builder", "line_number": 16, "usage_type": "name" }, { "api_name": "kivy.uix.button.Button", "line_number": 29, "usage_type": "name" }, { "api_name":...
20836739900
import typing from alembic.config import Config as AlembicConfig from alembic.command import upgrade from configman import ConfigMan from toolbelt.cli import Command, Argument if typing.TYPE_CHECKING: from .config import Config class MigratorConfig(ConfigMan): revision: str = "head" sql_only: bool = F...
mmohaveri/flask-sqlalchemy-cookiecutter-template
{{cookiecutter.directory_name}}/{{cookiecutter.project_name}}/cmd/migrate.py
migrate.py
py
1,099
python
en
code
0
github-code
97
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 10, "usage_type": "attribute" }, { "api_name": "configman.ConfigMan", "line_number": 14, "usage_type": "name" }, { "api_name": "alembic.config.Config", "line_number": 21, "usage_type": "call" }, { "api_name": "c...
1206938422
import os import progressbar from glob import glob import pickle import numpy as np from sklearn.neural_network import MLPClassifier from sklearn.model_selection import train_test_split from sklearn.preprocessing import MinMaxScaler from sklearn import metrics import cv2 import mahotas as mt from skimage import featu...
igor-morawski/exercises
Semantic_Segmentation(Features+NN)/train.py
train.py
py
7,212
python
en
code
0
github-code
97
[ { "api_name": "sklearn.metrics.precision_score", "line_number": 30, "usage_type": "call" }, { "api_name": "sklearn.metrics", "line_number": 30, "usage_type": "name" }, { "api_name": "numpy.unique", "line_number": 31, "usage_type": "call" }, { "api_name": "sklearn....
39097385303
from jit_code_generator import * from collections import defaultdict class AstVisitor: def __init__(self): #self.output = open(filename, 'w') self.code_generator = CodeGenerator() #list of dicts self.env = [defaultdict(lambda:None)] def enter_scope(self, env): self.env....
kcecireyes/JIT
jit_ast_visitor.py
jit_ast_visitor.py
py
5,212
python
en
code
1
github-code
97
[ { "api_name": "collections.defaultdict", "line_number": 9, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 113, "usage_type": "call" } ]
71421224638
""" URL mappings for the user API. """ from django.urls import path from modules.users import views app_name = 'auth' urlpatterns = [ path('register/', views.CreateUserView.as_view(), name='register'), path('login/', views.CreateTokenView.as_view(), name='login'), path('logout/', views.LogoutUserView.as...
codigoenlaweb/spotify-drf-api
modules/users/urls.py
urls.py
py
406
python
en
code
0
github-code
97
[ { "api_name": "django.urls.path", "line_number": 12, "usage_type": "call" }, { "api_name": "modules.users.views.CreateUserView.as_view", "line_number": 12, "usage_type": "call" }, { "api_name": "modules.users.views.CreateUserView", "line_number": 12, "usage_type": "attrib...
73440051840
from pathlib import Path def main(): workingdirectory = Path.cwd() #here we define an empty array: newfilelist = [] #languages is a python dictionary #left value is the abbreviation we have in our filesnames #right value is the function name in our code that handles that language language...
jackfruh/forMajid
convert_usingDictionary.py
convert_usingDictionary.py
py
3,288
python
en
code
0
github-code
97
[ { "api_name": "pathlib.Path.cwd", "line_number": 4, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 4, "usage_type": "name" } ]
8371363293
import matplotlib.pyplot as plt from sklearn.metrics import roc_curve, roc_auc_score, auc, confusion_matrix import numpy as np import re import os def print_confusion_as_csv(eng_abbrs, confusion_matrix): _confusion_matrix = confusion_matrix.tolist() LEN = len(eng_abbrs) print('-, ', end='') for abbr i...
yshsu0918/multilayer-goterm-predict
analysis.py
analysis.py
py
2,306
python
en
code
1
github-code
97
[ { "api_name": "sklearn.metrics.confusion_matrix.tolist", "line_number": 8, "usage_type": "call" }, { "api_name": "sklearn.metrics.confusion_matrix", "line_number": 8, "usage_type": "name" }, { "api_name": "sklearn.metrics.roc_curve", "line_number": 26, "usage_type": "call...
21674040103
import random import numpy as np from torch.utils.data.dataset import Dataset from src.datasets.bengali import IMAGE_KEY, INPUT_KEYS from src.utils.utils import rand_bbox, to_one_hot class CutMixUpDataset(Dataset): def __init__(self, dataset, image_key, input_k...
smivv/kaggle-bengali
src/datasets/bengali/cutmix.py
cutmix.py
py
1,765
python
en
code
0
github-code
97
[ { "api_name": "torch.utils.data.dataset.Dataset", "line_number": 10, "usage_type": "name" }, { "api_name": "numpy.random.rand", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 34, "usage_type": "attribute" }, { "api_name": "...
29793132601
# @Time : 2021/5/25 17:28 # @Author : lucas # @File : auth_gitee_request.py # @Project : SSO # @Software: PyCharm import requests from request.auth_base_request import AuthBaseRequest from auth_source import AuthSource from utils.utils import build_url class AuthGiteeRequest(AuthBaseRequest): # https://git...
lucas234/OauthDemo
request/auth_gitee_request.py
auth_gitee_request.py
py
1,992
python
en
code
0
github-code
97
[ { "api_name": "request.auth_base_request.AuthBaseRequest", "line_number": 12, "usage_type": "name" }, { "api_name": "auth_source.AuthSource.GITEE", "line_number": 14, "usage_type": "attribute" }, { "api_name": "auth_source.AuthSource", "line_number": 14, "usage_type": "na...