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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
30357769484 | import xarray
import xarray.plot
import numpy as np
def compute_rpe(initial_state_file_name='initial_state.nc',
output_file_prefix='output_', num_files=5):
"""
Computes the reference (resting) potential energy for the whole domain
Parameters
----------
initial_state_file_name : str... | MPAS-Dev/compass | compass/ocean/rpe.py | rpe.py | py | 3,982 | python | en | code | 9 | github-code | 18 | [
{
"api_name": "xarray.open_dataset",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.tile",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.min",
"line_number... |
6217822367 | import json
import pickle
import random
import re
import time
import uuid
from datetime import datetime
import grpc
from common.django_utils import DataResponse
from common.local import get_request_username
from kazoo.client import KazooClient
from rest_framework.response import Response
from dataflow.modeling.basic_... | Tencent/bk-base | src/api/dataflow/modeling/job/job_controller.py | job_controller.py | py | 44,585 | python | en | code | 85 | github-code | 18 | [
{
"api_name": "dataflow.modeling.job.modeling_job_pipeline.ModelingJobPipeLine",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "dataflow.modeling.handler.mlsql_execute_log.MLSqlExecuteLogHandler.get_with_default",
"line_number": 63,
"usage_type": "call"
},
{
"api_name"... |
8981948101 | import sys
from PIL import Image
from Node2 import Node
import math
from heapq import *
OPEN_LAND_COLOR = (248, 148, 18, 255)
ROUGH_MEADOW_COLOR = (255, 192, 0, 255)
EASY_MOVE_FOREST_COLOR = (255, 255, 255, 255)
SLOW_RUN_FOREST_COLOR = (2, 208, 60, 255)
WALK_FOREST_COLOR = (2, 136, 40, 255)
IMPASS_VEG_COLOR = (5, 73, ... | adh9570/Lab1 | lab.py | lab.py | py | 9,570 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "Node2.Node",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "Node2.Node",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "Node2.Node",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "Node2.Node",
"line_number": 73,
... |
17436128522 | from django.shortcuts import render
import json
def family(request, family_id):
with open('info/animals.json') as file:
data = json.load(file)
animals = [animal for animal in data['animals'] if animal['family'] == family_id]
family_name = next((family['name'] for family in data['families'] ... | tuvianesher/DI_Bootcamp | week5/day1/exercises_XP/animal-info/animal-info/animals/info/views.py | views.py | py | 764 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "json.load",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
... |
28827248251 | import numpy as np
from scipy.signal import convolve
from porespy.tools import ps_rect
__all__ = [
"local_diff",
"ramp",
]
def ramp(shape, inlet=1.0, outlet=0.0, axis=0):
r"""
Generates an array containing a linear ramp of greyscale values along the given
axis.
Parameter
---------
s... | PMEAL/porespy | porespy/beta/_generators.py | _generators.py | py | 2,122 | python | en | code | 240 | github-code | 18 | [
{
"api_name": "numpy.linspace",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.swapaxes",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.tile",
"line_nu... |
22803404724 | """
adapted from https://github.com/FeliMe/feature-autoencoder
"""
from argparse import ArgumentParser
from collections import defaultdict
from time import time
import numpy as np
import torch
from UPD_study.models.FAE.FAEmodel import FeatureReconstructor
from torch import Tensor
from torchinfo import summary
from UPD_... | iolag/UPD_study | UPD_study/models/FAE/FAEtrainer.py | FAEtrainer.py | py | 7,239 | python | en | code | 18 | github-code | 18 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "UPD_study.utilities.common_config.common_config",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 54,
"usage_type": "call"
},
{
... |
71427707559 | import torch
import numpy as np
class CategoriesSampler():
def __init__(self, label, n_batch, n_task, n_cls, n_per, n_cls_open, n_per_open):
self.n_batch = n_batch
self.n_task = n_task
self.n_cls = n_cls # the number of sampling's category
self.n_per = n_per # the number of samp... | wushaoling540/TNPNet | model/dataloader/samplers.py | samplers.py | py | 3,802 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.array",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.argwhere",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.from_numpy",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.randperm",
"lin... |
36791541843 | from django.shortcuts import render,redirect
import requests
from .models import Article
# Create your views here.
def index(request):
articles = Article.objects.all()
context={
'articles':articles
}
return render(request,'index.html',context)
def show(request,id):
article = Article.objects... | wwe221/TIL | python&Django/day9/crudtest/articles/views.py | views.py | py | 1,252 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "models.Article.objects.all",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "models.Article.objects",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "models.Article",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "dj... |
21108712894 | import argparse
import configparser
import json
import re
from pathlib import Path
import pygit2
def format_component(submod):
return {"component": {"type": "git", "git": {"commitHash": str(submod.head_id), "repositoryUrl": submod.url}}}
def lookup_submodule(repo, submodule_path):
submodule = repo.lookup_s... | microsoft/onnxruntime | tools/python/get_submodules.py | get_submodules.py | py | 2,586 | python | en | code | 9,700 | github-code | 18 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "re.fullmatch",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "pygit2.Repository... |
41115593102 | import psutil
import platform
from pydantic import BaseModel
from sys import platform as pf
from .apscheduler import scheduler
if pf == "win32":
import wmi
from win32com.client import GetObject
class PlatformInfo(BaseModel):
name: str
struct: str
type: str
class CpuInfo(BaseModel):
name: s... | Kyomotoi/ATRI | ATRI/utils/machine.py | machine.py | py | 4,146 | python | en | code | 675 | github-code | 18 | [
{
"api_name": "sys.platform",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "pydantic.BaseModel"... |
13110132294 | import dlib
import pymongo
import numpy as np
import cv2
# Load the shape predictor model
predictor = dlib.shape_predictor("shape_predictor_68_face_landmarks.dat")
# Connect to the MongoDB database
client = pymongo.MongoClient("mongodb://localhost:27017/")
db = client["miranda"]
face_features = db["face_features"]
#... | AnteZovko23/MIRANDA_BACKEND | embedder/landmark_test.py | landmark_test.py | py | 2,457 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "dlib.shape_predictor",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "dlib.rectangle",
... |
40598322412 | # Import essential module for this project
import googletrans
import speech_recognition as sr
import gtts
import playsound
import re
import random
# Google Supported voices and languages link is below:
# https://cloud.google.com/text-to-speech/docs/voices
input_lang = 'bn-IN'
destination_lang = 'bn'
# Create instanc... | ZobaerIslam/Bangla-virtual-assistant | main.py | main.py | py | 4,355 | python | bn | code | 0 | github-code | 18 | [
{
"api_name": "speech_recognition.Recognizer",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "googletrans.Translator",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "speech_recognition.Microphone",
"line_number": 25,
"usage_type": "call"
},
{
... |
6442391567 | import shutil
import tempfile
from http.client import OK
from django import forms
from django.conf import settings
from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.cache import cache
from django.contrib.auth import get_user_model
from django.test import Client, TestCase, override_setting... | CoderDmitriy/yatube | yatube/posts/tests/test_views.py | test_views.py | py | 14,574 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tempfile.mkdtemp",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.BASE_DIR",
"line_number": 18,
"usage_type": "attribute"
},
{... |
6049684012 | import time
import numpy as np
import os
import logging
from . import utils
from skimage.morphology import skeletonize_3d
from .scores import correctness_completeness_quality
logger = logging.getLogger(__name__)
class Trainer(object):
def __init__(self,training_step, validation=None, valid_every=None,
... | doruk-oner/ConnectivityOnProjections | Codes/training.py | training.py | py | 8,393 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": ... |
1513036576 | #!python3
#lower = int(args.lower)
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import LinearSegmentedColormap
import sys
import argparse
import signal
import math
from scipy.stats import zscore
from bisect import bisect_left
parser = argparse.ArgumentParser(description='... | 5centmike/Bullseye | bullseye.py | bullseye.py | py | 8,168 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "bisect.bisect_left",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "sys.exit",
... |
3909850792 | import gzip
import json
from flask import Blueprint, Response, request, escape
from lib import db
from lib.gwpcc import consts
from lib.gwpcc.colonies.colony import Colony
from lib.gwpcc.consts import KEY_THING_LOCALE_THING_NAMES, USER_TYPES
from lib.gwpcc.things.thing import Thing
colony_module = Blueprint('v4_colo... | OdysseyScorpio/gwp | lib/modules/v4/colony.py | colony.py | py | 6,112 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Blueprint",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.request.json",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "lib.db.get_redi... |
73284113639 | # -*- coding: utf-8 -*-
from contextlib import contextmanager
from math import floor, log10
from timeit import default_timer as timer
from typing import Tuple
import torch
import torch.nn as nn
from torch.utils.data import DataLoader, SubsetRandomSampler, TensorDataset
# +
from torchvision.datasets import MNIST, CIFA... | anthonyjclark/cs152fa21 | lectures/utils.py | utils.py | py | 7,704 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "torch.zeros_like",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.float",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "torchvision.transforms.Compose",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "torc... |
39774367173 | import gzip
import math
import numpy as np
import os
import random
import sys
import torch
import torch.nn as nn
import torch.utils.data as data
import torch.utils.model_zoo as model_zoo
import torchvision.transforms as transforms
if sys.version_info[0] == 2:
from urllib import urlretrieve
else:
from urllib.re... | voletiv/mcvd-pytorch | datasets/moving_mnist.py | moving_mnist.py | py | 7,641 | python | en | code | 246 | github-code | 18 | [
{
"api_name": "sys.version_info",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",... |
37013335108 | #!/usr/bin/env python3
import numpy as np
"""This module contains MISMIP constants and parameters, as well as functions
computing theoretical steady state profiles corresponding to various MISMIP
experiments.
It should not be cluttered with plotting or NetCDF output code.
"""
def secpera():
"Number of seconds p... | pism/pism | examples/mismip/mismip2d/MISMIP.py | MISMIP.py | py | 9,438 | python | en | code | 89 | github-code | 18 | [
{
"api_name": "numpy.array",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": ... |
18061028882 |
from products.models import Products,Category
from .models import Customers
from django.views.generic import CreateView, DeleteView,UpdateView,ListView,FormView,View,DetailView
from .forms import *
from django.contrib.auth import get_user_model
from django.db.models import Q
from cart.cart import Cart
from cart.models... | fa0xh1/CoffeShopku | myproject/customers/views.py | views.py | py | 11,368 | python | en | code | 13 | github-code | 18 | [
{
"api_name": "products.models.Products.objects.get",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "products.models.Products.objects",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "products.models.Products",
"line_number": 26,
"usage_type": "n... |
24567817647 | """Test conversation chain and memory."""
import pytest
from langchain_core.memory import BaseMemory
from langchain_core.prompts.prompt import PromptTemplate
from langchain.chains.conversation.base import ConversationChain
from langchain.memory.buffer import ConversationBufferMemory
from langchain.memory.buffer_window... | langchain-ai/langchain | libs/langchain/tests/unit_tests/chains/test_conversation.py | test_conversation.py | py | 4,185 | python | en | code | 68,990 | github-code | 7 | [
{
"api_name": "langchain.memory.buffer.ConversationBufferMemory",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "langchain.memory.buffer.ConversationBufferMemory",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "tests.unit_tests.llms.fake_llm.FakeLLM",
"l... |
24229625379 | from PyQt5.QtWidgets import QTextBrowser
from PyQt5.QtGui import QCursor
from PyQt5.QtCore import Qt
import markdown
class Intro(QTextBrowser):
def __init__(self):
super().__init__()
markdown_content = """
#### 请事先使用Qualcomm DbgCfgTool apk或是MTK DebugLogger apk软件录制log, 而且DbgCfgTool或是DebugLogger需要纪录到... | YuTing-Fang1999/FIH-tool | QC/AF/Analysis/AFLogFetcher/Intro.py | Intro.py | py | 1,045 | python | zh | code | 0 | github-code | 7 | [
{
"api_name": "PyQt5.QtWidgets.QTextBrowser",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "markdown.markdown",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtGui.QCursor",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "PyQ... |
31772971741 | #!/usr/bin/env python3
import cv2
import numpy as np
import math
from imutils import paths
import argparse
from skimage import exposure
#le a imagem
image = cv2.imread("imagem5.png")
original = image.copy()
#transforma pra escala de cinza
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
cv2.imwrite("gray.png", gray)
#... | Gilnek/Chromossome-Counter | scc (1).py | scc (1).py | py | 2,357 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "cv2.imread",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "cv2.imwrite",
"li... |
2887625368 | import subprocess, sys, time, tempfile, yaml, os, requests, pytest, signal, json, inspect, random
from PIL import Image
brave_processes = {}
DEFAULT_PORT=5000
@pytest.fixture #(scope="module")
def run_brave(config_file=None, port=None):
def _run_brave(config_file=None, port=None):
cmd = './brave.py'
... | bbc/brave | tests/utils.py | utils.py | py | 13,739 | python | en | code | 629 | github-code | 7 | [
{
"api_name": "subprocess.Popen",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "signal.SIGINT",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "pytest.fixture",
"... |
74593517343 | from setuptools import setup, Extension, find_packages
from Cython.Build import cythonize
ext_modules = [Extension("gripspy.util.checksum", ["gripspy/util/checksum.pyx"]),
Extension("gripspy.util.coincidence", ["gripspy/util/coincidence.pyx"])]
setup(
name='gripspy',
version='0.1',
author=... | GRIPS/gripspy | setup.py | setup.py | py | 892 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "setuptools.Extension",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "setuptools.Extension",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "setuptools.setup",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "setuptools.fi... |
34685690289 | """Endpoints for running models"""
import logging
from typing import List, Optional, Union, Type, Tuple
from accept_types import AcceptableType # type: ignore
from fastapi import (
APIRouter,
BackgroundTasks,
Body,
Response,
Request,
Depends,
UploadFile,
File,
Header,
HTTPExce... | SolarPerformanceInsight/solarperformanceinsight | api/solarperformanceinsight_api/routers/jobs.py | jobs.py | py | 13,600 | python | en | code | 6 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "fastapi.APIRouter",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "fastapi.Response",
"line_number": 69,
"usage_type": "name"
},
{
"api_name": "fastapi.Request"... |
806972331 | from rest_framework.decorators import api_view
from rest_framework.response import Response
from aidaijia_coupon.models import CouponCandidate, Coupon
from aidaijia_coupon.serializers import CouponCandidateSerializer, CouponSerializer
@api_view(['POST'])
def create_coupon(request):
queryset = CouponCandidate.obje... | sebastianlan/wedfairy-api | aidaijia_coupon/views.py | views.py | py | 1,227 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "aidaijia_coupon.models.CouponCandidate.objects.filter",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "aidaijia_coupon.models.CouponCandidate.objects",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "aidaijia_coupon.models.CouponCandidate",
... |
2648196535 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib3
import json
import certifi
import shutil
import sys
def getPdfLinks(d):
urls = []
titles = []
print("Getting links")
for i in d:
url = 'https://hacker-news.firebaseio.com/v0/item/' + str(i) + '.json?print=pretty'
r = http.r... | mlinnalampi/Scripts-and-Snippets | HackerNews/hn.py | hn.py | py | 2,066 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "json.loads",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "urllib3.PoolManager",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "certifi.where",
"lin... |
34446159241 | from django.urls import path
from apps.trabajoFinalApp import views
app_name = 'gestion'
urlpatterns = [
path('alumno/', views.alumno, name='alumno'),
path('alumno/proyecto/estado/', views.proyecto_create, name='proyecto_create'),
path('alumno/proyecto/entrega/', views.proyecto_entrega, name='proyecto_ent... | marcosgomezok/LaboratorioP3 | Laboratorio/apps/trabajoFinalApp/urls.py | urls.py | py | 2,651 | python | es | code | 0 | github-code | 7 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "apps.trabajoFinalApp.views.alumno",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "apps.trabajoFinalApp.views",
"line_number": 7,
"usage_type": "name"
},
{
"a... |
36515958276 | # importing the module
import pandas as pd
import pymongo
uri = "mongodb://localhost:27017/"
client = pymongo.MongoClient(uri)
mydb = client["nsrit"]
fields = mydb["pandasData"]
print(client)
# reading the files
f1 = pd.read_excel('results_data\combined_cse3-1.xls',sheet_name='combined')
f2 = pd.read_excel('result... | Sudheer-23/tpo_project_placements | merge.py | merge.py | py | 878 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.read_excel",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.read_excel",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.DataFra... |
33196455238 | import re
from nltk.stem import PorterStemmer
# Load vocabulary
vocabulary = []
with open('vocab.txt', 'r') as f:
lines = f.readlines()
vocabulary = [line[:-1] for line in lines]
def process_email(email_contents):
""" preprocesses a the body of an email and returns a list of word_indices """
globa... | rickwierenga/CS229-Python | ex6/process_email.py | process_email.py | py | 1,889 | python | en | code | 148 | github-code | 7 | [
{
"api_name": "re.compile",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 32,
... |
15459109022 | import time
import math
from functools import reduce
from logging import getLogger
logger = getLogger(__name__)
class Scheduler:
def __init__(self, jobs):
"""
Create a new Scheduler.
>>> s = Scheduler([Job(1, max, 100, 200)])
>>> for jobs in s:
... time.sleep(s.tick_d... | NicolasLM/sauna | sauna/scheduler.py | scheduler.py | py | 3,151 | python | en | code | 19 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "math.gcd",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_num... |
928667834 | from typing import Any, Callable, Optional
from reactivex import Observable, abc, typing
from reactivex.disposable import Disposable
def from_callback_(
func: Callable[..., Callable[..., None]],
mapper: Optional[typing.Mapper[Any, Any]] = None,
) -> Callable[[], Observable[Any]]:
"""Converts a callback f... | ReactiveX/RxPY | reactivex/observable/fromcallback.py | fromcallback.py | py | 1,878 | python | en | code | 4,581 | github-code | 7 | [
{
"api_name": "typing.Callable",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "reactivex.typing.Mapper",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "reactivex.t... |
40542186126 | # Data Source
import yfinance as yf
# Data viz
import plotly.graph_objs as go
import streamlit as st
st.title("Crypto App Buy and Sell Decision")
crypto_mapping = {"DOGE": "DOGE-INR", "ETHEREUM": "ETH-INR", "BITCOIN": "BTC-INR", "KUSAMA": "KSM-INR", "BINANCE": "BNB-INR",
"LITECOIN": "LTC-INR", "FILEC... | gsanjeev432/crypto-buy-sell | crypto_app.py | crypto_app.py | py | 3,068 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "streamlit.title",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "streamlit.selectbox",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "yfinance.download",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "plotly.graph_obj... |
23405664925 | import pygame
import random
from os import path
from settings import IMG_DIR, SOUND_DIR, IMG_WIDTH, IMG_HEIGHT, BLACK, FPS, PLAY, CLOSE
from assets import load_assets
def intro_screen(window):
clock = pygame.time.Clock()
# Carrega a imagem de fundo
background = pygame.image.load(path.join(IMG_DIR... | TomasPires/Projeto_Final_pygame | intro_screen.py | intro_screen.py | py | 1,133 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pygame.time.Clock",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pygame.time",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pygame.image",
... |
3985309545 | import threading
import logging
from queue import Queue, Full
from .match import Matcher
from .notification import Message
class Checker:
def __init__(self, name, expr, path, interval, threshold, users, counter, notification):
self.name = name
self.expr = expr
self.path = path
self... | bbotte/bbotte.github.io | magedu_logscan/logscan/check.py | check.py | py | 3,091 | python | en | code | 77 | github-code | 7 | [
{
"api_name": "threading.Event",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "match.Matcher",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "notification.Message",... |
70894127582 | from game.models import Round
from django.utils import timezone
def status_check():
rounds = Round.objects.filter(completed=False, update_status__gte=0)
for r in rounds:
hours_ago = (timezone.now() - r.update_status_date).total_seconds()/3600
if r.update_status == 0 and hours_ago >= 24:
... | bcorwin/TheDrawingGame | game/status_check.py | status_check.py | py | 895 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "game.models.Round.objects.filter",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "game.models.Round.objects",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "game.models.Round",
"line_number": 5,
"usage_type": "name"
},
{
"ap... |
43299204848 | import re
from functools import reduce
import operator
lines = [l.strip() for l in open('input16').readlines()]
rg = r'^(\w+\s?\w+):\s(\d+)-(\d+)\sor\s(\d+)-(\d+)$'
rules = {}
for idx, l in enumerate(lines):
if l == '':
break
groups = re.match(rg, l).groups()
field = groups[0]
start_1, end_1... | dimkarakostas/advent-of-code | 2020/day16.py | day16.py | py | 2,026 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "re.match",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "operator.mul",
"line_number": 71,
"usage_type": "attribute"
}
] |
17663174064 | import numpy as np
import pandas as pd
from tabulate import tabulate
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
from matplotlib import style
from mpl_finance import candlestick_ochl as candlestick
style.use('dark_background')
# BALANCE_COLOR = ['#ffa929', '#ff297f', '#7fff29', '#297fff']
BUY_N... | Draichi/T-1000 | t_1000/render/graph_generator.py | graph_generator.py | py | 13,264 | python | en | code | 166 | github-code | 7 | [
{
"api_name": "matplotlib.style.use",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.style",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "matplotlib.dates.datestr2num",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "ma... |
30689496376 | #!/usr/bin/python
# Append module path
import os, sys
path = os.path.abspath(os.path.join(os.path.dirname(__file__), '../modules'))
if not path in sys.path:
sys.path.insert(1, path)
del path
import dbal, tellstick_comm, time, logging, ConfigParser
config = ConfigParser.ConfigParser()
path = os.path.abs... | r0stig/Homeautomation | services/event_dispatcher.py | event_dispatcher.py | py | 1,417 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "os.path.abspath",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_nu... |
72719157022 | import MinkowskiEngine as ME
import torch
def minkowski_collate_fn(list_data):
coordinates_batch, features_batch, labels_batch = ME.utils.sparse_collate(
[d["coordinates"] for d in list_data],
[d["features"] for d in list_data],
[d["label"].reshape(1) for d in list_data],
dtype=torc... | kghandour/dd3d | utils/MinkowskiCollate.py | MinkowskiCollate.py | py | 861 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "MinkowskiEngine.utils.sparse_collate",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "MinkowskiEngine.utils",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.float32",
"line_number": 9,
"usage_type": "attribute"
},
{
"a... |
35413308388 | """ 771. Jewels and Stones
You're given strings jewels representing the types of stones that are jewels, and stones representing the stones you have.
Each character in stones is a type of stone you have. You want to know how many of the stones you have are also jewels.
Letters are case sensitive, so "a" is considered... | pm1100tm/algorithm-practice-python | leetcode/no_771.py | no_771.py | py | 1,875 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "utils.CommonUtils.logging_time",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "utils.CommonUtils",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "utils.CommonUtils.logging_time",
"line_number": 31,
"usage_type": "attribute"
},
... |
74463031903 | # Импортируем библиотеку requests
import requests
import json
def new_requests():
url_param = "https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest"
headers = {
"X-CMC_PRO_API_KEY": "d61bca4c-e9d3-40b9-8d82-abf9b057ffbd",
"Accept": "application/json"
}
params = {"id": 1}... | Eris36/Bitcoin | bitbd/utils/new_request.py | new_request.py | py | 1,041 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 22,
"usage_type": "call"
}
] |
36084132571 | import spacy
import requests
import time
import urllib
from urllib.error import HTTPError
import re
import json
from fuzzywuzzy import fuzz
#!python -m spacy download en_core_web_lg
from spacy.lang.en import English
nlp = English()
nlp.tokenizer.url_match = None
infixes = nlp.Defaults.infixes + [r'\.', r'\/', r'\:\/\... | nikitcha/ceebios-pdfdoi | backend/ml.py | ml.py | py | 3,267 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "spacy.lang.en.English",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "spacy.util.compile_infix_regex",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "spacy.util",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "... |
21466059351 |
from conf import SerialConf, OpcConf
from asyncua.common.methods import uamethod
from asyncua import ua, Server
import logging
import asyncio
import serial
import sys
import yaml
sys.path.insert(0, "..")
logging.basicConfig(level=logging.INFO)
_logger = logging.getLogger('asyncua')
@uamethod
def func(parent, value... | statefb/serial-opcua-gateway | pyserver/main.py | main.py | py | 1,856 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.path.insert",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "logging.basicConfig",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
... |
40436025427 | import numpy as np
import matplotlib.pyplot as plt
import re
def visualize_clustering(f_input, f_out1, f_out2):
input = open(f_input, 'r')
out1 = open(f_out1, 'r')
out2 = open(f_out2, 'r')
input_txt = input.read()
s = re.search(r'param a : 1 2 :=((.|\n)*?);', input_txt)
individuals_txt = ... | benn3331013/Project_Optimisation | visualize_clustering.py | visualize_clustering.py | py | 1,702 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "re.search",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
43351764847 | import os, json
from datetime import datetime, timedelta
MAIN_FILE='trips.json'
TODAY_CACHE=[]
def init_trips():
get_today_trips()
def get_trips_from_file(file_name):
try:
data = []
with open(file_name) as f:
data = json.loads(f.read())
except e:
print('%s' % e)
fi... | DmitriiKostrov/mazai | python/database_json.py | database_json.py | py | 2,623 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "json.loads",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.... |
71834734623 | """Keras End-To-End Memory Networks.
The implementation is based on http://arxiv.org/abs/1503.08895
"""
import tensorflow as tf
import numpy as np
from keras import backend as K
from keras.layers import Input
from keras.layers import Lambda, Embedding, Layer, TimeDistributed, GRU, CuDNNGRU
from keras.layers import Dot... | tonywenuon/keras_dialogue_generation_toolkit | models/multi_task.py | multi_task.py | py | 8,705 | python | en | code | 24 | github-code | 7 | [
{
"api_name": "keras.layers.GRU",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "keras.layers.Layer",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "numpy.ones",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"l... |
70747919583 | import eel
import sys
sys.path.append('./app')
from LoadFileDialog import LoadFileDialog
from WordMailMerge import WordMailMerge
def main():
eel.init('web')
eel.start('templates/index.html', jinja_templates='templates',size=(400,800),geometry={'size':(400,800)})
@eel.expose
def generateWordFile(fileName,d,out... | AnirudhKumaran/wordfeeder | main.py | main.py | py | 655 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.path.append",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "eel.init",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "eel.start",
"line_number": 9,... |
33078041436 | import numpy as np
import pandas as pd
import sys
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import seaborn as sns
from plot_utils import get_label_numbers, transform_pred, get_squared_error
stdev=sys.argv[1]
beta=sys.argv[2]
nruns=100
percent = np.zeros((nruns*4,2))
f... | smaslova/segway-gbr-testing | plots/plot_weight.py | plot_weight.py | py | 1,213 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "matplotlib.use",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_num... |
74226759582 | #!/usr/bin/python3
#-*-coding:utf-8-*-
# @Time: 2020/8/31 21:39
# @Author: haiyong
# @File: groupAnagrams.py
import collections
class Solution(object):
def groupAnagrams(self, strs):
init_dict = collections.defaultdict(list)
for s in strs:
init_dict[tuple(sorted(s))].append(s)
... | hiyongz/AlgorithmNotes | 03-HashTable-Map-Set/groupAnagrams.py | groupAnagrams.py | py | 507 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "collections.defaultdict",
"line_number": 11,
"usage_type": "call"
}
] |
32774897354 | import os, sys, django
sys.path.append('/home/jackson/Projects/CatchALift/cal')
os.environ['DJANGO_SETTINGS_MODULE'] = 'cal.settings'
django.setup()
from apps.messaging.models import Conversation, Message
for conversation in Conversation.objects.all():
print('Deleting conv: ' + conversation.coach_user)
conversa... | Xerxous/CatchALift | util/msg_reset.py | msg_reset.py | py | 458 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.path.append",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "django.setup",
"line_n... |
24559502857 | import logging
import re
import xml.etree.cElementTree
import xml.sax.saxutils
from io import BytesIO
from typing import List, Optional, Sequence
from xml.etree.ElementTree import ElementTree
from langchain_core.documents import Document
from langchain_community.document_loaders.base import BaseLoader
logger = loggi... | langchain-ai/langchain | libs/community/langchain_community/document_loaders/quip.py | quip.py | py | 8,426 | python | en | code | 68,990 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "langchain_community.document_loaders.base.BaseLoader",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 25,
"usage_type": "name"
},
{... |
72867071902 | import torch
from torch.autograd import Variable
from tensorboardX import SummaryWriter
from apex import amp
from utils import save_checkpoint, use_optimizer
from metrics import MetronAtK
import time
class Engine(object):
"""Meta Engine for training & evaluating NCF model
Note: Subclass should implement self.... | Ascend/ModelZoo-PyTorch | PyTorch/contrib/nlp/NCF_ID2943_for_PyTorch/engine.py | engine.py | py | 3,863 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "metrics.MetronAtK",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tensorboardX.SummaryWriter",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "utils.use_optimizer",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "apex... |
70878330783 | import xarray as xr
import seaborn as sns
import warnings
def rates_to_df(arr):
"""
Convert DataArray of rates to DataFrame
Parameters
----------
arr : xr.DataArray
DataArray containing the rates of neurons across time
Returns
-------
pd.DataFrame with neurons as index and ... | bagibence/hidenseek_hmm | hidenseek/util/plotting/rates.py | rates.py | py | 1,830 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "seaborn.color_palette",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "xarray.DataArray",
"line_number": 61,
"usage_type": "attribute"
},
{
"api_name": "seaborn.heatmap",
"line_number": 67,
"usage_type": "call"
}
] |
43191265995 | import base64
import gzip
import os
import re
import fsspec
import numpy as np
import pandas as pd
import pyarrow.parquet as pq
CLOUD_HEADER = 'gs://'
def do_external_setup(project_id):
"""Sets up GCP credentials for external colab.
Args:
project_id: GCP project id associated with the colab.
"""
if not... | google/cell_img | cell_img/common/data_utils.py | data_utils.py | py | 9,792 | python | en | code | 7 | github-code | 7 | [
{
"api_name": "os.path.exists",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_nu... |
16103294083 | # import mysql.connector
# from sqlalchemy import create_engine
import pandas as pd
import os
import numpy as np
import hashlib
import time
import humanize
import matplotlib.pyplot as plt
import seaborn as sns
import logging
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
sns.set_theme(rc={'figure.dpi': 15... | Small-Molecule-Discovery-Center/smdc_process_data | data_viz/plate_maps.py | plate_maps.py | py | 21,707 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "seaborn.set_theme",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.path.appen... |
29080494308 | # Databricks notebook source
from IPython.display import display
from datetime import datetime
import ipywidgets as widgets
from scenario_class import Scenario
from databricks.sdk.runtime import spark
import pandas as pd
import numpy as np
scenario = Scenario()
# COMMAND ----------
optimisation = scenario.optimisati... | HoshangSC/zone_modelling | BESS Notebook.py | BESS Notebook.py | py | 2,535 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "scenario_class.Scenario",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.select",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "databricks.sdk.... |
19874531606 | """Module with multilayer perceptron definition.
"""
import json
import pathlib
import time
from copy import deepcopy
from typing import List, Optional
import numpy as np
from .activations import _ACTIVATION_DICT
from .metrics import _METRICS_DICT
from .utils import chunked, progress_bar, unison_shuffle
class Mul... | czyzi0/mlp | mlp/multilayer_perceptron.py | multilayer_perceptron.py | py | 11,009 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "activations._ACTIVATION_DICT",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "typing.List"... |
6761193175 | from django.test import TestCase
from .models import Watering
from datetime import timedelta
from django.utils import timezone
from .api import viewsets
from django.urls import reverse
class WateringLogic(TestCase):
def test_check_soil_needs_watering_time(self):
watering, next_interval = viewsets.check_l... | Juliocsreis/arduino-automatic-garden-watering | jardim/tests.py | tests.py | py | 2,203 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "django.test.TestCase",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "api.viewsets.check_last_watering_interval",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "api.viewsets",
"line_number": 12,
"usage_type": "name"
},
{
"api_na... |
29325604358 | import re
import datetime
import win10toast
import threading
def find_closest_match(pattern, text):
# Find all matches of the pattern in the text
matches = re.findall(pattern, text)
# Get the current date and time
now = datetime.datetime.now()
# Set the minimum difference to the maximum possible ... | grealesguti/EverydayUtils | Alarm.py | Alarm.py | py | 4,188 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "re.findall",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "datetime.timed... |
25359532980 | #!/usr/bin/env python3
import socket
import numpy as np
import json
import matplotlib.pyplot as plt
import matplotlib.animation as animation
HOST = '<IP>' # IP address
PORT = 65431 # Port to listen on (use ports > 1023)
DATA_SIZE = 50 # number of data to be displayed in the graph simultaneously, you can change it to... | Kevin-Shiuan/embed-os-system-labs-Spring2023 | HW2/TCPserver.py | TCPserver.py | py | 2,533 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "socket.socket",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREAM",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.... |
46108487603 | from pathlib import Path
import torch
import numpy as np
import pandas as pd
from torch.utils.data import Dataset
class PPFDataset(Dataset):
def __init__(self, dataset_dir, num_images=None):
assert Path(f'data/{dataset_dir}/labels.csv').is_file()
df = pd.read_csv(f'data/{dataset_dir}/labels.csv')... | kimbochen/ppf_foldnet | dataset.py | dataset.py | py | 3,340 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.Series",
... |
72553302943 | from algo.cnn import CNN
import os
from pathlib import Path
import torch
import torch.nn as nn
import torch.optim as optim
from torch import autograd
import numpy as np
class Discriminator(nn.Module): # Discriminator Network
# initializer
def __init__(self, device, lr, state_dim, num_actions, wasserstein, ... | HosseinZaredar/Self-Driving-GAIL | algo/disc.py | disc.py | py | 7,618 | python | en | code | 10 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "torch.nn.BCEWithLogitsLoss",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.nn",
... |
30998130747 |
# from byol_essential.byol_models.model import BYOL
import os
import math
import numpy as np
import torch
import torchvision.transforms as transforms
from data.augment import Augment, Cutout
from utils.collate import collate_custom
import pdb
import copy
def get_criterion(p):
if p['criterion'] == 'simclr':
... | filipe-research/PropMix | utils/common_config.py | common_config.py | py | 21,168 | python | en | code | 9 | github-code | 7 | [
{
"api_name": "losses.losses.SimCLRLoss",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "losses.losses.SCANLoss",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "losses.losses.ConfidenceBasedCE",
"line_number": 25,
"usage_type": "call"
},
{
"a... |
29911618172 | """
fc_model.py
Written by Emily Holmes during a LAAS-CNRS internship, 2023
Simple feed-forward fully connected model for SSL estimations
"""
# Imports
import tensorflow as tf
import numpy as np
import os
import json
# Parameters
DATASET_FOLDER = '../dataset/SSLR'
TRAIN_FOLDER = 'lsp_train_106'
TEST_... | holmesemily/loc_nn | fc_model.py | fc_model.py | py | 8,808 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "tensorflow.abs",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "tensorflow.subtract",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "tensorflow.reduce_mean",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "tensorflow.... |
23355539466 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
from distutils.version import LooseVersion
from timm.models.layers import trunc_normal_
from vqfr.archs.vqganv1_arch import GeneralizedQuantizer, ResnetBlock, UpDownSample, VQGANDecoder, VQGANEncoder
from vqfr.ops.dcn imp... | TencentARC/VQFR | vqfr/archs/vqfrv1_arch.py | vqfrv1_arch.py | py | 10,415 | python | en | code | 281 | github-code | 7 | [
{
"api_name": "vqfr.ops.dcn.ModulatedDeformConvPack",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "torch.chunk",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "torch.cat",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "torch.sigm... |
42355768045 | import numpy as np
import yuntu.core.audio.utils as auUtils
def audioLoadBasicInfo(au):
au.originalSr = au.config["samplerate"]
au.nchannels = au.config["nchannels"]
au.sampwidth = au.config["sampwidth"]
au.length = au.config["length"]
au.md5 = au.config["md5"]
au.duration = au.config["duratio... | CONABIO/yuntu | yuntu/core/audio/methods.py | methods.py | py | 11,957 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "yuntu.core.audio.utils.readInfo",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "yuntu.core.audio.utils",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "IPython.display.Audio",
"line_number": 33,
"usage_type": "call"
},
{
"api_... |
72870469342 | from loss.loss_class import Loss
import torch
class MSELoss(Loss):
"""MSELoss class. Inherits the Loss class.
The MSELoss is used to calculate the MSE loss.
"""
def __init__(self):
"""Inits MSELoss."""
super().__init__('MSELoss')
def compute_loss(self, y_true, output_model):
... | Ascend/ModelZoo-PyTorch | PyTorch/dev/others/Multi-Gradient_Descent_ID0349_for_PyTorch/loss/mse_loss.py | mse_loss.py | py | 2,107 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "loss.loss_class.Loss",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.Tensor",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "torch.Tensor",
"line_number": 43,
"usage_type": "attribute"
}
] |
43725774375 |
import os
from pycocotools.coco import COCO
from torch.utils.data import DataLoader
from ssd.utils import SSDTransformer
from ssd.utils import dboxes300_coco, OpenImagesDataset, COCODetection
def get_coco_ground_truth(val_annotate_path):
cocoGt = COCO(annotation_file=val_annotate_path)
return cocoGt
def ... | mappleKeuj/AI | pytorch/detection/SSD/ssd/data.py | data.py | py | 1,157 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pycocotools.coco.COCO",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "ssd.utils.dboxes300_coco",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "ssd.utils.SSDTransformer",
"line_number": 18,
"usage_type": "call"
},
{
"api_name"... |
75027398943 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 8 14:47:44 2020
@author: mason
"""
import streamlit as st
import pickle
import xgboost
import pandas as pd
import numpy as np
with open('imdb_xgb.pickle','rb') as read_file:
xgb = pickle.load(read_file)
with open('df_test.pickle','rb') a... | masonellard/imdb-gross-sales | prediction_app/imdb_predict_app.py | imdb_predict_app.py | py | 3,413 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pickle.load",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": ... |
11691470757 | # -*- coding:utf-8 -*-
from configparser import ConfigParser, NoSectionError, NoOptionError
import os
dir_name = os.path.dirname(os.path.abspath(__file__)) # 获取当前文件夹地址
config_name = os.path.join(dir_name, "config.ini") # 拼接配置文件
class ConfigHandler:
"""封装配置文件类"""
# 初始化实例变量
def __init__(self):
... | songyongzhuang/PythonCode_office | lemon/python22/lemon_17_190925_日志操作logging/优秀作业/4/read_config.py | read_config.py | py | 1,090 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.path.dirname",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_nu... |
38012214373 | from django.test import TestCase
from django.contrib.auth import get_user_model
from findingaids.fa.models import Archive
from findingaids.fa_admin.models import Archivist
User = get_user_model()
class ArchivistTestCase(TestCase):
fixtures = ['user']
def test_sorted_archives(self):
# create some t... | emory-libraries/findingaids | findingaids/fa_admin/tests/models.py | models.py | py | 1,787 | python | en | code | 6 | github-code | 7 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.test.TestCase",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "findingaids.fa.models.Archive",
"line_number": 16,
"usage_type": "call"
},
{
... |
24860056470 | import importlib.machinery
import sys
from pathlib import Path
from create_python_module import create_python_module
class IdlMetaFinder(importlib.machinery.PathFinder):
@classmethod
def find_spec(cls, fullname, path, target=None):
# print(f"trying: {fullname=}, {path=}")
if "." in fullname:
... | Python-Masterclass/imports | idl/meta_finder.py | meta_finder.py | py | 667 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "importlib.machinery.machinery",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "importlib.machinery",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "sys.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "pa... |
43183957173 | from multiprocessing import Pool,freeze_support
from datetime import datetime
import Fetchers.NewsApi as NewsApi
from Libs.Caching import timed_lru_cache,getDiskCache
from Libs.Config import GetConfig
diskcache = getDiskCache()
def newsapi_getTopHeadlines(config):
return list(NewsApi.yieldTopHeadlines(config))
d... | jfugate/NewsCrawler | App/main.py | main.py | py | 825 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "Libs.Caching.getDiskCache",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "Fetchers.NewsApi.yieldTopHeadlines",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "Fetchers.NewsApi",
"line_number": 10,
"usage_type": "name"
},
{
"api_... |
42474655285 | """Unit tests for beansoup.plugins.config module."""
import pytest
import re
from beansoup.plugins import config
def test_error():
parser = config.ArgumentParser()
invalid_option = '--not-an-option'
with pytest.raises(config.ParseError) as excinfo:
args = parser.parse_args([invalid_option])... | fxtlabs/beansoup | tests/plugins/test_config.py | test_config.py | py | 1,121 | python | en | code | 11 | github-code | 7 | [
{
"api_name": "beansoup.plugins.config.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "beansoup.plugins.config",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "pytest.raises",
"line_number": 13,
"usage_type": "call"
},
{
"api_... |
11232543363 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'qjyao'
__mail__ = 'yaoqijunmail@foxmail.com'
'''
description:
'''
import asyncio
import threading
async def hello():
print('Hello world! (%s)' % threading.current_thread())
await asyncio.sleep(1)
print('Hello again! (%s)' % threading.current_t... | LiveAlone/pythonFirst | basic/std_libs/async_demo/demo.py | demo.py | py | 670 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "threading.current_thread",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "asyncio.sleep",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "threading.current_thread",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "async... |
30210127470 | from typing import Any
from amms.logger import l
DIVIDER = "-------------------------------------"
class Token:
def __init__(self, x_i: float = 1, x_i_qty: float = 0):
if x_i not in [1, 2]:
return Exception("1 or 2 allowed")
if x_i_qty <= 0:
return Exception("must be posi... | xujiahuayz/bondingcurves | amms/uniswap/old/utils.py | utils.py | py | 2,390 | python | en | code | 21 | github-code | 7 | [
{
"api_name": "amms.logger.l",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "amms.logger.l.info",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "amms.logger.l",
"line... |
72349306783 | import os
import smtplib
from email.encoders import encode_base64
from email.mime.base import MIMEBase
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from mimetypes import guess_type, read_mime_types
from zemailer.core.backends import Gmail
from zemailer.core.exceptions import NoSe... | Zadigo/zemailer | zemailer/core/senders.py | senders.py | py | 4,100 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "zemailer.core.backends.Gmail",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "zemailer.core.exceptions.NoServerError",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "zemailer.core.exceptions.NoServerError",
"line_number": 51,
"usage_ty... |
14417936397 | import itertools
import pandas as pd
import numpy as np
from .....Source.simulation.Heat_Recovery.ORC.Auxiliary.get_data_of_converting_each_stream_to_orc import get_data_of_converting_each_stream_to_orc
from .....KB_General.equipment_details import EquipmentDetails
from .....utilities.kb import KB
from .....Error_Handl... | Emb3rs-Project/p-core-functionalities | src/Source/simulation/Heat_Recovery/ORC/convert_orc.py | convert_orc.py | py | 15,959 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "utilities.kb.KB",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "Error_Handling.error_convert_orc.PlatformConvertORC",
"line_number": 162,
"usage_type": "call"
},
{
"api_name": "KB_General.fuel_properties.FuelProperties",
"line_number": 184,
"usa... |
26482333599 | #!/usr/bin/python
# coding: utf-8
"""
Скрипт для очистки устаревших файлов
"""
from datetime import datetime, timedelta
import _mysql
import json
import time
import os
import logging
from MySQLdb.constants import FIELD_TYPE
LOG_FILENAME = "../log/clear_files.log"
FILE_DIR = "../user_files"
MYSQL_DB = "sms16_test"
M... | AduchiMergen/sms16_test | sluice/clear_files.py | clear_files.py | py | 6,960 | python | ru | code | 0 | github-code | 7 | [
{
"api_name": "os.path.exists",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.mkdir",
"line_numb... |
34745658462 | import pyodbc
from PySimpleGUI import PySimpleGUI as sg
dados_conexao = (
"Driver={SQL Server};"
"Server=DESKTOP-6UP649V;"
"Database=Login;"
)
conexao = pyodbc.connect(dados_conexao)
#Layout
sg.theme('Material2')
layout = [
[sg.Text('Usuário'),sg.Input(key='usuario')],
[sg.Text('Senha'),sg.Input(k... | ViniCaetano/Login | Login.py | Login.py | py | 1,637 | python | pt | code | 0 | github-code | 7 | [
{
"api_name": "pyodbc.connect",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.PySimpleGUI.theme",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.PySimpleGUI",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "P... |
75083584224 | import wikipedia
import json
import requests
import urllib.request
wiki_request = 'http://ru.wikipedia.org/w/api.php?action=query&list=search&srsearch=Металлургия=%20России&format=json'
subject = 'Металлургия России'
url = 'https://ru.wikipedia.org/w/api.php'
session = requests.Session()
params = {
... | VolsArs/Analizing-of-Web-Data- | wiki_api/main.py | main.py | py | 2,506 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.Session",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "wikipedia.set_lang",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "wikipedia.page",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "json.dump",
"l... |
20317415807 | from collections import defaultdict
# 제거한 노드와 그 자식노드들을 모두 -1 처리하여 리프노드 계산에서 제외하여 처리함
# DFS 알고리즘을 이용하여 재귀를 이용하여 풀이 진행
def leaf_node(item):
global count_leaf
if Tree[item] == []:
count_leaf += 1
elif -1 not in Tree[item]:
for target in Tree[item]:
leaf_node(target)
N = int(inp... | DongyunLeee/baekjoon | 1068.py | 1068.py | py | 761 | python | ko | code | 0 | github-code | 7 | [
{
"api_name": "collections.defaultdict",
"line_number": 20,
"usage_type": "call"
}
] |
34800668961 | import datetime
from collections import deque
robots = deque(input().split(';'))
precess_time = [int(t) for t in input().split(':')]
goods = input()
seconds = precess_time[0]*3600 + precess_time[1]*60 + precess_time[2]
products_waiting = deque()
products_waiting.append(goods)
taken_robots = deque()
work_time = 0
while... | nicky1503/Python-Advanced | stack_py/robotics.py | robotics.py | py | 905 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "collections.deque",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.timedelt... |
72634200223 | import json
from datetime import datetime
from db import Trade
from fetcher import WebsocketFetcher
BASE_URI = 'wss://stream.binance.com:9443/stream?streams='
class Fetcher(WebsocketFetcher):
NAME = 'Binance'
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.symbols ... | ilyeong-minset/crypto_volume_stats | server/exchange/binance.py | binance.py | py | 1,026 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "fetcher.WebsocketFetcher",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "json.loads",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "db.Trade",
"line_number": 31,
"usage_type": "call"
}
] |
44906506687 | #! /usr/bin/env python3
import argparse
parser=argparse.ArgumentParser()
parser.add_argument("--parallel", type=str, nargs='+', help="Get the alignment quality of the parallel corpus", required=True)
args = parser.parse_args()
def isnumber(s):
try:
float(s)
return True
except ValueError:
pass
try:
impor... | Akshayanti/cross-lingual-tools | parallel_data/parallel_data_accuracy.py | parallel_data_accuracy.py | py | 1,080 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "unicodedata.numeric",
"line_number": 18,
"usage_type": "call"
}
] |
34596024578 | import os
import torch
import torch.nn as nn
import numpy as np
from collections import OrderedDict
from ..text_networks import load_text_embedding_from_path
from pcseg.config import cfg
from pcseg.utils import common_utils
class TextSegHead(nn.Module):
def __init__(self, model_cfg, in_channel, ignore_label, va... | CVMI-Lab/PLA | pcseg/models/head/text_seg_head.py | text_seg_head.py | py | 7,305 | python | en | code | 184 | github-code | 7 | [
{
"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.Linear",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
25051452656 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fileencoding=utf-8 fileformat=unix
#
# Author: Iranoan <iranoan+vim@gmail.com>
# License: GPL Ver.3.
from subprocess import run, PIPE
from email import utils
from shutil import which
import re
RE_CRLF = re.compile(r'[\r\n]+')
RE_SPACE = re.compile(r'[\u3000\t ]+')... | iranoan/asyncomplete-mail | autoload/asyncomplete-mail.py | asyncomplete-mail.py | py | 1,771 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "re.compile",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "subprocess.run",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_numb... |
20383536004 | #!usr/bin/env python3
# -*- coding: UTF-8 -*-
import logging
import os
import tensorflow as tf
import xl_tensorflow.models.vision.detection.configs.factory as config_factory
from xl_tensorflow.models.vision.detection.body.efficientdet_model import EfficientDetModel
from xl_tensorflow.models.vision.detection.dataloader... | Lannister-Xiaolin/xl_tensorflow | xl_tensorflow/models/vision/detection/training/efficientdet_training.py | efficientdet_training.py | py | 7,718 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "absl.logging.set_verbosity",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "absl.logging",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "absl.logging.INFO",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "absl.f... |
8149507462 | from flask import g
from backend.db import query_db
def build_conditions(params={}, date_column="datetime", column_param=None):
conditions = []
column = None
if column_param is not None:
column = params.get(column_param)
if column:
column_conditions = []
for item in column.spl... | tombakas/visual_computing_project | backend/blueprints/api/utils.py | utils.py | py | 1,117 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.g",
"line_number": 31,
"usage_type": "argument"
},
{
"api_name": "backend.db.query_db",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "flask.g._cbs_columns",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "flask.g",
... |
73139904542 | from Classes.Receita import Receita
from Classes.Paciente import Paciente
from datetime import date
class Farmaceutico:
def __init__(self, nome: str):
self.nome = nome
def receber_receita(self, receita: Receita, cliente: Paciente):
self.cliente = cliente
self.receita = receita
#... | carloseduribeiro/exemplos_python | AppFarmacia/Classes/Farmaceutico.py | Farmaceutico.py | py | 2,936 | python | pt | code | 0 | github-code | 7 | [
{
"api_name": "Classes.Receita.Receita",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "Classes.Paciente.Paciente",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "datetime.date",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "datet... |
32338086942 | from django import forms
from lk.models import *
class SelectStock(forms.Form):
all_stock = []
stock = forms.ChoiceField(widget=forms.Select, choices=all_stock)
stock.widget.attrs.update({'class': 'custom-select custom-select-sm', 'id': 'all_stock'})
class StockForm(forms.ModelForm):
class Meta:
model = Stock
... | autodatabases/uchetka | stocks/forms.py | forms.py | py | 1,519 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "django.forms.Form",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "django.forms.ChoiceField",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.form... |
32117375182 | import requests
class CMCTools:
def __init__(self):
self.TICKER_URL = "https://api.coinmarketcap.com/v1/ticker/"
self.GLOBAL_URL = "https://api.coinmarketcap.com/v1/global/"
self.coin_name_info_list = []
self.headers = { "User-agent": "cmcools - A lightweight coinmarketcap wrappe... | DustinStuff/cmctools | cmctools/cmctools.py | cmctools.py | py | 4,501 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.Session",
"line_number": 12,
"usage_type": "call"
}
] |
10348321477 | import sys, os, argparse
import json, csv
from time import time
from utils import *
from objects import *
import numpy as np
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='argparse')
# parser.add_argument('--expnum', '-n', help='experiment number', required=True)
# parser.add_arg... | jenny011/Tree-Based-FIM | ZigZag/main.py | main.py | py | 1,595 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
}
] |
38982615646 | import orjson
from pydantic import parse_raw_as
from redis.asyncio import Redis, ConnectionError
from core.helpers.utils import orjson_dumps
from db.storage.cache.base import AbstractAsyncCacheStorage, IndexModelType
class RedisAsyncCacheStorage(AbstractAsyncCacheStorage):
"""Redis is a repository class of Pydan... | Rezyapkin/Online-Cinema-with-ABAC | fastapi_api/src/db/storage/cache/redis.py | redis.py | py | 1,154 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "db.storage.cache.base.AbstractAsyncCacheStorage",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "redis.asyncio.Redis",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "redis.asyncio.Redis",
"line_number": 13,
"usage_type": "name"
},
{... |
73248282464 | import gym
import matplotlib.pyplot as plt
import numpy as np
import argparse
import random
import copy
import math
from azure_rl.azure_client import AzureClient
from learning.learning_base import QTableLearningBase, EpisodeInfo
from collections import deque
import cProfile
from pstats import SortKey
from gym_ceo.env... | davidnorman314/CEO | src/learning/qlearning_traces.py | qlearning_traces.py | py | 19,205 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "learning.learning_base.QTableLearningBase",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "gym.Env",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "random.uniform",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": ... |
72844876382 | import torch
import os
import numpy as np
import argparse
from tqdm import tqdm
from perf_gpu import save_image_grid
def test_om(args):
bin_path = args.bin_path
image_path = args.image_path
bin_list = os.listdir(bin_path)
bin_list.sort()
for i in tqdm(range(len(bin_list))):
images = np.fr... | Ascend/ModelZoo-PyTorch | ACL_PyTorch/contrib/cv/gan/StyleGAN2-ADA/stylegan2-ada-pytorch_postprocess.py | stylegan2-ada-pytorch_postprocess.py | py | 998 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "os.listdir",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.fromfile",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number":... |
74493526303 | from django.conf import settings
from django.views.generic import View
from django.shortcuts import render
from django.http import HttpResponseBadRequest
from .models import Tag
from .forms import TagForm
class Tags(View):
def get(self, request, *args, **kwargs):
context = {}
tags = Tag.get_tags_... | beczkowb/studypy | studypy/tags/views.py | views.py | py | 1,076 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.views.generic.View",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "models.Tag.get_tags_sorted_by_number_of_resources",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "models.Tag",
"line_number": 13,
"usage_type": "name"
},
{... |
7983531715 | # Autor Leonardo Dourado
# É proibida a utilização do programa ou cópia de parte do código sem a autorização do autor.
import requests
import time
def get_count_cryptocurrencies(category):
'''Essa função retorna a quantidade de
moedas disponíveis.'''
if category == "spot":
URL_query =... | LeonardoSDourado/Crypto_Monitor | functions.py | functions.py | py | 11,301 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_numbe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.