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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9772069825 |
import os
import numpy as np
import pygame
import pygame.display as display
from util.planning2 import Plan
from util.sim import SimRobot, Simulation
from util.settings import Settings
TEXT_LEFT = 0
TEXT_RIGHT = 1
TEXT_CENTRE = 2
class Window:
def __init__(self):
# Setup canvas
self.width, self.h... | hhea0001/team-306 | Robot/util/window.py | window.py | py | 5,079 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pygame.display.set_mode",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "pygame.display.set_caption",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pyg... |
74899627103 | import argparse
import pickle
import gzip
import warnings
import json
from sklearn.preprocessing import LabelEncoder
from sklearn.naive_bayes import MultinomialNB
from sklearn.model_selection import train_test_split
from sklearn.metrics import f1_score
from sklearn.metrics import accuracy_score, confusion_matrix
from s... | halesirin/hathitrust_armeno_turkish | scripts/train_model.py | train_model.py | py | 5,009 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "warnings.simplefilter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "gzip.open",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "json.loads",
... |
34394858310 | """
Install script
modifications file: modifications.json, this structure (small example):
{
"old":
{
"tech_tree":
{
"basicRocketry":
{
"title":"#autoLOC_501020 //#autoLOC_501020 = Basic Rocketry",
"description":"#autoLOC_501023 //#autoLOC_501023 = How hard can Rocket Science be anyway?",
"cos... | 1s0m0rph/KSP_TechTreeModification | tech_tree_modify.py | tech_tree_modify.py | py | 23,734 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "re.compile",
"line_number": 121,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 122,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 123,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 1... |
21264061865 | import concurrent
import decimal
import json
from unittest.mock import MagicMock, patch
import pytest
from google.cloud.pubsub_v1 import PublisherClient
from google.cloud.pubsub_v1.exceptions import TimeoutError
from google.protobuf import timestamp_pb2
from rele import Publisher
from rele.client import Subscriber
fr... | mercadona/rele | tests/conftest.py | conftest.py | py | 2,942 | python | en | code | 197 | github-code | 7 | [
{
"api_name": "pytest.fixture",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "rele.config.Config",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "rele.confi... |
36713772806 |
from pydantic import BaseModel
class WaMessageResMessageSchema(BaseModel):
id: str = ""
class WaMessageResContactSchema(BaseModel):
input: str = ""
wa_id: str = ""
class WaMessageResponseSchema(BaseModel):
messaging_product: str = "whatsapp"
contacts: list[WaMessageResContactSchema] = []
messages: list[WaM... | rfsalman/whatsapp-gpt | src/whatsapp_webhook/schemas/api_schema.py | api_schema.py | py | 622 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pydantic.BaseModel",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 14,
"usage_type": "name"
}
] |
24559112807 | """KonkoAI chat wrapper."""
from __future__ import annotations
import logging
import os
from typing import (
Any,
Dict,
Iterator,
List,
Mapping,
Optional,
Set,
Tuple,
Union,
)
import requests
from langchain_core.callbacks import (
CallbackManagerForLLMRun,
)
from langchain_core... | langchain-ai/langchain | libs/community/langchain_community/chat_models/konko.py | konko.py | py | 10,588 | python | en | code | 68,990 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "langchain_core.language_models.chat_models.BaseChatModel",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 60,
"usage_type": "name"
},
{... |
29581662768 | import os
import random
from collections.abc import Iterable
import numpy as np
import pandas as pd
import torch
from sklearn.model_selection import StratifiedKFold
from skorch.dataset import ValidSplit, get_len
from skorch.utils import to_numpy
from survboard.python.utils.hyperparameters import ACTIVATION_FN_FACTORY... | BoevaLab/survboard | survboard/python/utils/utils.py | utils.py | py | 12,877 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "torch.all",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.where",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.rand",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_number": 21... |
70997954142 | # using python to write likelihood part.
import numpy as np
from scipy.interpolate import interp1d
from scipy.integrate import quad
from scipy.optimize import brute, fmin, minimize_scalar
from scipy.special import gammainc
import os
jfactor_path = "/home/jguo/workspace/data/Fermi_Data/"
dwarves_list = ['c... | JGuoHep/DMIDDThreeBody | pdindirect.py | pdindirect.py | py | 9,223 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.loadtxt",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.stack",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_numbe... |
15435391241 | from django.conf.urls import url
from authentication.views import AuthView, UserView, RegisterView, UserSearchView
urlpatterns = [
url(r'^auth$', AuthView.as_view(), name='authenticate'),
url(r'^register$', RegisterView.as_view(), name='register'),
url(r'^user', UserView.as_view(), name='user'),
url(r... | amylnikau/django-snippet | authentication/urls.py | urls.py | py | 386 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "authentication.views.AuthView.as_view",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "authentication.views.AuthView",
"line_number": 6,
"usage_type": "name"
},
{
... |
33117199706 | #! /usr/bin/env python3
import argparse
import gzip
import json
from players.heuristic_player import HeuristicPlayer
from players.random_player import RandomPlayer
from game.game import Game
def parse_args():
parser = argparse.ArgumentParser(
description="Play different players against each other.")
... | heikoschmidle/skat-zero | code/random-vs-heuristic.py | random-vs-heuristic.py | py | 961 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "gzip.open",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "players.heuristic_player... |
12735871383 | import pymongo
import csv
from pymongo import MongoClient
import pandas as pd
import numpy as np
cluster = MongoClient(
"mongodb+srv://andrew:1234@cluster0.pgi1d.mongodb.net/CalgaryTraffic?ssl=true&ssl_cert_reqs=CERT_NONE")
db = cluster["Test"]
# DATABASE COLLECTION REMOVAL
# db.trafficVolume2018.delete_many({})
... | brandonlowon/ENSF-592-Project-Part-1 | ENSF_592_Project_Phase_1_Database Writing.py | ENSF_592_Project_Phase_1_Database Writing.py | py | 2,203 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
... |
40186030188 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Python version: 3.6
import os
from skimage import io, transform
from PIL import Image
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import copy
import itertools
import pickle
import imageio
import numpy as np
import random
from collections impor... | Michelingweo/FedTripleGAN | server_test.py | server_test.py | py | 12,062 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "matplotlib.use",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.random.randint",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 52,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image.FLIP_L... |
19120790920 | # This program scrapes the top 20 most traded stocks on the stock market from Nasdaq.com
# It will further be implemented to be exported or optimized if possible
from bs4 import BeautifulSoup
from urllib.request import urlopen
from datetime import datetime
from xlrd import open_workbook
from xlwt import Workbook
from ... | alvinjiang32/Souppy | Proj_1.py | Proj_1.py | py | 4,055 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "datetime.datetime.now",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "urllib.request.urlopen",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "bs4.Be... |
36318143688 | import glob
import os
from conans import AutoToolsBuildEnvironment, ConanFile, tools
from conans.errors import ConanInvalidConfiguration
class LibbacktraceConan(ConanFile):
name = "libbacktrace"
version = "cci.20210118"
description = "A C library that may be linked into a C/C++ program to produce symboli... | junyang0412/cloe | vendor/libbacktrace/conanfile.py | conanfile.py | py | 2,886 | python | en | code | null | github-code | 7 | [
{
"api_name": "conans.ConanFile",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "conans.errors.ConanInvalidConfiguration",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "conans.tools.Git",
"line_number": 45,
"usage_type": "call"
},
{
"api_name... |
71587286305 | import unittest
import torch
from pyoptmat import scaling
class ScalingTests:
def test_forward_back(self):
actual = self.f.scale(self.x)
back = self.f.unscale(actual)
self.assertTrue(torch.allclose(self.x, back))
class TestBoundedScalingFunction(unittest.TestCase, ScalingTests):
d... | Argonne-National-Laboratory/pyoptmat | test/test_scaling.py | test_scaling.py | py | 819 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "torch.allclose",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "torch.tensor",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
... |
3604139090 | """
Establish which kind of Poker combination is present in a deck of five cards.
Every card is a string containing the card value (with the upper-case initial
for face-cards) and the lower-case initial for suits, as in the examples below:
"Ah" ➞ Ace of hearts
"Ks" ➞ King of spades
"3d" ➞ Three of diamonds
"Qc" ➞ Quee... | kopsha/python-1o1 | solved_exercises/dani/poker_hands.py | poker_hands.py | py | 4,557 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "collections.namedtuple",
"line_number": 40,
"usage_type": "call"
}
] |
30434519251 | from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, include
from drf_yasg.views import get_schema_view
from drf_yasg import openapi
schema_view = get_schema_view(
openapi.Info(
title="trello",
default_version="... | rokujs/trello-backend | trello_backend/trello/urls.py | urls.py | py | 1,014 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "drf_yasg.views.get_schema_view",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "drf_yasg.openapi.Info",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "drf_yasg.openapi",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": ... |
11596438586 | import math
import numpy as np
from grooming.Algorithm.NodeStructure import Nodestructureservices
from pydantic import BaseModel
from grooming.schemas import LowRateGrooming, GroomingLightPath, GroomingOutput, RemaningServices, GroomOutType, RoutingType, NodeStructure
from pulp import LpProblem, LpMinimize, LpVariable,... | farzad1132/netplanner-backend | grooming/Algorithm/grooming.py | grooming.py | py | 43,230 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pulp.LpProblem",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pulp.LpMinimize",
"line_number": 33,
"usage_type": "argument"
},
{
"api_name": "math.ceil",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_nu... |
25189379655 | #!/usr/bin/env python3
'''
Written by Justus Languell, 2020-2021, jus@gtsbr.org
See info.txt
'''
# Imports
import motors
import cv2
import numpy as np
import time
import wx
import pyautogui
import os
import argparse
# Define Constants
# Main Function, taking arg inputs
def main(color,flip,vid):
cap = cv2... | Juicestus/piai | color.py | color.py | py | 1,944 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "cv2.flip",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2HSV",
"line_... |
31147665249 | import toml
import wandb
import torch
import numpy as np
import pandas as pd
from torch.utils.data import DataLoader
from torch import nn, optim
from src.training import train_model
from src.data_utils import CellDataset
from src.model import ResUNet
from src.losses import FocalLoss, ExponentialLogarithmicLoss, MixedLo... | kumgleb/Sartorius-Cell-Instance-Segmentation | train.py | train.py | py | 2,699 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.cuda.empty_cache",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "wandb.init",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "toml.load",
"li... |
9212267233 | import paho.mqtt.client as mqtt
import time
import ast
import requests
from PIL import Image, ImageDraw
from ST7789 import ST7789
#setup display
SPI_SPEED_MHZ = 80
base_path = "/home/harmony/bt.p3.raspberry"
sleeping_gif_file = "/home/harmony/bt.p3.raspberry/assets/images/sleeping_dog.gif"
harmony_screen_file = "/home... | DaStru/bt.p3.raspberry | main.py | main.py | py | 4,783 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "ST7789.ST7789",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_num... |
71947316062 | import cocotb
import pyuvm.utility_classes as utility_classes
from pyuvm import *
import pytest
import inspect
from cocotb.utils import get_sim_time
@cocotb.test()
async def test_01_uvm_transaction_accept_time(dut):
"""
Test uvm_transaction accept time
"""
tr0 = uvm_transaction()
tr1 = uvm_transact... | pyuvm/pyuvm | tests/cocotb_tests/t05_base_classes/test.py | test.py | py | 1,919 | python | en | code | 247 | github-code | 7 | [
{
"api_name": "cocotb.triggers.Timer",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cocotb.triggers",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "cocotb.test",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cocotb.triggers... |
16885573077 | # Assignment 10
# Contact Tracing App
# - Create a python program that will read QRCode using your webcam
# - You may use any online QRCode generator to create QRCode
# - All personal data are in QRCode
# - You may decide which personal data to include
# - All data read from QRCode should be stored in a text file inc... | 0DanChristian/PLDassignment10 | QRC_scanner.py | QRC_scanner.py | py | 5,776 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "pyzbar.pyzbar.decode",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pyzbar.pyzbar",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "cv2.rectangle",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "cv2.rectangle",
... |
1613756979 | import datetime
counter = 0
for i in range(1901, 2001):
for j in range(1, 13):
d = datetime.datetime(i, j, 1)
if d.weekday() == 6:
counter += 1
print(counter)
| SamCreamer/project-euler-solutions | python3/problem19.py | problem19.py | py | 194 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "datetime.datetime",
"line_number": 7,
"usage_type": "call"
}
] |
16798069916 | from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
from torch.autograd import Variable
import torch.optim as optim
import torch.nn.functional as F
import torch.nn as nn
import torch
import numpy as np
import conllu
# Parse the data using the CoNLL-U format parser
train_data = conllu.parse(
o... | Abhi7410/NLP-Spring23 | Assignment2/pos_tagger.py | pos_tagger.py | py | 10,875 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "conllu.parse",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "conllu.parse",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "conllu.parse",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number... |
27002283789 | from django.http import HttpResponse
from django.shortcuts import render,reverse,redirect
from django.contrib.auth import authenticate, login, logout #user django already has auth
from model.scitc_login import login
import json
import os
from model.scitc_login import sql
mysql = sql()
def user_logout(request)... | SimonYYB/SCITC_JRXY_ByPython | campushoy/views/user.py | user.py | py | 3,054 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "model.scitc_login.sql",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.logout",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 12,
"usage_type": "call"
},
{
"api_nam... |
17593790893 | import enum
import os
import random
from functools import reduce
from itertools import zip_longest
import cocotb
from cocolight import DUT, ValidReadyTb, cocotest, concat_bv
from cocotb.binary import BinaryValue
NUM_TV = int(os.environ.get("NUM_TV", 100))
class Incomplete(enum.Enum):
Ignore = enum.auto()
Fi... | GMUCERG/LWC | hardware/unit_tests/tb_piso.py | tb_piso.py | py | 4,863 | python | en | code | 15 | github-code | 7 | [
{
"api_name": "os.environ.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "enum.Enum",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "enum.auto",
"line_n... |
29296581947 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import cPickle
from utils import read_probes, read_links, read_link_ids, read_link_lengths, read_probe_ids, read_probe_times
def main():
probe_file = 'data/probe_points.csv'
link_file = 'data/links.csv'
probes = read_probes(probe_file)
probe_ids = read_p... | zengweiyi1994/gvv-hw | hw3/transform.py | transform.py | py | 1,092 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "utils.read_probes",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "utils.read_probe_ids",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "utils.read_probe_times",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "utils.r... |
11316519782 | from flask import make_response, request,session
import pandas as pd
from flask_restful import Resource, Api, marshal_with, fields
from .database import db
from .models import *
from .tasks import export_csv
from werkzeug.exceptions import HTTPException
import json
from flask_login import current_user
from flask_secur... | Sharkum/MAD2_project | application/api.py | api.py | py | 4,718 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "werkzeug.exceptions.HTTPException",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "flask.make_response",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "werkzeug.exceptions.HTTPException",
"line_number": 19,
"usage_type": "name"
},
... |
39914472083 | import camelot
import os
print("Extracting tables from PDF, please wait...")
# path of source pdf
source_file = "./source/data-new.pdf"
# save them in a folder - if the folder doesn't exist, create it
output_folder = "tables"
if not os.path.isdir(output_folder):
os.mkdir(output_folder)
# extract al... | ogaroh/pdf_tables | replicate_tables.py | replicate_tables.py | py | 779 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.path.isdir",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "camelot.read_pdf",
"line_numb... |
73184962782 | import datetime
from tqdm import tqdm
import time
def get_date():
date = datetime.datetime.now()
date = str(date.strftime('%d/%m/%Y'))
return date
"""
total students roll numbers
can keep list of strings as roll numbers can also have alphabets
Example: 18H51A05A0
"""
master_data = [x for x in range(1, 11)... | cyber-titan/Attendance-Script | general_script.py | general_script.py | py | 1,440 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "datetime.datetime.now",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "time.sleep",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
... |
37069880386 | import numpy as np
from scipy.signal import firwin2, filtfilt
from .fft import rfftfreq, rfft, irfft
from .utils import _npads, _smart_pad, _trim
def _apply_notches(X, notches, rate, fft=True):
"""Low-level code which applies notch filters.
Parameters
----------
X : ndarray, (n_time, n_channels)
... | hlillemark/process_nwb | process_nwb/linenoise_notch.py | linenoise_notch.py | py | 2,257 | python | en | code | null | github-code | 7 | [
{
"api_name": "fft.rfftfreq",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "fft.rfft",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.logical_and",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "numpy.hamming",
"line_num... |
7639147305 | from DDCN_model_p import *
from DDCN_testing_PKU_100_per import *
from DDCN_testing_PKU_50_per import *
from DDCN_testing_PKU_10_per import *
import numpy as np
from copy import deepcopy
import sklearn.metrics
############ PATHS ############### please fix the paths
dataset_path = '/home/acw6ze/DDCN/data/PKU/data_PK... | Powercoder64/DDCN_SRM | run_script_PKU.py | run_script_PKU.py | py | 6,359 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "numpy.load",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.concatenate",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "numpy.concatenate",
"line... |
26202404124 | import os
import sys
import numpy as np
import torch
from torch import nn
import torch.nn.functional as F
class Cell(nn.Module):
def __init__(self, in_dim, hidden_dim, out_dim, activation_function=torch.tanh,
activation_function_out=F.relu, state_initializer=None):
super(Cell, self).__in... | semueller/asr | asr/cells.py | cells.py | py | 3,981 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "torch.tanh",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.functional.rel... |
73363443742 | # -*- coding: utf-8 -*-
"""
Created on Mon Oct 28 21:11:38 2019
@author: Paulo
"""
from PIL import Image
from nightmares.images_defines import GDOT_SAVE_FOLDER
from nightmares.utils import mkdirs
from os.path import join, isdir
from os import listdir as ls
import tqdm
OUTPUT_FOLDER = "C:/Users/Paulo/Desktop/Python s... | Kotzly/GarfieldNightmares | nightmares/convert.py | convert.py | py | 1,577 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "nightmares.images_defines.GDOT_SAVE_FOLDER",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "tqdm.tqdm",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "night... |
8138709802 | from json import dumps
from flask import Response
from flask import Blueprint, render_template
from .db import query_db
from .variables import genres as GENRES
scatter_routes = Blueprint('scatter_routes', __name__,
template_folder='templates')
@scatter_routes.route("/scatter/gross-time-... | tombakas/visualization_2 | app/scatter_routes.py | scatter_routes.py | py | 2,907 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Blueprint",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "variables.genres",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "flask.render_t... |
23854168717 | from losses import Loss
from layers import Layer
from tqdm import trange
class Network:
def __init__(self):
self.layers = []
self.loss = None
self.loss_prime = None
self.err_log = []
self.err_log_val = []
# add layer to network
def add(self, layer: Layer):
... | Ancouse/CMPE_460 | Week6/Week6_hw/neural_network.py | neural_network.py | py | 2,760 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "layers.Layer",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "losses.Loss",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "tqdm.trange",
"line_number": 50,
"usage_type": "call"
}
] |
34954437427 | # coding=utf-8
import requests
import json
# url = 'http://www.qq.com'
proxies = {'http': '118.31.220.3:8080'}
url = 'http://www.bisige8.com/forum.php'
params = {'x': '27835'}
headers = {'User-Agent': "(KHTML, like Gecko) Chrome/22.0.1207.1 Safari/537.1"}
response = requests.get(url, params=params, proxies=proxies, hea... | Mike-Strong/everedit | proxy/test.py | test.py | py | 363 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
}
] |
2569379475 | import struct
from io import BytesIO
structure = {
'source_port': ('>H', 2),
'destination_port': ('>H', 2),
'sequence_number': ('>I', 4),
'acknowledgment_number': ('>I', 4),
'data_offset': ('>H', 2), # read two bytes and fill flags structure ad well
'window_size': ('>H', 2),
'checksum': ('... | funnydman/toxic | toxic/core/utils/tcp_decoder.py | tcp_decoder.py | py | 3,275 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "io.BytesIO",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "struct.unpack",
"line_number": 22,
"usage_type": "call"
}
] |
73422696863 | import boto3
from pprint import pprint
aws_mag_console = boto3.session.Session(profile_name=None)
ec2_client = aws_mag_console.client(service_name="ec2", region_name="us-east-1")
response = ec2_client.describe_instances()['Reservations']
for each_item in response:
for each in each_item['Instances']:
pr... | Lforlinux/boto3-python | ec2-client.py | ec2-client.py | py | 570 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "boto3.session.Session",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "boto3.session",
"line_number": 4,
"usage_type": "attribute"
}
] |
8544087521 | import sys
from collections import deque
maximum = 100000
li = [0 for i in range(maximum+1)] # 이동거리를 저장하기 위한 배열
n, k = map(int,sys.stdin.readline().split())
queue = deque()
def bfs():
queue.append(n) # 시작점을 queue 에 저장한다.
while queue:
x = queue.popleft() # 이동거리를 x로 두고
... | kimkihoon0515/CodingTest | DFS 와 BFS/1697/1697.py | 1697.py | py | 814 | python | ko | code | 3 | github-code | 7 | [
{
"api_name": "sys.stdin.readline",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 7,
"usage_type": "call"
}
] |
14481051923 | import collections
n = int(input())
dic = []
for i in range(n):
dic.append(input())
c = collections.Counter(dic)
maxCount = max(c.items(), key=lambda x: x[1])[1]
maxWord = max(c.items(), key=lambda x: x[1])[0]
ans = []
for k, v in c.items():
if v == maxCount:
ans.append(k)
ans.sort()
for a in ans:
p... | comu2e/Atcoder | Python/train/abc155/c/main.py | main.py | py | 328 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "collections.Counter",
"line_number": 6,
"usage_type": "call"
}
] |
25084561115 | from typing import Sequence
from typing import Tuple
import tensorflow as tf
def tf_split_on_label(
dataset: tf.data.Dataset, labels_in: Sequence[int]
) -> Tuple[tf.data.Dataset, tf.data.Dataset]:
"""
Allows to split a tensoflow dataset in in-dataset and
out-dataset according to labels_in
Args:
... | deel-ai/deel_dataset_manager | deel/datasets/utils/tensorflow_utils.py | tensorflow_utils.py | py | 835 | python | en | code | 4 | github-code | 7 | [
{
"api_name": "tensorflow.data",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "typing.Sequence",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "tensorflow.data",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.re... |
1402051434 | import json
import math
from pandas.io.json import json_normalize
from src.data.fetch_trend_data_utils import display_max_cols, save_dictionary_to_csv
display_max_cols(10)
jfile = "/home/randilu/fyp_impact analysis module/impact_analysis_module/data/external/events/Kelani_Valley_Plantaitions_PLC_v2.json"
with open(jfi... | randilu/Impact-Analysis-Module-codebase | src/data/fetch_kw_format2.py | fetch_kw_format2.py | py | 1,742 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "src.data.fetch_trend_data_utils.display_max_cols",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.io.json.json_normalize",
"line_number": 12,
"usage_type": "call"
}
] |
72751433183 | """This module contains the raw datasets.
The datasets are loaded in memory to be reusable by other functions.
"""
from datetime import datetime
import polars as pl
from src.data.data_extract import (
get_bs_data,
get_company_data,
get_departement_geographical_data,
get_naf_nomenclature_data,
get... | MTES-MCT/trackdechets-public-stats | src/data/datasets.py | datasets.py | py | 897 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "src.data.data_extract.get_bs_data",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "src.data.data_extract.get_bs_data",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "src.data.data_extract.get_bs_data",
"line_number": 24,
"usage_type": ... |
15387261814 | import json
import shutil
from datetime import timedelta
from pathlib import Path
from typing import Union, List
from unittest import mock
import pytest
from django.conf import settings
from django.utils import timezone
from app_root.players.models import (
PlayerShipOffer,
PlayerFactory,
PlayerFactoryPro... | Gaolious/analysis-ts2-strategy | ts/app_root/strategies/tests/test_managers.py | test_managers.py | py | 22,822 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "typing.Union",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "app_root.users.models.User.obje... |
24560842477 | """Util that can interact with Zapier NLA.
Full docs here: https://nla.zapier.com/start/
Note: this wrapper currently only implemented the `api_key` auth method for testing
and server-side production use cases (using the developer's connected accounts on
Zapier.com)
For use-cases where LangChain + Zapier NLA is powe... | langchain-ai/langchain | libs/community/langchain_community/utilities/zapier.py | zapier.py | py | 11,666 | python | en | code | 68,990 | github-code | 7 | [
{
"api_name": "langchain_core.pydantic_v1.BaseModel",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "langchain_core.pydantic_v1.Extra.forbid",
"line_number": 50,
"usage_type": "attribute"
},
{
"api_name": "langchain_core.pydantic_v1.Extra",
"line_number": 50,
"... |
44252696865 | import sys
from collections import deque
#sys.stdin = open('input.txt','r')
N = int(input())
lattice = [list(map(int,input().split())) for _ in range(N)]
c = (N//2,N//2)
s = lattice[c[0]][c[1]]
queue = deque()
queue.append(c)
L = [(0,1),(1,0),(0,-1),(-1,0)]
chk_matrix = [[0]*N for _ in range(N)]
chk_ma... | sangmanjung/Algorithm_study | basic/S7_DFS_N_BFS/sec7-8.py | sec7-8.py | py | 689 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "collections.deque",
"line_number": 10,
"usage_type": "call"
}
] |
19063666076 | # -*- coding: utf-8 -*-
"""
中国海关总署————>进出口商品国别(地区)总值表
"""
# import asyncio
# from twisted.internet import asyncioreactor
# asyncioreactor.install(asyncio.get_event_loop())
import datetime
import re
import scrapy
from shannon_spider.util.notify import send_dingtalk
from shannon_spider.shannon_base_spide... | cxapython/catvm | selenium/shannon_spider/spiders/trading_table_spider.py | trading_table_spider.py | py | 7,002 | python | en | code | 30 | github-code | 7 | [
{
"api_name": "shannon_spider.shannon_base_spider.ShannonBaseSpider",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "shannon_spider.orm.trading_table.TradingTableItem",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "shannon_spider.shannon_base_spider.Shannon... |
40860251785 | import scrapy
import csv
import json
import re
from html.parser import HTMLParser
def remove_non_ascii(text):
return ''.join([i if ord(i) < 128 else '' for i in text])
class MLStripper(HTMLParser):
def __init__(self):
self.reset()
self.strict = False
self.convert_charrefs= True
... | nikhilgupta23/Scrapy-Codes | storyltd_spider.py | storyltd_spider.py | py | 6,485 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "html.parser.HTMLParser",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "html.parser",
"line_number": 23,
"usage_type": "argument"
},
{
"api_name": "scrapy.Spider",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "json.dump",... |
41231894210 | import time
import warnings
import numpy as np
import numba as nb
import pandas as pd
import torch
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader
from sklearn.metrics import mean_squared_error as mse_func, mean_absolute_error as mae_func
from citylearnutils.utils import seed_everything
N_DAYS =... | mattmotoki/neurips-citylearn2022-2nd-place-solution | scripts/2_create_demand_model.py | 2_create_demand_model.py | py | 13,920 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numba.njit",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "numba.njit",
"... |
20941226810 | import sys
import re
import json
mode = None # whether structure or content validation
pause_between_problems = False # extra option for verbose structure validation
output_bracketless = False # optional output to accompany verbose content validation
prompt_update_ngrams = False # option to accept all remaining "probl... | tylergneill/pramana-nlp | data_prep/4_segmentation/validate.py | validate.py | py | 9,237 | python | en | code | 8 | github-code | 7 | [
{
"api_name": "re.search",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 63,
"usage... |
2231391735 | import random
import urllib
from hello.domains import myRandom, memberlist
from quiz00 import Quiz00
import random
from bs4 import BeautifulSoup
from urllib.request import urlopen
import pandas as pd
class Quiz20:
def quiz20list(self) -> str: return None
def quiz21tuple(self) -> str: return None
def ... | sol2kwon/djangoProject_Python_1 | hello/quiz20.py | quiz20.py | py | 6,797 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "quiz00.Quiz00",
"line_number": 107,
"usage_type": "name"
},
{
"api_name": "hello.domains... |
31917214971 | """
Бот для записи времени по покрасу через телеграм
необходимый функционал:
- записать время
- сохранить фотку в запись времени
- сохранить фотку в модель
- обновить запись времени
- удалить запись времени
"""
import io
import logging
import re
from asgiref.sync import sync_to_async
from django.db.models import Max
f... | fantazey/home_api | work_in_progress/telebot/main.py | main.py | py | 16,354 | python | ru | code | 0 | github-code | 7 | [
{
"api_name": "logging.basicConfig",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "telegram.Update",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "telegram.ext.C... |
5822622435 | # 如果需要逆向的js函数的实现是出现在一个闭包中,那么直接将闭包的整个代码块拷贝出进行调试即可
import execjs
# 实例化一个node对象
node = execjs.get()
# js源文件编译
ctx = node.compile(open('./login.js', encoding='utf-8').read())
# 执行js函数
funcName = 'md5("{0}")'.format('123456')
pwd = ctx.eval(funcName)
print(pwd)
| xiaoxu123195/Reptile_Collection | 逆向/凡科网/login.py | login.py | py | 377 | python | zh | code | 0 | github-code | 7 | [
{
"api_name": "execjs.get",
"line_number": 4,
"usage_type": "call"
}
] |
28729737132 | # coding: utf-8
"""
Container Security APIs
All features of the Container Security are available through REST APIs.<br/>Access support information at www.qualys.com/support/<br/><br/><b>Permissions:</b><br/>User must have the Container module enabled<br/>User must have API ACCESS permission # noqa: E501
... | jlk/qualys-cs-python-client | qualys_cs_api/models/registry_repo_response.py | registry_repo_response.py | py | 6,256 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "qualys_cs_api.configuration.Configuration",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "six.iteritems",
"line_number": 158,
"usage_type": "call"
},
{
"api_name": "pprint.pformat",
"line_number": 180,
"usage_type": "call"
}
] |
20200277070 | import os
import argparse
import numpy as np
from data3d.utils.associate import associate
from pyquaternion import Quaternion
def arg_parse():
parser = argparse.ArgumentParser()
parser.add_argument('--source_path')
parser.add_argument('--colmap_path')
# dataset options
parser.add_argument('--s... | eriksandstroem/SenFuNet | data/mvs_depth_estimation/setup_colmap_corbs.py | setup_colmap_corbs.py | py | 5,352 | python | en | code | 11 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
... |
39300552216 | import cv2
import pyaudio
import wave
from pydub import AudioSegment
# Video parameters
width, height = 640, 480
frame_rate = 30
video_filename = 'output_video.mp4' # Changed file extension to MP4
# Audio parameters
FORMAT = pyaudio.paInt16
CHANNELS = 1
RATE = 44100
CHUNK = 1024
RECORD_SECONDS = 5
audio_filename = "... | Cyb3rKotl3Ta/programming_CDS | lab2/lab2_mp4_test.py | lab2_mp4_test.py | py | 1,861 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pyaudio.paInt16",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "cv2.VideoWriter_fourcc",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "cv2.Vide... |
8041210844 | import bs4 as bs
import requests
import datetime
import json
def scrapeBogiesBR():
try:
source = requests.get('http://www.bogiesbr.com/').text
soup = bs.BeautifulSoup(source, 'lxml')
# scrape specials and days from website using css selectors
days = soup.select('div.grid_3 h2')
... | arissi/TigerHopping | barlib/scrapeBogiesBR.py | scrapeBogiesBR.py | py | 1,743 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.date.today",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.date",
... |
39671000097 | from minesweeper import Minesweeper
import numpy as np
import random
import itertools
class MinesweeperAI(Minesweeper):
def __init__(self, nrows, ncols, nmins, print_board=True):
super().__init__()
self.nrows = nrows
self.ncols = ncols
self.nmines = nmins
self.print_board =... | Darinochka/ml_tinkoff_2021 | exam/6_task/ai.py | ai.py | py | 5,043 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "minesweeper.Minesweeper",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "numpy.zeros",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.meshgrid",
"... |
21028350618 | import itertools
import logging
from typing import Any, Dict, Iterator, List, Set
import more_itertools
from transformers import BertTokenizer
from allennlp.predictors import Predictor
from ft.onto.base_ontology import (
Token,
Dependency,
PredicateLink,
PredicateArgument,
PredicateMention,
)
from ... | asyml/forte-wrappers | src/allennlp/fortex/allennlp/allennlp_processors.py | allennlp_processors.py | py | 16,732 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "forte.processors.base.PackProcessor",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "forte.common.resources.Resources",
"line_number": 60,
"usage_type": "name"
},
{... |
16521153303 | import json
import requests
cities = [
"Thorigné-Fouillard",
"Combourg",
"Saint Aubin d'Aubigné", "Liffré", "Saint Aubin du Cormier",
"Feins", "Bonnemain","Val Couesnon",
"Pontorson", "La Mézière"
]
cities_data = {
"interest_points": {
... | TheoLaperrouse/Grafana_Trajet | routes/cities_data.py | cities_data.py | py | 973 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 27,
"usage_type": "call"
}
] |
27844253697 | import datetime
import os
import shutil
import tempfile
from unittest import mock
import pytest
import pytz
from testifycompat import assert_equal
from testifycompat import assert_in
from testifycompat import run
from testifycompat import setup
from testifycompat import teardown
from testifycompat import TestCase
fro... | Yelp/Tron | tests/config/config_parse_test.py | config_parse_test.py | py | 48,576 | python | en | code | 340 | github-code | 7 | [
{
"api_name": "tron.config.schema.ConfigSSHOptions",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "tron.config.schema",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "tron.config.schedule_parse.ConfigDailyScheduler",
"line_number": 58,
"usage_type":... |
10227142504 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('controller_setup', '0028_auto_20160207_1101'),
]
operations = [
migrations.AlterField(
model_name='linkusertopla... | mohkof1106/updated-modbus | controller_setup/migrations/0029_auto_20160209_1112.py | 0029_auto_20160209_1112.py | py | 1,566 | python | en | code | 0 | github-code | 7 | [
{
"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"
},
{... |
42067849369 | #!/usr/bin/env python
import webapp2
import json
import time
import logging
import uuid
from google.appengine.api import channel
from google.appengine.api import memcache
from google.appengine.api import users
#from google.appengine.ext import ndb
MC_LISTENING_CLIENTS="listening_clients_%s"
def add_listener(lid, ... | Agigen/GAE-WebRTC | main.py | main.py | py | 2,533 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "google.appengine.api.memcache.Client",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "google.appengine.api.memcache",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "google.appengine.api.memcache.set",
"line_number": 23,
"usage_type": "... |
30075423029 | import logging
# __name__によってファイルを参照して出力される。
logger = logging.getLogger(__name__)
# loggerの閾値(DEBUG以上のerrorを取得可能となる。)
logger.setLevel(logging.DEBUG)
# handlerの定義
# ターミナル上にエラーを出力
s_handler = logging.StreamHandler()
# ファイル上にエラーを出力(文字化け予防のため、utf-8を指定)
f_handler = logging.FileHandler('./logging/sample_2.log', encoding='ut... | masaya1017/test_tech | logging/sample_2.py | sample_2.py | py | 1,436 | python | ja | code | 0 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.FileH... |
28994290567 | # !/usr/bin/env python3
import asyncio
import asyncio.subprocess
import json
import logging
import os
import re
import shutil
from typing import Union
from requests import post
from utils.abema import abema_download
from utils.bgm_nfo import episode_nfo, save_nfo, subject_name, subject_nfo
from utils.bot import async... | Ukenn2112/TgChannelAnime | main.py | main.py | py | 7,086 | python | en | code | 6 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "logging.basicConfig",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "logging.FileH... |
1277315993 | # -*- coding: utf-8 -*-
"""
Fórmula de Newton-Cotes
"""
from scipy.integrate import quad
import numpy as np
def l(x, i, n, nodos):
arr = []
for j in range(i):
arr.append((x - nodos[j])/(nodos[i]-nodos[j]))
for j in range(i+1, n+1):
arr.append((x - nodos[j])/(nodos[i]-nodos[j])... | pedrobn23/PracticasMetodosII | P2/source/ejercicio2.py | ejercicio2.py | py | 898 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "numpy.prod",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "scipy.integrate.quad",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.log",
"line_num... |
25884927576 | import json
import os
import sys
from loguru import logger as log
from datetime import datetime
from collections import OrderedDict
from api.tesouro import BuySell
from api.utils import fake_file
class DataProcess:
@classmethod
def open_file(cls, file):
with open(file, 'rt') as f:
file ... | ceconelo/prices_rate_tesouro | core/data_process.py | data_process.py | py | 4,411 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "json.loads",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "loguru.logger.info",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "loguru.logger",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "loguru.logger.error",
... |
4756642743 | from django.contrib import admin
from greatdebate.apps.decisionMakers.models import DecisionMaker, DecisionMakerResponse
class DecisionMakerAdmin(admin.ModelAdmin):
fields = ('name','title')
list_display = ('name','title')
admin.site.register(DecisionMaker,DecisionMakerAdmin)
class DecisionMakerResponseAdmin(admi... | hackforchange/GreatDebate | greatdebate/apps/decisionMakers/admin.py | admin.py | py | 516 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.site.register",
"line_number": 7,
"usage_type": "call"
},
... |
71650405984 | # coding: utf8
# flux download
import datetime
import os
import re
import requests
import sys
import time
import unicodedata
import urllib
import config
from lxml import etree
from time import sleep
from urllib.request import urlopen
from classes.flux.flux import flux
from classes.flux.flux_manager import flux_mana... | el-crocorino/FIPD_Python | modules/flux_download/flux_download.py | flux_download.py | py | 6,176 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "config.get_conf",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "classes.flux.flux_manager.flux_manager",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "requests.head",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "... |
30267941005 | """
Asynchronous Task controller. Executes task on given cron time
"""
import time
import logging as log
from croniter import croniter, CroniterBadCronError
from tornado.ioloop import IOLoop
class AsyncCrontabTask(object):
"""
Asynchronous Task controller. Executes task on given cron time. No more than one a... | FCG-LLC/aucote | utils/async_crontab_task.py | async_crontab_task.py | py | 4,316 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "tornado.ioloop.IOLoop.current",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "tornado.ioloop.IOLoop",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "logging.error",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "log... |
14812325514 | #Connect to the dq database as the user dq.
#Write a SQL query that creates a table called users in the dq database, with the following columns and data types:
#id -- integer data type, and is a primary key.
#email -- text data type.
#name -- text data type.
#address -- text data type.
#Execute the query using the exec... | p-ambre/Postgres | sql_transactions.py | sql_transactions.py | py | 668 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "psycopg2.connect",
"line_number": 12,
"usage_type": "call"
}
] |
17069789655 | #!/usr/bin/env python3
"""Calculate the difference between geocodes and some truth data in a csv.
The input consistss of a truth csv (without a header) of imageId,lat,lng and some geocode_results.
The script checks to see how many of calculated lat, lngs are corrected in comparision to the
truth csv. Incorrect image i... | sidewalklabs/oldto | oldtoronto/corrections_metrics.py | corrections_metrics.py | py | 3,080 | python | en | code | 27 | github-code | 7 | [
{
"api_name": "calculate_metrics.diff_geocode",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "csv.DictReader",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "csv.writer",
... |
9720031688 | import asyncio
import datetime
import re
from collections.abc import Iterator
from typing import Collection
from unittest.mock import AsyncMock
from unittest.mock import MagicMock
from unittest.mock import patch
from uuid import UUID
from uuid import uuid4
import pytest
from fastramqpi.context import Context
from gql ... | magenta-aps/os2mo-ldap-import-export | tests/test_dataloaders.py | test_dataloaders.py | py | 78,666 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pytest.fixture",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 48,
"usage_type": "attribute"
},
{
"api_name": "unittest.mock.patch",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "unittest.mock.... |
23106179103 | import sys
from typing import Any, Dict, List, Optional, Tuple
import yaml
from irctokens import build, Line
from ircrobots import Bot as BaseBot
from ircrobots import Server as BaseServer
from ircrobots import ConnectionParams
from ircstates.numerics import *
from ircrobots.matching import (Response, Responses, ANY,... | jesopo/irctoolkit | freenode/aban_check/__init__.py | __init__.py | py | 4,707 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "ircrobots.matching.Nick",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "ircrobots.matching.Response",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "ircrobots.matching.SELF",
"line_number": 20,
"usage_type": "name"
},
{
"api_n... |
35325703212 | #
# file: bullenfunk.py
#
# coder: moenk
#
# required: selenium bindings and geckodriver for firefox
# postgresql with postgis
# twitter auth data
#
import sys
import math
import time
import os.path
import locale
import psycopg2
import subprocess
import pandas as pd
import numpy as np
import holida... | moenk/bullenfunk | bullenfunk.py | bullenfunk.py | py | 31,069 | python | de | code | 1 | github-code | 7 | [
{
"api_name": "sys.exit",
"line_number": 90,
"usage_type": "call"
},
{
"api_name": "locale.atof",
"line_number": 97,
"usage_type": "call"
},
{
"api_name": "numpy.diff",
"line_number": 111,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.ChromeOptions",
... |
37313123730 | import getmac
import netifaces
def get_router_mac():
gateways = netifaces.gateways()
default_gateway = gateways['default'][netifaces.AF_INET][0]
mac = getmac.get_mac_address(ip=default_gateway, network_request=True)
return mac
| YishaiHezi/LocatorShell | get_default_mac.py | get_default_mac.py | py | 256 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "netifaces.gateways",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "netifaces.AF_INET",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "getmac.get_mac_address",
"line_number": 8,
"usage_type": "call"
}
] |
3545066838 | """
Definition of urls for tutorial.
"""
from django.conf.urls import include, url
from rest_framework import routers
from quickstart import views
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
router = routers.DefaultRouter()
router.register(r'users', vi... | xbetter/DjangoRest | DjangoRESTFrameWork/tutorial/tutorial/urls.py | urls.py | py | 896 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "rest_framework.routers.DefaultRouter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "rest_framework.routers",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "quickstart.views.UserViewSet",
"line_number": 13,
"usage_type": "attribute"
... |
31823156431 | import re
import sh
from aibench.proto import base_pb2
from aibench.python.utils import sh_commands
from aibench.python.device.device import Device
from aibench.python.device.device import YAMLKeyword
class AdbDevice(Device):
def __init__(self, adb):
self.address = adb[0]
prop = self.get_props()... | XiaoMi/mobile-ai-bench | aibench/python/device/adb_device.py | adb_device.py | py | 1,884 | python | en | code | 337 | github-code | 7 | [
{
"api_name": "aibench.python.device.device.Device",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "aibench.python.device.device.Device.__init__",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "aibench.python.device.device.Device",
"line_number": 15,
... |
11564357495 | import h5py
import numpy as np
import matplotlib.pyplot as plt
import scipy
import scipy.signal
base = 'cut_5278/'
dat = [10, 20, 30, 40]
dat_2 = [0.05, 0.1, 0.15, 0.2, 0.3, 0.4]
idx = np.zeros((len(dat), len(dat_2), 25, 2024))
k=0
for j in dat:
o = 0
for yyy in dat_2:
for i in range(1, 26):
... | Giacomo-Roncoroni/HSZ | real_data/00_extract_data.py | 00_extract_data.py | py | 556 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.zeros",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "h5py.File",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "scipy.signal.resample",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "scipy.signal",
"line_... |
40840714408 |
import cv2
import matplotlib.pyplot as plt
# ...image reading and showing....
# image of jinks rahane (meme)
img_path1 = 'Screenshot from 2020-10-05 20-29-28.png'
#image of kl_rahul :)
img_path2 = 'kl_rahul.jpg'
img = cv2.imread(img_path2,1)
grey_img = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
face_cascade = cv2.Casc... | hardikkamboj/Open_cv_tutorial | face_detection_using_casscades/face_detection.py | face_detection.py | py | 920 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "cv2.imread",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "cv2.CascadeClassifier... |
37817270074 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 27 15:18:20 2020
@author: jlee
"""
import time
start_time = time.time()
import numpy as np
import glob, os
import copy
import sys
from astropy.io import fits
from astropy.convolution import Gaussian2DKernel
from astropy.convolution import convolve
... | joungh93/PyRAF_GMOS_IFU | analysis/align_spat.py | align_spat.py | py | 5,182 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "time.time",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "warnings.filterwarnings",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "init_cfg.dir_cmb",
"li... |
45358114647 | import xlrd
a = dict()
b = []
#d = [0,0,0,0]
k1,k2,k3,k4 =0,0,0,0
rb = xlrd.open_workbook('C:\\Users\\ppirogov\\Desktop\\Паше\\trekking.xlsx')
sheet = rb.sheet_by_index(0)
sheet2 = rb.sheet_by_index(1)
vals2 =[sheet2.row_values(rownum) for rownum in range(sheet2.nrows)]
vals = [sheet.row_values(rownum) for rownum in ra... | pirogov-p/phyton | course_python/2.3.2.py | 2.3.2.py | py | 774 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "xlrd.open_workbook",
"line_number": 6,
"usage_type": "call"
}
] |
12009377801 | import logging
import gssapi
from django.contrib.auth import get_user_model
User = get_user_model()
def test_login(k5env, client, caplog, db, settings):
caplog.set_level(logging.DEBUG)
response = client.get('/login/')
assert response.status_code == 401
response = client.get('/login/', HTTP_AUTHOR... | klada/django-gssapi | tests/test_views.py | test_views.py | py | 1,364 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "gssapi.Name",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "gssa... |
36228147051 | import time, sys
import numpy as np
import matplotlib.pyplot as plt
sys.path.append('../../')
from py2Periodic.physics import twoLayerQG
from numpy import pi
pyqgParams = {
'dt' : 8000,
'nx' : 128,
'L' : 1.0e6,
'beta' : 1.5e-11,
'rd' : 1.5e4,
'rek' : 1.... | glwagner/py2Periodic | tests/twoLayerQG/verifyTwoLayerQGAgainstPyqg.py | verifyTwoLayerQGAgainstPyqg.py | py | 3,063 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "py2Periodic.physics.twoLayerQG.model",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "py2P... |
36090098991 | from PIL import Image , ImageDraw
import numpy ,os ,pyocr , pyocr.builders , re , sys
tools = pyocr.get_available_tools()
if len(tools) == 0:
print("No OCR tool found")
sys.exit(1)
tool = tools[0]
def get_text_ocr(src_file_name):
#print("%s"%tool.get_name())
#langs = tool.get_available_languages()
... | mstp015v/shikenbunkatsu | lib/ocr_lib/ocr_mj.py | ocr_mj.py | py | 681 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pyocr.get_available_tools",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line... |
38298707353 | import os
import whisper
from moviepy.editor import VideoFileClip
import pandas as pd
import logging
from concurrent.futures import ThreadPoolExecutor
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
model = whisper.load_model("large")
output_directory = "output_chunks"
de... | gabriel-peter/clipper | src/transcribe_audio.py | transcribe_audio.py | py | 1,406 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.basicConfig",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "whisper.load_model",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.info",... |
29065758432 | from django import forms
from . models import Book , Address , CustomUser , Author , Category , BookComments
from django.contrib.auth.forms import AuthenticationForm, UserCreationForm
from django.contrib.auth.models import User
# Custom fields Email Require
from django.forms import EmailField
from django.utils.transla... | Jerasin/BookStore-Django | bookstore/stock_book/forms.py | forms.py | py | 2,792 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "models.Book",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "django.contrib.a... |
15337058290 | #!/usr/bin/python
"""
diagManager.py: version 0.1.0
History:
2017/01/29: coding style phase1:
reformat to python-guide.org code style
http://docs.python-guide.org/en/latest/writing/style/
which uses PEP 8 as a base: http://pep8.org/.
2017/01/09: Initial version converted to a class
... | diyjac/SDC-P5 | p5lib/diagManager.py | diagManager.py | py | 8,319 | python | en | code | 222 | github-code | 7 | [
{
"api_name": "cv2.FONT_HERSHEY_COMPLEX",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "cv2.putText",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "cv2.putText",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "cv2.putText",
... |
8476966547 |
#%%
# imports
# ANCHOR IMPORTS
import pandas as pd
import swifter
from itertools import chain
from ast import literal_eval
import numpy as np
import re
from collections import Counter
from keywords import get_kws
# Visualization
import matplotlib.pyplot as plt
import seaborn as sns
#from wordcloud import Word... | cltl-students/soren-fomsgaard-qanon-style | src/data_exploration.py | data_exploration.py | py | 29,078 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "itertools.chain",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "itertools.chain",
"line_number": 105,
"usage_type": "call"
},
{
"api_name": "pandas.Series",
"line_number": 113,
"usage_type": "call"
},
{
"api_name": "itertools.chain",
... |
15466821199 | # -*- coding=utf-8 -*-
import logging
import json
from applications.message import helper
from applications.message.const import ERR_MSG_CONNECT_MSG_CENTER_FAIL, ERR_CODE_CONNECT_MSG_CENTER_FAIL, ERR_MSG_WRONG_MSG_FORMAT, ERR_CODE_WRONG_MSG_FORMAT
from applications.message.helper import _remote_call
logge... | zptime/interact | applications/message/tasks.py | tasks.py | py | 1,617 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "applications.message.helper.response200",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "applications.message.helper",
"line_number": 21,
"usage_type": "name"
},
{
... |
35756896712 | import os
from random import randint
from itertools import cycle
import json
import pygame as pg
from .. import tools, prepare
from ..components.angles import get_distance
from ..components.animation import Animation
from ..components.labels import Label, Blinker, Button, ButtonGroup
class ScreenSprite(pg.sprite.Sp... | iminurnamez/jewel-crush | data/components/ui.py | ui.py | py | 13,315 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "pygame.sprite",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pygame.Rect",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "components.labels.ButtonGroup",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "componen... |
1862824078 | import tensorflow as tf
import utils
import config
import matplotlib
class Model(object):
def __init__(self, global_step=None, is_training=True):
self.lr = 0
self._is_training = is_training
# self.keep_probability = tf.placeholder(tf.float32, name="keep_probabilty")
self.inputs = ... | chenglinjuan/Speech-enhancement | SE/lib/trnmodel.py | trnmodel.py | py | 6,785 | python | en | code | null | github-code | 7 | [
{
"api_name": "tensorflow.placeholder",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tensorflow.float32",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "config.time_width",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": ... |
13415058819 | import torch
def get_square_distance(query_pos, all_pos):
"""
query_pos.shape = (b, sample, 3)
all_pos.shape = (b, n, 3)
return shape = (b, sample, n)
"""
res = ((query_pos.unsqueeze(dim=2) - all_pos.unsqueeze(dim=1)) ** 2).sum(dim=-1)
return res
b, n, sample = 1, 1, 1
torch.manual_seed(1)... | HaoRan-hash/threed | test/compute_pair_dis.py | compute_pair_dis.py | py | 514 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.manual_seed",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.randn",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.randn",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.cdist",
"line_num... |
29144793467 |
import numpy as np
from scipy.special import softmax
def kl_divergence(p, q):
epsilon = 0.0000001
p = p + epsilon
q = q + epsilon
ans = sum(p[i] * np.log(p[i]/q[i]) for i in range(len(p)))
return ans
if __name__ == "__main__":
a = np.array([0,1,0,0,0,0,0,0,0],dtype= np.float32)
... | frank47ltt/MARL_Robustness | Attacks for Qmix/debugging.py | debugging.py | py | 744 | python | en | code | 4 | github-code | 7 | [
{
"api_name": "numpy.log",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_numbe... |
7587577225 | from flask import Blueprint, url_for, redirect, request, jsonify, Response, make_response, send_file, current_app
from .common import get_config, row_to_obj, rows_to_objs
from .data import create_csv, LESS_SENSITIVE_APPLICANT_FIELDS
from .db import get_db
from json import dumps
import functools
import bcrypt
import tim... | compsoc-edinburgh/htb21-reg | app/service_api.py | service_api.py | py | 8,786 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Blueprint",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.make_response",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "db.get_db",
"li... |
16755613793 | import scrapy
from Amazon_su.items import AmazontestItem
import time
import sys
import os
import re
import hashlib
class AmazonSpider(scrapy.Spider):
name = 'Amazon'
# allowed_domains = ['www.xxx.com']
# start_urls = ['https://www.amazon.com/s?k=80cc&i=automotive&page=1']
start_url = 'https://www.amaz... | 2491723663/represent-street | Amazon_su/spiders/Amazon.py | Amazon.py | py | 3,167 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "scrapy.Spider",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "hashlib.md5",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "time.perf_counter",
"lin... |
43458539019 | import csv, sqlite3
sqlite_file = "Public_Computer_Access_Locations.db"
connection = sqlite3.connect(sqlite_file)
cursor = connection.cursor()
cursor.execute('CREATE TABLE IF NOT EXISTS Public_Computer_Access_Locations (ID INTEGER PRIMARY KEY AUTOINCREMENT, '
'Lab_name TEXT, Phone Integer, Accessible TE... | ellisju37073/cne340_1 | data_importer.py | data_importer.py | py | 1,422 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sqlite3.connect",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "csv.DictReader",
"line_number": 12,
"usage_type": "call"
}
] |
7125634287 |
def takePicture():
import cv2
#cap = cv2.VideoCapture("0") #default webcam
cap = cv2.VideoCapture("http://192.168.0.100:8080/videofeed") #IP Camera
while(True):
ret,frame = cap.read()
cv2.imshow('frame',frame)
if cv2.waitKey(1) & 0xFF == ord('c'):
cv2.imwrit... | krishnasism/autosite | capture.py | capture.py | py | 505 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.imwrite",
"line_number"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.