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
36995460021
from string import punctuation from razdel import sentenize from razdel import tokenize as razdel_tokenize import numpy as np from IPython.display import Image from IPython.core.display import HTML lenta = open('lenta.txt',encoding="utf-8").read() rtt = open('russian_toxic_tweets.txt',encoding="utf-8").read() ...
Leop333/Python-s-Homeworks
CL Project #1/Computer Linguistics' Project.py
Computer Linguistics' Project.py
py
6,105
python
ru
code
null
github-code
21
[ { "api_name": "string.punctuation", "line_number": 21, "usage_type": "argument" }, { "api_name": "razdel.tokenize", "line_number": 22, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 38, "usage_type": "call" }, { "api_name": "collection...
2000160567
# rogue final game # Python Standard Library import copy import random # Third-Party Libraries import pygame as pg # Local Modules from game import Game from character import * from map import * ####### GAME CONSTANTS ############ FPS = 10 DIRECTIONS = { "DOWN": (0, +1), "UP": (0, -1), "RIGHT": (+1, 0...
antoinelii/roguegame
rogue.py
rogue.py
py
2,761
python
en
code
0
github-code
21
[ { "api_name": "game.Game", "line_number": 50, "usage_type": "name" }, { "api_name": "pygame.QUIT", "line_number": 54, "usage_type": "attribute" }, { "api_name": "pygame.KEYDOWN", "line_number": 55, "usage_type": "attribute" }, { "api_name": "pygame.K_q", "line...
24059648224
import pandas as pd from sklearn.model_selection import train_test_split from sklearn.neighbors import KNeighborsClassifier # from sklearn.metrics import accuracy_score, classification_report, confusion_matrix from sklearn.preprocessing import LabelEncoder # Step 1: Load the dataset data = pd.read_csv('APA-DDoS-Datas...
resrrdttrt/ai-service
DDoS/train.py
train.py
py
1,647
python
en
code
1
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.LabelEncoder", "line_number": 16, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 37, "usage_type": "call" },...
1318218753
import os from datetime import datetime from pathlib import Path import sys import cv2 import time import numpy as np import utils import utils as utils_customized from config import Config from models import RgbDetector, SpecDetector import logging def main(only_spec=False, only_color=False, if_merge=False, interv...
FEIJINTI/tobacco_color
main.py
main.py
py
10,119
python
en
code
1
github-code
21
[ { "api_name": "models.SpecDetector", "line_number": 19, "usage_type": "call" }, { "api_name": "config.Config.blk_model_path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "config.Config", "line_number": 19, "usage_type": "name" }, { "api_name": "c...
36554125346
from __future__ import absolute_import from __future__ import unicode_literals from __future__ import print_function import os from pygit2 import Repository, GIT_STATUS_WT_DELETED, GIT_STATUS_WT_MODIFIED, GIT_STATUS_WT_RENAMED, \ GIT_STATUS_WT_TYPECHANGE, GIT_STATUS_INDEX_NEW, GIT_STATUS_INDEX_MODIFIED, GIT_STATUS...
m42e/teamscale-cli
teamscale_precommit_client/git_utils.py
git_utils.py
py
3,868
python
en
code
null
github-code
21
[ { "api_name": "pygit2.GIT_STATUS_INDEX_NEW", "line_number": 11, "usage_type": "name" }, { "api_name": "pygit2.GIT_STATUS_INDEX_MODIFIED", "line_number": 11, "usage_type": "name" }, { "api_name": "pygit2.GIT_STATUS_WT_MODIFIED", "line_number": 11, "usage_type": "name" },...
1677807112
from pathlib import Path import pickle import numpy as np from sklearn.preprocessing import StandardScaler from sklearn.multioutput import MultiOutputRegressor from sklearn.pipeline import Pipeline from sklearn.model_selection import cross_validate from sklearn.metrics import mean_squared_error from sklearn import ens...
yujouwang/pyStruct
pyStruct/structurePredictor/lookupStructures.py
lookupStructures.py
py
3,990
python
en
code
0
github-code
21
[ { "api_name": "numpy.ndarray", "line_number": 18, "usage_type": "attribute" }, { "api_name": "sklearn.preprocessing.StandardScaler", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.linalg.norm", "line_number": 23, "usage_type": "call" }, { "api_nam...
21626333318
import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.svm import SVC from sklearn.neural_network import MLPClassifier from utils import plot_confusion_mat, plot_decision_regions, EpochViz def predict1vR(X, unique_classes, clf_dict): pred_labels = [] for x in X: x = x.re...
amw-18/ML-Implementations
Neural Networks, SVMs/1b.py
1b.py
py
4,007
python
en
code
0
github-code
21
[ { "api_name": "numpy.array", "line_number": 18, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 22, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 23, "usage_type": "call" }, { "api_name": "sklearn.neural_network.ML...
37223658183
#!/usr/bin/python3 '''This is a module''' from api.v1.views import app_views from flask import jsonify, request from models.amenity import Amenity from flask import abort from models import storage @app_views.route('/amenities', methods=['GET', 'POST'], strict_slashes=False) def get_amenities(): ...
mazi-kunle/AirBnB_clone_v3
api/v1/views/amenities.py
amenities.py
py
1,894
python
en
code
null
github-code
21
[ { "api_name": "flask.request.method", "line_number": 16, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 16, "usage_type": "name" }, { "api_name": "models.storage.all", "line_number": 17, "usage_type": "call" }, { "api_name": "models.ame...
32957867037
#!/usr/bin/env python3 import platform import uuid from flask import Flask, jsonify app = Flask(__name__) movie_list = [ { "_id": str(uuid.uuid4()), "title": "Toy Story", "rating": "G", "release_date": "11/22/1995", }, { "_id": str(uuid.uuid4()), "title": "...
dmorand17/dockerized-flask
app.py
app.py
py
2,275
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "uuid.uuid4", "line_number": 11, "usage_type": "call" }, { "api_name": "uuid.uuid4", "line_number": 17, "usage_type": "call" }, { "api_name": "uuid.uuid4", "line_number": 23, ...
39969002159
import sqlite3 from tabulate import tabulate def create_user_table(): connection = sqlite3.connect('vehicle_management.db') cursor = connection.cursor() #cursor.execute("ALTER TABLE BaseUser MODIFY COLUMN id Integer AUTO_INCREMENT ; ") #cursor.execute('DROP TABLE RepairHour') cursor.e...
ElenaR1/Python-101
week10/vehicle_management.py
vehicle_management.py
py
19,369
python
en
code
0
github-code
21
[ { "api_name": "sqlite3.connect", "line_number": 6, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 78, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 90, "usage_type": "call" }, { "api_name": "sqlite3.connect", ...
22888443741
""" Exception and context management across :xref:`snowmobile` objects. """ from __future__ import annotations from typing import Any, Iterable, Set, Type from .errors import * from . import Generic class ExceptionHandler(Generic): """All :xref:`snowmobile` classes contain a :class:`ExceptionHandler`. Para...
gem7318/snowmobile
snowmobile/core/exception_handler.py
exception_handler.py
py
9,897
python
en
code
3
github-code
21
[ { "api_name": "typing.Any", "line_number": 39, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 42, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 44, "usage_type": "name" }, { "api_name": "typing.Type", "line_number": 49,...
70753602932
import pandas as pd full_annotation_file = "dataset/label.xlsx" image_root = "dataset" ann = pd.read_excel(full_annotation_file).dropna() # split train test from sklearn.model_selection import train_test_split train_ann, test_ann = train_test_split(ann, test_size=0.2, random_state=42) train_ann.to_excel("dataset/tr...
toilaluan/hust_dl_scene_detection
scene_detect/data/split_train_test.py
split_train_test.py
py
408
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_excel", "line_number": 6, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 11, "usage_type": "call" } ]
16378127262
from django.http import Http404 from django.views.decorators.cache import cache_page from django.views.generic.detail import DetailView from django.views.generic.list import ListView from variants.filters import VariantFilter from variants.models import Variant class VariantsView(ListView): model = Variant te...
Luganskaya-Svetlana/Physalis
physalisproject/variants/views.py
views.py
py
2,429
python
en
code
3
github-code
21
[ { "api_name": "django.views.generic.list.ListView", "line_number": 9, "usage_type": "name" }, { "api_name": "variants.models.Variant", "line_number": 10, "usage_type": "name" }, { "api_name": "variants.filters.VariantFilter", "line_number": 14, "usage_type": "name" }, ...
9156763173
# -*- coding: utf-8 -*- import threading import time import enum import logging log = logging.getLogger(__name__) import arp import icmp import udp import tcp import raw import net from common import * # IP protocols @enum.unique class IPPROT(enum.IntEnum): ICMP = 1 IGMP = 2 IP = 4 TCP = 6 EGP =...
yiopposite/pyip
ipv4.py
ipv4.py
py
13,095
python
en
code
3
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "enum.IntEnum", "line_number": 20, "usage_type": "attribute" }, { "api_name": "enum.unique", "line_number": 19, "usage_type": "attribute" }, { "api_name": "threading.Lock", ...
4920779650
from collections import defaultdict N = int(input()) S = input() b = [0,0] z = defaultdict(list) z[b] = 1 for s in S: if (s == 'R'): b[0] += 1 elif s == 'L': b[0] -= 1 elif s == 'U': b[1] += 1 else: b[1] -= 1 z.add(b) print(z)
norisumo/Atcoder_ABC
291/B.py
B.py
py
282
python
en
code
0
github-code
21
[ { "api_name": "collections.defaultdict", "line_number": 6, "usage_type": "call" } ]
13417236285
import pytest from tests.conftest import CSV_FOLDER, JSON_FOLDER, TESTS_FOLDER from tests.util import seed_database_with_2019_test_data from vigorish.app import Vigorish @pytest.fixture(scope="package") def vig_app(request): """Returns an instance of the application configured to use the test DB and test config ...
a-luna/vigorish
tests/test_with_2019_data/conftest.py
conftest.py
py
876
python
en
code
2
github-code
21
[ { "api_name": "vigorish.app.Vigorish", "line_number": 11, "usage_type": "call" }, { "api_name": "tests.conftest.TESTS_FOLDER.glob", "line_number": 15, "usage_type": "call" }, { "api_name": "tests.conftest.TESTS_FOLDER", "line_number": 15, "usage_type": "name" }, { ...
11314772461
from django.db import models # Create your models here. class Author(models.Model): name = models.CharField(max_length=128) last_name = models.CharField(max_length=128, null=True) class Country(models.Model): name = models.CharField(max_length=128) created_at = models.DateTimeField(auto_now_add=True, null=T...
DearSergioM/travis-dearsergio
library/books/models.py
models.py
py
1,823
python
en
code
0
github-code
21
[ { "api_name": "django.db.models.Model", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 4, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 5, "usage_type": "call" }, { "api_name": "...
1118292487
import uuid from datetime import datetime import eng_to_ipa from nltk.stem.wordnet import WordNetLemmatizer from src.constant import Constant from src.stuff_util import cover_slash, get_notation, get_or_default class BaseModel: ''' this is class base model ''' def __init__(self,id=None,date_create=N...
minhdua/StudyEnglishVocabulary
src/model.py
model.py
py
6,272
python
en
code
0
github-code
21
[ { "api_name": "src.stuff_util.get_or_default", "line_number": 16, "usage_type": "call" }, { "api_name": "uuid.uuid4", "line_number": 16, "usage_type": "call" }, { "api_name": "src.stuff_util.get_or_default", "line_number": 17, "usage_type": "call" }, { "api_name":...
36333082570
import requests import json import glob import shutil import os from tqdm import tqdm basePath = "/data/dongwei/dwclassImages/" allClassNameUrl = "http://annotation.lingmou.ai:8000/index.php/skus/get-all" response = requests.get(allClassNameUrl) response = json.loads(response.text) def main(): count = 0 sma...
xytysingle/AnnotationTool
python-script/taigu_uncertain_process/moveOutCoca.py
moveOutCoca.py
py
1,412
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 13, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 17, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 21, ...
71280208694
import numpy as np from numba import njit from scipy.interpolate import interp1d from scipy.optimize import fsolve from Utils.EFE_TR import d_r @njit def h_def(A, B, KB, r, N, dR): """ Computes in each point of the grid the definition of the apparent horizon. Inputs: A : field A B : field B KB : field ...
LoreCip/NR_ADM
Program/Utils/Horizon.py
Horizon.py
py
2,210
python
en
code
0
github-code
21
[ { "api_name": "Utils.EFE_TR.d_r", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 25, "usage_type": "call" }, { "api_name": "numba.njit", "line_number": 9, "usage_type": "name" }, { "api_name": "numpy.where", "line_number"...
27705883956
# -*- coding: utf-8 -*- from Products.Five import BrowserView from Products.PloneMeeting.interfaces import IRedirect from zope.component.hooks import getSite from zope.interface import implements class RedirectView(BrowserView): """ """ DEFAULT = """<html><head><base href="{0}" /></head></html>""" d...
IMIO/Products.PloneMeeting
src/Products/PloneMeeting/browser/redirect.py
redirect.py
py
1,269
python
en
code
1
github-code
21
[ { "api_name": "Products.Five.BrowserView", "line_number": 9, "usage_type": "name" }, { "api_name": "zope.interface.implements", "line_number": 27, "usage_type": "call" }, { "api_name": "Products.PloneMeeting.interfaces.IRedirect", "line_number": 27, "usage_type": "argumen...
74154770931
import torch import numpy as np def tensor_to_numpy(tensor: torch.Tensor) -> np.ndarray: """ Convert an image or a batch of images from tensor to ndarray. Args: tensor (torch.Tensor): The tensor with shape `[c, h, w]` or `[b, c, h, w]`. Returns: np.ndarray: The array with sha...
Enot3811/contrastive_learning
torch_tools.py
torch_tools.py
py
1,029
python
en
code
0
github-code
21
[ { "api_name": "torch.Tensor", "line_number": 5, "usage_type": "attribute" }, { "api_name": "numpy.ndarray", "line_number": 5, "usage_type": "attribute" }, { "api_name": "numpy.ndarray", "line_number": 22, "usage_type": "attribute" }, { "api_name": "torch.tensor", ...
2756758043
"""add cid to employment Revision ID: 07eedaca0d9c Revises: c181358dbec6 Create Date: 2018-04-18 21:52:47.854505 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '07eedaca0d9c' down_revision = 'c181358dbec6' branch_labels = None depends_on = None def upgrade()...
nautilis/zhku.scm
back-end/migrations/versions/07eedaca0d9c_add_cid_to_employment.py
07eedaca0d9c_add_cid_to_employment.py
py
662
python
en
code
0
github-code
21
[ { "api_name": "alembic.op.add_column", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 21, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer...
31250741834
from typing import Dict, Optional, Tuple, List import collections from armi import plugins, pluginManager, meta, settings from armi.settings import Setting from armi.settings import fwSettings from armi.reactor import parameters class App: """ The main point of customization for the ARMI Framework. The ...
atomic-nuclear/production
apps.py
apps.py
py
9,416
python
en
code
1
github-code
21
[ { "api_name": "armi.plugins.getNewPluginManager", "line_number": 53, "usage_type": "call" }, { "api_name": "armi.plugins", "line_number": 53, "usage_type": "name" }, { "api_name": "armi.cli.EntryPointsPlugin", "line_number": 55, "usage_type": "attribute" }, { "api...
4045633880
import matplotlib.pyplot as plt import numpy as np import cv2 import tensorflow as tf import tensorflow.keras as keras def preprocessSudokuDigitsAndLabels(digits,labels): preprocessedDigits, preprocessedLabels = [],[] for digit in digits: digit=cv2.normalize(digit,0,255,cv2.NORM_MINMAX) if labels is None...
jakharrahul000/SudokuSolver
digitrecognition.py
digitrecognition.py
py
3,045
python
en
code
0
github-code
21
[ { "api_name": "cv2.normalize", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.NORM_MINMAX", "line_number": 12, "usage_type": "attribute" }, { "api_name": "numpy.float32", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.array", "l...
37623776850
from typing import Any, Callable, List, NoReturn, Union as U, Tuple, Optional import heapq import itertools from search_problems.util import Node from search_problems.util import Problem def best_first_search(problem: Problem, f: Callable) -> Optional[Node]: """ Takes in an implemented `Problem` and returns a `Nod...
loudpumpkins/lets_learn_ai
search_problems/best_first.py
best_first.py
py
1,390
python
en
code
0
github-code
21
[ { "api_name": "search_problems.util.Problem", "line_number": 9, "usage_type": "name" }, { "api_name": "typing.Callable", "line_number": 9, "usage_type": "name" }, { "api_name": "search_problems.util.Node", "line_number": 27, "usage_type": "call" }, { "api_name": "...
73034983093
""" .. _tut_sensors_time_frequency: ============================================= Frequency and time-frequency sensors analysis ============================================= The objective is to show you how to explore the spectral content of your data (frequency and time-frequency). Here we'll work on Epochs. We wil...
LiuFang816/SALSTM_py_data
python/mne-tools_mne-python/mne-python-master/tutorials/plot_sensors_time_frequency.py
plot_sensors_time_frequency.py
py
5,138
python
en
code
9
github-code
21
[ { "api_name": "mne.datasets.somato.data_path", "line_number": 25, "usage_type": "call" }, { "api_name": "mne.datasets.somato", "line_number": 25, "usage_type": "name" }, { "api_name": "mne.io.read_raw_fif", "line_number": 29, "usage_type": "call" }, { "api_name": ...
42565591906
from PIL import Image,ImageDraw,ImageFont import openpyxl from openpyxl import load_workbook import smtplib as s def xls_to_pylist(filepath,template_path,font_path,font_size,ext): workbook = load_workbook(filename=filepath) sheet = workbook.active no_of_row_in_sheet=8 for i in rang...
yvaishali941/certificate-generator
certi_gener.py
certi_gener.py
py
1,226
python
en
code
0
github-code
21
[ { "api_name": "openpyxl.load_workbook", "line_number": 13, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 30, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 30, "usage_type": "name" }, { "api_name": "PIL.ImageDraw.Draw", ...
22082145923
import torch from torch.nn import init import numpy as np import random import math import os from matplotlib import pyplot as plt from PIL import Image import scipy.signal from tqdm import tqdm from torch.autograd import Variable def weights_init_kaiming(m): classname = m.__class__.__name__ if classname.find...
htsun1998/Tracking-PyTorch
reid/utils/utils.py
utils.py
py
7,510
python
en
code
1
github-code
21
[ { "api_name": "torch.nn.init.kaiming_normal_", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.nn.init", "line_number": 17, "usage_type": "name" }, { "api_name": "torch.nn.init.kaiming_normal_", "line_number": 19, "usage_type": "call" }, { "api_nam...
12615005481
from django.contrib.auth.decorators import login_required from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.models import User from django.db.models import Q from django.shortcuts import redirect, render_to_response from django.urls import reverse_lazy from django.utils import timezone fro...
patrick-moreira/web-chat
webchatserver/chatapp/views.py
views.py
py
2,261
python
en
code
0
github-code
21
[ { "api_name": "django.views.generic.ListView", "line_number": 13, "usage_type": "attribute" }, { "api_name": "django.views.generic", "line_number": 13, "usage_type": "name" }, { "api_name": "models.Message.objects.all", "line_number": 18, "usage_type": "call" }, { ...
10283536748
try: # ------------------------------------------------------------------------------ # -- Import Section # ------------------------------------------------------------------------------ import traceback import os import time import math import numpy as np import cv2 import torch # ------...
bassem-mostafa/Self-Localization
script(s)/Self_Localization_Yolo_V3.py
Self_Localization_Yolo_V3.py
py
8,140
python
en
code
0
github-code
21
[ { "api_name": "time.localtime", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.getmtime", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.path.sep.join", "...
14736877484
#%% import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import growth.model import growth.viz colors, palette = growth.viz.matplotlib_style() # Load the data mass_fracs = pd.read_csv('../data/supplement_figure_data/yeast_ribosomal_mass_fractions.csv') elong = pd.read_csv('...
cremerlab/flux_parity
code/FigS5_yeast.py
FigS5_yeast.py
py
3,736
python
en
code
3
github-code
21
[ { "api_name": "growth.model.viz.matplotlib_style", "line_number": 8, "usage_type": "call" }, { "api_name": "growth.model.viz", "line_number": 8, "usage_type": "attribute" }, { "api_name": "growth.model", "line_number": 8, "usage_type": "name" }, { "api_name": "pan...
12025314528
from argparse import ArgumentParser from debias.modules import clf_debias_loss_functions from debias.modules import qa_debias_loss_functions def add_general_args(parser: ArgumentParser): """Arguments that are common between all experiments""" parser.add_argument("--output_dir", "-o", default=None, ...
chrisc36/debias
debias/utils/cli_utils.py
cli_utils.py
py
1,999
python
en
code
52
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "name" }, { "api_name": "argparse.ArgumentParser", "line_number": 17, "usage_type": "name" }, { "api_name": "debias.modules.clf_debias_loss_functions.Plain", "line_number": 27, "usage_type": "call" ...
9312059478
import math import itertools from imgdedup import color from imgdedup.color import Color DIRECTIONS = list(itertools.product((-1, 0, 1), repeat=2)) class Bitmap(object): def __init__(self, bitmap): self.bitmap = bitmap self.width = len(bitmap[0]) self.height = len(bitmap) def __it...
ytanay/duplicate-image-finder
imgdedup/bitmap.py
bitmap.py
py
2,085
python
en
code
0
github-code
21
[ { "api_name": "itertools.product", "line_number": 8, "usage_type": "call" }, { "api_name": "imgdedup.color.Color.average", "line_number": 31, "usage_type": "call" }, { "api_name": "imgdedup.color.Color", "line_number": 31, "usage_type": "name" }, { "api_name": "ma...
69805650614
import os import cv2 import numpy as np if __name__ == "__main__": from object_detection import ObjectDetection else: from .object_detection import ObjectDetection script_path = os.path.dirname(os.path.abspath(__file__)) def add_transparent_image(background, foreground, x_offset=0, y_offset=0): bg_h, b...
hernancontigiani/camera-computer-vision
detection/image_overlap.py
image_overlap.py
py
2,679
python
en
code
0
github-code
21
[ { "api_name": "os.path.dirname", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.dstack", "line...
73041709493
from __future__ import division import numpy as np from copy import deepcopy import sys from ._sdf import SDFRenderer from ...gloo import (TextureAtlas, IndexBuffer, VertexBuffer) from ...gloo import context from ...gloo.wrappers import _check_valid from ...ext.six import string_types from ...util.fonts import _load...
LiuFang816/SALSTM_py_data
python/vispy_vispy/vispy-master/vispy/visuals/text/text.py
text.py
py
17,851
python
en
code
9
github-code
21
[ { "api_name": "gloo.TextureAtlas", "line_number": 31, "usage_type": "call" }, { "api_name": "io.load_spatial_filters", "line_number": 33, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 35, "usage_type": "call" }, { "api_name": "ext.six.strin...
9830640450
from cProfile import label from importlib.metadata import entry_points import string import tkinter as tk import aspose.slides as slides import aspose.pydrawing as drawing from PIL import ImageTk , Image from tkinter import PhotoImage, filedialog main = tk.Tk() main.title("PPT to PdfConverter") p1 = Photo...
shadmanshaikh/pdfcoverter
main.py
main.py
py
1,887
python
en
code
3
github-code
21
[ { "api_name": "tkinter.Tk", "line_number": 11, "usage_type": "call" }, { "api_name": "tkinter.PhotoImage", "line_number": 13, "usage_type": "call" }, { "api_name": "PIL.ImageTk.PhotoImage", "line_number": 17, "usage_type": "call" }, { "api_name": "PIL.ImageTk", ...
5696798916
__version__ = "0.0.1" from typing import Any, Dict, List, Optional, TypeVar from fastapi import FastAPI from fastapi.openapi.docs import ( get_redoc_html, get_swagger_ui_html, get_swagger_ui_oauth2_redirect_html, ) from starlette.requests import Request from starlette.responses import HTMLResponse, JSONRe...
virajkanwade/fastapi_swagger2
src/fastapi_swagger2/__init__.py
__init__.py
py
5,674
python
en
code
3
github-code
21
[ { "api_name": "fastapi.FastAPI", "line_number": 18, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 19, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 20, "usage_type": "name" }, { "api_name": "typing.List", "li...
26499209317
from django.shortcuts import render, redirect from books.models import Book from django.core.paginator import Paginator def books_view(request): template = 'books/books_list.html' catalog = Book.objects.all() for book in catalog: book.pub_date = book.pub_date.strftime('%Y-%m-%d') context = {'c...
VyacheslavBakashov/Django_HW
2.1-databases/models_list_displaying/books/views.py
views.py
py
1,613
python
en
code
0
github-code
21
[ { "api_name": "books.models.Book.objects.all", "line_number": 8, "usage_type": "call" }, { "api_name": "books.models.Book.objects", "line_number": 8, "usage_type": "attribute" }, { "api_name": "books.models.Book", "line_number": 8, "usage_type": "name" }, { "api_n...
26405613457
import pandas as pd import numpy as np import matplotlib.pyplot as plt df = pd.read_csv("Virat_Kohli.csv") # print(df.head()) # #? Total no of runs Kholi has scored # print("Total runs: ", df["Runs"].sum()) # #? Find out the total no of balls he has faced # print("Total balls faced: ", df["BF"].sum()) # #? Find out...
Kamalmandal2003/Winter-Training-Project
analysis.py
analysis.py
py
2,741
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 41, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 41, "usage_type": "name" }, { "api_name": "matplotlib....
28525080415
from collections import Counter data = sorted([int(line.strip()) for line in open("10/input.txt")] + [0]) count = Counter({0:1}) for i in data: for j in range(i + 1, i + 4): count[j] += count[i] print(count[max(data) + 3])
bcwood/adventofcode2020
10/part2.py
part2.py
py
238
python
en
code
0
github-code
21
[ { "api_name": "collections.Counter", "line_number": 4, "usage_type": "call" } ]
23711613336
#!/bin/env python3 from math import log, ceil, floor, sqrt from random import choice, randint import time import stream # import hashing as hs # import modulus_hashing as modh ################## Modulus-prime scheme ######################3 def hash_func_modulus_prime(N,a,p,x): return ((a*x) % p) % N #Can be _ver...
heben2/streaming_sketches_hashing_2016
src/test_hashing.py
test_hashing.py
py
5,689
python
en
code
1
github-code
21
[ { "api_name": "math.sqrt", "line_number": 18, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 24, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 30, "usage_type": "call" }, { "api_name": "math.ceil", "line_number"...
32616979298
import unittest from unittest import mock import pytest from ScoutSuite.providers import get_provider from ScoutSuite.providers.aws.authentication_strategy import AWSCredentials from ScoutSuite.providers.base.authentication_strategy import AuthenticationException from ScoutSuite.providers.base.authentication_strategy...
ryanmrestivo/red-team
cloud/ScoutSuite/tests/test_aws_provider.py
test_aws_provider.py
py
4,343
python
en
code
91
github-code
21
[ { "api_name": "unittest.TestCase", "line_number": 17, "usage_type": "attribute" }, { "api_name": "ScoutSuite.providers.base.authentication_strategy_factory.get_authentication_strategy", "line_number": 22, "usage_type": "call" }, { "api_name": "ScoutSuite.providers.aws.authenticat...
22221329216
from liner_system import com_linear_data from noliner_system import com_nolinear_data import matplotlib.pyplot as plt if __name__ == '__main__': ax1 = plt.subplot(211) ax1.margins(0.05) t1,x1,v1 = com_nolinear_data(5) ax1.plot(t1, x1,'--',label='nolinear(5x)') ax1.plot(t1, v1,'--',label='noline...
wangjunhe8127/Simulation_Nonlinear-Control-Systems
plot_file.py
plot_file.py
py
1,330
python
en
code
0
github-code
21
[ { "api_name": "matplotlib.pyplot.subplot", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 10, "usage_type": "name" }, { "api_name": "noliner_system.com_nolinear_data", "line_number": 12, "usage_type": "call" }, { "api_...
42256707279
#-*- coding: utf-8 -*- import maya.cmds as cmds def getRenderableCameras(): cameraList = cmds.ls(ap=True,type='camera') renderableCameraList = {} for camera in cameraList: if cmds.getAttr(camera+'.renderable'): transforms = cmds.listRelatives(camera,f=True,parent=True,type='transform') ...
onexeno/Maya_Scripts
YM_Lib/common/YM_Camera_Ops.py
YM_Camera_Ops.py
py
1,444
python
en
code
0
github-code
21
[ { "api_name": "maya.cmds.ls", "line_number": 5, "usage_type": "call" }, { "api_name": "maya.cmds", "line_number": 5, "usage_type": "name" }, { "api_name": "maya.cmds.getAttr", "line_number": 8, "usage_type": "call" }, { "api_name": "maya.cmds", "line_number": ...
30596353695
import json import os from collections import OrderedDict from copy import deepcopy import torch import torch.distributed as dist import torch.nn.functional as F import torchvision.transforms as T from tqdm import tqdm from src.archs import define_network from src.metrics import cal_metric from src.models.base_model ...
hanchenchen/CCKS2022-track2-solution
src/models/bce_model.py
bce_model.py
py
7,963
python
en
code
9
github-code
21
[ { "api_name": "src.models.base_model.BaseModel", "line_number": 18, "usage_type": "name" }, { "api_name": "src.archs.define_network", "line_number": 23, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 23, "usage_type": "call" }, { "api_name":...
209406050
from django.test import TestCase from django.contrib.auth import get_user_model from .models import Snack from django.urls import reverse # Create your tests here. class SnackTest(TestCase): def setUp(self): self.user = get_user_model().objects.create_user( username='user',email='user@user.co...
Malek-Abdelal/django_crud_project
snacks/tests.py
tests.py
py
2,151
python
en
code
0
github-code
21
[ { "api_name": "django.test.TestCase", "line_number": 8, "usage_type": "name" }, { "api_name": "django.contrib.auth.get_user_model", "line_number": 11, "usage_type": "call" }, { "api_name": "models.Snack.objects.create", "line_number": 16, "usage_type": "call" }, { ...
16074490739
import sys import pandas as pd from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QLineEdit, QPushButton, QVBoxLayout, QScrollArea class MainWindow(QWidget): def __init__(self): super().__init__() # 设置窗口图标 self.setWindowIcon(QIcon('favicon.ico')) ...
zzbcode/gaokao-score-college
查可以上哪些大学.py
查可以上哪些大学.py
py
2,207
python
en
code
0
github-code
21
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 6, "usage_type": "name" }, { "api_name": "PyQt5.QtGui.QIcon", "line_number": 11, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QLabel", "line_number": 14, "usage_type": "call" }, { "api_name": "PyQt5...
36854673578
from kivy.lang import Builder from kivy.clock import Clock from kivy.properties import StringProperty from kivymd.uix.dialog import MDDialog from kivymd.uix.boxlayout import MDBoxLayout from kivymd.uix.gridlayout import MDGridLayout Builder.load_string(""" <ContentInfoMessageBox>: cols: 2 adaptive_height: True...
aprilahijriyan/kvuilder
kvuilder/data/templates/libs/components/messagebox.py
messagebox.py
py
3,023
python
en
code
1
github-code
21
[ { "api_name": "kivy.lang.Builder.load_string", "line_number": 8, "usage_type": "call" }, { "api_name": "kivy.lang.Builder", "line_number": 8, "usage_type": "name" }, { "api_name": "kivymd.uix.gridlayout.MDGridLayout", "line_number": 86, "usage_type": "name" }, { "...
40175895435
import yaml from fyers_api import fyersModel import datetime import logging from time import sleep from multiprocessing import Process, Queue, Value from dataFeed import DataFeed from strategyLogic import StrategyLogic from exchComm import ExchComm from access_token import get_fyers_object from globalEnums import Strat...
ShabbirHasan1/abcde
main.py
main.py
py
4,442
python
en
code
1
github-code
21
[ { "api_name": "access_token.get_fyers_object", "line_number": 27, "usage_type": "call" }, { "api_name": "multiprocessing.Queue", "line_number": 31, "usage_type": "call" }, { "api_name": "multiprocessing.Queue", "line_number": 32, "usage_type": "call" }, { "api_nam...
8443961590
import argparse import functools import numpy as np import tensorflow as tf from tensorflow.contrib.boosted_trees.estimator_batch.estimator import GradientBoostedDecisionTreeEstimator from tensorflow.contrib.boosted_trees.proto import learner_pb2 from tensorflow.contrib.boosted_trees.estimator_batch import custom_loss_...
clustersdata/finch
tensorflow-models/shallow/gbt_mnist.py
gbt_mnist.py
py
3,063
python
en
code
null
github-code
21
[ { "api_name": "tensorflow.logging.set_verbosity", "line_number": 11, "usage_type": "call" }, { "api_name": "tensorflow.logging", "line_number": 11, "usage_type": "attribute" }, { "api_name": "tensorflow.python.ops.math_ops.argmax", "line_number": 18, "usage_type": "call" ...
3693951438
#!/usr/bin/env python3 import tmdbsimple as tmdb from requests import HTTPError from datetime import datetime from utils.config import get_config from utils.logger import Logger config = get_config() log = Logger().get_log(__name__) # Find by tmdb id def _find_by_tmdbid(tmdb_id): # Returns tmdb.Movies object ...
tinni123/Trailer-Technician
providers/tmdb.py
tmdb.py
py
3,205
python
en
code
0
github-code
21
[ { "api_name": "utils.config.get_config", "line_number": 9, "usage_type": "call" }, { "api_name": "utils.logger.Logger", "line_number": 10, "usage_type": "call" }, { "api_name": "tmdbsimple.Movies", "line_number": 16, "usage_type": "call" }, { "api_name": "requests...
922632654
""" Mail """ # -*- coding: utf-8 -*- import logging from plone import api from plone.app.contentrules.actions.mail import IMailAction from plone.app.contentrules.actions.mail import MailAction from plone.app.contentrules.actions.mail import MailActionExecutor from plone.contentrules.rule.interfaces import IRuleElement...
eea/eea.meeting
src/eea/meeting/events/mail.py
mail.py
py
3,224
python
en
code
3
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "plone.app.contentrules.actions.mail.IMailAction", "line_number": 18, "usage_type": "name" }, { "api_name": "plone.app.contentrules.actions.mail.MailAction", "line_number": 23, "us...
16817920660
""" Программе в качестве аргумента передаётся ссылка на сайт, который она обходит и извлекает данные с возможностью проксирования через гуглкэш Usage: crawler.py <url> [options] Options: -h --help справка --use-google-cache использовать гуглкэш для парсинга сайта --root-url=URL ...
bananacatsky/parser
crawler.py
crawler.py
py
3,724
python
ru
code
0
github-code
21
[ { "api_name": "re.findall", "line_number": 27, "usage_type": "call" }, { "api_name": "re.IGNORECASE", "line_number": 27, "usage_type": "attribute" }, { "api_name": "re.DOTALL", "line_number": 27, "usage_type": "attribute" }, { "api_name": "logging.info", "line...
74861120371
import datetime import random from module import Module from assigned_module import AssignedModule from award import Award class Schedule: # klasa planu def __init__(self, awards_list: list = None): self.schedule_dict = {} self.today = datetime.date.today() self.current_module = None ...
jakwiat/theGoodPlace
schedule.py
schedule.py
py
4,175
python
en
code
1
github-code
21
[ { "api_name": "datetime.date.today", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 12, "usage_type": "attribute" }, { "api_name": "award.Award", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.date", ...
72163985972
from sentence_transformers import SentenceTransformer import datautils import json # MODEL_NAME = "all-MiniLM-L12-v2" MODEL_NAME = "all-mpnet-base-v2" OUTPUT_FILENAME = "sentences_emb.json" def main(): print("Loading everything...") dataset = datautils.load_dataset_mapping() model = SentenceTransformer(MO...
disi-unibo-nlp/ddegk
src/sentence_similarity/sentence_embedding.py
sentence_embedding.py
py
660
python
en
code
1
github-code
21
[ { "api_name": "datautils.load_dataset_mapping", "line_number": 11, "usage_type": "call" }, { "api_name": "sentence_transformers.SentenceTransformer", "line_number": 12, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 18, "usage_type": "call" } ]
31947026906
import matplotlib.pyplot as plt import numpy as np from ont_fast5_api.fast5_interface import get_fast5_file import h5py import os import itertools import glob rDNA_ids = [] with open('1015_rDNA_reads.fastq') as f: for items in itertools.zip_longest(*[iter(f)]*4): rDNA_ids.append(items[0].split()[0][1:]) ...
utrori/Nanopore_cas9
raw_signal_analysis.py
raw_signal_analysis.py
py
1,300
python
en
code
0
github-code
21
[ { "api_name": "itertools.zip_longest", "line_number": 12, "usage_type": "call" }, { "api_name": "h5py.File", "line_number": 25, "usage_type": "call" }, { "api_name": "h5py.File", "line_number": 27, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", ...
37004805168
import numpy as np import matplotlib # matplotlib.use('Agg') import matplotlib.pyplot as plt from SolarSail_Max import SolarSail_Max as Env import A3C import os import sys import pickle if __name__ == '__main__': random = True train = 0 name = 'random' if random else 'static' env = Env(random) par...
Mrfive1001/ReinforcementLearning
7 SolarSail_Maximum/main_a3c.py
main_a3c.py
py
2,186
python
en
code
4
github-code
21
[ { "api_name": "SolarSail_Max.SolarSail_Max", "line_number": 16, "usage_type": "call" }, { "api_name": "A3C.Para", "line_number": 17, "usage_type": "call" }, { "api_name": "A3C.A3C", "line_number": 33, "usage_type": "call" }, { "api_name": "SolarSail_Max.SolarSail_...
18517226116
""" tinyws: a tiny WebSocket implementation """ import socket import hashlib import threading from base64 import b64encode from enum import IntEnum import codecs clients = [] PORT = 7079 # 'py' in hex """WebSocket Close Codes""" ERROR_NONE = 1000 ERROR_PEER = 1001 ERROR_PROTO = 1002 ERROR_BAD = 1003 ERROR_RSV = 100...
DamnedFacts/tinyws
tinyws.py
tinyws.py
py
17,701
python
en
code
0
github-code
21
[ { "api_name": "socket.timeout", "line_number": 226, "usage_type": "attribute" }, { "api_name": "base64.b64encode", "line_number": 301, "usage_type": "call" }, { "api_name": "hashlib.sha1", "line_number": 301, "usage_type": "call" }, { "api_name": "codecs.getincrem...
22916408980
# -*- coding: utf-8 -*- import os import urllib2 import zipfile import glob import sqlite3 from dictmaster.util import mkdir_p, CancelableThread, FLAGS from dictmaster.queue import RawDbQueue DEFAULT_THREADCNT=6 class FetcherThread(CancelableThread): uris = [] postdata = None no = 0 _i = 0 _fla...
richfan/dictmaster
dictmaster/fetcher.py
fetcher.py
py
7,526
python
en
code
null
github-code
21
[ { "api_name": "dictmaster.util.CancelableThread", "line_number": 14, "usage_type": "name" }, { "api_name": "dictmaster.util.FLAGS", "line_number": 28, "usage_type": "name" }, { "api_name": "dictmaster.util.CancelableThread", "line_number": 51, "usage_type": "name" }, ...
39408532766
import data, os, pickle, utils import numpy as np from sklearn.svm import LinearSVC from sklearn.preprocessing import StandardScaler def formatFeatures(features): features = np.array(features) return features.reshape(features.shape[0], -1) def picklename(colorspace, channel, orient, pix_per_cell, cell_per_b...
mholzel/VehicleDetection
pickler.py
pickler.py
py
8,662
python
en
code
0
github-code
21
[ { "api_name": "numpy.array", "line_number": 8, "usage_type": "call" }, { "api_name": "utils.features", "line_number": 19, "usage_type": "call" }, { "api_name": "utils.load", "line_number": 21, "usage_type": "call" }, { "api_name": "data.get", "line_number": 28...
22568777511
import os import unittest from io import BytesIO, StringIO import networkx as nx from dataprofiler.data_readers.data import Data from dataprofiler.data_readers.graph_data import GraphData test_root_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) class TestGraphDataClass(unittest.TestCase): ...
capitalone/DataProfiler
dataprofiler/tests/data_readers/test_csv_graph_data.py
test_csv_graph_data.py
py
8,195
python
en
code
1,277
github-code
21
[ { "api_name": "os.path.dirname", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 10, "usage_type": "call" }, { "api_name": "unittest.TestCase", ...
20000268667
import numpy as np import peakutils from scipy.fftpack import fft from matplotlib import pyplot as plt from peakutils.plot import plot as pplot def FFTG(xInput, yInput): xLength = int(len(xInput)) #determine length of the array period = np.diff(xInput).mean() #determine period by the average of each element m...
IgnaceMenace/Orange3-Clockwork
peakutils_test.py
peakutils_test.py
py
2,307
python
en
code
1
github-code
21
[ { "api_name": "numpy.diff", "line_number": 9, "usage_type": "call" }, { "api_name": "scipy.fftpack.fft", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.abs", "line_numb...
19642286335
from os import environ from json import load from codecs import open from collections import ChainMap from unittest import TextTestRunner from lib.suite import make_suites with open('./tests/test_demo.json', encoding='utf-8') as f: data = load(f) def setup_hook_func(*args, **kwargs): print('hooks: setup: ru...
zhengxs2018/simple-apitest
runtest.py
runtest.py
py
872
python
en
code
0
github-code
21
[ { "api_name": "codecs.open", "line_number": 9, "usage_type": "call" }, { "api_name": "json.load", "line_number": 10, "usage_type": "call" }, { "api_name": "collections.ChainMap", "line_number": 34, "usage_type": "call" }, { "api_name": "os.environ", "line_numb...
70019424692
from django.urls import path from .views import * app_name = 'venda' urlpatterns = [ path('teste_vendas', teste_vendas, name='teste_vendas'), path('vendas', vendas, name="vendas"), path('cadastraProduto', cadastraProduto, name="cadastraProduto"), path('deletaProdutoVenda/<int:id>/<int:page>', deletaPr...
alexantos/venda
venda/urls.py
urls.py
py
361
python
pt
code
0
github-code
21
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", ...
23873801420
""" Player class. Player contains all behavior related to the player sprite. This includes some logic related to the controller though most of that is delegated to its own class. """ import pygame from base.color import Color from debug import DEBUG import configs as conf from configs import PLAYER as P from .jump...
andrewtremblay/platform-mechanics
src/sprites/player.py
player.py
py
6,390
python
en
code
0
github-code
21
[ { "api_name": "pygame.sprite", "line_number": 22, "usage_type": "attribute" }, { "api_name": "configs.PLAYER.INITIAL", "line_number": 32, "usage_type": "attribute" }, { "api_name": "configs.PLAYER", "line_number": 32, "usage_type": "name" }, { "api_name": "configs...
20661156111
## Test Target from alcustoms.sql.objects import Table ## Test Framework import unittest ## Testing Utils from alcustoms.sql.tests import utils ## This module from alcustoms.sql import constants, objects from alcustoms.sql.objects import Connection ## Builtin import collections import itertools class TableConstru...
AdamantLife/alcustoms
alcustoms/sql/tests/objects/test_Table.py
test_Table.py
py
44,997
python
en
code
0
github-code
21
[ { "api_name": "unittest.TestCase", "line_number": 18, "usage_type": "attribute" }, { "api_name": "alcustoms.sql.tests.utils.setupconnection", "line_number": 20, "usage_type": "call" }, { "api_name": "alcustoms.sql.tests.utils", "line_number": 20, "usage_type": "name" },...
25421425841
import asyncio import logging import os import subprocess from typing import Dict from ..channel import ChannelError, ProtocolChannel from ..transports import SubprocessProtocol, SubprocessTransport logger = logging.getLogger(__name__) class SocketStreamChannel(ProtocolChannel): payload = 'stream' async de...
Cdaprod/cockpit
src/cockpit/channels/stream.py
stream.py
py
5,708
python
en
code
0
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "channel.ProtocolChannel", "line_number": 13, "usage_type": "name" }, { "api_name": "asyncio.AbstractEventLoop", "line_number": 16, "usage_type": "attribute" }, { "api_name...
75136549493
from typing import Callable, Iterable from lifecycle.config import Config from lifecycle.infrastructure.infra_target import remote_shell from lifecycle.monitor.base import JobMonitor from lifecycle.monitor.health import check_until_job_is_operational, quick_check_job_condition from lifecycle.monitor.metric_parser impo...
TheRacetrack/plugin-remote-kubernetes
src/monitor.py
monitor.py
py
5,179
python
en
code
0
github-code
21
[ { "api_name": "racetrack_client.log.logs.get_logger", "line_number": 19, "usage_type": "call" }, { "api_name": "lifecycle.monitor.base.JobMonitor", "line_number": 22, "usage_type": "name" }, { "api_name": "plugin_config.InfrastructureConfig", "line_number": 25, "usage_typ...
41270203583
#!/Library/Frameworks/Python.framework/Versions/2.7/bin/python import numpy as np import sys import scipy from scipy import stats data_file = sys.argv[1] data = np.loadtxt(data_file) slope, intercept, r_value, p_value, std_err = stats.linregress(data[499:2499,0], data[499:2499,1]) nf = open('linear_reg.dat', 'w') ...
rbdavid/MolecDynamics
Analysis/MSD/slope.py
slope.py
py
754
python
en
code
0
github-code
21
[ { "api_name": "sys.argv", "line_number": 8, "usage_type": "attribute" }, { "api_name": "numpy.loadtxt", "line_number": 10, "usage_type": "call" }, { "api_name": "scipy.stats.linregress", "line_number": 12, "usage_type": "call" }, { "api_name": "scipy.stats", "...
496821968
import os from datetime import timedelta from airflow.utils.dates import days_ago from airflow.models import Variable LOCAL_PATH_DATA = Variable.get("LOCAL_PATH_DATA") DOCKER_PATH_DATA = Variable.get("DOCKER_PATH_DATA") LOCAL_PATH_BEST_MODEL = Variable.get("LOCAL_PATH_BEST_MODEL") DOCKER_PATH_BEST_MODEL = Variable.g...
made-ml-in-prod-2021/n0rdream
airflow_ml_dags/dags/global_variables.py
global_variables.py
py
1,111
python
en
code
0
github-code
21
[ { "api_name": "airflow.models.Variable.get", "line_number": 7, "usage_type": "call" }, { "api_name": "airflow.models.Variable", "line_number": 7, "usage_type": "name" }, { "api_name": "airflow.models.Variable.get", "line_number": 8, "usage_type": "call" }, { "api_...
7284509727
# coding: utf-8 from werkzeug import cached_property from marco.ext import dot class Container(object): def __init__(self, id, container_id, port, host_id, ident_id, app_name, version, sub_app): self.id = id self.container_id = container_id self.port = port self.host_id = host_i...
tonicbupt/marco
marco/models/container.py
container.py
py
1,477
python
en
code
1
github-code
21
[ { "api_name": "marco.ext.dot.get_container", "line_number": 24, "usage_type": "call" }, { "api_name": "marco.ext.dot", "line_number": 24, "usage_type": "name" }, { "api_name": "marco.ext.dot.get_containers", "line_number": 30, "usage_type": "call" }, { "api_name":...
4649471717
import tensorflow as tf from tensorflow import keras import tensorflow_probability as tfp from gym import Space, spaces from .utils import to_batchtensor class SquashedDiagGaussian: def __init__(self, mu, std, epsilon=1e-6): """ Guassian distribution with tanh squashing Parameters ...
NiranjanBhujel/ECE591-Project
code/sac_algo/policies.py
policies.py
py
4,260
python
en
code
0
github-code
21
[ { "api_name": "tensorflow_probability.distributions.Normal", "line_number": 25, "usage_type": "call" }, { "api_name": "tensorflow_probability.distributions", "line_number": 25, "usage_type": "attribute" }, { "api_name": "tensorflow.math.tanh", "line_number": 28, "usage_ty...
40761180257
import pytest from data_structures_algorithms.data_structures.hashing.hash_map import HashMap def test_construct(): HashMap() HashMap(initial_capacity=100) HashMap(hash_func_name="my_add_hash") def test_set_get(): hash_map = HashMap() hash_map["a"] = 1 assert hash_map["a"] == 1 def test_si...
yezhengkai/data-structures-and-algorithms
python/tests/test_hashing.py
test_hashing.py
py
610
python
en
code
0
github-code
21
[ { "api_name": "data_structures_algorithms.data_structures.hashing.hash_map.HashMap", "line_number": 6, "usage_type": "call" }, { "api_name": "data_structures_algorithms.data_structures.hashing.hash_map.HashMap", "line_number": 7, "usage_type": "call" }, { "api_name": "data_struct...
34901607145
import json import os from pathlib import Path from typing import Tuple # open a pdf with pydf2 import PyPDF2 from loguru import logger class FileHandler: @staticmethod def read_file(file_path: str): with open(file_path, "r") as f: return f.read() @staticmethod def save_dic_as_j...
spacewaterbear/cr-analysis
utils/file_handler.py
file_handler.py
py
2,180
python
en
code
0
github-code
21
[ { "api_name": "loguru.logger.info", "line_number": 21, "usage_type": "call" }, { "api_name": "loguru.logger", "line_number": 21, "usage_type": "name" }, { "api_name": "json.dump", "line_number": 23, "usage_type": "call" }, { "api_name": "loguru.logger.info", "...
18799936954
import os import numpy as np import matplotlib.pyplot as plt img_dir = '../../noise2noise-pytorch/cifar/test' f = np.random.choice(os.listdir(img_dir)) img = np.uint8(plt.imread(os.path.join(img_dir, f)) * 255) fig, axs = plt.subplots(1, 4, figsize=(15, 4)) axs[0].imshow(img) axs[0].set_xticks([]) axs[0].set_yticks...
hauserkristen/adversarial_denoising
denoising/poisson_shot_noise.py
poisson_shot_noise.py
py
956
python
en
code
1
github-code
21
[ { "api_name": "numpy.random.choice", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.uint8", "line...
37816023088
import json from pathlib import Path import numpy as np from keras.preprocessing import image, to_categorical def gen_npy(n_use): video_dir = Path('~/dataset/video00').expanduser() frame_dir = video_dir / 'frames/' info_path = video_dir / 'info.json' img_paths = sorted(frame_dir.iterdir()) info =...
amoshyc/tthl
data/gen_npy.py
gen_npy.py
py
1,370
python
en
code
0
github-code
21
[ { "api_name": "pathlib.Path", "line_number": 8, "usage_type": "call" }, { "api_name": "json.load", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 22...
40756868192
from sqlalchemy import create_engine import re from pandas import Series, DataFrame, concat import pandas as pd from pymongo import MongoClient import subprocess as t import logging from logging.config import fileConfig import configparser fileConfig('logger_config.ini') logger=logging.getLogger('infoLogger') class L...
yyztc/itop
load_dbserver.py
load_dbserver.py
py
4,346
python
en
code
0
github-code
21
[ { "api_name": "logging.config.fileConfig", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "configparser.ConfigParser", "line_number": 17, "usage_type": "call" }, { "api_name": ...
42510562754
from selenium import webdriver import time import pandas as pd import numpy as np from bs4 import BeautifulSoup import requests import re import copy class LinkedInData: """Crawl data from LinkedIn webpage jobKeyword: job type name timeCrawl: time for scrolling down the webpages headers: ...
Grace171/LinkedInJobAd
crawler.py
crawler.py
py
3,771
python
en
code
1
github-code
21
[ { "api_name": "selenium.webdriver.Safari", "line_number": 31, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 31, "usage_type": "name" }, { "api_name": "pandas.DataFrame", "line_number": 32, "usage_type": "call" }, { "api_name": "time.ti...
18403804869
import itertools; import math; import operator; import random; from bisect import *; from collections import deque, defaultdict, Counter, OrderedDict; from functools import reduce; from heapq import *; import unittest; from typing import List; def get_sol(): return Solution() class Solution: def balancedString(self...
afzalsiddique/problem-solving
Problem_Solving_Python/leetcode/lc1234.py
lc1234.py
py
1,802
python
en
code
1
github-code
21
[ { "api_name": "collections.Counter", "line_number": 7, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 10, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 23, "usage_type": "attribute" } ]
73913500213
from fastapi import FastAPI, Request, UploadFile, File, Form from fastapi.templating import Jinja2Templates import os import shutil import uvicorn import tracemoepy import asyncio import requests import time app = FastAPI() templates = Jinja2Templates(directory="src/templates") tracemoe = tracemoepy.tracemoe.TraceMoe(...
ArshdeepGadhri/SauceApp
base.py
base.py
py
2,914
python
en
code
0
github-code
21
[ { "api_name": "fastapi.FastAPI", "line_number": 11, "usage_type": "call" }, { "api_name": "fastapi.templating.Jinja2Templates", "line_number": 12, "usage_type": "call" }, { "api_name": "tracemoepy.tracemoe.TraceMoe", "line_number": 13, "usage_type": "call" }, { "a...
72513481973
import argparse from parameters import is_response_successful , list_parameters , list_contents_of_parameter parser = argparse.ArgumentParser() parser.add_argument('--parameter', default=False) args = parser.parse_args() def main(): parameter_name = args.parameter parameters = list_parameters() parame...
deniz-icin/aws-ssm-lister
app/cli.py
cli.py
py
621
python
fa
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 4, "usage_type": "call" }, { "api_name": "parameters.list_parameters", "line_number": 10, "usage_type": "call" }, { "api_name": "parameters.list_contents_of_parameter", "line_number": 15, "usage_type": "call" } ]
19759922549
import itertools import os import sys import random import math import dill as pickle import csv import json import multiprocessing import numpy as np from collections import Counter from collections import defaultdict from pathlib import Path from random import shuffle import re import string def save_model(file_pat...
Priyansh2/music_classification
scripts/spotify_album_genres.py
spotify_album_genres.py
py
3,151
python
en
code
0
github-code
21
[ { "api_name": "dill.dump", "line_number": 21, "usage_type": "call" }, { "api_name": "dill.load", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 41, "usage_type": "call" }, { "api_name": "os.path", "line_number": 41, ...
72512187893
from datetime import date from datetime import datetime def getCountTable(table): a = 0 for i in table: a = a + 1 print(a) return a def getDays(): curdate = datetime.today() l_date = date(curdate.year, curdate.month, curdate.day) a = l_date.day b = l_date.month if (b == 1...
debervill/asutermflask
data_func.py
data_func.py
py
1,698
python
en
code
1
github-code
21
[ { "api_name": "datetime.datetime.today", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 14, "usage_type": "name" }, { "api_name": "datetime.date", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.date...
28201169530
import sys sys.path.append('../../') #this to include the parent directory from beeBrain.geneticAlgorithm import GeneticAlgorithm import matplotlib.pyplot as plt import numpy as np N_MOVES = 150 DNA_SIZE = N_MOVES*2 # 40 x moves, 40 y moves DIRECTION_BOUND = [0, 1] CROSS_RATE = 0.8 MUTATE_RATE = 0.0001 POP_SIZ...
devhima/beeBrain
samples/ga_samples/find_path_sample.py
find_path_sample.py
py
2,450
python
en
code
3
github-code
21
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 16, "usage_type": "call" }, { "api_name": "beeBrain.geneticAlgorithm.Gen...
74207800694
import argparse import csv import os import matplotlib.pyplot as plt import torch from matplotlib.animation import FuncAnimation from torch import Tensor, nn class Args(argparse.Namespace): depth: int width: int use_positional_encoding: bool pe_mode: str pe_num_bands: int output_dir: str ...
dylanhu7/apma1941d
expressivity/expressivity.py
expressivity.py
py
8,427
python
en
code
0
github-code
21
[ { "api_name": "argparse.Namespace", "line_number": 11, "usage_type": "attribute" }, { "api_name": "torch.nn.Module", "line_number": 22, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 22, "usage_type": "name" }, { "api_name": "torch.nn.Module...
39398442486
def predict_gen(meta1): import pickle import os import numpy as np from django.conf import settings from keras.models import load_model model = load_model('F:\Music_recomend_project\Music_recommendations_system\MusicRecommend\model10.sav') d1 = np.array([meta1]) result = mode...
MNiz-iz/Music_recomendation_web-app
Music_recomend_project/Music_recommendations_system/MusicRecommend/predictor.py
predictor.py
py
963
python
en
code
0
github-code
21
[ { "api_name": "keras.models.load_model", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.argmax", "line_number": 14, "usage_type": "call" } ]
42376460784
from flask import flash def flash_form_errors(form): """ Flashes all form errors individually :param form: WTF form :return: """ for field, errors in form.errors.items(): for error in errors: flash('{0}: {1}'.format(field, error))
UgiR/UIC-PEC
PEC/utils.py
utils.py
py
274
python
en
code
1
github-code
21
[ { "api_name": "flask.flash", "line_number": 12, "usage_type": "call" } ]
3686712564
import pygame import sys import random import unicodedata class grafo(): def __init__(self, win, ancho, alto): pygame.init() self.ancho = ancho self.alto = alto self.terminar_grafo= False self.tam_mapa_ancho = 474 self.tam_mapa_alto = 655 self.user_text = ...
Jassy0205/TAD_2.0
grafos.py
grafos.py
py
40,789
python
es
code
0
github-code
21
[ { "api_name": "pygame.init", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.Rect", "line_number": 22, "usage_type": "call" }, { "api_name": "pygame.image.load", "line_number": 24, "usage_type": "call" }, { "api_name": "pygame.image", "line_num...
25241585720
import numpy import cv2 import math import copy import itertools from scipy import ndimage class Corners(object): def find_chessboard_coordinates(self, image_path): ###GFTT img = cv2.imread(image_path) gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) corners = cv2.goodFeaturesToTr...
DariaDanilova/camera_calibration
chessboard_corners/chessboard_corners.py
chessboard_corners.py
py
14,443
python
ru
code
0
github-code
21
[ { "api_name": "cv2.imread", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 18, "usage_type": "attribute" }, { "api_name": "cv2.goodFeaturesToTra...
793805858
#!/usr/bin/env python # @@ google # @T type google # @T category google import sys import json def procln(ev): ret = {'valid': False, 'name': 'google'} if 'utctimestamp' not in ev: return ret ret['timestamp'] = ev['utctimestamp'] if 'details' not in ev: return ret if 'events_name'...
ameihm0912/geomodel
plugin/google.py
google.py
py
834
python
en
code
10
github-code
21
[ { "api_name": "json.loads", "line_number": 30, "usage_type": "call" }, { "api_name": "sys.stdin.read", "line_number": 30, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 30, "usage_type": "attribute" }, { "api_name": "sys.stdout.write", "line...
22507558575
from sqlalchemy import inspect def object_as_dict(obj: object): """ Returns an object as a dictionary by list comprehension Parameters: obj (obj): The object to be converted into a dictionary Returns: dict (dict): A dictionary based on the object """ return { ...
SkinnyPigeon/serums_api
components/utils/convert_to_dicts.py
convert_to_dicts.py
py
1,263
python
en
code
0
github-code
21
[ { "api_name": "sqlalchemy.inspect", "line_number": 14, "usage_type": "call" } ]
1827615897
import winsound import time import multiprocessing as mp import keyboard def play(v): while(1): sleep_time = v.value print('sleeping for ',sleep_time) time.sleep(sleep_time) winsound.PlaySound("sound.wav", winsound.SND_LOOP) def change(v): while True: try: i...
nm011/dynamic-beats
beats.py
beats.py
py
867
python
en
code
0
github-code
21
[ { "api_name": "time.sleep", "line_number": 10, "usage_type": "call" }, { "api_name": "winsound.PlaySound", "line_number": 11, "usage_type": "call" }, { "api_name": "winsound.SND_LOOP", "line_number": 11, "usage_type": "attribute" }, { "api_name": "keyboard.is_pres...
30623901809
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ /*************************************************************************** Scripts for Msc of Giovana in LAPIG(University of Goias) ***************************************************************************/ /*******************************************************...
lmotta/lapig_msc_giovana
cap_04/motta_2021d/mapbioma_tendences_mk_reduce.py
mapbioma_tendences_mk_reduce.py
py
7,335
python
en
code
0
github-code
21
[ { "api_name": "osgeo.gdal.UseExceptions", "line_number": 30, "usage_type": "call" }, { "api_name": "osgeo.gdal", "line_number": 30, "usage_type": "name" }, { "api_name": "osgeo.gdal.PushErrorHandler", "line_number": 31, "usage_type": "call" }, { "api_name": "osgeo...
32467633186
from django.conf import settings from django.contrib.auth.models import AbstractUser from django.db import models class User(AbstractUser): """Кастомный пользователь с дополнительными полями.""" username = models.CharField( max_length=settings.MAX_LENGTH_USER, unique=True, verbose_name...
naelsa/api_yamdb
api_yamdb/users/models.py
models.py
py
1,737
python
en
code
0
github-code
21
[ { "api_name": "django.contrib.auth.models.AbstractUser", "line_number": 6, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 8, "usage_type": "call" }, { "api_name": "django.db.models", "line_number": 8, "usage_type": "name" }, { "...
21364233168
from dataclasses import _get_field import typing from typing import Type from ipv8.messaging.lazy_payload import VariablePayload from ipv8.messaging.serialization import default_serializer, Serializable def get_cls_fields(cls): cls_annotations = cls.__dict__.get("__annotations__", {}) # Now find fields in o...
grimadas/bami
src/bami/backbone/payload.py
payload.py
py
3,809
python
en
code
0
github-code
21
[ { "api_name": "dataclasses._get_field", "line_number": 15, "usage_type": "call" }, { "api_name": "typing.Type", "line_number": 33, "usage_type": "name" }, { "api_name": "ipv8.messaging.serialization.Serializable", "line_number": 33, "usage_type": "name" }, { "api_...
42630867623
from selenium import webdriver class Item(object): ip = None port = None anonymous = None type = None local = None speed = None class GetProxy(object): def __init__(self): ''' 初始化 ''' self.starturl = "http://www.kuaidaili.com/free/inha/" self.urls...
SmallBlackBeans/pythonPractice
hello/爬虫/练习/爬取快代理/kuaiProxy.py
kuaiProxy.py
py
1,842
python
en
code
0
github-code
21
[ { "api_name": "selenium.webdriver.PhantomJS", "line_number": 33, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 33, "usage_type": "name" } ]
24896292116
import os from pathlib import Path # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent import firebase_admin from firebase_admin import credentials cred_path = os.path.join(BASE_DIR, "static", "apikey.json") cred = credentials.Certificate(cred_path) fi...
LFabris6/VoucheriWeb
adriaticweb/settings.py
settings.py
py
4,002
python
en
code
0
github-code
21
[ { "api_name": "pathlib.Path", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "firebase_admin.credentials.Cert...
42499668078
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name='j-funcutils', version='0.0.5', author="Juan Manuel Camara Diaz", author_email="juanma.caaz@gmail.com", description="A basic cost time calculator", url="https://github.com/juan...
juanmacaaz/FuncUtils
setup.py
setup.py
py
556
python
en
code
1
github-code
21
[ { "api_name": "setuptools.setup", "line_number": 7, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 14, "usage_type": "call" } ]
5751618519
from socket import * import helper host = '127.0.0.1' port = 50008 while True: sock = helper.tcp() print('key in message :') msg = input() if msg.lower() == 'q': break conn = sock.connect((host,port)) byte_arr = msg.encode(encoding='utf-8') sock.send(byte_arr) buff ...
iorilan/py_tiny_apps_playground
tcp/01/tcp_client.py
tcp_client.py
py
435
python
en
code
1
github-code
21
[ { "api_name": "helper.tcp", "line_number": 8, "usage_type": "call" } ]