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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11357000023 | import pygame
class Heart(pygame.sprite.Sprite):
def __init__(self, imgfile, hp, pos=[]):
super().__init__()
self.heart_img = pygame.image.load(imgfile)
self.rect = self.heart_img.get_rect()
self.pos = pos
self.HP = hp
self.speed = 7
self.Invincible = 0 #受到攻... | boaoqian/undertale_fight_system | Heart.py | Heart.py | py | 662 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "pygame.sprite",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 7,
"usage_type": "attribute"
}
] |
21797734599 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Conjunto de funciones desarrolladas para ser utilizadas en los programas principales
'''
import numpy as np
import torch
import matplotlib.pyplot as plt
from labcomdig import gray2de
from network import *
'''
NUMPY
'''
def transmisorpamV2(Bn,Eb,M,p,L):
"""
[X... | osgofre/MIMO-DL | functions.py | functions.py | py | 20,722 | python | es | code | 1 | github-code | 1 | [
{
"api_name": "numpy.reshape",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.size",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "numpy.ceil",
"line_number": 40... |
38177168817 | import argparse
from dis import dis
import gym
import numpy as np
from itertools import count
import pyximport; pyximport.install()
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.distributions import MultivariateNormal
import matplotlib.pyplot as plt
import ... | sashankmodali/CS593-Robotics | Assignment 4/Continuous/modified-gym-env/train_model.py | train_model.py | py | 6,564 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pyximport.install",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "config.torch_seed",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "config.env_seed",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "config.gamma",
... |
27651236552 | '''
This code is based on https://github.com/ekwebb/fNRI which in turn is based on https://github.com/ethanfetaya/NRI
(MIT licence)
'''
from synthetic_sim_comperrors import *
import time
import numpy as np
import argparse
import os
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
parser = argpar... | vassilis-karavias/fNRIsigma-master | data/generate_dataset_comperrors.py | generate_dataset_comperrors.py | py | 5,643 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_... |
15091010369 | import json
import os
import time
from models import Downloader, User
SETTINGS_FILE = "settings.json"
# Create history file if it does not exist
if not os.path.exists("history.txt"):
with open("history.txt", "w") as f:
f.write("")
# Check if the JSON file exists
if os.path.exists(SETTINGS_FILE):
# If... | ahmethakanbesel/alms-video-indirme-araci | app.py | app.py | py | 3,731 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "os.path.exists",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
6835048152 | '''
This script contains functions which allow a user to select a ROI on a
single/multiple samples
These functions in a variety of ways call the roiselector function which is a GUI
to allow a user to select points. The functionionality of each funcitons is as follows:
ChangePoint: allows a user to CHANGE the l... | JonoSax/3DHistologicalReconstruction | HelperFunctions/SP_SampleAnnotator.py | SP_SampleAnnotator.py | py | 17,188 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "matplotlib.use",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 107,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 108,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": ... |
6648609464 | import logging
import math
import numpy as np
import util.annotation
import util.metadata_service
import util.provenance_metadata_store
from util.annotation import AnnotationStore
from engine import app
from ooi_data.postgres.model import Parameter, Stream, NominalDepth
from util.asset_management import AssetManagemen... | oceanobservatories/stream_engine | util/stream_request.py | stream_request.py | py | 36,193 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "engine.app.config.get",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "engine.app.config",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "engine... |
34424513905 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# @Author : Nam Zeng
# @Time : 2018/12/6 10:38
# @Desc : 用牛顿插值法拟合经过给定点的曲线
# x0 | y0
# x1 | y1 y10
# x2 | y2 y21 y210
import matplotlib.pyplot as plt
import numpy as np
def newton_interpolate(x, y):
"""
:param x: 点集的x坐标集x[]
:param y: 点集的y坐标集y... | NAMZseng/numerical-analysis | 5_newton_Interpolation.py | 5_newton_Interpolation.py | py | 1,620 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.zeros",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.title",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "matplotlib.pypl... |
25161342964 | #!/usr/bin/python
import sys
import numpy as np
import scipy.signal as signal
from scipy.io import wavfile
import sklearn as sk
import librosa
import heartpy as hp
import soundfile as sf
from scipy.fft import fft, ifft, fftfreq
import matplotlib.pyplot as plt
src_signal = librosa.load("LAB5_500HzFHR.wav", sr=None)
... | cKaliban/DSP-Architecture-Lab | Python-WSL/signal_processing.py | signal_processing.py | py | 1,670 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "librosa.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "scipy.fft.fft",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_numbe... |
3975828154 | import numpy as np
import torch
from torch._C import dtype
import torch.nn as nn
import random
from filters import BP_filter
import matplotlib.pyplot as plt
class Random_shift(nn.Module):
# Randomly shifts the track
def __init__(self, shift_max):
super().__init__()
self.shift_max = shif... | GianMarcoZampa/Progetto-DACLS | augmentation.py | augmentation.py | py | 2,144 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "random.randint",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.roll",
"line_num... |
26355670681 | import random
import json
import numpy as np
import torch
from torch.utils.data import Dataset, DataLoader, random_split, ConcatDataset
import pandas as pd
import os
import torchaudio
from dataset import snoring_preprocess
from dataset import dataset_utils
# TODO: some inspections for arguments
# TODO: ABC? (to a ... | wdwlinda/Snoring_Detection_full | dataset/dataset_builder.py | dataset_builder.py | py | 5,871 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "dataset.dataset_utils.get_pydub_sound",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "dataset.dataset_utils",
"line_number": 82,
"usage_type": "name"
},
{
... |
28044202513 | # Project) 오락실 Pang 게임 만들기
# [게임 조건]
# 1. 캐릭터는 화면 아래에 위치, 좌우로만 이동 가능
# 2. 스페이스를 누르면 무기를 쏘아 올림
# 3. 큰 공 1 개가 나타나서 바운스
# 4. 무기에 닿으면 공은 작은 크기 2 개로 분할, 가장 작은 크기의 공은 사라짐
# 5. 모든 공을 없애면 게임 종료 => 성공
# 6. 캐릭터는 공에 닿으면 게임 종료 => 실패
# 7. 시간 제한 99 초 초과 시 게임 종료 => 실패
# 8. FPS 는 30 으로 고정 => 필요 시 speed 값을 조정
# [게임 이미지]
# 1. 배경 : 640... | asummerz/Python | pygame_project/1_frame_background_stage_character.py | 1_frame_background_stage_character.py | py | 2,936 | python | ko | code | 0 | github-code | 1 | [
{
"api_name": "pygame.init",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "pygame.displa... |
37914829335 | import ipywidgets as widgets
def make_model_list_dropdown() -> widgets.Widget:
model_list_dropdown = widgets.Dropdown(
options=['Model 1', "Click to add new model..."],
value='Model 1',
description='Select Model',
style={
'description_width': '100px'
},
... | usnistgov/correlogram_tools | correlogram_tools/plotting_widget/model_header_box.py | model_header_box.py | py | 1,820 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "ipywidgets.Dropdown",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "ipywidgets.Widget",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "ipywidgets.HBox",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "ipywidgets.W... |
8059135342 | import pyttsx3
import speech_recognition as sr
import datetime
import wikipedia
import webbrowser
print("READ THIS")
print("WHAT YOUR JARVIS CAN DO")
print("Your Jarvis can search in chrome\n can summarize wikipedia\n can open google and youtube\n can show you IPL score\n can open National Geographic\n can recommend... | sarthak-dhonde/jarvis | Jarvis.py | Jarvis.py | py | 9,194 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "pyttsx3.init",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "speech_reco... |
41413125741 | #!/usr/bin/env python3
import os
import datetime
# Complete the time_delta function below.
def time_delta(t1, t2):
pattern = '%a %d %b %Y %H:%M:%S %z'
date1 = int(datetime.datetime.strptime(t1, pattern).timestamp())
date2 = int(datetime.datetime.strptime(t2, pattern).timestamp())
print(abs(date1 - d... | iliankostadinov/hackerrank-python | time_delta.py | time_delta.py | py | 620 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 11,
"usage_type": "call"
},
{
"api_... |
25082622727 | from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('event/', views.event, name='event'),
path('place/', views.place, name='place'),
path('imply/', views.imply, name='imply'),
path('insert_event/', views.insert_event, name='... | leehj8896/capstone-server_ec2 | print_db/urls.py | urls.py | py | 1,393 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"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",
... |
5493453692 | import re
import sys
from io import StringIO
from colorama import Fore, Style
from diff_match_patch import diff_match_patch
def highlight_differences(text1, text2):
dmp = diff_match_patch()
diffs = dmp.diff_main(text1, text2)
dmp.diff_cleanupSemantic(diffs)
highlighted_diff = ""
for diff in diff... | algFame/geektrust | rider-sharing/src/utils.py | utils.py | py | 1,384 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "diff_match_patch.diff_match_patch",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "colorama.Fore.RED",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "colorama.Fore",
"line_number": 17,
"usage_type": "name"
},
{
"api_name":... |
43535013974 | import argparse
import sys
import os, os.path
import redis
import argparse
import logging, logging.config
from hashlib import md5
argparser = argparse.ArgumentParser()
argparser.add_argument("--data", type=str, required=True)
argparser.add_argument("--db-host", type=str, required=True)
argparser.add_argument("--db-por... | HappyNationHack/team_Help_Desk | scripts/load_data.py | load_data.py | py | 1,742 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "logging.DE... |
3540804132 | """============================================================================
Có 60% người mua xe thể thao là nam giới.
1. Chọn loại phân phối. Tạo ra 10 mẫu (ngẫu nhiên) theo mô tả trên
với số lần lặp lại các thí nghiệm là 1000
2. Vẽ histogram quan sát. Nhận xét.
3. Trong 10 chủ... | lualua0909/Math-4-ML-lds3 | B6. Probability/Ex2 - Cau 2.py | Ex2 - Cau 2.py | py | 1,885 | python | vi | code | 10 | github-code | 1 | [
{
"api_name": "math.factorial",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "math.factorial",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "scipy.stats.binom.rvs",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "scipy.stats.binom... |
11295990652 | """
Constraints:
- the position of the container has to be in range of device capacity
based on device version
- on creation it checks there is a proper amount of chambers associated
with this object
- there cannot be any other container at the same place in the same device
"""
from django.db import... | AmbientELab-Group/Medbox-server | app/API/models/container.py | container.py | py | 2,660 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.db.models.Model",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "django.db.models.UUIDField",
"line_number": 19,
"usage_type": "call"
},
{
"api_name"... |
43565545552 | from django.conf.urls import patterns, include, url, static
from django.conf import settings
from django.views.generic import TemplateView
from django.contrib import admin
from django.views.generic import RedirectView
from accounts.views import UserProfileUpdateView
from django.views.defaults import permission_denied
... | colab/colab | colab/urls.py | urls.py | py | 1,586 | python | en | code | 23 | github-code | 1 | [
{
"api_name": "django.contrib.admin.autodiscover",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.conf.settings.COLAB_APPS",
"line_number": 13,
"usage_type": "attribute"
},
... |
71311124194 | import requests
from xml.etree import ElementTree
class CTAInterface():
def __init__(self, api_key):
self.api_key = api_key
self.base_url = 'http://lapi.transitchicago.com/api/1.0/ttarrivals.aspx'
def get_next_arrivals(self, station_id_list):
next_arrivals = list()
parameters... | efaurie/cta-train-tracker | src/CTAInterface.py | CTAInterface.py | py | 1,311 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree.fromstring",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 25,
"usage_type": "name"
}
] |
30419469650 | import requests
from bs4 import BeautifulSoup
from time import sleep
from lxml import html
headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"
" AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"}
def get_url():
for count in range(0,121,20):
... | bogdan-kurbanov/parcer | main.py | main.py | py | 1,468 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_nu... |
32425569605 | from irc.client import Event, ServerConnection
from timmy.db_access import settings
class AuthHandler:
def __init__(self):
self.auth_on_welcome = False
self.auth_type = ""
self.auth_data = ""
self.post_identify = ""
self.post_auth_sent = False
def init(self) -> None:
... | utoxin/TimTheWordWarBot | timmy/event_handlers/auth_handler.py | auth_handler.py | py | 1,205 | python | en | code | 14 | github-code | 1 | [
{
"api_name": "timmy.db_access.settings.get_setting",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "timmy.db_access.settings",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "timmy.db_access.settings.get_setting",
"line_number": 16,
"usage_type": "ca... |
24337707923 | from lxml import html
import requests
from time import sleep
import json
import argparse
from collections import OrderedDict
from time import sleep
def parse(ticker):
# Code to get the stock price
url = "http://finance.yahoo.com/quote/%s?p=%s" % (ticker, ticker)
response = requests.get(url, verify=False)
... | JackMcNally24/VODCA | python/Scripts/analysis.py | analysis.py | py | 3,562 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "lxml.html.fromstring",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "lxml.html",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "collections.OrderedDict",... |
18108561085 | # mypy: disable-error-code=arg-type
import asyncio
import discord
import validators
import wavelink
from discord import app_commands
from wavelink.ext import spotify
from .. import config
from ..client import CustomClient
def add_streaming_commands(client: CustomClient) -> None:
@client.tree.command(
na... | sasunday26/discord-music-bot | discord_music_bot/commands/streaming.py | streaming.py | py | 5,621 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "client.CustomClient",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "discord.Interaction",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "wavelink.YouTubeTrack.search",
"line_number": 24,
"usage_type": "call"
},
{
"api_nam... |
23856076875 | from selenium import webdriver
from lxml import etree
import time,re,random,csv
driver_path = r'D:\chromedriver\chromedriver.exe'
class BossSpider(object):
def __init__(self,writer):
self.base_url = 'https://www.zhipin.com'
self.url = 'https://www.zhipin.com/job_detail/?query=python&city=10... | rbp123/spiders | boss_spider.py | boss_spider.py | py | 4,554 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "lxml.etree.HTML",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "lxml.etr... |
8083603585 | from tqdm import tqdm
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from group4_banker import Group4Banker
from plot_config import setup, set_fig_size, set_arrowed_spines
setup()
def prep_data():
features = ['checking account balance', 'duration', 'credit history',
... | moeennaqvi/BankCreditProject | src/action_sensitivity.py | action_sensitivity.py | py | 5,750 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "plot_config.setup",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pandas.get_dummies"... |
18785321963 | from django.urls import include, path
from rest_framework import routers
from . import views
router = routers.DefaultRouter()
router.register(r'reto', views.RetoViewSet)
router.register(r'jugador', views.JugadoresViewSet)
router.register(r'usuarios', views.UsuarioViewSet, basename='usuario')
router.register(r'partidas... | Aram32mm/tarea1 | calculadora/urls.py | urls.py | py | 1,688 | python | es | code | 0 | github-code | 1 | [
{
"api_name": "rest_framework.routers.DefaultRouter",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "rest_framework.routers",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.urls.path",
"line_number": 16,
"usage_type": "call"
},
{
"api_na... |
11785008616 | # NN ライブラリを使いやすいように変更
# 7763c160b4ec1caa99718cd3c865339227a1908e
import numpy as np
import matplotlib.pyplot as plt
def main():
# ファイルからプロットする値を読み込む
true_x = []
predict_x = []
with open("data/tmp_result.csv") as fileobj:
while True:
line = fileobj.readline()
if line:
... | eipuuuuk825/Puniki4 | python/src/plot_scatter.py | plot_scatter.py | py | 1,885 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.corrcoef",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "numpy.max",... |
2340324466 | import torch
from torch import nn
__all__ = [
'DotProductAttention'
, 'AdditiveAttention'
]
class Attention(nn.Module):
'''base model for attention'''
def __init__(self, *args, **kwargs) -> None:
super().__init__()
self.maskValue = -1e10
def forward(self, *args, **kwargs):
'... | Thyme-git/transformer | layers/attention.py | attention.py | py | 8,633 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torch.Tensor",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "torch.Tensor",
"lin... |
10886136870 | from flask import Flask, render_template, request, Response, redirect, url_for , session , jsonify , flash
from flask_bootstrap import Bootstrap
from object_detection import *
import object_detection
from flask_sqlalchemy import SQLAlchemy # import sqlalchemy
from database import db , Vehicle , DB_Manager
import web... | LeandroMartinMacato/SecureV-App | app/app.py | app.py | py | 4,819 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "database.db",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "database.DB_Manag... |
73034000353 | # -*- coding: utf-8 -*-
'''
Functions used for CLI argument handling
'''
from __future__ import absolute_import
# Import python libs
import re
import inspect
# Import salt libs
from salt.ext.six import string_types, integer_types
import salt.ext.six as six
#KWARG_REGEX = re.compile(r'^([^\d\W][\w.-]*)=(?!=)(.*)$', r... | shineforever/ops | salt/salt/utils/args.py | args.py | py | 5,142 | python | en | code | 9 | github-code | 1 | [
{
"api_name": "re.compile",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "salt.ext.six.iteritems",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "salt.ext.six",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "salt.ext.six.string_ty... |
31305593402 | from django.urls import path
from .views import (
ArticulosAgregarView, ArticulosApiView, ArticulosDetalladoView, ArticulosEliminarView,ArticuloActualizarView)
urlpatterns = [
path('api/', ArticulosApiView.as_view(), name="Api"),
path('api/agregar/', ArticulosAgregarView.as_view(), name="create"),
... | AlbaBermudez/ProyectoAPI | ProyectoAPI/appAPI/urls.py | urls.py | py | 575 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "views.ArticulosApiView.as_view",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "views.ArticulosApiView",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "d... |
30490609484 | import os
os.system('pip3 install lightgbm==2.1.2')
os.system('pip3 install hyperopt')
import pandas as pd
import pickle
import data_converter
import numpy as np
import scipy
from os.path import isfile
import random
import time
from sklearn.model_selection import train_test_split, StratifiedKFold
from sklearn.metrics ... | MetaLearners/NIPS-2018-AutoML-Challenge | src/model.py | model.py | py | 12,004 | python | en | code | 17 | github-code | 1 | [
{
"api_name": "os.system",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 50,
... |
22357222228 | #coding=utf-8
'''
#import urllib
#import urllib.request
#import urllib.parse
import requests
URL_IP = 'http://httpbin.org/ip'
URL_GET = 'http://httpbin.org/get'
def use_simple_requests():
response = requests.get(URL_IP)
print('>>>Response Headers:')
print(response.headers)
print('>>>Response Body:')
... | Handsome2Hu/py | 个人学习/RequestsTest.py | RequestsTest.py | py | 4,842 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.dumps",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": ... |
10514583312 | import datetime
import gym
import numpy as np
from gym import spaces, error
from gym import utils
from gym.utils import seeding
from entity.time_window import time_window
from tool.kuhn_munkras import kuhn_munkras
class MatchEnv(gym.Env):
def __init__(self, max_car_num=30, max_lp_num=300, time_district_num=12, ma... | KirsVon/DQN-Master | DQN-master/match_env.py | match_env.py | py | 2,342 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "gym.Env",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "gym.spaces.Discrete",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "gym.spaces",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "gym.spaces.MultiDiscrete"... |
24939797081 | import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import pandas as pd
import plotly.express as px
df = pd.read_csv("../datasets/Los_Angeles_International_Airport_-_Passenger_Traffic_By_Terminal.csv")
df['ReportPeriod']=pd.to_datetime(df['Rep... | ucdavis/ECS272-Winter2020 | Assignment3/wyin/app.py | app.py | py | 2,973 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "dash.Dash",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "dash_html_components.Div"... |
32109402966 | import sys
import os
import imghdr
from PyQt5.QtWidgets import QApplication, QMainWindow, QAction
from PyQt5.QtWidgets import QWidget, QDesktopWidget, QMessageBox
from PyQt5.QtWidgets import QHBoxLayout, QVBoxLayout, QGridLayout
from PyQt5.QtWidgets import QGroupBox, QPushButton, QSlider
from PyQt5.QtWidgets import QLa... | laggui/timelapse-processing | timelapse_gui.py | timelapse_gui.py | py | 10,427 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "PyQt5.QtWidgets.QPushButton",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.pyqtSignal",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QSizePolicy.Expanding",
"line_number": 35,
"usage_type": "attribute"
... |
73948619555 | import matplotlib.patches as patches
import matplotlib.pyplot as plt
path = [
[.1, .3],
[.2, .9],
[.8, .4],
]
fig = plt.figure()
ax = fig.gca()
ax.add_patch(patches.Polygon(path))
fig.savefig("triangle_patch.png", dpi=150)
plt.close()
path = [
[.1, .3],
[.2, .9],
[.8, .4],
]
fig = plt.figure(... | brohrer/taming_matplotlib | patch_examples.py | patch_examples.py | py | 552 | python | en | code | 22 | github-code | 1 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "matplotlib.patches.Polygon",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": ... |
14404366448 | #!/usr/bin/env python3
#python crawl.py --iocp http://www.website.com/
import asyncio
import logging
import re
import signal
import os
import sys
import urllib.parse
import aiohttp
@asyncio.coroutine
def download(url,data):
filename=url.replace('http://','').replace('https://','')
path=filename.split('/')
... | wurui1994/record | Python/Spider/asyncio_crawl.py | asyncio_crawl.py | py | 3,835 | python | en | code | 29 | github-code | 1 | [
{
"api_name": "os.path.exists",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_nu... |
42758230743 | import keras
from keras.models import Sequential
from keras.layers import Dense
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.model_selection import StratifiedKFold
#设置随机数种子
np.random.seed(7)
#数据路径
data_file="pima-indians-diabetes.csv"
#导入数据
dataset=np.loadt... | renxingkai/KerasDLDemo | chapter05_Evaluate/KFold.py | KFold.py | py | 1,367 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "numpy.random.seed",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "numpy.loadtxt",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selec... |
43673538115 | from flask import jsonify, make_response, Blueprint, abort, redirect, request
from atexit import register
from time import sleep
from threading import Thread
from flasgger import swag_from
import utils
import logging
import json
bp = Blueprint('db', __name__)
search_q = utils.RedisQueue('searched')
expand_q = utils.R... | Taylorrrr/COMP90024-2020S1-Team22 | backend/db.py | db.py | py | 2,910 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "flask.Blueprint",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "utils.RedisQueue",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "utils.RedisQueue",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.warning",
... |
70323927393 | # -*- coding: utf-8 -*-
""" Autoruns
2015 fightnight
2022 bittor7x0"""
import xbmc,xbmcvfs,xbmcaddon,xbmcgui,xbmcplugin,urllib.request,urllib.parse,urllib.error,os,re,sys
import xml.etree.ElementTree as ET
SERVICE_DISABLED = 'Autoruns_service_disabled'
def list_addons():
#info directory
addDir('... | bittor7x0/kodi.script.autoruns | default.py | default.py | py | 4,990 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "xbmcaddon.Addon",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "xbmcvfs.translatePath",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"... |
42469206289 | import threading
import numpy as np
import cv2
import time
class CameraReader(threading.Thread):
def __init__(self,dev):
self.dev = dev
self.lock = threading.Lock()
self.frame = np.empty((480,640,3), dtype=np.uint8)
self.running = False
self.cap = None
threading.Thr... | olinrobotics/irl | irl_auxiliary_features/irl_stereo/scripts/stereo_utils/camera_reader.py | camera_reader.py | py | 1,780 | python | en | code | 7 | github-code | 1 | [
{
"api_name": "threading.Thread",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "threading.Lock",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"lin... |
39674304363 | from pymongo import MongoClient
import numpy as np
import datetime
client = MongoClient()
db = client.twitter
cursor = db.tweets.aggregate(
[{
"$project": {
"y": { "$year": "$timestamp_obj"},
"m": { "$month": "$timestamp_obj"},
"d": { "$dayOfMonth": "$timestamp_obj" },
... | Humpheh/twied | scripts/processing/fourier.py | fourier.py | py | 2,223 | python | en | code | 11 | github-code | 1 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "numpy.fft.fft... |
3824690503 | # -*- coding: utf-8 -*-
from ..enums import ScanTypesEnum
from ..errors import ClosedProcess
from ..process import AbstractProcess
from .functions import (
get_memory_regions,
read_process_memory,
search_addresses_by_value,
search_values_by_addresses,
write_process_memory
)
from typing import Gener... | JeanExtreme002/PyMemoryEditor | PyMemoryEditor/linux/process.py | process.py | py | 6,073 | python | en | code | 20 | github-code | 1 | [
{
"api_name": "typing.TypeVar",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "process.AbstractProcess",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "typing.Optiona... |
19918807345 | import numpy as np
import matplotlib.pyplot as plt
# 1. Linear regression for classifying noisy data
fig, axs = plt.subplots(3)
N = 100 # data set size
d = 2 # 2 classes of data
# Generate random training data
X = np.random.uniform(-1, 1, size=(N, d+1))
X[:, 0] = 1
# Calculate weights vector
w = np.random.... | kromer-creator/Machine-Learning-Projects | Linear Regression, PLA, and Pocket Algorithm/Lab3_Code.py | Lab3_Code.py | py | 2,736 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "numpy.random.uniform",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy... |
15952571818 | import socket
from time import sleep
# Keyence Scanner ASCII Commands ------------------------------------------------------
"""
Error Format: ER,COMMAND,ERROR_CODE
Error Codes:
------------
00 Undefined command received
01 Mismatched command format (Invalid number of parameters)
02 The parameter 1 value exceeds... | brianteachman/serial_printer_controller | sr1000.py | sr1000.py | py | 4,206 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "socket.socket",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 84,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREAM",
"line_number": 84,
"usage_type": "attribute"
},
{
"api_name": "time.sleep"... |
27885172320 | import tweepy
import time
#creds
auth = tweepy.OAuthHandler('F65nYoxP5rSF2GCvhYmyGTgf9' , 'ur8QEgt7J2ugicpmSCLauprXMNOVOzIfAQMOAXnbhflvb2aH1W')
auth.set_access_token('1309177113652662272-4rrOUk9Pxn9KccGPnATO2IUypgT8tr', '1K3NjvrLHuMYeR4xfpp2CpLENsgqrPugZ4WvTtI6ZAyO5' )
api = tweepy.API(auth)
user = api.me()
#print("... | prajaktaandhale/Twitter-Bot-using-Python | twitterbot1.py | twitterbot1.py | py | 1,039 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tweepy.OAuthHandler",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "tweepy.API",
"line_number": 8,
"usage_type": "call"
}
] |
23562269693 | from graph_tool.all import Graph,Vertex,graph_draw,radial_tree_layout
from GN0.alpha_zero.MCTS_cached import MCTS as MCTS_old,Node,Leafnode,upper_confidence_bound
from GN0.alpha_zero.MCTS import MCTS
from GN0.alpha_zero.NN_interface import NNetWrapper
from graph_game.shannon_node_switching_game import Node_switching_ga... | yannikkellerde/GNN_Hex | GN0/alpha_zero/visualize_MCTS.py | visualize_MCTS.py | py | 12,530 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "graph_game.shannon_node_switching_game.Node_switching_game",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 19,
"usage_type": "call"
},
{
"... |
11822802935 | import pygame
from typing import List, Callable, Tuple
GREEN = (0, 255, 0)
RED = (255, 0, 0)
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
GREY = (57, 57, 57)
LIGHT_GREY = (99, 99, 99)
LIGHT_BLUE = (141, 182, 205)
# BACKGROUND_COLOR = (158, 58, 64)
BACKGROUND_COLOR = (113, 155, 158)
SIDEBAR_IMAGE_SCALE = 1.5 # make card... | YoussefSamaan/Splendor-Game | client/game/utils.py | utils.py | py | 5,485 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pygame.Surface",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pygame.Surface",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "pygame.Surface",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "pygame.Rect",
"... |
22080278831 | import flask
import sqlite3
from flask import jsonify, Response
from config import DEBUG, DATABASE_PATH
from models import Application, ApplicationHistory
app = flask.Flask(__name__)
app.config["DEBUG"] = DEBUG
@app.route('/<app_id>', methods=['GET'])
def application(app_id):
connection = sqlite3.connect(DATABAS... | bilelmoussaoui/flathub-stats | flathub/server.py | server.py | py | 569 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "config.DEBUG",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "sqlite3.connect",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "config.DATABASE_PATH",
"li... |
36620678228 | import openai
import os
engine_list = ['gpt-35-turbo', 'gpt-35-turbo-16k', 'gpt-4', 'gpt-4-32k', 'text-embedding-ada-002']
class Config:
OPENAI_API_TYPE = "azure"
OPENAI_API_BASE = "your_api_base"
OPENAI_API_VERSION = "2023-07-01-preview"
OPENAI_API_KEY = "your_api_key"
MAX_TURNS = 10
os.maked... | pooruss/ML-Framework-for-Diverse-Applications-in-Trading-and-Finance | openai_chat.py | openai_chat.py | py | 2,362 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.makedirs",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "openai.api_type",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "openai.api_base",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "openai.api_vers... |
40218112068 | from datetime import datetime
from flask import render_template, url_for, redirect, flash, request, Blueprint
from flask_login import current_user, login_required
from website import db, settings
from website.hours.forms import LogHoursForm
from website.models import User, Event, Hours
from website.events.utils impor... | kastuparu/FRC190Website | website/hours/routes.py | routes.py | py | 3,670 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Blueprint",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "website.models.Event.query.get_or_404",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "website.models.Event.query",
"line_number": 18,
"usage_type": "attribute"
},
{
... |
24366566245 | import datetime
import boto3
from django.shortcuts import render
from django.http import HttpResponse, JsonResponse
from django.template import loader
from django.views.decorators.clickjacking import xframe_options_exempt
from phishing.forms import CreateTemplate
from phishing.models import Submission, MTurkUser, Ra... | maths22/trawl | phishing/views.py | views.py | py | 5,419 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "boto3.Session",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "django.template.loader.get_template",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "d... |
16239766894 | import warnings
from torch.utils.data.dataloader import DataLoader
from dataloaders.datasets.cityscapes import CityscapesSegmentation
from config_utils.search_args import obtain_search_args
from utils.loss import SegmentationLosses
import torch
import numpy as np
from auto_deeplab import AutoDeeplab
model = AutoDeepla... | NoamRosenberg/autodeeplab | test.py | test.py | py | 1,467 | python | en | code | 306 | github-code | 1 | [
{
"api_name": "auto_deeplab.AutoDeeplab",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "config_utils.search_args.obtain_search_args",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "utils.loss.SegmentationLosses",
"line_number": 16,
"usage_type": "ca... |
17659817974 | import json
import sys
import numpy
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
from keras.optimizer_v2.adam import Adam
import cv2
import tensorflow
import warnings
from keras.losses import categorical_crossentropy
from keras.models import model_from_json
from faceRecognition import testFaceRecognition2
f... | qqrtos/kids-learning-platform | mirpr-emotional/main.py | main.py | py | 4,764 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.environ",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "keras.models.model_from_json",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "keras.optimizer_v2.adam.Adam",
"line_number": 73,
"usage_type": "call"
},
{
"api_name... |
9264868588 |
# import libraries
import argparse
import os
import json
import datetime
import boto3
import sagemaker
from sagemaker.tensorflow.estimator import TensorFlow
from sagemaker.tensorflow.model import TensorFlowModel
from env import *
def train():
"Train the model in SageMaker"
with open(HYPERPARAMETERS_FI... | neoxia/sagemaker-benchmark | projects/mnist_tensorflow2_scriptmode/pipeline/main.py | main.py | py | 2,940 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.load",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sagemaker.tensorflow.estimator.TensorFlow",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sagemaker.tensorflow.model.TensorFlowModel",
"line_number": 58,
"usage_type": "call"
... |
23981818316 | #!/usr/bin/env python
import pydart
import logging
from simulation import Simulation
from window import Window
import utils
import sys
# from logging_tree import printout # pip install logging_tree
# printout()
root = logging.getLogger()
root.setLevel(logging.DEBUG)
root.handlers = []
ch = logging.StreamHandler(sys... | sehoonha/green_stair | main.py | main.py | py | 1,622 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.stdout... |
25485702994 | #!/usr/bin/env python3
from mpd import MPDClient
from requests import post
#from secrets import secrets # Get personal passwords
# NOTE: the 'secrets' module didn't exist at the time
from time import sleep, strftime
POST_URL = 'http://blog.pineman.sexy/control'
MPD_SOCKET = '/home/pineman/.config/mpd/socket'
client =... | pineman/code | old_proj/stream/mpdpostd.py | mpdpostd.py | py | 1,359 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "mpd.MPDClient",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "time.strftime",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 46,
"usage_type": "call"
}
] |
20210567264 | from dtcwt_scattering import DtcwtScattering2D
import numpy as np
from copy import copy
from keras import layers
from keras.models import Sequential
from keras.optimizers import RMSprop
from time import time
from statistics import mean
class DtcwtConvClassifier:
def __init__(self, m=2):
self.transform2D =... | COMPLEX-WAVELET/complex-wavelet | conv_classifier.py | conv_classifier.py | py | 2,384 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "dtcwt_scattering.DtcwtScattering2D",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "keras.models.Sequential",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "keras.layers.Conv1D",
"line_number": 18,
"usage_type": "call"
},
{
"ap... |
8887803211 | import scipy.signal as spsig
import globalVariables as gv
import numpy as np
import os
import matplotlib.pyplot as plt
from astropy.io import fits
import scipy.special as sps
import scipy.optimize as spo
from MakeMHzScale import MHzScale
import scipy.ndimage as spni
import scipy.interpolate as spi
#analyze the big fat... | BillyTheKidPhysicist/experimentControlAndAnalysis | prettyFocusAnalzer.py | prettyFocusAnalzer.py | py | 7,213 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "scipy.special.voigt_profile",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "scipy.special",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "scipy.special.voigt_profile",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": ... |
28646418023 | from datetime import datetime
from ..schema import BaseTransformer
class Transformer(BaseTransformer):
"""Transform Utah raw data for consolidation."""
postal_code = "UT"
fields = dict(
company="Company Name",
location="Location",
notice_date="Date of Notice",
jobs="Affec... | biglocalnews/warn-transformer | warn_transformer/transformers/ut.py | ut.py | py | 784 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "schema.BaseTransformer",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.da... |
72329281635 | #contains pretrained timm model
import urllib
import os
# import gradio as gr
import torch
import timm
import numpy as np
from PIL import Image
import torchvision.transforms as T
import torch.nn.functional as F
from matplotlib.colors import LinearSegmentedColormap
from typing import Dict
from captum.attr import vis... | shilpiprd/emlo7_solution | pgd.py | pgd.py | py | 3,265 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.device",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms.Compose",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "to... |
8404410120 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Модуль формы <icCubesOLAPSrvRequestPanelProto>.
Сгенерирован проектом DEFIS по модулю формы-прототипа wxFormBuider.
"""
import wx
from . import cubes_olap_srv_request_form_proto
import ic
from ic.log import log
from ic.utils import wxfunc
# Для управления взаимоде... | XHermitOne/defis3 | analitic/analitic/olap/cubes/cubes_olap_srv_request_panel.py | cubes_olap_srv_request_panel.py | py | 17,669 | python | ru | code | 0 | github-code | 1 | [
{
"api_name": "ic.engine.form_manager.icFormManager",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "ic.engine.form_manager",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "ic.utils.wxfunc.showInfoWindow",
"line_number": 146,
"usage_type": "call... |
14448299607 | from .models import Teacher
from .models import Group
from .models import TeacherSubject
from .models import TypedSubject
from .models import Day
from .models import TimeTable
from .models import LessonType
import itertools
import itertools
from pulp import *
problem = LpProblem("schedule-opt", LpMaximize)
from faker... | osboo/schedule-opt | schedule_app/schedules/optimizer.py | optimizer.py | py | 9,228 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "faker.Faker",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "itertools.product",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "itertools.product",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "itertools.product",
... |
73454293153 | from tkinter import *
from tkinter import ttk, messagebox
import statistics as stats
import MySQLdb
import numpy as np
import matplotlib.pyplot as plt
patronNomApe = '^([A-Z]\D+)$'
patronCp = '\d{5}$'
patronTelefono = '\d{9}$'
patronCod_Historia = '\d'
patronfecha = '^([0-2][0-9]|(3)[0-1])(\/)(((0)[0-9])|((1)[0-2]))(... | daguilerap/Hospital | proyectofinal/main.py | main.py | py | 25,321 | python | es | code | 0 | github-code | 1 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "numpy.arange",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "matplotlib.... |
71884000353 | from __future__ import absolute_import, division
from collections import defaultdict
from .components import Edge, Node
from .exceptions import InvalidNodeTypeError, MaxNodeError, GraphTypeError
from .utils import check_cycle
from .algorithms._search import BFS, DFS
from .algorithms._sort import topological_sort
... | Fredpwol/graphnet | graphnet/graph.py | graph.py | py | 18,096 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "graphnet.SCALAR",
"line_number": 56,
"usage_type": "name"
},
{
"api_name": "components.Node",
"line_number": 101,
"usage_type": "call"
},
{
"api_name": "components.Node",
"line_number": 103,
"usage_type": "name"
},
{
"api_name": "exceptions.InvalidN... |
13006443464 | from telethon import TelegramClient, events, sync,utils
from telethon.tl.functions.users import GetFullUserRequest
from telethon.tl.functions.messages import GetDialogsRequest
from telethon.tl.types import InputPeerEmpty, InputPeerChannel, InputPeerUser
from telethon.errors.rpcerrorlist import (PeerFloodError, UserNotM... | xiroshigo/TgMemberAdd | TgMemberAdder.py | TgMemberAdder.py | py | 12,767 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.system",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 63,
... |
5592598850 | from rest_framework import serializers
from api.models import OauthRecord
class OauthRecordSerializer(serializers.ModelSerializer):
class Meta:
model = OauthRecord
exclude = ('id', 'user')
def create(self, data):
instance = OauthRecord.objects.create(
user=data['user'],
... | johnny-butter/eLibrary | api/serializers/oauth_record.py | oauth_record.py | py | 421 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "api.models.OauthRecord",
"line_number": 8,
"usage_type": "name"
... |
21794665224 | from selenium import webdriver
from selenium.webdriver.firefox.service import Service
from webdriver_manager.firefox import GeckoDriverManager
import requests
driver = webdriver.Firefox(service=Service(GeckoDriverManager().install()))
driver.get("https://en.wikipedia.org/wiki/SpaceX")
wikipedia_xpath="/html/body/div... | RianNugroho/DSTakeHome | main.py | main.py | py | 923 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "selenium.webdriver.Firefox",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.firefox.service.Service",
"line_number": 6,
"usage_type": "call"
},
{
... |
73004553633 | from .backend import backend as bd
import numpy as np
import os
import time
import fdtd_1d as f
import matplotlib.pyplot as plt
from .constants import c0, BLUE, CYAN, TEAL, ORANGE, RED, MAGENTA, GREY
from werkzeug.utils import cached_property
from multiprocessing import Pool
color_spec = [BLUE, CYAN, TEAL, ORANGE... | HaneWall/FDTD | fdtd_1d/benchmarks.py | benchmarks.py | py | 43,827 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "constants.BLUE",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "constants.CYAN",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "constants.TEAL",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "constants.ORANGE",
"... |
35375175946 | from django.urls import path
from . import views
from reviews import views as reviewsViews
from .views import SearchBooks
app_name = "books"
urlpatterns = [
path("home/", views.Home, name="home_page"),
path("list/", views.ListBooks, name="list_books"),
path("list/top_ten", views.TopTen, name="top_ten"),
... | stanley-wei/CS35L-Project | books/urls.py | urls.py | py | 1,018 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "views.Home",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.urls.path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "views.ListBooks",
... |
11814951006 | # W tym pliku będą znajdować się ważne funkcje dotyczące
# Symulatora Julki. Zrobiłem to po to by nie zaśmiecać
# głównego pliku wykonywalnego.
import json
configFilePath = "./config.json"
loopedAnsw = False
randomizeAnsw = False
stoppingKeywords = None
userCustomJulkaAnsw = None
def initConfig():
global config... | REMOLP/JulkaSim-Remake | julkalib.py | julkalib.py | py | 3,301 | python | pl | code | 0 | github-code | 1 | [
{
"api_name": "json.load",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 83,
"usage_type": "call"
}
] |
23553893112 | from django.urls import path
from . import views
urlpatterns = [
path('<slug:category_name>/', views.CategoryView.as_view(), name="category"),
path('<slug:category>/<slug:slug>/', views.PostDetailView.as_view(), name="detail_post"),
path('<slug:tag_slug>/', views.TagDetailView.as_view(), name="detail_tag"... | anuarmurawski84/TestDjango2 | blog/urls.py | urls.py | py | 365 | python | en | code | 0 | github-code | 1 | [
{
"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",
... |
31464620825 | import logging
import os
import uuid
from typing import Tuple, Dict, Optional, Callable, Any
from nebullvm.base import (
ModelParams,
DeepLearningFramework,
QuantizationType,
Device,
)
from nebullvm.config import (
AUTO_TVM_TUNING_OPTION,
AUTO_TVM_PARAMS,
QUANTIZATION_DATA_NUM,
CONSTRAI... | MuntahaShams/nebullvm | nebullvm/optimizers/tvm.py | tvm.py | py | 12,889 | python | en | code | null | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "nebullvm.optimizers.base.BaseOptimizer",
"line_number": 50,
"usage_type": "name"
},
{
"api_name": "nebullvm.optional_modules.torch.Module",
"line_number": 55,
"usage_type": "name"... |
25056266008 | import re
import gspread
import os
import json
from itertools import takewhile
consonants_bw = "['|>&<}bptvjHxd*rzs$SDTZEgfqklmnhwy]"
double_cons = re.compile('{}{}'.format(consonants_bw, consonants_bw))
CONS_CLUSTER_IMPLEM = False
POS_NOMINAL = [
'abbrev', 'adj', 'adj_comp', 'adj_num', 'adv', 'adv_interrog',
... | CAMeL-Lab/camel_morph | camel_morph/utils/utils.py | utils.py | py | 18,417 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "re.compile",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 82,
"usage_ty... |
1823465172 | import json
from collections import defaultdict
from time import sleep
from uuid import uuid4
import pytest
import requests
from dp.protos.enodebd_dp_pb2 import CBSDRequest, CBSDStateResult, LteChannel
from dp.protos.enodebd_dp_pb2_grpc import DPServiceStub
from magma.test_runner.config import TestConfig
from magma.te... | AdityaKoranga/magma | dp/cloud/python/magma/test_runner/tests/test_active_mode_controller.py | test_active_mode_controller.py | py | 5,696 | python | en | code | null | github-code | 1 | [
{
"api_name": "magma.test_runner.config.TestConfig",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "magma.test_runner.tests.integration_testcase.DomainProxyIntegrationTestCase",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "uuid.uuid4",
"line_number": 2... |
4421851764 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Module to check if the DB works
===============================
Runs multiple checks to see if the database was correctly setup.
"""
import argparse
import logging
from orion.core.cli.db.test import main
log = logging.getLogger(__name__)
DESCRIPTION = "(DEPRECATED) ... | lebrice/orion | src/orion/core/cli/test_db.py | test_db.py | py | 1,067 | python | en | code | null | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "argparse.FileType",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "orion.core.cli.db.test.main",
"line_number": 45,
"usage_type": "call"
}
] |
38895831805 | import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # 要放在 import tensorflow as tf 前面才会起作用 !!!
import tensorflow as tf
from tensorflow import keras
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
from data import DIV2K
class Reloader:
def __init__(self, model_path):
self.model = k... | MuyaoYuan/FSRCNN-tf | reloader.py | reloader.py | py | 1,879 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.environ",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.keras.models.load_model",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.models",
"line_number": 13,
"usage_type": "attribute"
},
{
"ap... |
19327625963 | from django.conf.urls import patterns, url
from django.views.generic import TemplateView
from whatsnew.views import ChangelogView
urlpatterns = patterns(
'whatsnew.views',
url(r'^test/', TemplateView.as_view(template_name='whatsnew/test.html'),
name='whatsnew-test'),
url(r'^changelog/', ChangelogV... | saxix/django-whatsnew | whatsnew/urls.py | urls.py | py | 432 | python | en | code | 5 | github-code | 1 | [
{
"api_name": "django.conf.urls.patterns",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.views.generic.TemplateView.as_view",
"line_number": 8,
"usage_type": "call"
},
{
... |
42131468718 | import email
import csv
from fileinput import filename
from flask import Flask, render_template, url_for,request,redirect
app = Flask(__name__)
print(__name__)# is __main__ because this is main file we are running
#How to make these writing routes dynamic???
@app.route('/')
def my_home():# thats defaults
return ... | suprimregmi/Flask | Portfolio/app.py | app.py | py | 2,006 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "csv.writer",
... |
32812980636 | import yaml
import itertools
import random
from django.templatetags.static import static
import pandas as pd
from datetime import date
import json
def parse_yml(path):
with open(path, 'r', 1) as file_stream:
yml_file = yaml.load(file_stream)
return yml_file
def get_next_question_difficulty_level(que... | pkuaaron/akidzon_xblock | akidzon/utils.py | utils.py | py | 10,498 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "yaml.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame.from_dict",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "django.tem... |
24032855686 | from os import path
import random
import string
from cgi import FieldStorage
import onlinelux
STORAGE_PATH = path.abspath(path.join(path.dirname(onlinelux.__file__), 'public', 'storage'))
class StorageManager:
"""Images Storage"""
def __init__(self):
self.storage_path = STORAGE_PATH
def stor... | eteamin/onlineluxe | onlinelux/lib/store.py | store.py | py | 1,065 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.abspath",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_numb... |
14815941904 | import pysam
import numpy as np
import cv2
from PIL import Image
from multiprocessing import Process, Queue
import random
import glob
class Query:
def __init__(self,name,cigar,query,qual,mapq,position,indent,ref):
self.name=name
self.ref=ref
self.cigar=cigar
self.query=query
... | sylee623/GOTCHA | src/training_making/bam_array_generator_for_train.py | bam_array_generator_for_train.py | py | 14,268 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pysam.AlignmentFile",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 114,
"usage_type": "call"
},
{
"api_name": "random.sample",
"line_number": 153,
"usage_type": "call"
},
{
"api_name": "cv2.imwrite",
"li... |
11603680922 | '''
model training pseudocode:
load dataset
transform dataset
for 100 iterations:
split dataset into 3 equal parts
assign trainingset 2/3 parts
assign testingset 1/3 part
find size n of trainingset
#perform leave-one_out cross-validation
For n iterations:
assign validationset unique ... | theohal/BfTM | sarah/assignment_slp_v1.py | assignment_slp_v1.py | py | 1,831 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "sklearn.svm.SVC",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "sklearn.svm",
"li... |
11960533630 | import pickle
import cv2
import dlib
import os
import numpy as np
import base64
# initialize dlib's face detector (HOG-based) and then create the facial landmark predictor
detector = dlib.get_frontal_face_detector()
predictor = dlib.shape_predictor('models/shape_predictor_68_face_landmarks.dat')
# load the face recog... | ptlc8/zoom-visages | detect.py | detect.py | py | 4,771 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "dlib.get_frontal_face_detector",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "dlib.shape_predictor",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "dlib.face_recognition_model_v1",
"line_number": 13,
"usage_type": "call"
},
{
... |
28825101443 | # -*- coding: utf-8 -*-
"""
Created on Fri Jun 3 23:28:26 2016
@author: Guanhao Wu
"""
from Neuron import Neuron
from NeuronParameters import NeuronParameters
import matplotlib.pyplot as plt
import numpy as np
T=60000
V=[]
N=Neuron()
P=NeuronParameters()
P.set_RS(N)
for t in range(T):
if t>5... | higgamo/PNN | SingleNeuron.py | SingleNeuron.py | py | 471 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "Neuron.Neuron",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "NeuronParameters.NeuronParameters",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 26,
"usage_type": "call"
},
{
"api_name... |
30579027002 | import datetime
from cryptography.x509 import *
from cryptography.x509 import OID_COMMON_NAME
from cryptography.hazmat.primitives import serialization
from certificate_authority.database import db
from certificate_authority.models import *
from os import urandom
from utils.signing import get_default_encryption_padding,... | momvart/dns_project | certificate_authority/cert_issuer.py | cert_issuer.py | py | 2,592 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cryptography.hazmat.primitives.serialization.load_pem_private_key",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cryptography.hazmat.primitives.serialization",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.utcnow",
"li... |
26398398645 | # pylint: disable=missing-module-docstring
# pylint: disable=import-error
import json
from collections import namedtuple
from constants.isa_const import Opcode
class Term(namedtuple('Term', 'pos symbol')):
"""Описание выражения из исходного текста программы."""
# сделано через класс, чтобы был docstring
def... | buffer404/university | year3/Computer architecture/lab3/constants/isa.py | isa.py | py | 887 | python | ru | code | 1 | github-code | 1 | [
{
"api_name": "collections.namedtuple",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "constants.isa_const.Opcod... |
18456550160 | import argparse
import sys
def foltycalc(args):
if args.c=="add":
if args.a==78 or args.a==23 and args.b==23 or args.b==78:
return print(f"{args.a}+{args.b} is :",666)
else:
return print(f"{args.a}+{args.b} is :",args.a+args.b)
elif args.c=="sub":
... | kkstech1986/kksingh_soft | fultycalculater_CMD.py | fultycalculater_CMD.py | py | 1,886 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "sys.stdout.write",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 41,
"usage_type": "attribute"
}
] |
9466511067 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# load dataset
df = pd.read_csv("./project/feature_data.csv")
df.head()
# index number 제거
df.drop(["Unnamed: 0"], axis=1, inplace=True)
X = df.drop(["ET"], axis=1)
y = df["ET"]
n_1 = np.sum(y==1)
n_0 = np.sum(y==0)
print(n_0, n_1)
r_state = 42
#... | tyami/naver-competition-study | project/02_resampling.py | 02_resampling.py | py | 2,660 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "imblearn.under_sampling.RandomUnde... |
15238091678 | from django.urls import path
from . import views
urlpatterns = [
path('', views.review, name='review'),
path('post_review/', views.post_review, name='post_review'),
path('review_list/', views.review_list, name='review_list'),
path('game_reviews/<game_id>', views.game_reviews, name='game_reviews'),
] | fergabi17/gemotion | reviews/urls.py | urls.py | py | 318 | python | en | code | 1 | github-code | 1 | [
{
"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",
... |
25369895893 | import os
import configparser
class ReadConfig(object):
def __init__(self):
self.project_path = None
self.config_path = None
self.config = configparser.ConfigParser()
def _set_project_path(self):
# 获取项目地址
try:
self.project_path = os.path.split(os.path.abspa... | weixingdemeng/weixingdemeng.github.io | autotest/read_config.py | read_config.py | py | 746 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.split",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",... |
18119046702 | #!/usr/bin/python3
import aiohttp_cors
import os
import aiohttp
import concurrent.futures
import asyncio
class EyesWebServer():
def __init__(self):
self.app_path="/opt/eyes"
self.web_path="/opt/eyes/web/eyes"
self.web_address="home.dayton.tech"
self.web_port=8080
self.sse_... | tagdara/eyes | server/eyes.py | eyes.py | py | 1,998 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "asyncio.get_event_loop",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "aiohttp.web.Application",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "aiohttp.web",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "aioht... |
71176138595 | import asyncio
import time
from random import randint
from sys import argv
import web3 as w3
from web3.middleware import geth_poa_middleware
from solcx import compile_source
class Node:
def __init__(self, addr, password, addresses, account_limit, to_send,
port):
self.web3 = w3.Web3(
... | coltonfike/e2c | testnet/contract.py | contract.py | py | 3,596 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "web3.Web3",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "web3.Web3.WebsocketProvider",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "web3.Web3",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "web3.Web3.toChec... |
32738212165 | import argparse
from colorama import init
from .common import Messages, Path, check_if_exists
from .. import Havok
def parse_args():
parser = argparse.ArgumentParser(description="Convert Havok packfile to JSON")
parser.add_argument("hkFile", type=Path, help="Path to a Havok packfile")
parser.add_argumen... | krenyy/botw_havok | botw_havok/cli/hk_to_json.py | hk_to_json.py | py | 1,112 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "common.Path",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "common.Path",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "common.Path",
"li... |
22083627803 | import pika
import sys
import time
# 远程rabbitmq服务的配置信息
username = 'chris' # 指定远程rabbitmq的用户名密码
pwd = '123456'
ip_addr = '172.18.99.177'
# rabbitmq 报错 pika.exceptions.IncompatibleProtocolError: StreamLostError: (‘Transport indicated EOF’,) 产生此报错的原因是我将port写成了15672
# rabbitmq需要通过端口5672连接 - 而不是15672. 更改端口,转发,一切正常
port_nu... | chriskowk/PycharmProjects | PyQtTest/sendmq.py | sendmq.py | py | 1,549 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pika.PlainCredentials",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pika.BlockingConnection",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pika.ConnectionParameters",
"line_number": 15,
"usage_type": "call"
},
{
"api_name"... |
8529218144 | import os
import numpy as np
from netCDF4 import Dataset
from lisfloodutilities.readers import PCRasterMap
from lisfloodutilities.pcr2nc import convert
from . import TestWithCleaner
class TestPcr2nc(TestWithCleaner):
def test_convert(self):
dataset = 'tests/data/folder_d'
out = 'tests/data/pcr... | ec-jrc/lisflood-utilities | tests/test_pcr2nc.py | test_pcr2nc.py | py | 1,941 | python | en | code | 14 | github-code | 1 | [
{
"api_name": "os.unlink",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "lisfloodutilities.readers.PCRasterMap",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "lisfloodutilities.readers.PCRasterMap",
"line_number": 39,
"usage_type": "call"
},... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.