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
26516694175
from typing import Tuple from acme import specs from acme.jax import networks as networks_lib import jax.numpy as jnp BEHAVIOR_PARAMS_NAME = 'policy' EVAL_PARAMS_NAME = 'eval' def make_networks( spec: specs.EnvironmentSpec) -> networks_lib.FeedForwardNetwork: """Creates networks used by the agent. The mod...
deepmind/acme
acme/agents/jax/ars/networks.py
networks.py
py
969
python
en
code
3,100
github-code
18
[ { "api_name": "acme.specs.EnvironmentSpec", "line_number": 13, "usage_type": "attribute" }, { "api_name": "acme.specs", "line_number": 13, "usage_type": "name" }, { "api_name": "acme.jax.networks.FeedForwardNetwork", "line_number": 27, "usage_type": "call" }, { "a...
38016538329
from flask import Flask, redirect, url_for, render_template, request, session, jsonify import json import sys import os from app import get_ui_data, main app = Flask(__name__) # app.secret_key = os.urandom(12) # Generic key for dev purposes only @app.route('/', methods=['GET', 'POST']) def home(): return render_...
RishabhRastogi-VT/Search-VT
app_ui.py
app_ui.py
py
917
python
en
code
2
github-code
18
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 12, "usage_type": "call" }, { "api_name": "app.route", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.request.get_json", ...
27337631071
# -*- coding: utf-8 -*- """The check functions.""" # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # # License: BSD (3-clause) from distutils.version import LooseVersion import operator import os import os.path as op import sys from pathlib import Path import numpy as np from ._logging import warn, logge...
soheilbr82/BluegrassWorkingMemory
Python_Engine/Lib/site-packages/mne/utils/check.py
check.py
py
24,240
python
en
code
5
github-code
18
[ { "api_name": "operator.index", "line_number": 28, "usage_type": "call" }, { "api_name": "_logging.warn", "line_number": 57, "usage_type": "call" }, { "api_name": "distutils.version.LooseVersion", "line_number": 86, "usage_type": "call" }, { "api_name": "numpy.ran...
33470766432
import sqlite3 from flask import Flask, jsonify, redirect, render_template, request, url_for from hashids import Hashids from werkzeug import exceptions def connect_to_db(): connection = sqlite3.connect('shortener/database.db') connection.row_factory = sqlite3.Row return connection app = Flask(__name__) a...
Forum-123/URL-Shortener
app.py
app.py
py
2,556
python
en
code
1
github-code
18
[ { "api_name": "sqlite3.connect", "line_number": 7, "usage_type": "call" }, { "api_name": "sqlite3.Row", "line_number": 8, "usage_type": "attribute" }, { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "hashids.Hashids", "lin...
22967645364
import numpy as np import pandas as pd from scipy import signal from scipy import misc # Define your patterns here CROSS = np.reshape(list('F*F*X*F*F'), (3, 3)) BEND = np.reshape(list('F**F**XXX'), (3, 3)) ARROW = np.reshape(list('S*WSW*SSS'), (3, 3)) # Storing patterns in a dict P = {'CROSS': CROSS, 'BEND': BEND, '...
taesiri/2DChallenge
app/complex.py
complex.py
py
1,662
python
en
code
1
github-code
18
[ { "api_name": "numpy.reshape", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.reshape", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.reshape", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.vectorize", "line_nu...
12449425257
from __future__ import annotations import itertools from datetime import datetime, timedelta from typing import AsyncIterable, Iterable from redis.asyncio import Redis from cachetory.interfaces.backends.async_ import AsyncBackend class RedisBackend(AsyncBackend[bytes]): """Asynchronous Redis backend.""" _...
kpn/cachetory
cachetory/backends/async_/redis.py
redis.py
py
2,586
python
en
code
13
github-code
18
[ { "api_name": "cachetory.interfaces.backends.async_.AsyncBackend", "line_number": 12, "usage_type": "name" }, { "api_name": "redis.asyncio.Redis.from_url", "line_number": 22, "usage_type": "call" }, { "api_name": "redis.asyncio.Redis", "line_number": 22, "usage_type": "na...
25573889449
# 入力が10**5とかになったときに100ms程度早い import sys read = sys.stdin.readline def read_ints(): return list(map(int, read().split())) def read_a_int(): return int(read()) def read_matrix(H): ''' H is number of rows ''' return [list(map(int, read().split())) for _ in range(H)] def read_map(H, W): ...
masakiaota/kyoupuro
contests/AGC033/A.2.py
A.2.py
py
2,318
python
en
code
1
github-code
18
[ { "api_name": "sys.stdin", "line_number": 3, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 77, "usage_type": "call" } ]
27070358044
import pyrebase import sys import random import math import time import os from os.path import join, dirname from dotenv import load_dotenv # Load configs from .env file dotenv_path = join(dirname(__file__), '..', '.env') load_dotenv(dotenv_path) UPDATE_TIMER = .5 # 1 second CONFIG = { 'apiKey': os.environ.get...
caioariede/uber-react
fake_drivers/fake_drivers.py
fake_drivers.py
py
2,764
python
en
code
153
github-code
18
[ { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 13, "usage_type": "call" }, { "api_name": "dotenv.load_dotenv", "line_number": 14, "usage_type": "call" }, { "api_name": "os.environ.get", ...
35462189739
import torch import torchvision.datasets as datasets import torchvision.transforms as transforms import torch.utils.data as data import os import random import numpy as np TargetLabels = range(10) PSeq1 = [{ "breakpt": 1000, "distribution": { 0: 0.1, 1: 0.1, 2: 0.1, 3: 0.1, ...
KitFung/OMSI
dataloader.py
dataloader.py
py
4,195
python
en
code
0
github-code
18
[ { "api_name": "random.seed", "line_number": 149, "usage_type": "call" }, { "api_name": "torch.manual_seed", "line_number": 150, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 151, "usage_type": "call" }, { "api_name": "numpy.random", ...
17887144508
from django.shortcuts import render from .models import Sucursal,Camera from django.views.generic.list import ListView from django.views.generic.detail import DetailView from django.urls import reverse, reverse_lazy from core.dahuaClasses.dahua_class import Dahua #from core.db import BDBDatabase from procedures.Vrec.BD...
roldanwselipgo/webapp
webapp/sucursales/views.py
views.py
py
20,458
python
en
code
0
github-code
18
[ { "api_name": "django.views.generic.list.ListView", "line_number": 25, "usage_type": "name" }, { "api_name": "models.Sucursal", "line_number": 27, "usage_type": "name" }, { "api_name": "sucursales.tasks", "line_number": 33, "usage_type": "name" }, { "api_name": "p...
37241100023
# @author: hayat import os import sys import torch import torch.utils.data as data import numpy as np from PIL import Image import glob import random import cv2 random.seed(1143) def preparing_training_data(hazefree_images_dir, hazeeffected_images_dir): train_data = [] validation_data = [] hazy_data = glob.gl...
hayatkhan8660-maker/Light-DehazeNet
image_data_loader.py
image_data_loader.py
py
2,465
python
en
code
22
github-code
18
[ { "api_name": "random.seed", "line_number": 12, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 21, "usage_type": "call" }, { "api_name": "random.shuffle", "line_number": 61, "usage_type": "call" }, { "api_name": "random.shuffle", "line_numbe...
17091203099
from mpl_toolkits.basemap import shapefile from collections import defaultdict from itertools import groupby import numpy as np storm_dtype = [('xcent', 'f'), ('ycent', 'f'), ('frame_index', 'i'), ('frame_time', 'f'), ('feat_size', 'f'), ('feat_id', 'i'), ('track_id', 'i'), ('poly', 'O')]...
JeanBilheux/python_101
matplotlib/tutorial.py
tutorial.py
py
2,489
python
en
code
2
github-code
18
[ { "api_name": "mpl_toolkits.basemap.shapefile.Reader", "line_number": 21, "usage_type": "call" }, { "api_name": "mpl_toolkits.basemap.shapefile", "line_number": 21, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 22, "usage_type": "call" }, { "...
1642968954
from django import forms from pages.models import Page, Menu, Contact from micro_blog.models import Subscribers, Category import json class PageForm(forms.ModelForm): contact_info = forms.CharField(max_length=5000, required=False) class Meta: model = Page exclude = ('category', 'contact_info'...
MicroPyramid/MicroSite
pages/forms.py
forms.py
py
2,960
python
en
code
79
github-code
18
[ { "api_name": "django.forms.ModelForm", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 7, "usage_type": "name" }, { "api_name": "django.forms.CharField", "line_number": 8, "usage_type": "call" }, { "api_name": "django.f...
3409725989
import json import jieba import numpy as np from sklearn.cluster import KMeans from collections import Counter from pyecharts import options as opts from pyecharts.charts import Tree import os from pyspark.sql import SparkSession, SQLContext os.environ['JAVA_HOME'] = "/usr/local/java/jdk1.8" spark = SparkSession.build...
mykaneki/CollectionOfWorks
作品集/爬虫-数据分析/weibo/main/find_topics.py
find_topics.py
py
3,042
python
en
code
0
github-code
18
[ { "api_name": "os.environ", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pyspark.sql.SparkSession.builder.getOrCreate", "line_number": 12, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 12, "usage_type": "attribu...
26434950550
from flask import request from flasgger.utils import swag_from from flask import Blueprint from usersServiceApp.core.register_logic import validate_and_create_level from usersServiceApp.errors.usersException import usersException from flask import jsonify from usersServiceApp.infra.db_level import get_all_levels bp_...
TDP2-G1/users-service
usersServiceApp/api/level.py
level.py
py
2,176
python
en
code
0
github-code
18
[ { "api_name": "flask.Blueprint", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.request.get_json", "line_number": 49, "usage_type": "call" }, { "api_name": "flask.request", "line_number": 49, "usage_type": "name" }, { "api_name": "usersServiceApp....
34170357595
import torch from torch.utils import data from torch import nn, optim from torch.nn.utils.clip_grad import clip_grad_norm_ from torch.utils.data.sampler import SubsetRandomSampler from torch.nn import functional as F from copy import deepcopy from neural_net.maf import MaskedAutoregressiveTransform, RandomPermutat...
sg5g10/HMM
neural_net/train_nflow.py
train_nflow.py
py
6,750
python
en
code
0
github-code
18
[ { "api_name": "neural_net.maf.MaskedAutoregressiveTransform", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.nn.functional.tanh", "line_number": 27, "usage_type": "attribute" }, { "api_name": "torch.nn.functional", "line_number": 27, "usage_type": "name" ...
4819705552
""" 460. LFU Cache Design and implement a data structure for a Least Frequently Used (LFU) cache. Implement the LFUCache class: - LFUCache(int capacity) Initializes the object with the capacity of the data structure. - int get(int key) Gets the value of the key if the key exists in the cache. Otherwise, return -1. - v...
tkwang0530/LeetCode
0460.py
0460.py
py
5,901
python
en
code
4
github-code
18
[ { "api_name": "collections.defaultdict", "line_number": 103, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 146, "usage_type": "attribute" }, { "api_name": "unittest.main", "line_number": 164, "usage_type": "call" } ]
23016831943
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np import cv2 if __name__ == '__main__': import sys try: fn = sys.argv[1] except: fn = '../temp/cat.jpg' img = cv2.imread(fn) hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV) def nothing(x): pass cv2.namedW...
jiyeqian/demo
OpenCV/hsv_trackbar.py
hsv_trackbar.py
py
874
python
en
code
0
github-code
18
[ { "api_name": "sys.argv", "line_number": 11, "usage_type": "attribute" }, { "api_name": "cv2.imread", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2HSV", "line_n...
29664591285
#will be simplistic so that it can directly be fed to the trainloader/other loaders #will read from text files #new mode option to read from different text files from torch.utils.data import Dataset import numpy as np from torchvision import transforms import helper_func import info #print(type(self.train)) class O...
msandipan/Research_Pose_Estimation
Networks/utils/DataloaderClassV2.py
DataloaderClassV2.py
py
3,221
python
en
code
0
github-code
18
[ { "api_name": "torch.utils.data.Dataset", "line_number": 14, "usage_type": "name" }, { "api_name": "torchvision.transforms.Compose", "line_number": 16, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 16, "usage_type": "name" }, { "ap...
32358325077
from dateutil.relativedelta import relativedelta from odoo import fields, models class AccountPaymentTermLine(models.Model): _inherit = "account.payment.term.line" def write(self, vals): res = super().write(vals) if vals.get("discount_days"): for item in self: # g...
OCA/account-payment
account_payment_batch_process_discount/models/account_payment_term_line.py
account_payment_term_line.py
py
1,140
python
en
code
76
github-code
18
[ { "api_name": "odoo.models.Model", "line_number": 6, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 6, "usage_type": "name" }, { "api_name": "odoo.fields.Date.from_string", "line_number": 23, "usage_type": "call" }, { "api_name": "odoo.fi...
8048768182
import pydantic.schema ## Imports import torch import torchvision import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import torchvision.datasets as datasets import torchvision.transforms as transforms from torch.utils.data import DataLoader from torch.utils.tensorboard import Su...
morekajal/Pytorch_learnings
09_1_cnn_para_cal.py
09_1_cnn_para_cal.py
py
4,873
python
en
code
0
github-code
18
[ { "api_name": "torch.__version__", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.nn.Module", "line_number": 17, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 17, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d"...
9447549346
import argparse from utils.config_initializer import ConfigInitializer from utils.random_seed import seeding from worker import Worker if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('--model', type=str) parser.add_argument('--data', type=str) parser.add_argument('--...
Jyonn/SmartWord2Vec
run.py
run.py
py
573
python
en
code
0
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "call" }, { "api_name": "utils.config_initializer.ConfigInitializer.init", "line_number": 15, "usage_type": "call" }, { "api_name": "utils.config_initializer.ConfigInitializer", "line_number": 15, "u...
12456411286
import requests from requests.compat import urljoin from ..models import Model_ConfigProduct def PRODUCT_ID(): return Model_ConfigProduct.find_one_by_attr({ "config_product_code": "CI21000" }).config_product_id def DATA_RATE_GROUP(product_id: int): return [ { 'config_product...
cmsommerville/integrate
app/backend/data/Config_RateGroup.py
Config_RateGroup.py
py
1,016
python
en
code
0
github-code
18
[ { "api_name": "models.Model_ConfigProduct.find_one_by_attr", "line_number": 6, "usage_type": "call" }, { "api_name": "models.Model_ConfigProduct", "line_number": 6, "usage_type": "name" }, { "api_name": "requests.compat.urljoin", "line_number": 31, "usage_type": "call" ...
21841759414
import os, sys import subprocess import pandas as pd import multiprocessing as mp from p_tqdm import p_map import time def get_repo_root(): """Get the root directory of the repo.""" dir_in_repo = os.path.dirname(os.path.abspath('__file__')) # os.getcwd() return subprocess.check_output('git rev-parse --sh...
TheYuanLiao/ebike-routing
src/2-otp-routing.py
2-otp-routing.py
py
1,191
python
en
code
0
github-code
18
[ { "api_name": "os.path.dirname", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 11, "usage_type": "call" }, { "api_name": "subprocess.check_output"...
29135557048
""" * Title: Egg Drop * Author: Sam Gavis-Hughson * Date: 11/28/2017 * * Consider dropping eggs off of a building. If you drop an egg from the Xth floor * and it breaks, then you know for all eggs dropped from floor X or above, they * will break. Similarly, if you drop an egg from floor X and it doesn't break, no * egg...
samgh/CIMDynamicProgramming
python/egg_drop.py
egg_drop.py
py
4,528
python
en
code
17
github-code
18
[ { "api_name": "typing.List", "line_number": 70, "usage_type": "name" }, { "api_name": "unittest.TestCase", "line_number": 106, "usage_type": "attribute" }, { "api_name": "unittest.main", "line_number": 131, "usage_type": "call" } ]
35095652858
import json import os import time import warnings import numpy as np import torch from collections import defaultdict from torch.utils.data import DataLoader from transformers import get_linear_schedule_with_warmup from typing import List, Tuple, Dict from pathlib import Path from error_correction.modelling.base_tran...
j6mes/acl2021-factual-error-correction
src/error_correction/modelling/error_correction_module.py
error_correction_module.py
py
15,221
python
en
code
23
github-code
18
[ { "api_name": "error_correction.modelling.base_transformer.BaseTransformer", "line_number": 40, "usage_type": "name" }, { "api_name": "error_correction.modelling.utils.SARI_KEYS", "line_number": 42, "usage_type": "name" }, { "api_name": "error_correction.modelling.utils.SARI_KEYS...
17628829196
class chartdata: def chartdataorder(dic): import datetime month=datetime.datetime.now().month year=datetime.datetime.now().year monthnames={1:'Jan',2:'Feb',3:'Mar',4:'Apr',5:'May',6:'Jun',7:'Jul',8:'Aug',9:'Sep',10:'Oct',11:'Nov',12:'Dec'} ls=[] i=1 j=12...
hisham2k9/IMS-and-CAPA
ims/chartdata.py
chartdata.py
py
1,645
python
en
code
0
github-code
18
[ { "api_name": "datetime.datetime.now", "line_number": 4, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 4, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 5, "usage_type": "call" }, { "api_name": "datet...
71491359720
from google.cloud import bigquery from google.oauth2 import service_account BYTES_PER_GB = 2**30 QUERY_LIMIT = 1*BYTES_PER_GB def estimate_bytes_processed(query, bq_client): """A function to estimate query size without execution of query. Modified from: https://www.kaggle.com/sohier/beyond-queries-exploring-t...
BayleeDevers/Introduction-to-Artificial-Intelligence
api_bigquery.py
api_bigquery.py
py
1,888
python
en
code
0
github-code
18
[ { "api_name": "google.cloud.bigquery.job.QueryJobConfig", "line_number": 13, "usage_type": "call" }, { "api_name": "google.cloud.bigquery.job", "line_number": 13, "usage_type": "attribute" }, { "api_name": "google.cloud.bigquery", "line_number": 13, "usage_type": "name" ...
23499296967
import openai import json from PyQt5.QtCore import QThread,pyqtSignal class chatCompletion(QThread): responseChanged = pyqtSignal(str) with open("API_key.txt","r") as key: API_key = key.read() def __init__(self, context, maxtkns,temp, destination): super().__init__() self.context...
traosorus/Robotech.IO
ChatCompletion.py
ChatCompletion.py
py
1,774
python
en
code
0
github-code
18
[ { "api_name": "PyQt5.QtCore.QThread", "line_number": 7, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 8, "usage_type": "call" }, { "api_name": "openai.api_key", "line_number": 24, "usage_type": "attribute" }, { "api_name": "json.l...
31145280339
import urllib3 import tempfile import os import sys import argparse import json import certifi import ast api_dict = json.load(open("./api_dict.json", 'r')) http = urllib3.PoolManager(cert_reqs='CERT_REQUIRED', ca_certs=certifi.where()) class Request(): ''' This class handles performing a web request...
stooblie/gdp_calculator
etl/api.py
api.py
py
6,009
python
en
code
0
github-code
18
[ { "api_name": "json.load", "line_number": 10, "usage_type": "call" }, { "api_name": "urllib3.PoolManager", "line_number": 12, "usage_type": "call" }, { "api_name": "certifi.where", "line_number": 13, "usage_type": "call" }, { "api_name": "os.environ", "line_nu...
33100305014
from rest_framework.authtoken.models import Token from django.shortcuts import get_object_or_404 from django.http import JsonResponse from rest_framework.views import APIView from user.models import User from rest_framework import generics from rest_framework.authentication import TokenAuthentication from user.serializ...
fga-verival/2019-2Grupo5
translate-me/authentication-master/api/views.py
views.py
py
1,649
python
en
code
0
github-code
18
[ { "api_name": "rest_framework.views.APIView", "line_number": 14, "usage_type": "name" }, { "api_name": "rest_framework.permissions.AllowAny", "line_number": 15, "usage_type": "name" }, { "api_name": "django.http.JsonResponse", "line_number": 18, "usage_type": "call" }, ...
24549976093
from django import shortcuts from django.views.decorators import vary from django.shortcuts import render import horizon from openstack_auth import views #huoqu yonghuming , panduan yonghu quanxian ,yongyu shezhi tiaozhuanjiemian def get_user_home(user): if user.is_superuser: return horizon.get_dashboar...
TsinghuaCloud/horizon
4/openstack-dashboard/openstack_dashboard/views.py
views.py
py
940
python
en
code
0
github-code
18
[ { "api_name": "horizon.get_dashboard", "line_number": 13, "usage_type": "call" }, { "api_name": "horizon.get_dashboard", "line_number": 14, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "line_number": 21, "usage_type": "call" }, { "api_name": ...
2046875242
import torch import os import logging import shutil from tqdm import tqdm logger = logging.getLogger('Attention') def save_checkpoint(state, is_best, epoch, checkpoint, ins_name=-1): '''Saves model and training parameters at checkpoint + 'last.pth.tar'. If is_best==True, also saves checkpoint + 'best.pth.tar' ...
pd3nbplus/Seq2Seq-Machine-translation
utils.py
utils.py
py
3,080
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_n...
43277172360
from collections import OrderedDict from polity.models import Polity def navigation(request): # For now, we only support one level of sub-polities in the navigation. # This is mostly because we haven't designed the interface to accommodate # sub-sub-polities, and we're not likely to use them any time soon...
piratar/wasa2il
polity/contextprocessors.py
contextprocessors.py
py
1,720
python
en
code
null
github-code
18
[ { "api_name": "collections.OrderedDict", "line_number": 19, "usage_type": "call" }, { "api_name": "polity.models.Polity.POLITY_TYPES", "line_number": 22, "usage_type": "attribute" }, { "api_name": "polity.models.Polity", "line_number": 22, "usage_type": "name" }, { ...
71086542760
import secrets import uuid from django.contrib.auth.models import User from django.shortcuts import render from requests import Response from rest_framework.permissions import IsAuthenticated from rest_framework.views import APIView from .serializer import * from .models import * from rest_framework import generics, ...
culcat/hackathonUIBIPserver
server/views.py
views.py
py
1,830
python
en
code
0
github-code
18
[ { "api_name": "rest_framework.generics.ListAPIView", "line_number": 15, "usage_type": "attribute" }, { "api_name": "rest_framework.generics", "line_number": 15, "usage_type": "name" }, { "api_name": "rest_framework.generics.ListAPIView", "line_number": 20, "usage_type": "...
24561311580
from random import randrange import googletrans import discord import sqlite3 data = sqlite3.connect('database.db') cursor = data.cursor() img, style = "", "" client = discord.Client() token = "put your bot token here" # <-- TOKEN embed = discord.Embed Help_Message = ("*kiss {pessoa} => todas as preferencias.\n" ...
xtvlw/Bot_Discod-python3
Bot_Discord_Interations/Bot_Discord.py
Bot_Discord.py
py
2,444
python
en
code
0
github-code
18
[ { "api_name": "sqlite3.connect", "line_number": 7, "usage_type": "call" }, { "api_name": "discord.Client", "line_number": 12, "usage_type": "call" }, { "api_name": "discord.Embed", "line_number": 14, "usage_type": "attribute" }, { "api_name": "random.randrange", ...
37984355095
import tkinter as tk import soundfile as sf import sounddevice as sd class Mixer: # def __init__(self): # creating the box type window self.window = tk.Tk() self.window.title("Matrix Multiplication") self.window.geometry("600x200") self.fs=44100 se...
finalyearProjct/math-visualisation
Linear Algebra/mixer_matrix_multiplication.py
mixer_matrix_multiplication.py
py
3,569
python
en
code
0
github-code
18
[ { "api_name": "tkinter.Tk", "line_number": 9, "usage_type": "call" }, { "api_name": "soundfile.read", "line_number": 19, "usage_type": "call" }, { "api_name": "soundfile.read", "line_number": 22, "usage_type": "call" }, { "api_name": "soundfile.read", "line_nu...
12982338392
#$Rev: 117 $ #$Author: fnight $ #$Date: 2009-08-20 18:16:18 +0400 (Чт, 20 авг 2009) $ #This file is part of Vitamin Project from vitamin.modules.tpl.builtins import methods, modificators import operator from functools import partial from collections import OrderedDict builtin_methods = {x:getattr(methods, x...
dmifurman/Vitamin
vitamin/modules/tpl/context.py
context.py
py
6,614
python
ru
code
1
github-code
18
[ { "api_name": "vitamin.modules.tpl.builtins.methods", "line_number": 13, "usage_type": "argument" }, { "api_name": "vitamin.modules.tpl.builtins.modificators", "line_number": 14, "usage_type": "argument" }, { "api_name": "operator.attrgetter", "line_number": 53, "usage_ty...
18028291503
import fastf1 as ff1 import pandas as pd import numpy as np import math from fastf1 import plotting from matplotlib import pyplot as plt from matplotlib.colors import ListedColormap from matplotlib.collections import LineCollection # Enable the cache ff1.Cache.enable_cache('cache') # Enable plotting settings ff1.plo...
MaxRondelli/Formula-1-Analysis
telemetry_acceleration.py
telemetry_acceleration.py
py
9,286
python
en
code
2
github-code
18
[ { "api_name": "fastf1.Cache.enable_cache", "line_number": 11, "usage_type": "call" }, { "api_name": "fastf1.Cache", "line_number": 11, "usage_type": "attribute" }, { "api_name": "fastf1.plotting.setup_mpl", "line_number": 14, "usage_type": "call" }, { "api_name": ...
34922145248
import streamlit as st from miscellanious_functions import * from ClarkeAndWrightSavingsAlgorithm import ClarkeAndWrightSavingsAlgorithmWithVehConstraint from MDVRP_KMeansFunc import KMeansClusteringBasedNodesSelection from MDVRP_HierClustFunc import HierClusteringBasedNodeSelection import datetime st.set_page_config(...
Ioannis-Triantafyllakis/Solving-the-Multi-Depot-Vehicle-Routing-Problem
pages/02_🚀_Batch Simulations.py
02_🚀_Batch Simulations.py
py
3,144
python
en
code
0
github-code
18
[ { "api_name": "streamlit.set_page_config", "line_number": 8, "usage_type": "call" }, { "api_name": "streamlit.title", "line_number": 13, "usage_type": "call" }, { "api_name": "streamlit.subheader", "line_number": 14, "usage_type": "call" }, { "api_name": "streamli...
2973052907
from django.db.models.signals import post_save, pre_delete from django.contrib.auth import get_user_model from django.dispatch import receiver from profiles.models import Profile, Relationship @receiver(post_save, sender=get_user_model()) def post_save_create_profile(sender, instance, created, **kwargs): if creat...
durvalcarvalho/django-projects
social-network-django/profiles/signals.py
signals.py
py
1,104
python
en
code
1
github-code
18
[ { "api_name": "profiles.models.Profile.objects.create", "line_number": 10, "usage_type": "call" }, { "api_name": "profiles.models.Profile.objects", "line_number": 10, "usage_type": "attribute" }, { "api_name": "profiles.models.Profile", "line_number": 10, "usage_type": "n...
69852348519
# -*- coding: utf-8 -*- """ Created on Tue Apr 13 18:41:38 2021 @author: divyoj """# -*- coding: utf-8 -*- """ Created on Tue Apr 13 18:41:38 2021 @author: divyoj """ ## importing libraries: import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation from matplotlib.animation import Fu...
Divyoj-Singh/Planar_cell_polarity
1D/Deletion/Deletion.py
Deletion.py
py
5,876
python
en
code
0
github-code
18
[ { "api_name": "numpy.zeros", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.concatenate", "line_number": 92, "usage_type": "call" }, { "api_name": "numba.njit", "line_number": 24, "usage_type": "name" }, { "api_name": "numpy.zeros", "line_numb...
26721752973
from django.shortcuts import render from django.http import HttpResponse from . import forms ## Initalize dictionary of neighborhood coordinates neighborhood_coord_dict = forms.get_neighborhood_dict() c = {"neighborhoods": neighborhood_coord_dict} ## Blank/unknown site page def blank(request): return render(reque...
EmilyWebber/Healthy-Neighborhoods
Healthy-Neighborhoods/maps/views.py
views.py
py
1,428
python
en
code
0
github-code
18
[ { "api_name": "django.shortcuts.render", "line_number": 14, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 46, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 47, "usage_type": "call" }, { "api_name"...
9977481965
import control as ct import numpy as np # %% Projeto do Compensador class Compensador: def __init__(self, planta, P, Q): # Ordem do sistema n = planta.A.shape[0] # Projeto numérico do regulador integral Aa = np.block([[planta.A, np.zeros((n, 1))], [-planta.C, 0]]) Ba = np...
raphateixeira/LabVirtual
simulacao_maglev/maglev_modularizado/compensador.py
compensador.py
py
1,133
python
pt
code
7
github-code
18
[ { "api_name": "numpy.block", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.block", "line_number": 14, "usage_type": "call" }, { "api_name": "control.acker", "line_number"...
31137506240
import torch import torch.nn as nn import torch.nn.functional as F from multi_head_att.submodules import MultiHeadAttention, PositionwiseFeedForward, PositionalEncoding def masked_mean(input, mask=None, dim=1): # input: [batch_size, seq_len, hidden_size] # mask: Float Tensor of size [batch_size, seq_len], whe...
yuewang-cuhk/CMKP
unified_model/modules.py
modules.py
py
13,004
python
en
code
21
github-code
18
[ { "api_name": "torch.mean", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.max", "line_number": 25, "usage_type": "call" }, { "api_name": "torch.max", "line_number": 31, "usage_type": "call" }, { "api_name": "torch.nn.Module", "line_number": 3...
10339803522
#!/usr/bin/python3 import os import sys import string from pathlib import Path word_freqs = [] with open(os.path.join(Path.cwd(), 'res/ignore-words.txt')) as f: ignore_words = f.read().split(',') ignore_words.extend(list(string.ascii_lowercase)) for line in open(sys.argv[1]): start_index = None i = 0...
HoYaStudy/Python_Study
ProgrammingStyle/03-monolith/prog03.py
prog03.py
py
1,423
python
en
code
2
github-code
18
[ { "api_name": "os.path.join", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "pathlib.Path.cwd", "line_number": 12, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_n...
42332312555
""" fixtures for unit tests """ from typing import List, Dict import pytest from transformers import AutoTokenizer from text_classification.dataset_utils import ( InputMultilabelExample, MultilabelDataset, OutputMultilabelExample) @pytest.fixture def num_labels() -> int: """number of class labels""...
prolego-team/text-classification
unit_tests/conftest.py
conftest.py
py
2,870
python
en
code
0
github-code
18
[ { "api_name": "pytest.fixture", "line_number": 16, "usage_type": "attribute" }, { "api_name": "pytest.fixture", "line_number": 22, "usage_type": "attribute" }, { "api_name": "typing.List", "line_number": 23, "usage_type": "name" }, { "api_name": "typing.List", ...
74145734760
import torch import torch.nn as nn import torch.nn.functional as F from ...configs.model_configs import MODEL1_EMBEDDING_DIM, MODEL1_DECODER_HIDDEN_DIM, MODEL1_DECODER_NUM_LAYERS, MODEL1_DECODER_RNN_DROPOUT_P, MODEL1_DECODER_NUM_ATTENTION_HEAD, MODEL1_DECODER_ATTENTION_DROPOUT_P, MODEL1_ACTIVATION, MODEL1_DECODER_INPU...
nienwk/Seq2Seq_AbsSumm
seq2seq_text_summarization/models/decoders/decoder1.py
decoder1.py
py
8,525
python
en
code
0
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 7, "usage_type": "name" }, { "api_name": "configs.model_configs.MODEL1_EMBEDDING_DIM", "line_number": 11, "usage_type": "name" }, { "api_name":...
24504888903
import collections import logging import os import tensorflow as tf from transformers_keras.tokenizers import TransformerDefaultTokenizer def create_int_feature(values): feature = tf.train.Feature(int64_list=tf.train.Int64List(value=list(values))) return feature class TransformerTFRecordGenerator(object):...
17714196157/transformers-keras
transformers_keras/utils/transformer_tfrecord_generator.py
transformer_tfrecord_generator.py
py
4,094
python
en
code
null
github-code
18
[ { "api_name": "tensorflow.train.Feature", "line_number": 11, "usage_type": "call" }, { "api_name": "tensorflow.train", "line_number": 11, "usage_type": "attribute" }, { "api_name": "tensorflow.train.Int64List", "line_number": 11, "usage_type": "call" }, { "api_nam...
40701865889
from enum import Enum, auto n = int(input().strip()) class RainEnum(Enum): start = auto() end = auto() # 時刻を何分単位に丸めるか: 60 を割り切る数に設定 rain_time_unit = 5 units_per_hour = 60 // rain_time_unit def rain_time_to_unit(time: str, rain: RainEnum) -> int: ret = int(time[:2]) * units_per_hour if rain == Rai...
noritakaIzumi/atcoder-python
abc001/d.py
d.py
py
1,355
python
en
code
0
github-code
18
[ { "api_name": "enum.Enum", "line_number": 6, "usage_type": "name" }, { "api_name": "enum.auto", "line_number": 7, "usage_type": "call" }, { "api_name": "enum.auto", "line_number": 8, "usage_type": "call" } ]
37160023588
from pprint import pprint from selenium import webdriver from selenium.webdriver.chrome.options import Options import os import re def run_driver(): chrome_options = Options() # add options for chrome driver chrome_options.add_argument('--headless') # no window chrome_options.add_argument('--log-level=3...
V1S10US/YandexMusic-to-Spotify-Transfer
YM_to_Spotify_transfer.py
YM_to_Spotify_transfer.py
py
9,193
python
en
code
1
github-code
18
[ { "api_name": "selenium.webdriver.chrome.options.Options", "line_number": 8, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 13, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 13, "usage_type": "name" }, { ...
72578797160
#!/usr/bin/env python # # Project: Video Streaming with Flask # Author: Log0 <im [dot] ckieric [at] gmail [dot] com> # Date: 2014/12/21 # Website: http://www.chioka.in/ # Description: # Modified to support streaming out with webcams, and not just raw JPEGs. # Most of the code credits to Miguel Grinberg, except that I m...
zedoggo/CrowdCountingWebApp
main.py
main.py
py
5,885
python
en
code
1
github-code
18
[ { "api_name": "models.CC.CrowdCounter", "line_number": 35, "usage_type": "call" }, { "api_name": "torch.load", "line_number": 36, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 50, "usage_type": "call" }, { "api_name": "flask.render_template",...
42204642295
import argparse import os import numpy as np import open3d.ml as _ml3d import open3d.ml.torch as ml3d def parse_args(): parser = argparse.ArgumentParser( description = "Applies Object Detection Models (PointPillars \ or PointRCNN(requires cuda) on Raw Kitti Data \ ...
TerranL/REDSA-CAV
scripts/object_detection/objdet_rawKitti_frame.py
objdet_rawKitti_frame.py
py
6,044
python
en
code
0
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 70, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 70, "usage_type": "attribute" }, { "api_name": "numpy.concaten...
5245013549
from django.conf import settings from django.contrib.auth import login from django.contrib.auth.forms import AuthenticationForm from django.contrib.auth.models import User, Group from django.contrib.auth.decorators import permission_required, login_required from django.contrib.auth.views import redirect_to_login from d...
kmshi/miroguide
channelguide/user_profile/views.py
views.py
py
8,729
python
en
code
1
github-code
18
[ { "api_name": "channelguide.user_profile.forms.RegisterForm", "line_number": 28, "usage_type": "call" }, { "api_name": "channelguide.user_profile.forms", "line_number": 28, "usage_type": "name" }, { "api_name": "django.contrib.auth.login", "line_number": 36, "usage_type":...
74838301800
#!/usr/bin/env python """ Select transcripts/gene overlapping a given locations. """ import argparse import os import re import sys from pybedtools.bedtool import BedTool from pygtftk import arg_formatter from pygtftk.cmd_object import CmdObject from pygtftk.gtf_interface import GTF from pygtftk.utils import close_...
dputhier/pygtftk
pygtftk/plugins/select_by_loc.py
select_by_loc.py
py
10,229
python
en
code
37
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 31, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 35, "usage_type": "attribute" }, { "api_name": "pygtftk.arg_formatter.FormattedFile", "line_number": 37, "usage_type": "call" }, { "api_na...
71427372840
# This Python 3 environment comes with many helpful analytics libraries installed # It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python # For example, here's several helpful packages to load in import numpy as np # linear algebra import pandas as pd # data processing, CSV fil...
aorursy/new-nb-3
iniketan_naive-bayers-bow-kernel.py
iniketan_naive-bayers-bow-kernel.py
py
1,952
python
en
code
0
github-code
18
[ { "api_name": "os.listdir", "line_number": 23, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 28, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 30, "usage_type": "call" }, { "api_name": "pandas.read_csv", "lin...
2113479642
#!/opt/python-3.6/bin/python3.6 import sys import re import os from collections import Counter def process_text(doc): # remove SGML tags doc_clean = doc.replace('\n', ' ').replace('\t', ' ') doc_clean = re.sub(r"<[^>]*>", ' ', doc_clean) # remove leading and trailing spaces doc_clean = doc_clean....
kharaldsson/ling473
Project_02/hw/tallyemup.py
tallyemup.py
py
1,293
python
en
code
0
github-code
18
[ { "api_name": "re.sub", "line_number": 12, "usage_type": "call" }, { "api_name": "re.split", "line_number": 16, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 18, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 20, "u...
11039558696
# © 2023 Solvos Consultoría Informática (<http://www.solvos.es>) # License LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html) from openupgradelib import openupgrade @openupgrade.migrate() def migrate(env, version): openupgrade.logged_query( env.cr, """ UPDATE stock_valuatio...
solvosci/slv-manufacture
stock_valuation_mrp/migrations/13.0.2.2.0/pre-migration.py
pre-migration.py
py
851
python
en
code
0
github-code
18
[ { "api_name": "openupgradelib.openupgrade.logged_query", "line_number": 9, "usage_type": "call" }, { "api_name": "openupgradelib.openupgrade", "line_number": 9, "usage_type": "name" }, { "api_name": "openupgradelib.openupgrade.migrate", "line_number": 7, "usage_type": "ca...
12131155218
import unittest from core import configuration import time import logging class TestFB(unittest.TestCase): def setUp(self): # Configure the logging output logging.basicConfig(level=logging.INFO, format='[%(asctime)s][%(levelname)s][%(threadName)s] %(message)s') ...
DIGI2-FEUP/dinasore
tests/test_fb.py
test_fb.py
py
3,429
python
en
code
10
github-code
18
[ { "api_name": "unittest.TestCase", "line_number": 7, "usage_type": "attribute" }, { "api_name": "logging.basicConfig", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 11, "usage_type": "attribute" }, { "api_name": "core.conf...
19428802508
#!/usr/bin/env python ##from https://github.com/NamWoo from __future__ import print_function #import roslib #roslib.load_manifest('my_package') import sys, time import rospy import cv2 import numpy as np from std_msgs.msg import String from sensor_msgs.msg import Image from cv_bridge import CvBridge, CvBridgeError ...
NamWoo/ros_camera
scripts/pub2.py
pub2.py
py
2,337
python
en
code
0
github-code
18
[ { "api_name": "cv2.VideoCapture", "line_number": 25, "usage_type": "call" }, { "api_name": "cv2.CAP_GSTREAMER", "line_number": 25, "usage_type": "attribute" }, { "api_name": "cv2.CAP_PROP_FOURCC", "line_number": 28, "usage_type": "attribute" }, { "api_name": "cv2....
29219202600
import nibabel as nib import matplotlib.pyplot as plt import os import xlsxwriter def load_scan(file_name): scan = nib.load(file_name) data = scan.get_fdata() if data.ndim == 2: arr = (data - data.min())/(data.max()-data.min()) * 255 return arr # if data.ndim == 3: # xdim, ydim...
lglass/blurry-detect
blurdetection/processing.py
processing.py
py
1,832
python
en
code
2
github-code
18
[ { "api_name": "nibabel.load", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 25, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 25, "usage_type": "name" }, { "api_name": "matplotlib.p...
33642611780
from typing import Union import pytest from pytest import fixture from utilities.api_helpers.api import API api = API() domain: str = "www.demoqa.com" path: str = "/" @pytest.fixture(scope="session") def browser_context_args(browser_context_args: fixture) -> dict: response: Union[dict, str] = api.authenticate(...
ThompsonJonM/python-playwright
conftest.py
conftest.py
py
645
python
en
code
17
github-code
18
[ { "api_name": "utilities.api_helpers.api.API", "line_number": 8, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 15, "usage_type": "name" }, { "api_name": "pytest.fixtu...
33210140478
import random, os, time, sys, psutil # Quick sort code(Recursive) def partition(seq, left, right): pos = left for i in range(left, right): if seq[i] < seq[right]: seq[i],seq[pos] = seq[pos],seq[i] pos += 1 seq[pos],seq[right] = seq[right],seq[pos] return pos def quickS...
saimanoj22/IIIT_PUNE_Classroom_Codes
3 Third Sem/Analysis and Design of Algorithms/LAB 2/quickSort_recursive.py
quickSort_recursive.py
py
961
python
en
code
0
github-code
18
[ { "api_name": "sys.argv", "line_number": 21, "usage_type": "attribute" }, { "api_name": "random.sample", "line_number": 23, "usage_type": "call" }, { "api_name": "time.time", "line_number": 27, "usage_type": "call" }, { "api_name": "time.sleep", "line_number":...
21019428930
#!/usr/bin/env python # -*- coding: utf-8 -*- import re import sys from textwrap import dedent, TextWrapper try: from prompt_toolkit import print_formatted_text as print except (ImportError, ModuleNotFoundError): pass from pyutil.sys_checks import is_file class ZimText(TextWrapper): def __init__( ...
farisachugthai/utilities
pyutil/wrap.py
wrap.py
py
2,195
python
en
code
8
github-code
18
[ { "api_name": "textwrap.TextWrapper", "line_number": 15, "usage_type": "name" }, { "api_name": "re.compile", "line_number": 30, "usage_type": "call" }, { "api_name": "re.MULTILINE", "line_number": 30, "usage_type": "attribute" }, { "api_name": "textwrap.dedent", ...
7660020066
import numpy as np import matplotlib.pyplot as plt class BinaryCrossEntropy: def __init__(self): self.one = lambda y_hat: -np.log(y_hat) self.zero = lambda y_hat: -np.log(1-y_hat) def forward(self, y, y_hat): if y == 1: return self.one(y_hat) return self.zero(y_ha...
seyeon-shijuan/sesac-machine-learning
chap3_deep_learning/dl_05_binary_crossentropy.py
dl_05_binary_crossentropy.py
py
1,104
python
en
code
0
github-code
18
[ { "api_name": "numpy.log", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.log", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.log", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 31, ...
1749253646
from gettext import Catalog from pickle import TRUE from xmlrpc.client import boolean from basicmatcher.models import * import re from django.db import connection class jobTitleDoesntExist(Exception): pass #The function returns the index of the best candidate def matcherEngine(jobTitle:str)->int: ...
OrMeirchak/BasicMatcher
basicmatcher/engine.py
engine.py
py
8,327
python
en
code
1
github-code
18
[ { "api_name": "django.db.connection.cursor", "line_number": 44, "usage_type": "call" }, { "api_name": "django.db.connection", "line_number": 44, "usage_type": "name" }, { "api_name": "django.db.connection.cursor", "line_number": 53, "usage_type": "call" }, { "api_...
4795533383
# -*- coding: utf-8 -*- from sanic import Sanic from sanic_jwt import Initialize from app.blueprints import offers_bp from config import Config def get_app(): app = Sanic(__name__) Initialize( app, secret=Config.SECRET, cookie_set=True, cookie_strict=False, auth_mode...
levakin/sanic-test-app
microservices/offers/app/app.py
app.py
py
424
python
en
code
1
github-code
18
[ { "api_name": "app.blueprints", "line_number": 11, "usage_type": "name" }, { "api_name": "sanic.Sanic", "line_number": 11, "usage_type": "call" }, { "api_name": "sanic_jwt.Initialize", "line_number": 13, "usage_type": "call" }, { "api_name": "app.blueprints", ...
22029946259
"""API tests.""" import os import pytest from werkzeug.exceptions import Unauthorized from registration.src.api.utils.whitelist import verify, GIDS class TestWhitelist: """Tests if a user can access a whitelisted function.""" #pylint: disable=no-self-use @staticmethod @pytest.fixture(autouse=True) ...
CruzHacks/cruzhacks-2019-registration-service
services/registration/tests/test_api.py
test_api.py
py
2,358
python
en
code
0
github-code
18
[ { "api_name": "pytest.fixture", "line_number": 15, "usage_type": "call" }, { "api_name": "registration.src.api.utils.whitelist.verify", "line_number": 23, "usage_type": "call" }, { "api_name": "registration.src.api.utils.whitelist.GIDS", "line_number": 23, "usage_type": "...
20614866550
from django.db import models class Customer(models.Model): name = models.CharField(max_length=100) phone_number = models.CharField(max_length=20) description = models.TextField() quantity = models.IntegerField() price = models.DecimalField(max_digits=10, decimal_places=2) collection_date = mode...
Heytec/freddrycleaner
drycleaner/customer/models.py
models.py
py
539
python
en
code
0
github-code
18
[ { "api_name": "django.db.models.Model", "line_number": 3, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 3, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 4, "usage_type": "call" }, { "api_name": "...
26857455304
import pygame import random # Dimensiones de la ventana del juego WIDTH = 800 HEIGHT = 600 # Colores BLACK = (0, 0, 0) RED = (255, 0, 0) BLUE = (0, 0, 255) # Tamaño del jugador PLAYER_WIDTH = 60 PLAYER_HEIGHT = 80 # Tamaño de la bala BULLET_WIDTH = 10 BULLET_HEIGHT = 20 # Velocidad del jugador PLAYER_SPEED = 8 # ...
CesarPumacayo/Python-UTN
Ejemplos_Pygame/ejemplo_2.py
ejemplo_2.py
py
3,901
python
es
code
0
github-code
18
[ { "api_name": "pygame.init", "line_number": 31, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 32, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 32, "usage_type": "attribute" }, { "api_name": "pygame.time.C...
20929776689
from django.contrib import admin from .models import Events from users.models import CustomUser @admin.register(Events) class EventsAdmin(admin.ModelAdmin): list_display = [ 'id', 'title', 'start', 'end', 'date_created', 'get_username' ] @admin.display(order...
devdanix/ams
events/admin.py
admin.py
py
436
python
en
code
0
github-code
18
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 6, "usage_type": "name" }, { "api_name": "django.contrib.admin.display", "line_number": 16, "usage_type": "call" }, { ...
35178819758
''' This module contains methods for importing Vegetation Indices data from Google Earth Engine. The VIs are calculated from MODIS BRDF corrected product to reduce the influence of illumination and observation geometries. NDVI and EVI are retrieved from the 8 regions of interest. Before calling any of the methods, mak...
4C-Guided-Team-Challenge/drought-with-gedi
drought/data/vi_extract.py
vi_extract.py
py
3,602
python
en
code
0
github-code
18
[ { "api_name": "ee.Date", "line_number": 21, "usage_type": "attribute" }, { "api_name": "ee.Geometry", "line_number": 22, "usage_type": "attribute" }, { "api_name": "drought.data.ee_converter.get_region_as_df", "line_number": 31, "usage_type": "call" }, { "api_name...
73121666601
""" This test script is to test payment ledger back-population for following Scenario: - Citation Creation - Adjudication This script also cleans up the data created in pre-script. """ from utility.payment_ledger_utility import fetch_data_from_payment_ledger, get_local_citation_data from env.logging_interface ...
Apoorv-Choudhary/api-test
controllers/developer/populate_payment_ledger_with_old_payments/post/test_case_4.py
test_case_4.py
py
2,954
python
en
code
0
github-code
18
[ { "api_name": "env.session_manager.current_session.get_variable", "line_number": 15, "usage_type": "call" }, { "api_name": "env.session_manager.current_session", "line_number": 15, "usage_type": "name" }, { "api_name": "utility.payment_ledger_utility.fetch_data_from_payment_ledge...
23253950233
# -*- coding: utf-8 -*- # Resource object code # # Created by: The Resource Compiler for PyQt5 (Qt v5.4.1) # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore qt_resource_data = b"\ \x00\x00\x0a\x37\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\ \x00\x00\x5a\x0...
mthnzbk/domestic
domestic/resource.py
resource.py
py
866,028
python
ja
code
3
github-code
18
[ { "api_name": "PyQt5.QtCore.qRegisterResourceData", "line_number": 13244, "usage_type": "call" }, { "api_name": "PyQt5.QtCore", "line_number": 13244, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.qUnregisterResourceData", "line_number": 13247, "usage_type": "call" ...
7808470576
import torch import numpy as np import matplotlib.pyplot as plt # set up matplotlib plt.ion() # Helper function to plot duration of episodes and an average over the last 100 iterations def plot_variables(fig, plot_var, title): fig, ax1, ax2 = fig durations_t = torch.tensor(plot_var['durations'], dtype=torch....
kracon7/Multi-Step-Recurrent-Q-Learning-for-Robotic-Velcro-Peeling
utils/visualization.py
visualization.py
py
1,062
python
en
code
0
github-code
18
[ { "api_name": "matplotlib.pyplot.ion", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 6, "usage_type": "name" }, { "api_name": "torch.tensor", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.float", ...
31233759742
import matplotlib.pyplot as plt # plt 用于显示图片 from PIL import Image import numpy as np import seaborn as sns from seaborn.matrix import clustermap MAX_NUM = 1000 class MyGaussianBlur(): def __init__(self, radius = 1, sigma = 1.5): ''' Description ---------- 高斯模糊 Para...
cnhaox/2021Spring-SYSU-Computer_Vision
Assignment2/18308013-陈家豪-计算机视觉期末作业/code/segmentation.py
segmentation.py
py
10,354
python
en
code
4
github-code
18
[ { "api_name": "numpy.zeros", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 34, ...
8170251194
''' Utility functions for the application ''' from datetime import datetime from functools import wraps from flask import redirect, request, session, url_for from app.models import DesignatedDriver as DD from app.models import Event, db from twilio.rest import Client def get_all_entries(drivers=True): """ @...
Durian-Inc/DwDD
app/utils.py
utils.py
py
5,405
python
en
code
3
github-code
18
[ { "api_name": "app.models.DesignatedDriver.query.all", "line_number": 22, "usage_type": "call" }, { "api_name": "app.models.DesignatedDriver.query", "line_number": 22, "usage_type": "attribute" }, { "api_name": "app.models.DesignatedDriver", "line_number": 22, "usage_type...
34268580249
import numpy as np import xgboost as xgb dtrain=xgb.DMatrix(r'C:\Users\mashiji\Desktop\agaricus.txt.train') dtest=xgb.DMatrix(r'C:\Users\mashiji\Desktop\agaricus.txt.test') watchlist=[(dtest,'eval'),(dtrain,'train')] param={'max_depth':2,'eta':1,'silent':1,'objective':'binary:logistic'} bst=xgb.train(param,dtrain,1,w...
mashiji/Machine-Learning
xgboost/xgb_test.py
xgb_test.py
py
1,333
python
en
code
0
github-code
18
[ { "api_name": "xgboost.DMatrix", "line_number": 4, "usage_type": "call" }, { "api_name": "xgboost.DMatrix", "line_number": 5, "usage_type": "call" }, { "api_name": "xgboost.train", "line_number": 9, "usage_type": "call" }, { "api_name": "xgboost.DMatrix", "lin...
37572405799
''' ''' import os import codecs from types import SimpleNamespace import numpy as np import tensorflow as tf from datetime import datetime import time import random import pyemblib import configlogger from drgriffis.common import log import dataset import cross_validation from model import CNNParams, CNNModel def tra...
drgriffis/wordnet-cnn-classification
experiment.py
experiment.py
py
20,291
python
en
code
0
github-code
18
[ { "api_name": "drgriffis.common.log.writeln", "line_number": 28, "usage_type": "call" }, { "api_name": "drgriffis.common.log", "line_number": 28, "usage_type": "name" }, { "api_name": "drgriffis.common.log.writeln", "line_number": 32, "usage_type": "call" }, { "ap...
2056634467
#!/usr/bin/env python import __builtin__ import logging import mock import sys level = logging.INFO # level = logging.DEBUG logging.basicConfig(level=level) logger = logging.getLogger(__name__) orig_open = __builtin__.open def setup(**kwargs): install_requires = kwargs.get('install_requires') logger.debug(...
msabramo/setuppycheck
examples/reads_requirements_text/setuppycheck.py
setuppycheck.py
py
1,214
python
en
code
1
github-code
18
[ { "api_name": "logging.INFO", "line_number": 8, "usage_type": "attribute" }, { "api_name": "logging.basicConfig", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "__builtin__.op...
28709560662
from transformers import BertTokenizer, BertForSequenceClassification from transformers import AutoTokenizer, AutoModelForSequenceClassification from transformers import pipeline from sklearn import preprocessing import torch class classify(): ''' This function contanins all the classifiers used in the sentimen...
yashvajani/financial_sentiment_analysis-Microsoft_earnings
code/classifiers.py
classifiers.py
py
2,652
python
en
code
0
github-code
18
[ { "api_name": "transformers.BertForSequenceClassification.from_pretrained", "line_number": 20, "usage_type": "call" }, { "api_name": "transformers.BertForSequenceClassification", "line_number": 20, "usage_type": "name" }, { "api_name": "transformers.BertTokenizer.from_pretrained"...
1587151386
''' Created on 5 mars 2017 @author: OPBO6311 ''' from root.nested.constantes import Constantes from copy import deepcopy import requests from tkinter import ttk from tkinter import * import json class Replay(object): "La fenêtre permettant de rejouer une partie spécifique" dimensionx=400 ...
pierdobauce/SaverAPI
MyTestProject/src/root/nested/replay.py
replay.py
py
5,626
python
fr
code
0
github-code
18
[ { "api_name": "root.nested.constantes.Constantes.nondefini", "line_number": 18, "usage_type": "attribute" }, { "api_name": "root.nested.constantes.Constantes", "line_number": 18, "usage_type": "name" }, { "api_name": "root.nested.constantes.Constantes.nondefini", "line_number...
74711425320
import itertools import logging import math import sys import numpy import OpenGL OpenGL.ERROR_ON_COPY = True from OpenGL.arrays import vbo # noqa from OpenGL.GL import * # noqa from OpenGL.GLUT import * # noqa import OpenGL.GL.shaders as glsl # noqa log = logging.getLogger(__name__) class Renderer(object): ...
jdowner/voxel
voxel/core.py
core.py
py
25,564
python
en
code
15
github-code
18
[ { "api_name": "OpenGL.ERROR_ON_COPY", "line_number": 9, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.array", ...
72445104681
''' Reference: Samuel Oliveira, Victor Diniz, Anisio Lacerda, and Gisele L Pappa. 2016. Evolu-tionary rank aggregation for recommender systems. IEEE Congress on Evolutionary Computation (CEC). IEEE, 255–262. ''' import torch from torch import nn import torch.nn.functional as F from modules.attention import * from mo...
JiayuLi-997/IntEL-SIGIR2023
IntEL/src/models/supervise/ERA.py
ERA.py
py
2,412
python
en
code
15
github-code
18
[ { "api_name": "models.BaseModel.GeneralShuffleModel", "line_number": 14, "usage_type": "attribute" }, { "api_name": "models.BaseModel", "line_number": 14, "usage_type": "name" }, { "api_name": "models.BaseModel.GeneralShuffleModel.parse_model_args", "line_number": 22, "us...
33457927228
from score.IoV_state import IoVSendMessage import random import uuid # 读取位置信息,生成广播消息 def file_location(files): gen = [] with open(files, 'r') as f: locations = f.readlines() for i in range(0, len(locations)): locations[i] = locations[i].rstrip('\n') a = locations[i].split(',') ...
forbighouse/llbc
score/simulator.py
simulator.py
py
1,206
python
en
code
0
github-code
18
[ { "api_name": "random.randint", "line_number": 27, "usage_type": "call" }, { "api_name": "random.sample", "line_number": 37, "usage_type": "call" }, { "api_name": "uuid.uuid3", "line_number": 40, "usage_type": "call" }, { "api_name": "uuid.NAMESPACE_DNS", "lin...
17936815533
# 基本ライブラリ import streamlit as st import numpy as np import pandas as pd from PIL import Image from PIL import ImageFilter,ImageOps import torch import io #from airplane_class_1 import transform, Net # animal.py から前処理とネットワークの定義を読み込み #import airplane_maesyori_1 # maesyori def keepAspectResizeSimple(path,...
hkimata1991/app_airplane2
airplane_st.py
airplane_st.py
py
11,285
python
ja
code
0
github-code
18
[ { "api_name": "PIL.Image.open", "line_number": 17, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 17, "usage_type": "name" }, { "api_name": "PIL.Image.new", "line_number": 33, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number":...
72745541479
import torchvision.transforms as TF import torchvision.transforms.functional as TFF import numpy as np from PIL import Image import argparse from pathlib import Path from tqdm.auto import tqdm def _get_new_shape(img): H, W = np.array(img).shape[:2] H_new, W_new = 512, round(512 * W / H) return H_new, W_ne...
glcanvas/master-diploma
images2/resize.py
resize.py
py
1,852
python
en
code
0
github-code
18
[ { "api_name": "numpy.array", "line_number": 11, "usage_type": "call" }, { "api_name": "torchvision.transforms.InterpolationMode", "line_number": 17, "usage_type": "attribute" }, { "api_name": "torchvision.transforms", "line_number": 17, "usage_type": "name" }, { "...
18623976034
import datetime import openai from config import apikey import speech_recognition as sr import os import win32com.client import pyaudio import webbrowser # import required module import subprocess, sys import random import win32com.client as wincl speaker = win32com.client.Dispatch("SAPI.SpVoice") chatStr = "" def c...
Rajat-rj45/ThinkBot
jarvaisAi/main.py
main.py
py
5,632
python
en
code
0
github-code
18
[ { "api_name": "win32com.client.client.Dispatch", "line_number": 15, "usage_type": "call" }, { "api_name": "win32com.client.client", "line_number": 15, "usage_type": "attribute" }, { "api_name": "win32com.client", "line_number": 15, "usage_type": "name" }, { "api_n...
35602707105
# Predict in Keras import json from tensorflow.keras.preprocessing.text import tokenizer_from_json from tensorflow.keras.models import load_model from tensorflow.keras.preprocessing.sequence import pad_sequences import numpy as np from nltk.stem import WordNetLemmatizer import re stopwords = nltk.corpus.stopwords.word...
ConcurDataScience/ConcurMLWorkshop
03_Model_Building/predict.py
predict.py
py
1,904
python
en
code
3
github-code
18
[ { "api_name": "nltk.stem.corpus.stopwords.words", "line_number": 10, "usage_type": "call" }, { "api_name": "nltk.stem.corpus", "line_number": 10, "usage_type": "attribute" }, { "api_name": "nltk.stem", "line_number": 10, "usage_type": "name" }, { "api_name": "nltk...
4729219504
import kmmessage import time import logging ''' Keith Murray email: kmurrayis@gmail.com ''' from asecretplace import getPythonHelperBotKeys smstoaddr = getPythonHelperBotKeys.GETSMSADDR() mmstoaddr = getPythonHelperBotKeys.GETMMSADDR() emailtoaddr = getPythonHelperBotKeys.GETEMAILADDR() def getU...
KeithTheEE/redditPythonHelper
utils/textSupervision.py
textSupervision.py
py
5,687
python
en
code
6
github-code
18
[ { "api_name": "asecretplace.getPythonHelperBotKeys.GETSMSADDR", "line_number": 13, "usage_type": "call" }, { "api_name": "asecretplace.getPythonHelperBotKeys", "line_number": 13, "usage_type": "name" }, { "api_name": "asecretplace.getPythonHelperBotKeys.GETMMSADDR", "line_num...
101219671
import json import random with open("text.json", "r") as f: try: file = f.read() file_dict = json.loads(file) except Exception as e: print(f"Error: {e}") lifes = file_dict['life'] rand_word = random.choice(file_dict['words']) letters = [] print("You need to guess the wor...
roshumihai/hangmen_game
hangman_game.py
hangman_game.py
py
1,017
python
en
code
0
github-code
18
[ { "api_name": "json.loads", "line_number": 7, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 12, "usage_type": "call" } ]
71167665320
import numpy from keras.datasets import mnist from keras.models import Sequential from keras.layers import Dense from keras.layers import Dropout from keras.layers import Flatten from keras.layers.convolutional import Convolution2D from keras.layers.convolutional import MaxPooling2D from keras.utils import np_utils fro...
abhishekshanbhag/emotion_based_spotify
emotify_CNN_v2.py
emotify_CNN_v2.py
py
2,368
python
en
code
7
github-code
18
[ { "api_name": "keras.backend.set_image_dim_ordering", "line_number": 11, "usage_type": "call" }, { "api_name": "keras.backend", "line_number": 11, "usage_type": "name" }, { "api_name": "numpy.random.seed", "line_number": 15, "usage_type": "call" }, { "api_name": "...
27077838934
from .utils import memoized from .classes import DB, Column from .exceptions import (DriverNotFound, DBNotConnected) _connection = None def get_driver(driver): driver_path = 'drivers.%s_driver' % (driver,) try: return memoized(__import__)(driver_path, globals(), locals(), -1...
caioariede/python-simpleauth
simpleauth/db.py
db.py
py
1,115
python
en
code
2
github-code
18
[ { "api_name": "utils.memoized", "line_number": 13, "usage_type": "call" }, { "api_name": "exceptions.DriverNotFound", "line_number": 15, "usage_type": "call" }, { "api_name": "exceptions.DBNotConnected", "line_number": 20, "usage_type": "call" }, { "api_name": "cl...
2657443374
import argparse from app.environment import Environment import app.apis.twitter as twitter import app.apis.file_api as file_api import app.apis.kintone as kintone if __name__ == "__main__": parser = argparse.ArgumentParser(description="Data Extractor for Watson Disaster App") keyword, locations = Environment....
icoxfog417/WatsonDisasterApp
run.py
run.py
py
1,421
python
en
code
0
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "call" }, { "api_name": "app.environment.Environment.get_runtime_parameters", "line_number": 10, "usage_type": "call" }, { "api_name": "app.environment.Environment", "line_number": 10, "usage_type": ...
73027347560
import json from recruitment.bamboo_hr.entities.bamboo_employee import BambooEmployee from recruitment.bamboo_hr.entities.bamboo_time_off import BambooTimeOff from recruitment.bamboo_hr import util class BambooHrApi(): def employee(self, context, params): '''Gets an employee''' headers = context...
dipendrabaidawa/unified_api
unified/modules/main/categories/recruitment/bamboo_hr/api.py
api.py
py
1,243
python
en
code
0
github-code
18
[ { "api_name": "json.loads", "line_number": 17, "usage_type": "call" }, { "api_name": "recruitment.bamboo_hr.util.get_bamboo_request", "line_number": 17, "usage_type": "call" }, { "api_name": "recruitment.bamboo_hr.util", "line_number": 17, "usage_type": "name" }, { ...
12925254069
import json class GradeEncoder(json.JSONEncoder): def default(self, obj): return {"Course": obj.course, "Title": obj.title, "Period": obj.period, "Letter": obj.letter, "Score": obj.score, "Teacher": obj.teacher }...
joelewiss/GradeChecker
modules/output/json.py
json.py
py
390
python
en
code
1
github-code
18
[ { "api_name": "json.JSONEncoder", "line_number": 3, "usage_type": "attribute" }, { "api_name": "json.dumps", "line_number": 14, "usage_type": "call" } ]
661358366
from functools import partial import os import platform import shutil from exercise import Exercise from exercise_manager import ExerciseManager def ask(prompt: str) -> bool: if not prompt.rstrip().endswith("[Y/n]"): prompt += " [Y/n] " while True: answer = input(prompt).strip(...
y-lily/language-trainer
interface.py
interface.py
py
2,793
python
en
code
0
github-code
18
[ { "api_name": "exercise.Exercise", "line_number": 23, "usage_type": "name" }, { "api_name": "exercise.Exercise", "line_number": 26, "usage_type": "call" }, { "api_name": "platform.system", "line_number": 60, "usage_type": "call" }, { "api_name": "os.system", "...
6856646354
from django.urls import path from rest_framework_simplejwt.views import ( TokenObtainPairView, TokenRefreshView, TokenVerifyView ) from api.v1.views import RoomViewSet, MessageViewSet urlpatterns = [ path("token/", TokenObtainPairView.as_view(), name="token_obtain_pair"), path("refresh/", TokenRef...
amkolotov/il_chat
backend/api/v1/urls.py
urls.py
py
581
python
en
code
0
github-code
18
[ { "api_name": "django.urls.path", "line_number": 11, "usage_type": "call" }, { "api_name": "rest_framework_simplejwt.views.TokenObtainPairView.as_view", "line_number": 11, "usage_type": "call" }, { "api_name": "rest_framework_simplejwt.views.TokenObtainPairView", "line_number...
72442035880
#! /usr/bin/env python3 # -*- coding: utf-8 -*- import requests,time,hashlib,json,uuid from config import Config cf = Config.Config() def databuild(**kwargs): """ 公用的函数,构造data参数 :param kwargs: :return: """ data = json.dumps(kwargs) print(data) return data def body(data: str, guid=...
jdjdjjdd/git-code
common/login/login_basic.py
login_basic.py
py
6,005
python
en
code
0
github-code
18
[ { "api_name": "config.Config.Config", "line_number": 7, "usage_type": "call" }, { "api_name": "config.Config", "line_number": 7, "usage_type": "name" }, { "api_name": "json.dumps", "line_number": 17, "usage_type": "call" }, { "api_name": "time.time", "line_num...
25659294334
import yaml class DictionaryTagger(object): def __init__(self, dictionary_paths): files = [open(path, 'r') for path in dictionary_paths] dictionaries = [yaml.load(dict_file) for dict_file in files] map(lambda x: x.close(), files) self.dictionary = {} self.max_key_size = 0 ...
mattiaspalmgren/amazon-rating-predictor
dictionarytagger.py
dictionarytagger.py
py
1,564
python
en
code
1
github-code
18
[ { "api_name": "yaml.load", "line_number": 7, "usage_type": "call" } ]