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
41209430964
import random, requests def random_pokemon(): opponent_pokemon_number = random.randint(1, 151) url = 'https://pokeapi.co/api/v2/pokemon/{}/'.format(opponent_pokemon_number) response = requests.get(url) pokemon = response.json() return { 'name': pokemon['name'], 'id': pokemon['id']...
KaraboMolale/CFG-TOP-TRUMPS
CFG_PYTHON_TOP_TRUMPS.py
CFG_PYTHON_TOP_TRUMPS.py
py
2,624
python
en
code
0
github-code
1
[ { "api_name": "random.randint", "line_number": 5, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 7, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 27, "usage_type": "call" } ]
13967663676
import boto3 import botocore import os import time import zipfile from colorama import Fore, Style from functions import create_client def help(): print(f"{Fore.YELLOW}\n================================================================================================{Style.RESET_ALL}") print("[+] Module Descrip...
MiedzinskiBuck/Kintoun
modules/persistence/lambda_export_keys.py
lambda_export_keys.py
py
7,404
python
en
code
6
github-code
1
[ { "api_name": "colorama.Fore.YELLOW", "line_number": 10, "usage_type": "attribute" }, { "api_name": "colorama.Fore", "line_number": 10, "usage_type": "name" }, { "api_name": "colorama.Style.RESET_ALL", "line_number": 10, "usage_type": "attribute" }, { "api_name": ...
5606726905
from __future__ import (absolute_import, division, print_function, unicode_literals) from builtins import * import logging, signal, os, os.path from wizzat.util import mkdirp, slurp __all__ = [ 'RunnerBase', ] class RunnerBase(object): """ This is a base class for runners. It supports: - Set...
wizzat/wizzat.py
wizzat/runner.py
runner.py
py
4,577
python
en
code
6
github-code
1
[ { "api_name": "signal.SIGTERM", "line_number": 23, "usage_type": "attribute" }, { "api_name": "signal.SIGINT", "line_number": 24, "usage_type": "attribute" }, { "api_name": "signal.SIGHUP", "line_number": 25, "usage_type": "attribute" }, { "api_name": "signal.sign...
26807859600
import os import sys import numpy as np import pytest from numpy.random import rand sys.path.append(os.path.join(os.path.dirname(__file__), "../..")) module = __import__("Models", fromlist=["GPR"]) class TestGPR: @pytest.mark.skip def test_getPredictValue(self, x): ... @pytest.mark.skip def...
mit17024317/2020-0730
Optimizer/Models/test/test_GPR.py
test_GPR.py
py
1,642
python
en
code
0
github-code
1
[ { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
72436648354
import logging import os from pathlib import Path from typing import Union from dictIO import CppDict, DictReader from ospx import Graph, OspSimulationCase __ALL__ = ["OspCaseBuilder"] logger = logging.getLogger(__name__) class OspCaseBuilder: """Builder for OSP-specific configuration files needed to run an O...
dnv-opensource/ospx
src/ospx/ospCaseBuilder.py
ospCaseBuilder.py
py
4,204
python
en
code
1
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "typing.Union", "line_number": 23, "usage_type": "name" }, { "api_name": "os.PathLike", "line_number": 23, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "l...
4700100069
# system imports import logging import sys import os import io import concurrent.futures import shutil from time import sleep #import keyring # google and http imports from google.auth.transport.requests import Request from google.oauth2.credentials import Credentials from google_auth_oauthlib.flow import InstalledApp...
k3tchup/google_drive_sync
libgdrive/gDrive.py
gDrive.py
py
48,013
python
en
code
0
github-code
1
[ { "api_name": "os.path.dirname", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path.dirname", "...
28080781134
"""Adapted from: https://github.com/hugovk/random-street-view/blob/main/random_street_view.py """ import argparse import json import os import random import sys import requests from urllib.request import urlopen, urlretrieve from datetime import datetime import contextlib import yaml import traceback import shapefile...
BunningsWarehouseOfficial/random-mapillary
random_mapillary.py
random_mapillary.py
py
10,780
python
en
code
0
github-code
1
[ { "api_name": "yaml.load", "line_number": 32, "usage_type": "call" }, { "api_name": "yaml.FullLoader", "line_number": 32, "usage_type": "attribute" }, { "api_name": "mapillary.interface.set_access_token", "line_number": 34, "usage_type": "call" }, { "api_name": "m...
36878259269
import numpy as np from scipy.stats import ttest_ind np.random.seed(0) # set up simulation parameters num_simulations = 15000 # number of simulations to run sample_size = 20 # sample size for each group mean_1 = 0 # true mean for group 1 std_dev = 1 # standard deviation for both groups corr = 0.5 # correlation b...
guangyaodou/False-Positive-Psychology-Simulation
situation_A.py
situation_A.py
py
1,698
python
en
code
0
github-code
1
[ { "api_name": "numpy.random.seed", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 4, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.random.multivaria...
18033055398
from zeep.client import Client import zeep settings = zeep.Settings(strict=False, xml_huge_tree=True) wsdl = 'http://localhost:7000/ws/EstudianteWebServices?wsdl' cliente = Client(wsdl) ListEstudiantes = cliente.service.getListaEstudiante() def consultar(matricula): Estudiante = cliente.service.getEstudiante(mat...
AndoRoman/Client-SOAP
Main.py
Main.py
py
1,574
python
es
code
0
github-code
1
[ { "api_name": "zeep.Settings", "line_number": 4, "usage_type": "call" }, { "api_name": "zeep.client.Client", "line_number": 6, "usage_type": "call" } ]
17824878888
import torch.nn.functional as F import torch import numpy as np def mae(input, target): return torch.mean(torch.abs(input - target)) def logmae_wav(model, output_dict, target): loss = torch.log10(torch.clamp(mae(output_dict['wav'], target), 1e-8, np.inf)) return loss def max_si_snr(input, target, eps ...
RetroCirce/Choral_Music_Separation
losses.py
losses.py
py
2,000
python
en
code
29
github-code
1
[ { "api_name": "torch.mean", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.abs", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.log10", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.clamp", "line_number": 11, ...
70521367394
# -*- coding: utf-8 -*- """ A new file. """ import numpy as np from numba import jit, vectorize from utils import timeit from loops import loop1 @timeit def loop(m, n): s = 0 for i in range(1, m + 1): for j in range(1, n + 1): s += 1.0 / i + 1.0 / j return s @tim...
cmjdxy/fundamental-demos
study-parallel-computing/jit_vs_vec.py
jit_vs_vec.py
py
983
python
en
code
0
github-code
1
[ { "api_name": "utils.timeit", "line_number": 12, "usage_type": "name" }, { "api_name": "loops.loop1", "line_number": 23, "usage_type": "call" }, { "api_name": "utils.timeit", "line_number": 21, "usage_type": "name" }, { "api_name": "utils.timeit", "line_number...
37932432698
from kivymd.uix.button import MDIconButton from kivy.app import App from kivy.properties import ( AliasProperty, BooleanProperty, ListProperty, NumericProperty, ObjectProperty, StringProperty, ) class MDIconButtonTwoPosition(MDIconButton): enabled = True sourceEnabled = StringProperty()...
andrimation/Android_Social_App
andorid_app/app_files/MDIconButtonTwoPosition/MDIconButtonTwoPosition.py
MDIconButtonTwoPosition.py
py
867
python
en
code
0
github-code
1
[ { "api_name": "kivymd.uix.button.MDIconButton", "line_number": 12, "usage_type": "name" }, { "api_name": "kivy.properties.StringProperty", "line_number": 14, "usage_type": "call" }, { "api_name": "kivy.properties.StringProperty", "line_number": 15, "usage_type": "call" ...
40173689508
from django.shortcuts import render, redirect from django.http import JsonResponse from django.views.decorators.csrf import csrf_exempt from .models import * from realtime.models import InAndOut from .decorators import user_required, get_park_time '''用户端 - 我的''' @user_required def personal(request, user): ctx =...
codefish-yu/parking
parking/wechat/my.py
my.py
py
2,952
python
en
code
0
github-code
1
[ { "api_name": "django.shortcuts.render", "line_number": 21, "usage_type": "call" }, { "api_name": "decorators.user_required", "line_number": 15, "usage_type": "name" }, { "api_name": "realtime.models.InAndOut.objects.filter", "line_number": 29, "usage_type": "call" }, ...
30298059185
class Nellix2ssdf: def __init__(self,dicom_basedir,ptcode,ctcode,basedir): import imageio #import easygui from stentseg.utils.datahandling import loadvol from stentseg.utils.datahandling import savecropvols, saveaveraged ## Select ...
almarklein/stentseg
nellix/nellix2ssdf.py
nellix2ssdf.py
py
5,174
python
en
code
3
github-code
1
[ { "api_name": "imageio.get_reader", "line_number": 73, "usage_type": "call" }, { "api_name": "stentseg.utils.datahandling.savecropvols", "line_number": 93, "usage_type": "call" }, { "api_name": "stentseg.utils.datahandling.loadvol", "line_number": 100, "usage_type": "call...
7455827350
import datetime import sys import time import traceback # logger from pandacommon.pandalogger.PandaLogger import PandaLogger from pandajedi.jediconfig import jedi_config from pandajedi.jedicore import Interaction, JediException from pandajedi.jedicore.FactoryBase import FactoryBase from pandajedi.jedicore.JediDatasetS...
PanDAWMS/panda-jedi
pandajedi/jediorder/TaskRefiner.py
TaskRefiner.py
py
23,185
python
en
code
3
github-code
1
[ { "api_name": "pandacommon.pandalogger.PandaLogger.PandaLogger", "line_number": 19, "usage_type": "call" }, { "api_name": "JediKnight.JediKnight", "line_number": 23, "usage_type": "name" }, { "api_name": "pandajedi.jedicore.FactoryBase.FactoryBase", "line_number": 23, "us...
16077958011
from typing import Tuple import numpy as np from env import EnvWithModel from policy import Policy def value_prediction(env: EnvWithModel, pi: Policy, initV: np.array, theta: float) -> Tuple[np.array, np.array]: """ inp: env: environment with model information, i.e. you know transition dynamics and r...
owen8877/Sp22-CS394R
prog2/dp.py
dp.py
py
3,187
python
en
code
2
github-code
1
[ { "api_name": "env.EnvWithModel", "line_number": 8, "usage_type": "name" }, { "api_name": "policy.Policy", "line_number": 8, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 8, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_...
25820215342
from __future__ import absolute_import, division, print_function, unicode_literals import unittest from discogs_client import Client from discogs_client.tests import DiscogsClientTestCase from discogs_client.exceptions import ConfigurationError, HTTPError from datetime import datetime class CoreTestCase(DiscogsClien...
discogs/discogs_client
discogs_client/tests/test_core.py
test_core.py
py
3,753
python
en
code
481
github-code
1
[ { "api_name": "discogs_client.tests.DiscogsClientTestCase", "line_number": 10, "usage_type": "name" }, { "api_name": "discogs_client.Client", "line_number": 15, "usage_type": "call" }, { "api_name": "discogs_client.exceptions.ConfigurationError", "line_number": 17, "usage...
4496359468
import requests import numpy as np import cv2 import sys, os, shutil import json sys.path.append("../") from PIL import Image # input_img = r"E:\data\starin-diode\diode-0605\images\20200605_5.jpg" # input_img = "diode.jpg" input_imgs = r"E:\data\diode-opt\imgs/" # input_imgs = r"E:\pycharm_project\Data-pr...
Chase2816/TF-TORCH
tf1.15v3/tfserving-test1.py
tfserving-test1.py
py
3,851
python
en
code
0
github-code
1
[ { "api_name": "sys.path.append", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.exists", "line_num...
35939556874
''' Created on Nov 28, 2012 @author: cosmin ''' from google.appengine.ext import webapp import logging import jinja2 import os from models import Trend from models import TopJobs jinja_environment = jinja2.Environment( loader=jinja2.FileSystemLoader(os.path.dirname(__file__))) class SplitTrend: def __init__(...
cosminstefanxp/freely-stats
remote-code/Trends.py
Trends.py
py
2,653
python
en
code
0
github-code
1
[ { "api_name": "jinja2.Environment", "line_number": 13, "usage_type": "call" }, { "api_name": "jinja2.FileSystemLoader", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", ...
29653268879
from django.contrib import admin as dj_admin from django.contrib import admin from myapp.models import Project, ModelGroup, AutodeskExtractorRule, BimModel, Job from myapp.models import URN, ActiveLink class WorkAdmin(dj_admin.ModelAdmin): list_display = ("id", "name") class ProjectAdmin(admin.ModelAdmin): ...
kishik/ADCM-Scheduler
myapp/admin.py
admin.py
py
1,783
python
en
code
1
github-code
1
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 7, "usage_type": "name" }, { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 11, "usage_type": "attribute" ...
32068966886
from flask import Flask, request, jsonify from tf_idf import get_text, scrape_google, tf_idf_analysis app = Flask(__name__) @app.route('/get_text') def get_text_endpoint(): url = request.args.get('url') text = get_text(url) return jsonify(text=text) @app.route('/scrape_google') def scrape_google_endpoint...
farahramzy/seopro
python/app.py
app.py
py
657
python
en
code
0
github-code
1
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask.request.args.get", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.request.args", "line_number": 8, "usage_type": "attribute" }, { "api_name": "flask.request...
16158666088
import json import pandas as pd from sklearn.linear_model import LinearRegression from sklearn.metrics import mean_squared_error, r2_score import joblib import sys def train_model(): jsondata = json.loads(sys.argv[1]) # Create a dictionary to store models for each variable models = {} for variable_da...
MadakariNayakaHM/FinalYearProject
pythonScripts/new2.py
new2.py
py
1,106
python
en
code
0
github-code
1
[ { "api_name": "json.loads", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pandas.DataFrame", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "lin...
9356643217
import random import tensorflow as tf from AI.agent import Agent from AI.ROSEnvironment import ArmControlPlateform from config import get_config flags = tf.app.flags # Model flags.DEFINE_string('model', 'DQN', 'Type of model') # Environment #flags.DEFINE_string('env_name', 'Acrobot-v1', 'The name of gym environment t...
wlwlw/VisualArm
ArmRLAIController.py
ArmRLAIController.py
py
1,111
python
en
code
6
github-code
1
[ { "api_name": "tensorflow.app", "line_number": 7, "usage_type": "attribute" }, { "api_name": "tensorflow.set_random_seed", "line_number": 20, "usage_type": "call" }, { "api_name": "random.seed", "line_number": 21, "usage_type": "call" }, { "api_name": "config.get_...
40402312512
from tests.baseTest import * from lib.random_generator import RandomGenerator from lib.api_requests import RequestManager from grappa import should from api_endpoints.signup_endpoint import SignupMethods from api_endpoints.threads_endpoint import ThreadsMethods from lib.data_encoder import Encoder class ViewThreadsTe...
mdomosla/zadanie2-testy-forum
tests/threads/viewThreads_test.py
viewThreads_test.py
py
3,144
python
en
code
0
github-code
1
[ { "api_name": "lib.random_generator.RandomGenerator", "line_number": 11, "usage_type": "call" }, { "api_name": "lib.api_requests.RequestManager", "line_number": 12, "usage_type": "call" }, { "api_name": "lib.data_encoder.Encoder", "line_number": 13, "usage_type": "call" ...
24639708926
from typing import List, Tuple import numpy as np import torch import torch.nn.functional as F from torch import Tensor, nn def get_cnn_output_dim( input_size: int, conv_kernel_size: int, padding_size: int, conv_stride_size: int ) -> int: return (input_size + 2 * padding_size - conv_kernel_size) / conv_strid...
aleksei-mashlakov/m6_competition
src/mv_cnn_model.py
mv_cnn_model.py
py
5,039
python
en
code
2
github-code
1
[ { "api_name": "numpy.floor", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.nn.Module", "line_number": 59, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 59, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_nu...
8138880318
from collections import Counter class Solution: def longestPalindrome(self, s: str) -> int: counter = Counter(s) ans = 0 odd = False for k,v in counter.items(): ans += v // 2 * 2 if v % 2: odd = True if odd: ans += 1 return an...
MinecraftDawn/LeetCode
Easy/409. Longest Palindrome.py
409. Longest Palindrome.py
py
321
python
en
code
1
github-code
1
[ { "api_name": "collections.Counter", "line_number": 4, "usage_type": "call" } ]
6583723969
#!/usr/bin/python3 from PyQt5 import QtCore, QtGui, QtWidgets import webbrowser import os import subprocess class Ui_WelcomeScreen(object): ######################### CUSTOM ACTIONS ########################## def forumButtonAction(self): webbrowser.open("https://forum.namiblinux.org/categories") de...
namiblinux/namib-welcome
src/namib-welcome.py
namib-welcome.py
py
24,467
python
en
code
0
github-code
1
[ { "api_name": "webbrowser.open", "line_number": 11, "usage_type": "call" }, { "api_name": "webbrowser.open", "line_number": 13, "usage_type": "call" }, { "api_name": "webbrowser.open", "line_number": 15, "usage_type": "call" }, { "api_name": "webbrowser.open", ...
41826551936
import os import streamlit as st import openai from dotenv import load_dotenv def load_guidelines(filepath): with open(filepath, 'r', encoding='utf-8') as f: return f.read() def save_guidelines(filepath, content): with open(filepath, 'w', encoding='utf-8') as f: f.write(content) load_dote...
fhoeg/textReview_gui
app.py
app.py
py
1,490
python
en
code
0
github-code
1
[ { "api_name": "dotenv.load_dotenv", "line_number": 14, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 15, "usage_type": "call" }, { "api_name": "openai.api_key", "line_number": 17, "usage_type": "attribute" }, { "api_name": "openai.ChatCompletio...
73268729635
from django.shortcuts import render, redirect, get_object_or_404 from django.http import HttpResponse, HttpResponseRedirect,JsonResponse from .forms import NameForm from .models import NameFormModel import json, os, requests from datetime import datetime # Create your views here. database = [] def moviemanagerView(requ...
Leeoku/MovieDatabase
moviedb_project/moviemanager/views.py
views.py
py
2,560
python
en
code
0
github-code
1
[ { "api_name": "forms.NameForm", "line_number": 11, "usage_type": "call" }, { "api_name": "django.http.JsonResponse", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", ...
23637603147
import ssl import smtplib import imaplib from email import encoders import email from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from email.mime.image import MIMEImage from email.mime.base import MIMEBase import time import datetime import traceback import mylib...
passcombo/walnavi
mylibs/mailbox.py
mailbox.py
py
19,504
python
en
code
0
github-code
1
[ { "api_name": "socket.setdefaulttimeout", "line_number": 22, "usage_type": "call" }, { "api_name": "mylibs.ioprocessing.print_addr_book", "line_number": 64, "usage_type": "call" }, { "api_name": "mylibs.ioprocessing", "line_number": 64, "usage_type": "name" }, { "...
28567141205
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Base track file data. """ from typing import ( Type, Optional, Union, Dict, Tuple, Any, List, Sequence, Iterable, Iterator, cast, overload ) from datetime import datetime from pathlib import Path from copy import deepcopy, copy fr...
depixusgenome/trackanalysis
src/data/track.py
track.py
py
26,097
python
en
code
0
github-code
1
[ { "api_name": "typing.Union", "line_number": 27, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 28, "usage_type": "name" }, { "api_name": "typing.Sequence", "line_number": 28, "usage_type": "name" }, { "api_name": "typing.Dict", "line_num...
22290768472
from typing import Any, Dict, Optional import httpx from ...client import Client from ...models.wallet_module_response import WalletModuleResponse from ...types import UNSET, Response def _get_kwargs( *, client: Client, did: str, ) -> Dict[str, Any]: url = "{}/wallet/did/local/rotate-keypair".format...
Indicio-tech/acapy-client
acapy_client/api/wallet/patch_wallet_did_local_rotate_keypair.py
patch_wallet_did_local_rotate_keypair.py
py
2,921
python
en
code
6
github-code
1
[ { "api_name": "client.Client", "line_number": 12, "usage_type": "name" }, { "api_name": "client.base_url", "line_number": 15, "usage_type": "attribute" }, { "api_name": "typing.Dict", "line_number": 17, "usage_type": "name" }, { "api_name": "client.get_headers", ...
71795305634
import pygame from random import randint pygame.init() #game window WIDTH = 600 HEIGHT = 400 win = pygame.display.set_mode((WIDTH, HEIGHT)) pygame.display.set_caption("Shot Clock") pygame.display.set_icon(pygame.image.load('icon.png')) #gmae font pygame.font.init() GAME_FONT = pygame.font.Font('gamera.TTF', 35) #g...
BaboyaChoch/Shot-Clock
main.py
main.py
py
6,568
python
en
code
3
github-code
1
[ { "api_name": "pygame.init", "line_number": 4, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pygame.display.s...
18279946367
#SNAKE MENU import pygame import time ANSI_HOME_CURSOR = u"\u001B[0;0H\u001B[2" RESET_COLOR = u"\u001B[0m\u001B[2D" def snake_print(position): snake = [" ____", " / . .\ ", " \ ---<", " _________________/ /", " \__________________/"] print(ANSI_HOME_C...
fruitycoders/snake
snake/main.py
main.py
py
1,957
python
en
code
0
github-code
1
[ { "api_name": "time.sleep", "line_number": 25, "usage_type": "call" }, { "api_name": "pygame.init", "line_number": 65, "usage_type": "call" }, { "api_name": "pygame.init", "line_number": 68, "usage_type": "call" }, { "api_name": "pygame.init", "line_number": 7...
11976253992
from matplotlib import pyplot as plt import torch from torch.utils.data import Dataset as torchDataset import pandas as pd from transformers import BertTokenizer, BertModel import Config tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') model = BertModel.from_pretrained('bert-base-uncased').to(Config.devi...
NPCLEI/Fed_MSCNN
DatasetAPI/AmazonReviews.py
AmazonReviews.py
py
5,781
python
en
code
0
github-code
1
[ { "api_name": "transformers.BertTokenizer.from_pretrained", "line_number": 8, "usage_type": "call" }, { "api_name": "transformers.BertTokenizer", "line_number": 8, "usage_type": "name" }, { "api_name": "transformers.BertModel.from_pretrained", "line_number": 9, "usage_typ...
5232873316
from django.core.mail import EmailMessage TITLE = [ ('Mr', 'Mr'), ('Mrs', 'Mrs'), ('Ms', 'Ms'), ('Dr', 'Dr'), ] EXPERTISE = [ ('UI/UX Design', 'UI/UX Design'), ('Product Design', 'Product Design'), ('AI Design', 'AI Design'), ] MENTORSHIP_AREAS = [ ('Career Advice', 'Career Advice'), ...
bbrighttaer/adplisttest
authentication/utils.py
utils.py
py
840
python
en
code
0
github-code
1
[ { "api_name": "django.core.mail.EmailMessage", "line_number": 32, "usage_type": "call" } ]
41489962994
import os import shutil import subprocess import tempfile from typing import List from phrasetree.tree import Tree from elit.metrics.f1 import F1 from elit.metrics.metric import Metric from elit.utils.io_util import get_resource, run_cmd from elit.utils.log_util import cprint class EvalbBracketingScorer(Metric): ...
emorynlp/seq2seq-corenlp
elit/metrics/parsing/evalb_bracketing_scorer.py
evalb_bracketing_scorer.py
py
7,748
python
en
code
13
github-code
1
[ { "api_name": "elit.metrics.metric.Metric", "line_number": 15, "usage_type": "name" }, { "api_name": "elit.utils.io_util.get_resource", "line_number": 52, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 54, "usage_type": "call" }, { "api_name"...
70861870115
"""A modified BFS algorithm for the Android Bubble Sort Puzzle Solver.""" from collections import deque from solver.trie import Trie from solver.state import is_solved_state from solver.state import count_finished_tubes from solver.state import get_next_states class QuantizedDoubleEndedPriorityQueue: """A Quant...
batzilo/android-ball-sort-puzzle-solver
solver/bfs.py
bfs.py
py
1,880
python
en
code
1
github-code
1
[ { "api_name": "collections.deque", "line_number": 22, "usage_type": "call" }, { "api_name": "solver.state.count_finished_tubes", "line_number": 43, "usage_type": "call" }, { "api_name": "solver.trie.Trie", "line_number": 46, "usage_type": "call" }, { "api_name": "...
18088940221
from model import db_connection from helper import id_generator,paginated_results from flask import Flask, request class Contacts: def __init__(self): self.db=db_connection.Database() def record_exists(self,field,data): count = self.db.get_doc_count("contacts",field,data) if count: ...
rahulkaliyath/contact-book-server
controllers/contacts.py
contacts.py
py
4,014
python
en
code
0
github-code
1
[ { "api_name": "model.db_connection.Database", "line_number": 8, "usage_type": "call" }, { "api_name": "model.db_connection", "line_number": 8, "usage_type": "name" }, { "api_name": "helper.id_generator.ran_gen", "line_number": 17, "usage_type": "call" }, { "api_na...
73502727075
# -------------------------------- # Name: plot_sbcape_loop.py # Author: Robert M. Frost # NOAA Global Systems Laboratory # Created: 26 June 2023 # Purpose: Loop to plot 2m dew point # and wind barb comparisons at # different times during forecast runs # -------------------------------- from UFSutils import read_grib ...
robbyfrost/plotting_ufs
plot_td2m_loop.py
plot_td2m_loop.py
py
6,930
python
en
code
0
github-code
1
[ { "api_name": "matplotlib.rc", "line_number": 41, "usage_type": "call" }, { "api_name": "matplotlib.rc", "line_number": 43, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 48, "usage_type": "call" }, { "api_name": "numpy.array", "line_numbe...
4904615211
""" Livestock Animal Pens """ #Django from django.db import models ORIENTATION_CHOICES = ( ('Norte','Norte'), ('Sur','Sur'), ('Este','Este'), ('Oeste','Oeste') ) class LivestockAnimalPens(models.Model): """ Modelo de Corrales de animales de la produccion ganadera """ production_live...
tapiaw38/agrapi
producer/models/livestock_animal_pens.py
livestock_animal_pens.py
py
956
python
en
code
0
github-code
1
[ { "api_name": "django.db.models.Model", "line_number": 14, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 14, "usage_type": "name" }, { "api_name": "django.db.models.ForeignKey", "line_number": 18, "usage_type": "call" }, { "api_name...
22892777110
from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import numpy as np import os import time fig = plt.figure() plt.ion() ax = fig.add_subplot(111, projection='3d') ax.grid(False) for root, folder, files in os.walk("./results/features"): for file in sorted(files): if ".npy" not in fil...
zhuimengshaonian666/view_synthesis
vis.py
vis.py
py
671
python
en
code
0
github-code
1
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 8, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.ion", "line_number": 9, "usage_type": "call" }, { "api_name": "matplot...
16287113588
#!/usr/bin/env python from __future__ import absolute_import from __future__ import print_function import numpy as np import pandas as pd import re import util import os import entrez as ez from xgmml import * import parallel import db from six.moves import range import setting class MCODECluster(Network): def __...
data2code/msbio
ppi.py
ppi.py
py
39,228
python
en
code
7
github-code
1
[ { "api_name": "util.error_msg", "line_number": 68, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 102, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 110, "usage_type": "call" }, { "api_name": "util.error_msg", "line_...
11714358376
import Server import os import socket import threading from tkinter import * from tkinter import filedialog, messagebox import customtkinter as ctk from CTkListbox import * import PIL.Image import PIL.ImageTk from Server import * SIZE = 1024 FORMAT = "utf-8" PORT = 4000 connFlag = [False, 0] def serverLogWindow(f...
Aryan51203/File-Transfer
hostServer.py
hostServer.py
py
5,609
python
en
code
0
github-code
1
[ { "api_name": "socket.gethostbyname", "line_number": 26, "usage_type": "call" }, { "api_name": "socket.gethostname", "line_number": 26, "usage_type": "call" }, { "api_name": "socket.socket", "line_number": 29, "usage_type": "call" }, { "api_name": "socket.AF_INET"...
23096307798
from jinja2 import Template f = open('weather.log', 'r') w = f.readlines() f.close() weather = [] for i in w: weather.append(i[:25].strip().split()) #print(weather) html = open('weth.txt').read() template = Template(html) render = template.render(weather = weather) f = open('weather.h...
AnnPython/-jinja
weth1.py
weth1.py
py
360
python
en
code
1
github-code
1
[ { "api_name": "jinja2.Template", "line_number": 13, "usage_type": "call" } ]
26807889190
import os import sys import numpy as np import pytest from numpy.random import normal sys.path.append(os.path.join(os.path.dirname(__file__), "../..")) module = __import__("Acquisition", fromlist=["EI"]) class TestEI: @pytest.mark.parametrize( ("mean", "var", "base"), [(0.0, 1.0, 0.5), (0.8, 0.1...
mit17024317/2020-0730
Optimizer/Search/Acquisition/test/test_EI.py
test_EI.py
py
790
python
en
code
0
github-code
1
[ { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
17360305125
"""empty message Revision ID: d21d3839c096 Revises: 0c6b29c57638 Create Date: 2020-01-08 12:54:10.048577 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'd21d3839c096' down_revision = '0c6b29c57638' branch_labels = None depends_on = None def upgrade(): # ...
bcgov/namex
api/migrations/versions/d21d3839c096_.py
d21d3839c096_.py
py
2,035
python
en
code
6
github-code
1
[ { "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...
14149292573
import sys sys.path.insert(0,'python') from geo_trans import * import numpy as np from scipy.interpolate import griddata from fast_rw import * def get_coords(h,v): mgrss = get_lon_lat(27, 5).ravel() mgrss = np.array([(i[:5],i[-8:-4],i[-4:]) for i in mgrss]).reshape(2400,2400,3) index = np.where(mgrss[:,:...
MarcYin/S2_MODIS
scripts/standard_mask.py
standard_mask.py
py
792
python
en
code
2
github-code
1
[ { "api_name": "sys.path.insert", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.where", "line_numbe...
53079157
__author__ = 'James DeVincentis <james.d@hexhost.net>' import os import multiprocessing import time import schedule import setproctitle import cif class Feeder(multiprocessing.Process): def __init__(self): multiprocessing.Process.__init__(self) self.backend = None self.logging = cif.log...
Danko90/cifpy3
lib/cif/feeder/feeder.py
feeder.py
py
2,614
python
en
code
0
github-code
1
[ { "api_name": "multiprocessing.Process", "line_number": 13, "usage_type": "attribute" }, { "api_name": "multiprocessing.Process.__init__", "line_number": 15, "usage_type": "call" }, { "api_name": "multiprocessing.Process", "line_number": 15, "usage_type": "attribute" },...
5863215541
from typing import Any, Dict, List, Type, TypeVar, Union import attr from ..models.share_credential import ShareCredential from ..types import UNSET, Unset T = TypeVar("T", bound="ModifyRepositoryProfileRequest") @attr.s(auto_attribs=True) class ModifyRepositoryProfileRequest: """Model having repository detail...
dell/omivv
Python/omevv/v1/omevv_apis_client/models/modify_repository_profile_request.py
modify_repository_profile_request.py
py
3,461
python
en
code
3
github-code
1
[ { "api_name": "typing.TypeVar", "line_number": 8, "usage_type": "call" }, { "api_name": "typing.Union", "line_number": 23, "usage_type": "name" }, { "api_name": "types.Unset", "line_number": 23, "usage_type": "name" }, { "api_name": "types.UNSET", "line_number...
11572477017
from collections import deque idx = 1 while True: N = int(input()) if N == 0: exit() arr = [list(map(int, input().split())) for _ in range(N)] cost = [[999]*N for _ in range(N)] visited = [[False]*N for _ in range(N)] q = deque([[0,0]]) cost[0][0] = arr[0][0] dx = [-1, 1, 0, 0...
hyojeong00/BOJ
boj4485.py
boj4485.py
py
796
python
en
code
0
github-code
1
[ { "api_name": "collections.deque", "line_number": 13, "usage_type": "call" } ]
805703677
import pyaudio import numpy as np import math import struct import simpleaudio as sa from imutils.video import FPS #CHUNK = 1024 CHUNK = 1024 FORMAT = pyaudio.paInt16 CHANNELS = 2 RATE = 44100 RECORD_SECONDS = 0.03 print(int(RATE / CHUNK * RECORD_SECONDS)) volume = 0.1 # range [0.0, 1.0] fs = 44100 # sampl...
matheusbitaraes/VirtualDrum
hearaudio.py
hearaudio.py
py
2,534
python
en
code
0
github-code
1
[ { "api_name": "pyaudio.paInt16", "line_number": 11, "usage_type": "attribute" }, { "api_name": "imutils.video.FPS", "line_number": 22, "usage_type": "call" }, { "api_name": "struct.unpack", "line_number": 28, "usage_type": "call" }, { "api_name": "math.sqrt", ...
11548425803
import hashlib import time import utils import asyncpg import asyncpg.exceptions as asyncpg_exc from config import logger from aiohttp import web from db_wrapper import DbWrapper router = web.RouteTableDef() @router.post('/sign_in') async def sign_in(request: web.Request): body = await request.json() email: ...
ilookhandsometoday/dance-studio-backend
src/routes.py
routes.py
py
7,394
python
en
code
0
github-code
1
[ { "api_name": "aiohttp.web.RouteTableDef", "line_number": 11, "usage_type": "call" }, { "api_name": "aiohttp.web", "line_number": 11, "usage_type": "name" }, { "api_name": "aiohttp.web.Request", "line_number": 14, "usage_type": "attribute" }, { "api_name": "aiohtt...
36924785517
from beewin_module.database.beewinDB import Member, Result from beewin_module.models.dataClass import MemberData from flask_restful import Resource, request, output_json from common.argsParser import uid_parser, member_parser class MemberResource(Resource): def get(self, uid): if uid == 'all': ...
Yicheng-1218/web_module
beewin_api/resource/MemberResource.py
MemberResource.py
py
1,043
python
en
code
0
github-code
1
[ { "api_name": "flask_restful.Resource", "line_number": 7, "usage_type": "name" }, { "api_name": "beewin_module.database.beewinDB.Result", "line_number": 11, "usage_type": "name" }, { "api_name": "beewin_module.database.beewinDB.Member.MemberLength", "line_number": 11, "us...
41060932108
import pytest import sacrebleu EPSILON = 1e-4 test_sentence_level_chrf = [ ( 'Co nás nejvíc trápí, protože lékaři si vybírají, kdo bude žít a kdo zemře.', ['Nejvíce smutní jsme z toho, že musíme rozhodovat o tom, kdo bude žít a kdo zemře.'], 39.14078509, ), ( 'Nebo prostě n...
mjpost/sacrebleu
test/test_chrf.py
test_chrf.py
py
3,965
python
en
code
896
github-code
1
[ { "api_name": "sacrebleu.corpus_chrf", "line_number": 73, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 71, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 71, "usage_type": "attribute" }, { "api_name": "sacreb...
27768711368
import numpy as np import itertools import multiprocessing import threading import subprocess import time import sys import os if len(sys.argv) != 3: print("input data_folder thread_num") exit(0) folder = sys.argv[1] max_spawn = int(sys.argv[2]) if not os.path.exists(folder): os.mkdir(folder) os.chdir(fo...
kodack64/Q3DE
fig10_q3de_throughput/micro_spawn.py
micro_spawn.py
py
2,178
python
en
code
1
github-code
1
[ { "api_name": "sys.argv", "line_number": 10, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 14, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_...
10663386137
import os, yaml, logging, re # external imports import torch from joeynmt.helpers import load_config from subword_nmt import apply_bpe from subword_nmt import apply_bpe from sacremoses import MosesTokenizer, MosesDetokenizer from joeynmt.helpers import load_config, get_latest_checkpoint, \ load_checkpoint from joey...
dsfsi/masakhane-web
src/server/core/model_load.py
model_load.py
py
10,260
python
en
code
34
github-code
1
[ { "api_name": "os.environ.get", "line_number": 24, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 24, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 59, "usage_type": "call" }, { "api_name": "os.path", "line_num...
15162386829
#!/usr/bin/python # -*- coding: utf-8 -*- import numpy as np import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap def down_sample(a): tmp=[] for t in a: tmp.append(t[3::4]) return tmp[3::4] def draw_velocity(time, output_dir, data_dir)...
atom-model/ATOM
utils/draw_atm_velocities.py
draw_atm_velocities.py
py
2,177
python
en
code
13
github-code
1
[ { "api_name": "matplotlib.use", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.fromfile", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.fromfile", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.fromfile", "lin...
2453043535
from random import random import matplotlib.pyplot as plt class AlgoritmoGenetico(): def __init__(self, tamanho_populacao): self.tamanho_populacao = tamanho_populacao self.populacao = [] self.geracao = 0 self.melhor_solucao = 0 self.lista_solucoes = [] ...
josuelaiber/Civil_Final_Project
curso/Algoritmos Genéticos em Python/13.py
13.py
py
4,418
python
pt
code
0
github-code
1
[ { "api_name": "random.random", "line_number": 36, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 116, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 116, "usage_type": "name" }, { "api_name": "matplotlib.p...
38639273059
import numpy as np import matplotlib.pyplot as plt import iris.plot as iplt from irise import convert, diagnostics, variable from myscripts.models.um import case_studies import tropopause pvtrop = 3.5 pvname = 'ertel_potential_vorticity' dz = np.linspace(-2000, 2000, 21) def main(cubes): """ """ # Calula...
leosaffin/scripts
myscripts/tropopause/inversion_layer.py
inversion_layer.py
py
1,141
python
en
code
2
github-code
1
[ { "api_name": "numpy.linspace", "line_number": 10, "usage_type": "call" }, { "api_name": "irise.convert.calc", "line_number": 17, "usage_type": "call" }, { "api_name": "irise.convert", "line_number": 17, "usage_type": "name" }, { "api_name": "irise.variable.N_sq",...
33931275405
# https://www.acmicpc.net/problem/7576 # 토마토 from collections import deque M, N = map(int, input().split()) #col row board = [] for _ in range(N): board.append(list(map(int, input().split()))) def bfs(): global M, N, board queue = deque() for i in range(N): for j in range(M): if ...
progjs/coding_test
백준/7576.py
7576.py
py
960
python
en
code
0
github-code
1
[ { "api_name": "collections.deque", "line_number": 13, "usage_type": "call" } ]
14285320497
""" Forms Motors. """ from datetime import date from django import forms class MotorForm(forms.Form): """ Formularios para oferta de mobliliarios. """ FUEL_CHOICES = [ ('Nafta', 'Nafta'), ('Diesel', 'Diesel'), ('Alcohol', 'Alcohol'), ('Flex', 'Flex'), ('Eléctrico', 'El...
Seph1986/202306_nemu_market
apps/motor_app/forms.py
forms.py
py
3,469
python
en
code
0
github-code
1
[ { "api_name": "django.forms.Form", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 7, "usage_type": "name" }, { "api_name": "datetime.date.today", "line_number": 23, "usage_type": "call" }, { "api_name": "datetime.date",...
28987569197
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at https://mozilla.org/MPL/2.0/. from __future__ import annotations import pandas as pd import numpy as np from typing import Iterable, Callable, Any ...
cat-cfs/libcbm_py
libcbm/input/sit/sit_parser.py
sit_parser.py
py
12,741
python
en
code
6
github-code
1
[ { "api_name": "pandas.DataFrame", "line_number": 12, "usage_type": "attribute" }, { "api_name": "pandas.DataFrame", "line_number": 13, "usage_type": "attribute" }, { "api_name": "typing.Iterable", "line_number": 84, "usage_type": "name" }, { "api_name": "pandas.Da...
15626371570
import requests import re import datetime from dateutil import parser import time from PIL import Image, ImageDraw, ImageFont import urllib.parse from googleapiclient.discovery import build from google_auth_oauthlib.flow import InstalledAppFlow from google.auth.transport.requests import Request import os import pickl...
Peragore/BeoCastingTools
build_ticker.py
build_ticker.py
py
25,854
python
en
code
0
github-code
1
[ { "api_name": "requests.Session", "line_number": 20, "usage_type": "call" }, { "api_name": "re.split", "line_number": 47, "usage_type": "call" }, { "api_name": "re.split", "line_number": 50, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 66, ...
31149492786
from enum import Enum from typing import Optional from discord.ext import commands from .utils import ASPECT_RATIO_ORIGINAL class ResizeFlagDescriptions(Enum): height = "Flag to specify height." width = "Flag to specify width." aspect_ratio = f"Flag to specify width:height aspect ratio when resizing. \ ...
WitherredAway/Yeet
cogs/Image/utils/flags.py
flags.py
py
1,959
python
en
code
16
github-code
1
[ { "api_name": "enum.Enum", "line_number": 9, "usage_type": "name" }, { "api_name": "utils.ASPECT_RATIO_ORIGINAL", "line_number": 13, "usage_type": "argument" }, { "api_name": "discord.ext.commands.FlagConverter", "line_number": 22, "usage_type": "attribute" }, { "...
21007477247
# -*- coding: utf-8 -*- """ Created on Sun Feb 14 18:50:22 2021 @author: Cillian """ import numpy as np from pyDOE import lhs def get_initial_pts(parameter_samples, parameter_ranges, criteria='center' ): """Get initial Latin Hypercube sample points and scale Args: parameter_samples (str): Number o...
CillianHourican/CLS-Project
Deliverable 1/utils.py
utils.py
py
2,294
python
en
code
1
github-code
1
[ { "api_name": "pyDOE.lhs", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.empty", "line_number": 50, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 52, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_numbe...
71015824995
# Title: 3Sum # Link: https://leetcode.com/problems/3sum/ from itertools import combinations from collections import defaultdict class Solution: def three_sum(self, nums: list) -> list: ans = set() ans_dict = set() d = defaultdict(lambda: 0) for n in nums: d[n] += 1 ...
yskang/AlgorithmPractice
leetCode/3_sum.py
3_sum.py
py
1,313
python
en
code
1
github-code
1
[ { "api_name": "collections.defaultdict", "line_number": 12, "usage_type": "call" }, { "api_name": "itertools.combinations", "line_number": 18, "usage_type": "call" } ]
3584234188
import numpy as np import sqlite3 as sq import datetime as dt import subprocess as sp import glob as gb import os import matplotlib.pyplot as plt from PyFVCOM.grid import vincenty_distance from PyFVCOM.read import FileReader from PyFVCOM.plot import Time, Plotter from PyFVCOM.stats import calculate_coefficient, rmse ...
li12242/PyFVCOM
PyFVCOM/validation.py
validation.py
py
40,160
python
en
code
null
github-code
1
[ { "api_name": "datetime.datetime", "line_number": 15, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 30, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 176, "usage_type": "call" }, { "api_name": "numpy.inf", ...
25056244488
import argparse import time import re import os import datetime import numpy as np import torch import torch.nn as nn import torch.optim as optim from torch.optim.lr_scheduler import ReduceLROnPlateau from torch.utils.data import Dataset, DataLoader, random_split from torch.nn.utils.rnn import pack_padded_sequence, p...
CAMeL-Lab/camel_morph
camel_morph/sandbox/merger_network.py
merger_network.py
py
12,300
python
en
code
3
github-code
1
[ { "api_name": "torch.nn.Module", "line_number": 18, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 18, "usage_type": "name" }, { "api_name": "vocab.src", "line_number": 24, "usage_type": "attribute" }, { "api_name": "torch.nn.Module", "l...
38924106495
#!/usr/bin/env python3 """Work Log Record work activities and store to a sqlite database Created: 2018 Last Update: 2018-06-05 Author: Alex Koumparos """ import datetime import re # from csv_manager import CsvManager from db_manager import DBManager import wl_settings as settings class Menu: """The user-facing...
Crossroadsman/treehouse-techdegree-python-project4
work_log.py
work_log.py
py
26,340
python
en
code
0
github-code
1
[ { "api_name": "wl_settings.DATE_FORMATS", "line_number": 35, "usage_type": "attribute" }, { "api_name": "wl_settings.DATE_FORMATS", "line_number": 36, "usage_type": "attribute" }, { "api_name": "datetime.datetime", "line_number": 40, "usage_type": "call" }, { "api...
23199437019
import math import torch import gpytorch import numpy as np from voltron.means import EWMAMean, DEWMAMean, TEWMAMean from botorch.models import SingleTaskGP from botorch.optim.fit import fit_gpytorch_torch from voltron.rollout_utils import nonvol_rollouts class BasicGP(): def __init__(self, train_x, train_y, kerne...
g-benton/Volt
voltron/models/.ipynb_checkpoints/BasicGPModels-checkpoint.py
BasicGPModels-checkpoint.py
py
2,558
python
en
code
41
github-code
1
[ { "api_name": "gpytorch.means.ConstantMean", "line_number": 15, "usage_type": "call" }, { "api_name": "gpytorch.means", "line_number": 15, "usage_type": "attribute" }, { "api_name": "voltron.means.EWMAMean", "line_number": 17, "usage_type": "call" }, { "api_name":...
72936024995
import gspread import pandas as pd import os import requests from google.oauth2 import service_account # from oauth2client.service_account import ServiceAccountCredentials from bs4 import BeautifulSoup scope = ['https://spreadsheets.google.com/feeds', 'https://www.googleapis.com/auth/drive'] secret_file = os....
arthurnovello/PriceMonitor
app.py
app.py
py
1,467
python
en
code
0
github-code
1
[ { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 11, "usage_type": "call" }, { "api_name": "google.oauth2.service_account.Cre...
20505915805
# -*- coding: utf-8 -*- # # Copyright (c) 2012 David Townshend # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2 of the License, or (at your # option) any later version. ...
aquavitae/norman
tests/test_store.py
test_store.py
py
10,128
python
en
code
1
github-code
1
[ { "api_name": "mock.Mock", "line_number": 35, "usage_type": "call" }, { "api_name": "norman.Index", "line_number": 36, "usage_type": "call" }, { "api_name": "mock.Mock", "line_number": 50, "usage_type": "call" }, { "api_name": "mock.Mock", "line_number": 103, ...
17337628519
import pygame, sys, time, random from pygame.locals import * # Установка pygame. pygame.init() mainClock = pygame.time.Clock() # Настройка окна. WINDOWWIDTH = 400 WINDIWHEIGHT = 400 windowSurface = pygame.display.set_mode((WINDOWWIDTH, WINDIWHEIGHT), 0, 32) pygame.display.set_caption('Спрайты и звуки') # Настройка ц...
pavel-malin/game_python3
game_python3/spriteAndSounds.py
spriteAndSounds.py
py
4,973
python
en
code
2
github-code
1
[ { "api_name": "pygame.init", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.time.Clock", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.time", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pygame.display.set_mode",...
39394256532
from django.conf.urls.static import static from django.contrib.auth.decorators import login_required from django.urls import path from . import views from .views import AddPostView, UserSettings, UserProfile from .models import Profile from newsletter.models import NewsLetter urlpatterns = [ path( "", ...
JodyMurray/p4-plant-blog
blog/urls.py
urls.py
py
1,567
python
en
code
0
github-code
1
[ { "api_name": "django.urls.path", "line_number": 11, "usage_type": "call" }, { "api_name": "views.PostList.as_view", "line_number": 13, "usage_type": "call" }, { "api_name": "views.PostList", "line_number": 13, "usage_type": "attribute" }, { "api_name": "django.ur...
26904261036
from collections import deque def bfs(graph, root): visited = set() queue = deque([root]) i = 0 while queue: n = queue.popleft() if n not in visited: if i != 0: visited.add(n) queue += set(graph[n]) - set(visited) i += 1 return vi...
habaekk/Algorithm
boj/11403.py
11403.py
py
918
python
en
code
0
github-code
1
[ { "api_name": "collections.deque", "line_number": 5, "usage_type": "call" } ]
73042146593
# This program returns the current weather description of a requested place. import requests def get_weather(city): api_key = "6259067ceac0680e898834ae9b3e9835" url = "http://api.openweathermap.org/data/2.5/weather?q=" \ + city + "&appid=" + api_key + "&units=metric" request = requests.get(url)...
JadaTijssen/Portfolio
weather.py
weather.py
py
1,652
python
en
code
0
github-code
1
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" } ]
22497223453
#!/usr/bin/env python3 import argparse import sys import shutil from utils import utils from typing import List def parse_args(av: List[str]): parser = argparse.ArgumentParser(description="Run / check clang-tidy on staged cpp files.") parser.add_argument( "--clang-tidy-executable", help="Specific clan...
CesiumGS/cesium-omniverse
scripts/clang_tidy.py
clang_tidy.py
py
1,188
python
en
code
27
github-code
1
[ { "api_name": "typing.List", "line_number": 9, "usage_type": "name" }, { "api_name": "argparse.ArgumentParser", "line_number": 10, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 18, "usage_type": "name" }, { "api_name": "utils.utils.get_projec...
14724616321
from decimal import Decimal, getcontext import requests from utils.utils import get_data from utils import config DB_API_URL = config.DB_API_URL async def rate(valute): RATE_CNY = requests.get('https://www.cbr-xml-daily.ru/daily_json.js').json() rate = RATE_CNY['Valute'][valute]['Value']/10 url = f'{DB_...
IgorOlenchuk/bot_mypoison
bot/utils/settings.py
settings.py
py
790
python
en
code
1
github-code
1
[ { "api_name": "utils.config.DB_API_URL", "line_number": 7, "usage_type": "attribute" }, { "api_name": "utils.config", "line_number": 7, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "utils.utils.get_...
19416966323
import calendar import datetime from math import ceil import numpy as np from aiogram.dispatcher import FSMContext from aiogram.types import Message, ReplyKeyboardRemove, InlineKeyboardMarkup, \ InlineKeyboardButton, CallbackQuery from utils.db_api.models import DBCommands from data.config import days, months from ...
Sanzensekai-mx/cosmetology_bot_example
utils/general_func.py
general_func.py
py
9,053
python
en
code
0
github-code
1
[ { "api_name": "utils.db_api.models.DBCommands", "line_number": 12, "usage_type": "call" }, { "api_name": "aiogram.types.InlineKeyboardMarkup", "line_number": 26, "usage_type": "call" }, { "api_name": "aiogram.types.InlineKeyboardButton", "line_number": 34, "usage_type": "...
33918027336
import hydra import logging import pandas as pd from sklearn.model_selection import train_test_split from sklearn.model_selection import cross_val_score, StratifiedShuffleSplit from sklearn import metrics from joblib import load from transformers import pipeline logger = logging.getLogger(__name__) def evaluate_H...
Vachonni/ChatbotWiz
src/modelling/evaluate.py
evaluate.py
py
3,005
python
en
code
0
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "transformers.pipeline", "line_number": 24, "usage_type": "call" }, { "api_name": "sklearn.metrics.classification_report", "line_number": 31, "usage_type": "call" }, { "api...
32134064982
#GET() - Is used to request data from a specified resource. when you access a websites page your #browser makes a get request to your api. The api will return the front end that is displayed #in the browser #for example - get request is printing "bye world" for us in the local host port no. 8000. #POST() - is us...
manasvijain20/flask-project
app.py
app.py
py
1,849
python
en
code
0
github-code
1
[ { "api_name": "flask.Flask", "line_number": 16, "usage_type": "call" }, { "api_name": "flask.request.json", "line_number": 34, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 34, "usage_type": "name" }, { "api_name": "flask.jsonify", ...
31128572577
#!/usr/bin/env python import lzma import pickle from Bio import SeqIO import os import numpy as np import sys import matplotlib.pyplot as plt from sklearn.feature_extraction.text import CountVectorizer as Cvec from itertools import product from scipy.stats import poisson from scipy.special import softmax dmel_bkg = ...
laiker96/alfree_enhancer_detection
process_fasta_vectorization.py
process_fasta_vectorization.py
py
7,352
python
en
code
0
github-code
1
[ { "api_name": "numpy.load", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 19, ...
44221187152
import argparse import logging import pdb import sys import traceback from typing import Text, Optional import torch from pyprojroot import here as project_root import os sys.path.insert(0, str(project_root())) from context_model_pretrain import make_model from data.fsmol_task import FSMolTaskSample from data.multi...
cfifty/CAMP
context_modeling_test.py
context_modeling_test.py
py
4,420
python
en
code
0
github-code
1
[ { "api_name": "sys.path.insert", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "pyprojroot.here", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.getLogger", ...
21521159472
#!/usr/bin/env python3 import argparse """ Script to find complementary subsequences inside of a main sequence. Copyright 2020 Margherita Maria Ferrari. This file is part of ComplSeqUtils. ComplSeqUtils is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License a...
mmferrari/ComplSeqUtils
compl_seq_utils.py
compl_seq_utils.py
py
6,687
python
en
code
0
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 81, "usage_type": "call" } ]
12388878470
# asyncio实现了tcp udp ssl等协议,aiohttp是基于asyncio实现的http框架 import asyncio from aiohttp import web # 编写一个http服务器处理以下url #  / - 首页返回 b'<h1>Index</h1>'; #  /hello/{name} - 根据 URL 参数返回文本 hello, %s!。 async def index(request): await asyncio.sleep(0.5) return web.Response(body=b'<h1>index</h1>') async def hello(reque...
chikchikL/pythonLearning
aiohttp_demo.py
aiohttp_demo.py
py
969
python
en
code
0
github-code
1
[ { "api_name": "asyncio.sleep", "line_number": 10, "usage_type": "call" }, { "api_name": "aiohttp.web.Response", "line_number": 11, "usage_type": "call" }, { "api_name": "aiohttp.web", "line_number": 11, "usage_type": "name" }, { "api_name": "asyncio.sleep", "l...
38467207386
import cv2 import numpy as np import keras emnist_labels = [48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 1...
Xaosgod/image-text-recognition
Распознование текста дополнительно/main.py
main.py
py
2,500
python
en
code
0
github-code
1
[ { "api_name": "cv2.imread", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.COLOR_RGB2GRAY", "line_number": 11, "usage_type": "attribute" }, { "api_name": "cv2.threshold", "...
29326716419
from bs4 import BeautifulSoup import requests from csv import writer url = "https://www.linkedin.com/jobs/search?keywords=backend&location=India&geoId=102713980&trk=public_jobs_jobs-search-bar_search-submit&position=1&pageNum=0" page = requests.get(url) soup = BeautifulSoup(page.content,'html.parser') lists = soup.f...
entrepreneur123/web-scrapping
scrap.py
scrap.py
py
1,542
python
en
code
0
github-code
1
[ { "api_name": "requests.get", "line_number": 6, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 9, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 14, "usage_type": "call" } ]
4048633000
import traceback from types import MethodType # # class MyClass(object): # pass # # def set_name(self,name): # self.name=name # # cls = MyClass() # cls.name="kevin" # print(cls.name) # # cls.set_name = MethodType(set_name,cls) # cls.set_name("lara") # print(cls.name) #第二部分:可以看到上面的类可以被随便添加方法和属性,那么怎么实现只能添加指定的属性...
zkc360717118/PYTHON-python-study
7.1 slot和property.py
7.1 slot和property.py
py
6,827
python
en
code
0
github-code
1
[ { "api_name": "enum.Enum", "line_number": 113, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 239, "usage_type": "attribute" }, { "api_name": "logging.basicConfig", "line_number": 256, "usage_type": "call" }, { "api_name": "logging.DEBUG...
1306455244
import argparse import glob import os import numpy as np import tensorflow as tf from tqdm import tqdm from params import logmel_predictions_root, emb_root, saved_models_root os.environ["CUDA_VISIBLE_DEVICES"] = "1" os.environ['TF_FORCE_GPU_ALLOW_GROWTH'] = 'true' os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' def main...
polimi-ispl/speech_reconstruction_embeddings
dataset/logmel_predictions.py
logmel_predictions.py
py
2,750
python
en
code
1
github-code
1
[ { "api_name": "os.environ", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 14, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentPars...
27368861795
import numpy from sympy import symbols, exp, sqrt, diff, N, solve, integrate def function(x): return numpy.exp(-numpy.sqrt(x)) def function_symbolic(): return exp(-sqrt(symbols('x'))) # noinspection SpellCheckingInspection def m_n_plus_one(n, a, b, func): x = symbols('x') extremums = solve(diff(fu...
Miralius/LabsNumericalMethods
Lab3/functions.py
functions.py
py
1,459
python
en
code
0
github-code
1
[ { "api_name": "numpy.exp", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 6, "usage_type": "call" }, { "api_name": "sympy.exp", "line_number": 10, "usage_type": "call" }, { "api_name": "sympy.sqrt", "line_number": 10, ...
22110756450
""" Posts Models """ #Django from users.models import Profile from django.contrib.auth.models import User from django.db import models class Post(models.Model): user=models.ForeignKey(User,on_delete=models.CASCADE) profile=models.ForeignKey('users.Profile',on_delete=models.CASCADE) title= models.CharField...
jjestrada2/jjestrada2.github.io
platziGram/juanjoGraming/posts/models.py
models.py
py
576
python
en
code
1
github-code
1
[ { "api_name": "django.db.models.Model", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 8, "usage_type": "name" }, { "api_name": "django.db.models.ForeignKey", "line_number": 9, "usage_type": "call" }, { "api_name": ...
33318878173
import rpyc import sys server = "localhost" if len(sys.argv) > 1: if int(sys.argv[1]) > 0: try: conn = rpyc.connect(server, 18811) if conn.root: conn.root.initialize_connections(int(sys.argv[1])) while True: try: remote_command = input("Input the Command:\t").lower().split(" ") conn....
bodias/ds2022-mini-proj-1
ra_program_client.py
ra_program_client.py
py
793
python
en
code
0
github-code
1
[ { "api_name": "sys.argv", "line_number": 6, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 7, "usage_type": "attribute" }, { "api_name": "rpyc.connect", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 1...
6884041126
from torch import nn import torch.nn.functional as f class LSTM(nn.Module): def __init__(self, in_channels, hidden_dim, n_layer, n_classes): super(LSTM, self).__init__() self.n_layer = n_layer self.latent_dim = 32 self.hidden_dim = hidden_dim self.map = nn.Linear(in_channe...
Huasheng-hou/deep-fin
src/model/LSTM.py
LSTM.py
py
657
python
en
code
0
github-code
1
[ { "api_name": "torch.nn.Module", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 5, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
2333300703
from openpyxl import Workbook arquivo_excel = Workbook() planilha1 = arquivo_excel.active planilha1.title = "Relatorios" planilha2 = arquivo_excel.create_sheet("Ganhos") planilha1['A1'] = 'Categoria' planilha1['B1'] = 'Valor' planilha1['A2'] = "Restaurante" planilha1['B2'] = 45.99 planilha2.cell(row=3, column=1, value=...
DeMouraSS/dados-detran
planilha.py
planilha.py
py
409
python
pt
code
0
github-code
1
[ { "api_name": "openpyxl.Workbook", "line_number": 2, "usage_type": "call" } ]
25474598848
""" Picomon executable module. This module can be executed from a command line with ``$python -m picomon`` or from a python programme with ``picomon.__main__.run()``. """ import concurrent.futures import signal import argparse import logging import traceback import sys import os from time import sleep from datetim...
StrasWeb/picomon
picomon/__main__.py
__main__.py
py
4,947
python
en
code
0
github-code
1
[ { "api_name": "datetime.datetime.now", "line_number": 28, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 28, "usage_type": "name" }, { "api_name": "datetime.timedelta", "line_number": 29, "usage_type": "call" }, { "api_name": "datetime.d...
2774942212
from __future__ import absolute_import import os from celery import Celery from django.conf import settings # set the default Django settings module for the 'celery' program. os.environ.setdefault("DJANGO_SETTINGS_MODULE", "applifting.settings") app = Celery("applifting") # Using a string here means the worker will n...
ondrej-ivanko/applifting
applifting/celery.py
celery.py
py
949
python
en
code
0
github-code
1
[ { "api_name": "os.environ.setdefault", "line_number": 7, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 7, "usage_type": "attribute" }, { "api_name": "celery.Celery", "line_number": 8, "usage_type": "call" }, { "api_name": "django.conf.settings...
41654548036
import numpy as np import keras import pandas as pd from sklearn.model_selection import train_test_split np.random.seed(123) import tensorflow as tf tf.set_random_seed(123) from keras.models import Sequential from keras.layers import Dense, Dropout, Activation, Flatten from keras.layers import Convolution2D, MaxPoolin...
wasi-9274/DL_Directory
DL_Projects/mnist_advanced.py
mnist_advanced.py
py
2,351
python
en
code
0
github-code
1
[ { "api_name": "numpy.random.seed", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 5, "usage_type": "attribute" }, { "api_name": "tensorflow.set_random_seed", "line_number": 7, "usage_type": "call" }, { "api_name": "pandas.re...
2710936445
import os import shlex import subprocess import datetime import time import shutil from setuptools import setup, Extension cwd = os.path.dirname(os.path.abspath(__file__)) def execute_command(cmdstring, cwd=None, timeout=None, shell=False): if shell: cmdstring_list = cmdstring else: cmdstring...
caozhanhao/opqr-python
setup.py
setup.py
py
1,983
python
en
code
1
github-code
1
[ { "api_name": "os.path.dirname", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 9, "usage_type": "call" }, { "api_name": "shlex.split", "line_num...
24879538563
import pathlib from typing import Any, Callable, NamedTuple import pytest from fastapi.testclient import TestClient from starlette import status from tests.conftest import authenticate, find_username PROGRESS_REPORT_URL = "/progress" def _prepare_settings_and_summary( proposal_code: str, tmp_path: pathlib.Path...
saltastroops/salt-api
tests/integration/progress_report/test_submit_progress_report.py
test_submit_progress_report.py
py
5,922
python
en
code
0
github-code
1
[ { "api_name": "pathlib.Path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "pytest.MonkeyPatch", "line_number": 14, "usage_type": "attribute" }, { "api_name": "typing.NamedTuple", "line_number": 16, "usage_type": "name" }, { "api_name": "pathlib.P...