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
27096145601
# IMPROVEMNTS: # Lowercase all tokens t avoid duplicates. # Separate based on punctuation like ' to allow not or n't to be given equal chance import re import nltk import string def sanitize_list_of_tokens(tokenized_sentences): sanitized_sentences = [] is_word = re.compile('\w') for sent in tokenized_sent...
osamamukhtar11/computational-creativity
week1/sanitizer.py
sanitizer.py
py
1,464
python
en
code
0
github-code
6
[ { "api_name": "re.compile", "line_number": 11, "usage_type": "call" }, { "api_name": "string.punctuation", "line_number": 15, "usage_type": "attribute" }, { "api_name": "nltk.word_tokenize", "line_number": 16, "usage_type": "call" }, { "api_name": "re.sub", "l...
27030369613
#Advent of Code 2021 #Day 3: Binary Diagnostic #v1.0 12/03/21 -- Leliel from collections import Counter #Nifty mode, mean, etc for lists #Initializations gamma ="" epsi = "" i = 0 # row col=[] gambits =[] ####Load matrix #### with open('day3in.txt') as fn: for line in fn: bits...
Cleric-Leliel/AdventofCode2021
Day3.py
Day3.py
py
1,183
python
en
code
0
github-code
6
[ { "api_name": "collections.Counter", "line_number": 31, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 32, "usage_type": "call" } ]
74606038588
# -*- coding: utf-8 -*- import pytest from ksiega_wieczysta import KsiegaWieczysta from dzialka import Dzialka def test_default_verify_kw(): """Test that the default number is empty string""" vk = KsiegaWieczysta() assert vk.numer == '' @pytest.mark.parametrize("val,exp", [('LD1Y/00000351/8', True), ('...
jakubplata/KW
tests/test_ksiega_wieczysta.py
test_ksiega_wieczysta.py
py
1,217
python
en
code
0
github-code
6
[ { "api_name": "ksiega_wieczysta.KsiegaWieczysta", "line_number": 10, "usage_type": "call" }, { "api_name": "ksiega_wieczysta.KsiegaWieczysta", "line_number": 18, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 14, "usage_type": "call" }, ...
19465699629
""" Created on Tue Oct 09 16:39:00 2018 @author: Joshua C. Agar """ from numpy.core.multiarray import ndarray from .format import * import numpy as np from ..util.file import * from ..util.core import * from ..analysis.machine_learning import * from ..analysis.rnn import * from matplotlib.ticker import FormatStrFormat...
jagar2/Revealing-Ferroelectric-Switching-Character-Using-Deep-Recurrent-Neural-Networks
codes/viz/plot.py
plot.py
py
64,116
python
en
code
19
github-code
6
[ { "api_name": "matplotlib.pyplot.get_cmap", "line_number": 21, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 21, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.cm.viridis", "line_number": 39, "usage_type": "call" }, { "api_nam...
71603089149
import tkinter as tk from tkinter import filedialog import speech_recognition as sr import pyaudio import wave from PIL import Image, ImageTk def open_file_dialog(): file_path = filedialog.askopenfilename(filetypes=[("Audio Files", "*.wav")]) convert_speech_to_text(file_path) def convert_speech_to_text(file_p...
merkurluxury/seslimetincevirci
ruby/google.py
google.py
py
3,221
python
en
code
0
github-code
6
[ { "api_name": "tkinter.filedialog.askopenfilename", "line_number": 9, "usage_type": "call" }, { "api_name": "tkinter.filedialog", "line_number": 9, "usage_type": "name" }, { "api_name": "speech_recognition.Recognizer", "line_number": 13, "usage_type": "call" }, { ...
34859380583
from flask import Flask, render_template, render_template_string, request, redirect from flask_mysqldb import MySQL import yaml app = Flask(__name__) # Configure DB db = yaml.safe_load(open('db.yaml')) # print(db) app.config['MYSQL_HOST'] = db['mysql_host'] app.config['MYSQL_USER'] = db['mysql_user'] app.config['MYSQ...
MahikaJaguste/library-management-system
flask-website/app.py
app.py
py
10,504
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "yaml.safe_load", "line_number": 8, "usage_type": "call" }, { "api_name": "flask_mysqldb.MySQL", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.request.method", ...
43227838835
import os, sys, datetime, numpy as np, pandas as pd; from django.core.management.base import BaseCommand, CommandError; from django.db import models, transaction, IntegrityError; from explorer.models import Protein, SequenceRecord, Taxon; import pytz; class Command(BaseCommand): def add_arguments(self, parser): ...
CoronaWhy/Covid_Portal
webCovidPortal/explorer/management/commands/import_sequencerecord.py
import_sequencerecord.py
py
5,122
python
en
code
0
github-code
6
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 7, "usage_type": "name" }, { "api_name": "os.path.isfile", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path", "line_number": 32, "usage_type": "attribute" }, { "api_name": "pa...
42482681869
import requests,json,os # pushplus秘钥 sckey = os.environ.get("PUSHPLUS_TOKEN", "") sendContent = '' # glados账号cookie cookies= os.environ.get("GLADOS_COOKIE", []).split("&") if cookies[0] == "": print('未获取到COOKIE变量') cookies = [] exit(0) def start(): url= "https://glados.rocks/api/user/checkin" ...
domeniczz/GLaDOS_checkin_auto
glados_Qinglong.py
glados_Qinglong.py
py
1,978
python
en
code
19
github-code
6
[ { "api_name": "os.environ.get", "line_number": 4, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 7, "usage_type": "call" }, { "api_name": "os.environ", "line_num...
40033905041
# Import Required Libs import os import sys from categories_meta import COCO_CATEGORIES, COCO_NAMES from panopticapi.utils import id2rgb, rgb2id import panopticapi from PIL import Image, ImageDraw, ImageFont import requests import io import math import matplotlib.pyplot as plt # %config InlineBackend.figure_format = ...
adilsammar/detr-fine
dataprepration/main.py
main.py
py
6,853
python
en
code
4
github-code
6
[ { "api_name": "itertools.cycle", "line_number": 18, "usage_type": "call" }, { "api_name": "seaborn.color_palette", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.set_grad_enabled", "line_number": 26, "usage_type": "call" }, { "api_name": "torchvis...
11813459247
import sys from sklearn.tree import DecisionTreeClassifier from sklearn.datasets import load_breast_cancer from sklearn.model_selection import train_test_split sys.path.append('..') from mlscratch.models.bagging import Bagging from mlscratch.metrics import accuracy_score if __name__ == '__main__': X, y = load_br...
yutayamazaki/machine-learning-from-scratch
examples/bagging.py
bagging.py
py
900
python
en
code
0
github-code
6
[ { "api_name": "sys.path.append", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "sklearn.datasets.load_breast_cancer", "line_number": 12, "usage_type": "call" }, { "api_name": "sklea...
23135811933
# -*- coding: utf-8 -*- import sqlite3 connection = sqlite3.connect("company.db") cursor = connection.cursor() # delete #cursor.execute("""DROP TABLE employee;""") sql_command = """ CREATE TABLE employee ( staff_number INTEGER PRIMARY KEY, fname VARCHAR(20), lname VARCHAR(30), gender CHAR(1), joining DATE, bir...
baadam3/ICS0019_Advanced_python_solutions
Examples/Database_code/dbSQL.py
dbSQL.py
py
1,158
python
en
code
0
github-code
6
[ { "api_name": "sqlite3.connect", "line_number": 3, "usage_type": "call" } ]
73554600509
import numpy as np import pandas as pd import torch import os import cv2 import math import datetime import matplotlib.pyplot as plt from scipy.spatial.distance import cdist from torch.utils.data import Dataset def rotate_image(image, angle): image_center = tuple(np.array(image.shape[1::-1]) / 2) rot_mat = c...
arseniybelkov/Determining_HOCB
load_data.py
load_data.py
py
4,529
python
en
code
0
github-code
6
[ { "api_name": "numpy.array", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.getRotationMatrix2D", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.warpAffine", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2.INTER_LINEAR",...
51692491
import numpy as np from corai_plot import APlot from corai_util.tools.src.function_writer import factory_fct_linked_path from root_dir import ROOT_DIR from src.stock_bubble.plot_bubbles import plot_add_phases, \ plot_four_timeseries_decomp, plot_bubble_2d from src.stock_bubble.sample_self_exciting_bubble import sa...
Code-Cornelius/jump_diff_bubble_II_thesis
src/simul_bubble_script.py
simul_bubble_script.py
py
9,484
python
en
code
0
github-code
6
[ { "api_name": "numpy.random.seed", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.arange", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.array", "l...
6959924602
# https://matplotlib.org/examples/statistics/errorbar_demo_features.html import numpy as np import matplotlib.pyplot as plt # example data x = np.arange(0.1, 4, 0.5) y = np.exp(-x) # example error bar values that vary with x-position error = 0.1 + 0.2 * x fig, (ax0, ax1) = plt.subplots(nrows=2, sharex=True) ax0.erro...
SCKIMOSU/Numerical-Analysis
errorbar.py
errorbar.py
py
698
python
en
code
17
github-code
6
[ { "api_name": "numpy.arange", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", ...
30138183165
# !/usr/local/python/bin/python # -*- coding: utf-8 -*- # (C) Wu Dong, 2020 # All rights reserved # @Author: 'Wu Dong <wudong@eastwu.cn>' # @Time: '2020-03-19 10:23' """ 演示 pre-request 框架如何使用空值校验 """ from flask import Flask from pre_request import pre, Rule app = Flask(__name__) app.config["TESTING"] = True client = ...
Eastwu5788/pre-request
examples/example_filter/example_empty.py
example_empty.py
py
1,227
python
en
code
55
github-code
6
[ { "api_name": "flask.Flask", "line_number": 13, "usage_type": "call" }, { "api_name": "pre_request.Rule", "line_number": 20, "usage_type": "call" }, { "api_name": "pre_request.Rule", "line_number": 21, "usage_type": "call" }, { "api_name": "pre_request.pre.catch",...
38749292803
from math import nan from matplotlib.pyplot import sca import numpy as np import pandas as pd from pandas.core.frame import DataFrame from sklearn.preprocessing import StandardScaler from sklearn.preprocessing import RobustScaler from sklearn.preprocessing import MinMaxScaler from sklearn.preprocessing import MaxAbsS...
GC212ML2/term-project
FBClassifier.py
FBClassifier.py
py
20,255
python
en
code
1
github-code
6
[ { "api_name": "pandas.core.frame.DataFrame", "line_number": 30, "usage_type": "name" }, { "api_name": "pandas.core.frame.DataFrame", "line_number": 31, "usage_type": "name" }, { "api_name": "sklearn.preprocessing.StandardScaler", "line_number": 32, "usage_type": "call" ...
20415541366
import json import base64 import boto3 from datetime import datetime def lambda_handler(event, context): client = boto3.client('rds-data') db_cluster_arn = "XXXXXXX" db_credentials_secrets_store_arn = "XXXXX" database_name = "DB NAME" #print("Received event: " + json.dumps(event, indent=2))...
nanda4949/datapipeline
AWS_Stream_Processing_Pipeline/lambda_write_to_Aurora.py
lambda_write_to_Aurora.py
py
6,379
python
en
code
0
github-code
6
[ { "api_name": "boto3.client", "line_number": 10, "usage_type": "call" }, { "api_name": "base64.b64decode", "line_number": 18, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 24, "usage_type": "call" } ]
35925640159
from typing import Any, Tuple import numpy as np import keras.backend as K import keras.layers from keras.layers import Dense, Activation, Input, Conv2D, MaxPooling2D from keras import regularizers from keras import metrics from keras import optimizers from keras.models import Sequential from keras.applications.vgg16 ...
philine-bommer/Climate_X_Quantus
CphXAI/cphxai/src/utils/models.py
models.py
py
5,466
python
en
code
0
github-code
6
[ { "api_name": "keras.models.Sequential", "line_number": 27, "usage_type": "call" }, { "api_name": "keras.layers.Dense", "line_number": 31, "usage_type": "call" }, { "api_name": "keras.regularizers.l1_l2", "line_number": 33, "usage_type": "call" }, { "api_name": "k...
23432126079
#CIFAR-10 Object Recognition: Build a machine learning model that can correctly classify images of objects from the CIFAR-10 dataset. import tensorflow as tf from tensorflow.keras import datasets, layers, models import pandas as pd import matplotlib.pyplot as plt # Load the CIFAR-10 dataset from keras lib (train_image...
rezashokrzad/git_youtube_tutorial
ML challenges/ML02.py
ML02.py
py
2,306
python
en
code
6
github-code
6
[ { "api_name": "tensorflow.keras.datasets.cifar10.load_data", "line_number": 8, "usage_type": "call" }, { "api_name": "tensorflow.keras", "line_number": 8, "usage_type": "attribute" }, { "api_name": "tensorflow.keras.models.Sequential", "line_number": 21, "usage_type": "ca...
34464284141
from click import clear def Choose (dir): fdata=open(f'{dir}','r') import random names=[] while True: name = fdata.readline() if not name: break else: names.append(name[:-1]) num=random.randint(0,len(names)-1) fdata.close() return (names[nu...
AnshBhardwaj1/Projects
Projects/Hangman/main.py
main.py
py
1,574
python
en
code
0
github-code
6
[ { "api_name": "random.randint", "line_number": 12, "usage_type": "call" }, { "api_name": "click.clear", "line_number": 40, "usage_type": "call" }, { "api_name": "click.clear", "line_number": 43, "usage_type": "call" } ]
26180491120
#!/usr/bin/env python # Coordinator script by J.J.Iszatt import os import sys import datetime import subprocess import configparser from Bio import SeqIO import csv import functions as ji # Reading inputs input = '/assemble/input' output = '/assemble/output' logs = "/assemble/output/phanatic_log.tsv" # Configuring ...
JoshuaIszatt/Phanatic
docker_lib/coordinator.py
coordinator.py
py
6,195
python
en
code
0
github-code
6
[ { "api_name": "configparser.ConfigParser", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "sys.exit", ...
24362879640
import datetime from collections import defaultdict from itertools import chain from odoo import fields, models from odoo.exceptions import ValidationError from odoo.tools import float_compare from ..tools.lib_holidays import is_holiday class SaleOrder(models.Model): _inherit = 'sale.order' count_reverse ...
suningwz/netaddiction_addons
netaddiction_warehouse/models/sale_order.py
sale_order.py
py
14,593
python
en
code
0
github-code
6
[ { "api_name": "odoo.models.Model", "line_number": 13, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 13, "usage_type": "name" }, { "api_name": "odoo.fields.Integer", "line_number": 16, "usage_type": "call" }, { "api_name": "odoo.fields", ...
25805448587
import ray import time # Inicializar Ray en modo de cluster ray.init(address='auto') # Asumiendo que Ray está en modo de cluster # ray.init(local_mode=True) # Inicializar Ray en modo local sin utilizar la distribución # Definir una función simple para procesar la lista de manera paralela @ray.remote def pr...
joak99/SO-Asignacion3
Asignación_3/Parte2_RayFramework/suma_sublista.py
suma_sublista.py
py
1,477
python
es
code
0
github-code
6
[ { "api_name": "ray.init", "line_number": 5, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 12, "usage_type": "call" }, { "api_name": "ray.remote", "line_number": 9, "usage_type": "attribute" }, { "api_name": "time.time", "line_number": 25, ...
72530978429
import json import traceback # Exceptions # keywords: try and except # All non-system-exiting exceptions are derived from the Exception class # Ex of hierarchy # BaseException # +--SystemExit # +--KeyboardInterrupt # +--Exception # +--ArithmeticError # +--FloatingPointError # +--OverflowError ...
itiro-y/python-repo
LearningPython/exceptions/try_except.py
try_except.py
py
2,810
python
en
code
0
github-code
6
[ { "api_name": "traceback.print_exc", "line_number": 37, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 80, "usage_type": "call" } ]
74718151227
from enum import auto import torch from torchvision import datasets from torchvision import transforms from torchvision.utils import make_grid import matplotlib.pyplot as plt import numpy as np from cylinder_dataset import * device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") # device = torch.devic...
DaydreamAtNight/autoencoder-identical-to-POD-PCA
0_SVD_fluid.py
0_SVD_fluid.py
py
3,842
python
en
code
0
github-code
6
[ { "api_name": "torch.device", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.tensor", ...
26042453656
from __future__ import annotations import dataclasses import itertools import logging import re from dataclasses import dataclass from pathlib import Path, PurePath from textwrap import dedent from typing import Iterable, List, Type import pytest from pants.build_graph.address import Address from pants.core.goals.fi...
pantsbuild/pants
src/python/pants/core/goals/fix_test.py
fix_test.py
py
17,032
python
en
code
2,896
github-code
6
[ { "api_name": "pants.engine.fs.FileContent", "line_number": 50, "usage_type": "call" }, { "api_name": "pants.engine.fs.FileContent", "line_number": 51, "usage_type": "call" }, { "api_name": "pants.engine.target.SingleSourceField", "line_number": 54, "usage_type": "name" ...
40405165395
#!/usr/bin/env python # coding: utf-8 # In[1]: ## Imports and get_param import os import sys import glob import h5py import torch from torch import optim import numpy as np from tqdm.notebook import trange, tqdm import matplotlib.pyplot as plt sys.path.append(os.path.abspath(os.path.join('..'))) from models.Angu...
anders-s-olsen/Task_WMM_ACGMM_HMM
notebooks/realdata_fit_alldata.py
realdata_fit_alldata.py
py
8,651
python
en
code
0
github-code
6
[ { "api_name": "sys.path.append", "line_number": 20, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_num...
70276816827
import sys, getopt import csv import pandas as pd import numpy as np import matplotlib.pyplot as plt def main(argv): inputfile = '' outputfile = '' try: opts, args = getopt.getopt(argv,"hi:o:",["ifile=","ofile="]) except getopt.GetoptError: print('plot_distribution.py -i <inputfile.csv> -o <out...
CAZ-H/Uni-AI-Akari
plot_distribution.py
plot_distribution.py
py
2,028
python
en
code
1
github-code
6
[ { "api_name": "getopt.getopt", "line_number": 11, "usage_type": "call" }, { "api_name": "getopt.GetoptError", "line_number": 12, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.exit", "line_n...
10775323759
""" Slow, but it gets there. I needed to get a hint to check I was on the right track. The most important part was coming up with clever ways of pruning, which were specific to the problem domain. """ from collections import Counter, defaultdict, deque, namedtuple from functools import cmp_to_key from itertools impor...
knjmooney/Advent-Of-Code
2022/19-geode.py
19-geode.py
py
3,313
python
en
code
0
github-code
6
[ { "api_name": "os.path.dirname", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "requests_cache.CachedSession", "line_number": 23, "usage_type": "call" }, { "api_name": "json.load",...
23036263057
# -*- coding: utf-8 -*- """ Created on Tue Dec 8 01:26:31 2020 @author: sjdef """ # imports for time import time from datetime import datetime import pytz # imports for data #import yfinance as yf # pricing data #import matplotlib.pyplot as plt import pandas as pd import numpy as np import sqlite3 ...
sjdefran1/algo-trade-bot
MACDcrossover.py
MACDcrossover.py
py
34,327
python
en
code
1
github-code
6
[ { "api_name": "sqlite3.connect", "line_number": 25, "usage_type": "call" }, { "api_name": "alpaca_trade_api.REST", "line_number": 32, "usage_type": "call" }, { "api_name": "alpaca_trade_api.REST", "line_number": 51, "usage_type": "call" }, { "api_name": "pandas.Ti...
39252887710
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.Create...
mangaki/mangaki
mangaki/mangaki/migrations/0001_initial.py
0001_initial.py
py
4,436
python
en
code
137
github-code
6
[ { "api_name": "django.db.migrations.Migration", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 8, "usage_type": "name" }, { "api_name": "django.db.migrations.swappable_dependency", "line_number": 11, "usage_type": "call...
18739795103
from flask import Flask, request, redirect, render_template, session, flash from mysqlconnection import MySQLConnector app = Flask(__name__) mysql = MySQLConnector(app,'friendsdb') @app.route('/') def index(): query = "SELECT CONCAT(first_name, ' ', last_name) as name, occupation, DATE_FORMAT(created_at, '%d %b %y...
mtjhartley/codingdojo
dojoassignments/python/mysql_and_flask/full_friends/server.py
server.py
py
1,229
python
en
code
1
github-code
6
[ { "api_name": "flask.Flask", "line_number": 3, "usage_type": "call" }, { "api_name": "mysqlconnection.MySQLConnector", "line_number": 4, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 10, "usage_type": "call" }, { "api_name": "flask....
28248947795
from models.blocks import * import torch.utils.checkpoint as checkpoint class LITLayer(nn.Module): """ A basic LIT layer for one stage. Args: dim (int): Number of input channels. input_resolution (tuple[int]): Input resolution. depth (int): Number of blocks. num_heads (int): Nu...
ziplab/LITv2
classification/models/layers.py
layers.py
py
2,961
python
en
code
182
github-code
6
[ { "api_name": "torch.utils.checkpoint.checkpoint", "line_number": 54, "usage_type": "call" }, { "api_name": "torch.utils.checkpoint", "line_number": 54, "usage_type": "name" } ]
36844673323
import argparse import os import mmcv import torch import numpy as np import json from mmcv.parallel import MMDataParallel, MMDistributedDataParallel from mmcv.runner import get_dist_info, init_dist, load_checkpoint from tools.fuse_conv_bn import fuse_module from mmdet.apis import multi_gpu_test, single_gpu_test fro...
DeepSceneSeg/EfficientPS
tools/cityscapes_inference.py
cityscapes_inference.py
py
4,705
python
en
code
505
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 23, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 31, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 32, "usage_type": "attribute" }, { "api_name": "mmdet.apis.in...
14975425130
"""Adds config flow for DuerOS.""" from __future__ import annotations from dueros_smarthome.client import SmartHomeClient from dueros_smarthome.const import STATUS_OK import voluptuous as vol from homeassistant import config_entries from homeassistant.const import CONF_USERNAME from homeassistant.exceptions import Int...
zsy056/dueros-ha
custom_components/dueros/config_flow.py
config_flow.py
py
2,253
python
en
code
0
github-code
6
[ { "api_name": "homeassistant.config_entries.ConfigFlow", "line_number": 15, "usage_type": "attribute" }, { "api_name": "homeassistant.config_entries", "line_number": 15, "usage_type": "name" }, { "api_name": "const.DOMAIN", "line_number": 15, "usage_type": "name" }, {...
17196146627
import threading import keyboard import pyfirmata import time from Synthesizer import StringSynthesizer from additiveStream import AdditiveStream from GUI import PrototypeGUI class ReadOctavesThread(threading.Thread): def __init__(self, synthesizer, breadBoard, XPin, YPin, leds): threading.Thread.__init_...
MTA20439/P4_prototype
Main.py
Main.py
py
7,021
python
en
code
1
github-code
6
[ { "api_name": "threading.Thread", "line_number": 11, "usage_type": "attribute" }, { "api_name": "threading.Thread.__init__", "line_number": 13, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 13, "usage_type": "attribute" }, { "api_name": ...
71816511867
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ function that takes a sys.argv, typically a parent folder provided via bash or sbatch command, and searches within that folder for any files ending in downsized_for_atlas.tif It then takes the max projection along the final axis of that tiff and saves it with the ap...
emilyjanedennis/PRA
src/check_alignment.py
check_alignment.py
py
803
python
en
code
1
github-code
6
[ { "api_name": "sys.argv", "line_number": 18, "usage_type": "attribute" }, { "api_name": "glob.glob", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20,...
32639245681
from multiprocessing.dummy import freeze_support from multiprocessing import Pool from timer import timer import wfdb import numpy as np import main import json from os import listdir from os.path import isfile, join # TODO # Taśmy nie mają adnotacji lub mają ich za mało # 214 - 2 # 111 - 0 # 109 - 0 FILES_TO_SKIP = ...
Andrzej97/QRS_HRV_analysis
tests.py
tests.py
py
4,367
python
en
code
0
github-code
6
[ { "api_name": "os.listdir", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 21, "usage_type": "call" }, { "api_name": "main.get_r_samples", "line...
31253645404
#!/usr/bin/env python # Description: publishes current state of the robot, enumerates possible state_sub # and legal state changes # changes in cr_ros_2: removed the states docked and docking which were unique to # the physical structure of the turtlebot 2 # --> added namespacing to the service name and subscribed to...
campusrover/cr_ros_3
src/all_states.py
all_states.py
py
2,859
python
en
code
1
github-code
6
[ { "api_name": "rospy.ServiceProxy", "line_number": 16, "usage_type": "call" }, { "api_name": "rospy.ServiceProxy", "line_number": 17, "usage_type": "call" }, { "api_name": "enum.Enum", "line_number": 19, "usage_type": "name" }, { "api_name": "geometry_msgs.msg.Pos...
13486620535
from collections import defaultdict a_dir = '../2021-hashcode-practice/input/a_an_example.in.txt' class project: def __init__(self, d, s, b, r): self.duration = d self.score = s self.bestbefore = b self.roles = r contributorDict = defaultdict() projectDict = defaultdict() jkDict = defaultdict() ## f...
spes2357/2021-hashcode-practice
JKChai/YongFirstTest.py
YongFirstTest.py
py
5,848
python
en
code
0
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 11, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 12, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 13, "usage_type": "call" }, { "api_name"...
73652391229
# 给你两个下标从 0 开始的字符串 s 和 target 。你可以从 s 取出一些字符并将其重排,得到若干新的字符串。 # 从 s 中取出字符并重新排列,返回可以形成 target 的 最大 副本数。 from collections import Counter class Solution: def rearrangeCharacters(self, s: str, target: str) -> int: d1 = Counter(target) d2 = Counter(s) ans = float('inf') for key, val...
xxxxlc/leetcode
array/rearrangeCharacters.py
rearrangeCharacters.py
py
711
python
zh
code
0
github-code
6
[ { "api_name": "collections.Counter", "line_number": 11, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 12, "usage_type": "call" } ]
42454385824
import collections import ctypes import struct import time from .constants import MICROSEC_PER_SEC, NANOSEC_PER_MICROSEC i8 = ctypes.c_int8 i16 = ctypes.c_int16 i32 = ctypes.c_int32 i64 = ctypes.c_int64 u8 = ctypes.c_uint8 u16 = ctypes.c_uint16 u32 = ctypes.c_uint32 u64 = ctypes.c_uint64 cint = ctypes.c_int cuint ...
tiagocoutinho/linuxpy
linuxpy/ctypes.py
ctypes.py
py
2,212
python
en
code
2
github-code
6
[ { "api_name": "ctypes.c_int8", "line_number": 8, "usage_type": "attribute" }, { "api_name": "ctypes.c_int16", "line_number": 9, "usage_type": "attribute" }, { "api_name": "ctypes.c_int32", "line_number": 10, "usage_type": "attribute" }, { "api_name": "ctypes.c_int...
17441267494
#importing essential libraries import pandas as pd import numpy as np from sklearn.linear_model import LogisticRegression import pickle #create a function def data_split(data,ratio): np.random.seed(42) shuffled = np.random.permutation(len(data)) test_set_size = int(len(data)*ratio) test_indices = shuff...
imsanjoykb/Covid-19-Patient-Detector
COVID19/myTraining.py
myTraining.py
py
1,139
python
en
code
5
github-code
6
[ { "api_name": "numpy.random.seed", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.random.permutation", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.rand...
18318807371
"""P4Python - Python interface to Perforce API Perforce is the fast SCM system at www.perforce.com. This package provides a simple interface from Python wrapping the Perforce C++ API to gain performance and ease of coding. Similar to interfaces available for Ruby and Perl. """ classifiers = """\ Developmen...
rptb1/p4python
setup.py
setup.py
py
15,518
python
en
code
6
github-code
6
[ { "api_name": "sys.version_info", "line_number": 35, "usage_type": "attribute" }, { "api_name": "sys.version_info", "line_number": 41, "usage_type": "attribute" }, { "api_name": "distutils.core.setup", "line_number": 42, "usage_type": "name" }, { "api_name": "re.c...
30950764847
import numpy as np import scipy.special as special import matplotlib.pyplot as plt def c_2(Pi): K1prime = (-special.kn(0,np.sqrt(Pi)) -1/np.sqrt(Pi)*special.kn(1,np.sqrt(Pi))) return -1/(3*np.sqrt(Pi)*K1prime) def W0(x,Pi): return special.kn(1,np.sqrt(Pi)*x)/x def W(x,Pi): return c...
samueljmcameron/ABPs_coarse_graining
experiments/2020_01_21/hard_sphere_w/analytical_solve_homogeneous_ODE.py
analytical_solve_homogeneous_ODE.py
py
809
python
en
code
0
github-code
6
[ { "api_name": "scipy.special.kn", "line_number": 7, "usage_type": "call" }, { "api_name": "scipy.special", "line_number": 7, "usage_type": "name" }, { "api_name": "numpy.sqrt", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number"...
20793254975
import numpy as np import matplotlib.pyplot as plt import seaborn as sns from scipy import signal def glance(x): x = np.asarray(x) if x.ndim > 1: nch = x.shape[-1] else: nch = 1 x = x[:,None] fig = plt.figure(constrained_layout=True) gs = fig.add_gridspec(3, nch) asp...
remifan/commplax
commplax/plot.py
plot.py
py
3,449
python
en
code
49
github-code
6
[ { "api_name": "numpy.asarray", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 16, "usage_type": "name" }, { "api_name": "scipy.signal"...
20519891800
"""! @brief Examples of usage and demonstration of abilities of Local Excitatory Global Inhibitory Oscillatory Network (LEGION). @authors Andrei Novikov (pyclustering@yandex.ru) @date 2014-2020 @copyright BSD-3-Clause """ from pyclustering.utils import draw_dynamics; from pyclustering.nnet.legion impor...
annoviko/pyclustering
pyclustering/nnet/examples/legion_examples.py
legion_examples.py
py
6,495
python
en
code
1,113
github-code
6
[ { "api_name": "pyclustering.nnet.legion.legion_network", "line_number": 17, "usage_type": "call" }, { "api_name": "pyclustering.utils.draw_dynamics", "line_number": 23, "usage_type": "call" }, { "api_name": "pyclustering.utils.draw_dynamics", "line_number": 24, "usage_typ...
1795205230
from torch.utils.data import Dataset import numpy as np from PIL import Image from torchvision.transforms import ToPILImage __all__ = ['CustomDataset'] class CustomDataset(Dataset): def __init__(self, images, labels, transform=None): assert images.shape[0] == labels.shape[0] self.images = images...
PerdonLiu/Visual-Privacy-Protection-via-Mapping-Distortion
utils/custom_dataset.py
custom_dataset.py
py
700
python
en
code
4
github-code
6
[ { "api_name": "torch.utils.data.Dataset", "line_number": 10, "usage_type": "name" }, { "api_name": "torchvision.transforms.ToPILImage", "line_number": 23, "usage_type": "call" } ]
776601757
from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By from selenium.common import exceptions from pprint import pprint chro...
Karamba278/parsing
DZ5/mvideo_v1.py
mvideo_v1.py
py
1,734
python
en
code
0
github-code
6
[ { "api_name": "selenium.webdriver.chrome.options.Options", "line_number": 9, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 12, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 12, "usage_type": "name" }, { ...
31183148641
from django.db import models from django.db.models import ( Model, DateTimeField) from users.models import User class TrackableDate(Model): created_at = DateTimeField(auto_now_add=True) class Meta: abstract = True class Post(TrackableDate): title = models.CharField(max_length=255) link...
myrza256/hackernews
core/models.py
models.py
py
1,290
python
en
code
0
github-code
6
[ { "api_name": "django.db.models.Model", "line_number": 8, "usage_type": "name" }, { "api_name": "django.db.models.DateTimeField", "line_number": 9, "usage_type": "call" }, { "api_name": "django.db.models.CharField", "line_number": 16, "usage_type": "call" }, { "ap...
43085034741
#!/bin/env python """ Program to manage and run ATS demo problems. With inspiration, and in some places just stolen, from Ben Andre's PFloTran regression test suite. Author: Ethan Coon (ecoon@lanl.gov) """ from __future__ import print_function import sys,os import argparse import textwrap import time try: impor...
amanzi/ats
tools/testing/run_demos.py
run_demos.py
py
6,110
python
en
code
35
github-code
6
[ { "api_name": "sys.path.append", "line_number": 20, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number...
27102970019
from typing import Tuple import jax.numpy as jnp import numpy as np def aggregate_marg_utils_and_exp_values( value_state_choice_specific: jnp.ndarray, marg_util_state_choice_specific: jnp.ndarray, reshape_state_choice_vec_to_mat: np.ndarray, taste_shock_scale: float, income_shock_weights: jnp.nda...
OpenSourceEconomics/dcegm
src/dcegm/egm/aggregate_marginal_utility.py
aggregate_marginal_utility.py
py
3,627
python
en
code
15
github-code
6
[ { "api_name": "jax.numpy.ndarray", "line_number": 8, "usage_type": "attribute" }, { "api_name": "jax.numpy", "line_number": 8, "usage_type": "name" }, { "api_name": "jax.numpy.ndarray", "line_number": 9, "usage_type": "attribute" }, { "api_name": "jax.numpy", ...
20613810393
import openai from io import BytesIO #样式美化 import streamlit as st # 添加博客链接 st.markdown(""" <a href="https://yang1he.gitee.io" target="_blank">作者链接</a> """, unsafe_allow_html=True) import streamlit as st keys = ["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", "sk-orXLIhBsR4f4tfhHasPgT3BlbkFJbUjpyP...
nmhjklnm/chatpgt2
version2/main.py
main.py
py
3,233
python
en
code
3
github-code
6
[ { "api_name": "streamlit.markdown", "line_number": 8, "usage_type": "call" }, { "api_name": "openai.api_key", "line_number": 28, "usage_type": "attribute" }, { "api_name": "openai.ChatCompletion.create", "line_number": 29, "usage_type": "call" }, { "api_name": "op...
40954153933
import os.path import secrets from artifact_hub import s3_hub from artifact_hub import S3Backend def test_hub_initialization_s3_hub(): folder = "folder" object_id = f"object_{secrets.token_hex(3)}" bucket_name = "iamr0b0tx-development" hub = s3_hub(bucket_name, folder, object_id) assert isinstan...
robotstech/artifact-hub
tests/test_s3_hub.py
test_s3_hub.py
py
1,025
python
en
code
0
github-code
6
[ { "api_name": "secrets.token_hex", "line_number": 10, "usage_type": "call" }, { "api_name": "artifact_hub.s3_hub", "line_number": 13, "usage_type": "call" }, { "api_name": "artifact_hub.S3Backend", "line_number": 14, "usage_type": "argument" }, { "api_name": "secr...
34946528621
import socket import os import yaml import jwt HOST, PORT = '0.0.0.0', 8091 listen_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) listen_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 3) listen_socket.bind((HOST, PORT)) listen_socket.listen(3) listen_socket.setblocking(0) socketList=[] print('S...
shreyaghate02/http-server
mainweb-server.py
mainweb-server.py
py
7,177
python
en
code
0
github-code
6
[ { "api_name": "socket.socket", "line_number": 8, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 8, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREAM", "line_number": 8, "usage_type": "attribute" }, { "api_name": "socket.SOL_SOC...
13204097862
# Python libs import collections import os import json import logging # Maya import maya.cmds as cmds from maya.api import OpenMaya as om # Cortex from ..api import component from ..api import environment # Logger log = logging.getLogger(__name__) log.setLevel(logging.INFO) class Control(object): """ Funct...
GitHGuillaumeG/DEV
cortex/rigobject/control.py
control.py
py
14,121
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 17, "usage_type": "attribute" }, { "api_name": "maya.cmds.objExists", "line_number": 47, "usage_type": "call" }, { "api_name": "maya.cmds", ...
12575240346
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import re, time, os, joblib from tqdm.notebook import trange, tqdm from nltk.corpus import stopwords from nltk.stem.snowball import SnowballStemmer from nltk.stem import PorterStemmer, WordNetLemmatizer from tqdm.notebook imp...
JiggyJimenez/jiggyjimenez.github.io
K-Drama XAI Project/kdu.py
kdu.py
py
23,853
python
en
code
0
github-code
6
[ { "api_name": "warnings.filterwarnings", "line_number": 71, "usage_type": "call" }, { "api_name": "IPython.display.display_html", "line_number": 78, "usage_type": "call" }, { "api_name": "IPython.display.display_html", "line_number": 80, "usage_type": "call" }, { ...
5489557148
#!/usr/bin/env python """ Setup script for rinohtype """ import sys from setuptools import setup, find_packages if sys.version_info < (3, 3): print('rinohtype requires Python 3.3 or higher') sys.exit(1) def long_description(): import os base_path = os.path.dirname(os.path.abspath(__file__)) ...
rowhit/rinohtype
setup.py
setup.py
py
3,280
python
en
code
null
github-code
6
[ { "api_name": "sys.version_info", "line_number": 12, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_nu...
24834113846
""" Cluster the 2D PCA vectors uing kmean clustering - Please specify the number of clusters # Example run: cluster PCA singularity exec forgi-centroid-mea-final.simg python3 draw-kmeans-clusters.py --input_file COOLAIR3_R1_R2-forgi-pca.csv --tag COOLAIR3_R1_R2 --num_clusters 3 """ import matplotlib as mpl m...
DingLab-RNAstructure/smStructure-seq
draw-kmeans-clusters.py
draw-kmeans-clusters.py
py
4,645
python
en
code
4
github-code
6
[ { "api_name": "matplotlib.use", "line_number": 15, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 35, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 52, "usage_type": "call" }, { "api_name": "sklearn.cluste...
21341156863
#!/usr/bin/env python # -*- coding:utf-8 -*- # author: KrianJ # datetime:2022/5/7 14:01 # software: PyCharm-FFM_torch import torch import torch.nn as nn import torch.nn.functional as F class FFM_Layer(nn.Module): def __init__(self, dense_features, sparse_features, sparse_feature_dim, k: int): ...
KrianJ/CtrEstimate
models_torch/FFM.py
FFM.py
py
2,349
python
en
code
0
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 12, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 12, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.nn", "line_nu...
33583672361
from flask import Flask from controller import blueprints from flask_cors import CORS import os __all__ = ('create_app',) def create_app(config=None, app_name='face-detection-UI'): """ Initializes the application and its utilities. """ app = Flask(app_name, template_folder=os.path.join('templates'),...
giobart/face-detection-UI
app.py
app.py
py
618
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "flask_cors.CORS", "line_num...
25926471732
''' Created on 08 May 2014 @author: Deon ''' from PyQt4.QtGui import QGroupBox as QGroupBox from PyQt4.QtGui import QFileDialog from Output.AsciiGUI import Ui_Ascii from mylib import ProgressBar import numpy as np import sys import os import zipfile from shutil import copy2 class AsciiDEF(QGroupBox)...
Deon-Marais/ScanManipulator
Output/AsciiDEF.py
AsciiDEF.py
py
16,377
python
en
code
0
github-code
6
[ { "api_name": "PyQt4.QtGui.QGroupBox", "line_number": 18, "usage_type": "name" }, { "api_name": "PyQt4.QtGui.QGroupBox.__init__", "line_number": 20, "usage_type": "call" }, { "api_name": "PyQt4.QtGui.QGroupBox", "line_number": 20, "usage_type": "name" }, { "api_na...
18051477859
import asyncio import discord from discord.ext.commands import Bot from discord.ext import commands from discord import Color, Embed from MinecraftServer import MinecraftServer Client = discord.Client() bot = commands.Bot(command_prefix = "!") bot.remove_command("help") with open("ip.txt", "r") as f: lines = ...
DaleNaci/Aqua-Bot
bot/Main.py
Main.py
py
1,322
python
en
code
0
github-code
6
[ { "api_name": "discord.Client", "line_number": 11, "usage_type": "call" }, { "api_name": "discord.ext.commands.Bot", "line_number": 12, "usage_type": "call" }, { "api_name": "discord.ext.commands", "line_number": 12, "usage_type": "name" }, { "api_name": "Minecraf...
12500001115
#!/usr/bin/env python import sys import threading import ipaddress from scapy.all import ICMP, IP, sr1 from queue import Queue if len(sys.argv) < 2: print("Usage: icmping <host> [icmp_type] [icmp_code]\n") print("eg: icmping 192.168.56.0/24") print("eg: icmping 192.168.56.0/24 13 0") print("eg: icmpin...
c4pr1c3/cuc-ns-ppt
attach/chap0x05/icmping.py
icmping.py
py
1,599
python
en
code
22
github-code
6
[ { "api_name": "sys.argv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 17, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 18,...
16645091989
# !/usr/bin/python # -*- coding: utf-8 -*- """ __author__ = 'qing.li' """ import xlrd from xlutils.copy import copy # 单元格需要设置为文本类型 class OperaExcel: def __init__(self, file_path=None, i=None): if not file_path: self.file_path = "../excel/key_word.xlsx" else: self.file_path ...
QingqinLi/ui_project
util/opera_excel.py
opera_excel.py
py
1,267
python
en
code
0
github-code
6
[ { "api_name": "xlrd.open_workbook", "line_number": 25, "usage_type": "call" }, { "api_name": "xlutils.copy.copy", "line_number": 41, "usage_type": "call" } ]
31612534442
import telebot import pandas as pd from templates import * import requests ROOT_FOLDER = '' API_KEY = 'YOUR TOKEN' bot = telebot.TeleBot(API_KEY) def save_chat_id(chat_id, latitude=0.0, longitude=0.0): try: df_chats = pd.read_csv(f"{ROOT_FOLDER}/resources/chats.csv") if not df_chats.isin([chat_id]...
rakhmatov-dev/iss_location_bot
main.py
main.py
py
2,978
python
en
code
0
github-code
6
[ { "api_name": "telebot.TeleBot", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.concat", "...
35959582623
import sys import numpy as np from lib.robot_mod import Car, Robot from lib.vo import VelocityObstacle from lib.path_planner import DubinsPathPlanner from lib.motion_controller import * from pygame_animation import Screen def main_robots(): screen = Screen(scale=20) robots = init_robots() run = True ...
kentamt/mapf_playground
run_turtlebot_example.py
run_turtlebot_example.py
py
3,485
python
en
code
1
github-code
6
[ { "api_name": "pygame_animation.Screen", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 58, "usage_type": "call" }, { "api_name": "lib.vo.VelocityObstacle", "line_number": 66, "usage_type": "call" }, { "api_name": "lib.robot_mo...
74285388027
import sys sys.path.append('../python') sys.path.append('../apps') import needle as ndl import numpy as np import torch import torch.nn as nn from d2l import torch as d2l import math class MultiHeadAttention(nn.Module): """MultiHeadAttention""" def __init__(self, key_size, query_size, value_size, num_hiddens, ...
Erostrate9/needle
tests/TransformerDecoder.py
TransformerDecoder.py
py
28,334
python
en
code
2
github-code
6
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_numbe...
28031017443
import torch import sys sys.path.append('/home/kargarisaac/codes/deepdrive-zero/') from deepdrive_zero.constants import COMFORTABLE_STEERING_ACTIONS, \ COMFORTABLE_ACTIONS resume = True gamma = 0.99 batch_size = 32 #number of sequences to select lr = 1e-4 initial_exploration = 2e3 # each one has n_envs sample ->...
kargarisaac/R2D2
config.py
config.py
py
1,624
python
en
code
2
github-code
6
[ { "api_name": "sys.path.append", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "torch.device", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", ...
41791335734
import cv2 as cv from gtts import gTTS import os,sys,subprocess import RPi.GPIO as GPIO # Import Raspberry Pi GPIO library from OCR.SceneOCR import SceneOCR from OCR.DocScanner import DocScanner from OCR.DocOCR import DocOCR from SceneDescribe.Depth import SceneDescribe import os image_path="InputImages/camera_image_...
TheNova22/OurVision
legacy2/b2.py
b2.py
py
4,813
python
en
code
null
github-code
6
[ { "api_name": "cv2.dnn.readNet", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2.dnn", "line_number": 17, "usage_type": "attribute" }, { "api_name": "cv2.dnn.readNet", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.dnn", "line_numb...
73083660027
import numpy as np import matplotlib.pyplot as plt # height (cm) X = np.array([[147, 150, 153, 158, 163, 165, 168, 170, 173, 175, 178, 180, 183]]).T # weight (kg) y = np.array([[ 49, 50, 51, 54, 58, 59, 60, 62, 63, 64, 66, 67, 68]]).T # plt.show() one = np.ones((X.shape[0], 1)) Xbar = np.concatenate((one, X), axis=...
cuongdd2/cs582
linear_regression.py
linear_regression.py
py
764
python
en
code
0
github-code
6
[ { "api_name": "numpy.array", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.concatenate", "line_number...
25873728905
import copy import os import yaml from moonship.core.error import ConfigException from typing import ItemsView, Iterator, KeysView, Union __all__ = [ "Config", "ConfigItemsView" ] def convert_config_value(value: any, parent_key: str, key: str) -> any: if isinstance(value, dict): value = Config(v...
mpaulse/moonship
moonship/core/config.py
config.py
py
3,500
python
en
code
3
github-code
6
[ { "api_name": "typing.ItemsView", "line_number": 22, "usage_type": "name" }, { "api_name": "typing.Iterator", "line_number": 37, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 37, "usage_type": "name" }, { "api_name": "typing.Union", "lin...
22505082209
import nltk import json # Dev mode dev = False def chomp(x): if x.endswith("\r\n"): return x[:-2] if x.endswith("\n") or x.endswith("\r"): return x[:-1] return x def filt(x): return x.label()=='JP' class SimplePPDB(object): def __init__(self): # each key in self is a token, and each...
klabarbara/ppdb
SimplePPDB.py
SimplePPDB.py
py
5,609
python
en
code
0
github-code
6
[ { "api_name": "nltk.word_tokenize", "line_number": 93, "usage_type": "call" }, { "api_name": "nltk.pos_tag", "line_number": 94, "usage_type": "call" }, { "api_name": "json.load", "line_number": 170, "usage_type": "call" } ]
16514333784
import time import requests import pandas as pd from itertools import groupby #takes a string address and returns longitude, latitude and score tuple def adresse_to_lon_lat(adresse): url = "https://api-adresse.data.gouv.fr/search" response = requests.get(url, params = {'q': adresse, 'limit': '1'}) result ...
ghassenabdedayem/real_estate
Immo/First_model/geo_processing.py
geo_processing.py
py
3,108
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 18, "usage_type": "call" }, { "api_name": "time.time", "line_number": 41, "usage_type": "call" }, { "api_name": "time.time", "line_number":...
11257156561
from copy import deepcopy from Generator import * from Representation import * from collections import defaultdict class Kosaraju: def __init__(self, vertex,prob=0, head=False): self.V = vertex self.graph = defaultdict(list) self.result=[] self.repres = None if head : self....
kryptoTomo/Graph-Calculator
src/Kosaraju.py
Kosaraju.py
py
2,099
python
en
code
0
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 10, "usage_type": "call" }, { "api_name": "Generator.rand_digraph_edge_probability", "line_number": 13, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 22, "usage_type": "call" } ]
22700263274
from segmentation.utils import animate2 import matplotlib.pyplot as plt import matplotlib.animation as animation from pathlib import Path import os if __name__ == '__main__': dataset = 'exp12' filename = 'Unet_resnet34.json' mean_cca = False path = os.path.join(Path(__file__).resolve().parent, 'logs',...
KochPJ/AutoPoseEstimation
segmentation/stream_logs.py
stream_logs.py
py
616
python
en
code
11
github-code
6
[ { "api_name": "os.path.join", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", ...
26471376961
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import datetime class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='User', fields=[ ('id', models.A...
marcusshepp/nine_oh_lb
registration/migrations/0001_initial.py
0001_initial.py
py
1,567
python
en
code
0
github-code
6
[ { "api_name": "django.db.migrations.Migration", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 8, "usage_type": "name" }, { "api_name": "django.db.migrations.CreateModel", "line_number": 14, "usage_type": "call" }, ...
24107221993
from __future__ import absolute_import import typing as t from marshmallow import Schema, post_dump, post_load from marshmallow.fields import ( Boolean, DateTime, Dict, Field, Float, Integer, List, Nested, String, ) from marshmallow.schema import BaseSchema, SchemaMeta, with_metacl...
Kashif186/python-eccomerce-testing
myenv/Lib/site-packages/applitools/selenium/schema.py
schema.py
py
20,049
python
en
code
1
github-code
6
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 56, "usage_type": "attribute" }, { "api_name": "marshmallow.schema.with_metaclass", "line_number": 63, "usage_type": "call" }, { "api_name": "marshmallow.schema.SchemaMeta", "line_number": 63, "usage_type": "argument" ...
29343753537
import numpy as np import random from collections import namedtuple from math import sqrt from vec3 import Vec3 class Ray: def __init__(self, origin: Vec3, arrow: Vec3): self.origin = origin self.arrow = arrow.unity() class Camera: def __init__(self, scr_w, scr_h, msaa=1): random.se...
hdtx/raytracer-comparison
py/raytracer.py
raytracer.py
py
3,715
python
en
code
0
github-code
6
[ { "api_name": "vec3.Vec3", "line_number": 10, "usage_type": "name" }, { "api_name": "random.seed", "line_number": 17, "usage_type": "call" }, { "api_name": "vec3.Vec3", "line_number": 28, "usage_type": "call" }, { "api_name": "vec3.Vec3", "line_number": 29, ...
74521869627
# Importing necessary modules from SQLAlchemy from sqlalchemy import create_engine, Column, Integer, String from sqlalchemy.orm import declarative_base, sessionmaker # Set up SQLAlchemy Engine and Session engine = create_engine("mysql://cf-python:password@localhost/my_database") Session = sessionmaker(bind=engine) ses...
philippeducasse/python-intro
Achievement-1/1.7/recipe_app.py
recipe_app.py
py
8,648
python
en
code
0
github-code
6
[ { "api_name": "sqlalchemy.create_engine", "line_number": 6, "usage_type": "call" }, { "api_name": "sqlalchemy.orm.sessionmaker", "line_number": 7, "usage_type": "call" }, { "api_name": "sqlalchemy.orm.declarative_base", "line_number": 10, "usage_type": "call" }, { ...
72937565307
import logging import os import re from collections import defaultdict from subprocess import Popen, PIPE from typing import List, Tuple, Union, Optional, Any import pandas as pd from refseq_masher.const import REGEX_FASTA, REGEX_FASTQ from .const import REGEX_FASTQ, REGEX_FASTA NT_SUB = {x: y for x, y in zip('acgtr...
phac-nml/refseq_masher
refseq_masher/utils.py
utils.py
py
7,033
python
en
code
38
github-code
6
[ { "api_name": "typing.List", "line_number": 16, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 16, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 16, "usage_type": "name" }, { "api_name": "subprocess.PIPE", "line_nu...
447286576
import os import sys import math import click import dnnlib import numpy as np import PIL.Image import torch from torch import optim from torch.optim.lr_scheduler import StepLR import torch.nn as nn import legacy import pickle from tqdm import tqdm from typing import List, Optional, Tuple, Union try: import wandb e...
JueLin/stylegan3-texture-analysis-synthesis
train_encoder.py
train_encoder.py
py
5,560
python
en
code
0
github-code
6
[ { "api_name": "pickle.load", "line_number": 54, "usage_type": "call" }, { "api_name": "os.path.splitext", "line_number": 55, "usage_type": "call" }, { "api_name": "os.path", "line_number": 55, "usage_type": "attribute" }, { "api_name": "os.path.basename", "lin...
69958657149
from django.db import models from django.db.models.signals import pre_delete, m2m_changed from django.dispatch import receiver from utils.date_persian import date_fromgregorian from django.core.exceptions import ValidationError from deliver.models import Deliver import logging # Create your models here. logger = log...
amiravtar/restaurant_management
webapp_restuarant/order/models.py
models.py
py
9,913
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "django.db.models.Model", "line_number": 15, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 15, "usage_type": "name" }, { "api_name": "django...
12860595547
import editor import re import datetime def stat(): res = "По состоянию на " + str(datetime.datetime.now().time()) + " " + str(datetime.datetime.now().date()) + "\n\n" ed = editor.Editor("Википедия:Статьи года/2014/Голосование") data = ed.get_text() tmp_list = re.findall("[^=]==[^=]+==[^=]", data) ...
daoh/wp
yeararticle.py
yeararticle.py
py
2,336
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 6, "usage_type": "attribute" }, { "api_name": "editor.Editor", "line_number": 7, "usage_type": "call" }, { "api_name": "re.findall", ...
33273208633
import urllib.parse import requests main_api = "http://www.mapquestapi.com/directions/v2/route?" orig = "Kiev" dest = "London" key = "nx6L2yvG2qBBYY9c###nB4RXshWv4vTitHu" url = main_api + urllib.parse.urlencode({"key": key, "from":orig, "to":dest}) print(url) json_data = requests.get(url).json() print(json_data)
dev8psST/netacad_dev_net
08_parse-json1.py
08_parse-json1.py
py
316
python
en
code
0
github-code
6
[ { "api_name": "urllib.parse.parse.urlencode", "line_number": 9, "usage_type": "call" }, { "api_name": "urllib.parse.parse", "line_number": 9, "usage_type": "attribute" }, { "api_name": "urllib.parse", "line_number": 9, "usage_type": "name" }, { "api_name": "reques...
12062187410
# /usr/bin/env python welcomeText = '''# # hire.vladimir@gmail.com # # allow regex matches on MV fields + passing in regex values via field/token # # rev. history # 10/20/15 1.0 initial write # ''' import time, os, re import logging, logging.handlers import splunk.Intersplunk as si ####################################...
hire-vladimir/SA-cim_vladiator
bin/mvrex.py
mvrex.py
py
5,909
python
en
code
70
github-code
6
[ { "api_name": "logging.INFO", "line_number": 21, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 29, "usage_type": "call" }, { "api_name": "logging.NullHandler", "line_number": 31, "usage_type": "call" }, { "api_name": "re.match", ...
16705574064
from countdown.models import Word import os import django # Calculate the path to your Django project's settings module project_directory = os.path.dirname(os.path.abspath(__file__)) settings_module = 'countdown_game.settings' django_settings_module = f"{project_directory}/{settings_module}" # Set the DJANGO_SETTINGS...
Chikitonik/DI_Bootcamp
Week_13_PY/Day5/exercises_xp/countdown_game/countdown_game/save_words.py
save_words.py
py
930
python
en
code
0
github-code
6
[ { "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": "os.environ.setdefault", ...
30354297701
from os.path import abspath from io import BytesIO import copy import numpy as np import unittest # Enthought library imports from mayavi.core.null_engine import NullEngine from mayavi.filters.contour import Contour from mayavi.filters.optional import Optional from mayavi.filters.collection import Collection from maya...
enthought/mayavi
mayavi/tests/test_optional_collection.py
test_optional_collection.py
py
4,503
python
en
code
1,177
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 18, "usage_type": "attribute" }, { "api_name": "mayavi.core.null_engine.NullEngine", "line_number": 22, "usage_type": "call" }, { "api_name": "mayavi.tests.datasets.generateStructuredGrid", "line_number": 29, "usage_type":...
8780836707
import json import os import re import subprocess from contextlib import contextmanager from datetime import datetime # import schedule @contextmanager def chdir(path): """Change working directory to `path` and restore it again This context manager is useful if `path` stops existing during your operation...
andersy005/hpc-tools
scheduled-workflows/glade-catalog-update.py
glade-catalog-update.py
py
2,884
python
en
code
0
github-code
6
[ { "api_name": "os.getcwd", "line_number": 17, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 18, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 22, "usage_type": "call" }, { "api_name": "contextlib.contextmanager", "line_num...
14995444175
from django.conf.urls import url from .views import * app_name="education" urlpatterns=[ url(r'^register/$',register,name="register"), url(r'^login/$',login,name="login"), url(r'^index/$',index,name="index"), url(r'^courses/$',courses,name="courses"), url(r'^coursesingle/(\d+)/$',coursesingle,name...
pan0527/chenpan
demo4/apps/education/urls.py
urls.py
py
1,055
python
en
code
0
github-code
6
[ { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "django.co...
20896144834
import argparse from typing import Tuple import tensorflow as tf import numpy as np import pickle import math import cv2 import matplotlib.pyplot as plt from sklearn.metrics import auc from skimage.transform import resize from sklearn.metrics import confusion_matrix from sklearn.metrics import roc_curve, roc_auc_scor...
sanaullah-ashfat/tpu-imagenet-large
train.py
train.py
py
16,667
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 36, "usage_type": "call" }, { "api_name": "tensorflow.float32", "line_number": 64, "usage_type": "attribute" }, { "api_name": "tensorflow.bfloat16", "line_number": 66, "usage_type": "attribute" }, { "api_name...
24886221719
from aiohttp.test_utils import unittest_run_loop from djaio.tests import DjaioAppTestCase from djaio.tests.data.models import TstOutput, TstPostInput from djaio.tests.data.views import TstInputView, TstInputDetailView class TestBaseMethod(DjaioAppTestCase): def init_routes(self, app): super().init_route...
domclick/djaio
djaio/tests/adv_test_methods_db.py
adv_test_methods_db.py
py
4,509
python
en
code
7
github-code
6
[ { "api_name": "djaio.tests.DjaioAppTestCase", "line_number": 8, "usage_type": "name" }, { "api_name": "djaio.tests.data.views.TstInputView", "line_number": 12, "usage_type": "argument" }, { "api_name": "djaio.tests.data.views.TstInputView", "line_number": 13, "usage_type"...
27592776052
import os import json import sys import time import threading import serial fr = open("config.json","r") data = json.load(fr) fr.close() recport=data['recport'] traport=data['traport'] fr = open("filedata.json","r") data = json.load(fr) fr.close() ser = serial.Serial() ser.baudrate=230400 ser.port=recport ser.open(...
eclubiitk/Li-Fi-E-Club
FTP v3.0 Dev/transnew.py
transnew.py
py
6,442
python
en
code
0
github-code
6
[ { "api_name": "json.load", "line_number": 9, "usage_type": "call" }, { "api_name": "json.load", "line_number": 16, "usage_type": "call" }, { "api_name": "serial.Serial", "line_number": 19, "usage_type": "call" }, { "api_name": "serial.Serial", "line_number": 2...
6778535251
import os import cleaning_and_normalizing as cleandnor import encoding_korbert as enc import keras as keras import numpy as np import pandas as pd import tensorflow as tf from keras.models import load_model from keras_bert import ( AdamWarmup, Tokenizer, calc_train_steps, load_trained_model_from_checkp...
aiffelthon-gal/gal
code/text2cls.py
text2cls.py
py
5,348
python
en
code
0
github-code
6
[ { "api_name": "encoding_korbert.make_table", "line_number": 23, "usage_type": "call" }, { "api_name": "encoding_korbert.load_data", "line_number": 25, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 32, "usage_type": "call" }, { "api_name"...
71712522427
import math import torch import torch.nn as nn import torch.nn.functional as F from typing import Tuple from .utils import initialize_tensor __all__ = [ "Conv2d", "Conv2d_Bezier", "Conv2d_BatchEnsemble", "Conv2d_BatchEnsembleV2", "Conv2d_Dropout", "Conv2d_SpatialDropout", "Conv2d_DropBlock...
cs-giung/giung2
giung2/layers/conv.py
conv.py
py
13,690
python
en
code
5
github-code
6
[ { "api_name": "torch.nn.Conv2d", "line_number": 20, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 20, "usage_type": "name" }, { "api_name": "torch.Tensor", "line_number": 28, "usage_type": "attribute" }, { "api_name": "math.ceil", "line...
3929117673
import random import string from typing import Optional, List from sqlalchemy.orm import Session from sqlalchemy.exc import MultipleResultsFound from src.data_access.database.models.users import UserEntity from src.common.models.library_management.account import Account from src.data_access.database.models.account_en...
mariusvrstr/PythonMicroservice
src/data_access/repositories/account_repository.py
account_repository.py
py
2,423
python
en
code
0
github-code
6
[ { "api_name": "src.data_access.repositories.base_repository.SqlAlchemyRelationalRepositoryBase", "line_number": 23, "usage_type": "name" }, { "api_name": "sqlalchemy.orm.Session", "line_number": 24, "usage_type": "name" }, { "api_name": "src.data_access.database.models.users.User...
8986358022
import pyproj def trans_coord(lon, lat): prj = pyproj.Transformer.from_crs(crs_from=4326, crs_to=3857, always_xy=True) xs, ys = prj.transform(lon, lat) return xs, ys if __name__ == "__main__": print(trans_coord(116.407718, 39.912721)) # 北京坐标
Clarmy/clarmy02
clarmy02/__init__.py
__init__.py
py
272
python
en
code
1
github-code
6
[ { "api_name": "pyproj.Transformer.from_crs", "line_number": 5, "usage_type": "call" }, { "api_name": "pyproj.Transformer", "line_number": 5, "usage_type": "attribute" } ]
21210872100
''' Practica 30 Generar un programa que permita al usuario ingresar una lista de entre 2 y 6 números enteros y mostrar todas las posibles permutaciones de la lista @utor: Francisco Zamora Saldaña Programación avanzada 2MM3 ''' from itertools import permutations print("Permutaciones de una lista") def nu...
FranciscoZS/PythonCode
practica30.py
practica30.py
py
1,371
python
es
code
0
github-code
6
[ { "api_name": "itertools.permutations", "line_number": 48, "usage_type": "call" } ]
72160444989
import tkinter import json # window size (fixed, but you can adjust here) H, W = 360, 640 def main(): root = tkinter.Tk() root.title('HexSlider') root.wm_resizable(0,0) # prevent resizing canv = BoardViewCanvas(root) # begin! root.mainloop() class Color: BG = "#663300" FG = "#ffd9b3"...
Dovermore/artificial_intelligence_project
artificial_idiot/tests/texgen.py
texgen.py
py
9,206
python
en
code
0
github-code
6
[ { "api_name": "tkinter.Tk", "line_number": 8, "usage_type": "call" }, { "api_name": "tkinter.Canvas", "line_number": 36, "usage_type": "attribute" }, { "api_name": "tkinter.Entry", "line_number": 65, "usage_type": "call" }, { "api_name": "tkinter.Entry", "line...
44305428675
from model.transformer import Summarizer from model.common_layer import evaluate from utils import config import torch import torch.nn as nn import torch.nn.functional as F from tqdm import tqdm import os import time import numpy as np from utils.data import get_dataloaders, InputExample, InputFeatures def count_par...
nayeon7lee/bert-summarization
main.py
main.py
py
1,942
python
en
code
121
github-code
6
[ { "api_name": "model.transformer.parameters", "line_number": 14, "usage_type": "call" }, { "api_name": "model.transformer", "line_number": 14, "usage_type": "name" }, { "api_name": "utils.data.get_dataloaders", "line_number": 17, "usage_type": "call" }, { "api_nam...