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
30488355483
# $ pip install tk # $ pip install speedtest-cli from tkinter import * import speedtest def speedCheck(): speed = speedtest.Speedtest() speed.get_servers() down = str(round(speed.download()/(10**6), 3)) + " Mbps" up = str(round(speed.upload()/(10**6), 3)) + " Mbps" label_Download.config(text=down)...
Fakher-Zaman/Python-Projects
Internet_Speed_Test.py
Internet_Speed_Test.py
py
1,405
python
en
code
2
github-code
21
[ { "api_name": "speedtest.Speedtest", "line_number": 8, "usage_type": "call" } ]
147463598
import sqlite3 import sys from csv import DictReader import os class SQLiteDB(): def __init__(self, dbname=':memory:'): print(dbname) self.conn=sqlite3.connect(dbname) def importFromCSV(self, csvfilename, tablename, separator=";"): with open(csvfilename, 'r') as fh: ...
worldbestpro/CodeAnalysis
scripts/depScripts/csv2sql.py
csv2sql.py
py
1,766
python
en
code
4
github-code
21
[ { "api_name": "sqlite3.connect", "line_number": 9, "usage_type": "call" }, { "api_name": "csv.DictReader", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 47, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_numb...
33837542767
from django.http import JsonResponse from rest_framework.decorators import api_view from app.models import Merchants, Products from app.api.lib import pagination @api_view(['GET']) def get_merchants(request, merchant_id=None): rtype = "/merchants" status = False message = "General Failure" data = [] ...
trisamsul/olshop
app/api/merchants.py
merchants.py
py
3,454
python
en
code
0
github-code
21
[ { "api_name": "app.models.Merchants.objects.filter", "line_number": 25, "usage_type": "call" }, { "api_name": "app.models.Merchants.objects", "line_number": 25, "usage_type": "attribute" }, { "api_name": "app.models.Merchants", "line_number": 25, "usage_type": "name" },...
23043264094
#!/usr/bin/env python from gettext import install import pandas as pd import numpy as np #install plotly import plotly #load VDJ data and create two arrays #Source – TCRB only clonotypes #Target – TCRA_TCRB clones (clone_id) #Just two vectors with the same order of gems def item_series(item, indexed=None): ...
simonestegenborg/KIR_project
sankey_plot.py
sankey_plot.py
py
4,852
python
en
code
0
github-code
21
[ { "api_name": "pandas.Series", "line_number": 28, "usage_type": "call" }, { "api_name": "pandas.Series", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 30, "usage_type": "call" }, { "api_name": "pandas.Series", "line_nu...
24073033752
import requests, os, configparser import pandas as pd import matplotlib.pyplot as plt import json from sqlalchemy import create_engine import psycopg2 as ps from airflow import DAG from airflow.operators.python import PythonOperator, BranchPythonOperator from airflow.operators.bash import BashOperator from ran...
oscar-dif/project1
data_req.py
data_req.py
py
3,950
python
en
code
0
github-code
21
[ { "api_name": "os.path.dirname", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 15, "usage_type": "call" }, { "api_name": "sqlalchemy.create_engin...
15088417435
import time import datetime import psutil _FINISH = False def create_file(name): file = open(name, "a") file.write( "=======================================================================================================================================================================================...
AlexandraFishman/ProcessScanner
ProcessCapturing.py
ProcessCapturing.py
py
2,756
python
en
code
0
github-code
21
[ { "api_name": "datetime.datetime.now", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 13, "usage_type": "attribute" }, { "api_name": "psutil.process_iter", "line_number": 51, "usage_type": "call" }, { "api_name": "psut...
73735849333
"""Utility functions """ import hashlib from typing import Any, List, Optional import awkward import dask_awkward import hist import numba import numpy from rich.progress import ( BarColumn, Column, Progress, ProgressColumn, Text, TextColumn, TimeElapsedColumn, TimeRemainingColumn, ) ...
CoffeaTeam/coffea
src/coffea/util.py
util.py
py
6,018
python
en
code
114
github-code
21
[ { "api_name": "lz4.frame.frame.open", "line_number": 39, "usage_type": "call" }, { "api_name": "lz4.frame.frame", "line_number": 39, "usage_type": "attribute" }, { "api_name": "lz4.frame", "line_number": 39, "usage_type": "name" }, { "api_name": "cloudpickle.load"...
9425574786
try: from tpu_mlir.python import * except ImportError: pass import numpy as np import os import sys import argparse import cv2 from tools.model_runner import mlir_inference, model_inference, onnx_inference from PIL import Image from math import sqrt, ceil import itertools import torch def vis(img, boxes, sco...
sophgo/tpu-mlir
python/samples/detect_retinaface.py
detect_retinaface.py
py
12,635
python
en
code
366
github-code
21
[ { "api_name": "cv2.FONT_HERSHEY_SIMPLEX", "line_number": 31, "usage_type": "attribute" }, { "api_name": "cv2.getTextSize", "line_number": 33, "usage_type": "call" }, { "api_name": "cv2.rectangle", "line_number": 34, "usage_type": "call" }, { "api_name": "cv2.recta...
17474530834
""" Name: activation_funcs.py Description: 3.2節で紹介された活性化関数をまとめておく. """ import numpy as np import matplotlib.pylab as plt def step_func(x): """ ステップ関数 """ return np.array(x>0, dtype=np.int) def sigmoid_func(x): """ シグモイド関数 """ return 1/(1 + np.exp(-x)) def relu(x): """ Rec...
maniizu/practice_DL
activation_funcs.py
activation_funcs.py
py
1,186
python
ja
code
0
github-code
21
[ { "api_name": "numpy.array", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.int", "line_number": 14, "usage_type": "attribute" }, { "api_name": "numpy.exp", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.maximum", "line_number...
42665703123
"""Latent Dirichlet Allocation Patrick Wang, 2021 """ from typing import List from gensim.corpora.dictionary import Dictionary from gensim.models import LdaModel import numpy as np def lda_gen(vocabulary: List[str], alpha: np.ndarray, beta: np.ndarray, xi: int) -> List[str]: ''' vocabulary: list of strings(...
hj151mids/LDATopicModeling
lda_test.py
lda_test.py
py
1,631
python
en
code
0
github-code
21
[ { "api_name": "typing.List", "line_number": 12, "usage_type": "name" }, { "api_name": "numpy.ndarray", "line_number": 12, "usage_type": "attribute" }, { "api_name": "numpy.random.dirichlet", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.random", ...
6502053110
from typing import Tuple, Dict, List, Optional, Any import numpy as np import logging from scipy import ndimage from pyobs.utils.focusseries.base import FocusSeries from pyobs.utils.curvefit import fit_hyperbola from pyobs.images import Image log = logging.getLogger(__name__) class ProjectionFocusSeries(FocusSeri...
pyobs/pyobs-core
pyobs/utils/focusseries/projection.py
projection.py
py
6,503
python
en
code
8
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "pyobs.utils.focusseries.base.FocusSeries", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 20, "usage_type": "name" }, { "api_na...
15603028067
from rest_framework import serializers from django.contrib.auth.models import User from rest_framework_simplejwt.serializers import TokenObtainPairSerializer from api.models import ( Admin, Person, Driver, VehicleOwner, Vehicle, Fine, ViolationType, Accident, Message, PoliceOffic...
NimeshRancha/TrafficTicketBackend-main
TrafficTicket/api/serializers.py
serializers.py
py
7,823
python
en
code
0
github-code
21
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 27, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 27, "usage_type": "name" }, { "api_name": "django.contrib.auth.models.User", "line_number": 29, "usage_ty...
19057639043
from socket import socket, AF_INET, SOCK_STREAM import logging from threading import Thread from utils import * logging.basicConfig(level=logging.DEBUG) class Client: def __init__(self, token, server_ip, server_port): self.token = token self.server_addr = (server_ip, server_port) self.skt...
h4m5t/Tropy
src/client.py
client.py
py
1,409
python
en
code
0
github-code
21
[ { "api_name": "logging.basicConfig", "line_number": 6, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 6, "usage_type": "attribute" }, { "api_name": "socket.socket", "line_number": 13, "usage_type": "call" }, { "api_name": "socket.AF_INET", ...
12410003359
import os import torch from HE2RNA_GAMIL_all_genes.models.model_RNAPath import RNAPath from utils.eval_utils import initiate_model import argparse import os import pandas as pd parser = argparse.ArgumentParser() parser.add_argument("--tissue_name", type=str, default=None) parser.add_argument("--tissue_code", type=str...
GlastonburyC/RNAPath
inference.py
inference.py
py
3,200
python
en
code
6
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 24, "usage_type": "call" }, { "api_name": "torch...
73034599413
from twisted.internet import defer from tests import unittest from mock import Mock, NonCallableMock from tests.utils import setup_test_homeserver from synapse.replication.resource import ReplicationResource class BaseSlavedStoreTestCase(unittest.TestCase): @defer.inlineCallbacks def setUp(self): sel...
LiuFang816/SALSTM_py_data
python/matrix-org_synapse/synapse-master/tests/replication/slave/storage/_base.py
_base.py
py
1,548
python
en
code
9
github-code
21
[ { "api_name": "tests.unittest.TestCase", "line_number": 9, "usage_type": "attribute" }, { "api_name": "tests.unittest", "line_number": 9, "usage_type": "name" }, { "api_name": "tests.utils.setup_test_homeserver", "line_number": 12, "usage_type": "call" }, { "api_n...
8888841776
from typing import List, Tuple import torch from torch import Tensor import torch.nn.functional as F import torchaudio from torch.utils.data import Dataset, DataLoader from pathlib import Path import logging import random from glob import glob from torch.utils.data.distributed import DistributedSampler import os import...
RF5/simple-sashimi
sashimi/dataset.py
dataset.py
py
5,266
python
en
code
2
github-code
21
[ { "api_name": "torch.utils.data.Dataset", "line_number": 16, "usage_type": "name" }, { "api_name": "logging.info", "line_number": 21, "usage_type": "call" }, { "api_name": "torchaudio.load", "line_number": 27, "usage_type": "call" }, { "api_name": "torch.Tensor", ...
31034882785
import matplotlib.pyplot as plt import numpy as np def cost_plot(z, names): """ plot training improvement """ plt.figure() plt.grid() for i in range(len(z)): plt.plot(z[i]) plt.legend(names) plt.title("Cost during Training") def plot(x, x_lqr, dt): """ plot th...
tony-x-lin/susd_search
susd_lqr/plotting_tools/plot.py
plot.py
py
865
python
en
code
3
github-code
21
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 9, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.grid", "line_number": 10, "usage_type": "call" }, { "api_name": "matpl...
72075185973
import matplotlib.pyplot as plt import numpy as np # 데이터를 분리하는 모듈을 불러옵니다. from sklearn.model_selection import train_test_split # 학습용 데이터와 테스트용 데이터를 나누어주는 기능을 불러옵니다. # 사이킷런에 구현되어 있는 회귀 모델을 불러옵니다. from sklearn.linear_model import LinearRegression """ 1. 데이터를 생성하고, 생성한 데이터를 학습용 데이터와 테스트용 데이터로 분리하여 반환하는 함수를 ...
ssum21/STUDY_sklearn
simple_linearRegrssion_1.py
simple_linearRegrssion_1.py
py
3,910
python
ko
code
0
github-code
21
[ { "api_name": "numpy.random.seed", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 24, "usage_type": "attribute" }, { "api_name": "numpy.random.rand", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.random", ...
560297724
#It's khoji <a.khoji2001@gmail.com> # * in this code means that you should put your individual information #pip install bs4,selenium from bs4 import BeautifulSoup from selenium import webdriver from selenium.webdriver.chrome.options import Options #to use your default google chrome account (not Guest account) you shou...
khojiT/selenium-web-scraper
selweb.py
selweb.py
py
1,556
python
en
code
0
github-code
21
[ { "api_name": "selenium.webdriver.chrome.options.Options", "line_number": 12, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 15, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 15, "usage_type": "name" }, {...
70455665332
#!/usr/bin/env python3 # coding=utf-8 from theHarvester.discovery import qwantsearch import os import pytest from _pytest.mark.structures import MarkDecorator from typing import Optional pytestmark: MarkDecorator = pytest.mark.asyncio github_ci: Optional[str] = os.getenv('GITHUB_ACTIONS') # Github set this to be the ...
Chauvryl/Projet-2-Py
theHarvester-master/tests/discovery/test_qwantsearch.py
test_qwantsearch.py
py
1,440
python
en
code
0
github-code
21
[ { "api_name": "_pytest.mark.structures.MarkDecorator", "line_number": 9, "usage_type": "name" }, { "api_name": "pytest.mark", "line_number": 9, "usage_type": "attribute" }, { "api_name": "typing.Optional", "line_number": 10, "usage_type": "name" }, { "api_name": "...
29964357023
#덱 from collections import deque i = int(input()) count=0 d=deque() while(i>count): #print(d) a= input() if (a=="front"): if len(d)==0: print("-1") else : top = d[0] print(top) elif (a=="back"): if len(d)==0: print("-1") ...
GDSC-SCH/2021-GDSCSCH-AlgorithmStudy
09_민새미/10866.py
10866.py
py
1,004
python
en
code
0
github-code
21
[ { "api_name": "collections.deque", "line_number": 7, "usage_type": "call" } ]
17638747346
# -*- coding: utf-8 -*- """ created by huash06 at 2015-04-29 13:56 The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. Given an integer n, return all distinct solutions to the n-queens puzzle. Each solution contains a distinct board configuration ...
shhuan/algorithms
leetcode/hard/N_Queens.py
N_Queens.py
py
2,198
python
en
code
0
github-code
21
[ { "api_name": "copy.copy", "line_number": 51, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 84, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 84, "usage_type": "attribute" }, { "api_name": "datetime.datet...
21902475272
# unit tests of the user_db module from users import user_db import uuid import pytest user_fixture = { 'given_name': 'Bob', 'surname': 'Roberts', 'zip': '12345', 'email': 'bob@roberts.org' } def test_new_user(): persisted_user = user_db.new_user(user_fixture) assert persisted_user is not N...
andrewsw/simple-user-api
tests/test_user_db.py
test_user_db.py
py
2,404
python
en
code
0
github-code
21
[ { "api_name": "users.user_db.new_user", "line_number": 17, "usage_type": "call" }, { "api_name": "users.user_db", "line_number": 17, "usage_type": "name" }, { "api_name": "users.user_db.new_user", "line_number": 22, "usage_type": "call" }, { "api_name": "users.use...
31534789692
#!/usr/bin/python2 # vim: set et sts=4 sw=4: """ This python module provides a way to control wireless network functions on a headless Raspberry Pi which has netctl (e.g. arch linux). It has the following features without the netctl module: - Displays a single flashing LED if there is no IP address - Displays a...
shblythe/python2-pifacenetctl
pifacenetctl.py
pifacenetctl.py
py
6,785
python
en
code
0
github-code
21
[ { "api_name": "time.sleep", "line_number": 84, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 86, "usage_type": "call" }, { "api_name": "netctl.Netctl.stop_active_connection", "line_number": 90, "usage_type": "call" }, { "api_name": "netctl.Net...
71850833653
import json from tkinter import * from tkinter import filedialog from PIL import Image, ImageTk class Pessoa: def __init__(self, nome="", idade=0, foto=None): self.nome = nome self.idade = idade self.foto = foto class JanelaCadastro: def __init__(self, master): self.master = ...
TonyRio/2023-Facial_Rec_drones
master/cadastro.py
cadastro.py
py
2,770
python
pt
code
0
github-code
21
[ { "api_name": "tkinter.filedialog.askopenfilename", "line_number": 52, "usage_type": "call" }, { "api_name": "tkinter.filedialog", "line_number": 52, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number": 56, "usage_type": "call" }, { "api_name": "...
14645455221
# -*- coding: utf-8 -*- """ Created on 19 August 2022 @author: Berkay """ # libraries import torch import torch.backends.cudnn as cudnn import os import yaml import cv2 from PIL import Image # A class for human detection class HumanDetection: def __init__(self, model_path, conf): """ model_pa...
Samet-Berkay-Taskin/Person-Detection-YOLOV5
Person_detection_YOLOV5/human_detection.py
human_detection.py
py
1,947
python
en
code
1
github-code
21
[ { "api_name": "torch.hub.load", "line_number": 27, "usage_type": "call" }, { "api_name": "torch.hub", "line_number": 27, "usage_type": "attribute" } ]
73519345013
import datetime import config import jsonrpcclient import requests import logging import logging.config import pickle import shutil logging.config.dictConfig(config.LOGGING_CONF) class jeedom_api: def __init__(self): self._load_db() def request_jeedom(self, command, **kwargs): try: ...
jbfuzier/JeedomToInflux
jeedom_to_alerta.py
jeedom_to_alerta.py
py
3,135
python
en
code
0
github-code
21
[ { "api_name": "logging.config.dictConfig", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.config", "line_number": 10, "usage_type": "attribute" }, { "api_name": "config.LOGGING_CONF", "line_number": 10, "usage_type": "attribute" }, { "api_name":...
15961734099
from PIL import Image import numpy as np import cv2 import time def init_img_PIL(filepath): return Image.open(filepath) def init_img(filepath): return cv2.imread(filepath) def save_img_PIL(filepath,img): img.save(filepath) def show_img(img): res = cv2.resize(img,None,fx=0.5, fy=0.5) cv2.ims...
treyamador/computer_vision
theory/removal.py
removal.py
py
2,002
python
en
code
0
github-code
21
[ { "api_name": "PIL.Image.open", "line_number": 9, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 9, "usage_type": "name" }, { "api_name": "cv2.imread", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 21,...
29697627210
import streamlit as st import pandas as pd import numpy as np import pickle import matplotlib.pyplot as plt import seaborn as sns import sys sys.path.append("..") model = pickle.load(open("models/RFR-sales-27-05-2022-09-40-35.pkl", 'rb')) scaler = pickle.load(open('models/scaler-27-05-2022-09-40-35.pkl', 'rb')) select...
benbel376/rossman_predictive_analysis
apps/predictor.py
predictor.py
py
3,447
python
en
code
0
github-code
21
[ { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pickle.load", "line_number": 9, "usage_type": "call" }, { "api_name": "pickle.load", "line_number...
21434808091
import enum import re from typing import Dict, Iterable, List, Optional, Set, Union from . import enums class ParserState(enum.Enum): AWAITING_DATA = enum.auto() OBJECT_AWAIT_ATTRIBUTE = enum.auto() OBJECT_AWAIT_TYPE = enum.auto() OBJECT_AWAIT_VALUE = enum.auto() OBJECT_AWAIT_MULTILINE_OCTAL_VALU...
lukegb/buildcatrust
buildcatrust/nss_parser.py
nss_parser.py
py
5,072
python
en
code
1
github-code
21
[ { "api_name": "enum.Enum", "line_number": 8, "usage_type": "attribute" }, { "api_name": "enum.auto", "line_number": 9, "usage_type": "call" }, { "api_name": "enum.auto", "line_number": 10, "usage_type": "call" }, { "api_name": "enum.auto", "line_number": 11, ...
73617641013
import pygame import math import spell import settings """ @Author : YANG Lei (S201970) GARDIER Simon (S192580) Player(Sprite) : Classe représentant les joueurs (sorciers) """ class Player(pygame.sprite.Sprite): #Liste contenant les informations des différents joueurs PLAYERS = [ ...
sgardier/thewitcherscontest
Class/player.py
player.py
py
10,926
python
en
code
1
github-code
21
[ { "api_name": "pygame.sprite", "line_number": 11, "usage_type": "attribute" }, { "api_name": "settings.WINDOW_DIMENSIONS", "line_number": 16, "usage_type": "attribute" }, { "api_name": "pygame.image.load", "line_number": 18, "usage_type": "call" }, { "api_name": "...
11519508445
from player import Player import random from collections import OrderedDict TARGET_SCORE = 1000 POINTS = OrderedDict(( ('111', 1000), ('666', 600), ('555', 500), ('444', 400), ('333', 300), ('222', 200), ('1', 100), ('5', 50), )) def input_to_int(message): while True: try...
Letao-WANG/OneZero
farkle_test/run.py
run.py
py
3,060
python
en
code
0
github-code
21
[ { "api_name": "collections.OrderedDict", "line_number": 7, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 33, "usage_type": "call" }, { "api_name": "player.Player", "line_number": 54, "usage_type": "name" }, { "api_name": "player.name", ...
73365936372
import datetime arr=[] for i in range(2000,2400): d=datetime.datetime(i,2,1) if d.strftime("%a")=="Sat": arr.append(1) elif d.strftime("%a")=="Sun" and not ((i%4==0 and i%100!=0) or i%400==0): arr.append(1) else: arr.append(0) t=int(input()) for i in range(t): m=list(map(int...
bhatnitish1998/aps-2020
codechef_LONGCOOK.py
codechef_LONGCOOK.py
py
637
python
en
code
0
github-code
21
[ { "api_name": "datetime.datetime", "line_number": 4, "usage_type": "call" } ]
22083657530
#!/usr/bin/python import json import os import re from PySide2 import QtCore from PySide2.QtGui import QClipboard from PySide2.QtWidgets import QUndoStack, QAction from NodeGraphQt.base.actions import setup_actions from NodeGraphQt.base.commands import (NodeAddedCmd, NodeRemoved...
wow2006/NodeGraphQt
NodeGraphQt/base/graph.py
graph.py
py
21,443
python
en
code
null
github-code
21
[ { "api_name": "PySide2.QtCore.QObject", "line_number": 21, "usage_type": "attribute" }, { "api_name": "PySide2.QtCore", "line_number": 21, "usage_type": "name" }, { "api_name": "NodeGraphQt.base.model.NodeGraphModel", "line_number": 25, "usage_type": "call" }, { "...
12508758636
import itertools import math import random MAX_V_SPEED = -40 # ( ≤ 40m/s in absolute value) MAX_H_SPEED = 20 # ( ≤ 20m/s in absolute value) DELTA_TIME = 5 # Creating population - Avec random, tu prends le risque d'avoir des valeurs trop disparates dès le départ _values = itertools.product([e for e in range...
FlorianHuveteau/coding_game
training/mars_lander/ga_mars_lander.py
ga_mars_lander.py
py
6,729
python
en
code
0
github-code
21
[ { "api_name": "itertools.product", "line_number": 10, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 14, "usage_type": "attribute" }, { "api_name": "math.sin", "line_number": 43, "usage_type": "call" }, { "api_name": "math.radians", "li...
9100003995
import logging import os import datetime import time import typing import copy from collections import defaultdict import pickle from functools import partial import numpy as np from ConfigSpace.configuration_space import Configuration from smac.tae.execute_ta_run_hydra import ExecuteTARunHydra from smac.tae.execut...
timothyyu/ml_monorepo
SMAC3/smac/facade/hydra_facade.py
hydra_facade.py
py
11,310
python
en
code
59
github-code
21
[ { "api_name": "typing.Type", "line_number": 53, "usage_type": "attribute" }, { "api_name": "smac.scenario.scenario.Scenario", "line_number": 53, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 58, "usage_type": "attribute" }, { "api_name": ...
38070212036
import sys import psycopg2 import UserPanel import LoginWindow import AdminPanel connection = psycopg2.connect( database="kp0092_27", user="st0092", password="qwerty92", host="172.20.8.18", port="5432" ) connect_cursor = connection.cursor() start_window = LoginWindow.LoginWindow(connect_cursor) access_level...
Lostmindd/PostgreSQLSUBD
main.py
main.py
py
638
python
en
code
0
github-code
21
[ { "api_name": "psycopg2.connect", "line_number": 7, "usage_type": "call" }, { "api_name": "LoginWindow.LoginWindow", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 20, "usage_type": "call" }, { "api_name": "UserPanel.UserPanel"...
23358341102
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2023/7/11 20:34 # @Author : LiuXiu import sys from flask import Flask, request, send_file import os import pandas as pd app = Flask(__name__) app.config['SERVER_NAME'] = 'localhost:9997' # 指定监听端口为5000 # new_filename ="" @app.route('/') def index(): return...
ThornBirdlx/job-tools
file_processsing.py
file_processsing.py
py
2,220
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 33, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 33, "usage_type": "name" }, { "api_name": "flask.request.fil...
19930022013
# -*- coding: utf-8 -*- from scipy.spatial import distance as dist from collections import OrderedDict import numpy as np class CentroidTracker: def __init__(self, maxDisappeared=50, maxDistance=50): # 下一个可用的对象ID self.nextObjectID = 0 # 给定对象ID及相应质心 self.objects = OrderedDict() # 标记为“消失”的连续帧数 ...
wmn-231314/OldCare
oldCare-cv/track/centroidtracker.py
centroidtracker.py
py
3,688
python
en
code
5
github-code
21
[ { "api_name": "collections.OrderedDict", "line_number": 12, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 48, "usage_type": "call" }, { "api_name": "scipy.spa...
16216821334
import numpy as np import sys from collections import defaultdict import cPickle as pickle from itertools import product import matplotlib import matplotlib.pyplot as plt sys.path.append('/Volumes/CHRIS/Documents/research/pypragmods/pypragmods/') from lexica import Lexica, NULL_MSG, DISJUNCTION_SIGN from pragmods impor...
rlevy/pragmatic_disjunction
bls41/implicature_sims.py
implicature_sims.py
py
10,573
python
en
code
0
github-code
21
[ { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.style.use", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.py...
22006989836
import logging import logging.handlers import threading from itertools import zip_longest from logging import _STYLES from logging import Formatter from .filters import LoggingFilter try: from raven.handlers.logging import SentryHandler except ImportError: SentryHandler = None _lock = threading.RLock() de...
okomestudio/pyaides
src/pyaides/logging/config.py
config.py
py
5,751
python
en
code
0
github-code
21
[ { "api_name": "raven.handlers.logging.SentryHandler", "line_number": 13, "usage_type": "name" }, { "api_name": "threading.RLock", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.root", "line_number": 29, "usage_type": "attribute" }, { "api_name":...
21690091699
# pylint: disable=C0115,C0116,W0212 from datetime import datetime from freezegun import freeze_time from captchamonitor.utils.models import Relay from captchamonitor.utils.onionoo import Onionoo from captchamonitor.core.update_relays import UpdateRelays from captchamonitor.utils.consensus_parser import ConsensusRela...
woswos/CAPTCHA-Monitor
tests/integration/test_update_relays.py
test_update_relays.py
py
3,283
python
en
code
4
github-code
21
[ { "api_name": "captchamonitor.utils.consensus_parser.ConsensusRelayEntry", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 21, "usage_type": "nam...
27651774609
import sys sys.path.append('..') import fewshot_re_kit import torch from torch import autograd, optim, nn from torch.autograd import Variable from torch.nn import functional as F class ProtoHATT(fewshot_re_kit.framework.FewShotREModel): def __init__(self, sentence_encoder, shots, hidden_size=230): few...
thunlp/HATT-Proto
models/proto_hatt.py
proto_hatt.py
py
3,110
python
en
code
176
github-code
21
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "fewshot_re_kit.framework", "line_number": 9, "usage_type": "attribute" }, { "api_name": "fewshot_re_k...
40575250324
from pdb import set_trace as T import numpy as np import time from collections import defaultdict from forge.blade.io.stimulus.static import Stimulus as Static from forge.blade.io.serial import Serial def camel(string): '''Convert a string to camel case''' return string[0].lower() + string[1:] '''Internal dat...
Quaternion66/neural-mmo
forge/blade/io/stimulus/dynamic.py
dynamic.py
py
3,587
python
en
code
null
github-code
21
[ { "api_name": "forge.blade.io.stimulus.static.Stimulus.dict", "line_number": 61, "usage_type": "call" }, { "api_name": "forge.blade.io.stimulus.static.Stimulus", "line_number": 61, "usage_type": "name" }, { "api_name": "forge.blade.io.serial.Serial.key", "line_number": 78, ...
39792686192
# https://towardsdatascience.com/using-spacy-3-0-to-build-a-custom-ner-model-c9256bea098 from exporter import jsonl_to_list import pandas as pd from tqdm import tqdm import spacy from spacy.tokens import DocBin # def generate_training_file(training_data, outdir, model = 'en_core_web_md'): # """ Generate a spacy tr...
FieteO/doccano_spacy
generate_train_file.py
generate_train_file.py
py
2,548
python
en
code
8
github-code
21
[ { "api_name": "spacy.load", "line_number": 28, "usage_type": "call" }, { "api_name": "spacy.tokens.DocBin", "line_number": 30, "usage_type": "call" }, { "api_name": "pandas.read_json", "line_number": 47, "usage_type": "call" } ]
24160937571
from django.shortcuts import render,redirect # Create your views here. def home(request): if('reader' in request.session): action=[{"name":"view books","link":""},{"name":"profile","link":"profile"},{"name":"request","link":"request"},{"name":"orders and requests","link":"view_order"}] tp="reader" ...
connectheshelf/connectheshelf
home/views.py
views.py
py
1,439
python
en
code
0
github-code
21
[ { "api_name": "django.shortcuts.render", "line_number": 22, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "line_number": 33, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 37, "usage_type": "call" }, { "api_nam...
33053711640
from typing import List, Tuple, Dict from functools import reduce from collections import defaultdict def get_input() -> List[List[int]]: f = open("input/day9.txt", "r") return [[int(c) for c in line.strip()] for line in f.readlines()] def is_low_point(y, x, map): point = map[y][x] for (i, j) in neigh...
seveneightn9ne/advent2021
day9.py
day9.py
py
1,419
python
en
code
0
github-code
21
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 32, "usage_type": "name" }, { "api_name": "functools.reduce", "line_number": 41, "usage_type": "call" } ]
31539193138
import os import torch.utils.data as data from PIL import Image, ImageFile ImageFile.LOAD_TRUNCATED_IMAGES = True class ImgLoader(data.Dataset): def __init__(self, root, ann_file, transform=None, target_transform=None): print('=> loading annotations from: ' + os.path.basename(ann_file) + ' ...') s...
KaiyuYue/cgnl-network.pytorch
lib/dataloader.py
dataloader.py
py
821
python
en
code
259
github-code
21
[ { "api_name": "PIL.ImageFile.LOAD_TRUNCATED_IMAGES", "line_number": 5, "usage_type": "attribute" }, { "api_name": "PIL.ImageFile", "line_number": 5, "usage_type": "name" }, { "api_name": "torch.utils.data.Dataset", "line_number": 7, "usage_type": "attribute" }, { ...
7507131435
#!/usr/bin/env python3 import json import os import unittest from selfdrive.ui.update_translations import TRANSLATIONS_DIR, LANGUAGES_FILE, update_translations class TestTranslations(unittest.TestCase): @classmethod def setUpClass(cls): with open(LANGUAGES_FILE, "r") as f: cls.translation_files = json....
neokii/openpilot
selfdrive/ui/tests/test_translations.py
test_translations.py
py
1,946
python
en
code
null
github-code
21
[ { "api_name": "unittest.TestCase", "line_number": 9, "usage_type": "attribute" }, { "api_name": "selfdrive.ui.update_translations.LANGUAGES_FILE", "line_number": 12, "usage_type": "argument" }, { "api_name": "json.load", "line_number": 13, "usage_type": "call" }, { ...
11155546065
import os, sys from flask import Flask, jsonify, render_template import sqlite3 import json app = Flask(__name__, static_url_path='') class Collectable: def __init__(self): self.id = 0 self.name = "" self.display_name = "" self.price = 0 self.type = "" self.location...
sillypears/acnh-data
app.py
app.py
py
1,316
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 23, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 30, "usage_type": "call" }, { "api_name": "flask.jsonify", ...
31289246494
from typing import List from collections import defaultdict, deque class Solution: # brute force bfs def findMinHeightTrees(self, n: int, edges: List[List[int]]) -> List[int]: e = defaultdict(list) for u, v in edges: e[u].append(v) e[v].append(u) ans = [] m...
sengami-yuka/py
coding_problems/leetcode/310_minimum_height_trees.py
310_minimum_height_trees.py
py
4,608
python
en
code
0
github-code
21
[ { "api_name": "typing.List", "line_number": 6, "usage_type": "name" }, { "api_name": "collections.defaultdict", "line_number": 7, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 14, "usage_type": "call" }, { "api_name": "typing.List", ...
9253936561
from neo4j.v1 import GraphDatabase from library_app.model import Book, Borrower, Library neo4jDriver = GraphDatabase.driver("bolt://localhost:7687", auth=("neo4j", "12345678")) sess = neo4jDriver.session() def book_to_dict(book): if not book: return None book_dict = {} if book.isbn: book...
fredzqm/library_app
library_app/neo4j/neo4j_library.py
neo4j_library.py
py
14,289
python
en
code
0
github-code
21
[ { "api_name": "neo4j.v1.GraphDatabase.driver", "line_number": 5, "usage_type": "call" }, { "api_name": "neo4j.v1.GraphDatabase", "line_number": 5, "usage_type": "name" }, { "api_name": "library_app.model.Book", "line_number": 39, "usage_type": "call" }, { "api_nam...
42491942482
from concurrent.futures import ThreadPoolExecutor from typing import Any, Dict import pytest from kedro.io import AbstractDataSet, DataCatalog, DataSetError, MemoryDataSet from kedro.pipeline import Pipeline, node from kedro.pipeline.decorators import log_time from kedro.runner import ThreadRunner def source(): ...
zoeylin6/kedroo
tests/runner/test_thread_runner.py
test_thread_runner.py
py
8,170
python
en
code
0
github-code
21
[ { "api_name": "kedro.io.DataCatalog", "line_number": 39, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 37, "usage_type": "attribute" }, { "api_name": "kedro.pipeline.Pipeline", "line_number": 44, "usage_type": "call" }, { "api_name": "kedr...
23621447228
import re import requests import json from bs4 import BeautifulSoup from flask_restful import reqparse from flask import Blueprint,send_from_directory from requests.utils import requote_uri from config import ApiPath,ShikimoriLink from utils.lru_cache import timed_lru_cache from utils.messages import messages from util...
Semolik/AnimePlayer
api/anidub.py
anidub.py
py
14,596
python
en
code
4
github-code
21
[ { "api_name": "flask.Blueprint", "line_number": 24, "usage_type": "call" }, { "api_name": "flask_restful.reqparse.RequestParser", "line_number": 27, "usage_type": "call" }, { "api_name": "flask_restful.reqparse", "line_number": 27, "usage_type": "name" }, { "api_n...
19500577042
import torch import torch.optim as optim import matplotlib.pyplot as plt from skimage.io import imread, imsave, imshow from src import network from pathlib2 import Path from skimage import img_as_ubyte from src.tools import ProcessBar, CSV_Recorder, ElapsedTimeProcess, to_tensor, normalize, simple_denorm def to_numpy...
ChajinShin/DeepImagePrior
solver.py
solver.py
py
6,292
python
en
code
2
github-code
21
[ { "api_name": "skimage.img_as_ubyte", "line_number": 12, "usage_type": "call" }, { "api_name": "src.tools.simple_denorm", "line_number": 12, "usage_type": "call" }, { "api_name": "src.tools.to_tensor", "line_number": 17, "usage_type": "call" }, { "api_name": "src....
22550038969
from flask import Flask, request, url_for, render_template, redirect, session, flash app = Flask(__name__) app.secret_key = "secret" class Jogo: def __init__(self, nome, categoria, console): self.nome = nome self.categoria = categoria self.console = console jogo1 = Jogo("Mario", "Ação", "SNES") jogo2 = Jogo("...
btonella/flask
primeiroTeste.py
primeiroTeste.py
py
1,831
python
pt
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 3, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 25, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 25, "usage_type": "name" }, { "api_name": "flask.render_templ...
40747307926
# Скрипт для проверки переходника USB - 16 UART. # Необходимо соеденить вывод TXD c выводом RXD для каждого порта. import serial import serial.tools.list_ports print("Получение списка портов ...") ports = serial.tools.list_ports.comports() for port in ports: if port.vid != 0x0403 or port.pid != 0x6011: c...
bravikov/test-usb-16-uart
test.py
test.py
py
863
python
ru
code
0
github-code
21
[ { "api_name": "serial.tools.list_ports.comports", "line_number": 8, "usage_type": "call" }, { "api_name": "serial.tools", "line_number": 8, "usage_type": "attribute" }, { "api_name": "serial.Serial", "line_number": 15, "usage_type": "call" } ]
21833786207
import mimetypes import os import re from jinja2 import Template from lib.parse import parse_markdown_with_frontmatter class Entry(object): def __init__(self, path, parent=None): self.abs_path = path self.parent = parent self.root = parent.root if parent else self self.name = os....
dtao/danieltao.com
lib/structure.py
structure.py
py
5,302
python
en
code
0
github-code
21
[ { "api_name": "os.path.basename", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.relpath", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_num...
22462619345
from django.contrib import admin from django.urls import path from . import views urlpatterns = [ path('', views.home, name="home"), path('signup', views.signup, name="signup"), path('signin', views.signin, name="signin"), path('signout', views.signout, name="signout"), path('select_genres', views....
Muskaan06/cross-domain-recommendation
CDR/authentication/urls.py
urls.py
py
502
python
en
code
0
github-code
21
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", ...
5778652926
# 206. Reverse Linked List from typing import List, Optional from linklist import ListNode, init_looped_linked_list, values_from_linked_list example1_arg1 = [1, 2, 3, 4, 5] example1_out = [5, 4, 3, 2, 1] example2_arg1 = [1, 2] example2_out = [2, 1] class Solution: def reverseListIterative(self, head: Optional[...
jowls/challenges
leetcode/python/206.py
206.py
py
2,099
python
en
code
0
github-code
21
[ { "api_name": "typing.Optional", "line_number": 14, "usage_type": "name" }, { "api_name": "linklist.ListNode", "line_number": 14, "usage_type": "name" }, { "api_name": "linklist.values_from_linked_list", "line_number": 32, "usage_type": "call" }, { "api_name": "ty...
26835391892
# 클래스로 파이토치 모델 구현하기: 로지스틱 회귀 import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim # x data, y data new x_data = [[1, 2], [2, 3], [3, 1], [4, 3], [5, 3], [6, 2]] y_data = [[0], [0], [0], [1], [1], [1]] # Tensor 변환 x_train = torch.FloatTensor(x_data) y_train = torch.FloatTensor...
NoirCade/MS-AI-School
60일차/ex05.py
ex05.py
py
1,527
python
en
code
0
github-code
21
[ { "api_name": "torch.FloatTensor", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.FloatTensor", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.nn.Module", "line_number": 16, "usage_type": "attribute" }, { "api_name": "torch.nn", ...
17351256283
import re import random import numpy as np import os.path import scipy.misc import shutil import zipfile import time import tensorflow as tf from glob import glob from urllib.request import urlretrieve from tqdm import tqdm class DLProgress(tqdm): last_block = 0 def hook(self, block_num=1, block_size=1, tota...
xfqbuaa/Lyft_Challenge_Carla
helper.py
helper.py
py
6,989
python
en
code
0
github-code
21
[ { "api_name": "tqdm.tqdm", "line_number": 15, "usage_type": "name" }, { "api_name": "os.path.path.join", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 30, "usage_type": "attribute" }, { "api_name": "os.path", "line_num...
6591963847
import math import pandas as pd import numpy as np from scipy.sparse import coo_matrix from numpy.linalg import norm import sys def MSE(R,P,Q,lamda): ratings = R.data count = len(ratings) err = 0 for i in range(count): rating=ratings[i] r = R.row[i] c = R.col[i] if rati...
YiqunGan/Big-data-mining-with-Python-and-Spark
Big data mining with Python and Spark/yiqun_gan_hw2/yiqun_gan_task3.py
yiqun_gan_task3.py
py
3,423
python
en
code
0
github-code
21
[ { "api_name": "numpy.dot", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.linalg.norm", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 30, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 4...
16165055052
from django.core.paginator import Paginator from django.shortcuts import render from books.models import Book def books_view(request): template = 'books/books_list.html' books = Book.objects.all() print(books) context = {"books" : books} return render(request, template, context) def books_date(r...
Vladdikanov/2.1_dj_DZ
models_list_displaying/books/views.py
views.py
py
1,002
python
en
code
0
github-code
21
[ { "api_name": "books.models", "line_number": 9, "usage_type": "name" }, { "api_name": "books.models.Book.objects.all", "line_number": 9, "usage_type": "call" }, { "api_name": "books.models.Book.objects", "line_number": 9, "usage_type": "attribute" }, { "api_name":...
18551862552
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from builtins import * import math from snorkel.learning.pytorch import LSTM from pytorch_test_base import PyTorchTestBase import unittest class TestLSTM(PyTorchTestBas...
snorkel-team/snorkel-extraction
test/learning/pytorch/test_lstm.py
test_lstm.py
py
1,648
python
en
code
33
github-code
21
[ { "api_name": "pytorch_test_base.PyTorchTestBase", "line_number": 13, "usage_type": "name" }, { "api_name": "snorkel.learning.pytorch.LSTM", "line_number": 28, "usage_type": "call" }, { "api_name": "math.isnan", "line_number": 31, "usage_type": "call" }, { "api_na...
1835252981
# Importaciones y configuraciones import requests import sett import json import time import re from datetime import datetime from langchain.llms import OpenAI from langchain_experimental.sql import SQLDatabaseChain from langchain.prompts.prompt import PromptTemplate from sqlalchemy.exc import ProgrammingError from ...
JPierr3/bigdateros-llm-sql
services.py
services.py
py
6,364
python
es
code
0
github-code
21
[ { "api_name": "sett.whatsapp_token", "line_number": 32, "usage_type": "attribute" }, { "api_name": "sett.whatsapp_url", "line_number": 33, "usage_type": "attribute" }, { "api_name": "requests.post", "line_number": 37, "usage_type": "call" }, { "api_name": "json.du...
6793455602
import sys import os import numpy as np import pandas as pd import dill import argparse from tqdm import tqdm from pyquaternion import Quaternion from kalman_filter import NonlinearKinematicBicycle from sklearn.model_selection import train_test_split nu_path = './devkit/python-sdk/' sys.path.append(nu_path) sys.path.a...
zqzqz/AdvTrajectoryPrediction
data/nuScenes/preprocessing.py
preprocessing.py
py
13,688
python
en
code
75
github-code
21
[ { "api_name": "sys.path.append", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.path", "line_nu...
33606748657
from django.conf.urls import url from . import views urlpatterns = [ url( r'^$', views.post_list, name='thiscanbeanything'), url( r'^post/(?P<id>\d+)/$', views.post_detail, name='post_detail'), url( r'^post/new_post/$', views.post_new, name='post_new'), url( r'^post/(?P<id>\d+)/edit/$...
sp44s/my-blog-app
blog/urls.py
urls.py
py
360
python
en
code
0
github-code
21
[ { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "django.co...
71837094453
import torch from torch import nn from torch.nn import functional as F import math import numpy as np import scipy from backbones import SUPPORTED_BACKBONES class GaussianBlurLayer(nn.Module): def __init__(self, n_channels, kernel_size): super(GaussianBlurLayer, self).__init__() self.n_channels = ...
bsuleymanov/alpha-matting
src/model.py
model.py
py
14,119
python
en
code
1
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 10, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.nn", "lin...
2428330730
import os, sys import argparse import pandas as pd import urllib.request def download_dataset(url, file_name): urllib.request.urlretrieve(url, file_name) return if __name__ == "__main__": parser = argparse.ArgumentParser(description='Dowload raw coropora given dataset list.') parser.add_argument('--dataset...
nreimers/flax-sentence-embeddings
dataset/download_data.py
download_data.py
py
1,173
python
en
code
26
github-code
21
[ { "api_name": "urllib.request.request.urlretrieve", "line_number": 7, "usage_type": "call" }, { "api_name": "urllib.request.request", "line_number": 7, "usage_type": "attribute" }, { "api_name": "urllib.request", "line_number": 7, "usage_type": "name" }, { "api_na...
23387029952
import sqlite3 as lite from tabulate import tabulate # functionality class DatabaseManage(object): def __init__(self): global con try: con=lite.connect('courses.db') with con: cur = con.cursor() cur.execute("CREATE TABLE IF NOT EXISTS course(id...
aniket-teltumbade-au9/python-sqlite-crud
python_course_helper.py
python_course_helper.py
py
2,822
python
en
code
0
github-code
21
[ { "api_name": "sqlite3.connect", "line_number": 8, "usage_type": "call" }, { "api_name": "tabulate.tabulate", "line_number": 75, "usage_type": "call" } ]
1573085587
import numpy as np from collections import defaultdict class Agent: def __init__(self, nA=6, alpha=.01, gamma=0.9): """ Initialize agent. Params ====== - nA: number of actions available to the agent """ self.nA = nA self.Q = defaultdict(lambda: np.zeros(sel...
JoeZhao84/drl
drlnd/taxi-v2/agent.py
agent.py
py
2,302
python
en
code
0
github-code
21
[ { "api_name": "collections.defaultdict", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.random.choice", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.random"...
15361944710
from PyQt5.QtWidgets import QApplication from authorization import AddClient import sys def except_hook(cls, exception, traceback): sys.__excepthook__(cls, exception, traceback) app = QApplication(sys.argv) app.setStyle('Fusion') ex = AddClient() ex.show() sys.excepthook = except_hook sys.exit(app.exec())
syrez1/Library_System-QtProject
main.py
main.py
py
315
python
en
code
0
github-code
21
[ { "api_name": "sys.__excepthook__", "line_number": 7, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QApplication", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 10, "usage_type": "attribute" }, { "api_name": "authoriz...
2954153104
from email import header from http import cookies import re from urllib import response from bs4 import BeautifulSoup from requests import head, request import requests from config import API_KEY from twocaptcha import TwoCaptcha solver= TwoCaptcha('10946c2ec04f490bf2bb20b2c9141734') url= 'https://infograins.com/cont...
manojdubey123/bypassing-captcha
demo.py
demo.py
py
1,456
python
en
code
0
github-code
21
[ { "api_name": "twocaptcha.TwoCaptcha", "line_number": 12, "usage_type": "call" }, { "api_name": "urllib.response", "line_number": 16, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 16, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup"...
10524738376
from flaskr.models.models import (Students, Teachers, Managers, Classes, Schools) from sqlalchemy import func def handleSearch(search, key): if key == 'all': results = searchForAll(search.lower()) elif key == 'students': results = searchForStudents(search.low...
Ebra01/SsMS
flaskr/SearchEngine/utils.py
utils.py
py
2,439
python
en
code
0
github-code
21
[ { "api_name": "flaskr.models.models.Students.query.filter", "line_number": 28, "usage_type": "call" }, { "api_name": "flaskr.models.models.Students.query", "line_number": 28, "usage_type": "attribute" }, { "api_name": "flaskr.models.models.Students", "line_number": 28, "u...
15745630346
""" COMP30024 Artificial Intelligence, Semester 1, 2021 Project Part A: Searching Created by ThePinkCoder (Yongfeng Qin & Yun-Chi Hsiao) on Mar.23rd 2021 Module: state This module contains a class named called State which contains board attribute. Most states would have a parent state and generate child states based o...
is0xjh25/ropasci-360-single-game
search/state.py
state.py
py
3,413
python
en
code
1
github-code
21
[ { "api_name": "search.algorithm.hn", "line_number": 25, "usage_type": "call" }, { "api_name": "search.utility.get_ordered_list", "line_number": 53, "usage_type": "call" }, { "api_name": "itertools.product", "line_number": 59, "usage_type": "call" }, { "api_name": ...
36331307170
import glob import shutil import json imagesPath = "/Users/lingmou/Desktop/ali/" def main(): # images = glob.glob(imagesPath + "*.jpg") index = 7900001 data = read_json("/Users/lingmou/Desktop/python-script/ALI-project/annotationJson.json") for item in data: print(index) shutil.copy(i...
xytysingle/AnnotationTool
python-script/ALI-project/renumber.py
renumber.py
py
842
python
en
code
0
github-code
21
[ { "api_name": "shutil.copy", "line_number": 14, "usage_type": "call" }, { "api_name": "json.load", "line_number": 22, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 28, "usage_type": "call" } ]
15474849389
from torch_geometric.utils.random import erdos_renyi_graph import torch from torch_geometric.data import Data, InMemoryDataset from torch_geometric.data import DataLoader from torch_geometric.utils import to_dense_adj class Erdos_Renyi_pyg(InMemoryDataset): def __init__(self, root, nb_nodes1=200, nb_graphs1=500, ...
AdrianArnaiz/DiffWire
datasets/Erdos_Renyi_dataset.py
Erdos_Renyi_dataset.py
py
4,460
python
en
code
14
github-code
21
[ { "api_name": "torch_geometric.data.InMemoryDataset", "line_number": 8, "usage_type": "name" }, { "api_name": "torch.load", "line_number": 29, "usage_type": "call" }, { "api_name": "torch.save", "line_number": 55, "usage_type": "call" }, { "api_name": "torch_geome...
1122992091
# deepsea-ai, Apache-2.0 license # Filename: commands/monitor.py # Description: Thread to monitor the status of processing jobs in an ECS cluster. import time from pathlib import Path from threading import Thread from sqlalchemy.orm import sessionmaker from deepsea_ai.commands.monitor_utils import log_scaling_activi...
mbari-org/deepsea-ai
deepsea_ai/commands/monitor.py
monitor.py
py
3,788
python
en
code
1
github-code
21
[ { "api_name": "threading.Thread", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.orm.sessionmaker", "line_number": 27, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 28, "usage_type": "name" }, { "api_name": "threading.T...
20227689341
import utils import random import MT19937RNG import struct KEY = random.randint(0, 2 ** 16) PREFIX = utils.randomString(random.randint(10, 100)) def encrypt(plain, key): prng = MT19937RNG.MT19937RNG() prng.seed_mt(KEY) keystream = b"".join(struct.pack('>I', prng.extract_number()) for _ in range(len(plain)...
max644/matasano
24.py
24.py
py
1,323
python
en
code
0
github-code
21
[ { "api_name": "random.randint", "line_number": 6, "usage_type": "call" }, { "api_name": "utils.randomString", "line_number": 7, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 7, "usage_type": "call" }, { "api_name": "MT19937RNG.MT19937RNG",...
31626330484
import numpy import h5py from mayavi import mlab """ View data stored in tvb h5 files directly. Used for debugging purposes. It does not use tvb. """ def show_sensors(pth, red=None, green=None): """ show sensors stored in a h5. :param red: a list of labels to be shown in red """ if red is ...
the-virtual-brain/tvb-data
tvb_data/sensors/view_h5_3d.py
view_h5_3d.py
py
1,724
python
en
code
11
github-code
21
[ { "api_name": "mayavi.mlab.figure", "line_number": 20, "usage_type": "call" }, { "api_name": "mayavi.mlab", "line_number": 20, "usage_type": "name" }, { "api_name": "h5py.File", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.array", "line_numb...
31432217222
import os from requests.api import head import spiders.httputils import datetime import zipfile import os.path from urllib.parse import urlparse class BaseSpider: def __init__(self): super().__init__() self.host = '' self.base_url = '' self.output_dir = '' def load(self, url,...
406345/novel_spider_py
spiders/basespider.py
basespider.py
py
4,824
python
en
code
2
github-code
21
[ { "api_name": "urllib.parse.urlparse", "line_number": 20, "usage_type": "call" }, { "api_name": "os.makedirs", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line...
24567947850
#!/usr/bin/python3 from loadgui import * from loadmap import photo from piechart import pie_chart from hex_to_gdkrgba import hex_to_gdkrgba from gdkrgba_to_hex import gdkrgba_to_hex from colorsave import colorsave # Path import os import datetime import json # GUI Application import gi import gettext gi.require_ver...
0m3re/SNCF
visuel/visuel.py
visuel.py
py
12,549
python
en
code
1
github-code
21
[ { "api_name": "gi.require_version", "line_number": 18, "usage_type": "call" }, { "api_name": "gettext.gettext", "line_number": 22, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path.isfile", ...
72336840693
from django.shortcuts import render, reverse from django.http import JsonResponse, HttpResponseNotFound def index(request, path): path = path.replace('_', ':') print(reverse(path)) try: url = reverse(path) except Exception as e: return HttpResponseNotFound(f"url with pathname '{path...
git00000/corpus
corpus/apps/url_service/views.py
views.py
py
385
python
en
code
0
github-code
21
[ { "api_name": "django.shortcuts.reverse", "line_number": 9, "usage_type": "call" }, { "api_name": "django.shortcuts.reverse", "line_number": 11, "usage_type": "call" }, { "api_name": "django.http.HttpResponseNotFound", "line_number": 14, "usage_type": "call" }, { ...
5055774692
import pymongo def update_vacancies(data): connect = pymongo.MongoClient() vac = connect["job_seeking"]["vacancy"] for i in data: print('i', i) vac.update_one({'_id': i.pop('url')}, {'$set': i}, upsert=True)
melnichenkojulia/WebScrapping
JobScrapping/utils/database.py
database.py
py
239
python
en
code
0
github-code
21
[ { "api_name": "pymongo.MongoClient", "line_number": 5, "usage_type": "call" } ]
36069919871
from setuptools import setup import os curdir = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(curdir, "README.rst"), 'r') as readme: long_description = readme.read() setup( name = "array2latex", version = "0.5", description = "A tool to convert array into latex tables", long_description = lon...
adonese/array2latex
setup.py
setup.py
py
470
python
en
code
6
github-code
21
[ { "api_name": "os.path.abspath", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path.join", "line_nu...
17660159743
import csv import pyodbc def load_csv_data(file_path, table_name, connection_string): connection = pyodbc.connect(connection_string) cursor = connection.cursor() cursor.fast_executemany=True with open(file_path, 'r') as csv_file: csv_reader = csv.DictReader(csv_file) header = csv_rea...
vpicchianti/decision_support_systems
LDS_part1_group32_assignment2.py
LDS_part1_group32_assignment2.py
py
2,094
python
en
code
0
github-code
21
[ { "api_name": "pyodbc.connect", "line_number": 7, "usage_type": "call" }, { "api_name": "csv.DictReader", "line_number": 12, "usage_type": "call" }, { "api_name": "pyodbc.connect", "line_number": 32, "usage_type": "call" }, { "api_name": "csv.DictReader", "lin...
27685881120
#!/usr/bin/env python3 import pandas as pd from nltk.tokenize import RegexpTokenizer from nltk import word_tokenize import functools import operator import re import pickle import json from tqdm import tqdm print("Using configuration file : config.json") config = json.loads(re.sub(r'#.*?\n', '', open('config.json', '...
ajhoop/MIDS_Capstone
src/Transformer_v1/HS_extract/reformat.py
reformat.py
py
2,398
python
en
code
2
github-code
21
[ { "api_name": "json.loads", "line_number": 14, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 17, "usage_type": "call" }, { "api_name": "re.search", "line_number": 26, ...
17916403762
# coding=utf-8 import json def _decode_list(data): rv = [] for item in data: if isinstance(item, unicode): item = item.encode('utf-8') elif isinstance(item, list): item = _decode_list(item) elif isinstance(item, dict): item = _decode_dict(item) ...
konfan/OuterSort
transcodec/transcodec/helper/jsontool.py
jsontool.py
py
1,086
python
en
code
0
github-code
21
[ { "api_name": "json.loads", "line_number": 38, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 42, "usage_type": "call" } ]
71359778614
import matplotlib.pyplot as plt from fightcalculator import Squad def compute_result_of_a_fight1(A, α, B, β, C, γ): a, b, c = Squad(1, A, α), Squad(1, B, β), Squad(1, C, γ) a, b, c = Squad.fight3_to_death(a, b, c) return a.units, b.units, c.units def compute_result_of_a_fight2(A, α, B, β, C, γ): a,...
hvox/game_ideas
statistics.py
statistics.py
py
1,080
python
en
code
0
github-code
21
[ { "api_name": "fightcalculator.Squad", "line_number": 7, "usage_type": "call" }, { "api_name": "fightcalculator.Squad.fight3_to_death", "line_number": 8, "usage_type": "call" }, { "api_name": "fightcalculator.Squad", "line_number": 8, "usage_type": "name" }, { "ap...
680072743
# coding: utf-8 import re import json import os import fnmatch from datetime import datetime, timedelta from shutil import rmtree from slackbot.bot import respond_to from . import jira from . import crucible from . import bamboo from . import stash from . import settings from utils.slackbot_utils import send_messag...
gpailler/AtlassianBot
plugins/clean.py
clean.py
py
9,978
python
en
code
21
github-code
21
[ { "api_name": "utils.slackbot_utils.send_message", "line_number": 38, "usage_type": "call" }, { "api_name": "utils.slackbot_utils.send_message", "line_number": 56, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 56, "usage_type": "call" }, { "ap...
32934375092
import unittest import six import os.path as osp import _base_testing as bt from psyplot.compat.pycompat import OrderedDict import psyplot.data as psyd import pandas as pd import xarray as xr import psyplot.plotter as psyp from itertools import repeat from psyplot import rcParams import psyplot.config as psyc try: ...
psyplot/psyplot
tests/test_plotter.py
test_plotter.py
py
34,281
python
en
code
69
github-code
21
[ { "api_name": "psyplot.plotter.docstrings", "line_number": 21, "usage_type": "attribute" }, { "api_name": "psyplot.plotter", "line_number": 21, "usage_type": "name" }, { "api_name": "psyplot.config.setup_logging", "line_number": 24, "usage_type": "call" }, { "api_...
21391211182
"""Module requesting questions for the quiz from opentdb.com - Trivia question database """ import requests AMOUNT = 10 # up to 50 QUESTION_TYPE = "boolean" response = requests.get(url=f"https://opentdb.com/api.php?amount={AMOUNT}&type={QUESTION_TYPE}") response.raise_for_status() question_data = response.json()["re...
Artur-Niezgoda/udemy-quiz-project
data.py
data.py
py
328
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" } ]
72360872053
from tools import list_tools from src.sort import bubble_sort, selection_sort, insert_sort, shell_sort, merge_sort, quick_sort, heap_sort, bucket_sort import time from tools import file_tools, visualization, performance import platform from tools.iostream import printw import os import matplotlib.pyplot as plt all_sor...
grayondream/algorithm-forth
test/test/sort.py
sort.py
py
3,052
python
en
code
0
github-code
21
[ { "api_name": "src.sort.bubble_sort.all", "line_number": 11, "usage_type": "attribute" }, { "api_name": "src.sort.bubble_sort", "line_number": 11, "usage_type": "name" }, { "api_name": "src.sort.selection_sort.all", "line_number": 11, "usage_type": "attribute" }, { ...
10098249639
import requests import http.cookiejar as cookielib import re import time from PIL import Image # 构造 Request headers # agent = 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Mobile Safari/537.36' agent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) Apple...
jiangliu2u/PythonCoreLearn
loginZhihu.py
loginZhihu.py
py
3,677
python
en
code
0
github-code
21
[ { "api_name": "requests.session", "line_number": 17, "usage_type": "call" }, { "api_name": "http.cookiejar.LWPCookieJar", "line_number": 18, "usage_type": "call" }, { "api_name": "http.cookiejar", "line_number": 18, "usage_type": "name" }, { "api_name": "requests....
30194314191
from unittest import TestCase, main from requests import get TOKEN = "c439e1209216cc7e7c73a3a8d1d12bfd" CITY = "Norway" # test *only* BASE_URL = "https://api.openweathermap.org/data/2.5/weather?" URL = BASE_URL + "q=" + CITY + "&appid=" + TOKEN resp_PROD = get(URL) class testAPILoad(TestCase): def test_data_pr...
Futura-Py/weather
tests/test_api.py
test_api.py
py
1,002
python
en
code
5
github-code
21
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 12, "usage_type": "name" }, { "api_name": "unittest.main", "line_number": 15, "usage_type": "name" }, { "api_name": "unittest.main", "line...
7003724656
import requests # HTTP lib for python import json # Python Standard Library - JSON utility import elementtree.ElementTree as ET # fast XML parser from django.conf import settings from django.shortcuts import render_to_response, redirect from django.contrib import ...
justingosan/SendBox
sendbox/views.py
views.py
py
10,540
python
en
code
0
github-code
21
[ { "api_name": "django.conf.settings.BOX_API_KEY", "line_number": 18, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 18, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 21, "usage_type": "call" }, { "api_name"...
16756066804
from analysisargs import AnalysisArgs from analysisargs import Logs from analysisargs import ProjectionsType from analysisargs import DevicesType from analysisargs import FuncIdsType from analysisargs import TestModesType import numpy as np import typing class DrawingHandler: _a: AnalysisArgs """Hyperparamete...
mnapravnik/Efficiency-of-dragging-gestures
analysis/drawingtimes.py
drawingtimes.py
py
5,197
python
en
code
null
github-code
21
[ { "api_name": "analysisargs.AnalysisArgs", "line_number": 12, "usage_type": "name" }, { "api_name": "analysisargs.Logs", "line_number": 14, "usage_type": "name" }, { "api_name": "analysisargs.AnalysisArgs", "line_number": 17, "usage_type": "name" }, { "api_name": ...
27005311121
from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.common.exceptions import NoSuchElementException, ElementClickInterceptedException from time import time, sleep from pprint import pprint # TODO Create a keyword list def str_to_tupl...
Vincent-Muchiri/Python-Programming
Automating LinkedIn Jobs [49] - Selenium/submit_query.py
submit_query.py
py
13,496
python
en
code
0
github-code
21
[ { "api_name": "selenium.webdriver.common.by.By.TAG_NAME", "line_number": 34, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.common.by.By", "line_number": 34, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 41, "usage_type": "call" }, ...
31605407667
import pytest from user_api.graphql.resolvers import FilterQueryBuilder from user_api.models import User @pytest.fixture def builder(): return FilterQueryBuilder(User.query, {"name_Istartswith": "aaa", "last_name_exact": "Doe"}) def test_entity(builder): assert bu...
rai200890/graphene-flask-example
tests/user_api/graphql/resolvers/test_filter_query_builder.py
test_filter_query_builder.py
py
634
python
en
code
1
github-code
21
[ { "api_name": "user_api.graphql.resolvers.FilterQueryBuilder", "line_number": 9, "usage_type": "call" }, { "api_name": "user_api.models.User.query", "line_number": 9, "usage_type": "attribute" }, { "api_name": "user_api.models.User", "line_number": 9, "usage_type": "name"...