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
31355510321
import unittest import pyproj import simplegrid as sg class TestNearest(unittest.TestCase): def test_nearest_sw_corner(self): geod = pyproj.Geod(ellps='sphere') mg = sg.gridio.read_mitgridfile('./data/tile005.mitgrid', 270, 90) i,j,dist = sg.util.nearest(-128.,67.5,mg['XG'],mg['YG'],geo...
nasa/simplegrid
simplegrid/tests/test_nearest.py
test_nearest.py
py
1,096
python
en
code
5
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pyproj.Geod", "line_number": 11, "usage_type": "call" }, { "api_name": "simplegrid.gridio.read_mitgridfile", "line_number": 12, "usage_type": "call" }, { "api_name": "...
21529723220
import logging import sys import re import time import json def run(ctx): # Get the ticket data from the context ticket = ctx.config.get('data').get('ticket') ticket_srn = ticket.get('srn') # Create GraphQL client graphql_client = ctx.graphql_client() #query ticket endpoint for swimlanes ...
sonraisecurity/sonrai-bots
remediation/azure/add_sonrai_platform_user/bot.py
bot.py
py
5,348
python
en
code
5
github-code
6
[ { "api_name": "logging.info", "line_number": 28, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 54, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 117, "usage_type": "call" }, { "api_name": "logging.info", "line_numb...
42420354636
import sqlite3 from tkinter import * from tkinter import messagebox #Nombre la Base de Datos db = "timerSIAT.db" busca = Tk() busca.iconbitmap('buscar.ico') busca.title("Buscar Numero de Serie") busca.geometry("330x250") uno=Label(busca, text=" ") uno.place(x = 30, y = 70) dos=Label(busca, text=" ") dos.place(x = 15...
AnaNicoSerrano88/Timmer-SIAT
Buscar_Serie.py
Buscar_Serie.py
py
2,474
python
es
code
0
github-code
6
[ { "api_name": "tkinter.messagebox.showerror", "line_number": 28, "usage_type": "call" }, { "api_name": "tkinter.messagebox", "line_number": 28, "usage_type": "name" }, { "api_name": "sqlite3.connect", "line_number": 30, "usage_type": "call" }, { "api_name": "tkint...
18003897185
import torch import torch.nn as nn from torch.nn import Parameter from torch.distributions import Normal from algo.pn_utils.maniskill_learn.utils.torch import ExtendedModule from ..builder import DENSEHEADS class GaussianHeadBase(ExtendedModule): def __init__(self, scale_prior=1, bias_prior=0, dim_action=None, ep...
PKU-EPIC/UniDexGrasp
dexgrasp_policy/dexgrasp/algo/pn_utils/maniskill_learn/networks/dense_heads/gaussian.py
gaussian.py
py
2,881
python
en
code
63
github-code
6
[ { "api_name": "algo.pn_utils.maniskill_learn.utils.torch.ExtendedModule", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.nn.Parameter", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.tensor", "line_number": 12, "usage_type": "call" }, ...
6545029693
from sqlalchemy.orm import Session from . import models, schemas def get_items(db: Session, skip: int = 0, limit: int = 100): return db.query(models.Item).offset(skip).limit(limit).all() def create_objective(db: Session, objective: schemas.ObjectiveBase): db_objective = models.Objective(**objective.dict())...
yaseralnajjar/Fast-API-Sample
my_app/crud.py
crud.py
py
949
python
en
code
1
github-code
6
[ { "api_name": "sqlalchemy.orm.Session", "line_number": 6, "usage_type": "name" }, { "api_name": "sqlalchemy.orm.Session", "line_number": 10, "usage_type": "name" }, { "api_name": "sqlalchemy.orm.Session", "line_number": 18, "usage_type": "name" }, { "api_name": "s...
73952569148
import os import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt plt.style.use('SVA1StyleSheet.mplstyle') def parse_args(): import argparse parser = argparse.ArgumentParser(description='Correlation of reserved stars') parser.add_argument('--tausflask1', default='/ho...
des-science/Y3_shearcat_tests
alpha-beta-eta-test/code/tests/taus_v1v2.py
taus_v1v2.py
py
4,389
python
en
code
1
github-code
6
[ { "api_name": "matplotlib.use", "line_number": 3, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style.use", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 5, "usage_type": "attribute" }, { "api_name": "...
21188009718
""" Module for city related models. """ from sqlalchemy import Column, String, Integer, ForeignKey from sqlalchemy.orm import relationship from data import CONFIG from models import Base CONSUMPTION_RATES = CONFIG.get("game.cities.consumption") class City(Base): """ Model for tracking city data. """ __tab...
Jordan-Cottle/Game-Design-Capstone
StarcorpServer/starcorp/models/city.py
city.py
py
2,949
python
en
code
1
github-code
6
[ { "api_name": "data.CONFIG.get", "line_number": 9, "usage_type": "call" }, { "api_name": "data.CONFIG", "line_number": 9, "usage_type": "name" }, { "api_name": "models.Base", "line_number": 12, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_n...
30354483311
import sys import vtk from vtk.util import vtkConstants try: from vtk.util import numpy_support except ImportError: numpy_support = None import numpy # Enthought library imports. try: from tvtk.array_ext import set_id_type_array HAS_ARRAY_EXT = True except ImportError: HAS_ARRAY_EXT = False # Us...
enthought/mayavi
tvtk/array_handler.py
array_handler.py
py
27,563
python
en
code
1,177
github-code
6
[ { "api_name": "vtk.util.numpy_support", "line_number": 8, "usage_type": "name" }, { "api_name": "vtk.vtkIdTypeArray", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.int32", "line_number": 22, "usage_type": "attribute" }, { "api_name": "numpy.int64...
34029348872
import matplotlib.pyplot as plt import numpy as np """ Plot of success rate for a single NN with different control horizons """ # testing_result = [47.74, 52.76, 61.81, 63.82, 50.75] # baseline_result = [44.72, 45.73, 51.25, 52.26, 46.73] testing_result = [48, 53, 62, 64, 51] baseline_result = [45, 46, 51, 52, 47] ...
SFU-MARS/WayPtNav-reachability
executables/Plots_for_papers/Anjian/plot_ctrlhorizon_successful_rate.py
plot_ctrlhorizon_successful_rate.py
py
1,763
python
en
code
3
github-code
6
[ { "api_name": "numpy.asarray", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 20, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 20, "usage_type": "name" }, { "api_name": "numpy.aran...
31101340357
from django.urls import path from . import views app_name = "public" urlpatterns = [ path("", views.index, name="index"), path("about", views.about, name="about"), path("upload_dataset", views.upload_dataset, name="upload_dataset"), path("train_model", views.train_model, name="train_model"), path(...
pdagrawal/ml_playground
ml_playground/apps/public/urls.py
urls.py
py
374
python
en
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", ...
41265462253
import pandas as pd from sklearn.ensemble import AdaBoostClassifier from sklearn.metrics import accuracy_score from sklearn.model_selection import train_test_split #datamızı okuduk df = pd.read_csv("C:\projects\intropattern\otu.csv") #verinin tranzpozasını alarak left ve rightları column hale getirdik. df=df.T X = df....
Haticenurcoskunn/Introduction-to-pattern-term-project
binary_classficiton/boosting_algorithms.py
boosting_algorithms.py
py
970
python
tr
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 13, "usage_type": "call" }, { "api_name": "sklearn.ensemble.AdaBoostClassifier", "line_number": 17, "usage_type": "call" }...
75261205308
import torch from tqdm import tqdm def evaluate(model, loader, device): """ Evaluation function to calculate loss and accuracy on Val/test dataset Args: model (nn.Module): model to be evaluated on the give dataset loader (DataLoader): Validation/Test dataloader to evaluate the model on. ...
iMvijay23/Dinov2SSLImageCL
evaluate.py
evaluate.py
py
1,112
python
en
code
7
github-code
6
[ { "api_name": "torch.nn.CrossEntropyLoss", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 18, "usage_type": "attribute" }, { "api_name": "torch.no_grad", "line_number": 20, "usage_type": "call" }, { "api_name": "torch.argmax", ...
42739926570
# -*- coding = utf-8 -*- """ the :mod `dataset` module provides the dataset class and other subclasses which are used for managing datasets """ import pandas as pd import numpy as np class Dataset: """base class for loading datasets Note that you should never instantiate the class :class: `Dataset...
Jack-Lio/RecommenderSystem
dataset.py
dataset.py
py
4,487
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 19, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 20, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.zeros", "li...
7065948190
# -*- coding: utf-8 -*- from PyQt5 import QtWidgets from PyQt5.QtWidgets import QMessageBox class MyWindow(QtWidgets.QWidget): def __init__(self): super().__init__() self.myButton = QtWidgets.QPushButton(self) self.myButton.clicked.connect(self.msg) self.msg() def msg(self): ...
kRayvison/Pycharm_python36
k_test/temp_test.py
temp_test.py
py
727
python
en
code
1
github-code
6
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 6, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidgets", "line_number": 6, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QPushButton", "line_number": 9, "usage_type": "call" }, { "api_name": ...
16930073280
import shutil import difflib import filecmp import logging from prettyconf import config BOOTSTRAP_TESTS = config("BOOTSTRAP_TESTS", default=False) LOG = logging.getLogger(__name__) def compare_files(*, got, expected): """Compares the contents of a test file against expected Args: got: file with t...
huiwenke/3d-beacons-client
tests/tests_cli/utils.py
utils.py
py
1,186
python
en
code
null
github-code
6
[ { "api_name": "prettyconf.config", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "shutil.copy", "line_number": 26, "usage_type": "call" }, { "api_name": "filecmp.cmp", "lin...
40880620153
from flask import Flask, request, jsonify import requests from pyspark.sql import SparkSession from pyspark.sql.types import StructType, StructField, StringType, BooleanType import threading import logging import time app = Flask(__name__) # Create a SparkSession (Singleton) spark = SparkSession.builder.appName("APID...
DennisVW0/DE_TASK
app.py
app.py
py
3,411
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder.appName", "line_number": 12, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 12, "usage_type": "attribute" }, ...
29322733814
from google.cloud import bigquery import plotly.express as px dataset_id = "salestest" class DatasetManager(object): def __init__(self, dataset_id): self.dataset_id = dataset_id self.client = self._get_client() def print_listed_projeto(self): """INFORMA O NOME DO PROJETO DO SERVICE ...
luizgnunes/PesquisaJsonECriacaoGrafico
main.py
main.py
py
4,026
python
en
code
0
github-code
6
[ { "api_name": "google.cloud.bigquery.Client.from_service_account_json", "line_number": 36, "usage_type": "call" }, { "api_name": "google.cloud.bigquery.Client", "line_number": 36, "usage_type": "attribute" }, { "api_name": "google.cloud.bigquery", "line_number": 36, "usag...
71578318267
import torch.nn as nn from utils.config import config import torch import numpy as np from model.bbox_tools import * import torch.nn.functional as F from torchvision.ops import nms def nograd(f): def new_f(*args, **kwargs): with torch.no_grad(): return f(*args, **kwargs) retur...
langfengQ/FasterRCNN-expanded-VOC2007
model/faster_rcnn.py
faster_rcnn.py
py
4,074
python
en
code
1
github-code
6
[ { "api_name": "torch.no_grad", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.nn.Module", "line_number": 17, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 17, "usage_type": "name" }, { "api_name": "torch.Tensor", "line_...
16315480908
from dronekit import Vehicle, connect, VehicleMode, Command import time from pymavlink.dialects.v20 import ardupilotmega from pymavlink import mavutil class DKVehicle(Vehicle): def __init__(self, connection): print ("Connecting to vehicle on: %s" % connection) self.vehicle = connect(connection, ba...
JarrydSteele/pythonscripts
First/dk_vehicle.py
dk_vehicle.py
py
4,478
python
en
code
0
github-code
6
[ { "api_name": "dronekit.Vehicle", "line_number": 6, "usage_type": "name" }, { "api_name": "dronekit.connect", "line_number": 10, "usage_type": "call" }, { "api_name": "pymavlink.mavutil.mavlink", "line_number": 71, "usage_type": "attribute" }, { "api_name": "pymav...
17694953325
from Transformer import Transformer from MultiHeadAttention import MultiHeadAttention from tqdm import tqdm from Metrics import grad from Metrics import loss_function from Metrics import loss_function2 from Metrics import accuracy_function from sklearn.linear_model import LogisticRegression from sklearn.preprocessing i...
whytheevanssoftware/log-analyzer
training/__main__.py
__main__.py
py
7,572
python
en
code
2
github-code
6
[ { "api_name": "os.environ", "line_number": 24, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 25, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 26, "usage_type": "attribute" }, { "api_name": "os.environ", "lin...
43736972444
import sys from pyspark import SparkConf, SparkContext import re from bwt import reverseBwt from radix import radixSort from segment import segSort from default import defaultSort from partition import partitionSort # config spark context, set master, name and memory size def getSC(master, name): conf = (Spa...
xniu7/jhuclass.genome.indexing
code/python/sort.py
sort.py
py
3,476
python
en
code
1
github-code
6
[ { "api_name": "pyspark.SparkConf", "line_number": 14, "usage_type": "call" }, { "api_name": "pyspark.SparkContext", "line_number": 20, "usage_type": "call" }, { "api_name": "radix.radixSort", "line_number": 33, "usage_type": "call" }, { "api_name": "segment.segSor...
29216406296
import logging import os import pwd import sys from aiohttp import web from aiomisc.utils import bind_socket from configargparse import ArgumentParser, ArgumentDefaultsHelpFormatter from setproctitle import setproctitle from yarl import URL from megamarket.api.app import create_app from megamarket.utils.argparse impo...
Dest0re/backend-school2022
megamarket/api/__main__.py
__main__.py
py
1,960
python
en
code
0
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 18, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 18, "usage_type": "attribute" }, { "api_name": "configargparse.ArgumentParser", "line_number": 21, "usage_type": "call" }, { "api_name": "...
26239065759
from __future__ import unicode_literals, absolute_import, print_function, division import datetime import time from sopel.module import commands, rule, priority, thread from sopel.tools import Identifier from sopel.tools.time import seconds_to_human @commands('seen') def seen(bot, trigger): """Reports when and ...
examknow/Exambot-Source
sopel/modules/seen.py
seen.py
py
2,014
python
en
code
2
github-code
6
[ { "api_name": "datetime.datetime.utcfromtimestamp", "line_number": 27, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 27, "usage_type": "attribute" }, { "api_name": "sopel.tools.time.seconds_to_human", "line_number": 28, "usage_type": "call" }...
44613554676
# coding=utf-8 import tensorflow as tf import numpy as np from data_helper import * import gensim import os import time import datetime import csv # TF log level os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # Parameters # ================================================== flags = tf.flags logging = tf.logging # Data Param...
anonymous-2018-COLING/pan11
eval.py
eval.py
py
5,829
python
en
code
1
github-code
6
[ { "api_name": "os.environ", "line_number": 12, "usage_type": "attribute" }, { "api_name": "tensorflow.flags", "line_number": 15, "usage_type": "attribute" }, { "api_name": "tensorflow.logging", "line_number": 16, "usage_type": "attribute" }, { "api_name": "tensorf...
8101746211
# coding=utf-8 import streamlit as st class selectValues(): def __init__(self): self.points = ['腕', '肘', '膝', '頭', '投げ手', '足'] self.eval_kinds = ['パフォーマンス観点', '怪我観点'] self.timings = ['投げ始め', 'リリース時', '投げ終わり'] self.evaluates = ['○', '×'] self.total_evaluates = ['未評価', '1', '2...
ys201810/baseball_scoring_work
src/utils.py
utils.py
py
743
python
en
code
0
github-code
6
[ { "api_name": "streamlit.slider", "line_number": 15, "usage_type": "call" }, { "api_name": "streamlit.columns", "line_number": 21, "usage_type": "call" } ]
26185561724
""" Example: words = ['cat', 'baby', 'dog', 'bird', 'car', 'ax'] string1 = 'tabncihjs' find_embedded_word(words, string1) -> cat (the letters do not have to be in order) """ import collections from typing import List import unittest # Using sorting # words = ['cat', 'baby', 'dog', 'bird', 'car', 'ax'] -> act, abbbd...
01o91939/leetcode
embeddedWord.py
embeddedWord.py
py
2,392
python
en
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 30, "usage_type": "name" }, { "api_name": "collections.Counter", "line_number": 31, "usage_type": "call" }, { "api_name": "collections.Counter", ...
33511701341
from collections import defaultdict from src.data import data_manager from src.data.neuron_info import ntype from src.data.dataset_info import all_datasets, datasets_with_adj, timepoint from src.plotting import plotter class Figure(object): def __init__(self, output_path, page_size=7.20472): self.plt =...
dwitvliet/nature2021
src/figures/feedforward.py
feedforward.py
py
7,340
python
en
code
13
github-code
6
[ { "api_name": "src.plotting.plotter.Plotter", "line_number": 13, "usage_type": "call" }, { "api_name": "src.plotting.plotter", "line_number": 13, "usage_type": "name" }, { "api_name": "src.data.neuron_info.ntype", "line_number": 17, "usage_type": "call" }, { "api_...
33502453233
# encoding: utf-8 """ """ __author__ = 'Richard Smith' __date__ = '31 Jul 2020' __copyright__ = 'Copyright 2018 United Kingdom Research and Innovation' __license__ = 'BSD - see LICENSE file in top-level package directory' __contact__ = 'richard.d.smith@stfc.ac.uk' from django.core.management.base import BaseCommand, ...
cedadev/archive-opensearch
django_opensearch/management/commands/retrieve_vocab_cache.py
retrieve_vocab_cache.py
py
681
python
en
code
0
github-code
6
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 17, "usage_type": "name" }, { "api_name": "cci_tagger.facets.Facets", "line_number": 22, "usage_type": "call" }, { "api_name": "django.conf.settings.VOCAB_CACHE_FILE", "line_number": 23, "usage_type":...
70211358588
import json import glob import os import re import collections import yaml from yaml.parser import ParserError, ScannerError from saddlebags import exceptions SUPPORTED_FILE_TYPES = ['json', 'yaml', 'yml'] class Saddlebag(collections.MutableMapping): """ Provides access to the contents of JSON/YAML config...
eikonomega/saddlebags
saddlebags/saddlebag.py
saddlebag.py
py
5,393
python
en
code
0
github-code
6
[ { "api_name": "collections.MutableMapping", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 41, "usage_type": "attribute" }, { "api_name": "re.search", "line_number": 51, "usage_type": "call" }, { "api_name": "glob.glob",...
16000963484
import datetime import ipaddress import unittest from typing import Any, Optional from dataclasses import dataclass from podman import api class ParseUtilsTestCase(unittest.TestCase): def test_parse_repository(self): @dataclass class TestCase: name: str input: Any ...
mgorny/podman-py
podman/tests/unit/test_parse_utils.py
test_parse_utils.py
py
2,083
python
en
code
null
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 11, "usage_type": "attribute" }, { "api_name": "typing.Any", "line_number": 16, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 17, "usage_type": "name" }, { "api_name": "dataclasses.datacla...
72470151548
import cv2 import numpy as np import os import zipfile from show import blob_imagem,alturaXlargura from work import deteccoes, funcoes_imagem from drive import driveFile if not os.path.exists("modelo.zip"): """ Verifica se o modelo já se encontra no diretório se não se encontra no diretória, então baixa o mesmo...
mauriciobenjamin700/IC_V2
YOLO/experimentos/teste1/main.py
main.py
py
2,342
python
pt
code
0
github-code
6
[ { "api_name": "os.path.exists", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "drive.driveFile", "line_number": 19, "usage_type": "call" }, { "api_name": "zipfile.ZipFile", "li...
32717608076
import gymnasium as gym from gymnasium import error, spaces, utils, Env from gymnasium.spaces import MultiDiscrete, Box from gymnasium.utils import seeding import math import pymunk import pygame from pymunk import pygame_util screen_width = 1904 screen_height = 960 target = 350 class Robot(): def __init__(self, sp...
robertofiguz/2dWalker
Walker/envs/Walker_env.py
Walker_env.py
py
15,192
python
en
code
0
github-code
6
[ { "api_name": "pymunk.Poly.create_box", "line_number": 20, "usage_type": "call" }, { "api_name": "pymunk.Poly", "line_number": 20, "usage_type": "attribute" }, { "api_name": "pymunk.moment_for_poly", "line_number": 21, "usage_type": "call" }, { "api_name": "pymunk...
8280574767
from heapq import heapify, heappop, heappush import collections ''' Time: O(n) + O(nlogk) Space: O(n) ''' class Solution: def __init__(self, nums, k): self.heap = [] self.k = k self.nums = nums def topk(self): freq = collections.defaultdict(int) for num in self.nu...
gadodia/Algorithms
algorithms/Arrays/topkfrequent.py
topkfrequent.py
py
685
python
en
code
0
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 17, "usage_type": "call" }, { "api_name": "heapq.heappush", "line_number": 22, "usage_type": "call" }, { "api_name": "heapq.heappop", "line_number": 24, "usage_type": "call" } ]
22252725239
import numpy as np import optuna import pandas as pd import xgboost as xgb from sklearn.metrics import f1_score, precision_score from sklearn.model_selection import StratifiedKFold from sklearn.metrics import recall_score from sklearn.metrics import accuracy_score def objective(trial, df, y): params = { '...
lutianzhou001/RegPull
ML/optuna_XGBoost.py
optuna_XGBoost.py
py
3,097
python
en
code
2
github-code
6
[ { "api_name": "sklearn.model_selection.StratifiedKFold", "line_number": 20, "usage_type": "call" }, { "api_name": "xgboost.XGBClassifier", "line_number": 28, "usage_type": "call" }, { "api_name": "sklearn.metrics.f1_score", "line_number": 33, "usage_type": "call" }, {...
44593105346
# script to create scatter plot for mean intensity ranking in three emotion # categories. refer to readme for more information about survey and ranking # task. # 18 November 2018, Pulkit Singh import pandas as pd import seaborn as sns import matplotlib.pyplot as plt #------------------------------------------------...
pulkitsingh/IW-Emoji-Intensity
Emotion Word Survey/Word Intensity Ranking/Scatter plots mean/intensityRanking_mean.py
intensityRanking_mean.py
py
2,743
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 21, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 21, "usage_type": "name" }, { "api_name": "seaborn.scatterplot", "line_number": 22, "usage_type": "call" }, { "api_name": "matp...
70518540349
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ ServiceInterval Application implementation classes. """ from copy import copy from datetime import date, timedelta from numbers import Number import os import pickle import re import warnings __author__ = 'Don D.S.' # Version of ServiceInterval. VERSION = (1, 0) cl...
zokalo/pyServiceInterval
servint_utils.py
servint_utils.py
py
29,824
python
en
code
0
github-code
6
[ { "api_name": "datetime.timedelta", "line_number": 65, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 76, "usage_type": "call" }, { "api_name": "copy.copy", "line_number": 82, "usage_type": "call" }, { "api_name": "datetime.date", "...
29373295052
# External Packages from fastapi import APIRouter from fastapi import Request from fastapi.responses import HTMLResponse, FileResponse from fastapi.templating import Jinja2Templates from khoj.utils.rawconfig import TextContentConfig, OpenAIProcessorConfig, FullConfig # Internal Packages from khoj.utils import constant...
debanjum/khoj
src/khoj/routers/web_client.py
web_client.py
py
6,990
python
en
code
485
github-code
6
[ { "api_name": "fastapi.APIRouter", "line_number": 15, "usage_type": "call" }, { "api_name": "fastapi.templating.Jinja2Templates", "line_number": 16, "usage_type": "call" }, { "api_name": "khoj.utils.constants.web_directory", "line_number": 16, "usage_type": "attribute" ...
71723914428
""" -*- coding: utf-8 -*- File : basepage.py Version : 0.1 Author : usrpi Date :2021/1/4 """ import logging import datetime import os from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.support import expected_conditions as EC # 封装基本函数 -- 执行日志、处理异常、失败截图 # 所有的页面公共部分,不涉及业务 class Base...
xianghuanng/futureloan_web
Common/basepage.py
basepage.py
py
3,889
python
en
code
0
github-code
6
[ { "api_name": "logging.info", "line_number": 31, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 34, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 34, "usage_type": "attribute" }, { "api_name": "selenium.we...
9828876779
import sys import os from django.conf import settings from django.core.management import execute_from_command_line from django.conf.urls import url from django.http import HttpResponse from django.core.wsgi import get_wsgi_application DEBUG = os.environ.get('DEBUG', 'on') == 'on' print(DEBUG) SECRET_KEY = os.environ...
wesksky/MyDjangoProject
TinyDjango/hello.py
hello.py
py
913
python
en
code
0
github-code
6
[ { "api_name": "os.environ.get", "line_number": 9, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 13, "usage_type": "call" }, { "api_name": "os.environ", "line_nu...
10422156393
from __future__ import annotations import os import platform import re import subprocess import typing from pathlib import Path from PySide6 import QtCore, QtGui, QtWidgets import randovania from randovania import get_data_path if typing.TYPE_CHECKING: from collections.abc import Iterator def map_set_checked(...
randovania/randovania
randovania/gui/lib/common_qt_lib.py
common_qt_lib.py
py
9,466
python
en
code
165
github-code
6
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 15, "usage_type": "attribute" }, { "api_name": "collections.abc.Iterator", "line_number": 19, "usage_type": "name" }, { "api_name": "PySide6.QtWidgets.QCheckBox", "line_number": 19, "usage_type": "attribute" }, { ...
14852879493
import logging from datetime import timedelta import requests from django.db import models from django.utils.six import string_types from django.utils import timezone from requests_oauthlib import OAuth2Session from killboard import app_settings from killboard.errors import TokenError, IncompleteResponseError logger...
DeForce/py_killboard
killboard/managers.py
managers.py
py
5,176
python
en
code
1
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "django.db.models.QuerySet", "line_number": 20, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 20, "usage_type": "name" }, { "api_name": "dja...
10132276502
import plotly.express as px import plotly.graph_objects as go import pandas as pd from plotly.subplots import make_subplots import os import plotly.io as pio pio.renderers.default = "browser" num_of_interviews = [0, 1, 2, 3] y_list = 3 x_list = 6 current = False trend = False # example: communication = 0 specific_a...
Fabbochan/master_thesis_figures
datavisualization_heatmap.py
datavisualization_heatmap.py
py
5,880
python
en
code
0
github-code
6
[ { "api_name": "plotly.io.renderers", "line_number": 7, "usage_type": "attribute" }, { "api_name": "plotly.io", "line_number": 7, "usage_type": "name" }, { "api_name": "plotly.graph_objects.Scatterpolar", "line_number": 50, "usage_type": "call" }, { "api_name": "pl...
35266444899
import os # os.environ['CUDA_VISIBLE_DEVICES'] = '-1' import tensorflow as tf import keras # from keras import layers from sempler import Dataset, DatasetSide, DatasetSoft from wave_u_net import wave_u_net from loss import combined_loss, ScatterLoss, RegulatedLoss from call_back import CustomCallback from keras.callb...
ondra117/lil_neuron
learning.py
learning.py
py
3,143
python
en
code
1
github-code
6
[ { "api_name": "wave_u_net.wave_u_net", "line_number": 35, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 37, "usage_type": "call" }, { "api_name": "os.path", "line_number": 37, "usage_type": "attribute" }, { "api_name": "os.path.exists", ...
33237880927
from numpy import mean from numpy import std from matplotlib import pyplot as plt from sklearn.model_selection import KFold from tensorflow.keras.datasets import mnist from tensorflow.keras.utils import to_categorical from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Conv2D, MaxPooling2...
husainasad/Digit-Classifier
model.py
model.py
py
3,607
python
en
code
0
github-code
6
[ { "api_name": "tensorflow.keras.datasets.mnist.load_data", "line_number": 16, "usage_type": "call" }, { "api_name": "tensorflow.keras.datasets.mnist", "line_number": 16, "usage_type": "name" }, { "api_name": "tensorflow.keras.utils.to_categorical", "line_number": 19, "usa...
35014338143
# coding: utf-8 from flask import jsonify from app import app class Error(): ''' HTTP Response Error ''' def __init__(self): self.status = None self.code = None self.message = None self.errors = None def _ready(self, log_level='info'): if log_level == 'cr...
jasonsmithj/spam_public
app/http/error.py
error.py
py
2,234
python
en
code
0
github-code
6
[ { "api_name": "app.app.logger.critical", "line_number": 20, "usage_type": "call" }, { "api_name": "app.app.logger", "line_number": 20, "usage_type": "attribute" }, { "api_name": "app.app", "line_number": 20, "usage_type": "name" }, { "api_name": "app.app.logger.in...
37107835911
#!/usr/bin/python # -*- coding: utf8 -*- import sys import cherrypy import platform import os import time cur_dir = os.path.dirname(os.path.abspath(__file__)) #python 2.4为simplejson,python 2.6以上为json try: import json except ImportError: import simplejson as json ...
lxcong/lvs-manager
monitor_agent/run.py
run.py
py
12,755
python
en
code
160
github-code
6
[ { "api_name": "os.path.dirname", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 9, "usage_type": "call" }, { "api_name": "cherrypy.expose", "line...
9797629811
#client berada di sisi remote, client hanya mmebutuhkan # dependency kepada library Pyro5 import Pyro5.api if __name__=='__main__': # untuk mengecek service apa yang ada di ns, gunakan pyro5-nsc -p 9900 list #dalam kasus ini namanya adalah phonebook.server phonebook = Pyro5.api.Proxy('PYRONAME:phonebook...
rm77/sister2020
client/client.py
client.py
py
600
python
id
code
0
github-code
6
[ { "api_name": "Pyro5.api.api.Proxy", "line_number": 10, "usage_type": "call" }, { "api_name": "Pyro5.api.api", "line_number": 10, "usage_type": "attribute" }, { "api_name": "Pyro5.api", "line_number": 10, "usage_type": "name" } ]
16030870954
import os import cv2 import time import random import numpy as np import pandas as pd import keras.api._v2.keras as keras import tensorflow as tf tf.__version__, np.__version__ from tensorflow.keras.applications.inception_v3 import preprocess_input from tensorflow.keras import backend, layers, metrics from tensorflow....
gamal-abdelhakm/Handwritten-Signature-Identification-Verification-and-Detection
Script/Functions.py
Functions.py
py
8,768
python
en
code
2
github-code
6
[ { "api_name": "tensorflow.__version__", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.__version__", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number": 29, "usage_type": "call" }, { "api_name": "os.p...
9816914464
#!/usr/bin/env python # coding: utf-8 # # Ici on va importer les packages de Python # In[14]: import gudhi as gd import scipy.io as sio import math import matplotlib.pyplot as plt import numpy as np # # On donne les coordonnées de chaque atome # In[16]: coords = {'Ti':[[5,5,5]], 'O':[[5, 5, 10], [5, 10, 5], ...
Fouad-Mazguit/rapport-data
Data/CaTiO3/les nombres de Betti.py
les nombres de Betti.py
py
1,641
python
en
code
2
github-code
6
[ { "api_name": "numpy.zeros", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.linalg.norm", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.linalg", "line_number": 32, "usage_type": "attribute" }, { "api_name": "numpy.array", "li...
10629931945
import logging import pytest import nengo from nengo.builder import Model from nengo.builder.ensemble import BuiltEnsemble def test_seeding(Simulator, allclose): """Test that setting the model seed fixes everything""" # TODO: this really just checks random parameters in ensembles. # Are there other ...
Kanaderu/Neural-Networks
nengo-master/nengo/tests/test_builder.py
test_builder.py
py
4,239
python
en
code
0
github-code
6
[ { "api_name": "nengo.Network", "line_number": 17, "usage_type": "call" }, { "api_name": "nengo.Node", "line_number": 19, "usage_type": "call" }, { "api_name": "nengo.Ensemble", "line_number": 20, "usage_type": "call" }, { "api_name": "nengo.Ensemble", "line_nu...
42857124490
import pytest from django.conf import settings from django.test import override_settings from .compat import nullcontext def pytest_configure(): settings.configure( **dict( SECRET_KEY="abcd", INSTALLED_APPS=[ "django.contrib.auth", "django.contrib.s...
thaitl235/djangorestframework-api-key
tests/conftest.py
conftest.py
py
2,739
python
en
code
null
github-code
6
[ { "api_name": "django.conf.settings.configure", "line_number": 9, "usage_type": "call" }, { "api_name": "django.conf.settings", "line_number": 9, "usage_type": "name" }, { "api_name": "rest_framework.response.Response", "line_number": 39, "usage_type": "call" }, { ...
38713930072
from collections import defaultdict, deque def bfs(graph, start): visited = set() queue = deque([start]) while queue: vertex = queue.popleft() if vertex not in visited: visited.add(vertex) print(vertex, end=' ') for neighbor in graph[verte...
pogchumpus55/AI
bfs.py
bfs.py
py
765
python
en
code
0
github-code
6
[ { "api_name": "collections.deque", "line_number": 5, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 19, "usage_type": "call" } ]
19355802413
from datetime import datetime import csv AIRPORTS_DB_LINK = "https://raw.githubusercontent.com/cohaolain/ryanair-py/develop/ryanair/airports.csv" AIRPORTS_DB_FILE = "data/airports.csv" AIRPORTS_TIMESTAMP_FILE = "data/airports_timestamp.txt" airports = None def get_distance(lat1, lat2, lon1, lon2): from math impo...
slotruglio/flights-radar
utils/airports.py
airports.py
py
3,444
python
en
code
0
github-code
6
[ { "api_name": "math.radians", "line_number": 14, "usage_type": "call" }, { "api_name": "math.radians", "line_number": 15, "usage_type": "call" }, { "api_name": "math.radians", "line_number": 16, "usage_type": "call" }, { "api_name": "math.radians", "line_numbe...
32569222248
# -*- coding: utf-8 -*- ############################################################################### # License, author and contributors information in: # # __manifest__.py file at the root folder of this module. # #######################################################...
dip-ergo/tex-fasteners
mto_chain/models/inherit.py
inherit.py
py
4,293
python
en
code
0
github-code
6
[ { "api_name": "odoo.models.Model", "line_number": 14, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 14, "usage_type": "name" }, { "api_name": "odoo.fields.Datetime", "line_number": 19, "usage_type": "call" }, { "api_name": "odoo.fields",...
70280896828
from abc import ABC, abstractmethod from nltk.translate.bleu_score import sentence_bleu from bert_score import score as bert_score from BARTScore import bart_score import argparse class SimilarityClass(ABC): def __init__(self): pass @abstractmethod def get_similarity(self): pass class ...
esteng/ambiguous_vqa
analysis/abstract_class.py
abstract_class.py
py
3,112
python
en
code
5
github-code
6
[ { "api_name": "abc.ABC", "line_number": 8, "usage_type": "name" }, { "api_name": "abc.abstractmethod", "line_number": 12, "usage_type": "name" }, { "api_name": "nltk.translate.bleu_score.sentence_bleu", "line_number": 24, "usage_type": "call" }, { "api_name": "nlt...
41762485594
from tkinter import * from forex_python.converter import CurrencyRates FONT = ("Arial", 20, "bold") BG = "#B6D0E2" def display_selected_1(choice): """ Select first currency from dropdown menu and display on label """ choice = clicked_1.get() enter_amount_label.config(text=choice) def display...
vaibhav-bisen/Python_Projects
Currency Convertor/main.py
main.py
py
2,666
python
en
code
0
github-code
6
[ { "api_name": "forex_python.converter.CurrencyRates", "line_number": 26, "usage_type": "call" } ]
37961270756
import dash_html_components as html import dash from dash.dependencies import Input, Output import dash_table import pandas as pd import dash_core_components as dcc df = pd.read_csv('GraphVisualizationLearning\/data.csv') # print(df['seed'][2]) # print(df['seed']) del df['seed'] # df = df.dropna() dff = df[["Config",...
shashank793/DataVisualisation
venv/simple_graph/create_tabl.py
create_tabl.py
py
6,981
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "dash.Dash", "line_number": 24, "usage_type": "call" }, { "api_name": "dash_html_components.Div", "line_number": 87, "usage_type": "call" }, { "api_name": "dash_html_component...
37048610245
from flask import Blueprint, jsonify, render_template,request,flash,redirect,url_for, session import json import sqlite3 from numpy import empty from .excel_data import Device_Excel_Table, get_arr, get_by_ID_from_table from .location import get_all_location from .data_processing.index import database_initialization fr...
Kelly-Kxx/fyp_selenium_flask
website/views.py
views.py
py
6,347
python
en
code
0
github-code
6
[ { "api_name": "flask.Blueprint", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 17, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 17, "usage_type": "name" }, { "api_name": "flask.request...
2052137958
# Program to try and work out the power spectrum import numpy as np import matplotlib.pyplot as plt from scipy.fftpack import fft, fftfreq, ifft n = 1024 Lx = 100 omg = 2.0*np.pi/Lx x = np.linspace(0, Lx, n) y1 = 1.0*np.cos( 5.0*omg*x) y2 = 1.0*np.sin(10.0*omg*x) y3 = 0.5*np.sin(20.0*omg*x) y = y1 + y2 + y3 act = y1...
arunprasaad2711/Python_IISC_SIAM_2017
Programs_Session3/06_FFT_IFFT_example.py
06_FFT_IFFT_example.py
py
2,057
python
en
code
8
github-code
6
[ { "api_name": "numpy.pi", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.linspace", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.cos", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": ...
19491332687
import requests import hashlib import datetime import pandas as pd """Script that accesses Marvel API and gets 30 characters.""" #Access Marvel API (needed: Timestamp, privkey, publickey, hash) timestamp = datetime.datetime.now().strftime('%Y-%m-%d%H:%M:%S') pub_key = '' #insert public key priv_key = '' #insert priva...
Guibas1812/create-api-marvel-characters
initial_data.py
initial_data.py
py
3,441
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 9, "usage_type": "attribute" }, { "api_name": "hashlib.md5", "line_number": 17, "usage_type": "call" }, { "api_name": "requests.get",...
10552839170
import abc import dataclasses from typing import Optional, Union import numpy as np import numpy.typing as npt import rod from rod import logging @dataclasses.dataclass class PrimitiveBuilder(abc.ABC): name: str mass: float element: Union[ rod.Model, rod.Link, rod.Inertial, rod.Collision, rod.V...
ami-iit/rod
src/rod/builder/primitive_builder.py
primitive_builder.py
py
8,450
python
en
code
11
github-code
6
[ { "api_name": "abc.ABC", "line_number": 13, "usage_type": "attribute" }, { "api_name": "typing.Union", "line_number": 17, "usage_type": "name" }, { "api_name": "rod.Model", "line_number": 18, "usage_type": "attribute" }, { "api_name": "rod.Link", "line_number"...
30138374155
# !/usr/local/python/bin/python # -*- coding: utf-8 -*- # (C) Wu Dong, 2020 # All rights reserved # @Author: 'Wu Dong <wudong@eastwu.cn>' # @Time: '2020-04-01 09:47' # sys import typing as t from functools import wraps from inspect import isfunction from inspect import getfullargspec # 3p from flask import ( # pylint:...
Eastwu5788/pre-request
pre_request/request.py
request.py
py
13,075
python
en
code
55
github-code
6
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 43, "usage_type": "attribute" }, { "api_name": "typing.Optional", "line_number": 53, "usage_type": "attribute" }, { "api_name": "typing.Optional", "line_number": 55, "usage_type": "attribute" }, { "api_name": "t...
42344160389
import pandas as pd # pip install pandas openpyxl import plotly.express as px # pip install plotly-express import streamlit as st # pip install streamlit # emojis: https://www.webfx.com/tools/emoji-cheat-sheet/ st.set_page_config(page_title="Segmentation Analysis", page_icon=":bar_chart:", layout="wide") # ---- RE...
yodialfa/Segmentation_Recomendation
app.py
app.py
py
7,164
python
en
code
1
github-code
6
[ { "api_name": "streamlit.set_page_config", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 23, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 149, "usage_type": "attribute" }, { "api_name": "strea...
39176281823
#Import files import sys import serial import SLMC601V17_RS485_COM_Frames as SLMC_Frames #Determine determine which port was provided PORT = sys.argv[1] #Check that port provided... # contains ttyUSB sizeOfPort = len(PORT) sizeOfTTY = len("ttyUSB#") subString = PORT[sizeOfPort-sizeOfTTY:sizeOfPort-1] if(subString !...
aarontwillcock/SLMC601V1.7-RS485-Tool
SLMC601V17_RS485_COM_RX.py
SLMC601V17_RS485_COM_RX.py
py
3,797
python
en
code
1
github-code
6
[ { "api_name": "sys.argv", "line_number": 7, "usage_type": "attribute" }, { "api_name": "serial.Serial", "line_number": 17, "usage_type": "call" }, { "api_name": "SLMC601V17_RS485_COM_Frames.BMS_RET_AAB", "line_number": 70, "usage_type": "attribute" }, { "api_name"...
37122133332
from flask import request from flask_restx import Resource from app.main.util.decorator import admin_token_required from ..service.inventory_service import get_all_inventories, save_new_inventory, get_an_inventory, update_inventory, delete_inventory_method from ..util.dto import InventoryDto api = InventoryDto.api in...
miteshnath/inventory-management-module
app/main/controller/inventory_controller.py
inventory_controller.py
py
2,780
python
en
code
0
github-code
6
[ { "api_name": "util.dto.InventoryDto.api", "line_number": 8, "usage_type": "attribute" }, { "api_name": "util.dto.InventoryDto", "line_number": 8, "usage_type": "name" }, { "api_name": "util.dto.InventoryDto.inventory", "line_number": 9, "usage_type": "attribute" }, {...
23089748371
import pygame as pg class Scoreboard: """Represents the score in game""" def __init__(self, game): """Initializes the properties of the scoreboard""" self.settings = game.settings self.screen = game.screen self.screen_rect = self.screen.get_rect() self.text_color = (...
jackloague1/Space-Invaders-Project
Space-Invaders-Project/scoreboard.py
scoreboard.py
py
1,770
python
en
code
0
github-code
6
[ { "api_name": "pygame.font.SysFont", "line_number": 14, "usage_type": "call" }, { "api_name": "pygame.font", "line_number": 14, "usage_type": "attribute" }, { "api_name": "pygame.SRCALPHA", "line_number": 34, "usage_type": "attribute" }, { "api_name": "pygame.SRCA...
14279218231
from .IngestorInterface import IngestorInterface from .QuoteModel import QuoteModel from typing import List import subprocess import os import random class PDFIngest(IngestorInterface): """Subclass of IngestorInterface specific for .docx files.""" ingestMode =['pdf'] @classmethod def parse(cls, pa...
JPNaan/MEMEGenerator
MEMEGenerator/src/QuoteEngine/IngestPDF.py
IngestPDF.py
py
1,466
python
en
code
0
github-code
6
[ { "api_name": "IngestorInterface.IngestorInterface", "line_number": 11, "usage_type": "name" }, { "api_name": "random.randint", "line_number": 30, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 31, "usage_type": "call" }, { "api_name": "os....
43721467284
# -*- coding: utf-8 -*- __author__ = 'SinGle' __date__ = '2020/06/26 14:39' import re from flask import current_app from app.lib.Snapshot import Snapshot def param_handler(params, action): if "SNAPSHOTNAME" not in params.keys() or re.search("[\\\\,./\\x20]", params["SNAPSHOTNAME"]): snapshot_name = Non...
xSinGle/Snapshot
app/lib/Helper.py
Helper.py
py
1,419
python
en
code
0
github-code
6
[ { "api_name": "re.search", "line_number": 13, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 19, "usage_type": "call" }, { "api_name": "flask.current_app.logger.error", "line_number": 21, "usage_type": "call" }, { "api_name": "flask.current_app...
27638879954
# -*- coding: utf-8 -*- """ Region/Anvil Serializer and Deserializer https://minecraft.gamepedia.com/Region_file_format https://minecraft.gamepedia.com/Anvil_file_format """ from collections import defaultdict # from datetime import datetime from enum import IntEnum import gzip from math import ceil import os import ...
xSetech/aPyNBT
aPyNBT/region.py
region.py
py
8,686
python
en
code
1
github-code
6
[ { "api_name": "re.compile", "line_number": 21, "usage_type": "call" }, { "api_name": "typing.Tuple", "line_number": 24, "usage_type": "name" }, { "api_name": "enum.IntEnum", "line_number": 29, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number":...
19409761077
import asyncio import os import datetime import discord from discord import channel from discord.ext import commands from discord_slash import SlashCommand, SlashContext, cog_ext from discord_slash.utils.manage_commands import create_option, create_choice from core.classes import CogExtension class System(CogExtensio...
TimTsai0316/MinatoBot
cmds/system.py
system.py
py
2,045
python
en
code
0
github-code
6
[ { "api_name": "core.classes.CogExtension", "line_number": 12, "usage_type": "name" }, { "api_name": "discord_slash.SlashContext", "line_number": 16, "usage_type": "name" }, { "api_name": "discord.Embed", "line_number": 17, "usage_type": "call" }, { "api_name": "da...
74025602427
import modules from templates.quick_replies import add_quick_reply from templates.text import TextTemplate from templates.button import * entities = { 'type':None, 'choice':None } def process(input, entities = None): print('process',input,entities) output = {} if entities['type'] == None: ...
anne030303/messenger-landbot
modules/src/lease_contract.py
lease_contract.py
py
5,963
python
en
code
0
github-code
6
[ { "api_name": "templates.text.TextTemplate", "line_number": 15, "usage_type": "call" }, { "api_name": "templates.quick_replies.add_quick_reply", "line_number": 18, "usage_type": "call" }, { "api_name": "modules.generate_postback", "line_number": 18, "usage_type": "call" ...
24470944971
import tensorflow as tf import numpy as np from malaya.text.function import ( language_detection_textcleaning, summarization_textcleaning, split_into_sentences, transformer_textcleaning, pad_sentence_batch, upperfirst, ) from malaya.text.rouge import postprocess_summary from malaya.text.bpe impo...
MuzyAce/malaya
malaya/model/tf.py
tf.py
py
20,513
python
en
code
null
github-code
6
[ { "api_name": "numpy.array", "line_number": 31, "usage_type": "call" }, { "api_name": "malaya.model.abstract.Classification", "line_number": 38, "usage_type": "name" }, { "api_name": "malaya.text.function.language_detection_textcleaning", "line_number": 51, "usage_type": ...
8866112441
import numpy as np import cv2 as cv def bitfield(n): return [int(digit) for digit in bin(n)[2:]] def gerar_mensagem(mensagem): lista = [] for m in mensagem: val = ord(m) bits = bitfield(val) if len(bits) < 8: for a in range(8-len(bits)): bits.insert(0...
joaofxp/computer-science-univali
Python/M2/Trabalho 2/main.py
main.py
py
3,084
python
pt
code
0
github-code
6
[ { "api_name": "numpy.array", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 25, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 46, "usage_type": "call" } ]
9790493238
"""backend URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based...
wiksla/f5-bigip-journeys-app
journeys/backend/urls.py
urls.py
py
1,978
python
en
code
0
github-code
6
[ { "api_name": "rest_framework_nested.routers.SimpleRouter", "line_number": 22, "usage_type": "call" }, { "api_name": "rest_framework_nested.routers", "line_number": 22, "usage_type": "name" }, { "api_name": "rest_framework_nested.routers.NestedSimpleRouter", "line_number": 25...
33560462969
"""Program to List, Create, Add, Edit, Delete contacts and save to a JSON file""" import json class CreateContact: """""" def __init__(self, fname, lname, phone): #constructor self.fname = fname self.lname = lname self.phone = phone def create_new_contact(self): cont...
alenantony/Alokin-Task
Day2/contact.py
contact.py
py
10,501
python
en
code
0
github-code
6
[ { "api_name": "json.loads", "line_number": 56, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 75, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 99, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 111,...
25598775886
import sys import numpy as np import cv2 def main(): source_window = "source_image" gray_window = "gray" otsu_window = "otsu_threshold" edge_window = "edge" gray_img = cv2.imread(sys.argv[1], cv2.IMREAD_GRAYSCALE) threshold1 = 0 threshold2 = 100 edge_img = cv2.Canny(gray_img, threshol...
NMurata07/findContours
main.py
main.py
py
852
python
en
code
0
github-code
6
[ { "api_name": "cv2.imread", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 11, "usage_type": "attribute" }, { "api_name": "cv2.IMREAD_GRAYSCALE", "line_number": 11, "usage_type": "attribute" }, { "api_name": "cv2.Canny", "l...
70465705787
import numpy as np import scipy import scipy.sparse.linalg import scipy.sparse as sparse from scipy.linalg import expm from copy import deepcopy ################################################## # auxiliary function for time evolution method # ################################################## def TEO_two_sites(MPO...
ZhaoYilin/modelham
modelham/tensornetwork/auxiliary.py
auxiliary.py
py
12,711
python
en
code
0
github-code
6
[ { "api_name": "numpy.zeros", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.kron", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.reshape", "line_number": 21, "usage_type": "call" }, { "api_name": "scipy.linalg.expm", "line_nu...
43469204471
from __future__ import annotations import yaml import os import errno __all__ = ["save_setup", "read_setup"] def save_setup(setup: dict, path: str): """ Save Model initialization setup dictionary. Parameters ---------- setup : dict The setup dictionary to be saved to `YAML <https://yaml...
DassHydro-dev/smash
smash/io/setup_io.py
setup_io.py
py
2,170
python
en
code
2
github-code
6
[ { "api_name": "yaml.dump", "line_number": 47, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 85, "usage_type": "call" }, { "api_name": "os.path", "line_number": 85, "usage_type": "attribute" }, { "api_name": "yaml.safe_load", "line_numb...
3360586236
""" 백준 1012 : 유기농 배추 """ """ BFS - Breath first Search 한번 방문한 지점은 절대로 다시 방문하지 않는다. """ from collections import deque import sys input=sys.stdin.readline dx=[-1,1,0,0] dy=[0,0,-1,1] # ( -1, 0) ( 1,0) ( 0,-1) (0,1) def BFS(graph,visit , x, y): deq=deque() deq.append([x,y]) visit[x]...
030831/2023-Winter_Vacation_GroupStudy
1012.py
1012.py
py
1,301
python
ko
code
0
github-code
6
[ { "api_name": "sys.stdin", "line_number": 13, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 21, "usage_type": "call" } ]
22844256236
nstations = int(input()) nlines = int(input()) station_lines = {} # station -> lines for i in range(nlines): _, *stations = map(int, input().split()) for st in stations: station_lines.setdefault(st, []).append(i) start, end = map(int, input().split()) #=== from itertools import combinations fr...
sergey-ryzhikov/yandex-alogotrain-3.0B
t40.py
t40.py
py
1,563
python
en
code
0
github-code
6
[ { "api_name": "itertools.combinations", "line_number": 26, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 34, "usage_type": "call" } ]
13289274017
import os import platform import sys try: from pip._internal.operations import freeze except ImportError: # pip < 10.0 from pip.operations import freeze py_version = sys.version.replace("\n", " ") py_platform = platform.platform() pkgs = freeze.freeze() pip_pkgs = "\n".join( pkg for pkg in pkgs ...
kalaracey/runhouse
collect_env.py
collect_env.py
py
1,178
python
en
code
null
github-code
6
[ { "api_name": "sys.version.replace", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.version", "line_number": 10, "usage_type": "attribute" }, { "api_name": "platform.platform", "line_number": 11, "usage_type": "call" }, { "api_name": "pip.operations...
12011303368
import os from dataclasses import dataclass from typing import Dict, List, Optional, Tuple import pandas as pd import textstat # Set absl logging to warning s.t. we don't see "INFO:absl:Using default tokenizer." for each rouge calculation from absl import logging from langdetect import detect from sitaevals.common i...
AsaCooperStickland/situational-awareness-evals
sitaevals/tasks/assistant/evaluator.py
evaluator.py
py
17,920
python
en
code
23
github-code
6
[ { "api_name": "absl.logging.set_verbosity", "line_number": 22, "usage_type": "call" }, { "api_name": "absl.logging", "line_number": 22, "usage_type": "name" }, { "api_name": "absl.logging.WARNING", "line_number": 22, "usage_type": "attribute" }, { "api_name": "typ...
13031397171
import rospy, sys, tf import moveit_commander from math import * from geometry_msgs.msg import PoseStamped from moveit_commander import MoveGroupCommander, PlanningSceneInterface from moveit_msgs.msg import PlanningScene, ObjectColor from moveit_msgs.msg import Grasp, GripperTranslation from moveit_msgs.msg import Move...
sniper0110/Turtlebot_arm
turtlebot_arm_moveit_demos/bin/pick_and_place.py
pick_and_place.py
py
17,847
python
en
code
4
github-code
6
[ { "api_name": "moveit_commander.roscpp_initialize", "line_number": 27, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 27, "usage_type": "attribute" }, { "api_name": "rospy.init_node", "line_number": 29, "usage_type": "call" }, { "api_name": "rosp...
21764328772
# Approach 1 - Breadth-First Search # Time: O(N) # Space: O(N) from collections import deque class Solution: def orangesRotting(self, grid: List[List[int]]) -> int: queue = deque() # build the initial set of rotten oranges fresh_oranges = 0 ROWS, COLS = len(grid), len(gri...
jimit105/leetcode-submissions
problems/rotting_oranges/solution.py
solution.py
py
1,876
python
en
code
0
github-code
6
[ { "api_name": "collections.deque", "line_number": 10, "usage_type": "call" } ]
10420754903
from __future__ import annotations import asyncio import os import platform import re from asyncio import IncompleteReadError, StreamReader, StreamWriter from pathlib import Path from typing import TYPE_CHECKING from randovania.patching.patchers.exceptions import UnableToExportError if TYPE_CHECKING: from collec...
randovania/randovania
randovania/games/prime2/patcher/csharp_subprocess.py
csharp_subprocess.py
py
3,321
python
en
code
165
github-code
6
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 13, "usage_type": "name" }, { "api_name": "asyncio.AbstractEventLoop", "line_number": 16, "usage_type": "attribute" }, { "api_name": "platform.system", "line_number": 20, "usage_type": "call" }, { "api_name": "p...
6727548995
from django.utils import timezone from .models import Post, IP from django.shortcuts import render, get_object_or_404, redirect from .forms import PostForm, Login from django.contrib.auth.decorators import login_required, PermissionDenied, user_passes_test import json from datetime import timedelta from django.utils.ti...
Dado-pixel/my-second-blog
blog/views.py
views.py
py
4,046
python
en
code
1
github-code
6
[ { "api_name": "flask.request.META.get", "line_number": 19, "usage_type": "call" }, { "api_name": "flask.request.META", "line_number": 19, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 19, "usage_type": "name" }, { "api_name": "flask.re...
21456848433
#works but need to find out how to add sound import datetime from playsound import playsound alarmhour = int(input("Enter Hour: ")) alarmins = int(input("Enter Minutes: ")) alarmAm = input("AM / PM: ").upper() if alarmAm == "pm".upper(): alarmhour += 12 while True: if alarmhour == datetime.datetime.now().hou...
MortalKhangbat/MACnCHEESE
alarm_clock.py
alarm_clock.py
py
479
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 13, "usage_type": "attribute" }, { "api_name": "playsound.playsound", "line_number": 14, "usage_type": "call" } ]
17968730699
# Databricks notebook source # MAGIC %md # MAGIC # Train Machine Learning Model # MAGIC # MAGIC This notebook aims to develop and register an MLFlow Model for deployment consisting of: # MAGIC - a machine learning model to predict the liklihood of employee attrition. # MAGIC # MAGIC This example uses an adapted versio...
nfmoore/azure-databricks-mlops-example-scenarios
core/notebooks/train_model.py
train_model.py
py
7,954
python
en
code
2
github-code
6
[ { "api_name": "pandas.DataFrame", "line_number": 87, "usage_type": "attribute" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 94, "usage_type": "call" }, { "api_name": "typing.Tuple", "line_number": 87, "usage_type": "name" }, { "api_n...
39702394709
from flask import Blueprint from flask import render_template, url_for, request from flask import make_response, send_from_directory from werkzeug.utils import secure_filename import os from apps.xmind2caseapp import write2excel, xmind2case x2c = Blueprint('x2c',__name__) # workpath = os.getcwd() workpath=os.path.di...
siqyka/QtestTool
x2c.py
x2c.py
py
1,860
python
en
code
0
github-code
6
[ { "api_name": "flask.Blueprint", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "l...
2338682136
import pandas as pd import numpy as np import json from collections import defaultdict from play_by_play import PlayByPlay #define front end variables DATE = '2015-12-25' SEASON = '2015-16' SEASON_TYPE = 'Regular+Season' # 'Regular+Season' or 'Playoffs' HOME_TEAM = 'LAL' def build_df(json): rows = [] for fr...
nalin1096/DS5500_Player_Tracking_and_Identification_NBA
helpers/play_by_play/pbp_ocr.py
pbp_ocr.py
py
4,444
python
en
code
6
github-code
6
[ { "api_name": "pandas.DataFrame", "line_number": 21, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 39, "usage_type": "call" }, { "api_name": "json.load", "line_number": 73, "usage_type": "call" }, { "api_name": "play_by_play.PlayB...
30434077830
#%% # 신호 기록 가져오기 with open('sample_20200601_pointfinger.txt', 'r') as openfile : samples = openfile.readlines() tmp_timests = [ samples[i][:-1] for i in range(len(samples)) if i%3==0 ] tmp_samples = [ samples[i][:-1] for i in range(len(samples)) if i%3==1 ] #%% # 중복된 시간 기록 제거 timests, samples = list(), list() del...
oimq/DoTheEHands
SignalAnalyzer.py
SignalAnalyzer.py
py
6,880
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.font_manager.get_fontconfig_fonts", "line_number": 25, "usage_type": "call" }, { "api_name": "matplotlib.font_manager", "line_number": 25, "usage_type": "name" }, { "api_name": "matplotlib.rc", "line_number": 26, "usage_type": "call" }, { ...
13303955971
from fastapi import APIRouter from app.libraries.libpermission import Permission from app.schemas.permission import PermissionModel, PermissionUpdateModel, PermissionCreateModel router = APIRouter(tags=["permission"]) oPermission = Permission() @router.get("/permission/schema") async def get_permission_schema(joined:...
treytose/Pyonet-API
pyonet-api/app/routers/permission.py
permission.py
py
1,440
python
en
code
0
github-code
6
[ { "api_name": "fastapi.APIRouter", "line_number": 5, "usage_type": "call" }, { "api_name": "app.libraries.libpermission.Permission", "line_number": 6, "usage_type": "call" }, { "api_name": "app.schemas.permission.PermissionCreateModel", "line_number": 21, "usage_type": "n...
29127983258
from django.test import TestCase from django.utils.translation import ugettext_lazy as _ from social_links import forms class LinksFormTests(TestCase): def taset_clean_url(self): valid_urls = [['https://www.example.com','https://www.example.com'] ['http://www.example.com','http://w...
TimBest/ComposersCouch
social_links/tests/tests_forms.py
tests_forms.py
py
5,893
python
en
code
1
github-code
6
[ { "api_name": "django.test.TestCase", "line_number": 7, "usage_type": "name" }, { "api_name": "social_links.forms.clean_url", "line_number": 16, "usage_type": "call" }, { "api_name": "social_links.forms", "line_number": 16, "usage_type": "name" }, { "api_name": "d...
34371656679
############################################################################################################ from colorama import * import os import requests import re ############################################################################################################ def search_words_in_file(file_path,...
OMGmultitools/Anti-Grabber
Anti Grabbee.py
Anti Grabbee.py
py
3,123
python
en
code
0
github-code
6
[ { "api_name": "os.system", "line_number": 15, "usage_type": "call" }, { "api_name": "re.search", "line_number": 18, "usage_type": "call" }, { "api_name": "os.system", "line_number": 28, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 41, ...
438092224
from django.http import HttpResponse from django.shortcuts import redirect, reverse, render from cart.models import Cart, Item, OrderItem, Basket from product_listing.models import Product import cart.forms import datetime from django.contrib.auth import authenticate # Create your views here. def index(request): cont...
ftaoussi/COMP307---Marketplace
cart/views.py
views.py
py
4,769
python
en
code
0
github-code
6
[ { "api_name": "cart.models.Cart.objects.filter", "line_number": 14, "usage_type": "call" }, { "api_name": "cart.models.Cart.objects", "line_number": 14, "usage_type": "attribute" }, { "api_name": "cart.models.Cart", "line_number": 14, "usage_type": "name" }, { "ap...
35177658753
import numpy as np from sklearn.model_selection import train_test_split class ToyDataset: def __init__(self, min_len, max_len): self.SOS = "<s>" self.EOS = "/<s>" self.characters = list("abcd") self.int2char = self.characters # 1 for SOS, 1 for EOS, 1 for padding ...
xuzhiyuan1528/tf2basic
Seq2Seq/Utils.py
Utils.py
py
2,080
python
en
code
0
github-code
6
[ { "api_name": "sklearn.model_selection.train_test_split", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.random.randint", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 35, "usage_type": "attribute" }, { "a...
40140601153
import streamlit as st import pandas as pd st.set_page_config(layout="wide") col1, col2 = st.columns([3, 1]) option = None df = pd.read_csv('reuters_summaries.csv') with col2: st.write("") st.write("") st.write("") st.write("") st.write("") option = st.selectbox('', ['Crude Oil', 'Biofuel'])...
Jayanth-Shanmugam/news-articles-summarization
pages/Reuters.py
Reuters.py
py
1,302
python
en
code
0
github-code
6
[ { "api_name": "streamlit.set_page_config", "line_number": 4, "usage_type": "call" }, { "api_name": "streamlit.columns", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "streamlit.wr...
39697377859
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits import mplot3d # index boundaries for time 3D plot nStart = 140000 nEnd = 160000 with open("time_series_stochastic_old.txt", "r") as file: lines = file.readlines() time = [] intensity = [] E_real = [] E_imag = [] for line in lines:...
sir-aak/microscopically-derived-rate-equations
plotscripts/mdre_plotscript_spiking_detail.py
mdre_plotscript_spiking_detail.py
py
1,701
python
en
code
1
github-code
6
[ { "api_name": "numpy.array", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": ...
75051539708
# -*- coding: utf-8 -*- r""" tests.test_state ~~~~~~~~~~~~~~~~ Tests for the \p State class including movement mechanics and enumeration of the \p MoveSet class. :copyright: (c) 2019 by Zayd Hammoudeh. :license: MIT, see LICENSE for more details. """ from typing import Tuple import pytest fr...
ZaydH/stratego
src/tests/test_state.py
test_state.py
py
14,130
python
en
code
0
github-code
6
[ { "api_name": "stratego.player.Player", "line_number": 26, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 26, "usage_type": "name" }, { "api_name": "stratego.location.Location", "line_number": 37, "usage_type": "call" }, { "api_name": "strate...
36813380552
"""empty message Revision ID: 073719702e2e Revises: 23ecd00cae18 Create Date: 2020-03-29 13:31:19.799319 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '073719702e2e' down_revision = '23ecd00cae18' branch_labels = None depends_on = None def upgrade(): # ...
koiic/project-tracker
migrations/versions/073719702e2e_.py
073719702e2e_.py
py
1,333
python
en
code
0
github-code
6
[ { "api_name": "alembic.op.create_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy.Integ...