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
32052531396
"""Add global level timeline APIs.""" from django.core.paginator import Paginator from rest_framework import status from rest_framework.response import Response from rest_framework.views import APIView from posts.api.serializers import PostSerializer from timeline.controllers.central import TimelineCentral class Tim...
chayan007/tikup
timeline/api/views.py
views.py
py
1,069
python
en
code
5
github-code
21
[ { "api_name": "rest_framework.views.APIView", "line_number": 11, "usage_type": "name" }, { "api_name": "posts.api.serializers", "line_number": 18, "usage_type": "name" }, { "api_name": "timeline.controllers.central.TimelineCentral", "line_number": 18, "usage_type": "call"...
16064524375
import time from selenium import webdriver from bs4 import BeautifulSoup import re from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.action_chains import ActionChains def check_findmore(): try: driver.find_element_by_xpath( '//*[@id="Pl_Official_WeiboDetail__74"]' ...
ganhaha/Python-Program
评论获取微博用户名_II.py
评论获取微博用户名_II.py
py
2,240
python
en
code
0
github-code
21
[ { "api_name": "time.sleep", "line_number": 23, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 29, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 55, "usage_type": "call" }, { "api_name": "selenium.webdriver", ...
74505646771
from nevow import rend, loaders, tags from twisted.application import service, internet, strports from twisted.web import server, static from twisted.python import failure from nevow import inevow, rend, appserver, static, guard, url, loaders, stan from nevow.taglibrary import tabbedPane import Tree, Settings, LDAP, f...
belasin/tums
tums/trunk/source/Pages/Users/Group.py
Group.py
py
8,640
python
en
code
0
github-code
21
[ { "api_name": "Pages.Users.Base.Page", "line_number": 16, "usage_type": "attribute" }, { "api_name": "Pages.Users.Base", "line_number": 16, "usage_type": "name" }, { "api_name": "Core.PageHelpers.DefaultPage.__init__", "line_number": 22, "usage_type": "call" }, { ...
11669976287
# -*- coding: utf-8 -*- __author__ = 'Douglas Uba' __email__ = 'douglas.uba@inpe.br' import numpy as np from utils import create_random_circles, export2file # Define geo extent llx = -75.0; lly = -35.50; urx = -34.0; ury = 5.54 extent = [llx, lly, urx, ury] geoms = create_random_circles(extent, min=0.5, max=30.0, ...
uba/rasterstats-benchmark
generate-random-circles.py
generate-random-circles.py
py
418
python
en
code
0
github-code
21
[ { "api_name": "utils.create_random_circles", "line_number": 13, "usage_type": "call" }, { "api_name": "utils.export2file", "line_number": 16, "usage_type": "call" } ]
29805090018
# -*- coding: utf-8 -*- """ Created on Wed Jun 16 00:33:29 2021 @author: domin """ import networkx as nx def nxgraphmaker(dic): '''return nx.Graph() object from dictionary''' G=nx.Graph() for key, value in dic.items(): for i in range(len(value)): #edge=pydot.Edge(key,value[i]) ...
DomiDhillon/Graph_coloring
fiveCC/planarityCheck.py
planarityCheck.py
py
585
python
en
code
0
github-code
21
[ { "api_name": "networkx.Graph", "line_number": 13, "usage_type": "call" }, { "api_name": "networkx.algorithms.planarity.check_planarity", "line_number": 24, "usage_type": "call" }, { "api_name": "networkx.algorithms", "line_number": 24, "usage_type": "attribute" } ]
24661990337
import heapq import math import time from pm4py.objects.petri_net.obj import PetriNet, Marking from pm4py.objects.petri_net.utils.petri_utils import decorate_places_preset_trans, decorate_transitions_prepostset from algo.search_algorithm import SearchAlgorithm from util.alignment_utils import get_transitions_to_visit...
dvdwndrdl/order-aware-alignments
algo/order_aware/dijkstra_order_aware.py
dijkstra_order_aware.py
py
3,419
python
en
code
1
github-code
21
[ { "api_name": "algo.search_algorithm.SearchAlgorithm", "line_number": 14, "usage_type": "name" }, { "api_name": "pm4py.objects.petri_net.obj.PetriNet", "line_number": 15, "usage_type": "name" }, { "api_name": "pm4py.objects.petri_net.obj.Marking", "line_number": 15, "usag...
25271646550
import sys sys.path.append('/home/pi/git/Robotcar') import evdev from evdev import InputDevice, categorize, ecodes from time import sleep from src.lib.Display import Terminal import random class RemoteControl: aBtn = 304 bBtn = 305 xBtn = 307 yBtn = 308 up = 46 down = 32 left = 18 r...
IA5/RobotPi
Robotcar/src/lib/RemoteControl.py
RemoteControl.py
py
4,726
python
en
code
0
github-code
21
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "src.lib.Display.Terminal", "line_number": 57, "usage_type": "call" }, { "api_name": "evdev.InputDevic...
8043993564
import io import re from operator import itemgetter def itemNumber(item): return item[1] def count(file: io.IOBase) -> list[str]: wc = dict() for line in file: pos = line.find("#") if pos >= 0: line = line[:pos] words = re.split("[\s\.\,\:\;\?\!\"\'\{\}\[\]\(\)\+\=-\\\...
iproduct/intro-python
04-python-academy-files-lab/problem.py
problem.py
py
1,287
python
en
code
6
github-code
21
[ { "api_name": "io.IOBase", "line_number": 9, "usage_type": "attribute" }, { "api_name": "re.split", "line_number": 15, "usage_type": "call" }, { "api_name": "operator.itemgetter", "line_number": 33, "usage_type": "call" }, { "api_name": "operator.itemgetter", ...
9131006245
#!/usr/bin/env python3 """ Pagination function """ import csv import math from typing import List, Tuple def index_range(page: int, page_size: int) -> Tuple[int, int]: """Return 2 member tuple of start, end index """ return ((page - 1) * page_size, page * page_size) class Server: """Server class t...
Eric20Junior/alx-backend
0x00-pagination/2-hypermedia_pagination.py
2-hypermedia_pagination.py
py
1,850
python
en
code
0
github-code
21
[ { "api_name": "typing.Tuple", "line_number": 10, "usage_type": "name" }, { "api_name": "csv.reader", "line_number": 30, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 25, "usage_type": "name" }, { "api_name": "typing.List", "line_number": ...
13623661329
from flask import Flask,render_template,request import numpy as np import pickle app=Flask(__name__) model=pickle.load(open('model.pkl','rb')) city_encoded=pickle.load(open('city.pkl','rb')) @app.route('/') def home(): return render_template('home.html') @app.route('/predict', methods=['POS...
JasnaFaisal/ICT-Main-Project
app.py
app.py
py
2,767
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 7, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.render_template", "line_nu...
10702350921
import os from django.contrib import admin from django.urls import path from django.conf import settings from django.conf.urls.static import static from django.urls.conf import include from rest_framework import permissions from drf_yasg.views import get_schema_view from drf_yasg import openapi schema_view = get_sche...
Thewest123/blog-advanced-api
app/app/urls.py
urls.py
py
1,332
python
en
code
0
github-code
21
[ { "api_name": "drf_yasg.views.get_schema_view", "line_number": 12, "usage_type": "call" }, { "api_name": "drf_yasg.openapi.Info", "line_number": 13, "usage_type": "call" }, { "api_name": "drf_yasg.openapi", "line_number": 13, "usage_type": "name" }, { "api_name": ...
23622509778
from typing import List from uuid import UUID from fastapi import Depends, APIRouter, Path, status, HTTPException, Query from backend.crud.crud_playlists import PlaylistsCrud from backend.helpers.auth_helper import Authenticate from backend.helpers.music import is_playlist_showed, validate_playlist_owner, validate_publ...
Semolik/music
backend/api/api_v1/endpoints/music/playlists.py
playlists.py
py
7,693
python
en
code
3
github-code
21
[ { "api_name": "fastapi.APIRouter", "line_number": 10, "usage_type": "call" }, { "api_name": "backend.schemas.playlists.order_playlist_by", "line_number": 17, "usage_type": "name" }, { "api_name": "backend.core.config.settings.Order", "line_number": 19, "usage_type": "attr...
5324613292
import pytest from mock import Mock, patch, call from .fixtures import engine_mock class TestHelperFunctions(object): @patch('ramses.models.engine') def test_get_existing_model_not_found(self, mock_eng): from ramses import models mock_eng.get_document_cls.side_effect = ValueError mod...
gitter-badger/ramses
tests/test_models.py
test_models.py
py
8,721
python
en
code
null
github-code
21
[ { "api_name": "ramses.models.get_existing_model", "line_number": 13, "usage_type": "call" }, { "api_name": "ramses.models", "line_number": 13, "usage_type": "name" }, { "api_name": "mock.patch", "line_number": 9, "usage_type": "call" }, { "api_name": "ramses.model...
23242921184
import numpy as np from utils.preprocessing import compute_average, compute_variance class GaussianNaiveBayes(object): """ A Bayes classifier is a simple probabilistic classifier, which is based on applying Bayes' theorem. The feature model used by a naive Bayes classifier makes strong independence assum...
ViiSkor/ML-From-Scratch
supervised_learning/gaussian_naive_bayes.py
gaussian_naive_bayes.py
py
5,577
python
en
code
0
github-code
21
[ { "api_name": "numpy.unique", "line_number": 44, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 59, "usage_type": "call" }, { "api_name": "numpy.nditer", "line_number": 76, "usage_type": "call" }, { "api_name": "utils.preprocessing.compute_ave...
39680502
#https://machinelearningmastery.com/how-to-develop-lstm-models-for-multi-step-time-series-forecasting-of-household-power-consumption/ #https://blog.keras.io/a-ten-minute-introduction-to-sequence-to-sequence-learning-in-keras.html #https://levelup.gitconnected.com/building-seq2seq-lstm-with-luong-attention-in-keras-for-...
mauriciodev/tec_forecast
train.py
train.py
py
8,271
python
en
code
8
github-code
21
[ { "api_name": "os.environ", "line_number": 12, "usage_type": "attribute" }, { "api_name": "tensorflow.config.experimental.set_memory_growth", "line_number": 24, "usage_type": "call" }, { "api_name": "tensorflow.config", "line_number": 24, "usage_type": "attribute" }, ...
72166888692
import logging import sqlite3 import DeviceData # import ConfigClasses import re def execute_queries(cursor, queries, placeholders=None, data=None): try: if placeholders and data: for query, args in zip(queries, zip(placeholders, data)): cursor.execute(query, args[1]) e...
matthewmoonen/LogiOpsGui
execute_db_queries.py
execute_db_queries.py
py
18,637
python
en
code
0
github-code
21
[ { "api_name": "sqlite3.Error", "line_number": 17, "usage_type": "attribute" }, { "api_name": "logging.error", "line_number": 18, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 23, "usage_type": "call" }, { "api_name": "sqlite3.Error", ...
42254044179
# -*- coding: utf-8 -*- from json import JSONDecodeError from time import sleep from functools import partial import pandas as pd import quandl import quandl.errors.quandl_error import core.utility from core.contract_store import Store, QuotesType, columns_mapping from data.data_provider import DataProvider from core...
chrism2671/PyTrendFollow
data/quandl_provider.py
quandl_provider.py
py
7,448
python
en
code
238
github-code
21
[ { "api_name": "core.logger.get_logger", "line_number": 15, "usage_type": "call" }, { "api_name": "data.data_provider.DataProvider", "line_number": 18, "usage_type": "name" }, { "api_name": "core.contract_store.QuotesType.futures", "line_number": 24, "usage_type": "attribu...
71837093813
import numpy as np from scipy.ndimage import grey_dilation, grey_erosion from pathlib import Path import torch import torchvision from PIL import Image import random import cv2 from kornia.morphology import dilation, erosion from torch.nn import functional as F def generate_trimap_from_alpha(masks): batch_size, h...
bsuleymanov/alpha-matting
src/image_utils.py
image_utils.py
py
3,636
python
en
code
1
github-code
21
[ { "api_name": "numpy.zeros_like", "line_number": 15, "usage_type": "call" }, { "api_name": "scipy.ndimage.grey_dilation", "line_number": 18, "usage_type": "call" }, { "api_name": "scipy.ndimage.grey_erosion", "line_number": 19, "usage_type": "call" }, { "api_name"...
24057106091
""" This is the Entry point for Training the Machine Learning Model. Written By: Shahriar Sourav Version: 1.0 Revisions: None """ # Doing the necessary imports from sklearn.model_selection import train_test_split from data_ingestion import data_loader from data_preprocessing import preprocessing from data_preproces...
shahriarkasib/waferproject
trainingModel.py
trainingModel.py
py
6,808
python
en
code
0
github-code
21
[ { "api_name": "logs_insertion_to_db.training_log_insertion_to_db.training_log_insertion_to_db", "line_number": 30, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 35, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 35, ...
20676991971
from lib.ui_interface import Ui_MainWindow from lib.Models.connection import Conexion from lib.Models.Acto import Acto from lib.Models.Voluntario import Voluntario from lib.Models.Informe import Informe from lib.Models.Licencias import Licencia from PySide6 import QtWidgets, QtCore import sys import os.path import pdfk...
Patejuei/Sistema-Estadistica
programa.py
programa.py
py
27,697
python
es
code
0
github-code
21
[ { "api_name": "PySide6.QtWidgets.QMainWindow", "line_number": 14, "usage_type": "attribute" }, { "api_name": "PySide6.QtWidgets", "line_number": 14, "usage_type": "name" }, { "api_name": "lib.ui_interface.Ui_MainWindow", "line_number": 14, "usage_type": "name" }, { ...
18587389211
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains the classes and utility functions for distance and cartesian coordinates. """ import warnings import numpy as np from astropy import units as u from astropy.utils.exceptions import AstropyWarning from .angles import Angle __a...
astropy/astropy
astropy/coordinates/distances.py
distances.py
py
9,174
python
en
code
4,015
github-code
21
[ { "api_name": "astropy.units.SpecificTypeQuantity", "line_number": 23, "usage_type": "attribute" }, { "api_name": "astropy.units", "line_number": 23, "usage_type": "name" }, { "api_name": "astropy.units.m", "line_number": 100, "usage_type": "attribute" }, { "api_n...
16297394981
# Down The Marianas Trench Initial Release - Computer Science - Culminating Performance Task # **IMPORTANT NOTE** Program was written in VSCODE, certain elements/components may not work as expected on Repl.it.** # **IMPORTANT NOTE** Possible file location issues with Pyzo. Please use r prefix to specify proper file loc...
nuhgooyin/World-Vision-Gamemaker-Contest
ICS3UC CPT By Dan Nguyen.py
ICS3UC CPT By Dan Nguyen.py
py
19,647
python
en
code
1
github-code
21
[ { "api_name": "pygame.init", "line_number": 16, "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.displa...
4350228130
import pandas as pd from sqlalchemy.orm import Session from db.vehicles import VehicleModel from services.vehicles_data_service import VehiclesDataService from tests.factories.vehicle_factory import VehicleModelFactory from unittest.mock import patch, MagicMock import pytest import io # The vehicles_data_service fixt...
JesusAnaya/vehicles-get-information-api
tests/services/test_vehicles_data_service.py
test_vehicles_data_service.py
py
5,640
python
en
code
0
github-code
21
[ { "api_name": "sqlalchemy.orm.Session", "line_number": 15, "usage_type": "name" }, { "api_name": "services.vehicles_data_service.VehiclesDataService", "line_number": 16, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 14, "usage_type": "call" }, ...
70533983092
import pytest from solutions import ( _compare, _find_indexes_of_packet_pairs_in_correct_order, _load_puzzle_input, _parse, ) @pytest.fixture def example_data(): example_input = _load_puzzle_input(filename="example.txt") return _parse(example_input) def test_parse(example_data): assert l...
TomJGooding/advent-of-code
src/advent_of_code/year_2022/day_13/test_solutions.py
test_solutions.py
py
1,313
python
en
code
0
github-code
21
[ { "api_name": "solutions._load_puzzle_input", "line_number": 12, "usage_type": "call" }, { "api_name": "solutions._parse", "line_number": 13, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 10, "usage_type": "attribute" }, { "api_name": "sol...
12606731041
# python/exam_solution.py import datetime class PostcardList: def __init__(self): self._file = None self._postcards = list() self._date = dict() self._from = dict() self._to = dict() def writeFile(self): ''' Write self.{_date,_from,_to} to self._file ...
pigozzif/Advanced_Programming_2018-19_Final_Project
Python/exam_solution.py
exam_solution.py
py
4,195
python
en
code
0
github-code
21
[ { "api_name": "datetime.datetime.strptime", "line_number": 120, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 120, "usage_type": "attribute" } ]
10290942409
import itertools from pathlib import Path from typing import List import matplotlib.pyplot as plt import pandas as pd import seaborn as sns from exptune.utils import FinalRunsSummarizer def _trial_curve(train_df: pd.DataFrame, quantity: str, path: Path) -> None: plt.clf() sns.lineplot(x="training_iteration"...
shyam196/exptune
exptune/summaries/final_run_summaries.py
final_run_summaries.py
py
3,160
python
en
code
0
github-code
21
[ { "api_name": "pandas.DataFrame", "line_number": 12, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 12, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.clf", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.p...
7520081091
import cryptography.x509 import re from ._bean import bean_serializer, value_to_xml from ._bean_serializers import bean_class @bean_class('javax.security.auth.x500.X500Principal') class Name(list): #: The escapable characters ESCAPABLES = ('"', '+', ',', ';', '<', '>') #: A mapping from short attribute ...
moses-palmer/truepy
lib/truepy/_name.py
_name.py
py
3,789
python
en
code
44
github-code
21
[ { "api_name": "cryptography.x509.x509", "line_number": 15, "usage_type": "attribute" }, { "api_name": "cryptography.x509", "line_number": 15, "usage_type": "name" }, { "api_name": "cryptography.x509.x509", "line_number": 16, "usage_type": "attribute" }, { "api_nam...
70046012534
from pytest import raises as assert_raises from bundlebuilder.constants import ( DESCRIPTION_MAX_LENGTH, CONFIDENCE_CHOICES, REVISION_MIN_VALUE, SEVERITY_CHOICES, SHORT_DESCRIPTION_LENGTH, TLP_CHOICES, SCHEMA_VERSION, DEFAULT_SESSION_SOURCE, DEFAULT_SESSION_SOURCE_URI, DEFAULT_S...
CiscoSecurity/tr-05-ctim-bundle-builder
tests/unit/models/primary/test_sighting.py
test_sighting.py
py
5,851
python
en
code
3
github-code
21
[ { "api_name": "bundlebuilder.constants.DESCRIPTION_MAX_LENGTH", "line_number": 39, "usage_type": "name" }, { "api_name": "bundlebuilder.constants.DESCRIPTION_MAX_LENGTH", "line_number": 50, "usage_type": "name" }, { "api_name": "pytest.raises", "line_number": 57, "usage_t...
73366317172
import config from .email_constants import * import clients.ses_client as ses import utils.general def send_experiment_status_email(exp, to_email): body = get_experiment_status_template(exp) ses.send_email(EXPERIMENT_STATUS_EMAIL['subject'], body, to_email) def get_experiment_status_template(exp): statu...
bfortuner/pytorch-kaggle-starter
notifications/emailer.py
emailer.py
py
644
python
en
code
317
github-code
21
[ { "api_name": "clients.ses_client.send_email", "line_number": 9, "usage_type": "call" }, { "api_name": "clients.ses_client", "line_number": 9, "usage_type": "name" }, { "api_name": "utils.general.general.dict_to_html_ul", "line_number": 15, "usage_type": "call" }, { ...
32714540301
#%% import os import json import logging import time from Notification import NotifyThread from telegram.ext import Updater, Filters, CommandHandler, MessageHandler from MsgReplyer import start_cmd, help_cmd, add_cmd, del_cmd, list_cmd, exp_msg, error_callback logging.basicConfig(format='%(asctime)s - %(name)s - %(le...
PipperL/Discount_Notf_Bot
src/main.py
main.py
py
1,876
python
en
code
0
github-code
21
[ { "api_name": "logging.basicConfig", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.WARNING", "line_number": 14, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "json.load"...
42759879849
import sys import os import shutil if sys.version_info[0] == 2: import ConfigParser as configparser else: import configparser from .kwargs import ENCODER_DECODER_MORPH_LEARNER_INITIALIZATION_KWARGS class Config(object): def __init__(self, path): config = configparser.ConfigParser() confi...
coryshain/MorphAE
encoder_decoder_morph_learner/config.py
config.py
py
2,364
python
en
code
0
github-code
21
[ { "api_name": "sys.version_info", "line_number": 4, "usage_type": "attribute" }, { "api_name": "configparser.ConfigParser", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 36, "usage_type": "call" }, { "api_name": "os.path...
30505910338
# To read district densities csv files import csv # To handle colors from matplotlib.cm import plasma, inferno, Greys, viridis from matplotlib.colors import to_hex # To work with json formatted files import json # To work with polygons from shapely.geometry import Point from shapely.geometry.polygon import Polygon ...
schakalakka/uab-ri
mapping/districts.py
districts.py
py
6,962
python
en
code
1
github-code
21
[ { "api_name": "csv.reader", "line_number": 46, "usage_type": "call" }, { "api_name": "matplotlib.cm.Greys", "line_number": 119, "usage_type": "name" }, { "api_name": "matplotlib.cm.plasma", "line_number": 121, "usage_type": "name" }, { "api_name": "matplotlib.cm.i...
8195599099
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Jun 22 08:27:24 2018 @author: john """ import numpy as np import scipy as scp import scipy.stats as stats import matplotlib.pyplot as plt #test formulations of reward functions def calcActionDiffRew(a, wt=1.0): adt = a.dot(a) rew = wt * np.exp...
jturner65/Getup-DRL_Sripts
test stuff/testRwdFuncFormula.py
testRwdFuncFormula.py
py
8,298
python
en
code
0
github-code
21
[ { "api_name": "numpy.exp", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 105, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number...
24345086816
from selenium import webdriver import pandas # import pyexcel as p import datetime import time import math import argparse import datetime from tkinter import * from functools import partial import tkinter as tk from tkinter import messagebox def selenium(worker): PROXY = "proxy.fpt.vn:80" # IP:...
Vutya/NLP
seleniumAndTkinter.py
seleniumAndTkinter.py
py
4,334
python
en
code
0
github-code
21
[ { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 17, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 17, "usage_type": "name" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 21, "usage_type": "call" }, { "api...
15761471583
import numpy as np import os import PIL.Image as pil import random import torch from torchvision import transforms import cv2 from .mono_dataset import MonoDataset from tools.add_noise import add_gausian_noise class UAVDataset(MonoDataset): """Superclass for UAV dataset loaders """ def __init__(self, *a...
hjxwhy/monodepth2
datasets/uav_dataset.py
uav_dataset.py
py
7,884
python
en
code
null
github-code
21
[ { "api_name": "mono_dataset.MonoDataset", "line_number": 13, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 27, "usage_type": "attribute" }, { "api_name": "random.shuffl...
27922988657
''' https://github.com/snap-stanford/ogb/blob/master/examples/nodeproppred/products/graph_saint.py master: cb1f235 report acc: 0.7908 ± 0.0024 rank: 10 date: 2020-10-27 ''' import time import sys import argparse import torch from tqdm import tqdm import torch.nn.functional as F from torch_geometric.data import Graph...
AugF/ogb-evaluations
exp/products/graphsaint_sage.py
graphsaint_sage.py
py
9,909
python
en
code
0
github-code
21
[ { "api_name": "torch.nn", "line_number": 24, "usage_type": "attribute" }, { "api_name": "torch.nn.ModuleList", "line_number": 29, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 29, "usage_type": "attribute" }, { "api_name": "torch_geometric.nn.SA...
23837222800
""" Preprocessor and data importer from course distributions by yearsessions. Uses a combination of PAIR Reports and Tableau Dashboard data. """ from app import create_app from config import Config from app.models import PAIRReportsGrade as PRG, TableauDashboardGrade as TDG, TableauDashboardV2Grade as TDG2, CourseV2, ...
DonneyF/ubcgrades
scripts/db_fill_course_distributions.py
db_fill_course_distributions.py
py
8,781
python
en
code
27
github-code
21
[ { "api_name": "app.models.CampusEnum.UBCV", "line_number": 15, "usage_type": "attribute" }, { "api_name": "app.models.CampusEnum", "line_number": 15, "usage_type": "name" }, { "api_name": "app.models.CampusEnum.UBCO", "line_number": 15, "usage_type": "attribute" }, { ...
19071524738
from typing import Optional from TreeNode import TreeNode # https://leetcode.com/problems/merge-two-binary-trees/ # Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left class Solution: def mergeTrees(self, r...
BoydBLever/Algorithms
LeetCodePatterns/617.MergeTwoBinaryTrees.py
617.MergeTwoBinaryTrees.py
py
785
python
en
code
0
github-code
21
[ { "api_name": "typing.Optional", "line_number": 11, "usage_type": "name" }, { "api_name": "TreeNode.TreeNode", "line_number": 11, "usage_type": "name" } ]
35593407808
from geotiler.geo import Transformation, WebMercator, zoom_to from functools import partial import pytest approx = partial(pytest.approx, abs=1e-3) @pytest.fixture def web_mercator(): wm = WebMercator(10) wm.transformation = Transformation(1, 0, 0, 0, 1, 0) return wm def test_transformation_identity() ...
wrobell/geotiler
geotiler/tests/test_geo.py
test_geo.py
py
2,446
python
en
code
41
github-code
21
[ { "api_name": "functools.partial", "line_number": 6, "usage_type": "call" }, { "api_name": "pytest.approx", "line_number": 6, "usage_type": "attribute" }, { "api_name": "geotiler.geo.WebMercator", "line_number": 10, "usage_type": "call" }, { "api_name": "geotiler....
72069873333
from socketserver import TCPServer, ThreadingMixIn, BaseRequestHandler from datetime import datetime, date from kafka import KafkaConsumer from kafka import KafkaProducer import _thread import time class ThreadedTCPServer(ThreadingMixIn, TCPServer): pass class OnesSocketServerHandler(BaseRequestHandler): def ...
dmarenin/OnesSocketServer
OnesSocketServer/ones_socket_server.py
ones_socket_server.py
py
4,577
python
en
code
0
github-code
21
[ { "api_name": "socketserver.ThreadingMixIn", "line_number": 8, "usage_type": "name" }, { "api_name": "socketserver.TCPServer", "line_number": 8, "usage_type": "name" }, { "api_name": "socketserver.BaseRequestHandler", "line_number": 11, "usage_type": "name" }, { "...
36444994561
#the last thing I was working on was the thing where I have a dictionary of things and #I also have a list of things, complementary, may or may ot be necessary, actually maybe unique from kivy.app import App from kivy.uix.label import Label from kivy.graphics import Color, Rectangle from kivy.uix.screenmanager import ...
JessieSalas/chorderly
main.py
main.py
py
4,147
python
en
code
0
github-code
21
[ { "api_name": "kivy.uix.floatlayout.FloatLayout", "line_number": 17, "usage_type": "name" }, { "api_name": "kivy.properties.ListProperty", "line_number": 20, "usage_type": "call" }, { "api_name": "kivy.properties.StringProperty", "line_number": 22, "usage_type": "call" ...
33892034095
from flask import Flask, flash, redirect, render_template, request, session, abort, url_for import os from pymongo import MongoClient import json from werkzeug import secure_filename # import csv # import subprocess import pandas as pd import numpy as np from util_nlp_2 import parseS from gcpParser import syntax_text f...
arthurkang123/natural-language-processing-bi
legacy.py
legacy.py
py
8,317
python
en
code
0
github-code
21
[ { "api_name": "pymongo.MongoClient", "line_number": 17, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 21, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 24, "usage_type": "call" }, { "api_name": "flask.request.method", ...
20753342237
from sqlalchemy import create_engine from sqlalchemy.orm import scoped_session, sessionmaker db_url = "postgres://lgttpdhhguejbs:f4d62fb55654bc4926db58ad57b54674c779415c1febfcf87246574937f04fcf@ec2-107-20-173-2.compute-1.amazonaws.com:5432/d98ghsgms2kp76" engine = create_engine(db_url) db = scoped_session(sessionmaker...
flyyee/cep-moviereviewsite
1.0/t/findtests.py
findtests.py
py
741
python
en
code
0
github-code
21
[ { "api_name": "sqlalchemy.create_engine", "line_number": 5, "usage_type": "call" }, { "api_name": "sqlalchemy.orm.scoped_session", "line_number": 6, "usage_type": "call" }, { "api_name": "sqlalchemy.orm.sessionmaker", "line_number": 6, "usage_type": "call" } ]
10027120742
import requests as rq from bs4 import BeautifulSoup import time import json import re import numpy as np import datetime import unicodedata import pandas as pd from selenium import webdriver from selenium.webdriver.common.by import By from selenium import webdriver from selenium.webdriver.common.by import By from sel...
zacharyang/dsi-sg-6
Project-4/get_jobs.py
get_jobs.py
py
4,514
python
en
code
1
github-code
21
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 39, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 39, "usage_type": "name" }, { "api_name": "selenium.webdriver.support.ui.WebDriverWait", "line_number": 45, "usage_type": "call" }, ...
20192606363
#!/usr/bin/python3 import argparse import json PUBLIC_MACROS = ( ( "RELLUME_PUBLIC_REG", lambda e: "reg" in e and e.get("export"), "RELLUME_PUBLIC_REG({name}, {NAME}, {size}, {offset})", ), ) PRIVATE_MACROS = ( ( "RELLUME_MAPPED_REG", lambda e: "reg" in e, "RELLUME_MAPPED_...
aengelke/rellume
data/rellume/cpustruct_parser.py
cpustruct_parser.py
py
1,467
python
en
code
259
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 25, "usage_type": "call" }, { "api_name": "argparse.FileType", "line_number": 27, "usage_type": "call" }, { "api_name": "argparse.FileType", "line_number": 28, "usage_type": "call" }, { "api_name": "json.load...
34856560321
import cv2 import numpy as np import re def drawtext(framedata, coords, text="No data", ): """ Draws the requested text on top of a video frame :param framedata: the video frame :param coords: X, Y coordinates of the left-bottom corner of a text rectangle :param text: the text to be ...
igyukun/GetVoxiVideoPythonProject
utils.py
utils.py
py
2,106
python
en
code
0
github-code
21
[ { "api_name": "cv2.FONT_HERSHEY_PLAIN", "line_number": 14, "usage_type": "attribute" }, { "api_name": "cv2.putText", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.FILLED", "line_number": 16, "usage_type": "attribute" }, { "api_name": "numpy.mean", ...
467433543
import telebot from core import anki_engine from bot.base_view.views import ViewPrototype from . import keyboards from . import messages class CardView(ViewPrototype): def ask_first_card_side(self): self.edit_to_cancel_message() placeholder = telebot.types.ForceReply(input_field_placeholder=mes...
KozlovKV/anki-bot
bot/card_view/views.py
views.py
py
3,627
python
en
code
1
github-code
21
[ { "api_name": "bot.base_view.views.ViewPrototype", "line_number": 11, "usage_type": "name" }, { "api_name": "telebot.types.ForceReply", "line_number": 14, "usage_type": "call" }, { "api_name": "telebot.types", "line_number": 14, "usage_type": "attribute" }, { "api...
39868484933
# endpoints/read.py from fastapi import HTTPException, APIRouter from api.crud import read_email router = APIRouter() @router.get("/read/{email_id}", response_description="Read an email by ID") def read_endpoint(email_id: str): email = read_email(email_id) if email: return email raise HTTPExceptio...
yves1da2vinci3/email_autmoation
api/endpoints/read.py
read.py
py
365
python
en
code
0
github-code
21
[ { "api_name": "fastapi.APIRouter", "line_number": 5, "usage_type": "call" }, { "api_name": "api.crud.read_email", "line_number": 9, "usage_type": "call" }, { "api_name": "fastapi.HTTPException", "line_number": 12, "usage_type": "call" } ]
16992977794
from collections import defaultdict, Counter import numpy as np from inverted_index_gcp import * import math TUPLE_SIZE = 6 TF_MASK = 2 ** 16 - 1 # Masking the 16 low bits of an integer from contextlib import closing def read_posting_list(inverted, w,folder_name): with closing(MultiFileReader()) as r...
noaradin1/Information-Retreival-Project
ranking.py
ranking.py
py
4,613
python
en
code
0
github-code
21
[ { "api_name": "contextlib.closing", "line_number": 12, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 37, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 61, "usage_type": "call" }, { "api_name": "nu...
40542728132
from common.agent_events import FingerprintingEvent from common.types import SocketAddress from monkey_island.cc.models import Machine, NetworkServices from monkey_island.cc.repositories import IMachineRepository, NetworkModelUpdateFacade class FingerprintingEventHandler: """ Handles fingerprinting event and ...
guardicore/monkey
monkey/monkey_island/cc/agent_event_handlers/fingerprinting_event_handler.py
fingerprinting_event_handler.py
py
2,313
python
en
code
6,367
github-code
21
[ { "api_name": "monkey_island.cc.repositories.NetworkModelUpdateFacade", "line_number": 14, "usage_type": "name" }, { "api_name": "monkey_island.cc.repositories.IMachineRepository", "line_number": 15, "usage_type": "name" }, { "api_name": "common.agent_events.FingerprintingEvent",...
12407399437
from pyspark import SparkConf, SparkContext # setting up sparkContext (sc) conf = SparkConf().setMaster("local").setAppName("minTemperatures") sc = SparkContext(conf=conf) # reading the csv file and returning a RDD object lines = sc.textFile("G://Mi unidad//Big data//Spark//RDD//1800.csv") def parseline(l...
juanfelipehdezm/Big-Data
Spark/RDD/min_max_temperatures.py
min_max_temperatures.py
py
1,172
python
en
code
0
github-code
21
[ { "api_name": "pyspark.SparkConf", "line_number": 4, "usage_type": "call" }, { "api_name": "pyspark.SparkContext", "line_number": 5, "usage_type": "call" } ]
25541402441
import face_alignment import imageio import time import logging import sys DEVICE = "cpu" if "c" in sys.argv[1] else "cuda:0" FNAME = sys.argv[2] logger = logging.getLogger(__name__) logging.basicConfig(level=logging.DEBUG) t0 = time.time() logger.debug("Module start") # Run the 3D face alignment on a test image, wi...
sltay/face-alignment
hpc/small_gpu.py
small_gpu.py
py
875
python
en
code
null
github-code
21
[ { "api_name": "sys.argv", "line_number": 7, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 8, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.basicConfig", ...
40994005225
"""Python setup.py for pyUdK package""" import io import os from setuptools import find_packages, setup VERSION = '1.0.6' def read(*paths, **kwargs): """Read the contents of a text file safely. >>> read("project_name", "VERSION") '0.1.0' >>> read("README.md") ...""" content = "" with io.open( ...
Eddy-Morgan/pyudk
setup.py
setup.py
py
1,860
python
en
code
0
github-code
21
[ { "api_name": "io.open", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number"...
42684912243
import os from keras.preprocessing import image from keras.applications.inception_v3 import InceptionV3, preprocess_input from keras.models import Model, load_model from keras.layers import Input import numpy as np import keras import os.path from tqdm import tqdm import csv import tensorflow import random import glob ...
lucky31044/Action-Recognition-
app.py
app.py
py
4,700
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_...
7986099384
import copy import PySimpleGUI as sg import pandas as pd from datetime import datetime, timedelta from statsmodels.tsa.statespace.sarimax import SARIMAX import matplotlib.pyplot as plt from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk import random import numpy as np def generate_f...
iTteruya/TouristFLowModel
src/forecasting.py
forecasting.py
py
12,756
python
en
code
0
github-code
21
[ { "api_name": "random.choice", "line_number": 28, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 39, "usage_type": "call" }, { "api_name": "numpy.concatenate", "line_number": 51, "usage_type": "call" }, { "api_name": "numpy.array", "line...
70118326772
""" @author lferiani @date June 18th, 2019 Pipette rack in 4 and 1 Source 48MWP in 2 Destination 96MWP in 3 First take some water from A2 and put it in C2, take some DMSO from B2 and mix it with the water in C2, Take 1.5 ul DMSO from B2 and distribute it in destination Take 3 ul of DMSO+H2O from C2 and distribute it ...
luigiferiani/OTprotocols
20190618_water+drug_96MWP.py
20190618_water+drug_96MWP.py
py
5,786
python
en
code
0
github-code
21
[ { "api_name": "opentrons.labware.list", "line_number": 58, "usage_type": "call" }, { "api_name": "opentrons.labware", "line_number": 58, "usage_type": "name" }, { "api_name": "opentrons.labware.create", "line_number": 59, "usage_type": "call" }, { "api_name": "ope...
38678593023
import tempfile import seaborn as sns import math from shared import mapColumnNames import pingouin as pg import pandas as pd import matplotlib.pyplot as plt import matplotlib matplotlib.use('Agg') class ParseInput(): def __init__(self, list): self.geek = "GeekforGeeks" self.data = self.preproces...
jordibosch20/statistcts-backend-platform
parseInput.py
parseInput.py
py
4,527
python
en
code
0
github-code
21
[ { "api_name": "matplotlib.use", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 28, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 33, "usage_type": "call" }, { "api_name": "matplotlib....
36552199305
import pygame import sys import time import math import argparse from RobotLib.FrontEnd import * from RobotLib.IO import * from RobotLib.Math import * import numpy as np from threading import Timer W = 0.5 #rad/s L = 8.4 # cm (Distance between wheels) DISPLAY_SIZE = 256 V = 2 # 2 cm/s (Robot velocity) D = 5 # cm (whe...
ericvelazquez/Robotics
HW1/template.py
template.py
py
8,062
python
en
code
0
github-code
21
[ { "api_name": "math.pi", "line_number": 17, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 95, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 100, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number...
26952285920
import torch import torch.nn as nn from torch.nn import init import torch.nn.functional as F from torchsummary import summary class Hswish(nn.Module): def forward(self, x): out = x * F.relu6(x + float(3.0), inplace=True) / float(6.0) return out class Hsigmoid(nn.Module): def forward(self, x...
baaj2109/pytorch_object_detection
models/mobilenetv3.py
mobilenetv3.py
py
6,094
python
en
code
3
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.nn.functional.relu6", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.nn.functi...
19387346793
from django.shortcuts import render, HttpResponseRedirect, HttpResponse from django.utils.timezone import timezone from django.urls import reverse from django import forms from .models import Email from .forms import EmailForm # Create your views here. def index(request): error = '' if request.method == 'POS...
MyodsOnline/FinFax_django
message/views.py
views.py
py
836
python
en
code
0
github-code
21
[ { "api_name": "forms.EmailForm", "line_number": 14, "usage_type": "call" }, { "api_name": "django.shortcuts.HttpResponseRedirect", "line_number": 17, "usage_type": "call" }, { "api_name": "django.urls.reverse", "line_number": 17, "usage_type": "call" }, { "api_nam...
14111624636
from django.shortcuts import render, redirect from django.http import HttpResponse, FileResponse import os import sys import time from subprocess import Popen, PIPE from configparser import ConfigParser import time from django.contrib import auth from django.contrib.auth import authenticate, login from django.contrib...
yann-sjtu/software
show/views.py
views.py
py
8,922
python
en
code
0
github-code
21
[ { "api_name": "sys.path.append", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "configparser.ConfigParser", "line_number": 21, "usage_type": "call" }, { "api_name": "client.bcoscl...
38772379956
#!/usr/bin/env python3 import os import csv import sys import codecs import re import pandas as pd from pandas.io.json import json_normalize import numpy as np import argparse import spacy from spacy.tokens import Doc from spacy.vocab import Vocab from spacy.tokenizer import Tokenizer #from spacy.vectors import Vect...
scalleri/originaltweetsonly
classify.py
classify.py
py
10,331
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 43, "usage_type": "call" }, { "api_name": "sklearn.feature_extraction.text.TfidfVectorizer", "line_number": 53, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.LabelEncoder", "line_number": 54, "usage_ty...
40326161611
from subprocess import Popen, PIPE from time import sleep import json import qrcode def create_qr(data): qr = qrcode.QRCode( version=1, error_correction=qrcode.constants.ERROR_CORRECT_L, box_size=10, border=1, ) qr.add_data(data) qr.make(fit=True) img = qr.make_ima...
xuiqzy/Airdrop-Crazy
airdrop_crazy/utils/ngrok_detect.py
ngrok_detect.py
py
710
python
en
code
null
github-code
21
[ { "api_name": "qrcode.QRCode", "line_number": 8, "usage_type": "call" }, { "api_name": "qrcode.constants", "line_number": 10, "usage_type": "attribute" }, { "api_name": "subprocess.Popen", "line_number": 21, "usage_type": "call" }, { "api_name": "subprocess.PIPE",...
13107275481
# -*- coding: utf-8 -*- from __future__ import print_function from pyicloud import PyiCloudService from base64 import b64decode import boto3 import os APPLICATION_ID = boto3.client('kms').decrypt(CiphertextBlob=b64decode(os.environ['APPLICATION_ID']))['Plaintext'] APPLE_ID = boto3.client('kms').decrypt(CiphertextBlob...
ShinsukeYokota/alexa-iphone-finder
lambda_function.py
lambda_function.py
py
7,749
python
en
code
0
github-code
21
[ { "api_name": "boto3.client", "line_number": 9, "usage_type": "call" }, { "api_name": "base64.b64decode", "line_number": 9, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "boto3.client", "line_n...
33224744538
from django.db import models # Create your models here. from django.utils import timezone from django.utils.text import slugify class Movie(models.Model): CATEGORY_CHOICES = ( ('Action', 'ACTION'), ('Drama', 'DRAMA'), ('Comedy', 'COMEDY'), ('Romance', 'ROMANCE'), ('Horror...
Mouiad-JRA/Movie-app
src/movie/models.py
models.py
py
1,999
python
en
code
1
github-code
21
[ { "api_name": "django.db.models.Model", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 9, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 26, "usage_type": "call" }, { "api_name": ...
31098259097
import numpy as np import matplotlib.pyplot as plt import os import backup def eeg_like(file_name, folder=None): if folder is None: folder = "data/figures" os.makedirs(folder, exist_ok=True) bkp = backup.RunBackup.load(file_name=file_name) pst = bkp.positions prc = bkp.prices t_m...
AurelienNioche/HotellingBathtub
analysis/separate/eeg_like.py
eeg_like.py
py
3,064
python
en
code
0
github-code
21
[ { "api_name": "os.makedirs", "line_number": 13, "usage_type": "call" }, { "api_name": "backup.RunBackup.load", "line_number": 15, "usage_type": "call" }, { "api_name": "backup.RunBackup", "line_number": 15, "usage_type": "attribute" }, { "api_name": "numpy.arange"...
73767945971
from typing import List """ 121. Best Time to Buy and Sell Stock You are given an array prices where prices[i] is the price of a given stock on the ith day. You want to maximize your profit by choosing a single day to buy one stock and choosing a different day in the future to sell that stock. Return the maximum pr...
JayMil/interview_prep
leet_code/0121_best_time_to_buy_and_sell_stock.py
0121_best_time_to_buy_and_sell_stock.py
py
1,182
python
en
code
0
github-code
21
[ { "api_name": "typing.List", "line_number": 22, "usage_type": "name" } ]
17516107470
from setuptools import setup import re # change == to >= def load_reqs(filename): with open(filename) as reqs_file: return [ re.sub('==', '>=', line) for line in reqs_file.readlines() if not re.match(r'\s*#', line) ] requirements = load_reqs('requirements.txt') setup( ...
sanjeevm0/kcluster-client
setup.py
setup.py
py
693
python
en
code
0
github-code
21
[ { "api_name": "re.sub", "line_number": 8, "usage_type": "call" }, { "api_name": "re.match", "line_number": 9, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_number": 14, "usage_type": "call" } ]
22328025376
from collections import defaultdict class Graph: def __init__(self): self.neighbours=defaultdict(list) def addEdge(self,u,v,bidirec=True): #bidirectional True for undirected graph self.neighbours[u].append(v) if(bidirec): self.neighbours[v].append(u) def BFS(self,s): queue=[s] visited=defaultdict(l...
thecodearrow/Algorithms
BFS.py
BFS.py
py
827
python
en
code
2
github-code
21
[ { "api_name": "collections.defaultdict", "line_number": 5, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 15, "usage_type": "call" } ]
39831193540
#!/usr/bin/env python3 """ Script to host a flask application """ from flask import Flask, jsonify app = Flask(__name__) @app.route('/', strict_slashes=True) def index() -> jsonify: info = { "message": "Bienvenue" } return jsonify(info) if __name__ == "__main__": app.run(host="0.0.0.0", p...
Ddilibe/alx-backend-user-data
0x03-user_authentication_service/app.py
app.py
py
332
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 10, "usage_type": "name" } ]
73149018613
import pandas as pd import pickle import requests from bs4 import BeautifulSoup from sklearn.model_selection import train_test_split from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.linear_model import LogisticRegression from sklearn.metrics import precision_score, recall_score, accuracy_score...
gulcinvardar/lyrics_web_scraping
song_lyrics_with_artist_of_choice_model.py
song_lyrics_with_artist_of_choice_model.py
py
6,977
python
en
code
0
github-code
21
[ { "api_name": "nltk.download", "line_number": 17, "usage_type": "call" }, { "api_name": "nltk.download", "line_number": 18, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 27, "usage_type": "call" }, { "api_name": "pandas.read_csv", "li...
70309686134
"""Matplotlib Densityplot.""" from itertools import cycle import matplotlib.pyplot as plt import numpy as np from ....stats import hdi from ....stats.density_utils import get_bins, kde from ...plot_utils import _scale_fig_size, calculate_point_estimate from . import backend_kwarg_defaults, backend_show, create_axes_g...
arviz-devs/arviz
arviz/plots/backends/matplotlib/densityplot.py
densityplot.py
py
5,478
python
en
code
1,461
github-code
21
[ { "api_name": "itertools.cycle", "line_number": 49, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 49, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 49, "usage_type": "name" }, { "api_name": "plo...
4839353346
from django.urls import path from myapp.view import views, blogviews, userview, prideviews, collectviews, commentviews urlpatterns = [ path('index', views.index), path('register', userview.register), path('login', userview.login), path('userdetail', userview.getuser), path('userinfo', userview.get...
CysionLiu/KtDevBox-backend
myapp/urls.py
urls.py
py
1,218
python
en
code
19
github-code
21
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "myapp.view.views.index", "line_number": 6, "usage_type": "attribute" }, { "api_name": "myapp.view.views", "line_number": 6, "usage_type": "name" }, { "api_name": "django.url...
39413912589
from django.shortcuts import render from .models import Room from .models import Message from django.http import Http404 from django.shortcuts import get_object_or_404 from django.shortcuts import redirect from pytz import timezone from django.contrib.auth.models import User from django.contrib.auth.decorators import ...
jeniwen/goodpaint
chat/views.py
views.py
py
1,236
python
en
code
0
github-code
21
[ { "api_name": "django.shortcuts.get_object_or_404", "line_number": 16, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.User", "line_number": 16, "usage_type": "argument" }, { "api_name": "models.Room.objects.get_or_create", "line_number": 17, "usage_type...
5346940298
import os import csv import cv2 import numpy as np import sklearn samples = [] with open('data/driving_log.csv') as csvfile: reader = csv.reader(csvfile) for line in reader: next(reader,None)#neglecting the first line as it is titled row samples.append(line) from sklearn.model_sel...
avinashsingh93/behaviour-cloning
model.py
model.py
py
5,402
python
en
code
0
github-code
21
[ { "api_name": "csv.reader", "line_number": 9, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 16, "usage_type": "call" }, { "api_name": "random.shuffle", "line_number": 24, "usage_type": "call" }, { "api_name": "cv2...
27794955325
import torch import torch.nn as nn from tqdm import tqdm def init_weights(m): for name, param in m.named_parameters(): nn.init.uniform_(param.data, -0.08, 0.08) def write_embeddings(path, embeddings, id_to_vocab): with open(path, 'w') as f: for i, embedding in enumerate(tqdm(embeddings)): ...
dasollee2525/2021-SWE-AIProject
src/utils/pretrain/util_functions.py
util_functions.py
py
720
python
en
code
0
github-code
21
[ { "api_name": "torch.nn.init.uniform_", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.nn.init", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 8, "usage_type": "name" }, { "api_name": "tqdm.tqdm", "line...
3721795539
import matplotlib.pyplot as plt import pandas as pd import numpy as np #Github: https://github.com/sujitmandal #This programe is create by Sujit Mandal """ Github: https://github.com/sujitmandal This programe is create by Sujit Mandal """ data = pd.DataFrame({'x':[12,20,28,18,29,33,24,45,52,51,15,...
sujitmandal/Machine-Learning
k-mean clustering/k-meas clustering for dataset.py
k-meas clustering for dataset.py
py
2,041
python
en
code
2
github-code
21
[ { "api_name": "pandas.DataFrame", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.scatter", "line_number": 21, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 21, "usage_type": "name" }, { "api_name": "numpy.ra...
25630543665
import ealib import datetime import numpy as np population_size = 16 number_of_clusters = 3 objective_indices = [0, 1] archive = ealib.BruteforceArchive(objective_indices) init = ealib.CategoricalUniformInitializer() foslearner = ealib.CategoricalLinkageTree(ealib.NMI(), ealib.FoSOrdering.AsIs) criterion = ealib.MOG...
8uurg/Impact-of-Asynchrony-on-MBEAs
EALib/python_examples/example_mo_single_pop.py
example_mo_single_pop.py
py
1,621
python
en
code
0
github-code
21
[ { "api_name": "ealib.BruteforceArchive", "line_number": 9, "usage_type": "call" }, { "api_name": "ealib.CategoricalUniformInitializer", "line_number": 10, "usage_type": "call" }, { "api_name": "ealib.CategoricalLinkageTree", "line_number": 11, "usage_type": "call" }, ...
41567300711
#!/usr/bin/env python3 import os import argparse import re import subprocess def get_process_user(pid): """Retrieve the user of a given process.""" cmd = f"ps -o user= -p {pid}" result = subprocess.check_output(cmd, shell=True).decode('utf-8').strip() return result def get_gpu_processes(): """Get...
csullivan/settings
scripts/kill_orphaned_gpu_processes.py
kill_orphaned_gpu_processes.py
py
2,276
python
en
code
0
github-code
21
[ { "api_name": "subprocess.check_output", "line_number": 11, "usage_type": "call" }, { "api_name": "subprocess.check_output", "line_number": 17, "usage_type": "call" }, { "api_name": "subprocess.check_output", "line_number": 31, "usage_type": "call" }, { "api_name"...
23860967517
import itertools import numpy as np from scipy import signal from scipy.stats import skew, kurtosis from biosppy.signals import ecg from features import hrv, heartbeats, fs from features.melbourne_eeg import calcActivity, calcMobility, calcComplexity from loading import loader from utils import common, matlab def fr...
victorkifer/ecg-af-detection-physionet-2017
features/feature_extractor5.py
feature_extractor5.py
py
7,592
python
en
code
18
github-code
21
[ { "api_name": "scipy.signal.welch", "line_number": 14, "usage_type": "call" }, { "api_name": "scipy.signal", "line_number": 14, "usage_type": "name" }, { "api_name": "loading.loader.FREQUENCY", "line_number": 14, "usage_type": "attribute" }, { "api_name": "loading...
37259658372
import numpy as np import pandas as pd import re import nltk import json from sklearn.feature_extraction.text import TfidfVectorizer import numpy def largest_indices(ary, n): """Returns the n largest indices from a numpy array.""" flat = ary.flatten() indices = np.argpartition(flat, -n)[-n:] indice...
ahmedakbari/big_data
twitter_preprocess/keyword_extractor.py
keyword_extractor.py
py
2,032
python
en
code
0
github-code
21
[ { "api_name": "numpy.argpartition", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.argsort", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.unravel_index", "line_number": 18, "usage_type": "call" }, { "api_name": "sklearn.feature_...
23386957237
""" Raul Valenzuela raul.valenzuela@colorado.edu """ import matplotlib.pyplot as plt import numpy as np import seaborn as sns import tta_analysis3 as tta import pandas as pd import tta_continuity from matplotlib import rcParams from rv_utilities import discrete_cmap # sns.reset_orig() sns.set_style("whiteg...
rvalenzuelar/tta_climatology
figure_tta_events_per_season_and_wd.py
figure_tta_events_per_season_and_wd.py
py
4,233
python
en
code
1
github-code
21
[ { "api_name": "seaborn.set_style", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.rcParams", "line_number": 21, "usage_type": "name" }, { "api_name": "matplotlib.rcParams", "line_number": 22, "usage_type": "name" }, { "api_name": "matplotlib....
34658103051
import socket import tqdm import os SEPARATOR = "<SEPARATOR>" s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((socket.gethostname(), 8090)) # msg_from_server = s.recv(4096) # print(msg_from_server.decode('utf-8')) filename = input(r'Enter path of Image : ') filesize = os.path.getsize(filename) s.send...
dzakw/client-sock
tes_client_sock_python.py
tes_client_sock_python.py
py
962
python
en
code
0
github-code
21
[ { "api_name": "socket.socket", "line_number": 6, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 6, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREAM", "line_number": 6, "usage_type": "attribute" }, { "api_name": "socket.gethost...
26885641172
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('healers', '0012_auto_20141127_0720'), ] operations = [ migrations.AlterModelOptions( name='giftcertificate', ...
RumorIO/healersource
apps/healers/migrations/0013_auto_20141204_1737.py
0013_auto_20141204_1737.py
py
1,033
python
en
code
0
github-code
21
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AlterModelOptions", "line_number": 14, "usage_type": "call" ...
7564000547
#!/usr/bin/env python import matplotlib.pyplot as plt import matplotlib.patches as patches import numpy as np path = np.loadtxt('path.txt') # print (path[0]) smoothpath = np.loadtxt('smoothpath.txt') # print (smoothpath.shape) x_list = path[0].tolist() y_list = path[1].tolist() x_list_smoothed = smoothpath[0].toli...
Zhanghq8/Rapidly_Exploring_Random_Tree
display.py
display.py
py
1,237
python
en
code
2
github-code
21
[ { "api_name": "numpy.loadtxt", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pyplot"...
8648759187
#!/usr/bin/env python from __future__ import absolute_import from __future__ import division from __future__ import print_function from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter import tensorflow as tf import tensorflow.contrib.slim as slim from dataset_factory import get_split def get_dataset(...
tue-robotics-graveyard/tensorflow_playground
retrain_slim.py
retrain_slim.py
py
5,171
python
en
code
0
github-code
21
[ { "api_name": "dataset_factory.get_split", "line_number": 15, "usage_type": "call" }, { "api_name": "tensorflow.variable_scope", "line_number": 21, "usage_type": "call" }, { "api_name": "tensorflow.contrib.slim.conv2d", "line_number": 23, "usage_type": "call" }, { ...
9129776918
import re from datetime import datetime from ScrapeUFC.util import BaseParser, helpers class FighterParser(BaseParser): def __init__(self, db, response, fighter_id): super().__init__(db, response) self.fighter_id = fighter_id self.base_url = self.domain + '/fighter-details' self...
clueshh/ufcstats
ScrapeUFC/util/FighterParser.py
FighterParser.py
py
3,071
python
en
code
1
github-code
21
[ { "api_name": "ScrapeUFC.util.BaseParser", "line_number": 7, "usage_type": "name" }, { "api_name": "ScrapeUFC.util.helpers.split_name", "line_number": 17, "usage_type": "call" }, { "api_name": "ScrapeUFC.util.helpers", "line_number": 17, "usage_type": "name" }, { ...
32957974637
# Donovan Moini ''' The Pathfinder class is responsible for finding a solution (i.e., a sequence of actions) that takes the agent from the initial state to all of the goals with optimal cost. This task is done in the solve method, as parameterized by a maze pathfinding problem, and is aided by the SearchTreeNod...
dmoini/cmsi485-artificial-intelligence
homework-1/Pathfinder.py
Pathfinder.py
py
5,395
python
en
code
0
github-code
21
[ { "api_name": "queue.PriorityQueue", "line_number": 30, "usage_type": "call" }, { "api_name": "SearchTreeNode.SearchTreeNode", "line_number": 31, "usage_type": "call" }, { "api_name": "SearchTreeNode.SearchTreeNode", "line_number": 43, "usage_type": "call" }, { "a...
5874451989
import math from numpy import NaN import torch import torch.nn.functional as F from torch.autograd import Variable import torch.distributions as TD ONEOVERSQRT2PI = 1.0 / math.sqrt(2*math.pi) T=0.1 device = 'cuda' def l1(i,j,s): non = torch.sum(torch.exp(s[i,:]/T))-torch.exp(s[i,i]/T) return -torch.log(torch....
jeongeun980906/Representation_Learning_R3
core/loss.py
loss.py
py
4,191
python
en
code
0
github-code
21
[ { "api_name": "math.sqrt", "line_number": 8, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.sum", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.exp", "line_number": 13, ...
71181528692
from mysql.connector import Error from mysql.connector import MySQLConnection from configparser import ConfigParser import os class DbConnection: __instance = None @staticmethod def get_instance(): """ Static access method. """ if DbConnection.__instance == None: DbConnection()...
Ladrys/Database_app
src/db_connect.py
db_connect.py
py
2,313
python
en
code
0
github-code
21
[ { "api_name": "configparser.ConfigParser", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_number": 28, "usage_type": "attribute" }, { "api_name": "os.path.realpa...
35897353686
from itertools import permutations import networkx as nx from .matrix_graph import MatrixGraph from graphmodels import DGM class InvalidOperation(Exception): pass class LocalOperation: def __init__(self, graph, fscore): self.graph = graph self.fscore = fscore def do(self): raise...
DLunin/pygraphmodels
graphmodels/structure/local_search.py
local_search.py
py
4,358
python
en
code
0
github-code
21
[ { "api_name": "networkx.DiGraph", "line_number": 114, "usage_type": "call" }, { "api_name": "matrix_graph.MatrixGraph.from_networkx_DiGraph", "line_number": 116, "usage_type": "call" }, { "api_name": "matrix_graph.MatrixGraph", "line_number": 116, "usage_type": "name" }...
32412628068
#!/usr/bin/env python3 # # Author: # Tamas Jos (@skelsec) # import enum from urllib.parse import urlparse, parse_qs from asysocks.common.clienturl import SocksClientURL class MSLDAPProxyType(enum.Enum): SOCKS4 = 'SOCKS4' SOCKS4_SSL = 'SOCKS4_SSL' SOCKS5 = 'SOCKS5' SOCKS5_SSL = 'SOCKS5_SSL' MULTIPLEXOR = 'MUL...
ryanmrestivo/red-team
Exploitation-Tools/CrackMapExec/site-packages/msldap/commons/proxy.py
proxy.py
py
3,511
python
en
code
91
github-code
21
[ { "api_name": "enum.Enum", "line_number": 13, "usage_type": "attribute" }, { "api_name": "urllib.parse.urlparse", "line_number": 49, "usage_type": "call" }, { "api_name": "urllib.parse.parse_qs", "line_number": 53, "usage_type": "call" }, { "api_name": "asysocks.c...
6170707151
# -*- coding: utf-8 -*- """ Created on Tue Nov 14 10:07:02 2017 @author: RAVITHEJA """ import logging from config import argument_config, mongo_config from mongoDBConnection import initialize_mongo, insert_into_mongo from ckanForMetadata import insert_into_ckan def persistFinData(source, dataset_url, j...
ravithejaburugu/ravitest
sourcing/Quandl/FinDataPersist.py
FinDataPersist.py
py
2,333
python
en
code
0
github-code
21
[ { "api_name": "logging.basicConfig", "line_number": 18, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 20, "usage_type": "attribute" }, { "api_name": "config.argument_config.get", "line_number": 22, "usage_type": "call" }, { "api_name": "conf...
4108286845
import inspect from lectarium_app import session, logger from sqlalchemy_utils.aggregates import manager from sqlalchemy import asc from lectarium_app.models import User, Activity, ReceiptPosition, OrderPosition, Receipt, Order def update_all_aggregated_fields(): """ Updates all columns with @aggregated deco...
Tutturu204/Lect
master/lectarium_app/utils/update_aggregated.py
update_aggregated.py
py
2,218
python
en
code
0
github-code
21
[ { "api_name": "lectarium_app.models.ReceiptPosition", "line_number": 14, "usage_type": "name" }, { "api_name": "lectarium_app.models.Receipt", "line_number": 14, "usage_type": "name" }, { "api_name": "lectarium_app.models.OrderPosition", "line_number": 14, "usage_type": "...
33897586083
from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union import attr from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.charge_component import ChargeComponent T = TypeVar("T", bound="SAFETReimbursementItem") @attr.s(auto_attribs=True) class SAFETReimbursementItem: r"""An ite...
milyord/sp-api
sp/finances_v0/models/safet_reimbursement_item.py
safet_reimbursement_item.py
py
3,493
python
en
code
1
github-code
21
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 7, "usage_type": "name" }, { "api_name": "typing.TypeVar", "line_number": 11, "usage_type": "call" }, { "api_name": "typing.Union", "line_number": 25, "usage_type": "name" }, { "api_name": "types.Unset", "li...
34732387316
from flask import Flask , render_template , request from googletrans import Translator app = Flask(__name__) @app.route('/' , methods =["GET", "POST"]) def hello_world(): if request.method == "POST": text = request.form.get("input") src = request.form.get("option1") dest = request....
utkarshtrip281/translator_project
translator.py
translator.py
py
700
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 3, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 7, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 7, "usage_type": "name" }, { "api_name": "flask.request.form.g...
71657590774
import functools import config from flask import (Flask, flash, g, redirect, render_template, request, session, url_for) from flask_misaka import Misaka from flask_paginate import Pagination, get_page_parameter import _sqlite3 app = Flask(__name__) app.config.from_object('config.ProductionConfig')...
andmichalski/blog
app/app.py
app.py
py
5,712
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "flask_misaka.Misaka", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.g.db", "line_number": 21, "usage_type": "attribute" }, { "api_name": "flask.g", "line_n...
20226817783
# 🍀 © @tofik_dn # ⚠️ Do not remove credits import requests from userbot import CMD_HELP from userbot import CMD_HANDLER as cmd from userbot.utils import flicks_cmd @flicks_cmd(pattern="vidwibu$") async def _(event): try: response = requests.get( "https://api-tede.herokuapp.com/api/asupan/wi...
farizjs/Flicks-Userbot
userbot/modules/video.py
video.py
py
1,198
python
en
code
14
github-code
21
[ { "api_name": "requests.get", "line_number": 14, "usage_type": "call" }, { "api_name": "userbot.utils.flicks_cmd", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 25, "usage_type": "call" }, { "api_name": "userbot.utils.flic...
35866085039
import sys from itertools import permutations as pm input = sys.stdin.readline a, b = map(str, input().split()) b = int(b) pm_a = list(pm(a, len(a))) def digit_length(n): ans = 0 while n: n //= 10 ans += 1 return ans max_result = -1 for case in pm_a: tmp = int("".join(case)) ...
combiJihoon/AlgorithmStudy
week4/16943.py
16943.py
py
521
python
ko
code
0
github-code
21
[ { "api_name": "sys.stdin", "line_number": 4, "usage_type": "attribute" }, { "api_name": "itertools.permutations", "line_number": 8, "usage_type": "call" } ]
18408033463
from collections import defaultdict import subprocess import logging import psutil import time import threading import platform import os import sys import xml.etree.ElementTree as ET def bytes2human(n): """ >>> bytes2human(10000) '9.8 K/s' >>> bytes2human(100001221) '95.4 M/s' """ symbol...
alicevision/Meshroom
meshroom/core/stats.py
stats.py
py
10,614
python
en
code
10,013
github-code
21
[ { "api_name": "collections.defaultdict", "line_number": 42, "usage_type": "call" }, { "api_name": "psutil.cpu_freq", "line_number": 51, "usage_type": "call" }, { "api_name": "psutil.virtual_memory", "line_number": 52, "usage_type": "call" }, { "api_name": "platfor...