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
25815068031
import csv from utils import DateCounter def pad(filename: str): #---------------read_in--------------- data = [] with open(filename, mode='r') as file: reader = csv.reader(file) for row in reader: data.append(row) #---------------padding--------------- newdata = [] ...
UX404/Financial-data-processing
data_process/padding.py
padding.py
py
1,068
python
en
code
0
github-code
6
[ { "api_name": "csv.reader", "line_number": 8, "usage_type": "call" }, { "api_name": "utils.DateCounter", "line_number": 15, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 28, "usage_type": "call" } ]
12100401616
''' Aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it deosn't mttaer in waht oredr the ltteers in a wrod are, the olny iprmoatnt tihng is taht the frist and lsat ltteers be at the rghit pclae. The rset can be a toatl mses and you can sitll raed it wouthit porbelm. Tihs is bcuseae the huamn mnid deos not raed ervey ...
Shaywei/MyDevTools
Python/misc/mock_iterview_quinn.py
mock_iterview_quinn.py
py
1,757
python
en
code
0
github-code
6
[ { "api_name": "collections.Counter", "line_number": 29, "usage_type": "call" } ]
38870006486
import gym import tensorflow as tf from tensorflow import keras import random import numpy as np import datetime as dt import imageio import os # # conda activate tf # export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/ # conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0 # o pip install tensorflow # p...
nhovadia/CSCI4830_final_project
SpaceInvaders_Training.py
SpaceInvaders_Training.py
py
21,331
python
en
code
0
github-code
6
[ { "api_name": "gym.make", "line_number": 54, "usage_type": "call" }, { "api_name": "tensorflow.keras.Model", "line_number": 59, "usage_type": "attribute" }, { "api_name": "tensorflow.keras", "line_number": 59, "usage_type": "name" }, { "api_name": "tensorflow.kera...
37158413403
from sklearn.datasets import load_iris from sklearn.preprocessing import StandardScaler import matplotlib.pyplot as plt from sklearn.decomposition import PCA data = load_iris() X = data.data X[:, 0] /= 2.54 X[:, 1] /= 100 def scikit_pca(X): X_std = StandardScaler().fit_transform(X) sklearn_pca = PCA(n_compone...
QiliWu/Python-datavis
datavis/PCA.py
PCA.py
py
668
python
en
code
2
github-code
6
[ { "api_name": "sklearn.datasets.load_iris", "line_number": 6, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.StandardScaler", "line_number": 12, "usage_type": "call" }, { "api_name": "sklearn.decomposition.PCA", "line_number": 13, "usage_type": "call" }, ...
20913974107
from django.contrib import admin from django.urls import path, include from django.conf import settings from django.conf.urls.static import static from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView from rest_framework import permissions from drf_yasg.views import get_schema_view from drf_...
almazuulu/BookCatalogue
bookcatalogue/bookcatalogue/urls.py
urls.py
py
1,502
python
en
code
0
github-code
6
[ { "api_name": "drf_yasg.views.get_schema_view", "line_number": 13, "usage_type": "call" }, { "api_name": "drf_yasg.openapi.Info", "line_number": 14, "usage_type": "call" }, { "api_name": "drf_yasg.openapi", "line_number": 14, "usage_type": "name" }, { "api_name": ...
16627798046
from flask import Flask, request import json app = Flask(__name__) # create python dictionary to hold user data user_account = { 1: {"first_name": 'betty', "last_name": 'joy', "phone_number": '0493827405', "email_address": 'bettyjoy@accounts.com' } } user_count = 1 ...
rikiapst/cephaloPy
user.py
user.py
py
995
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 29, "usage_type": "call" }, { "api_name": "flask.request.data", "line_number": 29, "usage_type": "attribute" }, { "api_name": "flask.request", "li...
21952104219
import itertools import logging from django.conf import settings from django.core.management.base import BaseCommand from autoslug.utils import slugify from rainboard.models import ( Forge, Namespace, Project, Robotpkg, update_github, update_gitlab, ) class Command(BaseCommand): help = ...
Gepetto/dashboard
rainboard/management/commands/project.py
project.py
py
2,763
python
en
code
0
github-code
6
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 19, "usage_type": "name" }, { "api_name": "django.conf.settings.RAINBOARD_RPKG", "line_number": 27, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 27, "usage_type": ...
29462931299
from evdev import ecodes from datetime import datetime, timedelta from four_button_pages import StaticMenu, TokenEntryMenu, PAYGStatusMenu, ServiceMenu class FourButtonUserInterface(object): BACKLIGHT_TIMEOUT = 300 def __init__(self, lcd, conn, kbd, static_pages): self.conn = conn self.disp ...
victronenergy/dbus-characterdisplay
four_button_ui.py
four_button_ui.py
py
4,511
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 15, "usage_type": "name" }, { "api_name": "four_button_pages.PAYGStatusMenu", "line_number": 22, "usage_type": "call" }, { "api_name...
29224887814
""" Plot cross-section profile: Multiple cross-sections """ import sys sys.path.append('/home/zhouyj/software/seis_view') import numpy as np import matplotlib.pyplot as plt from reader import read_ctlg, slice_ctlg import warnings warnings.filterwarnings("ignore") # i/o paths fctlg = 'input/catalog_example.csv' title =...
ali4413/Seismicity-Visualization
Python/plot_prof_multi-cross-sec.py
plot_prof_multi-cross-sec.py
py
3,432
python
en
code
null
github-code
6
[ { "api_name": "sys.path.append", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "warnings.filterwarnings", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.array", ...
38710107620
from discord_slash import cog_ext from discord.ext import commands from txns import get_wallet import asyncio from embeds import * import discord import pytz from datetime import datetime import random from client import client from txns import * from whitelist import ghosts, ghostsIcons, fo_rank1, fo_rank2, fo_rank3, ...
AngelsOfAres/Fallen-Order-Keepers
c_heimdall/transfers.py
transfers.py
py
32,658
python
en
code
1
github-code
6
[ { "api_name": "client.client.get_guild", "line_number": 16, "usage_type": "call" }, { "api_name": "client.client", "line_number": 16, "usage_type": "name" }, { "api_name": "discord.ext.commands.Cog", "line_number": 21, "usage_type": "attribute" }, { "api_name": "d...
26833816694
# https://pypi.org/project/firebirdsql/ # pip install firebirdsql import firebirdsql from decouple import config # pip install mysql-connector-python import mysql.connector import re import os try: # Mysql Local # con_mysql = mysql.connector.connect( # host=config("host"), # user=config("user...
sistemadevsys/db_firebird_mysql
update_clientes.py
update_clientes.py
py
1,549
python
en
code
0
github-code
6
[ { "api_name": "mysql.connector.connector.connect", "line_number": 20, "usage_type": "call" }, { "api_name": "mysql.connector.connector", "line_number": 20, "usage_type": "attribute" }, { "api_name": "mysql.connector", "line_number": 20, "usage_type": "name" }, { "...
19663543751
import tensorflow as tf, numpy as np import pandas as pd import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes from baselines.bench.monitor import load_results logger_dir = '/home/lihepeng/Documents/Github/tmp/ev/cpo/train' df_train = load_results(logger_dir) logger_dir =...
liudading/tmp
ev/plot_d.py
plot_d.py
py
5,409
python
en
code
0
github-code
6
[ { "api_name": "baselines.bench.monitor.load_results", "line_number": 8, "usage_type": "call" }, { "api_name": "baselines.bench.monitor.load_results", "line_number": 11, "usage_type": "call" }, { "api_name": "baselines.bench.monitor.load_results", "line_number": 14, "usage...
40095183195
from airflow import DAG from airflow.operators.dummy_operator import DummyOperator from airflow.operators.python_operator import PythonOperator from datetime import datetime from Tecnocasa.tecnocasa_main import scrape_tecnocasa_url default_args = { 'start_date': datetime(2023, 1, 1), 'retries': 1, } dag = DAG...
pasqualepescina/AIHome
dags/dag.py
dag.py
py
630
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime", "line_number": 8, "usage_type": "call" }, { "api_name": "airflow.DAG", "line_number": 12, "usage_type": "call" }, { "api_name": "airflow.operators.dummy_operator.DummyOperator", "line_number": 14, "usage_type": "call" }, { "api_n...
8757517027
from urllib3.exceptions import ProtocolError, ReadTimeoutError import tweepy import dataset import json from tweepy import StreamListener from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer from textblob import TextBlob from models import * import pandas as pd import numpy as np from config import * e...
paulinaczheng/twitter_flu_tracking
twitter_package/tweet-stream.py
tweet-stream.py
py
6,168
python
en
code
11
github-code
6
[ { "api_name": "vaderSentiment.vaderSentiment.SentimentIntensityAnalyzer", "line_number": 17, "usage_type": "call" }, { "api_name": "tweepy.API", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 70, "usage_type": "call" }, { "ap...
32802746456
import gensim import gensim.downloader as api from gensim.models import Word2Vec as w2v import inspect import logging import warnings import numpy as np from sklearn import * from sklearn.metrics.pairwise import cosine_similarity from sklearn.metrics.pairwise import pairwise_distances import os ...
d4g10ur0s/InformationRetrieval_21_22
paradotea/erwthma_4.py
erwthma_4.py
py
9,321
python
en
code
0
github-code
6
[ { "api_name": "elasticsearch.Elasticsearch", "line_number": 39, "usage_type": "call" }, { "api_name": "warnings.filterwarnings", "line_number": 63, "usage_type": "call" }, { "api_name": "gensim.models.Word2Vec.load", "line_number": 98, "usage_type": "call" }, { "a...
17961034725
from flask import render_template, redirect, url_for, request from surv import app from .storage import c, new_game, save_game, load_game @app.route('/') def home(): return redirect(url_for('new')) @app.route('/new/') def new(): new_game() return redirect(url_for('list')) @app.route('/list/') def list():...
pkugelmass/survivor
surv/routes.py
routes.py
py
1,892
python
en
code
0
github-code
6
[ { "api_name": "flask.redirect", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.url_for", "line_number": 7, "usage_type": "call" }, { "api_name": "surv.app.route", "line_number": 5, "usage_type": "call" }, { "api_name": "surv.app", "line_number"...
34528771620
# https://medium.com/javarevisited/the-ultimate-guide-to-binary-trees-47112269e6fc # There are two ways check both #udacity course way class Node(object): def __init__(self, value): self.value = value self.left = None self.right = None class BinaryTree(object): def __init__(self, ...
ved93/PythonPractice
data-strutures/binary_tree.py
binary_tree.py
py
3,507
python
en
code
0
github-code
6
[ { "api_name": "collections.deque", "line_number": 87, "usage_type": "call" } ]
20831019932
from django.urls import path from posts.views import * urlpatterns = [ path("", MainPage.as_view(), name="main"), path("follow_post/", FollowPost.as_view(), name="follow_post"), path("posts/<int:user_id>/", PostByUserId.as_view(), name="post"), path("posts/view_post/<int:post_id>", ViewPost.as_view()...
YevheniiMorozov/social
gramm/posts/urls.py
urls.py
py
632
python
en
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", ...
24529853326
import numpy as np import torch import torch.nn as nn from lib.datasets.utils import class2angle from utils import box_ops import math padsize = np.array([28.,11.],dtype=np.float32) device = torch.device("cuda" if torch.cuda.is_available() else "cpu") def affine_transform(pt, t): new_pt = np.array([pt[0], pt[1...
HIYYJX/MonoGAE
lib/helpers/decode_helper.py
decode_helper.py
py
10,233
python
en
code
4
github-code
6
[ { "api_name": "numpy.array", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.device", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", ...
8561287023
import requests import json from typing import Dict, List from config.config_secret import secret_file_path class Auth: @classmethod def get_secret(cls, secret_types: List[str]) -> Dict[str,str]: """json 파일로부터 요구되는 시크릿키 목록을 읽어 반환한다. Args: secret_types : 요구되는 시크릿 키 이름들을 담은 배열 ...
Ywoosang/Dossa-Notification
app/auth/auth.py
auth.py
py
4,905
python
ko
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 9, "usage_type": "name" }, { "api_name": "config.config_secret.secret_file_path", "line_number": 24, "usage_type": "argument" }, { "api_name": "json.load", "line_number": 25, "usage_type": "call" }, { "api_name": "typing...
14958626079
# -*- coding: utf-8 -*- from datetime import datetime, date import logging import re ERROR_PARSING_DATE = "Error parsing date" def from_iso_format(string): parts = [int(a) for a in string.split("-")] if len(parts) != 3: raise ValueError return date(parts[0], parts[1], parts[2]) def datetime...
getyoti/yoti-python-sdk
yoti_python_sdk/date_parser.py
date_parser.py
py
1,157
python
en
code
9
github-code
6
[ { "api_name": "datetime.date", "line_number": 17, "usage_type": "call" }, { "api_name": "re.split", "line_number": 23, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 26, "usage_type": "call" }, { "api_name": "logging.warning", "line_...
22648817021
import matplotlib.pyplot as plt from scipy.io import loadmat import numpy as np import pandas from os.path import join,exists from os import mkdir import cv2 import math import os rho = 1 actions = ['No-Action', 'sweeping', 'gargling', 'opening cupboard', 'washing hands', 'eating', 'writing', 'wiping', 'dr...
Vincent-Fer/activity-recognition-prediction-online
encodage/encodage.py
encodage.py
py
11,449
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 17, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.gca", "line_number": 25, "usage_type": "call" }, { "api_name": "matp...
19024426652
from enum import Enum from typing import Union from typing import NamedTuple from typing import Callable class TaskType(Enum): """Type of machine learning task Attributes ---------- MULTI_CLASS_CLASSIFICATION multi-class classification MULTI_LABEL_CLASSIFICATION multi-label classi...
DanRuta/xva-trainer
lib/_dev/pyannote/audio/train/task.py
task.py
py
5,402
python
en
code
78
github-code
6
[ { "api_name": "enum.Enum", "line_number": 7, "usage_type": "name" }, { "api_name": "enum.Enum", "line_number": 28, "usage_type": "name" }, { "api_name": "typing.NamedTuple", "line_number": 43, "usage_type": "name" }, { "api_name": "torch.nn.nn.LogSoftmax", "li...
37273642245
import rosbag import sys import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import numpy as np import csv import glob import os from tf.transformations import euler_from_quaternion from scipy.interpolate import interp1d from scipy.spatial.transform import Rotation as R import numpy as np if (len(s...
ZiyouZhang/rotors_datmo
scripts/bag_analysis.py
bag_analysis.py
py
13,599
python
en
code
4
github-code
6
[ { "api_name": "sys.argv", "line_number": 14, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 15, "usage_type": "attribute" }, { "api_name": "glob.glob", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18...
22388129127
import pygame # Initialize pygame pygame.init() # Set up window size = (400, 400) screen = pygame.display.set_mode(size) pygame.display.set_caption("Circle Line") # Set up colors WHITE = (0, 0, 0) RED = (255, 0, 0) GREEN = (0, 255, 0) click_sound = pygame.mixer.Sound("clicked_sound.mp3") # Set up circles circle_ra...
Vormamim/boxes
matrix_stage3.py
matrix_stage3.py
py
2,268
python
en
code
1
github-code
6
[ { "api_name": "pygame.init", "line_number": 4, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pygame.display.s...
30859953212
import configparser import pandas as pd from datetime import datetime import os from pyspark.sql import SparkSession from pyspark.sql.functions import udf, col from pyspark.sql.functions import year, month, dayofmonth, hour, weekofyear, dayofweek, date_format import pyspark.sql.functions as F from pyspark.sql.types imp...
yashth/Data_Lake
etl.py
etl.py
py
7,406
python
en
code
0
github-code
6
[ { "api_name": "configparser.ConfigParser", "line_number": 11, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pyspark.sql...
3323951129
#!/usr/bin/python import os import re import math import matplotlib.pyplot as plt import numpy from numpy import sin, pi, arange import astropy.io from astropy.io import fits from PIL import Image # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # This script contrasts photon index and l...
aprilcotwut/photon_index_binning
compare_bin.py
compare_bin.py
py
15,988
python
en
code
0
github-code
6
[ { "api_name": "os.listdir", "line_number": 27, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 27, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 31, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.figure",...
20146094706
from datetime import datetime, timedelta from tqdm import tqdm import aiohttp import asyncio from pymongo import MongoClient from private import royale_token client = MongoClient('mongodb://localhost:27017/') MAX_TROPHIES = "Соперник(и) с наибольшим количеством кубков:" MAX_BEST_TROPHIES = "Соперник(и) с наибольши...
dfomin/clashroyaledata
data_analyzer.py
data_analyzer.py
py
8,146
python
en
code
0
github-code
6
[ { "api_name": "pymongo.MongoClient", "line_number": 10, "usage_type": "call" }, { "api_name": "private.royale_token", "line_number": 52, "usage_type": "name" }, { "api_name": "private.royale_token", "line_number": 69, "usage_type": "name" }, { "api_name": "datetim...
24958905519
import bpy from bpy.props import * from bpy.types import Node, NodeSocket from arm.logicnode.arm_nodes import * class SwitchNode(Node, ArmLogicTreeNode): '''Switch node''' bl_idname = 'LNSwitchNode' bl_label = 'Switch' bl_icon = 'CURVE_PATH' min_inputs = 1 min_outputs = 1 def __init__(...
phillipmacon/armory-3d-engine
blender/arm/logicnode/logic_switch.py
logic_switch.py
py
1,162
python
en
code
0
github-code
6
[ { "api_name": "bpy.types.Node", "line_number": 6, "usage_type": "name" } ]
26486257932
import dcos.config import dcos.http import dcos.package import json import logging import os import re import requests import s3 import shakedown import subprocess import urllib def _init_logging(): logging.basicConfig(level=logging.INFO) logging.getLogger('dcos').setLevel(logging.WARNING) logging.getLog...
KoddiDev/spark-streaming-mesos
tests/utils.py
utils.py
py
8,430
python
en
code
1
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 17, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "logging.WARNI...
41814241194
from django.shortcuts import render, get_object_or_404 from django.http import Http404 from .models import Question # Create your views here. def index(request): try: latest_question_list = Question.objects.order_by('pub_date')[:5] except Question.DoesNotExist: raise Http404('Question does ...
Vladimir-vut/django_mysite
mysite/pools/views.py
views.py
py
1,074
python
en
code
0
github-code
6
[ { "api_name": "models.Question.objects.order_by", "line_number": 12, "usage_type": "call" }, { "api_name": "models.Question.objects", "line_number": 12, "usage_type": "attribute" }, { "api_name": "models.Question", "line_number": 12, "usage_type": "name" }, { "api...
11342650070
# -*- encoding: utf-8 -*- import requests from scdl import CLIENT_ID class Client(): def get_collection(self, url, token, maxpage): params = { 'client_id': CLIENT_ID, 'linked_partitioning': '1', } if token: params['oauth_token'] = token resourc...
jz1/scdl
scdl/client.py
client.py
py
1,399
python
en
code
null
github-code
6
[ { "api_name": "scdl.CLIENT_ID", "line_number": 11, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 19, "usage_type": "call" } ]
36947412448
from functools import partial from random import shuffle from kivy.clock import Clock from kivy.app import App from kivy.lang import Builder import ani_property ani_property.install() KV_CODE = r''' GridLayout: rows: 4 cols: 4 padding: 20 spacing: 20 ''' def shuffle_children(widget, dt): childr...
gottadiveintopython/ani-property
examples/magnet.py
magnet.py
py
1,011
python
en
code
0
github-code
6
[ { "api_name": "ani_property.install", "line_number": 8, "usage_type": "call" }, { "api_name": "random.shuffle", "line_number": 23, "usage_type": "call" }, { "api_name": "kivy.app.App", "line_number": 28, "usage_type": "name" }, { "api_name": "kivy.lang.Builder.loa...
36010827079
import json import serial import numpy as np class CameraMLX90640(serial.Serial): """ Implements communications camera_mlx90640_firmware """ FRAME_HEIGHT = 24 FRAME_WIDTH = 32 def __init__(self, port): self.port_param = {'port': port, 'baudrate': 115200, 'timeout': 2.0} super(...
willdickson/camera_mlx90640
camera_mlx90640/camera_mlx90640.py
camera_mlx90640.py
py
1,876
python
en
code
0
github-code
6
[ { "api_name": "serial.Serial", "line_number": 5, "usage_type": "attribute" }, { "api_name": "json.dumps", "line_number": 33, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 39, "usage_type": "call" }, { "api_name": "json.decoder", "line_numb...
40899444822
"""DeviceManagement URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') ...
BensonXiong/DeviceManagement
DeviceManagement/DeviceManagement/urls.py
urls.py
py
1,371
python
en
code
0
github-code
6
[ { "api_name": "django.conf.urls.url", "line_number": 21, "usage_type": "call" }, { "api_name": "django.conf.urls.include", "line_number": 21, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 21, "usage_type": "attribute" }, { "api_...
34253272584
from flask_app.config.mysqlconnection import connectToMySQL from flask import flash from flask import re # the regex module # create a regular expression object that we'll use later EMAIL_REGEX = re.compile(r'^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9._-]+\.[a-zA-Z]+$') class User: def __init__( self , data ): self....
gerald-cakoni/PythonAssignments
flask_mysql/validation/dojo_survey/flask_app/models/user.py
user.py
py
2,765
python
en
code
0
github-code
6
[ { "api_name": "flask.re.compile", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.re", "line_number": 5, "usage_type": "name" }, { "api_name": "flask_app.config.mysqlconnection.connectToMySQL", "line_number": 23, "usage_type": "call" }, { "api_name"...
30056444826
import re from collections import defaultdict def parse_rule_container(rule): regex = re.compile(r'(.*) bags contain(.*)') matches = regex.match(rule) return matches.group(1), matches.group(2) def parse_contained_rule(rule): regex = re.compile(r'((\d+) ([a-z ]+) bag)+') all_matches = regex.finda...
nithish-thomas/adventOfCode2020
aoc20/day7/day7_1.py
day7_1.py
py
1,700
python
en
code
0
github-code
6
[ { "api_name": "re.compile", "line_number": 6, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 12, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 30, "usage_type": "call" }, { "api_name": "collections.defaultdict"...
10812461830
# -*- coding: utf-8 -*- import os from sys import path from django.conf.global_settings import (TEMPLATE_CONTEXT_PROCESSORS, STATICFILES_FINDERS) BASE_DIR = os.path.dirname(os.path.dirname(__file__)) path.append(os.path.join(BASE_DIR, 'apps')) SECRET_KEY = '_c#^&2xzwd@xt@i2b...
andreyshipilov/wknd_django
wknd_project/settings/common.py
common.py
py
2,378
python
en
code
1
github-code
6
[ { "api_name": "os.path.dirname", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.path", "line_numbe...
19593396615
import h5py import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap from mpl_toolkits.mplot3d import Axes3D from sklearn.metrics import roc_auc_score, roc_curve import numpy as np from tensorflow.keras import datasets, layers, models from sklearn.metrics import confusion_matrix ...
Yoichiro-Y/oc-nn-ensemble
.history/mnist_20221216201506.py
mnist_20221216201506.py
py
1,596
python
en
code
0
github-code
6
[ { "api_name": "h5py.File", "line_number": 17, "usage_type": "call" }, { "api_name": "tensorflow.keras.datasets.mnist.load_data", "line_number": 19, "usage_type": "call" }, { "api_name": "tensorflow.keras.datasets.mnist", "line_number": 19, "usage_type": "attribute" }, ...
39869333421
from django import forms from .models import Order, ProductReview PRODUCT_QUANTITY_CHOICES = [(i, str(i)) for i in range(1, 21)] class CustomSelectWidget(forms.Select): template_name = 'store/tst.html' class OrderForm(forms.Form): '''in the single_product view, we pass the product instance to the form.''' ...
TodorToshev/Own-Blueprint
store/forms.py
forms.py
py
1,612
python
en
code
1
github-code
6
[ { "api_name": "django.forms.Select", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 6, "usage_type": "name" }, { "api_name": "django.forms.Form", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.for...
24370174876
import unittest import matplotlib.pyplot as plt class TestCreateParticles(unittest.TestCase): def test_create_particles(self): from src.dataio import GridIO, FlowIO from src.create_particles import Particle, LaserSheet, CreateParticles # Read-in the grid and flow file grid = GridI...
kalagotla/syPIV
test/test_create_paritcles.py
test_create_paritcles.py
py
2,496
python
en
code
0
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 5, "usage_type": "attribute" }, { "api_name": "src.dataio.GridIO", "line_number": 11, "usage_type": "call" }, { "api_name": "src.dataio.FlowIO", "line_number": 14, "usage_type": "call" }, { "api_name": "src.create_...
2310558186
import requests import os from requests_oauthlib import OAuth2Session from dotenv import load_dotenv load_dotenv() from config import twitter_scopes from mongo_db import mongo redirect_uri = os.environ.get("REDIRECT_URI") client_id = os.environ.get("CLIENT_ID") class Token_Manager(): def __init__(self): ...
tyrovirtuosso/Twitter_Bookmark-Manager
token_manager.py
token_manager.py
py
1,780
python
en
code
6
github-code
6
[ { "api_name": "dotenv.load_dotenv", "line_number": 5, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 10, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.environ.get", ...
39269918095
import copy import os import shlex import sys import textwrap from functools import wraps def bash_quote(w, quote): ''' Quote word *w* with quote character *quote* which may be empty, single quote or double quote. ''' assert quote in ('', '"', "'") if quote == "'": w = w.replace("'", quote...
1and1/dim
ndcli/dimcli/cliparse.py
cliparse.py
py
19,558
python
en
code
39
github-code
6
[ { "api_name": "os.environ.get", "line_number": 31, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 31, "usage_type": "attribute" }, { "api_name": "copy.deepcopy", "line_number": 56, "usage_type": "call" }, { "api_name": "copy.copy", "line_nu...
25262905175
import datetime import logging from concurrent import futures from google.appengine.ext import ndb from upvote.gae.bigquery import tables from upvote.gae.datastore.models import exemption as exemption_models from upvote.gae.datastore.models import host as host_models from upvote.gae.datastore.models import policy as...
google/upvote_py2
upvote/gae/lib/exemption/api.py
api.py
py
21,555
python
en
code
449
github-code
6
[ { "api_name": "upvote.shared.constants.EXEMPTION_STATE", "line_number": 24, "usage_type": "attribute" }, { "api_name": "upvote.shared.constants", "line_number": 24, "usage_type": "name" }, { "api_name": "upvote.shared.constants.PLATFORM", "line_number": 72, "usage_type": ...
4143583368
import torch import torchvision from torchvision.io import read_image import os from torch.utils.data import Dataset """ This part of the script is an easy API to load and get the datasets """ def get_dataset(dataset: str, c_angle=30, new_size=[32, 32], batch_size=300): """ :param new_size: :param c_ang...
TamirShazman/ML2-Project
code/datasets.py
datasets.py
py
3,740
python
en
code
0
github-code
6
[ { "api_name": "torchvision.transforms.ToTensor", "line_number": 22, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 22, "usage_type": "attribute" }, { "api_name": "torchvision.transforms.ToTensor", "line_number": 24, "usage_type": "call" }...
33975836628
from flask import Flask, g from flask.ext.login import LoginManager import user_model DEBUG = True PORT = 8000 HOST = '0.0.0.0' app = Flask(__name__) app.secret_key = 'randomstuff' login_manager = LoginManager() login_manager.init_app(app) login_manager.login_view = 'login' @login_manager.user_loader def load_user...
kaka21garuda/FlaskSocial
app.py
app.py
py
972
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.ext.login.LoginManager", "line_number": 13, "usage_type": "call" }, { "api_name": "user_model.User.get", "line_number": 20, "usage_type": "call" }, { "api_name": "user_mod...
42663326199
import os import numpy as np import pandas as pd import matplotlib matplotlib.use('agg') import matplotlib.pyplot as plt plt.ioff() import seaborn def compare_abs_auroc_differences(results_dir, model_a_path, model_a_descriptor, model_b_path, model_b...
rachellea/explainable-ct-ai
src/evals/eval_by_scan_attr_compare.py
eval_by_scan_attr_compare.py
py
7,694
python
en
code
3
github-code
6
[ { "api_name": "matplotlib.use", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.ioff", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 8, "usage_type": "name" }, { "api_name": "os.path.exists",...
71964995709
from sklearn.neural_network import MLPClassifier from sklearn.model_selection import GridSearchCV from sklearn.model_selection import train_test_split from sklearn.metrics import precision_recall_curve from sklearn.metrics import roc_auc_score import os import dill as dpickle import numpy as np import pandas as pd imp...
kubeflow/code-intelligence
py/label_microservice/mlp.py
mlp.py
py
6,621
python
en
code
55
github-code
6
[ { "api_name": "sklearn.model_selection.train_test_split", "line_number": 72, "usage_type": "call" }, { "api_name": "sklearn.metrics.precision_recall_curve", "line_number": 83, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 83, "usage_type": "call" }...
23555067153
#!/usr/bin/python3 import numpy, tqdm, json, os, random import scipy.signal import util import speech_features RATE = 8000 NUMCEP = 16 CLASSES = 45 LENGTH = 4000 DELTA = 2000 LABEL_SCALE = 100 LABEL_SAVE_JSON = "switchboard-labels.json" OUT_FILE = "melspecs-switchboard.npy" EMPTY = "<EMPTY>" SIL = "SIL" SIL_DROPO...
ychnlgy/Switchboard2.0
src/load.py
load.py
py
5,989
python
en
code
0
github-code
6
[ { "api_name": "os.path.join", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "util.FragmentedFile", "line_number": 26, "usage_type": "call" }, { "api_name": "matplotlib.use", "l...
71592748667
import datetime import json import math import threading import traceback import asyncio import pandas as pd from constants import ( MAP_MARKET_ID_TO_NAME as MARKET_MAP, AVAILABLE_MARKETS, ALL_MARKET_LABEL, QUERY_INTERVAL, MINT_DIVISOR, CONTRACT_ADDRESS ) from prometheus_metrics import metrics...
overlay-market/ChainMonitoring
metrics/upnl.py
upnl.py
py
9,876
python
en
code
0
github-code
6
[ { "api_name": "constants.CONTRACT_ADDRESS", "line_number": 24, "usage_type": "name" }, { "api_name": "json.dump", "line_number": 29, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 54, "usage_type": "call" }, { "api_name": "constants.AVAIL...
29906192183
# ***** BEGIN GPL LICENSE BLOCK ***** # # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distribute...
meshonline/Surface-Heat-Diffuse-Skinning
addon/surface_heat_diffuse_skinning/__init__.py
__init__.py
py
14,549
python
en
code
170
github-code
6
[ { "api_name": "bpy.types", "line_number": 43, "usage_type": "attribute" }, { "api_name": "bpy.ops.object.mode_set", "line_number": 66, "usage_type": "call" }, { "api_name": "bpy.ops", "line_number": 66, "usage_type": "attribute" }, { "api_name": "bpy.ops.object.mo...
35243133405
import sys import os import json if "test_script" not in sys.modules: from pyakaikkr.CompareCifKkr import CompareCifKkr def get_kkr_struc_from_cif(ciffilepath: str, specx: str, displc: bool, use_bravais=True, remove_temperaryfiles=True, fmt="cif"): """get...
AkaiKKRteam/AkaiKKRPythonUtil
util/cif2kkr_test_script/cif2kkr_convert_to_akaikkrparam_sample.py
cif2kkr_convert_to_akaikkrparam_sample.py
py
3,825
python
en
code
4
github-code
6
[ { "api_name": "sys.modules", "line_number": 5, "usage_type": "attribute" }, { "api_name": "pyakaikkr.CompareCifKkr.CompareCifKkr", "line_number": 32, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 42, "usage_type": "call" }, { "api_name": "os.rmd...
7577852611
from django import forms from models import Attachment class AttachmentForm(forms.ModelForm): def __init__(self, *args, **kwargs): self.user = kwargs.pop('user', None) self.actived = kwargs.pop('actived', False) super(AttachmentForm, self).__init__(*args, **kwargs) def sav...
vicalloy/django-lb-attachments
attachments/forms.py
forms.py
py
616
python
en
code
7
github-code
6
[ { "api_name": "django.forms.ModelForm", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 5, "usage_type": "name" }, { "api_name": "models.Attachment", "line_number": 20, "usage_type": "name" } ]
38316017126
from flask import Flask from flask_sqlalchemy import SQLAlchemy db = SQLAlchemy() #imports routes from .routes import home_blueprint # from .database.model import * def create_app(): app = Flask(__name__) #load config file app.config.from_object("project.config.Config") #routes app.register_bl...
vipin733/flask_boilerplate
services/web/project/__init__.py
__init__.py
py
427
python
en
code
0
github-code
6
[ { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 4, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 12, "usage_type": "call" }, { "api_name": "routes.home_blueprint", "line_number": 18, "usage_type": "argument" } ]
37842291992
# ---------------------------------------------------------------------------------------------------------------------- # Implementation of k-Means Machine learning algorithm, tested using synthetic data created in script # # Sean Taylor Thomas # 9/2021 # stth223@uky.edu # ---------------------------------------------...
STaylorT/Machine-Learning
K-Means.py
K-Means.py
py
5,400
python
en
code
0
github-code
6
[ { "api_name": "random.seed", "line_number": 14, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 21, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 22, "usage_type": "call" }, { "api_name": "sys.maxsize", "line_num...
36387303386
import matplotlib.pyplot as plt import numpy as np import pandas as pd from sklearn.datasets import fetch_openml import torch import torch.nn as nn import torch.optim as optim from torch.utils.data import DataLoader, TensorDataset from sklearn.model_selection import train_test_split from matplotlib.colors import Linear...
quentinRolld/Adversarial_attack
generalization/train_gen.py
train_gen.py
py
9,674
python
en
code
1
github-code
6
[ { "api_name": "torch.tensor", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.float32", "line_number": 22, "usage_type": "attribute" }, { "api_name": "torch.tensor", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.long", "line_n...
30419861071
""" An AI agent that will explore its environment and perform certain tasks (mining, smelting, forging, and buying/selling items) """ import sys from time import sleep import traceback import cv2 import pyautogui from game_map import GameMap import utilities as utils from user_interface import UserInterface fro...
jeffaustin32/game_ai
main.py
main.py
py
1,821
python
en
code
0
github-code
6
[ { "api_name": "player.Player.TASKS", "line_number": 15, "usage_type": "attribute" }, { "api_name": "player.Player", "line_number": 15, "usage_type": "name" }, { "api_name": "sys.argv", "line_number": 16, "usage_type": "attribute" }, { "api_name": "player.Player.TA...
44408183986
#!/usr/bin/env python # coding: utf-8 # ## This Jupyter notebook will show you to perform basic calculations and plots with 2 dimensional data (matrices, ) # # ## We will compare two images: # ### * MODIS-AQUA - 31st August 2005 # ### * MODIS-AQUA - 16th Feburary 2017 # # Now, we will need to import several packages...
afonsomferreira/ppm_jupyter
2D_oceancolour_plots.py
2D_oceancolour_plots.py
py
7,930
python
en
code
0
github-code
6
[ { "api_name": "netCDF4.Dataset", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 67, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 75, "usage_type": "call" }, { "api_name": "numpy.array", "line_numbe...
18478316296
from block import Block from transaction import Transaction class ConverterToObj(): @staticmethod def chain_to_obj(blockchain): """ Receives a blockchain of dictionaries and converts the blocks into block objects and the transactions into Transactions objects Returns an updated blockchain ...
salvescoding/bockchain_cryptocurrency
app/helpers/converter_to_obj.py
converter_to_obj.py
py
1,249
python
en
code
0
github-code
6
[ { "api_name": "transaction.Transaction", "line_number": 15, "usage_type": "call" }, { "api_name": "block.Block", "line_number": 17, "usage_type": "call" }, { "api_name": "transaction.Transaction", "line_number": 31, "usage_type": "call" } ]
8287227022
# encoding: utf-8 from django.test import TestCase from django.db import IntegrityError from subscription.models import Subscription class SubscriptionModelTest(TestCase): def test_create_new_subscription(self): s = Subscription.objects.create( name='Henrique Bastos', cpf='05633165...
rosenclever/Eventex
subscription/tests/test_models.py
test_models.py
py
1,055
python
en
code
2
github-code
6
[ { "api_name": "django.test.TestCase", "line_number": 7, "usage_type": "name" }, { "api_name": "subscription.models.Subscription.objects.create", "line_number": 9, "usage_type": "call" }, { "api_name": "subscription.models.Subscription.objects", "line_number": 9, "usage_ty...
30086424921
import logging import paddle.fluid as fluid import paddle.fluid.dygraph.nn as nn from utils import build_norm_layer, build_conv_layer, Sequential class BasicBlock(fluid.dygraph.Layer): expansion = 1 def __init__(self, inplanes, planes, stride=1, ...
VIS-VAR/LGSC-for-FAS
models/resnet.py
resnet.py
py
10,152
python
en
code
223
github-code
6
[ { "api_name": "paddle.fluid.dygraph", "line_number": 7, "usage_type": "attribute" }, { "api_name": "paddle.fluid", "line_number": 7, "usage_type": "name" }, { "api_name": "utils.build_norm_layer", "line_number": 20, "usage_type": "call" }, { "api_name": "utils.bui...
34268869156
import pandas as pd import numpy as np import numpy as np import pandas as pd from keras.models import load_model from sklearn.preprocessing import MinMaxScaler from numpy import concatenate from flask import Flask, request, jsonify import json app = Flask(__name__) @app.route('/', methods=['GET']) def getMill(): ...
Francis-Walker/AI_api
api_deploy/model_api.py
model_api.py
py
9,209
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.read_pickle", "line_number": 17, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.MinMaxScaler", "line_number": 23, "usage_type": "call" }, { "api_name": "pan...
14761591721
import os from twisted.internet import reactor, defer def read_mail(mailitems): print(mailitems) return "Junk Mail... Sending to shredder: " + mailitems def shred_mail(mailitems): print('buzzzzz: ' + mailitems) os.remove('mail') reactor.stop() def create_mail(msg): with open("mail","w") as f:...
mina32/APT_Black
mailExample/mailPolling.py
mailPolling.py
py
826
python
en
code
0
github-code
6
[ { "api_name": "os.remove", "line_number": 10, "usage_type": "call" }, { "api_name": "twisted.internet.reactor.stop", "line_number": 11, "usage_type": "call" }, { "api_name": "twisted.internet.reactor", "line_number": 11, "usage_type": "name" }, { "api_name": "twis...
33386199461
""" File input and output functions """ import ujson as json from dev_funcs import printline, Recorded_Time from comms import Appointment #class to store data imported from local json config file class FileIO: def __init__(self): #build all of the variables from data.json file self.load_local_vars() #print the ...
TotalJTM/DoccoLink-Device-Firmware-V1
file_funcs.py
file_funcs.py
py
11,601
python
en
code
0
github-code
6
[ { "api_name": "ujson.loads", "line_number": 20, "usage_type": "call" }, { "api_name": "dev_funcs.Recorded_Time", "line_number": 45, "usage_type": "argument" }, { "api_name": "ujson.loads", "line_number": 54, "usage_type": "call" }, { "api_name": "ujson.dumps", ...
15018763785
from tkinter import Widget import customtkinter as ctk from customtkinter import ThemeManager from View.GUI.Windows.GraphWindow.ButtonBar import ButtonBar from View.GUI.Windows.GraphWindow.GraphCanvas import GraphCanvas from View.GUI.Windows.WindowInterface import WindowInterface, Position class GraphWindow(WindowI...
Moni5656/npba
View/GUI/Windows/GraphWindow/GraphWindow.py
GraphWindow.py
py
2,319
python
en
code
0
github-code
6
[ { "api_name": "View.GUI.Windows.WindowInterface.WindowInterface", "line_number": 11, "usage_type": "name" }, { "api_name": "customtkinter.CTkFrame", "line_number": 11, "usage_type": "attribute" }, { "api_name": "View.GUI.Windows.WindowInterface.Position.Center", "line_number"...
9352031238
"""Cleaning Functions These functions define standard text processing functions for cleaning. """ from html import unescape import re import emoji def clean_text(text): """Cleans single data entry of text. Args: text (str): input text for cleaning. Returns: str: output cleaned text. ...
HannahKirk/ActiveTransformers-for-AbusiveLanguage
scripts/0_data_prep/cleaning_functions.py
cleaning_functions.py
py
4,543
python
en
code
3
github-code
6
[ { "api_name": "html.unescape", "line_number": 21, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 23, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 24, "usage_type": "call" }, { "api_name": "emoji.UNICODE_EMOJI", "line_number": ...
18552105619
# # Napisać program który wyświetla wykres funkcji kwadratowej o podanych współczynnikach. # # Tworząc wykres należy tak dobrać zakres wyświetlanej osi X aby znalazły się w nim: # # współrzędna wierzchołka oraz miejsca zerowe z marginesem ok 10% # # (dla przykładu: jeżeli miejsca zerowe wynoszą np x1=2 i x2=10 to oś...
TomaszWs/Python-training
UG-training/wykres-funkcji.py
wykres-funkcji.py
py
3,391
python
pl
code
0
github-code
6
[ { "api_name": "math.sqrt", "line_number": 20, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 24, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 36,...
33680361650
from django.urls import path, include from rest_framework import routers from .views import ( IndexView, DetailView, ResultsView, vote, QuestionViewSet, ChoiceViewSet, ) router = routers.DefaultRouter() router.register(r"questions", QuestionViewSet) router.register(r"choices", ChoiceViewSet) ...
orvisevans/django-vue-site
backend/polls/urls.py
urls.py
py
630
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 12, "usage_type": "call" }, { "api_name": "rest_framework.routers", "line_number": 12, "usage_type": "name" }, { "api_name": "views.QuestionViewSet", "line_number": 13, "usage_type": "argument" }, { ...
787431703
""" Tests for `nameko_cachetools` module. """ import time import pytest from mock import Mock, patch import random import eventlet from nameko.rpc import rpc from nameko.standalone.rpc import ServiceRpcProxy from nameko_cachetools import CachedRpcProxy, CacheFirstRpcProxy from nameko.testing.services import (entrypoin...
santiycr/nameko-cachetools
test/test_nameko_cachetools.py
test_nameko_cachetools.py
py
4,402
python
en
code
9
github-code
6
[ { "api_name": "nameko_cachetools.CachedRpcProxy", "line_number": 22, "usage_type": "call" }, { "api_name": "nameko_cachetools.CacheFirstRpcProxy", "line_number": 23, "usage_type": "call" }, { "api_name": "nameko.rpc.rpc", "line_number": 25, "usage_type": "name" }, { ...
8267999016
from __future__ import annotations from unittest import mock from kombu.utils.objects import cached_property class test_cached_property: def test_deleting(self): class X: xx = False @cached_property def foo(self): return 42 @foo.deleter...
celery/kombu
t/unit/utils/test_objects.py
test_objects.py
py
2,091
python
en
code
2,643
github-code
6
[ { "api_name": "kombu.utils.objects.cached_property", "line_number": 15, "usage_type": "name" }, { "api_name": "kombu.utils.objects.cached_property", "line_number": 35, "usage_type": "name" }, { "api_name": "kombu.utils.objects.cached_property", "line_number": 60, "usage_t...
10649216487
""" ProjectManager Description: """ import pygame,sys pygame.init() # Defining Image Width get_width = int(input("Image Width: (px)")) get_height = int(input("Image Height: (px)")) get_name = str(input("Project Name: ")) win_size = (get_width,get_height) # Creating Project Script file = get_name + '.txt' with open(f...
LandenTy/GeometricEngine
CustomTexturer/main.py
main.py
py
3,267
python
en
code
0
github-code
6
[ { "api_name": "pygame.init", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 30, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 30, "usage_type": "attribute" }, { "api_name": "pygame.draw.ci...
1584185600
import cv2 def draw_boxes(im, boxes, class_names=None, scores=None, colors=None): scores = [None] * len(boxes) if scores is None else scores colors = [None] * len(boxes) if colors is None else colors class_names = [None] * len(boxes) if class_names is None else class_names for params in zip(boxes, cl...
Guillem96/ssd-pytorch
ssd/viz.py
viz.py
py
991
python
en
code
0
github-code
6
[ { "api_name": "cv2.rectangle", "line_number": 22, "usage_type": "call" }, { "api_name": "cv2.rectangle", "line_number": 24, "usage_type": "call" }, { "api_name": "cv2.putText", "line_number": 25, "usage_type": "call" }, { "api_name": "cv2.FONT_HERSHEY_SIMPLEX", ...
5558606800
import os from dotenv import load_dotenv from configparser import ConfigParser conf = ConfigParser() conf.read('model.conf') load_dotenv('.env') def _getenv(key, default): return type(default)(os.getenv(key)) if os.getenv(key) else default SERVER_IP = _getenv('SERVER_IP', '0.0.0.0') # Service IP SERVER_PORT = _get...
rahmanmahbub073/PythonBased_FastAPI_mL_dL_Repo
UnwantedImageDetection_server/config.py
config.py
py
1,241
python
en
code
1
github-code
6
[ { "api_name": "configparser.ConfigParser", "line_number": 5, "usage_type": "call" }, { "api_name": "dotenv.load_dotenv", "line_number": 8, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 10, "usage_type": "call" } ]
36132885755
from random import choice from time import sleep from colorama import init, Fore init() deck_preset = ("A", *range(2, 11), "J", "Q", "K") deck = [item for item in deck_preset for i in range(4)] del deck_preset class Card: special_names = ["A", "J", "Q", "K"] def __init__(self, name): ...
Rikaisan/100-days-of-code
python-files/11_blackjack.py
11_blackjack.py
py
5,613
python
en
code
1
github-code
6
[ { "api_name": "colorama.init", "line_number": 5, "usage_type": "call" }, { "api_name": "colorama.Fore.CYAN", "line_number": 54, "usage_type": "attribute" }, { "api_name": "colorama.Fore", "line_number": 54, "usage_type": "name" }, { "api_name": "colorama.Fore.WHIT...
23338785771
import tensorflow as tf import pandas as pd from sklearn.metrics import multilabel_confusion_matrix, confusion_matrix, precision_score, recall_score, f1_score def calculate_output(model, actual_classes, session, feed_dict): actuals = tf.argmax(actual_classes, 1) predictions = tf.argmax(model, 1) actuals = ...
Sam-Mah/PLDNN
tensorflow_confusion_metrics.py
tensorflow_confusion_metrics.py
py
2,817
python
en
code
3
github-code
6
[ { "api_name": "tensorflow.argmax", "line_number": 6, "usage_type": "call" }, { "api_name": "tensorflow.argmax", "line_number": 7, "usage_type": "call" }, { "api_name": "sklearn.metrics.multilabel_confusion_matrix", "line_number": 19, "usage_type": "call" }, { "api...
38514794793
import gc import os from pathlib import Path from typing import Any, Dict, cast import mlflow import numpy as np import onnx import torch import transformers from pytorch_lightning import Trainer, seed_everything from pytorch_lightning.callbacks import ModelCheckpoint from transformers.modeling_utils import PreTrained...
crypto-sentiment/crypto_sentiment_demo_app
crypto_sentiment_demo_app/models/train/bert/model.py
model.py
py
4,376
python
en
code
25
github-code
6
[ { "api_name": "transformers.logging.set_verbosity_error", "line_number": 21, "usage_type": "call" }, { "api_name": "transformers.logging", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 23, "usage_type": "attribute" }, { ...
26185607454
"""Rotate Image You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise). You have to rotate the image in-place, which means you have to modify the input 2D matrix directly. DO NOT allocate another 2D matrix and do the rotation. Input: matrix = [[1,2,3],[4,5,6],[7,8,9]] Outp...
01o91939/leetcode
rotateImage.py
rotateImage.py
py
1,441
python
en
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 18, "usage_type": "name" }, { "api_name": "unittest.TestCase", "line_number": 31, "usage_type": "attribute" }, { "api_name": "unittest.main", "line_number": 42, "usage_type": "call" } ]
5809207089
# --- # jupyter: # jupytext: # formats: ipynb,py # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.9.1+dev # kernelspec: # display_name: Python [conda env:biovectors] # language: python # name: conda-env-biovectors-...
greenelab/biovectors
multi_model_experiment/04_novel_distance_calculations.py
04_novel_distance_calculations.py
py
14,275
python
en
code
3
github-code
6
[ { "api_name": "plotnine.ggplot", "line_number": 59, "usage_type": "call" }, { "api_name": "plydata.query", "line_number": 60, "usage_type": "call" }, { "api_name": "plotnine.aes", "line_number": 61, "usage_type": "call" }, { "api_name": "plotnine.geom_boxplot", ...
46058474656
# -*- coding: utf-8 -*- from django.db import models from django.utils.translation import gettext_lazy as _ from django.utils import timezone from django.db import IntegrityError, transaction from .managers import TopicNotificationQuerySet from spirit.core.conf import settings class TopicNotification(models.Model):...
nitely/Spirit
spirit/topic/notification/models.py
models.py
py
4,758
python
en
code
1,153
github-code
6
[ { "api_name": "django.db.models.Model", "line_number": 12, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 12, "usage_type": "name" }, { "api_name": "django.utils.translation.gettext_lazy", "line_number": 15, "usage_type": "call" }, { ...
32645650527
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Module that contains functions related with Maya tag functionality for ueGear. """ from __future__ import print_function, division, absolute_import import maya.cmds as cmds import maya.api.OpenMaya as OpenMaya from mgear.uegear import utils, log logger = log.uegea...
mgear-dev/mgear4
release/scripts/mgear/uegear/tag.py
tag.py
py
9,387
python
en
code
209
github-code
6
[ { "api_name": "mgear.uegear.log.uegear_logger", "line_number": 15, "usage_type": "attribute" }, { "api_name": "mgear.uegear.log", "line_number": 15, "usage_type": "name" }, { "api_name": "mgear.uegear.utils.force_list", "line_number": 55, "usage_type": "call" }, { ...
27519489621
from django.shortcuts import (render, get_object_or_404, get_list_or_404, redirect, HttpResponse) from .models import Total from .serializer import TotalSerializer, Serializer # , UserSerializer from rest_framework.views import APIView from rest_framework.response import Response from res...
Afeez1131/CovidNg-2021
total/views.py
views.py
py
8,441
python
en
code
0
github-code
6
[ { "api_name": "django.shortcuts.render", "line_number": 25, "usage_type": "call" }, { "api_name": "django.core.mail.send_mail", "line_number": 34, "usage_type": "call" }, { "api_name": "django.contrib.messages.success", "line_number": 36, "usage_type": "call" }, { ...
31463758726
import logging import pathlib import sqlite3 logger = logging.getLogger(__name__) def is_database_exists(db_path): return pathlib.Path(db_path).exists() def open_connection(db_path): if is_database_exists(db_path): logger.debug(f"Connecting to {db_path}") try: return sqlite3.con...
nemeshnorbert/reveal
src/db/utils.py
utils.py
py
1,509
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 5, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 9, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 16, "usage_type": "call" }, { "api_name": "sqlite3.connect", "l...
28448639940
# __author__ = 'heyin' # __date__ = '2019/2/14 16:03' # google翻译rpc服务端代码 import sys sys.path.append('../') import json import grpc import time from concurrent import futures from rpc_server.fanyi import fanyi_pb2, fanyi_pb2_grpc from rpc_conf import HOST, PORT, ONE_DAY_IN_SECONDS from core import google js = google....
hy89/google-translate
rpc_server/server.py
server.py
py
1,172
python
en
code
0
github-code
6
[ { "api_name": "sys.path.append", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "core.google.Py4Js", "line_number": 16, "usage_type": "call" }, { "api_name": "core.google", "line...
42600676142
import multiprocessing import operator from functools import partial import numpy as np from core import mathlib from core.interact import interact as io from core.leras import nn from facelib import FaceType, XSegNet from models import ModelBase from samplelib import * class XSegModel(ModelBase): def __init__...
ccvvx1/Python_Df
models/Model_XSeg/Model.py
Model.py
py
15,453
python
en
code
0
github-code
6
[ { "api_name": "models.ModelBase", "line_number": 15, "usage_type": "name" }, { "api_name": "core.interact.interact.input_bool", "line_number": 28, "usage_type": "call" }, { "api_name": "core.interact.interact", "line_number": 28, "usage_type": "name" }, { "api_nam...
19053013321
from functools import wraps import re from collections import defaultdict from datetime import datetime, timedelta, timezone import humanize import simplejson as json from dateutil.tz import tzutc from flask import Blueprint, g, redirect, request, url_for, current_app, jsonify from flask_login import current_user, log...
ONSdigital/census-survey-runner
app/views/questionnaire.py
questionnaire.py
py
32,299
python
en
code
0
github-code
6
[ { "api_name": "structlog.get_logger", "line_number": 53, "usage_type": "call" }, { "api_name": "flask.Blueprint", "line_number": 55, "usage_type": "call" }, { "api_name": "flask.Blueprint", "line_number": 59, "usage_type": "call" }, { "api_name": "app.globals.get_...
8337543538
#! /usr/bin/env python import sys import csv import screed import random import argparse import sourmash import sequtils # local import def main(): parser = argparse.ArgumentParser() parser.add_argument('genome') parser.add_argument('-e', '--error-rate', type=float, default=.01) pars...
ctb/2022-sourmash-sens-spec
scripts/make-detection-curve.py
make-detection-curve.py
py
3,926
python
en
code
2
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 14, "usage_type": "call" }, { "api_name": "random.seed", "line_number": 31, "usage_type": "call" }, { "api_name": "screed.open", "line_number": 33, "usage_type": "call" }, { "api_name": "sourmash.MinHash", ...
22558981666
import math import numpy as np import matplotlib.pyplot as plt from matplotlib.animation import FuncAnimation #Dane początkowe k1 = 1 m = 1 h = 0.05 x0 = 10 vx0 = 0 w1 = math.sqrt(k1/m) A1 = math.sqrt((vx0*vx0)/(w1*w1) + (x0*x0)) iloscPunktow = 1000 #oś XY setXl = 0 setXr = 55 setYl = 49.95 s...
OskarLewandowski/My_Learning
Python/Oscylator-energia.py
Oscylator-energia.py
py
4,595
python
pl
code
0
github-code
6
[ { "api_name": "math.sqrt", "line_number": 14, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 15, "usage_type": "call" }, { "api_name": "math.acos", "line_number": 26, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 26, "u...
15156725753
import os import math import numpy as np from tqdm import tqdm import pickle import torch import torch.nn as nn from torch.autograd import Variable from torch.nn import functional as F from models import l2norm ## Memory class Memory(nn.Module): def __init__(self, mem_size=500000, feat_dim=256, margin=1, topk...
toanhvu/learning-to-remember-beauty-products
memory.py
memory.py
py
2,793
python
en
code
1
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 13, "usage_type": "name" }, { "api_name": "torch.nn.Parameter", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.nn", "line...
25359325465
# -*- coding: utf-8 -*- from __future__ import division import scrapy from scrapy import Request # from street_food.items import StreetFoodItem, StreetFoodDatTimeItem from street_food.items import StreetFoodDatTimeItem from street_food.spiders import tools import json from urllib import urlopen # import random from str...
kirimaks/street-food-scraper
street_food/street_food/spiders/offthegrid.py
offthegrid.py
py
3,638
python
en
code
0
github-code
6
[ { "api_name": "scrapy.Spider", "line_number": 14, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 31, "usage_type": "call" }, { "api_name": "scrapy.Request", "line_number": 41, "usage_type": "call" }, { "api_name": "urllib.urlopen", "li...
33851174074
''' boss class ''' import pygame class Boss(pygame.sprite.Sprite): def __init__(self,laser): pygame.sprite.Sprite.__init__(self) self.image = pygame.image.load("images/Boss.gif").convert() self.rect = self.image.get_rect() self.rect.x = 500 self.rect.y = 0...
Inviernos/Alien-Lord
boss.py
boss.py
py
1,580
python
en
code
0
github-code
6
[ { "api_name": "pygame.sprite", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pygame.sprite.Sprite.__init__", "line_number": 10, "usage_type": "call" }, { "api_name": "pygame.sprite", "line_number": 10, "usage_type": "attribute" }, { "api_name": "py...
32203126633
import datetime import random import yaml from requests import get def compute_median(lst): """ Вычисление медианты списка :param lst: входящий список значений :return: медиана """ quotient, remainder = divmod(len(lst), 2) return lst[quotient] if remainder else sum(sorted(lst)[quotient - ...
zombym/devops-tasks
5.5.1.py
5.5.1.py
py
5,538
python
ru
code
0
github-code
6
[ { "api_name": "random.randint", "line_number": 98, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 99, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 107, "usage_type": "call" }, { "api_name": "requests.get", "line_n...
23184643387
#!/usr/bin/env python3 #encoding: UTF-8 # To change this license header, choose License Headers in Project Properties. # To change this template file, choose Tools | Templates # and open the template in the editor. import numpy as np import matplotlib.pyplot as plt import math import TrashCan.Mathieson as mat import ...
grasseau/MCHClustering
src/PyTests/spline_t.py
spline_t.py
py
7,607
python
en
code
0
github-code
6
[ { "api_name": "numpy.zeros", "line_number": 17, "usage_type": "call" }, { "api_name": "math.erf", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 25, "usage_type": "attribute" }, { "api_name": "numpy.sqrt", "line_number": 26...
27529865063
import numpy as np import matplotlib.pyplot as plt from scipy import signal def load_data(filename): # 读入数据文件 data = np.loadtxt(filename) return data def plot_signal_waveform(data, fs): # 绘制信号波形 duration = len(data) / fs # 持续时间,单位为秒 time = np.linspace(0, duration, len(data)) plt.subplot(...
huigang39/TENG
Software/dl/signal_analysis.py
signal_analysis.py
py
1,602
python
en
code
2
github-code
6
[ { "api_name": "numpy.loadtxt", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplot", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pypl...
43968820856
#!/usr/bin/env python from Bio import SeqIO import argparse import json import os from CPT_GFFParser import gffParse, gffWrite def parse_xmfa(xmfa): """Simple XMFA parser until https://github.com/biopython/biopython/pull/544 """ current_lcb = [] current_seq = {} for line in xmfa.readlines(): ...
TAMU-CPT/galaxy-tools
tools/comparative/xmfa_process.py
xmfa_process.py
py
3,928
python
en
code
5
github-code
6
[ { "api_name": "Bio.SeqIO.parse", "line_number": 72, "usage_type": "call" }, { "api_name": "Bio.SeqIO", "line_number": 72, "usage_type": "name" }, { "api_name": "argparse.ArgumentParser", "line_number": 78, "usage_type": "call" }, { "api_name": "argparse.FileType",...
11323411187
import random import sys from pyfiglet import Figlet import requests import json import os from dotenv import load_dotenv # Setting up TMDB API Key load_dotenv() API_KEY = os.getenv('TMDB_API_KEY') # Retrieve top rated movies in TheMovieDB pages = {'results': []} for i in range(5): page = requests.get(f'https:/...
MaCeleste/Movie-Hangman
project.py
project.py
py
4,490
python
en
code
0
github-code
6
[ { "api_name": "dotenv.load_dotenv", "line_number": 11, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 18, "usage_type": "call" }, { "api_name": "pyfiglet.Figlet", "line...
5361671905
import bottle import json import random from . import DatabaseManager from .product import Product import recommender.vector.arithmetic import recommender.rocchio.algorithm @bottle.route('/product/get/<doc_id:int>') def product_get(doc_id): d = product_manager.get_product(doc_id).as_dictionary() result = {'...
dustywind/bachelor-thesis
impl/recommender/webapi.py
webapi.py
py
8,641
python
en
code
0
github-code
6
[ { "api_name": "bottle.route", "line_number": 12, "usage_type": "call" }, { "api_name": "bottle.route", "line_number": 18, "usage_type": "call" }, { "api_name": "bottle.route", "line_number": 26, "usage_type": "call" }, { "api_name": "bottle.route", "line_numbe...
39858982363
import os import sys if not "DEVITO_OPENMP" in os.environ or os.environ["DEVITO_OPENMP"] != "1": print("*** WARNING: Devito OpenMP environment variable has not been set ***", file=sys.stderr) import numpy as np from sympy import Matrix, Eq, solve import progressbar from devito import TimeData, Operator, t, x, y,...
gamdow/ACG-feasibility
wrapper_pkg/devito.py
devito.py
py
7,301
python
en
code
0
github-code
6
[ { "api_name": "os.environ", "line_number": 4, "usage_type": "attribute" }, { "api_name": "sys.stderr", "line_number": 5, "usage_type": "attribute" }, { "api_name": "devito.logger.set_log_level", "line_number": 15, "usage_type": "call" }, { "api_name": "devito.logg...
27318807553
# @PascalPuchtler # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software # dis...
iisys-hof/autonomous-driving
car-controller/src/mainController/Controller/MoveController/MoveControllerCommunication.py
MoveControllerCommunication.py
py
3,571
python
en
code
0
github-code
6
[ { "api_name": "sys.platform", "line_number": 30, "usage_type": "name" }, { "api_name": "serial.Serial", "line_number": 35, "usage_type": "call" }, { "api_name": "serial.PARITY_NONE", "line_number": 37, "usage_type": "attribute" }, { "api_name": "serial.EIGHTBITS",...
72532362749
import logging from asyncio import CancelledError, Task, create_task from collections.abc import AsyncGenerator from contextlib import asynccontextmanager, suppress from fastapi import FastAPI from servicelib.logging_utils import log_context from watchdog.observers.api import DEFAULT_OBSERVER_TIMEOUT from ._context i...
ITISFoundation/osparc-simcore
services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/outputs/_watcher.py
_watcher.py
py
4,081
python
en
code
35
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "_manager.OutputsManager", "line_number": 20, "usage_type": "name" }, { "api_name": "_context.OutputsContext", "line_number": 20, "usage_type": "name" }, { "api_name": "asy...
8022762471
#!/usr/bin/env python # encoding: utf-8 # @Time : 2019-07-31 10:24 __author__ = 'Ted' from PIL import Image, ImageFont, ImageDraw content={ "back_img":"pre/paper.jpg", "001":{ "ad":'老板,买10盒月饼呗', "head":'001.jpg' }, "002": { "ad": '老板,买20盒月饼呗', "head": '002.jpg' }, ...
pengfexue2/friends_ad
create_pics.py
create_pics.py
py
2,590
python
en
code
3
github-code
6
[ { "api_name": "PIL.Image.open", "line_number": 49, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 49, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number": 51, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number"...