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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8039787839 | from fractions import Fraction
# Fungsi untuk mencari bentuk baris eselon tereduksi/tak tereduksi dari matriks
def getRowEchelon(mat):
row, col = len(mat), len(mat[0])
lead = 0
for i in range(row):
# Mencari posisi nilai terdepan
while lead < col and mat[i][lead] == 0:
for j in... | masQ-21dev/TUBES | test.py | test.py | py | 1,767 | python | id | code | 0 | github-code | 7 | [
{
"api_name": "fractions.Fraction",
"line_number": 42,
"usage_type": "name"
}
] |
70714654303 | import torch.nn as nn
import torch
class BCE(nn.Module):
def __init__(self, user_size, item_size, dim):
super().__init__()
self.user_embd = nn.Embedding(user_size, dim)
self.item_embd = nn.Embedding(item_size, dim)
# self.user_bias = nn.Embedding(user_size, 1)
# self.item_bias = nn.Embedding(item_size, 1)
... | ChengDe1996/NTU-IR | R08922A04_hw2/Model.py | Model.py | py | 1,310 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "torch.nn.Embedding",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
14023773447 | import asyncio
import aiofiles
import json
from os.path import exists
from ..exceptions import WiserExtraConfigError
class _WiserExtraConfig:
def __init__(self, config_file: str, hub_name: str):
self._config_file = config_file + "_" + hub_name
self._config = {}
async def async_load_config(se... | msp1974/aioWiserHeatAPI | aioWiserHeatAPI/helpers/extra_config.py | extra_config.py | py | 2,626 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "os.path.exists",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "aiofiles.open",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "json.JSONDecodeError",
"l... |
32751413568 | # Импорт необходимых библиотек и модулей
import pytest
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import email_config # Импорт конфигурационного файла с электронной п... | AdmiralBuldog/task_33 | test_case_011_password_recovery.py | test_case_011_password_recovery.py | py | 3,372 | python | ru | code | 0 | github-code | 7 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "pytest.fixture",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "sele... |
19335926361 | # -*- coding: utf-8 -*-
"""
Created on Tue Feb 16 11:29:36 2021
@author: DELL
"""
import speech_recognition as sr
AUDIO_FILE=("Downloads/Dil_Todi_Na_Song.wav")
#use audio file as the source
r=sr.Recognizer()
#initialise the recogniser
with sr.AudioFile(AUDIO_FILE) as source:
audio=r.record(source... | PriyankaJhamb/TheJoyOfComputingInPythonNPTEL | Speech Recognition.py | Speech Recognition.py | py | 627 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "speech_recognition.Recognizer",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "speech_recognition.AudioFile",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "speech_recognition.UnknownValueError",
"line_number": 22,
"usage_type": "attri... |
5208296530 |
'''
Write a function called list_manipulator which receives a list of numbers as first parameter and different amount of other parameters. The second parameter might be "add" or "remove". The third parameter might be "beginning" or "end". There might or might not be any other parameters (numbers):
- In case of "add" ... | ateneva/softuni_proj | 2_advanced/exam_prep/2020-06-07-03_list_manipulator.py | 2020-06-07-03_list_manipulator.py | py | 2,921 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "collections.deque",
"line_number": 28,
"usage_type": "call"
}
] |
9218795863 | import pandas as pd
import requests
from pandas.io.json import json_normalize
import datetime
from dateutil import parser
import co2_converter_common as ccc
from dataiku.customrecipe import get_recipe_config
# Get input parameters:
input_df, output_dataset, columns_names = ccc.get_input_output()
coordinates = ccc.get_... | dataiku/dss-plugin-co2 | custom-recipes/energy-mix/recipe.py | recipe.py | py | 4,518 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "co2_converter_common.get_input_output",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "co2_converter_common.get_coordinates",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "co2_converter_common.get_date_column_name",
"line_number": 12,
... |
73363444702 | # -*- coding: utf-8 -*-
"""
Created on Mon Oct 28 18:27:01 2019
@author: Paulo
"""
import pandas as pd
import numpy as np
from PIL import Image
from nightmares.images_defines import GDOT_SAVE_FOLDER
from os.path import join, isdir
from os import listdir as ls
def create_info_cols(df):
""" Create width and height... | Kotzly/GarfieldNightmares | nightmares/images_info.py | images_info.py | py | 2,469 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.nan",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "numpy.nan",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "numpy.nan",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "nightmares.images_define... |
14835031719 | from datetime import datetime
from chalicelib import s3
from chalicelib.constants import EVENT_ARRIVAL, EVENT_DEPARTURE
import itertools
DATE_FORMAT_MASSDOT = "%Y-%m-%d %H:%M:%S"
DATE_FORMAT_OUT = "%Y-%m-%dT%H:%M:%S"
def pairwise(iterable):
# an itertools recipe from the docs
# "s -> (s0,s1), (s1,s2), (s2, ... | transitmatters/t-performance-dash | server/chalicelib/s3_historical.py | s3_historical.py | py | 5,487 | python | en | code | 35 | github-code | 7 | [
{
"api_name": "itertools.tee",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "itertools.filterfalse",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "chalicelib.s3.download_events",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "cha... |
3777673678 | import numpy as np
import pandas as pd
from sdt_analysis import *
import matplotlib.pyplot as plt
import os
import argparse
import random
mc = "black"
plt.rcParams.update(
{
"font.size": 40,
"axes.labelcolor": "{}".format(mc),
"xtick.color": "{}".format(mc),
"ytick.color": "{}".form... | sofiadepedro/MSci_lab_project | expt12_cold_scale/src_analysis/automatic/auto_pos.py | auto_pos.py | py | 2,087 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "matplotlib.pyplot.rcParams.update",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 10,
"usage_type": "name"
},
{
... |
28624307969 | # To add a new cell, type '# %%'
# To add a new markdown cell, type '# %% [markdown]'
# %%
#
# %% [markdown]
# # Initial Bringup of the Sovol-SO1
#
# Much of these are taken from: https://github.com/Springwald/GCodePlotter/blob/main/code/Plotter/SovolS01Hardware.cs
#
# It was learnt that the Sovol-SO1 does not requi... | cwoodall/generative-art-studio | python/notebooks/sovol_bringup.py | sovol_bringup.py | py | 2,915 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "serial.Serial",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "serial.close",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "serial.write",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "serial.read_all",
"line_n... |
29135838308 | """This module contains retry logic for bucardo replication.
The adding and dropping of triggers in bucardo causes the potential for a
customer-facing outage due to lock contention. The retry module allows bucardo
to attempt to get a lock, gracefully move on if it can't get one quickly
enough, and retry later.
Class... | emmadev/bucardo_wrapper | plugins/retry/__init__.py | __init__.py | py | 8,863 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "plugins.Plugin",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "plugins.bucardo.Bucardo",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "psycopg2.connect",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "psycopg2.conn... |
23350640976 | import mock
from nova.network import model as network_model
from nova import test
from nova import utils
from nova.virt.vmwareapi import fake as vmwareapi_fake
from nova.virt.vmwareapi import vim_util
from nova.virt.vmwareapi import vmops
class fake_session(object):
def __init__(self, ret=None):
self.ret... | SUSE-Cloud/nova | nova/tests/virt/vmwareapi/test_vmwareapi_vmops.py | test_vmwareapi_vmops.py | py | 6,727 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "nova.virt.vmwareapi.fake.FakeVim",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "nova.virt.vmwareapi.fake",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "nova.test.NoDBTestCase",
"line_number": 25,
"usage_type": "attribute"
},
{
... |
17102529552 | '''
File used to extract members of ICMA. From the extracted list, this file will determine whether a company is a member of ICMA
'''
# Install Relevant Libraries
# pip install openpyxl --upgrade --pre
# pip install fuzzywuzzy
# Import Libraries and ICMA
import requests
from bs4 import BeautifulSoup
from fuzzywu... | putridar/esg-dashboard | Scripts/icma.py | icma.py | py | 1,239 | python | en | code | 12 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "fuzzywuzzy.fuzz.partial_ratio",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "fuzzywuz... |
36299453572 | """
Triggered on the Cloud event and performs the data validation.
"""
import boto3
import os
import logging
import codecs
import pandas as pd
import json
#####################################################
# VARIABLES
#####################################################
file_name = os.path.splitext(os.path.ba... | vijayanandrp/blog | aws/lambda_trigger_lambda_csv_data_validation.py | lambda_trigger_lambda_csv_data_validation.py | py | 8,907 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.path.splitext",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path.basename",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"... |
43434059865 | import boto3
from datetime import date, datetime
client = boto3.client('stepfunctions')
# https://stackoverflow.com/questions/11875770/how-to-overcome-datetime-datetime-not-json-serializable
def json_serial(obj):
if isinstance(obj, (datetime, date)):
return obj.isoformat()
raise TypeError ("T... | masayang/aws_sf_monitor | sf_monitor/monitor.py | monitor.py | py | 1,557 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "boto3.client",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "datetime.date",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
"li... |
70282571104 | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: LIBSVM_test
Description :
Author : cqh
date: 2021/4/19
-------------------------------------------------
Change Activity:
2021/4/19:
---------------------------------------------... | cqh6666/python_project | machine_learning/LIBLInear/LIBSVM_test.py | LIBSVM_test.py | py | 1,024 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sklearn.svm.SVC",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "sklearn.svm",
"line_number": 48,
"usage_type": "name"
},
{
"api_name": "sklearn.metrics.accuracy_score",
"line_number": 52,
"usage_type": "call"
}
] |
23493186855 | import csv
import folium
import geopandas
import pandas as pd
from folium.plugins import FastMarkerCluster
def load_csv(csv_file):
content = []
with open(csv_file) as f:
reader = csv.DictReader(f)
for row in reader:
content.append(row)
return content
def create_map(csv_file, ... | tanzeyl/twitter-sentiment-analysis | Map.py | Map.py | py | 1,820 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "csv.DictReader",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "folium.Map",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "geopandas.read_file",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "geopandas.datasets.get_... |
30712035800 | # Built-in Library
from re import I
from typing import Sequence, Dict
import time
# External Imports.
import dm_env
from dm_env import specs
from torch.utils.tensorboard import SummaryWriter
from torch.distributions import distribution
from torch.distributions.categorical import Categorical
from torch.nn.modules import... | thekips/Postal_Brain | algorithms/actor_critic/a2c_loc.py | a2c_loc.py | py | 5,412 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "torch.utils.tens... |
15039175761 | import torch
import torch.nn as nn
from .date2vec import Date2Vec
class Model(nn.Module):
def __init__(self, user_len, item_len, d_model=6):
super(Model, self).__init__()
self.userID_embeddings = nn.Embedding(user_len, d_model)
self.itemID_embeddings = nn.Embedding(item_len + 1, d_model) ... | CarlossShi/mcm-shit-mountain | 2021-MCB-B/models/transformer.py | transformer.py | py | 2,647 | python | en | code | 7 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.nn.Embedding",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
30640939098 | import netCDF4 as nc
import numpy as np
import matplotlib.pyplot as plt
from tqdm import tqdm
import math
from numba import njit
from numba.experimental import jitclass
from time import time
import functools
#from joblib import Parallel, delayed
#import multiprocessing
from multiprocessing import Pool
class nctools:
... | themachinethatgoesping/tools | python/themachinethatgoesping/scripts/read_xcf.py | read_xcf.py | py | 7,969 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "netCDF4.Dataset",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 109,
"usage_type": "call"
},
{
"api_name": "numpy.nan",
"line_number": 110,
"usage_type": "attribute"
},
{
"api_name": "numpy.isnan",
"line_... |
25008501517 | import os
import yaml
import collections
def deep_update(d, u):
for k, v in u.items():
if not isinstance(d, collections.abc.Mapping):
d = {}
if isinstance(v, collections.abc.Mapping):
d[k] = deep_update(d.get(k, {}), v)
else:
d[k] = v
return d
def lo... | sebniedziela/pivalve-analytic | config/__init__.py | __init__.py | py | 1,450 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "collections.abc",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "collections.abc",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.getenv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"li... |
29286319597 | # encoding: utf-8
"""
@author: liaoxingyu
@contact: sherlockliao01@gmail.com
"""
import copy
import logging
from collections import OrderedDict
import numpy as np
import torch
import torch.nn.functional as F
from sklearn import metrics
from fastreid.utils import comm
from fastreid.utils.compute_dist import build_dis... | zengwb-lx/Yolov5-Deepsort-Fastreid | fast_reid/fastreid/evaluation/reid_evaluation.py | reid_evaluation.py | py | 3,970 | python | en | code | 240 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "evaluator.DatasetEvaluator",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "fastreid.utils.comm.get_world_size",
"line_number": 46,
"usage_type": "call"
},
{
"a... |
74321788704 | import sqlite3
def valida(limite_inferior, limite_superior):
"""
-> Verificar se tem coerencia nos dados inseridos
:param limite_inferior: Valor de medição minímo do conversor
:param limite_superior: Valor de medição maxímo do conversor
"""
while True:
if limite_inferior > limit... | JoaoPacce/Datalogger | definicao.py | definicao.py | py | 5,375 | python | pt | code | 0 | github-code | 7 | [
{
"api_name": "sqlite3.connect",
"line_number": 114,
"usage_type": "call"
}
] |
16712662421 | from django.urls import path
from .views import IndexView, CreateVinhoView, UpdateVinhoView, DeleteVinhoView, DetailsVinhoView
urlpatterns = [
path('', IndexView.as_view(), name='index'),
path('add/', CreateVinhoView.as_view(), name='add_vinho'),
path('<int:pk>/update/', UpdateVinhoView.as_view(), name='... | eng-olavo/WineStoreV1.00 | core/urls.py | urls.py | py | 487 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "views.IndexView.as_view",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "views.IndexView",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.urls.pat... |
28702527733 | # type: ignore
from datetime import datetime
import pandas
import pytest
from pathier import Pathier
import databased
root = Pathier(__file__).parent
dbpath = root / "dummy" / "db.db"
def test_is_this_thing_on():
dbpath.unlink(missing_ok=True)
db = databased.DataBased(dbpath)
assert db
def test__data... | matt-manes/databased | tests/test_databased.py | test_databased.py | py | 4,326 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pathier.Pathier",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "databased.DataBased",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "databased.DataBased",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "databased.Dat... |
34952430748 | """create known entities
Revision ID: cab84848600b
Revises: 0445df8a3cbd
Create Date: 2020-04-28 19:01:11.337078+00:00
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "cab84848600b"
down_revision = "0445df8a3cbd"
branch_labels = None
depends_on = None
def upgr... | la-mar/prodstats | src/prodstats/db/migrations/versions/20200428_cab84848600b.py | 20200428_cab84848600b.py | py | 1,847 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "alembic.op.create_table",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Strin... |
32743526482 | import json
import click
from app.convertor import convert_to_troposphere
@click.command()
@click.argument('input', type=click.File('r'))
@click.argument('output', type=click.File('w'))
def convert(input, output):
"""
This script takes a cloudformation template file and converts it to
troposphere.
"... | pyghassen/cloudformation-to-troposphere-convertor | run.py | run.py | py | 490 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "json.loads",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "app.convertor.convert_to_troposphere",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "click.command",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "click.ar... |
7700858453 | from typing import Optional, Dict, Union
import os
import os.path as osp
import pickle
import numpy as np
import torch
import torch.nn as nn
from .lbs import (lbs, blend_shapes)
from .vertex_ids import vertex_ids as VERTEX_IDS
from .utils import (
Struct, to_np, to_tensor, Tensor, Array,
SMPLOutput)
from .... | tijiang13/InstantAvatar | instant_avatar/deformers/smplx/body_models.py | body_models.py | py | 14,217 | python | en | code | 250 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "utils.Struct",
"lin... |
7781179163 | from rest_framework import viewsets
from goal.serializers import (
GoalSerializer,
GoalTypeSerializer,
GoalManagerSerializer,
)
from goal.models import (
Goal,
GoalType,
GoalManager,
)
class GoalViewSet(viewsets.ModelViewSet):
"""
retrieve:
Return a goal instance.
list:
... | DreamRich/DreamRich | src/goal/views.py | views.py | py | 1,662 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "rest_framework.viewsets.ModelViewSet",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.viewsets",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "goal.serializers.GoalSerializer",
"line_number": 36,
"usage_type": "nam... |
42624964361 | from flask import Flask, Response, request, jsonify, redirect, url_for, render_template, session, abort
import os
import pymongo
import json
from datetime import datetime
import time
import sys
# from people_counter import get_frame
# from people_counter import VideoCamera
seconds = time.time()
client = pymongo.Mon... | codevaam/smart-evacuation-system | portal /app.py | app.py | py | 3,933 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "time.time",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
... |
27916948199 | import pya
from math import sqrt, cos, sin, tan, atan2, pi, copysign
from pya import DBox, Point, DPoint, Vector, DVector, DSimplePolygon, SimplePolygon, DPolygon, Polygon, Region
from pya import Trans, DTrans, CplxTrans, DCplxTrans, ICplxTrans
from importlib import reload
import classLib
reload(classLib)
from classL... | shamil777/KLayout-python | Projects/Capacity_measurements/C23.py | C23.py | py | 19,886 | python | en | code | 16 | github-code | 7 | [
{
"api_name": "importlib.reload",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "importlib.reload",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pya.DPoint",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pya.DPoint",
"line_nu... |
33808029368 | import json
import logging
import os
import re
import time
import urllib.error
import urllib.parse
import urllib.request
import gpodder
from gpodder import feedcore, model, registry, util
_ = gpodder.gettext
# gPodder's consumer key for the Soundcloud API
CONSUMER_KEY = 'zrweghtEtnZLpXf3mlm8mQ'
logger = logging.g... | gpodder/gpodder | src/gpodder/plugins/soundcloud.py | soundcloud.py | py | 8,737 | python | en | code | 1,186 | github-code | 7 | [
{
"api_name": "gpodder.gettext",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "time.mktime",
"li... |
70707373343 | from django.conf.urls import patterns, url, include
from rest_framework.urlpatterns import format_suffix_patterns
import views
urlpatterns = patterns('',
url(r'^api-login/', include('rest_framework.urls', namespace='rest_framework')), # User accessible
url(r'^o/', includ... | bantonelli/CustomDrumSamples | api/urls.py | urls.py | py | 1,511 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.conf.urls.patterns",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.include",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "... |
43117000383 | from scipy.stats import norm, rankdata
import time
import math
import numpy as np
import pytz
import pandas as pd
from numpy.linalg import inv, pinv
from GaussianRUMGMM import *
from aggregate import *
import importlib
import functools
import scipy
import os
from collections import namedtuple
def find_bnds(x, a):
... | TristanV12/GMM | matlab/mixGaussianRUMGMM.py | mixGaussianRUMGMM.py | py | 9,512 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "importlib.import_module",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "importlib.import_module",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "numpy.one... |
72354753183 | import re
import time
from selenium.webdriver import Edge
from selenium.webdriver.support import expected_conditions, ui
from selenium.webdriver.common.by import By
PATH = 'C:\\Users\\Pende\\Downloads\\edgedriver_win32\\msedgedriver.exe'
class SawFirst:
def __init__(self, url):
self.driver = Edge(executa... | Zadigo/my_python_codes | sawfirst.py | sawfirst.py | py | 1,319 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "selenium.webdriver.Edge",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.supp... |
42185636310 | import torch
import torch.nn as nn
def GRU(input,initial_states,w_ih,w_hh,b_ih,b_hh):
pre_h=initial_states
batch_size,T,i_size=input.shape
h_size=w_ih.shape[0] // 3
#权重扩维,复制成batch_size倍
batch_w_ih=w_ih.unsqueeze(0).tile(batch_size,1,1)
batch_w_hh = w_hh.unsqueeze(0).tile(batch_size... | yyiridescent/AIlearning | GRU_model.py | GRU_model.py | py | 1,780 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.zeros",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.bmm",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.bmm",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.sigmoid",
"line_number": 25... |
8520504140 | # -*- coding: UTF-8 -*-
import math
from bokeh.io import show, output_file
from bokeh.models import GraphRenderer, StaticLayoutProvider, Oval
from bokeh.palettes import Spectral10
from bokeh.plotting import figure
# Configure the number of nodes
total_nodes = 10
node_points = list(range(total_nodes))
print(node_point... | shaweiguo/data | lib/bokeh/app/networks_explicit_paths.py | networks_explicit_paths.py | py | 1,915 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "bokeh.plotting.figure",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "bokeh.models.GraphRenderer",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "bokeh.models.Oval",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "ma... |
36845902919 | # 절대 좌표입력으로 고정된 위치에 레이아웃 만들기. (창이 변경되어도 항상 같은자리에 있음)
import sys
from PyQt5.QtWidgets import QApplication, QLabel, QWidget
class Example(QWidget):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
lbl1 = QLabel('Zetcode', self) # 레이블을 만듬.
lbl1.move(15, 10... | lyj911111/PyQT5-Tutorial | 5_레이아웃(layout 만들기)/1_절대좌표 레이아웃.py | 1_절대좌표 레이아웃.py | py | 914 | python | ko | code | 0 | github-code | 7 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QLabel",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QLabel",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "... |
74566468062 | import crochet
crochet.setup() # initialize crochet before further imports
from flask import Flask, jsonify, render_template, request
from prices.prices.spiders import emag
from scrapy import signals
from scrapy.crawler import CrawlerRunner
from scrapy.signalmanager import dispatcher
app = Flask(__name__)
output_dat... | valentinneagu/cherryprice | pricescraping/app.py | app.py | py | 1,789 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "crochet.setup",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "scrapy.crawler.CrawlerRunner",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "prices.prices.s... |
44359990147 | import unittest
from mixbox.vendor.six import StringIO, BytesIO
from lxml import etree
import mixbox.xml
from stix.test import EntityTestCase
from stix.extensions.malware.maec_4_1_malware import MAECInstance
class PythonMAECTests(EntityTestCase, unittest.TestCase):
klass = MAECInstance
_full_dict = {
... | davidratcliffe/es_eventgens | SA-ThreatIntelligence/contrib/stix/test/extensions/malware/maec_4_1_malware_test.py | maec_4_1_malware_test.py | py | 4,142 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "stix.test.EntityTestCase",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "unittest.TestCase",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "stix.extensions.malware.maec_4_1_malware.MAECInstance",
"line_number": 12,
"usage_type": ... |
36992507855 | import socketio
sio = socketio.Client()
"""
IO
"""
state = ''
lastError = 0
integral = 0
Kp = 1
Ki = Kp*2
Kd = Kp*1/2
dt = 0.1
def stateController(value):
global error, state, integral
if state != value:
error = [0]
integral = 0
state = value
@sio.on('read', namespace='/error... | endroca/process-simulator | controller/Controller.py | Controller.py | py | 972 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "socketio.Client",
"line_number": 3,
"usage_type": "call"
}
] |
4011461724 | from voicevox import Client
import re
import asyncio
from PIL import Image
import cv2
import pyautogui
import pytesseract
import numpy as np
import simpleaudio as sa
from pynput import mouse
import time
from io import BytesIO
import base64
import pickle
from translate import Translator
import os
import platform
import ... | Alacadrial/visual-novel-voicer | controller.py | controller.py | py | 9,767 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "platform.system",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pynput.mouse.Listener",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "pynput.mouse",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "pynput.mouse.Butto... |
26076025235 | import json
import logging
import sys
from gamebase.game.TurnGameLogic import TurnGameLogic
import random
from game.base.Phase import Phase
sys.path.insert(0, '../')
logging.basicConfig(level=logging.DEBUG)
'''
ShardDict Key
PHASE_LOOP -> 'loop'->
PHASE_FINISH -> 'finish'->
At PixelsGameLogic
width : The width of ... | HyOsori/battle.ai | game/pixels/PixelsGameLogic.py | PixelsGameLogic.py | py | 14,275 | python | en | code | 14 | github-code | 7 | [
{
"api_name": "sys.path.insert",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "logging.basicConfig",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
... |
14778525519 | from qiskit import QuantumCircuit
from .registers import HubbardRegister
__all__ = ['hubbard_circuit', 'initialize_chessboard', 'initialize_superposition_chessboard',
'initialize_repulsive_rows']
def hubbard_circuit(shape, ancilla_register, classical_registers, ordering=None, extra_leg=False):
"""
... | mballarin97/hubbard | hubbard/circuit.py | circuit.py | py | 7,371 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "registers.HubbardRegister",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "qiskit.QuantumCircuit",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "registers.qregisters",
"line_number": 38,
"usage_type": "attribute"
}
] |
28436570116 | import requests
class QueryException(Exception):
pass
class DB():
def __init__(self, key=None, host='evaldb.turb.io'):
self.key = key
self.host = host
def read(self, query, **args):
return self.query(query, args, True)
def write(self, query, **args):
return self.query(query, args, False)
... | turbio/todoval | db.py | db.py | py | 674 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.post",
"line_number": 18,
"usage_type": "call"
}
] |
71897863262 | from __future__ import annotations
from collections import deque
from copy import copy
from dataclasses import dataclass, field
from enum import Enum, auto
from heapq import heappop, heappush
from datetime import datetime
from typing import (
Deque,
Dict,
FrozenSet,
Iterator,
List,
Optional,
... | dalehp/advent19 | 20/donut.py | donut.py | py | 5,005 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.Iterator",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "enum.Enum",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "enum.auto",
"line... |
40442532534 | # CuPy and Numba on GPU
# Author: Shaurya
import numpy as np
import cupy as cp
from time import perf_counter
# similar to numpy arrays
# cupy was created by the people behind chainer for their GPU based DL
arr=cp.arange(10)
repr(arr)
arr.dtype
arr.shape
arr.strides
arr.device
# we can move data between CPU and the G... | abyssnlp/numba-gpu | 2. cupy-numba.py | 2. cupy-numba.py | py | 3,830 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "cupy.arange",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "cupy.asarray",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cupy.asarray",
"line_number... |
21794973718 | from rich import print
def print_field(field):
for row in field:
print(' '.join([str(pos) for pos in row]))
sizeX = int(input('width: '))
sizeY = int(input('height: '))
#sizeX, sizeY = 6, 5
field = [['[bold green]0[/bold green]'] * (sizeX) for i in range((sizeY))]
print_field(field)
playing = True
wh... | Technik-Tueftler/TeTueChallenge | x003C/source/helbaco.py | helbaco.py | py | 733 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "rich.print",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "rich.print",
"line_number": 31,
"usage_type": "call"
}
] |
21448802845 | from modules.Commands import Commands
from modules.Storage import Storage
def main():
"""Запуск локального 'ключ-значение' хранилища"""
storage_name = input("Write modules name: ")
storage = Storage(storage_name)
while True:
command = input("Write command: ")
commands = Commands()
... | art3xa/kv-storage | kvs_v0.7/client1/modules/KVS.py | KVS.py | py | 475 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "modules.Storage.Storage",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "modules.Commands.Commands",
"line_number": 11,
"usage_type": "call"
}
] |
21833502586 | from flask import Flask, request, jsonify
import os
import requests
app = Flask(__name__) # creating a flask instance
def get_weather(lat, lon):
api_key = os.environ.get('API_KEY') # retrieving the api key from our environment variable
url = f'https://api.openweathermap.org/data/2.5/weather?lat={la... | efrei-ADDA84/20220313 | TP 1-2-3/weather.py | weather.py | py | 1,072 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_numb... |
73911083742 | from collections import defaultdict
from typing import List
class Solution:
def minDominoRotations(self, A: List[int], B: List[int]) -> int:
countsA = defaultdict(int)
countsB = defaultdict(int)
possible = None
for a, b in zip(A, B):
if possible is None:
... | cs-cordero/interview-prep | leetcode/1007_minimum_domino_rotations_for_equal_row.py | 1007_minimum_domino_rotations_for_equal_row.py | py | 603 | python | en | code | 9 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "collections.defaultdict",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 8,
"usage_type": "call"
}
] |
1416843601 | import io, os, sys
import tinify
def compress_file(file_path, file_size_limit):
"""
压缩单个文件,如果文件大小超过限制则进行压缩,否则跳过
"""
file_size = os.path.getsize(file_path)
if file_size > file_size_limit:
print(f"Prepare to compress file: {file_path}")
try:
source = tinify.from_file(file_... | qinyuanpei/hugo-blog | .python/process-image.py | process-image.py | py | 1,653 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "os.path.getsize",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "tinify.from_file",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.getsize",
"li... |
70790149664 | from django.db import transaction
from django.http import JsonResponse
from rest_framework.decorators import api_view
from rest_framework.parsers import JSONParser
from store.Class.Order import Order
from store.Class.Product import Product
from store.Class.Store import Store
from store.serializers.OrderSerializer impo... | dollyrij-22/onlinestore | onlinestore/store/API/Order.py | Order.py | py | 1,279 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "rest_framework.parsers.JSONParser",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "store.serializers.OrderSerializer.CreateOrderRequest",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.http.JsonResponse",
"line_number": 19,
"usa... |
74736491742 | from typing import Any
from django.db.models import Manager, Model, QuerySet, Q
from core.apps.checks.constants import CheckStatus, CheckTypeChoices
class CheckQuerySet(QuerySet):
def avaliable_for_printing(self):
return self.filter(
Q(status=CheckStatus.RENDERED) | Q(status=CheckStatus.PRINT... | greedWizard/farfor_test_task | core/apps/checks/managers.py | managers.py | py | 1,629 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.db.models.QuerySet",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.models.Q",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "core.apps.checks.constants.CheckStatus.RENDERED",
"line_number": 10,
"usage_type": "attribute... |
2716159387 | from bs4 import BeautifulSoup as bs
import os
import re
from pathlib import Path
# get reference to folder of DUC summaries
def get_summary_folders():
root = "resources/duc/summaries/"
sub_folders = [f.path for f in os.scandir(root) if f.is_dir()]
return sub_folders
# obtain path of DUC summaries
def su... | AvramPop/bachelor-thesis | thesis-project/processing/duc.py | duc.py | py | 4,376 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.scandir",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 33... |
36139907037 | from django.template import Library
from rest_framework import serializers
from rest_framework.renderers import JSONRenderer
register = Library()
from . import models
import json
class UtilitiesSerializer(serializers.ModelSerializer):
class Meta:
model = models.Utilities
depth = 1
fields ... | raphirm/rezepteDjango | recipes/serializers.py | serializers.py | py | 1,065 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.template.Library",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 10,
"usage_type": "nam... |
23427257648 | # Day 6, Tuning Trouble
from typing import List, Union
# Q1 & Q2
def report_first_marker(signal: str, size: int) -> int:
for s, _ in enumerate(signal):
if len(set(signal[s:s+size])) == size: return s+size
assert False, f"unreachable, signal: {signal}, size: {size}"
# Input
def parse_input(file: str) -... | nilsmo1/aoc2022 | day06/main.py | main.py | py | 1,058 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.Union",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 11,
"usage_type": "name"
}
] |
27959590131 | # *_*coding:utf-8 *_*
# @Author : YueMengRui
import requests
from mylogger import logger
from typing import List
from configs import LLM_SERVER_APIS, EMBEDDING_SERVER_APIS
def servers_llm_chat(prompt, model_name: str = "", history: list = [], generation_configs: dict = {}):
req_data = {
"model_name": mode... | yuemengrui/LLM-Paimon | ai_server/info/utils/api_servers/llm_base.py | llm_base.py | py | 1,368 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.post",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "configs.LLM_SERVER_APIS",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "mylogger.logger.info",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "mylogger.l... |
71767629664 | import os
from . import CollectCurriculum
from traitlets.config import Configurable
from traitlets import List
class DsPipeline(Configurable):
name = 'DsPipeline'
description = '''
The primary pipeline for dscreate
DsPipeline's primary variable is ``steps`` containing converter and controller... | learn-co-curriculum/dscreate | dscreate/pipeline/DsPipeline.py | DsPipeline.py | py | 1,065 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "traitlets.config.Configurable",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "traitlets.List",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "traitlets.List",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.remove"... |
73928561823 | #imports
import tensorflow as tf
import numpy as np
from tensorflow.keras import datasets, layers, models
from tensorflow.keras.models import Sequential
import matplotlib.pyplot as plt
#loading data
(train_images, train_labels), (test_images, test_labels) = datasets.cifar10.load_data() #splits data into 50k training a... | astroari/cifar10-tests | cifar-baseline.py | cifar-baseline.py | py | 1,795 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "tensorflow.keras.datasets.cifar10.load_data",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.datasets.cifar10",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.keras.datasets",
"line_number": 9,
"usage_typ... |
38660437129 | #main programm.
import sqlite3
mybook=sqlite3.connect('bookstore.db')
ans='y'
total=0
while ans=='y' or ans=='Y':
bt=input("\nBook Title : ")
sql="SELECT * from books WHERE Title='"+bt+"';"
cursbook=mybook.cursor()
cursbook.execute(sql)
record=cursbook.fetchone()
if record==None:
... | AdarshN7/Programmin-with-Python | Python_Module_Assignments/ADARSH NISHAD - Python_M5Assignment/main.py | main.py | py | 731 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "sqlite3.connect",
"line_number": 3,
"usage_type": "call"
}
] |
74182784862 | from PIL import Image
import os, sys
def resize(path, dirs):
for item in dirs:
if os.path.isfile(path+item):
im = Image.open(path+item)
f, e = os.path.splitext(path+item)
imResize = im.resize((100,100), Image.ANTIALIAS)
imResize.save(f + '.jpg', 'JPEG', qual... | justinhyou/GestureRecognition-CNN | resize.py | resize.py | py | 703 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "os.path.isfile",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image.open",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number"... |
28786100796 | import logging
import uuid
from typing import Any, Optional, TypeVar, Union
from sqlalchemy import select, update
from sqlalchemy.ext.asyncio import AsyncSession, create_async_engine
from sqlalchemy.inspection import inspect
from sqlalchemy.orm import declarative_base, sessionmaker
from sqlalchemy.sql.base import Colu... | Addovej/employees_register_ts | src/connections/postgresql.py | postgresql.py | py | 4,627 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "typing.TypeVar",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "typing.Any",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.sql.schema.Met... |
22615469354 |
import torch
import torch.nn as nn
from utils.linear import Linear
from crossbar.crossbar import crossbar
from utils.observer import Observer
from networks.ode_net import ODE_Net
class ODE_NN(nn.Module):
def __init__(self, input_size, output_size, device_params, time_steps):
super(ODE_NN, self).__init_... | ricohasgithub/Crossbar-ODE_RNN | networks/ode_rnn/ode_nn.py | ode_nn.py | py | 1,404 | python | en | code | 1 | 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": "utils.observer.Observer",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "crossbar.crossb... |
70170884383 | #!/usr/bin/python
# -*- coding:utf-8 -*-
from django.urls import path
from favorite import views
# 收藏页面
urlpatterns = [
path('add/<game_id>', views.add, name="favorite-add"),
path('remove/<game_id>', views.remove, name="favorite-remove"),
path('list', views.list, name="favorite-list"),
]
| shingler/gfweb | favorite/urls.py | urls.py | py | 310 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "favorite.views.add",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "favorite.views",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.urls.path... |
41802144524 | from dataclasses import dataclass
temperature = int
a: temperature = 1
b = 1
assert a == b
int_or_float = int | float
c: int_or_float = 10
d: int_or_float = 10.0
assert c == 10
assert d == 10.0
@dataclass
class Point:
x: int
y: int
str_or_Point = str | Point
hello = "hello"
e: str_or_Point = "hello"
... | Viniciusvcr/bethon | tests/pass/type_alias.py | type_alias.py | py | 494 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "dataclasses.dataclass",
"line_number": 19,
"usage_type": "name"
}
] |
18233803677 | import xmltodict
from copyreg import constructor
from hashlib import new
from flask import Flask, jsonify, request, json, session
from flask_session import Session
from flask_cors import CORS
import json
from random import randrange
from flask_sqlalchemy import SQLAlchemy
import fastf1
import fastf1.plotting
import pan... | Harsh-2420/formula1 | backend/app.py | app.py | py | 29,086 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "flask_session.Session",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy... |
3147218379 | from django.shortcuts import render, get_object_or_404
from django.views.generic import ListView, DetailView
from django.views.generic.edit import CreateView, UpdateView
from .models import Restaurant, Dish, RestaurantReview
from .forms import RestaurantForm, DishesForm
from django.urls import reverse_lazy, reverse
fr... | Avijeet2016/Food-Bloggers | Food_Bloggers/FBvirenv/Food_Bloggers/restaurantApp/views.py | views.py | py | 3,155 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.views.generic.DetailView",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "models.Restaurant",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "models.RestaurantReview.RATING_CHOICES",
"line_number": 21,
"usage_type": "attribute"
... |
30462207516 | import numpy as np
from rbf_nn import sigmoid, sigmoidPrime, feedforward, backpropagation, loss, model
import matplotlib.pyplot as plt
from random import randint
import copy
from numpy.linalg import norm
p = np.zeros((2, 2000))
u = []
t = []
d = [0.5]
for i in range(2000):
u.append(2*np.random.uniform(0, 1)-1)
... | Sshanu/EE671 | dyanmic_rbf.py | dyanmic_rbf.py | py | 1,760 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "numpy.zeros",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.random.uniform",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.power",
"... |
27765183839 | from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import collections
import json
from googlecloudsdk.command_lib.apigee import errors
from googlecloudsdk.command_lib.apigee import resource_args
from googlecloudsdk.core import properties
from googlecloudsdk.... | twistedpair/google-cloud-sdk | google-cloud-sdk/lib/googlecloudsdk/command_lib/apigee/request.py | request.py | py | 6,559 | python | en | code | 55 | github-code | 7 | [
{
"api_name": "collections.OrderedDict",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "googlecloudsdk.command_lib.apigee.resource_args.ENTITIES",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "googlecloudsdk.command_lib.apigee.resource_args",
"line... |
24740572041 | import argparse
import numpy as np
import os
import json
from builtins import range
import tensorrtserver.api.model_config_pb2 as model_config
from tensorrtserver.api import *
import time
def triton_inferer(ctx, input_name, output_name, batch):
batch = [batch[i].astype(np.float32) for i in range(0,batch.shape[0])... | NVIDIA/healthcare-on-tap-TRT-TRITON-demo | sim_inference_req_triton.py | sim_inference_req_triton.py | py | 4,779 | python | en | code | 14 | github-code | 7 | [
{
"api_name": "numpy.float32",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "builtins.range",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tensorrtserver.api.model_config_pb2.ModelInput",
"line_number": 63,
"usage_type": "attribute"
},
{
... |
28713858160 | import OlivOS
import MC_Servestate.serve_base
import re
import json
import os
import threading
import time
class Event(object):
def init(plugin_event, Proc):
global log
bot_dict = Proc.Proc_data['bot_info_dict']
for value in bot_dict.values():
if value.platform["platform"] == "d... | Yorunina/MC_Servestate | MC_Servestate/main.py | main.py | py | 9,156 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "json.load",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "OlivOS.API.Event",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "OlivOS.API",
"line_number": 52,
"usage_type": "attribute"
},
{
"api_name": "OlivOS.contentAPI.fake_sdk... |
29369881761 | """empty message
Revision ID: c663e443ee71
Revises: 2f696fa6cac7
Create Date: 2019-11-22 18:14:27.328960
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'c663e443ee71'
down_revision = '2f696fa6cac7'
branch_labels = None
depends_on = None
def upgrade():
# ... | tiilt-lab/chemistry-dashboard | server/migrations/versions/c663e443ee71_.py | c663e443ee71_.py | py | 678 | python | en | code | 4 | github-code | 7 | [
{
"api_name": "alembic.op.add_column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.String"... |
13415658592 | """
Visualization using visdom.
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from itertools import *
from keras import backend
def preview_samples(images, labels, title):
"""
Shows a few samples of the loader.
"""
# We generate a plot
(fig, ax) = pl... | aPere3/ros4pro_private | src/ros4pro/vision/vis.py | vis.py | py | 3,957 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.subplots_adjust",
"line_number": 17,
"usage_type": "call"
},
{
"ap... |
9122214158 | # -*- coding: utf-8 -*-
import json
from typing import List, Tuple
from django.http import HttpRequest, JsonResponse
from catmaid.apps import get_system_user
from catmaid.control.authentication import requires_user_role
from catmaid.control.common import get_class_to_id_map, get_relation_to_id_map
from catmaid.model... | catmaid/CATMAID | django/applications/catmaid/control/tracing.py | tracing.py | py | 8,392 | python | en | code | 178 | github-code | 7 | [
{
"api_name": "django.http.HttpRequest",
"line_number": 77,
"usage_type": "name"
},
{
"api_name": "django.http.JsonResponse",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "django.http.JsonResponse",
"line_number": 77,
"usage_type": "name"
},
{
"api_nam... |
19720173936 | # -*- coding: utf-8 -*-
import os
import gc
import jieba
from sklearn.externals import joblib
from sklearn.ensemble import RandomForestClassifier
from sklearn.cross_validation import train_test_split
jieba.initialize()
class RandomForest(object):
""" 随机森林算法实践 """
def __init__(self, is_save=False):
... | ZoaChou/Python-learn | application/controller/random_forest.py | random_forest.py | py | 8,371 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "jieba.initialize",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sklearn.cross_validation.train_test_split",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "sklearn.ensemble.RandomForestClassifier",
"line_number": 57,
"usage_type": "ca... |
35663475760 | import time
import torch
import torch.nn as nn
from torch.utils.data.dataloader import DataLoader, Dataset
from torch.optim import Adam
from torch.optim import lr_scheduler
from .utils import EarlyStopping
from .loss import mae_loss
class Trainer:
"""
Default training loss is MAE. If you want to change it, yo... | liaoyuhua/GPT-TS | src/trainer.py | trainer.py | py | 6,467 | python | en | code | 23 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
... |
37049164783 | #%%
import cv2 as cv
import numpy as np
img = cv.imread('halloween.jpg', cv.IMREAD_COLOR)
print('dang bien cua tung pixel:', img.dtype)
#%% lay du lieu file hinh
print('so chieu data', img.ndim)
print('tong so pixel', img.size)
print('so piexl trong tung dimension', img.shape)
#%% chieu dai va chieu rong cua tam hin... | TraanQuang1509/ImageProcessing | Intro/template.py | template.py | py | 895 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "cv2.imread",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_COLOR",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_nu... |
26233438747 | from flask import Flask,request,redirect,render_template,session,url_for,make_response,abort,flash
from flask_sqlalchemy import SQLAlchemy
import MySQLdb
import os
import datetime
import logging
import json,uuid
app=Flask(__name__)
app.secret_key=os.urandom(16)
#废弃掉的sqlalchemy语句
# app.config['SQLALCHEMY_... | 3927o/Mikufans | main.py | main.py | py | 25,428 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.urandom",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "MySQLdb.connect",
"line_number": 92,
"usage_type": "call"
},
{
"api_name": "logging.FileHandler",
"line... |
41135417207 | import matplotlib.pyplot as plt
import numpy as np
import scipy.sparse.linalg as linalg
import time
from collections import defaultdict
from test import optimize
from nlp_problems import InvertedPendulum, InvertedPendulum_cart
import preconditioners
N = 40
h = 1e-5
max_iters = 20
problem = InvertedPendulum_cart(N=N,... | LordZamy/CSE-6644-Project | plot.py | plot.py | py | 6,880 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "nlp_problems.InvertedPendulum_cart",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.random.randn",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name"... |
22206454856 | from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
import datetime
class CompanyLoans(Document):
def show_payment_shedule(self):
if self.no_of_days and self.due_date and self.the_number_of_payments_made and self.total :
start_days=datetime.datetime.strptime(self.da... | beshoyAtefZaki/Dynamic-erp | erpnext/accounts/doctype/company_loans/company_loans.py | company_loans.py | py | 803 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "frappe.model.document.Document",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 9,
"usage_type": "attribute"
},
{
"api... |
70754672545 | from keras.utils import to_categorical
import tensorflow as tf
import pygame
class pytennis:
def __init__(self, fps = 50):
self.net = Network(150,450,100,600)
self.updateRewardA = 0
self.updateRewardB = 0
self.updateIter = 0
self.lossA = 0
self.lossB = 0
... | elishatofunmi/ReinEnv | pytennis/play.py | play.py | py | 15,682 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pygame.init",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pygame.font.SysFont",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "pygame.font",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "pygame.font.SysFont"... |
25643050848 | from PyQt5.QtWidgets import QWidget, QHBoxLayout, QComboBox
class LabelFilterComboBox(QWidget):
def __init__(self, parent=None, items=[]):
super(LabelFilterComboBox, self).__init__(parent)
self.items = items
self.combo_box = QComboBox()
self.combo_box.addItems(self.items)
s... | CVHub520/X-AnyLabeling | anylabeling/views/labeling/widgets/filter_label_widget.py | filter_label_widget.py | py | 658 | python | en | code | 929 | github-code | 7 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QComboBox",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QHBoxLayout",
"line_number": 14,
"usage_type": "call"
}
] |
34757830766 | import unittest
from configparser import ConfigParser
from pathlib import Path
from src.detectors.sift import SiftDuplicateDetector
from src.image import Image
class TestSift(unittest.TestCase):
def test_SiftDuplicateDetector(self):
config = ConfigParser()
config.read('./config.ini')
imag... | paulkamer/duplicate-image-detector | tests/test_sift.py | test_sift.py | py | 1,058 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "unittest.TestCase",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "configparser.ConfigParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "src.detectors.sift.SiftDuplicateDetector",
"line_number": 24,
"usage_type": "call"
},
... |
12130371161 | from typing import Optional
class ListNode:
def __init__(self, val=0, _next=None):
self.val = val
self.next = _next
class Solution:
def addTwoNumbers(self, l1: Optional[ListNode], l2: Optional[ListNode]) -> Optional[ListNode]:
# Check if either l1 or l2 is None. If one of them is Non... | kirillfr97/coding_challenges | add_two_numbers/add_two_numbers.py | add_two_numbers.py | py | 1,542 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.Optional",
"line_number": 11,
"usage_type": "name"
}
] |
34428480618 | from fastapi import APIRouter, Request, Depends, Form
from fastapi.exceptions import HTTPException
from fastapi.templating import Jinja2Templates
from sqlalchemy.orm import Session
from typing import List
from datetime import datetime
from starlette.responses import RedirectResponse
from database.database import... | nonameqm/oss_skku_message | server/app/routes/message.py | message.py | py | 2,792 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "fastapi.templating.Jinja2Templates",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "fastapi.APIRouter",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "database.database.SessionLocal",
"line_number": 21,
"usage_type": "call"
},
{
... |
8825014830 | # -*- coding: utf-8 -*-
"""
Module implementing ColorDlg.
"""
from PyQt5.QtCore import pyqtSlot, Qt
from PyQt5.QtWidgets import QDialog
from .Ui_color import Ui_Dialog
import colorpy, colorpy.illuminants, colorpy.colormodels
import numpy as np
class ColorDlg(QDialog, Ui_Dialog):
"""
Class documentation go... | MiRichter/OptiSim | ui/color.py | color.py | py | 7,819 | python | en | code | 13 | github-code | 7 | [
{
"api_name": "PyQt5.QtWidgets.QDialog",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "Ui_color.Ui_Dialog",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.Qt.WA_DeleteOnClose",
"line_number": 29,
"usage_type": "attribute"
},
{
"... |
38926617913 | import os
from fastapi.datastructures import UploadFile
from numpy.lib.function_base import delete
from tensorflow.python.keras.backend import set_session
from tensorflow.keras.applications.imagenet_utils import decode_predictions
import cv2
import matplotlib as plt
from tensorflow import keras
import imutils
import t... | klkettenacker/OcularDiseaseClassifier_App | ModelAPI/api.py | api.py | py | 7,629 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pathlib.Path",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "tensorflow.compat.v1.Graph",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "tensorflow.compat.v1.Session",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "... |
13755443345 | import boto3
# Get All Regions
regions = boto3.session.Session().get_available_regions('ec2')
# List instances
def list_instances(i):
"List EC2 instances"
ec2 = boto3.session.Session(region_name= i ).resource('ec2')
for i in ec2.instances.all():
print(', '.join((
i.id,
i.i... | karolnedza/aws-python | ec2-stop-all.py | ec2-stop-all.py | py | 1,083 | 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"
},
{
"api_name": "boto3.session.Session",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "boto3.ses... |
21204427162 | #
# project: project 2
# file: mnist.py
# author: MING Yao
#
import tensorflow as tf
import numpy as np
from convnet.convnet import ConvNet
import gzip
import os
import sys
from six.moves import urllib
SOURCE_URL = 'http://yann.lecun.com/exdb/mnist/'
WORK_DIRECTORY = 'data'
IMAGE_SIZE = 28
NUM_CHANNELS = 1
PIXEL_DEPT... | myaooo/TFConvNet | src/mnist.py | mnist.py | py | 3,754 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "tensorflow.gfile.Exists",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "tensorflow.gfile",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.gfile.MakeDirs",
"line_number": 31,
"usage_type": "call"
},
{
"api_name"... |
22176805619 | # There are n servers numbered from 0 to n-1 connected by undirected server-to-server connections forming a
# network where connections[i] = [a, b] represents a connection between servers a and b.
# Any server can reach any other server directly or indirectly through the network.
# A critical connection is a connection... | igomez10/Algorithms | leetcode/1192. Critical connections in a network/main.py | main.py | py | 2,668 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "collections.deque",
"line_number": 37,
"usage_type": "call"
}
] |
15640059949 | import click
from ddt_probe.probe import main
from ddt_probe.utils import PodInfo
import os
@click.command()
@click.argument('app_id')
@click.argument('pod_id')
@click.argument('pod_ip')
@click.argument('domain_id')
@click.argument('server_ip')
@click.argument('server_port')
def cli(server_ip, server_port, app_id, pod... | ipa-rwu/ddt | ddt-probe/ddt_probe/__init__.py | __init__.py | py | 830 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "ddt_probe.utils.PodInfo",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_num... |
8151855832 | import json
from json.decoder import JSONDecodeError
from collections import defaultdict
from django.http import (
HttpResponse,
HttpResponseBadRequest,
HttpResponseForbidden,
HttpResponseNotFound
)
from django.shortcuts import render, redirect
from django.contrib import messages
from django.contrib... | tombakas/bbq_organizer | bbq_organizer/views.py | views.py | py | 7,095 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.shortcuts.render",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.decorators.login_required",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "bbq_organizer.models.MeatType.objects.all",
"line_number": 37,
"usa... |
9721989952 | import cv2
import time
import numpy as np
width = 256
weight = f"./CowFace-{width}_6000.weights"
config = f"./CowFace-{width}.cfg"
size = (width,width)
net = cv2.dnn.readNet(weight, config)
model = cv2.dnn_DetectionModel(net)
model.setInputParams(size=size,scale=1./255,swapRB=True)
img = cv2.imread("detect.jpg")
out... | WesleyCh3n/NTU-IoT-Node | example/detect/detect.py | detect.py | py | 669 | python | en | code | 4 | github-code | 7 | [
{
"api_name": "cv2.dnn.readNet",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.dnn",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "cv2.dnn_DetectionModel",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
... |
37806951084 | """
Custom Vectorizer based on MI
-----------------------------
Using mutual information between metas and words to weight words
Public Methods
~~~~~~~~~~~~~~
train_model
"""
from __future__ import print_function
import math
from scipy.sparse import coo_matrix, csr_matrix
from sklearn.feature_extraction.text i... | patrickmesana/nlpkit | custom_mi_weights_model.py | custom_mi_weights_model.py | py | 4,954 | python | en | code | 6 | github-code | 7 | [
{
"api_name": "sklearn.feature_extraction.text.CountVectorizer",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "scipy.sparse.coo_matrix",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "math.log",
"line_number": 78,
"usage_type": "call"
},
{
"... |
2589065046 | from rest_framework import serializers
from .models import Election, Ballot
from django.contrib.auth.forms import get_user_model
from django.core.exceptions import ValidationError
from django.utils import timezone
from authentication.utils import Util
class UserSerializer(serializers.ModelSerializer):
email = ser... | AnirudhAchal/Secure-Ranked-Choice-E-Voting | backend/backend/election/serializers.py | serializers.py | py | 3,593 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.EmailField",
"line_number": 10,
"usag... |
41282509246 | from fastapi import FastAPI
import requests
import gradio as gr
import uvicorn
app = FastAPI()
headers = {
"Authorization": "Bearer xxxx",
"Content-Type": "application/json"
}
@app.get("/gpt3")
def get_gpt3_results(prompt: str):
print(prompt)
data = {
"model": "gpt-3.5-turbo",
"max_... | SnJForever/ChatGPT_chat | SERVICE/app.py | app.py | py | 3,093 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "gradio.Blocks",
"line_... |
13552746317 | import pygame
import numpy as np
from random import randint
from configs.game.weapon_config import weapon_data
from configs.game.spell_config import magic_data
from .components.stats import StatsHandler
from .components._input import InputHandler
from .components.animaton import AnimationHandler
from effects.particl... | baledick/PneumaRL | entities/player.py | player.py | py | 8,311 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "pygame.sprite",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "effects.particle_effects.AnimationPlayer",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "components.animaton.AnimationHandler",
"line_number": 45,
"usage_type": "call... |
3932617677 | from annoy import AnnoyIndex
import sqlite3
from get_audio_features import search_input, search_tracks, choose_right_track, get_audio_features
import ipdb
import pandas as pd
import requests
from authenticate import authenticate
def load_index(path, metric='angular'):
index = AnnoyIndex(12, metric)
index.loa... | saoriyosano/music_recommendation | get_recommendation.py | get_recommendation.py | py | 2,732 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "annoy.AnnoyIndex",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "requests.get",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.