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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
38451818612 | # aca desarrollaremos la parte de contar renglones y palabras
import logging
import logging.config
# abriendo archivo de configuración
logging.config.fileConfig('log_config_file.conf')
# creando el logger
logger = logging.getLogger('functions')
def count_words(file, nombre_path: str) -> any:
'''
Función que ... | Carlos-Montana/Act-tiimiit-alkemy | Act_4_logII/editorial/function.py | function.py | py | 868 | python | es | code | 0 | github-code | 36 | [
{
"api_name": "logging.config.fileConfig",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.config",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
}
] |
75200594022 | # This file is a part of GrumpyWidgets.
# The source code contained in this file is licensed under the MIT license.
# See LICENSE.txt in the main project directory, for more information.
import re
from xml.etree import ElementTree
from htmlcompare import assert_same_html as assert_same_html_
__all__ = [
'as_nor... | FelixSchwarz/grumpywidgets | grumpywidgets/testhelpers.py | testhelpers.py | py | 2,672 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "htmlcompare.assert_same_html",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree.fromstring",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 33,
"usage_type": "name"
},
{
... |
6655999686 | """Postgres Dataconn Connection Implementation"""
import glob
import sys
import os
from os import environ
from cml.data_v1.customconnection import CustomConnection
class PostgresCustomImp(CustomConnection):
"""Using https://pypi.python.org/pypi/postgres to connect to Postgres DBs"""
""" Print information on ... | pdefusco/Using_CustomConn_CML | postgresconn/pg-conn.py | pg-conn.py | py | 3,675 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "cml.data_v1.customconnection.CustomConnection",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "psycopg2.connect",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "pandas.read_sql",
"line_number": 68,
"usage_type": "call"
},
{
"api... |
3289690742 | __all__ = ['display']
import logging
import sys
import types
from six import itervalues
logger = logging.getLogger('pyomo.core')
def display(obj, ostream=None):
""" Display data in a Pyomo object"""
if ostream is None:
ostream = sys.stdout
try:
display_fcn = obj.display
except Attri... | igorsowa9/vpp | venv/lib/python3.6/site-packages/pyomo/core/base/misc.py | misc.py | py | 7,746 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "sys.exc_info",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "types.GeneratorType",
... |
6752697116 | # -*- coding: utf-8 -*-
from PyQt5.QtWidgets import QTreeWidgetItem, QDialog, QTreeWidgetItemIterator
from PyQt5.QtCore import pyqtSlot
from product.controllers.productcontroller import ProductController
from workshop.views.selectoddmentdraw import Ui_Dialog
import user
class SelectoddmentdrawModule(QDialog, Ui_... | zxcvbnmz0x/gmpsystem | workshop/modules/selectoddmentdrawmodule.py | selectoddmentdrawmodule.py | py | 3,851 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "PyQt5.QtWidgets.QDialog",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "workshop.views.selectoddmentdraw.Ui_Dialog",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "product.controllers.productcontroller.ProductController",
"line_number": 2... |
1372282786 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# author aliex-hrg
import sys,os,socketserver,json,hashlib
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(BASE_DIR)
from conf import settings
import admin,re
class MyTCPHandler(socketserver.BaseRequestHandler):
ftp_dir = setting... | hrghrghg/test | 作业/FTP文件服务器/server/core/core.py | core.py | py | 6,863 | python | en | code | 0 | github-code | 36 | [
{
"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": "sys.path.append",
"line... |
6742370298 | # -*- coding: utf-8 -*-
# file lyxpreview2bitmap.py
# This file is part of LyX, the document processor.
# Licence details can be found in the file COPYING.
# author Angus Leeming
# with much advice from members of the preview-latex project:
# David Kastrup, dak@gnu.org and
# Jan-Åke Larsson, jalar@mai.liu.se.
# Full... | cburschka/lyx | lib/scripts/lyxpreview2bitmap.py | lyxpreview2bitmap.py | py | 23,257 | python | en | code | 33 | github-code | 36 | [
{
"api_name": "sys.version_info",
"line_number": 92,
"usage_type": "attribute"
},
{
"api_name": "re.compile",
"line_number": 123,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 124,
"usage_type": "call"
},
{
"api_name": "lyxpreview_tools.error"... |
14437408352 | # -*- coding: utf-8 -*-
"""
Created on Sat Nov 26 2022
@author: MotoWiZ
"""
#%%
import cv2
import time
import numpy as np
import math
from picamera2 import Picamera2
lower_white = (0, 0, 0)
upper_white = (0, 0, 255)
t = time.time()
prevBallPosX, prevBallPosY, ballPosX, ballPosY = 0, 0, 0, 0
# -> Configuration of R... | MotoWiZ/Balance-ball-on-a-table | Testers/ball - 360.py | ball - 360.py | py | 10,389 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "time.time",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "picamera2.Picamera2",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "cv2.EVENT_LBUTTONDBLCLK",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "cv2.circle... |
2412653803 | import pytest
import elasticsearch_dsl as es_dsl
from karp5.domain.services import search_service
from karp5.config import conf_mgr
@pytest.mark.parametrize("from_,size", [
(0, 25),
(1000, 25),
(10000, 25),
(0, None),
(15000, 15875)
])
def test_large_lex(app_w_large_lex, from_, size):
mode =... | spraakbanken/karp-backend-v5 | karp5/tests/integration_tests/domain/services/test_search_service_it.py | test_search_service_it.py | py | 887 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "elasticsearch_dsl.Search",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "karp5.config.conf_mgr.elastic",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "karp5.config.conf_mgr",
"line_number": 19,
"usage_type": "name"
},
{
"api_... |
74277064423 | from PyQt5 import Qt, QtCore, QtGui, QtWidgets
from ui.mainw import Ui_MainWindow
import os, json
import subprocess
class VirtualCD_Window(QtWidgets.QMainWindow, Ui_MainWindow):
def __init__(self):
super(VirtualCD_Window, self).__init__()
self.setupUi(self)
self.setWindowOpacity(0.5)
... | zslukevin/Virtual-CD | VirtualCD.py | VirtualCD.py | py | 3,258 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "ui.mainw.Ui_MainWindow",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "... |
23604207590 | import argparse
import logging
import subprocess
import sys
import stanza
from iso639 import languages
sys.path.append('./resources')
import unimorph_inflect
def download_unimorph(lg: str):
logging.info("downloading UniMorph dictionary for %s" % lg)
subprocess.run("mkdir -p unimorph_dicts", shell=True)
... | murali1996/morpheus_multilingual | run_setup.py | run_setup.py | py | 1,835 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.path.append",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "logging.info",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "subprocess.run",
"line_n... |
13890870450 | """
Background
Algorithm Inorder(tree)
1. Traverse the left subtree, i.e., call Inorder(left-subtree)
2. Visit the root.
3. Traverse the right subtree, i.e., call Inorder(right-subtree)
**TODO: Can use a stack**
Algorithm Preorder(tree)
1. Visit the root.
2. Traverse the left subtree, i.e., call Pre... | orangered233/LeetCode | recover_binary_search_tree.py | recover_binary_search_tree.py | py | 4,358 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "typing.List",
"line_number": 87,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 97,
"usage_type": "name"
}
] |
27904683592 | import argparse
def parse_args():
"""
parsing and configuration
:return: parse_args
"""
desc = "Tensorflow implementation of pix2pix"
parser = argparse.ArgumentParser(description=desc)
parser.add_argument('--module', type=str, default='test_dataset',
help... | SunNYNO1/pix2pix | code/config.py | config.py | py | 2,348 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
}
] |
2959315606 | #%%
import pandas as pd
import numpy as np
import os
import re
import time
from functools import wraps, reduce
from copy import deepcopy
from sklearn.model_selection import train_test_split
#%%
project_dict_second = {
'01':'有源手术器械',
'02':'无源手术器械',
'03':'神经和心血管手术器械',
'04':'骨科手术器械',
'05':'耳鼻喉手术器械',
... | BigMasonFang/cfda | data_anly.py | data_anly.py | py | 7,677 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "time.time",
"line_number": 116,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 118,
"usage_type": "call"
},
{
"api_name": "functools.wraps",
"line_number": 114,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_numb... |
35781259149 | import os
import pandas as pd
import random
import numpy as np
import tensorflow as tf
from datetime import datetime
import models
from sklearn.metrics import r2_score
import math
IDS_TRAIN = []
IDS_TRAIN.append([12, 0, 1, 11])
IDS_TRAIN.append([7, 0, 17, 11])
IDS_TRAIN.append([12, 5, 15, 9])
IDS_TRAIN.append([8, 22, ... | picchius94/META-CONV1D | Training/evaluate_ST-Conv1D.py | evaluate_ST-Conv1D.py | py | 20,247 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "os.environ",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.seed",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "random.seed",
... |
2152538973 | import os
import sqlite3
from sqlite3.dbapi2 import Connection, Cursor
from typing import Any, AnyStr, Final, Optional
import codenotes.db.utilities.notes as notes
import codenotes.db.utilities.notes_categories as notes_categories
import codenotes.db.utilities.tasks as tasks
import codenotes.db.utilities.tasks_categor... | EGAMAGZ/codenotes | codenotes/db/connection.py | connection.py | py | 3,101 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "typing.Final",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "typing.AnyStr",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
3023673855 | import os
from PIL import Image
import PIL.ImageOps
import argparse
import torchvision as V
import matplotlib.pyplot as plt
import ujson as json
import glob
import re
from . import configs
import rich
from rich.progress import track
console = rich.get_console()
def mnist_burst(dest: str, split: str, *,
mnist='... | cdluminate/MyNotes | rs/2022-veccls/veccls/mnist.py | mnist.py | py | 2,329 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "rich.get_console",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_num... |
41774659941 | from scapy.all import *
from scapy.layers.dot11 import Dot11, Dot11Beacon, Dot11Elt, RadioTap, Dot11Deauth
from colorama import Fore
from string import Template
import run
class fakeAP:
fake_ap_interface = "none"
fake_ssid = "fake"
sniffer = "none"
def __init__(self, fake_ap_interface, fake_ssid, sn... | yehonatanBar61/EvilTwin_T | fakeAP.py | fakeAP.py | py | 5,330 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "string.Template",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "string.Template",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "string.Template",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "string.Template",
... |
21687254250 | import math
import random
import keyboard
from random import choice
import pygame
import pygame.freetype
from pygame.draw import *
pygame.mixer.pre_init(44100, -16, 1, 512)
pygame.font.init()
pygame.init()
# Ускорение свободного падения
g = 3
# Громкость музыки и выбор музыки (менять не надо)
track = 0
vol = 0.5
# Раз... | MrKotMatroskin/Practika_programm | Игры/Пушка/gun.py | gun.py | py | 24,603 | python | ru | code | 0 | github-code | 36 | [
{
"api_name": "pygame.mixer.pre_init",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pygame.mixer",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pygame.font.init",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygame.font",
... |
24435584276 | from PyMca5.PyMcaPhysics.xrf import FastXRFLinearFit
from XRDXRFutils.data import DataXRF, SyntheticDataXRF
import h5py
from os.path import basename, dirname, join, exists
from os import remove
class FastFit():
def __init__(self, data = None, cfgfile = None, outputdir = None):
self.data = data
self... | RosarioAndolina/Map2H5 | Map2H5/FastFit.py | FastFit.py | py | 1,893 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "PyMca5.PyMcaPhysics.xrf.FastXRFLinearFit.FastXRFLinearFit",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "PyMca5.PyMcaPhysics.xrf.FastXRFLinearFit",
"line_number": 18,
"usa... |
71331018983 | from flask import render_template, flash, redirect, url_for, request, jsonify
from datetime import datetime
from application.Utils.CLP_Algorithm.volume_maximization import volume_maximization
from application.Utils.utils import params
from flask_login import current_user, login_user, logout_user, login_required
from js... | carlosdonado10/CLP_flask_app | application/routes.py | routes.py | py | 10,983 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "application.models.Dispatch.query.filter_by",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "application.models.Dispatch.query",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "application.models.Dispatch",
"line_number": 18,
"usag... |
72515318503 |
# Predict water positions
import time
import sys # To use sys.argv
import mdtraj
import numpy as np
import math
def BWHB(x1, x2, print_dist=False): # Bridge Water Hydrogen Bond
d = np.sqrt(((x1*10-x2*10)**2).sum())
if print_dist:
print(f'{d:.3f}', end=' \t')
return (1 / (1 + (d/2.6)**6)) / 0.5... | darrenjhsu/tiny_IFD | 01_Workflow/MDR_analysis/calcWater_func.py | calcWater_func.py | py | 39,291 | python | en | code | 12 | github-code | 36 | [
{
"api_name": "numpy.sqrt",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"line_number": 26,... |
18873855877 | import sys
from PyQt5 import Qt, QtGui
from PyQt5.QtWidgets import QDialog, QWidget, QVBoxLayout, QScrollArea, QApplication, QMainWindow
from PyQt5.uic import loadUi
from Screens import db_objects as dbo
import gnrl_database_con
class InspectionPlannerPage(QDialog):
def __init__(self, mainWindowRef: QMainWindow... | krzysiek-droid/Deki-Desktop-App | DekiApp_pyqt5/Screens/mainWindow_Pages.py | mainWindow_Pages.py | py | 7,953 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "PyQt5.QtWidgets.QDialog",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "PyQt5.uic.loadUi",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "... |
74031724903 | #!/bin/python3
import glob
import os
import sys
import re
import mimetypes
import time
import shutil
import platform
from tkinter import *
from pathlib import Path
system = platform.platform()
if 'win' in system:
filedelimiter = "\\"
else:
opener = 'xdg-open'
filedelimiter = "/"
# glob, glob, glob if pred... | Balajisrinivasan26/automatic_file_organizer | janitor.py | janitor.py | py | 6,163 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "platform.platform",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.renames",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "shutil.copy",
"line_numb... |
43884835663 | from models.vn_layers import *
import torch
import torch.nn as nn
from math import *
from models.kernelization import *
class TransformerEncoder(nn.Module):
def __init__(self, args):
super(TransformerEncoder, self).__init__()
self.args = args
self.heads = args.num_heads
self.num_f... | MagicSssak/VNPerformer | models/TransformerEncoder.py | TransformerEncoder.py | py | 4,149 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.nn.Module",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "torch.cat",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "torch.stack",
"line_number"... |
70172687463 | from django.shortcuts import render
# allow us to redirect
from django.shortcuts import redirect
from django.shortcuts import HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.http import HttpResponse
from django.template import RequestContext, loader
# import the User class in models.py
... | luojianhe1992/Django_many_to_one-relation-test | Django many_to_one relation test/HoneyCell_django/WebApp/views.py | views.py | py | 8,790 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "django.shortcuts.render",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.decorators.login_required",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.render",
"line_number": 36,
"usage_type": "call"
... |
37290486339 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^test_view/$', views.test_fun_1),
url(r'^contact_us/$', views.contact_me_view),
url(r'^register_test/$', views.register_test),
url(r'^test_progress_bar/$', views.test_progress_bar),
url(r'^test_choicefield/',views.test_choi... | bitapardaz/bitasync | code_test/urls.py | urls.py | py | 375 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.co... |
4363721495 | from django.shortcuts import render
from matplotlib import pylab
from pylob import *
def graph():
x=[1,2,3,4,5,6]
y=[5,2,6,7,2,7]
plot(x,y,linewidth=2)
xlabel('x axis')
ylabel('y axis')
title('sample graph')
grid(True)
pylab.show()
| sharmajyo/blogsite | blog/views.py | views.py | py | 242 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "matplotlib.pylab.show",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pylab",
"line_number": 14,
"usage_type": "name"
}
] |
26834249137 | """
.. module:: Wairakei/Tauhara MT inversion and Temp. extrapolation
:synopsis: Forward and inversion ot MT using MCMC 1D constrain inversion.
Extrapolation from temperature profiles in wells.
Estimate Temperature distribution.
.. moduleauthor:: Alberto Ardid
University of Auckland
.. con... | aardid/mt_meb_inv_code | 00_main_inversion.py | 00_main_inversion.py | py | 77,169 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "matplotlib.rcParams.update",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "os.sep",
"line_number": 126,
"usage_type": "attribute"
},
{
"api_name": "os.s... |
5784439690 | from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from collections import namedtuple
import six
from .bt import BluetoothConnection
from .dummy import DummyConnection
from .file import FileConnection
from .network import NetworkConnection
from .seria... | base4sistemas/pyescpos | escpos/conn/__init__.py | __init__.py | py | 2,006 | python | en | code | 67 | github-code | 36 | [
{
"api_name": "six.PY2",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "collections.namedtuple",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "bt.BluetoothConnection",
"line_number": 48,
"usage_type": "name"
},
{
"api_name": "dummy.Dumm... |
7816667534 | import boto3
import re
def move_object(sourceBucket, sourceKey, destinationBucket,
destinationKey, isVTT):
s3 = boto3.client("s3")
print(
"Move " + sourceBucket + "/" + sourceKey + " to " +
destinationBucket + "/" + destinationKey
)
if isVTT is True:
s3.copy_obj... | awslabs/serverless-subtitles | lambda/SUBLambdaFunctionOutput/index.py | index.py | py | 2,775 | python | en | code | 126 | github-code | 36 | [
{
"api_name": "boto3.client",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "boto3.resource",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number"... |
39479073026 | # -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand, CommandError
from cards.models import Card
from cards.models import Battle
from cards.models import Format
from cards.models import FormatBasecard
from django.utils import timezone
import re
from optparse import make_option
from datetime i... | jcrickmer/mtgdbpy | cards/management/commands/battlelinks.py | battlelinks.py | py | 3,085 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.stdout",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "re.compile",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "ca... |
21619030471 | from __future__ import absolute_import
import errno
import io
import logging
import multiprocessing
import re
import sys
import threading
import time
import traceback
from builtins import object
from apache_beam.internal.http_client import get_new_http
from apache_beam.io.filesystemio import Downloader
from apache_be... | a0x8o/kafka | sdks/python/apache_beam/io/gcp/gcsio.py | gcsio.py | py | 22,338 | python | en | code | 59 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "apache_beam.utils.retry.PermanentException",
"line_number": 88,
"usage_type": "attribute"
},
{
"api_na... |
33650052777 | import os, sys
sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)), '..'))
import subprocess
import shlex
import re
import pexpect
from nltk.tokenize.stanford_segmenter import StanfordSegmenter
from nltk import tokenize
from TMPosTagger.TMJapanesePosTagger import TMMyKyteaTagger
from TMPreprocess... | shasha79/nectm | src/TMPosTagger/TMTokenizer.py | TMTokenizer.py | py | 17,900 | python | en | code | 5 | github-code | 36 | [
{
"api_name": "sys.path.append",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": ... |
31045306948 | from step_functions.state_machine_resource import execute_state_machine
import click
# as per available non english ids https://docs.aws.amazon.com/polly/latest/dg/ntts-voices-main.html
NEURAL_VOICE_LIST = [
"Vicki",
"Bianca",
"Takumi",
"Seoyeon",
"Camila",
"Vitoria",
"Ines",
"Lucia",
... | ryankarlos/AWS-ML-services | projects/nlp/execute_pipeline.py | execute_pipeline.py | py | 3,003 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "step_functions.state_machine_resource.execute_state_machine",
"line_number": 106,
"usage_type": "call"
},
{
"api_name": "step_functions.state_machine_resource.execute_state_machine",
"line_number": 108,
"usage_type": "call"
},
{
"api_name": "click.command",
"li... |
41023646811 | import numpy as np
import argparse
import cv2
cap = cv2.VideoCapture(0)
while(1):
ret, frame = cap.read()
gray_vid = cv2.cvtColor(frame, cv2.IMREAD_GRAYSCALE)
cv2.imshow('Original',frame)
edged_frame = cv2.Canny(frame,100,200)
cv2.imshow('Edges',edged_frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
... | emredogan7/METU-EE-2017-2018-Capstone-Design-Project-Repository | Code/edge_detection_canny.py | edge_detection_canny.py | py | 365 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_GRAYSCALE",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "cv2.imshow",
... |
38078314636 | import torch
from torch import nn
from torch import Tensor
class RanEncoder(nn.Module):
def __init__(self, per_dim, in_channel, out_channel):
super().__init__()
self.per_dim = per_dim
self.in_channel = in_channel
self.out_channel = out_channel
self.conv1 = nn.C... | DTI-dream/EDC-DTI | src/core/RAN_encoder.py | RAN_encoder.py | py | 984 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "torch.nn.Module",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numb... |
856846577 | #!/usr/bin/env python
from pyhesity import *
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-v', '--vip', type=str, default='helios.cohesity.com')
parser.add_argument('-u', '--username', type=str, default='helios')
parser.add_argument('-d', '--domain', type=str, default='local')
parser.add_ar... | bseltz-cohesity/scripts | python/viewDR66/deleteOldViews.py | deleteOldViews.py | py | 3,313 | python | en | code | 85 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
}
] |
72007183145 | from flask import Flask, request
from covid import CovidAssist
import pycountry
import requests_cache
import datetime
import json
import requests
import os
from twilio.twiml.messaging_response import MessagingResponse
app = Flask(__name__)
agent = CovidAssist()
requests_cache.install_cache(cache_name='covid_cache', ba... | amansr02/CovidAssist | app.py | app.py | py | 1,877 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "covid.CovidAssist",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests_cache.install_cache",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.requ... |
72198305384 | import io
from collections import Counter
import pandas as pd
import plotly.express as px
from django.db.models import Count, Sum
from django.conf import settings
from django.http import HttpResponse
from pywaffle import Waffle
import matplotlib.pyplot as plt
from .countries import REGIONS
from .models import DEMOGRA... | LCOGT/globalskypartners | reports/plots.py | plots.py | py | 5,063 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "models.DEMOGRAPH_CHOICES",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "models.AUDIENCE_CHOICES",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "models.ACTIVITY_CHOICES",
"line_number": 20,
"usage_type": "name"
},
{
"api_name... |
41516616217 | import os
import shrimpy
from datetime import datetime
from arbitrage import *
def main():
shrimpy_public_key = os.environ.get("PUBLIC_KEY")
shrimpy_secret_key = os.environ.get("PRIVATE_KEY")
shrimpy_client = shrimpy.ShrimpyApiClient(shrimpy_public_key, shrimpy_secret_key)
# Works well on binance but... | terencebeauj/arbitrage_scanner | main.py | main.py | py | 4,921 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "os.environ.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_num... |
11632604595 | from abc import abstractmethod
from io import BytesIO
from json import JSONEncoder
import numpy as np
import imageio
from PIL import Image
from pydicom import Sequence
from pydicom import read_file
from pydicom.dataelem import PersonName
from pydicom.multival import MultiValue
from pydicom.valuerep import DA, DT, TM, D... | FDU-VTS/PACS-VTS | PACS/ndicom_server/apps/core/utils.py | utils.py | py | 6,224 | python | en | code | 9 | github-code | 36 | [
{
"api_name": "io.BytesIO",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pydicom.read_file",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "abc.abstractmethod",
"line_number": 103,
"usage_type": "name"
},
{
"api_name": "pydicom.read_file",
... |
74784270182 | import numpy
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.tri as tri
import matplotlib.cm as cm
def ternary_plot(data_fn):
reader = pd.read_csv(data_fn)
SQRT3 = numpy.sqrt(3)
SQRT3OVER2 = SQRT3 / 2.
def unzip(l):
return zip(*l)
def permute_point(p, permutation=None):
if no... | yashvardhan747/Statistical-and-Aqual-chemical-plots | StatisticalTools/ternary_plot.py | ternary_plot.py | py | 3,213 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
... |
3900882792 | import os
import random
import cv2
from torchvision import transforms
import matplotlib.pyplot as plt
torch_image_transform = transforms.ToTensor()
def get_data(dir, labels):
data = []
for label in labels:
path = os.path.join(dir, label)
class_num = labels.index(label)
f... | nguyen-tho/VGG19_Insect_Classification | get_data.py | get_data.py | py | 2,689 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "torchvision.transforms.ToTensor",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.... |
25142936013 | # -*- coding: utf-8 -*-
from bs4 import BeautifulSoup
from pandas import DataFrame
from util import spider_util
#获取学校学区信息
xx_url='http://map.28dat.net/s_ft/school.aspx?no=101'
cz_url='http://map.28dat.net/s_ft/school.aspx?no=225'#初中
url_arr=[]
url_arr.append(xx_url)
url_arr.append(cz_url)
schoolarea = []
for url in u... | w341000/PythonTheWord | SchoolArea.py | SchoolArea.py | py | 1,184 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "util.spider_util.open_url",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "util.spider_util",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "util.spi... |
33639047987 | import io
import os
import sys
import tempfile
from Config.Config import G_CONFIG
from JobApi.ESJobApi import ESJobApi
spark_config = G_CONFIG.config['spark']
task_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'tasks')
src_root_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), '..')
f... | shasha79/nectm | src/JobApi/SparkTaskDispatcher.py | SparkTaskDispatcher.py | py | 2,602 | python | en | code | 5 | github-code | 36 | [
{
"api_name": "Config.Config.G_CONFIG.config",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "Config.Config.G_CONFIG",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "... |
3985485979 | import os
from skimage import io
import copy
import numpy as np
import random
from glob import glob
import h5py
import torch
import torch.utils.data as data
from torchvision import transforms, datasets
from src.datasets.root_paths import DATA_ROOTS
class BaseSo2Sat(data.Dataset):
CLASSES = ['Compact High-Rise',
... | jbayrooti/divmaker | src/datasets/so2sat.py | so2sat.py | py | 3,310 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "torch.utils.data",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "src.datasets.root_paths.DATA_ROOTS",
"line_number": 36,
"usage_type": "name"
},
{
... |
6694542098 | import time
import random
from typing import List, Tuple, Generator
class Life:
state: List[List[bool]]
m: int
n: int
def __init__(self, m: int, n: int):
self.m = m
self.n = n
self.state = [[False for _ in range(n)] for _ in range(m)]
def __repr__(self) -> ... | nurlbk/gameOfLife-video | gameOfLife.py | gameOfLife.py | py | 2,472 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "typing.List",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "random.randint",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "typing.Generator",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_n... |
73997935782 | #%% packages
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import seaborn as sns
#%% data import
cars_file = 'https://gist.githubusercontent.com/noamross/e5d3e859aa0c794be10b/raw/b999fb4425b54c63cab088c0ce2c0d6ce961a563/cars.csv'
cars = pd.read_csv(cars_file)
cars.head()
#%% visualise the ... | ono5/learn-pytorch | 03_ModelingIntroduction/10_LinReg_ModelClass_start.py | 10_LinReg_ModelClass_start.py | py | 2,294 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "seaborn.scatterplot",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "seaborn.regplot",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.array",
... |
3520624550 | """Defines helpers related to the system database."""
import logging
import time
from sqlalchemy import create_engine
from sqlalchemy.engine import Engine
from sqlalchemy.exc import OperationalError
from sqlalchemy.orm import sessionmaker
from sqlalchemy.sql import text
from .project_settings_service import ProjectS... | learningequality/meltano | src/meltano/core/db.py | db.py | py | 3,535 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "project_settings_service.ProjectSettingsService",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "logging.debug",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 30,
"usage_type": "call"
},
{... |
36121458003 | import random
import json
from typing import Tuple, Union, Dict, Any
from forte.data.ontology import Annotation
from forte.processors.data_augment.algorithms.single_annotation_op import (
SingleAnnotationAugmentOp,
)
from forte.common.configuration import Config
from forte.utils import create_import_error_msg
__... | asyml/forte | forte/processors/data_augment/algorithms/typo_replacement_op.py | typo_replacement_op.py | py | 4,240 | python | en | code | 230 | github-code | 36 | [
{
"api_name": "forte.utils.create_import_error_msg",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "requests.exceptions",
"line_number": 51,
"usage_type": "attribute"
},
{
"api_nam... |
9044214062 | import requests
import json
import pandas as pd
from dotenv import load_dotenv
import os
load_dotenv()
API_KEY = os.getenv("API_KEY")
def extract_lat_long_via_address(address_or_zipcode):
lat, lng = None, None
base_url = "https://maps.googleapis.com/maps/api/geocode/json"
endpoint = f"{base_url}?address=... | shrey150/playeasy-gis | convert_to_csv.py | convert_to_csv.py | py | 1,396 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number... |
26249935476 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
#@ brief introduction
"""
本段程序描述了移动机器人底盘的一些控制方法,包括使能、前进、设置底盘速度等
底盘电机的控制可以通过多种方式,例如:can modbus等
"""
from ZL_motor_control import ZL_motor_control
# class ZL_motor_control
import can
from math import *
import time
# 外部设置bus,然后传递给car
class car(object):
def __init__(self,w... | TiderFang/motor_control_bus | diff_car_controller/scripts/car_control.py | car_control.py | py | 4,546 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "can.CanError",
"line_number": 90,
"usage_type": "attribute"
},
{
"api_name": "ZL_motor_control.ZL_motor_control",
"line_number": 107,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 110,
"usage_type": "call"
},
{
"api_name": "time.... |
33638590751 | import numpy as np
import hydra
from tools.profiler import timeit
from waymo_dataset.registry import PIPELINES
from utils.sampler import preprocess as prep
from utils.bbox import box_np_ops
def _dict_select(dict_, inds):
for k, v in dict_.items():
if isinstance(v, dict):
_dict_select(v, inds)
... | abahnasy/waymo_gnn | waymo_dataset/pipelines/preprocess.py | preprocess.py | py | 7,111 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "numpy.array",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.int64",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "hydra.utils.to_absolut... |
26769234529 | from event_manager.models import Event
from datetime import datetime, timedelta
from celery import shared_task
from django.core.mail import send_mail
import pytz
from scheduler_APP.settings import EMAIL_HOST_USER
@shared_task()
def to_remind():
events_set = Event.objects.filter(remind_option__isnull=False)
fo... | EugeneVojtik/eugene_vojtik_scheduler | event_manager/tasks.py | tasks.py | py | 1,020 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "event_manager.models.Event.objects.filter",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "event_manager.models.Event.objects",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "event_manager.models.Event",
"line_number": 11,
"usage_... |
17010990531 | #import libs
import sys
import os
import socket
import pygame
pygame.init()
#define variables
PORT = int(sys.argv[1])
host = "localhost"
HOST = socket.gethostbyname(host)
#Connect to host at port
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
#try connecting to host
try:
... | ivanebos/pingPongNetworks | client.py | client.py | py | 1,036 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pygame.init",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "socket.gethostbyname",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "socket.socket",
"li... |
6533803679 | import cv2
import numpy as np
from matplotlib import pyplot as plt
blur1 = cv2.imread('part1/blur1.png', 0)
blur2 = cv2.imread('part1/blur2.png', 0)
blur3 = cv2.imread('part1/blur3.png', 0)
oriimg = cv2.imread('part1/original.jpg', 0)
# fft to convert the image to freq domain
fblur1 = np.fft.fft2(blur1)
fb... | ebbalseven/Motion-Deblurring-in-Frequency-Domain | part1.py | part1.py | py | 3,884 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "cv2.imread",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 8,
... |
4518167916 | #Python libraries that we need to import for our bot
import random
from flask import Flask, request
from pymessenger.bot import Bot
# using get
import os
app = Flask(__name__)
ACCESS_TOKEN = "EAAHGgxLDfLYBAGg0ZCgxEgo297oOfe0SuqVIvT2xWmXeJfNKZC7bpm35LZCluAHwULwKiAPmny2SVeLDCBlGackR9F5LYBPnoRHZBhWqGVEEEwZBPA9WbWn1DdApx... | longNT0dev/mess_bot_chat | botMessenger.py | botMessenger.py | py | 2,553 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pymessenger.bot.Bot",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "flask.reques... |
17551788197 | #!/usr/bin/env python3
import cv2
import depthai as dai
import contextlib
# Start defining a pipeline
pipeline = dai.Pipeline()
# Define a source - color camera
cam_rgb = pipeline.createColorCamera()
cam_rgb.setPreviewSize(600, 600)
cam_rgb.setBoardSocket(dai.CameraBoardSocket.RGB)
cam_rgb.setResolution(dai.ColorCam... | hello-word-yang/depthai-experiments | gen2-multiple-devices/main.py | main.py | py | 1,320 | python | en | code | null | github-code | 36 | [
{
"api_name": "depthai.Pipeline",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "depthai.CameraBoardSocket",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "depthai.ColorCameraProperties",
"line_number": 14,
"usage_type": "attribute"
},
{
... |
15675080040 | from django.views.decorators.http import require_http_methods
from common.json import ModelEncoder
from .models import AutomobileVO, SalesPerson, Customer, SaleRecord
from django.http import JsonResponse
import json
class AutomobileVOEncoder(ModelEncoder):
model = AutomobileVO
properties = [
"vin",
... | colinprize/DealershipPro | sales/api/sales_rest/views.py | views.py | py | 6,502 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "common.json.ModelEncoder",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "models.AutomobileVO",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "common.json.ModelEncoder",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "m... |
42778532873 | import tempfile
from datetime import datetime, timedelta
from typing import Any, Generator
import openpyxl
import pandas as pd
import pytest
from dateutil.tz import tzutc
from pytest_mock import MockFixture
from toucan_connectors.s3.s3_connector import S3Connector, S3DataSource
from toucan_connectors.toucan_connector... | ToucanToco/toucan-connectors | tests/s3/test_s3.py | test_s3.py | py | 9,501 | python | en | code | 16 | github-code | 36 | [
{
"api_name": "toucan_connectors.s3.s3_connector.S3Connector",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "toucan_connectors.s3.s3_connector.S3Connector",
"line_number": 16,
"usa... |
830274847 | import os
import sys
import numpy as np
import torch
from torchdrug import data
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
from diffpack import rotamer
if __name__ == "__main__":
protein = data.Protein.from_pdb('10mh_A.pdb', atom_feature=None, bond_feature=None,
... | DeepGraphLearning/DiffPack | test/test_rotamer.py | test_rotamer.py | py | 1,137 | python | en | code | 42 | github-code | 36 | [
{
"api_name": "sys.path.append",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
14102775036 | """
Functions that are helpful for evaluating models.
"""
from typing import Dict, Any, List
import pandas as pd
import numpy as np
from . import error_metrics
def evaluate_predictions(
df: pd.DataFrame,
y_true: pd.Series,
y_pred: pd.Series,
metrics_dict: Dict[str, Any] = {
'mean_absolute_er... | nasa/ML-airport-data-services | data_services/evaluation_utils.py | evaluation_utils.py | py | 4,896 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "pandas.DataFrame",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "pandas.Series",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pandas.Series",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "typing.Di... |
6071086081 | '''
Created on 29.03.2017
@author: abaktheer
Microplane Fatigue model 3D
(compressive plasticity (CP) + tensile damage (TD)
+ cumulative damage sliding (CSD))
Using Jirasek homogenization approach [1999]
'''
import numpy as np
from bmcs_utils.api import Float, View, Item
from ibvpy.tmodel.mats3D.mats3D_eval import ... | bmcs-group/bmcs_matmod | bmcs_matmod/ntim/vuntim.py | vuntim.py | py | 12,151 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "ibvpy.tmodel.mats3D.mats3D_eval.MATS3DEval",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "bmcs_utils.api.Float",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "bmcs_utils.api.Float",
"line_number": 30,
"usage_type": "call"
},
{
... |
2004723473 | """
Project Settings file
"""
import os
from starlette.datastructures import CommaSeparatedStrings, Secret
default_route_str = "/api"
ALLOWED_HOSTS = CommaSeparatedStrings(os.getenv("ALLOWED_HOSTS", "*"))
SECRET_KEY = Secret(os.getenv(
"SECRET_KEY",
"4bf4f696a653b292bc674daacd25195b93fce08a8dac7373b36c38f63c... | marirs/fastapi-boilerplate | server/core/settings.py | settings.py | py | 687 | python | en | code | 141 | github-code | 36 | [
{
"api_name": "starlette.datastructures.CommaSeparatedStrings",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "starlette.datastructures.Secret",
"line_number": 11,
"usage_type": "call"
},
{... |
25873892301 | from Physics import Physics, MassPoint, Position
import matplotlib.pyplot as plt
import numpy as np
import re
# Import 3D Axes
from mpl_toolkits.mplot3d import axes3d
def plotMassPoints(phyInstance):
massPts = phyInstance.getMassPoints()
pointArray = list(mp.position.arr for mp in massPts)
ptMat... | DoktorBotti/RL_LocalGravityAssistant | code/HelperFunctions.py | HelperFunctions.py | py | 4,874 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.stack",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.hsplit",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",... |
6778601752 | from utils import session
from models import User, Organization
from werkzeug.wrappers import Request
from werkzeug.utils import cached_property
from werkzeug.contrib.securecookie import SecureCookie
# you could just use
# os.urandom(20) to get something random
SECRET_KEY = '\xc9\xd5+\xe7U\x8f\xef\r\xa60\xed\xf4\x1cp... | anzarafaq/iqp | src/py/iqpapp/custom_request.py | custom_request.py | py | 1,551 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "werkzeug.wrappers.Request",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "werkzeug.contrib.securecookie.SecureCookie.load_cookie",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "werkzeug.contrib.securecookie.SecureCookie",
"line_number": ... |
5709821710 | """Example of script that run Disim and plots data from logs."""
import numpy as np
import os
import matplotlib.pylab as plt
from scipy import optimize
def run_disim(idm_args):
lua_args = "--lua-args=\""
for n, v in idm_args.items():
lua_args += n+"={},".format(v)
lua_args += "\""
duration = 3600 * 6
... | sgowal/disim | scripts/python/run_and_plot.py | run_and_plot.py | py | 1,741 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "os.system",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.genfromtxt",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.genfromtxt",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_nu... |
70089050984 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib
matplotlib.rcParams['text.usetex'] = True
def main() -> None:
w = 1.
emission_psf = np.genfromtxt('tem_m_0_n_0.csv', delimiter=',')
y_linspace = np.linspace(-2.0, 2.0, np.shape(emission_psf)[0])
x_linspace = np.linspac... | oliver-peoples/honours-project | old/combined_probabilities.py | combined_probabilities.py | py | 1,437 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "matplotlib.rcParams",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "numpy.genfromtxt",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.shape",... |
5209818029 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 29 16:04:51 2020
@authors:
Verifiers: Alessandro Busatto, Paolo Graziani, Aurora Rossi, Davide Roznowicz;
Applet: Giacomo Di Maggio, Marco Emporio, Marco Fattorelli, Sebastiano Gaiardelli, Francesco Trotti;
Map: Rosario Di Matteo, Marco Emporio, Adr... | romeorizzi/esami-RO-public | old/generate_all_exams_given_list.py | generate_all_exams_given_list.py | py | 4,434 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"l... |
27048685248 | import pygame
class Berry(pygame.sprite.Sprite):
def __init__(self, x, y):
width = height = 16
red = (255, 0, 0)
self.image = pygame.Surface((width, height))
self.image.fill(red)
self.rect = self.image.get_rect()
self.rect.x = x
self.rect.y = y
def IsEat... | JoeZlonicky/Snake | Source/Berry.py | Berry.py | py | 478 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pygame.sprite",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "pygame.Surface",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.sprite.collide_rect",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pygame.spr... |
26820836865 | #Pardhu Gorripati
#sqlalchemy components
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, Float
from sqlalchemy.orm import sessionmaker
from sqlalchemy import and_, or_, not_
Base = declarative_base()
class baseRoom... | bobbilisantosh321/python | Final Prj.py | Final Prj.py | py | 11,507 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sqlalchemy.ext.declarative.declarative_base",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integer",
"line_number": 15,
"usage_type": "argument"
},
{
... |
14175838199 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('workArounds', '0002_remove_monthlyreport_cycle'),
]
operations = [
migrations.RemoveField(
model_name='workday',... | ravitbar/workers | workArounds/migrations/0003_remove_workday_offday.py | 0003_remove_workday_offday.py | py | 365 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.RemoveField",
"line_number": 14,
"usage_type": "call"
},
... |
28923475301 | #18405. 경쟁적 전염
"""
heapq를 쓰는법도 있을것만 같지만 일단 이렇게 구현했다.
"""
#STEP 1. INPUT SETTING
import sys
from collections import deque
input=sys.stdin.readline
N,K=map(int,input().rstrip().split())
board=[]
dist=[[-1]* N for _ in range(N)]
start_deq=deque([])
for row in range(N):
arr=list(map(int,input().rstrip().split()))
b... | GuSangmo/BOJ_practice | BOJ/18405.py | 18405.py | py | 1,764 | python | ko | code | 0 | github-code | 36 | [
{
"api_name": "sys.stdin",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 12,
"usage_type": "call"
}
] |
1702730464 | # %%
from itertools import combinations
import spacy
# Load spaCy's pre-trained word embedding model
nlp = spacy.load("en_core_web_sm")
# Input text containing words for similarity comparison
text = (
"funny comedy music laugh humor song songs jokes musical hilarious"
)
# Process the input text wit... | NewDonkCity/Portfolio | word_embedding.py | word_embedding.py | py | 1,598 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "spacy.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "itertools.combinations",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"lin... |
26478265364 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('api', '0004_auto_20150623_1841'),
]
operations = [
migrations.AlterField(
model_name='element',
name... | protocolbuilder/sana.protocol_builder | src-django/api/migrations/0005_auto_20150703_2228.py | 0005_auto_20150703_2228.py | py | 608 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AlterField",
"line_number": 14,
"usage_type": "call"
},
{... |
18284253607 | # 用xpath爬取糗事百科里面段子的详情,存储为json格式
# https://www.qiushibaike.com/8hr/page/1/
# 每个段子 //div[contains(@id,"qiushi_tag_")]
# 用户名 ./div/a/h2
# 图片链接 ./div/a/img[@class="illustration"]/@src
# 段子内容 ./a/div[@class="content"]/span
# 点赞数 ./div/span/i[@class="number"]
# 评论数 ./div/span/a/i[@class="number"]
import requests
from lxml... | longyincug/crawler | 12_xpath_json_demo.py | 12_xpath_json_demo.py | py | 2,016 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "json.dumps",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "lxml.etree.HTML",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_number... |
4511367599 | import openpyxl
import pandas
from collections import Counter
from difflib import SequenceMatcher
from collections import OrderedDict
import time
import numpy
import igraph
import sys
pathTest = "E:\\Pham Thanh Quyet - 23.12.2022\\DSKH 22.12.23\\VRS VRH\\Book1.XLSX"
path = "E:\\Pham Thanh Quyet - 23.12.2022\\DSKH 22.... | ChinhTheHugger/vscode_python | excel_graph_test.py | excel_graph_test.py | py | 2,397 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "openpyxl.load_workbook",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "openpyxl.load_workbook",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "time.strftime... |
43102936048 | from collections import namedtuple
from playment.utilities import Decodable
class JobResult(Decodable):
def __init__(self, job_id: str = None, batch_id: str = None, project_id: str = None, reference_id: str = None,
status: str = None, tag: str = None, priority_weight: int = None, result: str = No... | crowdflux/playment-sdk-python | playment/jobs/job_result.py | job_result.py | py | 703 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "playment.utilities.Decodable",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "collections.namedtuple",
"line_number": 18,
"usage_type": "call"
}
] |
3269636790 | #
#
#
import time
from .external import getid
from .types import MissingParamException
from .utils import StopException, TaskRunner
def genarid() -> str:
return getid()
def makearfsfromdisk(disk: str) -> int:
runner = TaskRunner()
try:
runner.setvalue("disk", disk)
for step in (
... | toppk/saveme | lib/saveme/block.py | block.py | py | 1,345 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "external.getid",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "utils.TaskRunner",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_num... |
23540887587 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Language Detector is a RESTful web service for detecting the language of
arbitrary text.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import os... | NLPKit/LanguagePredictor | language_predictor.py | language_predictor.py | py | 2,386 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "typing.Dict",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "flask.request.get_json",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "flask.request",
"li... |
26010207985 | import argparse
import os
import re
import subprocess
import sys
import test_common
parser = argparse.ArgumentParser()
parser.add_argument("files", nargs="*")
args = parser.parse_args()
here = os.path.dirname(os.path.realpath(__file__))
codes = {}
for s in open(os.path.join(here, "..", "src", "etc.h")).readlines():... | russellw/ayane | test/test.py | test.py | py | 1,339 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath"... |
43281589774 | #!/usr/bin/env python
from sys import argv
import boto3
import logging
logging.basicConfig(level=logging.INFO)
session = boto3.Session()
sqs = session.client('sqs')
sts = session.client('sts')
def queue_transfer(from_queue, to_queue):
logging.info(f"Transfer from {from_queue} to {to_queue}")
from_queue_url ... | bhoven/sqs-util | sqs_util.py | sqs_util.py | py | 2,405 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.basicConfig",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "boto3.Session",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.info",
"... |
10665105745 | import datetime
from flask.ext.jwt import current_identity, jwt_required
from flask_restplus import Namespace, Resource, fields, reqparse
from packr.models import Order, Role, User
api = Namespace('lookup',
description='Operations related to looking up an order')
lookup = api.model('Lookup', {
'... | ZeroEcks/packr | packr/api/lookup.py | lookup.py | py | 4,547 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask_restplus.Namespace",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask_restplus.fields.Integer",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask_restplus.fields",
"line_number": 12,
"usage_type": "name"
},
{
"api_n... |
20583496296 | import cv2
import numpy as np
#COLOR PICKER RANGE
green = np.uint8([[[40, 40, 255]]]) #here insert the bgr values which you want to convert to hsv
hsvGreen = cv2.cvtColor(green, cv2.COLOR_BGR2HSV)
print(hsvGreen)
lowerLimit = hsvGreen[0][0][0] - 10, 150, 150
upperLimit = hsvGreen[0][0][0] + 10, 255, 255
print(upperL... | Altair115/OpenCV2-Workshop | Opdrachten/Op3.py | Op3.py | py | 1,498 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.uint8",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2HSV",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
"line_n... |
73490872105 | from selenium.webdriver.common.action_chains import ActionChains
from urllib.parse import urljoin
import time
import pytest
@pytest.fixture
def catalog_url(baseurl_option):
return urljoin(baseurl_option, '/index.php?route=product/category&path=20')
def test_login_catalog(catalog_url, browser):
browser.get(c... | astretcova/Otus-lessons | hw_8/catalog_test.py | catalog_test.py | py | 1,503 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "urllib.parse.urljoin",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pytest... |
44101908061 | from flask import Flask, request, send_from_directory
from PIL import Image
import pathlib
import os
import urllib
S3_BUCKET_URL = "https://s3-us-west-2.amazonaws.com/makersdistillery/"
IMAGES_PATH = pathlib.Path("images")
app = Flask(__name__)
@app.route("/images/<path:image_path>")
def images(image_path):
file... | akb/image-resize-service | image-resize.py | image-resize.py | py | 2,004 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pathlib.Path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": ... |
14147663072 | import inspect
from pathlib import Path
import torch
import yaml
from comfy import model_detection, model_management
from comfy.sd import CLIP, VAE, load_model_weights
from comfy.model_patcher import ModelPatcher
from comfy.utils import calculate_parameters
from folder_paths import models_dir as comfy_models_path
from... | s1dlx/comfy_meh | meh.py | meh.py | py | 7,524 | python | en | code | 13 | github-code | 36 | [
{
"api_name": "pathlib.Path.cwd",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "folder_paths.models_dir",
... |
8097764457 | import os
# use CPU only
os.environ["CUDA_VISIBLE_DEVICES"] = ""
import pickle
import argparse
import numpy as np
from math import ceil
from tqdm import tqdm
import tensorflow as tf
from shutil import rmtree
np.random.seed(1234)
def split(sequence, n):
""" divide sequence into n sub-sequence evenly """
k, m = ... | bryanlimy/CalciumGAN | dataset/generate_tfrecords.py | generate_tfrecords.py | py | 8,641 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "os.environ",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.seed",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
... |
70943334823 | import time
import smbus
from datetime import datetime, timedelta
import arrow # local/utc conversions
# set I2c bus addresses of clock module and non-volatile ram
DS3231ADDR = 0x68 #known versions of DS3231 use 0x68
AT24C32ADDR = 0x57 #older boards use 0x56
I2C_PORT = 1 #valid port... | bablokb/pi-wake-on-rtc | files/usr/local/sbin/ds3231.py | ds3231.py | py | 15,996 | python | en | code | 37 | github-code | 36 | [
{
"api_name": "arrow.get",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "arrow.get",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "smbus.SMBus",
"line_number": 99,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number"... |
21663810901 | #!/usr/bin/env python3
import random, argparse
parser = argparse.ArgumentParser()
parser.add_argument("-r", "--rows", help="how many rows defaults to 2")
parser.add_argument("-c", "--cols", help="how many cols defaults to 2")
args = parser.parse_args()
if args.rows:
try:
rows = int(args.rows)
... | nathankurt/random-seat-teams-bot | random_seats.py | random_seats.py | py | 1,528 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "random.shuffle",
"line_number": 30,
"usage_type": "call"
}
] |
23677049937 | import warnings
warnings.filterwarnings('ignore')
import numpy as np
import pandas as pd
#import matplotlib as plt
import matplotlib.pyplot as plt
from pyFTS.common import Util
from pyFTS.benchmarks import Measures
from pyFTS.partitioners import Grid, Entropy
from pyFTS.models import hofts
from pyFTS.common import Mem... | minhazul-alam/Fuzzy_Systems | FuzzyPracticeCodes/solarfts.py | solarfts.py | py | 1,382 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.... |
1411699424 | import os
from vk import VK
from ya_disk import YaDisk
import json
from datetime import datetime
from tqdm import tqdm
from dotenv import load_dotenv
def main():
vk_user_id = input('Enter VK user ID (only digits): ')
num_photos = int(input('Enter the number of photos to save (default is 5): ') or 5)
load... | kanadass/photo_backup_cw | main.py | main.py | py | 1,466 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "vk.VK",
"line_number": 19,... |
21753084092 | # -*- coding: utf-8 -*-
import os
import tensorflow as tf
from PIL import Image
writer = tf.python_io.TFRecordWriter("train.tfrecords")
images_path = "./snow/"
classes = {'snow'}
for index, name in enumerate(classes):
for img_name in os.listdir(images_path):
img_path = images_path + img_name
im... | crayhuang/TGOTPeopleRecognition | ImageHandler.py | ImageHandler.py | py | 1,094 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "tensorflow.python_io.TFRecordWriter",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "tensorflow.python_io",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 14,
"usage_type": "call"
},
{
"api_name":... |
72052973863 | from starlette.applications import Starlette
from starlette.responses import JSONResponse
from starlette.routing import Route
import uvicorn
async def homepage(request):
return JSONResponse({'hello': 'world'})
async def empty_route(request):
return JSONResponse({'new route': 'this route does no... | MuelGoh/starlette_project | main.py | main.py | py | 793 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "starlette.responses.JSONResponse",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "starlette.responses.JSONResponse",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "starlette.applications.Starlette",
"line_number": 27,
"usage_type": "cal... |
8674468084 | # !/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2022/10/25 15:03
# @Author : Hanchiao
# @File : antColony.py
import numpy as np
from enum import Enum
from itertools import count
import statistics
import matplotlib.pyplot as plt
import sys
import time
def _custom_create(custom_generate, pool):
ini... | Timber-Ye/intl-opt | AntColony/knapsack-problem/antColony.py | antColony.py | py | 8,503 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "itertools.count",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 111,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number"... |
9626703877 | import json
import re
import os
import time
import logging
from collections import namedtuple
from paddle.fluid import core
import paddle.fluid as fluid
import numpy as np
Doc = namedtuple("Document", ("id", "title", "content"))
SegDoc = namedtuple("Seg_Document",("id", "title", "content", "seg_content"))
def read_o... | hanguantianxia/model | utils.py | utils.py | py | 8,186 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.namedtuple",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "re.compile",... |
469424801 | #!/usr/bin/env python
from setuptools import setup
VERSION = "0.2"
REPO = "https://github.com/duedil-ltd/python-sloq"
README = "README.rst"
with open(README) as f:
long_description = f.read()
setup(
name="sloq",
version=VERSION,
description="Rate-limited Queue",
author="Paul Scott, Duedil Limited... | duedil-ltd/python-sloq | setup.py | setup.py | py | 617 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "setuptools.setup",
"line_number": 11,
"usage_type": "call"
}
] |
4352028229 | import sys
import csv
import json
# Converts the JSON output of a PowerBI query to a CSV file
def extract(input_file, output_file):
input_json = read_json(input_file)
data = input_json["results"][0]["result"]["data"]
dm0 = data["dsr"]["DS"][0]["PH"][0]["DM0"]
columns_types = dm0[0]["S"]
columns = ... | ondata/covid19italia | webservices/vaccini/puntiSomministrazione.py | puntiSomministrazione.py | py | 2,598 | python | en | code | 207 | github-code | 36 | [
{
"api_name": "json.load",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 70,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 71,
... |
20028159089 | from boto3 import client
from flask import Flask, jsonify, request, make_response
from .utils import get_timestamp
from .constants import FAVOURITE_COMPANIES_TABLE, FAVOURITE_ORG_ID, ORG_ID
app = Flask(__name__)
app.config["JSONIFY_PRETTYPRINT_REGULAR"] = True
client = client("dynamodb", region_name="eu-west-1")
h... | AndreuJove/serverless_training | app/app.py | app.py | py | 2,942 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "boto3.client.scan",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_nu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.