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
8218028
from pathlib import Path import shutil the_dir = Path().home() / "repos/pyman" dest_dir = Path().home() / "repos/myst_nb/docs/examples/pyman" notebooks = list(the_dir.glob("**/*txt")) print(notebooks) for a_notebook in notebooks: new_name = dest_dir / a_notebook.name print(new_name) shutil.copy(a_notebook...
eoas-ubc/eoas_tlef
pyman/move_material.py
move_material.py
py
331
python
en
code
3
github-code
1
[ { "api_name": "pathlib.Path", "line_number": 4, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 5, "usage_type": "call" }, { "api_name": "shutil.copy", "line_number": 11, "usage_type": "call" } ]
44933547743
from gensim.models import KeyedVectors import image_read as image_read import pandas as pd import re import numpy as np from ast import literal_eval ''' This class receives the image, performs the similarity and recommends the quotes ''' class QuoteFinder: def __init__(self, path): self.path = path ...
pran4ajith/quote-learning
quote_finder.py
quote_finder.py
py
1,663
python
en
code
0
github-code
1
[ { "api_name": "gensim.models.KeyedVectors.load_word2vec_format", "line_number": 20, "usage_type": "call" }, { "api_name": "gensim.models.KeyedVectors", "line_number": 20, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 25, "usage_type": "call" },...
35733914527
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name='pydrip', version='0.2.0', author="Matthew Clarkson", author_email="mpclarkson@gmail.com", description="A Python 3 client for the Drip API.", long_description=long_description,...
flypaperplanes/pydrip
setup.py
setup.py
py
682
python
en
code
4
github-code
1
[ { "api_name": "setuptools.setup", "line_number": 5, "usage_type": "call" } ]
36234924161
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Thu Nov 1 10:04:59 2018 @author: vganapa1 """ import numpy as np from scipy.io import loadmat import matplotlib.pyplot as plt from scipy.ndimage.interpolation import shift def F(mat2D): # Fourier tranform centered at zero mat2D = np.fft.fftshift(mat2D...
Mualpha7/Engineering_JupyterFiles
ENGR 030. Computation optics/CLEAN_TutorialNov1.py
CLEAN_TutorialNov1.py
py
2,511
python
en
code
0
github-code
1
[ { "api_name": "numpy.fft.fftshift", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.fft", "line_number": 14, "usage_type": "attribute" }, { "api_name": "numpy.fft.fft2", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.fft", "lin...
16176218244
# coding: utf-8 from rest_framework import serializers from swutils.phone import gen_canonical_phone, CanonicalPhoneGenerationException from sms_devino.client import DevinoException from core import models class Sms(serializers.ModelSerializer): result = serializers.SerializerMethodField() class Meta: ...
telminov/sms-service
core/serializers.py
serializers.py
py
2,693
python
en
code
2
github-code
1
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 8, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 8, "usage_type": "name" }, { "api_name": "rest_framework.serializers.SerializerMethodField", "line_number": 9,...
4848628333
# --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.11.3 # kernelspec: # display_name: Python 3 (ipykernel) # language: python # name: python3 # --- # + """ This cell sets up the information ...
cvisionai/tator-py
examples/move_to_new_section.py
move_to_new_section.py
py
4,081
python
en
code
4
github-code
1
[ { "api_name": "tator.get_api", "line_number": 49, "usage_type": "call" }, { "api_name": "uuid.uuid4", "line_number": 97, "usage_type": "call" } ]
42689748720
import numpy as np from scipy.spatial.distance import cdist from collections import defaultdict from sace.sace import SACE class CaseBasedSACE(SACE): def __init__(self, variable_features, weights=None, metric='euclidean', feature_names=None, continuous_features=None, categorical_features_lists...
riccotti/Scamander
sace/casebased_sace.py
casebased_sace.py
py
9,044
python
en
code
5
github-code
1
[ { "api_name": "sace.sace.SACE", "line_number": 9, "usage_type": "name" }, { "api_name": "scipy.spatial.distance.cdist", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.float", "line_number": 28, "usage_type": "attribute" }, { "api_name": "numpy.sum...
31663210078
import gym import numpy as np from stable_baselines3.common.env_checker import check_env from stable_baselines3.common.callbacks import BaseCallback from stable_baselines3 import DQN env = gym.make('navi_env:navi-env-v0') train = True new_train = True model_name = "distance_matters" steps = 10000 class ...
engelmannakos/onlab
dqn.py
dqn.py
py
1,661
python
en
code
0
github-code
1
[ { "api_name": "gym.make", "line_number": 7, "usage_type": "call" }, { "api_name": "stable_baselines3.common.callbacks.BaseCallback", "line_number": 14, "usage_type": "name" }, { "api_name": "stable_baselines3.DQN", "line_number": 21, "usage_type": "call" }, { "api...
24237381680
import cv2 from matplotlib import pyplot as plt import numpy as np img = cv2.imread('flower.jpg',0) equ = cv2.equalizeHist(img) res = np.hstack((img,equ)) cv2.imshow('histogram img',res) cv2.waitKey(0) cv2.destroyAllWindows() histg = cv2.calcHist([img],[0],None,[250],[0,256]) plt.plot (histg) plt.show()
puja2504/cv-programs
histogram.py
histogram.py
py
317
python
en
code
1
github-code
1
[ { "api_name": "cv2.imread", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.equalizeHist", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.hstack", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number":...
20392370999
import time from splinter import Browser from bs4 import BeautifulSoup from selenium import webdriver def init_browser(): # @NOTE: Replace the path with your actual path to the chromedriver executable_path = {"executable_path": r"C:/Users/ddzmi/Desktop/chromedriver.exe"} return Browser("chrome", **executa...
ddzmitry/Tutoring
PythonScraping/scrape_surfing.py
scrape_surfing.py
py
1,566
python
en
code
0
github-code
1
[ { "api_name": "splinter.Browser", "line_number": 10, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 25, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 27, "usage_type": "call" } ]
4767495324
# coding: utf-8 from fastapi import FastAPI from starlette.middleware.cors import CORSMiddleware from predict import FineTuningNet from pydantic import BaseModel app = FastAPI() # モデルの定義 net = FineTuningNet() app.add_middleware( CORSMiddleware, allow_origins=["*"], allow_credentials=True, allow_met...
May4bwu/perfume-ai
api/main.py
main.py
py
524
python
en
code
0
github-code
1
[ { "api_name": "fastapi.FastAPI", "line_number": 9, "usage_type": "call" }, { "api_name": "predict.FineTuningNet", "line_number": 12, "usage_type": "call" }, { "api_name": "starlette.middleware.cors.CORSMiddleware", "line_number": 15, "usage_type": "argument" }, { ...
8698747409
import random import matplotlib.pyplot as plt import numpy as np class Bucket: def __init__(self, start, end, sub_sum=None): self.start = start self.end = end self.sub_sum = sub_sum if sub_sum is None else sub_sum def __repr__(self): return f"({self.start},{self.end})" class...
songks0922/algorithm
python/solutions/dgim.py
dgim.py
py
4,149
python
en
code
0
github-code
1
[ { "api_name": "random.randint", "line_number": 120, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 159, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 160, "usage_type": "call" }, { "api_name": "matplotlib.pypl...
72401623395
import base64 import io import json import os from os import listdir from os.path import join from time import time import PIL.Image import numpy as np import matplotlib.pyplot as plt import cv2 import src.data.utils.utils as utils import src.data.constants as c ''' There will be folders inside masks_test called 'file...
gummz/cell
src/data/annotate_from_json_old.py
annotate_from_json_old.py
py
3,338
python
en
code
0
github-code
1
[ { "api_name": "src.data.utils.utils.set_cwd", "line_number": 44, "usage_type": "call" }, { "api_name": "src.data.utils.utils", "line_number": 44, "usage_type": "name" }, { "api_name": "src.data.constants.RAW_FILES_GENERALIZE", "line_number": 46, "usage_type": "attribute" ...
34442426524
import theano import theano.tensor as T import numpy as np from neupy.core.properties import (NumberProperty, ProperFractionProperty, ParameterProperty) from neupy.utils import asfloat, as_tuple from neupy.core.init import Initializer, Constant from .activations import AxesProperty f...
ravisankaradepu/saddle
layers/normalization.py
normalization.py
py
6,242
python
en
code
0
github-code
1
[ { "api_name": "base.BaseLayer", "line_number": 53, "usage_type": "name" }, { "api_name": "activations.AxesProperty", "line_number": 97, "usage_type": "call" }, { "api_name": "neupy.core.properties.ProperFractionProperty", "line_number": 98, "usage_type": "call" }, { ...
5053431386
from flask_classful import FlaskView, route from flask import request, jsonify from application.API.utils import AuthorizeRequest, notLoggedIn, b64_to_data from application.API.Factory.BLFactory import BF from application.API.Factory.SchemaFactory import SF class APIPostView(FlaskView): def index(self): re...
theirfanirfi/flask-book-exchange-apis
application/API/APIRoutes/PostView.py
PostView.py
py
5,197
python
en
code
0
github-code
1
[ { "api_name": "flask_classful.FlaskView", "line_number": 6, "usage_type": "name" }, { "api_name": "application.API.utils.AuthorizeRequest", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.request.headers", "line_number": 10, "usage_type": "attribute" }, ...
18601164642
import sys import os # Tell syspath where to import modules from other folders in root direcotry sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from env import EnvReader from model.combine import CombineData class Command: """ Command line command execution """ def __init__(self):...
piotrr79/csvApiParser
command.py
command.py
py
1,641
python
en
code
0
github-code
1
[ { "api_name": "sys.path.append", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
33372804607
import logging import os from aiogram import Bot, Dispatcher, types from aiogram.contrib.fsm_storage.memory import MemoryStorage from aiogram.dispatcher import FSMContext from aiogram.dispatcher.filters.state import State, StatesGroup from aiogram.utils import executor from smartcontract_interaction import * from dot...
dexXxed/student_residence_queue
main.py
main.py
py
4,564
python
uk
code
0
github-code
1
[ { "api_name": "dotenv.load_dotenv", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.getenv", ...
70170767393
import pyttsx3 from datetime import * import speech_recognition as sr import wikipedia import webbrowser import os #Initialization of pyttsx3 module engine = pyttsx3.init('sapi5') voices = engine.getProperty('voices') engine.setProperty('voices', voices[0].id) #Creating a function which will speak the giv...
gauravmanocha/Virtual-Assistant
VAssistant.py
VAssistant.py
py
5,775
python
en
code
1
github-code
1
[ { "api_name": "pyttsx3.init", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.now", "line_number": 20, "usage_type": "call" }, { "api_name": "speech_recognition.Recognizer", "line_number": 39, "usage_type": "call" }, { "api_name": "speech_recogni...
15690331612
from django.conf.urls import patterns, url from rest_framework import routers import views import api from forms import LoginForm urlpatterns = patterns('', url(r'user/(?P<pk>[\d]+)/?$', views.ListTweetsByUser.as_view(), name='user-tweet-list'), url(r'hashtag/(?P<tag>[-_\w]+)/?$', views.ListTweetsByHashTag.as_v...
lafaiDev/mini-blog
apps/blog/urls.py
urls.py
py
972
python
en
code
0
github-code
1
[ { "api_name": "django.conf.urls.patterns", "line_number": 11, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 12, "usage_type": "call" }, { "api_name": "views.ListTweetsByUser.as_view", "line_number": 12, "usage_type": "call" }, { "api...
38755112529
import numpy as np import pyart import gc import tempfile import os # We want cfgrib to be an optional dependency to ensure Windows compatibility try: import cfgrib CFGRIB_AVAILABLE = True except ImportError: CFGRIB_AVAILABLE = False # We really only need the API to download the data, make ECMWF API an #...
openradar/PyDDA
pydda/constraints/model_data.py
model_data.py
py
21,863
python
en
code
77
github-code
1
[ { "api_name": "tempfile.NamedTemporaryFile", "line_number": 164, "usage_type": "call" }, { "api_name": "cdsapi.Client", "line_number": 171, "usage_type": "call" }, { "api_name": "pyart.config.get_field_name", "line_number": 226, "usage_type": "call" }, { "api_name...
41585759269
from typing import Optional, List from .types import LanguageConfig, ModifierType, ResourceStr, PRODUCES_ADD, PRODUCES_MULT, \ UPKEEP_MULT, UPKEEP_ADD, EconomicCategoryKey, COST_MULT, COST_ADD from .utils import Writer, generate_resource_loc def _unpack_resource_id(resource: ResourceStr): return resource if ...
Stellaris-Evolved/stellaris-evolved
tools/uml/modifier.py
modifier.py
py
5,978
python
en
code
6
github-code
1
[ { "api_name": "types.ResourceStr", "line_number": 8, "usage_type": "name" }, { "api_name": "types.ModifierType", "line_number": 12, "usage_type": "name" }, { "api_name": "types.ResourceStr", "line_number": 19, "usage_type": "name" }, { "api_name": "types.ModifierT...
16805360824
#!/usr/bin/python3 import argparse from os import system from sys import stdout from scapy.all import * from random import randint def get_args(): parser = argparse.ArgumentParser(description='SYN Flood Attack --- Press CTRL+C to stop the attack!') parser.add_argument('--ip', required=True) parser.add_arg...
OceanicSix/Python_program
scapy_code/tcp_attack/syn_flood.py
syn_flood.py
py
1,386
python
en
code
1
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 10, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 17, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 24, "usage_type": "call" }, { "api_name": "random.randint"...
33649721176
import tweepy from tweepy import OAuthHandler from tweepy import API C_KEY = '' C_SECRET = '' A_TOKEN_KEY = '' A_TOKEN_SECRET = '' auth = tweepy.OAuthHandler(C_KEY, C_SECRET) auth.set_access_token(A_TOKEN_KEY, A_TOKEN_SECRET) api = tweepy.API(auth) keyword = '@delta' keyword2 = 'delta airlines' keyword3 = 'american ...
lauradan/cse482
twitter_collection_rest.py
twitter_collection_rest.py
py
1,422
python
en
code
0
github-code
1
[ { "api_name": "tweepy.OAuthHandler", "line_number": 10, "usage_type": "call" }, { "api_name": "tweepy.API", "line_number": 12, "usage_type": "call" } ]
27670978290
#! /usr/bin/env python3 # -*- coding:utf-8 -*- ''' cleans the an crubadan corpus for fijian a bit. all consonant-final words are removed. all words with 'h' are removed. then english words are identified by intersecting list with Celex. hyphens, hashtags, ampersands removed. spaces added. ''' import os,sys, itert...
gouskova/transcribers
fijian/fijian_cleaner.py
fijian_cleaner.py
py
1,649
python
en
code
3
github-code
1
[ { "api_name": "os.path.dirname", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.join", "line_numbe...
28770160800
from matplotlib import pyplot as plt from GradientByHand import renew_lrbyhand from GradientDescentUpdateModel import renew_gradientdescent from MultiScikit import renew_multivariate def plot(): ypoints = [] for i in range(50): ypoints.append(i) byhandpoints = [] gradient, bias = re...
EFRobins/SurfPrediction
Graphs.py
Graphs.py
py
900
python
en
code
0
github-code
1
[ { "api_name": "GradientByHand.renew_lrbyhand", "line_number": 12, "usage_type": "call" }, { "api_name": "GradientDescentUpdateModel.renew_gradientdescent", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 19, "usage_type"...
34370474574
import copy from config_manager import ConfigManager from lib import arrow from master.error.validate_exception import RecipeValidationException from util.gdal_util import MAX_RETRIES_TO_OPEN_FILE from util.time_util import DateTimeUtil, execute_with_retry_on_timeout from util import list_util from master.evaluator.ev...
kalxas/rasdaman
applications/wcst_import/recipes/general_coverage/grib_to_coverage_converter.py
grib_to_coverage_converter.py
py
19,682
python
en
code
4
github-code
1
[ { "api_name": "recipes.general_coverage.abstract_to_coverage_converter.AbstractToCoverageConverter", "line_number": 56, "usage_type": "name" }, { "api_name": "recipes.general_coverage.abstract_to_coverage_converter.AbstractToCoverageConverter.__init__", "line_number": 88, "usage_type": "...
1440866299
# stdlib imports import sqlite3 import xml.etree.ElementTree as ET import copy from collections import OrderedDict import re import logging # third party imports import numpy as np # local imports TABLES = OrderedDict(( ('station', OrderedDict(( ('id', 'str primary key'), # id is net.sta ...
ynthdhj/shakemap
shakelib/station.py
station.py
py
26,887
python
en
code
1
github-code
1
[ { "api_name": "collections.OrderedDict", "line_number": 15, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 17, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 31, "usage_type": "call" }, { "api_name"...
21585286375
#!/usr/local/bin/python3 import numpy as np import pandas as pd import psycopg2 as pg import sys, os, re from collections import defaultdict from matplotlib import pyplot as plt import os, sys, datetime, argparse, pytz, glob, logging, re, csv, operator, math, logging.handlers from dy8_signals import * class Stats: d...
chenxu0602/ChinaFutures
dy8_stats.py
dy8_stats.py
py
3,455
python
en
code
2
github-code
1
[ { "api_name": "collections.defaultdict", "line_number": 24, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 24, "usage_type": "attribute" }, { "api_name": "pandas.DataFrame", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy....
41758952234
from django.urls import path from . import views from django.conf.urls import url urlpatterns = [ path('', views.home, name='dict-home'), path('about/', views.about, name='dict-about'), url(r'^$', views.button), url(r'^output', views.output,name="script"), path('about/', views.home), url(r'^tes...
ManolisFrag/django_dictionary
dict/urls.py
urls.py
py
397
python
en
code
0
github-code
1
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "django.conf.urls....
8092625762
import argparse import requests import os import queue import sounddevice as sd import vosk import sys import json from bs4 import BeautifulSoup from query_wikipedia import process_p, process_l import win32com.client import re head = """<?xml version="1.0"?> <speak version="1.0" xml:lang="ru">\n""" tail = "\n</speak...
eabuntov/poiist_lab
lab3.py
lab3.py
py
6,875
python
en
code
0
github-code
1
[ { "api_name": "win32com.client.client.Dispatch", "line_number": 19, "usage_type": "call" }, { "api_name": "win32com.client.client", "line_number": 19, "usage_type": "attribute" }, { "api_name": "win32com.client", "line_number": 19, "usage_type": "name" }, { "api_n...
20022974903
#!/usr/bin/env python3 """ session.py ========== Small library for interacting with the sendgrid API """ from .base import BaseMailService import requests import json __version__ = 'v0.0.1' class MailService(BaseMailService): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) ...
alexdro87/sendgrid
sendgrid/syncservice.py
syncservice.py
py
1,451
python
en
code
0
github-code
1
[ { "api_name": "base.BaseMailService", "line_number": 14, "usage_type": "name" }, { "api_name": "requests.session", "line_number": 19, "usage_type": "call" }, { "api_name": "requests.codes", "line_number": 24, "usage_type": "attribute" }, { "api_name": "json.decode...
6785175471
import MySQLdb import logging from logging import handlers import ogr, osr import sys, os import math from ConfigParser import SafeConfigParser logging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)s %(message)s') vlbg = (1,) def setupLogging(): ''' set up the Python logging facility ''' #...
JosephSchafer/sbstools
testing/flightstats.py
flightstats.py
py
3,820
python
en
code
0
github-code
1
[ { "api_name": "logging.basicConfig", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 9, "usage_type": "attribute" }, { "api_name": "logging.handlers.RotatingFileHandler", "line_number": 17, "usage_type": "call" }, { "api_name...
13210571246
from flask import Flask, request import json import mysql.connector from flask_cors import CORS from flask import jsonify import ast app = Flask(__name__) CORS(app) current_user_id = 0 #Set mysql access credentials file = open("/tmp/secrets/credentials", "r") content = file.read() config = ast.literal_eval(content...
EGS-BillsDivider/WebApp
app/backend/src/main.py
main.py
py
2,704
python
en
code
0
github-code
1
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 9, "usage_type": "call" }, { "api_name": "ast.literal_eval", "line_number": 17, "usage_type": "call" }, { "api_name": "flask.request.method", ...
31754675357
from lib import config from lib import utils CONF = config.get_config().CONF class Mock(object): """ Centralize calls to mock command, setting the arguments common to all of them. """ def __init__(self, config_file, unique_extension): """ Initialize arguments common to all mock ca...
schabrolles/open-power-host-os-build
lib/mock.py
mock.py
py
1,198
python
en
code
0
github-code
1
[ { "api_name": "lib.config.get_config", "line_number": 4, "usage_type": "call" }, { "api_name": "lib.config", "line_number": 4, "usage_type": "name" }, { "api_name": "lib.utils.run_command", "line_number": 41, "usage_type": "call" }, { "api_name": "lib.utils", ...
15703394426
from django.http import JsonResponse from django.shortcuts import render from .forms import MyForm import nltk from nltk.corpus import stopwords from nltk.tokenize import word_tokenize from nltk.stem import WordNetLemmatizer from .chat_actions import action_check from .questions_answers import qa_pairs as qa_pairs # De...
ignitedevv/mMoney1
budget/howy_views.py
howy_views.py
py
2,544
python
en
code
0
github-code
1
[ { "api_name": "nltk.download", "line_number": 14, "usage_type": "call" }, { "api_name": "nltk.download", "line_number": 15, "usage_type": "call" }, { "api_name": "nltk.download", "line_number": 16, "usage_type": "call" }, { "api_name": "nltk.stem.WordNetLemmatizer...
24485477779
# -*- coding: utf-8 -*- """ Created on Fri Apr 28 11:21:32 2023 @author: rghot """ import streamlit as st from st_aggrid import JsCode, AgGrid, GridOptionsBuilder #https://blog.streamlit.io/building-a-pivottable-report-with-streamlit-and-ag-grid/ from st_aggrid.shared import GridUpdateMode import datetime...
heliostrome/streamlit_app
pages/Add_solar_pumping_system_files/solar_module_files/solar_funcs.py
solar_funcs.py
py
12,154
python
en
code
0
github-code
1
[ { "api_name": "streamlit.session_state", "line_number": 29, "usage_type": "attribute" }, { "api_name": "streamlit.session_state", "line_number": 30, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 32, "usage_type": "call" }, { "a...
25171252929
# This files contains your custom actions which can be used to run # custom Python code. # # See this guide on how to implement these action: # https://rasa.com/docs/rasa/core/actions/#custom-actions/ # This is a simple example for a custom action which utters "Hello World!" from typing import Any, Text, Dict, List,...
KushanChamindu/hcss-rasa-chatBot-Doctor
actions.py
actions.py
py
7,646
python
en
code
1
github-code
1
[ { "api_name": "rasa_sdk.Action", "line_number": 25, "usage_type": "name" }, { "api_name": "typing.Text", "line_number": 27, "usage_type": "name" }, { "api_name": "rasa_sdk.executor.CollectingDispatcher", "line_number": 30, "usage_type": "name" }, { "api_name": "ra...
44771865121
# -*- coding: utf-8 -*- from typing import Tuple import numpy as np import torch def batched_tensor_indexing( t: torch.Tensor, index: Tuple[torch.Tensor] ) -> torch.Tensor: """Index a tensor by matching dimensions from right-to-left instead of left-to-right. This allows for broadcasting of tensor indexi...
TylerSpears/carn-le
pitn/utils/_utils.py
_utils.py
py
1,396
python
en
code
1
github-code
1
[ { "api_name": "torch.Tensor", "line_number": 9, "usage_type": "attribute" }, { "api_name": "typing.Tuple", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.is_tensor", "line_number": 35, "usage_type": "call" }, { "api_name": "torch.stack", "line_...
46350327621
from django.shortcuts import render, HttpResponse, redirect from django.contrib import messages from datetime import datetime from .models import User # Create your views here. def index(request): for object in User.objects.all(): context = { 'id': object.id, 'first_name': object.fi...
RamS2k/Python
Django Apps/main/apps/users/views.py
views.py
py
1,509
python
en
code
0
github-code
1
[ { "api_name": "models.User.objects.all", "line_number": 8, "usage_type": "call" }, { "api_name": "models.User.objects", "line_number": 8, "usage_type": "attribute" }, { "api_name": "models.User", "line_number": 8, "usage_type": "name" }, { "api_name": "models.User...
25513805421
from sys import implementation from typing import Optional, Sequence, Tuple, Union import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from monai.networks.blocks import Convolution, UpSample from monai.networks.layers.factories import Conv, Pool from monai.utils import ensure_tuple_r...
KumoLiu/explainablePN
blocks/basic_block.py
basic_block.py
py
13,887
python
en
code
1
github-code
1
[ { "api_name": "torch.nn.Sequential", "line_number": 21, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 21, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 29, "usage_type": "name" }, { "api_name": "typing.Union", "li...
19968338135
import cv2 as cv import numpy as np from shared import imgs sLine = 200 pLine = 200 cannyth = 120 fname = "/Users/kolsha/Pictures/2O_aUamZRZU.jpg" def standard_lines(dst): cdst = cv.cvtColor(dst, cv.COLOR_GRAY2BGR) lines = cv.HoughLines(dst, 1, np.pi / 180, sLine) if lines is not None: for line ...
Kolsha/sai_processing
7task.py
7task.py
py
1,877
python
en
code
0
github-code
1
[ { "api_name": "cv2.cvtColor", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.COLOR_GRAY2BGR", "line_number": 12, "usage_type": "attribute" }, { "api_name": "cv2.HoughLines", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.pi", "l...
21519230741
import pandas as pd import numpy as np import seaborn as sns from sklearn.preprocessing import OneHotEncoder, StandardScaler import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split class ImportData: def __init__(self): unit_2018=pd.read_csv("Datas/2018_DATA_SA_Units.csv") crash_201...
matthew2019369/roadCrashAnalysis
script.py
script.py
py
2,458
python
en
code
0
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.read_csv", ...
74703532193
from collections import OrderedDict class Solution: def containsNearbyDuplicate(self, nums: list[int], k: int) -> bool: dic = OrderedDict() first_key = 0 for i in range(len(nums)): if i < k + 1: if nums[i] in dic: return True ...
Carl-Johnsons/Noob
PracticeCoding/LeetCode/#1Easy/Contains_Duplicate_II.py
Contains_Duplicate_II.py
py
686
python
en
code
1
github-code
1
[ { "api_name": "collections.OrderedDict", "line_number": 6, "usage_type": "call" } ]
12504212316
#this code is developed by Suraj CB #Github Profile URL: https://github.com/SurajCB #This code is contributed to be an Open Source Program import openai openai.api_key = "your api openai api key" messages = [] system_msg = input("What type of chatbot would you like to create?\n") messages.append({"role": "system", "c...
SurajCB/AI-Chat-bot
Chat gpt powered smart ai chat bot.py
Chat gpt powered smart ai chat bot.py
py
737
python
en
code
0
github-code
1
[ { "api_name": "openai.api_key", "line_number": 6, "usage_type": "attribute" }, { "api_name": "openai.ChatCompletion.create", "line_number": 16, "usage_type": "call" }, { "api_name": "openai.ChatCompletion", "line_number": 16, "usage_type": "attribute" } ]
7612581895
import argparse import numpy as np import motmetrics as mm parser = argparse.ArgumentParser() parser.add_argument('--eval_dir_dpm',type=str, required=True) parser.add_argument('--eval_dir_ssd',type=str, required=True) parser.add_argument('--output_path', type=str, required=True) args = parser.parse_args() ########...
cnmy-ro/Enhanced-DeepSORT
Tools/run_mot16_benchmark.py
run_mot16_benchmark.py
py
4,756
python
en
code
3
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "motmetrics.MOTAccumulator", "line_number": 40, "usage_type": "call" }, { "api_name": "motmetrics.MOTAccumulator", "line_number": 41, "usage_type": "call" }, { "api_na...
29144885954
import asyncio import datetime from utils import postReminder from dbmongo import db from utils import premeetReminder from utils import postmeetReminder import pytz Task_details = db.connection() async def remainder(Client): try: data = Task_details.discord.find() for eachTask...
Guvi-CodeCamp-SRM/GuviBot
src/remainder/remainder.py
remainder.py
py
1,481
python
en
code
0
github-code
1
[ { "api_name": "dbmongo.db.connection", "line_number": 9, "usage_type": "call" }, { "api_name": "dbmongo.db", "line_number": 9, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.datetim...
69999816675
from datetime import date from fastapi import APIRouter, Depends from fastapi_versioning import version from pydantic import TypeAdapter from app.bookings.dao import BookingDAO from app.bookings.schemas import SBooking from app.exceptions import RoomCannotBeBooked from app.tasks.tasks import send_booking_confirmation...
Sauberr/bookings_project_v1
app/bookings/router.py
router.py
py
1,576
python
en
code
1
github-code
1
[ { "api_name": "fastapi.APIRouter", "line_number": 17, "usage_type": "call" }, { "api_name": "app.users.models.Users", "line_number": 24, "usage_type": "name" }, { "api_name": "fastapi.Depends", "line_number": 24, "usage_type": "call" }, { "api_name": "app.users.de...
29001113439
import sys, pygame, random class enemy(pygame.sprite.Sprite): def __init__(self, posX, posY): super().__init__() randomEntity = [] randomEntity = [pygame.image.load("../assets/spaceinvader1.png").convert_alpha(), pygame.image.load("../assets/spaceinvader2.png").convert_alpha(), pygame.ima...
wiltley/SpaceInvadersPyGame
scripts/enemy.py
enemy.py
py
1,874
python
en
code
0
github-code
1
[ { "api_name": "pygame.sprite", "line_number": 3, "usage_type": "attribute" }, { "api_name": "pygame.image.load", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 8, "usage_type": "attribute" }, { "api_name": "random.randint", ...
72797936675
import pickle from typing import List import faiss from langchain.schema import Document from langchain.vectorstores import FAISS from kb_guardian.utils.deployment import get_deployment_embedding def create_FAISS_vectorstore(document_chunks: List[Document]) -> FAISS: """ Create a FAISS vector store from a l...
datarootsio/knowledgebase_guardian
kb_guardian/utils/vectorstore.py
vectorstore.py
py
1,831
python
en
code
4
github-code
1
[ { "api_name": "typing.List", "line_number": 11, "usage_type": "name" }, { "api_name": "langchain.schema.Document", "line_number": 11, "usage_type": "name" }, { "api_name": "kb_guardian.utils.deployment.get_deployment_embedding", "line_number": 23, "usage_type": "call" }...
1027569415
from sklearn.ensemble import RandomForestRegressor from sklearn.datasets import make_regression import numpy as np from RobustRF import * X, y = make_regression(n_features=4, n_informative=2,random_state=0, shuffle=False) regr = RandomForestRegressor(max_depth=2, random_state=0) regr.fit(X, y) RandomForestRegres...
dma092/Forest-type-Regression-with-General-Losses-and-Robust-Forest-an-implementation
base.py
base.py
py
1,105
python
en
code
2
github-code
1
[ { "api_name": "sklearn.datasets.make_regression", "line_number": 9, "usage_type": "call" }, { "api_name": "sklearn.ensemble.RandomForestRegressor", "line_number": 13, "usage_type": "call" }, { "api_name": "sklearn.ensemble.RandomForestRegressor", "line_number": 15, "usage...
19455497708
from django.shortcuts import render, redirect from .models import * from django.contrib import messages def index(request): return redirect('/main') def main(request): return render(request, "index.html") def register(request): errors = User.objects.regValidator(request.POST) if errors: for k...
CLMason/travel_buddies
myapp/views.py
views.py
py
3,216
python
en
code
0
github-code
1
[ { "api_name": "django.shortcuts.redirect", "line_number": 6, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 9, "usage_type": "call" }, { "api_name": "django.contrib.messages.error", "line_number": 15, "usage_type": "call" }, { "api...
5059645380
from __future__ import annotations from dataclasses import dataclass from itertools import zip_longest from math import floor, sqrt from typing import Any, Literal, Sequence, Tuple from vsexprtools import ExprList, ExprOp, ExprToken, complexpr_available, norm_expr from vsrgtools.util import wmean_matrix from vstools ...
jiaolovekt/HPCENC
deps/vs-plugins/vsmasktools/morpho.py
morpho.py
py
15,970
python
en
code
11
github-code
1
[ { "api_name": "typing.Tuple", "line_number": 22, "usage_type": "name" }, { "api_name": "vstools.ConvMode", "line_number": 22, "usage_type": "name" }, { "api_name": "typing.Sequence", "line_number": 22, "usage_type": "name" }, { "api_name": "vstools.vs.VideoNode", ...
21735603758
import os import sys import PIL from PIL import Image, ImageStat from restore import restore def main(): # Set default parameters. debug = False directory = os.getcwd() # Parse the command line parameters. for param in sys.argv: Dir = param.find("dir=") if Dir>=0: directory = param[Dir+4:] g...
monkidea/restore
main.py
main.py
py
1,652
python
en
code
0
github-code
1
[ { "api_name": "os.getcwd", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.chdir", "line_number": 26, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 27, ...
3813653520
""" Simple implementation of the CulliganIoT API This is used to provide an interface between Culligan and Ayla. Additional API endpoints are unknown and closed source. Logging in directly to Ayla still works for some endpoints. Others such as /devices.json only seem to work when obtaining the token through Culliga...
rewardone/Culligan
src/culligan/uniapi_culliganiot.py
uniapi_culliganiot.py
py
13,114
python
en
code
3
github-code
1
[ { "api_name": "typing.Optional", "line_number": 39, "usage_type": "name" }, { "api_name": "aiohttp.ClientSession", "line_number": 39, "usage_type": "name" }, { "api_name": "const.CULLIGAN_APP_ID", "line_number": 39, "usage_type": "name" }, { "api_name": "typing.Op...
38938274806
from contextlib import suppress from .utils import ( sap_hana, df, ) from .agent_based_api.v1 import ( register, Service, Result, State as state, get_value_store, ) from .agent_based_api.v1.type_defs import ( DiscoveryResult, StringTable, CheckResult, Parameters, ) def pa...
superbjorn09/checkmk
cmk/base/plugins/agent_based/sap_hana_data_volume.py
sap_hana_data_volume.py
py
3,083
python
en
code
null
github-code
1
[ { "api_name": "agent_based_api.v1.type_defs.StringTable", "line_number": 23, "usage_type": "name" }, { "api_name": "utils.sap_hana.ParsedSection", "line_number": 24, "usage_type": "attribute" }, { "api_name": "utils.sap_hana", "line_number": 24, "usage_type": "name" }, ...
15674132526
# -*- coding: utf-8 -*- # karaoke sampler v.1.0 import sys #reload(sys) #sys.setdefaultencoding('utf-8') #reload(sys) #sys.setdefaultencoding('utf8') import webbrowser from samplerPlayer import samplerPlayer from karaokesampler import karaokesampler from tools.GUIutils import GUIutils import json import cv2 i...
carlitoselmago/karaokeSampler
src/main.py
main.py
py
4,399
python
en
code
0
github-code
1
[ { "api_name": "tools.GUIutils.GUIutils", "line_number": 28, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 32, "usage_type": "call" }, { "api_name": "logging.ERROR", "line_number": 33, "usage_type": "attribute" }, { "api_name": "flask.Fl...
40508376516
import requests from tqdm import tqdm from subprocess import Popen def _download_file(url, destination): r = requests.get(url, stream=True) # Total size in bytes. total_size = int(r.headers.get("content-length", 0)) block_size = 1024 # 1 Kibibyte t = tqdm(total=total_size, unit="iB", unit_scale...
acannistra/landwatch
landwatch/get/util.py
util.py
py
765
python
en
code
6
github-code
1
[ { "api_name": "requests.get", "line_number": 7, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 13, "usage_type": "call" }, { "api_name": "subprocess.Popen", "line_number": 30, "usage_type": "call" } ]
132017384
""" Kafka Collector Bot Collects information from the Apache Kafka distributed stream processing system. Args: topic (str): topic to collect information from bootstrap_servers (str): the ‘host[:port]’ string of the Apache Kafka system. Defaults to `localhost:9092` """ from intelmq.lib.bot import CollectorBot...
jem0101/BigSwag-SQA2022-AUBURN
TestOrchestrator4ML-main/resources/Data/supervised/GITHUB_REPOS/certtools@intelmq/intelmq/bots/collectors/kafka/collector.py
collector.py
py
2,178
python
en
code
2
github-code
1
[ { "api_name": "intelmq.lib.bot.CollectorBot", "line_number": 20, "usage_type": "name" }, { "api_name": "intelmq.lib.exceptions.MissingDependencyError", "line_number": 24, "usage_type": "call" }, { "api_name": "kafka.KafkaConsumer", "line_number": 43, "usage_type": "call" ...
7696267710
import requests as requests from API.base_api import BaseApi class WeWork(BaseApi): corpid = "wwf55a566b6d1c6bd3" contact_secret = "lsgkRCZorU9MLTU7h-f7s0NsC_AJYoc9z7jWzwW2JlQ" token = dict() token_url = "https://qyapi.weixin.qq.com/cgi-bin/gettoken" @classmethod def get_token(cls, secret=co...
shadingyu96/apiautotest
API/wework.py
wework.py
py
724
python
en
code
0
github-code
1
[ { "api_name": "API.base_api.BaseApi", "line_number": 6, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 22, "usage_type": "call" } ]
43361748288
#coding:utf-8 from __future__ import print_function import os import sys # sys.path.append('../') import time import cv2 # import rospy import math import pickle import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as patches import matplotlib.animation as animation import matplotlib.image as m...
mkwork22/CarlaDataPreprocessor
output_sim_images.py
output_sim_images.py
py
15,170
python
en
code
0
github-code
1
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 41, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 41, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 49, "usage_type": "call" }, { "api_name": "m...
1908192107
import tkinter as tk import tkmacosx as tkmac from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg from matplotlib.figure import Figure from display_cube import plot_cube import cube_moves as cm import time import copy def virtual_cube(master=None): """ Provides a virtual interface for cube solving...
gaurav-behera/virtual-rubiks-cube
rubiks_cube/virtual_cube.py
virtual_cube.py
py
6,875
python
en
code
0
github-code
1
[ { "api_name": "copy.deepcopy", "line_number": 18, "usage_type": "call" }, { "api_name": "cube_moves.solved_state", "line_number": 18, "usage_type": "attribute" }, { "api_name": "tkinter.Frame", "line_number": 22, "usage_type": "call" }, { "api_name": "tkinter.Fram...
7535284663
import json from database import get_cart_by_id, set_cart_to_user import logging log = logging.getLogger(__name__) class Cart: def __init__(self, chat_id): self.chat_id = chat_id self.items = self.get_items_by_id() def add_item(self, item): item = list(item) item_id = str(ite...
1mpossible-code/avarice
classes/cart.py
cart.py
py
1,256
python
en
code
23
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 5, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 26, "usage_type": "call" }, { "api_name": "database.get_cart_by_id", "line_number": 29, "usage_type": "call" }, { "api_name": "json.loads", ...
71874354595
# -*- coding: utf-8 -*- """ @author: Stefan Mejlgaard """ import itertools import math def num_digits(number: int) -> int: """Return the number of digits in `number`""" return int(math.log10(number) + 1) def find_digits(positions: list[int]) -> list[int]: positions_iter = iter(positions) position =...
connesy/ProjectEuler
python/problem040/problem040.py
problem040.py
py
960
python
en
code
0
github-code
1
[ { "api_name": "math.log10", "line_number": 12, "usage_type": "call" }, { "api_name": "itertools.count", "line_number": 21, "usage_type": "call" }, { "api_name": "math.prod", "line_number": 41, "usage_type": "call" } ]
43467564915
from bs4 import BeautifulSoup import re import pandas as pd import time def getCarInfo(pagina): doc = BeautifulSoup(pagina, "html.parser") year_td = doc.find_all(["td"], bgcolor="#ffffff") for td in year_td: print(td.get_text()) '''year = year_td.find_next_sibling('td').get_...
Sankhay/Estudos
Python/selenium/getCarInfo.py
getCarInfo.py
py
23,229
python
pt
code
0
github-code
1
[ { "api_name": "bs4.BeautifulSoup", "line_number": 7, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 177, "usage_type": "call" } ]
25888659781
import datetime from typing import Any, Optional, Union from django.db import models dt_format = "%Y-%m-%d %H:%M:%S.%f" class TimestampField(models.CharField): def __init__(self, *args: Optional[Any], **kwargs: Optional[Any]): kwargs['max_length'] = 50 super(TimestampField, self).__init__(*args,...
ruler501/multipoll
multipoll/models/fields/timestamp.py
timestamp.py
py
1,802
python
en
code
0
github-code
1
[ { "api_name": "django.db.models.CharField", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 9, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 10, "usage_type": "name" }, { "api_name": "typing...
31475727911
from bs4 import BeautifulSoup import lxml import requests res = requests.get("https://web.archive.org/web/20200518073855/https://www.empireonline.com/movies/features/best-movies-2/") res.raise_for_status() soup = BeautifulSoup(res.text, "lxml") titles = soup.select(selector="h3[class='title']") titles_text = "" for...
csukel/100_days_of_code
Day45/top-100-movies/main.py
main.py
py
489
python
en
code
0
github-code
1
[ { "api_name": "requests.get", "line_number": 6, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 9, "usage_type": "call" } ]
40133379850
# suggestions.py # Code to handle submitting and reviewing suggestions. # Author: wHo#6933 # Plans: # 1. Submit suggestion command # 2. List pending suggestions command # 3. Accept/Decline suggestions command # Json format: # { # "id" (int): { # "user": userId (int), # "suggestion": suggestion (str) # ...
notbowen/CTSSBot
cogs/Suggestions/suggestions.py
suggestions.py
py
6,644
python
en
code
0
github-code
1
[ { "api_name": "discord.ext.commands.Cog", "line_number": 33, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 33, "usage_type": "name" }, { "api_name": "functions.readSuggestions", "line_number": 45, "usage_type": "call" }, { "api_...
26975726274
#!/usr/bin/python3 import sys import argparse import hmac import http import urllib from urllib import parse from http import client as httpclient parser = argparse.ArgumentParser() parser.add_argument('url') parser.add_argument('secret') args = parser.parse_args() payload = sys.stdin.read().encode() secret = args.s...
lexbailey/isabelle-theory-build-github-action
signed_post.py
signed_post.py
py
1,035
python
en
code
0
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.stdin.read", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 15, "usage_type": "attribute" }, { "api_name": "hmac.new", ...
29281970870
from collections import defaultdict import csv import gzip import itertools from pathlib import Path import tqdm from repodb.common import logger from repodb.classes.nodes.disorder import Disorder from repodb.classes.nodes.gene import Gene from repodb.classes.edges.gene_associated_with_disorder import ( GeneAssoc...
repotrial/nedrex
nedrex/parsers/disgenet.py
disgenet.py
py
2,920
python
en
code
0
github-code
1
[ { "api_name": "pathlib.Path", "line_number": 18, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 24, "usage_type": "call" }, { "api_name": "repodb.classes.nodes.disorder.Disorder.objects", "line_number": 25, "usage_type": "call" }, { ...
17847426563
import StringIO from datetime import timedelta from twisted.trial import unittest from twisted.internet import defer, error from twisted.mail import pop3 from twisted.cred import error as ecred from epsilon import structlike, extime from epsilon.test import iosim from axiom import store from xquotient import gra...
rcarmo/divmod.org
Quotient/xquotient/test/test_grabber.py
test_grabber.py
py
12,582
python
en
code
10
github-code
1
[ { "api_name": "StringIO.StringIO", "line_number": 20, "usage_type": "attribute" }, { "api_name": "epsilon.extime.Time", "line_number": 29, "usage_type": "call" }, { "api_name": "epsilon.extime", "line_number": 29, "usage_type": "name" }, { "api_name": "xquotient.m...
23531939947
""" +===============================+ ╦ ╦ ╔═╗ ╔╗╔ ╔═╗ ╔═╗ ╔╦╗ ╠═╣ ║ ║ ║║║ ║╣ ╚═╗ ║ ╩ ╩ ╚═╝ ╝╚╝ ╚═╝ ╚═╝ ╩ MARKET - PEGGED - ASSETS +===============================+ called by pricefeed_final.py to upload data matrix for HONEST MPA's to jsonbin.io if you run this script solo it will create a...
litepresence/Honest-MPA-Price-Feeds
honest/jsonbin.py
jsonbin.py
py
2,994
python
en
code
8
github-code
1
[ { "api_name": "config_apikeys.config_apikeys", "line_number": 32, "usage_type": "call" }, { "api_name": "config_apikeys.config_apikeys", "line_number": 34, "usage_type": "call" }, { "api_name": "requests.put", "line_number": 77, "usage_type": "call" }, { "api_name...
71096893793
from linebot import ( LineBotApi, WebhookHandler ) from linebot.exceptions import ( InvalidSignatureError ) from linebot.models import (ButtonsTemplate, PostbackAction, TemplateSendMessage) import shutil import testcount line_bot_api = LineBotApi('g40p1VQDlWGVMHyMd7pL2kZXGj/Qxx0g35zTCf7+NhIN/cUm/...
AliesFY/LALALA
pythonfile/recipi.py
recipi.py
py
5,306
python
en
code
0
github-code
1
[ { "api_name": "linebot.LineBotApi", "line_number": 13, "usage_type": "call" }, { "api_name": "linebot.WebhookHandler", "line_number": 14, "usage_type": "call" }, { "api_name": "testcount.select_count", "line_number": 22, "usage_type": "attribute" }, { "api_name": ...
25015472158
from typing import Optional, Dict, Any import pendulum from geopy.distance import distance as geopy_distance from src.data_models import Configuration def add_calculated_fields(*, current_item: Dict[str, Any], initial_status, current_statu...
krezac/tesla-race-analyzer
src/data_processor/calculated_fields_status.py
calculated_fields_status.py
py
2,822
python
en
code
1
github-code
1
[ { "api_name": "typing.Dict", "line_number": 9, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 9, "usage_type": "name" }, { "api_name": "src.data_models.Configuration", "line_number": 17, "usage_type": "name" }, { "api_name": "typing.Optional", ...
16385188379
from flask import jsonify from . import app from .models import DBManager ############## VISTAS API @app.route("/api/v1/movimientos") def listar_movimientos(): try: # db = DBManager(app.config.get("RUTA")) """ Hace excepcion para la configuracion tomar el dato en vez de con GET, s...
RamiroCovian/flask-api
balance/api.py
api.py
py
2,516
python
es
code
0
github-code
1
[ { "api_name": "models.DBManager", "line_number": 17, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 27, "usage_type": "call" }, { "api_name": "models.DBManager", "line_number": 44, "usage_type": "call" }, { "api_name": "flask.jsonify", "...
17244409261
import sys import shapefile from .utils import Command, FeatureLoader, create_connection, filename_to_table_name def shp_field_to_sql_type(field): if field[1] == "L": return "INTEGER" if field[1] == "F": return "FLOAT" if field[1] == "N": if field[3] == 0: return "INT...
chris48s/geometry-to-spatialite
geometry_to_spatialite/shapefile.py
shapefile.py
py
2,579
python
en
code
12
github-code
1
[ { "api_name": "utils.create_connection", "line_number": 56, "usage_type": "call" }, { "api_name": "shapefile.Reader", "line_number": 57, "usage_type": "call" }, { "api_name": "utils.filename_to_table_name", "line_number": 63, "usage_type": "call" }, { "api_name": ...
27818070176
import time import struct import pickle import random import socket import builtins from copy import deepcopy from threading import Thread, Lock import queue from utils import NoSocketCreated, ConnectionNotEstablished, HandshakeFailure, CONNECTION_STATES, MESSAGE_TYPES class Packet: def __init__(self, message_ty...
karthikrangasai/MONKE-Protocol
monke/monke.py
monke.py
py
11,197
python
en
code
0
github-code
1
[ { "api_name": "struct.pack", "line_number": 66, "usage_type": "call" }, { "api_name": "socket.socket", "line_number": 93, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 93, "usage_type": "attribute" }, { "api_name": "socket.SOCK_DGRAM", ...
3031853440
import matplotlib.pyplot as plt def plot_indicators_empirical_analysis(all_sorted_intervals): """ :param all_sorted_intervals: all created time intervals """ spam_x = [] spam_y = [] non_x = [] non_y = [] counter = 0 for interval in all_sorted_intervals: if ...
SandraSukarieh/SPRAP
SPRAP/plotting_functions.py
plotting_functions.py
py
700
python
en
code
0
github-code
1
[ { "api_name": "matplotlib.pyplot.scatter", "line_number": 25, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 25, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.scatter", "line_number": 26, "usage_type": "call" }, { "api_name": ...
16874515340
#!/usr/bin/env python3 import csv import glob import warnings from typing import List, Tuple from KaSaAn.core import KappaSnapshot def find_snapshots(directory: str, prefix: str) -> List[str]: """Get the file names of snapshots in specified directory that fit the pattern [dir][prefix][number].ka""" if direct...
yarden/KaSaAn
KaSaAn/functions/prefixed_snapshot_analyzer.py
prefixed_snapshot_analyzer.py
py
4,996
python
en
code
null
github-code
1
[ { "api_name": "glob.glob", "line_number": 14, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 18, "usage_type": "name" }, { "api_name": "KaSaAn.core.KappaSnapshot", "li...
4825182294
import requests from flask import Flask, render_template from bs4 import BeautifulSoup file = "kari-sakib-lab-report.txt" url = "https://climate.nasa.gov/effects/" def convert_tag_to_str_list(lst): new_lst = [] for i in lst: new_lst.append(str(i)) return new_lst def scraper(url): r = requests...
karisakib/flask_project
app.py
app.py
py
1,194
python
en
code
0
github-code
1
[ { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 16, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 33, "usage_type": "call" }, { "api_name": "flask.render_template", ...
38612962346
# https://www.youtube.com/watch?v=g7KoOUu4v7Q - followed along with this video # https://drive.google.com/drive/folders/0BwDJQBs1OukNOEtwNlBxUkVlcFk - images and scripts import sys import random import math import pygame import pygame.gfxdraw from pygame.locals import * pygame.init() CLOCK = pygame.time.Clock() # ...
DLopez6877/pgyame-animation
cat_animation.py
cat_animation.py
py
2,465
python
en
code
0
github-code
1
[ { "api_name": "pygame.init", "line_number": 12, "usage_type": "call" }, { "api_name": "pygame.time.Clock", "line_number": 14, "usage_type": "call" }, { "api_name": "pygame.time", "line_number": 14, "usage_type": "attribute" }, { "api_name": "pygame.display.set_mod...
16567540614
#coding:utf8 from flask import Flask,make_response,request app = Flask(__name__) @app.route('/cookie') def set_cookie(): response = make_response('cookie设置成功') response.set_cookie("name", 'zhang') return response if __name__ == '__main__': app.run(debug=True)
1071183139/biji
2_框架/1_flask框架/1_flask的基本使用/10_设置cookie.py
10_设置cookie.py
py
288
python
en
code
0
github-code
1
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.make_response", "line_number": 10, "usage_type": "call" } ]
18941046142
from django.shortcuts import render from accounts.models import Team # Create your views here. def dashboard(request): context = { } return render(request, 'accounts/dashboard.html', context) def create_team(request): if request.POST: name = request.POST['name'] members = request.POST['...
jabguru/interswitch-mind
accounts/views.py
views.py
py
588
python
en
code
0
github-code
1
[ { "api_name": "django.shortcuts.render", "line_number": 7, "usage_type": "call" }, { "api_name": "accounts.models.Team.objects.create", "line_number": 15, "usage_type": "call" }, { "api_name": "accounts.models.Team.objects", "line_number": 15, "usage_type": "attribute" ...
42744794274
#!/usr/bin/env python # coding: utf-8 # In[1]: import tensorflow as tf from tensorflow.keras.datasets import imdb (train_data, train_labels), (test_data, test_labels) = imdb.load_data(num_words=10000) # In[27]: class myCallback(tf.keras.callbacks.Callback): def on_epoch_end(self, epoch, logs={}): if(...
shahmeerrajput/WorkOnTensorflowNmpyPandas
IMDB DATASET.py
IMDB DATASET.py
py
2,624
python
en
code
0
github-code
1
[ { "api_name": "tensorflow.keras.datasets.imdb.load_data", "line_number": 9, "usage_type": "call" }, { "api_name": "tensorflow.keras.datasets.imdb", "line_number": 9, "usage_type": "name" }, { "api_name": "tensorflow.keras", "line_number": 15, "usage_type": "attribute" }...
11177776005
import os from selenium import webdriver import random import time from selenium.webdriver.chrome.options import Options from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By from selenium.webdriver.common.act...
dr11m/steamSkins
ScriptsForDiffPlatforms/steamMakeOrders.py
steamMakeOrders.py
py
30,363
python
en
code
2
github-code
1
[ { "api_name": "datetime.datetime.now", "line_number": 28, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 28, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 72, "usage_type": "call" }, { "api_name": "sys.exc_info", ...
965185620
import openpyxl VOLUNTEER_NUMBER = 1 VOLUNTEER_FIRST_NAME= 2 VOLUNTEER_LAST_NAME= 3 VOLUNTEER_EMAIL = 4 VOLUNTEER_HOUR= 5 VOLUNTEER_POSITION = 6 VOLUNTEER_COMMENT = 7 VOLUNTEER_CERT_LOC = 8 class VolunteerExcelFile: """ VolunteerExcelFile Class """ def __init__(self, filename:...
jasonwei0224/Volunteer_Certificate_Generator
ca/jason/pdfgenerator/VolunteerExcelFile.py
VolunteerExcelFile.py
py
2,223
python
en
code
0
github-code
1
[ { "api_name": "openpyxl.load_workbook", "line_number": 35, "usage_type": "call" } ]
24667117253
from forta_agent import Finding, FindingType, FindingSeverity, Network from src.detectors import processContract import rlp from datetime import datetime, timedelta from web3 import Web3 cache = [] def calc_contract_address(address, nonce): address_bytes = bytes.fromhex(address[2:].lower()) return Web3.toChe...
Sapo-Dorado/FortaKnight
src/agent.py
agent.py
py
1,747
python
en
code
2
github-code
1
[ { "api_name": "web3.Web3.toChecksumAddress", "line_number": 12, "usage_type": "call" }, { "api_name": "web3.Web3", "line_number": 12, "usage_type": "name" }, { "api_name": "web3.Web3.keccak", "line_number": 12, "usage_type": "call" }, { "api_name": "rlp.encode", ...
14283289627
import requests from tests.helpers import NetworkTest import time CONTROLLER = '127.0.0.1' KYTOS_API = 'http://%s:8181/api' % CONTROLLER class TestE2ESDNTraceInvertedCircuit: net = None circuit = None @staticmethod def setup_class(cls): """run at the beginning for all tests""" cls.net ...
Alsn2200/tests-kytos-
tests/test_e2e_200_sdntrace.py
test_e2e_200_sdntrace.py
py
4,307
python
en
code
0
github-code
1
[ { "api_name": "tests.helpers.NetworkTest", "line_number": 14, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 42, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 47, "usage_type": "call" }, { "api_name": "requests.post", ...
34266333830
import torch import torch.nn as nn import torch.nn.functional as F import math import time def timeit(x, func, iter=10): torch.cuda.synchronize() start = time.time() for _ in range(iter): y = func(x) torch.cuda.synchronize() runtime = (time.time()-start)/iter return runtime class HOG...
YutingXiao/Amodal-Segmentation-Based-on-Visible-Region-Segmentation-and-Shape-Prior
hoglayer.py
hoglayer.py
py
5,424
python
en
code
40
github-code
1
[ { "api_name": "torch.cuda.synchronize", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 9, "usage_type": "attribute" }, { "api_name": "time.time", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.cuda.synchronize...
3292374645
import os import os.path as osp import argparse import numpy as np import pandas as pd from tqdm import tqdm from sklearn import metrics import torch from dataset import create_data_loader, preprocess_df from model import ClassificationModel from utils import set_seeds, load_config, str2bool def inference(model, te...
DeepVisionStudy/dacon_breast_cancer
infer.py
infer.py
py
5,359
python
en
code
0
github-code
1
[ { "api_name": "model.eval", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.no_grad", "line_number": 20, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.sigmoid", "line_number":...
15222580959
import numpy as np import pickle from abc import ABC from keras.layers import Input, Dense, TimeDistributed from keras.layers import LeakyReLU, Dropout, Bidirectional from keras.layers import GRU, LSTM from keras.models import Model from keras.models import load_model from modules.constants import Constants from modu...
chandraseta/paparazzi-id
modules/summarizer/models.py
models.py
py
8,605
python
en
code
2
github-code
1
[ { "api_name": "abc.ABC", "line_number": 18, "usage_type": "name" }, { "api_name": "numpy.ndarray", "line_number": 23, "usage_type": "attribute" }, { "api_name": "modules.constants.Constants.MODEL_PATH", "line_number": 30, "usage_type": "attribute" }, { "api_name":...
13352323669
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import json import logging import numpy as np import os import uuid from pycocotools.cocoeval import COCOeval from pycocotools import mask as COCOmask from core.config ...
Min-Sheng/CA_FSIS_Cell
lib/datasets/fis_cell_evaluator.py
fis_cell_evaluator.py
py
23,521
python
en
code
0
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path", "line_number": 30, "usage_type": "attribute" }, { "api_name": "uuid.uuid4", "line_nu...
24843804603
"""Helper functions for decoding analysis.""" import warnings warnings.simplefilter(action='ignore', category=FutureWarning) warnings.simplefilter(action='ignore', category=DeprecationWarning) import os from pathlib import Path import numpy as np from scipy import stats from sklearn.pipeline import make_pipeline fro...
Cogitate-consortium/cogitate-msp1
coglib/ieeg/decoding/decoding_helper_functions.py
decoding_helper_functions.py
py
39,193
python
en
code
0
github-code
1
[ { "api_name": "warnings.simplefilter", "line_number": 3, "usage_type": "call" }, { "api_name": "warnings.simplefilter", "line_number": 4, "usage_type": "call" }, { "api_name": "matplotlib.rc", "line_number": 41, "usage_type": "call" }, { "api_name": "numpy.sum", ...
14751220428
''' A set of utility methods that are used in different parts of the framework. ''' import logging # Set of bots read from a bot tsv file bots = None filterBots = False def setFilterBots(fb,botfile): global filterBots,bots if fb: try: bots = set(long(bot) for bot in open(botfile,'r')...
declerambaul/WikiPride
src/utils.py
utils.py
py
6,973
python
en
code
9
github-code
1
[ { "api_name": "logging.info", "line_number": 18, "usage_type": "call" }, { "api_name": "logging.error", "line_number": 20, "usage_type": "call" }, { "api_name": "calendar.monthrange", "line_number": 93, "usage_type": "call" }, { "api_name": "calendar.monthrange", ...
40930647516
from django.db import models ###################################################################################################################### class Status(models.Model): id = models.AutoField( primary_key=True, ) title = models.CharField( verbose_name='Название стадии', max_...
joinc/SupportCenter
Contract/models.py
models.py
py
4,741
python
en
code
0
github-code
1
[ { "api_name": "django.db.models.Model", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 6, "usage_type": "name" }, { "api_name": "django.db.models.AutoField", "line_number": 7, "usage_type": "call" }, { "api_name": "...
18176472651
import os import shutil import pickle import pandas as pd from sklearn.cluster import KMeans #pd.set_option('display.max_colwidth', -1) DATA_PATH = "../ML_data" target = os.path.join(DATA_PATH, "target.csv") fp = os.path.join(DATA_PATH, "fp_folded.csv") y = pd.read_csv(target, index_col = "index") y = y.loc[(y[...
paulzierep/NP_epitope_predictor
tool/scripts/helper.py
helper.py
py
4,423
python
en
code
0
github-code
1
[ { "api_name": "os.path.join", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 1...
25072147771
import os from bs4 import BeautifulSoup from selenium import webdriver from selenium.webdriver.chrome.service import Service from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.ui import WebDriverWait class scrapebook(): ...
Husseinmdarman/BookContentToYoutubeVideos
secondary.py
secondary.py
py
1,995
python
en
code
0
github-code
1
[ { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 11, "usage_type": "call" }, { "api_name": "selenium.webdriver.Edge", "li...
23152647258
import json import random from typing import Optional import discord from discord import app_commands from discord.ui import Button, View from pydantic import ValidationError from client import TextToImageClient from enums import ErrorMessage, ErrorTitle, ModelEnum, ResponseStatusEnum, SchedulerType, WarningMessages ...
ainize-team/TTI-Bot
src/bot.py
bot.py
py
22,255
python
en
code
3
github-code
1
[ { "api_name": "discord.Object", "line_number": 30, "usage_type": "call" }, { "api_name": "settings.discord_bot_settings.guild_id", "line_number": 30, "usage_type": "attribute" }, { "api_name": "settings.discord_bot_settings", "line_number": 30, "usage_type": "name" }, ...
2065842249
"""Module for ingesting quotes from PDF files.""" import os import subprocess from typing import List import tempfile from .IngestorInterface import IngestorInterface from .QuoteModel import QuoteModel class PDFIngestor(IngestorInterface): """Ingestor for parsing quotes from PDF files. This c...
NgoDuyVu1993/Advance_Python_Udacity_Ass2
QuoteEngine/PDFIngestor.py
PDFIngestor.py
py
1,945
python
en
code
0
github-code
1
[ { "api_name": "IngestorInterface.IngestorInterface", "line_number": 12, "usage_type": "name" }, { "api_name": "tempfile.NamedTemporaryFile", "line_number": 39, "usage_type": "call" }, { "api_name": "subprocess.run", "line_number": 40, "usage_type": "call" }, { "ap...
35131155384
''' The following codes are from https://github.com/d-li14/mobilenetv2.pytorch ''' import os import torch import numpy as np from torchvision import datasets from torchvision import transforms DATA_BACKEND_CHOICES = ['pytorch'] try: from nvidia.dali.plugin.pytorch import DALIClassificationIterator from nvidia...
snudm-starlab/FALCON2
src/imagenetutils/dataloaders.py
dataloaders.py
py
14,404
python
en
code
40
github-code
1
[ { "api_name": "nvidia.dali.pipeline.Pipeline", "line_number": 23, "usage_type": "name" }, { "api_name": "torch.distributed.is_initialized", "line_number": 40, "usage_type": "call" }, { "api_name": "torch.distributed", "line_number": 40, "usage_type": "attribute" }, { ...
20158053259
import math from torch.optim.lr_scheduler import _LRScheduler class CosineAnnealingWarmUpRestarts(_LRScheduler): r"""Set the learning rate of each parameter group using a cosine annealing schedule, where :math:`\eta_{max}` is set to the initial lr, :math:`T_{cur}` is the number of epochs since the last res...
SangHunHan92/2K2K
utils/scheduler.py
scheduler.py
py
6,051
python
en
code
170
github-code
1
[ { "api_name": "torch.optim.lr_scheduler._LRScheduler", "line_number": 4, "usage_type": "name" }, { "api_name": "math.cos", "line_number": 63, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 63, "usage_type": "attribute" }, { "api_name": "math.log",...