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
30426823111
import json from logging import StreamHandler, Formatter, getLogger import traceback class FormatterJSON(Formatter): def format(self, record): if self.usesTime(): record.asctime = self.formatTime(record, self.datefmt) j = { 'logLevel': record.levelname, 'process...
n4cl/logging_template
logging/logger.py
logger.py
py
1,741
python
en
code
0
github-code
7
[ { "api_name": "logging.Formatter", "line_number": 6, "usage_type": "name" }, { "api_name": "traceback.format_exc", "line_number": 23, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 25, "usage_type": "call" }, { "api_name": "logging.getLogger", ...
42901100933
import requests import random from django.shortcuts import get_list_or_404, get_object_or_404 from rest_framework import status from rest_framework.response import Response from rest_framework.decorators import api_view, permission_classes from rest_framework.permissions import IsAuthenticated from accounts.models im...
JoonHeeSeo/movie_community_webservice
final-pjt-back/movies/views.py
views.py
py
10,688
python
en
code
0
github-code
7
[ { "api_name": "django.shortcuts.get_list_or_404", "line_number": 22, "usage_type": "call" }, { "api_name": "models.Movie", "line_number": 22, "usage_type": "argument" }, { "api_name": "serializers.MovieSerializer", "line_number": 23, "usage_type": "call" }, { "api...
36249677865
# task 1.2.1 from https://stepik.org/course/1547/syllabus from collections import deque def is_correct_brackets(cur: str, prev: str) -> bool: cur_prev_correct_brackets = { ']': '[', '}': '{', ')': '(', } return cur_prev_correct_brackets[cur] == prev def check(text: str) -> int: ...
alena-bartosh/stepic-courses
data_structures/week_1/brackets_in_text.py
brackets_in_text.py
py
1,531
python
en
code
1
github-code
7
[ { "api_name": "collections.deque", "line_number": 16, "usage_type": "call" } ]
3759782492
import pygame as pg import random, math # retuns the max radius for a circle on a point def max_radius(x, y): # distance to x borders max_x = 0 if x > screen_size/2: max_x = screen_size/2-(x-screen_size/2) else: max_x = x # distance to y borders max_y = 0 if y > screen_size/2: max_y = scr...
leschi4banane/Circle-Packing
main.py
main.py
py
2,129
python
en
code
0
github-code
7
[ { "api_name": "math.hypot", "line_number": 21, "usage_type": "call" }, { "api_name": "math.ceil", "line_number": 25, "usage_type": "call" }, { "api_name": "math.hypot", "line_number": 28, "usage_type": "call" }, { "api_name": "pygame.init", "line_number": 31, ...
23167481563
import binascii import hashlib from base64 import b64decode import requests from pkcs7 import PKCS7Encoder from Crypto.Cipher import AES from Crypto import Random from Crypto.PublicKey import RSA from Crypto.Cipher import PKCS1_v1_5 from Crypto.Signature import PKCS1_v1_5 as PKCS_sign from Crypto.Hash import SHA MODE...
adrianlzt/vaultier_python_client
vaultier.py
vaultier.py
py
7,201
python
en
code
0
github-code
7
[ { "api_name": "Crypto.Cipher.AES.MODE_CBC", "line_number": 14, "usage_type": "attribute" }, { "api_name": "Crypto.Cipher.AES", "line_number": 14, "usage_type": "name" }, { "api_name": "hashlib.new", "line_number": 31, "usage_type": "call" }, { "api_name": "hashlib...
23431179668
import json import requests import uuid import json import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) def poster(): url = "https://localhost:9200/uuid_index/_doc" toAdd = str(uuid.uuid4()) payload = json.dumps({ "value" : toAdd }) headers = { 'Aut...
Nikzy7/fastapi-test
uuidPoster.py
uuidPoster.py
py
644
python
en
code
0
github-code
7
[ { "api_name": "urllib3.disable_warnings", "line_number": 7, "usage_type": "call" }, { "api_name": "urllib3.exceptions", "line_number": 7, "usage_type": "attribute" }, { "api_name": "uuid.uuid4", "line_number": 12, "usage_type": "call" }, { "api_name": "json.dumps"...
71447347424
"""调试项目""" from os import environ from uvicorn import run if __name__ == "__main__": # 环境变量 with open(__file__.replace("dev.py", ".env")) as env: env_t = env.read() for i in env_t.split("\n"): key, val = i.split("=") environ[key] = val # trace/info/warning/error ...
303u/bbs
backend/dev.py
dev.py
py
384
python
en
code
10
github-code
7
[ { "api_name": "os.environ", "line_number": 12, "usage_type": "name" }, { "api_name": "uvicorn.run", "line_number": 15, "usage_type": "call" } ]
38127698763
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="sciler", version="0.2.2", author="Raccoon Serious Games", author_email="BEP@raccoon.games", description="Client library for S.C.I.L.E.R.", long_description=long_description, long_d...
IssaHanou/BEP_1920_Q2
cc_library/py_scc/setup.py
setup.py
py
715
python
en
code
1
github-code
7
[ { "api_name": "setuptools.setup", "line_number": 6, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 15, "usage_type": "call" } ]
72849884702
import torch if torch.__version__ >= "1.8": import torch_npu import sys import os import random import argparse import apex import numpy as np import torch.backends.cudnn as cudnn import torchvision.models as models from models.inception_resnet_v1 import InceptionResnetV1 from models.mtcnn import MTCNN, fixed_image...
Ascend/ModelZoo-PyTorch
PyTorch/built-in/cv/classification/FaceNet_for_PyTorch/fine_tune_new.py
fine_tune_new.py
py
8,062
python
en
code
31
github-code
7
[ { "api_name": "torch.__version__", "line_number": 2, "usage_type": "attribute" }, { "api_name": "torchvision.models.__dict__", "line_number": 22, "usage_type": "attribute" }, { "api_name": "torchvision.models", "line_number": 22, "usage_type": "name" }, { "api_nam...
25584664544
import json, sys def checkArgs(): if len(sys.argv) != 3: print("Usage: db_lyricsRebuilder.py [inputfile.json] [outputfile.json]") else: return [sys.argv[1], sys.argv[2]] def callData(inputfile): try: inFile = open(inputfile, "r") inData = json.load(inFile) inFile....
saltchang/caten-music
data_app/dataBuilder/db_lyricsRebuilder.py
db_lyricsRebuilder.py
py
995
python
en
code
8
github-code
7
[ { "api_name": "sys.argv", "line_number": 4, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 7, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 13, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 4...
12506064633
import re import xml.dom.minidom from bs4 import BeautifulSoup from nltk.tree import * import nltk.stem as ns from stanfordcorenlp import StanfordCoreNLP from sklearn.feature_extraction.text import CountVectorizer from sklearn.decomposition import LatentDirichletAllocation from sklearn.model_selection import GridSearc...
nli2code/sf_extactor
sf_extracor.py
sf_extracor.py
py
6,840
python
en
code
0
github-code
7
[ { "api_name": "nltk.stem.WordNetLemmatizer", "line_number": 10, "usage_type": "call" }, { "api_name": "nltk.stem", "line_number": 10, "usage_type": "name" }, { "api_name": "xml.dom.minidom.dom.minidom.parse", "line_number": 59, "usage_type": "call" }, { "api_name"...
11858484845
''' Expenditure On Books : 1996-1997 1997-98 Economis - 5200 Econimics - 8000 Commerce - 10000 Commerce - 14000 Math - 5000 Math - 7000 Language - 6000 Language - 6000 ...
SourinDas2000/Expenditure-on-books
Expenditure On Books.py
Expenditure On Books.py
py
1,049
python
en
code
0
github-code
7
[ { "api_name": "matplotlib.pyplot.style.use", "line_number": 18, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 18, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 18, "usage_type": "name" }, { "api_na...
37628216877
import pandas as pd import numpy as np from tqdm import tqdm def read_data(path,qid=False): """ 读取csv文件 :param path: :param qid: True or False,为False时不保留qid这一行 :return: """ data_df = pd.read_csv(path, sep="\t") # data_df.drop(["qid"], axis=1) data = np.array(data_df).tolist() if ...
activemodest/DIAC
result_ensemble.py
result_ensemble.py
py
3,664
python
en
code
35
github-code
7
[ { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 42, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_nu...
41615767872
import numpy as np import matplotlib.pyplot as plt import sklearn.datasets import sklearn.preprocessing import sklearn.neural_network import sklearn.model_selection numeros = sklearn.datasets.load_digits() imagenes = numeros['images'] # Hay 1797 digitos representados en imagenes 8x8 n_imagenes = len(imagenes) X = im...
TmsRC/RubioTomas_Ejercicio22
mlp_digitos.py
mlp_digitos.py
py
1,934
python
en
code
0
github-code
7
[ { "api_name": "sklearn.datasets.datasets.load_digits", "line_number": 9, "usage_type": "call" }, { "api_name": "sklearn.datasets.datasets", "line_number": 9, "usage_type": "attribute" }, { "api_name": "sklearn.datasets", "line_number": 9, "usage_type": "name" }, { ...
16417098813
from tkinter import * from tkinter import ttk from PIL import Image,ImageTk import db from tkinter import messagebox import validate_inputs class criminal: def __init__(self,root): self.root =root self.root.geometry("1530x790+100+100") self.root.title("Criminal Mangement Sys...
mustafaalhm/crime-mangment-system
criminal.py
criminal.py
py
22,378
python
en
code
0
github-code
7
[ { "api_name": "PIL.Image.open", "line_number": 47, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 47, "usage_type": "name" }, { "api_name": "PIL.Image.ANTIALIAS", "line_number": 48, "usage_type": "attribute" }, { "api_name": "PIL.Image", "li...
19464475928
# -*- coding: utf-8 -*- import re from mobile.sniffer.detect import detect_mobile_browser from mobile.sniffer.utilities import get_user_agent from zope.publisher.browser import BrowserView from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile _mobilePlatforms = r'android|blackberry|ip(hone|od|ad)|pa...
gitesdewallonie/alloch.skin
alloch/skin/browser/store.py
store.py
py
2,258
python
en
code
0
github-code
7
[ { "api_name": "re.compile", "line_number": 10, "usage_type": "call" }, { "api_name": "re.IGNORECASE", "line_number": 10, "usage_type": "attribute" }, { "api_name": "zope.publisher.browser.BrowserView", "line_number": 23, "usage_type": "name" }, { "api_name": "Prod...
13775820007
from cmath import exp from pickle import EXT2 import matplotlib.pyplot as plt import numpy as np import random from numpy import random pd=1/3 pr=1/3 pt=pr+pd measurements=int(1) ObservtionProbabilityFactor=float(0.005) iterations=int(10000000) TS=int(500) obsStLoc=[] obsStHalfRange=[] obsEtLoc=[] obsEtHalfRange=[...
tommyleonwood/SERD_MODEL
SERD model Python code/CreatingObservationExpEtvsTau/RandomObservation/RandomPointObservation.py
RandomPointObservation.py
py
8,891
python
en
code
0
github-code
7
[ { "api_name": "numpy.random.random", "line_number": 68, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 68, "usage_type": "name" }, { "api_name": "numpy.random.random", "line_number": 135, "usage_type": "call" }, { "api_name": "numpy.random", ...
42832430669
from datetime import datetime from django.http import HttpResponse from django.shortcuts import redirect, render from django.utils import timezone from .models import Player # Create your views here. def index(request): return render(request,"login.html") def logincheck(request): if request.method == 'POST': ...
kvssg123/Treasure-Hunt
game/views.py
views.py
py
6,278
python
en
code
0
github-code
7
[ { "api_name": "django.shortcuts.render", "line_number": 9, "usage_type": "call" }, { "api_name": "models.Player.objects.get", "line_number": 19, "usage_type": "call" }, { "api_name": "models.Player.objects", "line_number": 19, "usage_type": "attribute" }, { "api_n...
25733650105
import streamlit as st import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib matplotlib.use('Agg') import seaborn as sns def main(): st.title("Plotting with St.Pyplot") df = pd.read_csv("iris.csv") st.dataframe(df.head()) # prev method # df['species'].value_cou...
adityariyadi/learn-streamlit
app_pylot.py
app_pylot.py
py
926
python
en
code
0
github-code
7
[ { "api_name": "matplotlib.use", "line_number": 6, "usage_type": "call" }, { "api_name": "streamlit.title", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "streamlit.dataframe", ...
14203863563
from cryptography.fernet import Fernet from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import serialization, hashes from cryptography.hazmat.primitives.asymmetric import padding from common import list_files, show_pop_up, PRIVATE_ASYM_KEY_FILENAME, SYM_KEY_FILENAME import ...
LucasHaug/SegInfo
decrypt.py
decrypt.py
py
1,766
python
en
code
0
github-code
7
[ { "api_name": "os.path.dirname", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 11, "usage_type": "call" }, { "api_name": "cryptography.hazmat.prim...
12744826335
#!/usr/bin/python # __author__ = 'Cody Giles' # __license__ = "Creative Commons Attribution-ShareAlike 3.0 Unported License" # __version__ = "1.0" # __maintainer__ = "Cody Giles" # __status__ = "Production" # The first part of the script finds the device's network IP address # The second part of the script flashes th...
mn1del/rpi_cnc_img
ip_to_lcd/iptolcd.py
iptolcd.py
py
6,497
python
en
code
0
github-code
7
[ { "api_name": "datetime.date.today", "line_number": 42, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 42, "usage_type": "attribute" }, { "api_name": "subprocess.Popen", "line_number": 46, "usage_type": "call" }, { "api_name": "subprocess.PI...
7944580664
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Thu Feb 15 18:22:35 2018 @author: abinaya """ import numpy as np import matplotlib.pyplot as plt import pandas as pd from itertools import groupby, combinations import networkx as nx def returnBernoulliTrials(k, p): uniform_trials= np.random.uniform(s...
mcabinaya/Simulation-Methods-For-Stochastic-Systems
04-Networking-Part-2/main.py
main.py
py
1,907
python
en
code
2
github-code
7
[ { "api_name": "numpy.random.uniform", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 16, "usage_type": "attribute" }, { "api_name": "numpy.copy", "line_number": 17, "usage_type": "call" }, { "api_name": "networkx.Graph", ...
14881907743
from django.test import TestCase from app.models.core import User from app.models import Landscape, Land, Company, BuildingType, Place from app.core.services.builders.agent_builder import AgentBuilder from app.core.services.builders.building_builder import BuildingBuilder class CompanyAgent(TestCase): """This tes...
polowis/virtComp
test/models/company/test_company_agent.py
test_company_agent.py
py
2,054
python
en
code
1
github-code
7
[ { "api_name": "django.test.TestCase", "line_number": 8, "usage_type": "name" }, { "api_name": "app.models.Landscape", "line_number": 12, "usage_type": "name" }, { "api_name": "app.models.Landscape.objects.create_land", "line_number": 12, "usage_type": "call" }, { ...
38129589742
from django.contrib import admin from django.urls import path, include, re_path from rest_framework import permissions from drf_yasg.views import get_schema_view from drf_yasg import openapi schema_view = get_schema_view( openapi.Info( title="Employee Management System", default_version='v1', ...
thierryKeller-1/EmployeManagementSystem
backend/core/urls.py
urls.py
py
1,014
python
en
code
1
github-code
7
[ { "api_name": "drf_yasg.views.get_schema_view", "line_number": 7, "usage_type": "call" }, { "api_name": "drf_yasg.openapi.Info", "line_number": 8, "usage_type": "call" }, { "api_name": "drf_yasg.openapi", "line_number": 8, "usage_type": "name" }, { "api_name": "dr...
4822152316
import requests from bs4 import BeautifulSoup from duckduckgo_search import ddg from csv import writer def get_phish_data(count: int): response = requests.get('https://openphish.com/') soup = BeautifulSoup(response.text, 'lxml') phish_rows = soup.find('tbody').find_all('tr') phish_data = [] for i...
Nick-1912/PhishHunter
main.py
main.py
py
3,293
python
en
code
1
github-code
7
[ { "api_name": "requests.get", "line_number": 8, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 9, "usage_type": "call" }, { "api_name": "duckduckgo_search.ddg", "line_number": 21, "usage_type": "call" }, { "api_name": "requests.get", ...
33754043818
#coding=utf-8 from email.mime import image from glob import glob from logging import exception from pycqBot.cqApi import cqHttpApi, cqLog from pycqBot.cqCode import at, image from lor_deckcodes import LoRDeck, CardCodeAndCount import csv import json import urllib from unicodedata import name from urllib.requ...
yx5932/LoR_QQ_Bot
og.py
og.py
py
17,251
python
en
code
1
github-code
7
[ { "api_name": "json.load", "line_number": 34, "usage_type": "call" }, { "api_name": "jsonpath.jsonpath", "line_number": 35, "usage_type": "call" }, { "api_name": "jsonpath.jsonpath", "line_number": 36, "usage_type": "call" }, { "api_name": "jsonpath.jsonpath", ...
43370027107
from matplotlib import rc rc('text', usetex=True) import numpy as np import pylab as plt # Load channel-dependent limits on the cross section infile = 'limits_bb.txt' data = np.loadtxt(infile,unpack=True) mass = data[0] # Plot the limits for specific targets # Draco = 9, Segue 1 = 19, Combined = 26 targets = [ (...
oscar-macias/Fermi_GC_limits
release-01-00-00/example1.py
example1.py
py
671
python
en
code
1
github-code
7
[ { "api_name": "matplotlib.rc", "line_number": 2, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 9, "usage_type": "call" }, { "api_name": "pylab.loglog", "line_number": 16, "usage_type": "call" }, { "api_name": "pylab.xlabel", "line_numbe...
73464667744
import time import re from selenium import webdriver from selenium.webdriver.common.keys import Keys from datetime import date path = "C:/Users/b4ki/chromedriver.exe" driver = webdriver.Chrome(path) # waiting until the whole page is loaded driver.implicitly_wait(5) driver.get("https://blackclover.wbijam.pl/") def ch...
b4kii/wbijam
main.py
main.py
py
2,625
python
en
code
0
github-code
7
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 9, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 9, "usage_type": "name" }, { "api_name": "datetime.date.today", "line_number": 16, "usage_type": "call" }, { "api_name": "dateti...
32970196585
from django.urls import include, path from rest_framework.authtoken.views import obtain_auth_token from .views import * # Site from .views import horeca, people, events app_name = 'oborona' urlpatterns = [ path('participantcreate/', ParticipantCreate.as_view(), name='create-participant'), path('participa...
Zimus-a/VKR
scripts/main/oborona_taganroga/urls.py
urls.py
py
2,930
python
en
code
0
github-code
7
[ { "api_name": "django.urls.path", "line_number": 11, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 12, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 13, "usage_type": "call" }, { "api_name": "django.urls.path",...
3490812133
import datetime import dateutil import iso8601 import hashlib import logging def sizeof_fmt(num): """ >>> sizeof_fmt(1024) '1 KB' """ for x in ['bytes','KB','MB','GB']: if num < 1024.0: return "%3.1f %s" % (num, x) num /= 1024.0 return "%3.1f %s" % (num, 'TB') def f...
priestc/LibraryDSS
ldss/models/utils.py
utils.py
py
3,302
python
en
code
5
github-code
7
[ { "api_name": "datetime.datetime", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 25, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 29, "usage_type": "call" }, { "api_name": "iso8601.parse_d...
1716141071
#!/usr/bin/env python # -*- coding: latin-1 -*- ''' Prepare a summary for different datatypes for ENCODE3 ''' import os.path import argparse import encodedcc from encodedcc import get_ENCODE EPILOG = ''' The output of this program is for consumption by a googlesheet. ''' def getArgs(): parser = argparse.Argument...
T2DREAM/pyencoded-tools
ENCODE_status_summary.py
ENCODE_status_summary.py
py
15,820
python
en
code
0
github-code
7
[ { "api_name": "argparse.ArgumentParser", "line_number": 16, "usage_type": "call" }, { "api_name": "argparse.RawDescriptionHelpFormatter", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.path.path.expanduser", "line_number": 29, "usage_type": "call" }, ...
13575592635
import datetime from dateutil.parser import parse from urllib.parse import unquote from get_mongo_client import get_mongo_client cli = get_mongo_client() c = cli.kinpri_goods_wiki.items for i in c.find({'date': {'$gte': parse('2015-1-1')}}).sort('date'): if i['date_extra']: date = i['date'].strftime('%m月{...
sakuramochi0/kinpri-goods-wiki
print_release_date_list.py
print_release_date_list.py
py
637
python
en
code
0
github-code
7
[ { "api_name": "get_mongo_client.get_mongo_client", "line_number": 6, "usage_type": "call" }, { "api_name": "dateutil.parser.parse", "line_number": 9, "usage_type": "call" }, { "api_name": "urllib.parse.unquote", "line_number": 15, "usage_type": "call" } ]
7179135790
from config import keys from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.action_chains import ActionChains from selenium.common.exceptions imp...
rednave12/depopmate
Previous Versions/test.py
test.py
py
6,015
python
en
code
0
github-code
7
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 14, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 14, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.action_chains.ActionChains", "line_number": 16, "usage_type": "cal...
27497762865
import datetime from django import forms from django.core.exceptions import ValidationError import pytz from .models import * class DateInput(forms.DateInput): input_type = 'date' class TimeInput(forms.TimeInput): input_type = 'time' utc=pytz.UTC class AvailabilitiesForm(forms.ModelForm): start_hour = form...
plume210/giskar
A_and_R/forms.py
forms.py
py
1,925
python
en
code
0
github-code
7
[ { "api_name": "django.forms.DateInput", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 7, "usage_type": "name" }, { "api_name": "django.forms.TimeInput", "line_number": 9, "usage_type": "attribute" }, { "api_name": "dja...
21736256303
import torch.nn as nn # local modules from model.submodules import ResidualBlock, ConvLayer, RecurrentConvLayer, RecurrentResidualLayer class BaseUNet(nn.Module): def __init__(self, num_input_channels, num_output_channels=1, skip_type='sum', num_encoders=4, base_num_channels=32, num_residual_blo...
ercanburak/EVREAL
model/legacy.py
legacy.py
py
7,511
python
en
code
12
github-code
7
[ { "api_name": "torch.nn.Module", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 7, "usage_type": "name" }, { "api_name": "model.submodules.RecurrentConvLayer", "line_number": 50, "usage_type": "call" }, { "api_name": "torch...
33983689063
from django.conf.urls import url, include from extforms import views urlpatterns = [ url(r'^swc/request/$', views.SWCEventRequest.as_view(), name='swc_workshop_request'), url(r'^swc/request/confirm/$', views.SWCEventRequestConfirm.as_view(), name='swc_workshop_request_confirm'), url(r'^dc/request/$', view...
gridl/amy
extforms/urls.py
urls.py
py
1,429
python
en
code
null
github-code
7
[ { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "extforms.views.SWCEventRequest.as_view", "line_number": 6, "usage_type": "call" }, { "api_name": "extforms.views.SWCEventRequest", "line_number": 6, "usage_type": "attribute" ...
29316759640
import sys import cStringIO import json import zipfile import os from M2Crypto import X509 from spacewalk.satellite_tools.syncLib import log2 from spacewalk.server.rhnServer.satellite_cert import SatelliteCert import constants class Manifest(object): """Class containing relevant data from RHSM manifest.""" ...
spacewalkproject/spacewalk
backend/cdn_tools/manifest.py
manifest.py
py
13,008
python
en
code
640
github-code
7
[ { "api_name": "os.path.abspath", "line_number": 48, "usage_type": "call" }, { "api_name": "os.path", "line_number": 48, "usage_type": "attribute" }, { "api_name": "os.path.expanduser", "line_number": 48, "usage_type": "call" }, { "api_name": "zipfile.ZipFile", ...
7563924149
""" Individual Assignment1_part1 - Computer Vision Student: Antonios Glioumpas Part1: - Color / Grayscale Conversion - Gaussian Filtering - Bilateral Filtering - Grab object in RBG / HSV - Erosion / Dilation - Color Mask To run the Assignment1_part1.py script shell script: $ python Assignment1_part1....
TonyGlioumpas/Computer_Vision_Projects
Image_processing_and_object_detection/Part1.py
Part1.py
py
7,753
python
en
code
1
github-code
7
[ { "api_name": "cv2.CAP_PROP_POS_MSEC", "line_number": 32, "usage_type": "attribute" }, { "api_name": "cv2.VideoCapture", "line_number": 37, "usage_type": "call" }, { "api_name": "cv2.VideoWriter_fourcc", "line_number": 41, "usage_type": "call" }, { "api_name": "cv...
30321471951
import unittest from common.fibonacci import fibonacci import n2w # Really struggled to create my own function so I had to import n2w class challenge4(unittest.TestCase): def test_challenge4(self): i = 3 while i < 20: num = fibonacci(i) print(str(num), " - ", (n2w.conve...
smack1n/stdSling
challenge4/challenge4.py
challenge4.py
py
398
python
en
code
0
github-code
7
[ { "api_name": "unittest.TestCase", "line_number": 8, "usage_type": "attribute" }, { "api_name": "common.fibonacci.fibonacci", "line_number": 15, "usage_type": "call" }, { "api_name": "n2w.convert", "line_number": 16, "usage_type": "call" }, { "api_name": "unittest...
40757109118
import tweepy import json import secrets from kafka.producer import KafkaProducer # Twitter API authentication bearer_token = secrets.bearer_token # Create an OAuth2 user handler using the bearer token auth = tweepy.OAuth2BearerHandler(bearer_token) # Create the Twitter API client api = tweepy.API(auth) # Kafka pr...
Kritigeorgian/BDAT1002
producer.py
producer.py
py
1,154
python
en
code
0
github-code
7
[ { "api_name": "secrets.bearer_token", "line_number": 9, "usage_type": "attribute" }, { "api_name": "tweepy.OAuth2BearerHandler", "line_number": 12, "usage_type": "call" }, { "api_name": "tweepy.API", "line_number": 14, "usage_type": "call" }, { "api_name": "kafka....
18721035302
## deque from collections import deque listtt =[8, 4, 56, 34, 2] Q=deque(listtt) Q.pop() # 뒤에서 요소를 뺌 (2가 빠지겠지?) Q.popleft() # 앞에서 요소를 뺌 ( 8이 빠지겠지?) Q.append(53) # 뒤에 53을 추가 Q.appendleft(535) # 앞에 535를 추가 print(Q) print(list(Q)) # list 형으로 변환 #####dictionry # list5= ["red", "blue", "green", "yellow"] # D= dict(enume...
JaeBumPark/code-test
thisis/etcalgo/collectionsss.py
collectionsss.py
py
766
python
ko
code
0
github-code
7
[ { "api_name": "collections.deque", "line_number": 5, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 24, "usage_type": "call" } ]
28487841665
"""Initialize models.""" from keras.utils import plot_model from .encoders import get_model from .decoders import regular, simple101, resnet def build(encoder_type, decoder_type, freeze_encoder=False, use_dropout=False, n_filters=512, activation='elu', use_batchnorm=F...
Dammi87/tgs_keras
solution/estimator/models/__init__.py
__init__.py
py
2,223
python
en
code
0
github-code
7
[ { "api_name": "encoders.get_model", "line_number": 38, "usage_type": "call" }, { "api_name": "decoders.regular", "line_number": 45, "usage_type": "call" }, { "api_name": "decoders.simple101", "line_number": 52, "usage_type": "call" }, { "api_name": "decoders.resne...
73882911264
from cassandra.cluster import Cluster from cassandra.auth import PlainTextAuthProvider import uuid user_credentials=PlainTextAuthProvider(username='superapple',password='fact@123') conn=Cluster(['127.0.0.1'],port=9042,auth_provider=user_credentials) try: cur=conn.connect(keyspace='suman') id='a75ad251-8174-11...
EunbiYoon/cassandra
python_updatetable.py
python_updatetable.py
py
697
python
en
code
0
github-code
7
[ { "api_name": "cassandra.auth.PlainTextAuthProvider", "line_number": 5, "usage_type": "call" }, { "api_name": "cassandra.cluster.Cluster", "line_number": 6, "usage_type": "call" }, { "api_name": "uuid.UUID", "line_number": 11, "usage_type": "call" } ]
74826817822
#2 Loading Data in pandas # Selecting columns # Select the column item from credit_records # Use dot notation items = ____ # Display the results print(items) # Select the column item from credit_records # Use dot notation items = credit_records.item # Display the results print(items) # One or more ...
h2oDOGGY/python_datacamp
Introduction to Data Science in Python.py
Introduction to Data Science in Python.py
py
6,794
python
en
code
0
github-code
7
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 81, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 81, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.show", "line_number": 84, "usage_type": "call" }, { "api_name": "matpl...
41631087364
from pathlib import Path p = Path(__file__).with_name('d2.txt') MAXES = { 'red': 12, 'green': 13, 'blue': 14 } def validate_game(game: str) -> int: gametag, draws = game.split(': ') _, game_id = gametag.split() for draw in draws.split(';'): if not possible(draw): return 0 ...
machallboyd/adventofcode
2023/d2.py
d2.py
py
649
python
en
code
0
github-code
7
[ { "api_name": "pathlib.Path", "line_number": 3, "usage_type": "call" } ]
71543760864
from django.conf.urls import url from itkufs.accounting.views.edit import ( new_edit_settlement, new_edit_transaction, approve_transactions, reject_transactions, transfer, ) from itkufs.accounting.views.display import ( SettlementDetails, SettlementList, TransactionDetails, Transact...
itkinside/ufs
itkufs/accounting/urls.py
urls.py
py
3,519
python
en
code
9
github-code
7
[ { "api_name": "django.conf.urls.url", "line_number": 20, "usage_type": "call" }, { "api_name": "itkufs.accounting.views.display.SettlementDetails.as_view", "line_number": 22, "usage_type": "call" }, { "api_name": "itkufs.accounting.views.display.SettlementDetails", "line_numb...
16259526593
""" This scripts contains the PayoffMatrix """ from typing import Optional import numpy as np class PayoffMatrix: """ A class of 2 by 2 payoff matrices. Currently include the following games: The staghunt game: 'staghunt', The matching pennies game (coop and competive): 'penny_competive', 'penny_...
KennethEnevoldsen/tomsup
tomsup/payoffmatrix.py
payoffmatrix.py
py
6,578
python
en
code
58
github-code
7
[ { "api_name": "typing.Optional", "line_number": 45, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 45, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 59, "usage_type": "call" }, { "api_name": "numpy.array", "line_...
42272248867
import numpy as np import matplotlib.pyplot as plt from PIL import Image def medianFilter(image): rows, columns = image.size m_image = np.array(image, dtype=np.uint8) for row in range(rows): for col in range(columns): if m_image[row, col] == np.uint8(0): wi...
kennethGHS/PAID_C_and_H
Catalog 1/InterpolationAndGeometricalOperations/TAL/Rotation.py
Rotation.py
py
2,649
python
en
code
0
github-code
7
[ { "api_name": "numpy.array", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.uint8", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.squeeze", "line_numb...
9219815425
from django import forms from app_jobs.models import City, Language from .models import User class ProfileChangeForm(forms.ModelForm): """Форма для личного кабинета""" username = forms.CharField(widget=forms.TextInput(attrs={ 'class': 'form-control'}), label='Имя пользователя') email = forms.Em...
romaha57/django_parser
jobs_site/app_users/forms.py
forms.py
py
1,210
python
en
code
0
github-code
7
[ { "api_name": "django.forms.ModelForm", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 8, "usage_type": "name" }, { "api_name": "django.forms.CharField", "line_number": 11, "usage_type": "call" }, { "api_name": "django....
14311070769
from typing import List from typing import Optional from typing import Text class CardType: def __init__(self, num=None, special=None): self.num = num self.special = special assert self.num or self.special def number_value(self) -> Optional[int]: # The number value of this card. # Returns None if the card...
ebold123/cataract
app/card.py
card.py
py
918
python
en
code
0
github-code
7
[ { "api_name": "typing.Optional", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 16, "usage_type": "name" }, { "api_name": "typing.Text", "line_number": 16, "usage_type": "name" }, { "api_name": "typing.List", "line_n...
11947698637
from django.urls import path, include from .views import * urlpatterns = [ path('',index, name='index'), path('hackerlist',hacker_list, name='hackerlist'), path('hackerdetail',user_detail, name='userdetail'), path('voted',vote, name='vote') ]
amanjhurani/hackerpolling
polling/urls.py
urls.py
py
261
python
en
code
1
github-code
7
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "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.urls.path", ...
26387470749
#coding=utf-8 from __future__ import print_function from __future__ import division import cv2 import tensorflow as tf import numpy as np import os import colorsys import config from yolov3 import yolov3_body from yolov3 import yolo_eval from utils.get_anchors import get_anchors flags = tf.app.flags FLAGS = flags....
zhulf0804/Yolov3-Tensorflow
detect.py
detect.py
py
4,311
python
en
code
2
github-code
7
[ { "api_name": "tensorflow.app", "line_number": 18, "usage_type": "attribute" }, { "api_name": "config._coco_tf_weights", "line_number": 22, "usage_type": "attribute" }, { "api_name": "config._coco_names", "line_number": 24, "usage_type": "attribute" }, { "api_name...
72979502622
# source: https://platform.openai.com/docs/api-reference/introduction from pprint import pprint import requests from typing import Union, List import aiohttp import asyncio from .config import ChatCompletionConfig from ._return import BaseReturn,AsyncReturn from openai.error import InvalidRequestError class ChatGPT: ...
leoxiang66/requests-toolkit
requests_toolkit/openpy/_openai.py
_openai.py
py
6,163
python
en
code
0
github-code
7
[ { "api_name": "pprint.pprint", "line_number": 36, "usage_type": "call" }, { "api_name": "config.ChatCompletionConfig", "line_number": 50, "usage_type": "name" }, { "api_name": "config.ChatCompletionConfig", "line_number": 96, "usage_type": "name" }, { "api_name": ...
25747904416
import get_stock import pandas as pd from xlsxwriter import Workbook from datetime import datetime,date import seaborn as sns import matplotlib.pyplot as plt from matplotlib.dates import DayLocator, HourLocator, DateFormatter, drange def main(): start = datetime(2021,3,1) end = date.today() stock = '7203...
Eishiro/stock_price
main.py
main.py
py
1,120
python
en
code
0
github-code
7
[ { "api_name": "datetime.datetime", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.date.today", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 13, "usage_type": "name" }, { "api_name": "get_stock.company...
20705757603
import os from wand.image import Image from shutil import copyfile import glob import pdb import logging modulate_presets_1 = { (-100, -200): 'dark'} modulate_presets_2 = { (200, 300): 'default', (-1000, -1000): 'galaxy', (200, -800): 'flir'} cwd = './defaults_test/' def mkgif(filename): outfiles = ['testing_ov...
etcadinfinitum/DiscordDeepPhryer
extra/testing_overlay.py
testing_overlay.py
py
3,573
python
en
code
3
github-code
7
[ { "api_name": "logging.info", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number":...
17457916306
import torch import torchvision from ssd.container import Container import numpy as np class PostProcessor: def __init__(self, cfg): super().__init__() self.cfg = cfg self.width = cfg.INPUT.IMAGE_SIZE[1] self.height = cfg.INPUT.IMAGE_SIZE[0] def __call__(self, detections): ...
mariusud/road-damage-detection
SSD/ssd/modeling/box_head/inference.py
inference.py
py
6,295
python
en
code
0
github-code
7
[ { "api_name": "torch.arange", "line_number": 29, "usage_type": "call" }, { "api_name": "torch.nonzero", "line_number": 43, "usage_type": "call" }, { "api_name": "ssd.container.Container", "line_number": 54, "usage_type": "call" }, { "api_name": "torch.empty", ...
19502480307
""" Created on 2022/8/8 This file was Images are divided by inner radii and outer radii A HoughCircles algorithm is run to obtain outer radii from the droplets A Canny Edge Detection algorithm is run to obtain the inner radii from the condensates Once these radii are obtained, each condensate is matched with its res...
mbborja/llpsAnalysis
LLPSProject.py
LLPSProject.py
py
5,825
python
en
code
0
github-code
7
[ { "api_name": "glob.glob", "line_number": 47, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 48, "usage_type": "call" }, { "api_name": "skimage.io.imread", "line_number": 58, "usage_type": "call" }, { "api_name": "skimage.io", "line_n...
6146495897
import pygame from pygame.locals import * # physics def CollisionTest(Object1,ObjectList): CollisionList = [] for Object in ObjectList: if Object.colliderect(Object1): CollisionList.append(Object) return CollisionList class PhysicsObject(object): def __init__(self,x,y,x_size,y...
bedevil001/Bedevil-Adventure-Game
character/Migo adventure/idle/idle-1/entities.py
entities.py
py
5,361
python
en
code
1
github-code
7
[ { "api_name": "pygame.Rect", "line_number": 17, "usage_type": "call" }, { "api_name": "pygame.draw.rect", "line_number": 49, "usage_type": "call" }, { "api_name": "pygame.draw", "line_number": 49, "usage_type": "attribute" }, { "api_name": "pygame.transform.flip",...
18168396415
import threading import zmq from msgpack_numpy import dumps as dump from msgpack_numpy import loads as load from tornado.concurrent import Future from six.moves import queue import time import random import os from tqdm import tqdm from queue import Queue from intelActNet import Network from config import config from ...
guotata1996/IntelAct-Paper-Reproduce
base_optimizer.py
base_optimizer.py
py
3,813
python
en
code
0
github-code
7
[ { "api_name": "threading.Thread", "line_number": 17, "usage_type": "attribute" }, { "api_name": "config.config.ip_addr", "line_number": 18, "usage_type": "attribute" }, { "api_name": "config.config", "line_number": 18, "usage_type": "name" }, { "api_name": "zmq.Co...
35753620350
""" Insert the reviews file into the DB. """ from tqdm import tqdm from cmt_statistics_tool.helper import fillna_strs, get_or_add, read_original_revision from cmt_statistics_tool.tables import RevisionReview, SubmissionReview, async_session async def insert_reviews(file: str) -> None: original, revision = read_o...
HPI-Information-Systems/cmt_statistics_tool
cmt_statistics_tool/insert/reviews.py
reviews.py
py
8,058
python
en
code
1
github-code
7
[ { "api_name": "cmt_statistics_tool.helper.read_original_revision", "line_number": 11, "usage_type": "call" }, { "api_name": "cmt_statistics_tool.helper.fillna_strs", "line_number": 12, "usage_type": "call" }, { "api_name": "cmt_statistics_tool.helper.fillna_strs", "line_numbe...
32612292145
import json import random import boto3 import time topic = "" region = "" endpoint = "" iot = boto3.client('iot-data', region_name=region, endpoint_url=endpoint) def lambda_handler(event, context): data = { "timestamp": time.time(), "temperature": random.uniform(0.0, 100.0), ...
Ahsan0001/cloud_workshop
lambda_code.py
lambda_code.py
py
829
python
en
code
0
github-code
7
[ { "api_name": "boto3.client", "line_number": 10, "usage_type": "call" }, { "api_name": "time.time", "line_number": 16, "usage_type": "call" }, { "api_name": "random.uniform", "line_number": 17, "usage_type": "call" }, { "api_name": "random.uniform", "line_numb...
36965147865
# --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.13.8 # kernelspec: # display_name: Python 3 (ipykernel) # language: python # name: python3 # --- # # Supplementary Video 2 # + import jobl...
AdaptiveMotorControlLab/cebra-figures
src/prepare/prepare_supplementary_video_2.py
prepare_supplementary_video_2.py
py
6,660
python
en
code
13
github-code
7
[ { "api_name": "joblib.load", "line_number": 53, "usage_type": "call" }, { "api_name": "scipy.interpolate.make_interp_spline", "line_number": 55, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 55, "usage_type": "call" }, { "api_name": "numpy.a...
23412718102
import os import sys import logging import subprocess from pathlib import Path from ioco import util this = sys.modules[__name__] this.part = None this.fs_type = None this.config = None def main(config): this.config = config if this.config.get("block"): timing_key = "oci block" util.start_timi...
psadmin-io/ioco
ioco/oci.py
oci.py
py
3,164
python
en
code
5
github-code
7
[ { "api_name": "sys.modules", "line_number": 8, "usage_type": "attribute" }, { "api_name": "ioco.util.start_timing", "line_number": 17, "usage_type": "call" }, { "api_name": "ioco.util", "line_number": 17, "usage_type": "name" }, { "api_name": "logging.debug", ...
22342953468
from ...data import EntityBase class ConfigParameterBase(EntityBase): def __init__(self, Name: str = None, Type: str = None, Value: str = None, Description: str = None, *args, **kwargs): super().__init__(*args, **kwargs)...
fmuyilmaz/pdip
pdip/configuration/services/config_parameter_base.py
config_parameter_base.py
py
457
python
en
code
1
github-code
7
[ { "api_name": "data.EntityBase", "line_number": 4, "usage_type": "name" } ]
24559903667
import logging from typing import Any, Dict, List, Mapping, Optional from langchain_core.callbacks import CallbackManagerForLLMRun from langchain_core.language_models.llms import LLM from langchain_core.pydantic_v1 import Extra, Field, SecretStr, root_validator from langchain_core.utils import convert_to_secret_str, g...
langchain-ai/langchain
libs/community/langchain_community/llms/gooseai.py
gooseai.py
py
5,301
python
en
code
68,990
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "langchain_core.language_models.llms.LLM", "line_number": 12, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 29, "usage_type": "name" }, { "api_name": "t...
71257730783
import numpy as np from fastai.text import SortSampler, SortishSampler def test_sort_sampler_sorts_all_descending(): bs = 4 n = bs*100 data = 2 * np.arange(n) samp = list(SortSampler(data, lambda i: data[i])) # The sample is a permutation of the indices. assert sorted(samp) == list(range(n))...
hamelsmu/code_search
fastai/tests/test_samplers.py
test_samplers.py
py
937
python
en
code
483
github-code
7
[ { "api_name": "numpy.arange", "line_number": 9, "usage_type": "call" }, { "api_name": "fastai.text.SortSampler", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 21, "usage_type": "call" }, { "api_name": "fastai.text.SortishS...
7553209881
import gobject, gtk, pango from plugin.Interface import Interface from utils.HIGDialog import HIGDialog # # Dialog for inspecting controls. # class ControlInspector(HIGDialog): def __init__(self, ctrlclass): HIGDialog.__init__(self, buttons=(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE)) name = ctrlclas...
RaumZeit/gdesklets-core
shell/plugins/ControlBrowser/ControlInspector.py
ControlInspector.py
py
3,268
python
en
code
0
github-code
7
[ { "api_name": "utils.HIGDialog.HIGDialog", "line_number": 10, "usage_type": "name" }, { "api_name": "utils.HIGDialog.HIGDialog.__init__", "line_number": 14, "usage_type": "call" }, { "api_name": "utils.HIGDialog.HIGDialog", "line_number": 14, "usage_type": "name" }, {...
34980909864
import torchvision from torchvision.models.detection.faster_rcnn import FastRCNNPredictor import torch def load_fasterRCNN(max_size, min_size, num_classes, device): model = torchvision.models.detection.fasterrcnn_resnet50_fpn(weights="DEFAULT", max_size=max_size, min_size=min_size) in_features = model.roi_heads.bo...
zklaw/pills-detection
model.py
model.py
py
942
python
en
code
0
github-code
7
[ { "api_name": "torchvision.models.detection.fasterrcnn_resnet50_fpn", "line_number": 6, "usage_type": "call" }, { "api_name": "torchvision.models", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torchvision.models.detection.faster_rcnn.FastRCNNPredictor", "line...
74209845662
""" Example of "constant expression" propagation. A "constant expression" is an expression based on constants or init regs. """ from argparse import ArgumentParser from miasm.analysis.machine import Machine from miasm.analysis.binary import Container from miasm.analysis.cst_propag import propagate_cst_expr from mias...
cea-sec/miasm
example/expression/constant_propagation.py
constant_propagation.py
py
1,746
python
en
code
3,204
github-code
7
[ { "api_name": "argparse.ArgumentParser", "line_number": 19, "usage_type": "call" }, { "api_name": "miasm.analysis.machine.Machine", "line_number": 28, "usage_type": "call" }, { "api_name": "miasm.core.locationdb.LocationDB", "line_number": 30, "usage_type": "call" }, ...
42872191554
# -*- coding: utf-8 -*- """ Created on Thu May 9 19:12:25 2019 @author: zsl """ from math import log import operator import treePlotter from sklearn.datasets import load_iris import numpy as np import pandas as pd def calEntropy(dataset): ''' 计算熵 ''' data_dic ={} total = len(d...
foolfun/Algorithm
02_CART/CART.py
CART.py
py
5,936
python
en
code
0
github-code
7
[ { "api_name": "math.log", "line_number": 29, "usage_type": "call" }, { "api_name": "operator.itemgetter", "line_number": 53, "usage_type": "call" }, { "api_name": "sklearn.datasets.load_iris", "line_number": 130, "usage_type": "call" }, { "api_name": "pandas.cut",...
10383033296
from Bio import SeqIO import pandas as pd import multiprocessing import numpy as np # Translates the DNA sequence into AA sequence # USearch v11 was used to merge and filter deep sequence reads. # The zotus and otutab files are .txt files generated from USearch analysis. # Outfile is a pklfile with DNA and AA sequen...
HackelLab-UMN/PriSM-Inhibition-and-Seq-Analysis
Deep Sequence Analysis/merge_zotu_and_otutab.py
merge_zotu_and_otutab.py
py
3,405
python
en
code
0
github-code
7
[ { "api_name": "multiprocessing.cpu_count", "line_number": 40, "usage_type": "call" }, { "api_name": "multiprocessing.Pool", "line_number": 41, "usage_type": "call" }, { "api_name": "Bio.SeqIO.parse", "line_number": 44, "usage_type": "call" }, { "api_name": "Bio.Se...
72961049183
import unittest import numpy as np from torch_geometric.data import Data, InMemoryDataset, DataLoader from clique_finding_models.output_transforms import * GRAPHS = [ # A house graph. Data( x=torch.ones([5, 1]), edge_index=torch.tensor([ [0, 0, 1, 1, 1, 2, 2, 3, 1, 2, 2, 3, 4, 3, ...
maaario/mcp-gnns
clique_finding_models/output_transforms_test.py
output_transforms_test.py
py
3,881
python
en
code
0
github-code
7
[ { "api_name": "torch_geometric.data.Data", "line_number": 10, "usage_type": "call" }, { "api_name": "torch_geometric.data.Data", "line_number": 18, "usage_type": "call" }, { "api_name": "torch_geometric.data.Data.from_dict", "line_number": 29, "usage_type": "call" }, ...
5545563261
from datetime import datetime import fs.s3fs myfs = fs.s3fs.S3FS('wantsomedashboards','logfiles',os.environ['AWS_WSDS3_KEY'], os.environ['AWS_WSDS3_SECRET']) # db.define_table('page_visit_count', # Field('page_name'), # Field('counter', 'integer'), # ) db.define_table('page_visit_data', Field('page_name'), Fie...
wantsomechocolate/WantsomeDashboards
applications/dashboard/models/tables.py
tables.py
py
4,142
python
en
code
0
github-code
7
[ { "api_name": "fs.s3fs.s3fs.S3FS", "line_number": 4, "usage_type": "call" }, { "api_name": "fs.s3fs.s3fs", "line_number": 4, "usage_type": "attribute" }, { "api_name": "fs.s3fs", "line_number": 4, "usage_type": "name" }, { "api_name": "datetime.datetime.now", ...
10582469841
import common import re lines = common.get_lines("day7_data.txt") bags = {} for line in lines: colour = re.match(r".*(?= bags contain)", line)[0] bags[colour] = re.findall(r"(\d+?) (.+?) bags?", line) def has_shiny(colour: str): if colour == "shiny gold": return True else: ...
3schwartz/AdventOfCode
year2020/day7.py
day7.py
py
700
python
en
code
0
github-code
7
[ { "api_name": "common.get_lines", "line_number": 4, "usage_type": "call" }, { "api_name": "re.match", "line_number": 9, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 10, "usage_type": "call" } ]
20309695447
import random as rnd import numpy as np import math import matplotlib.pyplot as plt import Demode as de import Symbol as sym import timeit # import tensorflow as tf # real = tf.constant(2.25) # imag = tf.constant(3.25) # tf.dtypes.complex(real, imag) QAM = 4 Count_Total = 1 symbol_num = 1000 SNR = 15 symbol = [] SER ...
JJinTae/Kmeans_Clustering_Python
QPSK_Kmeans/QPSK_SER.py
QPSK_SER.py
py
3,554
python
ko
code
0
github-code
7
[ { "api_name": "numpy.zeros", "line_number": 19, "usage_type": "call" }, { "api_name": "Symbol.Gensymbol", "line_number": 31, "usage_type": "call" }, { "api_name": "Demode.Demode", "line_number": 32, "usage_type": "call" }, { "api_name": "Symbol.Addnoise", "lin...
24017255201
import copy import json import pytest from spatialdata.transformations.ngff.ngff_coordinate_system import ( NgffAxis, NgffCoordinateSystem, ) input_dict = { "name": "volume_micrometers", "axes": [ {"name": "x", "type": "space", "unit": "micrometer"}, {"name": "y", "type": "space", "uni...
scverse/spatialdata
tests/transformations/ngff/test_ngff_coordinate_system.py
test_ngff_coordinate_system.py
py
5,755
python
en
code
113
github-code
7
[ { "api_name": "spatialdata.transformations.ngff.ngff_coordinate_system.NgffCoordinateSystem.from_dict", "line_number": 21, "usage_type": "call" }, { "api_name": "spatialdata.transformations.ngff.ngff_coordinate_system.NgffCoordinateSystem", "line_number": 21, "usage_type": "name" }, ...
70938866145
import yaml import os import numpy as np import ruamel.yaml def load_conf(path: str) -> yaml: """ The goal of this function is to load the params Arguments: -path: str The path of configuration file to be loaded Returns: -file: yaml file The configuration file loaded """ w...
HippolyteGuigon/Kmeans_Implementation
KMeans/confs/confs.py
confs.py
py
2,368
python
en
code
0
github-code
7
[ { "api_name": "yaml.safe_load", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 64, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 64, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6...
75027635103
from flask import Flask import socket app = Flask(__name__) @app.route("/") def hello(): hostname = socket.gethostname() return f"Hello from {hostname}" if __name__ == "__main__": app.run(host='0.0.0.0', port=8080)
MasonEgger-Demos/python-k8s-demo-app
main.py
main.py
py
230
python
en
code
1
github-code
7
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "socket.gethostname", "line_number": 8, "usage_type": "call" } ]
560861385
import sys import logging FORMAT = ('%(asctime)-15s %(threadName)-15s' ' %(levelname)-8s %(module)-15s:%(lineno)-8s %(message)s') logging.basicConfig(format=FORMAT) log = logging.getLogger() log.setLevel(logging.DEBUG) #log.setLevel(logging.WARNING) #log.setLevel(logging.INFO) from modbus_sniffer import Seria...
snhobbs/ModbusSniffer
bin/modbus_sniffer.py
modbus_sniffer.py
py
875
python
en
code
18
github-code
7
[ { "api_name": "logging.basicConfig", "line_number": 5, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 7, "usage_type": "attribute" }, { "api_name": "sys.argv", ...
13837445218
import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.metrics import accuracy_score from sklearn.linear_model import LinearRegression from sklearn.linear_model import LogisticRegression from sklearn.ensemble import RandomForestClassifier from sklearn.neighbors import KNeighborsClassifier ...
jainanshul3863/Iris-Data_analysis
iris.py
iris.py
py
1,461
python
en
code
0
github-code
7
[ { "api_name": "sklearn.datasets.load_iris", "line_number": 13, "usage_type": "call" }, { "api_name": "sklearn.datasets", "line_number": 13, "usage_type": "name" }, { "api_name": "pandas.DataFrame", "line_number": 16, "usage_type": "call" }, { "api_name": "sklearn....
9122308308
# -*- coding: utf-8 -*- from django.conf import settings from django.contrib.auth import get_user_model from django.core.management.base import BaseCommand, CommandError from guardian.utils import get_anonymous_user User = get_user_model() class Command(BaseCommand): help = "Set the user profile settings of ev...
catmaid/CATMAID
django/applications/catmaid/management/commands/catmaid_set_user_profiles_to_default.py
catmaid_set_user_profiles_to_default.py
py
1,535
python
en
code
178
github-code
7
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 9, "usage_type": "call" }, { "api_name": "django.core.management.base.BaseCommand", "line_number": 12, "usage_type": "name" }, { "api_name": "guardian.utils.get_anonymous_user", "line_number": 22, "usage_t...
30971580539
from datetime import timedelta GENESIS_REWARD = 1000 """ The reward that is available for the first `REWARD_HALF_LIFE` blocks, starting with the genesis block. """ REWARD_HALF_LIFE = 10000 """ The number of blocks until the block reward is halved. """ BLOCK_REQUEST_RETRY_INTERVAL = timedelta(seconds=30) """ The appr...
ChaAC-FAU/labchain
src/config.py
config.py
py
1,021
python
en
code
11
github-code
7
[ { "api_name": "datetime.timedelta", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 25, "usage_type": "call" } ]
38440900753
import gradio as gr from transformers import pipeline fill_mask = pipeline("fill-mask", model="./QuijoBERT", tokenizer = './QuijoBERT') def predict(text): res_dict = {} x = fill_mask(text) print('x') for i in range(len(x)): k = x[i]['sequence'] e = x[i]['score'] print(k, ...
ASR01/QuijoBERT
app.py
app.py
py
764
python
en
code
0
github-code
7
[ { "api_name": "transformers.pipeline", "line_number": 5, "usage_type": "call" }, { "api_name": "gradio.Interface", "line_number": 25, "usage_type": "call" } ]
43346252886
import json import pickle import numpy as np # Variable: df_columns = None locations = None model = None # Price Predict funtion: def Price_Predict(locationOut, SqFt, Bath, Bed): locationsIn = locationOut.lower() location_index = df_columns.index(locationsIn) SqFt = float(SqFt) Bath = int(Bath) B...
Version-Max/Project_House_Price_Prediction_A
utilities.py
utilities.py
py
1,907
python
en
code
0
github-code
7
[ { "api_name": "numpy.zeros", "line_number": 24, "usage_type": "call" }, { "api_name": "json.load", "line_number": 71, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 76, "usage_type": "call" } ]
38419014913
import asyncio import uvloop import aiowebsockets async def connect_client(): async with aiowebsockets.Connect('ws://localhost:2053') as context: context.send(b'{"The":"Quick","Brown":"Fox","Jumped":"Over","The":"Lazy","Dog":"."}') async for message in context: context.sen...
SkylarFlare/aiowebsockets
benchmark/client.py
client.py
py
560
python
en
code
4
github-code
7
[ { "api_name": "aiowebsockets.Connect", "line_number": 8, "usage_type": "call" }, { "api_name": "asyncio.set_event_loop_policy", "line_number": 16, "usage_type": "call" }, { "api_name": "uvloop.EventLoopPolicy", "line_number": 16, "usage_type": "call" }, { "api_nam...
26848178971
import torch.nn as nn import torchaudio import torch.autograd.variable import numpy as np from torch.autograd.variable import * from utils.stft_istft import STFT class NET_Wrapper(nn.Module): def __init__(self,win_len,win_offset): super(NET_Wrapper, self).__init__() self.win_len = win_len ...
ZhaoF-i/freshmen_challenge
networks/TCN.py
TCN.py
py
3,650
python
en
code
0
github-code
7
[ { "api_name": "torch.nn.Module", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 10, "usage_type": "name" }, { "api_name": "utils.stft_istft.STFT", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.nn.ModuleLi...
9578959963
from pyspark import SparkContext,SparkConf,SparkFiles from pyspark.sql import SparkSession from datetime import datetime UTC_FORMAT = "%Y-%m-%dT%H:%M:%S.%fZ" from fmm import Network,NetworkGraph,STMATCH,STMATCHConfig #network = Network("../data/edges.shp") import os import utm os.environ["PYSPARK_PYTHON"]='/roo...
sequelOoO/-gps-
main.py
main.py
py
3,788
python
en
code
2
github-code
7
[ { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 10, "usage_type": "attribute" }, { "api_name": "datetime.datetime.strptime", "line_number": 18, "usage_type": "call" }, { "api_name": "datetime.da...
11286311088
from numba import jit, f8, i2 import numpy as np @jit(f8[:](f8[:], f8, i2[:])) def _proximal_operator(coef, threshold, group_ids): """ Proximal operator. """ result = np.zeros_like(coef).astype(np.float64) unique_group_ids = np.unique(group_ids) for group_id in unique_group_ids: target...
AnchorBlues/GroupLasso
grouplasso/_numba.py
_numba.py
py
868
python
en
code
13
github-code
7
[ { "api_name": "numpy.zeros_like", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.float64", "line_number": 10, "usage_type": "attribute" }, { "api_name": "numpy.unique", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.linalg.norm", ...
10967615971
from functools import reduce as R import sys,math input=sys.stdin.readline U=lambda:map(int,input().split()) Q=lambda a:(a>0)-(a<0) T=lambda p,q,r:Q((q[0]-p[0])*(r[1]-p[1])-(r[0]-p[0])*(q[1]-p[1])) def L(H,r): while len(H)>1 and T(H[-2],H[-1],r)<1:H.pop() if not len(H) or H[-1]!=r:H.append(r) return H def c...
Wanderkind/BOJ
10903.py
10903.py
py
532
python
en
code
2
github-code
7
[ { "api_name": "sys.stdin", "line_number": 3, "usage_type": "attribute" }, { "api_name": "functools.reduce", "line_number": 13, "usage_type": "call" }, { "api_name": "math.dist", "line_number": 17, "usage_type": "call" }, { "api_name": "math.pi", "line_number":...
20115060499
import argparse import csv import wnhier import wnNounSim import wnSemSim def handle_csv(file): """ Handles csv files by parsing them into a list. Requires the delimiter to be a semi-colon. Params: file: a csv filename Returns: a list with the csv file contents """ with ope...
oskarbyman/NLP_semantic_similarity
main.py
main.py
py
3,967
python
en
code
1
github-code
7
[ { "api_name": "csv.reader", "line_number": 18, "usage_type": "call" }, { "api_name": "wnhier.Sim", "line_number": 39, "usage_type": "call" }, { "api_name": "wnNounSim.Similarity", "line_number": 41, "usage_type": "call" }, { "api_name": "wnSemSim.Similarity", ...
23509695243
import streamlit as st from streamlit import session_state as s_state from pathlib import Path from tools.io import logo_load, load_databases from tools.workflow import sidebar_widgets, user_logging text_format = 'style="font-size: 25px;"' nirspec_link = '<a href="https://jwst-docs.stsci.edu/jwst-near-infrared-spectr...
Vital-Fernandez/ceers-data
CEERs_data.py
CEERs_data.py
py
3,711
python
en
code
0
github-code
7
[ { "api_name": "streamlit.set_page_config", "line_number": 36, "usage_type": "call" }, { "api_name": "tools.workflow.user_logging", "line_number": 40, "usage_type": "call" }, { "api_name": "streamlit.session_state", "line_number": 42, "usage_type": "name" }, { "api...
17678324150
# ---LICENSE-BEGIN - DO NOT CHANGE OR MOVE THIS HEADER # This file is part of the Neurorobotics Platform software # Copyright (C) 2014,2015,2016,2017 Human Brain Project # https://www.humanbrainproject.eu # # The Human Brain Project is a European Commission funded project # in the frame of the Horizon2020 FET Fla...
hmsgit/nrpcle
hbp_nrp_cle/hbp_nrp_cle/tests/brainsim/nest_devicetests/test_fixed_spike_generator.py
test_fixed_spike_generator.py
py
6,225
python
en
code
1
github-code
7
[ { "api_name": "unittest.TestCase", "line_number": 31, "usage_type": "attribute" }, { "api_name": "hbp_nrp_cle.brainsim.nest.devices.__NestFixedSpikeGenerator.NestFixedSpikeGenerator", "line_number": 38, "usage_type": "call" }, { "api_name": "mock.Mock", "line_number": 39, ...
31907377641
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('book', '0001_initial'), ] operations = [ migrations.AlterField( model_name='sequencebook', name='num...
fantazey/fb2library
book/migrations/0002_auto_20151112_2318.py
0002_auto_20151112_2318.py
py
537
python
en
code
5
github-code
7
[ { "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" }, {...
15272151280
from game_data import data import random import art from replit import clear print(art.logo) # create two accounts to compare choice_A = random.choice(data) # print(choice_A) choice_B = random.choice(data) # print(choice_B) score = 0 if choice_A == choice_B: choice_B = random.choice(data) # print(choice_B) # print(...
Diyoh/Python_projects
higher_lower_game.py
higher_lower_game.py
py
1,298
python
en
code
1
github-code
7
[ { "api_name": "art.logo", "line_number": 6, "usage_type": "attribute" }, { "api_name": "random.choice", "line_number": 8, "usage_type": "call" }, { "api_name": "game_data.data", "line_number": 8, "usage_type": "argument" }, { "api_name": "random.choice", "line...
4503650878
#coding:utf-8 import cv2 import numpy as np import glob def draw_chease_board(height = 1200, width = 1800, length = 200): image = np.zeros((height, width), dtype=np.uint8) print(image.shape[0], image.shape[1]) for j in range(width): for i in range(height): if (int(i / length) + int(j /...
ZhangLanTao/Robot-Grab-using-PointCloud
hardware/camera/camera_calibrate.py
camera_calibrate.py
py
3,785
python
en
code
7
github-code
7
[ { "api_name": "numpy.zeros", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 7, "usage_type": "attribute" }, { "api_name": "cv2.imwrite", "line_number": 20, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number"...
75240074463
from botoy import Botoy, Action, GroupMsg from botoy import decorators as deco import os import json import requests, time from utils.fileio import read_json, write_json from utils.twitter_manager import TwitterManager resource_path = "./resources/twitter_timeline_alarm" bot = Action( qq = int(os.getenv('BOTQQ')...
falcon-hayaki/botoy_plugins
plugins/bot_twitter_timeline_subscribe.py
bot_twitter_timeline_subscribe.py
py
3,369
python
en
code
0
github-code
7
[ { "api_name": "botoy.Action", "line_number": 12, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 13, "usage_type": "call" }, { "api_name": "utils.twitter_manager.TwitterManager", "line_number": 16, "usage_type": "call" }, { "api_name": "botoy.Gro...
24595013454
import random from django.core.management.base import BaseCommand from django_seed import Seed from reviews import models as models_reviews from places import models as models_places from users import models as models_users class Command(BaseCommand): help = "This command created many reviews" def add_argume...
ChoiNakHoon/stampKorea
reviews/management/commands/seed_review.py
seed_review.py
py
1,353
python
en
code
0
github-code
7
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 9, "usage_type": "name" }, { "api_name": "django_seed.Seed.seeder", "line_number": 22, "usage_type": "call" }, { "api_name": "django_seed.Seed", "line_number": 22, "usage_type": "name" }, { "a...
36506408865
from flask import Flask, render_template, request, redirect, flash from flask_mysqldb import MySQL from scripts.scraper import getReddit import yaml app = Flask(__name__) # Configure db db = yaml.safe_load(open("db.yaml")) app.config['MYSQL_HOST'] = db['mysql_host'] app.config['MYSQL_USER'] = db['mysql_user'] app.con...
jchi4/Aliens
app.py
app.py
py
2,433
python
en
code
0
github-code
7
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "yaml.safe_load", "line_number": 9, "usage_type": "call" }, { "api_name": "flask_mysqldb.MySQL", "line_number": 20, "usage_type": "call" }, { "api_name": "scripts.scraper.getReddi...
31199345433
from world import World import json import cProfile unit_testing = False def main(): if unit_testing: world = World(30, 1, 1) world.unit_test() else: with open("species.json", "w") as speciesFile: speciesFile.write("{}") world = World(50, 1, 1000) while Tru...
Qupergo/School-Projects
Other/GeneticAlgorithmSnake/snakeMain.py
snakeMain.py
py
885
python
en
code
0
github-code
7
[ { "api_name": "world.World", "line_number": 10, "usage_type": "call" }, { "api_name": "world.unit_test", "line_number": 11, "usage_type": "call" }, { "api_name": "world.World", "line_number": 15, "usage_type": "call" }, { "api_name": "world.make_moves", "line_...
17748441600
from pytube import Playlist, YouTube import re from datetime import timedelta from tqdm import tqdm # Ask user for YouTube playlist URL playlist_url = input("Enter YouTube playlist URL: ") # Extract playlist ID from URL playlist_id = re.findall(r"(?<=list=)[^&$]+", playlist_url)[0] # Initialize playlist object playl...
KhalsaAnonymous/youtube_playlist_duration
youtube_playlist_duration.py
youtube_playlist_duration.py
py
893
python
en
code
0
github-code
7
[ { "api_name": "re.findall", "line_number": 10, "usage_type": "call" }, { "api_name": "pytube.Playlist", "line_number": 13, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 22, "usage_type": "call" }, { "api_name": "pytube.YouTube", "line_numbe...