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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
30595194197 | import json
import requests
import hashlib
import string
import random
import time
URL = None
mail = None
domainList = ["@janmail.org","@mailon.ws","@seo-mailer.com","@clsn1.com","@onmail.top","@jancloud.net","@clsn.top","@sammail.ws","@oncloud.ws","@seomail.top"]
class bcolors:
HEADER = '\033[95m'
... | 3dg1luk43/temp-mail-client-python | tempmail.py | tempmail.py | py | 4,632 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "random.choice",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "string.ascii_lowercase",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "string.digits",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "random.r... |
36295336634 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import time
import math
import datetime
from pysc2.agents import base_agent
from pysc2.lib import actions
from pysc2.lib import features
import torch
import torch.nn as nn
fr... | chengjunyan1/PySC2-minigame-agent | MSCAgent/msc_agent3X.py | msc_agent3X.py | py | 8,902 | python | en | code | 0 | github-code | 27 | [
{
"api_name": "pysc2.agents.O.OneNet.Units_List",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "pysc2.agents.O.OneNet",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "pysc2.agents.O.OneNet.Units_Table",
"line_number": 29,
"usage_type": "attribu... |
32793290128 | #!/usr/bin/env python
"""
Example of using plt.axvline() to plot a a vertical line on a Matplotlib plot.
"""
import numpy as np
import matplotlib.pyplot as plt
values = np.random.randn(100)
plt.hist(values, label='values')
plt.axvline(values.mean(), color='red', linestyle='--', linewidth=4, label='mean')
plt.legend()
... | tleonhardt/CodingPlayground | python/matplotlib/vertical_line.py | vertical_line.py | py | 331 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "numpy.random.randn",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.hist",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.p... |
29674272808 | import tensorflow as tf
from official.core import input_reader
from official.core import task_factory
from yolo.configs import darknet_classification as exp_cfg
from yolo.dataloaders.decoders import classification_tfds_decoder as cli
from yolo.dataloaders import classification_input
from yolo.dataloaders import classif... | PurdueDualityLab/TensorFlowModels | yolo/tasks/image_classification.py | image_classification.py | py | 8,096 | python | en | code | 26 | github-code | 22 | [
{
"api_name": "official.vision.beta.tasks.image_classification.ImageClassificationTask",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "official.vision.beta.tasks.image_classification",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "tensorflow.keras",
... |
73746943086 | import unittest
from typing import Text
from ai_flow.plugin_interface.blob_manager_interface import BlobConfig, BlobManagerFactory, BlobManager
class MockBlockManager(BlobManager):
def __init__(self, config):
super().__init__(config)
def upload(self, local_file_path: Text) -> Text:
return 'up... | lisy09/ffa-2021-demos | aiflow/flink-ai-flow/ai_flow/test/plugin_interface/test_blob_manager.py | test_blob_manager.py | py | 1,227 | python | en | code | 1 | github-code | 2 | [
{
"api_name": "ai_flow.plugin_interface.blob_manager_interface.BlobManager",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "typing.Text",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Text",
"line_number": 13,
"usage_type": "name"
},
{
... |
12063125174 | # 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
# distributed under the Li... | miketheman/warehouse | tests/unit/oidc/test_views.py | test_views.py | py | 18,627 | python | en | code | null | github-code | 22 | [
{
"api_name": "pretend.stub",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pretend.stub",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "pretend.call_recorder",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "warehouse.oidc.views.... |
31688084705 | """Utility functions for CREST."""
from ...utils.parse_helpers import translate_1d
def crest_act_to_demod(crest_activities):
"""Transform the crest activity names into demod.
Args:
crest_activities: [description]
"""
translate_dict = {
"LEVEL": "level",
"ACTIVE_OCC": "active_o... | epfl-herus/demod | demod/datasets/CREST/utils.py | utils.py | py | 1,970 | python | en | code | 10 | github-code | 2 | [
{
"api_name": "utils.parse_helpers.translate_1d",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "utils.parse_helpers.translate_1d",
"line_number": 67,
"usage_type": "call"
}
] |
69959133166 | # -*- coding: utf-8 -*-
"""
Created on Tue Sep 15 13:56:51 2015
@author: Administrator
"""
import random
import numpy as np
import matplotlib.pyplot as plt
from dataSource import *
def centerCreate(data, k):
n_dim = len(zip(*data))
center = np.zeros((n_dim, k))
for i in range(n_dim):
for j in ran... | ashther/kmeans | kmeans.py | kmeans.py | py | 1,781 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "numpy.zeros",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "random.uniform",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number... |
27044022976 | from collections import OrderedDict as odict
def importCONFHD(fobj):
CONFHD = odict()
for i, v in enumerate(fobj):
vline = v.decode('utf-8')
if vline.strip() and vline[0:5].strip() != 'NUM' and 'XXXX' not in vline:
coduhe = vline[:5].strip()
nome = vline[5:20].strip()
... | venidera/deckparser | deckparser/importers/newave/importCONFHD.py | importCONFHD.py | py | 1,940 | python | en | code | 13 | github-code | 2 | [
{
"api_name": "collections.OrderedDict",
"line_number": 5,
"usage_type": "call"
}
] |
2510711795 | import argparse
import logging
import torch
import time
import os
import numpy as np
from os.path import join
from src.models.transe.TransE import TransE,compute_metric_results
from mlflow import log_metric, log_param
import mlflow
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
logging.getLogger('pyke... | wang-yuhao/Practical-Big-Data-Science-ADL-AI | scripts/run_transe.py | run_transe.py | py | 7,297 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging.INFO",... |
19799215362 | from django.conf.urls import include, url
from django.contrib import admin
#admin.autodiscover()
from .views import HomePageView, SignUpView, LoginView, LogOutView
urlpatterns = [
url(r'^admin/', admin.site.urls),
url('^$', HomePageView.as_view(), name='home'),
url(r'^accounts/register/$', SignUpView.as_v... | abdulhalim-cu/gswdcc | survivalguide/urls.py | urls.py | py | 545 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": ... |
34143731822 | import textwrap
from datetime import datetime
from discord import Color, Embed
from discord.ext.commands import Bot, BucketType, Cog, Context, cooldown, group
BAD_RESPONSES = {
404: "Issue/pull request not Found! Please enter a valid PR Number!",
403: "Rate limit is hit! Please try again later!",
}
class Gi... | janaSunrise/overflow-discord-bot | bot/cogs/coding/github.py | github.py | py | 8,334 | python | en | code | 3 | github-code | 2 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "discord.ext.commands.Bot",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "discord.ext.commands.Context",
"line_number": 24,
"usage_type": "name"
},
{
"ap... |
9478656449 | import cv2
import time
import poseModule as pm
from pythonosc import udp_client
from pythonosc import osc_message_builder
from calc_values import calc_useful_pose_values
ip = "127.0.0.1"
port = 3333
client = udp_client.SimpleUDPClient(ip, port)
cap = cv2.VideoCapture(0)
detector = pm.poseDetector()
while True:
s... | zoebreed/Sound_Space_Interaction | code/python_posenet/send-poses.py | send-poses.py | py | 795 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "pythonosc.udp_client.SimpleUDPClient",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pythonosc.udp_client",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 12,
"usage_type": "call"
},
{
"api_na... |
18834586830 | """
Tag rendering tags pointing ot minified/not-minified
Javascript or CSS content
"""
from django import template
from django.core import urlresolvers
from minify import app_settings
register = template.Library()
MINIFY_JS_URL = urlresolvers.reverse('minify_js')
MINIFY_CSS_URL = urlresolvers.reverse('minify_css')... | sternoru/django-minify-static | minify/templatetags/minify_tags.py | minify_tags.py | py | 5,629 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "django.template.Library",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.core.urlresolvers.reverse",
"line_number": 14,
"usage_type": "call"
},
{
"api_name... |
40844306710 | import csv
import matplotlib.pyplot as plt
# Crie uma função que lê a informação do ficheiro para um modelo, previamente pensado em memória;
# Pense num modelo para guardar uma distribuição; ---> Guarda num dicionario com cada chave sendo uma coluna do ficheiro, tendo os seus respetivos valores associados
# ... | Reinas2899/PL2023 | TPC1/TPC1.py | TPC1.py | py | 7,187 | python | pt | code | 0 | github-code | 2 | [
{
"api_name": "csv.DictReader",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 186,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 186,
"usage_type": "name"
},
{
"api_name": "matplot... |
5305987717 | import torch.nn as nn
import torch.nn.functional as F
class Oleksii17Autoencoder(nn.Module):
def __init__(self, num_classes=10, **kwargs):
super().__init__()
ext_size = kwargs['num_pkts']*kwargs['num_fields']
inner_size = 20
self.encoder = nn.Sequential(
nn.Flatten(),... | jmpr0/idalab2023-gruppo7 | src/networks/oleksii17_autoencoder.py | oleksii17_autoencoder.py | py | 1,325 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "torch.nn.Module",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_... |
31644294285 | import logging
import httpx
url = "http://127.0.0.1:12306/reader3"
# 处理函数
def encode_url(text: str): # 加密字符串避免敏感
hex_text = ''.join(hex(ord(c))[2:] for c in text)
return hex_text
def decode_url(hex_text: str): # 解密字符串避免敏感
text = bytes.fromhex(hex_text).decode('utf-8')
return text
def get_path(... | Suto-Commune/Re-Kindle-Reader | src/book.py | book.py | py | 3,205 | python | en | code | 1 | github-code | 2 | [
{
"api_name": "logging.info",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "httpx.get",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "httpx.post",
"line_number": 7... |
21965542480 | import colorgram
import turtle
import random
turtle.colormode(255)
rgb_colors = []
colors = colorgram.extract('image.jpg', 30)
for color in colors:
rgb_colors.append(color.rgb)
colors_lst = []
for color in rgb_colors:
t = {color.r, color.g, color.b}
colors_lst.append(t)
#Pop background colors from list
c... | eima1995/Python-Pro-Bootcamp-for-2021 | Hirst painting Day 18/main.py | main.py | py | 765 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "turtle.colormode",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "colorgram.extract",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "turtle.Turtle",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "random.choice",
"l... |
40765105038 | from typing import Tuple
import math
import numpy
from numpy import ndarray
from organoid_tracker.core import bounding_box
from organoid_tracker.core.mask import Mask
from organoid_tracker.core.resolution import ImageResolution
# Helps peak calling
def reconstruct_volume(multi_im: ndarray, mid_layers_nb: int) -> ... | jvzonlab/OrganoidTracker | organoid_tracker/position_detection_cnn/peak_calling.py | peak_calling.py | py | 2,246 | python | en | code | 18 | github-code | 2 | [
{
"api_name": "numpy.ndarray",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "numpy.zeros",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "typing.Tuple",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "organoid_tracker.core.resoluti... |
73858673965 | from Crypto.Cipher import DES
from Crypto.Random import get_random_bytes
def encrypt_des(key, plaintext):
cipher = DES.new(key, DES.MODE_ECB)
plaintext = plaintext + " " * (8 - len(plaintext) % 8) # Pad to multiple of 8 bytes
ciphertext = cipher.encrypt(plaintext.encode())
return ciphertext
def decry... | Hackerjedi666/myLocalSpam | just spam /spam.py | spam.py | py | 722 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "Crypto.Cipher.DES.new",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "Crypto.Cipher.DES",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "Crypto.Cipher.DES.MODE_ECB",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "... |
73250606446 | from PyQt5 import QtWidgets
import ui_logdialog
class LogDialog(QtWidgets.QDialog):
def __init__(self, msg, parent, msgType = QtWidgets.QStyle.SP_MessageBoxWarning, title = "Log", label = "Warning"):
super(LogDialog, self).__init__(parent)
self.ui = ui_logdialog.Ui_LogDialog()
self.ui.setu... | j0r1/SherPass | python3app/logdialog.py | logdialog.py | py | 1,097 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "PyQt5.QtWidgets.QDialog",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QStyle",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": ... |
24942971820 | import pandas as pd
import os,sys
import numpy as np
import matplotlib.pyplot as plt
from datetime import datetime,date,timedelta
from itertools import product
from sklearn.metrics import mean_squared_error
from sklearn.cluster import KMeans
os.chdir('C:/Users/arpit.goel/Documents/Projects/Kaggle/15.RecruitRestarauntP... | arpitg91/CompetitionScripts | 12_RestaurantSalesPredtiction/00.Scripts/01.DataImport.py | 01.DataImport.py | py | 11,430 | python | en | code | 1 | github-code | 27 | [
{
"api_name": "os.chdir",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.HDFStore",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_... |
161935601 | import wx
import random
import Pest
import wx.gizmos as gizmos
import time
from wx.lib.pubsub import pub
class TabOne(Pest.BasicTab):
def __init__(self, parent):
Pest.BasicTab.__init__(self,parent)
self.parent = parent
self.count = 0
style = gizmos.LED_ALIGN_CENTER
... | LeTurtleBoy/Beta-SMT | Windows/Pest1.py | Pest1.py | py | 1,033 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "Pest.BasicTab",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "Pest.BasicTab.__init__",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "Pest.BasicTab",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "wx.gizmos... |
73346839417 | import unittest
import os
from unittest.mock import patch, call
from dotenv import load_dotenv
from ppr_pipeline.loaders.loaders import PPR_Loader
class TestInjectors(unittest.TestCase):
def test_get_from_s3(self):
with patch('ppr_pipeline.injectors.injectors.boto3.client') as mocked_get:
PPR... | jackmulligan-ire/ppr-pipeline | test/test_loaders.py | test_loaders.py | py | 6,101 | python | en | code | 2 | github-code | 22 | [
{
"api_name": "unittest.TestCase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "unittest.mock.patch",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "ppr_pipeline.loaders.loaders.PPR_Loader._get_all_from_s3",
"line_number": 12,
"usage_type": "ca... |
6973669271 | # -*- coding: utf-8 -*-
"""
Created on Sun Feb 28 11:02:18 2021
@author: Leon Jovanovic
"""
import gym
from agent import Agent
import atari_wrappers
from torch.utils.tensorboard import SummaryWriter
import time
# ---------------------------------Parameters----------------------------------
DQN_HYPERPARAMS = {
'e... | leonjovanovic/drl-dqn-atari-pong | main.py | main.py | py | 2,550 | python | en | code | 4 | github-code | 2 | [
{
"api_name": "atari_wrappers.make_env",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "gym.wrappers.Monitor",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "gym.wrappers",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "torch.... |
73327345325 | import os
import sys
import requests
import re
from bs4 import BeautifulSoup
# switching to current running python files directory
os.chdir('\\'.join(__file__.split('/')[:-1]))
# function to get the html of the page
def get_page():
global url
url = input('Enter url of a medium article: ')
# handling possible error... | Python-World/python-mini-projects | projects/Scraping Medium Articles/scraping_medium.py | scraping_medium.py | py | 2,007 | python | en | code | 13,393 | github-code | 2 | [
{
"api_name": "os.chdir",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 18,
"... |
18991626251 | from utils import save_checkpoint,save_some_examples,load_checkpoint,lab_to_rgb
import torch
import torch.nn as nn
import torch.optim as optim
from tqdm import tqdm
import numpy as np
import config
from dataset import Colorization
from PatchDiscriminator_model import PatchDiscriminator
from pretrained_generator import... | morancium/Image_Colorization | pretrained_model.py | pretrained_model.py | py | 4,311 | python | en | code | 1 | github-code | 2 | [
{
"api_name": "fastai.data.external.untar_data",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "fastai.data.external.URLs.COCO_SAMPLE",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "fastai.data.external.URLs",
"line_number": 19,
"usage_type": "... |
43713065276 | import collections
class Solution:
def countOfAtoms(self, formula: str) -> str:
n = len(formula)
# in the final formula, whatever atoms, we need to keep count of it
stack = [collections.Counter()]
i=0
while i<n:
# if new bracket starts, its new molecule,... | amolmishra23/leetcode_solutions | 726-number-of-atoms/726-number-of-atoms.py | 726-number-of-atoms.py | py | 1,946 | python | en | code | 1 | github-code | 2 | [
{
"api_name": "collections.Counter",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 13,
"usage_type": "call"
}
] |
42675015884 | import pandas as pd
import cv2
import numpy as np
import os
import json
import csv
import matplotlib.pyplot as plt
# import tensorflow as tf
# from sklearn.preprocessing import LabelEncoder
# from tensorflow.keras.utils import to_categorical
# from sklearn.model_selection import train_test_split
# from tensorflow.kera... | zrminkim/car_estimate_project | preprocessing.py | preprocessing.py | py | 2,406 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "pandas.read_csv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number... |
18076797684 | from fastapi import FastAPI, Request
#For creating endpoints
from http import HTTPStatus
from typing import Dict
#For adding information to the response
from functools import wraps
from datetime import datetime
from tagifai import main
from config.config import logger
from config import config
from pathlib import P... | nikseddu/MLOPS | mlops/app/api.py | api.py | py | 1,957 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "fastapi.Request",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "datetime.dateti... |
20491164236 | # coding: utf-8
import traceback
from chiki.contrib.users import um
from flask import current_app
from werobot.replies import TransferCustomerServiceReply
from .robot import WeRoBot
from .admin import *
from .models import *
__all__ = [
'WXMsg', 'init_wxmsg',
]
robot = WeRoBot()
class WXMsg(object):
def __... | endsh/chiki | chiki/oauth/wxmsg.py | wxmsg.py | py | 3,217 | python | en | code | 2 | github-code | 2 | [
{
"api_name": "robot.WeRoBot",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "robot.init_app",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "robot.logger",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "werobot.replies.Transf... |
21928379949 | import datetime
import msgpack
import cPickle
import logging
from lz4.frame import compress, decompress
from rq.worker import Worker
from rq import job
PackDate_ExtType = 42
PackObj_ExtType = 43
job_default_load = job.loads
log = logging.getLogger('salactus')
handler = logging.StreamHandler()
handler.setFormatter(l... | harsh4870/cloud-custodian | cloud-custodian/tools/c7n_salactus/c7n_salactus/rqworker.py | rqworker.py | py | 1,877 | python | en | code | 2 | github-code | 2 | [
{
"api_name": "rq.job.loads",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "rq.job",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.StreamHandler",
... |
28532424097 | from collections import deque
import pytest
class TreeNode:
def __init__(self, val, left=None, right=None):
self.val = val
self.left = left
self.right = right
def traverse_zigzag(root):
"""
Given a binary tree,
connect each node with its level order successor.
The last n... | Keep-Simple/leetcode | grokking/bfs/medium/binary_tree_zigzag_order_traversal_test.py | binary_tree_zigzag_order_traversal_test.py | py | 1,414 | python | en | code | 1 | github-code | 2 | [
{
"api_name": "collections.deque",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "pytest.ma... |
70640611271 | import io
import zipfile
from datetime import datetime
import base64
import logging
import os
import string
import random
from odoo import api, fields, models
from odoo.tools.translate import _
from odoo.exceptions import UserError
from odoo.tools.float_utils import float_round, float_is_zero
from ..bindings.fattura... | addoons/odoo-addoons | l10n_it_fatturapa/wizard/wizard_export_fatturapa.py | wizard_export_fatturapa.py | py | 53,312 | python | it | code | 0 | github-code | 27 | [
{
"api_name": "logging.getLogger",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "string.ascii_uppercase",
"line_number": 81,
"usage_type": "attribute"
},
{
"api_name": "string.digits",
"line_number": 81,
"usage_type": "attribute"
},
{
"api_name": "stri... |
9275669055 | import torch.nn as nn
class L1Masked(nn.Module):
def __init__(self):
super().__init__()
def forward(self, input, target, mask=None):
if mask == None:
eps = 1e-9
mask = target.sum(1, True) > eps
mask = mask.float()
return nn.functional.l1_loss(input... | DmitryUlyanov/recognition | contrib/criterions/l1_masked.py | l1_masked.py | py | 340 | python | en | code | 4 | github-code | 2 | [
{
"api_name": "torch.nn.Module",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "torch.nn.functional.l1_loss",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.nn.func... |
3732501804 | from typing import List
class Solution:
def getMaximum(self, N : int, arr : List[int]) -> int:
# code here
s=sum(arr)
l=[]
for i in range(N,0,-1) :
if s%i == 0:
l.append(i)
return l[0]
| Pritz69/GFG_POTD | Maximum_Identical_Bowls.py | Maximum_Identical_Bowls.py | py | 257 | python | en | code | 4 | github-code | 2 | [
{
"api_name": "typing.List",
"line_number": 3,
"usage_type": "name"
}
] |
71565428208 | """Validate that all URLs specified in template files are correct."""
import os
import re
from pathlib import Path
from django.test import TestCase
from django.urls import reverse
class URLTest(TestCase):
"""Test all files for broken url tags."""
# Need fixture data in the database
fixtures = [
... | inventree/InvenTree | InvenTree/InvenTree/test_urls.py | test_urls.py | py | 3,483 | python | en | code | 3,204 | github-code | 2 | [
{
"api_name": "django.test.TestCase",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "os.path.abspath",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 52,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
... |
19916251968 | # This code will give you the balance to be maintained in banks for MF on a given date for the rest of the month
# Last update date: 15-05-2023
from datetime import date, datetime
current_date = date.today() # 2022-09-03
current_month = datetime.now().strftime("%B")
current_year = datetime.now().strftime("%y")
# pri... | apugithub/Python_Self | balance_to_maintain.py | balance_to_maintain.py | py | 1,305 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "datetime.date.today",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.datetim... |
10873531744 | ##python
import lathon
import numpy as np
from sympy.physics.units import *
from matplotlib import pyplot as plt
lathon.use_units = [
[J, "J"],
[J * s, "J * s"]]
## lathon <Angaben
var_1 = 1.2 * J
## python
lathon.Parser.subsection("plot")
lathon.Parser.text("""
here it is demostrated how to draw matplotli... | looooo/lathon | examples/test1.py | test1.py | py | 608 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "lathon.use_units",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "lathon.Parser.subsection",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "lathon.Parser",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "lath... |
15161741522 | import sqlite3
import requests
from flask import Flask, request, jsonify
app = Flask(__name__)
@app.route('/')
def hello():
return 'Hello, World!'
@app.route('/users', methods=['GET'])
def get_users():
conn = sqlite3.connect('database.db')
cursor = conn.cursor()
cursor.execute("SELECT *... | Rehan018/workOngride | app.py | app.py | py | 2,510 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_... |
2153891445 | from django.contrib import admin
from main.models import *
from main.forms import PmsgForm
class DeviceAdmin(admin.ModelAdmin):
date_hierarchy = 'updated'
list_display = ('app', 'appversion', 'devname', 'locale', 'devmodel', 'devversion', 'pushbadge', 'pushalert', 'pushsound', 'development', 'status', 'created', 'u... | mrgaolei/FMPusher | main/admin.py | admin.py | py | 3,412 | python | en | code | 12 | github-code | 2 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.TabularInline",
"line_number": 12,
"usage_type": "attribute"... |
16894698620 | from curses import start_color
from flask import Flask, Request, jsonify,request,send_from_directory
from flask_cors import CORS, cross_origin
from dotenv import load_dotenv
import os
import json
import requests
from dateutil.relativedelta import relativedelta
from datetime import *
import time
app = Flask(__name__)
C... | thegeorgejoseph/Financial-Data-Projects | stock-information-website/main.py | main.py | py | 5,178 | python | en | code | 1 | github-code | 2 | [
{
"api_name": "flask.Flask",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "dotenv.load_dotenv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_... |
122516341 | import pandas as pd
import pytorch_lightning as pl
import torch
import json
from transformers import AutoTokenizer
from torch.utils.data import Dataset, DataLoader
class BaseDataset(Dataset):
def __init__(self, args, split, tokenizer):
self.args = args
examples = []
if split == 'train':
... | forbeauty/baidumrclightning | dataset.py | dataset.py | py | 10,670 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "json.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_num... |
1140651749 | import json
import logging
import requests
from requests import ReadTimeout
from odoo import api, fields, models
from odoo.exceptions import UserError
_logger = logging.getLogger(__name__)
class DingDingApprovalMain(models.Model):
"""
所有需要提交审批的单据都需要继承本模型,方便使用共有的方法函数
"""
_name = 'dingding.approval.mai... | claro5/odooDingDing | dingding_base/models/dingding_approval_main.py | dingding_approval_main.py | py | 4,070 | python | en | code | null | github-code | 2 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "odoo.models.Model",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "odoo.fields.Boole... |
18637299450 | import models
from flask import Blueprint, jsonify, request, session
from datetime import datetime, time
from playhouse.shortcuts import model_to_dict
from flask_login import current_user, login_required
notes = Blueprint('notes', 'notes')
@notes.route('/', methods=['GET'])
@login_required
def notes_index():
pa... | TheRightClick/clicktix | backend/resources/notes.py | notes.py | py | 2,222 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "flask.Blueprint",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.request.get_json",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.request",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "models.Notes.sele... |
1032602521 | from django.urls import path
from project_e.jobs.views import (
job_creation_view,
pdf_contract_detail_view,
job_detail_view,
job_customer_contacted
)
app_name = "jobs"
urlpatterns = [
path("create/", view=job_creation_view, name="create"),
path("<int:pk>/", view=job_detail_view, name="detail... | effortless-electric/project-e | project_e/jobs/urls.py | urls.py | py | 475 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "django.urls.path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "project_e.jobs.views.job_creation_view",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.urls.path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name... |
11949152534 | import tensorflow as tf
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
# Load iris dataset
iris = load_iris()
# Split dataset into training and testing sets
X_train, X_test, y_train, y_test = train_test_split(iris.data, iris.target, test_size=0.2, random_state=42)
... | AaravSibbal/flower-predictor- | main.py | main.py | py | 1,143 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "sklearn.datasets.load_iris",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "tensorflow.feature_column.numeric_column",
"line_number": 12,
"usage_ty... |
26608627644 | import numpy as np
import pytest
from black_it.samplers.best_batch import BestBatchSampler
from black_it.search_space import SearchSpace
expected_params = np.array(
[
[0.43, 0.22],
[0.41, 0.01],
[0.03, 0.42],
[0.2, 0.04],
[0.23, 0.0],
[0.05, 0.05],
[0.0, 0.0... | bancaditalia/black-it | tests/test_samplers/test_best_batch.py | test_best_batch.py | py | 2,661 | python | en | code | 31 | github-code | 2 | [
{
"api_name": "numpy.array",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_numb... |
5146032336 | from model.modelAdaptee import ModelAdaptee
from base.target import Target
from data.models.adiDuctileIronModel import AdiDuctileIronModel
from data.models.chemicalComposition import ChemicalComposition
from data.models.manufacturingProcess import ManufacturingProcess
from data.models.physicalData import PhysicalData
... | Krisuuuuuu/Industrial-Decision-Support-System | data/adapter/modelAdapter.py | modelAdapter.py | py | 2,048 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "base.target.Target",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "model.modelAdaptee.ModelAdaptee",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "data.models.adiDuctileIronModel",
"line_number": 11,
"usage_type": "name"
},
{
"... |
19609508665 | import xml.dom.minidom
from xml.dom.minidom import parse
import os
import sys
baseDir = sys.argv[1]
#output directroy that everything will go in to make the animation and images
baseDir = baseDir+"/script_output"
dirList = os.listdir(baseDir)
for fname in dirList:
basename, extension = fname.split('.')
if ex... | TITAN2D/titan2d | scripts/parseXML.py | parseXML.py | py | 3,046 | python | en | code | 19 | github-code | 2 | [
{
"api_name": "sys.argv",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "xml.dom.minidom.parse",
"line_number": 16,
"usage_type": "call"
}
] |
3979658917 | from django.contrib.auth.decorators import login_required
from django.db.models import Q
from django.shortcuts import render, redirect
from .forms import TaskCommentForm, addTaskForm
from tasks.models import Task
from objects.models import Object, Reservation
# Create your views here.
def all_tasks(request):
ta... | ThomasBoich/djangorent | tasks/views.py | views.py | py | 2,768 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "tasks.models",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "tasks.models.Task.objects.all",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tasks.models.Task.objects",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_nam... |
19751817741 | from django.urls import path
from . import views
urlpatterns = [
path("item/", views.detailView, name="Detail-View"),
path("index/", views.basicView, name="Basic-View" ),
path("thumbeditor/", views.editThumbView, name="Thumb-View"),
path("new/", views.recentAdditions, name="Additions-View"),
pat... | Stewie23/WebSTLViewer | mysite/STLViewer/urls.py | urls.py | py | 904 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
23614049798 | from setuptools import setup
with open("README.md", "r") as fh:
long_description = fh.read()
setup(name='gym_pcgrl',
version='0.4.0',
install_requires=['gym', 'numpy>=1.17', 'pillow'],
author="Ahmed Khalifa",
author_email="ahmed@akhalifa.com",
description="A package for \"Procedural ... | amidos2006/gym-pcgrl | setup.py | setup.py | py | 712 | python | en | code | 98 | github-code | 2 | [
{
"api_name": "setuptools.setup",
"line_number": 6,
"usage_type": "call"
}
] |
41081944087 | from sklearn import tree
from sklearn.neighbors import KNeighborsClassifier
from sklearn.svm import SVC
# [height, weight, shoe_size]
X = [[181, 80, 44], [177, 70, 43], [160, 60, 38], [154, 54, 37], [166, 65, 40],
[190, 90, 47], [175, 64, 39],
[177, 70, 40], [159, 55, 37], [171, 75, 42], [181, 85, 43]]
Y = ... | sridhardumpala/Gender_Classification | SVM_SVCdemo.py | SVM_SVCdemo.py | py | 599 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "sklearn.svm.SVC",
"line_number": 14,
"usage_type": "call"
}
] |
20201873479 | import socketio
import asyncio
sio = socketio.AsyncClient()
@sio.event
async def connect():
print("I'm connected!")
@sio.event
async def connect_error(data):
print("The connection failed!")
@sio.event
async def disconnect():
print("I'm disconnected!")
# await sio.connect('http://192.168.1.197:8000')
@... | sonmasterj/iot-air_sensor | testSocket.py | testSocket.py | py | 520 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "socketio.AsyncClient",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "asyncio.run",
"line_number": 24,
"usage_type": "call"
}
] |
31305892199 | import datetime
import os.path
from math import floor, ceil
from peewee import ModelSelect
from typing import Union, Tuple, List
from modelos.tipoBeneficioORM import TipoBeneficioModel
from util.enums.aposentadoriaEnums import SubTipoAposentadoria, TipoAposentadoria, ContribSimulacao
from util.enums.configEnums import... | newprev/PrevCliente | util/helpers/helpers.py | helpers.py | py | 26,144 | python | pt | code | 0 | github-code | 2 | [
{
"api_name": "cache.cacheEscritorio.CacheEscritorio",
"line_number": 300,
"usage_type": "call"
},
{
"api_name": "math.floor",
"line_number": 356,
"usage_type": "call"
},
{
"api_name": "math.floor",
"line_number": 358,
"usage_type": "call"
},
{
"api_name": "dateti... |
30542647646 | from __future__ import absolute_import
from __future__ import unicode_literals
import json
import os
import sys
import textwrap
import click
from .list import kraft_list_preflight
from kraft.const import LIST_DESC_WIDTH
from kraft.logger import logger
from kraft.types import break_component_naming_format
from kraft.... | unikraft/pykraft | kraft/cmd/list/show.py | show.py | py | 3,350 | python | en | code | 175 | github-code | 2 | [
{
"api_name": "list.kraft_list_preflight",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "kraft.types.break_component_naming_format",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "kraft.logger.logger.error",
"line_number": 48,
"usage_type": "call"
... |
2257529164 | # Django Imports
from django.urls import reverse
# Third Party Imports
from rest_framework.status import HTTP_405_METHOD_NOT_ALLOWED
from rest_framework.test import APITestCase
from model_bakery import baker
# Project Imports
from customers.serializer import CustomerSerializer
class CustomerViewSetTest(APITestCase)... | vinithius2/Customer-project-study | customers/tests.py | tests.py | py | 3,027 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "rest_framework.test.APITestCase",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "model_bakery.baker.make",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "model_bakery.baker",
"line_number": 15,
"usage_type": "name"
},
{
"api_na... |
73702599726 | import pytest
from PageObject.checkoutpage import CheckOut
import PageObject
from PageObject.loginpage import LoginPage
from PageObject.checkout_info_page import CheckOutInfo
@pytest.mark.usefixtures("setup")
class TestCheckOutInfo:
@pytest.fixture(autouse=True)
def class_setup(self):
self.lp = PageO... | Sandz0814/E-COMMERCE | testcases/test_information.py | test_information.py | py | 1,478 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "PageObject.loginpage.LoginPage",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PageObject.loginpage",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "PageObject.checkoutpage.CheckOut",
"line_number": 14,
"usage_type": "call"
},
... |
26265332628 | # examples/text_example.py
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), "..", "src"))
import numpy as np
from hug_db import HugDB
from hug_db_load_balancer import HugDBLoadBalancer
from utils import hugprocess_text, text_to_hugvector
from gensim.models import KeyedVectors
import random
... | alexndrvega/HugVector | examples/text_example.py | text_example.py | py | 2,412 | python | en | code | 1 | github-code | 2 | [
{
"api_name": "sys.path.append",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": ... |
13033478090 | import os
import pymel.core as pm
import PySide2.QtWidgets as QtWidgets
import PySide2.QtGui as QtGui
import flottitools.ui as flottiui
import flottitools.utils.skinutils as skinutils
import flottitools.utils.skeletonutils as skelutils
COPYSKIN_UI = None
def copy_skin_launch():
global COPYSKIN_UI
if COPYS... | scott-techart/flottitools | skintools/transferskin/copy_skin_ui.py | copy_skin_ui.py | py | 11,359 | python | en | code | 1 | github-code | 2 | [
{
"api_name": "flottitools.ui.FlottiMayaWindowDesignerUI",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "flottitools.ui",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "os.path.abspath",
"line_number": 25,
"usage_type": "call"
},
{
"api... |
4439651698 | from unittest import TestCase
from datetime import datetime
from ppac.utils import datetime_to_str, str_to_datetime
class TestDatetimeStrConversion(TestCase):
def test_to_string(self):
d = datetime(2022, 5, 3, 12, 34, 44)
txt = datetime_to_str(d)
self.assertEqual(txt, '2022-05-03T12:34:44... | MatthiasRieck/ppac | tests/test_utils.py | test_utils.py | py | 487 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "unittest.TestCase",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "ppac.utils.datetime_to_str",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "ppac.uti... |
18007586590 | """Test the DirectSolver linear solver class."""
from __future__ import division, print_function
import unittest
from six import iteritems
import numpy as np
from openmdao.api import Problem, Group, IndepVarComp, DirectSolver, NewtonSolver
from openmdao.devtools.testutil import assert_rel_error
from openmdao.solver... | hwangjt/blue | openmdao/solvers/linear/tests/test_direct_solver.py | test_direct_solver.py | py | 4,192 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "openmdao.solvers.linear.tests.linear_test_base.LinearSolverTests.LinearSolverTestCase",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "openmdao.solvers.linear.tests.linear_test_base.LinearSolverTests",
"line_number": 17,
"usage_type": "name"
},
{
"a... |
20490491649 | from typing import Optional
from cryptojwt.utils import importer
from idpyoidc.client.service import Service
from idpyoidc.impexp import ImpExp
from idpyoidc.util import qualified_name
def specification_dump(info, exclude_attributes):
return {qualified_name(info.__class__): info.dump(exclude_attributes=exclude_... | peppelinux/idpy-oidc | src/idpyoidc/client/specification/__init__.py | __init__.py | py | 5,126 | python | en | code | null | github-code | 2 | [
{
"api_name": "idpyoidc.util.qualified_name",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cryptojwt.utils.importer",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "idpyoidc.impexp.ImpExp",
"line_number": 21,
"usage_type": "name"
},
{
"api_... |
41620678279 |
import streamlit as st #streamlit is used to build app in quick
from PIL import Image #used to make changes in the web app
# Loading Image using PIL
im = Image.open('./images/App_Icon.png')
st.set_page_config(page_title="CardioVascular Disease Predictor App",page_icon=im)
import pandas as pd
import numpy as np
im... | chaituucan/CardioVascular | Home.py | Home.py | py | 2,753 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "PIL.Image.open",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "streamlit.set_page_config",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "streamlit.container",... |
18122185973 | import numpy as np
import cv2
import matplotlib.pyplot as plt
import datetime
#import imutils
import time
class clsImage(object):
"""Code Example using Google style docstrings.
This module demonstrates documentation as specified by the `Google Python
Style Guide`_. Docstrings may extend over multiple lines. Secti... | lmhonorio/firstOCVPython | firstOCVPhyton/ImageTest.py | ImageTest.py | py | 10,596 | python | en | code | 1 | github-code | 2 | [
{
"api_name": "cv2.imread",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_num... |
19782766092 | """
训练模型
"""
import torch
import torchvision
from torch import optim, nn
import visdom
from torch.utils.data import DataLoader
from verificationcode import VerificationCode
from resnet import ResNet18
BATCH_SIZE = 32
LR = 1e-3
EPOCHS = 20
device = torch.device('cuda')
# 设置随机种子,以便能更好的复现
torch.manual_seed(1234)
# 导入数据... | sinat-jiang/VerificationCodeIdentification | src/train_scratch.py | train_scratch.py | py | 6,214 | python | zh | code | 0 | github-code | 2 | [
{
"api_name": "torch.device",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.manual_seed",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "verificationcode.VerificationCode",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "veri... |
13687269047 | import cv2
import numpy as np
import pickle
def predict_image(data, clf):
n_samples = len(data)
clean_data = data.flatten().reshape(1, -1)
clean_data = clean_data / 255
pred = clf.predict(clean_data)
print(pred)
return pred
def load_model(name):
with open(name, mode="rb") as f:
mod... | RealVizz/Hand-Gesture-Recognition | webcam_predictor.py | webcam_predictor.py | py | 1,572 | python | en | code | 1 | github-code | 2 | [
{
"api_name": "pickle.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.createBackgroundSubtractorMOG2",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy... |
4486116062 | from django.contrib.sessions.backends.db import SessionStore as DBStore
import chat
from django.utils import timezone
class SessionStore(DBStore):
@classmethod
def get_model_class(cls):
print('helllo')
return chat.models.CustomSession
def create_model_instance(self, data):
"""
... | Aratbm7/custom_session | core/session_backend.py | session_backend.py | py | 1,021 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "django.contrib.sessions.backends.db.SessionStore",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "chat.models",
"line_number": 10,
"usage_type": "attribute"
}
] |
20795817405 | import scrapy
import re
# import urlparse
from scrapy.spiders import CrawlSpider, Rule
from scrapy.linkextractors import LinkExtractor
from scrapy.loader.processors import Join, MapCompose, TakeFirst
from scrapy.pipelines.images import ImagesPipeline
from io import BytesIO
from urllib.request import urlopen,Request
... | eittech/megamercado-django | scraper/scraper/spiders/anglosgrowshop.py | anglosgrowshop.py | py | 10,794 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "scrapy.Spider",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "scrapy.Request",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "scrapy.Request",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "scrapy.Request",
... |
70889479407 | '''
Store of common functions found in all analysis engine
This is also where the date of BICC is set. This is the date from which much of the analysis is set.
NOTE. Python date format is (YYYY,MM,DD)
'''
import random
from datetime import datetime
from collections import Counter
from openpyxl.styles import Font, P... | banillie/projectlibrary | analysis/engine_functions.py | engine_functions.py | py | 41,611 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 57,
"usage_type": "call"
},
{
"api_name"... |
18116606995 | import requests, re, sys, pyperclip, webbrowser
from bs4 import BeautifulSoup as bs
# if len(sys.argv) > 1:
# # Takes what's written.
# adress = sys.argv[1:]
# # Takes what in clickboard.
# else:
# adress = pyperclip.paste()
#
# resp = input("Enter 'y' if you want to open web-sites. \nEnter 'n' if only... | TagJack/python_learning_stage | api_requests/google_search.py | google_search.py | py | 2,004 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "sys.argv",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "pyperclip.paste",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "webbrowser.open",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "requests.get",
"lin... |
42372611468 | import socket
from miniWeb服务器.application import app
import multiprocessing
class MyServer(object):
def __init__(self, ip, port):
# 创建套接字
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# 设置地址重用
server_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSE... | hide-in-cloud/python-test | miniWeb服务器/MySocket.py | MySocket.py | py | 2,059 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "socket.socket",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREAM",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "socket.SOL_SOC... |
26011041545 | from qtpy import uic
from qtpy.QtCore import Qt
from qtpy.QtWidgets import (
QDialog, QHBoxLayout, QLabel, QTextEdit, QVBoxLayout, QWidget)
from karabo.native import Hash, create_html_hash
from .utils import get_dialog_ui
EMPTY_CHANGES = Hash("None -", "No critical changes")
class Page(QWidget):
def __init... | European-XFEL/guiextensions | src/extensions/dialogs/compare_dialog.py | compare_dialog.py | py | 2,371 | python | en | code | 1 | github-code | 2 | [
{
"api_name": "karabo.native.Hash",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "qtpy.QtWidgets.QWidget",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "qtpy.QtWidgets.QLabel",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "qtpy.... |
3694728921 | # /bin/env python3
# -*- coding: utf-8 -*-
"""
|----------|
||--------||
|| CH1 ||
||--------||
||--------||
|| CH2 ||
||--------||
||--------||
|| MATH ||
||--------||
|----------|
"""
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Gdk
class Signals(Gtk.Grid):
"""
select... | AdamVerner/oscilo | Software/Modules/Scope/Signals.py | Signals.py | py | 1,806 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "gi.require_version",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "gi.repository.Gtk.Grid",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "gi.repository.Gtk",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "gi.r... |
34457490820 | import sys
import argparse
from os.path import join, dirname, abspath, realpath
_path_file = dirname(realpath(__file__))
sys.path.append(join(_path_file, "../../humoro"))
from examples.prediction.hmp_interface import HumanRollout
ROOT_DIR = join(dirname(abspath(__file__)), '..')
DATASET_DIR = join(ROOT_DIR, 'datasets'... | anindex/lgp | examples/play_segment.py | play_segment.py | py | 875 | python | en | code | 2 | github-code | 2 | [
{
"api_name": "os.path.dirname",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path.realpath",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_nu... |
10498806752 | """
File name: DODO_6281.py
Tags:
Description: Update the store procedure to support the destination field for the dynamic prompts
and correct printing on receipts.
Author: Javier Sandoval
Date created: 2020-04-23 14:00:00
Date last modified: 2020-04-27 17:00:00
Python Version: 3.7
"""
... | priyatam0509/Automation-Testing | Scripts/features/DODO_6281.py | DODO_6281.py | py | 23,092 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "logging.getLogger",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "app.mws",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "app.pos",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "app.framework.EDH.EDH",
"line_n... |
8992675844 | from django.urls import reverse
from factory.faker import faker
from rest_framework import status
from baskin_robbins.conftest import BaskinRobbinsTestCase
from baskin_robbins.product.tests.factories import RecipeWithIngredientFactory
faker = faker.Faker()
class RecipeViewTestCase(BaskinRobbinsTestCase):
def se... | aabanaag/api-baskin-robbins | baskin_robbins/product/tests/api_views/test_recipe_views.py | test_recipe_views.py | py | 2,098 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "factory.faker.faker",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "factory.faker.faker.Faker",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "baskin_robbins.conftest.BaskinRobbinsTestCase",
"line_number": 11,
"usage_type": "name"
},
... |
24230807523 | """It contains tests for the database.py module"""
import sqlalchemy
def test_database_init(app):
"""
GIVEN the init() function
WHEN init() is call
THEN check sqlalchemy initialization
"""
from app.database import init, Base, engine, db_session
init(app)
assert Base.__class__ == sqlalchemy.ext.decl... | marcosricardoss/flask-restful-skeleton | tests/unit/test_database.py | test_database.py | py | 853 | python | en | code | 17 | github-code | 2 | [
{
"api_name": "app.database.init",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "app.database",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": "app.database.Base.__class__",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "a... |
41970077180 | import logging
import json
from aiogram.types import message
import asyncio
from aiogram import Bot, Dispatcher, types, executor
import config
# логирование процесса
logging.basicConfig(level=logging.INFO)
# создаем экземпляр и передаем ему token нашего бота
bot = Bot(
token=config.BOT_TOKEN,
parse_mode=types... | izumizumoff/remember_bot_red | remember_bot_red/remember_bot_aio.py | remember_bot_aio.py | py | 33,922 | python | ru | code | 0 | github-code | 2 | [
{
"api_name": "logging.basicConfig",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "aiogram.Bot",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "config.BOT_TOKEN",
... |
73439257645 |
from math import gcd
import random
from Crypto.PublicKey import DSA
first_primes_list = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29,
31, 37, 41, 43, 47, 53, 59, 61, 67,
71, 73, 79, 83, 89, 97, 101, 103,
107, 109, 113, 127, 131, 137, 139,
14... | can-arikan/crypto_base_sunum | prime.py | prime.py | py | 2,433 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "random.randrange",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "random.randrange",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "math.gcd",
"line... |
34834445895 | # 열쇠
'''https://www.acmicpc.net/problem/9328'''
import sys
from collections import deque
# 상수
WALL = ord("*")
EMPTY = ord(".")
CONSTANT = abs(ord("A") - ord("a"))
DOCUMENT = ord("$")
COUNT = ord("Z") - ord("A") + 1
dx_dy = [(-1,0),(0,-1),(1,0),(0,1)]
# 필요 함수 정리
def is_wall(node):
if 0 <= node - ord("A") < COUNT... | GijeongKim98/codingtest | 백준/graph/key.py | key.py | py | 3,797 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "collections.deque",
"line_number": 100,
"usage_type": "call"
},
{
"api_name": "sys.stdin.readline",
"line_number": 122,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 122,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin.read... |
26357785061 | # used for the GPS module
import serial
def GPS():
g_flag = False # set flag
try:
gps = serial.Serial('COM5', 9600) # COM depends on your specific device, second value is baudrate
except:
print('\nFailed to connect.') # prints error if no device... | NavidKarami/Team-11-Capstone-Project | Codes/mfcc_gmm_final_version/GPS.py | GPS.py | py | 2,015 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "serial.Serial",
"line_number": 7,
"usage_type": "call"
}
] |
19017130137 | """_summary_
"""
import requests # type: ignore
def group_repos_by_tag(username: str, token: str) -> None:
"""_summary_
:param username: _description_
:type username: str
:param token: _description_
:type token: str
"""
url = f"https://api.github.com/users/{username}/repos"
headers... | TheNewThinkTank/project-metrics | src/REST/group_by_tag.py | group_by_tag.py | py | 1,433 | python | en | code | 3 | github-code | 2 | [
{
"api_name": "requests.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 28,
"usage_type": "call"
}
] |
35436077935 | import jax
import jax.numpy as jnp
def _simple_bisection(f, m, M, tol):
def _cond_fun(args):
m, M = args
return (M - m) / M > tol
def _body_fun(args):
m, M = args
x = jnp.linspace(m, M, 4)
y = f(x)
i_star = jnp.argmin(y)
new_min = jnp.where(
... | Confirm-Solutions/imprint | imprint/bound/optimizer.py | optimizer.py | py | 704 | python | en | code | 13 | github-code | 2 | [
{
"api_name": "jax.numpy.linspace",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "jax.numpy",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "jax.numpy.argmin",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "jax.numpy",
"line_n... |
40311361127 | """The classes that turn L{Documentable} instances into objects Nevow can render."""
from nevow import loaders, page, tags
from pydoctor import epydoc2stan, model
from pydoctor.nevowhtml.pages.table import ChildTable
from pydoctor.nevowhtml.util import \
templatefile, fillSlots, srclink, taglink
def getBetterT... | davidsansome/babbledrive | generator-pydoctor/pydoctor/nevowhtml/pages/__init__.py | __init__.py | py | 15,113 | python | en | code | 24 | github-code | 2 | [
{
"api_name": "pydoctor.epydoc2stan.doc2html",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "pydoctor.epydoc2stan",
"line_number": 53,
"usage_type": "name"
},
{
"api_name": "nevow.page.Element",
"line_number": 55,
"usage_type": "attribute"
},
{
"api_na... |
16030845556 | import pywavefront
import configparser
import numpy as np
class Model:
def __init__(self):
self.vertices = None
self.faces = None
self.color = None
def init_like(self, vertices, faces, color):
self.vertices = vertices
self.faces = faces
self.color = color
... | guseva-47/z_buffer_comp_graf | Model.py | Model.py | py | 2,046 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pywavefront.Wavefront",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.arr... |
17006035034 | # !/usr/bin/env python
# -*- coding: utf-8 -*-
from sklearn import preprocessing # 预处理,数据标准化
import numpy as np
a = np.array([
[10, 2.7, 3.6],
[-100, 5, -2],
[120, 20, 40]
], dtype=np.float64)
print(a)
# 计算公式 (X-X_mean)/X_std 去除均值和方差进行缩放
# sklearn.preprocessing.scale(X, axis=0, with_mean=True,with_std=True,copy=... | SeanLee97/machine_learning_demo | sklearn/data_normal/demo1.py | demo1.py | py | 1,499 | python | zh | code | 0 | github-code | 2 | [
{
"api_name": "numpy.array",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.float64",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "sklearn.preprocessing.scale",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sklearn.pre... |
2148842235 | import requests
from flask import Flask, request
app = Flask(__name__)
bot_token = "419653899:AAHsjKQYihN6pHI4kEHGBWVoytozZMq14Do"
def get_url(method):
return "https://api.telegram.org/bot{}/{}".format(bot_token, method)
def process_message(update):
data = {}
data["chat_id"] = update["message"]["from"][... | dragosgn/telegram-bot | server.py | server.py | py | 680 | python | en | code | 2 | github-code | 2 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
... |
74346586926 | #!/usr/bin/env python
# coding: utf-8
# In[3]:
import matplotlib.pyplot as plt
# In[5]:
img = plt.imread('E:/Git/Numpy_04476/New folder/b.jpg')
plt.imshow(img)
# In[6]:
img1 = plt.imread('E:/Git/Numpy_04476/New folder/c.jpg')
plt.imshow(img1)
# In[7]:
Crop_img1 = img[0:500, 0:1000]
plt.imshow(Crop_img1)
... | EnggQasim/Saylani-AI-Batch2 | New folder/MergeImages.py | MergeImages.py | py | 614 | python | en | code | 14 | github-code | 2 | [
{
"api_name": "matplotlib.pyplot.imread",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.imshow",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "m... |
71550065006 | import hashlib
import http.client
import json
import logging
import socket
import d1_onedrive.impl.resolver.resolver_base
import d1_onedrive.impl.resolver.resource_map
from d1_onedrive.impl import attributes
from d1_onedrive.impl import directory
from d1_onedrive.impl import disk_cache
from d1_onedrive.impl import one... | DataONEorg/d1_python | client_onedrive/src/d1_onedrive/impl/resolver/region.py | region.py | py | 10,172 | python | en | code | 14 | github-code | 2 | [
{
"api_name": "logging.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "d1_onedrive.impl.resolver.resolver_base.impl",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "d1_onedrive.impl.resolver.resolver_base",
"line_number": 49,
"usage_t... |
14004465781 | from django.db import models, DatabaseError
def get_pootle_build(default=0):
"""Get the Pootle build version for the current deployment, if any."""
try:
build = PootleConfig.objects.get_current().ptl_build
except Exception:
build = 0
if not build:
build = get_legacy_ptl_build(... | alex-silva/pootleDev | pootle/pootle/apps/pootle_app/models/pootle_config.py | pootle_config.py | py | 2,392 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "pootle_misc.siteconfig.load_site_config",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "django.db.DatabaseError",
"line_number": 55,
"usage_type": "name"
},
{
"api_name": "pootle_misc.siteconfig.load_site_config",
"line_number": 66,
"usage_type"... |
42001835319 | import scipy.io
import matplotlib.pyplot as plt
import numpy as np
import h5py
MOVIE_LEN = 11998
FRAME_H = 500
FRAME_W = 500
FRAME_SHAPE = (FRAME_H, FRAME_W)
def load_ground_truth_generation_data(path):
"""
Loads ground truth data generated by MATLAB annotation tool.
Returns:
f... | VoytechG/neuron-finder | unet/load_data.py | load_data.py | py | 1,791 | python | en | code | 1 | github-code | 2 | [
{
"api_name": "scipy.io.io.loadmat",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "scipy.io.io",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "scipy.io",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line... |
32868141891 | import matplotlib.pyplot as plt
from grid_template import Grid_Template
from layout_plot_color import Color_Layout
def make_weave_grid(m, n):
"""create a rectangular grid
Arguments:
m, n - respectively the number of rows and columns"""
from weave_grid import Weave_Grid
print("Grid: Weave_... | econrad003/yaMazeImp | template_demo.py | template_demo.py | py | 4,427 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "weave_grid.Weave_Grid",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "grid_template.Grid_Template",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "grid_template.Grid_Template",
"line_number": 25,
"usage_type": "call"
},
{
"api... |
71550235246 | import ete3
# Rendering
# Global
BRANCH_VERTICAL_MARGIN = 20
EDGE_COLOR = "Gray"
EDGE_WIDTH = 2
# Type Node
TYPE_NODE_FONT_SIZE_FILE = 14
TYPE_NODE_FONT_SIZE_BROWSE = 8
TYPE_NODE_RADIUS = 40
# Subject Node
SUBJECT_NODE_FONT_SIZE = 10
TYPE_NODE_COLOR_DICT = {
"Equiv": "LightBlue",
"Group": "LightGreen",
... | DataONEorg/d1_python | lib_common/src/d1_common/cert/subject_info_renderer.py | subject_info_renderer.py | py | 6,469 | python | en | code | 14 | github-code | 2 | [
{
"api_name": "ete3.Tree",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "ete3.TreeStyle",
"line_number": 131,
"usage_type": "call"
},
{
"api_name": "ete3.NodeStyle",
"line_number": 152,
"usage_type": "call"
},
{
"api_name": "ete3.TextFace",
"line_n... |
23049036641 | import os
import os.path
import random
import sys
from contextlib import contextmanager, redirect_stderr, redirect_stdout
import altair as alt
import numpy as np
import pandas as pd
import phenograph
import scipy
import scipy.io
import scipy.sparse
from phenograph.core import find_neighbors
from sklearn.manifold impor... | faryabib/NatMethods_TooManyCells_analysis | phenograph_rare.py | phenograph_rare.py | py | 3,397 | python | en | code | 8 | github-code | 2 | [
{
"api_name": "os.devnull",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "contextlib.redirect_stderr",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "contextlib.redirect_stdout",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": ... |
72052949167 | import json
import redis
from dotenv import load_dotenv
import moltin
from utils import get_database
def cache_categories(db):
categories = moltin.get_all_categories()
db.set('categories', json.dumps(categories))
for slug in categories:
category_data = moltin.get_category_by_slug(slug)
db... | alpden550/pizza-bot | caсhe.py | caсhe.py | py | 1,169 | python | en | code | 7 | github-code | 2 | [
{
"api_name": "moltin.get_all_categories",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "moltin.get_category_by_slug",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "json... |
15236251752 | # Standard Library
import os
import sqlite3
from typing import Type
# First Party
from minislite.sql import SqlManager
from minislite.models import MiniSLiteModel
class MiniSLiteDb:
def __init__(self, db_path=":memory:"):
self.db_path = db_path
os.environ["MINISLITE_DB_PATH"] = self.db_path
... | ahmetkotan/minislite | minislite/minislite.py | minislite.py | py | 1,183 | python | en | code | 5 | github-code | 2 | [
{
"api_name": "os.environ",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "sqlite3.connect",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sqlite3.Row",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "typing.Type",
"l... |
74945254767 | from __future__ import print_function
import argparse
import configparser
import json
import numpy as np
import os
import sys
import torch
import torch.distributed as dist
from datetime import datetime
from datasets import load_dataset, load_metric
from transformers import GPT2Tokenizer, GPT2LMHeadModel
from tqdm impor... | CodeGeeX/codegeex-fastertransformer | examples/pytorch/gpt/gpt_summarization.py | gpt_summarization.py | py | 11,013 | python | en | code | 65 | github-code | 2 | [
{
"api_name": "os.path.dirname",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"... |
11302810093 | import time
from options.train_options import TrainOptions
from data.myDataLoader import myDataLoader
from model.cycle_model import CycleGANModel
from util.visualizer import Visualizer
opt = TrainOptions().parse()
data_loader = myDataLoader(opt)
model = CycleGANModel(opt)
visualizer = Visualizer(opt)
total_steps = 0
... | Larry-zx/inkV1 | train.py | train.py | py | 1,899 | python | en | code | 0 | github-code | 2 | [
{
"api_name": "options.train_options.TrainOptions",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "data.myDataLoader.myDataLoader",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "model.cycle_model",
"line_number": 9,
"usage_type": "name"
},
{
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.