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
10193639226
from django.contrib import admin from django.forms import ModelForm from services.models import Service, ServiceMain from users.models import UserProfile # Register your models here. class ServiceAdmin(admin.ModelAdmin): list_display = ['id', 'name', 'service_main', 'price', 'is_active'] list_display_links =...
AsuraBot/klinika
services/admin.py
admin.py
py
791
python
en
code
0
github-code
97
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 9, "usage_type": "name" }, { "api_name": "django.contrib.admin.TabularInline", "line_number": 16, "usage_type": "attribute"...
9195867201
import textwrap from typing.io import BinaryIO def calc_char(t, x): if x - 1 <= (t % 40) <= x+1: return '#' return '.' def main_b(fp: BinaryIO): x = 1 t = 0 value = '' for line in fp.readlines(): value += calc_char(t, x) t += 1 if b'addx' in line: [...
RensHam/aoc22
aoc/day_10/main_b.py
main_b.py
py
480
python
en
code
0
github-code
97
[ { "api_name": "typing.io.BinaryIO", "line_number": 10, "usage_type": "name" }, { "api_name": "textwrap.wrap", "line_number": 22, "usage_type": "call" } ]
21359705487
import config from flask import Flask, Response, request from twilio import twiml from twilio.rest import TwilioRestClient app = Falsk(__name__) client = TwilioRestClient(config.TWILIO_ACCOUNT_SID, config.TWILIO_AUTH_TOKEN) @app.route('/call', method=['POST']) def outbound_call(): response=twiml.Response() call=c...
SoniaComp/Automated_Python
voice/voice_outbound.py
voice_outbound.py
py
700
python
en
code
0
github-code
97
[ { "api_name": "twilio.rest.TwilioRestClient", "line_number": 7, "usage_type": "call" }, { "api_name": "config.TWILIO_ACCOUNT_SID", "line_number": 7, "usage_type": "attribute" }, { "api_name": "config.TWILIO_AUTH_TOKEN", "line_number": 7, "usage_type": "attribute" }, {...
15123497320
import os import torch ### USER-SET CONFIG ### LEARNING_RATE = 0.001 VALID_EVERY = 20 NUM_EPOCH = 20 BATCH_SIZE = 100 DATA_SOURCE = 'DBLP' # KDD, LUCA, DBLP MODEL_TYPE = 'Many2One' # 'Many2Many', 'Many2One' ,'Many2OneAttention' # MODEL_TYPE = 'Many2Many' TEST_RATIO = 0.15 SEED = 1 EMBEDDING_DIM = 50 DEVICE = torch.dev...
DaehanKim/citation_count_prediction
setting.py
setting.py
py
1,303
python
en
code
1
github-code
97
[ { "api_name": "torch.device", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number":...
6293905958
import sounddevice as sd import pyogg_test import numpy import math sd.default.samplerate = 48000 #48Khz sampling rate sd.default.channels = 2, 2 #2 channels for input two channels for output print(f"Sound devices available to you are: \n {sd.query_devices()}\n") input_Dev = int(input("Please enter the ID va...
Bibostin/Mukkava-Legacy
testing/first_party_tests/sounddevice_experimentation/sd_record_playback_test.py
sd_record_playback_test.py
py
802
python
en
code
0
github-code
97
[ { "api_name": "sounddevice.default", "line_number": 6, "usage_type": "attribute" }, { "api_name": "sounddevice.default", "line_number": 7, "usage_type": "attribute" }, { "api_name": "sounddevice.query_devices", "line_number": 9, "usage_type": "call" }, { "api_name...
32194038255
# -*- coding: utf-8 -*- """ This module is for use of standalone scripts only """ from django_env import Env import django def configure_settings(env=None): if env is None: env = Env(readenv=True, parents=True) env.setdefault('DJANGO_SETTINGS_MODULE', 'conf') django.setup()
Uniquode/uniquode2
app/core/utils/configure.py
configure.py
py
299
python
en
code
0
github-code
97
[ { "api_name": "django_env.Env", "line_number": 11, "usage_type": "call" }, { "api_name": "django.setup", "line_number": 15, "usage_type": "call" } ]
35612966385
#!/usr/bin/env python2 from __future__ import print_function from collections import defaultdict, namedtuple import os.path import sys import glob from jinja2 import Environment, FileSystemLoader import yaml import netaddr RRFields = namedtuple('RRFields', ['rtype', 'rdata']) TEMPLATE_ENVIRONMENT = Environment( ...
cwoodfield/hackathon71
base_configs/gen_zone.py
gen_zone.py
py
3,638
python
en
code
0
github-code
97
[ { "api_name": "collections.namedtuple", "line_number": 15, "usage_type": "call" }, { "api_name": "jinja2.Environment", "line_number": 18, "usage_type": "call" }, { "api_name": "jinja2.FileSystemLoader", "line_number": 20, "usage_type": "call" }, { "api_name": "col...
770141566
import pickle from matplotlib import pyplot as plt import numpy as np from polynomial_model import add_polynomial_features import pandas as pd from mylinearregression import MyLinearRegression as MyLR from data_splitter import data_splitter from typing import Tuple THETAS_FILE = 'models.pickle' CSV_FILE_PATH = '../re...
42pde-bakk/ml_modules
module02/ex10/benchmark_train.py
benchmark_train.py
py
1,751
python
en
code
0
github-code
97
[ { "api_name": "pandas.read_csv", "line_number": 17, "usage_type": "call" }, { "api_name": "data_splitter.data_splitter", "line_number": 21, "usage_type": "call" }, { "api_name": "typing.Tuple", "line_number": 15, "usage_type": "name" }, { "api_name": "numpy.ndarra...
10230702092
#! /usr/bin/env python3 import requests import re import json import wikiUtil from sys import argv if __name__ == '__main__': SNintendo = requests.Session() for arg in argv[1:]: if not re.match(r'\d+', arg): continue nb = int(arg) content = SNintendo.get(url=f'https://support.fire-e...
pival13/FehWikiBot
MSResult.py
MSResult.py
py
1,664
python
en
code
3
github-code
97
[ { "api_name": "requests.Session", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 13, "usage_type": "name" }, { "api_name": "re.match", "line_number": 14, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 18...
6733548715
import requests, uuid, json, os, sys, shutil from pathlib import Path from glob import glob key = sys.argv[1] language_code = sys.argv[2] english_dir = f"{os.getcwd()}/wakawatch/fastlane/metadata/en-US/" metadata_dir = f"{os.getcwd()}/wakawatch/fastlane/metadata/{language_code}/" os.makedirs(metadata_dir) for file_na...
uioporqwerty/waka-watch
scripts/translate-metadata.py
translate-metadata.py
py
1,822
python
en
code
4
github-code
97
[ { "api_name": "sys.argv", "line_number": 5, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 7, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 8, ...
22098403740
import pytest from fastapi.testclient import TestClient from pytest_mock import MockerFixture from merino.config import settings from merino.exceptions import InvalidProviderError from merino.main import app from merino.providers import ProviderType, get_providers, init_providers @pytest.mark.asyncio async def test_...
0c0w3/merino-py
tests/unit/providers/test_init_providers.py
test_init_providers.py
py
1,594
python
en
code
null
github-code
97
[ { "api_name": "merino.providers.init_providers", "line_number": 15, "usage_type": "call" }, { "api_name": "merino.providers.get_providers", "line_number": 17, "usage_type": "call" }, { "api_name": "merino.providers.ProviderType.ADM", "line_number": 20, "usage_type": "attr...
16528871678
import numpy as np import os import os.path import h5py import pandas as pd import sys from sklearn.cluster import DBSCAN from scipy.spatial import ConvexHull #from hnnd import hNND filename = 'clusters RTX sim data high res/simulated_hexamers_width_100000.0.hdf5' # filename epsilon = 32.51 # radius e.g. 32.5 minpts ...
jungmannlab/resi
simulations for CD20/dbscan-circularity-simulateddata_hdf5.py
dbscan-circularity-simulateddata_hdf5.py
py
11,556
python
en
code
2
github-code
97
[ { "api_name": "numpy.vstack", "line_number": 18, "usage_type": "call" }, { "api_name": "scipy.spatial.ConvexHull", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.vstack", "line_number": 37, "usage_type": "call" }, { "api_name": "scipy.spatial.Conv...
13308984796
from nose.tools import eq_ from mock import MagicMock from buffpy.models.link import Link def test_links_shares(): ''' Test link's shares retrieving from constructor ''' mocked_api = MagicMock() mocked_api.get.return_value = {'shares': 123} link = Link(api=mocked_api, url='www.google.com') eq_(link...
cponeill/GrowthHackingTools
tweet-bot/buffpy/tests/test_link.py
test_link.py
py
897
python
en
code
1
github-code
97
[ { "api_name": "mock.MagicMock", "line_number": 11, "usage_type": "call" }, { "api_name": "buffpy.models.link.Link", "line_number": 14, "usage_type": "call" }, { "api_name": "nose.tools.eq_", "line_number": 16, "usage_type": "call" }, { "api_name": "mock.MagicMock"...
24122929977
import datetime import logging import os import time import numpy as np import pandas as pd import sys from monetio.models import hytraj from utilhysplit import hcontrol from utilhysplit.runhandler import ProcessList from utilvolc.utiltraj import combine_traj from ashapp.ashtrajectory import TrajectoryAshRun logger =...
noaa-oar-arl/utilhysplit
ashapp/backtraj.py
backtraj.py
py
6,946
python
en
code
9
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "ashapp.ashtrajectory.TrajectoryAshRun", "line_number": 57, "usage_type": "name" }, { "api_name": "pandas.DataFrame", "line_number": 60, "usage_type": "call" }, { "api_name...
27558509290
from random import randint import importlib import pkgutil def play_operation(): discovered_plugins = [ e.load() for e in importlib.metadata.entry_points()[ "core_software.operations" ]] # Select trigger = randint(0 , len(discovered_plugins)-1) operation = discovered_plu...
LAShemilt/plugins_example_operation
core_software/__init__.py
__init__.py
py
550
python
en
code
0
github-code
97
[ { "api_name": "importlib.metadata.entry_points", "line_number": 9, "usage_type": "call" }, { "api_name": "importlib.metadata", "line_number": 9, "usage_type": "attribute" }, { "api_name": "random.randint", "line_number": 15, "usage_type": "call" } ]
19041011571
#!/usr/bin/python3 ''' Python script to export data in the CSV format. ''' if __name__ == "__main__": import csv import requests from sys import argv urlUser = 'https://jsonplaceholder.typicode.com/users/' + argv[1] response_name = requests.get(urlUser) name = response_name.json()['username'] ...
rafyc/holbertonschool-system_engineering-devops
0x15-api/1-export_to_CSV.py
1-export_to_CSV.py
py
722
python
en
code
0
github-code
97
[ { "api_name": "sys.argv", "line_number": 11, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 20, ...
28212679546
from django.db import models from django.contrib.auth import get_user_model User = get_user_model() class Group(models.Model): """Класс модели записи группы""" title = models.CharField( max_length=200, verbose_name='Заголовок', ) slug = models.SlugField( max_length=200, ...
ZaripovRafael/django_blog
yatube/posts/models.py
models.py
py
1,663
python
ru
code
0
github-code
97
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 5, "usage_type": "call" }, { "api_name": "django.db.models.Model", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 8, "usage_type": "name" }, { "api_...
18836902484
import logging import discord from discord import app_commands, Interaction from discord.app_commands import Range from discord.ext import commands from handler.context import Context from handler.view import DropdownView from pepebot import PepeBot from datetime import timedelta import typing from typing import Opt...
0xgreenapple/peepbot
cogs/setup.py
setup.py
py
35,125
python
en
code
0
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 27, "usage_type": "call" }, { "api_name": "pepebot.PepeBot", "line_number": 30, "usage_type": "name" }, { "api_name": "discord.ext.commands.Cog", "line_number": 34, "usage_type": "attribute" }, { "api_name": "disco...
35917547015
import cv2 import numpy as np cap = cv2.VideoCapture(0) while(1): # Take each frame _, frame = cap.read() hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) lower_red = np.array([30,150,50]) upper_red = np.array([255,255,180]) mask = cv2.inRange(hsv, lower_red, upper_red) res = cv2.bi...
absterjr/Machine-Learning-and-OpenCV
Open CV/Edge Detection/Gradient.py
Gradient.py
py
915
python
en
code
4
github-code
97
[ { "api_name": "cv2.VideoCapture", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2HSV", "line_number": 10, "usage_type": "attribute" }, { "api_name": "numpy.array", ...
654460804
from simpful import * import matplotlib.pylab as plt from numpy import linspace, array FS = FuzzySystem() S_1 = FuzzySet(function=Triangular_MF(a=0, b=0, c=5), term="poor") S_2 = FuzzySet(function=Triangular_MF(a=0, b=5, c=10), term="good") S_3 = FuzzySet(function=Triangular_MF(a=5, b=10, c=10), term="excellent") FS....
aresio/simpful
examples/example_output_surface.py
example_output_surface.py
py
1,943
python
en
code
102
github-code
97
[ { "api_name": "numpy.linspace", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 39, "usage_type": "call" }, { "api_name": "numpy.array", "line_num...
44263465702
import pathlib from os.path import join import itertools from typing import Any import matplotlib.pyplot as plt from pytorch_lightning.utilities.types import STEP_OUTPUT import pytorch_lightning as pl import torch.nn as nn from .observable_layers import ObservableLayersChans from general.utils import max_min_norm, ...
TheodoreAouad/Bimonn_ICIP2022
deep_morpho/observables/plot_parameters.py
plot_parameters.py
py
7,041
python
en
code
2
github-code
97
[ { "api_name": "observable_layers.ObservableLayersChans", "line_number": 18, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 64, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 65, "usage_type": "call" }, { "api_name": "os....
43740779910
import argparse import json from pathlib import Path from typing import Any import torch from torch.utils.data import DataLoader from transformers import AdamW, BertConfig, BertForMaskedLM from hparams import Hyperparameter from preprocess import Preprocessor import torch import torch.nn as nn import wandb def get_...
Gyu-Seok0/CMU
Deep learning/Team Project/code/train_test_accept.py
train_test_accept.py
py
8,885
python
en
code
0
github-code
97
[ { "api_name": "typing.Any", "line_number": 26, "usage_type": "name" }, { "api_name": "torch.utils.data.DataLoader", "line_number": 26, "usage_type": "name" }, { "api_name": "torch.device", "line_number": 26, "usage_type": "attribute" }, { "api_name": "torch.no_gra...
73880302719
import json from datetime import datetime class Flow(): def __init__(self, timestamp=None, clientIP=None, serverIP=None, clientPort=None, serverPort=None, duration=None, _id=None, initFwdLength=-1, initBwdLength=-1, fwdHeaderLength=0, bwdHeaderLength=0, fwdBytes=0, bwdBytes=0, fwdPackets=0, bwdPackets=0, fwdPacke...
ZacharyGroff/IDS-Dataset-Generation
models/flow.py
flow.py
py
7,102
python
en
code
0
github-code
97
[ { "api_name": "datetime.datetime.strptime", "line_number": 104, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 104, "usage_type": "name" }, { "api_name": "datetime.datetime.strptime", "line_number": 105, "usage_type": "call" }, { "api_na...
74574995839
import matplotlib.pyplot as plt # 그래프 생성/이미지화 모듈 x = [1,4,9,16,25,36,49,64] y = [i for i in range(1, 9)] plt.plot(x, y, 'r') # 문자열은 색상/반환타입의 속성이다 plt.title('matplotlib sample') plt.xlabel('x value') plt.ylabel('y value') plt.show()
yoon92kr/Just_Run_Python
Code107.py
Code107.py
py
300
python
ko
code
0
github-code
97
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 8, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.title", "line_number": 11, "usage_type": "call" }, { "api_name": "matplo...
41436205806
import pytorch_lightning as pl from pytorch_lightning.callbacks import (DeviceStatsMonitor, ModelCheckpoint, LearningRateMonitor) from pytorch_lightning.callbacks.progress import TQDMProgressBar from pytorch_lightning import Trainer, loggers as pl_loggers from configs import...
adnan33/Glue_Tube_Length_Keypoint_Detection
training.py
training.py
py
2,996
python
en
code
0
github-code
97
[ { "api_name": "pytorch_lightning.seed_everything", "line_number": 16, "usage_type": "call" }, { "api_name": "pytorch_lightning.loggers.TensorBoardLogger", "line_number": 26, "usage_type": "call" }, { "api_name": "pytorch_lightning.loggers", "line_number": 26, "usage_type"...
30954526689
import click import json import os from LapisParser import * @click.command() @click.option('--source') @click.option('--name') @click.option('--method') @click.option('--out') def main(source, name, method, out): ans = dict() ans['data'] = dict() ans['succeed'] = False ans['errors'] = list() sou...
llylly/LapisServer
worker/datagen.py
datagen.py
py
1,086
python
en
code
0
github-code
97
[ { "api_name": "json.dump", "line_number": 25, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 46, "usage_type": "call" }, { "api_name": "click.command", "line_number": 7, "usage_type": "call" }, { "api_name": "click.option", "line_number": 8,...
6127962471
""" 图像处理 更改颜色空间 图像的几何变换 图像阈值 平滑图像 形态转换 图像梯度 Canny边缘检测 图像金字塔 OpenCV中的轮廓 OpenCV中的直方图 OpenCV中的图像转换 模板匹配 霍夫线变换 霍夫圆变换 基于分水岭算法的图像分割 基于GrabCut算法的交互式前景提取 """ import cv2 import numpy as np """ ████ ▒▒███ ▒███ ▒███ ▒███ ▒███ █████ ▒▒▒▒▒ 更改颜色空间 """ #%%...
Mazmots/pytorchProject
learning_opencv/c04.py
c04.py
py
14,040
python
zh
code
0
github-code
97
[ { "api_name": "cv2.imread", "line_number": 46, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 47, "usage_type": "call" }, { "api_name": "cv2.COLOR_RGB2GRAY", "line_number": 47, "usage_type": "attribute" }, { "api_name": "cv2.cvtColor", "l...
18559536621
from django.urls import path from .views import PostsList, PostDetail, PostCreate, PostUpdate, PostDelete, PostSearch, CategoryListView, subscribe, unsubscribe from django.views.decorators.cache import cache_page urlpatterns = [ path('', cache_page(60)(PostsList.as_view()), name='posts_list'), path('<int:pk>', c...
vikapavsk/django_news
NewsPaper/news/urls.py
urls.py
py
878
python
en
code
0
github-code
97
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.views.decorators.cache.cache_page", "line_number": 6, "usage_type": "call" }, { "api_name": "views.PostsList.as_view", "line_number": 6, "usage_type": "call" }, { "ap...
25582844087
import os import json import collections from pathlib import Path from appdirs import AppDirs from typing import Any, Optional, Iterable, Dict, Tuple from ..extra.utils import nested_dict_update, load_playlist class Model: def __init__( self, state_fname: Optional[Path] = None, log_fnam...
kpj/Vydia
vydia/core/model.py
model.py
py
2,871
python
en
code
11
github-code
97
[ { "api_name": "typing.Optional", "line_number": 16, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 16, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 17, "usage_type": "name" }, { "api_name": "pathlib.Path", "line...
22112060824
""" https://leetcode.com/problems/maximum-subarray/ did this before but still ran into nails.. kind of subtle.. not sure if I can come up with this in a stressful interview environment """ from typing import List class Solution: def maxSubArray(self, nums: List[int]) -> int: prefixSum = nums[0] ...
kangxie-colorado/leetcode-and-notes
previous_run/370.53.maxSubarry.py
370.53.maxSubarry.py
py
2,059
python
en
code
0
github-code
97
[ { "api_name": "typing.List", "line_number": 14, "usage_type": "name" } ]
32588833413
import scipy.integrate as integrate import scipy.stats as stats import numpy as np from numpy import sqrt, pi, sin, radians import matplotlib.pyplot as plt # Constructive-destructive-interference t = np.arange(0, 1+0.01, 0.01) y1 = sqrt(2)*sin(2*pi*t) energy1 = integrate.quad(lambda t: (sqrt(2)*sin(2*pi*t))**2, 0, 1) ...
kimdoanh89/Multiple-antenna-communications
docs/01-constructive-destructive-interference.py
01-constructive-destructive-interference.py
py
1,763
python
en
code
1
github-code
97
[ { "api_name": "numpy.arange", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 9, "...
35658965437
""" function for plotting the AbMetaAnalysis results """ # Info __author__ = 'Boaz Frankel' # Imports import pandas as pd import numpy as np from matplotlib import pyplot as plt from matplotlib.lines import Line2D import seaborn as sns import math from changeo.Gene import getFamily import typing def plot_compare_to...
boazfran/AbMetaAnalysis
AbMetaAnalysis/Plot.py
Plot.py
py
17,630
python
en
code
0
github-code
97
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 26, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 26, "usage_type": "name" }, { "api_name": "numpy.arange", "line_number": 43, "usage_type": "call" }, { "api_name": "math.ceil",...
73385516158
"""Create reads Revision ID: 49b4cc7895ba Revises: 3f30d324d67d Create Date: 2023-09-20 21:01:20.431436 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '49b4cc7895ba' down_revision = '3f30d324d67d' branch_labels = None depends_on = None def upgrade(): # #...
wmaethner/PickEmLeague2023_Backend_Python
src/PickEmLeague/migrations/versions/49b4cc7895ba_create_reads.py
49b4cc7895ba_create_reads.py
py
1,211
python
en
code
0
github-code
97
[ { "api_name": "alembic.op.create_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy.Integ...
8664508772
from rest_framework import serializers from rest_framework.relations import SlugRelatedField from rest_framework.validators import UniqueTogetherValidator from posts.models import Comment, Post, Group, Follow, User class CommentSerializer(serializers.ModelSerializer): """Класс для преобразования сложных данных ...
irinaexzellent/api_final_yatube
yatube_api/api/serializers.py
serializers.py
py
2,408
python
ru
code
0
github-code
97
[ { "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.relations.SlugRelatedField", "line_number": 13, "...
32299023581
import mpmath; class Scorer: def score_edge(self,Gain,Sigma): G=Gain[0]; S=Sigma[0]; if G<=0: return mpmath.ln(1); if G<S: S=G; eps = mpmath.ln( 1.0/mpmath.ln(2)) / mpmath.ln(2); t0 = mpmath.power(2,-G-eps); t1 = mpmath.power(2,-S-eps); #print 't1: ',t1; t2 = (1.0/G) * mpmath....
K4RI/mirrors-digitbio-2022
codes_sources/globe_v20220213/edge_ranking.py
edge_ranking.py
py
682
python
en
code
0
github-code
97
[ { "api_name": "mpmath.ln", "line_number": 11, "usage_type": "call" }, { "api_name": "mpmath.ln", "line_number": 16, "usage_type": "call" }, { "api_name": "mpmath.power", "line_number": 18, "usage_type": "call" }, { "api_name": "mpmath.power", "line_number": 20...
9079002763
import pytest from unittest.mock import MagicMock, mock_open from collections import namedtuple @pytest.fixture() def mock_object(monkeypatch): def create_mock_object(object_path, **kwargs): mo = MagicMock(**kwargs) monkeypatch.setattr(object_path, mo) return mo return create_mock_obj...
splunk/pytest-splunk-addon
tests/unit/tests_standard_lib/conftest.py
conftest.py
py
2,002
python
en
code
51
github-code
97
[ { "api_name": "unittest.mock.MagicMock", "line_number": 9, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 6, "usage_type": "call" }, { "api_name": "unittest.mock.mock_open", "line_number": 18, "usage_type": "call" }, { "api_name": "pytest.f...
733662479
import plotly.graph_objects as go fig = go.Figure(data=[ go.Mesh3d( # Order of vertex matters! in this case is: A-B-C-D-DRONE x=[3, 9, 1, 3, 0], y=[9, 3, 3, 1, 0], z=[0, 0, 0, 0, 6], colorbar_title='z', # i, j and k give the vertices of triangles # here we re...
HusskyAngel/proyecto_final_computacion_grafica
Plotly_related/main.py
main.py
py
569
python
en
code
0
github-code
97
[ { "api_name": "plotly.graph_objects.Figure", "line_number": 3, "usage_type": "call" }, { "api_name": "plotly.graph_objects", "line_number": 3, "usage_type": "name" }, { "api_name": "plotly.graph_objects.Mesh3d", "line_number": 4, "usage_type": "call" }, { "api_nam...
587985529
import boltons.fileutils as bf import yaml import pkg_resources from distutils.dir_util import copy_tree import pprint from pathlib import Path import shutil import re from jinja2 import Environment, PackageLoader, select_autoescape resource_package = __name__ env = Environment( loader=PackageLoader("docker_app...
HouseOfAgile/docker-apps
docker_app_generator/fileutils.py
fileutils.py
py
3,627
python
en
code
0
github-code
97
[ { "api_name": "jinja2.Environment", "line_number": 15, "usage_type": "call" }, { "api_name": "jinja2.PackageLoader", "line_number": 16, "usage_type": "call" }, { "api_name": "jinja2.select_autoescape", "line_number": 17, "usage_type": "call" }, { "api_name": "re.s...
27321452962
"""Defines core consumer functionality""" import logging import confluent_kafka from confluent_kafka import Consumer from confluent_kafka.avro import AvroConsumer from confluent_kafka.avro.serializer import SerializerError from tornado import gen logger = logging.getLogger(__name__) class KafkaConsumer: """Def...
paulbulson/kafka_project
home/consumers/consumer.py
consumer.py
py
4,596
python
en
code
0
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "confluent_kafka.avro.AvroConsumer", "line_number": 52, "usage_type": "call" }, { "api_name": "confluent_kafka.Consumer", "line_number": 54, "usage_type": "call" }, { "api_...
24400021500
import json import time def genere_solution(): # a*x+b*y=c [10] resultat = [] for a in range(0, 10): for b in range(0, 10): for c in range(0, 10): tmp = {'a': a, 'b': b, 'c': c, 'result': []} resultat.append(tmp) for x in range(0, 10): ...
abarhub/pynumber
genere_solution_equation.py
genere_solution_equation.py
py
925
python
en
code
1
github-code
97
[ { "api_name": "time.time", "line_number": 26, "usage_type": "call" }, { "api_name": "time.time", "line_number": 30, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 33, "usage_type": "call" } ]
42601115636
from collections import defaultdict import numpy as np from abaqus_python_interface import ABQInterface from fat_eval.weakest_link.FEM_functions.elements import element_types from fat_eval.weakest_link.hazard_functions import weibull from fat_eval.fatigue_materials import materials from fat_eval.utilities.steel_data...
erolsson/fat_eval
fat_eval/weakest_link/weakest_link_evaluator.py
weakest_link_evaluator.py
py
2,585
python
en
code
0
github-code
97
[ { "api_name": "abaqus_python_interface.ABQInterface", "line_number": 15, "usage_type": "call" }, { "api_name": "fat_eval.utilities.steel_data.abaqus_fields", "line_number": 19, "usage_type": "argument" }, { "api_name": "fat_eval.weakest_link.FEM_functions.elements.element_types",...
30936283031
from typing import Dict, List, Optional, Tuple, Callable import numpy as np from tensorflow.keras.preprocessing.image import ImageDataGenerator, Iterator def _sanitize_class_balance( classes: List[int], class_balance: Optional[Dict[int, float]] = None ) -> Dict[int, float]: if class_balance is None: ...
DIAGNijmegen/bodyct-luna22-ismi-training-baseline
balanced_sampler.py
balanced_sampler.py
py
5,055
python
en
code
3
github-code
97
[ { "api_name": "typing.List", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 8, "usage_type": "name" }, { "api_name": "numpy.sum", "line_number": 1...
43560089957
import numpy as np import santas_path import random from datetime import datetime def create_particle(particle_size, x_min=0, x_max=4): """ Create a single particle :param particle_size: :param x_min: :param x_max: :return: """ particle = x_min + (x_max - x_min) * np.random.uniform(low...
hechmik/travelling_santa_metaheuristics
particle_swarm.py
particle_swarm.py
py
18,428
python
en
code
1
github-code
97
[ { "api_name": "numpy.random.uniform", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 15, "usage_type": "attribute" }, { "api_name": "numpy.random.uniform", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.ran...
8885637570
# This file hold EXTRACT functions from bs4 import BeautifulSoup from fipe.scripts.loggers import get_logger logger = get_logger(__name__) def scrape_complete_tbody(driver, new_columns: list[str]) -> dict: """ Extracts the HTML table within the tbody tags and returns the information as a dictionary. Ar...
doug-pires/de-fipe
fipe/elt/extract.py
extract.py
py
4,731
python
en
code
0
github-code
97
[ { "api_name": "fipe.scripts.loggers.get_logger", "line_number": 6, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 22, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 64, "usage_type": "call" }, { "api_name": "bs...
14946121450
"""empty message Revision ID: 2e7f50426ccf Revises: a2f5a0132bde Create Date: 2018-03-13 12:20:00.301645 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '2e7f50426ccf' down_revision = 'a2f5a0132bde' branch_labels = None depends_on = None def upgrade(): # ...
adyouri/lafza
migrations/versions/2e7f50426ccf_.py
2e7f50426ccf_.py
py
1,122
python
en
code
0
github-code
97
[ { "api_name": "alembic.op.create_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy.Integ...
3332183676
import requests def get_info(): response = requests.get(url="https://yobit.net/api/3/info") # Получаем инфу по парам with open("output_data/Yobit_data/info.txt", "w") as file: file.write(response.text) return response.text def get_ticker(coin1="btc", coin2="usd"): # Статистика за последние 24 ч...
AydaTop1GG/Crypto-Bot
Yobit/info_parser.py
info_parser.py
py
4,549
python
ru
code
0
github-code
97
[ { "api_name": "requests.get", "line_number": 4, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 13, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 23, "usage_type": "call" }, { "api_name": "requests.get", "line_number...
36350752772
import pandas as pd import math from scipy import spatial from sklearn.feature_extraction.text import TfidfVectorizer import pickle import nltk nltk.download('stopwords') nltk.download('punkt') from nltk.corpus import stopwords from nltk.tokenize import word_tokenize # ***********************************************...
placid-brain/50.045-IR-Project-2022
vsm.py
vsm.py
py
5,807
python
en
code
0
github-code
97
[ { "api_name": "nltk.download", "line_number": 9, "usage_type": "call" }, { "api_name": "nltk.download", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 23, "usage_type": "call" }, { "api_name": "sklearn.feature_extraction...
5688096354
# Author: Matthew Wicker from statsmodels.stats.proportion import proportion_confint import math import numpy as np import tensorflow as tf from tqdm import trange from . import attacks def propagate_interval(W, b, x_l, x_u, marg=0, b_marg=0): marg = tf.divide(marg, 2) b_marg = tf.divide(b_marg, 2) x_mu...
matthewwicker/BNNReachAvoid
deepbayes_prealpha/analyzers/verifiers.py
verifiers.py
py
24,576
python
en
code
2
github-code
97
[ { "api_name": "tensorflow.divide", "line_number": 12, "usage_type": "call" }, { "api_name": "tensorflow.divide", "line_number": 13, "usage_type": "call" }, { "api_name": "tensorflow.divide", "line_number": 15, "usage_type": "call" }, { "api_name": "tensorflow.math...
10442348557
#!/usr/bin/env python3 """ This module reads the data in... """ import numpy as np import pickle import os.path import random import logging logging.basicConfig(level=0) # This named tuple holds the matrices which make one minibatch class Matrices: def __init__(self, minibatch_size, max_sent_len, ngrams): ...
janissl/SRNNMT
data_dense.py
data_dense.py
py
7,831
python
en
code
0
github-code
97
[ { "api_name": "logging.basicConfig", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.int", "line_number": 23, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "lin...
1877929332
import logging from io import SEEK_CUR from typing import Iterable, Iterator from .exceptions import FlvDataError from .format import FlvDumper, FlvParser from .io_protocols import RandomIO from .models import BACK_POINTER_SIZE, FlvHeader, FlvTag from .utils import AutoRollbacker, OffsetRepositor __all__ = ...
acgnhiki/blrec
src/blrec/flv/io.py
io.py
py
3,535
python
en
code
408
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "io_protocols.RandomIO", "line_number": 20, "usage_type": "name" }, { "api_name": "format.FlvParser", "line_number": 28, "usage_type": "call" }, { "api_name": "exceptions.F...
29818055488
# -*- coding: utf-8 -*- """ Created on Sat Jan 2 00:02:58 2016 @author: owner """ import re import cv2 import numpy as np from decimal import Decimal def is_string_like(obj): try: obj + '' except (TypeError, ValueError): return False return True def array2string(array): if arra...
aoikaneko/RandomTreeWalk
data_io.py
data_io.py
py
5,361
python
en
code
0
github-code
97
[ { "api_name": "numpy.floating", "line_number": 31, "usage_type": "attribute" }, { "api_name": "decimal.Decimal", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.floating", "line_number": 40, "usage_type": "attribute" }, { "api_name": "decimal.Decim...
22024697782
import shesha.config as conf import shesha.constants as scons from shesha.constants import CONST from shesha.util import dm_util, influ_util, kl_util from shesha.util import hdf5_util as h5u import numpy as np import pandas as pd from scipy import interpolate from shesha.sutra_wrap import carmaWrap_context, Dms fr...
ANR-COMPASS/shesha
shesha/init/dm_init.py
dm_init.py
py
38,187
python
en
code
12
github-code
97
[ { "api_name": "os.environ", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 23, "usage_type": "attribute" }, { "api_name": "shesha.sutra_wrap.carmaWrap_context", "line_number": 26, "usage_type": "name" }, { "api_name": "t...
3050489486
import json from django.shortcuts import render from django.core.paginator import Paginator from django.http import HttpResponse from django.shortcuts import redirect from django.db.models import Q from django.utils import timezone from apps.pregunta.models import Pregunta, Respuesta from apps.usuario.models import Us...
dannysho/QuestionsAnswers
apps/pregunta/views.py
views.py
py
5,556
python
es
code
0
github-code
97
[ { "api_name": "apps.pregunta.models.Pregunta.objects.all", "line_number": 18, "usage_type": "call" }, { "api_name": "apps.pregunta.models.Pregunta.objects", "line_number": 18, "usage_type": "attribute" }, { "api_name": "apps.pregunta.models.Pregunta", "line_number": 18, "...
21399162410
from collections import Counter def common(str1, str2): dict1 = Counter(str1) dict2 = Counter(str2) common_dict = dict1 & dict2 if len(common_dict) == 0: return (-1) commonChars = list(common_dict.elements()) commonChars = sorted(commonChars) print("".join(commonChars)) if __na...
Pankaj145-pb/Front-technologies
common.py
common.py
py
406
python
en
code
0
github-code
97
[ { "api_name": "collections.Counter", "line_number": 3, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 4, "usage_type": "call" } ]
5022192318
import csv import collections from data_display.utils.string_display import get_strings_from_cache # use streams pre-emptively in case table sizes get very big from django.http import StreamingHttpResponse # Some copy-pasta from the django docs: class Echo: """ A dummy class used to fit the "writer" inte...
BushiDokaj/VEEP-Summer-Project
data_display/io/export.py
export.py
py
998
python
en
code
0
github-code
97
[ { "api_name": "collections.deque", "line_number": 23, "usage_type": "call" }, { "api_name": "data_display.utils.string_display.get_strings_from_cache", "line_number": 25, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 28, "usage_type": "call" }, { ...
11518666025
import argparse from components.muc4_tools import get_event_keywords from components.load_muc4 import load_muc4 def parse_args(): parser = argparse.ArgumentParser() parser.add_argument("--all-human-names", type=str, default="data/muc34/outputs/all-human-names.txt") args = parser.p...
Glaciohound/Schema_Induction
source/legacy/muc4_human_names.py
muc4_human_names.py
py
988
python
en
code
0
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "components.load_muc4.load_muc4", "line_number": 17, "usage_type": "call" }, { "api_name": "components.muc4_tools.get_event_keywords", "line_number": 18, "usage_type": "argume...
39647388117
import configparser import os class Config: def __init__(self): cur_path = os.path.dirname(os.path.realpath(__file__)) self.conf_path = os.path.join(cur_path, "spider.ini") self.conf = configparser.ConfigParser() self.conf.read(self.conf_path, encoding='utf-8') def get_conf_da...
ggStuddUp/ForHer
data/congfig.py
congfig.py
py
1,501
python
en
code
0
github-code
97
[ { "api_name": "os.path.dirname", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.join", "line_n...
39796895547
# -*- coding: utf-8 -*- # Define here the models for your spider middleware # # See documentation in: # https://doc.scrapy.org/en/latest/topics/spider-middleware.html from settings import USER_AGENTS from selenium import webdriver from selenium.webdriver.chrome.options import Options from lxml import etree from scrap...
jie089410/my-repository
Sina/Sina/middlewares.py
middlewares.py
py
3,732
python
en
code
0
github-code
97
[ { "api_name": "random.choice", "line_number": 31, "usage_type": "call" }, { "api_name": "settings.USER_AGENTS", "line_number": 31, "usage_type": "argument" }, { "api_name": "requests.get", "line_number": 41, "usage_type": "call" }, { "api_name": "random.choice", ...
43214147849
from qiskit import QiskitError from qiskit.compiler import assemble from qiskit.providers.aer import QasmSimulator from .tools import mixed_unitary_noise_model, \ reset_noise_model, kraus_noise_model, no_noise, \ simple_cnot_circuit, simple_u3_circuit # Write the benchmarking func...
vm6502q/qiskit-qrack-provider
test/benchmark/simple_benchmarks.py
simple_benchmarks.py
py
2,986
python
en
code
1
github-code
97
[ { "api_name": "qiskit.providers.aer.QasmSimulator", "line_number": 35, "usage_type": "call" }, { "api_name": "tools.simple_u3_circuit", "line_number": 38, "usage_type": "call" }, { "api_name": "qiskit.compiler.assemble", "line_number": 39, "usage_type": "call" }, { ...
25626841727
from django.conf.urls import url from app.views import * urlpatterns = [ # Matches any html file - to be used for gentella # Avoid using your .html in your resources. # Or create a separate django app. # url(r'^.*\.html', views.gentella_html, name='gentella'), #新增评论 url(r'^add/$', ReviewCreate.as_...
lili1230120/HaOps
HaOps/app/urls.py
urls.py
py
463
python
en
code
0
github-code
97
[ { "api_name": "django.conf.urls.url", "line_number": 11, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 13, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 16, "usage_type": "call" } ]
36418260970
import openpyxl def convert_result_to_excel(result,excel_file_path): wb=openpyxl.Workbook() sheet=wb['Sheet'] header_list=list(result[0].keys()) for c in range(len(header_list)): sheet.cell(row=1,column=c+1).value=header_list[c] for r in range(len(result)): for c in range(len(header_list)): s...
tsushoji/python-MetaAPI
src/InstagramGraphAPIPrj/convert_result.py
convert_result.py
py
410
python
en
code
0
github-code
97
[ { "api_name": "openpyxl.Workbook", "line_number": 4, "usage_type": "call" } ]
17198528432
from django import forms from .models import RSVP class RSVPForm(forms.ModelForm): class Meta: model = RSVP fields = ['name', 'email', 'attending', 'guests', 'address1', 'address2', 'city', 'zip_code', 'state', 'song_request'] widgets = { 'attending': forms.R...
mekhami/wedding
rsvp/forms.py
forms.py
py
465
python
en
code
1
github-code
97
[ { "api_name": "django.forms.ModelForm", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 6, "usage_type": "name" }, { "api_name": "models.RSVP", "line_number": 8, "usage_type": "name" }, { "api_name": "django.forms.RadioS...
29810060812
from __future__ import annotations from typing import Optional, Tuple from retentioneering.backend.tracker import ( collect_data_performance, time_performance, track, ) from retentioneering.constants import DATETIME_UNITS from retentioneering.utils.doc_substitution import docstrings from ..types import E...
retentioneering/retentioneering-tools
retentioneering/eventstream/helpers/label_cropped_paths_helper.py
label_cropped_paths_helper.py
py
2,426
python
en
code
713
github-code
97
[ { "api_name": "types.EventstreamType", "line_number": 24, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 25, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 25, "usage_type": "name" }, { "api_name": "retentioneering.co...
9797582501
import argparse import BLPalette import GPLPalette import PaletteCore extraExt = '.extra' argparser = argparse.ArgumentParser( description="Convert between Blockland and GIMP palette formats", epilog="Only provide one mode.") argparser.add_argument('--to-gpl', metavar='FILENAME', help="convert Blockland .txt to ....
paulguy/minitools
blockland-colorset-tool.py
blockland-colorset-tool.py
py
3,652
python
en
code
5
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "BLPalette.BLPalette", "line_number": 25, "usage_type": "call" }, { "api_name": "GPLPalette.GPLPalette", "line_number": 26, "usage_type": "call" }, { "api_name": "GPLP...
39853772903
import datetime import os import re import pyspark.sql as psql from seldonite import collect, sources, run def clean_date(txt): try: if txt.startswith('java.util.GregorianCalendar'): year_match = re.search('(?<=,YEAR=)\d+', txt) month_match = re.search('(?<=,MONTH=)\d+', txt) ...
networkdynamics/event-embeddings-commodities
scripts/dataset/clean_dataset_dates.py
clean_dataset_dates.py
py
2,210
python
en
code
0
github-code
97
[ { "api_name": "re.search", "line_number": 12, "usage_type": "call" }, { "api_name": "re.search", "line_number": 13, "usage_type": "call" }, { "api_name": "re.search", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 20, ...
18433550390
import os import netCDF4 import pytest import matplotlib.pyplot as plt import config from weatherpy import maps from weatherpy.radar.nexradl2 import Nexrad2Plotter RADAR_FILE = 'Level2_KGLD_20170713_0200.nc' radar_dataset = None @pytest.fixture(scope='module', autouse=True) def lazyloaddataset(): print('loadi...
wxmann/weatherpy
weatherpy/radar/tests/test_nexradl2_plot.py
test_nexradl2_plot.py
py
2,407
python
en
code
0
github-code
97
[ { "api_name": "netCDF4.Dataset", "line_number": 20, "usage_type": "call" }, { "api_name": "os.sep.join", "line_number": 20, "usage_type": "call" }, { "api_name": "os.sep", "line_number": 20, "usage_type": "attribute" }, { "api_name": "config.TEST_DATA_DIR", "l...
74764921598
from aiogram import types, Dispatcher from start.create_bot import bot, dispetcher, db @dispetcher.message_handler(commands = ['send_message']) async def send_message_all_user(message: types.Message): users = await db.get_all_user() for user in users: await bot.send_message(user[0], message.text[13:]) ...
Coo3n/SubscriptionBot
handlers/admin.py
admin.py
py
471
python
en
code
0
github-code
97
[ { "api_name": "aiogram.types.Message", "line_number": 5, "usage_type": "attribute" }, { "api_name": "aiogram.types", "line_number": 5, "usage_type": "name" }, { "api_name": "start.create_bot.db.get_all_user", "line_number": 6, "usage_type": "call" }, { "api_name":...
73459346560
from patchman.models import Plate,Brand, PlateLog, DBSession from formencode import validators from formencode.schema import Schema from pyramid.httpexceptions import HTTPFound from pyramid.renderers import render_to_response from pyramid.view import view_config from pyramid_uniform import Form, FormRenderer from sqlal...
jwcastillo/patchcap
PatchMan/patchman/controller/plate_controller.py
plate_controller.py
py
5,351
python
en
code
0
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "formencode.schema.Schema", "line_number": 16, "usage_type": "name" }, { "api_name": "formencode.validators.String", "line_number": 22, "usage_type": "call" }, { "api_name"...
74695419200
import cv2 import json import numpy as np class Parameters: """ Parameters used for transferring between camera view and Bird Eye view, and between Bird Eye view and lat / lon List of Parameters: unwarp_M: The matrix used for unwarping (from Camera view to Bird Eye View) unwarp_M...
CATT-Works/MoveOver
cav/parameters.py
parameters.py
py
7,613
python
en
code
1
github-code
97
[ { "api_name": "numpy.float32", "line_number": 71, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 72, "usage_type": "call" }, { "api_name": "cv2.getPerspectiveTransform", "line_number": 74, "usage_type": "call" }, { "api_name": "cv2.getPerspe...
23011919671
import math from ultralytics import YOLO import cv2 from gtts import gTTS import os cap = cv2.VideoCapture(0) frame_width = int(cap.get(3)) frame_height = int(cap.get(4)) out = cv2.VideoWriter('output.avi', cv2.VideoWriter_fourcc('M', 'J', 'P', 'G'), 10, (frame_width, frame_height)) model = YOLO('yolov8n.pt') class...
akhilasok96/smart_blind_stick
yolov8_webcam.py
yolov8_webcam.py
py
2,692
python
en
code
0
github-code
97
[ { "api_name": "cv2.VideoCapture", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.VideoWriter", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.VideoWriter_fourcc", "line_number": 11, "usage_type": "call" }, { "api_name": "ultralytics.YO...
27940467771
import openpyxl from openpyxl.styles import Font import datetime import re filename = 'spendings.xlsx' wb = openpyxl.load_workbook(filename) ws_names = wb.sheetnames print(wb.sheetnames) sheetname = input('What sheet do you need? T/O: ') sheet_index = ws_names.index(sheetname) wb.active = sheet_index def counting...
tarikkus-lviv/excel-automation
Excel.py
Excel.py
py
1,985
python
uk
code
0
github-code
97
[ { "api_name": "openpyxl.load_workbook", "line_number": 8, "usage_type": "call" }, { "api_name": "openpyxl.styles.Font", "line_number": 41, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 47, "usage_type": "call" }, { "api_name": ...
72963222399
import argparse import json import sys from omero.gateway import BlitzGateway from omero.cli import cli_login from omero.model import StatsInfoI from omero.rtypes import rdouble # For an Image (ID), set min/max values for channel stats # Usage: python set_channel_minmax.py 3453 '{"0":[0,2000], "1":[1, 1100]}' def m...
will-moore/python-scripts
set_channel_minmax.py
set_channel_minmax.py
py
1,448
python
en
code
0
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 15, "usage_type": "call" }, { "api_name": "omero.cli.cli_login", "line_number": 21, "usage_type": "call" }, { "api_name": "omero.gateway.BlitzGateway", "line_number": 22, "usage_type": "call" }, { "api_name":...
73639559039
from numpy import linalg as la from .utils import rec_from_factors def PoF(X, factors, mask=None): """ The percentage of fitness (POF) metric INPUT: - <tensor> X: the original tensor - <tensor> rec: the reconstructed tensor OUTPUT: - <scalar> PoF_metric: the metric, higher is be...
ycq091044/GOCPT
GOCPT/metrics.py
metrics.py
py
583
python
en
code
6
github-code
97
[ { "api_name": "utils.rec_from_factors", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.linalg.norm", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.linalg", "line_number": 15, "usage_type": "name" }, { "api_name": "utils.rec_from_...
3645178591
# inputs 文件夹和 testplans 中获得输入,生成 json 格式的测试用例 import json from subprocess import run, PIPE from os import path join = path.join def execf(params): p=run(['./source/a.out']+params, stdout=PIPE) return(p.stdout) with open('./testplans.alt/universe') as fr: plans = fr.readlines() res=[] for item in plans...
Liu233w/theoretical-evaluation
tools/tcas/run-all.py
run-all.py
py
601
python
en
code
1
github-code
97
[ { "api_name": "os.path.join", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path", "line_number": 7, "usage_type": "name" }, { "api_name": "subprocess.run", "line_number": 10, "usage_type": "call" }, { "api_name": "subprocess.PIPE", "line_nu...
34920283402
import logging import asyncio from aiogram import Bot, Dispatcher, types from aiogram.contrib.fsm_storage.memory import MemoryStorage from aiogram.dispatcher.filters.state import State, StatesGroup # работа с базой данных from sqlalchemy import create_engine from sqlalchemy.orm import Session, sessionmaker import base...
Sanich137/line_by_line_translation_teacher_tgBOT
main.py
main.py
py
8,826
python
ru
code
0
github-code
97
[ { "api_name": "aiogram.dispatcher.filters.state.StatesGroup", "line_number": 35, "usage_type": "name" }, { "api_name": "aiogram.dispatcher.filters.state.State", "line_number": 36, "usage_type": "call" }, { "api_name": "aiogram.dispatcher.filters.state.State", "line_number": 3...
17357251796
from DNNCTF import DNNCTF import pandas as pd from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score DATASET = 'iris.data' MODEL = 'model' df = pd.read_csv(DATASET, header=None) data = df.iloc[:, :-1] target = df.iloc[:,-1] x_train, x_test, y_train, y_test = train_test_split...
GabrieleMaurina/workspace
python/tensorflow-iris/DNNCTFTest.py
DNNCTFTest.py
py
829
python
en
code
1
github-code
97
[ { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 14, "usage_type": "call" }, { "api_name": "DNNCTF.DNNCTF", "line_number": 17, "usage_type": "call" }, { "api_name": ...
42870390102
from abc import ABCMeta, abstractmethod from collections import OrderedDict from blenderneuron.activity import Activity class RootGroup: __metaclass__ = ABCMeta def __init__(self): self.name = "" self.roots = OrderedDict() self.import_synapses = False self.interact...
JustasB/BlenderNEURON
blenderneuron/rootgroup.py
rootgroup.py
py
2,184
python
en
code
25
github-code
97
[ { "api_name": "abc.ABCMeta", "line_number": 6, "usage_type": "name" }, { "api_name": "collections.OrderedDict", "line_number": 10, "usage_type": "call" }, { "api_name": "blenderneuron.activity.Activity", "line_number": 22, "usage_type": "call" } ]
37087917644
import unittest import tempfile import os import sys import pathlib import contextlib HERE = pathlib.Path(__file__).absolute().parent # print(HERE.parent) sys.path.insert(0, str(HERE.parent)) IMGUI_H = HERE.parent / 'libs/imgui/imgui.h' from pycpptool.get_tu import get_tu from clang import cindex ...
ousttrue/pycpptool
tests/test_imgui.py
test_imgui.py
py
4,137
python
en
code
1
github-code
97
[ { "api_name": "pathlib.Path", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path.insert", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "tempfile.mkstemp", "lin...
43046141213
from django.urls import path from .views import * urlpatterns = [ path('addtocart/<int:pk>/', add_to_cart, name='addtocart'), path('cart/', cart_view, name='cart'), path('remove/<int:pk>/', remove_from_cart, name='removecart'), path('increase/<str:pk>/', increase_cart, name='increasecart'), path('d...
SreeHari3232/ecom
ecom/order/urls.py
urls.py
py
378
python
en
code
0
github-code
97
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", ...
37794935677
from asyncpg.connection import Connection class DBWorker: def __init__(self, conn: Connection): self.conn = conn async def get_all_tokens_output(self): sql = """select tot."id", u."id" as user_id, tot.tokens, u."bep_address",tot.created_date_time from "tokens_output" tot join "user" u on ...
OneZeroZeroOneOne/SafeBull
api/database/db_worker.py
db_worker.py
py
563
python
en
code
1
github-code
97
[ { "api_name": "asyncpg.connection.Connection", "line_number": 4, "usage_type": "name" } ]
11987062307
import torch import numpy as np from frac_brownian import frac_brownian # Sampling def fcir(r0, a, b, sigma, H, m, n, T, device=None, seed=123): """ Inputs: r0: float tensor of shape (m,1), initial rates a: float tensor of shape (m), long term mean level b: ...
FalconX777/stochastics_models
src/frac_cir.py
frac_cir.py
py
1,329
python
en
code
0
github-code
97
[ { "api_name": "torch.manual_seed", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.cuda.manual_seed", "line_number": 25, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 25, "usage_type": "attribute" }, { "api_name": "torch.ones",...
38315816568
import gevent from gevent import getcurrent from gevent.pool import Group group = Group() def hello_from(n): print('Size of group', len(group)) print('Hello from Greenlet %s' % id(getcurrent())) group.map(hello_from, xrange(3)) def intensive(n): gevent.sleep(3 - n) return 'task', n print('Ordered')...
madchoy/Lab
gevent/group/test.py
test.py
py
1,137
python
en
code
0
github-code
97
[ { "api_name": "gevent.pool.Group", "line_number": 5, "usage_type": "call" }, { "api_name": "gevent.getcurrent", "line_number": 9, "usage_type": "call" }, { "api_name": "gevent.sleep", "line_number": 14, "usage_type": "call" }, { "api_name": "gevent.pool.Group", ...
17245624864
"""Charge subscriptions' spending to a cost centre.""" from datetime import date, timedelta from typing import Any, Dict, List, Optional from uuid import UUID import sqlalchemy from fastapi import Depends, HTTPException from pydantic import BaseModel from sqlalchemy import and_, between, desc, func, insert, select fr...
alan-turing-institute/rctab-api
rctab/routers/accounting/cost_recovery.py
cost_recovery.py
py
8,437
python
en
code
0
github-code
97
[ { "api_name": "pydantic.BaseModel", "line_number": 25, "usage_type": "name" }, { "api_name": "datetime.date", "line_number": 29, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 34, "usage_type": "name" }, { "api_name": "datetime.timedelta",...
40049868609
"""The module contains a base class for Mediator, from which is inherited in all blockchain mediators. Author: Jan Jakub Kubik (xkubik32) Date: 14.3.2023 """ import random from abc import ABC, abstractmethod from typing import Any, Dict, List, Optional, Set from base.logs import create_logger class ActionObjectStor...
Jakub-Kubik/smasf
base/simulation_manager_base.py
simulation_manager_base.py
py
6,639
python
en
code
0
github-code
97
[ { "api_name": "typing.Dict", "line_number": 29, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 29, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 29, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 3...
74138117759
#!/usr/bin/env python3 # -*- coding: utf-8 -*- #---------------------------------------------------------------------------- # Created By : SpeedCode210 # version ='2.0' # System dependencies : tar, gzip # Pip dependencies : Pillow # --------------------------------------------------------------------------- """Builds...
SpeedCode210/SmartPackager
flatpaksourcebuild.py
flatpaksourcebuild.py
py
1,549
python
en
code
0
github-code
97
[ { "api_name": "os.get_terminal_size", "line_number": 17, "usage_type": "call" }, { "api_name": "os.get_terminal_size", "line_number": 22, "usage_type": "call" }, { "api_name": "os.system", "line_number": 26, "usage_type": "call" }, { "api_name": "os.system", "...
22600992622
import os import unittest import numpy as np from common import ( j_loader, ) from deepmd.descriptor import ( DescrptSeA, ) from deepmd.env import ( tf, ) GLOBAL_ENER_FLOAT_PRECISION = tf.float64 GLOBAL_TF_FLOAT_PRECISION = tf.float64 GLOBAL_NP_FLOAT_PRECISION = np.float64 # from common import ( tes...
CGCL-codes/G4S
deepmd/source/tests/test_nvnmd_se_a.py
test_nvnmd_se_a.py
py
4,494
python
en
code
2
github-code
97
[ { "api_name": "deepmd.env.tf.float64", "line_number": 16, "usage_type": "attribute" }, { "api_name": "deepmd.env.tf", "line_number": 16, "usage_type": "name" }, { "api_name": "deepmd.env.tf.float64", "line_number": 17, "usage_type": "attribute" }, { "api_name": "d...
28431823133
import os from configparser import ConfigParser import threading import signal import csv import zmq import random import time def main(): """ This data feeder simulates the idea of having a constant stream of data entering our system, by reading csv files and pushing them row by row (as dicts) to the DAG ...
FdelMazo/7574-Distribuidos
TP2/feeder/main.py
main.py
py
3,038
python
en
code
1
github-code
97
[ { "api_name": "configparser.ConfigParser", "line_number": 20, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 24, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 24, "usage_type": "attribute" }, { "api_name": "threading.Ev...
21130950579
import functools import types import typing from http import client from timeit import default_timer from typing import Collection, Dict from urllib.request import ( # pylint: disable=no-name-in-module,import-error OpenerDirector, Request, ) from opentelemetry import context # FIXME: fix the importing of thi...
open-telemetry/opentelemetry-python-contrib
instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/__init__.py
__init__.py
py
9,160
python
en
code
527
github-code
97
[ { "api_name": "opentelemetry.util.http.get_excluded_urls", "line_number": 36, "usage_type": "call" }, { "api_name": "typing.Optional", "line_number": 38, "usage_type": "attribute" }, { "api_name": "typing.Callable", "line_number": 38, "usage_type": "attribute" }, { ...
22100448182
from typing import Any, List, Tuple from .constants._sync_mode import ASYNC from .opencv._cv_border_types import BORDER_DEFAULT from ..native import make_native_object import sys matx = sys.modules['matx'] class _LaplacianBlurOpImpl: """ LaplacianBlur Impl """ def __init__(self, device: Any...
bytedance/matxscript
python/matx/vision/laplacian_blur_op.py
laplacian_blur_op.py
py
3,723
python
en
code
363
github-code
97
[ { "api_name": "sys.modules", "line_number": 7, "usage_type": "attribute" }, { "api_name": "typing.Any", "line_number": 14, "usage_type": "name" }, { "api_name": "opencv._cv_border_types.BORDER_DEFAULT", "line_number": 15, "usage_type": "name" }, { "api_name": "nat...
4855826548
import requests import streamlit as st nome_do_filme = st.text_input('Choose Your Movie: ') if st.button('Consultar Filmes'): #é recomendado procurar filmes populares. Link fonte não possui um banco de dados extenso link = 'https://www.omdbapi.com/?apikey=90c1591a&t=' + nome_do_filme dvd = requests.get(lin...
natalyabreu/TrabalhoJosir
trabalhoA2.py
trabalhoA2.py
py
1,368
python
pt
code
0
github-code
97
[ { "api_name": "streamlit.text_input", "line_number": 3, "usage_type": "call" }, { "api_name": "streamlit.button", "line_number": 4, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 8, "usage_type": "call" }, { "api_name": "streamlit.write", ...
40744001556
# drunktweet.py ''' Print out possible drunk tweets from anywhere in the world. Usage: ./drunktweet.py London, UK ''' import regex import requests import json import simplejson, urllib import sys def geosearch(query): args = { 'address': query, 'sensor': 'false', } googurl = "http://maps....
diffra/DrunkTweet
drunktweet.py
drunktweet.py
py
1,612
python
en
code
2
github-code
97
[ { "api_name": "urllib.urlencode", "line_number": 19, "usage_type": "call" }, { "api_name": "simplejson.load", "line_number": 20, "usage_type": "call" }, { "api_name": "urllib.urlopen", "line_number": 20, "usage_type": "call" }, { "api_name": "regex.compile", "...
12935489021
import random import sqlite3 class Account: @staticmethod def get_card_checksum(card_number: str) -> int: numbers_sum = 0 for index in range(15): number = int(card_number[index]) if index % 2 == 0: number *= 2 if number > 9: ...
cecilemangel/simple-banking-system
banking.py
banking.py
py
6,555
python
en
code
0
github-code
97
[ { "api_name": "random.randint", "line_number": 23, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 26, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 37, "usage_type": "call" } ]
17448857102
import pandas as pd import geopandas as gpd from shapely.geometry import Point, LineString from .utils import report_progress from .lsm import snap_to_waterbodies import warnings def get_dm_nodes(dw_keys_df, district, mz_type ="d", out_type=int): df = dw_keys_df[dw_keys_df.oid == district] dm_nodes = [out_ty...
d2hydro/lhm-ribasim
src/lhm/dm.py
dm.py
py
5,612
python
en
code
0
github-code
97
[ { "api_name": "geopandas.GeoDataFrame", "line_number": 17, "usage_type": "attribute" }, { "api_name": "pandas.DataFrame", "line_number": 18, "usage_type": "attribute" }, { "api_name": "geopandas.GeoDataFrame", "line_number": 32, "usage_type": "attribute" }, { "api...
40457677958
from odoo import models, _ import logging _logger = logging.getLogger(__name__) class PaymentTransaction(models.Model): _inherit = 'payment.transaction' # Override to confirm payments totaling the amount_total_deposit def _check_amount_and_confirm_order(self): self.ensure_one() for order...
hibou-io/hibou-odoo-suite
sale_payment_deposit/models/payment.py
payment.py
py
1,436
python
en
code
38
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 4, "usage_type": "call" }, { "api_name": "odoo.models.Model", "line_number": 7, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 7, "usage_type": "name" }, { "api_name": "odoo._", "line_...
1014172936
from django.urls import path from .views import PlanCreateAPIView, PlanListAPIView, PlanRetrieveUpdateDestroyAPIView urlpatterns = [ # subscriptions plan urls path("", PlanListAPIView.as_view(), name="list_subscriptions"), path("<str:id>/", PlanRetrieveUpdateDestroyAPIView.as_view(), name="create_retriev...
codertjay/upwork_clone
plans/urls.py
urls.py
py
419
python
en
code
4
github-code
97
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "views.PlanListAPIView.as_view", "line_number": 7, "usage_type": "call" }, { "api_name": "views.PlanListAPIView", "line_number": 7, "usage_type": "name" }, { "api_name": "dja...
70013549440
# Pygame library import pygame # Dash Display class Dash(pygame.sprite.Sprite): # Properties surface = pygame.Surface((150,40)) font = None # Constructor def __init__(self): """ Entrée: None Sortie: None """ # Call Sprite Constructor pygame.sprite.Sp...
magnetic2247/shifty-legacy
game/dash.py
dash.py
py
1,142
python
en
code
0
github-code
97
[ { "api_name": "pygame.sprite", "line_number": 5, "usage_type": "attribute" }, { "api_name": "pygame.Surface", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.sprite.Sprite.__init__", "line_number": 17, "usage_type": "call" }, { "api_name": "pygame....
27891558150
import requests, urllib, re, os, json, pyrebase from bs4 import BeautifulSoup as BS import txt # print(txt.user) session = requests.session() pageURL = 'https://zenpencils.com/' page = session.post(pageURL) # print(page.text) # Home Page details # Finding total number of pages homepage = BS(page.text,"html.parser").fin...
jyotish09/GetUp
scraper/zenPencils.py
zenPencils.py
py
725
python
en
code
0
github-code
97
[ { "api_name": "requests.session", "line_number": 5, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 11, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 17, "usage_type": "call" }, { "api_name": "txt.db.child", "line...
26856930306
import queue import time import pytest from johnsnowlabs import nlp, settings from johnsnowlabs.auto_install.databricks.install_utils import ( cluster_exist_with_name_and_runtime, get_db_client_for_token, get_cluster_id, wait_till_cluster_running, _get_cluster_id, ) from johnsnowlabs.auto_install....
JohnSnowLabs/johnsnowlabs
tests/databricks/db_test_utils.py
db_test_utils.py
py
6,685
python
en
code
33
github-code
97
[ { "api_name": "pytest.fixture", "line_number": 21, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 26, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 31, "usage_type": "call" }, { "api_name": "tests.utilsz.secrets.db_...
74653638717
import json from rdflib import Graph, Namespace, URIRef, Literal from modules.mention_handler import MentionHandler from modules.attribute_handler import AttributeHandler from modules.entity_handler import EntityHandler from modules.relation_handler import RelationHandler from modules.coref_handler import CorefHandler ...
mjstrobl/KGP_from_Conversations
modules/pipeline.py
pipeline.py
py
2,646
python
en
code
0
github-code
97
[ { "api_name": "rdflib.Namespace", "line_number": 10, "usage_type": "call" }, { "api_name": "modules.mention_handler.MentionHandler", "line_number": 23, "usage_type": "call" }, { "api_name": "modules.attribute_handler.AttributeHandler", "line_number": 24, "usage_type": "ca...
33337791335
#!/usr/bin/python3 """class BaseModel""" import uuid from datetime import datetime import time import models class BaseModel: """class BaseModel defines common sttributes for all classes""" def __init__(self, *args, **kwargs): """initializes object""" if kwargs: for key, value i...
jofurdz/AirBnB_clone
models/base_model.py
base_model.py
py
1,393
python
en
code
0
github-code
97
[ { "api_name": "datetime.datetime.strptime", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 19, "usage_type": "name" }, { "api_name": "uuid.uuid4", "line_number": 23, "usage_type": "call" }, { "api_name": "datetime.date...