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
2614278018
# topics = ['动态规划'] from typing import List class Solution: def maxUncrossedLines(self, nums1: List[int], nums2: List[int]) -> int: """ Dynamic Programming time O(mn), space O(mn), m 和 n 分别为 nums1 和 nums2 的长度 """ m, n = len(nums1), len(nums2) dp = [[0] * (n + 1) fo...
show-me-code/signInHelper-using-face-
algorithms/[1035]不相交的线/solution.py
solution.py
py
655
python
en
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 7, "usage_type": "name" } ]
10502969372
from rest_framework.test import APITestCase from ...services.notification_service import NotificationService from ...api_services.notification import NotificationAPIService from django.urls import reverse class TestNotificationAPIServices(APITestCase): def setUp(self): self.payload = { "title"...
anojkr/onboarding-project
push_notification/apps/notification/tests/unit/test_notification_api_services.py
test_notification_api_services.py
py
1,441
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.test.APITestCase", "line_number": 6, "usage_type": "name" }, { "api_name": "services.notification_service.NotificationService", "line_number": 13, "usage_type": "call" }, { "api_name": "django.urls.reverse", "line_number": 14, "usage_type": "...
7295749579
import discord, datetime, time from discord.ext import commands, tasks from itertools import cycle start_time = time.time() class Events(commands.Cog): def __init__(self, client): self.client = client self.status = cycle(['Bind', 'Haven', 'Ascent','Split','Fracture']) @tasks.loop(seconds...
awesomedustyn/CAP-N-
cogs/Events.py
Events.py
py
908
python
en
code
0
github-code
6
[ { "api_name": "time.time", "line_number": 5, "usage_type": "call" }, { "api_name": "discord.ext.commands.Cog", "line_number": 7, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 7, "usage_type": "name" }, { "api_name": "itertools.c...
8733632634
from hmmlearn import hmm import numpy as np class CustomHMM: def __init__(self): def build_hmm(): model = hmm.GMMHMM(n_components=3, n_mix=3, covariance_type="diag", init_params="t") model.transmat_ = np.array([[0.5, 0.5, 0.0], [0.0, 0.5, 0.5], ...
mattschaff/upennvoicerecog
CustomHMM.py
CustomHMM.py
py
986
python
en
code
1
github-code
6
[ { "api_name": "hmmlearn.hmm.GMMHMM", "line_number": 7, "usage_type": "call" }, { "api_name": "hmmlearn.hmm", "line_number": 7, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.reshape", "line_n...
41655800194
import dash import dash_html_components as html from dash.dependencies import Input, Output, State import dash_core_components as dcc import dash_bootstrap_components as dbc import base64 import pandas as pd import io import dash_table import os import ast from seaborn.matrix import heatmap from .layouts.layout import...
DaPraxis/Interactive-Machine-Learning-Tool-for-Risk-Factor-Analysis2
application/plotlydash/dataDownload.py
dataDownload.py
py
34,472
python
en
code
0
github-code
6
[ { "api_name": "pandas.DataFrame", "line_number": 36, "usage_type": "call" }, { "api_name": "ast.literal_eval", "line_number": 40, "usage_type": "call" }, { "api_name": "ast.literal_eval", "line_number": 45, "usage_type": "call" }, { "api_name": "ast.literal_eval",...
71452829947
import numpy as np from functools import partial #from multiprocessing import Pool import matplotlib.pyplot as plt from matplotlib import cm from pandas import DataFrame import scipy as sc import scipy.signal import os import pdb import time def group_into_bands(fft, fft_freq, nfreq_bands): if nfreq_bands == 178: ...
Anmol6/kaggle-seizure-competition
preprocess/pre_processing.py
pre_processing.py
py
7,809
python
en
code
0
github-code
6
[ { "api_name": "numpy.digitize", "line_number": 30, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.digitize", "line_number": 62, "usage_type": "call" }, { "api_name": "numpy.zeros", "lin...
34002077692
# SWEA 5105 미로의 거리 from collections import deque def bfs(x, y): q = deque([(x, y)]) arr[x][y] = 0 dr = [-1, 1, 0, 0] dc = [0, 0, -1, 1] while q: r, c = q.popleft() for i in range(4): nr = r + dr[i] nc = c + dc[i] if 0 <= nr < N and ...
jinmoonJ/algorithm
0825/SWEA_5105.py
SWEA_5105.py
py
1,147
python
en
code
0
github-code
6
[ { "api_name": "collections.deque", "line_number": 6, "usage_type": "call" } ]
24696329244
""" Author : Animesh Bhasin Version : 1 Version Date : 16th Nov 2022 Description : This script is to read the data from City of New York API and load into postgres db """ import requests import pandas as pd from datetime import date, timedelta from sqlalchemy import create_engine import os def main(): """ Mai...
Sapphirine/202112-26-NYC-Vehicle-Crash-Analysis
get_crashes.py
get_crashes.py
py
5,844
python
en
code
1
github-code
6
[ { "api_name": "os.getenv", "line_number": 29, "usage_type": "call" }, { "api_name": "sqlalchemy.create_engine", "line_number": 32, "usage_type": "call" }, { "api_name": "datetime.date.today", "line_number": 74, "usage_type": "call" }, { "api_name": "datetime.date"...
21776740540
import sys import os import click import json import re import pandas as pd import numpy as np from PIL import ImageTk, Image from tkinter import Tk from .modules.interface import AnnotationInterface @click.version_option("0.0.1") @click.command() @click.argument('image_dir', required=True) @click.argument('bindings...
jacobhepkema/annotpics
annotpics/__main__.py
__main__.py
py
3,726
python
en
code
1
github-code
6
[ { "api_name": "json.load", "line_number": 51, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 57, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 65, "usage_type": "call" }, { "api_name": "os.path", "line_number": 65, ...
21246199914
import os import pytest import pandas as pd from typing import List from faker import Faker from dataclasses import dataclass from prepare_dataset import read_data, train_target @dataclass() class TrainingPipelineParams: input_data_path: str @pytest.fixture() def dataset_path(tmpdir): fake...
made-ml-in-prod-2021/alexshevchuk7
ml_project/tests/test_prepare_data.py
test_prepare_data.py
py
1,815
python
en
code
0
github-code
6
[ { "api_name": "dataclasses.dataclass", "line_number": 11, "usage_type": "call" }, { "api_name": "faker.Faker", "line_number": 18, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 16, "usage_type": "call" }, { "api_name": "pytest.fixture", ...
3361094578
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from functions import noso from functions import dtdu_backward from functions import dodt device = torch.device("cuda" if torch.cuda.is_available() else "cpu") dtype = torch.float class fcn(nn.Module): def __init__(self, task, ...
dooseokjeong/BPTC-NOSO
SNN_folded/network.py
network.py
py
5,968
python
en
code
3
github-code
6
[ { "api_name": "torch.device", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.float", ...
30451465881
from calendar import c from re import S import sys import time import smbus import spidev import RPi.GPIO as GPIO import logging from ctypes import * logger = logging.getLogger() # logger.setLevel(logging.INFO) # Display all print information logger.setLevel(logging.FATAL) # If you don’t want to display too many...
DFRobot/DFRobot_BME280
python/raspberrypi/DFRobot_BME280.py
DFRobot_BME280.py
py
22,063
python
en
code
9
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.FATAL", "line_number": 15, "usage_type": "attribute" }, { "api_name": "logging.StreamHandler", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.Fo...
9202548056
#!/usr/bin/env python # -*- coding: utf-8 -*- import time import os import h5py import random import numpy as np from PIL import Image import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F from torch.utils.data import Dataset from torchvision import models, transforms from su...
SuperBruceJia/NLNet-IQA
Cross Database Evaluations/data_process/get_data.py
get_data.py
py
6,026
python
en
code
8
github-code
6
[ { "api_name": "torch.utils.data.Dataset", "line_number": 24, "usage_type": "name" }, { "api_name": "lib.make_index.default_loader", "line_number": 28, "usage_type": "name" }, { "api_name": "h5py.File", "line_number": 51, "usage_type": "call" }, { "api_name": "h5py...
45805692666
from selenium import webdriver import math import time import os import eel eel.init('web') def getUrl(url, volume, chapter): if url[-1] != '/': url += '/' return str(url) + 'v' + str(volume) + '/c' + str(chapter) def startDriver(url, chapterNumbers, outputFolder='', outputName='output', firstChapt...
STmihan/RanobeLib-downloader
main.py
main.py
py
3,255
python
en
code
3
github-code
6
[ { "api_name": "eel.init", "line_number": 7, "usage_type": "call" }, { "api_name": "selenium.webdriver.FirefoxOptions", "line_number": 17, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 17, "usage_type": "name" }, { "api_name": "eel.cons...
22633446316
import ply.lex as lex # List of token names. This is always required tokens = ( 'PROP', 'TRUE', 'FALSE', 'NOT', 'AND', 'OR', 'IMPLY', 'X', 'U', 'F', 'G', 'R', 'LPAREN', 'RPAREN', ) # Regular expression rules for simple tokens t_PROP = r'[a-zA-Z_][a-z...
AriRodriguezCruz/mcfgpr
parser.py
parser.py
py
1,058
python
en
code
0
github-code
6
[ { "api_name": "ply.lex.lex", "line_number": 58, "usage_type": "call" }, { "api_name": "ply.lex", "line_number": 58, "usage_type": "name" } ]
34294677016
from django.contrib import admin from django.urls import path from final import views urlpatterns = [ path("", views.index, name="root"), path("about/", views.about, name="about"), path("signup/", views.signup, name="signup"), path("login/", views.loginUser, name="login"), path("contact/", views.co...
supratim531/useless-django-app
final/urls.py
urls.py
py
455
python
en
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "final.views.index", "line_number": 6, "usage_type": "attribute" }, { "api_name": "final.views", "line_number": 6, "usage_type": "name" }, { "api_name": "django.urls.path", ...
31357581621
import os from setuptools import setup, find_packages from nats import __version__ this_dir = os.path.dirname(os.path.abspath(__file__)) with open(os.path.join(this_dir, 'requirements.txt')) as f: requirements = f.read().splitlines() setup( name='nats-client', version=__version__, description='NATS cl...
nats-io/nats.py2
setup.py
setup.py
py
834
python
en
code
62
github-code
6
[ { "api_name": "os.path.dirname", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path.join", "line_nu...
7377958665
from flask import Flask,request,jsonify import numpy as np from scipy.signal import find_peaks import pandas as pd app = Flask(__name__) @app.route('/data_process',methods=['GET']) def data_process(): dict1={} if '[' and ']' and "," in request.args['C1 raw']: input_control=request.args['C1 raw'].str...
Owaiskhan9654/Pelican-API-for-data-Processing-Canary-Global
app.py
app.py
py
2,388
python
en
code
1
github-code
6
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.request.args", "line_number": 13, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 13, "usage_type": "name" }, { "api_name": "flask.request.args",...
38903741775
#SIEMPRE SIEMPRE SIEMPRE que abrimos un fichero lo tenemos que CERRAR después #Si abrimos un fichero con with, python hace el close() por nosotros :)) fichero = 'nombres2.txt' #qué tengo que poner como fichero? #qué pasa si no está en la misma carpeta? import pickle import csv with open(fichero)...
rjvillen/clases-particulares-python
ficheros/ficheros_ejemplos_sol.py
ficheros_ejemplos_sol.py
py
2,343
python
es
code
0
github-code
6
[ { "api_name": "pickle.dump", "line_number": 33, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 36, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 39, "usage_type": "call" }, { "api_name": "pickle.dump", "line_number": ...
74186588989
""" Loading logic """ import sqlite3 import sys from decimal import Decimal from datetime import datetime def load_data(database_uri: str, data: list) -> bool: """ Loads Bitcoin rate data into an SQLite database. Args: database_uri (str): The URI of the SQLite database. data (list): The l...
richardogoma/bitcoin-rate-etl
etl/load/loader.py
loader.py
py
2,943
python
en
code
0
github-code
6
[ { "api_name": "decimal.Decimal", "line_number": 37, "usage_type": "argument" }, { "api_name": "datetime.datetime", "line_number": 39, "usage_type": "argument" }, { "api_name": "sqlite3.connect", "line_number": 45, "usage_type": "call" }, { "api_name": "sqlite3.Err...
36345253262
""" EECS 445 - Winter 2017 - Project 2 FER2013 - Skeleton This file reads the dataset and provides a function `preprocessed_data` that returns preprocessed images, labels Usage: python -m data_scripts.fer2013 """ import numpy as np from scipy.misc import imresize from sklearn.utils import resample import pandas from ...
lixhuang/EECS445p2
data_scripts/fer2013.py
fer2013.py
py
6,969
python
en
code
0
github-code
6
[ { "api_name": "numpy.zeros", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": ...
716717090
from plenum.common.constants import SERVICES, VALIDATOR, TARGET_NYM, DATA from sovrin_common.roles import Roles from stp_core.network.port_dispenser import genHa import pytest from sovrin_client.test.cli.helper import doSendNodeCmd def testSuspendNode(be, do, trusteeCli, newNodeAdded): """ Suspend a node an...
hyperledger-archives/indy-client
sovrin_client/test/cli/test_node_suspension.py
test_node_suspension.py
py
2,820
python
en
code
18
github-code
6
[ { "api_name": "plenum.common.constants.SERVICES", "line_number": 19, "usage_type": "name" }, { "api_name": "sovrin_client.test.cli.helper.doSendNodeCmd", "line_number": 20, "usage_type": "call" }, { "api_name": "plenum.common.constants.SERVICES", "line_number": 22, "usage...
21215563455
# -*- coding: utf-8 -*- from django.db.models import Count, Case, When from django.db.models.functions import TruncDate from django.utils.translation import gettext as _ from django.utils.translation import get_language import plotly.offline as plotly import plotly.graph_objs as go from core.utils import duration_par...
babybuddy/babybuddy
reports/graphs/diaperchange_intervals.py
diaperchange_intervals.py
py
2,953
python
en
code
1,766
github-code
6
[ { "api_name": "plotly.graph_objs.Scatter", "line_number": 37, "usage_type": "call" }, { "api_name": "plotly.graph_objs", "line_number": 37, "usage_type": "name" }, { "api_name": "django.utils.translation.gettext", "line_number": 38, "usage_type": "call" }, { "api_...
8631506734
#!/usr/bin/env python3 import argparse import logging import requests import sys from alert_autoconf.config import read_from_file from json import JSONDecodeError LOG_LEVEL = "DEBUG" def parse_params() -> dict: parser = argparse.ArgumentParser(add_help=True) parser.add_argument( "-u", "--ur...
avito-tech/alert-autoconf
bin/validate.py
validate.py
py
2,475
python
en
code
1
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 40, "usage_type": "call" }, { "api_name": "logging.getLevelName", "line_number": 41, "usage_type": "call" }, { "api_name": "sys....
19238997232
from collections import deque N = int(input()) def bfs(): cnt = -1 q = deque() for i in range(10): q.append(i) while q: s = q.popleft() cnt += 1 if cnt == N: print(s) break for i in range(s%10): q.append(s * 10 + i) else: ...
sdh98429/dj2_alg_study
BAEKJOON/backtracking/b1038.py
b1038.py
py
344
python
en
code
0
github-code
6
[ { "api_name": "collections.deque", "line_number": 6, "usage_type": "call" } ]
21884520657
"""Use simple rate comparisions, try predicting event rates.""" import numpy as np import matplotlib.pyplot as plt from frbpoppy import Survey from tests.convenience import plot_aa_style, rel_path ALPHAS = np.around(np.linspace(-0.2, -2.5, 7), decimals=2) SURVEYS = ('parkes-htru', 'arecibo-palfa', 'askap-fly', 'fast...
TRASAL/frbpoppy
tests/rates/alpha_analytical.py
alpha_analytical.py
py
1,884
python
en
code
26
github-code
6
[ { "api_name": "numpy.around", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 9, "usage_type": "call" }, { "api_name": "frbpoppy.Survey", "line_number": 33, "usage_type": "call" }, { "api_name": "frbpoppy.Survey", "line...
10790083831
import html import os import re import requests class DirFile: def __init__(self, shop_data_dict, img_list, path, shop): self.shop_data_dict = shop_data_dict self.img_list = img_list self.path = path self.shop = shop def save_to_local(self): try: folder_nam...
kimbackdoo/Hareubang-Crawler
crawl/dir_file.py
dir_file.py
py
1,955
python
en
code
0
github-code
6
[ { "api_name": "os.path.exists", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 22, "usage_type": "call" }, { "api_name": "re.compile", "line_number...
33781322730
import copy import datetime as dt import decimal import re import pytest import pytz from google.cloud import bigquery from google.cloud import bigquery_storage_v1beta1 from google.protobuf import timestamp_pb2 def _to_bq_table_ref(proto_table_ref, partition_suffix=""): """Converts protobuf table reference to b...
silverdev/google-cloud-python
bigquery_storage/tests/system/test_reader.py
test_reader.py
py
15,016
python
en
code
0
github-code
6
[ { "api_name": "google.cloud.bigquery.table.TableReference.from_api_repr", "line_number": 27, "usage_type": "call" }, { "api_name": "google.cloud.bigquery.table", "line_number": 27, "usage_type": "attribute" }, { "api_name": "google.cloud.bigquery", "line_number": 27, "usa...
19692262120
#Socratica Video 22 List Comprehension #list comprehension [expression for variable in collection if test1 and test2] #list comprehension [expression for variable1 in collection1 and variable2 in collection2] squares = [] for i in range(1, 11): squares.append(i**2) print(squares) #print [1, 4, 9, 16, 25, 36, 49, 64,...
raymondmar61/pythonoutsidethebook
listcomprehension.py
listcomprehension.py
py
10,585
python
en
code
0
github-code
6
[ { "api_name": "math.pi", "line_number": 104, "usage_type": "argument" }, { "api_name": "itertools.repeat", "line_number": 199, "usage_type": "call" } ]
73268001788
# Uncomment the next two lines to enable the admin: from django.conf.urls import patterns, include, url from productes import views urlpatterns = patterns('', url(r'^$', views.llistarProductes, name='llistarProductes'), url(r'^llistarCategories/$', views.llistarCategories, name='llistarCategories'), url(r'...
kimpa2007/restoGestio
tpv/productes/urls.py
urls.py
py
938
python
en
code
0
github-code
6
[ { "api_name": "django.conf.urls.patterns", "line_number": 5, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "productes.views.llistarProductes", "line_number": 6, "usage_type": "attribute" }, { ...
37950158304
import copy import matplotlib.pyplot as plt from numpy import sqrt, inf from sklearn.model_selection import train_test_split from tqdm import tqdm import torch import torch.nn as nn import torch.optim as optim from models.cnn import CNN from linegeneration.generate_lines import create_image_set from utils.logger impor...
3it-inpaqt/line-classification-slope
models/run_cnn.py
run_cnn.py
py
6,433
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.pyplot.rcParams.update", "line_number": 21, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 21, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 21, "usage_type": "name" }, { ...
21098037404
# -*- coding: utf-8 -*- from flask import Blueprint, g, request, redirect, url_for, current_app import os from invenio.ext.template.context_processor import \ register_template_context_processor, template_args from invenio.base.decorators import templated from invenio.modules.formatter import format_record from...
cjhak/b2share
invenio/b2share/modules/main/views.py
views.py
py
2,867
python
en
code
null
github-code
6
[ { "api_name": "flask.Blueprint", "line_number": 18, "usage_type": "call" }, { "api_name": "flask.request.values.get", "line_number": 30, "usage_type": "call" }, { "api_name": "flask.request.values", "line_number": 30, "usage_type": "attribute" }, { "api_name": "fl...
39956836499
# -*- coding: utf-8 -*- """ Created on Wed Oct 19 14:11:57 2022 @author: Saskia Hustinx """ import re import gpt_2_simple as gpt2 import tensorflow as tf import json import tweepy import random import time ### NLP SECTION ### def words_in_string(word_list, a_string): return set(word_list).intersection(a_string.s...
sHustinx/nlp-fortune-cookie-bot
respond-dms.py
respond-dms.py
py
2,664
python
en
code
0
github-code
6
[ { "api_name": "gpt_2_simple.generate", "line_number": 22, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 26, "usage_type": "call" }, { "api_name": "json.load", "line_number": 38, "usage_type": "call" }, { "api_name": "tweepy.OAuthHandler", ...
33626981361
from flask import Flask, request import requests import tkinter as tk from tkinter import simpledialog import pdfrw import json from flask_cors import CORS import io import base64 app = Flask(__name__) CORS(app) @app.route("/") def hello_world(): ROOT = tk.Tk() ROOT.withdraw() # the input dialog # USE...
MHSiles/yoloco-be
other/main-2.py
main-2.py
py
4,824
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 12, "usage_type": "call" }, { "api_name": "tkinter.Tk", "line_number": 16, "usage_type": "call" }, { "api_name": "flask.request.args.get", "...
5592159173
from .http import * from .abc import User, Channel from .channels import DMChannel import asyncio as aio class Client: """ Base class for interacting with discord """ def __init__(self, token: str): self.http = HTTPClient(token) self.event_loop = aio.new_event_loop() aio.set_...
ledanne/descapede
diswrap/client.py
client.py
py
2,060
python
en
code
1
github-code
6
[ { "api_name": "asyncio.new_event_loop", "line_number": 15, "usage_type": "call" }, { "api_name": "asyncio.set_event_loop", "line_number": 16, "usage_type": "call" }, { "api_name": "abc.User", "line_number": 46, "usage_type": "call" }, { "api_name": "abc.User", ...
28156207354
import torch from projects.thre3ingan.singans.networks import Thre3dGenerator from torch.backends import cudnn cudnn.benchmark = True device = torch.device("cuda" if torch.cuda.is_available() else "cpu") def test_thre3d_generator() -> None: batch_size = 1 random_input = torch.randn(batch_size, 128, 64, 64,...
akanimax/3inGAN
projects/thre3ingan/singans/tests/test_networks.py
test_networks.py
py
491
python
en
code
3
github-code
6
[ { "api_name": "torch.backends.cudnn.benchmark", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.backends.cudnn", "line_number": 6, "usage_type": "name" }, { "api_name": "torch.device", "line_number": 8, "usage_type": "call" }, { "api_name": "to...
39400883437
import boto3 import pickle from typing import Any, Tuple import logging from re import sub import pandas as pd import numpy as np from sklearn.metrics import average_precision_score from sklearn.model_selection import StratifiedShuffleSplit import xgboost as xgb # ----- Class for uploading and downloading Python ob...
YangWu1227/python-for-machine-learning
tree_based/projects/telco_churn_sagemaker/src/custom_utils.py
custom_utils.py
py
4,461
python
en
code
0
github-code
6
[ { "api_name": "boto3.client", "line_number": 31, "usage_type": "call" }, { "api_name": "typing.Any", "line_number": 35, "usage_type": "name" }, { "api_name": "pickle.dumps", "line_number": 49, "usage_type": "call" }, { "api_name": "pickle.loads", "line_number"...
27259802510
"""We are the captains of our ships, and we stay 'till the end. We see our stories through. """ """513. Find Bottom Left Tree Value [Two Passes] """ from collections import deque class TreeNode: def __init__(self, val): self.val = val self.left = None self.right = None class Solution: ...
asperaa/back_to_grind
Trees/bottom_left_tree.py
bottom_left_tree.py
py
890
python
en
code
1
github-code
6
[ { "api_name": "collections.deque", "line_number": 25, "usage_type": "call" } ]
2018426878
import unittest import sys import os import tempfile import shutil from appliapps.flow.branch import Branch from appliapps.flow.collate import Collate from appliapps.flow.merge import Merge from appliapps.flow.split import Split class Test(unittest.TestCase): @classmethod def setUpClass(cls): cls.tdi...
lcb/applicake
tests/test_flow.py
test_flow.py
py
1,454
python
en
code
1
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 13, "usage_type": "attribute" }, { "api_name": "tempfile.mkdtemp", "line_number": 16, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 17, "usage_type": "call" }, { "api_name": "sys.argv", "line...
32108920209
import json from typing import List import mlflow import pandas from pandas import DataFrame class SpambugInference(mlflow.pyfunc.PythonModel): """ Inference code copied from MLFlow bugs.py """ def __init__(self, extraction_pipeline, clf, le): self.extraction_pipeline = extraction_pipeline ...
mozilla/mlops-platform-spike-library
bugbug/mlflow/bugbug/trackers/spambug_inference.py
spambug_inference.py
py
1,839
python
en
code
0
github-code
6
[ { "api_name": "mlflow.pyfunc", "line_number": 9, "usage_type": "attribute" }, { "api_name": "typing.List", "line_number": 17, "usage_type": "name" }, { "api_name": "json.loads", "line_number": 23, "usage_type": "call" } ]
75246891067
import collections import copy import numpy as np import mindspore as ms from mindspore import nn, ops from mindspore import Tensor, Parameter from mindspore.nn.layer.normalization import _BatchNorm from mindspore.nn.probability.distribution import Normal from mindspore_gl import Graph from mindspore_gl import GNNCe...
shuoliu0-0/EDIS
model.py
model.py
py
21,685
python
en
code
1
github-code
6
[ { "api_name": "mindspore.ops.nonzero", "line_number": 54, "usage_type": "call" }, { "api_name": "mindspore.ops", "line_number": 54, "usage_type": "name" }, { "api_name": "mindspore.ops.nonzero", "line_number": 58, "usage_type": "call" }, { "api_name": "mindspore.o...
6153769301
from django.shortcuts import render from . models import Department, Employee, User, Phone, Book, Store from django.http import HttpResponse # Create your views here. def index(request): # without relationship: user = User.objects.get(pk=1) phone = Phone.objects.get(user_id=user) #...
oruchkin/biteofpithon
django relationships/relation/core/views.py
views.py
py
3,072
python
en
code
0
github-code
6
[ { "api_name": "models.User.objects.get", "line_number": 10, "usage_type": "call" }, { "api_name": "models.User.objects", "line_number": 10, "usage_type": "attribute" }, { "api_name": "models.User", "line_number": 10, "usage_type": "name" }, { "api_name": "models.P...
28114724866
import matplotlib.pyplot as plt plt.rcParams['font.sans-serif'] = ['Microsoft YaHei'] # 数据 sizes = ["0.5x0.5", "2x2", "5x5", "7x7"] postgres = [2, 10, 94, 153] accumulo = [8, 15, 22, 41] # 绘图 plt.plot(sizes, postgres, label="PostgreSQL") plt.plot(sizes, accumulo, label="Accumulo") plt.xlabel("Extent(km²)") plt.ylabe...
KiktMa/gdal_tiff
shange/paintsd.py
paintsd.py
py
386
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.pyplot.rcParams", "line_number": 3, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 3, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 11, "usage_type": "call" }, { "api_name":...
31127201950
# to run, execute this command in the command line: # python create_plots.py pagecounts-20160802-150000.txt pagecounts-20160803-150000.txt import sys import pandas as pd import numpy as np import matplotlib.pyplot as plt filename1 = sys.argv[1] filename2 = sys.argv[2] data1 = pd.read_table(filename1, sep=' ',...
tomliangg/Plotting_Wikipedia_Page_Views
create_plots.py
create_plots.py
py
1,324
python
en
code
0
github-code
6
[ { "api_name": "sys.argv", "line_number": 7, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pandas.read_table", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.read_table", "...
70111562109
import requests def run(): api_key = 'f258ca5a16d84339a5f6cdb4c7700756' query_map = {} url = 'http://api.weatherbit.io/v2.0/current' query_map['lat'] = 39.757 query_map['lon'] = -75.742 query_map['key'] = api_key query_map['lang'] = 'en' response = requests.get(url,params=query_map).js...
cthacker-udel/Raspberry-Pi-Scripts
py/getcurrweather.py
getcurrweather.py
py
441
python
en
code
7
github-code
6
[ { "api_name": "requests.get", "line_number": 12, "usage_type": "call" } ]
3981685761
from django.test import TestCase from django import forms from parameterized import parameterized from MDM.forms import ItemGroupForm from MDM.bootstrap import INPUT class ItemGroupFormTest(TestCase): @parameterized.expand([ ('description', 'Descrição do Grupo de Item'), ]) def test_form_labels(...
tiagomend/flow_erp
MDM/tests/test_item_group_form.py
test_item_group_form.py
py
1,264
python
en
code
0
github-code
6
[ { "api_name": "django.test.TestCase", "line_number": 9, "usage_type": "name" }, { "api_name": "MDM.forms.ItemGroupForm", "line_number": 15, "usage_type": "call" }, { "api_name": "parameterized.parameterized.expand", "line_number": 11, "usage_type": "call" }, { "ap...
25390435322
import logging import requests import pandas as pd import time from .sqlite import Orders from .sqlite import Balances class BitMex(): def pull_bitmex_orderbooks(symbol, limit, mode='live'): # Tracking execution time start_ts = time.time() * 1000 # Get request request = requests.get('https://www.b...
noqcks/bmex-algo
src/bitmex.py
bitmex.py
py
8,025
python
en
code
0
github-code
6
[ { "api_name": "time.time", "line_number": 13, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 16, "usage_type": "call" }, { "api_name": "time.time", "line_number": 22, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number"...
776580237
from pprint import pprint import requests import json # Задание 1 Посмотреть документацию к API GitHub, разобраться как вывести список репозиториев для конкретного пользователя, # сохранить JSON-вывод в файле *.json. url = 'https://api.github.com/users/Karamba278/repos' #Сразу вставил имя юзера (себя) в ссылку, но мо...
Karamba278/parsing
DZ1/lesson1.py
lesson1.py
py
1,643
python
ru
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 17, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 29, "usage_type": "call" }, { "api_name": "pprint.pprint", "line_number":...
42433734628
import pytest import random from torchrl.envs import make_gym_env, TransitionMonitor @pytest.mark.parametrize('spec_id', [ 'Acrobot-v1', 'CartPole-v1', 'MountainCar-v0', 'MountainCarContinuous-v0', 'Pendulum-v0', ]) def test_transition_monitor(spec_id: str): env = TransitionMonitor(make_gym_env...
activatedgeek/torchrl
torchrl/envs/test_wrappers.py
test_wrappers.py
py
968
python
en
code
110
github-code
6
[ { "api_name": "torchrl.envs.TransitionMonitor", "line_number": 15, "usage_type": "call" }, { "api_name": "torchrl.envs.make_gym_env", "line_number": 15, "usage_type": "call" }, { "api_name": "random.random", "line_number": 29, "usage_type": "call" }, { "api_name":...
8516167540
import numpy as np import matplotlib.pyplot as plt import h5py path_Lf3D = "/mn/stornext/d19/RoCS/alma/emissa_sim/linfor3D/outhdf/" f = {"500nm" : h5py.File(path_Lf3D + "d3t57g44c_v000G_n019_it000_05000_mu1_00_linfor_3D_2.hdf", "r"), "1mm" : h5py.File(path_Lf3D + "d3t57g44c_v000G_n019_it000_01mm_mu1_00_linfor_...
jonasrth/MSc-plots
mean_CF.py
mean_CF.py
py
1,183
python
en
code
0
github-code
6
[ { "api_name": "h5py.File", "line_number": 7, "usage_type": "call" }, { "api_name": "h5py.File", "line_number": 8, "usage_type": "call" }, { "api_name": "h5py.File", "line_number": 9, "usage_type": "call" }, { "api_name": "h5py.File", "line_number": 11, "us...
43970042116
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ AUTHOR Pedro Cerqueira github: @pedrorvc DESCRIPTION This script serves to create xml files contaning the information necessary for the execution of BRIG (Blast Ring Image Generator), reducing the time performing the tedious task of setting u...
TAMU-CPT/galaxy-tools
tools/genome_viz/brigaid.py
brigaid.py
py
36,126
python
en
code
5
github-code
6
[ { "api_name": "os.path.join", "line_number": 49, "usage_type": "call" }, { "api_name": "os.path", "line_number": 49, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 49, "usage_type": "call" }, { "api_name": "csv.DictReader", "line_numbe...
71783932668
from setuptools import setup, find_packages def readme(): with open('README.rst', encoding='utf-8') as f: content = f.read() return content def get_version(): with open('VERSION', encoding='utf-8') as f: version = f.read() return version setup( name='thonny-quecpython', ver...
wcache/thonny_quecpython
setup.py
setup.py
py
1,267
python
en
code
0
github-code
6
[ { "api_name": "setuptools.setup", "line_number": 16, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 34, "usage_type": "call" } ]
34398796086
from typing import List import docx from .IngestorInterface import IngestorInterface from .QuoteModel import QuoteModel class DocxIngestor(IngestorInterface): allowed_extensions = ['docx'] @classmethod def parse(cls, path: str) -> List[QuoteModel]: if not cls.can_ingest(path): raise ...
KosziDrimi/Meme-Generator-project
QuoteEngine/DocxIngestor.py
DocxIngestor.py
py
800
python
en
code
0
github-code
6
[ { "api_name": "IngestorInterface.IngestorInterface", "line_number": 8, "usage_type": "name" }, { "api_name": "docx.Document", "line_number": 18, "usage_type": "call" }, { "api_name": "QuoteModel.QuoteModel", "line_number": 25, "usage_type": "call" }, { "api_name":...
38137944576
import dash from dash import html, dcc from dash.dependencies import Input, Output import plotly.graph_objs as go from plotly.subplots import make_subplots import pandas as pd # Load data df = pd.read_csv("https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv") # Create subplots fig = make...
TIIIIIIW/SOFTWARE-DEVELOPMENT-2
ML/Data/TestDash.py
TestDash.py
py
2,975
python
en
code
1
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "plotly.subplots.make_subplots", "line_number": 12, "usage_type": "call" }, { "api_name": "plotly.graph_objs.Candlestick", "line_number": 15, "usage_type": "call" }, { "api_na...
42242066819
from random import Random from torch.utils.data import DataLoader from torchvision import transforms, datasets class Partition: def __init__(self, data, index): self.data = data self.index = index def __len__(self): return len(self.index) def __getitem__(self, idx): data_...
DragonChen-TW/torch_DDP
data_partition.py
data_partition.py
py
1,832
python
en
code
1
github-code
6
[ { "api_name": "random.Random", "line_number": 22, "usage_type": "call" }, { "api_name": "torchvision.transforms.Compose", "line_number": 38, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 38, "usage_type": "name" }, { "api_name": "t...
12138793296
from dataclasses import fields from pyexpat import model import django from django import forms from django.db.models import fields from django.contrib.auth.forms import UserCreationForm,AuthenticationForm from django.forms import ModelForm from .models import * class CustomUserCreationForm(UserCreationForm): clas...
baadhira/shopify-ecommerce
adminapp/forms.py
forms.py
py
4,635
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.auth.forms.UserCreationForm", "line_number": 10, "usage_type": "name" }, { "api_name": "pyexpat.model", "line_number": 12, "usage_type": "name" }, { "api_name": "django.db.models.fields", "line_number": 13, "usage_type": "name" }, { "...
27615702847
""" Get 10 titles of the most popular movies/series etc. by each genre. Получите 10 наименований самых популярных фильмов/сериалов и т. д. в каждом жанре. title.basics.tsv.gz title.ratings.tsv.gz """ from pyspark import SparkConf from pyspark.sql import SparkSession import pyspark.sql.types as t import pyspark.sql.func...
Tetyana83/spark
task8.py
task8.py
py
2,591
python
en
code
0
github-code
6
[ { "api_name": "pyspark.sql.SparkSession.builder.master", "line_number": 12, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 12, "usage_type": "attribute" }, { "api_name": "pyspark.sql.SparkSession", "line_number": 12, "usage_type":...
36551632681
import matplotlib.pyplot as plt from DataHandler import DataHandler from LinearClassifier import LinearClassifier if __name__ == '__main__': #generating a normal distributed data (1000 samples per class) data_handler = DataHandler() class0Dataset = data_handler.get2DGaussian(1000, [-2, -2]) cla...
Mustapha-Belkacim/Linear-classifier
main.py
main.py
py
1,623
python
en
code
0
github-code
6
[ { "api_name": "DataHandler.DataHandler", "line_number": 7, "usage_type": "call" }, { "api_name": "LinearClassifier.LinearClassifier", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.show", "line_number": 28, "usage_type": "call" }, { "a...
12091024325
from typing import List, Iterator import torch from torch.utils.data.sampler import Sampler from nltk import Tree from nltk.tokenize.treebank import TreebankWordTokenizer class TokenizedLengthSampler(Sampler[List[int]]): """ PyTorch DataLoader - compatible sampler class that batchify sentences with the most ...
jinulee-v/bert_diora
bert_diora/utils.py
utils.py
py
1,470
python
en
code
0
github-code
6
[ { "api_name": "torch.utils.data.sampler.Sampler", "line_number": 9, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 9, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 14, "usage_type": "name" }, { "api_name": "nltk.tokenize....
75137098747
from django.contrib.auth.backends import ModelBackend from django.contrib.auth.models import Permission from .models import Organization, OrganizationUser class OrganizationBackend(ModelBackend): supports_object_permissions = True def authenticate(self, organization=None, username=None, password=None): ...
avidal/django-organizations
organizations/backends.py
backends.py
py
6,718
python
en
code
1
github-code
6
[ { "api_name": "django.contrib.auth.backends.ModelBackend", "line_number": 7, "usage_type": "name" }, { "api_name": "models.Organization.objects.get", "line_number": 17, "usage_type": "call" }, { "api_name": "models.Organization.objects", "line_number": 17, "usage_type": "...
70384349309
import numpy as np import scipy import cv2 import matplotlib.pyplot as plt from matplotlib.colors import LightSource def rotate_and_crop(arr, ang): """Array arr to be rotated by ang degrees and cropped afterwards""" arr_rot = scipy.ndimage.rotate(arr, ang, reshape=True, order=0) shift_up = np.ceil(np.arcs...
openearth/vcl
vcl/data.py
data.py
py
6,478
python
en
code
2
github-code
6
[ { "api_name": "scipy.ndimage.rotate", "line_number": 9, "usage_type": "call" }, { "api_name": "scipy.ndimage", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.ceil", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.arcsin", "...
29476131174
#! /usr/bin/env python # -*- coding: utf-8 -*- """Fine tune CTC network (CSJ corpus, for dialog).""" import os import sys import time import tensorflow as tf from setproctitle import setproctitle import yaml import shutil import tensorflow.contrib.slim as slim sys.path.append('../') sys.path.append('../../') sys.pat...
hirofumi0810/tensorflow_end2end_speech_recognition
examples/csj/fine_tuning/finetune_ctc_dialog.py
finetune_ctc_dialog.py
py
20,860
python
en
code
312
github-code
6
[ { "api_name": "sys.path.append", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.path", "line_nu...
43133597312
# This script is developed by Team 11 CIS 3760 # Parser - to parse the plain text file into json file import sys import re import json import os sys.path.insert(1, os.path.join(sys.path[0], '..')) import course_util uOCourseCodeIsolatedPat = re.compile(r'^\w{3}[ ]?\d{4}$') uOCourseCodePat = re.compile(r'...
jessendasilva1/UniveristySearch
graphing/util/parser/ottawaCourseParser.py
ottawaCourseParser.py
py
11,463
python
en
code
0
github-code
6
[ { "api_name": "sys.path.insert", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
41211802240
#import cv2 from keras.applications.vgg16 import VGG16 from keras.preprocessing import image from keras.applications.vgg16 import preprocess_input, decode_predictions import numpy as np import os import sys import json from PIL import Image # import Image import requests from io import BytesIO import urllib3 import h5p...
ming19956/PFE
information-retrival-search-engine/informationRetrival/vgg16_p/newvgg.py
newvgg.py
py
9,112
python
en
code
2
github-code
6
[ { "api_name": "urllib3.disable_warnings", "line_number": 16, "usage_type": "call" }, { "api_name": "urllib3.exceptions", "line_number": 16, "usage_type": "attribute" }, { "api_name": "numpy.ndarray", "line_number": 23, "usage_type": "attribute" }, { "api_name": "n...
12028632350
import tkinter from tkinter import messagebox from src.game.minesweeper import Minesweeper from src.game.minesweeper import CellStatus from src.game.minesweeper import GameStatus from datetime import datetime import platform class MineweeperUI: def __init__(self, root): self.ui_window = root self.ui_window.t...
PriscillaRoy/MinesweeperGame
src/gui/minesweeper_ui.py
minesweeper_ui.py
py
3,636
python
en
code
0
github-code
6
[ { "api_name": "src.game.minesweeper.Minesweeper", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 15, "usage_type": "name" }, { "api_name...
22837983090
import pandas as pd import networkx as nx # def splitDataFrameList(df,target_column,separator): # ''' df = dataframe to split, # target_column = the column containing the values to split # separator = the symbol used to perform the split # returns: a dataframe with each entry for the target column separated, with...
brooksjaredc/podcast_network_analysis
analyzing_functions/set_node_attr.py
set_node_attr.py
py
2,988
python
en
code
1
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 39, "usage_type": "call" }, { "api_name": "networkx.from_pandas_dataframe", "line_number": 41, "usage_type": "call" }, { "api_name": "networkx.DiGraph", "line_number": 41, "usage_type": "call" }, { "api_name": "netwo...
35226848142
import torch import torch.nn.functional from .calculate_ssim import ssim from .utils import fspecial_gauss def ms_ssim(image1: torch.Tensor, image2: torch.Tensor, filter_weight: torch.Tensor) -> float: """ Multi scale structural similarity Args: image1 (np.array): Original tensor picture. im...
avacaondata/SpainAI_Hackaton_ComputerVision
ESRGAN-PyTorch/esrgan_pytorch/utils/image_quality_assessment/calculate_mssim.py
calculate_mssim.py
py
1,882
python
en
code
1
github-code
6
[ { "api_name": "torch.Tensor", "line_number": 8, "usage_type": "attribute" }, { "api_name": "calculate_ssim.ssim", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.FloatTensor", "line_number": 22, "usage_type": "call" }, { "api_name": "calculate_ssim...
74077927228
from PyQt5.QtCore import QFile, QTextStream, QIODevice class StyleLoader: def __init__(self, variables_path: str = None): self._variables = {} self._stylesheets = {} self._init_variables(variables_path) def get_merged_stylesheets(self, names: list): return self._merge_stylesh...
lennertsoffers/KeyCursor
key_cursor_config/model/StyleLoader.py
StyleLoader.py
py
1,926
python
en
code
1
github-code
6
[ { "api_name": "PyQt5.QtCore.QFile", "line_number": 31, "usage_type": "call" }, { "api_name": "PyQt5.QtCore.QIODevice.ReadOnly", "line_number": 32, "usage_type": "attribute" }, { "api_name": "PyQt5.QtCore.QIODevice", "line_number": 32, "usage_type": "name" }, { "ap...
22781339759
import IMP import IMP.pmi import IMP.pmi.macros import RMF import matplotlib.pyplot as plt import seaborn as sns import sys import numpy as np import argparse ######### # PARSER ######### p = argparse.ArgumentParser( description="Align selected RMF files. \n" "Example of usage: alig...
Altairch95/ExocystDYN
scripts/align_rmf.py
align_rmf.py
py
5,528
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 14, "usage_type": "call" }, { "api_name": "IMP.atom.Selection", "line_number": 32, "usage_type": "call" }, { "api_name": "IMP.atom", "line_number": 32, "usage_type": "attribute" }, { "api_name": "numpy.arange...
32562155548
from django.conf.urls.defaults import * from django.conf import settings from gallery.feeds import Photos, Videos, Tags, TagContents, Comments try: import django_openidconsumer except ImportError: django_openidconsumer = None feeds = { 'comments': Comments, 'photos': Photos, 'videos': Videos, ...
ginking/Gallery-1
urls.py
urls.py
py
2,422
python
en
code
0
github-code
6
[ { "api_name": "gallery.feeds.Comments", "line_number": 11, "usage_type": "name" }, { "api_name": "gallery.feeds.Photos", "line_number": 12, "usage_type": "name" }, { "api_name": "gallery.feeds.Videos", "line_number": 13, "usage_type": "name" }, { "api_name": "gall...
32463868402
import numpy as np import matplotlib.pyplot as plt import torch import torch.nn as nn import torch.nn.functional as F import torch import torchvision import torchvision.transforms as transforms class DataLoader: def __init__(self, batch_size = 4): ''' num_workers should be 0...
jindeok/XAI_torch_captum
XAI_torch/utils.py
utils.py
py
2,051
python
en
code
0
github-code
6
[ { "api_name": "torch.utils.data.DataLoader", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.utils", "line_number": 21, "usage_type": "attribute" }, { "api_name": "torch.utils.data.DataLoader", "line_number": 23, "usage_type": "call" }, { "api_name...
8915382368
from datetime import datetime from astral import Astral from pyHS100 import Discover, SmartPlug, SmartBulb import time, socket, requests, pytz, simplejson #Used to determine daylight status, occupancy status, and does the things #if the things are needed based on prior info class SmartSwitchControl(): a = Astr...
bradyjibanez/Voyager
occupantInference/smartSwitchControl.py
smartSwitchControl.py
py
2,417
python
en
code
0
github-code
6
[ { "api_name": "astral.Astral", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 16, "usage_type": "name" }, { "api_name": "pytz.utc", "...
11735575748
"""Add File table Revision ID: 3822d04489a0 Revises: Create Date: 2021-06-26 16:18:52.167545 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '3822d04489a0' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands auto gen...
retroherna/rhinventory
alembic/versions/3822d04489a0_add_file_table.py
3822d04489a0_add_file_table.py
py
1,531
python
en
code
1
github-code
6
[ { "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...
16106180145
#!/usr/bin/env python3 if __name__ == "__main__": import argparse import os import benj ap = argparse.ArgumentParser() ap.add_argument("-i", "--input", dest="h5ad", required=True) ap.add_argument("-o", "--output", required=True) ap.add_argument("--labels", requir...
KellisLab/benj
scripts/integrate_and_train.py
integrate_and_train.py
py
1,676
python
en
code
2
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "benj.parse_args", "line_number": 17, "usage_type": "call" }, { "api_name": "benj.stopwatch", "line_number": 20, "usage_type": "call" }, { "api_name": "benj.parse_annd...
24604094520
# Packages import time import selenium from selenium import webdriver import NameExtractor app_names = [] element_web = [] k = 0 count = 1 def decompiler(path, file_path): global app_names, driver driver = webdriver.Chrome(path) driver.maximize_window() app_names = NameExtractor.n...
Neilnarnaware/Privacy-Detection-of-Android-Application
Decompiler.py
Decompiler.py
py
2,296
python
en
code
0
github-code
6
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 16, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 16, "usage_type": "name" }, { "api_name": "NameExtractor.name_extractor", "line_number": 19, "usage_type": "call" }, { "api_nam...
32509221733
import numpy as np import matplotlib.pyplot as plt import scipy.stats as sc import csv def myAnova(Matrice, pvalue_crit): # Initialisation : H = 0 F = 0 var_intra = 0 var_inter = 0 obs_moy = 0 eff_tot = 0 # Moyenne des classes : for i in range(len(Matrice)): obs_moy = sum(Ma...
Varelafv/TD6.py
TD2-EXO2.py
TD2-EXO2.py
py
5,319
python
fr
code
0
github-code
6
[ { "api_name": "numpy.mean", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 35, "usage_type": "call" }, { "api_name": "scipy.stats.f.cdf", "line_number": 46, "usage_type": "call" }, { "api_name": "scipy.stats.f", "line_num...
45254772596
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Feb 20 23 20:40:00 @author: kirsh012 """ import matplotlib.pyplot as plt import pandas as pd import numpy as np import seaborn as sns import joblib from sklearn.model_selection import PredefinedSplit, GridSearchCV from sklearn.ensemble import RandomFo...
tk27182/masters-thesis
Code/run_test_randomforest.py
run_test_randomforest.py
py
3,799
python
en
code
0
github-code
6
[ { "api_name": "dataprocessing.load_data_nn", "line_number": 26, "usage_type": "call" }, { "api_name": "nn_models.split_data_cv_indx", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.full", "line_number": 48, "usage_type": "call" }, { "api_name": "n...
25145519000
from dataclasses import dataclass from typing import Any from msg.serializers import BaseExpenseCreationSerializer, BaseExpensePropertySerializer @dataclass class ExpenseCreationHelper: data: dict def __call__(self, *args: Any, **kwds: Any) -> Any: if not self._parse_data(): return ...
enamsaraev/tg_api
msg/helpers.py
helpers.py
py
1,000
python
en
code
0
github-code
6
[ { "api_name": "typing.Any", "line_number": 11, "usage_type": "name" }, { "api_name": "msg.serializers.BaseExpenseCreationSerializer", "line_number": 22, "usage_type": "call" }, { "api_name": "msg.serializers.BaseExpensePropertySerializer", "line_number": 30, "usage_type":...
5589205557
import re import plac import ujson as json from utils import load_jsonl_file, dumps_jsonl regex_ws = re.compile(r'\s+') def load_corpus(path): documents = json.load(open(path, 'r')) return documents def hydrate(parses, relation): doc = parses.get(relation['DocID']) text = doc.get('text', '') if d...
rknaebel/bbc-discourse
hydrate.py
hydrate.py
py
1,089
python
en
code
1
github-code
6
[ { "api_name": "re.compile", "line_number": 8, "usage_type": "call" }, { "api_name": "ujson.load", "line_number": 12, "usage_type": "call" }, { "api_name": "utils.load_jsonl_file", "line_number": 38, "usage_type": "call" }, { "api_name": "utils.dumps_jsonl", "l...
38081298604
import asyncio import threading from sqlalchemy.orm import Query from ConsumerService.consumer.persistence import db from ConsumerService.consumer.business import manage_event_data from aio_pika import connect, ExchangeType from flask import Flask, request, jsonify, Response app = Flask(__name__) @app.route('/getPa...
oran1980/clewMedical
application-assignment/ConsumerService/consumer/main.py
main.py
py
3,890
python
en
code
1
github-code
6
[ { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.request.args", "line_number": 15, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 15, "usage_type": "name" }, { "api_name": "flask.request.args"...
2721867306
""" api.py ~~~~~~ This file define simple REST APi for a Machine Learning Model """ from os import environ as env from joblib import load from flask import abort, Flask, jsonify, make_response, request from pandas import DataFrame service_name = env['SERVICE_NAME'] version = env['API_VERSION'] model = load('data/m...
repodevs/flask-machine-learning-service
api.py
api.py
py
846
python
en
code
0
github-code
6
[ { "api_name": "os.environ", "line_number": 15, "usage_type": "name" }, { "api_name": "os.environ", "line_number": 16, "usage_type": "name" }, { "api_name": "joblib.load", "line_number": 17, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 18...
5145788640
import enum from ocrdgen.font.font import FontManager from ocrdgen.image.background import BgManager from pathlib import Path import numpy as np from PIL import ImageDraw, Image from ocrdgen.ops import boxes_ops import cv2 as cv from collections import OrderedDict from .base import BaseDrawer from ocrdgen import model...
nunenuh/ocrdgen
ocrdgen/drawer/word.py
word.py
py
3,432
python
en
code
0
github-code
6
[ { "api_name": "base.BaseDrawer", "line_number": 15, "usage_type": "name" }, { "api_name": "PIL.Image", "line_number": 16, "usage_type": "name" }, { "api_name": "PIL.ImageDraw.Draw", "line_number": 29, "usage_type": "call" }, { "api_name": "PIL.ImageDraw", "lin...
73831952826
from odoo import api, models, fields, _ from odoo.exceptions import UserError import logging _logger = logging.getLogger(__name__) class LgpsPartner(models.Model): _inherit = 'res.partner' client_type = fields.Selection( [ ('new', _('New')), ('aftersales', _('After Sales')), ...
intralix/odoo-addons
lgps/models/custom_partner.py
custom_partner.py
py
2,580
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 5, "usage_type": "call" }, { "api_name": "odoo.models.Model", "line_number": 7, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 7, "usage_type": "name" }, { "api_name": "odoo.fields.Selecti...
13842222350
import cv2 import numpy as np import math from numpy import random as nr import sys def lines(code=None, step=12): l = np.zeros((h, w, 3), np.uint8) l[:] = 255 if code == 0: # - horizontal for i in range(0, h, step): l = cv2.line(l, (0, i), (w, i), black) elif code == 1: # | hor...
ZZ76/filters
crosshatching.py
crosshatching.py
py
3,968
python
en
code
4
github-code
6
[ { "api_name": "numpy.zeros", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 9, "usage_type": "attribute" }, { "api_name": "cv2.line", "line_number": 14, "usage_type": "call" }, { "api_name": "cv2.line", "line_number": 17,...
26822225482
import hashlib import base64 import os import sys from Crypto.Cipher import AES from hashlib import md5 from PyQt4 import QtGui, QtCore import collections from eclib import EC from eclib import DiffieHellman class MainWindow(QtGui.QWidget): def __init__(self): QtGui.QWidget.__init__(self) global ...
iCHAIT/Elliptical-Curve-Cryptography
gui.py
gui.py
py
6,704
python
en
code
24
github-code
6
[ { "api_name": "PyQt4.QtGui.QWidget", "line_number": 13, "usage_type": "attribute" }, { "api_name": "PyQt4.QtGui", "line_number": 13, "usage_type": "name" }, { "api_name": "PyQt4.QtGui.QWidget.__init__", "line_number": 16, "usage_type": "call" }, { "api_name": "PyQ...
30984123610
""" apps/docs/urls.py """ from django.urls import path from . import views app_name = 'docs' urlpatterns = [ path('', views.index, name='index'), path('overview/', views.overview, name='overview'), path('what_is_an_ordo/', views.what_is_an_ordo, name='what_is_an_ordo'), path('create_an_account/', vie...
BrRoman/ordomatic
ordomatic/apps/docs/urls.py
urls.py
py
709
python
en
code
3
github-code
6
[ { "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", "line_number": 11, "usage_type": "call" }, { "api_name": "django.urls.path", ...
42579723690
import os import git import datetime import argparse class was_it_rufus: """ A class that instantiates all variables and methods about git status. ... Methods ------- Prints the git status """ def __init__(self, git_directory): """ Constructs all the necessary att...
srirammura/was_it_rufus
main.py
main.py
py
2,076
python
en
code
0
github-code
6
[ { "api_name": "git.Repo", "line_number": 34, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 38, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 38, "usage_type": "attribute" }, { "api_name": "datetime.timede...
5001531967
from datetime import datetime from django import template from tag.models import Tag register = template.Library() @register.inclusion_tag('toptags.html') def toptags(): tags=Tag.objects.all().order_by('-followers_count')[:5] args={} args['tags']=tags return args @register.inclusion_tag('trendingtags....
duonghau/hoidap
tag/templatetags/tag_template.py
tag_template.py
py
745
python
en
code
0
github-code
6
[ { "api_name": "django.template.Library", "line_number": 4, "usage_type": "call" }, { "api_name": "django.template", "line_number": 4, "usage_type": "name" }, { "api_name": "tag.models.Tag.objects.all", "line_number": 8, "usage_type": "call" }, { "api_name": "tag.m...
1059675909
""" This module defines the interface for the Server. .. autoclass:: Server :members: :undoc-members: :show-inheritance: """ import atexit import base64 import logging import os import threading from functools import partial, wraps import pluginbase import tornado.httpserver import tornado.web from flask im...
OPSORO/OS
src/opsoro/server/__init__.py
__init__.py
py
7,251
python
en
code
9
github-code
6
[ { "api_name": "functools.partial", "line_number": 38, "usage_type": "call" }, { "api_name": "os.path", "line_number": 38, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 38, "usage_type": "call" }, { "api_name": "os.path.dirname", ...
41728763711
import os import datetime import time # requires import of opencv through pip # pip install opencv-python import cv2 # requires import of PIL pillow through pip # python -m pip install pillow from PIL import Image, ImageTk import sys import tkinter def my_VidFunction(vid_name): cap = cv2.VideoCapture(vid_name) #c...
icommonscrc/Looney-Toon
OpenVideoAtTimeV8.py
OpenVideoAtTimeV8.py
py
2,716
python
en
code
0
github-code
6
[ { "api_name": "cv2.VideoCapture", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.namedWindow", "line_number": 24, "usage_type": "call" }, { "api_name": "cv2.WINDOW_KEEPRATIO", "line_number": 24, "usage_type": "attribute" }, { "api_name": "cv2.setWin...
35023516423
import cv2 import time from base_camera import BaseCamera from Process import Process global sess class Camera(BaseCamera): video_source = 0 process = Process() @staticmethod def set_video_source(source): Camera.video_source = source # @staticmethod def frames(self): camera =...
Micbetter/ISense-flow
camera_opencv.py
camera_opencv.py
py
3,981
python
en
code
0
github-code
6
[ { "api_name": "base_camera.BaseCamera", "line_number": 8, "usage_type": "name" }, { "api_name": "Process.Process", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.CAP_PROP_F...
8665817734
import os import boto3 from elasticsearch import Elasticsearch from unittest import TestCase from me_articles_drafts_delete import MeArticlesDraftsDelete from tests_util import TestsUtil class TestMeArticlesDraftsDelete(TestCase): dynamodb = boto3.resource('dynamodb', endpoint_url='http://localhost:4569/') el...
AlisProject/serverless-application
tests/handlers/me/articles/drafts/delete/test_me_articles_drafts_delete.py
test_me_articles_drafts_delete.py
py
4,930
python
en
code
54
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 9, "usage_type": "name" }, { "api_name": "boto3.resource", "line_number": 10, "usage_type": "call" }, { "api_name": "elasticsearch.Elasticsearch", "line_number": 11, "usage_type": "call" }, { "api_name": "tests_uti...
23225332326
import copy import six from lxml import etree from ems.exceptions import SchemaException from ems.exceptions import ValidationException from ems.exceptions import XMLException from ems.schema import fields def parse_meta(name, bases, dct): """ Parse the _META_ attribute from a schema definition. """ ...
ceramyq/python-ems
ems/schema/base.py
base.py
py
7,670
python
en
code
0
github-code
6
[ { "api_name": "six.iteritems", "line_number": 38, "usage_type": "call" }, { "api_name": "ems.exceptions.SchemaException", "line_number": 53, "usage_type": "call" }, { "api_name": "six.iteritems", "line_number": 62, "usage_type": "call" }, { "api_name": "ems.except...
40106131495
from .auto import Auto import gettext def russian(text): text = text.replace("usage:", "использование:") text = text.replace("show this help message and exit", "показывает это сообщение и выходит") text = text.replace("error:", "ошибк...
Papr1ka/config
practice4/auto/cli.py
cli.py
py
1,875
python
ru
code
0
github-code
6
[ { "api_name": "gettext.gettext", "line_number": 23, "usage_type": "attribute" }, { "api_name": "gettext.bindtextdomain", "line_number": 26, "usage_type": "call" }, { "api_name": "gettext.textdomain", "line_number": 27, "usage_type": "call" }, { "api_name": "auto.A...
21529376169
from .base_view import ClassView def get_model_value(instance, field): try: value = getattr(instance, field) except Exception: if field.find('__') > 0: fields = field.split('__') elif field.find('.') > 0: fields = field.split('.') else: raise...
sajithak52/store-django-app
myproject/base_class/views/list_view.py
list_view.py
py
3,646
python
en
code
0
github-code
6
[ { "api_name": "base_view.ClassView", "line_number": 22, "usage_type": "name" }, { "api_name": "base_view.ClassView.__init__", "line_number": 30, "usage_type": "call" }, { "api_name": "base_view.ClassView", "line_number": 30, "usage_type": "name" }, { "api_name": "...
31333928448
#!/usr/bin/env python3 import atexit import copy import datetime import json import os import re import sys import threading import botocore from flask import Flask from prometheus_client import make_wsgi_app, Gauge from pyemvue import PyEmVue from pyemvue.enums import Scale, Unit from werkzeug.middleware.dispatcher ...
thebaron/vueprom
src/vueprom.py
vueprom.py
py
5,230
python
en
code
2
github-code
6
[ { "api_name": "threading.Thread", "line_number": 20, "usage_type": "call" }, { "api_name": "prometheus_client.Gauge", "line_number": 25, "usage_type": "call" }, { "api_name": "datetime.datetime.utcnow", "line_number": 32, "usage_type": "call" }, { "api_name": "dat...
23932718939
import os import numpy as np import pandas as pd from variables import csv_path, label_encode, file_name, cutoff from sklearn.utils import shuffle def preprocess_data(csv_path): df = pd.read_csv(csv_path) df = df.copy() df.dropna(axis=0, how='any', inplace=False) df['label'] = df.apply(y2indicator, axi...
1zuu/Pytroch-Examples
IrishClassifier/util.py
util.py
py
1,061
python
en
code
2
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "variables.csv_path", "line_number": 8, "usage_type": "argument" }, { "api_name": "sklearn.utils.shuffle", "line_number": 13, "usage_type": "call" }, { "api_name": "variables....
32055141770
import sqlite3 connection = sqlite3.connect('data.db') cursor = connection.cursor() def initiate_db(): cursor.execute('CREATE TABLE IF NOT EXISTS books(name text primary key, author text, year integer, read integer)') connection.commit() def add_db(book, author, year): try: cursor.execute("...
minnalisa/book_shelf
database2.py
database2.py
py
1,624
python
en
code
0
github-code
6
[ { "api_name": "sqlite3.connect", "line_number": 3, "usage_type": "call" }, { "api_name": "sqlite3.IntegrityError", "line_number": 16, "usage_type": "attribute" } ]
9434937105
import random import datetime import urllib from optparse import make_option from django.core.management.base import BaseCommand from django.core.files.storage import default_storage from django.core.files.base import File try: from django.contrib.auth import get_user_model User = get_user_model() except Impor...
fusionbox/django-fusionbox-blog
fusionbox/blog/management/commands/seed_blogs.py
seed_blogs.py
py
3,513
python
en
code
1
github-code
6
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 11, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 43, "usage_type": "call" }, { "api_name": "urllib.urlretrieve", "line_number": 54, "usage_type": "call" }, { "api_name": "u...
15420800470
from selenium import webdriver from selenium.webdriver.common.keys import Keys import time import urllib.request # 132 명의 남자 연예인들 man_list = [ '장근석', '유아인', '유동근', '이서진', '송일국', '최재성', '장혁', '김민종', '지창욱', '주진모', '안성기', '이순재', '신영균', '이정재', ...
myoons/CycleGAN-Gender-Changer
data_utils/Korean_Crawling/man_crawling.py
man_crawling.py
py
4,090
python
en
code
6
github-code
6
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 144, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 144, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.keys.Keys.RETURN", "line_number": 152, "usage_type": "attribute"...