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
17598457644
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from PIL import Image def make_pages(page, item_list, page_size): paginator = Paginator(item_list, page_size) try: images = paginator.page(int(page)) except PageNotAnInteger: images = paginator.page(1) except EmptyPage: images = pag...
mr-shubhamsinghal/gallery-app
gallery/utils.py
utils.py
py
510
python
en
code
0
github-code
6
[ { "api_name": "django.core.paginator.Paginator", "line_number": 8, "usage_type": "call" }, { "api_name": "django.core.paginator.PageNotAnInteger", "line_number": 12, "usage_type": "name" }, { "api_name": "django.core.paginator.EmptyPage", "line_number": 14, "usage_type": ...
7176590579
import secrets from eth_keys import ( keys, ) from eth_utils import ( int_to_big_endian, ) try: import factory except ImportError: raise ImportError( "The p2p.tools.factories module requires the `factory_boy` library." ) def _mk_private_key_bytes() -> bytes: return int_to_big_endian(...
ethereum/py-evm
eth/tools/factories/keys.py
keys.py
py
772
python
en
code
2,109
github-code
6
[ { "api_name": "eth_utils.int_to_big_endian", "line_number": 19, "usage_type": "call" }, { "api_name": "secrets.randbits", "line_number": 19, "usage_type": "call" }, { "api_name": "factory.Factory", "line_number": 22, "usage_type": "attribute" }, { "api_name": "eth...
18183301241
from django.shortcuts import render, redirect from django.views.generic.edit import CreateView, UpdateView, DeleteView from .models import Post, Comment from .forms import CommentForm, ContactForm # Create your views here. def home(request): return render(request, 'home.html') def about(request): return rend...
gollobc/Meridio-Full-Stack-App
meridio/main_app/views.py
views.py
py
1,500
python
en
code
0
github-code
6
[ { "api_name": "django.shortcuts.render", "line_number": 9, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 12, "usage_type": "call" }, { "api_name": "models.Post.objects.all", "line_number": 15, "usage_type": "call" }, { "api_name":...
34450081054
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.shortcuts import render from django.views.generic.base import View from django.http import JsonResponse from participa.settings import SEFAZ_API_URL from participa.auth_sefaz.views import ParticipaSefazRequest, BaseView from pa...
vctrferreira/hackathon-sefaz
participa/report/views.py
views.py
py
2,135
python
en
code
1
github-code
6
[ { "api_name": "participa.auth_sefaz.views.BaseView", "line_number": 15, "usage_type": "name" }, { "api_name": "json.loads", "line_number": 22, "usage_type": "call" }, { "api_name": "participa.auth_sefaz.models.User.objects.filter", "line_number": 23, "usage_type": "call" ...
39915090383
import numpy as np import pandas as pd import math import requests, json, time from datetime import datetime class Processor: def __init__(self, history_length): self.history_length = history_length def fetchHistoricalDataForTicker(self, fsym, tsym, lim): df_cols = ['time', 'open', 'high', 'low', 'close', 'vo...
kwhuo68/rl-btc
processor.py
processor.py
py
1,365
python
en
code
3
github-code
6
[ { "api_name": "time.time", "line_number": 13, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 16, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 17, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number...
73051866108
import matplotlib.pyplot as plt import numpy as np import os import PIL import tensorflow as tf from tensorflow import keras model = tf.keras.models.load_model('C:/AI/model.h5') class_names = ['daisy', 'dandelion', 'roses', 'sunflowers', 'tulips'] img_height = 180 img_width = 180 sunflower_url = "http...
dasfef/PyQt5
Ex20221202_3(h5 activate).py
Ex20221202_3(h5 activate).py
py
925
python
en
code
0
github-code
6
[ { "api_name": "tensorflow.keras.models.load_model", "line_number": 9, "usage_type": "call" }, { "api_name": "tensorflow.keras", "line_number": 9, "usage_type": "attribute" }, { "api_name": "tensorflow.keras.utils.get_file", "line_number": 16, "usage_type": "call" }, {...
74147628668
# coding: utf-8 """ Pydici billing views. Http request are processed here. @author: Sébastien Renard (sebastien.renard@digitalfox.org) @license: AGPL v3 or newer (http://www.gnu.org/licenses/agpl-3.0.html) """ from datetime import date, timedelta import mimetypes import json from io import BytesIO import os import sub...
digitalfox/pydici
billing/views.py
views.py
py
39,484
python
en
code
122
github-code
6
[ { "api_name": "datetime.date.today", "line_number": 59, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 59, "usage_type": "name" }, { "api_name": "datetime.timedelta", "line_number": 60, "usage_type": "call" }, { "api_name": "crm.utils.get_su...
38217350686
#!/usr/bin/env python3 import argparse import sys from typing import List, Union import uuid import capstone_gt import gtirb from gtirb_capstone.instructions import GtirbInstructionDecoder def lookup_sym(node: gtirb.Block) -> Union[str, None]: """ Find a symbol name that describes the node. """ for s...
GrammaTech/ddisasm
tests/check_gtirb.py
check_gtirb.py
py
16,220
python
en
code
581
github-code
6
[ { "api_name": "gtirb.Block", "line_number": 12, "usage_type": "attribute" }, { "api_name": "typing.Union", "line_number": 12, "usage_type": "name" }, { "api_name": "gtirb.Block", "line_number": 21, "usage_type": "attribute" }, { "api_name": "gtirb.ProxyBlock", ...
38756128140
""" Kubernetes server class implementation. """ from __future__ import absolute_import import os import logging import uuid from kubernetes import config from kubernetes import client as k8sclient from kubernetes.client.rest import ApiException from retry import retry from pytest_server_fixtures import CONFIG from .c...
man-group/pytest-plugins
pytest-server-fixtures/pytest_server_fixtures/serverclass/kubernetes.py
kubernetes.py
py
5,398
python
en
code
526
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "pytest_server_fixtures....
72531788029
# pylint: disable=redefined-outer-name # pylint: disable=unused-argument # pylint: disable=unused-variable # pylint: disable=too-many-arguments import pytest from models_library.api_schemas_webserver.projects import ( ProjectCreateNew, ProjectGet, ProjectListItem, ProjectReplace, TaskProjectGet, )...
ITISFoundation/osparc-simcore
packages/models-library/tests/test_api_schemas_webserver_projects.py
test_api_schemas_webserver_projects.py
py
2,403
python
en
code
35
github-code
6
[ { "api_name": "pytest_simcore.simcore_webserver_projects_rest_api.HttpApiCallCapture", "line_number": 36, "usage_type": "name" }, { "api_name": "models_library.api_schemas_webserver.projects.ProjectCreateNew.parse_obj", "line_number": 37, "usage_type": "call" }, { "api_name": "mo...
30815309971
from typing import List, Tuple import cmath import random _inv_root2 = 1 / cmath.sqrt(2) _root2 = cmath.sqrt(2) bra = List[complex] ket = List[complex] def vdot(v1, v2): return sum(v1[i] * v2[i] for i in range(len(v1))) def vinv(v): return [-x for x in v] def qdot(q1: ket, q2: ket) -> complex: return...
Wroppy/werry_math
physics/quantum/systems.py
systems.py
py
3,990
python
en
code
0
github-code
6
[ { "api_name": "cmath.sqrt", "line_number": 5, "usage_type": "call" }, { "api_name": "cmath.sqrt", "line_number": 6, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 7, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 8, ...
30357445001
from traits.api import HasTraits, Code from traitsui.api import Item, Group, View # The main demo class: class CodeEditorDemo(HasTraits): """Defines the CodeEditor demo class.""" # Define a trait to view: code_sample = Code('import sys\n\nsys.print("hello world!")') # Display specification: cod...
enthought/traitsui
traitsui/examples/demo/Standard_Editors/CodeEditor_demo.py
CodeEditor_demo.py
py
922
python
en
code
290
github-code
6
[ { "api_name": "traits.api.HasTraits", "line_number": 7, "usage_type": "name" }, { "api_name": "traits.api.Code", "line_number": 11, "usage_type": "call" }, { "api_name": "traitsui.api.Group", "line_number": 14, "usage_type": "call" }, { "api_name": "traitsui.api.I...
12096156845
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import requests from bs4 import BeautifulSoup, Tag from workflow import Workflow def main(wf): if not wf.args: return word = wf.args[0].strip() resp = requests.post("http://www.zdic.net/sousuo/", data={"q": word}) soup = BeautifulSou...
jinuljt/zdic.alfredworkflow
zdic.py
zdic.py
py
1,421
python
en
code
6
github-code
6
[ { "api_name": "requests.post", "line_number": 17, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 18, "usage_type": "call" }, { "api_name": "bs4.Tag", "line_number": 43, "usage_type": "argument" }, { "api_name": "workflow.Workflow", "...
17079551201
from gensim.models import KeyedVectors from anki_corpus_for_gensim import bg_stopwords,en_stopwords import json, argparse, time from flask import Flask, request from flask_cors import CORS ################################################## # API part ################################################## app = Flask(__n...
teodorToshkov/sentencesimilarity
app.py
app.py
py
1,897
python
en
code
0
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": "anki_corpus_for_gensim.bg_stopwords", "line_number": 17, "usage_type": "name" }, { "api_name": "anki_...
29778121292
import requests, os, json from bs4 import BeautifulSoup as BS from random import choice _BASE_PATH = os.path.dirname(__file__) _DATA_FILE = os.path.join(_BASE_PATH,'data.txt') _ACTORS_FILE = os.path.join(_BASE_PATH,'actors.txt') _DIRECTORS_FILE = os.path.join(_BASE_PATH,'directors.txt') _YEARS_FILE ...
asav13/PRLA-Verk5
part2/y_u_so_stupid.py
y_u_so_stupid.py
py
6,583
python
en
code
0
github-code
6
[ { "api_name": "os.path.dirname", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7...
4142566592
import ast import networkx as nx import numpy as np from collections import defaultdict import json from tqdm import tqdm # nodes = [0, 1, 2, 3, 4] # graph = [[4, 3, 0.75], [4, 1, 0.81], [4, 2, 0.97], [4, 0, 0.52]] # page_rank_probs = defaultdict(float) # DG = nx.DiGraph() # DG.add_nodes_from(nodes) # DG.add_weighted_...
Gitsamshi/Nli-image-caption
playground.py
playground.py
py
8,056
python
en
code
3
github-code
6
[ { "api_name": "numpy.exp", "line_number": 47, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 47, "usage_type": "call" }, { "api_name": "json.load", "line_number": 52, "usage_type": "call" }, { "api_name": "json.load", "line_number": 53, ...
2653030207
import torch import torch.nn as nn from torch.autograd import Variable from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence class BiLSTM(nn.Module): def __init__(self, args): super(BiLSTM, self).__init__() self.embedding_size = args.embedding_size self.hidden_size = a...
wbakst/meta-learned-embeddings
lstm.py
lstm.py
py
2,741
python
en
code
1
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 6, "usage_type": "name" }, { "api_name": "torch.nn.Embedding", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.nn", "line_n...
40555963992
from django.urls import path from Web.views import Index, Persons, Random, QuotesByPerson, QuotesByCategory, CategoryCreateView, PersonCreateView, QuoteCreateView, LogoutView from Web.api_views import APIPersons, APICategories, APIQuotes, APIQuotesByPerson, APIQuotesByCategory, APIQuotesRandom urlpatterns = [ pat...
mavenium/PyQuotes
Web/urls.py
urls.py
py
1,415
python
en
code
27
github-code
6
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "Web.views.Index.as_view", "line_number": 7, "usage_type": "call" }, { "api_name": "Web.views.Index", "line_number": 7, "usage_type": "name" }, { "api_name": "django.urls.pat...
36396608095
""" Continuous Statistics Class """ from numbers import Number from typing import Union, Tuple from functools import wraps import inspect import numpy as np from gval.statistics.base_statistics import BaseStatistics import gval.statistics.continuous_stat_funcs as cs class ContinuousStatistics(BaseStatistics): ...
NOAA-OWP/gval
src/gval/statistics/continuous_statistics.py
continuous_statistics.py
py
9,420
python
en
code
14
github-code
6
[ { "api_name": "gval.statistics.base_statistics.BaseStatistics", "line_number": 16, "usage_type": "name" }, { "api_name": "gval.statistics.continuous_stat_funcs", "line_number": 34, "usage_type": "argument" }, { "api_name": "gval.statistics.continuous_stat_funcs", "line_number...
19399859119
# 目标和 # https://leetcode-cn.com/leetbook/read/queue-stack/ga4o2/ from typing import List import common.arrayCommon as Array class Solution: def findTargetSumWays(self, nums: List[int], S: int) -> int: print(nums) s = sum(nums) if s < S: return 0 n = len(nums) ...
Yigang0622/LeetCode
findTargetSumWays.py
findTargetSumWays.py
py
1,411
python
en
code
1
github-code
6
[ { "api_name": "typing.List", "line_number": 10, "usage_type": "name" } ]
31309035194
#!/usr/bin/env python # coding: utf-8 # In[ ]: #Library Imports from __future__ import print_function, division from keras.models import Sequential, Model from keras.layers.core import Dense from keras.layers.recurrent import LSTM, GRU, SimpleRNN from keras.layers import Input from keras.utils.data_utils import get_...
RenatoMAlves/context-aware-time-prediction
code/Context-LSTM/train_addittional_feats_py3.py
train_addittional_feats_py3.py
py
13,972
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 39, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 46, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number": 52, "usage_type": "call" }, { "api_name": "os.path", "line_number":...
3096449689
from django.shortcuts import render, render_to_response from django.utils import timezone from django.http import HttpResponse, Http404 #from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.core.paginator import EmptyPage, PageNotAnInteger from flynsarmy_paginator.paginator import Flynsa...
seolakim/reve-web
foodle/views.py
views.py
py
4,218
python
en
code
0
github-code
6
[ { "api_name": "django.shortcuts.render", "line_number": 17, "usage_type": "call" }, { "api_name": "django.db.models.Q", "line_number": 57, "usage_type": "call" }, { "api_name": "django.db.models.Q", "line_number": 59, "usage_type": "call" }, { "api_name": "models....
33805613545
from typing import Optional, Dict from fastapi import WebSocket, APIRouter, Cookie, status, Depends from ws_chat_py.engines.person_engine import PersonEngine ws_router = APIRouter() @ws_router.websocket("/ws") async def ws_chat_handler(websocket: WebSocket): await websocket.accept() authorized = check_cha...
backcrawler/ws_chat_py
ws_chat_py/handlers/ws_handlers.py
ws_handlers.py
py
925
python
en
code
0
github-code
6
[ { "api_name": "fastapi.APIRouter", "line_number": 8, "usage_type": "call" }, { "api_name": "fastapi.WebSocket", "line_number": 12, "usage_type": "name" }, { "api_name": "ws_chat_py.engines.person_engine.PersonEngine.create_person", "line_number": 18, "usage_type": "call" ...
28990015892
from sys import platform, version_info if True: from PyQt5.QtCore import pyqtSlot, Qt, QSettings, QTimer from PyQt5.QtGui import QFontMetrics from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QMessageBox else: from PyQt4.QtCore import pyqtSlot, Qt, QSettings, QTimer from PyQt4.QtGui import QFo...
falkTX/Cadence
src/jacksettings.py
jacksettings.py
py
41,004
python
en
code
361
github-code
6
[ { "api_name": "sys.platform", "line_number": 42, "usage_type": "name" }, { "api_name": "sys.version_info", "line_number": 45, "usage_type": "name" }, { "api_name": "dbus.Interface", "line_number": 63, "usage_type": "call" }, { "api_name": "dbus.UInt32", "line_...
71923388669
#!/usr/bin/env python import os, argparse parser = argparse.ArgumentParser() parser.add_argument("-u", required=True, dest="usuario", help="Usuario de PostgreSQL") parser.add_argument("-H", default="localhost", dest="host", help="IP del equipo remoto") parser.add_argument("-p", default="5432", dest="puerto", h...
francisjgarcia/ASGBD-2018-19
scripts/python/backup.py
backup.py
py
761
python
es
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 5, "usage_type": "call" }, { "api_name": "os.system", "line_number": 15, "usage_type": "call" } ]
39172128523
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from flask import json, make_response from flask_restplus import Api, Resource from http import HTTPStatus from .v1.api import api as api_v1 from .v2.api import api as api_v2 from .health import api as api_health api = Api() api.add_namespace(api_v1) api.add_names...
shalomb/terrestrial
apis/__init__.py
__init__.py
py
1,122
python
en
code
0
github-code
6
[ { "api_name": "flask_restplus.Api", "line_number": 14, "usage_type": "call" }, { "api_name": "v1.api.api", "line_number": 16, "usage_type": "argument" }, { "api_name": "v2.api.api", "line_number": 17, "usage_type": "argument" }, { "api_name": "health.api", "li...
33422541294
import torch import torch.nn as nn import torch.nn.functional as F import torchvision from torchvision import datasets, models, transforms from torchvision.utils import save_image from torch.utils.data import Dataset from torchvision import datasets, models, transforms from Regressor_and_loss import disparityregressi...
Pahulmeet/Stereo_Depth_Estimation
model8.py
model8.py
py
4,908
python
en
code
0
github-code
6
[ { "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": 28, "usage_type": "call" }, { "api_name": "torch.nn", "lin...
41705912087
import newspaper # Declare the url url = "https://ktechhub.com/tutorials/completely-deploy-your-laravel-application-on-ubuntu-linux-server-60a51098a8bf2" #Extract web content url = newspaper.Article(url="%s" % (url), language='en') url.download() url.parse() # Display scraped data print(url.text)
Kalkulus1/python_codes
scrape_any_web_article.py
scrape_any_web_article.py
py
302
python
en
code
0
github-code
6
[ { "api_name": "newspaper.Article", "line_number": 7, "usage_type": "call" } ]
6176179693
import os, time, sys import matplotlib.pyplot as plt import itertools import pickle import imageio import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data as data import torch.optim as optim from torchvision import datasets, transforms from torch.autograd import Variable import torchv...
hqyu/DL_GAN
GAN.py
GAN.py
py
4,169
python
en
code
0
github-code
6
[ { "api_name": "torch.utils.data.DataLoader", "line_number": 25, "usage_type": "call" }, { "api_name": "torch.utils.data", "line_number": 25, "usage_type": "name" }, { "api_name": "torchvision.datasets.MNIST", "line_number": 26, "usage_type": "call" }, { "api_name"...
7713955808
#!/usr/bin/python # -*- coding: utf-8 -*- from flask import Flask myApp = Flask(__name__) @myApp.route('/') def bonjour(): message = 'Bonjour, je suis Ramy \n' return message if __name__ == '__main__': myApp.run(host='0.0.0.0', port=8080)
RMDHMN/pythonFlash_testing
app.py
app.py
py
254
python
en
code
1
github-code
6
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" } ]
16471277711
""" A row measuring seven units in length has red blocks with a minimum length of three units placed on it, such that any two red blocks (which are allowed to be different lengths) are separated by at least one black square. There are exactly seventeen ways of doing this. How many ways can a row measuring fifty units ...
bsamseth/project-euler
114/114.py
114.py
py
1,999
python
en
code
0
github-code
6
[ { "api_name": "functools.lru_cache", "line_number": 32, "usage_type": "call" }, { "api_name": "time.time", "line_number": 43, "usage_type": "call" }, { "api_name": "time.time", "line_number": 44, "usage_type": "call" } ]
36668954335
from abc import ABC, abstractmethod # enum and constants from enum import Enum from uuid import UUID from time import time import threading class VehicleType(Enum): # supported vehicle CAR = 'car' TRUCK = 'truck' VAN = 'van' MOTORBIKE = 'motorbike' class ParkingSpotType(Enum): # available s...
manofsteel-ab/design-patterns
oo_design/parking_lot.py
parking_lot.py
py
11,034
python
en
code
0
github-code
6
[ { "api_name": "enum.Enum", "line_number": 10, "usage_type": "name" }, { "api_name": "enum.Enum", "line_number": 18, "usage_type": "name" }, { "api_name": "enum.Enum", "line_number": 26, "usage_type": "name" }, { "api_name": "enum.Enum", "line_number": 31, ...
75066660668
import scipy.io as sio import numpy as np class ReadFiles(object): def __init__(self): spamData = sio.loadmat('../data/spam_data.mat', struct_as_record=False) self.header = spamData['__header__'] self.version = spamData['__version__'] self.names = spamData['names'] pTrain...
Skalwalker/SpamRecognition
scripts/readfiles.py
readfiles.py
py
1,011
python
en
code
0
github-code
6
[ { "api_name": "scipy.io.loadmat", "line_number": 7, "usage_type": "call" }, { "api_name": "scipy.io", "line_number": 7, "usage_type": "name" }, { "api_name": "numpy.concatenate", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.concatenate", "li...
39399750947
import logging import os import argparse import json from itertools import chain from typing import Dict, List, Tuple, Any from functools import partial import s3fs from hydra import compose, initialize, core from omegaconf import OmegaConf import numpy as np os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # Nopep8 import...
YangWu1227/python-for-machine-learning
neural_network/projects/cnn_insect_classification_sagemaker/src/baseline_entry.py
baseline_entry.py
py
12,600
python
en
code
0
github-code
6
[ { "api_name": "os.environ", "line_number": 14, "usage_type": "attribute" }, { "api_name": "base_trainer.BaseTrainer", "line_number": 21, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 26, "usage_type": "name" }, { "api_name": "typing.Any", ...
22400134597
from PyQt5 import QtWidgets from diz3_2 import * # импорт нашего сгенерированного файла import sys from BD import Orm class Dialog2(QtWidgets.QDialog): def __init__(self, id): self.id = id super(Dialog2, self).__init__() self.ui = Ui_Dialog() self.ui.setupUi(self) self.ui...
Vorlogg/BD
dialog2.py
dialog2.py
py
1,367
python
en
code
0
github-code
6
[ { "api_name": "PyQt5.QtWidgets.QDialog", "line_number": 7, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidgets", "line_number": 7, "usage_type": "name" }, { "api_name": "BD.Orm", "line_number": 22, "usage_type": "call" } ]
19691344827
"""Define custom dataset class extending the Pytorch Dataset class""" import os from typing import Dict, List, Tuple import numpy as np import pandas as pd from PIL import Image import torch from torch.utils.data import DataLoader, Dataset import torchvision.transforms as tvt from utils.utils import Params class S...
karanrampal/sketches
src/model/data_loader.py
data_loader.py
py
3,585
python
en
code
0
github-code
6
[ { "api_name": "torch.utils.data.Dataset", "line_number": 16, "usage_type": "name" }, { "api_name": "torchvision.transforms", "line_number": 19, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 27, "usage_type": "call" }, { "api_name": "os.pa...
19399695029
from typing import List import copy class Solution: def calcEquation(self, equations: List[List[str]], values: List[float], queries: List[List[str]]) -> List[float]: graph = {} s = set() for i, each in enumerate(equations): nominator = each[0] denominator = each[1] ...
Yigang0622/LeetCode
calcEquation.py
calcEquation.py
py
2,160
python
en
code
1
github-code
6
[ { "api_name": "typing.List", "line_number": 6, "usage_type": "name" }, { "api_name": "copy.deepcopy", "line_number": 51, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 52, "usage_type": "call" } ]
1512983994
""" This file contains helper functions for the project """ # import libraries import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as patches from math import atan2, degrees import urllib.request from PIL import Image # functions def get_tracking_data(): """ Funct...
emekaamadi/Milestone-1-NFL-Project
src/functions.py
functions.py
py
5,059
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.abs", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 2...
1307107485
import functools import os import re from importlib import import_module from typing import Callable, Pattern import yaml from livelossplot.outputs import NeptuneLogger def unpack_config(func: Callable) -> Callable: """Load parameters from a config file and inject it to function keyword arguments""" @functoo...
Bartolo1024/RLCarRacing
utils.py
utils.py
py
2,684
python
en
code
0
github-code
6
[ { "api_name": "typing.Callable", "line_number": 11, "usage_type": "name" }, { "api_name": "yaml.full_load", "line_number": 19, "usage_type": "call" }, { "api_name": "functools.wraps", "line_number": 13, "usage_type": "call" }, { "api_name": "typing.Pattern", "...
6932656070
import gc import json import numpy as np import optuna import pandas as pd import sys import warnings import xgboost from glob import glob from sklearn.model_selection import KFold, StratifiedKFold from tqdm import tqdm from utils import FEATS_EXCLUDED, loadpkl, line_notify, to_json #===============================...
MitsuruFujiwara/KDD-Cup-2019
src/804_optimize_xgb_optuna.py
804_optimize_xgb_optuna.py
py
3,421
python
en
code
3
github-code
6
[ { "api_name": "warnings.filterwarnings", "line_number": 22, "usage_type": "call" }, { "api_name": "json.load", "line_number": 25, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 28, "usage_type": "call" }, { "api_name": "pandas.concat", "line...
6589740252
import pickle from flask import Flask, request, render_template, jsonify, send_file from elasticsearch import Elasticsearch from transformers import pipeline, AutoTokenizer, AutoModelForQuestionAnswering, AutoModel import spacy import json import time from pymongo import MongoClient import os from sklearn.linear_model ...
szegedai/SHunQA
backend/flask_service.py
flask_service.py
py
8,073
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 12, "usage_type": "call" }, { "api_name": "json.load", "line_number": 16, "usage_type": "call" }, { "api_name": "transformers.pipeline", "line_number": 23, "usage_type": "call" }, { "api_name": "transformers.AutoTokenize...
7796643764
import numpy as np import pickle from engine.sim_functions import calc_local_zodiacal_minimum,Spectrograph from engine.planet_retrieval import Planet,Star from engine.main_computer import compute from itertools import chain from multiprocessing import Pool import json import sys dR_scale = float(sys.argv[1]) #Reflecta...
JonahHansen/LifeTechSim
error_sim.py
error_sim.py
py
5,550
python
en
code
0
github-code
6
[ { "api_name": "sys.argv", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 12, "usage_type": "attribute" }, { "api_name": "engine.sim_functions.Spectrograph", "line_number": 25, "usage_type": "call" }, { "api_name": "engine....
31974764531
# -*- coding: utf-8 -*- import json import scrapy from club_activity_friends_details.items import ClubActivityFriendsDetailsItem from lib.GetCurrentTime import get_current_date from models.club import StructureStartUrl class AutoHomeClubActivityFriendsDetailsSpider(scrapy.Spider): name = 'auto_home_club_activity...
CY113/Cars
club_activity_friends_details/club_activity_friends_details/spiders/auto_home_club_activity_friends_details.py
auto_home_club_activity_friends_details.py
py
2,113
python
en
code
10
github-code
6
[ { "api_name": "scrapy.Spider", "line_number": 10, "usage_type": "attribute" }, { "api_name": "models.club.StructureStartUrl", "line_number": 12, "usage_type": "call" }, { "api_name": "club_activity_friends_details.items.ClubActivityFriendsDetailsItem", "line_number": 19, ...
36413248388
# --------------- # ParamCopy - Substance 3D Designer plugin # (c) 2019-2022 Eyosido Software SARL # --------------- import os, weakref from functools import partial from PySide2.QtCore import QObject from PySide2.QtWidgets import QToolBar import sd from sd.context import Context from sd.api.sdapplication import SDA...
eyosido/ParamCopy
src/paramcopy/pcui/pctoolbar.py
pctoolbar.py
py
2,317
python
en
code
9
github-code
6
[ { "api_name": "PySide2.QtCore.QObject", "line_number": 20, "usage_type": "name" }, { "api_name": "sd.getContext", "line_number": 26, "usage_type": "call" }, { "api_name": "functools.partial", "line_number": 29, "usage_type": "call" }, { "api_name": "functools.part...
5254327339
# -*- coding: utf-8 -*- """ Utility functions @authors: Álvaro Ramírez Cardona (alramirezca@unal.edu.co) Vanessa Robledo Delgado (vanessa.robledo@udea.edu.co) """ from os import path import xarray as xr import numpy as np import pandas as pd from scipy import ndimage import geopandas as gpd from datetime im...
alramirezca/ATRACKCS
atrackcs/utils/funcs.py
funcs.py
py
11,183
python
en
code
7
github-code
6
[ { "api_name": "warnings.filterwarnings", "line_number": 29, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 61, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 62, "usage_type": "call" }, { "api_name": "xarray.open_mfdataset", ...
25441389301
# -*- coding: utf-8 -*- from PIL import Image,ImageFont,ImageDraw import json import cover import time from io import BytesIO def paste_with_a(base_img_, img_, pos): if 4 == len(img_.split()): r,g,b,a = img_.split() base_img_.paste(img_, pos,mask=a) else: base_img_.paste(img_, pos) ...
kakinumaCN/maimai_DX_rating_image
main.py
main.py
py
9,086
python
en
code
0
github-code
6
[ { "api_name": "PIL.ImageDraw.Draw", "line_number": 31, "usage_type": "call" }, { "api_name": "PIL.ImageDraw", "line_number": 31, "usage_type": "name" }, { "api_name": "cover.download_cover", "line_number": 41, "usage_type": "call" }, { "api_name": "PIL.Image.open"...
28339823949
def secondElem(a): return a[1] def alphasort(a): a.sort(key=secondElem,reverse=True) for i in range(len(a)-1): if a[i][1] == a[i+1][1] and a[i][0] > a[i+1][0]: a[i],a[i+1] = a[i+1],a[i] return a from collections import Counter name = list(Counter(input()).items()) name = al...
t3chcrazy/Hackerrank
company-logo.py
company-logo.py
py
389
python
en
code
0
github-code
6
[ { "api_name": "collections.Counter", "line_number": 10, "usage_type": "call" } ]
34200144967
import pandas as pd import numpy as np import matplotlib.pyplot as plt from matplotlib import cm as cm import matplotlib.lines as mlines df= pd.read_csv('/home/nishchay/Documents/Arcon/Day7/winequality-red.csv') X1=df.iloc[:,11].values Y1=df.iloc[:,0].values Y2=df.iloc[:,1].values fig = plt.figure() ax1 = fig.add_sub...
nagrawal63/Neural-Networks
Day7/plot.py
plot.py
py
2,190
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 12, "usage_type": "name" }, { "api_name": "matplotlib....
10414874563
import itertools import operator import types from typing import Any, List, Optional, Tuple, Type import torch from executorch.exir.dialects.edge._ops import EdgeOpOverload from executorch.exir.error import ExportError, ExportErrorType from executorch.exir.lowered_backend_module import LoweredBackendModule from execut...
pytorch/executorch
exir/verification/verifier.py
verifier.py
py
7,890
python
en
code
479
github-code
6
[ { "api_name": "torch.fx.GraphModule", "line_number": 25, "usage_type": "name" }, { "api_name": "itertools.chain", "line_number": 27, "usage_type": "call" }, { "api_name": "torch.Tensor", "line_number": 28, "usage_type": "attribute" }, { "api_name": "torch._export....
21699610056
import cv2 # Method: getFrames # Purpose: Extract a predefined number of frames from a provided video # Parameters: video_capture: provided video # frame_num: the desired number of frames # frame_start: optional value to input for start of frame def get_frames(video_capture, frame_num, frame_s...
ccranson27/ccr_playground
frame_gathering.py
frame_gathering.py
py
2,033
python
en
code
0
github-code
6
[ { "api_name": "cv2.cvtColor", "line_number": 24, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2RGB", "line_number": 24, "usage_type": "attribute" }, { "api_name": "cv2.cvtColor", "line_number": 41, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY",...
7066069240
import sys,os,subprocess,string,re from threading import Timer import time,socket,json from os import path base_dir = path.dirname(path.abspath(sys.path[0])) print(base_dir) sys.path.append(base_dir) class HfsSetup(): def __init__(self,hver='',plants='',adict={}): self._run_code = True self._plan...
kRayvison/Pycharm_python36
new_render_data/input/p/script/CG/Houdini/function/old/HoudiniMain/HoudiniAppSet.py
HoudiniAppSet.py
py
5,487
python
en
code
1
github-code
6
[ { "api_name": "os.path.dirname", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "name" }, { "api_name": "os.path.abspath", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 6,...
25081332800
# If this is the name of a readable file, the Python commands in that file are # executed before the first prompt is displayed in interactive mode. # https://docs.python.org/3/using/cmdline.html#envvar-PYTHONSTARTUP # # Sample code which supports concurrent interactive sessions, by only # appending the new history is t...
mvshmakov/dotfiles
python/.config/python/pythonstartup.py
pythonstartup.py
py
1,442
python
en
code
3
github-code
6
[ { "api_name": "os.path.join", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.getenv", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number...
38736630905
import datetime import logging import matplotlib.pyplot as plt import numpy as np import numpy.typing as npt from backend.data.measurements import MeasurementArray, Measurements logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) def xyz2blh(x, y, z): """_summary_ Angle returned will be in ra...
GeoscienceAustralia/ginan
scripts/GinanEDA/backend/data/position.py
position.py
py
3,039
python
en
code
165
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.sqrt", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.arctan2", "l...
37822719553
"""Contains the MetaCurriculum class.""" import os from unitytrainers.curriculum import Curriculum from unitytrainers.exception import MetaCurriculumError import logging logger = logging.getLogger('unitytrainers') class MetaCurriculum(object): """A MetaCurriculum holds curriculums. Each curriculum is associate...
Sohojoe/ActiveRagdollAssaultCourse
python/unitytrainers/meta_curriculum.py
meta_curriculum.py
py
3,968
python
en
code
37
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 35, "usage_type": "call" }, { "api_name": "os.path", "line_number":...
57215059
import pytest import numpy as np import os from netZooPy import dragon def test_dragon(): #1. test1 print('Start Dragon run ...') n = 1000 p1 = 500 p2 = 100 X1, X2, Theta, _ = dragon.simulate_dragon_data(eta11=0.005, eta12=0.005, eta22=0.05, p1=100, p...
netZoo/netZooPy
tests/test_dragon.py
test_dragon.py
py
5,525
python
en
code
71
github-code
6
[ { "api_name": "netZooPy.dragon.simulate_dragon_data", "line_number": 12, "usage_type": "call" }, { "api_name": "netZooPy.dragon", "line_number": 12, "usage_type": "name" }, { "api_name": "os.system", "line_number": 15, "usage_type": "call" }, { "api_name": "os.sys...
195263286
from django.db import models from core.models import Service, PlCoreBase, Slice, Instance, Tenant, TenantWithContainer, Node, Image, User, Flavor, Subscriber from core.models.plcorebase import StrippedCharField import os from django.db import models, transaction from django.forms.models import model_to_dict from django...
xmaruto/mcord
xos/services/ceilometer/models.py
models.py
py
10,893
python
en
code
0
github-code
6
[ { "api_name": "core.models.Service", "line_number": 17, "usage_type": "name" }, { "api_name": "core.models.TenantWithContainer", "line_number": 33, "usage_type": "name" }, { "api_name": "sets.Set", "line_number": 124, "usage_type": "call" }, { "api_name": "core.mo...
74632636347
# -*- coding: utf-8 -*- """ Sihoo Celery Worker 模块 @author: AZLisme @email: helloazl@icloud.com """ from celery import Celery celery_app = Celery('SihooWorker') def configure(app): celery_app.config_from_object('sihoo.settings.celery-setting') celery_app.config_from_envvar('SIHOO_CELERY_SETTINGS', silen...
AZLisme/sihoo
sihoo/tasks/__init__.py
__init__.py
py
370
python
en
code
4
github-code
6
[ { "api_name": "celery.Celery", "line_number": 13, "usage_type": "call" } ]
158477486
import datetime as dt from rest_framework import status from rest_framework.exceptions import NotAuthenticated, PermissionDenied from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response from rest_framework.views import APIView from bumblebee.core.exceptions import ( Miss...
sthasam2/bumblebee-backend
bumblebee/feeds/api/views/feed_views.py
feed_views.py
py
4,226
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.views.APIView", "line_number": 27, "usage_type": "name" }, { "api_name": "rest_framework.permissions.IsAuthenticated", "line_number": 30, "usage_type": "name" }, { "api_name": "bumblebee.feeds.utils.get_folowing_buzzes_for_user", "line_number": 3...
27577951391
from django.shortcuts import get_object_or_404, render, redirect, HttpResponseRedirect from django.views.generic import TemplateView, UpdateView from django.contrib.auth import get_user_model from .models import Message from django.urls import reverse from django.contrib import messages from review.models import Review...
Afeez1131/Anonymous-v1
anonymous/views.py
views.py
py
4,560
python
en
code
0
github-code
6
[ { "api_name": "django.shortcuts.render", "line_number": 18, "usage_type": "call" }, { "api_name": "django.template.RequestContext", "line_number": 18, "usage_type": "call" }, { "api_name": "django.views.generic.TemplateView", "line_number": 23, "usage_type": "name" }, ...
7520101007
""" Created on Wed Feb 24 12:34:17 2021 @author: Narmin Ghaffari Laleh """ ############################################################################## from dataGenerator.dataSetGenerator_ClamMil import Generic_MIL_Dataset import utils.utils as utils from extractFeatures import ExtractFeatures from utils.core_util...
KatherLab/HIA
CLAM_MIL_Training.py
CLAM_MIL_Training.py
py
12,138
python
en
code
76
github-code
6
[ { "api_name": "random.seed", "line_number": 34, "usage_type": "call" }, { "api_name": "utils.utils.CreateProjectFolder", "line_number": 35, "usage_type": "call" }, { "api_name": "utils.utils", "line_number": 35, "usage_type": "name" }, { "api_name": "os.path.exist...
73933198267
from .common import * # NOQA import pytest project_detail = {"project": None, "namespace": None, "cluster": None, "project2": None, "namespace2": None, "cluster2": None} user_token = {"user_c1_p1_owner": {"user": None, "token": None}, "user_c1_p1_member": {"user": None, "token": None},...
jim02468/rancher
tests/validation/tests/v3_api/test_app.py
test_app.py
py
13,408
python
en
code
0
github-code
6
[ { "api_name": "pytest.fixture", "line_number": 319, "usage_type": "call" } ]
5560963127
""" this is a mixture of the best #free twitter sentimentanalysis modules on github. i took the most usable codes and mixed them into one because all of them where for a linguistical search not usable and did not show a retweet or a full tweet no output as csv, only few informations of a tweet, switching la...
CemFFM/Sentimentanalysis
full_equipt_sentimentanalysis .py
full_equipt_sentimentanalysis .py
py
11,573
python
en
code
0
github-code
6
[ { "api_name": "pandas.set_option", "line_number": 35, "usage_type": "call" }, { "api_name": "pandas.set_option", "line_number": 36, "usage_type": "call" }, { "api_name": "pandas.set_option", "line_number": 37, "usage_type": "call" }, { "api_name": "pandas.set_opti...
18405188691
import numpy as np from astropy import table from glob import glob import pandas as pd from scipy.stats import binned_statistic def get_outlier_fraction(tbl, suffix='', bins=20): diff = np.array(np.abs(tbl['z_est'] - tbl['z']) > 0.15 * (1 + tbl['z']), dtype=float) stat = binned_statistic(t...
minzastro/semiphore_public
utils/stats.py
stats.py
py
3,666
python
en
code
0
github-code
6
[ { "api_name": "numpy.array", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.abs", "line_number": 9, "usage_type": "call" }, { "api_name": "scipy.stats.binned_statistic", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.array", "l...
42636165267
import netCDF4 import numpy as np from matplotlib import pyplot as plt from matplotlib.colors import Normalize import cartopy.crs as ccrs import matplotlib.colors as colors # Land cover lc = netCDF4.Dataset("../data/LandCover_half.nc") lc.set_auto_mask(True) lc.variables land_cover = lc["Land Cover"][:] # fix landco...
bikempastine/Isoprene_PModel
exploration/anomaly_mapping.py
anomaly_mapping.py
py
7,350
python
en
code
0
github-code
6
[ { "api_name": "netCDF4.Dataset", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.shape", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.concatenate", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.unique", "lin...
15790344554
# -*- coding: utf-8 -*- """ Created on Tue Apr 28 23:15:17 2020 @author: malrawi """ import dicttoxml import ruamel.yaml # https://pypi.org/project/ruamel.yaml/ import json def read_yaml_as_dict(fname): """ A function used to read the ddoif dictionary in yaml format and return it as a python dictio...
morawi/ddoif
ddoif_utils.py
ddoif_utils.py
py
3,011
python
en
code
3
github-code
6
[ { "api_name": "ruamel.yaml.yaml.YAML", "line_number": 45, "usage_type": "call" }, { "api_name": "ruamel.yaml.yaml", "line_number": 45, "usage_type": "attribute" }, { "api_name": "ruamel.yaml", "line_number": 45, "usage_type": "name" }, { "api_name": "dicttoxml.dic...
25009445303
import datetime import re from random import shuffle from collections import defaultdict from django.utils.translation import ( activate, get_language_info, get_language, ) from django import http from django.shortcuts import render from django.core.cache import cache from django.conf import settings from ...
peterbe/kl2
kl/search/views.py
views.py
py
24,492
python
en
code
0
github-code
6
[ { "api_name": "nltk.corpus.wordnet", "line_number": 22, "usage_type": "name" }, { "api_name": "django.utils.translation.get_language", "line_number": 70, "usage_type": "call" }, { "api_name": "django.http.HttpResponseRedirect", "line_number": 78, "usage_type": "call" },...
19501436322
""" This file (test_youbit.py) contains unit tests for the encode.py and decode.py files. """ from pathlib import Path import os import time from yt_dlp.utils import DownloadError from tests.conftest import uploads from youbit import Encoder, download_and_decode from youbit.settings import Settings, Browser from youb...
mevimo/youbit
tests/unit/test_youbit.py
test_youbit.py
py
1,245
python
en
code
651
github-code
6
[ { "api_name": "youbit.settings.Browser", "line_number": 18, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 18, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.dirname", ...
4643605876
import os import shutil import pickle import glob import cv2 import numpy as np import matplotlib import matplotlib.pyplot as plt matplotlib.use('TkAgg') from cam import create_dataset, Camera def save_data(path, data): with open(path, 'wb') as handle: pickle.dump(data, handle) print("Saved") def...
EvilFis/MultiCamVision
test_method.py
test_method.py
py
16,755
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.use", "line_number": 10, "usage_type": "call" }, { "api_name": "pickle.dump", "line_number": 17, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 24, "usage_type": "call" }, { "api_name": "glob.glob", "line_number":...
2087116071
from bson import ObjectId import Usuario.search as buscarUsuario import Produto.search as buscarProduto from datetime import date def inserir_compra(mydb): compra = mydb.Compra usuario = mydb.Usuario lista_produtos = [] usuarios = buscarUsuario.userByID(mydb,ObjectId) data_atual = date.today() ...
Raniel-Santos/Banco-NoSQL-Python_MongoDB
Compra/insertCompra.py
insertCompra.py
py
1,170
python
pt
code
1
github-code
6
[ { "api_name": "Usuario.search.userByID", "line_number": 11, "usage_type": "call" }, { "api_name": "bson.ObjectId", "line_number": 11, "usage_type": "argument" }, { "api_name": "Usuario.search", "line_number": 11, "usage_type": "name" }, { "api_name": "datetime.dat...
11898315364
#!/usr/bin/env python3 """ basic Flask app """ from flask import Flask, render_template, request, g from flask_babel import Babel import pytz app = Flask(__name__) babel = Babel(app) users = { 1: {"name": "Balou", "locale": "fr", "timezone": "Europe/Paris"}, 2: {"name": "Beyonce", "locale": "en", "timezone":...
jeanpierreba/holbertonschool-web_back_end
0x0A-i18n/7-app.py
7-app.py
py
2,161
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "flask_babel.Babel", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.request.args.get", "line_number": 28, "usage_type": "call" }, { "api_name": "flask.request.arg...
21321917983
#! /usr/bin/env python3 import datetime import AutoPrimer as ntp import os class Worker(object): def __init__(self, name, command, options, channel, poster): # date time stamp from scheduler self.name = name self.status = 'init' # init, running, done, expired # which comm...
jcooper036/autoprimer
AutoPrimer/autobot/Worker.py
Worker.py
py
3,361
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 38, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 38, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 52, "usage_type": "call" }, { "api_name": "da...
2739075186
"""Given the html files for each of the language families, build language tree for each and write them in json object """ from bs4 import BeautifulSoup from tqdm import tqdm import json import sys import os link = 'html/indo-european.html' link = 'html/mongolic.html' link = 'html/bororoan.html' def get_list(html):...
ialsina/LangTree
parse_html.py
parse_html.py
py
3,111
python
en
code
0
github-code
6
[ { "api_name": "os.path.split", "line_number": 79, "usage_type": "call" }, { "api_name": "os.path", "line_number": 79, "usage_type": "attribute" }, { "api_name": "bs4.BeautifulSoup", "line_number": 83, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_nu...
30509139595
"""Add sessions Revision ID: 821a722fb6c5 Revises: 371a1b269d3f Create Date: 2017-05-04 14:38:19.372886 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '821a722fb6c5' down_revision = '371a1b269d3f' branch_labels = None depends_on = None def upgrade(): # #...
UltrosBot/Ultros-site
migrations/versions/821a722fb6c5_add_sessions.py
821a722fb6c5_add_sessions.py
py
1,008
python
en
code
2
github-code
6
[ { "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...
20793244215
import numpy as np from jax import numpy as jnp from flax import struct from flax.traverse_util import flatten_dict, unflatten_dict from flax.core import Scope, lift, freeze, unfreeze from commplax import comm, xcomm, xop, adaptive_filter as af from commplax.util import wrapped_partial as wpartial from typing import An...
remifan/commplax
commplax/module/core.py
core.py
py
10,764
python
en
code
49
github-code
6
[ { "api_name": "typing.Any", "line_number": 11, "usage_type": "name" }, { "api_name": "flax.struct.field", "line_number": 17, "usage_type": "call" }, { "api_name": "flax.struct", "line_number": 17, "usage_type": "name" }, { "api_name": "flax.struct.field", "lin...
72498342269
from nltk.corpus import wordnet as wn from nltk.corpus.reader.wordnet import WordNetError from numpy import dot from numpy.linalg import norm import numpy as np import pdb class BaseModel: def __init__(self, subject, predicate, _object): #subjectFamily.getBaseRanking()[0], predicateFamily.getBaseRanking()...
asuprem/imag-s
utils/baseModel.py
baseModel.py
py
3,739
python
en
code
1
github-code
6
[ { "api_name": "nltk.corpus.wordnet.synset", "line_number": 14, "usage_type": "call" }, { "api_name": "nltk.corpus.wordnet", "line_number": 14, "usage_type": "name" }, { "api_name": "nltk.corpus.wordnet.synset", "line_number": 15, "usage_type": "call" }, { "api_nam...
74800916026
import openai import uvicorn from fastapi import FastAPI, Request, Form from langchain.chains import RetrievalQA from langchain.chat_models import ChatOpenAI from langchain.document_loaders import CSVLoader from langchain.embeddings import OpenAIEmbeddings from langchain.prompts import PromptTemplate from langchain.vec...
carson-edmonds/AAI-520-Chatbot-Project
openai_fastapi/llm.py
llm.py
py
7,658
python
en
code
0
github-code
6
[ { "api_name": "openai.api_key", "line_number": 63, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 78, "usage_type": "call" }, { "api_name": "pandas.json_normalize", "line_number": 80, "usage_type": "call" }, { "api_name": "pandas.json_norm...
8385121611
from __future__ import absolute_import from __future__ import print_function import os import sys import optparse import collections if 'SUMO_HOME' in os.environ: tools = os.path.join(os.environ['SUMO_HOME'], 'tools') sys.path.append(tools) import sumolib # noqa else: sys.exit("please declare environ...
ngctnnnn/DRL_Traffic-Signal-Control
sumo-rl/sumo/tools/tlsCycleAdaptation.py
tlsCycleAdaptation.py
py
19,264
python
en
code
17
github-code
6
[ { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.environ", "line_numbe...
10418282793
from __future__ import annotations import platform import dolphin_memory_engine import pid from randovania.game_connection.executor.memory_operation import ( MemoryOperation, MemoryOperationException, MemoryOperationExecutor, ) MEM1_START = 0x80000000 MEM1_END = 0x81800000 def _validate_range(address:...
randovania/randovania
randovania/game_connection/executor/dolphin_executor.py
dolphin_executor.py
py
4,135
python
en
code
165
github-code
6
[ { "api_name": "randovania.game_connection.executor.memory_operation.MemoryOperationException", "line_number": 20, "usage_type": "call" }, { "api_name": "randovania.game_connection.executor.memory_operation.MemoryOperationExecutor", "line_number": 25, "usage_type": "name" }, { "ap...
28634572744
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.init as init import math from torch.autograd import Variable pi = 0.01 class Recommend(nn.Module): """A model to build Recommendation system """ def __init__(self, past_observations, n_factors, output_dim): super()....
prakashjayy/av_mckinesy_recommendation_challenge
func.py
func.py
py
2,764
python
en
code
6
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.nn.Embedding", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.nn", "line_n...
73227662588
import pandas as pd import imp import QR_Code_VCard_WC_copy import imp from tkinter import * from tkinter.ttk import * from tkinter.filedialog import askopenfile import time import os from pathlib import Path global current_path current_path=Path.cwd() def open_file(): global file_path file_...
JonJones98/Virtual-Business-Card-Generator
06_Scripts/Excel_connection_csv.py
Excel_connection_csv.py
py
3,698
python
en
code
0
github-code
6
[ { "api_name": "pathlib.Path.cwd", "line_number": 13, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 13, "usage_type": "name" }, { "api_name": "tkinter.filedialog.askopenfile", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path....
17651609361
from builtins import print, input, int import mariadb import sqlite3 import psycopg2 print("Indique en que base de datos quiere realizar las gestiones:") print("1. PostgreSQL\n2. MariaDB\n3. SQLite3") lectura = input() lectura = int(lectura) while True: if lectura == 1: # Creamos la conexi...
PedroPuertasR/2DAM
2 Trimestre/SGE/ConexionBD/main.py
main.py
py
6,179
python
es
code
0
github-code
6
[ { "api_name": "builtins.print", "line_number": 7, "usage_type": "call" }, { "api_name": "builtins.print", "line_number": 8, "usage_type": "call" }, { "api_name": "builtins.input", "line_number": 10, "usage_type": "call" }, { "api_name": "builtins.int", "line_n...
19981905247
import json import os from aiogram import Bot, Dispatcher, executor, types from aiogram.dispatcher.filters import Text from aiogram.contrib.fsm_storage.memory import MemoryStorage from aiogram.dispatcher.filters.state import State, StatesGroup from aiogram.dispatcher import FSMContext from aiogram.utils.markdown impor...
Baradys/scrappers
scrappers/sbermarket/sbermarket_bot.py
sbermarket_bot.py
py
4,624
python
en
code
0
github-code
6
[ { "api_name": "dotenv.load_dotenv", "line_number": 15, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 17, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 17, "usage_type": "attribute" }, { "api_name": "aiogram.Bot", "...
29929387988
#!/bin/python import xml.etree.ElementTree as ET import sys tree = ET.parse(sys.argv[1]) root = tree.getroot() ''' print root.find('deckname').text main = root.find('./zone') for c in main.findall(path='card'): print c.get('number')+c.get('name') ''' for c in root[2]: print(c.get('number') + ' ' + c.get('name'...
nikisix/dex
xml_parser.py
xml_parser.py
py
398
python
en
code
0
github-code
6
[ { "api_name": "xml.etree.ElementTree.parse", "line_number": 5, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 5, "usage_type": "name" }, { "api_name": "sys.argv", "line_number": 5, "usage_type": "attribute" } ]
10205108247
from bson.objectid import ObjectId from pyramid.httpexceptions import HTTPFound from pyramid.security import remember, forget from pyramid.url import route_url from pyramid.view import view_config from .forms import TaskForm, TaskUpdateForm @view_config(route_name='home', renderer='templates/home.jinja2') def task_l...
albertosdneto/tutorial_pyramid_mongo
task_manager/views.py
views.py
py
2,297
python
en
code
0
github-code
6
[ { "api_name": "pyramid.view.view_config", "line_number": 10, "usage_type": "call" }, { "api_name": "forms.TaskForm", "line_number": 21, "usage_type": "call" }, { "api_name": "pyramid.httpexceptions.HTTPFound", "line_number": 26, "usage_type": "call" }, { "api_name...
7126327995
from django.urls import path from . import views # какие url какой view обрабатывается urlpatterns = [ path('', views.post_list, name='post_list'), path('post/<int:pk>/', views.post_detail, name='post_detail'), path('post/new/', views.post_new, name='post_new'), path('post/<int:pk>/edit/', views.post_...
x2wing/django_l2
blog/urls.py
urls.py
py
424
python
en
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", ...
75131926908
""" 在python中,只有函数才是Callable(可Call的对象才是Callable)。但是tuple是一个数据类型,当然是不能Call(翻译成:使唤,hhh可能会比较容易理解) """ import cv2 as cv import numpy as np def negation_pixels(image): print(image.shape) height = image.shape[0] width = image.shape[1] channels = image.shape[2] print("width: %s height: %s channels:...
hahahei957/NewProject_Opencv2
04_像素取反.py
04_像素取反.py
py
1,037
python
en
code
0
github-code
6
[ { "api_name": "cv2.imshow", "line_number": 23, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 26, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 27, "usage_type": "call" }, { "api_name": "cv2.bitwise_not", "line_number":...
31872746206
from lxml import html import requests import re MainPage = requests.get("https://www.carvezine.com/stories/") tree = html.fromstring(MainPage.content) links = tree.xpath('//a[@class="summary-title-link"]/@href') text = "" text.encode('utf-8').strip() for link in links: testURL = "https://www.carvezine.com" + link s...
RichardWen/python-practice
webscraping/storyscraper.py
storyscraper.py
py
631
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 5, "usage_type": "call" }, { "api_name": "lxml.html.fromstring", "line_number": 6, "usage_type": "call" }, { "api_name": "lxml.html", "line_number": 6, "usage_type": "name" }, { "api_name": "requests.get", "line_num...
12989554153
from PIL import Image, ImageDraw, ImageFont import calendar, datetime, holidays def get_image_calendar(dates, year, month): width, height = 500, 500 img = Image.new('RGB', (width, height), color='white') draw = ImageDraw.Draw(img) font = ImageFont.truetype('arial.ttf', size=30) dict_for_month = {"...
michaelgershov/Calendar
calendar_image.py
calendar_image.py
py
3,088
python
en
code
0
github-code
6
[ { "api_name": "PIL.Image.new", "line_number": 7, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 7, "usage_type": "name" }, { "api_name": "PIL.ImageDraw.Draw", "line_number": 8, "usage_type": "call" }, { "api_name": "PIL.ImageDraw", "line_num...
5414745490
#!flask/bin/python """Alternative version of the ToDo RESTful server implemented using the Flask-RESTful extension.""" from flask import Flask, jsonify, abort, make_response, make_response, request, current_app from flask.ext.restful import Api, Resource, reqparse, fields, marshal from flask.ext.httpauth import HTTPB...
Spanarchie/BaseAPI
BaseAPI.py
BaseAPI.py
py
6,714
python
en
code
0
github-code
6
[ { "api_name": "py2neo.Graph", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.ext.restful.Api", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.ext.httpauth.HTT...
33008999633
''' Script to process nbn coverage map csv files, transform and load into a MongoDB Author: Rommel Poggenberg (29860571) Date created: 19th April 2021 (FIT5147 TP2 2021) ''' import csv import pymongo import pprint import sys import datetime pp = pprint.PrettyPrinter(indent=4) state_lookup={2:'New South Wales',3:'Vi...
rommjp/NBN_Rollout_Visualisation
write_nbn_data_to_mongodb.py
write_nbn_data_to_mongodb.py
py
5,360
python
en
code
0
github-code
6
[ { "api_name": "pprint.PrettyPrinter", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 22, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 22, "usage_type": "attribute" }, { "api_name":...
11370340934
import torch import torchvision import random import torch.nn as nn import torch from torch import tanh import torch.nn.functional as F # custom weights initialization def weights_init_1st(m): classname = m.__class__.__name__ if classname.find('Linear') != -1: m.weight.data.normal_(0.0, 0.15) #...
ssainz/reinforcement_learning_algorithms
fleet_simulator/Models.py
Models.py
py
3,261
python
en
code
0
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 34, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 34, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 38, "usage_type": "call" }, { "api_name": "torch.nn", "line_nu...
19114657314
import pandas as pd import torch import torch.nn as nn import math import download import pickle import random max_seq_len=34 pd.set_option('display.max_colwidth', None) print("here") # Importing flask module in the project is mandatory # An object of Flask class is our WSGI application. from ...
razerspeed/Image-Caption-Generation
server2.py
server2.py
py
6,750
python
en
code
1
github-code
6
[ { "api_name": "pandas.set_option", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.nn.Module", "line_number": 27, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 27, "usage_type": "name" }, { "api_name": "torch.nn.Dropout", ...
26040960706
from __future__ import annotations from textwrap import dedent from typing import Callable import pytest from pants.backend.python.goals.publish import ( PublishPythonPackageFieldSet, PublishPythonPackageRequest, rules, ) from pants.backend.python.macros.python_artifact import PythonArtifact from pants.b...
pantsbuild/pants
src/python/pants/backend/python/goals/publish_test.py
publish_test.py
py
6,774
python
en
code
2,896
github-code
6
[ { "api_name": "pants.testutil.python_rule_runner.PythonRuleRunner", "line_number": 30, "usage_type": "call" }, { "api_name": "pants.core.util_rules.config_files.rules", "line_number": 33, "usage_type": "call" }, { "api_name": "pants.backend.python.util_rules.pex_from_targets.rule...
585614447
from pathlib import Path ROOT_FOLDER = Path("STOCK_VOLATILITY_NEW").resolve().parent DATASET_DIR = ROOT_FOLDER / "data" ALL_DATA_DIR = DATASET_DIR / "all_data.csv" ALL_DATA_NEW_DIR = DATASET_DIR / "all_data_new.csv" UNPROCESSED_DATA = DATASET_DIR / "index_funds_data.csv" FORMATTED_DATA = DATASET_DIR / "formatted_dat...
vladkramarov/index_fund_volatility
core.py
core.py
py
1,412
python
en
code
0
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 3, "usage_type": "call" } ]
71483369148
""" Created by kevin-desktop, on the 18/02/2023 ADD sentiment columns to a sample Excel sheet. """ import numpy as np import pandas as pd import tqdm from asba_model import run_models path = "data/marco_sample.pkl" df = pd.read_pickle(path) dic = {} max_nb_terms = 0 for row in tqdm.tqdm(df.itertuples(name=None)):...
KnuxV/SentA
add_sentiment_to_dataframe.py
add_sentiment_to_dataframe.py
py
868
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_pickle", "line_number": 13, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 19, "usage_type": "call" }, { "api_name": "asba_model.run_models", "line_number": 25, "usage_type": "call" }, { "api_name": "pandas.DataFrame.f...
39430188225
import json import pandas as pd import yfinance as yf import pytz from datetime import datetime, timedelta import time # Read forex pairs from JSON file with open('forex_pairs.json', 'r') as file: forex_pairs = json.load(file) # Define the time frame and time zone timeframe = '1h' timezone = 'Africa/Nairobi' # ...
Nurain313/N1l8w5f9s2g5
Trash/ma.py
ma.py
py
3,229
python
en
code
0
github-code
6
[ { "api_name": "json.load", "line_number": 11, "usage_type": "call" }, { "api_name": "pytz.timezone", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 22, "usage_type": "call" }, { "api_name": "datetime.datetime", ...
71396397949
# Import packages import gpxpy import numpy as np # Read gpx-file gpxFile = "yourfile.gpx" gpx_file = open(gpxFile, 'r') gpx = gpxpy.parse(gpx_file) # Calculate speeds between points speed = [] for track in gpx.tracks: for segment in track.segments: for point_no, point in enumerate(segment.points): ...
Haukiii/simpleGpxRunCorrector
simpleGPXrunCorrector.py
simpleGPXrunCorrector.py
py
1,329
python
en
code
0
github-code
6
[ { "api_name": "gpxpy.parse", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.quantile", "line_number": 19, "usage_type": "call" }, { "api_name": "gpxpy.gpx.GPXTrackSegment.remove_point", "line_number": 30, "usage_type": "call" }, { "api_name": "gpxp...
22758733002
# (C) StackState 2020 # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import pytest @pytest.fixture(scope='session') def sts_environment(): return { 'type': 'csv', 'health_file': '/home/static_health/health.csv', 'delimiter': ',', 'collection_inter...
StackVista/stackstate-agent-integrations
static_health/tests/conftest.py
conftest.py
py
560
python
en
code
1
github-code
6
[ { "api_name": "pytest.fixture", "line_number": 7, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 17, "usage_type": "call" } ]
71236766909
import struct from enum import Enum import typing as ty from mate.net.nao_data import Data, DebugValue, DebugImage NO_SUBSCRIBE_KEY = "none" K = ty.TypeVar('K') def split(predicate: ty.Callable[[K], bool], dictionary: ty.Dict[K, dict]): dict1 = {} dict2 = {} for key in dictionary: if predicate(ke...
humanoid-robotics-htl-leonding/robo-ducks-core
tools/mate/mate/net/utils.py
utils.py
py
3,976
python
en
code
5
github-code
6
[ { "api_name": "typing.TypeVar", "line_number": 7, "usage_type": "call" }, { "api_name": "typing.Callable", "line_number": 10, "usage_type": "attribute" }, { "api_name": "typing.Dict", "line_number": 10, "usage_type": "attribute" }, { "api_name": "enum.Enum", "...
38053163844
from django.conf.urls import patterns, include, url from django.conf.urls.i18n import i18n_patterns from django.contrib.sitemaps.views import sitemap from django.contrib.sitemaps import Sitemap from django.contrib import admin from django.conf import settings admin.autodiscover() urlpatterns = i18n_patterns('', ur...
norn/bctip
bctip/urls.py
urls.py
py
1,711
python
en
code
13
github-code
6
[ { "api_name": "django.contrib.admin.autodiscover", "line_number": 7, "usage_type": "call" }, { "api_name": "django.contrib.admin", "line_number": 7, "usage_type": "name" }, { "api_name": "django.conf.urls.i18n.i18n_patterns", "line_number": 9, "usage_type": "call" }, ...