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
14150156159
# -*- coding: utf-8 -*- """ Created on Fri Apr 3 19:09:37 2020 @author: Maldonado """ import sqlite3 conexion = sqlite3.connect("ejemplo.db") cursor = conexion.cursor() #cursor.execute("create table usuarios (nombre varchar(100), edad integer, email varchar(100))") #cursor.execute("insert into usuarios values('Alb...
arudes/Codigo_python
conexion.py
conexion.py
py
853
python
es
code
0
github-code
18
[ { "api_name": "sqlite3.connect", "line_number": 10, "usage_type": "call" } ]
10556913421
#!/usr/bin/env python """Module with Embedding and RankLoss classes. First one is linear embedding with weights for features and so-called anchor point which roughly represents position of clusters.""" __author__ = 'Anna Kukleva' __date__ = 'August 2018' import torch.nn as nn import torch from utils.arg_pars import...
Annusha/slim_mallow
models/rank.py
rank.py
py
1,707
python
en
code
8
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 16, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 16, "usage_type": "name" }, { "api_name": "torch.manual_seed", "line_number": 20, "usage_type": "call" }, { "api_name": "utils.arg_pars.opt.se...
43188100990
import datetime import fcntl import inspect import json import os from types import FunctionType from typing import Optional, Union from apscheduler.executors.pool import ThreadPoolExecutor from apscheduler.jobstores.memory import MemoryJobStore from apscheduler.jobstores.sqlalchemy import SQLAlchemyJobStore from apsc...
SUNET/cnaas-nms
src/cnaas_nms/scheduler/scheduler.py
scheduler.py
py
8,904
python
en
code
66
github-code
18
[ { "api_name": "cnaas_nms.tools.log.get_logger", "line_number": 20, "usage_type": "call" }, { "api_name": "fcntl.lockf", "line_number": 39, "usage_type": "call" }, { "api_name": "fcntl.LOCK_EX", "line_number": 39, "usage_type": "attribute" }, { "api_name": "fcntl.L...
26243083440
# Author: Salvatore Masecchia <salvatore.masecchia@disi.unige.it> # License: New BSD import numpy as np ## Prox and Proj operators ---------------------------------------------------- from utils import discrete_derivate, discrete_derivate_conj, \ interval_projection, prox_l1 # Unchanged functions -...
slipguru/PyCGH
pycgh/analysis/eFLLAT/timing/fllat.py
fllat.py
py
3,490
python
en
code
1
github-code
18
[ { "api_name": "numpy.empty", "line_number": 16, "usage_type": "call" }, { "api_name": "utils.discrete_derivate", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.dot", "line_n...
14883765060
import sys from PySide6.QtWidgets import QMainWindow, QComboBox, QApplication, QLabel, QPushButton class spinner(QMainWindow): def __init__(self): super().__init__() self.spinner=QComboBox(self) lista = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10"] self.spinner.addItem...
Sergiopavonalvarez/Programacion_Python
02 Generacion de Interfaces Graficas/04 Layouts y Spinner/spinner.py
spinner.py
py
847
python
en
code
0
github-code
18
[ { "api_name": "PySide6.QtWidgets.QMainWindow", "line_number": 6, "usage_type": "name" }, { "api_name": "PySide6.QtWidgets.QComboBox", "line_number": 10, "usage_type": "call" }, { "api_name": "PySide6.QtWidgets.QLabel", "line_number": 13, "usage_type": "call" }, { ...
41537264128
#!/usr/bin/env python3 from enum import Enum import itertools class ConnectionType(Enum): JumpTrue = 'JT' JumpFalse = 'JF' CallTrue = 'CT' CallFalse = 'CF' ReturnTrue = 'RT' ReturnFalse = 'RF' NextBlock = 'NB' class Instruction: def __init__(self, name: str, is_branching: bool): ...
mika-s/MikasEmulators
helpers/cfg/classes.py
classes.py
py
3,107
python
en
code
0
github-code
18
[ { "api_name": "enum.Enum", "line_number": 7, "usage_type": "name" }, { "api_name": "itertools.count", "line_number": 59, "usage_type": "call" } ]
12287637894
from TCR_Autoencoder.tcr_autoencoder import PaddingAutoencoder import torch import torch.autograd as autograd import torch.nn as nn import torch.nn.functional as F class PathologyClassifier(nn.Module): def __init__(self, embedding_dim, device, max_len, input_dim, encoding_dim, output_dim, batch_s...
IdoSpringer/pathology_classifer
models.py
models.py
py
2,135
python
en
code
0
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 8, "usage_type": "name" }, { "api_name": "TCR_Autoencoder.tcr_autoencoder.PaddingAutoencoder", "line_number": 20, "usage_type": "call" }, { "ap...
33300166636
import csv import cv2 import numpy as np import matplotlib.pyplot as plt from keras.models import Sequential from keras.layers import Flatten, Dense, Cropping2D, Convolution2D, Lambda from keras.callbacks import EarlyStopping from keras.callbacks import ModelCheckpoint from keras.utils.visualize_util import plot from...
deepakzambre/BehavioralCloning
model.py
model.py
py
2,802
python
en
code
0
github-code
18
[ { "api_name": "csv.reader", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.fliplr", "line_number": 31, "usage_type": "call" }, { "api_name": "keras.models.Sequential", "lin...
8617993621
# -*- coding: utf-8 -*- from metadata import tvshow_meta, season_episodes_meta, all_episodes_meta from apis.trakt_api import trakt_fetch_collection_watchlist, trakt_get_hidden_items, trakt_get_my_calendar from modules import kodi_utils, settings, watched_status as ws from modules.utils import jsondate_to_datetime, adju...
17Q/project
plugin.video.david/resources/lib/indexers/episodes.py
episodes.py
py
22,522
python
en
code
0
github-code
18
[ { "api_name": "modules.kodi_utils.remove_meta_keys", "line_number": 8, "usage_type": "attribute" }, { "api_name": "modules.kodi_utils", "line_number": 8, "usage_type": "name" }, { "api_name": "modules.kodi_utils.set_view_mode", "line_number": 8, "usage_type": "attribute" ...
3330599566
# Задание №6 # 📌 Создать страницу, на которой будет форма для ввода имени # и возраста пользователя и кнопка "Отправить" # 📌 При нажатии на кнопку будет произведена проверка # возраста и переход на страницу с результатом или на # страницу с ошибкой в случае некорректного возраста. import logging from pathlib import P...
pvs7918/StudyPyt2
StudyFlask/seminar2/lesson/task6/task6.py
task6.py
py
1,474
python
ru
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 20, "usage_type": "call" }, { "api_name": "flask.request.bas...
30359082204
import gsw import numpy as np import xarray as xr from compass.step import Step class Combine(Step): """ A step for combining a January and an annual WOA 2023 climatology into a single file, where the January data is used where available and the annual in the deeper ocean where monthly data is not pr...
MPAS-Dev/compass
compass/ocean/tests/utility/extrap_woa/combine.py
combine.py
py
4,630
python
en
code
9
github-code
18
[ { "api_name": "compass.step.Step", "line_number": 8, "usage_type": "name" }, { "api_name": "xarray.open_dataset", "line_number": 66, "usage_type": "call" }, { "api_name": "xarray.Dataset", "line_number": 68, "usage_type": "call" }, { "api_name": "xarray.open_datas...
43365132500
import matplotlib.pyplot as plt import numpy as np f = input("Enter Frequency of sine wave : ") Fs = 8000 time = 8000 x = np.arange(time) y = np.sin(2 * np.pi * f * x / Fs) # print(x) plt.ylim(-1.5,1.5) plt.plot(x, y) plt.xlabel('t') plt.ylabel('y(t) (sine wave)') plt.grid(True) plt.show()
YashAgrawal0/Signals-and-systems
Assignment1/sine.py
sine.py
py
294
python
en
code
0
github-code
18
[ { "api_name": "numpy.arange", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 9, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.ylim", "line_...
32214434210
import sys import pickle from pathlib import Path from dotenv import find_dotenv, load_dotenv # find .env automagically by walking up directories until it's found, then # load up the .env entries as environment variables load_dotenv(find_dotenv()) from tqdm import tqdm import h5py import matplotlib.pyplot as plt imp...
gama-ufsc/brain-age
model_predict.py
model_predict.py
py
4,140
python
en
code
2
github-code
18
[ { "api_name": "dotenv.load_dotenv", "line_number": 8, "usage_type": "call" }, { "api_name": "dotenv.find_dotenv", "line_number": 8, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 29, "usage_type": "call" }, { "api_name": "torch.device", "...
15686942473
from PIL import Image import numpy as np import os import torch from torch.utils.data.dataset import Dataset import torchvision.transforms as T import torchvision.transforms.functional as F import random import cv2 import albumentations as A import json import platform import xml.etree.ElementTree as xmlET CLASS_NAM...
fire717/Pytorch-SSD-And-Extension
libs/data.py
data.py
py
20,953
python
en
code
2
github-code
18
[ { "api_name": "xml.etree.ElementTree.parse", "line_number": 45, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 45, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 64, "usage_type": "call" }, { "api_name": "cv2.cvt...
11618268982
import os import shutil from utils import copy_file, get_dir_length, read_file class GithubScraper: """ Scrape python files from github repo and save to buffer """ def __init__(self, repo, owner, dest, search_root=''): self.repo = repo self.owner = owner self.dest = dest ...
jhanreg11/monty
pipeline/scraper.py
scraper.py
py
1,578
python
en
code
0
github-code
18
[ { "api_name": "utils.get_dir_length", "line_number": 20, "usage_type": "call" }, { "api_name": "utils.copy_file", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line...
8000625346
# -*- coding:utf-8 -*- import os import time import requests from flask import Flask, render_template, request app = Flask(__name__) app.config['SECRET_KEY'] = '******' @app.route('/', methods=['GET', 'POST']) def index(): weather = '' if request.method == 'POST': if 'query' in request.form.keys(): ...
kunbao7/ch6
demo1.py
demo1.py
py
2,386
python
en
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 14, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 14, "usage_type": "name" }, { "api_name": "flask.request.form...
11815873688
import pandas as pd import numpy as np from math import sqrt from numpy import concatenate from matplotlib import pyplot from pandas import read_csv from pandas import DataFrame from pandas import concat from sklearn.preprocessing import MinMaxScaler from sklearn.preprocessing import LabelEncoder from sklearn...
shreyb99/self-adaptive-ecosystem
data analysis/LSTM Model.py
LSTM Model.py
py
4,495
python
en
code
1
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 19, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.MinMaxScaler", "line_number": 27, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 29, "usage_type": "call" }, { "api_name": "p...
15921324863
import os import torch from rouge import Rouge from datasets import load_dataset from transformers import (AutoTokenizer,AutoModelForSeq2SeqLM) import time start = time.time() def __init__(): model_ckpt = 'model/Laysumm/PRIMERA-arxiv-TrainPLUStest-4096' tokenizer = AutoTokenizer.from_pretrained(model_ckpt) ...
yangjenhao/BioLaySumm-2023-Task2-ReadabilityControlledSummarizationOfBiomedicalArticles
eval.py
eval.py
py
3,355
python
en
code
2
github-code
18
[ { "api_name": "time.time", "line_number": 7, "usage_type": "call" }, { "api_name": "transformers.AutoTokenizer.from_pretrained", "line_number": 11, "usage_type": "call" }, { "api_name": "transformers.AutoTokenizer", "line_number": 11, "usage_type": "name" }, { "ap...
32690365150
import math import time import functools import datetime import itertools from logging import getLogger import pyglet from PIL import Image import pathilico.pygletelm.cache as cache import pathilico.app.geometry as geometry from pathilico.pygletelm.message import WindowResized, WindowApiChangeCursor LAYERS = dict()...
yujota/pathilico
python/pathilico/pygletelm/window.py
window.py
py
49,052
python
en
code
1
github-code
18
[ { "api_name": "pyglet.graphics.OrderedGroup", "line_number": 26, "usage_type": "call" }, { "api_name": "pyglet.graphics", "line_number": 26, "usage_type": "attribute" }, { "api_name": "functools.wraps", "line_number": 44, "usage_type": "call" }, { "api_name": "tim...
27119751829
# -*- coding: utf-8 -*- import json import os from .utils import FileManagement from django.conf import settings from django.http import JsonResponse from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render from django.urls import reverse from wsgiref.util import FileWrapper pat...
nirjharij/docshare
docshareapp/views.py
views.py
py
4,755
python
en
code
0
github-code
18
[ { "api_name": "django.conf.settings.WORK_DIR", "line_number": 14, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 14, "usage_type": "name" }, { "api_name": "utils.FileManagement", "line_number": 16, "usage_type": "call" }, { "api_...
17072096112
from flask import request from flask_wtf import FlaskForm from wtforms import BooleanField, HiddenField, RadioField, SelectMultipleField, StringField, TextAreaField, validators from wtforms.fields import EmailField, TelField from wtforms.validators import DataRequired, Email, Optional, Regexp, URL from wtforms.widgets ...
StartupsPoleEmploi/labonneboite
labonneboite/web/contact_form/forms.py
forms.py
py
8,161
python
en
code
42
github-code
18
[ { "api_name": "wtforms.SelectMultipleField", "line_number": 15, "usage_type": "name" }, { "api_name": "wtforms.widgets.ListWidget", "line_number": 25, "usage_type": "call" }, { "api_name": "wtforms.widgets.CheckboxInput", "line_number": 26, "usage_type": "call" }, { ...
27366048320
import pygame class Cell: def __init__(self, value, row, col, screen): self.font = pygame.font.SysFont('arialblack', 4) self.value = value self.row = int(row) self.col = int(col) self.screen = screen # Sets all self values to correct values self.baseimg = p...
LuisMedina11/Project4-G67
cell(luis).py
cell(luis).py
py
2,221
python
en
code
0
github-code
18
[ { "api_name": "pygame.font.SysFont", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.font", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pygame.image.load", "line_number": 13, "usage_type": "call" }, { "api_name": "pygame.image", ...
20830367666
import argparse import os import torch from torch.nn.parallel import DistributedDataParallel from sslsv.Trainer import Trainer from sslsv.utils.helpers import load_config, load_dataloader, load_model def train(args): world_size = int(os.environ['WORLD_SIZE']) rank = int(os.environ["LOCAL_RANK"]) torch....
theolepage/sslsv
train_distributed.py
train_distributed.py
py
1,152
python
en
code
16
github-code
18
[ { "api_name": "os.environ", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.distributed.init_process_group", "line_number": 15, "usage_type": "call" }, { "api_name": "...
7592896564
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
suhaibchishti/sample_scripts
manila/tests/api/v1/test_share_instances.py
test_share_instances.py
py
3,394
python
en
code
0
github-code
18
[ { "api_name": "oslo_config.cfg.CONF", "line_number": 23, "usage_type": "attribute" }, { "api_name": "oslo_config.cfg", "line_number": 23, "usage_type": "name" }, { "api_name": "manila.test.TestCase", "line_number": 27, "usage_type": "attribute" }, { "api_name": "m...
21813882847
# Objective: print "Bring an Umbrella" if any of the next 12 hourly weather condition codes is less than 700. #HINT ''' 1. Practice printing out the weather ID for the weather in the 0th hour. 2. Try to create a slice from the weather data to get a list of the hourly forecasts for only the next 12 hours. 3. Using the ...
ahudspeth199/100_days_of_code
src/day_35_notes/challenge_315.py
challenge_315.py
py
1,026
python
en
code
0
github-code
18
[ { "api_name": "requests.get", "line_number": 21, "usage_type": "call" } ]
10043319713
# nbit-5, with truncation, one figure, all T. # with smooth # 25th/January/2021: T fixed. nbit-5 fixed. import numpy as np import glob import os import re import matplotlib.pyplot as plt from tensorboard.backend.event_processing.event_accumulator import EventAccumulator plt.switch_backend('agg') total_steps = 200000...
Shihwin/SelectiveSampling
utils/plot.py
plot.py
py
6,828
python
en
code
1
github-code
18
[ { "api_name": "matplotlib.pyplot.switch_backend", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 12, "usage_type": "name" }, { "api_name": "numpy.zeros", "line_number": 48, "usage_type": "call" }, { "api_name": "numpy....
25774386082
import os import json from typing import List from functools import reduce from operator import add from collections import Counter def summation_time(wakati_array: List, time_params: dict) -> int: target = [time_params[n] for n in wakati_array if n in time_params] return adjust_time_by_paramter(r...
tsukudamayo/kytea-api
compute_recipetime.py
compute_recipetime.py
py
2,673
python
en
code
0
github-code
18
[ { "api_name": "typing.List", "line_number": 9, "usage_type": "name" }, { "api_name": "functools.reduce", "line_number": 12, "usage_type": "call" }, { "api_name": "operator.add", "line_number": 12, "usage_type": "argument" }, { "api_name": "typing.List", "line_...
28606536275
# pylint: disable=bad-indentation,missing-module-docstring,missing-function-docstring import functools from acme.specs import EnvironmentSpec from acme.tf import networks import sonnet as snt import tensorflow as tf def make_value_func_bsuite(environment_spec: EnvironmentSpec, distribution...
liyuan9988/IVOPEwithACME
src/ope/fqe/nn_structure/bsuite_network.py
bsuite_network.py
py
1,062
python
en
code
2
github-code
18
[ { "api_name": "acme.specs.EnvironmentSpec", "line_number": 10, "usage_type": "name" }, { "api_name": "functools.partial", "line_number": 18, "usage_type": "call" }, { "api_name": "tensorflow.one_hot", "line_number": 19, "usage_type": "attribute" }, { "api_name": "...
74805863401
import ast import json import types from base64 import b64encode, b64decode from Crypto.Cipher import AES from Crypto.Util.Padding import pad, unpad from Crypto.Random import get_random_bytes class Message(object): def __init__(self, *args): self.package = args[0] self.key = args[1] ...
AB-Spud/jargon
jargon_message.py
jargon_message.py
py
4,590
python
en
code
1
github-code
18
[ { "api_name": "types.SimpleNamespace", "line_number": 17, "usage_type": "call" }, { "api_name": "types.SimpleNamespace", "line_number": 22, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 27, "usage_type": "call" }, { "api_name": "ast.literal_ev...
42129222934
import logging from subscription_manager.cli_command.cli import CliCommand from subscription_manager.i18n import ugettext as _ log = logging.getLogger(__name__) class VersionCommand(CliCommand): def __init__(self): shortdesc = _("Print version information") super(VersionCommand, self).__init__(...
candlepin/subscription-manager
src/subscription_manager/cli_command/version.py
version.py
py
911
python
en
code
61
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "subscription_manager.cli_command.cli.CliCommand", "line_number": 9, "usage_type": "name" }, { "api_name": "subscription_manager.i18n.ugettext", "line_number": 11, "usage_type": "ca...
417181616
from encodings import utf_8 from iot.DB import DBSingleton db= DBSingleton.get_instance() db.connectDB() from iot.models import User, Room, Devices, Records, DevicesLog from iot.serializers import DevicesSerializer, RecordsSerializer from rest_framework.response import Response from rest_framework import status from ...
HandsOfGoddest/SmartHome-HCMUT-HK212
BackEnd/src/iot/controller/deviceController.py
deviceController.py
py
6,993
python
en
code
0
github-code
18
[ { "api_name": "iot.DB.DBSingleton.get_instance", "line_number": 3, "usage_type": "call" }, { "api_name": "iot.DB.DBSingleton", "line_number": 3, "usage_type": "name" }, { "api_name": "rest_framework.decorators.APIView", "line_number": 17, "usage_type": "name" }, { ...
43237462483
import requests from bs4 import BeautifulSoup # Kullanıcıdan web sitesi adresini al url = input("Please enter the website address: ") # İstek yap ve yanıtı al response = requests.get(url) # Eğer yanıt 200 OK ise devam et, aksi takdirde hata mesajı ver if response.status_code == 200: soup = BeautifulSoup(response...
KikiCod/web-scraper
web_scraping.py
web_scraping.py
py
629
python
tr
code
0
github-code
18
[ { "api_name": "requests.get", "line_number": 8, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 12, "usage_type": "call" } ]
71427003240
import os import matplotlib.pyplot as plt import seaborn as sns color = sns.color_palette() sns.set_style('darkgrid') import gc import numpy as np import pandas as pd from sklearn.preprocessing import LabelEncoder from sklearn.model_selection import StratifiedKFold #Importing most common alogorithms from...
aorursy/new-nb-3
hakeem_comparison-of-different-algorithms.py
hakeem_comparison-of-different-algorithms.py
py
7,924
python
en
code
0
github-code
18
[ { "api_name": "seaborn.color_palette", "line_number": 8, "usage_type": "call" }, { "api_name": "seaborn.set_style", "line_number": 10, "usage_type": "call" }, { "api_name": "warnings.simplefilter", "line_number": 52, "usage_type": "call" }, { "api_name": "pandas.r...
36213643931
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="leabra", version="1.1.15", author="emergent", author_email="oreilly@ucdavis.edu", description="Python interface to emergent neural network simulation system, in Go", long_description=l...
emer/leabra
python/setup.py
setup.py
py
675
python
en
code
63
github-code
18
[ { "api_name": "setuptools.setup", "line_number": 6, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 15, "usage_type": "call" } ]
34145318906
from django.shortcuts import render from django.http import HttpResponseRedirect from django.urls import reverse from django.contrib.auth import logout,login,authenticate from django.contrib.auth.forms import UserCreationForm # Create your views here. def logout_view(request): """注销用户""" logout(re...
Dgama/Eric-Matthes-Python-Programming
learning_log/users/views.py
views.py
py
1,489
python
zh
code
0
github-code
18
[ { "api_name": "django.contrib.auth.logout", "line_number": 12, "usage_type": "call" }, { "api_name": "django.http.HttpResponseRedirect", "line_number": 13, "usage_type": "call" }, { "api_name": "django.urls.reverse", "line_number": 13, "usage_type": "call" }, { "a...
9257261359
#!/usr/bin/env python3 # coding=utf-8 import sys import sys from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.QtCore import pyqtSlot from PyQt5 import uic,QtGui import random import math class Example(QWidget): def __init__(self): super().__init__() QWidget.__init...
thekupidman/pythonravil4
pythonravil4/main.py
main.py
py
2,519
python
en
code
0
github-code
18
[ { "api_name": "PyQt5.QtGui.QIcon", "line_number": 27, "usage_type": "call" }, { "api_name": "PyQt5.QtGui", "line_number": 27, "usage_type": "name" }, { "api_name": "random.randint", "line_number": 54, "usage_type": "call" }, { "api_name": "math.sin", "line_num...
16816225925
import numpy as np import pandas as pd import re from sklearn.preprocessing import LabelEncoder from sklearn.utils.validation import check_is_fitted from pandas.tseries.holiday import USFederalHolidayCalendar, Holiday, SU, MO, TU, WE, TH, FR, SA from pandas.tseries.offsets import DateOffset from sklearn.utils import co...
leontoddjohnson/dstools
ds_statsml/_feature_eng.py
_feature_eng.py
py
15,208
python
en
code
0
github-code
18
[ { "api_name": "_timeseriestools.get_consecutive", "line_number": 23, "usage_type": "call" }, { "api_name": "_timeseriestools.get_fourier", "line_number": 74, "usage_type": "call" }, { "api_name": "_timeseriestools.get_fourier", "line_number": 75, "usage_type": "call" },...
23873943949
from __future__ import print_function import logging import grpc import cli_grpc_pb2 as pb2 import cli_grpc_pb2_grpc as pb2_grpc default_netloc = 'localhost:50051' def stat_client(stub, _uuid): uuid = pb2.Uuid(**{'value': _uuid}) req = pb2.StatRequest(**{"uuid": uuid}) try: stat_reply = stub.stat(...
TomasHricina/rest-grpc-CLI-client
grpc_client.py
grpc_client.py
py
1,119
python
en
code
0
github-code
18
[ { "api_name": "cli_grpc_pb2.Uuid", "line_number": 10, "usage_type": "call" }, { "api_name": "cli_grpc_pb2.StatRequest", "line_number": 11, "usage_type": "call" }, { "api_name": "grpc.RpcError", "line_number": 15, "usage_type": "attribute" }, { "api_name": "cli_grp...
21482211228
from django import forms from django.core import validators from sm_order.models import CollectAddress class AddressAddForm(forms.ModelForm): # 用户添加地址信息进行验证 class Meta: model = CollectAddress # 排除,不包括(那些字段不需要验证) # 因为提交过来的信息中,没有用户ID(user),所以不要验证 exclude = ["user", "create_time"...
kuangyongwei/supermarket
apps/sm_order/forms.py
forms.py
py
1,671
python
en
code
0
github-code
18
[ { "api_name": "django.forms.ModelForm", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 7, "usage_type": "name" }, { "api_name": "sm_order.models.CollectAddress", "line_number": 10, "usage_type": "name" }, { "api_name": ...
21027485555
# -*- coding: utf-8 -*- from flask import Flask,send_file, send_from_directory,jsonify from flask import request import json,os import redis import hashlib import time from PIL import Image,ImageDraw,ImageFont from redisco import models import redisco import requests from flask_socketio import SocketIO, rooms, join_roo...
yongliangliu/flaskMiniApp
pythonService.py
pythonService.py
py
16,081
python
en
code
0
github-code
18
[ { "api_name": "redisco.connection_setup", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 18, "usage_type": "call" }, { "api_name": "flask_socketio.SocketIO", "line_number": 19, "usage_type": "call" }, { "api_name": "redis.Re...
1653938869
import os import math import argparse import nsml import torch import torch.nn as nn import torchvision.models as models from data_loader import feed_infer from data_local_loader import data_loader from tqdm import tqdm from nsml import DATASET_PATH, IS_ON_NSML if IS_ON_NSML: TRAIN_DATASET_PATH = os.path.join(D...
temerara-nplab/round-1
iitp_trash/main.py
main.py
py
5,489
python
en
code
null
github-code
18
[ { "api_name": "nsml.IS_ON_NSML", "line_number": 16, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 17, "usage_type": "call" }, { "api_name": "nsml.DATASET_PATH", "line_number": 17, "usage_type": "argument" }, { "api_name": "os.path", "lin...
39733333909
import json import time from binance import Client import requests import pandas as pd from datetime import datetime # Коды не привязаны к личному кабинету в binance. Взяты из документации с апи. # При работе со своим личным кабинетом, нужно вставить свои, но лучше их "спрятать" через denv. # при данном коде данные ...
Karisana/binance
main.py
main.py
py
4,247
python
ru
code
0
github-code
18
[ { "api_name": "binance.Client", "line_number": 17, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 28, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 30, "usage_type": "call" }, { "api_name": "datetime.datetime",...
71023527721
import asyncio import random from many_many import ManyMany from stages import Stage class Model: def __init__(self, num): self.abv = None self.num = num self._saved = False self.processed = False self._downloaded = False @property def downloaded(self): re...
asmacdo/sandbox
helper-stages/mock_docker.py
mock_docker.py
py
4,461
python
en
code
0
github-code
18
[ { "api_name": "random.random", "line_number": 21, "usage_type": "call" }, { "api_name": "asyncio.sleep", "line_number": 22, "usage_type": "call" }, { "api_name": "stages.Stage", "line_number": 92, "usage_type": "name" }, { "api_name": "stages.Stage", "line_num...
41270642083
from pathlib import Path import pydicom import numpy as np import nibabel as nib from natsort import natsorted from typing import List, Dict, Any, Union from collections import defaultdict def get_dcm_list(folder: Path) -> List[Path]: """ Get a naturally sorted list of DICOM files from a directory. :para...
ludgerradke/bMRI
src/Utilitis/read.py
read.py
py
3,436
python
en
code
0
github-code
18
[ { "api_name": "pathlib.Path", "line_number": 10, "usage_type": "name" }, { "api_name": "natsort.natsorted", "line_number": 17, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.List", "line_nu...
7045400788
import pygame from Sprites.player import Player from Sprites.turtle_animated import TurtleSinker def animate_sprites(*args): """ Helper function used for animating turtles. - :param args: A list containing two lanes of turtles to be animated, the current frame count, and the net_group used to let...
IUS-CS/project-scrumger-games
src/Engine/sprite_animator.py
sprite_animator.py
py
2,209
python
en
code
1
github-code
18
[ { "api_name": "Sprites.turtle_animated.TurtleSinker", "line_number": 32, "usage_type": "argument" }, { "api_name": "Sprites.player.Player", "line_number": 39, "usage_type": "argument" }, { "api_name": "pygame.sprite", "line_number": 43, "usage_type": "attribute" }, { ...
21199166828
import json from typing import List import requests from data.payloads.notion_payloads import NotionPayloads class NotionAPI: base_url = "https://api.notion.com/v1" def __init__(self, auth_secret: str, notion_version: str): self._auth_secret = auth_secret self._notion_version = notion_versi...
anggelomos/notion-ticktick-connector
controllers/notion_api.py
notion_api.py
py
1,614
python
en
code
11
github-code
18
[ { "api_name": "data.payloads.notion_payloads.NotionPayloads.get_headers", "line_number": 17, "usage_type": "call" }, { "api_name": "data.payloads.notion_payloads.NotionPayloads", "line_number": 17, "usage_type": "name" }, { "api_name": "requests.post", "line_number": 27, ...
1280712134
import os import json import re import tomllib from pathlib import Path from typing import Any, Optional, cast, Callable, Final from . import shell Json = Any Builtin = Callable[..., Json] BUILTINS: Final[dict[str, Builtin]] = { "uname": lambda arg, ctx: getattr(shell.uname(), arg).lower(), "include": lambd...
cute-engineering/cutekit
cutekit/jexpr.py
jexpr.py
py
2,500
python
en
code
25
github-code
18
[ { "api_name": "typing.Any", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.Callable", "line_number": 12, "usage_type": "name" }, { "api_name": "typing.Final", "line_number": 14, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_numb...
5504792230
import pymysql import os from dotenv import load_dotenv load_dotenv() class Data: def __init__(self): self.conn = pymysql.connect( host=os.getenv('DB_HOST'), user=os.getenv("DB_USER"), password=os.getenv("DB_PASSWORD"), db=os.getenv("DB_NAME") ...
subAngel/sistema-spa
Database/database.py
database.py
py
7,828
python
en
code
0
github-code
18
[ { "api_name": "dotenv.load_dotenv", "line_number": 4, "usage_type": "call" }, { "api_name": "pymysql.connect", "line_number": 10, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 11, "usage_type": "call" }, { "api_name": "os.getenv", "line_num...
43821870295
# Importing necessary libraries from Cryptodome.Cipher import AES from Cryptodome.Util.Padding import pad, unpad import os # Defining the CBC mode encryption function # this function accepts a plaintext (entered by the user, uses the initialized random key, and initialized vector) # the AES.new creates a new cipher ob...
dharmik529/IST402
LM2_ECB&OFB_CBC&CBF/CBC_CBF_Python/main.py
main.py
py
4,161
python
en
code
1
github-code
18
[ { "api_name": "Cryptodome.Cipher.AES.new", "line_number": 16, "usage_type": "call" }, { "api_name": "Cryptodome.Cipher.AES", "line_number": 16, "usage_type": "name" }, { "api_name": "Cryptodome.Cipher.AES.MODE_CBC", "line_number": 16, "usage_type": "attribute" }, { ...
39062146703
import reflex as rx class State(rx.State): count: int = 0 def index(): return rx.vstack( rx.heading( "復興高中", color="#97AEB9", style={"margin-left":"-20px","margin": "20px ","margin-right":"-260px"} ), rx.heading( "自主學習點名系統", ...
EJ0226/fhsh_naming_system
project log_in/project/project.py
project.py
py
2,159
python
en
code
0
github-code
18
[ { "api_name": "reflex.State", "line_number": 3, "usage_type": "attribute" }, { "api_name": "reflex.vstack", "line_number": 7, "usage_type": "call" }, { "api_name": "reflex.heading", "line_number": 8, "usage_type": "call" }, { "api_name": "reflex.heading", "lin...
32077255043
# pyright: strict from dataclasses import dataclass from ...makeentries import Entries from ...common.energy import Energy from ...industry2018.i18 import I18 from ...transport2018.t18 import T18 from ...electricity2018.e18 import E18 @dataclass(kw_only=True) class Energies: r18_coal: Energy r18_fueloil: En...
GermanZero-de/localzero-generator-core
src/climatevision/generator/heat2018/energy_base/__init__.py
__init__.py
py
4,690
python
en
code
6
github-code
18
[ { "api_name": "common.energy.Energy", "line_number": 14, "usage_type": "name" }, { "api_name": "common.energy.Energy", "line_number": 15, "usage_type": "name" }, { "api_name": "common.energy.Energy", "line_number": 16, "usage_type": "name" }, { "api_name": "common...
3424730805
##Created By:Ayat Khrisat ##Email: v-akhrisat@microsoft.com import os from azure.ai.translation.text import TextTranslationClient, TranslatorCredential from azure.ai.translation.text.models import InputTextItem from azure.core.exceptions import HttpResponseError import azure.cognitiveservices.speech as speechsdk spee...
AyatKhraisat/Translator
main.py
main.py
py
4,052
python
en
code
0
github-code
18
[ { "api_name": "os.environ.get", "line_number": 10, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 11, "usage_type": "call" }, { "api_name": "os.environ", "line_...
13749763109
############################################################################### # # Author: Nathan Adelgren # Affiliation: Andlinger Center For Energy and the Environment # Princeton University # # Purpose: Define the class to be associated with an invariancy region. # ########...
Nadelgren/upLCP_solver
up_inv_region.py
up_inv_region.py
py
4,359
python
en
code
0
github-code
18
[ { "api_name": "copy.deepcopy", "line_number": 40, "usage_type": "call" }, { "api_name": "math.floor", "line_number": 81, "usage_type": "call" }, { "api_name": "math.ceil", "line_number": 81, "usage_type": "call" }, { "api_name": "collections.Counter", "line_nu...
36661593321
import sys import os import cv2 import numpy as np import h5py resource_path = 'D:/LZH/code/deep_learning/pytorch/' pic_dir = './data/0_presented_images_800/' root_dir = os.path.join(resource_path, pic_dir) sys.path.append(resource_path) resolution = 300 image_path = os.listdir(root_dir) path_dict = {} for j in ...
Kurisuzzz/Neural_control
Neural_control/image2array.py
image2array.py
py
831
python
en
code
2
github-code
18
[ { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.path", "line_number":...
30116027253
"""Transition matrix module.""" from typing import TypeVar, Iterable, Optional from cellrank import logging as logg from cellrank.ul._docs import d, inject_docs from cellrank.tl.kernels import VelocityKernel, ConnectivityKernel from cellrank.tl.kernels._base_kernel import KernelExpression from cellrank.tl.kernels._ve...
grenkoca/cellrank
cellrank/tl/_transition_matrix.py
_transition_matrix.py
py
4,296
python
en
code
null
github-code
18
[ { "api_name": "typing.TypeVar", "line_number": 12, "usage_type": "call" }, { "api_name": "typing.Optional", "line_number": 23, "usage_type": "name" }, { "api_name": "typing.Iterable", "line_number": 23, "usage_type": "name" }, { "api_name": "typing.Optional", ...
33794365358
import numpy as np from bokeh.models import CustomJS, Slider, ColumnDataSource, WidgetBox from bokeh.plotting import figure, output_file, show from bokeh.layouts import layout from scipy.integrate import odeint tools = 'pan' def lorenz(): sigma = 10 rho = 28 beta = 8.0 / 3 theta = 3 * np.pi / 4 ...
birdsarah/bokeh-miscellany
old/new_layout_tests/large_lorenz_layout.py
large_lorenz_layout.py
py
1,120
python
en
code
2
github-code
18
[ { "api_name": "numpy.pi", "line_number": 16, "usage_type": "attribute" }, { "api_name": "numpy.arange", "line_number": 26, "usage_type": "call" }, { "api_name": "scipy.integrate.odeint", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.cos", "li...
39881875882
from dis import dis from genericpath import exists import numpy as np from tkinter import * from tkinter import messagebox from tkinter import filedialog import PIL.Image, PIL.ImageTk from shutil import copyfile import time, os import cv2 import torch import torchvision.transforms as tt import torch.nn as nn import tor...
bISTP/Emotion-Detection-OpenCV-Pytorch-ResNet9
GUI_face_detection.py
GUI_face_detection.py
py
10,752
python
en
code
0
github-code
18
[ { "api_name": "cv2.CascadeClassifier", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.load", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.device", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.nn.Conv2d", "...
24406870785
import logging import pytest import requests from AutoApi.wenxin.contact.token import Weixin from AutoApi.wenxin.contact.utils import Utils class TestDepartment: @pytest.mark.parametrize("name", ["因缘研究院", "福利研究院", "天文研究院"]) def test_create(self, name, token): data = { "name": name+Utils...
duang01/Sublime3
AutoApi/wenxin/contact/test_department.py
test_department.py
py
1,035
python
en
code
0
github-code
18
[ { "api_name": "AutoApi.wenxin.contact.utils.Utils.udid", "line_number": 15, "usage_type": "call" }, { "api_name": "AutoApi.wenxin.contact.utils.Utils", "line_number": 15, "usage_type": "name" }, { "api_name": "requests.post", "line_number": 20, "usage_type": "call" }, ...
12007256601
# -*- ecoding: utf-8 -*- # @ModuleName: dcn # @Author: wk # @Email: 306178200@qq.com # @Time: 2022/6/11 12:56 PM from torch import nn import torch from ..layers import EmbeddingLayer, MLP_Layer, CrossNet from ..utils import get_dnn_input_dim, get_linear_input, get_feature_num from ..base_model import BaseModel class DC...
longtaizi13579/rec_sys
rec_pangu-main/rec_pangu/models/ranking/dcn.py
dcn.py
py
1,609
python
en
code
0
github-code
18
[ { "api_name": "base_model.BaseModel", "line_number": 11, "usage_type": "name" }, { "api_name": "utils.get_feature_num", "line_number": 24, "usage_type": "call" }, { "api_name": "layers.CrossNet", "line_number": 26, "usage_type": "call" }, { "api_name": "torch.nn.L...
70447130281
import sys import os sys.path.insert(1, os.path.join(sys.path[0], '.')) import itertools import numpy as np import activation_function from layer import InputLayer, OutputLayer, Layer class NetworkBaseClass: ID_NONE = -1 _ID_generator = itertools.count(ID_NONE + 1) @staticmethod def GenerateID(): ...
lonelycorn/machine-learning
legacy/network.py
network.py
py
6,424
python
en
code
0
github-code
18
[ { "api_name": "sys.path.insert", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 3, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
70796451241
import os from flask import Flask, render_template from flask_socketio import SocketIO, emit app = Flask(__name__) app.config["SECRET_KEY"] = os.getenv("SECRET_KEY") socketio = SocketIO(app) @app.route("/") def index(): return render_template("flack.html") @socketio.on("send message") def sendMessage(data): ...
FaizaanKhan24/MessagingWebApp
application.py
application.py
py
444
python
en
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 7, "usage_type": "call" }, { "api_name": "flask_socketio.SocketIO", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.render_template", ...
34327722591
from django.contrib import admin from django.urls import path from .views.task import * from .views.user import * urlpatterns = [ #Login and logout path("",home,name="home"), path("login",login_user,name="login"), path("logout",logout_user,name="logout"), #CRUD Task path("tasks/",list_tasks, na...
jadsonpp/todo_django
app/urls.py
urls.py
py
577
python
en
code
0
github-code
18
[ { "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.urls.path", "line_number": 10, "usage_type": "call" }, { "api_name": "django.urls.path", ...
4634235429
from keras import backend as K from keras.models import Model from keras.layers import Conv2D, Input, Conv2DTranspose, merge ,UpSampling2D from keras.optimizers import SGD, adam from keras.callbacks import ReduceLROnPlateau,ModelCheckpoint import prepare_data as pd import pandas import numpy import cv2 sca...
Wuuu12138/SISR
SRCNN2x.py
SRCNN2x.py
py
3,577
python
en
code
0
github-code
18
[ { "api_name": "keras.backend.log", "line_number": 15, "usage_type": "call" }, { "api_name": "keras.backend", "line_number": 15, "usage_type": "name" }, { "api_name": "keras.backend.mean", "line_number": 15, "usage_type": "call" }, { "api_name": "keras.backend.squa...
9511754272
# Import necessary libraries from wordcloud import WordCloud import matplotlib.pyplot as plt # Text data def choose_file(): text = input("filename: ") with open(text,'r') as f: text = f.read() return text # Generate word cloud def customize_wordcloud(): bg_color = input("backg...
becks-tech/word-cloud-generator
word_cloud.py
word_cloud.py
py
747
python
en
code
0
github-code
18
[ { "api_name": "wordcloud.WordCloud", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.imshow", "line_number": 25, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 25, "usage_type": "name" }, { "api_name": "matplo...
7429349951
import scipy.optimize from scipy.optimize import linprog import numpy as np import gc import time def LP_solver(T, data, replica_num): start = time.clock() disk = len(T) task = len(data) print("LP_solver-C-initing") c = [0] * task * replica_num # for i in range(0, disk * task): # c.app...
Jmt1995/DLP_MUTI_REPLICA
LP1.py
LP1.py
py
1,966
python
en
code
0
github-code
18
[ { "api_name": "time.clock", "line_number": 7, "usage_type": "call" }, { "api_name": "time.clock", "line_number": 70, "usage_type": "call" }, { "api_name": "gc.collect", "line_number": 73, "usage_type": "call" }, { "api_name": "scipy.optimize.linprog", "line_nu...
22567924743
''' Language parser for Python ''' from lizard import CodeReader class PythonReader(CodeReader): ext = ['py'] conditions = set(['if', 'for', 'while', 'and', 'or', 'elif', 'except', 'finally']) def __init__(self, context): super(PythonReader, self).__init__(context) ...
SoftengPoliTo/MI
lizard_ext/python.py
python.py
py
2,771
python
en
code
0
github-code
18
[ { "api_name": "lizard.CodeReader", "line_number": 6, "usage_type": "name" }, { "api_name": "lizard.CodeReader.generate_tokens", "line_number": 21, "usage_type": "call" }, { "api_name": "lizard.CodeReader", "line_number": 21, "usage_type": "name" } ]
33116972419
import unittest import os from dotenv import load_dotenv import nlpaug.augmenter.audio as naa from nlpaug.util import AudioLoader class TestSpeed(unittest.TestCase): @classmethod def setUpClass(cls): env_config_path = os.path.abspath(os.path.join( os.path.dirname(__file__), '..', '..', '....
subercui/csc2621-ChatbotAD
nlpaug/test/augmenter/audio/test_speed.py
test_speed.py
py
2,115
python
en
code
0
github-code
18
[ { "api_name": "unittest.TestCase", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.path.join", ...
35845070797
import pandas as pd import numpy as np import time import matplotlib.pyplot as plt import seaborn as sns from tree.base import DecisionTree from metrics import * np.random.seed(42) num_average_time = 100 # Learn DTs # ... # # Function to calculate average time (and std) taken by fit() and predict() for different N...
jayeshbhadange/ES654-Assignment1
experiments.py
experiments.py
py
2,530
python
en
code
0
github-code
18
[ { "api_name": "numpy.random.seed", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pandas.DataFrame", "line_number": 26, "usage_type": "call" }, { "api_name": "pandas.Series", ...
417184306
from iot.DB import DBSingleton db= DBSingleton.get_instance() db.connectDB() from iot.models import DevicesLog from iot.serializers import DevicesLogSerializer from rest_framework.response import Response from rest_framework import status from rest_framework.decorators import APIView import datetime from mongoengine...
HandsOfGoddest/SmartHome-HCMUT-HK212
BackEnd/src/iot/controller/logController.py
logController.py
py
1,945
python
en
code
0
github-code
18
[ { "api_name": "iot.DB.DBSingleton.get_instance", "line_number": 2, "usage_type": "call" }, { "api_name": "iot.DB.DBSingleton", "line_number": 2, "usage_type": "name" }, { "api_name": "rest_framework.decorators.APIView", "line_number": 16, "usage_type": "name" }, { ...
27920365767
import pytest from calvin.runtime.north.plugins.port import queue from calvin.runtime.north.calvin_token import Token from calvin.runtime.north.plugins.port.queue.common import QueueEmpty from calvin.runtime.north.plugins.port.queue.test.test_collect_unordered import TestCollectUnorderedFIFO pytest_unittest = pytest.m...
EricssonResearch/calvin-base
calvin/runtime/north/plugins/port/queue/test/test_collect_tagged.py
test_collect_tagged.py
py
3,395
python
en
code
282
github-code
18
[ { "api_name": "pytest.mark", "line_number": 7, "usage_type": "attribute" }, { "api_name": "calvin.runtime.north.plugins.port.queue.get", "line_number": 16, "usage_type": "call" }, { "api_name": "calvin.runtime.north.plugins.port.queue", "line_number": 16, "usage_type": "n...
8169188641
import argparse import logging import re def update_version(version : str, file : str): openedFile = open(file, "r") fileContent = openedFile.read() regex = r'^(\s*\"version\": )(\"[\d.]*\"),$' newFileContent = '' print(fileContent.splitlines() ) for f in fileContent.splitlines(): match = re.fullmatc...
fga-eps-mds/2021.1-Pro-Especies-UserInterface
increase_version.py
increase_version.py
py
1,140
python
en
code
4
github-code
18
[ { "api_name": "re.fullmatch", "line_number": 13, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 25, "usage_type": "call" }, { "api_name": "argparse.Namespace", "line_number": 24, "usage_type": "attribute" } ]
31861420209
from __future__ import absolute_import from __future__ import division from __future__ import print_function from collections import defaultdict import random import numpy as np from ray.rllib.env.async_vector_env import _DUMMY_AGENT_ID class MultiAgentEpisode(object): """Tracks the current state of a (possibl...
llan-ml/tesp
ray/rllib/evaluation/episode.py
episode.py
py
6,218
python
en
code
30
github-code
18
[ { "api_name": "random.randrange", "line_number": 52, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 53, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 64, "usage_type": "call" }, { "api_name": "ray....
33756221161
from PyQt5.QtWidgets import QMainWindow, QTableWidgetItem from PyQt5.QtGui import QPainter, QPen, QFont, QColor from PyQt5.QtCore import Qt, QPoint from view.forms import ExplainForm class ExplainView(QMainWindow): TABLE_LABLE_TEMPLATE = "<html><head/><body><p><span style=\" font-size:16pt; font-weight:600;\...
KrasotskyMaxim/GIIS
view/explain.py
explain.py
py
1,779
python
en
code
0
github-code
18
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 8, "usage_type": "name" }, { "api_name": "view.forms.ExplainForm", "line_number": 14, "usage_type": "call" }, { "api_name": "PyQt5.QtCore.Qt.AlignCenter", "line_number": 36, "usage_type": "attribute" }, { ...
74011000039
from __future__ import absolute_import, print_function import cPickle, os, os.path, Queue, random, re, sys, traceback, threading, time, warnings from thread import get_ident from itertools import count import logging NOTSET = logging.NOTSET DEBUG = logging.DEBUG INFO = logging.INFO WARNING = logging.WARNING...
buhtigexa/Nerit
lib/python2.7/site-packages/pony/logging2.py
logging2.py
py
10,011
python
en
code
3
github-code
18
[ { "api_name": "logging.NOTSET", "line_number": 8, "usage_type": "attribute" }, { "api_name": "logging.DEBUG", "line_number": 9, "usage_type": "attribute" }, { "api_name": "logging.INFO", "line_number": 10, "usage_type": "attribute" }, { "api_name": "logging.WARNIN...
22575680086
# -*- coding: utf-8 -*- import scrapy from selenium import webdriver from ..items import WangyiproItem class WangyiSpider(scrapy.Spider): name = 'wangyi' # allowed_domains = ['www.xx.com'] start_urls = ['http://war.163.com/'] def __init__(self): self.bro = webdriver.Chrome(executable_path='D:\迅雷...
ym7/Somecodes
爬虫/wangyiPro/wangyiPro/spiders/wangyi.py
wangyi.py
py
1,231
python
en
code
0
github-code
18
[ { "api_name": "scrapy.Spider", "line_number": 5, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 10, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 10, "usage_type": "name" }, { "api_name": "items....
18478823632
import requests import sys # SO, lets create a function to access the API # Also lets create a function to find pairs of players # Finally create a summoning function def accessAPI(): # Gets a request summoning # returns the list of NBA Players response = requests.get('https://mach-eight.uc.r.appspot.com/'...
Kuraokami/mach-nba
nba/nba_finder.py
nba_finder.py
py
1,560
python
en
code
0
github-code
18
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 41, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 45, "usage_type": "attribute" } ]
39857598535
import matplotlib.pyplot as plt import matplotlib import numpy as np matplotlib.rcParams.update({'font.size':14, 'font.family':'sans-serif'}) fig,(ax2,ax) = plt.subplots(2,1,sharex=True) colors = ['C0','C1'] with open('./data/result.data','rb') as fp: for cn,state_size in enumerate([2,4]): Ep = np.load(fp)...
mokchie/chemotaxis
nn-helix-nt/plot.py
plot.py
py
1,978
python
en
code
0
github-code
18
[ { "api_name": "matplotlib.rcParams.update", "line_number": 4, "usage_type": "call" }, { "api_name": "matplotlib.rcParams", "line_number": 4, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 5, "usage_type": "call" }, { "api_n...
18002760715
import argparse def parse(): parser = argparse.ArgumentParser(description="Parse and play card games.") parser.add_argument("game", help="the name of the game") parser.add_argument("--log", nargs="?", const="output.txt", metavar="FILENAME", help="logs the output of the game") parser.add_argument('--deb...
SNHenderson/plm18
proj3/src/utils/arg_parser.py
arg_parser.py
py
467
python
en
code
1
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 4, "usage_type": "call" } ]
25089509296
import csv import cv2 import numpy as np from keras.models import Sequential from keras.layers import Flatten, Dense, Lambda, Cropping2D, BatchNormalization, Activation, Dropout from keras.layers.convolutional import Conv2D from scipy import ndimage # 1) Read lines from driving_log.csv file lines = [] print('Opening...
gyadam/behavioral-cloning
model.py
model.py
py
3,524
python
en
code
0
github-code
18
[ { "api_name": "csv.reader", "line_number": 16, "usage_type": "call" }, { "api_name": "scipy.ndimage.imread", "line_number": 44, "usage_type": "call" }, { "api_name": "scipy.ndimage", "line_number": 44, "usage_type": "name" }, { "api_name": "numpy.array", "line...
42204631535
import argparse import os import random import shutil from math import atan, pi, sqrt import numpy as np import open3d.ml as _ml3d import open3d.ml.torch as ml3d from open3d._ml3d import metrics from open3d._ml3d.datasets.utils import BEVBox3D from open3d.ml import datasets def parse_args(): parser = argparse.Ar...
TerranL/REDSA-CAV
scripts/attacks/dora_attack.py
dora_attack.py
py
13,225
python
en
code
0
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 16, "usage_type": "call" }, { "api_name": "open3d.ml.utils.Config.load_from_file", "line_number": 65, "usage_type": "call" }, { "api_name": "open3d.ml.utils", "line_number": 65, "usage_type": "attribute" }, { ...
37862995739
from django.shortcuts import render, redirect from django.contrib.auth import logout as auth_logout from .forms import * from django.views.generic import * from .models import * from django.contrib.auth.models import AnonymousUser from django.http import HttpResponseRedirect from django.conf import settings from django...
chrishassert/textbook-exchange
main/views.py
views.py
py
11,710
python
en
code
0
github-code
18
[ { "api_name": "django.shortcuts.redirect", "line_number": 17, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 19, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 34, "usage_type": "call" }, { "api_nam...
12475598962
import sys import os from datetime import timedelta import random import pymysql.cursors pdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(os.path.abspath(pdir) ) from settings import SmartAlphaPath, debug, get_portf_suffix sett = SmartAlphaPath() sys.path.append(os.path.abspath( sett.g...
taatuco/sa_data_collection
portfolios/get_portf_alloc.py
get_portf_alloc.py
py
12,116
python
en
code
5
github-code
18
[ { "api_name": "os.path.dirname", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.path.append", "line...
33534492702
from functools import cache from collections import deque import numpy as np @cache def _get_input(input_file): with open(input_file, "r") as f: return np.array([list(map(int, line.strip())) for line in f.readlines() if line.strip() != ""]) def part_1(input_file): tree = _get_input(input_file) ...
jyates13/aoc2022
08/solve.py
solve.py
py
2,011
python
en
code
0
github-code
18
[ { "api_name": "numpy.array", "line_number": 9, "usage_type": "call" }, { "api_name": "functools.cache", "line_number": 6, "usage_type": "name" }, { "api_name": "numpy.zeros_like", "line_number": 15, "usage_type": "call" }, { "api_name": "collections.deque", "l...
72345081641
#https://note.nkmk.me/python-opencv-face-detection-haar-cascade/ import cv2 import numpy as np import sys import os.path def main(): #images = os.listdir("/Users/dennomaaya/Desktop/py/sei/") #ディレクトリのパスをここに書く data_dir_path = u"/Users/dennomaaya/Desktop/py/cascade_directory/seikai" file_list = os.listdir(r'/Users/den...
uni4/research
henkan.py
henkan.py
py
907
python
en
code
0
github-code
18
[ { "api_name": "os.path.listdir", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "name" }, { "api_name": "os.path.path.splitext", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.path", "lin...
18360681523
import requests import pickle from flask import Flask, render_template, request, redirect, url_for from get_letters import get_letters from get_hot_search_terms import hot_search_terms from top_trends_by_keyword import top_N_trends from trend_to_plot import trend_to_plot app = Flask(__name__) @app.route('/', methods=...
ericbarnhill/insight_app
app.py
app.py
py
2,894
python
en
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "get_hot_search_terms.hot_search_terms", "line_number": 16, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 17, "usage_type": "attribute" }, { "api_na...
23172324775
import sys import os from os.path import exists import hashlib import numpy as np from pprint import pprint from datetime import datetime import json import jsons from mysql.connector import connect, Error from Parameter import Parameter, intParameter, boolParameter, floatParameter, strParameter, listParameter, OutputP...
malcolm-dsider/GEOPHIRES-X
AdvGeoPHIRESUtils.py
AdvGeoPHIRESUtils.py
py
22,719
python
en
code
4
github-code
18
[ { "api_name": "cryptography.fernet.Fernet", "line_number": 18, "usage_type": "call" }, { "api_name": "cryptography.fernet.Fernet", "line_number": 21, "usage_type": "call" }, { "api_name": "cryptography.fernet.Fernet.generate_key", "line_number": 24, "usage_type": "call" ...
21260490588
""" Tests for L{vor.beanstalk}. """ import time from twisted.internet import reactor from twisted.trial import unittest from vor.graphite import FakeGraphiteProtocol from vor.beanstalk import BeanstalkGraphiteService class BeanstalkGraphiteServiceTest(unittest.TestCase): def setUp(self): self.collector...
mochi/vor
vor/test/test_beanstalk.py
test_beanstalk.py
py
3,577
python
en
code
47
github-code
18
[ { "api_name": "twisted.trial.unittest.TestCase", "line_number": 13, "usage_type": "attribute" }, { "api_name": "twisted.trial.unittest", "line_number": 13, "usage_type": "name" }, { "api_name": "vor.beanstalk.BeanstalkGraphiteService", "line_number": 16, "usage_type": "ca...
9863095096
#!/usr/bin/env python # -*- coding: utf-8 -*- # Date :2020/11/16 23:53 # Author:Lydia from time import sleep from appium import webdriver from appium.webdriver.common.mobileby import MobileBy from selenium.webdriver.support.wait import WebDriverWait class TestWX: def setup(self): # 定义字典 caps = { ...
lydia008/hogwats15
app/test_contact.py
test_contact.py
py
3,126
python
en
code
0
github-code
18
[ { "api_name": "appium.webdriver.Remote", "line_number": 30, "usage_type": "call" }, { "api_name": "appium.webdriver", "line_number": 30, "usage_type": "name" }, { "api_name": "appium.webdriver.common.mobileby.MobileBy.XPATH", "line_number": 41, "usage_type": "attribute" ...
11724325001
# Import TfidfVectorizer from sklearn.feature_extraction.text import TfidfVectorizer # Create a TfidfVectorizer: tfidf tfidf = TfidfVectorizer() # Apply fit_transform to document: csr_mat csr_mat = tfidf.fit_transform(documents) # Print result of toarray() method print(csr_mat.toarray()) # Get the words: words word...
Suchana34/Basics-of-Machine-Learning
unsupervised/clustering_wiki_articles.py
clustering_wiki_articles.py
py
1,481
python
en
code
1
github-code
18
[ { "api_name": "sklearn.feature_extraction.text.TfidfVectorizer", "line_number": 5, "usage_type": "call" }, { "api_name": "sklearn.decomposition.TruncatedSVD", "line_number": 31, "usage_type": "call" }, { "api_name": "sklearn.cluster.KMeans", "line_number": 34, "usage_type...
43561696178
import prep import torchvision import torch import time traindir = "/data/pytorch-imagenet-data/train/" normalize = transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]) transform = transforms.Compose([ transforms.RandomResizedCrop(224), transforms.Random...
gpzlx1/dataloading
src/pytorch-loading/pytorch-src.py
pytorch-src.py
py
1,363
python
en
code
0
github-code
18
[ { "api_name": "torchvision.datasets.ImageFolder", "line_number": 24, "usage_type": "call" }, { "api_name": "torchvision.datasets", "line_number": 24, "usage_type": "attribute" }, { "api_name": "prep.transform", "line_number": 24, "usage_type": "attribute" }, { "ap...
1316962405
import pickle from io import BytesIO import requests import yfinance as yf from PIL import Image from os import listdir from os.path import isfile, join curentList = [] import json, os import pandas as pd def makeDir(): curDir = os.getcwd() try: os.mkdir('sectorData') os.mkdir('data') ...
brendan12372/djangoProject6
pyFundamental/utils.py
utils.py
py
17,958
python
en
code
0
github-code
18
[ { "api_name": "os.getcwd", "line_number": 17, "usage_type": "call" }, { "api_name": "os.mkdir", "line_number": 19, "usage_type": "call" }, { "api_name": "os.mkdir", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 25, ...
69808893799
from config import config from main_profile import * import psycopg2 def app(): try: params = config() connection = psycopg2.connect(**params) cursor = connection.cursor() postgreSQL_select_Query = "select * from names;" cursor.execute(postgreSQL_select_Query) pri...
TheWarDaddy/findmylawyer
dlpiper/lib/app.py
app.py
py
1,296
python
en
code
2
github-code
18
[ { "api_name": "config.config", "line_number": 9, "usage_type": "call" }, { "api_name": "psycopg2.connect", "line_number": 10, "usage_type": "call" }, { "api_name": "psycopg2.Error", "line_number": 24, "usage_type": "attribute" } ]
34358253994
import pathlib import setuptools README = (pathlib.Path(__file__).parent / 'README.md').read_text() install_requires = [ 'pynvml==11.5.0', ] setuptools.setup( name='gpu_affinity', version='0.1.0', author='NVIDIA Corporation', description='GPU Affinity', long_description=README, long_desc...
NVIDIA/gpu_affinity
setup.py
setup.py
py
932
python
en
code
2
github-code
18
[ { "api_name": "pathlib.Path", "line_number": 5, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_number": 11, "usage_type": "call" } ]
35789976836
from utils.args import args from utils.formats import get_custom_format from ast import literal_eval import numpy as np def convert_to_float(v, format): if not 'nan' in v: v = '0x' + v CustomData = get_custom_format(format + '32') data = CustomData(0.0) d_t = data.from_bits(lit...
robalexlimas/posit_fp
utils/utils.py
utils.py
py
1,650
python
en
code
0
github-code
18
[ { "api_name": "utils.formats.get_custom_format", "line_number": 14, "usage_type": "call" }, { "api_name": "ast.literal_eval", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.nan", "line_number": 19, "usage_type": "attribute" }, { "api_name": "ast.l...
30761118842
# 用CCSCC那种记号来照合正解文 import re, os, csv import pipei as pi from pykakasi import kakasi # 打标签的思路是:因为CCSS的符号是跟正解文对应的,跟识别结果不对应,这个是最大的难点,所以要做的是先去找标志文件里面的C, # 也就是正确认识的部分,然后返回这些C的索引,然后根据索引去正解文中找被正确识别的单词,找到之后把单词顺序插入到一个list中去, # 在用识别结果里的单词去对应这个list,按顺序一个单词一个单词地对,每成功对应上一个单词就从list中把这个单词删除掉,并获取这个单词 # 的帧数表,然后打上标签0,没有对应上的单词就...
shuyuqing/-
changyong/pipei_3.py
pipei_3.py
py
9,608
python
zh
code
1
github-code
18
[ { "api_name": "csv.reader", "line_number": 54, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 60, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 60, "usage_type": "call" }, { "api_name": "os.path", "line_number": 60, ...
38951910507
import requests from pathlib import Path TOKEN_STORE = Path("./data/cispr_session") class CisprSessionExpiredError(Exception): pass def get_global_token() -> str: error = FileNotFoundError( "No token file found" f"Please make sure you've placed your token in {TOKEN_STORE.as_posix()}" )...
Ben-Brady/BUAttendance
modules/cispr/session.py
session.py
py
1,255
python
en
code
0
github-code
18
[ { "api_name": "pathlib.Path", "line_number": 5, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 32, "usage_type": "call" } ]
10760175294
from __future__ import annotations from typing import Callable from ndspy.rom import NintendoDSRom from range_typed_integers import u32_checked, u16_checked from skytemple_files.common.i18n_util import _ from skytemple_files.common.ppmdu_config.data import ( GAME_REGION_EU, GAME_REGION_US, GAME_REGION_JP...
SkyTemple/skytemple-files
skytemple_files/patch/handler/extract_move_code.py
extract_move_code.py
py
6,799
python
en
code
16
github-code
18
[ { "api_name": "skytemple_files.patch.handler.abstract.AbstractPatchHandler", "line_number": 57, "usage_type": "name" }, { "api_name": "skytemple_files.common.i18n_util._", "line_number": 64, "usage_type": "call" }, { "api_name": "skytemple_files.patch.category.PatchCategory.UTILI...
6851594531
#very quick write. from __future__ import division from Bio import SeqIO Ns = open('contentNs.txt', 'w') for sequence in SeqIO.parse('/home/muliano/VGP-running/pri.asm.20180817.fasta-buscos0', 'fasta'): id = sequence.id count1 = len(sequence) countNs = sequence.seq.upper().count('N') ou...
marcelauliano/phython_scripts
countNs.py
countNs.py
py
397
python
en
code
5
github-code
18
[ { "api_name": "Bio.SeqIO.parse", "line_number": 6, "usage_type": "call" }, { "api_name": "Bio.SeqIO", "line_number": 6, "usage_type": "name" } ]
27420512657
import torch.nn as nn import torch.nn.functional as F class FCNet(nn.Module): def __init__(self): super(FCNet, self).__init__() self.fc1 = nn.Linear(784, 500) self.fc2 = nn.Linear(500, 120) self.fc3 = nn.Linear(120, 10) def forward(self, x): out = self.fc1(x) o...
uidmice/wssa-fall19-lab1
models/fullyconnected.py
fullyconnected.py
py
438
python
en
code
1
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 5, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.nn", "line_numbe...
70122839721
import logging import os import azure.functions as func from azure.identity import DefaultAzureCredential import openai import json from opentelemetry.sdk.trace import TracerProvider from azure.monitor.events.extension import track_event from azure.monitor.opentelemetry import configure_azure_monitor from op...
implodingduck/azure-openai-function
func/HttpTrigger/__init__.py
__init__.py
py
3,588
python
en
code
0
github-code
18
[ { "api_name": "azure.monitor.opentelemetry.configure_azure_monitor", "line_number": 15, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 16, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 16, "usage_type": "attribute" }, { ...