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
33901949330
import torch import torch.nn as nn import torch.optim as optim from torch.utils.data import DataLoader from models import Seq2Seq from train_test import train, test from dataloader import load_data, collate_train, collate_test, transform_letter_to_index, Speech2TextDataset DEVICE = 'cuda' if torch.cuda.is_available()...
Stevenhyh1/Introduction-to-deep-learning
Recitation/recitation10/main.py
main.py
py
1,667
python
en
code
2
github-code
2
[ { "api_name": "torch.cuda.is_available", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 10, "usage_type": "attribute" }, { "api_name": "models.Seq2Seq", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.optim.Ad...
71803002631
import numpy as np from scipy import ndimage from libtiff import TIFF, TIFFfile, TIFFimage from itertools import zip_longest def grouper(iterable, n, fillvalue=None): "Collect data into fixed-length chunks or blocks" # grouper('ABCDEFG', 3, 'x') --> ABC DEF Gxx" args = [iter(iterable)] * n ret...
tbutyl/In-Vivo-Retinal-Imaging
time_filter/timeFilterSelective_MAC_alt.py
timeFilterSelective_MAC_alt.py
py
2,678
python
en
code
0
github-code
27
[ { "api_name": "itertools.zip_longest", "line_number": 10, "usage_type": "call" }, { "api_name": "libtiff.TIFFfile", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.average", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.std", ...
73143113325
import tensorflow as tf from utils.word2vec_dataload import Vocab from utils.config import * def article_to_ids(article_words, vocab): ids = [] oovs = [] unk_id = vocab.word_to_id(Vocab.UNKNOWN_TOKEN) for w in article_words: i = vocab.word_to_id(w) if i == unk_id: # If w is OOV ...
chargerKong/Text-summary-and-reasoning
seq2seq/batcher.py
batcher.py
py
12,606
python
en
code
6
github-code
2
[ { "api_name": "utils.word2vec_dataload.Vocab.UNKNOWN_TOKEN", "line_number": 8, "usage_type": "attribute" }, { "api_name": "utils.word2vec_dataload.Vocab", "line_number": 8, "usage_type": "name" }, { "api_name": "utils.word2vec_dataload.Vocab.UNKNOWN_TOKEN", "line_number": 23,...
24590441607
from datetime import datetime from typing import Any, Dict, Optional, Type from django import http from django.db import models from django.db.models.query import QuerySet from django.forms.models import BaseModelForm from django.shortcuts import render from django.views import View from .models import MaintainanceReco...
fengxue8076828/equipment_manager
maintainance/views.py
views.py
py
11,646
python
en
code
0
github-code
2
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 24, "usage_type": "call" }, { "api_name": "django.views.View", "line_number": 27, "usage_type": "name" }, { "api_name": "django.views.generic.ListView", "line_number": 35, "usage_type": "attribute" }, ...
3733507870
import requests from acesso_cep import BuscaEndereco cep = '08280160' objeto_cep = BuscaEndereco(cep) bairro, cidade, uf = objeto_cep.acessa_via_cep() r = requests.get('https://viacep.com.br/ws/08280160/json/') print(r.text) print(bairro) print(cidade) print(uf)
VitorSirotenco/validacaobr
main.py
main.py
py
305
python
pt
code
1
github-code
2
[ { "api_name": "acesso_cep.BuscaEndereco", "line_number": 7, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 10, "usage_type": "call" } ]
41428553345
import pymysql import requests from time import sleep from random import randint from resources.Setting import * from resources.Pretty import Pretty class GanggutongSpider: def __init__(self) -> None: self.bankuai = "港股通" self.tablename = self.bankuai + nowtime self.link = "https://vip.stoc...
YEUNGWAIPANG/My-Python-Spider
Xinlangcaijing/Xinlangcaijing_docker/Xinlangcaijing/Spiders/GanggutongSpider.py
GanggutongSpider.py
py
4,000
python
en
code
0
github-code
27
[ { "api_name": "resources.Pretty.Pretty", "line_number": 16, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 27, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 55, "usage_type": "call" }, { "api_name": "random.randint", ...
9763180616
import numpy as np import open3d as o3d import os import urllib.request import gzip import tarfile import shutil import time import pdb from scipy.spatial.transform import Rotation as Rot def create_plane(center, normal, plane_size, axis_size = 0.03): mesh = o3d.TriangleMesh() quat = np.r_[normal,0] e = ...
yuki-inaho/ransac-plane-fitting-and-visualization-with-o3d
main.py
main.py
py
4,490
python
en
code
0
github-code
2
[ { "api_name": "open3d.TriangleMesh", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.r_", "line_number": 14, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.cross", "line...
14228376322
#!/usr/bin/env python3 from setuptools import setup, Extension long_description='''\ MiniGraph is a simple, reasonably fast module for graph structures. It is not very featureful, but easy to use for the common cases.''' setup( name='MiniGraph', version='0.1', description='A small Python module for worki...
goodmami/minigraph
setup.py
setup.py
py
1,403
python
en
code
1
github-code
27
[ { "api_name": "setuptools.setup", "line_number": 9, "usage_type": "call" }, { "api_name": "setuptools.Extension", "line_number": 37, "usage_type": "call" } ]
15008616055
from django.urls import path, include from .views import * # not for prod. urlpatterns = [ path("", home_page, name='home'), path('contact/', contact), path('visa/e-visa/', e_visa, name='e_visa'), path('visa/e-visa/order/', e_visa_order, name='e_visa_order'), path('about/who-we-are/', who_we_are,...
KamilRAliyev/geo-travel-source
geotravel_app/urls.py
urls.py
py
673
python
en
code
1
github-code
2
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" }, { "api_name": "django.urls.path", ...
4880166014
# aliyun from urllib.parse import urlparse import datetime import base64 import hmac import hashlib import json import urllib.request import time import numpy as np import matplotlib.pyplot as plt from PIL import Image from io import BytesIO ak_id = '<your server id>' ak_secret = '<your server secret>' def get_curr...
jylink/BMI-FGSM
aliyun.py
aliyun.py
py
2,937
python
en
code
2
github-code
2
[ { "api_name": "datetime.datetime.strftime", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 21, "usage_type": "attribute" }, { "api_name": "datetime.datetime.utcnow", "line_number": 21, "usage_type": "call" }, { "api_na...
28105868437
""" @author: Ema & Sofia """ import numpy as np import tensorflow as tf import keras from keras.models import Sequential, Model from keras.layers import Dense, Concatenate, Input from keras import initializers class Actor: def __init__(self, state_size, action_size, seed, fc_units=256): model = Seque...
EmaPajic/RL_walking
model.py
model.py
py
2,033
python
en
code
0
github-code
27
[ { "api_name": "keras.models.Sequential", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 16, "usage_type": "call" }, { "api_name": "keras.layers.Dense", "line_number": 17, "usage_type": "call" }, { "api_name": "keras.initializ...
20426534443
import serial, time, io, datetime import serial.tools.list_ports import warnings from oxvent import OxVentLogger from kbthread import KeyboardThread from bronk import Bronk millis = lambda: int(round(time.time() * 1000)) #test params sample_length_millis = 2000 init_flow = 100 final_flow = 650 diff_flow = 50 ...
tomfrankkirk/oxvent_dvt
ingest/ingest_gauge.py
ingest_gauge.py
py
1,703
python
en
code
0
github-code
27
[ { "api_name": "time.time", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 35, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 35, "usage_type": "attribute" }, { "api_name": "serial.tools.l...
39327181586
# pacman imports from pacman.model.routing_tables.multicast_routing_table import \ MulticastRoutingTable from pacman.model.routing_tables.multicast_routing_tables import \ MulticastRoutingTables from pacman import exceptions # spinnMachine imports from spinn_machine.multicast_routing_entry import MulticastRou...
Erzcoder/Spiking-Neural-Networks-on-Robotino
src/spinnaker_nn/venv/lib/python2.7/site-packages/pacman/operations/router_compressors/mundys_router_compressor/routing_table_condenser.py
routing_table_condenser.py
py
4,637
python
en
code
3
github-code
2
[ { "api_name": "logging.getLogger", "line_number": 22, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 32, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 33, "usage_type": "call" }, { "api_name": "pacma...
38414456846
from uuid import uuid4 def create_db(list_data, post_data, db): collection = db['crud_collect'] added_dict_id = {'_id': uuid4().hex} added_dict_id.update(post_data) if len(list_data) > 1: if list_data['role'] == 'admin': try: collection.create_index('email', unique=...
YSKUMAR775/CRUD_MongoDB
package_data/create.py
create.py
py
698
python
en
code
0
github-code
27
[ { "api_name": "uuid.uuid4", "line_number": 6, "usage_type": "call" } ]
2343267447
import light_version_abuse_packet as abusePack from light_version_abuse_packet.metamask import Metamask from light_version_abuse_packet.adspower_driver import Driver from light_version_abuse_packet.adspowered import AdsPower from selenium.webdriver.common.by import By import time import utils import random class Abu...
Xaint00ship/AZTEC
script.py
script.py
py
5,753
python
en
code
0
github-code
2
[ { "api_name": "light_version_abuse_packet.adspower_driver.Driver", "line_number": 14, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 22, "usage_type": "call" }, { "api_name": "selenium.webdriver.common.by.By.CLASS_NAME", "line_number": 26, "usage_type"...
41890843374
from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() from django.conf import settings from registration.backends.default.urls import * urlpatterns = patterns('', (r'^accounts/', include('main.urls')), (r...
zhoupeiling/Colibri
urls.py
urls.py
py
1,890
python
en
code
0
github-code
27
[ { "api_name": "django.contrib.admin.autodiscover", "line_number": 5, "usage_type": "call" }, { "api_name": "django.contrib.admin", "line_number": 5, "usage_type": "name" }, { "api_name": "django.conf.urls.patterns", "line_number": 11, "usage_type": "call" }, { "ap...
23686233085
import neat import pickle from modules.GameAppManager import GameAppManager # mainGame method of train file # configuration of NEAT algorithm from file def main(): global statistic_report config = neat.config.Config( neat.DefaultGenome, neat.DefaultReproduction, neat.DefaultSpeciesSet,...
Michal-Jankowski/Flappy-Bird-ML-NEAT
mainGame/Model.py
Model.py
py
1,615
python
en
code
0
github-code
2
[ { "api_name": "neat.config.Config", "line_number": 10, "usage_type": "call" }, { "api_name": "neat.config", "line_number": 10, "usage_type": "attribute" }, { "api_name": "neat.DefaultGenome", "line_number": 11, "usage_type": "attribute" }, { "api_name": "neat.Defa...
2060860729
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse as ap from pathlib import Path abbreviations = { # Necessary to keep file names below 100 characters! (Fixed in v3.11 of Pymultinest, but I use v3.10) 'Earthlike': 'EL', 'NonEarthlike': 'NEL', 'MantleOnly': 'MO', 'Default': 'D', 'Test...
andrewmbuchan4/PyllutedWD_Public
src/pwd_utils.py
pwd_utils.py
py
2,339
python
en
code
2
github-code
27
[ { "api_name": "pathlib.Path", "line_number": 24, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 39, "usage_type": "call" } ]
17946357134
import discord from discord import app_commands from bot import bot from converter import convert_to_bs def get_error_response(): return { 'embed': discord.Embed( title='Error', description='Some error occured. Make sure the date is valid. Please try again.', colour=discord.Colour.red()), ...
anchalghale/date-discord-bot
commands.py
commands.py
py
1,552
python
en
code
0
github-code
27
[ { "api_name": "discord.Embed", "line_number": 11, "usage_type": "call" }, { "api_name": "discord.Colour.red", "line_number": 12, "usage_type": "call" }, { "api_name": "discord.Colour", "line_number": 12, "usage_type": "attribute" }, { "api_name": "discord.Embed", ...
22381548358
"""`formable.yielding.yield_stress.py` Module containing: - functions that calculate yield stress according to some yield point criterion. - a class to represent yield point criteria of a given type """ import functools import numpy as np class YieldPointUnsatisfiedError(Exception): pass def get_yie...
LightForm-group/formable
formable/yielding/yield_point.py
yield_point.py
py
6,083
python
en
code
2
github-code
27
[ { "api_name": "numpy.where", "line_number": 39, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 75, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 160, "usage_type": "call" }, { "api_name": "numpy.array", "line_number":...
7766291649
"""На основе руководства из: https://www.youtube.com/watch?v=UQlUAmCnbzQ""" import logging import collections import requests import lxml import csv from bs4 import BeautifulSoup logging.basicConfig(level=logging.DEBUG) logger = logging.getLogger('ld') ParserResult = collections.namedtuple( 'ParserResult', ...
Alnipet/parsers
Lunda Parser/Parser.py
Parser.py
py
3,478
python
en
code
0
github-code
27
[ { "api_name": "logging.basicConfig", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 11, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "collections....
41399081883
from django import forms from django.core.exceptions import ValidationError from protocol import Protocol from protocol.constants import ProtocolType from wallet.constants import WalletType from wallet.models import Address, ExtendedPublicKey, UserWallet def get_xpublic_key_or_address_form(MyModel, validate_func_nam...
rfreis/block-tracker
wallet/forms.py
forms.py
py
4,131
python
en
code
57
github-code
27
[ { "api_name": "django.forms.ModelForm", "line_number": 11, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 11, "usage_type": "name" }, { "api_name": "protocol.Protocol", "line_number": 22, "usage_type": "call" }, { "api_name": "django.cor...
25517372898
import pytest import allure @allure.feature('Random dog') @allure.story('Получение фото случайной собаки') def test_get_random_dog(dog_api): response = dog_api.get(path='breeds/image/random') with allure.step('Запрос отправлен, посмотрим код ответа'): assert response.status_code == 200, f'Неверный ко...
Babaevskiy/api_tests_with_allure
tests/test_dog_api.py
test_dog_api.py
py
2,801
python
ru
code
0
github-code
27
[ { "api_name": "allure.step", "line_number": 10, "usage_type": "call" }, { "api_name": "allure.step", "line_number": 13, "usage_type": "call" }, { "api_name": "allure.feature", "line_number": 5, "usage_type": "call" }, { "api_name": "allure.story", "line_number...
35378277970
from flask import Flask, render_template, request from flask_mysqldb import MySQL import json app = Flask(__name__) # We first specify the details of our sql server app.config['MYSQL_HOST'] = '127.0.0.1' app.config['MYSQL_USER'] = 'root' app.config['MYSQL_PASSWORD'] = 'root' app.config['MYSQL_DB'] = 'MyDB' mysql = M...
raghavmta/CubeTest
Cube.py
Cube.py
py
3,639
python
en
code
0
github-code
27
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask_mysqldb.MySQL", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 20, "usage_type": "attribute" }, { "api_name": "flask.reques...
41443313553
from typing import List import torch from recstudio.data import dataset, advance_dataset from recstudio.model import basemodel, loss_func, module, scorer from recstudio.ann import sampler r""" Paper Reference: ################## Jing Li, et al. "Neural Attentive Session-based Recommendation" in CIKM 2017. htt...
Xiuchen519/Amazon-KDDCUP-23
RecStudio/recstudio/model/seq/narm.py
narm.py
py
4,372
python
en
code
4
github-code
27
[ { "api_name": "torch.nn", "line_number": 16, "usage_type": "attribute" }, { "api_name": "typing.List", "line_number": 18, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.nn", "line_nu...
11810886697
import os import csv #import Tkinter as tk import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt def make_graph(filename, data): x = [] y = [] for line in data: n = float(line[0]) r = float(line[3]) x.append(n) y.append(r**1.75/n) ax = plt.axes() ax.set_axisbelow(False) plt.grid(axis='y...
nicfreeman1209/wall-fractals
dla/make graphs.py
make graphs.py
py
735
python
en
code
0
github-code
27
[ { "api_name": "matplotlib.use", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.axes", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 16, "usage_type": "name" }, { "api_name": "matplotlib.pyp...
20148964106
import numpy as np import time from autograd.numpy.numpy_boxes import ArrayBox def adam_optimize(objective, params, jac, step_size=1e-2, Nsteps=100, bounds=None, direction='min', beta1=0.9, beta2=0.999, callback=None, verbose=True): """Performs Nsteps steps of ADAM minimization of function `objective` with gradien...
fancompute/ceviche
ceviche/optimizers.py
optimizers.py
py
2,082
python
en
code
287
github-code
27
[ { "api_name": "numpy.set_printoptions", "line_number": 10, "usage_type": "call" }, { "api_name": "time.time", "line_number": 17, "usage_type": "call" }, { "api_name": "time.time", "line_number": 23, "usage_type": "call" }, { "api_name": "autograd.numpy.numpy_boxes...
31388913820
#!/usr/bin/python import toml import argparse import os program = argparse.ArgumentParser() program.add_argument("--dry", type=bool, help="Only print what is going to be done", default=False) program.add_argument("--set-version", type=bool, default=False, help="Sets version") program.add_argument("--publish", type=bo...
kislball/ena
tools.py
tools.py
py
1,986
python
en
code
2
github-code
27
[ { "api_name": "argparse.ArgumentParser", "line_number": 6, "usage_type": "call" }, { "api_name": "os.system", "line_number": 28, "usage_type": "call" }, { "api_name": "toml.load", "line_number": 31, "usage_type": "call" }, { "api_name": "toml.load", "line_numb...
32641523079
import wx import wx.grid as gridlib import copy class TableGroup(wx.Panel): """ This is a 'TableGroup' object customized for HERE Linear Conflation @:parameters data: data array, example: [[value1,value2,value3...],[value_x,value_y,value_z...],[...]] rowLabels: array, example: [name1,name2,name3......
whzhang/here-linear-conflation
Install/components/TableGroup.py
TableGroup.py
py
8,966
python
en
code
0
github-code
27
[ { "api_name": "wx.Panel", "line_number": 5, "usage_type": "attribute" }, { "api_name": "wx.Panel.__init__", "line_number": 21, "usage_type": "call" }, { "api_name": "wx.Panel", "line_number": 21, "usage_type": "attribute" }, { "api_name": "wx.ID_ANY", "line_nu...
30606979427
import readata as rd import matplotlib.pyplot as plt import numpy as np import xarray as xr # Cette routine sert à comparer l'évolution de la EKE au fil du couplage. # Les output : des plot de la EKE au fil du temps. ## === GENERAL PARAMETERS : # --- Physical parameters : hek = 40 f = 7.0e-5...
charli1213/Modele-shallow-water-multicouches
analyse-python/8pannels_RHSdE_RECOU.py
8pannels_RHSdE_RECOU.py
py
7,500
python
en
code
0
github-code
27
[ { "api_name": "readata.readat", "line_number": 29, "usage_type": "call" }, { "api_name": "xarray.Dataset", "line_number": 55, "usage_type": "call" }, { "api_name": "readata.im", "line_number": 58, "usage_type": "call" }, { "api_name": "readata.jp", "line_numbe...
40183274412
from .db import db, environment, SCHEMA, add_prefix_for_prod from datetime import datetime from flask_sqlalchemy import SQLAlchemy class Message(db.Model): __tablename__ = 'messages' if environment == "production": __table_args__ = {'schema': SCHEMA} # Columns id = db.Column(db.Integer, primar...
BoJamesH/tumult-project
app/models/message.py
message.py
py
1,468
python
en
code
3
github-code
27
[ { "api_name": "db.db.Model", "line_number": 5, "usage_type": "attribute" }, { "api_name": "db.db", "line_number": 5, "usage_type": "name" }, { "api_name": "db.environment", "line_number": 8, "usage_type": "name" }, { "api_name": "db.SCHEMA", "line_number": 9, ...
33527119502
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup dev_requires = [ "flake8>=2.2.0", "pytest>=2.6.0", ] setup( name="Montanus", version="0.0.1", description="A tool for managing static files version for CDN requirements", author="Le Wang", author_email="thisiswangl...
lewangdev/montanus
setup.py
setup.py
py
943
python
en
code
0
github-code
27
[ { "api_name": "setuptools.setup", "line_number": 11, "usage_type": "call" } ]
18858428457
from bubblebuster.link import Link, LinkMan from bubblebuster.image import ImageMan, ImageNames from bubblebuster.timer import ClickExplodeCommand, TimerMan from bubblebuster.group import GroupNames, GroupMan from bubblebuster.sprite import BoxSpriteMan, BoxSpriteNames from bubblebuster.settings import InterfaceSetting...
abergie5b/BubbleBuster
bubblebuster/weapon/weapon.py
weapon.py
py
5,900
python
en
code
0
github-code
27
[ { "api_name": "enum.Enum", "line_number": 12, "usage_type": "name" }, { "api_name": "bubblebuster.link.Link", "line_number": 20, "usage_type": "name" }, { "api_name": "bubblebuster.image.ImageMan.instance.find", "line_number": 27, "usage_type": "call" }, { "api_na...
32953059986
#!/usr/bin/env python ''' =============================================================================== Draw Rectangle using left mouse button Key 'n' - To update the segmentation Key 'r' - To reset the setup Key 's' - To save the results ===============================================================================...
jeetv/Computer_Vision
Assignment_3/grabcut.py
grabcut.py
py
12,400
python
en
code
0
github-code
2
[ { "api_name": "cv2.EVENT_LBUTTONDOWN", "line_number": 42, "usage_type": "attribute" }, { "api_name": "cv2.EVENT_MOUSEMOVE", "line_number": 46, "usage_type": "attribute" }, { "api_name": "cv2.rectangle", "line_number": 49, "usage_type": "call" }, { "api_name": "cv2...
26803012667
import numpy as np import tensorflow as tf import random as rn import os from scipy.stats import sem, t import numpy as np import pandas as pd import shutil #Load Parameters import utils.parameters as params FIXED_PARAMETERS = params.load_parameters() #Set Seeds for Reproducability os.environ['PYTHONHASHSEED']=str(i...
sharford5/Cardiac-Arrest-Community
grid_search.py
grid_search.py
py
2,282
python
en
code
0
github-code
27
[ { "api_name": "utils.parameters.load_parameters", "line_number": 13, "usage_type": "call" }, { "api_name": "utils.parameters", "line_number": 13, "usage_type": "name" }, { "api_name": "os.environ", "line_number": 16, "usage_type": "attribute" }, { "api_name": "num...
34421735678
import tqdm import time import random from math import sqrt from secrets import randbelow TIME_THRESHOLD = 5 OUTPUT_FILE = "aufgabe_1.txt" def probedivision(n: int) -> bool: wurzel = int(sqrt(n)) for i in range(2, wurzel + 1): if n % i == 0: return False return True def ...
pbusenius/Modul_28
tag_1/aufgabe_1.py
aufgabe_1.py
py
2,251
python
en
code
0
github-code
27
[ { "api_name": "math.sqrt", "line_number": 13, "usage_type": "call" }, { "api_name": "secrets.randbelow", "line_number": 32, "usage_type": "call" }, { "api_name": "time.time", "line_number": 53, "usage_type": "call" }, { "api_name": "time.time", "line_number": ...
73768978312
# -*- coding: utf-8 -*- # @Author: Bin Liu # @Date: 2018-06-18 14:32:27 # @Last Modified by: Bin Liu # @Last Modified time: 2018-06-20 13:51:51 # @E-mail: monster910818@gmail.com or monster910818@163.com # 导入环境和学习方法 from .env import ArmEnv from Mechanical_arm.rl import DDPG # 设置全局变量 MAX_EPISODES = 500 MAX_EP_STEPS =...
Monster910818/Robin.M
Mechanical_arm/Mechanical_arm/main.py
main.py
py
1,874
python
zh
code
0
github-code
27
[ { "api_name": "env.ArmEnv", "line_number": 24, "usage_type": "call" }, { "api_name": "env.state_dim", "line_number": 25, "usage_type": "attribute" }, { "api_name": "env.action_dim", "line_number": 26, "usage_type": "attribute" }, { "api_name": "env.action_bound", ...
73163494151
import tensorflow as tf from tensorflow import keras import numpy as np import xarray as xr def normalise_data(data, mu=None, std=None, dims=None): ''' Normalise the data in an xarray dataset ''' if mu is None and std is None: if not dims: dims = lis...
samimiaari95/magicalbox-python
FFANN_example.py
FFANN_example.py
py
11,022
python
en
code
0
github-code
27
[ { "api_name": "os.path.join", "line_number": 44, "usage_type": "call" }, { "api_name": "os.path", "line_number": 44, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 45, "usage_type": "call" }, { "api_name": "os.path", "line_number": 4...
37751371760
import numpy as np from sklearn.gaussian_process.kernels import RBF from sklearn.gaussian_process import GaussianProcessRegressor import matplotlib.pyplot as plt class Kernel: def calculate_kernel(self, sca_l, train_X, train_y, test_X): ker = RBF(length_scale=sca_l, length_scale_bounds='fixed') ...
GANDUWARD/AI-in-Python
Gaussian_regression/K.py
K.py
py
901
python
en
code
1
github-code
27
[ { "api_name": "sklearn.gaussian_process.kernels.RBF", "line_number": 8, "usage_type": "call" }, { "api_name": "sklearn.gaussian_process.GaussianProcessRegressor", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 13, "usage_type": "call"...
15082655764
import yt_dlp import re def download_video(url): ydl_opts = { "format_sort": "360", "live-from-start": False, "force-overwrites": True, "continue_dl": True, "skip-unavailable-fragments": True, "outtmpl": "./tmp/%(id)s.%(ext)s", } with yt_dlp.YoutubeDL(ydl_o...
franz101/assemblyai
api/tube2blog/downloader2.py
downloader2.py
py
711
python
en
code
0
github-code
27
[ { "api_name": "yt_dlp.YoutubeDL", "line_number": 15, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 21, "usage_type": "call" } ]
228607496
import requests import json from getenv import env import datetime class Quandl: def __init__(self): self.libor_url = 'https://www.quandl.com/api/v1/datasets/FED/RILSPDEPM01_N_B.json?auth_token=' self.api_key = env('QUANDL_API_KEY') def get_all_libor_rates_and_dates(self): response = ...
mattbrosenberg/ltt
project/libor/quandl.py
quandl.py
py
842
python
en
code
0
github-code
27
[ { "api_name": "getenv.env", "line_number": 9, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 19, "usage_type": "call" } ]
19688277067
import pygame pygame.init() window = pygame.display.set_mode((800,600)) pygame.display.set_caption("Window") black = (0,0,0) white = (255,255,255) image=pygame.image.load("C:/Users/Kwaku/Documents/Uni Work/FINAL YEAR PROJECT/python code/pygame tut/pygameimages/images/python_logo.png").convert_alpha() gameLoop=Tr...
k-ankobia/RC-Self-Driving-Car
python Tutorials/pygame tut/pygameimages/images.py
images.py
py
541
python
en
code
2
github-code
2
[ { "api_name": "pygame.init", "line_number": 3, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 5, "usage_type": "attribute" }, { "api_name": "pygame.display.s...
7829533360
from typing import Dict, Optional from promptrix.promptrixTypes import PromptMemory, PromptFunctions, Tokenizer from promptrix.Prompt import Prompt from alphawave_agents.SchemaBasedCommand import SchemaBasedCommand from alphawave_agents.SchemaBasedCommand import CommandSchema as sbcCommandSchema from alphawave_agents.a...
bdambrosio/llmFunctions
tests/testSchema.py
testSchema.py
py
948
python
en
code
0
github-code
27
[ { "api_name": "alphawave_agents.SchemaBasedCommand.CommandSchema", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 14, "usage_type": "name" }, { "api_name": "dataclasses.dataclass", "line_number": 9, "usage_type": "name" }, { ...
29364401178
from celery import task from datetime import datetime from API.models import APIKey, MemberAPIKey, SSORefreshToken from Map.models import System from core.models import Type from core.utils import get_config from API.utils import sso_refresh_access_token, crest_access_data, esi_access_data, sso_access_list, api_current...
evewspace/eve-wspace
evewspace/API/tasks.py
tasks.py
py
4,199
python
en
code
86
github-code
27
[ { "api_name": "sys.setdefaultencoding", "line_number": 22, "usage_type": "call" }, { "api_name": "django.contrib.auth.get_user_model", "line_number": 24, "usage_type": "call" }, { "api_name": "celery.task", "line_number": 26, "usage_type": "call" }, { "api_name": ...
31337384367
""" Implements attention operations for RL^2 agents """ import functools import torch as tc @functools.lru_cache def sinusoidal_embeddings(src_len, d_model, reverse=False): pos_seq = tc.arange(src_len) inv_freq = 1 / (10000 ** (tc.arange(0, d_model, 2) / d_model)) sinusoid_input = pos_seq.view(-1, 1) * ...
lucaslingle/pytorch_rl2
rl2/agents/architectures/common/attention.py
attention.py
py
12,328
python
en
code
44
github-code
27
[ { "api_name": "torch.arange", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.arange", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.cat", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.sin", "line_number": 15...
36944710885
from textual.app import App, ComposeResult from textual.widgets import Header, Footer, Button, Static from textual.containers import Container class TimeDisplay(Static): pass class StopWatch(Static): def compose(self) -> ComposeResult: yield Button("Start", id="start", variant="success") yie...
oussamadz/ebay_scraper_tui
main.py
main.py
py
1,513
python
en
code
0
github-code
27
[ { "api_name": "textual.widgets.Static", "line_number": 6, "usage_type": "name" }, { "api_name": "textual.widgets.Static", "line_number": 10, "usage_type": "name" }, { "api_name": "textual.widgets.Button", "line_number": 12, "usage_type": "call" }, { "api_name": "t...
71641611256
#!/usr/bin/env # coding:utf-8 """ Created on 2019/5/15 16:42 base Info """ __author__ = 'xx' __version__ = '1.0' import os import torch import torch.nn as nn from torch.nn.parameter import Parameter import torch.nn.functional as F from data_loader import Cora from model_component.utils.agg_softmax import softmax fr...
XxSear/high-order-graph-convolution-network
model_component/conv/gcn_conv_input_list.py
gcn_conv_input_list.py
py
3,089
python
en
code
0
github-code
22
[ { "api_name": "torch.nn.Module", "line_number": 25, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 25, "usage_type": "name" }, { "api_name": "torch.nn.parameter.Parameter", "line_number": 37, "usage_type": "call" }, { "api_name": "torch.Tens...
17067286571
import plotly import pandas as pd from plotly.graph_objs import Bar def return_figures(df): """ Function creates visualization out of DisasterResponse database using plotly and return figures in the form of list. Parameters: ----------- df : dataframe out of which plotly visualiza...
Piyush23Rai/DisasterResponse
app/data_visualization.py
data_visualization.py
py
2,242
python
en
code
0
github-code
27
[ { "api_name": "plotly.graph_objs.Bar", "line_number": 31, "usage_type": "call" }, { "api_name": "plotly.graph_objs.Bar", "line_number": 61, "usage_type": "call" } ]
564155407
import tensorflow as tf from tensorflow.keras.layers import (Activation, Concatenate, Conv2D, Reshape) from typing import List from .block import anchor_detect_head_block from .layer import AnchorBoxes class AnchorDetectHead(tf.keras.Model): def __init__(self, n_classes: int, ima...
solarfresh/solartf
solartf/objdetector/graph.py
graph.py
py
4,368
python
en
code
0
github-code
27
[ { "api_name": "tensorflow.keras", "line_number": 8, "usage_type": "attribute" }, { "api_name": "typing.List", "line_number": 12, "usage_type": "name" }, { "api_name": "block.anchor_detect_head_block", "line_number": 55, "usage_type": "call" }, { "api_name": "tenso...
14786365817
import statistics import pygame from pygame import Vector2 from TD.config import SCREEN_RECT from TD.editor import gui from TD import paths from .gui_group import PanelGUIGroup from TD.editor.globals import current_scene from .utils import validate_txt_point class Transforms(PanelGUIGroup): def __init__(self, ...
chrisrossx/TotalDestruction
TD/editor/level_scene/level_paths/transforms.py
transforms.py
py
8,856
python
en
code
0
github-code
27
[ { "api_name": "gui_group.PanelGUIGroup", "line_number": 13, "usage_type": "name" }, { "api_name": "TD.editor.gui.Label", "line_number": 19, "usage_type": "call" }, { "api_name": "TD.editor.gui", "line_number": 19, "usage_type": "name" }, { "api_name": "TD.editor.g...
4133871565
''' Maximum sum of Non-adjacent nodes Given a binary tree with a value associated with each node, we need to choose a subset of these nodes such that sum of chosen nodes is maximum under a constraint that no two chosen node in subset should be directly connected that is, if we have taken a node in our sum then we can...
Dharm3438/GFG_problem_of_the_day
15.max_sum_non_adjacent.py
15.max_sum_non_adjacent.py
py
3,318
python
en
code
0
github-code
27
[ { "api_name": "sys.setrecursionlimit", "line_number": 48, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 69, "usage_type": "call" } ]
36256347857
#send sms via way2sms api from tkinter import * import requests import json URL = 'https://www.way2sms.com/api/v1/sendCampaign' def sendPostRequest(reqUrl, apiKey, secretKey, useType, phoneNo, senderId, textMessage): req_params = { 'apikey':apiKey, 'secret':secretKey, 'usetype':useType, 'phone': phoneNo, '...
abhilashnambiar/dcodetech_python
send_sms_way2sms_api.py
send_sms_way2sms_api.py
py
916
python
en
code
0
github-code
27
[ { "api_name": "requests.post", "line_number": 16, "usage_type": "call" } ]
71531278152
#!/usr/bin/env python3 def request_wiki(): import sys, json, requests from dewiki import parser argv = sys.argv if len(argv) != 2: return req = requests.get("https://en.wikipedia.org/w/api.php?action=query&format=json&prop=revisions&meta=&continue=&titles=" + argv[1] ...
koteyevlev/django_ecole_42
D03/ex02/request_wikipedia.py
request_wikipedia.py
py
897
python
en
code
1
github-code
27
[ { "api_name": "sys.argv", "line_number": 6, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "dewiki.parser.Parser", "line_number": 14, "usage_type": "call" }, { "api_name": "dewiki.parser", "li...
20871584291
from monai.data import Dataset from monai.transforms import * import numpy as np import torch from torch.nn.functional import interpolate class MRIDataset(Dataset): def __init__(self, data, stack, transform): ''' :param data: data list [{'img': path, 'label': path},{}] :param stack: stack...
MAI-Lab-West-China-Hospital/Brain-MRI-data-sorting-and-artifacts-detection
dataset.py
dataset.py
py
2,638
python
en
code
0
github-code
27
[ { "api_name": "monai.data.Dataset", "line_number": 8, "usage_type": "name" }, { "api_name": "numpy.moveaxis", "line_number": 29, "usage_type": "call" }, { "api_name": "torch.from_numpy", "line_number": 32, "usage_type": "call" }, { "api_name": "torch.nn.functional...
35502429499
__all__ = ["install_mask_dir", "InstallMask"] import collections import errno import fnmatch import operator from portage import os, _unicode_decode from portage.exception import ( FileNotFound, IsADirectory, OperationNotPermitted, PermissionDenied, ReadOnlyFileSystem, ) from portage.util import n...
gentoo/portage
lib/portage/util/install_mask.py
install_mask.py
py
6,444
python
en
code
507
github-code
22
[ { "api_name": "collections.defaultdict", "line_number": 20, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 23, "usage_type": "call" }, { "api_name": "operator.attrgetter", "line_number": 96, "usage_type": "call" }, { "api_name": "fn...
23465147784
import xlsxwriter class BasicsExcel(object): @staticmethod def demo1(): workbook = xlsxwriter.Workbook('demo2.xlsx') worksheet1 = workbook.add_worksheet('第一个') worksheet2 = workbook.add_worksheet('第二个') worksheet3 = workbook.add_worksheet() bold = workbook.add_format()...
yl0115/handExcel
basicsexcel/basics_demo.py
basics_demo.py
py
877
python
en
code
0
github-code
27
[ { "api_name": "xlsxwriter.Workbook", "line_number": 8, "usage_type": "call" } ]
73908045167
from io import TextIOWrapper from sqlalchemy import Column, Integer, Date, Unicode, UnicodeText, String, Boolean, create_engine from sqlalchemy.engine import Engine from sqlalchemy.orm import Session from sqlalchemy.ext.declarative import declarative_base from typing import List, Dict import csv Base = declarative_bas...
cphil124/sports_database_model
python/pfr-data-ingestion/add_person_scratch.py
add_person_scratch.py
py
6,422
python
en
code
0
github-code
2
[ { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 9, "usage_type": "call" }, { "api_name": "sqlalchemy.Column", "line_number": 14, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer", "line_number": 14, "usage_type": "argument" }, { ...
70006811911
import streamlit as st import gridfs import tools import pandas as pd client = tools.init_connection() db = client.pollwatcher fs = gridfs.GridFS(db) def app(): st.header('Overcounted Voters') results = tools.get_rawdata(db,'view_validation_overcount') pos_map = {'pw_president':'President', 'pw_vi...
kawenks/sldev
verify/overage.py
overage.py
py
2,806
python
en
code
0
github-code
27
[ { "api_name": "tools.init_connection", "line_number": 6, "usage_type": "call" }, { "api_name": "gridfs.GridFS", "line_number": 8, "usage_type": "call" }, { "api_name": "streamlit.header", "line_number": 13, "usage_type": "call" }, { "api_name": "tools.get_rawdata"...
9476399864
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Mar 21 14:48:19 2017 @author: stjohn """ import folium from folium.plugins import MarkerCluster import pandas as pd library = pd.read_csv('LIBRARY.csv', nrows=10) #Create lists to hold coordinates and popups: coords = [] popups = [] icons = [] print...
stjohn/stjohn.github.io
teaching/seminar4/s17/lib.py
lib.py
py
1,137
python
en
code
0
github-code
27
[ { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "folium.Icon", "line_number": 30, "usage_type": "call" }, { "api_name": "folium.Map", "line_number": 35, "usage_type": "call" }, { "api_name": "folium.plugins.MarkerCluster",...
21708270942
import hashlib import os import random import string from datetime import date, datetime, timedelta from functools import wraps import mistune import openai.error from flask import Flask, jsonify, request, make_response, redirect from flask_limiter import Limiter from flask_login import LoginManager, UserMixin, login_...
gorse-io/midsearch
midsearch/server/__init__.py
__init__.py
py
7,618
python
en
code
61
github-code
27
[ { "api_name": "os.getenv", "line_number": 21, "usage_type": "call" }, { "api_name": "openai.error.proxy", "line_number": 22, "usage_type": "attribute" }, { "api_name": "openai.error", "line_number": 22, "usage_type": "name" }, { "api_name": "os.getenv", "line_...
15030779120
import os import zipfile from os.path import exists from typing import Optional import pandas as pd class DataFile: def __init__( self, name: str, col_cant_have_null_values: list[str], non_required_col: list[str], col_to_coerce_to_int64: Optional[list[st...
immutableT/cs513
data_file.py
data_file.py
py
3,404
python
en
code
0
github-code
27
[ { "api_name": "typing.Optional", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 15, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 36, "usage_type": "call" }, { "api_name": "os.path", "line_numb...
29831775227
import numpy as np import pandas as pd from keras.models import Sequential, load_model from keras.layers import Flatten,Dense,MaxPooling2D,Conv2D,Lambda,Cropping2D from keras.preprocessing.image import ImageDataGenerator from keras.callbacks import ModelCheckpoint, History import tensorflow as tf print("Tensorflow vers...
ThomasHenckel/Learning
Self-Driving Car Engineer/CarND-Behavioral-Cloning-P3/model.py
model.py
py
9,710
python
en
code
0
github-code
27
[ { "api_name": "tensorflow.__version__", "line_number": 8, "usage_type": "attribute" }, { "api_name": "tensorflow.ConfigProto", "line_number": 22, "usage_type": "call" }, { "api_name": "tensorflow.Session", "line_number": 25, "usage_type": "call" }, { "api_name": "...
22041535042
import itertools from birdears import KEYS from birdears.questionbase import QuestionBase # from birdears.interval import DiatonicInterval # from birdears.interval import ChromaticInterval from birdears.interval import Interval from birdears.scale import ScaleBase from birdears.scale import DiatonicScale from birde...
birdears/birdears
tests/test_basic.py
test_basic.py
py
5,041
python
en
code
55
github-code
27
[ { "api_name": "birdears.questionbase.QuestionBase", "line_number": 28, "usage_type": "call" }, { "api_name": "birdears.questionbase.QuestionBase", "line_number": 39, "usage_type": "call" }, { "api_name": "birdears.questionbase.QuestionBase", "line_number": 45, "usage_type...
23763204916
import os import json import utils def extract_op(input_dir, output_dir): ''' Extract op from assmbly code. You may need to adjust the structure of `for` loop and `if` condition based the hierarchy of your folder. ''' sub_list = [ 'Glow_2020/', 'Glow_2021/', 'Glow_2022/...
monkbai/DNN-decompiler
operator_inference/preprocess.py
preprocess.py
py
7,422
python
en
code
174
github-code
2
[ { "api_name": "utils.make_path", "line_number": 19, "usage_type": "call" }, { "api_name": "utils.make_path", "line_number": 24, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 25, "usage_type": "call" }, { "api_name": "utils.make_path", "lin...
34206134468
import pytest import requests from src import config @pytest.fixture() def post_method(): user = { "name": "Nick", "job": "QA" } return user @pytest.fixture() def put_method(): user_update = { "name": "Nick", "job": "QA Lead" } return user_update @pytest.fixtu...
gucciskygoogles/NewApiTest
conftest.py
conftest.py
py
852
python
en
code
0
github-code
22
[ { "api_name": "pytest.fixture", "line_number": 6, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 14, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 24, "usage_type": "call" }, { "api_name": "src.config.APIkey", "li...
22475450745
import typing import datetime import humanize import logging from cronitor import State, Monitor import cronitor import functools import shutil import tempfile import sys logger = logging.getLogger(__name__) try: import celery import celery.beat from celery.schedules import crontab, schedule, solar fro...
cronitorio/cronitor-python
cronitor/celery.py
celery.py
py
8,600
python
en
code
59
github-code
22
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "typing.TYPE_CHECKING", "line_number": 19, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 25, "usage_type": "call" }, { "api_name": "cronitor.api_key...
23838422724
import json import urllib.request import urllib.parse from urllib.error import HTTPError from django.conf import settings from django.contrib.auth import login from django.shortcuts import redirect from .models import User class AppAuthMiddleware: def __init__(self, get_response): self.get_response = ...
exval/Awesome-Task-Exchange-System-aTES
project/task-manager/src/tracker/middleware.py
middleware.py
py
2,428
python
en
code
0
github-code
22
[ { "api_name": "django.conf.settings.AUTH_APP_ID", "line_number": 19, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 19, "usage_type": "name" }, { "api_name": "django.conf.settings.AUTH_APP_SECRET", "line_number": 20, "usage_type": "attri...
15588111850
import requests from bs4 import BeautifulSoup import csv r = requests.get(f"https://www.bmkg.go.id/profil/stasiun-upt.bmkg") soup = BeautifulSoup(r.content, 'html.parser') print(soup.original_encoding) table = soup.find("table",{"class":"table table-hover table-striped"}) # to select the right table # cari s...
rifatrkf/ETL-Data-Stasiun
webscrapping/stasiun.py
stasiun.py
py
1,176
python
en
code
0
github-code
22
[ { "api_name": "requests.get", "line_number": 5, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 6, "usage_type": "call" } ]
32875910808
from logging import Logger from django.conf import settings from django.db.models.signals import post_delete, post_save from django.dispatch import receiver from django_celery_results.models import TaskResult from notify.models import BackgroundProcess from notify.serializers import BackgroundProcessSerializer from no...
mrmap-community/mrmap
mrmap/notify/signals.py
signals.py
py
3,571
python
en
code
11
github-code
22
[ { "api_name": "logging.Logger", "line_number": 12, "usage_type": "name" }, { "api_name": "django.conf.settings.ROOT_LOGGER", "line_number": 12, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 12, "usage_type": "name" }, { "api_nam...
35038135412
import os import json import eventlet import time from threading import Thread import sys from flask import Flask, render_template, jsonify from flask.ext.socketio import SocketIO, emit import socketio import zmq import time from helpers import * app = Flask(__name__) sio = SocketIO(app=app, async_mode="threading") e...
lenny-belardo/ExplosionDetection
app/project.py
project.py
py
2,559
python
en
code
0
github-code
22
[ { "api_name": "flask.Flask", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.ext.socketio.SocketIO", "line_number": 15, "usage_type": "call" }, { "api_name": "zmq.Context", "line_number": 21, "usage_type": "call" }, { "api_name": "zmq.PUB", "li...
10935824273
import os import sys import json import csv import torch from sentence_transformers import SentenceTransformer, util from train_relreg_tt import get_examples sys.setrecursionlimit(10000) def write_to_file(examples, meetings_dict, output_dir, split): id2meetingsrc_embed = {} for curid, utts in meetings_dict....
salesforce/query-focused-sum
extractors/test_relreg_tt.py
test_relreg_tt.py
py
2,929
python
en
code
39
github-code
22
[ { "api_name": "sys.setrecursionlimit", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os.mkdir", "lin...
38094177376
import cv2 import numpy as np import matplotlib.pyplot as plt import common #-----------------------------------------------------------------------------------# def clamp_scale(in0, in1, out0, out1, f): if f < in0: return out0 elif f > in1: return out1 else: assert(in0 != in1) ...
xukan840730/learning
ml/test-drive-assist/fit_line.py
fit_line.py
py
13,690
python
en
code
0
github-code
27
[ { "api_name": "common.normalize", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 3...
21049941646
from unittest import TestCase from uuid import uuid4 from tests.utils import create_mock_user, create_mock_enrollment, create_mock_discussion, teardown_data from models import db, Discussion discussion_data = [ { 'body': 'that the quick brown fox', }, { 'body': 'jumps over the lazy dog.' ...
aswasif007/pi-academy-api
tests/unit/models/test_discussion.py
test_discussion.py
py
2,055
python
en
code
0
github-code
22
[ { "api_name": "unittest.TestCase", "line_number": 16, "usage_type": "name" }, { "api_name": "uuid.uuid4", "line_number": 19, "usage_type": "call" }, { "api_name": "tests.utils.create_mock_user", "line_number": 20, "usage_type": "call" }, { "api_name": "tests.utils...
3422619304
#tutoring models from django.db import models from django.db.models.query import QuerySet from django.core.cache import cache from hkn.info.models import Person from hkn.tutor.constants import * import hkn.tutor.scheduler as scheduler import nice_types.semester from nice_types.db import QuerySetManager from nice_types...
wylliec/old-hkn
tutor/models.py
models.py
py
14,364
python
en
code
1
github-code
22
[ { "api_name": "nice_types.db.QuerySetManager", "line_number": 18, "usage_type": "name" }, { "api_name": "django.db.models.Model", "line_number": 23, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 23, "usage_type": "name" }, { "api_na...
17587268740
import csv from matplotlib import pyplot as plt from datetime import datetime # import os # cwd = os.getcwd() # Get the current working directory (cwd) # files = os.listdir(cwd) # Get all the files in that directory # print("Files in '%s': %s" % (cwd, files)) # filename = './sitka_weather_2014.csv' filename = './dea...
sansx/python_study
PythonCrashCourse/data_visualization/lesson4/highs_lows.py
highs_lows.py
py
1,210
python
en
code
0
github-code
22
[ { "api_name": "csv.reader", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 20, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 20, "usage_type": "name" }, { "api_name": "matplotlib.py...
24646030492
import math import pdb def normalizeAngle(angle): while angle < -math.pi: angle += 2*math.pi while angle > math.pi: angle -= 2*math.pi return angle def normalizeAngle0PI(angle): while angle < 0: angle += math.pi while angle > math.pi: angle -= math.pi return...
robotika/osgar
subt/ros/robot/src/robomath.py
robomath.py
py
2,401
python
en
code
13
github-code
22
[ { "api_name": "math.pi", "line_number": 5, "usage_type": "attribute" }, { "api_name": "math.pi", "line_number": 6, "usage_type": "attribute" }, { "api_name": "math.pi", "line_number": 7, "usage_type": "attribute" }, { "api_name": "math.pi", "line_number": 8, ...
41705122872
# This has some documentation embedded. See # ~/.local/lib/python3.8/site-packages/graphene_django/utils/testing.py from graphene_django.utils.testing import GraphQLTestCase import json from django.conf import settings from . import authenticate_jwt, login_tokenless # These two to trap stderr import sys from io import...
Anthony-J-Garot/snippets_graphql
snippets/tests/test_queries.py
test_queries.py
py
10,244
python
en
code
0
github-code
22
[ { "api_name": "graphene_django.utils.testing.GraphQLTestCase", "line_number": 21, "usage_type": "name" }, { "api_name": "json.loads", "line_number": 71, "usage_type": "call" }, { "api_name": "django.conf.settings.DEBUG", "line_number": 72, "usage_type": "attribute" }, ...
70834613815
import pygame import sys import random from settings import * from player import Player from sky import Sky from asteroid import Asteroid from bullet import Bullet def damage_meteors(meteor_filename_list): if asteroid.image == meteor_filename_list[0] or meteor_filename_list[1]: asteroid.damage = 5...
Alpaka4/space_shooter-3
space shooter/main.py
main.py
py
2,514
python
en
code
0
github-code
22
[ { "api_name": "asteroid.image", "line_number": 10, "usage_type": "attribute" }, { "api_name": "asteroid.damage", "line_number": 11, "usage_type": "attribute" }, { "api_name": "asteroid.image", "line_number": 12, "usage_type": "attribute" }, { "api_name": "asteroid...
15053154326
# I messed up the folder hierarchy for image classification from options import Options import xml.etree.ElementTree as ET import os import re def get_image_colors(dir, img_name): name = os.path.join(dir, "annotations", '{}.xml'.format(img_name)) tree = ET.parse(name) root = tree.getroot() return [obj...
D3rpyDolphin/Lego-Custom-Dataset
crop_images.py
crop_images.py
py
1,642
python
en
code
0
github-code
22
[ { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "xml.etree.ElementTree.parse", "line_number": 10, "usage_type": "call" }, { "api_name": "xml.etree.Element...
8346150308
#!/usr/bin/env python from setuptools import setup, find_packages __version__ = '0.0.2' readme = open("README").read() changes = open("docs/changes.rst").read() long_description = readme + "\n\n" + changes setup( name="django-nisoc", version=__version__, author="Djord Flanagan", author_email="grfl...
averagehuman/nisociety
setup.py
setup.py
py
959
python
en
code
0
github-code
2
[ { "api_name": "setuptools.setup", "line_number": 13, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 21, "usage_type": "call" } ]
69849138617
# -*- coding: utf-8 -*- # @Time : 2022/3/27 13:17 # @Author : Jarvis # @Email : jiamiao12@qq.com # @File : jd.py # @Software: PyCharm from selenium.webdriver.common.by import By page_url = 'https://www.jd.com' elements = [ {'name': 'search_ipt', 'desc': '搜索框点击', 'by': (By.ID, u'key'), 'ec': 'presence_of...
jarvis7164/AutoTestFrame
Page/jd/jd.py
jd.py
py
527
python
en
code
0
github-code
22
[ { "api_name": "selenium.webdriver.common.by.By.ID", "line_number": 13, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.common.by.By", "line_number": 13, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.by.By.CLASS_NAME", "line_number": 14, "...
41764633739
#!/usr/bin/env python3 """ Class to handle mysql databases """ # python standard modules # modules installed with pip from orderedattrdict import AttrDict import pymysql import pymysql.cursors class Database: """ Handle database connections Keep the connection open, and if any error try to reconne...
abundo/ablib
db.py
db.py
py
5,578
python
en
code
0
github-code
22
[ { "api_name": "pymysql.connect", "line_number": 29, "usage_type": "call" }, { "api_name": "pymysql.cursors", "line_number": 34, "usage_type": "attribute" }, { "api_name": "pymysql.MySQLError", "line_number": 57, "usage_type": "attribute" }, { "api_name": "pymysql....
10727324976
import nbformat import json import re import sys class bcolors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' BOLD = '\033[1m' UNDERLINE = '\033[4m' def read_notebook_code_cells(path_to_notebook): code_cells =...
OhIDunKnow/jupyterNotebook
lesson7/validate_c07.py
validate_c07.py
py
3,802
python
en
code
0
github-code
22
[ { "api_name": "nbformat.read", "line_number": 22, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 36, "usage_type": "call" }, { "api_name": "re.search", "line_number": 37, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 50...
3604237344
import numpy as np from nltk import word_tokenize from collections import Counter import random #TODO: Handle train/test/validation data #TODO: Datashuffling 2/3, 1/6, 1/6 #TODO: Store them separately #TODO: Write _make_batches #TODO: Define method to input <EOS> tokens #TODO: Global variable called numval bat...
liamge/NeuralLM
utils.py
utils.py
py
4,819
python
en
code
1
github-code
22
[ { "api_name": "collections.Counter", "line_number": 23, "usage_type": "call" }, { "api_name": "nltk.word_tokenize", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 44, "usage_type": "call" }, { "api_name": "numpy.random...
30467454281
import os import random import torch from transformers.file_utils import is_torch_available import numpy as np def set_seed(seed: int): """ Helper function for reproducible behavior to set the seed in ``random``, ``numpy``, ``torch`` and/or ``tf`` (if installed). Args: seed (:obj:`int`): The ...
jespinosal/aspect_based_sentiment_analysis
src/utils.py
utils.py
py
1,693
python
en
code
0
github-code
22
[ { "api_name": "random.seed", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 17, "usage_type": "attribute" }, { "api_name": "transformers.file_uti...
12809976778
from pages.base_page import BasePage from selenium.webdriver.common.by import By from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.support import expected_conditions as EC title_of_page = (By.XPATH, '//*[@data-ui-id="page-title-wrapper"]') product = (By.XPATH, '//*[@class="product-item...
adartsevichdasha/dasha_UI_tests
pages/eco_friendly_page.py
eco_friendly_page.py
py
2,355
python
en
code
0
github-code
22
[ { "api_name": "selenium.webdriver.common.by.By.XPATH", "line_number": 7, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.common.by.By", "line_number": 7, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.by.By.XPATH", "line_number": 8, "usage...
7815720300
import logging from airflow import DAG from airflow.operators.python_operator import PythonOperator # you need to run the airflow server first # run in terminal: /opt/airflow/start.sh ''' Define a function that uses the python logger to log a function. Then finish filling in the details of the DAG down below. Once you...
edumangabeira/DataEngineering
udacity/data_pipelines/classes/part1/airflow_DAG.py
airflow_DAG.py
py
779
python
en
code
0
github-code
27
[ { "api_name": "logging.info", "line_number": 14, "usage_type": "call" }, { "api_name": "airflow.DAG", "line_number": 17, "usage_type": "call" }, { "api_name": "airflow.operators.python_operator.PythonOperator", "line_number": 21, "usage_type": "call" } ]
28598807944
# Author: Gael Varoquaux # License: BSD 3 clause import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_equal from sklearn.utils.testing impo...
ryfeus/lambda-packs
Sklearn_scipy_numpy/source/sklearn/tests/test_base.py
test_base.py
py
7,045
python
en
code
1,104
github-code
22
[ { "api_name": "sklearn.base.BaseEstimator", "line_number": 23, "usage_type": "name" }, { "api_name": "sklearn.base.BaseEstimator", "line_number": 30, "usage_type": "name" }, { "api_name": "sklearn.base.BaseEstimator", "line_number": 36, "usage_type": "name" }, { "...
39520783662
import os import shutil import tempfile from absl.testing import absltest import chex import jax.numpy as jnp import numpy as np from jaqmc.dmc.ckpt_handler import CkptHandler from jaqmc.dmc.data_path import DataPath from jaqmc.dmc.state import State class CkptHandlerTest(chex.TestCase): def setUp(self): ...
bytedance/jaqmc
tests/dmc/ckpt_handler_test.py
ckpt_handler_test.py
py
2,331
python
en
code
31
github-code
2
[ { "api_name": "chex.TestCase", "line_number": 14, "usage_type": "attribute" }, { "api_name": "tempfile.mkdtemp", "line_number": 17, "usage_type": "call" }, { "api_name": "shutil.rmtree", "line_number": 20, "usage_type": "call" }, { "api_name": "jaqmc.dmc.ckpt_hand...
13879848845
from multiprocessing import Pool import JK import dmm import mgstage import tokyohot import jav if __name__ == '__main__': # conf root_raw = R'F:\0' root_finished = R'F:\1' single_processe = 1 # single_processe = 0 site = dmm # site = mgstage # site = tokyohot # site = ja...
Elypha/meta-scraper
main.py
main.py
py
867
python
en
code
0
github-code
2
[ { "api_name": "JK.file.findall", "line_number": 30, "usage_type": "call" }, { "api_name": "JK.file", "line_number": 30, "usage_type": "attribute" }, { "api_name": "multiprocessing.Pool", "line_number": 35, "usage_type": "call" } ]
2785949897
import sqlite3 import sys sys.path.append("C:\Source\Python\Advanced\movie-theater") from models.movie import * def create_connection(db_file): """ create a database connection to the SQLite database specified by db_file :param db_file: database file :return: Connection object or None """ ...
stemodev/movie-theater
db/SQLite.py
SQLite.py
py
3,108
python
en
code
0
github-code
2
[ { "api_name": "sys.path.append", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "sqlite3.connect", "line_number": 14, "usage_type": "call" } ]
29840947900
import typing import time import grpc import json import ftplib import pathlib from . import end_user_pb2 from . import end_user_pb2_grpc from ..types import TransferFile class Client: # def __init__(self, email: str, token_api: str, computing_server_addr: str, computing_server_port: str, file_server_addr: str, f...
chiral-data/chiral-client-python
chiral_client/client/__init__.py
__init__.py
py
5,163
python
en
code
0
github-code
22
[ { "api_name": "typing.List", "line_number": 14, "usage_type": "attribute" }, { "api_name": "typing.Tuple", "line_number": 14, "usage_type": "attribute" }, { "api_name": "grpc.insecure_channel", "line_number": 15, "usage_type": "call" }, { "api_name": "ftplib.FTP",...
22716246160
class Eta(): # Helps with tracking time of experiments, calculating ETA # from time of one subject x N subjects # Init class before starting data analysis, then update on each subject start def __init__(self, mode, N, print_eta=True, return_eta_str=True): import time as t ...
aleksandernitka/dwiprep
fun/eta.py
eta.py
py
3,055
python
en
code
0
github-code
2
[ { "api_name": "datetime.timedelta", "line_number": 20, "usage_type": "name" }, { "api_name": "datetime.datetime", "line_number": 21, "usage_type": "name" }, { "api_name": "statistics.mean", "line_number": 22, "usage_type": "name" }, { "api_name": "statistics.media...
17928837044
# two_spheres_normal_euler.py # unit test of normal2 force module # Sparisoma Viridi | https://github.com/dudung # 20230522 # 2054 Start this test. # 2122 Pass the test. from butiran.color2 import Color2 from butiran.math.vect3 import Vect3 from butiran.grain import Grain from butiran.force.normal2 import Normal2...
dudung/butiran
tests/motion/two_spheres_normal_euler.py
two_spheres_normal_euler.py
py
1,822
python
en
code
0
github-code
22
[ { "api_name": "butiran.force.normal2.Normal2", "line_number": 20, "usage_type": "call" }, { "api_name": "butiran.grain.Grain", "line_number": 23, "usage_type": "call" }, { "api_name": "butiran.math.vect3.Vect3", "line_number": 24, "usage_type": "call" }, { "api_na...
73681793976
# -*- coding: utf-8 -*- from django import forms from django.contrib import admin from django.utils.safestring import mark_safe import jinja2 from ckeditor_uploader.widgets import CKEditorUploadingWidget from core.admin import (BaseAttrAdmin, CreateChangeMixinAdmin, PermissionsMixinAdmin, sav...
ego/pyblog
server/post/admin.py
admin.py
py
5,651
python
en
code
0
github-code
22
[ { "api_name": "django.forms.ModelForm", "line_number": 20, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 20, "usage_type": "name" }, { "api_name": "django.forms.CharField", "line_number": 21, "usage_type": "call" }, { "api_name": "djang...
16694328679
import logging import os logging.basicConfig(filename="log.txt") from tinydb import TinyDB, Query def fetch(projectId): db = TinyDB("project_dbs/" + projectId + ".json") from rules import rules from display_results import display_results from insert_entity import insert_entity from categories.firewalls import ad...
likescam/cs-suite_Cloud-Security-Suite
tools/G-Scout/fetch.py
fetch.py
py
3,456
python
en
code
1
github-code
2
[ { "api_name": "logging.basicConfig", "line_number": 4, "usage_type": "call" }, { "api_name": "tinydb.TinyDB", "line_number": 8, "usage_type": "call" }, { "api_name": "insert_entity.insert_entity", "line_number": 21, "usage_type": "call" }, { "api_name": "logging.e...
29914521978
import numpy as np import networkx as nx class Node(object): '''create a node ''' def __init__(self, name, conn=None): self.name = name self.conn = {} if conn is not None: self.conn.update(conn) node = [ Node("A", {"B":1,"C":1}), Node("B", {"A":1,"C":0}), Node("C", {"A":1,"B"...
lyffski/Algorithms
Graphology/main.py
main.py
py
1,771
python
en
code
1
github-code
2
[ { "api_name": "numpy.array", "line_number": 47, "usage_type": "call" }, { "api_name": "networkx.degree_centrality", "line_number": 65, "usage_type": "call" } ]
74341059247
from . import views from django.urls import path, include from django.conf import settings from django.conf.urls.static import static urlpatterns = [ path('accounts/', include('django.contrib.auth.urls')), path('dashboard/', views.dashboard, name='dashboard'), path('register/', views.register, name='regist...
amishdas0/KARYA
socialmedia/users/urls.py
urls.py
py
713
python
en
code
0
github-code
2
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.include", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path",...
71393122297
from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys import pwinput import time kullaniciAdi = input("kullanıcı adını gir: ") sifre = pwinput.pwinput(prompt='Şifre: ') kisi = input("Takipçilerini göndermek istediğiniz kişinin kullanıcı ad...
bayramcinar/instagramFollowersCheck
instagramfollowersCheck.py
instagramfollowersCheck.py
py
3,546
python
en
code
1
github-code
22
[ { "api_name": "pwinput.pwinput", "line_number": 9, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 15, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 15, "usage_type": "name" }, { "api_name": "selenium....
13001502144
import os import requests import json token = os.getenv('tele_token') method = 'getUpdates' # c9에서 telegram api 막음 ㅠㅠㅠ # url = "https://api.telegram.org/bot{}/{}".format(token,method) url = "https://api.hphk.io/telegram/bot{}/{}".format(token,method) res = requests.get(url).json() #딕셔너리에서 추출할때 괄호 확인 잘하기 []:리스트 {}:딕셔...
MunYoungKuk/Telegram
bot.py
bot.py
py
761
python
ko
code
0
github-code
2
[ { "api_name": "os.getenv", "line_number": 5, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 23, "usage_type": "call" } ]