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
14667603119
# Homework ID 1741 import os from random import randint from uuid import uuid4 as uuid from subprocess import run, STDOUT, PIPE, Popen import numpy as np import re import importlib from io import StringIO import sys import types import inspect from termcolor import colored from tqdm.notebook import tqdm import runpy f...
gitterra/terra_autocheck
baseblock/lessonone/ultraPro.py
ultraPro.py
py
43,249
python
ru
code
1
github-code
6
[ { "api_name": "reset.test__AnyFunc", "line_number": 40, "usage_type": "call" }, { "api_name": "reset.test__AnyFunc", "line_number": 42, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 45, "usage_type": "call" }, { "api_name": "os.path", "l...
29381615330
import tensorflow.keras import tensorflow as tf import time import numpy as np import cv2 label_name = "labels.txt" count = 0 labels = [] with open(label_name, "r") as file: lines = file.readlines() for line in lines: _, label = line.split(' ') labels.append(label.replace('\n', '')) print(f"There are in {label...
SierrabaseLab/AI_beginner_course
DL_course/Image_Classification/Cam_Classify.py
Cam_Classify.py
py
937
python
en
code
1
github-code
6
[ { "api_name": "cv2.VideoCapture", "line_number": 18, "usage_type": "call" }, { "api_name": "tensorflow.keras.keras.models.load_model", "line_number": 19, "usage_type": "call" }, { "api_name": "tensorflow.keras.keras", "line_number": 19, "usage_type": "attribute" }, { ...
38736660495
from flask import render_template, request, session from flask import current_app from pymongo.errors import ServerSelectionTimeoutError from backend.dbconnector.mongo import MongoDB from . import eda_bp @eda_bp.route("/", methods=["GET", "POST"]) def connect(): """ Render the index page with the database ...
GeoscienceAustralia/ginan
scripts/GinanEDA/eda/routes/dbConnection.py
dbConnection.py
py
5,382
python
en
code
165
github-code
6
[ { "api_name": "flask.request.method", "line_number": 21, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 21, "usage_type": "name" }, { "api_name": "flask.session", "line_number": 23, "usage_type": "argument" }, { "api_name": "flask.sessi...
10181748406
from django.core import paginator from django.shortcuts import render, redirect from django.http import HttpResponse from django.contrib.auth.decorators import login_required from django.contrib import messages from .models import Project, Tag from .forms import ProjectForm, ReviewForm from .utils import searchProjects...
divanov11/Django-2021
projects/views.py
views.py
py
2,998
python
en
code
474
github-code
6
[ { "api_name": "utils.searchProjects", "line_number": 12, "usage_type": "call" }, { "api_name": "utils.paginateProjects", "line_number": 13, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 17, "usage_type": "call" }, { "api_name": "m...
8352736703
from __future__ import absolute_import, unicode_literals from enum import Enum from c8 import constants from c8.billing.billing_interface import BillingInterface from c8.connection import TenantConnection from c8.function.function_interface import FunctionInterface from c8.redis.redis_commands import RedisCommands fr...
Macrometacorp/pyC8
c8/client.py
client.py
py
114,388
python
en
code
6
github-code
6
[ { "api_name": "enum.Enum", "line_number": 16, "usage_type": "name" }, { "api_name": "enum.Enum", "line_number": 24, "usage_type": "name" }, { "api_name": "enum.Enum", "line_number": 30, "usage_type": "name" }, { "api_name": "c8.constants.STREAM_PORT", "line_nu...
34142196994
import numpy as np import scipy.constants class Particle: """The position, velocity and acceleration are set to be arrays, the name of the particle is set to be a string and its mass, kinetic energy and rest mass are set to be floats""" position = np.array([0., 0., 0.]) velocity = np.array([0., 0., 0.]) ...
Lancaster-Physics-Phys389-2020/phys389-2020-project-twgrainger
Particle.py
Particle.py
py
3,459
python
en
code
0
github-code
6
[ { "api_name": "numpy.array", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 12,...
17613494794
#%% # ============================================================================= # To do: Change the directory variable to the location of # the folder "Thesis Submission_GiaPhatTram" # For example: E:\Students\Thesis\Thesis Submission - Gia Phat Tram # =========================================================...
giaphattram/ThesisCode
AFP Analysis Part 2 - Panel Data Regression.py
AFP Analysis Part 2 - Panel Data Regression.py
py
21,130
python
en
code
1
github-code
6
[ { "api_name": "os.chdir", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.options", "line_number": 15, "usage_type": "attribute" }, { "api_name": "gc.enable", "line_number": 23, "usage_type": "call" }, { "api_name": "pandas.read_excel", "line_n...
5383127295
#!/usr/bin/python3 from flask import Flask, request, jsonify, send_from_directory, render_template import json import hashlib import datetime import time import psycopg2 as pg app = Flask(__name__, template_folder='/render_templates') def difficulty_in_range(difficulty): return 0 <= difficulty and difficulty <=...
Tom1380/Snake
api.py
api.py
py
4,536
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "psycopg2.connect", "line_number": 20, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 25, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_num...
36229709730
from typing import List ''' 剑指 Offer II 103. 最少的硬币数目 == 322 完全背包,拿就完事儿了。 ''' class Solution: def coinChange(self, coins: List[int], amount: int) -> int: if amount == 0: return 0 if min(coins) > amount: return -1 dp = [0] + [float('inf')] * amount for i in ran...
z-w-wang/Leetcode-Problemlist
FxxkOffer/DP/Offer_2_103.py
Offer_2_103.py
py
605
python
en
code
3
github-code
6
[ { "api_name": "typing.List", "line_number": 8, "usage_type": "name" } ]
23362097373
#!/usr/bin/python3 from ctypes import * import struct import os from Crypto.PublicKey import RSA from Crypto.Util.number import bytes_to_long, long_to_bytes ZKNLIBRARY_NAME=os.path.join(os.path.dirname(__file__),'libzkn.so') FLAG_ARRAY_SIZE=2048 class TooMuchData(Exception): pass class NotEnoughData(Exception): ...
bi-zone/CTFZone-2020-Finals-LittleKnowledge
zkn_support.py
zkn_support.py
py
12,318
python
en
code
0
github-code
6
[ { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 8, "usage_type": "call" }, { "api_name": "struct.unpack", "line_numb...
30468759960
#!/usr/bin/env python # coding: utf-8 # In[2]: import cv2 import numpy as np import tkinter as tk from tkinter import filedialog from PIL import Image, ImageTk # Function to open and process the image def process_image(): file_path = filedialog.askopenfilename() # Open a file dialog to choose an image if f...
prabhat351/IMAGE-TO-PENCIL-SKETCH-APP
sketch converter.py
sketch converter.py
py
1,309
python
en
code
0
github-code
6
[ { "api_name": "tkinter.filedialog.askopenfilename", "line_number": 15, "usage_type": "call" }, { "api_name": "tkinter.filedialog", "line_number": 15, "usage_type": "name" }, { "api_name": "cv2.imread", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2....
10503625684
import cv2 import numpy as np from PIL import Image def get_limits(color): c = np.uint8([[color]]) hsvC = cv2.cvtColor(c, cv2.COLOR_BGR2HSV) lowerLimit = hsvC[0][0][0] - 10, 100, 100 upperLimit = hsvC[0][0][0] + 10, 255, 255 lowerLimit = np.array(lowerLimit, dtype=np.uint8) upperLimit = np....
rizwanishaq/computer-vision-tutorial
color-detection/color_detection.py
color_detection.py
py
1,004
python
en
code
0
github-code
6
[ { "api_name": "numpy.uint8", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2HSV", "line_number": 7, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_...
40367642472
import pygame import random class Asteroid(pygame.sprite.Sprite): def __init__(self, x, y, current_dif): pygame.sprite.Sprite.__init__(self) self.x = x self.y = y if random.randint(1, 3) == 1: self.image = pygame.image.load('data\\bigger_asteroid.png') self.s...
Martian2024/PyGame_Project
Asteroid.py
Asteroid.py
py
1,091
python
en
code
3
github-code
6
[ { "api_name": "pygame.sprite", "line_number": 4, "usage_type": "attribute" }, { "api_name": "pygame.sprite.Sprite.__init__", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.sprite", "line_number": 6, "usage_type": "attribute" }, { "api_name": "rand...
43633345573
from __future__ import absolute_import #typing #overrides import torch from torch.nn import Conv1d, Linear from allennlp.modules.seq2vec_encoders.seq2vec_encoder import Seq2VecEncoder from allennlp.nn import Activation class CnnEncoder(Seq2VecEncoder): def __init__(self, embedding_dim , ...
plasticityai/magnitude
pymagnitude/third_party/allennlp/modules/seq2vec_encoders/cnn_encoder.py
cnn_encoder.py
py
3,653
python
en
code
1,607
github-code
6
[ { "api_name": "allennlp.modules.seq2vec_encoders.seq2vec_encoder.Seq2VecEncoder", "line_number": 13, "usage_type": "name" }, { "api_name": "allennlp.nn.Activation.by_name", "line_number": 25, "usage_type": "call" }, { "api_name": "allennlp.nn.Activation", "line_number": 25, ...
14443778908
''' Description: Autor: Jiachen Sun Date: 2021-04-04 15:30:04 LastEditors: Jiachen Sun LastEditTime: 2021-04-12 19:58:10 ''' import os import sys import copy import math import numpy as np np.random.seed(666) import torch torch.manual_seed(666) torch.cuda.manual_seed_all(666) torch.backends.cudnn.deterministic=True t...
jiachens/c_study
model_finetune_seg.py
model_finetune_seg.py
py
14,029
python
en
code
2
github-code
6
[ { "api_name": "numpy.random.seed", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 14, "usage_type": "attribute" }, { "api_name": "torch.manual_seed", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.cuda.manu...
41746149180
import os from typing import List import cv2 import gym import torch import torch.nn as nn from torch.distributions import Categorical import matplotlib.pyplot as plt action_dim = 2 input_dim = 4 num_episodes = 2000 lr = 0.01 gamma = 0.95 class PolicyNet(nn.Module): def __init__(self, input_dim: int, action_dim...
Okabe-Rintarou-0/AI-learning
exp/RL-gym/simple-policy-based-actor/train.py
train.py
py
4,074
python
en
code
0
github-code
6
[ { "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.Linear", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.nn", "line_nu...
72128930108
from pyglet.gl import * window = pyglet.window.Window() from OpenGL.GL import * from OpenGL.GL import shaders #===================================== #=============================== vertn = """ #version 410 layout (location = 0) in vec2 cord; layout (location = 1) in vec2 uv; out vec2 uvcord; void main() { g...
liltmagicbox/3dkatsu
pyglets/pyglet_11_7_texture.py
pyglet_11_7_texture.py
py
1,842
python
en
code
0
github-code
6
[ { "api_name": "pyglet.gl.window.Window", "line_number": 2, "usage_type": "call" }, { "api_name": "pyglet.gl.window", "line_number": 2, "usage_type": "attribute" }, { "api_name": "pyglet.gl", "line_number": 2, "usage_type": "name" }, { "api_name": "OpenGL.GL.shader...
18004104315
from datetime import datetime from importlib.resources import path import os os.environ['CUDA_LAUNCH_BLOCKING'] = '1' import time from matplotlib.patches import FancyArrow from gym import spaces from gym.spaces import Space import numpy as np import statistics import copy from collections import deque import torch ...
PKU-EPIC/UniDexGrasp
dexgrasp_policy/dexgrasp/algorithms/rl/dagger/dagger.py
dagger.py
py
12,949
python
en
code
63
github-code
6
[ { "api_name": "os.environ", "line_number": 4, "usage_type": "attribute" }, { "api_name": "gym.spaces.Space", "line_number": 53, "usage_type": "argument" }, { "api_name": "gym.spaces.Space", "line_number": 55, "usage_type": "argument" }, { "api_name": "gym.spaces.S...
26625788346
from django import template from django.template.loader import render_to_string from livesettings import config_value from satchmo_ext.productratings.utils import get_product_rating_string, get_product_rating import logging log = logging.getLogger('shop.templatetags') register = template.Library() def product_rating...
dokterbob/satchmo
satchmo/apps/satchmo_ext/productratings/templatetags/satchmo_ratings.py
satchmo_ratings.py
py
1,501
python
en
code
30
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "django.template.Library", "line_number": 9, "usage_type": "call" }, { "api_name": "django.template", "line_number": 9, "usage_type": "name" }, { "api_name": "django.templat...
31956962151
from cryptography.fernet import Fernet import subprocess import argparse class Crypt(): def __init__(self, key=None): self.keyName = "" self.key = None def activate(self, keyname): try: with open(keyname, 'rb') as filekey: self.key = filekey.read() self.keyName = keyname ex...
https-sam/files-encrypter
main.py
main.py
py
2,796
python
en
code
1
github-code
6
[ { "api_name": "cryptography.fernet.Fernet.generate_key", "line_number": 20, "usage_type": "call" }, { "api_name": "cryptography.fernet.Fernet", "line_number": 20, "usage_type": "name" }, { "api_name": "subprocess.check_output", "line_number": 30, "usage_type": "call" },...
14489837092
import numpy as np import pandas as pd import string as str import statistics as st def csv(): #Verify .csv files in folder possible_csvs = ["OneAppTeacherStudent.csv"] for i in range(1,10): possible_csvs.append("OneAppTeacherStudent ({}).csv".format(i)) csvs = possible_csvs.copy() for i in...
cameronfantham/EF-KPI-Data-Pre-processing
Student APP Usage Report Generator/APP.py
APP.py
py
9,306
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.unique", "line_number": 36, "usage_type": "call" }, { "api_name": "statistics.mode", "line_number": 51, "usage_type": "attribute" }, { "api_name": "statistics.mode", ...
15306421630
import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.model_selection import GridSearchCV, KFold from sklearn.linear_model import LinearRegression from sklearn.utils.validation import check_X_y, check_array, check_is_fitted from sklearn.base import BaseEstimator from sklearn.metrics impo...
pytaunay/total-pressure-cathodes-controlling-mechanisms
article/3_pressure-statistical-analysis/C_statistical-analysis/power-law_exhaustive-grid-search.py
power-law_exhaustive-grid-search.py
py
4,456
python
en
code
0
github-code
6
[ { "api_name": "sklearn.base.BaseEstimator", "line_number": 12, "usage_type": "name" }, { "api_name": "sklearn.utils.validation.check_X_y", "line_number": 30, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LinearRegression", "line_number": 39, "usage_type": "c...
37430442298
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' name: Shadows-IT selector.php 任意文件包含 referer: unknown author: Lucifer description: 文件selector.php中,参数idbase64解码可包含本地文件。 ''' import sys import requests class shadowsit_selector_lfi_BaseVerify: def __init__(self, url): self.url = url def run(self): ...
iceyhexman/onlinetools
scanner/plugins/cms/shadowsit/shadowsit_selector_lfi.py
shadowsit_selector_lfi.py
py
1,100
python
en
code
1,626
github-code
6
[ { "api_name": "requests.get", "line_number": 25, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 34, "usage_type": "attribute" } ]
3297094103
""" Module for config file loading/saving functionality Author: Julian Ding """ import os import configparser # User directory name CONFIG_DIR = 'config/engine_config/' # Config file type CFG_EXT = '.ini' # Delimiters DELIM = ' ' ARG_DELIM = '=' NAME_DELIM = '_' # Class to encapsulate the necessary properties of ...
WatChMaL/CNN
io_utils/ioconfig.py
ioconfig.py
py
3,594
python
en
code
4
github-code
6
[ { "api_name": "os.listdir", "line_number": 47, "usage_type": "call" }, { "api_name": "os.path.splitext", "line_number": 47, "usage_type": "call" }, { "api_name": "os.path", "line_number": 47, "usage_type": "attribute" }, { "api_name": "configparser.ConfigParser", ...
40471530271
import os from PIL import Image import torch import torch.nn as nn import torch.utils.data as data import numpy as np import cv2 class KeyPressDataset(data.Dataset): def __init__(self, file_name, transform=None): super(KeyPressDataset, self).__init__() self.file_name = file_name sel...
yxlijun/vision-piano-amt
3rdparty/key_classification/dataset.py
dataset.py
py
1,744
python
en
code
2
github-code
6
[ { "api_name": "torch.utils.data.Dataset", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.utils.data", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.utils.data", "line_number": 24, "usage_type": "name" }, { "api_name": "numpy.l...
2781058062
from faker import Faker import json from django.test import TestCase from django.core.validators import URLValidator from apps.short.models import Shorting fake = Faker() class TestShortingModel(TestCase): def test_pre_generate(self): cnt = 30 Shorting.pre_generate(count=cnt) shortings_c...
kant-chen/sharpshort
apps/short/tests.py
tests.py
py
1,239
python
en
code
0
github-code
6
[ { "api_name": "faker.Faker", "line_number": 8, "usage_type": "call" }, { "api_name": "django.test.TestCase", "line_number": 11, "usage_type": "name" }, { "api_name": "apps.short.models.Shorting.pre_generate", "line_number": 14, "usage_type": "call" }, { "api_name"...
8125676492
#!/usr/bin/python3 import adafruit_dht import board import datetime import os '''Records the temperature (in C and F) and Humidity of the connected DHT probe in today's file in the records directory. This should be run with a cron job every 5 minutes''' def main(): now = datetime.datetime.now() dirname = '/home/p...
jeremyjones1017/Mirror
temp_monitor.py
temp_monitor.py
py
1,230
python
en
code
2
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", ...
26042195416
import sys from http.client import HTTPMessage from http.server import BaseHTTPRequestHandler from types import SimpleNamespace import pytest from pants.backend.url_handlers.s3.register import ( DownloadS3AuthorityPathStyleURL, DownloadS3AuthorityVirtualHostedStyleURL, DownloadS3SchemeURL, ) from pants.ba...
pantsbuild/pants
src/python/pants/backend/url_handlers/s3/integration_test.py
integration_test.py
py
7,311
python
en
code
2,896
github-code
6
[ { "api_name": "pants.engine.fs.FileDigest", "line_number": 19, "usage_type": "call" }, { "api_name": "pants.engine.fs.Digest", "line_number": 22, "usage_type": "call" }, { "api_name": "pants.testutil.rule_runner.RuleRunner", "line_number": 29, "usage_type": "call" }, ...
32808761366
import numpy as np import pandas as pd import os, sys import argparse from datetime import datetime, timedelta DATA_PATH = os.path.join("/home/qilibj/github/nyc-tlc-trip-predition", "data") # Get days of month in 2018 def getDaysMonth(month): if month == 2: return 28 if month % 2 == 1: return 31 return 30...
qili93/nyc-tlc-trip-predition
DataPreprocessing.py
DataPreprocessing.py
py
9,058
python
en
code
1
github-code
6
[ { "api_name": "os.path.join", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path.join", "line_numb...
6484168441
# Quando segnale GPS buono, GPS con KF con elevata accuratezza delle osservazioni e bassa sulla F # Quando arriva l'info su SLAM, Q alta immagazzina le buone info derivanti dal GPS, perchè prediction sulla base di ultimo GPS fatto, mentre R basso. Da verificare, potrebbe essere modo per stima del fattore di scala (CALI...
franioli/COLMAP_SLAM
lib/EKF.py
EKF.py
py
4,770
python
en
code
0
github-code
6
[ { "api_name": "numpy.array", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": ...
35759489622
import halcon as ha import numpy as np import cv2 import math import pandas as pd import csv import os os.environ["KMP_DUPLICATE_LIB_OK"]='TRUE' import yaml #cv读取中文路径 def cv_imread(file_path): cv_img = cv2.imdecode(np.fromfile(file_path,dtype=np.uint8),-1) ## imdecode读取的是rgb,如果后续需要opencv处理的话,需要转换成bgr,转...
XueZhengjie/Melt-EHD
dataset/preprocess/2get_corner.py
2get_corner.py
py
4,688
python
en
code
1
github-code
6
[ { "api_name": "os.environ", "line_number": 8, "usage_type": "attribute" }, { "api_name": "cv2.imdecode", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.fromfile", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_nu...
839574728
#!/usr/bin/env python import argparse def main(): parser = argparse.ArgumentParser(description='probe2fa: a program to convert probe sequences to FASTA format', prog='probe2fa', formatter_class=argparse.RawTextHelpFormatter) parser.add_argument('-i', metavar='FILE', dest='probe_file', required=True, ...
hchyang/PSiTE
wes/util/probe2fa.py
probe2fa.py
py
1,102
python
en
code
10
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 6, "usage_type": "call" }, { "api_name": "argparse.RawTextHelpFormatter", "line_number": 6, "usage_type": "attribute" } ]
6785771353
import matplotlib.pyplot as plt def grade_transform(grade_letter): ''' This function transforms letter of grades into integers 'A' will be transformed to 1, B -- 2, C -- 3, D -- 4, ..., Z -- 26 ''' grade_letter = ord(grade_letter.lower()) - 96 grade_letter = int(grade_letter) return grade_l...
ky822/assignment10
mz948/supportfunctions.py
supportfunctions.py
py
1,313
python
en
code
null
github-code
6
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 27, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 27, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 28, "usage_type": "call" }, { "api_name": "mat...
34237807731
# -*- coding: utf-8 -*- from collections import Counter import datetime def deco(func): def wrapper(*args, **kwargs): startTime = datetime.datetime.now() func(*args, **kwargs) endTime = datetime.datetime.now() cost_time = endTime - startTime msec = cost_time.total_seconds()...
MRKINKI/nlp_project
dbqa/trad/question2text.py
question2text.py
py
2,827
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 7, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 9, "usage_type": "call" }, { "api_name": "datet...
26029205522
#!/usr/bin/env python3 """ Run mqtt broker on localhost: sudo apt-get install mosquitto mosquitto-clients Example run: python3 mqtt-all.py --broker 192.168.1.164 --topic enviro --username xxx --password xxxx """ # import argparse import configparser import ssl import time from runpy import run_path import ST7735 fro...
nickmolo/enviroplus-mqtt
enviroplus-mqtt.py
enviroplus-mqtt.py
py
9,899
python
en
code
0
github-code
6
[ { "api_name": "ltr559.LTR559", "line_number": 23, "usage_type": "call" }, { "api_name": "bme280.get_temperature", "line_number": 65, "usage_type": "call" }, { "api_name": "bme280.get_pressure", "line_number": 69, "usage_type": "call" }, { "api_name": "bme280.get_h...
16543520349
import string import spacy from spacy.vocab import Vocab from sense2vec import Sense2VecComponent import difflib import re from scripts.QuestionDomain.Question import Question from scripts.QuestionDomain.QuestionNode import QuestionNode class QuestionProcessor: def __init__(self): self.nlp = spacy.load("e...
Grimmii/TrainChatBot
src/scripts/QuestionDomain/QuestionProcessor.py
QuestionProcessor.py
py
4,241
python
en
code
0
github-code
6
[ { "api_name": "spacy.load", "line_number": 13, "usage_type": "call" }, { "api_name": "sense2vec.Sense2VecComponent", "line_number": 14, "usage_type": "call" }, { "api_name": "difflib.get_close_matches", "line_number": 102, "usage_type": "call" }, { "api_name": "re...
36029433809
from chatterbot import ChatBot from chatterbot.trainers import ChatterBotCorpusTrainer import yaml from flask import Flask, render_template, request, send_file import os class ChatBotModel: def __init__(self): self.chatbot = self.create_chatbot() self.train_chatbot() def extract_key_from_input...
trucni2005/chatbot_project
chatbot_model.py
chatbot_model.py
py
2,674
python
vi
code
0
github-code
6
[ { "api_name": "chatterbot.ChatBot", "line_number": 37, "usage_type": "call" }, { "api_name": "yaml.SafeLoader", "line_number": 44, "usage_type": "attribute" }, { "api_name": "yaml.load", "line_number": 45, "usage_type": "call" }, { "api_name": "chatterbot.trainers...
19241119646
import logging import signal import sys import traceback from django.db import transaction from licensedcode.cache import build_spdx_license_expression from packagedcode.utils import combine_expressions from matchcode.models import ApproximateDirectoryContentIndex from matchcode.models import ApproximateDirectoryStr...
nexB/purldb
minecode/management/commands/process_scans.py
process_scans.py
py
10,732
python
en
code
23
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 20, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 21, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 21, "usage_type": "attribute" }, { "api_name": "logging.INFO", ...
12747368070
from django.db import models from teacher.models import Teacher from course.models import Course from student.models import Student # Create your models here. class Quiz(models.Model): teacher=models.ForeignKey(Teacher,on_delete=models.CASCADE,null=True) title=models.CharField(max_length=200) detail=models...
Athulya-k-k/Learning-Management-system-back-end
quiz/models.py
models.py
py
1,653
python
en
code
0
github-code
6
[ { "api_name": "django.db.models.Model", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 7, "usage_type": "name" }, { "api_name": "teacher.models", "line_number": 8, "usage_type": "name" }, { "api_name": "django.db.mo...
514625351
import re import requests import json import urllib import time import timeit import math import sys from datetime import datetime from dateutil import tz import os osenviron={} djj_bark_cookie='' djj_sever_jiang='' JD_API_HOST = 'https://daojia.jd.com/client?_jdrandom=1609034402844' yuanck='' cookiesList=[] yuan...
zt6/github_wangdelu2020_python
djj/JD_Yuan.py
JD_Yuan.py
py
11,775
python
en
code
0
github-code
6
[ { "api_name": "urllib.parse.quote", "line_number": 57, "usage_type": "call" }, { "api_name": "urllib.parse", "line_number": 57, "usage_type": "attribute" }, { "api_name": "json.dumps", "line_number": 57, "usage_type": "call" }, { "api_name": "json.loads", "lin...
30815030211
import os from typing import Union, Optional, Tuple from PyQt5.QtGui import QFont, QFontDatabase, QIcon class ResourceManager: """ This class manages the resources in the gui/resources folder """ root = os.path.dirname(os.path.realpath(__file__)) default_resource_folder = { "font": "font...
Wroppy/werry_math
gui/resource_manager.py
resource_manager.py
py
2,444
python
en
code
0
github-code
6
[ { "api_name": "os.path.dirname", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.join", "lin...
70384349629
import cv2 import matplotlib import matplotlib.pyplot as plt import numpy as np import zmq import cmocean from matplotlib.colors import LightSource, ListedColormap from mpl_toolkits.axes_grid1 import make_axes_locatable from matplotlib.widgets import Slider, Button import scipy import vcl.prep_data cmap = ListedColo...
openearth/vcl
vcl/display.py
display.py
py
12,945
python
en
code
2
github-code
6
[ { "api_name": "matplotlib.colors.ListedColormap", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.colors.ListedColormap", "line_number": 16, "usage_type": "call" }, { "api_name": "cmocean.cm.haline", "line_number": 16, "usage_type": "call" }, { ...
34105134168
#!/usr/bin/env python import json import math import os import tarfile import textwrap import click import msgpack from . import http from .db import DB from .logos import fetch_logos, compress_logos from .model import root from .tools import info, success, title, ok, error, section, _secho, progress, match_patterns ...
etalab/geozones
geozones/__main__.py
__main__.py
py
13,978
python
en
code
43
github-code
6
[ { "api_name": "os.chdir", "line_number": 50, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 52, "usage_type": "call" }, { "api_name": "model.root.traverse", "line_number": 57, "usage_type": "call" }, { "api_name": "model.root", "line_number"...
36670043904
import matplotlib.pyplot as plt import pandas as pd import matplotlib as mpl # Load the data from the CSV file df = pd.read_csv('performance_metrics.csv') # Extract the x and y values from the data # methods = df['Method'] # x = df['Inference time'] # y1 = df['accuracy_1'] # y2 = df['accuracy_2'] configurations = df...
ThijsvdBurg/Husky_scripts
data_visualization/plot scripts/method_vs_add.py
method_vs_add.py
py
1,504
python
en
code
1
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.cm", "line_number": 16, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 16, "usage_type": "name" }, { "api_name": "matplotlib...
12999297394
from pyspark.sql import SparkSession sc = SparkSession.builder.getOrCreate().sparkContext words = sc.parallelize ( ["scala", "java", "hadoop", "spark", "akka", "spark vs hadoop", "pyspark", "pyspark and spark"] ) words_map = words.map(lambda x: (x, 1)) mapping = words_map.collect() print (m...
rajesh782762/test-job
main.py
main.py
py
328
python
en
code
0
github-code
6
[ { "api_name": "pyspark.sql.SparkSession.builder.getOrCreate", "line_number": 2, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 2, "usage_type": "attribute" }, { "api_name": "pyspark.sql.SparkSession", "line_number": 2, "usage_type...
30199926674
from django.shortcuts import render,HttpResponse,redirect from .forms import TodoForm from django.contrib import messages from todo.models import Todos # Create your views here. def index(request): todo = Todos.objects.all().order_by('-created_date') if request.method == 'POST': form = TodoForm(reques...
mominarham/django_todo
todo/views.py
views.py
py
758
python
en
code
0
github-code
6
[ { "api_name": "todo.models", "line_number": 8, "usage_type": "name" }, { "api_name": "todo.models.Todos.objects.all", "line_number": 8, "usage_type": "call" }, { "api_name": "todo.models.Todos.objects", "line_number": 8, "usage_type": "attribute" }, { "api_name": ...
8143562191
from cryptography.fernet import Fernet from dotenv import load_dotenv import os load_dotenv(r'C:\Users\johannes.falnes\PycharmProjects\NoroffVC\Module5\M5L3\Spy\.env') token = os.getenv('KEY') key = token.encode('utf-8') # key = b'_q0pPC5WeVCE5o8cC_oxm8WTyyvYV1YNJnKqRHjyuxA=' def decrypt(key): fernet = Fernet(k...
JFalnes/NoroffVC
Module5/M5L3/Spy/main.py
main.py
py
970
python
en
code
1
github-code
6
[ { "api_name": "dotenv.load_dotenv", "line_number": 5, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 6, "usage_type": "call" }, { "api_name": "cryptography.fernet.Fernet", "line_number": 13, "usage_type": "call" }, { "api_name": "cryptography.fe...
14132016095
from sqlalchemy.ext.asyncio import AsyncSession from fastapi import APIRouter from fastapi import Depends, APIRouter, HTTPException from src.database import get_session from src.gps_tracker.manager import GpsTrackerManager from src.gps_tracker.schema import GpsTracker, GpsTrackerCreate, GpsTrackerUpdate router = API...
jmcastellote/whereabouts
src/gps_tracker/router.py
router.py
py
1,128
python
en
code
0
github-code
6
[ { "api_name": "fastapi.APIRouter", "line_number": 10, "usage_type": "call" }, { "api_name": "src.gps_tracker.schema.GpsTrackerCreate", "line_number": 17, "usage_type": "name" }, { "api_name": "sqlalchemy.ext.asyncio.AsyncSession", "line_number": 17, "usage_type": "name" ...
34375406536
#!/usr/bin/env python3 from curses import wrapper from functools import partial import curses import time def spd_scale(y0, x0, y1, x1, x): """Get the speed at the given value of time. NOTE: The output is not clamped, regardless of the reference points given.""" # Two point form of a line # y...
kknives/rudra-training
motor-control/control.py
control.py
py
1,662
python
en
code
0
github-code
6
[ { "api_name": "curses.noecho", "line_number": 27, "usage_type": "call" }, { "api_name": "curses.cbreak", "line_number": 28, "usage_type": "call" }, { "api_name": "curses.curs_set", "line_number": 29, "usage_type": "call" }, { "api_name": "functools.partial", "...
40694950974
"""empty message Revision ID: 130d74c14470 Revises: 4f55a3c62dc6 Create Date: 2015-09-21 13:14:51.082388 """ # revision identifiers, used by Alembic. revision = '130d74c14470' down_revision = '4f55a3c62dc6' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - ...
StasEvseev/adminbuy
migrations/versions/130d74c14470_.py
130d74c14470_.py
py
1,273
python
en
code
0
github-code
6
[ { "api_name": "alembic.op.create_table", "line_number": 19, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 19, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 20, "usage_type": "call" }, { "api_name": "sqlalchemy.Integ...
11813574917
import unittest import numpy as np from sklearn.datasets import load_boston from mlscratch.models.linear import Ridge class TestRidge(unittest.TestCase): def _load_data(self): X, y = load_boston(return_X_y=True) X, y = X[:10], y[:10] return X, y def test_init(self): model =...
yutayamazaki/machine-learning-from-scratch
tests/test_ridge.py
test_ridge.py
py
901
python
en
code
0
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 9, "usage_type": "attribute" }, { "api_name": "sklearn.datasets.load_boston", "line_number": 12, "usage_type": "call" }, { "api_name": "mlscratch.models.linear.Ridge", "line_number": 17, "usage_type": "call" }, { "...
15037787465
import json, datetime def lambda_handler(event, context): if 'requestContext' in event: userinfo = event["requestContext"]["http"] print("userAgent: {}".format(userinfo["userAgent"])) print("sourceIp: {}".format(userinfo["sourceIp"])) if event['queryStringParameters']['requestType'] ==...
JLO64/USC_Bus_Times_API
lambda_function.py
lambda_function.py
py
4,638
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 18, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 18, "usage_type": "attribute" }, { "api_name": "datetime.timezone", "line_number": 18, "usage_type": "call" }, { "api_name": "dateti...
29771953166
#!/usr/bin/env python # coding: utf-8 # # Global Heat Budget Closure # *Contributors*: [Jan-Erik Tesdal](https://github.com/jetesdal), [Ryan Abernathey](https://github.com/rabernat) and [Ian Fenty](https://github.com/ifenty) # # A major part of this tutorial is based on "*A Note on Practical Evaluation of Budgets in ...
ECCO-GROUP/ECCO-v4-Python-Tutorial
Tutorials_as_Python_Files/ECCO_v4_Heat_budget_closure.py
ECCO_v4_Heat_budget_closure.py
py
37,017
python
en
code
44
github-code
6
[ { "api_name": "warnings.filterwarnings", "line_number": 62, "usage_type": "call" }, { "api_name": "ecco_v4_py.load_ecco_grid_nc", "line_number": 131, "usage_type": "call" }, { "api_name": "ecco_v4_py.recursive_load_ecco_var_from_years_nc", "line_number": 155, "usage_type"...
28898633855
import sys import os import re import html from xml.dom.minidom import parse if len(sys.argv) < 3: print('Usage:', sys.argv[0], '<root_file>', '<ditaval> [<out_directory>]', file=sys.stderr) exit(-1) chapter_stack = [] index_stack = [] column_stack = [] for n in range(0, 100): chapter_stack.append(0) ...
Torlus/dita-tools
dita2html.py
dita2html.py
py
18,833
python
en
code
0
github-code
6
[ { "api_name": "sys.argv", "line_number": 7, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 8, "usage_type": "attribute" }, { "api_name": "sys.stderr", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_...
26541303510
import pandas as pd import numpy import matplotlib.pyplot as plt from scipy import signal filename = "IMUData.csv" plt.rcParams["figure.autolayout"] = True df = pd.read_csv(filename) print(df.columns) Pitch = df["Pitch"] Roll = df['Roll'] AccY = df['AccY'] AccX = df['AccX'] AccZ = df['AccZ'] GyroX = df['GyroX'] GyroY ...
vchugh-vc/IMUAnalysis
MovementAnalysis.py
MovementAnalysis.py
py
2,313
python
en
code
1
github-code
6
[ { "api_name": "matplotlib.pyplot.rcParams", "line_number": 7, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 7, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy....
74416912829
# (https://www.cs.uic.edu/~liub/FBS/sentiment-analysis.html), # https://towardsdatascience.com/fine-grained-sentiment-analysis-in-python-part-1-2697bb111ed4 # https://github.com/cjhutto/vaderSentiment import pandas as pd import nltk from snorkel.utils import probs_to_preds from snorkel.labeling import PandasLFApplier...
jeannefukumaru/cs5228-project
distilbert.py
distilbert.py
py
5,327
python
en
code
0
github-code
6
[ { "api_name": "warnings.filterwarnings", "line_number": 27, "usage_type": "call" }, { "api_name": "warnings.filterwarnings", "line_number": 28, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 30, "usage_type": "call" }, { "api_name"...
3639426254
#!/usr/bin/env python3 import os import sys from setuptools import setup, find_packages assert(sys.version_info > (3, 4)) def read(filename): return open(os.path.join(os.path.dirname(__file__), filename)).read() __version__ = None with open(os.path.join(os.path.dirname(__file__), 'rdserial', '__init__.py')) a...
rfinnie/rdserialtool
setup.py
setup.py
py
1,495
python
en
code
87
github-code
6
[ { "api_name": "sys.version_info", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.dirname", ...
35800132876
import numpy as np from numpy import pi # matplotlib is library for plotting data. We will be discussing it later in detail. import matplotlib.pyplot as plt def sine_array(start, stop, num): x = np.linspace(start, stop, num) f = np.sin(x) return x, f if __name__ == '__main__': a, b = sine_array(0, 3...
jetbrains-academy/Python-Libraries-NumPy
NumPy/Array Basics/Linspace/task.py
task.py
py
420
python
en
code
1
github-code
6
[ { "api_name": "numpy.linspace", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 14, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_nu...
23795211630
# !/usr/bin/python import os import hashlib from datetime import datetime #walks the file tree starting at the root directory #returns a list of every file, exclusing those in the 'exclude' list def walk(): #list of directories to exclude from hashing: exclude = ["/dev", "/proc", "/run", "/sys", "/tmp", "/var/lib",...
danbeverly/lab5-Host-Integrity
hash.py
hash.py
py
3,185
python
en
code
0
github-code
6
[ { "api_name": "os.walk", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "hashlib.sha256", "line_number":...
41963662511
#!/usr/bin/env python3 import sys import json import zmq import gevent PUB_URL = "ipc:///tmp/wp_pub" SUB_URL = "ipc:///tmp/wp_sub" class Session: def __init__(self): self.context = zmq.Context() self.sub = self.context.socket(zmq.SUB) self.sub.connect(SUB_URL) self.sub.setsocko...
mastensg/windportal
firmware/wp_ipc.py
wp_ipc.py
py
1,636
python
en
code
2
github-code
6
[ { "api_name": "zmq.Context", "line_number": 15, "usage_type": "call" }, { "api_name": "zmq.SUB", "line_number": 17, "usage_type": "attribute" }, { "api_name": "zmq.SUBSCRIBE", "line_number": 19, "usage_type": "attribute" }, { "api_name": "zmq.Poller", "line_nu...
22510107176
from typing import Any, Dict, Optional, Tuple from pymysql.err import ProgrammingError, OperationalError from . import connect, Schema from .. import make_logger log = make_logger(name=__name__, logfile="logs/app.log") class Query: """ Base class for executing queries If a given query fails at some poi...
sudotouchwoman/labs-system-c
web/app/model/query.py
query.py
py
2,816
python
en
code
0
github-code
6
[ { "api_name": "pymysql.err.OperationalError", "line_number": 42, "usage_type": "name" }, { "api_name": "pymysql.err.ProgrammingError", "line_number": 42, "usage_type": "name" }, { "api_name": "pymysql.err.OperationalError", "line_number": 59, "usage_type": "name" }, {...
51673661
""" Visual comparison of the different kernels we could be using, in particular the powerlaw kernel and geometric. Presents the approximation errors of certain kernels choices. """ import numpy as np import scipy from corai_plot import APlot # assuming we want to use a kernel K for HP simulations/estimations. # now, w...
Code-Cornelius/jump_diff_bubble_II_thesis
experiments/kernels_approx.py
kernels_approx.py
py
3,336
python
en
code
0
github-code
6
[ { "api_name": "numpy.power", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.power", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.floor", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 20...
10976086529
import math import matplotlib.pyplot as plt import numpy as np import time def func(x): return x**3 - 5*x +3 def dfunc(x): return 3*x**2 - 5 def bisection(low, high): if (func(low) * func(high) > 0) or (high <= low): print("Wrong Interval!") return for _ in range(...
LiBingbin/Computational_Physics
PythonProject/hw02/hw02_t1.py
hw02_t1.py
py
2,961
python
en
code
0
github-code
6
[ { "api_name": "numpy.arange", "line_number": 71, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 73, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 73, "usage_type": "name" }, { "api_name": "matplotlib.pypl...
25005149375
import discord from discord.ext import commands from discord_slash import cog_ext from datetime import datetime class Inquiry(commands.Cog, name="지원"): def __init__(self, bot): self.bot = bot @commands.Cog.listener() async def on_message(self, msg): files = [] if msg.author.bot: ...
DENE-dev/dene-dev
RQ1-data/exp2/1070-Korean-Discord-Dictionary@SxU-69455cfa1894f15289cf91e5f5d26047abe5d24e/exts/inquiry.py
inquiry.py
py
2,157
python
en
code
0
github-code
6
[ { "api_name": "discord.ext.commands.Cog", "line_number": 7, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 7, "usage_type": "name" }, { "api_name": "discord.ChannelType", "line_number": 18, "usage_type": "attribute" }, { "api_nam...
17509655413
from typing import List from math import inf class Solution: def findMedianSortedArrays(self, a: List[int], b: List[int]) -> float: def median_helper(p, r): if p > r: return -1 i = (p+r)//2 j = (m+n)//2 - i if a[i-1] <= b[j] and b[j-1] <= a[i]:...
soji-omiwade/cs
dsa/before_rubrik/median_of_two_sorted_arrays_no_infs_in_for_bin_search.py
median_of_two_sorted_arrays_no_infs_in_for_bin_search.py
py
1,640
python
en
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 4, "usage_type": "name" }, { "api_name": "math.inf", "line_number": 25, "usage_type": "name" }, { "api_name": "math.inf", "line_number": 26, "usage_type": "name" }, { "api_name": "math.inf", "line_number": 29, "u...
34004525592
from collections import deque n,m,v = map(int,input().split()) graph = [[0]*(n+1)for _ in range(n+1)] for i in range(1,m+1): a,b = map(int,input().split()) graph[a][b] = 1 graph[b][a] = 1 visited_dfs = [False] * (n+1) visited_bfs = [False] * (n+1) answer_dfs = [] answer_bfs = [] def dfs(v): visited...
jinman-kim/algo
1260.py
1260.py
py
836
python
en
code
0
github-code
6
[ { "api_name": "collections.deque", "line_number": 26, "usage_type": "call" } ]
37131335817
#!/usr/bin/env python #_*_coding:utf-8_*_ import re, sys, os from collections import Counter pPath = os.path.split(os.path.realpath(__file__))[0] sys.path.append(pPath) import readFasta import saveCode import checkFasta USAGE = """ USAGE: python EAAC.py input.fasta <sliding_window> <output> input.fasta: the i...
Superzchen/iFeature
codes/EAAC.py
EAAC.py
py
2,474
python
en
code
152
github-code
6
[ { "api_name": "os.path.split", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.path.append", "line_...
44335346851
import xml.etree.ElementTree as ET import json from tkinter import Tk from tkinter.filedialog import askopenfilename import csv Tk().withdraw() filepath = askopenfilename() print(filepath) tree = ET.parse(filepath) root = tree.getroot() jsontext = root[7].text data = json.loads(jsontext) devices = data['deviceRespB...
matthewhilton/Tuya-Python-LocalKeys
TuyaLocalKeys.py
TuyaLocalKeys.py
py
656
python
en
code
2
github-code
6
[ { "api_name": "tkinter.Tk", "line_number": 7, "usage_type": "call" }, { "api_name": "tkinter.filedialog.askopenfilename", "line_number": 8, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree.parse", "line_number": 11, "usage_type": "call" }, { "api_name"...
40859794177
import json from progress.bar import Bar JSON_FILES = ['csdn', 'yahoo'] DICT_FILES = ['dict-10000', 'dict-50000', 'dict-100000', 'dict-200000', 'dict-500000', 'dict-1000000'] def collision_test(json_file, dict_file): with open(f'./{json_file}.json') as f: test_data = json.load(f) with open(f'./dict/{dict_fi...
Cthollist9/websec_course
PCFG/test.py
test.py
py
1,100
python
en
code
0
github-code
6
[ { "api_name": "json.load", "line_number": 10, "usage_type": "call" }, { "api_name": "progress.bar.Bar", "line_number": 19, "usage_type": "call" } ]
35031946883
"""Pytorch Dataset object that loads perfectly balanced MNIST dataset in bag form.""" import numpy as np import matplotlib.pyplot as plt import torch import torch.utils.data as data_utils from torchvision import datasets, transforms from PIL import Image import numpy as np from six.moves import cPickle as pickle impo...
miccaiif/WENO
Datasets_loader/dataset_MIL_CIFAR.py
dataset_MIL_CIFAR.py
py
10,471
python
en
code
43
github-code
6
[ { "api_name": "platform.python_version_tuple", "line_number": 22, "usage_type": "call" }, { "api_name": "six.moves.cPickle.load", "line_number": 24, "usage_type": "call" }, { "api_name": "six.moves.cPickle", "line_number": 24, "usage_type": "name" }, { "api_name":...
38483579984
from dot_detection import detect_face from square_detectionKmeans import detect_squares import cv2 from utility import show_error_window def dotsInRange(dotCenters, xMin, xMax, yMin, yMax): numInRange = 0 for dotCenter in dotCenters: if xMin <= dotCenter[0] <= xMax and yMin <= dotCenter[1] <= yMax: ...
RobertWetzler/DiceVision
computeFinalImage.py
computeFinalImage.py
py
1,843
python
en
code
0
github-code
6
[ { "api_name": "square_detectionKmeans.detect_squares", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.rectangle", "line_number": 24, "usage_type": "call" }, { "api_name": "cv2.rectangle", "line_number": 25, "usage_type": "call" }, { "api_name": "cv2...
26041638586
from __future__ import annotations import os.path import re import shutil import textwrap import zipfile from pathlib import Path import pytest import requests from packaging.specifiers import SpecifierSet from packaging.version import Version from pkg_resources import Requirement from pants.backend.python.goals imp...
pantsbuild/pants
src/python/pants/backend/python/util_rules/pex_test.py
pex_test.py
py
34,011
python
en
code
2,896
github-code
6
[ { "api_name": "pants.testutil.rule_runner.RuleRunner", "line_number": 86, "usage_type": "call" }, { "api_name": "pants.backend.python.util_rules.pex_test_utils.rules", "line_number": 88, "usage_type": "call" }, { "api_name": "pants.backend.python.util_rules.pex_test_utils", "...
33870065833
import json import math def sortDic(d): ans = [] for key in d.keys(): ans.append((d[key], key)) ans.sort() ans.reverse() return ans def getImportantVerb(): inpath = 'count.txt' fin = open(inpath, 'r') count = json.loads(fin.read()) sumEventType = len(count) mincount =...
xcjthu/EventExtraction_law
verb/sift.py
sift.py
py
1,175
python
en
code
9
github-code
6
[ { "api_name": "json.loads", "line_number": 17, "usage_type": "call" }, { "api_name": "math.log", "line_number": 40, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 46, "usage_type": "call" } ]
74338090428
import os import pickle as pkl import time import shutil from PIL import Image import torch from torch.autograd import Variable from scipy.spatial import procrustes from torch_geometric.data import Data from torch_geometric.data import Batch import numpy as np from data import * from models import * from train import...
jiayouwyhit/deepdrawing
test.py
test.py
py
11,971
python
en
code
32
github-code
6
[ { "api_name": "PIL.Image.open", "line_number": 27, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 27, "usage_type": "name" }, { "api_name": "PIL.Image.new", "line_number": 28, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number":...
39476655285
from py2neo import Graph,Node import json # graph = Graph( # host="127.0.0.1", # neo4j 搭载服务器的ip地址,ifconfig可获取到 # http_port=7474, # neo4j 服务器监听的端口号 # user="neo4j", # 数据库user name,如果没有更改过,应该是neo4j # password="123") # graph = Graph( # host="154.8.214...
zhang8929/zhangyuguang
zhangyuan/db/import_data/import_kswys_1.py
import_kswys_1.py
py
4,703
python
zh
code
0
github-code
6
[ { "api_name": "json.loads", "line_number": 17, "usage_type": "call" }, { "api_name": "py2neo.Node", "line_number": 64, "usage_type": "call" }, { "api_name": "py2neo.Node", "line_number": 77, "usage_type": "call" } ]
27023636610
import logging import os import time import numpy as np import numpy.ma as ma from tqdm import tqdm import cv2 from PIL import Image import torch import torch.nn as nn import torch.distributed as dist from torch.nn import functional as F import pandas as pd from Tools.lib.utils.utils import AverageMeter from Tools.li...
hardworking-jws/insulator-detection-remote-sensing
Tools/lib/core/function.py
function.py
py
13,193
python
en
code
1
github-code
6
[ { "api_name": "numpy.array", "line_number": 50, "usage_type": "call" }, { "api_name": "pandas.Series", "line_number": 52, "usage_type": "call" }, { "api_name": "numpy.log", "line_number": 62, "usage_type": "call" }, { "api_name": "numpy.log", "line_number": 63...
23161073613
from sklearn import tree from sklearn.svm import SVC from sklearn.neighbors import KNeighborsClassifier # Decision Tree clf_tree = tree.DecisionTreeClassifier() # Support Vector Machine clf_svm = SVC() # KNN Classifier clf_knn = KNeighborsClassifier(n_neighbors=3) # [height, weight, shoe_size] X = [[181, 80, 44], ...
marcosmcb/machine-learning-youtube-siraj
learn-python-for-datascience/introduction/introduction.py
introduction.py
py
1,026
python
en
code
1
github-code
6
[ { "api_name": "sklearn.tree.DecisionTreeClassifier", "line_number": 7, "usage_type": "call" }, { "api_name": "sklearn.tree", "line_number": 7, "usage_type": "name" }, { "api_name": "sklearn.svm.SVC", "line_number": 10, "usage_type": "call" }, { "api_name": "sklear...
19243476086
from __future__ import absolute_import from __future__ import unicode_literals from bs4 import BeautifulSoup from packageurl import PackageURL from minecode import seed from minecode import visit_router from minecode.visitors import HttpJsonVisitor from minecode.visitors import HttpVisitor from minecode.visitors imp...
nexB/purldb
minecode/visitors/haxe.py
haxe.py
py
3,162
python
en
code
23
github-code
6
[ { "api_name": "minecode.seed.Seeder", "line_number": 15, "usage_type": "attribute" }, { "api_name": "minecode.seed", "line_number": 15, "usage_type": "name" }, { "api_name": "minecode.visitors.HttpVisitor", "line_number": 23, "usage_type": "name" }, { "api_name": ...
27138020719
import logging import os import json import youtube_dl from urlextract import URLExtract import re from mutagen.easyid3 import EasyID3 import subprocess from humanfriendly import format_timespan from pytube import YouTube, Stream import time from telegram import (Update, ReplyKeyboardMarkup, Reply...
Ahmed18117/YT-Downloder-Bot
main.py
main.py
py
13,135
python
en
code
0
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 24, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 24, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 25, "usage_type": "call" }, { "api_name": "telegram.Upda...
70058701949
import csv import json import urllib.parse import boto3 from botocore.exceptions import ClientError SENDER = "EMnify Event Notifications <b.smith@emnify.com>" RECIPIENT = "brian.smith@emnify.com" AWS_REGION = "eu-west-1" email_client = boto3.client('ses',region_name=AWS_REGION) def compose_template(description, end...
bsmth/SNS-Notification-Examples
SNStoSES/SNStoSES.py
SNStoSES.py
py
2,329
python
en
code
1
github-code
6
[ { "api_name": "boto3.client", "line_number": 12, "usage_type": "call" }, { "api_name": "botocore.exceptions.ClientError", "line_number": 57, "usage_type": "name" }, { "api_name": "json.loads", "line_number": 65, "usage_type": "call" } ]
12134561926
from django.urls import path from .import views urlpatterns =[ path('jobs/',views.getAllJobs,name='jobs'), path('jobs/new/',views.newJob,name='newJob'), path('jobs/<int:pk>/',views.getJob,name='job'), path('jobs/<int:pk>/update/',views.updataJob,name='updataJob'), path('jobs/<int:pk>/delete/',views...
baadhira/Jobbee-Job-Portal
backend/job/urls.py
urls.py
py
826
python
en
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", ...
35105609840
import gtk import cairo from pycha.bar import HorizontalBarChart class Graph(gtk.DrawingArea): def __init__(self): gtk.DrawingArea.__init__(self) self.connect("expose-event", self.expose) self.connect("size-allocate", self.size_allocate) self._surface = None self._options = ...
a926kujfkuyf/fgs
epoptes/ui/graph.py
graph.py
py
1,279
python
en
code
0
github-code
6
[ { "api_name": "gtk.DrawingArea", "line_number": 5, "usage_type": "attribute" }, { "api_name": "gtk.DrawingArea.__init__", "line_number": 7, "usage_type": "call" }, { "api_name": "gtk.DrawingArea", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pycha...
27826259981
from django.contrib.auth.forms import UserCreationForm from django.forms import ModelForm from myauth.models import MyUser class MyUserCreateForm(UserCreationForm): class Meta: model = MyUser fields = ('username', 'email', 'password1', 'password2') def __init__(self, *args, **kwargs): ...
MikhailParkin/MikhailParkin
homework_09/blog/myauth/forms.py
forms.py
py
1,013
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.auth.forms.UserCreationForm", "line_number": 7, "usage_type": "name" }, { "api_name": "myauth.models.MyUser", "line_number": 9, "usage_type": "name" }, { "api_name": "django.forms.ModelForm", "line_number": 20, "usage_type": "name" }, { ...
37481579125
''' The purpose of this chapter is: 1. Structuring the data and defining relationships. 2. Generating a SQLite3 database (if it doesn't exist already) and writing classes that will define our data in code. 3. Learning about and using the ORM. In the context of Django, every table in the database is a class and...
hsnavihS/Django-Notes
Django's Core Features/3. Programming Django Models and Creating a SQLite Databse/main.py
main.py
py
17,979
python
en
code
0
github-code
6
[ { "api_name": "django.db.models.Model", "line_number": 72, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 72, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 73, "usage_type": "call" }, { "api_name"...
17953615657
# -*- coding: utf-8 -*- import torch from lichee import config from lichee import plugin from lichee.module.torch.layer.classifier import ClassifierBasic from lichee.task.torch.task_base import BaseTask class BaseSimpleClassification(BaseTask): """Base class of simple classification. Attributes --------...
Tencent/Lichee
lichee/task/torch/simple_classification.py
simple_classification.py
py
5,903
python
en
code
295
github-code
6
[ { "api_name": "lichee.task.torch.task_base.BaseTask", "line_number": 10, "usage_type": "name" }, { "api_name": "lichee.config.get_cfg", "line_number": 30, "usage_type": "call" }, { "api_name": "lichee.config", "line_number": 30, "usage_type": "name" }, { "api_name...
2654851221
import PIL import Utils class Layer(object): def __init__(self, id, _width=0, _height=0, _octave_count=0, _frequency=0, _persistence=0, _seed=0, _threshold=0, _z=0, color = (0,0,0,0), color_weight = 1): self.id = id self.width = _width self.height = _height self.octave_count = _...
sbobovyc/DCS
DCS/src/utils/Layer.py
Layer.py
py
1,032
python
en
code
1
github-code
6
[ { "api_name": "Utils.draw_blobs", "line_number": 22, "usage_type": "call" }, { "api_name": "PIL.Image.new", "line_number": 25, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 25, "usage_type": "attribute" }, { "api_name": "Utils.draw_pixels", ...
35390050332
import numpy as np import matplotlib matplotlib.use('AGG') # import matplotlib.pyplot as plt if __name__ == '__main__': # method = 'A-GEM' dataset = 'MNIST' hidden_l4 = np.load('/home/wangshuai/project/RACL/softmaxVis/{}_{}_runid_0_hidden_trainres.npy'.format(method, dataset)) labels_l4 = np.load...
wangshauitj/MDMT-R
vis_results.py
vis_results.py
py
2,245
python
en
code
1
github-code
6
[ { "api_name": "matplotlib.use", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.set_cmap", ...
15835633441
import datetime import time from bs4 import BeautifulSoup from flask import request, jsonify, render_template, flash from selenium.webdriver import Chrome, Keys from selenium.webdriver.common.by import By from config import app, db from utils import ( get_date, get_hour_row, check_connection_for_driver, ...
BohdanLazaryshyn/rdn_test_task
app.py
app.py
py
3,870
python
en
code
0
github-code
6
[ { "api_name": "utils.get_date", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 24, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 24, "usage_type": "attribute" }, { "api_name": "flas...
36159651328
import requests from bs4 import BeautifulSoup as soup from fractions import Fraction filename = "data.txt" f = open(filename,"w", encoding='utf-8') my_url = 'https://www.tasteofhome.com/course/page/' for i in range(1, 1662): url = my_url + str(i) response = requests.get(url) html = response.content p...
MargaritaKartaviciute/FeedTheCrowdWithAngular
script.py
script.py
py
3,498
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 14, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 22, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "...
9988582076
import psutil, os, json, asyncio, logging from .. import shared logger = logging.getLogger('VIM_main') class System: def are_processes_running(required_processes=["VALORANT-Win64-Shipping.exe", "RiotClientServices.exe"]): processes = [] for proc in psutil.process_iter(): processes.ap...
colinhartigan/valorant-inventory-manager
server/src/sys_utilities/system.py
system.py
py
1,857
python
en
code
150
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 5, "usage_type": "call" }, { "api_name": "psutil.process_iter", "line_number": 11, "usage_type": "call" }, { "api_name": "psutil.subprocess.Popen", "line_number": 20, "usage_type": "call" }, { "api_name": "psutil.s...
70046337787
from functools import wraps __version__ = '0.1' import inspect class MutexInitMeta(type): ATTR_NAME_SUBINIT_MARK = '_issubinit' ATTR_NAME_ARGS = '_args' ATTR_NAME_ARG_MAP = '_arg_method_dict' def __new__(mcs, name, bases, namespace): # Initialise the class klass = super(MutexInitMet...
bagrat/mutexinit
mutexinit/__init__.py
__init__.py
py
2,385
python
en
code
0
github-code
6
[ { "api_name": "inspect.getargspec", "line_number": 66, "usage_type": "call" }, { "api_name": "functools.wraps", "line_number": 68, "usage_type": "call" } ]
30332059535
#!/usr/bin/env python # -*- coding: utf-8 -*- """ @author = 'wyx' @time = 16/9/15 17:44 @annotation = '' """ import os import re from base import util, logger, config from peewee import IntegrityError from pic.db import redis_conn as redis, db from pic.models import Manga, Page from pyquery import PyQuery as pq cla...
631068264/learn_crawler
scrap/pic/app.py
app.py
py
4,863
python
en
code
0
github-code
6
[ { "api_name": "base.logger.get", "line_number": 23, "usage_type": "call" }, { "api_name": "base.logger", "line_number": 23, "usage_type": "name" }, { "api_name": "base.logger.get", "line_number": 24, "usage_type": "call" }, { "api_name": "base.logger", "line_n...
18932721860
from tkinter import * from typing import List from random import randint, sample, randrange from colorsys import hsv_to_rgb W = 1000 H = 300 root = Tk() c = Canvas(root, width=W, height=H, bg="black") c2 = Canvas(root, width=W, height=H, bg="black") c.pack() c2.pack() # minimum v <a, b> def minimumpos(l: List[int], ...
Plasmoxy/MaturitaInformatika2019
python/strukturovane_typy/bubble_retard_sort_visual.py
bubble_retard_sort_visual.py
py
2,199
python
en
code
2
github-code
6
[ { "api_name": "typing.List", "line_number": 16, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 23, "usage_type": "name" }, { "api_name": "colorsys.hsv_to_rgb", "line_number": 32, "usage_type": "call" }, { "api_name": "random.randrange", "l...
42418888585
from cffi import FFI from pathlib import Path import sys import os def compile_bfbridge(): # API mode out-of-line # https://cffi.readthedocs.io/en/latest/overview.html#purely-for-performance-api-level-out-of-line ffibuilder = FFI() # get this directory try: cwd = Path(__file__).parent ...
camicroscope/BFBridge
python/compile_bfbridge.py
compile_bfbridge.py
py
3,704
python
en
code
1
github-code
6
[ { "api_name": "cffi.FFI", "line_number": 9, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 13, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 2...
30164561306
# %% Load birthday data import pandas as pd import numpy as np import sys sys.path.append("../") from tools.rolling import rolling_fn df = pd.read_csv("https://calmcode.io/datasets/birthdays.csv") # %% Create a subset with only data from CA, parse date properly subset_df = ( df[["state", "date", "births"]] ....
cmougan/Novartis2021
eda/rolling_means.py
rolling_means.py
py
3,215
python
en
code
0
github-code
6
[ { "api_name": "sys.path.append", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "...
2170995542
import sqlite3 # テスト用の郵便番号 code = '4600022' # データベースに接続する conn = sqlite3.connect('zip.sqlite') # 郵便番号を検索する cur = conn.cursor() res = cur.execute('SELECT * FROM zip WHERE code = ?', [code]) for row in res: print(row)
YamaK777/Study
python/study/section02/post_num/zip-test.py
zip-test.py
py
292
python
ja
code
0
github-code
6
[ { "api_name": "sqlite3.connect", "line_number": 7, "usage_type": "call" } ]
11317259164
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http...
nlp-uoregon/trankit
trankit/adapter_transformers/benchmark/benchmark.py
benchmark.py
py
6,254
python
en
code
693
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 35, "usage_type": "call" }, { "api_name": "benchmark_utils.Benchmark", "line_number": 38, "usage_type": "name" }, { "api_name": "benchmark_args.PyTorchBenchmarkArguments", "line_number": 40, "usage_type": "name" }, { ...
40390206305
import re from datetime import datetime, timedelta import requests from airflow import DAG from airflow.operators.dummy_operator import DummyOperator from airflow.operators.python_operator import PythonOperator #=================== dag config ===================== default_args = { 'owner': 'muller' } dag = DAG...
TreeKat71/30DaysOfAirflow
day05_python_oper/py_oper.py
py_oper.py
py
1,293
python
en
code
11
github-code
6
[ { "api_name": "airflow.DAG", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 15, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 20, "usage_type": "call" }, { "api_name": "requests.get", "line_num...
26523872310
from typing import List import bisect import matplotlib.pyplot as plt import pandas as pd class TextLenAnalyser(): def __init__(self, texts: List[str] = None, lens = None): """ :param texts: 文本数组 :param sep_arr: :param sep_count: 从0 到 max_len 等分sep_count 份 """ self...
Holly-Liu/Bert_medical_qa
text_len.py
text_len.py
py
1,666
python
en
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 20, "usage_type": "name" }, { "api_name": "bisect.bisect_right", "line_number": 35, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.title", ...
7365848285
import discord from discord.ext import commands import random import dice.roll as roll import sys # Token to change for bot token = '1YOUR2BOT3TOKEN5HERE4' description = "A more advanced dice rolling bot." bot = commands.Bot(command_prefix='$', description=description) @bot.event async def on_ready(): print('L...
RowenStipe/Discord-D20Bot
diceroll.py
diceroll.py
py
3,848
python
en
code
0
github-code
6
[ { "api_name": "discord.ext.commands.Bot", "line_number": 13, "usage_type": "call" }, { "api_name": "discord.ext.commands", "line_number": 13, "usage_type": "name" }, { "api_name": "random.choice", "line_number": 36, "usage_type": "call" }, { "api_name": "random.ch...