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
31920261178
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Aug 4 14:59:16 2020 @author: Eric Chen, Graduate Center, City University of New York @contact: eric.clyang521@gmail.com """ import os os.chdir("/Users/eric/Desktop/paper_figure/solvation_free_energy/Tip3p_bulk") import numpy as np from gridData im...
EricChen521/small_mol_project_script
bulk_TSsix.py
bulk_TSsix.py
py
1,109
python
en
code
0
github-code
1
[ { "api_name": "os.chdir", "line_number": 13, "usage_type": "call" }, { "api_name": "gridData.Grid", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 47,...
73944536672
import neurals.data_generation_config as dgc import neurals.distancefield_utils as df import model.param as model_param import copy import numpy as np import open3d as o3d import os from scipy.spatial.transform import Rotation as scipy_rot import torch.utils.data # Each file correspond to a pointcloud class SmallData...
Ericcsr/synthesize_pregrasp
neurals/dataset.py
dataset.py
py
6,968
python
en
code
8
github-code
1
[ { "api_name": "torch.utils.data.utils", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.utils.data", "line_number": 13, "usage_type": "name" }, { "api_name": "open3d.io.read_point_cloud", "line_number": 23, "usage_type": "call" }, { "api_name"...
36694454341
from time import time import pennylane as qml from scipy.optimize import minimize import networkx as nx from .unitaries import ( hypercube_mixer, phase_shift, circulant_mixer, diagonal_pauli_decompose, complete_eigenvalues, ) def gen_graph(qubits, seed, prob = 0.25): # for smaller graphs, incr...
John-J-Tanner/Quantum_Benchmarking
pennylane/benchmark/qaoa_maxcut.py
qaoa_maxcut.py
py
7,745
python
en
code
1
github-code
1
[ { "api_name": "networkx.fast_gnp_random_graph", "line_number": 22, "usage_type": "call" }, { "api_name": "networkx.fast_gnp_random_graph", "line_number": 25, "usage_type": "call" }, { "api_name": "pennylane.Identity", "line_number": 49, "usage_type": "call" }, { "...
18379379442
from concurrent.futures import ThreadPoolExecutor from os.path import splitext from PIL import Image, ImageFile from tkinter.filedialog import * import os.path ImageFile.LOAD_TRUNCATED_IMAGES = True files = askopenfilenames() def convert_image(file): with Image.open(file) as im: output_path = s...
Genos-Noctua/Scripts
JPEG.py
JPEG.py
py
636
python
en
code
0
github-code
1
[ { "api_name": "PIL.ImageFile.LOAD_TRUNCATED_IMAGES", "line_number": 7, "usage_type": "attribute" }, { "api_name": "PIL.ImageFile", "line_number": 7, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number": 11, "usage_type": "call" }, { "api_name": "P...
6493966912
from msrest.service_client import ServiceClient from msrest import Configuration, Serializer, Deserializer from .version import VERSION from .operations.int_model_operations import IntModelOperations from . import models class AutoRestIntegerTestServiceConfiguration(Configuration): """Configuration for AutoRestIn...
testormoo/autorest.ansible
test/vanilla/Expected/AcceptanceTests/BodyInteger/fixtures/acceptancetestsbodyinteger/auto_rest_integer_test_service.py
auto_rest_integer_test_service.py
py
1,664
python
en
code
0
github-code
1
[ { "api_name": "msrest.Configuration", "line_number": 8, "usage_type": "name" }, { "api_name": "version.VERSION", "line_number": 24, "usage_type": "argument" }, { "api_name": "msrest.service_client.ServiceClient", "line_number": 43, "usage_type": "call" }, { "api_n...
16166437404
import mongoengine ROOT_URLCONF = 'parkkeeper.urls' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', } } MIDDLEWARE_CLASSES = [ 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middle...
telminov/django-park-keeper
test_settings.py
test_settings.py
py
1,121
python
en
code
4
github-code
1
[ { "api_name": "mongoengine.connect", "line_number": 42, "usage_type": "call" } ]
28410222567
from typing import Optional import unittest class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right class Solution: def __init__(self): self.global_max = float("-inf") def postOrderTraversal(self, root: Optiona...
teimurjan/leetcode
max-path-sum.py
max-path-sum.py
py
1,353
python
en
code
0
github-code
1
[ { "api_name": "typing.Optional", "line_number": 16, "usage_type": "name" }, { "api_name": "unittest.TestCase", "line_number": 36, "usage_type": "attribute" }, { "api_name": "unittest.main", "line_number": 56, "usage_type": "call" } ]
6668321784
import math from argparse import ArgumentParser from datetime import timedelta as delta import numpy as np import pytest from parcels import ( AdvectionEE, AdvectionRK4, AdvectionRK45, FieldSet, JITParticle, ParticleSet, ScipyParticle, Variable, timer, ) ptype = {'scipy': ScipyPar...
OceanParcels/parcels
docs/examples/example_stommel.py
example_stommel.py
py
8,324
python
en
code
250
github-code
1
[ { "api_name": "parcels.ScipyParticle", "line_number": 20, "usage_type": "name" }, { "api_name": "parcels.JITParticle", "line_number": 20, "usage_type": "name" }, { "api_name": "parcels.AdvectionRK4", "line_number": 21, "usage_type": "name" }, { "api_name": "parcel...
74579624992
"""empty message Revision ID: 88f77742bc2d Revises: Create Date: 2017-07-03 13:15:12.714598 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '88f77742bc2d' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands auto gene...
cokifigue/validateMe
migrations/versions/88f77742bc2d_.py
88f77742bc2d_.py
py
852
python
en
code
3
github-code
1
[ { "api_name": "alembic.op.create_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy.Integ...
40270074978
#!/usr/bin/python3 import os import argparse import time import urllib.request import email.mime.text import socket import getpass import subprocess def lookup_mac_vendor(mac_address): result = "" if mac_address: for i in range(3): vendor = None try: # Only firs...
cheretbe/notes
files/dhcp/on_dhcp_lease.py
on_dhcp_lease.py
py
3,273
python
en
code
3
github-code
1
[ { "api_name": "urllib.request.request.urlopen", "line_number": 20, "usage_type": "call" }, { "api_name": "urllib.request.request", "line_number": 20, "usage_type": "attribute" }, { "api_name": "urllib.request", "line_number": 20, "usage_type": "name" }, { "api_nam...
11737051293
from flask import jsonify, render_template from app.device import bp, device from app.models import DeviceModel, Project @bp.route('/devices', methods=['GET', 'POST']) def devices(): connected = device.get_devices() registered = DeviceModel.query.all() return render_template('device/devices.html', title='...
johndoe-dev/Ecodroid
app/device/routes.py
routes.py
py
660
python
en
code
0
github-code
1
[ { "api_name": "app.device.device.get_devices", "line_number": 8, "usage_type": "call" }, { "api_name": "app.device.device", "line_number": 8, "usage_type": "name" }, { "api_name": "app.models.DeviceModel.query.all", "line_number": 9, "usage_type": "call" }, { "api...
552195300
import pandas as pd import tqdm import numpy as np import codecs import glob from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.metrics import accuracy_score, f1_score from sklearn.linear_model import LogisticRegression import random import matplotlib.pyplot as plt import sys from sklearn import p...
terne/thesis
logreg_experiments/old/all_data_logistic_regression.py
all_data_logistic_regression.py
py
10,456
python
en
code
0
github-code
1
[ { "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": "codecs.open", "li...
44976337574
# -*- codeing = utf-8 -*- # @Time : 2021/5/9 21:41 # @File :校内赛识别图形最终版本.py # @Software : PyCharm import cv2 as cv def detectShape(img): # 查找轮廓,cv2.RETR_ExTERNAL=获取外部轮廓点, CHAIN_APPROX_NONE = 得到所有的像素点 contours, hierarchy = cv.findContours(img, cv.RETR_EXTERNAL, cv.CHAIN_APPROX_NONE) # 循环轮廓,判断每一个形状...
ChangYu-beginner/The-visual-program
校内赛识别图形最终版本.py
校内赛识别图形最终版本.py
py
3,663
python
en
code
1
github-code
1
[ { "api_name": "cv2.findContours", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.RETR_EXTERNAL", "line_number": 10, "usage_type": "attribute" }, { "api_name": "cv2.CHAIN_APPROX_NONE", "line_number": 10, "usage_type": "attribute" }, { "api_name": "cv...
27031089250
from win10toast import ToastNotifier import feedparser import time toaster = ToastNotifier() def getNews(): url = "https://www.youm7.com/rss/SectionRss?SectionID=203" #url rss feed = feedparser.parse("https://www.youm7.com/rss/SectionRss?SectionID=203") #Get all feed from rss for item in feed["entries"]:...
peterramsis/RssNotify
main.py
main.py
py
514
python
en
code
0
github-code
1
[ { "api_name": "win10toast.ToastNotifier", "line_number": 4, "usage_type": "call" }, { "api_name": "feedparser.parse", "line_number": 9, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 15, "usage_type": "call" } ]
38033746083
import numpy as np import pandas as pd import pickle from flask import Flask ,app ,request ,jsonify ,render_template ,url_for app=Flask(__name__) reg_model=pickle.load(open('regm.pkl','rb')) #load regression model scaler=pickle.load(open('scale.pkl','rb')) #load scaling model @app.route('/') def home()...
sanchayvashist/boston_house
app.py
app.py
py
1,532
python
en
code
0
github-code
1
[ { "api_name": "flask.app", "line_number": 5, "usage_type": "name" }, { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 6, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 7, ...
6712255038
import curses import math import sys import logging as log from pprint import pformat class Menu: DIRECTION_UP = 'UP' DIRECTION_DOWN = 'DOWN' def __init__(self, layout, border=True): self.win = curses.newwin(layout[0], layout[1], ...
nadr0/branch-delete
menu.py
menu.py
py
7,999
python
en
code
2
github-code
1
[ { "api_name": "curses.newwin", "line_number": 13, "usage_type": "call" }, { "api_name": "curses.color_pair", "line_number": 104, "usage_type": "call" }, { "api_name": "math.ceil", "line_number": 145, "usage_type": "call" }, { "api_name": "math.ceil", "line_num...
10645242083
import tushare as ts import numpy as np import matplotlib.pyplot as plt import random import math import datetime import tushare as ts import pymysql import stock_one # p = stock_one.oneday('sh.600123', '20150102', '20210218') # print(p) # exit() starttime = '20170102' endtime = '20210218' all = [] a = ['SH.6002...
moon142857/TradeDoor
stock_all.py
stock_all.py
py
2,046
python
en
code
0
github-code
1
[ { "api_name": "datetime.date", "line_number": 23, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 24, "usage_type": "call" }, { "api_name": "pymysql.connect", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.array", "line_n...
3890081887
""" Created on Fri Nov 8 23:23:22 2019 @author: Pratiksha """ # app.py for Scara Web App from flask import Flask, render_template, request from data import Articles import cv2 from pyzbar import pyzbar app = Flask(__name__) Articles = Articles() S = [] @app.route('/') def index(): return ren...
PratikshaJain37/Scara-Hack36
app.py
app.py
py
1,492
python
en
code
1
github-code
1
[ { "api_name": "flask.Flask", "line_number": 14, "usage_type": "call" }, { "api_name": "data.Articles", "line_number": 16, "usage_type": "name" }, { "api_name": "flask.render_template", "line_number": 21, "usage_type": "call" }, { "api_name": "flask.render_template...
35131163454
''' The following codes are from https://github.com/d-li14/mobilenetv2.pytorch Some helper functions for PyTorch, including: - get_mean_and_std: calculate the mean and std value of dataset. - msr_init: net parameter initialization. - progress_bar: progress bar mimic xlua.progress. ''' import errno import o...
snudm-starlab/FALCON2
src/imagenetutils/misc.py
misc.py
py
2,761
python
en
code
40
github-code
1
[ { "api_name": "torch.utils.data.DataLoader", "line_number": 26, "usage_type": "call" }, { "api_name": "torch.utils", "line_number": 26, "usage_type": "attribute" }, { "api_name": "torch.zeros", "line_number": 28, "usage_type": "call" }, { "api_name": "torch.zeros"...
10155952607
import time import argparse import json import tqdm import torch import numpy as np import torch.nn.functional as F from sklearn.metrics import roc_auc_score, f1_score from model.model import Model from model.data import get_data_frames, create_graph, create_hetero_graph, create_data_loaders def train(model, optimize...
mbekmyrz/newsrec
main.py
main.py
py
12,722
python
en
code
1
github-code
1
[ { "api_name": "time.time", "line_number": 15, "usage_type": "call" }, { "api_name": "model.model.train", "line_number": 17, "usage_type": "call" }, { "api_name": "model.model", "line_number": 17, "usage_type": "name" }, { "api_name": "tqdm.tqdm", "line_number"...
36170840461
import logging from typing import List from volatility3.framework import renderers, exceptions, interfaces from volatility3.framework.configuration import requirements from volatility3.framework.interfaces import plugins from volatility3.framework.layers import intel vollog = logging.getLogger(__name__) class Stati...
volatilityfoundation/volatility3
volatility3/plugins/windows/statistics.py
statistics.py
py
3,720
python
en
code
1,879
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "volatility3.framework.interfaces.plugins.PluginInterface", "line_number": 12, "usage_type": "attribute" }, { "api_name": "volatility3.framework.interfaces.plugins", "line_number": 12, ...
33049652214
from django.shortcuts import render from trino.dbapi import connect from trino.auth import BasicAuthentication import pandas as pd from core.models import Item import numpy as np # Create your views here. conn = connect(host="tcp.cheerful-maggot.dataos.app", port="7432", auth=BasicAuthent...
ramesh-tmdc/sample
views.py
views.py
py
2,609
python
en
code
0
github-code
1
[ { "api_name": "trino.dbapi.connect", "line_number": 9, "usage_type": "call" }, { "api_name": "trino.auth.BasicAuthentication", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 20, "usage_type": "call" }, { "api_name": "pan...
42169327955
#! /usr/bin/env python3 import os import requests #List all the files in /supplier-data/descriptions for root, dirs, files in os.walk("./supplier-data/descriptions"): #Loop through the list of description files of fruits for file_name in files: with open(os.path.join(root,file_name)) as file: ...
peterncs/fruit
run.py
run.py
py
927
python
en
code
0
github-code
1
[ { "api_name": "os.walk", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "requests.post", "line_number": 19,...
15578279834
# ================================================================================ # This script instantiates the llm object with the relevant parameters # ================================================================================ from langchain.llms import CTransformers # Local CTransformers wrapper for Llama-2...
DeveshParagiri/sage
llm.py
llm.py
py
521
python
en
code
1
github-code
1
[ { "api_name": "langchain.llms.CTransformers", "line_number": 7, "usage_type": "call" } ]
18323604988
import aiohttp import urllib.parse as urlparse from typing import Optional from middleware.config import Settings from middleware.exception import MiddlewareException from middleware.external.base.application import Application as BaseApplication class Application(BaseApplication): @staticmethod async def _g...
chyaoyuan/data-sync-cdc
middleware/external/schema/application.py
application.py
py
1,365
python
en
code
0
github-code
1
[ { "api_name": "middleware.external.base.application.Application", "line_number": 10, "usage_type": "name" }, { "api_name": "aiohttp.ClientResponse", "line_number": 12, "usage_type": "attribute" }, { "api_name": "middleware.exception.MiddlewareException", "line_number": 15, ...
74692201954
#!/usr/bin/env python3 # # CLIMPORN # # Prepare 2D maps (monthly) that will later become a movie! # NEMO output and observations needed # # L. Brodeau, January 2019 # import sys import glob #import argparse as ap import numpy as nmp from PIL import Image # # ClimPorn: from climporn.utils import chck4f import...
brodeau/climporn
python/scripts/mk_image_montage_agrif.py
mk_image_montage_agrif.py
py
3,867
python
en
code
6
github-code
1
[ { "api_name": "glob.glob", "line_number": 58, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 59, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 63, "usage_type": "call" }, { "api_name": "climporn.utils.chck4f", "line_number...
32394088452
import csv from face import Face data = csv.DictReader(open("fer2013/fer2013.csv")) faces_train = [] faces_val = [] faces_test = [] for row in data: if row.get("Usage") == "Training": faces_train += [Face(row)] elif row.get("Usage") == "PublicTest": faces_val += [Face(row)] elif row.get("U...
eshawang/Facial-Expression-Analysis
format_data.py
format_data.py
py
439
python
en
code
1
github-code
1
[ { "api_name": "csv.DictReader", "line_number": 4, "usage_type": "call" }, { "api_name": "face.Face", "line_number": 11, "usage_type": "call" }, { "api_name": "face.Face", "line_number": 13, "usage_type": "call" }, { "api_name": "face.Face", "line_number": 15, ...
72263561954
"""create auth tables Revision ID: 6e0daa4be1f8 Revises: cb42b1c187d9 Create Date: 2019-09-26 09:17:12.642904 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '6e0daa4be1f8' down_revision = 'cb42b1c187d9' branch_labels = None depends_on = None def upgrade(): ...
best-doctor/its_on
db/migrations/versions/6e0daa4be1f8_create_auth_tables.py
6e0daa4be1f8_create_auth_tables.py
py
1,439
python
en
code
14
github-code
1
[ { "api_name": "alembic.op.create_table", "line_number": 20, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 20, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy.Integ...
37897987245
from flask import Flask from flask import request import urllib.request import re from requests_html import HTMLSession app = Flask(__name__) #Makes all responses plaintext @app.after_request def treat_as_plain_text(response): response.headers["content-type"] = "text/plain" return response @app.route('/') de...
ThatOneCamel/boxdScrape
_oldVersion/app.py
app.py
py
1,380
python
en
code
1
github-code
1
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.request.args.get", "line_number": 17, "usage_type": "call" }, { "api_name": "flask.request.args", "line_number": 17, "usage_type": "attribute" }, { "api_name": "flask.reque...
72307539555
from sklearn.preprocessing import normalize from sklearn.neighbors import NearestNeighbors from tqdm import tqdm import os import pickle from datetime import datetime if not os.path.exists("saves/crude_embeddings.pkl"): raise ValueError("Please run --process first to generate embeddings") else: with open("save...
finned-tech/MEIP
model/train.py
train.py
py
1,936
python
en
code
0
github-code
1
[ { "api_name": "os.path.exists", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pickle.load", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", ...
37798492039
import pathlib import numpy as np import pytest import meshio from . import helpers @pytest.mark.parametrize( "mesh", [ helpers.empty_mesh, helpers.tet_mesh, helpers.hex_mesh, helpers.tet_mesh, helpers.add_cell_sets(helpers.tet_mesh), ], ) @pytest.mark.parametriz...
nschloe/meshio
tests/test_flac3d.py
test_flac3d.py
py
1,540
python
en
code
1,691
github-code
1
[ { "api_name": "meshio.flac3d.write", "line_number": 26, "usage_type": "call" }, { "api_name": "meshio.flac3d", "line_number": 26, "usage_type": "attribute" }, { "api_name": "meshio.flac3d", "line_number": 27, "usage_type": "attribute" }, { "api_name": "pytest.mark...
29001110749
import pygame class playerProjectiles(pygame.sprite.Sprite): def __init__(self, x): super().__init__() self.entity = pygame.image.load("../assets/playerbullet.png").convert_alpha() self.rect = self.entity.get_rect() self.rect = self.rect.move(x.rect.left+29, x.rect.top-50) s...
wiltley/SpaceInvadersPyGame
scripts/bullet.py
bullet.py
py
1,196
python
en
code
0
github-code
1
[ { "api_name": "pygame.sprite", "line_number": 3, "usage_type": "attribute" }, { "api_name": "pygame.image.load", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pygame.transform....
35813740191
""" Distributor, Layout, Transform, and Transpose class definitions. """ import logging from mpi4py import MPI import numpy as np import itertools from collections import OrderedDict from ..tools.cache import CachedMethod, CachedAttribute from ..tools.config import config from ..tools.array import prod from ..tools.g...
DedalusProject/dedalus
dedalus/core/distributor.py
distributor.py
py
36,686
python
en
code
376
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "tools.config.config", "line_number": 17, "usage_type": "name" }, { "api_name": "tools.config.config", "line_number": 18, "usage_type": "name" }, { "api_name": "tools.confi...
30767921487
# -*- coding: utf-8 -*- from django.template import RequestContext from django.http import HttpResponseRedirect from django.contrib.auth import logout from django.http import HttpResponse, Http404 #from django.template import Context #from django.template.loader import get_template from django.contrib.auth.models impo...
meoooh/Bookmarks
bookmarks/views.py
views.py
py
9,930
python
en
code
0
github-code
1
[ { "api_name": "django.template.RequestContext", "line_number": 36, "usage_type": "call" }, { "api_name": "django.shortcuts.render_to_response", "line_number": 43, "usage_type": "call" }, { "api_name": "django.shortcuts.get_object_or_404", "line_number": 54, "usage_type": ...
19267862140
#!/usr/bin/python3 import argparse import sys def parse_file(f): grammar = { 'N': [], 'Sigma': [], 'S': 'S', 'P': [] } for i in range(3): line = f.readline() line = line.rstrip() idx = line.find(' = ') s = line[:idx] elements = lin...
mapaaa/rdp-generator
main.py
main.py
py
7,755
python
en
code
0
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 88, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 243, "usage_type": "call" } ]
74429573154
#!/usr/bin/env python import os, argparse, time import utils from keras.models import Sequential from keras.layers import Dense, Activation, Dropout from keras.layers import LSTM from keras.callbacks import ModelCheckpoint, ReduceLROnPlateau, TensorBoard from keras.optimizers import SGD, RMSprop, Adagrad, Adadelta, Ada...
brannondorsey/midi-rnn
train.py
train.py
py
10,546
python
en
code
154
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 14, "usage_type": "call" }, { "api_name": "argparse.ArgumentDefaultsHelpFormatter", "line_number": 15, "usage_type": "attribute" }, { "api_name": "keras.models.Sequential", "line_number": 65, "usage_type": "call" }...
10565279224
import pandas as pd import numpy as np import tensorflow as tf from datetime import datetime import statistics # connect to db import pymysql import sqlalchemy from sqlalchemy import create_engine # misc import random as rn from sklearn.model_selection import train_test_split #pipeline from sklearn.preprocessing impor...
HBNU-SWUNIV/COME-CAPSTONE22-dashboard
003 Code/autoEncoder/AE.py
AE.py
py
7,821
python
en
code
0
github-code
1
[ { "api_name": "mysql_auth.info", "line_number": 22, "usage_type": "attribute" }, { "api_name": "pymysql.connect", "line_number": 28, "usage_type": "call" }, { "api_name": "pandas.read_sql", "line_number": 34, "usage_type": "call" }, { "api_name": "pandas.to_numeri...
74227210594
import uos as os import lcd160cr import lcd160cr_test import pyb import utime as time import widgets from colors import * from utils import restore_framebuffer try: lcd = lcd160cr.LCD160CR('XY') except OSError: # I might have plugged in into the other side lcd = lcd160cr.LCD160CR('YX') lcd.set_pen(WHITE, ...
fragmuffin/howto-micropython
examples/lcd-demo/main.py
main.py
py
3,425
python
en
code
2
github-code
1
[ { "api_name": "lcd160cr.LCD160CR", "line_number": 12, "usage_type": "call" }, { "api_name": "lcd160cr.LCD160CR", "line_number": 15, "usage_type": "call" }, { "api_name": "widgets.Button", "line_number": 25, "usage_type": "call" }, { "api_name": "utils.screenshot",...
22448311010
import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output from app import app from apps import app_individual, app_aggregate app.layout = html.Div([ dcc.Location(id='url', refresh=False), html.Div(id='page-content') ]) index_page = html.Div([ dcc....
saeed349/Microservices-Based-Algorithmic-Trading-System-V-2.0
Storage/dash/index.py
index.py
py
901
python
en
code
38
github-code
1
[ { "api_name": "app.app.layout", "line_number": 8, "usage_type": "attribute" }, { "api_name": "app.app", "line_number": 8, "usage_type": "name" }, { "api_name": "dash_html_components.Div", "line_number": 8, "usage_type": "call" }, { "api_name": "dash_core_component...
30826854011
from http import HTTPStatus from typing import Dict from aiohttp import web from aiohttp.web import Request, Response, json_response from botbuilder.core import ( BotFrameworkAdapterSettings, ConversationState, MemoryStorage, UserState, ) from botbuilder.core.integration import aiohttp_error_middleware...
Sako74/p10
P10_03_chatbot/webapp/app.py
app.py
py
4,282
python
en
code
0
github-code
1
[ { "api_name": "config.DefaultConfig", "line_number": 29, "usage_type": "call" }, { "api_name": "botbuilder.core.BotFrameworkAdapterSettings", "line_number": 33, "usage_type": "call" }, { "api_name": "botbuilder.core.MemoryStorage", "line_number": 36, "usage_type": "call" ...
1538771716
import logging import numpy as np from src.MiniProjects.Maze.Maze import Maze __author__ = 'frank.ma' logger = logging.getLogger(__name__) class MazeSolver(object): MOVES = dict(N=(-1, 0), W=(0, 1), S=(1, 0), E=(0, -1)) found_solution = False def __init__(self, maze: Maze): s...
frankma/Finance
src/MiniProjects/Maze/MazeSolver.py
MazeSolver.py
py
1,299
python
en
code
0
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "src.MiniProjects.Maze.Maze.Maze", "line_number": 17, "usage_type": "name" }, { "api_name": "numpy.zeros", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.ch...
892004178
import sqlite3 import csv get_sql = """ DELETE FROM 'table_fees' WHERE truck_number = ? AND timestamp = ? """ def delete_wrong_fees(cursor: sqlite3.Cursor, wrong_fees_file: str) -> None: with open(f'../{wrong_fees_file}') as csvfile: spamreader = csv.reader(csvfile, delimiter=',') for ...
BogdanNos/PythonNosinovskiy
mod13/task2/task2.py
task2.py
py
553
python
en
code
0
github-code
1
[ { "api_name": "sqlite3.Cursor", "line_number": 11, "usage_type": "attribute" }, { "api_name": "csv.reader", "line_number": 13, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 18, "usage_type": "call" } ]
30407259914
from fastapi import FastAPI from controllers.routes import router from services.services import download_and_load_data, download_and_load, clear_db_data from apscheduler.schedulers.background import BackgroundScheduler def poll_and_load_datasets_again(): clear_db_data() download_and_load_data() app = FastAP...
A-G-U-P-T-A/LoopApi
main.py
main.py
py
684
python
en
code
0
github-code
1
[ { "api_name": "services.services.clear_db_data", "line_number": 8, "usage_type": "call" }, { "api_name": "services.services.download_and_load_data", "line_number": 9, "usage_type": "call" }, { "api_name": "fastapi.FastAPI", "line_number": 12, "usage_type": "call" }, {...
32858455165
import mysql.connector import random import tabulate class Db_connection: def __init__(self): self.connection=mysql.connector.connect(host='localhost', user='root', password='123134', ...
vjkmr0898/programs
programs/clothing.py
clothing.py
py
9,958
python
en
code
0
github-code
1
[ { "api_name": "mysql.connector.connector.connect", "line_number": 6, "usage_type": "call" }, { "api_name": "mysql.connector.connector", "line_number": 6, "usage_type": "attribute" }, { "api_name": "mysql.connector", "line_number": 6, "usage_type": "name" }, { "api...
30951274678
"""Main module.""" import os from datetime import datetime import numpy as np from scipy.optimize import least_squares import click import matplotlib.pyplot as plt from geometric_calibration.reader import ( read_img_label_file, read_projection_hnc, read_projection_raw, ) from geometric_calibration.utils ...
mrossi93/geometric_calibration
geometric_calibration/geometric_calibration.py
geometric_calibration.py
py
18,359
python
en
code
4
github-code
1
[ { "api_name": "os.path.join", "line_number": 45, "usage_type": "call" }, { "api_name": "os.path", "line_number": 45, "usage_type": "attribute" }, { "api_name": "geometric_calibration.reader.read_img_label_file", "line_number": 46, "usage_type": "call" }, { "api_na...
40091316327
import torchvision from torchvision import transforms from torch.utils import data def load_data_fashion_mnist(batch_size, resize=None, workers=4): """ 自动下载FashionMNIST数据集,并返回数据加载器 """ trans = [transforms.ToTensor()] if resize: trans.insert(0, transforms.Resize(resize)) trans = tran...
huangluyao/simple_network
simple_network/dataset/load_data.py
load_data.py
py
1,177
python
en
code
0
github-code
1
[ { "api_name": "torchvision.transforms.ToTensor", "line_number": 9, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 9, "usage_type": "name" }, { "api_name": "torchvision.transforms.Resize", "line_number": 11, "usage_type": "call" }, { ...
15043765898
from typing import List, Tuple import pathlib import copy import numpy as np import networkx as nx from tqdm.auto import tqdm from defdap import ebsd from defdap.quat import Quat from beta_reconstruction.crystal_relations import ( unq_hex_syms, hex_syms, unq_cub_syms, burg_trans ) def calc_beta_oris(alpha_ori: ...
LightForm-group/beta-reconstruction
beta_reconstruction/reconstruction.py
reconstruction.py
py
25,051
python
en
code
1
github-code
1
[ { "api_name": "defdap.quat.Quat", "line_number": 16, "usage_type": "name" }, { "api_name": "beta_reconstruction.crystal_relations.unq_hex_syms", "line_number": 33, "usage_type": "name" }, { "api_name": "beta_reconstruction.crystal_relations.burg_trans", "line_number": 34, ...
26777282377
import math import torch import numpy as np from torch import autograd, optim from torch.distributions.multivariate_normal import MultivariateNormal import scipy.optimize from tqdm import tqdm def get_schedule(num, rad=4): if num == 1: return np.array([0.0, 1.0]) t = np.linspace(-rad, rad, num) s ...
Lucas-Florin/dais_np
src/neural_process/dais.py
dais.py
py
4,698
python
en
code
0
github-code
1
[ { "api_name": "numpy.array", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.min", "line_number": 1...
4247894925
from datetime import timedelta from airflow import DAG from airflow.models import Param from airflow.operators.dummy_operator import DummyOperator from common.operators.gce import ( StartGCEOperator, StopGCEOperator, CloneRepositoryGCEOperator, SSHGCEOperator, ) from common.utils import get_airflow_sch...
pass-culture/data-gcp
orchestration/dags/jobs/ml/algo_training_qpi.py
algo_training_qpi.py
py
9,855
python
en
code
2
github-code
1
[ { "api_name": "common.config.MLFLOW_BUCKET_NAME", "line_number": 43, "usage_type": "name" }, { "api_name": "common.config.ENV_SHORT_NAME", "line_number": 43, "usage_type": "name" }, { "api_name": "common.config.ENV_SHORT_NAME", "line_number": 47, "usage_type": "name" },...
6993276560
import numpy as np import matplotlib.pyplot as plt from scipy.integrate import odeint T = 200 h = 1e-2 t = np.arange(start=0, stop=T + h, step=h) bet, gam = 0.15, 1 / 50 # todo: zmienic poziej na randoma # S_pocz = np.random.uniform(0.7, 1) S_start = 0.8 I_start = 1 - S_start R_start = 0 N = S_start + I_start + R_sta...
Ukasz09/Machine-learning
SIR_Model_Spread_of_Disease/SIR.py
SIR.py
py
4,130
python
en
code
1
github-code
1
[ { "api_name": "numpy.arange", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.log", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.log", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 32, ...
9191488071
import numpy as np import os import argparse #import torch #import torch.nn as nn from sklearn.linear_model import LinearRegression import math import random from utils import * ''' def quantize(data,pred,error_bound): radius=32768 diff = data - pred quant_index = (int) (abs(diff)/ error_bound) + 1 ...
Meso272/NNpredictor
multilevel_selective_compress_2d_deprecated.py
multilevel_selective_compress_2d_deprecated.py
py
24,070
python
en
code
0
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 45, "usage_type": "call" }, { "api_name": "numpy.fromfile", "line_number": 73, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 73, "usage_type": "attribute" }, { "api_name": "numpy.copy"...
29920536522
from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QApplication, QMainWindow, QPushButton, QStackedWidget, QToolButton, QComboBox, \ QTableWidget, QTableWidgetItem, QLabel from PyQt5.uic import loadUi from fileDirectory import FileDirectory class Ui(QMainWindow): def __init__(self): supe...
lalocho/software2
src/PICK.py
PICK.py
py
9,213
python
en
code
0
github-code
1
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 8, "usage_type": "name" }, { "api_name": "PyQt5.uic.loadUi", "line_number": 11, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QStackedWidget", "line_number": 13, "usage_type": "argument" }, { "ap...
11646312135
from gtts import gTTS import wikipedia as wiki import sys bad_sections = ['See also', 'References', 'External links', 'Gallery'] # removes the sections which wouldn't be useful in these formats def remove_extra(page): new_sections = page.sections for x in bad_sections: if x in new_sections...
ajsebastian/audioWiki
main.py
main.py
py
2,238
python
en
code
0
github-code
1
[ { "api_name": "gtts.gTTS", "line_number": 56, "usage_type": "call" }, { "api_name": "wikipedia.page", "line_number": 62, "usage_type": "call" }, { "api_name": "wikipedia.summary", "line_number": 63, "usage_type": "call" } ]
23048697587
import torch from torchvision import transforms as T from torch.optim.lr_scheduler import ExponentialLR from PIL import Image import os from tqdm import tqdm from dalle2_pytorch import DALLE2, DiffusionPriorNetwork, DiffusionPrior, Unet, Decoder, OpenAIClipAdapter, DiffusionPriorTrainer, DecoderTrainer from dall...
goldiusleonard/Dalle2_pytorch_project
train_dalle2_from_csv.py
train_dalle2_from_csv.py
py
7,138
python
en
code
4
github-code
1
[ { "api_name": "torchvision.transforms.Compose", "line_number": 39, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 39, "usage_type": "name" }, { "api_name": "torchvision.transforms.Lambda", "line_number": 40, "usage_type": "call" }, { ...
26275998182
import json from http.server import HTTPServer, BaseHTTPRequestHandler from multiprocessing import active_children, Process ''' 大致原理,程序启动后,会在本地开启一个http服务。Tkinter布局助手上,点击预览后,将拖拽界面的布局转为python代码, 通过网络请求,发送到本服务,服务端接收到代码,使用exec函数执行代码。 因为exec函数,有一定危险性,如果你使用的是fork的项目,请自行检查代码后再执行。官方下载地址如下。 官方地址:https://www.pytk.net/tkinter-...
iamxcd/tkinter-helper
preview/preview-1.0.0.py
preview-1.0.0.py
py
1,855
python
en
code
408
github-code
1
[ { "api_name": "http.server.BaseHTTPRequestHandler", "line_number": 21, "usage_type": "name" }, { "api_name": "json.dumps", "line_number": 28, "usage_type": "call" }, { "api_name": "multiprocessing.active_children", "line_number": 36, "usage_type": "call" }, { "api...
28921295761
import pandas as pd import random as rd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import matplotlib.cm as cm import pickle import random import math class neuron: def __init__(self,weights): self.weights = weights self.outputneuron=None self.s=...
MeryemEssalmi/Adaptive-Neural-Network-from-scrach
Neural Network code.py
Neural Network code.py
py
11,523
python
en
code
0
github-code
1
[ { "api_name": "random.random", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 21, "usage_type": "call" }, { "api_name": "math.exp", "line_number": 28, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 49, ...
25191930876
from pytablewriter import MarkdownTableWriter def readCustomVCF(fname, keep_cols): data = [] with open(fname, 'r') as vcf: for line in vcf: # skip the header specification part if line.startswith('##'): continue # get the header line but only keep the...
W-L/ProblematicSites_SARS-CoV2
src/vcf2markdown.py
vcf2markdown.py
py
2,381
python
en
code
45
github-code
1
[ { "api_name": "pytablewriter.MarkdownTableWriter", "line_number": 34, "usage_type": "call" } ]
38918987427
from django.shortcuts import render , redirect from django.contrib.auth import login from django.contrib.auth.forms import UserCreationForm def register(request): #регаем нового юзверя if request.method != 'POST': #вывод пустой формы реги form=UserCreationForm() else: #Обр...
Master-sniffer/Learning-PYTHON-
Book_1/Django/Scripts/users/views.py
views.py
py
973
python
ru
code
1
github-code
1
[ { "api_name": "django.contrib.auth.forms.UserCreationForm", "line_number": 9, "usage_type": "call" }, { "api_name": "django.contrib.auth.forms.UserCreationForm", "line_number": 12, "usage_type": "call" }, { "api_name": "django.contrib.auth.login", "line_number": 17, "usag...
40531959843
"""序列化""" import json """JSON 如果我们要在不同的编程语言之间传递对象,就必须把对象序列化为标准格式,比如XML, 但更好的方法是序列化为JSON,因为JSON表示出来就是一个字符串,可以被所有语言读取, 也可以方便地存储到磁盘或者通过网络传输。 JSON不仅是标准格式,并且比XML更快,而且可以直接在Web页面中读取,非常方便。 JSON表示的对象就是标准的JavaScript语言的对象,JSON和Python内置的数据类型对应如下:""" """JSON类型 Python类型 {} dict [] list "string" str 1234.56 ...
zongrh/untitled_python3
python_io/python_serialize.py
python_serialize.py
py
2,229
python
zh
code
1
github-code
1
[ { "api_name": "json.dumps", "line_number": 20, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 25, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 45, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 52, ...
27516911233
# -*- coding:UTF-8 -*- def get_auth_url(): weibo_auth_url = 'https://api.weibo.com/oauth2/authorize' redirect_url = 'http://127.0.0.1:8000/complete/weibo/' auth_url = weibo_auth_url+'?client_id={client_id}&redirect_uri={re_url}'.format(client_id=2113796513,re_url=redirect_url) print(auth_url) def ge...
yuansuixin/Django
apps/utils/weibo_login.py
weibo_login.py
py
1,282
python
en
code
1
github-code
1
[ { "api_name": "requests.post", "line_number": 14, "usage_type": "call" } ]
1706775488
from tkinter import * from enum import Enum ## WFrame 창의 처음 위치를 나타내는 열거형 class StartPosition(Enum): default = 0 centerScreen = 1 centerParent = 2 manual = 3 ## Windows Forms를 토대로 작성한 Frame # # http://effbot.org/tkinterbook/ class WFrame(Frame): ## 제목 표시줄에 표시할 제목 # @var string t...
sunghwan2789/EnglishTypingPractice
wframe.py
wframe.py
py
3,692
python
ko
code
1
github-code
1
[ { "api_name": "enum.Enum", "line_number": 5, "usage_type": "name" } ]
20782775994
import os import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from .utils import download_file_from_gdrive # mapping network ################# def pixel_norm(x, epsilon=1e-8): return x * torch.rsqrt(torch.mean(torch.pow(x, 2), dim=1, keepdim=True) + epsilon) class MappingNetwo...
tanelp/neural-obfuscator
neural_obfuscator/stylegan.py
stylegan.py
py
12,295
python
en
code
2
github-code
1
[ { "api_name": "torch.rsqrt", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.mean", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.pow", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.nn.Module", "line_number":...
17847187153
# -*- test-case-name: xquotient.test.historic.test_composer5to6 -*- """ Create stub database for upgrade of L{xquotient.compose.Composer} from version 5 to version 6. """ from axiom.test.historic.stubloader import saveStub from axiom.dependency import installOn from axiom.userbase import LoginMethod from xquotient.c...
rcarmo/divmod.org
Quotient/xquotient/test/historic/stub_composer5to6.py
stub_composer5to6.py
py
711
python
en
code
10
github-code
1
[ { "api_name": "axiom.userbase.LoginMethod", "line_number": 21, "usage_type": "call" }, { "api_name": "axiom.dependency.installOn", "line_number": 24, "usage_type": "call" }, { "api_name": "xquotient.compose.Composer", "line_number": 24, "usage_type": "call" }, { "...
38914409041
# python dictonary file from difflib import get_close_matches from json import load #import tkinter as tk from tkinter import * # loading dictionary to memory file = open('data.json', 'r') data = load(file) file.close() # fuction declaration def translate(): output.delete(0, END) w = entry_key.get() w ...
rinkeshsante/ExperimentsBackup
Python Project Dictionary/app_GUI.py
app_GUI.py
py
1,797
python
en
code
0
github-code
1
[ { "api_name": "json.load", "line_number": 10, "usage_type": "call" }, { "api_name": "difflib.get_close_matches", "line_number": 25, "usage_type": "call" } ]
20192619756
import pprint from urllib import request import requests import pandas as pd from _kluce import * movie_id = 551 api_version = 3 api_base_url = f"https://api.themoviedb.org/{api_version}" endpoint_path = f"/search/movie" search_query = "Matrix" endpoint = f"{api_base_url}{endpoint_path}?api_key={api_key}&query={sear...
eavf/30-days
Day132/connect.py
connect.py
py
1,293
python
en
code
0
github-code
1
[ { "api_name": "requests.get", "line_number": 16, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 38, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 44, "usage_type": "call" } ]
71975828513
#!/usr/bin/env python3 import time from pyftdi.spi import SpiController from pycrc.algorithms import Crc # --------------------------------------------------------------------------- # DSI utilities # --------------------------------------------------------------------------- EOTP = [ 0x08, 0x0f, 0x0f, 0x01 ] DSI...
esden/icebreaker-temp
nano-pmod-up5k/control.py
control.py
py
4,883
python
en
code
3
github-code
1
[ { "api_name": "pycrc.algorithms.Crc", "line_number": 15, "usage_type": "call" }, { "api_name": "pyftdi.spi.SpiController", "line_number": 80, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 101, "usage_type": "call" }, { "api_name": "time.sleep"...
73206785314
"""Support for HomeSeer light-type devices.""" import asyncio import logging from typing import Any from homeassistant.components.light import ( ToggleEntity, LightEntity ) from homeassistant.const import ( CONF_NAME, STATE_ON, STATE_OFF ) from .command import (turn_off, turn_light_up) _LOGGER = logging.getL...
ettingshausen/hass-micoe-bath-heater
custom_components/micoe_bath_light/light.py
light.py
py
1,252
python
en
code
0
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "homeassistant.const.CONF_NAME", "line_number": 24, "usage_type": "argument" }, { "api_name": "homeassistant.components.light.LightEntity", "line_number": 32, "usage_type": "name" ...
35253854263
import pymongo import yfinance as yf from pymongo import collection from .stock_price import get_stock_price import os CLIENT = pymongo.MongoClient("mongodb+srv://App:ZU5u0b56vYc7xY15@stockopositions.r5bip.mongodb.net/StockoPositions?retryWrites=true&w=majority") DB = CLIENT.test USER_COLLECTION = DB.get_collection('d...
Asetka/Stocko
backend_api/backend_processing/db_wrapper.py
db_wrapper.py
py
6,000
python
en
code
0
github-code
1
[ { "api_name": "pymongo.MongoClient", "line_number": 7, "usage_type": "call" }, { "api_name": "yfinance.Ticker", "line_number": 116, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 123, "usage_type": "call" }, { "api_name": "stock_price.get_stock_...
5579649281
import keyboard from time import time from communication.bt_server import BT_Server from communication.KEYBOARD_CONFIG import KEYBOARD_CONFIG_DICT, DEBOUNCE_INTERVAL from communication.BT_CONFIG import BT_CONTROLLER_DICT def graceful_exit(func): def wrapper(*args, **kw_args): try: return func...
ankitasharma1/swarmbots
raft/controller.py
controller.py
py
3,093
python
en
code
0
github-code
1
[ { "api_name": "communication.KEYBOARD_CONFIG.DEBOUNCE_INTERVAL", "line_number": 26, "usage_type": "name" }, { "api_name": "communication.KEYBOARD_CONFIG.KEYBOARD_CONFIG_DICT", "line_number": 33, "usage_type": "name" }, { "api_name": "communication.KEYBOARD_CONFIG.KEYBOARD_CONFIG_...
10821283659
import argparse import torch import torch.nn as nn from torch.utils import data import numpy as np from torch.autograd import Variable import torch.optim as optim import torch.backends.cudnn as cudnn import os import os.path as osp from multiframe3_CoAttentionSTN import FtoFAttentionModel import scipy.io as sio from Po...
sa867/CoAttentionSTN
train_CoAttentionSTN_temporal.py
train_CoAttentionSTN_temporal.py
py
17,381
python
en
code
1
github-code
1
[ { "api_name": "torch.device", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 18, "usage_type": "attribute" }, { "api_name": "torch.nn.BCELoss...
32174735176
import os import io import base64 import os.path from zipfile import ZipFile from odoo import api, fields, models from odoo.tools.safe_eval import safe_eval class ExportNfe(models.TransientModel): _name = 'wizard.export.nfe' _description = "Exporta NF-e" start_date = fields.Date(string="Data Inicial", re...
Trust-Code/odoo-brasil
l10n_br_eletronic_document/wizard/export_nfe.py
export_nfe.py
py
4,275
python
en
code
178
github-code
1
[ { "api_name": "odoo.models.TransientModel", "line_number": 10, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 10, "usage_type": "name" }, { "api_name": "odoo.fields.Date", "line_number": 14, "usage_type": "call" }, { "api_name": "odoo.fie...
6421783280
import datetime from flask import jsonify, request, Blueprint from flask_jwt import jwt_required, current_identity from flasgger.utils import swag_from from app.utils.utils import serialize, get_flag_by_id from app.utils.validate_redflag import Validate_redflag from app.models.redflag import Redflag from database.inci...
PatrickMugayaJoel/IReporter-Api
app/views/redflags.py
redflags.py
py
8,161
python
en
code
0
github-code
1
[ { "api_name": "flask.Blueprint", "line_number": 14, "usage_type": "call" }, { "api_name": "database.incidents_db.IncidentsDB", "line_number": 15, "usage_type": "call" }, { "api_name": "database.media_db.MediaDB", "line_number": 16, "usage_type": "call" }, { "api_n...
29674277875
import json from astar.astar import Astar from roblib.map import Map import numpy as np from roblib.datastructures import MoveCommand from roblib.datastructures import Coordinate from filetransfer import Filetransfer # Path JSON _PATH_LOCAL = "./path.json" _PATH_REMOTE = "/home/nao/.local/share/PackageManager/apps/Flo...
tschibu/hslu-roblab-floorguide
planner.py
planner.py
py
4,098
python
en
code
0
github-code
1
[ { "api_name": "roblib.map.Map", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 18, "usage_type": "call" }, { "api_name": "astar.astar.Astar", "line_number": 24, "usage_type": "call" }, { "api_name": "roblib.datastructures.Coo...
31929396338
# Standalone 1.5D distributed SpMM implementation # Largely borrowed from CAGNET import argparse import math import os import time import torch import torch.distributed as dist import torch.multiprocessing as mp from sparse_coo_tensor_cpp import spmm_gpu comp_time = dict() comm_time = dict() bcast_comm_time = dict(...
alokpathy/spmm
nccl_ex.py
nccl_ex.py
py
9,877
python
en
code
1
github-code
1
[ { "api_name": "torch.cuda.synchronize", "line_number": 25, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 25, "usage_type": "attribute" }, { "api_name": "time.time", "line_number": 28, "usage_type": "call" }, { "api_name": "torch.cuda.synchroni...
19444944835
"""The core module of this code base. Includes the agent, environment, and experiment APIs. """ import logging import sys import time from abc import ABCMeta, abstractmethod import numpy as np LOGGER = logging.getLogger('experiment') LOGGER.setLevel(logging.DEBUG) class Agent(metaclass=ABCMeta): """An abstr...
christopher-wolff-zz/lab-old
lab/core.py
core.py
py
9,902
python
en
code
0
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 16, "usage_type": "attribute" }, { "api_name": "abc.ABCMeta", "line_number": 19, "usage_type": "name" }, { "api_name": "abc.abstractmethod",...
19078811720
from django.shortcuts import render from django.http import HttpResponseRedirect from django.db.models import Q from django.urls import reverse_lazy from django.views.generic import ListView from applications.Producto.models import ProductoServicio from applications.PaginaVenta.models import Suscripciones from applicat...
jhonny212/portalventas
applications/Compra/views.py
views.py
py
3,549
python
es
code
0
github-code
1
[ { "api_name": "django.views.generic.ListView", "line_number": 12, "usage_type": "name" }, { "api_name": "applications.Compra.models.Detalle", "line_number": 13, "usage_type": "name" }, { "api_name": "applications.Compra.models.Detalle.objects.get_carrito", "line_number": 21, ...
26514033503
from multiprocessing import Process, Value, RLock import time start = time.time() numa = Value('i', 0) numb = Value('i', 0) rlock = RLock() def do_sth(): """ """ """ rlock.acquire() try: adda() addb() finally: rlock.release() """ with rlock: for i in rang...
hemuke/python
17_process_thread/31_1_multiprocess_rlock.py
31_1_multiprocess_rlock.py
py
1,027
python
en
code
0
github-code
1
[ { "api_name": "time.time", "line_number": 4, "usage_type": "call" }, { "api_name": "multiprocessing.Value", "line_number": 6, "usage_type": "call" }, { "api_name": "multiprocessing.Value", "line_number": 7, "usage_type": "call" }, { "api_name": "multiprocessing.RL...
27168642483
# Databricks notebook source # MAGIC %pip install git+https://github.com/rafa-arana/fire.git # COMMAND ---------- # MAGIC %md # MAGIC --- # MAGIC + <a href="$./00.DLT-SAN-Setup">STAGE 0</a>: Setup # MAGIC + <a href="$./00.DLT-SAN-File Ingestion with Autoloader">STAGE 0 bis</a>: File Ingestion with Autoloader # MAGIC ...
rafa-arana/dlt-regulatory-reporting
01.DLT-SAN-Autoloader-template.py
01.DLT-SAN-Autoloader-template.py
py
5,618
python
en
code
0
github-code
1
[ { "api_name": "fire.spark.FireModel", "line_number": 88, "usage_type": "call" }, { "api_name": "dlt.table", "line_number": 95, "usage_type": "call" }, { "api_name": "dlt.read_stream", "line_number": 131, "usage_type": "call" }, { "api_name": "dlt.table", "line...
74229119712
from typing import List class Solution: def eraseOverlapIntervals(self, intervals: List[List[int]]) -> int: intervals.sort() res = 0 prevEnd = intervals[0][1] for start, end in intervals[1:]: if start >= prevEnd: prevEnd = end else: ...
TimHung000/leetcode
0435_nonOverlappingIntervals/main.py
main.py
py
450
python
en
code
0
github-code
1
[ { "api_name": "typing.List", "line_number": 4, "usage_type": "name" } ]
6377740088
#!/usr/bin/env python # -*- coding: utf-8 -*- # *************************************************************************** # Copyright (c) 2018 西安交通大学 # All rights reserved # # 文件名称:Mayavi_test.py # # 摘 要:数据可视化mayavi库测试文件 # # 创 建 者:上官栋栋 # # 创建日期:2018年11月9日 # # 修改记录 # 日期 修改者 版本 修改内容 # --...
sgdd66/Optimization-under-Constraint
Mayavi_test.py
Mayavi_test.py
py
18,371
python
en
code
0
github-code
1
[ { "api_name": "tvtk.tools.tvtk_doc.main", "line_number": 33, "usage_type": "call" }, { "api_name": "tvtk.tools.tvtk_doc", "line_number": 33, "usage_type": "name" }, { "api_name": "tvtk.api.tvtk.CubeSource", "line_number": 37, "usage_type": "call" }, { "api_name": ...
22452873346
import matplotlib.pyplot as plt import numpy as np import pandas as pd from sklearn import tree, ensemble from sklearn.model_selection import cross_val_score from sklearn.datasets import load_breast_cancer from sklearn.model_selection import KFold from sklearn.tree import plot_tree from sklearn.model_selection import t...
ken-100/edX
MachineLearning/HW01_DecisionTree_Cross-Validation.py
HW01_DecisionTree_Cross-Validation.py
py
6,116
python
en
code
0
github-code
1
[ { "api_name": "sklearn.datasets.load_breast_cancer", "line_number": 17, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 18, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 20, "usage_type": "call" }, { "api_name": ...
39674393133
import logging import csv import re from . import Indicator from ..interfaces import CountryPolyInterface class WebsiteIndicator(Indicator): """ Indicator which detects the TLD of the website in the users profile and maps it to an area. Note: domains such as .com, .net and .org are ignored, and only coun...
Humpheh/twied
src/twied/multiind/indicators/websiteindicator.py
websiteindicator.py
py
1,626
python
en
code
11
github-code
1
[ { "api_name": "interfaces.CountryPolyInterface", "line_number": 24, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 29, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 34, "usage_type": "call" }, { "api_name": "logging.debug",...
26055383293
import json import torch import yaml from torch.utils.data import DataLoader from torchvision.transforms import transforms from tqdm import tqdm from src.data.tooth_dataset import ToothDataset from src.model.vgg.vgg import Vgg from src.utils.transforms import SquarePad if __name__ == "__main__": with open("./src...
tudordascalu/2d-teeth-detection-challenge
src/model/vgg/scripts/predict.py
predict.py
py
2,508
python
en
code
2
github-code
1
[ { "api_name": "yaml.safe_load", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.device", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.cuda", ...
42595708920
from typing import Any, Dict from django.contrib.auth.mixins import PermissionRequiredMixin from .exceptions import UnfoldException class UnfoldModelAdminViewMixin(PermissionRequiredMixin): """ Prepares views to be displayed in admin """ def get_context_data(self, **kwargs) -> Dict[str, Any]: ...
unfoldadmin/django-unfold
src/unfold/views.py
views.py
py
708
python
en
code
506
github-code
1
[ { "api_name": "django.contrib.auth.mixins.PermissionRequiredMixin", "line_number": 8, "usage_type": "name" }, { "api_name": "exceptions.UnfoldException", "line_number": 15, "usage_type": "call" }, { "api_name": "typing.Dict", "line_number": 13, "usage_type": "name" }, ...
21372179198
from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from webdriver_manager.chrome import ChromeDriverManager from selenium.webdriver.chrome.options import Options ...
pdatlab/urology_journal_retriever
JournalGrabber.py
JournalGrabber.py
py
5,308
python
en
code
0
github-code
1
[ { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 16, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 16, "usage_type": "name" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 20, "usage_type": "call" }, { "api...
42500434502
from django.urls import path from . import views app_name = 'polls' urlpatterns = [ # polls的首页 path('', views.IndexView.as_view(), name='index'), # 显示第三个问题的内容,例如: /polls/2/ path('<int:pk>/', views.DetailView.as_view(), name='detail'), # 显示第三个问题的内容回答,例如:: /polls/2/results/ path('<int:p...
cybercampus/mysite-polls
polls/urls.py
urls.py
py
571
python
zh
code
0
github-code
1
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 11, "usage_type": "call" }, { "api_name": "django.urls.path", ...
31851582700
import pprint import re # noqa: F401 import six from asposeslidescloud.models.math_element import MathElement class BorderBoxElement(MathElement): """ Attributes: swagger_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): ...
aspose-slides-cloud/aspose-slides-cloud-python
asposeslidescloud/models/border_box_element.py
border_box_element.py
py
10,885
python
en
code
0
github-code
1
[ { "api_name": "asposeslidescloud.models.math_element.MathElement", "line_number": 8, "usage_type": "name" }, { "api_name": "six.iteritems", "line_number": 284, "usage_type": "call" }, { "api_name": "pprint.pformat", "line_number": 306, "usage_type": "call" } ]
183727253
import cv2 import numpy as np import os import svgwrite # load image, change color spaces, and smoothing img = cv2.imread(os.path.dirname(os.path.abspath(__file__))+"/INIAD_logo.png") im=cv2.resize(img,(10000,10000)) im_gray = cv2.cvtColor(im, cv2.COLOR_BGR2GRAY) retval, im_bw = cv2.threshold(im_gray, 0, 255, cv2.THR...
s1F101900723/CG
CG_python/11/11-5_4.py
11-5_4.py
py
2,421
python
en
code
0
github-code
1
[ { "api_name": "cv2.imread", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_numb...
30332025823
from pathlib import Path import shutil CURRENT = Path(__file__).resolve().parent ConfPath = CURRENT / ".vscode" if ConfPath.exists(): shutil.rmtree(ConfPath) ConfPath.mkdir() tasks_conf = ConfPath / "tasks.json" if False: tasks_conf.write_text( """ { "version": "2.0.0", "tasks": [ { ...
soda92/external_sorting
generate_vscode_files.py
generate_vscode_files.py
py
2,338
python
en
code
0
github-code
1
[ { "api_name": "pathlib.Path", "line_number": 4, "usage_type": "call" }, { "api_name": "shutil.rmtree", "line_number": 7, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 34, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": ...
38940929836
import functools import io import json import logging import mimetypes import os.path import re import shutil import urllib.parse from typing import Dict, Type, TextIO import yaml from swagger_ui_bundle import swagger_ui_3_path # type: ignore[import] from werkzeug import Response from werkzeug.exceptions import HTTPE...
superbjorn09/checkmk
cmk/gui/wsgi/applications/rest_api.py
rest_api.py
py
9,052
python
en
code
null
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 31, "usage_type": "call" }, { "api_name": "typing.Dict", "line_number": 33, "usage_type": "name" }, { "api_name": "typing.Type", "line_number": 33, "usage_type": "name" }, { "api_name": "cmk.gui.exceptions.MKUserEr...
57138372
""" please place a file gmail_settings.py with two varialbes: GMAIL_ACCOUNT = "" GMAIL_PASSWORD = "" or set the environment variables GMAIL_ACCOUNT = "" GMAIL_PASSWORD = "" """ from settings import GMAIL_ACCOUNT, GMAIL_PASSWORD import smtplib from email.MIMEMultipart import MIMEMultipart from email.MIMEBase impo...
c3h3/gmaildotpy
gmail/gmail.py
gmail.py
py
2,382
python
en
code
1
github-code
1
[ { "api_name": "settings.GMAIL_ACCOUNT", "line_number": 26, "usage_type": "name" }, { "api_name": "settings.GMAIL_PASSWORD", "line_number": 26, "usage_type": "name" }, { "api_name": "smtplib.SMTP", "line_number": 31, "usage_type": "call" }, { "api_name": "email.MIM...
71571421794
from typing import Iterable, Optional def main(data: Iterable[str]): nums = [int(line) for line in data] num_set = set(nums) def search(num: int) -> Optional[int]: target = 2020 - num if target in num_set: return target return None while nums: num1 = nums....
Lexicality/advent-of-code
src/aoc/y2020/day1.py
day1.py
py
620
python
en
code
0
github-code
1
[ { "api_name": "typing.Iterable", "line_number": 4, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 8, "usage_type": "name" } ]
15685220785
from aiogram.dispatcher import Dispatcher, FSMContext from aiogram.types import CallbackQuery, Message from tgbot.misc import AddChannel from tgbot.models import Channels async def start_add_chanel(callback: CallbackQuery) -> None: await callback.message.edit_text('Отправте нам сылку на канал') await AddCha...
sardor86/something_telegram_bot
tgbot/handlers/admin/add_chanel.py
add_chanel.py
py
1,050
python
en
code
0
github-code
1
[ { "api_name": "aiogram.types.CallbackQuery", "line_number": 8, "usage_type": "name" }, { "api_name": "tgbot.misc.AddChannel.get_channel_url.set", "line_number": 11, "usage_type": "call" }, { "api_name": "tgbot.misc.AddChannel.get_channel_url", "line_number": 11, "usage_ty...
3898644156
import discord import random import os import csv import paralleldots from datetime import datetime import asyncio #please make you have installed the packages or just run on replit from discord_components import * from discord.ext.commands import bot from discord.utils import get from discord.ext import commands, task...
Limbo-Hacks/Mr-Limbo-bot
main.py
main.py
py
21,202
python
en
code
3
github-code
1
[ { "api_name": "discord.Intents.default", "line_number": 17, "usage_type": "call" }, { "api_name": "discord.Intents", "line_number": 17, "usage_type": "attribute" }, { "api_name": "discord.ext.commands.Bot", "line_number": 22, "usage_type": "call" }, { "api_name": ...
27400999130
from __future__ import annotations import itertools from abc import ABC, abstractmethod from collections import defaultdict from collections.abc import Iterable, Iterator from dataclasses import dataclass, field from typing import cast from cognite.client.data_classes import data_modeling as dm from cognite.client.da...
cognitedata/pygen
cognite/pygen/_core/data_classes.py
data_classes.py
py
31,015
python
en
code
2
github-code
1
[ { "api_name": "cognite.client.data_classes.data_modeling.Text", "line_number": 17, "usage_type": "attribute" }, { "api_name": "cognite.client.data_classes.data_modeling", "line_number": 17, "usage_type": "name" }, { "api_name": "cognite.client.data_classes.data_modeling.Boolean",...
12752730558
""" Convert the CSV file with the information of transfers into a directed graph that can be used for debugging. """ import pandas as pd import networkx as nx import matplotlib.pyplot as plt # Read CSV file csv_file = "../data/n_100_cifar10/transfers.csv" df = pd.read_csv(csv_file) # Create a directed graph G = nx.Di...
devos50/decentralized-learning
scripts/convert_transfers_to_graph.py
convert_transfers_to_graph.py
py
1,825
python
en
code
2
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "networkx.DiGraph", "line_number": 13, "usage_type": "call" }, { "api_name": "networkx.spring_layout", "line_number": 49, "usage_type": "call" }, { "api_name": "networkx.draw...
33427742555
from setuptools import setup, find_packages ######################################################################################################################## with open("README.rst", "r") as handler: LONG_DESC = handler.read() setup( author="Shapelets.io", author_email="dev@shapelets.io", name=...
shapelets/khiva-python
setup.py
setup.py
py
533
python
de
code
46
github-code
1
[ { "api_name": "setuptools.setup", "line_number": 8, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 17, "usage_type": "call" } ]
32996852891
from setuptools import find_packages, setup third_party_dependencies = ( "Flask", "flask-GraphQL", "graphene_sqlalchemy", "psycopg2", "SQLAlchemy", "requests", ) tests_require = ( "nose", ) setup( name="slack-server-python", version="0.1.0", author="Richard Shen", author_e...
ariia-git/slack-server-python
setup.py
setup.py
py
744
python
en
code
0
github-code
1
[ { "api_name": "setuptools.setup", "line_number": 16, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 23, "usage_type": "call" } ]
26390497940
from django.db import models from django.utils.translation import gettext_lazy as _ class QuestionType(models.TextChoices): NUMERIC = 'NUMERIC', _('Numeric') TEXT = 'TEXT', _('Text') DROPDOWN = 'DROPDOWN', _('Dropdown') CHECKBOX = 'CHECKBOX', _('Checkbox') RADIO_BUTTON = 'RADIO_BUTTON', _('RadioBut...
mehedi-shafi/simple-survey
api/survey/enums.py
enums.py
py
495
python
en
code
0
github-code
1
[ { "api_name": "django.db.models.TextChoices", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 4, "usage_type": "name" }, { "api_name": "django.utils.translation.gettext_lazy", "line_number": 5, "usage_type": "call" }, { ...
31317534219
from typing import List from scripts.faceswaplab_ui.faceswaplab_inpainting_ui import face_inpainting_ui from scripts.faceswaplab_swapping.face_checkpoints import get_face_checkpoints import gradio as gr from modules import shared from scripts.faceswaplab_utils.sd_utils import get_sd_option def faceswap_unit_advanced_...
Navezjt/sd-webui-faceswaplab
scripts/faceswaplab_ui/faceswaplab_unit_ui.py
faceswaplab_unit_ui.py
py
11,583
python
en
code
0
github-code
1
[ { "api_name": "gradio.Accordion", "line_number": 12, "usage_type": "call" }, { "api_name": "gradio.Markdown", "line_number": 13, "usage_type": "call" }, { "api_name": "gradio.Row", "line_number": 16, "usage_type": "call" }, { "api_name": "gradio.Radio", "line_...