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
17813388652
from typing import Callable, Any, Type from lyrid import Address from lyrid.base import ActorSystemBase from lyrid.core.node import NodeSpawnProcessMessage from lyrid.core.process import Process from lyrid.core.system import Placement from tests.factory.system import create_actor_system from tests.mock.messenger impor...
SSripilaipong/lyrid
tests/system/actor_placement/_assertion.py
_assertion.py
py
3,625
python
en
code
12
github-code
6
[ { "api_name": "typing.Callable", "line_number": 14, "usage_type": "name" }, { "api_name": "lyrid.base.ActorSystemBase", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.Type", ...
15484480802
#!/usr/bin/env python from __future__ import print_function import sys import os if sys.version_info >= (3, 0): import tkinter else: import Tkinter as tkinter import interaction import canvas import FigureManager # The size of the button (width, height) for buttons in root gui. SIZE_BUTTON = (18, 4) def ...
t-lou/pytena
main.py
main.py
py
1,537
python
en
code
0
github-code
6
[ { "api_name": "sys.version_info", "line_number": 8, "usage_type": "attribute" }, { "api_name": "interaction.find_pmg", "line_number": 24, "usage_type": "call" }, { "api_name": "FigureManager.g_figure_manager.add_pmg", "line_number": 26, "usage_type": "call" }, { "...
21138659052
from neo4j import GraphDatabase # neo4j connection driver = GraphDatabase.driver("bolt://127.0.0.1:7687", auth=("neo4j", "neo4j")) # random walk k = 10 # Number of neighbors pre_weight = 2 # Weight of return n = -1 # number of users to use, -1 means using all the users. batch_size = 1000 # batchsize to save cores...
RManLuo/MotifGNN
src_sjjy/pipline_config.py
pipline_config.py
py
3,021
python
en
code
7
github-code
6
[ { "api_name": "neo4j.GraphDatabase.driver", "line_number": 4, "usage_type": "call" }, { "api_name": "neo4j.GraphDatabase", "line_number": 4, "usage_type": "name" } ]
1004121962
from flask import Flask, render_template, request import pypandoc app = Flask(__name__) @app.route('/') def home(): return render_template('index.html') @app.route('/convert', methods=['POST']) def convert(): input_markup = request.form['input_markup'] output_markup = pypandoc.convert(input_markup, format='...
myw/wiki-converter
converter.py
converter.py
py
552
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.request.form", "line_number": 15, "usage_type": "attribute" }, { "api_name": "flask.reques...
18015924174
import cv2 import sys import PyQt5.QtCore as QtCore from PyQt5.QtCore import QTimer # Import QTimer from PyQt5 from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QVBoxLayout, QLabel, QFileDialog, QInputDialog from PyQt5.QtGui import QImage, QPixmap class TrackingApp(QWidget): def __init__(self): ...
kio7/smart_tech
Submission 2/Task_6/trackingGUI.py
trackingGUI.py
py
3,282
python
en
code
0
github-code
6
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 8, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.QTimer", "line_number": 15, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QLabel", "line_number": 22, "usage_type": "call" }, { "api_name": "PyQ...
21998531046
from collections import Counter class Solution: def minWindow(self, s: str, t: str) -> str: s_len = len(s) t_len = len(t) begin = 0 win_freq = {} t_freq = dict(Counter(t)) min_len = s_len + 1 distance = 0 left = 0 right = 0 while rig...
hangwudy/leetcode
1-99/76. 最小覆盖子串.py
76. 最小覆盖子串.py
py
1,359
python
en
code
0
github-code
6
[ { "api_name": "collections.Counter", "line_number": 10, "usage_type": "call" } ]
8068261091
from torchvision.models.detection import maskrcnn_resnet50_fpn from rigl_torch.models import ModelFactory @ModelFactory.register_model_loader(model="maskrcnn", dataset="coco") def get_maskrcnn(*args, **kwargs): return maskrcnn_resnet50_fpn( weights=None, weights_backbone=None, trainable_backbone_layers=5...
calgaryml/condensed-sparsity
src/rigl_torch/models/maskrcnn.py
maskrcnn.py
py
400
python
en
code
10
github-code
6
[ { "api_name": "torchvision.models.detection.maskrcnn_resnet50_fpn", "line_number": 8, "usage_type": "call" }, { "api_name": "rigl_torch.models.ModelFactory.register_model_loader", "line_number": 6, "usage_type": "call" }, { "api_name": "rigl_torch.models.ModelFactory", "line_...
21437122618
import kivy from kivy.app import App from kivy.uix.label import Label # 2 from kivymd.app import MDApp from kivymd.uix.label import MDLabel from kivymd.uix.screen import Screen kivy.require('2.1.0') class MyFirstApp(App): def build(self): # lbl = Label(text='Hello World') # lbl = Label(text='Hel...
gonzales54/python_script
kivy/kivy1(text)/main1.py
main1.py
py
2,528
python
ja
code
0
github-code
6
[ { "api_name": "kivy.require", "line_number": 10, "usage_type": "call" }, { "api_name": "kivy.app.App", "line_number": 13, "usage_type": "name" }, { "api_name": "kivy.uix.label.Label", "line_number": 17, "usage_type": "call" }, { "api_name": "kivymd.app.MDApp", ...
36636572184
import random import pyxel import utils import stage TYPE_AGGRESSIVE = 0 TYPE_MILD = 1 TYPE_RANDOM_SLOW = 2 TYPE_RANDOM_FAST = 3 TYPES = [ TYPE_AGGRESSIVE, TYPE_MILD, TYPE_RANDOM_SLOW, TYPE_RANDOM_FAST ] TICKS_PER_FRAME = 10 MAX_FRAME = 4 MAX_SPEED = 0.4 MAX_RESPAWN_TICKS = 300 # 5 secs class Sp...
helpcomputer/megaball
megaball/spinner.py
spinner.py
py
4,317
python
en
code
7
github-code
6
[ { "api_name": "random.choice", "line_number": 35, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 36, "usage_type": "call" }, { "api_name": "stage.SPAWN_SECTOR_TOPLEFT", "line_number": 52, "usage_type": "attribute" }, { "api_name": "stage.SPA...
46046574096
#!/usr/bin/env python # -*- coding: utf-8 -*- import os from setuptools import setup README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read() REQUIREMENTS = open(os.path.join(os.path.dirname(__file__), 'requirements.txt')).read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os...
nitely/django-hooks
setup.py
setup.py
py
1,303
python
en
code
16
github-code
6
[ { "api_name": "os.path.join", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.join", "line_numbe...
37304550340
import pyrealsense2 as rs import numpy as np import cv2 WIDTH = 640 HEIGHT = 480 FPS = 30 # file name which you want to open FILE = './data/stairs.bag' def main(): # stream(Depth/Color) setting config = rs.config() config.enable_stream(rs.stream.color, WIDTH, HEIGHT, rs.format.rgb8, FPS) config.enabl...
masachika-kamada/realsense-matome
play_bagfile.py
play_bagfile.py
py
1,686
python
en
code
0
github-code
6
[ { "api_name": "pyrealsense2.config", "line_number": 14, "usage_type": "call" }, { "api_name": "pyrealsense2.stream", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pyrealsense2.format", "line_number": 15, "usage_type": "attribute" }, { "api_name": ...
1282652745
import datetime import pandas as pd from tqdm import tqdm from emailer import Emailer from shipping import Shipping from shipstation import Shipstation def main(): # Instantiate objects to be used throughout the script shipstation = Shipstation() shipping = Shipping() # Get all shipment information ...
mattgrcia/review-booster
main.py
main.py
py
4,870
python
en
code
0
github-code
6
[ { "api_name": "shipstation.Shipstation", "line_number": 12, "usage_type": "call" }, { "api_name": "shipping.Shipping", "line_number": 13, "usage_type": "call" }, { "api_name": "shipstation.get_shipments", "line_number": 17, "usage_type": "call" }, { "api_name": "t...
26333498275
# Face detection is done using classifier # classifier is an algorithm that decides wherether a face is present or not # classifier need to be trained images thousands of with and without the faces. # Opencv have pretrained classifier called haarcascade, localbinary pattern. import cv2 as cv img = cv.imread('Ima...
JinalSinroja/OpenCV
Face_Detection.py
Face_Detection.py
py
1,299
python
en
code
0
github-code
6
[ { "api_name": "cv2.imread", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_numbe...
19399743449
from typing import List import collections class Solution: def combine(self, n: int, k: int) -> List[List[int]]: q = collections.deque() for i in range(1, n + 1): q.append([i]) while q: e = q.popleft() if len(e) == k: q.appendleft(e) ...
Yigang0622/LeetCode
combine.py
combine.py
py
576
python
en
code
1
github-code
6
[ { "api_name": "collections.deque", "line_number": 8, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 6, "usage_type": "name" } ]
69986222269
from django.db import models from django.contrib.auth.models import AbstractUser from django.contrib.auth import get_user_model class CustomUser(AbstractUser): phone = models.CharField(max_length=13, blank=True, null=True) bonus_coin = models.IntegerField(default=0) class NameIt(models.Model): name = mo...
Pdnky/MySite
FoodDelivery/core/models.py
models.py
py
1,427
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.auth.models.AbstractUser", "line_number": 6, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 7, "usage_type": "call" }, { "api_name": "django.db.models", "line_number": 7, "usage_type": "name" }, { "...
10420612333
from __future__ import annotations from typing import TYPE_CHECKING from randovania.exporter.hints import guaranteed_item_hint from randovania.exporter.hints.hint_exporter import HintExporter from randovania.exporter.hints.joke_hints import JOKE_HINTS from randovania.game_description.db.hint_node import HintNode from...
randovania/randovania
randovania/games/prime2/exporter/hints.py
hints.py
py
4,216
python
en
code
165
github-code
6
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 12, "usage_type": "name" }, { "api_name": "randovania.game_description.game_patches.GamePatches", "line_number": 32, "usage_type": "name" }, { "api_name": "randovania.interface_common.players_configuration.PlayersConfiguration"...
2544504801
import cv2 import numpy as np ###Color detection def empty(a): pass def stackImages(scale,imgArray): rows = len(imgArray) cols = len(imgArray[0]) rowsAvailable = isinstance(imgArray[0], list) width = imgArray[0][0].shape[1] height = imgArray[0][0].shape[0] if rowsAvailable: for x ...
monsterpit/openCVDemo
Resources/chapter7.py
chapter7.py
py
3,458
python
en
code
0
github-code
6
[ { "api_name": "cv2.resize", "line_number": 19, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 21, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 22, "usage_type": "call" }, { "api_name": "cv2.COLOR_GRAY2BGR", "line_num...
28156175074
import argparse import sys from pathlib import Path from typing import List import numpy as np import torch from thre3d_atom.modules.volumetric_model.volumetric_model import ( VolumetricModel, VolumetricModelRenderingParameters, ) from thre3d_atom.rendering.volumetric.voxels import ( GridLocation, Fea...
akanimax/3inGAN
projects/thre3ingan/experimental/create_vol_mod_from_npy.py
create_vol_mod_from_npy.py
py
2,878
python
en
code
3
github-code
6
[ { "api_name": "typing.List", "line_number": 24, "usage_type": "name" }, { "api_name": "argparse.ArgumentParser", "line_number": 25, "usage_type": "call" }, { "api_name": "argparse.ArgumentDefaultsHelpFormatter", "line_number": 27, "usage_type": "attribute" }, { "a...
1466500793
from dataclasses import dataclass, field from src.shared.general_functions import sum_all_initialized_int_attributes @dataclass class ShareholdersEquity: """Shareholders' equity is the amount that the owners of a company have invested in their business. This includes the money they've directly invested and t...
hakunaprojects/stock-investing
src/domain/financial_statements/balance_sheet_statement/shareholders_equity.py
shareholders_equity.py
py
785
python
en
code
0
github-code
6
[ { "api_name": "dataclasses.field", "line_number": 18, "usage_type": "call" }, { "api_name": "src.shared.general_functions.sum_all_initialized_int_attributes", "line_number": 21, "usage_type": "call" }, { "api_name": "dataclasses.dataclass", "line_number": 6, "usage_type":...
11120994067
import logging import typing as tp from collections import deque from librarius.domain.messages import ( AbstractMessage, AbstractEvent, AbstractCommand, AbstractQuery, ) from librarius.service.uow import AbstractUnitOfWork from librarius.domain.exceptions import SkipMessage logger = logging.getLogger(...
adriangabura/vega
librarius/service/message_bus.py
message_bus.py
py
2,802
python
en
code
1
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "librarius.service.uow.AbstractUnitOfWork", "line_number": 19, "usage_type": "name" }, { "api_name": "typing.Type", "line_number": 20, "usage_type": "attribute" }, { "api_n...
11324258537
import pygame from random import randint from pygame.locals import * pygame.init() display_widht = 600 display_height = 360 spaceship_widht = 84 spaceship_height = 50 shots_x = [] shots_y = [] asteroids_x = [] asteroids_y = [] asteroids_type = [] gameDisplay = pygame.display.set_mode((display_widht, display_height...
macelai/star-wars
game.py
game.py
py
3,439
python
en
code
0
github-code
6
[ { "api_name": "pygame.init", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 19, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 19, "usage_type": "attribute" }, { "api_name": "pygame.display...
22868194593
import requests from googletrans import Translator, LANGUAGES import pickle import webScraping with open('Resources/API key/oxford.pck', 'rb') as file: api_key = pickle.load(file) app_id = api_key['app id'] app_key = api_key['app key'] url_base = 'https://od-api.oxforddictionaries.com/api/v2/' la...
TroySigX/smartbot
dictionary.py
dictionary.py
py
2,176
python
en
code
2
github-code
6
[ { "api_name": "pickle.load", "line_number": 7, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 16, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 27, "usage_type": "call" }, { "api_name": "requests.get", "line_number"...
36846615388
from typing import cast from .kotlin_entities import ( KotlinEntity, KotlinProperty, KotlinEntityEnumeration, PARSING_ERRORS_PROP_NAME, ENTITY_STATIC_CREATOR ) from ..base import Generator from ... import utils from ...config import GenerationMode, GeneratedLanguage, TEMPLATE_SUFFIX from ...schema....
divkit/divkit
api_generator/api_generator/generators/kotlin/generator.py
generator.py
py
16,470
python
en
code
1,940
github-code
6
[ { "api_name": "base.Generator", "line_number": 23, "usage_type": "name" }, { "api_name": "config.generation", "line_number": 26, "usage_type": "attribute" }, { "api_name": "config.generation", "line_number": 27, "usage_type": "attribute" }, { "api_name": "config.g...
18959073144
import boto3 import time import json import configparser from botocore.exceptions import ClientError redshift_client = boto3.client('redshift', region_name='ap-southeast-1') ec2 = boto3.resource('ec2', region_name='ap-southeast-1') def create_udacity_cluster(config): """Create an Amazon Redshift cluster Args...
hieutdle/bachelor-thesis
airflow/scripts/create_cluster.py
create_cluster.py
py
2,942
python
en
code
1
github-code
6
[ { "api_name": "boto3.client", "line_number": 7, "usage_type": "call" }, { "api_name": "boto3.resource", "line_number": 8, "usage_type": "call" }, { "api_name": "botocore.exceptions.ClientError", "line_number": 35, "usage_type": "name" }, { "api_name": "time.sleep"...
23091348874
''' Epidemic modelling YOUR NAME Functions for running a simple epidemiological simulation ''' import random import sys import click # This seed should be used for debugging purposes only! Do not refer # to this variable in your code. TEST_SEED = 20170217 def has_an_infected_neighbor(city, location): ''' ...
MaxSaint01/pa1
sir.py
sir.py
py
13,436
python
en
code
1
github-code
6
[ { "api_name": "random.random", "line_number": 190, "usage_type": "call" }, { "api_name": "random.seed", "line_number": 218, "usage_type": "call" }, { "api_name": "sys.stderr", "line_number": 308, "usage_type": "attribute" }, { "api_name": "sys.stderr", "line_n...
1422010768
#Dilation and Erosion import cv2 import matplotlib.pyplot as plt import numpy as np #-----------------------------------Dilation------------------------------ # Reads in a binary image img = cv2.imread('j.png',0) # Create a 5x5 kernel of ones Kernel = np.ones((5,5), np.uint8) ''' To dilate an image in OpenCV, yo...
haderalim/Computer-Vision
Types of features and Image segmentation/Dilation- Erosion- Opeining and Closing/test.py
test.py
py
2,245
python
en
code
1
github-code
6
[ { "api_name": "cv2.imread", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 12, "usage_type": "attribute" }, { "api_name": "cv2.dilate", "line_number":...
4501146166
import asyncio import contextlib import types import unittest import pytest from lsst.ts import salobj, watcher from lsst.ts.idl.enums.Watcher import AlarmSeverity # Timeout for normal operations (seconds) STD_TIMEOUT = 5 class GetRuleClassTestCase(unittest.TestCase): """Test `lsst.ts.watcher.get_rule_class`.""...
lsst-ts/ts_watcher
tests/test_model.py
test_model.py
py
18,435
python
en
code
0
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 14, "usage_type": "attribute" }, { "api_name": "lsst.ts.watcher.rules", "line_number": 19, "usage_type": "attribute" }, { "api_name": "lsst.ts.watcher", "line_number": 19, "usage_type": "name" }, { "api_name": "lss...
3929101533
from sqlalchemy import Column, INTEGER, Identity, String from src.data_access.database.models.base_entity import InoversityLibraryBase __all__ = [ "StaffEntity" ] class StaffEntity(InoversityLibraryBase): user_id = Column("id", INTEGER, Identity(), primary_key=True, index=True) role_level = Column("role...
mariusvrstr/PythonMicroservice
src/data_access/database/models/staff_entity.py
staff_entity.py
py
582
python
en
code
0
github-code
6
[ { "api_name": "src.data_access.database.models.base_entity.InoversityLibraryBase", "line_number": 10, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 11, "usage_type": "call" }, { "api_name": "sqlalchemy.INTEGER", "line_number": 11, "usage_type":...
4786996440
#まだわからん。 from collections import defaultdict n,k = map(int,input().split()) a = list(map(int,input().split())) d = defaultdict(int) right = 0 ans = 0 # 区間の最大を保存する。 kinds = 0 for left in range(n): while right < n and kinds < k: d[a[right]] += 1 right += 1 kinds = len(d) print("while...
K5h1n0/compe_prog_new
typical90/034/main.py
main.py
py
725
python
ja
code
0
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 7, "usage_type": "call" } ]
7436815802
from pathlib import Path from zoneinfo import ZoneInfo import datetime import sys TIME_ZONE = ZoneInfo('US/Eastern') def main(): station_name = sys.argv[1] dir_path = Path(sys.argv[2]) file_paths = sorted(dir_path.glob('*.WAV')) for file_path in file_paths: move_file(file_path...
HaroldMills/Vesper
scripts/organize_audiomoth_wav_files_by_night.py
organize_audiomoth_wav_files_by_night.py
py
1,464
python
en
code
47
github-code
6
[ { "api_name": "zoneinfo.ZoneInfo", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 12, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.argv", "line_numb...
8833474558
######################################################## # Rodrigo Leite - drigols # # Last update: 17/12/2021 # ######################################################## import pandas as pd from matplotlib import pyplot as plt df = pd.DataFrame( { ...
drigols/studies
modules/math-codes/modules/statistics-and-probability/src/outliers-v2.py
outliers-v2.py
py
804
python
en
code
0
github-code
6
[ { "api_name": "pandas.DataFrame", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.savefig", "line_number": 20, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 20, "usage_type": "name" }, { "api_name": "matplotli...
5609431554
import gym class SparseRewardWrapper(gym.Wrapper): def __init__(self, env, sparse_level=-1, timestep_limit=-1): super(SparseRewardWrapper, self).__init__(env) self.sparse_level = sparse_level self.timestep_limit = timestep_limit self.acc_reward = 0 self.acc_t = 0 def st...
pfnet-research/piekd
sparse_wrapper.py
sparse_wrapper.py
py
1,118
python
en
code
6
github-code
6
[ { "api_name": "gym.Wrapper", "line_number": 3, "usage_type": "attribute" } ]
72519791227
import json from warnings import warn # def init_from_config(meas_cls, config: dict): # arg_str = '' # # for key, value in config.items(): # arg_str = key+'='+value def export_measurement_config(obj, attr_keys=None): if attr_keys is None: attr_keys = obj.__init__.__code__.co_varnames ...
yyzidea/measurement-automation
utilities/measurement_helper.py
measurement_helper.py
py
1,278
python
en
code
0
github-code
6
[ { "api_name": "warnings.warn", "line_number": 32, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 40, "usage_type": "call" }, { "api_name": "json.load", "line_number": 45, "usage_type": "call" } ]
16543455789
from ai_chatbot.scripts import REDataHeader as Header import dateparser import datetime def printData(data): print('Station from : {0}'.format(data[Header.STATIONFROM])) print('Station to : {0}'.format(data[Header.STATIONTO])) print('departure date : {0}'.format(data[Header.DEPARTDATE])) print('depart...
Grimmii/TrainChatBot
src/ai_chatbot/scripts/RE_function_booking.py
RE_function_booking.py
py
2,542
python
en
code
0
github-code
6
[ { "api_name": "ai_chatbot.scripts.REDataHeader.STATIONFROM", "line_number": 7, "usage_type": "attribute" }, { "api_name": "ai_chatbot.scripts.REDataHeader", "line_number": 7, "usage_type": "name" }, { "api_name": "ai_chatbot.scripts.REDataHeader.STATIONTO", "line_number": 8, ...
8380997732
import os from flask import Flask, jsonify, request from math import sqrt app = Flask(__name__) @app.route('/') def nao_entre_em_panico(): nmax = 50 n1 = 0 n2 = 1 cont = 0 fib = 0 res = "Essa é sequencia dos 50 primeiros números da razão de Fibonacci: <br> Desenvolvido por Jefferson Alves. ...
jeffersonpedroza/Docker
fibonacci.py
fibonacci.py
py
606
python
pt
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 28, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 28, "usage_type": "attribute" } ]
2061469568
from sklearn.preprocessing import StandardScaler from sklearn import svm class OneClassSVM: def __init__(self, scaling=True): self._scaling = scaling def fit(self, X): if self._scaling: self._scaler = StandardScaler() X = self._scaler.fit_transform(X) X = X[:...
rom1mouret/cheatmeal
benchmarks/baselines/one_class_svm.py
one_class_svm.py
py
559
python
en
code
2
github-code
6
[ { "api_name": "sklearn.preprocessing.StandardScaler", "line_number": 12, "usage_type": "call" }, { "api_name": "sklearn.svm.OneClassSVM", "line_number": 17, "usage_type": "call" }, { "api_name": "sklearn.svm", "line_number": 17, "usage_type": "name" } ]
36837090213
import streamlit as st from streamlit_option_menu import option_menu import math import datetime from datetime import date import calendar from PIL import Image from title_1 import * from img import * with open('final.css') as f: st.markdown(f"<style>{f.read()}</style>",unsafe_allow_html=True) def av...
Deepsphere-AI/AI-lab-Schools
Grade 08/Application/find_avg.py
find_avg.py
py
1,787
python
en
code
0
github-code
6
[ { "api_name": "streamlit.markdown", "line_number": 11, "usage_type": "call" }, { "api_name": "streamlit.markdown", "line_number": 14, "usage_type": "call" }, { "api_name": "streamlit.columns", "line_number": 15, "usage_type": "call" }, { "api_name": "streamlit.col...
33359791664
import sys import unittest import psycopg2 sys.path.insert(0, '../src') from src.utils import daily_reports_return_json, daily_reports_return_csv, time_series_return_csv, check_query_data_active, check_request from src.config import connect_database # import copy class TestUtils(unittest.TestCase): def __init__...
shin19991207/CSC301-A2
tests/test_utils.py
test_utils.py
py
4,518
python
en
code
0
github-code
6
[ { "api_name": "sys.path.insert", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "unittest.TestCase", "line_number": 12, "usage_type": "attribute" }, { "api_name": "src.config.connect...
25849292828
# imports import socket import json def extractData(ledger): ledger = ledger['ledger'] title = ledger['title'] date = ledger['date'] people = [person['name'] for person in ledger['people']] people = ', '.join(people) summary = ledger['summary'] items = ledger['transactions'] htmlTable =...
alexcw08/email-microservice
server.py
server.py
py
2,524
python
en
code
0
github-code
6
[ { "api_name": "socket.socket", "line_number": 52, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 52, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREAM", "line_number": 52, "usage_type": "attribute" }, { "api_name": "json.loads"...
38160567413
#import bpy from random import seed from random import uniform import numpy as np import cv2 # seed random number generator seed(1) """ def test1(): # make mesh vertices = [(1, 0, 0),(1,0,5),(0,1,0)] edges = [] faces = [] faces.append([0,1,2]) faces.append([2,0,3]) #new_mesh = bpy.data.m...
olaals/masteroppgave-old
src/testing/blender/generate-mesh/generate-alu-parts/generate-test.py
generate-test.py
py
5,601
python
en
code
0
github-code
6
[ { "api_name": "random.seed", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 88, "usage_type": "call" }, { "api_name": "cv2.circle", "line_number": 95, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 96,...
39263007416
import datetime as datetime import json from django.db.models import Q from django.test import override_settings from mock import MagicMock, patch from rest_framework.status import HTTP_403_FORBIDDEN, HTTP_201_CREATED from eums.models import MultipleChoiceAnswer, TextAnswer, Flow, Run, \ NumericAnswer, Alert, Run...
unicefuganda/eums
eums/test/api/test_web_answers_end_point.py
test_web_answers_end_point.py
py
18,674
python
en
code
9
github-code
6
[ { "api_name": "eums.test.config.BACKEND_URL", "line_number": 23, "usage_type": "name" }, { "api_name": "eums.test.api.authorization.authenticated_api_test_case.AuthenticatedAPITestCase", "line_number": 26, "usage_type": "name" }, { "api_name": "mock.MagicMock", "line_number":...
21334940324
import logging import re import urlparse find_href = re.compile(r'\bhref\s*=\s*(?!.*mailto:)(?!.*&#109;&#97;&#105;&#108;&#116;&#111;&#58;)("[^"]*"|\'[^\']*\'|[^"\'<>=\s]+)') # FYI: added a workaround to not to break inline akavita counter script find_src = re.compile(r'\bsrc\s*=\s*("[^"\']*"|\'[^"\']*\'|[^"\'<>=\s;]{...
stachern/bseu_fm
hooks/subdir.py
subdir.py
py
1,410
python
en
code
0
github-code
6
[ { "api_name": "re.compile", "line_number": 5, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 16, "usage_type": "call" }, { "api_name": "urlparse.urlparse", "line_number...
22088681014
from helpers import setup_logger menu_name = "Hardware test" from threading import Event, Thread from traceback import format_exc from subprocess import call from time import sleep import sys import os from ui import Menu, Printer, PrettyPrinter, GraphicsPrinter from helpers import ExitHelper, local_path_gen logg...
LouisPi/piportablerecorder
apps/test_hardware/main.py
main.py
py
4,539
python
en
code
1
github-code
6
[ { "api_name": "helpers.setup_logger", "line_number": 17, "usage_type": "call" }, { "api_name": "threading.Event", "line_number": 23, "usage_type": "call" }, { "api_name": "helpers.local_path_gen", "line_number": 27, "usage_type": "call" }, { "api_name": "os.listdi...
15751603227
from elasticsearch import Elasticsearch, exceptions import json, time import itertools from project import config class SelectionAnalytics(): ''' SelectionAnalytics class data analytics - elasticsearch ''' # declare globals for the Elasticsearch client host DOMAIN = config.DOMAIN LO...
flabastie/news-analysis
project/queries/selection.py
selection.py
py
11,437
python
en
code
0
github-code
6
[ { "api_name": "project.config.DOMAIN", "line_number": 12, "usage_type": "attribute" }, { "api_name": "project.config", "line_number": 12, "usage_type": "name" }, { "api_name": "project.config.LOGIN", "line_number": 13, "usage_type": "attribute" }, { "api_name": "p...
70780596348
from flask import Flask, render_template, request from modelo import modelagemPredicao from data import gerarNovosDados app = Flask(__name__, template_folder='templates', static_folder='static') @app.route('/', methods=['GET', 'POST']) def index(): # variáveis auxiliares partidas = 0 precisaomedalha = 0 ...
stardotwav/Dota2Predictor
web service/app.py
app.py
py
2,788
python
pt
code
2
github-code
6
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 16, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 16, "usage_type": "name" }, { "api_name": "flask.request.form...
37379251526
import os import glob import numpy as np import time from osgeo import gdal from osgeo import ogr from osgeo import osr from configs import * def merge_shp(shp_list, save_dir): """merge shapefiles in shp_list to a single shapefile in save_dir Args: shp_list (list): _description_ save_dir (str)...
faye0078/RS-ImgShp2Dataset
make_dataset/shp_functions.py
shp_functions.py
py
8,144
python
en
code
1
github-code
6
[ { "api_name": "os.path.join", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path.exists", "line_...
21041808334
"""Pytorch dataset module""" import json from glob import glob from pathlib import Path import albumentations as A import cv2 import numpy as np import torch from albumentations.pytorch import ToTensorV2 from torch import Tensor from torch.utils.data import Dataset from data.config import DataConfig, keypoint_indice...
mohamad-hasan-sohan-ajini/deep_fashion_2
data/data_pt.py
data_pt.py
py
7,291
python
en
code
1
github-code
6
[ { "api_name": "albumentations.Compose", "line_number": 17, "usage_type": "call" }, { "api_name": "albumentations.LongestMaxSize", "line_number": 19, "usage_type": "call" }, { "api_name": "data.config.DataConfig.IMAGE_SIZE", "line_number": 19, "usage_type": "attribute" }...
21894452141
from dsa_stack import DSAStack import sys from typing import Union class TowersOfHanoi: def __init__(self, num_pegs: int, num_disks: int) -> None: self.num_pegs = num_pegs self.num_disks = num_disks self.pegs = [ DSAStack(num_disks), DSAStack(num_disks), ...
MC-DeltaT/DSA-Practicals
P2/towers_of_hanoi.py
towers_of_hanoi.py
py
3,845
python
en
code
0
github-code
6
[ { "api_name": "dsa_stack.DSAStack", "line_number": 12, "usage_type": "call" }, { "api_name": "dsa_stack.DSAStack", "line_number": 13, "usage_type": "call" }, { "api_name": "dsa_stack.DSAStack", "line_number": 14, "usage_type": "call" }, { "api_name": "typing.Union...
13114754891
import requests import tkinter.messagebox user = open('user.txt','r').read().splitlines() def checking(): for users in user: tik = (f'https://m.tiktok.com/node/share/user/@{users}') head = { 'accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/...
8-wrk/TikCheck
Check.py
Check.py
py
1,463
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 21, "usage_type": "call" }, { "api_name": "tkinter.messagebox.messagebox.showinfo", "line_number": 23, "usage_type": "call" }, { "api_name": "tkinter.messagebox.messagebox", "line_number": 23, "usage_type": "attribute" }, {...
31628139132
# fastapi from fastapi import APIRouter from fastapi_sqlalchemy import db # starlette from starlette.requests import Request # models from server.models import User router = APIRouter( prefix="/accounts", tags=["accounts"], dependencies=[], responses={ 400: {"description": "Bad request"} ...
RajeshJ3/arya.ai
server/accounts/account_controllers.py
account_controllers.py
py
525
python
en
code
0
github-code
6
[ { "api_name": "fastapi.APIRouter", "line_number": 11, "usage_type": "call" }, { "api_name": "starlette.requests.Request", "line_number": 22, "usage_type": "name" }, { "api_name": "fastapi_sqlalchemy.db.session.query", "line_number": 24, "usage_type": "call" }, { "...
72510037949
from django import forms from django.contrib.auth.models import User from django.contrib.auth.forms import UserCreationForm from .models import Profile from crispy_forms.helper import FormHelper from crispy_forms.layout import Layout, Submit, HTML, Div, Row, Column, Fieldset from crispy_forms.bootstrap import InlineRad...
userksv/carsbay
users/forms.py
forms.py
py
3,773
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.auth.forms.PasswordResetForm", "line_number": 10, "usage_type": "name" }, { "api_name": "django.contrib.auth.models.User.objects.filter", "line_number": 14, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.User.objects", "line_nu...
15142385428
import requests from flask import redirect, url_for, flash from app.github import bp from app.github.functions import request_interface @bp.route('/update-database', methods=['GET', 'POST']) async def update_database(): # get all repos sorted by star rating # The max number of items per page is 100 url ...
Red-Hammer/most-starred-python-repos
app/github/routes.py
routes.py
py
872
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 14, "usage_type": "call" }, { "api_name": "requests.exceptions", "line_number": 17, "usage_type": "attribute" }, { "api_name": "flask.flash", "line_number": 18, "usage_type": "call" }, { "api_name": "flask.redirect", ...
19325512904
from statsmodels.tsa.seasonal import seasonal_decompose from dateutil.parser import parse import pandas as pd import numpy as np import matplotlib.pyplot as plt df = pd.read_csv('../timeserie_train.csv', parse_dates=['data'], index_col='data', squeeze=True) # Multiplicative Decomposition result_mul = seasonal_d...
gsilva49/timeseries
H/python_code/decom.py
decom.py
py
1,379
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "statsmodels.tsa.seasonal.seasonal_decompose", "line_number": 13, "usage_type": "call" }, { "api_name": "statsmodels.tsa.seasonal.seasonal_decompose", "line_number": 16, "usage_type":...
21099702516
from sklearn import svm import sklearn.linear_model.stochastic_gradient as sg from sklearn.model_selection import GridSearchCV as grid import numpy #linear kernel support vector machine using tf-idf vectorizations class SVM: train_X = [] train_Y = [] test_X = [] test_Y = [] def __init__(self, train_...
hadarohana/Tweets
Tweets/SVM.py
SVM.py
py
1,710
python
en
code
0
github-code
6
[ { "api_name": "sklearn.feature_extraction.text.TfidfVectorizer", "line_number": 23, "usage_type": "call" }, { "api_name": "sklearn.linear_model.stochastic_gradient.SGDClassifier", "line_number": 36, "usage_type": "call" }, { "api_name": "sklearn.linear_model.stochastic_gradient",...
38217506704
import matplotlib.pyplot as plt from matplotlib.lines import Line2D import matplotlib.animation as animation import matplotlib.patches as mpatches from matplotlib import ticker from matplotlib import cm from matplotlib.ticker import FuncFormatter import numpy as np from utils.occ_map_utils import load_map, display_oc...
stomachacheGE/bofmp
tracking/animation.py
animation.py
py
17,318
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.animation.pause", "line_number": 19, "usage_type": "attribute" }, { "api_name": "matplotlib.animation", "line_number": 19, "usage_type": "name" }, { "api_name": "matplotlib.animation.event_source.stop", "line_number": 20, "usage_type": "call" }...
1396103450
from django.shortcuts import render, redirect, reverse from django.http import JsonResponse from django.forms import ValidationError from .models import * import pyshorteners def index(request): data = {} if request.method == "POST": try: l = Link() s = pyshorteners.Shortener() ...
jennytoc/url-shortener
url_shortener_app/views.py
views.py
py
976
python
en
code
0
github-code
6
[ { "api_name": "pyshorteners.Shortener", "line_number": 12, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "line_number": 17, "usage_type": "call" }, { "api_name": "django.shortcuts.reverse", "line_number": 17, "usage_type": "call" }, { "api_nam...
72994074107
import torch.nn as nn import torch class NetworksFactory: def __init__(self): pass @staticmethod def get_by_name(network_name, *args, **kwargs): ################ Ours ################# if network_name == 'Ours_Reconstruction': from networks.Ours_Reconstruction import N...
Lynn0306/LEDVDI
CODES/networks/networks.py
networks.py
py
1,012
python
en
code
20
github-code
6
[ { "api_name": "networks.Ours_Reconstruction.Net", "line_number": 14, "usage_type": "call" }, { "api_name": "networks.Ours_DeblurOnly.Net", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.nn.Module", "line_number": 28, "usage_type": "attribute" }, { ...
16164892137
from flask import Flask, request, jsonify, abort, Response, redirect from flask_sqlalchemy import SQLAlchemy from flask_cors import CORS from os import environ import sys import os import asyncio import requests from invokes import invoke_http import pika import amqp_setup import json from datetime import datetime ...
ESDeezknee/ESDeezknee
order/order.py
order.py
py
9,606
python
en
code
1
github-code
6
[ { "api_name": "flask.Flask", "line_number": 18, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 19, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 19, "usage_type": "name" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", ...
10117546059
import pytest from dao.genre import GenreDAO from service.genre import GenreService class TestGenreService: @pytest.fixture(autouse=True) def genre_service(self, genre_Dao: GenreDAO): self.genre_service = GenreService(genre_Dao) def test_get_one(self): certain_genre = self.genre_service....
AgzigitovOskar/CR_4_Agzigitov
tests/service_tests/genre_service.py
genre_service.py
py
618
python
en
code
0
github-code
6
[ { "api_name": "dao.genre.GenreDAO", "line_number": 9, "usage_type": "name" }, { "api_name": "service.genre.GenreService", "line_number": 10, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 8, "usage_type": "call" } ]
37974828359
''' Program to be called from cron for working with lights - on and off This is a wrapper for the Client, handling command line parameters Author: Howard Webb Date: 2/10/2021 ''' import argparse from exp import exp from GrowLight import GrowLight parser = argparse.ArgumentParser() # list of acceptable arg...
webbhm/GBE-Digital
python/Light_Switch.py
Light_Switch.py
py
538
python
en
code
1
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 12, "usage_type": "call" }, { "api_name": "GrowLight.GrowLight", "line_number": 17, "usage_type": "call" } ]
32644084947
import maya.cmds as cmds import pymel.core as pm from mgear.core import attribute ATTR_SLIDER_TYPES = ["long", "float", "double", "doubleLinear", "doubleAngle"] DEFAULT_RANGE = 1000 # TODO: filter channel by color. By right click menu in a channel with color def init_table_config_data(): """Initialize the di...
mgear-dev/mgear4
release/scripts/mgear/animbits/channel_master_utils.py
channel_master_utils.py
py
9,005
python
en
code
209
github-code
6
[ { "api_name": "maya.cmds.nodeType", "line_number": 50, "usage_type": "call" }, { "api_name": "maya.cmds", "line_number": 50, "usage_type": "name" }, { "api_name": "maya.cmds.listAttr", "line_number": 51, "usage_type": "call" }, { "api_name": "maya.cmds", "line...
36154798504
import streamlit as st st.set_option('deprecation.showPyplotGlobalUse', False) # for manipulation import pandas as pd import numpy as np # for data visualization import matplotlib.pyplot as plt import seaborn as sns sns.set(style="ticks") plt.style.use("dark_background") #sns.set_style('whitegrid') # t...
Jkauser/Agricultural-Production-Optimization-Engine
app.py
app.py
py
10,888
python
en
code
0
github-code
6
[ { "api_name": "streamlit.set_option", "line_number": 2, "usage_type": "call" }, { "api_name": "seaborn.set", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style.use", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotli...
38928831481
import os from dotenv import load_dotenv import requests from lxml import etree import re from postgres import cursor, connection from slugify import slugify load_dotenv() # -------------------------- # link đến trang hình ảnh của chapter nettruyen = os.getenv("PUBLIC_NETTRUYEN_URL") def openWebsite(domain: str): ...
baocuns/BCunsAutoCrawls
crawlChaptersNettruyenToPostgres.py
crawlChaptersNettruyenToPostgres.py
py
2,686
python
vi
code
0
github-code
6
[ { "api_name": "dotenv.load_dotenv", "line_number": 10, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 14, "usage_type": "call" }, { "api_name": "requests.request", "line_number": 21, "usage_type": "call" }, { "api_name": "postgres.cursor.execute...
14992716515
#!/usr/bin/env python # coding: utf-8 # In[37]: # Questions for 10/28 meeting: # Test set -> Should the test be just one game? Answer: Leave it the way it is for now. # Train set -> Should we duplicate previous games to add weighting? Answer: Yes. ## November 6th, 2020 Backend Meeting ## # 4 Factors to include for...
oohshan/SmartGameGoalsGenerator
passenger.py
passenger.py
py
15,323
python
en
code
1
github-code
6
[ { "api_name": "pandas.set_option", "line_number": 31, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 38, "usage_type": "call" }, { "api_name": "pandas.set_option", "line_number": 42, "usage_type": "call" }, { "api_name": "pandas.merge", ...
8042412809
import tornado.web import tornado.ioloop import tornado.httpserver import tornado.options # define parameter,like --port=9000 list=a,b,c,de, tornado.options.define("port", default=8000, type=None) tornado.options.define("list", default=[], type=str, multiple=True) class IndexHandler(tornado.web.RequestHandler): ...
zuohd/python-excise
tornado/server04.py
server04.py
py
847
python
en
code
0
github-code
6
[ { "api_name": "tornado.web.options.define", "line_number": 7, "usage_type": "call" }, { "api_name": "tornado.web.options", "line_number": 7, "usage_type": "attribute" }, { "api_name": "tornado.web", "line_number": 7, "usage_type": "name" }, { "api_name": "tornado....
34859170758
##### # Remove "warn" logs from spark ##### from os.path import abspath from pyspark.sql import SparkSession # warehouse_location points to the default location for managed databases and tables warehouse_location = abspath('spark-warehouse') spark = SparkSession \ .builder \ .appName("Pyspark integration wit...
zaka-ai/data-engineer-track
Big_data_warehousing_in_hadoop/hive_hands_on/2_hive_partitioning_pyspark_integration/2_2_hive_with_pyspark.py
2_2_hive_with_pyspark.py
py
828
python
en
code
0
github-code
6
[ { "api_name": "os.path.abspath", "line_number": 9, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder.appName", "line_number": 11, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 11, "usage_type": "attribute" ...
41559253356
from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.ui import WebDriverWait as wait from selenium.webdriver.common.action_chains import ActionChains as ...
cermen/SecondCompanyScraping
scrap.py
scrap.py
py
8,973
python
en
code
0
github-code
6
[ { "api_name": "selenium.webdriver.support.ui.WebDriverWait", "line_number": 24, "usage_type": "call" }, { "api_name": "selenium.webdriver.support.expected_conditions.element_to_be_clickable", "line_number": 24, "usage_type": "call" }, { "api_name": "selenium.webdriver.support.exp...
13437468850
# Display a runtext with double-buffering. import sys sys.path.append("matrix/bindings/python/samples") from samplebase import SampleBase from rgbmatrix import graphics import time from PIL import Image import requests import json import threading from threading import Thread from queue import Queue import traceback ...
aqwesd8/MTAProject
mtatext.py
mtatext.py
py
7,270
python
en
code
0
github-code
6
[ { "api_name": "sys.path.append", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "logging.basicConfig", "line_number": 19, "usage_type": "call" }, { "api_name": "logging.DEBUG", "...
31008546048
from flask import Flask from flask_pymongo import PyMongo from flask import Response import random import requests from flask import request import json from itsdangerous import (TimedJSONWebSignatureSerializer as Serializer, BadSignature, SignatureExpired) from flask import jsonify from bson....
SvTitov/tasker
SRV/tasker_srv/application.py
application.py
py
5,493
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 17, "usage_type": "call" }, { "api_name": "flask_pymongo.PyMongo", "line_number": 21, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 26, "usage_type": "call" }, { "api_name": "bson.json_util.default",...
20489742276
import scipy from scipy.special import logsumexp from sklearn.cluster import KMeans from sklearn.cluster import SpectralClustering from sklearn.linear_model import LogisticRegression from sklearn.svm import SVC, SVR from ucsl.sinkhornknopp_utils import * def one_hot_encode(y, n_classes=None): ''' utils function ...
rlouiset/py_ucsl
ucsl/utils.py
utils.py
py
6,772
python
en
code
1
github-code
6
[ { "api_name": "scipy.special.logsumexp", "line_number": 25, "usage_type": "call" }, { "api_name": "scipy.linalg.eigh", "line_number": 47, "usage_type": "call" }, { "api_name": "scipy.linalg", "line_number": 47, "usage_type": "attribute" }, { "api_name": "scipy.lin...
23476634886
import joblib wordsTB = ["'s", ',', 'keywords', 'Twitter', 'account', 'a', 'all', 'anyone', 'are', 'awesome', 'be', 'behavior', 'by', 'bye', 'can', 'chatting', 'check', 'could', 'data', 'day', 'detail', 'do', 'dont', 'find', 'for', 'give', 'good', 'goodbye', 'have', 'hello', 'help', 'helpful', 'helping', 'hey', 'hi'...
kaitong-li/Twitter-Bot
Twitter Bot/generatePkl.py
generatePkl.py
py
906
python
en
code
0
github-code
6
[ { "api_name": "joblib.dump", "line_number": 5, "usage_type": "call" }, { "api_name": "joblib.dump", "line_number": 6, "usage_type": "call" } ]
27579907019
from pyspark import SparkConf from pyspark.context import SparkContext from pyspark.sql.session import SparkSession conf = SparkConf().set("spark.cores.max", "32") \ .set("spark.driver.memory", "50g") \ .set("spark.executor.memory", "50g") \ .set("spark.executor.memory_overhead", "50g") \ .set("spark.dr...
thuy4tbn99/spark_instacart
baskets.py
baskets.py
py
2,095
python
en
code
0
github-code
6
[ { "api_name": "pyspark.SparkConf", "line_number": 4, "usage_type": "call" }, { "api_name": "pyspark.context.SparkContext", "line_number": 10, "usage_type": "call" }, { "api_name": "pyspark.sql.session.SparkSession", "line_number": 11, "usage_type": "call" }, { "ap...
72330666747
# TEE RATKAISUSI TÄHÄN: import pygame pygame.init() naytto = pygame.display.set_mode((640, 480)) robo = pygame.image.load("robo.png") leveys, korkeus = 640, 480 x = 0 y = 0 suunta = 1 kello = pygame.time.Clock() while True: for tapahtuma in pygame.event.get(): if tapahtuma.type == pygame.QUIT: ...
jevgenix/Python_OOP
osa13-06_reunan_kierto/src/main.py
main.py
py
796
python
fi
code
4
github-code
6
[ { "api_name": "pygame.init", "line_number": 4, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 5, "usage_type": "attribute" }, { "api_name": "pygame.image.loa...
18711654900
import argparse import logging from pathlib import Path from typing import List import yaml from topaz3.conversions import phase_remove_bad_values, phase_to_map from topaz3.database_ops import prepare_labels_database, prepare_training_database from topaz3.delete_temp_files import delete_temp_files from topaz3.get_cc ...
mevol/python_topaz3
topaz3/prepare_training_data.py
prepare_training_data.py
py
14,661
python
en
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 22, "usage_type": "name" }, { "api_name": "logging.info", "line_number": 30, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 34, "usage_type": "call" }, { "api_name": "logging.error", "line_numbe...
69936276028
import torch.nn as nn import torch.optim as optimizers from nlp.generation.models import CharLSTM class CharLSTMTrainer: def __init__(self, model: CharLSTM, vocab_size: int, learning_rate: float = 1e-3, weights_decay: float = 1e-3, ...
Danielto1404/bachelor-courses
python-backend/projects/nlp.ai/nlp/generation/trainers.py
trainers.py
py
1,129
python
en
code
5
github-code
6
[ { "api_name": "nlp.generation.models.CharLSTM", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.nn.CrossEntropyLoss", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 22, "usage_type": "name" }, { "api_name": "torc...
39680498179
""" General functions for data_tables and data_table_manager We are using a class here just to make it easier to pass around """ import logging import pprint import subprocess from pathlib import Path import re from typing import Union import matplotlib.pyplot as mpl import numpy as np import pandas as pd from py...
marsiwiec/ephys
ephys/gui/data_table_functions.py
data_table_functions.py
py
51,215
python
en
code
null
github-code
6
[ { "api_name": "ephys.tools.utilities.Utility", "line_number": 24, "usage_type": "call" }, { "api_name": "ephys.tools.utilities", "line_number": 24, "usage_type": "name" }, { "api_name": "pylibrary.tools.cprint.cprint", "line_number": 25, "usage_type": "attribute" }, {...
8056801684
""" Static Pipeline representation to create a CodePipeline dedicated to building Lambda Layers """ from troposphere import ( Parameter, Template, GetAtt, Ref, Sub ) from ozone.handlers.lambda_tools import check_params_exist from ozone.resources.iam.roles.pipeline_role import pipelinerole_build fr...
lambda-my-aws/ozone
ozone/templates/awslambdalayer_pipeline.py
awslambdalayer_pipeline.py
py
2,782
python
en
code
0
github-code
6
[ { "api_name": "ozone.handlers.lambda_tools.check_params_exist", "line_number": 35, "usage_type": "call" }, { "api_name": "troposphere.Template", "line_number": 36, "usage_type": "call" }, { "api_name": "troposphere.Parameter", "line_number": 37, "usage_type": "call" }, ...
6757711914
import json import sys import os.path from mutagen.id3 import (ID3, CTOC, CHAP, TIT2, TALB, TPE1, COMM, USLT, APIC, CTOCFlags) audio = ID3(sys.argv[1]) if len(sys.argv) > 2: data = json.loads(sys.argv[2]) chapters = data["chapters"] ctoc_ids = list(map(lambda i: i.get("id"), chapt...
lukekarrys/audiobook
id3.py
id3.py
py
1,967
python
en
code
1
github-code
6
[ { "api_name": "mutagen.id3.ID3", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 7, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "json.loads", "line_numbe...
35164168406
#!/usr/bin/python3 import os import json import html import random import string import threading import subprocess from bottle import app, error, post, request, redirect, route, run, static_file from beaker.middleware import SessionMiddleware session_opts = { 'session.type': 'file', 'session.data_dir': './cfg/', ...
Cameron-IPFSPodcasting/podcastnode-Umbrel
webui.py
webui.py
py
9,972
python
en
code
4
github-code
6
[ { "api_name": "beaker.middleware.SessionMiddleware", "line_number": 17, "usage_type": "call" }, { "api_name": "bottle.app", "line_number": 17, "usage_type": "call" }, { "api_name": "bottle.request.environ.get", "line_number": 18, "usage_type": "call" }, { "api_nam...
71552358588
import pyttsx3 import datetime import speech_recognition as sr import wikipedia import webbrowser import os, os.path import smtplib import random import win32gui import win32con try: engine=pyttsx3.init('sapi5') voices=engine.getProperty('voices') print(voices[0].id) engine.setProperty('voice',voic...
IamVicky90/Desktop-AI
task.py
task.py
py
10,566
python
en
code
0
github-code
6
[ { "api_name": "pyttsx3.init", "line_number": 13, "usage_type": "call" }, { "api_name": "webbrowser.get", "line_number": 22, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 25, "usage_type": "call" }, { "api_name": "datetime.datetime",...
32653169006
from flask import Flask, send_file, send_from_directory, safe_join, abort app = Flask(__name__) # app.config["CLIENT_IMAGES"] = "/home/mahima/console/static/client/img" app.config["CLIENT_IMAGES"] = "/home/lenovo/SEproject/OpsConsole/api/static" # The absolute path of the directory containing CSV files for users to...
trishu99/Platypus
api/static/fileserver.py
fileserver.py
py
882
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 3, "usage_type": "call" }, { "api_name": "flask.send_from_directory", "line_number": 18, "usage_type": "call" }, { "api_name": "flask.abort", "line_number": 20, "usage_type": "call" } ]
71943493307
import csv import math import sys import numpy as np import matplotlib.pyplot as plt from sklearn.feature_selection import chi2, f_regression, mutual_info_regression def mylog(x): if x==0: return -10000000000 else: return math.log(x) def entropy(probs, neg, pos): ''' entropy for bin...
Arnabjana1999/scoring_models
feature_selectors.py
feature_selectors.py
py
2,740
python
en
code
0
github-code
6
[ { "api_name": "math.log", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 37, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 55, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", ...
27216859235
from django.conf.urls.defaults import patterns, include, url # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Examples: (r'^$', 'rss_duna.feed.views.home'), # url(r'^myproject/', include('myproject.foo.urls')), # Un...
yonsing/rss_duna
urls.py
urls.py
py
965
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.admin.autodiscover", "line_number": 5, "usage_type": "call" }, { "api_name": "django.contrib.admin", "line_number": 5, "usage_type": "name" }, { "api_name": "django.conf.urls.defaults.patterns", "line_number": 7, "usage_type": "call" }, {...
73583270588
#!/usr/bin/python # coding: utf-8 from flask import Flask, Blueprint, flash, g, redirect, render_template, request, url_for, session import os app = Flask(__name__) tests = [] class TestObj: def __init__(self, name, path): self.name = name self.path = path+self.name self.countfile = self.pa...
rjames711/automation
flaskweb/app.py
app.py
py
1,568
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 31, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 31, "usage_type": "name" }, { "api_name": "flask.request.form...
25760910262
import random import numpy as np from keras.models import Sequential from keras.layers import Dense, LSTM # Define the RNN model model = Sequential() model.add(LSTM(64, input_shape=(1, 1))) model.add(Dense(1, activation='linear')) model.compile(optimizer='adam', loss='mean_squared_error') balance = 100 be...
atleastimnotgay/python
3cups_prediction.py
3cups_prediction.py
py
1,897
python
en
code
0
github-code
6
[ { "api_name": "keras.models.Sequential", "line_number": 7, "usage_type": "call" }, { "api_name": "keras.layers.LSTM", "line_number": 8, "usage_type": "call" }, { "api_name": "keras.layers.Dense", "line_number": 9, "usage_type": "call" }, { "api_name": "random.rand...
19882566170
from jinja2 import Environment, BaseLoader, TemplateNotFound import importlib_resources class PackageLoader(BaseLoader): def __init__(self, path): self.path = path def get_source(self, environment, template): from backendService import templates try: source = importlib_re...
bitlogik/guardata
backendService/templates/__init__.py
__init__.py
py
648
python
en
code
9
github-code
6
[ { "api_name": "jinja2.BaseLoader", "line_number": 5, "usage_type": "name" }, { "api_name": "importlib_resources.read_text", "line_number": 13, "usage_type": "call" }, { "api_name": "backendService.templates", "line_number": 13, "usage_type": "name" }, { "api_name"...
41014218939
#coding=utf-8 import numpy as np import pyten from scipy import stats from pyten.method.PoissonAirCP import PoissonAirCP from pyten.method import AirCP from pyten.tools import tenerror from pyten.method import cp_als from pyten.method import falrtc,TNCP import matplotlib.pyplot as plt #参数设置 missList = [0.7] duplicat...
yangjichen/ExpCP
realdata/GDELT_step3.py
GDELT_step3.py
py
7,907
python
en
code
0
github-code
6
[ { "api_name": "numpy.sum", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 39, "usage_type": "call" }, { "api_name": "sklearn.metrics.pairwise.cosine_similarity", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy....
2958627650
import Algorithmia import logging import os LOG_FOLDER = 'logs' if os.path.exists(LOG_FOLDER) is False: os.mkdir(LOG_FOLDER) logging.basicConfig(filename=LOG_FOLDER + '/' + __name__ + '.log', format='[%(asctime)s] %(message)s\n\n', level=logging.DEBUG) api_key = None def get_emotion(photo: b...
FunRobots/candybot_v2
src/coffebot/vision/utils/algorithmia.py
algorithmia.py
py
3,841
python
en
code
0
github-code
6
[ { "api_name": "os.path.exists", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_num...
10424214131
#-*- coding: utf-8 -*- u""" @author: Martí Congost @contact: marti.congost@whads.com @organization: Whads/Accent SL @since: October 2008 """ import cherrypy from cocktail.modeling import cached_getter from woost.controllers.publishablecontroller import PublishableController class DocumentController(PublishableCo...
marticongost/woost
woost/controllers/documentcontroller.py
documentcontroller.py
py
1,181
python
en
code
0
github-code
6
[ { "api_name": "woost.controllers.publishablecontroller.PublishableController", "line_number": 14, "usage_type": "name" }, { "api_name": "cherrypy.NotFound", "line_number": 27, "usage_type": "call" }, { "api_name": "cherrypy.HTTPRedirect", "line_number": 29, "usage_type": ...
27009828768
from sklearn.linear_model import LassoCV def run(x_train, y_train, x_test, y_test, eps, n_alphas, alphas, fit_intercept, normalize, precompute, max_iter, tol, copy_X, cv, verbose, n_jobs, positive, random_state, selection): reg = LassoCV(eps=eps, n_alphas=n_alphas, alph...
lisunshine1234/mlp-algorithm-python
machine_learning/regression/linear_models/lassoCV/run.py
run.py
py
1,314
python
en
code
0
github-code
6
[ { "api_name": "sklearn.linear_model.LassoCV", "line_number": 6, "usage_type": "call" } ]
4993994587
# -*- coding: utf-8 -*- """ Created on Sat Oct 19 13:04:11 2019 @author: Diego Wanderley @python: 3.6 @description: Train script with training class """ import tqdm import argparse import torch import torch.optim as optim import numpy as np from torch.utils.data import DataLoader from torch.utils.tensorboard import S...
dswanderley/detntorch
python/train_yolo.py
train_yolo.py
py
12,881
python
en
code
1
github-code
6
[ { "api_name": "torch.optim", "line_number": 45, "usage_type": "name" }, { "api_name": "torch.save", "line_number": 81, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 102, "usage_type": "call" }, { "api_name": "torch.autograd.Variable", "line...
3986831730
"""The abstract class for http routing""" from abc import ABCMeta, abstractmethod from typing import AbstractSet, Any, Mapping, Tuple from .http_callbacks import HttpRequestCallback from .http_response import HttpResponse class HttpRouter(metaclass=ABCMeta): """The interface for an HTTP router""" @property...
rob-blackbourn/bareASGI
bareasgi/http/http_router.py
http_router.py
py
1,583
python
en
code
26
github-code
6
[ { "api_name": "abc.ABCMeta", "line_number": 10, "usage_type": "name" }, { "api_name": "abc.abstractmethod", "line_number": 14, "usage_type": "name" }, { "api_name": "http_response.HttpResponse", "line_number": 15, "usage_type": "name" }, { "api_name": "http_respon...
21729046794
import firebase_admin from firebase_admin import db from flask import jsonify from hashlib import md5 from random import randint from time import time from time import time, sleep firebase_admin.initialize_app(options={ 'databaseURL': 'https://copy-passed.firebaseio.com', }) waitlist = db.reference('waitlist') id...
ocular-data/copy-passed-firebase
python_functions/authenticator/main.py
main.py
py
2,575
python
en
code
0
github-code
6
[ { "api_name": "firebase_admin.initialize_app", "line_number": 9, "usage_type": "call" }, { "api_name": "firebase_admin.db.reference", "line_number": 13, "usage_type": "call" }, { "api_name": "firebase_admin.db", "line_number": 13, "usage_type": "name" }, { "api_na...
15581775407
#!/usr/bin/env python import pygame import constants from network import Type import physical_object from physical_object import PhysicalObject import bullet import math from pygame.rect import Rect import play_sound from pygame import mixer from pygame.mixer import Sound TURRET_WIDTH = 24 TURRET_HEIGHT = 28 GUN_CHA...
Nayruden/GameDev
turret.py
turret.py
py
4,330
python
en
code
6
github-code
6
[ { "api_name": "physical_object.PhysicalObject", "line_number": 20, "usage_type": "name" }, { "api_name": "network.Type.TURRET", "line_number": 23, "usage_type": "attribute" }, { "api_name": "network.Type", "line_number": 23, "usage_type": "name" }, { "api_name": "...
39959163393
# to build, use "cd (playsong directory)" # pyinstaller --onefile playSong.py #lib imports import keyboard import threading import time import os import re #local imports from settings import SETTINGS,map_velocity,apply_range_bounds global isPlaying global midi_action_list isPlaying = False storedIndex = 0 convers...
eddiemunson/nn
playSong.py
playSong.py
py
7,532
python
en
code
0
github-code
6
[ { "api_name": "keyboard.release", "line_number": 74, "usage_type": "call" }, { "api_name": "keyboard.press", "line_number": 76, "usage_type": "call" }, { "api_name": "keyboard.press", "line_number": 77, "usage_type": "call" }, { "api_name": "keyboard.release", ...
74626753147
#%% import matplotlib.pyplot as plt import matplotlib.font_manager as fm import matplotlib.ticker as ticker from matplotlib import rcParams import numpy as np from highlight_text import fig_text import pandas as pd from PIL import Image import urllib import os df = pd.read_csv("success_rate_2022_2023.csv", index_col ...
array-carpenter/14thstreetanalytics
success_rate_comparison/success_rate_comparison.py
success_rate_comparison.py
py
4,223
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 22, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 22, "usage_type": "name" }, { "api_name": "matplotlib...
1956715633
from collections import deque ulaz = open('ulaz.txt', 'r') sve = ulaz.read() ulaz.close() igrači = sve.split('\n\n') prvi = deque(igrači[0].split('\n')[1:]) drugi = deque(igrači[1].split('\n')[1:]) while len(prvi) != 0 and len(drugi) != 0: a = int(prvi.popleft()) b = int(drugi.popleft()) if a > b:...
bonkach/Advent-of-Code-2020
22a.py
22a.py
py
582
python
hr
code
1
github-code
6
[ { "api_name": "collections.deque", "line_number": 6, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 7, "usage_type": "call" } ]
18262922550
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import sys import types import re import subprocess import unitTestUtil import logging sensorDict = {} util_support_map = ['fbttn', 'fbtp', 'lightning', 'minipack', 'fby2...
WeilerWebServices/Facebook
openbmc/tests/common/sensorTest.py
sensorTest.py
py
6,525
python
en
code
3
github-code
6
[ { "api_name": "sys.exit", "line_number": 30, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 34, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 51, "usage_type": "call" }, { "api_name": "re.search", "line_number": 60, "...
29180093984
from bs4 import BeautifulSoup as soup from urllib.request import urlopen as uReq from datetime import datetime as dt import re import copy import MySQLdb dataBase = MySQLdb userInput1 = str(input("Please Provide with Calendar link: ")) userInput2 = str(input("Please Provide a file name ending in .sql: ")) userInp...
ZbonaL/WebScraper
webscraper-Important-Dates.py
webscraper-Important-Dates.py
py
7,088
python
en
code
1
github-code
6
[ { "api_name": "urllib.request.urlopen", "line_number": 17, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 22, "usage_type": "call" }, { "api_name": "re.match", "line_number": 43, "usage_type": "call" }, { "api_name": "re.match", "lin...
16799554480
import argparse from pathlib import Path import sys # Add aoc_common to the python path file = Path(__file__) root = file.parent.parent sys.path.append(root.as_posix()) import re from functools import lru_cache from math import inf parser = argparse.ArgumentParser() parser.add_argument('--sample', '-s', help='Run wi...
mrkirby153/AdventOfCode2022
day16/day16.py
day16.py
py
3,973
python
en
code
0
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", ...