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
4148739067
############################################################################################################################################ # This script is used to get all 3rd party dependencies managed by spring-boot-dependencies and spring-cloud-dependencies. # # How to use this script. # 1. Get `SPRING_BOOT_VERSI...
Azure/azure-sdk-for-java
sdk/spring/scripts/get_spring_boot_managed_external_dependencies.py
get_spring_boot_managed_external_dependencies.py
py
11,298
python
en
code
2,081
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 31, "usage_type": "call" }, { "api_name": "log.log.set_log_level", "line_number": 43, "usage_type": "call" }, { "api_name": "log.log", "line_number": 43, "usage_type": "name" }, { "api_name": "time.time", ...
37768964225
""" Defines the classes used for mapping generator artifact rules. """ from abc import ABC, abstractmethod from enum import StrEnum from .constants import * from .logger import logger from .versions import ParsedVersion class MappingRuleAction(StrEnum): """Enumerates the actions that can be taken on an artifact...
sgammon/rules_graalvm
tools/scripts/mapping_generator/rule.py
rule.py
py
11,263
python
en
code
16
github-code
21
[ { "api_name": "enum.StrEnum", "line_number": 13, "usage_type": "name" }, { "api_name": "enum.StrEnum", "line_number": 21, "usage_type": "name" }, { "api_name": "abc.ABC", "line_number": 37, "usage_type": "name" }, { "api_name": "abc.abstractmethod", "line_numb...
27259970732
from collections import defaultdict from graph import Graph import sys sys.setrecursionlimit(10000) def search(word, words): n1 = len(words)-1 n2 = 0 if word == words[n1]: return n1 while True: id = (n1+n2)//2 if word == words[id]: break if word < words[id]...
catShaark/b-a-i-t-a-p-t-o-a-n-r-o-i-r-a-c
5757_words_a.py
5757_words_a.py
py
2,020
python
vi
code
0
github-code
21
[ { "api_name": "sys.setrecursionlimit", "line_number": 4, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 58, "usage_type": "call" }, { "api_name": "graph.Graph", "line_number": 61, "usage_type": "call" } ]
23209594865
# -*- coding: UTF-8 -*- import numpy as np import nrrd import cv2 import imageio class SegFat: def __init__(self): # ======== 读part1 ======== path = './result/nrrd' self.target = self.nrrd2np(path + '/data_part1.nrrd') self.bone = self.nrrd2np(path + '/bone_part1.nrrd') ...
WangMal/pelvicFat_seg
part1_seg.py
part1_seg.py
py
5,469
python
en
code
0
github-code
21
[ { "api_name": "nrrd.read", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 26...
10002388712
import boto3 from botocore.exceptions import ClientError import jmespath import json import os AWS_REGION = 'us-east-1' kms = boto3.client('kms', region_name=AWS_REGION) keys = kms.list_keys() key_ids = jmespath.search('Keys[].KeyId', keys) key_arns = jmespath.search('Keys[].KeyArn', keys) def enabled_keys(key_ids):...
philgladman/aws-resource-collector
kms/list-kms-keys.py
list-kms-keys.py
py
2,533
python
en
code
0
github-code
21
[ { "api_name": "boto3.client", "line_number": 8, "usage_type": "call" }, { "api_name": "jmespath.search", "line_number": 11, "usage_type": "call" }, { "api_name": "jmespath.search", "line_number": 12, "usage_type": "call" }, { "api_name": "jmespath.search", "li...
19682240907
import pandas as pd from pyomo.environ import * # !! Please don't delete this from pyomo.core.base.PyomoModel import * from pyomo.core.base.constraint import * from pyomo.core.base.objective import * from pyomo.core.base.var import * from pyomo.core.kernel.set_types import * from pyomo.opt.base.solvers import * import...
pan5431333/pyoptree
pyoptree/optree.py
optree.py
py
43,830
python
en
code
31
github-code
21
[ { "api_name": "abc.ABCMeta", "line_number": 19, "usage_type": "name" }, { "api_name": "pandas.DataFrame", "line_number": 52, "usage_type": "attribute" }, { "api_name": "pandas.DataFrame", "line_number": 64, "usage_type": "attribute" }, { "api_name": "numpy.inf", ...
30196229554
from outlier_detect import test_ucirv import matplotlib.pyplot as plt import time import numpy as np if __name__=='__main__': st = time.time() # all attack and device names sub_attacks = ["/udp","/syn", "/ack", "/scan","/udpplain","/junk", "/scan","/udp","/tcp"] devices = ["Danmini_Doorbell","Ecobee_Thermos...
adamk1997/thesis_code
outlier_script.py
outlier_script.py
py
2,165
python
en
code
0
github-code
21
[ { "api_name": "time.time", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 12, "usage_type": "call" }, { "api_name": "outlier_detect.test_ucirv", "lin...
31791797671
""" author : Lee Sang Min github : https://github.com/sangm1n e-mail : dltkd96als@naver.com title : topology sort """ import sys from collections import deque input = sys.stdin.readline v, e = map(int, input().split()) # 진입차수 indegree = [0] * (v+1) graph = [[] for _ in range(v+1)] for _ in range(e): a, b = map(...
sangm1n/problem-solving
CodingTest/10-6.py
10-6.py
py
763
python
en
code
0
github-code
21
[ { "api_name": "sys.stdin", "line_number": 11, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 25, "usage_type": "call" } ]
6028715332
# Project Catching the Bus # https://www.safaribooksonline.com/library/view/python-programming-language/9780134217314/PYMC_01_02.html import urllib.request u = urllib.request.urlopen('http://ctabustracker.com/bustime/map/getStopPredictions.jsp?stop=14787&route=22') data = u.read() from xml.etree.ElementTree import XM...
Wildbird74/PythonClasses
testytest/bus.py
bus.py
py
391
python
en
code
0
github-code
21
[ { "api_name": "urllib.request.request.urlopen", "line_number": 5, "usage_type": "call" }, { "api_name": "urllib.request.request", "line_number": 5, "usage_type": "attribute" }, { "api_name": "urllib.request", "line_number": 5, "usage_type": "name" }, { "api_name":...
28158164420
#!/usr/bin/env python3 import sys from pathlib import Path import re prefix_re = re.compile(r"^(-?\d+(?:\.\d+)?)-") def get_prefix_float(s: str) -> float: searched = prefix_re.search(s) assert searched is not None, f"no prefix found in {s}" return float(searched.group(1)) def path_sort_key(p: Path) ->...
whi-tw/.zshrc
scripts/sort_files.py
sort_files.py
py
850
python
en
code
1
github-code
21
[ { "api_name": "re.compile", "line_number": 7, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 16, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 23, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number":...
16127645144
import requests, nltk from bs4 import BeautifulSoup from collections import Counter r = requests.get('https://www.gutenberg.org/files/16/16-h/16-h.htm') r.encoding = ('utf-8') html = r.text soup = BeautifulSoup(html) text = soup.get_text() tokenizer = nltk.tokenize.RegexpTokenizer('\w+') tokens = tokenizer.tokenize(tex...
dmgonzalezmunoz/word-counter
word_counter.py
word_counter.py
py
570
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 4, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 7, "usage_type": "call" }, { "api_name": "nltk.tokenize.RegexpTokenizer", "line_number": 9, "usage_type": "call" }, { "api_name": "nltk.tokeni...
37275876468
import bpy import os import math import sys import csv base_path = "G:\\Programming\\Repositories\\University\\FloatingTrain\\matlab\\SB-1\\" aller_path = base_path + "aller.csv" retour_path = base_path + "retour.csv" initial_x = -23 initial_y = -10 initial_z = -1.0 # get the train object train = bpy.d...
Sytten/FloatingTrain
matlab/SB-1/code_trajectoire.py
code_trajectoire.py
py
1,155
python
en
code
2
github-code
21
[ { "api_name": "bpy.data", "line_number": 16, "usage_type": "attribute" }, { "api_name": "csv.reader", "line_number": 22, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 45, "usage_type": "attribute" } ]
9318795153
#!/usr/bin/env python import sys, random, os, subprocess, multiprocessing, time import PIL from PIL import Image from argparse import ArgumentParser parser = ArgumentParser(description=__doc__) parser.add_argument("--newer", action='store_true') parser.add_argument("--parallel", default=6, type=int) parser.add_argum...
tridge/junkcode
log_analysis/create_maps.py
create_maps.py
py
2,303
python
en
code
21
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_number": 23, "usage_type": "attribute" }, { "api_name": "inspect.getfile",...
8420109278
import pandas as pd import matplotlib.pyplot as plt import math import os from enum import Enum class Metric(Enum): AVG_TPUT = 0 LATENCY = 1 PFD = 2 SUBMITTED = 3 INFLIGHT = 4 CNC = 5 COMPLETED = 6 CONSUMED = 7 REAL_CONSUMED = 8 WAIT = 9 def global_max(local_max, global_max): ...
melanieplageman/prefetcher_charter
chart.py
chart.py
py
3,587
python
en
code
0
github-code
21
[ { "api_name": "enum.Enum", "line_number": 7, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 35, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 35, "usage_type": "name" }, { "api_name": "matplotlib.pyplot...
16789923227
#!/usr/bin/env python # coding: utf-8 import time import glob import util import json import os.path import requests import pandas as pd from datetime import datetime from requests.adapters import HTTPAdapter from urllib3.util.retry import Retry session = requests.Session() retry = Retry(connect=3, backoff_factor=0...
carolmb/mastodon-proj
notebooks/14_users_following.py
14_users_following.py
py
3,581
python
en
code
0
github-code
21
[ { "api_name": "requests.Session", "line_number": 17, "usage_type": "call" }, { "api_name": "urllib3.util.retry.Retry", "line_number": 18, "usage_type": "call" }, { "api_name": "requests.adapters.HTTPAdapter", "line_number": 19, "usage_type": "call" }, { "api_name"...
40257870496
"""#!/home/sgc/anaconda3/envs/phaseNet/bin/python""" # -*- coding: utf-8 -*- from obspy import UTCDateTime from obspy.clients.fdsn import Client import os, multiprocessing from datetime import timedelta try: from utils.merge_xml_picks import merge_xml_picks except ModuleNotFoundError: from merge_xml_picks impor...
dsiervo/sc3_ai_picker
utils/playback.py
playback.py
py
15,675
python
en
code
7
github-code
21
[ { "api_name": "os.path.isdir", "line_number": 37, "usage_type": "call" }, { "api_name": "os.path", "line_number": 37, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 37, "usage_type": "call" }, { "api_name": "os.makedirs", "line_nu...
3500578095
import copy import inspect import optparse import os import subprocess import sys import cStringIO import common.python26_polyfill # pylint: disable=W0611 import collections # Import after polyfill to get OrderedDict on 2.6 from common import annotator from common import chromium_utils from slave import recipe_api...
sunny-bay/chromium30
build/scripts/slave/annotated_run.py
annotated_run.py
py
12,288
python
en
code
1
github-code
21
[ { "api_name": "os.path.dirname", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.dirname", "l...
27366874196
import pytest from pytest_factoryboy import register from .factories import ( UserFactory, DefinitionExampleFactory, EnglishWordFactory, OshindongaIdiomFactory, # OshindongaPhoneticFactory, OshindongaWordFactory, # UnfoundWordFactory, WordDefinitionFactory, ) register(UserFactory) regi...
abiatarfestus/onestop
onestop/dictionary/tests/conftest.py
conftest.py
py
1,239
python
en
code
1
github-code
21
[ { "api_name": "pytest_factoryboy.register", "line_number": 15, "usage_type": "call" }, { "api_name": "factories.UserFactory", "line_number": 15, "usage_type": "argument" }, { "api_name": "pytest_factoryboy.register", "line_number": 16, "usage_type": "call" }, { "a...
13751826466
''' Author: Mario Bartolomé Date: Apr 3, 2018 ###### Wrapper for agent controller systems ''' from backend.comms.MultiWiiProtocol import MSPio from backend.comms.RemoteControl import RemoteServer # from backend.altitudeController import AltitudeController from backend.sensors.Sensor import Sensor from backend.sensor...
MarioBartolome/GII_0_17.02_SNSI
backend/systemControl/ctrlWrapper.py
ctrlWrapper.py
py
15,092
python
en
code
2
github-code
21
[ { "api_name": "typing.Dict", "line_number": 25, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 26, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 27, "usage_type": "name" }, { "api_name": "typing.List", "line_number": ...
75075693
import whisper import pyaudio import numpy as np import wave import struct import os import sys from glob import glob def record(idx, sr, framesize, t): pa = pyaudio.PyAudio() data = [] dt = 1 / sr stream = pa.open(format=pyaudio.paInt16, channels=1, rate=sr, input=True, input_device_index=idx, frames_...
Shiiya0418/Whisper-Sample-for-Jetson
record.py
record.py
py
985
python
en
code
1
github-code
21
[ { "api_name": "pyaudio.PyAudio", "line_number": 11, "usage_type": "call" }, { "api_name": "pyaudio.paInt16", "line_number": 14, "usage_type": "attribute" }, { "api_name": "numpy.frombuffer", "line_number": 23, "usage_type": "call" }, { "api_name": "glob.glob", ...
18382169111
import fnmatch import os import time import pytest from wazuh_testing import logcollector from wazuh_testing.tools import LOG_FILE_PATH from wazuh_testing.tools.configuration import load_wazuh_configurations from wazuh_testing.tools.services import control_service from wazuh_testing.tools.file import truncate_file fro...
wazuh/wazuh-qa
tests/integration/test_logcollector/test_macos/test_macos_format_only_future_events.py
test_macos_format_only_future_events.py
py
7,120
python
en
code
29
github-code
21
[ { "api_name": "pytest.mark", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pytest.mark.tier", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_nu...
30476928278
# author: Mike Dong, late November # version: 1.3 import cx_Oracle import PySimpleGUI as sg from Add_Students import run_program as add def run_program(course): # the function that runs everything, takes in the course name (name and year) con = cx_Oracle.connect('EOM/EOM@127.0.0.1/xe') # connects to the databa...
sidbmw/GRADESK
Python/Edit_Students.py
Edit_Students.py
py
5,476
python
en
code
5
github-code
21
[ { "api_name": "cx_Oracle.connect", "line_number": 10, "usage_type": "call" }, { "api_name": "PySimpleGUI.Input", "line_number": 41, "usage_type": "call" }, { "api_name": "PySimpleGUI.Input", "line_number": 42, "usage_type": "call" }, { "api_name": "PySimpleGUI.Che...
38594248066
import mpmath #Compute alpha and beta of three-term recurrence relation of #monic orthogonal polynomials induced by inner product #<F, G> = int_a^b F(u) G(u) dW(u). #Discretized Stieltjes procedure approximates the inner product as #<F, G> ~ sum_{i = 1}^MDS cDSi * F(uDSi) * G(uDSi). #alpha_m, 0 <= m <= M - 1 #beta_0 =...
ymkoyama/fcmf
gaussian_quadrature.py
gaussian_quadrature.py
py
2,899
python
en
code
0
github-code
21
[ { "api_name": "mpmath.mpf", "line_number": 13, "usage_type": "call" }, { "api_name": "mpmath.mpf", "line_number": 14, "usage_type": "call" }, { "api_name": "mpmath.mpf", "line_number": 15, "usage_type": "call" }, { "api_name": "mpmath.mpf", "line_number": 16, ...
73735838453
# import warnings # from collections import defaultdict # import copy # from coffea.nanoevents.util import quote import collections.abc import fnmatch from coffea.nanoevents.schemas.base import BaseSchema, zip_forms class PDUNESchema(BaseSchema): __dask_capable__ = False mixins = { # branch tag : obj...
CoffeaTeam/coffea
src/coffea/nanoevents/schemas/pdune.py
pdune.py
py
7,803
python
en
code
114
github-code
21
[ { "api_name": "coffea.nanoevents.schemas.base.BaseSchema", "line_number": 11, "usage_type": "name" }, { "api_name": "collections.abc.abc", "line_number": 62, "usage_type": "attribute" }, { "api_name": "collections.abc", "line_number": 62, "usage_type": "name" }, { ...
42970318635
''' Yeabkal Wubshit Sudoku Solver using Backtracking and SAT Solver. *** REQUIREMENTS *** To solve a Sudoku puzzle through a SAT solver, you need to have either: 1) PySAT module installed (https://pypi.org/project/python-sat/) [PREFERRED WAY] 2) `minisat` command line tool *** Usage *** ...
gabriellasanford/2020Vision
sudoku.py
sudoku.py
py
22,878
python
en
code
0
github-code
21
[ { "api_name": "shutil.which", "line_number": 47, "usage_type": "call" }, { "api_name": "pysat.solvers.Glucose3", "line_number": 72, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 120, "usage_type": "call" }, { "api_name": "math.sqrt", "line_...
31508893065
from typing import List, TYPE_CHECKING, Union from ..enum import EventType, Stat, TraitType, DamageType from ..buff import Buff from .trait import Trait from ..event import Event from battle.construct import Damage if TYPE_CHECKING: from battle.construct import Champion from ...action.state import StateManage...
TikaWorld/TFT-simulator
src/battle/construct/trait/divine.py
divine.py
py
2,995
python
en
code
0
github-code
21
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 9, "usage_type": "name" }, { "api_name": "buff.Buff", "line_number": 15, "usage_type": "name" }, { "api_name": "event.Event", "line_number": 15, "usage_type": "name" }, { "api_name": "enum.EventType.BASIC_ATTACK...
6742259348
from logging import fatal from os import name from django.shortcuts import render from django.http import JsonResponse, response from InkItUp.models import * from django.views.decorators.csrf import csrf_exempt import json # Create your views here. #____________Get artists____________ def getAllartists(request): ...
Holmern/Django_Neo4j
Django_Neo4j/InkItUp/views/artist.py
artist.py
py
3,470
python
en
code
0
github-code
21
[ { "api_name": "django.http.response", "line_number": 18, "usage_type": "name" }, { "api_name": "django.http.response.append", "line_number": 26, "usage_type": "call" }, { "api_name": "django.http.response", "line_number": 26, "usage_type": "name" }, { "api_name": ...
43718612075
import numpy as np from scipy.linalg import logm def skew(p): p_skew = np.array([[0,-1*p[2],p[1]],[p[2],0,-1*p[0]],[-1*p[1],p[0],0]]) return p_skew def pose_inv_map(T_mat): w, v = np.linalg.eig(T_mat[0:3,0:3]) index = np.argmin(np.absolute(w.imag)) a = v[:,index].real phi = np.arccos( (0.5)*(np.trace(T_ma...
jdmarr/se_project
util.py
util.py
py
2,039
python
en
code
0
github-code
21
[ { "api_name": "numpy.array", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.linalg.eig", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.linalg", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.argmin", "lin...
19657659592
from django.urls import path from . import views urlpatterns = [ path('fbase',views.fbase,name='fbase'), path('waiting',views.waiting,name="waiting"), path('showQuiz',views.showQuiz,name='showQuiz'), path('leaderboard',views.leaderboard,name='leaderboard'), path('download/<str:game>',views.download...
Mihirsinh-01/Quizck
game/urls.py
urls.py
py
389
python
en
code
0
github-code
21
[ { "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", ...
8243093820
from fastapi import HTTPException, status from backend.pkg import models def create(item, db): transport = models.Transport(id=item.id, status=item.status, plate_number=item.plate_number, transport_type_id=item.tra...
nikitakosatka/polyus-transport
backend/pkg/api/repository/transport.py
transport.py
py
1,467
python
en
code
0
github-code
21
[ { "api_name": "backend.pkg.models.Transport", "line_number": 7, "usage_type": "call" }, { "api_name": "backend.pkg.models", "line_number": 7, "usage_type": "name" }, { "api_name": "backend.pkg.models.Transport", "line_number": 17, "usage_type": "attribute" }, { "a...
22519176680
import argparse import json import sys from datetime import datetime import numpy as np import torch import datasets import models import trainer def get_default_args(): parser = argparse.ArgumentParser() parser.add_argument("--seed", type=int, default=42) #Trainer args parser.add_argument("--learn...
IshwarKulkarni/seq2dCompletion
main.py
main.py
py
2,467
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 35, "usage_type": "attribute" }, { "api_name": "datasets.SpiralDataset", "line_number": 46, "usage_type": "call" }, { "api_name": "datasets...
26459338040
import json import spacy nlp = spacy.load('en_core_web_lg') from flask import Flask,request ,Response app = Flask(__name__) from neo4j import GraphDatabase, basic_auth # from .utils import * driver = GraphDatabase.driver( "bolt://52.23.213.41:32889", auth=basic_auth("neo4j", "discrepan...
shubh101295/CS711-AI-Lawyer
final/app.py
app.py
py
9,577
python
en
code
1
github-code
21
[ { "api_name": "spacy.load", "line_number": 3, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "neo4j.GraphDatabase.driver", "line_number": 10, "usage_type": "call" }, { "api_name": "neo4j.GraphDatabase",...
41621751697
from collections import namedtuple from furl import furl import requests from festung._private import cast from festung._private import no_password_url from festung._private import to_headers from festung._private import to_http_url # Exceptions have to be on the DBAPI module from festung.exceptions import DatabaseEr...
figome/python-festung
festung/dbapi.py
dbapi.py
py
7,671
python
en
code
0
github-code
21
[ { "api_name": "festung.exceptions.DataError", "line_number": 48, "usage_type": "name" }, { "api_name": "festung.exceptions.DatabaseError", "line_number": 49, "usage_type": "name" }, { "api_name": "festung.exceptions.IntegrityError", "line_number": 50, "usage_type": "name"...
37494944771
import torch import numpy as np from datetime import datetime from base import base_trainer class Trainer(base_trainer.BaseTrainer): def __init__( self, model, device, optimizer, lr=1e-3, scheduler=None, validate=True, **kwargs ): super().__init__( model=model, device=...
kpomichowski/MoleDetector
trainer/trainer.py
trainer.py
py
5,998
python
en
code
0
github-code
21
[ { "api_name": "base.base_trainer.BaseTrainer", "line_number": 8, "usage_type": "attribute" }, { "api_name": "base.base_trainer", "line_number": 8, "usage_type": "name" }, { "api_name": "torch.argmax", "line_number": 36, "usage_type": "call" }, { "api_name": "torch...
41322244404
""" Discrete action-space MDP environments, which play nice with OpenAI Gym """ import numpy as np from .mdp_solver import MDPSolver class State(): def __init__(self, key, terminal=False): self.key = key self.actions = set() self.action_next_states = {} self.action_next_state_p = {} self.action_next_st...
minqi/PyMDP
pymdp/mdp.py
mdp.py
py
4,625
python
en
code
4
github-code
21
[ { "api_name": "numpy.random.choice", "line_number": 133, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 133, "usage_type": "attribute" }, { "api_name": "mdp_solver.MDPSolver", "line_number": 145, "usage_type": "call" }, { "api_name": "numpy.r...
13988282762
import matplotlib.pyplot as plt from matplotlib import style style.use('fivethirtyeight') from sklearn.datasets.samples_generator import make_blobs import numpy as np from scipy.stats import multivariate_normal # 0. Create dataset X,Y = make_blobs(cluster_std=1.5,random_state=20,n_samples=500,centers=3) #...
ankitrathi33/Master-s-Degree
EMalgo.py
EMalgo.py
py
6,076
python
en
code
0
github-code
21
[ { "api_name": "matplotlib.style.use", "line_number": 3, "usage_type": "call" }, { "api_name": "matplotlib.style", "line_number": 3, "usage_type": "name" }, { "api_name": "sklearn.datasets.samples_generator.make_blobs", "line_number": 10, "usage_type": "call" }, { ...
43667227690
"""An example of `multiprocessing.Queue`. There is also a `queue` module for in-process memory. It's for sharing data between threads. """ import multiprocessing def calc_square(ns, q): """The child process.""" for n in ns: # `q` is a queue (FIFO). q.put(round(n * n, 2)) if __name__ == '__m...
j127/python_tutorials
python_multiprocess/04_queue_multiprocessing.py
04_queue_multiprocessing.py
py
603
python
en
code
0
github-code
21
[ { "api_name": "multiprocessing.Queue", "line_number": 19, "usage_type": "call" }, { "api_name": "multiprocessing.Process", "line_number": 20, "usage_type": "call" } ]
73785665653
import json from dataclasses import dataclass from typing import Optional from .encoders import ModelEncoder @dataclass class Response: status_code: int event: Optional[object] = None body: Optional[object] = None message: Optional[str] = None extra_headers: Optional[object] = None disable_cor...
beverts312/lambda-utils
bails_lambda_utils/responses.py
responses.py
py
1,990
python
en
code
0
github-code
21
[ { "api_name": "typing.Optional", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 12, "usage_type": "name" }, { "api_name": "typing.Optional", ...
24646192053
from flask import Flask from db import get_one_country, get_top_10 import json app = Flask(__name__) @app.route("/") def hello_world(): top_10 = json.dumps(get_top_10()) return top_10 @app.route("/<id>") def hello_world_one(id): one_c = json.dumps(get_one_country(id_=id)) return one_c if __name__ ==...
curiouscat22/flask-ex
api/main.py
main.py
py
373
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 9, "usage_type": "call" }, { "api_name": "db.get_top_10", "line_number": 9, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 14,...
74336879733
from utils import io from model.BaseEmbeddingModel import BaseEmbeddingModel import torch import os.path as osp from torch_geometric.nn import Node2Vec class Node2vecWrapper(BaseEmbeddingModel): def __init__(self, config, data): super().__init__(config, data) self.device = self.config['devic...
xiransong/xGCN
model/Node2vecWrapper.py
Node2vecWrapper.py
py
2,308
python
en
code
1
github-code
21
[ { "api_name": "model.BaseEmbeddingModel.BaseEmbeddingModel", "line_number": 9, "usage_type": "name" }, { "api_name": "utils.io.load_pickle", "line_number": 21, "usage_type": "call" }, { "api_name": "utils.io", "line_number": 21, "usage_type": "name" }, { "api_name...
32831969560
# taken from OpenAI baselines. import numpy as np import gym from gym.core import ObservationWrapper from gym.spaces import Box from scipy.misc import imresize from gym.core import Wrapper class MaxAndSkipEnv(gym.Wrapper): def __init__(self, env, skip=4): """Return only every `skip`-th frame""" g...
denklewer/yandex-rl-tasks
atari_wrappers.py
atari_wrappers.py
py
7,838
python
en
code
0
github-code
21
[ { "api_name": "gym.Wrapper", "line_number": 11, "usage_type": "attribute" }, { "api_name": "gym.Wrapper.__init__", "line_number": 14, "usage_type": "call" }, { "api_name": "gym.Wrapper", "line_number": 14, "usage_type": "attribute" }, { "api_name": "numpy.zeros", ...
21499508067
from inspect import signature from autograd import elementwise_grad from autograd import numpy as np from scipy.optimize import minimize from scipy.special import gammaln from surpyval.recurrence.parametric.parametric_recurrence import ( ParametricRecurrenceModel, ) from surpyval.utils.recurrent_utils import hand...
derrynknife/SurPyval
surpyval/recurrence/parametric/nhpp.py
nhpp.py
py
8,876
python
en
code
40
github-code
21
[ { "api_name": "inspect.signature", "line_number": 30, "usage_type": "call" }, { "api_name": "autograd.elementwise_grad", "line_number": 36, "usage_type": "call" }, { "api_name": "inspect.signature", "line_number": 38, "usage_type": "call" }, { "api_name": "autogra...
44681440996
import requests import urllib.request import re import os import getopt import sys from bs4 import BeautifulSoup def download_sound( searched_word, lang="english", limit=3, url="dictionary.cambridge.org" ): """Downloads sound files from the site Args: searched_word (str): The word you need to pro...
Aggosh/WordSoundDownloaderCambridgeDictionary
main.py
main.py
py
3,091
python
en
code
1
github-code
21
[ { "api_name": "requests.get", "line_number": 29, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 32, "usage_type": "call" }, { "api_name": "urllib.request.request.build_opener", "line_number": 39, "usage_type": "call" }, { "api_name": "ur...
69897924534
import datetime import uuid import math class gen8: def __init__(self, form, data = None): self.form = form self.values = {} if data: self.load(data) OPTION_FULLSCREEN = 1 OPTION_INTERPOLATE_PIXELS = 8 OPTION_SCALE = 16 OPTION_SHOW_CURSOR = 32 OPTION_SIZ...
FelixWolf/pygms
pygms/gen8.py
gen8.py
py
6,486
python
en
code
1
github-code
21
[ { "api_name": "datetime.datetime.utcfromtimestamp", "line_number": 82, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 82, "usage_type": "attribute" }, { "api_name": "math.floor", "line_number": 112, "usage_type": "call" }, { "api_name": ...
74120467571
from flask import Blueprint, render_template,request,url_for,redirect,flash from models.preference import Preference import json from main.util.fashion import * from main.util.tech import * from main.util.beauty import * from main.util.lifestyle import * from models.user_preference import User_Preference from flask_log...
darrentey/pitch-project
main/blueprints/preferences/views.py
views.py
py
4,191
python
en
code
0
github-code
21
[ { "api_name": "flask.Blueprint", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.redirect", "line_number": 32, "usage_type": "call" }, { "api_name": "flask.url_for", "line_number": 32, "usage_type": "call" }, { "api_name": "models.preference.Prefer...
73593996854
import asyncio async def async_function(): await asyncio.sleep(2) print("hello") return "Async operation completed" async def create_and_run_task(): task = asyncio.create_task(async_function()) return task async def main(): task = await create_and_run_task() print("2") # Continue with...
Dev-wonderful/alx-backend-python
0x01-python_async_function/test.py
test.py
py
435
python
en
code
0
github-code
21
[ { "api_name": "asyncio.sleep", "line_number": 4, "usage_type": "call" }, { "api_name": "asyncio.create_task", "line_number": 9, "usage_type": "call" }, { "api_name": "asyncio.sleep", "line_number": 16, "usage_type": "call" }, { "api_name": "asyncio.run", "line...
86413700889
#!/usr/bin/env python3 import fileinput # <!-- https://rosettacode.org/wiki/Chinese_remainder_theorem#Python from functools import reduce def chinese_remainder(n, a): sum = 0 prod = reduce(lambda a, b: a*b, n) for n_i, a_i in zip(n, a): p = prod // n_i sum += a_i * mul_inv(p, n_i) * p ...
jupblb/aoc-2020
day13/solve2.py
solve2.py
py
812
python
en
code
0
github-code
21
[ { "api_name": "functools.reduce", "line_number": 10, "usage_type": "call" }, { "api_name": "fileinput.input", "line_number": 32, "usage_type": "call" } ]
7513170396
import keyboard from pygame import mixer from voices.voices import talk import threading as tr import datetime import time # Alarma if not hasattr(time, 'clock'): time.clock = time.perf_counter def clock(rec): num = rec.replace('alarma', '') num = num.strip() talk("Alarma activada a las " + num + " h...
Arielmarinvaldes/Lucy_AI_v2.0
system/funtion_sys.py
funtion_sys.py
py
865
python
en
code
1
github-code
21
[ { "api_name": "time.clock", "line_number": 10, "usage_type": "attribute" }, { "api_name": "time.perf_counter", "line_number": 10, "usage_type": "attribute" }, { "api_name": "voices.voices.talk", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.da...
31257765516
# coding:utf-8 import gettext import json import os import requests def post_message(process_name, state, info, machine_name): webhook_url = os.environ["incomming_webhook_url"] (process_name, state, info, machine_name) = map( lambda s: s.encode("utf-8"), (process_name, state, info, machine_name)) ...
miyaichi/uipath-job-status-listener-on-aws
handlers/slack.py
slack.py
py
1,692
python
en
code
7
github-code
21
[ { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "requests.post", "line_number": 21, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 23, "usage_type": "call" } ]
39532041249
import os import json import time import random import tqdm import shutil import wandb import functools import collections from typing import List from dataclasses import dataclass import numpy as np from minEarley.parser import EarleyParser from neural_lark.llm_interface import setup_llm from neural_lark.train_uti...
berlino/grammar-prompting
neural_lark/main_mol.py
main_mol.py
py
15,927
python
en
code
14
github-code
21
[ { "api_name": "dataclasses.dataclass", "line_number": 27, "usage_type": "name" }, { "api_name": "minEarley.parser.EarleyParser.open", "line_number": 50, "usage_type": "call" }, { "api_name": "minEarley.parser.EarleyParser", "line_number": 50, "usage_type": "name" }, {...
19067831368
import pandas as pd import torch.nn.functional as F import torch import os import numpy as np def prediction(index, test_loader, model, attributes, opts): results = {} attribute = attributes for batch_idx, (img, image_id_batch) in enumerate(test_loader): img = img.cuda() with torch.no_grad(...
Bombomls21/conformer_
utils/predict.py
predict.py
py
1,017
python
en
code
0
github-code
21
[ { "api_name": "torch.no_grad", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.nn.functional.sigmoid", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.nn.functional", "line_number": 15, "usage_type": "name" }, { "api_name": "numpy.a...
35371004165
from flask import request from new_api.db import database from new_api.rights_control.models.ReadArticle import ReadArticle class ReadHistoryArticle(ReadArticle): def __init__(self): super().__init__() self.history_id = int(request.form['history_id']) if request.method == 'POST' else \ ...
guateam/LabGuide
new_api/rights_control/models/ReadHistoryArticle.py
ReadHistoryArticle.py
py
586
python
en
code
2
github-code
21
[ { "api_name": "new_api.rights_control.models.ReadArticle.ReadArticle", "line_number": 7, "usage_type": "name" }, { "api_name": "flask.request.method", "line_number": 10, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 10, "usage_type": "name" ...
31670419407
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('pagetree', '0001_initial'), ('main', '0001_initial'), ] operations = [ migrations.AddField( model_name='...
ccnmtl/teachrecovery
teachrecovery/main/migrations/0002_usermodule_hierarchy.py
0002_usermodule_hierarchy.py
py
488
python
en
code
0
github-code
21
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AddField", "line_number": 15, "usage_type": "call" }, { ...
7298075306
from scrapy.utils.project import get_project_settings from scrapy.crawler import CrawlerProcess import sys setting = get_project_settings() process = CrawlerProcess(setting) IDD=sys.argv[1] for spider_name in process.spiders.list(): print ("Running spider %s" % (spider_name)) process.crawl(spider_name...
snxcj0523/StockCrawler
RunSPDS.py
RunSPDS.py
py
397
python
en
code
0
github-code
21
[ { "api_name": "scrapy.utils.project.get_project_settings", "line_number": 5, "usage_type": "call" }, { "api_name": "scrapy.crawler.CrawlerProcess", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 7, "usage_type": "attribute" } ]
26101221127
import os from argparse import ArgumentParser class ArgParser: def __init__(self): self.parser = ArgumentParser( prog='httpfs', usage='httpfs [-v] [-p PORT] [-d PATH-TO-DIR]', # add_help=False ) # self.parser.add_argument( # '-h', #...
MatthewTeolis/comp-445
assignment-2/http-server/src/httpserver/argparser/ArgParser.py
ArgParser.py
py
1,431
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 39, "usage_type": "call" } ]
13197987749
import logging from qkan.database.dbfunc import DBConnection VERSION = "2.5.9" logger = logging.getLogger("QKan.database.migrations") def run(dbcon: DBConnection) -> bool: # ValueMaps durch RelationMaps ersetzen, weil die entsprechende Funktion # aus der QGIS-API in Python nicht gemappt ist, somit also in ...
hoettges/QKan
qkan/database/migrations/0011_abflusstypen.py
0011_abflusstypen.py
py
2,197
python
de
code
9
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "qkan.database.dbfunc.DBConnection", "line_number": 10, "usage_type": "name" } ]
12053411660
"""Image Library Functions""" import os __all__ = list(globals()) def imread(file): import cv2 import numpy as np return cv2.imdecode(np.fromfile(file, np.uint8), -1) def imwrite(file, im): import cv2 cv2.imencode('.jpg', im)[1].tofile(file) def imshow(img, delay=50, title=''): # for test ...
znsoooo/lishixian
lishixian/np.py
np.py
py
910
python
en
code
2
github-code
21
[ { "api_name": "cv2.imdecode", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.fromfile", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 12, "usage_type": "attribute" }, { "api_name": "cv2.imencode", "line...
15804933908
import os import json import random import numpy class ExperimentConfiguration: def __init__(self, network_configuration, topology_configuration, firedex_configuration): base_host = "10.0.0.%d" host_index = 1 broker_host = (base_host % host_index) host_index = host_index + 1 ...
boulouk/firedex
firedex-static/experimental-framework/configuration/experiment_configuration.py
experiment_configuration.py
py
8,012
python
en
code
2
github-code
21
[ { "api_name": "random.sample", "line_number": 180, "usage_type": "call" }, { "api_name": "numpy.random.exponential", "line_number": 184, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 184, "usage_type": "attribute" }, { "api_name": "json.dump...
73233702774
import json from django.http import HttpResponse from django_swagger_utils.drf_server.utils.decorator.interface_decorator \ import validate_decorator from .validator_class import ValidatorClass from content_management_portal.storages.clean_solution_storage_implementation \ import CleanSolutionStorageImplementat...
bammidichandini/content_management_portal
content_management_portal/views/delete_coding_question_clean_solution/api_wrapper.py
api_wrapper.py
py
1,426
python
en
code
0
github-code
21
[ { "api_name": "content_management_portal.storages.question_storage_implementation.QuestionStorageImplementation", "line_number": 21, "usage_type": "call" }, { "api_name": "content_management_portal.storages.clean_solution_storage_implementation.CleanSolutionStorageImplementation", "line_numb...
4899518063
import zmq import threading import signal signal.signal(signal.SIGINT, signal.SIG_DFL); def request(): try: context = zmq.Context(1) ##### Request device # Socket facing client frontend_req = context.socket(zmq.SUB) frontend_req.bind("tcp://*:5559") fron...
AnEscapist/sdn-orchestrator
ucpe/zmq/test_pubsub_broker.py
test_pubsub_broker.py
py
1,734
python
en
code
0
github-code
21
[ { "api_name": "signal.signal", "line_number": 6, "usage_type": "call" }, { "api_name": "signal.SIGINT", "line_number": 6, "usage_type": "attribute" }, { "api_name": "signal.SIG_DFL", "line_number": 6, "usage_type": "attribute" }, { "api_name": "zmq.Context", "...
30488385073
import speech_recognition as sr import webbrowser import datetime import pyttsx3 import pyjokes import time import os def speechToText(): recognizer = sr.Recognizer() with sr.Microphone() as source: print("listening...") recognizer.adjust_for_ambient_noise(source) audio = recognizer.lis...
Fakher-Zaman/Python-Projects
Voice_Assistant.py
Voice_Assistant.py
py
2,227
python
en
code
2
github-code
21
[ { "api_name": "speech_recognition.Recognizer", "line_number": 10, "usage_type": "call" }, { "api_name": "speech_recognition.Microphone", "line_number": 11, "usage_type": "call" }, { "api_name": "speech_recognition.UnknownValueError", "line_number": 20, "usage_type": "attr...
26442665339
import os import traceback import inspect import importlib from data.constants import TEST_CARD_FILE, TEST_CARD_HEADER from game.game import game_base from .errors_screen import run as run_errors from ui.scene.templates.loading import Loading def step_test(t): t.step_sim() return t.get_sims() / 300 ...
milkmull/Card-Game-Final
node/tester/tester.py
tester.py
py
3,886
python
en
code
0
github-code
21
[ { "api_name": "ui.scene.templates.loading.Loading", "line_number": 20, "usage_type": "call" }, { "api_name": "errors_screen.run", "line_number": 38, "usage_type": "call" }, { "api_name": "game.card.cards.get_playable_card_data", "line_number": 45, "usage_type": "call" }...
2638217981
""" @Author: Wiktor Filipiuk <wiktor.filipiuk@gmail.com> @ProblemName: Special Pythagorean triplet ----------------------------------------------------------------------- @Description: A Pythagorean triplet is a set of three natural numbers, a < b < c, for which, a^2 + b^2 = c^2 For example, 3^2 + 4^2 = 9 + 16 = 25 = ...
wiktorfilipiuk/Algorithms_ProjectEuler
problem9.py
problem9.py
py
949
python
en
code
0
github-code
21
[ { "api_name": "functools.reduce", "line_number": 34, "usage_type": "call" }, { "api_name": "operator.mul", "line_number": 34, "usage_type": "argument" } ]
31298293056
# Group: Emilio Brambilla, Lasse Haffke, Moritz Lahann from skimage.segmentation import slic, mark_boundaries from skimage.io import imread import numpy as np import matplotlib.pyplot as plt def slic_visualize(image, n=100, c=10.0): superpixels = slic(input_image, n_segments=n, compactness=c) plt.imshow(ma...
ebrambilla42/cv1_assignements
CV1_5/cv_ex05_03/main.py
main.py
py
4,217
python
en
code
0
github-code
21
[ { "api_name": "skimage.segmentation.slic", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.imshow", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 13, "usage_type": "name" }, { "api_name": "...
74383392691
from io import BytesIO from six import iteritems import pycurl class Request(object): def __init__(self, save_to=None, **options): self.save_to = save_to self.options = options self.curl = pycurl.Curl() self.curl.setopt(pycurl.FOLLOWLOCATION, True) self.content = BytesIO() ...
bendechrai/opening-doors-rpi
door-bell-sms/doorbell/lib/python3.6/site-packages/http_client/base.py
base.py
py
2,327
python
en
code
4
github-code
21
[ { "api_name": "pycurl.Curl", "line_number": 10, "usage_type": "call" }, { "api_name": "pycurl.FOLLOWLOCATION", "line_number": 11, "usage_type": "attribute" }, { "api_name": "io.BytesIO", "line_number": 12, "usage_type": "call" }, { "api_name": "io.BytesIO", "l...
12164344402
""" Simple custom emitter for DataDog agent to produce messages to Kafka. Enable it by adding the following lines to datadog.conf and restarting the agent: kafka_hosts: kafka-hostname:9092 kafka_topic: datadog custom_emitters: /path/to/KafkaEmitter.py See the emitter documentation for additional optional settings. Vers...
vanveele/kafka-emitter
KafkaEmitter.py
KafkaEmitter.py
py
9,273
python
en
code
0
github-code
21
[ { "api_name": "sys.exc_info", "line_number": 74, "usage_type": "call" }, { "api_name": "sys.exc_info", "line_number": 94, "usage_type": "call" }, { "api_name": "kafka.errors.LeaderNotAvailableError", "line_number": 117, "usage_type": "name" }, { "api_name": "kafka...
70650281654
from hashlib import new import sys import os from torch.optim import Adam, AdamW, RMSprop from torch.nn import BCELoss from torch import no_grad from time import time sys.path.append(os.path.join(os.getcwd())) from DataProcessing.dataLoader import DataLoader from model import Model from util import save_and_log, lo...
Cabbagito/Extraterrestrial-Technosignature-Detection
ImageClassificationModel/training.py
training.py
py
2,682
python
en
code
1
github-code
21
[ { "api_name": "sys.path.append", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number...
70118816372
import tweepy import json from textblob import TextBlob import time import couchdb import json import pandas as pd import sys # LZT tweeter key consumer_key = 'syvBAqd7spC9PbV622K3UNaB6' consumer_secret = 'IPcGyK1Op8MH1etJeVlmxOnaNg6t5zYoifSr1bOb0lxI179n3z' access_token = '1385155978996322307-63mBdQYfKG6KEOElbh3HiPmW...
Zce-Zy/Master-Comp90024
couchDB/historyTweet_Catch/catch.py
catch.py
py
3,739
python
en
code
1
github-code
21
[ { "api_name": "tweepy.OAuthHandler", "line_number": 24, "usage_type": "call" }, { "api_name": "tweepy.API", "line_number": 26, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 90, "usage_type": "call" }, { "api_name": "tweepy.RateLimitError", ...
43255692755
import torch from torch.utils.data import DataLoader import numpy as np class SHRED(torch.nn.Module): '''SHRED model accepts input size (number of sensors), output size (dimension of high-dimensional spatio-temporal state, hidden_size, number of LSTM layers, size of fully-connected layers, and dropout paramete...
nathankutz/DataDriven
SHRED/models.py
models.py
py
5,607
python
en
code
1
github-code
21
[ { "api_name": "torch.nn", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.nn.LSTM", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 11, "usage_type": "attribute" }, { "api_name": "torch.nn.Linear", "line_...
37033873222
# -*- coding: utf-8 -*- """ Created on Mon Aug 9 09:51:59 2021 script for spatial analysis (Spatial Autocorrelation and Hotspot Analysis) author : Daegun Kim """ #%% Import packages import esda import pandas as pd import geopandas as gpd from geopandas import GeoDataFrame import libpysal as lps import numpy as np i...
gmkim716/Public-Big-Data_Hackathon-Project
ChildCare/Spatial_Analysis.py
Spatial_Analysis.py
py
18,740
python
en
code
0
github-code
21
[ { "api_name": "random.seed", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 27, "usage_type": "attribute" }, { "api_name": "os.environ", "lin...
24340607881
""" @file hough_lines.py @brief This program demonstrates line finding with the Hough transform """ import sys import math import cv2 as cv import numpy as np def main(): default_file = 'e34ce0452108219af69b5afe90fa0982.jpg' filename = "testLines.jpg" # Loads an image src = cv.imread(cv....
mmsaeed509/Image-Processing
semester-1/Assignments/Assignment 3/delivery03/line.py
line.py
py
969
python
en
code
1
github-code
21
[ { "api_name": "cv2.imread", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.samples.findFile", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.samples", "line_number": 15, "usage_type": "attribute" }, { "api_name": "cv2.IMREAD_GRAYSCALE...
73470099894
import requests from bs4 import BeautifulSoup import re URL = 'https://www.johnlewis.com/asus-chromebook-flip-c433ta-intel-core-m3-4gb-ram-64gb-emmc-14-inch-full-hd-silver/p4811855' TAG_NAME = 'p' QUERY = {'class': 'price price--large'} response = requests.get(URL) content = response.content soup = BeautifulSoup(cont...
borgausifo/pricing-alert-app
app_2.py
app_2.py
py
552
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 11, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 15, "usage_type": "call" } ]
42370835911
############## Secondo transition model ####################### # Miglioramenti rispetto al primo: ### 1) ha un decoder dentro il transition model ### 2) la loss contiene la differenza dei codici z_prime e z_prime_hat, dove il primo è calcolato come l'encoder di x_prime mentre il secondo come delta([encoder(x), action...
Elena-Umili/RL-Planning
code/transition_model_torch_2.py
transition_model_torch_2.py
py
7,628
python
en
code
1
github-code
21
[ { "api_name": "torch.device", "line_number": 20, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 20, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 20, "usage_type": "attribute" }, { "api_name": "torch.nn.Module"...
13885263826
#!/usr/bin/python import sqlite3 import time import datetime from datetime import date, timedelta import config from Expense import Expense class MonthView: def __init__(self, date, period): self.date = date self.period = period #date=time.strftime("%Y-%m-%d" def TotalAmount(self): ...
agurk/OldExpenses
website/MonthView.py
MonthView.py
py
2,840
python
en
code
0
github-code
21
[ { "api_name": "datetime.date", "line_number": 13, "usage_type": "name" }, { "api_name": "sqlite3.connect", "line_number": 18, "usage_type": "call" }, { "api_name": "config.SQLITE_DB", "line_number": 18, "usage_type": "attribute" }, { "api_name": "datetime.date", ...
37814898660
from os.path import dirname, join from bokeh.io import curdoc from bokeh.layouts import column, layout from bokeh.models import ColumnDataSource, Div, Select, Slider, TextInput,Button,CustomJS,TableColumn,DataTable,HTMLTemplateFormatter from bokeh.plotting import figure from bokeh.models.widgets import AutocompleteInpu...
giacomomarchioro/bokeharchivio
main.py
main.py
py
9,749
python
it
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 12, "usage_type": "call" }, { "api_name": "bokeh.models.Div", "...
2308192470
# -*- coding: utf-8 -*- """ Created on Tue Sep 20 16:16:03 2016 @author: marta """ import argparse import numpy as np parser = argparse.ArgumentParser(description="Chromosome parser") parser.add_argument('-i', '--input_file', dest = "input", action = "store", ...
isglobal-brge/Supplementary-Material
Ruiz-Arenas_2020/FASTEPPR_parser.py
FASTEPPR_parser.py
py
1,614
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.empty", "line_number": 42, "usage_type": "call" }, { "api_name": "numpy.savetxt", "line_number": 70, "usage_type": "call" } ]
26561060481
import numpy as np import scipy.optimize class GausFit: def __init__(self, BASELINE_SUBTRACT=False): """ This code will fit a timeseries with a single Gaussian for now, and may be extended to multiple Gaussians later on. """ self.BASELINE_SUBTRACT = BASELINE_SUBTRAC...
mshumko/ac6_microburst_scale_sizes
stats/old/gaus_fit.py
gaus_fit.py
py
2,104
python
en
code
0
github-code
21
[ { "api_name": "numpy.max", "line_number": 23, "usage_type": "call" }, { "api_name": "scipy.optimize.optimize.curve_fit", "line_number": 25, "usage_type": "call" }, { "api_name": "scipy.optimize.optimize", "line_number": 25, "usage_type": "attribute" }, { "api_name...
34007865491
#!/usr/bin/python #coding: utf-8 from __future__ import print_function from __future__ import division import sys import csv from math import log10 from collections import defaultdict words = [] # words list last_word_docid_pair = None # for wordcount calculation df_t_dict = defaultdict(lambda: set()...
rdetain/dauphine-tfidf_computing
tfidf_reducer.py
tfidf_reducer.py
py
2,625
python
en
code
0
github-code
21
[ { "api_name": "collections.defaultdict", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 16, "usage_type": "attribute" }, { "api_name": "math.log10", "line_number": 58, "usage_type": "call" } ]
26807808801
__all__ = ['UnionFind', 'PriorityQueue'] class UnionFind: """Union-find data structure. Each unionFind instance X maintains a family of disjoint sets of hashable objects, supporting the following two methods: - X[item] returns a name for the set containing the given item. Each set is named by ...
OpenWeavers/openanalysis
openanalysis/base_data_structures.py
base_data_structures.py
py
4,325
python
en
code
9
github-code
21
[ { "api_name": "itertools.count", "line_number": 87, "usage_type": "call" }, { "api_name": "heapq.heappush", "line_number": 97, "usage_type": "call" }, { "api_name": "heapq.heappop", "line_number": 106, "usage_type": "call" }, { "api_name": "heapq.heapify", "li...
28299187667
from flask import Flask from flask_restful import Resource, Api app = Flask(__name__) app.secret_key = 'thisisjustarandomstring' api = Api(app) class GCD(Resource): def get(self, n1, n2): n1 = float(n1) n2 = float(n2) if(n2 == 0): return n1 else: return {'ans': GC...
sahityasagiraju/Cloud-Computing-Hackathon
gcd/app/app.py
app.py
py
489
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask_restful.Api", "line_number": 6, "usage_type": "call" }, { "api_name": "flask_restful.Resource", "line_number": 8, "usage_type": "name" } ]
16815634164
import arcade class GUICard(arcade.Sprite): """ Card sprite """ def __init__(self, suit, value, scale=1): """ Card constructor """ # Attributes for suit and value self.suit = suit self.value = value # Image to use for the sprite when face up self.image_file_na...
Horus26/BlackJackPython
Blackjack/GUICard.py
GUICard.py
py
490
python
en
code
0
github-code
21
[ { "api_name": "arcade.Sprite", "line_number": 3, "usage_type": "attribute" } ]
18288075777
import json, os, sys from config import Config import pytest DEFAULT = os.path.expanduser('~') + '/.config/TerminusBrowser/config.json' test_list = [ ('', DEFAULT), ('/tmp/', DEFAULT), ('/tmp/cfg.json', '/tmp/cfg.json') ] @pytest.mark.parametrize("test_input, expected", test_list) def test_location(test...
wtheisen/TerminusBrowser
tests/test_config.py
test_config.py
py
390
python
en
code
121
github-code
21
[ { "api_name": "os.path.expanduser", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "config.Config", "line_number": 16, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize",...
34202548687
from typing import List from PyQt5.QtWidgets import QDialog, QLabel, QLayout, QLineEdit, QMainWindow, QPushButton, QSizePolicy, QVBoxLayout, QWidget from PyQt5.QtCore import Qt, Signal from . import Notification from .widgets import CustomDoubleValidator, DropdownList class RotateSimpleDialog(QDialog): # ...
miguel-martinr/Pycture
src/pycture/dialogs/rotate_simple_dialog.py
rotate_simple_dialog.py
py
2,136
python
en
code
1
github-code
21
[ { "api_name": "PyQt5.QtWidgets.QDialog", "line_number": 9, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.Signal", "line_number": 11, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 13, "usage_type": "name" }, { "api_name":...
7975651246
# coding=utf-8 import sys sys.path.append("d:\\Test\\pythonProject\\new\\logger") import os.path from configparser import ConfigParser from selenium import webdriver import logger class BrowserEngine(): dir = os.path.dirname(os.path.abspath('.')) chrome_driver_path = dir + '/tools/chromedriver.exe' ie_...
jerrychen28/Demo_Test
BrowserEngine/browser_engine.py
browser_engine.py
py
1,756
python
en
code
0
github-code
21
[ { "api_name": "sys.path.append", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.path.dirname", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.path", "...
4036506709
import http.client import http.server import json class testHTTPRequestHandler(http.server.BaseHTTPRequestHandler): OPENFDA_API_URL='api.fda.gov' OPENFDA_API_EVENT="/drug/event.json" def get_events(self, limit): conn= http.client.HTTPSConnection(self.OPENFDA_API_URL) #conexion conn.request...
Noemiglois/openfda
web.py
web.py
py
8,260
python
en
code
0
github-code
21
[ { "api_name": "http.client.server", "line_number": 5, "usage_type": "attribute" }, { "api_name": "http.client", "line_number": 5, "usage_type": "name" }, { "api_name": "http.client.client.HTTPSConnection", "line_number": 9, "usage_type": "call" }, { "api_name": "h...
1628453766
from PyQt5 import uic from PyQt5.QtCore import * from foodClasses import * from food_item_library.foodLibrary import * from custom_table_items import * class EditRecipePopup(QWidget): #========================== # Custom signals #========================== updated_recipe = pyqtSignal(dict) #=======================...
slevasse/foodinator
editRecipePopup.py
editRecipePopup.py
py
10,110
python
en
code
0
github-code
21
[ { "api_name": "PyQt5.uic.loadUi", "line_number": 18, "usage_type": "call" }, { "api_name": "PyQt5.uic", "line_number": 18, "usage_type": "name" } ]
24400175237
import numpy as np from scipy.sparse import csr_matrix from sklearn.metrics.pairwise import cosine_similarity import pickle from sklearn.decomposition import TruncatedSVD class LSA: def createQuery(userTerms, terms): query = [0] * len(terms) for x in userTerms: i = 0 for y in...
GiuseppeNappo/MagicPotBackend
app/lsa.py
lsa.py
py
2,058
python
it
code
0
github-code
21
[ { "api_name": "pickle.load", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 22, "usage_type": "call" }, { "api_name": "sklearn.metrics.pairwise.cosine_similarity", "line_number": 42, "usage_type": "call" }, { "api_name": "sci...
10682280912
#!/usr/bin/env python """NDG Attribute Authority SAML SOAP Binding client unit tests NERC DataGrid Project """ __author__ = "P J Kershaw" __date__ = "15/02/10 (moved from test_attributeauthorityclient)" __copyright__ = "(C) 2010 Science and Technology Facilities Council" __license__ = "BSD - see LICENSE file in top-le...
cedadev/ndg_security_common
ndg/security/common/test/unit/attributeauthorityclient/test_samlattributeauthorityclient.py
test_samlattributeauthorityclient.py
py
13,530
python
en
code
0
github-code
21
[ { "api_name": "logging.basicConfig", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 13, "usage_type": "attribute" }, { "api_name": "ndg.security.common.config.importElementTree", "line_number": 22, "usage_type": "call" }, { ...
14173322563
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed May 4 09:18:53 2022 @author: miguel """ #Loading the required modules import numpy as np import matplotlib.pyplot as plt import statistics import math import time class Kmeans: def _get_distance(self, centroides, atributos): distancias...
miligon/red_de_base_radial
kmeans.py
kmeans.py
py
3,936
python
en
code
0
github-code
21
[ { "api_name": "numpy.tile", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.power", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 30, ...
10224991589
# ble_json_read와 zigbee_json_read에서 만들어진 list들을 db에 로깅하는 모듈 import os,sys,json import pymysql from app.module.Zigbee import zigbee from app.module.BLE import bluetooth as ble p_file = './exported_json/zigbee' h_file = './exported_json/hub' b_file = './exported_json/ble' DBINFO_JSON = './app/module/DB/dbinfo.json' js...
germonado/Graduation-Project
app/module/DB/DBlogging.py
DBlogging.py
py
4,642
python
en
code
1
github-code
21
[ { "api_name": "json.load", "line_number": 14, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, ...
18719070266
import copy import pymysql import time from twisted.enterprise import adbapi from .items import MatchItem from .items import ImmMatchItem from .comm.MsDebug import MsLog class MsspiderPipeline(object): def __init__(self, db_pool): self.db_pool = db_pool # self.db_pool.cursor.execute('set autocommi...
mansoy/MsSpider
MsSpider/TestPiplelines.py
TestPiplelines.py
py
6,697
python
en
code
1
github-code
21
[ { "api_name": "time.time", "line_number": 22, "usage_type": "call" }, { "api_name": "twisted.enterprise.adbapi.ConnectionPool", "line_number": 32, "usage_type": "call" }, { "api_name": "twisted.enterprise.adbapi", "line_number": 32, "usage_type": "name" }, { "api_...
7505961191
from django.urls import path from todofeature.views import todo_list_view, todo_add_view app_name = "todofeature" urlpatterns = [ path("",todo_list_view, name="todo_list"), path("todo-add/", todo_add_view, name="todo_add"), ]
milashjung/python_class
src/todofeature/urls.py
urls.py
py
237
python
pt
code
0
github-code
21
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "todofeature.views.todo_list_view", "line_number": 8, "usage_type": "argument" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "t...
37201043445
import inspect import os import os.path as osp import json import time from datetime import datetime import torch from torch.utils.tensorboard import SummaryWriter import print_custom as db class G: output_dir = None output_file = None policy_file = None def save_hyperparams(output_dir, params): with...
rhklite/PPO_Pytorch
logger.py
logger.py
py
1,418
python
en
code
0
github-code
21
[ { "api_name": "os.path.join", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "name" }, { "api_name": "json.dumps", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_num...
14890823570
import yfinance as yf def price(ticker, period='1d',columns=['Close']): ''' Returns a DataFrame of prices for ticker from Yahoo Finance API ''' obj = yf.Ticker(ticker) return obj.history(period=period)[columns] def prices(tickers, period='1h',columns=['Close']): ''' Returns a DataFrame of...
markgolez/forexCrypto_technical_analysis
yahoo_finance.py
yahoo_finance.py
py
682
python
en
code
0
github-code
21
[ { "api_name": "yfinance.Ticker", "line_number": 7, "usage_type": "call" } ]
20661018921
############################################################################## """ THIS IS A STAND-ALONE MODULE IT IS NOT INTENDED TO BE IMPORTED """ ##########################################...
AdamantLife/alcustoms
alcustoms/Programs/SymLinkUtility.py
SymLinkUtility.py
py
5,732
python
en
code
0
github-code
21
[ { "api_name": "math.sqrt", "line_number": 24, "usage_type": "call" }, { "api_name": "tkinter.ttk.Frame", "line_number": 34, "usage_type": "attribute" }, { "api_name": "tkinter.ttk", "line_number": 34, "usage_type": "name" }, { "api_name": "tkinter.ttk.Label", ...
19402179537
import dataclasses import functools import re import requests from lxml import html from records.GameInfo import GameInfo, ItchGamePageInfo from decorators import aggregator from scrapers.GamePageScraper import GamePageScraper from scrapers.Scraper import Scraper @dataclasses.dataclass(frozen=True) class BundleEntr...
joseph-e-k/itchio-utils
scrapers/BundleEntryScraper.py
BundleEntryScraper.py
py
2,116
python
en
code
0
github-code
21
[ { "api_name": "scrapers.Scraper.Scraper", "line_number": 15, "usage_type": "name" }, { "api_name": "lxml.html.HtmlElement", "line_number": 16, "usage_type": "attribute" }, { "api_name": "lxml.html", "line_number": 16, "usage_type": "name" }, { "api_name": "records...
41434331235
from django.urls import path from . import views urlpatterns = [ path('new', views.new, name='new_gateway'), path('delate', views.delate, name='删除网关'), path('getAll', views.get_all), path('mqtt_config', views.mqtt_config), path('createTopic', views.create_topic), path('getAllTopic', views.get_...
dragonxu/IoT_device_client
backend/gateway/urls.py
urls.py
py
420
python
en
code
1
github-code
21
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", ...
25114741633
from django.contrib.auth.models import AbstractUser from django.db import models from .validators import username_regex_validator class User(AbstractUser): username = models.CharField( verbose_name='Юзернэйм', max_length=150, validators=[username_regex_validator], unique=True, ...
grmzk/foodgram-project-react
backend/users/models.py
models.py
py
1,771
python
en
code
0
github-code
21
[ { "api_name": "django.contrib.auth.models.AbstractUser", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 8, "usage_type": "call" }, { "api_name": "django.db.models", "line_number": 8, "usage_type": "name" }, { "...
40852032319
import streamlit as st # TODO: rename and refactor everything def select_num_interval( param_name: str, limits_list: list, defaults, n_for_hash, **kwargs ): st.sidebar.subheader(param_name) min_max_interval = st.sidebar.slider( "", limits_list[0], limits_list[1], defaults,...
IliaLarchenko/albumentations-demo
src/control.py
control.py
py
2,762
python
en
code
101
github-code
21
[ { "api_name": "streamlit.sidebar.subheader", "line_number": 9, "usage_type": "call" }, { "api_name": "streamlit.sidebar", "line_number": 9, "usage_type": "attribute" }, { "api_name": "streamlit.sidebar.slider", "line_number": 10, "usage_type": "call" }, { "api_nam...
30476922898
import cx_Oracle import PySimpleGUI as sg con = cx_Oracle.connect('EOM/EOM@127.0.0.1/xe') cur = con.cursor(scrollable=True) cur.execute("SELECT FIRST_NAME FROM EOM_STUDENTS") names_fetch = cur.fetchall() new_names = [n[0] for n in names_fetch] print(new_names) layout = [[sg.Text('Listbox with search')], ...
sidbmw/GRADESK
Python/Dropdown Menu Example.py
Dropdown Menu Example.py
py
1,083
python
en
code
5
github-code
21
[ { "api_name": "cx_Oracle.connect", "line_number": 5, "usage_type": "call" }, { "api_name": "PySimpleGUI.Text", "line_number": 15, "usage_type": "call" }, { "api_name": "PySimpleGUI.Input", "line_number": 16, "usage_type": "call" }, { "api_name": "PySimpleGUI.Listb...