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
14642614581
import sys, math, os, json, copy import nltk from nltk.corpus import stopwords from nltk.tokenize import RegexpTokenizer from nltk.tokenize import sent_tokenize def sigmoid(max): #sigmoid that calculates the influnce score c=1 def calc(x): return((max/(1+math.exp(-x*c))-max/2)*2) return calc d...
prodionov/articleAnalyzerAPI
restAPI/processing/influence_score.py
influence_score.py
py
2,570
python
en
code
0
github-code
21
[ { "api_name": "math.exp", "line_number": 11, "usage_type": "call" }, { "api_name": "copy.copy", "line_number": 15, "usage_type": "call" }, { "api_name": "nltk.tokenize.sent_tokenize", "line_number": 16, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords....
42520410751
from django.shortcuts import render, redirect from django.contrib.auth import authenticate, login, logout from django.contrib import messages from .forms import UserRegisterForm, UserLoginForm from django.conf import settings from .utils import prepare_image, face_detect, match_face from django.http import JsonResponse...
Maryam077/istudyfaceauth
FaceAuth/views.py
views.py
py
3,536
python
en
code
0
github-code
21
[ { "api_name": "django.shortcuts.render", "line_number": 17, "usage_type": "call" }, { "api_name": "django.utils.timezone.now", "line_number": 20, "usage_type": "call" }, { "api_name": "django.utils.timezone", "line_number": 20, "usage_type": "name" }, { "api_name"...
971598720
import numpy as np import torch import torch.nn.functional as func from torchvision.utils import save_image from matplotlib import colors from PIL import Image import matplotlib.pyplot as plt cmap = colors.ListedColormap(['b','g','y','r']) overflow_kernel = torch.tensor([ [0,1,0], [1,0,1], [0,1,0]]) over...
TomLemsky/pytorch-fractals
sandpile_torch.py
sandpile_torch.py
py
1,028
python
en
code
0
github-code
21
[ { "api_name": "matplotlib.colors.ListedColormap", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.colors", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.tensor", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.z...
73470152694
import math import time from abc import ABC from typing import Optional import loralib as lora import torch import torch.distributed as dist import wandb from coati.models.loss import GPTLMLoss from torch import nn from torch.optim import Adam, Optimizer from torch.optim.lr_scheduler import LambdaLR from torch.utils.d...
binmakeswell/ColossalChat
coati/trainer/sft.py
sft.py
py
6,451
python
en
code
58
github-code
21
[ { "api_name": "abc.ABC", "line_number": 26, "usage_type": "name" }, { "api_name": "strategies.Strategy", "line_number": 44, "usage_type": "name" }, { "api_name": "torch.optim.Optimizer", "line_number": 45, "usage_type": "name" }, { "api_name": "torch.utils.data.Da...
1117528613
""" Utils related to visualization of inputs, results or visualization in general Currently includes: - interactive prediction viewer for tiny images classification - simple confusion matrix Creation Date: April 2020 Creator: GranScudetto """ import tensorflow as tf import numpy as np import matplotlib.pyplot as plt ...
GranScudetto/AI-Example-Zoo
utils/visualization.py
visualization.py
py
18,774
python
en
code
1
github-code
21
[ { "api_name": "numpy.ndarray", "line_number": 18, "usage_type": "attribute" }, { "api_name": "numpy.random.randint", "line_number": 75, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 75, "usage_type": "attribute" }, { "api_name": "matplotlib....
7226373356
import numpy as np import matplotlib.pyplot as plt from Code import gradient_descent_solver from Code import newton_solver from Code import bfgs_solver from Code import solver from scipy.optimize import rosen, rosen_der, rosen_hess def rosenbrock_f(x): return rosen(x) def rosenbrock_grad_f(x): return rosen_...
icsmith97/ProjectFiles
Code/figure_contour_plots.py
figure_contour_plots.py
py
2,434
python
en
code
0
github-code
21
[ { "api_name": "scipy.optimize.rosen", "line_number": 11, "usage_type": "call" }, { "api_name": "scipy.optimize.rosen_der", "line_number": 15, "usage_type": "call" }, { "api_name": "scipy.optimize.rosen_hess", "line_number": 19, "usage_type": "call" }, { "api_name"...
71077566133
import torch import torch.nn as nn class NeuralNet(nn.Module): def __init__(self, input_size, hidden_size, num_classes): """ NeuralNet.__init__(): input_size: number of patterns (inputs) hidden_size: number of nodes in hidden layer num_classes: numbe...
bmai53/chatbot
bot/nn_model.py
nn_model.py
py
1,016
python
en
code
0
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 5, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
20771139457
from anaconda_navigator.utils.py3compat import request from django.http import HttpResponse from django.shortcuts import render from django.views.decorators.csrf import csrf_exempt from Django_mem.dao_mem import DaoMem def mem(request): dao = DaoMem() list = dao.selectList() return render(reques...
Sun6004/python-pratice
Django_mem/Django_mem/views.py
views.py
py
1,631
python
en
code
1
github-code
21
[ { "api_name": "Django_mem.dao_mem.DaoMem", "line_number": 9, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 11, "usage_type": "call" }, { "api_name": "anaconda_navigator.utils.py3compat.request", "line_number": 11, "usage_type": "argument"...
33044285803
import typing import uuid from typing import Optional from barcode_api.config.database import Base, SequentialIdMixin, CreatedAtUpdatedAtMixin from sqlalchemy import TEXT, ForeignKey, String from sqlalchemy.orm import Mapped, mapped_column, relationship if typing.TYPE_CHECKING: from .image_data import ImageData ...
Mewelopers/barcode-api
barcode_api/models/product.py
product.py
py
2,036
python
en
code
0
github-code
21
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 9, "usage_type": "attribute" }, { "api_name": "barcode_api.config.database.Base", "line_number": 13, "usage_type": "name" }, { "api_name": "barcode_api.config.database.SequentialIdMixin", "line_number": 13, "usage_type"...
34645952237
from __future__ import print_function from collections import deque __author__ = 'inmcm' class SimonCipher(object): """Simon Block Cipher Object""" # Z Arrays (stored bit reversed for easier usage) z0 = 0b01100111000011010100100010111110110011100001101010010001011111 z1 = 0b0101101000011001001111101...
inmcm/Simon_Speck_Ciphers
Python/simonspeckciphers/simon/simon.py
simon.py
py
13,367
python
en
code
92
github-code
21
[ { "api_name": "collections.deque", "line_number": 103, "usage_type": "call" } ]
36756284224
import torch DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu") IMGSIZE = 512 if torch.cuda.is_available() else 128 CNN_NORMALIZATION_MEAN = torch.tensor([0.485, 0.456, 0.406]).to(DEVICE) CNN_NORMALIZATION_STD = torch.tensor([0.229, 0.224, 0.225]).to(DEVICE) CONTENT_LAYERS_DEFAULT = ['conv_4'] STY...
bekhnam/Style-transfer
config.py
config.py
py
391
python
en
code
0
github-code
21
[ { "api_name": "torch.device", "line_number": 3, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 3, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 3, "usage_type": "attribute" }, { "api_name": "torch.cuda.is_avail...
31983495057
import collections import enum from . import paths from . import utility class Event: class Type(enum.Enum): BIRTH = "BIRTH" CREATION = "CREATION" VIRTUAL = "VIRTUAL" DEATH = "DEATH" def adds_agent(self): return self in {self.BIRTH, self.CREATION} def...
smailliwcs/pwscripts
python/polyworld/event.py
event.py
py
1,348
python
en
code
0
github-code
21
[ { "api_name": "enum.Enum", "line_number": 9, "usage_type": "attribute" }, { "api_name": "collections.defaultdict", "line_number": 53, "usage_type": "call" } ]
25289050772
import sys sys.path.append("../../") import gettext import uuid import traceback import appJar #import hs602 # Setup gettext. gettext.install('Hs602util') class Gui(appJar.gui): """Simple HS602 utility using appJar.""" def __init__(self): super().__init__() # Some defaults. # Window ...
jarvisteach/appJar
examples/issues/issue279.py
issue279.py
py
8,127
python
en
code
615
github-code
21
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "gettext.install", "line_number": 10, "usage_type": "call" }, { "api_name": "appJar.gui", "line_nu...
14150847527
import pandas as pd import numpy as np from helper import conversion # single_1 = (conversion(2**1, [1,4,7,10,13])) == (1,) # single_2 = (conversion(2, [1,4,7,10,13])) == (1,) # single_3 = (conversion(2**10, [1,4,7,10,13])) == (10,) # single_4 = (conversion(64, [1,4,6,7,10,13])) == (10,) # # two codings # double_1 = ...
theglobaljukebox/cantometrics
recode.py
recode.py
py
2,219
python
en
code
6
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 23, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 25, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 28, "usage_type": "call" }, { "api_name": "pandas.DataFrame", ...
28433071663
from typing import Dict, Set, Optional from random import shuffle from ._player import Player from .board._board import Board from .board._coords import Coords from ._roll_yield import RollYield from .errors import NotEnoughResourcesError from .board._building_type import BuildingType from ._development_card import De...
josefwaller/PyCatan2
src/pycatan/_game.py
_game.py
py
10,544
python
en
code
16
github-code
21
[ { "api_name": "board._board.Board", "line_number": 29, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 29, "usage_type": "name" }, { "api_name": "board._board", "line_number": 30, "usage_type": "name" }, { "api_name": "_player.Player", ...
18852736279
import json import argparse import os import numpy as np from sklearn.model_selection import train_test_split import pandas as pd def isascii(s): """Check if the characters in string s are in ASCII, U+0-U+7F.""" return len(s) == len(s.encode()) def create_sentences(sentences,key,dict): data = dict[key] ...
mallorbc/GPT_Neo_quotes_dataset
quotes_dataset.py
quotes_dataset.py
py
2,329
python
en
code
27
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path.realpath", "line_number": 31, "usage_type": "call" }, { "api_name": "os.path", "line_number": 31, "usage_type": "attribute" }, { "api_name": "json.load", ...
35593429328
import aiohttp import asyncio import logging import pkg_resources from functools import partial from ..util import obfuscate logger = logging.getLogger(__name__) HEADERS = { 'User-Agent': 'GeoTiler/{}'.format(pkg_resources.get_distribution('geotiler').version), } # client session params PARAMS = { 'headers'...
wrobell/geotiler
geotiler/tile/io.py
io.py
py
2,189
python
en
code
41
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "pkg_resources.get_distribution", "line_number": 12, "usage_type": "call" }, { "api_name": "aiohttp.ClientError", "line_number": 34, "usage_type": "attribute" }, { "api_name...
39648663513
import numpy as np from sklearn import preprocessing import matplotlib.pyplot as plt from collections import defaultdict from scipy.optimize import minimize from sklearn import mixture def load_dataset(filename): """ :param filename: *.dat file :return: numpy matrix samples x features, and string list of m...
BinRoot/Fluent-Extractor
svm_rank_linux64/process_actions_gmm.py
process_actions_gmm.py
py
7,586
python
en
code
6
github-code
21
[ { "api_name": "numpy.asarray", "line_number": 41, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 66, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 84, "usage_type": "call" }, { "api_name": "matplo...
2702767227
#!/usr/bin/env python # # Author: Qiming Sun <osirpt.sun@gmail.com> # ''' Non-relativistic NMR shielding tensor ''' import sys import time from functools import reduce import numpy from pyscf import lib from pyscf.lib import logger from pyscf.lib import parameters as param from pyscf.scf import _vhf from pyscf.scf i...
sunchong137/pyscf_2017
scf/rhf_nmr.py
rhf_nmr.py
py
11,743
python
en
code
1
github-code
21
[ { "api_name": "numpy.arange", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.einsum", "line_number": 49, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 53, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number"...
71259734453
import json import requests import redis import websocket import asyncio import time import datetime async def receive_sepsis(ws_pat): return ws_pat.recv() async def receive_sepses_doc(ws_doc): return ws_doc.recv() async def receive_data_from_start_sepsis(): # ws_pat = websocket.WebSocket() # ws_p...
Chinmay-395/Sepsis-Website
backend/testing_python_script.py
testing_python_script.py
py
1,076
python
en
code
0
github-code
21
[ { "api_name": "websocket.WebSocket", "line_number": 23, "usage_type": "call" }, { "api_name": "asyncio.sleep", "line_number": 26, "usage_type": "call" }, { "api_name": "asyncio.sleep", "line_number": 38, "usage_type": "call" }, { "api_name": "asyncio.get_event_loo...
73004969332
import heapq import itertools import math # 10.1 MERGE SORTED FILES def sort_stocks(dir, result_f): minheap = [] for file in dir: with open(file, "r") as in_file: for line in infile: line = line.split(",") heapq.heappush(minheap, (line[0], line[1:])) with open(result_f, "w") as out_file: while heap:...
angishen/algorithms-datastructures
ch10_heaps.py
ch10_heaps.py
py
5,451
python
en
code
0
github-code
21
[ { "api_name": "heapq.heappush", "line_number": 12, "usage_type": "call" }, { "api_name": "heapq.heappop", "line_number": 16, "usage_type": "call" }, { "api_name": "heapq.heappush", "line_number": 26, "usage_type": "call" }, { "api_name": "heapq.heappop", "line...
41335309732
from datetime import date from django.shortcuts import render, redirect, get_object_or_404 from django.contrib.auth.decorators import login_required from .models import Team, VideoGame, Gamer from .forms import TeamForm, VideogameForm, GamerForm def wikiIndex(request): teams_count = Team.objects.all().count() ...
diegoamorin/vilvox
apps/wiki/views.py
views.py
py
6,086
python
en
code
1
github-code
21
[ { "api_name": "models.Team.objects.all", "line_number": 11, "usage_type": "call" }, { "api_name": "models.Team.objects", "line_number": 11, "usage_type": "attribute" }, { "api_name": "models.Team", "line_number": 11, "usage_type": "name" }, { "api_name": "models.V...
38282711098
''' Desafio 105: Faça um programa que tenha uma função notas() que pode receber várias notas de alunos e vai retornar um dicionário com as seguintes informações: - Quantidade de notas - A maior nota - A menor nota - A média da turma - A situação (opcional) Adicione também as docstrings da função. ''' from statisti...
marcosdemelo00/Python-Exercises-CursoemVideo
World 3 - ex072 to ex115/ex105 - Analisando e gerando dicionarios (Analyzing and generating dictionaries).py
ex105 - Analisando e gerando dicionarios (Analyzing and generating dictionaries).py
py
948
python
pt
code
0
github-code
21
[ { "api_name": "statistics.mean", "line_number": 26, "usage_type": "call" }, { "api_name": "statistics.mean", "line_number": 28, "usage_type": "call" } ]
27952293422
import random from datetime import date from datetime import datetime from time import mktime, gmtime from dateutil.parser import parse as dateutil_parse from dateutil.tz import tzlocal from .base import Generator def to_timestamp(dt): if getattr(dt, 'tzinfo', None) is not None: dt = dt.astimezone(tzloc...
peopledoc/populous
populous/generators/date.py
date.py
py
1,987
python
en
code
8
github-code
21
[ { "api_name": "dateutil.tz.tzlocal", "line_number": 14, "usage_type": "call" }, { "api_name": "time.mktime", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 19, "usage_type": "name" }, { "api_name": "datetime.date", ...
854839274
# -*- coding: utf-8 -*- """ Created on Fri Jan 16 17:10:16 2015 @author: Mathew Topper """ import pyclbr import logging import pkgutil import traceback from importlib import import_module # Set up logging module_logger = logging.getLogger(__name__) class Plugin(object): '''Plugin discovery control classes.'''...
DTOcean/aneris
aneris/utilities/plugins.py
plugins.py
py
4,385
python
en
code
0
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "pkgutil.iter_modules", "line_number": 62, "usage_type": "call" }, { "api_name": "pyclbr.readmodule", "line_number": 79, "usage_type": "call" }, { "api_name": "pyclbr.Class...
36605111600
#!/usr/local/bin/python3 # install: `pip3 install spotipy` import spotipy import json import os from spotipy.oauth2 import SpotifyOAuth CLIENT_ID="" APP_CLIENT_SECRET="" APP_REDIRECT_URI="http://localhost:3000/discography" sp = spotipy.Spotify(auth_manager=SpotifyOAuth(client_id=CLIENT_ID, ...
beabout/claybeabout.com
scripts/spotify.py
spotify.py
py
2,020
python
en
code
0
github-code
21
[ { "api_name": "spotipy.Spotify", "line_number": 14, "usage_type": "call" }, { "api_name": "spotipy.oauth2.SpotifyOAuth", "line_number": 14, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 63, "usage_type": "call" }, { "api_name": "os.system", ...
830898354
import copy import datetime import http import json import os import re from requests.sessions import Session import simplejson import tempfile import threading import time import traceback import urllib from zipfile import ZipFile from flask import Flask from flask import request from flask import send_file from fla...
bilalkamoon/stopmurdoch.com
Backend/backend.py
backend.py
py
32,615
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 38, "usage_type": "call" }, { "api_name": "flask_cors.extension.CORS", "line_number": 39, "usage_type": "call" }, { "api_name": "sqlalchemy.MetaData", "line_number": 41, "usage_type": "call" }, { "api_name": "sqlalchemy....
16998037761
import json from pathlib import Path from pants.testutil.pants_integration_test import run_pants, setup_tmpdir build_root_marker = Path.cwd().joinpath("BUILDROOT") def test_reading_project_version_target() -> None: """Run a full Pants process as it would run on the command line reading a `version_file` targ...
AlexTereshenkov/cheeseshop-query
pants-plugins/internal_plugins/project_version/rules_full_pants_test.py
rules_full_pants_test.py
py
1,056
python
en
code
0
github-code
21
[ { "api_name": "pathlib.Path.cwd", "line_number": 6, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 6, "usage_type": "name" }, { "api_name": "pants.testutil.pants_integration_test.setup_tmpdir", "line_number": 17, "usage_type": "call" }, { "ap...
23097811743
from data_sets.forms_graph_pair import FormsGraphPair from data_sets import forms_graph_pair import math import sys, os from matplotlib import pyplot as plt from matplotlib import gridspec from matplotlib.patches import Polygon import numpy as np import torch,cv2 from utils.util import ensure_dir def write(data,out_di...
herobd/dessurt
data_sets/NAF_extract_lines.py
NAF_extract_lines.py
py
4,650
python
en
code
46
github-code
21
[ { "api_name": "numpy.uint8", "line_number": 18, "usage_type": "attribute" }, { "api_name": "numpy.pi", "line_number": 50, "usage_type": "attribute" }, { "api_name": "numpy.int0", "line_number": 52, "usage_type": "call" }, { "api_name": "numpy.array", "line_num...
35982255467
from functional.chain_of_responsibility.abstract_based_example.team_member import TeamMember class ViceDirector(TeamMember): def process(self, task): if 'meet' in task: if 'president' in task: self.meet_someone_else() return True if 'sign' in task: ...
TheProrok29/design_patterns_in_python
functional/chain_of_responsibility/abstract_based_example/vice_director.py
vice_director.py
py
553
python
en
code
0
github-code
21
[ { "api_name": "functional.chain_of_responsibility.abstract_based_example.team_member.TeamMember", "line_number": 4, "usage_type": "name" } ]
5944125674
import json from typing import Dict from enum import Enum class ComputeNode: def __init__(self, cfg: Dict[str, str]): self.name = cfg["name"] self.ip = cfg["ip"] def __str__(self): return "(name: " + str(self.name) + ", ip: " + str(self.ip) + ")" class ComputeConnection: def __...
kylevedder/DecentralizedComputeGraph
compute_graph.py
compute_graph.py
py
1,873
python
en
code
0
github-code
21
[ { "api_name": "typing.Dict", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 17, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 39, "usage_type": "name" }, { "api_name": "json.load", "line_number": 52,...
36337798057
import requests from lxml import etree # 请求头 headers= { 'User-Agent': '...', 'Cookie': '...', 'Host': 'www.365kk.cc', 'Connection': 'keep-alive' } # 小说主页 main_url = "http://www.365kk.cc/255/255036/" # 使用get方法请求网页 main_resp = requests.get(main_url, headers=headers) # 将网页内容按utf-8规范解码为文本形式 main_text =...
wziqiang/learn_me
a1.py
a1.py
py
1,651
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 17, "usage_type": "call" }, { "api_name": "lxml.etree.HTML", "line_number": 23, "usage_type": "call" }, { "api_name": "lxml.etree", "line_number": 23, "usage_type": "name" }, { "api_name": "requests.get", "line_numb...
31803383416
import re import sys import six from .errors import ExpectedExpr, UnexpectedExpr, SemanticFailure, raise_parsing_error from .position import Position, get_line_at_position from .rules import eof class _ParseBacktrackError(BaseException): pass class _PegState: def __init__(self, position): self.posit...
avakar/speg
speg/peg.py
peg.py
py
5,837
python
en
code
2
github-code
21
[ { "api_name": "errors.raise_parsing_error", "line_number": 44, "usage_type": "call" }, { "api_name": "position.Position", "line_number": 59, "usage_type": "call" }, { "api_name": "rules.eof", "line_number": 65, "usage_type": "name" }, { "api_name": "errors.Expecte...
37855592896
''' DAG for running ETL process Copy data from S3 to Redshift stage Create FACT and DIM tables from stage table Run data quality checks ''' from datetime import datetime, timedelta import logging import os from airflow import DAG from airflow.operators.python_operator import PythonOperator from airflow.operators.post...
aktakukac/DataEngineeringProject5
dags/sparkify_dag.py
sparkify_dag.py
py
5,416
python
en
code
0
github-code
21
[ { "api_name": "datetime.datetime", "line_number": 24, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 25, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 30, "usage_type": "call" }, { "api_name": "logging.info", "...
42095135119
from flask import Flask from flask import request, jsonify import numpy as np from numpy import array from keras.models import Sequential from keras.layers import Dense from keras.layers import Flatten from keras.layers.convolutional import Conv1D from keras.layers.convolutional import MaxPooling1D from keras import b...
javtokas/abc
app.py
app.py
py
2,876
python
en
code
1
github-code
21
[ { "api_name": "flask.Flask", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.quantile", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.quantile", "line_num...
36217934434
# -*- coding: utf-8 -*- """ Created on Mon Jul 31 10:01:17 2017 @author: trandhawa """ import numpy as np import matplotlib.pyplot as plt from processing_fxns import calibration_wave, adjust_load, plot_wave, moving_avg plot_num = 0 w = 60 sig = 1 date_ = '' load_amt = '20lbs' load_case = '90to450_1' file_prefix = '...
kaku3687/torque_sensing_dev
load_wtorque.py
load_wtorque.py
py
3,261
python
en
code
0
github-code
21
[ { "api_name": "numpy.genfromtxt", "line_number": 32, "usage_type": "call" }, { "api_name": "processing_fxns.calibration_wave", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.column_stack", "line_number": 38, "usage_type": "call" }, { "api_name": "...
28064563176
import sys import os library_path = '../libraries' sys.path.append(library_path) import numpy as np import time import math import pyqtgraph as pg from pyqtgraph.Qt import QtCore, QtWidgets from library_qlabs import QuanserInteractiveLabs from library_qlabs_qcar import QLabsQCar from library_qlabs_basic_shape impor...
kjfullert/testing
python/testing/test_qcar_lidar.py
test_qcar_lidar.py
py
2,764
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.system", "line_number": 23, "usage_type": "call" }, { "api_name": "library_qlabs.QuanserInteractiv...
1148113911
#https://school.programmers.co.kr/learn/courses/30/lessons/120871 from collections import defaultdict def solution(n): dic = defaultdict(int) i = 1 idx = 1 while idx <= n: if i % 3 == 0 or '3' in str(i): #3이 포함되있으면 i += 1 else: dic[idx] = i idx += 1 ...
julia0926/TIL_Algo
Study/programmers_입문/저주의숫자3.py
저주의숫자3.py
py
675
python
ko
code
0
github-code
21
[ { "api_name": "collections.defaultdict", "line_number": 5, "usage_type": "call" } ]
32270504693
import time import matplotlib matplotlib.use('agg') import matplotlib.pyplot as plt import seaborn as sns sns.set() from sklearn.metrics import roc_auc_score import keras class callback_ROC(keras.callbacks.Callback): """ Custom callback class for Keras which calculates and plots ROC AUCs after each trainin...
tempse/ALICE_ITSupgrade
macros/ML/neuralNets/modules/keras_callbacks.py
keras_callbacks.py
py
4,613
python
en
code
0
github-code
21
[ { "api_name": "matplotlib.use", "line_number": 4, "usage_type": "call" }, { "api_name": "seaborn.set", "line_number": 7, "usage_type": "call" }, { "api_name": "keras.callbacks", "line_number": 14, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.figur...
7896167218
from .base import * from .config_parse import * from .dbconn import * from .config_log import get_log_class from utils import gol # 初始化全局变量 def set_report_env(termial=False): app_path = os.path.split(os.path.abspath(sys.argv[0]))[0] # 打开日志功能 report_log = get_log_class('report.log') gol.init() # 添加基...
Shadowhello/HMS
utils/envir_report.py
envir_report.py
py
2,070
python
zh
code
1
github-code
21
[ { "api_name": "config_log.get_log_class", "line_number": 11, "usage_type": "call" }, { "api_name": "utils.gol.init", "line_number": 12, "usage_type": "call" }, { "api_name": "utils.gol", "line_number": 12, "usage_type": "name" }, { "api_name": "utils.gol.set_value...
19784907353
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ Parse weather history for Brno (weather, temperature and wind speed) from http://pocasi.divoch.cz/ and save it in json file. """ import os import re import pickle from glob import glob from lxml.html import parse from datetime import datetime, timedelta class Weather...
jhladka/Weather
weather-download.py
weather-download.py
py
3,057
python
en
code
0
github-code
21
[ { "api_name": "lxml.html.parse", "line_number": 42, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 53, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 60, "usage_type": "call" }, { "api_name": "datetime.dateti...
31332620142
import tensorflow as tf import matplotlib.pyplot as plt import numpy as np import os from generators import Generator from discriminators import Discriminator from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("./mnist/data/", one_hot=True) total_epoch = 100 batch_size = 100 ...
fabulousjeong/gan-tensorflow
train.py
train.py
py
2,674
python
en
code
4
github-code
21
[ { "api_name": "tensorflow.examples.tutorials.mnist.input_data.read_data_sets", "line_number": 9, "usage_type": "call" }, { "api_name": "tensorflow.examples.tutorials.mnist.input_data", "line_number": 9, "usage_type": "name" }, { "api_name": "numpy.random.normal", "line_number...
8723272276
""" Unit tests for the DayCountCalculator class in day_count_calculator.py """ from datetime import date from fixedIncome.src.scheduling_tools.day_count_calculator import DayCountCalculator #----------------------------------------------------------------------------------------- start_date, end_date = date(2016, 6, ...
aflapan/fixedIncome
fixedIncome/tests/test_scheduling_tools/test_day_count_calculator.py
test_day_count_calculator.py
py
2,262
python
en
code
1
github-code
21
[ { "api_name": "datetime.date", "line_number": 9, "usage_type": "call" }, { "api_name": "fixedIncome.src.scheduling_tools.day_count_calculator.DayCountCalculator.compute_accrual_length", "line_number": 17, "usage_type": "call" }, { "api_name": "fixedIncome.src.scheduling_tools.day...
9112636235
""" Train a machine learning model for the classifier bot. We create a player, and watch it play games against itself. Every observed state is converted to a feature vector and labeled with the eventual outcome (-1.0: player 2 won, 1.0: player 1 won) This is part of the second worksheet. """ from api import State, uti...
timothyyu/ml_monorepo
schnapsen/train-ml-bot.py
train-ml-bot.py
py
5,154
python
en
code
59
github-code
21
[ { "api_name": "bots.rand.rand.Bot", "line_number": 26, "usage_type": "call" }, { "api_name": "bots.rand.rand", "line_number": 26, "usage_type": "name" }, { "api_name": "time.time", "line_number": 33, "usage_type": "call" }, { "api_name": "sys.stdout.write", "l...
26613577183
import sounddevice as sd from scipy.io.wavfile import write def rec(secs): fs = 44100 #standard frequency for audio secs = int(secs) if secs > 0 : sound_record = sd.rec(int(secs * fs), fs, dtype = 'float64', channels = 2) # this turns our record into a file write('C:/Users/MONOUSO/...
salexandru-123/Simple-Recording-device
main.py
main.py
py
379
python
en
code
1
github-code
21
[ { "api_name": "sounddevice.rec", "line_number": 9, "usage_type": "call" }, { "api_name": "scipy.io.wavfile.write", "line_number": 11, "usage_type": "call" } ]
10569623803
import os import copy import numpy as np import matplotlib.pyplot as plt from JEOL_eds.JEOL_image import JEOL_image from JEOL_eds.JEOL_spectrum import JEOL_spectrum from JEOL_eds.misc import _decode class JEOL_PointLine: """Work with JEOL PointLine data (sequence of individual point spectra) Parameters ...
ialxn/JEOL_eds
JEOL_eds/JEOL_PointLine.py
JEOL_PointLine.py
py
12,473
python
en
code
6
github-code
21
[ { "api_name": "numpy.fromfile", "line_number": 92, "usage_type": "call" }, { "api_name": "JEOL_eds.misc._decode", "line_number": 93, "usage_type": "call" }, { "api_name": "numpy.fromfile", "line_number": 133, "usage_type": "call" }, { "api_name": "JEOL_eds.misc._d...
9244857811
from typing import List class Solution: def subsetXORSum(self, nums: List[int]) -> int: if not nums: return 0 def helper(term, idx): if idx == len(nums): return term return helper(term, idx + 1) + helper(term ^ nums[idx],...
fredzhangziji/Leetcode
Python/Recursion/1863. Sum of All Subset XOR Totals.py
1863. Sum of All Subset XOR Totals.py
py
366
python
en
code
1
github-code
21
[ { "api_name": "typing.List", "line_number": 3, "usage_type": "name" } ]
26682371326
from flask import Flask, make_response, jsonify, request from flask_migrate import Migrate from flask_restful import Api, Resource from models import db, Apartment, Tenant, Lease app = Flask( __name__ ) app.config[ 'SQLALCHEMY_DATABASE_URI' ] = 'sqlite:///apartments.db' app.config[ 'SQLALCHEMY_TRACK_MODIFICATIONS' ] ...
vargasmichael/flask-challenge-apartments
server/app.py
app.py
py
4,820
python
en
code
null
github-code
21
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "flask_migrate.Migrate", "line_number": 12, "usage_type": "call" }, { "api_name": "models.db", "line_number": 12, "usage_type": "argument" }, { "api_name": "models.db.init_app", ...
74947717813
""" 덧셈하여 타겟을 만들 수 있는 배열의 두 숫자 인덱스를 리턴하라. leetcode: https://leetcode.com/problems/two-sum/ 첫번째 수를 뺀 결과 키 조회 """ from typing import List def twoSum(nums: List[int], target: int) -> List[int]: nums_map = {} # 키와 값을 바꿔서 딕셔너리로 저장 for i, num in enumerate(nums): nums_map[num] = i # 타겟에서 첫번째 수를 뺀 ...
zusdn90/Python-Algorithm-Interview
ch07/1-3.py
1-3.py
py
715
python
ko
code
0
github-code
21
[ { "api_name": "typing.List", "line_number": 11, "usage_type": "name" } ]
6953852141
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Sep 22 11:58:04 2020 @author: ombretta """ import torch import h5py import os import pickle as pkl def check_video_availability(video_list, dataset_path): new_list = [] with h5py.File(str(dataset_path), 'r') as f: if "video_ids" in lis...
ombretta/videobagnet
datasets/breakfast.py
breakfast.py
py
3,365
python
en
code
1
github-code
21
[ { "api_name": "h5py.File", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_number": 27, "usage_type": "attribute" }, { "api_name": "torch.load", "line_number":...
9710609790
# -*- coding: utf-8 -*- """ Created on Sun Dec 19 22:55:32 2021 @author: Youngbin Moon (y.moon@unibas.ch) """ import csv import argparse """ Aim: fuse 3 csv files together so that each row is sample name, class name, motif score and # of PAS. (including negative control) """ def write_fused_csv (fused_csv, o_f...
zavolanlab/SCINPAS
src/fuse_numPAS_motifScore_nextflow.py
fuse_numPAS_motifScore_nextflow.py
py
6,867
python
en
code
2
github-code
21
[ { "api_name": "csv.writer", "line_number": 38, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 120, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 144, "usage_type": "call" } ]
40586314117
from flask import Flask, request from flask_migrate import Migrate from flask_sqlalchemy import SQLAlchemy from flask_login import LoginManager from flask_mail import Mail from flask_moment import Moment from flask_bootstrap import Bootstrap from flask_babel import Babel from flask_babel import lazy_gettext as _l imp...
Oskarovsky/repeat
app/__init__.py
__init__.py
py
3,111
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 19, "usage_type": "call" }, { "api_name": "config.Config", "line_number": 21, "usage_type": "argument" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 23, "usage_type": "call" }, { "api_name": "flask_migra...
72851144053
from flask import Flask, url_for, session, request, jsonify, redirect from flask_oauthlib.client import OAuth CLIENT_ID = 'SjHWna6K40tQdqyVAxEDjR5EGpbLM741oOWJRSz0' CLIENT_SECRET = 'n7T1j51NOFn3ARfrsFOnCrblDUBnPz2yIKcQ5VhSMye3W1YK01' app = Flask(__name__) app.debug = True app.secret_key = 'secret' oauth = OAuth(app) ...
basicarrero/appDistr_repo
client.py
client.py
py
2,786
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "flask_oauthlib.client.OAuth", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.session", "line_number": 26, "usage_type": "name" }, { "api_name": "flask.session.po...
10458553701
from __future__ import absolute_import, division, print_function from collections import defaultdict import logging import sqlite3 import pandas as pd from otestpoint.interface.measurementtable_pb2 import MeasurementTable from etceanalytics import utils from etceanalytics.analyzer import Analyzer from etceanalytics.pr...
adjacentlink/python-etce
etceanalyzers/otestpoint.py
otestpoint.py
py
8,988
python
en
code
7
github-code
21
[ { "api_name": "etceanalytics.analyzer.Analyzer", "line_number": 13, "usage_type": "name" }, { "api_name": "collections.defaultdict", "line_number": 36, "usage_type": "call" }, { "api_name": "etceanalytics.utils.concat_sqlite_trial_tables", "line_number": 62, "usage_type":...
36705965086
import pandas as pd import torch from torch.utils.data import Dataset from transformers import AutoTokenizer, AutoConfig class SSTDataset(Dataset): def __init__(self, filename, maxlen, tokenizer): #This is the file where sentences and labels are stored (its a .tsv format file) self.df = pd.read_csv(filename, de...
frozentoad9/SentimentAnalysis
dataset.py
dataset.py
py
1,178
python
en
code
0
github-code
21
[ { "api_name": "torch.utils.data.Dataset", "line_number": 6, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" } ]
20058945641
import os from sklearn.metrics import adjusted_rand_score, adjusted_mutual_info_score import numpy as np from pathlib import Path import matplotlib.pyplot as plt from chain import Chain from extractor import Extractor from grouper import Grouper, KMeansGrouper, SpectralGrouper, COPKMeansGrouper, BirchGrouper, AggloGrou...
Tadlai/auroral-classification
candidates_selection.py
candidates_selection.py
py
6,151
python
en
code
0
github-code
21
[ { "api_name": "path_dataclass.Paths", "line_number": 22, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_nu...
15898435706
import pandas as pd import requests from bs4 import BeautifulSoup import io from PyPDF2 import PdfFileReader import random from win10toast import ToastNotifier from datetime import date import pdf_to_list import athan_class import schedule import time # Global values for the position each item is at in ...
okatoue/BCMA_vic_athan_notifier
files/main.py
main.py
py
3,429
python
en
code
0
github-code
21
[ { "api_name": "datetime.date.today", "line_number": 25, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 25, "usage_type": "name" }, { "api_name": "pdf_to_list.new_times", "line_number": 43, "usage_type": "call" }, { "api_name": "athan_class.A...
31221178730
from unittest import result def to_fahrenheit(temp_in_c): if(type(temp_in_c) == int or type(temp_in_c) == float): result = temp_in_c * 1.8 + 32 return(result) else: return(None) def string_length(string1): if(type(string1) == str): result = 0 for i in string1: ...
c-mahn/hcu-ma-gmt-software-and-interface-technology
exam/exam.py
exam.py
py
894
python
en
code
0
github-code
21
[ { "api_name": "unittest.result", "line_number": 6, "usage_type": "name" }, { "api_name": "unittest.result", "line_number": 7, "usage_type": "name" }, { "api_name": "unittest.result", "line_number": 14, "usage_type": "name" }, { "api_name": "unittest.result", "...
11137046937
""" Script to run the streamlab demo """ from __future__ import annotations import time import mplfinance as mpf import streamlit as st from dotenv import load_dotenv from extract_data_logs import get_combined_data from plot_fixed_rate import calc_fixed_rate, plot_fixed_rate from plot_ohlcv import calc_ohlcv, plot_o...
wakamex/evm_bots
examples/hackweek_demo/run_demo.py
run_demo.py
py
3,578
python
en
code
0
github-code
21
[ { "api_name": "mplfinance.figure", "line_number": 30, "usage_type": "call" }, { "api_name": "dotenv.load_dotenv", "line_number": 38, "usage_type": "call" }, { "api_name": "elfpy.data.postgres.initialize_session", "line_number": 39, "usage_type": "call" }, { "api_n...
855595161
from parsel import Selector import logging try: # Python 3 from urllib.parse import urlparse, urljoin except ImportError: # Python 2 from urlparse import urlparse, urljoin logger = logging.getLogger() class Result(object): """Domain representing a single result""" def __init__(self, url, asset...
fayimora/asset-aggregator
crawler.py
crawler.py
py
6,696
python
en
code
0
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 36, "usage_type": "attribute" }, { "api_name": "parsel.Selector", "line_number": 105, "usage_type": "call" }, { "api_name": "urlparse.urlpars...
4643107264
import torch import torch.nn.functional as F import torch.nn as nn from bert4torch.layers import LayerNorm from bert4torch.models import build_transformer_model, BaseModel from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence # 模型参数:训练 epochs = 20 # 训练轮数 steps_per_epoch = None # 每轮步数 maxlen = 2...
nonames819/NER-Affection
NER&Affection/baidu_ner/model.py
model.py
py
7,132
python
en
code
0
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 47, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 47, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 53, "usage_type": "call" }, { "api_name": "torch.nn", "lin...
42758854959
import torch from torch import nn from torch import optim from torch.autograd import Variable from torchvision import datasets, transforms, models from collections import OrderedDict import utility from PIL import Image def get_dataloders(data_dir, use_gpu, num_workers, pin_memory): ''' Return dataloaders for tra...
craig-martinson/aipnd-project
model_helper.py
model_helper.py
py
11,687
python
en
code
1
github-code
21
[ { "api_name": "torchvision.transforms.Compose", "line_number": 22, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 22, "usage_type": "name" }, { "api_name": "torchvision.transforms.RandomRotation", "line_number": 22, "usage_type": "call" }...
31625017670
#!/usr/bin/python import requests import sys import argparse from xml.etree import ElementTree parser = argparse.ArgumentParser(description="Retrieve train details from Irish Rail realtime API.") parser.add_argument('dept_station', metavar='<dept station>', type=str, help="the departure station.") parser.add_argumen...
maallen/irishrail
irishrail.py
irishrail.py
py
1,661
python
en
code
2
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 28, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree.fromstring", "line_number": 30, "usage_type": "call" }, { "api_name": "...
21050689543
from django.urls import path from apps.order.views import * urlpatterns = [ path('place_order/', PlaceOrderView.as_view(), name='place_order'), path('order_commit/', OrderCommitView.as_view(), name='order_commit'), path('order_pay/', OrderPayView.as_view(), name='order_pay'), path('order_check/', Order...
yhhuang1996/Django-B2C-Project
ttsx/apps/order/urls.py
urls.py
py
438
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", ...
36691769863
import PySimpleGUI as sg from trader import Trader from get_transcription import get_transcription layout_search_by_id = [ # Отрисовка для поиска звонка по ИД [sg.Text('DIALOG ID'), sg.InputText(key='-dialog_id-'), sg.Submit(button_text='Найти'), sg.Submit(button_text='Очистить'), sg.Text('MODE: '), sg.Submi...
Melikhov-p/DEUS_IVR
main.py
main.py
py
3,066
python
en
code
0
github-code
21
[ { "api_name": "PySimpleGUI.Text", "line_number": 6, "usage_type": "call" }, { "api_name": "PySimpleGUI.InputText", "line_number": 6, "usage_type": "call" }, { "api_name": "PySimpleGUI.Submit", "line_number": 7, "usage_type": "call" }, { "api_name": "PySimpleGUI.Te...
18066301241
from loader import build_loader from model import build_model from trainer import build_trainer from inference import build_inference, Inference_COCO from utils import ensure_dir import logging, coloredlogs import argparse import yaml import os import torch import random import json from os import listdir from os.path ...
UCSB-NLP-Chang/Diffusion-SpaceTime-Attn
layout_predictor/LayoutTransformer/vis.py
vis.py
py
8,304
python
en
code
69
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 19, "usage_type": "call" }, { "api_name": "yaml.safe_load", "line_number": 33, "usage_type": "call" }, { "api_name": "yaml.safe_load", "line_number": 35, "usage_type": "call" }, { "api_name": "utils.ensure_di...
33597933526
from django.shortcuts import render, redirect from django.views import View from .models import Coupon from .forms import CouponApplyForm # Create your views here. from django.utils import timezone from django.contrib import messages from django.utils.decorators import method_decorator from django.views.decorators.csrf...
bakhshb/myshop
coupons/views.py
views.py
py
1,261
python
en
code
0
github-code
21
[ { "api_name": "django.views.View", "line_number": 14, "usage_type": "name" }, { "api_name": "django.utils.timezone.now", "line_number": 16, "usage_type": "call" }, { "api_name": "django.utils.timezone", "line_number": 16, "usage_type": "name" }, { "api_name": "for...
30981045122
import requests import hashlib import random import time import socket import threading import pwdc user_num_low = 111111111 user_num_max = 9999999999 user_nbr = user_num_low mutex=threading.Lock() def get_user_nbr():#构造用户邮箱 mutex.acquire(3) global user_nbr user_name = '%s%s' % (str(use...
HuazhangHu/Crack-verification-code
暴力破解密码.py
暴力破解密码.py
py
4,977
python
en
code
7
github-code
21
[ { "api_name": "threading.Lock", "line_number": 13, "usage_type": "call" }, { "api_name": "hashlib.md5", "line_number": 59, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 68, "usage_type": "call" }, { "api_name": "requests.adapters", "lin...
18363045901
from datetime import date, datetime, time from decimal import Decimal import uuid import warnings import ctds from .base import TestExternalDatabase from .compat import PY27, PY3, unichr_, unicode_ class TestCursorCallproc(TestExternalDatabase): # pylint: disable=too-many-public-methods '''Unit tests related to ...
zillow/ctds
tests/test_cursor_callproc.py
test_cursor_callproc.py
py
62,228
python
en
code
81
github-code
21
[ { "api_name": "base.TestExternalDatabase", "line_number": 11, "usage_type": "name" }, { "api_name": "ctds.Cursor", "line_number": 17, "usage_type": "attribute" }, { "api_name": "ctds.InterfaceError", "line_number": 54, "usage_type": "attribute" }, { "api_name": "c...
7896412009
import torch import torch.nn as nn import torch.nn.functional as F from modules.conv import Initialized_Conv1d, RegularConv from modules.helpers import mask_logits, apply_mask import math # bangliu class MultiHeadAttnBL(nn.Module): def __init__(self, d_model, heads, droprate): super().__init__() ...
maxtrem/qanet
modules/attn.py
attn.py
py
6,874
python
en
code
0
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 13, "usage_type": "name" }, { "api_name": "modules.conv.Initialized_Conv1d", "line_number": 19, "usage_type": "call" }, { "api_name": "modules...
39121934693
######################################################################### #$Id: $ #$Revision: $ #$HeadURL: $ #$Date: $ #$Author: $ ######################################################################### from __future__ import print_function from netCDF4 import Dataset import numpy as np import sys import getopt impo...
weihuang-jedi/jedi-tools
perfplot/diff2ncfile.py
diff2ncfile.py
py
4,273
python
en
code
0
github-code
21
[ { "api_name": "sys.exit", "line_number": 28, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 69, "usage_type": "call" }, { "api_name": "os.path", "line_number": 69, ...
35164430817
from django.contrib import admin from django.urls import path,include from django.conf.urls import handler404 urlpatterns = [ path('admin/', admin.site.urls), path('',include('apps.accounts.urls.urls')), path('configuration/',include('apps.configuration.urls.urls')), path('process/',include('ap...
zhangbin804/devops
devops/urls.py
urls.py
py
538
python
en
code
1
github-code
21
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 6, "usage_type": "name" }, { "api_name": "dja...
71070280054
#%% -------------PART 1. DATA PREPARATION------------ path = "C:\\Users\\hung\\Desktop\\MachineLearning\\" import os os.chdir(path) # 1. Hypothesis Generation from IPython.display import display, Image display(Image(filename= 'BigMartSales Prediction\\Description.png')) import pandas as pd import numpy as np import m...
Kientv84/MarchineLearning
BigMartSale.py
BigMartSale.py
py
18,911
python
en
code
0
github-code
21
[ { "api_name": "os.chdir", "line_number": 5, "usage_type": "call" }, { "api_name": "IPython.display.display", "line_number": 8, "usage_type": "call" }, { "api_name": "IPython.display.Image", "line_number": 8, "usage_type": "call" }, { "api_name": "warnings.filterwa...
27723600298
from matplotlib import pyplot as plt from matplotlib import animation from matplotlib.font_manager import FontProperties from matplotlib import gridspec import numpy as np import time import sys """ author: Kyle """ # update point: function handling the logic of animating the dot, denoting the current # position of the...
tsangkai/multirobot_localization_utias
src/data_analysis/realtime_plot.py
realtime_plot.py
py
9,813
python
en
code
4
github-code
21
[ { "api_name": "matplotlib.pyplot.scatter", "line_number": 54, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 54, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 188, "usage_type": "call" }, { "api_name": ...
41703067703
from aiohttp import web from constants import webserver_port from discord.ext import commands, tasks import aiohttp from log import logger from cleaner import header app = web.Application() routes = web.RouteTableDef() class Webserver(commands.Cog): def __init__(self, bot): self.bot = bot self.webs...
HoshikawaBot/CleanerBot
src/server.py
server.py
py
2,050
python
en
code
0
github-code
21
[ { "api_name": "aiohttp.web.Application", "line_number": 8, "usage_type": "call" }, { "api_name": "aiohttp.web", "line_number": 8, "usage_type": "name" }, { "api_name": "aiohttp.web.RouteTableDef", "line_number": 9, "usage_type": "call" }, { "api_name": "aiohttp.we...
26036260313
import pyttsx3 import speech_recognition as sr import datetime engine = pyttsx3.init('sapi5') voices = engine.getProperty('voices') engine.setProperty('voice', voices[0].id) def speak(audio): engine.say(audio) engine.runAndWait() def listen(): r=sr.Recognizer() with sr.Microphone() as source: ...
akshanshkmr/jarvis-voice-assistant
code.py
code.py
py
1,245
python
en
code
3
github-code
21
[ { "api_name": "pyttsx3.init", "line_number": 5, "usage_type": "call" }, { "api_name": "speech_recognition.Recognizer", "line_number": 14, "usage_type": "call" }, { "api_name": "speech_recognition.Microphone", "line_number": 15, "usage_type": "call" }, { "api_name"...
27411549624
''' import_drug_orders.py ''' import logging from sqlalchemy.dialects.postgresql import insert ''' ImportDrugOrders ''' class ImportDrugOrders: def __init__(self, con, meta): ## database connection self.con = con ## table structure self.meta = meta def get_order_fields(self,...
MarcPfeif/pharma-recommendation
pharma/import_drug_orders.py
import_drug_orders.py
py
3,390
python
en
code
0
github-code
21
[ { "api_name": "logging.info", "line_number": 87, "usage_type": "call" }, { "api_name": "sqlalchemy.dialects.postgresql.insert", "line_number": 92, "usage_type": "call" } ]
42344912383
from datetime import timedelta, datetime import logging from core.observables import Url from core.feed import Feed from core.errors import ObservableValidationError class VXVaultUrl(Feed): # set default values for feed default_values = { "frequency": timedelta(hours=1), "name": "VXVaultUrl",...
yeti-platform/yeti
plugins/feeds/public/vxvault_url.py
vxvault_url.py
py
1,429
python
en
code
1,485
github-code
21
[ { "api_name": "core.feed.Feed", "line_number": 9, "usage_type": "name" }, { "api_name": "datetime.timedelta", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetime.utcnow", "line_number": 30, "usage_type": "call" }, { "api_name": "datetime.da...
75054629173
# First exercise in the "graphic" section of the book # Objective: drawing one of every graphic primitive # This will display a 200x600 image in the screen # populated with several simple shapes import sys from PIL import Image,ImageDraw # COLORS white = (255,255,255) black = (0,0,0) # HELPER FUNCTIONS def drawdot(...
jolitti/code_as_creative_medium
exercises/graphic/one_with_everything.py
one_with_everything.py
py
1,339
python
en
code
0
github-code
21
[ { "api_name": "PIL.Image.new", "line_number": 18, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 18, "usage_type": "name" }, { "api_name": "PIL.ImageDraw.Draw", "line_number": 19, "usage_type": "call" }, { "api_name": "PIL.ImageDraw", "line_...
22089322750
import scvelo as scv import joblib from cellrank.tl.kernels import ConnectivityKernel from cellrank.tl.estimators import GPCCA import numpy as np import pandas as pd adata = scv.read( "/storage/singlecell/zz4/fetal_snakemake/results/merged_h5ad/merged_raw_filtered_umap_10000_woadult_MG_ldata_dynamics.h5ad", ca...
zhenzuo2/Human-Developmental-Retina-Atlas
Volocity/infer_fate/infer_fate.py
infer_fate.py
py
1,300
python
en
code
3
github-code
21
[ { "api_name": "scvelo.read", "line_number": 8, "usage_type": "call" }, { "api_name": "joblib.load", "line_number": 13, "usage_type": "call" }, { "api_name": "cellrank.tl.kernels.ConnectivityKernel", "line_number": 16, "usage_type": "call" }, { "api_name": "cellran...
20594548849
import torch from models.base import BaseModel from models.nn.layers import AttLayer, clones class NRHATitle(BaseModel): def __init__(self, hparams): super().__init__(hparams) self.attentions = clones(AttLayer(hparams.head_dim, hparams.attention_hidden_dim), hparams.head_num) def sentence_en...
Ruixinhua/NRHA
models/nrha_title.py
nrha_title.py
py
1,293
python
en
code
0
github-code
21
[ { "api_name": "models.base.BaseModel", "line_number": 6, "usage_type": "name" }, { "api_name": "models.nn.layers.clones", "line_number": 10, "usage_type": "call" }, { "api_name": "models.nn.layers.AttLayer", "line_number": 10, "usage_type": "call" }, { "api_name":...
26279525085
from os.path import basename from qair.data.example import Example from qair.data.utils import create_path import pickle class QAdataset: def __init__(self, ifile, fold=0, train=True): self.reader = ifile self.dataset = ifile.split('/')[-2] self.qids = list(pickle.load(open(f'data/info/{se...
dbonadiman/qa-ir
qair/data/dataset.py
dataset.py
py
2,852
python
en
code
1
github-code
21
[ { "api_name": "pickle.load", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.basename", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.basename", "line_number": 13, "usage_type": "call" }, { "api_name": "pickle.load", "line...
13415732575
from dataclasses import dataclass from datetime import datetime, timezone from dataclass_csv import accept_whitespaces, dateformat from sqlalchemy import Column, DateTime, Float, ForeignKey, Integer, String from sqlalchemy.ext.hybrid import hybrid_property from sqlalchemy.orm import relationship import vigorish.datab...
a-luna/vigorish
src/vigorish/models/pitchfx.py
pitchfx.py
py
17,765
python
en
code
2
github-code
21
[ { "api_name": "vigorish.database.Base", "line_number": 14, "usage_type": "attribute" }, { "api_name": "vigorish.database", "line_number": 14, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 17, "usage_type": "call" }, { "api_name": "sqlal...
40606620927
'''Receives raw xml data from climax devices and transforms into readable data for our system''' import html import logging import asyncio import slixmpp import xmltodict RECEIVER_JID = 'receive@inteli-xmpp' RECEIVER_PASS = 'receive' SEND_TO_JID = ['mike@inteli-xmpp', 'test@inteli-xmpp', 'translate@inteli-xmpp', 'guy...
Lucho-git/run-slixmpp
climax_transformer.py
climax_transformer.py
py
7,181
python
en
code
0
github-code
21
[ { "api_name": "slixmpp.ClientXMPP", "line_number": 15, "usage_type": "attribute" }, { "api_name": "slixmpp.ClientXMPP.__init__", "line_number": 18, "usage_type": "call" }, { "api_name": "slixmpp.ClientXMPP", "line_number": 18, "usage_type": "attribute" }, { "api_n...
9553234028
import numpy as np import torch import torch.nn as nn import torch.optim as optim import argparse from utils import * import torch.nn.functional as F from torch.utils.data import TensorDataset, DataLoader from torch.distributions.multivariate_normal import MultivariateNormal class MDN(nn.Module): def __init__(sel...
USC-Lira/CSCI699_RobotLearning_HW3
train_ildist.py
train_ildist.py
py
4,043
python
en
code
0
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 12, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 12, "usage_type": "name" }, { "api_name": "torch.load", "line_number": 49, "usage_type": "call" }, { "api_name": "torch.optim.Adam", "line...
6697191262
# Python3 import urllib.request, urllib.error, urllib.parse, os, tempfile import numpy as np import tensorflow as tf from scipy.misc import imread, imresize """ Utility functions used for viewing and processing images. """ def blur_image(X): """ A very gentle image blurring operation, to be used as a regulari...
zhangguobin/fast-neural-style
utils/image_utils.py
image_utils.py
py
2,966
python
en
code
0
github-code
21
[ { "api_name": "numpy.zeros", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number...
12193009210
import pickle import datetime from rankfm.rankfm import RankFM def train_rankfm_model(interactions_train, item_features_train, sample_weight_train): rank_fm = RankFM( factors=100, loss="warp", max_samples=100, alpha=0.05, sigma=0.1, learning_rate=0.1, learni...
maxgalanov/RecSysYearProject
hse_rec_sys/src/models/train_model.py
train_model.py
py
752
python
en
code
3
github-code
21
[ { "api_name": "rankfm.rankfm.RankFM", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 25, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 25, "usage_type": "attribute" }, { "api_name": "pick...
2172097381
#!/usr/bin/python3 """ script that creates a Flask web application with the specified routes """ from flask import Flask, escape app = Flask(__name__) # Route to display "Hello HBNB!" @app.route('/', strict_slashes=False) def hello_hbnb(): return 'Hello HBNB!' # Route to display "HBNB" @app.route('/hbnb', str...
254guru/AirBnB_clone_v2
web_flask/3-python_route.py
3-python_route.py
py
1,050
python
en
code
null
github-code
21
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.escape", "line_number": 27, "usage_type": "call" }, { "api_name": "flask.escape", "line_number": 35, "usage_type": "call" } ]
40832075291
import pandas as pd import numpy as np import random from colorama import Fore class Impute: def remove_outliers(self,dataframe,features): ''' Input: pd.DataFrame(), features = pd.Series() => List, String Output: pd.DataFrame() Params: pd.DataFrame(), features = pd.Series() that ...
TusharNautiyal-web/DataWrang-Library
datawrang/imputers.py
imputers.py
py
18,128
python
en
code
1
github-code
21
[ { "api_name": "colorama.Fore.RED", "line_number": 36, "usage_type": "attribute" }, { "api_name": "colorama.Fore", "line_number": 36, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 47, "usage_type": "call" }, { "api_name": "pandas.DataFrame", ...
36120876631
import tensorflow as tf from datasetHelper import loadDataset, getNextBatch from modelHelper import weight_variable, bias_variable from sklearn.utils import shuffle tf.compat.v1.disable_eager_execution() #defining the dimensions of the dataset images #MNIST dataset are 28X28 img_h, img_w = 28, 28 #defining total numb...
komekez/linear-classifier-mnist
main.py
main.py
py
3,805
python
en
code
1
github-code
21
[ { "api_name": "tensorflow.compat.v1.disable_eager_execution", "line_number": 6, "usage_type": "call" }, { "api_name": "tensorflow.compat", "line_number": 6, "usage_type": "attribute" }, { "api_name": "datasetHelper.loadDataset", "line_number": 22, "usage_type": "call" }...
13777849444
import os import sys import time import cv2 import numpy as np import pytesseract from PIL import Image import re import traceback # Add parent directory to sys.path so that we can import modules from there # Get the current working directory current_script_path= os.path.abspath(__file__) script_dir = os.path.dirname...
aaljalali/MDE_BDE_RING
MDE/windows/MDE/MDE/DataGeneration/img_process.py
img_process.py
py
8,022
python
en
code
0
github-code
21
[ { "api_name": "os.path.abspath", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_numb...
18239378611
from collections import deque n = 8 a = [list(input()) for _ in range(n)] check = [[[False] * (n + 1) for _ in range(n)] for _ in range(n)] dx = [0, 0, 1, -1, 1, 1, -1, -1, 0] dy = [1, -1, 0, 0, -1, 1, -1, 1, 0] check[7][0][0] = True q = deque() q.append((7, 0, 0)) ans = False while q: x, y, t = q.popleft() ...
yeonnseok/ps-algorithm
2019 baekjoon/Graph/16954_movingWall.py
16954_movingWall.py
py
845
python
en
code
1
github-code
21
[ { "api_name": "collections.deque", "line_number": 11, "usage_type": "call" } ]
12928368957
from builtins import str from builtins import object import logging import os import subprocess import tempfile class Process(object): ''' Define a process to execute ''' def __init__(self, name, exe, args, desc=None, proc_type=None, expand=True, bank_env=None, log_dir=None): ''' Defin...
Nurtal/TRASHEXCHANGE
biomaj-master/biomaj/process/process.py
process.py
py
8,316
python
en
code
0
github-code
21
[ { "api_name": "builtins.object", "line_number": 8, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 51, "usage_type": "call" }, { "api_name": "os.path", "line_number": 51, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_num...
72535224694
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This is a python install script written for pyIMU python package. # pip3 install --upgrade setuptools wheel Cython build # # py -3 setup.py build_ext --inplace # py -3 setup.py bdist # py -3 setup.py sdist # py -3 setup.py bdist_wheel # pip3 install -e . # -e ...
uutzinger/pyIMU
setup.py
setup.py
py
2,122
python
en
code
1
github-code
21
[ { "api_name": "os.path.abspath", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 19, "usage_type": "call" }, { "api_name": "io.open", "line_numb...
34018275795
import argparse import collections import json import utils import openreview_db as ordb from tqdm import tqdm parser = argparse.ArgumentParser( description='Create datasets for training baseline models') parser.add_argument('-d', '--dbfile', default="../db/or.db", type=str, help="Database in sqlite...
nnkennard/iclr-discourse-dataset
baselines/old/create_datasets.py
create_datasets.py
py
2,409
python
en
code
4
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "openreview_db.crunch_text_rows", "line_number": 33, "usage_type": "call" }, { "api_name": "utils.DiscourseUnit", "line_number": 34, "usage_type": "attribute" }, { "a...
70882971894
import json import os import re from glob import glob from mobie import initialize_dataset, add_image_data, add_segmentation from mobie.metadata import add_remote_project_metadata ROOT = "/g/schwab/Kimberly/Publications/MoBIE_paper/Jonas_project/raw/idr_0079" MODALITIES = {"experimentA": "membrane", "ex...
mobie/zebrafish-lm-project
create_project.py
create_project.py
py
6,759
python
en
code
0
github-code
21
[ { "api_name": "re.compile", "line_number": 24, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 38, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 38, "usage_type": "call" }, { "api_name": "os.path", "line_number": 38, ...
21666669958
import logging import sys # Uncomment to see debug logs logging.basicConfig(level=logging.INFO, format='%(asctime)s %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p') # logging.getLogger().addHandler(logging.StreamHandler(stream=sys.stdout)) from langchain.text_splitter import RecursiveCharacterTextSplitter from langchain...
gjmulder/urag
langchain_textsplit.py
langchain_textsplit.py
py
2,690
python
en
code
0
github-code
21
[ { "api_name": "logging.basicConfig", "line_number": 5, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 5, "usage_type": "attribute" }, { "api_name": "langchain.callbacks.manager.CallbackManager", "line_number": 16, "usage_type": "call" }, { "a...
3488916941
from functools import wraps from collections import namedtuple def simple_coroutine(): ''' 最简单的协程例子 ''' print("-> 开始协程") x = yield print("收到了协程信号", x) def simple_coro2(a): ''' 产生两个值的协程 ''' print("-> started: a = ", a) b = yield a print("-> received b = ", b) c = y...
Ehco1996/Fluent-Python
第十六章协程/coroutine.py
coroutine.py
py
1,282
python
en
code
30
github-code
21
[ { "api_name": "functools.wraps", "line_number": 30, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 53, "usage_type": "call" } ]
36270927434
from PIL import Image import os mypath0 = os.getcwd() f = [] for (dirpath, dirnames0, filenames0) in os.walk(mypath0): f.extend(filenames0) break #print(dirnames0) imagelist = [] for m in dirnames0: mypath1 = mypath0 + '\\' + m for (dirpath1, dirnames1, filenames1) in os.walk(mypath1): f.extend...
Tafkal/MangaImagestoPDF
Img_to_PDF.py
Img_to_PDF.py
py
978
python
en
code
0
github-code
21
[ { "api_name": "os.getcwd", "line_number": 4, "usage_type": "call" }, { "api_name": "os.walk", "line_number": 6, "usage_type": "call" }, { "api_name": "os.walk", "line_number": 13, "usage_type": "call" }, { "api_name": "os.walk", "line_number": 19, "usage_t...
13751016865
import os from datetime import datetime, time from influxdb_client import InfluxDBClient, Point from dwd_import.models import Device, MoistureMeasurement from . import DeviceDB, MoistureDB class InfluxDB(DeviceDB, MoistureDB): def __init__(self) -> None: super().__init__() self.bucket = os.envir...
codeforbielefeld/teuto-moisture-map-python
services/dwd-import/dwd_import/db/influx.py
influx.py
py
1,674
python
en
code
0
github-code
21
[ { "api_name": "os.environ.get", "line_number": 13, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 13, "usage_type": "attribute" }, { "api_name": "influxdb_client.InfluxDBClient.from_env_properties", "line_number": 16, "usage_type": "call" }, { ...