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
70879461628
import collections import re from dataclasses import dataclass @dataclass class Claim: claim_id: int x: int y: int width: int height: int _PARSE_REGEX = re.compile(r"#(\d+) @ (\d+),(\d+): (\d+)x(\d+)") @staticmethod def parse(claim: str): match = Claim._PARSE_REGEX.match(clai...
cj81499/advent-of-code
src/aoc_cj/aoc2018/day03.py
day03.py
py
1,294
python
en
code
2
github-code
6
[ { "api_name": "re.compile", "line_number": 14, "usage_type": "call" }, { "api_name": "dataclasses.dataclass", "line_number": 6, "usage_type": "name" }, { "api_name": "collections.defaultdict", "line_number": 24, "usage_type": "call" }, { "api_name": "aocd.data", ...
71560597309
# Garrett O'Hara # REDID: 822936303 # CS 578: Wireless Networks # Dr. Wang import os import sys import json import socket import traceback import threading FORMAT = "utf-8" TERMINATE = False PACKET_SIZE = 1024 SERVER_SOCKET = None DISCONNECT = "!DISCONNECT" def get_connection_data(): data = {} with open('d...
GarrettOHara/NetworkThroughputMeasureTool
Sender.py
Sender.py
py
3,170
python
en
code
1
github-code
6
[ { "api_name": "json.load", "line_number": 24, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 31, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 37, "usage_type": "call" }, { "api_name": "socket.error", "line_...
4313260430
from django.shortcuts import render # Create your views here. from unsers.models import BookInfo from django.views import View from django.http.response import JsonResponse from unsers.serializer import BookInfoSerializer class BookInfoView(View): def post1(self,request): serializer = BookInfoSerializer(d...
woainia2/python
drfdemo/unsers/views.py
views.py
py
1,439
python
en
code
0
github-code
6
[ { "api_name": "django.views.View", "line_number": 9, "usage_type": "name" }, { "api_name": "unsers.serializer.BookInfoSerializer", "line_number": 11, "usage_type": "call" }, { "api_name": "django.http.response.JsonResponse", "line_number": 17, "usage_type": "call" }, ...
25359328155
# -*- coding: utf-8 -*- import scrapy import street_food.tools.somastreatfoodpark_tools as tools from street_food.items import StreetFoodDatTimeItem import street_food.tools.basic_tools as basic_tools from scrapy import Request class SomastreatfoodparkSpider(scrapy.Spider): name = "somastreatfoodpark" allowed...
kirimaks/street-food-scraper
street_food/street_food/spiders/somastreatfoodpark.py
somastreatfoodpark.py
py
3,279
python
en
code
0
github-code
6
[ { "api_name": "scrapy.Spider", "line_number": 9, "usage_type": "attribute" }, { "api_name": "scrapy.Request", "line_number": 22, "usage_type": "call" }, { "api_name": "scrapy.Request", "line_number": 23, "usage_type": "call" }, { "api_name": "scrapy.Spider.__init_...
19272019559
import tool import itertools import random from argparse import ArgumentParser def get_option(): argparser = ArgumentParser() argparser.add_argument("--trr","--trajectory",type=str,help="path of trr") argparser.add_argument("--pdb","--protein",type=str,help="path of pdb") argparser.add_argum...
satoshi-python/Desktop
pdb_for_msm.py
pdb_for_msm.py
py
1,494
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "tool.MD_to_pdb_chain", "line_number": 52, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 52, "usage_type": "call" } ]
2235969872
#!/usr/bin/python3 import os import time import requests import zipfile import shutil import sys import datetime requests.packages.urllib3.disable_warnings() from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(InsecureRequestWarning) class APIPATH: #...
twotigers0608/test_python
jenkins_android/Auto_BAT-bender/auto_img.py
auto_img.py
py
18,082
python
en
code
0
github-code
6
[ { "api_name": "requests.packages.urllib3.disable_warnings", "line_number": 10, "usage_type": "call" }, { "api_name": "requests.packages", "line_number": 10, "usage_type": "attribute" }, { "api_name": "requests.packages.urllib3.disable_warnings", "line_number": 12, "usage_...
1558116814
import pygame import pygame.gfxdraw import random from typing import List import core from core import app, sprite, text import game class DemoState(app.State): def __init__(self, engine: app.Engine): super().__init__(engine) self.scene = game.Scene(engine) self.physics = game.PhysicsS...
cgloeckner/plate
main.py
main.py
py
6,522
python
en
code
0
github-code
6
[ { "api_name": "core.app.State", "line_number": 13, "usage_type": "attribute" }, { "api_name": "core.app", "line_number": 13, "usage_type": "name" }, { "api_name": "core.app.Engine", "line_number": 14, "usage_type": "attribute" }, { "api_name": "core.app", "lin...
37739437220
from django.urls import include, path from catalogos import views from catalogos.views import CategoriaView, CategoriaNew, CategoriaEdit, CategoriaDel,\ SubCategoriaView, SubCategoriaNew, SubCategoriaEdit, SubCategoriaDel, ProductoView,\ ProductoNew, ProductoEdit, ProductoDel, CatalogoView, MovimientosMercancia...
frpk21/pos
catalogos/urls.py
urls.py
py
3,011
python
es
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "catalogos.views.MenuView", "line_number": 9, "usage_type": "attribute" }, { "api_name": "catalogos.views", "line_number": 9, "usage_type": "name" }, { "api_name": "django.ur...
38381739274
from typing import List # https://leetcode-cn.com/problems/permutations/solution/hui-su-suan-fa-by-powcai-2/ class Solution0: def permute(self, nums: List[int]) -> List[List[int]]: res = [] def backtrack(nums, tmp): if not nums: res.append(tmp) return ...
1lch2/PythonExercise
leetcode/back_track/46.py
46.py
py
1,282
python
en
code
1
github-code
6
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 18, "usage_type": "name" } ]
27262013690
def save_tag_to_mat(lines, dim, query, root): feature_dao = FeatureDao() feature_dao.init(root) feature_id = 'tag%d' % dim feature_path = ''.join([feature_dao.featureRoot ,'/', feature_id, '/',query , '/', 'tag%d_tags.mat' % dim]) save_strings_to_mat(lines, 'tags', feature_path) def save_st...
Asperado/iconic
data_collection/database_builder/core/task_gen_top_tags.py
task_gen_top_tags.py
py
10,486
python
en
code
0
github-code
6
[ { "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.exists", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_numbe...
42510569163
from ast import arg from pathlib import Path import shutil, sys from setuptools import setup as _setup, find_packages root = Path(__file__).parent PKG = sys.argv.pop(1).replace("-", "_") PKG_NAME = PKG.replace("_", "-") src = root / "src" / PKG dist = root / "dist" / PKG dist.mkdir(exist_ok=True, parents=True) def...
jose-pr/pypki
setup.py
setup.py
py
2,153
python
en
code
2
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.argv.pop", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 8, "usage_type": "attribute" }, { "api_name": "shutil.rmtree", "line_number...
74056239227
import os import torch import pickle import numpy as np import matplotlib.pyplot as plt def ensure_numpy_array(tensor): if isinstance(tensor, torch.autograd.Variable): tensor = tensor.data if torch.cuda.is_available() and isinstance(tensor, torch.cuda.FloatTensor): tensor = tensor.cpu() if ...
isaachenrion/jets
src/visualizing/utils.py
utils.py
py
2,109
python
en
code
9
github-code
6
[ { "api_name": "torch.autograd", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.cuda.is_available", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.Tens...
35765065988
from torch_geometric.nn import GINConv, global_mean_pool, global_add_pool,GCNConv,SAGEConv from torch import nn from base_model import * from global_model_V2 import * import matplotlib import matplotlib.pyplot as plt import numpy as np import pandas as pd import json import pickle import torch import torch.n...
tianyao-aka/Expresive_K_hop_GNNs
model/PL_Model_TUDataset_V2.py
PL_Model_TUDataset_V2.py
py
4,161
python
en
code
2
github-code
6
[ { "api_name": "pytorch_lightning.LightningModule", "line_number": 23, "usage_type": "attribute" }, { "api_name": "torchmetrics.Accuracy", "line_number": 27, "usage_type": "call" }, { "api_name": "torch.optim.Adam", "line_number": 48, "usage_type": "call" }, { "api...
39607768583
import os import logging from optparse import make_option from django.core.management.base import BaseCommand from django.core.management.base import CommandError from core.batch_loader import BatchLoader, BatchLoaderException from core.management.commands import configure_logging configure_logging('load_batch_...
open-oni/open-oni
core/management/commands/load_batch.py
load_batch.py
py
1,884
python
en
code
43
github-code
6
[ { "api_name": "core.management.commands.configure_logging", "line_number": 12, "usage_type": "call" }, { "api_name": "os.getpid", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name":...
72281479869
from django.db.models import Count, Sum, Q, Case, When, BooleanField from django.db.models.functions import Coalesce from django_filters.rest_framework import DjangoFilterBackend from rest_framework import viewsets, mixins, filters from rest_framework.decorators import action from rest_framework.permissions import IsAu...
duca43/pocket-imdb-server
pocketimdb/movies/views.py
views.py
py
4,894
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.mixins.ListModelMixin", "line_number": 19, "usage_type": "attribute" }, { "api_name": "rest_framework.mixins", "line_number": 19, "usage_type": "name" }, { "api_name": "rest_framework.mixins.RetrieveModelMixin", "line_number": 20, "usage_type...
8702361268
import os, glob import numpy as np import astropy import spaceKLIP import pytest testdatapath = os.getenv('SPACEKLIP_TEST_DATA_PATH') testpath = os.path.dirname(os.path.abspath(__file__)) def test_has_test_data(): assert os.getenv('SPACEKLIP_TEST_DATA_PATH'), "The $SPACEKLIP_TEST_DATA_PATH environment variable...
kammerje/spaceKLIP
spaceKLIP/tests/test_database.py
test_database.py
py
1,625
python
en
code
14
github-code
6
[ { "api_name": "os.getenv", "line_number": 9, "usage_type": "call" }, { "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.abspath", "line_num...
29870052036
#!/usr/bin/env python import gc import sys import cv2 import mmcv import json import time import pickle import warnings import openslide import numpy as np import torch, torchvision from torchvision.ops import nms as torch_nms from pathlib import Path import concurrent.futures from lib.utils import * from lib.nms_WSI i...
Karnsira/CMVDET
inference_det.py
inference_det.py
py
5,829
python
en
code
0
github-code
6
[ { "api_name": "warnings.filterwarnings", "line_number": 22, "usage_type": "call" }, { "api_name": "json.load", "line_number": 25, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.array", "lin...
39227292289
# -*- coding: utf-8 -*- from flask import request, Response import arrow from sqlalchemy.orm.exc import NoResultFound import xml.etree.cElementTree as Etree import hashlib from datetime import datetime from utils import generate_random_key from tables import Artist, Album, Song, BridgeSession, BridgeUser, BridgeSong...
katajakasa/koel-ampache-bridge
src/app.py
app.py
py
6,515
python
en
code
0
github-code
6
[ { "api_name": "tables.BridgeSession.get_one_or_none", "line_number": 21, "usage_type": "call" }, { "api_name": "tables.BridgeSession", "line_number": 21, "usage_type": "name" }, { "api_name": "flask.request.args.get", "line_number": 21, "usage_type": "call" }, { "...
18955621832
# -*- coding: utf-8 -*- """ Created on Sun Apr 24 15:42:41 2022 @author: steve """ import pandas as pd import numpy as np import matplotlib.pyplot as plt us_transfers = pd.read_csv('us_data_transfers.csv', dtype=str) us_transfers['declared_safeguards'] = us_transfers['declared_safeguards'].str.replace(r'[','', rege...
slope23/GDPR
safeguard_analysis.py
safeguard_analysis.py
py
7,289
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 44, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 44, "usage_type": "name" }, { "api_name": "matplotl...
25986474876
import torch from torch import nn, optim from torchvision import transforms from PIL import Image import numpy as np import pandas as pd import torch.utils.data as data from sklearn.model_selection import KFold from torch.nn import functional as F from d2l import torch as d2l #加载数据 train_csv=pd.read_csv('../data/...
weiyuanhong623/Deep-learning
练习/leaves_classify/Myleaves.py
Myleaves.py
py
8,545
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.utils.data.Dataset", "line_number": 31, "usage_type": "attribute" }, { "api_name": "torch.utils.data", "line_number": 31, "usage_type": "name" }, { "api_name": "PIL.Im...
75091659706
""" - Author : Anish Basnet, Ashish Mainali - Email : anishbasnetworld@gmail.com, mainaliashish@outlook.com - Date : Saturday, July 17, 2021 """ import os from collections import Counter import pandas as pd from tweeter_covid19.utils import mkdir, write_pickle_data SETS = 10 def convert_sentences_to_list(string...
c0mmand3r3/twitter_covid19
examples/word_with_frequency_example.py
word_with_frequency_example.py
py
1,236
python
en
code
0
github-code
6
[ { "api_name": "os.path.join", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_number": 2...
36569042360
# -*- coding: utf-8 -*- from odoo import models, fields, api from odoo import exceptions from odoo.exceptions import ValidationError from odoo.tools.safe_eval import safe_eval, test_python_expr import json import datetime import string import requests from lxml import etree import logging _logger = logging...
AMohamed389/airport4
sr/models/sr.py
sr.py
py
7,697
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "odoo.models.Model", "line_number": 15, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 15, "usage_type": "name" }, { "api_name": "odoo.fields.Char...
7642668054
# Credit @KidsCanCode https://www.youtube.com/watch?v=Eltz-XJMxuU&list=PLsk-HSGFjnaH5yghzu7PcOzm9NhsW0Urw&index=2 # Tutorial Followed to create pygame template # This is the starting code for a new game import pygame as pg import random as rdm import sys from GameSettings import * from Agent import * from ResourceTi...
Tariq-C/AI-Village
2D-GameDesign/TileGameTest/TileGameTest.py
TileGameTest.py
py
5,186
python
en
code
0
github-code
6
[ { "api_name": "pygame.init", "line_number": 21, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 22, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 22, "usage_type": "attribute" }, { "api_name": "pygame.displa...
283721199
import cv2 import pytesseract import numpy as np from matplotlib import pyplot as plt from imutils.object_detection import non_max_suppression import glob import time import concurrent.futures import argparse import statistics def measure_staffgauge_len(image_path): img = cv2.imread(image_path) cv2.imsh...
noahcroit/flood-monitor-cctv
staff-gauge-reader/samples/waterlevel-extract-algorithm.py
waterlevel-extract-algorithm.py
py
4,611
python
en
code
0
github-code
6
[ { "api_name": "cv2.imread", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 28,...
73767748987
from __future__ import absolute_import import unittest import warnings import six from groupdocs_conversion_cloud import Configuration, InfoApi, ApiException, GetSupportedConversionTypesRequest from test.test_settings import TestSettings class TestAuthApi(unittest.TestCase): """ViewerApi unit tests""" def ...
groupdocs-conversion-cloud/groupdocs-conversion-cloud-python
test/apis/test_auth_api.py
test_auth_api.py
py
1,671
python
en
code
5
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 11, "usage_type": "attribute" }, { "api_name": "six.PY3", "line_number": 15, "usage_type": "attribute" }, { "api_name": "warnings.simplefilter", "line_number": 16, "usage_type": "call" }, { "api_name": "groupdocs_c...
44852510003
import math import numpy as np import librosa import soundfile as sf import utils as helper import config as CONF from skimage.filters import try_all_threshold, threshold_otsu import debug as debug import matplotlib.pyplot as plt import json import filewriter as file class Chrous: def __init__(self, file,len = Non...
gta191977649/songle
chrous.py
chrous.py
py
12,243
python
en
code
0
github-code
6
[ { "api_name": "librosa.load", "line_number": 20, "usage_type": "call" }, { "api_name": "librosa.feature.chroma_stft", "line_number": 22, "usage_type": "call" }, { "api_name": "librosa.feature", "line_number": 22, "usage_type": "attribute" }, { "api_name": "numpy.l...
2089779059
import unittest import os import sys import re import utils import subprocess TOPDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) check_py = os.path.join(TOPDIR, "check_standards.py") sys.path.insert(0, TOPDIR) try: import check_standards finally: del sys.path[0] class Tests(unittest.Test...
salilab/pmi
tools/dev_tools/test/test_check_standards.py
test_check_standards.py
py
10,634
python
en
code
12
github-code
6
[ { "api_name": "os.path.abspath", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_nu...
26471842221
from django.conf.urls import url from . import views urlpatterns = [ #url(r'^graduates/(\d+)/',views.graduateInfo, name='grad_bilgi'), url(r'^clubs/add-msg/(\d+)/',views.postNewMessage, name='new_m'), url(r'^clubs/add-reply/(\d+)/(\d+)/',views.postNewReply, name='new_r'), url(r'^clubs/(\d+)',views.cl...
BogachanA/Alumni
graduates/urls.py
urls.py
py
441
python
en
code
0
github-code
6
[ { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 10, "usage_type": "call" }, { "api_name": "django.c...
11147939799
import numpy as np import os import tensorflow as tf import keras from keras.applications import InceptionV3 from keras.models import Model from keras.layers import Dense, GlobalAveragePooling2D from keras.preprocessing.image import ImageDataGenerator from keras.optimizers import Adam import json import argparse import...
dylanebert/inception
main.py
main.py
py
6,021
python
en
code
0
github-code
6
[ { "api_name": "keras.layers.GlobalAveragePooling2D", "line_number": 18, "usage_type": "call" }, { "api_name": "keras.layers.Dense", "line_number": 19, "usage_type": "call" }, { "api_name": "keras.layers.Dense", "line_number": 20, "usage_type": "call" }, { "api_nam...
22182941307
from bs4 import BeautifulSoup import requests url = "https://www.doradcasmaku.pl/przepisy-obiad-pora-dnia" base_url = "https://www.doradcasmaku.pl" titles = [] ingredients = [] all_links = [] for x in range(2): print(x) if x == 0: response = requests.get(url) else: response = requests.get(u...
Michal-Pogorzelec/Projects
Python_Projects/recipes_scrapping.py
recipes_scrapping.py
py
1,917
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 14, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 18, "usage_type": "call" }, { "api_name": "requests.get", "line_...
911012990
#!/usr/bin/env python import matplotlib.pyplot as pt, numpy as np with open('scf_results.txt') as f: pt.clf() tally = dict() for line in f: words = line.split() mixing = float(words[0]) temp = words[1] if temp == "inf": temp = 10 niter = int(temp) ...
theochem/horton
tools/convergence_tester/plot.py
plot.py
py
638
python
en
code
83
github-code
6
[ { "api_name": "matplotlib.pyplot.clf", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 7, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 25, "usage_type": "call" }, { "api_name": "matplotl...
43281342984
import json import math with open("iris.json") as f: lines=f.read() #list1 initialized to store each line list1=[] for i in lines.split(" "): list1=list1+[i] print(list1,"\n") print() #To print dictionary objects print("Dictionary objects are : ") for i in list1: ...
AksA1210/pythonrepo
labcycle2_updated/l3.py
l3.py
py
1,933
python
en
code
0
github-code
6
[ { "api_name": "json.load", "line_number": 16, "usage_type": "call" } ]
36916221895
# -*- coding: utf-8 -*- from django.template.loader import get_template from django.template import Context from django.http import HttpResponse from djTest.articles.models import Article, Tag from django.shortcuts import redirect, render_to_response from django.contrib import csrf from django.template.context import R...
AlekseyNechaev/wiki_test_project
views.py
views.py
py
5,938
python
en
code
1
github-code
6
[ { "api_name": "django.template.loader.get_template", "line_number": 12, "usage_type": "call" }, { "api_name": "djTest.articles.models.Article.objects.all", "line_number": 14, "usage_type": "call" }, { "api_name": "djTest.articles.models.Article.objects", "line_number": 14, ...
14892323027
#-*-coding:utf-8-*- #!usr/bin/env python3 import itchat from itchat.content import * import re import os, sqlite3 import datetime def store(received_date=None, title=None, url=None, sharer=None, text=None): #数据库路径 db_file = os.path.join(os.path.dirname(__file__), 'glinks.db') #当数...
vincijy/Easy-wechat-script
群聊分享链接的保存/save_group_sharings.py
save_group_sharings.py
py
2,445
python
en
code
75
github-code
6
[ { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 15, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line...
28750237364
from flask import Flask, request, redirect, url_for, render_template, send_from_directory import pdb, sys import worker app = Flask(__name__, static_url_path='') @app.route('/', methods=['POST', 'GET']) def index(): if request.method == 'POST': headline_to_check = request.form['headline'] body_to_c...
jasirfayas/Deceptive-Article-Detection
main.py
main.py
py
1,171
python
en
code
3
github-code
6
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 8, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 8, "usage_type": "name" }, { "api_name": "flask.request.form",...
41373266692
#!/usr/bin/env python import json from statistics import mean from math import sqrt from graph import calc_diff RESULT_FILENAME = 'networks_simulation_results.json' def parse_json(): with open(f"tmp/{RESULT_FILENAME}") as fh: return json.loads(fh.read()) def calc_enice(results): enice = [ ...
mkapra/graph_measurements_segmentation
evaluate_sim_results.py
evaluate_sim_results.py
py
1,498
python
en
code
0
github-code
6
[ { "api_name": "json.loads", "line_number": 15, "usage_type": "call" }, { "api_name": "statistics.mean", "line_number": 23, "usage_type": "call" }, { "api_name": "statistics.mean", "line_number": 24, "usage_type": "call" }, { "api_name": "graph.calc_diff", "lin...
23195817764
import pandas as pd import matplotlib.pyplot as plt plt.rcParams.update({'font.size': 8}) plt.rcParams["font.family"] = "Times New Roman" MainDatabase = pd.read_excel(r'../Database/LoadableDatabase.xlsx') print(MainDatabase.head()) # base on database we will set iloc # x = MainDatabase.iloc[:, :4].values #independ...
Mehedi-Bin-Hafiz/Lentil-Price-Prediction-by-ML
Graph/BarGraph.py
BarGraph.py
py
3,274
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.pyplot.rcParams.update", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 6, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 6, "usage_type": "name" }, { "...
12009409608
from __future__ import annotations from dataclasses import replace from typing import TYPE_CHECKING, List import napari.layers import numpy as np from brainways.pipeline.brainways_params import BrainwaysParams, TPSTransformParams from brainways.pipeline.brainways_pipeline import PipelineStep from brainways.transforms...
bkntr/napari-brainways
src/napari_brainways/controllers/tps_controller.py
tps_controller.py
py
9,487
python
en
code
6
github-code
6
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 18, "usage_type": "name" }, { "api_name": "napari_brainways.controllers.base.Controller", "line_number": 22, "usage_type": "name" }, { "api_name": "napari_brainways.brainways_ui.BrainwaysUI", "line_number": 23, "usage_t...
23515448940
from collections import deque N,M = map(int,input().split()) graph = [list(map(int,input())) for _ in range(N)] def bfs(x,y): que = deque() que.append((x,y)) dx, dy = [-1,1,0,0], [0,0,1,-1] while que: x,y = que.popleft() for i in range(4): nx = x + dx[i] ny =...
Soohee410/Algorithm-in-Python
book/3. DFS,BFS/5.4. 미로 탈출.py
5.4. 미로 탈출.py
py
571
python
en
code
6
github-code
6
[ { "api_name": "collections.deque", "line_number": 7, "usage_type": "call" } ]
1983938436
import pytest from aiohttp import web from marshmallow import EXCLUDE, INCLUDE, Schema, fields from aiohttp_apispec import ( cookies_schema, docs, headers_schema, json_schema, match_info_schema, querystring_schema, request_schema, response_schema, setup_aiohttp_apispec, validati...
maximdanilchenko/aiohttp-apispec
tests/conftest.py
conftest.py
py
7,658
python
en
code
214
github-code
6
[ { "api_name": "marshmallow.Schema", "line_number": 19, "usage_type": "name" }, { "api_name": "marshmallow.EXCLUDE", "line_number": 21, "usage_type": "name" }, { "api_name": "marshmallow.fields.String", "line_number": 23, "usage_type": "call" }, { "api_name": "mars...
30626038922
from datetime import datetime from datetime import timezone from decimal import Decimal import xml.etree.ElementTree as ET import xml.dom.minidom as md import argparse import json import extract def statement_date_range(statement): ''' Identifies the start and end dates of statement transactions list. ...
henridvf/BEKBtoOFX
ofx.py
ofx.py
py
5,001
python
en
code
0
github-code
6
[ { "api_name": "xml.etree.ElementTree.Element", "line_number": 37, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 37, "usage_type": "name" }, { "api_name": "xml.etree.ElementTree.SubElement", "line_number": 39, "usage_type": "call" }, { ...
2706203437
import unittest,collections import Rhino.Geometry as geom import rhinoscriptsyntax as rs from rhino_unwrapper.meshUtils import mesh from rhino_unwrapper.meshUtils import meshLoad import userCuts import autoCuts reload(userCuts) reload(autoCuts) reload(mesh) reload(meshLoad) def setUpModule(): print("---- cuts --...
jlopezbi/rhinoUnfolder
rhino_unwrapper/cutSelection/test_cut.py
test_cut.py
py
5,006
python
en
code
8
github-code
6
[ { "api_name": "rhino_unwrapper.meshUtils.mesh", "line_number": 12, "usage_type": "argument" }, { "api_name": "rhino_unwrapper.meshUtils.meshLoad", "line_number": 13, "usage_type": "argument" }, { "api_name": "rhinoscriptsyntax.DeleteObjects", "line_number": 23, "usage_typ...
6597455104
#%%############################################################################# # PART 1: Module imports and object definition # ################################################################################ """ Assumes Python >= 3.7 & R == ??, and will require Linux to run properly....
crrcgeorgia/blogcharts
own-assets/en/blog.py
blog.py
py
17,917
python
en
code
0
github-code
6
[ { "api_name": "sklearn.preprocessing.MinMaxScaler", "line_number": 28, "usage_type": "call" }, { "api_name": "rpy2.robjects.r", "line_number": 39, "usage_type": "attribute" }, { "api_name": "rpy2.robjects", "line_number": 39, "usage_type": "name" }, { "api_name": ...
4329005114
from django.urls import path from rest_framework import routers from . import views # Create a DefaultRouter instance router = routers.DefaultRouter() # Register viewsets with the router router.register("journals", views.UserJournalEntriesViewSet, basename="journalentries") router.register("labels", views.UserLabelVi...
makoye224/mindscribe23
journalstore/urls.py
urls.py
py
948
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 6, "usage_type": "call" }, { "api_name": "rest_framework.routers", "line_number": 6, "usage_type": "name" } ]
72824516347
import requests import json from tqdm import tqdm access_token = '...' # Нужно вставить VK токен user_id = input('Введите VK id: ') class VkDownloader: def __init__(self): self.token = access_token def get_photos(self): url = 'https://api.vk.com/method/photos.get' params = { ...
Egor4955/My_course_work
main.py
main.py
py
2,714
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 23, "usage_type": "call" }, { "api_name": "requests.put", "line_number": 49, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 54, "usage_type": "call" }, { "api_name": "requests.post", "line_number"...
75238067706
import os import time import PoGoCLI import LocateIV import ButtonPressing from PIL import Image import threading from flask import Flask, render_template, request # Static information app = Flask(__name__) name_box = 'images/Name_Box.png' ok_button = 'images/Ok_Button.png' okay_button = 'images/Okay_Button.png' men...
DevJCrystal/PoGo-IV-Renamer
main.py
main.py
py
4,449
python
en
code
2
github-code
6
[ { "api_name": "flask.Flask", "line_number": 12, "usage_type": "call" }, { "api_name": "os.name", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.name", "line_number": 22, "usage_type": "attribute" }, { "api_name": "flask.request.args.get", "l...
29793833626
import BasicFunctionsNumPy from typing import List,Callable import Derivative import numpy as np Chain=List[Callable] def chain_deriv_3(chain:Chain,input_range:np.ndarray)->np.ndarray: """ Computes the derivative of 3 layer compsition functions """ assert len(chain)==3,\ "Provide thr...
Niramin/DeepLearning
ChainDerivative3.py
ChainDerivative3.py
py
987
python
en
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" }, { "api_name": "typing.Callable", "line_number": 5, "usage_type": "name" }, { "api_name": "numpy.ndarray", "line_number": 7, "usage_type": "attribute" }, { "api_name": "Derivative.deriv", "l...
37430052248
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' name: 垚捷电商平台通用struts命令执行 referer: http://www.wooyun.org/bugs/wooyun-2015-0105820 author: Lucifer description: 上海垚捷公司的钢材电商平台存在通用性struts漏洞,google:"ecp/announcement/announcement_view2.action"。 ''' import sys import requests class yaojie_steel_struts_exec_BaseVerify: ...
iceyhexman/onlinetools
scanner/plugins/cms/others/yaojie_steel_struts_exec.py
yaojie_steel_struts_exec.py
py
2,002
python
en
code
1,626
github-code
6
[ { "api_name": "requests.get", "line_number": 25, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 43, "usage_type": "attribute" } ]
11415113286
import pytest from qa2nli.converters.bart.predictor import BartConverter from pathlib import Path import logging logger = logging.getLogger(__name__) bart_model_path = Path(__file__).parent.parent.parent / \ '.models/bart_test/epoch=1.ckpt' @pytest.fixture def sample1(): inputs = ([ "What was his nam...
nli-for-qa/conversion
qa2nli/tests/test_bart_converter.py
test_bart_converter.py
py
1,082
python
en
code
1
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 5, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 7, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 11, "usage_type": "attribute" }, { "api_name": "logging.INFO", "...
22221152711
import matplotlib.pyplot as plt import matplotlib.patches as patches # Constants EARTH_RADIUS = 1 NUMBER_OF_EARTHS = int(2**255 / 7.5e18) # Using the previous estimation of 7.5e18 grains of sand per Earth EARTHS_PER_ROW = 10 def draw_earth(ax, x, y): """Draw an 'Earth' circle.""" earth_circle = patches.Circl...
flarnrules/flarnchain-newsletter
media/code_vizualizations/sha-256_earths.py
sha-256_earths.py
py
1,050
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.patches.Circle", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.patches", "line_number": 11, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 15, "usage_type": "call" }, { "api_name"...
35981188589
""" Vincente Pericoli UC Davis Read translated binary packet data, originating from my modified packet reader program. The files to read are a hybrid comma-separated form. THIS WILL LIKELY ONLY WORK FOR THE COHESIVE ELEMENT OUTPUTS This is quick and dirty. """ # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
vpericoli/warp3d-readers
warp3d_bpf_readers.py
warp3d_bpf_readers.py
py
7,144
python
en
code
0
github-code
6
[ { "api_name": "subprocess.check_call", "line_number": 56, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 189, "usage_type": "call" }, { "api_name": "numpy.float64", "line_number": 189, "usage_type": "attribute" }, { "api_name": "numpy.float64"...
15813989588
"""Model with the main Orange Widget. This module contains the world bank data widget, used for fetching data from world bank data API. """ import logging import collections from functools import partial import requests from PyQt4 import QtCore from Orange.widgets import widget from Orange.widgets.utils import concu...
zidarsk8/orange3-data-sets
orangecontrib/wbd/owwidget_base.py
owwidget_base.py
py
5,099
python
en
code
2
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "Orange.widgets.widget.OWWidget", "line_number": 20, "usage_type": "attribute" }, { "api_name": "Orange.widgets.widget", "line_number": 20, "usage_type": "name" }, { "api_n...
17335200732
import sys from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.QtCore import * import numpy as np from .plotbox import * from .common import parseSettings, slotError class BuilderBox(QWidget): def __init__(self, parent=None): super(BuilderBox, self).__init__(parent) self.tabLayou...
usnistgov/sesame
sesame/ui/system_tab.py
system_tab.py
py
22,629
python
en
code
16
github-code
6
[ { "api_name": "common.parseSettings", "line_number": 409, "usage_type": "call" }, { "api_name": "common.parseSettings", "line_number": 535, "usage_type": "call" } ]
23856939065
import os.path os.environ['CUDA_LAUNCH_BLOCKING'] = '1' import torch import torch.nn as nn import torch.optim as optim import numpy as np import pandas as pd from d2l import torch as d2l def train_ch13(net, train_iter, test_iter, loss, trainer, num_epochs, scheduler, save_path, devices=d2l.try_all_gpus()): if ...
UnderTurrets/HeightDriven_DoubleAttentions_Net
train/train.py
train.py
py
3,552
python
en
code
1
github-code
6
[ { "api_name": "os.path.environ", "line_number": 3, "usage_type": "attribute" }, { "api_name": "os.path", "line_number": 3, "usage_type": "name" }, { "api_name": "d2l.torch.try_all_gpus", "line_number": 13, "usage_type": "call" }, { "api_name": "d2l.torch", "li...
15155875777
import pyttsx3 import speech_recognition as sr import datetime import calendar import webbrowser import wikipedia import pywhatkit import pyjokes import tkinter as tk from PIL import ImageTk ,Image import tkinter.font as font window=tk.Tk() window.title("Ziva Virtual Assistant") img=ImageTk.PhotoImage(Im...
porkalai35/voice-assistant
sample.py
sample.py
py
3,577
python
en
code
2
github-code
6
[ { "api_name": "tkinter.Tk", "line_number": 13, "usage_type": "call" }, { "api_name": "PIL.ImageTk.PhotoImage", "line_number": 15, "usage_type": "call" }, { "api_name": "PIL.ImageTk", "line_number": 15, "usage_type": "name" }, { "api_name": "PIL.Image.open", "l...
10271804111
import argparse from sys import argv from math_parser_v1 import (pre_validation, parse, validate_parsed_list, process_unary_operations, sort_to_polish, calc) def create_parser()...
dlaevskiy/arhirepo
task_alina_epam/myargparse.py
myargparse.py
py
1,435
python
en
code
1
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 24, "usage_type": "name" }, { "api_name": "math_parser_v1.pre_validation", "line_number": 25, "usage_type": "call" }, { "api_name": "math_p...
30014488834
# Machine Problem 1 # Po, Justin Andre # Valles, Oscar Vian from random import randint, randrange from time import sleep from typing import Optional, List from os import system from math import modf from termcolor import cprint MAX_VAL: int = 30 DEBUG: bool = False DEBUG_DATA: bool = False DEBUG_DISABLE_LOOP: bool = ...
ohhskar-school/cmsc-125
mp1.py
mp1.py
py
11,945
python
en
code
0
github-code
6
[ { "api_name": "typing.Optional", "line_number": 23, "usage_type": "name" }, { "api_name": "random.randint", "line_number": 26, "usage_type": "call" }, { "api_name": "math.modf", "line_number": 88, "usage_type": "call" }, { "api_name": "typing.List", "line_numb...
18430194888
''' Created on 05.05.2017 @author: henrik.pilz ''' from array import array from datetime import datetime from xml.sax import handler import logging from datamodel import Feature from datamodel import FeatureSet from datamodel import Mime from datamodel import Price from datamodel import PriceDetails fr...
HenrikPilz/BMEcatConverter
src/importer/xml/bmecatImportHandler.py
bmecatImportHandler.py
py
29,729
python
en
code
4
github-code
6
[ { "api_name": "xml.sax.handler.ContentHandler", "line_number": 24, "usage_type": "attribute" }, { "api_name": "xml.sax.handler", "line_number": 24, "usage_type": "name" }, { "api_name": "transformer.SeparatorTransformer", "line_number": 139, "usage_type": "call" }, { ...
34179125376
import numpy as np from itertools import product from numpy.core.fromnumeric import shape def in_bounds(rng): return -50 <= rng[0] <= 50 and -50 <= rng[1] <= 50 with open("input") as input_file: instructions = [] for line in input_file: on_off, ranges = line.strip().split(" ") x,y,z = [[in...
mpryor/advent-of-code-2021
day-22/part-1.py
part-1.py
py
1,002
python
en
code
0
github-code
6
[ { "api_name": "numpy.zeros", "line_number": 15, "usage_type": "call" }, { "api_name": "itertools.product", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 27, "usage_type": "call" } ]
35563359071
from flask import Flask, url_for, render_template from flask.ext import restful from random import randint app = Flask(__name__) api = restful.Api(app) names = ['Logan', 'Jennifer', 'Richard', 'Sam', 'Rumel', 'Rob', 'Alison'] class GenerateName(restful.Resource): def get(self): name = names[randint(0,6)]...
rich-digi/logans-rest
logans.py
logans.py
py
543
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.ext.restful.Api", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.ext.restful", "line_number": 6, "usage_type": "name" }, { "api_name": "flask.ext.restful.Re...
41729600231
from tkinter import * from tkinter import ttk from PIL import ImageTk, Image import tkinter as tk img_x = 100 img_y = 100 def makeBoard(): img = (Image.open("h.jpg")) img = img.resize((img_x, img_y), Image.ANTIALIAS) img = ImageTk.PhotoImage(img) for x in range(0, 7): for y in range(0, 7): ...
sashamorecode/chess
main_v1.py
main_v1.py
py
3,784
python
en
code
0
github-code
6
[ { "api_name": "PIL.Image.open", "line_number": 13, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 13, "usage_type": "name" }, { "api_name": "PIL.Image.ANTIALIAS", "line_number": 14, "usage_type": "attribute" }, { "api_name": "PIL.Image", "li...
74142907388
# # 添加到celery服务器所在电脑的项目中 # # 让celery执行发送邮件前初始化django环境 # import os # import django # # 设置环境变量 # os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dailyfresh.settings") # # 初始化django环境 # django.setup() from celery import Celery from django.core.mail import send_mail from django.conf import settings from django.template ...
xmstu/dailyfresh2
dailyfresh/celery_tasks/tasks.py
tasks.py
py
2,820
python
zh
code
0
github-code
6
[ { "api_name": "celery.Celery", "line_number": 18, "usage_type": "call" }, { "api_name": "django.conf.settings.EMAIL_FROM", "line_number": 27, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 27, "usage_type": "name" }, { "api_name"...
22868197283
import Levenshtein import json import requests import speech_recognition as sr #from difflib import SequenceMatcher direction = json.loads(open('Resources/training/all tasks/direction.json').read()) training_batch_size = 200 training_epochs = 500 training_ignore_letters = ['?', ',', '!', '.', '"', ':', ';', '...
TroySigX/smartbot
global_function.py
global_function.py
py
6,287
python
en
code
2
github-code
6
[ { "api_name": "json.loads", "line_number": 7, "usage_type": "call" }, { "api_name": "speech_recognition.Recognizer", "line_number": 12, "usage_type": "call" }, { "api_name": "Levenshtein.ratio", "line_number": 164, "usage_type": "call" }, { "api_name": "requests.g...
1681577056
# -*- coding: utf-8 -*- """ Created on Thu Aug 15 11:11:01 2019 @author: mansi """ import random import pyffx df_2 = pandas.read_csv('C:\\Users\\mansi\\OneDrive\\Documents\\ADM\\enc_data.csv' ) #reading all columns into data frame col= df_2.iloc[:,10] col1 = df_2.iloc[:,1] col2 = df_2.iloc[:,2] col3...
seemanthini-n/Safe-machine-learning-for-patient-data-privacy
PaillierEncryption.py
PaillierEncryption.py
py
2,817
python
en
code
0
github-code
6
[ { "api_name": "pyffx.Integer", "line_number": 26, "usage_type": "call" }, { "api_name": "phe.paillier.generate_paillier_keypair", "line_number": 44, "usage_type": "call" }, { "api_name": "phe.paillier", "line_number": 44, "usage_type": "name" }, { "api_name": "pan...
2523813322
import torch import torch.nn as nn from model import Encoder_PE, Encoder_Unet, Decoder from utils import OutConv from TCE import TC_Early from TCL import TC_Late from THD import HyperDenseNet_TC from TCC import TC_Co from NLE import Non_Local_Early from NLL import Non_Local_Late from NLC import Non_Local_Co from NLH im...
wanpeng16/DpRAN
FusionVariants/Model_V.py
Model_V.py
py
3,343
python
en
code
1
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 15, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 15, "usage_type": "name" }, { "api_name": "model.Encoder_Unet", "line_number": 18, "usage_type": "call" }, { "api_name": "model.Encoder_PE", ...
11728312745
import math from collections import Counter class InvertedIndex: def __init__(self): self.index_terms = {} self.corpus = Counter() def parse_term(self, index_term, document_ID): acc = 1 if document_ID not in self.corpus: self.corpus[document_ID] = 0 if i...
nzabdelke/News-Clustering
data_preparation/inverted_index.py
inverted_index.py
py
1,620
python
en
code
0
github-code
6
[ { "api_name": "collections.Counter", "line_number": 8, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 18, "usage_type": "call" }, { "api_name": "math.log10", "line_number": 36, "usage_type": "call" }, { "api_name": "math.log10", "l...
70159917947
import math import pytest import os import itertools import torch from kaolin.ops.spc import points_to_morton, morton_to_points, points_to_corners, \ coords_to_trilinear, quantize_points class TestPoints: @pytest.fixture(autouse=True) def points(self): return torch.tensor([...
silence394/GraphicsSamples
Nvida Samples/kaolin/tests/python/kaolin/ops/spc/test_points.py
test_points.py
py
2,564
python
en
code
0
github-code
6
[ { "api_name": "torch.tensor", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.int16", "line_number": 19, "usage_type": "attribute" }, { "api_name": "pytest.fixture", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.tensor", "line...
33328757126
from fastapi import APIRouter, Depends from ..utils import engine, get_session from sqlmodel import Session, select from sqlalchemy.exc import NoResultFound from ..models.role import Role from datetime import datetime router = APIRouter(prefix="/api/roles", tags=["role"]) @router.post("/") async def post_role(*, rol...
KaterynaIurieva/timeflow
backend/api/role.py
role.py
py
4,527
python
en
code
null
github-code
6
[ { "api_name": "fastapi.APIRouter", "line_number": 8, "usage_type": "call" }, { "api_name": "models.role.Role", "line_number": 12, "usage_type": "name" }, { "api_name": "sqlmodel.Session", "line_number": 12, "usage_type": "name" }, { "api_name": "fastapi.Depends", ...
39223036706
""" General config variables """ import os from dotenv import load_dotenv, find_dotenv # load environment variables load_dotenv(find_dotenv()) DEVICE_IDENTIFIER = os.getenv("DEVICE_IDENTIFIER") MQTT_BROKER_HOST = os.getenv("MQTT_BROKER_HOST", "mqtt") MQTT_BROKER_HOST_PORT = int(os.getenv("MQTT_BROKER_HOST_PORT", "121...
romulomanzano/edge-ai
voice_orchestrator_app/config.py
config.py
py
657
python
en
code
2
github-code
6
[ { "api_name": "dotenv.load_dotenv", "line_number": 8, "usage_type": "call" }, { "api_name": "dotenv.find_dotenv", "line_number": 8, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 10, "usage_type": "call" }, { "api_name": "os.getenv", "line_n...
31211339771
''' TAREA7 La tarea se trata de maximizar algún variante de la función bidimensional ejemplo,g(x,y), con restricciones −3 ≤ x,y ≤ 3, con la misma técnica del ejemplo unidimensional.Crear una visualización animada de cómo proceden 15 réplicas simultáneas de la búsqueda encima de una gráfica d...
Elitemaster97/Simulacion
Tarea7/Tarea7.py
Tarea7.py
py
2,961
python
en
code
0
github-code
6
[ { "api_name": "random.uniform", "line_number": 32, "usage_type": "call" }, { "api_name": "random.uniform", "line_number": 33, "usage_type": "call" }, { "api_name": "random.uniform", "line_number": 38, "usage_type": "call" }, { "api_name": "random.uniform", "li...
39998768152
import json def read_and_format_financial_data(file_path='./output/billing_history.json'): try: with open(file_path, 'r') as file: billing_history = json.load(file) financial_info = 'Here is your recent financial data:\n' for item in billing_history: payment_date = i...
henryavh/BH23
FrontEnd/streamlit_sources/chat_data_reader.py
chat_data_reader.py
py
804
python
en
code
0
github-code
6
[ { "api_name": "json.load", "line_number": 5, "usage_type": "call" }, { "api_name": "json.JSONDecodeError", "line_number": 17, "usage_type": "attribute" } ]
34389857223
import os import os.path as osp import subprocess as sp import re name_r = re.compile("""run_geant_simulation[.]py (.*)\'""") props_r = re.compile("-(\w) (\S*)") def name_from_cmd(name): flags = name_r.findall(name)[0] props = dict(props_r.findall(flags)) keys = sorted(props.keys()) return '_'.join(['%s=%s' ...
yandexdataschool/crayimage
examples/collect_mc.py
collect_mc.py
py
1,821
python
en
code
5
github-code
6
[ { "api_name": "re.compile", "line_number": 6, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, ...
440709596
import addict from data_io import load_train_features from optimizer import adapt_optimizer from my_logger import print_info, set_global_slience_flag def main(): train_data = load_train_features() print_info("train_data.shape", train_data.shape) print_info("train_data.head", train_data.head()) featur...
kqdmqx/kaggle-Elo-Merchant-Category-Recommendation
optimize_lgbmodel000.py
optimize_lgbmodel000.py
py
1,690
python
en
code
1
github-code
6
[ { "api_name": "data_io.load_train_features", "line_number": 8, "usage_type": "call" }, { "api_name": "my_logger.print_info", "line_number": 9, "usage_type": "call" }, { "api_name": "my_logger.print_info", "line_number": 10, "usage_type": "call" }, { "api_name": "m...
36834868273
""" Created on Apr 5, 2010 @author: Barthelemy Dagenais """ from __future__ import unicode_literals, absolute_import from multiprocessing import Process import subprocess from threading import Thread from traceback import print_exc import unittest from py4j.compat import range from py4j.java_gateway import ( Jav...
deepsense-ai/seahorse
sessionmanager/we-deps-consts/2.0.0/py4j/tests/java_callback_test.py
java_callback_test.py
py
9,828
python
en
code
104
github-code
6
[ { "api_name": "py4j.java_gateway.set_default_callback_accept_timeout", "line_number": 22, "usage_type": "call" }, { "api_name": "subprocess.call", "line_number": 26, "usage_type": "call" }, { "api_name": "py4j.tests.java_gateway_test.PY4J_JAVA_PATH", "line_number": 27, "u...
37763224888
from DataLoader import NominalCIFAR10ImageDataset, NominalMNISTImageDataset, NominalMVTecCapsuleImageDataset from models.AE_CIFAR10 import AE_CIFAR10 from models.AE_CIFAR10_32 import AE_CIFAR10_32 from models.AE_CIFAR10_V4 import AE_CIFAR10_V4 from models.AE_MNIST_32 import AE_MNIST_32 from models.AE_MNIST_V2 import AE...
DennisWeiss/soft-tukey-depth-experiments
train-autoencoder.py
train-autoencoder.py
py
4,008
python
en
code
0
github-code
6
[ { "api_name": "torch.utils.data.cuda.is_available", "line_number": 26, "usage_type": "call" }, { "api_name": "torch.utils.data.cuda", "line_number": 26, "usage_type": "attribute" }, { "api_name": "torch.utils.data", "line_number": 26, "usage_type": "name" }, { "ap...
1245643607
import torch import os import random import json import numpy as np torch.manual_seed(0) random.seed(0) np.random.seed(0) from os.path import join from constants import * from utils import * from data import AIDADataset, AIDADocument from argparse import ArgumentParser # Constants PRETRAINED_MODEL = 'model.pt' CONFI...
GAIA-IE/AIDA-Entity-Coref
aida_coref.py
aida_coref.py
py
9,019
python
en
code
0
github-code
6
[ { "api_name": "torch.manual_seed", "line_number": 7, "usage_type": "call" }, { "api_name": "random.seed", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.random", "line...
70746450748
import matplotlib.pyplot as plt import pandas as pd def run(results_directory, optimizer, objectivefunc, Iterations): plt.ioff() fileResultsData = pd.read_csv(results_directory + "/experiment.csv") for j in range(0, len(objectivefunc)): objective_name = objectivefunc[j] startIteration = ...
7ossam81/EvoloPy
plot_convergence.py
plot_convergence.py
py
1,177
python
en
code
393
github-code
6
[ { "api_name": "matplotlib.pyplot.ioff", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 6, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pypl...
38756106620
import logging import pytest from pytest_server_fixtures import CONFIG from pytest_fixture_config import yield_requires_config from .base2 import TestServerV2 log = logging.getLogger(__name__) def _mongo_server(): """ This does the actual work - there are several versions of this used with different sc...
man-group/pytest-plugins
pytest-server-fixtures/pytest_server_fixtures/mongo.py
mongo.py
py
3,832
python
en
code
526
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "pytest.yield_fixture", "line_number": 24, "usage_type": "call" }, { "api_name": "pytest_fixture_config.yield_requires_config", "line_number": 25, "usage_type": "call" }, { ...
19240285698
import torch from jax import numpy as jnp from experiments.data import load_celeba_dataset from run_celeba import * from experiments.models import get_model, get_apply_fn_test from experiments.train_state import get_train_state from experiments.train import test, get_test_step from jax import jit import numpy as np im...
UCSC-REAL/fair-eval
celeba/wrap_up_result.py
wrap_up_result.py
py
3,404
python
en
code
5
github-code
6
[ { "api_name": "sys.path.append", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "numpy.max", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.testing.assert_array_al...
71580484029
import logging import json from datetime import datetime from database import connection as db_con import pandas as pd from utils.api_fx import APIConverter batch_max_size = 1000 processing_summary_insert = "INSERT processing_summary (start, end, start_msg_no, end_msg_no, processed_successfully) VALUES (%s, %s, %s, %...
gruffalow/sibos-2020
processing/find_cycles.py
find_cycles.py
py
7,575
python
en
code
2
github-code
6
[ { "api_name": "utils.api_fx.APIConverter", "line_number": 15, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 62, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 64, "usage_type": "call" }, { "api_name": "json.dumps", "lin...
41656647500
import numpy as np import pandas as pd import pymongo import time import collections from bson import ObjectId from queue import PriorityQueue client = pymongo.MongoClient("mongodb+srv://KokilaReddy:KokilaReddy@cluster0.5nrpf.mongodb.net/Social_media_data?retryWrites=true&w=majority") db=client['Social_media_data'] use...
Sociolitic/Analytics
Analytics/Trigger.py
Trigger.py
py
5,901
python
en
code
0
github-code
6
[ { "api_name": "pymongo.MongoClient", "line_number": 8, "usage_type": "call" }, { "api_name": "queue.PriorityQueue", "line_number": 49, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 127, "usage_type": "call" }, { "api_name": "collectio...
70268012349
import csv import numpy as np from matplotlib import pyplot as plt import datetime with open("Site_IUT_pas_touche.csv", encoding="utf16") as data: reader = csv.reader(data, delimiter=",") header_row = next(reader) France = 0 Usa = 0 Maroc = 0 Suisse = 0 Autre = 0 fo...
Epynox/python-sae101
Pays du visteur.py
Pays du visteur.py
py
883
python
en
code
0
github-code
6
[ { "api_name": "csv.reader", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.pie", "line_number": 36, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 36, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.a...
43010099412
import cv2 as cv import time cam = cv.VideoCapture(0) cam.set(3, 640) cam.set(4, 480) cnt = 0 t1 = time.time() while True: ret, frame = cam.read() cnt += 1 cv. imshow("live", frame) if cv.waitKey(10) & 0xff == ord("q"): t2 = time.time() break if cnt == 30: t2 = time.time(...
Ata1362/Camera_FPS
FPS.py
FPS.py
py
455
python
en
code
0
github-code
6
[ { "api_name": "cv2.VideoCapture", "line_number": 5, "usage_type": "call" }, { "api_name": "time.time", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_number":...
25435794167
import json import os from typing import List from urllib import parse import here_public_transit_api from here_public_transit_api.rest import ApiException from herepy import PlacesApi from loguru import logger from model.sqlmodel import InterestLocation, Location, Point, RouteSummary class Router: @staticmetho...
DublinHome/cli_scraps
classes/router.py
router.py
py
5,134
python
en
code
0
github-code
6
[ { "api_name": "model.sqlmodel.Point", "line_number": 16, "usage_type": "name" }, { "api_name": "model.sqlmodel.Point", "line_number": 24, "usage_type": "call" }, { "api_name": "model.sqlmodel.Point", "line_number": 20, "usage_type": "name" }, { "api_name": "here_p...
37495171695
import argparse import os, sys import numpy as np sys.path.append('../') from bilm.training import train, load_options_latest_checkpoint, load_vocab from bilm.data import BidirectionalLMDataset def main(args): # load the vocab vocab = load_vocab(args.vocab_file, 50) # define the options batch_size ...
xuezhongfei2008/23_bert
2_ELMo/ELMo_Chin-tf/bin/train_elmo.py
train_elmo.py
py
2,853
python
en
code
1
github-code
6
[ { "api_name": "sys.path.append", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "bilm.training.load_vocab", "line_number": 13, "usage_type": "call" }, { "api_name": "bilm.data.Bidire...
73817283066
import discord from sqlalchemy.ext.asyncio import AsyncSession from metricity import models def insert_thread(thread: discord.Thread, sess: AsyncSession) -> None: """Insert the given thread to the database session.""" sess.add(models.Thread( id=str(thread.id), parent_channel_id=str(thread.par...
python-discord/metricity
metricity/exts/event_listeners/_utils.py
_utils.py
py
1,151
python
en
code
39
github-code
6
[ { "api_name": "discord.Thread", "line_number": 7, "usage_type": "attribute" }, { "api_name": "sqlalchemy.ext.asyncio.AsyncSession", "line_number": 7, "usage_type": "name" }, { "api_name": "metricity.models.Thread", "line_number": 9, "usage_type": "call" }, { "api_...
41629752811
import numpy as np from sklearn.linear_model import LogisticRegression import matplotlib.pyplot as plt import matplotlib as mpl # 绘图地图包 from sklearn.preprocessing import StandardScaler from sklearn.pipeline import Pipeline from sklearn import datasets from sklearn.model_selection import train_test_split def iris_t...
Akira-uestc/machine-learning-note
scikit-learn机器学习分类算法/逻辑回归/logistic-scikitlearn.py
logistic-scikitlearn.py
py
2,396
python
en
code
1
github-code
6
[ { "api_name": "sklearn.datasets.load_iris", "line_number": 19, "usage_type": "call" }, { "api_name": "sklearn.datasets", "line_number": 19, "usage_type": "name" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 22, "usage_type": "call" }, { ...
34768256831
import sys from ckan.lib.base import request from ckan.lib.base import c, g, h from ckan.lib.base import model from ckan.lib.base import render from ckan.lib.base import _ from ckan.lib.navl.validators import not_empty from logging import getLogger import ckan.logic as logic import ckan.lib.dictization.model_dictiz...
SenseTecnic/ckanext-wotkit
ckanext/wotkit/actions.py
actions.py
py
13,367
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 27, "usage_type": "call" }, { "api_name": "ckan.logic.get_or_bust", "line_number": 28, "usage_type": "attribute" }, { "api_name": "ckan.logic", "line_number": 28, "usage_type": "name" }, { "api_name": "ckan.logic.g...
25288782980
import os import sys import time import random import discord from discord.ext import commands from discord.ext import tasks from discord import Member from discord.ext.commands import has_permissions from discord.ext.commands import MissingPermissions from discord.utils import find from discord.utils import get import...
powerthecoder/Corrupt
corrupt.py
corrupt.py
py
3,484
python
en
code
0
github-code
6
[ { "api_name": "json.load", "line_number": 18, "usage_type": "call" }, { "api_name": "discord.ext.commands.AutoShardedBot", "line_number": 34, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 34, "usage_type": "name" }, { "api_name"...
32475300833
from sentence_transformers import SentenceTransformer from get_data import get_qa_pair import time import json import torch # model = SentenceTransformer('moka-ai/m3e-base') device = torch.device('mps') model = SentenceTransformer('/Users/janan/Chinese-medical-dialogue-data/m3e-base') model.to(device) print(device) ...
Jananzzzz/medical_robot
utils/text_embedding.py
text_embedding.py
py
1,621
python
en
code
0
github-code
6
[ { "api_name": "torch.device", "line_number": 9, "usage_type": "call" }, { "api_name": "sentence_transformers.SentenceTransformer", "line_number": 10, "usage_type": "call" }, { "api_name": "get_data.get_qa_pair", "line_number": 20, "usage_type": "call" }, { "api_na...
854213644
from core.modules.vistrails_module import Module, ModuleError from Matrix import * from Array import * import scipy from scipy import io, sparse class ArrayUtilityModule(object): my_namespace = 'scipy|matrix|utilities|Matlab' class MatlabReader(ArrayUtilityModule, Module): """ Read a Matlab .mat file into a ...
VisTrails/VisTrails
contrib/NumSciPy/MatrixUtilities.py
MatrixUtilities.py
py
3,173
python
en
code
100
github-code
6
[ { "api_name": "core.modules.vistrails_module.Module", "line_number": 11, "usage_type": "name" }, { "api_name": "scipy.io.loadmat", "line_number": 26, "usage_type": "call" }, { "api_name": "scipy.io", "line_number": 26, "usage_type": "name" }, { "api_name": "scipy....
71645252027
# -*- coding: utf-8 -*- from __future__ import unicode_literals import string from django.utils.crypto import get_random_string from django.db import models from django.core.exceptions import ObjectDoesNotExist from django.conf import settings from django.urls import reverse from geoposition.fields import GeopositionF...
jekoule/benefits
perks/models.py
models.py
py
6,248
python
en
code
0
github-code
6
[ { "api_name": "sendgrid.SendGridAPIClient", "line_number": 19, "usage_type": "call" }, { "api_name": "django.conf.settings.SENDGRID_API_KEY", "line_number": 19, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 19, "usage_type": "name" },...
70513178429
import pygame from pygame.locals import * import random pygame.init() # Colours WHITE = (255,255,255) BLACK = (0,0,0) ORANGE = (220,100,0) BROWN = (180,80,50) YELLOW = (240,200,20) RED = (200,10,10) BLUE = (10,200,10) GREEN = (10,10,200) GREY = (50,50,50) SKYBLUE = (125,220,240) c...
hackrushT/python-mastermind
index.py
index.py
py
3,731
python
en
code
0
github-code
6
[ { "api_name": "pygame.init", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 35, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 35, "usage_type": "attribute" }, { "api_name": "pygame.display...
75091657786
""" - author: Ashish Mainali - email: ashishmainalee@gmail.com - date: 2021-01-11 """ # Imports import os import snscrape.modules.twitter as sntwitter import pandas as pd if __name__ == '__main__': write_path = os.path.join('data', 'twitter_datasets', 'raw_data', 'covid_tweets_raw.csv') # Creating list to ...
c0mmand3r3/twitter_covid19
examples/twitter_scrapping_example.py
twitter_scrapping_example.py
py
914
python
en
code
0
github-code
6
[ { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "snscrape.modules.twitter.TwitterSearchScraper", "line_number": 21, "usage_type": "call" }, { "api_name"...
41604832645
from django.urls import path # from .views import TweetDataViewSet from . import views app_urls = [ path('tweets/detailed/', views.detailed_tweet, name='detailed_tweet'), path('', views.tweet_list, name='home'), path('search/form/', views.search_tweet, name='search_tweet'), ]
Brian-Kariu/TwitterScraper
app/urls.py
urls.py
py
292
python
en
code
0
github-code
6
[ { "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", "line_number": 10, "usage_type": "call" } ]
25390438012
from .sqlite import KalmanTbl from peewee import * import time import logging from playhouse.shortcuts import model_to_dict import pandas as pd import numpy as np class Kalman(): def kalman_update(self, symbol, C, V, e, yhat, m, Q, K, P, R, Ve, max_vol): # set initial parameters delta = 0.00000000000001 ...
noqcks/bmex-algo
src/kalman.py
kalman.py
py
3,497
python
en
code
0
github-code
6
[ { "api_name": "numpy.nansum", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.nansum", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.nanprod", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.nanprod", "line_num...
27101875303
import numpy as np from keras.datasets import mnist from keras.utils import np_utils from keras.models import Sequential from keras.layers import Dense, Activation, Convolution2D, Flatten,MaxPooling2D,SimpleRNN,MaxPooling1D from keras.optimizers import Adam import tensorflow as tf import matplotlib.pyplot as plt im...
weiwow123/ML2018_410321114_2
mnist_train.py
mnist_train.py
py
2,888
python
en
code
0
github-code
6
[ { "api_name": "keras.datasets.mnist.load_data", "line_number": 14, "usage_type": "call" }, { "api_name": "keras.datasets.mnist", "line_number": 14, "usage_type": "name" }, { "api_name": "keras.utils.np_utils.to_categorical", "line_number": 18, "usage_type": "call" }, ...
24990580335
from scipy.io import loadmat from sklearn.preprocessing import LabelBinarizer from sklearn.model_selection import train_test_split from keras.layers import Dense, LSTM, TimeDistributed, Bidirectional, Dropout, Input, Masking, MaxPool2D, Embedding, \ Convolution1D, MaxPooling1D from keras.models import Model from ke...
Finallap/WiFi_Sensing_Python
old_training_script/cnn_bilstm.py
cnn_bilstm.py
py
6,876
python
en
code
5
github-code
6
[ { "api_name": "keras.layers.Input", "line_number": 21, "usage_type": "call" }, { "api_name": "keras.layers.Masking", "line_number": 23, "usage_type": "call" }, { "api_name": "keras_trans_mask.RemoveMask", "line_number": 24, "usage_type": "call" }, { "api_name": "k...
38279174893
from datetime import datetime from time import sleep from kucoin.client import Trade from constants import KU_KEY, KU_PASS, KU_SECRET, KU_URL import asyncio def init_client(): return Trade(key=KU_KEY, secret=KU_SECRET, passphrase=KU_PASS, is_sandbox=False, url=KU_URL) async def main(): client = init_client...
kaikoh95/crypto-trading-bot
kucoin_first_trade.py
kucoin_first_trade.py
py
3,343
python
en
code
32
github-code
6
[ { "api_name": "kucoin.client.Trade", "line_number": 10, "usage_type": "call" }, { "api_name": "constants.KU_KEY", "line_number": 10, "usage_type": "name" }, { "api_name": "constants.KU_SECRET", "line_number": 10, "usage_type": "name" }, { "api_name": "constants.KU...
41683515219
import json, os from flask import Flask, request, jsonify, send_file app = Flask(__name__) def parse_fields(filename, item): first_frame_number = int(item['FirstFrameNumber']) if isinstance(item['FirstFrameNumber'], str) else item[ 'FirstFrameNumber'] last_frame_number = int(item['LastFrameNumber']) ...
Sundayimohowo/flask-json-processor
app.py
app.py
py
1,756
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.request.files", "line_number": 23, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 23, "usage_type": "name" }, { "api_name": "flask.jsonify", ...