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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2957837903 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import torch
from torch import nn
class Reshape(nn.Module):
def forward(self, x):
return x.view(-1, 1, 28, 28)
net = nn.Sequential(
Reshape(),
# 输入通道为1,输出通道为6的卷积层 (28+4-5+1)*(28+4-5+1) = 28*28
nn.Conv2d(1, 6, kernel_size=5, padding=2), nn.Sigmoi... | chairc/daily-learning | pytorch-learning/003_pytorch_卷积神经网络(CNN)/04_LeNet_卷积神经网络(LeNet)/00_LeNet的结构.py | 00_LeNet的结构.py | py | 1,100 | python | en | code | 4 | github-code | 97 | [
{
"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.Sequential",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_... |
74188605439 | from tkinter import *
from tkinter import ttk
from tkinter import tix
from tkinter import messagebox
import banco_2
import os
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import letter, A4
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
from reportlab.... | JPalve24/C-digos-Abertos | Sistema Cadastro/SISTEMA.py | SISTEMA.py | py | 16,769 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "banco_2.dql",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "banco_2.dql",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "webbrowser.open",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "banco_2.dql",
"line_numbe... |
20232988275 | import abc
import datetime
import os
import shutil
import time
from grocsvs import log
class StepChunk(object):
__metaclass__ = abc.ABCMeta
@staticmethod
def get_steps(options):
""" """
raise Exception("this abstract staticmethod needs to be instantiated by subclasses")
@abc.abstrac... | grocsvs/grocsvs | src/grocsvs/step.py | step.py | py | 3,697 | python | en | code | 38 | github-code | 97 | [
{
"api_name": "abc.ABCMeta",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "abc.abstractmethod",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "abc.abstractmethod",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "abc.... |
35875994630 | import copy
from math import comb
from tkinter import *
import numpy as np
root = Tk()
root.geometry('800x660+1+1')
root.config(bg="#0f0f0f")
root.title("Геометрическое моделирование")
canv = Canvas(bg='white')
canv.pack(fill=BOTH,expand=1)
points = []
def click(event):
print("X:" , event.x , "Y:", event.y)
can... | piterskyproduction/ob_1 | ob_1.py | ob_1.py | py | 11,206 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.array",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "numpy.min",
"line_number":... |
16180726548 | from PySide2 import QtWidgets, QtGui, QtCore
class Header(QtWidgets.QWidget):
"""Header class for collapsible group"""
def __init__(self, name, content_widget,pref_name, prefs, bg_color, margins):
"""
Constructor
:param name: Name for the header
:param content_widget: Widget c... | Illogicstudios/bug_out_bag | BobCollapsibleWidget.py | BobCollapsibleWidget.py | py | 4,983 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "PySide2.QtWidgets.QWidget",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "PySide2.QtWidgets",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "PySide2.QtGui.QPixmap",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "... |
11137509114 | """Scans IP network
usage: NetScan.py [-h] [-b <IP>] [-p <ports>] [-m] [-t ##] [-s <IP>]
TCP net scan will scan the default IP interfaces entire network when no additional options are specified
options:
-h, --help show this help message and exit
-b <IP>, --bind <IP> Specify a local IP interface to bi... | Tailspinn/NetScan | NetScan.py | NetScan.py | py | 9,339 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "socket.socket",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_DGRAM",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "ipaddress.IP... |
4871501126 | import argparse
from typing import NoReturn
from Component import Component, NodeType
from LearnerInstance import LearnerInstance
from Message import Message, MessageLearnerCatchUp
from MessageController import MessageController
class Learner(Component):
def __init__(self, id: int = None, config_path: str = 'co... | Fraccaman/MultiPaxos | Learner.py | Learner.py | py | 1,605 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "Component.Component",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "Component.NodeType.Leaner",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "Component.NodeType",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": ... |
8673189356 | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 26 01:00:17 2023
@author: shada
"""
from leo_dqn_agents import DQN_agent
# from env_cartpole import CartPoleEnv
from leo_env import LeoEnv
import matplotlib.pyplot as plt
class DRL:
def __init__(self,num_episodes):
# Define the enviro... | Shadab442/dqn-leo-handover-python | drl_frameworks.py | drl_frameworks.py | py | 3,421 | python | en | code | 6 | github-code | 97 | [
{
"api_name": "leo_env.LeoEnv",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "leo_dqn_agents.DQN_agent",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 99,
"usage_type": "call"
},
{
"api_name": "matp... |
33881884184 | import random
from english_words import english_words_set
from PyDictionary import PyDictionary
words = list(english_words_set)
chosen = "r"
dict = PyDictionary()
meaning = dict.meaning(chosen)
print(f"This is The Meaning Of The Word You Are Going To Guess{meaning}")
chose_edit = chosen
def anti_vowel(c = input):
n... | Sanyam-Ahuja/Yo1 | My Projects/Yo/yo.py | yo.py | py | 797 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "english_words.english_words_set",
"line_number": 4,
"usage_type": "argument"
},
{
"api_name": "PyDictionary.PyDictionary",
"line_number": 6,
"usage_type": "call"
}
] |
34930174449 | import argparse
import logging
import os
import sys
import re
import collections
import json
from transformers import BertTokenizer, AutoTokenizer
import conll
import util
import udapi_io
logging.basicConfig(format='%(asctime)s - %(levelname)s - %(name)s - %(message)s',
datefmt='%m/%d/%Y %H:%M:%S',... | HaixiaChai/multi-coref | preprocess.py | preprocess.py | py | 22,792 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.basicConfig",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "json.load",
... |
42041450428 | # -*- coding: utf-8 -*-
import math
from django.db import models
from django.db.models import Q, F
from django.urls import reverse
from django.conf import settings
from common import enum
from us import get_session_ordinal
from bill.models import BillSummary
from website.templatetags.govtrack_utils import markdown
... | govtrack/govtrack.us-web | vote/models.py | models.py | py | 33,076 | python | en | code | 350 | github-code | 97 | [
{
"api_name": "csv.reader",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "common.enum.Enum",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "common.enum",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "common.enum.Item",
"... |
74699176319 | import time
import re
import logging
import scipy.misc
from scipy.ndimage.filters import gaussian_filter
from fpga import api
import numpy as np
import cv2
import os,sys
from bitstring import BitArray
from PIL import Image
import numpngw
logging.basicConfig(format='%(levelname)-6s[%(filename)s:%(lineno)d] %(message)s'... | KevinZhuGit/CEP_camera_project | python/api/t6.py | t6.py | py | 46,566 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.basicConfig",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "fpga.api",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"li... |
74941748160 |
# coding: utf-8
# In[3]:
get_ipython().run_line_magic('config', "InlineBackend.figure_format = 'retina'")
get_ipython().run_line_magic('matplotlib', 'inline')
import numpy as np
import matplotlib.pyplot as plt
def iterate_map(f, x_0, n):
# extended for multi-dim case
# trajectory = [x_0] * (n+1)
traje... | themichaelyang/dynsys | hw-7.py | hw-7.py | py | 10,457 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "numpy.stack",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_numbe... |
34434213848 | import json
from pathlib import Path
import time
import glob
from argparse import ArgumentParser
import math
import tensorflow as tf
from tensorflow import keras
from airsim_gd.dataset.tf_dataset import TFCVDataset
from airsim_gd.vision.nn.utils import train_utils
from airsim_gd.vision.nn import fast_scnn
from airsim... | rachthree/AirSim_NeurIPS | airsim_gd/vision/nn/train.py | train.py | py | 7,650 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "airsim_gd.vision.nn.fast_scnn.generate_model",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "airsim_gd.vision.nn.fast_scnn",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 28,
"usage_type": "call"
... |
28816517343 | #!/usr/bin/env python
import time
import math
import rospy
from std_msgs.msg import Float64
from geometry_msgs.msg import Twist
from robot import RobotCalculator
class DeliveryRobot(object):
def __init__(self):
rospy.loginfo("CuriosityRoverAckerMan Initialising...")
self.calculator = RobotCalcula... | aioz-ai/IROS20_NMFNet | beetlebot-simulation/src/beetlebot_AIOZ/beetlebot_control/scripts/control_6_wheel_4_sterring.py | control_6_wheel_4_sterring.py | py | 6,806 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "rospy.loginfo",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "robot.RobotCalculator",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "rospy.Publisher",
... |
44109796842 | from pymongo import MongoClient, DESCENDING
import logging
class DataReceiver:
def __init__(self):
self.client = MongoClient('mongo')
self.db = self.client["wazuhl"]
self.rewards = self.db["rewards"]
def get_latest_rewards(self, last_n=0):
query = self.rewards.find(sort=[("step... | SavchenkoValeriy/wazuhl | dashboard/data_receiver.py | data_receiver.py | py | 753 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pymongo.DESCENDING",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "logging.info",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging.info",
... |
22915311016 | import jwt
import datetime
# Clave secreta para firmar y verificar el token (puede ser cualquier valor secreto)
clave_secreta = 'mi_clave_secreta'
# Función para generar un token JWT
def generar_token(datos):
# Definir fecha de expiración del token (en este caso, 1 hora desde ahora)
fecha_expiracion = datetim... | luiseliasdavid/py-Ortiz-v2 | varios/02.py | 02.py | py | 1,320 | python | es | code | 0 | github-code | 97 | [
{
"api_name": "datetime.datetime.utcnow",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "datetime.timedelta",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "jw... |
70929505598 | import pytest
import unittest.mock
from podcast_agent.services.supabase import SupabaseService
class TestSupabaseService:
@pytest.fixture
def mock_upload_file(self):
with unittest.mock.patch(
'podcast_agent.services.supabase.SupabaseService.upload_file',
new_callable=unittest.m... | jonmc12/podcast-agent | tests/test_supabase.py | test_supabase.py | py | 832 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "unittest.mock.mock.patch",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "unittest.mock.mock",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "unittest.mock",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "unittest.... |
28339860057 | from django.db import models
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.dispatch import receiver
class UserProfile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
age = models.IntegerField(default= 20)
longitude = model... | iliasTsiortas/GetAband | getaband/models.py | models.py | py | 1,252 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.db.models.Model",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.models.OneToOneField",
"line_number": 8,
"usage_type": "call"
},
{
"api_name... |
12582690148 | import sys
import json
import pickle
import argparse
from lop.nets.ffnn import FFNN
from lop.nets.linear import MyLinear
from lop.algos.bp import Backprop
from lop.algos.cbp import ContinualBackprop
from lop.utils.miscellaneous import *
def expr(params: {}):
agent_type = params['agent']
env_file = params['env... | shibhansh/loss-of-plasticity | lop/slowly_changing_regression/expr.py | expr.py | py | 4,889 | python | en | code | 41 | github-code | 97 | [
{
"api_name": "lop.nets.linear.MyLinear",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "lop.nets.ffnn.FFNN",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "lop.algos.bp.Backprop",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "lop... |
74217229120 | import numpy as np
from pathlib import Path
import shutil
import subprocess
import os
import h5py
from openquake.hazardlib.source.point import PointSource
from openquake.hazardlib.geo.point import Point
from openquake.hazardlib.geo.nodalplane import NodalPlane
from openquake.hazardlib.pmf import PMF
from openquake.haz... | pabloitu/nz_nshm2022_nonpoisson | hazard_lib.py | hazard_lib.py | py | 7,421 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.path.join",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "subprocess.call",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line... |
24353656741 | """Crawl game URLs in matchday data."""
import datetime
import urllib3
import certifi
import numpy as np
import pandas as pd
import multiprocessing as mp
from bs4 import BeautifulSoup
from bld.project_paths import project_paths_join as ppj
def get_soup_obj(url):
"""
Returns the soup object from a given url.... | mmaeh/Ethnic-Conflict-in-Football-and-Election-Results | src/data_management/football_data_management/get_game_urls.py | get_game_urls.py | py | 2,398 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "urllib3.PoolManager",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "certifi.where",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame"... |
24478233294 | import cv2 as cv
import matplotlib
import numpy as np
import random
matplotlib.use('Agg')
from itertools import cycle
from matplotlib import colors as mcolors
from matplotlib import pyplot as plt
from pls_classifier import PLSClassifier
from sklearn.metrics import auc
from sklearn.metrics import average_precision_sco... | rafaelvareto/HPLS-verification | auxiliar.py | auxiliar.py | py | 17,757 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "matplotlib.use",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "random.sample",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "numpy.random.shuffle",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"... |
26337052884 | """Functions to use inside of tests.
Contains functions for easily returning wanted values on service.
Also contains functions for validating values on a service.
"""
from typing import Any, Dict, Optional, cast
from emulation_system.compose_file_creator import BuildItem, Service
from emulation_system.compose_file_c... | Opentrons/opentrons-emulation | emulation_system/tests/validation_helper_functions.py | validation_helper_functions.py | py | 3,086 | python | en | code | 12 | github-code | 97 | [
{
"api_name": "tests.conftest.OT2_ID",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "tests.conftest.THERMOCYCLER_MODULE_ID",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "tests.conftest.HEATER_SHAKER_MODULE_ID",
"line_number": 28,
"usage_type": "na... |
15002304832 | '''
# RPC Cliente #
# Autores: Henrique Moura Bini e Vinicius Henrique Soares
# Data de criação: 15/11/2021
# Data de modificação: 18/11/2021
# Descrição: Implementação de um serviço de gerenciamento de notas que deve enviar informações via gRPC:
- LISTAR_ALUNOS (1): Tenta listar os alun... | VinnyHS2/SistemasDistribuidos | Atividade-04-RPC/grpc_python_gerenciadorNotas/client.py | client.py | py | 10,599 | python | pt | code | 2 | github-code | 97 | [
{
"api_name": "grpc.insecure_channel",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "gerenciamentoNotas_pb2_grpc.GerenciadorDeNotasStub",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "gerenciamentoNotas_pb2.ListarAlunosRequest",
"line_number": 37,
... |
42359212087 | import matplotlib as mpl
from matplotlib.colors import LightSource
from matplotlib.collections import PolyCollection
import matplotlib.gridspec as gridspec
import matplotlib.patches as patches
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
import numpy as np
import pandas as pd
... | mueller-lab/TwinNet | code/Scripts/twinnet_tools/tnplot.py | tnplot.py | py | 34,977 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "matplotlib.rcParams.update",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.cm.get_cmap",
"line_number": 29,
"usage_type": "call"
},
{
"api_na... |
74609392960 | import requests
import json
import os
from dotenv import load_dotenv
import time
import datetime
import pytz
# start timer to see how long it takes
start_time = time.time()
# Convert timestamp to human-readable format and Seattle timezone
seattle_tz = pytz.timezone('America/Los_Angeles')
start_dt = datetime.datetime.... | tillo13/microsoft_bot_framework | INTEGRATIONS/DIRECTLINE/interact_with_bot.py | interact_with_bot.py | py | 4,303 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "time.time",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pytz.timezone",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.fromtimestamp",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.date... |
2233821671 | # There should be a readme.md file bundled with this script. Please refer to it if you have any questions.
import math
import psycopg2
import time
from multiprocessing import Pool
from os import environ
from threading import Lock
# DEFINE THIS ENVIRONMENT VARIABLE BEFORE RUNNING!
# Obvs, this is the connection stri... | fedspendingtransparency/usaspending-api | usaspending_api/database_scripts/populate_awards_idv_columns/populate_awards_idv_columns.py | populate_awards_idv_columns.py | py | 6,656 | python | en | code | 265 | github-code | 97 | [
{
"api_name": "os.environ",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "threading.Lock",
"line_number": 95,
"usage_type": "call"
},
{
"api_name": "time.perf_counter",
"line_number": 104,
"usage_type": "call"
},
{
"api_name": "time.perf_counter",
... |
13461303326 | import html
import os
import base64
from telethon.tl.functions.messages import ImportChatInviteRequest as Get
from telethon.tl.types import MessageEntityMentionName
from requests import get
from telethon.tl.functions.photos import GetUserPhotosRequest
from telethon.tl.functions.users import GetFullUserRequest
from Arab... | telethonArab/Arab | Arab/plugins/الايدي.py | الايدي.py | py | 5,769 | python | en | code | 13 | github-code | 97 | [
{
"api_name": "Arab.core.logger.logging.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "Arab.core.logger.logging",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "sql_helper.globals.gvarstatus",
"line_number": 18,
"usage_type": "call"
},
... |
21645265126 | import pika
import time
from pymongo import MongoClient
print('Start')
time.sleep(10)
connection = pika.BlockingConnection(pika.ConnectionParameters(host='rabbit', port=5672))
channel = connection.channel()
channel.queue_declare(queue='hello')
client = MongoClient(host='database', port=27017)
db = client.mydb
collec... | AlexeyBursikov/industrial_programming | Project1/receive/receive.py | receive.py | py | 535 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "time.sleep",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pika.BlockingConnection",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pika.ConnectionParameters",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pymongo.Mon... |
21573229615 | # -*- coding: utf-8 -*-
# You can run the script with a CSV filename as an argument.
#
# python post-ocr.py IMG_20170602_120428.jpg.csv
from __future__ import print_function
import sys
import re, csv, datetime, os
import pdb
# print errors
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
def ... | okffi/finnish-parliament-visitors | post-ocr.py | post-ocr.py | py | 5,279 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "sys.stderr",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "re.search",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 76... |
22960728927 | from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import MovieViewSet, MovieSearchView, WatchlistDeleteView, CastViewSet, ReviewsViewSet, MovieByGenre, GenreViewSet, GetCastByMovie, WatchlistCreateView, GetReviewByMovie, RandomizeRatings, WatchlistDetailView, WatchlistSh... | vaibhavchandrana/imdb-clone | moviereviewer/urls.py | urls.py | py | 1,437 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "rest_framework.routers.DefaultRouter",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "views.MovieViewSet",
"line_number": 5,
"usage_type": "argument"
},
{
"api_name": "views.CastViewSet",
"line_number": 6,
"usage_type": "argument"
},
{
"ap... |
23949618742 | from typing import TYPE_CHECKING
from ...file_utils import (
_BaseLazyModule,
is_tokenizers_available,
is_torch_available,
)
_import_structure = {
"configuration_dkplm": ["DkplmConfig"],
"tokenization_dkplm": ["BasicTokenizer", "DkplmTokenizer", "WordpieceTokenizer"],
}
if is_tokenizers_availabl... | alibaba/EasyNLP | easynlp/modelzoo/models/dkplm/__init__.py | __init__.py | py | 2,329 | python | en | code | 1,835 | github-code | 97 | [
{
"api_name": "file_utils.is_tokenizers_available",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "file_utils.is_torch_available",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 34,
"usage_type": "name"
},
{
... |
1687262095 | from PyQt6.QtCore import QTimer
from PyQt6.QtGui import QDoubleValidator
from PyQt6.QtWidgets import QWidget, QLabel, QVBoxLayout, QPushButton, QGridLayout, QMessageBox, QLineEdit, QHBoxLayout
from widgets.color import Color
class LandingGearFrame(QWidget):
def __init__(self):
super(LandingGearFrame, sel... | leadsgroup/RCAIDE_GUI | tabs/geometry/frames/landing_gear_frame.py | landing_gear_frame.py | py | 3,770 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "PyQt6.QtWidgets.QWidget",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "PyQt6.QtWidgets.QVBoxLayout",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PyQt6.QtWidgets.QHBoxLayout",
"line_number": 16,
"usage_type": "call"
},
{
"ap... |
313906755 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Nov 24 14:24:04 2018
content similarity
@author: wentingyang
"""
import pandas as pd
import numpy as np
Dbase=pd.read_csv('Master_Data.csv',sep=',')
list_content=list(Dbase['Review'])
import gensim
print(dir(gensim))
raw_documents = list_content
pr... | zhuj10896/Detection-of-Fake-Reviews | detect the fake reviews/Data Cleaning Codes/ContentSimilarity.py | ContentSimilarity.py | py | 2,446 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "nltk.tokenize.word_tokenize",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "gensim.corpora.Dictionary",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": ... |
22261802371 | # -*- coding: utf-8 -*-
import socket, sqlite3, time, requests
from log import logger
def get_config():
conn = sqlite3.connect('./data.sqlite')
c = conn.cursor()
cursor = c.execute('SELECT IP_address, IP_port FROM "config" WHERE is_use = 1')
data = [[i for i in row] for row in cursor]
IP_address ... | xqzpgczy/LiangHua | run_cline_socket.py | run_cline_socket.py | py | 1,913 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sqlite3.connect",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "log.logger.info",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "log.logger",
"line_nu... |
73033928000 | import os
import typer
from experiment import load_yaml
from ml_collections import ConfigDict
main = typer.Typer()
def get_is_os_from_log(log_path: str):
r_is, r_os = None, None
with open(log_path, 'r') as f:
for line in f.readlines():
l = line.split(' ')
if l[3] == 'in_r2:':
... | bsitaru/project_ofi | results_table_maker.py | results_table_maker.py | py | 7,199 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "typer.Typer",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 50,
... |
4301923303 | # -*- coding: utf-8 -*-
"""
Created on Mon Jan 10 11:22:33 2022
@author: vpreemen
"""
from openpyxl import load_workbook
class data_xls:
def __init__(self, recipe):
self.recipe=recipe
self.datasize=0
self.sheet=self.recipe['Import (excel)']['general']['she... | oooVincentooo/datacombiner | dBup_IO_XLS.py | dBup_IO_XLS.py | py | 4,845 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "openpyxl.load_workbook",
"line_number": 36,
"usage_type": "call"
}
] |
16476021296 | from rest_framework.response import Response
from rest_framework.views import APIView
from django.contrib.auth import get_user_model
from app.models.MyUser import MyUser
from rest_framework import permissions
from app.mserializers.UserSerialziers import UserLearnProgressSerializer
User = get_user_model()
# from app.m... | nguyenvandai61/polyglot-world-server | app/auth/api_views.py | api_views.py | py | 3,151 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "rest_framework.views.APIView",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "rest_framework.permissions.IsAuthenticated",
"line_number": 14,
"usage_typ... |
29382353420 | #Youtube Search
from bs4 import BeautifulSoup as BS
import requests
import gdata.youtube
import gdata.youtube.service
import logging,pprint
class YtubeSearch:
def __init__(self, searchTerms, categoryTerms):
logging.info("YPaser s: %s c: %s" %(searchTerms, categoryTerms))
self.searchTerm = searchTe... | moomou/Searchimagery | YoutubeSearch.py | YoutubeSearch.py | py | 3,431 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.info",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "pprint.pprint",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "gdata.youtube.youtube.service... |
9527089593 | import numpy as np
import cv2
# use gstreamer for video directly; set the fps
#camSet='v4l2src device=/dev/video0 ! video/x-raw,framerate=30/1 ! videoconvert ! video/x-raw, format=BGR ! appsink'
#camSet='v4l2src device=/dev/video0 ! nvvidconv ! omxh265enc insert-vui=1 ! h265parse ! rtph265pay config-interval=1 ! udps... | alicehua11/w251_GSstreamer_quantization | misc/server.py | server.py | py | 1,757 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.VideoWriter",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_n... |
2239435660 | import time
import cheminfo
import ase
import numpy as np
import rmsd
from ase import units
from ase.io.trajectory import Trajectory
from ase.md.velocitydistribution import MaxwellBoltzmannDistribution
from ase.md.verlet import VelocityVerlet
from ase.md.nvtberendsen import NVTBerendsen
from ase.optimize import BFGS
fr... | andersx/qml-ase | narupa-qml.py | narupa-qml.py | py | 3,553 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "cheminfo.convert",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "rmsd.set_coordinates",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"li... |
12279766590 | import tkinter as tk
from tkinter import ttk
from PIL import Image, ImageTk
from playsound import playsound
from enemy import *
from item import *
from inventory import *
from item import Item
from magic import *
class BattleEncounter(tk.Tk):
def __init__(self, enemy, *args, **kwargs):
tk.Tk.__init__(sel... | cm-l/battler-rpg | main.py | main.py | py | 9,678 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "tkinter.Tk",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "tkinter.Tk.__init__",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "tkinter.Tk",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "tkinter.Frame",
... |
31951029118 | import numpy as np
import pandas as pd
import logging
from data_ingestion import DataUtils
import nltk
import re
from nltk.stem import WordNetLemmatizer
from nltk.stem import PorterStemmer
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
from nltk.tokenize import sent_tokenize
from n... | Kirti1807/Jigsaw-Toxic-Comments-Severity-Using-ML | src/data_processing.py | data_processing.py | py | 7,648 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "application_logger.CustomApplicationLogger",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "nltk.stem.PorterStemmer",
"line_number": 98,
"usage_type": "call"
},
{
"api_name": "nltk.stem.WordNetLemmatizer",
"line_number": 111,
"usage_type": "call"... |
11158628356 | from session import Session
import structlog
log = structlog.get_logger()
class SessionManager:
instance = None
def __init__(self):
self.next_session_id = 1
self.sessions = {}
def create_session(self, user):
session = Session(self.next_session_id, user)
self.sessions[self... | opencord/voltha | netconf/session/session_mgr.py | session_mgr.py | py | 877 | python | en | code | 77 | github-code | 97 | [
{
"api_name": "structlog.get_logger",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "session.Session",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "session.session_id",
"line_number": 20,
"usage_type": "attribute"
}
] |
20001040336 | #!/usr/bin/env python
""" tools
A collection of functions to create a gridded bathymetry.
"""
import numpy as np
import os
import pandas as pd
import xarray as xr
def read_grid(fname):
"""Read output grid"""
grd = xr.open_dataset(fname)
return grd
def ll2xyz(lon, lat, R=6371000):
"""
Calcula... | christophrenkl/oi_bathymetry | src/tools.py | tools.py | py | 2,719 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "xarray.open_dataset",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.radians",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.radians",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line... |
71527224000 | import random
import requests
import struct
import sys
from base64 import urlsafe_b64encode
# The DNS HEADER
# Reference: https://www.rfc-editor.org/rfc/rfc1035
#
# 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
# +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
# | ID ... | cstromblad/dns_doh | dns_doh/client.py | client.py | py | 2,546 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "struct.pack",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "struct.pack",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "struct.pack",
"line_number... |
45168556552 |
#-----------------------------------------------------------------------------------------
# PACKAGES
import mics as mx
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from simtk import unit
#-----------------------------------------------------------------------------------------
# SWIT... | atoms-ufrj/jctc-lbf-paper | Concerted LBF Pathway/Results/analysis.py | analysis.py | py | 3,696 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "simtk.unit.kelvin",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "simtk.unit",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "simtk.unit.MOLAR_GAS_CONSTANT_R",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name":... |
72621082240 | import os
import tensorflow_transform as tft
import tensorflow_data_validation as tfdv
import apache_beam as beam
import tensorflow_transform.beam as tft_beam
from tensorflow_transform.tf_metadata import dataset_metadata
from tensorflow_transform.tf_metadata import schema_utils
from src.preprocessing import transfor... | GoogleCloudPlatform/professional-services | examples/vertex_mlops_enterprise/src/preprocessing/etl.py | etl.py | py | 6,561 | python | en | code | 2,602 | github-code | 97 | [
{
"api_name": "json.dumps",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "apache_beam.pipeline.PipelineOptions",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "apache_beam.pipeline",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_nam... |
14644935641 | import json, sys, os
import tokenizers
sys.path.append("rwkv")
import rwkv_cpp_model, rwkv_cpp_shared_library, sampling
model_path = "release.bin"
library = rwkv_cpp_shared_library.load_rwkv_shared_library()
model = rwkv_cpp_model.RWKVModel(library, model_path)
tokenizer = tokenizers.Tokenizer.from_file("rwkv/20B_t... | resloved/friend | backend/app.py | app.py | py | 1,366 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.path.append",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "rwkv_cpp_shared_library.load_rwkv_shared_library",
"line_number": 10,
"usage_type": "call"
},
{
"api_... |
7007385422 | from .stream import StreamList
def expand_wildcard(product, datasets):
if not "*" in product:
return [product]
if product.count("*") > 1:
raise ValueError("More than one wildcard in a product name is not supported!")
return [product.replace("*", ds) for ds in datasets]
def replace_from_d... | guitargeek/geeksw | geeksw/framework/ProducerWrapper.py | ProducerWrapper.py | py | 2,550 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "stream.StreamList",
"line_number": 58,
"usage_type": "argument"
}
] |
37256809294 | import argparse
import ConfigParser
import mysql.connector
import time
import sys, os, re
from context import NetworkAnalysis
import NetworkAnalysis.network_analysis as NA
def main():
options = parse_user_arguments()
get_interaction_ids_of_network(options)
def parse_user_arguments(*args, **kwds):
"""... | quimaguirre/NetworkAnalysis | scripts/get_interaction_id.py | get_interaction_id.py | py | 5,596 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "os.path",
"line... |
70420329279 | import numpy as np
#%%
np.random.seed(0)
x1 = np.random.randint(10, size=6)
x2 = np.random.randint(10, size=(3,4))
x3 = np.random.randint(10, size=(3,4,5))
# %%
print(x1.ndim)
print(x2.ndim)
print(x3.ndim)
print(x3.shape)
print(x3.size)
print(x3.dtype)
# %%
x1
x1[0]
# %%
x2[0]
x2[0,0]
# %%
x2[2,-1]
# %%
x1[0]
# %%
... | zh805/pest_data_analyze | data_analyze_learning/numpy_learn/numpy_shuzu.py | numpy_shuzu.py | py | 1,650 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.random.seed",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.randint",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.random",
... |
18889322513 | from bs4 import BeautifulSoup
import requests
url = "http://www.homes.com/"
querystring = {"uri":"property/3501-lafayette-blvd-norfolk-va-23513/id-400028660479/"}
response = requests.request("GET", url, params=querystring)
#print(response.text)
soup = BeautifulSoup(response.text)
print(soup)
# images = soup.find... | NickRance/homesapi | testapi.py | testapi.py | py | 346 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.request",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 13,
"usage_type": "call"
}
] |
9833106682 | from django.contrib import admin
from django.urls import path, include
from app import views
urlpatterns = [
path('purchase/', views.purchase),
path('sales/', views.sales),
path('purchaseprocess/', views.purchaseprocess),
path('getitems/', views.getItems),
path('getinventoryppi/', views.getInventor... | albert-sobreo/moving-average-prototype | app/urls.py | urls.py | py | 415 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "app.views.purchase",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "app.views",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.urls.path",
... |
23333576421 | from flask import Flask, jsonify, request, render_template
import flask
import requests
import json
import time
app = Flask(__name__)
wx_key = "2ebe5c322a838055b074c4ed70d7693b"
@app.route("/")
def home():
return render_template("index.html")
@app.route("/currentweather/<lat>/<lon>")
def currentweather(lat,lo... | MikeT9/Airport-Weather-Map | Fatima's Folder/app.py | app.py | py | 1,401 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"li... |
28775642831 | import pickle
# pickle_in = open('/home/ying/Documents/VM2/keywordsforelastic.pickle','rb')
# im2ents,im2nonents,im2keywords = pickle.load(pickle_in)
# im2entnonent ={}
# for im, toekns in im2ents.items():
# keywords ={}
# keywords['entity'] = toekns
# keywords['non_entity'] = im2nonents[im]
#
# im2entn... | alleriali/Mood-Image-Search | data.py | data.py | py | 3,820 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "spacy.load",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "nltk.stem.WordNetLemmatizer",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "pickle.load",
... |
26482963867 | ############### Blackjack Project #####################
############### Our Blackjack House Rules #####################
## The deck is unlimited in size.
## There are no jokers.
## The Jack/Queen/King all count as 10.
## The the Ace can count as 11 or 1.
## Use the following list as the deck of cards:
## car... | Arindam02/Python_Projects | Black-Jack Project/main.py | main.py | py | 2,719 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "random.choice",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "art.logo",
"line_number": 48,
"usage_type": "argument"
}
] |
3347422528 | from pyautogui import getWindowsWithTitle, screenshot, press, keyDown, keyUp
import pyscreeze
import cv2
import numpy as np
from collections import deque
import time
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
class Critic(nn.Module):
def __ini... | Uggeli/omf_projecti | testi2.py | testi2.py | py | 3,185 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "torch.nn.Module",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"lin... |
9598180831 | from torch import nn
import torch
from torch.nn import functional as F
class ShadowNet(nn.Module):
def __init__(self):
super(ShadowNet, self).__init__()
self.relu = nn.ReLU()
self.conv1 = nn.Conv2d(3, 12, 5, padding=2)
self.bn1 = nn.BatchNorm2d(12)
self.conv2 = nn.Conv2d... | lahavlipson/Shadow_From_Shading | shadow_net.py | shadow_net.py | py | 1,434 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "torch.nn.Module",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.nn.ReLU",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number... |
33772936493 | import numpy as np
import argparse
import imutils
import cv2
global gray,rX,rY
def updateRX(val):
global rX
rX = val-midX
cv2.imshow("Gray",imutils.translate(gray,rX,rY))
def updateRY(val):
global rY
rY = val-midY
cv2.imshow("Gray",imutils.translate(gray,rX,rY))
def scaleC(val):
global gra... | gopinathdanda/j-vision | opencvFrec/test.py | test.py | py | 1,346 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "cv2.imshow",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "imutils.translate",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "imutils.translate",
"line... |
7007377352 | import numpy as np
from scipy.special import erf, erfc, gamma
def gaus(x, A, mu, sigma):
"""A scaled normal distribution.
"""
return A * np.exp(-0.5 * ((x - mu) / sigma) ** 2)
def crystalball(x, a, n, xb, sig):
"""A scaled crystal ball distribution, i.e. a Gaussian with a power law for the left tail... | guitargeek/geeksw | geeksw/fitting/functions.py | functions.py | py | 4,131 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "numpy.exp",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 23,
... |
8324183421 | # <libraries>
import nltk
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
import logging
from wakeonlan import send_magic_packet
import sys,os
from pyHS100 import SmartPlug, SmartBulb
from pprint import pformat as pf
# </libraries>
# <global settings>
#setting up the TPLink plug
plu... | apakrash/python-telegram-bot | chatbot.py | chatbot.py | py | 4,651 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pyHS100.SmartPlug",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "logging.getLo... |
41214477130 | import time
import undetected_chromedriver.v2 as uc
from selenium.webdriver.common.by import By
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
if __name__ == '__main__':
driver = uc.Chrome(version_main=107)
action = ActionChains(driver)
driver.get("https:... | pablooc96/ProyectoCalidadSoftwareG6 | Codigo/5-servicios.py | 5-servicios.py | py | 775 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "undetected_chromedriver.v2.Chrome",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "undetected_chromedriver.v2",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.common.action_chains.ActionChains",
"line_number": 11,
"u... |
21130974789 | import collections.abc
import contextlib
import io
import typing
from timeit import default_timer
from typing import Collection
import urllib3.connectionpool
import wrapt
from opentelemetry import context
# FIXME: fix the importing of this private attribute when the location of the _SUPPRESS_HTTP_INSTRUMENTATION_KEY... | open-telemetry/opentelemetry-python-contrib | instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/__init__.py | __init__.py | py | 10,040 | python | en | code | 527 | github-code | 97 | [
{
"api_name": "opentelemetry.util.http.get_excluded_urls",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "typing.Callable",
"line_number": 38,
"usage_type": "attribute"
},
{
... |
27454191054 | from django.shortcuts import render, redirect
from django.contrib.auth import login
from django.contrib.auth.forms import UserCreationForm
def logged_out(request):
"""Pizzas homepage"""
return render(request, 'users/logged_out.html')
def register(request):
""""New user registration"""
if request.met... | yauheniordynets/pizzeria | users/views.py | views.py | py | 692 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.shortcuts.render",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.forms.UserCreationForm",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.forms.UserCreationForm",
"line_number": 16,
"usage_... |
74183872318 | import requests
from bs4 import BeautifulSoup
import sys
# recebendo valor para a variavel atravez de argumentos. ex: python recon.py http://luci-lua.tk/
url = sys.argv[1]
tag = input("tag: ")
req = requests.get(str(url))
print("Status: ", req.status_code)
html = BeautifulSoup(req.content, 'html.parser')
def res... | LuciLua/pythonStudies | pythonfiles/recon.py | recon.py | py | 661 | python | pt | code | 0 | github-code | 97 | [
{
"api_name": "sys.argv",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 13,
"usage_type": "call"
}
] |
21287137443 | import asyncio
import datetime
import json
import random
import requests
url = "http://10.192.0.2:30260/api/metrics/"
for i in range(25000):
data = {
"run_id": 1,
"name": "test_metric @ {}".format(0), # random.randint(0, 7)),
"cumulative": False,
"date": str(datetime.datetime.now... | mlbench/mlbench-dashboard | src/utility_scripts/write_dummy_data.py | write_dummy_data.py | py | 1,647 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "datetime.datetime.now",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "random.random",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "requests.p... |
20330941891 |
import curses
from MegaEditor import MegaEditor
class MegaTab:
def __init__(self, maxy, maxx, window, id, title, pos_x, is_active = False):
self.id = id
index = title.rfind("/")
if index == -1:
self.title = title
else:
self.title = title[index+1:]
... | sanketd617/MegaEditor | MegaTab.py | MegaTab.py | py | 1,278 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "MegaEditor.MegaEditor",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "curses.panel.new_panel",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "curses.panel",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "curses... |
17673318725 | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from matplotlib import cm
from matplotlib.colors import Normalize
from sklearn import preprocessing
from sklearn.linear_model import LogisticRegression
from sklearn.mixture import GaussianMixture
df = pd.read_csv("data/iris.csv")
x = df.drop('X_3',... | neemashahbazi/Distrust | code/old_code_expired.py | old_code_expired.py | py | 1,829 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.MinMaxScaler",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing",
"line_number": 15,
"usage_type": "name"
},
{
"api_name... |
30146738439 | #!/usr/bin/env python
# license removed for brevity
import os
import rospy
from std_msgs.msg import String
from sensor_msgs.msg import Image
from vision_msgs.msg import Detection2DArray
import argparse
import glob
import cv2
from cv_bridge import CvBridge
parser = argparse.ArgumentParser(description='Evaluator.')
par... | miguelriemoliveira/zmq_image_transmission | scripts/evaluator.py | evaluator.py | py | 2,992 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "rospy.Publisher",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sensor_msgs.msg.Image",
"line_number": 23,
"usage_type": "argument"
},
{
"api_name": "ros... |
27737604110 | import json
from lxml import etree
from urllib.parse import urlparse
from datetime import datetime
class MSRecordParser:
def __init__(self, xml):
"""
Create a Metashare record object.
:param xml: an lxml object, representing a CMDI record
"""
self.xml = xml
def _get_l... | CSCfi/Kielipankki-Metax-bridge | harvester/metadata_parser.py | metadata_parser.py | py | 9,807 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "urllib.parse.urlparse",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "urllib.parse.urlparse",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 65,
"usage_type": "call"
},
{
"api_name":... |
2744862529 | import pyrealsense2 as rs
def main():
# Inicializa el dispositivo RealSense
pipeline = rs.pipeline()
config = rs.config()
config.enable_stream(rs.stream.depth, 640, 480, rs.format.z16, 30)
config.enable_stream(rs.stream.color, 640, 480, rs.format.bgr8, 30)
pipeline.start(config)
# Obtiene ... | CarlosAHzBt/Punto-Minimo-PLY | densidad.py | densidad.py | py | 1,021 | python | es | code | 0 | github-code | 97 | [
{
"api_name": "pyrealsense2.pipeline",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pyrealsense2.config",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pyrealsense2.stream",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pyrea... |
37291773867 | import json
import os
from flask import Flask, request, redirect, render_template, session
from flask_bootstrap import Bootstrap
import spotipy
import spotipy.oauth2
from appdirs import user_cache_dir
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test.db'
app.secret_key = "YOUR OWN SE... | IlyasI/statsify | statsify.py | statsify.py | py | 5,505 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask_bootstrap.Bootstrap",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.redirect",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "flask.request.ar... |
13513153070 | '''
@ ! D:/Python366
@ -*- coding:utf-8 -*-
@ Time: 2019/7/19, 10:50
@ Author: LiangHongli
@ Mail: l.hong.li@foxmail.com
@ File: validation_mapping1.py
@ Software: PyCharm
读MERSI L1数据,自行做云检测等处理,用训练好的模型预测,并和原始的MODIS分布做比较
'''
from pathlib import Path
import numpy as np
import read_files as rf
import drawing_mapping_funcs... | LiangHongli1/sate_sand | aod_retrieval/validation_mapping1.py | validation_mapping1.py | py | 3,392 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "pathlib.Path",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "h5py.File",
"line_number": 3... |
7836747392 | import tensorflow as tf
from tensorflow.keras import backend as K
K.set_image_data_format('channels_last')
from constants.AI_params import TrainingParams
from io_project.read_utils import stringToArray
from constants_proj.AI_proj_params import *
from metrics_proj.isop_metrics import swstate_tf
import pandas as pd
impor... | olmozavala/subsurfacefields | proj_metrics.py | proj_metrics.py | py | 7,510 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "tensorflow.keras.backend.set_image_data_format",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.backend",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "constants.AI_params.TrainingParams.batch_size",
"line_number": 23,
... |
5646772662 | from ctypes import *
import os
import numpy as np
#import seaborn
###################
#引入包缩减
import json
import pandas
from pandas import DataFrame
###################
import datetime
import time
import pymysql as mdb
#import matplotlib.pyplot as plt
import matplotlib.dates as mdates
from matplotlib.figu... | nowstartboy/git-demo | method.py | method.py | py | 99,683 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "os.getcwd",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 30,
... |
37446023929 | import sys
import sqlite3
import pandas as pd
import re
from sqlalchemy import create_engine
def load_data(messages_filepath, categories_filepath):
''' Load data into pandas dataFrame
parameters:
messages_filepath: The path to the messages csv file
categories_filepath: The path to the message ... | kate-asarar/DisasterResponseMaster | data/process_data.py | process_data.py | py | 3,047 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.merge",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.Series",
"lin... |
7826525313 | import os
import dotenv
from flask import Flask, request, jsonify
import controllers.wallet as wallet
import controllers.transaction as transaction
dotenv.load_dotenv(verbose=True)
app = Flask(__name__)
FLASK_PORT = os.getenv("FLASK_PORT")
@app.route("/")
def hello():
return "Hello World!"
@app.route("/api/... | PyClin/gg | app/main.py | main.py | py | 1,623 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.request.get_json",
... |
6562515910 | import json
import base64
import io
import pathlib
import gpxpy
import numpy as np
import pandas as pd
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import plotly.express as px
Re_km = 6371
external_stylesheets = ['https://codepen.io/ch... | mshumko/gpxvis | gpxvis/app.py | app.py | py | 7,006 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "dash.Dash",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "plotly.express.set_mapbox_access_token",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "plotly.... |
7384690167 | import csv
from avro.datafile import DataFileReader
from avro.io import DatumReader
def convert_to_csv(args):
avro_file_name = args.in_file
csv_file_name = args.out_file
reader = DataFileReader(open(avro_file_name, "rb"), DatumReader())
try:
with open(csv_file_name, 'w') as csvfile:
... | Davidzrbb/converterCsvAvro | src/avro2csv.py | avro2csv.py | py | 895 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "avro.datafile.DataFileReader",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "avro.io.DatumReader",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "csv.QUOTE... |
37395976399 | # -*- coding: utf-8 -*-
import json
import re
import time
import traceback
import sys
import bitly_api
from bs4 import BeautifulSoup
import pafy
import requests
from twisted.python import log
import plugins.PluginBase as pb
class URL(pb.LinePlugin, pb.CommandPlugin):
GOOGLE_SHORTEN = 'https://www.googleapis.com/u... | genericpersona/BaneBot | plugins/URL.py | URL.py | py | 4,947 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "plugins.PluginBase.LinePlugin",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "plugins.PluginBase",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "plugins.PluginBase.CommandPlugin",
"line_number": 17,
"usage_type": "attribute"
}... |
42080944959 | from collections import defaultdict
import pandas as pd
import tensorflow as tf
import numpy as np
import matplotlib.pylab as plt
import seaborn as sns
sns.set_style("darkgrid", {"axes.facecolor": ".9"})
# read ES
path = '~/github/artificial_life/algorithms/evolution/checkpoints/DeadlyColony-v0/ep_stats.csv'
es_df ... | jpiabrantes/artificial_life | replay/tensorboard_reader.py | tensorboard_reader.py | py | 6,650 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "seaborn.set_style",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "collections.... |
17104967502 | import cv2
import os
import numpy as np
from PIL import Image
from datetime import datetime
import subprocess
import face_recognition
import numpy
import exifread
SQUARE_IMG_SIZE = 512
WHITE_BORDER_SIZE = 0.5 #in percents
MAX_PREVIEW_TABLE_ROWS = 5
def create_preview(path, image_id, use_blackpage=True):
... | qmaster0803/telegram_gallery_bot | photos_module.py | photos_module.py | py | 5,885 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "cv2.imread",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.copyMakeBorder",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "cv2.BORDER_CONSTANT",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "cv2.copyMakeBo... |
23193473105 | from django.shortcuts import render
from app3_1.forms import PersonForm
from app3_1.models import Person
# Create your views here.
def index(request):
pform1 = PersonForm()
if request.method=='POST':
# Accept value from form
pid = request.POST.get('pid')
name = request.POST.get('fullna... | krishnadreamersit/PythonDjango-3 | Mysite301/app3_1/views.py | views.py | py | 676 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "app3_1.forms.PersonForm",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "app3_1.models.Person",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "d... |
40617044313 | import pygame
pygame.init()
window_width=700
window_height=400
BLACK = (0, 0, 0)
FPS=30
size = (window_width, window_height)
screen = pygame.display.set_mode(size)
pygame.display.set_caption("Hello Scrolling Background")
run = True
clock = pygame.time.Clock()
background_image0 = pygame.image.load("bg0.jpg")... | shilpasayura/python | pygame/bgx/bgxy.py | bgxy.py | py | 885 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "pygame.init",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pygame.display... |
23330813791 | #!/usr/bin/python
import arcpy
import os, sys
from arcgis.gis import GIS
import time
import sys
from datetime import datetime
import logging
# CONFIGURAR---------------------------
# configurar espacio de trabajo
base = r'D:\arcgis\projects\arcmeteo-v1.2'
logdir= os.path.join(base,"_logs")
#Config... | twpjlnavarro/arcmeteo | code/arcmeteo-v1.2.py | arcmeteo-v1.2.py | py | 8,917 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.path.join",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "logging.basicConfig",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"lin... |
36645894188 | import random
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.preprocessing import MinMaxScaler
from sklearn.tree import DecisionTreeClassifier
from sklearn.model_selection import train_test_split
from sklearn import metrics
from sklearn.tree import export_graph... | or10cohen/TestGithub1 | PreProccesingAdaBoost.py | PreProccesingAdaBoost.py | py | 7,250 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "colorama.init",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
... |
5935727078 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author : Youcef KACER <youcef.kacer@gmail.com>
# License: BSD 3 clause
from __future__ import print_function
import pandas as pd
import numpy as np
from sklearn.preprocessing import OneHotEncoder,LabelEncoder
from sklearn.metrics import r2_score
from sklearn.cross_vali... | ykacer/CES_Data_Scientist_2016 | 25_projet_data_scientist/code/python/ndvi_regression.py | ndvi_regression.py | py | 11,732 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "numpy.log",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "sklear... |
30077565172 | # !/bin/env python
from tools.Log import ERR, INFO
from tools import Selector
import Config
def get_exec_function():
EXEC_FUNCTION = {
"GET": get_exec,
"SET": set_exec,
"RENAME": rename_exec,
"DEL": del_exec,
"CP": cp_exec
}
return EXEC_FUNCTION
def get_exec(ma... | ExxactRobotics/compo | src/model_exec.py | model_exec.py | py | 3,604 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "tools.Log.INFO",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "tools.Log.INFO",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "tools.Log.ERR",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "tools.Log.ERR",
"line... |
34914480992 | import pytest
from linotp.lib.crypto.encrypted_data import EncryptedData
TEST_STRING = "test string to be encrypted"
# pylint:disable=redefined-outer-name
@pytest.fixture
def data():
"""
Fixture to return an instance of encryptedData
The unencrypted string is TEST_STRING
"""
instance = Encryp... | LinOTP/LinOTP | linotp/tests/unit/lib/crypto/test_encrypted_data.py | test_encrypted_data.py | py | 925 | python | en | code | 484 | github-code | 97 | [
{
"api_name": "linotp.lib.crypto.encrypted_data.EncryptedData",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "linotp.lib.crypto.encrypted_data.EncryptedData.from_unencrypted",
"line_nu... |
7597124803 | import shelve
import os
import PySimpleGUI as sg
import time
from datetime import datetime, date
def calculate_elapsed_time(time_1, time_2):
"""Calculates the difference, in minutes, of two times
Format of times are HH:MM"""
# Get the hours and minutes from each time
hours_1 = int(time_1[0:2])
mi... | Danpythonman/course_times | course_times_console.py | course_times_console.py | py | 4,134 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "shelve.open",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.Text",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.Button",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.Window",
... |
2346610688 | """
Matching communication network with email network in the MC3 dataset
"""
import dev.util as util
import matplotlib
import matplotlib.pyplot as plt
from model.GromovWassersteinLearning import GromovWassersteinLearning
import numpy as np
import pickle
from sklearn.manifold import TSNE
import torch
def heatmap(data,... | HongtengXu/gwl | visualize_mimic3.py | visualize_mimic3.py | py | 7,969 | python | en | code | 65 | github-code | 97 | [
{
"api_name": "matplotlib.pyplot.gca",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "numpy.arange",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
... |
19035158212 | import os
try:
import unittest.mock as mock
except ImportError:
import mock as mock
from ..test_utils import *
from .result_file import ResultFile
from . import DataSpec, write_int
class Dummy(ResultFile):
_SPEC_ = ()
_FILE_NAME_ = "default_name"
def __init__(self, arg=None):
super(Dumm... | Mesocopic/branchedflowsim | python/branchedflowsim/io/result_file_test.py | result_file_test.py | py | 5,564 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "result_file.ResultFile",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "result_file.ResultFile",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "mock.patch.object",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "mock.... |
44963183166 | """Steps implementation for following scenarios: reset user's environment in OpenShift.io."""
from behave import when, then
from features.src.resetEnv import ResetEnvironment
from pyshould import should
@when(u'I reset environment')
def when_reset_environment(context):
"""Reset the environment."""
resetEnv =... | fabric8io/fabric8-test | booster_bdd/features/steps/resetEnvironment.py | resetEnvironment.py | py | 689 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "features.src.resetEnv.ResetEnvironment",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "behave.when",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pyshould.should.equal",
"line_number": 20,
"usage_type": "call"
},
{
"api_name"... |
22059164717 | """
MacGregor Winegard
Date: 11/21/2021
This function graphs one trajectory in 3d
"""
import numpy as np
np.set_printoptions(threshold = np.inf)
import matplotlib.pyplot as plt
#https://stackoverflow.com/questions/1054271/how-to-import-a-python-class-that-is-in-a-directory-above
import pathlib
import sys
_parentdir = ... | mgw6/scaffold_learning | Py_Code/graphing/graph_1traj_3d.py | graph_1traj_3d.py | py | 873 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.set_printoptions",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.inf",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.path.insert",
... |
11657970321 | #!/usr/bin/env python
import os
from setuptools import find_packages, setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="mygeoparse",
version="0.0.9",
description='Malaysia Address Parser',
long_description=long_description,
long_description_cont... | azzan-amin-97/mygeoparse | setup.py | setup.py | py | 1,441 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "setuptools.setuptools.setup",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "setuptools.setuptools",
"line_number": 8,
"usage_type": "name"
}
] |
18544036805 | """mysite1 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-ba... | SpringSnowB/All-file | m3/django_/mysite1/mysite1/urls.py | urls.py | py | 1,536 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.conf.urls.url",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 23,
"usage_type": "name"
},
{
"api_name... |
13433695809 | from __future__ import print_function
import random
import shutil
import math
import itertools
import numpy as np
import tensorflow as tf
from tensorflow.models.rnn import rnn_cell
optimizers = {
1: tf.train.GradientDescentOptimizer(.1),
2: tf.train.AdadeltaOptimizer(),
3: tf.train.AdagradOptimizer(.0... | ethanabrooks/seq2seq | rnn.py | rnn.py | py | 5,861 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "tensorflow.train.GradientDescentOptimizer",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "tensorflow.train",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.train.AdadeltaOptimizer",
"line_number": 17,
"usage_type": "ca... |
33570930981 | import argparse
import time
import numpy as np
import math
from tqdm import tqdm
import torch
import torch.nn as nn
import torch.optim as optim
import matplotlib.pyplot as plt
from utils import makedirs
from utils import load_dataset
import torch.nn.functional as F
from torchdiffeq import odeint_adjoint as odeint
mak... | ajordana/CS-GY-6953-Project | unactuated_benchmark/res_model.py | res_model.py | py | 2,481 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "utils.makedirs",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "utils.makedirs",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "utils.makedirs",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"l... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.