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
1322353770
from resizer import * import argparse if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument( "--src", type=str, required=True, help="The directory of the folder with the image to be resized.", ) parser.add_argument( "--width", type=int...
hjk1996/Image-Resizer
main.py
main.py
py
1,243
python
en
code
0
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 5, "usage_type": "call" } ]
42243204047
import numpy as np import argparse import sys import matplotlib.pyplot as plt from datetime import datetime max_value = 6 def classify(w, sample): return (np.sign(np.dot(w, sample))) def generate_dataset(num_data_points, dimension): # generate x0 of each data point (always 1) x0 = np.ones(shape=(num_data...
mjuvilla/ML-UPF-Homework
H1/ml_h1.py
ml_h1.py
py
4,452
python
en
code
1
github-code
36
[ { "api_name": "numpy.sign", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.random.random", "line_numbe...
21247224214
__author__ = 'yuerzx' import csv import pymongo from pymongo import MongoClient data_client = MongoClient() data_base = data_client.Locations #add authenticate for the MongoDB data_base.authenticate('EZYProperty', '8jshf7asd') super_c = data_base.supermarket counter = 0 err_counter = 0 with open("/home/yuerzx/Desktop...
yuerzx/python_information
supermarket_location/import_into_mongodb.py
import_into_mongodb.py
py
1,237
python
en
code
0
github-code
36
[ { "api_name": "pymongo.MongoClient", "line_number": 6, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 15, "usage_type": "call" }, { "api_name": "csv.QUOTE_MINIMAL", "line_number": 15, "usage_type": "attribute" } ]
74753775465
from prophepy import Mock from .builtin_matchers import get_matcher from .exceptions import CustomMatcherError from .utils import map_for_dict, reveal_if_needed class Subject: ''' This class represents the specced object. ''' def __init__(self, value, object_behavior): ''' It is instanc...
Einenlum/specify
specify/subject.py
subject.py
py
2,436
python
en
code
0
github-code
36
[ { "api_name": "exceptions.CustomMatcherError", "line_number": 29, "usage_type": "call" }, { "api_name": "builtin_matchers.get_matcher", "line_number": 53, "usage_type": "call" }, { "api_name": "utils.reveal_if_needed", "line_number": 63, "usage_type": "argument" }, { ...
69829306344
from torchvision import transforms, datasets import h5py import os import numpy as np import torch from torch.utils.data.dataset import Dataset from torch.utils.data import DataLoader #参考:https://blog.csdn.net/shwan_ma/article/details/100012808 #https://github.com/pbizopoulos/signal2image-modules-in-deep-neural-networ...
im-wll/EEG-process
dataset/dataloader.py
dataloader.py
py
3,865
python
en
code
1
github-code
36
[ { "api_name": "torch.utils.data.dataset.Dataset", "line_number": 12, "usage_type": "name" }, { "api_name": "h5py.File", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.copy", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.asarray",...
70808020583
from flask import Flask, request, jsonify from a_entities.bank_account import BankAccount from a_entities.customer import Customer from b_data_access_layer.postgres_bank_account_dao import BankAccountPostgresDAO from b_data_access_layer.postgres_customer_dao import CustomerPostgresDAO from c_service_layer.postgres_ban...
bluedragonscales/project0_banking
main.py
main.py
py
7,753
python
en
code
0
github-code
36
[ { "api_name": "logging.basicConfig", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 12, "usage_type": "attribute" }, { "api_name": "flask.Flask", "line_number": 16, "usage_type": "call" }, { "api_name": "b_data_access_laye...
24537866239
from operator import itemgetter, add from pathlib import Path banks = list(map(int, Path("day6.txt").read_text().split())) n, history = len(banks), {} while tuple(banks) not in history: history[tuple(banks)] = len(history) i, mx = max(enumerate(banks), key = itemgetter(1)) banks[i] = 0 for i in range(i + 1, i...
AlexBlandin/Advent-of-Code
2017/day6.py
day6.py
py
675
python
en
code
0
github-code
36
[ { "api_name": "pathlib.Path", "line_number": 4, "usage_type": "call" }, { "api_name": "operator.itemgetter", "line_number": 9, "usage_type": "call" }, { "api_name": "operator.add", "line_number": 15, "usage_type": "argument" } ]
8882346001
import simplejson as json from datetime import datetime DEBUG = False # Zigbee catch-all decoder, just adds the following properties: # Only changes topic: # csn-zigbee/acp_id -> acp/acp_id/csn-zigbee class Decoder(object): def __init__(self, settings=None): print(" zigbee_catchall init()") re...
AdaptiveCity/acp_local_mqtt
acp_decoders/decoders/zigbee_catchall.py
zigbee_catchall.py
py
1,788
python
en
code
1
github-code
36
[ { "api_name": "simplejson.loads", "line_number": 54, "usage_type": "call" } ]
29391322952
from collections import defaultdict class Solution: def longestStrChain(self, words: List[str]) -> int: n = len(words) words.sort(key=lambda word: len(word)) graph = defaultdict(set) for i, word in enumerate(words): for j in range(len(word)): graph[word...
AnotherPianist/LeetCode
1129-longest-string-chain/1129-longest-string-chain.py
1129-longest-string-chain.py
py
587
python
en
code
1
github-code
36
[ { "api_name": "collections.defaultdict", "line_number": 8, "usage_type": "call" } ]
21254500663
import json import boto3 from datetime import datetime current_date_time = datetime.now() sqs = boto3.resource('sqs', region_name='us-east-1') def lambda_handler(event, context): queue = sqs.get_queue_by_name (QueueName='CustomerOrders') date_time = current_date_time.strftime("%d/%m/%Y %H:%M:%S") ...
tmachek98/python-boto3
Lambda.py
Lambda.py
py
563
python
en
code
0
github-code
36
[ { "api_name": "datetime.datetime.now", "line_number": 5, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 5, "usage_type": "name" }, { "api_name": "boto3.resource", "line_number": 7, "usage_type": "call" }, { "api_name": "json.dumps", ...
11875963511
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Mar 17 12:34:56 2019 @author: stark """ import requests from PageLinker import LinkFinder from domain import * from utility import * class Spider: projectName = '' baseURL = '' domainName = '' queueFile = '' crawledFile = '' ...
pandafy/WebCrawler
spider.py
spider.py
py
3,354
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 59, "usage_type": "call" }, { "api_name": "PageLinker.LinkFinder", "line_number": 64, "usage_type": "call" } ]
1653425451
import numpy import matplotlib.pyplot as plt import pylab import dcf import utility as util import logistic_regression as lr import svm from tqdm import tqdm from copy import deepcopy from preprocessing import preprocess_Z_score import matplotlib # ======================================== FEATURES plots ============...
srrmtt/GenderVoiceDetection
plot.py
plot.py
py
19,657
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.pyplot.Figure", "line_number": 22, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 22, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.xlabel", "line_number": 23, "usage_type": "call" }, { "api_name": "m...
3273808823
# This is a sample Python script. #########################################: Please Don't Change :####################################### import logging import os import sys from datetime import datetime sys.path.append( "/home/sonu/workspace/pro/component/" ) sys.path.append( "/home/sonu/workspace/pro/utils/...
rajeshraj124/advanced_logger_with_single_place_credentials
pro_sample/main.py
main.py
py
1,997
python
en
code
0
github-code
36
[ { "api_name": "sys.path.append", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.path", "line_numb...
34796334569
from django.urls import resolve, reverse from .. import views from .test_recipes_base import RecipesTestBase class RecipesSearchViewTest(RecipesTestBase): def test_search_view_function_is_correct(self): view = resolve(reverse('recipes:search')) self.assertIs(view.func, views.search) def test...
giovcandido/django-course-project1
recipes/tests/test_recipes_search_view.py
test_recipes_search_view.py
py
1,872
python
en
code
0
github-code
36
[ { "api_name": "test_recipes_base.RecipesTestBase", "line_number": 7, "usage_type": "name" }, { "api_name": "django.urls.resolve", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.reverse", "line_number": 9, "usage_type": "call" }, { "api_name":...
22869043882
import pygame, sys #기본세팅 import random, time #내가 추가한 것 from pygame.locals import * #Set up pygame. pygame.init() #상수 정의 SCREEN =8 BLACK = (0,0,0) GREEN = (0, 128, 0) WHITE = (255, 255, 255) BLUE = (0,0,255) RED = (255,0,0) YELLOW = (255,204,51) screen = pygame.display.set_mode((600,400), 0,32) pyg...
Choiseungpyo/Othello_Python
Othello.py
Othello.py
py
22,209
python
en
code
0
github-code
36
[ { "api_name": "pygame.init", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 18, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 18, "usage_type": "attribute" }, { "api_name": "pygame.display...
30800987858
print('1') #from src.__init__ import main from flask import Flask, request from flask_restx import Api, Namespace, fields, Resource ## local from settings import model_path, vocab_path, cnn_path from torch import nn # from src.controller.analyzeController import Analyze from src.controller.keywordController import ...
hmcck27/pshelper-server
src/app_for_server.py
app_for_server.py
py
6,957
python
ko
code
null
github-code
36
[ { "api_name": "load_models.koBERT_CNN_Classifier", "line_number": 20, "usage_type": "call" }, { "api_name": "settings.model_path", "line_number": 20, "usage_type": "name" }, { "api_name": "settings.vocab_path", "line_number": 20, "usage_type": "name" }, { "api_nam...
73811093863
import logging logger = logging.getLogger(__name__) def app(environ, start_response): path = environ.get('PATH_INFO', '') if path == '/exception': raise Exception('My exception!') data = "Request on %s \n" % path logger.info(data, extra={'tags': ['role:web', 'env:prod']}) start_response...
sebest-blog/gunicorn-with-docker
myapp.py
myapp.py
py
453
python
en
code
15
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 4, "usage_type": "call" } ]
1783613538
import sqlite3 import time from telethon import TelegramClient from telethon import sync, events import re import json db = sqlite3.connect('Account.db') cur = db.cursor() x = 1 m = 0 while(True): if x == 23: print("Всего добыто:") print(m) break cur.execute(f"SELECT PHONE FROM Accou...
Black-Triangle-code/Telegram_coin_bot
balance.py
balance.py
py
1,310
python
en
code
123
github-code
36
[ { "api_name": "sqlite3.connect", "line_number": 9, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 21, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 26, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": ...
71903174184
#! /usr/bin/env python import matplotlib.pyplot as plt from scipy.fftpack import fft from scipy.io import wavfile # get the api from scipy.signal import fftconvolve, convolve, stft, butter import numpy as np from scipy import signal import warnings warnings.filterwarnings("ignore") from numpy import array, diff, where...
buoyancy99/BobaBot
voice_utils/src/old_detection.py
old_detection.py
py
5,313
python
en
code
2
github-code
36
[ { "api_name": "warnings.filterwarnings", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.average", "line_number": 68, "usage_type": "call" }, { "api_name": "numpy.split", ...
37290989369
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('user_profile', '0003_remove_userprofile_title'), ] operations = [ migrations.CreateModel( name='RegistrationPath...
bitapardaz/diabet
user_profile/migrations/0004_auto_20171023_0837.py
0004_auto_20171023_0837.py
py
952
python
en
code
0
github-code
36
[ { "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.CreateModel", "line_number": 14, "usage_type": "call" }, ...
14302599067
import os import cv2 as cv import numpy as np people = [] for i in os.listdir(r'C:\Users\Atul\Downloads\OpenCV_course\opencv-course-master\Resources\Faces\train'): people.append(i) #each folder in the faces folder corresponds to one person ben affleck,mindy,etc and name of folder is person's name so we store tar...
ajinkeya17/OpenCV-Course
Codebase/face_recognition_training.py
face_recognition_training.py
py
2,247
python
en
code
0
github-code
36
[ { "api_name": "os.listdir", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.CascadeClassifier", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_numb...
5784254080
from unittest import mock import bson import pytest from test.tools import anything, in_any_order from slivka import JobStatus from slivka.db.documents import JobRequest, ServiceState from slivka.db.helpers import delete_many, insert_many, pull_many from slivka.scheduler import Runner, Scheduler from slivka.scheduler...
bartongroup/slivka
test/scheduler/test_scheduler.py
test_scheduler.py
py
8,266
python
en
code
7
github-code
36
[ { "api_name": "slivka.scheduler.Runner", "line_number": 21, "usage_type": "call" }, { "api_name": "slivka.scheduler.runners.RunnerID", "line_number": 22, "usage_type": "call" }, { "api_name": "unittest.mock.patch.object", "line_number": 32, "usage_type": "call" }, { ...
12420365719
from django.urls import path from . import views # register app namespace which is going to be used in URL names app_name = "my_app" urlpatterns = [ path("", views.example_view, name="example"), path("variable/", views.variable_view, name="variable") ]
felixdusengimana/python-django-web-development
04 Templates/template_study/my_app/urls.py
urls.py
py
262
python
en
code
0
github-code
36
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" } ]
23702247236
# -*- coding: utf-8 -*- from __future__ import division, print_function, unicode_literals __all__ = ["IterativeTwoDSearch"] import os import h5py import numpy as np from .two_d_search import TwoDSearch from ._grid_search import grid_search class IterativeTwoDSearch(TwoDSearch): cache_ext = ".h5" query_pa...
dfm/ketu
ketu/iterative.py
iterative.py
py
4,714
python
en
code
10
github-code
36
[ { "api_name": "two_d_search.TwoDSearch", "line_number": 15, "usage_type": "name" }, { "api_name": "numpy.log", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 49, "usage_type": "call" }, { "api_name": "numpy.array", "lin...
16178639967
# -*- coding: utf-8 -*- from high2low import Changer_low as ch_low import utils as util #from low2high import Changer_high as ch_high import is_horl as is_horl txt = input("Enter Korean Sentence: ") ch = ch_low() #ch_high = ch_high() hi = is_horl.isHigh() detect=hi.isThisHigh(txt) # 높임말 if detect ==1: hi.getSta...
joowhan/Translation_Project
lab/highlow_factory/ver3_chari/src/test.py
test.py
py
523
python
en
code
2
github-code
36
[ { "api_name": "high2low.Changer_low", "line_number": 9, "usage_type": "call" }, { "api_name": "is_horl.isHigh", "line_number": 12, "usage_type": "call" }, { "api_name": "utils.tohigh", "line_number": 23, "usage_type": "call" } ]
32274499758
#!/opt/csw/bin/python # coding=utf-8 import re import fileinput from time import time from datetime import datetime urlRe = re.compile('(http://www\.|https://www\.|http://|https://|www\.)(?P<link>\S+)') youtubeUrlRe = re.compile('(youtube\.com/watch\?v=|youtube\.com/watch\?.*&v=|youtu.be/)(?P<id>[A-Za-z0-9_-]{11})') ...
sviik/marju
plugin/interceptor/old/__init__.py
__init__.py
py
2,001
python
en
code
1
github-code
36
[ { "api_name": "re.compile", "line_number": 9, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 10, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime.fromtimestamp", ...
31524008748
import fitz from loguru import logger def get_page_from_sheet(sheet: str, pdf_fpath=None, doc=None): """ Get the page number from the sheet. """ if (pdf_fpath is not None) and (doc is not None): raise ValueError("Only one of pdf_fpath or doc can be specified.") if pdf_fpath: doc =...
fuzzy-tribble/meche-copilot
meche_copilot/pdf_helpers/get_page_from_sheet.py
get_page_from_sheet.py
py
1,478
python
en
code
1
github-code
36
[ { "api_name": "fitz.open", "line_number": 13, "usage_type": "call" }, { "api_name": "fitz.Rect", "line_number": 21, "usage_type": "call" }, { "api_name": "fitz.Rect", "line_number": 22, "usage_type": "call" }, { "api_name": "fitz.Rect", "line_number": 23, ...
15698017832
from django.shortcuts import render from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response from rest_framework import status from rest_framework.views import APIView from rest_framework.permissions import IsAuthenticated from django.db.models import Q from .serializer impor...
mohammad-reza-sasani/online-shop-react-django
backend/comment/views.py
views.py
py
2,202
python
en
code
0
github-code
36
[ { "api_name": "rest_framework.pagination.PageNumberPagination", "line_number": 20, "usage_type": "name" }, { "api_name": "rest_framework.generics.ListAPIView", "line_number": 25, "usage_type": "attribute" }, { "api_name": "rest_framework.generics", "line_number": 25, "usa...
1147807834
"""empty message Revision ID: b7c0cfa43719 Revises: 25279a0b5c75 Create Date: 2016-11-02 00:02:18.768539 """ # revision identifiers, used by Alembic. revision = 'b7c0cfa43719' down_revision = '25279a0b5c75' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - ...
CodeForProgress/sms-app
src/migrations/versions/b7c0cfa43719_.py
b7c0cfa43719_.py
py
760
python
en
code
1
github-code
36
[ { "api_name": "alembic.op.add_column", "line_number": 19, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 19, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 19, "usage_type": "call" }, { "api_name": "sqlalchemy.String"...
8806299537
from django.test import TestCase from django.urls import resolve from django.http import HttpRequest from django.template.loader import render_to_string from django.utils.html import escape from lists.views import home_page, view_list from lists.models import Item, List from lists.forms import STR_EMPYT_LIST_ERROR, It...
juewuer/python-web-dev
superlists/lists/tests/test_views.py
test_views.py
py
7,695
python
en
code
0
github-code
36
[ { "api_name": "django.test.TestCase", "line_number": 14, "usage_type": "name" }, { "api_name": "django.test.TestCase", "line_number": 19, "usage_type": "name" }, { "api_name": "django.urls.resolve", "line_number": 21, "usage_type": "call" }, { "api_name": "lists.v...
42866864407
""" 3 / \ 9 20 / \ 15 7 return its zigzag level order traversal as: [ [3], [20,9], [15,7] ] """ # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None # Definition for a binary tree node...
allen791210/LeetCode
103_Binary_Tree_Zigzag_Level_Order_Traversal.py
103_Binary_Tree_Zigzag_Level_Order_Traversal.py
py
1,289
python
en
code
0
github-code
36
[ { "api_name": "collections.deque", "line_number": 34, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 38, "usage_type": "call" } ]
3237711712
from django.db import models from rest_framework import serializers gender=( ("male","Male"), ("female","Female"), ) status=( ("Done","Done"), ("Pending","Pending"), ) Data=( ("share_all_data","Share All Data"), ("share_alerts_only","Share Alerts Only"), ) communication=( ("email","Email"),...
AdnanSiddiqui96/Projects-Backup
TestProject/Patient/models.py
models.py
py
15,374
python
en
code
0
github-code
36
[ { "api_name": "django.db.models.Model", "line_number": 34, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 34, "usage_type": "name" }, { "api_name": "django.db.models.AutoField", "line_number": 35, "usage_type": "call" }, { "api_name"...
5663610357
import methods import matplotlib.pyplot as plt def func(x, y): return 1 + 1.8*y*methods.np.sin(x) - y**2 x0 = 0 y0 = 0 x_end = 6 h = 0.1 x1, y1, h = methods.runge_kutta(x0, y0, x_end, func, h, True) x1_halved, y1_halved = methods.runge_kutta(x0, y0, x_end, func, h/2, False) x2, y2 = methods.adams(x1[:4], y1[:4]...
Melkye/Labs
Math/Lab8_Koshi_problem/Lab8_Koshi_problem/Lab8_Koshi_problem.py
Lab8_Koshi_problem.py
py
1,270
python
en
code
0
github-code
36
[ { "api_name": "methods.np.sin", "line_number": 5, "usage_type": "call" }, { "api_name": "methods.np", "line_number": 5, "usage_type": "attribute" }, { "api_name": "methods.runge_kutta", "line_number": 12, "usage_type": "call" }, { "api_name": "methods.runge_kutta"...
25917900708
from __future__ import print_function import argparse import random import math import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from os import listdir from os.path import join from moviepy.editor import * model = torch.hub.load('pytorch/vision', 'deeplabv3_resnet101', ...
WhiteNoise/deep-bgremove
createmask.py
createmask.py
py
2,592
python
en
code
61
github-code
36
[ { "api_name": "torch.hub.load", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.hub", "line_number": 16, "usage_type": "attribute" }, { "api_name": "torch.FloatTensor", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.cuda.is_availab...
22420951914
from django.shortcuts import render,redirect from django.contrib import messages from .models import Courses def new(request): context = { 'course': Courses.objects.all() } return render(request, 'new.html', context) def create(request): errors = Courses.objects.basic_validator(request.P...
Wendy-Wu-Chiang/Python_stack
django/full_stack_django/courses_proj/courses_app/views.py
views.py
py
952
python
en
code
0
github-code
36
[ { "api_name": "models.Courses.objects.all", "line_number": 7, "usage_type": "call" }, { "api_name": "models.Courses.objects", "line_number": 7, "usage_type": "attribute" }, { "api_name": "models.Courses", "line_number": 7, "usage_type": "name" }, { "api_name": "dj...
8195166573
from PIL import Image, ImageOps, ImageDraw, ImageFont from bot.config import PICS_DIRECTORY, QUOTATION_DATABASE import textwrap import sqlite3 import random import os import io def get_random_quote(): conn = sqlite3.connect(QUOTATION_DATABASE) cursor = conn.cursor() count = cursor.execute('SELECT COUNT(...
Ku6iKRu6Ika/quote-bot
bot/utils.py
utils.py
py
1,504
python
en
code
0
github-code
36
[ { "api_name": "sqlite3.connect", "line_number": 12, "usage_type": "call" }, { "api_name": "bot.config.QUOTATION_DATABASE", "line_number": 12, "usage_type": "argument" }, { "api_name": "random.randint", "line_number": 16, "usage_type": "call" }, { "api_name": "PIL....
26634573192
import requests def request_demo(): url = "https://qyapi.weixin.qq.com/cgi-bin/gettoken" param = { "corpid":"ww93348658d7c66ef4", "corpsecret":"T0TFrXmGYel167lnkzEydsjl6bcDDeXVmkUnEYugKIw" } proxy = { "http": "http://127.0.0.1:8080", "https": "http://127.0.0.1:8080" }...
ceshiren/HogwartsSDET17
test_mock/requests_demo.py
requests_demo.py
py
447
python
en
code
7
github-code
36
[ { "api_name": "requests.get", "line_number": 12, "usage_type": "call" } ]
19651817490
from binance.client import Client import pandas as pd import matplotlib.pyplot as plt import ta data = Client().get_historical_klines("BTCUSDT", Client.KLINE_INTERVAL_1DAY, "01 JANUARY 2018") df = pd.DataFrame(data, columns = ['timestamp', 'open', 'high', 'low', 'close', 'volume', 'close_time', 'quote_av', 'trad...
RaphaelFontaine/Trading
src/moving_average_crossing.py
moving_average_crossing.py
py
1,984
python
en
code
0
github-code
36
[ { "api_name": "binance.client.Client", "line_number": 6, "usage_type": "call" }, { "api_name": "binance.client.Client.KLINE_INTERVAL_1DAY", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pandas.DataFrame", "line_number": 7, "usage_type": "call" }, { ...
10073007087
import numpy as np import json import timeit import os import argparse from pathlib import Path import sys from shapely.geometry import Polygon import numpy as np import numba from inspect import getmembers sys.path.append(os.path.realpath('hausdorff')) from hausdorff_dist import hausdorff_distance sys.path.append(o...
PhanVinhLong/vehicle-counting-aichcmc2020
count2.py
count2.py
py
6,482
python
en
code
1
github-code
36
[ { "api_name": "sys.path.append", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_nu...
72311226344
import os import subprocess from src.manager.manager.launcher.launcher_interface import ILauncher, LauncherException from src.manager.manager.docker_thread.docker_thread import DockerThread from src.manager.libs.process_utils import wait_for_xserver from typing import List, Any import time class LauncherDronesRos2(ILa...
JdeRobot/RoboticsApplicationManager
manager/manager/launcher/launcher_drones_ros2.py
launcher_drones_ros2.py
py
2,530
python
en
code
2
github-code
36
[ { "api_name": "src.manager.manager.launcher.launcher_interface.ILauncher", "line_number": 9, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 14, "usage_type": "name" }, { "...
11883990410
from lcp.core.interfaces.module import Module from lcp.modules.camerafeed.camera_feed import CameraFeed import cv2 as cv import _thread class FaceDetector(Module): __name = "Face Detector" __version = "1.0" __dependencies = [CameraFeed] def __init__(self, config): super().__init__(self.__name...
huybthomas/LCP-Core-Old
src/lcp/modules/facedetector/face_detector.py
face_detector.py
py
1,900
python
en
code
0
github-code
36
[ { "api_name": "lcp.core.interfaces.module.Module", "line_number": 7, "usage_type": "name" }, { "api_name": "lcp.modules.camerafeed.camera_feed.CameraFeed", "line_number": 10, "usage_type": "name" }, { "api_name": "cv2.CascadeClassifier", "line_number": 26, "usage_type": "...
70666328104
import xml.etree.ElementTree as ET bd=ET.Element("base") ventana=ET.SubElement(bd,"ventana", name="ventana-consultas") ventana_hide=ET.SubElement(ventana,"ventana-hide",) ventana_hide.set("option-hide","false") ET.dump(bd) tree = ET.ElementTree(bd) tree.write("C:/Users/ricar/Desktop/pruebas v1/pruebasv1.xml") estruc...
ColqueRicardo/v-version
pruebas/pruebas aisladas/archivos xml.py
archivos xml.py
py
829
python
es
code
0
github-code
36
[ { "api_name": "xml.etree.ElementTree.Element", "line_number": 3, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 3, "usage_type": "name" }, { "api_name": "xml.etree.ElementTree.SubElement", "line_number": 4, "usage_type": "call" }, { ...
42360576812
""" __title__ = '' __author__ = 'Thompson' __mtime__ = '2018/5/23' # code is far away from bugs with the god animal protecting I love animals. They taste delicious. ┏┓ ┏┓ ┏┛┻━━━┛┻┓ ┃ ☃ ┃ ┃ ┳┛ ┗┳ ┃ ┃ ┻ ┃ ┗━┓ ┏━...
hwzHw/python37
day0109/requests_04_代理IP.py
requests_04_代理IP.py
py
1,014
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 29, "usage_type": "call" } ]
2080670146
# -*- coding : utf-8 -*- import numpy as np import torch from torch import nn class DNN(nn.Module): def __init__(self,args): super().__init__() self.outDim = args.outDim self.seqLen = args.seqLen self.hiddenDim1 = args.hiddenDim1 self.hiddenDim2 = args.hiddenDim2 se...
Ylizin/RWSim
ylSim/DNN.py
DNN.py
py
1,213
python
en
code
2
github-code
36
[ { "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.Linear", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
5049970089
import copy import json import math import struct from functools import partial from pathlib import Path, PosixPath import numpy as np # isort: off import torch import tensorrt as trt # isort: on # numpy doesn't know bfloat16, define abstract binary type instead np_bfloat16 = np.dtype('V2', metadata={"dtype": "bfloa...
NVIDIA/TensorRT-LLM
tensorrt_llm/_utils.py
_utils.py
py
6,159
python
en
code
3,328
github-code
36
[ { "api_name": "numpy.dtype", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.Tensor", "line_number": 19, "usage_type": "attribute" }, { "api_name": "torch.Tensor", "line_number": 20, "usage_type": "attribute" }, { "api_name": "torch.bfloat16", ...
28121817798
import tornado.httpserver import tornado.ioloop import tornado.web import tornado.options import settings from handlers import * def make_app(): db = None handlers = [ (r"/", MainHandler), (r"/covert", CovertHandler) ] config = {"template_path":settings.TEMPLATE_PATH, "static_path":settings.ASS...
caroltc/lrc2srt
app.py
app.py
py
672
python
en
code
2
github-code
36
[ { "api_name": "settings.TEMPLATE_PATH", "line_number": 14, "usage_type": "attribute" }, { "api_name": "settings.ASSETS_PATH", "line_number": 14, "usage_type": "attribute" }, { "api_name": "settings.COOKIE_SECRET", "line_number": 14, "usage_type": "attribute" }, { ...
19782973821
from datetime import datetime from scipy import misc import tensorflow as tf import os import src.facenet.detect_face import cv2 import matplotlib.pyplot as plt from helper import get_images_from_file_list, get_box_from_ellipse import math import pickle import dlib # ============================================ # Glob...
ryan-mccaffrey/glasses-for-everyone
detect_face.py
detect_face.py
py
18,364
python
en
code
2
github-code
36
[ { "api_name": "cv2.CascadeClassifier", "line_number": 27, "usage_type": "call" }, { "api_name": "dlib.get_frontal_face_detector", "line_number": 28, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 40, "usage_type": "call" }, { "api_name": "cv2...
23077134371
from spa.clientside.asyncdbhandler import CAsyncDBHandler from spa import BaseServiceID, tagBaseRequestID class CPostgres(CAsyncDBHandler): # Asynchronous and SQL streaming postgreSQL service id sidPostgres = BaseServiceID.sidReserved + 0x6FFFFFF4 """ An Open flag option, which is specific to PostgreS...
udaparts/socketpro
bin/spa/clientside/upostgres.py
upostgres.py
py
1,257
python
en
code
27
github-code
36
[ { "api_name": "spa.clientside.asyncdbhandler.CAsyncDBHandler", "line_number": 4, "usage_type": "name" }, { "api_name": "spa.BaseServiceID.sidReserved", "line_number": 6, "usage_type": "attribute" }, { "api_name": "spa.BaseServiceID", "line_number": 6, "usage_type": "name"...
29647725517
import sqlite3 import pandas as pd import time import sys from drugbank.drugbank_index_query import drugbank_search from hpo.hpo_index_query import hpo_search from omim.omim_index_query import omim_search from stitch.stitch_chemical_sources_index_query import stitch_chemical_sources_search from stitch.stitch_br08303_i...
Hamza-ABDOULHOUSSEN/gmd2k22
python/data_query.py
data_query.py
py
7,485
python
en
code
0
github-code
36
[ { "api_name": "sqlite3.connect", "line_number": 41, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 66, "usage_type": "call" }, { "api_name": "hpo.hpo_index_query.hpo_search", "line_number": 85, "usage_type": "call" }, { "api_name": "drugba...
70489044264
import pytest from unittest.mock import AsyncMock, patch from api.exceptions import InvalidParameterError from crawler.default.instances.second_instance import SecondInstance # Mock para a resposta do ClientSession mock_response = AsyncMock() mock_response.text.return_value = 'Sample Text' @pytest.mark.asyncio async...
BrunoPisaneschi/JusBrasil
tests/unit/crawler/default/instances/test_second_instance.py
test_second_instance.py
py
921
python
en
code
0
github-code
36
[ { "api_name": "unittest.mock.AsyncMock", "line_number": 7, "usage_type": "call" }, { "api_name": "crawler.default.instances.second_instance.SecondInstance", "line_number": 13, "usage_type": "call" }, { "api_name": "pytest.raises", "line_number": 15, "usage_type": "call" ...
31618419583
import torch from pathlib import Path import copy import time import torch.nn.functional as F import matplotlib.pyplot as plt import numpy as np import pdb import skimage from distutils.version import LooseVersion from skimage.transform import resize as sk_resize device = torch.device("cuda:0" if torch.cuda.is_availab...
hariharan98m/ischemic-stroke-detection
fcn_roialign/master2/utils.py
utils.py
py
10,688
python
en
code
0
github-code
36
[ { "api_name": "torch.device", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 13, "usage_type": "attribute" }, { "api_name": "distutils.versio...
12486515502
import cv2 from datetime import datetime, timedelta import geojson from geotiff import GeoTiff from models import Model0 import netCDF4 import numpy as np import pandas as pd import os from os import path from scipy import interpolate from scipy.io import loadmat, savemat import torch import wget import...
drivendataorg/snowcast-showdown
1st Place/src/features/constfeatures.py
constfeatures.py
py
13,858
python
en
code
12
github-code
36
[ { "api_name": "numpy.cos", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.radians", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22,...
74949364585
import matplotlib.pyplot as plt import numpy as np import torch from torch import nn from RNN_torch.model import RNN # Hyper parameters BATCH_SIZE = 64 EPOCH = 1 TIME_STEP = 28 # 考虑多少个时间点的数据 INPUT_SIZE = 1 # 每个时间点给RNN多少个数据点 LR = 0.01 rnn = RNN(INPUT_SIZE) print(rnn) optimizer = torch.optim.Adam(r...
xjtulyc/PKU_Weekly_Summary_repo
20220719/cs231n assignment/assignment_3.py
assignment_3.py
py
1,352
python
en
code
2
github-code
36
[ { "api_name": "RNN_torch.model.RNN", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.optim.Adam", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.optim", "line_number": 18, "usage_type": "attribute" }, { "api_name": "torch.nn.MSELos...
19509126438
import pandas as pd import requests from datetime import datetime DISCORD_URL = "https://discord.com/api/v9/invites/UQZpTQbCT4?with_counts=true" STARTED_AT = datetime.now() request = requests.get(DISCORD_URL) data = request.json() new_dataframe = pd.json_normalize(data, max_level=2) new_dataframe["_started_at"] =...
ndrluis/soberana-data-poc
extract/scripts/discord.py
discord.py
py
566
python
en
code
2
github-code
36
[ { "api_name": "datetime.datetime.now", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 7, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.json_normali...
70955291624
"""add admin flag to user Revision ID: dd535b1f37a1 Revises: 4519159d3019 Create Date: 2019-01-06 13:39:21.042745 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'dd535b1f37a1' down_revision = '4519159d3019' branch_labels = None depends_on = None def upgrade(...
euphwes/cubers.io
migrations/versions/014_dd535b1f37a1_add_admin_flag_to_user.py
014_dd535b1f37a1_add_admin_flag_to_user.py
py
797
python
en
code
27
github-code
36
[ { "api_name": "alembic.op.batch_alter_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....
5987566968
from django.urls import path from .views import ListingsView, ListingView, SearchView # Declare the URL for the listings app here. urlpatterns = [ path('', ListingsView.as_view(),name="ListALL"), path('search', SearchView.as_view()), path('<slug>', ListingView.as_view()), # Used for lising...
testusername190/Realest_Estate_Backend
backend/listings/urls.py
urls.py
py
374
python
en
code
0
github-code
36
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "views.ListingsView.as_view", "line_number": 7, "usage_type": "call" }, { "api_name": "views.ListingsView", "line_number": 7, "usage_type": "name" }, { "api_name": "django.ur...
4084609951
import customtkinter as ctk class ConfirmDeleteOldestBackupDialog(ctk.CTkToplevel): def __init__(self, parent, controller, *args, **kwargs): super().__init__(parent, *args, **kwargs) # Configure variables self.controller = controller self.label_text = "You are only allowed 10 back...
berndklare/flashcards
dialogs/confirm_delete_oldest_backup_dialog.py
confirm_delete_oldest_backup_dialog.py
py
1,389
python
en
code
0
github-code
36
[ { "api_name": "customtkinter.CTkToplevel", "line_number": 4, "usage_type": "attribute" }, { "api_name": "customtkinter.CTkLabel", "line_number": 21, "usage_type": "call" }, { "api_name": "customtkinter.CTkButton", "line_number": 26, "usage_type": "call" }, { "api_...
11917002254
from django.db import models from django.db import models from django.utils import timezone from django.contrib.auth.models import User import uuid from users.models import Profile from ckeditor.fields import RichTextField # Create your models here. def user_directory_path(instance,filename): return 'blogs/{0}/{1...
minarefaat1002/blog_website
blogs project/blog/models.py
models.py
py
2,654
python
en
code
0
github-code
36
[ { "api_name": "django.db.models.Model", "line_number": 14, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 14, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 15, "usage_type": "call" }, { "api_name"...
4863814184
import numpy as np import pandas as pd import itertools from sklearn import metrics from sklearn.model_selection import GridSearchCV from sklearn.model_selection import StratifiedKFold from sklearn.model_selection import cross_val_score # models that are being considered from sklearn.ensemble import AdaBoostCla...
grikkaq/ml_hw5
elections_results.py
elections_results.py
py
7,045
python
en
code
0
github-code
36
[ { "api_name": "sklearn.metrics.accuracy_score", "line_number": 42, "usage_type": "call" }, { "api_name": "sklearn.metrics", "line_number": 42, "usage_type": "name" }, { "api_name": "sklearn.metrics.f1_score", "line_number": 51, "usage_type": "call" }, { "api_name"...
28512647903
# Import libraries import numpy as np import pandas as pd pd.options.mode.chained_assignment = None from sqlalchemy import create_engine from googlesearch import search from tqdm import tqdm tqdm.pandas() # Read data df = pd.read_csv('data/user-item-interactions.csv') df_content = pd.read_csv('data/articles.csv') del ...
sameedakber-ai/ibm-recommendations-2
data/process_data.py
process_data.py
py
2,578
python
en
code
0
github-code
36
[ { "api_name": "pandas.options", "line_number": 4, "usage_type": "attribute" }, { "api_name": "tqdm.tqdm.pandas", "line_number": 8, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 8, "usage_type": "name" }, { "api_name": "pandas.read_csv", "li...
26166080106
import argparse import os import cv2 import matplotlib.pyplot as plt import maxflow import networkx as nx import numpy as np class GraphCuts: def __init__(self, src, target, mask, save_graph=False): """ Initialize the graph and computes the min-cut. :param src: image to be blended ...
c1a1o1/graphcut-textures
src/graphcut_textures.py
graphcut_textures.py
py
7,197
python
en
code
0
github-code
36
[ { "api_name": "maxflow.Graph", "line_number": 26, "usage_type": "attribute" }, { "api_name": "numpy.array_equal", "line_number": 55, "usage_type": "call" }, { "api_name": "numpy.inf", "line_number": 56, "usage_type": "attribute" }, { "api_name": "numpy.array_equal...
38191743871
import json leer = [] for linea in open('202006_movements.json','r'): leer.append(json.loads(linea)) #print (linea) datos = [] def leer(): for linea in open('202006_movements.json','r'): datos.append(json.loads(linea)) def recogidasPorPunto(): resultado = dict() for obj in d...
dalevale/GIW2020-21
practica2.py
practica2.py
py
1,371
python
es
code
0
github-code
36
[ { "api_name": "json.loads", "line_number": 4, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 11, "usage_type": "call" } ]
22161452898
#!/usr/bin/env python3 import glob import os.path import re import statistics import sys from collections import defaultdict from typing import List, Dict """ USAGE: ./simple_spec_summary.py # all files in /spec/result/ ./simple_spec_summary.py 1 10 # result 1-10 from /spec/result/ ./simple_Spec_summary.py <list>...
typro-type-propagation/TyPro-CFI
scripts/simple_spec_summary.py
simple_spec_summary.py
py
3,896
python
en
code
3
github-code
36
[ { "api_name": "typing.List", "line_number": 19, "usage_type": "name" }, { "api_name": "collections.defaultdict", "line_number": 20, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 37, "usage_type": "name" }, { "api_name": "os.path.path.exists",...
25714644305
import numpy as np import matplotlib.pyplot as plt def plot_with_exponential_averaging(x, y, label, alpha): y_ema = [y[0],] for y_i in y[1:]: y_ema.append(y_ema[-1] * alpha + y_i * (1 - alpha)) p = plt.plot(x, y_ema, label=label) plt.plot(x, y, color=p[0].get_color(), alpha=0.2) def...
olenmg/dopamine-rl
utils/plot.py
plot.py
py
804
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 9, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 11, "usage_type": "call" }, { "api_name": "matplot...
72287095464
#!/usr/local/python3/bin/python3 import sys sys.path.append("..") import tushare as ts import re import datetime import basicdata.basic_mgr as sk import time import os import pandas as pd g_update_newest=False #True|False #是否下载最新的概念,一般不需要 g_ctcode_name=None #g_ctcode_name['TS56']='电改' g_tscode_concept=None #g_tscode...
haianhua/stock
stock/conceptdata/concept_mgr.py
concept_mgr.py
py
2,624
python
en
code
0
github-code
36
[ { "api_name": "sys.path.append", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "basicdata.basic_mgr.get_tscodes", "line_number": 38, "usage_type": "call" }, { "api_name": "basicdata...
43109381353
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Apr 18 21:28:29 2021 @author: apolloseeds """ from dataset import * import matplotlib.pyplot as plt import numpy as np from scipy.io import loadmat from sklearn import model_selection from toolbox_02450 import train_neural_net, draw_neural_net, visual...
ralph-elhaddad/02450-Intro-ML
Project2/2b.py
2b.py
py
7,248
python
en
code
0
github-code
36
[ { "api_name": "sklearn.model_selection.KFold", "line_number": 26, "usage_type": "call" }, { "api_name": "sklearn.model_selection", "line_number": 26, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 34, "usage_type": "call" }, { "api_nam...
35018437018
import line import cv2 import time import serial # Camera vid = cv2.VideoCapture(0) # Elegoo power_forward = 100 power_sideway_minimal = 130 power_sideway_maximal = 200 compteur = 0 ips = 0 after = time.time() + 1 imprimer_taille_image = True left_begin = 0 left_end = 85 right_begin = 95 right_end = 180 compteur_...
GuillaumeCariou/I3S_Tutorship_Internship
Python/Line_Following/Line/main_rgb.py
main_rgb.py
py
3,992
python
en
code
0
github-code
36
[ { "api_name": "cv2.VideoCapture", "line_number": 7, "usage_type": "call" }, { "api_name": "time.time", "line_number": 16, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 42, "usage_type": "call" }, { "api_name": "serial.Serial", "line_number...
10660236943
# coding=utf-8 import mysql.connector from mysql.connector import Error import requests import json import datetime dias_semana = ['Domingo', 'Segunda-feira', 'Terça-feira', 'Quarta-feira', 'Quinta-feira', 'Sexta-feira', 'Sábado'] try: # recupera dataset do chat url_json = "http://raw.githubusercontent.com/ca...
camilabianchi/graces_desafio
2_importacao_python_airflow/importa_chat.py
importa_chat.py
py
2,617
python
pt
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 13, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 14, "usage_type": "call" }, { "api_name": "mysql.connector.connector.connect", "line_number": 18, "usage_type": "call" }, { "api_name": "mysql.conne...
6864404682
import math, random import gym import numpy as np import torch import torch.nn as nn import torch.optim as optim import torch.autograd as autograd import torch.nn.functional as F import matplotlib.pyplot as plt USE_CUDA = torch.cuda.is_available() Variable = lambda *args, **kwargs: autograd.Variable(*args, **kwargs).c...
saumyasinha/learning_better_policies_with_critical_states
Qlearning/dqn_for_CartPole.py
dqn_for_CartPole.py
py
8,842
python
en
code
0
github-code
36
[ { "api_name": "torch.cuda.is_available", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 11, "usage_type": "attribute" }, { "api_name": "torch.autograd.Variable", "line_number": 12, "usage_type": "call" }, { "api_name": "torch...
20405590464
import matplotlib.pyplot as plt from tespy.networks import Network from tespy.connections import Connection from tespy.components import (Source, Sink, Condenser, Pump) # Create a TESPy network nw = Network(fluids=['water', 'NH3']) # Add components and connections to the network source = Source('source') sink = Sink(...
JubranKhattab/testing_tespy_projects
subsystems/ploting.py
ploting.py
py
1,346
python
en
code
0
github-code
36
[ { "api_name": "tespy.networks.Network", "line_number": 7, "usage_type": "call" }, { "api_name": "tespy.components.Source", "line_number": 10, "usage_type": "call" }, { "api_name": "tespy.components.Sink", "line_number": 11, "usage_type": "call" }, { "api_name": "t...
10836961705
import pandas as pd from flask import Flask, jsonify, request,json import pickle model = pickle.load(open('model.pkl','rb')) app = Flask(__name__) @app.route('/', methods=['POST']) def predict(): # get data body_dict = json.loads(request.get_data().decode('utf-8')) data = body_dict['0'] # predic...
liJiansheng/Catchup
LR Model API/app.py
app.py
py
695
python
en
code
0
github-code
36
[ { "api_name": "pickle.load", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.json.loads", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.json", "line_number"...
18113301417
import pygame #зарускаем программу pygame.init() #add colors black=( 0, 0, 0) white=( 255, 255, 255) green=( 0, 255, 0) red=( 255, 0, 0) size = [700,700] screen=pygame.display.set_mode(size) pygame.display.set_caption("Professor Craven's Cool Game") done = True clock=pygame.time.Clock() screen.fill(white)...
AndreiTsukov/PythonFiles
Classwork/pygame/lesson1/snegovik.py
snegovik.py
py
532
python
en
code
0
github-code
36
[ { "api_name": "pygame.init", "line_number": 3, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 10, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pygame.display...
8446584828
import warnings from cupy import testing import cupyx.scipy.signal.windows as cu_windows import pytest from pytest import raises as assert_raises try: import scipy.signal.windows as cpu_windows # NOQA import scipy.fft # NOQA except ImportError: pass window_funcs = [ ('boxcar', ()), ('triang...
cupy/cupy
tests/cupyx_tests/scipy_tests/signal_tests/test_windows.py
test_windows.py
py
22,594
python
en
code
7,341
github-code
36
[ { "api_name": "cupy.testing.numpy_cupy_allclose", "line_number": 43, "usage_type": "call" }, { "api_name": "cupy.testing", "line_number": 43, "usage_type": "name" }, { "api_name": "cupy.testing.numpy_cupy_allclose", "line_number": 52, "usage_type": "call" }, { "ap...
72425931625
from selenium import webdriver from selenium.webdriver.chrome.service import Service from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from bs4 import BeautifulSoup import pandas as pd from selenium.webdriver.common.by import By import re from webdr...
umairahmad89/h-m-scraper
scraper.py
scraper.py
py
2,718
python
en
code
0
github-code
36
[ { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 42, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 42, "usage_type": "name" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 46, "usage_type": "call" }, { "api...
35056823314
import pickle import json import yaml import numpy as np import torch import torch.optim as optim import time from data_manager import DataManager from model import BiLSTMCRF from utils import f1_score, get_tags, format_result from torch.utils.tensorboard import SummaryWriter writer = SummaryWriter(log_dir='./tensorbo...
ravesky/medical_ner_pytorch
main.py
main.py
py
10,508
python
en
code
44
github-code
36
[ { "api_name": "torch.utils.tensorboard.SummaryWriter", "line_number": 13, "usage_type": "call" }, { "api_name": "data_manager.DataManager", "line_number": 23, "usage_type": "call" }, { "api_name": "data_manager.DataManager", "line_number": 32, "usage_type": "call" }, ...
33380799983
import requests from bs4 import BeautifulSoup import time import plotly import numpy as np import pandas as pd import datetime as dt import cufflinks as cf import subprocess import traceback from sys import exit from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart import base64 import pi...
rhart-rup/Playstation-Store-Price-Drop-Alert
main.py
main.py
py
13,550
python
en
code
1
github-code
36
[ { "api_name": "os.path.chdir", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "name" }, { "api_name": "bs4.BeautifulSoup", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.nan", "line_number"...
32844059000
import xlrd import product def excel_reader(file_name): # open excel sheet loc = "C:/Users/andym/PycharmProjects/FacebookScraper/" + file_name read_list = [] temp_list = [] wb = xlrd.open_workbook(loc) sheet = wb.sheet_by_index(0) sheet.cell_value(0, 0) rows_total = sheet.nrows c...
andymangibbs/CraigslistScraper
excelRead.py
excelRead.py
py
1,154
python
en
code
0
github-code
36
[ { "api_name": "xlrd.open_workbook", "line_number": 11, "usage_type": "call" }, { "api_name": "product.Product", "line_number": 25, "usage_type": "call" } ]
12243691897
from django.test import TestCase, RequestFactory from django.urls import reverse from django.contrib.auth.models import User, Permission from django.contrib import admin from django_comment import models from .test_app.models import TestModel from django_comment.admin import CommentedItemAdmin, CommentedItemInline ...
genosltd/django-comment
tests/test_admin.py
test_admin.py
py
4,334
python
en
code
0
github-code
36
[ { "api_name": "django.test.TestCase", "line_number": 13, "usage_type": "name" }, { "api_name": "test_app.models.TestModel.objects.create", "line_number": 16, "usage_type": "call" }, { "api_name": "test_app.models.TestModel.objects", "line_number": 16, "usage_type": "attri...
22543357667
import jwt import json import logging import time from jwt import ExpiredSignatureError logger = logging.getLogger("handler_logger") logger.setLevel(logging.DEBUG) def jwt_encode(obj): try: return jwt.encode(obj, '#0wc-0-#@#14e8rbk#bke_9rg@nglfdc3&6z_r6nx!q6&3##l=', ...
gaurav3g/chat-sls-server
backend/utils/jwt_utils.py
jwt_utils.py
py
842
python
en
code
0
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 8, "usage_type": "attribute" }, { "api_name": "jwt.encode", "line_number": 13, "usage_type": "call" }, { "api_name": "jwt.decode", "line_...
23129694122
import speech_recognition as sr from state import State from ClientThread import* import threading class VoiceRecognizer: State.event = 'create' def __init__(self): self.client = ClientThread() self.r = sr.Recognizer() self.speech = '' self.recognitionResult = '' se...
Moufdi96/Projet_IHM_Multimodal
speecheRecognizer.py
speecheRecognizer.py
py
1,682
python
en
code
0
github-code
36
[ { "api_name": "state.State.event", "line_number": 7, "usage_type": "attribute" }, { "api_name": "state.State", "line_number": 7, "usage_type": "name" }, { "api_name": "speech_recognition.Recognizer", "line_number": 11, "usage_type": "call" }, { "api_name": "speech...
496475437
from dagster_pandas import DataFrame from google.cloud.bigquery.job import LoadJobConfig, QueryJobConfig from google.cloud.bigquery.table import EncryptionConfiguration, TimePartitioning from dagster import InputDefinition, List, Nothing, OutputDefinition, Path, check, solid from .configs import ( define_bigquery...
helloworld/continuous-dagster
deploy/dagster_modules/libraries/dagster-gcp/dagster_gcp/bigquery/solids.py
solids.py
py
5,243
python
en
code
2
github-code
36
[ { "api_name": "google.cloud.bigquery.table.EncryptionConfiguration", "line_number": 23, "usage_type": "call" }, { "api_name": "google.cloud.bigquery.table.TimePartitioning", "line_number": 28, "usage_type": "call" }, { "api_name": "dagster.check.list_param", "line_number": 40...
37349168777
from ase.units import Ha import numpy as np from my_gpaw.xc.fxc import KernelWave, XCFlags, FXCCache from my_gpaw.xc.rpa import GCut from my_gpaw.response.pair_functions import SingleQPWDescriptor from my_gpaw.pw.descriptor import PWMapping class G0W0Kernel: def __init__(self, xc, context, **kwargs): sel...
f-fathurrahman/ffr-learns-gpaw
my_gpaw/response/g0w0_kernels.py
g0w0_kernels.py
py
2,219
python
en
code
0
github-code
36
[ { "api_name": "my_gpaw.xc.fxc.XCFlags", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.eye", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.argmin", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.linalg.norm", ...
21120272187
import sys import pickle import torch as T import torch.nn as nn import torch.optim as optim import torch.nn.functional as F sys.path.append("../") # nopep8 from model.dialog_acts import Encoder from DataLoader.bucket_and_batch import bucket_and_batch import numpy as np import string import random device = T.device('...
JRC1995/Chatbot
Classifier/train_and_test/train.py
train.py
py
3,877
python
en
code
79
github-code
36
[ { "api_name": "sys.path.append", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.device", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", ...
31061296375
from ..utils import Object class GetBackgroundUrl(Object): """ Constructs a persistent HTTP URL for a background Attributes: ID (:obj:`str`): ``GetBackgroundUrl`` Args: name (:obj:`str`): Background name type (:class:`telegram.api.types.BackgroundType`): ...
iTeam-co/pytglib
pytglib/api/functions/get_background_url.py
get_background_url.py
py
801
python
en
code
20
github-code
36
[ { "api_name": "utils.Object", "line_number": 6, "usage_type": "name" }, { "api_name": "utils.Object.read", "line_number": 35, "usage_type": "call" }, { "api_name": "utils.Object", "line_number": 35, "usage_type": "name" } ]
40961470159
# coding: utf-8 import datetime from simpleai.search import astar, SearchProblem from simpleai.search.viewers import BaseViewer class RobotProblem(SearchProblem): def __init__(self, pallets_a_entregar): ''' En el estado necesitamos llevar la posición de los pallets, la del robot, si tenemo...
ucse-ia/ucse_ia
practicas/robot_pallets.py
robot_pallets.py
py
5,721
python
es
code
5
github-code
36
[ { "api_name": "simpleai.search.SearchProblem", "line_number": 7, "usage_type": "name" }, { "api_name": "simpleai.search.viewers.BaseViewer", "line_number": 151, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 152, "usage_type": "call" }, ...
36725320029
# -*- coding: utf-8 -*- from preprocess import Channel from workflow.cf_workflow import run as user_cf from workflow.if_workflow import run as user_if from workflow.rsif_workflow import run as user_rsif from workflow.lfm_workflow import run as lfm from workflow.prank_workflow import run as prank from flask import Flask...
ang0410/recommend
manage.py
manage.py
py
4,408
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 16, "usage_type": "call" }, { "api_name": "preprocess.Channel", "line_number": 22, "usage_type": "call" }, { "api_name": "flask.abort", "line_number": 55, "usage_type": "call" }, { "api_name": "flask.request.args.get", ...
11439201598
from itertools import product from typing import Union Coor = Union[tuple[int, int, int], tuple[int, int, int, int]] CubeMap = set[Coor] def get_input() -> CubeMap: with open('input.txt', 'r') as f: return {(i, j, 0) for i, l in enumerate(f.readlines()) for j, ch in enumerate(l) if l and ch == '#'} def n...
markopuzav/aoc-2020
day17/solution.py
solution.py
py
1,413
python
en
code
0
github-code
36
[ { "api_name": "typing.Union", "line_number": 4, "usage_type": "name" }, { "api_name": "itertools.product", "line_number": 14, "usage_type": "call" } ]
15827248022
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from future import standard_library standard_library.install_aliases() from builtins import * import unittest import importlib import os from emission.core.wrapper.trip_ol...
e-mission/e-mission-server
emission/individual_tests/TestNominatim.py
TestNominatim.py
py
6,717
python
en
code
22
github-code
36
[ { "api_name": "future.standard_library.install_aliases", "line_number": 6, "usage_type": "call" }, { "api_name": "future.standard_library", "line_number": 6, "usage_type": "name" }, { "api_name": "os.environ.get", "line_number": 18, "usage_type": "call" }, { "api_...
4619575632
#!/usr/bin/env python import django from net_system.models import NetworkDevice, Credentials from pprint import pprint rtrs = { "test-sw1": { "port": "22", "username": "admin1", "eapi_port": "443", "password": "99saturday", "ip": "1.1.1.1", "device_type": "arista_eos" }, "test-sw2":...
jerry-bonner/pynet
class8/ex3.py
ex3.py
py
1,335
python
en
code
0
github-code
36
[ { "api_name": "net_system.models.NetworkDevice.objects.all", "line_number": 27, "usage_type": "call" }, { "api_name": "net_system.models.NetworkDevice.objects", "line_number": 27, "usage_type": "attribute" }, { "api_name": "net_system.models.NetworkDevice", "line_number": 27,...
34338165702
# https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/ from typing import List # Definition for a binary tree node. class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right class Solution: ...
0x0400/LeetCode
p105.py
p105.py
py
788
python
en
code
0
github-code
36
[ { "api_name": "typing.List", "line_number": 13, "usage_type": "name" } ]
11526198960
import asyncio import json import multiprocessing as mp from importlib import import_module from django import http from django.conf import settings from django.core.cache import caches from django.core.handlers.asgi import ASGIRequest from django.contrib import auth from django.utils import timezone from asgiref.syn...
cognitive-space/warpzone
worlds/websocket.py
websocket.py
py
5,411
python
en
code
1
github-code
36
[ { "api_name": "django.core.handlers.asgi.ASGIRequest", "line_number": 31, "usage_type": "name" }, { "api_name": "django.http.QueryDict", "line_number": 35, "usage_type": "call" }, { "api_name": "django.http", "line_number": 35, "usage_type": "name" }, { "api_name"...
12785925952
from py_reconhecimento import TReconhecimento from py_cadastro import TCadastro from py_principal import TPrincipal from kivy.uix.screenmanager import ScreenManager from kivy.app import App from kivy import Config from kivy.lang import Builder Config.set('graphics', 'resizable', True) Config.set('kivy', 'exit_on_escap...
eticialima/recognitionfacial
project/py_main.py
py_main.py
py
1,088
python
en
code
3
github-code
36
[ { "api_name": "kivy.Config.set", "line_number": 9, "usage_type": "call" }, { "api_name": "kivy.Config", "line_number": 9, "usage_type": "name" }, { "api_name": "kivy.Config.set", "line_number": 10, "usage_type": "call" }, { "api_name": "kivy.Config", "line_num...
21107255277
import sqlite3 #Her oprettes en forbindelse til databasefilen #Hvis filen ikke findes, vil sqlite oprette en ny tom database. con = sqlite3.connect('start.db') print('Database åbnet') try: con.execute("""CREATE TABLE personer ( id INTEGER PRIMARY KEY AUTOINCREMENT, navn STRING, alder INTEGER)""") ...
jonascj/learn-programming-with-python
ch-database/src/database_start.py
database_start.py
py
1,314
python
da
code
2
github-code
36
[ { "api_name": "sqlite3.connect", "line_number": 5, "usage_type": "call" } ]
29212263006
import numpy as np import pandas as pd import datetime, time # 处理输入时间戳,当前汽车驶入时间戳转化为sumo中以秒为单位 def time_processing(timeStamp): timeArray = time.localtime(timeStamp) # 时间时区设置转换 base_time = datetime.datetime(timeArray[0], timeArray[1], timeArray[2], 0, 0, 0) # 获取当日日期定位到00:00:00 base_time = time.mktim...
Rossions/TCSC
DataProcessing/chengdu/processing_abandon.py
processing_abandon.py
py
2,020
python
en
code
1
github-code
36
[ { "api_name": "time.localtime", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 10, "usage_type": "call" }, { "api_name": "time.mktime", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.read_csv", "li...
8413029677
import sqlite3 connection = sqlite3.connect('data.db') cursor = connection.cursor() create_table = "CREATE TABLE IF NOT EXISTS hotels (hotel_id text PRIMARY KEY, name text, stars real, price real, city text)" cursor.execute(create_table) connection.commit() connection.close()
mariorodeghiero/flask-python-rest-api-course
create_db.py
create_db.py
py
279
python
en
code
0
github-code
36
[ { "api_name": "sqlite3.connect", "line_number": 3, "usage_type": "call" } ]
73037104745
import collections.abc import copy import typing import enpheeph.injections.plugins.indexing.abc.indexingpluginabc import enpheeph.utils.constants import enpheeph.utils.dataclasses import enpheeph.utils.enums import enpheeph.utils.typings class IndexingPlugin( enpheeph.injections.plugins.indexing.abc.indexingplu...
Alexei95/enpheeph
src/enpheeph/injections/plugins/indexing/indexingplugin.py
indexingplugin.py
py
9,122
python
en
code
1
github-code
36
[ { "api_name": "enpheeph.injections.plugins.indexing.abc.indexingpluginabc.injections", "line_number": 13, "usage_type": "attribute" }, { "api_name": "enpheeph.injections.plugins.indexing.abc.indexingpluginabc", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.Opti...
15715933133
import json import os import sys from tempfile import NamedTemporaryFile DEPRECATED_KEYS = [ 'site_yaml_path', 'inventory_config', 'variable_manager_config', 'passwords', 'modules', 'private_key_file'] LIST_TYPES = ['skip-tags', 'tags'] DIRECT_PARAMS = ['start_at_task', 'scp_extra_args', 'sftp...
christaotaoz/shkd-work
work/doc/srv6+5G/ansible8.82/cloudify_ansible_sdk/__init__.py
__init__.py
py
3,848
python
en
code
0
github-code
36
[ { "api_name": "sys.stdout", "line_number": 21, "usage_type": "attribute" }, { "api_name": "json.dumps", "line_number": 69, "usage_type": "call" }, { "api_name": "os.environ.copy", "line_number": 73, "usage_type": "call" }, { "api_name": "os.environ", "line_num...
74791240424
import math import json import random import argparse def genRandomFeatures(n): features = [] for i in range(0, n): lat = (random.random() - 0.5) * 360.0 lng = (random.random() - 0.5) * 180.0 geom = { 'type': 'Point', 'coordinates': [lat, lng] } props = { 'class': 1 if random.random() > 0.5 else 0 ...
decision-labs/mapnik
benchmark/utils/random_points.py
random_points.py
py
1,569
python
en
code
0
github-code
36
[ { "api_name": "random.random", "line_number": 9, "usage_type": "call" }, { "api_name": "random.random", "line_number": 10, "usage_type": "call" }, { "api_name": "random.random", "line_number": 12, "usage_type": "call" }, { "api_name": "random.random", "line_nu...
24417230499
from os.path import exists from pyimpspec.data.data_set import ( DataSet, dataframe_to_data_sets, ) from typing import List def parse_spreadsheet(path: str, **kwargs) -> List[DataSet]: """ Parse a spreadsheet (.xlsx or .ods) containing one or more impedance spectra. Parameters ---------- ...
vyrjana/pyimpspec
src/pyimpspec/data/formats/spreadsheet.py
spreadsheet.py
py
1,039
python
en
code
12
github-code
36
[ { "api_name": "os.path.exists", "line_number": 29, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 30, "usage_type": "name" }, { "api_name": "pyimpspec.data.data_set.DataSet", "line_number": 30, "usage_type": "name" }, { "api_name": "pandas.Dat...
40618220774
from django.conf.urls import url from . import views urlpatterns=[ url(r'^register/',views.mapiview.as_view()), url(r'^editview/',views.mapiview1.as_view()), url(r'^update/',views.mapiview2.as_view()), url(r'^vcus/',views.vcustomer), url(r'^registercus/',views.post), url(r'^viewtr/(?P<idd>\w+)',...
jannamariyam/GOLD_APP
SPRINT 4/web/goldinapp/customer/urls.py
urls.py
py
366
python
en
code
0
github-code
36
[ { "api_name": "django.conf.urls.url", "line_number": 4, "usage_type": "call" }, { "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.co...