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
71271935408
#!/usr/bin/env python3 # Developed by Xieyuanli Chen and Thomas Läbe # This file is covered by the LICENSE file in the root of this project. # Brief: a simple example to split the ground truth data into training and validation parts import numpy as np from sklearn.model_selection import train_test_split def split_tr...
PRBonn/OverlapNet
src/utils/split_train_val.py
split_train_val.py
py
1,127
python
en
code
605
github-code
2
[ { "api_name": "sklearn.model_selection.train_test_split", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 32, "usage_type": "call" } ]
19459129510
''' Created on May 14, 2011 @author: Antonio Bello - Elapsus ''' from model.request_entity import RequestEntity, RequestCategoryEntity from google.appengine.ext import db from utils.enum import Enum RequestSortOrder = Enum( [ 'REQUESTOR', 'RANK', 'CATEGORY', 'SUBMITTED_ON' ] ) class RequestManager: "...
jeden/uber-support
uber-support/src/control/request_manager.py
request_manager.py
py
2,612
python
en
code
0
github-code
2
[ { "api_name": "utils.enum.Enum", "line_number": 10, "usage_type": "call" }, { "api_name": "model.request_entity.RequestCategoryEntity.all", "line_number": 17, "usage_type": "call" }, { "api_name": "model.request_entity.RequestCategoryEntity", "line_number": 17, "usage_typ...
26912086457
import numpy as np from scipy.signal import argrelextrema from dark_matter.constants import THRESHOLD def read_data_from_file(datafile): data = np.genfromtxt(datafile, delimiter=",") data = data.transpose() velocities = data[0] temperatures = data[1] return velocities, temperatures def get_v_c...
saroad2/dark_matter
src/dark_matter/util.py
util.py
py
2,117
python
en
code
0
github-code
2
[ { "api_name": "numpy.genfromtxt", "line_number": 8, "usage_type": "call" }, { "api_name": "scipy.signal.argrelextrema", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.greater", "line_number": 17, "usage_type": "attribute" }, { "api_name": "dark_ma...
29676311626
# This is designed to be a Nessus to Snort Rule generator based on the "CVE Reference" column in Nessus .csv's import csv, datetime, os, glob path = raw_input("Enter the filepath to where your Nessus CSV's are stored: ") outfile=open("msn_snort_rules.txt","w") outfile.close() x = 0 while x < len(glob.glob(os.path...
Bl00dvault/CVE-Sweeper
Archive/cve1.py
cve1.py
py
1,246
python
en
code
1
github-code
2
[ { "api_name": "glob.glob", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "glob.glob", "line_number": 8, ...
25968238331
############################################################################### # Code adapted from https://github.com/devendrachaplot/Object-Goal-Navigation # # Adapted by Pierre Marza (pierre.marza@insa-lyon.fr) # ############################################################################### ...
PierreMarza/autonerf
policy/main.py
main.py
py
27,957
python
en
code
5
github-code
27
[ { "api_name": "os.environ", "line_number": 23, "usage_type": "attribute" }, { "api_name": "arguments.get_args", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 74, "usage_type": "call" }, { "api_name": "numpy.random.seed", ...
4570791888
import pandas as pd from bs4 import BeautifulSoup from urllib.request import urlopen list_animes = [] seasons = ['winter', 'spring', 'summer', 'fall'] for year in range(1981, 2022): for season in seasons: url_by_year = 'https://myanimelist.net/anime/season/' + str(year) + '/' + season response_by...
Eivrens/DataFrame-MyAnimeList
AnimesSeasonals.py
AnimesSeasonals.py
py
6,418
python
en
code
0
github-code
2
[ { "api_name": "urllib.request.urlopen", "line_number": 12, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 14, "usage_type": "call" }, { "api_name": "urllib.request.urlopen", "line_number": 18, "usage_type": "call" }, { "api_name": "bs4.B...
1409377798
# coding=utf-8 import dispatcher import manager import rpc TOPIC = 'sendout_request' class Service(object): def __init__(self): self.topic = TOPIC self.manager = manager.Manager() def start(self): self.conn = rpc.create_connection() # 创建RabbitMQ连接 rpc_dis...
hxssgaa/LearnPython
CorePython/corepython/fun/rpc/service.py
service.py
py
667
python
en
code
0
github-code
27
[ { "api_name": "manager.Manager", "line_number": 12, "usage_type": "call" }, { "api_name": "rpc.create_connection", "line_number": 15, "usage_type": "call" }, { "api_name": "dispatcher.RpcDispatcher", "line_number": 16, "usage_type": "call" } ]
14905591744
from src.cla_mcr_back import main from hyperopt import hp, tpe from hyperopt import fmin def objective(args): mcr_len, std_mult = args return 1./main(dimension_of_mcr_vectors=mcr_len, threshold_std_multiplier=std_mult, sparseness=0.0002, dimension_of_cla_vectors=65536) def objective1(args): mcr_len, std_m...
pulinagrawal/cla-to-mcr
src/scratch.py
scratch.py
py
648
python
en
code
0
github-code
2
[ { "api_name": "src.cla_mcr_back.main", "line_number": 7, "usage_type": "call" }, { "api_name": "hyperopt.hp.choice", "line_number": 14, "usage_type": "call" }, { "api_name": "hyperopt.hp", "line_number": 14, "usage_type": "name" }, { "api_name": "hyperopt.hp.unifo...
34766171094
# -*- coding: utf-8 -*- # @Time : 2021/3/23 23:30 # @File : jsl_double_low.py # @Author : Rocky C@www.30daydo.com # -*-coding=utf-8-*- # @Time : 2019/9/2 9:35 # @File : send_bond_info.py # 发送邮件的,集思录双底 import sys sys.path.append('..') import pandas as pd import datetime from configure.settings import DBSelector from c...
Rockyzsu/convertible_bond
datahub/jsl_double_low.py
jsl_double_low.py
py
2,922
python
en
code
178
github-code
2
[ { "api_name": "sys.path.append", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "common.BaseService.BaseService", "line_number": 45, "usage_type": "name" }, { "api_name": "configur...
13572104859
from ibm_watson_machine_learning import APIClient import math import PIL from PIL import Image import numpy as np from flask import Flask, request, json, jsonify import os import requests token = os.environ['TOKEN'] deployment_id = os.environ['DEPLOYMENT_ID'] model_deployment_endpoint_url = f'https://cpd...
Workshop-Sogei-MLOps/Workshop-MLOps-app
server.py
server.py
py
1,906
python
en
code
0
github-code
2
[ { "api_name": "os.environ", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.asarray", "line_number": 17, "usage_type": "call" }, { "api_name": "flask.Flask", "line...
23914121814
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ incomplete routines: - download image from WMS - add world file to the downloaded image - classify to extract particular info - vectorize the binary classified image """ import os,sys,math from owslib.wms import WebMapService def write_worldfile(iname,psize,xulcoord,y...
cmaene/ImageAnalysis
WMS/process_wms.py
process_wms.py
py
3,914
python
en
code
1
github-code
2
[ { "api_name": "owslib.wms.WebMapService", "line_number": 59, "usage_type": "call" }, { "api_name": "math.ceil", "line_number": 79, "usage_type": "call" }, { "api_name": "math.ceil", "line_number": 80, "usage_type": "call" }, { "api_name": "os.system", "line_nu...
30293868378
from pathlib import Path import streamlit as st from PIL import Image # --- PATH SETTINGS --- current_dir = Path(__file__).parent if "__file__" in locals() else Path.cwd() css_file = current_dir / "main.css" resume_file = current_dir / "CV.pdf" profile_pic = current_dir / "profile-pic.png" # --- GENERAL SETTINGS -...
TaiNg365/streamlit-profile
app.py
app.py
py
5,688
python
en
code
0
github-code
2
[ { "api_name": "pathlib.Path", "line_number": 8, "usage_type": "call" }, { "api_name": "pathlib.Path.cwd", "line_number": 8, "usage_type": "call" }, { "api_name": "streamlit.set_page_config", "line_number": 34, "usage_type": "call" }, { "api_name": "streamlit.markd...
70840662768
import torch.nn as nn import torch import torch.nn.functional as F class CNN_layer(nn.Module): def __init__(self, in_channel, out_channel, num_layers): super().__init__() start_block = [nn.Conv2d(in_channel, out_channel, kernel_size=3, padding=1), nn.BatchNorm2d(out_channel),...
jsh0551/model_implementation
base_model/CNN/VGGNet.py
VGGNet.py
py
2,874
python
en
code
0
github-code
2
[ { "api_name": "torch.nn.Module", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 5, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.nn", "line_numbe...
6457009468
from django import template from analysis.performance_analysis import rank_tier import time register = template.Library() def print_timestamp(timestamp): right_now = time.time() ts = float(right_now) - float(timestamp) if ts < 86400: return str(round(ts/3600))+' hours ago' elif ts < 172800: ...
1chimaruGin/DotaAnalysis
analysis/templatetags/timetags.py
timetags.py
py
864
python
en
code
2
github-code
27
[ { "api_name": "django.template.Library", "line_number": 5, "usage_type": "call" }, { "api_name": "django.template", "line_number": 5, "usage_type": "name" }, { "api_name": "time.time", "line_number": 9, "usage_type": "call" }, { "api_name": "time.strftime", "l...
41152430305
from http import HTTPStatus from typing import Any, Dict, Optional, Union import httpx from ... import errors from ...client import Client from ...models.server_validation_error_response import ServerValidationErrorResponse from ...models.users_user import UsersUser from ...models.users_user_patch import UsersUserPat...
jgoodson/vail-sphere-rest-api-client
vail_sphere_rest_api_client/api/default/update_cognito_user.py
update_cognito_user.py
py
5,025
python
en
code
0
github-code
27
[ { "api_name": "client.Client", "line_number": 17, "usage_type": "name" }, { "api_name": "models.users_user_patch.UsersUserPatch", "line_number": 18, "usage_type": "name" }, { "api_name": "client.base_url", "line_number": 20, "usage_type": "attribute" }, { "api_nam...
23980005616
# -- coding:utf-8 -- import numpy as np import pandas as pd from sklearn import metrics import matplotlib.pyplot as plt import seaborn as sns from sklearn.metrics import f1_score, precision_score, recall_score from sklearn.metrics import auc, roc_curve import utils import warnings from generate_score_form import sc...
HAIRLAB/Risk_Score_COVID_19
svc_score.py
svc_score.py
py
21,504
python
en
code
2
github-code
27
[ { "api_name": "warnings.filterwarnings", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 28, "usage_type": "attribute" }, { "api_name": "numpy.exp", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.concatenate"...
28371839501
from itertools import count from collections import defaultdict import numpy as np from .processor import EVAL_METHOD from .table_renderer import TableRenderer class confusion_counter(object): """ Class Variable: DISPLAY_METHOD: {0, 1, 2, 3} 0 = in absolute count 1 = in all p...
qianyizhang/zqy-utils
zqy_utils/result_parser/eval_confusion.py
eval_confusion.py
py
9,372
python
en
code
0
github-code
27
[ { "api_name": "collections.defaultdict", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 52, "usage_type": "call" }, { "api_name": "table_renderer.TableRenderer", "line_number": 83, "usage_type": "call" }, { "api_name": "iter...
25713872118
import azure.functions as func import logging import json # Store the connected clients connected_clients = set() def main(req: func.HttpRequest, context: func.Context) -> func.HttpResponse: # Handle HTTP requests as usual # ... # Handle WebSocket requests if 'Upgrade' in req.headers.ge...
Fpratss/UPF_TradingApp
TradingBot/__init__.py
__init__.py
py
1,081
python
en
code
0
github-code
27
[ { "api_name": "azure.functions.HttpRequest", "line_number": 8, "usage_type": "attribute" }, { "api_name": "azure.functions", "line_number": 8, "usage_type": "name" }, { "api_name": "azure.functions.Context", "line_number": 8, "usage_type": "attribute" }, { "api_na...
35703891894
import re from datetime import datetime class Date: __DATE_PATTERN = re.compile(r'^(?:\d{2}-){2}\d{4}$') @staticmethod def validate_date(date): try: if not Date.__DATE_PATTERN.match(date): raise ValueError('Invalid date format') datetime.strptime(date, '%d-...
kirill-grechin/python-basics
grechin_kirill_hw_11/task_1.py
task_1.py
py
834
python
en
code
0
github-code
27
[ { "api_name": "re.compile", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 13, "usage_type": "name" } ]
32676759147
''' Parallelized script for computing the difference accuracy scores for crack detection ''' import multiprocessing as mp from multiprocessing import Pool import glob, os import pandas as pd from lib.arg_parser.general_args import parse_args_eval from lib.eval.compute_scores import compute_scores from lib.utils.save_hi...
achrefjaziri/SimCrack
run_parallel_eval.py
run_parallel_eval.py
py
6,516
python
en
code
1
github-code
2
[ { "api_name": "warnings.filterwarnings", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 40, "usage_type": "call" }, { "api_name": "os.path", "line_number": 40, "usage_type": "attribute" }, { "api_name": "os.path.join", ...
32423595421
from typing import List class Solution: def findDiagonalOrder(self, nums: List[List[int]]) -> List[int]: return [x for d, j, i, x in sorted([(i + j, j, i, x) for i, r in enumerate(nums) for j, x in enumerate(r)])] if __name__ == '__main__': solver = Solution() cases = [ [[1,2,3,4,5,6]], [[1,2,3],[4,...
gyang274/leetcode
src/1400-1499/1424.diagonal.traverse.py
1424.diagonal.traverse.py
py
574
python
en
code
1
github-code
27
[ { "api_name": "typing.List", "line_number": 4, "usage_type": "name" } ]
38148187111
import cv2 import mediapipe from light_control import * camera_id = 0 capture = cv2.VideoCapture(camera_id) drawingModule = mediapipe.solutions.drawing_utils handsModule = mediapipe.solutions.hands frameWidth = capture.get(cv2.CAP_PROP_FRAME_WIDTH) frameHeight = capture.get(cv2.CAP_PROP_FRAME_HEIGHT) with handsMo...
thieulong/RPI-Light-Control-Using-Fingers
main.py
main.py
py
6,390
python
en
code
0
github-code
27
[ { "api_name": "cv2.VideoCapture", "line_number": 7, "usage_type": "call" }, { "api_name": "mediapipe.solutions", "line_number": 9, "usage_type": "attribute" }, { "api_name": "mediapipe.solutions", "line_number": 10, "usage_type": "attribute" }, { "api_name": "cv2....
19474258307
import numpy as np from scipy.special import gamma def mean(v_c, w, alpha, dof): b_dof = (dof / np.pi) ** 0.5 * gamma(0.5 * (dof - 1)) / gamma(0.5 * dof) delta = alpha / np.sqrt(1 + alpha ** 2) return v_c + w * delta * b_dof def std(w, alpha, dof): b_dof = (dof / np.pi) ** 0.5 * gamma(0.5 * (dof - 1...
florpi/GaussianStreamingModel
gsm/models/skewt/parameters2moments.py
parameters2moments.py
py
1,518
python
en
code
0
github-code
27
[ { "api_name": "numpy.pi", "line_number": 6, "usage_type": "attribute" }, { "api_name": "scipy.special.gamma", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number...
74343404872
__author__ = 'ericrincon' __author__ = 'ericrincon' import os import gensim import numpy import linecache from random import shuffle from gensim import utils from gensim.models import Doc2Vec from gensim.models.doc2vec import TaggedLineDocument from gensim.models.doc2vec import TaggedDocument import gensim.models.do...
ericrincon/Deep-Learning-NLP
Doc2vec/Doc2VecTool.py
Doc2VecTool.py
py
4,671
python
en
code
2
github-code
27
[ { "api_name": "numpy.random.permutation", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 25, "usage_type": "attribute" }, { "api_name": "gensim.utils.smart_open", "line_number": 27, "usage_type": "call" }, { "api_name": "ge...
26178779336
from concurrent.futures import ThreadPoolExecutor from confluent_kafka import Consumer, KafkaError, TopicPartition import json import heapq import time def consume_segment_topic(partition): # Create the Kafka consumer configuration conf = {'bootstrap.servers': 'localhost:9091,localhost:9092,localhost:9093', 'g...
kohinoorthinks/kafka-streaming
data-stream-scalable-concurrent-consumer.py
data-stream-scalable-concurrent-consumer.py
py
2,420
python
en
code
0
github-code
27
[ { "api_name": "confluent_kafka.Consumer", "line_number": 12, "usage_type": "call" }, { "api_name": "confluent_kafka.TopicPartition", "line_number": 16, "usage_type": "call" }, { "api_name": "confluent_kafka.KafkaError._PARTITION_EOF", "line_number": 27, "usage_type": "att...
36093344718
import pygame from utils import resource_path class Map: def __init__(self, imagePath): # grab the images and scales it before storing into self.image self.image = pygame.transform.smoothscale_by( pygame.image.load(resource_path(imagePath)), .63) # width of the area on the map ...
Euler-s-Theorem/mountain-top-game-jam-2023
src/map.py
map.py
py
1,111
python
en
code
0
github-code
27
[ { "api_name": "pygame.transform.smoothscale_by", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.transform", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pygame.image.load", "line_number": 9, "usage_type": "call" }, { "api_name": "...
1152646701
import numpy as np import torch from typing import Callable, Union, List, Tuple from ...data.samples import Sample, Batch from ...data.datatypes import TaskType from ...data.metadata.types import SampleMetadataCommonTypes class OODMethod: def __init__(self, hyperparams={}) -> None: pass def get_par...
MECLabTUDA/FrOoDo
froodo/ood/methods/ood_methods.py
ood_methods.py
py
3,442
python
en
code
24
github-code
27
[ { "api_name": "typing.Union", "line_number": 30, "usage_type": "name" }, { "api_name": "torch.tensor", "line_number": 30, "usage_type": "attribute" }, { "api_name": "typing.List", "line_number": 30, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_n...
31852610487
""" IDK YET Test on mac in ipython: run plot_time_his -gtx cas6_v0_live -test False """ import pandas as pd from lo_tools import Lfun from lo_tools import extract_argfun as exfun from lo_tools import plotting_functions as pfun import pickle import numpy as np import VFC_functions as vfun import matplotlib.pyplot...
dakotamm/LO_user
timeseries_seasons_w_year_avg.py
timeseries_seasons_w_year_avg.py
py
13,712
python
en
code
0
github-code
2
[ { "api_name": "matplotlib.pyplot.rc", "line_number": 36, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 36, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.rc", "line_number": 37, "usage_type": "call" }, { "api_name": "matplotli...
14816662863
"""Mediainfo related code.""" import os import math import hashlib import subprocess from lxml import etree from datetime import datetime, timedelta from encarne.logger import Logger def check_duration(origin, temp, seconds=1): """Check if the duration is bigger than a specific amount.""" # If the destinati...
Nukesor/encarne
encarne/media.py
media.py
py
4,062
python
en
code
11
github-code
2
[ { "api_name": "encarne.logger.Logger.info", "line_number": 22, "usage_type": "call" }, { "api_name": "encarne.logger.Logger", "line_number": 22, "usage_type": "name" }, { "api_name": "encarne.logger.Logger.info", "line_number": 25, "usage_type": "call" }, { "api_n...
72542298951
from odoo import api, fields, models, _ from odoo.exceptions import UserError, ValidationError from datetime import datetime,date, timedelta class AccountMove(models.Model): _inherit = 'account.move' def send_grp_email(self, grp_name, subject, msg): partn_ids = [] user_names = '' group...
kingsleyuk2003/odoo14
odoo-custom-addons/kin_account/models/account.py
account.py
py
9,843
python
en
code
0
github-code
27
[ { "api_name": "odoo.models.Model", "line_number": 5, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 5, "usage_type": "name" }, { "api_name": "odoo.exceptions.UserError", "line_number": 30, "usage_type": "call" }, { "api_name": "odoo.excep...
71812244551
#brought to you by nananananate #theoretical from utilities import * from sys_info import * import discord import asyncio import process_json #import google_api_interact <---- not needed import time import datetime import random import sys import decode from collections import defaultdict client = discord.Client()...
piewalker442/discord-bot
security.py
security.py
py
43,552
python
en
code
0
github-code
27
[ { "api_name": "discord.Client", "line_number": 19, "usage_type": "call" }, { "api_name": "time.time", "line_number": 22, "usage_type": "call" }, { "api_name": "time.time", "line_number": 32, "usage_type": "call" }, { "api_name": "collections.defaultdict", "lin...
73545814471
import datetime from pathlib import Path from os import path class log_notifier: def __init__(self, agent_name, logfile): self.agent_name = agent_name self.logfile = file = (f"{Path().absolute()}/../../log/{logfile}") # Posting to the Console def notify(self, text): if text == ...
nghazali/KubeCapWatch
src/KubeCapWatch/notify/logger.py
logger.py
py
823
python
en
code
0
github-code
27
[ { "api_name": "pathlib.Path", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_...
11159809938
import logging import cv2 from lib.helpers import calculate_relative_coords, pop_if_full LOGGER = logging.getLogger(__name__) class DetectedObject: """Object that holds a detected object. All coordinates and metrics are relative to make it easier to do calculations on different image resolutions""" def...
linchiyu/learning
viseron-master/src/lib/detector.py
detector.py
py
4,617
python
en
code
0
github-code
27
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "lib.helpers.calculate_relative_coords", "line_number": 29, "usage_type": "call" }, { "api_name": "cv2.ocl.haveOpenCL", "line_number": 99, "usage_type": "call" }, { "api_nam...
18989455847
from django.urls import path from . import views urlpatterns = [ path("news/", views.PostListGetApi.as_view(), name="posts"), path("news/create/", views.PostCreateApi.as_view(), name="new_post"), path( "news/<int:id>/", views.PostGetDeleteUpdateApi.as_view(), name="post_detail" ...
rdchvd/news-web-api
newsproject/newsapp/urls.py
urls.py
py
936
python
en
code
0
github-code
27
[ { "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", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", ...
73344143432
import aiohttp import collections import random API_URL_BASE = 'https://api.coingecko.com/api/v3/' CoinInfo = collections.namedtuple('CoinInfo', 'id symbol name') class CoinGeckoAPI: """Simple wrapper over Coingecko's API in using async.""" def __init__(self, api_base_url=API_URL_BASE): ...
TricksterGuy/DiscordCryptoBot
coingecko_helper.py
coingecko_helper.py
py
3,497
python
en
code
1
github-code
27
[ { "api_name": "collections.namedtuple", "line_number": 7, "usage_type": "call" }, { "api_name": "aiohttp.ClientSession", "line_number": 14, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 18, "usage_type": "call" }, { "api_name": "r...
74556815431
from unittest.mock import patch import pytest with patch('cyware.khulnasoft.common.cyware_uid'): with patch('cyware.khulnasoft.common.cyware_gid'): from cyware.core.logtest import send_logtest_msg from cyware.core.common import LOGTEST_SOCKET @pytest.mark.parametrize('params', [ {'command': ...
cyware/cyware
framework/cyware/core/tests/test_logtest.py
test_logtest.py
py
1,430
python
en
code
0
github-code
27
[ { "api_name": "unittest.mock.patch", "line_number": 5, "usage_type": "call" }, { "api_name": "unittest.mock.patch", "line_number": 6, "usage_type": "call" }, { "api_name": "unittest.mock.patch", "line_number": 27, "usage_type": "call" }, { "api_name": "cyware.core...
28428956266
from query import decrypt_audit_log from hashlib import sha256 import csv import os from datetime import datetime def hashFunction(filename): cipher = sha256() with open(filename, 'rb') as f: for byte_block in iter(lambda: f.read(4096), b""): cipher.update(byte_block) #hashed = sha256...
Prasoon04/CSCI-531-Applied-Cryptography
Semester Project/immutability.py
immutability.py
py
2,408
python
en
code
0
github-code
27
[ { "api_name": "hashlib.sha256", "line_number": 10, "usage_type": "call" }, { "api_name": "query.decrypt_audit_log", "line_number": 27, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 31, "usage_type": "call" }, { "api_name": "csv.writer", "l...
28047769666
#!/usr/bin/env python # # Creates a sysdig capture, waits for termination and prints the download URL. # import sys import time from sdcclient import SdcClient # # Parse arguments # if len(sys.argv) not in (5, 6): print(('usage: %s <sysdig-token> hostname capture_name duration [filter]' % sys.argv[0])) print...
sysdiglabs/sysdig-sdk-python
examples/create_sysdig_capture.py
create_sysdig_capture.py
py
1,388
python
en
code
57
github-code
2
[ { "api_name": "sys.argv", "line_number": 14, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 15, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 17, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 19...
21198308572
import pygame from colour import Color pygame.init() GREEN = (0,255,0) WHITE = (255,255,255) BLUE = (0,0,255) class Room(pygame.sprite.Sprite): vertex_list = [] color = BLUE obstacles = [] surface_size = None def __init__(self, vertex_list, screen_sz): super().__init__() self....
dreilly369/AppliedMathForSecurityBook
Chapter 12 - AGP Implementation/AGP_project/gui_test.py
gui_test.py
py
2,270
python
en
code
8
github-code
2
[ { "api_name": "pygame.init", "line_number": 4, "usage_type": "call" }, { "api_name": "pygame.sprite", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pygame.Surface", "line_number": 23, "usage_type": "call" }, { "api_name": "pygame.draw.polygon", ...
3108623553
from typing import Annotated from typing import Dict from typing import List from typing import Optional from vortex.Tuple import Tuple from peek_plugin_diagram.tuples.grids.GridKeyTuple import GridKeyTuple class WorkerDiagramGridApi: @classmethod def getGridKeys( cls, modelSetKey: str, ...
Synerty/peek-plugin-diagram
peek_plugin_diagram/worker/WorkerDiagramGridApi.py
WorkerDiagramGridApi.py
py
3,176
python
en
code
0
github-code
2
[ { "api_name": "typing.Annotated", "line_number": 17, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 17, "usage_type": "name" }, { "api_name": "peek_plugin_diagram._private.worker.api.WorkerDiagramGridApiImpl.WorkerDiagramGridApiImpl.getGridKeys", "line_nu...
41833769747
""" boardPlot.py Class file containing all the methods for generating and updating image of the board as well as the interactivity """ from matplotlib.patches import Rectangle from matplotlib.collections import PatchCollection import matplotlib.pyplot as plt YELLOW = (1.0, 1.0,0.0, 0.9) class boardPlot: def __...
dennis-chn/minesweeper-python
boardPlot.py
boardPlot.py
py
5,670
python
en
code
0
github-code
27
[ { "api_name": "matplotlib.patches.Rectangle", "line_number": 32, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.draw", "line_number": 76, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 76, "usage_type": "name" }, { "api_name": ...
19694886398
import dash # Import core components from dash import dcc # import dash_core_components as dcc # Import html components from dash import html # import dash_html_components as html from dash.dependencies import Input, Output import plotly.express as px df = px.data.iris() all_dims = ['sepal_length', 'sepal_width', ...
algoquant/python
dash_iris.py
dash_iris.py
py
900
python
en
code
3
github-code
2
[ { "api_name": "plotly.express.data.iris", "line_number": 11, "usage_type": "call" }, { "api_name": "plotly.express.data", "line_number": 11, "usage_type": "attribute" }, { "api_name": "plotly.express", "line_number": 11, "usage_type": "name" }, { "api_name": "dash...
37071291428
import sys,os import curses from itertools import product from pulp import * class Sudoku: x_size = 19 y_size = 38 x_offset = 0 y_offset = 0 subboards = {} x_sub_off = 12 y_sub_off = 6 x_sub_size = 11 y_sub_size = 6 map = {} state = {} solutions = [] win = None n...
awright96/SudokuCLI
sudoku.py
sudoku.py
py
8,935
python
en
code
0
github-code
27
[ { "api_name": "itertools.product", "line_number": 27, "usage_type": "call" }, { "api_name": "itertools.product", "line_number": 33, "usage_type": "call" }, { "api_name": "itertools.product", "line_number": 35, "usage_type": "call" }, { "api_name": "curses.color_pa...
10192364559
# Create a colorize(text, color) function that contain this tuple # colors = ('cyan', 'yellow', 'blue', 'green', 'magenta') # If the color is not present in the tuple, raise a ValueError exception # If the text is not a string raise a TypeError Exception # make sure to catch the exception # Here are 2 ways of calling...
ilyanosovsky/DI_Bootcamp
Week3/Day4/class.py
class.py
py
1,148
python
en
code
0
github-code
2
[ { "api_name": "requests.get", "line_number": 38, "usage_type": "call" } ]
22469441256
import json import logging from collections import namedtuple import aio_pika import aiomysql async def init_mysql(app): conf = app['config']['db'] conn = await aiomysql.create_pool( host=conf['host'], port=conf['port'], user=conf['user'], password=conf['password'], db=conf['database']) ...
therearesomewhocallmetim/prognet
_root/db.py
db.py
py
1,869
python
en
code
1
github-code
2
[ { "api_name": "aiomysql.create_pool", "line_number": 12, "usage_type": "call" }, { "api_name": "aio_pika.connect_robust", "line_number": 25, "usage_type": "call" }, { "api_name": "aio_pika.pool.Pool", "line_number": 27, "usage_type": "call" }, { "api_name": "aio_p...
17094323525
from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_bootstrap import Bootstrap from flask_login import LoginManager from flask_gravatar import Gravatar import os # Initialize sqlalchemy db = SQLAlchemy() # Main Application Function def create_app(): app = Flask(__name__) # INITIALIZE ...
nwizugbesamson/online_shop
project/__init__.py
__init__.py
py
1,835
python
en
code
1
github-code
2
[ { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 14, "usage_type": "call" }, { "api_name": "flask_bootstrap.Bootstrap", "line_number": 20, "usage_type": "call" }, { "api_name": "flas...
11328515825
from collections import deque def shortestPathBinaryMatrix(grid) -> int: if not grid or not (grid[0][0] == 0 and grid[-1][-1] == 0): return -1 grid[0][0] = 1 queue = deque([(0, 0)]) directions = [(0, 1), (1, 0), (1, -1), (1, 1), (0, -1), (-1, 0), (-1, 1), (-1, -1)] while queue: r, c...
a-gon/problem_solutions
medium/shortestPathBinaryMatrix.py
shortestPathBinaryMatrix.py
py
786
python
en
code
0
github-code
2
[ { "api_name": "collections.deque", "line_number": 7, "usage_type": "call" } ]
42619989493
import paho.mqtt.client as mqtt_client import socket import os import sys import subprocess import hashlib from Crypto.Cipher import AES from Crypto.Util.Padding import pad, unpad import json import locale import threading import time systype = ("windows" if os.name == "nt" else "unix") def getpath(): ...
Minecraft-vIIr/FCTRL-tools
target.py
target.py
py
6,497
python
en
code
1
github-code
27
[ { "api_name": "os.name", "line_number": 14, "usage_type": "attribute" }, { "api_name": "sys.executable", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_...
36652536110
# -*- coding: utf-8 -*- from __future__ import unicode_literals from datetime import timedelta, date from django import forms from django.contrib.auth.forms import AuthenticationForm, UserChangeForm from applications.accounts.models import User class ProfileForm(forms.ModelForm): class Meta: model = Us...
ersul4ik/acs
applications/accounts/forms.py
forms.py
py
2,545
python
en
code
0
github-code
2
[ { "api_name": "django.forms.ModelForm", "line_number": 12, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 12, "usage_type": "name" }, { "api_name": "applications.accounts.models.User", "line_number": 14, "usage_type": "name" }, { "api_na...
12465465847
import discord from discord.ext import commands class Help(commands.Cog): """Return help about commands and more""" def __init__(self, bot): self.bot = bot @commands.command() async def help(self, message): """About Whitea and discord server.""" ...
6eba610ia9/WhiteaBot
whitea/cogs/help.py
help.py
py
3,779
python
en
code
2
github-code
2
[ { "api_name": "discord.ext.commands.Cog", "line_number": 4, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 4, "usage_type": "name" }, { "api_name": "discord.ext.commands", "line_number": 20, "usage_type": "name" }, { "api_name": ...
73764694127
from project_api.utils import StandardException from firebase_admin import messaging from django.utils.translation import ugettext_lazy class FirebaseAppPush: def __init__(self, registration_token, title: str, body: str, data=None): self.registration_token = registration_token self.title = title ...
lasval/DockerOnDjangoStarter
django/project_api/firebase_notification.py
firebase_notification.py
py
1,578
python
en
code
0
github-code
2
[ { "api_name": "firebase_admin.messaging.Message", "line_number": 15, "usage_type": "call" }, { "api_name": "firebase_admin.messaging", "line_number": 15, "usage_type": "name" }, { "api_name": "firebase_admin.messaging.Notification", "line_number": 16, "usage_type": "call"...
23907899837
import tensorflow as tf import tensorflow_hub as hub from time import time import pandas as pd import matplotlib import numpy as np matplotlib.use('Agg') import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from keras.callbacks import EarlyStopping, ModelCheckpoint import tensorflow a...
lethaiq/Siamese-LSTM2
transformer.py
transformer.py
py
6,381
python
en
code
0
github-code
2
[ { "api_name": "matplotlib.use", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 31, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 44, "usage_type": "call" }, { "api_name":...
42616640102
# !/usr/bin/env python # -*-coding:utf-8 -*- """ @ Time : 2023/01/15 @ Author: Zng_sh @ Description: jieba分词统计 """ import global_variable as glv import input_json_data as ijd import jieba jieba.setLogLevel(jieba.logging.INFO) # jieba 词库调整 jieba.load_userdict("Jieba_word_frequency_adjustment_dict.txt"...
Zng-zy/WordFrequencyAnalysis
hong_lou_meng/jieba_word_segmentation_statistics.py
jieba_word_segmentation_statistics.py
py
4,668
python
en
code
0
github-code
2
[ { "api_name": "jieba.setLogLevel", "line_number": 13, "usage_type": "call" }, { "api_name": "jieba.logging", "line_number": 13, "usage_type": "attribute" }, { "api_name": "jieba.load_userdict", "line_number": 16, "usage_type": "call" }, { "api_name": "jieba.lcut",...
24745248425
# This script will make a plot of the along ring comparisons for ne and Te to # Thomson scattering data. Also do a comparison of the radial profiles at the # location the TS points mapped to the OMP. # 2D grid where the left two are radial comparisons and the right two are along # ring for ring 40. import oedge_plots i...
shawnzamperini/d3dscripts
2021/03/nf_bg_comp.py
nf_bg_comp.py
py
6,117
python
en
code
0
github-code
2
[ { "api_name": "matplotlib.pyplot.rcParams", "line_number": 13, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 13, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.rc", "line_number": 14, "usage_type": "call" }, { "api_name":...
19305600444
import logging import numpy as np import vxi11 import json import sys from .AbstractSignalGenerator import AbstractSignalGenerator import time def validate_channel(func): def inner(self, *args, **kwargs): allowed_channels = [1, 2] if len(args) > 0: if args[0] not in allowed_channels: ...
RNO-G/radiant-test
radiant_test/Keysight81160A.py
Keysight81160A.py
py
7,282
python
en
code
0
github-code
2
[ { "api_name": "numpy.max", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.abs", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.round", "line_number": 28, "usage_type": "call" }, { "api_name": "AbstractSignalGenerator.AbstractSigna...
27029556068
#! /usr/bin/python from __future__ import division # python2 compatibility from time import time import math import subprocess import json BLOCKS = ["", "", "", "", "", "", "", "", ""] CHARGING_CHARACTER = "" EMPTY_BLOCK_CHARGING = '|' EMPTY_BLOCK_DISCHARGING = '⍀' FULL_BLOCK = '' color_good="#24708A" co...
Kalior/dotfiles
conky/battery.py
battery.py
py
1,915
python
en
code
0
github-code
2
[ { "api_name": "subprocess.check_output", "line_number": 23, "usage_type": "call" }, { "api_name": "subprocess.STDOUT", "line_number": 23, "usage_type": "attribute" }, { "api_name": "math.ceil", "line_number": 40, "usage_type": "call" }, { "api_name": "subprocess.c...
15727214415
import bencode_torrent import requests import hashlib import sys import os from datetime import datetime import bencodepy from struct import * class tracker: def __init__(self, url, torrent): self.url = url info_hash = hashlib.sha1() peer_id = hashlib.sha1() peer_id.update(str(os.getpid()).encode()) peer_id...
Rohan17rp/bittorent-client
tracker.py
tracker.py
py
1,460
python
en
code
0
github-code
2
[ { "api_name": "hashlib.sha1", "line_number": 13, "usage_type": "call" }, { "api_name": "hashlib.sha1", "line_number": 14, "usage_type": "call" }, { "api_name": "os.getpid", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line...
30461536168
import sys try: from django.conf import settings import django settings.configure( DEBUG=True, USE_TZ=True, DATABASES={ "default": { "ENGINE": "django.db.backends.sqlite3", } }, ROOT_URLCONF="cla_common.urls", INSTALLE...
ministryofjustice/cla_common
runtests.py
runtests.py
py
1,178
python
en
code
1
github-code
2
[ { "api_name": "django.conf.settings.configure", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.settings", "line_number": 7, "usage_type": "name" }, { "api_name": "django.setup", "line_number": 28, "usage_type": "call" }, { "api_name": "django...
26789433304
import inspect import os import sys from Crypto.Cipher import PKCS1_OAEP from Crypto.PublicKey import RSA def _get_script_dir(follow_symlinks=True) -> str: '''получить директорию со скриптом''' # https://clck.ru/P8NUA if getattr(sys, 'frozen', False): # type: ignore path = os.path.abspath(sys.e...
po1nt-1/shodaner
creepy.py
creepy.py
py
1,623
python
en
code
0
github-code
2
[ { "api_name": "os.path.abspath", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "sys.executable", "line_number": 14, "usage_type": "attribute" }, { "api_name": "inspect.getabsfile",...
22117634898
from setuptools import setup packages = [ 'hype' ] setup( name='hype.py', author='nap', url='https://github.com/devliftz/', version=1.5, packages=packages, license='MIT', description='Hypecord', include_package_data=True, python_requires='>=3.8.0', classifie...
devliftz/hype.py
setup.py
setup.py
py
943
python
en
code
0
github-code
2
[ { "api_name": "setuptools.setup", "line_number": 7, "usage_type": "call" } ]
72763408365
from PyQt5 import QtCore, QtGui, QtWidgets from Model.leftgui import LeftGUI from Model.rightgui import RightGUI class MainGUI: def __init__(self, dialog): self.dialog = dialog self.left_gui = LeftGUI(dialog) self.right_gui = RightGUI(dialog) self.left_gui.setupUi() self.ri...
Oussama-Maati/buddy-maker
View/gui.py
gui.py
py
3,473
python
en
code
0
github-code
2
[ { "api_name": "Model.leftgui.LeftGUI", "line_number": 9, "usage_type": "call" }, { "api_name": "Model.rightgui.RightGUI", "line_number": 10, "usage_type": "call" }, { "api_name": "PyQt5.QtGui.QIcon", "line_number": 19, "usage_type": "call" }, { "api_name": "PyQt5....
1234713159
import requests,datetime webUrl= "https://pixe.la/v1/users" TOKEN = "dvgdfrSf6F2GMqkVe" USERNAME = "sharath44665" GRAPH_ID = "graph1" userParamerters ={ "token" : TOKEN, "username" : USERNAME, "agreeTermsOfService" : "yes", "notMinor" : "yes" } # creating user # response = requests.post(url=webUrl, j...
Sharath44665/pythonWorkSpace
habit-traker/main.py
main.py
py
1,648
python
en
code
0
github-code
2
[ { "api_name": "datetime.datetime", "line_number": 38, "usage_type": "call" }, { "api_name": "requests.delete", "line_number": 66, "usage_type": "call" } ]
70312449327
""" Proxy Server Implementation using asyncio. The very high level overview is as follows: - Spawn one coroutine per client connection and create a reverse proxy layer to example.com - Process any commands from layer (such as opening a server connection) - Wait for any IO and send it as events to top layer...
The-Cracker-Technology/mitmproxy
mitmproxy/proxy/server.py
server.py
py
19,037
python
en
code
1
github-code
2
[ { "api_name": "asyncio.Event", "line_number": 33, "usage_type": "attribute" }, { "api_name": "typing.Callable", "line_number": 36, "usage_type": "attribute" }, { "api_name": "typing.Any", "line_number": 36, "usage_type": "attribute" }, { "api_name": "time.time", ...
38923869892
import enum import json #Acrobotv1-OpenAPIv1.json class HttpController: def __init__(self, handler): self.handler = handler def get(self, path, accept=None): if path == "/joints": return self.handler.getJoints(accept) elif path == "/joints/0": return self.h...
SKloeser/DRL4IOT
wrappers/acrobot_v1_http_layer_v1.py
acrobot_v1_http_layer_v1.py
py
7,728
python
en
code
2
github-code
2
[ { "api_name": "enum.Enum", "line_number": 61, "usage_type": "attribute" }, { "api_name": "json.dumps", "line_number": 120, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 135, "usage_type": "call" }, { "api_name": "json.JSONDecodeError", "li...
71571007086
from typing import List # class Solution: def solveNQueens(self, n: int) -> List[List[str]]: res, ans = [], [] queens = [-1] * n def dfs(index): if index == n: res.append(queens.copy()) return for i in range(n): queens[...
gui549/Leetcode-Solutions
Hard/51.N-Queens.py
51.N-Queens.py
py
2,163
python
en
code
0
github-code
2
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" } ]
34725729541
import psycopg2 import xlsxwriter from xlsxwriter import utility class PyPostExcel: def __init__(self, db_name, table, password, username, host, date, port="5432"): self.rows = [] self.db_name = db_name self.table = table self.password = password self.username = username ...
u-Aymane/PyPostExcel
pypostgresexcel/pypostgresexcel.py
pypostgresexcel.py
py
7,848
python
en
code
1
github-code
2
[ { "api_name": "psycopg2.connect", "line_number": 15, "usage_type": "call" }, { "api_name": "xlsxwriter.Workbook", "line_number": 22, "usage_type": "call" }, { "api_name": "xlsxwriter.utility.xl_col_to_name", "line_number": 112, "usage_type": "call" }, { "api_name"...
31479642076
# -*- coding: utf-8 -*- from skimage import io from skimage.color import rgb2gray import numpy as np from math import floor def grid_image(img, h_grid, w_grid, overlap): h, w = img.shape grid_h = floor(h / h_grid) # * (1 + overlap)) grid_w = floor(w / w_grid) #* (1 + overlap))/2 ) overlap_h = floor(g...
victormelo/cv_toolbox
cv_toolbox/core/util.py
util.py
py
2,261
python
en
code
1
github-code
2
[ { "api_name": "math.floor", "line_number": 11, "usage_type": "call" }, { "api_name": "math.floor", "line_number": 12, "usage_type": "call" }, { "api_name": "math.floor", "line_number": 13, "usage_type": "call" }, { "api_name": "math.floor", "line_number": 14, ...
36027087080
#!/usr/bin/env python # -*- coding: utf-8 -*- from flask import Flask from twilio.twiml.voice_response import VoiceResponse #import sys, codecs #sys.stdout = codecs.getwriter("utf-8")(sys.stdout) app = Flask(__name__) @app.route('/say', methods=['GET', 'POST']) def say(): # TwiMLを作成 resp = VoiceResponse() ...
TetsuoS/twilio-demo-h301205
say.py
say.py
py
528
python
en
code
0
github-code
2
[ { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "twilio.twiml.voice_response.VoiceResponse", "line_number": 15, "usage_type": "call" } ]
39102510184
import curses import traceback import datetime import time try: # -- Initialize -- stdscr = curses.initscr() # initialize curses screen curses.noecho() # turn off auto echoing of keypress on to screen curses.cbreak() # enter break mode where pressing Enter key ...
jwatson-CO-edu/py_info
Snippets/Interaction/ncurses_loop.py
ncurses_loop.py
py
1,299
python
en
code
0
github-code
2
[ { "api_name": "curses.initscr", "line_number": 8, "usage_type": "call" }, { "api_name": "curses.noecho", "line_number": 9, "usage_type": "call" }, { "api_name": "curses.cbreak", "line_number": 10, "usage_type": "call" }, { "api_name": "curses.A_BOLD", "line_nu...
72286520048
from __future__ import annotations import pygame import math from pygame import Rect from typing import Optional, Tuple, List from .widget import Widget from .theme import Theme from .view import View from .event import MouseEvent from .utils import resource_filepath def dist_between_rects(r1, r2): return math....
lsouoliveira/15-puzzle
src/gui/puzzle_grid.py
puzzle_grid.py
py
8,857
python
en
code
0
github-code
2
[ { "api_name": "math.hypot", "line_number": 16, "usage_type": "call" }, { "api_name": "widget.Widget", "line_number": 25, "usage_type": "name" }, { "api_name": "pygame.font.Font", "line_number": 30, "usage_type": "call" }, { "api_name": "pygame.font", "line_num...
30957243988
import numpy as np from numpy import arange from sklearn.ensemble import RandomForestRegressor from sklearn.model_selection import cross_val_score from GC_IDT.Movement import * from GC_IDT.AccuracyScore import * from TouchGlove.MovementAndTrigger import * from Tools.ProgressBar import ProgressBar import matplotlib im...
vija96/PSACS
PSACS.py
PSACS.py
py
16,497
python
en
code
0
github-code
2
[ { "api_name": "matplotlib.rc", "line_number": 20, "usage_type": "call" }, { "api_name": "Tools.ProgressBar.ProgressBar", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.array",...
35416362839
import torch from megatron import get_args from megatron import mpu from megatron.model.language_model import parallel_lm_logits from megatron.model.language_model import get_language_model from megatron.model.utils import init_method_normal from megatron.model.utils import scaled_init_method_normal from megatron.modu...
DevSinghSachan/emdr2
megatron/model/t5_model.py
t5_model.py
py
7,572
python
en
code
104
github-code
2
[ { "api_name": "torch.arange", "line_number": 31, "usage_type": "call" }, { "api_name": "torch.long", "line_number": 31, "usage_type": "attribute" }, { "api_name": "megatron.module.MegatronModule", "line_number": 38, "usage_type": "name" }, { "api_name": "megatron....
28781391850
'''Module holding functions related to miscellaneous metrics, such as Halstead metrics or the Maintainability Index. ''' import ast import math import collections from radon.visitors import HalsteadVisitor, ComplexityVisitor from radon.raw import analyze # Halstead metrics Halstead = collections.namedtuple('Halstead...
AtomLinter/linter-pylama
bin/deps/radon/metrics.py
metrics.py
py
4,006
python
en
code
22
github-code
2
[ { "api_name": "collections.namedtuple", "line_number": 13, "usage_type": "call" }, { "api_name": "ast.parse", "line_number": 22, "usage_type": "call" }, { "api_name": "radon.visitors.HalsteadVisitor.from_ast", "line_number": 42, "usage_type": "call" }, { "api_name...
23546436469
import time import posixpath from datetime import timedelta from core.test_run import TestRun from test_tools import fs_utils class Vdbench: def __init__(self, params, config): print("VDBench plugin initialization") self.run_time = timedelta(seconds=60) try: self.working_dir ...
Open-CAS/open-cas-linux
test/functional/test-framework/internal_plugins/vdbench/__init__.py
__init__.py
py
3,228
python
en
code
192
github-code
2
[ { "api_name": "datetime.timedelta", "line_number": 12, "usage_type": "call" }, { "api_name": "posixpath.join", "line_number": 22, "usage_type": "call" }, { "api_name": "test_tools.fs_utils.check_if_directory_exists", "line_number": 29, "usage_type": "call" }, { "a...
19273148197
from django.urls import path from . import views app_name = 'todo' urlpatterns = [ path('', views.HomeView.as_view(), name='home'), path('addBranch/', views.addBranch, name='addBranch'), path('updateBranch/<str:branch_name>/', views.updateBranch, name='updateBranch'), path('deleteBranch/<...
BarkinMecer/alpers_to_do_app
todo/urls.py
urls.py
py
1,218
python
en
code
0
github-code
2
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", ...
34855833996
import torch.nn as nn import torch.nn.functional as F import torch import math class Linear(nn.Module): def __init__(self, in_features, out_features, dropout, bias=False): super(Linear, self).__init__() self.dropout = dropout self.in_features = in_features self.out_feature...
lgl6633/MG-attack
models/model_GAT.py
model_GAT.py
py
3,896
python
en
code
2
github-code
2
[ { "api_name": "torch.nn.Module", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 6, "usage_type": "name" }, { "api_name": "torch.nn.Parameter", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.nn", "line_n...
4777881629
import cv2 import os def load_known_faces(known_faces_dir, face_cascade): known_faces = [] known_names = [] # for file in os.listdir(known_faces_dir): # image = cv2.imread(os.path.join(known_faces_dir, file)) # gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) # faces = face_cascade.de...
CallMeProteus/facial
load_known_faces.py
load_known_faces.py
py
1,120
python
en
code
1
github-code
2
[ { "api_name": "cv2.VideoCapture", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 23, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 23, "usage_type": "attribute" } ]
32476249237
import logging import os import platform import tempfile import shutil from collections import namedtuple from subprocess import Popen, PIPE, TimeoutExpired from typing import List IS_WINDOWS = platform.system().lower() == "windows" RUNNING_ON_CI = os.environ.get("APPVEYOR", False) RUNNING_TEST_FOR_MASTER_ON_CI = os.e...
rgaleanog/test
sam-installation/aws-sam-cli-src/tests/testing_utils.py
testing_utils.py
py
4,663
python
en
code
1
github-code
2
[ { "api_name": "platform.system", "line_number": 10, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 11, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.environ.get", "...
71249751407
#coding:utf-8 import pymysql # global db db = pymysql.connect("localhost","root","stone","tencent_news") # global cursor cursor = db.cursor() #参数为网址,通过SQL语法,查询该url是否在all_url表中,存在则返回number # def getAllUrlNumber(url): # sql = "SELECT number FROM tencent_news.all_url WHERE url = '%s';"%url # number = -1 # t...
zhao358713420/TencentNews
src/sql/sqlTest.py
sqlTest.py
py
1,424
python
en
code
0
github-code
2
[ { "api_name": "pymysql.connect", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 49, "usage_type": "call" } ]
71359331566
import xml.etree.ElementTree as ET import os import pickle # Return the root of an xml file def getXMLRoot(xmlFileName): xmlTree = ET.parse(xmlFileName) xmlRoot = xmlTree.getroot() return xmlRoot # Return all non-hidden files in a directory, given a path to the directory from the script execution path d...
alex-calderwood/msu-data-mining-project
svo/corenlp/python/file_tools.py
file_tools.py
py
951
python
en
code
1
github-code
2
[ { "api_name": "xml.etree.ElementTree.parse", "line_number": 8, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 8, "usage_type": "name" }, { "api_name": "os.listdir", "line_number": 16, "usage_type": "call" }, { "api_name": "pickle.dum...
4455778337
#!/usr/bin/env python """ Name: plot_from_files.py Author: Divya Jaganathan Date: 26 July, 2018 Plots a single plot of different performance curves from different performance_data text files in a folder """ import glob import matplotlib matplotlib.use('agg') import numpy as np import matplotlib.pyplot as plt import...
MPAS-Dev/MPAS-Tools
ocean/performance_testing/plot_from_files.py
plot_from_files.py
py
2,258
python
en
code
32
github-code
2
[ { "api_name": "matplotlib.use", "line_number": 14, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number":...
8488338327
# -*- coding: utf-8 -*- """ Created on Fri Nov 8 14:16:17 2019 @author: caoa """ import pandas as pd import numpy as np import os from utils import add_datepart import time pd.options.display.max_rows = 30 pd.options.display.max_columns = 10 t0 = time.time() wdir = 'data' meter_dict = {0: 'electricity', ...
caocscar/ashrae
data_wrangling.py
data_wrangling.py
py
4,343
python
en
code
0
github-code
2
[ { "api_name": "pandas.options", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pandas.options", "line_number": 14, "usage_type": "attribute" }, { "api_name": "time.time", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.uint8", "...
28767785650
#!/usr/bin/env python from matplotlib.dates import DateFormatter, DayLocator, MonthLocator from matplotlib.finance import quotes_historical_yahoo, candlestick import sys from datetime import date import matplotlib.pyplot as pyplot today = date.today() start = (today.year - 1, today.month, today.day) alldays = DayLo...
xenron/sandbox-da-python
book/packt/NumPy.1.5.Beginner's.Guide/ch9code/candlesticks.py
candlesticks.py
py
695
python
en
code
4
github-code
2
[ { "api_name": "datetime.date.today", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 9, "usage_type": "name" }, { "api_name": "matplotlib.dates.DayLocator", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotli...
33705369598
import time from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.chrome.service import Service from webdriver_manager.chrome import ChromeDriverManager from selenium.webdriver.support.select import Select def timetable_lookup(): options = Options() ...
Vevilion/TafeTimetable-Discord-Bot
tafe_timetable.py
tafe_timetable.py
py
1,720
python
en
code
0
github-code
2
[ { "api_name": "selenium.webdriver.chrome.options.Options", "line_number": 10, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 13, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 13, "usage_type": "name" }, {...
26608754075
import sys import getopt import os import os.path import platform import configparser import locale import utilitaires import genCodeCommon import genHTML import database import genereCode1Ville ################################################## # main function ################################################## def m...
Thierry46/finances-Locales
genCode.py
genCode.py
py
4,785
python
fr
code
1
github-code
2
[ { "api_name": "configparser.RawConfigParser", "line_number": 24, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 31, "usage_type": "attribute" }, { "api_name": "os.path.basename", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path",...
20750359191
import re from itertools import groupby import numpy as np import pandas as pd from repetition.asr import remove_repetition from retracing.asr import remove_retracing from util import count_words, get_percentage def get_words(text): """ Removes tags from fisher annotated utterance :param text: ex: Input...
AshwinDeshpande96/Measuring_the_Impact_of_Verbal_Disfluency_Tags_on_Automated_Dementia_Detection
code/disfluency/remove_disfluency_fisher.py
remove_disfluency_fisher.py
py
11,065
python
en
code
2
github-code
2
[ { "api_name": "re.sub", "line_number": 34, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 35, "usage_type": "call" }, { "api_name": "itertools.groupby", "line_number": 45, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 77, "...
870446632
import pygame import sys sys.setrecursionlimit(10**6) pygame.init() fill_img=pygame.image.load("fill.png") brush_img=pygame.image.load("brush.png") clear_img=pygame.image.load("clear.png") disp_width=800 disp_height=600 gameDisplay = pygame.display.set_mode((disp_width,disp_height)) pygame.display.set_c...
AI-Factor-y/my-backup-codes
floodfill algorithm/floodfill.py
floodfill.py
py
6,770
python
en
code
0
github-code
2
[ { "api_name": "sys.setrecursionlimit", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.init", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.image.load", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.image", "...
26607879824
import pandas as pd import numpy as np from sklearn.preprocessing import LabelEncoder from sklearn.naive_bayes import GaussianNB from sklearn.model_selection import train_test_split import funcs data = pd.read_csv('IoT.csv', delimiter=',') labels = pd.DataFrame(data, columns=['label']) data = pd.DataFrame(dat...
DanilaShmakov/ML
py/lab5.py
lab5.py
py
2,401
python
en
code
0
github-code
2
[ { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 10, "usage_type": "call" }, { "api_name": "funcs.normalize", ...
73130614766
import os.path import pandas import sqlalchemy import server.model.connection as sm_connection import server.model.event as sm_event from server.model import event as event def match_num_df(num_matches=12): conn = sm_connection.engine.connect() evt_id = event.EventDal.get_current_event()[0] matches_sql...
irs1318dev/irsScouting2017
server/view/dataframes.py
dataframes.py
py
6,061
python
en
code
4
github-code
2
[ { "api_name": "server.model.connection.engine.connect", "line_number": 12, "usage_type": "call" }, { "api_name": "server.model.connection.engine", "line_number": 12, "usage_type": "attribute" }, { "api_name": "server.model.connection", "line_number": 12, "usage_type": "na...
18834269410
from unittest.mock import patch, call from django.contrib.auth.models import User from django.db.models import ProtectedError from django.test import TestCase from django.urls import reverse from restaurant.models import Ingredient, Inventory, MenuItemType, MenuItem, Sale, InventoryTopUp, Transaction from mixer.backe...
sternocleidomastoid/django_restaurant
restaurant/tests/test_models/test_models.py
test_models.py
py
6,763
python
en
code
0
github-code
2
[ { "api_name": "django.test.TestCase", "line_number": 12, "usage_type": "name" }, { "api_name": "mixer.backend.django.mixer.blend", "line_number": 15, "usage_type": "call" }, { "api_name": "restaurant.models.Inventory", "line_number": 15, "usage_type": "argument" }, { ...
11758146399
# shell : python3 /home/pi/skripts/prod/Entladesteuerung.py # @/usr/bin/python3 /home/pi/skripts/prod.Entladesteuerung.py # -*- coding: utf-8 -*- # System- und fremde Funktionen import time , sys , RPi.GPIO as GPIO , json from colorama import init , Fore , Style , Back # init(autoreset=T...
torstenkuhn77/Peter
skripts/prod_alt/Entladesteuerung_bis_2020.03.01.py
Entladesteuerung_bis_2020.03.01.py
py
18,774
python
de
code
0
github-code
2
[ { "api_name": "colorama.init", "line_number": 16, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 39, "usage_type": "call" }, { "api_name": "time.strftime", "line_number": 54, "usage_type": "call" }, { "api_name": "Func_Temp_Sens.sensorRT", ...
1045146166
from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404, render from namep.models import Question from .forms import Question def index(request): questions = Question.objects.all() context = {'questions' : questions,} return render(request, 'namep/post.html', context) ...
FlorentVigot/Django_CRUD_Chat
name/namep/views.py
views.py
py
1,190
python
en
code
0
github-code
2
[ { "api_name": "forms.Question.objects.all", "line_number": 8, "usage_type": "call" }, { "api_name": "forms.Question.objects", "line_number": 8, "usage_type": "attribute" }, { "api_name": "forms.Question", "line_number": 8, "usage_type": "name" }, { "api_name": "dj...
19150110377
import logging from .markup import get_variable from .markup import save_variable from pyats.async_ import pcall from pyats.aetest.steps import Steps log = logging.getLogger() def parallel(self, steps, testbed, section, name, data): # When called run all the actions # below the keyword parallel concurrentl...
Preet2fun/Ansible-server-network-automation
network-test-virtualenv/lib/python3.6/site-packages/genie/libs/sdk/triggers/blitz/blitz_parallel.py
blitz_parallel.py
py
5,474
python
en
code
0
github-code
2
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "pyats.aetest.steps.Steps", "line_number": 39, "usage_type": "call" }, { "api_name": "markup.get_variable", "line_number": 49, "usage_type": "call" }, { "api_name": "pyats.a...
33486494963
import numpy import unittest try: import h5py HAVE_H5PY = True except ImportError: HAVE_H5PY = False from . import PckSaverTest from ..hdf5pck import Hdf5PckSaver @unittest.skipUnless(HAVE_H5PY, "requires h5py") class TestHdf5PckSaver(PckSaverTest, unittest.TestCase): ''' Test class Hdf5PckSaver ''' ...
shmilee/gdpy3
src/savers/tests/test_hdf5pck.py
test_hdf5pck.py
py
1,370
python
en
code
7
github-code
2
[ { "api_name": "unittest.TestCase", "line_number": 13, "usage_type": "attribute" }, { "api_name": "hdf5pck.Hdf5PckSaver", "line_number": 15, "usage_type": "name" }, { "api_name": "h5py.File", "line_number": 24, "usage_type": "call" }, { "api_name": "h5py.Dataset", ...
70531787246
import csv import os from datetime import datetime HISTORY_CSV_PATH = './history.csv' def initialize_history_file(hist_path=HISTORY_CSV_PATH): if not os.path.exists(hist_path): headers = ["Date", "Model ID", "Retraining Type", "Remarks"] with open(hist_path, 'w', newline='') as csvfile: ...
ORlGlN/sio
src/backend/history.py
history.py
py
731
python
en
code
0
github-code
2
[ { "api_name": "os.path.exists", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "csv.writer", "line_number": 12, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": ...
28423834357
# Implementation of between-class average dist over within-class average dist (ABW, derived by Aupetit) # For more details on the measure, see Lewis, J., Ackerman, M., & de Sa, V. (2012). # Human cluster evaluation and formal quality measures: A comparative study. In Proceedings of the Annual Meeting of the Cognitive ...
kix2mix2/DRflow
DRflow/metrics/ABW.py
ABW.py
py
1,142
python
en
code
1
github-code
2
[ { "api_name": "scipy.spatial.distance.pdist", "line_number": 18, "usage_type": "call" } ]
17370374093
import sys import json from scipy.signal import find_peaks import opencor def main(stimulation_mode_parameter, stimulation_level_parameter): return_code = 0 s = opencor.open_simulation('/home/opencor/models/HumanSAN_Fabbri_Fantini_Wilders_Severi_2017.sedml') d = s.data() c = d.constants() stimula...
hsorby/docker_opencor_run_model
run_model.py
run_model.py
py
2,056
python
en
code
0
github-code
2
[ { "api_name": "opencor.open_simulation", "line_number": 10, "usage_type": "call" }, { "api_name": "scipy.signal.find_peaks", "line_number": 30, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 32, "usage_type": "call" }, { "api_name": "sys.argv",...
27637334757
from django.urls import path, include from . import views urlpatterns = [ #Universal Urls path('', views.login), path('register/', views.register, name = "register"), path('login/', views.login, name = "login"), path('logout/', views.log_out, name = "logout"), path('serveFile/<str:file_url>', ...
Delvisb/Django-LMS
DjangoNoteBookLMS/NoteBook/urls.py
urls.py
py
2,176
python
en
code
1
github-code
2
[ { "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", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", ...
40088594248
import socket import pickle import struct import argparse def send_msg(sock, msg): msg_pickle = pickle.dumps(msg) sock.sendall(struct.pack(">I", len(msg_pickle))) sock.sendall(msg_pickle) print(msg[0], 'sent to', sock.getpeername()) def recv_msg(sock, expect_msg_type = None): msg_len = struct.un...
C3atUofU/Hierarchical-SGD
messaging_test/util.py
util.py
py
1,129
python
en
code
3
github-code
2
[ { "api_name": "pickle.dumps", "line_number": 8, "usage_type": "call" }, { "api_name": "struct.pack", "line_number": 9, "usage_type": "call" }, { "api_name": "struct.unpack", "line_number": 15, "usage_type": "call" }, { "api_name": "socket.MSG_WAITALL", "line_n...
35849186522
import tensorflow as tf import numpy as np import os from scipy.stats import rv_discrete tf.compat.v1.disable_eager_execution() os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # suppress messages os.environ['MKL_NUM_THREADS'] = '36' os.environ['OMP_NUM_THREADS'] = '36' tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging....
ryand-LANL/EMCCD-calibration
NoiseModel_TFv1.py
NoiseModel_TFv1.py
py
4,292
python
en
code
0
github-code
2
[ { "api_name": "tensorflow.compat.v1.disable_eager_execution", "line_number": 5, "usage_type": "call" }, { "api_name": "tensorflow.compat", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 6, "usage_type": "attribute" }, { "...