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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
73066482913 | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 29 16:40:47 2020
@author: Eric Bianchi
"""
import shutil
import os
import numpy as np
import tensorflow as tf
import cv2
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Try except statements
#+++++++++++++++++++++++++++++++++++++++++++++++... | beric7/COCO-Bridge-2021-plus | general_utils/classification_utils.py | classification_utils.py | py | 24,182 | python | en | code | 5 | github-code | 1 | [
{
"api_name": "shutil.rmtree",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.mkdir",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.mkdir",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.mkdir",
"line_number": 38,
... |
42318918858 | from tkinter import *
from functools import partial
import connection
import time
def end_shift(user_id,start_time):
global newTab
t = time.localtime()
date_time = time.strftime("%Y/%m/%d, %H:%M:%S",t)
print(date_time,user_id,start_time)
query = connection.cur.execute("UPDATE bj_clock_in SET e... | b00t3r322/DB_Project | userpage.py | userpage.py | py | 1,329 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "time.localtime",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "time.strftime",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "connection.cur.execute",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "connection.cur",
... |
15485119752 | from datetime import datetime, timedelta
import json
import threading
import logging
from enum import Enum
from const import CONST
from main import send_post
import pykka
import ledPWM
'''
on: time_h=19 photoresistor=50
time_h=18 photoresistor=20 -> nothing
time_h=20 photoresistor=60 -> nothing
time_h=21 photoresistor... | RyuzakiKK/esls | rpi/lamp.py | lamp.py | py | 11,090 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "enum.Enum",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "enum.Enum",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "const.CONST",
"line_number"... |
24021315413 | import tweepy
import logging
import time
from config import create_api, download_media
import os
import glob
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger()
def check_mentions(api, since_id):
logger.info("Retrieving mentions")
new_since_id = since_id
# fetch items (tweets) from menti... | seanfinnessy/deep-fry-reply | bots/bot.py | bot.py | py | 3,034 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.basicConfig",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "tweepy.Cursor",
... |
4688893528 | import datetime
from django.shortcuts import render
from .models import Agreement, Period
import json
from django.http import HttpResponse
# Function of separation ID
# Returns a single identifier without a comma
# Returns "None", if not number or 0
def separation(set_in):
double_comma = 0
result = []
set... | EvgeniyArefa/B2B | agreement/views.py | views.py | py | 4,510 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.shortcuts.render",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 63,
"usage_type": "call"
},
{
"api_name"... |
25168573512 | from django.urls import path
from .views import licence_list, licence_details, ask_licence, buy_licences, release_licence
urlpatterns = [
path('/', licence_list),
path('/details/<int:pk>', licence_details),
path('/get/<int:pk>', ask_licence),
path('/buy/<str:company_name>/<int:quantity>', buy_licences)... | Donovan1905/Licence-api | app_licences/urls.py | urls.py | py | 371 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "views.licence_list",
"line_number": 5,
"usage_type": "argument"
},
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "views.licence_d... |
21499865608 | #!/usr/bin/env python
import sys
from setuptools import find_packages, setup
setup_requires = []
# I only release from OS X so markdown/pypandoc isn't needed in Windows
if not sys.platform.startswith('win'):
setup_requires.extend([
'setuptools-markdown',
])
setup(
name='serplint',
author='B... | beaugunderson/serplint | setup.py | setup.py | py | 1,362 | python | en | code | 5 | github-code | 1 | [
{
"api_name": "sys.platform.startswith",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.platform",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "setuptools.setup",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "setuptools... |
4568639765 | from datetime import datetime
import scrapy
from scrapy.http import Request
from maksavit_scrapy.items import ScrapyMaksavitItem
from maksavit_scrapy.settings import (CATEGORIES, DOMAIN, LOCATION, MAIN_URL,
PROXY)
class MaksavitSpider(scrapy.Spider):
name = 'maksavit'
p... | danlaryushin/parser_scrapy | maksavit_scrapy/spiders/maksavit.py | maksavit.py | py | 5,849 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "scrapy.Spider",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "maksavit_scrapy.settings.DOMAIN",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "maksavit_scrapy.settings.CATEGORIES",
"line_number": 18,
"usage_type": "name"
},
{... |
16236213310 | import requests
import base64
import os
# Obtained from your app dashboard
CLIENT_ID = os.getenv("SPOTIFY_CLIENT_ID")
CLIENT_SECRET = os.getenv("SPOTIFY_CLIENT_SECRET")
# Obtained after the initial user authorization request
CODE = os.getenv("CODE")
STATE = os.getenv("STATE")
# Obtained in the response body when reque... | xalxnder/spotifork | spotify_connector.py | spotify_connector.py | py | 2,021 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.getenv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 10,
"us... |
44399324332 | import os
import sys
from PyQt5 import QtWidgets, QtCore
from pyqtgraph import PlotWidget, plot
import pyqtgraph as pg
class MainWindow(QtWidgets.QMainWindow):
def __init__(self, *args, **kwargs):
super(MainWindow, self).__init__(*args, **kwargs)
self.graphWidget = pg.PlotWidget()
self.... | Gravios/tutorials | python/py-qt/hello-qtgraph.py | hello-qtgraph.py | py | 1,378 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "pyqtgraph.PlotWidget",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "p... |
7641609513 | #DriveMan CLI by OxxoCode
#https://github.com/OxxoCode/DriveMan
import argparse
import gdrive
class DriveMan:
#Parse any DriveMan arguments passed by the user
def parse_args(self):
self.parser = argparse.ArgumentParser()
self.parser.add_argument('-user', '--username', nar... | OxxoCodes/DriveMan | driveman.py | driveman.py | py | 4,142 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "gdrive.GDrive",
"line_number": 30,
"usage_type": "call"
}
] |
1070819232 | import asyncio
import json
from aiohttp import web
from rpc_client import RemoteDictRpcClient
from loguru import logger
import sys
logger.remove()
logger.add(sys.stdout, format="{time:HH:mm:ss} - {level} - {message}", level="INFO")
routes = web.RouteTableDef()
@routes.get('/get_value')
async def get_from_remote_dic... | jaksklo/RemoteDictionary | src/client_main.py | client_main.py | py | 3,129 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "loguru.logger.remove",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "loguru.logger",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "loguru.logger.add",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "loguru.logger",
... |
8939825128 | # 测试VOC2007数据集的读取
import cv2
import numpy as np
import os
import pandas as pd
import torch
import albumentations as A
from PIL import Image, ImageFile
from torch.utils.data import Dataset, DataLoader
ImageFile.LOAD_TRUNCATED_IMAGES = True
class YOLODataset(Dataset):
def __init__(
self,
csv_file,... | huansu/yolov1 | Dataset.py | Dataset.py | py | 2,257 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PIL.ImageFile.LOAD_TRUNCATED_IMAGES",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "PIL.ImageFile",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "torch.utils.data.Dataset",
"line_number": 15,
"usage_type": "name"
},
{
"a... |
11343348277 | """
预测年收入是否超过 5W 美元
参考: https://github.com/tensorflow/models/blob/r1.8.1/official/wide_deep/wide_deep.py
python -m tutorials.wide_deep --help
"""
import os.path as osp
import shutil
import sys
from dataclasses import dataclass
import pandas as pd
from absl import app
from tensorflow import keras
from utils import log... | henryhyn/caesar-next | tutorials/wide_deep.py | wide_deep.py | py | 7,267 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "dataclasses.dataclass",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "absl.app.define_help_flags",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "absl.app",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "absl.app.fl... |
1076514044 | from tqdm import tqdm
import json
import os
lang = 'fortran'
rel_constrcuts = ['do' if lang == 'fortran' else 'for']
rel_clauses = ['private', 'reduction', 'simd', '_']
data_dir = '/home/1010/talkad/Downloads/OMP_Dataset/fortran/source'
counter = {construct:{clause:0 for clause in rel_clauses} for construct in rel_... | talkad/OMPify | HPCorpus/omp_gen_data/data_stats.py | data_stats.py | py | 1,172 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 1... |
7419945532 | #!/usr/bin/env python3
# consumed by pre-push test 009
# confirms if response from delegator is valid json
import sys
import json
import traceback
try:
filepath = sys.argv[1]
except:
print("must supply file path as argv[1]")
exit(2)
try:
with open(filepath) as f:
try:
string = f.read()
jsonstring = j... | GLYCAM-Web/gems | testbin/isvalidjson.py | isvalidjson.py | py | 518 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "sys.argv",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "traceback.format_exc",
"line_number": 26,
"usage_type": "call"
}
] |
14945088805 | # encoding: utf-8
"""
通过fp-growth算法寻找购物篮数据当中的频繁项集,算法逻辑来源于:Tan, Pang-Ning, Michael Steinbach, and Vipin Kumar.
Introduction to Data Mining. 1st ed. Boston: Pearson / Addison Wesley, 2006. (pp. 363-370)
"""
# original author information
__copyright__ = 'Copyright © 2022 ERSSLE'
__license__ = 'MIT License'
... | ERSSLE/association-analysis | fp_growth2.py | fp_growth2.py | py | 11,722 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "collections.defaultdict",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 26,
"usage_type": "call"
},
{
"api_name"... |
3846931421 | from setuptools import setup
import os
def read(*parts):
retval = ''
with open(os.path.join(*parts), 'r') as f:
retval = f.read()
return retval
def requirements():
return read('requirements.txt').split()
setup(
name='yggdrasil',
url='https://github.com/Moguri/yggdrasil',
licen... | Moguri/yggdrasil | setup.py | setup.py | py | 389 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "setuptools.setup",
"line_number": 17,
"usage_type": "call"
}
] |
12330263546 | import unittest
import wx
import os
import sys
from mockito import mock
from nose.tools import assert_equal, assert_true
from robotide.robotapi import Variable
from robotide.controller import DataController
from robotide.controller.robotdata import NewTestCaseFile
from robotide.controller.settingcontrollers import Var... | camppolite/MyTools | RIDE3/utest/editor/test_editor_creator.py | test_editor_creator.py | py | 4,099 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "os.path.dirname",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"lin... |
71507038435 | import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelEncoder
from sklearn.neighbors import KNeighborsClassifier
from sklearn.tree import DecisionTreeClassifier
from sklearn.svm import SVC
from sklearn.model_selection import GridSearchCV
from sklearn.metrics im... | JustinValentine/Iris-Flower-Classification | main.py | main.py | py | 4,990 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 30,
"usage_type": "call"
}... |
30340948646 | # #################################################################################
# # GJI final pub specs #
# import matplotlib #
# from matplotlib import rc ... | LemmaSoftware/akvo | akvo/tressel/rotate.py | rotate.py | py | 11,120 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "numpy.pi",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "numpy.angle",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "scipy.signal.hilbert",
"line_... |
6392984137 | # -*- coding: utf-8 -*-
"""
Created on Sun Nov 10 15:10:01 2019
@author: Rajdeep
@author: Mtajic
"""
import pydotplus
import numpy as np
import matplotlib.pyplot as plt
from sklearn import svm, tree, datasets
from sklearn.utils import shuffle
from sklearn.metrics import confusion_matrix, classification_report
from ... | rajdeepslather/gesture.py | DT.py | DT.py | py | 5,235 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "skimage.io.imread",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "skimage.io",
"line_number": 52,
"usage_type": "name"
},
{
"api_name": "skimage.filters.gaussian",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "skimage.transfo... |
33692704779 | import webapp2
import jinja2
import os
from google.appengine.ext import ndb
from twilio.rest import TwilioRestClient
from time import time
import json
import logging
from common import make_template
from private import account_sid, auth_token
class User(ndb.Model):
"""Model for the user db"""
fullname = ndb.St... | mtbentley/teenlink | action.py | action.py | py | 4,311 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "google.appengine.ext.ndb.Model",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "google.appengine.ext.ndb",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "google.appengine.ext.ndb.StringProperty",
"line_number": 14,
"usage_type": "... |
32186915496 | import math
import re
from math import * # noqa: F401, F403
from sympy import Eq, solve, symbols
from .calculate import Calculate
def Solve(equations_str):
try:
equations_str = equations_str.replace(' ', '')
equations_ori = re.split(r'[,;]+', equations_str)
equations_str = equations_str... | InternLM/xtuner | xtuner/tools/plugins/solve.py | solve.py | py | 2,370 | python | en | code | 626 | github-code | 1 | [
{
"api_name": "re.split",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 18,
"usage_ty... |
34236014841 | # 新建登录测试类,继承 unittest.Testcase
import unittest
from parameterized import parameterized
from base.get_driver import GetDriver
from page.page_login import PageLogin
# from base.base import base_click
from tools.read_txt import read_txt
from base.get_logger import GetLogger
log = GetLogger().get_logger()
def get_dat... | XuLai-7/projectWebAutoTest | scripts/test01_login.py | test01_login.py | py | 2,938 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "base.get_logger.GetLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tools.read_txt.read_txt",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name... |
16503333002 | from sqlalchemy.exc import IntegrityError
from src.config.database import SessionLocal
from ..config.models import Timezones, ZoneDetails, ErrorLog
def populate_timezones_table(timezones):
with SessionLocal() as db:
try:
db.query(Timezones).delete()
for tz in timezones:
... | marivfa/timezone_proyect | src/crud/timezone.py | timezone.py | py | 1,960 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "src.config.database.SessionLocal",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "config.models.Timezones",
"line_number": 8,
"usage_type": "argument"
},
{
"api_name": "config.models.Timezones",
"line_number": 10,
"usage_type": "call"
},
{
... |
32166692076 | """A growing set of tests designed to ensure when isort implements a feature described in a ticket
it fully works as defined in the associated ticket.
"""
from functools import partial
from io import StringIO
import pytest
import isort
from isort import Config, exceptions
def test_semicolon_ignored_for_dynamic_line... | PyCQA/isort | tests/unit/test_ticketed_features.py | test_ticketed_features.py | py | 23,756 | python | en | code | 6,145 | github-code | 1 | [
{
"api_name": "isort.check_code",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "isort.check_code",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "isort.code",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "isort.check_code",
"... |
29434889395 | import os
import re
import psutil
from time import process_time
import csv
# Start time
startTime = process_time()
#variable for unique list of words that was replace
uniqueWord = []
#variable for no. of times a word replace
wordFrequency = []
def createRequiredWordDictionary(enWord, frWord):
""... | devakumar0107/exeter-coding-challenge | index.py | index.py | py | 2,564 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "time.process_time",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "time.process_time",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "psutil.Process",
"line_... |
16845084048 | #!/usr/bin/env/python3
import logging
import argparse
import time
import queue
import json
from datetime import datetime
from cellscan.panel import PanelThread
from cellscan.radio import RadioThread
from cellscan.gnss import GnssThread
from cellscan.data import saveCellSite, db, Cellsite, Location
from cellscan.uploa... | jcrawfordor/cellscan | cellscan/start.py | start.py | py | 4,801 | python | en | code | 25 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "queue.Q... |
6422773296 | #!/usr/bin/env python2
import json
import math
import re
import sys
def entropy(seq):
bins = {}
total = 0
for x in seq:
bins[x] = 1 + bins.get(x,0)
total += 1
return 0 - sum((float(p) / total) * math.log(float(p) / total, 2) for p in bins.itervalues())
if __name__ == "__main__":
... | maugier/cs422 | high-entropy/mapper.py | mapper.py | py | 626 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "math.log",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sys.stdout.write",
"line_numbe... |
24849937803 | """
Kártyák definíciója
"""
from enum import IntEnum, unique
from functools import total_ordering
@unique
class Szinek(IntEnum):
"""
Francia kártya színek
"""
KARO = 0
PIKK = 1
KOR = 2
TREFF = 3
JOKER = 4
def __str__(self):
"""
Stringgé alakítja az értéket.
... | cogitoergoread/rlcard3 | rlcard3/games/mocsar/card.py | card.py | py | 4,062 | python | hu | code | 1 | github-code | 1 | [
{
"api_name": "enum.IntEnum",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "enum.unique",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "enum.IntEnum",
"line_number": 50,
"usage_type": "name"
},
{
"api_name": "enum.unique",
"line_number": ... |
42951044565 | """
Created on Nov 25, 2016
Utility class for image processing
@author: Levan Tsinadze
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
from cnn.utils.image_utils import image_converter
IMAGE_SIZE = 299
class document_image_converter(... | ChelovekHe/tensorflow_ann_modules | cnn/documents/image_utils.py | image_utils.py | py | 6,982 | python | en | code | null | github-code | 1 | [
{
"api_name": "cnn.utils.image_utils.image_converter",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 127,
"usage_type": "call"
}
] |
22392012000 |
import setuptools
import setuptools.command.install
from setuptools import setup
from torch.utils.cpp_extension import CppExtension, BuildExtension, CUDAExtension
import subprocess
import os
import sys
import torch
import glob
BUILD_PATH = os.path.join(os.getcwd(), 'python', 'cpp_build')
INSTALL_PATH = os.path.join(o... | AIS-Bonn/stillleben | setup.py | setup.py | py | 3,314 | python | en | code | 59 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number":... |
14450483805 |
import time
from pymavlink import mavutil
# from iq_pymavlink_.arm import arm
# from iq_pymavlink_.takeoff import takeoff
# from iq_pymavlink_.land import land
# from iq_pymavlink_.speed_yaw import set_speed
# from iq_pymavlink_.get_autopilot_info import get_autopilot_info
# from iq_pymavlink_.wait_for_posit... | aleksejvalenkov/hakaton_baumanka | autopilot/main.py | main.py | py | 2,658 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pymavlink.mavutil.mavlink_connection",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pymavlink.mavutil",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "pymavlink.mavutil.mavlink",
"line_number": 46,
"usage_type": "attribute"
},
{
... |
71989646113 | from typing import TYPE_CHECKING
from urllib.parse import quote, urlencode
from osp.core.namespaces import emmo
from osp.models.catalytic.utils import make_arcp
if TYPE_CHECKING:
from typing import List, Union
from osp.core.cuds import Cuds
from osp.core.ontology import OntologyClass
def _make_internal... | simphony/simphony-catalytic | osp/wrappers/simcatalyticfoam/utils.py | utils.py | py | 3,425 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "osp.core.namespaces.emmo.hasQuantityValue",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "osp.core.namespaces.emmo",
"line_number": 26,
"usage_type": "name"
}... |
26055359083 | import json
import torch
import yaml
from torchvision.transforms import transforms
from tqdm import tqdm
from src.data.tooth_segmentation_dataset import ToothSegmentationDataset
from src.model.unet.unet import UNet
from src.utils.transforms import SquarePad
if __name__ == "__main__":
with open("./src/model/unet/... | tudordascalu/2d-teeth-detection-challenge | src/model/unet/scripts/predict.py | predict.py | py | 1,748 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "yaml.safe_load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.device",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
... |
14353845555 | """Test interpellation parsing."""
from dataclasses import asdict
from lxml import etree
from fi_parliament_tools.parsing.documents import Interpellation
true_interpellation_statement = {
"type": "L",
"mp_id": 1144,
"firstname": "Suna",
"lastname": "Kymäläinen",
"party": "sd",
"title": "",
... | arcada-uas/fi-parliament-tools | tests/test_parsing/test_interpellation.py | test_interpellation.py | py | 1,253 | python | en | code | null | github-code | 1 | [
{
"api_name": "lxml.etree.fromstring",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "fi_parliament_tools.parsing.documents.Interpellation",
"line_number": 39,
"usage_type": "call"
},
{
... |
70242359395 | #!/usr/bin/env python
'''This demo illustrates how to set up a persistent questionnaire. The main
advantage of this approach is that you have less to fill in case you have
already filled the questionnaire before. In addition it is possible to
share these answers between multiple questionnaires as long as the given
ids ... | bebraw/pyqa | demos/persistency/demo.py | demo.py | py | 1,393 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "yaml.load_all",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "pyqa.ask",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 47,... |
30584439371 | import torch
import time
import sys
import pickle
debug = 0
class Node:
def __init__(self, state):
self.state = state
self.n_actions = state.count(' ')
self.regret_sum = torch.zeros(self.n_actions)
self.strategy_sum = torch.zeros(self.n_actions,1)
self.strateg... | JaLnYn/pokerbot | pokerbot/tictactoe/nttt.py | nttt.py | py | 6,415 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.zeros",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.zeros",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.ones",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.ones",
"line_number": 32... |
24348933296 | import time
import torch
import numpy as np
from CycleGAN.options.train_options import TrainOptions
from CycleGAN.data.create_numpy_data_loader import get_numpy_loader, define_transformer
from CycleGAN.models import create_model
from CycleGAN.util.visualizer import Visualizer
from CycleGAN.util.load_npy import load_npy... | minhto2802/T2_ADC | CycleGAN/train.py | train.py | py | 3,413 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "CycleGAN.options.train_options.TrainOptions",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "CycleGAN.util.load_npy.load_npy",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "CycleGAN.util.norm_data.norm",
"line_number": 19,
"usage_type... |
36805691224 | import os
import sys
import numpy as np
from dataclasses import dataclass
from art.attacks.evasion import ProjectedGradientDescent
from art.estimators.classification import SklearnClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score
from src.exception import Custom... | archanachintagari/attacks_aml | src/components/model_trainer.py | model_trainer.py | py | 2,595 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"li... |
30114689964 | import os
from tqdm import tqdm
from utils import *
from chain import L2R_Chain
from evaluate import *
from prompts.multiple_choice_1 import MULTIPLE_CHOICE_1_PROMPT_TEMPLATE
from env import OPENAI_API_KEY
os.environ["OPENAI_API_KEY"] = OPENAI_API_KEY
model = L2R_Chain()
load_ratio = 0.75
load_num = int(load_ratio... | windszzlang/Learn-to-Refuse | gold_l2r.py | gold_l2r.py | py | 2,931 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "env.OPENAI_API_KEY",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "chain.L2R_Chain",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
... |
16052209240 | from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def index():
storing = requests.get('https://zenquotes.io/api/random')
json_storing = storing.json()
quote = json_storing[0]
return render_template('podo.html', quote=quote)
if __name__ == '__main__':
app.run(debug=Tr... | haileylwb/TeamEdge-Final-Project | app.py | app.py | py | 341 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 10,
"usage_type": "call"
}
] |
35262645275 | from flask_admin import Admin, BaseView, expose
from flask_admin.contrib.sqla import ModelView
from app import app, db
from model import Category, Products
from flask_login import logout_user, current_user
from flask import redirect
admin = Admin(app=app, name="Quan tri ban hang", template_mode="bootstrap4")
class ... | NguyenHoangPhucBao/Sale_App_v1 | app/admin.py | admin.py | py | 1,230 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask_admin.Admin",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "app.app",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "flask_admin.BaseView",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "flask_login.logout_user"... |
20283883307 | from cocos.sprite import Sprite
from time import sleep
from pygame.mixer import Sound, music
from resource import flying_squirrel, flying_squirrel_flying, rush, die, jump
class Flying_squirrel(Sprite):
def __init__(self, game):
self.image1 = flying_squirrel
self.image2 = flying_squirrel_flying
... | liang212/Pyhton_Final_Game | GAME/flying_squirrel.py | flying_squirrel.py | py | 2,792 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "cocos.sprite.Sprite",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "resource.flying_squirrel",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "resource.flying_squirrel_flying",
"line_number": 9,
"usage_type": "name"
},
{
"api_nam... |
36327419981 | """
This module takes care of starting the API Server, Loading the DB and Adding the endpoints
"""
from flask import Flask, request, jsonify, url_for, Blueprint
from api.models import db
from api.utils import generate_sitemap
import random
#from models import Person
api = Blueprint('api', __name__)
@api.route('/card... | gmihov001/Random-card-dealer-JS-Flask | src/api/routes.py | routes.py | py | 722 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "api.models",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "flask.Blueprint",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_... |
27458271918 | from flask import Flask, request, jsonify
import maritalk
import requests
app = Flask(__name__)
API_KEY = '100967333014773694334$301a2d09eb5a949372342c6ce125335b346740cecd46dbe12fc2fa326cf315f3'
URL = "https://chat.maritaca.ai/api/chat/inference"
MODEL = maritalk.MariTalk(key=API_KEY)
auth_header = {
"authoriz... | matheus-a-r/projeto-pln | backend/app.py | app.py | py | 1,722 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "maritalk.MariTalk",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "flask.request.json",
"... |
42904566825 | from util import readfile
from collections import deque
DAY = 18
OPERATORS = {"*": 1, "+": 2}
def solve_1(data):
def _eval(out):
s = []
for token in reversed(out):
if token.isdigit():
s.append(token)
elif token in OPERATORS:
a, b = list(map... | rainmayecho/aoc2020 | 18.py | 18.py | py | 1,584 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.deque",
"line_number": 27,
"usage_type": "call"
}
] |
166570434 | # -*- coding: utf-8 -*-
'''
.. module:: skrf.media.coaxial
============================================================
coaxial (:mod:`skrf.media.coaxial`)
============================================================
A coaxial transmission line defined from its electrical or geometrical/physical properties
.. autosu... | jem0101/BigSwag-SQA2022-AUBURN | TestOrchestrator4ML-main/resources/Data/supervised/GITHUB_REPOS/scikit-rf@scikit-rf/skrf/media/coaxial.py | coaxial.py | py | 9,549 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "distributedCircuit.DistributedCircuit",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "media.Media",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "constants.INF",
"line_number": 71,
"usage_type": "name"
},
{
"api_name": "media... |
1541112013 | #!/usr/bin/env python
import os
import sys
import frida
import psutil
# In case of infinite loops, deadpool_dfa may have killed previous run of this script
# but not the spawned process so let's make it sure by ourselves:
for proc in psutil.process_iter():
if proc.name() == 'drmless':
proc.kill()
os.chmod... | SideChannelMarvels/Deadpool | wbs_aes_plaidctf2013/DFA2/spawn_drmless.py | spawn_drmless.py | py | 1,125 | python | en | code | 595 | github-code | 1 | [
{
"api_name": "psutil.process_iter",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.chmod",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "frida.spawn",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "frida.attach",
"line_num... |
44312590749 | from detect import FaceDetect, CodeDetect
from abc import ABC, abstractmethod
from updater import Updater
import cv2
import re
import sys
class Scanner(ABC):
def __init__(self):
self.cap = None
def __del__(self):
self.cap.release()
cv2.destroyAllWindows()
@abstractmethod
... | fuisl/checkin | bin/scan.py | scan.py | py | 4,964 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "abc.ABC",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "cv2.destroyAllWindows",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "abc.abstractmethod",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
... |
5410327142 | # -*- coding: utf-8 -*-
import cv2
import numpy as np
if __name__ == '__main__':
# 画像の読み込み
img_src = cv2.imread("./image/te.jpg", 0)
# 4近傍の定義
neiborhood4 = np.array([[0, 1, 0],
[1, 1, 1],
[0, 1, 0]],
np.uint8)
#... | umentu/opencv | opening_closing.py | opening_closing.py | py | 844 | python | ja | code | 1 | github-code | 1 | [
{
"api_name": "cv2.imread",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number... |
2599616076 | import pandas as pd
url = "https://bilkav.com/satislar.csv"
veriler = pd.read_csv(url)
veriler = veriler.values
X = veriler[:,0:1]
Y = veriler[:,1]
#verilerin egitim ve test icin bolunmesi
from sklearn.model_selection import train_test_split
x_train, x_test,y_train,y_test = train_test_split(X,Y,test_size=0.33, ran... | AyseErdanisman/MakineOgrenmesiKurs | Model Kaydetme Picle/model_kaydetme.py | model_kaydetme.py | py | 610 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.LinearRegression",
"line_number": 18,
"usage_type": "call"
... |
30552261597 | import gc
import os
import supervisely as sly
from supervisely.app.widgets import (
Card,
Button,
Container,
Progress,
Empty,
FolderThumbnail,
DoneLabel,
GridGallery,
Field,
ImagePairSequence
)
import torch
import src.globals as g
from src import train
from src.monitoring import... | supervisely-ecosystem/hrda | src/ui/training.py | training.py | py | 5,113 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "supervisely.app.widgets.Button",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "supervisely.app.widgets.Button",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "supervisely.app.widgets.Button",
"line_number": 27,
"usage_type": "call"
... |
75261792673 | import json
import psycopg2
import os
def lambda_handler(event, context):
user = event['request']['userAttributes']
print('userAttributes')# for debugging
print(user)# for debugging
try:
print('entered-try') # for debugging
sql = """
INSERT INTO public.users (
displ... | seanware/aws-bootcamp-cruddur-2023 | aws/lambdas/cruddur-post-connfirmation.py | cruddur-post-connfirmation.py | py | 1,213 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "psycopg2.connect",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "psycopg2.DatabaseError",
"line_number": 40,
"usage_type": "attribute"
}
] |
16322339038 | #!/usr/bin/env python
from PIL import Image
import mysql.connector
import sys
imagePath = "/var/www/thedisplay.studio/userimages/" + sys.argv[1]
im = Image.open(imagePath, 'r')
im = im.convert('RGB')
width, height = im.size
pixel_values = list(im.getdata())
dataForPanel = ""
if(int(sys.argv[3]) == 1):
startRa... | thereelaman/webToPanel | api/panel/imageToModule.py | imageToModule.py | py | 1,351 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image.open",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "sys.argv",
"line_number": 17,... |
38851038019 | """
normal: fine-tune learning rate 0.1
parameters: --config_file ../configs/CUB/cub_vgg16_cam.yaml BASIC.GPU_ID [0]
"""
import os
import sys
import datetime
import pprint
import _init_paths
from config.default import cfg_from_list, cfg_from_file, update_config
from config.default import config as cfg
from core.engin... | vasgaowei/transformer-loc-voc | tools_cam/train_cam_cor_loc.py | train_cam_cor_loc.py | py | 9,229 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "torch.device",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "timm.models.crea... |
27508254805 | # Regex to get CiviCRM ID from parentheses in contact name
# https://stackoverflow.com/a/38999572/1191545
import logging
from django.core.exceptions import MultipleObjectsReturned
from tqdm import tqdm
from contact.models import (
Meeting,
MeetingAddress,
MeetingWorshipTime,
Organization,
)
from cont... | WesternFriend/WF-website | content_migration/management/import_civicrm_contacts_handler.py | import_civicrm_contacts_handler.py | py | 7,892 | python | en | code | 46 | github-code | 1 | [
{
"api_name": "logging.basicConfig",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "logging.ERROR",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "contact.mode... |
71377839714 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Plotting functions for traveltime."""
import numpy as np
import pygimli as pg
from pygimli.viewer.mpl import createColorBar
from .utils import shotReceiverDistances
def drawTravelTimeData(ax, data, t=None):
"""Draw first arrival traveltime data into mpl ax a.
... | gimli-org/gimli | pygimli/physics/traveltime/plotting.py | plotting.py | py | 5,897 | python | en | code | 312 | github-code | 1 | [
{
"api_name": "pygimli.x",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pygimli.unique",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pygimli.sort",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pygimli.unique",
"line_numb... |
25344510269 | from __future__ import print_function
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.autograd import Variable
torch.backends.cudnn.bencmark = True
import os,sys,cv2,random,datetime
import argparse
import numpy as np
from dataset import ImageDataset
from matl... | clcarwin/sphereface_pytorch | train.py | train.py | py | 4,350 | python | en | code | 704 | github-code | 1 | [
{
"api_name": "torch.backends",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "to... |
25037492498 | from fastapi import FastAPI, APIRouter, Depends, HTTPException, Request, Response, Header
from fastapi.responses import HTMLResponse, JSONResponse, RedirectResponse
from ..db import profile_crud, anime_crud, users_crud, auth_crud, s3_crud, anilist_crud
from ..schemas.profile_schema import Profile, UserAnimesPost, UserA... | konn1ehuang/Backend | app/routers/anilist.py | anilist.py | py | 3,131 | python | en | code | null | github-code | 1 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "fastapi.APIRouter",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.getenv",
... |
72347994595 | __author__ = "Manuel Yves Galliker"
__maintainer__ = "Manuel Yves Galliker"
__license__ = "Apache-2.0"
from PyQt5 import QtCore
from PyQt5.QtWidgets import QVBoxLayout, QWidget, QDialog, QDialogButtonBox
class ConfirmSelectionWindow(QDialog):
def __init__(self):
super().__init__()
buttonBox = QDi... | manumerous/vpselector | src/vpselector/windows/confirm_selection_window.py | confirm_selection_window.py | py | 715 | python | en | code | 58 | github-code | 1 | [
{
"api_name": "PyQt5.QtWidgets.QDialog",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QDialogButtonBox",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QDialogButtonBox.Cancel",
"line_number": 12,
"usage_type": "attri... |
71097951074 | from django.conf import settings
from django.template.loader import render_to_string
def google_analytics(request):
"""
Returns analytics code.
"""
if settings.GA_TRACKING_ID:
return {
"google_analytics": render_to_string(
"ga.html", {"GA_TRACKING_ID": settings.GA_T... | iodide-project/iodide | server/context_processors.py | context_processors.py | py | 512 | python | en | code | 1,482 | github-code | 1 | [
{
"api_name": "django.conf.settings.GA_TRACKING_ID",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.template.loader.render_to_string",
"line_number": 11,
"usage_type": "c... |
9795231579 | #定制曲线颜色
#使用plot函数中的color关键字参数
import numpy
import matplotlib.pyplot as plt
#将-6到6分成1024份,形成1024个值
X=numpy.linspace(-6,6,1024)
#定义曲线的颜色集合,所有的颜色都从这个列表中选取
colors=['red','yellow','b','c','#FF00FF','0.75']
#绘制20条一元二次曲线,并从colors中依次取颜色值
for i in range(20):
plt.plot(X,-X**2 + (i+1)*2,color=colors[i % len(colors)]... | 081327/python-matplotlib | li24.7.py | li24.7.py | py | 503 | python | zh | code | 0 | github-code | 1 | [
{
"api_name": "numpy.linspace",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyp... |
74736809314 | import pytest
from boxsdk.exception import BoxOAuthException
def test_expired_access_token_is_refreshed(box_oauth, box_client, mock_box):
# pylint:disable=protected-access
mock_box.oauth.expire_token(box_oauth._access_token)
# pylint:enable=protected-access
box_client.folder('0').get()
assert len(... | box/box-python-sdk | test/functional/test_token_refresh.py | test_token_refresh.py | py | 767 | python | en | code | 395 | github-code | 1 | [
{
"api_name": "pytest.raises",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "boxsdk.exception.BoxOAuthException",
"line_number": 18,
"usage_type": "argument"
}
] |
25014218796 | import tkinter as tk
from tkinter import ttk
from datetime import datetime, timedelta
from woocommerce import API
from customtkinter import *
# WooCommerce API credentials
url = "https://bedrock-computers.co.uk/"
consumer_key = "ck_e63f2847761567231436732f8c753e392fd81614"
consumer_secret = "cs_d40131313ebeeb4e1bd8b8fb... | BenedictCallander/Bedrock_Inventory | order.py | order.py | py | 3,024 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.datetime.now",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "datetime.timedelta",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "woocommerc... |
353415061 | #-*- coding:utf-8 -*-
import argparse
import os
import process_file
def main():
parser = argparse.ArgumentParser(description='데이터 검증')
parser.add_argument('--project', type=str, required=True,
help='프로젝트명')
parser.add_argument('--datadir', type=str, required=True,
... | acho98/Validator | check.py | check.py | py | 1,024 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "process_file.process",
"line_number": 28,
"usage_type": "call"
}
] |
4848671373 | #!/usr/bin/env python3
import argparse
import os
import sys
import tempfile
import uuid
import tator
from .extractor import process_file
if __name__ == "__main__":
""" CLI Frontend to extractor """
parser = argparse.ArgumentParser(description="Thumbnail Extractor")
tator.get_parser(parser)
parser.a... | cvisionai/tator-py | tator/extractor/__main__.py | __main__.py | py | 3,621 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "tator.get_parser",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tator.get_api",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "sys.exit",
... |
37688974065 | # from cgitb import text
import types
from aiogram.types import ReplyKeyboardMarkup,KeyboardButton
from aiohttp import request
# from sqlalchemy import true
# from telegram import Contact
startbut = ReplyKeyboardMarkup(
keyboard=[
[
KeyboardButton(text = "Buyurtma berish"),
],
[
... | onlysharifjon/O_N_L_Y_bot | keyboards/default/startkey.py | startkey.py | py | 435 | python | en | code | 7 | github-code | 1 | [
{
"api_name": "aiogram.types.ReplyKeyboardMarkup",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "aiogram.types.KeyboardButton",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "aiogram.types.KeyboardButton",
"line_number": 13,
"usage_type": "call"
}
... |
35636630591 | #!/usr/bin/env python
# coding: utf-8
import pandas as pd
import numpy as np
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import classification_report, confusion_matrix, f1_score
pd.options.display.max_columns = None
import warnings
warnings.filterwarnings('ignore')
# Read the CSVs
data... | rajrdas/tcd-group-competition-team70--rec-alg-click-pred | RecClickPred-d1.py | RecClickPred-d1.py | py | 7,983 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.options",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "warnings.filterwarnings",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.re... |
32903246276 | """
This module contains the class that encapsulates the conversation history and context
"""
import traceback
import re
from .openaicli import OpenAICli
from .prompt import Prompt
from .pineconecli import PineconeCli
from .tools import Tools
class Conversation:
"""
This class is used to encapsulate the conve... | mazharm/openaichatbot | server/conversation.py | conversation.py | py | 5,580 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "openaicli.OpenAICli",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pineconecli.PineconeCli",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tools.Tools",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "prompt.Prompt... |
21771337536 | import mblib
import itertools
def main():
num = ["1","2","3","4","5","6","7"]
for x in list(itertools.permutations(num, len(num)))[::-1]:
print(f"Checking: {x}")
if mblib.isPrime(int("".join(x))):
res = int("".join(x))
resdigit = len(x)
break
pri... | Gamesbydo/PE_python | problem41.py | problem41.py | py | 412 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "itertools.permutations",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "mblib.isPrime",
"line_number": 7,
"usage_type": "call"
}
] |
72894744993 | # Python script for additional style validation
# Author: Rintze M. Zelle
# Version: 2011-12-17
# * Requires lxml library (http://lxml.de/)
#
# Add CC by-sa license
import os, glob, re
from lxml import etree
path = 'C:\Documents and Settings\zelle\My Documents\CSL\styles\\'
verbatims = {}
for independentStyle in glo... | citation-style-language/utilities | csl-add-rights.py | csl-add-rights.py | py | 1,295 | python | en | code | 18 | github-code | 1 | [
{
"api_name": "glob.glob",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "lxml.etree.parse",
"line_numb... |
38124692196 | from django.db.models.signals import post_save
from django.dispatch import receiver
import csv
from student.admin import lopTinChiDetailAdmin
from users.models import Student
from management.models import vien_dao_tao, lop_chung
from .models import csvStudent, sinhVien_dangKi_lopTinChi, sinhVien_lopTinChiDetail
@recei... | tannguyen1100/Project_KTPMUD | student/signals.py | signals.py | py | 1,620 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "csv.reader",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "student.admin",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "users.models.Student.objects.create",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "users.mo... |
70198769954 | import numpy as np
import networkx as nx
from networkx import Graph
import matplotlib.pyplot as plt
from calculations import *
from plotting import *
import os
from itertools import product
# 3-regular graphs
G_3reg0 = Graph()
G_3reg1 = Graph()
G_3reg2 = Graph()
G_3reg0.add_edges_from([(0,2), (1,2), (2,3), (3,4), (... | obstjn/ws-qaoa-transfer | scripts/plot_0-1_edge.py | plot_0-1_edge.py | py | 1,098 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "networkx.Graph",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "networkx.Graph",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "networkx.Graph",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_n... |
32482842311 | #!/usr/bin/env python
# Martin Kersner, m.kersner@gmail.com
# 2016/01/18
from __future__ import print_function
import os
import sys
import lmdb
from random import shuffle
from skimage.io import imread
from scipy.misc import imresize
import numpy as np
from PIL import Image
import caffe
from utils import get_id_classes... | MasazI/crfasrnn-training | data2lmdb.py | data2lmdb.py | py | 5,632 | python | en | code | 16 | github-code | 1 | [
{
"api_name": "sys.argv",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "utils.get_id_classes",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "random.shuffle",
"line_number": 90,
"usage_type": "call"
},
{
"api_name": "random.shuffle",
... |
17083232439 | import cv2
import numpy as np
net = cv2.dnn.readNetFromTorch('models/instance_norm/mosaic.t7')
net2 = cv2.dnn.readNetFromTorch('models/instance_norm/the_scream.t7')
net3 = cv2.dnn.readNetFromTorch('models/instance_norm/candy.t7')
net4 = cv2.dnn.readNetFromTorch('models/instance_norm/feathers.t7')
img = cv2.imread('im... | seulachoi/myproject | openCV_imgcrop4.py | openCV_imgcrop4.py | py | 2,034 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "cv2.dnn.readNetFromTorch",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.dnn",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "cv2.dnn.readNetFromTorch",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.dnn",... |
18621936653 | import unittest
from outpost24hiabclient.entities.scanner import Scanner
from outpost24hiabclient.clients.hiabclient import HiabClient
from outpost24hiabclient import ScannerService
from unittest.mock import patch
import xml.etree.ElementTree as ET
class HiabClientTest:
def get_scanners(self):
... | schubergphilis/outpost24hiabclient | tests/test_scanner_service.py | test_scanner_service.py | py | 3,750 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "xml.etree.ElementTree.fromstring",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 59,
"usage_type": "name"
},
{
"api_name": "outpost24hiabclient.entities.scanner.Scanner",
"line_number": 63,
"usage_type": "c... |
70839110753 | from collections import deque
dx = [-1, 0, 1, 0]
dy = [0, 1, 0, -1]
R, C = map(int, input().split())
arr = [list(input()) for _ in range(R)]
visited = [[0] * C for _ in range(R)]
w_visited = [[0] * C for _ in range(R)]
def bfs(start, end, w):
e_x, e_y = end.pop()
x, y, cnt = start.popleft()
for i in r... | ckdfh0917/Algorithm | 기웅스터디/BFS/3055. 탈출.py | 3055. 탈출.py | py | 2,306 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.deque",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 65,
"usage_type": "call"
}
] |
12095875596 | from __future__ import absolute_import
import rules
from rotations.models import Rotation, RotationRequest, RotationRequestResponse, RotationRequestForward
@rules.predicate
def is_owner(user, object):
"""
Check if the user owns the passed object, which may be one of: Rotation, RotationRequest,
RotationR... | msarabi95/easy-internship | rotations/rules.py | rules.py | py | 807 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "rotations.models.Rotation",
"line_number": 13,
"usage_type": "argument"
},
{
"api_name": "rotations.models.RotationRequest",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "rotations.models.RotationRequestResponse",
"line_number": 17,
"usage_t... |
35915365701 | # Python > Itertools > itertools.product()
# Find the cartesian product of 2 sets.
#
# https://www.hackerrank.com/challenges/itertools-product/problem
#
from itertools import product
A = list(map(int, input().split()))
B = list(map(int, input().split()))
P = list(product(A, B))
print(" ".join(str(x) for x in P))... | rene-d/hackerrank | python/py-itertools/itertools-product.py | itertools-product.py | py | 321 | python | en | code | 72 | github-code | 1 | [
{
"api_name": "itertools.product",
"line_number": 12,
"usage_type": "call"
}
] |
19907396281 | from datetime import datetime
from flask import Flask, render_template, url_for, flash, redirect, request
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SECRET_KEY'] = 'bf2a0fbecd7030220d754389dcbd5ij9'
app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://ipnx:root.Account#20@ipNX@... | Greyacey/SiteList | site/flaskapp.py | flaskapp.py | py | 2,125 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "flask... |
38958993008 | import logging
from cliff import command
from smiley import db
from smiley import db_linecache
from smiley import output
class Replay(command.Command):
"""Query the database and replay a previously captured run.
"""
log = logging.getLogger(__name__)
_cwd = None
def get_parser(self, prog_name... | smiley-debugger/smiley | smiley/commands/replay.py | replay.py | py | 1,820 | python | en | code | 391 | github-code | 1 | [
{
"api_name": "cliff.command.Command",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "cliff.command",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "smiley.db.... |
30951637732 | #/usr/bin/python
# An electronic piggy bank that sorts and securely stores your coins.
# It uses a Raspberry Pi, an Arduino, a Coin Acceptor, the Adafruit LCD Shield,
# and 3 LEGO Mindstorms motors connected to an NXT.
# Both the NXT and Arduino are connected to a USB hub connected to the Raspberry Pi
# Adafruit's... | alexstrandberg/Raspberry-Pi-Piggy-Bank-with-Coin-Sorter | main.py | main.py | py | 15,106 | python | en | code | 13 | github-code | 1 | [
{
"api_name": "Adafruit_CharLCDPlate.Adafruit_CharLCDPlate",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "serial.Serial",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "... |
13343320060 | from tqdm import tqdm
import jittor as jt
from jittor import optim
from jittor.lr_scheduler import MultiStepLR
import argparse
import random
import sys
import glob
import pickle
import os
import numpy as np
from tensorboardX import SummaryWriter
from dataset.dota import DOTA
from dataset.transforms import train_transfo... | li-xl/SCRDet.jittor | train.py | train.py | py | 7,503 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "jittor.in_mpi",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "jittor.mpi.world_rank",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "jittor.mpi",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "jittor.flags... |
28031190806 | import functools
import os.path
import sys
import delphyne.trees
import delphyne.behaviours
import delphyne.blackboard
import delphyne.maliput as maliput
import delphyne_gui.utilities
from delphyne_gui.utilities import launch_interactive_simulation
from . import helpers
############################################... | maliput/delphyne_demos | demos/city.py | city.py | py | 4,495 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "delphyne.blackboard.providers.resolve",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "delphyne.blackboard.providers.resolve",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "delphyne.maliput.LaneId",
"line_number": 53,
"usage_type": "c... |
33800619515 | import csv
import json
# Open up the CSV File
with open("filename.output.csv", "r") as f:
reader = csv.reader(f)
# Ignore the headers as an individual row
next(reader)
data = []
# Iterate across the reader object
for row in reader:
# Append to the empty data list
d... | elemasamuel/Backend-Devs---show-your-skills | show_your_skills/csvToJson.py | csvToJson.py | py | 858 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "csv.reader",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 30,
"usage_type": "call"
}
] |
2006635343 | from __future__ import print_function
from kafka import KafkaConsumer
import time
from datetime import datetime
import json
import argparse
def print_log(message):
print("%s:%d:%d: key=%s value=%s" % (message.topic, message.partition,
message.offset, message.key,
... | DanThomp507/DDOS-Protector | Consumer.py | Consumer.py | py | 2,973 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.loads",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"... |
719002111 | import threading
import logging
from core import fb_interface
class FB(threading.Thread, fb_interface.FBInterface):
def __init__(self, fb_name, fb_type, fb_obj, fb_xml, monitor=None):
threading.Thread.__init__(self, name=fb_name)
fb_interface.FBInterface.__init__(self, fb_name, fb_type, fb_xml, m... | howcroft/dinasore | core/fb.py | fb.py | py | 2,333 | python | en | code | null | github-code | 1 | [
{
"api_name": "threading.Thread",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "core.fb_interface.FBInterface",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "core.fb_interface",
"line_number": 6,
"usage_type": "name"
},
{
"api_name"... |
73811735393 | #from numba import njit # compile python
#import matplotlib
#matplotlib.rcParams['text.usetex'] = True
import matplotlib.pyplot as plt # plotting facility
from matplotlib.colors import Normalize, SymLogNorm
from matplotlib import cm
from matplotlib import gridspec
import numpy as np
import os, datetime, math
import tim... | dibondar/NonseparableSplitOperator | WignerPlot_221104.py | WignerPlot_221104.py | py | 14,749 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.array",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "numpy.copy",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "numpy.copy",
"line_number": 44... |
19368667201 | import json
import os
import re
from sieglib.bdt import Bdt
from sieglib.bhd import Bhd, BhdHeader, BhdRecord, BhdDataEntry
from sieglib.dcx import Dcx
from sieglib.log import LOG
from pyshgck.time import time_it
class ExternalArchive(object):
""" Combination of BHD and BDT. Contains methods to export files to t... | dece/DarkSoulsDev | Programs/SiegLib/sieglib/external_archive.py | external_archive.py | py | 13,672 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "re.compile",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "sieglib.bhd.Bhd",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "sieglib.bdt.Bdt",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"li... |
43293306618 | # - 제공된 영화 제목을 검색하여 해당 영화의 출연진(`cast`) 그리고 스태프(`crew`) 중 연출진으로 구성된 목록만을 출력합니다.
# - requests 라이브러리를 활용하여 TMDB에서 영화제목으로 영화를 검색(Search Movies)합니다. # 04.py 에서 검색코드 가져옴 id 값까지 가지고 옴
# - 응답 받은 결과 중 첫번째 영화의 id 값을 활용하여 TMDB에서 해당 영화에 대한 출연진과 스태프 목록(Get Credits)을 가져옵니다.
# 1. credits 검색 & 목록 가져오기
# - 출연진 중 `cast_id` 값이 `10 미만`인 ... | yangu1455/01-PJT-02 | 2회차/황지선/05.py | 05.py | py | 3,338 | python | ko | code | null | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "pprint.pprint",
"line_number": 76,
"usage_type": "call"
}
] |
2773540722 | """
Zadání:
S využitím principů OOP vytvořte simulaci jednoduché hry, v níž se v zápase (Match) virtuálně utkají vždy dva hráči (Player).
Zápas tvoří symbolické souboje (výměny) na 10 vítězných bodů.
Hráč získává bod, když hodí vyšší hodnotu symbolickou kostkou než jeho protihráč.
Objekty hráčů mohou být načteny z... | OndraVicha/python-projekt | game/game.py | game.py | py | 9,311 | python | cs | code | 0 | github-code | 1 | [
{
"api_name": "enum.Enum",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "datetime.datet... |
2549644044 | import torch
ck = torch.load('/data1/liuyidi/scene_cls/V4.1/log_dir/V4.2_duibi3/ckpt/checkpoint-iter-002000.pyth')['model_state']
ck2 = torch.load('/data1/liuyidi/scene_cls/V4.1/log_dir/V4.1_test27_1_fix/ckpt/checkpoint-iter-008000.pyth')['model_state']
for i,j in zip(ck.keys(),ck2.keys()):
if torch.equal(... | Yidi299/yy_moco | four_pic/weight_ckeck.py | weight_ckeck.py | py | 507 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.load",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "torch.load",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "torch.equal",
"line_number": 8,
"usage_type": "call"
}
] |
43016664506 | import mysql.connector
import tkinter as tk
from tkinter import ttk
from style import *
from util import *
from tkinter import messagebox as mb
from datetime import datetime, timedelta
class MenuTampilPesanan(tk.Frame):
def __init__(self, parent, controller):
tk.Frame.__init__(self, parent)
self.con... | alliefn/sistem-tracking-covid19 | src/pesanan.py | pesanan.py | py | 18,480 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tkinter.Frame",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "tkinter.Frame.__init__",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tkinter.Frame",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "tkinter.F... |
3243317035 | import math
import torch
import torch.nn as nn
def matrix_2d_decode(matrix, inH, inW, scale, device, add_scale=True):
matrix = matrix[0]
scale_int = int(math.ceil(scale))
h_offset = matrix[0][:inH*scale_int]
w_offset = matrix[1][:inW*scale_int]
# [outH, outW]: Every Row is the same
h_offset_m... | miracleyoo/Meta-SSSR-Pytorch-Publish | model/matrix.py | matrix.py | py | 7,881 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "math.ceil",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.cat",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.cat",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.cat",
"line_number": 18,
"... |
12730312192 | import gettext
import tempfile
from collections import defaultdict
import polib
from carcade.utils import get_template_source
def get_translations(po_file_path):
"""Creates :class:`gettext.GNUTranslations` from PO file `po_file_path`."""
po_file = polib.pofile(po_file_path)
with tempfile.NamedTemporaryF... | aromanovich/carcade | carcade/i18n.py | i18n.py | py | 1,271 | python | en | code | 18 | github-code | 1 | [
{
"api_name": "polib.pofile",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tempfile.NamedTemporaryFile",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "gettext.GNUTranslations",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "poli... |
33385652042 | import matplotlib.pyplot as plt
import sys
import os
import numpy as np
log_folders = ['covtype_test_100rounds_1']
log_folders_10 = [f'covtype_test_10rounds_{i}' for i in range(1, 6)]
fig_path = f'../logs/plots/'
max_rounds = [0 for i in range(len(log_folders))]
for i in range(len(log_folders)):
cur_dir = os.list... | WVLeeuw/BC_Unsupervised_FL | plots/time_taken_multiple.py | time_taken_multiple.py | py | 2,902 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "os.listdir",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.figure",
... |
71446585953 | # 739. Daily Temperatures
# Medium
#
# 4298
#
# 130
#
# Add to List
#
# Share
# Given a list of daily temperatures temperatures, return a list such that, for each day in the input, tells you how many days you would have to wait until a warmer temperature. If there is no future day for which this is possible, put 0 inst... | laiqjafri/LeetCode | problems/00739_daily_temperatures.py | 00739_daily_temperatures.py | py | 992 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.List",
"line_number": 20,
"usage_type": "name"
}
] |
72498744034 | '''
Create input features YAML for Ludwig configuration.
'''
import yaml
import argparse
import pandas as pd
if __name__ == "__main__":
# Argument parsing.
parser = argparse.ArgumentParser()
parser.add_argument("input_file", help="Input file")
parser.add_argument("output_file", help="Output file")
... | jgoecks/transcriptional-signatures-ludwig | create_input_features.py | create_input_features.py | py | 760 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "yaml.dump",
"line_number": 28,
"usage_type": "call"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.