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
20543243144
import jax import numpy as np from jax import lax from jax import numpy as jnp def gaussian(x, sigma): return 1 / (sigma * np.sqrt(2 * np.pi)) * np.exp(x**2 / (-2 * sigma**2)) def make_gaussian_kernel(n, sigma, dx=0.001): assert n % 2 == 1 # Make sure n is odd # Compute gaussian on a symmetric grid ...
cshallue/recon-cnn
recon/smoothing.py
smoothing.py
py
2,316
python
en
code
1
github-code
36
[ { "api_name": "numpy.sqrt", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 8, "usage_type": "attribute" }, { "api_name": "numpy.exp", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 15,...
32933105911
import numpy as np from PIL import Image rainbow = np.zeros((521,512,3),'uint8') for i in range(0,256): rainbow[:,i,0] = 255-i rainbow[:,i,1] = 0+i for i in range(256,512): rainbow[:,i,1] = 255-i rainbow[:,i,2] = 0+i image = Image.fromarray(rainbow) image.save('rainbow.jpg')
hieumewmew/MultimediaCommunicationExam
bai5/rainbow.py
rainbow.py
py
299
python
en
code
0
github-code
36
[ { "api_name": "numpy.zeros", "line_number": 4, "usage_type": "call" }, { "api_name": "PIL.Image.fromarray", "line_number": 13, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 13, "usage_type": "name" } ]
14102761586
import platform import yaml import pkg_resources import re import logging log = logging.getLogger(__name__) def convert_conda_yaml_to_requirement(conda_array) : ''' Convert the conda.yaml syntax to requirements.txt syntax : for now : - select "dependencies" key - transform = into == ...
nasa/ML-airport-data-services
data_services/conda_environment_test.py
conda_environment_test.py
py
3,612
python
en
code
3
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "re.match", "line_number": 25, "usage_type": "call" }, { "api_name": "re.match", "line_number": 35, "usage_type": "call" }, { "api_name": "re.match", "line_number": 49, ...
25417748938
#!/usr/bin/env python import soundfile as sf import math class LoopableSample(): def __init__(self): self.data = [] def addBuffer(self, buffer): for d in buffer: self.data.append(d) def fromFile(self, file): print("loading %s" % file) (data, ignore) = ...
andrewbooker/samplescaper
capture/LoopableSample.py
LoopableSample.py
py
1,055
python
en
code
2
github-code
36
[ { "api_name": "soundfile.read", "line_number": 16, "usage_type": "call" }, { "api_name": "math.floor", "line_number": 25, "usage_type": "call" }, { "api_name": "math.floor", "line_number": 26, "usage_type": "call" }, { "api_name": "soundfile.write", "line_numb...
26175621630
from distutils.core import setup, Extension from Cython.Build import cythonize include_dirs_list = [ "../include", "../Thirdparty/libccd/src", #libccd "../Thirdparty/libccd/build/src", #libccd "../Thirdparty/yaml-cpp/include", # yaml-cpp...
hfutcgncas/mpl_cpp
cython/setup.py
setup.py
py
1,152
python
en
code
1
github-code
36
[ { "api_name": "distutils.core.setup", "line_number": 21, "usage_type": "call" }, { "api_name": "Cython.Build.cythonize", "line_number": 21, "usage_type": "call" }, { "api_name": "distutils.core.Extension", "line_number": 21, "usage_type": "call" } ]
17498728037
import os.path import pandas import numpy as np def opt_report(reportPath, snrTh=0.9, debug=False, plotError=True): df = pandas.read_csv(reportPath) totalNbLoop = list(df["nbLoop"])[-1] # print(totalNbLoop) loopList = [] rmseList = [] avgErrorList = [] for loop_ in range(totalNbLoop + 1):...
SaifAati/Geospatial-COSICorr3D
geoCosiCorr3D/geoTiePoints/misc.py
misc.py
py
4,538
python
en
code
37
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.nanmean", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.nanmean", "line_...
26613373403
from sklearn.linear_model import LogisticRegression import pandas as pd import numpy as np from sklearn.metrics import accuracy_score from sklearn.metrics import confusion_matrix, classification_report import seaborn as sn import matplotlib.pyplot as plt data = pd.read_csv('./Data/wine.csv') data = data.sample(frac=1,...
larocaroja/Advanced-Programming
Logistic Regression.py
Logistic Regression.py
py
2,652
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LogisticRegression", "line_number": 24, "usage_type": "call" }, { "api_name": "sklearn.metrics.confusion_matrix", "line_number": 28, "usage_type": "call" }, ...
26740758351
#!/usr/bin/env python import glob, os, sys, subprocess, shutil, string, argparse parser = argparse.ArgumentParser(description="Wrapper script for MakePlots_HTopMultilep.py. This gets called on the PBS worker node via the PBS script generated by submit-PBS-ARRAY-MakePlots_HTopMultilep.py. The variable to be plotted ge...
mmilesi/HTopMultilepAnalysis
PlotUtils/Scripts/wrapper-MakePlots_HTopMultilep-PBS.py
wrapper-MakePlots_HTopMultilep-PBS.py
py
2,258
python
en
code
0
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 5, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 22, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path.abspath", "line...
74352481703
# -*- coding: utf-8 -*- """ ------------------------------------------------------------------------------- GUFY - Copyright (c) 2019, Fabian Balzer Distributed under the terms of the GNU General Public License v3.0. The full license is in the file LICENSE.txt, distributed with this software. ----------------...
Fabian-Balzer/GUFY
GUFY/simgui_modules/threading.py
threading.py
py
12,049
python
en
code
0
github-code
36
[ { "api_name": "PyQt5.QtWidgets.QDialog", "line_number": 33, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidgets", "line_number": 33, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 42, "usage_type": "call" }, { "api_name": "...
6951210977
import argparse from algorithms.utils import timedcall @timedcall def count_inversions(array): _, inversions = _count_inversions(array) return inversions def _count_inversions(array): if len(array) < 2: return array, 0 mid = len(array) // 2 left, left_inversions = _count_inversions(arra...
dfridman1/algorithms-coursera
algorithms/divide_and_conquer/week2/inversions.py
inversions.py
py
1,642
python
en
code
0
github-code
36
[ { "api_name": "algorithms.utils.timedcall", "line_number": 6, "usage_type": "name" }, { "api_name": "algorithms.utils.timedcall", "line_number": 42, "usage_type": "name" }, { "api_name": "argparse.ArgumentParser", "line_number": 58, "usage_type": "call" } ]
38817077412
import requests import random from dotenv import load_dotenv from PIL import ImageTk, Image from io import BytesIO import tkinter as tk import os class FetchAPI(): query: str quantity: int img_width: int img_height: int load_dotenv() api_key = os.getenv('PEX...
yethuhlaing/Car-Rental
src/fetchAPI.py
fetchAPI.py
py
2,071
python
en
code
0
github-code
36
[ { "api_name": "dotenv.load_dotenv", "line_number": 13, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 14, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 34, "usage_type": "call" }, { "api_name": "requests.get", "line_...
10495557667
from dateutil import rrule import datetime # 算两个时间的月数 def months_calculte(begin,end): begin += '-01' end += '-01' d1 = datetime.datetime.strptime(begin,'%Y-%m-%d') d2 = datetime.datetime.strptime(end,'%Y-%m-%d') # d2 = datetime.date(2017, 4) months = rrule.rrule(rrule.MONTHLY, dtstart=d1, until=...
rantengfei/python-utility
compute_time.py
compute_time.py
py
3,098
python
en
code
0
github-code
36
[ { "api_name": "datetime.datetime.strptime", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 7, "usage_type": "attribute" }, { "api_name": "datetime.datetime.strptime", "line_number": 8, "usage_type": "call" }, { "api_nam...
42910133147
from pymongo import MongoClient import time client = MongoClient('localhost', 27017) db = client['sahamyab'] series_collection = db['tweets'] start_time = time.time() series_collection.update_many( {'hashtags':{'$in': ['فولاد', 'شستا', 'شبندر'] }}, {'$set':{'gov': True }}) end_time = tim...
masoudrahimi39/Big-Data-Hands-On-Projects
NoSQL Databases (Cassandra, MongoDB, Neo4j, Elasticsearch)/MongoDB/1000 twiits/game3_2.py
game3_2.py
py
397
python
en
code
0
github-code
36
[ { "api_name": "pymongo.MongoClient", "line_number": 4, "usage_type": "call" }, { "api_name": "time.time", "line_number": 8, "usage_type": "call" }, { "api_name": "time.time", "line_number": 13, "usage_type": "call" } ]
16810461794
import json from django.contrib import messages from django.contrib.auth import authenticate, login from django.contrib.auth.decorators import login_required from django.core import serializers from django.core.files.uploadhandler import FileUploadHandler from django.core.urlresolvers import reverse from django.http im...
SeanKapus/Fashion
outfit/views.py
views.py
py
3,292
python
en
code
0
github-code
36
[ { "api_name": "outfit.forms.UserForm", "line_number": 18, "usage_type": "call" }, { "api_name": "django.contrib.messages.info", "line_number": 22, "usage_type": "call" }, { "api_name": "django.contrib.messages", "line_number": 22, "usage_type": "name" }, { "api_na...
7813076216
from datetime import datetime from typing import Dict, List import pytest import sqlalchemy as sa from httpx import AsyncClient from sqlalchemy.ext.asyncio import AsyncSession from aspen.api.views.tests.data.auth0_mock_responses import DEFAULT_AUTH0_USER from aspen.auth.auth0_management import Auth0Client from aspen....
chanzuckerberg/czgenepi
src/backend/aspen/api/views/tests/test_users.py
test_users.py
py
3,879
python
en
code
11
github-code
36
[ { "api_name": "pytest.mark", "line_number": 15, "usage_type": "attribute" }, { "api_name": "httpx.AsyncClient", "line_number": 18, "usage_type": "name" }, { "api_name": "sqlalchemy.ext.asyncio.AsyncSession", "line_number": 18, "usage_type": "name" }, { "api_name":...
14248952393
from collections import deque #올바른 괄호열인지 판단 하는 함수 def isCorrect(p): lst = [] #문자열의 문자를 하나하나 담을 lst for i in range(len(p)): if p[i] == '(': # 만약 열린 괄호이면 리스트에 넣는다. lst.append(p[i]) elif p[i] == ')': # 만약 닫힌 괄호라면 if len(lst) == 0: # 닫힌 괄호인데 lst가 빈 상태라면 retur...
vmfaldwntjd/Algorithm
Programmers/DFS,BFS/괄호 변환/Programmers.py
Programmers.py
py
2,869
python
ko
code
0
github-code
36
[ { "api_name": "collections.deque", "line_number": 24, "usage_type": "call" } ]
17567691479
from inpladesys.datatypes import Segment, Segmentation from typing import List import numpy as np from inpladesys.datatypes.dataset import Dataset from collections import Counter from sklearn.model_selection import train_test_split import time import scipy.stats as st def generate_segmentation(preprocessed_documents: ...
Coolcumber/inpladesys
software/inpladesys/models/misc/misc.py
misc.py
py
5,944
python
en
code
3
github-code
36
[ { "api_name": "typing.List", "line_number": 10, "usage_type": "name" }, { "api_name": "numpy.ndarray", "line_number": 10, "usage_type": "attribute" }, { "api_name": "inpladesys.datatypes.Segment", "line_number": 22, "usage_type": "call" }, { "api_name": "inpladesy...
18316576813
import functools import inspect import types from typing import Dict, List, Optional, Type, Union import pytest import servo.utilities.inspect class OneClass: def one(self) -> None: ... def two(self) -> None: ... def three(self) -> None: ... class TwoClass(OneClass): def ...
opsani/servox
tests/utilities/inspect_test.py
inspect_test.py
py
9,377
python
en
code
6
github-code
36
[ { "api_name": "servo.utilities.inspect.utilities.inspect.get_instance_methods", "line_number": 46, "usage_type": "call" }, { "api_name": "servo.utilities.inspect.utilities", "line_number": 46, "usage_type": "attribute" }, { "api_name": "servo.utilities.inspect", "line_number"...
34222159351
from django.shortcuts import render, redirect from .models import Aricle from .forms import ArticleForm def new(request): if request.method == 'POST': article_form = ArticleForm(request.POST) if article_form.is_valid(): article = article_form.save() return redirect('blog:de...
kimhyunso/exampleCode
django/MTV/blog/new_views.py
new_views.py
py
542
python
en
code
0
github-code
36
[ { "api_name": "forms.ArticleForm", "line_number": 8, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "line_number": 11, "usage_type": "call" }, { "api_name": "forms.ArticleForm", "line_number": 13, "usage_type": "call" }, { "api_name": "django.s...
9766193824
import sys import librosa import numpy as np #import soundfile as sf import functools import torch #from torch.nn.functional import cosine_similarity #import essentia.standard as es def logme(f): @functools.wraps(f) def wrapped(*args, **kwargs): print('\n-----------------\n') print(' MODEL: ...
andrebola/contrastive-mir-learning
utils.py
utils.py
py
7,635
python
en
code
13
github-code
36
[ { "api_name": "functools.wraps", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.stdout.write", "line_number": 55, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 55, "usage_type": "attribute" }, { "api_name": "sys.stdout.flush", ...
23702793306
# This is just a sample program to show you how to do # basic image operations using python and the Pillow library. # # By Eriya Terada, based on earlier code by Stefan Lee, # lightly modified by David Crandall, 2020 # Import the Image and ImageFilter classes from PIL (Pillow) from PIL import Image, ImageFilter, I...
dhruvabhavsar/Optical-Music-Recognition
python-sample/omr.py
omr.py
py
13,907
python
en
code
0
github-code
36
[ { "api_name": "PIL.Image.open", "line_number": 17, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 17, "usage_type": "name" }, { "api_name": "PIL.Image.new", "line_number": 24, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number":...
31553967278
from nltk.tokenize import word_tokenize from nltk.corpus import stopwords from nltk.stem import PorterStemmer import json import string import re ps = PorterStemmer() punctuation = list(string.punctuation) stop = stopwords.words('english') + punctuation + ['rt', '#rt', '#follow', 'via', 'donald', 'trump', '…', "trump...
henrydambanemuya/socialsensing
ConflictSensingApp/TextNormalizer.py
TextNormalizer.py
py
1,705
python
en
code
0
github-code
36
[ { "api_name": "nltk.stem.PorterStemmer", "line_number": 8, "usage_type": "call" }, { "api_name": "string.punctuation", "line_number": 10, "usage_type": "attribute" }, { "api_name": "nltk.corpus.stopwords.words", "line_number": 11, "usage_type": "call" }, { "api_na...
19041324588
# Author: Trevor Sherrard # Since: Feb. 21, 2022 # Purpose: This file contains functionallity needed to run inference on a single image import cv2 import numpy as np import tensorflow as tf import keras # declare file paths model_file_loc = "../../models/saved_unet_model.h5" test_image_loc = "../../dataset/semantic_d...
Post-Obstruction-Assessment-Capstone/Drone-Road-Segmentation
utils/deep_learning/single_image_inference.py
single_image_inference.py
py
1,599
python
en
code
0
github-code
36
[ { "api_name": "cv2.imread", "line_number": 21, "usage_type": "call" }, { "api_name": "cv2.IMREAD_COLOR", "line_number": 21, "usage_type": "attribute" }, { "api_name": "cv2.resize", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.float32", "line...
20510556949
from __future__ import print_function import numpy as np import ad3.factor_graph as fg import time def test_random_instance(n): costs = np.random.rand(n) budget = np.sum(costs) * np.random.rand() scores = np.random.randn(n) tic = time.clock() x = solve_lp_knapsack_ad3(scores, costs, budget) t...
andre-martins/AD3
examples/python/example_knapsack.py
example_knapsack.py
py
2,835
python
en
code
68
github-code
36
[ { "api_name": "numpy.random.rand", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 8, "usage_type": "attribute" }, { "api_name": "numpy.sum", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.random.rand", "l...
20436716291
# pxy7896@foxmail.com # 2020/8/1 __doc__ = """ 获取中公教育每日一练内容;获取国务院政府工作报告。 """ import requests from bs4 import BeautifulSoup import os # 服务器反爬虫机制会判断客户端请求头中的User-Agent是否来源于真实浏览器,所以,我们使用Requests经常会指定UA伪装成浏览器发起请求 headers = {'user-agent': 'Mozilla/5.0'} # 写文件 def writedoc(raw_ss, i, ii): # 打开文件 ...
pxy7896/PlayWithPython3
获取某网站每日一练.py
获取某网站每日一练.py
py
4,447
python
zh
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 31, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 34, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 55, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "...
8385928022
from django.db.models import Model, Q, OuterRef, Max, Count from django.conf import settings from django.core import mail from django.http import HttpResponse from django.template import Context, Template, loader from django.utils.translation import gettext_lazy as _ from django.contrib import admin import os, glob fro...
johncronan/formative
formative/utils.py
utils.py
py
9,508
python
en
code
4
github-code
36
[ { "api_name": "models.Site.objects.get_current", "line_number": 18, "usage_type": "call" }, { "api_name": "models.Site.objects", "line_number": 18, "usage_type": "attribute" }, { "api_name": "models.Site", "line_number": 18, "usage_type": "name" }, { "api_name": "...
36750215907
from flask import (g, abort, get_flashed_messages, request, flash, redirect, url_for) from sqlalchemy.sql import functions from buddyup.app import app from buddyup.database import (Course, Visit, User, BuddyInvitation, Location, Major, Event, Language, db) from buddyup...
thangatran/Buddy-Up
buddyup/pages/admin.py
admin.py
py
5,477
python
en
code
0
github-code
36
[ { "api_name": "flask.g.user", "line_number": 17, "usage_type": "attribute" }, { "api_name": "flask.g", "line_number": 17, "usage_type": "name" }, { "api_name": "buddyup.app.app.config.get", "line_number": 17, "usage_type": "call" }, { "api_name": "buddyup.app.app....
23856814731
from collections import deque GENERATOR = 0 MICROCHIP = 1 floors = [[] for _ in range(4)] elev = 0 elems = dict() def is_safe(arrangement): floors, _ = arrangement for floor in floors: chips = set() hasg = False for e in floor: if e & 1 == MICROCHIP: chips....
mahiuchun/adventofcode-2016
day11/part2.py
part2.py
py
3,739
python
en
code
0
github-code
36
[ { "api_name": "collections.deque", "line_number": 96, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 97, "usage_type": "call" } ]
41703057518
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('portfolio', '0006_auto_20160109_0000'), ] operations = [ migrations.CreateModel( name='Blog', fields...
zachswift615/zachswift
portfolio/migrations/0007_blog.py
0007_blog.py
py
701
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" }, ...
10401144210
#!/usr/bin/env python """ Testtool om een lokale HTTP server te starten die verbinding maakt met dvs-daemon. Niet geschikt voor productie! Gebruik daar WSGI voor. """ import bottle import argparse import dvs_http_interface import logging # Initialiseer argparse parser = argparse.ArgumentParser(description='DVS HTTP ...
PaulWagener/rdt-infoplus-dvs
dvs-http.py
dvs-http.py
py
906
python
nl
code
null
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 14, "usage_type": "call" }, { "api_name": "dvs_http_interface.dvs_client_server", "line_number": 20, "usage_type": "attribute" }, { "api_name": "logging.basicConfig", "line_number": 23, "usage_type": "call" }, { ...
27511260267
# -*- coding: utf-8 -*- """ Created on Mo 12 Sept 2 13:15:51 2022 @author: FKAM """ import pandas as pd import streamlit as st import plotly.express as px import plotly.graph_objs as go #import altair as alt #from bokeh.plotting import figure def list_ext(uploads, radio3): list_ = [] header_default = ["date...
KempiG/Master
PVD_funcs.py
PVD_funcs.py
py
11,030
python
en
code
0
github-code
36
[ { "api_name": "pandas.DataFrame", "line_number": 49, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 68, "usage_type": "call" }, { "api_name": "pandas.concat", "line_number": 83, "usage_type": "call" }, { "api_name": "pandas.concat", "l...
74436148265
# osandvold # 5 Jul 2022 # Adapted script from checkData_UPENN.m script from Heiner (Philips) # for validating and reading log data from DMS of CT Benchtop import numpy as np import pandas as pd import glob import os.path import matplotlib.pyplot as plt from matplotlib.pyplot import figure from matplotlib.widgets impo...
chan-andrew/LACTI
check_data.py
check_data.py
py
14,721
python
en
code
0
github-code
36
[ { "api_name": "numpy.fromfile", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.floor", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.arange", "line_numbe...
7111352063
import urllib import urllib2 from django import template from django.conf import settings from django.template.defaultfilters import truncatewords from django.utils.html import strip_tags from django.utils.safestring import mark_safe from utils.acm_auth import get_ip register = template.Library() def fix_trunc(te...
mnadifi/cie
source/apps/articles/templatetags.py
templatetags.py
py
2,209
python
en
code
0
github-code
36
[ { "api_name": "django.template.Library", "line_number": 13, "usage_type": "call" }, { "api_name": "django.template", "line_number": 13, "usage_type": "name" }, { "api_name": "urllib.urlencode", "line_number": 46, "usage_type": "call" }, { "api_name": "django.conf....
17013425141
import datetime from lambda_function import handler from components import line_bot_api from utils import utils_database from linebot.models import ( JoinEvent, MemberJoinedEvent, MemberLeftEvent, TextSendMessage ) @handler.add(JoinEvent) def handle_join(event): group_id = event.source.group_id ...
jialiang8931/WRA06-Volunteer-LineBot
src/components/handler_event_group.py
handler_event_group.py
py
2,658
python
en
code
0
github-code
36
[ { "api_name": "components.line_bot_api.get_group_summary", "line_number": 17, "usage_type": "call" }, { "api_name": "components.line_bot_api", "line_number": 17, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 21, "usage_type": "call" }, ...
73387258343
from datetime import datetime from __init__ import db from flask_login import UserMixin from sqlalchemy.sql import func class OrganizerEvent(db.Model): id = db.Column(db.Integer, primary_key=True) organizer_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False) event_id = db.Column(db.Integ...
ntoghrul/Evento
models.py
models.py
py
1,496
python
en
code
0
github-code
36
[ { "api_name": "__init__.db.Model", "line_number": 8, "usage_type": "attribute" }, { "api_name": "__init__.db", "line_number": 8, "usage_type": "name" }, { "api_name": "__init__.db.Column", "line_number": 9, "usage_type": "call" }, { "api_name": "__init__.db", ...
26703340293
import speech_recognition as sr import wave import sys import os import uuid pcmfn = sys.argv[1] wavefn = os.path.join(str(uuid.uuid4().hex)) with open(pcmfn, 'rb') as pcm: pcmdata = pcm.read() with wave.open(wavefn, 'wb') as wavfile: #convert pcm to wav wavfile.setparams((2, 2, 48000, 0, 'NONE', 'NONE')) ...
nfsmith/DiscordStenographer
transcribePCM.py
transcribePCM.py
py
586
python
en
code
0
github-code
36
[ { "api_name": "sys.argv", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "uuid.uuid4", "line_number": ...
28482960968
import pandas as pd import numpy as np import os, sys import warnings import matplotlib.pyplot as plt import gmplot from sklearn.cluster import DBSCAN import random import json def remove_invalid_coord(df): #[-90; 90] #return df.query('lat >= -90 & lat <= 90').query('lon >= -90 & lat <= 90') return df.query('lat !=...
lucaslzl/ponche
timewindow/lookdata.py
lookdata.py
py
5,789
python
en
code
0
github-code
36
[ { "api_name": "pandas.to_datetime", "line_number": 26, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 27, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 28, "usage_type": "call" }, { "api_name": "pandas.DataF...
22354796740
from django.shortcuts import render from remarcable_app.models import SearchHistory from remarcable_app.query_functions import ( delete_old_searches, pull_all_products, pull_all_tagged_products, pull_all_categories, pull_all_tags, products_to_array, search_products, tags_to_dictionary, ...
stephenv13/remarcableproject
remarcable_app/views.py
views.py
py
5,899
python
en
code
0
github-code
36
[ { "api_name": "remarcable_app.query_functions.pull_all_products", "line_number": 27, "usage_type": "call" }, { "api_name": "remarcable_app.query_functions.pull_all_tagged_products", "line_number": 28, "usage_type": "call" }, { "api_name": "remarcable_app.query_functions.pull_all_...
23063800044
from src.pipeline.predict_pipeline import camera from src.utils import emotion_average import spotipy from spotipy.oauth2 import SpotifyClientCredentials from src.utils import normalize from src.utils import string from src.exception import CustomException import sys import pandas as pd def recommender(emotion,preferen...
AnshulDubey1/Music-Recommendation
src/pipeline/song_predictor.py
song_predictor.py
py
2,474
python
en
code
5
github-code
36
[ { "api_name": "spotipy.Spotify", "line_number": 12, "usage_type": "call" }, { "api_name": "spotipy.oauth2.SpotifyClientCredentials", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 38, "usage_type": "call" }, { "api_name...
16411706948
import os import shutil import numpy as np import cv2 import random import copy from keras.models import Sequential from keras.layers.core import Dense, Flatten, Dropout import tensorflow as tf def qpixmap_to_array(qtpixmap): # qpixmap转换成array img = qtpixmap.toImage() temp_shape = (img.height(), img.byte...
zhangxinzhou/game_explorer
game01_dino/new_test/game_utils.py
game_utils.py
py
5,865
python
en
code
0
github-code
36
[ { "api_name": "numpy.array", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 20, "usage_type": "attribute" }, { "api_name": "cv2.cvtColor", "line_number": 28, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "l...
8444405928
import cupy import cupyx.scipy.fft from cupy import _core from cupy._core import _routines_math as _math from cupy._core import fusion from cupy.lib import stride_tricks import numpy _dot_kernel = _core.ReductionKernel( 'T x1, T x2', 'T y', 'x1 * x2', 'a + b', 'y = a', '0', 'dot_product'...
cupy/cupy
cupy/_math/misc.py
misc.py
py
16,182
python
en
code
7,341
github-code
36
[ { "api_name": "cupy._core.ReductionKernel", "line_number": 12, "usage_type": "call" }, { "api_name": "cupy._core", "line_number": 12, "usage_type": "name" }, { "api_name": "cupy.fft", "line_number": 89, "usage_type": "attribute" }, { "api_name": "cupy.fft", "l...
16968857057
#-*- coding: utf-8 -*- from __future__ import unicode_literals from operator import __or__ as OR from functools import reduce import six from django.conf import settings try: from django.utils.encoding import force_unicode as force_text except ImportError: from django.utils.encoding import force_text from dj...
infolabs/django-edw
backend/edw/admin/base_actions/update_terms.py
update_terms.py
py
3,011
python
en
code
6
github-code
36
[ { "api_name": "django.conf.settings", "line_number": 29, "usage_type": "argument" }, { "api_name": "edw.admin.entity.forms.EntitiesUpdateTermsAdminForm", "line_number": 34, "usage_type": "call" }, { "api_name": "django.utils.encoding.force_text", "line_number": 46, "usage...
19608346992
# PROBLEM: # Given an array A of non-negative integers, return an array # consisting of all the even elements of A, followed by all # the odd elements of A. # You may return any answer array that satisfies this condition. # EXAMPLE: # Input: [3,1,2,4] # Output: [2,4,3,1] # The outputs [4,2,3,1], [2,4,1,3], and [4,...
angiereyes99/coding-interview-practice
easy-problems/SortArrayByParity.py
SortArrayByParity.py
py
1,364
python
en
code
0
github-code
36
[ { "api_name": "typing.List", "line_number": 27, "usage_type": "name" } ]
6797262441
from utils.faker_factory import faker from ..mails import BaseMailView class OpportunityReminderCloseMailView(BaseMailView): """ """ template_name = 'mails/opportunity/opportunity_reminder_close.html' mandatory_mail_args = [ 'title', 'created_by_name', 'duedate_timedelta', ...
tomasgarzon/exo-services
service-exo-mail/mail/mailviews/opportunity_reminder_close.py
opportunity_reminder_close.py
py
850
python
en
code
0
github-code
36
[ { "api_name": "mails.BaseMailView", "line_number": 6, "usage_type": "name" }, { "api_name": "utils.faker_factory.faker.uri_path", "line_number": 29, "usage_type": "call" }, { "api_name": "utils.faker_factory.faker", "line_number": 29, "usage_type": "name" } ]
25462981448
import numpy as np import matplotlib.pyplot as plt from scipy.integrate import solve_ivp def system_of_odes(t, y): # Define the system of second-order ODEs # y is an array of shape (2n,), where n is the number of equations # Compute coefficients n = int(len(y) / 2) y1 = y[:n] # x,y y2 =...
mjanszen/Wind_turbine_aeroelasticity
src/dynamics_only_test.py
dynamics_only_test.py
py
1,287
python
en
code
0
github-code
36
[ { "api_name": "numpy.concatenate", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.concatenate", "line_number": 24, "usage_type": "call" }, { "api_name": "scipy.integrate.solve_ivp", "line_number": 30, "usage_type": "call" }, { "api_name": "matplot...
39303528940
#!usr/bin/env python # -*- coding:utf-8 -*- """ @author: admin @file: main.py @time: 2021/09/02 @desc: """ import time import torch from model import config from model.data_process import PrepareData from model.Transformer import make_model from model.LabelSmoothing import LabelSmoothing from model.opt import NoamOpt f...
coinyue/Transformer
main.py
main.py
py
1,629
python
en
code
0
github-code
36
[ { "api_name": "model.data_process.PrepareData", "line_number": 22, "usage_type": "call" }, { "api_name": "model.config.TRAIN_FILE", "line_number": 22, "usage_type": "attribute" }, { "api_name": "model.config", "line_number": 22, "usage_type": "name" }, { "api_name...
5547122437
#!/local/cluster/bin/python #biopython take three regions, invert middle, then put together import sys from Bio import SeqIO strain=sys.argv[1] #include 50 bp margin so as not to interrupt att site in rotated genome largestart=int(sys.argv[2]) + 50 largeend=int(sys.argv[3]) - 50 infile="../" + strain + ".gbk" outfile=...
osuchanglab/BradyrhizobiumGenomeArchitecture
remove_monopartite.py
remove_monopartite.py
py
547
python
en
code
0
github-code
36
[ { "api_name": "sys.argv", "line_number": 6, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 8, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "Bio.SeqIO.read", "line_num...
4419617010
""" Simple BBS 簡単な掲示板 要件: 1. ページ上部に大きくSimple BBSと書かれている 2. Username と Messageを入力するフォームがある 3. 送信と書かれたスイッチがある 4. 入力された文字が掲示板に表示されていく(下段に追加されていく) 5. Username に何も入力されていない状態で送信された場合は名無しさんにする 6. Message に何も入力されていない状態で送信された場合は空欄にする """ import os from flask import Flask, render_template, request app = Flask(__name__) @ap...
tetsuya-yamamoto-ai-learn/practice01-F
WebAP.py
WebAP.py
py
2,101
python
ja
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 18, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 24, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 24, "usage_type": "name" }, { "api_name": "os.path.isfile", ...
40017524881
from scipy.stats import zscore from datetime import datetime as dt import numpy as np import pandas as pd RAW_DIR = "raw/" RAW_TRAIN_PATH = RAW_DIR + "raw_train_data.csv" RAW_PREDICT_PATH = RAW_DIR + "raw_predict_data.csv" CYCLE_AMOUNT_PATH = RAW_DIR + "cycle_amount.csv" INPUT_DIR = "input/" TRAIN_DATA_PATH = INPUT_D...
ytorii/park-amount
wdnn/raw_to_input_csv.py
raw_to_input_csv.py
py
5,411
python
en
code
0
github-code
36
[ { "api_name": "pandas.DataFrame", "line_number": 27, "usage_type": "call" }, { "api_name": "pandas.Series", "line_number": 46, "usage_type": "call" }, { "api_name": "scipy.stats.zscore", "line_number": 65, "usage_type": "call" }, { "api_name": "datetime.datetime.s...
18082073278
#!/usr/bin/env python """ Neato control program to make a robot follow a line (like a roadway) and react to signs in its path. """ import rospy from geometry_msgs.msg import Twist, PoseWithCovariance, Pose, Point, Vector3 from sensor_msgs.msg import LaserScan, Image import math import numpy as np import cv2 from cv_...
lianilychee/project_caribou
scripts/caribou.py
caribou.py
py
6,666
python
en
code
1
github-code
36
[ { "api_name": "rospy.init_node", "line_number": 31, "usage_type": "call" }, { "api_name": "rospy.Publisher", "line_number": 32, "usage_type": "call" }, { "api_name": "geometry_msgs.msg.Twist", "line_number": 32, "usage_type": "argument" }, { "api_name": "geometry_...
38810777586
''' CAS schema's for the roads ''' __name__ = "CASSchema.py" __author__ = "COUTAND Bastien" __date__ = "07.12.22" from datetime import datetime from pydantic import BaseModel, Field class CASBase(BaseModel): ''' CAS Schema ''' cas_ip: str = Field( description='ip for the CAS...
coutand-bastien/Student-project
ENSIBS-4/eduroom/server/app-container/api/schemas/CASSchema.py
CASSchema.py
py
838
python
en
code
0
github-code
36
[ { "api_name": "pydantic.BaseModel", "line_number": 11, "usage_type": "name" }, { "api_name": "pydantic.Field", "line_number": 15, "usage_type": "call" }, { "api_name": "pydantic.Field", "line_number": 19, "usage_type": "call" }, { "api_name": "pydantic.Field", ...
4005677116
# -*- coding: utf-8 -*- """ Created on Thu Jul 5 16:06:36 2018 @author: jose.molina """ # -*- coding: utf-8 -*- """ Created on Thu Jul 5 15:39:40 2018 @author: jose.molina """ from bs4 import BeautifulSoup from selenium import webdriver import requests from xml.etree import ElementTree from time...
josemolinag/scraping
cosas.py
cosas.py
py
3,820
python
en
code
0
github-code
36
[ { "api_name": "pandas.DataFrame", "line_number": 31, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 34, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 34, "usage_type": "name" }, { "api_name": "bs4.Bea...
16732411603
from typing import List class Solution: def findReplaceString(self, s: str, indices: List[int], sources: List[str], targets: List[str]) -> str: for i, source, target in sorted(list(zip(indices, sources, targets)), reverse=True): l = len(source) if s[i:i + l] == source: ...
wLUOw/Leetcode
2023.08/833/Solution.py
Solution.py
py
372
python
en
code
0
github-code
36
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" } ]
17359757102
from typing import Optional, List import torch import uuid from torch import nn from supertransformerlib import Core class DefaultParameterLayer(nn.Module): """ A NTM extension layer designed to contain within it the default state for some sort of parameter and to be manipulatable to create, interpol...
smithblack-0/torch-supertransformerlib
src/supertransformerlib/NTM/defaults.py
defaults.py
py
5,642
python
en
code
0
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.nn.Parameter", "line_number": 19, "usage_type": "attribute" }, { "api_name": "torch.nn", "l...
27140115657
# -*- coding: utf-8 -*- ####################### # deploy.urls ####################### """ 1. 部署服务 2. add DNS 3. nginx设置 4. config check 5. 诊断 """ from django.urls import path from deploy import views urlpatterns = [ path('health/', views.health,name="health"), path('start/',views.deploy,name="deploy"...
yuzhenduan/envDeploy
deploy/urls.py
urls.py
py
691
python
en
code
0
github-code
36
[ { "api_name": "django.urls.path", "line_number": 16, "usage_type": "call" }, { "api_name": "deploy.views.health", "line_number": 16, "usage_type": "attribute" }, { "api_name": "deploy.views", "line_number": 16, "usage_type": "name" }, { "api_name": "django.urls.pa...
75312911145
import matplotlib.pyplot as plt from moisture_tracers import plotdir from moisture_tracers.plot.figures.fig2_satellite_comparison import make_plot def main(): start_time = "20200201" grid = "lagrangian_grid" resolutions = ["km1p1", "km2p2", "km4p4"] lead_times = [30, 36, 42, 48] make_plot(start_t...
leosaffin/moisture_tracers
moisture_tracers/plot/figures/fig4_satellite_comparison_lagrangian_grid.py
fig4_satellite_comparison_lagrangian_grid.py
py
560
python
en
code
0
github-code
36
[ { "api_name": "moisture_tracers.plot.figures.fig2_satellite_comparison.make_plot", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.savefig", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 13, "usage...
39694098177
from app.issue_detector import IssueDetector from app.support_detector import SupportDetector import pandas as pd from pathlib import Path import sys from pydantic import BaseModel, Field class SupportScoreCalculator(BaseModel): timestamp: str = Field() issue_detector: IssueDetector = Field(default=IssueDetec...
blocks-web3/empower-link
contribution-analyzer/app/support_score_calculator.py
support_score_calculator.py
py
3,688
python
en
code
0
github-code
36
[ { "api_name": "pydantic.BaseModel", "line_number": 9, "usage_type": "name" }, { "api_name": "pydantic.Field", "line_number": 10, "usage_type": "call" }, { "api_name": "app.issue_detector.IssueDetector", "line_number": 11, "usage_type": "name" }, { "api_name": "pyd...
31280891768
import boto3 import os import botocore import logging from agief_experiment import utils class Cloud: # EC2 instances will be launched into this subnet (in a vpc) subnet_id = 'subnet-0b1a206e' # For ECS, which cluster to use cluster = 'default' # When creating EC2 instances, the root ssh key t...
Cerenaut/run-framework
scripts/run-framework/agief_experiment/cloud.py
cloud.py
py
11,421
python
en
code
2
github-code
36
[ { "api_name": "agief_experiment.utils.run_bashscript_repeat", "line_number": 48, "usage_type": "call" }, { "api_name": "agief_experiment.utils", "line_number": 48, "usage_type": "name" }, { "api_name": "agief_experiment.utils.run_bashscript_repeat", "line_number": 63, "us...
2153986094
from django.shortcuts import render # Create your views here. def func(request, num1, num2): if num2 != 0: div = num1 / num2 else: div = '계산할 수 없습니다.' context = { 'num1' : num1, 'num2' : num2, 'sub' : num1 - num2, 'mul' : num1 * num2, 'div' : div ...
ji-hyon/Web_study
Django/practice/part2_Django/django_2_2/project2/calculators/views.py
views.py
py
406
python
en
code
0
github-code
36
[ { "api_name": "django.shortcuts.render", "line_number": 17, "usage_type": "call" } ]
71355007785
import dotenv import openai import os dotenv.load_dotenv('../.env') openai.api_key = os.environ["OPENAI_API_KEY"] response = openai.ChatCompletion.create( model="gpt-3.5-turbo", messages=[ {"role": "user", "content": "tell me about gpt for social good"} ] ) print(response["choices"][0]["message"]["...
aiformankind/gpt-for-social-good
gpt/demo.py
demo.py
py
330
python
en
code
0
github-code
36
[ { "api_name": "dotenv.load_dotenv", "line_number": 5, "usage_type": "call" }, { "api_name": "openai.api_key", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 6, "usage_type": "attribute" }, { "api_name": "openai.ChatComple...
31415174040
from pydantic import BaseModel import json import requests import Console import config HTTP_PREFIX = "http://" HOST = config.server_address + "/internal" class DownloadFileFromAgentInputType(BaseModel): ip_address: str file_path: str class ListFilesFromAgentInputType(BaseModel): ip_address: str di...
Kuba12a/CybClient
Gateways/CybServerGateway.py
CybServerGateway.py
py
3,708
python
en
code
0
github-code
36
[ { "api_name": "config.server_address", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pydantic.BaseModel", "line_number": 11, "usage_type": "name" }, { "api_name": "pydantic.BaseModel", "line_number": 16, "usage_type": "name" }, { "api_name": "pydan...
6415147937
# -*- coding: utf-8 -*- """ Created on Thu Apr 15 18:08:59 2021 @author: Chris """ #%% Imports from PIL import ImageGrab import win32gui import numpy as np import time import cv2 #%% Get the ID of the Emulator window # List to hold window information window = [] # Name of the window to find window_name = "Super St...
qchrisd/StreetFighterBot
ScreenGrabProof.py
ScreenGrabProof.py
py
2,115
python
en
code
0
github-code
36
[ { "api_name": "win32gui.IsWindowVisible", "line_number": 27, "usage_type": "call" }, { "api_name": "win32gui.GetWindowText", "line_number": 28, "usage_type": "call" }, { "api_name": "win32gui.GetWindowText", "line_number": 29, "usage_type": "call" }, { "api_name":...
20504076743
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # @Filename : kalao_pump_switch.sh # @Date : 2023-01-12-14-12 # @Project: KalAO-ICS # @AUTHOR : Janis Hagelberg """ kalao_pump_switch.py is part of the KalAO Instrument Control Software it is a maintenance script used to switch the water cooling pump from on to off and opp...
janis-hag/kalao-ics
scripts/kalao_pump_switch.py
kalao_pump_switch.py
py
907
python
en
code
0
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 17, "usage_type": "call" }, { "api_name": "kalao.plc.temperature_control.pump_on", "line_number": 27, "usage_type": "call" }, { "api_name": "kalao.plc.temperature_control", "line_number": 27, "usage_type": "name" }...
39671693100
import discord from discord.ext import commands import time import json import os if not os.path.isfile('config.json'): exit f = open('config.json') data = json.load(f) TOKEN = data['token'] servers = data['servers'] message = data['message'] delay = int(data['delay']) for i in range(len(servers)): servers...
skiteskopes/discord_channel_create_auto_messager
discord_bot.py
discord_bot.py
py
593
python
en
code
0
github-code
36
[ { "api_name": "os.path.isfile", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 11, "usage_type": "call" }, { "api_name": "discord.Client", "line_number...
39627512703
import sys import argparse from lettuce.bin import main as lettuce_main from lettuce import world from selenium.webdriver.common.desired_capabilities import DesiredCapabilities from salad.steps.everything import * from salad.terrains.everything import * BROWSER_CHOICES = [browser.lower() for browse...
salad/salad
salad/cli.py
cli.py
py
3,130
python
en
code
122
github-code
36
[ { "api_name": "selenium.webdriver.common.desired_capabilities.DesiredCapabilities.__dict__.keys", "line_number": 11, "usage_type": "call" }, { "api_name": "selenium.webdriver.common.desired_capabilities.DesiredCapabilities.__dict__", "line_number": 11, "usage_type": "attribute" }, { ...
23420924440
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('ventas', '0048_auto_20160928_0742'), ] operations = [ migrations.AlterField( model_name='comanda', n...
pmmrpy/SIGB
ventas/migrations/0049_auto_20160930_1114.py
0049_auto_20160930_1114.py
py
2,096
python
es
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.AlterField", "line_number": 14, "usage_type": "call" }, {...
70345443943
import numpy as np import math import torch import torch.nn as nn class Upper(nn.Module): # Upper: Mutual Information Contrastive Learning Upper Bound ''' This class provides the Upper bound estimation to I(X,Y) Method: forward() : provides the estimation with input samples ...
joey-wang123/Semi-meta
mi_estimators.py
mi_estimators.py
py
3,452
python
en
code
0
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.nn", "line_...
9587889867
import os import csv from decimal import Decimal from forex_python.bitcoin import BtcConverter from forex_python.converter import CurrencyRates from plugin import plugin, require FILE_PATH = os.path.abspath(os.path.dirname(__file__)) @require(network=True) @plugin('currencyconv') class Currencyconv(): """ Co...
sukeesh/Jarvis
jarviscli/plugins/currency_conv.py
currency_conv.py
py
2,657
python
en
code
2,765
github-code
36
[ { "api_name": "os.path.abspath", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 8, "usage_type": "call" }, { "api_name": "forex_python.bitcoin.BtcCon...
6035944019
import matplotlib.pyplot as plt import pdb import numpy as np import csv import time def PlotDemo1(a, b): a1 = [] b1 = [] a1 = a b1 = b fig = plt.figure() ax = fig.add_subplot(1,1,1) ax.plot(a,b) plt.show() def PlotDemo(a,zero): a1 = [] b1 = [] a1 = a fig = plt.fi...
2017wxyzwxyz/PythonStock
获取当日数据并画分时图/画出走势图.py
画出走势图.py
py
1,976
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 12, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.show", "line_number": 15, "usage_type": "call" }, { "api_name": "mat...
71249335464
""" NSynth classification using PyTorch Authors: Japheth Adhavan, Jason St. George Reference: Sasank Chilamkurthy <https://chsasank.github.io> """ import torch import torch.nn as nn import torch.optim as optim from torch.optim import lr_scheduler import numpy as np import utils import models import data import visuali...
ifrit98/NSynth_Classification_CNN
src/main.py
main.py
py
9,785
python
en
code
1
github-code
36
[ { "api_name": "logging.basicConfig", "line_number": 21, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 21, "usage_type": "attribute" }, { "api_name": "utils.get_free_gpu", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.device...
32538066028
# -*- coding: utf-8 -*- """ Created on Sat May 5 10:53:26 2018 @author: lenovo """ import numpy as np from scipy.optimize import leastsq def fun(p,x): """定义想要拟合的函数""" k,b = p return k*x+b def err(p,x,y): """定义误差函数""" return fun(p,x)-y x = [1,2,3,4] y = [6,5,7,10] p0 = ...
wilsonzyp/probability_statistics
Try_leastsq_with_scipy.py
Try_leastsq_with_scipy.py
py
446
python
en
code
1
github-code
36
[ { "api_name": "numpy.array", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 26, "usage_type": "call" }, { "api_name": "scipy.optimize.leastsq", "line_number": 27, "usage_type": "call" } ]
2962922987
#! /usr/bin/env python from sensor_msgs.msg import CompressedImage from cv_bridge import CvBridge, CvBridgeError import cv2 import rospy import subprocess #from PIL import Image # PIL from __init__ import * from rgiro_spco2_slam.srv import spco_data_image,spco_data_imageResponse import spco2_placescnn as places365 cl...
Shoichi-Hasegawa0628/spco2_boo
rgiro_spco2_slam/src/spco2_image_features.py
spco2_image_features.py
py
3,939
python
en
code
2
github-code
36
[ { "api_name": "rgiro_spco2_slam.srv.spco_data_imageResponse", "line_number": 18, "usage_type": "call" }, { "api_name": "spco2_placescnn.Image.fromarray", "line_number": 22, "usage_type": "call" }, { "api_name": "spco2_placescnn.Image", "line_number": 22, "usage_type": "at...
5547407739
""" Tests for voting 31/01/2023. """ from scripts.vote_2023_01_31 import start_vote from brownie import chain, accounts from brownie.network.transaction import TransactionReceipt from eth_abi.abi import encode_single from utils.config import network_name from utils.test.tx_tracing_helpers import * from utils.test.e...
lidofinance/scripts
archive/tests/test_2023_01_31.py
test_2023_01_31.py
py
12,625
python
en
code
14
github-code
36
[ { "api_name": "brownie.accounts.at", "line_number": 38, "usage_type": "call" }, { "api_name": "brownie.accounts", "line_number": 38, "usage_type": "name" }, { "api_name": "brownie.accounts.at", "line_number": 39, "usage_type": "call" }, { "api_name": "brownie.acco...
8733726032
import pygame pygame.init() __screen_info = pygame.display.Info() __height = __screen_info.current_h # Screen constants SCREEN_SIZE = (__height / 7 * 6, __height - 64) ICON_SIZE = (64, 64) LEFT_BOUND = 0 RIGHT_BOUND = SCREEN_SIZE[0] - ICON_SIZE[0] TOP_BOUND = 0 BOTTOM_BOUND = SCREEN_SIZE[1] ALIEN_INVASION_BOUND = SC...
SimonValentino/SpaceInvaders
constants.py
constants.py
py
3,409
python
en
code
0
github-code
36
[ { "api_name": "pygame.init", "line_number": 3, "usage_type": "call" }, { "api_name": "pygame.display.Info", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 5, "usage_type": "attribute" } ]
72911967144
"""The URL configuration of the application When the particular URL is hit it feeds the request to the corresponding view. """ from django.urls import path from django.views.generic import RedirectView from .views import base, add_to_registry, validate_url, issue_registry, dashboard urlpatterns = [ path('base/', ...
architsingh15/django-radius-github
issue_tracker/urls.py
urls.py
py
585
python
en
code
1
github-code
36
[ { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" }, { "api_name": "views.base", "line_number": 10, "usage_type": "argument" }, { "api_name": "django.urls.path", "line_number": 11, "usage_type": "call" }, { "api_name": "views.add_to_registr...
21213459172
import csv from django.db.models import Q from django.http import HttpResponse from data.models import ( List, Pairing, AOS, BCP, ) def raw_list(request, list_id): list = List.objects.get(id=list_id) return HttpResponse(list.raw_list.replace("\n", "<br>")) def export_pairings_as_csv(reques...
Puciek/aos_tools
data/views.py
views.py
py
4,349
python
en
code
0
github-code
36
[ { "api_name": "data.models.List.objects.get", "line_number": 15, "usage_type": "call" }, { "api_name": "data.models.List.objects", "line_number": 15, "usage_type": "attribute" }, { "api_name": "data.models.List", "line_number": 15, "usage_type": "name" }, { "api_n...
39395995067
from aiogram.types import ( ReplyKeyboardMarkup, InlineKeyboardMarkup, InlineKeyboardButton, ) main_buttons = { "ask": "Спросить 🤖", } class Keyboard: def __init__(self): self.main = self.make_main_buttons() def make_main_buttons(self): _keyboard_main = ReplyKeyboardMarkup(r...
Devil666face/ChatGPTosBot
bot/keyboard.py
keyboard.py
py
856
python
en
code
0
github-code
36
[ { "api_name": "aiogram.types.ReplyKeyboardMarkup", "line_number": 17, "usage_type": "call" }, { "api_name": "aiogram.types.InlineKeyboardMarkup", "line_number": 24, "usage_type": "call" }, { "api_name": "aiogram.types.InlineKeyboardButton", "line_number": 25, "usage_type"...
70874370025
import logging from datetime import datetime from typing import Generic, Text, Type, TypeVar from uuid import UUID, uuid4 from injector import ( Injector, UnknownProvider, UnsatisfiedRequirement, inject, singleton, ) from pydantic import BaseModel, Field log = logging.getLogger(__name__) class C...
lzukowski/workflow
src/application/bus.py
bus.py
py
2,137
python
en
code
5
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "pydantic.BaseModel", "line_number": 18, "usage_type": "name" }, { "api_name": "uuid.UUID", "line_number": 19, "usage_type": "name" }, { "api_name": "pydantic.Field", "...
74286571624
#!/usr/bin/env python # -*- coding: utf-8 -*- # # PYTHON_ARGCOMPLETE_OK # Pass --help flag for help on command-line interface import sympy as sp import numpy as np from pyneqsys.symbolic import SymbolicSys def solve(guess_a, guess_b, power, solver='scipy'): """ Constructs a pyneqsys.symbolic.SymbolicSys instanc...
bjodah/pyneqsys
examples/bi_dimensional.py
bi_dimensional.py
py
2,055
python
en
code
38
github-code
36
[ { "api_name": "sympy.symbols", "line_number": 16, "usage_type": "call" }, { "api_name": "sympy.Symbol", "line_number": 18, "usage_type": "call" }, { "api_name": "pyneqsys.symbolic.SymbolicSys", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.savetx...
4767724527
import os #os.environ['GLOG_minloglevel'] = '2' from tqdm import trange import caffe import argparse import pandas as pd def main(solver_proto, out_dir): caffe.set_mode_gpu() solver = caffe.SGDSolver(solver_proto) train_loss, test_loss = [], [] test_loss.append(solver.test_nets[0].blobs['loss'].data.c...
alexkreimer/monocular-odometry
tools/solve.py
solve.py
py
1,237
python
en
code
1
github-code
36
[ { "api_name": "caffe.set_mode_gpu", "line_number": 10, "usage_type": "call" }, { "api_name": "caffe.SGDSolver", "line_number": 11, "usage_type": "call" }, { "api_name": "tqdm.trange", "line_number": 14, "usage_type": "call" }, { "api_name": "tqdm.trange", "lin...
42494180975
""" WRITE ME Tests for the R operator / L operator For the list of op with r op defined, with or without missing test see this file: doc/library/tensor/basic.txt For function to automatically test your Rop implementation, look at the docstring of the functions: check_mat_rop_lop, check_rop_lop, check_nondiff_rop, ""...
Theano/Theano
theano/tests/test_rop.py
test_rop.py
py
17,055
python
en
code
9,807
github-code
36
[ { "api_name": "theano.gof.Op", "line_number": 33, "usage_type": "name" }, { "api_name": "theano.gof.Apply", "line_number": 40, "usage_type": "call" }, { "api_name": "theano.gradient.grad_undefined", "line_number": 48, "usage_type": "call" }, { "api_name": "unittes...
28841930639
import pygame, sys, time, random from pygame.locals import * pygame.init() mainClock = pygame.time.Clock() lives = 3 lives2 = 3 width = 800 height = 600 windowSurface = pygame.display.set_mode((width, height), 0, 32) pygame.display.set_caption('Star Wars!') movementSpeed = 10 projectileSpeed = 30 scrollSpeed = 6 ia...
Noah04322/Assignments
End of Year.py
End of Year.py
py
23,466
python
en
code
0
github-code
36
[ { "api_name": "pygame.init", "line_number": 3, "usage_type": "call" }, { "api_name": "pygame.time.Clock", "line_number": 4, "usage_type": "call" }, { "api_name": "pygame.time", "line_number": 4, "usage_type": "attribute" }, { "api_name": "pygame.display.set_mode",...
17887984325
from PySide2.QtCore import QUrl, QObject, Slot from PySide2.QtGui import QGuiApplication from PySide2.QtQuick import QQuickView class MyClass(QObject): @Slot(int, result=str) # 声明为槽,输入参数为int类型,返回值为str类型 def returnValue(self, value): return str(value + 10) if __name__ == '__main__': path = 's...
pyminer/pyminer
pyminer/widgets/widgets/basic/quick/demo1.py
demo1.py
py
635
python
en
code
77
github-code
36
[ { "api_name": "PySide2.QtCore.QObject", "line_number": 8, "usage_type": "name" }, { "api_name": "PySide2.QtCore.Slot", "line_number": 10, "usage_type": "call" }, { "api_name": "PySide2.QtGui.QGuiApplication", "line_number": 18, "usage_type": "call" }, { "api_name"...
2153945744
from django.shortcuts import render product_price = {"라면":980,"홈런볼":1500,"칙촉":2300, "식빵":1800} # Create your views here. def price(request, thing, cnt): if thing in product_price: y_n = 'y' price = product_price[thing] else: y_n = 'n' price = 0 context = { 'y_n' : y...
ji-hyon/Web_study
Django/practice/part2_Django/django_2_1/project1/prices/views.py
views.py
py
505
python
en
code
0
github-code
36
[ { "api_name": "django.shortcuts.render", "line_number": 20, "usage_type": "call" } ]
28536518861
"""project URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-ba...
mechtron/coreys-image-classifier
api/project/urls.py
urls.py
py
1,341
python
en
code
3
github-code
36
[ { "api_name": "django.conf.urls.url", "line_number": 29, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 29, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 29, "usage_type": "name" }, { "api_name...
30526696470
from __future__ import print_function, division import os import logging import math import numpy as np import pandas as pd import torch from torch.utils.tensorboard import SummaryWriter IS_ON_SERVER = False if os.getcwd().startswith('/home/SENSETIME/yuanjing1') else True axis_name2np_dim = { "x": 2, "y": 1...
eugeneyuan/test_rep
src/utils/miscs.py
miscs.py
py
6,820
python
en
code
0
github-code
36
[ { "api_name": "os.getcwd", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.clip", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.percentile", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.all", "line_number": ...
23012638929
""" Script for labeling purposes Usage : python label_processing.py -d [PATH TO IMAGES FOLDER] [PARAMS] Parameters: -d : Path to the folder where the images is stored -l : Lower all labels in xml files. -c : Count each label of all the xml files -s : Find images with specific label -lm : Creat...
Hyuto/rangrang-ML
scripts/label_processing.py
label_processing.py
py
5,474
python
en
code
0
github-code
36
[ { "api_name": "os.path.splitext", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_number": 23, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 23, "usage_type": "call" }, { "api_name": "os.remove", "line_number...
6789488341
from django.contrib import auth from django.core.exceptions import ObjectDoesNotExist from .models import Member class EcosystemActivityMiddleware: EXTENSIONS_EXCLUDED = ['js', 'map', 'css'] PATHS_EXCLUDED = ['/api/graphql-jwt'] def __init__(self, get_response): self.get_response = get_response ...
tomasgarzon/exo-services
service-exo-core/ecosystem/middleware.py
middleware.py
py
888
python
en
code
0
github-code
36
[ { "api_name": "models.Member.objects.get", "line_number": 20, "usage_type": "call" }, { "api_name": "models.Member.objects", "line_number": 20, "usage_type": "attribute" }, { "api_name": "models.Member", "line_number": 20, "usage_type": "name" }, { "api_name": "dj...
19406242010
# # @lc app=leetcode id=24 lang=python3 # # [24] Swap Nodes in Pairs # # @lc code=start # Definition for singly-linked list. from typing import Optional class ListNode: def __init__(self, val=0, next=None): self.val = val self.next = next class Solution: def swapPairs(self, head: Opt...
Matthewow/Leetcode
vscode_extension/24.swap-nodes-in-pairs.py
24.swap-nodes-in-pairs.py
py
772
python
en
code
2
github-code
36
[ { "api_name": "typing.Optional", "line_number": 18, "usage_type": "name" } ]
30180224626
from flask import Flask, render_template, request, redirect import datetime app=Flask(__name__) messages=[] @app.route('/') def index(): return render_template("index.html.jinja2", messages=messages) @app.route('/post/add/', methods=['POST']) def add_message(): text = request.form.get('message') timesta...
haishengbao/website
app.py
app.py
py
490
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.request.form.get", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.request...
29277732322
# QUESTION: # In Hogwarts the currency is made up of galleon (G) and Sickle (s), # and there are seven coins in general circulation: # 1s, 5s, 10s, 25s, 50s, G1(100s), and G2(200s) # It's possible to make G3.5 in the following way: # 1xG2 +1xG1 + 4x10s +1x5s + 5x1s # How many different ways can G3.5 be made using any ...
krissukoco/hogwarts-coins
main.py
main.py
py
1,525
python
en
code
0
github-code
36
[ { "api_name": "typing.List", "line_number": 13, "usage_type": "name" } ]
25114962700
from flask import Flask from flask_restful import Resource, Api from flask_jwt_extended import JWTManager from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from controler import * app = Flask(__name__) api = Api(app) app.config['JWT_SECRET_KEY'] = 'qwejhfloimslvuywdkkvuhssss' jwt = JWTMan...
VolodymyrVoloshyn02/PP
app.py
app.py
py
1,882
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "flask_restful.Api", "line_number": 11, "usage_type": "call" }, { "api_name": "flask_jwt_extended.JWTManager", "line_number": 14, "usage_type": "call" }, { "api_name": "sqlalchem...
72485218024
from django.urls import path, include from rest_framework.routers import DefaultRouter from . import views from .apis import listings, users from knox import views as knox_views router = DefaultRouter() router.register(r"users", users.UserViewSet, basename="users_api") router.register(r"listings", listings.AuctionView...
pecodeliar/BayleeWeb
api/urls.py
urls.py
py
1,160
python
en
code
0
github-code
36
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 7, "usage_type": "call" }, { "api_name": "apis.users.UserViewSet", "line_number": 8, "usage_type": "attribute" }, { "api_name": "apis.users", "line_number": 8, "usage_type": "name" }, { "api_name...
484991740
# features - word cnt, character cnt, sentence cnt, word freq import sys import time import json import string from nltk.tokenize import word_tokenize from nltk.corpus import stopwords from nltk.stem.porter import PorterStemmer import numpy as np import pandas as pd porter = PorterStemmer() stop_words = set(stopwords...
AparAhuja/Machine_Learning
Naive Bayes and SVM/Q1/e.py
e.py
py
6,378
python
en
code
0
github-code
36
[ { "api_name": "nltk.stem.porter.PorterStemmer", "line_number": 13, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords.words", "line_number": 14, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords", "line_number": 14, "usage_type": "name" }, { "...
1742330108
import requests from django.contrib.auth.decorators import login_required from django.shortcuts import render from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin from django.views.generic import ListView, CreateView, DetailView, UpdateView, DeleteView from .models import * # Create your clas...
cysong12/COMP-2800-Team-DTC-14-Cominder
Apps/fridge/views.py
views.py
py
3,201
python
en
code
0
github-code
36
[ { "api_name": "django.shortcuts.render", "line_number": 17, "usage_type": "call" }, { "api_name": "django.contrib.auth.decorators.login_required", "line_number": 11, "usage_type": "call" }, { "api_name": "django.views.generic.DetailView", "line_number": 20, "usage_type": ...
23407025114
# -*- coding: utf-8 -*- """ Department to Employee is One to Many. 解决方案: 有的时候 One to Many 对应的 Many 可能数量太多, 无法作为冗余跟 One 一起储存. 这时可以以 One.id 建立 Global Index. 问题: 由于 GSI 本质是另一个 DynamoDB Table, 只不过系统帮你自动维护了. 同样的 GSI 也会根据 hash key 做 partition 分散流量. 如果 One 这边的 entity 的数量不够多. 那么会导致 GSI 的流量不均衡. """ import os import random...
MacHu-GWU/Dev-Exp-Share
docs/source/01-AWS/01-All-AWS-Services-Root/21-Database/01-DynamoDB-Root/04-Dynamodb-Data-Modeling/principal/one-to-many/strategy2.py
strategy2.py
py
4,760
python
en
code
3
github-code
36
[ { "api_name": "os.environ", "line_number": 29, "usage_type": "attribute" }, { "api_name": "pynamodb.connection.Connection", "line_number": 31, "usage_type": "call" }, { "api_name": "pynamodb.models.Model", "line_number": 34, "usage_type": "name" }, { "api_name": "...
38221121523
from itertools import permutations def solution(k, dungeons): answer = 0 per = list(permutations(dungeons, len(dungeons))) for i in range(len(per)): cnt = 0 copy_k = k for j in range(len(per[i])): if per[i][j][0] <= copy_k: copy_k -= per[i][j][1] ...
kh-min7/Programmers
87946(피로도).py
87946(피로도).py
py
411
python
en
code
0
github-code
36
[ { "api_name": "itertools.permutations", "line_number": 5, "usage_type": "call" } ]
25650877857
import sqlite3 from sqlite3 import Error def create_connection(path): connection = None try: connection = sqlite3.connect(path) print("Connection to SQLite DB successful") except Error as e: print(f"The error '{e}' occurred") return connection def connect_to_db(): return crea...
rezzco/portfo
shit.py
shit.py
py
1,772
python
en
code
0
github-code
36
[ { "api_name": "sqlite3.connect", "line_number": 7, "usage_type": "call" }, { "api_name": "sqlite3.Error", "line_number": 9, "usage_type": "name" }, { "api_name": "sqlite3.Error", "line_number": 23, "usage_type": "name" }, { "api_name": "sqlite3.Error", "line_n...
3896815670
from datetime import timedelta from pathlib import Path import pytest import htmap from htmap.utils import timeout_to_seconds, wait_for_path_to_exist def test_returns_when_path_does_exist(): path = Path(__file__) wait_for_path_to_exist(path) @pytest.mark.parametrize("timeout", [0, -1]) def test_timeout_o...
htcondor/htmap
tests/unit/test_wait_for_path_to_exist.py
test_wait_for_path_to_exist.py
py
706
python
en
code
29
github-code
36
[ { "api_name": "pathlib.Path", "line_number": 11, "usage_type": "call" }, { "api_name": "htmap.utils.wait_for_path_to_exist", "line_number": 13, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 18, "usage_type": "call" }, { "api_name": "pytest.r...
26884869558
import torch from torch.utils.data import Dataset import torch.utils.data.dataloader as dataloader import torch.optim as optim import torch.nn as nn import torch.nn.functional as F import numpy as np from numpy.matlib import repmat import math MAX_LEN = 300 AUDIO_TYPE_ID = {'vowel-u': 0,'vowel-i': 1,'vowel-a': 2,'alph...
KalibrateBlockchain/VFO2
version_1/models_def.py
models_def.py
py
8,707
python
en
code
0
github-code
36
[ { "api_name": "numpy.arange", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 61, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 71, "usage_type": "call" }, { "api_name": "numpy.matlib.repmat", "line_nu...