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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
10693944537 | # iterative
# n = number of nodes
# Time: O(n)
# Space: O(n)
from collections import deque
def tree_includes(root, target):
if not root:
return False
queue = deque([root])
while queue:
current = queue.popleft()
if current.val == target:
return True
if current.left:
queue.append(c... | mjfung1/structy | Python/27tree_includes.py | 27tree_includes.py | py | 679 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "collections.deque",
"line_number": 12,
"usage_type": "call"
}
] |
25290301564 | import requests
import cv2
import cmath
import numpy as np
import time
from globals import *
from cam import tracker
import tlm
def set_resolution(url: str, index: int=1, verbose: bool=False):
try:
if verbose:
resolutions = "10: UXGA(1600x1200)\n9: SXGA(1280x1024)\n8: XGA(1024x768)\n7: SVGA(80... | ksklorz/ITproj | src/cam/video_lib.py | video_lib.py | py | 4,811 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "cv2.selectROI",
"line_numb... |
21049266316 | # Miguel Delapaz - CS594 - IRC Server Project
import socket
import select
import sys
from enum import Enum
try:
import queue
except ImportError:
import Queue as queue
class Command(Enum):
LOGIN = 1
LOGOUT = 2
ADD_CHANNEL = 3
JOIN_CHANNEL = 4
LEAVE_CHANNEL = 5
LIST_ROOMS = 6
LIST_USE... | mdelapaz/CS594-Project | irc_server.py | irc_server.py | py | 10,438 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "enum.Enum",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "socket.socket",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number":... |
42199060348 | #! /usr/bin/env python
"""
Finite State Methods and Statistical NLP
"""
import nltk
import pickle
import random
from os import path
from nltk.corpus import masc_tagged
from nltk.tag import hmm
from ass3utils import train_unsupervised
nltk.download('masc_tagged')
short_sent = [
"Once we have finished , we will go... | dmuiruri/nlp | fsm_snlp/fsm_snlp.py | fsm_snlp.py | py | 7,250 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "nltk.download",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.masc_tagged.tagged_sents",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.masc_tagged",
"line_number": 43,
"usage_type": "name"
},
{
"api_na... |
26219034741 | import coverage
import test_sut
cov = coverage.Coverage()
cov.set_option("run:branch", True)
cov.start()
test_sut.test_handle_event()
cov.stop()
cov.save()
cov.report(show_missing=True) | mikepatrick/coverage-test | collect_coverage.py | collect_coverage.py | py | 188 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "coverage.Coverage",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "test_sut.test_handle_event",
"line_number": 8,
"usage_type": "call"
}
] |
27848566804 | import streamlit as st
import pandas as pd
from PIL import Image
import shap
import matplotlib.pyplot as plt
from sklearn import datasets
import pickle
def main():
st.write("""
# Boston House Price Prediction App
This app predicts the **Boston House Price**!
""")
image = Image.open('boston.jpg... | BingQuanChua/DataScienceApps | 08_boston_housing_regression/myapp.py | myapp.py | py | 5,010 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "streamlit.write",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "streamlit.image",
"line_... |
34337715752 | from django.conf.urls import url
from schedulizer import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^addclasses/$', views.addClasses, name='addClasses'),
url(r'^finalschedule/$', views.finalSchedule, name='finalSchedule'),
url(r'^getdars/$', views.getDars, name='getDars'),
u... | leeonlee/fsched | schedulizer/urls.py | urls.py | py | 378 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.conf.urls.url",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "schedulizer.views.index",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "schedulizer.views",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "djan... |
22525799323 | from sklearn.metrics import f1_score, matthews_corrcoef
import numpy as np
from rouge import Rouge
from src.utils import qa_utils
from datasets import load_metric
import re
class App:
def __init__(self):
self.functions = {}
def add(self, key):
def adder(func):
self.functions[key] =... | microsoft/LMOps | uprise/src/utils/metric.py | metric.py | py | 5,807 | python | en | code | 2,623 | github-code | 1 | [
{
"api_name": "rouge.Rouge",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "src.utils.qa_utils.normalize_squad",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "src.utils.qa_utils",
"line_number": 57,
"usage_type": "name"
},
{
"api_name": "src... |
27995731321 | import pandas as pd
import numpy as np
import nltk
nltk.download('punkt')
from nltk.tokenize import word_tokenize
df=pd.read_csv("cauhoi.csv",delimiter=";")
tt=df.Question
Answer={}
t,c=np.unique(df.Answer,return_counts=True)
for i in range(0,len(t)):
Answer[i]=t[i]
d=['(',')',',','.','!',' ','-','?','!','... | phamtri1812/website_quan_ly_mam_non | chatbot/model.py | model.py | py | 3,045 | python | vi | code | 0 | github-code | 1 | [
{
"api_name": "nltk.download",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.unique",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "nltk.tokenize.word_tokenize"... |
18320858574 | import numpy as np
from sklearn.linear_model import LogisticRegression
class Camargo():
def __init__(self):
self.clssfier = LogisticRegression(class_weight='balanced')
def transform(self, source,target):
col_name = source.columns
for col in col_name:
s_median = np.log(sou... | cadet6465/eCPDP | baselines/Camargo.py | Camargo.py | py | 803 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sklearn.linear_model.LogisticRegression",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.log",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.log",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.log"... |
2593816440 | from typing import List, Optional, Tuple
from collections import defaultdict
import pickle
import json
import argparse
import os
from typing import Union, Dict
import math
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import cosine_similarity
SAVE_DIR = 'retriever_caches'
... | NoviScl/GPT3QA | tfidf_retriever.py | tfidf_retriever.py | py | 4,470 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "sklearn.feature_extraction.text.TfidfVectorizer",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 52,
"usage_type": "attribute"
},
{
"api_nam... |
3097247249 | import argparse
def read_user_cli_args():
"""Handle the CLI arguments and options."""
parser = argparse.ArgumentParser(
prog="sitechecker", description="Teste a disponibilidade de uma URL"
)
parser.add_argument(
"-u",
"--urls",
metavar="URLs",
nargs="+... | hugosousa111/sitechecker | sitechecker/cli.py | cli.py | py | 1,065 | python | pt | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 5,
"usage_type": "call"
}
] |
42613974193 | import matplotlib.pyplot as plt
# Create the figure and axes
fig, ax = plt.subplots()
# Sample data
x = [1, 2, 3, 4, 5]
y = [10, 15, 7, 12, 8]
# Plot the data
ax.plot(x, y)
# Set x-tick positions and labels
xtick_positions = range(min(x), max(x)+1)
xtick_labels = [str(xtick) for xtick in xtick_positions]
ax.set_xti... | wendycahya/Yaskawa-Communication | IntegratedSystem/Basic Function Test/xticks-function.py | xticks-function.py | py | 472 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.xticks",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "m... |
7283812606 | import dolfin as df
from coordinate_systems import SphericalCoordinateSystem
N = 100
r_max = 2
mesh = df.IntervalMesh(N, 0, r_max)
V = df.FunctionSpace(mesh, 'P', 2)
r = df.SpatialCoordinate(mesh)
u = df.TrialFunction(V)
v = df.TestFunction(V)
coordinates = SphericalCoordinateSystem(mesh)
spherical_laplace = coo... | wagnandr/immunotherapy-lung-cancer | reduced_models/test_laplace_spherical.py | test_laplace_spherical.py | py | 880 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "dolfin.IntervalMesh",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "dolfin.FunctionSpace",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "dolfin.SpatialCoordinate",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "dolfi... |
19460218663 | from typing import Any, Dict, List
from unittest.mock import call
import pandas
import pytest
from callee.strings import Glob, String
from tests.service_test_fixtures import ServiceTestFixture
from tests.utils import DataFrameColumnMatcher, shuffled_cases
from the_census._variables.models import Group, GroupCode, Gro... | drawjk705/the_census | tests/unit/the_census/variables/repository/variables_repo_test.py | variables_repo_test.py | py | 5,924 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.DataFrame",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "the_census._variables.models.Group",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "the_census._variables.models.GroupCode",
"line_number": 20,
"usage_type": "call"
},... |
36682257881 | # -*- coding: utf-8 -*-
"""
Created on Sun May 30 11:19:57 2021
@author: Gaurav
"""
import cv2
import mediapipe as mp
import time
from google.protobuf.json_format import MessageToDict
cap = cv2.VideoCapture(0)
mphands = mp.solutions.hands
hands = mphands.Hands()
mpDraw = mp.solutions.drawing_utils
ptime = 0
ctime... | kanojia-gaurav/Advance_opencv | Hand_using_mediaPipe/Hand_detection.py | Hand_detection.py | py | 1,251 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "mediapipe.solutions",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "mediapipe.solutions",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "cv... |
18022324894 | import os
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import time
import kornia
import copy
from torch.utils.data import Dataset
import glob
import cv2
os.environ["OPENCV_IO_ENABLE_OPENEXR... | PKU-EPIC/DREDS | DepthSensorSimulator/stereo_matching.py | stereo_matching.py | py | 25,023 | python | en | code | 89 | github-code | 1 | [
{
"api_name": "os.environ",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "torch.arange",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.double",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "torch.exp",
"line_... |
12083730428 | import pygame, random
pygame.init()
SIZE = WIDTH, HEIGHT = 1200, 700
SCREEN = pygame.display.set_mode(SIZE)
WHITE = 255,255,255
BLACK = 0,0,0
class Ball:
def __init__(self):
self.x = 100
self.y = 100
self.radius = 50
self.move_x = random.random()
self.move_y... | brainmentorspvtltd/RKGIT_IOT | OOPS/BallGame.py | BallGame.py | py | 1,556 | python | en | code | 5 | github-code | 1 | [
{
"api_name": "pygame.init",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "random.random",
... |
7954284443 | from commom.BrowserStartUp import *
import requests
import json
class RunMain():
# 设置GET请求的带参数的cookie信息
def sent_get_by_cookies(self, url, cookies, paramdata=None):
headers = {"Content-Type": "application/json"}
response = requests.get(BaseUrl()+url,cookies=getCookies(cookies),data=json.dumps(pa... | King-BAT/RanZhi | RanZhiPython/commom/SendHttp.py | SendHttp.py | py | 1,279 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 1... |
4404407019 | import snap
import numpy as np
import numpy.linalg as la
import matplotlib.pyplot as plt
# The function to calculate the distance between two Network of the virtual tree
def distance(NId1, NId2, b, H):
# NId1 and NId2 are the IDs of two nodes
# b is the number of each parent's children
# H is the height of... | myishh/adb | hw1/search.py | search.py | py | 2,931 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.ones",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "snap.GenRndGnm",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "snap.PNGraph",
"line_number": 53,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_n... |
19573688332 | import os
import pathlib
import struct
import click
import tqdm
from collections import defaultdict
class ResException(Exception):
pass
class Res(object):
def __init__(self, file):
# Every resource file begins with the string 'ITERES'
self._file = file
self._file.seek(0, os.SEEK_EN... | ali1234/iteres | iteres/res.py | res.py | py | 2,250 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "os.SEEK_END",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.SEEK_SET",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "struct.unpack",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "struct.unpack",
"... |
33710378084 | import base64
import os
def img_to_base64(image_bytes):
"""
:param image_bytes: 文件路径
:return: base64字符串
"""
with open(image_bytes, "rb") as fb:
img = fb.read()
base64_bytes = base64.b64encode(img)
img_suffix = os.path.splitext(image_bytes)[1].replace('.', '')
if im... | GavinHaydy/ruffian_test | ruffianTest/common/picture/picture_to_base64.py | picture_to_base64.py | py | 1,007 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "base64.b64encode",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
}
] |
40419888974 | from pathlib import Path
import re
from collections import deque
data_folder = Path(".").resolve()
reg = re.compile(r"(\d+) <-> (.+)")
def find_groups(comms):
groups = []
for i in range(len(comms)):
in_groups = []
for j in range(len(groups)):
for k in range(len(comms[i])):
... | eirikhoe/advent-of-code | 2017/12/sol.py | sol.py | py | 1,549 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pathlib.Path",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 5,
"usage_type": "call"
}
] |
31208091569 | import xlrd
import xlwt
from xlutils.copy import copy
import os
def get_file_and_rewrite(startpath):
for root, dirs, files in os.walk(startpath):
for dir in dirs:
for root, dirs, files in os.walk(startpath + "\\" + dir):
for file in files:
file_loc = root ... | comewithme1200/pythonMaibeo | test.py | test.py | py | 2,323 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.walk",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "xlrd.open_workbook",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "xlutils.copy.copy",
"line_numb... |
73938022115 | '''
Created on 25 abr. 2020
@author: jesus.fernandez
'''
import urllib3
import pandas as pd
class WorldCovidDataCrawler(object):
'''
classdocs
'''
#Declaración de constantes
URL_BASE = 'https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_... | jfernandezrodriguez01234/TFM_jfernandezrodriguez01234 | src/crawlers/medical/WorldCovidDataCrawler.py | WorldCovidDataCrawler.py | py | 3,058 | python | pt | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "common.SQLUtil.SQLUti... |
30550400117 | def isTrue(obj, attr) :
return hasattr(obj, attr) and getattr(obj, attr)
import numpy as np
import torch
def get_sorting_index_with_noise_from_lengths(lengths, noise_frac) :
if noise_frac > 0 :
noisy_lengths = [x + np.random.randint(np.floor(-x*noise_frac), np.ceil(x*noise_frac)) for x in lengths]
... | lijiehu95/SEAT | attention/model/modelUtils.py | modelUtils.py | py | 6,648 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.random.randint",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numpy.floor",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.ceil",
"lin... |
19585411357 |
# https://leetcode.com/problems/plus-one/
# 66. Plus One
# You are given a large integer represented as an integer array digits,
# where each digits[i] is the ith digit of the integer.
# The digits are ordered from most significant to least significant in left-to-right order.
# The large integer does not contain any l... | kj-grogu/COEN-279-DAA | src/PlusOne.py | PlusOne.py | py | 1,741 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.List",
"line_number": 41,
"usage_type": "name"
}
] |
73111772195 | # -*- coding: utf-8 -*-
# __author__ = 'XingHuan'
# 4/15/2018
import logging
import inspect
import functools
import time
log_level = logging.DEBUG
log_formats = [
'%(levelname)s:%(name)s: %(asctime)s %(pathname)s[line:%(lineno)d] %(funcName)s %(message)s',
'%(levelname)s:%(name)s: %(asctime)s %(message)s',
]
... | ZackBinHill/Sins | sins/utils/log.py | log.py | py | 1,436 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.DEBUG",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "logging.Formatter",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "logging.Stream... |
41798632502 | #!/usr/bin/python3
from argparse import ArgumentParser
import logging
import mympd
import myhttp
import socket
import sys
import threading
import time
from tkinter import *
import datetime
import random
import parser
from math import cos
from math import sin
from math import tan
import os
import vlc
import platform
... | LumiH/Adaptive-Informative-Real-Time-Streaming | stream.py | stream.py | py | 17,754 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "time.sleep",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "myhttp.HTTPResponse.parse",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "myhttp.HTTPResponse",... |
74473013793 | import tkinter as tk
from tkinter import ttk
from tkinter import filedialog
from ttkthemes import ThemedStyle
from tkinter import font
from win32 import win32api
from win32 import win32print
import os
import sys
import matplotlib.font_manager as fm
root = tk.Tk()
root.withdraw()
style = ThemedStyle(root)
... | jeerprank/Tisknu | MTisknu.py | MTisknu.py | py | 3,141 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tkinter.Tk",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "ttkthemes.ThemedStyle",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_... |
41927760490 | import pymem
import pymem.process
import psutil
import os
import time
class PymongUS:
def __init__(self):
self.dwspeed = 0x00DA3C30
self.imposter =0x00DA5A84
self.pm = pymem.Pymem('Among Us.exe')
def makemeImposter(self):
try:
client = pymem.process.module_from_name(... | xsphereboi/Pymong-US | app.py | app.py | py | 3,463 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pymem.Pymem",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pymem.process.module_from_name",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pymem.process",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pymem.p... |
32185261146 | from copy import copy
from ldap3 import SUBTREE
from plugins.AD import PluginADScanBase
from utils.consts import AllPluginTypes
class PluginADDuplicateAccount(PluginADScanBase):
"""存在重复的账户"""
# 出现原因是不同用户登录不同域控同时添加同一账户,域控之间同步导致的,添加后有的账户只有"CNF"字段,有的账户有"CNF"的同时
# 在SAMAccountName里也有"$DUPLICATE-"字段
disp... | Amulab/CAudit | plugins/AD/Plugin_AD_Scan_1031.py | Plugin_AD_Scan_1031.py | py | 2,067 | python | en | code | 250 | github-code | 1 | [
{
"api_name": "plugins.AD.PluginADScanBase",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "utils.consts.AllPluginTypes.Scan",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "utils.consts.AllPluginTypes",
"line_number": 16,
"usage_type": "name"
... |
70749701793 | # replace Channel.save_measurement_locally:
from save_all_s4p.vna_monkeypatch import monkeypatch
monkeypatch()
# imports
from pathlib import Path
from save_all_s4p import get_timestamp
from rohdeschwarz.instruments.vna import Vna
# constants
PORTS = [1, 2, 3, 4]
TEN_SECONDS_MS = 10 * 1000
# data pat... | Terrabits/save_all_s4p | __main__.py | __main__.py | py | 1,454 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "save_all_s4p.vna_monkeypatch.monkeypatch",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "pathlib.Path.cwd",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": ... |
3839894470 | from django.shortcuts import render
import csv
import random
from .models import Cliente, Producto, Ventas
from django.core.mail import EmailMessage
from barcode.codex import Code128
from barcode.writer import ImageWriter
from reportlab.platypus import (SimpleDocTemplate, Image, Spacer,Table)
from reportlab.lib.pagesiz... | hrdax/Juan_MellaEV4 | JMNJEV4/views.py | views.py | py | 28,128 | python | es | code | 0 | github-code | 1 | [
{
"api_name": "django.shortcuts.render",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "models.Producto.objects.get",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "models.Producto.objects",
"line_number": 25,
"usage_type": "attribute"
},
{
"... |
36537091858 | import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow import keras
from keras.models import Sequential
from keras.layers import Dense
X = np.array([[185.32, 12.69],
[259.92, 11.87],
[231.01, 14.41],
[175.37, 11.72],
[187.12, 14.13]])
Y = np.array([[1.],
[0.],... | dunkerbunker/Python-ML-AI | manual models/tensorflowTest.py | tensorflowTest.py | py | 2,413 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.array",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.min",
"line_number": 21,
... |
28437959160 | import os
import sys
import time
import json
import asyncio
import logging
import re
from opencensus.ext.azure.log_exporter import AzureLogHandler
from azure.iot.device import Message
from azure.iot.device.aio import IoTHubModuleClient
from datetime import datetime, timedelta
TWIN_CALLBACKS = 0
OBJECT_TAGS = ['truck'... | liupeirong/MLOpsManufacturing | samples/edge-object-detection/edge/modules/objectDetectionBusinessLogic/main.py | main.py | py | 9,013 | python | en | code | 21 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
... |
32163590327 | import os
import ast
import argparse
import functools
import subprocess
import collections
from .visitor import Visitor
PREAMBLE = r"""
\documentclass[a4paper,oneside,article]{memoir}
\usepackage[T1]{fontenc}
\usepackage[noend]{algorithmic}
\usepackage{algorithm}
\usepackage{amsmath,amssymb}
\begin{document}
""".stri... | Mortal/algorithmicpy | algorithmic/main.py | main.py | py | 2,935 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "ast.parse",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.path",
"lin... |
71413888673 | # @Author : kane.zhu
# @Time : 2022/12/2 16:21
# @Software: PyCharm
# @Description:
from celery.schedules import crontab
beat_schedule = {
'add-every-30-seconds': {
'task': 'celery.reverse_schedule',
'schedule': crontab(minute="*"),
},
}
| canpowerzhu/flask-demo | utils/kane_celery/cele_schedule.py | cele_schedule.py | py | 268 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "celery.schedules.crontab",
"line_number": 11,
"usage_type": "call"
}
] |
5876622591 | import numpy as np
import math
import random
import sys
import itertools
from pathlib import Path
home = str(Path.home())
import sys
rankability_path = "%s/rankability_toolbox_dev"%home
if rankability_path not in sys.path:
sys.path.insert(0,rankability_path)
import pyrankability
from pyrankability.rank import solve... | IGARDS/sensitivity_study | src/sensitivity_tests.py | sensitivity_tests.py | py | 28,780 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "pathlib.Path.home",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "sys.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "sys.path.insert",
"lin... |
10924450539 | # -*- coding:utf-8 -*-
import logging.config
import re
from bs4 import BeautifulSoup
from utils import spider_utils
logging.config.fileConfig('log.ini')
file_logger = logging.getLogger(name="fileLogger")
def get_dianping_url(url):
"""
获取大众点评数据 url
:return:
"""
# url = "http://www.dianping.com/se... | logonmy/spider-mz | spider_producer/dianping_spider.py | dianping_spider.py | py | 12,103 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.config.config.fileConfig",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.config.config",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "logging.config",
"line_number": 9,
"usage_type": "name"
},
{
"api_name"... |
34280625886 | # Title: Face detection using Python and OpenCV.
# Author: @CodeProgrammer "On Telegram" || @PythonSy "On Instagram".
"""
you need to install OpenCV by using this command in the terminal:
pip install opencv-python
for more codes you can visit our channel on Telegram: @CodeProgrammer
"""
import cv2
"""
load t... | hack-parthsharma/Useless-Python-Codes | Face Detection.py | Face Detection.py | py | 914 | python | en | code | 5 | github-code | 1 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_... |
23097599098 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('academy', '0005_aluno_pessoa'),
]
operations = [
migrations.CreateModel(
name='Professor',
fields=[
... | rodrigolucianocosta/Relationship- | relationship/academy/migrations/0006_professor.py | 0006_professor.py | py | 818 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.CreateModel",
"line_number": 14,
"usage_type": "call"
},
... |
32066594400 | from flask import Flask
from twilio.twiml.voice_response import VoiceResponse
app = Flask(__name__)
@app.route("/answer", methods=['GET', 'POST'])
def answer_call():
"""Respond to incoming phone calls with a brief message."""
# Start our TwiML response
resp = VoiceResponse()
# Read a mes... | marzookh/twilio | answer_phone.py | answer_phone.py | py | 562 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "twilio.twiml.voice_response.VoiceResponse",
"line_number": 11,
"usage_type": "call"
}
] |
7161385428 | import unittest
from itertools import chain
import torch
from pytorch_metric_learning.distances import CosineSimilarity
from pytorch_metric_learning.losses import CentroidTripletLoss
from pytorch_metric_learning.reducers import MeanReducer
from .. import TEST_DEVICE, TEST_DTYPES
from ..zzz_testing_utils.testing_util... | jwlee3746/metric_learning_pytorch | pytorch-metric-learning/tests/losses/test_centroid_triplet_loss.py | test_centroid_triplet_loss.py | py | 9,166 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "torch.nn.functional.normalize",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "unittest.TestCase",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "py... |
25953580166 | ############### Blackjack Project #####################
############### Blackjack House Rules #####################
## The deck is unlimited in size.
## There are no jokers.
## The Jack/Queen/King all count as 10.
## The the Ace can count as 11 or 1.
## Use the following list as the deck of cards:
## The cards in ... | navil-noor/Python | Days-of-Python/11-blackjack/main.py | main.py | py | 3,428 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "random.choice",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "art.logo",
"line_number": 61,
"usage_type": "argument"
},
{
"api_name": "replit.clear",
"line_number": 100,
"usage_type": "call"
}
] |
26632544137 | from docx import Document
from docx.shared import Pt
from openpyxl import load_workbook
import os
nome_arquivo = "Alunos.xlsx"
planilhaAlunos = load_workbook(nome_arquivo)
sheet = planilhaAlunos['Nomes']
for L in range(2, len(sheet['A']) + 1):
arquivo = Document('Certificado1.docx')
estilo = arquivo.styles[... | marques-matheus/Python | Word/Gerando_certificado_em_massa.py | Gerando_certificado_em_massa.py | py | 706 | python | pt | code | 0 | github-code | 1 | [
{
"api_name": "openpyxl.load_workbook",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "docx.Document",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "docx.shared.Pt",
"line_number": 23,
"usage_type": "call"
}
] |
4603867834 | import pygame
import math
car_img = pygame.image.load('pic/car_img.png')
class Window:
def __init__(self, win_w, win_h):
self.win_w = win_w
self.win_h = win_h
self.win = pygame.display.set_mode((win_w, win_h))
self.clock = pygame.time.Clock()
self.speed = 30
def ... | march-o/neat-car-ai | window.py | window.py | py | 3,122 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pygame.image.load",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pygame.disp... |
6564899352 | import argparse
import time, datetime
import os
import os.path as osp
import logging
from baselines import logger, bench
from baselines.common.misc_util import (
set_global_seeds,
boolean_flag,
)
import baselines.torcs_ddpg.training as training
from baselines.torcs_ddpg.models import Actor, Critic
from baseline... | dosssman/TorcsRLILHybrid | baselines/torcs_ddpg/main.py | main.py | py | 7,196 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "mpi4py.MPI.COMM_WORLD.Get_rank",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "mpi4py.MPI.COMM_WORLD",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "mpi4py.MPI",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "... |
24285392707 | import sys
import logging
sys.path.append('../../../../')
from flask import current_app, request
from flask_restful import Resource, reqparse
from spiders.selenium_spider import bloomberg
parser = reqparse.RequestParser()
parser.add_argument('spider')
parser.add_argument('action')
def test():
print('testing')
... | kingking888/news_plus | web/backend/news/apps/jobs.py | jobs.py | py | 2,136 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "flask_restful.reqparse.RequestParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flas... |
10382864943 | from socket import socket, AF_INET, SOCK_DGRAM
import CommTypes_pb2 as pb
import time
import datetime
import numpy as np
def recvSSLMessage(udp_sock):
msg = pb.protoMotorsDataSSL()
# multiple messages are received and accumulated on buffer during vision processing
# so read until buffer socket ... | jgocm/proto-motors-data-collect | src/runMotorsCollectFromSSLSpeeds.py | runMotorsCollectFromSSLSpeeds.py | py | 3,530 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "CommTypes_pb2.protoMotorsDataSSL",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "CommTypes_pb2.protoMotorsPWMSSL",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "socket.socket",
"line_number": 39,
"usage_type": "call"
},
{
"api... |
41032471906 | import yaml
from aws_cdk import Aws, CfnOutput, Duration, Size, Stack
from aws_cdk import aws_events as events
from aws_cdk import aws_events_targets as targets
from aws_cdk import aws_iam as iam
from aws_cdk import aws_s3 as s3
from aws_cdk import aws_sns as sns
from constructs import Construct
class ProducerStack(S... | awsdocs/aws-doc-sdk-examples | .tools/test/eventbridge_rule_with_sns_fanout/producer_stack/producer_stack.py | producer_stack.py | py | 4,722 | python | en | code | 8,378 | github-code | 1 | [
{
"api_name": "aws_cdk.Stack",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "constructs.Construct",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "yaml.safe_load",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "aws_cdk.aws_sns.Top... |
125319284 | import constants
import time
import datetime
import os
import pandas as pd
import py_parser
import numpy as np
import label_perturbation_main
def giveTimeStamp():
tsObj = time.time()
strToret = datetime.datetime.fromtimestamp(tsObj).strftime(constants.TIME_FORMAT)
return strToret
def generateUnitTest(a... | jem0101/BigSwag-SQA2022-AUBURN | TestOrchestrator4ML-main/resources/Code/generation/main.py | main.py | py | 3,660 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "time.time",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.fromtimestamp",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "cons... |
18455753919 | # -*- coding: utf-8 -*-
"""
Created on Thu Dec 21 13:14:50 2017
@author: B
"""
import sys
sys.path.append('/root/asar2018psc/training/Models/')
import numpy as np
np.random.seed(123)
import argparse
import Models , PageLoadBatches
from keras.callbacks import ModelCheckpoint
from keras import optimizers
i... | beratkurar/asar2018-page-segmentation-competition | training/lightpagetrainf8.py | lightpagetrainf8.py | py | 3,903 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.seed",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"lin... |
35121463315 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import cherrypy
import Installation
import Equipement
import Activite
import database as bd
class WebManager(object):
@cherrypy.expose
def index(self):
return '''
<html><body>
<h1> Installations sportives des Pays de la loire </h1>
<input type="button" name=... | wlegendre5/TDPython | CherryMain.py | CherryMain.py | py | 1,765 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cherrypy.expose",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "database.Database",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "database.read_Installations",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "ch... |
9417593237 | from django.urls import path
from api.views import (
TaskAPIView,
AlgorithmTestAPIView,
TestAPIView,
WantedPageDataAPIView,
KreditJobAPIView,
GoogleTrendsAPIView,
)
urlpatterns = [
path('test/', TestAPIView.as_view(), name='test'),
path('algo_test/', AlgorithmTestAPIView.as_view(), nam... | veggieavocado/Gobble-v.1 | api/urls.py | urls.py | py | 647 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "api.views.TestAPIView.as_view",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "api.views.TestAPIView",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "... |
19817687474 | # -*- coding: utf-8 -*-
import json
from classytags.core import Tag, Options
from cms.utils.encoder import SafeJSONEncoder
from django import template
from django.utils.safestring import mark_safe
register = template.Library()
@register.filter('json')
def json_filter(value):
"""
Returns the JSON representat... | farhan711/DjangoCMS | cms/templatetags/cms_js_tags.py | cms_js_tags.py | py | 1,039 | python | en | code | 7 | github-code | 1 | [
{
"api_name": "django.template.Library",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.utils.safestring.mark_safe",
"line_number": 17,
"usage_type": "call"
},
{
"api_name"... |
2797548973 | #!/usr/bin/env python3
CLOUD = False
try:
from polyinterface import Controller,LOGGER
except ImportError:
from pgc_interface import Controller,LOGGER
try:
import polyinterface
except ImportError:
import pgc_interface as polyinterface
CLOUD = True
import sys
import json
import time
import http.cli... | Einstein42/udi-ecobee-poly | nodes/Controller.py | Controller.py | py | 49,710 | python | en | code | 5 | github-code | 1 | [
{
"api_name": "pgc_interface.LOGGER",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "pgc_interface.LOGGER.info",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "pgc_interface.LOGGER",
"line_number": 52,
"usage_type": "name"
},
{
"api_name": "p... |
42015858077 |
from pathlib import Path
HOME_DIR = Path.home()
BASE_DIR = HOME_DIR / 'covid_phylo_data'
BASE_DIR.mkdir(exist_ok=True)
CACHE_DIR = BASE_DIR / 'cache'
RAW_SEQUENCE_SHELVE_FNAME = 'raw_seqs.shelve'
| JoseBlanca/covid_phylo | src/config.py | config.py | py | 201 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "pathlib.Path.home",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 4,
"usage_type": "name"
}
] |
10450147143 | """ Simple youtube downloader best resolution video by URL """
from pytube import YouTube
def print_progress_bar(file_size: int, bytes_remaining: int) -> None:
""" Visualizes the download progress """
# rows, columns = os.popen('stty size', 'r').read().split()
fill_empty = ' '
fill_full = '#'
fill... | darkus007/youtube_downloader | you_tu_be_best_res.py | you_tu_be_best_res.py | py | 2,054 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pytube.YouTube",
"line_number": 38,
"usage_type": "call"
}
] |
3141982124 | import math
import numpy as np
import pandas as pd
from tqdm import tqdm
from scipy import sparse
from sklearn.decomposition import TruncatedSVD
from tools.utils import normalize_adjacency
from tools.Config import Config
class GraRep(object):
"""
GraRep Model Object.
A sparsity aware implementation of GraRe... | PiggyGaGa/FBNE-PU | Baselines/GraRep.py | GraRep.py | py | 3,500 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "tools.utils.normalize_adjacency",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "tools.Config.Config",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "scipy.sparse.coo_matrix",
"line_number": 49,
"usage_type": "call"
},
{
"api_n... |
42332194005 | import pandas as pd
import numpy as np
import os
import random
import pywt
import pickle
from tqdm import tqdm
import torch
from random import sample
from dataloaders.utils import Normalizer,components_selection_one_signal,mag_3_signals,PrepareWavelets,FiltersExtention
from sklearn.utils import class_weight
from skimag... | teco-kit/ISWC22-HAR | dataloaders/dataloader_base.py | dataloader_base.py | py | 28,398 | python | en | code | 11 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 56,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
70979189794 | from pymongo import MongoClient
from celery import Celery
import redis
from task_config import CACHE_REDIS_HOST
from task_config import CELERY_BROKER_URL
from task_config import CELERY_RESULT_BACKEND
from task_config import MONGODB_URL
#------- redis---------#
class RedisWrapper:
def __init__(self):
self.... | ThatMrWayne/Macros-Eat | tasks/task.py | task.py | py | 5,512 | python | zh | code | 1 | github-code | 1 | [
{
"api_name": "redis.Redis",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "task_config.CACHE_REDIS_HOST",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "task_con... |
44396101883 | #
# @lc app=leetcode id=23 lang=python3
#
# [23] Merge k Sorted Lists
#
from typing import List, Optional
# @lc code=start
# Definition for singly-linked list.
class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
class Solution:
def mergeKLists(self, lists: Li... | lamdalamda/.leetcode | 23.merge-k-sorted-lists.py | 23.merge-k-sorted-lists.py | py | 4,377 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.List",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_n... |
39412489351 | from django.contrib import admin
from .models import NewsItem, Comment
class CommentAdmin(admin.ModelAdmin):
list_display = ['name_author', 'news', 'text', 'check_admin', 'show_piece_text']
list_filter = ['name_author']
search_fields = ['name_author']
actions = ['switch_to_status_deleted']
def s... | glebserg/portfolio | Test/DjangoNewsItems/news/app_news/admin.py | admin.py | py | 1,666 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.TabularInline",
"line_number": 27,
"usage_type": "attribute"... |
24603216306 | # -*- coding: utf-8 -*-
"""
Created on Fri Mar 29 17:52:45 2019
@author: qinzhen
"""
import numpy as np
import matplotlib.pyplot as plt
def readData(images_file, labels_file):
x = np.loadtxt(images_file, delimiter=',')
y = np.loadtxt(labels_file, delimiter=',')
return x, y
def softmax(x):
"""
Co... | Doraemonzzz/CS229 | 17autumn/ps4/q1/my_nn_starter.py | my_nn_starter.py | py | 5,288 | python | en | code | 14 | github-code | 1 | [
{
"api_name": "numpy.loadtxt",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": ... |
35886830090 | from __future__ import annotations
from copy import deepcopy
from sys import stdout
from os import get_terminal_size
from typing import Generator, overload
from contui.style import Style
__all__ = ["Buffer"]
def _write(content: str):
stdout.write(content)
stdout.flush()
class Pixel:
"""A unicode symbol... | Tired-Fox/contui | contui/buffer.py | buffer.py | py | 6,823 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.stdout.write",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "sys.stdout.flush",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_n... |
27150385369 | import sklearn.datasets
import pandas as pd
from sklearn.model_selection import train_test_split
import numpy as np
from sklearn.metrics import accuracy_score
breast_cancer = sklearn.datasets.load_breast_cancer()
breast_cancer_DF = pd.DataFrame( breast_cancer.data, columns = breast_cancer.feature_names)
breast_cancer_... | abhishekv362/Neural-Networks | MP Neuron/Implementation.py | Implementation.py | py | 1,180 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sklearn.datasets.datasets.load_breast_cancer",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets.datasets",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sklearn.datasets",
"line_number": 7,
"usage_type": "name"
},
... |
17440181992 | from time import process_time
from collections import defaultdict
from functools import lru_cache
def solve(data):
positions = [int(data[0].split()[-1]), int(data[1].split()[-1])]
score = [0, 0]
die = 1
player = 0
total_rolls = 0
while max(score) < 1000:
roll = 0
for i in range... | Florik3ks/AOC2021 | 21/21.py | 21.py | py | 3,479 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "collections.defaultdict",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "time.process_time",
"line_number": 104,
"usage_type": "call"
},
{
"api_name": "time.process_time",
"line_number": 106,
"usage_type": "call"
},
{
"api_name": "time.pr... |
727185089 | import numpy as np
from autoencoder import Autoencoder
from sklearn import datasets
P=Autoencoder(4,2)
X, Y = datasets.make_classification(
n_features=4,
n_classes=4,
n_samples=100,
n_redundant=0,
n_clusters_per_class=1
)
P.Train(X,2000)
| dani2442/DeepLearning | ShallowNN/Autoencoder/autodencoder_test.py | autodencoder_test.py | py | 264 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "autoencoder.Autoencoder",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets.make_classification",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets",
"line_number": 7,
"usage_type": "name"
}
] |
25297763622 | #!/usr/bin/env python
# coding=utf-8
from __future__ import print_function
import json
import os
import re
import sys
import time
import requests
try:
import config
except ImportError:
print(('Please see config.py.example, update the '
'values and rename it to config.py'))
sys.exit(1)
APIURL ... | linaspurinis/trakt.plex.scripts | lib/trakt.py | trakt.py | py | 5,971 | python | en | code | 31 | github-code | 1 | [
{
"api_name": "sys.exit",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_num... |
7168933467 | #!/usr/bin/env python
# coding: utf-8
# In[64]:
import pandas as pd
import numpy as np
from sklearn.feature_extraction.text import CountVectorizer
from nltk.stem import PorterStemmer
from nltk.tokenize import sent_tokenize, word_tokenize
from sklearn.pipeline import FeatureUnion
from nltk.corpus import stopwords
im... | AdroitProgrammer/TechFestival-Hackathon | main.py | main.py | py | 3,167 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "numpy.sum",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.dot... |
20190419338 | from mrjob.job import MRJob
from mrjob.step import MRStep
from datetime import datetime
from datetime import timedelta
# We extend the MRJob class
# This includes our definition of map and reduce functions
class MRAvgTripTime(MRJob):
def mapper(self, _, line):
row = line.split(',')
if len(row) >... | Vishal4295/Map-Reduce-Case-Study | mrtask_d.py | mrtask_d.py | py | 1,327 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "mrjob.job.MRJob",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "datetime... |
163086800 | import cv2
import dlib
import numpy as np
from mtcnn import MTCNN
# Inicialización de MTCNN y dlib
detector = MTCNN()
predictor = dlib.shape_predictor("shape_predictor_68_face_landmarks.dat")
with open("coco.names", "r") as f:
classes = [line.strip() for line in f.readlines()]
colors = np.random.uniform(0, 255, s... | SergioAyalaHernandez/detectorRostros | detectorObjetos2.py | detectorObjetos2.py | py | 2,924 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "mtcnn.MTCNN",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "dlib.shape_predictor",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.random.uniform",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.random",
... |
18690098738 | """Contains classes and utilities related to FICA taxes."""
from ...earnings import EarningsTaxPolicy, EarningsType, TaxCategory
from ...money import Money
from ..composite import CompositeTax
from ..bracket import Bracket, BracketTax
from ..flat import FlatTax
from .data import (
ADDITIONAL_MEDICARE_TAX_RATE,
... | thomasebsmith/finances | src/finances/tax/federal/fica.py | fica.py | py | 2,571 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flat.FlatTax",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "data.WAGE_BASE_LIMIT_BY_YEAR",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "data.SOCIAL_SECURITY_TAX_RATE",
"line_number": 33,
"usage_type": "argument"
},
{
"api_n... |
4536994522 | import scrapy
class CompaniesSpider(scrapy.Spider):
name = "companies"
def start_requests(self):
urls = [
'https://www.nse.co.ke/market-statistics.html'
]
for url in urls:
yield scrapy.Request(url=url, callback=self.parse)
def parse(self, response):
... | wcyn/nse | nse/spiders/companies_spider.py | companies_spider.py | py | 808 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "scrapy.Spider",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "scrapy.Request",
"line_number": 12,
"usage_type": "call"
}
] |
26459808577 | import scipy as sp
import numpy as np
from typing import Literal, Tuple
def cossin(Q: np.ndarray, shape: Tuple[int, int], ret: Literal['full', 'blocks', 'minimal'] = 'full'):
p, q = shape
m, _ = Q.shape
m1, m2 = m - p, m - q
(U_1, U_2), theta, (V_1t, V_2t) = sp.linalg.cossin(Q, p=p, q=q, separate=... | sfcaracciolo/cossin_wrapper | src/cossin_wrapper/core.py | core.py | py | 2,991 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.ndarray",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "typing.Tuple",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "typing.Literal",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "scipy.linalg.cossin",
... |
18403269330 | from flask import Flask, render_template, request, redirect, session,flash
from pymongo import MongoClient
from bson.objectid import ObjectId
from user_database import user_coll , post_coll
import datetime
app = Flask(__name__)
app.secret_key = "3423"
@app.route('/')
def browser():
return render_template('login.ht... | longvd336/First-project | app.py | app.py | py | 9,196 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "user_database.post_coll.find_one",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "use... |
41284570814 | from keras.preprocessing.text import Tokenizer
from keras.models import Sequential
from keras.layers import Dense, LSTM, Dropout, Merge, Input, concatenate, Lambda
from keras.layers.embeddings import Embedding
from keras.models import Model
from keras.preprocessing import sequence
from keras.utils import np_utils
from ... | renhaocui/activityExtractor | trainFullModel.py | trainFullModel.py | py | 22,297 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "sys.setdefaultencoding",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "numpy.full",
"line_n... |
15224383350 | # coding=utf-8
from __future__ import absolute_import
import logging.config
from os.path import join, realpath, abspath, dirname as up
from django.utils.text import slugify
class LoggingSettings(object):
"""
Drop in replacement of Django's Logging Configuration:
Sends INFO level or higher to the console ... | techoutlooks/django-quickconfigs | quickconfigs/config/logging.py | logging.py | py | 3,509 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "django.utils.text.slugify",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "logging.config.config.dictConfig",
"line_number": 92,
"usage_type": "call"
},
{
"api_name"... |
70506253475 | #!/usr/bin/env python
from api_types import DEFAULT_DATASET
from flask import Flask, render_template, request, redirect, url_for
import api
import dataset
import filters
app = Flask(__name__, static_folder="public", template_folder="views")
app.jinja_env.filters["diff_classname"] = filters.diff_classname_filter
... | OrcaCollective/1-312-hows-my-driving | src/app.py | app.py | py | 5,101 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "filters.diff_classname_filter",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "flask.redirect",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "flask.u... |
24710122363 | from typing import List, Tuple
STUDENT_START = -1
STUDENT_END = 1
def get_students_count(events: List[Tuple[int, int, int]], students_count: int) -> Tuple[int, List[int]]:
"""
Функция которая вычисляет необходимое количество билетов и вариант раздачи билетов.
:param events: список событий в котором ука... | OkhotnikovFN/Yandex-Algorithms | trainings_1.0/hw_7/task_c/c.py | c.py | py | 2,007 | python | ru | code | 1 | github-code | 1 | [
{
"api_name": "typing.List",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 8,
"usage_type": "name"
}
] |
34308053041 | from random import randint
import pygame
class Colone:
def __init__(self):
self.x = 10
self.vitesse = 3
self.trou = randint(1,399)
self.taille_trou = 100
self.rectUp = pygame.Rect((round(500*(self.x/10)), 0), (50, self.trou))
self.rectDown = pygame.Rect((round(500*(s... | SamTiq/fappy-bird-algog-n- | colone.py | colone.py | py | 407 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "random.randint",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.Rect",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygame.Rect",
"line_number": 11,
"usage_type": "call"
}
] |
27736665489 | from typing import List, Tuple, Optional, Union
from pathlib import Path
import pandas as pd
import numpy as np
import fire
import ta
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.pipeline import make_pipeline, Pipeline
from sklearn.preprocessing import FunctionTransformer
from src.paths impor... | Paulescu/hands-on-train-and-deploy-ml | src/preprocessing.py | preprocessing.py | py | 5,277 | python | en | code | 505 | github-code | 1 | [
{
"api_name": "src.logger.get_console_logger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "typing.Opt... |
4345568828 | import time
import pygame
import threading
from opening import screen
# atak = 'first'
from קבועים import rto, xx
atak_1 = [100, 300, True]
atak_2 = [200,200,True]
def bose_atak(atak,a,x,y,live ):
time = pygame.time.get_ticks()
if time > 5000 and time < 7000:
image = pygame.image.load(rto)
... | noamelul1234567890/DIYproject | bose_atak.py | bose_atak.py | py | 860 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pygame.time.get_ticks",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pygame.time",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.load",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "קבועים.rto",... |
37449295163 | import sys
import json
from datetime import datetime
# Import the necessary methods from "twitter" library
from twitter import Twitter, OAuth, TwitterHTTPError, TwitterStream
if sys.version_info[0] < 3:
raise Exception("Python 3 is required to run this script")
try:
with open('config_json.txt') as config_fil... | prairiewest/simple-tweet-scraping | tweets.py | tweets.py | py | 5,774 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.version_info",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "twitter.OAuth",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "twitter.Twitter",
"l... |
32029539658 | import torch.nn as nn
import torch
import torch.nn.functional as F
from src.models.dropblock import DropBlock
from torch.autograd import Variable
import math
import numpy as np
import torch.nn.functional as F
from torch.nn.utils.weight_norm import WeightNorm
from collections import defaultdict
class ConvBlock(nn.Mod... | OscarcarLi/meta-analysis-classification | src/models/shallow_conv.py | shallow_conv.py | py | 4,066 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"lin... |
22995621098 | import time
from pyspark.sql import SparkSession
from pyspark.sql import Window
from pyspark.sql.functions import col, to_timestamp, rank, desc
spark = (SparkSession
.builder
.appName("SparkEj1")
.getOrCreate())
csv_trade = "trade_details.csv"
csv_trade_snap = "trade_details_snapshot.csv"... | StefanoNapo/Big-Data-Bosonit | SparkEj1/SparkEj1.py | SparkEj1.py | py | 1,762 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pyspark.sql.SparkSession.builder.appName",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pyspark.sql.SparkSession",
"line_number": 7,
"usage_type": "... |
6749597437 | from tool_share_app import models, forms
from django.http import HttpResponseRedirect
from django.contrib import messages
from django.shortcuts import render
from tool_share_app.forms.date_form import RequestDate, ReturnDate
from tool_share_app.views import add_context_extra_data
from django.views.decorators.csrf... | ibrr1/ToolShare | ToolShareVE/toolshare/toolshare/tool_share_app/views/tool_request.py | tool_request.py | py | 6,095 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.http.HttpResponseRedirect",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "tool_share_app.models.Tool.objects.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "tool_share_app.models.Tool",
"line_number": 23,
"usage_type": "at... |
8556970875 | from rest_framework.views import APIView
from rest_framework.response import Response
import math
class PostProcView(APIView):
def largest_remainder(self, options, q, points, zero_votes):
out = []
e = []
r = []
if not zero_votes:
if len(options) == 0:
... | josvilgar1/decide-defensa | decide/postproc/views.py | views.py | py | 5,820 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "rest_framework.views.APIView",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "math.floor",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "rest_framework.response.Response",
"line_number": 209,
"usage_type": "call"
}
] |
4883070999 | # BAP 2019
# Author: Axel Claeijs
# This script uses the trained network to make predictions
#-----------------------------------------------------------
# IMPORTS
#-----------------------------------------------------------
import sys
import cv2
import math
import pptk
import numpy as np
import matplotlib.pyplot as ... | axelclaeijs/PointCloud_Costmap_NN | Use_WM.py | Use_WM.py | py | 5,144 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.random.randint",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "scipy.ndimage.interpolation.rotate",
"line_number": 33,
"usage_type": "call"
},
{
"api_nam... |
11531556819 | import sqlite3
from aiocryptopay import AioCryptoPay, Networks
from config import cryptobot_test_net, cryptobot_main_net
from database.db_keys import user_table, k_user_id, k_locate, k_login, k_key, k_addres
cp = AioCryptoPay(token=cryptobot_main_net, network=Networks.MAIN_NET)
sql_create_users_table = f""" CREATE ... | stifhaks/testbot | database/db_helper.py | db_helper.py | py | 8,967 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "aiocryptopay.AioCryptoPay",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "config.cryptobot_main_net",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "aiocryptopay.Networks.MAIN_NET",
"line_number": 6,
"usage_type": "attribute"
},
{
... |
9946805104 | # -*- coding: utf-8 -*-
import subprocess
import os
import sys
import socket
import logging
import dns.resolver #pip install dnspython
dominio = raw_input(str('Digite o nome do seu dominio: '))
# Path's
amavis_novalistadeverificacao = '/tmp/amavis_novalistadeverificacao'
amavis_novalistadeverificacaoip = '/tmp/amavi... | danieljones0028/addAmavisBlacklistZimbra | addBlacklist.py | addBlacklist.py | py | 8,545 | python | pt | code | 1 | github-code | 1 | [
{
"api_name": "os.path.exists",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "subprocess.call",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"lin... |
8020600920 | import random
from PyQt6.QtWidgets import QPushButton, QApplication, QMainWindow, QWidget, QGridLayout, QLabel
from PyQt6.QtGui import QAction, QIcon
from PyQt6.QtMultimedia import QSoundEffect
from PyQt6.QtCore import QSize, Qt, QCoreApplication, QPoint, QPropertyAnimation, QUrl
from PyQt6 import QtCore
class MainWin... | ArthurDubovik/Minesweeper | Minisweeper_Qt6.py | Minisweeper_Qt6.py | py | 15,854 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PyQt6.QtWidgets.QMainWindow",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "PyQt6.QtGui.QIcon",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "PyQt6.QtMultimedia.QSoundEffect",
"line_number": 15,
"usage_type": "call"
},
{
"api_... |
21065158917 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import os
import time
from absl import flags
import absl.logging as _logging # pylint: disable=unused-import
import tensorflow as tf
import imagenet_input
import resnet_model
from tensorflow.contr... | ProjectSidewalk/sidewalk-cv-assets19 | old/tf_resnet_tutorial/tpu/models/experimental/resnet_bfloat16/resnet_main.py | resnet_main.py | py | 18,959 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "absl.flags.FLAGS",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "absl.flags",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "absl.flags.DEFINE_bool",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "absl.flags",
... |
7564949893 | import numpy as np
from lime import lime_tabular
from ...base import Explainer
class LimeExplainer(Explainer):
def __init__(self, train_ds, labels, *args, meta_prefix=None, **kwargs) -> None:
super().__init__(*args, meta_prefix=meta_prefix, **kwargs)
data = np.array([item["item"] for item in tra... | Oxid15/xai-benchmark | xaib/explainers/feature_importance/lime_explainer.py | lime_explainer.py | py | 1,215 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "base.Explainer",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "lime.lime_tabular.LimeTabularExplainer",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "lime... |
21343589977 | import sys
import time
import traceback
import discord
from os import getenv
from discord import Game, File
from discord.ext import commands
from discord.utils import get
import logging
import re
from urllib.parse import urlparse
from collections import defaultdict
from sqlalchemy import create_engine, func, update, sq... | skydemmon/registerbotv3 | registerbot.py | registerbot.py | py | 15,418 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "discord.Intents.default",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "discord.Intents",
"line_number": 80,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands.Bot",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": ... |
71505625634 | import cv2 as cv
import numpy as np
import matplotlib.pyplot as plt
img = cv.imread('tower.jpg', cv.IMREAD_GRAYSCALE)
img_data = []
rows, cols = img.shape
img_data.append(str(rows%256))
img_data.append(str(rows//256))
img_data.append(str(cols%256))
img_data.append(str(cols//256))
for row in range(rows):
for col in... | Kaveesha-98/065-538-720-GNC | CPU/test_benches/textUpdate.py | textUpdate.py | py | 782 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cv2.imread",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_GRAYSCALE",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "cv2.imshow",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line... |
28134075243 | import tensorflow as tf
import numpy as np
import facenet
import math
import pickle
from scipy import misc
import sklearn.metrics as ms
from sklearn.svm import SVC
from sklearn.model_selection import train_test_split
from sklearn.model_selection import GridSearchCV
from sklearn.metrics import classificatio... | rjx678/facenet_demo | src/align/test_svc.py | test_svc.py | py | 25,114 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "tensorflow.GPUOptions",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.std",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.maximum",
"line_... |
33880439793 | from utils import timeit
@timeit
def get_data():
data = []
with open('input.txt') as input_file:
for line in input_file:
value = line.strip()
data.append(value)
return data
@timeit
def part_1(data):
key_pad = [[i*3+j+1 for j in range(3)] for i in range(3)]
x, y = ... | bdaene/advent-of-code | 2016/day02/solve.py | solve.py | py | 1,755 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "utils.timeit",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "utils.timeit",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "utils.timeit",
"line_number": 42,
"usage_type": "name"
}
] |
25472718455 | # this is a really slow network scanner.
# the idea is that it will slowly poke around and check who's up and whos not
# over the course of a while, ideally without being discoverd or tripping over
# network detection systems. who knows if it works
import socket as s
import netifaces
import arprequest
import argparse
... | BingoChado/NetMapper | scanner.py | scanner.py | py | 5,776 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "os.remove",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "netifaces.ifaddresses",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.