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
11737234773
from copy import deepcopy from zope.interface import implements from Globals import InitializeClass from AccessControl import ClassSecurityInfo from Acquisition import aq_base, aq_inner, aq_parent, aq_chain from OFS.PropertyManager import PropertyManager from Products.CMFCore.utils import getToolByName from Products....
nuxeo-cps/products--CPSSchemas
widgets/indirect.py
indirect.py
py
7,146
python
en
code
0
github-code
36
[ { "api_name": "Products.CMFCore.utils.SimpleItemWithProperties", "line_number": 16, "usage_type": "name" }, { "api_name": "zope.interface.implements", "line_number": 38, "usage_type": "call" }, { "api_name": "Products.CPSSchemas.interfaces.IWidget", "line_number": 38, "us...
19931655401
import typing from .datatype import Datatype def parse_int(v: typing.Any) -> int: """Parse the value `v` to an int. This function fixes parsing values like "100.1" to int by rounding. Raises ------ ValueError When the value `v` could not be parsed Parameters ---------- v...
miile7/pylo-project
pylo/default_datatypes.py
default_datatypes.py
py
3,582
python
en
code
1
github-code
36
[ { "api_name": "typing.Any", "line_number": 5, "usage_type": "attribute" }, { "api_name": "typing.Any", "line_number": 27, "usage_type": "attribute" }, { "api_name": "typing.Optional", "line_number": 27, "usage_type": "attribute" }, { "api_name": "datatype.Datatype...
19842328575
import os import re from io import open import torch class Dictionary(object): def __init__(self): self.word2idx = {} self.idx2word = [] def add_word(self, word): if word not in self.word2idx: self.idx2word.append(word) self.word2idx[word] = len(self.idx2word) -...
TheMarvelousWhale/NTU-CE4045-NLP
Assignment2/part_1/data_fnn.py
data_fnn.py
py
1,860
python
en
code
3
github-code
36
[ { "api_name": "os.path.join", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path", "line_number": 24, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 2...
16937190382
import re import pandas as pd import requests from bs4 import BeautifulSoup as bs base = "https://www.dictionary.com/browse/" csv = pd.read_csv("words.csv") meaning = [] pronounce = [] password = [] words = csv["Word"] for word in words: url = base + word try: read = requests.get(url,...
priyakaur/portifolio
fetch_meaning.py
fetch_meaning.py
py
1,586
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 17, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 20, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "lin...
29403941645
"""Handlers tests.""" from django.conf import settings from django.db.models.signals import post_save from django.test import override_settings from test_plus.test import TestCase import responses import rovercode_web @override_settings(SUBSCRIPTION_SERVICE_HOST='http://test.test') class TestHandlers(TestCase): ...
rovercode/rovercode-web
rovercode_web/users/tests/test_handlers.py
test_handlers.py
py
1,401
python
en
code
14
github-code
36
[ { "api_name": "test_plus.test.TestCase", "line_number": 13, "usage_type": "name" }, { "api_name": "django.db.models.signals.post_save.connect", "line_number": 18, "usage_type": "call" }, { "api_name": "django.db.models.signals.post_save", "line_number": 18, "usage_type": ...
72529053224
from django.shortcuts import render_to_response, render from django.contrib.auth.decorators import login_required from models import Court from notification.models import Notification # Create your views here. @login_required def all(request): ''' To list all the court :param request: :return: ''...
Championzb/TenniSoda
court/views.py
views.py
py
662
python
en
code
0
github-code
36
[ { "api_name": "models.Court.objects.all", "line_number": 16, "usage_type": "call" }, { "api_name": "models.Court.objects", "line_number": 16, "usage_type": "attribute" }, { "api_name": "models.Court", "line_number": 16, "usage_type": "name" }, { "api_name": "notif...
6939711390
from bokeh.plotting import figure, show x = [1, 2, 3, 4, 5] y1 = [6, 7, 2, 4, 5] y2 = [2, 3, 4, 5, 6] y3 = [4, 5, 5, 7, 2] p = figure(title="Multiple bars example") # top defines the single y-coord for each bar; stated more clearly, height # bottom defines y-intercept, i.e. the 0 value where the lowest data pt starts...
marnatgon/Senior-Design
software/example/bokeh/2-custom-render/bar.py
bar.py
py
525
python
en
code
0
github-code
36
[ { "api_name": "bokeh.plotting.figure", "line_number": 7, "usage_type": "call" }, { "api_name": "bokeh.plotting.show", "line_number": 14, "usage_type": "call" } ]
73360095144
# django imports from django.contrib.contenttypes.models import ContentType from django.core.cache import cache from django.db.models.signals import post_save from django.db.models.signals import pre_save from django.db.models.signals import pre_delete # lfs imports from lfs.caching.utils import clear_cache from lfs.c...
django-lfs/lfs
caching/listeners.py
listeners.py
py
7,661
python
en
code
23
github-code
36
[ { "api_name": "lfs.core.signals.cart_changed.connect", "line_number": 30, "usage_type": "call" }, { "api_name": "lfs.core.signals.cart_changed", "line_number": 30, "usage_type": "name" }, { "api_name": "django.db.models.signals.pre_delete.connect", "line_number": 34, "usa...
21158916889
from colorsys import rgb_to_yiq import speedtest s = speedtest.Speedtest() bytes_num = 1000000 dws = round(s.download()/bytes_num, 2) ups = round(s.upload()/bytes_num, 2) print(f' download {dws}') print(f' download {ups}')
jesus-sanchez5/Kali_pruebas
Programas_prueba/python/pruebaVelocidad.py
pruebaVelocidad.py
py
227
python
en
code
0
github-code
36
[ { "api_name": "speedtest.Speedtest", "line_number": 4, "usage_type": "call" } ]
7838997057
from django.conf.urls import url from django.contrib.auth.views import LoginView, LogoutView from .views import * urlpatterns = [ url(r'^login/', LoginView.as_view(template_name='management/login.html'), name='login'), url(r'^logout/', LogoutView.as_view(template_name='management/logout.html', ...
robbydrive/RestaurantsAPI
management/urls.py
urls.py
py
1,143
python
en
code
0
github-code
36
[ { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "django.contrib.auth.views.LoginView.as_view", "line_number": 7, "usage_type": "call" }, { "api_name": "django.contrib.auth.views.LoginView", "line_number": 7, "usage_type": "nam...
74791822182
import os import csv import logging from collections import defaultdict logger = logging.getLogger(__name__) logging.basicConfig( format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO ) # ROOT_PATH = "/Midgard/home/martinig/thesis-src" ROOT_PATH ...
martinigoyanes/LexiconGST
src/postprocessing/collect_results.py
collect_results.py
py
5,189
python
en
code
0
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 10, "usage_type": "attribute" }, { "api_name": "collections.def...
11863065064
# Orbit propagator class to encapsulate solve import numpy as np import matplotlib.pyplot as plt ## for newer scipy.integrate # import scipy.integrate as ode ## for older scipy.integrate (in the videos) from scipy.integrate import ode from mpl_toolkits.mplot3d import Axes3D import planetary_data as pd class OrbitPro...
stevespreiz/orbit-solver
src/OrbitPropagator.py
OrbitPropagator.py
py
3,754
python
en
code
0
github-code
36
[ { "api_name": "planetary_data.earth", "line_number": 14, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.array", "...
14147429202
import argparse import re PLATOON_PRESETS= { # scenario 1: 4 AVs with human cars inbetween, some of which are sensing cars used to collect metrics on 'scenario1': 'human#sensor human*5 (human#sensor human*5 av human*5)*4 human#sensor human*5 human#sensor', } def parse_args(): parser = argparse.ArgumentPar...
sarahbhaskaran/cosim
scripts/args.py
args.py
py
2,504
python
en
code
1
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 10, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 36, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 38, "usage_type": "call" } ]
43157704514
#!/usr/bin/python3 #-*- coding:utf-8 -*- import sys import pygame from pygame.locals import * SCREEN_WIDTH, SCREEN_HEIGHT = 480, 700 pygame.init() screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT)) pygame.display.set_caption("Plane Flight") bk_img = pygame.image.load("resources/image/background.png")...
minskeyguo/mylib
python-edu/plane/02-plane.py
02-plane.py
py
1,311
python
en
code
0
github-code
36
[ { "api_name": "pygame.init", "line_number": 12, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 13, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pygame.displa...
71485638184
import json from .lock import f_lock from .config import read_config config = read_config() def update_dict(key=None, target=4, goal=4, flag=1): pwd = config["pwd"] with f_lock(f"{pwd}/bin3D_list.json") as json_file: json_dict = json.load(json_file) if key is None: for key in js...
lorenghoh/bin3D2zarr
src/lib/handler.py
handler.py
py
887
python
en
code
0
github-code
36
[ { "api_name": "config.read_config", "line_number": 7, "usage_type": "call" }, { "api_name": "lock.f_lock", "line_number": 11, "usage_type": "call" }, { "api_name": "json.load", "line_number": 12, "usage_type": "call" }, { "api_name": "json.dumps", "line_number...
16537362389
import json import pickle import math import os import torch import numpy as np from pycocoevalcap.eval import COCOEvalCap from torch import nn from torch.nn.utils.rnn import pack_padded_sequence from torch.utils.data import DataLoader from torchvision.transforms import transforms from build_vocab import Vocabulary ...
b-feldmann/ImcaptionNet
train.py
train.py
py
5,421
python
en
code
1
github-code
36
[ { "api_name": "pickle.load", "line_number": 32, "usage_type": "call" }, { "api_name": "torchvision.transforms.transforms.Compose", "line_number": 35, "usage_type": "call" }, { "api_name": "torchvision.transforms.transforms", "line_number": 35, "usage_type": "name" }, ...
70806732583
from bs4 import BeautifulSoup import requests import time import json import wikipedia import html2text API_URL = "https://{}.fandom.com/api.php" def timeit(fn): def wrapper(*args, **kwargs): av_list = [] for i in range(10): start = time.time() fn(*args, **kwargs) ...
Unic-X/Kala-Bot
commands/Fandom/fandom.py
fandom.py
py
4,901
python
en
code
2
github-code
36
[ { "api_name": "time.time", "line_number": 21, "usage_type": "call" }, { "api_name": "time.time", "line_number": 23, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 40, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number...
34173082997
#!/usr/bin/env python __author__ = 'xinya' from bleu.bleu import Bleu from meteor.meteor import Meteor from rouge.rouge import Rouge from cider.cider import Cider from collections import defaultdict from argparse import ArgumentParser import codecs from pdb import set_trace import sys import numpy as np reload(sys) ...
zpeide/transfer_qg
metric/qgevalcap/eval.py
eval.py
py
3,487
python
en
code
2
github-code
36
[ { "api_name": "sys.setdefaultencoding", "line_number": 17, "usage_type": "call" }, { "api_name": "bleu.bleu.Bleu", "line_number": 26, "usage_type": "call" }, { "api_name": "meteor.meteor.Meteor", "line_number": 27, "usage_type": "call" }, { "api_name": "rouge.roug...
12340279038
# treatment of routes for search from pathlib import Path from flask import Blueprint, \ make_response, \ render_template, \ request, \ session from backend.collect import container_images_cache, \ update_status from backend.config import config from frontend.misc import is_htmx SORTABLE_BY = [...
HenriWahl/gitlab-container-registry-hub
frontend/search.py
search.py
py
6,841
python
en
code
1
github-code
36
[ { "api_name": "flask.Blueprint", "line_number": 22, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 22, "usage_type": "call" }, { "api_name": "flask.request.args.get", "line_number": 35, "usage_type": "call" }, { "api_name": "flask.request.arg...
29142750716
# Assignment Collector/Grader - a Django app for collecting and grading code # Copyright (C) 2010,2011,2012 Anthony Rossi <anro@acm.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free ...
rossica/assignmentcollectorgrader
collector/admin.py
admin.py
py
7,481
python
en
code
0
github-code
36
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 24, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 24, "usage_type": "name" }, { "api_name": "collector.models.CourseForm", "line_number": 25, "usage_type": "name" }, { ...
38033762926
import asyncio import inspect import sys from datetime import datetime, timezone from pathlib import Path from typing import List import pytest from typing_extensions import Annotated, TypedDict from pydantic import BaseModel, Extra, Field, ValidationError, validate_arguments from pydantic.decorator import ValidatedF...
merlinepedra25/PYDANTIC
tests/test_decorator.py
test_decorator.py
py
13,616
python
en
code
1
github-code
36
[ { "api_name": "pytest.mark.skipif", "line_number": 15, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 15, "usage_type": "attribute" }, { "api_name": "sys.version_info", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pydantic.va...
34405116951
import time import re import codecs import io #import urllib2 as ul import requests import xml.etree.ElementTree as ET from konlpy.tag import Kkma from konlpy.utils import pprint import zipfile def LoadDB_2020(src='oro'): dat = [] z = zipfile.ZipFile('../scraped/{}/{}.zip'.format(src,src)) for j in z.filel...
nborggren/BadukNews
src/BadukCorpus.py
BadukCorpus.py
py
4,965
python
en
code
1
github-code
36
[ { "api_name": "zipfile.ZipFile", "line_number": 14, "usage_type": "call" }, { "api_name": "codecs.decode", "line_number": 19, "usage_type": "call" }, { "api_name": "zipfile.ZipFile", "line_number": 28, "usage_type": "call" }, { "api_name": "io.TextIOWrapper", ...
43302752004
import py import sys from rpython.rtyper.lltypesystem import lltype from rpython.rlib import rawstorage from rpython.rlib.rawstorage import alloc_raw_storage, free_raw_storage,\ raw_storage_setitem, raw_storage_getitem, AlignmentError,\ raw_storage_setitem_unaligned, raw_storage_getitem_unaligned from rpython...
mozillazg/pypy
rpython/rlib/test/test_rawstorage.py
test_rawstorage.py
py
3,046
python
en
code
430
github-code
36
[ { "api_name": "rpython.rlib.rawstorage.alloc_raw_storage", "line_number": 13, "usage_type": "call" }, { "api_name": "rpython.rlib.rawstorage.raw_storage_setitem", "line_number": 14, "usage_type": "call" }, { "api_name": "rpython.rlib.rawstorage.raw_storage_getitem", "line_num...
7405420240
import numpy as np import operator import matplotlib.pyplot as plt import os def createDataSet(): group = np.array([[1.0,1.1],[1.0,1.0],[0,0],[0,0.1]]) labels = ['A','A','B','B'] return group, labels def classify0(inX, dataSet, labels, k): #k-近邻算法 dataSetSize = dataSet.shape[0] #shape代表读取矩阵第一维度的长度 ...
GuoBayern/MachineLearning
kNN.py
kNN.py
py
6,576
python
en
code
0
github-code
36
[ { "api_name": "numpy.array", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.tile", "line_number": 11, "usage_type": "call" }, { "api_name": "operator.itemgetter", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_num...
74957408425
#! /usr/bin/env python from __future__ import print_function import os import sys import argparse from subprocess import CalledProcessError from scripting.conda import install_python from scripting.contexts import cd, cdtemp, homebrew_hidden, setenv from scripting.unix import system, which, check_output from scriptin...
csdms/csdms-stack
build-stack.py
build-stack.py
py
7,372
python
en
code
0
github-code
36
[ { "api_name": "scripting.unix.which", "line_number": 24, "usage_type": "call" }, { "api_name": "os.pathsep.join", "line_number": 36, "usage_type": "call" }, { "api_name": "os.pathsep", "line_number": 36, "usage_type": "attribute" }, { "api_name": "os.path.dirname"...
41865321011
import sys import copy import tempfile import os.path import filecmp import shutil import functools from album import Album, ParseError, SaveError TEST_CASE_DIR = "test_cases/DyphalGenerator_Album_save" def create_file(name, dir_name): with open(os.path.join(dir_name, name), "w") as f: pass def create_f...
rdegraaf/dyphal
test/test_DyphalGenerator_Album_save.py
test_DyphalGenerator_Album_save.py
py
7,238
python
en
code
2
github-code
36
[ { "api_name": "os.path.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path", "line_number": 14, "usage_type": "name" }, { "api_name": "os.path.umask", "line...
24788463789
from collections import defaultdict class TrieNode: def __init__(self): self.word = -1 self.children = defaultdict(TrieNode) self.palindrome_word = [] class Trie: def __init__(self): self.root = TrieNode() @staticmethod def is_palindrome(word: str) -> bool: r...
inhyeokJeon/AALGGO
Python/LeetCode/trie/336_palindrome_pair.py
336_palindrome_pair.py
py
2,814
python
en
code
0
github-code
36
[ { "api_name": "collections.defaultdict", "line_number": 7, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 81, "usage_type": "name" } ]
31194615398
import time import requests # Takes in a schedule dictionary and sends instructions at specified times # Exits when mode is changed to manual def send_instructions(schedule): manual = False while not manual: for scheduled_time in schedule.keys(): if int(time.strftime('%H')) == int(schedule...
apangasa/hackumass-blindcontrol
cloudFxns/scheduler.py
scheduler.py
py
1,384
python
en
code
2
github-code
36
[ { "api_name": "time.strftime", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 14, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 18, "usage_type": "call" }, { "api_name": "requests.get", "line_num...
21052645591
import csv import datetime as dt import os import numpy as np from matplotlib import pyplot from pandas import datetime from pandas import read_csv from sklearn.metrics import mean_squared_error from statsmodels.tsa.arima_model import ARIMA from statsmodels.tsa.statespace.sarimax import SARIMAX from prepare_historica...
chaitanyacsss/github_repository_growth_forecast
arima_predictions.py
arima_predictions.py
py
4,334
python
en
code
1
github-code
36
[ { "api_name": "os.path.join", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "csv.writer", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path.exists", "line_numbe...
14566840458
from datetime import date from django.apps import apps from django.db import models from lxml import etree import requests from .product_forms import FORMS class IsbnPool(models.Model): PURPOSE_GENERAL = 'GENERAL' PURPOSE_WL = 'WL' PURPOSE_CHOICES = ( (PURPOSE_WL, 'Wolne Lektury'), (PURPOS...
fnp/redakcja
src/isbn/models.py
models.py
py
6,085
python
en
code
4
github-code
36
[ { "api_name": "django.db.models.Model", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 9, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 17, "usage_type": "call" }, { "api_name": ...
20244314041
#!/usr/bin/env python # Download individual checksum files for Electron zip files from S3, # concatenate them, and upload to GitHub. from __future__ import print_function import argparse import sys from lib.config import s3_config from lib.util import boto_path_dirs sys.path.extend(boto_path_dirs()) from boto.s3.c...
brave/muon
script/merge-electron-checksums.py
merge-electron-checksums.py
py
1,189
python
en
code
970
github-code
36
[ { "api_name": "sys.path.extend", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "lib.util.boto_path_dirs", "line_number": 14, "usage_type": "call" }, { "api_name": "lib.config.s3_c...
6994313010
from lib.cuckoo.common.abstracts import Signature class MemoryAvailable(Signature): name = "antivm_memory_available" description = "Checks amount of memory in system, this can be used to detect virtual machines that have a low amount of memory available" severity = 1 categories = ["anti-vm"] author...
cuckoosandbox/community
modules/signatures/windows/antivm_memory_available.py
antivm_memory_available.py
py
954
python
en
code
312
github-code
36
[ { "api_name": "lib.cuckoo.common.abstracts.Signature", "line_number": 3, "usage_type": "name" } ]
35220926762
import json import requests from bs4 import BeautifulSoup URL = 'https://www.zr.ru/news/' HEADERS = {'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:93.0) Gecko/20100101 Firefox/93.0', 'accept': '*/*'} HOST = 'https://www.zr.ru' # Функция получения данных с сервера def get_html(url, params=None): ...
dimedrolex/parser-news-zr
www-zr-ru.py
www-zr-ru.py
py
2,503
python
ru
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 13, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 19, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 35, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "lin...
17928875089
# -*- coding: utf-8 -*- import datetime from django.utils.decorators import method_decorator from django.conf import settings from django.contrib.auth.decorators import permission_required from django.core.exceptions import ObjectDoesNotExist from django.urls import reverse from django.db.models import Count from dja...
jgesim/kiwitcms
tcms/testplans/views.py
views.py
py
28,207
python
en
code
1
github-code
36
[ { "api_name": "tcms.testplans.forms.NewPlanForm", "line_number": 68, "usage_type": "call" }, { "api_name": "tcms.testplans.models.TestPlan.objects.create", "line_number": 72, "usage_type": "call" }, { "api_name": "tcms.testplans.models.TestPlan.objects", "line_number": 72, ...
2920450419
#coding:utf-8 import urllib import http.cookiejar import json class Qqpush: pushurl='https://wx.scjtqs.com/qq/push/pushMsg' def push(self,qq,token,data): url = self.pushurl+"?token="+token post={} post['qq']=qq post['content']=[{"msgtype":"text","text":data}] postdata=byt...
scjtqs2/fqsign
utils/qqpush.py
qqpush.py
py
861
python
en
code
0
github-code
36
[ { "api_name": "json.dumps", "line_number": 12, "usage_type": "call" }, { "api_name": "urllib.request.Request", "line_number": 17, "usage_type": "call" }, { "api_name": "urllib.request", "line_number": 17, "usage_type": "attribute" }, { "api_name": "http.cookiejar....
15573580960
import argparse import json import os import cv2 import imageio import numpy as np import pims def _get_box(annot_box): x, y, w, h = annot_box["x"], annot_box["y"], annot_box["width"], annot_box["height"] return (int(x), int(y), int(x + w), int(y + h)) def extract_crop_from_image(image, box): x1, y1, x...
EGO4D/episodic-memory
VQ2D/visualizations/visualize_annotations.py
visualize_annotations.py
py
5,766
python
en
code
80
github-code
36
[ { "api_name": "numpy.pad", "line_number": 28, "usage_type": "call" }, { "api_name": "cv2.rectangle", "line_number": 39, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 52, "usage_type": "call" }, { "api_name": "numpy.copy", "line_number": 65...
10895202904
from __future__ import unicode_literals import six def python_2_unicode_compatible(klass): """ A decorator that defines __unicode__ and __str__ methods under Python 2. Under Python 3 it does nothing. To support Python 2 and 3 with a single code base, define a __str__ method returning text and app...
akloster/table-cleaner
table_cleaner/utils.py
utils.py
py
1,509
python
en
code
0
github-code
36
[ { "api_name": "six.PY2", "line_number": 16, "usage_type": "attribute" }, { "api_name": "six.text_type", "line_number": 28, "usage_type": "attribute" }, { "api_name": "six.string_types", "line_number": 30, "usage_type": "attribute" }, { "api_name": "six.PY3", "...
6527845396
from django.shortcuts import render,get_object_or_404 from .models import Post,Category from markdown import markdown from django.views.generic import ListView from comment.forms import CommentForm from django.http import HttpResponse # def index(request): # post_list = Post.objects.all() # return render(requ...
Sunnysunflowers/danjo
blogproject/blog/views.py
views.py
py
1,581
python
en
code
0
github-code
36
[ { "api_name": "django.views.generic.ListView", "line_number": 14, "usage_type": "name" }, { "api_name": "models.Post", "line_number": 15, "usage_type": "name" }, { "api_name": "django.shortcuts.get_object_or_404", "line_number": 21, "usage_type": "call" }, { "api_...
40395330066
import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.preprocessing import StandardScaler # Data preprocessing data = pd.read_csv("data.csv") # Converting Pandas dataframe to numpy array X = data.x.values.reshape(-1, 1) Y = data.y.values.reshape(-1, 1) # Add bias m = X.shape[0] # sampl...
arnakoguzhan/machine-learning
3-polynomial-regression/plr_from_scratch_GD.py
plr_from_scratch_GD.py
py
2,424
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.append", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.append", "line_numbe...
74569463783
import sys, random, string, poplib from PyQt5 import QtCore, uic from PyQt5.QtWidgets import QApplication, QComboBox, \ QPushButton, QLineEdit, QLabel def on_cross_pushbutton_clicked(): if method_combo_box.currentText() == "Corte Simples": offsprings = simple_cut_crossover() son1_label_3.setVi...
gabbarco/IA-Projects-2022
7_crossover_operation/crossover_operation.py
crossover_operation.py
py
4,508
python
en
code
1
github-code
36
[ { "api_name": "random.randint", "line_number": 41, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 42, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 81, "usage_type": "call" }, { "api_name": "PyQt5.QtCore.QCoreApplic...
2654931278
import matplotlib.pyplot as graph from usrfuncs import * from time import * def desmos(FUNC, X_MIN, X_MAX): error = 0 if (len(FUNC) != len(X_MIN)) or (len(FUNC) != len(X_MAX)) or (len(X_MIN) != len(X_MAX)): exit('Недопустимые вводные данные!') for c in range(len(FUNC)): t = time() ...
TIIGR/Python_in_SPbAU
funcs_operation/desmos.py
desmos.py
py
2,541
python
ru
code
0
github-code
36
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 23, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 23, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.title", "line_number": 26, "usage_type": "call" }, { "api_name": "matp...
19839810739
import torch import torch.nn as nn def test_reflectionPad(padding): m = nn.ReflectionPad2d(padding) input = torch.arange(16, dtype=torch.float).reshape(1, 1, 4, 4) out = m(input) return out if __name__ == '__main__': print(test_reflectionPad(1)) x = torch.arange(4, dtype=torch.float).reshape...
AnhVietPham/Deep-Learning
DL-Pytorch/padding/main.py
main.py
py
696
python
en
code
0
github-code
36
[ { "api_name": "torch.nn.ReflectionPad2d", "line_number": 6, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 6, "usage_type": "name" }, { "api_name": "torch.arange", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.float", "line_n...
4004966963
#!/usr/local/bin/python """ File allowing to create all kind of useful files like saving targets's primers pair in bed file or save target object into file for example. """ import dill from config import * def create_fasta_file(targets): """ Creates a fasta file containing all sequences of targets :para...
gloubsi/oncodna_primers_design
code/fileCreation.py
fileCreation.py
py
3,515
python
en
code
0
github-code
36
[ { "api_name": "dill.dump", "line_number": 86, "usage_type": "call" }, { "api_name": "dill.load", "line_number": 100, "usage_type": "call" } ]
10848555614
from datetime import datetime from uuid import UUID import uuid from fastapi import HTTPException from starlette.responses import Response from starlette import status from http import HTTPStatus from ..app import app from ..api.schemas import CreateOrderSchema, GetOrderSchema, GetOrdersSchema, Status ORDERS = [] o...
BlackJack2021/microservice-api
src/ch02/orders/api/api.py
api.py
py
3,040
python
en
code
0
github-code
36
[ { "api_name": "datetime.datetime.utcnow", "line_number": 18, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 18, "usage_type": "name" }, { "api_name": "app.app.get", "line_number": 28, "usage_type": "call" }, { "api_name": "app.app", ...
13898975323
import numpy as np import functools from functools import total_ordering import bisect import matplotlib.pyplot as plt # Ryan Filgas # AI Fall 2022 STATESIZE = 8 MAXFITNESS = 28 # Allow for sorting of individuals @functools.total_ordering class member: def __init__(self, fitness, position): self.fitness,...
rfilgas/ML-AI-CV
AI-Genetic-Algorithm/8-queens.py
8-queens.py
py
5,883
python
en
code
1
github-code
36
[ { "api_name": "functools.total_ordering", "line_number": 14, "usage_type": "attribute" }, { "api_name": "numpy.random.randint", "line_number": 50, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 50, "usage_type": "attribute" }, { "api_name": "...
2185921772
import ping3 from apscheduler.schedulers.asyncio import AsyncIOScheduler from apscheduler.schedulers.base import STATE_RUNNING import myhome.tgbot import myhome.core class Cron: def __init__(self): self.presence = True self.leave_home_count_down = 0 self.leave_home_count_down_max = myhome...
hldh214/myhome
myhome/cron.py
cron.py
py
3,864
python
en
code
0
github-code
36
[ { "api_name": "myhome.tgbot.config", "line_number": 13, "usage_type": "attribute" }, { "api_name": "myhome.tgbot", "line_number": 13, "usage_type": "name" }, { "api_name": "apscheduler.schedulers.asyncio.AsyncIOScheduler", "line_number": 14, "usage_type": "call" }, { ...
5030099218
# Desenvolva uma lógica que leia o peso e a altura de uma pessoa, calcule seu Índice de # Massa Corporal (IMC) e mostre seu status, de acordo com a tabela abaixo: # - IMC abaixo de 18,5: Abaixo do Peso # - Entre 18,5 e 25: Peso Ideal # - 25 até 30: Sobrepeso # - 30 até 40: Obesidade # - Acima de 40: Obesidade Mórbida...
hdtorrad/Estudos-Python3
Só exercícios/ex043-IMC.py
ex043-IMC.py
py
981
python
pt
code
1
github-code
36
[ { "api_name": "datetime.date.today", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 14, "usage_type": "name" } ]
73198221223
import functools import json import sys import traceback from flask import jsonify import sql_graph from backend.bq import BackendBQClient from backend.validation import ValidationError def _convert_bq_obj_to_rf(obj): data_dict = json.loads(obj["object_data"]) converted_obj = { "id": obj["object_id"], "...
google/grizzly
grizzly_data_lineage/backend/utils.py
utils.py
py
2,755
python
en
code
51
github-code
36
[ { "api_name": "json.loads", "line_number": 14, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 48, "usage_type": "call" }, { "api_name": "backend.bq.BackendBQClient", "line_number": 68, "usage_type": "call" }, { "api_name": "sql_graph.GrizzlyLoa...
37068047547
from django.shortcuts import render,HttpResponseRedirect,reverse,redirect from django.contrib.auth import authenticate,login,logout from .forms import login_form,addressform from .models import guestuser # Create your views here. def user_login(request): if request.method=='POST': loginform=login_form(requ...
MohamedHany2002/online-shop
account/views.py
views.py
py
2,121
python
en
code
0
github-code
36
[ { "api_name": "forms.login_form", "line_number": 9, "usage_type": "call" }, { "api_name": "django.contrib.auth.authenticate", "line_number": 13, "usage_type": "call" }, { "api_name": "django.contrib.auth.login", "line_number": 19, "usage_type": "call" }, { "api_na...
1020567975
# ********************************************************************************************************************* # league_of_legends_api.py # import cogs.helper.api.league_of_legends_api as lol_api # *****************************************************************************************************************...
nartgnoh/BeeBot.py
cogs/helper/api/league_of_legends_api.py
league_of_legends_api.py
py
2,024
python
en
code
0
github-code
36
[ { "api_name": "dotenv.load_dotenv", "line_number": 12, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 13, "usage_type": "call" }, { "api_name": "riotwatcher.LolWatcher", "line_number": 14, "usage_type": "call" } ]
17448094011
from lumicube.standard_library import * import opensimplex # Enter the address or hostname of your lumicube cube = None if isRunningOnCube(): # connect locally if running locally cube = LumiCube(); else: # connect to my remote cube if not running locally (eg from my Mac) cube = LumiCube("cube.local")...
paultough/lumicube
lava.py
lava.py
py
1,210
python
en
code
0
github-code
36
[ { "api_name": "opensimplex.random_seed", "line_number": 18, "usage_type": "call" }, { "api_name": "opensimplex.noise4", "line_number": 28, "usage_type": "call" } ]
24711363173
# KLIB - variables # wykys 2021 from pathlib import Path PATH_KLIB = f'{Path.home()}/projects/klib' PATH_KICAD = '/usr/share/kicad-nightly' PATH_KICAD_CONFIG = f'{Path.home()}/.config/kicad/6.99' PATH_KICAD_COMMON = f'{PATH_KICAD_CONFIG}/kicad_common.json' PATH_FP_LIB_TABLE = f'{PATH_KICAD_CONFIG}/fp-lib-table' PATH_...
wykys/klib
scripts/klib_vars.py
klib_vars.py
py
1,892
python
en
code
5
github-code
36
[ { "api_name": "pathlib.Path.home", "line_number": 6, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 6, "usage_type": "name" }, { "api_name": "pathlib.Path.home", "line_number": 8, "usage_type": "call" }, { "api_name": "pathlib.Path", "lin...
22349362845
import tqdm from tensorboardX import SummaryWriter import cv2 import numpy as np import os import torch import torch.optim as optim from torch.utils.data import DataLoader from models.lbs import batch_rodrigues from utils import misc from pytorch3d.io import save_obj from opt_params import OptParams def process_visua...
SamsungLabs/NeuralHaircut
src/multiview_optimization/runner.py
runner.py
py
10,207
python
en
code
453
github-code
36
[ { "api_name": "utils.misc.prepare_visual", "line_number": 19, "usage_type": "call" }, { "api_name": "utils.misc", "line_number": 19, "usage_type": "name" }, { "api_name": "torch.cat", "line_number": 20, "usage_type": "call" }, { "api_name": "torch.cat", "line_...
38191760011
""" GIW 2020-21 Práctica 07 Grupo 05 Autores: XX, YY, ZZ, (Nombres completos de los autores) declaramos que esta solución es fruto exclusivamente de nuestro trabajo personal. No hemos sido ayudados por ninguna otra persona ni hemos obtenido la solución de fuentes externas, y tampoco hemos compartido nuestra solu...
dalevale/GIW2020-21
practica8.py
practica8.py
py
7,670
python
es
code
0
github-code
36
[ { "api_name": "mongoengine.connect", "line_number": 15, "usage_type": "call" }, { "api_name": "mongoengine.Document", "line_number": 22, "usage_type": "name" }, { "api_name": "mongoengine.StringField", "line_number": 23, "usage_type": "call" }, { "api_name": "mong...
42296323474
import threading from typing import ContextManager, Optional from liquidctl.driver.kraken3 import KrakenX3 from liquidctl.driver.hydro_platinum import HydroPlatinum from .sensor import Sensor from .log import LogManager class AIODeviceSensor(Sensor, ContextManager): is_valid: bool device: Optional[any] ...
maclarsson/cfancontrol
cfancontrol/devicesensor.py
devicesensor.py
py
4,944
python
en
code
3
github-code
36
[ { "api_name": "sensor.Sensor", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.ContextManager", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 14, "usage_type": "name" }, { "api_name": "threading.Lock", ...
69844963625
import cv2 from tensorflow.keras.models import load_model from keras_preprocessing import image import numpy as np import cv2 from pygame import mixer import os IMG_SIZE = 250 song_iter = 0 start_flag = False next_flag = True model = load_model('C:/Users/ANUJ/Desktop/gesture-recognition/model/gesture_model.h5') ...
anuj1501/Gesture-music-controller
src_files/tester.py
tester.py
py
2,854
python
en
code
0
github-code
36
[ { "api_name": "tensorflow.keras.models.load_model", "line_number": 18, "usage_type": "call" }, { "api_name": "pygame.mixer.init", "line_number": 24, "usage_type": "call" }, { "api_name": "pygame.mixer", "line_number": 24, "usage_type": "name" }, { "api_name": "os....
74205980903
from . import utils import torch from torch import nn, autograd import torch.nn.functional as F from typing import Union, List, Optional, Tuple from dataclasses import dataclass from warnings import warn from functools import reduce from tqdm import tqdm import numpy as np import svox2.csrc as _C # _C = utils._get_c_e...
ysus33/RGB-D_Plenoxel_Mapping_Tracking
svox2/svox2.py
svox2.py
py
65,491
python
en
code
0
github-code
36
[ { "api_name": "svox2.csrc.RenderOptions", "line_number": 33, "usage_type": "call" }, { "api_name": "svox2.csrc", "line_number": 33, "usage_type": "name" }, { "api_name": "dataclasses.dataclass", "line_number": 16, "usage_type": "name" }, { "api_name": "torch.Tenso...
3266365657
# forms.py from django import forms from .models import Mensaje, Conversacion from django.contrib.auth.models import User class MensajeForm(forms.ModelForm): class Meta: model = Mensaje fields = ('contenido',) class EnviarMensajeForm(forms.Form): contenido = forms.CharField(label="Mensaje", wid...
arielgodoy/EntregafinalPython-Agodoy
chat/forms.py
forms.py
py
863
python
es
code
0
github-code
36
[ { "api_name": "django.forms.ModelForm", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 5, "usage_type": "name" }, { "api_name": "models.Mensaje", "line_number": 7, "usage_type": "name" }, { "api_name": "django.forms.For...
42903865352
import glob import cv2 as cv method = cv.TM_SQDIFF_NORMED # Path / Threshold # Thresholds were set manually, by careful examination of examples template_blue_locks = ([img for img in glob.glob("./templates_heist/blue_lock/*.png")],0.05) template_blue_keys = ([img for img in glob.glob("./templates_heist/blue_key/*...
neuroevolution-ai/ProcgenAutoencoder
data_generation/balance_data.py
balance_data.py
py
3,236
python
en
code
1
github-code
36
[ { "api_name": "cv2.TM_SQDIFF_NORMED", "line_number": 6, "usage_type": "attribute" }, { "api_name": "glob.glob", "line_number": 9, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 10, "usage_type": "call" }, { "api_name": "glob.glob", "line_num...
34651163338
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import os from datetime import datetime from xml.dom.minidom import Document from xml.etree import cElementTree as cET class TagBase: def __init__(self): pass def setTextNode(self, tag, data): if data != ...
carlos-ferras/Sequence-ToolKit
model/handle_rlf.py
handle_rlf.py
py
15,117
python
en
code
2
github-code
36
[ { "api_name": "xml.dom.minidom.Document", "line_number": 28, "usage_type": "call" }, { "api_name": "xml.dom.minidom.Document", "line_number": 36, "usage_type": "call" }, { "api_name": "xml.dom.minidom.Document", "line_number": 111, "usage_type": "call" }, { "api_n...
16823303848
from uuid import uuid4 def randId(): return uuid4().hex def loggedIn(session, LoggedIn): if ('user' in session) and (session['user'] is not None): userLoggedIn = LoggedIn.query.filter_by(rand_id=str(session['user'])).first() if userLoggedIn: return userLoggedIn.username ret...
billz96/Pycourses
helpers.py
helpers.py
py
669
python
en
code
3
github-code
36
[ { "api_name": "uuid.uuid4", "line_number": 4, "usage_type": "call" } ]
31113875208
""" The main script that serves as the entry-point for all kinds of training experiments. """ from __future__ import annotations import logging from functools import partial from typing import TYPE_CHECKING, Any, Callable, Mapping, Optional, Sequence, Tuple, Union, cast import torch from al.core.data.collators impo...
saifullah3396/doc_al
src/al/core/training/waal_trainer.py
waal_trainer.py
py
18,690
python
en
code
0
github-code
36
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 24, "usage_type": "name" }, { "api_name": "logging.basicConfig", "line_number": 34, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 34, "usage_type": "attribute" }, { "api_name": "al.core.tr...
41978072202
import time from flask import Blueprint, jsonify, request import requests import part2.health_check as health_check from dbBrokerManager.config import async_session, engine, BaseBroker from dbBrokerManager.AsyncDAL import DAL import datetime import asyncio server = Blueprint("broker_manager_Read_Only", __name__) brok...
DistributedSystemsGroup-IITKGP/Assignment-2
BrokerManagerReadOnly.py
BrokerManagerReadOnly.py
py
7,333
python
en
code
1
github-code
36
[ { "api_name": "flask.Blueprint", "line_number": 10, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 32, "usage_type": "call" }, { "api_name": "datetime.datetime.utcnow", "line_number": 41, "usage_type": "call" }, { "api_name": "datetime.dateti...
24952050763
from selenium import webdriver import time import json import os from selenium.webdriver.common.by import By import subprocess import difflib import re from urllib.parse import unquote from colorama import * class Voltaire: def __init__(self): options = webdriver.ChromeOptions() opt...
Sshinx/Voltaire-is-Over
Voltaire.py
Voltaire.py
py
3,406
python
en
code
11
github-code
36
[ { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 15, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 15, "usage_type": "name" }, { "api_name": "subprocess.Popen", "line_number": 18, "usage_type": "call" }, { "api_name": "...
40713013689
from datetime import datetime import pytz import requests from config import NO_IMG_URL, TIMEZONE def convert_timezone( time=None, format="%Y-%m-%dT%H:%M:%SZ", ori_timezone=None, desire_timezone=TIMEZONE ): date_time = datetime.strptime(time, "%Y-%m-%dT%H:%M:%SZ") ori_timezone = pytz.timezone(ori_timezo...
timho102003/newsfriend
util.py
util.py
py
689
python
en
code
0
github-code
36
[ { "api_name": "config.TIMEZONE", "line_number": 10, "usage_type": "name" }, { "api_name": "datetime.datetime.strptime", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 12, "usage_type": "name" }, { "api_name": "pytz.tim...
14824615177
from pathlib import Path import csv import random from faker import Faker fake=Faker() p = Path('.') # Find all files in folder fileslist=list(p.glob('**/*.csv')) # Set the folder for the anonymized files outfolder = 'anon' for file in fileslist: randid=random.randint(10000,99999) randid2=random.randint(10...
carluri/pythonscripts
anonymize_csv.py
anonymize_csv.py
py
994
python
en
code
0
github-code
36
[ { "api_name": "faker.Faker", "line_number": 6, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 8, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 17, "usage_type": "call" }, { "api_name": "random.randint", "line_numb...
7640727921
#Before all this run the command pip install --user PyPDF2==1.26.0 #Shift + right click will bring up the powershell/cmd for the folder #Ensure file is in the same folder and has the extension .pdf import PyPDF2 import sys import time from tqdm import tqdm pdfname = input("Enter the name of your file (example: Hello.pd...
anjannair/Automating-With-Python
PDFs/extracttext.py
extracttext.py
py
1,524
python
en
code
1
github-code
36
[ { "api_name": "time.sleep", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 14, "usage_type": "call" }, { "api_name": "PyPDF2.PdfFileReader", "line_number": 16, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number...
26665766366
from metrics import * import numpy as np import pandas as pd from keras.preprocessing.text import Tokenizer from keras.preprocessing.sequence import pad_sequences from keras.utils.vis_utils import plot_model from keras.utils import to_categorical from sklearn.preprocessing import LabelEncoder from sklearn.metrics impor...
hpabst/CS680Project
src/utils.py
utils.py
py
7,487
python
en
code
0
github-code
36
[ { "api_name": "sklearn.metrics.roc_auc_score", "line_number": 27, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 43, "usage_type": "call" }, { "api_name": "pickle.dump", "line_number": 46, "usage_type": "call" }, { "api_name": "json.dumps", ...
40072930878
# 标准库 import io as _io import os as _os import sys as _sys import imp as _imp import codecs as _codecs import traceback as _traceback import pathlib as _pathlib def enhance_init(work_dir=__file__, python_version_require=0, check_module_list=[]): """ :param pythonVersionRequire(int): 最低python所需版本 :param ch...
IceTiki/tikilib
enhance.py
enhance.py
py
4,584
python
en
code
1
github-code
36
[ { "api_name": "sys.version_info", "line_number": 18, "usage_type": "attribute" }, { "api_name": "sys.version", "line_number": 22, "usage_type": "attribute" }, { "api_name": "sys.stdout", "line_number": 29, "usage_type": "attribute" }, { "api_name": "codecs.getwrit...
10178404139
import logging import multiprocessing import random import signal import sys import time import traceback from typing import Callable, Dict, List, Optional from pebble import ProcessPool, sighandler from .client import Client from .util import constants as C from .util import helper from .util.enums import State cl...
ghilesmeddour/faktory_worker_python
src/pyfaktory/consumer.py
consumer.py
py
9,583
python
en
code
11
github-code
36
[ { "api_name": "client.Client", "line_number": 59, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 60, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 62, "usage_type": "name" }, { "api_name": "typing.List", "line_num...
74262373225
import torch from torch.utils.data import (DataLoader, RandomSampler, SequentialSampler, TensorDataset) from tqdm import tqdm from transformers import ElectraForTokenClassification, ElectraConfig, WEIGHTS_NAME, CONFIG_NAME from transformers import ElectraTokenizer import time import pandas...
lindvalllab/MLSym
inference/run_and_predict.py
run_and_predict.py
py
9,557
python
en
code
7
github-code
36
[ { "api_name": "_pickle.load", "line_number": 18, "usage_type": "call" }, { "api_name": "spacy.load", "line_number": 20, "usage_type": "call" }, { "api_name": "transformers.ElectraTokenizer.from_pretrained", "line_number": 24, "usage_type": "call" }, { "api_name": ...
32923615588
import torch import json speakers = torch.load('../models/vits_ca/speakers.pth') print(type(speakers)) conv = [line.strip().split(',') for line in open('speakers_conversion.csv').readlines()] new_speakers = {} for source, target in conv: id = speakers.get(source) if id: new_speakers[target] = source wi...
projecte-aina/tts-api
scripts/change_model.py
change_model.py
py
414
python
en
code
7
github-code
36
[ { "api_name": "torch.load", "line_number": 4, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 13, "usage_type": "call" } ]
30647902648
#!/usr/bin/python3 import matplotlib.pyplot as plt import numpy as np x = np.linspace(-10,10,100) # 创建一个包含-10到10之间100个等距点的数组作为x坐标 y= x ** 2 # 计算y坐标 plt.plot(x, y) # 绘制曲线 plt.xlabel('x') # 设置x轴标签 plt.xlabel('y') # 设置y轴标签 plt.title('y = x^2') # 设置图标题 plt.grid(True) # 显示网格线 plt .show() #显示图形
Hsurpass/ElegantTest
test_python/python3/test_matplot/x_square.py
x_square.py
py
397
python
zh
code
0
github-code
36
[ { "api_name": "numpy.linspace", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 8, "usage_type": "name" }, { "api_name": "matplotlib.pyplo...
26296087809
from PIL import Image import numpy as np import cv2 import pdb import os import time import signal import argparse import json import shutil def split_data(path_, set_): path_ = path_ + "/" file_array = [file for file in os.listdir(path_) if file.endswith('.txt')] file_array = sorted(file_array) ...
IIT-PAVIS/ReId_without_Id
data/split_train_test.py
split_train_test.py
py
1,418
python
en
code
16
github-code
36
[ { "api_name": "os.listdir", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_number": 27, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number...
31474695571
# encoding: utf-8 """ Core """ import json import pytz from typing import Any, Dict from base64 import b64decode from datetime import datetime from google.cloud import datastore from jsonschema import validate from jsonschema.exceptions import ValidationError, SchemaError import config import log def current_dateti...
rogerjestefani/schema-publish
src/core.py
core.py
py
2,605
python
en
code
0
github-code
36
[ { "api_name": "datetime.datetime.now", "line_number": 20, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 20, "usage_type": "name" }, { "api_name": "pytz.timezone", "line_number": 20, "usage_type": "call" }, { "api_name": "jsonschema.vali...
43194853510
import torch from HDGCN import HDGCN from utils import DatasetLoader, accuracy from torch.utils.data import DataLoader from adabelief_pytorch import AdaBelief import torch.nn.functional as F # # Settings. # torch.cuda.set_device(4) learning_rate = 0.001 device = torch.device("cuda" if torch.cuda.is_avail...
MathIsAll/HDGCN-pytorch
main.py
main.py
py
3,791
python
en
code
5
github-code
36
[ { "api_name": "torch.cuda.set_device", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 12, "usage_type": "attribute" }, { "api_name": "torch.device", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.cuda.is_avai...
25809988661
#!/usr/bin/env python3 import multiprocessing import time import os from src.model.load_json import load_json_to_dict from src.model.load_script import load_script_file from src.model.shunt import Shunt from src.tools.engine.code.github.clone import CodeClone from src.tools.log4py.log4py import print_log from src.too...
MongoliaCavalry/BronzeMan
main.py
main.py
py
2,464
python
en
code
0
github-code
36
[ { "api_name": "src.tools.log4py.log4py.print_log", "line_number": 19, "usage_type": "call" }, { "api_name": "os.getpid", "line_number": 19, "usage_type": "call" }, { "api_name": "src.tools.log4py.log4py.LogLevel.INFO", "line_number": 19, "usage_type": "attribute" }, {...
27943726192
import os, sys, statistics as stats tags = [] #Outliner v1.0 #Copyright Richard Gustafsson #Release: Oct 15 2019 def spc(i=1337): if i != 1337: print(i) print("") if os.path.isfile("tags.txt"): with open("tags.txt") as file: tags = [line.strip() for line in file] print("Tags loaded:") for index in range(...
Weeaboo420/pythonCollection
Outliner/outliner.py
outliner.py
py
2,263
python
en
code
0
github-code
36
[ { "api_name": "os.path.isfile", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 29, "usage_type": "call" }, { "api_name": "os.name", "line_number": 32,...
19421956825
# import the libraries from datetime import timedelta # The DAG object; we'll need this to instantiate a DAG from airflow import DAG # Operators; we need this to write tasks! from airflow.operators.bash_operator import BashOperator # This makes scheduling easy from airflow.utils.dates import days_ago #defining DAG argu...
Amarigh/Apache_Airflow_DAG
ETL_Server_Access_Log_Processing.py
ETL_Server_Access_Log_Processing.py
py
1,513
python
en
code
0
github-code
36
[ { "api_name": "airflow.utils.dates.days_ago", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 20, "usage_type": "call" }, { "api_name": "airflow.DAG", "line_number": 24, "usage_type": "call" }, { "api_name": "datetime....
8128511000
#Run old_indexer first! import sys import whoosh.index as index import whoosh.qparser as qparser from whoosh.searching import Searcher correct = 0 queries = 0 #Opens index ix = index.open_dir("oldIndex") #Opens test file with open(sys.argv[1], 'r') as f: while True: #Reads next query/u...
gale2307/Jarvis
old_ir_tester.py
old_ir_tester.py
py
1,596
python
en
code
1
github-code
36
[ { "api_name": "whoosh.index.open_dir", "line_number": 13, "usage_type": "call" }, { "api_name": "whoosh.index", "line_number": 13, "usage_type": "name" }, { "api_name": "sys.argv", "line_number": 16, "usage_type": "attribute" }, { "api_name": "whoosh.qparser.Query...
24011947026
# -------------------------------------------------------- # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- import torch from torch import nn import numpy as np from core.utils import * import torch.nn.functional as F from torch.distributions import N...
liruiw/HCG
core/networks.py
networks.py
py
11,936
python
en
code
13
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 13, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 37, "usage_type": "call" }, { "api_name": "torch.nn", "line_nu...
72743725223
import os import pandas as pd import numpy as np import os from sklearn.preprocessing import MinMaxScaler, StandardScaler from sklearn.pipeline import make_pipeline, Pipeline import platform import sys import sklearn import tensorflow as tf file_path = 'H:/Study/Hackarthon/dacon/shopping/dataset/dataset' ...
KMLEE1989/Study
Dacon/shopping/shopping_1.py
shopping_1.py
py
4,021
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_name": "platform.platform", ...
36236100422
from django.shortcuts import render from django.http import * from django.contrib.auth import authenticate, login, logout from django.urls import reverse from django.contrib.auth.decorators import login_required from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger # Create your views here. # from d...
hrsh-4/blood-bank
bank/views.py
views.py
py
7,332
python
en
code
0
github-code
36
[ { "api_name": "django.shortcuts.render", "line_number": 20, "usage_type": "call" }, { "api_name": "django.core.paginator.Paginator", "line_number": 31, "usage_type": "call" }, { "api_name": "django.core.paginator.PageNotAnInteger", "line_number": 34, "usage_type": "name" ...
38221038133
from itertools import permutations def is_Prime(number): if number == 1 or number == 0: return False for i in range(2, int(number ** 0.5) + 1): if number % i == 0: return False return True def solution(numbers): answer = set() number = list(map(str, numbers)) comb_n...
kh-min7/Programmers
42839(소수 찾기).py
42839(소수 찾기).py
py
597
python
en
code
0
github-code
36
[ { "api_name": "itertools.permutations", "line_number": 17, "usage_type": "call" } ]
25162153371
import json import logging import os import requests import uuid from typing import Dict LOGGER = logging.getLogger(__name__) LOGGER.setLevel(logging.INFO) class TestGCWebhook: def setup(self): self.tenant = os.getenv("TENANT", "rapha") self.stage = os.getenv("STAGE", "x") self.base_u...
NewStore/int-cinori
integrations/adyen_gift_card/tests/integration/test_gc_api.py
test_gc_api.py
py
1,692
python
en
code
0
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.getenv", "line_number": 18, "usage_type": "call" }, { "api_name": "os.getenv", "line_n...
31256076584
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed u...
nerdicbynature/ospurge
ospurge/tests/resources/test_cinder.py
test_cinder.py
py
4,466
python
en
code
1
github-code
36
[ { "api_name": "unittest.TestCase", "line_number": 20, "usage_type": "attribute" }, { "api_name": "ospurge.tests.mock.Mock", "line_number": 22, "usage_type": "call" }, { "api_name": "ospurge.tests.mock", "line_number": 22, "usage_type": "name" }, { "api_name": "ope...
8806894100
import requests ## HTTP GET Request req = requests.get('https://beomi.github.io/beomi.github.io_old/') ## HTML 소스 가져오기 html = req.text ## HTTP Header 가져오기 header = req.headers ## HTTP Status 가져오기 (200: 정상) status = req.status_code ## HTTP가 정상적으로 되었는지 (True/False) is_ok = req.ok print(html) print(header) print(status...
astinaus/python_study
crawler/requests_test.py
requests_test.py
py
386
python
ko
code
1
github-code
36
[ { "api_name": "requests.get", "line_number": 4, "usage_type": "call" } ]
74105448422
#!/usr/bin/env python3 """Convert font to images of letters.""" import sys import os from PIL import Image, ImageFont, ImageDraw LETTER_SIZE = 60 try: font_file = sys.argv[1] output_folder = sys.argv[2] except IndexError: sys.stderr.write("Usage: {} [ttf file] [output folder]\n".format(sys.argv[0])) s...
kirilenkobm/floating_letters
font_to_letters.py
font_to_letters.py
py
1,280
python
en
code
2
github-code
36
[ { "api_name": "sys.argv", "line_number": 10, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sys.stderr.write", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.stderr", "line_n...
70996246505
import json from datetime import datetime, timedelta import openpyxl import requests from django.conf import settings from django.contrib import messages from django.contrib.auth import authenticate, login, logout from django.contrib.auth.decorators import login_required from django.contrib.auth.hashers import make_pa...
fnabiyevuz/crm
main/views.py
views.py
py
58,006
python
en
code
0
github-code
36
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 32, "usage_type": "name" }, { "api_name": "board.models.Lead", "line_number": 34, "usage_type": "name" }, { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 38, "usage_type"...
21160011627
import matplotlib.pyplot as plt import networkx as nx from queue import PriorityQueue import time start_time = time.time() G = nx.Graph() file = open("data.csv",'r') lines = file.readlines() edges = [] for row in range(0,len(lines[0:]),2): header = lines[row] header = header[:len(header)-1].split(',') ...
UsamaA99/Krus-Prim
primsAlgo.py
primsAlgo.py
py
3,164
python
en
code
0
github-code
36
[ { "api_name": "time.time", "line_number": 7, "usage_type": "call" }, { "api_name": "networkx.Graph", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 27, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", ...
3355703340
from modules.base_classes import * import modules.comp_map as cmp def main(): n = int(input()) rectangles = [Rectangle(*(map(int, input().split()))) for _ in range(n)] m = int(input()) points = [Point2D(*map(int, input().split())) for _ in range(m)] x_values, y_values = cmp.fill_zipped_coord(rec...
B-S-B-Rabbit/algorithm_lab2
compression_map.py
compression_map.py
py
521
python
en
code
0
github-code
36
[ { "api_name": "modules.comp_map.fill_zipped_coord", "line_number": 12, "usage_type": "call" }, { "api_name": "modules.comp_map", "line_number": 12, "usage_type": "name" }, { "api_name": "modules.comp_map.fill_matrix", "line_number": 14, "usage_type": "call" }, { "...
35553806288
import tweepy import configparser from datetime import datetime from dateutil import tz from threading import Thread config = configparser.ConfigParser(interpolation=None) config.read('twitterkeys.ini') api_key = config["twitter"]["APIKey"] api_key_secret = config["twitter"]["APIKeySecret"] bearer_token = config["twi...
gatordevin/TradingBot
twitterbot.py
twitterbot.py
py
2,403
python
en
code
1
github-code
36
[ { "api_name": "configparser.ConfigParser", "line_number": 7, "usage_type": "call" }, { "api_name": "tweepy.OAuth1UserHandler", "line_number": 16, "usage_type": "call" }, { "api_name": "tweepy.Client", "line_number": 17, "usage_type": "call" }, { "api_name": "tweep...
31471559038
import itertools import operator import re import dataclasses from dataclasses import dataclass, field from typing import List, Tuple, Iterable, Dict, Optional, Set from robotoff import settings from robotoff.ml.langid import DEFAULT_LANGUAGE_IDENTIFIER, LanguageIdentifier from robotoff.products import ProductDataset...
alexouille123/robotoff
robotoff/ingredients.py
ingredients.py
py
13,629
python
en
code
null
github-code
36
[ { "api_name": "robotoff.utils.get_logger", "line_number": 22, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 27, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 28, "usage_type": "call" }, { "api_name": "re.compile", "lin...
22247301648
import sys import numpy as np import matplotlib.pyplot as plt fname = sys.argv[1] # get filename from argument samples = [] for s in sys.argv[2:len(sys.argv)]: samples.append(s) data = open(fname, "r") # Open file from BMG (export as table) and store in a list file_stored = [] for i in data: file_stored.appen...
Brad0440/BioTools
BMG_Plot.py
BMG_Plot.py
py
2,496
python
en
code
0
github-code
36
[ { "api_name": "sys.argv", "line_number": 5, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 7, "usage_type": "attribute" }, { "api_name": "numpy.average", "line_number": 74, "usage_type": "call" }, { "api_name": "numpy.std", "line_number"...
11565107048
import morse, keras import numpy as np from scipy import signal channels = 1 samples_per_sec = 100 max_seconds = 5 max_samples = max_seconds * samples_per_sec trans_seconds = 5 trans_samples = trans_seconds * samples_per_sec latent_dim = 100 TOKENS = "$^0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ " num_decoder_tokens = len(...
sehugg/cwkeras
cwmodel.py
cwmodel.py
py
10,643
python
en
code
1
github-code
36
[ { "api_name": "keras.layers.Input", "line_number": 21, "usage_type": "call" }, { "api_name": "keras.layers", "line_number": 21, "usage_type": "attribute" }, { "api_name": "keras.layers.Conv1D", "line_number": 25, "usage_type": "call" }, { "api_name": "keras.layers...
25299883898
import pandas as pd import numpy as np from sqlalchemy import create_engine from typing import List engine = create_engine('sqlite:///../data/data.db', echo=False) con = engine.connect() df = pd.read_sql('select * from patient', con=con) con.close() def detect_duplicates(df:pd.DataFrame) -> pd.DataFrame: # remove...
monkeyusage/duplicates
scripts/detect_duplicates.py
detect_duplicates.py
py
1,699
python
en
code
0
github-code
36
[ { "api_name": "sqlalchemy.create_engine", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.read_sql", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 11, "usage_type": "attribute" }, { "api_name": "typing.L...
12279662576
# third party import torch import torch.nn as nn class IMDBDataset: def __init__(self, reviews, targets): """ Argument: reviews: a numpy array targets: a vector array """ self.reviews = reviews self.target = targets def __len__(self): # return l...
seedatnabeel/Data-IQ
src/models/nlp_models.py
nlp_models.py
py
1,958
python
en
code
9
github-code
36
[ { "api_name": "torch.tensor", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.long", "line_number": 22, "usage_type": "attribute" }, { "api_name": "torch.tensor", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.float", "line_num...
7284886713
#!/usr/bin/env python # coding: utf-8 # # Integración con Python # # Esta sección pretende ser un compendio (esperemos que claro y ordenado) de todo el `Python` # que hemos ido usando en el Capítulo 4. # # Esta sección también puede servir como repaso de los conceptos más aplicados que hemos introducido en dicho c...
GCED-CM/JB-Calculo2-UDC
_build/jupyter_execute/capitulos/05/07.Integracion.py
07.Integracion.py
py
5,684
python
es
code
2
github-code
36
[ { "api_name": "sympy.symbols", "line_number": 30, "usage_type": "call" }, { "api_name": "sympy.Lambda", "line_number": 33, "usage_type": "call" }, { "api_name": "sympy.integrate", "line_number": 35, "usage_type": "call" }, { "api_name": "sympy.integrate", "lin...
70222738664
import telebot from telebot import types import sqlite3 bot = telebot.TeleBot('1835870307:AAHlXuytmI_rtPbjNLj3PzBU3oaeGe7yboY') # Получение списка администраторов def get_administrators(): list = [] for i in get_db_connection().execute('SELECT * FROM administrators').fetchall(): list.append(i[1]) ...
bygimen01/SerhiiBot
bot.py
bot.py
py
24,230
python
ru
code
0
github-code
36
[ { "api_name": "telebot.TeleBot", "line_number": 6, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 18, "usage_type": "call" }, { "api_name": "sqlite3.Row", "line_number": 19, "usage_type": "attribute" }, { "api_name": "sqlite3.connect", ...
15500224657
import numpy as np from sklearn import datasets from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler from sklearn.neighbors import KNeighborsClassifier """使用scikit-learn提供的数值归一化""" if __name__ == "__main__": iris = datasets.load_iris() X = iris.data y = iri...
ediltwwj/MachinelLearning
ModelTest/scalerTest.py
scalerTest.py
py
975
python
en
code
0
github-code
36
[ { "api_name": "sklearn.datasets.load_iris", "line_number": 10, "usage_type": "call" }, { "api_name": "sklearn.datasets", "line_number": 10, "usage_type": "name" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 14, "usage_type": "call" }, { ...