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
3143871769
import matplotlib.pyplot as plt import seaborn as sns import pandas as pd df = pd.read_csv('output_data/result.csv') price = df.loc[:, "price"] dist_from_st = df.loc[:, "dist_from_st"] pop = df.loc[:, "pop"] fire_station_num = df.loc[:, "fire_station_num"] crime_num = df.loc[:, "crime_num"] tabacco_num = df.loc[:, "ta...
dullmode/stat-homework
process1.py
process1.py
py
944
python
en
code
1
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 5, "usage_type": "call" }, { "api_name": "pandas.concat", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 25, "usage_type": "call" }, { "api_name": "matplotlib.pypl...
30361383161
from typing import List, Dict, Any import json from affectivecloud.algorithm import BaseServiceType from affectivecloud.protocols import Services # 基础计算请求 class BaseServiceRequest(object): class _request(object): # 会话服务类型:基础服务 services = Services.Type.BASE_SERVICE # 初始化基础计算 class Init(...
Entertech/Enter-AffectiveCloud-PC-SDK
affectivecloud/protocols/requests/base_service.py
base_service.py
py
4,497
python
en
code
0
github-code
6
[ { "api_name": "affectivecloud.protocols.Services.Type", "line_number": 14, "usage_type": "attribute" }, { "api_name": "affectivecloud.protocols.Services", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 19, "usage_type": "name" }, ...
7542043217
#!/usr/bin/env python3 from jira.client import JIRA import logging import re import sys import random import datetime from termcolor import colored, cprint import time import traceback from functools import lru_cache import json import requests from diskcache import Cache import urllib3 import codecs import string imp...
AKudlaienko/CLI
jira_cli/jira_cli_custom.py
jira_cli_custom.py
py
66,851
python
en
code
0
github-code
6
[ { "api_name": "os.environ", "line_number": 33, "usage_type": "attribute" }, { "api_name": "diskcache.Cache", "line_number": 46, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 49, "usage_type": "call" }, { "api_name": "datetime.dateti...
3380661710
import os import datetime import logging # Create a custom logger logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') with open(f"{os.getcwd()}/logger_filename_var") as file: log_filename = file.read() file_h...
RodriguesJD/jamf_api_client
core/write_jamf_to_json_file/write_to_json_tools.py
write_to_json_tools.py
py
1,553
python
en
code
1
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 7, "usage_type": "attribute" }, { "api_name": "logging.Formatter", "line_number": 9, "usage_type": "call" }, { "api_name": "os.getcwd", "...
26040815446
from __future__ import annotations import logging import re from dataclasses import dataclass from enum import Enum from typing import Any, Iterable from pants.base.exiter import PANTS_FAILED_EXIT_CODE, PANTS_SUCCEEDED_EXIT_CODE from pants.core.goals.lint import LintFilesRequest, LintResult, Partitions from pants.eng...
pantsbuild/pants
src/python/pants/backend/project_info/regex_lint.py
regex_lint.py
py
12,446
python
en
code
2,896
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 20, "usage_type": "call" }, { "api_name": "enum.Enum", "line_number": 23, "usage_type": "name" }, { "api_name": "dataclasses.dataclass", "line_number": 40, "usage_type": "call" }, { "api_name": "dataclasses.datacla...
8463177347
from whoosh.index import open_dir from whoosh.qparser import QueryParser # read in the index we created ix = open_dir('index') # collect and parse the query query = input('Enter query: ') parser = QueryParser('lyrics', ix.schema) query = parser.parse(query) # search the index and return the results with ix.searcher(...
Garydmg/lyricssearch
main.py
main.py
py
526
python
en
code
null
github-code
6
[ { "api_name": "whoosh.index.open_dir", "line_number": 5, "usage_type": "call" }, { "api_name": "whoosh.qparser.QueryParser", "line_number": 9, "usage_type": "call" } ]
38798121731
# -*- coding: utf-8 -*- import urllib from bs4 import BeautifulSoup import time import locale import json import pycountry ## Country code ## countries = {} for country in pycountry.countries: countries[country.name] = country.alpha_2 ## Setup a set of replacements for unmatched country names ## REPLACEMENTS =...
minsu-park/CIA_WorldFactbook
parse_CIA_worldfact.py
parse_CIA_worldfact.py
py
3,628
python
en
code
1
github-code
6
[ { "api_name": "pycountry.countries", "line_number": 13, "usage_type": "attribute" }, { "api_name": "urllib.urlopen", "line_number": 49, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 51, "usage_type": "call" }, { "api_name": "locale.setl...
4376897870
import re import os import sys from pyquery import PyQuery as pq from lxml import etree from dictmaster.util import words_to_db from dictmaster.replacer import * from dictmaster.plugin import BasePlugin from dictmaster.stages.fetcher import Fetcher from dictmaster.stages.processor import HtmlContainerProcessor DICTN...
tuxor1337/dictmaster
dictmaster/plugins/dwds-panel.py
dwds-panel.py
py
6,317
python
en
code
32
github-code
6
[ { "api_name": "dictmaster.plugin.BasePlugin", "line_number": 25, "usage_type": "name" }, { "api_name": "sys.exit", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path", "l...
2746655652
import chess from itertools import chain, combinations PIECES = (W_PAWN, W_KNIGHT, W_BISHOP, W_ROOK, W_QUEEN, W_KING, B_PAWN, B_KNIGHT, B_BISHOP, B_ROOK, B_QUEEN, B_KING) = list(chain(range(1, 7), range(9, 15)...
Sirikorn-praew/module8-9
consts.py
consts.py
py
337
python
en
code
0
github-code
6
[ { "api_name": "itertools.chain", "line_number": 15, "usage_type": "call" } ]
28819709194
from pymongo import MongoClient import os # from crud import Operations class DatabaseConnection(): def main(self): client = MongoClient(os.getenv('MONGO_URI')) print(client) db = client.omnius return db def RawModel(self): db = DatabaseConnection().main() curs...
omnius45467/gilgamesh
project/lib/database/databaseconnection.py
databaseconnection.py
py
422
python
en
code
0
github-code
6
[ { "api_name": "pymongo.MongoClient", "line_number": 8, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 8, "usage_type": "call" } ]
73411461628
from selenium import webdriver from selenium_stealth import stealth import time options = webdriver.ChromeOptions() options.add_argument("start-maximized") # options.add_argument("--headless") #options.add_argument("--disable-blink-features") options.add_argument("--disable-blink-features=AutomationControlled") opti...
brunocardone/web_scraping_IDFB
Documents/WebScraping/FacebookScrape/Playground.py
Playground.py
py
944
python
en
code
0
github-code
6
[ { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 5, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 5, "usage_type": "name" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 15, "usage_type": "call" }, { "api_n...
17918739855
# coding: utf-8 # # Лабораторная №3 # Вначале импортируем нужные вещи: # In[1]: from __future__ import print_function import numpy numpy.random.seed(1337) # for reproducibility from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation, Flatten from keras.layers.convolutional im...
aakogtenkov/Ask-me-if-you-can
labs/Lab3.py
Lab3.py
py
11,152
python
en
code
0
github-code
6
[ { "api_name": "numpy.random.seed", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 12, "usage_type": "attribute" }, { "api_name": "numpy.load", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.zeros", "lin...
31299472242
from django.test import TestCase, Client from django.urls import reverse import ecomapp.models from mock import patch class TestPriceConvertor(TestCase): def setUp(self): self.category1 = ecomapp.models.Category.objects.create( name = 'category1', slug = 'category-1' ) self.brand1 = ecomapp.models...
hussienalhaj/alhajjj
djangoshop/ecomapp/tests/test_tdd.py
test_tdd.py
py
1,803
python
en
code
0
github-code
6
[ { "api_name": "django.test.TestCase", "line_number": 6, "usage_type": "name" }, { "api_name": "ecomapp.models.models.Category.objects.create", "line_number": 9, "usage_type": "call" }, { "api_name": "ecomapp.models.models", "line_number": 9, "usage_type": "attribute" },...
3916792160
from collections import deque def bfs(start): queue = deque([start]) visited[start] = True cnt = 1 while queue: start = queue.popleft() if str(start) in graph: for i in graph[str(start)]: if visited[i] == False: queue.append(i) ...
jun2mun/code_study
코딩테스트/소프트웨어마에스트로/1325.py
1325.py
py
829
python
en
code
2
github-code
6
[ { "api_name": "collections.deque", "line_number": 3, "usage_type": "call" } ]
9898693151
# -------------------------------- # | Inter-Arrival Times: | # | - Arrivals waiting for | # | weight loss consultation | Nurse # | | GENERATOR ---------------- # | Entities | People a...
nuwagalb/Discrete-Event-Simulation-SimPy
weight_loss_store_results.py
weight_loss_store_results.py
py
3,633
python
en
code
0
github-code
6
[ { "api_name": "random.expovariate", "line_number": 34, "usage_type": "call" }, { "api_name": "random.expovariate", "line_number": 65, "usage_type": "call" }, { "api_name": "simpy.Environment", "line_number": 70, "usage_type": "call" }, { "api_name": "simpy.Resourc...
22682934245
#! /usr/bin/env python3 import numpy as np import os import subprocess from cyvcf2 import VCF import vcf __author__ = 'Josef Moser' class Assignment2: def __init__(self): if not os.path.isfile("AmpliseqExome.20141120.NA24385.vcf"): subprocess.call(["wget", "ftp://ftp-trace.ncbi.nlm.nih.gov/g...
josmos/medizinische_genomanalysen_2017_assignment_2
assignment2.py
assignment2.py
py
2,773
python
en
code
0
github-code
6
[ { "api_name": "os.path.isfile", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "subprocess.call", "line_number": 15, "usage_type": "call" }, { "api_name": "vcf.Reader", "line_nu...
34816956703
import tkinter as tk # Construct GUI for from tkinter import filedialog, messagebox from scipy.misc import imresize # For recieve new photos from keras.preprocessing.image import load_img, img_to_array # Read pics from keras.models import load_model from PIL import Image, ImageTk # Show pics import os os.environ['...
Jerrrrykun/cloud_computing_project
FBP_model/FBP_GUI.py
FBP_GUI.py
py
3,756
python
en
code
3
github-code
6
[ { "api_name": "os.environ", "line_number": 8, "usage_type": "attribute" }, { "api_name": "tkinter.Tk", "line_number": 12, "usage_type": "attribute" }, { "api_name": "tkinter.Label", "line_number": 22, "usage_type": "call" }, { "api_name": "tkinter.Label", "lin...
9372531733
import io import logging.config import os import re import zipfile from environs import Env import pandas as pd import requests logger = logging.getLogger(__file__) def get_product_list(last_id, client_id, seller_token): """Получить список товаров магазина озон""" url = "https://api-seller.ozon.ru/v2/produc...
devmanorg/seller-apis
seller.py
seller.py
py
6,218
python
en
code
0
github-code
6
[ { "api_name": "logging.config.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.config", "line_number": 11, "usage_type": "name" }, { "api_name": "requests.post", "line_number": 28, "usage_type": "call" }, { "api_name": "requests.post",...
2976747492
from collections import Counter from torch import Tensor from typing import Dict import torch def pro(gt: Tensor, prediction: Tensor) -> float: """ calculate the per-region overlap score between two gray scale images. 'the percentage of correctly predicted pixels is computed for each annotated defect reg...
NilsB98/Diffusion-Based-AD
utils/metrics.py
metrics.py
py
5,458
python
en
code
1
github-code
6
[ { "api_name": "torch.Tensor", "line_number": 8, "usage_type": "name" }, { "api_name": "torch.Tensor", "line_number": 23, "usage_type": "name" }, { "api_name": "collections.Counter", "line_number": 24, "usage_type": "call" }, { "api_name": "typing.Dict", "line_...
30366451121
from numpy import asarray, empty, isnan # Enthought library imports. from traits.api import Enum, Event, Instance, Property, Range, Trait # Local relative imports from .abstract_plot_renderer import AbstractPlotRenderer from .base import reverse_map_1d from .grid_data_source import GridDataSource from .grid_mapper im...
enthought/chaco
chaco/base_2d_plot.py
base_2d_plot.py
py
11,592
python
en
code
286
github-code
6
[ { "api_name": "abstract_plot_renderer.AbstractPlotRenderer", "line_number": 15, "usage_type": "name" }, { "api_name": "traits.api.Instance", "line_number": 23, "usage_type": "call" }, { "api_name": "grid_data_source.GridDataSource", "line_number": 23, "usage_type": "argum...
386807309
""" Created on Tue Oct 6 This program found the solution of matrix Ax = B by total gaussian method. Parameters ---------- matrix: AB Returns ------- a: matrix from equations b: constant vector movement : vector with x's positions @author: Daniel Felipe Gomez Martinez """ import numpy as np import json np.set_printop...
jsperezsalazar2001/SADA_ANALYTICS
SADA_ANALYTICS/public/python/total_gaussian_method.py
total_gaussian_method.py
py
3,790
python
en
code
1
github-code
6
[ { "api_name": "numpy.set_printoptions", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.array", "lin...
71476925629
import torch import torch.nn as nn import torch.optim as optim import numpy as np from torch.autograd import Variable from collections import OrderedDict from generator import Generator import classify_svhn as data import matplotlib.pyplot as plt from torchvision.transforms import ToPILImage import os import argpars...
gchafouleas/IFT6135_Assignment3
qualitative_evaluation.py
qualitative_evaluation.py
py
2,708
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_number": 28, "usage_type": "attribute" }, { "api_name": "os.mkdir", "l...
8384333441
from __future__ import print_function from __future__ import absolute_import import os import sys from collections import defaultdict if 'SUMO_HOME' in os.environ: sys.path.append(os.path.join(os.environ['SUMO_HOME'], 'tools')) import sumolib # noqa from sumolib.miscutils import parseTime # noqa def get_option...
ngctnnnn/DRL_Traffic-Signal-Control
sumo-rl/sumo/tools/output/computePassengerCounts.py
computePassengerCounts.py
py
4,645
python
en
code
17
github-code
6
[ { "api_name": "os.environ", "line_number": 7, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_n...
71951823547
import torch import os from sklearn.cluster import KMeans,SpectralClustering from sklearn import cluster from sklearn import metrics import numpy as np from sklearn.neighbors import kneighbors_graph from sklearn.preprocessing import StandardScaler import utils.analyse_utils as analyse_utils import argparse exp_dir ...
xuqiongkai/FingerprintAttack_on_FL
analyse_cluster.py
analyse_cluster.py
py
3,654
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.concatenate", "line_number": 50, "usage_type": "call" }, { "api_name": "torch.load", "line_number": 57, "usage_type": "call" }, { "api_name": "os.path.join", ...
14560212981
""" Fundir PDF,Alarme, Código fonte de site """ # Alarme: from tkinter import * #Responsavel pela criação da interface, importamos todas funções import datetime import time from playsound import playsound #Responsavel pelo sinal sonoro #pip install playsound root = Tk() #Definição do objeto da interface ro...
tiagoc93/Fusao_PDF
fusao_pdf/fundir_pdf_alarme_codigo_site.py
fundir_pdf_alarme_codigo_site.py
py
3,332
python
pt
code
0
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 17, "usage_type": "attribute" }, { "api_name": "time.sleep", "line_number": 18, "usage_type": "call" }, { "api_name": "playsound.pla...
1688872290
# -*- coding: utf-8 -*- """ Created on Sat Jun 4 20:35:25 2022 @author: sinha """ # -*- coding: utf-8 -*- """ Created on Wed Jun 1 23:08:31 2022 @author: sinha """ # -*- coding: utf-8 -*- """ Created on Sun May 22 16:18:42 2022 @author: sinha """ import numpy as np import matplotlib.pyplot...
MegaCharizardZ/Nanomagnetics
pbit_simulation.py
pbit_simulation.py
py
5,353
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.pyplot.rcParams.update", "line_number": 29, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 29, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 29, "usage_type": "name" }, { ...
25873712765
import aiohttp import aiolimiter import asyncio import hmac import hashlib import urllib.parse from datetime import timezone from moonship.core import * from moonship.client.web import * from typing import Union API_BASE_URL = "https://api.binance.com/api/v3" STREAM_BASE_URL = "wss://stream.binance.com:9443/stream" ...
mpaulse/moonship
moonship/client/binance.py
binance.py
py
18,311
python
en
code
3
github-code
6
[ { "api_name": "asyncio.Lock", "line_number": 19, "usage_type": "call" }, { "api_name": "aiolimiter.AsyncLimiter", "line_number": 20, "usage_type": "call" }, { "api_name": "aiolimiter.AsyncLimiter", "line_number": 21, "usage_type": "call" }, { "api_name": "asyncio....
34191620429
#!/usr/bin/env python ############################################################################### # # fundec.py <tree> <database_file> <%id cutoff> # I should probably iclude some reguular expression recognition to make the # counts of each annotation more robust. I imagine that as is this # code will only cluster ...
geronimp/HandyScripts
03_working_with_trees/fundec.py
fundec.py
py
7,805
python
en
code
0
github-code
6
[ { "api_name": "skbio.tree.TreeNode.read", "line_number": 85, "usage_type": "call" }, { "api_name": "skbio.tree.TreeNode", "line_number": 85, "usage_type": "name" }, { "api_name": "collections.Counter", "line_number": 94, "usage_type": "call" }, { "api_name": "logg...
13337008000
import demjson import os import unittest from tests.utils import captured_output from product_deps_graph import parse_options, Product TEST_BASE_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) TEST_DATA_DIR = os.path.join(TEST_BASE_DIR, 'data') class TestParseOptions(unittest.TestCase): def t...
weichen2046/android_vendor_hlhtddx
build/tools/tests/unit/test_product_deps_graph.py
test_product_deps_graph.py
py
2,904
python
en
code
0
github-code
6
[ { "api_name": "os.path.abspath", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.join", "line_nu...
4500909446
from __future__ import annotations # This file is part of ts_watcher. # # Developed for Vera C. Rubin Observatory Telescope and Site Systems. # This product includes software developed by the LSST Project # (https://www.lsst.org). # See the COPYRIGHT file at the top-level directory of this distribution # for details o...
lsst-ts/ts_watcher
python/lsst/ts/watcher/rules/mt_ccw_following_rotator.py
mt_ccw_following_rotator.py
py
2,408
python
en
code
0
github-code
6
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 31, "usage_type": "attribute" }, { "api_name": "lsst.ts.watcher.BaseRule", "line_number": 35, "usage_type": "attribute" }, { "api_name": "lsst.ts.watcher", "line_number": 35, "usage_type": "name" }, { "api_name"...
25911916032
import datetime from Solution import Solution class P019(Solution): def solve(self): self.problem_number = 19 result = 0 first_day = datetime.date(1901,1,1) delta = datetime.timedelta(days=5) first_sunday = first_day + delta delta = datetime.timedelta(days=7) ...
TalaatHarb/project-euler-100
python-project-euler-100/p019.py
p019.py
py
620
python
en
code
2
github-code
6
[ { "api_name": "Solution.Solution", "line_number": 4, "usage_type": "name" }, { "api_name": "datetime.date", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.timedelta", ...
41810332581
from requests import get class WikiRequest: def __init__(self,lat,lng): self.lat = lat self.lng = lng def _get_pageid(self): lat_lng = "|".join([str(self.lat), str(self.lng)]) parameters = { "action": "query", "list": "geosearch", "gscoord":...
KikaDIEN1994/chatbot
papybot/wikirequest.py
wikirequest.py
py
1,288
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 17, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 40, "usage_type": "call" } ]
17242414561
# Websocket server using tornado import tornado import tornado.websocket from fetch_aver import Hunter import logging import json import time from simu_overview import data_magic logging.basicConfig(filename='/home/Chunar/codes/Monitor_pi/motor_factory/overview/overview.log', level=logging.DEBUG) class Ech...
Chunar5354/Monitor_pi
motor_factory/overview/overview_web_server.py
overview_web_server.py
py
1,511
python
en
code
0
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 10, "usage_type": "attribute" }, { "api_name": "tornado.websocket", "line_number": 12, "usage_type": "attribute" }, { "api_name": "time.lo...
36618143046
import os import sys import logging from . import utils class Config(object): def __init__(self, config_dir): """ Class Constructor Initialising a configuration with an empty list of data flows """ self.logger = logging.getLogger("Pipelinewise CLI") self.config_di...
beherap/pipelinewise
pipelinewise/cli/config.py
config.py
py
14,501
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_nu...
3203304672
import requests as r import json as j def GetHeroID(): hero_data = r.get('https://api.opendota.com/api/heroes') hero_id = j.loads(hero_data.text) return hero_id hero_dic = {} heroes = GetHeroID() for hero in heroes: hero_dic[hero['id']] = hero['localized_name'] def GetItemID(): item_data = r...
BenjinZA/BearBot
Cogs/Utils/OD/id.py
id.py
py
999
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 6, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 7, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 20, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 21...
19024281392
from typing import Tuple from typing import Optional from .utils import NoiseCollection from .base import Augmentation from .utils import Noise import pyroomacoustics as pra import numpy as np import threading import collections normalize = lambda wav: wav / (np.sqrt(np.mean(wav ** 2)) + 1e-8) class Reverb(Augmenta...
DanRuta/xva-trainer
lib/_dev/pyannote/audio/augmentation/reverb.py
reverb.py
py
4,876
python
en
code
78
github-code
6
[ { "api_name": "numpy.sqrt", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 12, "usage_type": "call" }, { "api_name": "base.Augmentation", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_numb...
4252980223
from rest_framework import serializers # from category.models import Category from .models import * from category.serializers import CategorySerializer from django.contrib.auth.models import User class UserSerializer(serializers.ModelSerializer): class Meta: model = User fields = ( 'u...
PeaceTem/tothex
core/serializers.py
serializers.py
py
2,243
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 9, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 9, "usage_type": "name" }, { "api_name": "django.contrib.auth.models.User", "line_number": 11, "usage_type...
26248085396
import fixtures from unittest import mock from oslo_concurrency import lockutils from oslo_config import cfg from oslo_config import fixture as config_fixture import oslo_messaging from oslo_messaging import conffixture as messaging_conffixture from oslo_utils import uuidutils import oslotest.base as base_test from de...
sodafoundation/delfin
delfin/test.py
test.py
py
11,546
python
en
code
201
github-code
6
[ { "api_name": "oslo_config.cfg.StrOpt", "line_number": 20, "usage_type": "call" }, { "api_name": "oslo_config.cfg", "line_number": 20, "usage_type": "name" }, { "api_name": "oslo_config.cfg.CONF", "line_number": 25, "usage_type": "attribute" }, { "api_name": "oslo...
43168489415
import logging import os import subprocess from datetime import datetime import discord from discord.ext import commands from roycemorebot import constants log = logging.getLogger("roycemorebot.main") # Change the bot class to log adding/removing cogs: class CogLoggingBot(commands.Bot): """Subclass of `discord...
egelja/roycemorebot
roycemorebot/__main__.py
__main__.py
py
3,709
python
en
code
1
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "discord.ext.commands.Bot", "line_number": 15, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 15, "usage_type": "name" }, { "api_name": "...
43273324093
import torch import torch.nn as nn import torch.nn.functional as F from math import ceil # from lightconvpoint.spatial import knn, sampling_quantized from lightconvpoint.utils.functional import batch_gather import torch class Convolution_FKAConv(torch.nn.Module): def __init__(self, in_channels, out_channels, ker...
valeoai/POCO
lightconvpoint/nn/conv_fkaconv.py
conv_fkaconv.py
py
5,573
python
en
code
163
github-code
6
[ { "api_name": "torch.nn", "line_number": 9, "usage_type": "attribute" }, { "api_name": "math.ceil", "line_number": 26, "usage_type": "call" }, { "api_name": "torch.nn.Sequential", "line_number": 27, "usage_type": "call" }, { "api_name": "torch.nn", "line_numbe...
5231037387
import sys import os import time import glob import subprocess import re import tempfile from functools import reduce class bcolors: HEADER = '\033[95m' OKBLUE = '\033[94m' BLUE = '\033[94m' OKGREEN = '\033[92m' GREEN = '\033[92m' PURPLE = '\033[0;35m' LPURPLE = '\033[1;35m' CYAN = '...
volodymyrss/pilton
pilton.py
pilton.py
py
14,081
python
en
code
0
github-code
6
[ { "api_name": "re.findall", "line_number": 43, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 50, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 54, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 63, ...
35951940288
#!/usr/bin/python from __future__ import print_function import logging import logging.handlers import re from path import Path from cglims.api import ClinicalLims, ClinicalSample from ..utils.files import make_link __version__ = '1.20.22' logger = logging.getLogger(__name__) class ExternalIDNotFoundException(Exce...
Clinical-Genomics/deliver
deliver/modules/cust.py
cust.py
py
8,057
python
en
code
1
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "cglims.api.ClinicalSample", "line_number": 51, "usage_type": "call" }, { "api_name": "re.match", "line_number": 110, "usage_type": "call" }, { "api_name": "re.match", ...
30626797392
from flask import Flask, request, render_template from model import Model app = Flask(__name__) @app.route("/", methods=['GET', 'POST']) def stroke_form(): return render_template('stroke.html') @app.route("/result", methods=['GET', 'POST']) def result(): if request.method == 'POST': model = Model(...
ulmasovjafarbek/stroke-prediction-model
app.py
app.py
py
700
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 15, "usage_type": "attribute" }, { "api_name": "flask.requ...
73652378109
# 给你一个用字符数组 tasks 表示的 CPU 需要执行的任务列表。其中每个字母表示一种不同种类的任务。任务可以以任意顺序执行,并且每个任务都可以在 1 个单位时间内执行完。在任何一个单位时间,CPU 可以完成一个任务,或者处于待命状态。 # 然而,两个 相同种类 的任务之间必须有长度为整数 n 的冷却时间,因此至少有连续 n 个单位时间内 CPU 在执行不同的任务,或者在待命状态。 # 你需要计算完成所有任务所需要的 最短时间 。 import collections class Solution(object): def leastInterval(self, tasks, n): """ ...
xxxxlc/leetcode
array/leastInterval.py
leastInterval.py
py
1,466
python
zh
code
0
github-code
6
[ { "api_name": "collections.Counter", "line_number": 17, "usage_type": "call" } ]
21396662329
import json from typing import Dict, Optional import yaml from racetrack_client.client_config.alias import resolve_lifecycle_url from racetrack_client.client_config.auth import get_user_auth from racetrack_client.client_config.io import load_client_config from racetrack_client.log.context_error import wrap_context fr...
TheRacetrack/racetrack
racetrack_client/racetrack_client/client/call.py
call.py
py
2,488
python
en
code
27
github-code
6
[ { "api_name": "racetrack_client.log.logs.get_logger", "line_number": 14, "usage_type": "call" }, { "api_name": "typing.Optional", "line_number": 20, "usage_type": "name" }, { "api_name": "racetrack_client.log.logs.configure_logs", "line_number": 26, "usage_type": "call" ...
7988973268
from display import Display, TextRow from display_text_manager import DisplayTextManager from progress_bar_manager import ProgressBarManager from spotify_manager import SpotifyManager, TrackData import schedule import time import logging DISPLAY_WIDTH = 126 DISPLAY_HEIGHT = 64 DISPLAY_ADDRESS = 0x3C displ...
SteelPh0enix/SpotifyOLED
app.py
app.py
py
2,899
python
en
code
2
github-code
6
[ { "api_name": "display.Display", "line_number": 13, "usage_type": "call" }, { "api_name": "display_text_manager.DisplayTextManager", "line_number": 14, "usage_type": "call" }, { "api_name": "progress_bar_manager.ProgressBarManager", "line_number": 15, "usage_type": "call"...
71080527547
from django.forms import Form, fields, widgets from django.core.exceptions import ValidationError import re from decimal import * from datetime import date class ChargeForm(Form): amount = fields.DecimalField( label='Сумма:', required=True, max_digits=7, decimal_places=2, w...
maks-sh/technoatom-py
hw_3/finance/forms.py
forms.py
py
3,561
python
en
code
1
github-code
6
[ { "api_name": "django.forms.Form", "line_number": 8, "usage_type": "name" }, { "api_name": "django.forms.fields.DecimalField", "line_number": 9, "usage_type": "call" }, { "api_name": "django.forms.fields", "line_number": 9, "usage_type": "name" }, { "api_name": "d...
19432817071
''' Created on 2014. 6. 9. This module extract features followings N-gram(Unigram, Bigram, Trigram) : extractNgrams() , store to a file and load from it : saveFeatureMap(), loadFeatureMap() , make the features as context which is a list of existence of a feature : toContext() @author: yeonchan ''' im...
acha21/LSTD
FeatureExtractor.py
FeatureExtractor.py
py
5,424
python
en
code
0
github-code
6
[ { "api_name": "maxent.MaxentModel", "line_number": 22, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 28, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 29, "usage_type": "call" }, { "api_name": "co...
73511779068
import xml.etree.ElementTree as ET def parseXMLFile(filename): try: tree = ET.parse(filename) return tree.getroot() except FileNotFoundError: print("Input filename does not exist: " + filename) sys.exit(2) def getSVGHeight(elem): maxHeight = int(elem.find("coordenadas").g...
fonsecadh/sew-lab
XML/Ejercicio-2/Tarea-4/rutasToSvg.py
rutasToSvg.py
py
3,169
python
en
code
0
github-code
6
[ { "api_name": "xml.etree.ElementTree.parse", "line_number": 6, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 6, "usage_type": "name" }, { "api_name": "xml.etree.ElementTree.SubElement", "line_number": 45, "usage_type": "call" }, { "...
31653382206
__author__ = 'Dani' from .utils import initialize_country_dict, look_for_country_name_exception, \ build_label_for_observation, _is_empty_value, build_observation_uri, \ normalize_code_for_uri, initialize_indicator_dict,\ KEY_INDICATOR_NAME, KEY_INDICATOR_PROV_URL, KEY_INDICATOR_PROV_NAME, \ KEY_INDIC...
weso/wixFetcher
app/parsers/primaryobservationsparser.py
primaryobservationsparser.py
py
13,146
python
en
code
0
github-code
6
[ { "api_name": "utils.initialize_country_dict", "line_number": 22, "usage_type": "call" }, { "api_name": "utils.initialize_indicator_dict", "line_number": 23, "usage_type": "call" }, { "api_name": "utils.build_observation_uri", "line_number": 67, "usage_type": "call" }, ...
74905912828
import logging import os import transformer import statement import sys mydir = (os.getcwd()).replace('\\','/') + '/files' logger=logging.getLogger() logger.setLevel(logging.DEBUG) file_handler = logging.FileHandler('logs.log') formatter = logging.Formatter('%(message)s') file_handler.setFormatter(formatter) logger....
Tavet/Bancolombia-stats
main.py
main.py
py
2,287
python
es
code
0
github-code
6
[ { "api_name": "os.getcwd", "line_number": 7, "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": "logging.FileHandler", ...
23019743765
import argparse import random import copy import time import math import numpy as np from pettingzoo.classic import connect_four_v3 def get_legal_actions(env): observation, reward, termination, truncation, info = env.last() action_mask = observation["action_mask"] return np.nonzero(action_mask)[0] def s...
jfrancis71/PyGenBrix
misc/connect4.py
connect4.py
py
11,094
python
en
code
0
github-code
6
[ { "api_name": "numpy.nonzero", "line_number": 13, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 19, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 39, "usage_type": "call" }, { "api_name": "math.log", "line_numbe...
11917226110
# Map.py # # Map class fields: # - driver: webdriver opens Chrome window # - dirpath: string path of directory containing index.html file # - center: (lat,lon) coordinate at which map is centered # - last_pt: (lat,lon) coordinate...
vwlin/FleetTracker
UI/Map.py
Map.py
py
4,154
python
en
code
1
github-code
6
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 49, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 49, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_number": 50, "usage_type": "call" }, { "api_name": "os.path"...
651492617
# Multicut Pipeline implemented with luigi # Blockwise solver tasks import luigi from .pipelineParameter import PipelineParameter from .dataTasks import ExternalSegmentation, StackedRegionAdjacencyGraph from .customTargets import HDF5DataTarget, FolderTarget from .defectHandlingTasks import DefectsToNodes from .blo...
constantinpape/mc_luigi
mc_luigi/blockwiseBaselineTasks.py
blockwiseBaselineTasks.py
py
35,149
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 46, "usage_type": "call" }, { "api_name": "tools.config_logger", "line_number": 47, "usage_type": "call" }, { "api_name": "blockwiseMulticutTasks.BlockwiseSolver", "line_number": 51, "usage_type": "name" }, { "api_...
615799007
from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.QtCore import * from datetime import date from dataEnum import * import style class DisplayTaskWindow(QWidget): task_updated = pyqtSignal() entries_updated = pyqtSignal() def __init__(self, connection, cursor, task_id, user_id): s...
KasiaCzy/pyqt5_office_management
displayTask.py
displayTask.py
py
7,557
python
en
code
1
github-code
6
[ { "api_name": "style.btn_style", "line_number": 75, "usage_type": "call" }, { "api_name": "style.delete_btn_style", "line_number": 80, "usage_type": "call" }, { "api_name": "style.btn_style", "line_number": 84, "usage_type": "call" }, { "api_name": "style.window_t...
24638981199
import time from django.conf import settings from rest_framework.permissions import IsAuthenticatedOrReadOnly from rest_framework.views import APIView from django.db import transaction from django.core.exceptions import ObjectDoesNotExist from rest_framework.status import HTTP_204_NO_CONTENT, HTTP_400_BAD_REQUEST from ...
kaineus2999/ems-backend
moving_companies/views.py
views.py
py
2,372
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.views.APIView", "line_number": 17, "usage_type": "name" }, { "api_name": "rest_framework.permissions.IsAuthenticatedOrReadOnly", "line_number": 18, "usage_type": "name" }, { "api_name": "models.Moving_company.objects.all", "line_number": 21, ...
531690711
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ headervuln.py Like 'gethead.py', checks for vulnerable header settings on servers. Inspiration: https://github.com/httphacker -Christopher Welborn 12-31-2015 """ import os import sys from urllib import request from colr import auto_disable as colr_auto_d...
welbornprod/headervuln
headervuln.py
headervuln.py
py
6,177
python
en
code
0
github-code
6
[ { "api_name": "colr.auto_disable", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.split", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "l...
38870574082
import os from collections import OrderedDict import subprocess from pymake import ExpeFormat from pymake import get_pymake_settings USAGE = """\ ---------------- Manage the data : This script is part of the repo/ml of pymake. ---------------- """ class Data(ExpeFormat): _default_expe = { '_expe_silent' : T...
dtrckd/ml
script/data.py
data.py
py
5,739
python
en
code
0
github-code
6
[ { "api_name": "pymake.ExpeFormat", "line_number": 18, "usage_type": "name" }, { "api_name": "collections.OrderedDict", "line_number": 37, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 57, "usage_type": "call" }, { "api_name": "col...
17493563724
#this function gets the static deflection of the Car struct #Inputs are the model and Car struct #outputs are the static deflection matrix import numpy as np import numpy.linalg import itertools from itertools import combinations import get_SM def get_SD(model, Car): if(not isinstance(Car,dict)): ...
brandontran14/CarSimulation
get_SD.py
get_SD.py
py
2,618
python
en
code
0
github-code
6
[ { "api_name": "get_SM.get_SM", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.linalg.lstsq", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.linalg", "line...
6018077586
def getGraph(path, imgPath): from selenium import webdriver from selenium.webdriver.common.by import By from PIL import Image driver = webdriver.Chrome( executable_path=r"H:\Snippets\Program-Learning\Python\chromedriver.exe") driver.get(path) element = driver.find_element(by...
Yuelioi/Program-Learning
Python/Snippets/爬虫/html屏幕元素截图.py
html屏幕元素截图.py
py
1,570
python
en
code
0
github-code
6
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 7, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 7, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.by.By.CLASS_NAME", "line_number": 11, "usage_type": "attribute" },...
33787977790
from google.cloud import speech_v1 def sample_recognize(storage_uri, model): """ Transcribe a short audio file from Cloud Storage using a specified transcription model Args: storage_uri URI for audio file in Cloud Storage, e.g. gs://[BUCKET]/[FILE] model The transcription model to use, e....
silverdev/google-cloud-python
speech/samples/v1/speech_transcribe_model_selection_gcs.py
speech_transcribe_model_selection_gcs.py
py
1,480
python
en
code
0
github-code
6
[ { "api_name": "google.cloud.speech_v1.SpeechClient", "line_number": 16, "usage_type": "call" }, { "api_name": "google.cloud.speech_v1", "line_number": 16, "usage_type": "name" }, { "api_name": "argparse.ArgumentParser", "line_number": 39, "usage_type": "call" } ]
20317318586
import argparse import os import random import cv2 import numpy as np import tensorflow as tf from imutils import paths from sklearn.preprocessing import LabelBinarizer from tensorflow.python.keras.models import load_model from tensorflow.python.keras.preprocessing.image import img_to_array data_path = 'testdata' ima...
marinasuban/Comp309
Capstone/test copy.py
test copy.py
py
1,940
python
en
code
0
github-code
6
[ { "api_name": "tensorflow.random.set_seed", "line_number": 16, "usage_type": "call" }, { "api_name": "tensorflow.random", "line_number": 16, "usage_type": "attribute" }, { "api_name": "numpy.random.seed", "line_number": 17, "usage_type": "call" }, { "api_name": "n...
3486411037
########################################################################### # Main Testing ########################################################################### # Origin: Urs Utzinger # import cv2 import time import logging import time import numpy as np from blazepalm import Palm from blazehandpose ...
uutzinger/NCNN_python
test_blazehandpose.py
test_blazehandpose.py
py
7,809
python
en
code
0
github-code
6
[ { "api_name": "cv2.FONT_HERSHEY_SIMPLEX", "line_number": 57, "usage_type": "attribute" }, { "api_name": "cv2.namedWindow", "line_number": 66, "usage_type": "call" }, { "api_name": "cv2.WINDOW_AUTOSIZE", "line_number": 66, "usage_type": "attribute" }, { "api_name":...
2966202584
# coding=utf-8 """ The Email Activity Report API endpoint Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/reports/email-activity/ Schema: https://api.mailchimp.com/schema/3.0/Reports/EmailActivity/Instance.json """ from __future__ import unicode_literals from mailchimp3.baseapi import ...
VingtCinq/python-mailchimp
mailchimp3/entities/reportemailactivity.py
reportemailactivity.py
py
2,559
python
en
code
464
github-code
6
[ { "api_name": "mailchimp3.baseapi.BaseApi", "line_number": 14, "usage_type": "name" }, { "api_name": "mailchimp3.helpers.check_subscriber_hash", "line_number": 64, "usage_type": "call" } ]
9835262839
from django.contrib.auth import get_user_model from django.db import models # Create your models here. from group.models import UserGroup User = get_user_model() class Place(models.Model): name = models.CharField(max_length=100) address = models.CharField(max_length=255) def __str__(self): try:...
wesky93/graphene-django-example
src/event/models.py
models.py
py
1,833
python
en
code
1
github-code
6
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 7, "usage_type": "call" }, { "api_name": "django.db.models.Model", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 10, "usage_type": "name" }, { "ap...
29786051405
#!/usr/bin/env python # coding=utf-8 from __future__ import division, unicode_literals import argparse import logging import phodopus import squirrel import sys if sys.version_info.major == 2: from pathlib2 import Path else: from pathlib import Path if __name__ == '__main__': logging.basicConfig( ...
tianws/script
toVOC/evaluation/evalute.py
evalute.py
py
1,534
python
en
code
0
github-code
6
[ { "api_name": "sys.version_info", "line_number": 11, "usage_type": "attribute" }, { "api_name": "logging.basicConfig", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 18, "usage_type": "attribute" }, { "api_name": "argparse....
14042048930
from django.shortcuts import render from board.forms import BulletinPostForm from django.http import HttpResponseRedirect from board.forms import UserForm from board.forms import UserProfileForm from django.http import HttpResponseRedirect,HttpResponse # Create your views here. def index(request): cont = {} ...
PolyCole/mwf-django
mwf_django/frontend/views.py
views.py
py
1,740
python
en
code
0
github-code
6
[ { "api_name": "board.forms.BulletinPostForm", "line_number": 14, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 19, "usage_type": "call" }, { "api_name": "board.forms.BulletinPostForm", "line_number": 24, "usage_type": "call" }, { ...
70732575547
import pytest import numpy as np from juldate import ( datetime_to_jd, jd_to_datetime, jd_to_datetime64, jd_to_datetime_v, jd_to_datetime64_v, ) from conftest import ( list_datetime, list_datetime64, list_jd, list_mjd, ) @pytest.mark.parametrize( 'dt, jd', [(dt, jd) for dt,...
churilov-ns/juldate
tests/api/test_jd_to_datetime.py
test_jd_to_datetime.py
py
1,533
python
en
code
0
github-code
6
[ { "api_name": "juldate.jd_to_datetime", "line_number": 23, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 18, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 18, "usage_type": "attribute" }, { "api_name": "conft...
34620419810
"""add timestamp to posts Revision ID: a1b11d495752 Revises: 60091a21a7c3 Create Date: 2021-12-29 20:09:38.288250 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'a1b11d495752' down_revision = '60091a21a7c3' branch_labels = None depends_on = None def upgrade(...
kritonpc/FlaskBlog
migrations/versions/a1b11d495752_add_timestamp_to_posts.py
a1b11d495752_add_timestamp_to_posts.py
py
951
python
en
code
0
github-code
6
[ { "api_name": "alembic.op.batch_alter_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....
21884542177
"""Plot corner plots showing best fit for rates. Linked with the ideas in cube.py -> generating a range of parameters. TODO: In progress """ import numpy as np import os from glob import glob import matplotlib.pyplot as plt from matplotlib.colors import LogNorm from frbpoppy import paths, unpickle, poisson_interval ...
TRASAL/frbpoppy
tests/rates/corner.py
corner.py
py
3,297
python
en
code
26
github-code
6
[ { "api_name": "numpy.linspace", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path.join", "line...
29420214101
import pdb import os import cv2 import torch import pandas as pd import numpy as np from tqdm import tqdm import torch.backends.cudnn as cudnn from torch.utils.data import DataLoader, Dataset from albumentations import (Normalize, Compose) from albumentations.torch import ToTensor import torch.utils.data as data from m...
Bryce1010/DeepLearning-Project
Segmentation/Severstal: Steel Defect Detection/codes/EXP1_baseline_Unet/test.py
test.py
py
3,638
python
en
code
7
github-code
6
[ { "api_name": "numpy.concatenate", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 25, "usage_type": "call" }, { "api_name": "torch.utils.data.Dataset", "line_number": 30, "usage_type": "name" }, { "api_name": "albumentations...
13355625489
from collections.abc import Iterable from functools import reduce import os # 输入和输出 # 输出 print("需要输出的数据") # 输入(input) # input输出的值是字符串,如需要整数则需int()函数i = int(i) i = input("请输入:") print(i) # = # =号是赋值,左边给右边赋值 # 数据类型和变量 # 变量 # a就是变量名,变量可以是任意数据类型 # 变量在程序中用变量名表示,必须是大小写英文,数字和_组合,不能以数字开头,例如 a = 1 # 常量(就是不能变得变量,用全部大写字母表示) FI...
1065672881/Demo
python/Python基础/python.py
python.py
py
10,122
python
zh
code
0
github-code
6
[ { "api_name": "os.listdir", "line_number": 258, "usage_type": "call" }, { "api_name": "collections.abc.Iterable", "line_number": 328, "usage_type": "argument" }, { "api_name": "collections.abc.Iterable", "line_number": 329, "usage_type": "argument" }, { "api_name"...
3718805470
import argparse, json from concurrent.futures.process import ProcessPoolExecutor import numpy as np from src.scripts.experiments.experiment import run # Utility function for progress bar. https://github.com/tqdm/tqdm # If the software is running on very low memory requirements, it may be removed as unnecessary. fro...
kstavratis/Bachelor-s-Thesis-Adaptive-Clan-Particle-Swarm-Optimzation-with-Enhanced-Information-Sharing
main.py
main.py
py
2,400
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 16, "usage_type": "call" }, { "api_name": "json.load", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.random.default_rng", "line_number": 44, "usage_type": "call" }, { "api_name": "numpy.rand...
43972129556
from cpt import OrfFinder from Bio.Data import CodonTable from Bio import SeqIO from Bio import Seq data = "debug/cody-genome.fa" #isps = OrfFinder(args.table, args.ftype, args.ends, args.isp_min_len, args.strand) aadebug = open("aa-debug.fa","w") ntdebug = open("nt-debug.fa","w") bedbug = open("debug.bed","w") gffbu...
TAMU-CPT/galaxy-tools
tools/spanin/debug.py
debug.py
py
718
python
en
code
5
github-code
6
[ { "api_name": "cpt.OrfFinder", "line_number": 13, "usage_type": "call" }, { "api_name": "Bio.Data.CodonTable.unambiguous_dna_by_id", "line_number": 15, "usage_type": "attribute" }, { "api_name": "Bio.Data.CodonTable", "line_number": 15, "usage_type": "name" } ]
1771987908
# SPDX-License-Identifier: AGPL-3.0-or-later ''' Frea Search is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Frea Search is distribu...
regularenthropy/server
modules/job_manager.py
job_manager.py
py
6,911
python
en
code
0
github-code
6
[ { "api_name": "msg.dbg", "line_number": 35, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 38, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 39, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number...
4429850406
from app import app, db from app.forms import LoginForm, RegistrationForm, EditProfileForm from flask import render_template, flash, redirect, url_for, request from flask_login import current_user, login_user, logout_user, login_required from werkzeug.urls import url_parse from datetime import datetime from app.models ...
PengDongCd/Flask_learn
app/route.py
route.py
py
4,040
python
en
code
0
github-code
6
[ { "api_name": "flask.render_template", "line_number": 26, "usage_type": "call" }, { "api_name": "app.app.route", "line_number": 10, "usage_type": "call" }, { "api_name": "app.app", "line_number": 10, "usage_type": "name" }, { "api_name": "app.app.route", "line...
33973566337
""" Binary tree with decision tree semantics and ASCII visualization. """ import copy import dot2tex as d2t from experiments.models import MetricType from pathlib import Path import pydot import subprocess from typing import Dict, Any from utils.random import COLOR_LIST class Node: """A decision tree node.""...
user-anonymous-researcher/interpretable-dts
tree/tree.py
tree.py
py
15,067
python
en
code
0
github-code
6
[ { "api_name": "pydot.Dot", "line_number": 166, "usage_type": "call" }, { "api_name": "pydot.Node", "line_number": 187, "usage_type": "call" }, { "api_name": "pydot.Dot", "line_number": 190, "usage_type": "attribute" }, { "api_name": "pydot.Edge", "line_number"...
33729486498
from typing import List from unittest import TestCase from io_scene_vrm.importer import py_model class TestImporter(TestCase): def test_validate_license_url(self) -> None: for url, confirmation_required in [ ("", False), ("test", True), ("https://example.com", True), ...
intp1/VRM_Addon_for_Blender
tests/test_importer.py
test_importer.py
py
1,777
python
en
code
null
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 7, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 34, "usage_type": "name" }, { "api_name": "io_scene_vrm.importer.py_model.LicenseConfirmationRequiredProp", "line_number": 34, "usage_type": "attribute...
18711641450
"""Functions to get the correlation coefficients from lst files""" import logging import re from pathlib import Path def get_cc(filename): """Extract the cc from the file and return as a float""" logging.debug(f"Trying to extract CC from {filename}") try: filepath = Path(filename) assert ...
mevol/python_topaz3
topaz3/get_cc.py
get_cc.py
py
990
python
en
code
0
github-code
6
[ { "api_name": "logging.debug", "line_number": 10, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.error", "line_number": 15, "usage_type": "call" }, { "api_name": "re.findall", "line_numbe...
30112429038
# -*- coding: utf-8 -*- """ Created on Fri May 3 11:36:04 2019 @author: mjrubino """ # Import modules import pandas as pd from pygbif import occurrences as occ from pygbif import species import os # Local variables workDir = 'C:/Data/USGS Analyses/GAP-Habitat-Map-Assessment/' tempDir = workDir + 'temp/' os.chdir(w...
mjrubino/GAP-Habitat-Map-Assessment
Scripts/GetGBIFRecordCounts.py
GetGBIFRecordCounts.py
py
1,352
python
en
code
0
github-code
6
[ { "api_name": "os.chdir", "line_number": 18, "usage_type": "call" }, { "api_name": "config.sciNames1719", "line_number": 21, "usage_type": "attribute" }, { "api_name": "pandas.DataFrame", "line_number": 23, "usage_type": "call" }, { "api_name": "pygbif.species.nam...
25087291266
from __future__ import print_function def update_route_53(event, context): import boto3 from botocore.exceptions import ClientError details = event['domain'].split(".") ##getelb name client = boto3.client('elbv2') details = event['domain'].split(".") key = 'LoadBalancers' try: ...
vchokshi/crispy-computing-machine
roots/aws/master/us-west-2/lambda/_discovered_functions/update_route_53.py
update_route_53.py
py
1,895
python
en
code
2
github-code
6
[ { "api_name": "boto3.client", "line_number": 11, "usage_type": "call" }, { "api_name": "botocore.exceptions.ClientError", "line_number": 22, "usage_type": "name" }, { "api_name": "boto3.client", "line_number": 35, "usage_type": "call" }, { "api_name": "botocore.ex...
22700217544
import matplotlib.pyplot as plt import json import os import numpy as np from PIL import Image import pyrealsense2 as rs from matplotlib.patches import FancyArrowPatch from mpl_toolkits.mplot3d import proj3d import open3d as o3d import pc_reconstruction.open3d_utils as utils import copy def load_robot_path_pos(robot...
KochPJ/AutoPoseEstimation
pc_reconstruction/create_pointcloud.py
create_pointcloud.py
py
19,408
python
en
code
11
github-code
6
[ { "api_name": "os.path.join", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 18, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "l...
42342371473
from importlib import import_module import inspect def introspect_constructor(module_name): module, funct = split_module_class(module_name) try: spec = inspect.getargspec( getattr(import_module(module), funct).__init__) except Exception as e: spec = inspect.getargspec(getattr(...
jenslaufer/rl-trader
src/di/introspect.py
introspect.py
py
911
python
en
code
3
github-code
6
[ { "api_name": "inspect.getargspec", "line_number": 9, "usage_type": "call" }, { "api_name": "importlib.import_module", "line_number": 10, "usage_type": "call" }, { "api_name": "inspect.getargspec", "line_number": 12, "usage_type": "call" }, { "api_name": "importli...
5845145557
import requests from stellar_sdk.asset import Asset from stellar_sdk.keypair import Keypair from stellar_sdk.network import Network from stellar_sdk.operation.manage_sell_offer import ManageSellOffer from stellar_sdk.server import Server from stellar_sdk.transaction_builder import TransactionBuilder import json # Pr...
younes3334/Stellar_trading_bot
stellar_bot_v1.py
stellar_bot_v1.py
py
2,551
python
en
code
0
github-code
6
[ { "api_name": "stellar_sdk.server.Server", "line_number": 15, "usage_type": "call" }, { "api_name": "stellar_sdk.network.Network.TESTNET_NETWORK_PASSPHRASE", "line_number": 18, "usage_type": "attribute" }, { "api_name": "stellar_sdk.network.Network", "line_number": 18, "u...
72851769147
import cv2 import numpy as np def empty(a): # this is just an empty function, that does nothing, but is to be put inside the cv2.createTrackbar() function pass path = 'Resources/test1.png' cv2.namedWindow("Track Bars") # naming the window cv2.resizeWindow("Track Bars", 640, 240) # setting the size of the window ...
kartikeya47/OpenCV-Dump
chapter7.py
chapter7.py
py
2,084
python
en
code
0
github-code
6
[ { "api_name": "cv2.namedWindow", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.resizeWindow", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.createTrackbar", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.createTrackbar...
21736032732
from django.contrib import admin from django.urls import path, re_path, include from django.conf import settings from django.conf.urls.static import static, serve from django.views.generic import TemplateView from rest_framework.schemas import get_schema_view patterns = [ path('admin/', admin.site.urls), path...
pawanganesh/journey_journal
journey_journal/urls.py
urls.py
py
1,396
python
en
code
1
github-code
6
[ { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 10, "usage_type": "name" }, { "api_name": "...
30929914725
import torch from transformers import AutoTokenizer, AutoModelForCausalLM, LlamaTokenizer, LlamaForCausalLM from peft import PeftModel import os import sys import warnings def load_model(model_path: str, lora_path:str = None, device = "cpu"): assert model_path is not None load_type = torch.float16 tokenizer_mod...
inforix/lll
utils/model.py
model.py
py
5,957
python
en
code
1
github-code
6
[ { "api_name": "torch.float16", "line_number": 11, "usage_type": "attribute" }, { "api_name": "transformers.AutoTokenizer.from_pretrained", "line_number": 15, "usage_type": "call" }, { "api_name": "transformers.AutoTokenizer", "line_number": 15, "usage_type": "name" }, ...
26038335266
from __future__ import annotations import re from dataclasses import asdict from typing import Iterable, Iterator, List, Optional import strawberry from pants_explorer.server.graphql.context import GraphQLContext from pants_explorer.server.graphql.field_types import JSONScalar from strawberry.types import Info from ...
pantsbuild/pants
pants-plugins/pants_explorer/server/graphql/query/targets.py
targets.py
py
6,692
python
en
code
2,896
github-code
6
[ { "api_name": "pants.base.specs_parser.SpecsParser", "line_number": 18, "usage_type": "call" }, { "api_name": "strawberry.field", "line_number": 23, "usage_type": "call" }, { "api_name": "strawberry.field", "line_number": 26, "usage_type": "call" }, { "api_name": ...
72120292669
from fastapi import APIRouter, Depends from sqlalchemy import select, insert from sqlalchemy.ext.asyncio import AsyncSession from database import get_async_session from store.models import Category, Product from store.schemas import CategorySchema router = APIRouter( tags=['Category'] ) @router.post('/category/...
ananos548/fastapi_store
src/store/router_category.py
router_category.py
py
804
python
en
code
0
github-code
6
[ { "api_name": "fastapi.APIRouter", "line_number": 9, "usage_type": "call" }, { "api_name": "store.schemas.CategorySchema", "line_number": 15, "usage_type": "name" }, { "api_name": "sqlalchemy.ext.asyncio.AsyncSession", "line_number": 15, "usage_type": "name" }, { ...
42494127816
import numpy as np import cv2 from tensorflow import keras import tensorflow as tf physical_devices = tf.config.list_physical_devices('GPU') tf.config.experimental.set_memory_growth(physical_devices[0], True) model=keras.models.load_model("Model/best.hdf5") face_cascade=cv2.CascadeClassifier("Cascades/haarc...
sairushan/Face_Mask_Detector
mask_detect.py
mask_detect.py
py
1,041
python
en
code
0
github-code
6
[ { "api_name": "tensorflow.config.list_physical_devices", "line_number": 5, "usage_type": "call" }, { "api_name": "tensorflow.config", "line_number": 5, "usage_type": "attribute" }, { "api_name": "tensorflow.config.experimental.set_memory_growth", "line_number": 6, "usage_...
25262544715
#!/usr/bin/python """Command-line tool for enabling and disabling sections of cron jobs.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import collections import os import re import sys import six class Commenter(object): """Utility...
google/upvote_py2
manage_crons.py
manage_crons.py
py
6,025
python
en
code
449
github-code
6
[ { "api_name": "re.compile", "line_number": 33, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 82, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 114, "usage_type": "call" }, { "api_name": "six.iteri...
69894879549
from collections import namedtuple from itertools import combinations from math import sqrt Point = namedtuple('Point', 'x y') def distance_squared(first_point, second_point): return (first_point.x - second_point.x) ** 2 + (first_point.y - second_point.y) ** 2 def min_squared_divide_and_conquer(points): d...
gregh13/Algorithmic-Toolkit
Week_4_divide_and_conquer/closest.py
closest.py
py
2,753
python
en
code
0
github-code
6
[ { "api_name": "collections.namedtuple", "line_number": 6, "usage_type": "call" }, { "api_name": "itertools.combinations", "line_number": 69, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 84, "usage_type": "call" } ]
9693626340
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Functions used to create figures of the paper """ __author__ = "Christina Ludwig, GIScience Research Group, Heidelberg University" __email__ = "christina.ludwig@uni-heidelberg.de" import matplotlib.pyplot as plt import seaborn as sns import os import nb_utils as nbu ...
redfrexx/osm_association_rules
src/nb_utils/figures.py
figures.py
py
5,664
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 29, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 29, "usage_type": "name" }, { "api_name": "seaborn.boxplot", "line_number": 32, "usage_type": "call" }, { "api_name": "seaborn....
23800731471
#/bin/python3 from argparse import * from termcolor import colored def arguments(): parser=ArgumentParser(colored('Usage of the Program ','green')+(colored(' pyhton3 wat.py -u <url> \n','red'))) parser.add_argument('-u',dest='url',help='URL of the target') return parser.parse_args() arg=arguments() print(arg.url)...
prajwalcbk/tools
wat/wat.py
wat.py
py
321
python
en
code
0
github-code
6
[ { "api_name": "termcolor.colored", "line_number": 8, "usage_type": "call" } ]
74186559869
from django.urls import path, include from rest_framework.routers import DefaultRouter from .views import JuiceView, BrandView app_name = 'warehouse' router = DefaultRouter() router.register('juice', JuiceView) router.register('brand', BrandView) urlpatterns = [ path('', include(router.urls)), ]
rezarezaeedev/juiceshop
Warehouse/urls.py
urls.py
py
302
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 8, "usage_type": "call" }, { "api_name": "views.JuiceView", "line_number": 9, "usage_type": "argument" }, { "api_name": "views.BrandView", "line_number": 10, "usage_type": "argument" }, { "api_na...
22905230404
#!/usr/bin/python3 # run server (dont forget to set the pins 3 and 2 to GPIO mode and enable PWM) import logging import signal import time from argparse import ArgumentParser from typing import NamedTuple, Optional from configparser import ConfigParser, NoOptionError from contextlib import ExitStack from enum import E...
Deric-W/Supratix_experiment
ramp_experiment/__main__.py
__main__.py
py
12,899
python
en
code
0
github-code
6
[ { "api_name": "typing.NamedTuple", "line_number": 24, "usage_type": "name" }, { "api_name": "enum.Enum", "line_number": 32, "usage_type": "name" }, { "api_name": "time.monotonic", "line_number": 50, "usage_type": "call" }, { "api_name": "time.monotonic", "line...
2914444286
from sklearn.metrics import accuracy_score, confusion_matrix from sklearn.model_selection import GridSearchCV from sklearn.ensemble import RandomForestClassifier from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelEncoder from sklearn.metrics import accuracy_score, confusion_matr...
anon3y/emo_app
model_u.py
model_u.py
py
2,239
python
en
code
0
github-code
6
[ { "api_name": "sklearn.preprocessing.LabelEncoder", "line_number": 14, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 22, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.StandardScaler", "line_number": 25, "us...
30950885897
def p_id(fp,rho,d): return rho*(1+fp**2/(d*(d-1)*3)) def swim_add(fp,rho,d): return rho*fp**2/(d*(d-1)*3) if __name__=="__main__": import numpy as np import matplotlib.pyplot as plt import os import sys sys.path.append('../../analysis_scripts') from dumpfile import DumpFile fro...
samueljmcameron/ABPs_coarse_graining
experiments/2020_04_09/compare_winkler_naive/pressure_vs_rho.py
pressure_vs_rho.py
py
2,709
python
en
code
0
github-code
6
[ { "api_name": "sys.path.append", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 24, "usage_type": "call" }, { "api_name": "sys.path", "line_nu...
41039453827
import cv2 import numpy as np import random net = cv2.dnn.readNet("processing/yolov3_training.weights", "processing/yolov3_testing.cfg") classes = ["Tank"] layer_names = net.getLayerNames() output_layers = [layer_names[i - 1] for i in net.getUnconnectedOutLayers()] colors = np.random.uniform(0, 255, size=(len(classes...
pashakres/tank_detection
processing/object_detection.py
object_detection.py
py
1,773
python
en
code
1
github-code
6
[ { "api_name": "cv2.dnn.readNet", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.dnn", "line_number": 6, "usage_type": "attribute" }, { "api_name": "numpy.random.uniform", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.random", "l...
29402035006
#! -*- coding: utf-8 -*- import numpy as np import tensorflow as tf from tensorflow.keras.layers import Layer from tensorflow.keras.models import Model from tensorflow.keras.layers import * from tensorflow.keras import backend as K import os import cv2 os.environ['CUDA_VISIBLE_DEVICES']='' class ReflectionPadding2D(L...
xuyanging/vae
soiling_pattern_genration.py
soiling_pattern_genration.py
py
4,303
python
en
code
0
github-code
6
[ { "api_name": "os.environ", "line_number": 10, "usage_type": "attribute" }, { "api_name": "tensorflow.keras.layers.Layer", "line_number": 13, "usage_type": "name" }, { "api_name": "tensorflow.pad", "line_number": 25, "usage_type": "call" }, { "api_name": "tensorfl...