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
37995248075
from airflow.hooks.postgres_hook import PostgresHook from airflow.models import BaseOperator from airflow.utils.decorators import apply_defaults import logging class DataQualityOperator(BaseOperator): """ This is used for data quality checks on the tables. Parameters ---------- - BaseOberator: Airf...
JANHMS/Automate_data_pipelines_with_Airflow
plugins/operators/data_quality.py
data_quality.py
py
1,629
python
en
code
1
github-code
6
[ { "api_name": "airflow.models.BaseOperator", "line_number": 6, "usage_type": "name" }, { "api_name": "airflow.utils.decorators.apply_defaults", "line_number": 16, "usage_type": "name" }, { "api_name": "airflow.hooks.postgres_hook.PostgresHook", "line_number": 29, "usage_t...
358150804
import os import random import discord from dotenv import load_dotenv from discord.ext import commands from redditgrabber.main_classes import RedditAPI from twitterinterface.main import User_OAuth, User_Unauthenticated bot = commands.Bot(command_prefix="+") class DiscordBot: def __init__(self): load_doten...
nibble90/jacobbot-discord
bot.py
bot.py
py
5,418
python
en
code
0
github-code
6
[ { "api_name": "discord.ext.commands.Bot", "line_number": 9, "usage_type": "call" }, { "api_name": "discord.ext.commands", "line_number": 9, "usage_type": "name" }, { "api_name": "dotenv.load_dotenv", "line_number": 13, "usage_type": "call" }, { "api_name": "os.get...
41761105577
import pygame as p p.init() b=(0,0,0) w=(255,255,255) b2=(0,0,255) g=(0,255,0) r=(255,0,0) s=[400,300] s2=p.display.set_mode(s) p.display.set_caption("겜판") d=False c=p.time.Clock() while not d: c.tick(10) for event in p.event.get(): if event.type == p.QUIT: ...
dlatpdbs/pygame
2020.6.3 겜판.py
2020.6.3 겜판.py
py
344
python
en
code
0
github-code
6
[ { "api_name": "pygame.init", "line_number": 3, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 12, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 12, "usage_type": "attribute" }, { "api_name": "pygame.display...
71913875388
import torch from torch import nn from torch.nn.parameter import Parameter __all__ = [ "AbsoluteSinusoidalPE", "AbsoluteLearnablePE", ] class AbsoluteSinusoidalPE(nn.Module): """The Absolute Sinusoidal Positional Encoding Module A. Vaswani et al., “Attention Is All You Need.” arXiv, Aug. 01, 2023. Acc...
zty200489/sifeng
sifeng/dl/modules/positional_encoding.py
positional_encoding.py
py
2,807
python
en
code
5
github-code
6
[ { "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.Dropout", "line_number": 37, "usage_type": "call" }, { "api_name": "torch.nn", "line_n...
18835478405
import os import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.autograd import Variable import numpy as np import time from os import mkdir from os.path import join, isdir from torch.utils.data import random_split, DataLoader from datetime import date from torchv...
TTThanos/PEFGAN-for-rainfall
PEFGAN/Test_code.py
Test_code.py
py
9,863
python
en
code
1
github-code
6
[ { "api_name": "datetime.date", "line_number": 37, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 38, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 64, "usage_type": "call" }, { "api_name": "os.path", "line_number...
73687597949
from fontParts.world import * import string fontPath = "IBM Plex Serif-Regular.ufo" biggies = { # glyphName: (1,2,3,4,80) #x,y,w,h,extra(=smaller in the box) 'A': (1, 0, 2, 3, 250), "uni0414": (4, 2, 2, 3, 240), #"Zhecyr": (9, 6, 3, 5, 240), # choice(f.keys()): (5, 1,2, 3,120), } font =...
thomgb/pythonTypeThings
DrawBot/GridSpecimen.py
GridSpecimen.py
py
4,772
python
en
code
0
github-code
6
[ { "api_name": "fontTools.pens.cocoaPen.CocoaPen", "line_number": 24, "usage_type": "call" }, { "api_name": "string.ascii_letters", "line_number": 80, "usage_type": "attribute" } ]
23653193080
from csv import DictReader, writer from dataclasses import dataclass from decimal import Decimal import os import re @dataclass class Piece(): name: str thickness: Decimal width: Decimal length: Decimal decor: str def piece_from_dict(row:dict) -> Piece: """ returns a Piece object if the 'P...
sebastian-tschen/schrank-og2
fix_bom.py
fix_bom.py
py
1,561
python
en
code
0
github-code
6
[ { "api_name": "decimal.Decimal", "line_number": 10, "usage_type": "name" }, { "api_name": "decimal.Decimal", "line_number": 11, "usage_type": "name" }, { "api_name": "decimal.Decimal", "line_number": 12, "usage_type": "name" }, { "api_name": "dataclasses.dataclass...
39902062761
from bs4 import BeautifulSoup import gzip import logging import pandas as pd import urllib.request from util import create_directory_if_not_exists class ParseXMLData: """Download xml data and parse it to pandas DataFrame.""" def __init__(self, url: str, file_path: str, pandas_columns: list): """Init...
artemkozlov752/DBLP_Processor
parsers/ParseXMLData.py
ParseXMLData.py
py
3,103
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 20, "usage_type": "call" }, { "api_name": "util.create_directory_if_not_exists", "line_number": 37, "usage_type": "call" }, { "api_name": "urllib.request.request.urlretrieve", "line_number": 40, "usage_type": "call" }, ...
39359043181
import time import selenium from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.chrome.service import Service from selenium.webdriver.support.ui import Select from selenium.webdriver.common.alert import Alert #driver=webdriv...
Paviterence/Selenium-Python-BasicCodes
dropdown_with_css_selector.py
dropdown_with_css_selector.py
py
3,789
python
en
code
1
github-code
6
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 11, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 11, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.by.By.ID", "line_number": 15, "usage_type": "attribute" }, { ...
42664773461
from functools import wraps from ipaddress import ip_address from typing import Callable, Optional from pymodbus import client from pymodbus.constants import Defaults from pymodbus.exceptions import ModbusIOException from pymodbus.framer import rtu_framer, socket_framer from pymodbus.register_read_message import ReadI...
ograsdijk/CPA1110
cpa1110/device.py
device.py
py
6,677
python
en
code
0
github-code
6
[ { "api_name": "typing.Callable", "line_number": 23, "usage_type": "name" }, { "api_name": "functools.wraps", "line_number": 24, "usage_type": "name" }, { "api_name": "cpa1110.attributes.FloatProperty", "line_number": 33, "usage_type": "call" }, { "api_name": "cpa1...
18244598384
import requests from .strava_auth import build_credentials, get_cookie_valid from ..common import poll_calendar from datetime import datetime from utils import get_key from utils.database import get_database_connection, generate_sql_datafields, generate_sql_datafields_multiple, sql_select API_URL = "https://www.strava...
cg-Kdaf/Replica
src/external_services/strava/strava_activities.py
strava_activities.py
py
11,339
python
en
code
1
github-code
6
[ { "api_name": "strava_auth.build_credentials", "line_number": 13, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 21, "usage_type": "call" }, { "api_name": "date...
30788902174
from django.shortcuts import render,redirect,HttpResponse,HttpResponseRedirect,get_object_or_404 from .models import * from .forms import * from django.contrib import messages from django.http import Http404 from django.template.loader import get_template from xhtml2pdf import pisa from django.template.loader import ge...
Sayeedh784/Marital-Status
status/views.py
views.py
py
9,260
python
en
code
2
github-code
6
[ { "api_name": "django.shortcuts.render", "line_number": 14, "usage_type": "call" }, { "api_name": "django.contrib.messages.success", "line_number": 22, "usage_type": "call" }, { "api_name": "django.contrib.messages", "line_number": 22, "usage_type": "name" }, { "a...
26095524740
import sys import logging from nmap import PortScannerHostDict class MockPortScanner: """MockPortScanner allows to use a mock version of nmap from Python.""" def __init__(self): """Initialize MockPortScanner module.""" logging.debug("Creating MockPortScanner") self._scan_result = {} ...
aHugues/port-eye
port_eye/mock_nmap.py
mock_nmap.py
py
17,233
python
en
code
2
github-code
6
[ { "api_name": "logging.debug", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.version_info", "line_number": 21, "usage_type": "attribute" }, { "api_name": "nmap.PortScannerHostDict", "line_number": 346, "usage_type": "call" }, { "api_name": "sys.ver...
4635525235
import matplotlib.pyplot as plt import json import numpy as np id = 'handcraft_RNN_3' filename = 'statistics/'+id filename += '.json' with open(filename, 'r') as f: log = json.load(f) train_accuracy = log['train_accuracy'] test_accuracy = log['test_accuracy'] train_loss = log['train_loss'] test_loss = log...
ChiWeiHsiao/Deep-Learning-Assignment
4-RNN/plot.py
plot.py
py
1,341
python
en
code
3
github-code
6
[ { "api_name": "json.load", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.amax", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 27, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line...
33049952078
'''Loading libraries''' import pandas as pd import numpy as np import time from sklearn.model_selection import train_test_split from sklearn.metrics import confusion_matrix,f1_score from scipy.stats import gamma import copy from sklearn.metrics.pairwise import cosine_similarity ''' Notes: - Datalimit V = 3500 - 1000s...
raquelaoki/MLCB2019
MLCB/script_v010_mlcb.py
script_v010_mlcb.py
py
13,627
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 31, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 48, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 49, "usage_type": "call" }, { "api_name": "numpy.arange", "line_nu...
8102262691
# -*- coding:shift-jis -*- import getpass user = getpass.getuser() import os currentWorkingDirectory = "C:\\Users\\{0}\\Desktop\\PySong2\\eSignal".format(user) os.chdir(currentWorkingDirectory) import sys sys.path.append('../PythonStats/x64/Debug/') sys.path.append('../PythonStats/x64/Release/') sys.path.a...
ys2310/eSignal
中心限月(Futures).py
中心限月(Futures).py
py
23,757
python
en
code
1
github-code
6
[ { "api_name": "getpass.getuser", "line_number": 3, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.path.append", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.path", "line_number": ...
38336224522
#!/usr/bin/python from websocket import create_connection import unittest from common import read_info from common import read_message from common import check_action as c from common import json_diff as d import time import json class websocket_request(unittest.TestCase): """21. 读取joint配置信息 & 22. 修改motion配置信...
leen0910/websocket_api
websocket_api/test_case/test18_MontionConfig.py
test18_MontionConfig.py
py
2,036
python
en
code
0
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 16, "usage_type": "attribute" }, { "api_name": "common.read_info.ReadInfo", "line_number": 19, "usage_type": "call" }, { "api_name": "common.read_info", "line_number": 19, "usage_type": "name" }, { "api_name": "web...
20600642841
from typing import Union, List from pathlib import Path import jinja2 import re from synthtool import log from synthtool import tmp PathOrStr = Union[str, Path] def _make_env(location): env = jinja2.Environment( loader=jinja2.FileSystemLoader(str(location)), autoescape=False, keep_trai...
googleapis/google-cloud-java
owl-bot-postprocessor/synthtool/sources/templates.py
templates.py
py
3,706
python
en
code
1,781
github-code
6
[ { "api_name": "typing.Union", "line_number": 11, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 11, "usage_type": "name" }, { "api_name": "jinja2.Environment", "line_number": 15, "usage_type": "call" }, { "api_name": "jinja2.FileSystemLoader"...
70396796347
import chex import numpy.testing as npt import pytest from shinrl import CartPole @pytest.fixture def setUp(): config = CartPole.DefaultConfig(dA=5) return config def test_to_discrete_act(setUp): from shinrl.envs.mountaincar.calc import to_discrete_act config = setUp act = to_discrete_act(conf...
omron-sinicx/ShinRL
tests/envs/cartpole/cartpole_calc_test.py
cartpole_calc_test.py
py
1,448
python
en
code
42
github-code
6
[ { "api_name": "shinrl.CartPole.DefaultConfig", "line_number": 10, "usage_type": "call" }, { "api_name": "shinrl.CartPole", "line_number": 10, "usage_type": "name" }, { "api_name": "pytest.fixture", "line_number": 8, "usage_type": "attribute" }, { "api_name": "shin...
4702570744
''' 给你一个下标从 0 开始的整数数组 nums 。 现定义两个数字的 串联 是由这两个数值串联起来形成的新数字。 例如,15 和 49 的串联是 1549 。 nums 的 串联值 最初等于 0 。执行下述操作直到 nums 变为空: 如果 nums 中存在不止一个数字,分别选中 nums 中的第一个元素和最后一个元素,将二者串联得到的值加到 nums 的 串联值 上,然后从 nums 中删除第一个和最后一个元素。 如果仅存在一个元素,则将该元素的值加到 nums 的串联值上,然后删除这个元素。 返回执行完所有操作后 nums 的串联值。 ''' from typing import List class Solutio...
relidaning/myPython
leetcode/2562.py
2562.py
py
1,116
python
zh
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 15, "usage_type": "name" } ]
25816878328
############################################### # Student_ID : 99131009 # # Name : Najmeh # # Last Name : Mohammadbagheri # # E-mail : Najmeh.mohammadbagheri77@gmail.com # ############################################### import numpy as np import pandas...
najmemhmdb/Machine-Learning-Hws
ML_HW4/SVM.py
SVM.py
py
2,366
python
en
code
0
github-code
6
[ { "api_name": "numpy.dot", "line_number": 17, "usage_type": "call" }, { "api_name": "pandas.read_fwf", "line_number": 23, "usage_type": "call" }, { "api_name": "sklearn.utils.shuffle", "line_number": 27, "usage_type": "call" }, { "api_name": "sklearn.model_selecti...
1712958551
import os import sys import time import socket import paramiko import scp class TransferAgent: def __init__(self, config, data_dir): self.remote_user = config['Network']['remote_user'] self.remote_host = config['Network']['remote_host'] self.remote_path = config['Network']['remote_path'...
willdickson/ethocam
software/ethocam_daq/ethocam_daq/file_transfer.py
file_transfer.py
py
2,852
python
en
code
5
github-code
6
[ { "api_name": "socket.gethostname", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_number": 28, "usage_type": "attribute" }, { "api_name": "paramiko.SSHClient", ...
45254708036
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Aug 26 11:31:00 2021 @author: kirsh012 Description: Plots Autoencoder results without an AUC threshold """ import time start = time.time() from pathlib import Path import os import sys import numpy as np import matplotlib.pyplot as plt import seab...
tk27182/masters-thesis
Code/plot_autoencoder_results.py
plot_autoencoder_results.py
py
4,120
python
en
code
0
github-code
6
[ { "api_name": "time.time", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 28, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 33, "usage_type": "call" }, { "api_name": "pickle.load", "line_number":...
37377212508
import os import yaml import os.path as osp from utils.util import OrderedYaml Loader, Dumper = OrderedYaml() def parse(opt_path): with open(opt_path, mode='r') as f: opt = yaml.load(f, Loader=Loader) os.environ['CUDA_VISIBLE_DEVICES'] = opt['gpu_ids'] opt['path']['root'] = osp.abspath(osp.jo...
XLearning-SCU/2023-CVPR-FPL
codes/options/options.py
options.py
py
1,854
python
en
code
5
github-code
6
[ { "api_name": "utils.util.OrderedYaml", "line_number": 5, "usage_type": "call" }, { "api_name": "yaml.load", "line_number": 9, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.abspath", ...
529460697
import requests, re, time base_url = 'http://jwglxt.gxufe.edu.cn/taglib/DataTable.jsp?tableId=6393005' all_list = [] form_header = { "Host": "jwglxt.gxufe.edu.cn", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0", "Accept": "text/html,application/xhtml...
lingyunyi/PythonLittleProject
210311 - caiyuanSocrePull/main.py
main.py
py
2,029
python
en
code
0
github-code
6
[ { "api_name": "requests.post", "line_number": 38, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 39, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 40, "usage_type": "call" } ]
5034452234
""" refactors out the logic of handling files from the server itself """ from drapache import dbpy import re import os from drapache import util from drapache.util.http import Response import markdown def register(handler_list,checkfunction,func): handler_list.append({'check':checkfunction,'handler':func}) d...
louissobel/Drapache
drapache/dbfilehandlers.py
dbfilehandlers.py
py
4,209
python
en
code
199
github-code
6
[ { "api_name": "drapache.dbpy.execute.execute", "line_number": 56, "usage_type": "call" }, { "api_name": "drapache.dbpy.execute", "line_number": 56, "usage_type": "attribute" }, { "api_name": "drapache.dbpy", "line_number": 56, "usage_type": "name" }, { "api_name":...
4830402283
from django.contrib.auth import authenticate, login from django.shortcuts import render from django.http import HttpResponse, Http404, HttpResponseRedirect, QueryDict from django.views import View from graf_analysis import grafanaFormatter from sosgui import _log, settings from sosdb import Sos import traceback as tb i...
nick-enoent/sosdb-grafana
grafana/views.py
views.py
py
14,020
python
en
code
1
github-code
6
[ { "api_name": "sosgui._log.MsgLog", "line_number": 23, "usage_type": "call" }, { "api_name": "sosgui._log", "line_number": 23, "usage_type": "name" }, { "api_name": "numpy.integer", "line_number": 26, "usage_type": "attribute" }, { "api_name": "numpy.floating", ...
21200921834
import json import os.path with open('./text/AA/wiki_00', encoding='utf-8') as file: file_contents = file.read() json_objects = json.loads(file_contents) for item in json_objects: item_id = item['id'] if os.path.isfile('./wikidata/' + str(item_id) + '.jpg'): with open('./wikidata/' + str(item_id)...
markoeltermann/CourseProject
WikiXmlPostProcesssing.py
WikiXmlPostProcesssing.py
py
565
python
en
code
0
github-code
6
[ { "api_name": "json.loads", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.path.isfile", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path", "line_n...
9767157490
from collections import Iterable import networkx as nx import numpy as np from rich import print as rprint def solve_mapping(possibilities: dict[any, Iterable]) -> dict: """ Takes a dict of possible values each key can take on, and applies a bipartite maximum matching to solve the constraints. :para...
smartspot2/advent-of-code
common/utils/misc_utils.py
misc_utils.py
py
2,834
python
en
code
0
github-code
6
[ { "api_name": "collections.Iterable", "line_number": 8, "usage_type": "name" }, { "api_name": "networkx.Graph", "line_number": 18, "usage_type": "call" }, { "api_name": "networkx.bipartite.maximum_matching", "line_number": 19, "usage_type": "call" }, { "api_name":...
27651183947
import sys from classes.grafo_lista_adj import GrafoListaAdj from classes.grafo_matriz_adj import GrafoMatrizAdj from utils.obter_arestas import obterArestas import itertools class GrafoLib: def __init__(self, config): self.tipo_representacao = config['tipo_representacao'] self.caminho_arq = confi...
thiago1591/grafos-lib
classes/grafo_lib.py
grafo_lib.py
py
5,520
python
pt
code
0
github-code
6
[ { "api_name": "utils.obter_arestas.obterArestas", "line_number": 15, "usage_type": "call" }, { "api_name": "classes.grafo_lista_adj.GrafoListaAdj", "line_number": 20, "usage_type": "call" }, { "api_name": "classes.grafo_matriz_adj.GrafoMatrizAdj", "line_number": 22, "usag...
34861228677
from statuspage.forms import StatusPageModelBulkEditForm from utilities.forms import StaticSelect, StaticSelectMultiple, add_blank_choice, BulkEditNullBooleanSelect from .. import choices from ..models import Incident, IncidentUpdate, IncidentTemplate from django import forms from components.models import Component __...
Status-Page/Status-Page
statuspage/incidents/forms/bulk.py
bulk.py
py
2,779
python
en
code
45
github-code
6
[ { "api_name": "statuspage.forms.StatusPageModelBulkEditForm", "line_number": 15, "usage_type": "name" }, { "api_name": "django.forms.ChoiceField", "line_number": 16, "usage_type": "call" }, { "api_name": "django.forms", "line_number": 16, "usage_type": "name" }, { ...
14951215246
"""modify users column make email unique Revision ID: 57754eb9dc08 Revises: de5cc16433c6 Create Date: 2023-07-09 12:07:29.270265 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '57754eb9dc08' down_revision = 'de5cc16433c6' branch_labels = None depends_on = None...
Ruzell11/web-py
alembic/versions/57754eb9dc08_modify_users_column_make_email_unique.py
57754eb9dc08_modify_users_column_make_email_unique.py
py
653
python
en
code
0
github-code
6
[ { "api_name": "alembic.op.alter_column", "line_number": 20, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 20, "usage_type": "name" }, { "api_name": "sqlalchemy.String", "line_number": 20, "usage_type": "call" }, { "api_name": "alembic.op.creat...
70143356987
import pytest from src.user.tests.conftest import VALID_ADDRESS, OTHER_VALID_ADDRESS, INVALID_ADDRESS_FIELDS from src.user.address_management import Address @pytest.mark.django_db class TestAddressCreationSuccess: def test_correct_http_response(self, create_address): """GIVEN valid address and an authen...
JokusPokus/pcb_shop
src/user/tests/address_api_tests.py
address_api_tests.py
py
14,169
python
en
code
0
github-code
6
[ { "api_name": "src.user.tests.conftest.VALID_ADDRESS.copy", "line_number": 22, "usage_type": "call" }, { "api_name": "src.user.tests.conftest.VALID_ADDRESS", "line_number": 22, "usage_type": "name" }, { "api_name": "src.user.tests.conftest.VALID_ADDRESS", "line_number": 39, ...
15925985053
import serial import signal import sys capture = True def signal_handler(sig, frame): global capture print('You pressed Ctrl+C!') capture = False signal.signal(signal.SIGINT, signal_handler) print('Press Ctrl+C') buffSize = 360 port = '/dev/ttyACM0' baudrate = 4000000 ser = serial.Serial(None, baudrat...
avionic-iot-aviot/SDNWiMesh
microphone-receiver.py
microphone-receiver.py
py
946
python
en
code
0
github-code
6
[ { "api_name": "signal.signal", "line_number": 13, "usage_type": "call" }, { "api_name": "signal.SIGINT", "line_number": 13, "usage_type": "attribute" }, { "api_name": "serial.Serial", "line_number": 20, "usage_type": "call" } ]
5702215101
#-*- coding:utf-8 -*- import urllib.request,json import smtplib import email.mime.multipart from email.mime.text import MIMEText def weather_ali(): host = 'http://jisutqybmf.market.alicloudapi.com' path = '/weather/query' method = 'GET' appcode = 'appcode' querys = 'city=%E6%88%90%E9%83%BD&citycode=...
qq1066536/MyCodeGit
python/阿里天气.py
阿里天气.py
py
2,615
python
en
code
1
github-code
6
[ { "api_name": "urllib.request.request.Request", "line_number": 14, "usage_type": "call" }, { "api_name": "urllib.request.request", "line_number": 14, "usage_type": "attribute" }, { "api_name": "urllib.request", "line_number": 14, "usage_type": "name" }, { "api_nam...
27366339916
#!/usr/bin/python # -*- coding: UTF-8 -*- import xml.sax import xml.sax.handler class AnnotationData: def __init__(self): self.serial = '' self.bookName = '' self.bookId = 0 self.starthtmlPath = '' self.startparagraphId = 0 self.startelementId = 0 self.start...
2240831304/pythonserver
readrecord/handlerequest/annotationdataparse.py
annotationdataparse.py
py
3,147
python
en
code
0
github-code
6
[ { "api_name": "xml.sax.sax", "line_number": 27, "usage_type": "attribute" }, { "api_name": "xml.sax", "line_number": 27, "usage_type": "name" } ]
28569439772
""" I don't know what exactly this module does """ from vk_api import make_vk_api_request from creds import access_token import json def load_json_data_from_file(filename): with open(filename) as data_file: data = json.load(data_file) return data def get_id_list(json_data): id_list = [] for...
dlbas/vk_telebot
get_recent_news.py
get_recent_news.py
py
707
python
en
code
0
github-code
6
[ { "api_name": "json.load", "line_number": 12, "usage_type": "call" }, { "api_name": "vk_api.make_vk_api_request", "line_number": 28, "usage_type": "call" }, { "api_name": "creds.access_token", "line_number": 28, "usage_type": "argument" } ]
11354658233
#!/usr/bin/env python """ WordCNN Model from Kim Y. 2014. Convolutional Neural Network for Sentence Classification In Proceedings of EMNLP. """ from keras.layers import Input, Dense, Embedding, Convolution1D, MaxPooling1D from keras.layers import Flatten, Concatenate, Dropout from keras.models import Model from keras....
jihopark/abusive-language
model/word_cnn.py
word_cnn.py
py
2,392
python
en
code
14
github-code
6
[ { "api_name": "keras.layers.Input", "line_number": 26, "usage_type": "call" }, { "api_name": "keras.layers.Embedding", "line_number": 29, "usage_type": "call" }, { "api_name": "keras.layers.Embedding", "line_number": 34, "usage_type": "call" }, { "api_name": "kera...
23394127209
from django.shortcuts import render from django.http import HttpResponse from .models import Site, Version from . import scraper from .notify_helper import notify def versionView(request, version): v = Version.objects.filter(id=version).first() return render(request, 'observer/version.html', {'v': v, 'update...
TYuto/web_observer
observer/views.py
views.py
py
1,345
python
en
code
0
github-code
6
[ { "api_name": "models.Version.objects.filter", "line_number": 10, "usage_type": "call" }, { "api_name": "models.Version.objects", "line_number": 10, "usage_type": "attribute" }, { "api_name": "models.Version", "line_number": 10, "usage_type": "name" }, { "api_name...
38829532815
from django.shortcuts import redirect, render from .models import ChatRoom , Privatenotifications from django.contrib.auth.decorators import login_required from django.http import JsonResponse from django.utils.dateformat import DateFormat from django.utils.formats import get_format from django.contrib import messages...
hiteshkhatana/chatroom
chat/views.py
views.py
py
3,676
python
en
code
0
github-code
6
[ { "api_name": "django.shortcuts.redirect", "line_number": 20, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 22, "usage_type": "call" }, { "api_name": "django.contrib.auth.decorators.login_required", "line_number": 14, "usage_type": "call"...
30357670961
import logging from pyface.qt import QtCore, QtGui, is_pyside from traits.api import Any, Callable, List, Str, TraitError, Tuple from .editor_factory import TextEditor as BaseTextEditor from .editor import EditorWithList logger = logging.getLogger(__name__) # -----------------------------------------------------...
enthought/traitsui
traitsui/qt/check_list_editor.py
check_list_editor.py
py
8,679
python
en
code
290
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "editor.EditorWithList", "line_number": 19, "usage_type": "name" }, { "api_name": "traits.api.List", "line_number": 27, "usage_type": "call" }, { "api_name": "traits.api.St...
31644510539
from __future__ import annotations from typing import List from fastapi import APIRouter, Depends, HTTPException, status from sqlalchemy.orm import Session from starlette.responses import Response from ecommerce.auth.jwt import get_current_user from ecommerce.db import db from ecommerce.products import schema, servi...
lordavadon2/ecommerce-fastapi
ecommerce/products/router.py
router.py
py
3,263
python
en
code
0
github-code
6
[ { "api_name": "fastapi.APIRouter", "line_number": 14, "usage_type": "call" }, { "api_name": "ecommerce.products.schema.Category", "line_number": 21, "usage_type": "attribute" }, { "api_name": "ecommerce.products.schema", "line_number": 21, "usage_type": "name" }, { ...
3027354466
from __future__ import absolute_import, print_function import torch import numpy as np import torch.fft device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") # Derives from ProGamerGov's implementation of color decorellation. class RGB_decorrelation: def __init__(self): self.color_corr...
Perrigatoni/Feature-Visualization
featurevis/image_classes.py
image_classes.py
py
5,958
python
en
code
1
github-code
6
[ { "api_name": "torch.device", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.tensor", ...
34441386926
"""Implementation of a Logger class.""" import json import os import numpy as np import torch class Logger(object): """Class that implements a logger of statistics. Parameters ---------- name: str References ---------- Code from https://github.com/sebascuri/rllib.git. """ def _...
nuria95/O-RAAC
oraaclib/util/logger.py
logger.py
py
1,845
python
en
code
32
github-code
6
[ { "api_name": "os.path.exists", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_number": 27, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 28, "usage_type": "call" }, { "api_name": "torch.Tensor", "line_numb...
55821638
import os import sys import json import datetime import numpy as np import skimage.draw import cv2 import matplotlib.pyplot as plt import tensorflow as tf from keras.backend.tensorflow_backend import set_session # Habilitando o Tensorflow para operar na GPU config = tf.ConfigProto(gpu_options = tf.GPUOptions(per_proce...
AndersonOliveiraDaRocha/BiMasterPucRio
CUSTOM/custom.py
custom.py
py
7,049
python
pt
code
0
github-code
6
[ { "api_name": "tensorflow.ConfigProto", "line_number": 13, "usage_type": "call" }, { "api_name": "tensorflow.GPUOptions", "line_number": 13, "usage_type": "call" }, { "api_name": "tensorflow.Session", "line_number": 15, "usage_type": "call" }, { "api_name": "keras...
15798551751
from typing import List import math import tensorflow as tf from keras import backend as K from keras import layers from keras.models import Model from keras.utils import get_file from keras.utils import get_source_inputs from keras_applications.imagenet_utils import _obtain_input_shape from keras_applications.imagene...
titu1994/keras_mixnets
keras_mixnets/mixnets.py
mixnets.py
py
28,622
python
en
code
39
github-code
6
[ { "api_name": "keras_applications.imagenet_utils.preprocess_input", "line_number": 30, "usage_type": "call" }, { "api_name": "keras.backend", "line_number": 30, "usage_type": "name" }, { "api_name": "keras_mixnets.custom_objects.MixNetConvInitializer", "line_number": 94, ...
72796556028
"""Models used in the database.""" from peewee import (BooleanField, CharField, CompositeKey, ForeignKeyField, IntegerField, Model) from python.db.connection import Connection class BaseModel(Model): """A base model that will use our SQLite database.""" class Meta: """Meta class for the base...
ChuOkupai/m2-amis-projet
srcs/python/db/models.py
models.py
py
982
python
en
code
2
github-code
6
[ { "api_name": "peewee.Model", "line_number": 8, "usage_type": "name" }, { "api_name": "python.db.connection.Connection.get_instance", "line_number": 13, "usage_type": "call" }, { "api_name": "python.db.connection.Connection", "line_number": 13, "usage_type": "name" }, ...
36670584484
# -*- coding: utf-8 -*- import sys import xlsxwriter import xlrd from datetime import datetime reload(sys) sys.setdefaultencoding('utf-8') from os.path import expanduser class wrExcel(): def __init__(self, code, date): self.home = expanduser("~") self.code = code s...
jackusa/Automatic-Trading-System
saveExcel.py
saveExcel.py
py
2,554
python
en
code
1
github-code
6
[ { "api_name": "sys.setdefaultencoding", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.expanduser", "line_number": 15, "usage_type": "call" }, { "api_name": "xlsxwriter.Workbook", "line_number": 20, "usage_type": "call" }, { "api_name": "xlrd.ope...
20200564637
import json import yaml import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt def plot_curves(curves, out_pdf, selected_indices=None, selected_names=None): pts_per_inch = 72. if 'page_setup' in curves: plt.figure(figsize=(curves['page_setup']['width']/pts_per_inch, curves['page_setup']['heig...
kandrosov/PdfPlotExtractor
plot_curves.py
plot_curves.py
py
2,436
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.use", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 11, "usage_type": "name" }, { "api_name": "matplotlib.p...
7328747850
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import math, copy, time from torch.autograd import Variable import matplotlib.pyplot as plt import seaborn seaborn.set_context(context="talk") class Batch: "Object for holding a batch of data with mask during training." de...
RUOK90/various_transformers
dummy.py
dummy.py
py
8,894
python
en
code
0
github-code
6
[ { "api_name": "seaborn.set_context", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.autograd.Variable", "line_number": 29, "usage_type": "call" }, { "api_name": "torch.nn.Module", "line_number": 50, "usage_type": "attribute" }, { "api_name": "torc...
70077328507
import streamlit as st from myFunctions import Gustavo import pytest st.set_page_config( page_title="Sherlock Links", page_icon=":telescope", layout="centered", initial_sidebar_state="expanded" ) def main_page(): st.markdown("# Sherlock Links 🔭") st.markdown('#### Gustavo Duarte e Silva') ...
gustavo-duarte-silva/ProjetoFinalPythonPRO
projetofinalPRO/mainProgram.py
mainProgram.py
py
1,778
python
en
code
0
github-code
6
[ { "api_name": "streamlit.set_page_config", "line_number": 5, "usage_type": "call" }, { "api_name": "streamlit.markdown", "line_number": 13, "usage_type": "call" }, { "api_name": "streamlit.markdown", "line_number": 14, "usage_type": "call" }, { "api_name": "stream...
15405198426
from PyQt5 import QtWidgets from worginform import Ui_WorginForm import worgin import sys class WorginUi(QtWidgets.QWidget): def __init__(self): super(WorginUi, self).__init__() self.ui = Ui_WorginForm() self.ui.setupUi(self) self.ui.addBtn.clicked.connect(self.addWoIToList) ...
omortie/worgin
worginui.py
worginui.py
py
1,150
python
en
code
0
github-code
6
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 9, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidgets", "line_number": 9, "usage_type": "name" }, { "api_name": "worginform.Ui_WorginForm", "line_number": 12, "usage_type": "call" }, { "api_name": "w...
31270856131
# -*-coding:utf-8 -*- import base64 import hashlib import hmac import json from urllib.parse import urlparse import requests from qiniu import QiniuMacAuth, Auth from requests.adapters import HTTPAdapter from urllib3 import Retry import configs class BaseSDK(object): _ACCESS_KEY = configs.ACCESS_KEY _SECRET...
celerysoft/QiniuCloudSDK
sdk/base.py
base.py
py
2,334
python
en
code
0
github-code
6
[ { "api_name": "configs.ACCESS_KEY", "line_number": 17, "usage_type": "attribute" }, { "api_name": "configs.SECRET_KEY", "line_number": 18, "usage_type": "attribute" }, { "api_name": "requests.Session", "line_number": 27, "usage_type": "call" }, { "api_name": "urll...
8909192797
import base64 from io import BytesIO import imagehash import PIL import requests class Image: """ An image class to calculate the dhash value and create preview images. """ def __init__(self, img_url: str): """Constructor Args: img_url (str): The image to load. "...
SebastianBach/searcher
searcher/image.py
image.py
py
2,221
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 24, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 25, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 25, "usage_type": "attribute" }, { "api_name": "io.BytesIO", "line_num...
73106997309
from datetime import datetime as dt import os import numpy as np from pandas import to_datetime as td import yaml THIS_DIR = os.path.dirname(os.path.realpath(__file__)) def calculate_torque(power, rpm): """ Accepts scalars and np.array() as input :param power: (W) :param rpm: (1/60s) :return torq...
stefano-v37/cyperana
CyPerAna/utilities.py
utilities.py
py
2,411
python
en
code
0
github-code
6
[ { "api_name": "os.path.dirname", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.pi", "line_numbe...
17704126277
from fast_dash import FastDash, Fastify from fast_dash.Components import Text from dash import dcc from utils import translate # Fastify Dash's dropdown component dropdown = Fastify(DashComponent=dcc.Dropdown(options={x:x for x in ['French', 'Spanish', 'German']}), modify_property='value') def translate_from_english...
bridgecrew-perf6/fast_dash
examples/Translate to multiple languages/app.py
app.py
py
959
python
en
code
null
github-code
6
[ { "api_name": "fast_dash.Fastify", "line_number": 8, "usage_type": "call" }, { "api_name": "dash.dcc.Dropdown", "line_number": 8, "usage_type": "call" }, { "api_name": "dash.dcc", "line_number": 8, "usage_type": "name" }, { "api_name": "utils.translate", "line...
34115337337
import cv2 import numpy as np import matplotlib.pyplot as plt def LineDetection(): img_1 = input('Your image: ') print('OK') img_2 = cv2.imread(img_1, cv2.IMREAD_GRAYSCALE) img = cv2.Canny(img_2, 50, 200) lines = cv2.HoughLinesP(img, rho=1, theta=np.deg2rad(0...
NagiWang/Line
Line/Line.py
Line.py
py
791
python
en
code
0
github-code
6
[ { "api_name": "cv2.imread", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.IMREAD_GRAYSCALE", "line_number": 8, "usage_type": "attribute" }, { "api_name": "cv2.Canny", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.HoughLinesP", "li...
13321462554
from airflow.models import Variable from airflow.hooks.postgres_hook import PostgresHook import requests def remove_deleted_content_items(ds, *args, **kwargs): if "client" not in kwargs or kwargs["client"] is None: raise Exception("You must configure a client for this operator") headers = {"Authoriza...
CrossingsCommunityChurch/apollos-shovel
dags/rock/rock_deleted_content_items_dag.py
rock_deleted_content_items_dag.py
py
1,894
python
en
code
0
github-code
6
[ { "api_name": "airflow.models.Variable.get", "line_number": 10, "usage_type": "call" }, { "api_name": "airflow.models.Variable", "line_number": 10, "usage_type": "name" }, { "api_name": "airflow.hooks.postgres_hook.PostgresHook", "line_number": 14, "usage_type": "call" ...
71257756668
import asyncio from io import BytesIO from PIL import Image as PillowImage from telegram import Bot from app.config import Config from app.extensions import scheduler from app.main import db from app.models import Image from app.storage import ImageStorage @scheduler.task( "interval", id="upload_to_telegram...
IllusionOfControl/sansetto_bot
app/tasks.py
tasks.py
py
1,575
python
en
code
0
github-code
6
[ { "api_name": "app.extensions.scheduler.app.app_context", "line_number": 21, "usage_type": "call" }, { "api_name": "app.extensions.scheduler.app", "line_number": 21, "usage_type": "attribute" }, { "api_name": "app.extensions.scheduler", "line_number": 21, "usage_type": "n...
18677217585
import logging import os import random import sys from collections import OrderedDict import numpy as np import torch import torch.backends.cudnn as cudnn import torch.nn.functional as F import torch.nn as nn class AverageMeter(object): """Computes and stores the average and current value""" def __init__(se...
ShunLu91/PA-DA
nasbench201/utils.py
utils.py
py
3,951
python
en
code
29
github-code
6
[ { "api_name": "random.seed", "line_number": 58, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 59, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 59, "usage_type": "attribute" }, { "api_name": "torch.manual_seed", ...
4397909460
import os import zipfile from ..utils import word_list from ..core.config import CLI_MODE if CLI_MODE == True: from ..cli.progress import cli_progress as progress from ..cli.dialogs import dialog_import, dialog_vok_merge_yn,\ dialog_vok_merge_edit from sys import argv else: from ..g...
tuxor1337/voktrainer
vok/actions/vok.py
vok.py
py
6,928
python
en
code
1
github-code
6
[ { "api_name": "core.config.CLI_MODE", "line_number": 6, "usage_type": "name" }, { "api_name": "gui.dialogs.dialog_vok_merge_yn", "line_number": 18, "usage_type": "call" }, { "api_name": "gui.dialogs.dialog_vok_merge_edit", "line_number": 27, "usage_type": "call" }, { ...
33536357948
from pathlib import Path import sys from invoke import task @task(name="list_tasks", default=True) def _tasks(c): """Show the current list of tasks""" filepath = Path(__file__) with c.cd(filepath.parent): c.run(f"{sys.executable} -m invoke -c {filepath.stem} -l") @task def new_post(c, name): ...
gabrielecalvo/gabrielecalvo.github.io
tasks.py
tasks.py
py
570
python
en
code
0
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.executable", "line_number": 11, "usage_type": "attribute" }, { "api_name": "invoke.task", "line_number": 6, "usage_type": "call" }, { "api_name": "invoke.task", "line_nu...
70207356029
import numpy as np from statistics import mean from scipy.interpolate import make_lsq_spline import matplotlib.pyplot as plt def knot_points1(nknots, x, degree): #create the knot locations knots = np.linspace(x[0], x[-1], nknots) lo = min(x[0], knots[0]) #we have to add these min and values to conform b...
coolxerxes/xerxes-alex-aws-gesture
newspmodel/pre_utils.py
pre_utils.py
py
1,122
python
en
code
0
github-code
6
[ { "api_name": "numpy.linspace", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.append", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.array", "line_nu...
71595482427
from unittest.case import TestCase from flask.typing import StatusCode from flask.wrappers import Request import sys, os from werkzeug.wrappers import response sys.path.append("./src") import unittest from src.EncodeDecode import EncodeDecode from src import tinyurl class test_encode(unittest.TestCase): def set...
yoohannes/shortURL
test/test_encode.py
test_encode.py
py
1,626
python
en
code
0
github-code
6
[ { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "unittest.TestCase", "line_number": 14, "usage_type": "attribute" }, { "api_name": "src.tinyurl.tinyur...
72531756989
""" Base model classes for schemas in OpenAPI specs (OAS) for this service """ from typing import Any from pydantic import BaseModel, Extra from ..utils.change_case import snake_to_camel class EmptyModel(BaseModel): # Used to represent body={} class Config: extra = Extra.forbid class InputSc...
ITISFoundation/osparc-simcore
packages/models-library/src/models_library/api_schemas_webserver/_base.py
_base.py
py
1,964
python
en
code
35
github-code
6
[ { "api_name": "pydantic.BaseModel", "line_number": 13, "usage_type": "name" }, { "api_name": "pydantic.Extra.forbid", "line_number": 16, "usage_type": "attribute" }, { "api_name": "pydantic.Extra", "line_number": 16, "usage_type": "name" }, { "api_name": "pydantic...
9088438138
from django.db import models from django.conf import settings from datetime import datetime class Game (models.Model): game_location = models.CharField(max_length=50, blank=True) fundraising_link = models.CharField(max_length=127, blank=True) start_date = models.DateField(null=True, blank=True) end_date = models.D...
knoopr/ShotForTheHeart
ShotForTheHeart/models/Game.py
Game.py
py
2,250
python
en
code
0
github-code
6
[ { "api_name": "django.db.models.Model", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 5, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 6, "usage_type": "call" }, { "api_name": "...
40449822038
from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals import codecs from collections import OrderedDict import json import os import unicodecsv from commoncode.testcase import FileBasedTesting import json2csv def load_csv(location): """ Load a...
darcyfdu/findlicense
etc/scripts/test_json2csv.py
test_json2csv.py
py
12,311
python
en
code
2
github-code
6
[ { "api_name": "codecs.open", "line_number": 22, "usage_type": "call" }, { "api_name": "unicodecsv.DictReader", "line_number": 23, "usage_type": "call" }, { "api_name": "shutil.copy2", "line_number": 37, "usage_type": "call" }, { "api_name": "commoncode.testcase.Fi...
27094943059
import torch from torch import nn from einops import rearrange, repeat from einops.layers.torch import Rearrange class Encoder(nn.Module): def __init__(self, patch_dim, nb_layers, nb_heads, one_head_dim, ff_dim, dropout = 0.0): super().__init__() self.layers = nn.ModuleList([]) for _ in ran...
phelchegs/bms-molecular-translation
model/ViT_encoder.py
ViT_encoder.py
py
2,630
python
en
code
1
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 6, "usage_type": "name" }, { "api_name": "torch.nn.ModuleList", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.nn", "line_n...
28148699561
import cv2 import pickle import os import numpy as np import pandas as pd from datetime import datetime #path untuk file recognizer recognizer_path = './recognizer' encodings_file = os.path.join(recognizer_path, 'encodings.pickle') #load file recognizer with open(encodings_file, 'rb') as f: data = pickle.load(f) ...
okta4294/Real_Time_Face_Presensi
face_recognition.py
face_recognition.py
py
2,293
python
en
code
1
github-code
6
[ { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pickle.load", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.CascadeClassifier", "line...
10230197945
from typing import Optional from urllib.parse import parse_qs, urlparse from datasets import load_dataset from pydantic import BaseModel import evals import evals.metrics from evals.api import CompletionFn from evals.formatting import make_abc from evals.record import RecorderBase class Sample(BaseModel): quest...
openai/evals
evals/elsuite/multiple_choice.py
multiple_choice.py
py
2,729
python
en
code
12,495
github-code
6
[ { "api_name": "pydantic.BaseModel", "line_number": 14, "usage_type": "name" }, { "api_name": "urllib.parse.urlparse", "line_number": 21, "usage_type": "call" }, { "api_name": "urllib.parse.parse_qs", "line_number": 23, "usage_type": "call" }, { "api_name": "datase...
8041409439
import pymongo from pymongo import MongoClient from bson.objectid import ObjectId # used to id query conn = MongoClient("localhost", 27017) db = conn.study collection = db.student res = collection.find({"age": {"$gt": 18}}) print(res.count()) for row in res: print(row) print(type(row)) ''' return all reco...
zuohd/python-excise
database/query_document.py
query_document.py
py
728
python
en
code
0
github-code
6
[ { "api_name": "pymongo.MongoClient", "line_number": 5, "usage_type": "call" }, { "api_name": "bson.objectid.ObjectId", "line_number": 24, "usage_type": "call" }, { "api_name": "pymongo.DESCENDING", "line_number": 28, "usage_type": "attribute" } ]
19483668877
#for basic rendering of html pages from django.shortcuts import render, render_to_response, redirect from django.template import RequestContext from django.http import HttpResponse, HttpResponseRedirect, Http404, FileResponse #for authentication login and logout from django.contrib.auth import login as auth_login from...
rishshah/RePlace
PlacementPortal/ic/views.py
views.py
py
5,004
python
en
code
2
github-code
6
[ { "api_name": "django.contrib.auth.logout", "line_number": 35, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "line_number": 36, "usage_type": "call" }, { "api_name": "django.contrib.auth.decorators.login_required", "line_number": 32, "usage_type": "ca...
73944972988
import io import os from google.cloud import speech_v1p1beta1 as speech def transcribe_audio(file_name): client = speech.SpeechClient() with io.open(file_name, "rb") as audio_file: content = audio_file.read() audio = speech.types.RecognitionAudio(content=content) config = speech.types.Rec...
colanconnon/cs410project
cs410videosearchengine/cs410videosearchengine/utils.py
utils.py
py
630
python
en
code
0
github-code
6
[ { "api_name": "google.cloud.speech_v1p1beta1.SpeechClient", "line_number": 7, "usage_type": "call" }, { "api_name": "google.cloud.speech_v1p1beta1", "line_number": 7, "usage_type": "name" }, { "api_name": "io.open", "line_number": 8, "usage_type": "call" }, { "api...
26913265951
import os import pygame as pg from data.handTracking import handDetector from .states import classic, menu, mode, options, controls, audio, ghost, splash, keybinding, getkey import cv2 import math class Control(): def __init__(self, fullscreen, difficulty, size): pg.mixer.pre_init(44100, -16, 1, 512) ...
meganskrobacz/CCIS
Pong_Hand_Detection_Dec_2021/data/control.py
control.py
py
5,238
python
en
code
0
github-code
6
[ { "api_name": "pygame.mixer.pre_init", "line_number": 12, "usage_type": "call" }, { "api_name": "pygame.mixer", "line_number": 12, "usage_type": "attribute" }, { "api_name": "pygame.init", "line_number": 13, "usage_type": "call" }, { "api_name": "pygame.display.se...
30167679016
import os import sys import time import pickle import pandas as pd from sklearn.neural_network import MLPRegressor from sklearn.model_selection import train_test_split def main(filename): df = pd.read_csv(filename) X = df[['theta1', 'theta2', 'dtheta1', 'dtheta2', 'ddtheta1', 'ddtheta2']].values y = df[['...
cmower/two_dof_robot
learn_inverse_dynamics_training.py
learn_inverse_dynamics_training.py
py
1,165
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 15, "usage_type": "call" }, { "api_name": "sklearn.neural_network.MLPRegressor", "line_number": 17, "usage_type": "call" ...
12495543719
import arcade width = 1280 height = 640 # Load the image background = arcade.load_texture("map_1.png") penguin = arcade.Sprite("penguin.png") penguin.bottom = 500 penguin.left = 0 penguin.change_x = 5 gravity = -0.2 arcade.open_window(width, height, "Animal jump") arcade.set_background_color(arcade.color.SKY_BLUE) ...
tt-n-walters/thebridge-week1
level.py
level.py
py
1,005
python
en
code
0
github-code
6
[ { "api_name": "arcade.load_texture", "line_number": 7, "usage_type": "call" }, { "api_name": "arcade.Sprite", "line_number": 8, "usage_type": "call" }, { "api_name": "arcade.open_window", "line_number": 15, "usage_type": "call" }, { "api_name": "arcade.set_backgro...
75276604346
import random import matplotlib.pyplot as plt import matplotlib.ticker as ticker import csv import numpy as np import time import requests import os IP = "http://100.26.232.128:5000/" def update_config(size, policy): """ Update cache config :param size: max cache capacity (str) :param policy: enum("R...
jiaxilyu/mnist_DCGAN
ece1779/a2/perftest/perf_test.py
perf_test.py
py
8,058
python
en
code
0
github-code
6
[ { "api_name": "requests.post", "line_number": 24, "usage_type": "call" }, { "api_name": "time.perf_counter", "line_number": 41, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 42, "usage_type": "call" }, { "api_name": "time.perf_counter", ...
8175791145
from tir import Webapp from tir import ApwInternal from datetime import datetime import pandas as pd import locale as lo filial="01010001" dataalt="01/08/2020" tipoalt="007" dataAdimissao = "" lo.setlocale(lo.LC_MONETARY,'pt_BR.UTF-8') DataSytem = datetime.today().strftime('%d/%m/%Y') oHelper = Webap...
Okamael/DigitaAlteracaoSalario
dissidio.py
dissidio.py
py
1,547
python
pt
code
0
github-code
6
[ { "api_name": "locale.setlocale", "line_number": 13, "usage_type": "call" }, { "api_name": "locale.LC_MONETARY", "line_number": 13, "usage_type": "attribute" }, { "api_name": "datetime.datetime.today", "line_number": 14, "usage_type": "call" }, { "api_name": "date...
70818540668
# -*- coding: utf-8 -*- """ Created on Tue Jan 28 10:47:01 2020 @author: wayne """ #from metadata import metadata import math import csv import pandas #from math import sqrt import sys,os sys.path.append(os.sys.path[0]) #import arcpy import richdem as rd import numpy as np import glob import rasteri...
ChaoEcohydroRS/FlorenceFlood_UAVSAR_Repo
UAVSAR/PolarSARpro/RadiometricNormalization_7.py
RadiometricNormalization_7.py
py
11,036
python
en
code
3
github-code
6
[ { "api_name": "sys.path.append", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.sys", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.chdir", "line_number...
21666332184
from typing import Optional class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right class BST: #Return node with val if it is present, else return None. It is recursive with no helper method. def searchBST(self, root: O...
Adam-1776/Practice
DSA/BST/BST.py
BST.py
py
1,719
python
en
code
0
github-code
6
[ { "api_name": "typing.Optional", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 23, "usage_type": "name" } ]
2745837897
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function, absolute_import import os import torch from torch.utils.data import Dataset class Human36m(Dataset): def __init__(self, data_path, is_train=True): self.data_path = data_path self.is_train = is_train self.train_input, self.train...
zhengxiangyue/joint_capture
src/dataset.py
dataset.py
py
2,148
python
en
code
3
github-code
6
[ { "api_name": "torch.utils.data.Dataset", "line_number": 8, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.join", ...
27600794984
''' Implements classes for preparing the image data for CNN classification ''' from PIL import Image import os import joblib class PrepareImageData(): """The main class for preparing the datasets for CNN classification""" def __init__(self, product_df, image_details_df, image_path): """ Args: ...
shbz80/fb_marketplace_api
prepare_image_data.py
prepare_image_data.py
py
6,766
python
en
code
0
github-code
6
[ { "api_name": "PIL.Image.open", "line_number": 60, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 60, "usage_type": "name" }, { "api_name": "os.getcwd", "line_number": 94, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 95,...
32515379203
from aiohttp import web async def handle_404(request, response): return web.FileResponse('./static/page404.html') async def error_middleware(app, handler): @web.middleware async def middleware_handler(request): try: response = await handler(request) if response.status == ...
riatelab/magrit
magrit_app/helpers/error_middleware404.py
error_middleware404.py
py
587
python
en
code
102
github-code
6
[ { "api_name": "aiohttp.web.FileResponse", "line_number": 5, "usage_type": "call" }, { "api_name": "aiohttp.web", "line_number": 5, "usage_type": "name" }, { "api_name": "aiohttp.web.HTTPException", "line_number": 16, "usage_type": "attribute" }, { "api_name": "aio...
51676351
""" Market impact plots for the thesis. Plot showing the shape of market impact as calculated by Rosenbaum et al. in Paul Jusselin and Mathieu Rosenbaum. “No-arbitrage implies power-law market impact and rough volatility”. """ import numpy as np import scipy.integrate from corai_plot import APlot from tqdm import tqdm...
Code-Cornelius/jump_diff_bubble_II_thesis
experiments/market_impact.py
market_impact.py
py
2,061
python
en
code
0
github-code
6
[ { "api_name": "numpy.linspace", "line_number": 12, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.power", "line_number": 20, "usage_type": "call" }, { "api_name": "scipy.integrate.integrate.quad",...
6184090872
import tkinter as tk from tkinter.font import Font import numpy as np from typing import Optional, List, Tuple, Dict, Literal from cc import GameBuilder, maybe_num_nodes import math """ Util functions. """ def keep_one_dir(edge_index: np.ndarray) -> np.ndarray: return edge_index[:, edge_index[0] < edge_index[1]] ...
zml72062/pebble_game
game_gui.py
game_gui.py
py
14,381
python
en
code
1
github-code
6
[ { "api_name": "numpy.ndarray", "line_number": 11, "usage_type": "attribute" }, { "api_name": "typing.Tuple", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.Tuple", "line...
10359780560
""" The arithmetic sequence, 1487, 4817, 8147, in which each of the terms increases by 3330, is unusual in two ways: (i) each of the three terms are prime, and, (ii) each of the 4-digit numbers are permutations of one another. There are no arithmetic sequences made up of three 1-, 2-, or 3-digit primes, exhibiting...
younes-m/projecteuler_ruby
problems/euler49.py
euler49.py
py
1,507
python
en
code
0
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 59, "usage_type": "call" } ]
18918871052
"""PyTest Fixtures.""" import importlib import os import platform import subprocess import sys import warnings from pathlib import Path import pytest # Ensure we always run from the root of the repository if Path.cwd() != Path(__file__).parent: os.chdir(Path(__file__).parent) # checking if user is running pytest...
ansible/ansible-lint
conftest.py
conftest.py
py
2,821
python
en
code
3,198
github-code
6
[ { "api_name": "pathlib.Path.cwd", "line_number": 13, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 13, "usage_type": "name" }, { "api_name": "os.chdir", "line_number": 14, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_numbe...
12680241876
from matplotlib import pyplot as plt def plot_loss(forecast, reconstruct, total, path): plt.figure() plt.plot(forecast, label="Forecast loss") plt.plot(reconstruct, label="Reconstruct loss") plt.plot(total, label="Total loss") plt.title("Train losses during training") plt.xlabel("Epoch") p...
ForestsKing/MTAD_GAT
utils/plot.py
plot.py
py
397
python
en
code
4
github-code
6
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 5, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 6, "usage_type": "call" }, { "api_name": "matplo...
21722179224
import pandas as pd import plotly.express as px dataframe = pd.read_csv("Integrated_Data.csv") name = [] inverse = [] sum = 0 for x in dataframe.index: name.append(dataframe.loc[x, "Name"]) inverse.append(1.0/float(dataframe.loc[x, "Facility/Demand"])) sum += float(dataframe.loc[x, "Facility/Demand"]) fo...
Nitvr/Datathon_2023
Fund Allocation/Fund_1_inverse_of_fpd.py
Fund_1_inverse_of_fpd.py
py
487
python
en
code
1
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 4, "usage_type": "call" }, { "api_name": "plotly.express.pie", "line_number": 19, "usage_type": "call" }, { "api_name": "plotly.express", "line_number": 19, "usage_type": "name" }, { "api_name": "plotly.express.color...
19685007302
#!/usr/bin/python3 import os import time import pafy from subprocess import PIPE, run from colors import colors colors = colors() def out(command): result = run(command, stdout=PIPE, stderr=PIPE, universal_newlines=True, shell=True) return result.stdout def valid_path(userpath): exist = os.path.exists(u...
rohithvishaal/youtube-video-downloader
ydl.py
ydl.py
py
5,890
python
en
code
1
github-code
6
[ { "api_name": "colors.colors", "line_number": 7, "usage_type": "name" }, { "api_name": "subprocess.run", "line_number": 11, "usage_type": "call" }, { "api_name": "subprocess.PIPE", "line_number": 11, "usage_type": "name" }, { "api_name": "os.path.exists", "lin...
16614573939
# !/usr/bin/python # -*- coding: utf-8 -*- """ __author__ = 'qing.li' """ import logging from settings import BASE_DIR class Logger: def __init__(self, path=None): if path: self.path = path else: self.path = BASE_DIR + '/log/logs/selenium.log' self.logger = logging....
QingqinLi/mooc_ui_web
log/log.py
log.py
py
817
python
en
code
0
github-code
6
[ { "api_name": "settings.BASE_DIR", "line_number": 15, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.FileHandler", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.Strea...
16814914384
import time import wandb import copy import os import numpy as np import itertools from itertools import chain import torch import imageio import warnings import functools from hsp.utils.util import update_linear_schedule from hsp.runner.separated.base_runner import Runner from pathlib import Path from collections impo...
samjia2000/HSP
hsp/runner/separated/overcooked_runner.py
overcooked_runner.py
py
14,067
python
en
code
15
github-code
6
[ { "api_name": "hsp.runner.separated.base_runner.Runner", "line_number": 26, "usage_type": "name" }, { "api_name": "time.time", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.stack", "line_number": 48, "usage_type": "call" }, { "api_name": "time.ti...
19182969867
import numpy as np from scipy import stats import math import random import matplotlib.pyplot as plt def mc_sim1(): sample_size=100000 X = np.random.normal(0, 1, sample_size) print(X) formula = np.cos(X) ** 2 # formula = X mean = np.mean(formula) se = np.std(formula) / np.sqrt(sample_size) ...
Tomdeleeuw/MAS
main.py
main.py
py
1,493
python
en
code
0
github-code
6
[ { "api_name": "numpy.random.normal", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.cos", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.mean", "line_...
10714389879
# Md Lutfar Rahman # mrahman9@memphis.edu # DataScience Assingment - 4 import pandas import seaborn from matplotlib import pyplot from sklearn.metrics.cluster import adjusted_rand_score from sklearn.metrics import silhouette_score df = pandas.read_csv('Sales_Transactions_Dataset_Weekly.csv') def Q1(): from sklearn...
milu-buet/data-science
Assignment/HW4/COMP4993_A4_MDLufarRahman/main.py
main.py
py
2,974
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "sklearn.cluster.KMeans", "line_number": 19, "usage_type": "call" }, { "api_name": "sklearn.metrics.cluster.adjusted_rand_score", "line_number": 21, "usage_type": "call" }, { ...
7160474861
from random import random, uniform from typing import Callable import numpy as np population_size = 100 crossover_probability = 0.8 mutation_probability = 0.2 epochs = 100 def paraboloid(x, y): return (2 * x ** 2) / 3 + (7 * y ** 2) / 2 + 1 def d2b(f: int, b: int) -> str: n = int(f) base = int(b) r...
DonChaka/PSI
PAG/AlgorytmGenetyczny.py
AlgorytmGenetyczny.py
py
4,097
python
en
code
0
github-code
6
[ { "api_name": "typing.Callable", "line_number": 34, "usage_type": "name" }, { "api_name": "random.uniform", "line_number": 41, "usage_type": "call" }, { "api_name": "random.uniform", "line_number": 58, "usage_type": "call" }, { "api_name": "random.uniform", "l...
136163983
from regex import D import requests from urllib.parse import urljoin import json import numpy as np import pandas as pd def time_question(question, ask_endpoint): return requests.post(url=ask_endpoint, data=json.dumps({'question': question})).elapsed.total_seconds() if __name__ == '__main__': questions = [ ...
miteshkumar77/chatbot-ta
Software/data_scripts/timing_data.py
timing_data.py
py
1,099
python
en
code
0
github-code
6
[ { "api_name": "requests.post", "line_number": 10, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 10, "usage_type": "call" }, { "api_name": "urllib.parse.urljoin", "line_number": 26, "usage_type": "call" }, { "api_name": "pandas.DataFrame", ...
11005162738
import multiprocessing import multiprocessing.connection import sys from utils.ConfigHelper import ConfigHelper from utils.env_helper import create_env def worker_process( remote: multiprocessing.connection.Connection, conf: ConfigHelper, id: int ) -> None: """Executes the threaded interface to the environme...
xixiha5230/PPO
worker/Worker.py
Worker.py
py
2,336
python
en
code
2
github-code
6
[ { "api_name": "multiprocessing.connection", "line_number": 10, "usage_type": "attribute" }, { "api_name": "utils.ConfigHelper.ConfigHelper", "line_number": 10, "usage_type": "name" }, { "api_name": "utils.env_helper.create_env", "line_number": 22, "usage_type": "call" }...
25560069409
"""predictive_parking ROOT URL Configuration """ from rest_framework_swagger.views import get_swagger_view from rest_framework import routers from rest_framework.schemas import get_schema_view from django.conf.urls import url, include from django.conf import settings from occupancy import views as occupancy_views f...
Amsterdam/parkeerscans
api/parkeerscans/predictive_parking/urls.py
urls.py
py
2,722
python
en
code
3
github-code
6
[ { "api_name": "rest_framework.routers.APIRootView", "line_number": 17, "usage_type": "attribute" }, { "api_name": "rest_framework.routers", "line_number": 17, "usage_type": "name" }, { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 45, "usage_type": "a...
10220293365
import asyncio from typing import List, Optional from aiogram import Bot from aiogram.types import ChatActions, InputFile, InputMediaPhoto, Message from aiogram.types.message import ParseMode from aiogram.utils.exceptions import BadRequest from nazurin import config from nazurin.models import File, Illust, Image, Ugo...
y-young/nazurin
nazurin/bot.py
bot.py
py
5,888
python
en
code
239
github-code
6
[ { "api_name": "aiogram.Bot", "line_number": 23, "usage_type": "name" }, { "api_name": "nazurin.utils.decorators.retry_after", "line_number": 24, "usage_type": "call" }, { "api_name": "aiogram.Bot.send_message", "line_number": 24, "usage_type": "attribute" }, { "ap...
13321467934
from airflow.models import Variable from airflow.hooks.postgres_hook import PostgresHook from rock.utilities import ( safeget_no_case, safeget, get_delta_offset_with_content_attributes, find_supported_fields, ) from urllib.parse import unquote from psycopg2.extras import Json from functools import reduc...
CrossingsCommunityChurch/apollos-shovel
dags/rock/rock_features.py
rock_features.py
py
23,879
python
en
code
0
github-code
6
[ { "api_name": "airflow.models.Variable.get", "line_number": 21, "usage_type": "call" }, { "api_name": "airflow.models.Variable", "line_number": 21, "usage_type": "name" }, { "api_name": "airflow.hooks.postgres_hook.PostgresHook", "line_number": 25, "usage_type": "call" ...