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
44856064669
import torch import torch.nn as nn def train(): model = nn.Linear(in_features=4, out_features=2) criterion = nn.MSELoss() optimizer = torch.optim.SGD(params=model.parameters(), lr=0.1) for epoch in range(10): # Converting inputs and labels to Variable inputs = torch.Tensor([0.8,0.4,0....
kaushikacharya/Introduction_to_Deep_Learning_and_Neural_Networks
code/train_linear_classifier.py
train_linear_classifier.py
py
935
python
en
code
0
github-code
97
[ { "api_name": "torch.nn.Linear", "line_number": 5, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 5, "usage_type": "name" }, { "api_name": "torch.nn.MSELoss", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": ...
43656609764
#!/usr/bin/env python # coding: utf-8 # # -實作程式輔助判斷藥物造成SJS/TEN之可能性 # ## 本程式整合Naranjo score及ALDEN score,藉由輸入藥物資訊、病人資料及相關問題 # ## 經由分析後,即可比較各藥物間之懷疑程度,同時輸出藥物使用表格 # ### 讀取藥物資料(存於csv檔中): # * acetaminophen, 500 mg 1# QID, 2020/6/8-2020/6/10 # * prednisolone, 5 mg 2# QID, 2020/6/12-2020/6/24 # * prednisolone, 5 mg 1# QID, 20...
magicakimo/ALDEN-Naranjo-score-helper
SJS_TEN_helper.py
SJS_TEN_helper.py
py
25,262
python
en
code
0
github-code
97
[ { "api_name": "datetime.datetime.strptime", "line_number": 63, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 63, "usage_type": "attribute" }, { "api_name": "datetime.timedelta", "line_number": 228, "usage_type": "call" }, { "api_name": ...
70695099198
import simpy import random import unittest try: from unittest import mock except ImportError: import mock from cloudscope.dynamo import CharacterSequence from cloudscope.replica import Location, Device from cloudscope.simulation.workload import MobileWorkload from tests.test_simulation import get_mock_simula...
bbengfort/cloudscope
tests/test_simulation/test_workload/test_mobile.py
test_mobile.py
py
5,978
python
en
code
1
github-code
97
[ { "api_name": "unittest.TestCase", "line_number": 21, "usage_type": "attribute" }, { "api_name": "cloudscope.simulation.workload.MobileWorkload.counter.reset", "line_number": 27, "usage_type": "call" }, { "api_name": "cloudscope.simulation.workload.MobileWorkload.counter", "l...
15079397539
from typing import List class Solution: def sortedSquares(self, nums: List[int]) -> List[int]: i = 0 j = len(nums) - 1 result = [0] * len(nums) while i <= j: if abs(nums[i]) > abs(nums[j]): result[j - i] = nums[i] ** 2 i += 1 ...
JunkieStyle/LeetCodeProblems
array/977_SquareOfASortedArray/main.py
main.py
py
446
python
en
code
0
github-code
97
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" } ]
7315554427
from django.http import HttpResponseServerError from rest_framework.viewsets import ViewSet from rest_framework.response import Response from rest_framework import serializers from rest_framework import status from ..models import DealershipEmployee class DealershipEmployeeSerializer(serializers.HyperlinkedModelSerial...
nashville-hot-software/carnival-api
carnivalproject/carnivalapi/views/dealershipemployee.py
dealershipemployee.py
py
3,196
python
en
code
0
github-code
97
[ { "api_name": "rest_framework.serializers.HyperlinkedModelSerializer", "line_number": 8, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 8, "usage_type": "name" }, { "api_name": "models.DealershipEmployee", "line_number": 11, "usage...
74887004477
import cv2 image = cv2.imread("number.png") gray = cv2.cvtColor(image,cv2.COLOR_BGR2GRAY) _,thresh = cv2.threshold(gray,70,255,cv2.THRESH_BINARY_INV) thresh1 = cv2.adaptiveThreshold(gray,255,1,1,11,2) kernel = cv2.getStructuringElement(cv2.MORPH_CROSS,(3,3)) dilated = cv2.dilate(thresh,kernel,iterations = 1) _,cont...
debdip/Thesis
check_font/sample2/text.py
text.py
py
507
python
en
code
0
github-code
97
[ { "api_name": "cv2.imread", "line_number": 3, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 4, "usage_type": "attribute" }, { "api_name": "cv2.threshold", "lin...
16337486330
from __future__ import print_function import sys import math import threading import argparse import time from mpi4py import MPI import torch from torch.autograd import Variable from torch import nn import torch.nn.functional as F from nn_ops import NN_Trainer, accuracy from data_loader_ops.my_data_loader import Da...
hwang595/Draco
src/distributed_nn.py
distributed_nn.py
py
7,656
python
en
code
23
github-code
97
[ { "api_name": "mpi4py.MPI.COMM_WORLD", "line_number": 80, "usage_type": "attribute" }, { "api_name": "mpi4py.MPI", "line_number": 80, "usage_type": "name" }, { "api_name": "argparse.ArgumentParser", "line_number": 84, "usage_type": "call" }, { "api_name": "coding....
30936293791
from pathlib import Path from keras.utils import data_utils def maybe_download_vgg16_pretrained_weights(weights_file: Path): if not weights_file.is_file(): print(f"Pretrained VGG16 weigths not found, downloading now to: {weights_file}") weights_file.parent.mkdir(parents=True, exist_ok=True) ...
DIAGNijmegen/bodyct-luna22-ismi-training-baseline
utils.py
utils.py
py
709
python
en
code
3
github-code
97
[ { "api_name": "pathlib.Path", "line_number": 5, "usage_type": "name" }, { "api_name": "keras.utils.data_utils.get_file", "line_number": 9, "usage_type": "call" }, { "api_name": "keras.utils.data_utils", "line_number": 9, "usage_type": "name" } ]
13588225632
from django.urls import path from api_server.apps.custom_accounts import views from api_server.apps.custom_accounts.apps import CustomAccountsConfig app_name = CustomAccountsConfig.name urlpatterns = [ path('set-csrf/', views.SetCsrf.as_view(), name='set-csrf'), path('hello/', views.HelloView.as_view(), name...
reouno/simple-auth-app
api_server/api_server/apps/custom_accounts/urls.py
urls.py
py
611
python
en
code
0
github-code
97
[ { "api_name": "api_server.apps.custom_accounts.apps.CustomAccountsConfig.name", "line_number": 6, "usage_type": "attribute" }, { "api_name": "api_server.apps.custom_accounts.apps.CustomAccountsConfig", "line_number": 6, "usage_type": "name" }, { "api_name": "django.urls.path", ...
4580284423
import datetime from movie import Movie from projection import Projection from reservation import Reservation from sqlalchemy import func import ast class Cinema(): def __init__(self, session): self.__session = session def movie_details(self): name = input("Enter the name of the movie: ") ...
emilenovv/HackBulgaria
week6/cinema_orm/cinema.py
cinema.py
py
5,948
python
en
code
0
github-code
97
[ { "api_name": "movie.Movie", "line_number": 22, "usage_type": "call" }, { "api_name": "movie.Movie", "line_number": 27, "usage_type": "argument" }, { "api_name": "datetime.datetime.strptime", "line_number": 36, "usage_type": "call" }, { "api_name": "datetime.datet...
38450120149
#A ideia do programa é simular um programa de arduino que seja capaz de obter dados de sensores diversos e ligar/ desligar equipamentos de uma estufa de cultivo de plantas. # Serão analisados temperatura do ar, umidade dos vasos e luminosidade do dia # Ventiladores serão ligados ou desligados de acordo com a temperatu...
Garibodi/Scripts
Python/sensor_check.py
sensor_check.py
py
4,093
python
pt
code
0
github-code
97
[ { "api_name": "datetime.datetime.now", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 13, "usage_type": "name" } ]
43313282423
import flask import flask_uploads def make_app() -> tuple[flask.Flask, flask.cli.FlaskGroup]: app = flask.Flask(__name__) app.config.from_object("config.AppConfig") configure_db(app) configure_uploads(app) register_blueprints(app) register_error_handlers(app) configure_logging(app) cli...
rmksrv/the_ultimate_flask_course_projects
store_app/app.py
app.py
py
1,383
python
en
code
0
github-code
97
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.cli.FlaskGroup", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.cli", "line_number": 13, "usage_type": "attribute" }, { "api_name": "flask.Flask", "lin...
34083946222
from PyQt5 import QtWidgets from PyQt5.QtWidgets import QWidget from enum import Enum from src import config from src.handlers import file_handler, command_handler from src.widgets.ConsoleLineEdit import ConsoleLineEdit class TraverseDirType(Enum): UP = "up" DOWN = "down" class LoggingType(Enum): INPUT ...
TyckSoftware/mark-one-desktop
src/widgets/ConsoleWidget.py
ConsoleWidget.py
py
3,588
python
en
code
0
github-code
97
[ { "api_name": "enum.Enum", "line_number": 9, "usage_type": "name" }, { "api_name": "enum.Enum", "line_number": 14, "usage_type": "name" }, { "api_name": "src.config.CONSOLE_LOGGING", "line_number": 20, "usage_type": "attribute" }, { "api_name": "src.config", "...
39204651781
from typing import List from uuid import UUID from app.database import db from app.models.transaction import Transaction, TransactionCreate, TransactionUpdate class TransactionDAO: """DAO for Transaction model, this class implements the interface with firestore db""" collection_name = 'transactions' def...
tabris2015/customer-management-service
app/daos/transaction.py
transaction.py
py
1,863
python
en
code
0
github-code
97
[ { "api_name": "app.database.db.collection", "line_number": 13, "usage_type": "call" }, { "api_name": "app.database.db", "line_number": 13, "usage_type": "name" }, { "api_name": "app.models.transaction.TransactionCreate", "line_number": 15, "usage_type": "name" }, { ...
735636939
import sys from collections import deque #sys.stdin=open("input.txt",'rt') MAX=100000 S,E=map(int,input().split()) ch=[0]*(MAX+1) dis=[0]*(MAX+1) ch[S]=1 dis[E]=0 cnt=0 dq=deque() dq.append(S) while dq: now=dq.popleft() if now==E: break for next in (now-1,now+1,no...
InbumS/CoTe
KWStudy/Chap7/송아지 찾기.py
송아지 찾기.py
py
515
python
en
code
4
github-code
97
[ { "api_name": "collections.deque", "line_number": 13, "usage_type": "call" } ]
16476101996
from django.db.models import fields from rest_framework import serializers from app.models.Post import Post from app.mserializers.UserSerialziers import ProfileGeneralSerializer from app.mserializers.CommentSerializers import CommentSerializer class PostSerializer(serializers.ModelSerializer): author = serialize...
nguyenvandai61/polyglot-world-server
app/mserializers/PostSerializers.py
PostSerializers.py
py
1,149
python
en
code
0
github-code
97
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 9, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 9, "usage_type": "name" }, { "api_name": "rest_framework.serializers.SerializerMethodField", "line_number": 10...
20613160632
import json import logging import tempfile import shapely.geometry as sgeo import shapely.ops as ops from pyproj.crs import CRS from pywps import FORMATS, ComplexOutput, LiteralInput, Process from raven.utilities.analysis import dem_prop from raven.utilities.checks import boundary_check, single_file_check from raven....
Ouranosinc/raven
raven/processes/wps_generic_terrain_analysis.py
wps_generic_terrain_analysis.py
py
5,883
python
en
code
38
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 22, "usage_type": "call" }, { "api_name": "pywps.Process", "line_number": 25, "usage_type": "name" }, { "api_name": "pywps.LiteralInput", "line_number": 32, "usage_type": "call" }, { "api_name": "pywps.ComplexOutpu...
36894240336
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('config', '0001_initial'), ] operations = [ migrations.AlterField( model_name='settings', name='datat...
pkimber/aliuacademy_org
aliuacademy_org/python-packages/fle_utils/config/migrations/0002_auto_20150612_1320.py
0002_auto_20150612_1320.py
py
444
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.AlterField", "line_number": 14, "usage_type": "call" }, {...
71729160000
import torch import torchvision import torch.nn as nn from typing import Optional, Callable, Type, Union from torchvision.models.resnet import Bottleneck, conv3x3, conv1x1 class BasicBlock(torchvision.models.resnet.BasicBlock): expansion: int = 1 def __init__( self, inplanes: int, plan...
s295103/aml_project
architectures/myresnet.py
myresnet.py
py
7,600
python
en
code
0
github-code
97
[ { "api_name": "torchvision.models", "line_number": 7, "usage_type": "attribute" }, { "api_name": "typing.Optional", "line_number": 15, "usage_type": "name" }, { "api_name": "torch.nn.Module", "line_number": 15, "usage_type": "attribute" }, { "api_name": "torch.nn"...
35656485254
# type: ignore from calendar import Calendar import re from typing import List from datetime import datetime, timedelta from db import sqlalchemy_engine from middlewares import db_session_middleware from models.booking import Booking from models.portfolio import Portfolio, PortfolioPydantic from models.user import U...
mahmutalisahn/dream
dream_api_service/lop/v1/repositories/user_repository.py
user_repository.py
py
10,154
python
en
code
0
github-code
97
[ { "api_name": "services_repository.ServiceRepository", "line_number": 24, "usage_type": "call" }, { "api_name": "calendar_repository.CalendarRepository", "line_number": 25, "usage_type": "call" }, { "api_name": "middlewares.db_session_middleware", "line_number": 29, "usag...
37220596463
from Cryptodome.PublicKey import RSA from Cryptodome.Signature import PKCS1_v1_5 from Cryptodome.Hash import SHA256 import binascii from util.hash_util import hash_block, sha256 class Verification: @staticmethod def valid_proof_of_work(prev_hash, outstanding_transactions, proof_of_work): ...
kgebreki/blockchain
src/util/verification.py
verification.py
py
2,098
python
en
code
0
github-code
97
[ { "api_name": "util.hash_util.sha256", "line_number": 18, "usage_type": "call" }, { "api_name": "util.hash_util.hash_block", "line_number": 25, "usage_type": "call" }, { "api_name": "Cryptodome.PublicKey.RSA.importKey", "line_number": 48, "usage_type": "call" }, { ...
40915101692
""".. Ignore pydocstyle D400. ======================== Resolwe Exceptions Utils ======================== Utils functions for working with exceptions. """ from django.core.exceptions import ValidationError from rest_framework.response import Response from rest_framework.views import exception_handler def resolwe_e...
gregorjerse/resolwe
resolwe/flow/utils/exceptions.py
exceptions.py
py
901
python
en
code
null
github-code
97
[ { "api_name": "rest_framework.views.exception_handler", "line_number": 28, "usage_type": "call" }, { "api_name": "django.core.exceptions.ValidationError", "line_number": 30, "usage_type": "argument" }, { "api_name": "rest_framework.response.Response", "line_number": 32, "...
70926235838
# -*- coding: utf-8 -*- import torch.nn as nn import torch.nn.functional as F import torchvision.models as models import numpy as np import torch # SEGNET class SegNet(nn.Module): def __init__(self,input_nbr,label_nbr): super(SegNet, self).__init__() batchNorm_momentum = 0.1 self.conv11 =...
Invadazoid/JU_GDCNN_Floorplan
models.py
models.py
py
42,084
python
en
code
1
github-code
97
[ { "api_name": "torch.nn.Module", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
3188949214
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Apr 26 15:34:16 2021 @author: Sid """ import itertools # python lib for permutations, combinations # copied from previous Rosalind submission ## code to open file and store data with open('/Users/Sid/Documents/2020-21/BCB 5250/Rosalind DataSets/rosa...
ranasid17/Bioinformatics
Rosalind/lexiconography.py
lexiconography.py
py
1,190
python
en
code
0
github-code
97
[ { "api_name": "itertools.product", "line_number": 19, "usage_type": "call" } ]
27301622282
# -*- coding: utf-8 -*- """ Created on Wed Oct 21 12:47:51 2020 Does the infrastructure pathway plotting for Descoberto and Santa Maria. @author: dgold @edited: lbl59 """ from mpl_toolkits.axes_grid1 import make_axes_locatable import numpy as np import pandas as pd from sklearn.cluster import KMeans from sklearn.met...
lbl59/federal_district
figure_generation/Fig4_e2l_plot_pathways_autocluster.py
Fig4_e2l_plot_pathways_autocluster.py
py
12,714
python
en
code
0
github-code
97
[ { "api_name": "numpy.zeros", "line_number": 37, "usage_type": "call" }, { "api_name": "sklearn.cluster.KMeans", "line_number": 43, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 45, "usage_type": "call" }, { "api_name": "numpy.unique", "l...
20254970953
from typing import Callable import numpy as np def eval_barycentric(x: float, x_int_pts: [], y_int_pts: [], N, weights: []): # check if the exact points exists if x in x_int_pts: i = list(x_int_pts).index(x) return y_int_pts[i] top_sum = 0 bottom_sum = 0 for i, x_i in enumerate(x...
hydenp/appm_4600
interpolation/barycentric.py
barycentric.py
py
1,365
python
en
code
0
github-code
97
[ { "api_name": "typing.Callable", "line_number": 33, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 33, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_...
42205650714
from datetime import datetime data = datetime.now() hora = data.hour minutos = data.minute if hora >= 19: print("Es hora de irse a casa") else: print ("Quedan {} horas y {} minutos para irnos a casa".format(18- int(hora), 59-int(minutos)))
joaovarga/python-modulos-ejercicio2
modulos2.py
modulos2.py
py
262
python
es
code
0
github-code
97
[ { "api_name": "datetime.datetime.now", "line_number": 2, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 2, "usage_type": "name" } ]
15026681610
from django.shortcuts import render from django.views import View from django.http import HttpResponse, HttpResponseRedirect from django.contrib.auth import login, logout, authenticate from django.contrib.auth.decorators import login_required from django.urls import reverse from BaseApp.models import UserProfile, Quest...
Advaiit/OnlinePoll
BaseApp/views.py
views.py
py
8,029
python
en
code
0
github-code
97
[ { "api_name": "django.views.View", "line_number": 13, "usage_type": "name" }, { "api_name": "django.shortcuts.render", "line_number": 17, "usage_type": "call" }, { "api_name": "BaseApp.content_util.getTopQuestions", "line_number": 17, "usage_type": "call" }, { "ap...
74710571517
import redis import msgpack import json import pytest from webob import Request from dsq.store import QueueStore, ResultStore from dsq.manager import Manager from dsq.http import Application from dsq.compat import bytestr @pytest.fixture def app(request): cl = redis.StrictRedis() cl.flushdb() return Appl...
baverman/dsq
tests/test_http.py
test_http.py
py
3,886
python
en
code
19
github-code
97
[ { "api_name": "redis.StrictRedis", "line_number": 15, "usage_type": "call" }, { "api_name": "dsq.http.Application", "line_number": 17, "usage_type": "call" }, { "api_name": "dsq.manager.Manager", "line_number": 17, "usage_type": "call" }, { "api_name": "dsq.store....
4399556770
# Import the dependencies. import numpy as np import sqlalchemy from sqlalchemy.ext.automap import automap_base from sqlalchemy.orm import Session from sqlalchemy import create_engine, func from flask import Flask, jsonify import datetime as dt ################################################# # Database Setup #######...
InsomniYak28/sqlalchemy-challenge
app.py
app.py
py
3,516
python
en
code
0
github-code
97
[ { "api_name": "sqlalchemy.create_engine", "line_number": 14, "usage_type": "call" }, { "api_name": "sqlalchemy.ext.automap.automap_base", "line_number": 16, "usage_type": "call" }, { "api_name": "sqlalchemy.orm.Session", "line_number": 21, "usage_type": "call" }, { ...
30344700998
from setuptools import setup, find_packages import os version = '0.8.dev0' setup(name='adi.dropdownmenu', version=version, description="A dropdownmenu that is configurable for site administrators and mirrows your folderstructures.", long_description=open("README.txt").read() + "\n" + ...
ida/adi.dropdownmenu
setup.py
setup.py
py
1,266
python
en
code
0
github-code
97
[ { "api_name": "setuptools.setup", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "setuptools.find_packages", ...
26176416797
"""The code editor of GraphDonkey, with a few features: - Syntax Highlighting - Error Highlighting - Line Numbers Based on https://stackoverflow.com/questions/2443358/how-to-add-lines-numbers-to-qtextedit - Selection/Line Events (Duplicate, Copy, Cut, Comment/Uncomment, Auto-Indent, Indent/Unindent...) - Parenthes...
RandyParedis/GraphDonkey
main/editor/CodeEditor.py
CodeEditor.py
py
40,936
python
en
code
2
github-code
97
[ { "api_name": "main.plugins.PluginLoader.instance", "line_number": 28, "usage_type": "call" }, { "api_name": "main.plugins.PluginLoader", "line_number": 28, "usage_type": "name" }, { "api_name": "main.extra.IOHandler.IOHandler.get_preferences", "line_number": 29, "usage_t...
9934054225
import random from enum import IntEnum from random import randint import numpy as np from keras.models import load_model import cv2 import time class items(IntEnum): Nothing =0 Paper =1 Rock =2 Scissors=3 class game: def __init__(self): self.model = load_model('keras_model.h5', ...
maxx110/rock_paper_scissors
camera_rps.py
camera_rps.py
py
6,573
python
en
code
0
github-code
97
[ { "api_name": "enum.IntEnum", "line_number": 9, "usage_type": "name" }, { "api_name": "keras.models.load_model", "line_number": 19, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.ndarray", ...
19039486388
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Apr 25 14:23:03 2020 @author: Narahari B M """ import sys, os sys.path.insert(0, "/home/fractaluser/Narahari/Personal/Consulting/hinglish_text_mining") sys.path.insert(0, "/home/ec2-user/hinglish_text_mining") from flask import Flask, request from fla...
selfishhari/hinglish_text_mining
src/api/app.py
app.py
py
1,322
python
en
code
2
github-code
97
[ { "api_name": "sys.path.insert", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "sys.path.insert", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.path", "line_nu...
26336097934
"""Entrypoint for the USB-TCP bridge application.""" import logging from . import systemd from .cli import build_root_parser import uvicorn # type: ignore[import] LOG = logging.getLogger(__name__) if __name__ == "__main__": args = build_root_parser().parse_args() systemd.configure_logging(level=args.log_lev...
Opentrons/opentrons
system-server/system_server/__main__.py
__main__.py
py
589
python
en
code
363
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "cli.build_root_parser", "line_number": 11, "usage_type": "call" }, { "api_name": "uvicorn.run", "line_number": 15, "usage_type": "call" } ]
40930219444
#app.py from flask import Flask, flash, request, redirect, url_for, render_template import urllib.request import os from werkzeug.utils import secure_filename import collect_fea_style as cfs import img_style_transform as ist app = Flask(__name__) UPLOAD_FOLDER_content = 'static/uploads/content' UPLOAD_FOL...
asapacsin/image-style-transfer-web
image-style-transfer-web/main copy.py
main copy.py
py
2,944
python
en
code
0
github-code
97
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 32, "usage_type": "call" }, { "api_name": "flask.request.files", "line_number": 37, "usage_type": "attribute" }, { "api_name": "flask.reque...
74314782400
""" Helpers for sending emails. """ import functools import os import sendgrid from sendgrid.helpers import mail _SENDGRID_API_ENV = 'SENDGRID_API_KEY' @functools.lru_cache() def _sg() -> sendgrid.SendGridAPIClient: """Returns a cached SendGridAPIClient.""" return sendgrid.SendGridAPIClient(api_key=os.envir...
Huntrr/spb
lib/email_utils.py
email_utils.py
py
788
python
en
code
0
github-code
97
[ { "api_name": "sendgrid.SendGridAPIClient", "line_number": 16, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 16, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 16, "usage_type": "attribute" }, { "api_name": "functools.l...
33307348608
import sys, itertools, collections from utils import read_file, timer def step(board): N, M = len(board), len(board[0]) result = [[None]*M for i in range(N)] for i in range(N): for j in range(M): counts = collections.Counter() for dx in range(-1, 2): for dy...
FilippoSimonazzi/Python_Projects
AdventOfCode_2018/2018_18_good_performances.py
2018_18_good_performances.py
py
1,312
python
en
code
0
github-code
97
[ { "api_name": "collections.Counter", "line_number": 11, "usage_type": "call" }, { "api_name": "utils.read_file", "line_number": 31, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 38, "usage_type": "call" }, { "api_name": "utils.timer",...
8673186666
# -*- coding: utf-8 -*- """ Created on Tue Apr 25 17:56:08 2023 @author: shada """ import torch import torch.nn as nn class MLP(nn.Module): def __init__(self, state_dim, action_dim): super(MLP, self).__init__() self.fc1 = nn.Linear(state_dim, 64) self.fc2 = nn.Linear(64, 48)...
Shadab442/dqn-leo-handover-python
dqn_models.py
dqn_models.py
py
593
python
en
code
6
github-code
97
[ { "api_name": "torch.nn.Module", "line_number": 11, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 11, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.nn", "line_nu...
2274650445
""" Combine ESR Leavers data sets into a single file. Steps: 1. Find files in Trust_data/ESR_Leavers 2. Calculate the Termination Year-Month 3. Group by Year-Month, Ward and Leaving Reason and calculate leavers frequency 4. Drop all columns except Organisation, Termination Month, Leaving Reason, Frequency. 5. Save to f...
Stat-Cook/NuRS_Python_Executable
nurs_routines/esr_leavers_monthly_frequency.py
esr_leavers_monthly_frequency.py
py
1,685
python
en
code
1
github-code
97
[ { "api_name": "config.ALLOCATE_WARD_COLUMN", "line_number": 30, "usage_type": "name" }, { "api_name": "pandas.DataFrame", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.concatenate", "line_number": 32, "usage_type": "call" }, { "api_name": "config...
42099826148
import dataclasses import numpy as np import typing import datetime import covid19sim.inference.message_utils as mu class RiskLevelBoundsCheckedType(mu.RiskLevelType): """ Wrapper class aliasing RiskLevelType to bound check passed data to RiskLevelType """ lo_bound = 0 hi_bound = mu.risk_leve...
mila-iqia/COVI-AgentSim
tests/utils/message_context.py
message_context.py
py
15,556
python
en
code
17
github-code
97
[ { "api_name": "covid19sim.inference.message_utils.RiskLevelType", "line_number": 9, "usage_type": "attribute" }, { "api_name": "covid19sim.inference.message_utils", "line_number": 9, "usage_type": "name" }, { "api_name": "covid19sim.inference.message_utils.risk_level_mask", "...
17921751038
import csv import re from stemming.porter2 import stem from check_list import * from data_learner import * # csv_path = "sample.csv" # colom = 'Complaint Text' output = [['Complaint area']] unwanted_words_list = conjuctions + prepositions + pronouns + omit_verbs + ordinals + months + omit_words known_words_list = unw...
manumathew23/car-complaints-text-analytics
car-complaints-text-analytics/text_analytics.py
text_analytics.py
py
3,746
python
en
code
1
github-code
97
[ { "api_name": "re.sub", "line_number": 22, "usage_type": "call" }, { "api_name": "stemming.porter2.stem", "line_number": 43, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 68, "usage_type": "call" }, { "api_name": "csv.reader", "line_number...
38228162870
from flask_restful import Resource, reqparse from werkzeug.datastructures import FileStorage from werkzeug.utils import secure_filename from pytorch_helper.resnet34 import load_model, predict from pytorch_helper.constants import SF_CARS, INDIA_CARS, INDCARS_PARAM, SFCARS_PARAM import os class Predict(Resource): A...
cvproject-dl/dl-cvproject
API(v1)/resources/predict.py
predict.py
py
2,177
python
en
code
0
github-code
97
[ { "api_name": "flask_restful.Resource", "line_number": 9, "usage_type": "name" }, { "api_name": "flask_restful.reqparse.RequestParser", "line_number": 16, "usage_type": "call" }, { "api_name": "flask_restful.reqparse", "line_number": 16, "usage_type": "name" }, { ...
38505176425
import itertools from gavo import base from gavo import rscdef from gavo import svcs from gavo import utils from gavo.registry.model import VS _VOTABLE_TO_SIMPLE_TYPE_MAP = { "char": "char", "bytea": "char", "unicodeChar": "char", "short": "integer", "int": "integer", "long": "integer", "float": "real", "dou...
brianv0/gavo
gavo/registry/tableset.py
tableset.py
py
5,911
python
en
code
1
github-code
97
[ { "api_name": "gavo.base.sqltypeToVOTable", "line_number": 22, "usage_type": "call" }, { "api_name": "gavo.base", "line_number": 22, "usage_type": "name" }, { "api_name": "gavo.registry.model.VS.dataType", "line_number": 25, "usage_type": "call" }, { "api_name": "...
36660508879
from sqlalchemy import Table, Column, String, Integer from utils.datetime import naive_now from .base import metadata, TimeStamp SubscriptionItemsTable = Table( "subscription_items", metadata, Column("id", String(32), primary_key=True), Column("created_at", TimeStamp(), index=True, default=naive_now)...
vuonglv1612/My-Own-App-Engine
billing/infrastructure/postgres/tables/subscription_items.py
subscription_items.py
py
466
python
en
code
0
github-code
97
[ { "api_name": "sqlalchemy.Table", "line_number": 7, "usage_type": "call" }, { "api_name": "base.metadata", "line_number": 9, "usage_type": "argument" }, { "api_name": "sqlalchemy.Column", "line_number": 10, "usage_type": "call" }, { "api_name": "sqlalchemy.String"...
7097201833
from functools import partial from random import randint import torch import numpy from models.point_completion import OccupancyModel from train import MODEL_FILENAME, SHAPENET_CLASS_DIR from utils.constants import DEVICE, POINTCLOUD_N from utils.data_loader import generate_data_loader def generate_grid(ncuts, xl, ...
Akmalleo3/Fall2020_OccupancyNetworksProject
point_completion_occupancy_model/evaluate.py
evaluate.py
py
5,493
python
en
code
0
github-code
97
[ { "api_name": "numpy.linspace", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.meshgrid", "li...
44469780711
from itertools import tee import numpy as np import math def distance_between_points(a, b): """ Calculates the Euclidean distance between two points :param a: first point :param b: second point :return: Euclidean distance between a and b """ return np.linalg.norm(np.array(b) - np.array(a)) ...
Ezte27/Autonomous_Mobile_Robot
AutonomousMobileRobot/path_planning/rrt/utilities/geometry.py
geometry.py
py
2,239
python
en
code
0
github-code
97
[ { "api_name": "numpy.linalg.norm", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.linalg", "line_number": 12, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 12, "usage_type": "call" }, { "api_name": "itertools.tee", "...
22408544558
# Native imports import logging import logging.config from os import getenv from os.path import exists from yaml import safe_load # Imports from main import create_app # Authorship Information __author__ = "Islam Elkadi" __copyright__ = "Copyright 2021, Thea Manager" __credits__ = ["Islam Elkadi"] __license__ = "N/A"...
islam-thea/thea-manager-backend
src/backend/server/application.py
application.py
py
1,521
python
en
code
0
github-code
97
[ { "api_name": "logging.INFO", "line_number": 27, "usage_type": "attribute" }, { "api_name": "os.getenv", "line_number": 45, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 50, "usage_type": "call" }, { "api_name": "yaml.safe_load", "line...
5648561433
from datetime import datetime from flask import request, session, Blueprint, make_response, render_template, redirect from .models import Hacker from hacker_server import db bp = Blueprint('hacker_main', __name__, url_prefix='/') @bp.route('/', methods=["POST", "GET"]) def index(): '''초기 접속 시 실행할 함수''' return...
kafa46/information_security
src/xss_practice_level_01/hacker/hacker_server/hacker_views.py
hacker_views.py
py
944
python
en
code
5
github-code
97
[ { "api_name": "flask.Blueprint", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.redirect", "line_number": 11, "usage_type": "call" }, { "api_name": "models.Hacker.query.order_by", "line_number": 16, "usage_type": "call" }, { "api_name": "models.Hac...
3807861677
from django.db import models # Create your models here. CROP_CHOICES= ( ('Barley', 'Barley'), ('Wheat', 'Wheat'), ('Maize', 'Maize'), ('Sugarcane', 'Sugarcane'), ('Rice','Rice'), ) LOCATION = (('AMRITSAR','Amritsar'), ('BARNALA','Barnala'), ('FARIDKOT','Faridkot'), ...
sparsh1412/FarmAlert
services/models.py
models.py
py
1,272
python
en
code
2
github-code
97
[ { "api_name": "django.db.models.Model", "line_number": 32, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 32, "usage_type": "name" }, { "api_name": "django.db.models.FloatField", "line_number": 33, "usage_type": "call" }, { "api_name...
4017843123
from django.shortcuts import render from cap import caplib import json import xmlsec import os from lxml import etree capMsg = caplib.Alert() def alert(request): return render(request, 'alert.html') def map(request): capMsg.sender = request.POST['source'] if request.POST.has_key('source') else '' capMsg...
aristide-n/CAPComposer
CAPComposer/views.py
views.py
py
3,880
python
en
code
7
github-code
97
[ { "api_name": "cap.caplib.Alert", "line_number": 8, "usage_type": "call" }, { "api_name": "cap.caplib", "line_number": 8, "usage_type": "name" }, { "api_name": "django.shortcuts.render", "line_number": 12, "usage_type": "call" }, { "api_name": "django.shortcuts.re...
7991809749
""" 使用图像增广训练模型 通常只在训练集使用. """ import time import torch from torch import nn, optim from torch.utils.data import Dataset, DataLoader import torchvision from PIL import Image import sys sys.path.append("..") import utils device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') # 下载数据集 if torch.cuda.is_avai...
ygtxr1997/DiveIntoPytorch
Chapter09/9.1.2-ImageAugTrainingModel.py
9.1.2-ImageAugTrainingModel.py
py
2,702
python
en
code
0
github-code
97
[ { "api_name": "sys.path.append", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.device", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", ...
71157504320
import xml.etree.ElementTree as etree import asmmobile.util as util import datetime import dateutil.tz def importer(filename, prefix='elaine-'): events = {} locations = {} root = etree.parse(filename).getroot() offset = util.tzOffsetString( datetime.datetime.now(dateutil.tz.tzlocal()).utcoffset...
Barro/assembly-mobile
src/asmmobile/tools/import-asmtvxml.py
import-asmtvxml.py
py
1,530
python
en
code
0
github-code
97
[ { "api_name": "xml.etree.ElementTree.parse", "line_number": 9, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 9, "usage_type": "name" }, { "api_name": "asmmobile.util.tzOffsetString", "line_number": 10, "usage_type": "call" }, { "api...
9562379702
from sqlalchemy import Integer, ForeignKey, String, Column, Date, Table, Boolean from sqlalchemy.orm import relationship from database import Base, db_session from datetime import datetime import ast from flask_login import current_user from abc import ABCMeta, abstractmethod from flask import Flask, redirect, render_t...
hpy/surveysytem
source/models/courses_model.py
courses_model.py
py
1,680
python
en
code
0
github-code
97
[ { "api_name": "database.Base", "line_number": 13, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 15, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer", "line_number": 15, "usage_type": "argument" }, { "api_name": "sqlalchemy.Col...
37412382712
# convert.py import json from base64 import b64decode from pathlib import Path from datetime import date now = date.today() def convert(): DATA_DIR = Path.cwd() / "responses" #JSON_FILE = DATA_DIR / '/Users/oscartesniere/Documents/GitHub/Projet_NSI_2/responses/image_AI.json' nom = '/Users/oscartesniere...
Oscar-T24/Projet_NSI_2
openAI/convert.py
convert.py
py
910
python
en
code
0
github-code
97
[ { "api_name": "datetime.date.today", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 9, "usage_type": "name" }, { "api_name": "pathlib.Path.cwd", "line_number": 12, "usage_type": "call" }, { "api_name": "pathlib.Path", "...
9385297002
"""Silence Finder.""" from dataclasses import dataclass, field from pathlib import Path import re from rich import print from ..helpers import ffprogress from .SegmentData import SegmentData @dataclass class SilenceFinder: """Finds silence in a file and generates a list of SegmentData's representing the non-sil...
Tsubashi/vid-split
src/vid_split/split/SilenceFinder.py
SilenceFinder.py
py
3,813
python
en
code
0
github-code
97
[ { "api_name": "pathlib.Path", "line_number": 15, "usage_type": "name" }, { "api_name": "dataclasses.field", "line_number": 20, "usage_type": "call" }, { "api_name": "SegmentData.SegmentData", "line_number": 31, "usage_type": "call" }, { "api_name": "helpers.ffprog...
74562099520
from typing import Optional, List from lang.python.helper import TreeNode, print_tree class Solution: def pathSum(self, root: Optional[TreeNode], targetSum: int) -> List[List[int]]: # print_tree(root) return self.m2(root, targetSum) result = [] self.m1(root, targetSum, [], result) ...
HotHat/leetcode
lang/python/s113.py
s113.py
py
1,386
python
en
code
0
github-code
97
[ { "api_name": "typing.Optional", "line_number": 6, "usage_type": "name" }, { "api_name": "lang.python.helper.TreeNode", "line_number": 6, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 6, "usage_type": "name" } ]
9078575053
import logging import pytest import copy from math import ceil from ..cim_tests import FieldTestHelper from ..utilities.log_helper import format_search_query_log from ..utilities.log_helper import get_table_output MAX_TIME_DIFFERENCE = 45 LOGGER = logging.getLogger("pytest-splunk-addon") class IndexTimeTestTemplate...
splunk/pytest-splunk-addon
pytest_splunk_addon/standard_lib/index_tests/test_templates.py
test_templates.py
py
10,793
python
en
code
51
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 19, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 73, "usage_type": "call" }, { "api_name": "utilities.log_helpe...
606912316
import matplotlib.pyplot as plt import numpy as np def plot_patterns( data, patterns, i_pattern, show_symbols=True ): """ Colorify the toy dataset for visual interpretation of the patterns. """ n_row = data.shape[0] n_col = data.shape[1] _, ax = plt.subplots(...
axelroques/NetTree
nettree/plot.py
plot.py
py
1,681
python
en
code
0
github-code
97
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 19, "usage_type": "name" }, { "api_name": "numpy.arange", "line_number": 58, "usage_type": "call" }, { "api_name": "matplotlib....
24126671767
# pip3 install pysocks import sys import threading import requests import socks import socket import re # Variables globales que indican los parametros a usar cantidad_hilos = 1 cantidad_repeticiones = 10 url = None puerto = 80 # Lista de hilos que habran trabajando. hilos = [] # Funcion que se encarga de manejar ...
jujoar/AtaqueDeLosClones
stress.py
stress.py
py
3,201
python
es
code
0
github-code
97
[ { "api_name": "sys.argv", "line_number": 23, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 25, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 28, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number...
11122407459
from typing import List from promformat.parser.PromQLParser import PromQLParser class Expr: def __init__(self, ctx): self.ctx = ctx class Literal(Expr): def __init__(self, ctx, value): super(Literal, self).__init__(ctx) self.value = value class Number(Literal): pass class St...
alxric/promformat
promformat/ast_nodes.py
ast_nodes.py
py
5,492
python
en
code
null
github-code
97
[ { "api_name": "promformat.parser.PromQLParser.PromQLParser.LabelMatcherContext", "line_number": 120, "usage_type": "attribute" }, { "api_name": "promformat.parser.PromQLParser.PromQLParser", "line_number": 120, "usage_type": "name" }, { "api_name": "typing.List", "line_number...
28829480406
from typing import List, Dict from clang import cindex from . import entity_base from pybind11_weaver.utils import fn import logging from pybind11_weaver import gen_unit _logger = logging.getLogger(__name__) class MethodCoder: def __init__(self, cursor, scope_full_name, inject_docstring): self.inect...
edimetia3d/pybind11_weaver
pybind11_weaver/entity/klass.py
klass.py
py
5,276
python
en
code
3
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "pybind11_weaver.utils.fn.get_fn_pointer_type", "line_number": 41, "usage_type": "call" }, { "api_name": "pybind11_weaver.utils.fn", "line_number": 41, "usage_type": "name" }, ...
316887275
from click.testing import CliRunner from json import dumps from flask import Flask, jsonify, request, Response import sys import os import re sys.path.append( "/home/luuthanh/Desktop/Keyword_extraction/Backend/Module") from Module.yake import highlight from Module.yake import yake app = Flask(__name__) # def pre...
anhquan1012/Keyword_extraction
Backend/api.py
api.py
py
2,182
python
en
code
1
github-code
97
[ { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "flask.Flask", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.request.method", "l...
29925332688
#!/usr/bin/env python # coding: utf-8 # In[3]: import numpy as np import pandas as pd # In[4]: movies = pd.read_csv('tmdb_5000_movies.csv') credits = pd.read_csv('tmdb_5000_credits.csv') # In[5]: movies.head(2) # In[6]: credits.head() # In[7]: movies['title'].head() ...
IshaanDixit18/Movie-Recommender-System
Movie Recommendation System.py
Movie Recommendation System.py
py
6,693
python
en
code
0
github-code
97
[ { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 15, "usage_type": "call" }, { "api_name": "ast.literal_eval", "line_number": 151, "usage_type": "attribute" }, { "api_name": "ast.literal_ev...
37703010392
# %% import datetime from unicodedata import name from numpy.testing._private.utils import tempdir import requests import pandas as pd import numpy as np from io import BytesIO from zipfile import ZipFile from xml.etree.ElementTree import parse from tqdm import tqdm # import dbconfig # from hiroku import hiroku import ...
leeway00/KRX_financial_crawlers
Korea_data/fundamental_dart_old.py
fundamental_dart_old.py
py
8,005
python
en
code
2
github-code
97
[ { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 88, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 88, "usage_type": "attribute" }, { "api_name": "req...
21882133121
from UM.Extension import Extension from cura.CuraApplication import CuraApplication from UM.Logger import Logger from UM.Settings.SettingDefinition import SettingDefinition from UM.Settings.DefinitionContainer import DefinitionContainer from UM.Settings.ContainerRegistry import ContainerRegistry from UM.i18n import i1...
ollyfg/cura_pressure_advance_setting
PressureAdvanceSettingPlugin.py
PressureAdvanceSettingPlugin.py
py
5,907
python
en
code
7
github-code
97
[ { "api_name": "UM.i18n.i18nCatalog", "line_number": 9, "usage_type": "call" }, { "api_name": "typing.TYPE_CHECKING", "line_number": 17, "usage_type": "name" }, { "api_name": "UM.Extension.Extension", "line_number": 20, "usage_type": "name" }, { "api_name": "cura.C...
19209354458
import json from data import User import logging class UserApi: @staticmethod def fetch_user(token): try: user = User.get(token) response = { 'uid': user.user_id, 'name': user.name, 'status': user.status, 'email': ...
LiSe-Team/LiSe
api/user_api.py
user_api.py
py
558
python
en
code
0
github-code
97
[ { "api_name": "data.User.get", "line_number": 10, "usage_type": "call" }, { "api_name": "data.User", "line_number": 10, "usage_type": "name" }, { "api_name": "logging.error", "line_number": 21, "usage_type": "call" } ]
33541932748
import cv2 as cv import numpy as np import pyttsx3 engine = pyttsx3.init() engine.setProperty('rate',150) detector = cv.CascadeClassifier(r"Face_Detect/haar_cascade.xml") recognizer = cv.face.LBPHFaceRecognizer.create() recognizer.read("Face_Detect/face_trainer.yml") img_path = "D:/IFP/Images/test.jpg" names = [...
Saisandeepsangeetham/IFP
Face_Detect/pi_code_face_detect.py
pi_code_face_detect.py
py
1,507
python
en
code
0
github-code
97
[ { "api_name": "pyttsx3.init", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.CascadeClassifier", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.face.LBPHFaceRecognizer.create", "line_number": 11, "usage_type": "call" }, { "api_name": "c...
39646433086
''' 以下を順に実行 1. 静止画を表示 2. "q"を押されたら動画を表示 3. escか"q"を押されるor動画終了で元の静止画を表示 4. "q"を押されたら終了 *sample.png,sample.mp4は同じフォルダに入れておくこと ''' # 動画再生用 import vlc # 動画再生中にキー入力を検知する用 pygameやmsvcrtでは検出できなかった。ブロックされている?? # import pygame # import sys # import msvcrt from pynput import keyboard # 静止画表示用 import cv2 ...
akahane-yasuhiko/vlc-python-sample
app.py
app.py
py
3,236
python
ja
code
0
github-code
97
[ { "api_name": "vlc.Instance", "line_number": 32, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 51, "usage_type": "call" }, { "api_name": "pynput.keyboard.Key", "line_number": 56, "usage_type": "attribute" }, { "api_name": "pynput.keyboard", ...
22196820121
from fastapi import APIRouter, Depends from fastapi.logger import logger as fastapi_logger from fastapi_plugins import depends_redis from aioredis import Redis from pydantic import BaseModel router = APIRouter( prefix="/wordcount", tags=["wordcount"] ) WORD_COUNT_KEY = "wordcount" @router.get("") async def r...
lisy09/spark-dev-box
word-count-api/server/routers/v1/endpoints/wordcount.py
wordcount.py
py
1,130
python
en
code
0
github-code
97
[ { "api_name": "fastapi.APIRouter", "line_number": 7, "usage_type": "call" }, { "api_name": "aioredis.Redis", "line_number": 16, "usage_type": "name" }, { "api_name": "fastapi.Depends", "line_number": 16, "usage_type": "call" }, { "api_name": "fastapi_plugins.depen...
24123357687
# write_emitimes_files_L1L2nc.py from utilvolc import write_emitimes as we from datetime import datetime, timedelta from glob import glob wdir = '/hysplit-users/allisonr/Soufriere/Data_Insertion/' vdir = '/pub/ECMWF/JPSS/VOLCAT/Vincent/Ash/' vid = None correct_parallax = False decode_times = True # vfiles = '*'+vid+'...
noaa-oar-arl/utilhysplit
utilvolc/tools/write_emitimes_files_L1L2nc.py
write_emitimes_files_L1L2nc.py
py
846
python
en
code
9
github-code
97
[ { "api_name": "glob.glob", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 21, "usage_type": "name" }, { "api_name": "utilvolc.write...
16243449224
from google.colab import drive drive.mount('/content/drive') import pandas as pd import numpy as np from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelEncoder import xgboost as xgb path = '/content/drive/MyDrive/DSA3101_Share/' df = pd.read_csv(path+'2006_to_2008_preprocessed....
austinloh/dsa3101-2220-03-airline
backend/model/XGBoost/XGBoost_Model.py
XGBoost_Model.py
py
3,521
python
en
code
2
github-code
97
[ { "api_name": "google.colab.drive.mount", "line_number": 2, "usage_type": "call" }, { "api_name": "google.colab.drive", "line_number": 2, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.numbe...
30574781997
import numpy as np import matplotlib.pyplot as plt from .utils import compute_error, dict_sim def _omp_solver(A, y, k0): r = y x = np.zeros((A.shape[1],)) x_mask = np.zeros((A.shape[1],), dtype=bool) xs = None for k in range(k0): # print(A.shape, r.shape) inner_prod = np.abs(A.T @...
10258392511/ImageAnalysis
SparseModel/dict_learning/helpers/train.py
train.py
py
3,622
python
en
code
0
github-code
97
[ { "api_name": "numpy.zeros", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.abs", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.argmax", "line_number": 15...
7709362407
from .dataset import Dataset import pandas as pd def read_csv(*args, **kwargs): '''Passes along all arguments and kwargs to :func:`pandas.read_csv` then casts to :class:`Dataset`. This method is just a helper wrapper function. You can also pass args for init'ing the Dataset, like roles or targets. ...
sahahn/BPt
BPt/dataset/funcs.py
funcs.py
py
6,029
python
en
code
10
github-code
97
[ { "api_name": "dataset.Dataset", "line_number": 21, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 21, "usage_type": "call" }, { "api_name": "pandas.isnull", "line_number": 26, "usage_type": "call" }, { "api_name": "pandas.concat", "li...
22034198862
from datetime import ( datetime, timedelta, ) from typing import Optional import pytest from pydantic import BaseModel from reconcile.utils import expiration TODAY = datetime.utcnow().date() YESTERDAY = TODAY - timedelta(days=1) TOMORROW = TODAY + timedelta(days=1) NEXT_WEEK = TODAY + timedelta(days=7) LAST_...
app-sre/qontract-reconcile
reconcile/test/utils/test_expiration.py
test_expiration.py
py
2,727
python
en
code
25
github-code
97
[ { "api_name": "datetime.datetime.utcnow", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 12, "usage_type": "name" }, { "api_name": "datetime.timedelta", "line_number": 13, "usage_type": "call" }, { "api_name": "datetim...
24682713646
import os import numpy as np from typing import List, Dict, Tuple, Union, Optional import random from gensim.models import Word2Vec import pickle import openpyxl import re from copy import deepcopy from collections import namedtuple import matplotlib.pyplot as plt import matplotlib as mpl import matplotlib.font_manager...
saraitne11/skcc_4_1_ML
ReferenceCodes/RNN/utils.py
utils.py
py
24,703
python
en
code
0
github-code
97
[ { "api_name": "collections.namedtuple", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.expanduser", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "os.path.join",...
26183682486
import tweepy import time consumer_key = 'ZDyySngKigmSXfXqoYu0k5VvP' consumer_secret = 'XbunRKnPSJsA689f20Yezu7dZ4Qde2wlJ2OOjoJo8bWHfjpxS2' access_token = '1254713164274577408-lLZJsmD84HAA0R1p4eU47OklnuOirL' access_token_secret = 'RhNh8gZXP5tyfuWuHQvGjsY8X0u1FhWnnJ6Fug9SmyiFC' auth = tweepy.OAuthHandler(consumer_key,...
willOnyema/Scripting-Projects
TweeterBot/ztmbot.py
ztmbot.py
py
993
python
en
code
0
github-code
97
[ { "api_name": "tweepy.OAuthHandler", "line_number": 9, "usage_type": "call" }, { "api_name": "tweepy.API", "line_number": 12, "usage_type": "call" }, { "api_name": "tweepy.RateLimitError", "line_number": 21, "usage_type": "attribute" }, { "api_name": "time.sleep",...
16302244607
import os import time import argparse from tqdm import tqdm from PIL import ImageFile from datetime import datetime from contextlib import ExitStack import torch import torch.nn as nn import torch.optim as optim import torch.distributed as dist import torchvision.datasets as datasets import torchvision from models.res...
DamonAtSjtu/HAWIS
training_test/trainer_ImageNet.py
trainer_ImageNet.py
py
10,281
python
en
code
1
github-code
97
[ { "api_name": "PIL.ImageFile.LOAD_TRUNCATED_IMAGES", "line_number": 28, "usage_type": "attribute" }, { "api_name": "PIL.ImageFile", "line_number": 28, "usage_type": "name" }, { "api_name": "torch.backends", "line_number": 29, "usage_type": "attribute" }, { "api_na...
11732416150
import os import sys from paste.script.serve import ServeCommand from karl.scripting import get_default_config import logging logging.basicConfig() def main(): os.environ['PASTE_CONFIG_FILE'] = get_default_config() cmd = ServeCommand('karl') cmd.description = """\ Run the KARL application. If st...
karlproject/karl
karl/scripts/karlctl.py
karlctl.py
py
680
python
en
code
48
github-code
97
[ { "api_name": "logging.basicConfig", "line_number": 7, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 10, "usage_type": "attribute" }, { "api_name": "karl.scripting.get_default_config", "line_number": 10, "usage_type": "call" }, { "api_name": "...
37851135161
import json import logging from trie import Trie import pickle # the query processor that search for the IDs according to the input query, def query_processor(created_inv_index, created_trie): while True: input_query = input("Enter your query:(Press \"quit\" for terminate.) ") if input_query == "q...
sertayy/University_Projects
bogazici/CMPE493 | Introduction to Information Retrieval/CMPE493_Project_2/query.py
query.py
py
2,245
python
en
code
0
github-code
97
[ { "api_name": "json.load", "line_number": 38, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 44, "usage_type": "call" }, { "api_name": "trie.Trie", "line_number": 50, "usage_type": "call" }, { "api_name": "logging.error", "line_number": 56...
26188333578
import twitter import datetime from settings import CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET api = twitter.Api(consumer_key=CONSUMER_KEY, consumer_secret=CONSUMER_SECRET, access_token_key=ACCESS_TOKEN, access_token_secret=ACCESS_TOKEN_SECRET...
Pooort/twitter_lists
network/twitter.py
twitter.py
py
896
python
en
code
0
github-code
97
[ { "api_name": "twitter.Api", "line_number": 5, "usage_type": "call" }, { "api_name": "settings.CONSUMER_KEY", "line_number": 5, "usage_type": "name" }, { "api_name": "settings.CONSUMER_SECRET", "line_number": 6, "usage_type": "name" }, { "api_name": "settings.ACCE...
27394747438
import requests from twilio.rest import Client TWILIO_ACCOUNT_SID = 'hidden' TWILIO_AUTH_TOKEN ='hidden' #account_sid = os.environ['TWILIO_ACCOUNT_SID'] #auth_token = os.environ['TWILIO_AUTH_TOKEN'] account_sid = TWILIO_ACCOUNT_SID auth_token = TWILIO_AUTH_TOKEN # hourly forecast for next 48 hours for Denver my_key ='...
denisetra/100days-FirstAttempt
WeatherAlerts-SMS-Day35/weather_alert_main.py
weather_alert_main.py
py
1,495
python
en
code
0
github-code
97
[ { "api_name": "requests.get", "line_number": 26, "usage_type": "call" }, { "api_name": "twilio.rest.Client", "line_number": 42, "usage_type": "call" } ]
70214600958
import torch import torch.nn as nn """ Convolutional block: It follows a two 3x3 convolutional layer, each followed by a batch normalization and a relu activation. """ class conv_block(nn.Module): def __init__(self, in_c, out_c, activation = "relu"): super().__init__() self.conv1 = nn.Conv2d(i...
aditya-nutakki/pfs
ddpm/unet.py
unet.py
py
4,790
python
en
code
0
github-code
97
[ { "api_name": "torch.nn.Module", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 7, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
18699752838
from motion_detector import df from bokeh.plotting import figure, show, output_file from bokeh.models import HoverTool, ColumnDataSource # Add new columns to the dataframe which is the datetime values converted into strings # These will be provided to the HoverTool for use in the tooltips df["Start_string"] = d...
tonyc4800/Motion-Detection-with-Webcam
main.py
main.py
py
1,062
python
en
code
0
github-code
97
[ { "api_name": "motion_detector.df", "line_number": 7, "usage_type": "name" }, { "api_name": "motion_detector.df", "line_number": 8, "usage_type": "name" }, { "api_name": "bokeh.models.ColumnDataSource", "line_number": 11, "usage_type": "call" }, { "api_name": "mot...
22621175610
import os import shutil from datetime import datetime import time start_time = datetime.now() PATH_PHONE = r"C:\Users\HP\python\агрегатор\photo_phone" PATH_PC = r"C:\Users\HP\python\агрегатор\photo_PC" def aggregator(path_phone: str, path_PC: str): dir_phone = os.listdir(path_phone) for file in dir_phone: ...
slaukan/pars_photo
pars_photo.py
pars_photo.py
py
1,484
python
ru
code
0
github-code
97
[ { "api_name": "datetime.datetime.now", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 6, "usage_type": "name" }, { "api_name": "os.listdir", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.join", "...
70167283840
from pyquery import PyQuery as pq from ..models import GroupBuyItem, USER_AGENT from .base import PyQueryBasedScraper from .util import extract_shipping_date URL = "https://cannonkeys.com/pages/group-buy-status" class CannonkeysScraper(PyQueryBasedScraper): def _get_url(self): return URL def _scrap...
anticlockwise/key_updates
keyup/scrapers/cannonkeys.py
cannonkeys.py
py
2,096
python
en
code
0
github-code
97
[ { "api_name": "base.PyQueryBasedScraper", "line_number": 10, "usage_type": "name" }, { "api_name": "pyquery.PyQuery", "line_number": 28, "usage_type": "call" }, { "api_name": "models.GroupBuyItem", "line_number": 35, "usage_type": "call" }, { "api_name": "util.ext...
16579895599
import hashlib import json import os import time from datetime import datetime from urllib import parse, request import pytumblr from bs4 import BeautifulSoup from src.config import * def build_binary_local_name(reduced_like, middlefix='', binary_url=''): if reduced_like['like_type'] == 'audio': remote_...
zentechinc/tumblr_tools
src/main.py
main.py
py
18,969
python
en
code
0
github-code
97
[ { "api_name": "urllib.request.urlopen", "line_number": 16, "usage_type": "call" }, { "api_name": "urllib.request", "line_number": 16, "usage_type": "name" }, { "api_name": "os.path.abspath", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "...
16155679907
# biblioteka za ogranicenja import constraint # 1. definisanje problema problem = constraint.Problem() # print(problem) # 2. definisanje promenljivih problem.addVariable('x', ['a', 'b', 'c']) problem.addVariable('y', [1, 2]) problem.addVariable('z', [0.1, 0.2, 0.3]) # 3. definisanje ogranicenja i dodavanje ogranicen...
natasablagojevic/pp
vezbe/03/01.py
01.py
py
809
python
sh
code
0
github-code
97
[ { "api_name": "constraint.Problem", "line_number": 5, "usage_type": "call" } ]
26722715497
import matplotlib.pyplot as plt def read_file(filename): # 讀取檔案 prices = [] with open(filename, 'r') as f: for line in f: if 'Adj Close' in line: continue data = line.strip().split(',') prices.append(float(data[5])) return prices def three_days...
jym197228/stock_technical_analysis_ver1
sta1.py
sta1.py
py
3,368
python
en
code
0
github-code
97
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 85, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 85, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.xlabel", "line_number": 86, "usage_type": "call" }, { "api_name": "mat...
40349044947
import numpy as np import cv2 from scipy.ndimage import label from PIL import Image __all__ = ["apply_mask", "concat", "threshold"] def threshold(attention_map, threshold_value): # Convert the attention_map to NumPy array if it's a Pillow Image if isinstance(attention_map, Image.Image): attention_map ...
mshenoda/label-diffusion
labeldiffusion/image_processing.py
image_processing.py
py
4,509
python
en
code
0
github-code
97
[ { "api_name": "PIL.Image.Image", "line_number": 10, "usage_type": "attribute" }, { "api_name": "PIL.Image", "line_number": 10, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_n...
20110283881
from typing import Optional from structlog import BoundLogger from cr_kyoushi.simulation import ( states, transitions, ) from cr_kyoushi.simulation.util import now from .config import Context __all__ = ["ActivitySelectionState", "WebsiteState", "LeavingWebsite"] class ActivitySelectionState(states.Probab...
ait-aecid/kyoushi-statemachines
src/cr_kyoushi/statemachines/web_browser/states.py
states.py
py
2,493
python
en
code
1
github-code
97
[ { "api_name": "cr_kyoushi.simulation.states.ProbabilisticState", "line_number": 17, "usage_type": "attribute" }, { "api_name": "cr_kyoushi.simulation.states", "line_number": 17, "usage_type": "name" }, { "api_name": "cr_kyoushi.simulation.transitions.Transition", "line_number...
45480133872
from deck import Deck import pandas as pd import numpy as np import matplotlib.pyplot as plt the_deck=Deck(1,13,4) sum_face=0 #number of occurrence new_list=[0]*13 num_occurrence=new_list[:] #each loop, shuffle deck, draw card--add the value to sum and its occurrence +1 for i in range(1000): the_deck.shuffle() ...
Linglinglinglinglingling/Python_program
Assignment/data_analysis/backup/fairness.py
fairness.py
py
987
python
en
code
1
github-code
97
[ { "api_name": "deck.Deck", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 24, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.legend", ...
5606777743
from __future__ import absolute_import from __future__ import division from __future__ import print_function import pkgutil import compas_convert from compas_convert.universal_converter.type_converter_match import TypeConverterMatch class UniversalConverter(object): def __init__(self): self._converters ...
biodigitalmatter/compas_convert
src/compas_convert/universal_converter/universal_converter.py
universal_converter.py
py
5,093
python
en
code
3
github-code
97
[ { "api_name": "pkgutil.iter_modules", "line_number": 95, "usage_type": "call" }, { "api_name": "compas_convert.__path__", "line_number": 95, "usage_type": "attribute" }, { "api_name": "compas_convert.universal_converter.type_converter_match.TypeConverterMatch", "line_number":...
40096631534
import numpy as np from time import sleep from qcodes import ( load_by_run_spec, ) from qcodes.utils.dataset.doNd import do1d, do2d, dond, plot, LinSweep, LogSweep from qcodes.instrument_drivers.stanford_research.SR830 import SR830 from measurement_toolkit.parameters.general_parameters import RepetitionParameter ...
nulinspiratie/measurement_toolkit
measurement_toolkit/measurements/noise_measurements.py
noise_measurements.py
py
5,162
python
en
code
0
github-code
97
[ { "api_name": "qcodes.instrument_drivers.stanford_research.SR830.SR830", "line_number": 33, "usage_type": "argument" }, { "api_name": "qcodes.utils.dataset.doNd.LinSweep", "line_number": 44, "usage_type": "call" }, { "api_name": "measurement_toolkit.parameters.general_parameters....
2228901614
import torch import torch.nn as nn import torch.nn.functional as F class VectorQuantizer(nn.Module): def __init__(self, embed_dim, n_embed): """ Args: embed_dim: dimensionality of the tensors in the quantized space. Inputs to the modules must be in this format as well. n_embed: number of...
pneves1051/vqgan-music
models/vq_vae/modules.py
modules.py
py
7,966
python
en
code
0
github-code
97
[ { "api_name": "torch.nn.Module", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 6, "usage_type": "name" }, { "api_name": "torch.empty", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.nn.Parameter", "lin...
26855579976
import argparse import torch import numpy as np from robot.controller.pets.envs import make from robot.envs.hyrule.rl_env import ArmReachWithXYZ from robot.model.gnn.gnn_forward import GNNForwardAgent from robot.model.arm.extra.forward import Worker from robot.model.arm.dataset import Dataset from robot.mod...
hzaskywalker/torch_robotics
robot/model/arm/test/test_gnn_arm.py
test_gnn_arm.py
py
4,021
python
en
code
2
github-code
97
[ { "api_name": "robot.envs.hyrule.rl_env.ArmReachWithXYZ", "line_number": 14, "usage_type": "name" }, { "api_name": "torch.tensor", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 24, "usage_type": "call" }, { "api_name": "tor...
11731773240
from pyramid.renderers import get_renderer from pyramid.decorator import reify class Navigation(object): ''' Encapsulate the logic for building the navigation above each calendar. ''' def __init__(self, calendar_presenter): self._presenter = calendar_presenter self._init_left_side() ...
karlproject/karl
karl/content/calendar/navigation.py
navigation.py
py
1,486
python
en
code
48
github-code
97
[ { "api_name": "pyramid.renderers.get_renderer", "line_number": 40, "usage_type": "call" }, { "api_name": "pyramid.decorator.reify", "line_number": 37, "usage_type": "name" } ]
27694746948
# -*- coding: utf-8 -*- from superjson import json from pathlib_mate import Path from seedinvest_monitor.devops.config import Config config = Config() if config.is_aws_lambda_runtime(): config.update_from_env_var(prefix="SEEDINVEST_MONITOR_") else: config.update(json.load(Path(config.CONFIG_DIR, "00-config-sh...
MacHu-GWU/seedinvest_monitor-project
seedinvest_monitor/devops/config_init.py
config_init.py
py
550
python
en
code
0
github-code
97
[ { "api_name": "seedinvest_monitor.devops.config.Config", "line_number": 7, "usage_type": "call" }, { "api_name": "superjson.json.load", "line_number": 11, "usage_type": "call" }, { "api_name": "superjson.json", "line_number": 11, "usage_type": "name" }, { "api_nam...
27923273255
from concurrent.futures import Executor, Future, InvalidStateError from contextlib import suppress from queue import SimpleQueue from typing import Any, Callable, TypeVar, cast T = TypeVar("T") class SingleThreadExecutor: def __init__(self, pool: Executor) -> None: self._q: SimpleQueue = SimpleQueue() ...
solomankabir123/coq-nvim-test
coq/shared/executor.py
executor.py
py
944
python
en
code
0
github-code
97
[ { "api_name": "typing.TypeVar", "line_number": 6, "usage_type": "call" }, { "api_name": "concurrent.futures.Executor", "line_number": 10, "usage_type": "name" }, { "api_name": "queue.SimpleQueue", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.Ca...
18836934764
from __future__ import annotations import datetime import os import re import logging import base64 import json from typing import Optional, Union, List, TYPE_CHECKING import discord from google.oauth2.credentials import Credentials from google.auth.exceptions import RefreshError from googleapiclient.discovery import...
0xgreenapple/peepbot
handler/youtube.py
youtube.py
py
13,346
python
en
code
0
github-code
97
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 19, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 22, "usage_type": "call" }, { "api_name": "typing.Optional", "line_number": 45, "usage_type": "name" }, { "api_name": "handler.databa...