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
43749210328
# -*- coding: utf-8 -*- # pylint: disable=trailing-whitespace,bad-whitespace,invalid-name # pylint: disable=anomalous-backslash-in-string,bad-continuation # pylint: disable=multiple-statements,redefined-outer-name,global-statement """ FILE: pyThreeD.py DATE: 06 DEC 2023 AUTH: G. E. Deschaines DESC: Three dimensio...
gedeschaines/propNav
pyThreeD.py
pyThreeD.py
py
5,099
python
en
code
0
github-code
97
[ { "api_name": "warnings.simplefilter", "line_number": 26, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 33, "usage_type": "call" }, { "api_name": "draw3D.MainLoop", "line_number": 57, "usage_type": "call" }, { "api_name": "draw3D.doneflag", ...
23558218358
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name='aiopyql', version='PYQLVERSION', packages=setuptools.find_packages(include=['aiopyql'], exclude=['build']), author="Joshua Jamison", author_email="joshjamison1@gmail.com", descri...
codemation/aiopyql
setup.py
setup.py
py
879
python
en
code
34
github-code
97
[ { "api_name": "setuptools.setup", "line_number": 4, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 7, "usage_type": "call" } ]
21082102911
#twitter mentioning network Matrix #goal is to make it up-to-date everytime #this code is run by a user #!/usr/bin/env python # encoding: utf-8 import time from selenium import webdriver #solve scroll problem???? from selenium.webdriver.common.keys import Keys #from selenium.webdriver.support.ui import WebDriverWait #...
aljohaniAbdula/checkMnetions
main.py
main.py
py
1,920
python
en
code
0
github-code
97
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 14, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 14, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 30, "usage_type": "call" }, { "api_name": "selenium.webd...
17624608212
import difflib import itertools from typing import Iterable, Tuple from .parser import Parser class Differ: r''' This class can be used to flexibly compare two pieces of text and return diff information in a variety of formats. Definitions of common terms used: - non-newline whitespace: Tabs an...
james-perretta/superdiff
superdiff/differ.py
differ.py
py
4,121
python
en
code
1
github-code
97
[ { "api_name": "parser.Parser", "line_number": 54, "usage_type": "call" }, { "api_name": "difflib.SequenceMatcher", "line_number": 79, "usage_type": "call" }, { "api_name": "itertools.zip_longest", "line_number": 87, "usage_type": "call" }, { "api_name": "itertools...
25663178331
from django.core.exceptions import ValidationError from django.db import models import jsonfield class Template(models.Model): name = models.CharField(max_length=100, unique=True) data = models.TextField(default="") args = jsonfield.JSONField( blank=True, default={"measurement": "", "field...
Ekateriner/Distributed-informer
admin/cconfigurator/template/models.py
models.py
py
1,060
python
en
code
0
github-code
97
[ { "api_name": "django.db.models.Model", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 6, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 7, "usage_type": "call" }, { "api_name": "...
74117377919
from detectron2.config import LazyCall as L from detectron2.solver import WarmupParamScheduler from fvcore.common.param_scheduler import MultiStepParamScheduler from ..common.data.cod10k_instance_seg import dataloader from ..common.models.diffcis_with_label import model from ..common.train import train from ..common....
tuananh1007/CamoDiffusion
configs/CIS/COD10k.py
COD10k.py
py
1,858
python
en
code
0
github-code
97
[ { "api_name": "common.train.train.max_iter", "line_number": 16, "usage_type": "attribute" }, { "api_name": "common.train.train", "line_number": 16, "usage_type": "name" }, { "api_name": "common.train.train.grad_clip", "line_number": 17, "usage_type": "attribute" }, { ...
41553686205
# coding=utf-8 import random import numpy as np from collections import defaultdict from environment import Agent, Environment from planner import RoutePlanner from simulator import Simulator class LearningAgent(Agent): """ An agent that learns to drive in the smart-cab world *** Q-learning agent pseudo-code...
thomalm/udacity
machine-learning-nanodegree/p4-smartcab/smartcab/agent.py
agent.py
py
6,484
python
en
code
1
github-code
97
[ { "api_name": "environment.Agent", "line_number": 10, "usage_type": "name" }, { "api_name": "planner.RoutePlanner", "line_number": 29, "usage_type": "call" }, { "api_name": "environment.Environment.valid_actions", "line_number": 30, "usage_type": "attribute" }, { ...
33558871674
import requests from bs4 import BeautifulSoup as bs with open('URL_IMPORTANT.txt','r') as f: url = f.read() response = requests.get(url) soup = bs(response.text, "lxml") _soup1 = soup.find('div', 'temp fact__temp fact__temp_size_s') better_soup = (str(_soup1.text) + '°') print('\n Температура сейчас:', better_soup)...
Landore64/Parser
weather.py
weather.py
py
762
python
en
code
0
github-code
97
[ { "api_name": "requests.get", "line_number": 6, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 7, "usage_type": "call" } ]
35749500073
"""DRFsite URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/4.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based...
Alex-Senokosov/Quizes
DRFsite/urls.py
urls.py
py
2,769
python
en
code
1
github-code
97
[ { "api_name": "django.urls.path", "line_number": 26, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 26, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 26, "usage_type": "name" }, { "api_name": "...
16133304572
# Lint as: python3 """Tests for epi_forecast_stat_mech.statistical_models.bic_model.""" from absl.testing import parameterized from epi_forecast_stat_mech.statistical_models import bic_model from epi_forecast_stat_mech.statistical_models import linear_model_test import numpy as np from absl.testing import absltest ...
HopkinsIDD/EpiForecastStatMech
epi_forecast_stat_mech/statistical_models/bic_model_test.py
bic_model_test.py
py
1,500
python
en
code
7
github-code
97
[ { "api_name": "epi_forecast_stat_mech.statistical_models.linear_model_test.LinearModelTest", "line_number": 14, "usage_type": "attribute" }, { "api_name": "epi_forecast_stat_mech.statistical_models.linear_model_test", "line_number": 14, "usage_type": "name" }, { "api_name": "epi_...
40803552771
import copy import sys import os from pathlib import Path from utils import dump_to_file from utils import load_file src_path = sys.argv[1] dest_path = sys.argv[2] module = sys.argv[3] src_name = sys.argv[4] dest_name = sys.argv[5] dest_action_group = dest_name.split('.')[1] def update_actions_group(data, to_be_...
ansible-collections/el_grandiose_module_promoter
regenerate.py
regenerate.py
py
3,798
python
en
code
0
github-code
97
[ { "api_name": "sys.argv", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 12, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 13, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number...
17174323726
from crypt import methods from rest_framework.viewsets import ViewSet from rest_framework.response import Response from rest_framework import status from rest_framework.serializers import ModelSerializer from rest_framework.decorators import action from rareapi.models import RareUser, Subscription class RareUserView(...
nss-day-cohort-52/rare-api-smoky-pythons
rareapi/views/rare_user.py
rare_user.py
py
2,559
python
en
code
0
github-code
97
[ { "api_name": "rest_framework.viewsets.ViewSet", "line_number": 10, "usage_type": "name" }, { "api_name": "rareapi.models.RareUser.objects.all", "line_number": 12, "usage_type": "call" }, { "api_name": "rareapi.models.RareUser.objects", "line_number": 12, "usage_type": "a...
2381596863
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^register$', views.register, name='register'), url(r'^login$', views.login, name='login'), url(r'^process$', views.process, name='process'), url(r'^logout$', views.logout), url(r'^m...
amarinas/DojoAssignments
Python/django/dojo_secrets/apps/dojosecrets/urls.py
urls.py
py
533
python
en
code
0
github-code
97
[ { "api_name": "django.conf.urls.url", "line_number": 5, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.co...
73367821119
import matplotlib.pyplot as plt input_values = [1, 2, 3, 4, 5] # Plot 1 - Cubes cubes = [] for num in input_values: cubes.append(num*num*num) ax1 = plt.subplot(1, 2, 1) ax1.plot(input_values, cubes, marker='*', ls='dashed', lw='2', c='#326C4C') plt.title("Cubed Numbers") plt.xlabel("Input Values") plt.ylabel("V...
tksatc/CIT228
Chapter15/cubes.py
cubes.py
py
782
python
en
code
0
github-code
97
[ { "api_name": "matplotlib.pyplot.subplot", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 11, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.title", "line_number": 13, "usage_type": "call" }, { "api_name": "m...
1180280480
from itertools import combinations from SAT_AI import SAT_AI as MinesweeperAI import numpy as np class Minesweeper(): """ Minesweeper game representation """ def __init__(self, height=8, width=8, mines=8): # Set initial width, height, and number of mines self.height = height ...
alonShevach/Artificial-Intelligence
MineSweeperAI/MinesweeperSolver/PDB_Producer.py
PDB_Producer.py
py
5,305
python
en
code
0
github-code
97
[ { "api_name": "itertools.combinations", "line_number": 83, "usage_type": "call" }, { "api_name": "SAT_AI.SAT_AI", "line_number": 113, "usage_type": "call" }, { "api_name": "numpy.save", "line_number": 158, "usage_type": "call" } ]
28785442502
import time import functools def main(): # Find the sum of all positive integers that cannot be written as the sum of two abundant numbers # NOTE: Only evaluate integers under 20162 # NOTE: every EVEN integer greater than 46 is the sum of two abundant numbers # finds abundantNumbers under 20162 print("F...
dsmdavid/Euler
problem_023_04.py
problem_023_04.py
py
1,886
python
en
code
0
github-code
97
[ { "api_name": "functools.reduce", "line_number": 51, "usage_type": "call" }, { "api_name": "time.time", "line_number": 59, "usage_type": "call" }, { "api_name": "time.time", "line_number": 61, "usage_type": "call" } ]
22883835361
import scrapy import time from datetime import datetime class ShoptimeSpider(scrapy.Spider): name = 'shoptime' download_delay = 2 start_urls = ['https://www.shoptime.com.br/produto/1614132278?pfm_carac=IPhone%2011&pfm_index=4&pfm_page=category&pfm_pos=grid&pfm_type=vit_product_grid#info-section', ...
Guilherme-98/Banco_de_Dados
Projeto - BD/produto/produto/spiders/shoptime.py
shoptime.py
py
13,106
python
pt
code
0
github-code
97
[ { "api_name": "scrapy.Spider", "line_number": 6, "usage_type": "attribute" }, { "api_name": "datetime.datetime.today", "line_number": 29, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 29, "usage_type": "name" }, { "api_name": "time.slee...
31342908805
from PIL import ImageGrab import numpy as np import cv2 from skimage.io import imread from skimage.transform import resize from skimage.util import img_as_ubyte from tensorflow.keras.models import load_model import utils SCREEN_RESOLUTION = (1920, 1080) IMAGE_RESOLUTION = (128, 128) width, height = 128, 128 bbox = ((...
rishitoshsingh/Satellite-Image-Colorizer
main.py
main.py
py
1,920
python
en
code
0
github-code
97
[ { "api_name": "tensorflow.keras.models.load_model", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.ceil", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 24, "usage_type": "call" }, { "api_name": "cv2.vconcat"...
14276564269
import cv2 import numpy as np import random import os class MixUp(object): def __init__(self, mix_img_dir='/data/FaceRecog/tupu_data/mixup_background/', mix_ratio=[0.1, 0.3]): super(MixUp, self).__init__() self.mix_img_fpath = [ os.path.join(mix_img_di...
chaffeechenyefei/mlu_video
FaceRecog/datasets/aug_utils/mixup.py
mixup.py
py
2,009
python
en
code
2
github-code
97
[ { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_numbe...
1429611200
import logging class CalculatorModel: def __init__(self): self.result = 0 def add(self, number): self.result += number def minus(self, number): print(number) a = self.result - number self.result = a def division(self, number): localNumber = Calculator...
Georgij785/OOP_seminars
Lesson_7/Home_task/Task_1/Calc.py
Calc.py
py
2,832
python
en
code
0
github-code
97
[ { "api_name": "logging.basicConfig", "line_number": 39, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 39, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 41, "usage_type": "call" } ]
7129619021
#import datetime from django import forms from django.contrib.admin.widgets import AdminDateWidget, AdminSplitDateTime from django.forms.widgets import CheckboxSelectMultiple, HiddenInput from main.models import Perfil, Lista, Consulta #BIRTH_YEAR_CHOICES = [(i, i) for i in range(1950, 2012)] class PerfilForm(forms.M...
Luis-Antonio-Solache-Hernandez/SDHA
main/forms.py
forms.py
py
928
python
en
code
0
github-code
97
[ { "api_name": "django.forms.ModelForm", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 9, "usage_type": "name" }, { "api_name": "main.models.Perfil", "line_number": 11, "usage_type": "name" }, { "api_name": "django.cont...
16145788856
from abc import ABC, abstractmethod import itertools def add(x, y): return x + y def mul(x, y): return x * y class Expression(ABC): @abstractmethod def evaluate(self): pass class Number(Expression): def __init__(self, value=None): self.value = value def __repr__(self): ...
hash167/adventofcode
2020/day18.py
day18.py
py
2,947
python
en
code
1
github-code
97
[ { "api_name": "abc.ABC", "line_number": 13, "usage_type": "name" }, { "api_name": "abc.abstractmethod", "line_number": 14, "usage_type": "name" }, { "api_name": "itertools.chain", "line_number": 50, "usage_type": "call" }, { "api_name": "itertools.chain", "lin...
11746336902
# SPDX-License-Identifier: GPL-3.0+ from __future__ import unicode_literals from datetime import datetime import estuary.utils.recents from estuary.models.bugzilla import BugzillaBug from estuary.models.distgit import DistGitCommit from estuary.models.errata import Advisory from estuary.models.freshmaker import Fres...
redhat-exd-rebuilds/estuary-api
tests/utils/test_recents.py
test_recents.py
py
2,387
python
en
code
4
github-code
97
[ { "api_name": "estuary.models.bugzilla.BugzillaBug.get_or_create", "line_number": 17, "usage_type": "call" }, { "api_name": "estuary.models.bugzilla.BugzillaBug", "line_number": 17, "usage_type": "name" }, { "api_name": "datetime.datetime", "line_number": 19, "usage_type"...
43869945640
import argparse from huggingface_hub import HfApi def main(args): api = HfApi() api.upload_folder( folder_path=args.folder_path, repo_id=args.repo_id, repo_type=args.repo_type, ignore_patterns=args.ignore_patterns ) if __name__ == '__main__': parser = argparse.Argumen...
romlingroup/flatpack-ai
utilities/convert_model_to_onnx/append_onnx.py
append_onnx.py
py
1,006
python
en
code
2
github-code
97
[ { "api_name": "huggingface_hub.HfApi", "line_number": 6, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 16, "usage_type": "call" } ]
29195164437
import numpy as np import torch def iou(box1, box2, share_center=False): """ Parameters ---------- box1: torch.Tensor Iterable of format [bx, by, bw, bh] where bx and by are the coords of the top left of the bounding box and bw and bh are the width and height box2: same as b...
nickeisenberg/ml_arcs
yolo/utils/iou.py
iou.py
py
1,516
python
en
code
0
github-code
97
[ { "api_name": "torch.sub", "line_number": 27, "usage_type": "call" }, { "api_name": "torch.min", "line_number": 28, "usage_type": "call" }, { "api_name": "torch.max", "line_number": 32, "usage_type": "call" }, { "api_name": "torch.sub", "line_number": 35, ...
40091507120
from django.shortcuts import render, redirect, HttpResponseRedirect from django.http import HttpResponse, request from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.forms import AuthenticationForm from django.contrib.auth import authenticate, login, logout from .forms import SignUpForm from...
ShivPratapRaj/Inventory_Management
account/views.py
views.py
py
1,723
python
en
code
0
github-code
97
[ { "api_name": "django.http.request.method", "line_number": 16, "usage_type": "attribute" }, { "api_name": "django.http.request", "line_number": 16, "usage_type": "name" }, { "api_name": "forms.SignUpForm", "line_number": 17, "usage_type": "call" }, { "api_name": "...
36442874469
#!/broad/software/free/Linux/redhat_5_x86_64/pkgs/python_2.7.1-sqlite3-rtrees/bin/python # cptoigv.py # Given a list of BAMs and loci, make for IGV_plotter # a samples.txt and sample_locus.txt file corresponding # to the cartesian product of all BAMs at all loci. import sys import re import argparse import os parser...
ericminikel/ngs-scripts
cptoigv.py
cptoigv.py
py
1,054
python
en
code
3
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.basename", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" } ]
21247360410
""" File containing functions for preprocessing csv files with textual data. """ import numpy as np import pandas as pd import re from tqdm.notebook import tqdm_notebook from keras.preprocessing import text, sequence from typing import Union, List, Dict from tqdm import tqdm from tqdm.notebook import tqdm_notebook im...
mrbaloglu/reinforcement_learning
NLP_utils/preprocessing.py
preprocessing.py
py
13,130
python
en
code
2
github-code
97
[ { "api_name": "re.sub", "line_number": 25, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 28, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 31, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 38, "u...
11691745960
#!/usr/bin/env python # -*-coding:utf-8-*- # author:sware """ 工具箱: 日志、配置 """ import os import time import logging # log_path 是存放日志的路径 cur_path = os.path.dirname(os.path.abspath(__file__)) log_path = os.path.join(os.path.dirname(cur_path),'logs') # 如果logs文件夹不存在,就自动创建一个 if not os.path.exists(log_path): os.mkdir(log_p...
sumlxt123/wxsm
wxsm/utils.py
utils.py
py
3,226
python
zh
code
1
github-code
97
[ { "api_name": "os.path.dirname", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.join", "line...
71547581438
#!/usr/bin/env python3 import random import numpy as np import torch from spn.experiments.RandomSPNs_layerwise.distributions import RatNormal from spn.experiments.RandomSPNs_layerwise.rat_spn import RatSpn, RatSpnConfig def set_seed(seed: int): """ Set the seed globally for python, numpy and torch. Arg...
braun-steven/docker-nvidia-tutorial
src/run.py
run.py
py
1,947
python
en
code
1
github-code
97
[ { "api_name": "random.seed", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 19, "usage_type": "attribute" }, { "api_name": "torch.manual_seed", ...
74555980477
import pygame #import pygame.camera import picamera import io from pygame.locals import * from . import ui, camera, lamp class MenuGroup(ui.Group): x, y, w, h = (680, 16, 119, 172) text = "Menu" class MenuZoom(ui.Button): x, y, w, h = (684, 32, 110, 48) text = "Zoom" def action(self): ...
calston/picroscope
picroscope/main.py
main.py
py
10,027
python
en
code
1
github-code
97
[ { "api_name": "pygame.display.init", "line_number": 324, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 324, "usage_type": "attribute" }, { "api_name": "pygame.font.init", "line_number": 325, "usage_type": "call" }, { "api_name": "pygame.fo...
38693304296
import json import requests def get_details (site, start_date, end_date): url = 'https://nwis.waterservices.usgs.gov/nwis/iv/?site={site}&startDT={start}&endDT={end}&parameterCD=00060&format=json'.format(site=site, start=start_date, end=end_date) req = requests.get(url) if req.status_code != 200 : ...
jameeters/stream_gages
gage_details.py
gage_details.py
py
2,044
python
en
code
0
github-code
97
[ { "api_name": "requests.get", "line_number": 7, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 13, "usage_type": "call" } ]
7225436820
import sys from io import StringIO import unittest from src.AOJ.ITP1_6_B import resolve class TestClass(unittest.TestCase): def assertIO(self, input, output): stdout, stdin = sys.stdout, sys.stdin sys.stdout, sys.stdin = StringIO(), StringIO(input) resolve() sys.stdout.seek(0) ...
nabetama-training/CompetitionProgrammingPractice
tests/AOJ/test_ITP1_6_B.py
test_ITP1_6_B.py
py
770
python
en
code
0
github-code
97
[ { "api_name": "unittest.TestCase", "line_number": 8, "usage_type": "attribute" }, { "api_name": "sys.stdout", "line_number": 10, "usage_type": "attribute" }, { "api_name": "sys.stdin", "line_number": 10, "usage_type": "attribute" }, { "api_name": "sys.stdout", ...
31137530043
from utils.info import pktInfo from utils.my_enum import interfaceState from utils.record import pktRecord from .gcc_twcc_estimator import GCC BaseDelay = 200 # ms, 假设传播时延 class GccNativeEstimator(object): def __init__(self, initialBwe, maxBwe, minBwe, filterType): self.pktsRecord = pktRecord(BaseDelay) self.p...
RuneAkko/rtcplayground
gcc/main_estimator.py
main_estimator.py
py
2,793
python
en
code
1
github-code
97
[ { "api_name": "utils.record.pktRecord", "line_number": 11, "usage_type": "call" }, { "api_name": "utils.my_enum.interfaceState.INIT", "line_number": 14, "usage_type": "attribute" }, { "api_name": "utils.my_enum.interfaceState", "line_number": 14, "usage_type": "name" },...
71597351359
import json from logging import getLogger from datalad.dochelpers import borrowkwargs from datalad.downloaders.http import HTTPDownloader from datalad.support.exceptions import DownloadError from datalad.utils import auto_repr lgr = getLogger("datalad.downloaders.shub") @auto_repr class SHubDownloader(HTTPDownloade...
datalad/datalad
datalad/downloaders/shub.py
shub.py
py
1,196
python
en
code
464
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "datalad.downloaders.http.HTTPDownloader", "line_number": 13, "usage_type": "name" }, { "api_name": "datalad.dochelpers.borrowkwargs", "line_number": 19, "usage_type": "call" }, ...
9421977755
""" This is a movement utility class that encapsulates movements into an image list and adds some methods for manipulating the movement, such as interval-based image extraction. """ import numpy as np import os import sys import shutil import re from collections import Counter class Image(object): def __init__(se...
LonxunQuantum/PWMLFF
utils/extract_movement.py
extract_movement.py
py
6,728
python
en
code
12
github-code
97
[ { "api_name": "re.findall", "line_number": 43, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 52, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 53, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 54, ...
6635858725
from flask import Flask from flask import render_template from flask import Flask, render_template from flask_socketio import SocketIO from flask_socketio import send, emit from flask_socketio import join_room, leave_room, rooms app = Flask(__name__) app.config['SECRET_KEY'] = 'vnkdjnfjknfl1232#' socketio = SocketIO...
paplessix/mines_strat_gaz_nat
strat_gaz/storage_optimisation/planner/server.py
server.py
py
1,763
python
en
code
2
github-code
97
[ { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "flask_socketio.SocketIO", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 17, "usage_type": "call" }, { "api_name": "flask_socke...
30847405477
#!/usr/bin/env python import rospy from nav_msgs.msg import Odometry from geometry_msgs.msg import Pose, Twist, Transform, TransformStamped, Pose2D from gazebo_msgs.msg import LinkStates from std_msgs.msg import Header import numpy as np from numpy import dot import math import tf from racecar_control.msg import drive...
BU-DEPEND-Lab/F1tenth
F1tenth_BU/racecar_simulator/racecar_control/scripts/lqr_steer_control.py
lqr_steer_control.py
py
5,471
python
en
code
1
github-code
97
[ { "api_name": "numpy.eye", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.eye", "line_number": 21, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 30, "usage_type": "attribute" }, { "api_name": "numpy.dot", "line_number": 41, ...
4756788814
from datetime import datetime DATE_MAP = ('s', 'mns', 'Hrs', 'Days', 'Months', 'Years') def get_time() -> str: dt = datetime(2022, 10, 1, 0, 0, 0) delta = dt - datetime.now() cleaned_delta = str(delta).replace(' days, ', ':') deltas = cleaned_delta.split('.')[0].split(':') x = len(deltas) st...
amoh-godwin/Tutsandbox
launchpage/static/python/countdown.py
countdown.py
py
471
python
en
code
0
github-code
97
[ { "api_name": "datetime.datetime", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 9, "usage_type": "name" } ]
18782427329
from copy import deepcopy import torch from torch.utils.data import DataLoader import torch.nn as nn class EWC: def __init__( self, net: nn.Module, dataloader: DataLoader, device, num_tasks, criterion, permutator): self.permutator = permutator self.net = net self.dataloader = datal...
xanderdavies/elastic_weight_consolidation
ewc.py
ewc.py
py
1,468
python
en
code
0
github-code
97
[ { "api_name": "torch.nn.Module", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.utils.data.DataLoader", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.zeros_li...
38133136009
import numpy as np import matplotlib.pyplot as plt def display_map(map_path): map = np.zeros([7,30,3])+5 with open(map_path) as file: for y, line in enumerate(file.readlines()): for x, c in enumerate(line): if c == 'o': map[y,x] =[0.5,0.5,0.5]#obstacle ...
nickconlon/static_assessment
web_gridworld/admin/analysis.py
analysis.py
py
899
python
en
code
0
github-code
97
[ { "api_name": "numpy.zeros", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.axes", "line_number": 27, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 27, "usage_type": "name" }, { "api_name": "matplotlib.pyplot...
22408595668
#!/usr/bin/env python # --------------------------------------------------------------- # Imports # --------------------------------------------------------------- # General Imports from typeguard import check_argument_types # Utils Imports from .utils import exception_handler # Local pack...
islam-thea/thea-manager-backend
src/backend/server/main/services/user_manager.py
user_manager.py
py
3,449
python
en
code
0
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 23, "usage_type": "call" }, { "api_name": "models.dynamodb.Dynamo", "line_number": 47, "usage_type": "call" }, { "api_name": "typeguard.check_argument_types", "line_number": 69, "usage_type": "call" }, { "api_name"...
72795387840
from concurrent.futures import ThreadPoolExecutor import numpy as np import torch from agent import ActionPredictionNetwork, R2D2Agent, RNDNetwork from batched_layer import BatchedLayer from config import Config from data_type import AgentInputData, DataType, SelectActionOutput from local_buffer import LocalBuffer from...
ej6QrPxsn/deep_reinforcement_learning
learner.py
learner.py
py
14,004
python
en
code
0
github-code
97
[ { "api_name": "config.Config", "line_number": 19, "usage_type": "name" }, { "api_name": "shared_data.SharedActorData", "line_number": 20, "usage_type": "name" }, { "api_name": "agent.RNDNetwork", "line_number": 24, "usage_type": "call" }, { "api_name": "utils.get_...
36006362794
# -*- coding: utf-8 -*- import logging import pickle from api import apis from datetime import datetime from flask import Flask, render_template from my.util import hatena from my.db import datastore from google.appengine.api import memcache app = Flask(__name__) app.register_blueprint(apis) app.config['DEBUG'] = True...
wertrain/hatena-matome-py
main.py
main.py
py
3,632
python
en
code
0
github-code
97
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "api.apis", "line_number": 12, "usage_type": "argument" }, { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_...
23983622994
#!/usr/bin/python3 import serial import signal import sys keepReading = True def signal_handler(sig, frame): global keepReading keepReading = False signal.signal(signal.SIGINT, signal_handler) serialport = serial.Serial('/dev/ttyACM0',9600) min_vals = [0,0,0,0,0,0] max_vals = [0,0,0,0,0,0] print("Reading ...
mvalkama/pla32311exercises
raspberry/imuserial/imureader.py
imureader.py
py
1,064
python
en
code
0
github-code
97
[ { "api_name": "signal.signal", "line_number": 13, "usage_type": "call" }, { "api_name": "signal.SIGINT", "line_number": 13, "usage_type": "attribute" }, { "api_name": "serial.Serial", "line_number": 14, "usage_type": "call" } ]
4204973010
import sys sys.path.append("/home/cloud/projects/bin/nemo-gitannex/") from gi.repository import Nemo, GObject import gitannex_utils as utils import urllib import os.path class GitAnnexMenuProvider(GObject.GObject, Nemo.MenuProvider): def __init__(self): pass def menu_get_cb(self, menu, path_list): ...
tmalch/nemo-gitannex
gitannex/gitannex-menu.py
gitannex-menu.py
py
3,861
python
en
code
0
github-code
97
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "gi.repository.GObject.GObject", "line_number": 10, "usage_type": "attribute" }, { "api_name": "gi.rep...
44815321936
from attrdict import AttrDict from flask import jsonify, request from voluptuous import Schema, REMOVE_EXTRA from blockcerts.const import ISSUER_SCHEMA, TEMPLATE_SCHEMA, RECIPIENT_SCHEMA, JOB_SCHEMA from blockcerts.misc import issue_certificate_batch, get_tx_receipt, verify_cert from flaskapp.config import get_config ...
docknetwork/verifiable-claims-engine
flaskapp/routes.py
routes.py
py
2,041
python
en
code
4
github-code
97
[ { "api_name": "flask.jsonify", "line_number": 13, "usage_type": "call" }, { "api_name": "voluptuous.Schema", "line_number": 17, "usage_type": "call" }, { "api_name": "blockcerts.const.ISSUER_SCHEMA", "line_number": 19, "usage_type": "name" }, { "api_name": "blockc...
37439027162
from django.urls import path, include from rest_framework.routers import DefaultRouter from .views import MusicViewSet, AlbumViewSet, ArtistViewSet, AlbumItemViewSet router = DefaultRouter() router.register('music', MusicViewSet) router.register('album', AlbumViewSet) router.register('albumitem', AlbumItemViewSet) rou...
Savridinov/musicapi
music/urls.py
urls.py
py
412
python
en
code
0
github-code
97
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 5, "usage_type": "call" }, { "api_name": "views.MusicViewSet", "line_number": 6, "usage_type": "argument" }, { "api_name": "views.AlbumViewSet", "line_number": 7, "usage_type": "argument" }, { "a...
33027497093
import collections import functools import logging import sys logging.basicConfig( filename = 'NumberGuessingLog.out', filemode ='w', level = logging.DEBUG, format = '%(asctime)s - %(levelname)s: %(message)s', datefmt = '%Y-%m-%d %I:%M:%S', ) class NumberGuessing: # 2018.P.1 def __init__(...
SestrenExsis/CodeKatas
withgoogle/solvers/NumberGuessing.py
NumberGuessing.py
py
1,949
python
en
code
0
github-code
97
[ { "api_name": "logging.basicConfig", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 10, "usage_type": "attribute" }, { "api_name": "logging.info", "line_number": 17, "usage_type": "call" }, { "api_name": "sys.stdout.flush",...
19417541670
# -*- coding: utf-8 -*- import uuid from datetime import datetime from tempfile import NamedTemporaryFile from time import time from unittest.mock import MagicMock, patch import pxapi import pytest from chaoslib.exceptions import ActivityFailed, InvalidExperiment from chaospixie import ( encode, execute_scrip...
chaostoolkit-incubator/chaostoolkit-pixie
tests/test_init.py
test_init.py
py
4,041
python
en
code
1
github-code
97
[ { "api_name": "pytest.raises", "line_number": 31, "usage_type": "call" }, { "api_name": "chaoslib.exceptions.InvalidExperiment", "line_number": 31, "usage_type": "argument" }, { "api_name": "chaospixie.get_auth", "line_number": 32, "usage_type": "call" }, { "api_n...
599447650
from django.contrib.sessions.backends.db import SessionStore from django.contrib.gis.geos import LineString, Point from django.core.serializers import serialize from anchorwhat.models import Drawing, Questions, Survey, Sessions, PageTime, Pages, Trials, Sets from datetime import datetime, timezone from device_detector ...
LostInZoom/lostinzoom-experiments
anchorwhat/api/sessions.py
sessions.py
py
4,643
python
en
code
1
github-code
97
[ { "api_name": "django.contrib.sessions.backends.db.SessionStore", "line_number": 12, "usage_type": "call" }, { "api_name": "device_detector.DeviceDetector", "line_number": 16, "usage_type": "call" }, { "api_name": "user_agents.parse", "line_number": 17, "usage_type": "cal...
31948984681
from bs4 import BeautifulSoup import requests import logging import os logger = logging.getLogger(__name__) def crawl(alph): for letter in alph: # this can run a long time its helpfull to know which letter its on logger.info(f"processing letter {letter}...") url = "http://www.mso.anu.edu.a...
benjihillard/English-Dictionary-Database
dictionaryScript.py
dictionaryScript.py
py
1,461
python
en
code
56
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 13, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 14, "usage_type": "call" }, { "api_name": "os.environ.get", ...
74764678079
''' This module can change the volume on windows hosts courtesy of linearWinVolume ''' import modules.number_parser import utils.str_tools import os workingDir = os.path.dirname(os.path.realpath(__file__))+os.path.sep vocab = { "raise":['volume',4], "lower":['volume',4], "volume":['volume',9], "to":[...
afornelas/Amber
modules/volume.py
volume.py
py
2,089
python
en
code
0
github-code
97
[ { "api_name": "os.path.dirname", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 9, "usage_type": "call" }, { "api_name": "modules.number_parser.numb...
15487825616
import matplotlib.pyplot as plt import scipy.interpolate as interp import numpy as np import decimal as d d.getcontext().prec = 3 thein = [0.0, 0.04, 0.08, 0.16, 0.50] theout = [0.002, 0.032, 0.063, 0.13, 0.42] thecout = [0.013, 0.010, 0.014, 0.013, 0.0066] thex1out = [-0.65, -0.64, -0.65, -0.62, -0.60] them, theb =...
jhand1993/SN_distributions
host_sims/versions/guts/moneyplot.py
moneyplot.py
py
1,630
python
en
code
0
github-code
97
[ { "api_name": "decimal.getcontext", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.polyfit", "line_number": 13, "usage_type": "call" }, { "api_name": "decimal.Decimal", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plo...
70382674240
# Silly example of date comparison to get age from datetime import date birth_year = int(input("Year of birth: ")) birth_month = int(input("Month of birth: ")) birth_day = int(input("Day of birth: ")) birthday_date = date(birth_year, birth_month, birth_day) age = date.today() - birthday_date result = "You are " + st...
thomazmoura/Samples
Python/simple-operations/calculate-age.py
calculate-age.py
py
376
python
en
code
2
github-code
97
[ { "api_name": "datetime.date", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.date.today", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 9, "usage_type": "name" } ]
4840539232
from imageai.Detection import ObjectDetection import cv2 from object_detector.DetectorAPI import DetectorAPI class ObjectDetector: model_class_labels = ["person", "bicycle", "car", "motorcycle", "airplane", "bus", "train", "truck", "boat", "traffic light", "fire hydrant", "stop sign", ...
shrinivas93/doorman-app
object_detector/ObjectDetector.py
ObjectDetector.py
py
3,299
python
en
code
1
github-code
97
[ { "api_name": "object_detector.DetectorAPI.DetectorAPI", "line_number": 23, "usage_type": "call" }, { "api_name": "imageai.Detection.ObjectDetection", "line_number": 25, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 39, "usage_type": "call" }, { ...
71503982718
import json import sys import threading import kafka import requests threads = [] cookie = "token=code_space;" header = { "cookie": cookie, "Accept": "*/*", "Accept-Encoding": "gzip, deflate, br", "Accept-Language": "zh-CN,zh;q=0.9", "Connection": "keep-alive", "Content-Type": "ap...
Zackiss/Westworld
client.py
client.py
py
3,747
python
en
code
0
github-code
97
[ { "api_name": "threading.Thread", "line_number": 21, "usage_type": "attribute" }, { "api_name": "threading.Thread.__init__", "line_number": 23, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 23, "usage_type": "attribute" }, { "api_name": ...
17582450529
# -*- coding: utf-8 -*- """ Created on Mon Mar 20 13:40:01 2023 @author: oscar """ import os import sys import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import flopy from flopy.utils.triangle import Triangle as trng import geopandas as gpd from shapely.geometry import Polygon import sfrmake...
ocgd123/MODStreamPy
Code/ModflowRouting.py
ModflowRouting.py
py
17,656
python
en
code
0
github-code
97
[ { "api_name": "shapely.geometry.Polygon", "line_number": 43, "usage_type": "call" }, { "api_name": "geopandas.GeoDataFrame", "line_number": 47, "usage_type": "call" }, { "api_name": "shapely.geometry.Polygon", "line_number": 66, "usage_type": "call" }, { "api_name...
21184336361
# _*_coding:utf-8_*_ # __author: a123456 import random import time from functools import wraps def run_time(func): """打印函数运行时间, 毫秒""" @wraps(func) # 获取函数自身名称 def inner(*args, **kwargs): no_print = kwargs.get("no_print") if no_print: kwargs.pop("no_print") return f...
impossible-g/algorithm
tools/helper.py
helper.py
py
1,850
python
en
code
1
github-code
97
[ { "api_name": "time.time", "line_number": 18, "usage_type": "call" }, { "api_name": "time.time", "line_number": 20, "usage_type": "call" }, { "api_name": "functools.wraps", "line_number": 11, "usage_type": "call" }, { "api_name": "random.randint", "line_number...
10884143400
import sys, base64 import numpy as np from PIL import Image from io import BytesIO, StringIO import skimage.io import tensorflow as tf from main import foward_pass from helper import ImageProcess file = sys.argv[-1] if file == 'demo.py': print("Error loading video") quit # Define encoder function def encod...
kanhua/lyft-challenge
test_encode.py
test_encode.py
py
1,710
python
en
code
0
github-code
97
[ { "api_name": "sys.argv", "line_number": 11, "usage_type": "attribute" }, { "api_name": "PIL.Image.fromarray", "line_number": 21, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 21, "usage_type": "name" }, { "api_name": "io.BytesIO", "line_nu...
26603056174
from django.core.mail import EmailMessage from django.db.models import Q, Sum from django.template.loader import render_to_string from django.http import HttpResponse from .utils import send_email from django.contrib.auth import get_user_model from django_q.tasks import async_task from django_q.models imp...
Bbillyben/labsmanager
labsmanager/tasks.py
tasks.py
py
7,500
python
en
code
0
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 24, "usage_type": "call" }, { "api_name": "django_q.models.Schedule.objects.filter", "line_number": 31, "usage_type": "call" }, { "api_name": "django_q.models.Schedule.objects", "line_number": 31, "usage_type": "attribute"...
24069035827
import constants import pandas as pd import datetime def trim(days_ago): n = datetime.datetime.now() r = n - datetime.timedelta(days=days_ago) delete = 'DELETE FROM {} WHERE TIME < \'' + r.isoformat() + '\';' print(delete) constants.postgres_engine.execute(delete.format(constants.data_table)) def...
NOAA-PMEL/de_osmc
db.py
db.py
py
3,200
python
en
code
1
github-code
97
[ { "api_name": "datetime.datetime.now", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 7, "usage_type": "attribute" }, { "api_name": "datetime.timedelta", "line_number": 8, "usage_type": "call" }, { "api_name": "constant...
41718852124
import os import random import shutil from argparse import ArgumentParser from datetime import datetime import matplotlib.pyplot as plt import numpy as np import torch from pytorch_fid.fid_score import calculate_fid_given_paths from torch.utils.data import DataLoader from torch.utils.data.dataset import Subset from to...
tomii926/gan_fl
fid.py
fid.py
py
4,217
python
en
code
0
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 31, "usage_type": "call" }, { "api_name": "os.path", "line_number": 31, "usage_type": "attribute" }, { "api_name": "gan.Generator", ...
3269711082
from main.py import Distribution import math import matplotlib.pyplot as plt class Binomial(Distribution): def __init__(self, p = 0, n = 1): Distribution.__init__(self) self.p = p self.n = n def calculate_mean(self): self.mean = self.p * self.n return self.mean ...
abdulrahman-1212/Distributions
binomial.py
binomial.py
py
2,439
python
en
code
0
github-code
97
[ { "api_name": "main.py.Distribution", "line_number": 6, "usage_type": "name" }, { "api_name": "main.py.Distribution.__init__", "line_number": 8, "usage_type": "call" }, { "api_name": "main.py.Distribution", "line_number": 8, "usage_type": "name" }, { "api_name": "...
72620736320
import logging import unittest from ml_preproc.pipeline.features.clean_input import _map_abbreviations class CleanInputTest(unittest.TestCase): def test_map_abbreviations(self): abbreviations = {'str': 'street', 'str.': 'street', 'rd': 'road'} result = _map_abbreviations("Main str. 8", abbreviations) e...
GoogleCloudPlatform/professional-services
examples/dataflow-production-ready/python/tests/test_clean_input.py
test_clean_input.py
py
477
python
en
code
2,602
github-code
97
[ { "api_name": "unittest.TestCase", "line_number": 6, "usage_type": "attribute" }, { "api_name": "ml_preproc.pipeline.features.clean_input._map_abbreviations", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "c...
22112251814
""" https://leetcode.com/problems/course-schedule/ this is just cycle detection in directed graph we can just use the direction to mean depends on [0,1] means 0 depends on 1... if you say its a cycle detection, where to start the traversal? topological sort just scan every node and see if it is scanned? yeah, so w...
kangxie-colorado/leetcode-and-notes
previous_run/441.207.courseSchedul.py
441.207.courseSchedul.py
py
3,803
python
en
code
0
github-code
97
[ { "api_name": "typing.List", "line_number": 20, "usage_type": "name" }, { "api_name": "collections.defaultdict", "line_number": 21, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 55, "usage_type": "name" }, { "api_name": "collections.defaultdi...
32848224734
import argparse import json from utils.params import FT_Configer from finetune.trainer import Trainer def load(json_file): with open(json_file, 'r') as f: return json.load(f) def main(): parser = argparse.ArgumentParser(description="Argparser") parser.add_argument("--params", ...
Quelisa/fine-tune-model
text-similarity/run_finetune.py
run_finetune.py
py
590
python
en
code
1
github-code
97
[ { "api_name": "json.load", "line_number": 10, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 15, "usage_type": "call" }, { "api_name": "utils.params.FT_Configer", "line_number": 21, "usage_type": "call" }, { "api_name": "finetune.t...
72939248958
from flask import Flask from flask_sqlalchemy import SQLAlchemy from variaveis import DATABASE app = Flask(__name__) app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False app.config['SQLALCHEMY_DATABASE_URI'] = DATABASE db = SQLAlchemy(app) db.init_app class Awa_Foto(db.Model): id = db.Column(db.Integer, primar...
dskls009/meunovopy_bot
models.py
models.py
py
411
python
en
code
0
github-code
97
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "variaveis.DATABASE", "line_number": 8, "usage_type": "name" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 10, "usage_type": "call" } ]
19507126742
import sqlite3 from flask import current_app def get_db(): return current_app._get_current_object().get_db() # Database function def insert_user(firstname, lastname, emailuser): db = get_db() cursor = db.cursor() cursor.execute("INSERT INTO users (first_name, last_name, email) VALUES (?, ?, ? )", (fir...
JasonPham02/WeatherApp-project
routes/db_utils.py
db_utils.py
py
775
python
en
code
0
github-code
97
[ { "api_name": "flask.current_app._get_current_object", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.current_app", "line_number": 5, "usage_type": "name" } ]
4452767656
### Test scales with easy OCR def detect_Number(List_with_Images): # Input Images, best case closely cropped to image # Output List of Numbers and letters import easyocr reader = easyocr.Reader(['ch_sim','en']) # this needs to run only once to load the model into memory Results = [] for x in List_with_...
Fipsii/DaphniaDetector
Code_Measure/archive/Easy_OCR_Detection.py
Easy_OCR_Detection.py
py
3,649
python
en
code
0
github-code
97
[ { "api_name": "easyocr.Reader", "line_number": 7, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 103, "usage_type": "call" } ]
37413560932
from selenium import webdriver import time # Launch Firefox browser driver = webdriver.Firefox() # Open custom map URL driver.get("https://webcam-live.creaweather.fr/Meteo60.html") time.sleep(5) # Execute JavaScript to get all pins on the map pins = driver.execute_script("return document.querySelectorAll('.gm-style-i...
Oscar-T24/PySky
Test/testretrievement.py
testretrievement.py
py
801
python
en
code
1
github-code
97
[ { "api_name": "selenium.webdriver.Firefox", "line_number": 5, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 5, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 9, "usage_type": "call" } ]
20228759595
#!/usr/bin/python #-*-coding:utf-8 import os import sys import pdb import re import math from pymongo import MongoClient import pymongo import time import json import time import pdb def load_model(f_name): ifp = open(f_name, 'rb') return eval(ifp.read()) # def viterbi(obs, states, start_p, trans_p, emit_p): # ...
yangze01/weibo_crawler
weibo_crawler/FC/HMM/HMM.py
HMM.py
py
4,822
python
en
code
5
github-code
97
[ { "api_name": "math.exp", "line_number": 49, "usage_type": "call" }, { "api_name": "math.exp", "line_number": 62, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 101, "usage_type": "call" } ]
19969739496
from http import HTTPStatus from typing import Dict, Iterable, List, Mapping, Optional, Union from amundsen_common.entity.resource_type import ResourceType from amundsen_common.models.dashboard import DashboardSummarySchema from amundsen_common.models.table import TableSummarySchema from flasgger import swag_from from...
givemeamug/amundsen
metadata/metadata_service/api/popular_resources.py
popular_resources.py
py
1,500
python
en
code
null
github-code
97
[ { "api_name": "flask_restful.Resource", "line_number": 14, "usage_type": "name" }, { "api_name": "metadata_service.proxy.get_proxy_client", "line_number": 20, "usage_type": "call" }, { "api_name": "typing.Optional", "line_number": 23, "usage_type": "name" }, { "ap...
389576459
from flask import Flask from flask_cors import CORS # comm in deployment import socket import requests from requests.auth import HTTPBasicAuth HEADER = 64 PORT = 5050 PORT_2 = 5678 MSG_SIZE = 2048 FORMAT = 'utf-8' DISCONNECT_MESSAGE = "!DISCONNECT" SERVER = '192.168.86.152' # Run server first ADDR = (SERVER, PORT) ADD...
nickaskam/nfl-score-tracker
backend/app.py
app.py
py
1,708
python
en
code
0
github-code
97
[ { "api_name": "socket.socket", "line_number": 16, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 16, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREAM", "line_number": 16, "usage_type": "attribute" }, { "api_name": "socket.sock...
3684215825
from fastapi import FastAPI, Request, Depends, BackgroundTasks, background from fastapi.templating import Jinja2Templates from sqlalchemy import engine import dbmodels import yfinance as yf from sqlalchemy.orm import Session from database import SessionLocal, engine from pydantic import BaseModel from dbmodels import S...
abilashnair0310/StockTracker
main.py
main.py
py
2,787
python
en
code
0
github-code
97
[ { "api_name": "twilio.rest.Client", "line_number": 14, "usage_type": "call" }, { "api_name": "fastapi.FastAPI", "line_number": 19, "usage_type": "call" }, { "api_name": "dbmodels.Base.metadata.create_all", "line_number": 21, "usage_type": "call" }, { "api_name": "...
33668774309
import matplotlib.pyplot as plt import time import os import platform import sys import copy import numpy as np platform = platform.system() args = sys.argv if "--size" in args: size = int(args[args.index("--size")+1]) a, b = size, size else: a,b = 40,40 if "--wait" in args: wait = int(args[args.inde...
PepperLola/cgol-grapher
cgol_grapher.py
cgol_grapher.py
py
3,517
python
en
code
1
github-code
97
[ { "api_name": "platform.system", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.random.choice", "line_number": 41, "usage_type": "call" }, { "api_name": "numpy.random", "...
5778286759
from typing import List class Solution: def rob(self, nums: List[int]) -> int: if not nums: return 0 if len(nums) == 1: return nums[0] return max(self.rob_range(nums[1:]), self.rob_range(nums[: len(nums) - 1])) def rob_range(self, nums: List[int]) -> int: ...
baoyf4244/interviews
leetcode/dynamic_programming/0213_house_robber_ii.py
0213_house_robber_ii.py
py
501
python
en
code
0
github-code
97
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 12, "usage_type": "name" } ]
32941960528
import os import argparse import time import numpy as np import utils from config import get_algo_config, get_algo_class dataset_root = 'data/' parser = argparse.ArgumentParser() parser.add_argument("--runs", type=int, default=1, help="how many times we repeat the experiments to obtain the aver...
xuhongzuo/deep-iforest
main_ts.py
main_ts.py
py
4,610
python
en
code
57
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "config.get_algo_class", "line_number": 35, "usage_type": "call" }, { "api_name": "config.get_algo_config", "line_number": 36, "usage_type": "call" }, { "api_name": "...
16199075070
import sys import numpy as np import matplotlib as mpl #import numpy.fft as npfft import scipy.fftpack as spfft from mpi4py import MPI # Force matplotlib to not use any Xwindows backend mpl.use('Agg') import matplotlib.pyplot as plt def plotSpectrum(y,Fs): """ Plots a Single-Sided Amplitude Spectrum of y(t) """...
LongDaniel/Wind_Turbine
LES/cases/Inflow/post_inlet_5.py
post_inlet_5.py
py
7,673
python
en
code
1
github-code
97
[ { "api_name": "matplotlib.use", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 17, "usage_type": "call" }, { "api_name": "scipy.fftpack.fft", "line_number": 26, "usage_type": "call" }, { "api_name": "scipy.fftpack", "lin...
30219209777
import os import numpy as np import torch import torch.nn.functional as F os.environ["CUDA_VISIBLE_DEVICES"] = '0,1' def pytorch_compute_single(im, target_interface, GPU_mode=1): input_pytorch_value = None output_pytorch_value = None input_pytorch_cpu_value = None output_pytorch_cpu_value = N...
Embed-Debuger/Meta
Duo/utils/pytorch_compute.py
pytorch_compute.py
py
7,127
python
en
code
0
github-code
97
[ { "api_name": "os.environ", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.reshape", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.from_numpy", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.from_numpy", ...
31932790840
from django.urls import path from resultpage import views urlpatterns = [ path('', views.index, name='index'), path('crop/', views.auto_crop, name='auto_crop'), path('brightness/', views.render_brightness, name='render_brightness'), path('prediction/', views.render_prediction, name='render_prediction')...
jenny5546/sampyo-backend-deploy-version
resultpage/urls.py
urls.py
py
428
python
en
code
0
github-code
97
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "resultpage.views.index", "line_number": 5, "usage_type": "attribute" }, { "api_name": "resultpage.views", "line_number": 5, "usage_type": "name" }, { "api_name": "django.url...
773748808
from typing import Optional, Union from snovault import calculated_property, collection, load_schema from snovault.types.user import User as SnovaultUser from .base import Item as SMAHTItem @collection( name='users', unique_key="user:email", # Required to GET via /users/{email}/ properties={ "t...
smaht-dac/smaht-portal
src/encoded/types/user.py
user.py
py
1,272
python
en
code
2
github-code
97
[ { "api_name": "base.Item", "line_number": 17, "usage_type": "name" }, { "api_name": "snovault.types.user.User", "line_number": 17, "usage_type": "name" }, { "api_name": "snovault.load_schema", "line_number": 19, "usage_type": "call" }, { "api_name": "typing.Option...
71002599038
import math import itertools from collections import defaultdict import sys from timeit import default_timer as timer import numpy as np def graphFromInput(): edges = [] nameToId = dict() idToName = dict() N = int(sys.stdin.readline()) for line in sys.stdin.readlines(): u,v = l...
dkfrankandersen/ITU_AdvancedAlgorithms
5fifth/DpHamiltonianCycle.py
DpHamiltonianCycle.py
py
2,755
python
en
code
0
github-code
97
[ { "api_name": "sys.stdin.readline", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 12, "usage_type": "attribute" }, { "api_name": "sys.stdin.readlines", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.stdin", ...
12071869860
import cv2 import numpy as np from PIL import Image #<= 这个是赠品需要汇入的东西 import winsound import threading import tkinter as tk # 建立主视窗和 Frame(把元件变成群组的容器) window = tk.Tk() top_frame = tk.Frame(window) # 将元件分为 top/bottom 两群并加入主视窗 top_frame.pack() bottom_frame = tk.Frame(window) bottom_frame.pack(side=tk.BOTTOM) # 建立事件处理函式...
s92475mark/Exercise_musiplayer
nothin.py
nothin.py
py
1,365
python
zh
code
0
github-code
97
[ { "api_name": "tkinter.Tk", "line_number": 9, "usage_type": "call" }, { "api_name": "tkinter.Frame", "line_number": 10, "usage_type": "call" }, { "api_name": "tkinter.Frame", "line_number": 14, "usage_type": "call" }, { "api_name": "tkinter.BOTTOM", "line_numb...
10421684056
import cv2 import glob import numpy as np import matplotlib.pyplot as plt import pickle def grayscale(img): ''' :param img: :return: ''' return cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) def find_corners(img, nx, ny): ''' :param img: :param nx: :param ny: :return: ''' gra...
jonad/AdvancedLaneDetection
codes/preprocessing.py
preprocessing.py
py
14,721
python
en
code
0
github-code
97
[ { "api_name": "cv2.cvtColor", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 13, "usage_type": "attribute" }, { "api_name": "cv2.findChessboardCorners", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy....
71361226559
# -*- coding: utf-8 -*- import os import re import urllib.request import socket from bs4 import BeautifulSoup #send mail from email import encoders from email.header import Header from email.mime.text import MIMEText from email.utils import parseaddr, formataddr import smtplib import time import datetime #map import...
lyyiangang/Parse58
ParseHZWXQLT.py
ParseHZWXQLT.py
py
6,290
python
en
code
0
github-code
97
[ { "api_name": "time.localtime", "line_number": 39, "usage_type": "call" }, { "api_name": "time.localtime", "line_number": 40, "usage_type": "call" }, { "api_name": "time.localtime", "line_number": 41, "usage_type": "call" }, { "api_name": "socket.setdefaulttimeout...
7424523640
import pytest from time import sleep from selenium import webdriver from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.wait import WebDriverWait from util.util import get_code,identification_verification_code,get_logger class TestUserLogin(object): def __init__(self...
Zoescat/selenium_test
testcases/log/test_user_login.py
test_user_login.py
py
3,156
python
en
code
0
github-code
97
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 11, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 11, "usage_type": "name" }, { "api_name": "util.util.get_logger", "line_number": 14, "usage_type": "call" }, { "api_name": "uti...
25601437411
from setuptools import setup, find_packages with open("README.md", "r") as fh: long_description = fh.read() setup(name='filmapis', version='0.2', description='The funniest joke in the world', long_description=long_description, classifiers=[ 'Development Status :: 3 - Alpha', ...
WTTeneger/kinopoisk_api
setup.py
setup.py
py
839
python
en
code
1
github-code
97
[ { "api_name": "setuptools.setup", "line_number": 8, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 23, "usage_type": "call" } ]
70677595519
from django.db import models from hesab.models import User class jamsabad(models.Model): jam = models.IntegerField(blank=True,null=True) user = models.ForeignKey(User,on_delete=models.CASCADE) class Meta: verbose_name = "جمع" verbose_name_plural = "جمع سبد ها" def __str__(self): ...
yacn1414/spsh
hesab/models/jamsabadm.py
jamsabadm.py
py
358
python
en
code
1
github-code
97
[ { "api_name": "django.db.models.Model", "line_number": 3, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 3, "usage_type": "name" }, { "api_name": "django.db.models.IntegerField", "line_number": 4, "usage_type": "call" }, { "api_name"...
2644434037
import argparse import json def parse_har(har_file): with open(har_file) as f: har_dict = json.load(f) for entry in har_dict['log']['entries']: url = entry['request']['url'] if '/search_results/' in url: yield url def main(har_file): for url in parse_har(har_file): ...
tbelhalfaoui/vaccine-shotgun
vaccine_shotgun/parse_har.py
parse_har.py
py
521
python
en
code
1
github-code
97
[ { "api_name": "json.load", "line_number": 7, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 21, "usage_type": "call" } ]
19862416598
import os import sys import logging import logzero import config from logging.handlers import TimedRotatingFileHandler logzero.loglevel(logging.WARNING) logger = logging.getLogger("vits-simple-api") level = getattr(config, "LOGGING_LEVEL", "DEBUG") level_dict = {'DEBUG': logging.DEBUG, 'INFO': logging.INFO, 'WARNING':...
Artrajz/vits-simple-api
logger.py
logger.py
py
1,643
python
en
code
381
github-code
97
[ { "api_name": "logzero.loglevel", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.WARNING", "line_number": 8, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.DEBUG", ...
71400567998
import datetime, time from mpi4py import MPI class configuration(): def __init__(self): # Topology settings self.nodesPerRank = 8 self.maxNodesPerRank = 10 # Time settings self.simTime = 1000 self.timeSpeed = 100 self.syncTime = 5 # Main chain set...
leobago/shardSim
shardSim/configuration.py
configuration.py
py
1,281
python
en
code
31
github-code
97
[ { "api_name": "datetime.datetime.now", "line_number": 40, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 40, "usage_type": "attribute" }, { "api_name": "mpi4py.MPI.COMM_WORLD.Get_size", "line_number": 42, "usage_type": "call" }, { "api_n...
20837861712
#http://hotsapi.net/api/v1/replays?game_type=QuickMatch&player={playerName} ? {#battleTag} #http://hotsapi.net/api/v1/replays/{replay_id} #saebu_no LhoeynJY saebu.no.mysql import requests import json def callAPI(): # url = "http://hotsapi.net/api/v1/replays?game_type=QuickMatch&player=TommyGun%232872" url = "...
tomassabu/hotsstat
DataCollector.py
DataCollector.py
py
1,956
python
en
code
0
github-code
97
[ { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 27, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 34, "usage_type": "call" } ]
42993922929
#!/usr/bin/env python # -*- coding: utf-8 -*- from losoto.lib_operations import * from losoto._logging import logger as logging logging.debug('Loading STRUCTURE module.') def _run_parser(soltab, parser, step): doUnwrap = parser.getbool( step, 'doUnwrap', False ) refAnt = parser.getstr( step, 'refAnt', '') ...
revoltek/losoto
losoto/operations/structure.py
structure.py
py
7,409
python
en
code
10
github-code
97
[ { "api_name": "losoto._logging.logger.debug", "line_number": 7, "usage_type": "call" }, { "api_name": "losoto._logging.logger", "line_number": 7, "usage_type": "name" }, { "api_name": "losoto._logging.logger.info", "line_number": 40, "usage_type": "call" }, { "api...
23379397918
import scipy.integrate as integrate import scipy.signal as signal import numpy as np import matplotlib.pyplot as plt # Inputs (Angles are in decimal degrees!) # Graph Parameters (seconds) start = 0 stop = 1000000 step = 1000 UScalar = 5 # Divides distances/speeds by 10^x. Keeps numbers computer-reasonable. # Item ...
maxoknh/ILSulator
main.py
main.py
py
5,488
python
en
code
0
github-code
97
[ { "api_name": "numpy.power", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.power", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.power", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.power", "line_number": ...
7766159021
#!/usr/bin/env python3 import os.path import logging from main.settings import Config log = logging.getLogger(__file__) if __name__ == '__main__': import argparse parser = argparse.ArgumentParser(description='Spark operation for processing Border Crossing Entry data') parser.add_argument('-i', '--inpu...
riomat13/hadoop_playground
src/python/main/border/spark.py
spark.py
py
3,137
python
en
code
0
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.path.join", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path.pa...
6805487468
from django.conf import settings from django.conf.urls.static import static from django.urls import include, path from jobsapp.views import EditProfileView, EmployerProfileEditView from .views import * app_name = "accounts" urlpatterns = [ path("searchcompany/", SearchcompanyView.as_view(), name="searchcompany...
Safa52/job_portal
accounts/urls.py
urls.py
py
1,128
python
en
code
0
github-code
97
[ { "api_name": "django.urls.path", "line_number": 12, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 13, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 14, "usage_type": "call" }, { "api_name": "django.urls.path",...
70793717120
from gtts import gTTS import json import socket import struct import urllib import os import requests def askForService(token: str, port: int, lang: str, data: bytes) -> dict: ''' DO NOT MODIFY THIS PART ''' HOST = "140.116.245.157" sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: ...
dodo920306/DEVELOPMENT_OF_INTELLIGENT-MEDICAL_INFORMATION_SYSTEM_Final_Project
mi2s_asr_client.py
mi2s_asr_client.py
py
19,119
python
zh
code
0
github-code
97
[ { "api_name": "socket.socket", "line_number": 14, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 14, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREAM", "line_number": 14, "usage_type": "attribute" }, { "api_name": "json.dumps"...
19873655422
from matplotlib import cm, use use('Agg') import matplotlib.pyplot as plt from matplotlib.ticker import FixedLocator, AutoMinorLocator from mpl_toolkits.mplot3d import Axes3D import numpy as np import matplotlib.colors as colors import os class MidpointNormalize(colors.Normalize): def __init__(self, vmin=None, v...
mwilensky768/MJW-MWA
plt_lib.py
plt_lib.py
py
6,045
python
en
code
0
github-code
97
[ { "api_name": "matplotlib.use", "line_number": 2, "usage_type": "call" }, { "api_name": "matplotlib.colors.Normalize", "line_number": 11, "usage_type": "attribute" }, { "api_name": "matplotlib.colors", "line_number": 11, "usage_type": "name" }, { "api_name": "matp...
74150215999
import math import random import numpy as np import matplotlib.pyplot as plt def random_point(a, b): return np.random.uniform(a, b) def left_riemann_sum(a, b, N): dx = (b-a)/N x_l = np.linspace(a, b-dx,N) return np.sum(f(x_l)*dx) def middle_riemann_sum(a, b, N): dx = (b-a)/N...
hadizha-66/Riemann-s-integral-calculus-2s-
rieman_sums.py
rieman_sums.py
py
2,898
python
en
code
0
github-code
97
[ { "api_name": "numpy.random.uniform", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.linspace", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.sum", "...