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
32394806954
from keras.models import Sequential from keras.layers.core import Flatten, Dense, Dropout from keras.layers.convolutional import MaxPooling2D, ZeroPadding2D from keras.layers.convolutional import Conv2D as Convolution2D import numpy as np def pop(model): '''Ref: https://github.com/fchollet/keras/issues/2371#iss...
saumak/Visual-Question-Answering
vgg.py
vgg.py
py
3,406
python
en
code
0
github-code
18
[ { "api_name": "h5py.File", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.swapaxes", "line_number": 43, "usage_type": "call" }, { "api_name": "numpy.swapaxes", "line_number": 44, "usage_type": "call" }, { "api_name": "numpy.swapaxes", "line_nu...
40961899949
############################################################################# # The Graph class named OnlineRailwayFreightBooking prepares the adjacency matrix # for the different unique cities and trains running between them.Once the matrix is # ready all the search operation is done on the matrix. ###################...
koolkhan2006/BITSPilani
S1-20_DSECFZG519/online_railway_freight_booking.py
online_railway_freight_booking.py
py
13,609
python
en
code
1
github-code
18
[ { "api_name": "itertools.combinations", "line_number": 120, "usage_type": "call" } ]
34729205095
from typing import Any, Union from eth_typing import Address, HexStr from web3 import Web3 from web3.types import Wei from src.libs.Web3Client.Web3Client import Web3Client from web3.types import TxParams, Nonce import os class Erc20Web3Client(Web3Client): """ Client that comes with the ERC20 ABI preloaded. ...
coccoinomane/crabada.py
src/libs/Web3Client/Erc20Web3Client.py
Erc20Web3Client.py
py
2,966
python
en
code
61
github-code
18
[ { "api_name": "src.libs.Web3Client.Web3Client.Web3Client", "line_number": 10, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path", "line_number": 26, "usage_type": "attribute" }, { "api_name":...
71426860200
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) import matplotlib.pyplot as plt import matplotlib.patches as patches from ipywidgets import interact, IntSlider, fixed from pathlib import Path from PIL import Image base_path = Path('../input/global-wheat-detection/') TRAIN_CSV_PATH = base_...
aorursy/new-nb-3
goldsnitch_interactive-image-masks-eda-utility.py
goldsnitch_interactive-image-masks-eda-utility.py
py
2,071
python
en
code
0
github-code
18
[ { "api_name": "pathlib.Path", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 29, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 29, "usage_type": "name" }, { "api_name": "matplotlib.py...
3838700286
import csv import pylab as pl from sklearn.cluster import KMeans from sklearn.decomposition import PCA import matplotlib.pyplot as plt from my_functions import cluster2, find_k, cluster_k, pca # gets all sessionIDs in semantic_features file and their index to check later if the session exists in simple_features file w...
sotiria3103/clustering_labeled
clustering_labeled.py
clustering_labeled.py
py
6,012
python
en
code
0
github-code
18
[ { "api_name": "csv.reader", "line_number": 10, "usage_type": "call" }, { "api_name": "csv.DictReader", "line_number": 16, "usage_type": "call" }, { "api_name": "csv.DictReader", "line_number": 17, "usage_type": "call" }, { "api_name": "my_functions.cluster2", ...
41115472052
import shutil import asyncio from pathlib import Path from random import choice, randint from nonebot.adapters.onebot.v11 import ( Bot, MessageEvent, GroupIncreaseNoticeEvent, GroupDecreaseNoticeEvent, GroupAdminNoticeEvent, GroupBanNoticeEvent, GroupRecallNoticeEvent, FriendRecallNotic...
Kyomotoi/ATRI
ATRI/plugins/essential/__init__.py
__init__.py
py
5,313
python
en
code
675
github-code
18
[ { "api_name": "pathlib.Path", "line_number": 28, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 29, "usage_type": "call" }, { "api_name": "ATRI.service.Service", "line_number": 36, "usage_type": "call" }, { "api_name": "nonebot.adapters.onebo...
41671481606
from werkzeug import url_decode class HTTPMethodOverrideMiddleware(object): """The HTTPMethodOverrideMiddleware middleware implements the hidden HTTP method technique. Not all web browsers support every HTTP method, such as DELETE and PUT. This middleware class allows clients to provide a method overr...
pwgn/flaskAppArchitecture
app/middleware.py
middleware.py
py
2,257
python
en
code
0
github-code
18
[ { "api_name": "werkzeug.url_decode", "line_number": 32, "usage_type": "call" } ]
2572869774
""" RandomForest.py Written by Dan Adler Email: (daadler0309@gmail.com) GitHub: https://github.com/dadler6/ Self-implementation of a random forest. Package requirements: numpy pandas DecisionTree.py (self implementation) """ # Imports import numpy as np import DecisionTree as DT from collections import Counter class...
arsipku/My-Skripsi
RandomForest.py
RandomForest.py
py
7,194
python
en
code
2
github-code
18
[ { "api_name": "DecisionTree.ClassificationDecisionTree.handle_data", "line_number": 90, "usage_type": "call" }, { "api_name": "DecisionTree.ClassificationDecisionTree", "line_number": 90, "usage_type": "attribute" }, { "api_name": "numpy.random.choice", "line_number": 124, ...
29169970222
from os import listdir import json import operator import numpy as np import pylab import requests from elasticsearch import Elasticsearch, TransportError from genericpath import isfile from os.path import join from regex import regex import matplotlib.pyplot as plt an = { "settings": { "index": { ...
Agnes5/nlp
lab3/task.py
task.py
py
5,072
python
en
code
0
github-code
18
[ { "api_name": "elasticsearch.Elasticsearch", "line_number": 54, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 62, "usage_type": "call" }, { "api_name": "genericpath.isfile", "line_number": 62, "usage_type": "call" }, { "api_name": "os.path.joi...
71427008040
from sklearn.metrics import accuracy_score import numpy as np import pandas as pd from sklearn.ensemble import RandomForestClassifier import time import nltk from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.model_selection import train_test_split from sklearn.model_selection import cross...
aorursy/new-nb-3
halftru_kernel5cd708ea59.py
halftru_kernel5cd708ea59.py
py
8,305
python
en
code
0
github-code
18
[ { "api_name": "nltk.stem.PorterStemmer", "line_number": 67, "usage_type": "call" }, { "api_name": "nltk.stem.WordNetLemmatizer", "line_number": 77, "usage_type": "name" }, { "api_name": "nltk.tokenize.word_tokenize", "line_number": 83, "usage_type": "call" }, { "a...
26422178428
import numpy as np import cv2 def show_video(file_name, start_frame, end_frame, frametime, window_name): frame_count = 1 break_flag = False font = cv2.FONT_HERSHEY_SIMPLEX cap = cv2.VideoCapture(file_name) while(True): ret, frame = cap.read() if (not ret) or (frame_count > end_fram...
Norman960122/testin
video/show_video_part.py
show_video_part.py
py
1,258
python
en
code
0
github-code
18
[ { "api_name": "cv2.FONT_HERSHEY_SIMPLEX", "line_number": 6, "usage_type": "attribute" }, { "api_name": "cv2.VideoCapture", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.putText"...
71898030120
import os import glob import pandas as pd import numpy as np import random from sklearn.utils.validation import check_is_fitted from sklearn.utils import check_array, as_float_array from sklearn.base import TransformerMixin, BaseEstimator import kneed import scipy import seaborn as sns import matplotlib.pyplot as plt f...
jump-cellpainting/2023_Chandrasekaran_submitted
benchmark/old_notebooks_v1/utils.py
utils.py
py
31,435
python
en
code
24
github-code
18
[ { "api_name": "os.path.join", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "glob.glob", "line_number": 22, "usage_type": "call" }, { "api_name": "pandas.concat", "line_number"...
34439225781
""" A Python scripts for active learning Using active learning approach to select data for K-iteration fine-tuning Author: xinyi Date: 20210824 """ import sys sys.path.insert(0, './') import os import cv2 import numpy as np import glob import shutil from tensorflow.keras.models import load_model from tensorflow.keras.u...
xinyiz0931/aspnet
tool/active_learner.py
active_learner.py
py
6,845
python
en
code
0
github-code
18
[ { "api_name": "sys.path.insert", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.isdir", "line_number": 37, "usage_type": "call" }, { "api_name": "os.path", "line_number"...
2562905922
# coding: utf-8 import torch from torch import nn from .pretrained import alexnet, alexnet_pre from .BasicModule import BasicModule class PCAlexNet(BasicModule): def __init__(self, num_classes): super(PCAlexNet, self).__init__() self.conv1 = alexnet.features[0:3] self.conv2 = alexnet.fe...
BolinLai/Vertebrae_Collapse
models/PCAlexNet.py
PCAlexNet.py
py
1,501
python
en
code
0
github-code
18
[ { "api_name": "BasicModule.BasicModule", "line_number": 10, "usage_type": "name" }, { "api_name": "pretrained.alexnet.features", "line_number": 14, "usage_type": "attribute" }, { "api_name": "pretrained.alexnet", "line_number": 14, "usage_type": "name" }, { "api_n...
10339972992
#!/usr/bin/python3 import sys import re import operator import collections from pathlib import Path class WordFrequenciesModel: freqs = {} ignore_words = set( open(Path.joinpath(Path.cwd(), "res/ignore-words.txt")).read().split(",") ) def __init__(self, path): self.update(path) ...
HoYaStudy/Python_Study
ProgrammingStyle/32-trinity/prog32.py
prog32.py
py
1,448
python
en
code
2
github-code
18
[ { "api_name": "pathlib.Path.joinpath", "line_number": 13, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 13, "usage_type": "name" }, { "api_name": "pathlib.Path.cwd", "line_number": 13, "usage_type": "call" }, { "api_name": "re.findall", ...
23707957501
import argparse import getpass import os import sys import subprocess from livestreamer import * from livestreamer.compat import input, stdout, file, is_win32 from livestreamer.stream import StreamProcess, StreamType from livestreamer.utils import ArgumentParser, NamedPipe exampleusage = """ example usage: $ livestr...
derekzhang79/livestreamer
src/livestreamer/cli.py
cli.py
py
11,346
python
en
code
1
github-code
18
[ { "api_name": "livestreamer.logger.new_module", "line_number": 24, "usage_type": "call" }, { "api_name": "livestreamer.logger", "line_number": 24, "usage_type": "attribute" }, { "api_name": "sys.stdout", "line_number": 26, "usage_type": "attribute" }, { "api_name"...
8254386494
import numpy as np import scipy.io import matplotlib.pyplot as plt from scipy import linalg import random import math from sklearn.cluster import KMeans import ipyvolume as ipv # 1. Загрузите данные ex7data1.mat из файла. data1 = scipy.io.loadmat('ex7data1.mat') X1 = data1['X'] print(X1.shape) # 2. ...
zhyshkevich/ml
zhyshkevich_858341_ml_labs/lab 7/lab 7.py
lab 7.py
py
7,421
python
ru
code
0
github-code
18
[ { "api_name": "scipy.io.io.loadmat", "line_number": 13, "usage_type": "call" }, { "api_name": "scipy.io.io", "line_number": 13, "usage_type": "attribute" }, { "api_name": "scipy.io", "line_number": 13, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.figur...
37356466050
import json import logging from urllib.parse import urlparse import jmespath def load_har(har_path): """ :param har_path: :return: """ with open(har_path, 'r', encoding='utf-8') as har: return json.load(har) def save_postman_collection(file_path, postman_json): with open(file_path,...
whitexie/Har2Postman
har2postman/common.py
common.py
py
3,499
python
en
code
0
github-code
18
[ { "api_name": "json.load", "line_number": 15, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 20, "usage_type": "call" }, { "api_name": "urllib.parse.urlparse", "line_number": 88, "usage_type": "call" }, { "api_name": "jmespath.search", "lin...
14951469581
# A part of NonVisual Desktop Access (NVDA) # Copyright (C) 2020-2022 NV Access Limited # This file may be used under the terms of the GNU General Public License, version 2 or later. # For more details see: https://www.gnu.org/licenses/gpl-2.0.html """This module is not a Robot Framework library itself. Instead i...
nvaccess/nvda
tests/system/libraries/SystemTestSpy/blockUntilConditionMet.py
blockUntilConditionMet.py
py
3,270
python
en
code
1,802
github-code
18
[ { "api_name": "typing.Any", "line_number": 23, "usage_type": "name" }, { "api_name": "typing.Callable", "line_number": 36, "usage_type": "name" }, { "api_name": "typing.Callable", "line_number": 38, "usage_type": "name" }, { "api_name": "typing.Optional", "lin...
73270820519
""" Tests for TabularDatasets. To run tests: python -m unittest tableshift/tests/test_tabular_dataset.py -v """ import logging import tempfile import unittest from tableshift.core import TabularDataset, RandomSplitter, \ DatasetConfig, PreprocessorConfig, CachedDataset LOG_LEVEL = logging.DEBUG logger = logging...
mlfoundations/tableshift
tableshift/tests/test_tabular_dataset.py
test_tabular_dataset.py
py
4,307
python
en
code
7
github-code
18
[ { "api_name": "logging.DEBUG", "line_number": 13, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 16, "usage_type": "call" }, { "api_name": "unittest.Tes...
72262440359
import os, sys, time import numpy as np import matplotlib.pyplot as plt plt.axis('off') from PIL import Image, ImageOps import cv2 from tensorflow.keras.preprocessing import image def load_img(path, resize=None): img = Image.open(path) img = img.convert("RGB") if resize is not None: size_h = size_w =...
giaanthunder/sign_detection
sliding_window.py
sliding_window.py
py
5,085
python
en
code
0
github-code
18
[ { "api_name": "matplotlib.pyplot.axis", "line_number": 4, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 4, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number": 12, "usage_type": "call" }, { "api_name": "PIL.Image", ...
74339273639
# -*- coding: utf-8 -*- import json import redis from tornado.testing import AsyncHTTPTestCase from insight_reloaded.api import application from insight_reloaded import __version__ as VERSION from insight_reloaded.insight_settings import ( REDIS_HOST, REDIS_PORT, REDIS_DB, DEFAULT_REDIS_QUEUE_KEY ) from tornad...
peopledoc/insight-reloaded
insight_reloaded/tests/test_api.py
test_api.py
py
2,660
python
en
code
1
github-code
18
[ { "api_name": "tornado.testing.AsyncHTTPTestCase", "line_number": 18, "usage_type": "name" }, { "api_name": "tornado.ioloop.IOLoop.instance", "line_number": 21, "usage_type": "call" }, { "api_name": "tornado.ioloop.IOLoop", "line_number": 21, "usage_type": "attribute" }...
28329302183
import psycopg2 from psycopg2 import Error try: connection = psycopg2.connect(user="postgres", password="UTEC", database="postgres", host="localhost", port="5432") cursor = connection.cursor() # Executing a SQL query to insert data into table cursor.execute("SELECT * from class") record = cursor...
jcpazos/microblog
psycotestcrud.py
psycotestcrud.py
py
1,615
python
en
code
0
github-code
18
[ { "api_name": "psycopg2.connect", "line_number": 5, "usage_type": "call" }, { "api_name": "psycopg2.Error", "line_number": 44, "usage_type": "attribute" } ]
27274028711
import time import logging import asyncio from django.shortcuts import render, HttpResponse, redirect from eventkit import Event # from .decoder import Decoder from ib_insync.decoder import Decoder from ib_insync import * import pandas as pd def stock_data(request): context = {} return render(request, 'ib_ap...
ashaffir/stocks_management
ib_api/archive/views_ib_insync_not_work.py
views_ib_insync_not_work.py
py
3,022
python
en
code
0
github-code
18
[ { "api_name": "django.shortcuts.render", "line_number": 15, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 31, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 40, "usage_type": "call" }, { "api_name": "ib_...
40201523029
import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import os from six.moves import urllib download_dir = "./data/" download_url = "https://raw.githubusercontent.com/aravind9722/datasets-for-ML-projects/main/cardekho_dataset.csv" os.makedirs(download_dir,exist_ok=True) filename = os.path.basen...
Fortunatetech/India-Used-Car-Price-Prediction-with-Deployment
Explore_Dataset_Page.py
Explore_Dataset_Page.py
py
1,275
python
en
code
1
github-code
18
[ { "api_name": "os.makedirs", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.basename", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_nu...
3855276064
from xml.dom import minidom import libvirt from libvirt import libvirtError from libvirttestapi.src import sharedmod from libvirttestapi.utils import utils required_params = ('guestname', 'nodeset', 'mode') optional_params = {} def check_numa_params(domobj, mode, node_tuple): """dump domain config xml descript...
libvirt/libvirt-test-API
libvirttestapi/repos/numa/numa_param_config.py
numa_param_config.py
py
3,887
python
en
code
12
github-code
18
[ { "api_name": "xml.dom", "line_number": 18, "usage_type": "name" }, { "api_name": "xml.dom.minidom.parseString", "line_number": 18, "usage_type": "call" }, { "api_name": "xml.dom.minidom", "line_number": 18, "usage_type": "name" }, { "api_name": "xml.dom.getElemen...
41087033374
# coding: utf-8 from datetime import datetime, timedelta startTime = datetime.now() current_datetime = str(datetime.now())[:16] current_date = str(datetime.now())[:10] import warnings warnings.filterwarnings('ignore') # If you run on new machine, change to "YES": NEW_MACHINE = 'NO' if NEW_MACHINE == 'YES': print(...
PVLKim/Machine-learning-projects
Predicting-tickets-price-change/1-Cleaning.py
1-Cleaning.py
py
14,137
python
en
code
0
github-code
18
[ { "api_name": "datetime.datetime.now", "line_number": 3, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 3, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 4, "usage_type": "call" }, { "api_name": "datetime.d...
71841868201
from collections import defaultdict N = int(input()) papers = list() res = defaultdict(int) for _ in range(N): papers.append(list(map(int, input().split()))) def solve(start_x, start_y, length): global papers pivot = papers[start_y][start_x] divide = False for y in range(start_y, start_y + length...
AlgoLive/AlgoLive_2023
2023 Spring/Week 5 DivideConquer/1780_종이의 개수/1780_최동욱.py
1780_최동욱.py
py
872
python
en
code
6
github-code
18
[ { "api_name": "collections.defaultdict", "line_number": 5, "usage_type": "call" } ]
30621879064
import scrapy from scrapy.http import Request import bs4 import re from sucie.items import SucieItem class chickenSpider(scrapy.Spider): name = "sucie" allowed_domains = ["www.qinbing.cn"] start_urls = [ "http://www.qinbing.cn/list/jiage/19/1", ] base_url = "http://www.qinbing.cn/list/jia...
Maxence1/scrapy-based-spider-
sucie/sucie/spiders/chickenSpider.py
chickenSpider.py
py
2,453
python
en
code
0
github-code
18
[ { "api_name": "scrapy.Spider", "line_number": 8, "usage_type": "attribute" }, { "api_name": "scrapy.http.Request", "line_number": 22, "usage_type": "call" }, { "api_name": "scrapy.http.Request", "line_number": 34, "usage_type": "call" }, { "api_name": "re.findall"...
39177187173
from keras.layers import Dense, Flatten, Conv2D, Permute, Conv2DTranspose, Input, concatenate, Reshape, Cropping1D from keras.models import Sequential, Model from keras.models import model_from_json from keras.optimizers import Adam from rl.agents.dqn import DQNAgent from rl.memory import SequentialMemory from rl.polic...
anth2o/inf581_flappy_bird
define_model.py
define_model.py
py
3,336
python
en
code
0
github-code
18
[ { "api_name": "keras.models.model_from_json", "line_number": 17, "usage_type": "call" }, { "api_name": "keras.models.Sequential", "line_number": 24, "usage_type": "call" }, { "api_name": "keras.layers.Permute", "line_number": 25, "usage_type": "call" }, { "api_nam...
32989434046
import datetime import logging import time import torch import torch.distributed as dist from maskrcnn_benchmark.utils.comm import get_world_size from maskrcnn_benchmark.utils.metric_logger import MetricLogger def reduce_loss_dict(loss_dict): """ Reduce the loss dictionary from all processes so that process...
lhoyer/MIC
det/maskrcnn_benchmark/engine/trainer.py
trainer.py
py
12,740
python
en
code
200
github-code
18
[ { "api_name": "maskrcnn_benchmark.utils.comm.get_world_size", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.no_grad", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.stack", "line_number": 27, "usage_type": "call" }, { "api_name":...
4041808665
# -*- coding: utf-8 -*- """ Created on Thu Dec 6 17:38:25 2018 # 数据观测与数据预处理 @author: 40393 """ import pandas as pd import numpy as np import datetime as datetime import datetime import sys import xgboost as xgb import re import matplotlib.pyplot as plt import seaborn as sns import lightgbm as lgb fro...
songhu1992/python-code
moedel2.py
moedel2.py
py
10,114
python
en
code
2
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.nan", "line_number": 28, "usage_type": "attribute" }, { "api_name": "pandas.lib", "line_number": 29, "usage_type": "attribute" }, { "api_name": "datetime.datetime.strp...
6907277536
from django.forms import ModelForm from .models import Reservation class ReservationForm(ModelForm): def __init__(self, *args, **kwargs): self.user = kwargs.pop('user') self.film = kwargs.pop('film') print(kwargs) super(ReservationForm, self).__init__(*args, **kwargs) def...
Dayana-Marinova/Cinema-Reservation-System
cinema_system/film/forms.py
forms.py
py
628
python
en
code
0
github-code
18
[ { "api_name": "django.forms.ModelForm", "line_number": 5, "usage_type": "name" }, { "api_name": "models.Reservation", "line_number": 21, "usage_type": "name" } ]
12264966506
from collections import OrderedDict from functools import lru_cache from numpy import int32, float64 from pandas import Series class PoloniexTicker: ref = OrderedDict([ ('id', int32), ('last', float64), ('lowestAsk', float64), ('highestBid', float64), ('percentChange', flo...
Pedrexus/overlooker
apps/agent/modules/exchange/Poloniex/PoloniexTicker.py
PoloniexTicker.py
py
987
python
en
code
0
github-code
18
[ { "api_name": "collections.OrderedDict", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.int32", "line_number": 10, "usage_type": "name" }, { "api_name": "numpy.float64", "line_number": 11, "usage_type": "name" }, { "api_name": "numpy.float64", ...
40004475228
import glob, os, re, datetime, json, zipfile import dateutil.parser, time command_dispatched_pattern = re.compile(r"\s*Key: type\s*Value: CommandDispatched") timestamp_pattern = re.compile(r"\s*Key: timestamp\s*Value: (.*Z)") event_payload_pattern = re.compile(r"(\{.*\})", re.S) csv_content = "timestamp,command_type\n...
twobiers/software-architecture-sustainability-experiment
case-study-dungeon/scripts/extract_commands.py
extract_commands.py
py
1,150
python
en
code
0
github-code
18
[ { "api_name": "re.compile", "line_number": 4, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 5, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 6, "usage_type": "call" }, { "api_name": "re.S", "line_number": 6, "usage...
4646814041
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Oct 3 16:55:19 2022 @author: Jack """ ## https://towardsdatascience.com/beginners-guide-to-custom-environments-in-openai-s-gym-989371673952 ## There will specific file structuring if I want to "register" my gym env. # import gym # class BasicEnv(gym....
CoAxLab/imaginagents
basic_env_agent_test.py
basic_env_agent_test.py
py
5,241
python
en
code
0
github-code
18
[ { "api_name": "numpy.random.normal", "line_number": 70, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 70, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "line_number": 72, "usage_type": "call" }, { "api_name": "numpy.array", "...
9297864222
#!/usr/bin/env python import os import matplotlib.pyplot as plt import numpy as np from skimage.feature import peak_local_max from lib.model import Point, ClickResult from lib.utils import get_image, main_process, Phase, Campaign, Arg SIGMA=25 WIDTH=400 HEIGHT=400 DEFAULT_THRESHOLD=2.0 X=None Y=None def process_...
gabrielkasmi/bdappv
click_analysis.py
click_analysis.py
py
4,111
python
en
code
7
github-code
18
[ { "api_name": "lib.utils.Campaign.GOOGLE", "line_number": 22, "usage_type": "attribute" }, { "api_name": "lib.utils.Campaign", "line_number": 22, "usage_type": "name" }, { "api_name": "numpy.meshgrid", "line_number": 40, "usage_type": "call" }, { "api_name": "nump...
30964915836
from creators.models import Location from django.core.management.base import BaseCommand class Command(BaseCommand): help = 'Populate Location table with countries' def handle(self, *args, **kwargs): if Location.objects.all().count() < 1: with open("./zubhub/creators/management/commands...
unstructuredstudio/zubhub
zubhub_backend/zubhub/creators/management/commands/populate_countries.py
populate_countries.py
py
781
python
en
code
46
github-code
18
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 7, "usage_type": "name" }, { "api_name": "creators.models.Location.objects.all", "line_number": 11, "usage_type": "call" }, { "api_name": "creators.models.Location.objects", "line_number": 11, "usage_...
9464552766
import json import socket import random from transport import Protocol from diffie_hellman import DiffieHellman class Server: def __init__(self, PORT): self.client_port, self.server_port = PORT self.serv_secret = random.randint(500, 1500) self.target_server_port = '' sock = soc...
maximums/PR_lab_2
server_abstr.py
server_abstr.py
py
3,171
python
en
code
1
github-code
18
[ { "api_name": "random.randint", "line_number": 11, "usage_type": "call" }, { "api_name": "socket.socket", "line_number": 13, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 13, "usage_type": "attribute" }, { "api_name": "socket.SOCK_DGRAM", ...
2333666811
# -*- coding: utf-8 -*- """ Created on Mon Apr 20 16:08:15 2020 @author: lv13916 """ import pandas as pd import numpy as np import sys import csv import os from fuzzywuzzy import fuzz from io import StringIO import matplotlib.pyplot as plt path = r"C:\Users\lv13916\University of Bristol\AMR Database - Documents\Luc...
lvass/phd_thesis
chapter 2/monge_elkan_match.py
monge_elkan_match.py
py
4,530
python
en
code
0
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 21, "usage_type": "call" }, { "api_name": "os.sep", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.sep", "line_number": 25, "usage_type": "attribute" }, { "api_name": "csv.reader", "line_number...
24879143150
import genanki from tinydb import TinyDB, Query import sys, getopt listdb = TinyDB('./db/words.json') dictdb = TinyDB('./db/dict.json') CSS = """.card { font-family: arial; font-size: 20px; text-align: center; color: black; background-color: white; } """ # Card model WordCard = genanki.Model( 12760084...
wivl/wordanki
main.py
main.py
py
4,583
python
en
code
0
github-code
18
[ { "api_name": "tinydb.TinyDB", "line_number": 6, "usage_type": "call" }, { "api_name": "tinydb.TinyDB", "line_number": 8, "usage_type": "call" }, { "api_name": "genanki.Model", "line_number": 20, "usage_type": "call" }, { "api_name": "genanki.Deck", "line_numb...
28868176507
# -*- coding: utf-8 -*- """ Created on Thu May 28 22:53:52 2020 @author: Andrew """ import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt import datetime plt.style.use('ggplot') # df = pd.read_csv(r"C:\Users\Andrew\Documents\Python Scripts\data set\nyc open da...
andrewhong5297/NYC_Open_Data
NYC 311 Data Analysis.py
NYC 311 Data Analysis.py
py
5,605
python
en
code
0
github-code
18
[ { "api_name": "matplotlib.pyplot.style.use", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 15, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 15, "usage_type": "name" }, { "api_na...
42276344319
import sys import matplotlib.pyplot as plt import numpy as np def thermal_eq_stats(filename,plot=False): with open(filename) as f: lines = f.readlines() thermal_eq_flag = False dump_interval = 1.1 for i in range(len(lines)): spl = lines[i].split() if spl == ['#', '----------',...
srgoldy32/md_tools
thermal_eq_stats.py
thermal_eq_stats.py
py
1,740
python
en
code
0
github-code
18
[ { "api_name": "numpy.average", "line_number": 46, "usage_type": "call" }, { "api_name": "numpy.std", "line_number": 47, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 52, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", ...
74827617321
import unittest import import_ipynb import pandas as pd import pandas.testing as pd_testing import numpy.testing as np_testing import os from sklearn.model_selection import train_test_split from sklearn.linear_model import LogisticRegression from sklearn import metrics class Test(unittest.TestCase): def _dir...
PacktWorkshops/The-Deep-Learning-with-Keras-Workshop
Chapter01/Exercise1.04/Exercise1.04_Unit_test.py
Exercise1.04_Unit_test.py
py
2,183
python
en
code
44
github-code
18
[ { "api_name": "unittest.TestCase", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.isdir", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.dirname", ...
20897585378
import pygame from pygame.locals import * from pygame.color import * import pymunk import pygame_util import pymunk.util from pymunk import Vec2d from math import * import random from time import sleep import copy from walker import walker class simulation(): def __init__(self, scr_w = 800, scr_h = 600, \ ...
nesvera/paul_walker
simulation.py
simulation.py
py
4,773
python
en
code
1
github-code
18
[ { "api_name": "pygame.init", "line_number": 25, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 26, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 26, "usage_type": "attribute" }, { "api_name": "pygame.time.C...
42197573044
from django.http import JsonResponse from django.core.paginator import Paginator from .models import Post,Classify def post(request): ''' 根据页数,排序方式,所属分类来返回文章列表页, json格式返回 p:页码 c:所属分类id s:排序方式 1:按默认推荐排序,2:按时间排序,3:按欢迎度排序 ''' p = request.GET.get('p') c = request.GET.get('c') s = req...
qq915522927/wblog
w_post/api.py
api.py
py
1,604
python
en
code
0
github-code
18
[ { "api_name": "models.Post.my_objects.active", "line_number": 26, "usage_type": "call" }, { "api_name": "models.Post.my_objects", "line_number": 26, "usage_type": "attribute" }, { "api_name": "models.Post", "line_number": 26, "usage_type": "name" }, { "api_name": ...
26535653295
import os import string import pickle import re import time import subprocess from itertools import compress from typing import List import numpy as np import nltk nltk.download('punkt') from nltk.tokenize import word_tokenize from keras.models import Model, Input, load_model from keras.preprocessing.sequence import pa...
mmarouen/marabou
marabou/train/src/models/named_entity_recognition_rnn.py
named_entity_recognition_rnn.py
py
27,420
python
en
code
2
github-code
18
[ { "api_name": "nltk.download", "line_number": 11, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 40, "usage_type": "name" }, { "api_name": "string.punctuation", "line_number": 53, "usage_type": "attribute" }, { "api_name": "typing.List", "...
18388019902
"""training.py Helper functions for running experiments. Author: Alex Kyllo Date: 2021-06-06 """ import logging import os from datetime import datetime from pathlib import Path from tensorflow.keras import callbacks from musiclearn import processing, vae_models LOG = logging.getLogger(__name__) LOG.setLevel(logging...
jackPhn/CSS586_Project
musiclearn/training.py
training.py
py
3,057
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.PathLike", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os.makedirs", ...
37299276654
from collections import defaultdict class ATM: def __init__(self): self.notectr = defaultdict(int) def deposit(self, banknotesCount: List[int]) -> None: for i in range(5): self.notectr[[20, 50, 100, 200, 500][i]] += banknotesCount[i] def withdraw(self, amount: int) -> List[in...
theabbie/leetcode
design-an-atm-machine.py
design-an-atm-machine.py
py
951
python
en
code
11
github-code
18
[ { "api_name": "collections.defaultdict", "line_number": 6, "usage_type": "call" } ]
31665792569
from selenium import webdriver from webdriver_manager.chrome import ChromeDriverManager from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.support import expected_conditions as ec from selenium.webdriver.common.by import By from Tasks.task10.pages.campaign_page import CampaignPage from Ta...
roman-kachur/selenium_2017
Tasks/task10/app/application.py
application.py
py
1,810
python
en
code
0
github-code
18
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 14, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 14, "usage_type": "name" }, { "api_name": "webdriver_manager.chrome.ChromeDriverManager", "line_number": 14, "usage_type": "call" }, ...
70416485481
from collections import namedtuple from operator import attrgetter metro_data = [ ('Tokyo', 'JP', 36.93, (35.68, 139.69)), ('Delhi NCR', 'IN', 21.94, (28.61, 77.21)), ('Mexico City', 'MX', 20.14, (19.43, -99.13)), ('New York-Newark', 'US', 20.1, (40.81, -74.02)), ('Sao Paulo', 'BR', 19.65, (-23.55,...
RyanLin1995/python
流畅的python/07_函数是一等对象/7.8_支持函数式编程的包/7.8.1_operatoe模块/02_attrgetter.py
02_attrgetter.py
py
768
python
en
code
0
github-code
18
[ { "api_name": "collections.namedtuple", "line_number": 11, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 12, "usage_type": "call" }, { "api_name": "operator.attrgetter", "line_number": 17, "usage_type": "call" }, { "api_name": "ope...
70728699880
import copy import json from django.http import HttpResponse import time import calendar import datetime from reports_mjt.utils.decime import to_string def utc(local_st): utc_st = time.localtime(local_st - 28800) result = time.strftime("%Y-%m-%d %H:%M:%S", utc_st) return result day_now = time...
guruiadmin/gurui
reports_mjt/reports_mjt/utils/data_select.py
data_select.py
py
7,028
python
en
code
0
github-code
18
[ { "api_name": "time.localtime", "line_number": 11, "usage_type": "call" }, { "api_name": "time.strftime", "line_number": 12, "usage_type": "call" }, { "api_name": "time.localtime", "line_number": 14, "usage_type": "call" }, { "api_name": "calendar.monthrange", ...
30533224640
''' Initilizing maze and point-based features No walls, no collision with features Known correspondence which means all features have unique labels screen visualization ''' import pygame from visualization import * from shapely.geometry import * #### Variables #### map_width = 500 map_height = 600 bor...
ZL92/Robot_Simulator
Localization with KF/maze.py
maze.py
py
2,673
python
en
code
0
github-code
18
[ { "api_name": "pygame.draw.line", "line_number": 29, "usage_type": "call" }, { "api_name": "pygame.draw", "line_number": 29, "usage_type": "attribute" }, { "api_name": "pygame.draw.line", "line_number": 35, "usage_type": "call" }, { "api_name": "pygame.draw", ...
1642788724
from django.conf import settings as django_settings from datetime import datetime from fabric.api import * import django import yaml import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "microsite.settings") django.setup() def build_documents(): books_dir = os.path.join(django_settings.BASE_DIR, 'books') ...
MicroPyramid/MicroSite
fabfile.py
fabfile.py
py
1,220
python
en
code
79
github-code
18
[ { "api_name": "os.environ.setdefault", "line_number": 9, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.setup", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.join", "...
37965678500
# -*- coding: utf-8 -*- import scrapy from scrapy.linkextractors import LinkExtractor from scrapy.spiders import CrawlSpider, Rule from scrapy.http import Request class SteamSpider(CrawlSpider): name = 'steam' #allowed_domains = ['https://store.steampowered.com/'] start_urls = ['https://store.steampowered...
RitamDey/Everything
python/scrapy/steam_scrapper/steam_scrapper/spiders/steam.py
steam.py
py
936
python
en
code
1
github-code
18
[ { "api_name": "scrapy.spiders.CrawlSpider", "line_number": 8, "usage_type": "name" }, { "api_name": "scrapy.spiders.Rule", "line_number": 14, "usage_type": "call" }, { "api_name": "scrapy.linkextractors.LinkExtractor", "line_number": 15, "usage_type": "call" } ]
26857573664
import pygame import sys pygame.init() size= (800,500) screen= pygame.display.set_mode(size) clock = pygame.time.Clock() pygame.mouse.set_visible(0) while True: for event in pygame.event.get(): if event.type == pygame.QUIT: sys.exit() mouse_pos = pygame.mouse.get_pos() x = mouse...
CesarPumacayo/Python-UTN
Tema_Pygame/clase05_mouse.py
clase05_mouse.py
py
555
python
en
code
0
github-code
18
[ { "api_name": "pygame.init", "line_number": 4, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pygame.time.Cloc...
70073301482
import os import binascii from datetime import datetime def get_file_header(path): """ Retrieve the first two hexadecimal numbers of a file """ data = open(path, 'rb') hex_str = binascii.b2a_hex(data.read(2)) return str(hex_str[:2], 'utf8'), str(hex_str[2:4], 'utf8') """ JPEG file...
FrogHarkness/Stack
converter.py
converter.py
py
2,258
python
en
code
0
github-code
18
[ { "api_name": "binascii.b2a_hex", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 38, "usage_type": "call" }, { "api_name": "os.path", "line_number": 38, "usage_type": "attribute" }, { "api_name": "datetime.datetime.fromtime...
14117760664
# Dash & Plotly Modules import dash import dash_core_components as dcc import dash_html_components as html import dash_bootstrap_components as dbc import dash_flexbox_grid as dfx from dash.dependencies import Input, Output, State import dash_table import dash_dangerously_set_inner_html from dash.exceptions import Preve...
SimsonChow/ml-dash-app
app.py
app.py
py
6,297
python
en
code
0
github-code
18
[ { "api_name": "dash_bootstrap_components.themes", "line_number": 21, "usage_type": "attribute" }, { "api_name": "dash.Dash", "line_number": 22, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 24, "usage_type": "call" }, { "api_name": "dash_...
36500319754
import pytest from src.lib.string_util import StringUtil @pytest.fixture(scope="module", autouse=True) def stu_object(): stu = StringUtil() yield stu class TestStringUtil: @pytest.mark.parametrize("test_input, expected", [('県外一例目', False), ('県内1例目', True), ('県内2外', True)]) def test_exclude_outside(s...
daisuke19891023/covid19-yamanashi-scraping
tests/lib/test_string_util.py
test_string_util.py
py
979
python
en
code
4
github-code
18
[ { "api_name": "src.lib.string_util.StringUtil", "line_number": 7, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 5, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 12, "usage_type": "call" }, { "api_name": "p...
70238034282
import numpy as np import matplotlib.pyplot as plt X= [20,30,47,78,765,89,4] y = [33,5,72,366,5,4,66] plt.plot(X,y) plt.xlabel('X - axis') plt.ylabel('Y - axis') plt.title('Example') plt.legend('temp') plt.show()
Luna-Hacks-Group6/Data-Visualization
index.py
index.py
py
218
python
en
code
0
github-code
18
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 10, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.xlabel", "line_number": 11, "usage_type": "call" }, { "api_name": "mat...
36103192528
# -*- coding: utf-8 -*- """ Created on Fri Feb 17 11:39:58 2017 @author: luzhangqin """ import numpy as np from sklearn.cluster import KMeans #计算两个输入集合的每对之间的距离。 from scipy.spatial.distance import cdist from matplotlib.font_manager import FontProperties import matplotlib.pyplot as plt font = FontProperties(fname = r'...
TonyLDS/sklearn
6-2.py
6-2.py
py
1,684
python
zh
code
0
github-code
18
[ { "api_name": "matplotlib.font_manager.FontProperties", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.random.uniform", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 21, "usage_type": "attribute" }, { "api...
73052160361
import numpy as np import math import torch import torch.nn as nn import torchvision.transforms as transforms class OhemCELoss(nn.Module): """ 算法本质: Ohem本质:核心思路是取所有损失大于阈值的像素点参与计算,但是最少也要保证取n_min个 """ def __init__(self, thresh, lb_ignore=255): super(OhemCELoss, self).__init__() # s...
fry404006308/fry_course_materials
230721_深度学习几分钟精通课程/230726-OhemCELoss/ohemCELoss.py
ohemCELoss.py
py
1,830
python
en
code
444
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.log", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.tensor", "line_number...
74028660521
# from argparse import ArgumentParser from PIL import Image, ImageFont, ImageDraw from config import Input_shape, channels, threshold, ignore_thresh, path from network_function import YOLOv3 from detect_function import predict from utils.yolo_utils import read_anchors, read_classes, letterbox_image # , resize_image fr...
maiminh1996/YOLOv3-tensorflow
src/propagation.py
propagation.py
py
13,056
python
en
code
1
github-code
18
[ { "api_name": "os.environ", "line_number": 16, "usage_type": "attribute" }, { "api_name": "config.path", "line_number": 23, "usage_type": "name" }, { "api_name": "sys.argv", "line_number": 27, "usage_type": "attribute" }, { "api_name": "config.path", "line_num...
23136321822
import re import numpy as np import torch from nltk.translate.bleu_score import corpus_bleu from nltk.translate.meteor_score import meteor_score from rouge import Rouge def cosine_similarity(v1, v2, t): return ((v1 * v2).sum() / (v1.norm() * v2.norm() * 2 + 1e-8) + 0.5).cpu().item() def exponential_similarity(v...
brianimpact/air4all
study_unit_summarizer/utils.py
utils.py
py
2,275
python
en
code
1
github-code
18
[ { "api_name": "torch.exp", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.log", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.pow", "line_number": 17, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 23, "us...
28735989833
from skimage.io import imread from matplotlib import pyplot as plt import numpy from scipy import stats RANGE = 256 # utility function plotting histogram def plot_hist(img, title, pixel_value_range = RANGE): image_hist, bins = numpy.histogram(img, bins=range(pixel_value_range)) center = (bins[:-1]...
FunnyPhantom/computer_vision_hws
hw6.py
hw6.py
py
2,684
python
en
code
0
github-code
18
[ { "api_name": "numpy.histogram", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.title", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 13, "usage_type": "name" }, { "api_name": "matplotlib....
22987188222
from dataclasses import dataclass from typing import Dict, Generator, NamedTuple, OrderedDict, Union from starknet_py.serialization._context import ( DeserializationContext, SerializationContext, ) from starknet_py.serialization.data_serializers._common import ( deserialize_to_dict, serialize_from_dict...
software-mansion/starknet.py
starknet_py/serialization/data_serializers/named_tuple_serializer.py
named_tuple_serializer.py
py
1,941
python
en
code
231
github-code
18
[ { "api_name": "starknet_py.serialization.data_serializers.cairo_data_serializer.CairoDataSerializer", "line_number": 20, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 20, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 20, "usage...
14201785411
#!/usr/bin/env python3 # coding: utf-8 """ @file: test_reasder.py @description: @author: Yiran Wu @email: wuyiran@genomics.cn @last modified by: Yiran Wu change log: 2021/08/13 create file. """ import numpy as np import pandas as pd from stereo.core.stereo_exp_data import StereoExpData from stereo.preprocess.q...
pratapstat/stereopy
tests/test_reader.py
test_reader.py
py
3,935
python
en
code
null
github-code
18
[ { "api_name": "scipy.sparse.csr_matrix", "line_number": 40, "usage_type": "call" }, { "api_name": "scipy.sparse", "line_number": 40, "usage_type": "name" }, { "api_name": "numpy.random.randint", "line_number": 42, "usage_type": "call" }, { "api_name": "numpy.rando...
2828191126
# An implementation of a linear SVM that uses gradient descent for training import numpy as np import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from sklearn.datasets import load_breast_cancer from sklearn.preprocessing import StandardScaler from datetime import datetime from util im...
IvanRado/AI
Support_Vector_Machines/linear_svm_gradient.py
linear_svm_gradient.py
py
3,958
python
en
code
0
github-code
18
[ { "api_name": "numpy.maximum", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.random.randn", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 22, "usage_type": "attribute" }, { "api_name": "numpy.where", ...
38363037154
import flet as ft def main(page: ft.Page): page.title = "Flet Band Name Generator" # page.vertical_alignment = "center" def reset_textfields(): city.error_text = "" pet.error_text = "" def button_clicked(e): reset_textfields() valid_form = True if city.value =...
InesaFitsner/flet-100-days-of-code
day-001-band-name-generator/main.py
main.py
py
1,010
python
en
code
14
github-code
18
[ { "api_name": "flet.Page", "line_number": 4, "usage_type": "attribute" }, { "api_name": "flet.TextField", "line_number": 26, "usage_type": "call" }, { "api_name": "flet.TextField", "line_number": 27, "usage_type": "call" }, { "api_name": "flet.Text", "line_num...
23073222413
#!/usr/bin/env python3 # Version 1.0 # Author Alexis Blanchet-Cohen # Date: 24/02/2014 import argparse import os import subprocess parser = argparse.ArgumentParser(description='Set up analysis directories and configuration files.') parser.add_argument("directory", nargs=1, help="Project directory. If the directory d...
blancha/abcngspipelines
utils/setup.py
setup.py
py
2,140
python
en
code
2
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "l...
43231711194
import requests import string from flask import Flask, render_template, request, redirect, url_for, flash, jsonify from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) app.config['DEBUG'] = True app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///weather.db' app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = Fals...
andradenatalie/OpenWeatherAPI
app.py
app.py
py
2,575
python
en
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 23, "usage_type": "call" }, { "api_name": "flask.render_temp...
38262608689
import sys import requests import datetime import time from pytz import timezone import sendgrid from sendgrid.helpers.mail import * import os from dotenv import load_dotenv def send_email(subject, content): load_dotenv() sg = sendgrid.SendGridAPIClient(api_key=os.environ.get('SENDGRID_API_KEY')) from_email = Email...
javierdechile/check_updates_http
check_updates.py
check_updates.py
py
2,337
python
en
code
1
github-code
18
[ { "api_name": "dotenv.load_dotenv", "line_number": 12, "usage_type": "call" }, { "api_name": "sendgrid.SendGridAPIClient", "line_number": 13, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 13, "usage_type": "call" }, { "api_name": "os.envir...
35501404471
import json import requests game_id = 453253378 r = requests.post( 'https://www.codingame.com/services/gameResultRemoteService/findByGameId', json = [str(game_id), None] ) replay = r.json() print(replay) with open(f'{game_id}.json', 'w+') as f: f.write(json.dumps(replay))
eulerscheZahl/playground-tlpdf9r5
project/code/download.py
download.py
py
277
python
en
code
0
github-code
18
[ { "api_name": "requests.post", "line_number": 5, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 12, "usage_type": "call" } ]
6986990128
from datetime import datetime # GMT string to GMT Time dateString = "Oct 28 23:59:59 2020 GMT" dateFormatter = "%b %d %H:%M:%S %Y GMT" print(datetime.strptime(dateString, dateFormatter)) # GMT Time to GMT String x = datetime.now() #現在時間 print(x.strftime("%Y-%m-%d %H:%M:%S")) # x = datetime(2018, 6, 1) # ...
danieltwlin/Python
Operating System/datetime/time_format.py
time_format.py
py
360
python
en
code
null
github-code
18
[ { "api_name": "datetime.datetime.strptime", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 7, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 12, "usage_type": "call" }, { "api_name": "date...
30619756558
from collections import defaultdict class Solution(object): def shortestAlternatingPaths(self, n, red_edges, blue_edges): """ :type n: int :type red_edges: List[List[int]] :type blue_edges: List[List[int]] :rtype: List[int] """ redGraph = defaultdict(list) ...
baldFemale/LeetCode-Solution
python/BFS/Shortest Path with Alternating Colors/Shortest Path with Alternating Colors.py
Shortest Path with Alternating Colors.py
py
1,575
python
en
code
15
github-code
18
[ { "api_name": "collections.defaultdict", "line_number": 12, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 13, "usage_type": "call" } ]
26190195355
import discord users = { 'Dark#6189': { 'rank': 'F', 'wins': 0, 'gold': 0, # gold gained from fighting monsters 'inventory': {} # inventory to store items from shop }, 'user2': { 'rank': 'A', 'wins': 3, 'gold': 0, 'inventory': {} }, ...
cis3296s23/DungeonHuntingRPG
lb.py
lb.py
py
3,216
python
en
code
0
github-code
18
[ { "api_name": "discord.Embed", "line_number": 52, "usage_type": "call" }, { "api_name": "discord.Color.from_rgb", "line_number": 52, "usage_type": "call" }, { "api_name": "discord.Color", "line_number": 52, "usage_type": "attribute" } ]
15473251664
import pathlib import pickle import uuid import attrs import tensorflow as tf import morefun.composite_genotypes as cg import morefun.grammars.backbones as bb import morefun.grammars.structured_grammatical_evolution as sge import morefun.grammars.upper_grammars as ugr import morefun.neural_networks.connections as con...
Mirandatz/morefun
morefun/phenotypes.py
phenotypes.py
py
2,169
python
en
code
0
github-code
18
[ { "api_name": "morefun.grammars.backbones.Backbone", "line_number": 25, "usage_type": "attribute" }, { "api_name": "morefun.grammars.backbones", "line_number": 25, "usage_type": "name" }, { "api_name": "attrs.field", "line_number": 25, "usage_type": "call" }, { "a...
356307083
from collections import namedtuple error_message = namedtuple('error_message', ('message', 'code',)) WRONG_UUID = error_message( 'Строка UUID не соответсует стандарту. Допустимы только строки UUID версии 4', 'wrong_uuid', ) WRONG_URL_CODE_LEN = error_message( 'Длинна "url_code" должна быть ровно 7 символо...
AlekseiKhatkevich/short_urls
short_urls/error_messages.py
error_messages.py
py
707
python
ru
code
1
github-code
18
[ { "api_name": "collections.namedtuple", "line_number": 3, "usage_type": "call" } ]
14980005101
import pandas as pd import streamlit as st # function to preprocess the data file and remove redundant data based on the week of the date provided in file. @st.cache() def pre_process(data): countyColumns = data[['countyFIPS', 'County Name']] week_df = data.drop(['countyFIPS', 'County Name', 'State', 'StateFI...
lakshbiradar/Covid-data-animation
dataprocess.py
dataprocess.py
py
1,896
python
en
code
1
github-code
18
[ { "api_name": "pandas.merge", "line_number": 21, "usage_type": "call" }, { "api_name": "streamlit.cache", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.merge", "line_number": 28, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "li...
3702556622
import copy import json import time import typing import random import ansi from non_blocking_input import nbprepare, nbclose import atexit import sys, os nb = nbprepare() atexit.register(nbclose) l_snake = [] dangerous_grids = set() bw = 2 _size: typing.Optional[typing.Tuple] = None _display_size: typing.Optional...
Bznkxs/term
snake.py
snake.py
py
13,978
python
en
code
0
github-code
18
[ { "api_name": "non_blocking_input.nbprepare", "line_number": 12, "usage_type": "call" }, { "api_name": "atexit.register", "line_number": 13, "usage_type": "call" }, { "api_name": "non_blocking_input.nbclose", "line_number": 13, "usage_type": "argument" }, { "api_n...
41558738325
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html import boto3 #from final_local.models import Ads_motorbike, db_connect, create_table class GumtreeScraperPipeline(object): ...
henri45/estimate_motorbike_value_django
estimate_motorbike_value_django/scrapy_project/pipelines.py
pipelines.py
py
1,144
python
en
code
0
github-code
18
[ { "api_name": "boto3.resource", "line_number": 16, "usage_type": "call" } ]
73487329960
"""Saved serializers.""" # Django REST Framework from rest_framework import serializers # Models from app.posts.models import Saved, CategorySaved # Serializers from app.posts.serializers import PostModelSerializer class CategorySavedModelSerializer(serializers.ModelSerializer): """Category saved model seriali...
Julian-Bio0404/Api-Facebook-Clone
facebook/app/posts/serializers/saved.py
saved.py
py
1,442
python
en
code
9
github-code
18
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 13, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 13, "usage_type": "name" }, { "api_name": "rest_framework.serializers.StringRelatedField", "line_number": 16,...
26505581882
import numpy as np import pytorch_lightning as pl import torch as th from torch.utils.data.dataloader import DataLoader from minerl3161.hyperparameters import MineRLDQNHyperparameters from minerl3161.pl_pretraining import pl_dataset, pl_model from minerl3161.buffers import ReplayBuffer from minerl3161.utils import sam...
will-maclean/MineRL
tests/test_pl_pretraining.py
test_pl_pretraining.py
py
3,075
python
en
code
2
github-code
18
[ { "api_name": "numpy.zeros", "line_number": 16, "usage_type": "call" }, { "api_name": "minerl3161.buffers.ReplayBuffer", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.random.rand", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.r...
35824484228
import pandas as pd from habanero import Crossref from tqdm import tqdm from fuzzywuzzy import fuzz def get_user_input(prompt, valid_columns): while True: user_input = input(prompt) if user_input in valid_columns: return user_input else: print("Column not found. Try ...
berkeokur/Doi_finder
main.py
main.py
py
3,829
python
en
code
0
github-code
18
[ { "api_name": "habanero.Crossref", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.read_excel", "line_number": 25, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 41, "usage_type": "call" }, { "api_name": "pandas.notna", "lin...
4037372855
import numpy as np import torch import torchvision import torch.nn as nn import torch.nn.functional as F from torch.utils.data import Dataset from torchvision import transforms import seaborn as sns import argparse sns.set_style('white') parser = argparse.ArgumentParser() parser.add_argument("--seed", type=int, defaul...
DepenM/Exp-WN
MNIST_prune.py
MNIST_prune.py
py
13,880
python
en
code
1
github-code
18
[ { "api_name": "seaborn.set_style", "line_number": 10, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.ran...
24445334996
import torch from langchain.llms import CTransformers from langchain.chains import LLMChain from langchain import PromptTemplate import gradio as gr import time custom_prompt_template = """ You are an AI Chatbot named Sunny, created by 'Sic Team', and your task is to provide information to users and chat with them bas...
ToxIcDisOt/sunny.main.model
app.py
app.py
py
2,555
python
en
code
0
github-code
18
[ { "api_name": "langchain.PromptTemplate", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.device", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.c...
9978052245
from keras.models import Sequential, Model from keras.layers import * from crf import CRF from keras.optimizers import Nadam from multipliers import * import tensorflow as tf from keras.initializers import * def return_input(cfg): x_in = Input((cfg['maxlen'],), name='word') pos_tag_in = Input((cfg['maxlen'],)...
qrfaction/ruijin-kg-SuperGUTScode
初赛/models.py
models.py
py
3,769
python
en
code
58
github-code
18
[ { "api_name": "keras.models.Model", "line_number": 72, "usage_type": "call" }, { "api_name": "crf.CRF", "line_number": 99, "usage_type": "call" }, { "api_name": "keras.models.Model", "line_number": 102, "usage_type": "call" }, { "api_name": "crf.loss_function", ...
25637056200
"""Добавление связи между заказам и таблицы с временем заказов Revision ID: 940dafae9a62 Revises: 82e629e61ca9 Create Date: 2021-03-19 22:46:19.052728 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '940dafae9a62' down_revision = '82e629e61ca9' branch_labels = ...
lizatish/YandexBackendSchool2021
migrations/versions/940dafae9a62_добавление_связи_между_заказам_и_.py
940dafae9a62_добавление_связи_между_заказам_и_.py
py
935
python
en
code
0
github-code
18
[ { "api_name": "alembic.op.add_column", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 21, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer...
4943270698
import argparse import configparser import os # Method to parse command-line arguments and a configuration file. It returns an arguments and a configuration object. def setup(): arg_parser = argparse.ArgumentParser() arg_group = arg_parser.add_mutually_exclusive_group() arg_group.add_argument("-a", "--all...
s3jSubmission/sigmod-s3j-submission
monitor/src/setup.py
setup.py
py
2,226
python
en
code
0
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "configparser.ConfigParser", "line_number": 38, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 39, "usage_type": "call" } ]
28430422044
#File to test the image that is processed from utils import * import numpy as np import cv2 as cv cap = cv.VideoCapture(0) if not cap.isOpened(): print("Cannot open camera") exit() fourcc = cv.VideoWriter_fourcc(*'MJPG') out = cv.VideoWriter('output.avi', fourcc, 20.0, (640, 480)) while True: # Capture...
Pieterjan-byte/IMP
recorder.py
recorder.py
py
692
python
en
code
0
github-code
18
[ { "api_name": "cv2.VideoCapture", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.VideoWriter_fourcc", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.VideoWriter", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.waitKey", ...
74708323881
''' for communication between the Unreal Engine game client and the backend server requires defining endpoints, handling requests, and establishing a protocol for data exchange. Below, I'll provide a simple example using Python with Flask for RESTful API ''' from flask import Flask, request, jsonify app = Flask(__...
FiredPhoenixIR/Simple_Game_Backend
RESTful_API.py
RESTful_API.py
py
826
python
en
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 16, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 16, "usage_type": "name" }, { "api_name": "flask.jsonify", ...
12710745307
from rapidsms.webui.utils import render_to_response from models import * from datetime import datetime, timedelta from utilities.export import export from rapidsms.webui.utils import paginated from django.contrib.auth.decorators import login_required, permission_required @login_required @permission_required("logger.c...
ewheeler/rapidsms-contrib-apps
logger/views.py
views.py
py
1,283
python
en
code
3
github-code
18
[ { "api_name": "rapidsms.webui.utils.paginated", "line_number": 21, "usage_type": "call" }, { "api_name": "rapidsms.webui.utils.render_to_response", "line_number": 22, "usage_type": "call" }, { "api_name": "django.contrib.auth.decorators.login_required", "line_number": 9, ...
157666626
import random import matplotlib.pyplot as plt import pandas as pd import numpy as np from IPython.display import display import inspect # Version con mosquitos pero sin genotipos y sin muerte. # AUN NO METO GENOTIPOS # Infeccion de mosquito: # - Mosquito suceptible pica a humano infectado. # - Queda infectado hasta ...
macataci/Dengue_ECO_EVO
code/abm_manual/mosquitos_SIR.py
mosquitos_SIR.py
py
5,880
python
es
code
0
github-code
18
[ { "api_name": "pandas.DataFrame", "line_number": 46, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 47, "usage_type": "call" }, { "api_name": "random.sample", "line_number": 58, "usage_type": "call" }, { "api_name": "random.sample", "...
7715660195
# -*- coding: utf-8 -*- import dealunit import tools # patient_name import patient_name_data patient_name = dealunit.Patient_name(patient_name_data.patient_name_data) # patient_drug import patient_drug_data patient_drug = dealunit.Patient_drug(patient_drug_data.patient_drug_data) # patient_assess import patient_ass...
phantom0309l/chenshuxiu.top
chenshuxiu.top/crondev/xuzhe/fcqx_yicongxing/calcfunctions/calcscores.py
calcscores.py
py
1,056
python
en
code
0
github-code
18
[ { "api_name": "dealunit.Patient_name", "line_number": 8, "usage_type": "call" }, { "api_name": "patient_name_data.patient_name_data", "line_number": 8, "usage_type": "attribute" }, { "api_name": "dealunit.Patient_drug", "line_number": 12, "usage_type": "call" }, { ...
4681808078
# Standard Algorithm Implementation # Sampling-based Algorithms PRM import matplotlib.pyplot as plt import numpy as np import networkx as nx from scipy import spatial # Class for PRM class PRM: # Constructor def __init__(self, map_array): self.map_array = map_array # map array, ...
Dheerajb07/campus-navigator
PRM Implementation/PRM.py
PRM.py
py
12,918
python
en
code
1
github-code
18
[ { "api_name": "networkx.Graph", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.arctan2", "line_number": 57, "usage_type": "call" }, { "api_name": "numpy.cos", "line_number": 61, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number":...
20406396935
from selenium import webdriver from selenium.common.exceptions import * from time import sleep from bs4 import BeautifulSoup as soup BASE_URL = 'http://www.kogl.or.kr/' URL = 'https://www.culture.go.kr/sso/login.do?agentId=5' driver = webdriver.Chrome('/Users/mac/Documents/python_work/my_project/crawling/chromedriv...
951237/python_crawling
크롤링_공공글꼴 다운로드_200402/crawling_공공글꼴_save_200402.py
crawling_공공글꼴_save_200402.py
py
2,010
python
ko
code
0
github-code
18
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 11, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 11, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 20, "usage_type": "call" }, { "api_name": "bs4.Beautiful...
11706188940
from decimal import Decimal from django.test import TestCase from djstripe.models import Customer, Charge, Card from django.contrib.auth.models import User import stripe import json import time # Create your tests here. class StripeUserTest(TestCase): def test_customer_stripe_id(self): self.customer = ...
esabunor/StripeTest
stripeuser/tests.py
tests.py
py
5,427
python
en
code
0
github-code
18
[ { "api_name": "django.test.TestCase", "line_number": 9, "usage_type": "name" }, { "api_name": "stripe.Customer.create", "line_number": 12, "usage_type": "call" }, { "api_name": "stripe.Customer", "line_number": 12, "usage_type": "attribute" }, { "api_name": "djstr...
7385099449
import argparse import sys import numpy from util.metric import * from util.plot_self import * def npToDict(array, offset=0): dict_array = {} for i in range(array.shape[0]): dict_array[array[i, 0] + offset] = array[i, 1:] return dict_array def dictToNp(dict): num = len(dict) array = nump...
ShenYueling56/SweepRobot
evaluation/util/associate.py
associate.py
py
5,880
python
en
code
1
github-code
18
[ { "api_name": "numpy.zeros", "line_number": 17, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 88, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 90, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number":...
14765690034
import configparser import argparse import os import csv from os import path from pathlib import Path from collections import defaultdict from collections import namedtuple import pandas as pd from upsetplot import UpSet from matplotlib import pyplot as plt from upsetplot import generate_counts, plot config = configpa...
kyleLesack/sv_calling_benchmarking
real_data/shortread/00_scripts/2_make_plots/create_upset_plots.py
create_upset_plots.py
py
5,966
python
en
code
0
github-code
18
[ { "api_name": "configparser.ConfigParser", "line_number": 14, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 15, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 30, "usage_type": "call" }, { "api_nam...
25593674475
# coding: utf-8 import datetime from typing import Any from il2fb.commons.structures import BaseStructure class TimestampedData(BaseStructure): __slots__ = ['timestamp', 'data', ] def __init__(self, data: Any): self.timestamp = datetime.datetime.utcnow() self.data = data def __repr__(...
IL2HorusTeam/il2fb-ds-airbridge
il2fb/ds/airbridge/structures.py
structures.py
py
506
python
en
code
5
github-code
18
[ { "api_name": "il2fb.commons.structures.BaseStructure", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 13, "usage_type": "name" }, { "api_name": "datetime.datetime.utcnow", "line_number": 14, "usage_type": "call" }, { "api_na...