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
10298086633
# Pollover is a Discord bot that allows users to create polls in discord servers, as well as fetch random trivia questions from an API for users to answer import discord import os import sqlite3 import requests import random import html from discord import option from http_server import start_server # Instantiating a...
MohameddMostafaa/Pollover-Discord-Bot
main.py
main.py
py
10,319
python
en
code
0
github-code
97
[ { "api_name": "discord.Bot", "line_number": 13, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 16, "usage_type": "attribute" }, { "api_name": "sqlite3.connect", "line_number": 19, "usage_type": "call" }, { "api_name": "discord.SelectOption", ...
74245127038
import json from pprint import pprint with open('swjson.json') as data_file: data = json.load(data_file) listapelis=[] for pelicula in data ["results"]: for titulo in pelicula["films"]: if titulo["id"] not in listapelis: listapelis.append(titulo["id"]) for nave in data["results"]: contador=0 for pe...
Alexlp1092/LM1718
P3JSON/SW/sw2.py
sw2.py
py
472
python
pt
code
0
github-code
97
[ { "api_name": "json.load", "line_number": 4, "usage_type": "call" } ]
18838032322
import sys from termcolor import colored if len(sys.argv) < 2: print("Usage: gooz <path>") sys.exit(0) boilerplate = """ from functions import * from keys import * <code> """ try: with open(sys.argv[1], 'r') as f: code = f.read() except FileNotFoundError: print(colored("File not found:", "red...
Advik-B/Goose-Script
src/main.py
main.py
py
1,045
python
en
code
3
github-code
97
[ { "api_name": "sys.argv", "line_number": 4, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 15, "usage_type": "attribute" }, { "api_name": "termcolor.colored", "line_numb...
12985590307
import logging import re import yaml LOG = logging.getLogger(__name__) def error_override_vars(override_vars, spec_filepath): """ Warn user if any given variable name isn't found in the original spec file. """ if override_vars is None: return original_text = open(spec_filepath, "r").rea...
koning/merlin
merlin/spec/override.py
override.py
py
1,704
python
en
code
null
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "yaml.dump", "line_number": 43, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 47, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 48,...
74986915837
from django.shortcuts import render from django.db import connection from collections import namedtuple from django.http import HttpResponseRedirect from django.urls import reverse from .forms import createForm def rud_kategori_apparel(request): cursor = connection.cursor() try: cursor.execute("SET SEA...
kartikadipra/c03-basdat
kategori_apparel/views.py
views.py
py
1,986
python
en
code
0
github-code
97
[ { "api_name": "django.db.connection.cursor", "line_number": 9, "usage_type": "call" }, { "api_name": "django.db.connection", "line_number": 9, "usage_type": "name" }, { "api_name": "django.shortcuts.render", "line_number": 19, "usage_type": "call" }, { "api_name":...
4993428115
""""""""""" NumPy Coding """"""""""" import pandas as pd import matplotlib.pyplot as plt import numpy as np NumP_Array = np.array([[1, 2, 3], [4, 6, 7]]) NP1 = np.array([[1, 3], [4, 5]]) NP2 = np.array([[3, 4], [5, 7]]) MNP = NP1@NP2 MNP3 = np.dot(NP1, NP2) MNP2 = NP1*NP2 MNP4 = np.multiply(NP1, NP2) Sum1 = NP1+NP2 ...
aminzayer/ML-Coding-Practice-Example
NumPy-Pandas-Matplotlib-Coding.py
NumPy-Pandas-Matplotlib-Coding.py
py
5,027
python
en
code
2
github-code
97
[ { "api_name": "numpy.array", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 14...
2646257857
# -*- coding: utf-8; -*- # # (c) 2011-2015 Thomas Bellembois thomas.bellembois@ens-lyon.fr # # This file is part of Chimithèque. # # Chimithèque is free software; you can redistribute it and/or modify # it under the terms of the Cecill as published by the CEA, CNRS and INRIA # either version 2 of the License, or (at yo...
tbellembois/chimitheque
modules/chimitheque_logger.py
chimitheque_logger.py
py
4,360
python
en
code
2
github-code
97
[ { "api_name": "logging.NOTSET", "line_number": 31, "usage_type": "attribute" }, { "api_name": "logging.DEBUG", "line_number": 32, "usage_type": "attribute" }, { "api_name": "logging.INFO", "line_number": 33, "usage_type": "attribute" }, { "api_name": "logging.WARN...
8673054937
from django.shortcuts import render, redirect, get_object_or_404 from .models import Photo from .forms import PhotoForm from django.views.generic import ListView from django.db.models import Q # Create your views here. def all_gallery_view(request, *args, **kwargs): queryset = Photo.gallery.all() context = { ...
benayu/organisation_tool
DjangoApp/gallery/views.py
views.py
py
1,821
python
en
code
0
github-code
97
[ { "api_name": "models.Photo.gallery.all", "line_number": 10, "usage_type": "call" }, { "api_name": "models.Photo.gallery", "line_number": 10, "usage_type": "attribute" }, { "api_name": "models.Photo", "line_number": 10, "usage_type": "name" }, { "api_name": "djang...
71622306239
import numpy as np import h5py from matplotlib import pyplot as plt from scipy.stats import mstats DATA_DIR = "/qscratch/ashriva/Experiments/Data/final_dataset/" arr_dir = "../../results/" def errbar_cal(err): ymin = np.min(err) ymax = np.max(err) ymean = np.mean(err) ystd = np.std(err) # yerror ...
saakethdesai/dimensionality-reduction
analysis/figure4/plot_mse.py
plot_mse.py
py
12,527
python
en
code
0
github-code
97
[ { "api_name": "numpy.min", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.std", "line_number": 14, ...
27988443839
from tkinter import * from tkinter import messagebox import tkinter.filedialog import os import shutil import customtkinter as CTk import json import subprocess downloads_path = '' def set_path(): global downloads_path downloads_path = tkinter.filedialog.askdirectory() def README_function(): message = ...
ziadh/Desky
src/DO/DO.pyw
DO.pyw
pyw
4,922
python
en
code
0
github-code
97
[ { "api_name": "tkinter.filedialog.askdirectory", "line_number": 15, "usage_type": "call" }, { "api_name": "tkinter.filedialog", "line_number": 15, "usage_type": "attribute" }, { "api_name": "tkinter.messagebox.showinfo", "line_number": 19, "usage_type": "call" }, { ...
73110641599
##################################################################################################### # # Will list all of the incomplete run id's that need to finish running, per diagnotic/selection treatment # Script will go through each replicate for a specific selection/diagnostic treatment # # Command Line Inputs:...
jgh9094/ECJ-2023-Suite-Of-Diagnostic-Metrics-For-Characterizing-Selection-Schemes
DataTools/Checker/sweep-run.py
sweep-run.py
py
4,509
python
en
code
3
github-code
97
[ { "api_name": "sys.path.insert", "line_number": 25, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number": 35, "usage_type": "call" }, { "api_name": "pandas.errors", "li...
15619116416
import pandas import json from apyori import apriori # 数据导入和处理 with open('spider/data/user_following_topics.txt', 'r') as f: data = f.readlines() array = [] for user in data: info = json.loads(user) if info['type'] == 'people': array.append({ 'id': ...
koala0qoo/Zhihu_topic_association_rule
topic_association_rule.py
topic_association_rule.py
py
1,272
python
en
code
0
github-code
97
[ { "api_name": "json.loads", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 19, "usage_type": "call" }, { "api_name": "apyori.apriori", "line_number": 27, "usage_type": "call" } ]
73436104318
import os, sys, itertools, pandas import numpy as np from physion.analysis import read_NWB, process_NWB def Normalize(x): if np.std(x)>0: return (x-np.mean(x))/np.std(x) else: return np.zeros(len(x)) def NWB_to_dataframe(nwbfile, visual_stim_label='per-protocol', ...
yzerlaut/physion
src/physion/analysis/dataframe.py
dataframe.py
py
15,887
python
en
code
1
github-code
97
[ { "api_name": "numpy.std", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.std", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 10, ...
72493917759
from datetime import datetime, date # get days between two specified_dates def days_between(d1, d2): d1 = datetime.strptime(d1, '%Y-%m-%d') d2 = datetime.strptime(d2, '%Y-%m-%d') return abs((d2 - d1).days) if __name__ == '__main__': # get date_1 and date_2 date_1 = date(year=2022, month=6, day...
amit-curiosity/python-basics
days-between-dates/days_between_dates.py
days_between_dates.py
py
581
python
en
code
0
github-code
97
[ { "api_name": "datetime.datetime.strptime", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 7, "usage_type": "name" }, { "api_name": "datetime.datetime.strptime", "line_number": 8, "usage_type": "call" }, { "api_name": "...
30735337420
# coding: utf-8 import numpy as np import pickle from PIL import Image import chainer from chainer import cuda from chainer import optimizers from chainer.optimizer import WeightDecay from chainer import serializers import net def main(): # Parameters epoch_max = 200 minibatch_max = 64 lambda_em = 1...
taichi-iki/ddgm
train.py
train.py
py
3,215
python
en
code
1
github-code
97
[ { "api_name": "pickle.Unpickler", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 30, "usage_type": "call" }, { "api_name": "net.DDGMNet", "line_number": 34, "usage_type": "call" }, { "api_name": "chainer.optimizers.Adam", ...
38128312802
#!/usr/bin/env python # coding: utf-8 # In[2]: import requests from ftplib import FTP from datetime import datetime from datetime import timedelta import zipfile import os # In[3]: #a python class to scape data from the texas rrc file transfer protocol class grabtxrrcdata(): def __init__(self, localPat...
fahimnis/grabRigData
grabRigData.py
grabRigData.py
py
2,020
python
en
code
0
github-code
97
[ { "api_name": "datetime.datetime", "line_number": 27, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 30, "usage_type": "call" }, { "api_name": "ftplib.FTP", "line_number": 35, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_...
74745837760
import os from torch.utils.data import Dataset import random from PIL import Image ''' Data storage format: class mixed ../data/train/xxx.jpg ../data/test/xxx.jpg ''' class DogCat(data.Dataset): def __init__(self,root,transform=None,train=True,val=False,test=False): self.test=test self.train=train self.va...
dezhili/PyTorch_Format1
dataset/Custom_Dataset.py
Custom_Dataset.py
py
1,158
python
en
code
0
github-code
97
[ { "api_name": "os.path.join", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 21, "usage_type": "call" }, { "api_name": "random.shuffle", "line_numbe...
31805131504
import numpy as np from bidict import bidict from loguru import logger from lxml import etree from quantized_mesh_encoder import encode from plateaukit.constants import nsmap from plateaukit.utils import parse_posList class VerticesMap: counter: int index_by_vertex: bidict def __init__(self): se...
ozekik/plateaukit
plateaukit/generators/quantized_mesh.py
quantized_mesh.py
py
2,016
python
en
code
1
github-code
97
[ { "api_name": "bidict.bidict", "line_number": 13, "usage_type": "name" }, { "api_name": "bidict.bidict", "line_number": 17, "usage_type": "call" }, { "api_name": "lxml.etree.parse", "line_number": 46, "usage_type": "call" }, { "api_name": "lxml.etree", "line_n...
41486379719
import collections from typing import List import base.solution from lib.ds_collections.treenode import TreeNode class Solution(base.solution.Solution): def all_nodes_distance_k_in_binary_tree(self, root: List[List[int]], target: int, K: int) -> List[int]: root = TreeNode.deserialize(root) if no...
pondycrane/algorithms
python/graph/bfs/all_nodes_distance_k_in_binary_tree.py
all_nodes_distance_k_in_binary_tree.py
py
1,996
python
en
code
0
github-code
97
[ { "api_name": "base.solution.solution", "line_number": 8, "usage_type": "attribute" }, { "api_name": "base.solution", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 9, "usage_type": "name" }, { "api_name": "lib.ds_collections...
41616336309
import json import struct import tensorflow as tf import cv2 import numpy as np import os imageSize = 337 width = imageSize height = imageSize mobileNetArchitectures = [ ['conv2d', 2], ['separableConv', 1], ['separableConv', 2], ['separableConv', 1], ['separableConv', 2], ['separableConv', 1],...
daxiangpanda/RTStylize
converter/tfjs2python.py
tfjs2python.py
py
5,294
python
en
code
0
github-code
97
[ { "api_name": "json.load", "line_number": 30, "usage_type": "call" }, { "api_name": "struct.calcsize", "line_number": 37, "usage_type": "call" }, { "api_name": "struct.unpack", "line_number": 38, "usage_type": "call" }, { "api_name": "tensorflow.cast", "line_n...
23361417923
import django from django.conf import settings from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.urls import path, include urlpatterns = [ path('admin/', admin.site.urls), path('', include('blog.urls')), ] # Images & debug configuration if setting...
benjanem/jeu-videos
mysite/urls.py
urls.py
py
752
python
en
code
0
github-code
97
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 8, "usage_type": "name" }, { "api_name": "dja...
5276359661
from flask import Blueprint, render_template, abort from sqlalchemy import func, distinct from skylines.database import db from skylines.lib.dbutil import get_requested_record from skylines.model import User, Club, Flight, Airport statistics_blueprint = Blueprint('statistics', 'skylines') @statistics_blueprint.rout...
pmnyc/Data_Engineering_Collections
django_flask_samples/skylines-master/skylines/frontend/views/statistics.py
statistics.py
py
3,077
python
en
code
2
github-code
97
[ { "api_name": "flask.Blueprint", "line_number": 8, "usage_type": "call" }, { "api_name": "skylines.database.db.session.query", "line_number": 18, "usage_type": "call" }, { "api_name": "skylines.database.db.session", "line_number": 18, "usage_type": "attribute" }, { ...
22100545022
from typing import Any, Tuple, List import sys matx = sys.modules['matx'] from .. import ASYNC, PadWithBorderOp from ._base import BaseInterfaceClass, BatchBaseClass from ._common import _torch_padding_mode, _assert class Pad(BaseInterfaceClass): def __init__(self, padding: List[int], ...
bytedance/matxscript
python/matx/vision/tv_transforms/pad.py
pad.py
py
2,733
python
en
code
363
github-code
97
[ { "api_name": "sys.modules", "line_number": 3, "usage_type": "attribute" }, { "api_name": "_base.BaseInterfaceClass", "line_number": 9, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.List", ...
14946191390
# -*- coding: utf-8 -*- import json from flask import url_for import pytest from project.models import Translation import base LENGTH_ERROR = base.length_error(2, 100) @pytest.mark.usefixtures('client_class') class TestTranslations: def jwt_header(self, username='test'): jwt = base.valid_jwt_token(clien...
adyouri/lafza
tests/test_translations.py
test_translations.py
py
8,600
python
en
code
0
github-code
97
[ { "api_name": "base.length_error", "line_number": 9, "usage_type": "call" }, { "api_name": "base.valid_jwt_token", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.url_for", "line_number": 20, "usage_type": "call" }, { "api_name": "json.dumps", ...
15557106530
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Oct 3 09:32:22 2021 @author: phoudayer """ import types import pandas as pd import numpy as np import matplotlib.pyplot as plt import scipy.stats as st from scipy.optimize import minimize, curve_fit from scipy.linalg import block_diag #============...
pierrehoudayer/IMAS-8
script.py
script.py
py
14,423
python
en
code
0
github-code
97
[ { "api_name": "matplotlib.rc", "line_number": 22, "usage_type": "call" }, { "api_name": "matplotlib.rc", "line_number": 23, "usage_type": "call" }, { "api_name": "matplotlib.rc", "line_number": 24, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line...
37886124072
from anytree import Node, RenderTree from pickpack import pickpack title = 'Please choose your favorite fruit: ' options = [ { 'name': 'Apples', 'grow_on': 'trees' }, { 'name': 'Oranges', 'grow_on': 'trees' }, { 'name': 'Strawberries', 'grow_on': 'vines' }, { 'name': 'Grapes', 'grow_on': 'vines' }, ] ...
anafvana/pickpack
example/options_map_func.py
options_map_func.py
py
616
python
en
code
11
github-code
97
[ { "api_name": "anytree.Node", "line_number": 16, "usage_type": "call" }, { "api_name": "pickpack.pickpack", "line_number": 18, "usage_type": "call" } ]
74983546238
import tensorflow as tf from tensorflow.keras import layers from tensorflow.keras import models from tensorflow.keras import backend as K import horovod.tensorflow.keras as hvd #import horovod.tensorflow as hvd_tf import numpy as np import argparse import math import time from cifar import load_cifar import custom_ca...
jorditorresBCN/SA-MIRI-2019
tf_keras_horovod_cifar.py
tf_keras_horovod_cifar.py
py
2,236
python
en
code
0
github-code
97
[ { "api_name": "horovod.tensorflow.keras.init", "line_number": 17, "usage_type": "call" }, { "api_name": "horovod.tensorflow.keras", "line_number": 17, "usage_type": "name" }, { "api_name": "argparse.ArgumentParser", "line_number": 19, "usage_type": "call" }, { "ap...
22111175814
""" the key is full binary tree it must be 2^n - 1 1 cannot (1 can) 2 cannot 4 cannot divided into 3 parts 1 root left 2^i - 1 right 2^j - 1 ah no.. 5 can, so not 2^n - 1 2*n - 1??? """ # Definition for a binary tree node. from typing import List, Optional class TreeNode: def __init__(self, val=0, left=Non...
kangxie-colorado/leetcode-and-notes
mock.fullBinaryTree.py
mock.fullBinaryTree.py
py
1,048
python
en
code
0
github-code
97
[ { "api_name": "typing.List", "line_number": 32, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 32, "usage_type": "name" } ]
35887147325
# -*- coding: utf-8 -*- """ Created on Tue Mar 1 18:51:22 2022 @author: suraj """ import streamlit as st from streamlit_cropper import st_cropper import numpy as np import cv2 from PIL import Image, ImageEnhance from urllib.request import urlopen import os import base64 import io from io import Bytes...
ssgzth/SnapEdit
main.py
main.py
py
6,638
python
en
code
0
github-code
97
[ { "api_name": "urllib.request.urlopen", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 26, "usage_type": "call" }, { "api_name": "cv2.imdecode", "line_number": 27, "usage_type": "call" }, { "api_name": "cv2.IMREAD_COLOR", ...
30371797287
from __init__ import * from discord.ext import commands import discord from numpy import nan import datetime as dt import plotly.graph_objects as go import tweepy from wol_bot_static import token, teams, ha, pred_cols, twitter_apikey, twitter_secret_apikey, \ twitter_access_token, twitter_secret_access_token, poll...
jacobhesster/wolves-pred-bot
wolves_bot.py
wolves_bot.py
py
38,321
python
en
code
1
github-code
97
[ { "api_name": "discord.Intents.default", "line_number": 196, "usage_type": "call" }, { "api_name": "discord.Intents", "line_number": 196, "usage_type": "attribute" }, { "api_name": "discord.ext.commands.Bot", "line_number": 198, "usage_type": "call" }, { "api_name...
9421598465
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import sys import re import pandas as pd import numpy as np from torch.utils.data import Dataset, DataLoader import torch codepath = os.path.abspath(sys.path[0]) sys.path.append(codepath+'/../lib') sys.path.append(os.getcwd()) class MovementHybridDataset(Dataset...
LonxunQuantum/PWMLFF
src/pre_data/data_loader_2type_nn_hybrid.py
data_loader_2type_nn_hybrid.py
py
9,371
python
en
code
12
github-code
97
[ { "api_name": "os.path.abspath", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "sys.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "sys.path.append", "lin...
42322159989
# importing the modules that will be needed in the project import pygame import random # initialising the pygame modules pygame.init() # creating and setting the size of the screen that is going to be used screen_width = 1040 screen_height = 680 screen = pygame.display.set_mode((screen_width, screen_height)) # Creat...
JoshieKing/capstoneRepository
my_game.py
my_game.py
py
6,611
python
en
code
0
github-code
97
[ { "api_name": "pygame.init", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pygame.image.l...
10767903160
import itertools from collections import UserDict from operator import itemgetter from typing import Dict, Iterator, List, Set, Tuple, TypeVar, Union, cast from pyproj import Proj, Transformer from shapely.geometry import MultiLineString, MultiPolygon, Polygon from shapely.geometry.base import BaseGeometry from shapel...
xoolive/cartes
cartes/osm/overpass/relations/boundary.py
boundary.py
py
5,186
python
en
code
38
github-code
97
[ { "api_name": "collections.UserDict", "line_number": 18, "usage_type": "name" }, { "api_name": "shapely.geometry.base.BaseGeometry", "line_number": 23, "usage_type": "name" }, { "api_name": "shapely.geometry.MultiLineString", "line_number": 24, "usage_type": "argument" ...
74993256957
import logging import re import requests from .base import ParserBase bot = logging.getLogger("rse.main.parsers.zenodo") class ZenodoParser(ParserBase): name = "zenodo" matchstring = "^10[.][0-9]{4}/zenodo[.][0-9]{7}$" def _set_uid(self, uid): """Given some kind of Zenodo uri, parse it""" ...
rseng/rse
rse/main/parsers/zenodo.py
zenodo.py
py
3,858
python
en
code
13
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "base.ParserBase", "line_number": 11, "usage_type": "name" }, { "api_name": "re.search", "line_number": 17, "usage_type": "call" }, { "api_name": "rse.utils.urls.repository_...
10196036061
from sklearn.metrics import mean_squared_error,accuracy_score,auc,f1_score import torch import numpy as np def rmse(y_true,y_pred): if isinstance(y_true,torch.Tensor): return ((y_pred-ytrue)**2).mean().pow(0.5).item() elif isinstance(y_true,np.ndarray): return mean_squared_error(y_true,y_pred,s...
rishubhkhurana/EVA
S12/metrics.py
metrics.py
py
1,767
python
en
code
0
github-code
97
[ { "api_name": "torch.Tensor", "line_number": 6, "usage_type": "attribute" }, { "api_name": "numpy.ndarray", "line_number": 8, "usage_type": "attribute" }, { "api_name": "sklearn.metrics.mean_squared_error", "line_number": 9, "usage_type": "call" }, { "api_name": "...
22836655413
import csv import requests import random import json import pymysql import time from lxml import etree allResult = [] # 从json文件当中获取当前的数据条数以及总数据 # with open('小说.json','r',encoding='utf-8') as file: # with open('小说test.json','r',encoding='utf-8') as file: # # jsonDic = json.load(file) # count = jsonDic['count'] #...
huojinhui/PycharmProjects
初级python/移动端/小说.py
小说.py
py
3,636
python
en
code
0
github-code
97
[ { "api_name": "pymysql.connect", "line_number": 15, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 27, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 68, "usage_type": "call" }, { "api_name": "csv.DictWriter", "line_num...
31873871767
import itertools list = ['0001','0011','0101','1011','1101','0111'] new_list = [int(binary , 2) for binary in list] new_list.sort() print(new_list) sum= sum(new_list) print(sum) combination = itertools.combinations(new_list,2) last = None for combo in combination: last = combo print...
Pulkit-g03/Synapse_task
Task1.-2.py
Task1.-2.py
py
549
python
en
code
0
github-code
97
[ { "api_name": "itertools.combinations", "line_number": 15, "usage_type": "call" } ]
1525205735
#!/usr/bin/env python3 # script fetches FMI Open data and imports it to DB from tendo import singleton me = singleton.SingleInstance() # will sys.exit(-1) if other instance is running from db_setup import * from cleaner import * import configparser from configurator import * import os.path tiff_dir_base = config.get...
savelov/radar-wms
get_single.py
get_single.py
py
5,612
python
en
code
9
github-code
97
[ { "api_name": "tendo.singleton.SingleInstance", "line_number": 4, "usage_type": "call" }, { "api_name": "tendo.singleton", "line_number": 4, "usage_type": "name" }, { "api_name": "os.path.exists", "line_number": 54, "usage_type": "call" }, { "api_name": "os.path",...
37944246863
# -*- coding:utf8 -*- from __future__ import print_function import os import numpy as np import pandas as pd import codecs from keras.datasets import imdb from config import Config class Data_Loader(object): def __init__(self): print('Loading data...') def load_from_file(self, config, mode='train')...
FrankBlood/TextClassification
imdb/data_loader.py
data_loader.py
py
2,929
python
en
code
1
github-code
97
[ { "api_name": "config.train_path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "config.test_path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 27, "usage_type": "call" }, { "api_name": "os.listdir", ...
15551955186
#import PIL.Image import dlib import numpy as np import cv2 from .faceID_models import faceID_models import itertools import sys import os import re import multiprocessing import shutil face_detector = dlib.get_frontal_face_detector() predictor_68_point_model = faceID_models.pose_predictor_model_location() pose_pred...
guantinglin/faceID_lib
faceID_lib/api.py
api.py
py
13,014
python
en
code
1
github-code
97
[ { "api_name": "dlib.get_frontal_face_detector", "line_number": 13, "usage_type": "call" }, { "api_name": "faceID_models.faceID_models.pose_predictor_model_location", "line_number": 15, "usage_type": "call" }, { "api_name": "faceID_models.faceID_models", "line_number": 15, ...
3165487068
import glob import re import jieba from collections import defaultdict jieba.enable_paddle() jieba.initialize() def convert_to_halfwidth(line): line = line.translate(str.maketrans("".join([chr(i) for i in range(ord('!'), ord('~') + 1)]), "".join([chr(i) for i in range(ord('!'), ord('~') + 1)]))).strip() line ...
sikfeng/language-modelling-for-code-switching
data_generation/scripts/extract_man_ch_news_txt.py
extract_man_ch_news_txt.py
py
5,025
python
en
code
0
github-code
97
[ { "api_name": "jieba.enable_paddle", "line_number": 6, "usage_type": "call" }, { "api_name": "jieba.initialize", "line_number": 7, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 14, "usage_type": "call" }, { "api_name": "glob.glob", "line_nu...
1254911841
from typing import Union, List from simpleperf_utils import AdbHelper def get_logcat_for_aut(aut: str, adb: AdbHelper) -> Union[str, None]: status, pid = adb.run_and_return_output(['shell', 'pidof', aut]) if not status: print("failed to get pid") return None print(pid) status, logcat_...
eblokland/TestOrchestrator
adb_helpers/logcat_utils.py
logcat_utils.py
py
1,129
python
en
code
0
github-code
97
[ { "api_name": "simpleperf_utils.AdbHelper", "line_number": 6, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 6, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 20, "usage_type": "name" }, { "api_name": "typing.Union", ...
34146593638
import tkinter as tk import tkinter.font as tkFont from time import strftime import datetime as dd class App: def __init__(self, root): #setting title root.title("clock") #setting window size width=1000 height=580 screenwidth = root.winfo_screenwidth() screen...
sanjayengineer121/clock-of-office
clock.py
clock.py
py
4,664
python
en
code
0
github-code
97
[ { "api_name": "time.strftime", "line_number": 20, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 24, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 24, "usage_type": "attribute" }, { "api_name": "tkinter.La...
73680746238
#Coded by Sumanjay on 29th Feb 2020 from flask import Flask, request, jsonify from inshorts import getNews from flask_cors import CORS app = Flask(__name__) app.secret_key = "i_am_not_feeling_sleepy_so_i_am_coding_this" CORS(app) @app.route('/') def home(): return 'News API is UP!<br><br>A part of <a href="https:...
cyberboysumanjay/Inshorts-News-API
app.py
app.py
py
758
python
en
code
185
github-code
97
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 16, "usage_type": "attribute" }, { "api_name": "flask.request", ...
10068481596
#!/usr/bin/env python #-*- coding: utf-8 -*- #pylint: disable=C0301,C0103,R0914,R0903 """ WMArchive command line tool """ from __future__ import print_function __author__ = "Valentin Kuznetsov" # system modules import os import sys import pwd if sys.version_info < (2, 6): raise Exception("WMArchive requires pyth...
dmwm/WMArchive
src/python/WMArchive/Tools/wma_client.py
wma_client.py
py
6,915
python
en
code
4
github-code
97
[ { "api_name": "sys.version_info", "line_number": 15, "usage_type": "attribute" }, { "api_name": "sys.version_info", "line_number": 18, "usage_type": "attribute" }, { "api_name": "urllib2.HTTPSHandler", "line_number": 48, "usage_type": "attribute" }, { "api_name": ...
23674049756
from setuptools import setup, find_packages import os # import pkg_resources # installed_pkg = {pkg.key for pkg in pkg_resources.working_set} # # Determine version on branch name # active_branch = os.environ.get('CI_COMMIT_REF_NAME') # if active_branch is None: # if 'git' in installed_pkg: # impor...
alphabayes/databayes
setup.py
setup.py
py
2,498
python
en
code
0
github-code
97
[ { "api_name": "setuptools.setup", "line_number": 32, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 48, "usage_type": "call" } ]
42473281454
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QGraphicsDropShadowEffect, QWidget class EffectTool: @staticmethod def setBlur(widget: QWidget, shadowRadius: int = 12, shadowColor: int = Qt.gray): # 去除默认边框 widget.setWindowFlags(Qt.Frameless...
NWYLZW/right-click-helper
src/rightClickHelper/tool/effectTool.py
effectTool.py
py
891
python
en
code
23
github-code
97
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 8, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.Qt.gray", "line_number": 8, "usage_type": "attribute" }, { "api_name": "PyQt5.QtCore.Qt", "line_number": 8, "usage_type": "name" }, { "api_name": "PyQt5....
32187845923
import numpy as np import matplotlib.pyplot as plt import seaborn as sns from matplotlib.patches import Rectangle ''' 0 -- up 1 -- right 2 -- down 3 -- left ''' def get_motion_direction(x, epsilon): if np.random.uniform(0,1) > epsilon: return x return np.random.randint(0, 4) def is_wall(x, y): if x == 0 or x == ...
ankit-1517/GridWorld-using-MDP-and-Q-Learning
ql.py
ql.py
py
5,381
python
en
code
3
github-code
97
[ { "api_name": "numpy.random.uniform", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 13, "usage_type": "attribute" }, { "api_name": "numpy.random.randint", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.ran...
71700654400
# Author: Steven C. Dang # Main script for importing provided D3M dataset schemas for operation on datasets import logging import os.path as path import os import csv # Workflow component specific imports from ls_utilities.ls_logging import setup_logging from ls_utilities.cmd_parser import get_default_arg_parser fr...
stevencdang/AutoML-DS-Components
datasetimporter/src/main.py
main.py
py
2,483
python
en
code
0
github-code
97
[ { "api_name": "ls_utilities.cmd_parser.get_default_arg_parser", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 31, "usage_type": "call" }, { "api_name": "os.path", "line_number": 31, "usage_type": "name" }, { "api_name": "l...
2191583326
import argparse import numpy as np from maml import MAML from Dynamics import Dynamics import gym from cost_functions import cheetah_cost_fn, ant_cost_fn from my_envs.mujoco import * import tensorflow as tf import utils from loginfo import log import time from controllers import MPCcontroller from utils import confi...
Jerryxiaoyu/local_mpc
MPC_main.py
MPC_main.py
py
7,900
python
en
code
0
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 20, "usage_type": "call" }, { "api_name": "cost_functions.cheetah_cost_fn", "line_number": 68, "usage_type": "name" }, { "api_name": "time.time", "line_number": 87, "usage_type": "call" }, { "api_name": "nump...
29274893341
"""added decision_by_id fields to works Revision ID: 622cb040a90e Revises: 2b164207f899 Create Date: 2023-02-02 11:38:06.597732 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '622cb040a90e' down_revision = '2b164207f899' branch_labels = None depends_on = None ...
bcgov/EPIC.track
epictrack-api/migrations/versions/622cb040a90e_added_decision_by_id_fields_to_works.py
622cb040a90e_added_decision_by_id_fields_to_works.py
py
1,639
python
en
code
4
github-code
97
[ { "api_name": "alembic.op.execute", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "alembic.op.add_column", "line_number": 22, "usage_type": "call" }, { "api_name": "alembic.op", ...
27672051498
import json import boto3 import os import logging def lambda_handler(event, context): connection_id = event["requestContext"]["connectionId"] dynamodb = boto3.resource('dynamodb') table = dynamodb.Table('Connection') ###### $connect if event["requestContext"]["eventType"] == "CONNECT": ...
passingbreeze-bonfire/send-realtime-location-info-service
lambda-Websocket/handler.py
handler.py
py
1,000
python
en
code
1
github-code
97
[ { "api_name": "boto3.resource", "line_number": 8, "usage_type": "call" } ]
2082444568
import requests import json if __name__ == '__main__': url = 'http://www.kfc.com.cn/kfccda/ashx/GetStoreList.ashx?op=keyword' headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36' } place = input('enter a plac...
xishandong/crawlProject
基础篇/request/05-肯德基餐厅位置查询.py
05-肯德基餐厅位置查询.py
py
1,184
python
en
code
305
github-code
97
[ { "api_name": "requests.post", "line_number": 20, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 24, "usage_type": "call" } ]
10164315621
from django.shortcuts import render, redirect from django.views.generic.edit import CreateView, UpdateView, DeleteView from django.views.generic import ListView, DetailView from django.contrib.auth import login from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.decorators import login_requi...
raihanmorshed/dovecollector
dovecollector/main_app/views.py
views.py
py
3,813
python
en
code
0
github-code
97
[ { "api_name": "django.contrib.auth.forms.UserCreationForm", "line_number": 18, "usage_type": "call" }, { "api_name": "django.contrib.auth.login", "line_number": 23, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "line_number": 24, "usage_type": "call" ...
5341965986
import re import json import string from bs4 import BeautifulSoup from selenium import webdriver import csv def get_soup(url): driver = webdriver.Chrome(executable_path=r'C:\Users\Ashish Mishra\Desktop\chromedriver.exe') driver.get(url) html = driver.page_source soup = BeautifulSoup(html...
MindaugasVaitkus2/selenium-webriver-python
indeed jobdescription scrapping.py
indeed jobdescription scrapping.py
py
4,552
python
en
code
0
github-code
97
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 11, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 11, "usage_type": "name" }, { "api_name": "bs4.BeautifulSoup", "line_number": 14, "usage_type": "call" }, { "api_name": "string...
2239451800
#!/usr/bin/env python3 import cheminfo import sys import numpy as np import qml import scipy from qml.kernels import (get_atomic_local_gradient_kernel, get_atomic_local_kernel) from qml.math import svd_solve from qml.representations import generate_fchl_acsf import rmsd from train_test impo...
andersx/qml-ase
train_csv.py
train_csv.py
py
2,428
python
en
code
3
github-code
97
[ { "api_name": "numpy.random.seed", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 18, "usage_type": "attribute" }, { "api_name": "train_test.csvdir_to_reps", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.r...
42476057579
import requests from bs4 import BeautifulSoup import pandas as pd def gameFinder(gameName): gameName = gameName.replace(' ', '_') page = requests.get(f"https://en.wikipedia.org/wiki/{gameName}") soup = BeautifulSoup(page.content, 'html.parser') main = soup.find(id='bodyContent') infos = ...
Hama101/DiscordBot
GameFinder.py
GameFinder.py
py
784
python
en
code
1
github-code
97
[ { "api_name": "requests.get", "line_number": 8, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 9, "usage_type": "call" } ]
22540287304
import numpy as np import matplotlib.pyplot as plt from scipy.optimize import curve_fit from get_KONICA_data import get_KONICA_data import json import os # Sigmoid函数 def sigmoid(x, k, x0): return 1 / (1 + np.exp(-k * (x - x0))) # root_path = r'B:\Datasets\Temporal_Flicker_Meter_log\deltaL_L_2s\2023-12-17-05-06-02'...
caiyancheng/VRR_Real
dL_L/fit_dl_L_curve_flicker_meter_sigmoid.py
fit_dl_L_curve_flicker_meter_sigmoid.py
py
2,772
python
en
code
1
github-code
97
[ { "api_name": "numpy.exp", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 15...
30804491856
# exercise 1.1 # use function 'bisect' to realize # looking for the root of equation by bisect from math import log2, log, e from math import ceil, floor from math import cos, sin import matplotlib.pyplot as plt import numpy as np def bisect(f, a, b, tol): ''' calculate the approximate solution of f(x)=0 ...
RonaldLeoLu/NumericalAnalysis
C11_bisect.py
C11_bisect.py
py
4,547
python
en
code
0
github-code
97
[ { "api_name": "math.ceil", "line_number": 61, "usage_type": "call" }, { "api_name": "math.log2", "line_number": 61, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 84, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplot", "l...
43740360270
import cv2 import os from flask import Flask,request, render_template from datetime import date from pyattendance import attendance, face_detection #### Defining Flask App app = Flask(__name__) today = date.today().strftime("%d-%B-%Y") atd = attendance() face_detector = face_detection() ################## ROUTING...
yash9904/Attendance-System
app.py
app.py
py
5,435
python
en
code
1
github-code
97
[ { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.date.today", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 12, "usage_type": "name" }, { "api_name": "pyattendance.attendance...
16515671928
from flask import Flask, render_template,request, redirect,json; import snscrape.modules.twitter as sntwitter import pandas as pd import snscrape.modules.twitter as sntwitter import pandas as pd from textblob import TextBlob import re import string import sqlite3 import os from os import path import pickle model = pic...
Fardeen8032/ReviewAnalysis
app.py
app.py
py
5,566
python
en
code
0
github-code
97
[ { "api_name": "pickle.load", "line_number": 14, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_numbe...
35996477044
from torch import nn from collections import Counter from random import random from nltk import word_tokenize from torch.autograd import Variable import pandas as pd import re import numpy as np import torch import torch.nn.functional as F import os from sklearn.utils import shuffle import json import random import ar...
Wendy-Xiao/Extsumm_local_global_context
test.py
test.py
py
6,383
python
en
code
67
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 67, "usage_type": "call" }, { "api_name": "os.path", "line_number": 67, "usage_type": "attribute" }, { "api_name": "os.makedirs", ...
35670053571
# Author: Santosh Kumar # Created On: 11-Apr-2019 # Description: This is sample code to create REST api using Flask in python from flask import Flask, jsonify, request app = Flask('friends_network') friends = [ { 'name': 'John Warner', 'friendlist': [ { 'name': 'David Karter', 'sex': ...
hifisantosh/python_rest_api
python_flask_rest_api.py
python_flask_rest_api.py
py
2,157
python
en
code
0
github-code
97
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.request.get_json", "line_number": 33, "usage_type": "call" }, { "api_name": "flask.request", "line_number": 33, "usage_type": "name" }, { "api_name": "flask.jsonify", "...
39063098598
import requests import json def cal(a): v2=a[0] v4=a[1]-1 while True: v3=v2 v6=0 v7=10 while True: v5=v3%10 if v5==0: return v2 v3=v3//10 v6=max(v5,v6) v7=min(v5,v7) if v3<=0: ...
duowen1/geektree
5.100w/solve5.py
solve5.py
py
682
python
en
code
0
github-code
97
[ { "api_name": "requests.get", "line_number": 28, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 29, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 34, "usage_type": "call" } ]
5920208470
#!/usr/bin/env python2 from PIL import Image, ImageDraw, ImageFont WIDTH = 7200 #1080P CONSTANT = 16 def main(): height = CONSTANT words = open("eat_shit.txt") for line in words: height += CONSTANT image = Image.new('RGB', (WIDTH, height), (255,255,255)) draw = ImageDraw.Draw(image) ...
infoforcefeed/Clear-Waste-of-Time
convert.py
convert.py
py
663
python
en
code
3
github-code
97
[ { "api_name": "PIL.Image.new", "line_number": 14, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 14, "usage_type": "name" }, { "api_name": "PIL.ImageDraw.Draw", "line_number": 15, "usage_type": "call" }, { "api_name": "PIL.ImageDraw", "line_...
13947622994
from django.shortcuts import render from dj_rest_auth.views import LoginView from .models import CustomUser from django.shortcuts import get_object_or_404 from random import randint from django.core.mail import send_mail from rest_framework.response import Response from .serializers import TwoFASerializer from rest_fra...
JQeybulla/DRF-two-factor-authentication
users/views.py
views.py
py
2,962
python
en
code
0
github-code
97
[ { "api_name": "dj_rest_auth.views.LoginView", "line_number": 18, "usage_type": "name" }, { "api_name": "django.shortcuts.get_object_or_404", "line_number": 26, "usage_type": "call" }, { "api_name": "models.CustomUser", "line_number": 26, "usage_type": "argument" }, { ...
13288099561
#!/usr/bin/env python # (c) Stefan Countryman, 2017 DESC = """Find all frame files of a given frame type in a given time range on a remote LIGO server and download them to the specified output directory, skipping any files that have already been downloaded.""" PROG_BAR_WIDTH = 40 VERBOSE = True # default to verbose f...
stefco/geco_data
geco_fetch_frame_files.py
geco_fetch_frame_files.py
py
32,096
python
en
code
3
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 46, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 57, "usage_type": "attribute" }, { "api_name": "subprocess.PIPE", "line_number": 169, "usage_type": "name" }, { "api_name": "subprocess.PIP...
39628606538
# BUCKS STATS from nba_api.stats.static import teams from nba_api.stats.endpoints import leaguegamefinder import pandas as pd import time # Get the team ID for the Milwaukee Bucks bucks_id = teams.find_teams_by_full_name('Milwaukee Bucks')[0]['id'] # Define the seasons you want to get data for seasons = ['2018-19', ...
ektoravlonitis/Deep-Learning-for-Milwaukee-Bucks
data_collection.py
data_collection.py
py
6,033
python
en
code
1
github-code
97
[ { "api_name": "nba_api.stats.static.teams.find_teams_by_full_name", "line_number": 9, "usage_type": "call" }, { "api_name": "nba_api.stats.static.teams", "line_number": 9, "usage_type": "name" }, { "api_name": "nba_api.stats.endpoints.leaguegamefinder.LeagueGameFinder", "line...
23253185807
#!/usr/bin/env python # coding: utf-8 # # KDD FINAL PROJECT # # CHRAN SURESH - 10450732 SHREYA VHADADI - 10453495 PRITIHIV DEV - 10453922 # ## Online Shopper's Intention # The main idea is to find the customers intention of whether he/she would buy the particular product given the features. # In[59]: i...
ShreyaVhadadi/Online-Shoppers-Intention
KDD_PROJECT.py
KDD_PROJECT.py
py
7,389
python
en
code
0
github-code
97
[ { "api_name": "warnings.filterwarnings", "line_number": 18, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 38, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.pie", "line_number": 52, "usage_type": "call" }, { "api_name": "matplot...
30412007456
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html import sqlalchemy from sqlalchemy.orm import sessionmaker from restaurant.models import TripAdvisor class RestaurantPipelin...
LinYuMingBejing/TripAdvisorCrawl
restaurant/pipelines.py
pipelines.py
py
1,766
python
en
code
0
github-code
97
[ { "api_name": "sqlalchemy.create_engine", "line_number": 17, "usage_type": "call" }, { "api_name": "sqlalchemy.orm.sessionmaker", "line_number": 18, "usage_type": "call" }, { "api_name": "restaurant.models.TripAdvisor", "line_number": 37, "usage_type": "argument" }, {...
71866031039
from dataclasses import dataclass from datetime import datetime from typing import Optional, List from opentelemetry.proto.common.v1 import common_pb2 from opentelemetry.proto.logs.v1 import logs_pb2 from opentelemetry.proto.trace.v1 import trace_pb2 @dataclass class LogRecord: span_id: str trace_id: str ...
D-Korobkov/AnaLogs
opentelemetry/model.py
model.py
py
2,980
python
en
code
0
github-code
97
[ { "api_name": "datetime.datetime.fromtimestamp", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 21, "usage_type": "name" }, { "api_name": "opentelemetry.proto.logs.v1.logs_pb2.LogRecord", "line_number": 30, "usage_type": "attr...
2246053104
import os from pathlib import Path from datetime import datetime from flask import Flask, render_template import requests import markdown import sqlite3 db_connection = sqlite3.connect("./database.db") db_cursor = db_connection.cursor() db_cursor.execute( """ CREATE TABLE IF NOT EXISTS food ( name TEXT, ...
HackFrostNL/example-simple-portfolio
app.py
app.py
py
2,520
python
en
code
0
github-code
97
[ { "api_name": "sqlite3.connect", "line_number": 10, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 27, "usage_type": "call" }, { "api_name": "os.scandir", "line_number": 32, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", ...
74155278717
from django import forms from .models import Review # class ReviewForm(forms.Form): # creat from from djanjo form # user_name = forms.CharField(label="your name", max_length=100, error_messages={ # "required":"Your name must not be empty", # "max_length":"please enter a shorter name" # }) # ...
heshamzm/Feedback_django
reviews/forms.py
forms.py
py
1,287
python
en
code
0
github-code
97
[ { "api_name": "django.forms.ModelForm", "line_number": 14, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 14, "usage_type": "name" }, { "api_name": "models.Review", "line_number": 16, "usage_type": "name" } ]
31495711567
# -*- coding: utf-8 -*- """ Created on Sun Sep 30 09:47:02 2018 @author: I340968 """ from PIL import Image im=Image.open('test.jpg') rgb_im=im.convert('RGB') r,g,b=rgb_im.getpixel((1,1)) print(r,g,b)
janakiraam/Python_Basic_Advance
set2/Area_image_to_rgb.py
Area_image_to_rgb.py
py
214
python
en
code
0
github-code
97
[ { "api_name": "PIL.Image.open", "line_number": 9, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 9, "usage_type": "name" } ]
74108958397
"""Notifier that sends a message to the specified chat through Telegram""" import logging from notifiers.base_notifier import Notifier import telegram from telegram.error import TelegramError _logger = logging.getLogger(__name__) class TelegramNotifier(Notifier): """Notifier class for Telegram""" def __ini...
MA3STR0/kimsufi-crawler
notifiers/telegram_notifier.py
telegram_notifier.py
py
1,101
python
en
code
193
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "notifiers.base_notifier.Notifier", "line_number": 11, "usage_type": "name" }, { "api_name": "telegram.Bot", "line_number": 17, "usage_type": "call" }, { "api_name": "telegr...
43320230692
from setuptools import setup, find_packages # setup metainfo libinfo_content = open('__init__.py', 'r').readlines() version_line = [l.strip() for l in libinfo_content if l.startswith('__version__')][0] exec(version_line) # produce __version__ setup( name='zerotasq', version=__version__, description='Stre...
chschock/zerotasq
setup.py
setup.py
py
1,005
python
en
code
0
github-code
97
[ { "api_name": "setuptools.setup", "line_number": 8, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 18, "usage_type": "call" } ]
30381274236
# Calls to attach and detach buffers # from mpi4py import MPI # try: # from numpy import empty # except ImportError: # from array import array # def empty(size, dtype): # return array(dtype, [0]*size) # BUFSISE = 10000 + MPI.BSEND_OVERHEAD # buff = empty(BUFSISE, dtype='b') # MPI.Attach_buffer(...
zuoshifan/python-parallel
mpi4py点到点通信之缓冲阻塞通信模式/attach_detach.py
attach_detach.py
py
1,994
python
en
code
1
github-code
97
[ { "api_name": "mpi4py.MPI.COMM_WORLD", "line_number": 62, "usage_type": "attribute" }, { "api_name": "mpi4py.MPI", "line_number": 62, "usage_type": "name" }, { "api_name": "numpy.empty", "line_number": 76, "usage_type": "call" }, { "api_name": "numpy.float64", ...
73429176638
import itertools import sys import math from sweeppy import Sweep class LIDAR(): MAX_SAFE_DISTANCE = 300.0 QUADRANT_SIZE = 45.0 def __init__(self): self.lidar_sensor = "/dev/serial/by-id/usb-FTDI_FT230X_Basic_UART_DO00867Q-if00-port0" self.sweep = None self.speed = 0 self.rate = 0 def connec...
MissouriMRR/DroneKit
Flight/Scanse.py
Scanse.py
py
1,359
python
en
code
4
github-code
97
[ { "api_name": "itertools.islice", "line_number": 33, "usage_type": "call" }, { "api_name": "math.radians", "line_number": 37, "usage_type": "call" } ]
1663108583
import math import requests,json,re,time from lxml import etree headers = { 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36', 'cookie':'what ever' } proxys = [] def dl(): ''' 正在测试:是否可以用代理IP进行请求 想达到稳定的目的。 :return...
yuanhai11/spider
Other/spider_all/企查查/spider_qcc.py
spider_qcc.py
py
2,260
python
en
code
4
github-code
97
[ { "api_name": "requests.get", "line_number": 18, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 19, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 20, "usage_type": "call" }, { "api_name": "requests.request", "line_number": ...
29491446372
#!/usr/bin/env python3 import argparse import json import sys def dump_json(obj, out, pretty): if pretty: json.dump(obj, out, indent=2, sort_keys=True) else: json.dump(obj, out, separators=(",", ":"), sort_keys=True) return def main(): parser = argparse.ArgumentParser(description="App...
Cocos-BCX/cocos-mainnet
programs/genesis_util/apply_patch.py
apply_patch.py
py
1,854
python
en
code
1,304
github-code
97
[ { "api_name": "json.dump", "line_number": 9, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 11, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 15, "usage_type": "call" }, { "api_name": "json.load", "line_numb...
39432935854
from typing import Union, Any, TypeVar, List from enum import Enum from api_krita import Krita from api_krita.enums import Tool, BlendingMode, TransformMode T = TypeVar('T', bound=Enum) class Config(Enum): """ Configuration fields available in the plugin. Each field remembers its default value: - `...
V-YOP/yuuki-krita-config
pykrita/yuuki_helper/composer_utils/config.py
config.py
py
5,364
python
en
code
0
github-code
97
[ { "api_name": "typing.TypeVar", "line_number": 7, "usage_type": "call" }, { "api_name": "enum.Enum", "line_number": 7, "usage_type": "name" }, { "api_name": "enum.Enum", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 72...
22984191110
import os import time import paho.mqtt.client as mqtt import cv2 import pytesseract import re import ffmpeg rtsp_url = "rtsp://arkpi.local:8554/unicast" tmp_img_file = './currentimg.jpg' broker_ip = 'arkpi.local' topic = 'ocrrequest' publish_topic = 'plantdetect' mqtt_port = 1883 is_ocr_enabled = False def on_conn...
JM2308/CatchPot
tesseract-rtsp/app.py
app.py
py
3,718
python
en
code
0
github-code
97
[ { "api_name": "time.time", "line_number": 53, "usage_type": "call" }, { "api_name": "time.time", "line_number": 54, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 56, "usage_type": "call" }, { "api_name": "os.path", "line_number": 56, ...
38370606520
from typing import Callable import tensorflow as tf import numpy as np def hard_swish(x: tf.Tensor): with tf.name_scope('hard_swish'): return x * tf.nn.relu6(x + np.float32(3)) * np.float32(1. / 6.) class FuncAsLayer: """ This wrapper is a common denominator for function activations and layer activati...
michalfaber/tf_netbuilder
tf_netbuilder/activations.py
activations.py
py
749
python
en
code
9
github-code
97
[ { "api_name": "tensorflow.Tensor", "line_number": 6, "usage_type": "attribute" }, { "api_name": "tensorflow.name_scope", "line_number": 7, "usage_type": "call" }, { "api_name": "tensorflow.nn.relu6", "line_number": 8, "usage_type": "call" }, { "api_name": "tensorf...
27266227340
from elasticsearch import Elasticsearch, VERSION body={"doc": { 'title': 'Sabrina', }} #Primeiro passo Conectar a Instância do Elastic elastic_client = Elasticsearch(hosts=['192.168.150.128:9200']) #Criar o indice filmes # filmes = elastic_client.indices.create("movies")...
clark94/Elastic
insertUpdateData.py
insertUpdateData.py
py
980
python
en
code
0
github-code
97
[ { "api_name": "elasticsearch.Elasticsearch", "line_number": 10, "usage_type": "call" } ]
10422870313
# # @lc app=leetcode.cn id=1631 lang=python3 # # [1631] Path With Minimum Effort # # @lc code=start from typing import List from heapq import heappush, heappop class NodeCost: def __init__(self, node: int, cost: int) -> None: self.node = node self.cost = cost def __lt__(self, other: 'NodeCos...
sugarmouse/leetcode-backup
src/1631.path-with-minimum-effort.py
1631.path-with-minimum-effort.py
py
3,989
python
en
code
0
github-code
97
[ { "api_name": "typing.List", "line_number": 22, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 27, "usage_type": "name" }, { "api_name": "heapq.heappush", "line_number": 31, "usage_type": "call" }, { "api_name": "heapq.heappop", "line_numb...
14183261697
import cv2 import numpy as np LOWER_RED = np.array([150,50,50]) # np.array([120,200,0]) UPPER_RED = np.array([180, 255, 255]) LOWER_BLACK = np.array([0, 0, 0]) UPPER_BLACK = np.array([180, 220, 30]) LOWER_WHITE = np.array([0, 0, 200]) UPPER_WHITE = np.array([180, 255, 255]) def nothing(): pass #cv2.name...
codedump00/vision
helpers/color.py
color.py
py
3,343
python
en
code
1
github-code
97
[ { "api_name": "numpy.array", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 8, ...
1856898870
import openai openai.api_type = "azure" openai.api_key = "d79f238475304db4b7247d70f88930df" openai.api_base = "https://yb-japaneast.openai.azure.com/" openai.api_version = "2023-05-15" response = openai.ChatCompletion.create( engine="gpt-35-turbo-16k", messages=[ {"role": "system", "content": "나는 관광가이드 처럼...
YabetChoi/openai
2. aoi_chatgpt.py
2. aoi_chatgpt.py
py
850
python
ko
code
0
github-code
97
[ { "api_name": "openai.api_type", "line_number": 3, "usage_type": "attribute" }, { "api_name": "openai.api_key", "line_number": 4, "usage_type": "attribute" }, { "api_name": "openai.api_base", "line_number": 5, "usage_type": "attribute" }, { "api_name": "openai.api...
70697073279
import pygame class Countdown: def __init__(self,cooldown): ''' this make a clock to check cooldown of status parameter cooldown: time to end status ''' self.__start = pygame.time.get_ticks() self.__cooldown = cooldown self.__stop = False @property de...
kitoshitachi/Magic-Bullet
code/clock.py
clock.py
py
883
python
en
code
1
github-code
97
[ { "api_name": "pygame.time.get_ticks", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.time", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pygame.time.get_ticks", "line_number": 16, "usage_type": "call" }, { "api_name": "pygame.tim...
23129381165
from find_next_node import TreeNode, Solution from typing import Optional def to_binary_tree(items: list[int]) -> Optional[TreeNode]: """Create binary tree from list of values in bfs order. :param list[int] items: list of values :return Optional[TreeNode]: returned binary tree """ n = len(items) ...
greatqiaotong/coding-algorithm
08_next_node_in_binary_tree/tests/test_find_next_node.py
test_find_next_node.py
py
2,194
python
en
code
0
github-code
97
[ { "api_name": "find_next_node.TreeNode", "line_number": 20, "usage_type": "call" }, { "api_name": "find_next_node.TreeNode", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 5, "usage_type": "name" }, { "api_name": "find_n...
32433332666
from django.urls import re_path, include, path from driver_app.views import RegistrationAPIView from driver_app.views import LoginAPIView from driver_app.views import DriverViewSet app_name = 'driver_app' urlpatterns = [ re_path(r'^sign_up/?$', RegistrationAPIView.as_view(), name='driver_sign_up'), re_path(r...
ekandreeva/bound
driver_app/urls.py
urls.py
py
1,116
python
en
code
0
github-code
97
[ { "api_name": "django.urls.re_path", "line_number": 10, "usage_type": "call" }, { "api_name": "driver_app.views.RegistrationAPIView.as_view", "line_number": 10, "usage_type": "call" }, { "api_name": "driver_app.views.RegistrationAPIView", "line_number": 10, "usage_type": ...
24805942580
# 6603 로또 """ 단순 정렬된 조합을 구하는 문제, S의 원소는 원래부터 오름차순으로 주어지므로 따로 정렬할 필요도 없다. 종료조건에 input()[0] == 0으로 비교해야지, 그냥 input() == '0'해도 항상 False가 나오기 때문에 종료안됨. """ import sys from itertools import combinations input = sys.stdin.readline while True: array = list(map(str, input().split())) if len(array) == 1: ...
jang-namu/pyAlgorithm
solved/7주차-백트래킹/bj6603.py
bj6603.py
py
578
python
ko
code
0
github-code
97
[ { "api_name": "sys.stdin", "line_number": 8, "usage_type": "attribute" }, { "api_name": "itertools.combinations", "line_number": 15, "usage_type": "call" } ]
24066251759
from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import numpy as np from sklearn import linear_model import psycopg2 from datetime import datetime import random sales_ranges=[ {'min': 0, 'max': 499, 'symbol': 'A'}, {'min': 500, 'max': 999, 'symbol': 'B'}, {'min': 1000, 'max': 2499, '...
acuteIQ/missing_data_prediction
regression/company_regression_per_sci_code.py
company_regression_per_sci_code.py
py
5,681
python
en
code
0
github-code
97
[ { "api_name": "psycopg2.connect", "line_number": 33, "usage_type": "call" }, { "api_name": "random.shuffle", "line_number": 108, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 110, "usage_type": "call" }, { "api_name": "sklearn.linear_model.Li...
1583597598
import pandas as pd from sklearn.model_selection import train_test_split from sklearn.linear_model import LinearRegression # Load the Excel file excel_file_path = "Data.xlsx" # Load Yard Locations Data yard_locations_data = pd.read_excel(excel_file_path, sheet_name="Yard Locations") # Load Past In and Out ...
JeetSolanki23/BitTech_Phase3_Submission_H23
main.py
main.py
py
2,085
python
en
code
0
github-code
97
[ { "api_name": "pandas.read_excel", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.read_excel", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.read_excel", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.merge", ...
5594158953
# -*- coding: utf-8 -*- from setuptools import setup, find_packages with open('README.md') as f: readme = f.read() with open('LICENSE') as f: license = f.read() setup( name='ot_service_wrapper', version='0.1', description='Biotaphy package for wrapping Open Tree services', long_description=re...
biotaphy/ot_service_wrapper
setup.py
setup.py
py
573
python
en
code
0
github-code
97
[ { "api_name": "setuptools.setup", "line_number": 10, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 19, "usage_type": "call" } ]
72207015358
from typing import Any, Sequence import openai from azure.search.documents import SearchClient from azure.search.documents.models import QueryType from approaches.approach import Approach from text import nonewlines from core.messagebuilder import MessageBuilder from core.modelhelper import get_token_limit class Cha...
Xiang-CH/innochat_template
app/backend/approaches/chatreadretrieveread.py
chatreadretrieveread.py
py
8,226
python
en
code
2
github-code
97
[ { "api_name": "approaches.approach.Approach", "line_number": 12, "usage_type": "name" }, { "api_name": "azure.search.documents.SearchClient", "line_number": 35, "usage_type": "name" }, { "api_name": "core.modelhelper.get_token_limit", "line_number": 42, "usage_type": "cal...
72558312318
import re import nltk import string import numpy as np # 导入数据集预处理、特征工程和模型训练所需的库 from sklearn import model_selection, metrics import pandas from keras.preprocessing import text, sequence from keras import layers, models, optimizers from keras.utils import to_categorical np.set_printoptions(threshold=np.inf) MAX_SEQUEN...
Vance0124/Web-Information-Processing
Lab2/exp2/src/Entity.py
Entity.py
py
13,987
python
en
code
0
github-code
97
[ { "api_name": "numpy.set_printoptions", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.inf", "line_number": 12, "usage_type": "attribute" }, { "api_name": "string.punctuation", "line_number": 47, "usage_type": "attribute" }, { "api_name": "re.find...
6609531695
import json from tqdm import tqdm import sys import shutil import scipy import pickle import open3d as o3d import numpy as np from multiprocessing import Pool import cv2 as cv import imageio import os os.environ['OPENBLAS_NUM_THREADS'] = '1' DEPTH_SCALE_FACTOR = 5000 # Point cloud from depth (by Konstantin) def po...
MobileRoboticsSkoltech/SmartPortraits-toolkit
convert_to_TUM/utils/convert_to_tum.py
convert_to_tum.py
py
7,469
python
en
code
5
github-code
97
[ { "api_name": "os.environ", "line_number": 14, "usage_type": "attribute" }, { "api_name": "cv2.getOptimalNewCameraMatrix", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.linalg.inv", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy....
70094040960
from pathlib import Path import sys path_root = Path(__file__).parents[2] sys.path.append(str(path_root)) from requirements import * from Metrics.Regression_metrics import * class RESET(): def __init__(self): pass def test(self, fitted_model, power=3): model, X, y, y_pred_restricted, featu...
kvbiii/ML_Algorithms_from_scratch
Linear_Regression/Diagnostic_tests/RESET.py
RESET.py
py
2,697
python
en
code
1
github-code
97
[ { "api_name": "pathlib.Path", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path.append", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 4, "usage_type": "attribute" } ]
13432291629
import argparse from abc import ABC from pathlib import Path import numpy as np import epoch_counter from main import add_arguments from qlearning.network import TeacherAgent from qlearning.teacher import TeacherEnv from trainer import Trainer class EpochCounter(epoch_counter.EpochCounter): infos_name = "infos"...
ethanabrooks/teacher-RL
qlearning_main.py
qlearning_main.py
py
2,682
python
en
code
0
github-code
97
[ { "api_name": "epoch_counter.EpochCounter", "line_number": 14, "usage_type": "attribute" }, { "api_name": "trainer.Trainer", "line_number": 43, "usage_type": "name" }, { "api_name": "abc.ABC", "line_number": 43, "usage_type": "name" }, { "api_name": "pathlib.Path"...
25717540504
import argparse, sys import numpy as np from PIL import Image from tqdm import tqdm import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F from torch.autograd import Variable from transform import random_transform_generator from dataset import SEMDataset from modules import * ...
bmtuan/Att-Unet
main.py
main.py
py
6,961
python
en
code
0
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 22, "usage_type": "call" }, { "api_name": "transform.random_transform_generator", "line_number": 48, "usage_type": "call" }, { "api_name": "dataset.SEMDataset", "line_number": 64, "usage_type": "call" }, { "a...