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
38579982962
import csv import functools reader = csv.DictReader(open('data/id_lang.csv', 'r', encoding='utf-8'), delimiter='\t', quoting=csv.QUOTE_NONE) @functools.lru_cache def get_filetxt(filename): with open(f'data/lyrics/{filename}.txt', 'r', encoding='utf-8') as file: txt = file.read().replace('\n', ' ') ...
TrvsF/song-sentiment-comparer
src/tests/dataset.py
dataset.py
py
762
python
en
code
5
github-code
18
[ { "api_name": "csv.DictReader", "line_number": 4, "usage_type": "call" }, { "api_name": "csv.QUOTE_NONE", "line_number": 4, "usage_type": "attribute" }, { "api_name": "functools.lru_cache", "line_number": 6, "usage_type": "attribute" }, { "api_name": "csv.DictWrit...
28784673622
from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker # SQLALCHEMY_DATABASE_URL = "sqlite:///./sql_app.db" # if using sqlite SQLALCHEMY_DATABASE_URL = f'postgresql://postgres:dc8294dc8294!!@localhost/postgres' # create database engine = cr...
cookie1986/FastAPI-Microservice
app/database.py
database.py
py
675
python
en
code
0
github-code
18
[ { "api_name": "sqlalchemy.create_engine", "line_number": 9, "usage_type": "call" }, { "api_name": "sqlalchemy.orm.sessionmaker", "line_number": 11, "usage_type": "call" }, { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 14, "usage_type": "call"...
8978671587
# -*- coding: utf-8 -*- """ Created on Fri Apr 12 17:33:02 2019 @author: Anna Shishkina """ import mne import numpy as np from scipy.linalg import eig import matplotlib.pyplot as plt import matplotlib.ticker as ticker #------------------------------------------------------------------------------ # Matrix ch x coi...
brainwavesurf/Headcoils_data_analysis
spyder/Eigen decomposition/Head_position_eigenvectors.py
Head_position_eigenvectors.py
py
2,747
python
en
code
0
github-code
18
[ { "api_name": "mne.io.read_raw_fif", "line_number": 20, "usage_type": "call" }, { "api_name": "mne.io", "line_number": 20, "usage_type": "attribute" }, { "api_name": "mne.pick_types", "line_number": 23, "usage_type": "call" }, { "api_name": "scipy.linalg.eig", ...
31429349812
import cv2 import os import string # Create the directory structure if not os.path.exists("Dataset"): os.makedirs("Dataset") if not os.path.exists("Dataset/Training Data"): os.makedirs("Dataset/Training Data") if not os.path.exists("Dataset/Test Data"): os.makedirs("Dataset/Test Data") for i in range(1...
adityaaay/indiansignlang
collectdata.py
collectdata.py
py
9,483
python
en
code
1
github-code
18
[ { "api_name": "os.path.exists", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.exists", "line_numbe...
20836751034
from http.server import SimpleHTTPRequestHandler from socketserver import TCPServer import cgi class FileUploadHandler(SimpleHTTPRequestHandler): def do_POST(self): form = cgi.FieldStorage( fp=self.rfile, headers=self.headers, environ={'REQUEST_METHOD': 'POST', 'CONTENT_...
TanLocLouis/GK-Gambling-Game-N9
Design/server.py
server.py
py
2,150
python
en
code
0
github-code
18
[ { "api_name": "http.server.SimpleHTTPRequestHandler", "line_number": 5, "usage_type": "name" }, { "api_name": "cgi.FieldStorage", "line_number": 7, "usage_type": "call" }, { "api_name": "socketserver.TCPServer", "line_number": 56, "usage_type": "call" } ]
26646957354
#!/usr/bin/env python3 import matplotlib.pyplot as plt import numpy as np import argparse import monarch import signal import sys def main(): # Parse command line arguments parser = argparse.ArgumentParser(description = "Plot Sigfox Monarch Beacon") parser.add_argument("-r", "--rc", help = "Radio configur...
Jeija/sigfox-monarch-beacon-generator
plot.py
plot.py
py
1,004
python
en
code
0
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 12, "usage_type": "call" }, { "api_name": "monarch.generate_beacon", "line_number": 18, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 21, "usage_type": "call" }, { "api_name":...
71427537640
# libs from __future__ import division import numpy as np import tifffile as tiff import matplotlib.pyplot as plt from skimage.transform import resize from collections import defaultdict import pandas as pd import cv2 import os import shapely from shapely.geometry import MultiPolygon, Polygon def stretch_8b...
aorursy/new-nb-3
jay960702_waterway-0-095-lb.py
jay960702_waterway-0-095-lb.py
py
2,899
python
en
code
0
github-code
18
[ { "api_name": "numpy.zeros_like", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 27, "usage_type": "attribute" }, { "api_name": "numpy.percentile", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.percentile...
28284909186
from pathlib import Path import bw_processing as bwp import numpy as np from fs.base import FS from fs.osfs import OSFS from fs.zipfs import ZipFS from .errors import InconsistentGlobalIndex def get_seed(seed=None): """Get valid Numpy random seed value""" # https://groups.google.com/forum/#!topic/briansuppo...
brightway-lca/brightway2-calc
bw2calc/utils.py
utils.py
py
2,331
python
en
code
9
github-code
18
[ { "api_name": "numpy.random.RandomState", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 15, "usage_type": "attribute" }, { "api_name": "errors.InconsistentGlobalIndex", "line_number": 26, "usage_type": "call" }, { "api_nam...
2441527659
""" small_matrix_app.tests.matrix_entry_widget.py Creates the screen for entering and submitting matrices to be multiplied together """ import sys from PyQt5 import QtCore, QtWidgets from PyQt5.QtWidgets import ( QVBoxLayout, QSpinBox, QGridLayout, QWidget, QHBoxLayout, QPushButton, QFormLa...
grace-harper/small-matrix-app
matrix_app/matrix_entry_widget.py
matrix_entry_widget.py
py
11,907
python
en
code
1
github-code
18
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 30, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidgets", "line_number": 30, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QPushButton", "line_number": 49, "usage_type": "call" }, { "api_name...
30523696752
from collections import deque n, m, k = map(int, input().split()) edge = [[] for _ in range(n*2)] for _ in range(m): u, v, a = map(int, input().split()) u -= 1 v -= 1 if a == 0: u += n v += n edge[u].append((v, 1)) edge[v].append((u, 1)) s = list(map(int, input().split())) fo...
chikati3/Atcoder
abc277/E.py
E.py
py
805
python
en
code
0
github-code
18
[ { "api_name": "collections.deque", "line_number": 25, "usage_type": "call" } ]
1736546086
import os import requests from bson.objectid import ObjectId from flask import ( Flask, flash, render_template, redirect, request, session, url_for, abort) from flask_pymongo import PyMongo from gridfs import GridFS from werkzeug.security import generate_password_hash, check_password_hash from werkzeug.utils im...
oisintohak/MS3
app.py
app.py
py
14,330
python
en
code
1
github-code
18
[ { "api_name": "os.path.exists", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "flask.Flask", "line_number": 19, "usage_type": "call" }, { "api_name": "os.environ.get", "line_nu...
19193279559
import pulp, logging '''https://arxiv.org/pdf/1606.01935.pdf - page 3, 4''' ####################################################################################################################### ########################################### CONSTANTS BELOW ################################################# #...
270ajay/capacitatedVehicleRouting
src/varsAndCts.py
varsAndCts.py
py
6,148
python
en
code
4
github-code
18
[ { "api_name": "pulp.LpVariable", "line_number": 36, "usage_type": "call" }, { "api_name": "pulp.LpBinary", "line_number": 36, "usage_type": "attribute" }, { "api_name": "logging.info", "line_number": 40, "usage_type": "call" }, { "api_name": "pulp.LpVariable", ...
30050146365
import pymysql import random def K2(): conn = pymysql.connect(host = "47.103.24.215",user = 'root',passwd = 'yesterday.1',db = 'zp',charset="utf8") cursor = conn.cursor() t = ['教育', '互联网', '管理', '文秘', '电子', '机械', '客服', '销售', '银行', '保险', '汽车', '采购', '化工', '设计'] sql = 'SELECT K1,K2 FROM ZpModel_zp where...
mainfxyz/Recruitment-website
zpWeb/olap.py
olap.py
py
2,244
python
en
code
1
github-code
18
[ { "api_name": "pymysql.connect", "line_number": 5, "usage_type": "call" } ]
41885124095
"""Command line tool for creating METS document and copying files to workspace directory. """ from __future__ import print_function, unicode_literals import datetime import os import sys import uuid from shutil import copyfile import six import click import lxml.etree import mets import xml_helpers.utils as xml_util...
Digital-Preservation-Finland/dpres-siptools
siptools/scripts/compile_mets.py
compile_mets.py
py
11,259
python
en
code
22
github-code
18
[ { "api_name": "click.disable_unicode_literals_warning", "line_number": 28, "usage_type": "attribute" }, { "api_name": "click.command", "line_number": 31, "usage_type": "call" }, { "api_name": "click.argument", "line_number": 32, "usage_type": "call" }, { "api_name...
4445704169
from datetime import datetime import pytest def change_code(info): info = info.replace('C#', 'c') info = info.replace('D#', 'd') info = info.replace('F#', 'f') info = info.replace('G#', 'g') info = info.replace('A#', 'a') return info def calculate_time(start, end): hour, minute, _ = str...
prography-6th-study/algorithm-code
jisoo/2-방금그곡.py
2-방금그곡.py
py
1,750
python
en
code
4
github-code
18
[ { "api_name": "datetime.datetime.strptime", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 16, "usage_type": "name" }, { "api_name": "pytest.mark.parametrize", "line_number": 53, "usage_type": "call" }, { "api_name": "...
1244055499
import yaml import os import requests from icecream import ic # print(os.path.realpath(__file__)) # print(os.path.dirname(os.path.realpath(__file__))) # print(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) # print(os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "config", "data...
ToddCombs/APItest
utils/read_data.py
read_data.py
py
1,018
python
en
code
0
github-code
18
[ { "api_name": "os.path.join", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.realpath", "lin...
32077112473
"""Module diffs -- Utility module to compare to result dictionaries. During testing and development it is often necessary to compare two result dictionaries. """ # pyright: strict from dataclasses import dataclass from typing import Any, Iterator from collections.abc import Mapping from math import isnan, fabs from ...
GermanZero-de/localzero-generator-core
src/climatevision/generator/diffs.py
diffs.py
py
3,017
python
en
code
6
github-code
18
[ { "api_name": "typing.Any", "line_number": 15, "usage_type": "name" }, { "api_name": "math.isnan", "line_number": 16, "usage_type": "call" }, { "api_name": "math.isnan", "line_number": 18, "usage_type": "call" }, { "api_name": "math.isnan", "line_number": 20, ...
20342199910
import numpy as np from sklearn.externals import joblib from sklearn.ensemble import RandomForestClassifier from sklearn.svm import SVC all_features = np.load('extracted_features.npy') all_labels = np.load('labels.npy') rf = RandomForestClassifier(n_estimators=128) val_separator = int(all_features.shape[1]*0.9) all...
maxspero/feedback-networks-transfer-learning
tl_rf.py
tl_rf.py
py
1,361
python
en
code
2
github-code
18
[ { "api_name": "numpy.load", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 8, "usage_type": "call" }, { "api_name": "sklearn.ensemble.RandomForestClassifier", "line_number": 10, "usage_type": "call" }, { "api_name": "sklearn.e...
10805122411
#!/usr/bin/env python3 import numpy as np import matplotlib.pyplot as plt from randomwalk import RandomWalk n_vals,mean_distance_vals = [],[] max_n = 2000 for n in range(100,max_n,50): rw = RandomWalk(p=0.5,n=n,stats=False) rw.plot_monte_carlo(number_of_trials=3000,show=False) mean_distance_vals.append(rw.mc_mean...
aaronlf/Final-Year-Project
brownian-motion/random-walk/mean_distance_dependence.py
mean_distance_dependence.py
py
752
python
en
code
0
github-code
18
[ { "api_name": "randomwalk.RandomWalk", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.polyfit", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figu...
75063262761
'''Handles the receiving of packages. Update deliveries table when an ords''' from .models import Deliveries from . import db import pandas as pd from datetime import datetime from sqlalchemy import text def scan_package(scan_order_number): #Scan new package. extract info from barcode data new_deliver...
sebasalvarez13/inventory-system
inventoryapp/deliveries.py
deliveries.py
py
1,246
python
en
code
0
github-code
18
[ { "api_name": "models.Deliveries", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 12, "usage_type": "name" }, { "api_name": "sqlalchemy....
10333048851
import getpass import logging import os import platform import textwrap from configparser import ConfigParser from pathlib import Path from typing import Tuple from appdirs import user_config_dir, user_data_dir logging.basicConfig( level=logging.INFO, format="%(asctime)s: %(levelname)s - %(message)s", dat...
yulqen/bcompiler-engine
engine/config.py
config.py
py
5,186
python
en
code
3
github-code
18
[ { "api_name": "logging.basicConfig", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 13, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "platform.syst...
71427511080
# This Python 3 environment comes with many helpful analytics libraries installed # It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python # For example, here's several helpful packages to load in import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O...
aorursy/new-nb-3
janmejoy_covid19-time-series-analysis-plotly-visualization.py
janmejoy_covid19-time-series-analysis-plotly-visualization.py
py
6,842
python
en
code
0
github-code
18
[ { "api_name": "os.walk", "line_number": 12, "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": "plotly.io.templates", "line_num...
15903925869
import os import torch from ldm.util import instantiate_from_config def get_resume_checkpoint_path(opt): if not os.path.exists(opt.resume): raise ValueError("Cannot find {}".format(opt.resume)) if os.path.isfile(opt.resume): paths = opt.resume.split("/") # idx = len(paths)-paths[::-1]...
AlexanderLontke/weight-diffusion
src/weight_diffusion/execution/util.py
util.py
py
1,655
python
en
code
0
github-code
18
[ { "api_name": "os.path.exists", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.isfile", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number":...
8456351693
#!/usr/bin/python3 """ Class FileStorage """ import json from models.amenity import Amenity from models.base_model import BaseModel from models.city import City from models.place import Place from models.review import Review from models.state import State from models.user import User classes = {"Amenity": Amenity, "B...
zelda096/AirBnB_clone_v2
models/engine/file_storage.py
file_storage.py
py
1,944
python
en
code
0
github-code
18
[ { "api_name": "models.amenity.Amenity", "line_number": 15, "usage_type": "name" }, { "api_name": "models.base_model.BaseModel", "line_number": 15, "usage_type": "name" }, { "api_name": "models.city.City", "line_number": 15, "usage_type": "name" }, { "api_name": "m...
19155670504
import numpy as np import clementine as ct import random import matplotlib.pyplot as plt class k_meams: def __init__(self, x, y, k): self.k = k # 簇数 self.x = x self.y = y self.C = [[] for i in range(k)] # 簇划分 self.D = self.choice_init(k, self.x) # 初始化支持向量 self.N ...
mr-wuliu/MECHINELEARNING
K-means.py
K-means.py
py
4,001
python
en
code
0
github-code
18
[ { "api_name": "numpy.zeros", "line_number": 39, "usage_type": "call" }, { "api_name": "numpy.linalg.norm", "line_number": 49, "usage_type": "call" }, { "api_name": "numpy.linalg", "line_number": 49, "usage_type": "attribute" }, { "api_name": "numpy.linalg.norm", ...
23235128128
from typing import Optional, Type, List import pytorch_lightning import torch from agz.MCTS_recurse import MCTS from games.Game import Game class Simulator: def __init__(self, game: Type[Game], mcts_iterations=100, device="cpu"): self.do_mcts = True self.game = game self.mcts_object = MC...
Fjf/AlphaGoZero-MPI
agz/simulator.py
simulator.py
py
5,352
python
en
code
0
github-code
18
[ { "api_name": "typing.Type", "line_number": 11, "usage_type": "name" }, { "api_name": "games.Game.Game", "line_number": 11, "usage_type": "name" }, { "api_name": "agz.MCTS_recurse.MCTS", "line_number": 14, "usage_type": "call" }, { "api_name": "games.Game.Game", ...
75333502119
import pygame, sys import matplotlib.pyplot as plt import numpy as np import math from scipy.integrate import ode # set up the colors BLACK = (0, 0, 0) WHITE = (255, 255, 255) RED = (255, 0, 0) GREEN = (0, 255, 0) BLUE = (0, 0, 255) DEFAULT_ANGLE = 45. DEFAULT_SPEED = 50. # clock object that ensure that animation ha...
judacribz/python_repo
csci_3010u/lab/Lab2/lab2.py
lab2.py
py
5,800
python
en
code
0
github-code
18
[ { "api_name": "pygame.time.Clock", "line_number": 19, "usage_type": "call" }, { "api_name": "pygame.time", "line_number": 19, "usage_type": "attribute" }, { "api_name": "pygame.image.load", "line_number": 22, "usage_type": "call" }, { "api_name": "pygame.image", ...
22395167636
from sklearn.cluster import KMeans import matplotlib.pyplot as plt import numpy as np data = np.array([[1, 2], [4, 7], [9, 5], [12, 2], [5, 1], [3, 4]]) num_cluster = 2 kmeans = KMeans(n_clusters=num_cluster) kmeans.fit(data) labels = kmeans.labels_ centers = kmeans.cluster_centers_ colors = ["r.", "g.", "y.", "c...
MaviyaQureshi/DWM
practiceKMeans.py
practiceKMeans.py
py
542
python
en
code
0
github-code
18
[ { "api_name": "numpy.array", "line_number": 5, "usage_type": "call" }, { "api_name": "sklearn.cluster.KMeans", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.py...
38873071989
import logging import warnings from pathlib import Path from optuna import Trial from research.armors.armor_color.benchmarker import make_armor_color_benchmarker from research.armors.armor_color.pipeline import ArmorColorKerasPipeline from research.armors.evaluation.hyper_tuner import HyperTuner from research.common....
PolySTAR-mtl/cv
src/research/armors/armor_color/scripts/hyper_tune_cnn.py
hyper_tune_cnn.py
py
1,296
python
en
code
0
github-code
18
[ { "api_name": "pathlib.Path", "line_number": 13, "usage_type": "name" }, { "api_name": "optuna.Trial", "line_number": 13, "usage_type": "name" }, { "api_name": "research.armors.armor_color.pipeline.ArmorColorKerasPipeline.from_custom_cnn", "line_number": 14, "usage_type":...
6358439522
#!/usr/bin/env python """NLTK utils """ import pickle import nltk from nltk.corpus import brown, gutenberg __all__ = ['get_nltk_freq_words'] __author__ = ['chaonan99'] def get_nltk_freq_words(): """Use Brown corpus frequent words More corpora: http://www.nltk.org/book/ch02.html """ freq_dict = nltk...
easonnie/combine-FEVER-NSMN
src/chaonan_src/_utils/nltk_utils.py
nltk_utils.py
py
928
python
en
code
71
github-code
18
[ { "api_name": "nltk.FreqDist", "line_number": 18, "usage_type": "call" }, { "api_name": "nltk.corpus.brown.words", "line_number": 18, "usage_type": "call" }, { "api_name": "nltk.corpus.brown", "line_number": 18, "usage_type": "name" }, { "api_name": "nltk.corpus.g...
32352764847
import base64 from odoo import _, api, fields, models from odoo.exceptions import UserError, ValidationError from odoo.tools import float_compare class AccountPaymentOrder(models.Model): _name = "account.payment.order" _description = "Payment Order" _inherit = ["mail.thread", "mail.activity.mixin"] _...
OCA/bank-payment
account_payment_order/models/account_payment_order.py
account_payment_order.py
py
19,037
python
en
code
174
github-code
18
[ { "api_name": "odoo.models.Model", "line_number": 8, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 8, "usage_type": "name" }, { "api_name": "odoo.fields.Char", "line_number": 15, "usage_type": "call" }, { "api_name": "odoo.fields", "...
42187751948
import colorama from colorama import * colorama.init() num1 = int(input("Enter first number: ")) condition = input("What mathematical operator Would you like to use: \n\t\t+ for addition,\n\t\t- for substraction, \n\t\t* for multiplication,\n\t\t/ for diviition,\n\t\t% for Modulus, \n\t\t** for the power oparator \n\t\...
Shreeporno420/PYTHON
Python Project/text_Calculator.py
text_Calculator.py
py
752
python
en
code
1
github-code
18
[ { "api_name": "colorama.init", "line_number": 3, "usage_type": "call" } ]
2642113061
import os import argparse from hexapod import hexapod from time import time, sleep from config import movement_interval as react_delay_ms from setting import calibration_path react_delay = react_delay_ms * 0.001 def normal_loop(): if not remote.connected(): sleep(1 - react_delay) t0 = time() re...
ViolinLee/cv_picnics
running.py
running.py
py
1,200
python
en
code
0
github-code
18
[ { "api_name": "config.movement_interval", "line_number": 9, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 14, "usage_type": "call" }, { "api_name": "time.time", "line_number": 16, "usage_type": "call" }, { "api_name": "hexapod.hexapod.process_...
39677207066
import ipaddress import dns def is_ipaddress(item): try: ipaddress.ip_address(item) return True except Exception: return False def is_ipnetwork(item): try: ipaddress.ip_network(item) return True except Exception: return False def is_domain(item): ...
vincentfer/https-github.com-fportantier-habu
habu/lib/enrich.py
enrich.py
py
1,314
python
en
code
0
github-code
18
[ { "api_name": "ipaddress.ip_address", "line_number": 7, "usage_type": "call" }, { "api_name": "ipaddress.ip_network", "line_number": 15, "usage_type": "call" }, { "api_name": "dns.name.from_text", "line_number": 22, "usage_type": "call" }, { "api_name": "dns.name"...
14758747138
from django.conf import settings from requests_oauthlib import OAuth2Session from django.shortcuts import redirect, get_object_or_404 from .models import SlackInstance, SlackOrgLink, SlackRepoLink, Organisation, Repository from django.urls import reverse import json from django.contrib.auth.decorators import login_requ...
palfrey/vellere
notifier/slack.py
slack.py
py
3,006
python
en
code
1
github-code
18
[ { "api_name": "helpers.session", "line_number": 19, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "line_number": 22, "usage_type": "call" }, { "api_name": "django.contrib.auth.decorators.login_required", "line_number": 17, "usage_type": "name" }, ...
40531263232
from typing import List class Solution: def removeDuplicates(self, nums: List[int]) -> int: if len(nums) == 0: return 0 cur_idx = 0 ori_idx = 1 length = 1 while (ori_idx < len(nums)): if nums[ori_idx] != nums[ori_idx-1]: cur_id...
ShijiaLiLiLi/leetcode
26_Remove_Duplicates_from_Sorted_Array/python.py
python.py
py
464
python
en
code
0
github-code
18
[ { "api_name": "typing.List", "line_number": 3, "usage_type": "name" } ]
3271080791
from bench.common import ( SampleConfig, register_sample, SampleSource, SampleTag, ) import numpy as np import json def get_sample_config(): with open("./bench/samples/basic/le/le.json", "r") as f: arg_data = json.load(f) arg_data_length = len(arg_data["le_0"]) args_cases_ = [] ...
DeepLink-org/DLOP-Bench
bench/samples/basic/le/__init__.py
__init__.py
py
1,001
python
en
code
38
github-code
18
[ { "api_name": "json.load", "line_number": 13, "usage_type": "call" }, { "api_name": "bench.common.SampleConfig", "line_number": 18, "usage_type": "call" }, { "api_name": "bench.common.SampleSource.MMDET", "line_number": 24, "usage_type": "attribute" }, { "api_name...
16153848467
# Request data from GitHubs API and visualise it # ! Data is imcomplete, and varies with each call ! import requests from plotly.graph_objects import Bar from plotly import offline # Make an API call and store the response url = 'https://api.github.com/search/repositories?q=language:python&sort=stars' headers ...
Thomt0m/Data_Visualisation_Python
web_api_github_python_repos.py
web_api_github_python_repos.py
py
1,962
python
en
code
0
github-code
18
[ { "api_name": "requests.get", "line_number": 18, "usage_type": "call" }, { "api_name": "plotly.offline.plot", "line_number": 80, "usage_type": "call" }, { "api_name": "plotly.offline", "line_number": 80, "usage_type": "name" } ]
27143843562
""" This file uses modified code from nvidia apex (https://github.com/NVIDIA/apex) """ import torch import torch.nn as nn from torch.autograd import Variable from torch._utils import _flatten_dense_tensors, _unflatten_dense_tensors from torch.optim import Optimizer import copy class MultiSequential(nn.Sequential): ...
johnolafenwa/TorchFusion-Utils
torchfusion_utils/fp16/fp16.py
fp16.py
py
40,038
python
en
code
15
github-code
18
[ { "api_name": "torch.nn.Sequential", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 13, "usage_type": "name" }, { "api_name": "torch.nn.Module", "line_number": 148, "usage_type": "attribute" }, { "api_name": "torch.nn", ...
42370467511
from flask import Flask, request, render_template, jsonify from uuid import uuid4 from boggle import BoggleGame app = Flask(__name__) app.config["SECRET_KEY"] = "this-is-secret" # The boggle games created, keyed by game id games = {} @app.get("/") def homepage(): """Show board.""" return render_template("...
raytene-han/flask-boggle
app.py
app.py
py
1,389
python
en
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 17, "usage_type": "call" }, { "api_name": "uuid.uuid4", "line_number": 32, "usage_type": "call" }, { "api_name": "boggle.BoggleGame", "...
721566040
import cv2 from PIL import Image, ImageTk import numpy as np from tensorflow import keras from keras import Sequential from keras.layers import Dense,Flatten,MaxPool2D,Conv2D,Dropout,MaxPooling2D,BatchNormalization from keras.preprocessing.image import ImageDataGenerator from keras.utils import to_categorical, plot_mod...
LTPhat/Emotion-Regconition
emojify.py
emojify.py
py
4,040
python
en
code
1
github-code
18
[ { "api_name": "keras.models.Sequential", "line_number": 17, "usage_type": "call" }, { "api_name": "keras.models", "line_number": 17, "usage_type": "name" }, { "api_name": "keras.layers.Conv2D", "line_number": 20, "usage_type": "call" }, { "api_name": "keras.layers...
70221460200
import os import tkinter as tk from tkinter import filedialog import PyInstaller.__main__ class PyToExeConverter: def __init__(self, master): self.master = master master.title("PyToExe Converter") # create label to display selected file path self.file_path_label = tk.Label(master, ...
cyph3rryx/Py-to-Exe
GUI_Based.py
GUI_Based.py
py
2,073
python
en
code
2
github-code
18
[ { "api_name": "tkinter.Label", "line_number": 12, "usage_type": "call" }, { "api_name": "tkinter.Button", "line_number": 16, "usage_type": "call" }, { "api_name": "tkinter.Button", "line_number": 20, "usage_type": "call" }, { "api_name": "tkinter.filedialog.askope...
30673083043
from flask import Flask, render_template, request from pymysql import connections import os import boto3 from config import * from datetime import datetime app = Flask(__name__) bucket = custombucket region = customregion db_conn = connections.Connection( host=customhost, port=3306, user=customuser, ...
Zisan-art/aws-live
EmpApp.py
EmpApp.py
py
10,906
python
en
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "pymysql.connections.Connection", "line_number": 13, "usage_type": "call" }, { "api_name": "pymysql.connections", "line_number": 13, "usage_type": "name" }, { "api_name": "flask.r...
74011042279
import sys, unittest from decimal import Decimal from datetime import date from pony.orm import * from pony.orm.tests.testutils import * db = Database('sqlite', ':memory:') class Student(db.Entity): name = Required(str) scholarship = Optional(int) gpa = Optional(Decimal, 3, 1) dob = Opti...
buhtigexa/Nerit
lib/python2.7/site-packages/pony/orm/tests/test_prefetching.py
test_prefetching.py
py
3,854
python
en
code
3
github-code
18
[ { "api_name": "decimal.Decimal", "line_number": 13, "usage_type": "argument" }, { "api_name": "datetime.date", "line_number": 14, "usage_type": "argument" }, { "api_name": "datetime.date", "line_number": 37, "usage_type": "call" }, { "api_name": "datetime.date", ...
35694482005
import sys import json from secrets import token_hex from cryptography.fernet import Fernet non_binary_key = 'KVrqh62j6pNiGkfPe4nUr6W66UMI1JA2d_4lVPgtO3U=' key = non_binary_key.encode() def encrypt(file_data, filename, key): f = Fernet(key) binary_data = file_data.encode() encrypted_data = f.encrypt(binary...
spc2538/mirra-api-javascript
scripts/encrypt_userkey.py
encrypt_userkey.py
py
841
python
en
code
0
github-code
18
[ { "api_name": "cryptography.fernet.Fernet", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 16, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 17, "usage_type": "attribute" }, { "api_name": "json.dumps", ...
16509283641
from django.urls import path from bookstore.views import user_account_views as account from bookstore.views import user_detail_views as detail urlpatterns = [ path('login/', account.MyTokenObtainPairView.as_view(), name='token_obtain_pair'), path('register/', account.register_user, name='register-user'), ...
Bikash-nath/Bookaholic-v2
backend/bookstore/urls/user_urls.py
user_urls.py
py
2,408
python
en
code
2
github-code
18
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "bookstore.views.user_account_views.MyTokenObtainPairView.as_view", "line_number": 7, "usage_type": "call" }, { "api_name": "bookstore.views.user_account_views.MyTokenObtainPairView", "l...
75155832681
import streamlit as st import gdown import pickle import os import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import re from sklearn.feature_extraction.text import TfidfVectorizer @st.cache_data def collect(): gdown.download(id = '1GK_KpfUVfdbdJlutyaXX_Sf0uaApqXfN')#ret dat...
Selvamsmail/linkedin_deployment
Linkedin_app.py
Linkedin_app.py
py
8,361
python
en
code
0
github-code
18
[ { "api_name": "gdown.download", "line_number": 14, "usage_type": "call" }, { "api_name": "streamlit.cache_data", "line_number": 12, "usage_type": "attribute" }, { "api_name": "gdown.download", "line_number": 19, "usage_type": "call" }, { "api_name": "gdown.downloa...
13366279477
# !/usr/bin/python3 # -*- coding: UTF-8 -*- import redis import uuid import time class MyLock: def acquire_lock(self, conn, lockname, acquire_lock_time=10, lock_time_out=10): identifier = str(uuid.uuid4()) print(identifier) end_time = time.time() + acquire_lock_time lockname = "...
mymusic56/python-hello-world
demo/mylock.py
mylock.py
py
1,267
python
en
code
0
github-code
18
[ { "api_name": "uuid.uuid4", "line_number": 12, "usage_type": "call" }, { "api_name": "time.time", "line_number": 15, "usage_type": "call" }, { "api_name": "time.time", "line_number": 18, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 25, ...
19672992640
import logging from autonetkit.design.utils import filters from autonetkit.design.utils.graph_utils import connected_components from autonetkit.network_model.topology import Topology from autonetkit.network_model.types import DeviceType logger = logging.getLogger(__name__) def check_layer2_conn(topology: Topology) ...
sk2/autonetkit
autonetkit/design/validation/validation.py
validation.py
py
1,036
python
en
code
128
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "autonetkit.network_model.topology.Topology", "line_number": 11, "usage_type": "name" }, { "api_name": "autonetkit.design.utils.graph_utils.connected_components", "line_number": 19, ...
23841935645
# Representations abstraites import matplotlib.pyplot as plt import numpy as np import pickle import params # # Ouverture des listes # with open ('liste1', 'rb') as fp: # l1x = pickle.load(fp) # with open ('liste2', 'rb') as fp: # l1y = pickle.load(fp) # with open ('liste1v', 'rb') as fp: # l2x = pickle.lo...
gamaievsky/DescripteursHarmoniquesAudio
Comparison.py
Comparison.py
py
2,477
python
en
code
0
github-code
18
[ { "api_name": "params.color_abstr", "line_number": 19, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 21, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 21, "usage_type": "name" }, { "api_name": "ma...
24575590100
#coding:utf-8 """ Created on 2018年12月25日 @author: devshilei@gmail.com """ import shutil import os from PIL import Image def image_files_all_in_one(source_path, target_path): """ Discription: 处理原始图像文件(汇总到一个文件目录下) @param source_path: 源目录 @param target_path: 目标目录 """ for root, __,...
devshilei/cell_segmentation
image_preprocess_for_pillow.py
image_preprocess_for_pillow.py
py
3,935
python
en
code
1
github-code
18
[ { "api_name": "os.walk", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 2...
26376746849
#!/usr/bin/sudo python from mininet.topo import Topo from mininet.net import Mininet from mininet.log import setLogLevel from mininet.node import OVSKernelSwitch, RemoteController, CPULimitedHost from mininet.cli import CLI from mininet.link import TCLink import os import threading import numpy as np from random impor...
onurklngc/drone-network-onos-and-mininet
2019-2020/main.py
main.py
py
23,868
python
en
code
1
github-code
18
[ { "api_name": "time.time", "line_number": 55, "usage_type": "call" }, { "api_name": "mininet.node.RemoteController", "line_number": 75, "usage_type": "name" }, { "api_name": "mininet.topo.Topo", "line_number": 83, "usage_type": "name" }, { "api_name": "numpy.rando...
19092170530
# Exercicio - Lista de tarefas com desfazer e refazer # todo = [] -> lista de tarefas # todo = ['fazer café'] -> Adiciona fazer café # todo = ['fazer café', 'caminhar'] Adiciona caminhar # desfazer = ['fazer café',] -> Refazer ['Caminhar'] # desfazer = [] -> Refazer ['caminhar', 'fazer café'] # refazer = todo ['fazer c...
AndersonBasilio/Python
pratica120.py
pratica120.py
py
3,313
python
pt
code
0
github-code
18
[ { "api_name": "json.load", "line_number": 59, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 67, "usage_type": "call" }, { "api_name": "os.system", "line_number": 89, "usage_type": "call" } ]
21036260432
#!/bin/python3 # =========================== # Ar-Ray-code 2022 # =========================== from PySide2.QtWidgets import QApplication, QWidget, QMessageBox import sys import argparse class QuestionWidget(QWidget): def __init__(self): super().__init__() parser = argparse.ArgumentParser(descript...
Ar-Ray-code/ReadableWidgets
PySide2/pyamlside2/commandline_widgets/question_select.py
question_select.py
py
1,294
python
en
code
3
github-code
18
[ { "api_name": "PySide2.QtWidgets.QWidget", "line_number": 10, "usage_type": "name" }, { "api_name": "argparse.ArgumentParser", "line_number": 14, "usage_type": "call" }, { "api_name": "PySide2.QtWidgets.QMessageBox", "line_number": 26, "usage_type": "call" }, { "a...
18106481732
import sys, os import numpy as np import jax import jax.numpy as jnp from jax import random, grad, jit, vmap, jacfwd, jacrev from functools import partial class NuclearPotential(object): def __init__(self, nwalk, pot_name, pot_3b_name): self.nwalk=nwalk self.hc = 197.327053 self.alpha = 1 /...
CompPhysics/ComputationalPhysics2
doc/Programs/NeuralNetworks/NuclearPotential.py
NuclearPotential.py
py
5,122
python
en
code
135
github-code
18
[ { "api_name": "numpy.sqrt", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 32, "usage_type": "call" }, { "api_name": "jax.numpy.sqrt", "line_number": ...
28110287762
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('events', '0004_auto_20150221_2127'), ] operations = [ migrations.CreateModel( name='CalendarEvent', ...
mzakany23/django-calendar-app
src/events/migrations/0005_auto_20150222_1810.py
0005_auto_20150222_1810.py
py
1,166
python
en
code
0
github-code
18
[ { "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.CreateModel", "line_number": 14, "usage_type": "call" }, ...
38267961959
from github import Github import csv import os def importStageThree(token, strRepo): g = Github(token) repo = g.get_repo(strRepo) #Read commit SHAs from data2.csv read_file = open('data2.csv', encoding='utf-8') csvreader = csv.DictReader(read_file) read_file_header = [] read_file_head...
StefanHNelson0916/github-repo-mining
Stage3.py
Stage3.py
py
1,310
python
en
code
0
github-code
18
[ { "api_name": "github.Github", "line_number": 6, "usage_type": "call" }, { "api_name": "csv.DictReader", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_number...
8488833440
import pickle from collections import defaultdict from random import shuffle pieces = {"N": ["knight", "night", "nike", "9", "nine", "ninth", "white", "flight", "light", "might"], "B": ["bishop", "ship"], "Q": ["queen", "quin", "green", "coin", "korean"], "K": ["king", "kink", "pin...
karayaman/voice-to-chess-notation
datageneration.py
datageneration.py
py
4,756
python
en
code
6
github-code
18
[ { "api_name": "collections.defaultdict", "line_number": 81, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 92, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 93, "usage_type": "call" }, { "api_name"...
13702225602
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Apr 23 12:04:30 2020 @author: aggarwal """ #%% """"import essential packages""" import pandas as pd import numpy as np from osgeo import gdal from statsmodels.stats.outliers_influence import variance_inflation_factor from sklearn.preprocessing import L...
ayush-yadav14/Geospatial-Project-based-on-Landslides-Detection
final_code_ad.py
final_code_ad.py
py
47,769
python
en
code
0
github-code
18
[ { "api_name": "numpy.array", "line_number": 41, "usage_type": "call" }, { "api_name": "osgeo.gdal.Open", "line_number": 68, "usage_type": "call" }, { "api_name": "osgeo.gdal", "line_number": 68, "usage_type": "name" }, { "api_name": "osgeo.gdal.Open", "line_nu...
70693630439
from collections import deque def bfs(): q = deque([n]) while q: node = q.popleft() if node == k: print(time[node]) return for i in (node-1, node+1, node*2): if 0 <= i <= MAX_N: if not time[i]: q.append(i) ...
holquew/PS
boj/01697.py
01697.py
py
440
python
en
code
0
github-code
18
[ { "api_name": "collections.deque", "line_number": 5, "usage_type": "call" } ]
74838303400
#!/usr/bin/env python """ Select transcript based on their size (i.e size of mature/spliced transcript). """ import argparse import os import sys from pygtftk import arg_formatter from pygtftk.cmd_object import CmdObject from pygtftk.gtf_interface import GTF from pygtftk.utils import message __updated__ = "2018-01-2...
dputhier/pygtftk
pygtftk/plugins/select_by_tx_size.py
select_by_tx_size.py
py
3,160
python
en
code
37
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 19, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 23, "usage_type": "attribute" }, { "api_name": "pygtftk.arg_formatter.FormattedFile", "line_number": 25, "usage_type": "call" }, { "api_na...
36585630415
import os import queue import re import shutil from typing import List, Optional, Iterable, Tuple from sflkit.instrumentation import Instrumentation from sflkit.instrumentation.file_instrumentation import FileInstrumentation from sflkit.language.visitor import ASTVisitor from sflkit.logger import LOGGER class DirIns...
uds-se/sflkit
src/sflkit/instrumentation/dir_instrumentation.py
dir_instrumentation.py
py
4,128
python
en
code
5
github-code
18
[ { "api_name": "sflkit.instrumentation.Instrumentation", "line_number": 13, "usage_type": "name" }, { "api_name": "sflkit.language.visitor.ASTVisitor", "line_number": 14, "usage_type": "name" }, { "api_name": "sflkit.instrumentation.file_instrumentation.FileInstrumentation", "...
26544479110
import gzip import codecs import os import json from subprocess import Popen, PIPE from tqdm import tqdm import networkx as nx from collections import defaultdict from spacy.tokens import Doc import multiprocess as mp import pickle import re import spacy import multiprocessing from pathlib import Path import pickle env...
shangqing-liu/GraphSearchNet
graph-based-search/parsers/sourcecode/java/build_java_graph.py
build_java_graph.py
py
18,659
python
en
code
25
github-code
18
[ { "api_name": "os.environ.copy", "line_number": 17, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_n...
31178555564
from email.policy import default from django.db import models import uuid from users.models import Profile # Create your models here. # For database tables class Project(models.Model): owner = models.ForeignKey( Profile, null=True, blank=True, on_delete=models.CASCADE) title = models.CharField(max_l...
shreyan-haldankar/devsociety-dev
projects/models.py
models.py
py
3,035
python
en
code
1
github-code
18
[ { "api_name": "django.db.models.Model", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 10, "usage_type": "name" }, { "api_name": "django.db.models.ForeignKey", "line_number": 11, "usage_type": "call" }, { "api_name...
9975364936
import json from typing import Any from django.utils.translation import get_language from rest_framework import serializers from rest_framework.utils.serializer_helpers import ReturnDict from my_apps.shop.models import Banner, BasketItem, Category, Faq, Order, Product, Review class CategorySerializer(serializers.Mo...
alex2011ua/OnlineStore
OnlineStoreDjango/my_apps/shop/api_v1/serializers.py
serializers.py
py
3,770
python
en
code
0
github-code
18
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 11, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 11, "usage_type": "name" }, { "api_name": "rest_framework.serializers.SerializerMethodField", "line_number": ...
22637095569
import sys from itertools import combinations N = int(sys.stdin.readline()) area = [i for i in range(1,N+1)] human_num = dict() num = list(map(int,sys.stdin.readline().rstrip().split())) for i in range(1,N+1) : human_num[i] = num[i-1] node = dict() visited = [0] * (N+1) for i in range(1,N+1) : ...
jooyun-1/PS_repo
백준/Gold/17471. 게리맨더링/게리맨더링.py
게리맨더링.py
py
1,638
python
en
code
0
github-code
18
[ { "api_name": "sys.stdin.readline", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 4, "usage_type": "attribute" }, { "api_name": "sys.stdin.readline", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.stdin", "li...
38324446489
# -*- coding: utf-8 -*- """ This module provides functions for several types of feedback mode 0: Kitaev phase estimation. arxiv: quant-ph/9511026 mode 1: Adaptive repeated phase estimation PRA 63, 053804 (2001) mode 2: Feedback off, Returns 0. mode 3: returns a random number depending on m, x More information can be...
dweigand/qubit-oscillator
feedback.py
feedback.py
py
17,363
python
en
code
0
github-code
18
[ { "api_name": "matplotlib.use", "line_number": 56, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 75, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 75, "usage_type": "attribute" }, { "api_name": "unittest.TestCase", "...
27909968842
from kivy.uix.widget import Widget from kivy.clock import Clock from runnable import run_on_ui_thread from kivy.event import EventDispatcher from jnius import autoclass from webviewclient ...
xiaoyaoking/kivy-android-webview
src/xyweb/webviewengine.py
webviewengine.py
py
3,974
python
en
code
15
github-code
18
[ { "api_name": "jnius.autoclass", "line_number": 10, "usage_type": "call" }, { "api_name": "jnius.autoclass", "line_number": 11, "usage_type": "call" }, { "api_name": "jnius.autoclass", "line_number": 12, "usage_type": "call" }, { "api_name": "jnius.autoclass", ...
70509059560
from elasticsearch_dsl import ( connections, Document, Text, Keyword, Integer, Long ) class Job(Document): custno = Keyword() jobno = Integer() description = Keyword() # job = Keyword() # # job = Text(index='not_analyzed') # issue: https://github.com/elastic/elasticsearch/issues/2...
d2207197/hack104-rec
hack104_rec/es/mapping.py
mapping.py
py
2,862
python
en
code
0
github-code
18
[ { "api_name": "elasticsearch_dsl.Document", "line_number": 9, "usage_type": "name" }, { "api_name": "elasticsearch_dsl.Keyword", "line_number": 10, "usage_type": "call" }, { "api_name": "elasticsearch_dsl.Integer", "line_number": 11, "usage_type": "call" }, { "api...
2371230061
from __future__ import ( absolute_import, division, print_function ) import json import logging import time import boto.swf.layer2 as swf import boto.sqs.connection as sqs import boto.sqs.queue as sqs_queue from .state_machine import StateMachine _LOGGER = logging.getLogger(__name__) class SWFDecider(...
bfansports/CloudProcessingEngine-Decider
pydecider/swf_decider.py
swf_decider.py
py
4,265
python
en
code
3
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "boto.swf.layer2.Decider", "line_number": 20, "usage_type": "attribute" }, { "api_name": "boto.swf.layer2", "line_number": 20, "usage_type": "name" }, { "api_name": "state_...
17785978989
"""Support for Xiaomi curtain.""" from typing import Any from homeassistant.components.cover import ( ATTR_POSITION, ATTR_CURRENT_POSITION, ATTR_TILT_POSITION, CoverEntity, CoverEntityFeature, ) from homeassistant.const import ( ATTR_BATTERY_LEVEL, STATE_CLOSING, STATE_OPENING, STAT...
niceboygithub/AqaraGateway
custom_components/aqara_gateway/cover.py
cover.py
py
8,470
python
en
code
387
github-code
18
[ { "api_name": "core.gateway.Gateway", "line_number": 52, "usage_type": "name" }, { "api_name": "core.gateway.Gateway", "line_number": 63, "usage_type": "name" }, { "api_name": "core.const.DOMAIN", "line_number": 63, "usage_type": "name" }, { "api_name": "homeassis...
15832116401
# modules import numpy as np import os, sys, subprocess import sys, subprocess, os from IPython.display import display, Javascript, HTML, Math, Markdown # suppress traitlets futurewarning import warnings with warnings.catch_warnings(): warnings.simplefilter(action='ignore', category=FutureWarning) warnings.fi...
keriheuer/rqa
__init__.py
__init__.py
py
14,248
python
en
code
0
github-code
18
[ { "api_name": "warnings.catch_warnings", "line_number": 9, "usage_type": "call" }, { "api_name": "warnings.simplefilter", "line_number": 10, "usage_type": "call" }, { "api_name": "warnings.filterwarnings", "line_number": 11, "usage_type": "call" }, { "api_name": "...
7468949529
from configparser import ConfigParser from os.path import exists as file_exists config = ConfigParser() def tbaAppend(tbaSecret): print(tbaSecret) config.set('main', 'TBA-KEY', tbaSecret) with open('settings.ini', 'w+') as f: config.write(f) return str(config.get('main', 'TBA-KEY')) # funct...
miklast/HeatStripe
settingMaker.py
settingMaker.py
py
1,052
python
en
code
8
github-code
18
[ { "api_name": "configparser.ConfigParser", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 21, "usage_type": "call" } ]
12831066413
from django.test import TestCase from rest_framework.test import APIClient from rest_framework import status from core.models import Recipe, Tag, Ingredient from django.contrib.auth import get_user_model from recipe.serializers import RecipeSerializer, RecipeDetailSerializer from django.urls import reverse import os fr...
Gabkings/recipe-app-api
app/recipe/tests/test_recipe_api.py
test_recipe_api.py
py
11,055
python
en
code
0
github-code
18
[ { "api_name": "django.urls.reverse", "line_number": 13, "usage_type": "call" }, { "api_name": "django.urls.reverse", "line_number": 18, "usage_type": "call" }, { "api_name": "core.models.Tag.objects.create", "line_number": 23, "usage_type": "call" }, { "api_name":...
41471647050
from typing import Dict, Optional, Any, List from helix_fhir_client_sdk.dictionary_writer import convert_dict_to_str class FhirValidationException(Exception): def __init__( self, *, request_id: Optional[str], url: str, json_data: str, response_text: Optional[str], ...
icanbwell/helix.fhir.client.sdk
helix_fhir_client_sdk/exceptions/fhir_validation_exception.py
fhir_validation_exception.py
py
1,489
python
en
code
1
github-code
18
[ { "api_name": "typing.Optional", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.Dict", "li...
71489526760
# USAGE # python pi_object_detection.py --prototxt MobileNetSSD_deploy.prototxt.txt --model MobileNetSSD_deploy.caffemodel # import the necessary packages from multiprocessing import Process from multiprocessing import Queue import imutils from imutils.video import FPS import numpy as np import argparse import time im...
ivanmonteiro/pi-object-detection
benchmark_simples.py
benchmark_simples.py
py
1,953
python
en
code
0
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.dnn.readNetFromTensorflow", "line_number": 24, "usage_type": "call" }, { "api_name": "cv2.dnn", "line_number": 24, "usage_type": "attribute" }, { "api_name": "cv...
70883532839
import json import os import shutil import sys import zipfile import random from rich.console import Console from typing import Any, Optional, TextIO, Literal JustifyMethod = Literal["default", "left", "center", "right", "full"] OverflowMethod = Literal["fold", "crop", "ellipsis", "ignore"] MainConsole = Console()...
EillesWan/RDTM-DevelopmentTools
处理自动提交的皮肤投稿数据/RyounSkinExcelReader_DatabaseSaver.py
RyounSkinExcelReader_DatabaseSaver.py
py
15,909
python
en
code
1
github-code
18
[ { "api_name": "typing.Literal", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.Literal", "line_number": 12, "usage_type": "name" }, { "api_name": "rich.console.Console", "line_number": 16, "usage_type": "call" }, { "api_name": "typing.Any", "...
23333864752
from nes_py.wrappers import JoypadSpace import gym_super_mario_bros from gym_super_mario_bros.actions import SIMPLE_MOVEMENT from IPython import embed import gym from gym.wrappers import * import matplotlib.pyplot as plt from ppo import Agent import numpy as np import torch env = gym_super_mario_bros.make('SuperMarioB...
whooooaami/super-mario-with-ai
test_env.py
test_env.py
py
985
python
en
code
0
github-code
18
[ { "api_name": "gym_super_mario_bros.make", "line_number": 12, "usage_type": "call" }, { "api_name": "nes_py.wrappers.JoypadSpace", "line_number": 13, "usage_type": "call" }, { "api_name": "gym_super_mario_bros.actions.SIMPLE_MOVEMENT", "line_number": 13, "usage_type": "ar...
42172235938
import time from datetime import timedelta from airflow import DAG from airflow.operators.python_operator import PythonOperator from airflow.utils.dates import timezone def _sleep(): time.sleep(3) default_args = { 'owner': 'natchanon', 'start_date': timezone.datetime(2021, 3, 1), 'email': ['airflow...
natchanonDev/Sanbox
dags/test_dag.py
test_dag.py
py
812
python
en
code
0
github-code
18
[ { "api_name": "time.sleep", "line_number": 10, "usage_type": "call" }, { "api_name": "airflow.utils.dates.timezone.datetime", "line_number": 15, "usage_type": "call" }, { "api_name": "airflow.utils.dates.timezone", "line_number": 15, "usage_type": "name" }, { "api...
12967952268
from __future__ import unicode_literals from django.core.files.storage import FileSystemStorage from django.utils.encoding import force_bytes from mayan.apps.storage.utils import fs_cleanup, mkdtemp from ..models import Cache from .literals import ( TEST_CACHE_LABEL, TEST_CACHE_MAXIMUM_SIZE, TEST_CACHE_NAME, ...
Sumit-Kumar-Jha/mayan
mayan/apps/file_caching/tests/mixins.py
mixins.py
py
2,277
python
en
code
0
github-code
18
[ { "api_name": "mayan.apps.storage.utils.mkdtemp", "line_number": 23, "usage_type": "call" }, { "api_name": "django.core.files.storage.FileSystemStorage", "line_number": 24, "usage_type": "call" }, { "api_name": "mayan.apps.storage.utils.fs_cleanup", "line_number": 27, "us...
32121578103
from fastapi import APIRouter, Depends, Request, status, HTTPException, File, UploadFile from fastapi.responses import JSONResponse from fastapi.encoders import jsonable_encoder from sqlalchemy.orm import Session from fastapi.security import HTTPBearer from db import get_db import crud import models as mod image_rout...
olympusss/plant
routers/image.py
image.py
py
2,268
python
en
code
0
github-code
18
[ { "api_name": "fastapi.APIRouter", "line_number": 11, "usage_type": "call" }, { "api_name": "fastapi.Request", "line_number": 15, "usage_type": "name" }, { "api_name": "sqlalchemy.orm.Session", "line_number": 15, "usage_type": "name" }, { "api_name": "fastapi.Uplo...
27470767332
import functools import os import os.path as osp from collections import OrderedDict from math import cos, pi from typing import Any, Dict, Union, Optional import numpy as np import torch import torch.nn.functional as F from scipy.optimize import linear_sum_assignment from torch import distributed as dist from torch i...
xiao-pl/ICFMNet
icfm_net/util/utils.py
utils.py
py
17,196
python
en
code
0
github-code
18
[ { "api_name": "dist.get_dist_info", "line_number": 32, "usage_type": "call" }, { "api_name": "torch.Tensor", "line_number": 35, "usage_type": "attribute" }, { "api_name": "torch.tensor", "line_number": 36, "usage_type": "call" }, { "api_name": "torch.distributed.a...
4819310122
""" 188. Best Time to Buy and Sell Stock IV You are given an array prices where prices[i] is the price of a given stock on the ith day, and an integer k. Find the maximum profit you can achieve. You may complete at most k transactions. Note: You may not engage in multiple transactions simultaneously (i.e., you must s...
tkwang0530/LeetCode
0188.py
0188.py
py
2,239
python
en
code
4
github-code
18
[ { "api_name": "typing.List", "line_number": 41, "usage_type": "name" }, { "api_name": "unittest.TestCase", "line_number": 64, "usage_type": "attribute" }, { "api_name": "unittest.main", "line_number": 79, "usage_type": "call" } ]
72527287399
""" LeukemiaAI demo application. """ import gradio as gr from transformers import pipeline model = pipeline("image-classification", model="SuperMaker/vit-base-patch16-224-in21k-leukemia") def predict(img): """a simple wrapper around the model pipeline""" predictions = model(img) formatted = {} for l...
MohammedSaLah-Eldeen/LeukemiaAI
LeukemiaAI/app.py
app.py
py
1,015
python
en
code
0
github-code
18
[ { "api_name": "transformers.pipeline", "line_number": 8, "usage_type": "call" }, { "api_name": "gradio.Blocks", "line_number": 20, "usage_type": "call" }, { "api_name": "gradio.Row", "line_number": 22, "usage_type": "call" }, { "api_name": "gradio.Markdown", "...
36924121261
# fmt: off import re import sys from utils import bits sys.path.append("..") # fmt: on MEM_PATTERN = re.compile(r"mem\[(\d*)\]") def part_1(instructions): mask = None mem = {} for cmd, value in instructions: if cmd == "mask": mask = value elif cmd.startswith("mem"): ...
eruvanos/2020_AOC
14/solution.py
solution.py
py
2,888
python
en
code
0
github-code
18
[ { "api_name": "sys.path.append", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "re.compile", "line_number": 11, "usage_type": "call" }, { "api_name": "utils.bits.test_bit", "lin...
29979477298
import logging from looker_sdk import models from os import name import pytest from lmanage.configurator.folder_configuration import create_folders as cf from tests import fake_methods_data input_data = fake_methods_data.input_data LOGGER = logging.getLogger(__name__) def test_create_folder(mocker): # Tests if t...
looker-open-source/lmanage
tests/test_create_folders.py
test_create_folders.py
py
930
python
en
code
10
github-code
18
[ { "api_name": "tests.fake_methods_data.input_data", "line_number": 8, "usage_type": "attribute" }, { "api_name": "tests.fake_methods_data", "line_number": 8, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "ap...
15505835635
import random import pytest from keywords.utils import random_string @pytest.mark.usefixtures("class_init") class TestDictionary(object): @pytest.mark.parametrize("key, value", [ (random_string(5), ""), (random_string(5), random_string(1)), (random_string(5), random_string(10)), (...
couchbaselabs/mobile-testkit
testsuites/CBLTester/CBL_Functional_tests/APITests/test_dictionary.py
test_dictionary.py
py
9,909
python
en
code
14
github-code
18
[ { "api_name": "pytest.skip", "line_number": 26, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 9, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 9, "usage_type": "attribute" }, { "api_name": "keywords.utils.ran...
71427487400
# This Python 3 environment comes with many helpful analytics libraries installed # It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python # For example, here's several helpful packages to load in import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O...
aorursy/new-nb-3
jahanpour_dive-into-cats.py
jahanpour_dive-into-cats.py
py
2,383
python
en
code
0
github-code
18
[ { "api_name": "json.load", "line_number": 18, "usage_type": "call" }, { "api_name": "pandas.DataFrame.from_dict", "line_number": 20, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 20, "usage_type": "attribute" }, { "api_name": "pandas.Dat...
17091100879
import matplotlib.pyplot as plt from scipy.io import netcdf_file ncf = netcdf_file('KTLX_20100510_22Z.nc') data = ncf.variables['Reflectivity'] lats = ncf.variables['lat'] lons = ncf.variables['lon'] i = 0 fig, ax = plt.subplots(1, 1) im = ax.imshow(data[i], origin='lower', extent=(lons[0], lons[-1], l...
JeanBilheux/python_101
matplotlib/code/simple_radar_viewer.py
simple_radar_viewer.py
py
512
python
en
code
2
github-code
18
[ { "api_name": "scipy.io.netcdf_file", "line_number": 4, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 10, "usage_type": "name" }, { "api_name": "matp...
24772769790
import csv import logging import string import six from ..core.qt import QtCore, Qt from camelot.view.controls import delegates from camelot.admin.action.list_action import DeleteSelection from camelot.admin.object_admin import ObjectAdmin from camelot.admin.table import Table from camelot.admin.action import Action,...
Platanen/camelot
camelot/view/import_utils.py
import_utils.py
py
16,346
python
en
code
null
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 20, "usage_type": "call" }, { "api_name": "string.ascii_uppercase", "line_number": 55, "usage_type": "attribute" }, { "api_name": "camelot.admin.action.Action", "line_number": 93, "usage_type": "name" }, { "api_nam...
72394477159
from setuptools import setup, find_packages import sys, os import src from src.versionConfig import version, versionComment # Load long_description from README.txt here = os.path.dirname(__file__) readme_txt = os.path.join(here, 'README.md') long_description = '\n\n' + open(readme_txt).read() setup(name='cmip-utiliti...
cedadev/cmip_utilities
Package/setup.py
setup.py
py
1,210
python
en
code
0
github-code
18
[ { "api_name": "os.path.dirname", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8...
74625861798
import os import time import numpy import scipy.io import datetime from .learn import learn from .test import test from .result_to_db import data_to_db from algorithm_demo import settings from django.core.cache import cache def l21_cmnmf(parameter_cell): # parse parameter method_dir = parameter_...
Index-Out-Of-Range/grad_project_demo
HMNMF_Codes/L21_CMNMF/L21_CMNMF.py
L21_CMNMF.py
py
6,796
python
en
code
2
github-code
18
[ { "api_name": "scipy.io.io.loadmat", "line_number": 40, "usage_type": "call" }, { "api_name": "scipy.io.io", "line_number": 40, "usage_type": "attribute" }, { "api_name": "scipy.io", "line_number": 40, "usage_type": "name" }, { "api_name": "numpy.shape", "line...
39005737404
import sys import requests from PyQt5.QtWidgets import QApplication, QMainWindow, QWidget, QVBoxLayout, QListWidget, QPushButton, QLabel, QLineEdit from PyQt5.QtMultimedia import QMediaPlayer, QMediaContent from PyQt5.QtCore import QUrl # Deezer API credentials # ini adalah baris kode untuk memasukan api dari...
itshusni29/musicAPI
apps/main.py
main.py
py
5,711
python
en
code
0
github-code
18
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 16, "usage_type": "name" }, { "api_name": "PyQt5.QtMultimedia.QMediaPlayer", "line_number": 25, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 30, "usage_type": "call" }, { ...
10824371971
import argparse import os import logging import model import util import torch def main(): ############################################################################### # Load data ############################################################################### d = util.Dictionary() if args.task =...
elisaF/pytorch-jimodel
main.py
main.py
py
6,187
python
en
code
1
github-code
18
[ { "api_name": "util.Dictionary", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 14, "usage_type": "call" }, { "api_name": "util.read_corpus", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.info", "lin...
42908292665
import time from functools import wraps from pathlib import Path from typing import List import numpy as np from tqdm import tqdm import torch import sys sys.path.append("/home/user/yolov7") from utils.datasets import letterbox from utils.general import check_img_size, non_max_suppression, scale_coords from torchvisio...
TimHiemstra/ISMI_TIGER
Docker/tigeralgorithmexample/processing.py
processing.py
py
6,806
python
en
code
0
github-code
18
[ { "api_name": "sys.path.append", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "time.time", "line_number": 29, "usage_type": "call" }, { "api_name": "time.time", "line_number"...
8857131929
import os import streamlit as st import numpy as np import pandas as pd from pathlib import Path import pickle from PIL import Image import matplotlib.pyplot as plt from wordcloud import WordCloud import plotly.express as px from concurrent.futures import ThreadPoolExecutor from datetime import datetime fro...
saldanhad/freecodecampmlapp
Dashboard.py
Dashboard.py
py
6,929
python
en
code
0
github-code
18
[ { "api_name": "os.getenv", "line_number": 19, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 20, "usage_type": "call" }, { "api_name": "azure.storage.blob.BlobServiceClient.from_connection_string", "line_number": 22, "usage_type": "call" }, { "a...
29043204043
from django.db import models class Thing(models.Model): """ A representation of a thing. """ THING_URL_NONE = 'NO' THING_URL_INTERNAL = 'INT' THING_URL_EXTERNAL = 'EXT' THING_URL_TYPES = ( (THING_URL_NONE, 'No URL'), (THING_URL_INTERNAL, 'Internal URL (uses slug)'), ...
maxwelld90/dmax_website
website_project/things/models.py
models.py
py
4,327
python
en
code
0
github-code
18
[ { "api_name": "django.db.models.Model", "line_number": 3, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 3, "usage_type": "name" }, { "api_name": "django.db.models.SlugField", "line_number": 17, "usage_type": "call" }, { "api_name": ...
39759596384
try: from others.others import make_tuple, \ compute_conv_output_shape, \ stride_tensor, \ pad_tensor, \ unpad_tensor, \ unstride_tensor except ImportError: from ...
giltinde/deep-learning-project
Proj_302882_335482_343955/Miniproject_2/model.py
model.py
py
37,941
python
en
code
0
github-code
18
[ { "api_name": "torch.set_grad_enabled", "line_number": 20, "usage_type": "call" }, { "api_name": "torch.empty", "line_number": 322, "usage_type": "call" }, { "api_name": "torch.empty", "line_number": 323, "usage_type": "call" }, { "api_name": "torch.empty", "l...
26926921962
# Start page: http://www.pythonchallenge.com/pc/def/oxygen.html import os from PIL import Image, ImageDraw from common import EXTERNAL_FOLDER, IGNORE_FOLDER, download_file from pprint import pprint file_name = 'oxygen.png' file_url = f'http://www.pythonchallenge.com/pc/def/{file_name}' file_path = f'{EXTERNAL_FOLDE...
MysterGoN/python-challenge
lvl-07.py
lvl-07.py
py
940
python
en
code
0
github-code
18
[ { "api_name": "common.EXTERNAL_FOLDER", "line_number": 12, "usage_type": "name" }, { "api_name": "os.path.exists", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "common.download_fi...
22154880702
import json import pathlib from typing import Optional, Dict from eval.data import TerminationOutcome from ._tool import Tool class PET(Tool): def __init__(self, core): self.core = core def parse_outcome(self, stdout: str, stderr: str) -> Optional[TerminationOutcome]: output = json.loads(std...
incaseoftrouble/qcomp-2023-stochastic-games-models
eval/tools/pet.py
pet.py
py
1,360
python
en
code
0
github-code
18
[ { "api_name": "_tool.Tool", "line_number": 9, "usage_type": "name" }, { "api_name": "json.loads", "line_number": 14, "usage_type": "call" }, { "api_name": "eval.data.TerminationOutcome", "line_number": 17, "usage_type": "call" }, { "api_name": "typing.Optional", ...