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
41559924516
#!/usr/bin/python ################# # Imports import os import time import datetime import time from datetime import datetime as dt from time import strftime import pDBIconnect import decimal import pandas as pd def nowTime(): nowstrt = datetime.datetime.now().strftime("%d-%m-%Y %H:%M:%S") return nowstrt pd.s...
grizli-beep/resume
Monitoring scripts/check_PositionsAttributes.py
check_PositionsAttributes.py
py
1,552
python
en
code
0
github-code
1
[ { "api_name": "datetime.datetime.now", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 16, "usage_type": "attribute" }, { "api_name": "pandas.set_option", "line_number": 18, "usage_type": "call" }, { "api_name": "pDBIco...
33761466474
from io import StringIO from copy import deepcopy class Singleton(type): _instances = {} def __call__(cls, *args, **kwargs): if not args and not kwargs: # empty call if cls not in cls._instances: cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs) ...
taucompling/morphophonology_spe
source/configuration.py
configuration.py
py
2,880
python
en
code
5
github-code
1
[ { "api_name": "copy.deepcopy", "line_number": 38, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 66, "usage_type": "call" }, { "api_name": "io.StringIO", "line_number": 69, "usage_type": "call" } ]
26206633753
from tempfile import TemporaryDirectory import popxl import numpy as np from popxl_addons.layers import Linear from popxl_addons.module import Module from popxl_addons.task_session import TaskSession import os import glob class MockModel(Module): def __init__(self): super().__init__() self.l1 = Li...
graphcore/popxl-addons
tests/integration/test_task_session.py
test_task_session.py
py
2,609
python
en
code
1
github-code
1
[ { "api_name": "popxl_addons.module.Module", "line_number": 11, "usage_type": "name" }, { "api_name": "popxl_addons.layers.Linear", "line_number": 14, "usage_type": "call" }, { "api_name": "popxl_addons.layers.Linear", "line_number": 15, "usage_type": "call" }, { "...
42603986144
from django.shortcuts import render from portfolio.models import MyApp # Create your views here. def home(request): # name = "John" all_apps = MyApp.objects.all() context = { 'my_apps': all_apps } return render(request, 'website/index.html', context)
SergeiVorobev/MyPortfolio
portfolio/views.py
views.py
py
281
python
en
code
0
github-code
1
[ { "api_name": "portfolio.models.MyApp.objects.all", "line_number": 8, "usage_type": "call" }, { "api_name": "portfolio.models.MyApp.objects", "line_number": 8, "usage_type": "attribute" }, { "api_name": "portfolio.models.MyApp", "line_number": 8, "usage_type": "name" },...
40454861663
import os from datetime import datetime from typing import Any, Dict, List, Tuple, Union from uuid import uuid4 import sqlalchemy as sa from sqlalchemy.orm import Session, aliased from sqlalchemy.sql import label from umeta import config, core, generators, models, sources def get_buckets(db: Session, s: config.Sour...
subdavis/umeta
umeta/crud.py
crud.py
py
10,616
python
en
code
0
github-code
1
[ { "api_name": "sqlalchemy.orm.Session", "line_number": 13, "usage_type": "name" }, { "api_name": "umeta.config.Source", "line_number": 13, "usage_type": "attribute" }, { "api_name": "umeta.config", "line_number": 13, "usage_type": "name" }, { "api_name": "umeta.mo...
9194086611
import pygame import numpy as np from astar_point_rigid import * import time def triangleCoordinates(start, end, triangleSize = 5): rotation = (math.atan2(start[1] - end[1], end[0] - start[0])) + math.pi/2 # print(math.atan2(start[1] - end[1], end[0] - start[0])) rad = math.pi/180 coordinateList...
mesneym/Astar-Path-Planning
main.py
main.py
py
6,588
python
en
code
0
github-code
1
[ { "api_name": "numpy.array", "line_number": 13, "usage_type": "call" }, { "api_name": "time.time", "line_number": 47, "usage_type": "call" }, { "api_name": "numpy.round", "line_number": 59, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 59...
1074569179
import os import shutil import sys import datetime import json dateconvert = { 1: "Jan", 2: "Feb", 3: "Marc", 4: "Apr", 5: "Maj", 6: "Jun", 7: "Jul", 8: "Aug", 9: "Szept", 10: "Okt", 11: "Nov", 12: "Dec" } def prepare(): root = "" if l...
Je-RICO-h/Python-picsorter
Picsorter/main.py
main.py
py
3,237
python
en
code
0
github-code
1
[ { "api_name": "sys.argv", "line_number": 26, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 27, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path", "line_number...
33880837913
from collections import defaultdict def solve(program): painted_hull = {} x, y = 0, 0 dx, dy = 0, 1 painting = True def input_func(): print(f"get_color({x}, {y}) : {get_color(x, y)}") return get_color(x, y) def output_func(value): nonlocal x, y, dx, dy, painting ...
bdaene/advent-of-code
2019/day11/part 1.py
part 1.py
py
5,225
python
en
code
1
github-code
1
[ { "api_name": "collections.defaultdict", "line_number": 94, "usage_type": "call" } ]
31658308898
import sklearn.svm import ProtModel import numpy as np import sys class SVM(ProtModel.Model): #classe per modello SVM, estende classe astratta modello generico e utilizza la classe SVC di SkLearn def __init__(self, C, G): self.C=C self.G=G def train(self,datat): #train the model gi...
Rambaldelli/SVM-GOR-Secondary-Structure-Prediction-Comparison
MySVM.py
MySVM.py
py
2,653
python
en
code
0
github-code
1
[ { "api_name": "ProtModel.Model", "line_number": 8, "usage_type": "attribute" }, { "api_name": "sklearn.svm.svm.SVC", "line_number": 35, "usage_type": "call" }, { "api_name": "sklearn.svm.svm", "line_number": 35, "usage_type": "attribute" }, { "api_name": "sklearn....
72781393635
""" This program lists all the active courses as well as courses with an assignment group containing "Ungraded" This is useful for configuring the Redis db (See README.md) """ import os import dotenv from canvasapi import Canvas dotenv.load_dotenv() canvas_url = 'https://moravian.instructure.com/' canvas_token = ...
bjcoleman/trello-todo-canvas
list_ids.py
list_ids.py
py
819
python
en
code
0
github-code
1
[ { "api_name": "dotenv.load_dotenv", "line_number": 14, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 17, "usage_type": "attribute" }, { "api_name": "canvasapi.Canvas", "line_number": 19, "usage_type": "call" } ]
2769032283
from sklearn.svm import SVC import pandas as pd from sklearn.metrics import accuracy_score import pickle train = pd.read_csv("./mnist/train.csv") valid = pd.read_csv("./mnist/t10k.csv") train_label = train.iloc[:, 0] #모든행에 1번쨰 열 train_data = train.iloc[:, 1:] #모든 행에 2번째 ㅇ열부터 끝까지 valid_label = train.iloc[:...
Aki-hwang/Python_lvl_1
66_손글씨_숫자_학습.py
66_손글씨_숫자_학습.py
py
738
python
ko
code
0
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "sklearn.svm.SVC", "line_number": 15, "usage_type": "call" }, { "api_name": "sklearn.metrics.accurac...
38906726308
from typing import Optional from .AircraftData import AircraftData from src.pyLiveKML.KML.GeoCoordinates import GeoCoordinates from src.pyLiveKML.KML.KML import AltitudeMode from src.pyLiveKML.KML.KMLObjects.IconStyle import IconStyle from src.pyLiveKML.KML.KMLObjects.Placemark import Placemark from src.pyLiveKML.KML....
smoke-you/pyLiveKML
evals/apps/aircraft_trail/AircraftPosition.py
AircraftPosition.py
py
1,270
python
en
code
1
github-code
1
[ { "api_name": "src.pyLiveKML.KML.KMLObjects.Placemark.Placemark", "line_number": 12, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 14, "usage_type": "name" }, { "api_name": "src.pyLiveKML.KML.GeoCoordinates.GeoCoordinates", "line_number": 18, "us...
70319724513
# -*- coding: utf-8 -*- from five import grok from jowent.bannerviewlet import MessageFactory as _ from jowent.bannerviewlet.behaviors.bannerimage import IBannerImage from jowent.bannerviewlet.interfaces import IBannerViewletSettings from plone.namedfile.interfaces import INamedBlobImageField from plone.registry.interf...
jowent/jowent.bannerviewlet
jowent/bannerviewlet/validators.py
validators.py
py
2,198
python
en
code
0
github-code
1
[ { "api_name": "z3c.form.validator.FileUploadValidator", "line_number": 13, "usage_type": "attribute" }, { "api_name": "z3c.form.validator", "line_number": 13, "usage_type": "name" }, { "api_name": "zope.component.getUtility", "line_number": 22, "usage_type": "call" }, ...
71155389793
import os import csv import copy import textwrap import string import gzip import shutil import textwrap import itertools import math # Relevant import pandas import sklearn import scipy import numpy import statsmodels.api # Custom #dir() #importlib.reload() ########################################################...
tcameronwaller/partner
package/utility.py
utility.py
py
148,385
python
en
code
0
github-code
1
[ { "api_name": "string.ascii_letters", "line_number": 53, "usage_type": "attribute" }, { "api_name": "string.digits", "line_number": 54, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 76, "usage_type": "call" }, { "api_name": "os.path.isdir...
74258977312
import sys, os, time, traceback import ctypes from optparse import OptionParser import pygame.midi import winreg # Constants # Axis mapping axis = {'X': 0x30, 'Y': 0x31, 'Z': 0x32, 'RX': 0x33, 'RY': 0x34, 'RZ': 0x35, 'SL0': 0x36, 'SL1': 0x37, 'WHL': 0x38, 'POV': 0x39} # Slider or Pitchbend keys(m_types) sliders = ...
c0redumb/midi2vjoy
midi2vjoy/midi2vjoy.py
midi2vjoy.py
py
4,958
python
en
code
73
github-code
1
[ { "api_name": "pygame.midi.midi.get_count", "line_number": 28, "usage_type": "call" }, { "api_name": "pygame.midi.midi", "line_number": 28, "usage_type": "attribute" }, { "api_name": "pygame.midi", "line_number": 28, "usage_type": "name" }, { "api_name": "pygame.m...
34139026795
import torch import onnx from torchvision import models from torch import nn import onnxruntime import numpy as np import onnxsim class NaiveModel(torch.nn.Module): def __init__(self): super().__init__() self.net = models.mobilenet_v2(pretrained=True) self.out2 = nn.Linear(1000,2) def f...
qiaofengsheng/ai_deploy
TensorRT/python/export_onnx.py
export_onnx.py
py
3,222
python
en
code
16
github-code
1
[ { "api_name": "torch.nn", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torchvision.models.mobilenet_v2", "line_number": 12, "usage_type": "call" }, { "api_name": "torchvision.models", "line_number": 12, "usage_type": "name" }, { "api_name": "torch...
17217415192
from random import random, randint, choice import numpy from ..ops import multiType from p4p.wrapper import Value def rand_str(): N = randint(0, 10) # inclusive return ''.join([choice('abcdefghijklmnopqrstufwxyz') for n in range(N)]) def rand_int(): return randint(-10, 10) def rand_flt(): return r...
epics-base/masarService
python/minimasar/gather/sim.py
sim.py
py
2,591
python
en
code
6
github-code
1
[ { "api_name": "random.randint", "line_number": 10, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 11, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 14, "usage_type": "call" }, { "api_name": "random.random", "line...
71039294435
import json, os coder = "utf8" numlist = { "一" : 1, "二" : 2, "三" : 3, "四" : 4, "五" : 5, "六" : 6, "七" : 7, "八" : 8, "九" : 9, "十" : 10 } class StringTool : def bins(BinsStrings : str) : re = [] for i in BinsStrings : i = b...
Donseking/dsksystem
pymodle/dskmod.py
dskmod.py
py
6,240
python
en
code
1
github-code
1
[ { "api_name": "json.load", "line_number": 78, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 89, "usage_type": "call" }, { "api_name": "json.load", "line_number": 94, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 105, ...
24859917703
from starlette.datastructures import FormData from starlette.requests import Request from fcg.viewmodels import parse from fcg.viewmodels.base_viewmodel import BaseViewModel class FormBaseViewModel(BaseViewModel): def __init__(self, request: Request): super().__init__(request) self.proposal_code ...
saltastroops/finder-chart-generator
fcg/viewmodels/form_base_viewmodel.py
form_base_viewmodel.py
py
772
python
en
code
0
github-code
1
[ { "api_name": "fcg.viewmodels.base_viewmodel.BaseViewModel", "line_number": 8, "usage_type": "name" }, { "api_name": "starlette.requests.Request", "line_number": 9, "usage_type": "name" }, { "api_name": "starlette.datastructures.FormData", "line_number": 15, "usage_type":...
9789033915
from mongo import engine from mongo.course import * from datetime import datetime from .user import * from .utils import * __all__ = ['Post'] class Post(): @classmethod def found_thread(cls, target_thread): reply_thread = [] if target_thread.reply: for reply in target_thread.repl...
Normal-OJ/Back-End
mongo/post.py
post.py
py
4,387
python
en
code
2
github-code
1
[ { "api_name": "datetime.datetime.now", "line_number": 45, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 45, "usage_type": "name" }, { "api_name": "mongo.engine.PostThread", "line_number": 48, "usage_type": "call" }, { "api_name": "mongo...
10436178052
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Use text editor to edit the script and type in valid Instagram username/password from InstagramAPI import InstagramAPI import json api = InstagramAPI("instamike59.officiel", "091h1scd") if (api.login()): api.getSelfUserFeed() # get self user feed data = api.LastJs...
michaeldupont/my_instagram_bot
insta.py
insta.py
py
516
python
en
code
0
github-code
1
[ { "api_name": "InstagramAPI.InstagramAPI", "line_number": 9, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 15, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 17, "usage_type": "call" } ]
26237514951
from uuid import uuid4 import pytest from synthetic.conf import EngagementConfig, PopulationConfig, ProfileConfig, global_conf from synthetic.event.constants import EventType from synthetic.utils.current_time_utils import get_current_time from synthetic.database.schemas import SyntheticUserSchema from synthetic.user....
benshi-ai/open-synthetic-data-generator
tests/test_synthetic_user/test_db.py
test_db.py
py
1,953
python
en
code
0
github-code
1
[ { "api_name": "synthetic.conf.global_conf.population", "line_number": 15, "usage_type": "attribute" }, { "api_name": "synthetic.conf.global_conf", "line_number": 15, "usage_type": "name" }, { "api_name": "synthetic.conf.PopulationConfig", "line_number": 15, "usage_type": ...
25142555924
#1 import pygame from pygame.locals import * #2 pygame.init() width, height = 640, 480 screen = pygame.display.set_mode((width, height)) keys = [False, False, False, False] playerpos = [100,100] acc = [0,0] boomerangs = [] #3 player = pygame.image.load("dude.png") player = pygame.transform.scale(player, (1...
thomakj/tools
hobby/games/Hello Bunny/game.py
game.py
py
1,362
python
en
code
0
github-code
1
[ { "api_name": "pygame.init", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pygame.image.loa...
9492227464
import os import cv2 import numpy as np from PyQt5 import QtCore, QtGui, QtWidgets # uic from PyQt5.QtWidgets import (QApplication, QMainWindow, QPushButton, QWidget, QLabel, QVBoxLayout) # +++ from ui import Ui_Form # +++ ...
selim1763/python_record_video
record_video.py
record_video.py
py
3,051
python
en
code
0
github-code
1
[ { "api_name": "PyQt5.QtWidgets.QDialog", "line_number": 12, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidgets", "line_number": 12, "usage_type": "name" }, { "api_name": "ui.Ui_Form", "line_number": 12, "usage_type": "name" }, { "api_name": "PyQt5.QtCore....
70755614754
import unittest2 import os import top class TestStopParser(unittest2.TestCase): @classmethod def setUpClass(cls): cls._sp = top.StopParser() test_dir = os.path.join('top', 'tests', 'files') test_file = 'TCD_Deliveries_20140207111019.DAT' cls._test_file = os.path.join(test_dir...
loum/top
top/tests/test_stopparser.py
test_stopparser.py
py
3,059
python
en
code
0
github-code
1
[ { "api_name": "unittest2.TestCase", "line_number": 7, "usage_type": "attribute" }, { "api_name": "top.StopParser", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "lin...
9509034408
from flask import request, make_response, jsonify import hashlib from bson import json_util from bson.objectid import ObjectId import os from werkzeug.utils import secure_filename import base64 from utils.config import app, userCollection, postCollection,imgCounterCollection from utils.response import make_response, ...
DoniyorI/FILO
utils/post.py
post.py
py
3,159
python
en
code
0
github-code
1
[ { "api_name": "flask.request.cookies.get", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.request.cookies", "line_number": 15, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 15, "usage_type": "name" }, { "api_name": "ut...
23655343690
#!/usr/bin/env python # -*- encoding: utf-8 -*- # History analizer # # This is the main file for this module, where the test cases should be # developed and where the functions called by the API must be located. # It depends on several other files, mainly: # # fetcher.py - Uses the browser_history library to actual...
Shit-bucket/Morpheos
backend/modules/history/__init__.py
__init__.py
py
1,031
python
en
code
1
github-code
1
[ { "api_name": "modules.history.fetcher.fetch_all", "line_number": 23, "usage_type": "call" }, { "api_name": "modules.history.summarize.summarize_by_domain", "line_number": 27, "usage_type": "call" }, { "api_name": "modules.history.statistics.most_repeated", "line_number": 28,...
41403616679
#======================================================== # SiteDescription.py #======================================================== # PublicPermissions: True #======================================================== # SiteDescription class to parse standard format XML # file and create a matching Python representa...
jodysankey/pythonpath
src/sitemgt/sitedescription.py
sitedescription.py
py
5,890
python
en
code
0
github-code
1
[ { "api_name": "xml.etree.ElementTree.etree.ElementTree.parse", "line_number": 54, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree.etree", "line_number": 54, "usage_type": "attribute" }, { "api_name": "xml.etree.ElementTree", "line_number": 54, "usage_type": "...
3168618507
from collections import OrderedDict from typing import Tuple, Union from fvcore.common.registry import Registry import copy import json import threading import numpy as np import torch import torch.nn.functional as F import torch.distributed as dist from torch import nn from collections import defaultdict from clip i...
zhaoyanpeng/vipant
cvap/module/decoder/loss_head.py
loss_head.py
py
25,849
python
en
code
19
github-code
1
[ { "api_name": "fvcore.common.registry.Registry", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.nn.Module", "line_number": 25, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 25, "usage_type": "name" }, { "api_name": "collect...
35235621538
from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth import authenticate, login, logout from django.shortcuts import render, get_object_or_404, redirect from django.views.generic import FormView, View, ListView from django.views.generic.base import TemplateView, TemplateResponseMixin from ...
NeelRoshania/MarPersonnel
home/views.py
views.py
py
16,642
python
en
code
0
github-code
1
[ { "api_name": "django.views.generic.View", "line_number": 22, "usage_type": "name" }, { "api_name": "forms.LoginForm", "line_number": 23, "usage_type": "name" }, { "api_name": "django.shortcuts.render", "line_number": 30, "usage_type": "call" }, { "api_name": "dja...
26674788073
""" Place to keep data persistence between requests """ import os import json BASE_DIR = os.path.dirname(os.path.realpath(__file__)) class Datastore: STORAGE = os.path.join(BASE_DIR, 'storage.txt') def load(self): try: handle = open(self.STORAGE, 'r') except IOError: r...
albertyw/indoor-localization
server/datastore.py
datastore.py
py
545
python
en
code
24
github-code
1
[ { "api_name": "os.path.dirname", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.join", "line_n...
21369768960
import argparse import sys from ft_config import load_config # check python version >= 3.6 assert sys.version_info >= (3, 6) # read config.json config = load_config() # parse arguments parser = argparse.ArgumentParser() parser.add_argument('--action', required=True, help="...
mikkorautiainen/fasttext-decrapifier
decrapper.py
decrapper.py
py
2,218
python
en
code
2
github-code
1
[ { "api_name": "sys.version_info", "line_number": 8, "usage_type": "attribute" }, { "api_name": "ft_config.load_config", "line_number": 12, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 16, "usage_type": "call" }, { "api_name": "ft...
6034089894
from typing import List """ Summary: Single pass, comparing current interval with the previous one. If overlap - increment the counter. Depending on the overlap type (case 2 vs 3), the prev interval is either updated or not. Possible cases: 1. Don't overlap ----- ------ 2. Overlap 1 ----- -...
EvgeniiTitov/coding-practice
coding_practice/sample_problems/leet_code/medium/435_non_overlapping_intervals.py
435_non_overlapping_intervals.py
py
2,012
python
en
code
1
github-code
1
[ { "api_name": "typing.List", "line_number": 54, "usage_type": "name" } ]
38164794895
from django.conf.urls import patterns, url from notes import views urlpatterns = patterns('', url(r'^$', views.all_notes, name='all_notes'), url(r'^resolved', views.resolved_notes, name='resolved_notes'), url(r'^(?P<note_id>\d+)/$', views.note_detail, name='note_detail'), url(r'^(?P<note_id>\d+)/edit/...
nicmatts/3DP
threedp/notes/urls.py
urls.py
py
629
python
en
code
0
github-code
1
[ { "api_name": "django.conf.urls.patterns", "line_number": 5, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "notes.views.all_notes", "line_number": 6, "usage_type": "attribute" }, { "api_name":...
31979524390
from django.views import View from django.http import JsonResponse, HttpResponseForbidden from django.shortcuts import get_object_or_404 from django.utils.decorators import method_decorator from django.views.decorators.csrf import csrf_exempt import json from api.settings import ALLOWED_TOKENS from . import models from...
arklual/api
marks/views.py
views.py
py
1,640
python
en
code
0
github-code
1
[ { "api_name": "django.views.View", "line_number": 14, "usage_type": "name" }, { "api_name": "django.shortcuts.get_object_or_404", "line_number": 17, "usage_type": "call" }, { "api_name": "accounts.models.Account", "line_number": 17, "usage_type": "argument" }, { "...
42281958081
"""A wonderful, simple database app by Georgina Paál""" import common import query from flask import Flask, render_template app = Flask(__name__) @app.route('/', methods=['GET', 'POST']) def main_page(): """ Lists all functions on the main page""" return render_template('main_page.html') @app.route('/men...
ginapaal/basic_sql_si_week
main.py
main.py
py
2,165
python
en
code
0
github-code
1
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 15, "usage_type": "call" }, { "api_name": "common.make_connection", "line_number": 22, "usage_type": "call" }, { "api_name": "query.mentors...
7080163471
from airflow import DAG from databox import Client from google.cloud import storage from gcsfs import GCSFileSystem import pandas as pd import logging as log import pendulum import requests from airflow.operators.python import PythonOperator from airflow.operators.dummy import DummyOperator from airflow.models import V...
adriennejohnson719/CS_280_Data_Workflow_Project
ETL.py
ETL.py
py
9,938
python
en
code
0
github-code
1
[ { "api_name": "airflow.models.Variable.get", "line_number": 17, "usage_type": "call" }, { "api_name": "airflow.models.Variable", "line_number": 17, "usage_type": "name" }, { "api_name": "airflow.models.TaskInstance", "line_number": 21, "usage_type": "name" }, { "a...
42176940574
""" Question: Given a binary tree, write a function to get the maximum width of the given tree. Width of a tree is maximum of widths of all levels. For example: __1__ / \ 2 3 / \ \ 4 5 8 / \ 6 7 For the above tree, width of level 1 is 1. width of level 2 is 2. ...
viniciuschiele/solvedit
btree/find_max_width.py
find_max_width.py
py
1,278
python
en
code
0
github-code
1
[ { "api_name": "collections.deque", "line_number": 30, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 51, "usage_type": "name" }, { "api_name": "binarytree.Node", "line_number": 53, "usage_type": "call" }, { "api_name": "binarytree.Node",...
23253320504
from uuid import uuid4 from sqlalchemy.orm import Session from models.model import Student, Course from schemas.student import CreateStudent from bcrypt import hashpw, gensalt def get_students(session: Session): query = session.query(Student).all() return query def get_student_by_id(_id: str, session: Sessi...
samvalvi/school-admin-api
repository/student.py
student.py
py
1,805
python
en
code
1
github-code
1
[ { "api_name": "sqlalchemy.orm.Session", "line_number": 8, "usage_type": "name" }, { "api_name": "models.model.Student", "line_number": 9, "usage_type": "argument" }, { "api_name": "sqlalchemy.orm.Session", "line_number": 13, "usage_type": "name" }, { "api_name": "...
29457232613
import json import os from botocore.vendored import requests # PCE API request call using requests module def pce_request(pce, org_id, key, secret, verb, path, params=None, data=None, json=None, extra_headers=None): base_url = os.path.join(pce, 'orgs', org_id) print(base_url) headers = { ...
illumiolabs/illumio-security-hub-connector
security-hub-quarantine-action/src/lambda_function.py
lambda_function.py
py
4,164
python
en
code
4
github-code
1
[ { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16,...
875275062
import pandas as pd import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages from matplotlib import ticker PATH = "statistics/results" df = pd.read_csv(PATH+'.csv', index_col=0).round(2) timings = [10**i for i in range(2, 6)] fig, ax =plt.subplots(figsize=(4,3)) ax.axis('tight') ax.axis('...
matrs01/Advanced_Cpp_course_4_sem
homework_3/vector_with_sort_vs_set/plot_maker_hw_3.py
plot_maker_hw_3.py
py
996
python
en
code
0
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 11, "usage_type": "name" }, { "api_name": "matplotli...
70018798433
import math from random import random import pytest import numpy as np import pandas as pd from sklearn.ensemble import RandomForestClassifier from starter.ml import model @pytest.fixture def dummy_data(): data_df = pd.DataFrame({ "id": list(range(100)), "numerical_feat": [random()*10...
ympaik87/heroku_fastapi_deployment
starter/starter/test_model.py
test_model.py
py
1,460
python
en
code
0
github-code
1
[ { "api_name": "pandas.DataFrame", "line_number": 12, "usage_type": "call" }, { "api_name": "random.random", "line_number": 14, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 10, "usage_type": "attribute" }, { "api_name": "starter.ml.model.t...
12762645895
import math import pygame from debug import debug from svg.path import parse_path from settings import TILE_SIZE from supports import import_folder from audio import audio_manager class Player(pygame.sprite.Sprite): def __init__(self, pos, groups, obstacle_sprites, camera) -> None: super().__init__(group...
Instelce/FastRoute
player.py
player.py
py
9,344
python
en
code
0
github-code
1
[ { "api_name": "pygame.sprite", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pygame.Surface", "line_number": 18, "usage_type": "call" }, { "api_name": "settings.TILE_SIZE", "line_number": 18, "usage_type": "name" }, { "api_name": "pygame.math.Vect...
73471784993
# F06 - Mengubah stok game def update_stok(role,hasil): if role == 'Admin': id_game = input('Masukkan ID game: ') jumlah = int(input('Masukkan jumlah: ')) for line in hasil: if id_game == line[0]: if (line[5] + jumlah) >= 0: ...
IvanLeovandi/Tugas-Besar-IF1210-Dasar-Pemrograman-2021-2022
Source Code/fungsi tubes.py
fungsi tubes.py
py
3,311
python
id
code
3
github-code
1
[ { "api_name": "datetime.datetime.now", "line_number": 27, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 27, "usage_type": "attribute" } ]
25459941035
import logging import subprocess from telemetry.core import exceptions from telemetry.internal.platform import android_platform_backend as \ android_platform_backend_module from telemetry.core import util from telemetry.internal.backends import android_command_line_backend from telemetry.internal.backends import bro...
hanpfei/chromium-net
third_party/catapult/telemetry/telemetry/internal/backends/chrome/android_browser_backend.py
android_browser_backend.py
py
8,590
python
en
code
289
github-code
1
[ { "api_name": "telemetry.internal.backends.chrome.chrome_browser_backend.ChromeBrowserBackend", "line_number": 17, "usage_type": "attribute" }, { "api_name": "telemetry.internal.backends.chrome.chrome_browser_backend", "line_number": 17, "usage_type": "name" }, { "api_name": "tel...
2408123049
import numpy as np import pytest from numpy import testing as np_testing import pymanopt from . import _backend_tests class TestNumPyBackend: @pytest.fixture(autouse=True) def setup(self): self.n = 10 @pymanopt.function.numpy( _backend_tests.manifold_factory(point_layout=3) ...
pymanopt/pymanopt
tests/backends/test_numpy.py
test_numpy.py
py
1,347
python
en
code
651
github-code
1
[ { "api_name": "numpy.sum", "line_number": 19, "usage_type": "call" }, { "api_name": "pymanopt.function.numpy", "line_number": 15, "usage_type": "call" }, { "api_name": "pymanopt.function", "line_number": 15, "usage_type": "attribute" }, { "api_name": "numpy.sum", ...
6584305006
import copy # To duplicate materials. from PyQt6.QtCore import pyqtSignal, pyqtSlot, QObject, QUrl from PyQt6.QtGui import QDesktopServices from typing import Any, Dict, Optional, TYPE_CHECKING import uuid # To generate new GUIDs for new materials. from UM.Message import Message from UM.i18n import i18nCatalog from ...
Ultimaker/Cura
cura/Machines/Models/MaterialManagementModel.py
MaterialManagementModel.py
py
14,258
python
en
code
5,387
github-code
1
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 18, "usage_type": "name" }, { "api_name": "UM.i18n.i18nCatalog", "line_number": 21, "usage_type": "call" }, { "api_name": "PyQt6.QtCore.QObject", "line_number": 24, "usage_type": "name" }, { "api_name": "PyQt6.Q...
74538549792
import json import os import pathlib from tempfile import TemporaryDirectory from typing import Any, Dict from jsonschema import ValidationError from pep440 import is_canonical from nbformat import __version__ as nbf_version from nbformat import current_nbformat, read, write, writes from nbformat.reader import get_ve...
jupyter/nbformat
tests/test_api.py
test_api.py
py
3,517
python
en
code
226
github-code
1
[ { "api_name": "pep440.is_canonical", "line_number": 19, "usage_type": "call" }, { "api_name": "nbformat.__version__", "line_number": 19, "usage_type": "argument" }, { "api_name": "base.TestsBase", "line_number": 22, "usage_type": "name" }, { "api_name": "nbformat....
74719824672
from django.shortcuts import render,redirect from .forms import * from .models import * from django.contrib.auth.decorators import login_required def gestionarPersonas(request): if request.method == 'POST': persona_form = PersonaForm(request.POST) if persona_form.is_valid(): persona_for...
EvelinSenghaas/Contratos
project/personas/views.py
views.py
py
2,726
python
en
code
0
github-code
1
[ { "api_name": "django.shortcuts.render", "line_number": 17, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 24, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "line_number": 31, "usage_type": "call" }, { "api_nam...
39960784073
import argparse import pandas as pd import os import subprocess parser = argparse.ArgumentParser() parser.add_argument('-csv_path', '--csv_path', default='download_list.csv', help='path of download_list.csv') parser.add_argument('-save_path', '--save_path', default='video/data/', help='dir for saving videos') parser.a...
deepbrainai-research/koeba
download_video.py
download_video.py
py
2,794
python
en
code
30
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "os.mkdir", "li...
31506165264
import warnings from itertools import islice from math import log2, pow, sqrt from copy import copy from PIL import Image, ImageChops from numpy import array, zeros, append from scipy.fftpack import dct, idct from qtar.core.imageqt import ImageQT, ImageQTPM from qtar.core.curvefitting import fit_cfregions, CFRegions,...
Raykeen/qtar-stego
qtar/core/qtar.py
qtar.py
py
17,375
python
en
code
0
github-code
1
[ { "api_name": "math.pow", "line_number": 63, "usage_type": "call" }, { "api_name": "math.log2", "line_number": 63, "usage_type": "call" }, { "api_name": "qtar.core.container.Key", "line_number": 71, "usage_type": "call" }, { "api_name": "qtar.core.container.Contai...
73428982753
import os import PIL import math import numpy as np import pandas as pd import cv2 as cv from PIL import ImageFont from PIL import Image from PIL import ImageDraw if __name__ == '__main__': # 图片文件夹目录 path = "image" files = os.listdir(path) for img_file in files: print(img_file)...
leemengwei/dead_pig_insurance
src/DeadPigImage.py
DeadPigImage.py
py
2,937
python
en
code
0
github-code
1
[ { "api_name": "os.listdir", "line_number": 15, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 19, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 19, "usage_type": "name" }, { "api_name": "PIL.ImageDraw.Draw", "line_nu...
30340835666
from PyQt5 import uic from PyQt5 import QtGui, QtCore from PyQt5.QtWidgets import QMainWindow, QPushButton, QApplication, QTextEdit, QApplication, QDialog def p(x): print (x) class callScript(QDialog): #def __init__(self): # super().__init__() def setupCB(self, akvoData, kernelParams, SaveStr...
LemmaSoftware/akvo
akvo/gui/callScript.py
callScript.py
py
2,344
python
en
code
2
github-code
1
[ { "api_name": "PyQt5.QtWidgets.QDialog", "line_number": 8, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.QProcess", "line_number": 19, "usage_type": "call" }, { "api_name": "PyQt5.QtCore", "line_number": 19, "usage_type": "name" }, { "api_name": "PyQt5.QtCor...
20962586522
from pyspark import SparkContext sc = SparkContext("local[*]", "week9Assignment") sc.setLogLevel("WARN") def check_age(line): fields = line.split(",") if int(fields[1]) > 18: return fields[0], fields[1], fields[2], "Y" else: return fields[0], fields[1], fields[2], "N" base_rdd = sc.text...
Nishant-001/BigData_PySpark
week9assignment.py
week9assignment.py
py
502
python
en
code
0
github-code
1
[ { "api_name": "pyspark.SparkContext", "line_number": 3, "usage_type": "call" } ]
31440311203
import pyspark from pyspark.sql import SparkSession from pyspark.sql.functions import col, asc,desc spark = SparkSession.builder.appName('SparkByExamples.com').getOrCreate() simpleData = [("James","Sales","NY",90000,34,10000), \ ("Michael","Sales","NY",86000,56,20000), \ ("Robert","Sales","CA",81000,30,23000)...
sahil20101993/spark_examples
pivot_df.py
pivot_df.py
py
889
python
en
code
0
github-code
1
[ { "api_name": "pyspark.sql.SparkSession.builder.appName", "line_number": 5, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 5, "usage_type": "attribute" }, { "api_name": "pyspark.sql.SparkSession", "line_number": 5, "usage_type": "...
41287163895
from django.urls import path, re_path, register_converter from .views import * from core.routers import PetuniRouter from .converters import CRMIdConverter app_name = 'crm' register_converter(CRMIdConverter, 'crmid') router = PetuniRouter() urlpatterns = [ path('contact/<crmid:crm_id>/pull/', CRMContactView.as_v...
sdmitrievlolx/code_samples
crm/urls.py
urls.py
py
1,400
python
en
code
0
github-code
1
[ { "api_name": "django.urls.register_converter", "line_number": 8, "usage_type": "call" }, { "api_name": "converters.CRMIdConverter", "line_number": 8, "usage_type": "argument" }, { "api_name": "core.routers.PetuniRouter", "line_number": 9, "usage_type": "call" }, { ...
26854894161
#! /usr/bin/env python """ Optimizer performance comparison """ import os import sys import subprocess from multiprocessing import Pool problems = { 'xray': '../doc/examples/xray/model.py', 'pemu': '../doc/examples/superlattice/PEMU-web.py', } # Aim for evals; assume problem size is 10 root = 'out' nrepe...
reflectometry/refl1d
compareopt/compare.py
compare.py
py
2,024
python
en
code
16
github-code
1
[ { "api_name": "os.path.join", "line_number": 41, "usage_type": "call" }, { "api_name": "os.path", "line_number": 41, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 42, "usage_type": "call" }, { "api_name": "os.path", "line_number":...
26856048171
from setuptools import setup, find_packages from os.path import join import sys version = '2.2.dev0' readme = open("README.rst").read() history = open(join('docs', 'HISTORY.txt')).read() install_requires = ['setuptools', 'gocept.munin', 'Products.ZServerViews>=0.2'] if sys.version_info < (2, 5): install_requires....
RedTurtle/munin.zope
setup.py
setup.py
py
1,759
python
en
code
6
github-code
1
[ { "api_name": "os.path.join", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.version_info", "line_number": 10, "usage_type": "attribute" }, { "api_name": "setuptools.setup", "line_number": 13, "usage_type": "call" }, { "api_name": "setuptools.find_pa...
33159038452
# -*- coding: utf-8 -*- import csv import json import re # Make utility functions available exec(compile(open("util.py", "r").read(), "util.py", 'exec')) #open needed files and copy their content into lists with open('../data/mp/stats/templates.txt', 'r') as file: reader = csv.reader(file, delimiter=',') templates...
kreuvf/fkmod
csv2json/templates.py
templates.py
py
2,156
python
en
code
0
github-code
1
[ { "api_name": "csv.reader", "line_number": 12, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 17, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 88, "usage_type": "call" } ]
38018666023
import torch import torch.nn as nn from networks.layers import ( RecurrentConvolutionalLayer, ConvLayer, Dense ) class SharkRCNN(nn.Module): def __init__(self, num_steps): super(SharkRCNN, self).__init__() self.conv = ConvLayer(1, 32, (7,3), (2,1), (3,1)) self.pool1 = ...
buchholzmd/SharkBehaviorClassification
networks/rcnn.py
rcnn.py
py
1,499
python
en
code
3
github-code
1
[ { "api_name": "torch.nn.Module", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 10, "usage_type": "name" }, { "api_name": "networks.layers.ConvLayer", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.nn.MaxP...
29878128846
from __future__ import print_function, division import pandas as pd import numpy as np # import matplotlib # matplotlib.use('qt4agg') import matplotlib.pyplot as plt from sklearn.preprocessing import MinMaxScaler, minmax_scale def mae(y, prediction): return np.mean(np.abs(y - prediction)) # Read in full data set X...
moosmann/bl
bike.py
bike.py
py
2,710
python
en
code
0
github-code
1
[ { "api_name": "numpy.mean", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.abs", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_numbe...
2628304929
import os from datetime import datetime import re import logging from os.path import join def validate_date_prefix(date_prefix, formats, present): '''Returns True if the string date_prefix is a valid date, given the list of formats and if the date is smaller than the given present date. ''' for forma...
tamiryspino/orderPhotos
src/rename_file.py
rename_file.py
py
6,354
python
en
code
1
github-code
1
[ { "api_name": "datetime.datetime.strptime", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 15, "usage_type": "name" }, { "api_name": "logging.info", "line_number": 19, "usage_type": "call" }, { "api_name": "re.match", ...
12981297349
#!/usr/bin/env python # Import PyGame library import pygame import adapter import MD3Buttons import RetroflagSnes import ArduinoMicro from actions import * import logger controllers = { MD3Buttons, RetroflagSnes, ArduinoMicro, } pad = {} joysticks = {} currentGuid = "" currentAdapter = -1 def pressButton(btn): ...
Pilou44/UsbToConsole
code/gamepad.py
gamepad.py
py
4,184
python
en
code
0
github-code
1
[ { "api_name": "logger.debug", "line_number": 23, "usage_type": "call" }, { "api_name": "adapter.pressButton", "line_number": 25, "usage_type": "call" }, { "api_name": "logger.debug", "line_number": 27, "usage_type": "call" }, { "api_name": "logger.debug", "lin...
15053848115
from django.contrib import admin from django.urls import path, include from .views import register_view, login_view, index, profile_view, oikawakuroo urlpatterns = [ path('home/', index, name='home'), path('register/', register_view, name='register'), path('login/', login_view, name='login'), path('pro...
KamiliyaOikawa/Lending
user/urls.py
urls.py
py
421
python
en
code
0
github-code
1
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "views.index", "line_number": 6, "usage_type": "argument" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "views.register_view", ...
34506238695
import cocotb from cocotb.triggers import Timer, RisingEdge, FallingEdge, ClockCycles from cocotb.result import TestFailure from cocotb.clock import Clock from cocotb.binary import BinaryValue from cocotb.scoreboard import Scoreboard from cocotb.monitors import Monitor from cocotb.regression import TestFactory from coc...
Alberto12MC/Modules
tb/Zybo_Example/cocotb/Zybo_Example_tb.py
Zybo_Example_tb.py
py
6,898
python
en
code
3
github-code
1
[ { "api_name": "cocotb.monitors.Monitor", "line_number": 31, "usage_type": "name" }, { "api_name": "cocotb.monitors.Monitor.__init__", "line_number": 37, "usage_type": "call" }, { "api_name": "cocotb.monitors.Monitor", "line_number": 37, "usage_type": "name" }, { "...
39586354908
# fixtures are functions that are run by the pytest before the actual test functions # eg= setup database connection, initialize webdriver import pytest # define fixtures function (parent method) @pytest.fixture() def setup_list(): print("\n in fixtures..\n") # city2 = ["new york", "london", "mumbai"] city...
kasthuridinesh/pythonprojects
pytest/parallel_test/udemy/test_fixtures01.py
test_fixtures01.py
py
606
python
en
code
0
github-code
1
[ { "api_name": "pytest.fixture", "line_number": 7, "usage_type": "call" } ]
72615318755
import functools from keras.layers import * from keras.models import Model from keras.wrappers.scikit_learn import KerasClassifier from keras.regularizers import l2 from keras.optimizers import SGD import numpy as np import pandas as pd import tensorflow as tf import os import pickle import plac from rectified_adam i...
csvance/uthealth-ri
run.py
run.py
py
8,731
python
en
code
0
github-code
1
[ { "api_name": "rectified_adam.RectifiedAdam", "line_number": 22, "usage_type": "call" }, { "api_name": "tensorflow.config.experimental.list_physical_devices", "line_number": 29, "usage_type": "call" }, { "api_name": "tensorflow.config", "line_number": 29, "usage_type": "a...
28558005881
from django import forms from django.forms import ValidationError from pgweb.core.models import Organisation from .models import Event class EventForm(forms.ModelForm): form_intro = 'Before submitting an event, please read the <a href="/about/policies/news-and-events/">current policy</a> for News and Events' ...
postgres/pgweb
pgweb/events/forms.py
forms.py
py
2,439
python
en
code
66
github-code
1
[ { "api_name": "django.forms.ModelForm", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 8, "usage_type": "name" }, { "api_name": "pgweb.core.models.Organisation.objects.filter", "line_number": 25, "usage_type": "call" }, { ...
25422528336
import urllib.request import json import dml import prov.model import datetime import uuid class trans_school(dml.Algorithm): contributor = 'kobesay' reads = ['kobesay.publicschool', 'kobesay.nonpublicschool'] writes = ['kobesay.regionschool', 'kobesay.regionpublicschool', 'kobesay.regionnonpublicschool'] ...
data-mechanics/course-2017-spr-proj
kobesay/trans_school.py
trans_school.py
py
6,680
python
en
code
0
github-code
1
[ { "api_name": "dml.Algorithm", "line_number": 8, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 16, "usage_type": "attribute" }, { "api_name": "dml.py...
17288175559
""" Handling mouse events in pygame Drag and drop an image """ import pygame BLACK = 0, 0, 0 WHITE = 255, 255, 255 RED = 255, 0, 0 GREEN = 0, 255, 0 BLUE = 0, 0, 255 pygame.init() canvas = pygame.display.set_mode((500, 600)) people = pygame.image.load('assets/people.png') # Start with image at 0, 0 people_rect...
Apress/game-development-with-pygame
p45b_mouse_events.py
p45b_mouse_events.py
py
1,361
python
en
code
2
github-code
1
[ { "api_name": "pygame.init", "line_number": 17, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 18, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 18, "usage_type": "attribute" }, { "api_name": "pygame.image....
8197675549
""" Problem Set 3 """ def pretty_print_fwd(fwd_struct): """ Arma cuadro para visualizar una estructura forward. Parámetros: fwd_struct : Estructura de tasas forward """ for t, fwds in fwd_struct.items(): fwds_txt = ', '.join(f'{tt:3}: {r:6.2%}' for tt, r in fwds.items()) pr...
FedericoMenendez22/pythonFinanzas
clases/ps3.py
ps3.py
py
530
python
en
code
0
github-code
1
[ { "api_name": "json.loads", "line_number": 20, "usage_type": "call" } ]
32072889087
from factsumm import FactSumm import jsonlines factsumm = FactSumm() with jsonlines.open('/home/tiezheng/workspace/FidSum/data/qmsum/processed_data_no_sent_split/test.jsonl') as F: article = [] target = [] for item in F: article.append(item['src']) target.append(item['tgt']) with open('sr...
TysonYu/KA-QFMS
src/utls/hallucination.py
hallucination.py
py
1,434
python
en
code
0
github-code
1
[ { "api_name": "factsumm.FactSumm", "line_number": 4, "usage_type": "call" }, { "api_name": "jsonlines.open", "line_number": 6, "usage_type": "call" } ]
40357222820
import ssl from telnetlib import * from telnetlib.option import TelnetOption class TelnetOptionAuthentication( TelnetOption ): """ RFC 2941, Telnet Authentication Option """ AUTH_TYPE_NULL = chr( 0 ) AUTH_TYPE_KERBEROS_V4 = chr( 1 ) AUTH_TYPE_KERBEROS_V5 = chr( 2 ) AUTH_TYP...
pe2mbs/pytelnet
telnetlib/option/authentication.py
authentication.py
py
3,701
python
en
code
0
github-code
1
[ { "api_name": "telnetlib.option.TelnetOption", "line_number": 5, "usage_type": "name" }, { "api_name": "ssl.wrap_socket", "line_number": 62, "usage_type": "call" }, { "api_name": "ssl.PROTOCOL_SSLv23", "line_number": 65, "usage_type": "attribute" }, { "api_name": ...
12348014771
import abc from typing import TYPE_CHECKING from ml_deeco.estimators import Estimate if TYPE_CHECKING: from ml_deeco.simulation import Experiment class ComponentMeta(abc.ABCMeta): """ Metaclass for Component. Uses a counter to automatically generate the component ID. """ def __new__(mcs, name, ...
smartarch/ML-DEECo
ml_deeco/simulation/components.py
components.py
py
2,001
python
en
code
0
github-code
1
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 6, "usage_type": "name" }, { "api_name": "abc.ABCMeta", "line_number": 10, "usage_type": "attribute" }, { "api_name": "ml_deeco.estimators.Estimate", "line_number": 49, "usage_type": "argument" }, { "api_name": ...
622186416
import torch.nn as nn import torch resl_to_ch = { 4 : (512, 512), 8 : (512, 512), 16 : (512, 512), 32 : (512, 512), 64 : (512, 256), 128 : (256, 128), 256 : (128, 64), 512 : (64, 32), 1024 : (32, 16), } resl_to_batch = { 4 : 512, 8 : 512, 16 : 512...
blacknwhite5/privacy-preserving-v2
models/pg_network.py
pg_network.py
py
4,274
python
en
code
0
github-code
1
[ { "api_name": "torch.nn.Module", "line_number": 40, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 40, "usage_type": "name" }, { "api_name": "torch.nn.init.kaiming_normal_", "line_number": 44, "usage_type": "call" }, { "api_name": "torch.nn....
23007266288
""" Created on 7 Apr 2018 @author: john.dwan ELEVATION PROFILE APP GENERATOR ideagora geomatics-2018 http://geodose.com """ import json from math import asin, cos, radians, sin, sqrt import urllib.request import matplotlib.pyplot as plt from shapely.geometry import LineString from siteline import config def have...
John-Dwan/siteline
siteline/open_elevation_profile.py
open_elevation_profile.py
py
4,101
python
en
code
0
github-code
1
[ { "api_name": "math.radians", "line_number": 27, "usage_type": "call" }, { "api_name": "math.radians", "line_number": 28, "usage_type": "call" }, { "api_name": "math.radians", "line_number": 29, "usage_type": "call" }, { "api_name": "math.radians", "line_numbe...
12497368956
"""Common methods and classes used for mesh client""" from collections import namedtuple import os import json import boto3 REGION_NAME = os.environ.get("AWS_REGION", "eu-west-2") class SingletonCheckFailure(Exception): """Singleton check failed""" def __init__(self, msg=None): super().__init__() ...
NHSDigital/spine-core-aws-common
mesh_aws_client/mesh_common.py
mesh_common.py
py
4,776
python
en
code
11
github-code
1
[ { "api_name": "os.environ.get", "line_number": 7, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 7, "usage_type": "attribute" }, { "api_name": "boto3.client", "line_number": 35, "usage_type": "call" }, { "api_name": "json.loads", "line_numb...
39999778314
import numpy as np import cv2 import time from framecounter import FrameCounter fcount = FrameCounter() cv2.startWindowThread() # cap = cv2.VideoCapture('walking.mp4') cap = cv2.VideoCapture(0) i = 0 while(True): i+=1 ret, frame = cap.read() fcount.start() frame = cv2.resize(frame,(640,360)) #fr...
cbernet/maldives
opencv/video_in.py
video_in.py
py
817
python
en
code
3
github-code
1
[ { "api_name": "framecounter.FrameCounter", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.startWindowThread", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.re...
38981554044
import numpy as np import pandas as pd import matplotlib.pyplot as plt import math import re import random import collections from scipy import stats import jieba import jieba.posseg as pseg import wordcloud from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.decomposition import Trun...
restart2013/biliTechVideo
analyse.py
analyse.py
py
12,912
python
en
code
2
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 18, "usage_type": "call" }, { "api_name": "re.search", "line_number": 30, "usage_type": "call" }, { "api_name": "re.search", "line_number": 40, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 44, ...
72486000035
from django.conf.urls.defaults import * from django.contrib.auth.views import login, logout_then_login from dpro.bilet.views import * #index, doldur, listele, csvdeneme, degistir, urlpatterns = patterns( '', (r'^bilet/admin/', include('django.contrib.admin.urls')), (r'^bilet/login/$', login, {'template...
zekzekus/dpro
urls.py
urls.py
py
695
python
en
code
1
github-code
1
[ { "api_name": "django.contrib.auth.views.login", "line_number": 8, "usage_type": "name" }, { "api_name": "django.contrib.auth.views.logout_then_login", "line_number": 9, "usage_type": "name" } ]
9351150330
from workers.serializers import * from workers.models import * from projects.models import * from rest_framework import viewsets, permissions, status from rest_framework.response import Response from rest_framework.views import APIView from django.db.models import Q from django.db.models import Prefetch import datetime...
Nikola-code/Portfolio
BonaAkademia/projekt-main/app/workers/views.py
views.py
py
11,140
python
en
code
0
github-code
1
[ { "api_name": "rest_framework.viewsets.ModelViewSet", "line_number": 16, "usage_type": "attribute" }, { "api_name": "rest_framework.viewsets", "line_number": 16, "usage_type": "name" }, { "api_name": "rest_framework.permissions.AllowAny", "line_number": 19, "usage_type": ...
16083859777
def run(model): import pandas as pd n_rows = None print("____ Loading Data") x_train = pd.read_csv('csv/traffic/x_train.csv', nrows=n_rows) x_test = pd.read_csv('csv/traffic/x_test.csv', nrows=n_rows) y_train = pd.read_csv('csv/traffic/y_train.csv', nrows=n_rows) y_test = pd.read_csv('csv/traffic/y_test.csv',...
arthurpiazzi/Traffic-Flow
teste.py
teste.py
py
2,827
python
en
code
1
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.read_csv", "...
42231125149
import random import pytz import json from django.dispatch import receiver from django.db.models.signals import pre_save from django_celery_beat.models import CrontabSchedule, PeriodicTask from .models import Agent days = { "sun": 0, "mon": 1, "tue": 2, "wed": 3, "thu": 4, "fri": 5, "sat...
wh1te909/backup-offsite
offsite/core/signals.py
signals.py
py
2,265
python
en
code
11
github-code
1
[ { "api_name": "models.Agent", "line_number": 24, "usage_type": "name" }, { "api_name": "django_celery_beat.models.PeriodicTask.objects.filter", "line_number": 38, "usage_type": "call" }, { "api_name": "django_celery_beat.models.PeriodicTask.objects", "line_number": 38, "u...
17553648881
import os import argparse import json from pypdf import PdfReader import openai API_KYE = os.environ['OPENAI_API_KEY'] openai.api_key = API_KYE def summarize_file(path): reader = PdfReader(path) number_of_pages = len(reader.pages) page = reader.pages[0] text = page.extract_text() messages=[ ...
xzymustbexzy/summarizer
src/main.py
main.py
py
857
python
en
code
1
github-code
1
[ { "api_name": "os.environ", "line_number": 8, "usage_type": "attribute" }, { "api_name": "openai.api_key", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pypdf.PdfReader", "line_number": 13, "usage_type": "call" }, { "api_name": "openai.ChatCompleti...
11494310897
import inspect import os import numpy as np import pickle import regex import tensorflow as tf from tensorflow import keras from transformers import BertConfig, TFBertMainLayer from .utils import found_package import transformers import tensorflow_addons as tfa from .utils import iobes_iob, parse_lr_method from .con...
CederGroupHub/MatEntityRecognition
materials_entity_recognition/scripts/model_framework.py
model_framework.py
py
34,451
python
en
code
1
github-code
1
[ { "api_name": "tensorflow.keras.Model", "line_number": 28, "usage_type": "attribute" }, { "api_name": "tensorflow.keras", "line_number": 28, "usage_type": "name" }, { "api_name": "os.path.abspath", "line_number": 88, "usage_type": "call" }, { "api_name": "os.path"...
11207901318
""" End to end test of video timelines. """ import datetime import logging from edx.analytics.tasks.tests.acceptance import AcceptanceTestCase log = logging.getLogger(__name__) class VideoAcceptanceTest(AcceptanceTestCase): """End to end test of video timelines.""" INPUT_FILE = 'video_timeline.log' d...
openedx/edx-analytics-pipeline
edx/analytics/tasks/tests/acceptance/test_video.py
test_video.py
py
3,956
python
en
code
90
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "edx.analytics.tasks.tests.acceptance.AcceptanceTestCase", "line_number": 13, "usage_type": "name" }, { "api_name": "datetime.date", "line_number": 19, "usage_type": "call" } ]
31008119657
from math import inf from collections import deque from tracemalloc import start def dijkstra(wmat, start, end=-1): n = len(wmat) dist = [inf] * n dist[start] = wmat[start][start] # 0 spVertex = [False] * n parent = [-1] * n path = [{}] * n for count in range(n - 1): minix = i...
kmlutkmtll/discreteMath
graph2.py
graph2.py
py
4,325
python
en
code
0
github-code
1
[ { "api_name": "math.inf", "line_number": 9, "usage_type": "name" }, { "api_name": "tracemalloc.start", "line_number": 10, "usage_type": "name" }, { "api_name": "math.inf", "line_number": 18, "usage_type": "name" }, { "api_name": "tracemalloc.start", "line_numb...
28940574898
import PyPDF2 #translate the pdf file to txt file def pdf_to_text(pdf_file_path, txt_file_path): try: # Open the PDF file with open(pdf_file_path, 'rb') as pdf_file: pdf_reader = PyPDF2.PdfReader(pdf_file) # Initialize an empty text string text = "" ...
evanJensengit/finance_helper
pdf_to_txt.py
pdf_to_txt.py
py
1,096
python
en
code
0
github-code
1
[ { "api_name": "PyPDF2.PdfReader", "line_number": 8, "usage_type": "call" } ]
42482303901
import graphene from graphene import Field from graphene_django.types import ErrorType from graphene.types.base import BaseOptions from django.core.exceptions import ObjectDoesNotExist class DeleteMutationOptions(BaseOptions): model = None arguments = None output = None resolver = None interface...
JiaWeiXie/django-project-template
project-name/src/app/utils/graphql/mutation.py
mutation.py
py
2,807
python
en
code
0
github-code
1
[ { "api_name": "graphene.types.base.BaseOptions", "line_number": 10, "usage_type": "name" }, { "api_name": "graphene.Mutation", "line_number": 19, "usage_type": "attribute" }, { "api_name": "graphene.ID", "line_number": 22, "usage_type": "call" }, { "api_name": "gr...
31932909558
from flask import Flask, render_template , Response import cv2 , os import argparse app = Flask(__name__) app.config['SECRET_KEY'] = '1234' @app.route('/') #html 보여준다. def index(): return render_template('index.html') @app.route('/video_show') def video_show(): return Response(yield_video(), mimetype= "multi...
amo33/taskprojects
yieldvideo/videoyield.py
videoyield.py
py
1,512
python
en
code
0
github-code
1
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.Response", "line_number": 14, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", ...
7419480168
""" HSC Datasets """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from . import hsc_utils from . import astroimage_utils from tensor2tensor.data_generators import generator_utils from tensor2tensor.data_generators import image_utils from tensor2tensor.d...
ml4astro/galaxy2galaxy
galaxy2galaxy/data_generators/hsc.py
hsc.py
py
8,144
python
en
code
27
github-code
1
[ { "api_name": "os.path.join", "line_number": 31, "usage_type": "call" }, { "api_name": "os.path", "line_number": 31, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 31, "usage_type": "call" }, { "api_name": "os.path.realpath", "lin...
35072935714
from kivy.uix.screenmanager import Screen from kivy.lang import Builder from kivy.uix.boxlayout import BoxLayout from kivy.properties import StringProperty from kivy.utils import platform from kivymd.uix.dialog import MDDialog from kivymd.uix.button import MDFlatButton from kivymd.uix.filemanager import MDFileManager ...
wasimafser/DataShare
screens/send.py
send.py
py
3,650
python
en
code
2
github-code
1
[ { "api_name": "kivy.lang.Builder.load_string", "line_number": 15, "usage_type": "call" }, { "api_name": "kivy.lang.Builder", "line_number": 15, "usage_type": "name" }, { "api_name": "socket.socket", "line_number": 48, "usage_type": "call" }, { "api_name": "socket....
40586297846
# -*- coding: utf-8 -*- """ Created on Fri Oct 29 18:16:02 2021 @author: Park Ihn """ import json from collections import OrderedDict import csv from datetime import datetime import re from turtle import Turtle #input file open inputCsv = open("KIKmix.20220401(말소코드포함).csv","r",encoding="cp949") rd = csv.reader(inputCs...
YangHong-bin/visual_code
py_요기요 코드/test.py
test.py
py
3,713
python
ko
code
0
github-code
1
[ { "api_name": "csv.reader", "line_number": 15, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 35, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 62, "usage_type": "call" }, { "api_name": "re.search"...
22876010422
import socket import select import errno from select import POLLIN, POLLOUT, POLLERR, POLLHUP, POLLNVAL from ccstruct import * from collections import deque # define channel types CH_TYPE_PIPE = 0 CH_TYPE_TCP = 1 CH_TYPE_UDP_S = 2 # send-only UDP CH_TYPE_UDP_R = 3 # recv-only UDP # define channel state CH_STATE_NO...
yeliqseu/ccfd-python
channel.py
channel.py
py
10,849
python
en
code
5
github-code
1
[ { "api_name": "select.POLLIN", "line_number": 19, "usage_type": "name" }, { "api_name": "select.POLLOUT", "line_number": 20, "usage_type": "name" }, { "api_name": "select.POLLERR", "line_number": 21, "usage_type": "name" }, { "api_name": "collections.deque", "...
15978928257
import math import numpy as np import torch from PIL import Image class BackDoorAttack(): @staticmethod def make_attack(train_x, train_y, args): """ Makes a backdoored dataset, following Gu et al. https://arxiv.org/abs/1708.06733 train_x: clean training features - must be shape (n_sa...
andrewyguo/auditing
attacks/backdoor.py
backdoor.py
py
2,198
python
en
code
1
github-code
1
[ { "api_name": "numpy.random.choice", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 23, "usage_type": "attribute" }, { "api_name": "numpy.copy", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.eye", "lin...
31904462804
# sc_logger.py import logging class XBLogger: def __init__(self): log = logging.getLogger('log') log.setLevel(logging.DEBUG) # setup file handler & formatter ch = logging.FileHandler(filename='log/scorpius.log', mode='w') # setup output string # format_s = '%(lev...
xavibenavent/scorpius
src/sc_logger.py
sc_logger.py
py
702
python
en
code
0
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 9, "usage_type": "attribute" }, { "api_name": "logging.FileHandler", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.Format...
25461318315
import unittest from collections import namedtuple from telemetry.internal.results import page_test_results from telemetry.page import page from telemetry.web_perf.metrics import single_event from telemetry.web_perf import timeline_interaction_record TRACE_EVENT_NAME = 'FrameView::performLayout' METRIC_NAME = 'layout...
hanpfei/chromium-net
third_party/catapult/telemetry/telemetry/web_perf/metrics/single_event_unittest.py
single_event_unittest.py
py
2,972
python
en
code
289
github-code
1
[ { "api_name": "collections.namedtuple", "line_number": 11, "usage_type": "call" }, { "api_name": "telemetry.web_perf.timeline_interaction_record.TimelineInteractionRecord", "line_number": 14, "usage_type": "attribute" }, { "api_name": "telemetry.web_perf.timeline_interaction_reco...
38487802023
import os import json import sys def pr(matrix): for r in matrix: print(r) path = os.path.dirname(os.path.abspath(__file__)) inputname = sys.argv[1] if len(sys.argv) > 1 else os.path.join(path, "input.txt") with open(os.environ.get("AOC_INPUT", inputname), "r") as f: INPUT = f.read().split("\n") ...
pting/aoc2022
day08/day08.py
day08.py
py
2,153
python
en
code
0
github-code
1
[ { "api_name": "os.path.dirname", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.argv", "line_num...
11724373152
from app import app from flask import render_template, request from bs4 import BeautifulSoup from app.forms import GetPageForm import requests import string def get_page_controller(): form = GetPageForm() page_url = form.url.data page = requests.get(page_url) soup = BeautifulSoup(page.text, 'html.parser') ...
kellybarber/python-scraper
app/controllers/get_page_controller.py
get_page_controller.py
py
789
python
en
code
0
github-code
1
[ { "api_name": "app.forms.GetPageForm", "line_number": 10, "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": "string.punctuati...
70511358435
from nio import Block from nio.util.discovery import not_discoverable from nio.testing.block_test_case import NIOBlockTestCase from ...multiple import MultipleSignals from ...generators.counter import CounterGenerator @not_discoverable class SampleCounterBlock(CounterGenerator, Block): pass @not_discoverable c...
nio-blocks/simulator
tests/generators/test_counter.py
test_counter.py
py
3,075
python
en
code
1
github-code
1
[ { "api_name": "generators.counter.CounterGenerator", "line_number": 10, "usage_type": "name" }, { "api_name": "nio.Block", "line_number": 10, "usage_type": "name" }, { "api_name": "nio.util.discovery.not_discoverable", "line_number": 9, "usage_type": "name" }, { "...