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
45785657546
import re import mmh3, base64, sys, os, time, platform import requests, argparse, socket from urllib.parse import urlparse from requests.exceptions import RequestException import urllib3 urllib3.disable_warnings() # shodan_cli_api_key and URL_LIST var can be also setted manually bellow. shodan_cli_api_key = "" URL_LI...
torsh4rk/favicon_hash_shodan
favicon_shodan.py
favicon_shodan.py
py
9,343
python
en
code
1
github-code
6
[ { "api_name": "urllib3.disable_warnings", "line_number": 8, "usage_type": "call" }, { "api_name": "platform.system", "line_number": 16, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 24, "usage_type": "call" }, { "api_name": "base64.encodebyt...
28246082829
from tx_js.utils import utils import pandas as pd import json class model_data_process: def __init__(self, config): self.fea_config = config['fea_config'] self.data = pd.read_csv(config['data_path']) def deal_min_max_(self): print('*' * 10, 'min_max', '*' * 10) min_max_config = ...
nolxf1/tx_js
tx_js/data_process/model_data_process.py
model_data_process.py
py
2,992
python
en
code
1
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "tx_js.utils.utils.min_max_feature_", "line_number": 14, "usage_type": "call" }, { "api_name": "tx_js.utils.utils", "line_number": 14, "usage_type": "name" }, { "api_name": "t...
41630277364
import pandas as pd import os from pathlib import Path import logging import warnings from utils import * warnings.filterwarnings("ignore") MODE_MAPPING = { "car": "pv", "car_passenger": "pv", "bus": "pt", "rail": "pt", "ferry": "pt", "walk": "active", "bike": "active", "freight": "fr...
tringuyenarup/monty-data-visualization
src/trips_metrics.py
trips_metrics.py
py
6,617
python
en
code
0
github-code
6
[ { "api_name": "warnings.filterwarnings", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 25, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 26, "usage_type": "attribute" }, { "api_name": "pandas.D...
23976458337
# -*- coding: utf-8 -*- """ Created on Mon Aug 10 17:57:30 2020 @author: vinhe """ from selenium import webdriver from selenium.common.exceptions import NoSuchElementException from bs4 import BeautifulSoup import pandas as pd import time url = 'https://www.ukclimbing.com/logbook/books/dorset-1045' dr...
vince-lam/climbing-crag-selection
ukc_crag_scraper.py
ukc_crag_scraper.py
py
2,347
python
en
code
0
github-code
6
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 16, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 16, "usage_type": "name" }, { "api_name": "bs4.BeautifulSoup", "line_number": 29, "usage_type": "call" }, { "api_name": "time.s...
35971337923
import enum import obspython #pyright: ignore [reportMissingImports] import serial class _Events(enum.IntEnum): NONE = 0 STREAMING = 1 RECORDING = 2 STREAMING_AND_RECORDING = 3 def start_streaming(self): if self is self.NONE: new_state = self.STREAMING elif self is self...
kiransingh99/OBS-tally
src/tally.py
tally.py
py
2,416
python
en
code
0
github-code
6
[ { "api_name": "enum.IntEnum", "line_number": 5, "usage_type": "attribute" }, { "api_name": "obspython.OBS_FRONTEND_EVENT_STREAMING_STARTING", "line_number": 54, "usage_type": "attribute" }, { "api_name": "obspython.OBS_FRONTEND_EVENT_STREAMING_STOPPED", "line_number": 57, ...
71277508668
import os, sys sys.path.append(os.path.dirname(__file__)) from config import setting import unittest, time from reportTemplate.HTMLTestRunnerCN import HTMLTestRunner # 测试报告存放文件夹,如不存在,则自动创建一个report目录 if not os.path.exists(setting.TEST_REPORT): os.makedirs(setting.TEST_REPORT + '/' + "screenshot") def add_case(test...
r3fR4in/psuy-test-demo
run_test.py
run_test.py
py
1,128
python
en
code
1
github-code
6
[ { "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.dirname", "line_number": 2, "usage_type": "call" }, { "api_name": "os.path", "line_number...
21040640825
import sys from PyQt5.QtWidgets import QApplication, QWidget, QDoubleSpinBox, QSpinBox, QHBoxLayout from PyQt5.QtCore import Qt ''' 建立視窗 ''' class MyClass(QWidget): def __init__(self): super().__init__() self.initUI() def initUI(self): self.setWindowTitle("hihi") self.resize(...
yongjiechou/chouyj
yongjie0706.py
yongjie0706.py
py
921
python
en
code
0
github-code
6
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 10, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QHBoxLayout", "line_number": 18, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QSpinBox", "line_number": 19, "usage_type": "call" }, { "api_...
39028062819
import json import argparse from typing import Literal import requests from time import sleep from datetime import datetime from paramiko import AutoAddPolicy, SFTPClient, SSHClient def get_ssh_client(ssh_host: str, ssh_usr: str, ssh_pwd: str = None) -> SSHClient: ssh = SSHClient() ssh.set_missing_host_key_po...
omirete/free-live-news
automations/update_news_videos_list.py
update_news_videos_list.py
py
6,033
python
en
code
0
github-code
6
[ { "api_name": "paramiko.SSHClient", "line_number": 11, "usage_type": "call" }, { "api_name": "paramiko.AutoAddPolicy", "line_number": 12, "usage_type": "call" }, { "api_name": "paramiko.SSHClient", "line_number": 10, "usage_type": "name" }, { "api_name": "paramiko...
7467820805
import logging from dataclasses import asdict from http import HTTPStatus from aiohttp import web import aiohttp from ..Avatar.avatar import Avatar from ..AvatarProcessor.avatar_processor import AvatarProcessor, LookStringVersionException from ..server.config import Config class HTTPHandler: def __init__( ...
leecs0503/maple-cody-recommendation-system
src/AvatarServer/server/http_handler.py
http_handler.py
py
6,047
python
en
code
4
github-code
6
[ { "api_name": "logging.Logger", "line_number": 16, "usage_type": "attribute" }, { "api_name": "server.config.Config", "line_number": 17, "usage_type": "name" }, { "api_name": "AvatarProcessor.avatar_processor.AvatarProcessor", "line_number": 18, "usage_type": "name" }, ...
74537475388
import numpy as np, cv2 # 라디안 각도가 필요(20도 회전) theta = 20 * np.pi / 180 rot_mat = np.array([[np.cos(theta), -np.sin(theta)], [np.sin(theta), np.cos(theta)]], np.float32) pts1 = np.array([(250, 30), (400, 70), (350, 250), (150, 200)], np.float32) # rot_mat * pts1 을 계산하여 회전변환된 행렬을 구함...
binlee52/OpenCV-python
ch05/19.point_transform.py
19.point_transform.py
py
757
python
en
code
1
github-code
6
[ { "api_name": "numpy.pi", "line_number": 4, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.cos", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 5, ...
8233513096
import json #10-6 加法运算 """ print("Please input two number\n") try: x = int(input("first number:\n")) y = int(input("second number:\n")) except ValueError: print("Sorry, I really needed a number.") else: sum = x + y print("The sum of " + str(x) + " and " + str(y) + " is " + str(sum) + ".") #10-7 ...
coryeleven/learn_python
file_exception/execption.py
execption.py
py
2,032
python
en
code
0
github-code
6
[ { "api_name": "json.dump", "line_number": 64, "usage_type": "call" }, { "api_name": "json.load", "line_number": 70, "usage_type": "call" }, { "api_name": "json.load", "line_number": 74, "usage_type": "call" } ]
16492848867
from __future__ import annotations import pygame from typing import Optional from settings import * class Actor: """ A class to represent all the game's actors. This class includes any attributes/methods that every actor in the game must have. This is an abstract class. Only subclasses should be inst...
kimber1y-tung/CSC148
a1/code/actors2.py
actors2.py
py
13,670
python
en
code
0
github-code
6
[ { "api_name": "pygame.Surface", "line_number": 24, "usage_type": "attribute" }, { "api_name": "pygame.image.load", "line_number": 32, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 32, "usage_type": "attribute" }, { "api_name": "pygame.Surfac...
27679934780
"""The main stript to call the imgCIF creator. """ import sys import os import re import click import CifFile from imgCIF_Creator.output_creator import imgcif_creator from imgCIF_Creator.command_line_interfaces import parser def validate_filename(filename): """Checks if the input string is a) a folder containin...
COMCIFS/instrument-geometry-info
Tools/imgCIF_Creator/imgCIF_Creator/creator.py
creator.py
py
6,366
python
en
code
0
github-code
6
[ { "api_name": "os.path.isdir", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_number": 23, "usage_type": "attribute" }, { "api_name": "os.walk", "line_number": 24, "usage_type": "call" }, { "api_name": "os.sep", "line_number": 24, ...
14093508629
from cProfile import label from django import forms from django.forms import ModelForm from .models import File class FileForm(ModelForm): class Meta: model = File fields = ["file",] labels = { "file": "" } widgets = { 'file': forms.FileInput(attrs={'class': 'upload'}), }
omaralsakka/Bluugo-exercise
app1/forms.py
forms.py
py
293
python
en
code
0
github-code
6
[ { "api_name": "django.forms.ModelForm", "line_number": 6, "usage_type": "name" }, { "api_name": "models.File", "line_number": 8, "usage_type": "name" }, { "api_name": "django.forms.FileInput", "line_number": 14, "usage_type": "call" }, { "api_name": "django.forms"...
23139443318
from djoser.serializers import UserCreateSerializer, UserSerializer from drf_extra_fields.fields import Base64ImageField from rest_framework.validators import UniqueTogetherValidator from users.models import User, Follow from .models import Recipes, Tags, Ingredient, FavoriteUser, ShopCart, \ IngredientForRecipe fr...
salbadys/foodgram-project-react
backend/api/serializers.py
serializers.py
py
8,635
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 10, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 10, "usage_type": "name" }, { "api_name": "models.Recipes", "line_number": 14, "usage_type": "name" }, ...
9661144523
from collections import deque import sys input = sys.stdin.readline def bfs(v, visited, A): q = deque() q.append(v) visited[v] += 1 while q: node = q.popleft() for i in A[node]: if visited[i] == -1: visited[i] = visited[node] + 1 q.append(i)...
java-squid/lets-algorithm
08--graph/han/baekjoon/18352.py
18352.py
py
1,280
python
ko
code
0
github-code
6
[ { "api_name": "sys.stdin", "line_number": 4, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 7, "usage_type": "call" } ]
35084977431
import xml.etree.cElementTree as ET import pprint osm_file = open("raleigh_north-carolina.osm", "r") def count_tags(file): """ Parses through tags and adds tags to the dictionary after calling the add_tag function """ tag_names = {} for event, elem in ET.iterparse(file, events=("start",)): add_tag(e...
kadc87/P3-Wrangle-OpenStreetMap-Data
audit.py
audit.py
py
591
python
en
code
0
github-code
6
[ { "api_name": "xml.etree.cElementTree.iterparse", "line_number": 15, "usage_type": "call" }, { "api_name": "xml.etree.cElementTree", "line_number": 15, "usage_type": "name" }, { "api_name": "pprint.pprint", "line_number": 30, "usage_type": "call" } ]
26972696011
import execjs import time import requests with open('2.js', 'r', encoding='utf-8') as f: line = execjs.compile(f.read()) total = 0 times = 0 for i in range(1, 6): t = int(time.time()) * 1000 + 100000000 mm = line.call('get_m',str(t)) params = { 'page': i, 'm': str(mm) + '丨'...
DennisDing-CN/yuanrenxue_1
yuanrenxue_2/2.py
2.py
py
753
python
en
code
0
github-code
6
[ { "api_name": "execjs.compile", "line_number": 6, "usage_type": "call" }, { "api_name": "time.time", "line_number": 10, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 20, "usage_type": "call" } ]
39654580074
import os os.environ['CUDA_VISIBLE_DEVICES'] = '7' import logging import engine.hooks as hooks from engine.launch import launch from engine.defaults import DefaultTrainer, default_setup, default_argument_setup from datasets.segmentation.builder import build_segmentation_train_loader from datasets.segmentation.builder...
lqxisok/llSeg
exp/train_cityscapes.py
train_cityscapes.py
py
4,715
python
en
code
2
github-code
6
[ { "api_name": "os.environ", "line_number": 2, "usage_type": "attribute" }, { "api_name": "engine.defaults.DefaultTrainer", "line_number": 24, "usage_type": "name" }, { "api_name": "datasets.segmentation.builder.build_segmentation_train_loader", "line_number": 30, "usage_t...
14923981687
# Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html import os import os.path import json import hashlib import httplib2 import base64 class SpiderPipeline(object): def __init__(self, store_uri, post_ur...
1nforimcon5ultin9/5pid3r
spider/spider/pipelines/basic.py
basic.py
py
1,583
python
en
code
1
github-code
6
[ { "api_name": "os.path.exists", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 16, "usage_type": "call" }, { "api_name": "base64.b64encode", "line_...
31192539431
''' Created on Jan 20, 2023 @author: Miguel This class lets the manage of 2B_MatrixElement suite to obtain hamiltonians TODO: should be used to obtain the hamiltonian files, can be called from runner setUp's in case there are no seeds. ''' import os import subprocess import shutil import xml.etree.ElementTree ...
migueldelafuente1/taurus_tools
tools/hamiltonianMaker.py
hamiltonianMaker.py
py
14,505
python
en
code
1
github-code
6
[ { "api_name": "tools.helpers.TBME_SUITE", "line_number": 57, "usage_type": "name" }, { "api_name": "os.listdir", "line_number": 57, "usage_type": "call" }, { "api_name": "tools.helpers.GITHUB_2BME_HTTP", "line_number": 78, "usage_type": "argument" }, { "api_name":...
3814009951
import argparse import os import importlib from datetime import datetime from typing import Union, Callable import gymnasium as gym import deepspeed import numpy as np import torch import torch.nn as nn import torch.distributed as dist from torch.distributions import Normal from deepspeed.runtime.pipe.topology import ...
bigrl-team/gear
examples/offline/single-node/main.py
main.py
py
5,184
python
en
code
11
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 25, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 62, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 62, "usage_type": "name" }, { "api_name": "deeps...
1921549266
import pyomo.environ as pe from utils.properties import calc_beta_psa from samples.separator import Separator class PSA(): """ Pressure Swing Adsorption Must be combined with "Separator" stream_in: Input stream, object of class 'stream' stream_prod: Output stream, object o...
jkleinekorte/millgas2what
src/samples/psa.py
psa.py
py
1,674
python
en
code
1
github-code
6
[ { "api_name": "pyomo.environ.Block", "line_number": 22, "usage_type": "call" }, { "api_name": "pyomo.environ", "line_number": 22, "usage_type": "name" }, { "api_name": "samples.separator.Separator", "line_number": 31, "usage_type": "call" }, { "api_name": "pyomo.e...
2130581094
import email import imaplib import smtplib from email.mime.text import MIMEText from email.utils import formataddr, make_msgid from email.mime.multipart import MIMEMultipart from email.mime.base import MIMEBase from email import encoders from textwrap import dedent from email import encoders from utils.configs import *...
nqbinhcs/Remote-Desktop-via-Mail
src/utils/receiver.py
receiver.py
py
10,714
python
en
code
8
github-code
6
[ { "api_name": "smtplib.SMTP_SSL", "line_number": 65, "usage_type": "call" }, { "api_name": "imaplib.IMAP4_SSL", "line_number": 69, "usage_type": "call" }, { "api_name": "email.message_from_bytes", "line_number": 93, "usage_type": "call" }, { "api_name": "email.mes...
27009516728
import numpy as np import run as r ''' [id] 109 [name] LinearSVC [input] x_train 训练集 训练集标签数据集 二维数组 必须 定数 y_train 测试集 测试集数据集 二维数组 必须 定数 x_test 训练集标签 训练集标签标签 一维数组 必须 定数 y_test 测试集标签 测试集标签 一维数组 必须 定数 penalty 惩罚 默认为l2,指定惩罚中使用的规范。罚款是SVC中使用的标准。 'l2'导致稀疏的'coef_' vector,可选'l2','l1' 字符串 不必须 定数 loss 损失函数 默认为squared_hinge,指定损...
lisunshine1234/mlp-algorithm-python
machine_learning/classification/support_vector_machines/LinearSVC/main.py
main.py
py
6,263
python
zh
code
0
github-code
6
[ { "api_name": "run.run", "line_number": 80, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 97, "usage_type": "call" }, { "api_name": "numpy.delete", "line_number": 101, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 1...
4406041221
import sys from enum import Enum class Move(Enum): LEFT_TO_MID = 1 MID_TO_LEFT = 2 MID_TO_RIGHT = 3 RIGHT_TO_MID = 4 class Stack: def __init__(self): self.s = [] def push(self, data): self.s.append(data) def pop(self): return self.s.pop() def empty(sel...
guzhoudiaoke/data_structure_and_algorithms
coding_interview_guide/1_stack_and_queue/6_solve_tower_of_hanoi_using_stack/solve_tower_of_hanoi_using_stack.py
solve_tower_of_hanoi_using_stack.py
py
4,406
python
en
code
0
github-code
6
[ { "api_name": "enum.Enum", "line_number": 5, "usage_type": "name" }, { "api_name": "sys.maxsize", "line_number": 118, "usage_type": "attribute" }, { "api_name": "sys.maxsize", "line_number": 119, "usage_type": "attribute" }, { "api_name": "sys.maxsize", "line_...
43534668351
import glob import json from collections import defaultdict from tabulate import tabulate import numpy as np import pandas as pd import math from metric.smd_scorer import score_SMD data = defaultdict(lambda: defaultdict(list)) for name in glob.glob('generations/smd-*.json'): parse = name.replace("generation/",""...
andreamad8/FSB
utils/merge_file_smd.py
merge_file_smd.py
py
2,407
python
en
code
119
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 11, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 13, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 24, "usage_type": "call" }, { "api_name": "json.load", "line_num...
20565331206
from prompt_toolkit import prompt from prompt_toolkit.completion import Completion, Completer class NestedCompleter(Completer): def __init__(self, words_dic=None, meta_dict=None, ignore_case=True, match_middle=True): if meta_dict is None: meta_dict = {} if words_dic is None: ...
BlueRhino/TroyCat
troy_platform/common/cli/completer.py
completer.py
py
2,073
python
en
code
0
github-code
6
[ { "api_name": "prompt_toolkit.completion.Completer", "line_number": 5, "usage_type": "name" }, { "api_name": "prompt_toolkit.completion.Completion", "line_number": 41, "usage_type": "call" }, { "api_name": "prompt_toolkit.prompt", "line_number": 59, "usage_type": "call" ...
22463368310
## Splits up the existing images in Kodak_Full_Images into training data and labels ## creates .npy files corresponding to train/test inputs and labels in the './data' folder ## This only needs to be run ONCE after cloning the repository import random import os from PIL import Image #install using 'pip install Pillow'...
OrenKohavi/DeepLearning-FinalProject
create_data.py
create_data.py
py
6,909
python
en
code
0
github-code
6
[ { "api_name": "os.path.isdir", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_number": 28, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number"...
37288437240
import webbrowser import requests from Decorator import prStyle from suggestor import suggestor def openre(u): reg="sastra.edu" u=u+"2" h1="X-Forwarded-Scheme" h2="X-Forwarded-Host" r=requests.get(u,headers={"X-Forwarded-Scheme":"http","X-Forwarded-Host":"sastra.edu"},allow_redirects=Fals...
ramsundar07/Web-Cache-Vulnerability-Scanner
scanner.py
scanner.py
py
1,572
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "Decorator.prStyle", "line_number": 14, "usage_type": "call" }, { "api_name": "Decorator.prStyle", "line_number": 15, "usage_type": "call" }, { "api_name": "Decorator.prStyle", ...
39433359856
from bs4 import BeautifulSoup import requests response = requests.get(url="https://news.ycombinator.com") response.raise_for_status() soup = BeautifulSoup(response.text, "html.parser") item_a_tag = soup.findAll("a", class_="storylink") score_span_tag = soup.findAll("span", class_="score") item_list_text = [i.getText...
svrohith9/100-days-python
Day45/main.py
main.py
py
723
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 4, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 7, "usage_type": "call" } ]
72066998909
from .behavior import Behavior from ..tools import Factory class LinearElastic(Behavior): def __init__(self): Behavior.__init__(self) def installRequires(self): self._coeffs_req = ["elasticity",] self._dual = "sig" self._require = [("eto", "tensor2"),("sig", "tensor2")]...
basileMarchand/pyfetra
pyfetra/behavior/linearElastic.py
linearElastic.py
py
650
python
en
code
0
github-code
6
[ { "api_name": "behavior.Behavior", "line_number": 4, "usage_type": "name" }, { "api_name": "behavior.Behavior.__init__", "line_number": 6, "usage_type": "call" }, { "api_name": "behavior.Behavior", "line_number": 6, "usage_type": "name" }, { "api_name": "tools.Fac...
34198676226
import socket import argparse from hashlib import md5 import math from lab6 import proto prev_seq = "" def create_ranges(genome_len: int, num_ranges: int): sequences = {} offsets = [int] counter = [0] prev_counter = [0] # generating starting sequences def seq_gen(length=4, seq="", trigger: i...
sbogolepov/nsu_network_vol2
lab6/server.py
server.py
py
2,615
python
en
code
0
github-code
6
[ { "api_name": "math.ceil", "line_number": 34, "usage_type": "call" }, { "api_name": "hashlib.md5", "line_number": 41, "usage_type": "call" }, { "api_name": "socket.socket", "line_number": 44, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number...
24410877195
# -*- coding: utf-8 -*- """ Created on Wed Feb 1 19:09:58 2023 @author: megha """ # -*- coding: utf-8 -*- """ Created on Mon Jun 1 19:13:36 2020 @author: bvv """ from flask import Flask, request, jsonify, render_template import pickle import numpy as np app = Flask(__name__) model_pkl = pick...
Meghana0804/Hotel_review
file.py
file.py
py
1,311
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 20, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 21, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 27, "usage_type": "call" }, { "api_name": "flask.request.form.valu...
73693762108
import lightgbm import numpy as np import xgboost from sklearn.ensemble import RandomForestRegressor, AdaBoostRegressor, GradientBoostingRegressor, BaggingRegressor from sklearn.linear_model import LinearRegression, Lasso, Ridge from sklearn.metrics import r2_score, mean_squared_error, mean_absolute_error, mean_absolut...
Spatio-Temporal-Lab/stknnjoin
stknnjoin_knob_tuning/model.py
model.py
py
3,677
python
en
code
1
github-code
6
[ { "api_name": "xgboost.XGBRegressor", "line_number": 31, "usage_type": "call" }, { "api_name": "sklearn.metrics.r2_score", "line_number": 56, "usage_type": "call" }, { "api_name": "sklearn.metrics.mean_squared_error", "line_number": 57, "usage_type": "call" }, { "...
30047027068
import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl import math def plot_2Dhist(config_filename='ionorb_stl2d_boris.config'): print("Reading config file: %s ..." % config_filename) ## defaults: out_fname = "./out.hits.els.txt" dPhi = 0.0 ## radian shift of stl file coord system...
cms21/fusion_compute
analysis/fusion_plots.py
fusion_plots.py
py
7,689
python
en
code
0
github-code
6
[ { "api_name": "numpy.fromstring", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.fromstring", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 50, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "...
21529755500
import logging from azure.graphrbac import GraphRbacManagementClient from azure.graphrbac.models import GraphErrorException from sonrai.platform.azure.client import ManagedIdentityClient def run(ctx): object_id = ctx.resource_id graphrbac_client = ctx.get_client().get(GraphRbacManagementClient) try: ...
sonraisecurity/sonrai-bots
remediation/azure/delete_identity/bot.py
bot.py
py
1,843
python
en
code
5
github-code
6
[ { "api_name": "azure.graphrbac.GraphRbacManagementClient", "line_number": 12, "usage_type": "argument" }, { "api_name": "logging.info", "line_number": 16, "usage_type": "call" }, { "api_name": "azure.graphrbac.models.GraphErrorException", "line_number": 18, "usage_type": ...
3359577537
from pathlib import Path from typing import List import numpy as np import pandas as pd from lightfm import LightFM from lightfm.data import Dataset from evaluator import Evaluator from preprocessor import preprocess_yahoo_coat, preprocess_movielens def lightfm_trainer( train: np.ndarray, loss: str, n_components...
usaito/dr-ranking-metric
src/simulator.py
simulator.py
py
6,549
python
en
code
22
github-code
6
[ { "api_name": "numpy.ndarray", "line_number": 13, "usage_type": "attribute" }, { "api_name": "lightfm.LightFM", "line_number": 16, "usage_type": "call" }, { "api_name": "lightfm.data.Dataset", "line_number": 24, "usage_type": "call" }, { "api_name": "typing.List",...
14097274700
from django.db import models from django.contrib.auth import get_user_model User = get_user_model() # Create your models here. class UProfile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE, primary_key=True) current_point = models.IntegerField(default=0) class PraiseHistory(mode...
takuyakubo/skill_profiler
user_profile/models.py
models.py
py
636
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 4, "usage_type": "call" }, { "api_name": "django.db.models.Model", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 9, "usage_type": "name" }, { "api_...
2424194484
import re from collections import defaultdict def check_name(name: str) -> bool: return re.fullmatch(r'[\da-zA-Z]*', name) is not None def get_file(directory: list, path: str): file_dict = defaultdict(int) for file in directory: file_dict[file] += 1 max_file_name = "" for file in file_di...
mas678/Test_func
main.py
main.py
py
1,507
python
en
code
0
github-code
6
[ { "api_name": "re.fullmatch", "line_number": 6, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 10, "usage_type": "call" } ]
21405819020
# 파이썬의 with 문은 코드를 특별한 컨텍스트 에서 실행함을 나태는 데 사용한다. # contextlib 를 사용하면 객체와 함수를 with 문에 사용할 수 있게 만들기가 쉽다. # 이 모듈은 간단한 함수를 with 문에 사용할 수 있게 해주는 contextmanager 데코레이터를 포함한다. # 이 데코레이터를 이용하는 방법이 __enter__ 와 __exit__ 라는 특별한 메서드를 담은 새 클래스를 정의하는 방법 보다 훨씬 쉽다. import logging from contextlib import contextmanager def my_functio...
byunseob/python-study
파이썬 코딩의 기술/chapter-06-Built-in module /43. Consider contexlib and with statements to create reusable try finally behavior/main.py
main.py
py
2,151
python
ko
code
0
github-code
6
[ { "api_name": "logging.debug", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.error", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.debug", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.getLogger", "li...
16809270764
# /usr/local/bin/python # -*- coding: utf-8 -*- import logging.config from tools.tool_ichikawa import IchikawaModule logging.config.fileConfig("log.conf") ### 予約カゴを空にする def main(): tool = IchikawaModule(sleep=3) result = tool.clear_reserve_basket() if result: # 成功 logging.info("Succeeded in clearing rese...
sarcastic555/library_reservation
clear_reserve_basket.py
clear_reserve_basket.py
py
470
python
en
code
0
github-code
6
[ { "api_name": "logging.config.config.fileConfig", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.config.config", "line_number": 7, "usage_type": "attribute" }, { "api_name": "logging.config", "line_number": 7, "usage_type": "name" }, { "api_name"...
42092032116
from fastapi import APIRouter, HTTPException, Depends from starlette.responses import JSONResponse from starlette.status import HTTP_201_CREATED import crud from Schema import RequestUser, Response from config import sessionLocale from sqlalchemy.orm import session user_router = APIRouter() def get_db(): db =...
tbougares/piece-api
rooterUser.py
rooterUser.py
py
848
python
en
code
0
github-code
6
[ { "api_name": "fastapi.APIRouter", "line_number": 11, "usage_type": "call" }, { "api_name": "config.sessionLocale", "line_number": 16, "usage_type": "call" }, { "api_name": "Schema.RequestUser", "line_number": 24, "usage_type": "name" }, { "api_name": "sqlalchemy....
30518317763
from typing import List # Definition for a binary tree node. class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right class Solution: def generateTrees(self, n: int) -> List[TreeNode]: return self.helper(1,n) ...
Joel-Hwang/leetcode
Python3/_95_UniqueBinarySearchTreesII.py
_95_UniqueBinarySearchTreesII.py
py
761
python
en
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 15, "usage_type": "name" } ]
15992328590
#!/usr/bin/env python # -*- coding: UTF-8 -*- ''' @Project -> File :Spam-Filtering -> bayes @IDE :PyCharm @Author :Yilin Lou @Date :5/5/20 7:27 下午 @Group :Stevens Institute of technology ''' import time import nltk import ssl import time # try: # _create_unverified_https_context = ssl._create_unverified_co...
fengzechen0615/Spam-Filtering
Bayes/bayes.py
bayes.py
py
5,814
python
en
code
0
github-code
6
[ { "api_name": "nltk.corpus.stopwords.words", "line_number": 29, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords", "line_number": 29, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 40, "usage_type": "call" }, { "api_name": "num...
9163769015
''' =============================================================================== National Hurricane Center WeeWX API Module: Data Puller Purpose: This library pip libraries we need to install: sqlalchemy, pytz, requests, bs4, configobj, lxml =====================================================================...
ddjlabs/nhc-data-parser
app/nhc_data_puller.py
nhc_data_puller.py
py
7,669
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 20, "usage_type": "attribute" }, { "api_name": "logging.Formatter", "line_number": 23, "usage_type": "call" }, { "api_name": "logging.StreamH...
34691212543
from functions_indexing import * import time import datetime import multiprocessing # name of the index, change which one is commented if you want to change which one to index INDEX_NAME = 'abstracts' # settings for how it should look like INDEX_SETTINGS = { "mappings": { "properties": { "desc...
sbthepotato/DAT640-Project-22H
indexing/abstracts_index.py
abstracts_index.py
py
1,767
python
en
code
0
github-code
6
[ { "api_name": "time.time", "line_number": 29, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 30, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 30, "usage_type": "attribute" }, { "api_name": "multiprocessin...
16569602517
import logging import networkx as nx import pandas as pd import pquality.PartitionQuality as Pq from pipelines.pipeline_base import PipelineBase logger = logging.getLogger(__name__) class CommunityDetectionMetrics(PipelineBase): def __init__(self, datasources, context_name): files = [ { ...
flaprimo/twitter-network-analysis
pipelines/phase_1/community_detection_metrics.py
community_detection_metrics.py
py
9,021
python
en
code
8
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "pipelines.pipeline_base.PipelineBase", "line_number": 10, "usage_type": "name" }, { "api_name": "pquality.PartitionQuality.internal_edge_density", "line_number": 87, "usage_type": ...
31361570887
import numpy as np from scipy.optimize import minimize def morse_potential(r, r_eq, D, a): """ Get activation energy of a site based on local environment. Based off Morse potential, V(r) = D(1 - exp(-a(r-r_eq))) inputs - r - 4 x 1 np array of distances to nearest neighbors on the lattice r_eq ...
salmanak31/importance_learning
il_pedagogical/potentials.py
potentials.py
py
11,255
python
en
code
0
github-code
6
[ { "api_name": "numpy.exp", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 50, "usage_type": "call" }, { "api_name": "scipy.optimize.minimize", "line_number": 157, "usage_type": "call" }, { "api_name": "scipy.optimize.minimize...
22684615540
import gym import random import collections import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from stateRepresenter import StateRepresenter from torchsummary import summary import time from torch.optim.lr_scheduler import _LRScheduler #Hyperparameters # l...
Hyunwoo-Park-Yonsei/RL_lanefollowing
DDPG.py
DDPG.py
py
13,097
python
en
code
0
github-code
6
[ { "api_name": "collections.deque", "line_number": 29, "usage_type": "call" }, { "api_name": "random.sample", "line_number": 35, "usage_type": "call" }, { "api_name": "torch.tensor", "line_number": 49, "usage_type": "call" }, { "api_name": "torch.float", "line_...
28183107243
import etl.influx_etl as influx_etl from etl import util import pandas as pd import functools import pytz from datetime import datetime from dateutil.relativedelta import relativedelta from dateutil import tz import itertools from sklearn.preprocessing import StandardScaler import requests import os, sys, glob, json im...
MondoPower/Classifying_solar_daily_generation
classification/src/libs/gather_weather_data.py
gather_weather_data.py
py
5,748
python
en
code
0
github-code
6
[ { "api_name": "dateutil.relativedelta.relativedelta", "line_number": 22, "usage_type": "call" }, { "api_name": "dateutil.relativedelta", "line_number": 22, "usage_type": "name" }, { "api_name": "tstools.manipulation.generate_cyclic_time_of_day", "line_number": 26, "usage_...
16774672046
from PySide2.QtWidgets import * from PySide2.QtCore import * from PySide2.QtGui import * import time from simulator import Simulator from interactive_argument import InteractiveArgument from ui.grid_ui import GridUI from ui.side_panel_ui import SidePanelUI from edict import Broadcaster from grid2d import LOCAL_OBSTACLE...
alexraymond/busybarracks
ui/simulator_ui.py
simulator_ui.py
py
16,775
python
en
code
0
github-code
6
[ { "api_name": "simulator.Simulator", "line_number": 28, "usage_type": "call" }, { "api_name": "ui.grid_ui.GridUI", "line_number": 122, "usage_type": "call" }, { "api_name": "ui.side_panel_ui.SidePanelUI", "line_number": 131, "usage_type": "call" }, { "api_name": "...
41705562387
import os import re import subprocess import time # import system module import sys # import some PyQt5 modules from PyQt5.QtWidgets import QApplication, QFileDialog, QWidget from PyQt5.QtGui import QImage, QPixmap from PyQt5.QtCore import QTimer, QThread, QObject, QEventLoop, pyqtSignal, pyqtSlot import qimage2ndarr...
kalleadolfsson/spec-streamer
Spectrometer.py
Spectrometer.py
py
11,238
python
en
code
2
github-code
6
[ { "api_name": "numpy.set_printoptions", "line_number": 19, "usage_type": "call" }, { "api_name": "sys.maxsize", "line_number": 19, "usage_type": "attribute" }, { "api_name": "PyQt5.QtCore.QThread", "line_number": 29, "usage_type": "name" }, { "api_name": "PyQt5.Qt...
10422982223
from __future__ import annotations import uuid from typing import TYPE_CHECKING from unittest.mock import ANY, AsyncMock, MagicMock, call import pytest from randovania.game_connection.builder.connector_builder_option import ConnectorBuilderOption from randovania.game_connection.builder.debug_connector_builder import...
randovania/randovania
test/game_connection/test_game_connection.py
test_game_connection.py
py
6,540
python
en
code
165
github-code
6
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 21, "usage_type": "name" }, { "api_name": "randovania.game_connection.game_connection.GameConnection", "line_number": 27, "usage_type": "call" }, { "api_name": "unittest.mock.MagicMock", "line_number": 27, "usage_type":...
30997821090
""" apps/products/views_books.py """ import os from django import forms from django.contrib.auth.decorators import login_required from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404, render from django.urls import reverse from .forms import BookForm, ChargeForm from .models im...
BrRoman/editor
editor/apps/products/views_books.py
views_books.py
py
4,832
python
en
code
0
github-code
6
[ { "api_name": "models.Product.objects.filter", "line_number": 17, "usage_type": "call" }, { "api_name": "models.Product.objects", "line_number": 17, "usage_type": "attribute" }, { "api_name": "models.Product", "line_number": 17, "usage_type": "name" }, { "api_name...
15726839041
from bs4 import BeautifulSoup import requests import pandas as pd import numpy as np #function for extracting title def get_title(soup): try: title=soup.find("span",attrs={"id":'productTitle'}).text.strip() except AttributeError: title="" return title #fuction for e...
Sajidha777/amazon-web-scraping
amazon-web-scraping.py
amazon-web-scraping.py
py
3,513
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 89, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 91, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 105, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", ...
12050781814
import pygame as pg from os import path from logger import logger class MusicManager(): def __init__(self, game, music_loaded): self.game = game self.time_btw_stp = 0 self.music_loaded = music_loaded self.startup() def set_data(self, data): self.music_loaded = data ...
Barbapapazes/dungeons-dragons
managers/music_manager.py
music_manager.py
py
4,208
python
en
code
1
github-code
6
[ { "api_name": "pygame.mixer.music.set_volume", "line_number": 24, "usage_type": "call" }, { "api_name": "pygame.mixer", "line_number": 24, "usage_type": "attribute" }, { "api_name": "pygame.mixer.music.load", "line_number": 25, "usage_type": "call" }, { "api_name"...
29318583144
# -*- coding: utf-8 -*- """ Created on Sat Apr 18 19:00:19 2015 @author: Dag """ import numpy as np import matplotlib.pyplot as plt import sys sys.path.append("D:/Dropbox/Forårs semester 2015/Social Data analyse og visualisering 02806/reddit project") #sys.path.append("C:/Users/Dag/Dropbox/Forårs semester 2015/Socia...
connors511/dtu-02806-social-data
plotter.py
plotter.py
py
10,970
python
en
code
0
github-code
6
[ { "api_name": "sys.path.append", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 18, "usage_type": "call" }, { "api_name": "datetime.datetime...
73008021629
#Lesson 14 My version, with comments from pyspark import SparkConf, SparkContext #Next few lines, boilerplate code conf = SparkConf().setMaster("local").setAppName("FriendsByAge") #Running locally sc = SparkContext(conf = conf) def parseLine(line): fields = line.split(',') #split the values in the csv based on wh...
CenzOh/Python_Spark
MyCode/friends.py
friends.py
py
1,491
python
en
code
0
github-code
6
[ { "api_name": "pyspark.SparkConf", "line_number": 4, "usage_type": "call" }, { "api_name": "pyspark.SparkContext", "line_number": 5, "usage_type": "call" } ]
18613593705
#! /usr/bin/python from pwn import * #I push this poc just want to recommend pwntools #It's a very great tool for pwn #Althought you can very easy to write pwn poc with pwntools #but don't depend it too much #see pwntool's doc at : https://pwntools.readthedocs.org/en/latest/ #and the github : https://github.com/Gallo...
zh-explorer/ctfgame
week2/pwn_step3_poc.py
pwn_step3_poc.py
py
1,140
python
en
code
0
github-code
6
[ { "api_name": "pwn.send", "line_number": 40, "usage_type": "call" }, { "api_name": "pwn.recv", "line_number": 41, "usage_type": "call" }, { "api_name": "pwn.recv", "line_number": 42, "usage_type": "call" }, { "api_name": "pwn.send", "line_number": 45, "usa...
9345185190
import os import datetime from os.path import exists from datetime import date folder_path = "./logs/" file_path = "" log_file = None def open_log_file(path_to_folder=folder_path, file_mode="a"): global log_file file_path = path_to_folder + "log_" + date.today().strftime("%b_%d_%Y") + ".txt" ...
sean-francis113/pf2edatascraper
lib/log.py
log.py
py
1,378
python
en
code
0
github-code
6
[ { "api_name": "datetime.date.today", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 13, "usage_type": "name" }, { "api_name": "os.path.exists", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.datetime.no...
21215124985
# -*- coding: utf-8 -*- from django import template from django.conf import settings from django.utils import timezone, formats from django.utils.translation import gettext_lazy as _ register = template.Library() @register.filter() def datetime_short(date): """ Format a datetime object as short string for li...
babybuddy/babybuddy
core/templatetags/datetime.py
datetime.py
py
1,450
python
en
code
1,766
github-code
6
[ { "api_name": "django.template.Library", "line_number": 7, "usage_type": "call" }, { "api_name": "django.template", "line_number": 7, "usage_type": "name" }, { "api_name": "django.utils.timezone.localtime", "line_number": 22, "usage_type": "call" }, { "api_name": ...
37229128073
from ImagePrep import PrepareImage from CurveDetector import Curve import cv2 def main(): cap = cv2.VideoCapture('Test Data/curve_road.mp4') i = 0 ImagePreprocessor = PrepareImage((7,7),(0,0),False,50,170,0.6,0.6) CurveMaker = Curve() while(cap.isOpened()): ret, frame = cap.read() if...
TheGupta2012/RAAHI
openCV Lanes/Curved Lanes/Codes/testing.py
testing.py
py
941
python
en
code
3
github-code
6
[ { "api_name": "cv2.VideoCapture", "line_number": 5, "usage_type": "call" }, { "api_name": "ImagePrep.PrepareImage", "line_number": 7, "usage_type": "call" }, { "api_name": "CurveDetector.Curve", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.resize",...
71482548028
from collections import deque def solution(priorities, location): answer = 0 pairs = [[priority, False] for priority in priorities] pairs[location][1] = True pairs = deque(pairs) start = 1 while pairs: current = pairs.popleft() is_top_prior = True for p, is_selected in ...
YoonHan/Algorithm
python/Programmers/프린터/solution.py
solution.py
py
652
python
en
code
1
github-code
6
[ { "api_name": "collections.deque", "line_number": 8, "usage_type": "call" } ]
31032640447
from base import BasePolicyTest from tcutils.wrappers import preposttest_wrapper import test from vn_test import * from quantum_test import * from policy_test import * from vm_test import * from tcutils.topo.sdn_topo_setup import sdnTopoSetupFixture from common.system.system_verification import system_vna_verify_policy...
hkumarmk/aaa
scripts/policy/test_policy_detailed_basic.py
test_policy_detailed_basic.py
py
3,969
python
en
code
0
github-code
6
[ { "api_name": "base.BasePolicyTest", "line_number": 17, "usage_type": "name" }, { "api_name": "sdn_single_vm_multiple_policy_topology.sdn_single_vm_multiple_policy_config", "line_number": 33, "usage_type": "attribute" }, { "api_name": "tcutils.topo.sdn_topo_setup.sdnTopoSetupFixt...
35430841485
from scrapy.spider import BaseSpider from scrapy.selector import HtmlXPathSelector from port.items import PortVisit class LpcSpider(BaseSpider): name = 'lpc.co.nz' allowed_domains = ['lpc.co.nz'] start_urls = [ 'http://www.lpc.co.nz/RP.jasc?Page=/LPCShipsInPortNetApp', ] def parse(self, response): hxs = Htm...
hughbris/portent
port/spiders/lpc.py
lpc.py
py
1,259
python
en
code
1
github-code
6
[ { "api_name": "scrapy.spider.BaseSpider", "line_number": 6, "usage_type": "name" }, { "api_name": "scrapy.selector.HtmlXPathSelector", "line_number": 14, "usage_type": "call" }, { "api_name": "port.items.PortVisit", "line_number": 25, "usage_type": "call" } ]
23710277531
from django.db import models from django.core.validators import FileExtensionValidator from django.contrib.postgres.fields import JSONField from .auth_helper import get_client_token from .graph_helper import MailGraph, get_user, send_invite_mail # Create your models here. class ClientUser(models.Model): email = mode...
boiyelove/alpenels
core/models.py
models.py
py
2,498
python
en
code
0
github-code
6
[ { "api_name": "django.db.models.Model", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 9, "usage_type": "name" }, { "api_name": "django.db.models.EmailField", "line_number": 10, "usage_type": "call" }, { "api_name":...
72966317947
from build import * from matplotlib.pyplot import plot, show def show_graph(clusters, centroids): for color, centroid, points in zip('rgbcymk', centroids, clusters): xs = map(lambda e: e['x'], points) ys = map(lambda e: e['y'], points) plot(xs, ys, color + 'o') plot(centroid['x'], centroid['y'], color + 'x', ...
LG95/Clustering
debug.py
debug.py
py
337
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.show", "line_number": 11, "usage_type": "call" } ]
5053400482
import zmq, sys CARDS = ['1','2','3','4','5','6','7','8','9','B'] def main(): welcome() selectSC() def selectSC(): strIn = valid_input(['0','1','Q'], '0-Server 1-Client Q-Quit:') if strIn == '0': # server print('server') server() elif strIn == '1': # client ...
HollowTurtle047/MA
MA.py
MA.py
py
3,445
python
en
code
0
github-code
6
[ { "api_name": "zmq.Context", "line_number": 24, "usage_type": "call" }, { "api_name": "zmq.REP", "line_number": 25, "usage_type": "attribute" }, { "api_name": "zmq.Context", "line_number": 47, "usage_type": "call" }, { "api_name": "zmq.REQ", "line_number": 48,...
38836497276
import pyodbc import re import random import datetime import docx #for row in cursor: # a += row[2] #print(a) #Капуста, морковь, лук, петрушка, укроп, свекла, мясо(500 грамм), Фасоль (200 грамм) #Cabbage, carrot, onion, parsley, dill, beetroot, meat (500 grams), Beans (200 grams) #Количество каждого ингредие...
HogeRider/study3
try.py
try.py
py
28,633
python
ru
code
0
github-code
6
[ { "api_name": "pyodbc.connect", "line_number": 83, "usage_type": "call" }, { "api_name": "pyodbc.connect", "line_number": 276, "usage_type": "call" }, { "api_name": "pyodbc.connect", "line_number": 288, "usage_type": "call" }, { "api_name": "pyodbc.connect", "...
74197625149
import logging import traceback from datetime import datetime import humanize import pandas as pd from des.models import SkybotByYear from des.models import SkybotByDynclass from des.dao import ( ExposureDao, CcdDao, DesSkybotJobResultDao, SkybotByYearDao, DesSummaryDynclassDao, ) from des.dao im...
linea-it/tno
backend/des/summary/summary_result.py
summary_result.py
py
10,588
python
en
code
1
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 23, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 27, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 27, "usage_type": "name" }, { "api_name": "des.dao.Des...
18272439881
from flask import render_template from flask import Flask from flask import jsonify from model import db def init_db(): """ Initialize the database """ db.create_all() class _DefaultSettings(object): USERNAME = 'world' SECRET_KEY = 'development key' DEBUG = True # create the application app = Fl...
shalizi/collective_stats_logviewer
src/collective_stats_logviewer/views.py
views.py
py
1,179
python
en
code
null
github-code
6
[ { "api_name": "model.db.create_all", "line_number": 8, "usage_type": "call" }, { "api_name": "model.db", "line_number": 8, "usage_type": "name" }, { "api_name": "flask.Flask", "line_number": 17, "usage_type": "call" }, { "api_name": "model.db.create_all", "lin...
32878765855
import numpy as np import matplotlib as plt import control as co # %conifg InlineBackend.figure_format = 'svg' # plots will be in svg format plt.rcParams['figure.figsize'] = [23,10] # you don't need this plt.rcParams['font.size'] = 24 G1 = co.tf([2,5], [1,2,3]) G1 t = np.linspace(0, 10, 100) t1, y1 = co.impulse_res...
edinhooliveira/pyControl
control-test.py
control-test.py
py
434
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.rcParams", "line_number": 6, "usage_type": "attribute" }, { "api_name": "matplotlib.rcParams", "line_number": 7, "usage_type": "attribute" }, { "api_name": "control.tf", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.linsp...
6639053374
import os import hashlib from typing import Any, Optional, TypeVar from collections.abc import Iterator, Iterable, Hashable from collections import defaultdict from operator import itemgetter from pathlib import Path from axtk.typing import PathLike T = TypeVar('T', bound=Hashable) def is_namedtuple(obj) -> bool: ...
marcovzla/axtk
src/axtk/utils.py
utils.py
py
5,725
python
en
code
0
github-code
6
[ { "api_name": "typing.TypeVar", "line_number": 11, "usage_type": "call" }, { "api_name": "collections.abc.Hashable", "line_number": 11, "usage_type": "name" }, { "api_name": "os.PathLike", "line_number": 21, "usage_type": "attribute" }, { "api_name": "collections....
4770079037
import os,sys src_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) if src_dir not in sys.path: sys.path.append(src_dir) from Abstract.DataManagerAbstract import DataManagerAbstract import pandas as pd from sklearn.model_selection import StratifiedKFold class KFoldDataManager(DataManagerAbstract)...
subhajoy/recommender-capstone
src/DataManagers/KFoldDataManager.py
KFoldDataManager.py
py
1,751
python
en
code
1
github-code
6
[ { "api_name": "os.path.dirname", "line_number": 3, "usage_type": "call" }, { "api_name": "os.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number...
15211655660
""" Flux Errors ----------- Figure 3.5. An example of Gaussian flux errors becoming non-Gaussian magnitude errors. The dotted line shows the location of the mean flux; note that this is not coincident with the peak of the magnitude distribution. """ # Author: Jake VanderPlas # License: BSD # The figure produced by t...
astroML/astroML_figures
book_figures/chapter3/fig_flux_errors.py
fig_flux_errors.py
py
2,946
python
en
code
7
github-code
6
[ { "api_name": "astroML.plotting.setup_text_plots", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 34, "usage_type": "attribute" }, { "api_name": ...
20606410311
from django.shortcuts import render, get_object_or_404 from django.views.decorators.csrf import csrf_exempt from .forms import DocumentForm, ForumPostCreationForm from .models import DocumentModel, KeywordModel, ForumPost from django.db import connection, ProgrammingError import os from .ocr import extract_text...
ZunaedSifat/KnowledgeRepository
documents/views.py
views.py
py
7,119
python
en
code
0
github-code
6
[ { "api_name": "django.db.connection.cursor", "line_number": 19, "usage_type": "call" }, { "api_name": "django.db.connection", "line_number": 19, "usage_type": "name" }, { "api_name": "django.db.ProgrammingError", "line_number": 24, "usage_type": "name" }, { "api_n...
39607779343
import logging import os from optparse import make_option from django.core.management.base import BaseCommand from django.utils import timezone from core import title_loader from core import solr_index from core.models import Title from core.management.commands import configure_logging configure_logging('load_title...
open-oni/open-oni
core/management/commands/load_titles.py
load_titles.py
py
3,903
python
en
code
43
github-code
6
[ { "api_name": "core.management.commands.configure_logging", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "django.core.management.base.BaseCommand", "line_number": 17, "usage_type": "...
40184733295
import os import pandas as pd import numpy as np from flask import Flask, jsonify, render_template, request from predictPrice import predictPrice app = Flask(__name__) ################################################# # Global Variables ################################################# filter_by = {"yr" : 0, "cat...
sigmanudude/ResidentialEnergyPrediction
app.py
app.py
py
2,190
python
en
code
1
github-code
6
[ { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 29, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 52, "usage_type": "call" }, { "api_name": "os.path.join", ...
30112329577
import cv2 import numpy as np img = cv2.imread("feather.jfif") cv2.imshow("mostrar la imagen",img) gray_img = cv2.cvtColor(img,cv2.COLOR_RGB2GRAY) cv2.imshow("escala de grises",gray_img) print(gray_img) #print(img) cv2.waitKey(0)
alonsosebastian1/clases-
clase 104/ready_image.py
ready_image.py
py
241
python
en
code
0
github-code
6
[ { "api_name": "cv2.imread", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.COLOR_RGB2GRAY", "line_number...
71345479229
from datetime import timedelta, datetime from flask import Blueprint, current_app, jsonify, request from DAL.SessionDAL.SessionDALImplementation import SessionDALImplementation from SAL.SessionSAL.SessionSALImplementation import SessionSALImplementation from DAL.ItemDAL.ItemDALImplementation import ItemDALImplementat...
dmerc12/143Designs
back-end/API/ItemRoutes/UpdateItemRoute.py
UpdateItemRoute.py
py
1,562
python
en
code
0
github-code
6
[ { "api_name": "flask.Blueprint", "line_number": 12, "usage_type": "call" }, { "api_name": "DAL.ItemDAL.ItemDALImplementation.ItemDALImplementation", "line_number": 14, "usage_type": "call" }, { "api_name": "SAL.ItemSAL.ItemSALImplementation.ItemSALImplementation", "line_numbe...
39993146053
""" ## PanoFormer: Panorama Transformer for Indoor 360 Depth Estimation ## Zhijie Shen, Chunyu Lin, Kang Liao, Lang Nie, Zishuo Zheng, Yao Zhao ## https://arxiv.org/abs/2203.09283 ## The code is reproducted based on uformer:https://github.com/ZhendongWang6/Uformer """ import torch import torch.nn as nn import...
zhijieshen-bjtu/PanoFormer
PanoFormer/network/model.py
model.py
py
29,060
python
en
code
79
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 25, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 25, "usage_type": "name" }, { "api_name": "torch.nn.AdaptiveAvgPool2d", "line_number": 33, "usage_type": "call" }, { "api_name": "torch.nn", ...
73816664509
import os import re from pathlib import Path from leet.logging import log, log_progress from spellchecker import SpellChecker from ..util import flatten spell = SpellChecker() def check_spelling(path, settings): log.info(f"Checking the spelling of '{path}'...") if os.path.isdir(path): all_markdown ...
Tenchi2xh/monospace
monospace/core/spelling.py
spelling.py
py
2,810
python
en
code
3
github-code
6
[ { "api_name": "spellchecker.SpellChecker", "line_number": 10, "usage_type": "call" }, { "api_name": "leet.logging.log.info", "line_number": 14, "usage_type": "call" }, { "api_name": "leet.logging.log", "line_number": 14, "usage_type": "name" }, { "api_name": "os.p...
41555595000
from __future__ import print_function import numpy as np import getpass import os import argparse import time import shutil import sys import time # for loading/saving the images from nipy.core.api import Image from nipy import load_image, save_image # for the registration from nipype.interfaces.ants import Registrat...
jmschabdach/markov-movement-correction
testing-transforms.py
testing-transforms.py
py
4,431
python
en
code
0
github-code
6
[ { "api_name": "nipype.interfaces.ants.ApplyTransforms", "line_number": 47, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 61, "usage_type": "call" }, { "api_name": "os.path", "line_number": 61, "usage_type": "attribute" }, { "api_name": "os...
19365131335
import argparse import numpy as np import os import tabulate import torch import torch.nn.functional as F import data import models import curves import utils def main(args): os.makedirs(args.dir, exist_ok=True) torch.backends.cudnn.benchmark = True loaders, num_classes = data.loaders( dataset ...
jonasjuerss/mode-connectivity
eval_curve_extensive.py
eval_curve_extensive.py
py
10,550
python
en
code
0
github-code
6
[ { "api_name": "os.makedirs", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.backends", "line_number": 17, "usage_type": "attribute" }, { "api_name": "data.loaders", "line_number": 19, "usage_type": "call" }, { "api_name": "curves.CurveNet", "l...
14565910294
from typing import List # Items are sorted, use in place sorting_algorithms, no aux data structure allowed # Input: a list of integers # Output: the new length of the list without duplicates # O(n) def remove_duplicates(nums: List[int]) -> int: # Generally, we use 2 pointers moving in the same direction: one fast...
HemlockBane/ds_and_algo
lists/patterns/two_pointers.py
two_pointers.py
py
845
python
en
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 8, "usage_type": "name" } ]
18920390902
"""Utility helpers to simplify working with yaml-based data.""" # pylint: disable=too-many-lines from __future__ import annotations import functools import logging import os import re from collections.abc import Iterator, Sequence from io import StringIO from pathlib import Path from re import Pattern from typing impo...
ansible/ansible-lint
src/ansiblelint/yaml_utils.py
yaml_utils.py
py
45,423
python
en
code
3,198
github-code
6
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 35, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 45, "usage_type": "call" }, { "api_name": "typing.Any", "line_number": 71, "usage_type": "name" }, { "api_name": "ansiblelint.constan...
72777741947
# Modelling spread of infectious desease using logisic growth model import os import shutil from shutil import copyfile from pathlib import Path import requests import numpy as np import pandas as pd from scipy import stats import seaborn as sns from pandas.plotting import register_matplotlib_converters from datetime ...
evgenyneu/covid19
code/run_model.py
run_model.py
py
13,131
python
en
code
1
github-code
6
[ { "api_name": "tarpan.shared.info_path.InfoPath", "line_number": 43, "usage_type": "name" }, { "api_name": "dataclasses.dataclass", "line_number": 27, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 90, "usage_type": "call" }, { "api_...
31954083803
# https://developers.google.com/people/quickstart/python # authorize w/o browser: # https://stackoverflow.com/questions/46457093/google-drive-api-with-python-from-serverbackend-without-browser-autentication # Step1 # pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib from __futu...
boltunoff/turo
turo_google_calendar/google_cal_extract.py
google_cal_extract.py
py
7,264
python
en
code
2
github-code
6
[ { "api_name": "dateutil.parser.parse", "line_number": 30, "usage_type": "call" }, { "api_name": "dateutil.parser", "line_number": 30, "usage_type": "name" }, { "api_name": "pytz.timezone", "line_number": 31, "usage_type": "call" }, { "api_name": "pytz.timezone", ...
29983290275
import os import torch import torchvision.transforms as tfs import numpy as np from torch.utils.data.dataset import Dataset from torch.utils.data import DataLoader from PIL import Image # Pre-defined ShapeNet id2cat mapping # taken from https://github.com/optas/latent_3d_points/blob/8e8f29f8124ed5fc59439e8551ba7ef7...
voidstrike/FPSG
src/datasets/mv_dataset_v2.py
mv_dataset_v2.py
py
11,480
python
en
code
7
github-code
6
[ { "api_name": "torch.utils.data.dataset.Dataset", "line_number": 55, "usage_type": "name" }, { "api_name": "os.listdir", "line_number": 89, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 95, "usage_type": "call" }, { "api_name": "os.path", ...
17328053511
#Importing libraries import numpy as np import pandas as pd from sklearn.metrics import r2_score, mean_squared_error, mean_absolute_percentage_error, mean_absolute_error import pmdarima as pm import matplotlib.pyplot as plt from matplotlib.legend_handler import HandlerTuple #Disable tensorflow cuDNN warnings import lo...
piyushsinghoffice/LazyForecast
LazyForecast/LazyForecast.py
LazyForecast.py
py
18,117
python
en
code
0
github-code
6
[ { "api_name": "logging.disable", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.WARNING", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 12, "usage_type": "attribute" }, { "api_name": "warnings.filterw...
24525525115
import regex as re import numpy as np class Dataset: ''' Loader for csv datasets ''' def __init__(self, path: str): ''' Parameters ---------- path : str, optional Path to csv file. Returns ------- None. ''' ...
booleangabs/Probability-and-Statistics-From-Scratch
data.py
data.py
py
2,662
python
en
code
0
github-code
6
[ { "api_name": "numpy.argsort", "line_number": 52, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 54, "usage_type": "call" }, { "api_name": "regex.compile", "line_number": 108, "usage_type": "call" }, { "api_name": "regex.VERBOSE", "line_nu...
4931626874
import paddle.trainer_config_helpers as paddle """ LeNet """ is_predict=get_config_arg('is_predict', bool, False) process = 'process' test = 'data/test.list' train = 'data/train.list' if is_predict: process = 'predict_process' test = None train = 'predict.list' paddle.define_py_data_sources2( ...
wondervictor/DeepLearningWithPaddle
LeNet/LeNet.py
LeNet.py
py
2,085
python
en
code
5
github-code
6
[ { "api_name": "paddle.trainer_config_helpers.define_py_data_sources2", "line_number": 19, "usage_type": "call" }, { "api_name": "paddle.trainer_config_helpers", "line_number": 19, "usage_type": "name" }, { "api_name": "paddle.trainer_config_helpers.settings", "line_number": 3...
11859127376
""" Functions to convert data from one format to another """ import itertools import logging from operator import itemgetter from typing import Dict, List import numpy as np import pandas as pd from pandas import DataFrame, to_datetime from freqtrade.constants import DEFAULT_DATAFRAME_COLUMNS, DEFAULT_TRADES_COLUMNS,...
robcaulk/freqai
freqtrade/data/converter.py
converter.py
py
13,545
python
en
code
42
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "freqtrade.constants.DEFAULT_DATAFRAME_COLUMNS", "line_number": 34, "usage_type": "name" }, { "api_name": "pandas.DataFrame", "line_number": 35, "usage_type": "call" }, { "...
41382926589
from typing import TYPE_CHECKING import pandas as pd from hvac import Quantity if TYPE_CHECKING: from .building import Building from .ventilation_zone import VentilationZone class BuildingEntity: def __init__(self): self.ID: str = '' self.building: Building | None = None self.ven...
TomLXXVI/HVAC
hvac/cooling_load_calc/building/building_entity.py
building_entity.py
py
1,515
python
en
code
8
github-code
6
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 5, "usage_type": "name" }, { "api_name": "building.Building", "line_number": 14, "usage_type": "name" }, { "api_name": "ventilation_zone.VentilationZone", "line_number": 15, "usage_type": "name" }, { "api_name":...
29189646172
import datetime from swimmingpool_parameters import SCHOOLTRACKPARAMETER, PERSONPERTRACK class SwimmingPool: """ Class: Swimming Pool Has: name, work_hours, price list and number of tracks It handles booking and payment history. Checks for free seats / lanes and generates a payment. """ d...
Kkwarc/Pool_Customer_Service
PlywalniaPython/swimming_pool.py
swimming_pool.py
py
7,658
python
en
code
0
github-code
6
[ { "api_name": "swimmingpool_parameters.PERSONPERTRACK", "line_number": 17, "usage_type": "name" }, { "api_name": "swimmingpool_parameters.SCHOOLTRACKPARAMETER", "line_number": 18, "usage_type": "name" }, { "api_name": "datetime.date", "line_number": 65, "usage_type": "cal...
70402052347
from django.db import models from django.utils import timezone import pandas as pd import numpy as np from pandas import DataFrame, Series from functools import lru_cache import datetime import time from django_pandas.io import read_frame import lcf.dataframe_helpers as dfh from .auctionyear import AuctionYear from .po...
gamzatti/lcf
lcf/models/scenario.py
scenario.py
py
23,042
python
en
code
0
github-code
6
[ { "api_name": "django.db.models.Model", "line_number": 17, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 17, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 18, "usage_type": "call" }, { "api_name"...
2139180912
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import lightgbm as lgb from sklearn import preprocessing from sklearn.decomposition import PCA from sklearn.model_selection import train_test_split #切分数据 from sklearn.metrics import mean_squared_error #评价指标 f...
yunzhongyue16/machine-learning
b.py
b.py
py
2,254
python
en
code
1
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 17, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 18, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.MinMaxScaler", "line_number": 23, "usage_type": "call" }, { "api_name": "sk...
8549036763
from flask import Flask,render_template,request,make_response,jsonify from flask_cors import CORS app = Flask(__name__) CORS(app) @app.route('/',methods=["POST","GET"]) def test(): if request.method == "POST" : print(request.data) print(request.get_json) #get_json() 을 이용해 딕셔너리로 바꿈 ...
Ywoosang/Python-Flask
Asynchronous/app.py
app.py
py
566
python
en
code
1
github-code
6
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 9, "usage_type": "attribute" }, { "api_name": "flask.request", ...
14764010074
import sys from typing import List def get_max_sub_sequence_length(list_a: List[int], list_b: List[int], list_c: List[int]) -> int: """ get the length max sub-sequence of the three in put lists """ width = len(list_a) + 1 length ...
JoeLove100/data-structures-and-algorithms
algorithms_101/dynamic_programming/max_substring_three.py
max_substring_three.py
py
1,490
python
en
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 6, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 7, "usage_type": "name" }, { "api_name": "sys.stdin.read", "line_number": ...