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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
23119221621 | # program to count number of letters required to write out numbers from 1 to 1000
# example: 342 (three hundred and forty-two)
# don't include spaces or hyphens
# allows conversion of number to words
import inflect
p = inflect.engine()
# helper function to translate numbers to words
def translate():
numbers = [n... | alexdebolt/Project_Euler | number_letter.py | number_letter.py | py | 739 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "inflect.engine",
"line_number": 7,
"usage_type": "call"
}
] |
19406986481 | import requests
url = 'http://173.246.108.142/level1.php'
i = 0
while i < 1024:
data = ({'id': '28', 'holdthedoor': 'Submit', 'key': ''})
headers = {'Cookie': 'HoldTheDoor='}
r = requests.post(url, data, headers=headers)
print ("Voted %d times" % (i + 1))
i += 1
| DoraKorpar/holbertonschool-higher_level_programming | hodor/level_1/hodor.py | hodor.py | py | 286 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.post",
"line_number": 9,
"usage_type": "call"
}
] |
19188520991 | # -*- coding: utf-8 -*-
import os
from unittest.mock import patch
from gitlint.shell import ErrorReturnCode, CommandNotFound
from gitlint.tests.base import BaseTestCase
from gitlint.git import GitContext, GitContextError, GitNotInstalledError, git_commentchar, git_hooks_dir
class GitTests(BaseTestCase):
# Exp... | sgkiokas/gitlint | gitlint-core/gitlint/tests/git/test_git.py | test_git.py | py | 4,721 | python | en | code | null | github-code | 21 | [
{
"api_name": "gitlint.tests.base.BaseTestCase",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "gitlint.shell.CommandNotFound",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "gitlint.git.GitNotInstalledError",
"line_number": 25,
"usage_type": "argume... |
9333751631 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from detect import distance_compute, detect_3sig, m_model_create,detect_dbscan
from torchvision import datasets, transforms
import syft as sy
import time
import sys
import server
class Arguments():
def __in... | TudouJack/Federated-Learning-with-Paillier-and-Rubstness | new plan.py | new plan.py | py | 10,970 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "torch.nn.Module",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
8235825364 |
from tkinter import *
from tkinter import ttk
from enum import Enum, auto
import threading
import os
import music as m
class Sound(Enum):
NONE_STATUS = auto()
TEST_STATUS = auto()
PLAY_STATUS = auto()
class Playback(Enum):
#playback
START_POSITION = auto()
MIDWAY_POSITION = auto()
... | Kazu-SK/Guitar_Chord_Navigation | guitar_chord_navigation.py | guitar_chord_navigation.py | py | 25,317 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "enum.Enum",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "enum.auto",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "enum.auto",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "enum.auto",
"line_number": 18,
... |
13078578645 | def search_result_list(first_link):
return """
<html>
...
<a href='%(first_link)s' />
...
<a href='other-links 1' />
<a href='other-links 2' />
...
</html>
""" % locals()
def details_page(ziplink):
return (
"""
<html>
...
<a href="{0}">
... | andreafrancia/subs-crawler | tests/pages.py | pages.py | py | 696 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "StringIO.StringIO",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "zipfile.ZipFile",
"line_number": 30,
"usage_type": "call"
}
] |
72753151412 | """
周节能率计算
"""
import datetime
import pytz
from app.db import water_heater
from app.models.week_save import WeekSave
from . import equipment
def equipment_week_save(serial_number: str, date: str) -> WeekSave:
"""计算设备周节能率
处理指定日期的上一周
:Parameters:
- `serial_number`: 设备序列号.
- `date`: 日期.
... | robertzml/merope | app/biz/week_save.py | week_save.py | py | 4,243 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "app.db.water_heater.get_summary_cumulative",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "app.db.water_heater",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "pytz.timezone",
"line_number": 24,
"usage_type": "call"
},
{
"api_... |
16931893440 | from wsgiref.validate import validator
from rest_framework import serializers
from .models import AppUser
class AppUserSerializer(serializers.ModelSerializer):
class Meta:
model = AppUser
# fields = ['id','first_name', 'last_name', 'email']
fields = '__all__'
#https://stackoverflow.co... | aniruddhha/python-codes-094a | python-training/06_07_day/crudmain/crudrest/serializers.py | serializers.py | py | 753 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "models.AppUser",
"line_number": 8,
"usage_type": "name"
},
{... |
43128070911 | #!/usr/bin/env python3
import argparse
from collections import defaultdict
import logging
import queue
from threading import Lock
import time
from typing import Any, DefaultDict, Dict, Iterable, NamedTuple, Optional, Tuple
from enocean.communicators.serialcommunicator import SerialCommunicator
from enocean.protocol.con... | RavuAlHemio/prometheus_enocean_exporter | prometheus_enocean_exporter.py | prometheus_enocean_exporter.py | py | 11,190 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.NamedTuple",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.NamedTuple",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
... |
72299782774 | # %%
import os
import mne
import traceback
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
from onstart import LOGGER
# %%
class Drawer(object):
''' Functional Drawer using Matplotlib '''
def __init__(self):
'''
Method: __init__
Initialization
... | listenzcc/MEG-EEG-Analysis | visualizing/toolbox.py | toolbox.py | py | 5,146 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "onstart.LOGGER.debug",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "onstart.LOGGER",
"line_number": 63,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.close",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "matplotli... |
33899964043 | from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union
import attr
from ..types import UNSET, Unset
if TYPE_CHECKING:
from ..models.error import Error
from ..models.warning import Warning_
T = TypeVar("T", bound="SetAppointmentResponse")
@attr.s(auto_attribs=True)
class SetAppointmentRes... | milyord/sp-api | sp/services/models/set_appointment_response.py | set_appointment_response.py | py | 3,885 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.TypeVar",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "typing.Union",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "types.Unset",
"li... |
18687473433 | from tkinter import*
from tkinter import ttk
import tkinter
from PIL import Image,ImageTk
import os
from tkinter import filedialog as fd
#--------------------------------------------
from student_details import student_details
from teacher_details import teacher_details
from teacher_attendance import Teacher_A... | DipakAgarwal0703/FRAMS | Admin_main.py | Admin_main.py | py | 6,704 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "PIL.Image.open",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "PIL.ImageTk.PhotoImage",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "PIL.ImageTk",
"li... |
32956113063 | import os
from random import randint
import base64
import hashlib
from Crypto.Cipher import AES
from Crypto import Random
from collections import defaultdict
block_size = 16
prefix = os.urandom(200)
key = "YELLOW SUBMARINE"
def PKCS7_padding(text , block_size):
text_length = len(text)
amount_to_pad = block_size - ... | prerna-grg/Cryptopals-solutions | set2/C14.py | C14.py | py | 2,247 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.urandom",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "base64.b64decode",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "Crypto.Cipher.AES.new",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "Crypto.Cipher.AES",... |
10908786980 | import os, sys, ast, time, logging
import argparse
global FILE_DIR, PAR_DIR, CONFIG_FILE, cfgr, args
FILE_DIR = os.path.dirname(os.path.realpath(__file__))
PAR_DIR = os.path.abspath(os.path.join(FILE_DIR, os.path.pardir))
CONFIG_FILE = os.path.join(PAR_DIR, 'etc', 'config.yaml')
args, cfgr = {}, None
def _convert_v... | cskyan/bionlpsota | bin/helper.py | helper.py | py | 4,867 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "os.path.dirname",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"lin... |
26590674603 | import os
import pickle
from pathlib import Path
from shutil import copy2
def save_model(model, filename="trained_model", path=None):
if path == None:
path = Path(os.getcwd())
filepath = path / f"{filename}.sav"
with open(filepath, 'wb') as f:
pickle.dump(model, f)
print(f"Trained mode... | henryhyunwookim/Voice-Cloning-and-Fake-Audio-Detection | utils/save.py | save.py | py | 1,646 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "pathlib.Path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pickle.dump",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": ... |
33215967063 | import pandas as pd
import numpy as np
from sklearn.model_selection import KFold
from datetime import datetime
class RidgeRegression:
def __init__(self):
return
def fit(self, X_train, Y_train, LAMBDA):
assert len(X_train.shape) == 2 and X_train.shape[0] == Y_train.shape[0]
W = np.l... | phamduytung2002/DSLab-training | Session 1/Ridge Regression/RidgeRegression.py | RidgeRegression.py | py | 3,614 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.linalg.inv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "numpy.identity",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.random.rand",... |
3070468706 | import argparse
import logging
import sys
import requests
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry
from flask import Flask, Response, render_template, request
def _parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("--port", default=80... | lingofunk/lingofunk-app | webapp/main.py | main.py | py | 5,241 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.Session",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "requests.packages.urllib3.util.retry.Retry",
"line_number": 24,
"usage_type": "call"
},
{
... |
18852929958 | from django.shortcuts import render, redirect
from .models import Notes
from django.views.decorators.csrf import csrf_exempt, csrf_protect
from .forms import NoteForm
import json
# Create your views here.
def index(request):
# data = {
# 'page_title': 'Home',
# 'notes': [{
# 'title': '... | VasaviDevelopers/Django-Tutorial---Blog | notes/views.py | views.py | py | 2,891 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "models.Notes.objects.all",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "models.Notes.objects",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "models.Notes",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "djang... |
403527293 | from collections import defaultdict
import datetime
import os
from mock import patch, MagicMock
import pytest
from barman.infofile import WalFileInfo
from barman.server import Server, PostgresConnectionError
from testing_helpers import build_test_backup_info, build_config_from_dicts, \
build_real_server
class E... | terrorobe/barman | tests/test_server.py | test_server.py | py | 9,269 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "barman.server.Server",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "testing_helpers.build_config_from_dicts",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_nam... |
75162915893 | import numpy as np
from OpenGL.GL import *
from OpenGL.arrays.numbers import NumberHandler as NH # used to pass number references to pyopengl
from constants import *
from Chunk import Chunk
from ChunkWorker import ChunkWorker
import time
from collections import defaultdict
class World:
def __ini... | BeneDevRepo/PyCraft | World.py | World.py | py | 7,943 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "collections.defaultdict",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "ChunkWorker.ChunkWorker",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "OpenGL.arrays.numbers.NumberHandler",
"line_number": 38,
"usage_type": "call"
},
{
... |
13674865480 | bl_info = {
"name": "Render Studio",
"description": "Render Studio",
"author": "DJABHipHop",
"version": (0, 0, 1),
"blender": (2, 80, 0),
"location": "3D View > Render Studio",
"warning": "", # used for warning icon and text in addons panel
"wiki_url": "",
"tracker_url": "",
"cat... | Render-Studio/Render-Studio-Addon | __init__.py | __init__.py | py | 9,317 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "os.path.dirname",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"lin... |
17388819363 | # -*- coding: utf-8 -*-
"""
Created on Wed Oct 30 16:11:35 2019
@author: lindsay.hu
"""
'''
【课程3.9】 直方图
plt.hist(x, bins=10, range=None, normed=False, weights=None, cumulative=False, bottom=None,
histtype='bar', align='mid', orientation='vertical',rwidth=None, log=False, color=None, label=None,
stacked=False, hol... | hulinjuan/Python_data_analysis_action_netease | 03 重点工具掌握:数据分析核心技巧/第3章 图表绘制工具:Matplotlib/Part2 图表绘制/课程3.9 直方图.py | 课程3.9 直方图.py | py | 1,444 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.Series",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.random.randn",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.... |
40549517692 | from ipaddress import IPv4Address, IPv4Interface
from unittest.mock import MagicMock
from uuid import UUID
import pytest
from monkeytypes import OperatingSystem
from common.agent_events import FingerprintingEvent
from common.types import (
DiscoveredService,
NetworkPort,
NetworkProtocol,
NetworkServic... | guardicore/monkey | monkey/tests/unit_tests/monkey_island/cc/agent_event_handlers/test_fingerprinting_event_handler.py | test_fingerprinting_event_handler.py | py | 4,262 | python | en | code | 6,367 | github-code | 21 | [
{
"api_name": "uuid.UUID",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "ipaddress.IPv4Address",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "common.types.DiscoveredService",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "common... |
6465001135 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import time
import atexit
import json
import pytz
import argparse
from lib.pylogbeat import PyLogBeatClient
from datetime import datetime
from collections import OrderedDict
from py3nvml import py3nvml as nv
class GPUCollector(object):
def __init__(self):
sel... | valdemarjr/gpuinfo-tobeats | gpuinfo-tobeats.py | gpuinfo-tobeats.py | py | 2,856 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "py3nvml.py3nvml.nvmlSystemGetDriverVersion",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "py3nvml.py3nvml",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "py3nvml.py3nvml.nvmlDeviceGetCount",
"line_number": 19,
"usage_type": "call"
... |
12177616859 | import sys
import os
import time
# import msvcrt
sys.path.append('../')
import mongoengine
import datetime
import pymongo
import json
from discs import manageDatabases
from discs import updateDatabases
from discs import populate
from discs.services.underlying import databaseRead as underlyingDatabaseRead
from dis... | ayush1120/CRDT-DisCS | scarf/terminal/interface.py | interface.py | py | 11,288 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "mongoengine.disconnect_all",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "mongoengine.re... |
7291282967 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import stdimage.models
import django.utils.timezone
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('auth', '0001_initial'),
]
operations = [
... | joshsamara/game-website | core/migrations/0001_initial.py | 0001_initial.py | py | 4,103 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.CreateModel",
"line_number": 17,
"usage_type": "call"
},
... |
4037015121 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('djangocosign', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='userprofile',
na... | mercycorps/djangocosign | migrations/0002_auto_20151104_1341.py | 0002_auto_20151104_1341.py | py | 498 | python | en | code | 0 | github-code | 21 | [
{
"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"
},
{... |
72682212534 | import csv
import os
from typing import Optional, Set
import networkx as nx
from openpyxl import load_workbook
from KSPUtils.config_node_utils import ConfigNode
def all_successors(node: str, G: nx.DiGraph) -> Set[str]:
nbunch = {node}
for s in G.successors(node):
nbunch.add(s)
nbunch.update(... | allista/ThrottleControlledAvionics | TechTree/ModuleNetworks.py | ModuleNetworks.py | py | 12,399 | python | en | code | 52 | github-code | 21 | [
{
"api_name": "networkx.DiGraph",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "typing.Set",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "networkx.DiGraph",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "networkx.nx_ag... |
30779639445 | import abc
from typing import TypeAlias, Sequence
IntSequence: TypeAlias = Sequence[int]
""" Superclass of `tuple[int]` and `list[int]`. (We often want to use both in one argument of function.) """
IntSequenceOrInt: TypeAlias = IntSequence | int
""" `IntSequence` possibly given by only one element -- `int`; see `seq_o... | JoHavel/note_copyist | utils/my_typing.py | my_typing.py | py | 1,115 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.TypeAlias",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "typing.Sequence",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "typing.TypeAlias",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "typing.Sequence",
... |
18727791152 | """Deleted public column of events table
Revision ID: 51261ea00405
Revises: 2b0d5d437d7b
Create Date: 2022-12-29 23:52:08.505661
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '51261ea00405'
down_revision = '2b0d5d437d7b'
b... | AkhmedLostInShali/meroplanBackend | alembic/versions/51261ea00405_deleted_public_column_of_events_table.py | 51261ea00405_deleted_public_column_of_events_table.py | py | 903 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "alembic.op.batch_alter_table",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "alembic.op.batch_alter_table",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "... |
74097236214 | import discord
from discord import Member, Message, Intents
from discord.ext import commands, tasks
from discord.errors import NotFound
import discord.utils
import asyncio
import json
import requests
with open("properties.json", encoding='UTF-8') as f:
data = json.load(f)
TOKEN = data["properties"]["token"]
PREFI... | Fynnyx/fabsi_mc | discord/fabsi_bot/fabsibot.py | fabsibot.py | py | 17,785 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "json.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "discord.Intents",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands.Bot",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "discord.ext.comman... |
2657133890 | from selenium import webdriver
from lxml import etree
import pymongo
import time
from selenium.common.exceptions import TimeoutException
class LagouSpider(object):
driver_path = r'E:\chromedriver_win32\chromedriver.exe'
client = pymongo.MongoClient('127.0.0.1', port=27017)
def __init__(self):
se... | q654528967/python | gangkou/get_gangkou.py | get_gangkou.py | py | 3,117 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "lxml... |
15338299694 | from flask import Flask,render_template, request, session, Response, redirect
from database import connector
from model import entities
from sqlalchemy import or_, and_
import time
import datetime
import json
from operator import itemgetter,attrgetter
db = connector.Manager()
engine = db.createEngine()
app = Flask(_... | cs2b01/mobile-project-luteachmobile | web/server.py | server.py | py | 10,641 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "database.connector.Manager",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "database.connector",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "flask.Flask",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.rende... |
2141294199 | """MindSpore ResNet"""
import math
from typing import Any, Callable, List, Optional, Type, Union
import mindspore as ms
from mindspore import nn, ops
def conv3x3(in_planes: int, out_planes: int, stride: int = 1, groups: int = 1, dilation: int = 1) -> nn.Conv2d:
"""3x3 convolution with padding"""
return nn.Co... | mindspore-ai/docs | docs/mindspore/source_zh_cn/migration_guide/code/resnet_convert/resnet_ms/src/resnet.py | resnet.py | py | 10,196 | python | en | code | 154 | github-code | 21 | [
{
"api_name": "mindspore.nn.Conv2d",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "mindspore.nn",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "mindspore.nn.Conv2d",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "mindspore.nn... |
2920318110 | import config
from telegram_bot.responders.bot_texts import Responses
from telegram_bot.bot_instance import bot
from telegram import ReplyKeyboardRemove, InlineKeyboardMarkup, InlineKeyboardButton
class AudioResponder:
@staticmethod
async def ask_audio_enabled(user_id):
"""Ask user if he needs a QUOTE... | chemradio/cta-gfx-helper | bot_engine/telegram_bot/responders/shared_responders/audio_responder.py | audio_responder.py | py | 1,134 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "telegram.InlineKeyboardMarkup",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "telegram.InlineKeyboardButton",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "telegram.InlineKeyboardButton",
"line_number": 15,
"usage_type": "call"
},
... |
33220634215 | import time
from dataclasses import dataclass
from utils.methods import duration_time,i_float,dbopen
@dataclass
class Workout:
type: str
current_date: str
time_start: str
def __post_init__(self):
pass
def __str__(self):
return '''ID{:2} {} {}\n
... | fatsamy/fatsamy | utils/work_class.py | work_class.py | py | 5,129 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "utils.methods.dbopen",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "time.localtime",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "time.localtime",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "utils.methods.dura... |
5721070874 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/3/10 16:11
# @Author : duwenzhi
# @Site :
# @File : AttendanceSystem.py
# @Software: PyCharm
import os
import cv2
import facenet
import time
import datetime
import logging
import numpy as np
import mysql.connector
import tensorflow as tf
import al... | Wormhole307/my_project | AttendanceSystem.py | AttendanceSystem.py | py | 10,324 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "logging.basicConfig",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "tensorflow.ap... |
26183887516 | import pyspark.sql.functions as F
from pyspark.sql import SparkSession
import datetime as dt
import os
import unittest
from shutil import rmtree
class TestInit(unittest.TestCase):
@classmethod
def setUpClass(cls):
# Build local spark session, and set up conf
cls.spark = SparkSession.builder.m... | haifabenaouicha/spark-structured-streaming-python-application | tests/test_init.py | test_init.py | py | 1,058 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "unittest.TestCase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pyspark.sql.SparkSession.builder.master",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 14,
"usage_type": "attrib... |
19040361174 | from django.shortcuts import render,redirect
from .forms import EmployeeForms
from .models import Employee
# Create your views here.
def employee_dashboard(request):
if request.method=='GET':
employee_form=EmployeeForms()
emp_list=Employee.objects.all()
emp_dict={
'employee_form... | vjvijaykumarvj/company_project | company_root/modelforms_app/views.py | views.py | py | 1,409 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "forms.EmployeeForms",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "models.Employee.objects.all",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "models.Employee.objects",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_nam... |
34438964717 | """Python file to serve as the frontend"""
import streamlit as st
from streamlit_chat import message
from langchain.prompts.prompt import PromptTemplate
from langchain.text_splitter import RecursiveCharacterTextSplitter
from langchain.document_loaders import ReadTheDocsLoader
from langchain.vectorstores.faiss import F... | PrateekKumar2109/streamlit-chat | main.py | main.py | py | 4,469 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "langchain.text_splitter.RecursiveCharacterTextSplitter",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "langchain.prompts.prompt.PromptTemplate.from_template",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "langchain.prompts.prompt.PromptTempl... |
73026872373 | import unittest
from rx.testing import TestScheduler, ReactiveTest
on_next = ReactiveTest.on_next
on_completed = ReactiveTest.on_completed
on_error = ReactiveTest.on_error
subscribe = ReactiveTest.subscribe
subscribed = ReactiveTest.subscribed
disposed = ReactiveTest.disposed
created = ReactiveTest.created
class Te... | LiuFang816/SALSTM_py_data | python/ReactiveX_RxPY/RxPY-master/tests/test_observable/test_bufferwithcount.py | test_bufferwithcount.py | py | 1,936 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "rx.testing.ReactiveTest.on_next",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "rx.testing.ReactiveTest",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "rx.testing.ReactiveTest.on_completed",
"line_number": 6,
"usage_type": "attrib... |
5060657045 | import llog
import asyncio
from datetime import datetime
import json
import logging
import os
import struct
import time
from sqlalchemy import func
import base58
import brute
import chord
import consts
import db
import mbase32
import multipart as mp
import mutil
import dhgroup14
import enc
import sshtype
import rsak... | bitcoinembassy/morphis | dmail.py | dmail.py | py | 28,903 | python | en | code | 15 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.urandom",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "chord.NODE_ID_BYTES",
"li... |
9870253307 | #!usr/bin/env python3
"""Parser for all of India"""
from datetime import datetime, timedelta
from logging import Logger, getLogger
from typing import Any
import arrow
import numpy as np
import pandas as pd
from bs4 import BeautifulSoup
from pytz import UTC
from requests import Response, Session
from electricitymap... | electricitymaps/electricitymaps-contrib | parsers/IN.py | IN.py | py | 16,549 | python | en | code | 3,126 | github-code | 21 | [
{
"api_name": "arrow.get",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "requests.Session",
"line_number": 138,
"usage_type": "name"
},
{
"api_name": "requests.Session",
"line_number": 144,
"usage_type": "call"
},
{
"api_name": "requests.Response",
... |
11554263244 | from solution import look_and_say, solution_01, solution_02
import pytest
@pytest.mark.parametrize(
"number,expected",
[
(1, 11),
(11, 21),
(21, 1211),
(1211, 111221),
(111221, 312211),
],
)
def test_look_and_say(number, expected):
assert int(look_and_say(str(n... | suic86/adventofcode | 2015/day_10/test_solution.py | test_solution.py | py | 482 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "solution.look_and_say",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "solution... |
72373647732 | '''Train a model to detect whether an input contains triggers or not.'''
import multiprocessing
import logging
import argparse
import time
from configs import add_args, set_seed
import os
import math
from _utils import Example
from _utils import convert_defect_examples_to_features
from utils import calc_stats
import t... | yangzhou6666/adversarial-backdoor-for-code-models | CodeT5/run_detector.py | run_detector.py | py | 13,104 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "transformers.RobertaConfig",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "transformers.RobertaModel",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "transformers.RobertaTokenizer",
"line_number": 28,
"usage_type": "name"
},
{
... |
11547468306 | from numpy import (
absolute,
ascontiguousarray,
empty,
float32,
memmap,
nan,
uint8,
uint64,
zeros,
)
from ._allele import Allele
__all__ = ["read_bed"]
def read_bed(filepath, nrows, ncols, row_chunk, col_chunk, ref: Allele):
from dask.array import concatenate, from_delayed
... | limix/pandas-plink | pandas_plink/_bed_read.py | _bed_read.py | py | 2,108 | python | en | code | 73 | github-code | 21 | [
{
"api_name": "_allele.Allele",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "numpy.memmap",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 24,
"usage_type": "argument"
},
{
"api_name": "dask.delayed.delayed",
... |
71077569333 | import json
import numpy as np
import torch
import torch.nn as nn
from bot.nn_model import NeuralNet
from bot.dataset import ChatDataset, process_data, get_data_loader
def train():
with open('intents.json', 'r') as f:
intents = json.load(f)
X_train, y_train, data = process_data(intents)
... | bmai53/chatbot | train.py | train.py | py | 1,757 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "json.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "bot.dataset.process_data",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "bot.dataset.ChatDataset",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "bot.datase... |
75162757813 | from urlparse import urlparse
import time
import psycopg2
COLUMNS = map(lambda a: a.strip(), "datid | datname | numbackends \
| xact_commit | xact_rollback | blks_read | blks_hit | tup_returned \
| tup_fetched | tup_inserted | tup_updated | tup_deleted | conflicts \
| temp_files | temp_bytes | deadlocks | blk... | bearstech/collectd_pg | pg.py | pg.py | py | 3,087 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "psycopg2.connect",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "collectd.error",
"line_numbe... |
73029526133 | from __future__ import absolute_import, print_function, division
from numbers import Number
import dask
from dask.threaded import get as threaded_get
from dask.utils import derived_from
import numpy as np
from sklearn.base import BaseEstimator, MetaEstimatorMixin
from sklearn.exceptions import NotFittedError
from s... | LiuFang816/SALSTM_py_data | python/dask_dask-learn/dask-learn-master/dklearn/model_selection.py | model_selection.py | py | 8,592 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "sklearn.base.BaseEstimator",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "sklearn.base.MetaEstimatorMixin",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "sklearn.utils.validation.check_is_fitted",
"line_number": 45,
"usage_type": "c... |
19191288913 | #!/usr/bin/env python
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import matplotlib.pyplot as plt
import numpy as np
import os
import random
import re
import rospy
import sys
import yaml
directory = os.path.join(os.path.dirname(os.path.realpath(__file_... | sumaiyah/Multi-Robot-Formation-Control | src/ros/formation_move.py | formation_move.py | py | 7,070 | python | en | code | 17 | github-code | 21 | [
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.realpath",
"lin... |
3727479597 | # -*- coding: utf-8 -*-
import datetime as dt
import os
from PyQt6.QtWidgets import (QApplication, QVBoxLayout, QGridLayout,
QWidget, QCalendarWidget, QLabel)
from PyQt6.QtCore import (Qt, QTime, QEvent)
import re
import scroller
import settings
import sys
import t... | MashTT/Portfolio | main.py | main.py | py | 5,918 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "PyQt6.QtWidgets.QWidget",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "PyQt6.QtWidgets.QGridLayout",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "PyQt6.QtWidgets.QVBoxLayout",
"line_number": 27,
"usage_type": "call"
},
{
"a... |
3214189938 | import datetime
import xarray
def doy(time):
"""
Calculate the day of year from input datetime object
Args:
time (datetime.datetime):
Returns:
int: day of year where January 1 has a value of 1 not 0
"""
day_of_year = (time - datetime.datetime(time.year, 1, 1)).days + 1
#... | profxj/mhw_analysis | mhw_analysis/utils.py | utils.py | py | 1,405 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "datetime.datetime",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "xarray.concat",
"line_number": 58,
"usage_type": "call"
}
] |
28034109867 | import numpy
import typing
import ctypes
import os
import inspect
import qm3.data
import qm3.engines
class run( qm3.engines.template ):
def __init__( self, mol: object, meth: str, chrg: int,
mult: typing.Optional[int] = 1,
sel_QM: typing.Optional[numpy.array] = numpy.array( [], dtyp... | sergio-marti/ren-qm3 | qm3/engines/mopac.py | mopac.py | py | 4,789 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "qm3.data.engines",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "qm3.data",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "typing.Optional",... |
18607911301 | from django.conf.urls import url
from .views import *
urlpatterns = [
url(r'^work/$', work, name='work'),
url(r'^live/$', live, name='live'),
url(r'^training/$', training, name='training'),
url(r'^welfare/$', welfare, name='welfare'),
]
| PingFeng233/tencentHR | inTencent/urls.py | urls.py | py | 255 | python | en | code | 22 | github-code | 21 | [
{
"api_name": "django.conf.urls.url",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.co... |
18403600429 | import itertools; import math; import operator; import random; import re; from bisect import *; from collections import deque, defaultdict, Counter, OrderedDict; from heapq import *; import unittest; from typing import List;
def get_sol(): return Solution()
class TreeNode:
def __init__(self, val=0, left=None, right... | afzalsiddique/problem-solving | Problem_Solving_Python/leetcode/lc1080.py | lc1080.py | py | 3,020 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "collections.deque",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number": 66,
"usage_type": "attribute"
}
] |
9582912973 | import ccxt
import pandas as pd
import ta
from ta.momentum import RSI
import time
# Função para obter dados de criptomoedas da Binance
def get_binance_data(symbol, timeframe):
exchange = ccxt.binance()
ohlcv = exchange.fetch_ohlcv(symbol, timeframe)
df = pd.DataFrame(ohlcv, columns=['timestamp', 'open', 'h... | leooli-321/FIAP | Primeiro-semestre/#2 Computational Thinking Using Python/Atividades/outros/RSI2.py | RSI2.py | py | 1,517 | python | pt | code | 1 | github-code | 21 | [
{
"api_name": "ccxt.binance",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "ta.momentum.RSI",
... |
5158115664 | import cv2
import numpy
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
import os
# import gflags
import gflags
import sys
import time
import subprocess
def create_frame(frame, labels):
... | iskwak/DetetctingActionStarts | figures/make_thumos_movie.py | make_thumos_movie.py | py | 4,564 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 78,
"usage_type": "attribute"
},
{
"api_name": "cv2.CAP_PROP_FRAME_WIDTH",... |
3755487872 | #! /usr/bin/env python3
"""
Restore sites from xxLINK tape
Author: Johan van der Knijff
Example command line:
sudo python3 ~/kb/xxLINK-resources/scripts/restore-sites.py /home/johan/kb/xxLINK/tapes-DDS/2/file000001 /home/johan/kb/xxLINK/siteData-DDS/2
NOTE: running as sudo is needed bc of permissions set in source... | KBNLresearch/xxLINK-resources | scripts/restore-sites.py | restore-sites.py | py | 11,979 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.stderr.write",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "sys.stderr",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "subprocess.Popen",
"lin... |
15480541600 | # from selenium import webdriver
# External import
import re
import time
import requests
import json
import os
# Internal import
import util.current as current
from util.change_scale import encode_b64
from weibo.read_preset import read_preset
from util.str_check import is_contain_chinese
# Fixed global variables -... | oGsLP/img-crawler | crawl_weibo.py | crawl_weibo.py | py | 7,539 | python | en | code | 12 | github-code | 21 | [
{
"api_name": "time.sleep",
"line_number": 105,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 112,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 115,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number":... |
19804630524 | ###########################################
# main.py
# script principal del curso BigData
###########################################
import numpy as np
import pandas as pd
import os
import logging
from pathlib import Path
from tqdm import tqdm
#======================================================... | Rgalindo85/ESEIT_BigData_2022b | main.py | main.py | py | 3,932 | python | es | code | 0 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame.from_d... |
6773872229 | import discord
from discord.ext import commands
from dislash import slash_command, Option, OptionType
class Owner(commands.Cog):
def __init__(self, client):
self.client = client
@slash_command(description="Fait quitter le bot d'un serveur.")
async def leave(self, ctx, guild_id):
... | KucoDEV/Haikei | cogs/Owner.py | Owner.py | py | 580 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "dislash.slash_command",
"line_number": 9,
"usage_type": "call"
}
] |
20030469382 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Setup for rqt_rosbag_control """
import os
from setuptools import setup
package_name = 'rqt_rosbag_control'
setup(
name=package_name,
version='0.0.0',
packages=[package_name],
package_dir={'': 'src'},
data_files=[
('share/ament_index/resour... | Butakus/rqt_rosbag_control | setup.py | setup.py | py | 985 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "setuptools.setup",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_nu... |
18589000521 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Defines constants used in `astropy.samp`.
"""
from astropy.utils.data import get_pkg_data_filename
__all__ = [
"SAMP_STATUS_OK",
"SAMP_STATUS_WARNING",
"SAMP_STATUS_ERROR",
"SAFE_MTYPES",
"SAMP_ICON",
]
__profile_version__ = "1.... | astropy/astropy | astropy/samp/constants.py | constants.py | py | 825 | python | en | code | 4,015 | github-code | 21 | [
{
"api_name": "astropy.utils.data.get_pkg_data_filename",
"line_number": 37,
"usage_type": "call"
}
] |
11994158946 | from interface import get_menu_item
from delete_cont import delete_contact
from add_cont import add_contact
from finder import search_by
from show_db import show
def procedure():
while True:
choice = get_menu_item()
if choice == 1:
add_contact()
elif choice == 2:
de... | guesswhofoolsyou/python_homeworks | Seminar_8/controller.py | controller.py | py | 474 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "interface.get_menu_item",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "add_cont.add_contact",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "delete_cont.delete_contact",
"line_number": 14,
"usage_type": "call"
},
{
"api_name"... |
38594807674 | import datetime
import unittest
from backend.tasks import fetch_everything_for_researcher
from django.test import TestCase
import pytest
from papers.baremodels import BareAuthor
from papers.baremodels import BareName
from papers.baremodels import BarePaper
from papers.models import Name
from papers.models import Pape... | dissemin/dissemin | backend/tests/test_generic.py | test_generic.py | py | 4,017 | python | en | code | 166 | github-code | 21 | [
{
"api_name": "papers.baremodels.BarePaper",
"line_number": 30,
"usage_type": "argument"
},
{
"api_name": "django.test.TestCase",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "unittest.SkipTest",
"line_number": 43,
"usage_type": "call"
},
{
"api_name":... |
74991049973 | from configparser import ConfigParser
from sys import argv
from traceback import format_exc
from controller.controle_log import ControleLog
from os.path import join, dirname
from scripts import snmpget, snmpset, volume_particao
aplicacao, comando = argv[0], argv[1]
log = ControleLog(join(dirname(aplicacao), 'log'), Tr... | danilo-aalmeida/fean-gerencia-de-redes | principal_smnp.py | principal_smnp.py | py | 4,563 | python | pt | code | 0 | github-code | 21 | [
{
"api_name": "sys.argv",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "controller.controle_log.ControleLog",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.dirnam... |
6837482660 | from collections import defaultdict
class Solution:
def isHappy(self, n: int) -> bool:
hashtable = defaultdict(int)
while True:
summ = 0
while n!=0:
summ+=(n%10)**2
n = n//10
if summ == 1:
return True
el... | zelzhan/Challenges-and-contests | LeetCode/HappyNumber.py | HappyNumber.py | py | 426 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "collections.defaultdict",
"line_number": 4,
"usage_type": "call"
}
] |
22089554090 | import scanpy as sc
import matplotlib.pyplot as plt
import matplotlib
import numpy as np
output_file_path = "/storage/singlecell/zz4/fetal_snakemake/figures/figure6/"
matplotlib.rcParams.update({"font.size": 25})
adata_result = sc.read("/storage/singlecell/zz4/fetal_snakemake/results/multivelo_recover_dynamics_run_umap... | zhenzuo2/Human-Developmental-Retina-Atlas | figures/figure2/plot_PRPC_precurors_annotation.py | plot_PRPC_precurors_annotation.py | py | 907 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "matplotlib.rcParams.update",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "scanpy.read",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.na... |
16731727852 | import numpy as np
from argparse import Namespace
from copy import deepcopy
from itertools import chain
from typing import Dict, List
import pytorch_lightning as pl
from albumentations.pytorch import ToTensorV2
from torch import optim
import torch.nn.functional as f
import random
from typing import Callable, Tuple, Uni... | btseytlin/kaggle_cassava | src/cassava/models/byol.py | byol.py | py | 6,505 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.Tensor",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "torch.nn.functional.normalize",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.nn.functional",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "torch.... |
37944263367 | from __future__ import annotations
import copy
import functools
import inspect
from itertools import groupby
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
List,
Optional,
Sequence,
Set,
Tuple,
Type,
TypeVar,
Union,
)
from typing import cast as typing_cast
fro... | abersheeran/kui | kui/parameters/__init__.py | __init__.py | py | 14,614 | python | en | code | 276 | github-code | 21 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "typing.TypeVar",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "typing.Callable",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "typing_extensions... |
38132964176 | #!/bin/python
# -*- coding: utf-8 -*-
# Kage personal stuff
#
from __future__ import print_function
import os
import re
import sys
import ast
import ssl
import stat
import time
import uuid
import zlib
import copy
import smtplib
import tarfile
import zipfile
import random
import struct
import string
import fnmatch
impor... | kagepark/kmisc | kmisc/__init__.py | __init__.py | py | 153,332 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "re.compile",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 267,
"usage_type": "call"
},
{
"api_name": "re.escape",
"line_number": 343,
"usage_type": "attribute"
},
{
"api_name": "re.split",
"line_number": 3... |
23093292539 | import networkx as nx
import matplotlib.pyplot as plt
import numpy as np
import random
import pandas as pd
from collections import defaultdict
def drawGraph(min, max):
# Get 10 logarithmically spaced bins between kmin and kmax
bin_edges = np.logspace(np.log10(min), np.log10(max), num=100)
# histogram the ... | Nunuvin/cryptic_philanthropist | Analysis/Author_relationships/Authors_Stats.py | Authors_Stats.py | py | 1,445 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.logspace",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.log10",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.histogram",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",... |
28275989280 | import torch
from torch import nn
import torch.nn.modules as Model
import torchvision.models as models
import matplotlib.pyplot as plt
import torch
from torch import nn
from torch.utils.data import Dataset
from torchvision.datasets import ImageFolder
from torchvision import transforms
import numpy as np
class Res... | SuchiraLaknath/Image_Classification | Confution metrix.py | Confution metrix.py | py | 2,444 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.nn.Module",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "torchvision.models.resnet50",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torchvision... |
41596500751 | import fxcmpy
import numpy as np
from stocktrends import Renko
import statsmodels.api as sm
import time
import copy
con = fxcmpy.fxcmpy(access_token = "blacked out api key",
log_level = 'error', server = 'demo')
pairs = ['EUR/USD', 'GBP/USD', 'USD/CHF', 'AUD/USD', 'USD/CAD']
pos_size = 10
#calcu... | nnisheeth791/Trading-Bot | MACD_strat.py | MACD_strat.py | py | 6,807 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "fxcmpy.fxcmpy",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "stocktrends.Renko",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "statsmodels.api.add_consta... |
25284268030 | # -*- coding:utf8 -*-
from .utils import HTTP_METHOD
from ..transport import Transport
from ..exceptions import InvalidParameter
from .properties import (LOG_SUBSCRIPTION_HOST, GET_LOG_RESOURCE_PATH,
SUBSCRIPTION_POSITION_RESOURCE_PATH)
class StreamClient(object):
"""
The client for a... | NetEase-Cloudsearch/stream-python-sdk | stream/client/stream_client.py | stream_client.py | py | 3,388 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "transport.Transport",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "exceptions.InvalidParameter",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "exceptions.InvalidParameter",
"line_number": 50,
"usage_type": "call"
},
{
"api_n... |
73877835894 | import logging
import argparse
import time
import random
import string
import multiprocessing
logging.basicConfig(format='%(process)d %(asctime)s %(message)s')
def log(size):
content = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(size))
logging.warning('Watch out! %s', content... | gangtao/logtest | src/main.py | main.py | py | 1,211 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "logging.basicConfig",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "string.ascii_uppercase",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "string.d... |
22504155639 | import numpy as np
import matplotlib.pyplot as plt
from scipy import special
from scipy.spatial import distance_matrix
from scipy.optimize import lsq_linear
from scipy.special import psi, polygamma, betainc, gamma
import threading
class DirichletGOF:
def __init__(self, significance_level, dim, sample_size, crit_va... | HesitantlyHuman/hatespace | hatespace/analysis/dirichlet_tools/dirichlet_gof.py | dirichlet_gof.py | py | 6,963 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "numpy.linspace",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "scipy.special.gammaincinv",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "scipy.special",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "scipy.special.... |
73544705651 | import json
import logging
import requests
class NodeConnector:
def __init__(self, url):
self.url = url
def test_connection(self):
logging.info("Testing connection to the node...")
method = "web3_clientVersion"
payload = {
"jsonrpc": "2.0",
"method": met... | OxMarco/ethereum-lora | node_connector.py | node_connector.py | py | 954 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "logging.info",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "logging.error",
"line_number... |
21542235851 | import ctypes
import datetime
import json
import multiprocessing
import os
import minimalmodbus
import serial
import serial as serialutil
import time
# To setup modbus control
# COMMAND -> PROFILE="i/o propfile" and select modbus
schn_iname = ['Speed, rmp', 'Current, A', 'Torque, %', 'Volt, V', '5', '6', '7', '8'... | SergeyTya/testbench_server | schn.py | schn.py | py | 10,494 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "minimalmodbus.Instrument",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "ctypes.c_int16",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "ctypes.c_int16",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "ctypes.c_... |
5130771982 | import tensorflow as tf
import os
import time
import pandas as pd
from tensorflow.keras.models import Sequential
from sklearn.preprocessing import StandardScaler
from tensorflow.keras.layers import Dense
from tensorflow.keras.callbacks import EarlyStopping
from sklearn.model_selection import train_test_split
... | amalaj7/Keras | early_stopping.py | early_stopping.py | py | 1,537 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 20,
"usage_type": "call"
... |
31824978739 | from django.core.management.base import BaseCommand, CommandError
from lidapp.models import ID
import logging
class Command(BaseCommand):
args = '<identifier>'
help = 'Get metadata for an identifier'
def handle(self, *args, **options):
logger = logging.getLogger('lidapp.actions')
identifi... | gwu-libraries/idservice | lids/lidapp/management/commands/lookup.py | lookup.py | py | 662 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "lidapp.models.ID.objects.get",
"line_number": 14,
"usage_type": "call"
},
{
... |
4769332647 | __author__ = "Nicolas Sénave"
# __email__ = "email"
# NB: I will create an email for this project if some are interested by it.
__version__ = "0.0.1-SNAPSHOT"
from enum import Enum
from abc import ABC, abstractmethod
from typing import List
import re
import json
from random import randrange
from tkinter import Tk, ... | nsenave/chessopy | chessopy/__init__.py | __init__.py | py | 31,896 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "enum.Enum",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "abc.ABC",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 101,
"usage_type": "name"
},
{
"api_name": "json.load",
"line_number": 251,
... |
2058237753 | from .validation_models import *
def quick_test(model, duration=300, temperature=32, v_init=-65):
from patch import p
p.time
p.celsius = temperature
p.v_init = v_init
model.record_soma()
p.finitialize(v_init)
p.continuerun(duration)
from plotly import graph_objs as go
go.Figure(go... | dbbs-lab/models-old | dbbs_models/test/__init__.py | __init__.py | py | 402 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "patch.p.time",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "patch.p",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "patch.p.celsius",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "patch.p",
"line_numbe... |
10568983583 | from flask import request, jsonify, Blueprint
from api.schemas.orders_schema import orders_schema
from api.models.orders import Orders
api = Blueprint('orders_api', __name__)
@api.route("/orders")
def orders():
all_orders = Orders.query.all()
if not all_orders:
return jsonify({
"message... | ialmoqren/learning-python | api/controller/orders.py | orders.py | py | 464 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "api.schemas.orders_schema",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "flask.Blueprint",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "api.models.orders.Orders.query.all",
"line_number": 11,
"usage_type": "call"
},
{
"api_na... |
31079136063 | from urllib.request import urlopen
from bs4 import BeautifulSoup
import io
import sys
#ABCの回数
times="040"
#問題
problem="d"
# 1. Get a html.
with urlopen("https://atcoder.jp/contests/abc{0}/tasks/abc{0}_{1}".format(times, problem)) as res:
html = res.read().decode("utf-8")
# 2. Load a html by BeautifulSoup.
soup = B... | katonyonko/ABC040 | ABC040_D.py | ABC040_D.py | py | 2,448 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "io.StringIO",... |
38127511545 | from fastapi import APIRouter, HTTPException, Depends, Header
from sqlalchemy.orm import Session
from orm import database, models
from internal import schemas, middleware
router = APIRouter(
prefix="/asset",
tags=["asset"],
responses={404: {"description": "Not found"}},
)
@router.get("/", response_model=... | Kavianex/exchange-market-service | app/routers/assets.py | assets.py | py | 1,105 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "fastapi.Depends",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "orm.database.... |
31373023767 | import re
import pytest
@pytest.mark.smoke
@pytest.mark.regression
@pytest.mark.ci
def test_sign_out(open_main_page):
open_main_page.click_sign_out()
assert open_main_page.get_title() == "Scouts panel - sign in", "Main page was not opened"
@pytest.mark.smoke
@pytest.mark.ci
def test_find_elements(open_main_... | DergachovaAnna/python_autotests_hillel | lesson_19/all_tests/tests_ui/test_main_page.py | test_main_page.py | py | 1,972 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pytest.mark",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pytest.mark",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pytest.mark",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pytest.mark",
"li... |
3902033781 | from fastapi import APIRouter, HTTPException, Depends, Body
from fastapi.security import HTTPBearer
import httpx
import load_envs as _envs
router = APIRouter()
token_auth_scheme = HTTPBearer(auto_error=False)
# NOTE : [oauth2_scheme] obj looks like this : { scheme = 'Bearer', credentials = 'xxxtokenxxx' }
@router.... | Jackk-Doe/D-Reddit-Microservices-backend-app | client-API-gateway/app/routes/posts.py | posts.py | py | 6,829 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "fastapi.security.HTTPBearer",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "httpx.get",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "load_envs.POST_... |
33193535072 | import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import tifffile
from operator import itemgetter
from skimage.filters import gaussian
from functions import init_fig, gfp
import ca_source_extraction as cse # https://github.com/j-friedrich/CaImAn/tree/multi-scale_paper
if matplotlib.__version__[0] =... | j-friedrich/multi-scale | fig4.py | fig4.py | py | 3,290 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "matplotlib.__version__",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.style.use",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.style",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name":... |
26815833073 | #!/usr/bin/env python3
_license = """
big
Copyright 2022-2023 Larry Hastings
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation... | larryhastings/big | tests/bigtestlib.py | bigtestlib.py | py | 3,531 | python | en | code | 22 | github-code | 21 | [
{
"api_name": "pathlib.Path",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 55,
"usage_type": "attribute"
},
{
"api_name": "sys.path",
"line_number": 67,
"usage_type": "attribute"
},
{
"api_name": "sys.path.insert",
"line_... |
73036469813 | import unittest
from cupy import testing
@testing.parameterize(
{'actual': {'a': [1, 2], 'b': [3, 4, 5]},
'expect': [{'a': 1, 'b': 3}, {'a': 1, 'b': 4}, {'a': 1, 'b': 5},
{'a': 2, 'b': 3}, {'a': 2, 'b': 4}, {'a': 2, 'b': 5}]},
{'actual': {'a': [1, 2]}, 'expect': [{'a': 1}, {'a': 2}]},
... | LiuFang816/SALSTM_py_data | python/pfnet_chainer/chainer-master/tests/cupy_tests/testing_tests/test_parameterized.py | test_parameterized.py | py | 588 | python | hi | code | 9 | github-code | 21 | [
{
"api_name": "unittest.TestCase",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "cupy.testing.product",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cupy.testing",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "cupy.testing... |
41493072766 | import time
import nidaqmx
from nidaqmx.constants import AcquisitionType, RegenerationMode
from nidaqmx.stream_writers import AnalogMultiChannelWriter
import numpy as np
import config
from coils.waveform import Waveform
def turn_off():
with nidaqmx.Task() as task_o:
# Define voltage output channels for ... | spuulis/haematite | coils/coils.py | coils.py | py | 4,282 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "nidaqmx.Task",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "config.COILS_NAME_OX",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "config.COILS_NAME_OY",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "coil... |
41893439093 | # -*- coding: utf-8 -*-
"""
Created on Wed Nov 17 09:19:21 2021
@author: Juan
"""
import streamlit as st
import plotly.graph_objects as go
from plotly.subplots import make_subplots
import pandas as pd
from datetime import datetime
#1.-----Downloads data
df = pd.read_csv("https://raw.githubusercontent... | juandavid7777/BTC-dashboard | Dashboard_BTC.py | Dashboard_BTC.py | py | 5,962 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "plotly.graph_objects.Figure",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "plotly.graph_objects",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "plot... |
24414776557 | """foodexpress URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-b... | Deependra12/food-express | foodexpress/urls.py | urls.py | py | 1,933 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.urls.path",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "... |
23998144068 | import requests
import jinja2
import http.server
import socketserver
from refresh import Refresh
from secrets import spotify_user_id, discover_weekly_id
# Brings in variables from secrets.py
class PlaylistSongs:
def __init__(self):
self.user_id = spotify_user_id
self.spotify_token = ""
sel... | jordan-sussman/discover-weekly-gallery | app.py | app.py | py | 2,083 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "secrets.spotify_user_id",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "secrets.discover_weekly_id",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "secrets.discover_weekly_id",
"line_number": 21,
"usage_type": "argument"
},
{
... |
40319057326 | import numpy as np
import os
import torch
import torch.utils.data as data
import torchvision.transforms as transforms
from PIL import Image
import utils
import h5py
class CelebA_synthetic(data.Dataset):
def __init__(self, data_path, attr_path, syn_data_path, image_size, mode, selected_attrs, attrs_d):
sup... | jiazhi412/strong_attribute_bias | dataloader/CelebA_train_synthetic.py | CelebA_train_synthetic.py | py | 4,540 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.utils.data",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "numpy.loadtxt",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.st... |
10535573690 | import cv2
import time
import numpy as np
import math
from ctypes import cast, POINTER
from comtypes import CLSCTX_ALL
from pycaw.pycaw import AudioUtilities, IAudioEndpointVolume
import HandtrackingModule as htm
def run_volume_control():
wCam, hCam = 848, 488
# Creating a video capture object to ... | Annamjohn/Gesture-Based-System-Control | v.py | v.py | py | 3,373 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "HandtrackingModule.handDetector",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pycaw.pycaw.AudioUtilities.GetSpeakers",
"line_number": 23,
"usage_type": "call"
},
... |
18361921481 | import yaml,os,sys,datetime
def gen_prot_dict():
"""
:param input_list:
:return:
"""
from .protocols import Stock_solution,MonoDispensing_type1,MonoDispensing_type2,MultiBase,SMTransfer,ReactionQC,QCSolubilise,DMATransfer,\
PostWorkupTransfer,Workup,PostWorkupQCAndTransfer,PostWorkupDMSOAdd... | xchem/opentrons | xchem_ot/utils/parser.py | parser.py | py | 3,489 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "protocols.Stock_solution",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "protocols.MonoDispensing_type1",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "protocols.MonoDispensing_type2",
"line_number": 10,
"usage_type": "name"
},
{... |
72071455733 | from skimage import io, transform
import os
import numpy as np
import torch
from torch.utils.data import Dataset, DataLoader
from torch.utils.data.dataloader import default_collate
import torch.nn as nn
import torch.nn.functional as F
import torchvision.models as models
import matplotlib.pyplot as plt
class SoNDatase... | dmarcosg/CSIB | utils.py | utils.py | py | 22,076 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "numpy.float32",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "skimage.io.imread",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "skimage.io",... |
32718031838 | import numpy as np
import pandas as pd
from scipy import interpolate
class WeeklyKernelInterpolation:
def __init__(self, smooth):
self.freq = pd.to_timedelta('1min')
self.timesteps_per_day = pd.to_timedelta('24H') / self.freq
self.smooth = smooth
def norm(self, XA, XB):
... | niklascp/vehicletracker | vehicletracker/models/WeeklyKernelInterpolation.py | WeeklyKernelInterpolation.py | py | 1,533 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.to_timedelta",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.to_timedelta",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.vstack",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.to_timedel... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.