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
2863726451
import matplotlib.pyplot as plt import csv # 1. 读取数据;数据数组 data = [] headers = ['工作年限' ,'学历','职位','薪水','城市','发布时间'] city = set() with open('jobs.csv', 'r', encoding='utf-8') as fd: reader = csv.DictReader(fd, fieldnames=headers) # 返回的是迭代器 next(reader) # 把头略过 for row in reader: data.append(row['城市...
XiaJune/A-small
d16_plot_linalg/demo_hist.py
demo_hist.py
py
944
python
en
code
0
github-code
36
[ { "api_name": "csv.DictReader", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 17, "usage_type": "name" }, { "api_name": "matplotlib.p...
2360933175
# -*- coding: utf-8 -*- """ DIAGNOSTICS OF THE CARDIOVASCULAR SYSTEM BASED ON NEURAL NETWORKS Classify ECG-Signals to CAD-Symptoms by means of artificial neural networks Skript containing function to plot results. """ import os import numpy as np import seaborn as sns import matplotlib.pyplot as plt from matplotlib im...
Judweep/ECG_Classifier
Source_code/Plotting_Functions.py
Plotting_Functions.py
py
5,669
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 25, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 25, "usage_type": "name" }, { "api_name": "numpy.linspace", "line_number": 26, "usage_type": "call" }, { "api_name": "matplotli...
13925791934
import numpy as np import cv2 as cv import scipy.io from PIL import Image import time import os import errno import random from sklearn.model_selection import train_test_split import shutil import cv2 ############################################################################### #####################################...
haynec/yolov5_4_channel
fuse_and_reorg_dataset.py
fuse_and_reorg_dataset.py
py
4,190
python
en
code
0
github-code
36
[ { "api_name": "os.path.join", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path", "line_number": 32, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path.join", "line_number"...
17894590970
import collections import time from typing import Any, Dict from absl import logging import numpy as np import robustness_metrics as rm from sklearn.metrics import accuracy_score from sklearn.metrics import auc from sklearn.metrics import log_loss from sklearn.metrics import precision_recall_curve from sklearn.metrics...
google/uncertainty-baselines
baselines/diabetic_retinopathy_detection/utils/eval_utils.py
eval_utils.py
py
52,854
python
en
code
1,305
github-code
36
[ { "api_name": "tensorflow.zeros", "line_number": 71, "usage_type": "call" }, { "api_name": "tensorflow.zeros", "line_number": 72, "usage_type": "call" }, { "api_name": "tensorflow.zeros", "line_number": 73, "usage_type": "call" }, { "api_name": "tensorflow.TensorA...
7182787702
#!/usr/bin/env python # encoding: utf-8 # # facke-guider.py # # Created by José Sánchez-Gallego on 29 Mar 2017. from __future__ import division from __future__ import print_function from __future__ import absolute_import import opscore from opscore.protocols.parser import CommandParser from opscore.utility.qstr impo...
albireox/lcoHacks
python/lcoHacks/fake-guider.py
fake-guider.py
py
12,732
python
en
code
0
github-code
36
[ { "api_name": "os.path.expandvars", "line_number": 49, "usage_type": "call" }, { "api_name": "os.path", "line_number": 49, "usage_type": "attribute" }, { "api_name": "opscore.protocols.parser.CommandParser", "line_number": 51, "usage_type": "call" }, { "api_name":...
14412924035
import util.settings as settings import time import sys, getopt from util.logging import * from colorama import init import supermarkets.runner as srunner def main(argv): init() # Parsing of arguments try: #opts, args = getopt.getopt(argv,"hi:o:",["ifile=","ofile="]) opts, args = getopt.getopt(argv,"hve",["hel...
tonsmets/SupermarketScraper
supermarketscraper/main.py
main.py
py
1,164
python
en
code
21
github-code
36
[ { "api_name": "colorama.init", "line_number": 9, "usage_type": "call" }, { "api_name": "getopt.getopt", "line_number": 14, "usage_type": "call" }, { "api_name": "getopt.GetoptError", "line_number": 15, "usage_type": "attribute" }, { "api_name": "sys.exit", "li...
12404712601
from vegetation_index import psri_index from osgeo import gdal import numpy as np import zipfile import os # adjust with band data filename target_band = ["B04_10m.jp2", "B08_10m.jp2"] print(target_band) zip_folder_path = "./data/2020" files = os.listdir(zip_folder_path) # make folder if not exits output_folder = f...
primagiant/auto-mapping-and-predicting-crops-production
utils/index/psri_calc.py
psri_calc.py
py
2,539
python
en
code
0
github-code
36
[ { "api_name": "os.listdir", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number...
16055989419
import discord from discord.ext import commands from core.classes import Cog_Extension import json, asyncio, datetime, sqlite3, shutil, os, time class Task(Cog_Extension): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.time_task_counters = 0 self.bg_tas...
healthyvitamin/discord_bot
discord_bot/cmds/background_task.py
background_task.py
py
3,875
python
en
code
0
github-code
36
[ { "api_name": "core.classes.Cog_Extension", "line_number": 6, "usage_type": "name" }, { "api_name": "json.load", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 18, "usage_type": "call" }, { "api_name": "datetime.da...
32268751295
#!/usr/bin/env python import sys import os import shutil #os.environ['OPENBLAS_NUM_THREADS'] = '1' import argparse import subprocess import requests import stat import json import pathlib import zipfile import pysam import pandas as pd import numpy as np from collections import Counter from functools import reduce fr...
BimberLab/nimble
nimble/__main__.py
__main__.py
py
13,434
python
en
code
1
github-code
36
[ { "api_name": "nimble.utils.low_complexity_filter_amount", "line_number": 50, "usage_type": "argument" }, { "api_name": "json.dump", "line_number": 54, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 65, "usage_type": "call" }, { "api_name": "...
28662940889
import logging from ..models.formularios.form_accion_sort import Form_Accion_Sorteable from ..models.formularios.form_campo import Form_Campo from ..models.formularios.form_campo_sort import Form_Campo_Sorteable from ..models.formularios.form_elemento import Form_Elemento from ..models.formularios.form_filtro_param_so...
juanceweb/mayan_local
mayan/apps/unq/functions/functions_formularios.py
functions_formularios.py
py
8,973
python
es
code
0
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "models.formularios.form_formularios.Form_Formulario.objects.get", "line_number": 25, "usage_type": "call" }, { "api_name": "models.formularios.form_formularios.Form_Formulario.objects", ...
8574496857
from djoser.views import UserViewSet from rest_framework.pagination import LimitOffsetPagination from rest_framework.permissions import IsAuthenticated class DjoserUserViewSet(UserViewSet): pagination_class = LimitOffsetPagination permission_classes = [IsAuthenticated] def me(self, request, *args, **kwar...
ticpragma/foodgram-project-react
foodgram/users/views.py
views.py
py
452
python
en
code
0
github-code
36
[ { "api_name": "djoser.views.UserViewSet", "line_number": 6, "usage_type": "name" }, { "api_name": "rest_framework.pagination.LimitOffsetPagination", "line_number": 7, "usage_type": "name" }, { "api_name": "rest_framework.permissions.IsAuthenticated", "line_number": 8, "us...
39660373641
from collections import Counter class Solution: def permuteUnique(self, nums: List[int]) -> List[List[int]]: if len(nums) == 1: return [nums] counter = Counter(nums) result = [] def backtracking(perm): if len(perm) == len(nums): resul...
deusi/practice
47-permutations-ii/47-permutations-ii.py
47-permutations-ii.py
py
686
python
en
code
0
github-code
36
[ { "api_name": "collections.Counter", "line_number": 8, "usage_type": "call" } ]
27162959135
import gym import numpy as np import matplotlib.pyplot as plt NUM_RUNS = 50 MAX_EPISODE_STEPS = 5000 NUM_EPISODES = 100 NUM_ACTIONS = 3 env = gym.make('MountainCar-v0').env env._max_episode_steps = MAX_EPISODE_STEPS POLYNOMIAL_FEATURES = True POLYNOMIAL_DEGREE = 2 ''' https://github.com/openai/gym/wiki/MountainC...
MaximilianSamsinger/Advanced-Machine-Learning
Assignment 3/Mountain_Car.py
Mountain_Car.py
py
4,287
python
en
code
1
github-code
36
[ { "api_name": "gym.make", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 45, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 46, "usage_type": "call" }, { "api_name": "numpy.append", "line_number": 56...
72311227944
import os import shutil import subprocess import traceback from typing import Any, List from src.manager.launcher.launcher_interface import ILauncher, LauncherException class LauncherRos(ILauncher): """ Launcher for ROS/Gazebo It's configuration should follow this spec: { "type": "module", ...
JdeRobot/RoboticsApplicationManager
manager/manager/launcher/launcher_ros.py
launcher_ros.py
py
2,764
python
en
code
2
github-code
36
[ { "api_name": "src.manager.launcher.launcher_interface.ILauncher", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 34, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 35, "usage_type": "name" }, { "api_nam...
27365994887
import codecs import json import uuid import re from scrapy.utils.markup import remove_tags from scrapy.utils.serialize import ScrapyJSONEncoder from typing import Union from scrapper.crowler.data.object import Variant, Step class JsonWithEncodingPipeline(object): def __init__(self): self....
Paleontolog/summarizer_service
crowler/pipelines/pipel.py
pipel.py
py
1,896
python
en
code
0
github-code
36
[ { "api_name": "codecs.open", "line_number": 16, "usage_type": "call" }, { "api_name": "uuid.uuid4", "line_number": 16, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 20, "usage_type": "call" }, { "api_name": "typing.Union", "line_number": 2...
20422284442
# -*- coding: utf-8 -*- """ Created on Wed Jun 5 00:48:35 2019 @author: Vamshi Krishna """ import matplotlib.pyplot as plt emp_names=['vamshi','preethi','santhosh','deexita'] emp_salary=[80000,75000,60000,80000] plt.pie(emp_salary,labels=emp_names,radius=2,autopct='%0.0f%%',shadow=True,explode=[0.2,0,0,0])...
RevanthR/AI_Assignments
Assignment4piegraph.py
Assignment4piegraph.py
py
334
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.pyplot.pie", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 11, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.show", "line_number": 12, "usage_type": "call" }, { "api_name": "matplo...
6290474507
# Extract Adobe Analytics data strings from Adobe Assurance (Project Griffon) logs # 24 Oct 2022 11:18 # Michael Powe # reminder of what we are looking for # (json_data['events'][3]['payload']['ACPExtensionEventData']['hitUrl']) import json import urllib.parse from argparse import ArgumentParser from pprint import ppr...
nyambol/adobe-assurance-json
json-parser.py
json-parser.py
py
4,571
python
en
code
0
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 14, "usage_type": "call" }, { "api_name": "json.load", "line_number": 64, "usage_type": "call" }, { "api_name": "urllib.parse.parse.unquote", "line_number": 73, "usage_type": "call" }, { "api_name": "urllib.p...
4221751433
#!/usr/bin/env python3 """ Extensive database of location and timezone data for nearly every airport and landing strip in the world. """ from __future__ import annotations import csv from pathlib import Path from typing import Dict, Literal, TypedDict __project_name__ = __package__ # Release numbering follows the r...
legoironman1234/IATAGuesser
IATAGuesser/airportsdata/__init__.py
__init__.py
py
3,193
python
en
code
0
github-code
36
[ { "api_name": "typing.TypedDict", "line_number": 22, "usage_type": "call" }, { "api_name": "typing.Literal", "line_number": 38, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 72, "usage_type": "call" }, { "api_name": "typing.Dict", "line_...
21411610014
from __future__ import absolute_import, division import scipy.ndimage as ndimage from matplotlib import widgets import glob import datetime import scipy.interpolate as interpolate import numpy as np import matplotlib.pyplot as plt __all__ = ['Slit'] #===================================================================...
CyclingNinja/sunkit-sst
sunkitsst/visualisation/slit.py
slit.py
py
5,853
python
en
code
0
github-code
36
[ { "api_name": "numpy.zeros", "line_number": 26, "usage_type": "call" }, { "api_name": "scipy.interpolate.splprep", "line_number": 86, "usage_type": "call" }, { "api_name": "scipy.interpolate", "line_number": 86, "usage_type": "name" }, { "api_name": "numpy.linspac...
34140146726
from __future__ import print_function, division import we import json import numpy as np import sys if sys.version_info[0] < 3: import io open = io.open """ Hard-debias embedding Man is to Computer Programmer as Woman is to Homemaker? Debiasing Word Embeddings Tolga Bolukbasi, Kai-Wei Chang, James Zou, Venkates...
JasmineZhangxyz/nlp-optimization-objective
bolukbais2016 + bias metrics/debias.py
debias.py
py
2,466
python
en
code
0
github-code
36
[ { "api_name": "sys.version_info", "line_number": 6, "usage_type": "attribute" }, { "api_name": "io.open", "line_number": 8, "usage_type": "attribute" }, { "api_name": "we.doPCA", "line_number": 18, "usage_type": "call" }, { "api_name": "we.drop", "line_number"...
3576654470
from sklearn.metrics import accuracy_score from sklearn.metrics import f1_score from sklearn.metrics import roc_auc_score from sklearn.metrics import average_precision_score from sklearn.metrics import recall_score # accuracy_scores: return the correctly classified samples. The set of labels predicted for a sample mus...
ClarissaW/Predict-tags-on-StackOverflow
evaluation.py
evaluation.py
py
1,960
python
en
code
0
github-code
36
[ { "api_name": "sklearn.metrics.accuracy_score", "line_number": 25, "usage_type": "call" }, { "api_name": "sklearn.metrics.f1_score", "line_number": 26, "usage_type": "call" }, { "api_name": "sklearn.metrics.recall_score", "line_number": 27, "usage_type": "call" }, { ...
7207753656
# geospatial help functions import geopandas as gpd import matplotlib.pyplot as plt def show_overlaps(data_temp, id_col): # checks and plots which areas overlap overlaps = [] for index, row in data_temp.iterrows(): data_temp1 = data_temp.loc[data_temp[id_col] != row[id_col]] # grab all ro...
PeterFriedrich/bridge_the_gap
helper_functions.py
helper_functions.py
py
1,286
python
en
code
0
github-code
36
[ { "api_name": "geopandas.overlay", "line_number": 30, "usage_type": "call" } ]
74311600743
import numpy as np import glob import os from blimpy import Waterfall import blimpy as bl import gc import time import matplotlib import matplotlib.pyplot as plt start=time.time() def get_elapsed_time(start=0): end = time.time() - start time_label = 'seconds' if end > 3600: end = end/3600 ...
Tusay/589_ML
get_images.py
get_images.py
py
4,546
python
en
code
0
github-code
36
[ { "api_name": "time.time", "line_number": 11, "usage_type": "call" }, { "api_name": "time.time", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.log10", "line_number": 33, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.imshow", "line_...
41715969518
import torch import torch.nn as nn from torch.autograd import Variable import torch.nn.functional as F def hidden_init(layer): fan_in = layer.weight.data.size()[0] lim = 1. / np.sqrt(fan_in) return (-lim, lim) class Actor(nn.Module): """Initialize parameters and build model. Args: ...
zachterrell57/stock-trading
DDPG Example Implementation/network.py
network.py
py
2,616
python
en
code
0
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 11, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 11, "usage_type": "name" }, { "api_name": "torch.manual_seed", "line_number": 27, "usage_type": "call" }, { "api_name": "torch.nn.Linear", ...
70291499304
import webapp2 import random def rand_fortune(): fortunes = ["To avoid criticism, do nothing, say nothing, be nothing", "Error 404: Fortune not found", "Optimist believe we live in the best of worlds and pessimists fear this is true.", "Of all our human resources, the most precious is the desire to improve"] i...
freddyworldpeace/fortune-cookie
main.py
main.py
py
1,023
python
en
code
0
github-code
36
[ { "api_name": "random.randint", "line_number": 6, "usage_type": "call" }, { "api_name": "webapp2.RequestHandler", "line_number": 10, "usage_type": "attribute" }, { "api_name": "random.randint", "line_number": 17, "usage_type": "call" }, { "api_name": "webapp2.WSGI...
2168304898
import wave import numpy as np import scipy from scipy.io.wavfile import read from scipy.signal import hann from scipy.fftpack import rfft import matplotlib.pyplot as plt def plotFreqSpec(filename,graphpath=None): # read audio samples framerate,data = read(filename) file = wave.open(filename, 'rb') n...
Mheeh/Audio
spectrum.py
spectrum.py
py
1,348
python
en
code
0
github-code
36
[ { "api_name": "scipy.io.wavfile.read", "line_number": 12, "usage_type": "call" }, { "api_name": "wave.open", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.float", "line_number": 17, "usage_type": "attribute" }, { "api_name": "numpy.mean", "li...
42360805462
from django.shortcuts import render, redirect, reverse # Create your views here. from django.views.decorators.http import require_GET from django.contrib.auth.decorators import login_required from goods.models import Goods from . import models @require_GET @login_required def add(req, count, goods_id): goods = ...
hwzHw/python37
dayWeb/myshopping/shopcart/views.py
views.py
py
1,215
python
en
code
0
github-code
36
[ { "api_name": "goods.models", "line_number": 14, "usage_type": "name" }, { "api_name": "goods.models.Goods.objects.get", "line_number": 14, "usage_type": "call" }, { "api_name": "goods.models.Goods.objects", "line_number": 14, "usage_type": "attribute" }, { "api_n...
70005734826
from PyQt5.QtCore import QObject, pyqtSignal, pyqtSlot class TInteractObj(QObject): SigReceivedMessFromJS = pyqtSignal(dict) SigSendMessageToJS = pyqtSignal(str) def __init__(self, parent = None): super().__init__(parent) @pyqtSlot(str,result=str) def JSSendMessage(self, strPara...
cjt24703/pyqt5-
TInteractObject.py
TInteractObject.py
py
631
python
en
code
1
github-code
36
[ { "api_name": "PyQt5.QtCore.QObject", "line_number": 3, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 4, "usage_type": "call" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 5, "usage_type": "call" }, { "api_name": "PyQ...
15599967327
from django.shortcuts import render from inicio.models import Paciente from django.views.generic.list import ListView from django.views.generic.edit import CreateView, UpdateView, DeleteView from django.contrib.auth.mixins import LoginRequiredMixin from django.urls import reverse_lazy def mi_vista(request): return...
MatrixUHzp/web-doctor
inicio/views.py
views.py
py
1,189
python
en
code
0
github-code
36
[ { "api_name": "django.shortcuts.render", "line_number": 9, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 12, "usage_type": "call" }, { "api_name": "django.views.generic.list.ListView", "line_number": 14, "usage_type": "name" }, { ...
74050675304
from copy import deepcopy from typing import Optional, List from types import MethodType from collections import defaultdict from nltk.tokenize import sent_tokenize from nltk.corpus import stopwords import random import spacy import torch from parlai.core.agents import create_agent, create_agent_from_shared from parla...
facebookresearch/ParlAI
projects/k2r/stacked_agent/task/agents.py
agents.py
py
28,080
python
en
code
10,365
github-code
36
[ { "api_name": "nltk.corpus.stopwords.words", "line_number": 29, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords", "line_number": 29, "usage_type": "name" }, { "api_name": "parlai.core.opt.Opt.load", "line_number": 35, "usage_type": "call" }, { "api_na...
73484234343
import time import nlp_pre_processing nlp = nlp_pre_processing.NLPPreprocessor() # Multiprocessing from multiprocessing import Pool start_time = time.time() num_partitions = 20 num_cores = 15 print(f'Partition Number: {num_partitions} - Number of Cores: {num_cores}...') def main_process_pipeline(df, func): df_...
fclesio/learning-space
Python/multiprocessing_function.py
multiprocessing_function.py
py
932
python
en
code
10
github-code
36
[ { "api_name": "nlp_pre_processing.NLPPreprocessor", "line_number": 3, "usage_type": "call" }, { "api_name": "time.time", "line_number": 8, "usage_type": "call" }, { "api_name": "multiprocessing.Pool", "line_number": 17, "usage_type": "call" }, { "api_name": "time....
20752748311
import requests import googletrans from pycatapi import Client def load_random_cat(): c = Client() cat_url = c.get_cat() return cat_url def load_random_joke(): url = "https://official-joke-api.appspot.com/random_joke" response = requests.get(url).json() joke = f'- {response["setup"]}\n- {re...
zarex1111/WEB_Project
base_config.py
base_config.py
py
697
python
en
code
0
github-code
36
[ { "api_name": "pycatapi.Client", "line_number": 7, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "googletrans.Translator", "line_number": 21, "usage_type": "call" } ]
69886479786
import os import unittest import ansible from ansiblelint import Runner, RulesCollection from pkg_resources import parse_version class TestTaskIncludes(unittest.TestCase): def setUp(self): rulesdir = os.path.join('lib', 'ansiblelint', 'rules') self.rules = RulesCollection.create_from_directory(r...
dholdaway/Best-Practices_And_Examples
Ansible/test/TestTaskIncludes.py
TestTaskIncludes.py
py
1,901
python
en
code
4
github-code
36
[ { "api_name": "unittest.TestCase", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "ansiblelint.RulesColl...
36122181612
import os, sys import argparse libpath = os.path.join(os.path.dirname(__file__), '../') sys.path.append(libpath) import src from src.compiler.gen_relay_ir import gen_relay_ir from src.compiler.visualize import visualize from src.compiler.compiler import Compiler from src.compiler.utils import dump_params def fronten...
LianjunW/QuantizationTools
examples/test_complier.py
test_complier.py
py
3,582
python
en
code
0
github-code
36
[ { "api_name": "os.path.join", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.path.append", "line_nu...
17436666953
import functools import torch.nn as nn import os import sys import time import random import argparse import torch __all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101', 'resnet152'] def conv3x3(in_planes, out_planes, stride=1): """3x3 convolution with padding""" return nn.Conv2d(i...
xmed-lab/EPL_SemiDG
network/resnet.py
resnet.py
py
9,203
python
en
code
33
github-code
36
[ { "api_name": "torch.nn.Conv2d", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 17, "usage_type": "name" }, { "api_name": "torch.nn.Module", "line_number": 21, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_nu...
289073657
import pathlib #path to the desktop desktop = pathlib.Path("/home/symon_kipkemei") #create a new folder folder new_path = pathlib.Path("/home/symon_kipkemei/screenshots") new_path.mkdir(exist_ok=True) # list items in desktop for filepath in desktop.iterdir(): #filter screenshots only if filepath.suffix == "...
symonkipkemei/cnd-labs
python-101/labs/13_modules-and-automation.py
13_modules-and-automation.py
py
501
python
en
code
0
github-code
36
[ { "api_name": "pathlib.Path", "line_number": 4, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 8, "usage_type": "call" } ]
21332967957
from sostrades_core.execution_engine.sos_wrapp import SoSWrapp from climateeconomics.core.core_land_use.land_use_v1 import LandUseV1 from sostrades_core.tools.post_processing.charts.chart_filter import ChartFilter from sostrades_core.tools.post_processing.charts.two_axes_instanciated_chart import InstanciatedSeries,\ ...
os-climate/witness-core
climateeconomics/sos_wrapping/sos_wrapping_land_use/land_use/land_use_v1_disc.py
land_use_v1_disc.py
py
15,085
python
en
code
7
github-code
36
[ { "api_name": "sostrades_core.execution_engine.sos_wrapp.SoSWrapp", "line_number": 16, "usage_type": "name" }, { "api_name": "climateeconomics.core.core_land_use.land_use_v1.LandUseV1.LAND_DEMAND_DF", "line_number": 38, "usage_type": "attribute" }, { "api_name": "climateeconomics...
19412985681
from django.conf.urls.defaults import * # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() name = "This time" urlpatterns = patterns('articles.views', # home page url(r'^$', 'collections', kwargs={"template_name": "home.html"}), # inserting collections ...
jlong29/AY250
Homework7/bibtex/urls.py
urls.py
py
746
python
en
code
0
github-code
36
[ { "api_name": "django.contrib.admin.autodiscover", "line_number": 5, "usage_type": "call" }, { "api_name": "django.contrib.admin", "line_number": 5, "usage_type": "name" }, { "api_name": "django.contrib.admin.site", "line_number": 22, "usage_type": "attribute" }, { ...
462199369
# the dupe bot needs a lot of special logic so it can't really use the same code as the other bots sadly import discord import logging import time import asyncio from enum import Enum from selenium import webdriver from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.common.keys import ...
Sadtrxsh/Mathboi
dupe.py
dupe.py
py
14,259
python
en
code
0
github-code
36
[ { "api_name": "asyncio.Event", "line_number": 20, "usage_type": "call" }, { "api_name": "asyncio.Lock", "line_number": 21, "usage_type": "call" }, { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 23, "usage_type": "call" }, { "api_name": "selenium....
18617730217
# python 3.6 # author: qcw from requests import get, exceptions import re class SentiveFile(object): """ 从可能泄露的敏感文件中发现子域名,如crossdomain.xml、robots.txt等等 """ def __init__(self, url): """ :param url: 外部输入的url :param domians:返回主程序的结果 """ self.url = url sel...
b1ackc4t/getdomain
module/active/SensitiveFile.py
SensitiveFile.py
py
2,248
python
en
code
3
github-code
36
[ { "api_name": "requests.get", "line_number": 41, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 42, "usage_type": "call" }, { "api_name": "requests.exceptions.RequestException", "line_number": 47, "usage_type": "attribute" }, { "api_name": "req...
73082338983
import numpy as np from sklearn import metrics from sklearn.metrics import roc_curve from sklearn.metrics import roc_auc_score import matplotlib.pyplot as plt def calculate_AUC(model_results): ''' :param model_results: model_results=[TP, FP, TN, FN, pred, pred_prob, test_data, test_flag] :return: auc '...
lauraqing/test_metric_evaluation_s3
calculate_AUC.py
calculate_AUC.py
py
1,292
python
en
code
0
github-code
36
[ { "api_name": "sklearn.metrics.roc_curve", "line_number": 30, "usage_type": "call" }, { "api_name": "sklearn.metrics.auc", "line_number": 31, "usage_type": "call" }, { "api_name": "sklearn.metrics", "line_number": 31, "usage_type": "name" } ]
6117512730
from __future__ import annotations import logging import math import pickle import lpips import omegaconf import pytorch3d import pytorch3d.io import torch from pytorch3d import transforms from pytorch3d.ops.points_alignment import SimilarityTransform from pytorch3d.renderer.cameras import CamerasBase from pytorch3d....
shubham-goel/ds
src/eval/evaluate_base.py
evaluate_base.py
py
11,007
python
en
code
68
github-code
36
[ { "api_name": "utils.mesh.RTs_to_transform", "line_number": 33, "usage_type": "call" }, { "api_name": "pytorch3d.ops.points_alignment.SimilarityTransform", "line_number": 33, "usage_type": "call" }, { "api_name": "utils.mesh.RTs_to_transform", "line_number": 34, "usage_ty...
22353244515
import hashlib from pyspark.sql.functions import udf from pyspark.sql.types import StringType def _hash_list(*list_to_hash): list_to_hash = [str(element) for element in list_to_hash] str_concatted = "".join(list_to_hash) sha1 = hashlib.sha1() sha1.update(str_concatted.encode("utf8")) return sha1....
mlrun/mlrun
mlrun/datastore/spark_udf.py
spark_udf.py
py
929
python
en
code
1,129
github-code
36
[ { "api_name": "hashlib.sha1", "line_number": 10, "usage_type": "call" }, { "api_name": "pyspark.sql.functions.udf", "line_number": 30, "usage_type": "call" }, { "api_name": "pyspark.sql.types.StringType", "line_number": 30, "usage_type": "call" }, { "api_name": "p...
70152353705
import numpy as np from PIL import Image IMAGE_SIZE = 1000 if __name__ == '__main__': # Два изображения одинаковой яркости, но полностью разного цвета img_1_1_data = np.zeros((IMAGE_SIZE, IMAGE_SIZE, 3), dtype=np.uint8) img_1_1_data[..., 0] = 255 img_1_1 = Image.fromarray(img_1_1_data) img_1_1.sav...
borgishmorg/abchihba_back_end
image_generator.py
image_generator.py
py
3,272
python
ru
code
0
github-code
36
[ { "api_name": "numpy.zeros", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 8, "usage_type": "attribute" }, { "api_name": "PIL.Image.fromarray", "line_number": 10, "usage_type": "call" }, { "api_name": "PIL.Image", "line_...
31065215705
from ..utils import Object class UpdateNewPreCheckoutQuery(Object): """ A new incoming pre-checkout query; for bots only. Contains full information about a checkout Attributes: ID (:obj:`str`): ``UpdateNewPreCheckoutQuery`` Args: id (:obj:`int`): Unique query identifie...
iTeam-co/pytglib
pytglib/api/types/update_new_pre_checkout_query.py
update_new_pre_checkout_query.py
py
2,045
python
en
code
20
github-code
36
[ { "api_name": "utils.Object", "line_number": 6, "usage_type": "name" }, { "api_name": "utils.Object.read", "line_number": 55, "usage_type": "call" }, { "api_name": "utils.Object", "line_number": 55, "usage_type": "name" } ]
18854609090
import cv2 # import the OpenCV module import numpy as np # import the numpy module using the name 'np'. import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt #HOMEWORK 2 # Utility functions def show_wait(original, transformed, filename): double = np.hstack((original,transformed)) #stac...
matitaweb/mumet2017_computer_vision_homework
HOMEWORK_03/bounding_box.py
bounding_box.py
py
983
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.use", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.hstack", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.imwrite", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.rectangle", "line_numb...
22508968712
import socket from flask import Flask from redis import Redis app = Flask(__name__) redis = Redis(host='redis', port=6379) hostname = socket.gethostname() @app.route('/') def hello(): redis.incr('hits') return 'This is %s! There have been %s total hits.' % ( hostname, redis.get('hits'), ...
GoodWriteHQ/datacenter-demo
service/app.py
app.py
py
393
python
en
code
8
github-code
36
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "redis.Redis", "line_number": 8, "usage_type": "call" }, { "api_name": "socket.gethostname", "line_number": 9, "usage_type": "call" }, { "api_name": "redis.incr", "line_number...
27578227980
#!/usr/bin/env python # -*- coding:utf-8 -*- import time,configparser try: from tkinter import * except ImportError: # Python 2.x PythonVersion = 2 from Tkinter import * from tkFont import Font from ttk import * # Usage:showinfo/warning/error,askquestion/okcancel/yesno/retrycancel from tkM...
ilaer/mteam_checkin
ui.py
ui.py
py
6,048
python
en
code
20
github-code
36
[ { "api_name": "configparser.ConfigParser", "line_number": 26, "usage_type": "call" }, { "api_name": "time.strftime", "line_number": 128, "usage_type": "call" }, { "api_name": "time.localtime", "line_number": 128, "usage_type": "call" }, { "api_name": "time.time", ...
33904308892
import os import argparse # from icecream import ic from misc_functions import read_name_funct # from misc_functions import * #################################################### def find_movie_files(movie_folders, iniID, finID, movie_path, imov_min=1, imov_max=9): exist_movies = {} rt_infofiles = False #...
MartinAlvarezSergio/ramses2hdf5_movies
combine_movies_functions.py
combine_movies_functions.py
py
4,453
python
en
code
0
github-code
36
[ { "api_name": "os.path.isdir", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 25, "usage_type": "call" }, { "api_name": "misc_functions.read_name_funct"...
36337524182
import pygame from pygame.sprite import Sprite class Fish(Sprite): def __init__(self, oa_game): super().__init__() self.screen = oa_game.screen self.settings = oa_game.settings self.image = pygame.image.load('gameproject_final/images/fish.png') self.image = pygame.transfor...
sortzis/CIT228
gameproject_final/fish.py
fish.py
py
826
python
en
code
0
github-code
36
[ { "api_name": "pygame.sprite.Sprite", "line_number": 4, "usage_type": "name" }, { "api_name": "pygame.image.load", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pygame.transf...
9766145404
""" This script is used to compute neural network embeddings. """ import torch import numpy as np import sklearn import pickle import os import json import argparse from pathlib import Path from tqdm import tqdm import librosa from utils import extract_spectrogram from models import AudioEncoder de...
andrebola/contrastive-mir-learning
encode.py
encode.py
py
3,368
python
en
code
13
github-code
36
[ { "api_name": "torch.load", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.device", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.no_grad", "line_number": 27, "usage_type": "call" }, { "api_name": "utils.extract_spectrogram", ...
42591855037
from pyrailbaron.map.datamodel import Coordinate from pyrailbaron.map.states import download_zip, extract_kml, simplify_coords from typing import List from pathlib import Path from math import log, atan, cos, pi, tan, sqrt FALSE_EASTING = 6200000 FALSE_NORTHING = 3000000 CENTRAL_MERIDIAN = -91.866667 * (pi/180) STD_P...
bmboucher/rail_baron
python/src/pyrailbaron/map/canada.py
canada.py
py
2,330
python
en
code
0
github-code
36
[ { "api_name": "math.pi", "line_number": 10, "usage_type": "name" }, { "api_name": "math.pi", "line_number": 11, "usage_type": "name" }, { "api_name": "math.pi", "line_number": 12, "usage_type": "name" }, { "api_name": "math.pi", "line_number": 13, "usage_t...
17633338331
# script part2c # Sammy, Nikolai, Aron # integral nummer (1), time_to_destination import numpy as np import roadster import matplotlib.pyplot as plt route_dist, route_speed = roadster.load_route('speed_elsa.npz') delintervall = 25 l = [2**i for i in range(0,delintervall)] trapets_list = [] for num in ...
Nikkobrajj/roadster
script_part2c.py
script_part2c.py
py
1,019
python
en
code
0
github-code
36
[ { "api_name": "roadster.load_route", "line_number": 9, "usage_type": "call" }, { "api_name": "roadster.time_to_destination", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 22, "usage_type": "call" }, { "api_name": "matplotli...
71765839143
import matplotlib.pyplot as plt import random def roll_dice(number_of_dice: int, sides: int = 6) -> int: """Simulates dice throws.""" result = 0 for _ in range(number_of_dice): result += random.randint(1, sides) return result def simulate_die_throws(number_of_rolls: int, amount_of_dice: int, ...
Joey-JJ/dice_simulations
dice_simulation.py
dice_simulation.py
py
1,664
python
en
code
0
github-code
36
[ { "api_name": "random.randint", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.bar", "line_number": 40, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 40, "usage_type": "name" }, { "api_name": "matplotlib.pypl...
25412118768
from typing import Iterable, Tuple from ..shared.more_itertools import flat_map, count from ..shared.solver import Solver """[summary] 2 thoughts on performance: 1. This *enumerates* paths, which isn't necessary. All we need to do is count them, so just increment a number when you get to 16,16, and...
bathcat/pyOiler
src/pyoiler/problems/euler015.py
euler015.py
py
2,357
python
en
code
1
github-code
36
[ { "api_name": "typing.Tuple", "line_number": 21, "usage_type": "name" }, { "api_name": "typing.Iterable", "line_number": 30, "usage_type": "name" }, { "api_name": "typing.Iterable", "line_number": 54, "usage_type": "name" }, { "api_name": "shared.more_itertools.fl...
17353771853
# Cam definition from collections import namedtuple _Cam = namedtuple("_Cam", field_names = ["xpos", "ypos", "steps", "offset", "signal_name", "horizontal", "reverse_direction", "bump_height", "follower"]) class Cam(_Cam): def __new__(_cls, xpos, ypos, steps, offset, signal_name, horizontal=False, reverse_direct...
jmacarthur/box2d-ssem
cams.py
cams.py
py
3,563
python
en
code
0
github-code
36
[ { "api_name": "collections.namedtuple", "line_number": 5, "usage_type": "call" } ]
72555949543
"""django_sandbox URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Cl...
tedlano/django-sandbox
django_sandbox/urls.py
urls.py
py
1,394
python
en
code
1
github-code
36
[ { "api_name": "django.conf.urls.url", "line_number": 24, "usage_type": "call" }, { "api_name": "django.conf.urls.include", "line_number": 24, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 25, "usage_type": "call" }, { "api_name": "dj...
69933322346
#!/usr/bin/python import cv2, time, argparse from ptpython.repl import embed parser = argparse.ArgumentParser(description='OpenCV Face Recognition') parser.add_argument('-interactive', action='store_true', help='Open a console terminal for evaluation') parser.add_argument('input', help='Input video file to pro...
jaysridhar/learn-opencv
face-detection/face-detect.py
face-detect.py
py
1,773
python
en
code
0
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 14, "usage_type": "call" }, { "api_name": "time.time", "line_number": 15, "usage_type": "call" }, { "api_name": "mediapipe.solutions...
7044110193
import imgaug as ia import argparse import imgaug.augmenters as iaa from shapely.geometry import Polygon from cvat import CvatDataset import shapely import numpy as np from urllib.request import urlopen from matplotlib import pyplot as plt import matplotlib.image as mpimg from PIL import Image, ImageDraw import random ...
cds-mipt/cds-dtld-utils
data_augmentation.py
data_augmentation.py
py
6,262
python
en
code
0
github-code
36
[ { "api_name": "PIL.Image.fromarray", "line_number": 28, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 28, "usage_type": "name" }, { "api_name": "cvat.CvatDataset", "line_number": 41, "usage_type": "call" }, { "api_name": "PIL.Image.new", "l...
72673665383
import numpy as np from itertools import combinations from TransitionToClosedView import * def quick_check_zero_det(matrix: np.ndarray): zero_line = True for i in range(matrix.shape[1]): for j in range(matrix.shape[0]): if matrix.item(i, j) != 0: zero_line = False ...
Hembos/optimization-method
Transport task/EnumerationMethod.py
EnumerationMethod.py
py
7,249
python
ru
code
0
github-code
36
[ { "api_name": "numpy.ndarray", "line_number": 6, "usage_type": "attribute" }, { "api_name": "numpy.matrix", "line_number": 51, "usage_type": "call" }, { "api_name": "itertools.combinations", "line_number": 56, "usage_type": "call" }, { "api_name": "numpy.linalg.de...
27051867513
from django.urls import path, include from django.utils.translation import gettext_lazy as _ from .views import * app_name = 'buildings' urlpatterns = [ path('', BuildingListView.as_view(), name = 'building_list'), path(_('add/'), BuildingCreateView.as_view(), name = 'building_create'), path(_('<slug>/'),...
andywar65/buildings
urls.py
urls.py
py
3,877
python
en
code
4
github-code
36
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.utils.translation.gettext_lazy", "line_number": 9, "usage_type": "call" }, { "api_name": "...
74100918822
# Authors: Chao Li, Handing Wang, Jun Zhang, Wen Yao, Tingsong Jiang # Xidian University, China # Defense Innovation Institute, Chinese Academy of Military Science, China # EMAIL: lichaoedu@126.com, hdwang@xidian.edu.cn # DATE: February 2022 # ------------------------------------------...
HandingWangXDGroup/AGSM-DE
LSS_DE.py
LSS_DE.py
py
6,576
python
en
code
9
github-code
36
[ { "api_name": "torch.device", "line_number": 29, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 29, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 29, "usage_type": "attribute" }, { "api_name": "VGG16_Model.vgg"...
847509581
#Python Image Library (PIL) #Installation: #Open terminal #pip install pillow from PIL import Image #Open an image mem_img = Image.open('d:/images/kids.jpg') #fetch its attributes #print(mem_img.size) # size of the image as a (w,h) tuple #print(mem_img.format) #format: JPEG, PNG, ... #print(mem_img.mode) #Color mod...
dheeraj120501/Lets-Code
02-Languages/Python/11-PIL/handson_pil_1.py
handson_pil_1.py
py
1,087
python
en
code
3
github-code
36
[ { "api_name": "PIL.Image.open", "line_number": 10, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 10, "usage_type": "name" } ]
21911933808
#!/usr/bin/env python3 import re import os from os.path import join, isfile import sys import argparse import requests ENCLAVE_ENDPOINT = "" class S3FileReader(object): """ Reads P3A measurements (as they are stored in the S3 bucket) from disk and replays them to our live Nitro enclave. This object mus...
brave-experiments/p3a-shuffler
scripts/replay-p3a-data.py
replay-p3a-data.py
py
2,065
python
en
code
1
github-code
36
[ { "api_name": "os.path.join", "line_number": 25, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path.join", "line_numbe...
32220783153
from itertools import chain def matches_gen(data): yield { 'team-slug' : data['event']['homeTeam']['slug'], 'eventid': data['event']['id'], } yield { 'team-slug' : data['event']['awayTeam']['slug'], 'eventid': data['event']['id'], } def goals_gen(data): team_dict...
repositoriolegal/JokerDoMilhao
Sofa/analysis/filters.py
filters.py
py
803
python
en
code
2
github-code
36
[ { "api_name": "itertools.chain.from_iterable", "line_number": 32, "usage_type": "call" }, { "api_name": "itertools.chain", "line_number": 32, "usage_type": "name" } ]
40243498393
from api.serializers import RecipeSmallSerializer from rest_framework import serializers from users.models import Subscription, User class UserShowSerializer(serializers.ModelSerializer): """Serializer to output user/user list.""" email = serializers.EmailField(required=True) username = serializers.CharF...
nastyatonkova/foodgram-project-react
backend/users/serializers.py
serializers.py
py
5,079
python
en
code
0
github-code
36
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 6, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 6, "usage_type": "name" }, { "api_name": "rest_framework.serializers.EmailField", "line_number": 9, "usage...
26117861949
from datetime import datetime, timezone from unittest import TestCase from zoneinfo import ZoneInfo from app import chasecenter, ical from app.tests.test_chasecenter import EXAMPLE_RAW_EVENT EXAMPLE_EVENT = chasecenter.initialize_chase_event(EXAMPLE_RAW_EVENT) class TestGenerateCalendar(TestCase): def test_gen...
albertyw/chase-center-calendar
app/tests/test_ical.py
test_ical.py
py
1,388
python
en
code
2
github-code
36
[ { "api_name": "app.chasecenter.initialize_chase_event", "line_number": 9, "usage_type": "call" }, { "api_name": "app.tests.test_chasecenter.EXAMPLE_RAW_EVENT", "line_number": 9, "usage_type": "argument" }, { "api_name": "app.chasecenter", "line_number": 9, "usage_type": "...
74035927782
from __future__ import print_function, division import torch from torchvision import datasets, transforms import os import math data_transforms = { 'train': transforms.Compose([ transforms.RandomCrop(32, padding=4), transforms.RandomHorizontalFlip(), transforms.ToTensor(), transfor...
xuchaoxi/pytorch-classification
data_provider.py
data_provider.py
py
1,588
python
en
code
24
github-code
36
[ { "api_name": "torchvision.transforms.Compose", "line_number": 9, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 9, "usage_type": "name" }, { "api_name": "torchvision.transforms.RandomCrop", "line_number": 10, "usage_type": "call" }, { ...
13087308271
import sql_connection as sq import logging def is_new_recipe(cursor, title): """ This function checks if the recipe title already exists in the database or not. If the recipe title does not exist yet in the database, function returns True. If the title already exists in the database, or this an error, ...
DarShabi/Web-Scraping-allrecipes
dump_data.py
dump_data.py
py
7,380
python
en
code
0
github-code
36
[ { "api_name": "logging.error", "line_number": 21, "usage_type": "call" }, { "api_name": "logging.error", "line_number": 41, "usage_type": "call" }, { "api_name": "logging.error", "line_number": 58, "usage_type": "call" }, { "api_name": "logging.error", "line_n...
2223003364
import collections def longest_nonrep(s): # len longest substr with nonrepeating characters if s == "": return 0 d = {} l = 0 last = 0 # use last i window to be the substring for i in range(len(s)): if d.get(s[i], -1) != -1: # if repeating character last = max(last, d[s[...
arrws/leetcode
array/repeat_chars_substr.py
repeat_chars_substr.py
py
1,530
python
en
code
0
github-code
36
[ { "api_name": "collections.defaultdict", "line_number": 36, "usage_type": "call" } ]
15108076525
# -*- coding: utf-8 -*- __author__ = 'lily' import sys import unittest import time, datetime from TestCase.webCase.case_web_all import ParametrizedTestCase,SearchTest,HomeTest,UserinfoTest from common import report from common import util import xlsxwriter from common import readYaml import os sys.path.append("..") P...
hi-noikiy/apiTest
testRunner/webRunner.py
webRunner.py
py
2,977
python
en
code
0
github-code
36
[ { "api_name": "sys.path.append", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_num...
3747122457
# Standard Library import logging import subprocess logging.basicConfig(level=logging.INFO) def create_namespace_if_not_exists(namespace_name: str) -> bool: """ Create a namespace if not exists :param namespace_name: name of the namespace you want to create :return: bool Returns t...
abnamro/repository-scanner
deployment/resc-helm-wizard/src/resc_helm_wizard/kubernetes_utilities.py
kubernetes_utilities.py
py
1,223
python
en
code
137
github-code
36
[ { "api_name": "logging.basicConfig", "line_number": 5, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 5, "usage_type": "attribute" }, { "api_name": "subprocess.run", "line_number": 18, "usage_type": "call" }, { "api_name": "subprocess.run", ...
11440299116
# _*_ coding:utf-8 _*_ """ 主界面逻辑函数 """ import os import exifread import requests from PyQt5.QtCore import QSize, Qt from PyQt5.QtGui import QPixmap from PyQt5.QtWidgets import QWidget, QFileDialog from ui.main_window import Ui_Form class MainWindow(Ui_Form, QWidget): def __init__(self): super(MainWi...
a-ltj/pyqt_image
view/main.py
main.py
py
4,659
python
en
code
4
github-code
36
[ { "api_name": "ui.main_window.Ui_Form", "line_number": 19, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 19, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QFileDialog.getExistingDirectory", "line_number": 34, "usage_type": "call"...
72748557223
from asyncio.windows_events import NULL from cmath import nan from itertools import count import os from pathlib import Path from importlib.resources import path from tokenize import String from weakref import ref import pandas as pd import numpy as np import datetime # cols_to_be_replaced = ['Kund: Namn', 'Kund: C/o...
Farazzaidi22/TeodorProject
Main/Source Code/script.py
script.py
py
13,948
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_excel", "line_number": 23, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 29, "usage_type": "call" }, { "api_name": "importlib.resources.path", "line_number": 32, "usage_type": "name" }, { "api_name": "pathlib.Path"...
22525078962
from . import user from ..models.user import User, Contact from flask import render_template, flash, redirect, request, url_for from flask_login import login_required, current_user from ..forms.profile import PhotoForm, EditProfileForm from ..forms.activity import ContactForm import os from ..extentions import a...
Honglin-Li/TravelPlatform
app/user/view_profile.py
view_profile.py
py
7,125
python
en
code
0
github-code
36
[ { "api_name": "forms.profile.PhotoForm", "line_number": 24, "usage_type": "call" }, { "api_name": "flask_login.current_user.avatar", "line_number": 26, "usage_type": "attribute" }, { "api_name": "flask_login.current_user", "line_number": 26, "usage_type": "name" }, { ...
17864613680
import traceback import copy from compare_reports import Comparison import sources import warnings import asyncio import inspect import arrow import ast import sys import time import pandas as pd from pprint import pprint from string import ascii_lowercase import gspread import gspread_formatting from oauth2client.ser...
CodeBlackwell/Incomparable
DataValidation/sources/semaphore_methods.py
semaphore_methods.py
py
26,468
python
en
code
0
github-code
36
[ { "api_name": "warnings.filterwarnings", "line_number": 26, "usage_type": "call" }, { "api_name": "gspread.utils", "line_number": 39, "usage_type": "attribute" }, { "api_name": "oauth2client.service_account.ServiceAccountCredentials.from_json_keyfile_name", "line_number": 42,...
1749907675
# -*- coding: utf-8 -*- from __future__ import (absolute_import, print_function, unicode_literals, division) from itertools import chain from namedlist import namedtuple, NO_DEFAULT from six import iteritems, iterkeys from .api import kv_format_pairs def _validate_filters(fields, filters): ...
eisensheng/kaviar
kaviar/functools.py
functools.py
py
1,432
python
en
code
1
github-code
36
[ { "api_name": "six.iterkeys", "line_number": 13, "usage_type": "call" }, { "api_name": "namedlist.NO_DEFAULT", "line_number": 27, "usage_type": "name" }, { "api_name": "namedlist.namedtuple", "line_number": 28, "usage_type": "call" }, { "api_name": "itertools.chai...
4185172909
from django.db import models from django.utils import timezone class Post(models.Model): author = models.ForeignKey('auth.User') title = models.CharField(max_length=200) text = models.TextField() created_date = models.DateTimeField(default=timezone.now) published_date = models.DateTimeField(blank=...
jetbrains-academy/pycharm-courses
DjangoTutorial_v3.5/lesson1/task1/blog/models.py
models.py
py
476
python
en
code
232
github-code
36
[ { "api_name": "django.db.models.Model", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 5, "usage_type": "name" }, { "api_name": "django.db.models.ForeignKey", "line_number": 6, "usage_type": "call" }, { "api_name": ...
73335955623
from unittest import TestCase from adsws.api.discoverer import affinity from flask.ext.restful import Resource import flask from flask_restful import Resource, Api import mock class SetCookieView(Resource): """ Returns a good HTTP answer with a coockie set in the headers """ storage = None @affinit...
adsabs/adsws
adsws/tests/test_affinity.py
test_affinity.py
py
2,266
python
en
code
2
github-code
36
[ { "api_name": "flask_restful.Resource", "line_number": 8, "usage_type": "name" }, { "api_name": "adsws.api.discoverer.affinity.affinity_decorator", "line_number": 13, "usage_type": "call" }, { "api_name": "adsws.api.discoverer.affinity", "line_number": 13, "usage_type": "...
938525732
from torch.utils.data import DataLoader import logging import formatter as form from dataset import dataset_list logger = logging.getLogger(__name__) collate_fn = {} formatter = {} def init_formatter(config, task_list, *args, **params): for task in task_list: formatter[task] = form.init_formatter(confi...
china-ai-law-challenge/CAIL2020
sfks/baseline/reader/reader.py
reader.py
py
3,478
python
en
code
150
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "formatter.init_formatter", "line_number": 15, "usage_type": "call" }, { "api_name": "dataset.dataset_list", "line_number": 45, "usage_type": "name" }, { "api_name": "datase...
17013150761
# -*- coding: UTF-8 -*- from __future__ import absolute_import, division, print_function import os os.environ['KMP_DUPLICATE_LIB_OK'] = 'True' os.environ["CUDA_VISIBLE_DEVICES"] = "-1" # 这一行注释掉就是使用cpu,不注释就是使用gpu import pathlib import numpy as np import pandas as pd import seaborn as sns import tensorflow as tf fr...
jiali1025/SMOTE-REG
code/nano_dl_keras_smote.py
nano_dl_keras_smote.py
py
6,754
python
en
code
0
github-code
36
[ { "api_name": "os.environ", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_numb...
70718371624
import os import sys import cv2 import subprocess from tkinter import Tk, Frame, Button, Label, Entry from tkinter import filedialog, colorchooser from math import sqrt from mosaic import MosaicGenerator class Window(Frame): """ The tkinter window and logic """ def __init__(self, parent): ""...
LFruth/MosaicGenerator
MosaicGenerator.py
MosaicGenerator.py
py
7,563
python
en
code
0
github-code
36
[ { "api_name": "tkinter.Frame", "line_number": 12, "usage_type": "name" }, { "api_name": "tkinter.Label", "line_number": 34, "usage_type": "call" }, { "api_name": "tkinter.Entry", "line_number": 37, "usage_type": "call" }, { "api_name": "tkinter.Button", "line_...
37021411015
import torch import torch.nn as nn import torch.nn.functional as F import torch_scatter as scatter from modules.utils import MergeLayer_output, Feat_Process_Layer from modules.embedding_module import get_embedding_module from modules.time_encoding import TimeEncode from model.gsn import Graph_sampling_network from mode...
EdisonLeeeee/STEP
src/model/tgat.py
tgat.py
py
5,947
python
en
code
6
github-code
36
[ { "api_name": "torch.nn", "line_number": 12, "usage_type": "attribute" }, { "api_name": "modules.time_encoding.TimeEncode", "line_number": 27, "usage_type": "call" }, { "api_name": "modules.embedding_module.get_embedding_module", "line_number": 29, "usage_type": "call" ...
7946726176
import torch.nn as nn import torch class BasicBlock(nn.Module): # 18-layers、34-layers exception = 1 def __init__(self, in_channels, out_channles, stride=1, downsample=None, **kwargs): super(BasicBlock, self).__init__() self.conv1 = nn.Co...
yedupeng/Artificial_Model
ResNext/ResNext_Model.py
ResNext_Model.py
py
5,475
python
en
code
0
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 4, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 4, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.nn", "line_numbe...
73894836904
# -*- coding: utf-8 """ File containing ConfigObject. """ from __future__ import division, print_function, unicode_literals ### Logging ### import logging _logger = logging.getLogger("ConfigUtils") ############### import os import sys from ast import literal_eval try: import configparser except ImportError: ...
thnguyn2/ECE_527_MP
mp4/SD_card/partition1/usr/share/pyshared/Onboard/ConfigUtils.py
ConfigUtils.py
py
20,458
python
en
code
0
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "gi.repository.Gio.Settings.list_schemas", "line_number": 56, "usage_type": "call" }, { "api_name": "gi.repository.Gio.Settings", "line_number": 56, "usage_type": "attribute" }, ...
9016676437
#!/usr/bin/env python3 import sys, datetime, threading, time, shutil, hashlib from Key import Key from Display import Display from Simulation import Simulation class Main: def __init__(self): self.cuteloading = None self.asynckey = None try: sys.stdout.write(Display.screen(True...
Mieschendahl/MAPF
MAPF.py
MAPF.py
py
2,019
python
en
code
0
github-code
36
[ { "api_name": "sys.stdout.write", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 13, "usage_type": "attribute" }, { "api_name": "Display.Display.screen", "line_number": 13, "usage_type": "call" }, { "api_name": "Display.Displ...
43162890839
# ResNet:提出了层间残差跳连,引入了前方信息,缓解梯度消失,使神经网络增加层数成为可能。 # 单纯堆叠神经网络层数,会使神经网络模型退化,以至于后面的特征丢失了前面特征的原本模样 # 用一根跳连线将前面的特征直接接到后边,使输出结果包含了堆叠卷积的非线性输出和跳过两层堆叠卷积直接连接过来的恒等映射x, # 让它们对应的元素相加,有效缓解了神经网络模型堆叠导致的退化,使得神经网络可以向着更深层级发展。 # ResNet中的“+” 与InceptionNet中的“+” 不同的。 # Inception中的“+”是沿深度方向叠加,相当于千层蛋糕增加层数 # ResNet块中的“+”是两路特征图对应元素相...
Demonya/tensorflow_basic
P5/P5.15:ResNet.py
P5.15:ResNet.py
py
6,041
python
en
code
0
github-code
36
[ { "api_name": "tensorflow.keras", "line_number": 20, "usage_type": "attribute" }, { "api_name": "tensorflow.keras.models.Model", "line_number": 24, "usage_type": "name" }, { "api_name": "tensorflow.keras.layers.Conv2D", "line_number": 31, "usage_type": "call" }, { ...
8384706762
"""Functions for application """ import collections import base64 import skbio import pandas as pd from io import StringIO def parse_sequences(seq_lines, consensus_sequence): msa = skbio.alignment.TabularMSA.read(seq_lines, constructor=skbio.sequence.DNA) seqs, name...
johnchase/dash-alignment-viewer
webapp/util.py
util.py
py
3,587
python
en
code
2
github-code
36
[ { "api_name": "skbio.alignment.TabularMSA.read", "line_number": 13, "usage_type": "call" }, { "api_name": "skbio.alignment", "line_number": 13, "usage_type": "attribute" }, { "api_name": "skbio.sequence", "line_number": 14, "usage_type": "attribute" }, { "api_name...
12833767605
from functools import reduce with open("input.txt", "r") as f: inputs = f.read().splitlines() def accScore(acc, inputs): return acc + [ ord(a) - ord('A') + 27 if ord(a) < ord('a') else ord(a) - ord('a') + 1 for a in inputs[0] if all(a in line for line in inputs[1:]) ][0] score1 = reduce(a...
efoncubierta/advent-of-code
2022/day03/main.py
main.py
py
570
python
en
code
0
github-code
36
[ { "api_name": "functools.reduce", "line_number": 12, "usage_type": "call" }, { "api_name": "functools.reduce", "line_number": 15, "usage_type": "call" } ]
6504272930
import sys from io import StringIO text_input1 = """4 6""" text_input2 = """3 2""" sys.stdin = StringIO(text_input1) # sys.stdin = StringIO(text_input2) r, c = [int(x) for x in input().split()] matrix = [] for n in range(r): current_row = [] for m in range(c): current_sequence = chr(97 + n) + chr(...
gyurel/Python-Advanced-Course
exercises_multidimensional_lists/matrix_of_palindromes.py
matrix_of_palindromes.py
py
479
python
en
code
0
github-code
36
[ { "api_name": "sys.stdin", "line_number": 8, "usage_type": "attribute" }, { "api_name": "io.StringIO", "line_number": 8, "usage_type": "call" } ]
15339693534
from functools import partial def parse(s: str, ind: int = 0): return_index = ind != 0 result = [] ind += 1 # First character is "[" while s[ind] != "]": if s[ind] == ",": ind += 1 elif s[ind] == "[": sub_result, ind = parse(s, ind) result.append(su...
martinsbruveris/advent-of-code
aoc/aoc_2022/day_13.py
day_13.py
py
1,783
python
en
code
0
github-code
36
[ { "api_name": "functools.partial", "line_number": 58, "usage_type": "call" }, { "api_name": "functools.partial", "line_number": 59, "usage_type": "call" } ]
38250977833
from django.shortcuts import render from django.http import HttpResponse from rest_framework.response import Response from rest_framework.decorators import api_view from .serializers import TodoSerializer from .models import Todo # Create your views here. @api_view(['GET']) def index(request): return Response('h...
SergeJohn/todo-app
backend/api/views.py
views.py
py
1,251
python
en
code
1
github-code
36
[ { "api_name": "rest_framework.response.Response", "line_number": 12, "usage_type": "call" }, { "api_name": "rest_framework.decorators.api_view", "line_number": 10, "usage_type": "call" }, { "api_name": "models.Todo.objects.all", "line_number": 17, "usage_type": "call" }...
44140383131
import logging as log from os import getenv, listdir import discord from discord.ext import commands from discord import ExtensionAlreadyLoaded from dotenv import load_dotenv # -------------------------> Globals load_dotenv() intents = discord.Intents.all() bot = commands.Bot(command_prefix=getenv('PREFIX'), intents...
juliavdkris/dotobot
src/main.py
main.py
py
1,451
python
en
code
0
github-code
36
[ { "api_name": "dotenv.load_dotenv", "line_number": 11, "usage_type": "call" }, { "api_name": "discord.Intents.all", "line_number": 12, "usage_type": "call" }, { "api_name": "discord.Intents", "line_number": 12, "usage_type": "attribute" }, { "api_name": "discord.e...
14889874420
from __future__ import print_function from operator import itemgetter import collections import os.path import re import sys # Avoid endlessly adding to the path if this module is imported multiple # times, e.g. in an interactive session regpath = os.path.join(sys.path[0], "registry") if sys.path[1] != regpath: s...
AndroidBBQ/android10
frameworks/native/opengl/tools/glgen2/glgen.py
glgen.py
py
11,061
python
en
code
176
github-code
36
[ { "api_name": "os.path.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path", "line_number": 11, "usage_type": "name" }, { "api_name": "sys.path", "line_numb...
28481602613
# Importing flask module in the project is mandatory # An object of Flask class is our WSGI application. from flask import Flask, render_template,request, redirect, url_for,session from pymongo import MongoClient app = Flask(__name__) client = MongoClient("mongodb+srv://arsal0344:03444800061@cluster0.u6h8hwf.mongodb...
SHnice/MentoriaPakistan
index.py
index.py
py
2,889
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 23, "usage_type": "call" }, { "api_name": "flask.render_temp...
36567731753
from __future__ import unicode_literals from django.db import migrations from django.db import models class Migration(migrations.Migration): dependencies = [ ('django_mfa', '0002_auto_20160706_1421'), ] operations = [ migrations.AlterField( model_name='UserRecoveryCodes', ...
MicroPyramid/django-mfa
django_mfa/migrations/0003_change_secret_code_max_length.py
0003_change_secret_code_max_length.py
py
418
python
en
code
176
github-code
36
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AlterField", "line_number": 14, "usage_type": "call" }, {...
39479689036
from django.core.management.base import BaseCommand, CommandError from cards.models import Card from cards.models import PhysicalCard from decks.models import Deck, DeckCard, Tournament, TournamentDeck, DeckCluster, DeckClusterDeck import re from optparse import make_option from datetime import datetime, timedelta ...
jcrickmer/mtgdbpy
decks/management/commands/loaddeckhierarchicalclusters.py
loaddeckhierarchicalclusters.py
py
1,967
python
en
code
0
github-code
36
[ { "api_name": "sys.stdout", "line_number": 15, "usage_type": "attribute" }, { "api_name": "django.core.management.base.BaseCommand", "line_number": 18, "usage_type": "name" }, { "api_name": "django.core.management.base.BaseCommand.option_list", "line_number": 21, "usage_t...
36477035716
import os from django.shortcuts import render from django.views.decorators.csrf import csrf_exempt from catVdog.models import IMG from Include.cnn.predict import predict # Create your views here. # 添加 index 函数,返回 index.html 页面 def index(request): return render(request, 'index.html') @csrf_exempt def u...
Missyanc/CatVsDog
catVdog/views.py
views.py
py
927
python
en
code
97
github-code
36
[ { "api_name": "django.shortcuts.render", "line_number": 10, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_n...
25111441493
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division, print_function, unicode_literals __author__ = 'hendro' from tornado.web import RequestHandler from library.AutoVivification import AutoVivification from library.helpers import send_request, is_engine_activated, load_engi...
w33ladalah/news-crawler-engine
webapp/console.py
console.py
py
5,059
python
en
code
0
github-code
36
[ { "api_name": "tornado.web.RequestHandler", "line_number": 16, "usage_type": "name" }, { "api_name": "config.USERNAME", "line_number": 35, "usage_type": "name" }, { "api_name": "config.PASSWORD", "line_number": 35, "usage_type": "name" }, { "api_name": "config.USE...
25534524692
#how to import video in openCV import cv2 as cv2 import matplotlib.pyplot as plt import numpy as np cap = cv2.VideoCapture(0) fourcc = cv2.VideoWriter_fourcc(*'XVID') out = cv2.VideoWriter('outpu.avi',fourcc,20.0,(640,480)) while(cap.isOpened()): ret, frame = cap.read(0)#This code initiates an infinite loop #re...
CoolCoder31/Machine_learning_and_analyze
MY_START/OpenCV/OpenCV1.py
OpenCV1.py
py
677
python
en
code
0
github-code
36
[ { "api_name": "cv2.VideoCapture", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.VideoWriter_fourcc", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.VideoWriter", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.cvtColor", ...