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
702144150
import requests from bs4 import BeautifulSoup import urllib.request import json from selenium import webdriver from time import sleep from selenium.webdriver.chrome.options import Options chrome_options = Options() # 啟動無頭模式 chrome_options.add_argument('--headless') #規避google bug chrome_options.add_argument(...
fcu-D0441126/scrapy-Food-Panda
foodpanda.py
foodpanda.py
py
2,262
python
en
code
0
github-code
18
[ { "api_name": "selenium.webdriver.chrome.options.Options", "line_number": 9, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 12, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 12, "usage_type": "name" }, { ...
13720767604
import os import pygments from prompt_toolkit import print_formatted_text from prompt_toolkit.formatted_text import PygmentsTokens from pygments_markdown_lexer import MarkdownLexer from typing import Any from langchain import ConversationChain, OpenAI from langchain.chat_models import ChatOpenAI from langchain.chains.c...
eunomia-bpf/GPTtrace
gpttrace/utils/common.py
common.py
py
4,086
python
en
code
152
github-code
18
[ { "api_name": "llama_index.VectorStoreIndex", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 34, "usage_type": "name" }, { "api_name": "pygments_markdown_lexer.MarkdownLexer", "line_number": 34, "usage_type": "name" }, { "api...
72031158441
import torch from . import TransformException, BaseTransform class ToTensor(BaseTransform): """ convert obspy Trace to Tensor Args: device (torch.device) source (string): the data source to filter, default: raw output: (string): optional, the key of the output data in the dictionary...
blainerothrock/hyperspectral-imaging-ml
hyperspec/transforms/to_tensor.py
to_tensor.py
py
1,327
python
en
code
1
github-code
18
[ { "api_name": "torch.device", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.device", "line_number": 21, "usage_type": "attribute" }, { "api_name": "torch.tensor", "line_number": 33, "usage_type": "call" }, { "api_name": "torch.tensor", "line_...
3914474894
import os import datetime from discord.ext import commands import discord from dotenv import load_dotenv load_dotenv() TOKEN = os.getenv('DISCORD_TOKEN') FILE_NAME = "timetable.csv" HOURS_PER_DAY = 24 DAYS_PER_WEEK = 5 timetable = [[None for h in range(HOURS_PER_DAY)] for d in range(DAYS_PER_WEEK)] bot = commands.B...
evanSpendlove/DarkSpace
darkspace.py
darkspace.py
py
1,764
python
en
code
1
github-code
18
[ { "api_name": "dotenv.load_dotenv", "line_number": 8, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 10, "usage_type": "call" }, { "api_name": "discord.ext.commands.Bot", "line_number": 16, "usage_type": "call" }, { "api_name": "discord.ext.comm...
16213633644
# -*- coding: utf-8 -*- import sys,os import csv import json import re import string import ast import uuid import itertools import codecs from operator import itemgetter from subprocess import Popen, PIPE from inspect import currentframe, getframeinfo import argparse import numpy as np from performance import Perfor...
Peilin-Yang/boundary_theory
utils/run_proximity_subqueries.py
run_proximity_subqueries.py
py
12,952
python
en
code
0
github-code
18
[ { "api_name": "run_subqueries.RunSubqueries", "line_number": 22, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_number": 28, "usage_type": "attribute" }, { "api_name": "os.path.exists...
73480169319
""" This module gather the main package functions one can use elsewhere, *e.g.* in the demo. :author: Jean-Baptiste Courbot - jean-baptiste.courbot@univ-lyon1.fr :date: november 02, 2015 """ import numpy as np import scipy.stats as st import scipy.ndimage.morphology as morph import sys sys.path.insert(0,'../lib...
courbot/heolht
lib/strategy_detection_pose.py
strategy_detection_pose.py
py
6,749
python
en
code
2
github-code
18
[ { "api_name": "sys.path.insert", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "scipy.ndimage.morphology.binary_dilation", "line_number": 54, "usage_type": "call" }, { "api_name":...
73773701800
import pandas as pd import numpy as np import warnings from scipy.special import betainc from tqdm import tqdm import os os.environ["MKL_NUM_THREADS"] = "10" os.environ["NUMEXPR_NUM_THREADS"] = "10" os.environ["OMP_NUM_THREADS"] = "10" os.environ["OPENBLAS_NUM_THREADS"] = "10" os.environ["VECLIB_MAXIMUM_THREADS"] = "10...
DEIB-GECO/GeneNetFusion
creation_matrices.py
creation_matrices.py
py
13,119
python
en
code
1
github-code
18
[ { "api_name": "os.environ", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.environ", "line_n...
28465480821
import base64 import json from aws_lambda_powertools.utilities.data_classes import ( KinesisFirehoseEvent, event_source, ) from aws_lambda_powertools.utilities.typing import LambdaContext @event_source(data_class=KinesisFirehoseEvent) def lambda_handler(event: KinesisFirehoseEvent, context: LambdaContext): ...
heitorlessa/aws-lambda-powertools-test
examples/event_sources/src/kinesis_firehose_delivery_stream.py
kinesis_firehose_delivery_stream.py
py
753
python
en
code
0
github-code
18
[ { "api_name": "aws_lambda_powertools.utilities.data_classes.KinesisFirehoseEvent", "line_number": 12, "usage_type": "name" }, { "api_name": "aws_lambda_powertools.utilities.typing.LambdaContext", "line_number": 12, "usage_type": "name" }, { "api_name": "base64.b64encode", "li...
42427196827
import numpy as np import cvxpy as cp import const import pickle import general import simulate def iterative(D: np.array, M: np.array): ''' Estimates state according to iterative MLE. :param D : N array of measured data datatype: D[i] = [index of POVM] :param M : Nxdxd array of POVM set ...
3ti3nn3/tomography
mle.py
mle.py
py
3,918
python
en
code
1
github-code
18
[ { "api_name": "numpy.array", "line_number": 9, "usage_type": "attribute" }, { "api_name": "general.count", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.int", "line_numbe...
17005494321
# -*- coding: utf-8 -*- # This file is part of Viper - https://github.com/viper-framework/viper # See the file 'LICENSE' for copying permission. from __future__ import unicode_literals import os import sys from tests.conftest import FIXTURE_DIR from viper.common.objects import File, MispEvent import pytest class Tes...
viper-framework/viper
tests/common/test_objects.py
test_objects.py
py
1,991
python
en
code
1,527
github-code
18
[ { "api_name": "viper.common.objects.MispEvent", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 17, "usage_type": "call" }, { "api_name": "tests.conftest.FIXTURE_DIR", "line_number": 17, "usage_type": "argument" }, { "api_na...
14817071891
import networkx as nx import numpy as np class Sniper: def __init__(self, prop): self.y = 0.5 self.r = 0.05 self.graph = nx.Graph() self.proportion = prop def score(self, grad): nodes = [int(k) for k in list(grad.keys())] self.graph.add_nodes_from(nodes) ...
poopcorn/FedCare
backend/anomaly/metrics/sniper.py
sniper.py
py
1,743
python
en
code
1
github-code
18
[ { "api_name": "networkx.Graph", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 2...
71426520680
# This Python 3 environment comes with many helpful analytics libraries installed # It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python # For example, here's several helpful packages to load in import numpy as np # linear algebra import pandas as pd # data processing, CSV fil...
aorursy/new-nb-3
evanwang1028_2j5n5j6o.py
evanwang1028_2j5n5j6o.py
py
2,028
python
en
code
0
github-code
18
[ { "api_name": "subprocess.check_output", "line_number": 23, "usage_type": "call" }, { "api_name": "pandas.read_json", "line_number": 28, "usage_type": "call" }, { "api_name": "pandas.read_json", "line_number": 30, "usage_type": "call" }, { "api_name": "pandas.to_d...
21545802748
# coding:utf8 import time from fastweb.web import Api, Page from fastweb.exception import HttpError from fastweb.component.request import Request from fastweb.web import coroutine, run_on_executor class Test(Api): @coroutine #@checkArgument(name=str, sex=int) def get(self): """ #sel...
CYang828/fastweb
examples/web/handlers/test.py
test.py
py
2,880
python
en
code
18
github-code
18
[ { "api_name": "fastweb.web.Api", "line_number": 11, "usage_type": "name" }, { "api_name": "fastweb.component.request.Request", "line_number": 48, "usage_type": "call" }, { "api_name": "fastweb.exception.HttpError", "line_number": 51, "usage_type": "name" }, { "api...
21227010853
from django.contrib.auth import get_user_model from rest_framework.test import APITestCase, APIClient from rest_framework.reverse import reverse from rest_framework.authtoken.models import Token import json from authors.apps.highlights.models import Highlight from authors.apps.articles.tests.basetests import BaseTest ...
andela/ah-the-immortals-backend
authors/apps/highlights/tests/basetests.py
basetests.py
py
8,412
python
en
code
1
github-code
18
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 9, "usage_type": "call" }, { "api_name": "authors.apps.articles.tests.basetests.BaseTest", "line_number": 12, "usage_type": "name" }, { "api_name": "rest_framework.reverse.reverse", "line_number": 16, "usa...
8881021991
import looker_sdk from pathlib import Path base_path = Path(__file__).resolve().parent LOOKER_SDK_CONFIG = { 'base_url': 'https://...sa.looker.com...', 'client_id': 'gv...', 'client_secret': 'bM...' } BASE_URL = LOOKER_SDK_CONFIG['base_url'] CLIENT_ID = LOOKER_SDK_CONFIG['client_id'] CLIENT_SECRET = LOOKE...
rrpizzano/business_intelligence
general_code/looker/Return ID by Name/return_id_by_name.py
return_id_by_name.py
py
904
python
en
code
1
github-code
18
[ { "api_name": "pathlib.Path", "line_number": 4, "usage_type": "call" }, { "api_name": "looker_sdk.init31", "line_number": 19, "usage_type": "call" } ]
71216987239
import collections import enum import json import logging import os import urllib.parse # Source: https://en.wikipedia.org/wiki/Seattle_Fire_Department # # TODO(aryann): Many of the unit types are missing from this list. _UNIT_MAP = { 'A': 'Basic Life', 'AIR': 'Air Unit', 'B': 'Battalion Chief', 'CHAP...
aryann/seattlefiretwitterbot
parser.py
parser.py
py
5,314
python
en
code
0
github-code
18
[ { "api_name": "os.path.join", "line_number": 46, "usage_type": "call" }, { "api_name": "os.path", "line_number": 46, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 46, "usage_type": "call" }, { "api_name": "os.path.realpath", "lin...
73015049319
#!/bin/env python from os.path import exists import numpy as np import cv2 import sys cv2.namedWindow('image') # Default hsv configured for red hsv_min = np.array([0, 93, 237]) hsv_max = np.array([179, 255, 255]) # Read config from colors.csv if exists('colors.csv'): with open('colors.csv') as f: vals = ...
danipatko/infotabor
detect/color.py
color.py
py
1,105
python
en
code
0
github-code
18
[ { "api_name": "cv2.namedWindow", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.exists", "line_num...
13338865611
# We import all our dependencies. from venv import create from pandas import test from n2v.internals.N2P_ImageFormatter import N2P_ImageFormatter from n2v.models import N2VConfig, N2V from n2v.models.n2p_config import N2PConfig import numpy as np from csbdeep.utils import plot_history from n2v.utils.n2v_utils import m...
jakezimm12/n2p-master
main.py
main.py
py
6,935
python
en
code
0
github-code
18
[ { "api_name": "ssl._create_default_https_context", "line_number": 19, "usage_type": "attribute" }, { "api_name": "ssl._create_unverified_context", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.path.isdir", "line_number": 22, "usage_type": "call" }, ...
2476153344
from typing import Dict, Union, List import tensorflow as tf from ants_ai.training.neural_network.encoders.encoders import TrainingDataset from kerastuner import HyperParameters from ants_ai.training.neural_network.factories.model_factory import ModelFactory, EncodingType from ants_ai.training.neural_network.factories...
Jason-Turan0/ants
ants_ai/training/neural_network/factories/conv2d_maxpool_model_factory.py
conv2d_maxpool_model_factory.py
py
3,758
python
en
code
1
github-code
18
[ { "api_name": "ants_ai.training.neural_network.factories.model_factory.ModelFactory", "line_number": 26, "usage_type": "name" }, { "api_name": "ants_ai.training.neural_network.factories.model_hyper_parameter.ModelHyperParameter", "line_number": 29, "usage_type": "call" }, { "api_...
71773720360
# File: common_demo.py import json import os import string import logging import sys from pathlib import Path logging.basicConfig(format='[ %(levelname)s ] %(message)s',level=logging.DEBUG) logging.disable(logging.DEBUG) current_path = os.path.abspath(os.getcwd()) demo_info = current_path + '/Source/demo_info.json' ...
henry1758f/OpenVINO_Demo_Kit
Source/common_demo.py
common_demo.py
py
11,572
python
en
code
10
github-code
18
[ { "api_name": "logging.basicConfig", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 9, "usage_type": "attribute" }, { "api_name": "logging.disable", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.DEBUG", ...
26437648620
import json from django.views.generic.edit import FormView from django.forms.models import modelform_factory, modelformset_factory, inlineformset_factory from django.http import HttpResponse, JsonResponse from django.shortcuts import render, get_object_or_404 from django.middleware import csrf from django.urls import ...
tayursky/med-crm
directory/views/forms.py
forms.py
py
12,205
python
en
code
0
github-code
18
[ { "api_name": "django.views.generic.edit.FormView", "line_number": 22, "usage_type": "name" }, { "api_name": "directory.utils.get_model", "line_number": 31, "usage_type": "call" }, { "api_name": "django.http.JsonResponse", "line_number": 35, "usage_type": "call" }, { ...
1521068922
import googlemaps import ast import sys import time sys.path.append("lib/") from myio import read_excel, save def get_geoNearBy(locations, types): vic = [] # to save result of the vicinity cnt = 0 for loc in locations: dicLoc = ast.literal_eval(loc["coordinate"]) # turn string into dict coo...
a22057916w/StoreManager
google_API/gen_vic.py
gen_vic.py
py
2,030
python
en
code
3
github-code
18
[ { "api_name": "sys.path.append", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "ast.literal_eval", "line_number": 12, "usage_type": "call" }, { "api_name": "time.sleep", "line_n...
70043647079
import flet as ft from view_panel.base import CameraViewPanel import pyastrov.ui.ft_part as ft_part from pyastrov.core import AstroVCore from pyastrov.camera.interface import ControlType from pyastrov.procimg import utils import asyncio idx = 0 class CameraWBPanel(ft.UserControl): def __init__(self,core :AstroVCor...
imoken1122/PyAstroV
pyastrov/ui/control_panel/wb_rgb.py
wb_rgb.py
py
4,532
python
en
code
0
github-code
18
[ { "api_name": "flet.UserControl", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pyastrov.core.AstroVCore", "line_number": 10, "usage_type": "name" }, { "api_name": "view_panel.base.CameraViewPanel", "line_number": 10, "usage_type": "name" }, { "api...
9747363392
import random import ssl import time import sys import socket, threading, select import os import subprocess import configparser bg='' G = bg+'\033[32m' O = bg+'\033[33m' GR = bg+'\033[37m' R = bg+'\033[31m' logo=''' ++++ ++++ +++ ++++ + + + + + + ...
Monster-ZeroX/http-ssl-ssh-injector
sni.py
sni.py
py
3,432
python
en
code
null
github-code
18
[ { "api_name": "time.ctime", "line_number": 30, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 37, "usage_type": "call" }, { "api_name": "sys.stdout.write", "line_number": 38, "usage_type": "call" }, { "api_name": "sys.stdout", "line_numb...
13517368632
from django.shortcuts import render, get_object_or_404, redirect from .models import Projecten from .models import Vloeren from .models import Bedrijven from .models import Datum_Document from .models import Controlemomenten_gepland from django.contrib.auth.decorators import login_required from django.views.decorator...
hzm74/docreg
djdocreg/database/views.py
views.py
py
5,810
python
nl
code
1
github-code
18
[ { "api_name": "models.Bedrijven.objects.all", "line_number": 25, "usage_type": "call" }, { "api_name": "models.Bedrijven.objects", "line_number": 25, "usage_type": "attribute" }, { "api_name": "models.Bedrijven", "line_number": 25, "usage_type": "name" }, { "api_n...
8631180081
import sys import itertools start = [[False for i in range(0,1000)] for j in range(0, 1000)] def set_all(start, line, val): foo = line.split() fram = foo[2].split(',') to = foo[4].split(',') r1 = range(int(fram[0]), int(to[0]) +1) r2 = range(int(fram[1]), int(to[1])+1) for (i,j) in itertools....
Prozen/AdventOfCode
6/6.py
6.py
py
929
python
en
code
0
github-code
18
[ { "api_name": "itertools.product", "line_number": 11, "usage_type": "call" }, { "api_name": "itertools.product", "line_number": 26, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 31, "usage_type": "attribute" } ]
6855172062
import requests from bs4 import BeautifulSoup as BS from pprint import pprint def parse_cars(): url = 'https://www.mashina.kg/search/all/' response = requests.get(url, timeout=15) print(response) print(response.status_code == 200) # print(response.text[:200]) cars = [] soup = BS(response...
liligga/telebot_273
parser/base.py
base.py
py
929
python
en
code
0
github-code
18
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 15, "usage_type": "call" } ]
31502030752
import argparse import matplotlib.pyplot as plt import torch from src.data.make_dataset import CorruptMnist from src.models.model import MyAwesomeModel def training() -> None: parser = argparse.ArgumentParser(description="Training arguments") parser.add_argument("--lr", default=1e-3) args = parser.parse...
SkafteNicki/example_mlops
src/models/train_model.py
train_model.py
py
1,414
python
en
code
2
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 16, "usage_type": "attribute" }, { "api_name": "src.m...
39310622105
""" Module with class that can represent who has been updated and when, along with functions to load it from and save it to s3. """ from datetime import datetime import json import os from typing import Any, Dict, List, Optional import boto3 from get_logger import get_logger STORECHECKER_S3_BUCKET: str = os.environ[...
ktausch/switch-price-updates
lambda_functions/update_state.py
update_state.py
py
2,574
python
en
code
0
github-code
18
[ { "api_name": "os.environ", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 15, "usage_type": "attribute" }, { "api_name": "get_logger.get_logger", "line_number": 17, "usage_type": "call" }, { "api_name": "boto3.client", ...
8496255154
from flask import render_template, flash, redirect, url_for from loan import app from loan.forms import * from loan.models import * @app.route('/') def home(): loans = Loan.query.all() return render_template('home.html', loans=loans) @app.route('/loan', methods=['GET', 'POST']) def loan(): form = LoanFo...
djangowilly/Loan
loan/routes.py
routes.py
py
1,051
python
en
code
0
github-code
18
[ { "api_name": "flask.render_template", "line_number": 10, "usage_type": "call" }, { "api_name": "loan.app.route", "line_number": 7, "usage_type": "call" }, { "api_name": "loan.app", "line_number": 7, "usage_type": "name" }, { "api_name": "flask.redirect", "lin...
30267716183
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ Управление классами ядра системы """ from os import path import json import logging from config import SETTINGS from config import TEST_PATH_RESULTS, WRONG_AUTO_MINFIN_TESTS_FILE from constants import ERROR_NO_DOCS_FOUND, ERROR_REQUEST_CONTAINS_BAD_WORD from core.answer...
svetakorn/Datatron
data_retrieving.py
data_retrieving.py
py
18,306
python
ru
code
0
github-code
18
[ { "api_name": "text_preprocessing.TextPreprocessing", "line_number": 37, "usage_type": "call" }, { "api_name": "core.answer_object.CoreAnswer", "line_number": 46, "usage_type": "call" }, { "api_name": "constants.ERROR_REQUEST_CONTAINS_BAD_WORD", "line_number": 65, "usage_...
34442515484
import subprocess import os from six import string_types # SLHA parser # by Florian Staub (florian.staub@gmail.com) # ---------------------------------------------------------- # SLHA Class # ---------------------------------------------------------- class SLHA(): def __init__(self): self.blocks = {} ...
fstaub/xSLHA
xslha/main.py
main.py
py
10,207
python
en
code
4
github-code
18
[ { "api_name": "os.path.isfile", "line_number": 203, "usage_type": "call" }, { "api_name": "os.path", "line_number": 203, "usage_type": "attribute" }, { "api_name": "subprocess.call", "line_number": 204, "usage_type": "call" }, { "api_name": "subprocess.call", ...
32415218501
import math import time from matplotlib import cm, pyplot as plt from numpy import array, convolve, linalg, matrix, trace, transpose from PIL import Image from gaussian_filters import gauss, gauss_1der, gauss_2der from mark_show import mark_show_hess def hessian(img, # the input image name ...
vatsalya-gupta/AVD624-Computer-Vision
Assignments/Code_for_Assignment_2/01_Hessian_Matrix/01_hessian_matrix.py
01_hessian_matrix.py
py
2,921
python
en
code
0
github-code
18
[ { "api_name": "time.time", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 18, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 18, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 1...
2420655950
from collections import deque from Entidades.Term import TermUnit from Entidades.Term import Term from Entidades.Grammar.TextGrammar import TextGrammar from Entidades.Grammar.Grammar import Grammar from Services.LexicAnalyzer import LexicAnalyzer class TableService: ErrorString = "Error" def __init__(se...
CCTUnifor/Compiler
Python/Analisador Sintático Descendente Tabular/Services/GrammarTableService.py
GrammarTableService.py
py
8,119
python
en
code
8
github-code
18
[ { "api_name": "Entidades.Grammar.Grammar.Grammar.STREAM_END_UNIT", "line_number": 21, "usage_type": "attribute" }, { "api_name": "Entidades.Grammar.Grammar.Grammar", "line_number": 21, "usage_type": "name" }, { "api_name": "Entidades.Term.TermUnit.TERMINAL", "line_number": 45...
25919836905
import feedparser import re import docclass def read(feed,classifier): f=feedparser.parse(feed) for entry in f['entries']: #print(entry) print ()#这一行在干嘛 print('-----') #print('title') #print(entry['title'].encode('utf-8')) print ('Title: ',entry['title'].encode('utf-...
sevenry/python_learning_note
programm_collective_intelligence/chap6/feedfilter.py
feedfilter.py
py
1,757
python
en
code
2
github-code
18
[ { "api_name": "feedparser.parse", "line_number": 5, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 40, "usage_type": "call" } ]
13590692648
from sklearn.linear_model import LogisticRegression from sklearn.preprocessing import StandardScaler from sklearn.model_selection import train_test_split import numpy as np def logisticRegression(): data=np.loadtxt("ex2data1.txt",delimiter=",",dtype=np.float64) X=data[:,0:-1] y=data[:,-1] #train_test_...
penggan666/ml
logic regression/scikit_logic.py
scikit_logic.py
py
1,003
python
en
code
1
github-code
18
[ { "api_name": "numpy.loadtxt", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.float64", "line_number": 7, "usage_type": "attribute" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 12, "usage_type": "call" }, { "api_name"...
578353035
#! /usr/bin/env python # -*- coding: utf-8 -*- """Merge two existed dataset.""" import argparse import logging from pathlib import Path from os.path import dirname as parent from fairseq.molecule_utils.external.fairseq_dataset_build_utils import merge_and_build from fairseq.molecule_utils.basic import smiles_utils a...
HankerWu/TamGent
scripts/build_data/merge_datasets.py
merge_datasets.py
py
1,974
python
en
code
15
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 16, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 17, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 19, "usage_type": "name" }, { "api_name": "pathlib.Path", ...
37643906078
import re from collections import Counter from pathlib import Path from shutil import copyfile from typing import Set, List, Literal, Iterable, Optional import pandas from sortedcontainers import SortedDict from tqdm import tqdm from .base import BaseTask, CorporaTaskMixin from .filters.base import CandidatesPairCSV ...
MarvinLvn/paraphone
paraphone/tasks/corpora.py
corpora.py
py
11,113
python
en
code
0
github-code
18
[ { "api_name": "typing.Set", "line_number": 19, "usage_type": "name" }, { "api_name": "imports.FileID", "line_number": 19, "usage_type": "name" }, { "api_name": "workspace.Workspace", "line_number": 19, "usage_type": "name" }, { "api_name": "workspace.root_path", ...
26535666745
import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' import warnings warnings.filterwarnings('ignore') import argparse from typing import List from src.models.named_entity_recognition_rnn import RNNModel, DataPreprocessor from src.utils.config_loader import NamedEntityRecognitionConfigReader def evaluate_model(question...
mmarouen/marabou
marabou/train/src/scripts/eval_named_entity_recognition.py
eval_named_entity_recognition.py
py
2,362
python
en
code
2
github-code
18
[ { "api_name": "os.environ", "line_number": 2, "usage_type": "attribute" }, { "api_name": "warnings.filterwarnings", "line_number": 4, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 11, "usage_type": "name" }, { "api_name": "src.utils.config_lo...
4819232112
""" 129. Sum Root to Leaf Numbers You are given the root of a binary tree containing digits from 0 to 9 only. Each root-to-leaf path in the tree represents a number. - For example, the root-to-leaf path 1->2->3 represents the number 123. Return the total sum of all root-to-leaf numbers. Test cases are generated so tha...
tkwang0530/LeetCode
0129.py
0129.py
py
3,512
python
en
code
4
github-code
18
[ { "api_name": "typing.List", "line_number": 63, "usage_type": "name" }, { "api_name": "collections.deque", "line_number": 92, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 112, "usage_type": "attribute" }, { "api_name": "unittest.main",...
24587856577
import base64 import collections import contextlib import email.message import http.client import http.server import json import socket import threading import time from typing import BinaryIO from typing import cast from typing import Dict from typing import Iterable from typing import Iterator from typing import Tupl...
AllSeeingEyeTolledEweSew/http_proxy
http_proxy_test.py
http_proxy_test.py
py
35,110
python
en
code
0
github-code
18
[ { "api_name": "typing.Iterator", "line_number": 29, "usage_type": "name" }, { "api_name": "typing.BinaryIO", "line_number": 35, "usage_type": "name" }, { "api_name": "http.client.client.parse_headers", "line_number": 37, "usage_type": "call" }, { "api_name": "http...
6128463262
import random import math import sys import numpy as np from PIL import Image, ImageDraw def cartesianProduct(*arrays): la = len(arrays) dtype = np.result_type(*arrays) arr = np.empty([len(a) for a in arrays] + [la], dtype=dtype) for i, a in enumerate(np.ix_(*arrays)): arr[...,i] = a return...
Saptak625/SimHabitat
main.py
main.py
py
4,389
python
en
code
1
github-code
18
[ { "api_name": "numpy.result_type", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.empty", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.ix_", "line_number": 11, "usage_type": "call" }, { "api_name": "random.randint", "line_num...
9552295350
import sys import gc from numpy.random import seed seed(7) import numpy as np import glob from utils import get_classes from sklearn.model_selection import StratifiedShuffleSplit import cv2 from keras.utils import to_categorical import scipy.io as sio from scipy.misc import imresize def load_inputs(mode, test_subject,...
AdrianNunez/keras_models
cnn-m-2048_based_two-stream_network/data.py
data.py
py
21,402
python
en
code
7
github-code
18
[ { "api_name": "numpy.random.seed", "line_number": 4, "usage_type": "call" }, { "api_name": "scipy.io.loadmat", "line_number": 23, "usage_type": "call" }, { "api_name": "scipy.io", "line_number": 23, "usage_type": "name" }, { "api_name": "sys.exit", "line_numbe...
42837343738
from functools import partial from kivy.uix.anchorlayout import AnchorLayout from kivy.clock import Clock from constants import green_color, red_color, maroon_color from application.application_utils import create_grid_layout, create_label from application.screens.games.base_game import BaseGame from application.widget...
QuimMarset/MAI-CIR
application/screens/games/number_gap_filling_game_screen.py
number_gap_filling_game_screen.py
py
3,770
python
en
code
0
github-code
18
[ { "api_name": "application.screens.games.base_game.BaseGame", "line_number": 11, "usage_type": "name" }, { "api_name": "application.application_utils.create_grid_layout", "line_number": 28, "usage_type": "call" }, { "api_name": "application.application_utils.create_grid_layout", ...
74149028841
from config import dino_pretrain_path from .resnet import ResNet from .vision_transformer import * import torch def get_backbone(args, **kwargs): if "resnet" in args.arch: return _get_resnet_backbone(args) elif "vit" in args.arch: return _get_vit_backbone(args, **kwargs) else: ...
kleinzcy/Cr-KD-NCD
model/get_model.py
get_model.py
py
1,331
python
en
code
2
github-code
18
[ { "api_name": "resnet.ResNet", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.load", "line_number": 24, "usage_type": "call" }, { "api_name": "config.dino_pretrain_path", "line_number": 24, "usage_type": "argument" } ]
74037692520
from construct import Struct, Int32ul, Int16ul, Int8ul, Nibble, Const, IfThenElse, this, Bytes, BitStruct from formats.common import FlagsEnumCumulative ''' typedef enum FLG_CONTIGUOUS_MIP { FLG_7ZIP = 0x40000000, FLG_ADDRU_MASK = 0xf, FLG_ADDRV_MASK = 0xf0, FLG_ARRTEX = 0x200000, FLG_COMPR_MASK =...
klensy/wt-tools
src/wt_tools/formats/ddsx_parser.py
ddsx_parser.py
py
2,581
python
en
code
125
github-code
18
[ { "api_name": "formats.common.FlagsEnumCumulative", "line_number": 30, "usage_type": "call" }, { "api_name": "construct.Int32ul", "line_number": 31, "usage_type": "argument" }, { "api_name": "construct.Struct", "line_number": 74, "usage_type": "call" }, { "api_nam...
23839988252
import hashlib import json import os import string import sys import typing sys.path.append(os.getcwd()) import disk_set def truncated_sha1(pwd): # type: (typing.Text) -> bytes return hashlib.sha1(pwd.encode("utf8")).digest()[:8] def brute_force(length, strings): # type: (int, typing.Sequence[typing.Text...
warm-ice0x00/disk-set
main.py
main.py
py
1,030
python
en
code
0
github-code
18
[ { "api_name": "sys.path.append", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 9, "usage_type": "call" }, { "api_name": "hashlib.sha1", "line_number"...
22987268922
from typing import cast from unittest.mock import AsyncMock, patch import pytest from starknet_py.contract import Contract from starknet_py.hash.address import compute_address from starknet_py.hash.selector import get_selector_from_name from starknet_py.net.account.account import Account from starknet_py.net.account....
software-mansion/starknet.py
starknet_py/tests/e2e/account/account_test.py
account_test.py
py
22,277
python
en
code
231
github-code
18
[ { "api_name": "starknet_py.net.account.account.Account", "line_number": 36, "usage_type": "call" }, { "api_name": "starknet_py.net.signer.stark_curve_signer.KeyPair", "line_number": 39, "usage_type": "call" }, { "api_name": "typing.cast", "line_number": 40, "usage_type": ...
316718183
"""raytracing helper functions for deferred rendering using pyembree as a backend Currently, meshes are represented as simple dictionaries with vertices, faces, uvs and optionally additional per-vertex attributes (e.g., tangents, bitangents and normals). This is due to a limitation in the trimesh.Trimesh class, namely...
smerzbach/pysmtb
pysmtb/rendering.py
rendering.py
py
37,384
python
en
code
3
github-code
18
[ { "api_name": "trimesh.Scene", "line_number": 51, "usage_type": "name" }, { "api_name": "types.NoneType", "line_number": 51, "usage_type": "name" }, { "api_name": "trimesh.Trimesh", "line_number": 52, "usage_type": "name" }, { "api_name": "types.NoneType", "li...
36444701308
from django.shortcuts import render from django.conf import settings from django.contrib.auth.decorators import login_required # import models from apps.core.models.message_block import MessageBlock from apps.core.models.todo_action_status import TodoActionStatus from apps.core.models.todo import Todo from apps.core.m...
phonehtetpaing/ebdjango
apps/core/views/vendor_contactchat/analytics.py
analytics.py
py
12,291
python
en
code
0
github-code
18
[ { "api_name": "django.conf.settings.BASE_DIR", "line_number": 29, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 29, "usage_type": "name" }, { "api_name": "apps.core.models.summary_log_end_users.SummaryLogEndUsers.objects.raw", "line_number"...
14116434492
""" http://docs.aws.amazon.com/amazondynamodb/latest/gettingstartedguide/GettingStarted.Python.03.html """ from __future__ import print_function # Python 2/3 compatibility import boto3 import json import decimal # Helper class to convert a DynamoDB item to JSON. class DecimalEncoder(json.JSONEncoder): def defaul...
SungardAS/porper-core
tests/sample_codes_for_dynamodb.py
sample_codes_for_dynamodb.py
py
2,683
python
en
code
0
github-code
18
[ { "api_name": "json.JSONEncoder", "line_number": 12, "usage_type": "attribute" }, { "api_name": "decimal.Decimal", "line_number": 14, "usage_type": "attribute" }, { "api_name": "boto3.resource", "line_number": 22, "usage_type": "call" }, { "api_name": "json.dumps"...
41911427082
from utils import read_file values = read_file(8, str, False) grid = [] for current_tree_height in values: grid.append(list(current_tree_height)) visible = 0 def get_column(matrix, i): return [_row[i] for _row in matrix] for row in range(len(grid)): for column in range(len(grid[row])): # Ign...
TheAmazingHazza/Advent-Of-Code-2022
src/Day_8.py
Day_8.py
py
2,575
python
en
code
1
github-code
18
[ { "api_name": "utils.read_file", "line_number": 3, "usage_type": "call" } ]
32382419406
import os import sys import traceback import pdb import re import numpy as np import pandas as pd from math import log from collections import Counter from functools import reduce from operator import add from multiprocessing import Pool # directory name: {dataset}_{search-l}_{type}_{# of the shard} # usage "python an...
hjchoi-camelab/guitar
parser/anns_jh_breakdown-new-parser.py
anns_jh_breakdown-new-parser.py
py
14,834
python
en
code
0
github-code
18
[ { "api_name": "sys.argv", "line_number": 20, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 23, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 24, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number...
69834141801
import glob import json import os import argparse import time import re import pickle # Libs from tqdm import tqdm from xmltodict import unparse import xml.etree.ElementTree as ET import sys import numpy as np import pandas as pd from multiprocessing import Pool import matplotlib # If you get _tkinter.TclError: no d...
embedded-machine-learning/scripts-and-guides
scripts/inference_evaluation/visualize_tf2oda_csv_detections.py
visualize_tf2oda_csv_detections.py
py
9,553
python
en
code
4
github-code
18
[ { "api_name": "matplotlib.use", "line_number": 22, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 48, "usage_type": "call" }, { "api_name": "tensorflow.keras.backend.clear_session", "line_number": 92, "usage_type": "call" }, { "api...
14736616516
from typing import List, Optional from db.database import SessionLocal from db import models import logging class NoTeamException(Exception): pass class TeamRepository: def __init__(self): self.db = SessionLocal() def create_team(self, name: str, country: str, cur_pos_league: str) -> models.Te...
joaquinfontela/FastAPI-Tutorial
src/repositories/team_repository.py
team_repository.py
py
1,964
python
en
code
0
github-code
18
[ { "api_name": "db.database.SessionLocal", "line_number": 14, "usage_type": "call" }, { "api_name": "db.models.Team", "line_number": 17, "usage_type": "call" }, { "api_name": "db.models", "line_number": 17, "usage_type": "name" }, { "api_name": "db.models.Team", ...
26017508186
from datetime import datetime from functools import lru_cache import requests from fastapi import Depends, FastAPI, HTTPException from fastapi.responses import RedirectResponse from pydantic import BaseModel, BaseSettings app = FastAPI(docs_url=None, redoc_url=None) class Labels(BaseModel): alertname: str p...
hadret/forwardly
main.py
main.py
py
1,928
python
en
code
0
github-code
18
[ { "api_name": "fastapi.FastAPI", "line_number": 9, "usage_type": "call" }, { "api_name": "pydantic.BaseModel", "line_number": 12, "usage_type": "name" }, { "api_name": "pydantic.BaseModel", "line_number": 18, "usage_type": "name" }, { "api_name": "pydantic.BaseMod...
27798855781
#!/bin/env python3 import itertools def invalid_preamble_number(numbers, preamble): for p in range(preamble, len(numbers)): if not any(a + b == numbers[p] for a, b in itertools.combinations(numbers[p - preamble:p], 2)): yield numbers[p] def contiguous_set_code(numbers, total): num_set = ...
bbglab/adventofcode
2020/jordi/day9/part1and2.py
part1and2.py
py
868
python
en
code
0
github-code
18
[ { "api_name": "itertools.combinations", "line_number": 7, "usage_type": "call" } ]
20076121327
from django.urls import path from .views import home, send_invitation, accept_invitation, reject_invitation from django.contrib.auth.views import LoginView, LogoutView urlpatterns = [ path('', home, name = 'player_home'), path('login/', LoginView.as_view(template_name='player/login_form.html'), name='player_lo...
shubhamjain238/tic-tac-toe
tic_tac_toe/player/urls.py
urls.py
py
620
python
en
code
0
github-code
18
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "views.home", "line_number": 6, "usage_type": "argument" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.contrib.auth.vie...
35090246128
from mrjob.job import MRJob from mrjob.step import MRStep import re WORD_RE = re.compile(r"[\w]+") # clean reference frame input, save it to a list f = open('myframe.txt', 'r') x = f.readlines() f.close() total = [] for i in range(len(x)): temp = x[i].split(',') for t in temp: t = t.strip() t = t.strip('\n') t...
Fangfangwan/SSSP
collocation.py
collocation.py
py
2,224
python
en
code
0
github-code
18
[ { "api_name": "re.compile", "line_number": 4, "usage_type": "call" }, { "api_name": "mrjob.job.MRJob", "line_number": 20, "usage_type": "name" }, { "api_name": "mrjob.step.MRStep", "line_number": 77, "usage_type": "call" }, { "api_name": "mrjob.step.MRStep", "...
10447648305
from matplotlib.collections import PolyCollection from matplotlib import cm import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import nanopores.geometries.pughpore as pughpore import nanopores from scipy.interpolate import LinearNDInterpolator import numpy as np from nanopores.tools import fields ...
mitschabaude/nanopores
scripts/pughpore/bary_interp.py
bary_interp.py
py
1,827
python
en
code
7
github-code
18
[ { "api_name": "mirror.xf", "line_number": 12, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 12, "usage_type": "call" }, { "api_name": "scipy.interpolate.LinearNDInterpolator", "line_number": 13, "usage_type": "call" }, { "api_name": "mirror.x...
21124930732
from django.urls import path from .views import add_contact, contacts_list, edit_contact, delete_contact urlpatterns = [ path('add/', add_contact, name='add_contact'), path('edit/<int:id>/', edit_contact, name='edit_contact'), path('delete/<int:id>/', delete_contact, name='delete_contact'), path('', c...
Reverlight/address-book
address_book/urls.py
urls.py
py
359
python
en
code
0
github-code
18
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "views.add_contact", "line_number": 6, "usage_type": "argument" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "views.edit_conta...
7620076423
from django.urls import path, include from rest_framework.routers import DefaultRouter from .views import ChurroViewSet, submit_survey, submit_career, submit_contact, submit_order, home, submit_booking router = DefaultRouter() router.register(r'churros', ChurroViewSet) urlpatterns = [ path('', include(router.url...
ayesiloz1/Maestro_churro_Backend
churro_app/urls.py
urls.py
py
742
python
en
code
0
github-code
18
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 6, "usage_type": "call" }, { "api_name": "views.ChurroViewSet", "line_number": 7, "usage_type": "argument" }, { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" }, { "api_n...
22493882661
import os from nose.tools import assert_equal, with_setup from mod import f def f_setup(): files = os.listdir('.') if 'no.txt' in files: os.remove('no.txt') if 'yes.txt' in files: os.remove('yes.txt') def f_teardown(): files = os.listdir('.') if 'yes.txt' in files: os.rem...
jieyanzhu/codes-effective-computation-in-physics
chap_18/test_f.py
test_f.py
py
522
python
en
code
1
github-code
18
[ { "api_name": "os.listdir", "line_number": 8, "usage_type": "call" }, { "api_name": "os.remove", "line_number": 10, "usage_type": "call" }, { "api_name": "os.remove", "line_number": 12, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 15, ...
3272762041
import jax.numpy as jnp import jax from jax import device_put from jax import numpy as np from bench.core.executer import Executer def box_area(boxes): return (boxes[:, 2] - boxes[:, 0]) * (boxes[:, 3] - boxes[:, 1]) def box_iou(boxes1, boxes2): area1 = box_area(boxes1) area2 = box_area(boxes2) l...
DeepLink-org/DLOP-Bench
bench/samples/long_tail/generalized_box_iou/jax_impl.py
jax_impl.py
py
1,511
python
en
code
38
github-code
18
[ { "api_name": "jax.numpy.maximum", "line_number": 18, "usage_type": "call" }, { "api_name": "jax.numpy", "line_number": 18, "usage_type": "name" }, { "api_name": "jax.numpy.minimum", "line_number": 19, "usage_type": "call" }, { "api_name": "jax.numpy", "line_n...
9771955203
import numpy as np import matplotlib.pyplot as plt import pickle # import required libraries from scipy.stats import norm import numpy as np import matplotlib.pyplot as plt import seaborn as sb # https://www.askpython.com/python/normal-distribution # creating the dataset # data = {'C':20, 'C++':15, 'Java':30, # ...
iii2022/csbert
retrofit/code/distribution.py
distribution.py
py
1,605
python
en
code
0
github-code
18
[ { "api_name": "pickle.load", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.float", "line_number": 25, "usage_type": "attribute" }, { "api_name": "numpy.mean", "line_numbe...
23102936152
import os import speech_recognition as sr def transcribe_audio(audio_file): recognizer = sr.Recognizer() with sr.AudioFile(audio_file) as source: audio = recognizer.record(source) try: transcript = recognizer.recognize_google(audio, language="es-ES") return transcript ...
MateoPissarello/pythonSpeechRecognition
transcript.py
transcript.py
py
1,080
python
en
code
0
github-code
18
[ { "api_name": "speech_recognition.Recognizer", "line_number": 5, "usage_type": "call" }, { "api_name": "speech_recognition.AudioFile", "line_number": 7, "usage_type": "call" }, { "api_name": "speech_recognition.UnknownValueError", "line_number": 13, "usage_type": "attribu...
19775675231
from __future__ import (absolute_import, division, print_function, unicode_literals, ) from future.builtins import range import numpy as np import tt from tt.optimize import tt_min import copy import scipy import ttrecipes as tr def search_subspace(t, Xs, Ys, tsq=None, tmin=None, tmax=None, ...
visangela/SenVis
server/core/analysis.py
analysis.py
py
41,230
python
en
code
1
github-code
18
[ { "api_name": "numpy.all", "line_number": 39, "usage_type": "call" }, { "api_name": "numpy.all", "line_number": 41, "usage_type": "call" }, { "api_name": "numpy.all", "line_number": 42, "usage_type": "call" }, { "api_name": "numpy.all", "line_number": 44, ...
12226426951
import sys from collections import deque sys.setrecursionlimit(100000) def SNS(n_nodes, myInput, a, b): ''' 엘리스친구의 친구관계가 myInput으로 주어지고, 사용자 a, b가 주어질 때 둘 사이의 촌수를 반환합니다. ''' if a == b : return 0 graph = [[] for i in range(n_nodes)] m_edges = len(myInput) for line in myInput: ...
zinseo964/Algorithm
0519/sns.py
sns.py
py
1,224
python
ko
code
0
github-code
18
[ { "api_name": "sys.setrecursionlimit", "line_number": 3, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 18, "usage_type": "call" } ]
29110787529
# Gabriella Miles, Farscope PhD Student, Bristol Robotics Laboratory # Date created: 13th July 2020 import tensorflow.keras as keras import tensorflow as tf from keras.models import Model from keras.layers import Dense, Input, Flatten, Dropout, LSTM from datetime import datetime class Classifier: def __init__(self, ...
gabriellamiles/DL_Toolbox
models/r_lstm.py
r_lstm.py
py
1,809
python
en
code
1
github-code
18
[ { "api_name": "keras.layers.Input", "line_number": 23, "usage_type": "call" }, { "api_name": "keras.layers.LSTM", "line_number": 25, "usage_type": "call" }, { "api_name": "keras.layers.LSTM", "line_number": 26, "usage_type": "call" }, { "api_name": "keras.layers.L...
6220544647
import json import time from datamanage.pro import exceptions as dm_pro_errors from datamanage.pro.dataquality.mixins.base_mixins import BaseMixin from datamanage.pro.dataquality.models.audit import ( DataQualityAuditFunction, DataQualityAuditRule, DataQualityAuditRuleEvent, DataQualityAuditRuleTemplat...
Tencent/bk-base
src/api/datamanage/pro/dataquality/rule_views.py
rule_views.py
py
42,258
python
en
code
85
github-code
18
[ { "api_name": "datamanage.pro.dataquality.mixins.base_mixins.BaseMixin", "line_number": 36, "usage_type": "name" }, { "api_name": "common.views.APIViewSet", "line_number": 36, "usage_type": "name" }, { "api_name": "common.local.get_request_username", "line_number": 134, "...
7440898209
import matplotlib.pyplot as plt import numpy as np from numpy import pi, cos, sin with open("water_data.txt") as f: lines = f.readlines() E = [] A = [] for line in lines: vals = line.split("\t") E.append(float(vals[0])) A.append(float(vals[1])) Ener...
Vibi31/FYS4711-Dosimetri
photons.py
photons.py
py
2,045
python
en
code
0
github-code
18
[ { "api_name": "numpy.array", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.title", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 19, "usage_type": "name" }, { "api_name": "matplotlib.pypl...
14950006221
# A part of NonVisual Desktop Access (NVDA) # Copyright (C) 2008-2021 NV Access Limited, James Teh, Michael Curran, Leonard de Ruijter, Reef Turner, # Julien Cochuyt # This file may be used under the terms of the GNU General Public License, version 2 or later. # For more details see: https://www.gnu.org/licenses/gp...
nvaccess/nvda
source/appModules/nvda.py
nvda.py
py
9,160
python
en
code
1,802
github-code
18
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 24, "usage_type": "attribute" }, { "api_name": "NVDAObjects.IAccessible.IAccessible", "line_number": 30, "usage_type": "name" }, { "api_name": "api.getForegroundObject", "line_number": 40, "usage_type": "call" }, { ...
16682021897
### 051920 -- trying to learn a simple dimensionality reduction ### of neural activity that keeps diff trials close and diff stimuli separate ### limited to linear methods for now, but should look into nonlinear import numpy as np from sklearn.linear_model import LogisticRegression from metric_learn import MLKR from ...
preacherwhite/Hal-sharedcore-Tang-data
analysis/scripts/metric_learning.py
metric_learning.py
py
3,100
python
en
code
0
github-code
18
[ { "api_name": "analysis.data_utils.get_imcal_data", "line_number": 12, "usage_type": "call" }, { "api_name": "analysis.data_utils.spike_counts", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.concatenate", "line_number": 22, "usage_type": "call" }, { ...
37962377790
import matplotlib.pyplot as plt import numpy as np from sklearn import svm f=open('./CSR1.DAT') trainscale=300 data=[] flag=0 for line in f.readlines(): str = line.strip().split("\t") tmp = [] if str[0]=='1': flag=1 if line=='\n': flag=0 if flag==1: for i in range(1, len(str...
Yuuki-Yoda/SVR
main.py
main.py
py
1,638
python
en
code
1
github-code
18
[ { "api_name": "numpy.array", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number":...
33457905708
import pandas as pd import os import geohash path = "./taxi_test" #文件夹目录 def to_split_txt_line(str_list): _vehicle_id = int(str_list[0]) _report_time = str_list[1] _latitude = float(str_list[2]) _longitude = float(str_list[3][:-1]) return _vehicle_id, _report_time, _latitude, _longitude def ge...
forbighouse/llbc
paper2/utility_ex.py
utility_ex.py
py
1,082
python
en
code
0
github-code
18
[ { "api_name": "os.walk", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 2...
21066912891
import datetime, time, os, pyautogui, playsound from PIL import ImageGrab from functools import partial ImageGrab.grab = partial(ImageGrab.grab, all_screens=True) def min(x, y): x *= 60 return (x + y) updating_Animation = [ '[. ] ', '[.. ] ', '[...] ' ] started = False updating_Fram...
LouisRadek/Pythonbot_Homeschooling
main.py
main.py
py
11,396
python
en
code
2
github-code
18
[ { "api_name": "PIL.ImageGrab.grab", "line_number": 5, "usage_type": "attribute" }, { "api_name": "PIL.ImageGrab", "line_number": 5, "usage_type": "name" }, { "api_name": "functools.partial", "line_number": 5, "usage_type": "call" }, { "api_name": "datetime.date.to...
9597624373
#!/usr/bin/env python import torch import torch.nn as nn from torch.utils.data import DataLoader from model import VAE from dataset import ChordDataset dataset = ChordDataset("../bundle.txt") loader = DataLoader(dataset, batch_size=4, shuffle=False, collate_fn=lambda x: x) vae = VAE(len(dataset.alphabet), 16, 16) ...
tobybell/chords
vae/test.py
test.py
py
713
python
en
code
0
github-code
18
[ { "api_name": "dataset.ChordDataset", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.utils.data.DataLoader", "line_number": 12, "usage_type": "call" }, { "api_name": "model.VAE", "line_number": 14, "usage_type": "call" }, { "api_name": "dataset.al...
25217077172
# https://leetcode.com/problems/remove-linked-list-elements/ # tags: #linked_list # # Solution: # Time complexity: O(n), Space complexity O(1) from typing import Optional class ListNode: def __init__(self, val=0, next=None): self.val = val self.next = next def __str__(self): return s...
ronelzb/leetcode
linked_list/0203_remove_linked_list_elements.py
0203_remove_linked_list_elements.py
py
1,240
python
en
code
0
github-code
18
[ { "api_name": "typing.Optional", "line_number": 19, "usage_type": "name" } ]
46855953644
x=0 while x <= 5: print(x) x = x + 1 counties = ["Arapahoe","Denver","Jefferson"] for county in counties: print(county) for i in range(len(counties)): print(counties[i]) counties_dict = {"Arapahoe": 422829, "Denver": 463353, "Jefferson":432438} for county in counties_dict.keys(): print(county) ...
zoomdmartin02/Election-Analysis
module_files/loops.py
loops.py
py
2,499
python
en
code
0
github-code
18
[ { "api_name": "datetime.datetime.now", "line_number": 69, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 69, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 76, "usage_type": "call" }, { "api_name": "da...
26261493799
#!/usr/bin/env python # -*- coding: utf-8 -*- import os from importlib.machinery import SourceFileLoader try: import cleep except: class cleep: __file__ = None def get_core_version_from_sources(repo_dir): try: cleep_sources = SourceFileLoader("cleep_sources", os.path.join(repo_dir, 'cleep'...
CleepDevice/cleep-cli
cleepcli/config.py
config.py
py
1,758
python
en
code
0
github-code
18
[ { "api_name": "importlib.machinery.SourceFileLoader", "line_number": 14, "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.env...
12185194630
########################################################## # Author : Hwx # # Date : 2016-9-30 # # Purpose: KaKs ratio calculation, statistic and figure # ########################################################## # import package import ...
stonepy/icystone
server6/KaKs.py
KaKs.py
py
8,091
python
en
code
1
github-code
18
[ { "api_name": "matplotlib.use", "line_number": 10, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 23, "usage_type": "call" }, { "api_name": "pandas.read_table", "line_number": 30, "usage_type": "call" }, { "api_name": "pandas.read_csv", "lin...
26526227535
import dataclasses import functools from jax_privacy.experiments.image_data import base from jax_privacy.experiments.image_data import loader import tensorflow as tf import tensorflow_datasets as tfds MEAN_RGB = (0.49139968, 0.48215841, 0.44653091) STDDEV_RGB = (0.24703223, 0.24348513, 0.26158784) @dataclasses.dat...
deepmind/jax_privacy
jax_privacy/experiments/image_data/mnist_cifar_svhn.py
mnist_cifar_svhn.py
py
5,561
python
en
code
72
github-code
18
[ { "api_name": "jax_privacy.experiments.image_data.base.ImageDatasetConfig", "line_number": 15, "usage_type": "attribute" }, { "api_name": "jax_privacy.experiments.image_data.base", "line_number": 15, "usage_type": "name" }, { "api_name": "tensorflow.Tensor", "line_number": 35...
73118406441
from splinter import Browser from bs4 import BeautifulSoup as bs import pandas as pd from webdriver_manager.chrome import ChromeDriverManager def init_browser(): #NB: Replace path with local path to ChromeDriver executable_path = {'executable_path': ChromeDriverManager().install()} return Browser('chrome',...
jasperthegeo/Webscrape_challenge
non-jupiter_scrape_mars.py
non-jupiter_scrape_mars.py
py
2,457
python
en
code
0
github-code
18
[ { "api_name": "webdriver_manager.chrome.ChromeDriverManager", "line_number": 8, "usage_type": "call" }, { "api_name": "splinter.Browser", "line_number": 9, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 17, "usage_type": "call" }, { "api...
24468458164
# define seperotr def seperator(): print() print("<=======================================================================================================================>") ## If you want to scrape a Website ## # 1. Use The Official API of The Website Owner # 2. HTML Web Scraping using Some Tools Like...
PraddyumnYadav/Web_Scraping_With_Python
main.py
main.py
py
2,899
python
en
code
1
github-code
18
[ { "api_name": "requests.get", "line_number": 32, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 33, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 38, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "...
16476543650
import time import numpy as np import matplotlib.pyplot as plt def arrow(): fig = plt.figure() ax = fig.add_subplot(111) point = { 'start': [10, 10], 'end': [90, 90], "v1": [20, 20], "v2": [30, 30], "v3": [40, 40], } ax.plot(*point['start'], 'o', color="re...
yuto-moriizumi/sotuken
plot2.py
plot2.py
py
1,702
python
en
code
0
github-code
18
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 7, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.show", "line_number": 30, "usage_type": "call" }, { "api_name": "matpl...
6392715333
# non local imports ^_^ # if your reading this use auto-py-to-exe to convert this to an .exe file from colorama import Fore, Back, Style import asyncio import time import sys import socket import requests x = 0 responses = [] async def get_isp_from_api(ip): url = f"http://ip-api.com/json/{ip}" r...
KuroSys/Ponger
pong.py
pong.py
py
2,117
python
en
code
4
github-code
18
[ { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "socket.socket", "line_number": 27, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 27, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREAM", ...
20777033203
import flask from flask import render_template, jsonify import os import random import linecache app = flask.Flask(__name__) app.config["DEBUG"] = True DATA_FILE = "data.txt" randfile = open(DATA_FILE, "w") nums = 4096 for i in range(nums): line = str(random.uniform(-4096, 4096)) + "\n" randfile.write(line) ...
datamadness81/pythonapp
api.py
api.py
py
4,249
python
es
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "random.uniform", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path.exists", ...
26965550196
import re import numpy as np import string import nltk from nltk.tokenize import word_tokenize from nltk.corpus import stopwords from nltk.stem import WordNetLemmatizer from nltk.stem import PorterStemmer from bs4 import BeautifulSoup as bs def get_stem_tokens(text): text = text.lower() text = re.sub(r'[-+]?...
Subangkar/Machine-Learning-CSE-472-BUET
Assignment-2/TextClassification/utils.py
utils.py
py
1,697
python
en
code
1
github-code
18
[ { "api_name": "re.sub", "line_number": 15, "usage_type": "call" }, { "api_name": "string.punctuation", "line_number": 16, "usage_type": "attribute" }, { "api_name": "nltk.tokenize.word_tokenize", "line_number": 17, "usage_type": "call" }, { "api_name": "nltk.corpu...
5529284679
import random import matplotlib.pyplot as plt def monty_hall(ndoors, kopen, switch=True, show_selections=False): assert(ndoors - kopen > 0 and kopen >= 0) if ndoors-kopen == 1: return True """ Randomly choose a door between 1 and ndoors """ door_chose = random.randint(1, ndoors) """ Randomly choose ...
USharma002/MontyHallSimulation
main.py
main.py
py
2,094
python
en
code
0
github-code
18
[ { "api_name": "random.randint", "line_number": 10, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 14, "usage_type": "call" }, { "api_name": "random.sample", "line_number": 22, "usage_type": "call" }, { "api_name": "random.choice", "line...
3860908926
# -*- codeing = utf-8 -*- # @Time : 2021/6/4 18:35 # @Autor : Soutubot # @File : pdfg-bot.py # @Software : PyCharm # 匯入相關套件 from PIL import Image import re import requests import base64 import time import datetime from urllib import parse from bs4 import BeautifulSoup import telebot import os import urllib.parse import...
soutubot/pdfg
pdfg-bot.py
pdfg-bot.py
py
7,398
python
en
code
2
github-code
18
[ { "api_name": "requests.session", "line_number": 21, "usage_type": "call" }, { "api_name": "telebot.TeleBot", "line_number": 25, "usage_type": "call" }, { "api_name": "time.time", "line_number": 67, "usage_type": "call" }, { "api_name": "os.listdir", "line_num...
29667840805
import torch import torch.nn as nn import torch.optim as optim from torch.optim import lr_scheduler import torchvision from torchvision import datasets, models as tv_models from torch.utils.data import DataLoader from torchsummary import summary import numpy as np from scipy import io import threading import pickle fro...
msandipan/MasterProject
source_code/patch_classifiers/train.py
train.py
py
53,737
python
en
code
0
github-code
18
[ { "api_name": "torch.backends", "line_number": 33, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 37, "usage_type": "attribute" }, { "api_name": "wandb.init", "line_number": 40, "usage_type": "call" }, { "api_name": "sys.argv", "line_num...
10542104971
import dash import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output, Event, State from flask import Flask import flask import webbrowser import os import pdb #------------------------------------------------------------------------------------------------------...
paul-shannon/ijaliframedisplaywithsound
simpleWithButtonAndIFrame.py
simpleWithButtonAndIFrame.py
py
2,525
python
en
code
0
github-code
18
[ { "api_name": "dash.Dash", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_numbe...
3580993003
# -*- coding: utf8 -*- """Base model.""" import os import datetime from flask import url_for, current_app from sqlalchemy.ext.declarative import declared_attr from sqlalchemy.ext.hybrid import hybrid_property from sqlalchemy.dialects.postgresql import JSONB from sqlalchemy import Integer, Text, Unicode, Boolean from s...
alexandermendes/explicates
explicates/model/base.py
base.py
py
2,653
python
en
code
7
github-code
18
[ { "api_name": "sqlalchemy.schema.Column", "line_number": 21, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer", "line_number": 21, "usage_type": "argument" }, { "api_name": "sqlalchemy.schema.Column", "line_number": 24, "usage_type": "call" }, { "api_name...
6233123087
from apps.api.modules.utils import add_esb_info_before_request from ..base import BaseApi, DataAPI, DataAPISet, ProxyDataAPI class _GseApi(DataAPISet): MODULE = "GSE" def __init__(self): from config.domains import GSE_APIGATEWAY_ROOT_V2 self.get_agent_status = DataAPI( method="...
Tencent/bk-base
src/dataweb/app/apps/api/modules/gse.py
gse.py
py
911
python
en
code
85
github-code
18
[ { "api_name": "base.DataAPISet", "line_number": 6, "usage_type": "name" }, { "api_name": "base.DataAPI", "line_number": 13, "usage_type": "call" }, { "api_name": "config.domains.GSE_APIGATEWAY_ROOT_V2", "line_number": 15, "usage_type": "name" }, { "api_name": "app...
25744031956
# USAGE # python detect_faces_video.py --prototxt deploy.prototxt.txt --model res10_300x300_ssd_iter_140000.caffemodel # import the necessary packages from imutils.video import VideoStream import numpy as np import argparse import imutils import time import socket import cv2 import struct import sys try: # construct...
JokeOfAllTrades/Face-Filter
Assets/Face Detection/facedetector.py
facedetector.py
py
3,767
python
en
code
1
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.dnn.readNetFromCaffe", "line_number": 27, "usage_type": "call" }, { "api_name": "cv2.dnn", "line_number": 27, "usage_type": "attribute" }, { "api_name": "socket....
8337222355
import json import time from kafka import KafkaProducer from flask import Flask, jsonify, request ORDER_KAFKA_TOPIC = 'order_details' KAFKA_SERVER_ADDRESS = 'localhost:9092' # KAFKA_SERVER_ADDRESS = '47.93.191.241:29093` app = Flask(__name__) ## from inside docker compose network - when add the service to compose ...
sparsh-ai/recohut
docs/03-processing/project-kafka-ikea/orders_backend.py
orders_backend.py
py
1,257
python
en
code
91
github-code
18
[ { "api_name": "flask.Flask", "line_number": 12, "usage_type": "call" }, { "api_name": "kafka.KafkaProducer", "line_number": 15, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 16, "usage_type": "call" }, { "api_name": "flask.request.json", "...
9525107354
""" OU.py """ __author__ = "giorgio@ac.upc.edu" __credits__ = ["https://github.com/yanpanlau", "https://gist.github.com/jimfleming/9a62b2f7ed047ff78e95b5398e955b9e"] import numpy as np from scipy.stats import norm # https://blog.csdn.net/u013745804/article/details/78461253 # 上周在实现DDPG的过程中,发现其中用到了一个没见过的随机过程,叫做Ornstei...
softmicro929/a-deep-rl-approach-for-sdn-routing-optimization
OU.py
OU.py
py
1,643
python
zh
code
15
github-code
18
[ { "api_name": "numpy.ones", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 35, "usage_type": "call" }, { "api_name": "scipy.stats.norm.rvs", "line_number": 39, "usage_type": "call" }, { "api_name": "scipy.stats.norm", "li...
9775290874
from base import app, db from placedb import Place from flask import render_template, request @app.route("/personadd", methods=['POST']) def personadd(): navn = request.form["navn"] stoy = request.form["stoy"] vurdering = request.form["vurdering"] ledighet = request.form["ledighet"] lokasjon = requ...
HeddaSkaare/studieplassen
backend/routes.py
routes.py
py
494
python
no
code
0
github-code
18
[ { "api_name": "flask.request.form", "line_number": 7, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 7, "usage_type": "name" }, { "api_name": "flask.request.form", "line_number": 8, "usage_type": "attribute" }, { "api_name": "flask.requ...
1660739097
# -*- coding: utf-8 -*- from PyQt5.QtCore import (QObject, pyqtSignal, pyqtSlot) import numpy as np import cv2 import logging logging.basicConfig() logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) class QVideoWriter(QObject): frameNumber = pyqtSignal(int) finished = pyqtSignal() def...
mcmorre/QVideo
QVideo/dvr/QVideoWriter.py
QVideoWriter.py
py
2,047
python
en
code
null
github-code
18
[ { "api_name": "logging.basicConfig", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 10, "usage_type": "attribute" }, { "api_name": "PyQt5.QtCore.Q...
21589402274
import random from paddle.vision.transforms import functional as F # from paddle.vision.transforms import RandomCrop import numpy as np import cv2 def horizontal_flip(im): if len(im.shape) == 3: im = im[:, ::-1, :] elif len(im.shape) == 2: im = im[:, ::-1] return im class Compose: ...
Foldit/Netdisk-Image-Demoireing-Rank7th
demoire-baseline/transforms.py
transforms.py
py
5,317
python
en
code
9
github-code
18
[ { "api_name": "cv2.imread", "line_number": 29, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 31, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 35, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2RGB", "line_numb...