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
42754051183
from datetime import datetime from elasticsearch import Elasticsearch from elasticsearch import helpers import json import time es = Elasticsearch() f = open("yt_data.rst") lines = f.readlines() cnt = 1 data_cnt = 0 actions = [] s = time.time() for line in lines: data = json.loads(line) action = { "_ind...
timothyliu0912/db_project
db/c.py
c.py
py
641
python
en
code
0
github-code
36
[ { "api_name": "elasticsearch.Elasticsearch", "line_number": 6, "usage_type": "call" }, { "api_name": "time.time", "line_number": 12, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 14, "usage_type": "call" }, { "api_name": "elasticsearch.helpers...
44310767729
import pygame, colors, random, time, sideclass, draw, timer from random import randint def collision(player, enemy, player1, screen, WIDTH, HEIGHT): if (pygame.sprite.groupcollide(player, enemy, False, True)): draw.drawlose(enemy, screen, WIDTH, HEIGHT) player1.score = 0 def side(screen, WIDTH, ...
RamboTheGreat/Minigame-Race
sidescroll.py
sidescroll.py
py
2,909
python
en
code
0
github-code
36
[ { "api_name": "pygame.sprite.groupcollide", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.sprite", "line_number": 6, "usage_type": "attribute" }, { "api_name": "draw.drawlose", "line_number": 7, "usage_type": "call" }, { "api_name": "sideclass.pl...
16272104179
import torch import torch.nn.functional as F # Focal Loss with alpha=0.25 and gamma=2 (standard) class FocalLoss(torch.nn.Module): def __init__(self, alpha=0.25, gamma=2): super(FocalLoss, self).__init__() self.alpha = alpha self.gamma = gamma def forward(self, pred, targets): ...
martinigoyanes/drugVQA
loss.py
loss.py
py
2,477
python
en
code
0
github-code
36
[ { "api_name": "torch.nn", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.nn.functional.binary_cross_entropy_with_logits", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.nn.functional", "line_number": 12, "usage_type": "name" }, { ...
15637256017
import os import csv import sys import fnmatch import shutil import time import re import config as cfg import numpy as np import pandas as pd import mysql.connector as mysql import sqlalchemy from datetime import datetime from dateutil.parser import parse from selenium import webdriver from selenium.webdriver.common.k...
xxwikkixx/ChadBot
barchart/barchartDl.py
barchartDl.py
py
6,546
python
en
code
16
github-code
36
[ { "api_name": "selenium.webdriver.chrome.options.Options", "line_number": 26, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 28, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 28, "usage_type": "name" }, {...
38164556201
import glob import importlib import io import logging import os import shlex import subprocess import time import cornet import numpy as np import pandas import torch import torch.nn as nn import torch.utils.model_zoo import torchvision import tqdm from PIL import Image from torch.nn import Module Image.warnings.simp...
franzigeiger/training_reductions
base_models/trainer_performance.py
trainer_performance.py
py
12,170
python
en
code
3
github-code
36
[ { "api_name": "PIL.Image.warnings.simplefilter", "line_number": 21, "usage_type": "call" }, { "api_name": "PIL.Image.warnings", "line_number": 21, "usage_type": "attribute" }, { "api_name": "PIL.Image", "line_number": 21, "usage_type": "name" }, { "api_name": "log...
22234739193
from pykinect2 import PyKinectV2 from pykinect2.PyKinectV2 import * from pykinect2 import PyKinectRuntime import numpy as np import cv2 import time # kinect = PyKinectRuntime.PyKinectRuntime(PyKinectV2.FrameSourceTypes_Color) # while True: # if kinect.has_new_color_frame(): # frame = kinect.get_last_color_fram...
zachvin/KinectImaging
tests.py
tests.py
py
996
python
en
code
0
github-code
36
[ { "api_name": "cv2.VideoCapture", "line_number": 19, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 25, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 25, "usage_type": "attribute" }, { "api_name": "cv2.findCircles...
5577508746
import json with open('firm.txt', 'r', encoding='utf-8') as f: data = [] for line in f: line = line.replace("\n", "") string = line.split(" ") data.append(string) average = 0 avg_firms = 0 diction = {} for el in data: profit = int(el[2]) - int(el[3]) diction.update({el[0]:profi...
Ilyagradoboev/geekproject
lesson_5.7.py
lesson_5.7.py
py
580
python
en
code
0
github-code
36
[ { "api_name": "json.dump", "line_number": 25, "usage_type": "call" } ]
30351631272
def load_and_get_stats(filename): """Reads .wav file and returns data, sampling frequency, and length (time) of audio clip.""" import scipy.io.wavfile as siow sampling_rate, amplitude_vector = siow.read(filename) wav_length = amplitude_vector.shape[0] / sampling_rate return sampling_rate, amplit...
Sychee/Piano-Audio-Classifier
audio_to_spectogram.py
audio_to_spectogram.py
py
1,820
python
en
code
0
github-code
36
[ { "api_name": "scipy.io.wavfile.read", "line_number": 6, "usage_type": "call" }, { "api_name": "scipy.io.wavfile", "line_number": 6, "usage_type": "name" }, { "api_name": "numpy.linspace", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot...
22868444012
import pandas as pd import numpy as np from nltk.corpus import stopwords nltk_stopwords = stopwords.words('english') # Sklearn TF-IDF Libraries from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.feature_extraction.text import CountVectorizer from sklearn.metrics.pairwise import cosine_similarity...
chois11/7071CEM-R
resources/backend/search_engine.py
search_engine.py
py
1,376
python
en
code
0
github-code
36
[ { "api_name": "nltk.corpus.stopwords.words", "line_number": 5, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords", "line_number": 5, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "sklea...
24644699429
import io import itertools def part_one(): file = open('inputs\\day_1_part_1.txt', 'r') total = 0 for line in file: total = total + int(line) print(f'Part 1 Total {total}') def part_two(): file = open('inputs\\day_1_part_1.txt', 'r') observed_frequencies = {0} total = 0 for lin...
mruston0/AdventOfCode2018
day_1_chronal_calibration.py
day_1_chronal_calibration.py
py
639
python
en
code
0
github-code
36
[ { "api_name": "itertools.cycle", "line_number": 15, "usage_type": "call" } ]
41203564707
import cv2 import numpy as np from PIL import Image facedetect = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')#create a cascade classifier using haar cascade cam = cv2.VideoCapture(0)#creates avideo capture object rec=cv2.createLBPHFaceRecognizer()#create a recognizer object rec.load("test_traini...
UPASANANAG/Face-Recognizer
facedetector.py
facedetector.py
py
1,437
python
en
code
0
github-code
36
[ { "api_name": "cv2.CascadeClassifier", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.createLBPHFaceRecognizer", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2....
26285333278
import os, requests, colorama from colorama import Fore green = Fore.GREEN red = Fore.RED yellow = Fore.YELLOW reset = Fore.RESET #banner banner = """ __ __ __ / / / /___ _____/ /_ / /_/ / __ \/ ___/ __/ / __ / /_/ (__ ) /_ ...
Nadeesha-Prasad/Zero-Balance-Host-Scanner-For-Linux
hscan.py
hscan.py
py
2,271
python
en
code
1
github-code
36
[ { "api_name": "colorama.Fore.GREEN", "line_number": 3, "usage_type": "attribute" }, { "api_name": "colorama.Fore", "line_number": 3, "usage_type": "name" }, { "api_name": "colorama.Fore.RED", "line_number": 4, "usage_type": "attribute" }, { "api_name": "colorama.F...
21417420352
import pandas as pd import numpy as np import requests from textblob import TextBlob as tb from bs4 import BeautifulSoup as bs from matplotlib import pyplot as plt import time import nltk import re from IPython.display import clear_output import matplotlib.pyplot as plt import seaborn as sns stopwords = nltk.corpus....
Ruksana-Kauser/NLP_Final_Project
reviews.py
reviews.py
py
6,211
python
en
code
0
github-code
36
[ { "api_name": "nltk.corpus.stopwords.words", "line_number": 15, "usage_type": "call" }, { "api_name": "nltk.corpus", "line_number": 15, "usage_type": "attribute" }, { "api_name": "textblob.TextBlob", "line_number": 27, "usage_type": "call" }, { "api_name": "reques...
26009651155
import argparse import os import random import re import subprocess import time parser = argparse.ArgumentParser() parser.add_argument( "-n", "--number", help="max number of problems to attempt", type=int ) parser.add_argument( "-r", "--random", help="attempt problems in random order", action="store_true" ) pa...
russellw/ayane
script/e.py
e.py
py
2,820
python
en
code
0
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "random.seed", "line_number": 24, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 28, "usage_type": "call" }, { "api_name": "re.match", "line_num...
33052012137
from sqlalchemy.orm import Session import curd, cloud, orm def policy_with_projects(yun, projects): if not projects or len(projects) == 0: return None tagvals = ','.join(['"'+p.project.name+'"' for p in projects]) return yun.CloudIAM.policy_gen_write_with_tag("Project", tagvals) def policy_with_te...
kealiu/codecommitter
app/iam.py
iam.py
py
2,267
python
en
code
0
github-code
36
[ { "api_name": "sqlalchemy.orm.Session", "line_number": 28, "usage_type": "name" }, { "api_name": "orm.User", "line_number": 28, "usage_type": "attribute" }, { "api_name": "curd.ProjectAdmin.get_all_by_user", "line_number": 31, "usage_type": "call" }, { "api_name":...
40554209630
""" Stack-In-A-Box: Stack Management """ import logging import re import threading import uuid import six logger = logging.getLogger(__name__) class ServiceAlreadyRegisteredError(Exception): """StackInABoxService with the same name already registered.""" pass class StackInABox(object): """Stack-In-A-...
TestInABox/stackInABox
stackinabox/stack.py
stack.py
py
11,760
python
en
code
7
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "uuid.uuid4", "line_number": 160, "usage_type": "call" }, { "api_name": "six.iteritems", "line_number": 209, "usage_type": "call" }, { "api_name": "six.iteritems", "lin...
36570577773
from haystack.forms import SearchForm from django import forms from haystack.query import SearchQuerySet from haystack.query import SQ from peeldb.models import City valid_time_formats = ["%Y-%m-%d 00:00:00"] class job_searchForm(SearchForm): q = forms.CharField(max_length=200, required=False) location = for...
MicroPyramid/opensource-job-portal
search/forms.py
forms.py
py
7,863
python
en
code
336
github-code
36
[ { "api_name": "haystack.forms.SearchForm", "line_number": 10, "usage_type": "name" }, { "api_name": "django.forms.CharField", "line_number": 11, "usage_type": "call" }, { "api_name": "django.forms", "line_number": 11, "usage_type": "name" }, { "api_name": "django....
16132606164
# -*- coding: utf-8 -*- """ Created on Tue Feb 18 10:01:52 2020 @author: Ferhat """ from flask import Flask, jsonify, json, Response,make_response,request from flask_cors import CORS # ============================================================================= # from flask_cors import cross_origin # ==============...
RamazanFerhatSonmez/Image-Processing-Python
rest-server.py
rest-server.py
py
4,161
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 24, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 25, "usage_type": "call" }, { "api_name": "logging.FileHandler", "line_number": 26, "usage_type": "call" }, { "api_name": "logging.INFO", "l...
15539017308
from functools import reduce from decimal import Decimal # From stdin: # num_of_elem=int(input()) # elements=list(map(int,input().split())) # From a file: num_of_elem=0 elements="" with open('input/input03.txt','r') as file_in: file_lines=file_in.readlines() num_of_elem=int(file_lines[0]) elements=file_li...
gianv9/HackerRanksSubmissions
10 Days of Statistics/Day 0/Mean Median and Mode/solution.py
solution.py
py
1,156
python
en
code
0
github-code
36
[ { "api_name": "decimal.Decimal", "line_number": 18, "usage_type": "call" }, { "api_name": "functools.reduce", "line_number": 18, "usage_type": "call" }, { "api_name": "decimal.Decimal", "line_number": 27, "usage_type": "call" } ]
28230488326
from requests import Request, Session import config import json __all__=['SendBookClass', 'SendFindClass'] config_FindClass = config.FindClass() config_BookClass = config.BookClass() http_proxy = "http://localhost:8888" https_proxy = "https://localhost:8888" ftp_proxy = "ftp://10.10.1.10:3128" #cafile = 'FiddlerR...
akhildevelops/cult-fitness-auto-book
cult_network.py
cult_network.py
py
2,133
python
en
code
1
github-code
36
[ { "api_name": "config.FindClass", "line_number": 7, "usage_type": "call" }, { "api_name": "config.BookClass", "line_number": 8, "usage_type": "call" }, { "api_name": "requests.Session", "line_number": 31, "usage_type": "call" }, { "api_name": "requests.Request", ...
30846787707
# image/views.py from rest_framework.response import Response from rest_framework import generics, status, filters from rest_framework.views import APIView from django.shortcuts import get_object_or_404 from django.core.serializers.json import DjangoJSONEncoder from django.contrib.auth.models import User from django.h...
ngade98/waterlogged_heroku
waterlogged/views.py
views.py
py
16,109
python
en
code
0
github-code
36
[ { "api_name": "azure.storage.blob.BlobServiceClient.from_connection_string", "line_number": 28, "usage_type": "call" }, { "api_name": "azure.storage.blob.BlobServiceClient", "line_number": 28, "usage_type": "name" }, { "api_name": "rest_framework.views.APIView", "line_number"...
36060957275
# list of registered users - pdf - full format # list of users who availed book - name, ISBN, borrowDate and returnDate # list of users with fine amount - name and fee pending # send notification about the due submit and late fee - sends notification from db_read import database from fpdf import FPDF from tkinter...
sridamul/BBMS
userManagement.py
userManagement.py
py
11,961
python
en
code
0
github-code
36
[ { "api_name": "db_read.database.child", "line_number": 14, "usage_type": "call" }, { "api_name": "db_read.database", "line_number": 14, "usage_type": "name" }, { "api_name": "fpdf.FPDF", "line_number": 15, "usage_type": "call" }, { "api_name": "tkinter.messagebox....
42412749367
from flask import Flask, Response, jsonify from Flask_PoolMysql import func # 实例化flask对象 app = Flask(__name__) app.config.from_pyfile('config.py') class JsonResponse(Response): @classmethod def force_type(cls, response, environ=None): """这个方法只有视图函数返回非字符、非元祖、非Response对象才会调用 :param response: ...
loingjuzy/learn-flask
Flask_T1.py
Flask_T1.py
py
1,397
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.Response", "line_number": 9, "usage_type": "name" }, { "api_name": "flask.jsonify", "line_number": 21, "usage_type": "call" }, { "api_name": "Flask_PoolMysql.func", "li...
41865132711
from __future__ import absolute_import, print_function import os import numpy as np import pyopencl as cl os.environ['PYOPENCL_COMPILER_OUTPUT']='1' modulepath=os.path.dirname(os.path.abspath(__file__)) class Particles(object): def __init__(self,nparticles=1,ndim=10): self.nparticles=nparticles ...
rdemaria/sixtracklib_gsoc18
studies/study1/sixtracklib.py
sixtracklib.py
py
2,937
python
en
code
0
github-code
36
[ { "api_name": "os.environ", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line...
72806130663
# -*- coding: utf-8 -*- """ Created on Tue Oct 2 17:51:41 2018 @author: USER """ import sys sys.path.append('..') import os import torch import torch.nn as nn import numpy as np import utils.general as utils import utils.adversarial_ae as ae_utils from adverse_AE import Adversarial_AE, Discriminator ...
bchao1/Fun-with-MNIST
Adversarial_Autoencoder/train.py
train.py
py
3,559
python
en
code
23
github-code
36
[ { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "utils.general.get_dataloader", "line_number": 26, "usage_type": "call" }, { "api_name": "utils.genera...
12852390478
# An implementation of the three-body problem by Logan Schmalz # https://github.com/LoganSchmalz/threebody/ # MIT License import numpy as np import scipy as sci import scipy.integrate import scipy.linalg import matplotlib.pyplot as plt # As astronomers, we like to normalize values to scales that make sense # So that'...
LoganSchmalz/threebody
threebody.py
threebody.py
py
5,543
python
en
code
0
github-code
36
[ { "api_name": "scipy.linalg.norm", "line_number": 39, "usage_type": "call" }, { "api_name": "scipy.linalg", "line_number": 39, "usage_type": "attribute" }, { "api_name": "scipy.linalg.norm", "line_number": 40, "usage_type": "call" }, { "api_name": "scipy.linalg", ...
35515239669
import argparse from datetime import datetime import os import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data from model import Model from dataset import Dataset from tqdm import tqdm from sklearn.metrics import confusion_matrix, roc_curve, auc import numpy as np import matplotli...
onermustafaumit/MLNM
gland_classification/four_resolutions_model/test.py
test.py
py
9,294
python
en
code
4
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 39, "usage_type": "call" }, { "api_name": "os.path", "line_number": 39, "usage_type": "attribute" }, { "api_name": "os.makedirs", ...
9856058749
import re import csv import os import sys import pickle from pprint import pprint from enum import Enum sys.path.insert(0, '../heatmap') sys.path.insert(0, '../tests') from stat_type_lookups import * from tester import * # Types of files: # Fundamental files # - PlayByPlay.csv, GameIDs.csv, BoxscoreStats.csv #...
AdamCharron/CanadaBasketballStats
enrich/parse_to_yaml.py
parse_to_yaml.py
py
11,609
python
en
code
0
github-code
36
[ { "api_name": "sys.path.insert", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "sys.path.insert", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.path", "line_numbe...
42632745572
from setuptools import setup, find_packages version = '0.1' long_description = ( open('README.rst').read() + '\n' + 'Contributors\n' '============\n' + '\n' + open('CONTRIBUTORS.rst').read() + '\n' + open('CHANGES.rst').read() + '\n') setup( name='imio.dms.ws', version=ver...
IMIO/imio.dms.ws
setup.py
setup.py
py
1,189
python
en
code
0
github-code
36
[ { "api_name": "setuptools.setup", "line_number": 16, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 34, "usage_type": "call" } ]
4513078370
import json import random words = [] unavailableWordIndices = set() rejectedWordIndices = set() with open("words.js", "r") as f: s = f.read() s = s[s.find("["):s.rfind(",")] + "]" words = json.loads(s) with open("history.json", "r") as f: history = json.load(f) for item in history: index ...
mkacz91/slowle
picker.py
picker.py
py
2,289
python
en
code
1
github-code
36
[ { "api_name": "json.loads", "line_number": 11, "usage_type": "call" }, { "api_name": "json.load", "line_number": 14, "usage_type": "call" }, { "api_name": "json.load", "line_number": 21, "usage_type": "call" }, { "api_name": "json.load", "line_number": 25, ...
72809319784
from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union import attr from ..models.reference_type import ReferenceType from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.key import Key T = TypeVar("T", bound="Reference") @attr.s(auto_attribs=True) class Reference: """ Att...
sdm4fzi/aas2openapi
ba-syx-submodel-repository-client/ba_syx_submodel_repository_client/models/reference.py
reference.py
py
3,280
python
en
code
7
github-code
36
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.TypeVar", "line_number": 12, "usage_type": "call" }, { "api_name": "typing.Union", "line_number": 24, "usage_type": "name" }, { "api_name": "types.Unset", "li...
12316087861
import tkinter as tk from tkinter import ttk from tkinter import filedialog import os import glob import cv2 import math import csv import re import pandas as pd import matplotlib.pyplot as plt import numpy as np from tensorflow.keras.applications.imagenet_utils import preprocess_input, decode_predictions ...
NoahSCode/EDUSIM
app_train.py
app_train.py
py
10,305
python
en
code
0
github-code
36
[ { "api_name": "tkinter.filedialog.askdirectory", "line_number": 26, "usage_type": "call" }, { "api_name": "tkinter.filedialog", "line_number": 26, "usage_type": "name" }, { "api_name": "tkinter.END", "line_number": 30, "usage_type": "attribute" }, { "api_name": "t...
35056080810
import cantera as ct import numpy as np from typing import List, Tuple from scipy import integrate from copy import copy """ Present a simple implementation of IDT reactors and the cantera implementation of a LFS reactor. Each model can be called as: IDT, all_conditions = idt_reactor.solve(gas, flag='T', temp_rise=...
fingeraugusto/red_app
src/reactors.py
reactors.py
py
11,199
python
en
code
0
github-code
36
[ { "api_name": "numpy.ndarray", "line_number": 35, "usage_type": "attribute" }, { "api_name": "cantera.one_atm", "line_number": 63, "usage_type": "attribute" }, { "api_name": "cantera.Solution", "line_number": 76, "usage_type": "attribute" }, { "api_name": "cantera...
18206090350
from scrapy.selector import HtmlXPathSelector from scrapy.contrib.spiders import CrawlSpider # Rule from scrapy.http.request import Request import html2text import time import re import dateutil.parser import datetime import urlparse from buzz_crawler.items import BuzzCrawlerItem from markdown import markdown class ...
claudehenchoz/z4
buzz_crawler/buzz_crawler/spiders/woz_spider.py
woz_spider.py
py
1,600
python
en
code
0
github-code
36
[ { "api_name": "scrapy.contrib.spiders.CrawlSpider", "line_number": 14, "usage_type": "name" }, { "api_name": "scrapy.selector.HtmlXPathSelector", "line_number": 20, "usage_type": "call" }, { "api_name": "buzz_crawler.items.BuzzCrawlerItem", "line_number": 21, "usage_type"...
13859467294
import xml.etree.ElementTree as ET import json path_train = "D:/code/prompt-ABSA/dataset/original data/ABSA16_Laptops_Train_SB1_v2.xml" path_test = 'D:/code/prompt-ABSA/dataset/original data/EN_LAPT_SB1_TEST_.xml' terr = 'laptops16' def get_path(territory, data_type): return f'./dataset/data/{territory}/{data_ty...
lazy-cat2233/PBJM
data_from_xml.py
data_from_xml.py
py
2,285
python
en
code
1
github-code
36
[ { "api_name": "xml.etree.ElementTree.parse", "line_number": 22, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 22, "usage_type": "name" }, { "api_name": "json.dump", "line_number": 67, "usage_type": "call" }, { "api_name": "json.dump...
31515158551
"""Basic state machine implementation.""" # pylint: disable=unnecessary-pass, too-many-instance-attributes from typing import Iterable, Union from rclpy import logging from rclpy.node import Node from rclpy.time import Time, Duration LOGGER = logging.get_logger("behavior") class Resource: """The resource class i...
LARG/spl-release
src/behavior/behavior/state_machine.py
state_machine.py
py
22,719
python
en
code
1
github-code
36
[ { "api_name": "rclpy.logging.get_logger", "line_number": 9, "usage_type": "call" }, { "api_name": "rclpy.logging", "line_number": 9, "usage_type": "name" }, { "api_name": "rclpy.node.Node", "line_number": 86, "usage_type": "name" }, { "api_name": "typing.Iterable"...
1063868906
#!/usr/bin/env python # -*- coding: utf-8 -*- from PIL import Image from matplotlib import pyplot as plt import numpy as np import pytesseract import cv2 import tkinter as tk import logging import time import re import threading # Dimensioning values # We are defining global variables based on match data in order t...
BrunoSader/An-emotional-sports-highlight-generator
ocr/final_ocr.py
final_ocr.py
py
18,525
python
en
code
4
github-code
36
[ { "api_name": "logging.basicConfig", "line_number": 46, "usage_type": "call" }, { "api_name": "logging.WARNING", "line_number": 46, "usage_type": "attribute" }, { "api_name": "cv2.VideoCapture", "line_number": 57, "usage_type": "call" }, { "api_name": "cv2.CAP_PRO...
35153410551
import torch import torch.nn as nn class Net(nn.Module): def __init__(self): super(Net, self).__init__() self.fc1 = nn.Linear(784, 256, bias = False) self.bn1 = nn.BatchNorm1d(256) self.relu1 = nn.ReLU() self.fc2 = nn.Linear(256, 128) self.bn2 = nn.BatchNorm1d...
Sachi-27/WiDS--Image-Captioning
Week 2/model.py
model.py
py
649
python
en
code
0
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 4, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 4, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.nn", "line_numbe...
34203757063
import torch import torch.nn as nn from math import sin, cos import models from models.base import BaseModel from models.utils import chunk_batch from systems.utils import update_module_step from nerfacc import ContractionType, OccupancyGrid, ray_marching from nerfacc.vol_rendering import render_transmittance_from_alph...
3dlg-hcvc/paris
models/se3.py
se3.py
py
10,421
python
en
code
31
github-code
36
[ { "api_name": "models.base.BaseModel", "line_number": 13, "usage_type": "name" }, { "api_name": "models.make", "line_number": 15, "usage_type": "call" }, { "api_name": "models.make", "line_number": 16, "usage_type": "call" }, { "api_name": "models.make", "line...
2109558152
import numpy as np import pandas as pd from math import factorial, pi import scipy.optimize import scipy.misc import os import re import argparse from sklearn.gaussian_process import GaussianProcessRegressor from sklearn.gaussian_process.kernels import RBF,ConstantKernel # for tests #import matplotlib.pyplot...
pierre-moreau/EoS_HRG
EoS_HRG/fit_lattice.py
fit_lattice.py
py
20,400
python
en
code
0
github-code
36
[ { "api_name": "os.path.dirname", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 15, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser...
42493659115
""" Helper function to safely convert an array to a new data type. """ from __future__ import absolute_import, print_function, division import numpy as np import theano __docformat__ = "restructuredtext en" def _asarray(a, dtype, order=None): """Convert the input to a Numpy array. This function is almost ...
Theano/Theano
theano/misc/safe_asarray.py
safe_asarray.py
py
2,384
python
en
code
9,807
github-code
36
[ { "api_name": "theano.config", "line_number": 32, "usage_type": "attribute" }, { "api_name": "numpy.dtype", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 34, "usage_type": "call" } ]
24814387482
#! /usr/bin/env python from __future__ import print_function from pyspark import SparkContext, SparkConf from pyspark.sql import SparkSession import Addressbook_pb2 import sys from google.protobuf import json_format import json import glob import errno if __name__ == "__main__": confz = SparkConf()\ .set(...
yiyuan906/ProjectWork
ProtobufTest/SparkConvertFrom.py
SparkConvertFrom.py
py
1,367
python
en
code
0
github-code
36
[ { "api_name": "pyspark.SparkConf", "line_number": 15, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder.master", "line_number": 22, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 22, "usage_type": "attribute"...
41510394343
# -*- coding: utf-8 -*- # project 1 import pandas as pd import numpy as np import matplotlib import warnings import matplotlib.pyplot as plt import os import seaborn as sns from scipy import stats as st from scipy.linalg import svd from sklearn.preprocessing import StandardScaler, MinMaxScaler from sklear...
tirohweder/into_ml_dm_project_1
main.py
main.py
py
11,707
python
en
code
3
github-code
36
[ { "api_name": "warnings.filterwarnings", "line_number": 21, "usage_type": "call" }, { "api_name": "matplotlib.MatplotlibDeprecationWarning", "line_number": 21, "usage_type": "attribute" }, { "api_name": "pandas.DataFrame", "line_number": 39, "usage_type": "call" }, { ...
40746622543
import numpy as np import gzip from ase import Atom, Atoms import gzip import io import os from ase.io import write, read import pyscal3.formats.ase as ptase import warnings def read_snap(infile, compressed = False): """ Function to read a POSCAR format. Parameters ---------- infile : string ...
pyscal/pyscal3
src/pyscal3/formats/vasp.py
vasp.py
py
3,869
python
en
code
2
github-code
36
[ { "api_name": "ase.io.read", "line_number": 40, "usage_type": "call" }, { "api_name": "pyscal3.formats.ase.read_snap", "line_number": 41, "usage_type": "call" }, { "api_name": "pyscal3.formats.ase", "line_number": 41, "usage_type": "name" }, { "api_name": "warning...
11686617200
import psutil import time import sys # Nav : gzserver, move_base, amcl, robo state pub, rosout, mapsrv # ObjTrack : gzserver, subscribr, objdetector, objtracker, controller # Nav2D : stage, navigator, operator, mapper, rviz, joy, controller cpu_util = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] mem_util = [0.0, 0.0, 0.0,...
aditi741997/robotics_project
measure_cpu.py
measure_cpu.py
py
2,264
python
en
code
1
github-code
36
[ { "api_name": "sys.argv", "line_number": 11, "usage_type": "attribute" }, { "api_name": "psutil.AccessDenied", "line_number": 27, "usage_type": "attribute" }, { "api_name": "psutil.process_iter", "line_number": 32, "usage_type": "call" }, { "api_name": "psutil.pro...
18626454048
# # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be u...
ssOleg/pywbem
pywbem/_recorder.py
_recorder.py
py
36,379
python
en
code
null
github-code
36
[ { "api_name": "six.PY2", "line_number": 43, "usage_type": "attribute" }, { "api_name": "six.PY2", "line_number": 51, "usage_type": "attribute" }, { "api_name": "collections.namedtuple", "line_number": 56, "usage_type": "call" }, { "api_name": "yaml.MappingNode", ...
17849611547
from ..config import np, Vector, DataName, MetaboliteConfig, ParameterName, LegendConfig from ..metabolic_network_contents.metabolite import Metabolite from ..metabolic_network_contents.reaction import Reaction metabolite_width = MetaboliteConfig.width class NormalLegendConfig(object): metabolite_content_dict ...
LocasaleLab/Automated-MFA-2023
figures/figure_plotting/figure_elements/metabolic_network/layout_generator_functions/legend_layout_generator.py
legend_layout_generator.py
py
11,543
python
en
code
0
github-code
36
[ { "api_name": "config.MetaboliteConfig.width", "line_number": 7, "usage_type": "attribute" }, { "api_name": "config.MetaboliteConfig", "line_number": 7, "usage_type": "name" }, { "api_name": "metabolic_network_contents.metabolite.Metabolite", "line_number": 12, "usage_typ...
42194340126
import datetime import math from sqlalchemy import desc, asc from app.main import db from app.main.model.unit import Unit from app.main.service.language_helper import LanguageHelper def save_unit(data, args): errors = {} language_data = LanguageHelper(args) # Check unique field is null or not if da...
viettiennguyen029/recommendation-system-api
app/main/service/unit_service.py
unit_service.py
py
9,022
python
en
code
0
github-code
36
[ { "api_name": "app.main.service.language_helper.LanguageHelper", "line_number": 13, "usage_type": "call" }, { "api_name": "app.main.model.unit.Unit.query.filter_by", "line_number": 27, "usage_type": "call" }, { "api_name": "app.main.model.unit.Unit.query", "line_number": 27, ...
2036516482
import os import pathlib import argparse import uuid import logging import subprocess from nuvoloso.dependencies.install_packages import InstallPackages from nuvoloso.dependencies.kops_cluster import KopsCluster from nuvoloso.dependencies.kubectl_helper import KubectlHelper from nuvoloso.api.nuvo_management import Nu...
Nuvoloso/testing_open_source
testingtools/deploy_app_cluster.py
deploy_app_cluster.py
py
6,776
python
en
code
0
github-code
36
[ { "api_name": "nuvoloso.api.nuvo_management.NuvoManagement", "line_number": 21, "usage_type": "call" }, { "api_name": "nuvoloso.dependencies.kubectl_helper.KubectlHelper", "line_number": 22, "usage_type": "call" }, { "api_name": "nuvoloso.dependencies.install_packages.InstallPack...
75002646183
from concurrent.futures import ThreadPoolExecutor,wait,as_completed from socket import timeout from turtle import done from unittest.result import failfast import requests import re import warnings import os import traceback import importlib warnings.filterwarnings('ignore') url='https://e-hentai.org' slist...
CrystalRays/pytools
ehentaidownloader.py
ehentaidownloader.py
py
4,505
python
en
code
0
github-code
36
[ { "api_name": "warnings.filterwarnings", "line_number": 11, "usage_type": "call" }, { "api_name": "os.makedirs", "line_number": 38, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 40, "usage_type": "call" }, { "api_name": "re.findall", "li...
71930911465
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jun 5 20:17:37 2017 @author: afranio """ import numpy as np import matplotlib.pyplot as plt # dados experimentais # benzeno - pressao de vapor X temperatura P = np.array([ 1, 5, 10, 20, 40, 60, 100, 200, 400, 760]) # mmH...
afraniomelo/curso-matlab
codigos/python/ajuste_polinomio.py
ajuste_polinomio.py
py
887
python
pt
code
0
github-code
36
[ { "api_name": "numpy.array", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.polyfit", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.polyval", "line_numbe...
23314260402
import logging import os from malware_extractor import MalwareExtractor logger = logging.getLogger(__name__) class VXVaultExtractor(MalwareExtractor): def process_input(self): # files are just zip files, so can simply copy those across self.copy_files() if __name__ == "__main__": logger.i...
g-clef/malware_extractor
VXVaultExtractor.py
VXVaultExtractor.py
py
708
python
en
code
0
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "malware_extractor.MalwareExtractor", "line_number": 10, "usage_type": "name" }, { "api_name": "os.environ.get", "line_number": 19, "usage_type": "call" }, { "api_name": "os...
26498800829
import requests import json import numpy as np import cv2 import os from tqdm import tqdm def crop_receipt(raw_img): """Crop receipt from a raw image captured by phone Args: raw_img ([np.array]): Raw image containing receipt Returns: cropped_receipt ([np.array]): The image of cropped rece...
tiendv/MCOCR2021
Task1/cropper.py
cropper.py
py
1,516
python
en
code
9
github-code
36
[ { "api_name": "cv2.imencode", "line_number": 21, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 23, "usage_type": "call" }, { "api_name": "cv2.imencode", "line_number": 28, "usage_type": "call" }, { "api_name": "requests.request", "line_...
12526381398
from PIL import ImageGrab,Image import pytesseract def yz_code(): # bbox = (1348, 423, 1455, 455) # 截图范围,这个取决你验证码的位置 # img = ImageGrab.grab(bbox=bbox) # img.save("D:\\py\\login\\image_code.jpg") # 设置路径 # img.show() img = Image.open('img5.bmp') # PIL库加载图片 # print img.format, img.size, img....
SuneastChen/other_python_demo
其他实例/验证码识别/图片处理1_pytesseract识别.py
图片处理1_pytesseract识别.py
py
1,285
python
en
code
0
github-code
36
[ { "api_name": "PIL.Image.open", "line_number": 11, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 11, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number": 28, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number"...
71202438503
# -*- coding: utf-8 -*- # @Author: Luis Condados # @Date: 2023-09-09 18:46:06 # @Last Modified by: Luis Condados # @Last Modified time: 2023-09-16 18:33:43 import fiftyone as fo import fiftyone.zoo as foz import fiftyone.brain as fob from sklearn.cluster import KMeans import click import logging logging.basicCo...
Gabriellgpc/exploratory_image_data_analysis
workspace/demo.py
demo.py
py
2,617
python
en
code
0
github-code
36
[ { "api_name": "logging.basicConfig", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 16, "usage_type": "attribute" }, { "api_name": "fiftyone.Dataset.from_images_dir", "line_number": 19, "usage_type": "call" }, { "api_name":...
27890676766
# -*- coding: utf-8 -*- import tensorflow as tf import tensorflow.examples.tutorials.mnist.input_data as input_data import pdb def weight_variable(shape): "初始化权重" initial = tf.truncated_normal(shape,stddev=0.1) return tf.Variable(initial) def bias_variable(shape): "初始化偏置项" initial = tf.constant...
RyanWangZf/Tensorflow_Tutorial
Others/simple_CNN.py
simple_CNN.py
py
2,840
python
en
code
0
github-code
36
[ { "api_name": "tensorflow.truncated_normal", "line_number": 11, "usage_type": "call" }, { "api_name": "tensorflow.Variable", "line_number": 12, "usage_type": "call" }, { "api_name": "tensorflow.constant", "line_number": 16, "usage_type": "call" }, { "api_name": "t...
4778562539
from typing import Optional, Tuple, Union import paddle import paddle.nn.functional as F def cast_if_needed(tensor: Union[paddle.Tensor, None], dtype: paddle.dtype) -> Union[paddle.Tensor, None]: """Cast tensor to dtype""" return tensor if tensor is None or tensor.dtype == dtype else paddl...
NVIDIA/TransformerEngine
transformer_engine/paddle/utils.py
utils.py
py
4,609
python
en
code
1,056
github-code
36
[ { "api_name": "typing.Union", "line_number": 7, "usage_type": "name" }, { "api_name": "paddle.Tensor", "line_number": 7, "usage_type": "attribute" }, { "api_name": "paddle.dtype", "line_number": 8, "usage_type": "attribute" }, { "api_name": "paddle.cast", "lin...
73060543145
from tutelary.models import ( PermissionSet, Policy, PolicyInstance ) from django.contrib.auth.models import User import pytest from .factories import UserFactory, PolicyFactory from .datadir import datadir # noqa from .settings import DEBUG @pytest.fixture(scope="function") # noqa def setup(datadir, db): u...
Cadasta/django-tutelary
tests/test_integrity.py
test_integrity.py
py
4,068
python
en
code
6
github-code
36
[ { "api_name": "factories.UserFactory.create", "line_number": 13, "usage_type": "call" }, { "api_name": "factories.UserFactory", "line_number": 13, "usage_type": "name" }, { "api_name": "factories.UserFactory.create", "line_number": 14, "usage_type": "call" }, { "a...
40285478633
# %% import logging import os.path import shutil import sys from typing import Optional import matplotlib.pyplot as plt import pandas as pd import pytorch_lightning as pl import torch import torch.nn.functional as F import torchaudio from icecream import ic from torch.utils.data import Dataset, DataLoader import matpl...
Stanvla/Thesis
hubert/clustering/torch_mffc_extract.py
torch_mffc_extract.py
py
17,709
python
en
code
0
github-code
36
[ { "api_name": "torch.utils.data.Dataset", "line_number": 25, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 28, "usage_type": "call" }, { "api_name": "icecream.ic", "line_number": 59, "usage_type": "call" }, { "api_name": "os.path.path.joi...
8694387627
import pandas as pd import numpy as np import os from datetime import timedelta import math pd.set_option('display.width', 1200) pd.set_option('precision', 3) np.set_printoptions(precision=3) np.set_printoptions(threshold=np.nan) class Config: __instance = None def __new__(cls, *args, **kwargs): if c...
cheersyouran/simi-search
codes/config.py
config.py
py
3,162
python
en
code
10
github-code
36
[ { "api_name": "pandas.set_option", "line_number": 7, "usage_type": "call" }, { "api_name": "pandas.set_option", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.set_printoptions", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.set_pri...
20238646277
from numpy import * import operator import matplotlib import matplotlib.pyplot as plt from os import listdir def classify0(inX, dataSet, labels, k): dataSetSize=dataSet.shape[0]#返回dataset的第一维的长度 print(dataSetSize) diffMat = tile(inX, (dataSetSize,1)) - dataSet #计算出各点离原点的距离 #表示diffMat的平方 sqDiffM...
geroge-gao/MachineLeaning
kNN/kNN.py
kNN.py
py
4,622
python
en
code
4
github-code
36
[ { "api_name": "operator.itemgetter", "line_number": 21, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 46, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 46, "usage_type": "name" }, { "api_name": "matplo...
23861578625
from collections import defaultdict def is_isogram(string): dt = defaultdict(int) for c in string.lower(): dt[c] += 1 for k in dt: if k.isalpha() and dt[k] > 1: return False return True
stackcats/exercism
python/isogram.py
isogram.py
py
231
python
en
code
0
github-code
36
[ { "api_name": "collections.defaultdict", "line_number": 4, "usage_type": "call" } ]
17643428428
import argparse import os import torch import torch.nn as nn import torch.optim as optim from tqdm import tqdm from torchvision.utils import save_image from torch.utils.data import Dataset, DataLoader import albumentations from albumentations.pytorch import ToTensorV2 from PIL import Image import numpy as np torch.bac...
ishon19/CSE676-FinalProject
Pix2Pix.py
Pix2Pix.py
py
14,819
python
en
code
1
github-code
36
[ { "api_name": "torch.backends", "line_number": 14, "usage_type": "attribute" }, { "api_name": "torch.nn.Module", "line_number": 19, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 19, "usage_type": "name" }, { "api_name": "torch.nn.Sequential...
73659014184
from django.shortcuts import render, redirect, HttpResponse from django.contrib import messages from login.models import User from .models import Quote # Create your views here. def quotes(request): if 'user_id' not in request.session: return redirect('/') all_users = User.objects.all() user =...
everhartC/QuoteDash
quoteApp/views.py
views.py
py
1,807
python
en
code
0
github-code
36
[ { "api_name": "django.shortcuts.redirect", "line_number": 9, "usage_type": "call" }, { "api_name": "login.models.User.objects.all", "line_number": 11, "usage_type": "call" }, { "api_name": "login.models.User.objects", "line_number": 11, "usage_type": "attribute" }, { ...
14893965980
#coding: utf-8 import sys,io from PyQt5.QtWidgets import * from PyQt5.QtCore import * from PyQt5.QtGui import QIcon class Main(QWidget): def __init__(self): super().__init__() self.mainUI() def mainUI(self): self.setGeometry(300,300,300,300) self.setWindowT...
hirotask/-Python-mojiretu_kugiru
文字列区切る君/main.py
main.py
py
1,205
python
en
code
1
github-code
36
[ { "api_name": "sys.argv", "line_number": 46, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 48, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 49, "usage_type": "attribute" }, { "api_name": "io.TextIOWrapper", "line_n...
15871423301
from pathlib import Path from typing import Any, Dict import torch from tsm import TSM from tsn import TSN, TRN, MTRN verb_class_count, noun_class_count = 125, 352 class_count = (verb_class_count, noun_class_count) def make_tsn(settings): return TSN( class_count, settings["segment_count"], ...
epic-kitchens/epic-kitchens-55-action-models
model_loader.py
model_loader.py
py
2,906
python
en
code
73
github-code
36
[ { "api_name": "tsn.TSN", "line_number": 14, "usage_type": "call" }, { "api_name": "tsn.TRN", "line_number": 28, "usage_type": "name" }, { "api_name": "tsn.MTRN", "line_number": 30, "usage_type": "name" }, { "api_name": "tsm.TSM", "line_number": 46, "usage_...
26192939759
import os import png import math from color_helpers import convert_16_bit_texture_for_pypng # IO THPS Scene Image Correction def shift_row_pixels(row_pixels, shift_amount): shifted_row = [] shifted_row.extend(row_pixels[shift_amount * -4 :]) shifted_row.extend(row_pixels[0 : shift_amount * -4]) ret...
slfx77/psx_texture_extractor
helpers.py
helpers.py
py
2,778
python
en
code
11
github-code
36
[ { "api_name": "os.makedirs", "line_number": 61, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 61, "usage_type": "call" }, { "api_name": "os.path", "line_number": 61, "usage_type": "attribute" }, { "api_name": "png.Writer", "line_numbe...
23013394729
import requests import os def gokidsgo(): a = input('Url? default: 127.0.0.1/').rstrip() if a == '': url = 'http://127.0.0.1/icons/folder.gif' print('grabbing: ' + url) req = requests.get(url, timeout=90) if req.ok: dat = req.text print(dat...
thcsparky/bigclickskid
oldtries/sandbox.py
sandbox.py
py
952
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 21, "usage_type": "call" } ]
4275879545
from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker import cloudinary cloudinary.config( cloud_name="djtxsnk9c", api_key="372171617535646", api_secret="2zMo8MA5wgslqPtRwHOVS1AFRks", ) # SQLALCHEMY_DATABASE_URL = "sqlite:///...
ddicko/deploy_fastapi
sql_app/database.py
database.py
py
775
python
en
code
0
github-code
36
[ { "api_name": "cloudinary.config", "line_number": 8, "usage_type": "call" }, { "api_name": "sqlalchemy.create_engine", "line_number": 17, "usage_type": "call" }, { "api_name": "sqlalchemy.orm.sessionmaker", "line_number": 20, "usage_type": "call" }, { "api_name": ...
28985781241
from collections import Counter from typing import Generator, Iterable, Literal, Set import click import trimesh.creation from aoc_2022_kws.cli import main from aoc_2022_kws.config import config from trimesh import transformations class Facet: def __init__( self, axis: Literal["x", "y", "z"], x: int, y: ...
SocialFinanceDigitalLabs/AdventOfCode
solutions/2022/kws/aoc_2022_kws/day_18.py
day_18.py
py
5,002
python
en
code
2
github-code
36
[ { "api_name": "typing.Literal", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.Generator", "line_number": 50, "usage_type": "name" }, { "api_name": "trimesh.transformations.translation_matrix", "line_number": 60, "usage_type": "call" }, { "api_na...
38285078798
from setuptools import find_packages, setup with open("README.txt") as f: readme = f.read() + "\n" with open("CHANGES.txt") as f: readme += f.read() + "\n" with open("HACKING.txt") as f: readme += f.read() setup( name="fc.qemu", version="1.4.1.dev0", author="Christian Kauhaus, Christian Theune...
flyingcircusio/fc.qemu
setup.py
setup.py
py
1,233
python
en
code
4
github-code
36
[ { "api_name": "setuptools.setup", "line_number": 10, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 18, "usage_type": "call" } ]
70853975785
# -*- coding: utf-8 -*- from __future__ import print_function from nltk.stem.porter import PorterStemmer from textblob import TextBlob from wordcloud import WordCloud import nltk import json import matplotlib.pyplot as plt import os import string from textblob.sentiments import NaiveBayesAnalyzer ps = Po...
dhanashriOstwal/electionSentimentAnalysis
Python Scripts/sentimentAnalysis.py
sentimentAnalysis.py
py
3,158
python
en
code
0
github-code
36
[ { "api_name": "nltk.stem.porter.PorterStemmer", "line_number": 14, "usage_type": "call" }, { "api_name": "json.load", "line_number": 31, "usage_type": "call" }, { "api_name": "string.punctuation", "line_number": 38, "usage_type": "attribute" }, { "api_name": "stri...
29450013209
from ..models import Comment from ..serializers import CommentSerializer from rest_framework.response import Response from rest_framework import permissions, generics from rest_framework.authtoken.models import Token from rest_framework.status import HTTP_403_FORBIDDEN class CommentDetail(generics.RetrieveUpdateDestr...
thunderlink/ThunderFish
backend/server/views/comment.py
comment.py
py
1,520
python
en
code
3
github-code
36
[ { "api_name": "rest_framework.generics.RetrieveUpdateDestroyAPIView", "line_number": 9, "usage_type": "attribute" }, { "api_name": "rest_framework.generics", "line_number": 9, "usage_type": "name" }, { "api_name": "rest_framework.permissions.IsAuthenticatedOrReadOnly", "line_...
2911463134
import torch.nn as nn import torch.nn.functional as F class NeuralNet(nn.Module): def __init__(self): super(NeuralNet, self).__init__() self.conv1 = nn.Conv2d(1, 3, kernel_size=(3, 3), stride=1, padding=0) self.conv2 = nn.Conv2d(3, 6, kernel_size=(4, 4), stride=1, padding=0) sel...
arunsanknar/AlectioExamples
image_classification/fashion-mnist-and-mnist/model.py
model.py
py
870
python
en
code
0
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 5, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.nn", "line_numbe...
12152753848
import numpy as np import plotly import plotly.graph_objects as go def normalize_cam_points(P,x,N): """ Normalize the camera matrices and the image points with normalization matrices N. :param P: ndarray of shape [n_cam, 3, 4], the cameras :param x: ndarray of shape [n_cam, 3, n_points], the projected...
antebi-itai/Weizmann
Multiple View Geometry/Assignment 5/Solution/code/utils.py
utils.py
py
4,188
python
en
code
0
github-code
36
[ { "api_name": "numpy.linalg.norm", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.linalg", "line_number": 34, "usage_type": "attribute" }, { "api_name": "numpy.where", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.nan", "line...
22355103302
# coding: utf-8 import os import random import time import cv2 import numpy as np import torch from torch import nn, optim from tqdm import tqdm import matplotlib.pyplot as plt import modules class Classifier: chinese_characters = ['云', '京', '冀', '吉', '宁', '川', '新', '晋', '桂', '沪', '津',...
QQQQQby/Car-Plate-Recognition
classifier.py
classifier.py
py
6,613
python
en
code
1
github-code
36
[ { "api_name": "torch.cuda.is_available", "line_number": 27, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 27, "usage_type": "attribute" }, { "api_name": "torch.set_default_tensor_type", "line_number": 28, "usage_type": "call" }, { "api_name": ...
15980397887
"""Check for usage of models that were replaced in 2.0.""" from pylint.checkers import BaseChecker from pylint.interfaces import IAstroidChecker class NautobotReplacedModelsImportChecker(BaseChecker): """Visit 'import from' statements to find usage of models that have been replaced in 2.0.""" __implements__ ...
nautobot/pylint-nautobot
pylint_nautobot/replaced_models.py
replaced_models.py
py
3,231
python
en
code
4
github-code
36
[ { "api_name": "pylint.checkers.BaseChecker", "line_number": 6, "usage_type": "name" }, { "api_name": "pylint.interfaces.IAstroidChecker", "line_number": 9, "usage_type": "name" } ]
26034310554
#!/usr/bin/env python # coding: utf-8 # In[1]: import pandas as pd # In[2]: commercial = pd.read_csv('./commercial.csv') commercial # In[3]: # 끝에 5개 데이터만 추출 commercial.tail(5) # In[5]: list(commercial), len(list(commercial)) # In[7]: commercial.groupby('상가업소번호')['상권업종소분류명'].count().sort_values(ascend...
dleorud111/chicken_data_geo_graph
치킨 매장 수에 따른 지도 그리기.py
치킨 매장 수에 따른 지도 그리기.py
py
2,238
python
ko
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 98, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 98, "usage_type": "name" }, { "api_name": "mat...
27823324545
import requests from bs4 import BeautifulSoup import zlib #crc32加密 list_cyc32=[] list_url=[] import re # # 为了用xpath user_agent = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 SE 2.X MetaSr 1.0' headers = {'User-Agent': user_agent} # url="https://www.cn...
Madlife1/pythonProject2
url_spider.py
url_spider.py
py
1,896
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 15, "usage_type": "call" }, { "api_name": "zlib.crc32", "line_number": 18, "usage_type": "call" }, { "api_name": "requests.get", "line_nu...
14551208863
from fractions import Fraction from hypothesis import given from jubeatools import song from jubeatools.formats.timemap import TimeMap from jubeatools.testutils import strategies as jbst from jubeatools.utils import group_by @given(jbst.timing_info(with_bpm_changes=True), jbst.beat_time()) def test_that_seconds_at_...
Stepland/jubeatools
jubeatools/formats/konami/eve/tests/test_timemap.py
test_timemap.py
py
1,881
python
en
code
4
github-code
36
[ { "api_name": "jubeatools.song.Timing", "line_number": 13, "usage_type": "attribute" }, { "api_name": "jubeatools.song", "line_number": 13, "usage_type": "name" }, { "api_name": "jubeatools.song.BeatsTime", "line_number": 13, "usage_type": "attribute" }, { "api_na...
12336375941
#!/usr/bin/python3 """ Defines requests for the drivers route """ from api.v1.views import app_views from flask import jsonify, request, make_response from functools import wraps from hashlib import md5 from models import storage from models.users import User import datetime import jwt SECRET_KEY = 'thisissecret' de...
NamasakaLennox/Msimu
backend/api/v1/auth.py
auth.py
py
2,555
python
en
code
0
github-code
36
[ { "api_name": "flask.request.headers", "line_number": 25, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 25, "usage_type": "name" }, { "api_name": "flask.request.headers", "line_number": 26, "usage_type": "attribute" }, { "api_name": "f...
29524986199
import os import tempfile import time import unittest from Tools import ValkyrieTools class TestTools(unittest.TestCase): def test_isFloat(self): self.assertTrue(ValkyrieTools.isFloat('1.0')) self.assertFalse(ValkyrieTools.isFloat(1)) def test_isInteger(self): self.assertTrue(ValkyrieT...
ValkyFischer/ValkyrieUtils
unittests/test_tools.py
test_tools.py
py
7,154
python
en
code
0
github-code
36
[ { "api_name": "unittest.TestCase", "line_number": 7, "usage_type": "attribute" }, { "api_name": "Tools.ValkyrieTools.isFloat", "line_number": 9, "usage_type": "call" }, { "api_name": "Tools.ValkyrieTools", "line_number": 9, "usage_type": "name" }, { "api_name": "T...
31044290128
import torch from torch.autograd import Function import torch.nn as nn import torchvision import torchvision.transforms as transforms import time import numpy as np #Force Determinism torch.manual_seed(0) torch.backends.cudnn.deterministic = True torch.backends.cudnn.benchmark = False np.random.seed(0) # Device confi...
RyanKarl/SGX_NN_Training_and_Inference
examples/mnist/test_main.py
test_main.py
py
7,871
python
en
code
0
github-code
36
[ { "api_name": "torch.manual_seed", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.backends", "line_number": 11, "usage_type": "attribute" }, { "api_name": "torch.backends", "line_number": 12, "usage_type": "attribute" }, { "api_name": "numpy.rando...
25730149556
# -*- coding: utf-8 -*- from django.shortcuts import render import psycopg2 import psycopg2.extras import json from django.http import HttpResponse from django.http import HttpResponseServerError from django.http import HttpResponseBadRequest from .dicttoxml import DictToXML def index(request): # Try to connect ...
thomaskonrad/bev-reverse-geocoder
bev_reverse_geocoder_api/views.py
views.py
py
6,488
python
en
code
3
github-code
36
[ { "api_name": "psycopg2.connect", "line_number": 16, "usage_type": "call" }, { "api_name": "psycopg2.extras", "line_number": 20, "usage_type": "attribute" }, { "api_name": "django.http.HttpResponseServerError", "line_number": 32, "usage_type": "call" }, { "api_nam...
73200838504
# -*- coding: utf-8 -*- """ Created on Thu Jul 11 14:15:46 2019 @author: danie """ import geopandas as gpd import pandas as pd from shapely.geometry import LineString, Point import os import re import numpy as np import hkvsobekpy as his import csv #%% def __between(value, a, b): # Find and validate before-part....
d2hydro/sobek_kisters
sobek/read.py
read.py
py
20,927
python
en
code
0
github-code
36
[ { "api_name": "shapely.geometry.LineString", "line_number": 42, "usage_type": "call" }, { "api_name": "shapely.geometry.Point", "line_number": 48, "usage_type": "call" }, { "api_name": "shapely.geometry.Point", "line_number": 49, "usage_type": "call" }, { "api_nam...
24201086153
# 백준 - 유기농 배추 import sys, collections T = int(sys.stdin.readline()) tc = 0 def bfs(start, M, N): global visited dirs = ((-1,0), (1,0), (0,-1), (0,1)) # 상, 하, 좌, 우 queue = collections.deque() queue.append(start) while queue: i, j = queue.popleft() if visited[i][j]: co...
superyodi/burning-algorithm
bfs/boj_1012.py
boj_1012.py
py
1,095
python
en
code
1
github-code
36
[ { "api_name": "sys.stdin.readline", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 5, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.stdin.readline"...
20678800215
from __future__ import annotations from typing import List, Optional from sqlalchemy import BigInteger, Column, Integer, String from pie.database import database, session class Seeking(database.base): __tablename__ = "fun_seeking_seeking" idx = Column(Integer, primary_key=True, autoincrement=True) gui...
pumpkin-py/pumpkin-fun
seeking/database.py
database.py
py
2,317
python
en
code
0
github-code
36
[ { "api_name": "pie.database.database.base", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pie.database.database", "line_number": 10, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 13, "usage_type": "call" }, { "api_name"...
44258229341
import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' import tensorflow as tf import tensorflow.keras.backend as K # from keras.models import load_model from tensorflow.keras.models import load_model from os import listdir from os.path import isdir from PIL import Image import numpy as np from numpy import load from nump...
vgthengane/pytorch-cv-models
h4_face.py
h4_face.py
py
6,258
python
en
code
1
github-code
36
[ { "api_name": "os.environ", "line_number": 2, "usage_type": "attribute" }, { "api_name": "PIL.Image.open", "line_number": 31, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 31, "usage_type": "name" }, { "api_name": "numpy.asarray", "line_num...
7004766354
#!/usr/bin/python from bs4 import BeautifulSoup import requests import time import sys import urllib from itertools import chain import argparse url = "http://10.10.10.122/login.php" startUrl = "http://10.10.10.122/" proxyValues = {'http': 'http://127.0.0.1:8080'} SLEEP_VALUE = 3 lower_letters = range(97,123) upper_l...
nutty-guineapig/htb-pub
CTF/blindLDAPInjector.py
blindLDAPInjector.py
py
5,035
python
en
code
0
github-code
36
[ { "api_name": "urllib.parse.quote_plus", "line_number": 56, "usage_type": "call" }, { "api_name": "urllib.parse", "line_number": 56, "usage_type": "attribute" }, { "api_name": "requests.session", "line_number": 59, "usage_type": "call" }, { "api_name": "bs4.Beauti...
28890288771
"""Constructs related to type annotations.""" import dataclasses import logging import typing from typing import Mapping, Optional, Set, Tuple, Type, Union as _Union from pytype import datatypes from pytype.abstract import _base from pytype.abstract import _classes from pytype.abstract import _instance_base from pyty...
google/pytype
pytype/abstract/_typing.py
_typing.py
py
31,975
python
en
code
4,405
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "pytype.abstract._instance_base.SimpleValue", "line_number": 27, "usage_type": "attribute" }, { "api_name": "pytype.abstract._instance_base", "line_number": 27, "usage_type": "name...
71845863784
from django.http import HttpResponse from django.template import loader def index(request): template = loader.get_template('pages/page_index.html') context = {} return HttpResponse(template.render(context, request)) def page(request): template = loader.get_template('pages/page_display.html') con...
craig-glass/epic_django
pages/views.py
views.py
py
466
python
en
code
0
github-code
36
[ { "api_name": "django.template.loader.get_template", "line_number": 6, "usage_type": "call" }, { "api_name": "django.template.loader", "line_number": 6, "usage_type": "name" }, { "api_name": "django.http.HttpResponse", "line_number": 8, "usage_type": "call" }, { "...
20465270702
# -*- coding: utf-8 -*- # @Project : CrawlersTools # @Time : 2022/6/21 17:08 # @Author : MuggleK # @File : base_requests.py import json import random import re import time from chardet import detect from httpx import Client, Response from loguru import logger from CrawlersTools.requests.proxy import get_proxi...
MuggleK/CrawlersTools
CrawlersTools/requests/base_requests.py
base_requests.py
py
6,417
python
en
code
16
github-code
36
[ { "api_name": "CrawlersTools.requests.random_ua.UserAgent", "line_number": 36, "usage_type": "call" }, { "api_name": "CrawlersTools.requests.proxy.get_proxies", "line_number": 63, "usage_type": "call" }, { "api_name": "httpx.Client", "line_number": 64, "usage_type": "call...
27775098322
import matplotlib.pyplot as plt import numpy as np # Create some data to plot x = np.arange(5) y = [2, 5, 3, 8, 10] # Set the xticks with labels that include LaTeX and \n xticks = [r'Label 1', r'Label$_{2}\n$with superscript $x^2$', r'Label 3', r'Label$_{4}$', r'Label 5'] plt.plot(x, y) plt.xticks(x, xticks, rotation...
JinyangLi01/Query_refinement
Experiment/TPCH/running_time/try.py
try.py
py
406
python
en
code
0
github-code
36
[ { "api_name": "numpy.arange", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 10, "usage_type": "name" }, { "api_name": "matplotlib.pyplo...
36109925973
#!/usr/bin/env python3 #_main_.py import writer import getimage import argparse import os from time import sleep import gimmedahandler #import shit ##set up the parser parser = argparse.ArgumentParser( description= "A simple bot to place pixels from a picture to whatever you want \n Please note to write files with t...
a-usr/pixelbot
_main_.py
_main_.py
py
3,718
python
en
code
1
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 32, "usage_type": "call" }, { "api_name": "getimage.imageprompt", "line_number": 41, "usage_type": "call" }, { "api_name": "gimmedahandle...
536521380
import os import cv2 import numpy as np import skimage.exposure as sk_exposure import matplotlib.pyplot as plt from skimage.io import imshow, imread from skimage.color import rgb2hsv, hsv2rgb from skimage import color from scipy.ndimage.filters import maximum_filter from scipy.ndimage.morphology import generat...
LauraMarin/Tesis_2023
Unet_Nuclei_feature/Contour_seg.py
Contour_seg.py
py
4,106
python
en
code
0
github-code
36
[ { "api_name": "numpy.ones", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 14, "usage_type": "attribute" }, { "api_name": "numpy.ones", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number...
24426403241
#!/usr/bin/env python import sys import os from distutils.core import setup from distutils.command.install import install, write_file from distutils.command.install_egg_info import to_filename, safe_name from functools import reduce class new_install(install): def initialize_options(self): install.initial...
jwagner/playitslowly
setup.py
setup.py
py
2,789
python
en
code
96
github-code
36
[ { "api_name": "distutils.command.install.install", "line_number": 10, "usage_type": "name" }, { "api_name": "distutils.command.install.install.initialize_options", "line_number": 12, "usage_type": "call" }, { "api_name": "distutils.command.install.install", "line_number": 12,...
13957012079
import tensorflow as tf import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np from numpy.random import random_integers import os import pandas as pd from math import floor # Matplotlib fig params mpl.rcParams['figure.figsize'] = (8, 6) mpl.rcParams['axes.grid'] = False # Enable eager for easy t...
ptallo/financial-forecasting-api
models/univarmodel.py
univarmodel.py
py
7,529
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.rcParams", "line_number": 12, "usage_type": "attribute" }, { "api_name": "matplotlib.rcParams", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number": 20, "usage_type": "call" }, { "api_name": "num...
9156690869
import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import numpy as np import random from matplotlib.animation import FuncAnimation from mpl_toolkits.mplot3d.art3d import Poly3DCollection def randomwalk3D(n, angle_degrees, escape_radius=100): x, y, z = np.zeros(n), np.zeros(n), np.zeros...
shafransky93/PsudoSunSimulator
randwalk.py
randwalk.py
py
6,660
python
en
code
0
github-code
36
[ { "api_name": "numpy.zeros", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.radians", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": ...
11545489040
from logging import INFO, getLogger, StreamHandler, Formatter, DEBUG, INFO from os import environ from urlparse import urlparse from gunicorn.glogging import Logger from log4mongo.handlers import MongoHandler, MongoFormatter # parse the MONGOLAB_URI environment variable to get the auth/db info MONGOLAB_URI_PARSED =...
mapio/heroku-log4mongo
heroku-log4mongo/logger.py
logger.py
py
2,096
python
en
code
5
github-code
36
[ { "api_name": "urlparse.urlparse", "line_number": 11, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 11, "usage_type": "name" }, { "api_name": "os.environ", "line_number": 22, "usage_type": "name" }, { "api_name": "logging.getLogger", "line...
11168036307
#!python3 """ Construct a mouseoverable SVG of three-party-preferred outcomes. We'll call the three parties "blue" (x-axis), "green" (y-axis) and "red" (with R + G + B == 1). The primary methods that you'll want to call are `get_args` and `construct_svg`. """ from typing import Tuple import sys import math from en...
alexjago/3pp-visualiser
visualise_cpv.py
visualise_cpv.py
py
22,052
python
en
code
0
github-code
36
[ { "api_name": "enum.Enum", "line_number": 36, "usage_type": "name" }, { "api_name": "argparse.Namespace", "line_number": 46, "usage_type": "attribute" }, { "api_name": "typing.Tuple", "line_number": 46, "usage_type": "name" }, { "api_name": "argparse.Namespace", ...