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
31189135547
# # @lc app=leetcode.cn id=1046 lang=python3 # # [1046] 最后一块石头的重量 # # @lc code=start from heapq import heappop from typing import List class Solution: def lastStoneWeight(self, stones: List[int]) -> int: n = len(stones) import heapq hp = [ -i for i in stones] heapq.heapify(hp) ...
Interesting6/FuckLeetCode
1046.最后一块石头的重量.py
1046.最后一块石头的重量.py
py
879
python
en
code
0
github-code
21
[ { "api_name": "typing.List", "line_number": 11, "usage_type": "name" }, { "api_name": "heapq.heapify", "line_number": 15, "usage_type": "call" }, { "api_name": "heapq.heappop", "line_number": 17, "usage_type": "call" }, { "api_name": "heapq.heappop", "line_num...
20028970967
import os from flask import current_app class Healthcheck(object): def __init__(self, app): self.flask_app = app self.flask_app.add_url_rule("/healthcheck", view_func=self.healthcheck_view) self.checkers = [] def healthcheck_view(self): responseCode = 200 response = {...
communitiesuk/funding-service-design-utils
fsd_utils/healthchecks/healthcheck.py
healthcheck.py
py
1,155
python
en
code
1
github-code
21
[ { "api_name": "os.getenv", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.current_app.logger.debug", "line_number": 21, "usage_type": "call" }, { "api_name": "flask.current_app.logger", "line_number": 21, "usage_type": "attribute" }, { "api_name":...
71018860532
from ..utils import debug as dbg from ..utils import coloration as clr from ..utils.getch import getch import os import sys YES = {"yes", "ye", "y", "yeah", "yay"} NO = {"no", "n", "nooo", "noo"} YES_NO_ANSWERS = { 1: "\t\tPlease answer {wrn}{bold} YES {ec} or {wrn}{bold} NO {ec} :", 5: "Fuck off." } def ye...
erik-helmers/grader-cli
taskgrader/utils/niceAsk.py
niceAsk.py
py
1,500
python
en
code
0
github-code
21
[ { "api_name": "utils.coloration.colorize", "line_number": 28, "usage_type": "call" }, { "api_name": "utils.coloration", "line_number": 28, "usage_type": "name" }, { "api_name": "sys.stdout.flush", "line_number": 29, "usage_type": "call" }, { "api_name": "sys.stdou...
30688494171
#https://adventofcode.com/2022/day/14 #from __future__ import annotations from typing import Iterator, NamedTuple import itertools_recipes as ir from functools import total_ordering, cached_property from collections import UserList import ast from ast import literal_eval import enum from aoc_recipes import P...
copperfield42/Advent-of-Code-2022
day14/day14.py
day14.py
py
4,370
python
en
code
0
github-code
21
[ { "api_name": "aoc_recipes.Point", "line_number": 27, "usage_type": "name" }, { "api_name": "aoc_recipes.Point", "line_number": 28, "usage_type": "name" }, { "api_name": "typing.Iterator", "line_number": 30, "usage_type": "name" }, { "api_name": "aoc_recipes.Point...
6504388030
from fastai.text import * from pathlib import Path import pandas as pd from .ulmfit import ULMFiT_SP from ...pipeline_logger import pipeline_logger import torch from enum import Enum class TableType(Enum): SOTA = 0 ABLATION = 1 IRRELEVANT = 2 def multipreds2preds(preds, threshold=0.5): bs = preds.sh...
paperswithcode/axcell
axcell/models/structure/type_predictor.py
type_predictor.py
py
1,752
python
en
code
365
github-code
21
[ { "api_name": "enum.Enum", "line_number": 10, "usage_type": "name" }, { "api_name": "torch.cat", "line_number": 18, "usage_type": "call" }, { "api_name": "ulmfit.ULMFiT_SP", "line_number": 21, "usage_type": "name" }, { "api_name": "pipeline_logger.pipeline_logger"...
8712442424
import configparser from wpilib.command.subsystem import Subsystem from wpilib.encoder import Encoder from wpilib.robotdrive import RobotDrive from wpilib.victorsp import VictorSP from wpilib.adxrs450_gyro import ADXRS450_Gyro from wpilib.smartdashboard import SmartDashboard from commands.tank_drive import TankDrive ...
TechnoJays/robot2017
src/subsystems/drivetrain.py
drivetrain.py
py
9,160
python
en
code
2
github-code
21
[ { "api_name": "wpilib.command.subsystem.Subsystem", "line_number": 11, "usage_type": "name" }, { "api_name": "configparser.ConfigParser", "line_number": 61, "usage_type": "call" }, { "api_name": "commands.tank_drive.TankDrive", "line_number": 70, "usage_type": "call" },...
40986911693
from __future__ import print_function from __future__ import division import sys import re import csv import os import numpy as np from tqdm import tqdm import operator import subprocess import shutil #TOTAL_VID = 2935479 #TOTAL_IMG = 10837498 IMAGE_EXT = ['png', 'jpg'] CACHE_DIR = './dataset/image_cache/' IMAGE_TEMP...
wcarvalho/ViralityPredictionModel
2_2_image_content/image_downloader.py
image_downloader.py
py
1,542
python
en
code
1
github-code
21
[ { "api_name": "csv.reader", "line_number": 33, "usage_type": "call" }, { "api_name": "operator.itemgetter", "line_number": 40, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 42, "usage_type": "call" }, { "api_name": "os.path", "line_numbe...
72944610612
#!/usr/bin/env python3.8 import sys import argparse from typing import List FILE_MAX_BRIGHTNESS = '/sys/class/backlight/intel_backlight/max_brightness' FILE_BRIGHTNESS = '/sys/class/backlight/intel_backlight/brightness' def read_file(path: str) -> List[str]: with open(path, 'r') as fd: return fd.readlin...
bpingris/bblight
brightness.py
brightness.py
py
2,665
python
en
code
0
github-code
21
[ { "api_name": "typing.List", "line_number": 11, "usage_type": "name" }, { "api_name": "argparse.ArgumentParser", "line_number": 57, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 70, "usage_type": "attribute" }, { "api_name": "sys.stderr", "l...
34803871290
import argparse import csv import pymongo import config SAMPLE_ID_HEADER = 'SampleID' GENE_ID_HEADER = 'Gene ID' GENE_SYMBOL_HEADER = 'Gene Symbol' GENE_NAME_HEADER = 'Gene Name' STRAND_HEADER = 'Strand' CHR_HEADER = 'Chr' START_POS_HEADER = 'Start' END_POS_HEADER = 'End' def get_db(): client = pymongo.MongoCli...
churchill-lab/factorial-experiment-viewer
src/importdesnp.py
importdesnp.py
py
3,095
python
en
code
0
github-code
21
[ { "api_name": "pymongo.MongoClient", "line_number": 18, "usage_type": "call" }, { "api_name": "config.MONGO_SERVER", "line_number": 18, "usage_type": "attribute" }, { "api_name": "config.MONGO_PORT", "line_number": 18, "usage_type": "attribute" }, { "api_name": "c...
15781536292
import networkx as nx import sys sys.setrecursionlimit(10000) ## Parsing files = ['input.txt', 'testInput.txt'] with open(files[0], 'r') as f: lines = [a.strip() for a in f.readlines()] w,h = len(lines[0]), len(lines) def getNbs(x,y): for dx,dy in [(1,0),(-1,0),(0,1),(0,-1)]: newX,newY = x+dx, y+dy...
nabihestefan/AdventOfCode
Python/2016/day24/day24.py
day24.py
py
1,711
python
en
code
0
github-code
21
[ { "api_name": "sys.setrecursionlimit", "line_number": 3, "usage_type": "call" }, { "api_name": "networkx.Graph", "line_number": 20, "usage_type": "call" }, { "api_name": "networkx.shortest_path_length", "line_number": 50, "usage_type": "call" } ]
70638427253
"""Day 3""" from typing import List, Tuple def process(filename) -> int: with open(filename) as infile: lines = infile.readlines() gamma_str, episolon_str = find_count(lines) gamma = int(f"0b{gamma_str}" , 2) epsilon = int(f"0b{episolon_str}" , 2) ox_rating = int(f"0b{find_prefix(lines, ...
tebriel/aoc2021
day03/main.py
main.py
py
1,756
python
en
code
0
github-code
21
[ { "api_name": "typing.List", "line_number": 20, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 20, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 41, "usage_type": "name" } ]
41000899610
""" Plot supllementary functions and classes. """ from ast import literal_eval from colorsys import rgb_to_hls, hls_to_rgb from numbers import Number import operator import matplotlib.pyplot as plt import numpy as np try: from matplotlib.collections import PatchCollection from matplotlib.colors import ColorCo...
analysiscenter/batchflow
batchflow/plotter/utils.py
utils.py
py
10,760
python
en
code
194
github-code
21
[ { "api_name": "matplotlib.legend_handler.HandlerBase", "line_number": 57, "usage_type": "name" }, { "api_name": "matplotlib.patches.Rectangle", "line_number": 78, "usage_type": "call" }, { "api_name": "matplotlib.collections.PatchCollection", "line_number": 82, "usage_typ...
16300472430
import os import gc import time import pandas as pd import numpy as np import soundfile as sf import scipy.signal as signal import sklearn import IPython.display as ipd import keras import keras.backend as K import tensorflow as tf import math import matplotlib.pyplot as plt import librosa import librosa...
MikeCamp1998/Machine-Learning
Language_Detection/utils.py
utils.py
py
7,133
python
en
code
0
github-code
21
[ { "api_name": "librosa.load", "line_number": 54, "usage_type": "call" }, { "api_name": "librosa.stft", "line_number": 55, "usage_type": "call" }, { "api_name": "librosa.magphase", "line_number": 56, "usage_type": "call" }, { "api_name": "librosa.feature.melspectro...
4686623393
import numpy as np import matplotlib.pyplot as plt # Python program to print all # prime number in an interval import matplotlib as mpl a = 1.0 v0 = 0.0 t, h, n = 0.0, 0.1, 20 ta, xa = [], [] for i in range(n): x = v0*t + a*t*t / 2.0 ta.append(t) xa.append(x) t = t + h plt.figure(figsize=(4, 4)) plt.p...
stompkins7192/PHY494
02_python/math.py
math.py
py
449
python
en
code
0
github-code
21
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 17, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 18, "usage_type": "call" }, { "api_name": "mat...
15706297163
# Imports here import matplotlib.pyplot as plt import argparse import torch import numpy as np from torch import nn, optim import torch.nn.functional as F from torchvision import datasets, transforms, models from train import build_classifier, build_model def get_input_args(): """ 5 command line arguments...
jeffrisandy/image_classifier
test/predict.py
predict.py
py
5,363
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 23, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 41, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 41, "usage_type": "name" }, { "api_name": "numpy.ceil", "li...
12578644927
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Author: Khairil Ariffin Bin Yahya School: Technical University of Munich Course: Earth Space Orientated Science and Technology Date: 20.06.2023 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" import os import torch import datetime import ...
KhairilAriffinYahya/Khairil_TUM-Facade_Semantic_Segmentation
localfunctions.py
localfunctions.py
py
23,689
python
en
code
1
github-code
21
[ { "api_name": "os.path.dirname", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path", "line_number": 32, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path.dirname", "l...
39984781780
#coding:utf-8 import random import os import cv2 import numpy as np def get_neck(point1, point2): if point1 and point2: x = (point1[0] + point2[0]) // 2 y = (point1[1] + point2[1]) // 2 return [x, y] else: return None # 将coco关键点顺序转为cpm对应顺序,并增加neck点 def coco2c...
JayMarx/CPM
utils/process_data.py
process_data.py
py
3,304
python
en
code
1
github-code
21
[ { "api_name": "cv2.resize", "line_number": 37, "usage_type": "call" }, { "api_name": "cv2.INTER_LINEAR", "line_number": 37, "usage_type": "attribute" }, { "api_name": "numpy.pad", "line_number": 54, "usage_type": "call" }, { "api_name": "random.shuffle", "line...
5248854911
#!/usr/bin/env python # coding: utf-8 # # README # 2020.08.29 version of this code # This is an ensemble model for training on data comprised of electronic radiologist notes to predict the presence of metastatic cancers. Model written in Python 3. # # **NOTE: the model presented here was created, trained, tested, a...
karenbatch19/Splenomegaly-Detection
splenomegaly_detection.py
splenomegaly_detection.py
py
17,069
python
en
code
0
github-code
21
[ { "api_name": "sklearn.metrics.accuracy_score", "line_number": 179, "usage_type": "call" }, { "api_name": "sklearn.metrics.precision_score", "line_number": 184, "usage_type": "call" }, { "api_name": "sklearn.metrics.recall_score", "line_number": 190, "usage_type": "call" ...
4088517943
#!/usr/bin/env python # coding: utf-8 # # Project: Housing Evictions and Fair Market Rents in New York City</h1> <a id=7></a> # ## Mapping Tests for Eviction and FMR data</h3> # # ##Page Summary: # This page is meant to draft the mapping of both evictions and FMR datasets. # ## Data: # # For this project, we are u...
amelia-ingram/eviction-rent
Test/Eviction_Rent_Project_Test.Mapping.py
Eviction_Rent_Project_Test.Mapping.py
py
11,744
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.nan", "line_number": 64, "usage_type": "attribute" }, { "api_name": "urllib.request.urlopen", "line_number": 104, "usage_type": "call" }, { "api_name": "json.load", ...
23302023177
""" make the other directions from the up direction """ import os from PIL import Image def spike_split(name): parts = name.split('_') front = '_'.join(parts[:-1]) direction = parts[-1].split('.')[0] if direction[:2] != 'up': raise ValueError('nah') idx = direction[2:] di...
wlaub/waldmo
Graphics/Atlases/Gameplay/danger/spikes/waldmo/main.py
main.py
py
866
python
en
code
0
github-code
21
[ { "api_name": "os.listdir", "line_number": 19, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 27, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 27, "usage_type": "name" } ]
2353255350
from typing import TypeVar, Union import os from dotenv import load_dotenv def init_environment(): base_dir = os.path.abspath(os.path.dirname(__file__)) env_file = os.path.join(base_dir, '.env') load_dotenv(env_file) T = TypeVar('T', str, int) def getenv(key: str, default: T) -> T: value = os.gete...
CubingZA/CubingZA-Website
etl/config.py
config.py
py
721
python
en
code
2
github-code
21
[ { "api_name": "os.path.abspath", "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": "os.path.join", "line_nu...
24060799540
# ----------------------------------------- # Model Solution: DFS # # Time Complexity: O(n) # Space Complexity: O(n) # ----------------------------------------- # n := len(prevRoom) # Ref: # a) https://leetcode.com/problems/count-ways-to-build-rooms-in-an-ant-colony/discuss/1299618/Python3.-Short-dfs. # b) https://lee...
DaMinaup6/algorithm-exercises
leetcode/hard/1916_count_ways_to_build_rooms_in_an_ant_colony.py
1916_count_ways_to_build_rooms_in_an_ant_colony.py
py
1,315
python
en
code
0
github-code
21
[ { "api_name": "collections.defaultdict", "line_number": 19, "usage_type": "call" }, { "api_name": "math.comb", "line_number": 29, "usage_type": "call" } ]
770954306
# -*- coding: utf-8 -*- # @Time: 2021/3/10 16:32 # @Author: qiao # @Email: rukunqiao@outlook.com # @File: submodules.py # @Software: PyCharm # @Description: # None # - Package Imports - # import torch import torch.nn as nn import torch.nn.functional as F # - Coding Part - # class FlowHead(nn.Mod...
CodePointer/TIDENet
tide/submodules.py
submodules.py
py
15,229
python
en
code
3
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 18, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 18, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.nn", "line_nu...
73033283573
from datetime import datetime import json from tornado import gen from tornado.log import app_log from tornado.httpclient import HTTPRequest, AsyncHTTPClient from sqlalchemy.types import TypeDecorator, TEXT from sqlalchemy import ( inspect, Column, Integer, ForeignKey, Unicode, Boolean, DateTime, ) from s...
LiuFang816/SALSTM_py_data
python/jupyterhub_jupyterhub/jupyterhub-master/jupyterhub/orm.py
orm.py
py
20,590
python
en
code
9
github-code
21
[ { "api_name": "sqlalchemy.types.TypeDecorator", "line_number": 28, "usage_type": "name" }, { "api_name": "sqlalchemy.types.TEXT", "line_number": 37, "usage_type": "name" }, { "api_name": "json.dumps", "line_number": 41, "usage_type": "call" }, { "api_name": "json....
13998233067
from builtins import range import os import re import sys import copy import datetime my_list_type = None try: # This is for python 2 from types import ListType my_list_type = ListType except ImportError: # This is for python 3 my_list_type = list ASCII_TIMESTAMP_FORMAT = '%Y-%m-%dT%H:%M:%S.%fZ' ...
nasa/RtRetrievalFramework
lib/Python/text_util.py
text_util.py
py
5,873
python
en
code
43
github-code
21
[ { "api_name": "types.ListType", "line_number": 12, "usage_type": "name" }, { "api_name": "builtins.range", "line_number": 31, "usage_type": "call" }, { "api_name": "os.curdir", "line_number": 61, "usage_type": "attribute" }, { "api_name": "os.path.exists", "li...
32484822374
from builtins import property from datetime import datetime, date class Person: def __init__(self, fname, lname, birthdate: str, adress, telephone, email): self.fname = fname self.lname = lname self.birthdate = birthdate self.adress = adress self.telephone = telephone ...
Rahelsc/pythonPC
2ndAssignment2/person.py
person.py
py
1,686
python
en
code
0
github-code
21
[ { "api_name": "datetime.date.today", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 13, "usage_type": "name" }, { "api_name": "builtins.property", "line_number": 24, "usage_type": "name" }, { "api_name": "builtins.property...
12691982603
import time import pygame , sys from pygame.locals import * import random pygame.init() pygame.display.set_caption('SnakeXenzia') dis_width = 600 dis_height = 500 screen = pygame.display.set_mode((dis_width,dis_height)) icon = pygame.image.load('icon.png') pygame.display.set_icon(icon) img = py...
rkumar2667/SnakeGame
Snake/game.py
game.py
py
7,289
python
en
code
0
github-code
21
[ { "api_name": "pygame.init", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.display.set_caption", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pygame.displa...
25807222775
import threading import unittest from slixmpp.test import SlixTest class TestStreamSet(SlixTest): def tearDown(self): self.stream_close() def testHandleSoftwareVersionRequest(self): self.stream_start(mode='client', plugins=['xep_0030', 'xep_0092']) self.xmpp['xep_0092'].name = 'Sli...
poezio/slixmpp
tests/test_stream_xep_0092.py
test_stream_xep_0092.py
py
1,906
python
en
code
108
github-code
21
[ { "api_name": "slixmpp.test.SlixTest", "line_number": 7, "usage_type": "name" }, { "api_name": "unittest.TestLoader", "line_number": 68, "usage_type": "call" } ]
25201668986
from tkinter import * #import mongo import backend import pymongo from pymongo import MongoClient c = MongoClient() db=c["mydatabase"] article = db.articles def view_command(): #list1.delete(0,END) for row in backend.view(): list1.insert(END,row) """ def search_command(): list1.del...
savs33/Positive-News-Sentiment-Analysis-from-Scrapped-Newspaper-Data-
frontend.py
frontend.py
py
1,040
python
en
code
0
github-code
21
[ { "api_name": "pymongo.MongoClient", "line_number": 7, "usage_type": "call" }, { "api_name": "backend.view", "line_number": 13, "usage_type": "call" } ]
39199067757
""" This module provides a SKYNewsSummarizer class for scraping and summarizing news articles from a specified website. Author: Lalith Sagar, Devagudi Date: July 23, 2023 """ import requests from bs4 import BeautifulSoup from urllib.parse import urljoin from datetime import datetime, timedelta, timezone from summariz...
Lalith-Sagar-Devagudi/NEWS-summarization-using-LLMs
SKYNewsSummarizer.py
SKYNewsSummarizer.py
py
4,554
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 67, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 68, "usage_type": "call" }, { "api_name": "urllib.parse.urljoin", "line_number": 74, "usage_type": "call" }, { "api_name": "requests.get", ...
15235945287
import sys import torch sys.path.append('./gans') from helper_functions import create_noise def generator_loss(gen, disc, criterion, num_images, z_dim, device): """ Calculate the generator loss Argss: gen: the Generator_NGAN class instance generator model disc: the Disc...
caron14/GANs
gans/loss_func_gans.py
loss_func_gans.py
py
2,521
python
en
code
0
github-code
21
[ { "api_name": "sys.path.append", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "helper_functions.create_noise", "line_number": 32, "usage_type": "call" }, { "api_name": "torch.ones_...
11126380995
import numpy as np import cv2 avgHeight = 0 def get_symbols(thresh, im=None, draw_contours=False): thresh, cnts, _ = cv2.findContours( thresh.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) if len(cnts) > 0: cnts, _ = sort_contours(cnts) avgCntArea = np.mean([cv2.contourArea(k) for k...
mhtocs/quickmaths_git
quickmaths/utils/component.py
component.py
py
11,778
python
en
code
1
github-code
21
[ { "api_name": "cv2.findContours", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.RETR_EXTERNAL", "line_number": 10, "usage_type": "attribute" }, { "api_name": "cv2.CHAIN_APPROX_SIMPLE", "line_number": 10, "usage_type": "attribute" }, { "api_name": "n...
43801942895
import sys import time # for a random seed import numpy as np from sklearn import datasets from sklearn import tree from hcClassifier import HcClassifier from knnClassifier import KnnClassifier from dtClassifier import DTreeClassifier from sklearn.neighbors import KNeighborsClassifier from mlp import MLP def main(ar...
justinrixx/Classifiers
main.py
main.py
py
3,065
python
en
code
0
github-code
21
[ { "api_name": "time.time", "line_number": 51, "usage_type": "call" }, { "api_name": "sklearn.datasets.load_iris", "line_number": 54, "usage_type": "call" }, { "api_name": "sklearn.datasets", "line_number": 54, "usage_type": "name" }, { "api_name": "numpy.genfromtx...
33338910737
######################################## #### Licensed under the MIT license #### ######################################## import torch import torch.nn as nn import torch.nn.functional as F from numpy import prod import capsules as caps from capsules import squash class ResCapsBlock(nn.Module): def __init__(self...
moejoe95/MoCapsNet
model.py
model.py
py
3,357
python
en
code
9
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 13, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.nn", "lin...
23035201993
#! /usr/bin/env python # Python native libs import math import numpy as np import matplotlib.pyplot as plt from scipy import fft # Project libs from common.signal_utils import fft_and_normalize_and_to_dB from common.impulse_responses import ideal_multiband_truncated from common.amplitude_function import get_amplitude...
LucasJSch/signal_processing_1
python/guia3/ex_12.py
ex_12.py
py
933
python
en
code
0
github-code
21
[ { "api_name": "math.pi", "line_number": 19, "usage_type": "name" }, { "api_name": "numpy.hamming", "line_number": 24, "usage_type": "call" }, { "api_name": "common.impulse_responses.ideal_multiband_truncated", "line_number": 25, "usage_type": "call" }, { "api_name...
24912614945
from multiprocessing import Process, Queue import logging import logging.handlers class LogListener(Process): """Listener class that handles logging info for the worker processes""" def __init__(self, listen_queue: Queue, logfile_name: str): super().__init__(daemon=True) self.listen_queue = l...
illinois-or-research-analytics/spring_2022_research
franklin/bu_et_al_2021/deprecated_version/clustered_bdid/log_listener.py
log_listener.py
py
929
python
en
code
0
github-code
21
[ { "api_name": "multiprocessing.Process", "line_number": 6, "usage_type": "name" }, { "api_name": "multiprocessing.Queue", "line_number": 9, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "logging...
22495171039
from socket import * import datetime PORT_NUMBER = 12000 IP_ADDRESS = "10.106.109.57" TIMEOUT = 1 PACKETS_TO_TRANSMIT = 10 client_socket = socket(AF_INET, SOCK_DGRAM) client_socket.settimeout(TIMEOUT) print("\nTransmitting Packets\n") for seq_num in range(1, PACKETS_TO_TRANSMIT + 1): try: send_time = da...
life8899/Computer_Science
320/Homework/UDP Socket Programming/UDPPinger.py
UDPPinger.py
py
947
python
en
code
0
github-code
21
[ { "api_name": "datetime.datetime.now", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 16, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 21, "usage_type": "call" }, { "api_name": "da...
43797442439
import os import sys import random from bottle import debug, default_app, post, request, route, run from configparser import ConfigParser from typing import DefaultDict, Any from pprint import pprint from app import api from src.board import Board from src.brain import Brain config = ConfigParser() config.read('confi...
mattcasiro/python-snake
app/main.py
main.py
py
1,424
python
en
code
0
github-code
21
[ { "api_name": "configparser.ConfigParser", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 17, "usage_type": "call" }, { "api_name": "app.api.ping_response", "line_number": 21, "usage_type": "call" }, { "api_name": "app.api", ...
21834803117
from flask import Flask from tools import base64_to_numpy from flask import request from ia.model_loader import Model import services.stats as statsService import services.db as dbService import json from config import config app = Flask(__name__, instance_relative_config=True) @app.route('/statistics', methods=...
Jardins-Angevins/JA-Back
main.py
main.py
py
4,180
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 14, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 18, "usage_type": "call" }, { "api_name": "services.db.getPictureCount", "line_number": 19, "usage_type": "call" }, { "api_name": "services.db", ...
37441168893
#! /usr/bin/env python3 import sys import os import argparse import json import re import logging import torch import torch.nn as nn from torch.autograd import Variable import torch.nn.functional as F import numpy as np import random from collections import OrderedDict from options_parser import Options_Parser from ...
jkchen79/netvlad-in-speech
src/lre07_main.py
lre07_main.py
py
7,776
python
en
code
9
github-code
21
[ { "api_name": "os.path.exists", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path", "line_number": 29, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 31, "usage_type": "call" }, { "api_name": "os.path", "line_numbe...
5744199499
from django.urls import path from . import views app_name = 'home' urlpatterns=[ path('about/', views.about, name='about'), path('how_to/', views.how_to, name='how_to'), path('contact/', views.contact, name='contact'), path('support/', views.support, name='support'), path('registration/', views.r...
Ijerry-cloud/recreating-values
home/urls.py
urls.py
py
403
python
en
code
0
github-code
21
[ { "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", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", ...
5146301265
from django.conf.urls import patterns, url from material import views urlpatterns = patterns('', url(r'^inventory/$', views.InventoryListView.as_view(), name='list'), url(r'^inventory/(?P<pk>\d+)/$', views.InventoryDetailView.as_view(), name='detail'), url(r'^$', views.MaterialListView.as_view(), name='list'), u...
ericgarig/Pizzo
material/urls.py
urls.py
py
395
python
en
code
0
github-code
21
[ { "api_name": "django.conf.urls.patterns", "line_number": 5, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "material.views.InventoryListView.as_view", "line_number": 6, "usage_type": "call" }, { ...
7615675449
import json import boto3 import time step = boto3.client('stepfunctions') def lambda_handler(event, context): main_message=json.loads(event['Records'][0]['body']) print("Main Message Part : {}".format(main_message)) step_function_input=main_message['input'] task_token=main_message['MyTaskToken'...
Hyunsoo-Ryan-Lee/AWS-Training
CDK-Python/lambda_functions/lambda_stepfunction/callback/lambda_function.py
lambda_function.py
py
537
python
en
code
0
github-code
21
[ { "api_name": "boto3.client", "line_number": 5, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 9, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 17, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 21, ...
74791824053
import argparse import textwrap help_prefix = textwrap.dedent( """\ This is a lisp interpreter with clojure like syntax, Namespaces and full python interoperability""" ) help_suffix = textwrap.dedent("""""") def get_argp(): """Get an argument parser.""" return argparse.ArgumentParser( ...
EricGebhart/plysp
plysp/options.py
options.py
py
1,322
python
en
code
1
github-code
21
[ { "api_name": "textwrap.dedent", "line_number": 4, "usage_type": "call" }, { "api_name": "textwrap.dedent", "line_number": 11, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 16, "usage_type": "call" }, { "api_name": "argparse.RawDe...
13337273255
import pandas as pd from sklearn.preprocessing import LabelEncoder def get_season(date): month = pd.to_datetime(date).month if month in [12, 1, 2]: return 0.00 elif month in [3, 4, 5]: return 1.00 elif month in [6, 7, 8]: return 2.00 else: return 3.00 ...
mhlvvln/enot-gpt
optimizer.py
optimizer.py
py
2,279
python
en
code
0
github-code
21
[ { "api_name": "pandas.to_datetime", "line_number": 5, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.LabelEncoder", "line_number": 32, "usage_type": "call" }, { "api_name": "pandas.Series", "line_number": 35, "usage_type": "call" }, { "api_name": "pa...
43757046798
import json import os import yaml from django_grpc_bus.settings import message_bus_settings from django import apps class BaseSerializable: attrs = () @property def to_json(self): return json.dumps(self.as_serializer()) def as_serializer(self): result = {} for k in self.attr...
rameezarshad/django-grpc-framework
django_grpc_bus/utils/service_meta.py
service_meta.py
py
5,461
python
en
code
4
github-code
21
[ { "api_name": "json.dumps", "line_number": 14, "usage_type": "call" }, { "api_name": "django.apps.apps.get_model", "line_number": 65, "usage_type": "call" }, { "api_name": "django.apps.apps", "line_number": 65, "usage_type": "attribute" }, { "api_name": "django.ap...
20820573413
from locale import currency from unicodedata import category from django.shortcuts import redirect, render from django.contrib.auth.decorators import login_required from .models import UserIncome, Source from django.contrib import messages from django.core.paginator import Paginator from django.db import models from dj...
Shrut26/Expense-Management
userincome/views.py
views.py
py
5,479
python
en
code
0
github-code
21
[ { "api_name": "models.Source.objects.all", "line_number": 18, "usage_type": "call" }, { "api_name": "models.Source.objects", "line_number": 18, "usage_type": "attribute" }, { "api_name": "models.Source", "line_number": 18, "usage_type": "name" }, { "api_name": "mo...
32449782
import asyncio import csv import logging from urllib.parse import parse_qs, urlparse from datetime import time, timezone import discord from discord.ext import commands, tasks from ehrenbot import Ehrenbot from ehrenbot.utils.exceptions import BungieAPIError from ehrenbot.utils.registration import ( check_profile...
soares-daniel/Ehrenbot-1.0
ehrenbot/cogs/registration.py
registration.py
py
5,944
python
en
code
0
github-code
21
[ { "api_name": "discord.ext.commands.Cog", "line_number": 19, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 19, "usage_type": "name" }, { "api_name": "ehrenbot.Ehrenbot", "line_number": 21, "usage_type": "name" }, { "api_name": "...
19934856020
import asyncio, argparse, subprocess parser = argparse.ArgumentParser(description="Servidor asincrónico") parser.add_argument('-ht', type=str, help="Ingresar host") parser.add_argument('-p', type=int, help="Ingresar puerto") args = parser.parse_args() async def tcp_echo_client(): reader, writer = await asyncio.op...
bruno212121/Computaciondos_2022
AsyncIO/cliente.py
cliente.py
py
843
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 3, "usage_type": "call" }, { "api_name": "asyncio.open_connection", "line_number": 9, "usage_type": "call" }, { "api_name": "asyncio.run", "line_number": 24, "usage_type": "call" } ]
18049693176
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Visualization functions for megsim. author: Jussi (jnu@iki.fi) """ import pathlib import mne import numpy as np import trimesh from mayavi import mlab from mne.transforms import _cart_to_sph, _pol_to_cart, apply_trans from mne.io.constants import FIFF from scipy.spati...
andreyzhd/MEGSim
megsimutils/viz.py
viz.py
py
12,101
python
en
code
1
github-code
21
[ { "api_name": "mayavi.mlab.triangular_mesh", "line_number": 27, "usage_type": "call" }, { "api_name": "mayavi.mlab", "line_number": 27, "usage_type": "name" }, { "api_name": "mayavi.mlab.mesh", "line_number": 35, "usage_type": "call" }, { "api_name": "mayavi.mlab"...
36084220002
#!/usr/bin/env python3 # """ Extract data for FL. For example: $ scripts/extract_FL.py """ import geopandas from geopandas import GeoDataFrame from baseline import * def main() -> None: """Preprocess modified VTD (precinct) data for FL""" xx: str = "FL" # water: bool = True adds: bool = False ...
alecramsay/baseline
scripts/extract_FL.py
extract_FL.py
py
5,041
python
en
code
0
github-code
21
[ { "api_name": "geopandas.GeoDataFrame", "line_number": 36, "usage_type": "name" }, { "api_name": "geopandas.read_file", "line_number": 36, "usage_type": "call" } ]
11442851426
#!/usr/bin/python3 from variables import * import wdriver import dbase from datetime import datetime from selenium.webdriver.common.by import By from selenium.common.exceptions import NoSuchElementException from selenium.common.exceptions import TimeoutException from urllib.parse import urlparse from time import sleep...
npr0n/phoenixarchiver
_docker-refactor/brazzers.py
brazzers.py
py
9,079
python
en
code
0
github-code
21
[ { "api_name": "poster.mega_logout", "line_number": 85, "usage_type": "call" }, { "api_name": "poster.mega_login", "line_number": 86, "usage_type": "call" }, { "api_name": "dbase.init_db", "line_number": 88, "usage_type": "call" }, { "api_name": "poster.collection_...
12026716011
# -*- coding: utf-8 -*- import json from django.test import SimpleTestCase from fw_engine.models import Rule, Host, Module, ModuleParam class TestRules(SimpleTestCase): def test_get(self): host = Host() host.name = "host for testing rule list" host.save() mod = Module() mo...
rikkt0r/firewall-rule-generator
server/fw_api/tests/test_rules.py
test_rules.py
py
5,639
python
en
code
1
github-code
21
[ { "api_name": "django.test.SimpleTestCase", "line_number": 7, "usage_type": "name" }, { "api_name": "fw_engine.models.Host", "line_number": 9, "usage_type": "call" }, { "api_name": "fw_engine.models.Module", "line_number": 13, "usage_type": "call" }, { "api_name":...
3057669596
#! python """ Companion tool to citex, which heuristically matches close title names. The output is a single .bib file, with all references in the inputs grouped and annotated if they may be duplicates. It is suggested to use this on the output of citex. """ import argparse import collections import difflib import os ...
HealthHackAu2016/cbr-improved-citations
second_pass.py
second_pass.py
py
3,651
python
en
code
4
github-code
21
[ { "api_name": "collections.defaultdict", "line_number": 31, "usage_type": "call" }, { "api_name": "difflib.ndiff", "line_number": 45, "usage_type": "call" }, { "api_name": "btx_io.write_bib_entries", "line_number": 61, "usage_type": "call" }, { "api_name": "btx_io...
27145099837
from odoo import models, fields, api, _ import uuid class AttachmentsShare(models.Model): _name = 'attachments.share' _description = 'Attachments Share' def _default_access_token(self): return uuid.uuid4().hex def _compute_state(self): for record in self: record.state = '...
kasng/OdooPM
extra-addons/sync_documents/models/attachments_share.py
attachments_share.py
py
2,253
python
en
code
0
github-code
21
[ { "api_name": "odoo.models.Model", "line_number": 5, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 5, "usage_type": "name" }, { "api_name": "uuid.uuid4", "line_number": 10, "usage_type": "call" }, { "api_name": "odoo.fields.Date.from_str...
40549665642
import io from unittest.mock import MagicMock import pytest from monkeytypes import OperatingSystem from tests.monkey_island import InMemoryFileRepository from monkey_island.cc.repositories import IFileRepository, RetrievalError from monkey_island.cc.services.agent_binary_service.agent_binary_repository import ( ...
guardicore/monkey
monkey/tests/unit_tests/monkey_island/cc/services/agent_binary_service/test_agent_binary_repository.py
test_agent_binary_repository.py
py
1,921
python
en
code
6,367
github-code
21
[ { "api_name": "tests.monkey_island.InMemoryFileRepository", "line_number": 21, "usage_type": "call" }, { "api_name": "monkey_island.cc.services.agent_binary_service.agent_binary_repository.LINUX_AGENT_FILE_NAME", "line_number": 22, "usage_type": "argument" }, { "api_name": "io.By...
71833981494
import os, sys sys.path.append(os.path.join(os.path.dirname(__file__), "../../")) from scripts.simulation.SimulationWorld import SimulationWorld from scripts.GUI import TrajPlanner from PyQt4 import QtGui import sys from scripts.TrajectoryOptimizationPlanner.TrajectoryOptimizationPlanner import TrajectoryOptimizationPl...
k-maheshkumar/trajopt_python
scripts/examples/planner_example_kukka_arm.py
planner_example_kukka_arm.py
py
2,623
python
en
code
25
github-code
21
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 2, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
4049187370
from auditlog.registry import auditlog from django.db import models class Case(models.Model): total = models.IntegerField() recovered = models.IntegerField() deaths = models.IntegerField() county = models.ForeignKey("County", on_delete=models.CASCADE) as_of = models.DateField() created_on = m...
rzwink/ohioready-api
api/models/case.py
case.py
py
623
python
en
code
1
github-code
21
[ { "api_name": "django.db.models.Model", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 5, "usage_type": "name" }, { "api_name": "django.db.models.IntegerField", "line_number": 6, "usage_type": "call" }, { "api_name"...
13954466857
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import string from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.metrics import f1_score from sklearn.preprocessing import StandardScaler from sklearn.svm import LinearSVC from sklearn.naive_bayes import MultinomialNB '''Load Data''' training = open...
AndreaCeolin/VarDial2021
RDI/shallow_models.py
shallow_models.py
py
1,389
python
en
code
0
github-code
21
[ { "api_name": "string.punctuation", "line_number": 20, "usage_type": "attribute" }, { "api_name": "sklearn.feature_extraction.text.TfidfVectorizer", "line_number": 29, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.StandardScaler", "line_number": 30, "usage_...
41890773307
## fetchbot spider v.0.0.1 beta created by pro_metheus import requests from bs4 import BeautifulSoup as bs def spider(a): #the spider function who visits the links provided by the breaker if(requests.get(a)): r=requests.get(a) print(a+" found and is working...") #all other function...
pro-metheus/fetcher
spider.py
spider.py
py
711
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 8, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 18, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_nu...
29505986232
from django import template register = template.Library() @register.simple_tag def column_classes(col_block): """ Creates a list of classes for column classes :param col_block: a Column block from a StructBlock :return: """ class_str = '' for val, size in col_block.value['columns'].items(...
Designer023/cookiecutter-wagtail-bootstrap-heroku
{{cookiecutter.pkg_name}}/boost_cms/templatetags/bootstrap_grid_tags.py
bootstrap_grid_tags.py
py
682
python
en
code
0
github-code
21
[ { "api_name": "django.template.Library", "line_number": 3, "usage_type": "call" }, { "api_name": "django.template", "line_number": 3, "usage_type": "name" } ]
28801916387
import sys import io _INPUT = """\ 20 1000 4 51 69 102 127 233 295 350 388 417 466 469 523 553 587 720 739 801 855 926 954 """ sys.stdin = io.StringIO(_INPUT) # 「答え」を二分探索する問題 # 範囲を「半分の値=基準値」で割って探索するのが二分探索 # 今回の場合、スコアの値は0以上L以下と最大と最小が決まっているのでこれの半分であるM以上の値は満たすかを調べていくことで求められる import sys N, L = list(map(int, sys.stdin....
Satjopg/atcoder
typical90/001.py
001.py
py
1,195
python
ja
code
0
github-code
21
[ { "api_name": "sys.stdin", "line_number": 11, "usage_type": "attribute" }, { "api_name": "io.StringIO", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.stdin.readline", "line_number": 18, "usage_type": "call" }, { "api_name": "sys.stdin", "line_n...
5670845974
from django.shortcuts import get_object_or_404 from rest_framework import generics, permissions from rest_framework.response import Response from rest_framework.parsers import FormParser,MultiPartParser from .models import BecomeTeacher from .serializers import BecomeTeacherSerializer, TeacherProfileSerializer from use...
piyushKumar-1/online-tuition
teacher/api.py
api.py
py
7,041
python
en
code
0
github-code
21
[ { "api_name": "rest_framework.generics.GenericAPIView", "line_number": 14, "usage_type": "attribute" }, { "api_name": "rest_framework.generics", "line_number": 14, "usage_type": "name" }, { "api_name": "student.serializers.EventsSerializer", "line_number": 15, "usage_type...
21633916428
import openai import os # Configure a chave de API openai.api_key = "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" # Envie uma solicitação de texto para o modelo ChatGPT response = openai.Completion.create( engine="davinci", # Escolha um dos modelos pré-treinados disponíveis prompt="Olá, como poss...
Daniel-sdn/openai
arquivo-bkp/chave.py
chave.py
py
440
python
pt
code
0
github-code
21
[ { "api_name": "openai.api_key", "line_number": 5, "usage_type": "attribute" }, { "api_name": "openai.Completion.create", "line_number": 8, "usage_type": "call" }, { "api_name": "openai.Completion", "line_number": 8, "usage_type": "attribute" } ]
26966499971
import csv from codecs import BOM_UTF8, BOM_UTF16, BOM_UTF16_BE, BOM_UTF16_LE from io import StringIO def _csv_iter(f, has_header): rd = iter(csv.reader(f)) hdr = next(rd) if has_header else [] return hdr, rd def rows_from_csv(filename, encoding='utf-8', has_header=True, return_header=False): with o...
MHMMD-ASHIF/VOX-personal-voice-assistant
venv/Lib/site-packages/plib/stdlib/csvtools.py
csvtools.py
py
1,720
python
en
code
0
github-code
21
[ { "api_name": "csv.reader", "line_number": 7, "usage_type": "call" }, { "api_name": "codecs.BOM_UTF8", "line_number": 31, "usage_type": "name" }, { "api_name": "codecs.BOM_UTF16", "line_number": 32, "usage_type": "name" }, { "api_name": "codecs.BOM_UTF16_BE", ...
71993383413
#### 01 Setting Up #### import requests from bs4 import BeautifulSoup import csv url = "https://www.justdial.com/Madanapalle/Mobile-Shops/nct-11216691" r = requests.get(url) print(r.content) soup = BeautifulSoup(r.content, 'html5lib') print(soup.prettify()) #### 02 Scraping #### shop_name_location = ".lng_cont_...
ashrithssreddy/adhoc_codes
eyewear_data_scraping/code.py
code.py
py
386
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 6, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 8, "usage_type": "call" } ]
24562156368
bl_info={ "author": "STEAM LAB CENTRO, Diego Trujillo Pisanty", "blender":(2,80,0), "description":"Export RAPID scripts for ABB robots", "name":"ABBlender", "support":"TESTING", "version":(0,2), "wiki_url":"https://github.com/dtpisanty/abblender" } import bpy from math import degrees #...
dtpisanty/abblender
abblender.py
abblender.py
py
10,816
python
en
code
1
github-code
21
[ { "api_name": "bpy.types", "line_number": 17, "usage_type": "attribute" }, { "api_name": "bpy.props.StringProperty", "line_number": 18, "usage_type": "call" }, { "api_name": "bpy.props", "line_number": 18, "usage_type": "attribute" }, { "api_name": "bpy.props.Stri...
24567942470
#!/usr/bin/python3 from loadgui import problems import matplotlib.pyplot as plt import numpy as np from PIL import Image import os def pie_chart(directory, colors): h, i = problems(directory) fig = plt.figure() lst_data = [] lst_value = [] for j in range(len(h)): lst_data.append(h[j]) ...
0m3re/SNCF
visuel/piechart.py
piechart.py
py
792
python
en
code
1
github-code
21
[ { "api_name": "loadgui.problems", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 10, "usage_type": "name" }, { "api_name": "numpy.arra...
7955078133
from configparser import ConfigParser from tkinter.filedialog import askdirectory from win10toast import ToastNotifier toast = ToastNotifier() file = 'config.ini' config = ConfigParser() config.read(file) #ruta vieja C:/Users/miyav/videos/prueba-wdog # path = askdirectory() path = '{}'.format(askdirectory(title='Sel...
Rob382/auto-borrar-archivo-mas-reciente
actualizar_config.py
actualizar_config.py
py
1,054
python
es
code
1
github-code
21
[ { "api_name": "win10toast.ToastNotifier", "line_number": 5, "usage_type": "call" }, { "api_name": "configparser.ConfigParser", "line_number": 8, "usage_type": "call" }, { "api_name": "tkinter.filedialog.askdirectory", "line_number": 13, "usage_type": "call" } ]
71192904053
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('students', '0005_auto_20151022_2131'), ] operations = [ migrations.CreateModel( name='Groups', field...
egorsmth/students
students/migrations/0006_auto_20151022_2142.py
0006_auto_20151022_2142.py
py
1,114
python
en
code
0
github-code
21
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.CreateModel", "line_number": 14, "usage_type": "call" }, ...
37128106690
import matplotlib.pyplot as plt import numpy as np import argparse as ap import scipy.integrate as si def lj(r,eps,sig): r6=r*r*r*r*r*r r6i=pow(sig,6)*np.reciprocal(r6) return 4*eps*(r6i*r6i-r6i) parser=ap.ArgumentParser() parser.add_argument('-i',type=str,default=[],action='append',help='input file name'...
Abrams-Teaching/instructional-codes
originals/plot_rdf.py
plot_rdf.py
py
1,379
python
en
code
0
github-code
21
[ { "api_name": "numpy.reciprocal", "line_number": 8, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 21, "usage_type": "call" }, { "api_name": "ma...
27574052527
from datetime import datetime import numpy as np def convert_to_rates(times, values): rates = np.diff(values) / np.diff(times) return times[:-1], rates def interpolate_times(times, values): times_interp = np.linspace(np.min(times), np.max(times), times.size) values_interp = np.interp(times_interp, t...
akofke/autoperiod
src/autoperiod/helpers.py
helpers.py
py
918
python
en
code
12
github-code
21
[ { "api_name": "numpy.diff", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.min", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 11,...
71409923893
from __future__ import print_function from keras.models import Model from keras.models import Sequential from keras.layers import Input, LSTM, Dense import numpy as np import os import audiosegment from keras.layers import TimeDistributed from keras.layers import RepeatVector ''' Yet another attempt with LS...
joakimrisa/Mandatory
Prosjekt/retryLSTM.py
retryLSTM.py
py
2,072
python
en
code
0
github-code
21
[ { "api_name": "os.walk", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_number": 28, "usage_type": "attribute" }, { "api_name": "audiosegment.from_file", "line_...
28018712128
from requests import get import json url = 'https://earthquake.usgs.gov/fdsnws/event/1/query' def main(): with open('CA.txt', 'w') as f: arr = [] for year in range(1970, 2021): for month in range(1, 12): _month1 = month if month > 9 else f'0{month}' _mo...
Dearkano/Aftershock
ml/datafeed.py
datafeed.py
py
977
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 24, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 28, "usage_type": "call" } ]
72905278453
import wordle_solve, json, copy # word list - load in from json file # f = open('bigdictionary.json') f = open('wordledictionary.json') wordList = json.load(f) f.close # initialize all_words and valid_words lists - dictionary with words of proper length # and with T or F indicating whether word valid with current Kno...
jacoxnet/wordle
play.py
play.py
py
2,059
python
en
code
1
github-code
21
[ { "api_name": "json.load", "line_number": 6, "usage_type": "call" }, { "api_name": "wordle_solve.WORDLEN", "line_number": 13, "usage_type": "attribute" }, { "api_name": "copy.deepcopy", "line_number": 15, "usage_type": "call" }, { "api_name": "wordle_solve.WordKno...
42872149867
from flask import render_template, redirect, session, request, url_for, flash, Markup from app import app, db from app.forms import LoginForm, EditorForm from app.models import User, Post, Tag from flask_login import current_user, login_user, logout_user, login_required from werkzeug.urls import url_parse from werkzeug...
magicaljellybeans/blog
app/routes.py
routes.py
py
6,783
python
en
code
0
github-code
21
[ { "api_name": "flask.request.args.get", "line_number": 16, "usage_type": "call" }, { "api_name": "flask.request.args", "line_number": 16, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 16, "usage_type": "name" }, { "api_name": "app.mode...
30539532734
"""Esse módulo contém funções e classes utilitárias para otimizações do ABM. """ from __future__ import annotations from dataclasses import dataclass from typing import Callable import numpy as np from py_abm.entities import Fitness from py_abm.fitness.abm import Market, OptimizationType class ABMFitnessWithCallba...
moesio-f/py-abm-public
src/py_abm/runners/utils/abm.py
abm.py
py
10,057
python
pt
code
0
github-code
21
[ { "api_name": "py_abm.entities.Fitness", "line_number": 21, "usage_type": "name" }, { "api_name": "typing.Callable", "line_number": 22, "usage_type": "name" }, { "api_name": "numpy.ndarray", "line_number": 22, "usage_type": "attribute" }, { "api_name": "py_abm.ent...
71898370934
import WebScraper as ws import Lists as l from selenium.common import exceptions as seleniumExceptions import traceback import StringOperations as s import Enums as e class FacebookScraper(ws.Webscraper): def __init__(self, email, password): ws.Webscraper.__init__(self) self.login(email, password...
danach707/FinalProjectJCE
FacebookScraper.py
FacebookScraper.py
py
6,099
python
en
code
0
github-code
21
[ { "api_name": "WebScraper.Webscraper", "line_number": 9, "usage_type": "attribute" }, { "api_name": "WebScraper.Webscraper.__init__", "line_number": 12, "usage_type": "call" }, { "api_name": "WebScraper.Webscraper", "line_number": 12, "usage_type": "attribute" }, { ...
34477856822
#incomplete from rest_framework.test import APITestCase from rest_framework.reverse import reverse as api_reverse from rest_framework import status from django.contrib.auth import get_user_model from testeAPI.models import BlogPost #automated #new/blank db from testeAPI.models import BlogPost class BlogAPITestCase(A...
jpmarques-13/primeiraAPI
TestandoAPI/testeAPI/api/test.py
test.py
py
1,045
python
en
code
0
github-code
21
[ { "api_name": "rest_framework.test.APITestCase", "line_number": 13, "usage_type": "name" }, { "api_name": "testeAPI.models.BlogPost.objects.create", "line_number": 19, "usage_type": "call" }, { "api_name": "testeAPI.models.BlogPost.objects", "line_number": 19, "usage_type...
2409745527
from __future__ import absolute_import import logging from .error_messages import CHARACTER_LIMIT_MESSAGE logger = logging.getLogger(__name__) WEBVIEW_HEIGHT_RATIOS = [ 'compact', 'tall', 'full', ] class Text(object): def __init__(self, text, quick_replies=None): self.text = text s...
rehabstudio/fbmessenger
fbmessenger/elements.py
elements.py
py
6,577
python
en
code
111
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "error_messages.CHARACTER_LIMIT_MESSAGE.format", "line_number": 75, "usage_type": "call" }, { "api_name": "error_messages.CHARACTER_LIMIT_MESSAGE", "line_number": 75, "usage_type": ...
35707864700
import unittest import os from lib.height import Heights test_filename = os.path.join(os.path.dirname( __file__), 'test_data', 'test_data.txt') class TestHeights(unittest.TestCase): def test_path_finder(self): with open(test_filename) as f: heights = Heights(f) heights.find_path...
steventhurgood/adventofcode
lib/height/height_test.py
height_test.py
py
567
python
en
code
0
github-code
21
[ { "api_name": "os.path.join", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 6, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_...
31388230511
import argparse import os import numpy as np import time from io import BytesIO import matplotlib import matplotlib.pyplot as plt from common.mko import MKO from common.utilities import encodings from externals import get_samples_array, post_error, post_results_cache, post_status import time def parse_args(): par...
SCOREC/BDA_SM
src/analyzers/executables/cloudplot.py
cloudplot.py
py
4,359
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path", "line_number": 29, "usage_type": "attribute" }, { "api_name": "os.unlink", "...
5439995552
import pygame from player import Player from food import Food import constants as C from levels import levels from helpers import Point from obstacle import Obstacle def point_inside_rect(point, rect): return rect.x <= point.x < rect.x + rect.width and rect.y <= point.y < rect.y + rect.height def rect_collisio...
sammko/EatForSpeed
main.py
main.py
py
4,663
python
en
code
null
github-code
21
[ { "api_name": "helpers.Point", "line_number": 17, "usage_type": "call" }, { "api_name": "helpers.Point", "line_number": 20, "usage_type": "call" }, { "api_name": "levels.levels", "line_number": 32, "usage_type": "name" }, { "api_name": "obstacle.Obstacle", "li...
14725055013
import requests import json def fetch_data(url): resp = requests.get(url) try: json_data = resp.json() except json.decoder.JSONDecodeError: print(f"Error ao buscar: {url}") return {} return json_data def get_from_via_cep_api(cep: str): CEP_URL = f"https://viacep.com.br/ws...
n1lux/csv-to-table
utils/get_api.py
get_api.py
py
418
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 6, "usage_type": "call" }, { "api_name": "json.decoder", "line_number": 9, "usage_type": "attribute" } ]
74403148211
from .models import * from django.core.files import File from django.contrib.auth.models import Group def check_matches(): for match in Match.objects.all(): pointsA = 0 pointsB = 0 if match.tabellinoA: for stat in match.tabellinoA.get_stats(): if stat: ...
Morri02/Portale-FIP
main/initcmds.py
initcmds.py
py
4,842
python
en
code
0
github-code
21
[ { "api_name": "django.core.files.File", "line_number": 124, "usage_type": "call" }, { "api_name": "django.core.files.File", "line_number": 134, "usage_type": "call" } ]
21746487552
import copy from typing import List, Mapping, Tuple, Dict from petools.core import PosePredictorInterface from .angle_math import * class AngleCalculator: right_shoulder_angle = 'right_shoulder_angle' left_shoulder_angle = 'left_shoulder_angle' right_hip_angle = 'right_hip_angle' left_hip_angle = 'le...
MakiResearchTeam/PETools
petools/model_tools/angle_calculation_tools/angle_calculator.py
angle_calculator.py
py
4,605
python
en
code
0
github-code
21
[ { "api_name": "typing.List", "line_number": 22, "usage_type": "name" }, { "api_name": "copy.deepcopy", "line_number": 81, "usage_type": "call" }, { "api_name": "petools.core.PosePredictorInterface.HUMANS", "line_number": 84, "usage_type": "attribute" }, { "api_nam...
70314937974
# 242. Valid Anagram class Solution: def isAnagram(self, s: str, t: str) -> bool: from collections import Counter c = Counter(s) c1 = Counter(t) return c == c1 s = Solution() ss = "rat" t = "car" print(s.isAnagram(ss, t))
Azjargal13/lc-notes-codes
general/lc-242.py
lc-242.py
py
262
python
en
code
0
github-code
21
[ { "api_name": "collections.Counter", "line_number": 7, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 8, "usage_type": "call" }, { "api_name": "{'Counter': 'collections.Counter'}", "line_number": 12, "usage_type": "call" } ]
6076976790
#!/usr/bin/python import RPi.GPIO as GPIO from picamera import PiCamera import time import datetime PIN = 12 GPIO.setmode(GPIO.BCM) GPIO.setup(PIN, GPIO.IN) camera = PiCamera() camera.rotation = 180 camera.resolution = (1024, 576) #camera.start_preview() #sleep(20) #camera.stop_preview() while True: time.s...
jutako/raspi
camera/PIR_camera.py
PIR_camera.py
py
790
python
en
code
0
github-code
21
[ { "api_name": "RPi.GPIO.setmode", "line_number": 11, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_number": 11, "usage_type": "name" }, { "api_name": "RPi.GPIO.BCM", "line_number": 11, "usage_type": "attribute" }, { "api_name": "RPi.GPIO.setup", "lin...
28627356994
import os import mimetypes from django import forms from django.core.exceptions import ObjectDoesNotExist from django.http import HttpResponseBadRequest, FileResponse from django.shortcuts import render from django.utils.http import urlquote from django.views import View from website.models import Category from websit...
PLUS-POSTECH/study.plus.or.kr
src/seminar/views.py
views.py
py
2,907
python
en
code
5
github-code
21
[ { "api_name": "django.forms.Form", "line_number": 15, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 15, "usage_type": "name" }, { "api_name": "django.forms.CharField", "line_number": 16, "usage_type": "call" }, { "api_name": "django.for...
27885495347
import asyncio import os import discord from decouple import config from discord.ext import commands intents = discord.Intents().all() bot = commands.Bot(command_prefix="!", intents=intents) bot.remove_command('help') # Load Extensions async def load_cogs(): await bot.load_extension('help') await bot.load_e...
matheusrod21/Duda-Discord-Bot
src/main.py
main.py
py
597
python
en
code
0
github-code
21
[ { "api_name": "discord.Intents", "line_number": 8, "usage_type": "call" }, { "api_name": "discord.ext.commands.Bot", "line_number": 9, "usage_type": "call" }, { "api_name": "discord.ext.commands", "line_number": 9, "usage_type": "name" }, { "api_name": "os.listdir...
25900181194
from collections import namedtuple from abc import ABC, abstractmethod import numpy as np from scipy.signal import find_peaks from scipy.ndimage import maximum_filter # Helper functions for validating inputs. def ensure_covariance_size(R, array): """Ensures the size of R matches the given array design.""" m = ...
morriswmz/doatools.py
doatools/estimation/core.py
core.py
py
10,582
python
en
code
132
github-code
21
[ { "api_name": "scipy.signal.find_peaks", "line_number": 31, "usage_type": "call" }, { "api_name": "scipy.ndimage.maximum_filter", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 35, "usage_type": "call" }, { "api_name": "nump...
308559622
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('hs', '0003_auto_20150312_2216'), ] operations = [ migrations.AlterField( model_name='challenge', name...
maincarry/esports-hs
hs/migrations/0004_auto_20150312_2230.py
0004_auto_20150312_2230.py
py
666
python
en
code
0
github-code
21
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AlterField", "line_number": 13, "usage_type": "call" }, {...
37224594218
#CH07_02. SVM 커널 실습(python) #Iris 데이터를 이용한 SVM 커널 실습 import pandas as pd import numpy as np import matplotlib.pyplot as plt np.random.seed(2021) #1. Data from sklearn.datasets import load_iris iris = load_iris() data = iris.data target = iris.target data = data[target !=0, :2] target = target[target !=0] plt.sca...
badjiyoon/da_study
Sewon/part4/ch7/ML_algorithm_ch7_02.py
ML_algorithm_ch7_02.py
py
4,879
python
en
code
0
github-code
21
[ { "api_name": "numpy.random.seed", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 8, "usage_type": "attribute" }, { "api_name": "sklearn.datasets.load_iris", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotl...
19943918727
import configparser import requests import json config = configparser.ConfigParser() config.read("config.ini") bearer_token = config.get("vars", "bearer_token") api_application = config.get("vars", "api_application") api_company = config.get("vars", "api_company") template = config.get("vars", "template") agents_url ...
ixoncloud/apply-agent-template-to-all
main.py
main.py
py
1,721
python
en
code
0
github-code
21
[ { "api_name": "configparser.ConfigParser", "line_number": 5, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 22, "usage_type": "call" }, { "api_name": "requests.patch", "line_number": 55, "usage_type": "call" }, { "api_name": "json.dumps", ...
17195050673
import abc from collections import OrderedDict import cfpi.core.gtimer as gt from cfpi.core.logging import eval_util, logger from cfpi.data_management.replay_buffer import ReplayBuffer from cfpi.samplers.path_collector import MdpPathCollector def _get_epoch_timings(): times_itrs = gt.get_times().stamps.itrs ...
cfpi-icml23/cfpi
cfpi/core/rl_algorithm.py
rl_algorithm.py
py
8,096
python
en
code
6
github-code
21
[ { "api_name": "cfpi.core.gtimer.get_times", "line_number": 11, "usage_type": "call" }, { "api_name": "cfpi.core.gtimer", "line_number": 11, "usage_type": "name" }, { "api_name": "collections.OrderedDict", "line_number": 12, "usage_type": "call" }, { "api_name": "c...
17769833730
from django.urls import path from rest_framework.authtoken import views from . import views from rest_framework_simplejwt.views import ( TokenObtainPairView, TokenRefreshView, ) urlpatterns = [ path('invoices/', views.InvoiceView.as_view(), name='invoice'), path('invoices/mass/', views.InvoiceMass.as_v...
EnisBourbia/Payio
backend/invoice/urls.py
urls.py
py
1,223
python
en
code
0
github-code
21
[ { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" }, { "api_name": "rest_framework.authtoken.views.InvoiceView.as_view", "line_number": 10, "usage_type": "call" }, { "api_name": "rest_framework.authtoken.views.InvoiceView", "line_number": 10, "usag...
15579654480
# Cut Edge from collections import defaultdict graph = defaultdict(list) visited = [] timer = 0 # low -> lowest time of insertion of the current node # tin -> actual time of insertion of the current node low, tin = [], [] def printAllBridges(current, parent): global graph, visited, timer, low, tin visited[c...
Deepak-Laksman/DSA-Implementations-Python
Graphs/BridgesInGraph.py
BridgesInGraph.py
py
1,221
python
en
code
0
github-code
21
[ { "api_name": "collections.defaultdict", "line_number": 5, "usage_type": "call" } ]
73034818293
""" ====================================== MEGSIM single trial simulation dataset ====================================== The MEGSIM consists of experimental and simulated MEG data which can be useful for reproducing research results. The MEGSIM files will be dowloaded automatically. The datasets are documented in: A...
LiuFang816/SALSTM_py_data
python/mne-tools_mne-python/mne-python-master/examples/datasets/plot_megsim_data_single_trial.py
plot_megsim_data_single_trial.py
py
1,226
python
en
code
9
github-code
21
[ { "api_name": "mne.datasets.megsim.load_data", "line_number": 26, "usage_type": "call" }, { "api_name": "mne.read_evokeds", "line_number": 32, "usage_type": "call" }, { "api_name": "mne.combine_evoked", "line_number": 33, "usage_type": "call" } ]
26559599811
import numpy as np import pandas as pd import scipy.signal import matplotlib.colors import matplotlib.pyplot as plt import sampex import cdflib import fbrbsp import fbrbsp.load.utils as utils from fbrbsp.load.emfisis import Mag base_data_url = 'https://spdf.gsfc.nasa.gov/pub/data/rbsp/' q_e = -1.6E-19 m_e = 9.1E-31 ...
mshumko/fbrbsp
fbrbsp/load/efw.py
efw.py
py
8,822
python
en
code
0
github-code
21
[ { "api_name": "fbrbsp.load.utils.validate_time_range", "line_number": 43, "usage_type": "call" }, { "api_name": "fbrbsp.load.utils", "line_number": 43, "usage_type": "name" }, { "api_name": "fbrbsp.load.utils.get_filename_times", "line_number": 52, "usage_type": "call" ...
32875628181
# 세그먼트 트리 설명 - 안경잡이개발자 https://m.blog.naver.com/ndb796/221282210534 # 세그먼트 트리 효율적인 구현 https://gyutaelee.github.io/algorithm/Efficient-and-easy-segment-trees/ from typing import List class NumArray: def __init__(self, nums: List[int]): n = len(nums) # 2n 길이의 이진 트리를 만듭니다. # 1이 루트노드이며, 0은 사용...
yeardream-high6/coding_test
곽치영/Leetcode/2022.07/31/leetcode307.py
leetcode307.py
py
2,343
python
ko
code
0
github-code
21
[ { "api_name": "typing.List", "line_number": 8, "usage_type": "name" } ]