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
35020713686
import openslide import os import numpy as np import random import json import joblib import seaborn as sns import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import pandas as pd import anndata as ad from sklearn.metrics import confusion_matrix as cfm import argparse from pathlib import Path impor...
boqchen/MVS
codebase/downstream_tasks/cell_typing/apply_rf.py
apply_rf.py
py
6,695
python
en
code
0
github-code
71
[ { "api_name": "matplotlib.use", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.device", "line_number": 37, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 37, "usage_type": "call" }, { "api_name": "torch.cuda", "...
18430835582
import pandas as pd from timeit import default_timer as timer from os.path import dirname import datetime import os """ The caller should measure duration and pass here along with parameters. This program will create CSV if it does not exist. If this CSV exists, we will update it. Thus we will add a new line in the ...
borisgarbuzov/project2
project2/src/calculate_time.py
calculate_time.py
py
1,815
python
en
code
0
github-code
71
[ { "api_name": "datetime.datetime.now", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path....
70260880871
import struct import os from pathlib import Path from PIL import Image import cv2 as cv import numpy as np from tqdm import tqdm def write_txt(save_path: str, content: list, mode='w'): """ 將list內容寫入txt中 @param content: list格式內容 save_path: 絕對路徑str @return:None """ with open(save_path, m...
cjwang0318/HandWriting
CASIA_to_paddle_format.py
CASIA_to_paddle_format.py
py
5,811
python
en
code
0
github-code
71
[ { "api_name": "pathlib.Path", "line_number": 24, "usage_type": "call" }, { "api_name": "struct.unpack", "line_number": 37, "usage_type": "call" }, { "api_name": "struct.unpack", "line_number": 41, "usage_type": "call" }, { "api_name": "struct.unpack", "line_nu...
27578930911
# testy_wdlocal.py 14 Feb 2021 # for Dataset id in list, perform wdlocal recon, write results to file from django.contrib.auth.models import User from django.shortcuts import get_object_or_404 import codecs, pytz import simplejson as json from datetime import datetime from datasets.models import Dataset, Hit from dat...
WorldHistoricalGazetteer/whgazetteer
tests/testy_wdlocal.py
testy_wdlocal.py
py
4,632
python
en
code
18
github-code
71
[ { "api_name": "django.shortcuts.get_object_or_404", "line_number": 16, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.User", "line_number": 16, "usage_type": "argument" }, { "api_name": "django.shortcuts.get_object_or_404", "line_number": 17, "usage_typ...
41431199067
import os import torch import csv import glob import logging import argparse import numpy as np import dask.dataframe as dd from typing import List, Any, Optional, Tuple from tqdm.auto import tqdm, trange from collections import Counter from functools import partial from transformers import ( PreTrainedTokenizer, P...
kkkravets/Seq2Lightning
src/model_utils.py
model_utils.py
py
8,421
python
en
code
0
github-code
71
[ { "api_name": "logging.getLogger", "line_number": 21, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 24, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path", "line...
12132108938
# -*- coding=utf-8 -*- from PIL import Image import argparse # Add command arguments parser = argparse.ArgumentParser() parser.add_argument('file') parser.add_argument('-o', '--output') parser.add_argument('--width', type=int, default=80) parser.add_argument('--height', type=int, default=80) # Get arguments args = p...
qy-yang/Lets-play
img2ascii/img2ascii.py
img2ascii.py
py
1,163
python
en
code
0
github-code
71
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 36, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 36, "usage_type": "name" }, { "api_name": "PIL.Image.NEAREST", ...
3768963502
import requests from bs4 import BeautifulSoup def get_product_price(url): # Send a GET request to the product URL response = requests.get(url) # Parse the HTML content using BeautifulSoup soup = BeautifulSoup(response.content, 'html.parser') # Find the element containing the price # A...
Chamepp/Daily.py
General/72-ecommerce-price-tracking-and-comparison.py
72-ecommerce-price-tracking-and-comparison.py
py
834
python
en
code
89
github-code
71
[ { "api_name": "requests.get", "line_number": 6, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 9, "usage_type": "call" } ]
615608396
from flask import Flask, jsonify, request from flask_cors import CORS import main app = Flask(__name__) CORS(app) @app.route('/summoner', methods=['GET']) def get_summoner(): summoner_name = request.args.get('summoner_name') region = request.args.get('region') api_key = request.args.get('api_key') sum...
yngOtto/JungleKing
app.py
app.py
py
474
python
en
code
3
github-code
71
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.request.args.get", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.request.args",...
20512516103
import pandas as pd import os.path import re import numpy as np import scipy.stats def file_exists(fn): return os.path.isfile(fn) def read_table(fn, indiv_col): _, fn_ext = os.path.splitext(fn) compress_args = {} if fn_ext == '.gz': fn_new = re.sub('.gz$', '', fn) compress_args = {'co...
liangyy/brainxcan
brainxcan/sbxcan/util/misc.py
misc.py
py
1,122
python
en
code
0
github-code
71
[ { "api_name": "os.path.path.isfile", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path", "line_number": 9, "usage_type": "name" }, { "api_name": "os.path.path.splitext", ...
36551794623
from itsdangerous import BadSignature, SignatureExpired from itsdangerous import TimedJSONWebSignatureSerializer as Serializer from utils.Response import Response, Success, Error import time # 采用JWT技术,产生token并返回给前端 SECRET_KEY = 'Backend for online chat web system' class Token: # 生成token,有效期60min @staticmetho...
umbrella-leaf/online-chat
online-chat-backend/utils/Token.py
Token.py
py
1,200
python
en
code
0
github-code
71
[ { "api_name": "itsdangerous.TimedJSONWebSignatureSerializer", "line_number": 14, "usage_type": "call" }, { "api_name": "utils.Response.Success", "line_number": 15, "usage_type": "call" }, { "api_name": "time.time", "line_number": 17, "usage_type": "call" }, { "api...
37702151414
# Generator Code import torch.nn as nn import torch.nn.functional as F class Generator(nn.Module): def __init__(self): super(Generator, self).__init__() self.conv_t_1 = nn.ConvTranspose1d(128, 256, kernel_size=4, stride=4, bias=False) self.b_n_1 = nn.BatchNorm1d(256) self.conv_t_2 ...
Torng/Music_Generator
Module/generator.py
generator.py
py
1,266
python
en
code
0
github-code
71
[ { "api_name": "torch.nn.Module", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 6, "usage_type": "name" }, { "api_name": "torch.nn.ConvTranspose1d", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.nn", "l...
25885530266
from sklearn.feature_extraction.text import TfidfVectorizer import pandas as pd from nltk.tokenize import word_tokenize import os import numpy as np import gensim from sklearn.decomposition import PCA from sklearn.random_projection import GaussianRandomProjection import logging from stanfordcorenlp import StanfordCoreN...
pdhung3012/SoftwareStoryPointsPrediction
devItems/spring-2020/SEEAccuracyImprove/trainAll_D2v/step1_vectorizeByD2v.py
step1_vectorizeByD2v.py
py
3,654
python
en
code
0
github-code
71
[ { "api_name": "os.mkdir", "line_number": 29, "usage_type": "call" }, { "api_name": "gensim.models.doc2vec.Doc2Vec.load", "line_number": 82, "usage_type": "call" }, { "api_name": "gensim.models.doc2vec.Doc2Vec", "line_number": 82, "usage_type": "name" }, { "api_nam...
8286388093
from tkinter import * import random from datetime import datetime from time import sleep from threading import Thread import re from tkinter import ttk import pyfirmata # На плате Arduino Uno задействованы следующие цифровы пины: # 5 - реле; # 7 - реле 'Подключи Arduino к порту номер 3' board = pyfirmata.Arduino('COM...
denisamirov/solar_clean_system_scripts
python_code/solar_panels_clean_system_python.pyw
solar_panels_clean_system_python.pyw
pyw
14,953
python
en
code
0
github-code
71
[ { "api_name": "pyfirmata.Arduino", "line_number": 15, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 49, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 50, "usage_type": "call" }, { "api_name": "re.findall", "line_number...
70841560551
#!/opt/anaconda3/bin/python # -*- coding: UTF-8 -*- """ @Author: njuselhx @Time: 2021/1/18 下午8:34 @File: compute.py @Software: PyCharm """ import math import jieba import pymongo def tokenize(data): words = jieba.cut(data) word_list = [] for word in words: word_list.append(word) return word_l...
FertileFragrance/data_not_scientific
tf-idf/compute.py
compute.py
py
4,058
python
en
code
5
github-code
71
[ { "api_name": "jieba.cut", "line_number": 16, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 38, "usage_type": "call" }, { "api_name": "math.log10", "line_number": 71, "usage_type": "call" } ]
18970086427
import os import numpy as np from scipy.spatial.transform import Rotation as R import matplotlib.pyplot as plt from pytransform3d.plot_utils import plot_vector def fix_transformation(transformation): fixed_transformation = np.zeros((4,4)) fixed_transformation[3,3] = 1 q = R.from_matrix(transformation[:3, :...
daniellehot/handover_orientation_analysis
visual_analysis.py
visual_analysis.py
py
3,805
python
en
code
0
github-code
71
[ { "api_name": "numpy.zeros", "line_number": 8, "usage_type": "call" }, { "api_name": "scipy.spatial.transform.Rotation.from_matrix", "line_number": 10, "usage_type": "call" }, { "api_name": "scipy.spatial.transform.Rotation", "line_number": 10, "usage_type": "name" }, ...
13549717413
import datetime from django.db import models from django.utils import timezone class Session(models.Model): day = models.DateField(default=timezone.now) duration = models.TimeField(default=datetime.time) error = models.BooleanField(default=False) def calculate_duration(self): start_time = No...
shifty11/timetracker
tracker/models.py
models.py
py
2,275
python
en
code
0
github-code
71
[ { "api_name": "django.db.models.Model", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.models.DateField", "line_number": 8, "usage_type": "call" }, { "api_name": "...
70265315750
##### #Collection of SAM,BAM,FASTA,FASTQ and MicroRazers parsers ##### #import pysam import re import sys #sys.path.append('/storage/brno2/home/ivogel/.local/lib/python2.7/site-packages') #sys.path.append('/storage/brno2/home/ivogel/.local/lib/python2.7/site-packages') import pysam def parseGenomicID(name): if na...
puko818/BUT_projects
TE_HOMOLOGIES/Parsers.py
Parsers.py
py
6,738
python
en
code
0
github-code
71
[ { "api_name": "re.match", "line_number": 24, "usage_type": "call" }, { "api_name": "pysam.AlignmentFile", "line_number": 34, "usage_type": "call" }, { "api_name": "pysam.AlignmentFile", "line_number": 56, "usage_type": "call" } ]
39437785238
import matplotlib.pyplot as plt import numpy as np import random N = int(input()) print(N) test = 1000 count=[0 for i in range(N+1)] # Stores the count of the total occurrences for t in range(test): X1 = 0 X2 = 0 X = [0 for i in range(0,N+1)] # probability of X being there for i ...
Vikr-182/Random-walkers-implementation
script.py
script.py
py
831
python
en
code
0
github-code
71
[ { "api_name": "random.randint", "line_number": 15, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.xlabel", "line_number": 34, "usage_type": "call" }, { "api_name": "matplotlib.pyp...
71142779430
#https://www.hackerrank.com/challenges/largest-permutation #points 30 from collections import defaultdict n, k = map(int, input().split()) array = list(map(int, input().split())) ar_enum = defaultdict(int) for i in range(n): ar_enum[array[i]] = i j = 0 l = 0 if n > 1: for i in range(n, 0, -1): if ...
Azim-Islam/Problem-Solving-DSA
HackerRank/hr_largest_permutation.py
hr_largest_permutation.py
py
706
python
en
code
4
github-code
71
[ { "api_name": "collections.defaultdict", "line_number": 10, "usage_type": "call" } ]
39840895095
""" Managing camera input and barcode detection """ from __future__ import annotations from PyQt5.QtWidgets import QFrame, QLabel, QSizePolicy from PyQt5.QtCore import Qt, QThread, pyqtSlot, pyqtSignal from PyQt5.QtGui import QImage, QPixmap from config.macros import FRAME_RATE, FRAMES_BEETWEEN_SCANS from pyzbar import...
michalwilk123/STManager
src/main/python/gui/cameraDisplay.py
cameraDisplay.py
py
6,945
python
en
code
1
github-code
71
[ { "api_name": "PyQt5.QtCore.QThread", "line_number": 17, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 18, "usage_type": "call" }, { "api_name": "PyQt5.QtGui.QImage", "line_number": 18, "usage_type": "argument" }, { "api_name": "c...
18958817928
import base64 import time from io import BytesIO as _BytesIO import dash import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output import digits_server from predict_all import * external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css'] app = dash....
galipremsagar/Cross-Domain-Transfer-Net
app.py
app.py
py
17,845
python
en
code
0
github-code
71
[ { "api_name": "dash.Dash", "line_number": 15, "usage_type": "call" }, { "api_name": "time.time", "line_number": 27, "usage_type": "call" }, { "api_name": "io.BytesIO", "line_number": 29, "usage_type": "call" }, { "api_name": "base64.b64encode", "line_number": ...
14582677414
from django.shortcuts import render from .models import * from django.http import JsonResponse,HttpResponse import json import time, datetime def get(request): queryset=Book.objects.all() book_list=[] for book in queryset: timeArray = time.localtime(book.times) otherStyleTime = t...
2569792062/work_book
shuji/views.py
views.py
py
1,306
python
en
code
0
github-code
71
[ { "api_name": "time.localtime", "line_number": 11, "usage_type": "call" }, { "api_name": "time.strftime", "line_number": 12, "usage_type": "call" }, { "api_name": "django.http.HttpResponse", "line_number": 22, "usage_type": "call" }, { "api_name": "django.http.Htt...
43048596445
import warnings import math import torch from time import time import numpy as np import pynvml from .init_methods import init_methods class KMeans: ''' Kmeans clustering algorithm implemented with PyTorch Parameters: n_clusters: int, Number of clusters max_iter: int, default: 100 ...
divelab/LECI
GOOD/utils/fast_pytorch_kmeans/kmeans.py
kmeans.py
py
10,902
python
en
code
8
github-code
71
[ { "api_name": "warnings.warn", "line_number": 58, "usage_type": "call" }, { "api_name": "torch.cuda.device", "line_number": 102, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 102, "usage_type": "attribute" }, { "api_name": "torch.cuda.synchron...
12168819458
#!/usr/bin/env python3 import os import sys import struct import parser from collections import namedtuple import ctypes import argparse ############# global variables pd_complete = '' inputfile = '' outputfile = '' list_of_pde = {} num_of_regions = 0 read_buff='' struct_mmu_regions_tuple = {"start_addr","size","per...
fractalclone/zephyr-riscv
scripts/gen_mmu.py
gen_mmu.py
py
18,562
python
en
code
24
github-code
71
[ { "api_name": "collections.namedtuple", "line_number": 20, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 22, "usage_type": "call" }, { "api_name": "struct.unpack_from", "line_number": 86, "usage_type": "call" }, { "api_name": "stru...
41887893638
from itertools import count from . import views from django.shortcuts import redirect, render from dojo_ninjas_app.models import dojos ,ninjas def index(request): dojos_table = dojos.objects.all() ninjas_table = ninjas.objects.all() context= { "ninjas" : ninjas_table, "dojos" : dojos_table ...
ReemAllharbi/PYTHON
dojo_ninjas_proj/dojo_ninjas_app/views.py
views.py
py
1,107
python
en
code
0
github-code
71
[ { "api_name": "dojo_ninjas_app.models.dojos.objects.all", "line_number": 7, "usage_type": "call" }, { "api_name": "dojo_ninjas_app.models.dojos.objects", "line_number": 7, "usage_type": "attribute" }, { "api_name": "dojo_ninjas_app.models.dojos", "line_number": 7, "usage_...
27936776230
from django.shortcuts import render,redirect from django.contrib import messages # DELETED -->from django.contrib.auth.forms import UserCreationForm from .forms import UserRegisterForm, UserUpdateForm, ProfileUpdateForm from django.contrib.auth.decorators import login_required # importing Model forms i.e UserUpdateForm...
rajdeepp26/Tech-blog-app
users/views.py
views.py
py
1,978
python
en
code
1
github-code
71
[ { "api_name": "forms.UserRegisterForm", "line_number": 12, "usage_type": "call" }, { "api_name": "django.contrib.messages.success", "line_number": 16, "usage_type": "call" }, { "api_name": "django.contrib.messages", "line_number": 16, "usage_type": "name" }, { "ap...
3105690289
# -*- coding: utf8 -*- """ ====================================== Project Name: RE-For-NER File Name: model Author: czh Create Date: 2021/3/23 -------------------------------------- Change Activity: ====================================== """ # 将ner问题建模为关系抽取问题,已知subject_entity和relation,预测object enti...
zhihao-chen/re_for_ner
ReNER/models/model.py
model.py
py
5,222
python
en
code
1
github-code
71
[ { "api_name": "torch.nn.Module", "line_number": 26, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 26, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 33, "usage_type": "call" }, { "api_name": "torch.nn", "line_nu...
7525161322
from __future__ import division from __future__ import print_function import threading import time import os from six.moves import queue as Queue # pylint: disable=redefined-builtin from six.moves import xrange # pylint: disable=redefined-builtin import tensorflow.compat.v1 as tf from tensorflow.core.protobuf impor...
bytedance/monolith
monolith/core/auto_checkpoint_feed_hook.py
auto_checkpoint_feed_hook.py
py
13,866
python
en
code
702
github-code
71
[ { "api_name": "time.time", "line_number": 27, "usage_type": "call" }, { "api_name": "time.time", "line_number": 28, "usage_type": "call" }, { "api_name": "tensorflow.compat.v1.compat.v1.logging.info", "line_number": 29, "usage_type": "call" }, { "api_name": "tenso...
11346497312
from collections import deque class Solution: def racecar(self, target: int) -> int: if target == 0: return 0 # step, location, speed q = deque([(0, 0, 1)]) # (loc, speed) explored = set() while q: # print(q) num_instructions,...
chutianwen/jobhunt2023
leetcode/bfs/race_car.py
race_car.py
py
1,158
python
en
code
1
github-code
71
[ { "api_name": "collections.deque", "line_number": 11, "usage_type": "call" } ]
11566539309
from django.shortcuts import render, redirect, get_object_or_404 from .forms import DataForm, OptionForm from .models import Data, Option from django.contrib import messages from django.core.paginator import Paginator from django.contrib.auth.decorators import login_required @login_required def add_data(request): for...
programmerzia/bloodbank
master_data/views.py
views.py
py
2,652
python
en
code
1
github-code
71
[ { "api_name": "forms.DataForm", "line_number": 10, "usage_type": "call" }, { "api_name": "forms.DataForm", "line_number": 12, "usage_type": "call" }, { "api_name": "django.contrib.messages.success", "line_number": 15, "usage_type": "call" }, { "api_name": "django....
42054315862
import matplotlib.pyplot as plt import numpy as np xIndex = np.arange(6) w = 0.4 x = [chr(x) for x in range(65, 71)] y = [4, 9, 1, 7, 3, 5] y2 = [9, 5, 6, 7, 1, 7] ''' HORIZONTAL plt.barh(xIndex - w/2, y, label="bar 1", height=w, color='b') plt.barh(xIndex + w/2, y2, label="bar 2", height=w, color='c') plt.yticks(x...
gayatri-p/python-stuff
matplotlib/bar_chart.py
bar_chart.py
py
552
python
en
code
0
github-code
71
[ { "api_name": "numpy.arange", "line_number": 4, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.bar", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 17, "usage_type": "name" }, { "api_name": "matplotlib.pyplot...
4561862606
from flask import Flask, render_template, request, jsonify app = Flask(__name__) from pymongo import MongoClient client = MongoClient('mongodb+srv://test:sparta@cluster0.msldn.mongodb.net/Cluster0?retryWrites=true&w=majority') db = client.dbsparta # import requests # from bs4 import BeautifulSoup # # headers = {'U...
eisont/Publishing
hanghae99/hanghae99_Sparta/projects/idea_site/app.py
app.py
py
2,215
python
ko
code
0
github-code
71
[ { "api_name": "flask.Flask", "line_number": 3, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 30, "usage_type": "call" }, { "api_name": "flask.request.for...
14682102692
import csv import re import warnings import numpy as np from .config import DIR warnings.filterwarnings("ignore") def get_word_vector(s1, s2): """ :param s1: 句子1 :param s2: 句子2 :return: 返回中英文句子切分后的向量 """ # 把句子按字分开,中文按字分,英文按单词,数字按空格 regEx = re.compile("[\\W]*") res = re.compile(r"([\u4...
YouZijun97/pwc
src/cos_simi.py
cos_simi.py
py
3,663
python
en
code
0
github-code
71
[ { "api_name": "warnings.filterwarnings", "line_number": 7, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 17, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_...
75121109990
import math from typing import Dict, List from .paths import * def load_frecent_characters() -> List[str]: return list(__load_frecent_characters().keys()) def __load_frecent_characters() -> Dict[str, float]: frecencies = {} try: with frecency_file_location.open("r") as file: for lin...
fdw/rofimoji
src/picker/frecent.py
frecent.py
py
1,108
python
en
code
738
github-code
71
[ { "api_name": "typing.List", "line_number": 7, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 11, "usage_type": "name" }, { "api_name": "math.floor", "line_number": 35, "usage_type": "call" } ]
3263695422
# Squeeze-and-Excitation Networks # https://arxiv.org/pdf/1709.01507.pdf """ 一种通道注意力机制。由于特征压缩和FC的存在,其捕获的通道注意力特征是具有全局信息的。 """ import torch import torch.nn as nn class SE_Block(nn.Module): def __init__(self, in_channel, reduction=16): super(SE_Block, self).__init__() self.avg_pool = nn.AdaptiveAvg...
RacleRay/RaychSnippts
raych/layers/cnn/se.py
se.py
py
952
python
en
code
1
github-code
71
[ { "api_name": "torch.nn.Module", "line_number": 12, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 12, "usage_type": "name" }, { "api_name": "torch.nn.AdaptiveAvgPool2d", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.nn", ...
35871477476
__authors__ = 'Marija Aleksejeva, Daniil Kolomeitsev, Jevgenij Mozajev,' \ ' Nina Mustafina, Svetlana Pavlova' import os import justext import re # This function cleans up the pages using justext. A new directory # with clean pages is created. The link is saved in the first line # of each file. def cl...
sweeterr/dumb_search_engine
project_cleaning.py
project_cleaning.py
py
1,683
python
en
code
0
github-code
71
[ { "api_name": "re.compile", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number...
28866873412
import original_filenames import json import collections import os.path def create_work_files(og_file): """ :param og_file: an original forum json-file with no modifications :return: send a dict for each file to function "separate_each_month" """ data = collections.defaultdict(list) with open(...
SickanEkman/Forum-trends
prepare_original_files.py
prepare_original_files.py
py
2,009
python
en
code
0
github-code
71
[ { "api_name": "collections.defaultdict", "line_number": 12, "usage_type": "call" }, { "api_name": "json.load", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.mkdir", "line_number": 41, "usage_type": "call" }, { "api_name": "os.path", "line_n...
36802233524
import paho.mqtt.client as mqtt import json from time import sleep from test.lib import run_shell key_list = ['button_ok', 'button_right', 'button_left', 'button_down', 'button_UP'] mqttc = {} gpio = 0 def buzzer(): run_shell('echo {} > /sys/class/gpio/export'.format(str(gpio))) run_shell('echo "out" > /sys/c...
liuchengyiu/power_control_test
power_control_test/test/hardware/key/key.py
key.py
py
1,831
python
en
code
0
github-code
71
[ { "api_name": "test.lib.run_shell", "line_number": 11, "usage_type": "call" }, { "api_name": "test.lib.run_shell", "line_number": 12, "usage_type": "call" }, { "api_name": "test.lib.run_shell", "line_number": 13, "usage_type": "call" }, { "api_name": "time.sleep",...
74840051749
"""Label a pull request based on its type.""" import enum import pathlib from . import util TYPE_LABEL_PREFIX = "type" @enum.unique class Labels(enum.Enum): """Labels that can be applied to a Pull Request.""" type_bug = f"{TYPE_LABEL_PREFIX}-bug" docs = "docs" type_feature = f"{TYPE_LABEL_PREFIX}-f...
python/bedevere
bedevere/prtype.py
prtype.py
py
1,733
python
en
code
112
github-code
71
[ { "api_name": "enum.Enum", "line_number": 11, "usage_type": "attribute" }, { "api_name": "enum.unique", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pathlib.PurePath", "line_number": 45, "usage_type": "call" } ]
1845172428
import tensorflow as tf import tensorflow_addons as tfa from nets.models.base import BaseTFKerasModel @tf.keras.utils.register_keras_serializable("nets") class GatedMixture(BaseTFKerasModel): """ Gated mixture of experts. Takes raw inputs, passes them through each expert and gate layer pair, elemen...
abw-24/nets
src/nets/models/mixture.py
mixture.py
py
2,229
python
en
code
1
github-code
71
[ { "api_name": "nets.models.base.BaseTFKerasModel", "line_number": 9, "usage_type": "name" }, { "api_name": "tensorflow.keras.layers.Dense", "line_number": 33, "usage_type": "call" }, { "api_name": "tensorflow.keras", "line_number": 33, "usage_type": "attribute" }, { ...
30741375610
import pygame, sys, os, random class Carro_inimigo(pygame.sprite.Sprite): def __init__(self, screen): pygame.sprite.Sprite.__init__(self) self.screen = screen self.posicoes = [[480, 350], [505, 350]] self.posicao = random.choice(self.posicoes) self.objetos = ['adv_car.png', ...
RonnanSouza/need_py_speed_game
Game/objetos_pista.py
objetos_pista.py
py
2,418
python
pt
code
0
github-code
71
[ { "api_name": "pygame.sprite", "line_number": 3, "usage_type": "attribute" }, { "api_name": "pygame.sprite.Sprite.__init__", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.sprite", "line_number": 5, "usage_type": "attribute" }, { "api_name": "rand...
36137268312
from transformers import ( RobertaForMaskedLM, RobertaForTokenClassification, AutoTokenizer ) from collections import Counter def load_roberta(model_path, mode="prompt"): tokenizer = AutoTokenizer.from_pretrained(model_path, use_fast=True, add_prefix_space=True, do_lower_case=False) if mode == "pr...
LogIntelligence/LogPPT
logppt/models/roberta.py
roberta.py
py
2,064
python
en
code
40
github-code
71
[ { "api_name": "transformers.AutoTokenizer.from_pretrained", "line_number": 10, "usage_type": "call" }, { "api_name": "transformers.AutoTokenizer", "line_number": 10, "usage_type": "name" }, { "api_name": "transformers.RobertaForMaskedLM.from_pretrained", "line_number": 12, ...
36090435314
import logging import telegram from telegram import Update from telegram.error import TelegramError from telegram.ext import CallbackContext, CommandHandler, Updater from eliud.conf import settings from eliud.markups.base import BaseMarkup logger = logging.getLogger("eliud.telegram") class Bot: """ Constru...
ragnarok22/eliud
eliud/telegram/__init__.py
__init__.py
py
2,345
python
en
code
10
github-code
71
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "eliud.conf.settings.TELEGRAM_TOKEN", "line_number": 20, "usage_type": "attribute" }, { "api_name": "eliud.conf.settings", "line_number": 20, "usage_type": "name" }, { "api...
71938513511
# for task2 chaos import os import SimpleITK as sitk res=[] for filename in os.listdir(r'CT'): # print(filename+'/DICOM_anon') res.append(filename+'/DICOM_anon') # print(res) for i in res: file_path = os.path.join('CT',i) #dicom存放文件夹 print(i.split('/')[0]) print(file_path) series_IDs = sitk.Im...
zz10001/LITS2017-main1
data_prepare/dcm2nii.py
dcm2nii.py
py
646
python
en
code
49
github-code
71
[ { "api_name": "os.listdir", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "SimpleITK.ImageSeriesReader.GetGD...
36526538023
"""first. Revision ID: de23d4edb0e2 Revises: Create Date: 2021-12-20 11:41:48.292514 """ import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision = "de23d4edb0e2" down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands auto generated by A...
probicheaux/brackend
alembic/versions/de23d4edb0e2_first.py
de23d4edb0e2_first.py
py
1,762
python
en
code
1
github-code
71
[ { "api_name": "alembic.op.create_table", "line_number": 19, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 19, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 21, "usage_type": "call" }, { "api_name": "sqlalchemy.Integ...
26661054580
from django.shortcuts import render,get_object_or_404 from post.models import post from subscribe.models import sub from django.core.paginator import Paginator,EmptyPage,PageNotAnInteger from django.db.models import Count,Q def search(request): queryset=post.objects.all() searched=request.GET.get('q') if searched: ...
sarkersourav55/Sourav-s_blog
index/views.py
views.py
py
1,547
python
en
code
0
github-code
71
[ { "api_name": "post.models.post.objects.all", "line_number": 8, "usage_type": "call" }, { "api_name": "post.models.post.objects", "line_number": 8, "usage_type": "attribute" }, { "api_name": "post.models.post", "line_number": 8, "usage_type": "name" }, { "api_name...
70146115430
from fastapi import FastAPI, Request, HTTPException, status from fastapi.responses import HTMLResponse, FileResponse, JSONResponse import uvicorn from sklearn.datasets import load_iris from sklearn.naive_bayes import GaussianNB from pydantic import BaseModel from fastapi.staticfiles import StaticFiles from fastapi.midd...
jeanth20/Movie_recommendation_ML
app.py
app.py
py
5,464
python
en
code
0
github-code
71
[ { "api_name": "fastapi.FastAPI", "line_number": 13, "usage_type": "call" }, { "api_name": "fastapi.staticfiles.StaticFiles", "line_number": 15, "usage_type": "call" }, { "api_name": "fastapi.templating.Jinja2Templates", "line_number": 17, "usage_type": "call" }, { ...
33828949718
""" This file holds the trainer for the segmentation network. """ import argparse import numpy as np import os import platform # pytorch includes import torch import torch.nn as nn import torchvision as tv from torch.autograd import Variable from torch.utils.data import DataLoader # ml_utils includes from general.ut...
OpenGeoscience/deepres
cropnet/cropnet/segmenter.py
segmenter.py
py
3,131
python
en
code
5
github-code
71
[ { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "os.path", "line_number": 26, "usage_type": "attribute" }, { "api_name": "os.path.expanduser", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_numb...
74839515109
from _pytest.logging import LogCaptureFixture import pytest from pytest_mock import MockerFixture from mock import AsyncMock from pythclient.solana import SolanaAccount, SolanaPublicKey, SolanaClient @pytest.fixture def solana_pubkey() -> SolanaPublicKey: return SolanaPublicKey("AHtgzX45WTKfkPG53L6WYhGEXwQkN1B...
pyth-network/pyth-client-py
tests/test_solana_account.py
test_solana_account.py
py
3,047
python
en
code
34
github-code
71
[ { "api_name": "pythclient.solana.SolanaPublicKey", "line_number": 13, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pythclient.solana.SolanaPublicKey", "line_number": 12, "usage_type": "name" }, ...
1502950721
import math import time import collections from sqlalchemy import func, or_, and_, desc from sqlalchemy.orm import joinedload from clld.db.meta import DBSession from clld.db.models import common from matplotlib.cm import viridis from matplotlib.colors import to_hex from gramfinder import models from gramfinder.maps i...
clld/gramfinder
gramfinder/views.py
views.py
py
3,313
python
en
code
1
github-code
71
[ { "api_name": "matplotlib.colors.to_hex", "line_number": 18, "usage_type": "call" }, { "api_name": "matplotlib.cm.viridis", "line_number": 18, "usage_type": "call" }, { "api_name": "clld.db.meta.DBSession.query", "line_number": 22, "usage_type": "call" }, { "api_n...
5714632608
#!/usr/bin/env python3 # Convert a DICOM file into plain text in a suitable format # for passing into the anonymisation/annotations parts of SemEHR. # Can alternatively read from the MongoDB dicom database instead of files. # Usage: -y default.yaml -i input -o output # -y = path to the default.yaml file to get FileSy...
SMI/SmiServices
src/applications/SRAnonTool/CTP_DicomToText.py
CTP_DicomToText.py
py
13,521
python
en
code
18
github-code
71
[ { "api_name": "SmiServices.IdentifierMapper.CHItoEUPI", "line_number": 60, "usage_type": "call" }, { "api_name": "SmiServices.IdentifierMapper", "line_number": 60, "usage_type": "name" }, { "api_name": "os.path.isdir", "line_number": 84, "usage_type": "call" }, { ...
41936897456
from ctypes import * import cv2 from PyQt5 import QtWidgets, QtGui, QtCore import numpy as np # Carrega a biblioteca compartilhada contendo a função de filtro de mediana em C mediana_lib = CDLL("./filtro_mediana.so") # Define os tipos de argumentos e retorno para a função de filtro de mediana em C mediana_lib.filtro_...
marcio-henriquemh/Processamento-de-Imagens-UFS
filtro_mediana/filtro_2.py
filtro_2.py
py
5,525
python
pt
code
0
github-code
71
[ { "api_name": "numpy.ctypeslib.as_array", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.ctypeslib", "line_number": 19, "usage_type": "attribute" }, { "api_name": "cv2.medianBlur", "line_number": 23, "usage_type": "call" }, { "api_name": "PyQt5.Qt...
21661705717
import torch import torch.nn as nn import torch.optim as optim from torch.utils.data import DataLoader, Dataset from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score import json from collections import Counter # Load the features from the JSON file with open('./features.json',...
mbooch22/pet-celebrity-lookalike-backend
src/train_classifier.py
train_classifier.py
py
2,615
python
en
code
0
github-code
71
[ { "api_name": "json.load", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.tensor", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.float32", "line_number": 19, "usage_type": "attribute" }, { "api_name": "torch.tensor", "line_nu...
27004898360
#!/usr/bin/env python # data analysis example program # Including some examples of how to use DataFrames from pandas # # Usage : # python analysis.py -i test.dat import pickle import numpy as np import matplotlib.pyplot as plt import argparse from event import Event, Pulse parser = argparse.ArgumentParser(descripti...
jimbrooke/CosmicRayExpt
analysis/analysis.py
analysis.py
py
2,319
python
en
code
0
github-code
71
[ { "api_name": "argparse.ArgumentParser", "line_number": 16, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 27, "usage_type": "call" }, { "api_name": "event.pulses", "line_number": 36, "usage_type": "attribute" }, { "api_name": "event.pulses", ...
2203550366
from setuptools import setup, find_packages requirements = [ 'numpy >=1.14.6', 'scipy >=1.1.0', ] setup_requires = [ 'numpy', 'scipy' ] setup( name = 'clayton', version = '0.0.3', description = 'Sampling from copulae', long_description=open('README.md', 'r').read(), author = 'Al...
Aleboul/clayton
setup.py
setup.py
py
563
python
en
code
4
github-code
71
[ { "api_name": "setuptools.setup", "line_number": 13, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 24, "usage_type": "call" } ]
17660048180
from flask import Flask, render_template, request, redirect, flash from flask_debugtoolbar import DebugToolbarExtension from utility import append_data,load_data app = Flask(__name__) app.config["SECRET_KEY"] = 'whateverpassword' app.config["SEND_FILE_MAX_AGE_DEFAULT"] = 0 tales = load_data() @app.route('/') def mai...
nikgun1984/Madlibs-with-Flask
app.py
app.py
py
1,200
python
en
code
0
github-code
71
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "utility.load_data", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.render_templa...
12811777879
import os from celery import Celery from celery.schedules import crontab os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings') app = Celery('backend') # Using a string here means the worker don't have to serialize # the configuration object to child processes. # - namespace='CELERY' means all celery-re...
jacoblimjy/HawkHub-Software-Engineering-Project
backend/backend/celery.py
celery.py
py
1,194
python
en
code
0
github-code
71
[ { "api_name": "os.environ.setdefault", "line_number": 5, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 5, "usage_type": "attribute" }, { "api_name": "celery.Celery", "line_number": 7, "usage_type": "call" }, { "api_name": "celery.schedules.cro...
70320639911
"""survey URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.2/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Clas...
QoobIY/survey
survey/survey/urls.py
urls.py
py
2,056
python
en
code
0
github-code
71
[ { "api_name": "rest_framework.schemas.openapi.SchemaGenerator", "line_number": 23, "usage_type": "name" }, { "api_name": "django.urls.path", "line_number": 44, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 44, "usage_type": "attribute" ...
24850055028
import sys import hashlib import random import statistics import math import time def getParameters(): try: u = sys.argv[1] k = sys.argv[2] c = sys.argv[3] widthOfConfidenceInterval = sys.argv[4] if (u is False or k is False or c is False or widthOfConfidenceInterval is Fals...
CarlTern/MicroMintSimulator
MicroMintSimulator.py
MicroMintSimulator.py
py
2,553
python
en
code
0
github-code
71
[ { "api_name": "sys.argv", "line_number": 10, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 12, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number...
28833280692
import tensorflow as tf import tensorflow.keras as tfk from ..utils.metrics import AOP class ProtectedClassifier(tfk.Model): def __init__(self, classifier, discriminator): super(ProtectedClassifier, self).__init__() self.classifier = classifier self.softmax = tfk.Sequential(classifier.layer...
EugenioTL/discriminative-adversarial-privacy
models/discriminative_adversarial_privacy_model.py
discriminative_adversarial_privacy_model.py
py
9,004
python
en
code
1
github-code
71
[ { "api_name": "tensorflow.keras.Model", "line_number": 5, "usage_type": "attribute" }, { "api_name": "tensorflow.keras", "line_number": 5, "usage_type": "name" }, { "api_name": "tensorflow.keras.Sequential", "line_number": 9, "usage_type": "call" }, { "api_name": ...
70897413990
import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu') class SiameseNetwork(nn.Module): def __init__(self, args): super(SiameseNetwork, self).__init__() C = args.output_...
rifkiaputri/Relation-Aligner
siamese_pcnn.py
siamese_pcnn.py
py
3,483
python
en
code
0
github-code
71
[ { "api_name": "torch.device", "line_number": 6, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 6, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn.Module", ...
20585713793
#!/usr/bin/env python # coding: utf-8 # <h1> Functionality 3 - Shortest Ordered Route</h1> #import libraries import pandas as pd import csv import networkx as nx import matplotlib.pyplot as plt from networkx.algorithms.shortest_paths.weighted import single_source_dijkstra import collections import heapq from collecti...
pujacj/ADM-HW5
func_3.py
func_3.py
py
11,631
python
en
code
0
github-code
71
[ { "api_name": "pandas.DataFrame", "line_number": 60, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 74, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 95, "usage_type": "call" }, { "api_name": "itertools.g...
34097992762
def get_arduino(port=None): """ This is a PyFirmata 'helper' that tries to connect to an Arduino compatible board. If no port is informed, using pyserial's serial.tools.list_ports.comports(), if one port is found, tries that one. If more than one port is found, shows for the user to choose ...
villares/sketch-a-day
2023/sketch_2023_06_12/inputs.py
inputs.py
py
3,931
python
en
code
193
github-code
71
[ { "api_name": "serial.tools.list_ports.comports", "line_number": 20, "usage_type": "call" }, { "api_name": "serial.tools.list_ports", "line_number": 20, "usage_type": "name" }, { "api_name": "pyfirmata.Arduino", "line_number": 47, "usage_type": "call" }, { "api_na...
69967635749
"""Utilities for reading and plotting ArcGIS binary files. This module contains some simple functions to make it easier to read and plot the data contained in the binary grid files produced by ArcGIS. """ import sys import numpy as np from numpy import ma def read_bin(fname): """Read data from a ArcGIS binary f...
sahg/PyTOPKAPI
pytopkapi/arcfltgrid.py
arcfltgrid.py
py
2,336
python
en
code
20
github-code
71
[ { "api_name": "numpy.fromstring", "line_number": 25, "usage_type": "call" }, { "api_name": "sys.byteorder", "line_number": 26, "usage_type": "attribute" }, { "api_name": "numpy.ma.masked_where", "line_number": 94, "usage_type": "call" }, { "api_name": "numpy.ma", ...
26539423626
from flask import render_template,request,session,g,flash,Flask,redirect,url_for from Controller import Configure import pyrebase from datetime import datetime firebase = pyrebase.initialize_app(Configure.firebaseConfig) auth = firebase.auth() db = firebase.database() storage = firebase.storage() def delete...
OmarAhmed8581/Tele-Medicines
Controller/Order/Order.py
Order.py
py
1,806
python
en
code
1
github-code
71
[ { "api_name": "pyrebase.initialize_app", "line_number": 6, "usage_type": "call" }, { "api_name": "Controller.Configure.firebaseConfig", "line_number": 6, "usage_type": "attribute" }, { "api_name": "Controller.Configure", "line_number": 6, "usage_type": "name" }, { ...
30138936658
#!/usr/bin/pthon3 """ UserSearches Module """ from os import getenv import models from models.base_model import BaseModel, Base from sqlalchemy import Column, String, ForeignKey, Integer, DateTime, Text,\ MetaData, Table from sqlalchemy.orm import relationship, backref storage_t = getenv("PHARMACY_Storage") cla...
Nne85/Pharma_Finda
models/user_searches.py
user_searches.py
py
1,050
python
en
code
1
github-code
71
[ { "api_name": "os.getenv", "line_number": 11, "usage_type": "call" }, { "api_name": "models.base_model.BaseModel", "line_number": 14, "usage_type": "name" }, { "api_name": "models.base_model.Base", "line_number": 14, "usage_type": "name" }, { "api_name": "models.s...
25480809011
from sklearn.model_selection import GridSearchCV from sklearn.pipeline import Pipeline from sklearn.linear_model import LogisticRegression from sklearn.feature_extraction.text import TfidfVectorizer from cleansing import * from load_data import load_IMDb import nltk def main(): x_train = load_clean_data() y_t...
onnga-wasabi/ml
ch08/train.py
train.py
py
1,748
python
en
code
0
github-code
71
[ { "api_name": "load_data.load_IMDb", "line_number": 12, "usage_type": "call" }, { "api_name": "load_data.load_IMDb", "line_number": 14, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords.words", "line_number": 16, "usage_type": "call" }, { "api_name": "n...
3609384723
import json from exceptions import FormatException, UnsupportedException from lib.utils import base64_url_decode class JWT: def __init__(self, text): jwt = text.split('.') if len(jwt) != 3: raise FormatException("jwt") self.header = json.loads(base64_url_decode(jwt[0]).decode...
tMorriss/attestation_checker
lib/jwt.py
jwt.py
py
673
python
en
code
0
github-code
71
[ { "api_name": "exceptions.FormatException", "line_number": 11, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 13, "usage_type": "call" }, { "api_name": "lib.utils.base64_url_decode", "line_number": 13, "usage_type": "call" }, { "api_name": "jso...
40380697400
#!/usr/bin/env python3 """Functional Python Programming Chapter 9, Example Set 3 http://www.tylervigen.com/view_correlation?id=7 http://www.tylervigen.com/view_correlation?id=97 http://www.tylervigen.com/view_correlation?id=3890 http://www.tylervigen.com/view_correlation?id=43 """ # pylint: disable=wildcard-import...
PacktPublishing/Functional-Python-Programming-Second-Edition
Chapter09/ch09_ex3.py
ch09_ex3.py
py
8,210
python
en
code
81
github-code
71
[ { "api_name": "urllib.request.request.urlopen", "line_number": 21, "usage_type": "call" }, { "api_name": "urllib.request.request", "line_number": 21, "usage_type": "attribute" }, { "api_name": "urllib.request", "line_number": 21, "usage_type": "name" }, { "api_nam...
70944145511
#------------------------------------------------------------------------------ """ Driver for a VersaTenn III Environmental Chamber Controller """ #------------------------------------------------------------------------------ import serial import time #-------------------------------------------------------------...
deadsy/tenney
vt3/vt3.py
vt3.py
py
2,044
python
en
code
0
github-code
71
[ { "api_name": "serial.Serial", "line_number": 41, "usage_type": "call" }, { "api_name": "serial.SEVENBITS", "line_number": 44, "usage_type": "attribute" }, { "api_name": "serial.PARITY_ODD", "line_number": 45, "usage_type": "attribute" }, { "api_name": "serial.STO...
24856624188
from keywords import keywords from decision import best_children, best_branches from pandas_to_tree import pandas_to_tree from flow import high_scores import pandas as pd from chatbot import EchoBot, recieveMessage, sendMessage from RLchatbot import giving_points from datetime import date from matplotlib.dates import d...
DhilenChin/ShoeString-Error404
graph.py
graph.py
py
3,318
python
en
code
1
github-code
71
[ { "api_name": "keywords.keywords", "line_number": 23, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 37, "usage_type": "call" }, { "api_name": "pandas_to_tree.pandas_to_tree", "line_number": 38, "usage_type": "call" }, { "api_name": "chatb...
32619331951
from django.shortcuts import render, get_object_or_404,HttpResponseRedirect from .models import Category, Product from cart.forms import CartAddProductForm def product_list(request, category_slug=None): category = None categories = Category.objects.all() products = Product.objects.filter() cart_produc...
Eapu/pizza
orders/views.py
views.py
py
1,272
python
en
code
0
github-code
71
[ { "api_name": "models.Category.objects.all", "line_number": 8, "usage_type": "call" }, { "api_name": "models.Category.objects", "line_number": 8, "usage_type": "attribute" }, { "api_name": "models.Category", "line_number": 8, "usage_type": "name" }, { "api_name": ...
10794977280
from django.shortcuts import render, redirect from django.contrib.auth import authenticate, login from .forms import LoginForm from django.contrib.auth.models import User, auth from django.contrib.auth.forms import UserChangeForm from user.models import * from .models import Profile from .models import Event fr...
ramrishi1/Dotage
user/views.py
views.py
py
6,038
python
en
code
0
github-code
71
[ { "api_name": "django.shortcuts.render", "line_number": 16, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 19, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 22, "usage_type": "call" }, { "api_name"...
36398303124
from flask import url_for from urllib.parse import parse_qs from urllib3.util import parse_url from app.config import URL, PROTON_CLIENT_ID def test_login_with_proton(flask_client): r = flask_client.get( url_for("auth.proton_login"), follow_redirects=False, ) location = r.headers.get("Loc...
simple-login/app
tests/auth/test_proton.py
test_proton.py
py
650
python
en
code
4,235
github-code
71
[ { "api_name": "flask.url_for", "line_number": 10, "usage_type": "call" }, { "api_name": "urllib3.util.parse_url", "line_number": 16, "usage_type": "call" }, { "api_name": "urllib.parse.parse_qs", "line_number": 17, "usage_type": "call" }, { "api_name": "app.config...
42852917684
import bs4 import re from crawler import Crawler class Winha(Crawler): """Inherits Crawler class. Simulates the browser to login in to the Winha student system, in order to get the desired data based on the HTML documents. The desired data in this case are student information, courses, and gpa & grades distri...
likair/VAMK.help
vamk/api/winha.py
winha.py
py
11,240
python
en
code
1
github-code
71
[ { "api_name": "crawler.Crawler", "line_number": 6, "usage_type": "name" }, { "api_name": "crawler.Crawler.__init__", "line_number": 27, "usage_type": "call" }, { "api_name": "crawler.Crawler", "line_number": 27, "usage_type": "name" }, { "api_name": "bs4.Beautiful...
5328399717
import webbrowser as web import datetime import demjson from tools import url_tools from common.constant import * DYNAMIC_URL = "https://www.bilibili.com/video/" def to_obtain_dynamic_list(last_time: datetime.datetime, limit=100): myid = "22966665" # 获取最新动态 data = url_tools.http2json(b_url[MYSELF_NEW_DYN...
QiWenLV/BTools-server
browser/open_dynamic.py
open_dynamic.py
py
2,680
python
en
code
0
github-code
71
[ { "api_name": "datetime.datetime", "line_number": 10, "usage_type": "attribute" }, { "api_name": "tools.url_tools.http2json", "line_number": 13, "usage_type": "call" }, { "api_name": "tools.url_tools", "line_number": 13, "usage_type": "name" }, { "api_name": "tool...
70886299109
import numpy as np import FinanceDataReader as fdr import ML_RSB_env as RSB import matplotlib.pyplot as plt # Index(['Open', 'High', 'Low', 'Close', 'Volume', 'Change'], dtype='object') stock = fdr.StockListing('KOSPI') Find_id = stock['Name'] cmp_code = stock['Code'] stock_value = "삼성전자" iid = int(Find_id...
Jeonsangeun/Stock_RL
ML_TEST/ML_RoboStockbuyer.py
ML_RoboStockbuyer.py
py
2,884
python
en
code
0
github-code
71
[ { "api_name": "FinanceDataReader.StockListing", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 12, "usage_type": "call" }, { "api_name": "FinanceDataReader.DataReader", "line_number": 23, "usage_type": "call" }, { "api_name":...
34072935226
import yt #yt.funcs.mylog.setLevel(40) # # Nov 2017: Units bug in Enzo domain mass flux that needs to be corrected # by root grid dx^2. However, to avoid confusion, for now, # just make this a global post-process correction. Leaving as bug # in Enzo. # APPLY_CORRECTION_TO_BOUNDARY_MASS_...
aemerick/galaxy_analysis
analysis/_galaxy_analysis.py
_galaxy_analysis.py
py
59,804
python
en
code
1
github-code
71
[ { "api_name": "galaxy_analysis.utilities.utilities.nooutput", "line_number": 81, "usage_type": "call" }, { "api_name": "galaxy_analysis.utilities.utilities", "line_number": 81, "usage_type": "name" }, { "api_name": "yt.load", "line_number": 82, "usage_type": "call" }, ...
8685054258
import pandas as pd #import json import datetime # this piece of code will add the mode artiact had model history into a data frame try: print("no error") except exception as err: print(err) print("Error appear in the code") class ModelVersioning: def __init__(self, trained_model): self...
MahendraKIITian/demo
model_history.py
model_history.py
py
1,003
python
en
code
0
github-code
71
[ { "api_name": "pandas.DataFrame", "line_number": 18, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 25, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 25, "usage_type": "attribute" } ]
28682226333
import requests import json import LMIPy import os # user input needed # enter the location of the json file containing your minimal dataset info json (no layers) dataset_json_data_loc = '' # ex: /home/data/aqueduct_rw_api_2021-02-19/aq_floods_minimal_2021-02-19.json # enter the location of the folder containing your ...
resource-watch/data-team-tools
restore_dataset/restore_dataset_from_json.py
restore_dataset_from_json.py
py
3,940
python
en
code
2
github-code
71
[ { "api_name": "json.load", "line_number": 14, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 16, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 19, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 25, ...
16127243230
""" https://leetcode.com/problems/flower-planting-with-no-adjacent/ 1042. Flower Planting With No Adjacent Easy ----------------------- You have N gardens, labelled 1 to N. In each garden, you want to plant one of 4 types of flowers. paths[i] = [x, y] describes the existence of a bidirectional path from garden x to ga...
liuyanhui/leetcode-py
leetcode/1042_flower_planting_with_no_adjacent/flower_planting_with_no_adjacent.py
flower_planting_with_no_adjacent.py
py
3,158
python
en
code
0
github-code
71
[ { "api_name": "collections.defaultdict", "line_number": 56, "usage_type": "call" } ]
34869487356
from flask import Flask, render_template, request from flask_uploads import UploadSet, configure_uploads, IMAGES from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///test.db' db = SQLAlchemy(app) class User(db.Model): id = db.Column(db.Integer, primar...
NareshAtnPLUS/flask-image-upload
upload.py
upload.py
py
1,116
python
en
code
0
github-code
71
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 8, "usage_type": "call" }, { "api_name": "flask_uploads.UploadSet", "line_number": 19, "usage_type": "call" }, { "api_name": "flask_u...
7794763880
from __future__ import annotations import importlib import os import sys import typing import pytest from _pytest.monkeypatch import MonkeyPatch from pytest_mock import MockerFixture from platformdirs.unix import Unix def test_user_documents_dir(mocker: MockerFixture) -> None: example_path = "/home/example/Exa...
0xallie/platformdirs
tests/test_unix.py
test_unix.py
py
4,143
python
en
code
null
github-code
71
[ { "api_name": "pytest_mock.MockerFixture", "line_number": 15, "usage_type": "name" }, { "api_name": "platformdirs.unix.Unix", "line_number": 19, "usage_type": "call" }, { "api_name": "pytest_mock.MockerFixture", "line_number": 22, "usage_type": "name" }, { "api_na...
37573902973
import pygame, sys from settings import * from level import Level import colores import constantes #Iniciamos el juego pygame.init() #tamaño da ventana screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT)) clock = pygame.time.Clock() level = Level(level_map, screen) #Bucle principal del juego while True: ...
a21pablogo/pythonProject2
main.py
main.py
py
520
python
es
code
0
github-code
71
[ { "api_name": "pygame.init", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 10, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pygame.time.Cl...
17793950997
from django.urls import path from . import views urlpatterns = [ path('create_report/', views.create_report), path('reports/', views.ReportListView.as_view(), name='reports'), path('report/<int:pk>', views.ReportDetailView.as_view(), name='report'), path('report/<int:pk>/edit', views.update_report_metrics...
S3raphimCS/Hackathon_telehack
backend/SPO_KROT/metrics/urls.py
urls.py
py
563
python
en
code
4
github-code
71
[ { "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", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", ...
14356835871
#!/usr/bin/env python3 import os import numpy import argparse here = os.path.dirname(os.path.realpath(__file__)) def gen_board(size_x, size_y, height, num_towers, seed): numpy.random.seed(seed) board = [[0 for x in range(size_x)] for y in range(size_y)] cells = [(x, y) for x in range(size_x) for y in r...
fickert/fast-downward-nancy
training/generators/termes/gen_random_tower_boards.py
gen_random_tower_boards.py
py
1,361
python
en
code
0
github-code
71
[ { "api_name": "os.path.dirname", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.random.seed", "l...
14084438396
""" http://adventofcode.com/2017/day/2 """ from typing import List def parse_table(table: List[str]) -> List[List[int]]: return [[int(val) for val in row.split()] for row in table] def row_checksum(table: List[str]) -> int: rows = parse_table(table) return sum(max(row) - min(row) for row in ...
aboucaud/adventofcode2017
day02/day02.py
day02.py
py
1,042
python
en
code
0
github-code
71
[ { "api_name": "typing.List", "line_number": 7, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 12, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 20, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 2...
15625243405
import yaml import subprocess import kubernetes import json from kubernetes import client, config config.load_kube_config() with open("namespace.json", "r") as config_file: namespace_config = json.load(config_file) label_2 = namespace_config.get("label", {}).get("app", "") namespace = namespace_config["namespace"...
arthur-1205/capstone
05_Deny_all_traffic_from_app_to_app.py
05_Deny_all_traffic_from_app_to_app.py
py
4,108
python
en
code
1
github-code
71
[ { "api_name": "kubernetes.config.load_kube_config", "line_number": 7, "usage_type": "call" }, { "api_name": "kubernetes.config", "line_number": 7, "usage_type": "name" }, { "api_name": "json.load", "line_number": 10, "usage_type": "call" }, { "api_name": "kubernet...
8827844927
"""This module defines the handler that handles avatar image requests.""" from ng import httpfilters from ng.database import MySQLDatabase from ng.http import HttpResponse, HttpErrorResponse from ng.models import Avatar from ng.views import TemplateView, ImageView, StaticView import config import _accounthelper def...
lichuanzju/ngavatar
src/scripts/cgi/handlers/_avatar.py
_avatar.py
py
1,762
python
en
code
0
github-code
71
[ { "api_name": "config.static_filepath", "line_number": 15, "usage_type": "call" }, { "api_name": "ng.views.StaticView", "line_number": 18, "usage_type": "call" }, { "api_name": "ng.http.HttpErrorResponse", "line_number": 20, "usage_type": "call" }, { "api_name": "...
15829272016
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- import solfuzz, sys, os, threading import logging, json, glob logger = logging.getLogger() try: import flask templates = os.path.abspath(os.path.join(os.path.dirname(__file__), 'templates')) app = flask.Flask(__name__, template_folder=templates) logger.in...
holiman/solfuzzz
solfuzzweb.py
solfuzzweb.py
py
2,475
python
en
code
1
github-code
71
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.join", "lin...
71127312871
import logging import pymysql import csv import pandas as pd from sqlalchemy import create_engine import datetime class MysqlDB(): def __init__(self): self.conn = 0 self.cursor = 0 def dbconnect(self): try: self.conn = pymysql.connect(host='localhost', port=3306, user='roo...
itskathyc/pythonProject
common/Database.py
Database.py
py
4,694
python
en
code
0
github-code
71
[ { "api_name": "pymysql.connect", "line_number": 16, "usage_type": "call" }, { "api_name": "sqlalchemy.create_engine", "line_number": 18, "usage_type": "call" }, { "api_name": "logging.debug", "line_number": 19, "usage_type": "call" }, { "api_name": "logging.error"...
1872244587
import csv import math import numpy as np from matplotlib import pyplot as plt from mpl_toolkits.mplot3d import Axes3D from numpy.linalg import norm from scipy.signal import find_peaks import utils # Če je True zapiše rezultate v datoteko write = True # Št. let leta = 100 # Uvozi rešitve ode intervali, rZemlja, rL...
rokuk/sim-precesija-lune
scripts/apsidal.py
apsidal.py
py
2,691
python
sl
code
0
github-code
71
[ { "api_name": "utils.readstate", "line_number": 19, "usage_type": "call" }, { "api_name": "utils.gmZemlja", "line_number": 23, "usage_type": "attribute" }, { "api_name": "utils.gmLuna", "line_number": 23, "usage_type": "attribute" }, { "api_name": "utils.gmZemlja"...
10007267175
from django.shortcuts import render from django.shortcuts import HttpResponse, render from random import randint import os import re import requests from pymongo import MongoClient from bson import ObjectId # Configuring the logger import logging logger = logging.getLogger(__name__) # Configuring MongoDB client = ...
gomezportillo/SSBW
ejercicios/views.py
views.py
py
9,549
python
en
code
0
github-code
71
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 18, "usage_type": "call" }, { "api_name": "django.shortcuts.HttpResponse", "line_number": 39, "usage_type": "call" }, { "api_name": "d...
21447059863
from django.shortcuts import render,redirect from .models import Vendors, Vouchers , Suggest_Reward,Redemption_Request , budget from Users.models import User , announcements from activities.models import Points from django.core.mail import send_mail import pytz from datetime import datetime,date,timedelta from django.h...
MahmoudAbdelkhalek5o5o/ECS_Reward_System
ECS_Reward_System/Rewards/views.py
views.py
py
13,889
python
en
code
0
github-code
71
[ { "api_name": "pytz.UTC", "line_number": 16, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 17, "usage_type": "name" }, { "api_name": "models.Vendors....
40323900737
import itertools def cross(a,b): c = [] c.append(a[1]*b[2]-a[2]*b[1]) c.append(a[2]*b[0]-a[0]*b[2]) c.append(a[0]*b[1]-a[1]*b[0]) return c def positiveCross(a,b): c = cross(a,b) if c[2] < 0: c[0] = -c[0] c[1] = -c[1] c[2] = -c[2] return c def unitize(a): le...
emlynx/tropical
naiveHull.py
naiveHull.py
py
2,471
python
en
code
0
github-code
71
[ { "api_name": "itertools.combinations", "line_number": 50, "usage_type": "call" } ]
21576951892
#std lib packages from io import StringIO, BytesIO import os import os.path as path import socket import sys #user-defined packages from util.parser import Parser class Client: def __init__(self): self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) #http_bind_address self.BUFFER...
sgilz/socket-service
client/client.py
client.py
py
6,957
python
en
code
0
github-code
71
[ { "api_name": "socket.socket", "line_number": 12, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 12, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREAM", "line_number": 12, "usage_type": "attribute" }, { "api_name": "util.parser...
33934755305
import logging import textwrap import uuid from dateutil.relativedelta import relativedelta from odoo import api, fields, models, _ from odoo.exceptions import ValidationError, UserError from odoo.tools import float_is_zero _logger = logging.getLogger(__name__) class SurveyUserInput(models.Model): """ Metadata...
odoo/odoo
addons/survey/models/survey_user_input.py
survey_user_input.py
py
45,288
python
en
code
31,745
github-code
71
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "odoo.models.Model", "line_number": 14, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 14, "usage_type": "name" }, { "api_name": "odoo.fields.Many...
72240606951
""" Test cases for Order Model """ import logging import unittest import os from service import app from service.models import Order, Item, DataValidationError, db from tests.factories import OrderFactory, ItemFactory DATABASE_URI = os.getenv( "DATABASE_URI", "postgresql://postgres:postgres@localhost:5432/postgre...
CSCI-GA-2820-SP23-001/orders
tests/test_models.py
test_models.py
py
11,253
python
en
code
0
github-code
71
[ { "api_name": "os.getenv", "line_number": 12, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 20, "usage_type": "attribute" }, { "api_name": "service.app.config", "line_number": 26, "usage_type": "attribute" }, { "api_name": "service.app"...
72110259749
# author: choi sugil # date: 2023.10.25 version: 1.0.0 license: MIT brief: keyward # description: 데이터클래스 와 클래스를 연동하는 프로그램 sqlite로 데이터를 읽어옴 from dataclasses import dataclass, field import sqlite3 @dataclass class StudentArg: name: str korean: int = 0 math: int = 0 english: int = 0 science: int = 0 ...
freshmea/chungnam_chatbot
python/a64_class_method_dataclassAndMethod_sqlite.py
a64_class_method_dataclassAndMethod_sqlite.py
py
1,764
python
en
code
2
github-code
71
[ { "api_name": "dataclasses.field", "line_number": 15, "usage_type": "call" }, { "api_name": "dataclasses.dataclass", "line_number": 8, "usage_type": "name" }, { "api_name": "sqlite3.connect", "line_number": 54, "usage_type": "call" } ]
41573922312
import os import pandas as pd import numpy as np from upsetplot import from_contents, plot import matplotlib.pyplot as plt from GEN_Utils import FileHandling from loguru import logger logger.info('Import OK') input_folder = 'results/tpemi_proteomics/peptide_summary/' output_folder = 'results/tpemi_proteomics/interse...
dezeraecox-manuscripts/COX_Proteome-organisation
src/tpemi_proteomics/intersections.py
intersections.py
py
3,764
python
en
code
0
github-code
71
[ { "api_name": "loguru.logger.info", "line_number": 10, "usage_type": "call" }, { "api_name": "loguru.logger", "line_number": 10, "usage_type": "name" }, { "api_name": "os.path.exists", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_n...