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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5260979778 | import requests
import json
from server import *
MICROSOFT_KEY = '6921d35270394cbc83c543cb8e4cdd08'
MICROSOFT_URL = 'https://westeurope.api.cognitive.microsoft.com/face/v1.0/detect'
headers = {'Ocp-Apim-Subscription-Key': MICROSOFT_KEY, "Content-Type": "application/octet-stream" }
def get_image_emotion(image_path... | elena20ruiz/stewie | server/emotion/emotion_api.py | emotion_api.py | py | 684 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.post",
"line_number": 15,
"usage_type": "call"
}
] |
36797154424 | """Utilities related to the dataset loader"""
import torch
from src.utils import funcutils
@funcutils.debug(apply=False, sign=True, ret=True, sign_beautify=True, ret_beautify=True)
def features_dataset_results_list_to_batch(features_results):
"""
Merges features dataset list of results into one batch
Arg... | KhaledElTahan/Real-World-Anomaly-Detection | src/datasets/loader_helper.py | loader_helper.py | py | 1,421 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.stack",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "torch.stack",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "torch.stack",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "src.utils.funcutils.debug",
"... |
24994827851 | p# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2008 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved.
# Jordi Esteve <jesteve@zikzakmedia.com>
# $Id$
#
# ... | factorlibre/openerp-extra-6.1 | esale_osc/esale_oscom.py | esale_oscom.py | py | 47,860 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "osv.osv.osv",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "osv.osv",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "osv.fields.char",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "osv.fields",
"line_numbe... |
15624204826 | from django.db import models
class Predictions(models.Model):
apartment = models.ForeignKey(
to="Apartment", null=True, on_delete=models.SET_NULL
)
predicted_price = models.DecimalField(max_digits=40, decimal_places=2, null=False)
accurate_price = models.BooleanField(null=True)
class Meta... | sprifti/apartments-price-prediction | apartments/models/predictions.py | predictions.py | py | 355 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.db.models.Model",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "django.db.models.ForeignKey",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": ... |
18525399365 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import Sequential, Linear, ReLU
from torch_geometric.nn import GATConv
from torch_geometric.nn import global_max_pool as gmp
from drp.models.registry import COMPONENTS,BACKBONES
@COMPONENTS.register_module()
class DrugGATEncoder(torch.nn... | yivan-WYYGDSG/AGMI | drp/models/components/encoders/drug_gat_encoder.py | drug_gat_encoder.py | py | 1,281 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "torch.nn",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch_geometric.nn.GATConv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch_geometric.nn.GATConv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "t... |
4397944430 | from gi.repository import Gtk, Gdk
from time import sleep
from pkg_resources import resource_filename
from ..core.kartei import vokabelKartei
from ..core.config import KASTEN_ANZ, FILTER_ON
from ..actions.abfrager import vok_abfrager
from ..actions.vok import vok_import, vok_export
from ..utils import sort_cstm
from ... | tuxor1337/voktrainer | vok/gui/main.py | main.py | py | 7,625 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "gi.repository.Gtk.Builder",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "gi.repository.Gtk",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "pkg_resources.resource_filename",
"line_number": 21,
"usage_type": "call"
},
{
"api_n... |
20565320446 | import os
from art import text2art
from prompt_toolkit import prompt, print_formatted_text
from prompt_toolkit.history import FileHistory
from troy_platform.common.cli.Style import style
from troy_platform.common.cli.completer import NestedCompleter
from troy_platform.info_gathering.namp import TPNMap
from troy_platf... | BlueRhino/TroyCat | troy_platform/__main__.py | __main__.py | py | 1,760 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "troy_platform.tools.socket_client.SocketClient",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "troy_platform.info_gathering.namp.TPNMap",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "prompt_toolkit.print_formatted_text",
"line_number": ... |
2418819974 | import os
import pickle
import random
import requests
import pathlib
import torch
import torch.utils.data
import torchvision
import numpy as np
from math import pi
from tqdm import tqdm
from PIL import Image
from typing import List, Optional
from itertools import islice, cycle
import supervised.utils.datadir
from supe... | doggydigit/Biasadaptation-jureca | supervised/data/datasets.py | datasets.py | py | 28,638 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "random.seed",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "torch.manual_seed",
... |
4881861987 | """Multiplex network class.
"""
import networkx as nx
class Multinet(nx.Graph):
"""
Undirected Multiplex network class.
"""
def __init__(self, container_id='multiplex'):
"""Initialize a Multinet with empty layer list.
"""
nx.Graph.__init__(self)
self._cid = containe... | wuhaochen/multinet | multinet/classes.py | classes.py | py | 9,472 | python | en | code | 12 | github-code | 6 | [
{
"api_name": "networkx.Graph",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "networkx.Graph.__init__",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "networkx.Graph",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "networ... |
11242751539 | from django import forms
from pybo.models import Question, Answer, Comment
'''
1. Django form document
https://docs.djangoproject.com/en/3.0/topics/forms/
'''
class QuestionForm(forms.ModelForm):
'''
Question 모델과 연결된 Form
'''
class Meta: # innerclass, 반드시 필요
model = Question
field... | tunastorm/mysite | pybo/forms.py | forms.py | py | 1,090 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "pybo.models.Question",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "django.... |
27055900399 | import json
from http import HTTPStatus
from backend.models import TechStack
from backend.serializers.techstack_serializer import TechStackSchema
def test_get_tech_stack_when_logged_in(auth_client, add_tech_stack):
"""Test get list of tech stacks for logged in user."""
rv = auth_client.get("/api/techstacks/"... | CodeForPoznan/codeforpoznan.pl_v3 | backend/tests/test_tech_stack_list.py | test_tech_stack_list.py | py | 2,776 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "http.HTTPStatus.OK",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "http.HTTPStatus",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "http.HTTPStatus.OK",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "http.... |
16178495348 | from gui.widgets.blamecodescrollview import BlameCodeScrollView
from gui.widgets.diffcodescrollview import DiffCodeScrollView
from gui.widgets.commitcontextview import CommitContextView
from gui.widgets.initcommitcontextview import InitCommitContextView
from gui.widgets.buttontabpanel import ButtonTabPanel
from gui.wid... | WiseAmateur/VisualBlame | gui/root.py | root.py | py | 2,450 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "kivy.require",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "kivy.app.App",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "kivy.lang.Builder.load_file",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "kivy.lang.Build... |
70096845949 | import collections
t = int(input())
def man_distance(x, y, nx, ny):
return abs(x - nx) + abs(y - ny)
def bfs(home_x, home_y):
queue = collections.deque([(home_x, home_y, 20)])
visited = collections.defaultdict(int)
visited[(home_x, home_y, 20)] = 1
while queue:
print(queue)
x, y... | YooGunWook/coding_test | 백준/백준_9205번.py | 백준_9205번.py | py | 1,041 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 12,
"usage_type": "call"
}
] |
72120205627 | from collections import Counter
import sys
import math
n = int(input())
s1 = input()
def steadyGene(s1):
s = Counter(s1)
result=math.inf
out = 0
for mnum in range(n):
s[s1[mnum]] -= 1
while all(e <= n/4 for e in s.values()) and out <= mnum:
result = min(resu... | BAGPALLAB7/HackerRank-Solutions-Python3 | HackerRank - Problem Solving/bearAndSteady_hackerrank.py | bearAndSteady_hackerrank.py | py | 436 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "collections.Counter",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "math.inf",
"line_number": 11,
"usage_type": "attribute"
}
] |
27213278845 | import sys
from collections import deque
N = int(sys.stdin.readline().rstrip())
map = [list(map(int, list(sys.stdin.readline().rstrip()))) for _ in range(N)]
visited = [[False] * N for _ in range(N)]
dx = [-1, 1, 0, 0]
dy = [0, 0, -1, 1]
def bfs(x, y):
q = deque()
q.append((x, y))
visited[x][y] = True
... | hammii/Algorithm | BAEKJOON_python/2667_단지번호붙이기.py | 2667_단지번호붙이기.py | py | 881 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "sys.stdin.readline",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin.readline",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"li... |
21748756362 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
collect_astro collects astrological data from wunderground.com.
"""
import pandas as pd
import requests
import numpy as np
from time import sleep
def main():
# Range of dates to consider.
date_rng = pd.date_range(start='1/1/2017', end='12/31/2018', freq='D')... | markhannel/InAPinch | src/data_collection/collect_astro.py | collect_astro.py | py | 1,473 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.date_range",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.date_range",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "requests.get",
... |
10742844627 | # 1 导入库
import cv2
import matplotlib.pyplot as plt
import numpy as np
# 2 方法:显示图片
def show_image(image, title, pos):
img_RGB = image[:, :, ::-1] # BGR to RGB
plt.title(title)
plt.subplot(2, 2, pos)
plt.imshow(img_RGB)
# 3 方法:显示灰度直方图
def show_histogram(hist, title, pos, color):
plt.subplot(2, 2, p... | justinge/opencv_tutorial | chapter4/gray_histogram_mask.py | gray_histogram_mask.py | py | 1,596 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.title",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.subplot",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "m... |
31618850629 | import random
import numpy as np
from scipy.spatial.distance import cdist
from TFIDF import get_tfidf
def get_distance_matrix(x: np.ndarray, y: np.ndarray) -> np.ndarray:
return cdist(x, y, 'euclidean') ** 2
class K_means:
def __init__(self, data: np.ndarray, number_of_clusters):
self.data: np.ndarr... | a80-abbasi/Saadi-Reterieval-System | webserver/Clustering.py | Clustering.py | py | 3,037 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "numpy.ndarray",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "scipy.spatial.distance.cdist",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.ndarray",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "nump... |
41495863506 | from rdkit import Chem
import csv
format = {'id': "nan", 'mol_weight': 3, 'esol': 1, 'smiles': 9, 'sol': 8, 'surface': 7}
delimiter = ","
input = "delaney-processed.csv"
output = "esol.sdf"
# Example formats:
# ChEMBL CSV: {'id': 0, 'mol_weight': 3, 'alogp': 5, 'smiles': 7, 'ic50': 10}
# MoleculeNet data sets:
# BACE... | sophiahoenig/NetworkBalanceScaling | utils/convert_CSV2SDF.py | convert_CSV2SDF.py | py | 1,151 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "csv.reader",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "rdkit.Chem.MolFromSmiles",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "rdkit.Chem",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "rdkit.Chem.SDWriter",
... |
42168511453 | import tkinter as tk
from tkinter import filedialog, messagebox
from PIL import Image, ImageTk, ImageDraw
from ui import UI
from inputProcessing import InputProcessing
class MainWindow(tk.Frame):
def __init__(self, master):
self.master = master
self.ui = UI()
self.ui.setupUi(master)
... | mstelmakh/STUD-Project-PIPR-20Z | Imagine logo/gui.py | gui.py | py | 5,316 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tkinter.Frame",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "ui.UI",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number":... |
8684889721 | # -*- coding: utf-8 -*-
"""
(`-()_.-=-.
/66 , , \
=(o_/=//_( /======`
~"` ~"~~` C.E.
Created on Thu Aug 6 11:58:53 2020
@author: Chris
Contact :
Christopher.eaby@gmail.com
"""
import tweepy
import matplotlib.pyplot as plt
import folium
import numpy... | Christopher-Eaby/Twitter-Mining | Twitter Mining/mining.py | mining.py | py | 4,062 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "geopy.geocoders.Nominatim",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "tweepy.OAuthHandler",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "tweepy.API",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "folium.Featu... |
5467985967 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""Pacote de controle do espectrômetro Callisto e de sua unidade de calibração em sistemas tipo Linux. Depende do binário callisto da distribuição Linux e utiliza conexão TCP e conexão serial.
@Author: Luciano Barosi
@Date: 15.04.2022
@Links: https://github.com/lbarosi/callis... | lbarosi/callisto | callisto.py | callisto.py | py | 23,526 | python | pt | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "logging.NullHandler",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "subprocess.Popen",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "shlex.split",
... |
39254111655 | import re
from typing import List, Optional
import typer
from rich.table import Table
from animelist import common
from animelist.anime import Anime, Status
def impl_list_command(existing_genre: Optional[str], existing_status: Optional[Status], existing_rating: Optional[str],
number: Optional[... | YangLorenzo/animelist | animelist/mycommands/listcommand.py | listcommand.py | py | 2,655 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.Optional",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "animelist.anime.Status",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.List",
... |
43387468817 | import pandas as pd
import json
import os
PARAMS_USERS_ITEMS = ["{\'user_id\': \'", "\', \'items_count\': \'",
"\', \'steam_id\': \'", "\', \'user_url\': \'",
"\', \'items\': \'[", "}]\'}"]
PARAMS_USER_REVIEWS = ["{\'user_id\': \'", "\', \'user_url\': \'",
... | BetoVT/PI-MLOps | src/process/process.py | process.py | py | 2,318 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.loads",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame.from_dict",
"li... |
4788370984 | import csv
import re
import time
import pandas as pd
from selenium import webdriver
from selenium.common.exceptions import WebDriverException
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
import Fonct... | Kamomille/WebScrapping_Supermarket | casinotest.py | casinotest.py | py | 7,303 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "selenium.webdriver.Firefox",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.support.ui.WebDriverWait",
"line_number": 21,
"usage_type": "call"
},
... |
74728175546 |
import urllib
import maxminddb
import GeoIP
import re
import os
import io
import gzip
__author__ = 'brizzbane'
def iplookup(ip_address):
asn = gi.org_by_addr(ip_address)
geo = reader.get(ip_address)
lookup = {'city': None, 'postal': None, 'region': None, 'region_code': None, 'latitude': None,
... | brizzbane/iplookup | iplookup/__init__.py | __init__.py | py | 2,568 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "re.search",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "urllib.urlopen",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "io.BytesIO",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "gzip.GzipFile",
"line_number"... |
12151554700 | """A module for working with chart animations."""
import abc
from enum import Enum
from os import PathLike
import json
from typing import Optional, Union, List, Any
import jsonschema # type: ignore
import pandas as pd # type: ignore
from pandas.api.types import is_numeric_dtype # type: ignore
from ipyvizzu.json i... | vizzu-streamlit/ipyvizzu | src/ipyvizzu/animation.py | animation.py | py | 16,490 | python | en | code | null | github-code | 6 | [
{
"api_name": "json.dumps",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "ipyvizzu.json.RawJavaScriptEncoder",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": ... |
7061805662 | from selenium import webdriver
from selenium.webdriver.support import ui
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select, WebDriverWait
from selenium.webdriver.support import expected_conditions as ec
from selenium.webdriver.common.by import By
import time
from bs4 imp... | beetee17/med_txtbk_scrape | scrape_urls.py | scrape_urls.py | py | 3,399 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "time.sleep",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pynput.mouse.Button.left",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "pynput.mouse.Button",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "time.sle... |
38435084602 | import cv2
import numpy as np
path_to_picture = "../resources/book_1001_zadacha.jpg"
img = cv2.imread(path_to_picture, cv2.IMREAD_GRAYSCALE)
# SIFT Features Detector
sift = cv2.xfeatures2d.SIFT_create()
# features of picture
kp_image, desc_image = sift.detectAndCompute(img, None)
# обозначить на picture точки kp_im... | DenisLaptev/pysource | tutorials/t34_Object_tracking_using_Homography.py | t34_Object_tracking_using_Homography.py | py | 3,306 | python | ru | code | 1 | github-code | 6 | [
{
"api_name": "cv2.imread",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_GRAYSCALE",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "cv2.xfeatures2d.SIFT_create",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.xfe... |
36105377823 | import os
import requests
import datetime
from progress.bar import Bar
def dTraversal(link):
print("##########################################")
print("Scanner Bug Directory Traversal")
print("##########################################")
with open('././wordlist/directorytraversal.txt','r') a... | rizkiar111299/ToolsMajalengkaCyberTester | tools/DIRECTORITRAVERSAL.py | DIRECTORITRAVERSAL.py | py | 1,610 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "progress.bar.Bar",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "requests.exceptions",
"line_number": 33,
"usage_type": "attribute"
}
] |
74537496828 | import numpy as np
import cv2
def draw_bar(img, pt, w, bars):
pt = np.array(pt, np.int)
for bar in bars:
(x, y), h = pt, w*6
cv2.rectangle(img, (x, y, w, h), (0, 0, 0), -1)
if bar == 0:
y = y + w * 3 - w // 4
h = w // 2
cv2.rectangle(img, (x, y, w, h)... | binlee52/OpenCV-python | ch08/연습문제/Q8-18.py | Q8-18.py | py | 1,253 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.int",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "cv2.rectangle",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.rectangle",
"line_numbe... |
42714925779 | import torch
import os
import numpy as np
from torch_geometric.data import Data, DataLoader
from creat_vrp import reward1,creat_instance
# from rolloutModel import Model
from gtppo_modelimplicit import Actor_critic
import os
import time
import sys
import torch
from creat_vrp import creat_data,reward,reward1
from collec... | GETUFELLEK/Edge-embedded-graph-transformer | test_vrp_all_epochs.py | test_vrp_all_epochs.py | py | 4,714 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.device",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "torch.no_grad",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "creat_vrp.reward1",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "torch.cat",
"line_nu... |
30217072844 | import matplotlib.pyplot as plt
import random
balls = 100 # number of balls
p = 0.5
def distribution(p):
choice = random.uniform(0, 1)
if choice < p:
choice = 1
else:
choice = 0
return choice
def galton(balls, p):
result = []
for i in range(0, balls):
course = 0
... | ThePeziBear/MyPythonLibrary | For Beginners/Galton Board.py | Galton Board.py | py | 620 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "random.uniform",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 33,
"usage_type": "name"
}
] |
2664532531 | from pathlib import Path
import pandas as pd
# import matplotlib.pyplot as plt
import geopandas as gpd
import folium
import time
from folium import IFrame
import altair as alt
pd.set_option('display.max_columns', None)
pd.set_option('display.max_rows', None)
def main():
# start time of function
start_time = t... | sebastian-konicz/Unemployment | src/02_map_pop_up.py | 02_map_pop_up.py | py | 3,535 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.set_option",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"lin... |
37431582858 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
name: zte 无线控制器 SQL注入
referer: http://www.wooyun.org/bugs/wooyun-2015-0151898
author: Lucifer
description: 文件/apgroup/getChannelByCountryCode.php中,参数CountryCode存在SQL注入。
'''
import sys
import json
import requests
class zte_wireless_getChannelByCountryCode_sqli_BaseVeri... | iceyhexman/onlinetools | scanner/plugins/industrial/zte_wireless_getChannelByCountryCode_sqli.py | zte_wireless_getChannelByCountryCode_sqli.py | py | 1,356 | python | en | code | 1,626 | github-code | 6 | [
{
"api_name": "requests.post",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 37,
"usage_type": "attribute"
}
] |
44377830025 | #!/usr/bin/python3
"""
Please list 10 commits (from the most recent to oldest) of the
repository “rails” by the user “rails”
You must use the GitHub API, here is the documentation
https://developer.github.com/v3/repos/commits/
Print all commits by: `<sha>: <author name>` (one by line)
"""
import requests
from sys impor... | Innocent9712/alx-higher_level_programming | 0x11-python-network_1/100-github_commits.py | 100-github_commits.py | py | 773 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
}
] |
28930499595 | import torch
from torch import nn
def sort_by_seq_lens(batch, sequences_lengths, descending=True):
"""
Sort a batch of padded variable length sequences by their length.
Args:
batch: A batch of padded variable length sequences. The batch should
have the dimensions (batch_size x max_sequ... | thinkingmanyangyang/multi-classification | net/layers/lstm_layer.py | lstm_layer.py | py | 2,925 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "torch.arange",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "torch.nn.LSTM",
"line_... |
73834959229 |
#!######################################################################
#! ___________.__ _________ __ #
#! \__ ___/| |__ ____ / _____/ ____ _____ | | __ ____ #
#! | | | | \_/ __ \ \_____ \ / \\__ \ | |/ // __ \ #
#! | | | Y \ __... | Th0mz/TheSnake | TheSnake.py | TheSnake.py | py | 4,144 | python | pt | code | 1 | github-code | 6 | [
{
"api_name": "pygame.init",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.... |
31855809970 | """
Basic molecular features.
"""
import numpy as np
from deepchem.feat.base_classes import MolecularFeaturizer
class RDKitDescriptors(MolecularFeaturizer):
"""RDKit descriptors.
This class comptues a list of chemical descriptors using RDKit.
See http://rdkit.org/docs/GettingStartedInPython.html
#list-of-a... | CAVED123/deepchem | deepchem/feat/rdkit_descriptors.py | rdkit_descriptors.py | py | 3,257 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "deepchem.feat.base_classes.MolecularFeaturizer",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "rdkit.Chem.Descriptors.descList",
"line_number": 64,
"usage_type": "attribute"
},
{
"api_name": "rdkit.Chem.Descriptors",
"line_number": 64,
"usage_typ... |
40696774733 | import asyncio
import logging
from typing import Any, Dict, List, Optional
import grpc
import snowflake
from magma.common.cert_validity import cert_is_invalid
from magma.common.grpc_client_manager import GRPCClientManager
from magma.common.rpc_utils import (
grpc_async_wrapper,
indicates_connection_error,
)
fr... | magma/magma | orc8r/gateway/python/magma/magmad/state_reporter.py | state_reporter.py | py | 10,825 | python | en | code | 1,605 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "orc8r.protos.service303_pb2.State",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "asyncio.AbstractEventLoop",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_... |
857522407 | """car, make, model, submodel
Revision ID: a2421508b2d8
Revises:
Create Date: 2020-06-02 11:36:25.034523
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "a2421508b2d8"
down_revision = None
branch_labels = None
depends_o... | kbudaj/seez | seez/infrastructure/postgres/migrations/versions/a2421508b2d8_car_make_model_submodel.py | a2421508b2d8_car_make_model_submodel.py | py | 4,501 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "alembic.op.create_table",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.diale... |
36914814961 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^edit_brand/$', views.edit_brand),
url(r'^edit_product/$', views.edit_product),
url(r'^edit_item/$', views.edit_item),
url(r'^login/$',views.producer_login),
url(r'^delete_brand/$',views.delete_brand),
url(r'^delete_product/$',views.delet... | avinashchinna/Digimarketing | producer/urls.py | urls.py | py | 650 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.conf.urls.url",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.co... |
15690069425 |
from google.cloud.sql.connector import Connector
import sqlalchemy
import pymysql
from dotenv import load_dotenv
import os
# initialize Connector object
class db():
pool = None
def __init__(self):
load_dotenv()
# connector = Connector()
#Database resources
#https://pypi.org/p... | stoppable408/RPTrader | modules/db.py | db.py | py | 8,011 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "google.cloud.sql.connector.Connector",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.... |
34734198803 | from multiprocessing import Pool
import cloudpickle as pickle
import os
import numpy as np
import logging
logger = logging.getLogger(__name__)
def work(pickled_task):
np.random.seed()
task = pickle.loads(pickled_task)
return task.execute()
class SimulationTask:
def __init__(self, alg, alg_args):
... | yannikschaelte/SSA | ssa/engine.py | engine.py | py | 1,833 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "cloudpickle.load... |
3648018166 | import numpy as np
from itertools import product
from .modified_pymatgen.substrate_analyzer_mod import reduce_vectors
########### Construction of supercell matrices
def get_independent_Supercell_Matrices(max_supercell_sizes, limit = None):
"""Find all independent supercell matrices for a given range of cell size... | computationalelectrochemistrygroup/WaterStructureCreator | waterstructureCreator/construct_supercells.py | construct_supercells.py | py | 5,683 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "numpy.linalg.norm",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "numpy.arccos",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"lin... |
13559011126 | import cv2
import numpy as np
from threading import Thread
import threading
def gamma(image, gamma=1.0):
if gamma == 0: # The minimal position of the slider is always 0.
gamma = 1
table = np.array([((i / 255.0) ** (1.0 / gamma)) * 255
for i in np.arange(0, 256)]).astype("uint8")... | spiderock98/KNN-DigitRecognize | zoom.py | zoom.py | py | 2,983 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.LUT",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number"... |
24558017574 | from modelfactory.introspect import Introspector
from modelfactory.models import DynamicModel, DynamicField
from django.template.defaultfilters import slugify
import codecs
from io import StringIO
from utils import OrderedDictReader, utfify
def fieldify(txt):
return slugify(txt).replace('-', '_')
clas... | aplayford/django-improv | improv/modelfactory/loaders.py | loaders.py | py | 5,161 | python | en | code | 18 | github-code | 6 | [
{
"api_name": "django.template.defaultfilters.slugify",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "io.StringIO",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "io.see... |
23983161889 | # -*- coding: utf-8 -*-
import lzma
import base64 as b64
import random as rd
import argparse
"""
Copyright owned by Ryder3x
----------------------------------------------------------------------------
File: BHE.py
Author: Ryder3x
Created: 13th June 2023
Copyright owned by Ryder3x
Description: This is the source code ... | Ryder3x/BHE | BHE.py | BHE.py | py | 3,586 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "random.seed",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "random.shuffle",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "lzma.compress",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "base64.b32encode",
"line... |
71861277629 | from selenium import webdriver
import time
from selenium.webdriver.common.keys import Keys
from bs4 import BeautifulSoup
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
import datetime
#Assign Variables
tweet= []
temp=[]
... | FurkanHaydari/GetRich | GetRich.py | GetRich.py | py | 6,144 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.firefox.options.Options",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.common.desired_capabilities.DesiredCapabilities.FIREFOX",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.com... |
37011697999 | #coding=utf-8
import requests
import json
from DataBase import DataBase
import Config
import DMExceptions
from Base import RESTAPIBase
class FacePre(RESTAPIBase):
'''
封装的预处理配置类,该类主要用于预处理的增、删、改、查
属性:
fpre_path:URL路径
url:http的完整路径
'''
def __init__(self, path=None, ip=None, port=None, db_ip=None, db_port=No... | wangluqiang/face | public/FacePre.py | FacePre.py | py | 6,284 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "Base.RESTAPIBase",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "Config.Config",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "Base.RESTAPIBase.__init__",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "Base.RESTAPIB... |
74801046266 | # %%
import os
import numpy as np
import cv2
import mediapy as media
import itertools as it
from scipy.spatial import KDTree
pi2 = np.pi*2
def rotate_image(image, angle):
image_center = tuple(np.array(image.shape[1::-1]) / 2)
rot_mat = cv2.getRotationMatrix2D(image_center, angle, 1.0)
result = cv2.warpAf... | csvt32745/VFX_2021_SPRING | hw2/sift.py | sift.py | py | 14,093 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "numpy.pi",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.getRotationMatrix2D",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.warpAffine",
... |
72167765309 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torchattacks import PGD
from ..advtrainer import AdvTrainer
class MART(AdvTrainer):
r"""
MART in 'Improving Adversarial Robustness Requires Revisiting Misclassified Examples'
[https://openreview.net/forum?id=rklOg6EFwS]
[https://... | Harry24k/adversarial-defenses-pytorch | torchdefenses/trainer/empirical_defenses/mart.py | mart.py | py | 2,865 | python | en | code | 33 | github-code | 6 | [
{
"api_name": "advtrainer.AdvTrainer",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torchattacks.PGD",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "torch.nn.functional.softmax",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "tor... |
72496097789 | from django.urls import path
from .views import (
ColocationTariffSummAPIView, ElementAPIView, InvoiceElementsAPIView, InvoiceElementsUpdateAPIView,
ExpertiseTariffSummAPIView, ElementUpdateAPIView, GetElementAPIView, VpsTariffSummAPIView
)
urlpatterns = [
# path('tarif-create', TariffCreateAPIView.as_vi... | Rahmet97/TestProjectBackend | billing/urls.py | urls.py | py | 1,132 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "views.ColocationTariffSummAPIView.as_view",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "views.ColocationTariffSummAPIView",
"line_number": 11,
"usage_type": "name"
... |
4885832312 | """
找到图像位置(路径)
打开
显示
"""
import numpy as np
from PIL import Image
img = Image.open('test.jpeg')
print(img.size)
# 转换成 Numpy 数组
imgData = np.asarray(img)
# w, h, c = imgData.shape
# 显示一张图片
img.show()
print(imgData) | RockingHorse-L/PIL | 01打开图像.py | 01打开图像.py | py | 277 | python | zh | code | 2 | github-code | 6 | [
{
"api_name": "PIL.Image.open",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "numpy.asarray",
"line_number": 13,
"usage_type": "call"
}
] |
20232271552 | #!/usr/bin/env python
from setuptools import setup, find_packages
import os
description = 'A simple python wrapper to access e-Stat API'
long_description = description
if os.path.exists('README.rst'):
with open('README.rst') as f:
long_description = f.read()
setup(name='estatpy',
version='0.0.1',
... | otomarukanta/estatpy | setup.py | setup.py | py | 917 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.exists",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "setuptools.setup",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",... |
31361786087 | # Standard libraries
import json
# pip imports
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import scipy.integrate as integrate
from pandas import DataFrame
from mpl_toolkits.mplot3d import Axes3D
# non-pip
from potentials import *
from visualization import *
from lattice import *
from il... | salmanak31/importance_learning | logs/il_pedagogical.py | il_pedagogical.py | py | 8,533 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.asarray",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": ... |
7925174539 | from tools import otsu, parse, thresholding
import numpy as np
from imutils import resize
import matplotlib
import matplotlib.pyplot as plt
import cv2 as cv
import argparse
matplotlib.use('TKAgg')
PATH = "images/otsu/{}"
parser = argparse.ArgumentParser()
parser.add_argument('--filepath', '-f',
ty... | YvesAugusto/project_vc | otsu.py | otsu.py | py | 1,481 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.use",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tools.parse.HELP_FILEPATH",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "... |
40592741670 | from collections import Counter
tc=int(input())
while tc:
n=int(input())
li=list(map(int,input().split()))
a=Counter(li)
flag=True
if len(a)==1:
print(-1)
flag=False
if flag:
ma=max(li)
for i in range(n):
if li[i]==ma and ((i+1 < n and(li... | ku-nal/Codeforces | codeforces/1433/C.py | C.py | py | 424 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "collections.Counter",
"line_number": 7,
"usage_type": "call"
}
] |
43633337503 |
from __future__ import absolute_import
#typing
#overrides
import torch
from torch.nn import Dropout
from allennlp.modules.feedforward import FeedForward
from allennlp.modules.layer_norm import LayerNorm
from allennlp.modules.seq2seq_encoders.multi_head_self_attention import MultiHeadSelfAttention
from allennlp.modul... | plasticityai/magnitude | pymagnitude/third_party/allennlp/modules/seq2seq_encoders/stacked_self_attention.py | stacked_self_attention.py | py | 7,248 | python | en | code | 1,607 | github-code | 6 | [
{
"api_name": "itertools.izip",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "allennlp.modules.seq2seq_encoders.seq2seq_encoder.Seq2SeqEncoder",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "allennlp.modules.feedforward.FeedForward",
"line_number": 88,... |
23262868705 | import logging
import threading
from time import sleep
fmt = "%(threadName)s %(message)s"
logging.basicConfig(level=logging.DEBUG, format=fmt)
class ActivePool(object):
def __init__(self):
self.pool = []
self.lock = threading.Lock()
def make_active(self, name):
with self.lock:
... | simula67/advanced-python-course-material | instructor-github/day5/mt/psmtsympoolsem.py | psmtsympoolsem.py | py | 1,100 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "threading.Lock",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.debug",
... |
31866682945 | """Views file for django"""
# python modules
import time
import os
from pathlib import Path
import socket
from git import Repo
from pathlib import Path
# django modules
from django.shortcuts import render, redirect
# serial functions
from apps.relays.serial_module_ import serial_ports
def update_view(request):
p... | MeletChirino/Linky4Teens | new_gui/new_gui/views.py | views.py | py | 3,746 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "git.Repo",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "apps.relays.serial_mo... |
38300630398 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
from sklearn import metrics
from sklearn import preprocessing
def regression(state):
data = pd.read_csv('all-measles-rates.csv', sep=",", error... | bml72/FinalProject-Group4 | Individual-Final-Project-Report/Russell-Moncrief-Individual-Project/Code/russell_final.py | russell_final.py | py | 3,904 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "matplotli... |
73348434107 | import math
import numpy as np
import pandas as pd
import collections
from scipy.stats import pearsonr
from pandas import DataFrame
from statsmodels.tsa.stattools import adfuller
from statsmodels.stats.diagnostic import acorr_ljungbox
from anteater.utils.log import logger
class FeaturePortrait(object):
def __i... | openeuler-mirror/gala-anteater | anteater/feature_extraction/feature_portrait.py | feature_portrait.py | py | 5,664 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pandas.DataFrame",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "pandas.to_datetime",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "numpy.median",
... |
15306817060 | from aiogram import types
from misc import dp,bot
from .sqlit import reg_user,cheack_status,cheack_black
import asyncio
content_chat = -1001780671252
ids_user = []
import asyncio
@dp.message_handler(commands=['start'])
async def cmd_start(message: types.Message):
reg_user(id=message.chat.id)
go = ... | pytera895143242/privatbot | handlers/commands_start.py | commands_start.py | py | 3,781 | python | ru | code | 0 | github-code | 6 | [
{
"api_name": "aiogram.types.Message",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "aiogram.types",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "sqlit.reg_user",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sqlit.cheack_... |
17748909345 | #!/usr/bin/env python
# coding: utf-8
# # Price Prediction using Regression
# This is a tickets pricing monitoring system. It scrapes tickets pricing data periodically and stores it in a database. Ticket pricing changes based on demand and time, and there can be significant difference in price. We are creating this p... | muhammaddtalha/Price-Prediction | Price Prediction.py | Price Prediction.py | py | 15,520 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "seaborn.set",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "seaborn.countplot",
"line_number": 145,
"usage_type": "call"
},
{
"api_name": "seaborn.countplot",
... |
25320304397 | import os
from conans import ConanFile, CMake, tools
from conans.errors import ConanInvalidConfiguration
from conans.tools import Version
class CAFConan(ConanFile):
name = "caf"
version = "0.17.6"
description = "An open source implementation of the Actor Model in C++"
url = "https://github.com/bincraf... | bincrafters/conan-caf | conanfile.py | conanfile.py | py | 5,545 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "conans.ConanFile",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "conans.tools.get",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "conans.tools",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "os.rename",
"line_n... |
33628587291 | import lib.data.clean as clean
import lib.data.raw as raw
import lib.data as data
import pandas as pd
import numpy as np
import os
LOAD_AIR_DATA = False
LOAD_WEATHER_DATA = False
LOAD_NOISE_DATA = True
LOAD_TRAFFIC_DATA = True
def main():
# Load RAW csv files
dataset_names = [x[2] for x in raw.RAW_D... | mhruiz/tfm_big-data | py01_data_preparation.py | py01_data_preparation.py | py | 8,364 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "lib.data.raw.RAW_DATA_NAMES",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "lib.data.raw",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "lib.data.raw.read_dataset_from_raw",
"line_number": 20,
"usage_type": "attribute"
},
{
... |
24924223345 | import webapp2
class MainHandler(webapp2.RequestHandler):
def get(self):
fp = FormPage()
fp.inputs = {"first_name": "text", "last_name": "text"}
fp.create_inputs()
self.response.write(fp.print_out())
class Page(object):
def __init__(self):
self._head = '''<!DOCTYPE HTML>
<html>
<head>
<title>{self.t... | bogoroh/DPW2 | Class/abstract/main.py | main.py | py | 1,107 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "webapp2.RequestHandler",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "webapp2.WSGIApplication",
"line_number": 49,
"usage_type": "call"
}
] |
13985238937 | from spectralDNS import config
from numpy import zeros, ones, arange, pi, float, complex, int, complex128
from Matrices import BBBmat, SBBmat, ABBmat
import SFTc
from scipy.linalg import lu_factor, lu_solve, solve
class Helmholtz(object):
def __init__(self, N, alfa, quad="GL", neumann=False):
# Prepare LU... | SebsterG/spectralDNS | spectralDNS/shen/la.py | la.py | py | 7,821 | python | en | code | null | github-code | 6 | [
{
"api_name": "numpy.zeros",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.float",
"line_number": 17,
"usage_type": "argument"
},
{
"api_name": "numpy.zeros",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.float",
"line_numbe... |
12393563129 | import math
import sys
from collections import Counter
from copy import deepcopy
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
ALPHA = math.pi**2 / 8
def normal_cdf(value, loc=0.0, scale=1.0):
return 0.5 * (1 + torch.erf((value - loc) / (scale * math.sqrt(2))))
def sigm... | changchunli/PLSP | utils/ST_loss.py | ST_loss.py | py | 9,916 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "math.pi",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.erf",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.sqrt",
"line_number": 19,
... |
16542826257 | from nuitka.utils.CStrings import encodePythonStringToC
def getGotoCode(label, emit):
assert label is not None
emit("goto %s;" % label)
def getLabelCode(label, emit):
assert label is not None
emit("%s:;" % label)
def getBranchingCode(condition, emit, context):
true_target = context.getTrueBr... | Nuitka/Nuitka | nuitka/code_generation/LabelCodes.py | LabelCodes.py | py | 1,028 | python | en | code | 10,019 | github-code | 6 | [
{
"api_name": "nuitka.utils.CStrings.encodePythonStringToC",
"line_number": 40,
"usage_type": "call"
}
] |
12708115590 | #!/usr/bin/env python
import sys
import os
import argparse
from lammpack_types import Config
from ordering_functions import *
def printRdfs(rdfs, norm = True):
nlines = len(rdfs['r'])
sys.stdout.write("#r vol")
orderedKeys = []
for key in rdfs['data']:
orderedKeys.append(key)
orderedKeys.sort()
for key in ord... | mglagolev/mouse | calculate_rdfs.py | calculate_rdfs.py | py | 2,171 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "sys.stdout.write",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout.write",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"l... |
35727354879 | # 필요한 라이브러리 불러오기
from keras.datasets import mnist
from keras import models
from keras import layers
from keras.utils import to_categorical
import cv2
# MNIST 데이터셋 불러오기
(train_images, train_labels), (test_images, test_labels) = mnist.load_data()
for i in range(len(train_images)):
lable = str(train_labels[0])
c... | dongjunchoi/Python | HELLOPYHON/day16/mykeras03filewrite.py | mykeras03filewrite.py | py | 636 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "keras.datasets.mnist.load_data",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "keras.datasets.mnist",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "cv2.imwrite",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.wai... |
29010166638 | import sys
from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QDesktopWidget
from PyQt5.QtGui import QFont, QResizeEvent, QPainter
from PyQt5.QtCore import Qt, QRectF, QTimer, QSize
from pyqt.Clickable_Label import Label
class NumberWidget(QWidget):
def __init__(self):
super().__init__()
... | rogitson/pirl | pyqt/number_widget.py | number_widget.py | py | 2,097 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QApplication.primaryScreen",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QApplication",
"line_number": 13,
"usage_type": "name"
... |
1896322399 |
from flask import Flask, redirect, render_template, request
from pyparsing import Word
import requests
import random
app = Flask(__name__)
sb = ['בגלל' , 'מפני' , 'משום' , 'מכיוון', 'לאור']
vv = ['אף על פי' , 'אפילו', 'למרות' , 'גם אם']
@app.route("/")
def home():
return render_template("index.html") # ... | XcPlease/copymeter | copymeter/main.py | main.py | py | 1,166 | python | he | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.request.form",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "flask.reques... |
2003580699 | # wgranie pygame
import pygame
import random
import math
# initialize pygame
pygame.init()
# dodanie ekranu/wyswietlacza
screen = pygame.display.set_mode((800, 600)) # szerokosc , wysokosc - 0, 0 to byloby "nic" w lewym gornym rogu
# Tło
background = pygame.image.load("kosmos.png")
# Tytul i Icona okna ekranu
pyg... | nieonek/crashcoursepython | PYGAME.py | PYGAME.py | py | 5,535 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.init",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.l... |
6284688916 | from django.http import HttpResponse
from django.template import loader
def index(request):
name = 'HUFS'
temp = loader.get_template('hello_world.html')
context = {
'name' : name,
}
return HttpResponse(temp.render(context, request))
def if_else(request):
warr = True
vara = 8
v... | Saon163/djangoProject320 | polls/views.py | views.py | py | 1,206 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "django.template.loader.get_template",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.template.loader",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 11,
"usage_type": "call"
},
{
... |
7506938836 | import csv
import matplotlib.pyplot as plt
import numpy as np
with open("World firearms murders and ownership - Sheet 1.tsv") as f:
reader = csv.reader(f, delimiter='\t')
data = list(reader)
header = data.pop(0)
print(header)
# scatter of firearms per 100 against homicides per 100k
homicide_100k = []
firea... | miawich/repository_mia | Notes/NotesB/10_scatter_plot_miawich.py | 10_scatter_plot_miawich.py | py | 1,414 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "csv.reader",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplo... |
4546053027 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
# Getting Data
ad_data = pd.read_csv("advertising.csv")
print(ad_data.head())
print()
print(ad_data.describe())
print()
print(ad_data.info())
print()
# EDA
ad_data["Age"].hist(bins = 30)
plt.xlabel("Age")
s... | Hardvan/Logistic-Regression-Model | Logistic Regression/Logistic Regression Code.py | Logistic Regression Code.py | py | 1,495 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.xlabel",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "seaborn.joi... |
43045790441 | # -*- coding: utf-8 -*-
"""
Created on Thu Aug 9 11:36:01 2018
@author: XT21586
"""
import os, sys
import win32com.client as win32
import tkinter as tk
import numpy as np
import pandas as pd
import re
import sqlparse
from sqlparse.sql import IdentifierList, Identifier
from sqlparse.tokens import Keyword, DML
... | lucmilot/DOSSET | grab_all_file_with_FTP_3b.py | grab_all_file_with_FTP_3b.py | py | 8,835 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "re.compile",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "re.DOTALL",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "re.compile",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "re.IGNORECASE",
"line_number... |
2390999882 |
from flask import Blueprint, jsonify, Response
import random
mockresponse = Blueprint('mockresponse', __name__)
RANKCLASS = ('2','3','4','5', "6", "7", "8", "9", "10", "J", "Q", "K", "A")
SUITCLASS = ('diamond', 'club','heart','spade')
@mockresponse.route("/getcards", methods=["GET"])
def getcards():
return json... | johnflyasian/mockcard | app/views/mock.py | mock.py | py | 609 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Blueprint",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 18,
"usage_type": "call"
}
] |
26572020574 | import numpy as np
import datetime
import os
import json
import pandas as pd
from keras import regularizers, optimizers, utils, applications
from brodatz.data_utils import save_history
def probas_to_classes(y_prob):
return np.argmax(y_prob, axis=1)
def accuracy(y_test, y_predict):
return np.mean(np.argma... | take5v/brodatz | brodatz/utils.py | utils.py | py | 7,503 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.argmax",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.argmax",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"lin... |
35014440363 | # coding: utf-8
import os
import json
import requests
from app import app
from app.redis.connect import Connect
class Chatwork():
def __init__(self):
self.url = 'https://api.chatwork.com/v2/'
self.headers = {
'X-ChatWorkToken': os.environ.get('CHATWORK_TOKEN')
}
def is_... | jasonsmithj/spam_public | app/utility/chatwork.py | chatwork.py | py | 3,016 | python | ja | code | 0 | github-code | 6 | [
{
"api_name": "os.environ.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "app.app.config",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "app.app",
"lin... |
33810329003 | import tensorflow as tf
from config import config
config_feature = config['feature']
class DataNormalization(tf.keras.layers.Layer):
def __init__(self):
super(DataNormalization, self).__init__(name='data_normalization') #
self.n = tf.Variable(initial_value=1.0, trainable=False, name='batch_number'... | ashnik777/Audio-Classification | custom_layers.py | custom_layers.py | py | 3,321 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "config.config",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "tensorflow.keras",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.Variable",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tensorflow.Varia... |
6191665909 | from django.contrib import admin
from django.urls import path, include, re_path
from . import views
urlpatterns = [
path('admin/', admin.site.urls),
path('authenticate/', views.Gmail_Authenticate.as_view(),
name='gmail_authenticate'),
path('admin/oauth2callback', views.Auth_Return.as_view(), name=... | singh-gagan/django-hiring-tool | hiringapp/urls.py | urls.py | py | 677 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "dja... |
14480338764 | from flask import Flask, render_template, request, jsonify
import subprocess
from socket import gethostbyname
import platform
windows_template_folder = r"WebLocalScanner\templates"
linux_template_folder = "webscanner/templates"
#app = Flask(__name__, template_folder=windows_template_folder)
app = Flask(__name__, templ... | DominikFerenc/WebScannerPort | app.py | app.py | py | 1,974 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "socket.gethostbyname",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "platform.system",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "subprocess.run",
... |
22222392801 | from typing import Union, List, Any
import json
import re
from telebot.types import InlineKeyboardMarkup, InlineKeyboardButton
from loguru import logger
from database.create_db import session
from database.check_data.check_location_for_name import check_location
from database.create_data.create_location import create... | FreemaHG/tourist-telegram-bot | utils/request_for_api/get_location.py | get_location.py | py | 4,551 | python | ru | code | 1 | github-code | 6 | [
{
"api_name": "database.check_data.check_location_for_name.check_location",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "loguru.logger.info",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "loguru.logger",
"line_number": 35,
"usage_type": "name"
}... |
43722852683 | from flask import render_template,request,redirect
from flask_app import app
from flask_app.models.dojo import Dojo
from flask_app.models.ninja import Ninja
@app.route("/dojos")
def index():
dojos = Dojo.get_all()
print(dojos)
return render_template("dojo.html", all_dojos = dojos)
@app.route("/dojos/<int... | Felix0331/dojos_ninjas | flask_app/controllers/dojos.py | dojos.py | py | 1,254 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask_app.models.dojo.Dojo.get_all",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask_app.models.dojo.Dojo",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "flask.render_template",
"line_number": 11,
"usage_type": "call"
},
{
... |
30043917498 | # -*- coding: utf-8 -*-
import scrapy
from scrapy.selector import Selector
from scrapy.http import Request,FormRequest
from scrapy.selector import HtmlXPathSelector
from scrapy.selector import XmlXPathSelector
from scrapy.linkextractors import LinkExtractor
import requests
import json
import re
import uuid
import hashl... | vartika102/Web-Scraping | spiders/nissan_dubai.py | nissan_dubai.py | py | 5,409 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "scrapy.Spider",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "scrapy.selector.Selector",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "autodata.items... |
12110707007 | from tqdm import tqdm
def dplay(cups, dest):
c1 = cups[dest]
c2 = cups[c1]
c3 = cups[c2]
cups[dest] = cups[c3]
search_val = (dest-1) % len(cups)
while search_val in [c1, c2, c3]:
search_val = (search_val-1) % len(cups)
cups[c3] = cups[search_val]
cups[search_val] = c1
des... | scjohnson/aoc_2020 | solution_23.py | solution_23.py | py | 1,102 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tqdm.tqdm",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 46,
"usage_type": "call"
}
] |
2748266916 | import json
import pandas as pd
from datetime import datetime
# Load JSON data from the file
with open("testdata04.json", "r") as file:
json_data = file.read()
data = json.loads(json_data)
raw_data = data['New_path4']
combined_data = {}
for timestamp, values in raw_data.items():
value_list =... | phonefern/HandDetect | convert_json/data_convert.py | data_convert.py | py | 1,549 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.loads",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "json.dumps",
... |
2799355440 | # imports
import pandas as pd
import numpy as np
import streamlit as st
import os
import datetime as dt
from dateutil.relativedelta import relativedelta
import requests
import pickle
import matplotlib.pyplot as plt
import matplotlib
import seaborn as sns
import pydeck as pdk
# set tab name
st.set_page_config(page_t... | carolinedlu/streamlit_resale_flat_prices | streamlit_resale_flat_prices_app.py | streamlit_resale_flat_prices_app.py | py | 15,911 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "streamlit.set_page_config",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "streamlit.markdown",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "streamlit.title",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "streamli... |
41436242393 |
from data import dataset
import torch
from torch.utils import DataLoader
from torch.autograd import Variable
import utils
import keys
from torch.nn import CTCLoss
import crnn
import os
import config
lr = 0.0003
betas = (0.5, 0.999)
niter = 100
device = None
def weights_init(m):
classname = ... | risingstar213/OCR | crnn/crnn_train.py | crnn_train.py | py | 4,147 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.autograd.Variable",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "torch.IntTensor",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "torch.isnan",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "torch.device",
... |
17599114011 | from flask import Flask, render_template, request, redirect
from threading import Thread
# from werkzeug.security import secure_filename
app = Flask(__name__)
app.config.from_object("config")
from helper import *
@app.route("/")
def index():
return render_template("index.html")
@app.route("/", meth... | reedwi/flask-transcriber | __init__.py | __init__.py | py | 1,160 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.request.files",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "flask.reque... |
42603312345 | # -*- coding:UTF-8 -*-
import json
import mitmproxy.http
from mitmproxy import ctx
class Events:
def response(self, flow: mitmproxy.http.HTTPFlow):
if 'stock.xueqiu.com/v5/stock/batch/quote.json' in flow.request.url and \
'_s' in flow.request.url:
response_data = json.loads(fl... | NelsonSub/task_hogwarts | seventh/rewrite.py | rewrite.py | py | 763 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "mitmproxy.http.http",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "mitmproxy.http",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "json.loads",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"li... |
21112732832 | from .plugin import Plugin
import requests
# 插件名称
name = '订蛋糕'
# 描述信息
description = """
订蛋糕(快应用) 验证码登录接口
源代码: http://t5.market.xiaomi.com/download/Mina/0e9584b8c7a402421c82b27925f18cc422d41e3e6
更新时间: 2020-08-14
"""
# 作者
author = 'kksanyu'
# 是否启用该插件
enable = False
class OctinnQuickApp(Plugin):
def run(self, op... | superdashu/who_are_you | plugins/octinn-quickapp.py | octinn-quickapp.py | py | 1,411 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "plugin.Plugin",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "requests.post",
"line_number": 29,
"usage_type": "call"
}
] |
37730675819 | import random
# from scipy.constants import k
from scipy.constants import pi
# from scipy.constants import e
import numpy as np
import time
import os
random.seed()
N = 2
k = 1
sigma = 1
ep = 1
T = 1
m0 = 1
side = 6
side_p = side / 2
time = 0.001
period = 5
epoches = int(period / time)
... | Vandyshge/PhysModelNew | Gas_prog/v4.py | v4.py | py | 12,191 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "random.seed",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "scipy.constants.pi",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "numpy.exp",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_nu... |
24663062013 | from base64 import encode
import pandas as pd
import requests
import base64
import json
import ast
cred = {
{
"client_id": "YOUR CLIENT ID",
"client_secret": "YOUR CLIENT SECRET"
}
}
def get_bearer_token() -> dict:
encoded_cred = base64.b64encode(
bytes(
cred... | gabrielvms/AirflowTest | utils.py | utils.py | py | 1,641 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "base64.b64encode",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "ast.literal_eval",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "requests.get",
"l... |
5053298376 | import sys, os, time, atexit
import signal
import threading, logging
from exceptions import InterruptedException
class Container(threading.Thread):
def __init__(self, context, idle_time=0, group=None, name=None, parent_interrupted=None):
super(Container, self).__init__(group=group, name=name)
sel... | palankai/xadrpy | src/xadrpy/core/workers/containers.py | containers.py | py | 3,370 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "threading.Thread",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "threading.Event",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "threading.Event",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "threading.Event"... |
36105555428 | import os
import zipfile
import numpy as np
import torch
import matplotlib.pyplot as plt
from scipy.signal import argrelextrema
from pytorch_forecasting.utils import autocorrelation
X = np.load("interpret_csv/node_values_alpha.npy").transpose((1, 2, 0))
# X = np.load("interpret_csv_bravo/node_values_bravo.npy").transp... | oscarcrowley1/thesis | analysis/autocorr.py | autocorr.py | py | 1,201 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "numpy.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "torch.Tensor",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pytorch_forecasting.utils.a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.