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
28965526131
from flask import jsonify, make_response, request from flask_jwt_extended import jwt_required from flask_restx import Namespace, Resource from main.modules.projects.controller import ProjectsController from main.modules.projects.schema_validator import AddProjectSchema, UpdateProjectSchema,AddUserAccessSchema, RemoveU...
anirudh9260/file_sharing_project
main/modules/projects/view.py
view.py
py
4,483
python
en
code
0
github-code
6
[ { "api_name": "flask_restx.Resource", "line_number": 11, "usage_type": "name" }, { "api_name": "flask_jwt_extended.jwt_required", "line_number": 12, "usage_type": "call" }, { "api_name": "main.modules.auth.controller.AuthUserController.get_current_auth_user", "line_number": 1...
30489526760
import numpy as np import os import sys import glob cur_dir = os.path.abspath(os.path.dirname(__file__)) sys.path.append(os.path.abspath(".")) from static import variable from static import graph_var from domain.loader.result_obj import ResultObject def load_result_obj(_pose, _recover, _quality): result_obj = []...
Fusroda-h/ppl
utils/pose/load_result_text.py
load_result_text.py
py
3,599
python
en
code
3
github-code
6
[ { "api_name": "os.path.abspath", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.path.append", "line...
33355320944
""" Entry point for run server application """ import os from flask import Flask from flask_migrate import Migrate def create_app(test_config=None): # Initialize and setup Flask app app = Flask(__name__, instance_relative_config=True) db_uri = os.getenv("DATABASE_URI", os.path.join(app.instance_path, "app...
jcardenasc93/urbanpilot
app/__init__.py
__init__.py
py
1,808
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, ...
29093042844
import os import sys # sys.path.extend([os.getcwd()]) # print(sys.path) import argparse import logging import torch import yaml from datasets.loader import build_data from tune_train import run_batch from bleu_from_csv import read_pred_refs,calculate_bleu global min_freq,batch_size,hidden_size,embedding_dim logging.bas...
rd20karim/M2T-Segmentation
src/evaluate_m2L.py
evaluate_m2L.py
py
9,471
python
en
code
1
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 14, "usage_type": "attribute" }, { "api_name": "logging.FileHandler", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.Str...
25549056551
import datetime import time import requests now = datetime.datetime.now() print(now.year) name = ("hari").title() inpt = {"name": name} response = requests.get(url='https://api.agify.io?', params=inpt) response2 = requests.get(url="https://api.genderize.io/?", params=inpt) age_data = response.json()["age"] gender_...
harisuryaa/Python-Projects
flask url/test.py
test.py
py
384
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 5, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 5, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.get"...
35266442209
import os from keras.callbacks import Callback from average_list import EverageList from matplotlib import pyplot as plt import pickle class CustomCallback(Callback): def __init__(self, chackpoint=False, file_name="chackpoint"): self.chackpoint = chackpoint self.file_name = file_name + ".pkl" ...
ondra117/lil_neuron
call_back.py
call_back.py
py
1,337
python
en
code
1
github-code
6
[ { "api_name": "keras.callbacks.Callback", "line_number": 7, "usage_type": "name" }, { "api_name": "os.path.exists", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pickle.loads", ...
73591354749
# Filename : house_views.py # Date : 2018/10/13 import os from flask import Blueprint, render_template, request, jsonify from flask_login import login_required, current_user import status_code from house.models import User, Area, Facility, House, HouseImage, Order from house.user_views import login_manager from uti...
gilgameshzzz/learn
flask5/house/house_views.py
house_views.py
py
6,241
python
en
code
0
github-code
6
[ { "api_name": "house.models", "line_number": 13, "usage_type": "name" }, { "api_name": "flask.Blueprint", "line_number": 13, "usage_type": "call" }, { "api_name": "house.models.User.query.get", "line_number": 22, "usage_type": "call" }, { "api_name": "house.models...
37419488662
import tkinter as tk from tkinter import filedialog import PyPDF2 import os def select_folder(): folder_path = filedialog.askdirectory() folder_entry.delete(0, tk.END) folder_entry.insert(0, folder_path) def process_files(): folder_path = folder_entry.get() keywords = keyword_entry.get().split('...
MasudCodes/Include-PDF
pdf_filter.py
pdf_filter.py
py
3,115
python
en
code
0
github-code
6
[ { "api_name": "tkinter.filedialog.askdirectory", "line_number": 8, "usage_type": "call" }, { "api_name": "tkinter.filedialog", "line_number": 8, "usage_type": "name" }, { "api_name": "tkinter.END", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.p...
5588640606
from flask import Flask, jsonify, request, abort, json from flask_cors import CORS from werkzeug.exceptions import HTTPException import mysql.connector from datetime import datetime from time import sleep # from python_arptable import get_arp_table api = Flask(__name__) cors = CORS(api, resources={r"*": {"origins":...
brimell/temp-monitor-dash
Server/api_server.py
api_server.py
py
5,097
python
en
code
1
github-code
6
[ { "api_name": "flask.Flask", "line_number": 12, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 13, "usage_type": "call" }, { "api_name": "mysql.connector.connector.connect", "line_number": 42, "usage_type": "call" }, { "api_name": "mysql.c...
40726773721
# b_lens = 2 # w = 10 # truck_weights = [7, 4, 5, 6] # lens = len(truck_weights) # truck_weights.reverse() # 대기중인 트럭 # t_aft = [] # 다리를 통과한 트럭 # cur_brg = [0] # 현재 다리에 올라간 트럭 # time = 0 # 현재 시간 # temp = [] # n번 트럭이 들어간 시간 # # while len(t_aft) < lens: # try: # if sum(cur_brg) + truck_weights[-1] <= 10: ...
John3210of/AnyPrac
9rogramers/bridge_pass.py
bridge_pass.py
py
2,270
python
ko
code
0
github-code
6
[ { "api_name": "collections.deque", "line_number": 43, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 44, "usage_type": "call" } ]
39585629995
import psutil import json #coding:UTF-8 import requests def get_key(): key_info = psutil.net_io_counters(pernic=True).keys() recv = {} sent = {} for key in key_info: recv.setdefault(key, psutil.net_io_counters(pernic=True).get(key).bytes_recv) sent.setdefault(key, psutil.net_io_count...
limingzhizhong2018/jiankong1
net.py
net.py
py
1,042
python
en
code
0
github-code
6
[ { "api_name": "psutil.net_io_counters", "line_number": 8, "usage_type": "call" }, { "api_name": "psutil.net_io_counters", "line_number": 14, "usage_type": "call" }, { "api_name": "psutil.net_io_counters", "line_number": 15, "usage_type": "call" }, { "api_name": "t...
30293232009
from splinter import Browser import pandas as pd import time import shutil class NIPExtractor(): def __init__(self): self._browser = Browser('chrome') # self._browser = Browser('chrome', headless=True) self.scraped_data = [] url = 'https://ppuslugi.mf.gov.pl/' self._brows...
drazka/askMF_project
askMF2.py
askMF2.py
py
3,154
python
en
code
0
github-code
6
[ { "api_name": "splinter.Browser", "line_number": 11, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 27, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 33, "usage_type": "call" }, { "api_name": "time.sleep", "line_number"...
9435561185
from os.path import join from os import listdir import pandas as pd from rdflib import Literal from rdflib.namespace import RDF, SKOS from utils.mappings import * from utils.namespaces import * from utils.data_structure import MyNode, MyLiteral from random import seed, randint from validate_values import validate impo...
fusion-jena/Meta2KG
kg_population/populate.py
populate.py
py
7,638
python
en
code
3
github-code
6
[ { "api_name": "random.seed", "line_number": 15, "usage_type": "call" }, { "api_name": "rdflib.namespace.RDF.type", "line_number": 19, "usage_type": "attribute" }, { "api_name": "rdflib.namespace.RDF", "line_number": 19, "usage_type": "name" }, { "api_name": "rdfli...
8469541835
## __main__.py - Tommy Dougiamas """ This file interprets all command line arguments. It passes off the actual processing to other functions. """ # Stdlib imports import sys import os from pathlib import Path # Used to fix incompatibilities between windows and unix-based file paths ("/" vs "\\") # Relative imports f...
exciteabletom/mazegenerator
mazegenerator/__main__.py
__main__.py
py
5,120
python
en
code
1
github-code
6
[ { "api_name": "sys.stderr", "line_number": 26, "usage_type": "attribute" }, { "api_name": "sys.stderr", "line_number": 28, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 29, "usage_type": "call" }, { "api_name": "sys.exit", "line_number"...
32898217246
""" Simple wrapper to access Microsoft Business Central data through its Web Services author: Francesco Baldisserri email: fbaldisserri@gmail.com version: 0.8 """ import numpy as np import pandas as pd import requests from requests.auth import HTTPBasicAuth ODATA_HEADER = { "OData-Version": "4.0", "Accept": ...
sirbradflies/Microsoft-Business-Central-Wrapper
bcwrapper.py
bcwrapper.py
py
6,523
python
en
code
1
github-code
6
[ { "api_name": "requests.auth.HTTPBasicAuth", "line_number": 38, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 52, "usage_type": "call" }, { "api_name": "pandas.DataFrame.from_records", "line_number": 58, "usage_type": "call" }, { "api_name":...
12829865059
from rest_framework.test import APITestCase class TestStudentInfo(APITestCase): url = "http://localhost:8000/api/studentlists/" def test_post_studentInfo(self): data = { "first_name": "StudentTest", "last_name": "test1", "gender": "Male", "dob": "2021-0...
SethuKarthick/Student_enrollment_form_Backend
studentadmissionmanager/studentlists/tests.py
tests.py
py
971
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.test.APITestCase", "line_number": 4, "usage_type": "name" } ]
71449750587
from multiprocessing import Process, Pipe class Consumer(Process): def __init__(self, pipe): Process.__init__(self) self.pipe = pipe def run(self): print("Consumer received...{}".format(self.pipe.recv())) self.pipe.send("Consumer words!") class Producer(Process): def __i...
haidongsong/spider_learn
zhang_xiaobo_spider_practice/process_pip.py
process_pip.py
py
785
python
en
code
0
github-code
6
[ { "api_name": "multiprocessing.Process", "line_number": 4, "usage_type": "name" }, { "api_name": "multiprocessing.Process.__init__", "line_number": 6, "usage_type": "call" }, { "api_name": "multiprocessing.Process", "line_number": 6, "usage_type": "name" }, { "api...
22907417370
# (C) Efsane Müzikal herkes için en güzel müzik botu.. from time import time from datetime import datetime from pyrogram import Client, filters from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton, Chat, CallbackQuery from helpers.decorators import authorized_users_only from config import BO...
TMLANA/li
handlers/callback.py
callback.py
py
10,837
python
tr
code
0
github-code
6
[ { "api_name": "datetime.datetime.utcnow", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 12, "usage_type": "name" }, { "api_name": "pyrogram.types.CallbackQuery", "line_number": 35, "usage_type": "name" }, { "api_name"...
29254881363
from os import sep from prettytable import PrettyTable import os LimpiarPantalla = lambda: os.system('cls') #region Metodos def separador(): print("="*60) def productosABC(): global Total_Anual LimpiarPantalla() # Producto A print("\t\tProducto A") print("PRIMER SEMESTRE") cant_A = int(in...
1i348493930303/PIA_CONTA
PIA_CONTA.py
PIA_CONTA.py
py
21,574
python
es
code
0
github-code
6
[ { "api_name": "os.system", "line_number": 4, "usage_type": "call" }, { "api_name": "prettytable.PrettyTable", "line_number": 39, "usage_type": "call" }, { "api_name": "prettytable.PrettyTable", "line_number": 136, "usage_type": "call" }, { "api_name": "prettytable...
4185377944
import numpy as np import matplotlib.pyplot as plt from epsilon_greedy import EpsGreedy from ucb import UCB from beta_thompson import BetaThompson from linucb import LinUCB from lin_thompson import LinThompson def offlineEvaluate(mab, arms, rewards, contexts, nrounds=None): """ Offline evaluation of a multi-...
Bluestone47/multi-armed-bandits
offline_evaluate.py
offline_evaluate.py
py
3,028
python
en
code
0
github-code
6
[ { "api_name": "numpy.cumsum", "line_number": 56, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 56, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 57, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", ...
30928758025
""" Generic metric class for tpc_ml. """ import torch import torch.nn as nn from logger import Logger class GenericMetric: """ """ def __init__(self, name: str='generic', output_shape: tuple=(), target_shape: tuple=(), input_shape: tuple=(), when_compute: ...
infophysics/pytorch_starter
src/metrics.py
metrics.py
py
3,072
python
en
code
0
github-code
6
[ { "api_name": "torch.empty", "line_number": 28, "usage_type": "call" }, { "api_name": "torch.float", "line_number": 30, "usage_type": "attribute" }, { "api_name": "torch.empty", "line_number": 34, "usage_type": "call" }, { "api_name": "torch.float", "line_numb...
37772790464
from django.contrib import admin from .models import UserMeta # Register your models here. @admin.register(UserMeta) class UserMetaAdmin(admin.ModelAdmin): list_display = ('user', 'reputation') list_editable = ('reputation',) search_fields = ('user',) list_filter = ('reputation',)
Dathmar/mors-tyrannis
users/admin.py
admin.py
py
300
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 7, "usage_type": "name" }, { "api_name": "django.contrib.admin.register", "line_number": 6, "usage_type": "call" }, { ...
4428785283
import sys import time import clr from openhab import OpenHAB from msvcrt import kbhit # Detect key press to exit from subprocess import check_output # Check processes running clr.AddReference('EngineIO') from EngineIO import * # There is no way to check if OpenHAB and Home I/O are running and Home I/O API is availa...
jaBote/OpenHAB-python-HomeIO
connect_main.py
connect_main.py
py
13,351
python
en
code
1
github-code
6
[ { "api_name": "clr.AddReference", "line_number": 8, "usage_type": "call" }, { "api_name": "subprocess.check_output", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 18, "usage_type": "call" }, { "api_name": "sys.exit", "line...
31126467694
import torch from transformers import BertConfig, BertModel # Building the config config = BertConfig() # Building the model from the config model = BertModel(config) print(config) model.save_pretrained("directory_on_my_computer") encoded_sequences = [ [101, 7592, 999, 102], [101, 4658, 1012, 102], [10...
SleepySoft/HuggingFaceStudy
02.UsingTransformers/03.Models_PT.py
03.Models_PT.py
py
435
python
en
code
0
github-code
6
[ { "api_name": "transformers.BertConfig", "line_number": 5, "usage_type": "call" }, { "api_name": "transformers.BertModel", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.tensor", "line_number": 20, "usage_type": "call" } ]
26040035346
from __future__ import annotations import logging import os from abc import ABCMeta from dataclasses import dataclass from itertools import chain from pants.backend.helm.check.kubeconform.extra_fields import KubeconformFieldSet from pants.backend.helm.check.kubeconform.subsystem import KubeconformSubsystem from pants...
pantsbuild/pants
src/python/pants/backend/helm/check/kubeconform/common.py
common.py
py
5,240
python
en
code
2,896
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 23, "usage_type": "call" }, { "api_name": "pants.core.goals.check.CheckRequest", "line_number": 26, "usage_type": "name" }, { "api_name": "abc.ABCMeta", "line_number": 26, "usage_type": "name" }, { "api_name": "pan...
70055366269
import json import matplotlib.pyplot as plt def readFile(fileName): ''' read asterix from json file and return two data structures ''' with open(fileName, 'r') as f: data = [json.loads(line[:-2]) for line in f.readlines()[0:-1]] # f = open(fileName) # data = json.load(f) tra...
avidalh/eva
src/plotAst.py
plotAst.py
py
14,044
python
en
code
0
github-code
6
[ { "api_name": "json.loads", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 173, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 173, "usage_type": "name" }, { "api_name": "matplotlib.pypl...
20201535727
from django import forms from crispy_forms.helper import FormHelper from crispy_forms.layout import Layout, Submit from bootstrap_datepicker_plus.widgets import DateTimePickerInput class SubscriptionForm(forms.Form): sub_name = forms.CharField(label='Subscription Name', max_length=100) price = forms.DecimalFie...
jyoshin/django-subs
base/forms.py
forms.py
py
838
python
en
code
0
github-code
6
[ { "api_name": "django.forms.Form", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 6, "usage_type": "name" }, { "api_name": "django.forms.CharField", "line_number": 7, "usage_type": "call" }, { "api_name": "django.forms"...
27147298644
import io class FullNameTable: def __init__(self, reader, table_directory, position): self._full_font_name = '' self._data = None self._table_directory = table_directory if table_directory is not None: int_offset = self._read_u_long(table_directory, position + 8...
dynamicpdf-api/python-client
dynamicpdf_api/full_name_table.py
full_name_table.py
py
3,314
python
en
code
0
github-code
6
[ { "api_name": "io.SEEK_SET", "line_number": 15, "usage_type": "attribute" } ]
39027091801
import sys import io import requests from bs4 import BeautifulSoup from fake_useragent import UserAgent sys.stdout = io.TextIOWrapper(sys.stdout.detach(), encoding = 'utf-8') sys.stderr = io.TextIOWrapper(sys.stderr.detach(), encoding = 'utf-8') URL = 'https://www.wishket.com/accounts/login/' ua = UserAgent() #Sess...
DooHwan-Kim/WebScraping
section3/3-5-1.py
3-5-1.py
py
1,211
python
en
code
0
github-code
6
[ { "api_name": "sys.stdout", "line_number": 8, "usage_type": "attribute" }, { "api_name": "io.TextIOWrapper", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.stdout.detach", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.stderr", "lin...
25823398956
import numpy as np from keras.preprocessing.image import load_img, img_to_array from keras.models import load_model import os from time import sleep n_class = 7 img_size = 28 BATCH_SIZE = 26 EPOCH = 10 path="./real-data" labels=['normal','inner_1','inner_2','outer_1','outer_2','ball_1','ball_2'] #readi...
Lu-JF/RaspberryPiCaseStudy
Run_on_RaspberryPi.py
Run_on_RaspberryPi.py
py
3,973
python
en
code
2
github-code
6
[ { "api_name": "keras.preprocessing.image.load_img", "line_number": 17, "usage_type": "call" }, { "api_name": "keras.preprocessing.image.img_to_array", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.expand_dims", "line_number": 19, "usage_type": "call" }...
18270572912
import spacy from keyboost.keyBoost import * if len(section.split(' ')) <=1000: nlp = spacy.load('fr_core_news_sm') stopwords = nlp.Defaults.stop_words keyboost = KeyBoost('paraphrase-MiniLM-L6-v2') keywords = keyboost.extract_keywords(text=section, language='fr', ...
ecolabdata/2021-NLP_AE
Zakaria/keyboost_project/keyboost_source/Inference/final_script_keyboost_component.py
final_script_keyboost_component.py
py
569
python
en
code
4
github-code
6
[ { "api_name": "spacy.load", "line_number": 7, "usage_type": "call" }, { "api_name": "keyboost.keyBoost", "line_number": 12, "usage_type": "name" }, { "api_name": "keyboost.keyBoost.extract_keywords", "line_number": 15, "usage_type": "call" }, { "api_name": "keyboo...
43627045594
from typing import List class Solution(object): def minDominoRotations(self, tops: List[int], bottoms: List[int]) -> int: n = len(tops) t, b = 0, 0 for i in range(n): if tops[i] != tops[0]: t += 1 if bottoms[i] != tops[0]: b += 1 ...
MichaelTQ/LeetcodePythonProject
solutions/leetcode_1001_1050/LeetCode1007_MinimumDominoRotationsForEqualRow.py
LeetCode1007_MinimumDominoRotationsForEqualRow.py
py
1,235
python
en
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" } ]
4742162211
import pandas as pd import matplotlib.pyplot as plt import numpy as np import sklearn.linear_model import scipy.stats as stats import pandas_market_calendars as mcal from alpha_vantage.timeseries import TimeSeries api_key = '8FIYTT49ZEZT2GV5' ts = TimeSeries(key=api_key, output_format='pandas') data, meta_da...
obawolo/Capstone
test2.py
test2.py
py
3,635
python
en
code
0
github-code
6
[ { "api_name": "alpha_vantage.timeseries.TimeSeries", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas_market_calendars.get_calendar", "line_number": 12, "usage_type": "call" }, { "api_name": "scipy.stats.norm.cdf", "line_number": 21, "usage_type": "call" ...
26112391085
import numpy from silx.gui import qt from silx.gui.plot import PlotWidget from silx.gui.plot.actions.control import ZoomBackAction, CrosshairAction from silx.gui.plot.actions.io import SaveAction, PrintAction from silx.gui.plot.tools.menus import ZoomEnabledAxesMenu class PlotWidgetWithContextMenu(PlotWidget): ""...
silx-kit/silx
examples/plotContextMenu.py
plotContextMenu.py
py
2,503
python
en
code
106
github-code
6
[ { "api_name": "silx.gui.plot.PlotWidget", "line_number": 9, "usage_type": "name" }, { "api_name": "silx.gui.plot.actions.control.ZoomBackAction", "line_number": 18, "usage_type": "call" }, { "api_name": "silx.gui.plot.actions.control.CrosshairAction", "line_number": 19, "...
22964639167
from flask import render_template, Blueprint, request, redirect, url_for, session from log_required import login_required from database import DatabaseExecutes import os from youtubesearchpython import VideosSearch import re dashboard_blueprint = Blueprint("dashboard", __name__, template_folder='templates') database_e...
PKostecki/GamesTracker
blueprints/dashboard/dashboard.py
dashboard.py
py
2,935
python
en
code
1
github-code
6
[ { "api_name": "flask.Blueprint", "line_number": 8, "usage_type": "call" }, { "api_name": "database.DatabaseExecutes", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "li...
39040950677
import streamlit as st import pandas as pd import plotly.express as px # Access mapbox token from secrets.toml mapbox_token = st.secrets["mapbox_token"] # Import weather data into a DataFrame. df = pd.read_csv("cities.csv")[ [ "City", "Country", "Lat", "Lng", "Max Temp", ...
matin-n/Vacation-Weather-Dashboard
streamlit_app.py
streamlit_app.py
py
4,323
python
en
code
0
github-code
6
[ { "api_name": "streamlit.secrets", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "streamlit.set_page_config", "line_number": 23, "usage_type": "call" }, { "api_name": "stream...
8065250974
from django.urls import path #from burcblog import settings from . import views from django.conf.urls.static import static from django.contrib.auth.views import LoginView,LogoutView from django.contrib.auth import views as auth_views urlpatterns = [ path('', views.homepage,name="homepage"), path('...
SeraySimsek/zodiacblog
urls.py
urls.py
py
2,643
python
en
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 11, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 12, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 13, "usage_type": "call" }, { "api_name": "django.urls.path",...
72651198267
"""Payment Views""" import logging from django.contrib.auth import get_user_model from rest_framework import status from rest_framework.response import Response from rest_framework.views import APIView from rest_framework.permissions import IsAuthenticated from .serializers import ChargeCardSerializer, OrderHistorySer...
Horlawhumy-dev/dukka_ecommerce
payment/views.py
views.py
py
3,531
python
en
code
1
github-code
6
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 16, "usage_type": "call" }, { "api_name": "rest_framework.views.APIView", "line_number": 19, "usage_type": "name" }, { "api_name": "rest_framework.permissions.IsAuthenticated", "line_number": 21, "usage_ty...
7460253766
import torch import torchvision import torchvision.transforms as transforms import torch.optim as optim import torch.nn as nn import torch.nn.functional as F import numpy as np class down(nn.Module): def __init__(self, inChannels, outChannels, filterSize): super(down, self).__init__() # Initiali...
CodeCore1994/CSE353_ML
model.py
model.py
py
4,886
python
en
code
0
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 10, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.nn", "line_nu...
31784880117
"""Use final model to predict on new data.""" import os from typing import Final, Dict, List import albumentations as A from tensorflow.keras.models import load_model from wildlifeml import WildlifeDataset from wildlifeml.data import BBoxMapper from wildlifeml.training.evaluator import Evaluator from wildlifeml.utils....
slds-lmu/wildlife-experiments
scripts/pred_final_model.py
pred_final_model.py
py
2,088
python
en
code
2
github-code
6
[ { "api_name": "typing.Final", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.Final", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.Final", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.Final", "line_numbe...
7390219690
# Fits neural networks to the UK election data import tensorflow as tf import tensorflow_probability as tfp from cc_funcs import cc_log_prob, cc_mean from election_data import load_election_data import numpy as np import pandas as pd seed = 0 epochs = 1000 TRAIN_BUF = 509 TEST_BUF = 150 BATCH_SIZE = 128 reg_cc = 0.0 ...
cunningham-lab/cb_and_cc
cc/election_mlp.py
election_mlp.py
py
6,980
python
en
code
32
github-code
6
[ { "api_name": "tensorflow.random.set_seed", "line_number": 24, "usage_type": "call" }, { "api_name": "tensorflow.random", "line_number": 24, "usage_type": "attribute" }, { "api_name": "tensorflow_probability.distributions", "line_number": 25, "usage_type": "attribute" }...
18197429187
# -*- coding: utf-8 -*- """ Created on Wed Dec 15 19:33:16 2021 @author: Mike """ import time import datetime import pandas as pd import json #opens the file and gets the data inside with open('symbol_1500.json') as f: daa = json.load(f) #code taken from https://learndataanalysis.org/source-code...
WujiMikeChen/Stock-Trading-Algorithms
GettingStockData/GetStockData.py
GetStockData.py
py
1,013
python
en
code
0
github-code
6
[ { "api_name": "json.load", "line_number": 15, "usage_type": "call" }, { "api_name": "time.mktime", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 19, "usage_type": "call" }, { "api_name": "time.mktime", "line_numbe...
32659170404
# Shamelessly stolen from https://github.com/Thezomg/mcapi/ # Based on Java from https://github.com/Mojang/AccountsClient/ import requests import json from requests.exceptions import ConnectionError class NoSuchUserException(Exception): pass AGENT = "minecraft" PROFILE_URL = "https://api.mojang.com/profiles/min...
JunctionAt/JunctionWWW
blueprints/uuid_utils.py
uuid_utils.py
py
2,544
python
en
code
1
github-code
6
[ { "api_name": "requests.get", "line_number": 26, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 48, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 50, "usage_type": "call" }, { "api_name": "requests.exceptions.ConnectionE...
10139859610
from staff.models import Staff from django.contrib.auth.models import User from django.test import TestCase from django.utils import timezone class StaffTest(TestCase): @classmethod def setUpTestData(self): # Set up non-modified objects used by all test methods startTime = timezone.now() ...
shreygoel7/Pinocchio
Pinocchio/staff/tests/test_models.py
test_models.py
py
787
python
en
code
0
github-code
6
[ { "api_name": "django.test.TestCase", "line_number": 7, "usage_type": "name" }, { "api_name": "django.utils.timezone.now", "line_number": 12, "usage_type": "call" }, { "api_name": "django.utils.timezone", "line_number": 12, "usage_type": "name" }, { "api_name": "d...
24501132151
import random import numpy as np import heapq import scipy.io import math class data_loader: def __init__(self, database_name='UCB', labeled_num=100): if database_name == 'UWA' or database_name == 'UWA30': self.class_num = 30 self.depth_feature_length = 110 self.rgb_feat...
wenwen0319/GVCA
loader_class_euc.py
loader_class_euc.py
py
9,645
python
en
code
4
github-code
6
[ { "api_name": "random.random", "line_number": 70, "usage_type": "call" }, { "api_name": "scipy.io.io.loadmat", "line_number": 141, "usage_type": "call" }, { "api_name": "scipy.io.io", "line_number": 141, "usage_type": "attribute" }, { "api_name": "scipy.io", "...
10291570300
""" KMeans, Birch and Gaussian Clustering Algorithms from scikit-learn library Place the dataset file in the same directory and change the 'dataset_name' (line 18) accordingly. Make sure the files 'cluster_labelling.py' and 'performance_measures' are present in the same directory """ from sklearn.cluster import Birch...
sharath-cgm/SoftModes
Other Clustering Algorithms/k-means_BIRCH_Gaussian_scikit.py
k-means_BIRCH_Gaussian_scikit.py
py
2,835
python
en
code
0
github-code
6
[ { "api_name": "numpy.loadtxt", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 26, "usage_type": "call" }, { "api_name": "sklearn.cluster.Birch", "line_number": 47, "usage_type": "call" }, { "api_name": "cluster_labelling.la...
41013589479
# coding=utf-8 import matplotlib #matplotlib.use('Agg') import numpy as np import pyten from scipy import stats from pyten.method.PoissonAirCP import PoissonAirCP from pyten.method import AirCP from pyten.tools import tenerror from pyten.method import falrtc,TNCP,cp_als import util import matplotlib.pyplot as plt siz ...
yangjichen/ExpCP
EXP1/testPoissonAirCP.py
testPoissonAirCP.py
py
5,845
python
en
code
0
github-code
6
[ { "api_name": "numpy.random.seed", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 22, "usage_type": "attribute" }, { "api_name": "util.create2", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.zeros", "l...
6439414982
import numpy as np from scipy import stats from scipy import ndimage import cv2 def make_cdf(img, n_bins=256): """ Creates CDF of input image (map from [0,255] to [0,1]) Inputs: - img: input image - n_bins: Number of bins used Output: - Dictionary containing Cummulative frequencies (CDF) ...
shfoo/texture-synthesis
pyramid_synthesis.py
pyramid_synthesis.py
py
6,527
python
en
code
0
github-code
6
[ { "api_name": "scipy.stats.cumfreq", "line_number": 18, "usage_type": "call" }, { "api_name": "scipy.stats", "line_number": 18, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_n...
28742339410
import numpy as np import networkx as nx from numba import jit from src.inference.beta_utils import * class HotPotts: def __init__(self, neighbour_graph, number_clusters, beta, beta_model, beta_strength): check_valid_model(beta_model) self.neighbour_graph = neighbour_graph self.num_clust...
Roth-Lab/SpatialSort
src/distributions/HotPotts.py
HotPotts.py
py
7,821
python
en
code
1
github-code
6
[ { "api_name": "numpy.array", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.int64", "line_number": 28, "usage_type": "attribute" }, { "api_name": "numpy.max", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number...
74596475068
from numpy import dot from scipy.linalg import det, svd def destress(Q, MP): """ Removes the stress and associated energy from state Q """ A = Q[5:14].reshape([3, 3]) detA = det(A) U, _, Vh = svd(A) Q[5:14] = detA**(1 / 3) * dot(U, Vh).ravel()
haranjackson/ADER
models/gpr/boundaries.py
boundaries.py
py
270
python
en
code
13
github-code
6
[ { "api_name": "scipy.linalg.det", "line_number": 9, "usage_type": "call" }, { "api_name": "scipy.linalg.svd", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 11, "usage_type": "call" } ]
26829722508
#!/usr/bin/python import sys import os import os.path import logging import subprocess import bz2 import cPickle import logging import core_data __author__ = "Michael Lienhardt" __copyright__ = "Copyright 2017, Michael Lienhardt" __license__ = "GPL3" __version__ = "0.5" __maintainer__ = "Michael Lienhardt" __email_...
HyVar/gentoo_to_mspl
guest/hyvar/extract_portage.py
extract_portage.py
py
26,673
python
en
code
10
github-code
6
[ { "api_name": "os.path.realpath", "line_number": 52, "usage_type": "call" }, { "api_name": "os.path", "line_number": 52, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 53, "usage_type": "call" }, { "api_name": "os.path", "line_nu...
23742189000
import cv2 from tracker import * # Create tracker object tracker = EuclideanDistTracker() cap = cv2.VideoCapture("highway.mp4")#read frames from the video # Object detection from Stable camera #Extract the moving objects from the stable camera object_detector = cv2.createBackgroundSubtractorMOG2(history=...
Sarah436/Object_Tracking_OpenCV
main.py
main.py
py
1,813
python
en
code
0
github-code
6
[ { "api_name": "cv2.VideoCapture", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.createBackgroundSubtractorMOG2", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.threshold", "line_number": 25, "usage_type": "call" }, { "api_name": "cv2....
72014606588
import torch.nn as nn class LockedDropout(nn.Module): def __init__(self): super().__init__() def forward(self, x, batch_first=False, p=0.5): if not self.training or not p: return x mask_shape = (x.size(0), 1, x.size(2)) if batch_first else (1, ...
jerbarnes/semeval22_structured_sentiment
baselines/graph_parser/src/awd/locked_dropout.py
locked_dropout.py
py
543
python
en
code
71
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 4, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 4, "usage_type": "name" } ]
21867301965
import logging import warnings import time import math from threading import Condition, Thread import struct import pickle import traceback import os from usb.backend import libusb0, libusb1 import usb.core import usb.util from phywhisperer.firmware import phywhisperer as fw_phywhisperer def packuint32(data): ...
newaetech/phywhispererusb
software/phywhisperer/interface/naeusb.py
naeusb.py
py
30,764
python
en
code
77
github-code
6
[ { "api_name": "phywhisperer.firmware.phywhisperer.fwver", "line_number": 45, "usage_type": "attribute" }, { "api_name": "phywhisperer.firmware.phywhisperer", "line_number": 45, "usage_type": "name" }, { "api_name": "pickle.dumps", "line_number": 76, "usage_type": "call" ...
70106004348
from twython import Twython, TwythonError import time APP_KEY = "zx9UyoOfI693D50KDKlzPKWyw" APP_SECRET = "szRyDakpY6Ms40ovi61sCNCUIK1vWlI5zMe84YAcOLJZ3i4jMr" OAUTH_TOKEN = "190738750-VXHAqJU7vHwMK1Uy1i20CkmvlhYkXPvobU1xteAR" OAUTH_TOKEN_SECRET = "HOOgGxG5ylFsSoFlDReKOgsfPDG6fooCVkGeEmKPFqdPS" twitter = Twython(APP_KE...
benjaminhr/python-twitter-bot
mytwitterbot.py
mytwitterbot.py
py
965
python
en
code
0
github-code
6
[ { "api_name": "twython.Twython", "line_number": 9, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 23, "usage_type": "call" }, { "api_name": "twython.TwythonError", "line_number": 33, "usage_type": "name" } ]
32644480377
""" Shifter's Component guide class. """ import ast from functools import partial import maya.cmds as cmds # pyMel import pymel.core as pm from pymel.core import datatypes # mgear import mgear from mgear.core import string from mgear.core import node from pymel import versions from mgear.core import dag, vector, t...
mgear-dev/mgear4
release/scripts/mgear/shifter/component/guide.py
guide.py
py
52,578
python
en
code
209
github-code
6
[ { "api_name": "mgear.shifter.guide.Main", "line_number": 42, "usage_type": "attribute" }, { "api_name": "mgear.shifter.guide", "line_number": 42, "usage_type": "name" }, { "api_name": "mgear.log", "line_number": 275, "usage_type": "call" }, { "api_name": "mgear.se...
19108844161
from django.shortcuts import render,redirect import random from time import strftime def index(req): if 'gold' not in req.session: req.session['gold'] = 0 if 'activities' not in req.session: req.session['activities'] = [] data = { 'gold': req.session['gold'], 'activities': r...
klandon94/django_intro
ninja_gold/apps/ninja/views.py
views.py
py
1,621
python
en
code
0
github-code
6
[ { "api_name": "django.shortcuts.render", "line_number": 14, "usage_type": "call" }, { "api_name": "time.strftime", "line_number": 20, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 22, "usage_type": "call" }, { "api_name": "random.randint",...
43202515107
"""Losses.""" import logging import torch import torch.nn.functional as F from . import heads from ..show.flow_vis import flow_compute_color from PIL import Image from datetime import datetime from .lovasz_loss import lovasz_softmax_flat, flatten_probas, lovasz_hinge LOG = logging.getLogger(__name__) class Center...
tfzhou/MG-HumanParsing
lib/network/losses.py
losses.py
py
38,886
python
en
code
74
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 17, "usage_type": "attribute" }, { "api_name": "torch.nn.L1Loss", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.nn", "line_...
14494988554
import os, argparse import joblib import pickle import mlflow from azureml.core import Run from distutils.dir_util import copy_tree from sklearn.calibration import CalibratedClassifierCV from sklearn.metrics import brier_score_loss def calc_reliability(y_test, yhat, yhat_proba, suffix): # calculate brier sco...
Latticecraft/Azure-ML-Accelerator
src/pipeline/model/calibrate/calibrate.py
calibrate.py
py
2,639
python
en
code
2
github-code
6
[ { "api_name": "sklearn.metrics.brier_score_loss", "line_number": 14, "usage_type": "call" }, { "api_name": "mlflow.log_metric", "line_number": 15, "usage_type": "call" }, { "api_name": "joblib.load", "line_number": 22, "usage_type": "call" }, { "api_name": "pickle...
43005477988
from vsgpr import VSGPR from linalg import log_gaussian import torch.nn.functional as F import numpy as np import math class VSGPR_SVGP(VSGPR): """ Add KL in loss function """ def __init__(self, Xm, kernel, variance=None, beta=1.0, batch_size=None): """ :param Xm: Inducing inputs. ...
weiyadi/dlm_sgp
conjugate/vsgpr_svgp.py
vsgpr_svgp.py
py
1,501
python
en
code
2
github-code
6
[ { "api_name": "vsgpr.VSGPR", "line_number": 8, "usage_type": "name" }, { "api_name": "numpy.random.choice", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 25, "usage_type": "attribute" }, { "api_name": "torch.nn.functional....
1293463811
import inspect from functools import partial import jax.numpy as jnp from jax import jit from onnx_jax.handlers.backend_handler import BackendHandler from onnx_jax.handlers.handler import onnx_op from onnx_jax.pb_wrapper import OnnxNode int32_max = jnp.iinfo(jnp.int32).max @onnx_op("Slice") class Slice(BackendHand...
gglin001/onnx-jax
onnx_jax/handlers/backend/slice.py
slice.py
py
3,354
python
en
code
7
github-code
6
[ { "api_name": "jax.numpy.iinfo", "line_number": 11, "usage_type": "call" }, { "api_name": "jax.numpy", "line_number": 11, "usage_type": "name" }, { "api_name": "jax.numpy.int32", "line_number": 11, "usage_type": "attribute" }, { "api_name": "onnx_jax.handlers.back...
73723507707
# -*- coding: utf-8 -*- """Preview Code for 'Inf-Net: Automatic COVID-19 Lung Infection Segmentation from CT Scans' submit to Transactions on Medical Imaging, 2020. First Version: Created on 2020-05-13 (@author: Ge-Peng Ji) """ import torch import torch.nn.functional as F import numpy as np import os import argparse ...
aytek03/Image-Segmentation-for-COVID-19
MyTest_LungInf.py
MyTest_LungInf.py
py
3,310
python
en
code
1
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 25, "usage_type": "call" }, { "api_name": "Code.model_lung_infection.InfNet_ResNest.Inf_Net", "line_number": 45, "usage_type": "call" }, { "api_name": "torch.load", "line_number": 47, "usage_type": "call" }, { ...
10350107391
# %% Taken from pytorch example - Test that things work import torch import torchvision dummy_input = torch.randn(10, 3, 224, 224, device="cpu") model = torchvision.models.alexnet(pretrained=True) # Providing input and output names sets the display names for values # within the model's graph. Setting these does not ...
danielfrg/cantus
demucs/torch_to_onnx.py
torch_to_onnx.py
py
2,158
python
en
code
0
github-code
6
[ { "api_name": "torch.randn", "line_number": 6, "usage_type": "call" }, { "api_name": "torchvision.models.alexnet", "line_number": 7, "usage_type": "call" }, { "api_name": "torchvision.models", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.onn...
9022428231
import json from urllib.parse import quote def get_cookies(session_id_str, user_id=-1, first=-1, after=-1, JSON_codification=True, session_id=True, debug=False): cookiesAux = dict() if user_id != -1: cookiesAux["id"] = user_id if first != -1: cookiesAux["first"] = first i...
gameoverfran/seguridad_informatica
getters_maker.py
getters_maker.py
py
1,294
python
en
code
0
github-code
6
[ { "api_name": "urllib.parse.quote", "line_number": 22, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 22, "usage_type": "call" } ]
27533063430
import numpy as np import sqlalchemy from sqlalchemy.ext.automap import automap_base from sqlalchemy.orm import Session from sqlalchemy import create_engine, func, distinct from flask import Flask, jsonify # Database Setup engine = create_engine("sqlite:///hawaii.sqlite") Base = automap_base() Base.prepare(engine, r...
RyakDL/SQL_alchemy_challenge
Surfs_up/Climate_app.py
Climate_app.py
py
5,211
python
en
code
0
github-code
6
[ { "api_name": "sqlalchemy.create_engine", "line_number": 11, "usage_type": "call" }, { "api_name": "sqlalchemy.ext.automap.automap_base", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 20, "usage_type": "call" }, { "api_name...
21965777489
import numpy as np from sklearn.linear_model import LinearRegression import pylab def linear_regression_line_coordinates(x,y,min_x,max_x): x = np.array(x).reshape(-1,1) y = np.array(y) model = LinearRegression().fit(x,y) r_sq = model.score(x,y) slope = model.coef_ intercept = model.intercept_ ...
ernestofgonzalez/PhysicsBsc
TerceiroSemestre/FísicaExperimentalII/Apresentação/data_analysis.py
data_analysis.py
py
3,959
python
en
code
0
github-code
6
[ { "api_name": "numpy.array", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 8, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LinearRegression", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.lins...
2078236337
# import datetime # from re import U from odoo import models, fields,api from odoo.exceptions import UserError from odoo import models, fields, api from odoo.exceptions import UserError from odoo import http from odoo.http import request from datetime import datetime import io import base64 import xlwt class Securi...
Odolution/lacas
security_amount_report/models/security_amount_report.py
security_amount_report.py
py
9,111
python
en
code
0
github-code
6
[ { "api_name": "odoo.models.Model", "line_number": 16, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 16, "usage_type": "name" }, { "api_name": "xlwt.Workbook", "line_number": 26, "usage_type": "call" }, { "api_name": "xlwt.easyxf", "l...
74929806586
from django.shortcuts import render from .models import CompanyAccount response = {} def company_detail(request, id): html = "layout/company_profile.html" selected_company = CompanyAccount.objects.get(company_id=id) response['sub_title'] = selected_company.company_name + ' Profil Page' response['c...
argaghulamahmad/konekin-enterprise
company_profile/views.py
views.py
py
3,180
python
en
code
0
github-code
6
[ { "api_name": "models.CompanyAccount.objects.get", "line_number": 11, "usage_type": "call" }, { "api_name": "models.CompanyAccount.objects", "line_number": 11, "usage_type": "attribute" }, { "api_name": "models.CompanyAccount", "line_number": 11, "usage_type": "name" },...
32119058861
# pylint: disable=C0103 from django.db import migrations import apps.bk_crypto.models class Migration(migrations.Migration): dependencies = [ ("doc", "0002_alter_comment_content_alter_commentbin_content_and_more"), ] operations = [ migrations.AlterField( model_name="doc", ...
OVINC-CN/iWikiAPI
apps/doc/migrations/0003_alter_doc_header_img_alter_docbin_header_img.py
0003_alter_doc_header_img_alter_docbin_header_img.py
py
791
python
en
code
0
github-code
6
[ { "api_name": "django.db.migrations.Migration", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 8, "usage_type": "name" }, { "api_name": "django.db.migrations.AlterField", "line_number": 15, "usage_type": "call" }, {...
44799067773
from django.db import models from django.db.models.signals import post_save, post_delete from django.dispatch import receiver from .models import Message from apps.users.models import Profile def message_post(sender, instance, created, *args, **kwargs): if created: create_message = Message.objects.create(...
Shwarz1Van1Hummer/SCP_MVC2
apps/chat/signals.py
signals.py
py
682
python
en
code
0
github-code
6
[ { "api_name": "models.Message.objects.create", "line_number": 10, "usage_type": "call" }, { "api_name": "models.Message.objects", "line_number": 10, "usage_type": "attribute" }, { "api_name": "models.Message", "line_number": 10, "usage_type": "name" }, { "api_name...
21932297815
import discord from discord.ext import commands, tasks import main import datetime import roleutils channel = 823535219155927111 globalchan = 912531337901125642 readychan = 919290727660417024 readymsg = 925801984638984202 processors = {} class RecomCog(commands.Cog): def __init__(self, client): self.client ...
Jarkyc/Franklin-The-Undying
recomcog.py
recomcog.py
py
6,944
python
en
code
0
github-code
6
[ { "api_name": "discord.ext.commands.Cog", "line_number": 14, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 14, "usage_type": "name" }, { "api_name": "datetime.timedelta", "line_number": 34, "usage_type": "call" }, { "api_name": ...
654968097
import h5py from heimdall import view, to_source def example(split_channels=False): """ Split channel toggles between old (False) and new (True) napari channel behaviour. """ path = '/home/pape/Work/data/ilastik/mulastik/data/data.h5' with h5py.File(path) as f: raw = f['raw'] pred = f[...
constantinpape/heimdall
example/hdf5_viewer.py
hdf5_viewer.py
py
479
python
en
code
20
github-code
6
[ { "api_name": "h5py.File", "line_number": 9, "usage_type": "call" }, { "api_name": "heimdall.to_source", "line_number": 12, "usage_type": "call" }, { "api_name": "heimdall.view", "line_number": 13, "usage_type": "call" } ]
30721176104
import os import rasterio import numpy as np from tqdm import tqdm import time import scipy.ndimage as ndimage def fullPython_uniformFilter(imgPath: str, half_size: int, outputImgPath: str) -> np.ndarray: """ """ with rasterio.open( imgPath, "r" ) as i...
joclarstudio/demogreen
src/demogreen/demo_green.py
demo_green.py
py
8,838
python
en
code
3
github-code
6
[ { "api_name": "rasterio.open", "line_number": 13, "usage_type": "call" }, { "api_name": "time.perf_counter", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.float32", "line...
36181964923
from collections import Counter import numpy as np import pandas as pd def my_train_test_split(X, y, test_size=0.2): indices = np.array([i for i in range(len(X))]) np.random.shuffle(indices) cut = int(len(X) * (1 - test_size)) X_train = X[indices[:cut]] X_test = X[indices[cut:]] y_train = y[i...
lee-saint/lab-python
scratch11/practice.py
practice.py
py
2,632
python
en
code
0
github-code
6
[ { "api_name": "numpy.array", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.random.shuffle", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.mean", "lin...
19238418884
from typing import List class Solution: def productExceptSelf(self, nums: List[int]) -> List[int]: res = [1] * len(nums) left_product = 1 right_product = 1 # left products for i in range(len(nums)): res[i] = left_product left_p...
rasimatics/Data-Structures-and-Algorithms
238_product_except_self.py
238_product_except_self.py
py
538
python
en
code
2
github-code
6
[ { "api_name": "typing.List", "line_number": 4, "usage_type": "name" } ]
16886325808
from calendar import c from ensurepip import version from tkinter import * from tkinter import ttk from turtle import back from PIL import ImageTk, Image from pyparsing import col from tkinter import filedialog import os from zipfile import ZipFile import wget import tkinter import webbrowser import thread...
HarukuCode/dcs-autoIM
autoIMv1.2.py
autoIMv1.2.py
py
10,796
python
en
code
0
github-code
6
[ { "api_name": "os.path.dirname", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.join", "line...
73833124667
## SPDX-License-Identifier: MIT ## The content of this file has been developed in the context of the MOSIM research project. ## Original author(s): Jannes Lehwald, Janis Sprenger #import json import argparse #import os from thrift.transport import TSocket from thrift.transport import TTransport from thrift.protocol ...
mercedes-benz/MOSIM_Core
Framework/LanguageSupport/python/MMIPython/src/MMIPython/PythonAdapter.py
PythonAdapter.py
py
4,205
python
en
code
16
github-code
6
[ { "api_name": "MMIStandard.core.ttypes.MIPAddress", "line_number": 41, "usage_type": "call" }, { "api_name": "MMIStandard.core.ttypes.MIPAddress", "line_number": 61, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 100, "usage_type": "call" ...
539510536
# https://projecteuler.net/problem=5 from collections import Counter from math import sqrt def find_prime_factors(number, results=[]): """ Results is created once and we use python reference to reuse the same list. """ prime = smallest_prime(number) if prime: # If we have found a prime it ...
raulcd/project-euler
euler/problem005.py
problem005.py
py
1,954
python
en
code
0
github-code
6
[ { "api_name": "math.sqrt", "line_number": 27, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 38, "usage_type": "call" } ]
11855563133
import sys import json from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.QtCore import * from P2PNode import P2PNode class Window(QMainWindow): def __init__(self, host='localhost', port=5000): super().__init__() #Initialises stored IP and port variables self.host = host ...
elioskmil/SoftwareDevFinalProj
Window.py
Window.py
py
7,492
python
en
code
0
github-code
6
[ { "api_name": "P2PNode.P2PNode", "line_number": 22, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 141, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 224, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_numbe...
26003394923
from mpi4py import MPI import numpy as np comm = MPI.COMM_WORLD rank = comm.rank data = list() matrix_data = list() tam = 1000 a = np.random.randint(100, size=(tam, tam)) c = np.random.randint(100, size=tam) nuevoVector = np.zeros(len(c)) comm.Barrier() t_start = MPI.Wtime() def multiplicarFila_X_Vector(matrix_...
leoAlvTor/AlvaradoTorres_Leonardo_Examen
main.py
main.py
py
1,958
python
en
code
0
github-code
6
[ { "api_name": "mpi4py.MPI.COMM_WORLD", "line_number": 4, "usage_type": "attribute" }, { "api_name": "mpi4py.MPI", "line_number": 4, "usage_type": "name" }, { "api_name": "numpy.random.randint", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.random...
23886429484
import argparse, json import pandas as pd def process_cnv_vcf(vcf_lines_list): genomic_lines = [] for line in vcf_lines_list: record = dict() if not line[0].startswith('#'): record = { "chrm": line[0], "start": int(line[1]), } ...
mark-welsh/cancerdx-wgs
reformat_cnv_vcf.py
reformat_cnv_vcf.py
py
1,336
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 23, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 29, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 34, "usage_type": "call" } ]
35787277366
import pytest from app.apiclients.api_client import ApiClient # This is the same as using the @pytest.mark.anyio on all test functions in the module pytestmark = pytest.mark.anyio urls = ["https://google.com"] @pytest.mark.parametrize('anyio_backend', ['asyncio']) async def test_api_client(): for url in urls: ...
jetoslabs/dhruv-email-integration
app/tests/apiclients/test_api_client.py
test_api_client.py
py
544
python
en
code
0
github-code
6
[ { "api_name": "pytest.mark", "line_number": 6, "usage_type": "attribute" }, { "api_name": "app.apiclients.api_client.ApiClient", "line_number": 13, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 10, "usage_type": "call" }, { "api_n...
8783685417
import os import signal import time import threading import pytest import queuety @pytest.mark.parametrize("tested_signal", ("SIGINT", "SIGTERM", "SIGHUP")) def test_entry_main( tested_signal, create_mock_coro, event_loop, mock_queue, mock_gather ): tested_signal = getattr(signal, tested_signal) mock_en...
asyks/queuety
tests/test_entry.py
test_entry.py
py
1,177
python
en
code
0
github-code
6
[ { "api_name": "time.sleep", "line_number": 20, "usage_type": "call" }, { "api_name": "os.kill", "line_number": 21, "usage_type": "call" }, { "api_name": "os.getpid", "line_number": 21, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 23...
39374634414
#!/usr/bin/env python3 import argparse import os from common.console import Term import git import pathlib import json import time import sys import json try: from versioning import version_string except ModuleNotFoundError: def version_string(): return "Unknown version" def find_root_git_dir(dir): ...
gwutama/dev-tools
scripts/gitinfo.py
gitinfo.py
py
12,453
python
en
code
0
github-code
6
[ { "api_name": "os.path.isfile", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_number": 27, "usage_type": "attribute" }, { "api_name": "os.path.isdir", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path", "line_number"...
43974970200
import warnings from datetime import datetime from dateutil import parser as dateparser import structlog from pyramid.events import NewRequest, NewResponse from pyramid.exceptions import ConfigurationError from pyramid.httpexceptions import HTTPTemporaryRedirect, HTTPGone from pyramid.renderers import JSON as JSONRend...
mozilla-services/cliquet
cliquet/initialization.py
initialization.py
py
19,215
python
en
code
65
github-code
6
[ { "api_name": "newrelic.agent", "line_number": 18, "usage_type": "name" }, { "api_name": "webob.request", "line_number": 49, "usage_type": "attribute" }, { "api_name": "cliquet.utils.json", "line_number": 49, "usage_type": "attribute" }, { "api_name": "cliquet.uti...
34431549596
from logging import getLogger from telegram import Bot, Update from telegram.ext import Dispatcher, CommandHandler from telegram import ParseMode from chalicelib.sns_manage import publish_to_sns from chalicelib.models import Subscription from chalicelib.messages import ( TGCaseStatsMessage, TGHelpMessage, ...
beugene-orcher/covid-19-bot
chalicelib/covid19bot.py
covid19bot.py
py
3,066
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 21, "usage_type": "call" }, { "api_name": "chalicelib.configer.APP_NAME", "line_number": 21, "usage_type": "name" }, { "api_name": "telegram.Bot", "line_number": 22, "usage_type": "call" }, { "api_name": "chaliceli...
41315883605
# encoding:utf-8 import requests import base64 # client_id 为官网获取的AK, client_secret 为官网获取的SK def getToken(): host = 'https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id=mmQnMG1Um66XS61FjDMqRaMt&client_secret=AxSP62vTNT9IVuf0PnAWZkVFrHiPWviD' response = requests.get(host) token...
beishangongzi/somethingforfun
动漫化/main.py
main.py
py
1,348
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "base64.b64encode", "line_number": 30, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 36, "usage_type": "call" }, { "api_name": "base64.b64decode", "l...
28178948572
import argparse import pickle import SPARQLWrapper import tqdm def main(): parser = argparse.ArgumentParser(prog="get_additional_triples", description="Get additional triples of entities " "appearing in triples of relations of " ...
pmonnin/YAGO4-LP
src/get_additional_triples.py
get_additional_triples.py
py
2,756
python
en
code
2
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "call" }, { "api_name": "SPARQLWrapper.SPARQLWrapper", "line_number": 18, "usage_type": "call" }, { "api_name": "SPARQLWrapper.JSON", "line_number": 21, "usage_type": "attribute" }, { "api_na...
19396155100
from flask import Flask, render_template, jsonify from flask_restful import Resource, Api from flask_cors import CORS app = Flask(__name__) # api= Api(app) CORS(app) # def cust_dict(book): # from openpyxl import Workbook # from openpyxl import load_workbook # wb = load_workbook(book) # ws = wb.active # cust_di...
jawadfarid/evolveu
python/Comp_240/comp_240.py
comp_240.py
py
5,842
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 7, "usage_type": "call" }, { "api_name": "openpyxl.load_workbook", "line_number": 73, "usage_type": "call" }, { "api_name": "{'Workbook': 'openpy...
5711237355
#!/usr/bin/python #-*- encoding:UTF-8 -*- import wx import sys import taskManager class DemoFrame(wx.Frame): def __init__(self): wx.Frame.__init__(self, None, -1, "TaskManager", size=(640,480)) self.list = wx.ListCtrl(self, -1, style=wx.LC_REPORT)#创建列表 # Add some columns self.list...
sensal/SomeFiles
python_taskManager/test.py
test.py
py
1,359
python
en
code
0
github-code
6
[ { "api_name": "wx.Frame", "line_number": 7, "usage_type": "attribute" }, { "api_name": "wx.Frame.__init__", "line_number": 9, "usage_type": "call" }, { "api_name": "wx.Frame", "line_number": 9, "usage_type": "attribute" }, { "api_name": "wx.ListCtrl", "line_nu...
73787036349
""" Code to study groups of cells that activate together """ from tqdm.auto import tqdm as pbar import numpy as np import pandas as pd from matplotlib import pyplot as plt from tctx.analysis import simbatch as sb from tctx.util import spike_trains as spt, plot from kmodes.kmodes import KModes class Amat: """ ...
comp-neural-circuits/tctx
tctx/analysis/amat.py
amat.py
py
16,664
python
en
code
1
github-code
6
[ { "api_name": "numpy.all", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.issubdtype", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.floating", "line_number": 28, "usage_type": "attribute" }, { "api_name": "numpy.float", "lin...
7807987381
import pandas as pd import numpy as np import torch.optim as optim import json import sys import time import torch import math from torch import nn # from skorch import NeuralNetClassifier from rf import one_h_suits, get_tree_info, create_unstructured_example from rf import process_structured_test_examples, cache_dir,...
DanCunnington/FFNSL
examples/follow_suit/baselines/fcn.py
fcn.py
py
18,053
python
en
code
2
github-code
6
[ { "api_name": "os.path.realpath", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 24, "usage_type": "call" }, { "api_name": "sys.path.append", ...
2831476730
import numpy as np from scipy.special import factorial x = np.pi/2 exp = np.arange(0,100,2) a = x**exp fact = factorial(exp) termos = a/fact termos[1::2]= -1*termos[1::2] cosvalue = termos.sum() print(cosvalue) print(np.cos(x))
tmpereira/Curso_Python
lista 05/lista05_04.py
lista05_04.py
py
229
python
en
code
11
github-code
6
[ { "api_name": "numpy.pi", "line_number": 3, "usage_type": "attribute" }, { "api_name": "numpy.arange", "line_number": 4, "usage_type": "call" }, { "api_name": "scipy.special.factorial", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.cos", "line...
16799481850
import argparse from pathlib import Path import sys # Add aoc_common to the python path file = Path(__file__) root = file.parent.parent sys.path.append(root.as_posix()) parser = argparse.ArgumentParser() parser.add_argument('--sample', '-s', help='Run with sample data', action='store_true', default=False) parsed_arg...
mrkirby153/AdventOfCode2022
day07/day07.py
day07.py
py
4,259
python
en
code
0
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", ...
45365011493
import dash from dash import dcc, html, dash_table from dash.dependencies import Input, Output import numpy as np import pandas as pd from collections import defaultdict def check_first(s): bads = {'Collected', 'Harvested', 'collected', 'harvested'} for bad in bads: if bad in s: return Fa...
pakreinbold/skyrim-alchemy
apps/tabbed_skyrim_app.py
tabbed_skyrim_app.py
py
8,532
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_html", "line_number": 20, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 60, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 99, "usage_type": "call" }, { "api_name": "numpy.zeros...
21792538798
import os import json import shlex import shutil import subprocess from subprocess import STDOUT, check_output from distutils.version import LooseVersion from blacklist import BLACKLIST from random import shuffle def attrget(item, key): keys = key.split('.') for key in keys: if item: it...
mdamien/chrome-extensions-archive
extstats/notused/make_repos.py
make_repos.py
py
2,477
python
en
code
384
github-code
6
[ { "api_name": "distutils.version.LooseVersion", "line_number": 31, "usage_type": "call" }, { "api_name": "os.devnull", "line_number": 34, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 36, "usage_type": "call" }, { "api_name": "blacklist.BL...
11091581610
from tkinter import * from PIL import Image,ImageTk tk=Tk() canvas = Canvas(tk, width=1080, height=620,bg='firebrick1',relief=RIDGE) canvas.pack() root_posn1=(400,520) load = Image.open('C:\\Users\\DELL\\Desktop\\Data_structure\\Plate1.PNG') img = ImageTk.PhotoImage(load) class stack: def __init__(self): ...
shahjebhasan/Data_Structure-Visualiztion
stack.py
stack.py
py
1,256
python
en
code
0
github-code
6
[ { "api_name": "PIL.Image.open", "line_number": 7, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 7, "usage_type": "name" }, { "api_name": "PIL.ImageTk.PhotoImage", "line_number": 8, "usage_type": "call" }, { "api_name": "PIL.ImageTk", "line_...
10554931990
from anytree import Node, PreOrderIter, RenderTree from anytree.exporter import UniqueDotExporter import pygraphviz as pvg import random import os, hashlib from tkinter import * from tkinter import messagebox import cv2 # import pygame def uniqueID(): return hashlib.md5(os.urandom(32)).hexdigest()[:5] def indiceA...
its-dev-fer/Ahorcado-con-arboles
v2/v2.py
v2.py
py
7,216
python
es
code
0
github-code
6
[ { "api_name": "hashlib.md5", "line_number": 12, "usage_type": "call" }, { "api_name": "os.urandom", "line_number": 12, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 15, "usage_type": "call" }, { "api_name": "anytree.Node", "line_number...
31619972288
from typing import Mapping, Any from psycopg2._psycopg import connection as Connection from psycopg2.pool import SimpleConnectionPool class ConnectionPool: def __init__(self, config: Mapping[str, Any]): self.config = config self.connection_pool = None def create_pool(self): self.con...
cnry/airbyte
airbyte-integrations/connectors/destination-redshift-no-dbt/destination_redshift_no_dbt/connection_pool.py
connection_pool.py
py
1,038
python
en
code
null
github-code
6
[ { "api_name": "typing.Mapping", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 8, "usage_type": "name" }, { "api_name": "psycopg2.pool.SimpleConnectionPool", "line_number": 14, "usage_type": "call" }, { "api_name": "psycopg2._...
39780270274
#!/bin/python3 # From https://gpiozero.readthedocs.io/en/stable/remote_gpio.html #import libraries from gpiozero import LED from gpiozero.pins.pigpio import PiGPIOFactory from time import sleep factory2 = PiGPIOFactory(host='192.168.16.1') #factory3 = PiGPIOFactory(host='192.168.1.4') led_1 = LED(17) # local pin l...
gitswovi/gits-coding
python/gpiozero/myRemoteLED.py
myRemoteLED.py
py
580
python
en
code
1
github-code
6
[ { "api_name": "gpiozero.pins.pigpio.PiGPIOFactory", "line_number": 10, "usage_type": "call" }, { "api_name": "gpiozero.LED", "line_number": 13, "usage_type": "call" }, { "api_name": "gpiozero.LED", "line_number": 14, "usage_type": "call" }, { "api_name": "time.sle...