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
20154443994
from datetime import datetime # needed to read and compare dates class item: # initiates item class for all inventory elements def __init__(self, itemID=0, manuF='none', itemT='none', itemP=0.0, serv=datetime.today(), dmg='False'): self.itemID = itemID self.manuF = manuF self.it...
BrittanyZimmerman/CIS2348
FinalProject - Part 1/FinalProjectPart1.py
FinalProjectPart1.py
py
5,756
python
en
code
0
github-code
36
[ { "api_name": "datetime.datetime.today", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 6, "usage_type": "name" }, { "api_name": "csv.reader", "line_number": 27, "usage_type": "call" }, { "api_name": "csv.reader", "...
31944141020
"""empty message Revision ID: 0e84780c08ce Revises: Create Date: 2023-06-25 00:48:55.259558 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '0e84780c08ce' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands auto gene...
yinsont/lit-crypts
server/migrations/versions/0e84780c08ce_.py
0e84780c08ce_.py
py
1,792
python
en
code
3
github-code
36
[ { "api_name": "alembic.op.create_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy.Integ...
70446469223
""" East Text detection """ import cv2 import numpy as np from imutils.object_detection import non_max_suppression from cfir_game_lens.utils import Box, GameCoverImage, ImageSize from dataclasses import astuple class EAST: # pylint: disable=too-few-public-methods """East Class """ LAYER_NAMES = ["featur...
CfirTsabari/cfir_game_lens
cfir_game_lens/east.py
east.py
py
3,836
python
en
code
0
github-code
36
[ { "api_name": "cv2.dnn.readNet", "line_number": 22, "usage_type": "call" }, { "api_name": "cv2.dnn", "line_number": 22, "usage_type": "attribute" }, { "api_name": "cfir_game_lens.utils.GameCoverImage", "line_number": 25, "usage_type": "name" }, { "api_name": "cfir...
23781717999
#!/usr/bin/env python3 import gym from gym import wrappers import gym_gazebo import time import numpy import random import time import qlearn import liveplot from matplotlib import pyplot as plt def render(): render_skip = 0 # Skip first X episodes. render_interval = 50 # Show render Every Y episodes. ...
mjohal67/ENPH353_Lab06_Reinforcement
examples/gazebo_lab06_ex/gazebo_lab06_ex.py
gazebo_lab06_ex.py
py
4,089
python
en
code
0
github-code
36
[ { "api_name": "gym.make", "line_number": 30, "usage_type": "call" }, { "api_name": "gym.wrappers.Monitor", "line_number": 33, "usage_type": "call" }, { "api_name": "gym.wrappers", "line_number": 33, "usage_type": "attribute" }, { "api_name": "liveplot.LivePlot", ...
43249592224
from django.shortcuts import render from articles.models import Article def articles_list(request): template = 'articles/news.html' acricles = Article.objects.all().prefetch_related('scopes') ordering = '-published_at' context = {'object_list': acricles.order_by(ordering)} return render(request, ...
StickKing/netology-dj-homeworks
2.2-databases-2/m2m-relations/articles/views.py
views.py
py
339
python
en
code
0
github-code
36
[ { "api_name": "articles.models.Article.objects.all", "line_number": 8, "usage_type": "call" }, { "api_name": "articles.models.Article.objects", "line_number": 8, "usage_type": "attribute" }, { "api_name": "articles.models.Article", "line_number": 8, "usage_type": "name" ...
43301294024
from rpython.rlib.rarithmetic import r_singlefloat, r_uint from rpython.rtyper.lltypesystem import lltype, rffi from rpython.translator.tool.cbuild import ExternalCompilationInfo r_uint32 = rffi.r_uint assert r_uint32.BITS == 32 UINT32MAX = 2 ** 32 - 1 # keep in sync with the C code in pypy__decay_jit_counters below...
mozillazg/pypy
rpython/jit/metainterp/counter.py
counter.py
py
13,442
python
en
code
430
github-code
36
[ { "api_name": "rpython.rtyper.lltypesystem.rffi.r_uint", "line_number": 6, "usage_type": "attribute" }, { "api_name": "rpython.rtyper.lltypesystem.rffi", "line_number": 6, "usage_type": "name" }, { "api_name": "rpython.rtyper.lltypesystem.lltype.Struct", "line_number": 11, ...
75107100903
from pyrogram import Client, Filters, InlineKeyboardMarkup, InlineKeyboardButton, Emoji from config import Messages as tr @Client.on_message(Filters.private & Filters.incoming & Filters.command(['start'])) async def _start(client, message): await client.send_message(chat_id = message.chat.id, text = tr.STA...
cdfxscrq/GDrive-Uploader-TG-Bot
plugins/help.py
help.py
py
2,093
python
en
code
83
github-code
36
[ { "api_name": "config.Messages.START_MSG.format", "line_number": 7, "usage_type": "call" }, { "api_name": "config.Messages.START_MSG", "line_number": 7, "usage_type": "attribute" }, { "api_name": "config.Messages", "line_number": 7, "usage_type": "name" }, { "api_...
12028416507
# -*- coding: utf-8 -*- import re from django.utils import simplejson as json from django.db import connection from psycopg2.extensions import adapt, register_adapter, AsIs, new_type, register_type from .adapt import ADAPT_MAPPER rx_circle_float = re.compile(r'<\(([\d\.\-]*),([\d\.\-]*)\),([\d\.\-]*)>') rx_line = re...
cr8ivecodesmith/django-orm-extensions-save22
django_orm/postgresql/geometric/objects.py
objects.py
py
8,366
python
en
code
0
github-code
36
[ { "api_name": "re.compile", "line_number": 10, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 11, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 12, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 13, ...
24257764446
"""Find out how to 'clear the board' in Pyramid Solitaire. The design is meant to be simple to understand so it is less likely to have bugs, but to make Pyramid Solitaire solvable for the worst case scenarios, we must do a bit of optimization work on the state representation. This implementation skips all of the prec...
mchung94/solitaire-player
pysolvers/solvers/pyramid.py
pyramid.py
py
11,173
python
en
code
37
github-code
36
[ { "api_name": "solvers.deck.deck.card_rank", "line_number": 22, "usage_type": "call" }, { "api_name": "solvers.deck.deck", "line_number": 22, "usage_type": "attribute" }, { "api_name": "solvers.deck", "line_number": 22, "usage_type": "name" }, { "api_name": "colle...
18873931268
from flask import Blueprint, request, abort from models.dota.item import DotaItem from api.dota.validators import all_items_schema items_route = Blueprint("items", __name__, url_prefix="/items") @items_route.route("/<int:item_id>") def get_item_by_id(item_id: int): item = DotaItem.query.filter_by(id=item_id).on...
NeKadgar/game_market_items_base
api/dota/items.py
items.py
py
1,111
python
en
code
0
github-code
36
[ { "api_name": "flask.Blueprint", "line_number": 6, "usage_type": "call" }, { "api_name": "models.dota.item.DotaItem.query.filter_by", "line_number": 11, "usage_type": "call" }, { "api_name": "models.dota.item.DotaItem.query", "line_number": 11, "usage_type": "attribute" ...
14919658167
__copyright__ = """ Copyright 2017 FireEye, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law ...
fireeye/brocapi
brocapi/brocapi_syslog.py
brocapi_syslog.py
py
2,466
python
en
code
27
github-code
36
[ { "api_name": "datetime.datetime.today", "line_number": 39, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 39, "usage_type": "attribute" }, { "api_name": "logging.info", "line_number": 44, "usage_type": "call" }, { "api_name": "socket.so...
1121900442
import asyncio import logging import os from time import time import aiohttp logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') logger = logging.getLogger(__name__) async def read_text_file(directory, file): """ Async version of the download_link method we...
suganyamuthukumar/python
TestfileIOAsync.py
TestfileIOAsync.py
py
1,603
python
en
code
0
github-code
36
[ { "api_name": "logging.basicConfig", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 8, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "os.chdir", "...
8385871532
from django.db import models, connection from django.db.models import Q, Max, Case, Value, When, Exists, OuterRef, \ UniqueConstraint, Subquery from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.core.cache import cache from django.core.exceptions import FieldErro...
johncronan/formative
formative/models/formative.py
formative.py
py
40,781
python
en
code
4
github-code
36
[ { "api_name": "utils.MarkdownFormatter", "line_number": 31, "usage_type": "call" }, { "api_name": "django.db.models.Manager", "line_number": 34, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 34, "usage_type": "name" }, { "api_name":...
37486401663
from itertools import product from random import choice from time import sleep from os import system from math import floor from colorama import Back, Fore, Style ################################################################################ # Simulation of Conway's Game of Life. The goal here was to write this with...
tvl-fyi/depot
users/wpcarro/scratch/data_structures_and_algorithms/conways-game-of-life.py
conways-game-of-life.py
py
2,666
python
en
code
0
github-code
36
[ { "api_name": "math.floor", "line_number": 22, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 24, "usage_type": "call" }, { "api_name": "itertools.product", "line_number": 33, "usage_type": "call" }, { "api_name": "colorama.Back.GREEN", ...
33693604036
from __future__ import print_function import argparse import torch import torch.utils.data from torch import optim from torch import nn from torch.utils.data import DataLoader from gensim.models import KeyedVectors import os import numpy as np from collections import OrderedDict from multiprocessing import cpu_count ...
dnddnjs/pytorch-svae
train.py
train.py
py
5,776
python
en
code
1
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 36, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 36, "usage_type": "attribute" }, { "api_name": "torch...
10202065384
import os import math import numpy as np import shutil import cv2 from colormath.color_conversions import * from colormath.color_objects import * from sklearn.manifold import TSNE import json from similarity_measurer import SimilarityMeasurer from color_palette import ColorPalette from geo_sorter_helper impo...
Xiaozhxiong/Palette-Sorting
expriment_6.py
expriment_6.py
py
6,551
python
en
code
0
github-code
36
[ { "api_name": "os.path.exists", "line_number": 42, "usage_type": "call" }, { "api_name": "os.path", "line_number": 42, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 43, "usage_type": "call" }, { "api_name": "os.path.exists", "line_nu...
73917552423
import scipy.io import pylab import numpy from math import * import scipy.misc import scipy.sparse import sys import time import matplotlib.ticker #import HCIL_model # make sure this model accounts for alignments etc from matplotlib import pyplot as plt import socket import time from InitializationPY import * from EKF_...
HeSunPU/FPWCmatlab
EKF.py
EKF.py
py
6,852
python
en
code
2
github-code
36
[ { "api_name": "numpy.concatenate", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.real", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.imag", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.eye", "line_number"...
4855275955
#!/usr/bin/python # -*- coding: utf-8 -* from fabric.api import * from fabric.context_managers import * from fabric.contrib.console import confirm from fabric.contrib.files import * from fabric.contrib.project import rsync_project import fabric.operations import time,os import logging import base64 from getpass import ...
zzlyzq/speeding
funcs/cdh.py
cdh.py
py
9,909
python
en
code
1
github-code
36
[ { "api_name": "json.loads", "line_number": 48, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 65, "usage_type": "call" } ]
70176885225
# imports from sklearn.pipeline import Pipeline from sklearn.compose import ColumnTransformer from TaxiFareModel.encoders import TimeFeaturesEncoder, DistanceTransformer from sklearn.linear_model import LinearRegression from sklearn.preprocessing import StandardScaler, OneHotEncoder from TaxiFareModel.utils import comp...
lamothearthur/TaxiFareModel
TaxiFareModel/trainer.py
trainer.py
py
2,701
python
en
code
0
github-code
36
[ { "api_name": "sklearn.pipeline.Pipeline", "line_number": 24, "usage_type": "call" }, { "api_name": "TaxiFareModel.encoders.DistanceTransformer", "line_number": 25, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.StandardScaler", "line_number": 26, "usage_typ...
74867967785
from data_loader import * from plotter import * from utils import * import netCDF4 as nc import argparse import pandas as pd from tkinter import * # TODO: Add gui....eventually # import customtkinter # # customtkinter.set_appearance_mode('system') # root = customtkinter.CTk() # root.geometry('300x400') # button = cus...
sauriemma11/GOES-SOSMAG-Mag-Subtraction
src/main.py
main.py
py
6,243
python
en
code
0
github-code
36
[ { "api_name": "netCDF4.Dataset", "line_number": 37, "usage_type": "call" }, { "api_name": "netCDF4.Dataset", "line_number": 45, "usage_type": "call" }, { "api_name": "netCDF4.Dataset", "line_number": 53, "usage_type": "call" }, { "api_name": "argparse.ArgumentPars...
70525087465
import socket import sys import logging logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) # Create a TCP/IP socket sock = socket.socket (socket.AF_INET, socket.SOCK_STREAM) # Connect the socket to the port where the server is listening server_address = ('localhost', 5000) logging.info ('connecting to {} por...
Des-Tello/ArquiSW
services/visualizacion_personal.py
visualizacion_personal.py
py
2,142
python
en
code
0
github-code
36
[ { "api_name": "logging.basicConfig", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 5, "usage_type": "attribute" }, { "api_name": "logging.DEBUG", "line_number": 5, "usage_type": "attribute" }, { "api_name": "socket.socket", ...
28814194209
import os import glob import logging import numbers import numpy as np import pandas as pd from ast import literal_eval from django.conf import settings from ..utils.custom_decorator import where_exception from ..data_preprocess.preprocess_base import PreprocessorBase logger = logging.getLogger("collect_log_helper") ...
IoTKETI/citydatahub_analytics_module
ANALYTICS_MODULE/API/services/model_batch/batch_helper.py
batch_helper.py
py
8,017
python
en
code
1
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "data_preprocess.preprocess_base.PreprocessorBase", "line_number": 32, "usage_type": "name" }, { "api_name": "django.conf.settings.ANALYTICS_MANAGER_NFS", "line_number": 41, "usage...
19258065891
from openpyxl import load_workbook class doExcel(): def __init__(self,file_path,sheet_name): self.file_path=file_path self.sheet_name=sheet_name self.wb=load_workbook(self.file_path) self.sh=self.wb[self.sheet_name] #获取当前sheet最大的行数 self.row_max=self.sh.max_row ...
DXH20191016/untitled
test_interface_auto/common/doExcel.py
doExcel.py
py
1,429
python
en
code
0
github-code
36
[ { "api_name": "openpyxl.load_workbook", "line_number": 8, "usage_type": "call" } ]
24349509747
import os import json from flask import Flask, request, send_file, jsonify from picamera2 import Picamera2, Preview import time from PIL import Image picam2 = Picamera2() camera_config = picam2.create_still_configuration(main={"size": (256, 256)}) picam2.set_controls({"ExposureTime": 5000}) picam2.configure(camera_con...
felzmatt/visiope-project
raspberry-stack/sensor-server/main.py
main.py
py
2,697
python
en
code
0
github-code
36
[ { "api_name": "picamera2.Picamera2", "line_number": 8, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 17, "usage_type": "call" }, { "api_name": "PIL.Image.FLIP_TOP_BOTTOM",...
31518451112
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import logging import base64 import hmac import hashlib import json from urllib import parse from urllib import request from datetime import datetime # timeout in 5 seconds: TIMEOUT = 5 API_HOST = 'be.huobi.com' SCHEME = 'https' # language setting: 'zh-CN', 'en': LAN...
szhu3210/Arbitrage-trader
legacy/huobi_eth_client.py
huobi_eth_client.py
py
15,614
python
en
code
5
github-code
36
[ { "api_name": "json.dumps", "line_number": 83, "usage_type": "call" }, { "api_name": "urllib.request.Request", "line_number": 89, "usage_type": "call" }, { "api_name": "urllib.request", "line_number": 89, "usage_type": "name" }, { "api_name": "urllib.request.urlop...
74517025384
#!/usr/bin/env pythonimport coliche, os import bn.bn def bn2dot(bnfile, outfile, vdfile=None, loners=False, center=None, awfile=None): # give None to outfile to get string back dotbuffer = [] bns = bn.bn.load(bnfile, False) varc = bns.varc arcs = bns.arcs() names = vdfile \ ...
tomisilander/bn
bn/util/bn2dot.py
bn2dot.py
py
1,917
python
en
code
1
github-code
36
[ { "api_name": "bn.bn.bn.load", "line_number": 10, "usage_type": "call" }, { "api_name": "bn.bn.bn", "line_number": 10, "usage_type": "attribute" }, { "api_name": "bn.bn", "line_number": 10, "usage_type": "name" } ]
39776686649
import sqlite3 import pandas as pd import urllib.request import xml.etree.ElementTree as et from installations_type_json import Installation_type_json from installations_type_xml import Installation_type_xml from installation import Instalation from recherche import Recherche from patinoire import Patinoire from glissa...
alioudiallo224/Restfull-API-in-python
database.py
database.py
py
13,259
python
fr
code
0
github-code
36
[ { "api_name": "sqlite3.connect", "line_number": 21, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 34, "usage_type": "call" }, { "api_name": "urllib.request.request.urlopen", "line_number": 47, "usage_type": "call" }, { "api_name": "urllib...
73171895785
""" Date: 2019.07.04 Programmer: DH Description: About System Manager Report Generator """ import pandas as pd import matplotlib.pyplot as plt from PIL import Image class ReportGenerator: """ To get information about age, emotion, factor from data_set, and make a chart from data_set. """...
Im-Watching-You/SELab-Smart-Mirror
DH/report.py
report.py
py
12,685
python
en
code
0
github-code
36
[ { "api_name": "pandas.DataFrame", "line_number": 132, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 175, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 199, "usage_type": "call" }, { "api_name": "matplot...
36896145879
import struct import dns.rdata import dns.rdatatype class SSHFP(dns.rdata.Rdata): """SSHFP record @ivar algorithm: the algorithm @type algorithm: int @ivar fp_type: the digest type @type fp_type: int @ivar fingerprint: the fingerprint @type fingerprint: string @see: draft-ietf-secsh-d...
RMerl/asuswrt-merlin
release/src/router/samba-3.6.x/lib/dnspython/dns/rdtypes/ANY/SSHFP.py
SSHFP.py
py
2,129
python
en
code
6,715
github-code
36
[ { "api_name": "dns.rdata.rdata", "line_number": 6, "usage_type": "attribute" }, { "api_name": "dns.rdata", "line_number": 6, "usage_type": "name" }, { "api_name": "dns.rdata.rdata._hexify", "line_number": 29, "usage_type": "call" }, { "api_name": "dns.rdata.rdata"...
13151184850
import numpy as np from scipy.optimize import fmin_bfgs from MILpy.functions.noisyORlossWeights import noisyORlossWeights from MILpy.functions.noisyORlossAlphas import noisyORlossAlphas from MILpy.functions.traindecstump import traindecstump class MILBoost(object): def __init__(self): self._alpha = No...
jmarrietar/MILpy
Algorithms/MILBoost.py
MILBoost.py
py
3,049
python
en
code
18
github-code
36
[ { "api_name": "numpy.asmatrix", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.asmatrix", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.vstack", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.array", "line_nu...
36450480034
# repo originally forked from https://github.com/Confusezius/Deep-Metric-Learning-Baselines ################# LIBRARIES ############################### import warnings warnings.filterwarnings("ignore") import numpy as np, pandas as pd, copy, torch, random, os from torch.utils.data import Dataset from PIL import Imag...
Andrew-Brown1/Smooth_AP
src/datasets.py
datasets.py
py
18,924
python
en
code
193
github-code
36
[ { "api_name": "warnings.filterwarnings", "line_number": 5, "usage_type": "call" }, { "api_name": "torch.utils.data.DataLoader", "line_number": 36, "usage_type": "call" }, { "api_name": "torch.utils", "line_number": 36, "usage_type": "attribute" }, { "api_name": "t...
16753186305
import os import json import pandas as pd import numpy as np reffile = "reference.json" # errfile = "errors.json" datfile = os.path.join(".", "data", "DOHMH_New_York_City_Restaurant_Inspection_Results.csv") data = pd.read_csv(datfile, index_col=[0]) data = data.sort_index() original_cols = data.columns with o...
raokaran/rest_inspect
edav_final/merge_doh_yelp.py
merge_doh_yelp.py
py
4,213
python
en
code
0
github-code
36
[ { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "json.load", "line_numbe...
40238893115
import argparse from dotenv import load_dotenv from parse_page import Driver from pipeline import pipeline from threads import threads load_dotenv() def main(): parser = argparse.ArgumentParser( description='Download and decrypt DRM protected mpeg-dash content') parser.add_argument('--url', type=str...
vigoroous/DRMBypass
src/main.py
main.py
py
1,323
python
en
code
0
github-code
36
[ { "api_name": "dotenv.load_dotenv", "line_number": 8, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 12, "usage_type": "call" }, { "api_name": "parse_page.Driver", "line_number": 23, "usage_type": "call" }, { "api_name": "pipeline....
71073572903
import torch import torch.nn as nn import torch.nn.utils.rnn as rnn from torch.utils.data import Dataset, DataLoader, TensorDataset import torch.nn.functional as F from torch.autograd import Variable from sklearn.model_selection import train_test_split import numpy as np import time import pandas as pd import matplotl...
aymitchell/UAV-navigation
TrajectoryPrediction/train.py
train.py
py
5,926
python
en
code
7
github-code
36
[ { "api_name": "torch.device", "line_number": 27, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 27, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 27, "usage_type": "attribute" }, { "api_name": "time.ctime", ...
21885165618
""" Migration scripts """ import click from packaging.version import Version from brewblox_ctl import actions, click_helpers, const, migration, sh, utils @click.group(cls=click_helpers.OrderedGroup) def cli(): """Global command group""" def check_version(prev_version: Version): """Verify that the previous...
BrewBlox/brewblox-ctl
brewblox_ctl/commands/update.py
update.py
py
9,669
python
en
code
3
github-code
36
[ { "api_name": "click.group", "line_number": 11, "usage_type": "call" }, { "api_name": "brewblox_ctl.click_helpers.OrderedGroup", "line_number": 11, "usage_type": "attribute" }, { "api_name": "brewblox_ctl.click_helpers", "line_number": 11, "usage_type": "name" }, { ...
73750601385
import json import os import time from tqdm import tqdm from easydict import EasyDict import pandas as pd from .index_compression import restore_dict def find_pos_in_str(zi, mu): len1 = len(zi) pl = [] for each in range(len(mu) - len1): if mu[each:each + len1] == zi: # 找出与子字符串首字符相同的字符位置 ...
cuteyyt/searchEngine
miniSearchEngine/construct_engine/utils.py
utils.py
py
4,878
python
en
code
0
github-code
36
[ { "api_name": "time.time", "line_number": 38, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 43, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 49, "usage_type": "call" }, { "api_name": "time.time", "line_number": 5...
40585203716
import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable from . import common import numpy as np import pytorch_lightning as pl class CNN_Encoder(nn.Module): def __init__(self, output_size, input_size=(1, 28, 28)): super(CNN_Encoder, self).__init__() ...
BenjaminMidtvedt/SCAINCE
models/autoencoders.py
autoencoders.py
py
4,508
python
en
code
0
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 13, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.nn", "lin...
27037529813
import os import re from PIL import Image from datetime import datetime from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.timezone import now from django.utils.html import format_html from django.utils.text import slugify from filebrowser.fields import FileBrowseF...
andywar65/rpnew_base
pagine/models.py
models.py
py
11,731
python
en
code
1
github-code
36
[ { "api_name": "django.utils.timezone.now", "line_number": 20, "usage_type": "name" }, { "api_name": "django.utils.timezone.now", "line_number": 22, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 22, "usage_type": "call" }, { "api_nam...
72045581223
from collections import defaultdict puzzle = open('puzzle', 'r').read().splitlines() grid = defaultdict(str) for y in range(len(puzzle)): for x in range(len(puzzle[y])): grid[(y, x)] = puzzle[y][x] def surrounding(cords, grid): ret = [] for y in range(cords[0]-1, cords[0]+2): for x in range(cords[1]-1, cords[...
filipmlynarski/Advent-of-Code-2018
day_18/day_18_part_2.py
day_18_part_2.py
py
1,437
python
en
code
0
github-code
36
[ { "api_name": "collections.defaultdict", "line_number": 4, "usage_type": "call" } ]
13097683438
# !/usr/bin/env python # -*- coding: utf-8 -*- """ @author: lishuang @description: 基于能力描述的薪资预测 数据集:抓取了4512个职位的能力描述,薪资 Step1,数据加载 Step2,可视化,使用Networkx Step3,提取文本特征 TFIDF Step4,回归分析,使用KNN回归,朴素贝叶斯回归,训练能力和薪资匹配模型 Step5,基于指定的能力关键词,预测薪资 """ import random import re import jieba import matplotlib.pyplot as plt import networkx...
TatenLee/machine-learning
bi/core/l13/salary_prediction.py
salary_prediction.py
py
4,807
python
zh
code
1
github-code
36
[ { "api_name": "pandas.set_option", "line_number": 26, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 29, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 29, "usage_type": "name" }, { "api_name": "j...
23297695443
import pandas as pd import pathlib from model import toa datadir = pathlib.Path(__file__).parents[0].joinpath('data') def test_toa_per_region(): # we use a modified version of the silvopasture TLA data as mock TLA values sp_land_dist_all = [331.702828, 181.9634517, 88.98630743, 130.15193962, 201.18287123, ...
ProjectDrawdown/solutions
model/tests/test_toa.py
test_toa.py
py
922
python
en
code
203
github-code
36
[ { "api_name": "pathlib.Path", "line_number": 5, "usage_type": "call" }, { "api_name": "pandas.Index", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line...
43509548445
#!/usr/bin/env python3 from dialog.parser import Parser from dialog.scope import Scope from dialog.returns import Returns import dialog.link_parser import multiprocessing import json from dialog.interpreter import Dialog class Instance(Dialog): """ Dialog interperter connected with websockets. """ d...
kusha/dialog
dialog/server.py
server.py
py
6,720
python
en
code
1
github-code
36
[ { "api_name": "dialog.interpreter.Dialog", "line_number": 13, "usage_type": "name" }, { "api_name": "json.dumps", "line_number": 47, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 66, "usage_type": "call" }, { "api_name": "json.dumps", "lin...
20456988287
from django import forms from django.contrib import admin from .models import Category, Comment, Genre, Review, Title, User EMPTY = '-пусто-' class UserAdminForm(forms.ModelForm): def __init__(self, *args, **kwargs): super(UserAdminForm, self).__init__(*args, **kwargs) self.fields['password'].wi...
photometer/yamdb_final
api_yamdb/reviews/admin.py
admin.py
py
1,578
python
en
code
0
github-code
36
[ { "api_name": "django.forms.ModelForm", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 9, "usage_type": "name" }, { "api_name": "django.forms.PasswordInput", "line_number": 12, "usage_type": "call" }, { "api_name": "dja...
13330164064
import time import numpy as np import torch import pickle import warnings import torch.nn as nn import torch.nn.functional as F from torch.utils.data import Dataset from torchvision import datasets, transforms from scipy.ndimage.interpolation import rotate as scipyrotate from networks import MLP, ConvNet, LeN...
liuyugeng/baadd
DC/utils.py
utils.py
py
61,851
python
en
code
25
github-code
36
[ { "api_name": "torchvision.transforms.Compose", "line_number": 32, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 32, "usage_type": "name" }, { "api_name": "torchvision.transforms.Resize", "line_number": 32, "usage_type": "call" }, { ...
3520691800
import copy import fnmatch import logging import re from collections import namedtuple from enum import Enum from typing import Dict, Iterable, Optional, Union import yaml from meltano.core.behavior import NameEq from meltano.core.behavior.canonical import Canonical from meltano.core.behavior.hookable import HookObjec...
learningequality/meltano
src/meltano/core/plugin/base.py
base.py
py
9,638
python
en
code
1
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "enum.Enum", "line_number": 33, "usage_type": "name" }, { "api_name": "yaml.add_multi_representer", "line_number": 42, "usage_type": "call" }, { "api_name": "meltano.core.b...
6812358559
import webbrowser, os import json import boto3 import io from io import BytesIO import sys from pprint import pprint from dotenv import load_dotenv import pandas as pd load_dotenv() AWSSecretKey = os.getenv('AWSSecretKey') AWSAccessKeyId = os.getenv('AWSAccessKeyId') def get_rows_columns_map(table_result, blocks_map...
yashjhaveri05/BE-Project-2022-2023
MacroMedic/Flask/imageOCR.py
imageOCR.py
py
7,500
python
en
code
0
github-code
36
[ { "api_name": "dotenv.load_dotenv", "line_number": 11, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 13, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 14, "usage_type": "call" }, { "api_name": "boto3.client", "line_numbe...
19424192217
# -*- coding: utf-8 -*- """ Created on Sun Dec 13 17:05:23 2020 @author: Ruo-Yah Lai """ import matplotlib.pyplot as plt import numpy as np import csv import ast def spikePlots(turns, unit, subfield, filename, df, title=""): """ turns: from alleyTransitions filename: the file with which locations a fiel...
whock3/ratterdam
Ruo-Yah's weekly/121320.py
121320.py
py
1,809
python
en
code
0
github-code
36
[ { "api_name": "csv.reader", "line_number": 21, "usage_type": "call" }, { "api_name": "ast.literal_eval", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.empty", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.vstack", "line_numb...
31626333564
import os import bs4 from nltk.corpus.reader.api import CorpusReader from nltk.corpus.reader.api import CategorizedCorpusReader import nltk import time from sklearn.feature_extraction.text import TfidfVectorizer import pandas as pd from sklearn.feature_extraction import text from nltk import sent_tokenize from nltk imp...
kyle1213/data-mining
html_to_vector.py
html_to_vector.py
py
13,987
python
en
code
0
github-code
36
[ { "api_name": "nltk.corpus.reader.api.CategorizedCorpusReader", "line_number": 32, "usage_type": "name" }, { "api_name": "nltk.corpus.reader.api.CorpusReader", "line_number": 32, "usage_type": "name" }, { "api_name": "nltk.corpus.reader.api.CategorizedCorpusReader.__init__", ...
33543687487
from django.contrib import admin from .models import Quiz, Category, Question, Answer, UserAnswers @admin.register(Category) class CategoryAdmin(admin.ModelAdmin): """ Модель категорий для вывода в админ панели. """ list_display = ('id', 'category_name', 'created_at') list_display_links = ('id', ...
Kagoharo/QuizSite
Quiz/quizlet/admin.py
admin.py
py
1,915
python
en
code
0
github-code
36
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 6, "usage_type": "name" }, { "api_name": "django.contrib.admin.register", "line_number": 5, "usage_type": "call" }, { ...
75118121702
""" Objet Contact représentant un contact de l'Annuaire Author: Tristan Colombo <tristan@gnulinuxmag.com> (@TristanColombo) Date: 17-12-2015 Last modification: 17-12-2015 Licence: GNU GPL v3 (voir fichier gpl_v3.txt joint) """ import sqlite3 import pystache import o...
GLMF/GLMF190
Dev/interface_CLI/etape_2/Contact.py
Contact.py
py
4,342
python
en
code
0
github-code
36
[ { "api_name": "sqlite3.OperationalError", "line_number": 79, "usage_type": "attribute" }, { "api_name": "sqlite3.OperationalError", "line_number": 112, "usage_type": "attribute" }, { "api_name": "pystache.render", "line_number": 134, "usage_type": "call" }, { "api...
74512115622
import cv2 import numpy as np import matplotlib.pyplot as plt img1 = cv2.imread('shanghai-11.png') img2 = cv2.imread('shanghai-12.png') img3 = cv2.imread('shanghai-13.png') plt.figure(1) plt.subplot(131), plt.imshow(img1, cmap='gray'), plt.title("Image 1") plt.subplot(132), plt.imshow(img2, cmap='gray'), pl...
costinchican/computer_vision
App2/app2.py
app2.py
py
8,599
python
en
code
0
github-code
36
[ { "api_name": "cv2.imread", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_nu...
73497184104
import importlib import io import math import os import typing from enum import Enum import discord import humanize from discord.ext import commands from jishaku.functools import executor_function from PIL import Image import common.image_utils as image_utils import common.utils as utils class ImageCMDs(commands.Co...
AstreaTSS/Seraphim-Bot
cogs/general/cmds/image_cmds.py
image_cmds.py
py
13,117
python
en
code
1
github-code
36
[ { "api_name": "discord.ext.commands.Cog", "line_number": 18, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 18, "usage_type": "name" }, { "api_name": "common.utils.SeraphimBase", "line_number": 22, "usage_type": "attribute" }, { ...
43131754181
from concurrent.futures import ThreadPoolExecutor,ProcessPoolExecutor,as_completed,wait from concurrent import futures import time import requests # 官方文档:https://docs.python.org/zh-cn/3.8/library/concurrent.futures.html#module-concurrent.futures urls = ['http://www.tencent.com','http://www.google.com/','http://www.ku...
melody27/python_script
thread_process_futures/concurrent.futures_test.py
concurrent.futures_test.py
py
2,510
python
zh
code
0
github-code
36
[ { "api_name": "time.time", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "concurrent.futures.ThreadPoolExecutor", "line_number": 19, "usage_type": "call" }, { "api_name": "concurre...
14484717443
import cv2 as cv import numpy as np left_window = 'Task 4 - left' right_window = 'Task 4 - right' # create window for left camera cv.namedWindow(left_window) # create window for right camera cv.namedWindow(right_window) # read in imagaes img_l = cv.imread('imgs/combinedCalibrate/aL09.bmp') img_r = cv.imread('imgs...
mjhaskell/EE_631
HW3/task4.py
task4.py
py
1,954
python
en
code
0
github-code
36
[ { "api_name": "cv2.namedWindow", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.namedWindow", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 14, "usage_type": "call" }, { "api_name": "cv2.imread", "line_numb...
2805625238
import pandas as pd import scipy import pylab import numpy as np from statsmodels.formula.api import OLS from easydev import Progress, AttrDict from gdsctools.stats import MultipleTesting from gdsctools import readers from gdsctools.boxplots import BoxPlots from gdsctools.settings import ANOVASettings from gdsctools...
Oncology/gdsctools
gdsctools/anova.py
anova.py
py
47,168
python
en
code
null
github-code
36
[ { "api_name": "gdsctools.readers.IC50", "line_number": 95, "usage_type": "call" }, { "api_name": "gdsctools.readers", "line_number": 95, "usage_type": "name" }, { "api_name": "gdsctools.readers.GenomicFeatures", "line_number": 109, "usage_type": "call" }, { "api_n...
16775198576
from rest_framework.decorators import api_view, permission_classes from rest_framework import generics from lembaga.models import Lembaga, Institusi, Tema from lembaga.serializers import LembagaSerializer, InstitusiSerializer, TemaSerializer from rest_framework.permissions import AllowAny from rest_framework.response i...
ferenica/sipraktikum-backend
lembaga/views.py
views.py
py
2,986
python
en
code
0
github-code
36
[ { "api_name": "rest_framework.viewsets.ModelViewSet", "line_number": 11, "usage_type": "attribute" }, { "api_name": "rest_framework.viewsets", "line_number": 11, "usage_type": "name" }, { "api_name": "rest_framework.decorators.permission_classes", "line_number": 12, "usag...
31848452342
import numpy as np import pandas as pd import pandas.testing as pdt import pytest from cod_analytics.classes import TransformReference from cod_analytics.math.homography import Homography, HomographyCorrection class TestHomography: xy_bounds = (-1, 1) xy_corners = [ [-1, -1], [1, -1], ...
cesaregarza/CoD-Analytics
tests/test_homography.py
test_homography.py
py
11,028
python
en
code
0
github-code
36
[ { "api_name": "numpy.pi", "line_number": 27, "usage_type": "attribute" }, { "api_name": "numpy.random.RandomState", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 32, "usage_type": "attribute" }, { "api_name": "numpy.vstack...
6380032523
from functools import partial import chex import jax import numpy as np import numpy.testing as npt from absl.testing import parameterized from tessellate_ipu import tile_map, tile_put_replicated from tessellate_ipu.lax import scatter_add_p, scatter_max_p, scatter_mul_p, scatter_p class IpuTilePrimitivesLaxScater(c...
graphcore-research/tessellate-ipu
tests/lax/test_tile_lax_scatter.py
test_tile_lax_scatter.py
py
2,847
python
en
code
10
github-code
36
[ { "api_name": "chex.TestCase", "line_number": 13, "usage_type": "attribute" }, { "api_name": "absl.testing.parameterized.TestCase", "line_number": 13, "usage_type": "attribute" }, { "api_name": "absl.testing.parameterized", "line_number": 13, "usage_type": "name" }, {...
28799587509
import json import os import pickle import numpy as np from pprint import pprint winningRuns, losingRuns, cards, relics, X, Y = None, None, None, None, None, None cwd = os.path.dirname(__file__) pathToData = os.path.join(cwd, '..', 'Data') #Parses the wins and loses from the dump file def loadFromFile(winsPath, ...
kenttorell/MLFinal_StS
Code/LoadData.py
LoadData.py
py
4,299
python
en
code
0
github-code
36
[ { "api_name": "os.path.dirname", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9...
23507472501
# implementing pymoo multi-objective optimization with FEniCS FEA objectives import numpy as np import matplotlib.pyplot as plt from matplotlib.offsetbox import TextArea, DrawingArea, OffsetImage, AnnotationBbox import pathlib from pathlib import Path from pymoo.core.problem import ElementwiseProblem from pymoo.algor...
grohalex/Project2023
Python/main.py
main.py
py
7,557
python
en
code
0
github-code
36
[ { "api_name": "pymoo.core.problem.ElementwiseProblem", "line_number": 27, "usage_type": "name" }, { "api_name": "numpy.zeros", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.su...
6913776937
# -*- coding: utf-8 -*- """ Created on Tue Aug 24 19:55:28 2021 @author: jon-f """ import numpy as np import matplotlib.pyplot as plt import os from skimage.transform import resize def binary_array_to_hex(arr): bit_string = ''.join(str(int(b)) for b in arr.flatten()) width = int(np.ceil(len(bit_string)/4)) retur...
triviajon/jonbot
to_hash_thing.py
to_hash_thing.py
py
2,180
python
en
code
0
github-code
36
[ { "api_name": "numpy.ceil", "line_number": 16, "usage_type": "call" }, { "api_name": "skimage.transform.resize", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.zeros", "li...
6280612969
import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import datetime as dt from datetime import datetime #%config InlineBackend.figure_format = 'retina' #%matplotlib inline #%% path='C:/Users/Mr.Goldss/Desktop/health care digital ticket EDA/' filename='7_23_2020 Faci...
zjin311/MaricopaWorkLog
health care digital ticket EDA/python models/seaborn viz center.py
seaborn viz center.py
py
10,947
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_excel", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 95, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 95, "usage_type": "name" }, { "api_name": "seabor...
73495691624
import pygame as pg import ChessEngine import os from itertools import cycle from copy import deepcopy pg.init() pg.mixer.init() ROOT_DIR = os.path.dirname(__file__) IMAGE_DIR = os.path.join(ROOT_DIR, 'images') WIDTH = HEIGHT = 512 DIMENSION = 8 SQ_SIZE = HEIGHT // 8 MAX_FPS = 15 IMAGES = {} WHITE = (215,215,215) BLAC...
GracjanPW/Chess
Chess/ChessMain.py
ChessMain.py
py
4,586
python
en
code
0
github-code
36
[ { "api_name": "pygame.init", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.mixer.init", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.mixer", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "l...
129847267
from django.shortcuts import render, get_object_or_404 from .models import Post, Category, User from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from taggit.models import Tag from django.db.models import Count from django.utils import timezone def post_list(request, tag_slug=None): posts =...
open-apprentice/ellieplatform-website
blog/views.py
views.py
py
2,992
python
en
code
1
github-code
36
[ { "api_name": "models.Post.objects.filter", "line_number": 10, "usage_type": "call" }, { "api_name": "models.Post.objects", "line_number": 10, "usage_type": "attribute" }, { "api_name": "models.Post", "line_number": 10, "usage_type": "name" }, { "api_name": "model...
25047674881
import torch from torch import nn import os import argparse import torch.utils.data as data from torch import optim from torch.autograd import Variable import torchvision.transforms as transforms import tqdm import numpy as np import random from tensorboardX import SummaryWriter from datetime import datetime import dat...
YJZFlora/Gun_Violence_Data_Mining
main.py
main.py
py
9,601
python
en
code
0
github-code
36
[ { "api_name": "tensorboardX.SummaryWriter", "line_number": 20, "usage_type": "call" }, { "api_name": "torchvision.transforms.Compose", "line_number": 22, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 22, "usage_type": "name" }, { "...
24788288939
from typing import List """ Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. A subarray is a contiguous part of an array. """ class Solution: def maxSubArray(self, nums: List[int]) -> int: dp = [nums[0]] # res...
inhyeokJeon/AALGGO
Python/LeetCode/dp/53_maximum_subarr.py
53_maximum_subarr.py
py
680
python
en
code
0
github-code
36
[ { "api_name": "typing.List", "line_number": 10, "usage_type": "name" } ]
72769207784
from __future__ import absolute_import, division, print_function, unicode_literals import os import csv import sys import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers import matplotlib.pyplot as plt import tensorflow_docs.plots import pandas as pd print(tf.version.VERSION) column...
kotrotskon/iBKs_regration
Main.py
Main.py
py
8,398
python
en
code
1
github-code
36
[ { "api_name": "tensorflow.version", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 51, "usage_type": "call" }, { "api_name": "os.path", ...
27141705447
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2018/11/22 12:54 # @Author : Ryu # @Site : # @File : yibu.py # @Software: PyCharm import asyncio,aiohttp import time import requests async def f1(url): async with aiohttp.ClientSession() as session: async with session.get(url) as resp: ...
yuzhema/crawer
day08/yibu.py
yibu.py
py
805
python
en
code
0
github-code
36
[ { "api_name": "aiohttp.ClientSession", "line_number": 14, "usage_type": "call" }, { "api_name": "time.clock", "line_number": 21, "usage_type": "call" }, { "api_name": "time.clock", "line_number": 23, "usage_type": "call" }, { "api_name": "requests.get", "line_...
38622940273
"""Platform for sensor integration.""" import logging from datetime import datetime from .const import ( DOMAIN, MODEM_GATEWAY, EVT_MODEM_CONNECTED, EVT_MODEM_DISCONNECTED, EVT_LTE_CONNECTED, EVT_LTE_DISCONNECTED, SENSOR_LASTUPD ) from homeassistant.components.binary_sensor import ( ...
vladkozlov69/homeassistant_modem
binary_sensor.py
binary_sensor.py
py
5,944
python
en
code
1
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 22, "usage_type": "call" }, { "api_name": "homeassistant.components.binary_sensor.BinarySensorEntity", "line_number": 47, "usage_type": "name" }, { "api_name": "const.EVT_MODEM_DISCONNECTED", "line_number": 59, "usage_type...
34701767455
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('login', '0002_usuario_nome'), ] operations = [ migrations.RenameField( model_name='usuario', old_nam...
andersonfantini/example-django-social-login
login/migrations/0003_auto_20150213_1520.py
0003_auto_20150213_1520.py
py
380
python
en
code
1
github-code
36
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.RenameField", "line_number": 14, "usage_type": "call" }, ...
3746638257
# Standard Library import argparse import os class EnvDefault(argparse.Action): """ Helper for the CLI argparse to allow setting defaults through environment variables Usage: In an argparse argument, set the Action to this class. Add the extra variable envvar added that has the name of the environ...
abnamro/repository-scanner
components/resc-vcs-scanner/src/vcs_scanner/helpers/env_default.py
env_default.py
py
1,071
python
en
code
137
github-code
36
[ { "api_name": "argparse.Action", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 18, "usage_type": "attribute" } ]
1048912505
import torch from torch import nn class down_conv(nn.Module): def __init__(self, in_ch, out_ch): super(down_conv, self).__init__() self.conv = nn.Sequential( nn.Conv2d(in_ch, out_ch, 3, 1, 1), nn.ReLU(), nn.Conv2d(out_ch, out_ch, 3, 1, 1), nn.ReLU() ...
lembolov9/u-net-torch
model.py
model.py
py
2,331
python
en
code
0
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 5, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.nn", "line_n...
13960662339
from django.contrib.auth.decorators import login_required from django.shortcuts import render, redirect from django.views.decorators.cache import never_cache from helfertool.utils import nopermission from registration.permissions import has_access, ACCESS_CORONA_VIEW, ACCESS_CORONA_EDIT from registration.utils import ...
helfertool/helfertool
src/corona/views/helper.py
helper.py
py
2,339
python
en
code
52
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "registration.utils.get_or_404", "line_number": 21, "usage_type": "call" }, { "api_name": "registration.permissions.has_access", "line_number": 24, "usage_type": "call" }, { ...
40520294015
from pprint import pprint from functools import reduce from collections import defaultdict data = [l.strip() for l in open("input.txt","r").readlines()] pprint(data) # part 1 # vowels = ["a","e","i","o","u"] # forbidden = ["ab", "cd", "pq", "xy"] # nice = 0 # for line in data: # vows = sum([1 for ch in line if ch...
archanpatkar/advent2015
Day-05/sol.py
sol.py
py
955
python
en
code
0
github-code
36
[ { "api_name": "pprint.pprint", "line_number": 6, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 22, "usage_type": "call" } ]
17066369564
import pandas as pd from sklearn.linear_model import LinearRegression '''dealing with the data''' def preprocessing(country): rows = data.loc[(data['countriesAndTerritories'] == country)] x = rows['dateRep'].iloc[::-1].reset_index(drop=True) for i in range(x.size): x[i] = i size = x.si...
Amy-Liao/COVID-19-Forecast
model.py
model.py
py
1,577
python
en
code
0
github-code
36
[ { "api_name": "sklearn.linear_model.LinearRegression", "line_number": 25, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 42, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 47, "usage_type": "call" } ]
73488488423
from requests import get from scrapy import Selector response = get("https://fr.wikipedia.org/wiki/Guerre_d%27Alg%C3%A9rie") source = None if response.status_code == 200 : source = response.text if source : selector = Selector(text=source) titles = selector.css("div.toc ul > li") for title in titles...
LexicoScrap/scrap_test
scrap_test_one.py
scrap_test_one.py
py
484
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 5, "usage_type": "call" }, { "api_name": "scrapy.Selector", "line_number": 11, "usage_type": "call" } ]
40584544669
import sys from catchException import exception_handler from requests.adapters import HTTPAdapter from urllib3.util.retry import Retry from requests import ReadTimeout, ConnectTimeout, HTTPError, Timeout, ConnectionError import pandas as pd import os # import requests # import urllib3 ## handle exception properly ##...
adderbyte/finos_viz
dataValuation.py
dataValuation.py
py
4,312
python
en
code
0
github-code
36
[ { "api_name": "sys.excepthook", "line_number": 15, "usage_type": "attribute" }, { "api_name": "catchException.exception_handler", "line_number": 15, "usage_type": "name" }, { "api_name": "urllib3.util.retry.Retry", "line_number": 58, "usage_type": "call" }, { "api...
43068200237
import time from datetime import datetime import webbrowser from PySide2.QtSvg import QSvgRenderer from PySide2.QtCore import Qt, QSize, QRect, QPoint from PySide2.QtGui import QIcon, QPixmap, QColor, QPainter, QImage, QMouseEvent, QFont, QFontMetrics, QPen, QBrush from PySide2.QtWidgets import QMainWindow, Q...
Noboxxx/selectionEditor
ui.py
ui.py
py
23,323
python
en
code
0
github-code
36
[ { "api_name": "PySide2.QtWidgets.QApplication.desktop", "line_number": 22, "usage_type": "call" }, { "api_name": "PySide2.QtWidgets.QApplication", "line_number": 22, "usage_type": "name" }, { "api_name": "maya.OpenMayaUI.MQtUtil.mainWindow", "line_number": 26, "usage_type...
42600271957
import openpyxl import os, string, sys from lib import l DIRS_SOCIUM = ['/media/da3/asteriskBeagleAl/Socium/2017/', '/media/da3/asteriskBeagleAl/Socium/2018/'] def isSNILS(snils): if snils != None: t = str(snils).replace('\n',' ').replace(' ', ' ').replace(' ', ' ').replace(' ', ' ').strip() if...
dekarh/asocium
asocium_loaded.py
asocium_loaded.py
py
6,570
python
en
code
0
github-code
36
[ { "api_name": "string.digits", "line_number": 26, "usage_type": "attribute" }, { "api_name": "string.digits", "line_number": 45, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 59, "usage_type": "call" }, { "api_name": "os.listdir", "li...
10138616258
""" called as optimal_model_search.py $TMPDIR $PACKAGEDIR $NPROC $PATTERNDIR $OUTDIR """ import sys import itertools import logging import numpy as np import pandas as pd import pyarrow as pa import pyarrow.parquet as pq from pathlib import Path from sklearn.ensemble import RandomForestClassifier from sklearn.metrics ...
chiemvs/Weave
hpc/inspect_models.py
inspect_models.py
py
5,840
python
en
code
2
github-code
36
[ { "api_name": "pathlib.Path", "line_number": 17, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 17, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 18, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number"...
73424751784
import json from nose.tools import ok_, eq_, assert_is_not_none try: from mock import Mock, patch except ImportError: from unittest.mock import Mock, patch try: from httplib import OK except: from http.client import OK from uuid import uuid4 from time import sleep from config import * from applicat...
belodetek/unzoner-api
src/tests/utils_tests.py
utils_tests.py
py
4,279
python
en
code
3
github-code
36
[ { "api_name": "application.application.testing", "line_number": 29, "usage_type": "attribute" }, { "api_name": "application.application", "line_number": 29, "usage_type": "name" }, { "api_name": "application.application.test_client", "line_number": 30, "usage_type": "call...
73118929704
import os import tempfile class WrapStrToFile: def __init__(self): # здесь инициализируется атрибут filepath, он содержит путь до файла-хранилища self._filepath = tempfile.mktemp() print(self._filepath) @property def content(self): try: with open(self._filepath...
IlyaOrlov/PythonCourse2.0_September23
Practice/mtroshin/Lecture_7/3.py
3.py
py
1,099
python
ru
code
2
github-code
36
[ { "api_name": "tempfile.mktemp", "line_number": 8, "usage_type": "call" }, { "api_name": "os.remove", "line_number": 26, "usage_type": "call" } ]
30395131421
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Mar 20 21:29:31 2021 @author: skibbe """ import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.multiprocessing as mp #from . import tools as tls from pw import tools as tls import math #mp.set_start_method(...
febrianrachmadi/BIA_ATLAS2
deep_patchwork/pw/batch_mat.py
batch_mat.py
py
4,678
python
en
code
1
github-code
36
[ { "api_name": "torch.float32", "line_number": 25, "usage_type": "attribute" }, { "api_name": "torch.tensor", "line_number": 30, "usage_type": "call" }, { "api_name": "torch.float32", "line_number": 32, "usage_type": "attribute" }, { "api_name": "torch.tensor", ...
42243580740
import numpy as np import matplotlib.pyplot as plt import bead_util as bu save_dir = '/processed_data/spinning/pramp_data/20190626/outgassing/' files, lengths = bu.find_all_fnames(save_dir, ext='.txt') times = [] rates = [] for filename in files: file_obj = open(filename, 'rb') lines = file_obj.readline...
charlesblakemore/opt_lev_analysis
scripts/spinning/plot_outgassing_analysis.py
plot_outgassing_analysis.py
py
645
python
en
code
1
github-code
36
[ { "api_name": "bead_util.find_all_fnames", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.argsort", ...
16109071350
import requests authors = ['John Donne', 'George Herbert', 'Andrew Marvell', 'Richard Crashaw', 'Henry Vaughan', 'Anne Bradstreet', 'Katherine Philips', 'Sir John Suckling', 'Edward Taylor'] # authors = ['William Shakespeare'] titles = [] #prohibited_punctuation = [',', ';', ' ', '"'] prohibited_punctuation = [' ', '...
canzhiye/metaphysical-poetry-generator
poetry_grabber.py
poetry_grabber.py
py
983
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 13, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 21, "usage_type": "call" } ]
71749898023
#! /usr/local/bin/python3 """ Currently active courses that have the WRIC attribute. """ import sys from datetime import datetime # For curric db access import psycopg2 from psycopg2.extras import NamedTupleCursor # CGI stuff -- with debugging import cgi import cgitb from pprint import pprint cgitb.enable(display=0, ...
cvickery/senate-curriculum
Approved_Courses/writing_intensive.py
writing_intensive.py
py
1,695
python
en
code
0
github-code
36
[ { "api_name": "cgitb.enable", "line_number": 15, "usage_type": "call" }, { "api_name": "psycopg2.connect", "line_number": 20, "usage_type": "call" }, { "api_name": "psycopg2.extras.NamedTupleCursor", "line_number": 21, "usage_type": "name" }, { "api_name": "dateti...
2187178006
import numpy as np from scipy.spatial.distance import cdist from scipy.optimize import linprog from functools import partial import itertools def sparse_jump(Y, n_states, max_features, jump_penalty=1e-5, max_iter=10, tol=1e-4, n_init=10, verbose=False): # Implementation of sparse jump model n_o...
Yizhan-Oliver-Shu/continuous-jump-model
regime/.ipynb_checkpoints/sparse_jump-checkpoint.py
sparse_jump-checkpoint.py
py
11,123
python
en
code
3
github-code
36
[ { "api_name": "numpy.clip", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.repeat", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 12...
2628241264
from datetime import timedelta from pathlib import Path import environ import os env = environ.Env() BASE_DIR = Path(__file__).resolve().parent.parent DEBUG = env.bool("DJANGO_DEBUG", True) SECRET_KEY = os.getenv( "DJANGO_KEY", default="django-insecure-c1@)8!=axenuv@dc*=agcinuw+-$tvr%(f6s9^9p9pf^7)w+_b", ) #...
mohamedsamiromar/family-tree
family_tree/settings/base.py
base.py
py
3,990
python
en
code
0
github-code
36
[ { "api_name": "environ.Env", "line_number": 6, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 8, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_numbe...
35862806433
import datetime import pytest from lizaalert.users.models import UserRole @pytest.fixture def user(django_user_model): return django_user_model.objects.create_user(username="TestUser", password="1234567", email="test@test.com") @pytest.fixture def user_2(django_user_model): return django_user_model.object...
Studio-Yandex-Practicum/lizaalert_backend
src/tests/user_fixtures/user_fixtures.py
user_fixtures.py
py
1,978
python
en
code
7
github-code
36
[ { "api_name": "pytest.fixture", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pytest.fixture", "line_number": 13, "usage_type": "attribute" }, { "api_name": "rest_framework_simplejwt.tokens.RefreshToken.for_user", "line_number": 22, "usage_type": "call" ...
73094876263
import numpy as np import matplotlib.pyplot as plt from pathlib import Path from PIL import Image from skimage import io, morphology, measure import pandas as pd class LabelFieldOperations: def __init__(self, labelVol): self.labelVol = labelVol def MaskLabels(self, mask): print('masking inc...
lcubelongren/ElephantTrunkMuscles
VolumeOperations.py
VolumeOperations.py
py
3,323
python
en
code
0
github-code
36
[ { "api_name": "numpy.where", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.isin", "line_number": ...
11089039079
import yaml import praw import time def connect_to_reddit(config): reddit = praw.Reddit(username=config["auth"]["username"], password=config["auth"]["password"], user_agent=config["auth"]["user_agent"], client_id=config["auth"]["client_id"]...
nouveaupg/mass_dm
broadcast_dm.py
broadcast_dm.py
py
2,255
python
en
code
1
github-code
36
[ { "api_name": "praw.Reddit", "line_number": 6, "usage_type": "call" }, { "api_name": "praw.exceptions", "line_number": 16, "usage_type": "attribute" }, { "api_name": "time.sleep", "line_number": 29, "usage_type": "call" }, { "api_name": "yaml.safe_load", "line...
7690140597
from collections import defaultdict class Graph: def __init__(self, vertices): self.V = vertices self.graph = defaultdict(list) def addEdge(self, v, w): self.graph[v].append(w) self.graph[w].append(v) def isCyclicUtil(self, v, visited, parent): visited[v] = T...
thisisshub/DSA
Q_graphs/problems/detecting_cycle/A_in_the_undirected_graph.py
A_in_the_undirected_graph.py
py
1,144
python
en
code
71
github-code
36
[ { "api_name": "collections.defaultdict", "line_number": 9, "usage_type": "call" } ]
34377485430
""" The :py:mod:`~ahk.script` module, most essentially, houses the :py:class:`~ahk.ScriptEngine` class. The :py:class:`~ahk.ScriptEngine` is responsible for rendering autohotkey code from jinja templates and executing that code. This is the heart of how this package works. Every other major component either inherits f...
Frankushima/LeagueAccountManager
ahk/script.py
script.py
py
7,406
python
en
code
1
github-code
36
[ { "api_name": "ahk.utils.make_logger", "line_number": 21, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 34, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 34, "usage_type": "attribute" }, { "api_name": "shutil.which", ...
8254311544
import numpy as np import pygame from sys import exit #Initializing Parameters pygame.init() displayInfo = pygame.display.Info() screenWidth = displayInfo.current_w screenHeight = displayInfo.current_h display_surface = pygame.display.set_mode((screenWidth, screenHeight-50), pygame.RESIZABLE) pygame.display.set_capt...
bfelson/Python-Game-Engine
engine.py
engine.py
py
4,993
python
en
code
0
github-code
36
[ { "api_name": "pygame.init", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.display.Info", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pygame.display.set_m...
70108688104
import yt import matplotlib import matplotlib.pyplot as plt import numpy as np import unyt from unyt import cm, s # 9 different simulations with a few snapshots: # NIF_hdf5_plt_cnt_0* #frames = [000,125,250,275,300,32,350,375,425] ds = yt.load('/scratch/ek9/ccf100/nif/turb_foam_gamma_5_3_3d_1024_50mu_bubbles/NIF_hdf5...
dcollins4096/p68c_laser
script1.py
script1.py
py
2,199
python
en
code
0
github-code
36
[ { "api_name": "yt.load", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 45, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 46, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 4...
18423321387
import torch from torch import nn import pytorch_lightning as pl from transformers import AutoTokenizer import os import pandas as pd import numpy as np from config import CONFIG class CommonLitDataset(torch.utils.data.Dataset): def __init__(self, df): self.df = df self.full_text_tokens = df['fu...
alexeyevgenov/Kaggle_CommonLit-Evaluate_Student_Summaries
code/dataset.py
dataset.py
py
2,348
python
en
code
0
github-code
36
[ { "api_name": "torch.utils", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.tensor", "line_number": 26, "usage_type": "call" }, { "api_name": "torch.float32", "line_number": 26, "usage_type": "attribute" }, { "api_name": "pytorch_lightning.Li...
39047349636
'''Tests for the classification module.''' import pytest import torch import torch.nn as nn from torch.utils.data import TensorDataset, DataLoader from sklearn.model_selection import train_test_split from torchutils.classification import Classification @pytest.fixture(params=[1, 10]) def data_num_features(request):...
joseph-nagel/torchutils
tests/test_classification.py
test_classification.py
py
2,598
python
en
code
0
github-code
36
[ { "api_name": "pytest.fixture", "line_number": 12, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 17, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.manual_seed", ...
3023655025
import os from PIL import Image import PIL.ImageOps import argparse import torchvision as V import matplotlib.pyplot as plt import ujson as json import glob import re from . import configs import rich from rich.progress import track console = rich.get_console() def cifar10_burst(dest: str, split: str): assert(spli...
cdluminate/MyNotes
rs/2022-veccls/veccls/cifar10.py
cifar10.py
py
1,809
python
en
code
0
github-code
36
[ { "api_name": "rich.get_console", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_num...
32341335567
#!/usr/bin/env python ''' Here we create a 7 shell module, plot its cross section, and plot a 3D representation. Note: the 3D representation uses polygons to construct the module shells (but within the software, the shells are constructed mathematically to have perfect curvature). Created on Aug 15, 2011 @author: ...
humatic/foxsi-optics-sim
examples/example1.py
example1.py
py
1,040
python
en
code
0
github-code
36
[ { "api_name": "foxsisim.module.Module", "line_number": 24, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 27, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 27, "usage_type": "name" }, { "api_name": "mat...
3336257171
from __future__ import print_function import os.path from googleapiclient.discovery import build from google_auth_oauthlib.flow import InstalledAppFlow from google.auth.transport.requests import Request from google.oauth2.credentials import Credentials import requests import time import pandas as pd import json from pp...
ur2136/DrinkEasy
CodeBase/BackEnd/Pre-Processing Scripts/googleplaces.py
googleplaces.py
py
7,915
python
en
code
0
github-code
36
[ { "api_name": "os.path.path.exists", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 26, "usage_type": "attribute" }, { "api_name": "os.path", "line_number": 26, "usage_type": "name" }, { "api_name": "google.oauth2.credentia...