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
36780535651
from typing import List, Union, Iterator, Tuple from cell import Cell class World: NEIGHT = ( (-1, -1), (-1, 0), (-1, 1), (0, -1), (0, 1), (1, -1), (1, 0), (1, 1) ) def __init__(self, width, height): self.w = width self.h = ...
AzaubaevViktor/evo_life
world.py
world.py
py
2,710
python
en
code
0
github-code
6
[ { "api_name": "cell.Cell", "line_number": 26, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 29, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 29, "usage_type": "name" }, { "api_name": "cell.Cell", "line_number": 29,...
71840538747
from flask import Flask from flask import render_template from flask import Response, request, jsonify app = Flask(__name__) current_id = 4 sales = [ { "id": 1, "salesperson": "James D. Halpert", "client": "Shake Shack", "reams": 1000 }, { "id": 2, "salesperson": "Stanley Hudson", "client": "Toast", ...
haoshuai999/User-Interface
cu-paper-infinity&ppc/app.py
app.py
py
2,393
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 59, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 63, "usage_type": "call" }, { "api_name": "flask.request....
30354475241
import setuptools from setuptools import Command try: import numpy from numpy.distutils.command import build, install_data, build_src from numpy.distutils.core import setup HAS_NUMPY = True except ImportError: HAS_NUMPY = False from distutils.command import build, install_data from distutil...
enthought/mayavi
setup.py
setup.py
py
16,576
python
en
code
1,177
github-code
6
[ { "api_name": "sys.argv", "line_number": 30, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 31, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 32, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_nu...
26602476689
import numpy as np import pandas as pd import datetime as dt import sqlalchemy from sqlalchemy.ext.automap import automap_base from sqlalchemy.orm import Session from sqlalchemy import create_engine, func, inspect from flask import Flask, jsonify app = Flask(__name__) engine = create_engine("sqlite:///Resources/haw...
SofiaAS1/SQLalchemy-Challenge
app.py
app.py
py
3,377
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 12, "usage_type": "call" }, { "api_name": "sqlalchemy.create_engine", "line_number": 14, "usage_type": "call" }, { "api_name": "sqlalchemy.ext.automap.automap_base", "line_number": 15, "usage_type": "call" }, { "api_name...
28800553771
import os import pytest import pathlib import numpy as np import pandas as pd from math import isclose from cytominer_eval.operations import mp_value from cytominer_eval.utils.mpvalue_utils import ( calculate_mp_value, calculate_mahalanobis, ) # Load CRISPR dataset example_file = "SQ00014610_normalized_feat...
cytomining/cytominer-eval
cytominer_eval/tests/test_operations/test_mp_value.py
test_mp_value.py
py
3,230
python
en
code
7
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line...
14235086016
from http.client import HTTPSConnection from tkinter import filedialog as fd from tkinterdnd2 import * from threading import * from tkinter import * from json import * from sys import * from tkinter import ttk from time import sleep import tkinter as tk import pyimgur import random import sys ''' GUIDES I USED https...
vaperyy/ImageBot_for_Discord
image_bot.py
image_bot.py
py
13,058
python
en
code
0
github-code
6
[ { "api_name": "tkinter.BooleanVar", "line_number": 62, "usage_type": "call" }, { "api_name": "tkinter.BooleanVar", "line_number": 64, "usage_type": "call" }, { "api_name": "tkinter.Button", "line_number": 83, "usage_type": "call" }, { "api_name": "tkinter.Button",...
19200731938
import argparse from inference import Inference from model import FashionModel from train import Trainer from data import TrainDataset class ArgumentSelectError(Exception): pass def training(): train_dataset = TrainDataset( image_dir=args.train_data_dir, csv_path_train=f'data/dataset_csv/lis...
omerferhatt/deep-fashion-classification
main.py
main.py
py
4,105
python
en
code
1
github-code
6
[ { "api_name": "data.TrainDataset", "line_number": 13, "usage_type": "call" }, { "api_name": "model.FashionModel", "line_number": 24, "usage_type": "call" }, { "api_name": "train.Trainer", "line_number": 31, "usage_type": "call" }, { "api_name": "inference.Inferenc...
14624971996
#coding:utf-8 from math import e import numpy as np year=150 def func(x): if x<0: return e**(g*x) else: return 1 x_1=[-3/float(40000)*x**2+3/float(200)*x for x in range(1,year)] x_2=[] T=3/2*(year-50) a=1/T**2 for x in range(1,year): if(x<=T): x_2.append(a*x**2) ...
liangzp/2018-American-Interdisciplinary-Contest-in-Modeling
Code/random_model.py
random_model.py
py
1,910
python
en
code
0
github-code
6
[ { "api_name": "math.e", "line_number": 9, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 34, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 34, "usage_type": "name" }, { "api_name": "numpy.random.normal"...
5637517912
from urllib.request import urlopen from datetime import datetime import json from settings import my_lec_list, base_url class InfoList(object): def __init__(self): self.json = self.get_api() self.table = self.json["table"] self.count = self.json["count"] self.body = self.json["body...
pddg/learning
models.py
models.py
py
2,174
python
en
code
0
github-code
6
[ { "api_name": "urllib.request.urlopen", "line_number": 17, "usage_type": "call" }, { "api_name": "settings.base_url", "line_number": 17, "usage_type": "name" }, { "api_name": "json.loads", "line_number": 19, "usage_type": "call" }, { "api_name": "settings.my_lec_l...
72333132669
""" @File : AdaBoost.py @Time : 2020-05-26 @Author : BobTsang @Software: PyCharm @Email : bobtsang@bupt.edu.cn """ # 这次用的是乳腺癌数据集做的二分类任务,因为鸢尾花数据集太小,特征较少,对于提升树不太cover # Minst:596x31 # time:62s import pandas as pd import numpy as np from sklearn import datasets import random import time # 手工实现打乱数据,不采用sklearn调...
BobTsang1995/StatisticalLearningMethod-python-
AdaBoost.py
AdaBoost.py
py
12,463
python
zh
code
2
github-code
6
[ { "api_name": "random.seed", "line_number": 31, "usage_type": "call" }, { "api_name": "random.shuffle", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 106, "usage_type": "call" }, { "api_name": "numpy.shape", "line_numbe...
20269902024
import os.path import math import numpy import json import bz2 import platereader from platereader.replicate import Replicate from platereader.statusmessage import StatusMessage, Severity from platereader.csvunicode import CsvFileUnicodeWriter, CsvFileUnicodeReader from platereader.parser import tecan, bioscreen clas...
platereader/gathode
platereader/plate.py
plate.py
py
71,939
python
en
code
4
github-code
6
[ { "api_name": "platereader.parser.modulenameToModule", "line_number": 18, "usage_type": "call" }, { "api_name": "platereader.parser", "line_number": 18, "usage_type": "attribute" }, { "api_name": "platereader.parser.getModulesOfNamespace", "line_number": 19, "usage_type":...
19637644362
import requests import datetime response = requests.get("https://blockchain.info/rawaddr/42e58ccd620fab780e46095f4b3f6987aa253219") data = response.json() first_tr_id = data["txs"][0]["hash"] first_tr_time = data["txs"][0]["time"] a = [1, 2, 3, 4] for n in range(len(a)): print(a[n])
maciek1066/training
bitcoin_api.py
bitcoin_api.py
py
294
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 4, "usage_type": "call" } ]
30614657486
from unittest import main from re import compile from ir_datasets.formats import ToucheQuery, TrecQrel, ToucheTitleQuery from ir_datasets.formats.touche import ToucheQualityQrel from test.integration.base import DatasetIntegrationTest class TestTouche(DatasetIntegrationTest): # noinspection PyTypeChecker de...
Heyjuke58/ir_datasets
test/integration/touche.py
touche.py
py
9,700
python
en
code
null
github-code
6
[ { "api_name": "test.integration.base.DatasetIntegrationTest", "line_number": 9, "usage_type": "name" }, { "api_name": "ir_datasets.formats.ToucheQuery", "line_number": 17, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 20, "usage_type": "call" }, {...
9272119407
import os import numpy as np import spacy import re import json import pyttsx3 #replace it to librosa import os import librosa import numpy as np from fastdtw import fastdtw from gtts import gTTS from scipy.spatial.distance import euclidean from fastdtw import fastdtw import shutil import config def create_folder_if_...
RamSankarTheDeveloper/TeenyTinyTitleTrove
utils.py
utils.py
py
10,032
python
en
code
0
github-code
6
[ { "api_name": "os.path.exists", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 20, "usage_type": "call" }, { "api_name": "shutil.move", "line_numbe...
16898559994
#!/usr/bin/env python3 import itertools def print_header(x, y, z = None): print("join_digits(", seq2digit(x), ", ", seq2some(y), ", ", seq2digit(z), ") ->", sep="") def produce(seq): while seq: if len(seq) == 4: yield seq2node(seq[:2]) yield seq2node(seq[2:]) brea...
platbox/nanometer
py/ftree_generate.py
ftree_generate.py
py
1,194
python
en
code
3
github-code
6
[ { "api_name": "itertools.chain", "line_number": 24, "usage_type": "call" } ]
30814462620
""" Script Description - train NADA model Usage - $ python train_nada.py --config_path [config_path] --name [exp_name] --suppress - $ cat [config_path] | python train_nada.py --pipe --name [exp_name] --suppress Author - Minsu Kim - Dongha Kim History - 230419 : MINSU , init - adaptation ...
studio-YAIVERSE/studio-YAIVERSE
train_nada.py
train_nada.py
py
13,226
python
en
code
20
github-code
6
[ { "api_name": "model_engine.find_get3d", "line_number": 38, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 46, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 50, "usage_type": "attribute" }, { "api_name": "logging....
32005344445
import torch.nn as nn from transformers import BertModel from services.text_similarity.settings import Settings class BERTClassifier(nn.Module): def __init__(self, freeze_params=False): super(BERTClassifier, self).__init__() self.settings = Settings self.bert = BertModel.from_pretrained(s...
R-aryan/Text-Similarity-Using-BERT
backend/services/text_similarity/application/ai/model.py
model.py
py
1,945
python
en
code
0
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 7, "usage_type": "name" }, { "api_name": "services.text_similarity.settings.Settings", "line_number": 10, "usage_type": "name" }, { "api_name":...
32397358077
import os import random import numpy as np import torch from scipy import ndimage as ndi from torch.nn import functional as F from torch.utils.data import Dataset from my_utils import normalize class UNetDataset(Dataset): def __init__(self, data_dir, shape, train, transform): self.shape = ...
alienzyj/PPos
my_dataset.py
my_dataset.py
py
10,080
python
en
code
0
github-code
6
[ { "api_name": "torch.utils.data.Dataset", "line_number": 13, "usage_type": "name" }, { "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", "...
8560654831
"""Bad style, but I don't know better where to put this.""" import logging import shelve from functools import wraps logger = logging.getLogger(__name__) def shelve_memoize(filename): """On-disk cache decorator using shelve.""" def decorator_shelve_memoize(func): @wraps(func) def wrapper_shel...
leogott/document-clustering
utils.py
utils.py
py
755
python
en
code
null
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "shelve.open", "line_number": 16, "usage_type": "call" }, { "api_name": "functools.wraps", "line_number": 12, "usage_type": "call" } ]
42786347897
import os import math import glob import time import random import torch from PIL import Image from torch.utils import data from torchvision.transforms import RandomCrop import numpy as np import core.io as io import core.clip_utils as cu import multiprocessing as mp class CachedAVSource(data.Dataset): def __ini...
fuankarion/active-speakers-context
core/dataset.py
dataset.py
py
16,534
python
en
code
52
github-code
6
[ { "api_name": "torch.utils.data.Dataset", "line_number": 17, "usage_type": "attribute" }, { "api_name": "torch.utils.data", "line_number": 17, "usage_type": "name" }, { "api_name": "random.seed", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.rand...
24957977468
#!/usr/bin/python3 '''Post the compositions in a given directory filtered or not by a basename now one ehr per composition ''' import json import logging import requests from url_normalize import url_normalize import sys import argparse import os from typing import Any,Callable import re from json_tools import diff ...
crs4/TO_OPENEHR_CONVERTER
COMPOSITIONS_UPLOADER/CompositionUploader.py
CompositionUploader.py
py
11,566
python
en
code
0
github-code
6
[ { "api_name": "json.dumps", "line_number": 24, "usage_type": "call" }, { "api_name": "json_tools.diff", "line_number": 24, "usage_type": "call" }, { "api_name": "collections.abc", "line_number": 35, "usage_type": "attribute" }, { "api_name": "typing.Any", "lin...
40814128
""" Plot the results. """ import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import datasets # Set a nice seaborn style for matplotlib sns.set_theme() #%% # Load results from csv df = pd.read_csv("jeopardy_results.csv", index_col="idx") #%% # Load the dataset from the Hugging Face Hub datas...
BlackHC/player_of_jeopardy
analysis.py
analysis.py
py
6,596
python
en
code
10
github-code
6
[ { "api_name": "seaborn.set_theme", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 17, "usage_type": "call" }, { "api_name": "datasets.load_dataset", "line_number": 21, "usage_type": "call" }, { "api_name": "pandas.DataFr...
73008025149
# Lesson 26 my code from pyspark.sql import SparkSession #import spark sql with session and row from pyspark.sql import Row #both of these thigns we use to itneract with SparkSQL and dataFrames spark = SparkSession.builder.appName("SparkSQL").getOrCreate() #the get or create again, creating a new spark session or conn...
CenzOh/Python_Spark
MyCode/sparkSql.py
sparkSql.py
py
2,183
python
en
code
0
github-code
6
[ { "api_name": "pyspark.sql.SparkSession.builder.appName", "line_number": 5, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 5, "usage_type": "attribute" }, { "api_name": "pyspark.sql.SparkSession", "line_number": 5, "usage_type": "...
24254182121
import time import requester import json import config location_id_data = {} exclude_ids = config.settings["loc_ids_to_exclude"] # Gananoque & Tay Valley Old People One & Prescott def parseLocationsToDict(): # Locations.json is extracted from the bottom of the pomelo covid-vaccination "locations" html page whe...
TASelwyn/PomeloScraper
main.py
main.py
py
4,417
python
en
code
0
github-code
6
[ { "api_name": "config.settings", "line_number": 8, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 15, "usage_type": "call" }, { "api_name": "config.resetLastAvailableDate", "line_number": 34, "usage_type": "call" }, { "api_name": "requeste...
73369850107
#!/usr/bin/env python3 import rospy import socket as s import numpy as np from cv_bridge import CvBridge import cv2 import pickle import struct import time # import ROS messages from sensor_msgs.msg import Image from sensor_msgs.msg import CameraInfo from std_msgs.msg import Header from utils import Msg import con...
yv1es/MRMapper
core/ros_node/mr-mapper/src/camera_publisher.py
camera_publisher.py
py
3,667
python
en
code
0
github-code
6
[ { "api_name": "socket.socket", "line_number": 28, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 28, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREAM", "line_number": 28, "usage_type": "attribute" }, { "api_name": "socket.bind...
16542834327
import sys from nuitka import Options from nuitka.ModuleRegistry import ( getDoneModules, getUncompiledModules, getUncompiledTechnicalModules, ) from nuitka.plugins.Plugins import Plugins from nuitka.PythonVersions import python_version from nuitka.Tracing import inclusion_logger from nuitka.utils.CStrings...
Nuitka/Nuitka
nuitka/code_generation/LoaderCodes.py
LoaderCodes.py
py
5,236
python
en
code
10,019
github-code
6
[ { "api_name": "nuitka.utils.CStrings.encodePythonStringToC", "line_number": 24, "usage_type": "call" }, { "api_name": "nuitka.plugins.Plugins.Plugins.encodeDataComposerName", "line_number": 25, "usage_type": "call" }, { "api_name": "nuitka.plugins.Plugins.Plugins", "line_numb...
8747012693
# -*- coding: utf-8 -*- """ Created on Sat Aug 24 23:16:21 2019 @author: ADMIN """ import pandas as pd import numpy as np import AllFunctions as af #import dateutil import math item_data=pd.read_csv("item_data.csv") log_data=pd.read_csv("view_log.csv",parse_dates=['server_time'],infer_datetime_format=True) train_d...
kinjaldand/MLProjects
AdClickPredictWNSHack/Work2.py
Work2.py
py
9,745
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 17, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 18, "usage_type": "call" }, { "api_name": "pandas.read_csv", ...
72833443067
# PET DATA PROCESSING import numpy as np import matplotlib.pyplot as plt from pathlib import Path num_examples = 1386 num_examples2 = 1386 res = 64 def folder_to_array(file_name, cat_name, X, idx1, numf, numt, y, label): idx_normal = range(idx1, idx1+numf) idx_flip = range(idx1+numf, idx1+2*num...
alexgilbert747/thesis
pets_data2.py
pets_data2.py
py
1,969
python
en
code
0
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 19, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 23, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.imread", "line_number": 25, "usage_type": "call" }, { "api_name": "matplotlib.pyplot"...
18920197222
from __future__ import annotations import sys from typing import TYPE_CHECKING from ansiblelint.rules import AnsibleLintRule if TYPE_CHECKING: from ansiblelint.file_utils import Lintable from ansiblelint.utils import Task def _changed_in_when(item: str) -> bool: if not isinstance(item, str): re...
ansible/ansible-lint
src/ansiblelint/rules/no_handler.py
no_handler.py
py
2,753
python
en
code
3,198
github-code
6
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 8, "usage_type": "name" }, { "api_name": "ansiblelint.rules.AnsibleLintRule", "line_number": 32, "usage_type": "name" }, { "api_name": "ansiblelint.utils.Task", "line_number": 48, "usage_type": "name" }, { "api_...
6368283311
import datacube import sys import xarray as xr import numpy as np import geopandas as gpd from datacube.virtual import construct_from_yaml from datacube.storage.masking import mask_invalid_data from osgeo import gdal, osr site = sys.argv[1] grid = gpd.read_file('/scratch/a.klh5/mangrove_data/shapefiles/{}.shp'.format...
klh5/wm_generator
gen_water_mask.py
gen_water_mask.py
py
2,809
python
en
code
0
github-code
6
[ { "api_name": "sys.argv", "line_number": 10, "usage_type": "attribute" }, { "api_name": "geopandas.read_file", "line_number": 12, "usage_type": "call" }, { "api_name": "osgeo.osr.SpatialReference", "line_number": 22, "usage_type": "call" }, { "api_name": "osgeo.os...
28970147437
import typing as t import collections import flask_restx import flask_restx.fields as frf import marshmallow.fields as mf from marshmallow_pynamodb import ModelSchema from model.base_model import Model from common.util import create_table class Serializer(ModelSchema): _api_model = None def __init__(self, ...
wizzdev-pl/iot-starter
web_server/server/core/serializer.py
serializer.py
py
3,081
python
en
code
7
github-code
6
[ { "api_name": "marshmallow_pynamodb.ModelSchema", "line_number": 13, "usage_type": "name" }, { "api_name": "common.util.create_table", "line_number": 18, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 42, "usage_type": "call" }, { ...
7169499809
from flask import Blueprint, request, jsonify, abort from modules.logger import logging from modules.config import config import modules.database as Database import modules.models as Models import modules.ldap as Ldap import modules.scanner as Scanner from modules.tools import get_token,requires_auth,check_auth,calc_...
aDrongo/ldap-device-surveyor
backend/modules/views.py
views.py
py
4,004
python
en
code
0
github-code
6
[ { "api_name": "flask.Blueprint", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 17, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 17, "usage_type": "name" }, { "api_name": "flask.request...
26113994325
__authors__ = ["T. Vincent"] __license__ = "MIT" __date__ = "16/05/2018" import logging import sys import numpy import pytest from silx.utils.testutils import ParametricTestCase from silx.math import colormap _logger = logging.getLogger(__name__) class TestNormalization(ParametricTestCase): """Test silx.mat...
silx-kit/silx
src/silx/math/test/test_colormap.py
test_colormap.py
py
10,291
python
en
code
106
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "silx.utils.testutils.ParametricTestCase", "line_number": 19, "usage_type": "name" }, { "api_name": "numpy.arange", "line_number": 24, "usage_type": "call" }, { "api_name":...
71150367547
import numpy as np import pandas as pd import scipy from sklearn.linear_model import LinearRegression as linreg from sklearn.linear_model import LogisticRegression as logreg from sklearn.cross_validation import KFold from sklearn.cross_validation import * from sklearn import cross_validation titanic=pd.read_csv("trai...
leminhtr/kaggle
Titanic/main_linreg-logreg.py
main_linreg-logreg.py
py
4,162
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.value_counts", "line_number": 25, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LinearRegression", "line_number": 41, "usage_type": "call" }, { "api_nam...
20086331044
""" Contains classes Quandle, Biquandle, Identity_Quandle, Alexander_Quandle, and Singquandle. FIXME: - Nothing for now. TODO: - If X is a rack with operation a*b, then it is a birack if we define a**b as the identity a**b == a. Thus biquandle matrix2 should be optional. - Does the above apply...
RafaelMri/Pyknots
modules/quandles.py
quandles.py
py
13,410
python
en
code
1
github-code
6
[ { "api_name": "pyknots.modules.magmas.Magma", "line_number": 26, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path", "line_number": 32, "usage_type": "attribute" }, { "api_name": "os.path.rea...
648181227
import numpy as np import torch from affogato.affinities import compute_affinities from torchvision.utils import make_grid from inferno.extensions.criteria import SorensenDiceLoss class ConcatDataset(torch.utils.data.Dataset): def __init__(self, *datasets): self.datasets = datasets self.lens = [l...
constantinpape/affogato
src/python/module/affogato/interactive/napari/train_utils.py
train_utils.py
py
5,323
python
en
code
9
github-code
6
[ { "api_name": "torch.utils", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.cumsum", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.roll", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.where", "line_numbe...
26298956035
import argparse from dateutil import tz from datetime import datetime from spotipy import Spotify import spotipy.util from models import Play, Track, Album, Artist, PostgreSQLConnection import settings def set_timezone_to_datetime(datetime_to_set, timezone): return datetime_to_set.replace(tzinfo=tz.gettz(timez...
mymindwentblvnk/hoergewohnheiten
extract/main.py
main.py
py
7,345
python
en
code
16
github-code
6
[ { "api_name": "dateutil.tz.gettz", "line_number": 14, "usage_type": "call" }, { "api_name": "dateutil.tz", "line_number": 14, "usage_type": "name" }, { "api_name": "datetime.datetime.strptime", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.dat...
17333008494
import collections class Rectangle(): def __init__(self, w, h, placed=None, free_wh=None): self.wh = w, h self.placed = placed or [] self.free_wh = free_wh or (0,0) @property def w(self): return self.wh[0] @property def h(self): return self.wh[...
yad439/pallet-packing
concat_baseline/concat_baseline.py
concat_baseline.py
py
11,602
python
en
code
0
github-code
6
[ { "api_name": "collections.Counter", "line_number": 154, "usage_type": "call" } ]
19329693229
from google_auth_oauthlib.flow import InstalledAppFlow from googleapiclient.discovery import build from google.oauth2.credentials import Credentials from google.auth.transport.requests import Request import os # All scopes together ALL_SCOPES = [ 'https://www.googleapis.com/auth/contacts.readonly', 'https://ww...
clarkdever/gcal-gcontacts-sync
google_api_utils.py
google_api_utils.py
py
2,803
python
en
code
0
github-code
6
[ { "api_name": "os.path.exists", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "google.oauth2.credentials.Credentials.from_authorized_user_file", "line_number": 21, "usage_type": "call" }...
19969055167
""" This helps in finding the means and standards of the images to normalize before training. To run python3 calculate_means_std.py -i path/to/image/folder/ """ import argparse import subprocess import yaml import os import sys sys.path.remove("/opt/ros/kinetic/lib/python2.7/dist-packages") import cv2 import nump...
vijaysamula/Building_floor_counter
calculate_means_stds.py
calculate_means_stds.py
py
2,438
python
en
code
0
github-code
6
[ { "api_name": "sys.path.remove", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path.join", ...
43367818416
# Importancia de la característica de permutación (PFI) para la clasificación de latidos utilizando un perceptrón multicapa (MLP) # # # - Código 'PFI.py' # - Trabajo Fin de Máster. # - Néstor Bolaños Bolaños. (nestorbolanos@correo.ugr.es) import warnings warnings.filterwarnings("ignore") import numpy as np imp...
Nestructor/Codigo_TFM_Aplicacion-del-Aprendizaje-Profundo-en-la-toma-de-Decisiones-Clinicas-Informadas
PFI.py
PFI.py
py
6,333
python
es
code
0
github-code
6
[ { "api_name": "warnings.filterwarnings", "line_number": 9, "usage_type": "call" }, { "api_name": "seaborn.set", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.empty", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.empty", "lin...
33708620212
import os from google.cloud import storage class GoogleStorageLoader(): def __init__(self) -> None: """Start Google Cloud clint - could be used for uploading to storage """ os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "../content/key-bucket.json" self.client = storage.Client() ...
IhorLuk/reddit_api_data_ingestion
src/storage.py
storage.py
py
724
python
en
code
0
github-code
6
[ { "api_name": "os.environ", "line_number": 8, "usage_type": "attribute" }, { "api_name": "google.cloud.storage.Client", "line_number": 9, "usage_type": "call" }, { "api_name": "google.cloud.storage", "line_number": 9, "usage_type": "name" } ]
13454184469
""" words list가 링크만 있고, 글자 데이터가 없음. 글자 리스트를 받아오기 위한 파일 """ from selenium import webdriver from bs4 import BeautifulSoup import pandas as pd class Get_chndic_data: def __init__(self, link): self.link = link self.get_data = [] def beautiful_soup(self, link): """ Beautiful Soup...
i-hs/chn_words_crawling
make_database/words_list.py
words_list.py
py
2,691
python
ko
code
0
github-code
6
[ { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 24, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 24, "usage_type": "name" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 31, "usage_type": "call" }, { "api...
42072257921
#!/usr/bin/env python # coding: utf-8 # In[36]: import requests from bs4 import BeautifulSoup import pandas list1=[] for page in range(0,30,10): r = requests.get("http://www.pyclass.com/real-estate/rock-springs-wy/LCWYROCKSPRINGS/t=0&s="+str(page)+".html", headers={'User-agent': 'Mozilla/5.0 (X11; Ubuntu;...
shivangijain827/python-projects
web - scraper/main.py
main.py
py
1,883
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 18, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 63, "usage_type": "call" } ]
3477283820
import logging import os import typing from collections import defaultdict from typing import Dict import dpath.util from voluptuous import Any from dvc.exceptions import DvcException from dvc.utils.serialize import ParseError, load_path from dvc_data.hashfile.hash_info import HashInfo from .base import Dependency ...
gshanko125298/Prompt-Engineering-In-context-learning-with-GPT-3-and-LLMs
myenve/Lib/site-packages/dvc/dependency/param.py
param.py
py
4,814
python
en
code
3
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "dvc.exceptions.DvcException", "line_number": 19, "usage_type": "name" }, { "api_name": "dvc.exceptions.DvcException", "line_number": 23, "usage_type": "name" }, { "api_nam...
8585416211
import torch import torch.nn as nn from torch import cat, exp import torch.nn.functional as F from torch.nn.functional import pad from torch.nn.modules.batchnorm import _BatchNorm class my_AFF(nn.Module): ''' Point-wise Convolution based Attention module (PWAtt) ''' def __init__(self, channels=64, r=...
Al-Dailami/DTSC-CAFF
dtsc_caff_model.py
dtsc_caff_model.py
py
21,192
python
en
code
1
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.nn", "line_...
24455754580
# -*- coding: utf-8 -*- """ @author: Fatih Kemal Terzi """ import cv2 import numpy as np # Image reading img = cv2.imread('pools.png') count=0 # Image converting to HSV color space hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV) # Adjusting range of blue color for detecting pools lower_blue = np.array([8...
FatihKemalTerzi/Image-Processing
Midterm3.py
Midterm3.py
py
1,105
python
en
code
0
github-code
6
[ { "api_name": "cv2.imread", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 14, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2HSV", "line_number": 14, "usage_type": "attribute" }, { "api_name": "numpy.array", "lin...
75131970108
import requests headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36"} "传入参数的形式" params = {"wd":"haha"} "最后面的问号可加可不加,不加的话,程序会自动帮你加上" url_temp = "https://www.baidu.com/?" "注意用requests调用post和get时的函数" r = requests.get(url_temp, ...
hahahei957/NewProject_Opencv2
venv_2/爬虫/01_HelloWorld.py
01_HelloWorld.py
py
874
python
zh
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 14, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 22, "usage_type": "call" } ]
41202734206
import tcod import random import copy import constants as const import entity import render import numpy as np import random_loot as rloot class Room: """ A room! Wow. """ def __init__(self, x, y, w, h): self.x = x # upper left point self.y = y # upper left point self.w = w ...
cpiod/1rl
game_map.py
game_map.py
py
16,741
python
en
code
3
github-code
6
[ { "api_name": "tcod.map.Map", "line_number": 28, "usage_type": "call" }, { "api_name": "tcod.map", "line_number": 28, "usage_type": "attribute" }, { "api_name": "numpy.arange", "line_number": 39, "usage_type": "call" }, { "api_name": "numpy.float32", "line_num...
9512772188
import sys import pandas as pd import numpy as np import xml.dom.minidom #from exercise 3 def output_gpx(points, output_filename): """ Output a GPX file with latitude and longitude from the points DataFrame. """ def append_trkpt(pt, trkseg, doc): trkpt = doc.createElement('trkpt') trkpt...
tomchiu19/tourPlanner
code/05-generate-gpx.py
05-generate-gpx.py
py
2,464
python
en
code
0
github-code
6
[ { "api_name": "xml.dom.minidom.dom.minidom.getDOMImplementation", "line_number": 17, "usage_type": "call" }, { "api_name": "xml.dom.minidom.dom", "line_number": 17, "usage_type": "attribute" }, { "api_name": "xml.dom.minidom", "line_number": 17, "usage_type": "name" }, ...
41054313506
# coding: utf-8 # # Heat Diffusion in Soils # # This Jupyter Notebook gives an example how to implement a 1D heat diffusion model in Python. # # First we need to import the packages which we will be using: # # In[1]: import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns impo...
solomelittle/EL-Individual-Assignment
03_ScriptCH_WieringermeerBoundary.py
03_ScriptCH_WieringermeerBoundary.py
py
7,445
python
en
code
0
github-code
6
[ { "api_name": "seaborn.set", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.shape", "line_number...
26470959901
""" Problem 71: Ordered Fractions https://projecteuler.net/problem=71 Goal: By listing the set of reduced proper fractions for d <= N in ascending order of size, find the numerator and denominator of the fraction immediately to the left of n/d. Constraints: 1 <= n < d <= 1e9, gcd(n, d) == 1, d < N <= 1e15 Reduced P...
bog-walk/project-euler-python
solution/batch7/problem71.py
problem71.py
py
7,025
python
en
code
0
github-code
6
[ { "api_name": "fractions.Fraction", "line_number": 60, "usage_type": "call" }, { "api_name": "fractions.Fraction", "line_number": 61, "usage_type": "call" }, { "api_name": "fractions.Fraction", "line_number": 62, "usage_type": "call" }, { "api_name": "fractions.Fr...
3739410797
import requests from bs4 import BeautifulSoup import re def get_vote_links(current_page): """Finds the vote page links on the main folktingspage. Args: main_page_soup (_type_): Takes in the main page with all the vote subpages as a soap object Returns: _type_: Returns a list of soap Obje...
jonahank/Vote-Prediction-Model
utils/scraper_functions.py
scraper_functions.py
py
4,617
python
en
code
1
github-code
6
[ { "api_name": "requests.get", "line_number": 31, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 32, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 51, "usage_type": "call" }, { "api_name": "re.compile", "line_numb...
1708447421
from __future__ import print_function import numpy as np import matplotlib.pyplot as plt import ball_endmill from utility import mm_to_inch from utility import plot_circle def plot_spheremill_toolpos(params): # Extract parameters diam_tool = params['diam_tool'] diam_sphere = params['diam_sphere'] ...
willdickson/sphere_mill_gcode
sphere_mill_gcode/ball_endmill_viz.py
ball_endmill_viz.py
py
2,135
python
en
code
0
github-code
6
[ { "api_name": "utility.plot_circle", "line_number": 22, "usage_type": "call" }, { "api_name": "utility.plot_circle", "line_number": 23, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 24, "usage_type": "call" }, { "api_name": "matplo...
10933119158
import os import cv2 # commutator vision import numpy as np import matplotlib.pyplot as plt import tensorflow as tf mnist = tf.keras.datasets.mnist # The hand number nad what it is (x_train, y_train), (x_test, y_test) = mnist.load_data() # split to training data and test data || x is the pixle data y is what Number...
Zippy-boy/HandDigets
main.py
main.py
py
1,658
python
en
code
0
github-code
6
[ { "api_name": "tensorflow.keras", "line_number": 7, "usage_type": "attribute" }, { "api_name": "tensorflow.keras.utils.normalize", "line_number": 10, "usage_type": "call" }, { "api_name": "tensorflow.keras", "line_number": 10, "usage_type": "attribute" }, { "api_n...
38466019670
__author__ = 'christiaanleysen' import features.featureMaker as fm from sklearn.metrics import mean_absolute_error import matplotlib.pyplot as plt import numpy as np from sklearn.linear_model import LinearRegression from sklearn import preprocessing ''' This file is used to calculate the linear regression ''' def pre...
chrike-platinum/Thesis-Gaussian-process-regression-clustering-and-prediction-of-energy-consumption
Methods/LinRegPrediction.py
LinRegPrediction.py
py
1,353
python
en
code
1
github-code
6
[ { "api_name": "numpy.asarray", "line_number": 30, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.scale", "line_number": 30, "usage_type": "call" }, { "api_name": "sklearn.preprocessing", "line_number": 30, "usage_type": "name" }, { "api_name": "numpy...
27267969236
from flask import Flask, render_template from shp_display import * app = Flask(__name__) def script(): return ['hades2'] def get_table(db): db = db script = "<table>" # Header Generator code = "<tr>" for s in db: if str(s) != "MULTIPOLYGON" and str(s) != 'geometry': cod...
nitish8090/Watershed_Modules_Py3
flask_app/app.py
app.py
py
1,373
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 38, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 49, "usage_type": "call" } ]
74099804029
import os import os.path as osp import torch import torch.nn as nn import torch.nn.functional as F import numpy as np import pandas as pd import argparse from dataset import collate_fn, MergedMatchingDataset from torch.utils.data import DataLoader from EmbedModel import EmbedModel from GCN import gcn from logger import...
ChenRunjin/GNEM
test.py
test.py
py
6,754
python
en
code
5
github-code
6
[ { "api_name": "numpy.asarray", "line_number": 62, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 63, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 67, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": ...
35037176201
import cv2 import numpy as np from analyzers.analyseContour import AnalyseContour from analyzers.contour import Contour class AnalyseSafran(AnalyseContour): """ Class qui mesure la taille du safran qui sort de l'eau. Attributs: x1RefPoint (int): coordonnée x du premier point de référence corresp...
Torystan/analyse-images
analyzers/analyseSafran.py
analyseSafran.py
py
4,231
python
fr
code
0
github-code
6
[ { "api_name": "analyzers.analyseContour.AnalyseContour", "line_number": 8, "usage_type": "name" }, { "api_name": "cv2.cvtColor", "line_number": 39, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 39, "usage_type": "attribute" }, { "api_n...
73727669948
import torch def get_device(model=None): """Returns two-tuple containing a PyTorch device (CPU or GPU(s)), and number of available GPUs. Returns a two-tuple containing a PyTorch device (CPU or GPU(s)) and number of available CUDA devices. If `model` is not None, and a CUDA device is available, the model...
bowang-lab/Transformer-GCN-QA
src/utils/model_utils.py
model_utils.py
py
2,040
python
en
code
15
github-code
6
[ { "api_name": "torch.cuda.is_available", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 23, "usage_type": "attribute" }, { "api_name": "torch.device", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.cuda.devic...
73675801466
import os, sys proj_path = "/home/webuser/webapps/tigaserver/" os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tigaserver_project.settings") sys.path.append(proj_path) os.chdir(proj_path + "util_scripts/") from django.core.wsgi import get_wsgi_application application = get_wsgi_application() from django.db.model...
Mosquito-Alert/mosquito_alert
util_scripts/check_in_progress_reports.py
check_in_progress_reports.py
py
1,276
python
en
code
6
github-code
6
[ { "api_name": "os.environ.setdefault", "line_number": 4, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 4, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "li...
1601092211
__author__ = "Meet Dave" __version__ = "1.0" __maintainer__ = "Meet Dave" __email__ = "meetkirankum@umass.edu" # Load libraries import matplotlib.pyplot as plt import torch import cv2 import numpy as np from torchvision import models from torchvision import transforms from make_video import make_video # Load pret...
meetdave06/random-cv-tasks
test1/test1.py
test1.py
py
2,455
python
en
code
0
github-code
6
[ { "api_name": "torchvision.models.segmentation.deeplabv3_resnet101", "line_number": 20, "usage_type": "call" }, { "api_name": "torchvision.models.segmentation", "line_number": 20, "usage_type": "attribute" }, { "api_name": "torchvision.models", "line_number": 20, "usage_t...
71904076349
from pydrive.auth import GoogleAuth from pydrive.drive import GoogleDrive gauth = GoogleAuth() gauth.LoadCredentialsFile("mycreds.txt") if gauth.credentials is None: gauth.LocalWebserverAuth() elif gauth.access_token_expired: gauth.Refresh() else: gauth.Authorize() gauth.SaveCredentialsFile("mycreds.txt") d...
gmagannaDevelop/GlcJournal
pydrive/automated_access.py
automated_access.py
py
568
python
en
code
1
github-code
6
[ { "api_name": "pydrive.auth.GoogleAuth", "line_number": 6, "usage_type": "call" }, { "api_name": "pydrive.drive.GoogleDrive", "line_number": 18, "usage_type": "call" } ]
39380382951
import datetime import jpholiday from django import template register = template.Library() # Djangoのテンプレートタグライブラリ # カスタムフィルタとして登録する @register.filter def get_dict_value(dictionary, key): return dictionary.get(key) @register.filter def append_string(dest, src): return dest + src @register.filter def get_day_...
manakamu/docker
django/Docker-Django/django_project/pole/templatetags/pole_tags.py
pole_tags.py
py
1,141
python
ja
code
0
github-code
6
[ { "api_name": "django.template.Library", "line_number": 5, "usage_type": "call" }, { "api_name": "django.template", "line_number": 5, "usage_type": "name" }, { "api_name": "datetime.date", "line_number": 25, "usage_type": "call" }, { "api_name": "jpholiday.is_holi...
37964221731
import sys import os import random from PIL import Image ''' Simple image carver. Right now it will assemble any and all JPEGS found including partial fragmented files. It does not find the rest of the file. You must have pillow installed. You can do that by `pip install pillow`. YOU MUST HAVE PYTHON 3 NOT 2! THE Pi...
steviekong/Jpeg_carver
carver.py
carver.py
py
3,434
python
en
code
1
github-code
6
[ { "api_name": "sys.argv", "line_number": 13, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.stat", "line_number": 24, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 63,...
41254027126
from copy import copy, deepcopy from itertools import izip from burrahobbit.util import all SENTINEL = object() SHIFT = 5 BMAP = (1 << SHIFT) - 1 BRANCH = 2 ** SHIFT MAXBITMAPDISPATCH = 16 def relevant(hsh, shift): """ Return the relevant part of the hsh on the level shift. """ return hsh >> shift & BMAP ...
fmayer/burrahobbit
burrahobbit/_tree.py
_tree.py
py
17,423
python
en
code
8
github-code
6
[ { "api_name": "burrahobbit.util.all", "line_number": 99, "usage_type": "call" }, { "api_name": "itertools.izip", "line_number": 99, "usage_type": "call" }, { "api_name": "itertools.izip", "line_number": 102, "usage_type": "call" }, { "api_name": "copy.copy", "...
39463837440
# Standard library imports import serial import time import sys import zerorpc import datetime # Application library imports from MySQLhandler import * import Utility SCRIPT_NAME = "RFIDhandler" TIME_BEFORE_ACTIVATION = 60 * 5 print("Initialize serial connection with Arduino") try: s = serial.Serial('/dev/ttyAC...
jeremyalbrecht/Alarm-RPI
RFIDhandler.py
RFIDhandler.py
py
2,490
python
en
code
0
github-code
6
[ { "api_name": "serial.Serial", "line_number": 18, "usage_type": "call" }, { "api_name": "Utility.launch_fatal_process_alert", "line_number": 22, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 23, "usage_type": "call" }, { "api_name": "sys.exit"...
38049723382
import sys import os import yaml import json CUSTOM_WORD_LIST_FILENAME = '.wordlist.txt' def find_wordlist_files(path): wordlist_paths = [] for root, dirs, files in os.walk(path): for file in files: if file.endswith(CUSTOM_WORD_LIST_FILENAME): wordlist_paths.append(os.path....
actions-marketplace-validations/jordanbean-msft_wth-spell-check-action
generate-spellcheck.py
generate-spellcheck.py
py
1,153
python
en
code
0
github-code
6
[ { "api_name": "os.walk", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 17, ...
29059896663
import imageio import torch import torch.nn.functional as F import numpy as np import os, argparse os.environ["CUDA_VISIBLE_DEVICES"] = "0" from net.bgnet import Net from utils.tdataloader import test_dataset parser = argparse.ArgumentParser() parser.add_argument('--testsize', type=int, default=416, help='testing size...
thograce/BGNet
etest.py
etest.py
py
1,718
python
en
code
57
github-code
6
[ { "api_name": "os.environ", "line_number": 6, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 10, "usage_type": "call" }, { "api_name": "net.bgnet.Net", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.load", ...
21141233312
import datetime import json import os import time import pandas as pd import requests from mystockdata import config, db from mystockdata.db import DatetimeIndexMixin, PrefixedDfDb from mystockdata.exceptions import HistoryDataError class ShSeDb(DatetimeIndexMixin, PrefixedDfDb): prefix = 'sh_se_' class CybSe...
onecans/my
mystockdata/mystockdata/se.py
se.py
py
9,831
python
en
code
2
github-code
6
[ { "api_name": "mystockdata.db.DatetimeIndexMixin", "line_number": 14, "usage_type": "name" }, { "api_name": "mystockdata.db.PrefixedDfDb", "line_number": 14, "usage_type": "name" }, { "api_name": "mystockdata.db.DatetimeIndexMixin", "line_number": 18, "usage_type": "name"...
2088974749
"""@namespace IMP.pmi.restraints.proteomics Restraints for handling various kinds of proteomics data. """ from __future__ import print_function import IMP import IMP.core import IMP.algebra import IMP.atom import IMP.container import IMP.pmi import IMP.pmi.tools import IMP.pmi.output import numpy import math import sy...
salilab/pmi
pyext/src/restraints/proteomics.py
proteomics.py
py
23,746
python
en
code
12
github-code
6
[ { "api_name": "IMP.atom.create_connectivity_restraint", "line_number": 41, "usage_type": "call" }, { "api_name": "IMP.atom", "line_number": 41, "usage_type": "attribute" }, { "api_name": "IMP.RestraintSet", "line_number": 44, "usage_type": "call" }, { "api_name": ...
3962586718
import sys import os import random import matplotlib.pyplot as plt from typing import List BASE_FILENAME="develop" OUTPUT_TYPE="png" def create_pie_chart(keywords: List[str], base_filename: str, output_type: str): data = [] explode = [] biggest_value = 0 biggest_iterator = 0 for i, _ in enumerate...
neilschark/bullshitgraphs
bullshitgraphs/bullshitgraphs.py
bullshitgraphs.py
py
1,675
python
en
code
1
github-code
6
[ { "api_name": "typing.List", "line_number": 10, "usage_type": "name" }, { "api_name": "random.randint", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 27, "usage_type": "call" }, { "api_name": "matplotlib.pypl...
42440314481
import plotly.express as px import plotly.graph_objs as go import pandas as pd from sklearn.decomposition import PCA import numpy as np #****************** Récupération des données CSV ************************# df = pd.read_csv("https://simplonline-v3-prod.s3.eu-west-3.amazonaws.com/media/file/csv/be67fa74-2c34-419...
AbdiNi/Plotly-Dash
Dash_Plotly/My_dataset.py
My_dataset.py
py
4,007
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "plotly.express.scatter", "line_number": 46, "usage_type": "call" }, { "api_name": "plotly.express", "line_number": 46, "usage_type": "name" }, { "api_name": "plotly.graph_ob...
2053821942
from config import dogs_and_cats_config as config from pyimagesearch.preprocessing import ImageToArrayPreprocessor, MeanPreprocessor, CropPreprocessor from pyimagesearch.io import HDF5DatasetGenerator from keras.models import load_model import progressbar import json import numpy as np import cv2 import argparse import...
lykhahaha/Mine
PractitionerBundle/chapter10-dogs_vs_cats/crop_accuracy_public_test.py
crop_accuracy_public_test.py
py
1,859
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 18, "usage_type": "call" }, { "api_name": "config.dogs_and_cats_config.DATASET_MEAN", "line_number": 18, "usage_type": "attribute" }, { "...
962892446
from tkinter import * from tkinter.messagebox import showinfo import pandas as pd import numpy as np import sklearn as sk from sklearn.linear_model import LinearRegression import matplotlib.pyplot as plt # function call def cal(): data = pd.read_csv("2a.csv") if (var1.get()=='123'): showinf...
Santonu-Naskar/Rainfall-Prediction
rainfall/main/main1.py
main1.py
py
3,959
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "tkinter.messagebox.showinfo", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 14, "usage_type": "call" }, { "api_name": "tkinter....
30950837477
def D0(fp): Dt = 1 taur = 1./(3*Dt) return fp**2*taur/2. def rms(fp,ts): Dt = 1 taur = 1./(3*Dt) d = 2 tts = ts*1e-5 return 4*Dt*tts+fp**2*taur**2/(d*(d-1))*(2*d*tts/taur+np.exp(-2*d*tts/taur)-1) def swim(fp,rho): Dt = 1 taur = 1./(3*Dt) return rho*fp*fp*taur/2.0...
samueljmcameron/ABPs_coarse_graining
experiments/2020_03_31/no_interactions_pressure/single_pressure.py
single_pressure.py
py
1,818
python
en
code
0
github-code
6
[ { "api_name": "sys.path.append", "line_number": 31, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 31, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 33, "usage_type": "call" }, { "api_name": "sys.path", "line_nu...
73279162747
import numpy as np import matplotlib.pyplot as plt # system variables fs = 100e3 f = 1e3 phi = np.pi/4 N = 4*fs/f n_var = 0.01 # create some empty vectors to fill x = np.zeros(N, dtype=complex) n_a = np.zeros(N, dtype=complex) e = np.zeros(N) w = np.zeros(N) y = np.zeros(N, dtype=complex) y_ = np.zero...
yrrapt/ada-comms
sinusoid_estimate_noise.py
sinusoid_estimate_noise.py
py
1,012
python
en
code
0
github-code
6
[ { "api_name": "numpy.pi", "line_number": 7, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number":...
30192351629
import numpy as np import matplotlib.pyplot as plt from sklearn.metrics import accuracy_score from sklearn.model_selection import train_test_split from sklearn.datasets import load_iris iris = load_iris() X = iris.data y = iris.target def sigmoid(inX):# 定义sigmoid函数 return 1.0/(1+np.exp(-inX)) def std_da...
TJPU-ML/Homework-for-the-fall-semester-of-2018
iris classification/王熙煚/lris.py
lris.py
py
2,416
python
en
code
0
github-code
6
[ { "api_name": "sklearn.datasets.load_iris", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.zeros", "lin...
12242514248
#!/usr/bin/env python from rootpy import ROOT from rootpy.io import File from rootpy.tree import Tree from collections import deque def find_maintenance(filename): aux_file = File(filename, 'read') aux_tree = aux_file.get('t_hk_obox') maintenance_start = False maintenance_list = [] gps_time_list =...
ZhenghengLi/POLAR_DATA
Preprocessing/script/split_time.py
split_time.py
py
2,130
python
en
code
2
github-code
6
[ { "api_name": "rootpy.io.File", "line_number": 9, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 32, "usage_type": "call" }, { "api_name": "rootpy.io.File", "line_number": 34, "usage_type": "call" } ]
18446576990
from django.conf import settings from django.contrib import messages from django.http import HttpResponseRedirect from allauth.account import signals from allauth.account.adapter import DefaultAccountAdapter class AccountAdapter(DefaultAccountAdapter): def is_open_for_signup(self, request): return getatt...
epicserve/django-base-site
apps/accounts/auth_adapter.py
auth_adapter.py
py
1,443
python
en
code
284
github-code
6
[ { "api_name": "allauth.account.adapter.DefaultAccountAdapter", "line_number": 9, "usage_type": "name" }, { "api_name": "django.conf.settings", "line_number": 11, "usage_type": "argument" }, { "api_name": "django.http.HttpResponseRedirect", "line_number": 18, "usage_type":...
6166850776
# -*- coding: utf-8 -*- """ Created on Tue Jun 6 16:06:45 2017 @author: Francesco """ import threading import sys import serial import numpy as np import time import matplotlib.pyplot as plt global PORT global BAUD global NUM_CHANNELS global END_BUNDLE_BYTE global BYTE_PER_CHANNEL global BUNDLE...
FrancesoM/UnlimitedHand-Learning
python_side/multithread.py
multithread.py
py
5,210
python
en
code
1
github-code
6
[ { "api_name": "threading.Thread", "line_number": 48, "usage_type": "attribute" }, { "api_name": "threading.Thread.__init__", "line_number": 51, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 51, "usage_type": "attribute" }, { "api_name": ...
16270189491
import pymysql import datetime def insert(outsideTemp, insideTemp, targetTemp, fanState): sql = "INSERT INTO FANS ( `time`, `outside_temp`, `inside_temp`, `target_temp`, `fan_state`) " sql += "VALUES ( \"{0}\", {1}, {2}, {3}, {4})".format(datetime.datetime.now(), outsideTemp, insideTemp, targetTemp, fanState) ...
scottware/fans
database.py
database.py
py
1,653
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pymysql.connect", "line_number": 8, "usage_type": "call" }, { "api_name": "pymysql.con...
73700516027
import os, time, gc import numpy as np import gym import random from gym import spaces from gym.utils import seeding from screeninfo import get_monitors import pybullet as p from .agents.objects import Object from .util import Util from .agents.agent import Agent class BaseEnv(gym.Env): def __init__(self, time_s...
gabriansa/collaborative-gym
collaborative_gym/envs/base_env.py
base_env.py
py
20,082
python
en
code
0
github-code
6
[ { "api_name": "gym.Env", "line_number": 14, "usage_type": "attribute" }, { "api_name": "pybullet.connect", "line_number": 27, "usage_type": "call" }, { "api_name": "pybullet.DIRECT", "line_number": 27, "usage_type": "attribute" }, { "api_name": "util.Util", "l...
40633067575
from django.urls import path from .views import ( add_to_cart, delete_from_cart, order_details, checkout, update_transaction_records, success ) app_name = 'cart' urlpatterns = [ path('^add-to-cart/<int:pk>/<slug:slug>/', add_to_cart, name="add_to_cart"), path('^order-summary/', order_d...
sadakchap/cfe-ecom
cart/urls.py
urls.py
py
662
python
en
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 14, "usage_type": "call" }, { "api_name": "views.add_to_cart", "line_number": 14, "usage_type": "argument" }, { "api_name": "django.urls.path", "line_number": 15, "usage_type": "call" }, { "api_name": "views.order_d...
16647141836
import os import pandas as pd import numpy as np from tqdm.auto import tqdm from textaugment import EDA from nltk.tokenize import word_tokenize class DataProcessing: def __init__(self, input_path, output_path): self.input_path = input_path self.output_path = output_path self.X = None ...
marynadorosh/test_task
src/data/make_dataset.py
make_dataset.py
py
2,626
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.vstack", "line_numbe...
41682530680
"""add directory id to address Revision ID: 19e625982be8 Revises: a9adfd3c2eba Create Date: 2018-02-02 23:11:03.395662 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql # revision identifiers, used by Alembic. revision = '19e625982be8' down_revision = 'a9adfd3c2eba' branch...
MondayHealth/provider-import
alembic/versions/19e625982be8_add_directory_id_to_address.py
19e625982be8_add_directory_id_to_address.py
py
973
python
en
code
0
github-code
6
[ { "api_name": "alembic.op.add_column", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 21, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer...
8099648005
import pandas as pd import pydotplus from IPython.display import Image from sklearn import metrics from sklearn.externals.six import StringIO from sklearn.model_selection import train_test_split from sklearn.tree import DecisionTreeClassifier, export_graphviz # nazwy wszystkich kolumn z CSV column_names = ['Elevation'...
fedoruka/fct_classification
main.py
main.py
py
2,347
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 21, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 29, "usage_type": "call" }, { "api_name": "sklearn.tree.DecisionTreeClassifier", "line_number": 32, "usage_type": "call" ...
26625188476
from django.conf import settings from django.core import urlresolvers from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render_to_response from django.template import RequestContext from django.utils.translation import ugettext_lazy as _ from product.modules.downloadable.models imp...
dokterbob/satchmo
satchmo/apps/product/modules/downloadable/views.py
views.py
py
4,066
python
en
code
30
github-code
6
[ { "api_name": "re.compile", "line_number": 16, "usage_type": "call" }, { "api_name": "django.utils.translation.ugettext_lazy", "line_number": 26, "usage_type": "call" }, { "api_name": "product.modules.downloadable.models.DownloadLink.objects.get", "line_number": 29, "usag...
8101165169
import requests import json from config import keys class ConvertionException(Exception): pass class CryptoConverter: @staticmethod def get_price(quote: str, base: str, amount: str): if quote == base: raise ConvertionException(f'Вы ввели одинаковые валюты {base}.') ...
voxvt/botexam
utils.py
utils.py
py
1,270
python
ru
code
0
github-code
6
[ { "api_name": "config.keys", "line_number": 16, "usage_type": "name" }, { "api_name": "config.keys", "line_number": 21, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 30, "usage_type": "call" }, { "api_name": "json.loads", "line_number": ...
21712175054
# -*- coding: utf-8 -*- from django.core.management.base import BaseCommand, CommandError from optparse import make_option from ...scraper import Scrap class Command(BaseCommand): option_list = BaseCommand.option_list + (make_option( '--url', action='store', dest='url', help='Sub...
jms/FlyNi-API
flyni_api/flyni/management/commands/get_data.py
get_data.py
py
500
python
en
code
0
github-code
6
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 9, "usage_type": "name" }, { "api_name": "django.core.management.base.BaseCommand.option_list", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.core.management.base.BaseCommand", "li...
37176092039
import numpy as np import cv2 # Check available mouse events available with opencv library # events = [i for i in dir(cv2) if 'EVENT' in i] # print(events) # General Callback function used for handling mouse events def click_event(event, x, y, flags, param): # Show x and y coordinate if event == cv2.EVENT_LB...
sbhrwl/object_detection
src/opencv/mouse_events/handle_mouse_event.py
handle_mouse_event.py
py
1,226
python
en
code
0
github-code
6
[ { "api_name": "cv2.EVENT_LBUTTONDOWN", "line_number": 12, "usage_type": "attribute" }, { "api_name": "cv2.FONT_HERSHEY_SIMPLEX", "line_number": 14, "usage_type": "attribute" }, { "api_name": "cv2.putText", "line_number": 16, "usage_type": "call" }, { "api_name": "...
70968292347
import cv2 import numpy as numpy import os detector = cv2.CascadeClassifier('haarcascade_frontalface_alt.xml') recognizer = cv2.face.LBPHFaceRecognizer_create() recognizer.read("trainer/trainer.yml") font = cv2.FONT_HERSHEY_SIMPLEX id = 0 name = ['none', 'Godswill', 'Ebere', 'Godswill', 'handle'] cap = cv2.VideoCap...
awesomegusS/cv
recognizer.py
recognizer.py
py
1,158
python
en
code
0
github-code
6
[ { "api_name": "cv2.CascadeClassifier", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.face.LBPHFaceRecognizer_create", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.face", "line_number": 6, "usage_type": "attribute" }, { "api_name": "c...
74796405626
import torch import torchvision from torch import nn from torch.nn import Sequential, Conv2d, MaxPool2d, Flatten, Linear from torch.utils.data import DataLoader from torch.utils.tensorboard import SummaryWriter train_dataset = torchvision.datasets.CIFAR10(root="../dataset_CIFAR10", train=True, download=True, ...
ccbit1997/pytorch_learning
src/cifar10_model.py
cifar10_model.py
py
1,591
python
en
code
0
github-code
6
[ { "api_name": "torchvision.datasets.CIFAR10", "line_number": 8, "usage_type": "call" }, { "api_name": "torchvision.datasets", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torchvision.transforms.ToTensor", "line_number": 9, "usage_type": "call" }, { ...
72226014269
from flask import Flask from flask_sqlalchemy import SQLAlchemy import os import datetime from sqlalchemy.dialects.postgresql import ARRAY app = Flask(__name__) SECRET_KEY = os.urandom(32) app.config['SECRET_KEY'] = SECRET_KEY app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///db.sqlite" app.config['RECAPTCHA_USE_S...
dananguyenucsb/ithinkihavecovid-19
model.py
model.py
py
1,606
python
en
code
1
github-code
6
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "os.urandom", "line_number": 11, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 22, "usage_type": "call" }, { "api_name": "datetime.datetime",...
27513964476
# -*- coding: utf-8 -*- import os import sys import io import math def synthesize_asic_entity(yosys_location, yosys_synth_script, target_cell, entity_name, timing_constraint, synthesis_output_folder): # Check if folder exists, and if not create if(not os.path.isdir(synthesis_output_folder)): os.mkdir(...
tintin10q/subterranean2digital
Reference_code/verilog_project/yosys_synth/synth.py
synth.py
py
11,689
python
en
code
0
github-code
6
[ { "api_name": "os.path.isdir", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number"...
10423167833
from __future__ import annotations import dataclasses from random import Random from unittest.mock import MagicMock import pytest from randovania.game_description.game_patches import GamePatches from randovania.game_description.resources.pickup_index import PickupIndex from randovania.game_description.resources.reso...
randovania/randovania
test/games/prime2/generator/test_echoes_bootstrap.py
test_echoes_bootstrap.py
py
3,634
python
en
code
165
github-code
6
[ { "api_name": "randovania.game_description.resources.pickup_index.PickupIndex", "line_number": 21, "usage_type": "call" }, { "api_name": "randovania.game_description.resources.pickup_index.PickupIndex", "line_number": 22, "usage_type": "call" }, { "api_name": "randovania.game_des...
74725395066
from datetime import datetime from pynamodb.models import Model from pynamodb.attributes import UnicodeAttribute, NumberAttribute, UTCDateTimeAttribute from flask_blog.lib.utils import is_production import os class Entry(Model): class Meta: table_name = "serverless_blog_entries" region = 'ap-north...
uni51/serverless_python_tutorial
application/flask_blog/models/entries.py
entries.py
py
1,030
python
en
code
0
github-code
6
[ { "api_name": "pynamodb.models.Model", "line_number": 8, "usage_type": "name" }, { "api_name": "flask_blog.lib.utils.is_production", "line_number": 13, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 14, "usage_type": "call" }, { "api_name":...
37430288968
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' name: 票友机票预订系统10处SQL注入 referer: http://www.wooyun.org/bugs/wooyun-2010-0118867 author: Lucifer description: multi sqli。 ''' import sys import requests class piaoyou_ten_sqli_BaseVerify: def __init__(self, url): self.url = url def run(self): h...
iceyhexman/onlinetools
scanner/plugins/cms/piaoyou/piaoyou_ten_sqli.py
piaoyou_ten_sqli.py
py
1,575
python
en
code
1,626
github-code
6
[ { "api_name": "requests.get", "line_number": 35, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 44, "usage_type": "attribute" } ]
8385237281
from __future__ import absolute_import from __future__ import print_function import os import sys from argparse import ArgumentParser if 'SUMO_HOME' in os.environ: sys.path.append(os.path.join(os.environ['SUMO_HOME'], 'tools')) import sumolib # noqa def get_options(args=None): parser = ArgumentParser(descr...
ngctnnnn/DRL_Traffic-Signal-Control
sumo-rl/sumo/tools/turn-defs/turnFile2EdgeRelations.py
turnFile2EdgeRelations.py
py
1,716
python
en
code
17
github-code
6
[ { "api_name": "os.environ", "line_number": 8, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_n...
26824633032
import matplotlib.pyplot as plt import scipy import scipy.interpolate import sys sys.path.append('/home/faustian/python/adas/xxdata_13/') from matplotlib import rc import adasread rc('text', usetex=True) rc('font',**{'family':'serif','serif':['Computer Modern Roman']}) #rc('font',**{'family':'sans-serif','sans-serif'...
icfaust/Misc
analyzeSXB.py
analyzeSXB.py
py
3,468
python
en
code
0
github-code
6
[ { "api_name": "sys.path.append", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "matplotlib.rc", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.rc", "line_n...