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
38011177201
import os import sys import argparse from glob import glob import re from RL4MT.core.config import * parser = argparse.ArgumentParser("Batch Validation") parser.add_argument('-c', '--config') parser.add_argument('-d', '--device', default='cpu') parser.add_argument('-m', '--model_dir') parser.add_argument('-s', '--sou...
joelau94/RL4MT
v170117/RL4MT/experiment/batchvalid.py
batchvalid.py
py
1,291
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 25, "usage_type": "call" }, { "api_name": "os.system", "line_number": 37, "usage_type": "call" }, { "api_name": "os.system", "line_numb...
5395976305
from PySide6.QtWidgets import (QApplication, QMainWindow, QPushButton, QPlainTextEdit, QVBoxLayout, QWidget, QProgressBar) from PySide6.QtCore import QProcess import re progress_re = re.compile("Total complete: (\d+)%") def simple_percent_parser(output): m = progress_re.search(outp...
flyfire/learning-qt
pyside6-tutorial/app9.py
app9.py
py
2,419
python
en
code
0
github-code
21
[ { "api_name": "re.compile", "line_number": 6, "usage_type": "call" }, { "api_name": "PySide6.QtWidgets.QMainWindow", "line_number": 16, "usage_type": "name" }, { "api_name": "PySide6.QtWidgets.QPushButton", "line_number": 22, "usage_type": "call" }, { "api_name": ...
41784380935
from typing import Optional, Union import numpy as np import torch def onehot2int(array: np.ndarray) -> np.ndarray: """Convert (possibly) one-hot encoded labels to integers. If the array is not one-hot encoded, then the array is returned. Args: array (np.ndarray): Array to convert. np.ndarray of...
HLasse/data-centric-synthetic-data
src/data_centric_synth/dataiq/numpy_helpers.py
numpy_helpers.py
py
2,306
python
en
code
1
github-code
21
[ { "api_name": "numpy.ndarray", "line_number": 7, "usage_type": "attribute" }, { "api_name": "numpy.argmax", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.ndarray", "line_number": 23, "usage_type": "attribute" }, { "api_name": "numpy.ndarray", ...
30637758170
""" Solution for 140. Word Break II https://leetcode.com/problems/word-break-ii/ """ from functools import lru_cache from typing import List class Solution: """ Runtime: 48 ms, faster than 71.25% of Python3 online submissions for Word Break II. Memory Usage: 13 MB, less than 100.00% of Python3 online submissions...
KKosukeee/CodingQuestions
LeetCode/140_word_break_II.py
140_word_break_II.py
py
2,075
python
en
code
0
github-code
21
[ { "api_name": "typing.List", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 60, "usage_type": "name" }, { "api_name": "functools.lru_cache", "line_number": 71, "usage_type": "call" } ]
33397138654
import logging import os import os.path import random # clique import clique import clique.isc import clique.event from clique import web from clique import runtime from clique.web import endpoint from clique.util import Timer # ambiency import ambiency from ambiency import actuators from ambiency import build_actuat...
thenaran/hue
app/main.py
main.py
py
5,123
python
en
code
0
github-code
21
[ { "api_name": "phue.AllLights", "line_number": 33, "usage_type": "call" }, { "api_name": "clique.web.endpoint", "line_number": 37, "usage_type": "call" }, { "api_name": "clique.web.endpoint", "line_number": 48, "usage_type": "call" }, { "api_name": "clique.web.end...
604715081
import os import sys import json import time NODES = sc._jsc.sc().getExecutorMemoryStatus().size() print(f"NODES: {NODES}") w_path = os.path.abspath(__file__) print(w_path) sc.setLocalProperty("spark.databricks.devbricks.path", w_path) sc.setLocalProperty("spark.databricks.devbricks.project_dir", os.path.dirname(w_p...
deka108/user-custom-module
main.py
main.py
py
2,514
python
en
code
0
github-code
21
[ { "api_name": "os.path.abspath", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number...
46870934394
from puzzle import PuzzleContext from collections import OrderedDict DIRS = OrderedDict( N=(0, +1), W=(-1, 0), S=(0, -1), E=(+1, 0), ) def rotate_left(direction, amnt): if amnt == 0: return direction directions = list(DIRS) i = directions.index(direction) i = (i + 1) % len(dire...
vstrimaitis/aoc-2020
12/sol.py
sol.py
py
1,822
python
en
code
0
github-code
21
[ { "api_name": "collections.OrderedDict", "line_number": 4, "usage_type": "call" }, { "api_name": "puzzle.PuzzleContext", "line_number": 51, "usage_type": "call" } ]
41721488826
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Aug 19 20:07:56 2019 @author: leon """ import numpy as np import pandas as pd import matplotlib.pyplot as plt np.set_printoptions(threshold=np.inf) # ============================================================================= # The starting sta...
katakoruma/monopoly-probabilities-of-stay
Monopoly.py
Monopoly.py
py
1,563
python
en
code
0
github-code
21
[ { "api_name": "numpy.set_printoptions", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.inf", "line_number": 12, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "line_number": 27, "usage_type": "call" }, { "api_name": "pandas.read_excel",...
73755234293
import streamlit as st import pandas as pd import numpy as np import design import database api_key='AIzaSyAAgRZSfn5osPVOWWpYkFC1Asp_y1-lsco' channel_name='' channel_id = '' global channel_df st.title('Scrape the YOUTUBE Data') channel_name = st.text_input('Enter the Youtube channel',placeholder='yout...
Yogeshmoorthy/youtube_harvesting
🏡Home.py
🏡Home.py
py
2,034
python
en
code
0
github-code
21
[ { "api_name": "streamlit.title", "line_number": 14, "usage_type": "call" }, { "api_name": "streamlit.text_input", "line_number": 15, "usage_type": "call" }, { "api_name": "streamlit.session_state", "line_number": 17, "usage_type": "attribute" }, { "api_name": "str...
42372363826
import pwn elf = pwn.ELF("./bof103") p = elf.process() pwn.context.log_level="DEBUG" pr = pwn.remote("127.0.0.1", 5000) system_addr = elf.symbols['system'] useme_addr = elf.symbols['useme'] pop_rdi = rop.rdi.address pop_rsi = rop.rsi.address print(pop_rdi) payload = b"a"*24 # 16 bytes of char payloa...
olegunza/SSTF2023
PWN/BOF103/bof103_solve.py
bof103_solve.py
py
976
python
en
code
0
github-code
21
[ { "api_name": "pwn.ELF", "line_number": 3, "usage_type": "call" }, { "api_name": "pwn.context", "line_number": 5, "usage_type": "attribute" }, { "api_name": "pwn.remote", "line_number": 6, "usage_type": "call" }, { "api_name": "pwn.p64", "line_number": 17, ...
10064522412
from pyircbot.modulebase import ModuleBase, ModuleHook import datetime import time import math class Calc(ModuleBase): def __init__(self, bot, moduleName): ModuleBase.__init__(self, bot, moduleName) self.hooks = [ModuleHook("PRIVMSG", self.calc)] self.timers = {} self.sqlite = s...
dpedu/pyircbot3
pyircbot/modules/Calc.py
Calc.py
py
12,765
python
en
code
0
github-code
21
[ { "api_name": "pyircbot.modulebase.ModuleBase", "line_number": 8, "usage_type": "name" }, { "api_name": "pyircbot.modulebase.ModuleBase.__init__", "line_number": 10, "usage_type": "call" }, { "api_name": "pyircbot.modulebase.ModuleBase", "line_number": 10, "usage_type": "...
23934692256
# # @lc app=leetcode id=1302 lang=python3 # # [1302] Deepest Leaves Sum # # https://leetcode.com/problems/deepest-leaves-sum/description/ # # algorithms # Medium (84.10%) # Likes: 1224 # Dislikes: 56 # Total Accepted: 97.2K # Total Submissions: 114K # Testcase Example: '[1,2,3,4,5,null,6,7,null,null,null,null,8]...
ciwyw2/leetcode-20
python/1302.deepest-leaves-sum.py
1302.deepest-leaves-sum.py
py
1,759
python
en
code
null
github-code
21
[ { "api_name": "collections.deque", "line_number": 57, "usage_type": "call" } ]
5158112974
import cv2 import numpy import matplotlib import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas import os # import gflags import gflags import sys import time import subprocess gflags.DEFINE_string("input_dir", ""...
iskwak/DetetctingActionStarts
figures/make_movie.py
make_movie.py
py
6,422
python
en
code
9
github-code
21
[ { "api_name": "gflags.DEFINE_string", "line_number": 14, "usage_type": "call" }, { "api_name": "gflags.DEFINE_string", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 19, "usage_type": "call" }, { "api_name": "ma...
25844355625
# coding=utf-8 '''服务信息''' import uuid from flask import request from flask.blueprints import Blueprint from base import ApiHelper from ext import conf, log # 蓝图对象 bp = Blueprint('index', __name__) # 蓝图url前缀 url_prefix = '' @bp.route("/", methods=["GET"]) @ApiHelper.api_get_args_parser(None) def api_index(): "...
micelle-bookmark/micelle-server-python
app/views/index.py
index.py
py
698
python
en
code
1
github-code
21
[ { "api_name": "flask.blueprints.Blueprint", "line_number": 13, "usage_type": "call" }, { "api_name": "ext.conf.config", "line_number": 25, "usage_type": "attribute" }, { "api_name": "ext.conf", "line_number": 25, "usage_type": "name" }, { "api_name": "ext.conf.con...
21288835240
from PIL import Image, ImageDraw, ImageFont from uuid import uuid4 from random import randint import os import textwrap class MemeEngine: """ A class that creates a meme using quotes.""" def __init__(self, outputDir): """ Initialization of parameters. :param outputDir: Output location. :return: None "...
nesspll/memegenerator
MemeEngine/MemeEngine.py
MemeEngine.py
py
1,342
python
en
code
0
github-code
21
[ { "api_name": "PIL.Image.open", "line_number": 32, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 32, "usage_type": "name" }, { "api_name": "random.randint", "line_number": 37, "usage_type": "call" }, { "api_name": "PIL.Image.NEAREST", "line...
9073609715
import os import itertools import logging import matplotlib.pyplot as plt plt.style.use(os.path.join(os.path.dirname(__file__), 'mpl_style')) # noqa from matplotlib.pyplot import setp import numpy as np """ Mostly taken from https://bitbucket.org/aadfreiburg/plotting_scripts """ def plot_scatter_plot(x_data, y_da...
timothyyu/ml_monorepo
CAVE/cave/plot/scatter.py
scatter.py
py
12,634
python
en
code
59
github-code
21
[ { "api_name": "matplotlib.pyplot.style.use", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 6, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 6, "usage_type": "name" }, { "api_name"...
22276651750
import torch from sklearn import linear_model, model_selection import numpy as np from .base import BaseEvaluator import os import torch.nn as nn import torch.nn.functional as F from tqdm import tqdm, trange from torch.utils.data import Subset, DataLoader from torchvision.models import resnet18 from .base import BaseEv...
NNHieu/unlearning-eval
unlearn_eval/evaluators/attack_based.py
attack_based.py
py
10,228
python
en
code
0
github-code
21
[ { "api_name": "numpy.array", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 44, "usage_type": "call" }, { "api_name": "numpy.all", "line_number": 45, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 4...
36522555502
from pyvi import ViTokenizer import pandas as pd from keras.preprocessing.sequence import pad_sequences import numpy as np import pickle import matplotlib.pyplot as plt def save_vocabulary(path, vocabulary, word_to_num, num_to_word): data = {'vocabulary': vocabulary, 'word_to_num': word_to_num, ...
nducthang/Question-Similarity-in-Medical
src/CNN/utils.py
utils.py
py
2,450
python
en
code
1
github-code
21
[ { "api_name": "pickle.dump", "line_number": 14, "usage_type": "call" }, { "api_name": "pickle.HIGHEST_PROTOCOL", "line_number": 14, "usage_type": "attribute" }, { "api_name": "pickle.load", "line_number": 19, "usage_type": "call" }, { "api_name": "pyvi.ViTokenizer...
8064867877
import PySimpleGUI as sg import os from os.path import exists import cv2 import base64 import numpy as np import csv import pandas as pd CSV_NAME = "Labels.csv" def already_labeled(filename): if exists("./" + CSV_NAME): df = pd.read_csv(CSV_NAME, sep=",") return filename in df.iloc[:, 0].val...
hajo1038/KI_Projekt
Labeling_App/main.py
main.py
py
6,186
python
en
code
0
github-code
21
[ { "api_name": "os.path.exists", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 28, "usage_type": "call" }, { "api_name": "cv2.resize", "line_numb...
20599893881
#!/usr/bin/env python3 # Author: Jeffrey Grover # Purpose: Clean garbage from bed files in the chromosome ID fields # Created: 09/2018 from argparse import ArgumentParser def clean_bed(input_file, cleaner_sep): with open(input_file, 'r') as input_handle: for line in input_handle: entry = line...
groverj3/genomics_tools
bed_clean_chromosomes.py
bed_clean_chromosomes.py
py
912
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 20, "usage_type": "call" } ]
31251253026
# from .functional.conv import fd_convolve import typing as tp import equinox as eqx import finitediffx as fdx from jaxtyping import Array from jaxsw._src.fields.base import Field class Difference(eqx.Module): axis: int = eqx.static_field() accuracy: int = eqx.static_field() derivative: int = eqx.static_...
jejjohnson/jaxsw
jaxsw/_src/operators/fd.py
fd.py
py
5,049
python
en
code
4
github-code
21
[ { "api_name": "equinox.Module", "line_number": 10, "usage_type": "attribute" }, { "api_name": "equinox.static_field", "line_number": 11, "usage_type": "call" }, { "api_name": "equinox.static_field", "line_number": 12, "usage_type": "call" }, { "api_name": "equinox...
2250779801
from __future__ import annotations import os.path from pathlib import Path from config import settings def validate(path: Path): if not os.path.exists(path) and settings.debug: raise FileNotFoundError(path) elif os.path.exists(path): return path else: raise Exception("ValidationE...
OmmarShaikh01/EthChange
tool/__init__.py
__init__.py
py
881
python
en
code
0
github-code
21
[ { "api_name": "pathlib.Path", "line_number": 9, "usage_type": "name" }, { "api_name": "os.path.path.exists", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path", "line...
21471227918
from tkinter import * from tkinter import ttk from tkinter import filedialog, simpledialog from lcopt.utils import DEFAULT_DB_NAME, FORWAST_DB_NAME from lcopt import LcoptModel from brightway2 import * import os from pathlib import Path def check_databases(): return DEFAULT_DB_NAME in projects, FORWAST_DB_NAME i...
pjamesjoyce/rmflow
rmflow/bin/lcopt_launcher.py
lcopt_launcher.py
py
3,618
python
en
code
0
github-code
21
[ { "api_name": "lcopt.utils.DEFAULT_DB_NAME", "line_number": 13, "usage_type": "name" }, { "api_name": "lcopt.utils.FORWAST_DB_NAME", "line_number": 13, "usage_type": "name" }, { "api_name": "tkinter.simpledialog.askstring", "line_number": 23, "usage_type": "call" }, {...
24160959091
from django.urls import path from librarian import views urlpatterns = [ path('', views.home, name='librarian_home'), path('login/', views.login, name='librarian_login'), path('trackbook/',views.trackbook,name='librarian_trackbook'), path('trackstudent/',views.trackstudent,name='librarian_trackstudent')...
connectheshelf/connectheshelf
librarian/urls.py
urls.py
py
621
python
en
code
0
github-code
21
[ { "api_name": "django.urls.path", "line_number": 4, "usage_type": "call" }, { "api_name": "librarian.views.home", "line_number": 4, "usage_type": "attribute" }, { "api_name": "librarian.views", "line_number": 4, "usage_type": "name" }, { "api_name": "django.urls.p...
8050371384
# importing sql import sqlite3 # select function to show full contents of a table # primary key = Username def Select (cursor, query, args=()): cursor.execute(query, args) records = cursor.fetchall() print("Total rows are: ", len(records)) if len(records) > 0: for row in records: print(row) try: ...
hannaleung8/Culminating-2022-2023
database_table.py
database_table.py
py
2,429
python
en
code
0
github-code
21
[ { "api_name": "sqlite3.connect", "line_number": 33, "usage_type": "call" }, { "api_name": "sqlite3.Error", "line_number": 57, "usage_type": "attribute" }, { "api_name": "sqlite3.connect", "line_number": 66, "usage_type": "call" } ]
70349563894
import pandas as pd import matplotlib.pyplot as plt import numpy as np ##first task def csv_to_df(df='HAZI\HAZI04\StudentsPerformance.csv'): df_data= pd.read_csv(df, sep=',') return df_data ##second task def capitalize_columns(df: pd.DataFrame) -> pd.DataFrame: df_data_capitalized = df.copy() df_data...
makosteszta007/BEVADAT2022232
HAZI/HAZI04/HAZI04.py
HAZI04.py
py
3,039
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pandas.DataFrame", "line_number": 14, "usage_type": "attribute" }, { "api_name": "pandas.Data...
35746245542
# app.py from flask import Flask, jsonify, request, render_template from random import randint app = Flask(__name__) @app.route('/hello', methods=['GET', 'POST']) def hello(): # POST request if request.method == 'POST': print('Incoming..') print(request.get_json()) # parse as J...
kalh47/news-stance-detector
My Chrome Extension/testrandom.py
testrandom.py
py
668
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 12, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 12, "usage_type": "name" }, { "api_name": "flask.request.get_...
10501276191
from flask import Flask,render_template,request from selenium import webdriver from urllib.request import urlopen,Request,urlretrieve from time import sleep import os import json from PIL import Image app = Flask(__name__) options = webdriver.ChromeOptions() options.add_experimental_option('excludeSwitc...
programmingninjas/profile-picture-downloader
app.py
app.py
py
2,911
python
en
code
1
github-code
21
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 11, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 11, "usage_type": "name" }, { "api_name": "os.get...
72546301814
import os import glob from pathlib import Path import utilities from read_config import read_config from parse_vcf import parse_vcf class alignment(object): # Reference file as to be reference.fasta or reference.fa # Sequence files must be sequences (paired end) files (PATH_TO_SEQUNCES)/*P.fq.gz (coming f...
baribefe/pySNPCallingPipeline
pysnpcall/alignment.py
alignment.py
py
8,745
python
en
code
0
github-code
21
[ { "api_name": "read_config.read_config", "line_number": 17, "usage_type": "call" }, { "api_name": "os.system", "line_number": 64, "usage_type": "call" }, { "api_name": "os.system", "line_number": 66, "usage_type": "call" }, { "api_name": "glob.glob", "line_num...
11161875726
from django.urls import path from reports import views urlpatterns = [ path("", views.reports_landing_page, name="Reports_Page"), path("taskTimers/", views.task_timer_reports, name='Task_Timer_Reports'), path("admin/", views.admin_reports_page, name='Admin_Reports'), path("admin/taskTimes", views.full...
timotiousPrime/MacTrack
reports/urls.py
urls.py
py
456
python
en
code
0
github-code
21
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "reports.views.reports_landing_page", "line_number": 6, "usage_type": "attribute" }, { "api_name": "reports.views", "line_number": 6, "usage_type": "name" }, { "api_name": "d...
29620545347
from uuid import uuid4 import aiofiles from fastapi import UploadFile, HTTPException async def save_photo( title: str, file: UploadFile, ): file_name = f'../media/poster_book/{uuid4()}.jpg' if file.content_type.split('/')[0] == 'image': await write_image(file_name, file) else: ...
kindevelopment/FastApi_blog_book
src/blog/service.py
service.py
py
583
python
en
code
0
github-code
21
[ { "api_name": "fastapi.UploadFile", "line_number": 9, "usage_type": "name" }, { "api_name": "uuid.uuid4", "line_number": 11, "usage_type": "call" }, { "api_name": "fastapi.HTTPException", "line_number": 15, "usage_type": "call" }, { "api_name": "aiofiles.open", ...
14842398190
import sqlite3 DB_FILE = "harvest.db" def init(): with sqlite3.connect(DB_FILE) as con: con.cursor().execute("create table if not exists users(id, name)") con.cursor().execute("create table if not exists souls(soulid, userid)") con.commit() def register(id, name): with sqlite3.conne...
sslees/ld52
data.py
data.py
py
2,858
python
en
code
0
github-code
21
[ { "api_name": "sqlite3.connect", "line_number": 7, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 14, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 23, "usage_type": "call" }, { "api_name": "sqlite3.connect", ...
12915279504
import requests import os import os.path from os import path from bs4 import BeautifulSoup from urllib.request import urlretrieve from download import * from save_pic_as_txt import * from check_db import * def collect_pics(website_url, web_prefix): URL = website_url pic_location = web_prefix page = request...
golopogus/mtg_spoiler
collect_pics.py
collect_pics.py
py
1,900
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 14, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 38, "usage_type": "call" }, { "api_name": "os.path", "line_numbe...
23154350240
import subprocess import json import dkim from celery import Celery from celery.utils.log import get_task_logger #from redis import Redis #from redis import ConnectionPool from kombu import Queue, Connection from pymongo import MongoClient from sslyze.synchronous_scanner import SynchronousScanner from sslyze.server_con...
naeemhaq/tracker
scanner/data/scheduling/tasks.py
tasks.py
py
6,602
python
en
code
null
github-code
21
[ { "api_name": "celery.Celery", "line_number": 17, "usage_type": "call" }, { "api_name": "kombu.Queue", "line_number": 20, "usage_type": "call" }, { "api_name": "kombu.Queue", "line_number": 21, "usage_type": "call" }, { "api_name": "kombu.Queue", "line_number"...
27944699640
#!/usr/bin/env python import sys from collections import deque def read_lines(path): with open(path) as fh: return [line.rstrip() for line in fh.readlines()] class RecursiveCombat: def __init__(self, p1, p2, count=1): self.p1 = p1 self.p2 = p2 self.seen = set() self....
janosgyerik/advent-of-code
2020/day22/part2.py
part2.py
py
2,489
python
en
code
0
github-code
21
[ { "api_name": "collections.deque", "line_number": 71, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 88, "usage_type": "attribute" } ]
14425324370
import sys import os import pathlib from inspect import currentframe, getframeinfo def is_installed(): return 'lib64' in Path(__file__).parts or 'lib' in Path(__file__).parts def maindir(): dir=pathlib.Path(os.path.realpath(__file__)).parent return str(dir.resolve()) configdir = None setup_done = False w...
deeptho/neumodvb
gui/neumodvb/util.py
util.py
py
5,568
python
en
code
9
github-code
21
[ { "api_name": "pathlib.Path", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.realpath", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_n...
41642174264
import argparse from pyannote.database.util import load_rttm import numpy as np import tqdm def segment_load(seg_path): segment = np.load(seg_path, allow_pickle=True).item() return segment if __name__ == "__main__": parser = argparse.ArgumentParser(description="convert segment file to rttm file") par...
Rexiome/wav2VAD
egs/voxsrc21/v1/local/seg2rttm.py
seg2rttm.py
py
931
python
en
code
0
github-code
21
[ { "api_name": "numpy.load", "line_number": 7, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 12, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 19, "usage_type": "call" } ]
43894231331
import logging from wazo_auth.database.helpers import commit_or_rollback logger = logging.getLogger(__name__) class DefaultPolicyService: def __init__(self, dao, default_policies): self._dao = dao self._default_policies = default_policies def update_policies(self): top_tenant_uuid =...
wazo-platform/wazo-auth
wazo_auth/services/default_policy.py
default_policy.py
py
2,357
python
en
code
7
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 5, "usage_type": "call" }, { "api_name": "wazo_auth.database.helpers.commit_or_rollback", "line_number": 20, "usage_type": "call" }, { "api_name": "wazo_auth.database.helpers.commit_or_rollback", "line_number": 35, "usage_...
13653735705
import functools from flask_restful import Resource, Api from flask import ( Blueprint, flash, g, redirect, render_template, request, session, url_for ) from werkzeug.security import check_password_hash, generate_password_hash import app.models.orm as orm bp = Blueprint('auth', __name__, url_prefix='/') @bp.rou...
amommendes/flask_mergulhando
app/auth.py
auth.py
py
1,088
python
en
code
1
github-code
21
[ { "api_name": "flask.Blueprint", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 19, "usage_type": "call" }, { "api_name": "flask.ses...
13465946627
import json import re from send_core.models import Status, Function, Invite, Invited_user, Task, Log from django.http import HttpResponse from django.utils.timezone import now from django.contrib.auth.decorators import login_required from django.views.decorators.csrf import ensure_csrf_cookie from django.contrib.auth i...
lc4t/sender_API
send_core/views.py
views.py
py
17,664
python
en
code
4
github-code
21
[ { "api_name": "django.http.HttpResponse", "line_number": 16, "usage_type": "call" }, { "api_name": "send_core.models.Status.objects.filter", "line_number": 25, "usage_type": "call" }, { "api_name": "send_core.models.Status.objects", "line_number": 25, "usage_type": "attri...
35461872273
#!/usr/bin/env python # coding: utf-8 import pandas as pd import altair as alt import streamlit as st import time df = pd.read_csv('../sources/tourist_arrivals.csv') df['date'] = pd.to_datetime(df['date']) # Build an empty graph lines = alt.Chart(df).mark_line().encode( x=alt.X('1:T',axis=alt.Axis(title='date')), ...
alod83/data-science
DataVisualization/Altair/AltairAnimation.py
AltairAnimation.py
py
1,211
python
en
code
140
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 10, "usage_type": "call" }, { "api_name": "altair.Chart", "line_number": 13, "usage_type": "call" }, { "api_name": "altair.X", "line_n...
16341581015
import cv2 import numpy as np class FrameAnalyzer: def __init__(self,frame_buffer,matches,candidate_frames): self.buffer_size = frame_buffer-1 #Last index of buffer self.matches = matches self.timeFrames = np.zeros(shape=(1,frame_buffer)) self.angleFrames = np.zeros(shape=(matches,f...
HDavidSolano/small-cv-projects
CraftedCVCodes/FrameAnalyzer.py
FrameAnalyzer.py
py
9,368
python
en
code
0
github-code
21
[ { "api_name": "numpy.zeros", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 11...
15828917953
from django.test import TestCase from home.models import Event class CompanyTestCase(TestCase): def test_str(self): """Test for string representation.""" event = Event.objects.first event_name = str(event.customer) + str(event.evt_time) print (event_name) self.a...
reach1dev/react-django-docker-boilerplate
django/src/home/tests/test_models.py
test_models.py
py
354
python
en
code
2
github-code
21
[ { "api_name": "django.test.TestCase", "line_number": 6, "usage_type": "name" }, { "api_name": "home.models.Event.objects", "line_number": 9, "usage_type": "attribute" }, { "api_name": "home.models.Event", "line_number": 9, "usage_type": "name" } ]
18381725261
import os from sys import platform import pytest from wazuh_testing import global_parameters, LOG_FILE_PATH from wazuh_testing.modules.fim import (registry_parser, KEY_WOW64_64KEY, REG_SZ, KEY_ALL_ACCESS, RegOpenKeyEx, RegCloseKey, WINDOWS_HKEY_LOCAL_MACHINE, MONITORED_KEY) from ...
wazuh/wazuh-qa
tests/integration/test_fim/test_registry/test_registry_limit/test_registry_limit_capacity_alerts.py
test_registry_limit_capacity_alerts.py
py
7,519
python
en
code
29
github-code
21
[ { "api_name": "sys.platform", "line_number": 18, "usage_type": "name" }, { "api_name": "wazuh_testing.modules.WINDOWS", "line_number": 23, "usage_type": "name" }, { "api_name": "wazuh_testing.modules.TIER1", "line_number": 23, "usage_type": "name" }, { "api_name":...
73888309492
from typing import List class Solution: # TLE 34/38 passed # Time: O(n * k) def rotate(self, nums: List[int], k: int) -> None: """ Do not return anything, modify nums in-place instead. """ n = len(nums) if k > n: k = k % n for i in range(k): ...
xiaofanc/leetcode
0189-rotate-array.py
0189-rotate-array.py
py
2,306
python
en
code
0
github-code
21
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 32, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 57, "usage_type": "name" } ]
29967816361
from abc import ABC, abstractmethod import os from datasets import DatasetDict, load_from_disk from transformers import TrainingArguments from lme import DATASET_CACHE_DIR from lme.data_processors.utils import dataset_summary class AbstractDataProcessor(ABC): def __call__(self, training_arguments: TrainingArg...
sebastian-nehrdich/language-models-bair
lme/data_processors/abstract.py
abstract.py
py
1,241
python
en
code
0
github-code
21
[ { "api_name": "abc.ABC", "line_number": 13, "usage_type": "name" }, { "api_name": "transformers.TrainingArguments", "line_number": 14, "usage_type": "name" }, { "api_name": "os.path.exists", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "...
5932319262
# import sys # sys.stdin = open('04.txt', 'r') from collections import deque def bfs(s, d): queue = deque() visited = [0] * (V + 1) visited[s] = 1 queue.append(s) step = 0 while queue: step += 1 for _ in range(len(queue)): node = queue.popleft() if G[nod...
GH-Lim/AlgorithmHomeworkshop
homework/2기서울2반8월29일임건혁/서울2반8월29일임건혁_04.py
서울2반8월29일임건혁_04.py
py
847
python
en
code
0
github-code
21
[ { "api_name": "collections.deque", "line_number": 7, "usage_type": "call" } ]
21925499069
import re import parametertypes from collections import defaultdict, OrderedDict def catches(function, exceptionType = Exception): ''' Returns whether or not calling the provided function yields an exception of type exceptionType, or a descendant of it. ''' try: function() return False except exceptionType...
ptitSeb/zandronum
protocolspec/generator/spec.py
spec.py
py
11,859
python
en
code
7
github-code
21
[ { "api_name": "re.search", "line_number": 87, "usage_type": "call" }, { "api_name": "re.IGNORECASE", "line_number": 87, "usage_type": "attribute" }, { "api_name": "collections.OrderedDict", "line_number": 92, "usage_type": "call" }, { "api_name": "re.search", ...
19066072109
import ctypes import json from virus_total_apis import PublicApi as VirusTotalPublicApi from ctypes.wintypes import DWORD, HANDLE, LPWSTR API_KEY = '' k_handle = ctypes.WinDLL("Kernel32.dll") d_handle = ctypes.WinDLL("DNSAPI.dll") def integer(obj): rv = {} for k, v in obj.items(): if isinstance(v, b...
littl3field/PyWindows_API_Research
DNScacheVTLookup.py
DNScacheVTLookup.py
py
1,631
python
en
code
4
github-code
21
[ { "api_name": "ctypes.WinDLL", "line_number": 9, "usage_type": "call" }, { "api_name": "ctypes.WinDLL", "line_number": 10, "usage_type": "call" }, { "api_name": "ctypes.Structure", "line_number": 24, "usage_type": "attribute" }, { "api_name": "ctypes.wintypes.HAND...
15341882861
from pathlib import Path import random import sys import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from clovars.main import main as clovars_main sns.set() RANDOMNESS_SEED = 42 def main(): """Main function of this script.""" random.seed(RANDOMNESS_SEED) np.ran...
jfaccioni/clovars
scripts/Figures and Videos/Figure 2D/produce_fig_2D.py
produce_fig_2D.py
py
1,752
python
en
code
0
github-code
21
[ { "api_name": "seaborn.set", "line_number": 12, "usage_type": "call" }, { "api_name": "random.seed", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.random", "line_nu...
70842830452
from pyramid.config import Configurator def main(global_config, **settings): """ This function returns a Pyramid WSGI application. """ config = Configurator(settings=settings) config.include('pyramid_mako') config.add_static_view('static', 'static', cache_max_age=3600) config.add_route('proje...
yentsun/hydra
hydra/__init__.py
__init__.py
py
495
python
en
code
0
github-code
21
[ { "api_name": "pyramid.config.Configurator", "line_number": 8, "usage_type": "call" } ]
73565261813
import re from itertools import product from core.variable_template_regex import VariableTemplateRegex import networkx as nx from gfx.arrow import Arrow from gfx.object import Object from gfx.text import Text from bidict import bidict import time def regex_node_match(data1, data2): """ data1 corresponds to G1...
enjoysmath/abstract-spacecraft
core/networkx_tools.py
networkx_tools.py
py
3,979
python
en
code
2
github-code
21
[ { "api_name": "itertools.product", "line_number": 23, "usage_type": "call" }, { "api_name": "networkx.MultiDiGraph", "line_number": 57, "usage_type": "attribute" }, { "api_name": "bidict.bidict", "line_number": 57, "usage_type": "name" }, { "api_name": "bidict.bid...
27404345804
import requests import sys import _json if len(sys.argv)!=2: sys.exit() response=requests.get("https://api.coindesk.com/v1/bpi/currentprice.json",+ sys.argv[1]) f=response.json() for time in f["time"]: print(time["rate"]) print(_json.dumps(f)) while True: a=input("enter how munch bitcion you want to...
MrTalha100/CS50
problem set 4/problem 6-bitcoin price index.py
problem 6-bitcoin price index.py
py
339
python
en
code
0
github-code
21
[ { "api_name": "sys.argv", "line_number": 4, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 5, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 6, ...
42136956721
from __future__ import division from matplotlib import pyplot as plt from fe_utils import ReferenceTriangle import numpy as np from animation_tools import Animation, Scene, CellScene, Title class BuildTriangle(CellScene): def __call__(self, i): if i == 0: nodes = [] nodes.append(se...
finite-element/finite-element-course
doc/source/_scripts/animate_reference_element.py
animate_reference_element.py
py
4,060
python
en
code
74
github-code
21
[ { "api_name": "animation_tools.CellScene", "line_number": 8, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 14, "usage_type": "name" }, { "api_name": "ani...
32739285610
# -*- coding: utf8 -*- import keras from keras.models import Model from keras.layers import Input, Lambda, Conv2D, MaxPooling2D, Flatten, Dense, Reshape from keras.losses import binary_crossentropy from keras.datasets import mnist, fashion_mnist import keras.backend as K from scipy.stats import norm import numpy as np ...
lyang028/loss_bp
loss_bp_test.py
loss_bp_test.py
py
4,759
python
en
code
0
github-code
21
[ { "api_name": "keras.datasets.fashion_mnist.load_data", "line_number": 20, "usage_type": "call" }, { "api_name": "keras.datasets.fashion_mnist", "line_number": 20, "usage_type": "name" }, { "api_name": "keras.backend.random_normal", "line_number": 28, "usage_type": "call"...
4604979207
import shutil import requests from pathlib import Path from settings import ROOT_DIR, IMG_CACHE_FOLDER_RELATIVE from common.misc import add_schema from syncronous.utils import get_unique_file_name from common.models import ImageModel, ConnectedToModel # def get_name_from_img_url(img_url): # name = None # for i i...
Aspect13/market-scrapper
syncronous/ImageClass.py
ImageClass.py
py
2,423
python
en
code
0
github-code
21
[ { "api_name": "common.models.ConnectedToModel", "line_number": 25, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 26, "usage_type": "call" }, { "api_name": "settings.ROOT_DIR", "line_number": 26, "usage_type": "argument" }, { "api_name": "set...
3707721541
from typing import List # Definition for singly-linked list. class ListNode: def __init__(self, val=0, next=None): self.val = val self.next = next # Definition for a binary tree node. class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left =...
dmp2016/LeetCode
Convert Sorted List to Binary Search Tree.py
Convert Sorted List to Binary Search Tree.py
py
1,130
python
en
code
0
github-code
21
[ { "api_name": "typing.List", "line_number": 42, "usage_type": "name" } ]
13878140883
from distutils.core import setup, Extension from Cython.Build import cythonize with open("gui-cpp-files.txt", "r") as f: sources = f.read().strip().split(" ") setup(name="cython_checkers", ext_modules=cythonize(Extension( "checkers_game.pyx", # our Cython source sources...
williamh890/checkers-ai
checkers-ai/setup.py
setup.py
py
438
python
en
code
0
github-code
21
[ { "api_name": "distutils.core.setup", "line_number": 7, "usage_type": "call" }, { "api_name": "Cython.Build.cythonize", "line_number": 8, "usage_type": "call" }, { "api_name": "distutils.core.Extension", "line_number": 8, "usage_type": "call" } ]
26062638282
from django.http import HttpResponse from monitor import driver from core.models import * import json import os import time def Observer(request): if not os.path.exists('/tmp/observer_last_run'): return HttpResponse(json.dumps({"health": ":-X", "time": time.time(), "comp": 0})) t = time.time() sta...
wathsalav/xos
xos/core/views/observer.py
observer.py
py
617
python
en
code
0
github-code
21
[ { "api_name": "os.path.exists", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.http.HttpResponse", "line_number": 10, "usage_type": "call" }, { "api_name": "json.dumps", "...
74063012213
import PyPDF2 import os.path def PDFmerge(pdfs, output): # creating pdf file merger object pdfMerger = PyPDF2.PdfFileMerger() # appending pdfs one by one for pdf in pdfs: with open(pdf, 'rb') as f: temp = pdfMerger.id_count # pdfMerger.addBookmark("Holly",...
mmcclain117/School-Code
Go Through/Eclipse Python/PDF Merger/NeedToGoThrough/Merging.py
Merging.py
py
906
python
en
code
0
github-code
21
[ { "api_name": "PyPDF2.PdfFileMerger", "line_number": 7, "usage_type": "call" } ]
27434113432
# File: Logger.py # Author: Nawaf Abdullah # Creation Date: 15/April/2018 # Description: Logs all the outputs given by PhysTerm from datetime import datetime def logger(output): log = open("log.txt", "a") output = str(output) log_str = "[" + str(datetime.now()) + "] > " + output + "\n" log.wri...
scriptpapi/PhysTerm
Utilities/Logger.py
Logger.py
py
334
python
en
code
0
github-code
21
[ { "api_name": "datetime.datetime.now", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 11, "usage_type": "name" } ]
12335944878
from django import forms from .models import nudge_model class nudge_form(forms.ModelForm): class Meta: model = nudge_model fields = ['name', 'image', 'tagline', 'schedule', 'description', 'moderator', 'category', 'sub_category', 'rigor_rank'] widgets = { 'image': forms....
muhammederamala/nudge_api
nudge_creation_api/nudges/forms.py
forms.py
py
409
python
en
code
0
github-code
21
[ { "api_name": "django.forms.ModelForm", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 4, "usage_type": "name" }, { "api_name": "models.nudge_model", "line_number": 6, "usage_type": "name" }, { "api_name": "django.forms...
903466572
import argparse from torch import nn as nn import torch import torch.nn.functional as F from torch.optim.lr_scheduler import MultiStepLR from torchvision import datasets, transforms import numpy.random as npr import numpy as np import sys from itertools import chain import copy import math from torch.utils....
Gusicun/SICS
SICS_mnist/net.py
net.py
py
1,383
python
en
code
0
github-code
21
[ { "api_name": "torch.device", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.nn.Module", "line_number": 18, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 18, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "lin...
72638727093
# -*- coding: utf-8 -*- # 该脚本的作用是为了备份金融端口数据库每天的binlog import datetime from pathlib import Path from mtk.alert import sender from mtk.utils.cmd import exec_cmd from mtk.mysql.backup import financial_ports from mtk.mysql.runtime import get_mysql_running_ports, get_mysql_runtime_instances instances = get_mysql_runtime_in...
together-wang/python3
backup_binlog.py
backup_binlog.py
py
4,868
python
en
code
0
github-code
21
[ { "api_name": "mtk.mysql.runtime.get_mysql_runtime_instances", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.date.today", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 11, "usage_type": "attribute" }, { ...
14249148285
import json from time import sleep from tinder import TinderClient tc = TinderClient("501d1515-b84d-0c35-ef33-345901de5bf5") sugar = None c=0 n=0 checked_list = [] with open("ckd.json","r") as f: checked_list = json.loads(f.read()) while True: users = tc.get_recommendations()["results"] c+=1 n+=len(...
0z4ck/pytinpy
examples/search.py
search.py
py
1,139
python
en
code
2
github-code
21
[ { "api_name": "tinder.TinderClient", "line_number": 5, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 13, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 33, "usage_type": "call" }, { "api_name": "json.dumps", "line_numbe...
20599947681
#!/usr/bin/env python3 # Author: Jeffrey Grover # Purpose: Append a string to all chromosome IDs # Created: 2019-03-14 from argparse import ArgumentParser def append_chromosome(input_file, chrom_string): with open(input_file, 'r') as input_handle: for line in input_handle: entry = line.strip(...
groverj3/genomics_tools
gtf_append_chr_ids.py
gtf_append_chr_ids.py
py
937
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 20, "usage_type": "call" } ]
27275169228
import numpy as np import pandas as pd from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.naive_bayes import MultinomialNB from sklearn.pipeline import make_pipeline from sklearn.model_selection import train_test_split df = pd.read_csv('dataset.csv') #convert review text to unicode rev...
jonathanplacatka/steam-sentiment-analysis
naive_bayes.py
naive_bayes.py
py
1,352
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 14, "usage_type": "call" }, { "api_name": "sklearn.pipeline.make_pipeline", "line_number": 17, "usage_type": "call" }, {...
23737544939
# -*- coding: utf-8 -*- """ test_celllab_cts.py: Unit-test function for CellLabCTS. Created on Thu Jul 9 08:20:06 2015 @author: gtucker """ from nose.tools import assert_equal from numpy.testing import assert_array_equal from landlab import RasterModelGrid, HexModelGrid from landlab.ca.celllab_cts import Transition...
David-Loibl/landlab
landlab/ca/tests/test_celllab_cts.py
test_celllab_cts.py
py
6,374
python
en
code
null
github-code
21
[ { "api_name": "landlab.ca.celllab_cts.Transition", "line_number": 40, "usage_type": "call" }, { "api_name": "nose.tools.assert_equal", "line_number": 42, "usage_type": "call" }, { "api_name": "nose.tools.assert_equal", "line_number": 43, "usage_type": "call" }, { ...
32681827217
import random import func_timeout from Games.Brisca.BriscaForwardModel import BriscaForwardModel from Games.Brisca.BriscaGame import BriscaGame from Games.Brisca.BriscaGameState import BriscaGameState from Games.Brisca.BriscaHeuristic import BriscaHeuristic from Games.TicTacToe.TicTacToeGame import TicTacToeGame from G...
montoliu/grupoiauji
main_functions.py
main_functions.py
py
4,130
python
en
code
0
github-code
21
[ { "api_name": "Games.TicTacToe.TicTacToeGame.TicTacToeGame", "line_number": 47, "usage_type": "call" }, { "api_name": "Games.TicTacToe.TicTacToeGameState.TicTacToeGameState", "line_number": 48, "usage_type": "call" }, { "api_name": "Games.TicTacToe.TicTacToeForwardModel.TicTacToe...
13442455031
#!/usr/bin/env python2 from functools import wraps def varargs(option, opt_str, value, parser): """Recipe for variable arguments Because we can't use argparse in python 2.6""" assert value is None value = [] def floatable(str): try: float(str) return True ...
ptrnb/ldif_parser
ldif_parser/utils.py
utils.py
py
1,036
python
en
code
0
github-code
21
[ { "api_name": "functools.wraps", "line_number": 34, "usage_type": "call" } ]
22444647636
# Team 1 # Training loop to segment GM & WM structures from MRI images import numpy as np import torch as th import torch.optim as optim import nibabel as nib # import matplotlib.pyplot as plt import json import random import torchvision import time import copy from Unet import ResNetUNet from collections import defau...
madincode/MIAL
structureTrain.py
structureTrain.py
py
11,926
python
en
code
0
github-code
21
[ { "api_name": "numpy.set_printoptions", "line_number": 24, "usage_type": "call" }, { "api_name": "datetime.date.today", "line_number": 27, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 27, "usage_type": "attribute" }, { "api_name": "copy.de...
28238985551
#!/usr/bin/env python # coding: utf-8 import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt # read in all the data df = pd.read_csv(r"D:\FEB_2023\ML\Assignment\wine-quality-white-and-red.csv") df['quality'].unique() df.describe() print(df['quality'].mode()) df.info() df.shap...
davidgonghs/ML-assignment
ml_ass.py
ml_ass.py
py
14,043
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 50, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 69, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.fi...
15942801876
#!/usr/bin/env python # coding: utf-8 # <span style='font-family:serif'> # # # <center>$Machine Learning From Scratch$</center> # # <center><span style='background:yellow'> PCA (Análise de Componentes Principais)</span></center> # <center>$Rafael Pavan$</center> # # # <span style='font-family:serif'> # ...
rafaelpavan95/MSc_MachineLearning_DataMining
PCA_FROM_SCRATCH.py
PCA_FROM_SCRATCH.py
py
9,471
python
pt
code
0
github-code
21
[ { "api_name": "matplotlib.rcParams", "line_number": 32, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 43, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 63, "usage_type": "call" }, { "api_name": "matplotl...
37800151996
from functools import partial from inspect import ismethod, isfunction, getmodule, isbuiltin, getmro def get_class_that_defined_method(meth): if isinstance(meth, partial): return get_class_that_defined_method(meth.func) if ismethod(meth) or ( isbuiltin(meth) and getattr(meth, '...
SanctusAnimus/space-traders-python-cli
helpers.py
helpers.py
py
917
python
en
code
0
github-code
21
[ { "api_name": "functools.partial", "line_number": 6, "usage_type": "argument" }, { "api_name": "inspect.ismethod", "line_number": 8, "usage_type": "call" }, { "api_name": "inspect.isbuiltin", "line_number": 9, "usage_type": "call" }, { "api_name": "inspect.getmro"...
37864868101
""" для запуска build переходим в cmd в папку с setup.py и запускаем 'python setup.py build' """ from cx_Freeze import setup, Executable import os executables = [Executable('main2.py', #главный файл программы targetName='VHO_v1.exe', base = 'Win32GUI'),] #задаем имя файла excludes = ['concurrent','ct...
pashaapsky/PyQt5-Matplotlib-docx-numpy-CX_freeze
setup.py
setup.py
py
1,544
python
ru
code
0
github-code
21
[ { "api_name": "cx_Freeze.Executable", "line_number": 8, "usage_type": "call" }, { "api_name": "cx_Freeze.setup", "line_number": 41, "usage_type": "call" } ]
17117672916
import cv2 camera_index = 0 video = cv2.VideoCapture(camera_index) detector = cv2.CascadeClassifier("/home/vargha/Desktop/haarcascade_frontalface_default.xml") while video.isOpened(): ret, frame = video.read() if not ret: print("null") break boxes = detector.detectMultiScale(frame) for...
Vargha-Kh/Deep-Learning-Practices
Face Detection/Haarcascade Detection/face_detection_camera.py
face_detection_camera.py
py
598
python
en
code
1
github-code
21
[ { "api_name": "cv2.VideoCapture", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.CascadeClassifier", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.rectangle", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.imshow", "...
44016481158
import asyncio import mtrpacket async def trace(): async with mtrpacket.MtrPacket() as mtr: for ttl in range(1, 256): result = await mtr.probe('localhost', ttl=ttl) print(result) if result.success: break asyncio.get_event_loop().run_until_complete(trace(...
mcbuck54/RaspberryPi
Network/checknetwork.py
checknetwork.py
py
323
python
en
code
0
github-code
21
[ { "api_name": "mtrpacket.MtrPacket", "line_number": 5, "usage_type": "call" }, { "api_name": "asyncio.get_event_loop", "line_number": 12, "usage_type": "call" } ]
25876813082
import torch import argparse import os import random import numpy as np from itertools import islice from torch import Tensor, FloatTensor, LongTensor from pl import PL from utils import one_hot, generate_nothing from models.preact_resnet import PreActResNet18 from models.easy_net import ConvNet from dataset import D...
ermongroup/neuralsort
pytorch/run_baseline.py
run_baseline.py
py
3,700
python
en
code
124
github-code
21
[ { "api_name": "torch.manual_seed", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.cuda.manual_seed", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 19, "usage_type": "attribute" }, { "api_name": "numpy.random...
17997227424
# 创建者:wzz # 开发时间:2022/4/23 20:17 import numpy as np import xarray as xr import matplotlib.pyplot as plt import cartopy.crs as ccrs from cartopy.mpl.ticker import LongitudeFormatter, LatitudeFormatter # ------------------第一问------------------- # data = xr.open_dataset('sst.mnmean.nc') # 读数据 print(data) ...
wzzcharles/python-learning
test9.py
test9.py
py
2,150
python
en
code
0
github-code
21
[ { "api_name": "xarray.open_dataset", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.datetime64", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 17, "usage_type": "call" }, { "api_name": "matplot...
20752462607
import pygame import random pygame.init() BLACK = ( 0, 0, 0) WHITE = ( 255, 255, 255) GREEN = ( 0, 255, 0) ORANGE = (244, 118, 65) BLUE = ( 0, 0, 255) PURPLE = ( 255, 0, 255) SCREEN_WIDTH = 1280 SCREEN_HEIGHT = 720 size = (SCREEN_WIDTH, SCREEN_HEIGHT) class Ball: def __init__...
flyyee/cep-twink
1.0/ball.py
ball.py
py
2,702
python
en
code
0
github-code
21
[ { "api_name": "pygame.init", "line_number": 3, "usage_type": "call" }, { "api_name": "pygame.Surface", "line_number": 23, "usage_type": "call" }, { "api_name": "pygame.draw.circle", "line_number": 46, "usage_type": "call" }, { "api_name": "pygame.draw", "line_...
34975399223
import os import torch.onnx import torch.nn as nn # -*- coding: utf-8 -*- import torch from transformers import AutoTokenizer from torch.utils.data import DataLoader, RandomSampler import functools from dataloader.multitargetdataloader import MultiTargetProcessor from util.systems_settings import get_device, seed_ev...
suongnhoang/SRUTransformers
convertonnx.py
convertonnx.py
py
4,998
python
en
code
0
github-code
21
[ { "api_name": "util.systems_settings.seed_everything", "line_number": 24, "usage_type": "call" }, { "api_name": "util.systems_settings.get_device", "line_number": 25, "usage_type": "call" }, { "api_name": "transformers.AutoTokenizer.from_pretrained", "line_number": 40, "u...
37574025392
# Using mouse clicks create a line connecting current and last point import cv2 import numpy as np prevCoordinate=None # event=[i for i in dir(cv2) if 'EVENT' in i] # for i in event: # print(i) def clickEvent(event,x,y,flags,param): global prevCoordinate if event==cv2.EVENT_LBUTTONDOWN: cv2.circ...
rahulgolani/Python-For-Vision-and-Detection---OpenCV
7-More On Mouse Event/main.py
main.py
py
667
python
en
code
0
github-code
21
[ { "api_name": "cv2.EVENT_LBUTTONDOWN", "line_number": 14, "usage_type": "attribute" }, { "api_name": "cv2.circle", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.line", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2.imshow", "line...
28999144587
"""empty message Revision ID: e15942edf967 Revises: 30db2293ca83 Create Date: 2018-12-16 23:46:48.586950 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'e15942edf967' down_revision = '30db2293ca83' branch_labels = None depends_on = None def upgrade(): # ...
gamesover/cs50w-project1
migrations/versions/e15942edf967_.py
e15942edf967_.py
py
695
python
en
code
0
github-code
21
[ { "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.DateTim...
42022642483
from typing import Optional class TreeNode: def __init__(self, val=0, left=None, right=None): self.val=val self.left=left self.right=right class Solution: def sumNumbers(self, root: Optional[TreeNode]) -> int: if root is None: return 0 res = 0 queu...
nikasakandelidze/algorithms
sumRootToLeafNumbers/sumRootToLeafNumbers.py
sumRootToLeafNumbers.py
py
936
python
en
code
1
github-code
21
[ { "api_name": "typing.Optional", "line_number": 12, "usage_type": "name" } ]
23109976001
from argparse import ArgumentParser from common.util import load_hyperparams, merge_dict import os from rl.bernoulli_bandits.model_setup import BernoulliBandit from rl.bernoulli_bandits.model_setup import EpsilonGreedyAgent, ThompsonSamplingAgent, UCBAgent from rl.bernoulli_bandits.util import get_regret, plot_regret ...
markmo/dltemplate
src/rl/bernoulli_bandits/__init__.py
__init__.py
py
1,137
python
en
code
57
github-code
21
[ { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 10, "usage_type": "call" }, { "api_name": "common.util.merge_dict", ...
7749185530
import numpy as np import pickle import os from PIL import Image from config import imshape, n_classes, labels, model_name import imgaug as ia from imgaug import augmenters as iaa import cv2 import json import tensorflow as tf ia.seed(1) seq = iaa.Sequential([ iaa.Fliplr(0.5), iaa.Multiply((1.2, 1.5)), i...
Tim-R413/Cover-Crop-Image-Segmentation
FCN segmentation/IMAGE_SEGMENTATION_PROJECT/data_generator.py
data_generator.py
py
6,492
python
en
code
1
github-code
21
[ { "api_name": "imgaug.seed", "line_number": 13, "usage_type": "call" }, { "api_name": "imgaug.augmenters.Sequential", "line_number": 15, "usage_type": "call" }, { "api_name": "imgaug.augmenters", "line_number": 15, "usage_type": "name" }, { "api_name": "imgaug.aug...
71027346932
#!/usr/bin/python3 """ This script uses Basic Authentication with a access token to access github """ import requests import sys if __name__ == "__main__": if len(sys.argv) != 3: print("Usage: ./10-my_github.py <username> <token>") sys.exit(1) username = sys.argv[1] token = sys.argv[2]...
billwk254/alx-higher_level_programming
0x11-python-network_1/10-my_github.py
10-my_github.py
py
533
python
en
code
0
github-code
21
[ { "api_name": "sys.argv", "line_number": 13, "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...
11442345712
import logging from utils import singleton @singleton.Singleton class Logger(): def __init__(self): self.logger = logging.getLogger('app') self.logger.setLevel(logging.DEBUG) self.fh = logging.FileHandler('log/app.log') self.fh.setLevel(logging.DEBUG) # self.logger.addHandl...
carmodysan/cpxng
utils/log.py
log.py
py
652
python
en
code
0
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 9, "usage_type": "attribute" }, { "api_name": "logging.FileHandler", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.DEBUG"...
19548867920
import os import pickle import numpy as np import torch from torch.utils import data from skimage.io import imread from albumentations import * import h5py def get_loss(): return torch.nn.BCELoss(reduction="sum") def get_optimizer(params, optim_type, LEARNING_RATE): if optim_type == "adam": ...
SimonHaastrup/Thesis_Public
supervised/utils.py
utils.py
py
4,360
python
en
code
0
github-code
21
[ { "api_name": "torch.nn.BCELoss", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 11, "usage_type": "attribute" }, { "api_name": "torch.optim.Adam", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.optim", "li...
18727019129
import pandas as pd import copy import json from dateutil.parser import parse from falx.utils import table_utils def gen_visual_trace_with_mult(_data, _fields): """given a dataset and a few fields, returns the projection of the table on the fields the result is represented as a map that maps each tuple to its mult...
Mestway/falx
falx/utils/vis_utils.py
vis_utils.py
py
11,175
python
en
code
15
github-code
21
[ { "api_name": "pandas.DataFrame.from_dict", "line_number": 49, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 49, "usage_type": "attribute" }, { "api_name": "copy.deepcopy", "line_number": 70, "usage_type": "call" }, { "api_name": "copy.d...
23235028728
import os import yaml CONFIG_DIR = os.path.sep.join([os.getenv('HOME'), '.pyremote']) CONFIG_FILE = os.path.sep + 'config.yaml' CONFIG_FULL_PATH = CONFIG_DIR + CONFIG_FILE def create(): if os.path.exists(CONFIG_DIR + CONFIG_FILE): return if not os.path.exists(CONFIG_DIR): os.makedirs(CONFIG_...
urazoth/pyremote
config.py
config.py
py
695
python
en
code
1
github-code
21
[ { "api_name": "os.path.sep.join", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.getenv", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, ...
7936813200
import requests import pandas as pd date="14 July 2020" url="https://en.wikipedia.org/wiki/COVID-19_pandemic_in_Tamil_Nadu#covid19-container" data=requests.get(url) capturedData=data.text.split("The data below are based on Health and Family Welfare Department of Tamil Nadu daily reports.")[1].split(">By cluster<")[0] ...
DeepakStarkz/PythonDataAnalyticsCorona
WebScrapper/scrapper.py
scrapper.py
py
1,196
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 5, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 23, "usage_type": "call" } ]
9086102077
from tkinter import * from tkinter import filedialog from openpyxl import Workbook, load_workbook from io import StringIO import threading import sys import time import os import numpy as np import sqlite3 import mne class NullIO(StringIO): def write(self, txt): pass #Formats the edf for the al...
VivianDLi/AutoScorer
AutoScorer.py
AutoScorer.py
py
9,244
python
en
code
0
github-code
21
[ { "api_name": "io.StringIO", "line_number": 15, "usage_type": "name" }, { "api_name": "mne.io.read_raw_edf", "line_number": 37, "usage_type": "call" }, { "api_name": "mne.io", "line_number": 37, "usage_type": "attribute" }, { "api_name": "mne.time_frequency.psd_ar...
22048251749
from player import Player from random import choice from copy import copy, deepcopy from blok import Blok from multiprocessing import Pool class AI(Player): def __init__(self, p_id): self.board = [] super().__init__(p_id) def decide_action(self, board, depth=0, player=0, playerhands=False): ...
mkr-mac/Blokus-Bot
ai.py
ai.py
py
5,978
python
en
code
0
github-code
21
[ { "api_name": "player.Player", "line_number": 7, "usage_type": "name" }, { "api_name": "random.choice", "line_number": 22, "usage_type": "call" }, { "api_name": "multiprocessing.Pool", "line_number": 42, "usage_type": "call" }, { "api_name": "copy.copy", "line...
38418674632
import datetime from datetime import datetime import pymongo import requests ## this script is used to collect the reddit data # The subreddits are extracted from reddit #search the for comments from the subreddits pulled and save this data in the database my_client = pymongo.MongoClient("mongodb://127.0.0.1:27017/...
phani8179/Most_popular_sports
data_collection.py
data_collection.py
py
2,414
python
en
code
0
github-code
21
[ { "api_name": "pymongo.MongoClient", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.auth.HTTPBasicAuth", "line_number": 24, "usage_type": "call" }, { "api_name": "requests.auth", "line_number": 24, "usage_type": "attribute" }, { "api_name": "re...
13884868398
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('wagtailimages', '0013_make_rendition_upload_callable'), ] operations = [ # We create a new attribute to allow the data migra...
Stasonhub/wagtail
wagtail/wagtailimages/migrations/0014_remove_filter_model_1.py
0014_remove_filter_model_1.py
py
991
python
en
code
null
github-code
21
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AddField", "line_number": 15, "usage_type": "call" }, { ...
22204489816
import psycopg2 import random from datetime import datetime, timedelta def random_date(start, end): delta = end - start int_delta = delta.days random_days = random.randrange(int_delta) dt = start + timedelta(days=random_days) return dt def db_connect(): conn = psycopg2.connect( host=...
sebsm/BD2-Project
gen_db.py
gen_db.py
py
9,642
python
en
code
0
github-code
21
[ { "api_name": "random.randrange", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 10, "usage_type": "call" }, { "api_name": "psycopg2.connect", "line_number": 15, "usage_type": "call" }, { "api_name": "random.choice", ...
42116092912
# -*- coding: utf-8 -*- """ Created on Fri Mar 1 14:50:32 2019 @author: lei """ import tensorflow as tf import cv2 import numpy as np import os from multiprocessing import Process, Queue import time import random import math from scipy.io import loadmat import caffe_classes max_num = 1000 #max r...
RoyYiLei/Convert-the-ILSVRC2012-images-to-tfrecord
tfrecord_maker.py
tfrecord_maker.py
py
8,817
python
en
code
1
github-code
21
[ { "api_name": "scipy.io.loadmat", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.squeeze", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.squeeze", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.array", "line_...
6069837533
from aiogram.dispatcher import FSMContext from aiogram.dispatcher.filters.state import State, StatesGroup from aiogram import types from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton from aiogram.dispatcher.filters import Text from DB import sqlite_db from keyboard import admin_keyboard u_ID = None ...
Xumpocmb/Pizza-TelegramBot
handlers/admin.py
admin.py
py
6,015
python
ru
code
0
github-code
21
[ { "api_name": "aiogram.dispatcher.filters.state.StatesGroup", "line_number": 13, "usage_type": "name" }, { "api_name": "aiogram.dispatcher.filters.state.State", "line_number": 14, "usage_type": "call" }, { "api_name": "aiogram.dispatcher.filters.state.State", "line_number": 1...
32124483516
import json import transformers from transformers import AutoTokenizer,BertTokenizerFast prompt_match={'M':'materials type','R':'regulatory factor','P':'product category','F':'faradaic efficiency','CO2':'carbon dioxide','CA':'catalyst','ELE':'electroreduction','RE':'reduction'} tokenizer=AutoTokenizer.from_pretrained('b...
Xzaohui/chemical_IE
data/ner_data_manage.py
ner_data_manage.py
py
3,292
python
en
code
0
github-code
21
[ { "api_name": "transformers.AutoTokenizer.from_pretrained", "line_number": 5, "usage_type": "call" }, { "api_name": "transformers.AutoTokenizer", "line_number": 5, "usage_type": "name" }, { "api_name": "json.loads", "line_number": 10, "usage_type": "call" }, { "ap...