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
24605926525
from Message import Message from flask import request, abort from linebot import ( LineBotApi, WebhookHandler ) from linebot.exceptions import ( InvalidSignatureError ) from linebot.models import ( MessageEvent, TextMessage, TextSendMessage ) from re import match as re_match class LINE(object): @staticmethod def...
hans00/MessageBot
Core/LINE.py
LINE.py
py
3,189
python
en
code
0
github-code
6
[ { "api_name": "linebot.LineBotApi", "line_number": 30, "usage_type": "call" }, { "api_name": "linebot.WebhookHandler", "line_number": 31, "usage_type": "call" }, { "api_name": "linebot.models.MessageEvent", "line_number": 32, "usage_type": "argument" }, { "api_nam...
4753839454
from util import * from datetime import datetime class Agent: def __init__(self, index=0): self.index = index def getAction(self, state): raiseNotDefined() # Напрямики для пересування гравця та ворогів class Directions: NORTH = 'North' SOUTH = 'South' EAST = 'East' WEST = 'We...
VW-Passat/Lab03
game.py
game.py
py
10,994
python
uk
code
0
github-code
6
[ { "api_name": "io.StringIO", "line_number": 288, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 292, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 292, "usage_type": "name" } ]
8408005394
#!/usr/bin/env python3 import os import sys import re import argparse import json import signal import logging import requests from multi_accounts_handler import MultiAccountsHandler BANNER = ''' _____ __ __ ______ _ _ |_ _| /\ | \/ | ____(_) | | | | ...
prisma-cloud/IAMFinder
iamfinder.py
iamfinder.py
py
10,096
python
en
code
102
github-code
6
[ { "api_name": "sys.exit", "line_number": 26, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 29, "usage_type": "call" }, { "api_name": "logging.error", "line_number": 35, "usage_type": "call" }, { "api_name": "logging.info", "line_number":...
41974618883
from django import forms from polls.models import Question def get_choices(): # choiceList = [ # (1, 'aaa'), # (2, 'bbb'), # (3, 'CCC'), # ] object = Question.objects.first() choiceList = [(i.pk, i.choice_text) for i in object.choice_set.all()] return choiceList ''' cla...
pybest/Book1-vote-CBV
pollsCBV/polls_new/forms.py
forms.py
py
1,478
python
en
code
0
github-code
6
[ { "api_name": "polls.models.Question.objects.first", "line_number": 13, "usage_type": "call" }, { "api_name": "polls.models.Question.objects", "line_number": 13, "usage_type": "attribute" }, { "api_name": "polls.models.Question", "line_number": 13, "usage_type": "name" ...
25352444520
# coding: utf-8 __author__ = "humkyung <humkyung.atools.co.kr>" import vtk from .SceneObject import SceneObject class Cylinder(SceneObject): """A template for drawing a cylinder.""" def __init__(self, renderer, pt1=(0, 0, 0), pt2=(0, 0, 10), radius: float = 0.5): """Initialize the cylinder.""" ...
humkyung/AViewer
Primitives/Cylinder.py
Cylinder.py
py
1,898
python
en
code
2
github-code
6
[ { "api_name": "SceneObject.SceneObject", "line_number": 9, "usage_type": "name" }, { "api_name": "vtk.vtkLineSource", "line_number": 47, "usage_type": "call" }, { "api_name": "vtk.vtkTubeFilter", "line_number": 52, "usage_type": "call" }, { "api_name": "vtk.vtkPol...
70714257467
from smol_evm.opcodes import assemble, PUSH, RETURN, MLOAD, MSTORE, MSTORE8, MSIZE from smol_evm.memory import Memory, InvalidMemoryAccess, InvalidMemoryValue from smol_evm.runner import run import pytest @pytest.fixture def memory() -> Memory: return Memory() def store0(memory, offset): memory.store(offset,...
karmacoma-eth/smol-evm
tests/test_memory.py
test_memory.py
py
3,828
python
en
code
165
github-code
6
[ { "api_name": "smol_evm.memory.Memory", "line_number": 9, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 7, "usage_type": "attribute" }, { "api_name": "smol_evm.memory.Memory", "line_number": 8, "usage_type": "name" }, { "api_name": "pytest...
19289265217
from asgiref.sync import async_to_sync from channels.layers import get_channel_layer from turbo import get_broadcast_channel class BroadcastableMixin(object): def get_streams(self): """ Allow subscribing to streams for objects by their primary key (single updates), or any ForeignKey pre...
davish/hotwire-django-demo-chat
turbo/mixins.py
mixins.py
py
1,360
python
en
code
10
github-code
6
[ { "api_name": "channels.layers.get_channel_layer", "line_number": 22, "usage_type": "call" }, { "api_name": "turbo.get_broadcast_channel", "line_number": 27, "usage_type": "call" }, { "api_name": "asgiref.sync.async_to_sync", "line_number": 29, "usage_type": "call" } ]
11471722
import logging import logging.config import traceback import os class LogHelper(): LOGGING = { 'version': 1, 'disable_existing_loggers': True, 'formatters': { 'verbose': { 'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s' ...
vinhtk/vsum
log_helper.py
log_helper.py
py
1,803
python
pt
code
0
github-code
6
[ { "api_name": "os.makedirs", "line_number": 46, "usage_type": "call" }, { "api_name": "logging.config.dictConfig", "line_number": 47, "usage_type": "call" }, { "api_name": "logging.config", "line_number": 47, "usage_type": "attribute" }, { "api_name": "logging.get...
29209748500
import os import ast import random import string import subprocess from _ast import Call, ImportFrom from pathlib import Path from typing import List, Optional, Tuple, Any, Callable from tests4py.grammars.fuzzer import Grammar from tests4py.grammars.fuzzer import is_valid_grammar from tests4py.constants import PYTHON...
smythi93/Tests4Py
src/tests4py/projects/expression.py
expression.py
py
9,449
python
en
code
8
github-code
6
[ { "api_name": "tests4py.projects.Project", "line_number": 23, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 29, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 29, "usage_type": "name" }, { "api_name": "typing.List", ...
72581105467
import subprocess import numpy as np import datetime now = datetime.datetime.now() def extract_contributions(): # Looks at the GWM out file and extracts well names and contributions # Assumes only one instance of "OPTIMAL RATES FOR EACH FLOW VARIABLE" start_string0 = "Groundwater Management Solution" ...
Fleford/EO_Aberdeen
EOWPP_Aberdeen/GWM_Manipulator_abr.py
GWM_Manipulator_abr.py
py
17,991
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 4, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 4, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.append",...
16377133086
import shapely.geometry as geometry from shapely.geometry import Polygon from itertools import zip_longest import numpy as np import random from scipy.spatial import ConvexHull from ligo.skymap.io import fits from ligo.skymap.postprocess import find_greedy_credible_levels import healpy as hp from spherical_geometry.pol...
nihargupte-ph/GW-Localization-Tiling
misc_functions.py
misc_functions.py
py
19,875
python
en
code
2
github-code
6
[ { "api_name": "itertools.zip_longest", "line_number": 70, "usage_type": "call" }, { "api_name": "shapely.geometry.mapping", "line_number": 86, "usage_type": "call" }, { "api_name": "shapely.geometry", "line_number": 86, "usage_type": "name" }, { "api_name": "shape...
40411387361
#!/usr/bin/env python3 our_version = 108 script_name = "rib_summary" """ Name: rib_summary.py Description: NXAPI: display ipv4/ipv6 RIB summary Example output: % ./rib_summary.py --vault hashicorp --devices cvd_leaf_1 --ipv4 TOTALS 172.22.150.102 cvd-1311-leaf vrf ver routes paths defaul...
allenrobel/nxapi-netbox
scripts/rib_summary.py
rib_summary.py
py
7,840
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 68, "usage_type": "call" }, { "api_name": "nxapi_netbox.args.args_cookie.ArgsCookie", "line_number": 70, "usage_type": "name" }, { "api_name": "nxapi_netbox.args.args_nxapi_tools.ArgsNxapiTools", "line_number": 70, "...
7610509170
from ctypes.wintypes import SIZE from dice import * from random import randint import matplotlib.pyplot as plt import numpy as np from mpi4py import MPI from math import sqrt def simulation(f_events, f_sides, f_n_dice): f_X = dice(sides, n_dice).myDice() #Nested dictionary composed of dices (last dict stores the s...
davidmcarreira/parallel-computing
Ex4/ex1.py
ex1.py
py
5,064
python
en
code
0
github-code
6
[ { "api_name": "random.randint", "line_number": 14, "usage_type": "call" }, { "api_name": "mpi4py.MPI.COMM_WORLD", "line_number": 25, "usage_type": "attribute" }, { "api_name": "mpi4py.MPI", "line_number": 25, "usage_type": "name" }, { "api_name": "mpi4py.MPI.Wtime...
73549681468
__doc__ = """ Preprocessing of image training dataset and images for prediction. Ver 1.0 -- preprocessing.py Aslak Einbu Februar 2020. """ import cv2 import config def preprocess(image): """ Preprocessing of images applied in training and predictions. """ image = cv2.cvtColor(image, cv2.COLOR_BGR2GRA...
aslake/family_deep_learning
preprocessing.py
preprocessing.py
py
462
python
en
code
1
github-code
6
[ { "api_name": "cv2.cvtColor", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 15, "usage_type": "attribute" }, { "api_name": "cv2.resize", "line_number": 17, "usage_type": "call" }, { "api_name": "config.model_img_dims...
27010089698
import numpy as np from sklearn.preprocessing import OrdinalEncoder def run(array, label_index, categories, dtype): x = np.array(array) if dtype == 'float': dtype = np.float elif dtype == 'int': dtype = np.int elif dtype == 'object': dtype = np.object elif dtype == 'bool': ...
lisunshine1234/mlp-algorithm-python
pretreatment/standardization/OrdinalEncoder/run.py
run.py
py
1,135
python
en
code
0
github-code
6
[ { "api_name": "numpy.array", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.float", "line_number": 8, "usage_type": "attribute" }, { "api_name": "numpy.int", "line_number": 10, "usage_type": "attribute" }, { "api_name": "numpy.object", "line_nu...
1900491900
from django.urls import path from django.conf.urls.static import static from . import views from django.conf import settings urlpatterns = [ path('', views.index, name='index'), path('dashboard/', views.dashboard, name='dashboard'), path('order-summary/', views.OrderSummaryView.as_view(), name='order-summa...
wittymindstech/npk-shipping-web
NPK/orders/urls.py
urls.py
py
761
python
en
code
1
github-code
6
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", ...
31928041852
# -*- Coding: utf-8 -*- import chunk from sre_parse import FLAGS from tkinter import ttk import math from tkinter import ttk import numpy as np #------------------------------------------------------------------------------------------- import matplotlib import matplotlib.pyplot as plt from matplotlib.pylab import m...
DarBEJ2903/Python-digital-speech-processing
PRY_FINAL/clase_starend_work.py
clase_starend_work.py
py
5,033
python
en
code
0
github-code
6
[ { "api_name": "pyaudio.PyAudio", "line_number": 36, "usage_type": "call" }, { "api_name": "pyaudio.paInt16", "line_number": 44, "usage_type": "attribute" }, { "api_name": "scipy.io.wavfile.read", "line_number": 58, "usage_type": "call" }, { "api_name": "scipy.io.w...
86569808344
import argparse import ctypes import logging import re from datetime import datetime from mako.template import Template from pycparser import parse_file, c_ast logger = logging.getLogger('hwdb') template = """/* * Copyright © 2024 Igalia S.L. * SPDX-License-Identifier: MIT */ #pragma once #include <stdint.h> ty...
sailfishos-mirror/mesa
src/etnaviv/hwdb/hwdb.h.py
hwdb.h.py
py
11,242
python
en
code
1
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "pycparser.c_ast.NodeVisitor", "line_number": 83, "usage_type": "attribute" }, { "api_name": "pycparser.c_ast", "line_number": 83, "usage_type": "name" }, { "api_name": "re....
10230305545
import json # %% filepath = "/evals/registry/data/theory_of_mind/tomi/train.txt" lines, datapoints = [], [] with open(filepath, "r") as f: for line in f: line_index = line.split(" ")[0] if int(line_index) == 1: if len(lines) == 0: lines.append(line) else: ...
openai/evals
evals/elsuite/theory_of_mind/scripts/data_generation.py
data_generation.py
py
3,048
python
en
code
12,495
github-code
6
[ { "api_name": "json.dumps", "line_number": 47, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 55, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 70, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 80, ...
28237512561
# coding: utf-8 rub = io.read("rubrene.cif") get_ipython().magic(u'cd rubrene/') rub = io.read("rubrene.cif") view(rub) frag1 = io.read("dimers/dimer_4_0_d-7.19A.xyz") frag1.edit frag1.edit() frag1 from scipy.spatial import ConvexHull hull = ConvexHull(frag1.get_positions()) hull.vertices hull.neighbors hull.vertices p...
schober-ch/fodft_tools
rubrene/convex_hull.py
convex_hull.py
py
1,316
python
en
code
0
github-code
6
[ { "api_name": "scipy.spatial.ConvexHull", "line_number": 11, "usage_type": "call" }, { "api_name": "scipy.spatial.ConvexHull", "line_number": 23, "usage_type": "call" }, { "api_name": "scipy.spatial.spatial.convex_hull_plot_2d", "line_number": 30, "usage_type": "call" }...
12458879132
from collections import namedtuple Person = namedtuple("Person", "name age job_title is_vegetarian") person_1 = Person("Zsolt", 31, "instructor", False) person_2 = Person("Eugene", 28, "instructor", False) print(person_1.name) print(person_2.age)
stephenh369/python_course
day_1/namedtuples.py
namedtuples.py
py
250
python
en
code
0
github-code
6
[ { "api_name": "collections.namedtuple", "line_number": 3, "usage_type": "call" } ]
26775656201
# -*- coding:utf-8 -*- from inspector import getargspec from functools import wraps def check_user(f): an, av, kw, d = getargspec() @wraps(f) def _(*a, **kw): _a = dict(zip(an, a)) user_id = _a.pop('user_id', None) if not user_id: raise Exception('function must contains ...
tonicbupt/antonidas
utils/__init__.py
__init__.py
py
371
python
en
code
0
github-code
6
[ { "api_name": "inspector.getargspec", "line_number": 6, "usage_type": "call" }, { "api_name": "functools.wraps", "line_number": 7, "usage_type": "call" } ]
41855231369
# -*- coding: utf-8 -*- import sys, signal from json import loads from colorama import Fore, init from db.books import BooksDB from translation.bootstrap import Treino from extractors.noticias import Source with open("config.json") as f: configs = loads(f.read()) b = BooksDB(configs["db_uri"]) debug =...
viniciussilvaramos/pyrobotteacher
app.py
app.py
py
1,219
python
en
code
0
github-code
6
[ { "api_name": "json.loads", "line_number": 11, "usage_type": "call" }, { "api_name": "db.books.BooksDB", "line_number": 12, "usage_type": "call" }, { "api_name": "extractors.noticias.Source", "line_number": 15, "usage_type": "call" }, { "api_name": "translation.bo...
32653142106
import psutil as ps import re import os import netifaces as net #used for gathering network information # mimic the whole psutil module class networkData(): # list of interface identifiers def allNICs(self): return os.listdir('/sys/class/net/') # get address of a particular interface def addressForInterface(s...
trishu99/Platypus
api/networkData.py
networkData.py
py
2,218
python
en
code
0
github-code
6
[ { "api_name": "os.listdir", "line_number": 11, "usage_type": "call" }, { "api_name": "netifaces.ifaddresses", "line_number": 16, "usage_type": "call" }, { "api_name": "netifaces.interfaces", "line_number": 22, "usage_type": "call" }, { "api_name": "netifaces.inter...
33010150844
import pickle import torch.nn.functional as F from torch.nn.modules.module import register_module_backward_hook from torch_geometric.nn import ChebConv from torch.nn import ReLU import numpy as np import torch import argparse import sys, random import os with open("./syntheticdata", "rb") as f: data_list = pickle....
farhibahsan/Synthetic-Data-Generation
train.py
train.py
py
4,628
python
en
code
0
github-code
6
[ { "api_name": "pickle.load", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 15, "usage_type": "attribute" }, { "api_name": "torch_geometric.nn.ChebConv", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.nn.Parame...
16986926497
from django.db import models from django.forms import model_to_dict import datetime from core.modelo_base import ModeloBaseDos from core.miembros.choices import gender_choices, estado from config.settings import MEDIA_URL, STATIC_URL # Sociedad Cientifica class SCientificaModel(ModeloBaseDos): nombre = models.Cha...
mhidalgo94/project-goac
core/miembros/models.py
models.py
py
3,618
python
es
code
1
github-code
6
[ { "api_name": "core.modelo_base.ModeloBaseDos", "line_number": 10, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 11, "usage_type": "call" }, { "api_name": "django.db.models", "line_number": 11, "usage_type": "name" }, { "api_na...
29104445755
from django.urls import reverse from rest_framework import status from rest_framework.test import APITestCase from ...models import Subscribe class TestSubscribeView(APITestCase): def setUp(self): self.url = reverse('subscribe-list') def test_create_subscribe(self): data = {'email': 'foo@bar...
crowd-tools/CrowdClick
ad_source/tests/view_sets/test_subscribe.py
test_subscribe.py
py
740
python
en
code
3
github-code
6
[ { "api_name": "rest_framework.test.APITestCase", "line_number": 8, "usage_type": "name" }, { "api_name": "django.urls.reverse", "line_number": 10, "usage_type": "call" }, { "api_name": "rest_framework.status.HTTP_201_CREATED", "line_number": 15, "usage_type": "attribute" ...
5595718046
# Iago Leonardo Alves de Oliveira # 04/04/2021 # Biblioteca desenvolvida para buscar infomações de anuncios de um vendedor no mercado livre # As informações são anotadas em uma planilha do excel # Passo a passo: # + Recebe o caminho da pasta onde a planilha será salva # + Cria a planilha do excel com uma aba nomeada ...
oliveira-iago/Bot_Mercado-Livre
Libs/catalogo.py
catalogo.py
py
11,743
python
pt
code
1
github-code
6
[ { "api_name": "datetime.date.today", "line_number": 32, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 32, "usage_type": "name" }, { "api_name": "openpyxl.styles.PatternFill", "line_number": 37, "usage_type": "call" }, { "api_name": "openpyx...
70694496507
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Created on Wed Apr 6 22:48:01 2016 @author: 冥凝 """ import math import matplotlib.pyplot as mp import easygui as eg G=6.67408*10**(-11) # m**3/(kg*s**2) class earth(object): def __init__(self,r,m): self.r=r self.m=m def F(se...
LynnChen-whu/computationalphysics_N2013301020022
炮弹轨道.py
炮弹轨道.py
py
3,640
python
en
code
0
github-code
6
[ { "api_name": "math.sin", "line_number": 26, "usage_type": "call" }, { "api_name": "math.cos", "line_number": 26, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 32, "usage_type": "attribute" }, { "api_name": "math.pi", "line_number": 64, "...
13934723376
# Import the packages needed to import and transform the dataframes # import os import pandas as pd import numpy as np import geopandas as gpd # set working directory incorrectly to test the function setting the correct working directory os.chdir("C:\\Users\\derek.baker\\PycharmProjects") # Create function to set the...
UCDPA-derekbaker/UCDPA_Derek_Baker
UCDA-Derek_Baker.py
UCDA-Derek_Baker.py
py
23,469
python
en
code
0
github-code
6
[ { "api_name": "os.chdir", "line_number": 8, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 12, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 14, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 18, "us...
4794800019
import matplotlib matplotlib.use('agg') import matplotlib.pyplot as plt import numpy as np import mutation_waterfall.preprocess as preprocess def plot(mutation_list_file, n_genes=30, ax=None, file=None): """Generates a waterfall plot describing mutational landscape of samples. Args: mutation_list_fil...
dohlee/python-mutation-waterfall
src/mutation_waterfall/plot.py
plot.py
py
2,152
python
en
code
1
github-code
6
[ { "api_name": "matplotlib.use", "line_number": 2, "usage_type": "call" }, { "api_name": "mutation_waterfall.preprocess.make_binary_matrix", "line_number": 20, "usage_type": "call" }, { "api_name": "mutation_waterfall.preprocess", "line_number": 20, "usage_type": "name" ...
29950824664
from fastapi import FastAPI from pydantic import BaseModel app = FastAPI() class MyRequestSchema(BaseModel): url: str class MyResponseSchema(BaseModel): response: str def my_inference_fn(req: MyRequestSchema) -> MyResponseSchema: # This is an example inference function - you can instead import a func...
seanshi-scale/launch_image_minimal_example
launch_image_minimal_example/server.py
server.py
py
657
python
en
code
0
github-code
6
[ { "api_name": "fastapi.FastAPI", "line_number": 4, "usage_type": "call" }, { "api_name": "pydantic.BaseModel", "line_number": 7, "usage_type": "name" }, { "api_name": "pydantic.BaseModel", "line_number": 11, "usage_type": "name" } ]
46057864026
# -*- coding: utf-8 -*- from django.db.models.fields import SlugField from django.utils.encoding import smart_str from django.utils.text import slugify from spirit.core.conf import settings __all__ = ['AutoSlugField', ] class AutoSlugField(SlugField): """ Auto populates itself from another field. It b...
nitely/Spirit
spirit/core/utils/models.py
models.py
py
1,569
python
en
code
1,153
github-code
6
[ { "api_name": "django.db.models.fields.SlugField", "line_number": 12, "usage_type": "name" }, { "api_name": "spirit.core.conf.settings.ST_UNICODE_SLUGS", "line_number": 23, "usage_type": "attribute" }, { "api_name": "spirit.core.conf.settings", "line_number": 23, "usage_t...
27183928263
############################################################################### # # # Trainer.py # # J. Steiner ...
JCSteiner/Directed-Study-Fall-2020
ASR CNN/Trainer.py
Trainer.py
py
8,380
python
en
code
1
github-code
6
[ { "api_name": "torch.nn.CTCLoss", "line_number": 72, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 72, "usage_type": "name" }, { "api_name": "torch.optim.AdamW", "line_number": 75, "usage_type": "call" }, { "api_name": "torch.optim", "line_n...
70725054588
# Databricks notebook source # MAGIC %md # MAGIC ### Working on lap_times files # COMMAND ---------- # DBTITLE 1,Creating parameters dbutils.widgets.text("p_data_source", "") v_data_source = dbutils.widgets.get("p_data_source") # COMMAND ---------- # DBTITLE 1,Run the configuration notebook # MAGIC %run "../0 - inc...
diassmith/formula1-project
OLD - bronze - to - silver/laptimes.py
laptimes.py
py
2,041
python
en
code
1
github-code
6
[ { "api_name": "pyspark.sql.types.StructType", "line_number": 30, "usage_type": "call" }, { "api_name": "pyspark.sql.types.StructField", "line_number": 30, "usage_type": "call" }, { "api_name": "pyspark.sql.types.IntegerType", "line_number": 30, "usage_type": "call" }, ...
39245522417
import requests from bs4 import BeautifulSoup from random import randint import csv payload = {'groups': 'top_250', 'start':1} h = {'Accept-Language': 'en-US'} url = 'https://www.imdb.com/search/title/?genres=action' file = open("movies.csv", "a") file_obj = csv.writer(file) file_obj.writerow(['Title', '...
maritevzadze/WEATHER
qvizi4.py
qvizi4.py
py
1,041
python
en
code
0
github-code
6
[ { "api_name": "csv.writer", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 16, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 20, "usage_type": "call" } ]
34464335249
from rest_framework.test import APIClient from testing.testcases import TestCase from utils.paginations import EndlessPagination from django.conf import settings from friendships.models import Friendship from newsfeeds.models import NewsFeed from newsfeeds.services import NewsFeedService NEWSFEEDS_URL = '/api/newsfeed...
wangxiaoyu-au/django-twitter
newsfeeds/api/tests.py
tests.py
py
8,916
python
en
code
0
github-code
6
[ { "api_name": "testing.testcases.TestCase", "line_number": 14, "usage_type": "name" }, { "api_name": "rest_framework.test.APIClient", "line_number": 19, "usage_type": "call" }, { "api_name": "rest_framework.test.APIClient", "line_number": 23, "usage_type": "call" }, {...
26521523896
#import libraries import tensorflow as tf import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt from sklearn.preprocessing import StandardScaler from sklearn.model_selection import train_test_split from sklearn.metrics import confusion_matrix model = tf.keras.models.S...
NijatZeynalov/Classify-Diabetes-using-ANNs
build_model.py
build_model.py
py
1,459
python
en
code
0
github-code
6
[ { "api_name": "tensorflow.keras.models.Sequential", "line_number": 12, "usage_type": "call" }, { "api_name": "tensorflow.keras", "line_number": 12, "usage_type": "attribute" }, { "api_name": "tensorflow.keras.layers.Dense", "line_number": 14, "usage_type": "call" }, {...
75358148986
""" @author: Ahmed Issa """ # Noon from bs4 import BeautifulSoup import requests import csv def get_data(pageNo): headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'} source = requests.get('https://w...
AhmedIssa11/E-Commerce-Web-Scraper
noon.py
noon.py
py
1,655
python
en
code
2
github-code
6
[ { "api_name": "requests.get", "line_number": 16, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 18, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 60, "usage_type": "call" } ]
73250364989
import socket # ソケット通信のため import curses # サーバーのIPアドレス SERVER_IP = "192.168.0.3" # ポート番号 PORT = 8000 MAP_SIZE_X = 5 MAP_SIZE_Y = 5 # サンプルマップデータ map_data2 = [[0x20, 0x20, 0x20, 0x20, 0x20], [0x20, 0x08, 0x80, 0x40, 0x20], [0x20, 0x10, 0x20, 0x00, 0x20], [0x20, 0x00, 0x00, ...
ururu17220/BombConsole
client/task3_sample.py
task3_sample.py
py
2,871
python
ja
code
0
github-code
6
[ { "api_name": "socket.socket", "line_number": 32, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 32, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREAM", "line_number": 32, "usage_type": "attribute" }, { "api_name": "curses.init...
30732388030
import cv2 import mediapipe as mp from utils import zoom_in, hand_zoom_factor, process_hands from mouse import move_mouse, click_mouse from face import detect_face mp_hands = mp.solutions.hands # Global zoom factor. if the zoom factor goes higher than 1, the image will zoom in on the detected face. zoom_factor = 1 ...
Pouyaexe/follow-my-face
main.py
main.py
py
1,974
python
en
code
2
github-code
6
[ { "api_name": "mediapipe.solutions", "line_number": 7, "usage_type": "attribute" }, { "api_name": "cv2.VideoCapture", "line_number": 14, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 28, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2R...
22382716847
import functools import operator from advent import AdventProblem def preprocess(line): replacements = { ".": False, "#": True, } return [replacements[ch] for ch in line] def part_1(map, x_step=3, y_step=1): x, y = 0, 0 width = len(map[0]) height = len(map) tree_count = ...
slimshreydy/advent-of-code
submissions/day03.py
day03.py
py
910
python
en
code
0
github-code
6
[ { "api_name": "functools.reduce", "line_number": 37, "usage_type": "call" }, { "api_name": "operator.mul", "line_number": 37, "usage_type": "attribute" }, { "api_name": "advent.AdventProblem", "line_number": 41, "usage_type": "call" }, { "api_name": "advent.Advent...
19617170769
# -*- coding: utf-8 -*- import os import pickle import click from play import run, ralign, update_environment from play.api import cli update_environment(dict( # VAGRANT_SETTINGS='projectB', )) PICKLE_FILE = '.play.db' VAGRANT_HOSTNAME = 'default.rubot.vagrant' VAGRANT_SSH_OPTS = '-o StrictHostKeyChecking=no -o...
rubot/play
play/templates/playfile-vagrant/playfile.py
playfile.py
py
2,593
python
en
code
0
github-code
6
[ { "api_name": "play.update_environment", "line_number": 10, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 28, "usage_type": "call" }, { "api_name": "click.echo", "line_number": 33, "usage_type": "call" }, { "api_name": "click.echo", "line...
41865778856
from datetime import datetime, timedelta def get_now_date(): now_time = datetime.now().strftime('%d-%m-%y') return now_time def get_week_dates(): dates = [] today = datetime.now().date() for _ in range(7): dates.append(today.strftime('%d-%m-%y')) today += timedelta(days=1) ...
hardt0x1c/ToDoBot
utils/utils.py
utils.py
py
333
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 5, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 5, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime....
21882834027
from django.urls import path from . import views urlpatterns = [ path('report/<int:event_id>/edit_event', views.create_report, name='create_report'), path('report/<int:report_id>/report_profile', views.report_profile, name='report_profile'), path('report/<int:user_id>/scholarship_profile', views.scholarsh...
perkypsi/SOproject
reports/urls.py
urls.py
py
555
python
en
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", ...
12569303632
#import pandas for reading the xlsx File import pandas as pd #import pymsgbox for displaying a messagebox, the request to check if the URL from the mapping is available, the Handler for outlook, the time for the sleep, the custom py for jira import pymsgbox, urllib.request,urllib.parse,urllib.error, win32com.client, ti...
KieniL/pymailtojira
main.py
main.py
py
4,461
python
en
code
0
github-code
6
[ { "api_name": "os.getcwd", "line_number": 16, "usage_type": "call" }, { "api_name": "jira_py.add_attachment", "line_number": 18, "usage_type": "call" }, { "api_name": "os.remove", "line_number": 19, "usage_type": "call" }, { "api_name": "sys.argv", "line_numbe...
37585101206
# Add the 3d affine widget. # import pyvista as pv pl = pv.Plotter() actor = pl.add_mesh(pv.Sphere()) widget = pl.add_affine_transform_widget(actor) pl.show() # # Access the transform from the actor. # actor.user_matrix # Expected: ## array([[1., 0., 0., 0.], ## [0., 1., 0., 0.], ## [0., 0., 1., 0.], ## ...
pyvista/pyvista-docs
version/dev/api/plotting/_autosummary/pyvista-plotting-widgets-WidgetHelper-add_affine_transform_widget-1.py
pyvista-plotting-widgets-WidgetHelper-add_affine_transform_widget-1.py
py
345
python
en
code
1
github-code
6
[ { "api_name": "pyvista.Plotter", "line_number": 4, "usage_type": "call" }, { "api_name": "pyvista.Sphere", "line_number": 5, "usage_type": "call" } ]
20154266926
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import (division, print_function, absolute_import, unicode_literals) __all__ = ["geocode"] import os import MySQLdb def geocode(aff, min_affils=10): with MySQLdb.connect(host="localhost", user="root", ...
dfm/careermap
careermap/geocode.py
geocode.py
py
924
python
en
code
0
github-code
6
[ { "api_name": "MySQLdb.connect", "line_number": 14, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 15, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 15, "usage_type": "attribute" } ]
44337902243
from torch import nn, Tensor class Net(nn.Module): def __init__(self): super(Net, self).__init__() self.layers = nn.Sequential( nn.Linear(1, 10), # nn.Tanh(), nn.Linear(10, 10), nn.Tanh(), # nn.Dropout(p=0.2), nn.Linear(10, ...
meetinger/functionApproximator
Net.py
Net.py
py
436
python
en
code
0
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 4, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 4, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.nn", "line_n...
1256336364
import cv2 import numpy as np print("OpenCV version:") print(cv2.__version__) img = cv2.imread("image/bts-02.jpg") print("image shape: {} pixels".format(img.shape)) print("width: {} pixels".format(img.shape[1])) print("height: {} pixels".format(img.shape[0])) print("channels: {}".format(img.shape[2])) (height, widt...
Nowwook/Python
OpenCV/cv_basic/opcv_Image.py
opcv_Image.py
py
1,579
python
en
code
0
github-code
6
[ { "api_name": "cv2.__version__", "line_number": 5, "usage_type": "attribute" }, { "api_name": "cv2.imread", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.flip", "line_number"...
33549549637
import time, os, copy, sys, json, argparse, warnings, cv2 import torch from torch import nn from laspy.file import File from laspy.header import Header from numba import jit import numpy as np import pandas as pd import dask.dataframe as dd from dask import delayed, compute from scipy import ndimage, stats, i...
maramir6/PointCloud-implementation
data_generation.py
data_generation.py
py
17,190
python
en
code
0
github-code
6
[ { "api_name": "warnings.filterwarnings", "line_number": 28, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 30, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 30, "usage_type": "attribute" }, { "api_name": "os.pa...
72143874428
from __future__ import annotations from typing import TYPE_CHECKING if TYPE_CHECKING: from src.models.task import Task from src.models.person import Person from typing import List, Optional from datetime import datetime class Employee(Person): def __init__(self, name: str, surname: str, email: str): ...
levensworth/udesa-pc-tutorial
2022-a/6-todo-list/solution/src/models/employee.py
employee.py
py
2,021
python
en
code
2
github-code
6
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 3, "usage_type": "name" }, { "api_name": "src.models.person.Person", "line_number": 12, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 15, "usage_type": "name" }, { "api_name": "src.models.t...
28805947146
import argparse import sys from typing import IO from prompt_toolkit.shortcuts import checkboxlist_dialog, input_dialog from yaml import safe_dump from ..exceptions import UserError from ..plugin import BaseCommand class Command(BaseCommand): @classmethod def get_help(cls) -> str: return "Interactiv...
coddingtonbear/jira-select
jira_select/commands/build_query.py
build_query.py
py
1,815
python
en
code
22
github-code
6
[ { "api_name": "plugin.BaseCommand", "line_number": 12, "usage_type": "name" }, { "api_name": "argparse.ArgumentParser", "line_number": 18, "usage_type": "attribute" }, { "api_name": "prompt_toolkit.shortcuts.checkboxlist_dialog", "line_number": 26, "usage_type": "call" ...
28599712917
# flask 는 웹앱을 만들기 위한 마이크로 웹 프라임워크 # render_template = from flask import Flask, render_template, request from vsearch import search_for_letters app = Flask(__name__) def log_request(req: 'flask_request', res: str) -> None: with open('vsearch.log', 'a') as log: print(req,res, file=log) @app.rou...
WoojinAhnSE/HeadFirstPythonWoojin
ch5/vsearch4web.py
vsearch4web.py
py
1,256
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.request.form", "line_number": 13, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 13, "usage_type": "name" }, { "api_name": "flask.request.form",...
24223744659
import sys import os import os.path import re from functools import partial from html.entities import name2codepoint from ..constants import preferred_encoding, filesystem_encoding dynamic_property = lambda func: func(None) class CurrentDir(object): def __init__(self, path): self.path = path sel...
prodigeni/pdfmasher
ebooks/utils/__init__.py
__init__.py
py
5,938
python
en
code
0
github-code
6
[ { "api_name": "os.getcwd", "line_number": 19, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 20, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 25, "usage_type": "call" }, { "api_name": "sys.getfilesystemencoding", "line_num...
25805440448
import argparse import concurrent.futures as futures import itertools import json import logging import os import re import sys import time import urllib from collections import defaultdict, namedtuple from concurrent.futures import ThreadPoolExecutor from pprint import pprint import redis import requests from request...
scality/utapi
lib/reindex/s3_bucketd.py
s3_bucketd.py
py
17,561
python
en
code
12
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 19, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 19, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 20, "usage_type": "call" }, { "api_name": "argparse.Argu...
18396739406
# Classifiers can be found here: # https://github.com/opencv/opencv/tree/master/data import os import cv2 def pixelate_image(image): temp = cv2.resize(image, (16, 16), interpolation=cv2.INTER_LINEAR) return cv2.resize(temp, image.shape[:2], interpolation=cv2.INTER_NEAREST) def main(classifier_path, image_p...
kelvins/ipcv-snippets
anonymize_faces/main.py
main.py
py
1,201
python
en
code
2
github-code
6
[ { "api_name": "cv2.resize", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.INTER_LINEAR", "line_number": 9, "usage_type": "attribute" }, { "api_name": "cv2.resize", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.INTER_NEAREST", "li...
74589123706
# an example of linear regression by more comprehensive method #Step 1: importing necessary python package import numpy as np import pandas as pd from sklearn.linear_model import LinearRegression import sklearn.metrics as ms import matplotlib.pyplot as plt #Step2: Importing dataset data = pd.read_csv ('/home/kishor...
KishorKaphle/Getting_Started_with_ML
Simple LR Model.py
Simple LR Model.py
py
1,146
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LinearRegression", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.scatter", "line_number": 22, "usage_type": "call" }, { "a...
10439401983
import pandas as pd import time from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC espera_corta = 1 espera_larga = 3 timeout =...
estravagancia/selenium
main.py
main.py
py
3,848
python
en
code
0
github-code
6
[ { "api_name": "selenium.webdriver.Firefox", "line_number": 13, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 13, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 19, "usage_type": "call" }, { "api_name": "time.sl...
28920476590
from time import sleep from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By def fillForms(row, column, browser): try: assert isinstance(row, int) and isinstance(column, int) except AssertionError: print("\033[1;31mTry again\0...
G0dof/python-selenium
exercícios/ex05.py
ex05.py
py
1,178
python
en
code
0
github-code
6
[ { "api_name": "selenium.webdriver.common.by.By.CSS_SELECTOR", "line_number": 14, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.common.by.By", "line_number": 14, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.by.By.CSS_SELECTOR", "line_number...
27598185638
from django.urls import path from . import views app_name = 'blog' urlpatterns = [ path('home/',views.Home.as_view(),name='home'), path('<int:pk>/<str:title>/',views.detail,name='detail'), path('user/<int:pk>/',views.user_post,name="user_post"), path('new_post/',views.NewPost.as_view(),name='new_post'), path...
Abhishekvaish/BlogShare
blog/urls.py
urls.py
py
399
python
en
code
3
github-code
6
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 11, "usage_type": "call" }, { "api_name": "django.urls.path", ...
4663452768
from flask import Blueprint, request from flask_cors import cross_origin from bson.json_util import dumps from dotenv import load_dotenv import math, os import urllib.parse from db import db from auth import requires_auth, requires_scope, AuthError load_dotenv() try: LIMIT = int(os.getenv('DEFAULT_LOCATIONS_LIMI...
mozzio616/vege-pick
api/v1/location_am.py
location_am.py
py
2,161
python
en
code
0
github-code
6
[ { "api_name": "dotenv.load_dotenv", "line_number": 11, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 14, "usage_type": "call" }, { "api_name": "db.db.locations", "line_number": 18, "usage_type": "attribute" }, { "api_name": "db.db", "line_n...
4186297807
import itertools import logging import string from collections import defaultdict, deque from urllib import parse import click import requests import nltk from nltk.corpus import stopwords from nltk.stem import PorterStemmer, WordNetLemmatizer from nltk.tokenize import word_tokenize from .models import get_model lo...
eaudeweb/NLPService
nlpservice/nlp/utils.py
utils.py
py
4,051
python
en
code
2
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "models.get_model", "line_number": 24, "usage_type": "call" }, { "api_name": "urllib.parse.urlparse", "line_number": 34, "usage_type": "call" }, { "api_name": "urllib.parse...
21998972206
# Definition for a binary tree node. class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: def maxDepth(self, root: TreeNode) -> int: if not root: return 0 return max(self.maxDepth(root.left), self.maxDepth(ro...
hangwudy/leetcode
剑指Offer面试题/剑指 Offer 55 - I. 二叉树的深度.py
剑指 Offer 55 - I. 二叉树的深度.py
py
843
python
en
code
0
github-code
6
[ { "api_name": "collections.deque", "line_number": 19, "usage_type": "call" } ]
40319755087
from ansible.module_utils.basic import AnsibleModule from ansible_collections.ansibleguy.opnsense.plugins.module_utils.base.handler import \ module_dependency_error, MODULE_EXCEPTIONS try: from ansible_collections.ansibleguy.opnsense.plugins.module_utils.helper.utils import profiler from ansible_collectio...
ansibleguy/collection_opnsense
plugins/modules/webproxy_pac_match.py
webproxy_pac_match.py
py
5,482
python
en
code
158
github-code
6
[ { "api_name": "ansible_collections.ansibleguy.opnsense.plugins.module_utils.base.handler.MODULE_EXCEPTIONS", "line_number": 14, "usage_type": "name" }, { "api_name": "ansible_collections.ansibleguy.opnsense.plugins.module_utils.base.handler.module_dependency_error", "line_number": 15, "u...
2182683591
#!/usr/bin/env python3 """ SSCI MarsBot robot server """ import remote import pickle import json import time from ev3dev2 import DeviceNotFound from ev3dev2.motor import MediumMotor, MoveSteering, SpeedPercent, OUTPUT_A, OUTPUT_B, OUTPUT_C from ev3dev2.led import Led, Leds from ev3dev2.display import Display from Scr...
terbos90803/ev3-marsbots
marsbot-ev3/robot.py
robot.py
py
4,157
python
en
code
0
github-code
6
[ { "api_name": "Screen.init_console", "line_number": 30, "usage_type": "call" }, { "api_name": "ev3dev2.motor.MediumMotor", "line_number": 37, "usage_type": "call" }, { "api_name": "ev3dev2.motor.OUTPUT_A", "line_number": 37, "usage_type": "argument" }, { "api_name...
31366291841
"""Init db default values Revision ID: e008d81a779e Revises: Create Date: 2018-08-15 14:15:20.856976 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'e008d81a779e' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands ...
NatLibFi/Finto-suggestions
api/migrations/versions/e008d81a779e_.py
e008d81a779e_.py
py
6,469
python
en
code
7
github-code
6
[ { "api_name": "alembic.op.create_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy.Integ...
17329250564
import socket import threading from collections import namedtuple from contextlib import contextmanager from queue import Queue from rich.console import Console from rich.table import Table from commonport import COMMON_PORTS PortService = namedtuple('PortService', ['port', 'service']) class PortScan...
x404xx/Port-Scanner
scanner.py
scanner.py
py
4,022
python
en
code
0
github-code
6
[ { "api_name": "collections.namedtuple", "line_number": 13, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 22, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 24, "usage_type": "call" }, { "api_name": "contextlib.c...
21396054389
from typing import Any, Dict, List, Optional from fastapi import APIRouter, FastAPI from fastapi.responses import JSONResponse from pydantic import BaseModel, Field from image_builder.config import Config from image_builder.build import build_job_image from image_builder.health import health_response from image_build...
TheRacetrack/racetrack
image_builder/image_builder/api.py
api.py
py
5,373
python
en
code
27
github-code
6
[ { "api_name": "racetrack_client.log.logs.init_logs", "line_number": 24, "usage_type": "call" }, { "api_name": "image_builder.config.Config", "line_number": 25, "usage_type": "name" }, { "api_name": "racetrack_client.utils.config.load_config", "line_number": 25, "usage_typ...
3529636643
import asyncio import datetime import os import hashlib from typing import List, Dict, Set, Any import ordinance # NOTE # see https://docs.python.org/3/library/difflib.html#difflib.HtmlDiff.make_file # NOTE def _hash_file(path: str) -> str: try: with open(path, 'rb') as file: data = file.rea...
Kalamuwu/Ordinance-plugins
folder_monitor/monitor.py
monitor.py
py
5,835
python
en
code
1
github-code
6
[ { "api_name": "hashlib.sha512", "line_number": 18, "usage_type": "call" }, { "api_name": "ordinance.ext", "line_number": 24, "usage_type": "attribute" }, { "api_name": "typing.Dict", "line_number": 27, "usage_type": "name" }, { "api_name": "typing.Any", "line_...
73952551228
import numpy as np from astropy.table import Table, vstack, hstack import os import pdb def make_total_cats(mastercat_version, mcal_bpz_dir, deep_dir, output_dir, field_list): total_mcal_cat = Table() total_class_cat = Table() total_cat = Table() for field_name in field_list: print('Adding {0} to tot...
des-science/Y3_shearcat_tests
Stellar_contamination/make_total_cats.py
make_total_cats.py
py
1,412
python
en
code
1
github-code
6
[ { "api_name": "astropy.table.Table", "line_number": 9, "usage_type": "call" }, { "api_name": "astropy.table.Table", "line_number": 10, "usage_type": "call" }, { "api_name": "astropy.table.Table", "line_number": 11, "usage_type": "call" }, { "api_name": "astropy.ta...
62202385
# train-clean-100: 251 speaker, 28539 utterance # train-clean-360: 921 speaker, 104104 utterance # test-clean: 40 speaker, 2620 utterance # merged test: 80 speaker, 5323 utterance # batchisize 32*3 : train on triplet: 5s - > 3.1s/steps , softmax pre train: 3.1 s/steps import logging from time import time import num...
Walleclipse/Deep_Speaker-speaker_recognition_system
train.py
train.py
py
9,061
python
en
code
235
github-code
6
[ { "api_name": "constants.DATASET_DIR", "line_number": 44, "usage_type": "attribute" }, { "api_name": "constants.PRE_TRAIN", "line_number": 46, "usage_type": "attribute" }, { "api_name": "logging.info", "line_number": 47, "usage_type": "call" }, { "api_name": "pre_...
2052253559
""" Author: xtrs 功能模块--功能条目列表控件--条目--条目设置对话框 """ from PyQt5.QtWidgets import QApplication, QColorDialog, QFontDialog import PyQt5.QtCore as qtc from PyQt5.QtCore import Qt from popup_dialog import PopDialog # noinspection PyUnresolvedReferences from PyQt5.uic import loadUiType ui_StripLWItemSettingDialog, _ = loadUiTy...
xuerong-xr/Lightning
main/Components/StripLWItemSettingDialog.py
StripLWItemSettingDialog.py
py
1,312
python
en
code
0
github-code
6
[ { "api_name": "PyQt5.uic.loadUiType", "line_number": 12, "usage_type": "call" }, { "api_name": "popup_dialog.PopDialog", "line_number": 15, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.Qt.WindowCloseButtonHint", "line_number": 23, "usage_type": "attribute" }, {...
18718611353
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^courses$', views.courses, name='courses'), url(r'^delete/(?P<course_id>\d)$', views.delete, name='delete'), url(r'^destroy/(?P<course_id>\d)$', views.destroy, name='destroy'), ]
mtjhartley/codingdojo
dojoassignments/python/django/full_stack_django/courses/apps/coursesapp/urls.py
urls.py
py
311
python
en
code
1
github-code
6
[ { "api_name": "django.conf.urls.url", "line_number": 5, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.co...
40303964792
import sklearn from sklearn.model_selection import GridSearchCV from sklearn.model_selection import train_test_split from sklearn.pipeline import Pipeline from sklearn.preprocessing import RobustScaler from sklearn.svm import SVC from tsfresh.transformers import RelevantFeatureAugmenter from src.constants.paths_gener...
lucmos/dynamic-sketch-recognizer
src/learner.py
learner.py
py
8,000
python
en
code
3
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.ERROR", "line_number": 17, "usage_type": "attribute" }, { "api_name": "src.utility.chronometer.Chrono", "line_number": 52, "usage_type": "call" }, { "api_name": ...
19062796807
import cv2 import numpy as np image = cv2.imread("1.jpeg") gray=cv2.cvtColor(image,cv2.COLOR_BGR2GRAY) edged = cv2.Canny(image, 10, 250) _,cnts,_ = cv2.findContours(edged.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) idx = 0 print(cnts) for c in cnts: #print(np.array(c).shape,cv2.boundingRect(c)) x,y,w...
pranshu28/image_classification
Code/crop.py
crop.py
py
1,184
python
en
code
1
github-code
6
[ { "api_name": "cv2.imread", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 6, "usage_type": "attribute" }, { "api_name": "cv2.Canny", "line_nu...
18101463484
from typing import List, Tuple from unittest import TestCase, main class Solution: def equationsPossible(self, equations: List[str]) -> bool: """union find approach""" def rank(ch: str) -> int: """takes character and returns corresponding integer""" return ord(ch) - 97 # ...
hirotake111/leetcode_diary
leetcode/satisfiability_of_equality_equations/solution.py
solution.py
py
1,677
python
en
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 6, "usage_type": "name" }, { "api_name": "unittest.TestCase", "line_number": 38, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 39, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_num...
71781892028
import matplotlib.pyplot as plt import pandas as pd import numpy as np from PIL import Image from tensorflow.keras.preprocessing.image import ImageDataGenerator from matplotlib import image import json class eda_sda(): def __init__(self,img_path,folder_path,batch_size): self.img_path = img_path se...
jmomartinez/chest_ct_img_classfication
src/eda_sda.py
eda_sda.py
py
2,796
python
en
code
0
github-code
6
[ { "api_name": "tensorflow.keras.preprocessing.image.ImageDataGenerator", "line_number": 20, "usage_type": "call" }, { "api_name": "matplotlib.image.imread", "line_number": 27, "usage_type": "call" }, { "api_name": "matplotlib.image", "line_number": 27, "usage_type": "name...
37675934432
import pygame class GuiText: def __init__(self, x, y, text, fontsize=30, color=(255, 255, 255), layer=5): self.x = x self.y = y self.text = text self.color = color self.fontsize = fontsize self.font = pygame.font.SysFont(None, self.fontsize) self.render = se...
GrzegorzNieuzyla/Shot-em-up
shotemup/gui.py
gui.py
py
743
python
en
code
0
github-code
6
[ { "api_name": "pygame.font.SysFont", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.font", "line_number": 11, "usage_type": "attribute" } ]
17613672220
import pandas as pd import matplotlib.pyplot as plt from datetime import datetime # Lee el archivo CSV df = pd.read_csv('Sadya/AURA_FFT_Subject1_Filtered.csv') # Extrae los minutos y segundos del campo 'Time and date' df['Time and date'] = pd.to_datetime(df['Time and date'], format='[%H:%M:%S.%f %d/%m/%Y]') df['Minut...
subcero123/EEG-Analysis
Ploteo/ploteoFFT.py
ploteoFFT.py
py
1,667
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 26, "usage_type": "call" }, { "api_name": "matplotli...
36775521379
import requests import pytest from unittest.mock import patch, MagicMock, create_autospec import pickle import os import pandas as pd from astropy.table import Table from gapipes.gaia.core import Tap from gapipes.gaia.utils import Job @pytest.fixture def mock_post_query(): fn = os.path.join(os.path.dirname(__file...
smoh/gapipes
gapipes/gaia/tests/test_tap.py
test_tap.py
py
3,365
python
en
code
0
github-code
6
[ { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 14, "usage_type": "call" }, { "api_name": "pickle.load", "line_num...
19204597403
import numpy as np from scipy.integrate import quad from scipy.interpolate import splev, splrep from astropy import units, constants from .params import par class StochasticGW: def __init__(self, param=None, xe=None, **kwargs): if param is None: param = par() self.param = param ...
sambit-giri/pySZe
src/gertsenshtein_effect.py
gertsenshtein_effect.py
py
6,158
python
en
code
0
github-code
6
[ { "api_name": "params.par", "line_number": 11, "usage_type": "call" }, { "api_name": "camb.CAMBparams", "line_number": 17, "usage_type": "call" }, { "api_name": "params.set_cosmology", "line_number": 18, "usage_type": "call" }, { "api_name": "params.set_dark_energ...
2078443467
# -*- coding: utf-8 -*- import pytest from django.core.urlresolvers import reverse from testapp.articles.models import Article @pytest.mark.django_db class TestArticleSearchView(object): def test_access(self, app, data): response = app.get(reverse('articles:index')) assert response.status_code ...
odoku/django-searchview
tests/test_views.py
test_views.py
py
2,324
python
en
code
0
github-code
6
[ { "api_name": "django.core.urlresolvers.reverse", "line_number": 13, "usage_type": "call" }, { "api_name": "django.core.urlresolvers.reverse", "line_number": 18, "usage_type": "call" }, { "api_name": "testapp.articles.models.Article.objects.filter", "line_number": 23, "us...
31126486524
import torch from datasets import load_dataset from transformers import AdamW, AutoTokenizer, AutoModelForSequenceClassification, DataCollatorWithPadding # Same as before checkpoint = "bert-base-uncased" tokenizer = AutoTokenizer.from_pretrained(checkpoint) model = AutoModelForSequenceClassification.from_pretrained(c...
SleepySoft/HuggingFaceStudy
10.ProcessingTheData_PT.py
10.ProcessingTheData_PT.py
py
6,856
python
zh
code
0
github-code
6
[ { "api_name": "transformers.AutoTokenizer.from_pretrained", "line_number": 8, "usage_type": "call" }, { "api_name": "transformers.AutoTokenizer", "line_number": 8, "usage_type": "name" }, { "api_name": "transformers.AutoModelForSequenceClassification.from_pretrained", "line_n...
42206225259
# _*_ coding: utf-8 _*_ import cv2 import sys import gxipy as gx from PIL import Image from threading import Timer import datetime def Frame_acquire(): # 参数设定 Width_set = 640 # 设置分辨率宽 Height_set = 480 # 设置分辨率高 framerate_set = 80 # 设置帧率 # 枚举设备 device_manager = gx.DeviceManag...
Dragonchengllc/DaHeng-Camera
Image_acquire.py
Image_acquire.py
py
4,890
python
zh
code
2
github-code
6
[ { "api_name": "gxipy.DeviceManager", "line_number": 17, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 24, "usage_type": "call" }, { "api_name": "gxipy.GxSwitchEntry", "line_number": 63, "usage_type": "attribute" }, { "api_name": "PIL.Image.froma...
30545285126
from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation, Flatten from keras.layers import Conv2D, MaxPool2D from keras.optimizers import SGD, RMSprop, adam from keras.utils import np_utils import numpy as np import matplotlib.pyplot as plt import matplotlib import os from sklearn.u...
limingwu8/ML
test/trainOurOwnData/trainOurOwnData.py
trainOurOwnData.py
py
3,618
python
en
code
1
github-code
6
[ { "api_name": "os.listdir", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 45, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 45, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": ...
369147575
import warnings from collections import deque from itertools import chain import numpy as np import torch import torch.nn as nn from statsmodels.tsa.arima.estimators.hannan_rissanen import hannan_rissanen from utils import (_get_mixed_design_mat_part, _get_ordinal_design_mat_part, _get_se...
ardafazla/jointoptimization
models/sarimax.py
sarimax.py
py
19,766
python
en
code
0
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 20, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 20, "usage_type": "name" }, { "api_name": "utils._check_endog", "line_number": 51, "usage_type": "call" }, { "api_name": "utils._check_exog", ...
39316038148
from faker import Faker from sqlalchemy import create_engine, text import random import uuid # Create a Faker instance fake = Faker() # Create a SQLAlchemy engine engine = create_engine('postgresql://user:mysecretpassword@localhost:5432/mydatabase') # Number of records to generate num_records = 100 # Start a new SQ...
ezsx/xdev-test-task
db/generate_test_data.py
generate_test_data.py
py
2,008
python
en
code
0
github-code
6
[ { "api_name": "faker.Faker", "line_number": 7, "usage_type": "call" }, { "api_name": "sqlalchemy.create_engine", "line_number": 10, "usage_type": "call" }, { "api_name": "sqlalchemy.text", "line_number": 19, "usage_type": "call" }, { "api_name": "sqlalchemy.text",...
37546117614
import random, json, logging, sys from pprint import pprint logging.basicConfig(filename='traveling_salesman.log', level=logging.DEBUG) with open("travelling-salesman-data.json","r") as f: data = json.loads(f.read()) def get_distance_two_cities(city1, city2): n1 = data['names'].index(city1) n2 = data['na...
paulbaumgarten/genetic-alg
traveling_salesman_1.py
traveling_salesman_1.py
py
5,646
python
en
code
0
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 4, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 4, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 7, "usage_type": "call" }, { "api_name": "random.choice", "l...
5042148324
import mimetypes mimetypes.init() import base64 import textwrap from . import FileLoader, LoaderWrappingLoader DEFAULT_MIMETYPE = "application/octet-stream" DATA_URI_TEMPLATE = "data:%s;base64,%s" IMG_TEMPLATE = '<img src="%s" />' class ImgLoader(LoaderWrappingLoader): tag = 'img' WRAPPED_LOADER = FileLoade...
louissobel/makejank
makejank/loaders/img_loader.py
img_loader.py
py
954
python
en
code
0
github-code
6
[ { "api_name": "mimetypes.init", "line_number": 2, "usage_type": "call" }, { "api_name": "mimetypes.guess_type", "line_number": 20, "usage_type": "call" }, { "api_name": "base64.b64encode", "line_number": 29, "usage_type": "call" }, { "api_name": "textwrap.fill", ...
26960572250
from logging import debug from statistics import mean from time import time from typing import List, Tuple from numpy.random import default_rng class Simulator: def __init__(self, lam: float, mi: float, on_time: float, off_time: float, servers: int, time_limit: float, events_limit: int, seed: in...
deserekkk/OAST-MM1
simulation/simulator.py
simulator.py
py
10,874
python
en
code
1
github-code
6
[ { "api_name": "typing.List", "line_number": 27, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 27, "usage_type": "name" }, { "api_name": "numpy.random.default_rng", "line_number": 28, "usage_type": "call" }, { "api_name": "time.time", "li...
8866661205
#!/usr/bin/python from PIL import Image, ImageFont, ImageDraw from bake_tiles import xyrange def main(): result = Image.new('RGBA', (832, 512)) draw = ImageDraw.Draw(result) tw = 832/32 th = 512/32 font = ImageFont.load_default() for y,x in xyrange(th,tw): i = (x + y) if i%2 == 0: color = (0,0,0,255) e...
maxattack/ld26-eraserland
tools/render_idmap.py
render_idmap.py
py
716
python
en
code
0
github-code
6
[ { "api_name": "PIL.Image.new", "line_number": 7, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 7, "usage_type": "name" }, { "api_name": "PIL.ImageDraw.Draw", "line_number": 8, "usage_type": "call" }, { "api_name": "PIL.ImageDraw", "line_num...
72590668987
from __future__ import absolute_import, unicode_literals import logging from kombu.five import bytes_if_py2 from kombu.utils.debug import Logwrapped, setup_logging from kombu.tests.case import Case, Mock, patch class test_setup_logging(Case): def test_adds_handlers_sets_level(self): with patch('kombu....
DMills27/CMS-Django-Application
lib/python2.7/site-packages/kombu-4.0.0rc3-py2.7.egg/kombu/tests/utils/test_debug.py
test_debug.py
py
1,780
python
en
code
0
github-code
6
[ { "api_name": "kombu.tests.case.Case", "line_number": 11, "usage_type": "name" }, { "api_name": "kombu.tests.case.patch", "line_number": 14, "usage_type": "call" }, { "api_name": "kombu.tests.case.Mock", "line_number": 15, "usage_type": "call" }, { "api_name": "ko...
13001799095
import yaml import importlib import inspect from collections import defaultdict from copy import deepcopy import ast from torch.utils.data import DataLoader from torchvision import transforms import numpy as np import itertools import pandas as pd import datetime import torch from torch.utils.data import DataLoader fro...
linyongver/ZIN_official
landcover.py
landcover.py
py
6,759
python
en
code
15
github-code
6
[ { "api_name": "importlib.import_module", "line_number": 19, "usage_type": "call" }, { "api_name": "inspect.getfullargspec", "line_number": 22, "usage_type": "call" }, { "api_name": "torchvision.transforms.Compose", "line_number": 53, "usage_type": "call" }, { "api...
36961532301
#!/usr/bin/env python # coding: utf-8 # # Covid-19 SI$_n$R Model # # # First, import all necessary libraries # In[1]: import numpy as np import ast from os.path import exists from scipy.optimize import minimize from scipy.optimize import fsolve from scipy.integrate import odeint from scipy.stats import gamma from...
annette-bell/SInR-Covid-Dissertation
SInR_Model_Analysis.py
SInR_Model_Analysis.py
py
37,579
python
en
code
1
github-code
6
[ { "api_name": "pandas.read_excel", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 56, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 56, "usage_type": "attribute" }, { "api_name": "numpy.random.ga...
15252589390
import uuid from django.db import models from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import AbstractUser class BaseModel(models.Model): """ Setups default class representation and adds created_date and modified_date database fields. """ id =...
VikaZorenko/security
lab5/myapp/models.py
models.py
py
1,274
python
en
code
0
github-code
6
[ { "api_name": "django.db.models.Model", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 8, "usage_type": "name" }, { "api_name": "django.db.models.UUIDField", "line_number": 13, "usage_type": "call" }, { "api_name": ...
6506027495
from django.db.models import QuerySet from rest_framework import status from rest_framework.decorators import api_view from rest_framework.permissions import IsAuthenticated from rest_framework.request import Request from rest_framework.response import Response from rest_framework.views import APIView from applicatio...
chpenaf/DotSportsBackend
applications/catalog/api/views.py
views.py
py
10,298
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.views.APIView", "line_number": 26, "usage_type": "name" }, { "api_name": "serializers.ServiceSerializer", "line_number": 28, "usage_type": "name" }, { "api_name": "models.Service.objects.all", "line_number": 32, "usage_type": "call" }, { ...
31601486608
from django import db from django.db import models from autoslug import AutoSlugField class CategoriesModel(models.Model): categoryName = models.CharField(max_length=30,blank=False,null=False) slug = AutoSlugField(populate_from = 'categoryName', unique=True) class Meta: db_table = 'category' ...
yusuf-teker/django-library-management
library/models/categories.py
categories.py
py
372
python
en
code
0
github-code
6
[ { "api_name": "django.db.models.Model", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 5, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 6, "usage_type": "call" }, { "api_name": "...
8420564941
# Program to show formatting of date time from datetime import datetime now = datetime.now() t = now.strftime("%H:%M:%S") print("time:", t) str1 = now.strftime("%m/%d/%Y, %H:%M:%S") # mm/dd/YY H:M:S format print("str1:", str1) str2 = now.strftime("%d/%m/%Y, %H:%M:%S") # dd/mm/YY H:M:S format print("str2:", str2)
davidjava1991/Python3CompleteCourse
Section8/lecture85/Program4.py
Program4.py
py
314
python
en
code
1
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 4, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 4, "usage_type": "name" } ]
38650384243
import pickle import pandas as pd import logging log = logging.getLogger("EHR-ML") def calculateMccF1(x, y): import sys import os import rpy2.robjects as robjects from rpy2.robjects.packages import importr # import R's "base" package mccf1 = importr('mccf1') old_stdout = sys.stdout #...
ryashpal/EHR-ML
ehrml/utils/MlUtils.py
MlUtils.py
py
17,014
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "rpy2.robjects.packages.importr", "line_number": 18, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 20, "usage_type": "attribute" }, { "api_name": "sys.s...