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
5271224866
"""Add titre_loi and urls_loi to Dossier Revision ID: 4f517bb53d67 Revises: a3f51bad5419 Create Date: 2022-06-13 08:33:44.107959 """ from alembic import op import sqlalchemy as sa from sqlalchemy_utils import JSONType # revision identifiers, used by Alembic. revision = "4f517bb53d67" down_revision = "a3f51bad5419" ...
administration-solrep/signale
zam-repondeur-1.17.7/db_migrations/versions/4f517bb53d67_add_titre_loi_and_urls_loi_to_dossier.py
4f517bb53d67_add_titre_loi_and_urls_loi_to_dossier.py
py
642
python
en
code
0
github-code
21
[ { "api_name": "alembic.op.add_column", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 21, "usage_type": "call" }, { "api_name": "sqlalchemy.Text", ...
11267963765
# -*- coding: utf-8 -*- """ Created on Sun Oct 17 11:13:55 2021 @author: Asus """ import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torchvision from torch.utils.data import Dataset, DataLoader from torchvision import transforms, utils import numpy as n...
shubhamsarda00/COL341-Machine-Learning
Assignment2.2/src/test_c.py
test_c.py
py
4,252
python
en
code
0
github-code
21
[ { "api_name": "torch.utils.data.Dataset", "line_number": 20, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 51, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 51, "usage_type": "attribute" }, { "api_name": "numpy.array", ...
3613353568
import setuptools with open("README.md", "r") as fh: long_description = fh.read() with open('requirements.txt') as f: install_requires = f.read().splitlines() setuptools.setup( name="robusta_stats", version="0.0.4", author="Eitan Hemed", author_email="Eitan.Hemed@gmail.com", description="...
EitanHemed/robusta
setup.py
setup.py
py
870
python
en
code
1
github-code
21
[ { "api_name": "setuptools.setup", "line_number": 9, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 26, "usage_type": "call" } ]
21997703956
################################################################################ # TRAVELING SALESMAN PROBLEM - LOGGING FUNCTIONS # Olga Koldachenko okold525@mtroyal.ca # COMP 5690 Senior Computer Science Project # Mount Royal University Winter 2022 # # This file holds several helper functio...
okold/stake
log.py
log.py
py
2,464
python
en
code
0
github-code
21
[ { "api_name": "datetime.datetime.now", "line_number": 39, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 39, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 68, "usage_type": "call" }, { "api_name": "datetim...
1562311963
import os import sys import glob import numpy as np import yaml from data_analysis import gaze from data_analysis import visualization from data_analysis.visualization.gaze_quality import plot_gaze_accuracy_heatmap, plot_gaze_accuracy_contour # Directory for the recording sessions parameters_fpath = "/home/kamran/Code...
vedb/data_analysis
demos/test_cumulative_gaze_accuracy.py
test_cumulative_gaze_accuracy.py
py
3,147
python
en
code
0
github-code
21
[ { "api_name": "yaml.safe_load", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.vstack", "line_number": 38, "usage_type": "call" }, { "api_name": "numpy.vstack", "line_numbe...
17760173943
from flask import Flask from flask import make_response, url_for, redirect from flask import render_template import json import os PROJECT_ROOT = os.path.realpath(os.path.dirname(__file__)) data_path = os.path.join(PROJECT_ROOT, 'data', 'data.json') img_dir_path = 'static/img/' data = json.loads( open(data_path...
bethirahul/Portfolio-Webpage-AWS
flask_app2.py
flask_app2.py
py
1,974
python
en
code
0
github-code
21
[ { "api_name": "os.path.realpath", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.join", "lin...
37044480063
import numpy as np import matplotlib.pyplot as plt from DRG import FicheroMatriz, CalcularLongitud from random import randrange listaReacciones, listaEFMs = FicheroMatriz("EFMsEColi.txt") proporcionesTotales = {} for i in listaReacciones: proporcionesTotales[i] = 0 for i in EFMsEColi: for ind, j in enumerate(...
Guillamoto/TFM-tools
LongitudesProporciones.py
LongitudesProporciones.py
py
848
python
es
code
0
github-code
21
[ { "api_name": "DRG.FicheroMatriz", "line_number": 6, "usage_type": "call" }, { "api_name": "random.randrange", "line_number": 24, "usage_type": "call" }, { "api_name": "DRG.CalcularLongitud", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.mean", ...
36006110471
#!/usr/bin/env python3 # CSDN刷访客 # Author: 夏日 # 分为指定url和遍历所有文章两种模式 # github: https://github.com/zss192/CTF-python-script/blob/master/csdn%E5%88%B7%E8%AE%BF%E5%AE%A2.py import re import requests import time import random user_agent_list=[ 'Mozilla/5.0(compatible;MSIE9.0;WindowsNT6.1;Trident/5.0)', ...
zss192/CTF-python-script
test.py
test.py
py
3,209
python
en
code
5
github-code
21
[ { "api_name": "random.choice", "line_number": 34, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 35, "usage_type": "call" }, { "api_name": "requests.Session", "line_number": 37, "usage_type": "call" }, { "api_name": "re.compile", "line_n...
70039940854
from reportlab.pdfbase import pdfmetrics from pprint import pprint import io widths = {} ratios = [] for i in range(1, 100): width = pdfmetrics.stringWidth("Preliminary", "Courier", i) widths[i] = width ratios.append(width / i) # pprint(ratios) pprint(widths)
kForth/PdfMarker
test.py
test.py
py
275
python
en
code
1
github-code
21
[ { "api_name": "reportlab.pdfbase.pdfmetrics.stringWidth", "line_number": 10, "usage_type": "call" }, { "api_name": "reportlab.pdfbase.pdfmetrics", "line_number": 10, "usage_type": "name" }, { "api_name": "pprint.pprint", "line_number": 15, "usage_type": "call" } ]
31670672267
from att_speech.modules.hooks.hook import TrainingLoopHook import torch class ConstantGradientNoise(TrainingLoopHook): def __init__(self, gradient_noise, **kwargs): self.gradient_noise = gradient_noise super(ConstantGradientNoise, self).__init__(**kwargs) def post_backward(self, model, optimi...
chorowski-lab/pytorch-asr
att_speech/modules/hooks/gradient_noise.py
gradient_noise.py
py
637
python
en
code
3
github-code
21
[ { "api_name": "att_speech.modules.hooks.hook.TrainingLoopHook", "line_number": 5, "usage_type": "name" }, { "api_name": "torch.randn_like", "line_number": 16, "usage_type": "call" } ]
10366273076
from django.urls import path # Views from apps.users import views app_name = "users" urlpatterns = [ path( "login/", views.LoginView.as_view(), name="login" ), path( "logout/", views.LogoutView.as_view(), name="logout" ), path( "create/", ...
JCristhian96/docker-sistemsb
sistema/apps/users/urls.py
urls.py
py
493
python
en
code
0
github-code
21
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "apps.users.views.LoginView.as_view", "line_number": 10, "usage_type": "call" }, { "api_name": "apps.users.views.LoginView", "line_number": 10, "usage_type": "attribute" }, { ...
24705143314
from django.http import request from django.shortcuts import redirect, render from shop.forms.users.signups import ImageUserForm, SignupForm from django.views.decorators.csrf import csrf_exempt from shop.models.ImageUser import ImageUser @csrf_exempt def about(request): form_image = ImageUserForm() if reques...
WeerachonYN/Workshop1
shop/views/about.py
about.py
py
1,129
python
en
code
0
github-code
21
[ { "api_name": "shop.forms.users.signups.ImageUserForm", "line_number": 9, "usage_type": "call" }, { "api_name": "django.http.request.method", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.http.request", "line_number": 10, "usage_type": "name" }, ...
74029064371
from random import randint from sqlalchemy.exc import IntegrityError from faker import Faker from . import db from .task.models import Task from datetime import datetime def tasks(count=30): fake = Faker() i = 0 while i < count: task = Task(title=fake.text(), description=fake.text(), ...
dima-yurchuk/project_web_flask
app/fake.py
fake.py
py
523
python
en
code
0
github-code
21
[ { "api_name": "faker.Faker", "line_number": 11, "usage_type": "call" }, { "api_name": "task.models", "line_number": 14, "usage_type": "name" }, { "api_name": "task.models.Task", "line_number": 14, "usage_type": "call" }, { "api_name": "task.models", "line_numb...
70138449652
#!/usr/bin/python3 import argparse import sys def get_args(): parser = argparse.ArgumentParser( description="convert alphabetical column names to numbers" ) parser.add_argument( "colname", type=str, help="alphabetical letters to convert into numbers" ) return parser.parse_args() ...
kkirino/commands
letters2int.py
letters2int.py
py
950
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 31, "usage_type": "call" }, { "api_name": "sys.stderr", "line_number": 34, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_...
4846406616
import json ### Classes ## Team class class Team: def __init__(self, name, hthDict): self.name = name self.headToHeadDict = hthDict ## League class (collection of teams) class League: def __init__(self, teams): self.teams = teams self.matrix = Matrix(self.getTeamNamesList()) ...
SoslyLW/SportsReferenceInternship2023
main.py
main.py
py
2,833
python
en
code
0
github-code
21
[ { "api_name": "json.load", "line_number": 86, "usage_type": "call" } ]
70471099893
#%% from sklearn import datasets import matplotlib.pyplot as plt import numpy as np # AgglomerativeClustering(병합군집) : 시작할 때 각 포인트를 하나의 클러스터로 지정하고, 그다음 종료 조건을 만족할 때까지 가장 비슷한 두 클러스터를 합침 from sklearn.cluster import KMeans, AgglomerativeClustering, k_means n=500 x1, y1 = datasets.make_blobs(n_samples=n, random_state=8) x...
jeewonkimm2/scikitlearn_review
Data_Mining/Clustering2.py
Clustering2.py
py
2,490
python
ko
code
0
github-code
21
[ { "api_name": "sklearn.datasets.make_blobs", "line_number": 10, "usage_type": "call" }, { "api_name": "sklearn.datasets", "line_number": 10, "usage_type": "name" }, { "api_name": "sklearn.datasets.make_blobs", "line_number": 11, "usage_type": "call" }, { "api_name...
20550849801
import matplotlib.pyplot as plt point1 = (4, 1) point2 = (3, 4) fig, ax = plt.subplots(1, 1) fig.set_size_inches(5,5) ax.plot(point1[0], point1[1], color='green', marker='^',linestyle='None', label='point1') ax.plot(point2[0], point2[1], color='red', marker='o', linestyle='None',label='point2') ax.set_xlim([0, 5]) a...
spatialthoughts/courses
code/python_dataviz/solutions/01_matplotlib_basics.py
01_matplotlib_basics.py
py
363
python
en
code
38
github-code
21
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 6, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.show", "line_number": 15, "usage_type": "call" }, { "api_name": "mat...
4771167232
from src.database.repository.news_repository import NewsRepository from src.schema.news import NewsInsert, NewsCustom from datetime import datetime class NewsService: def __init__(self): self.news_repository = NewsRepository() def create_news(self, news): self.news_repository.create_document(...
octsobral/news-portal-backend
src/service/news_service.py
news_service.py
py
2,349
python
en
code
0
github-code
21
[ { "api_name": "src.database.repository.news_repository.NewsRepository", "line_number": 8, "usage_type": "call" }, { "api_name": "src.schema.news.NewsCustom", "line_number": 51, "usage_type": "call" }, { "api_name": "src.schema.news.NewsCustom", "line_number": 64, "usage_t...
18742354728
#!/usr/bin/env python3 import numpy as np import matplotlib # Force matplotlib to not use any X Windows backend (must be called befor importing pyplot) matplotlib.use('Agg') import matplotlib.pyplot as plt import scipy.optimize as optimize from sigmoid import sigmoid from plotData import plotData from costFunction im...
altermarkive/machine-learning-course-by-stanford-university
machine-learning-ex2/ex2/ex2.py
ex2.py
py
5,240
python
en
code
2
github-code
21
[ { "api_name": "matplotlib.use", "line_number": 6, "usage_type": "call" }, { "api_name": "sigmoid.sigmoid", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.any", "line_number"...
9146847835
from enum import Enum import re import requests import dblp.config as config import dblp.dblp_data as dblp_data class BibFormat(Enum): """ Format of DBLP bibtex. """ condensed = 'condensed' standard = 'standard' crossref = 'crossref' def bib_url(self): """ Get identifier...
k4ntz/latex_utils
dblp/dblp_api.py
dblp_api.py
py
2,247
python
en
code
5
github-code
21
[ { "api_name": "enum.Enum", "line_number": 9, "usage_type": "name" }, { "api_name": "re.search", "line_number": 42, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 59, "usage_type": "call" }, { "api_name": "dblp.config.DBLP_PUBLICATION_BIBTEX.f...
13065042654
""" paper: T-Net: Deep Stacked Scale-Iteration Network for Image Dehazing file: create_trainlist.py about: create a list for the training/testing images author: Lirong Zheng date: 01/01/21 """ import os import argparse parser = argparse.ArgumentParser(description='Parameters for create list') parser.add_argument('-f...
Dilizlr/T-Net
utils/create_trainlist.py
create_trainlist.py
py
885
python
en
code
2
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 22, "usage_type": "call" } ]
33005977596
import pandas as pd import datetime as dt from airflow import DAG from airflow.operators.bash_operator import BashOperator from airflow.operators.python_operator import PythonOperator bashCommand = "curl https://archive.ics.uci.edu/ml/machine-learning-databases/00382/c2k_data_comma.csv" dataCleaned = None dataConverte...
israelzuniga/effective-bassoon
dags/dag-Jaime.py
dag-Jaime.py
py
1,059
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 17, "usage_type": "call" }, { "api_name": "pandas.DataFrame", ...
10212937698
""" @Author : Wilson79 @Date : 2020年2月9日 星期日 12:41:38 """ # 导入词云制作库wordcloud和中文分词库jieba import jieba import wordcloud w = wordcloud.WordCloud(width=1500, height=1100, background_color='white', font_path="/System/Library/fonts/PingFang.ttc") # ...
wsh3776/wordcloud
code/code3_jieba.py
code3_jieba.py
py
934
python
zh
code
0
github-code
21
[ { "api_name": "wordcloud.WordCloud", "line_number": 10, "usage_type": "call" }, { "api_name": "jieba.lcut", "line_number": 17, "usage_type": "call" } ]
6422076806
import sys import re import mysql.connector from antlr4 import * from antlr4.InputStream import InputStream from lib.ClusterConfigGrammar.ClusterConfigLexer import ClusterConfigLexer from lib.ClusterConfigGrammar.ClusterConfigParser import ClusterConfigParser from lib.ClusterConfigGrammar.ClusterConfigListener impor...
gonzoKhan/ics421-Naive-SQL-Processing-for-Parallel-DBMS
loadCSV.py
loadCSV.py
py
11,441
python
en
code
0
github-code
21
[ { "api_name": "lib.ClusterConfigGrammar.ClusterConfigLexer.ClusterConfigLexer", "line_number": 25, "usage_type": "call" }, { "api_name": "lib.ClusterConfigGrammar.ClusterConfigParser.ClusterConfigParser", "line_number": 27, "usage_type": "call" }, { "api_name": "lib.ClusterConfig...
29316505405
import pytest from src.problems.average_of_levels_in_binary_tree import Solution from src.utils.tree_node import BTreeNode @pytest.mark.parametrize( "root,expected", [ (BTreeNode(3, left=BTreeNode(9), right=BTreeNode( 20, left=BTreeNode(15), right=BTreeNode(7)...
yyunikov/coding-python
tests/problems/average_of_levels_in_binary_tree_test.py
average_of_levels_in_binary_tree_test.py
py
667
python
en
code
0
github-code
21
[ { "api_name": "src.problems.average_of_levels_in_binary_tree.Solution", "line_number": 23, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 7, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 7, "usage_type": "attribute" ...
6090512874
import numpy as np import matplotlib.pyplot as plt import sys """ input: x is a boolean list. Example [1,0,1,0,1] ouput: It converts the boolean list to integer and square it. input=[0,0,1,0,1] converted to integer -> 5 output=square(5)->25 """ def f1(x): #convert binary to integer res = 0 for ele in...
ranjanZ/Ev_computing
function1.py
function1.py
py
4,594
python
en
code
0
github-code
21
[ { "api_name": "numpy.array", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.random.randint", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 37, "usage_type": "attribute" }, { "api_name": "numpy.random.choic...
43448616770
#!/usr/bin/env python # -*- coding: utf-8 -*- import requests import re url='https://movie.douban.com/top250' dic = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36' } rec = requests.get(url,headers=dic) rec_text = rec.text obj...
wdnmdgdx741/niubi_toolset
爬虫/取HTMl文件/requests1.py
requests1.py
py
703
python
en
code
5
github-code
21
[ { "api_name": "requests.get", "line_number": 13, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 16, "usage_type": "call" }, { "api_name": "re.S", "line_number": 18, "usage_type": "attribute" } ]
73042359413
import discord import urllib.request import random import os import json import shutil import asyncio import sys import chanrestrict LATEX_TEMPLATE="template.tex" HELP_MESSAGE = r""" Hello! I'm the *LaTeX* math bot! You can type mathematical *LaTeX* into the chat and I'll automatically render it! Simply use the `!...
DXsmiley/LatexBot
latexbot.py
latexbot.py
py
4,638
python
en
code
34
github-code
21
[ { "api_name": "discord.Client", "line_number": 36, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 42, "usage_type": "call" }, { "api_name": "chanrestrict.setup", "line_number": 52, "usage_type": "call" }, { "api_name": "os.path.isfile", ...
1846343852
import os import cv2 import k4a import numpy as np import torch import model.transforms as transforms from config import CONFIG from model.model_cnn import CNNClassifier device = k4a.Device.open() if device is None: exit(-1) device_config = k4a.DeviceConfiguration( color_format=k4a.EImageFormat.COLOR_BGRA32...
GiveMeTheReason/gestures-navigation
kinect/tst_camera.py
tst_camera.py
py
4,314
python
en
code
0
github-code
21
[ { "api_name": "k4a.Device.open", "line_number": 12, "usage_type": "call" }, { "api_name": "k4a.Device", "line_number": 12, "usage_type": "attribute" }, { "api_name": "k4a.DeviceConfiguration", "line_number": 16, "usage_type": "call" }, { "api_name": "k4a.EImageFor...
17180871680
import sys from serial import SerialException from serial.tools.list_ports import comports from PyQt5.QtGui import QTextCursor from PyQt5.QtCore import pyqtSignal from PyQt5.QtWidgets import QWidget, QPlainTextEdit, QApplication, QLineEdit, QPushButton, \ QHBoxLayout, QVBoxLayout, QLabel, QComboBox, QErrorMessage ...
Abestanis/BalloonLaserPointing
controller/ui.py
ui.py
py
7,105
python
en
code
0
github-code
21
[ { "api_name": "PyQt5.QtWidgets.QApplication", "line_number": 11, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 21, "usage_type": "attribute" }, { "api_name": "Py...
5122602364
from prefect import flow, task, get_run_logger from prefect_pokemon.credentials import PokemonCredentials @task(retries=3) def get_pokemon(credentials: PokemonCredentials, name: str): logger = get_run_logger() client = credentials.get_client() logger.info(f"Fetching info for Pokemon {name}") return ...
desertaxle/prefect-pokemon
prefect_pokemon/pokemon.py
pokemon.py
py
1,304
python
en
code
5
github-code
21
[ { "api_name": "prefect_pokemon.credentials.PokemonCredentials", "line_number": 7, "usage_type": "name" }, { "api_name": "prefect.get_run_logger", "line_number": 8, "usage_type": "call" }, { "api_name": "prefect.task", "line_number": 6, "usage_type": "call" }, { "a...
26969827505
from collections import defaultdict class Solution: def firstUniqChar(self, s: str) -> int: ccs = defaultdict(int) fi = -1 for ch in s: ccs[ch] += 1 for i, ch in enumerate(s): if ccs[ch] == 1: return i return -1
hckhilliam/programming
LeetCode/31DayChallengeMay/5firstUniqueChar.py
5firstUniqueChar.py
py
297
python
en
code
0
github-code
21
[ { "api_name": "collections.defaultdict", "line_number": 5, "usage_type": "call" } ]
71259883572
import asyncio import websockets def abc(): asyncio.wait([user.send(message) for user in USERS]) async def client_hello(): uri = "ws://localhost:8765" async with websockets.connect(uri) as websocket: name = input("What's your name? ") await websocket.send(name) print(f"> {name}...
binhgo/python101
websocket-client.py
websocket-client.py
py
533
python
en
code
0
github-code
21
[ { "api_name": "asyncio.wait", "line_number": 7, "usage_type": "call" }, { "api_name": "websockets.connect", "line_number": 12, "usage_type": "call" }, { "api_name": "asyncio.get_event_loop", "line_number": 24, "usage_type": "call" }, { "api_name": "asyncio.wait", ...
15570887852
# Import necessary modules from Keras from tensorflow.keras.models import Model from tensorflow.keras.layers import Input, Conv2D, MaxPooling2D, AveragePooling2D, Conv2DTranspose from tensorflow.keras.layers import Concatenate, BatchNormalization, Dropout, Cropping2D from tensorflow import keras from keras.layers impor...
cleveryangcong/Bachelor_Thesis
src/models/U_net/unet.py
unet.py
py
16,302
python
en
code
0
github-code
21
[ { "api_name": "xarray.set_options", "line_number": 17, "usage_type": "call" }, { "api_name": "warnings.simplefilter", "line_number": 21, "usage_type": "call" }, { "api_name": "tensorflow.keras.layers.Input", "line_number": 109, "usage_type": "call" }, { "api_name"...
72135558132
from flask import Blueprint, jsonify, request import json, logging, logging.config import random import liir_image_search.server.text2image.dress_demo.demo_code.txt2img.txt2img as txt2img with open("logging.json", "r") as logging_file: logging.config.dictConfig(json.load(logging_file)) logger = logging.getLogger(...
anirudhtomer/NLPImageSearch
liir_image_search/server/search_service.py
search_service.py
py
2,953
python
en
code
0
github-code
21
[ { "api_name": "logging.config.dictConfig", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.config", "line_number": 7, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.getLogge...
6557426758
import asyncio import time import base64 from collections import namedtuple from aiohttp import ClientResponseError from salvo.util import resolve import molotov from molotov.run import run from molotov import util, api @molotov.setup() async def init_worker(worker_num, args): headers = {} content_type = m...
tarekziade/salvo
salvo/scenario.py
scenario.py
py
4,172
python
en
code
211
github-code
21
[ { "api_name": "molotov.get_var", "line_number": 18, "usage_type": "call" }, { "api_name": "molotov.get_var", "line_number": 22, "usage_type": "call" }, { "api_name": "base64.b64encode", "line_number": 24, "usage_type": "call" }, { "api_name": "molotov.setup", ...
28756011620
import csv import plotly.express as px import numpy as np def showScatterChart(): with open('C:/Users/C/OneDrive/Desktop/Coding/python/Correlation/StudentMarksVsDaysPresent.csv') as f: data = csv.DictReader(f) scatterPlot = px.scatter(data, x="DaysPresent", y="Marks(%)", title="Marks VS. Day...
CaitlynP123/Correlation
correlation-Students.py
correlation-Students.py
py
1,120
python
en
code
0
github-code
21
[ { "api_name": "csv.DictReader", "line_number": 7, "usage_type": "call" }, { "api_name": "plotly.express.scatter", "line_number": 8, "usage_type": "call" }, { "api_name": "plotly.express", "line_number": 8, "usage_type": "name" }, { "api_name": "csv.DictReader", ...
12012171187
from rest_framework.viewsets import GenericViewSet,ViewSet,ModelViewSet from rest_framework.decorators import action from rest_framework.response import Response from rest_framework import status from django_filters.rest_framework import DjangoFilterBackend import requests from .models import User, University,Departmen...
PeaceInSpace/smart-gnu
smartGNU/smart_gnu/views.py
views.py
py
2,695
python
en
code
1
github-code
21
[ { "api_name": "rest_framework.viewsets.GenericViewSet", "line_number": 12, "usage_type": "name" }, { "api_name": "models.User.objects.all", "line_number": 13, "usage_type": "call" }, { "api_name": "models.User.objects", "line_number": 13, "usage_type": "attribute" }, ...
9840084872
from datetime import datetime class GuardRecord: def __init__(self, line): date_str = ' '.join(line.split()[0:2]) self.datetime = datetime.strptime(date_str, '[%Y-%m-%d %H:%M]') self.observation_str = ' '.join(line.split()[2:]) def __lt__(self, other): return self.datetime < ...
jeresch/advent-2018
solutions/sol4p1.py
sol4p1.py
py
1,627
python
en
code
0
github-code
21
[ { "api_name": "datetime.datetime.strptime", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 7, "usage_type": "name" } ]
5227563388
from typing import Dict, List import torch.nn as nn import torch.nn.functional as F def make_iac_model(config: Dict, agents_id: List[str]): models = {} for id in agents_id: critic_net = ICritic( input_space=config["local_state"][id], output_space=config["local_action"][id], ...
AmoyZhp/traffic_light_control
traffic_light_control/controler/model/iac.py
iac.py
py
1,686
python
en
code
0
github-code
21
[ { "api_name": "typing.Dict", "line_number": 7, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 7, "usage_type": "name" }, { "api_name": "torch.nn.Module", "line_number": 33, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_numbe...
72763454452
import os import html import hashlib import urllib import base64 from w3lib.html import replace_entities from django.utils import timezone from django.utils.timezone import make_aware, is_naive from django.core.cache import cache from .constants import MiscConstants class DecodeResult: def __init__(self, encoded, t...
Cvolton/GDHistory
history/utils.py
utils.py
py
9,036
python
en
code
17
github-code
21
[ { "api_name": "base64.b64encode", "line_number": 21, "usage_type": "call" }, { "api_name": "base64.b64decode", "line_number": 25, "usage_type": "call" }, { "api_name": "w3lib.html.replace_entities", "line_number": 60, "usage_type": "call" }, { "api_name": "os.gete...
2714952747
import glob import logging import os import re from typing import TYPE_CHECKING import numpy as np import pandas as pd from . import globalvar as gl from .pandas_meterdataclass_extensions import OutAccessor from .timer import Timer if TYPE_CHECKING: # Using for visual studio code type hint. class DataFrame(pd....
roy1648/AMI_data_analyze_estimate
mylib/module_InputDataV1.py
module_InputDataV1.py
py
10,856
python
en
code
0
github-code
21
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 14, "usage_type": "name" }, { "api_name": "pandas.DataFrame", "line_number": 16, "usage_type": "attribute" }, { "api_name": "pandas_meterdataclass_extensions.OutAccessor", "line_number": 17, "usage_type": "name" }, ...
71235015092
#!flask/bin/python from app import app from flask import Flask from flask import request from flask import render_template from flask import session from flask import redirect from flask import url_for from flask import escape import pickle from flask import jsonify from urlparse import urlparse, urljoin from flask.ext...
asclab/cbp-lims
app/view.py
view.py
py
4,420
python
en
code
0
github-code
21
[ { "api_name": "pickle.load", "line_number": 25, "usage_type": "call" }, { "api_name": "psycopg2.connect", "line_number": 26, "usage_type": "call" }, { "api_name": "flask.session", "line_number": 42, "usage_type": "name" }, { "api_name": "flask.request.args.get", ...
70685924853
import os from subprocess import call import json import sys import logging from lxml import etree def create(): if (len(sys.argv) == 3): num_serv = int(sys.argv[2]) else: num_serv = 2 if ((num_serv < 1) or (num_serv > 5)): raise Exception("formato incorrecto") call(["cat", ">>", "gestiona-pc1.json"]) ...
avillaseca01/CDPSPC1G31
gestiona-pc1.py
gestiona-pc1.py
py
17,615
python
en
code
0
github-code
21
[ { "api_name": "sys.argv", "line_number": 10, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 11, "usage_type": "attribute" }, { "api_name": "subprocess.call", "line_number": 19, "usage_type": "call" }, { "api_name": "json.dump", "line_num...
36614066435
import numpy as np import pandas as pd from sklearn.decomposition import PCA import matplotlib.pyplot as plt def dist_mat(myList): l = myList.shape[0] distance_matrix = np.zeros((int((l**2-l)/2), 3)) counter = 0 for x in range(0,(myList.shape[0])-1): for y in range((x+1),(myList.shape[0])): ...
muthupal007/Clustering-Algorithms
HAC/HAC_script.py
HAC_script.py
py
4,987
python
en
code
5
github-code
21
[ { "api_name": "numpy.zeros", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.linalg.norm", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.linalg", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pandas.DataFrame", ...
33808541788
"""dj_diplom URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-bas...
SaD-Pr0gEr/Online-store-api
shop/urls.py
urls.py
py
1,186
python
en
code
0
github-code
21
[ { "api_name": "django.urls.path", "line_number": 22, "usage_type": "call" }, { "api_name": "django.urls.include", "line_number": 22, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 23, "usage_type": "call" }, { "api_name": "django.urls.inc...
37517414166
# coding=utf-8 import os import sys import time import math import random import pandas as pd import numpy as np import qtawesome import qdarkstyle import traceback import xlsxwriter import matplotlib.pyplot as plt from scipy.signal import savgol_filter import copy from PyQt5.QtWidgets import * from PyQt5.QtGui import ...
ToLoveToFeel/petroleomicsSoftware
MainWinAll.py
MainWinAll.py
py
406,153
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_excel", "line_number": 26, "usage_type": "call" }, { "api_name": "pandas.read_excel", "line_number": 28, "usage_type": "call" }, { "api_name": "math.isnan", "line_number": 33, "usage_type": "call" }, { "api_name": "math.isnan", "line...
37298867984
import argparse import os import shutil def split_dir(abs_dirname, N): """Move files into subdirectories.""" files = [os.path.join(abs_dirname, f) for f in os.listdir(abs_dirname)] i = 0 for f in files: while(os.path.isfile(f)): # create new subdir if necessary ...
Ramc23/split-directory
split-directory.py
split-directory.py
py
2,619
python
en
code
0
github-code
21
[ { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_numbe...
22439181556
#!/usr/bin/env python import sqlite3 import os import time import glob import time import grovepi dbname='/var/www/templog.db' #Sensor connected to A0,A1,A2 Port sensor0 = 0 sensor1 = 1 sensor2 = 2 def log_temperature(temp): print (temp) conn=sqlite3.connect(dbname) curs=conn.cursor() curs...
madios/windMeter
src/cgi-bin/monitor.py
monitor.py
py
703
python
en
code
0
github-code
21
[ { "api_name": "sqlite3.connect", "line_number": 19, "usage_type": "call" }, { "api_name": "grovepi.analogRead", "line_number": 32, "usage_type": "call" } ]
28889201592
import pytest import tkinter as tk from src.campo_minado import CampoMinado @pytest.fixture def root(): return tk.Tk() def obter_combinacoes_dimensoes(): # Defina as combinações de linhas e colunas para diferentes níveis dimensoes = { 'facil': (8, 8), 'intermediario': (10, 16), ...
MatheusAndradeUchoa/Campo_minado
test/criar_Campo_test.py
criar_Campo_test.py
py
1,541
python
pt
code
0
github-code
21
[ { "api_name": "tkinter.Tk", "line_number": 9, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 7, "usage_type": "attribute" }, { "api_name": "src.campo_minado.CampoMinado", "line_number": 25, "usage_type": "call" }, { "api_name": "pytest.mark...
25392623920
import collections from contextlib import contextmanager import os import subprocess import time import numpy as np from matplotlib import pyplot as plt class Tools(): @staticmethod def normalize(value, mean, std): return (value - mean) / std @staticmethod def inv_trans(value, mean, std): ...
ryoma-k/GBVPP_Public
src/base/utils/tools.py
tools.py
py
3,361
python
en
code
8
github-code
21
[ { "api_name": "cv2.imread", "line_number": 29, "usage_type": "call" }, { "api_name": "{'cv2': 'cv2'}.resize", "line_number": 33, "usage_type": "call" }, { "api_name": "cv2.INTER_NEAREST", "line_number": 42, "usage_type": "attribute" }, { "api_name": "cv2.INTER_ARE...
43045092477
import numpy as np from attrs import define, asdict from tqdm import tqdm import pickle import os from os.path import exists import torch import torch.nn as nn import torch.optim as optim from instructRNN.models.full_models import make_default_model from instructRNN.trainers.base_trainer import BaseTrainer from instr...
ReidarRiveland/Instruct-RNN
instructRNN/trainers/decoder_trainer.py
decoder_trainer.py
py
11,642
python
en
code
1
github-code
21
[ { "api_name": "torch.device", "line_number": 18, "usage_type": "call" }, { "api_name": "attrs.define", "line_number": 20, "usage_type": "name" }, { "api_name": "instructRNN.trainers.base_trainer.BaseTrainer", "line_number": 41, "usage_type": "name" }, { "api_name"...
6873822041
#!/usr/bin/env python import rospy import math from pyproj import Proj from R3_functions import quat_rot, fit_in_rad, debug_info import tf import geometry_msgs.msg # ROS messages from std_msgs.msg import String, Float32, Int32 from geometry_msgs.msg import Point, Pose, Twist from nav_msgs.msg import Odometry from sen...
DTU-R3/DTU-R3-ROS
waypoint_nav/src/3d_waypoint_control.py
3d_waypoint_control.py
py
13,957
python
en
code
2
github-code
21
[ { "api_name": "pyproj.Proj", "line_number": 47, "usage_type": "call" }, { "api_name": "geometry_msgs.msg.Point", "line_number": 56, "usage_type": "call" }, { "api_name": "geometry_msgs.msg.Twist", "line_number": 57, "usage_type": "call" }, { "api_name": "sensor_ms...
29252948778
import cv2 import numpy as np import matplotlib.pyplot as plt import torch def show(img): plt.figure(figsize=(100,100)) plt.imshow(img, cmap="gray") plt.show() def ttoi(tensor): img = tensor.cpu().numpy() return img def visualization(images, num_images=20, num_rows=2): r = num_rows i = nu...
rrmina/AI502-GAN-Experiments
utils.py
utils.py
py
1,282
python
en
code
0
github-code
21
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 7, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.imshow", "line_number": 8, "usage_type": "call" }, { "api_name": "matp...
36338879437
from flask_app import app from flask import render_template, redirect, request, session, flash from flask_app.models.cars_model import Cars @app.route('/dashboard') def dashboard(): return render_template('logged_in.html', first_name=session['user_name'], user_id=session['id'], cars=Cars.get_cars_sell_names()) @a...
zachif/belt_exam
flask_app/controllers/cars_controller.py
cars_controller.py
py
2,322
python
en
code
0
github-code
21
[ { "api_name": "flask.render_template", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.session", "line_number": 7, "usage_type": "name" }, { "api_name": "flask_app.models.cars_model.Cars.get_cars_sell_names", "line_number": 7, "usage_type": "call" }, { ...
21221515304
import numpy as np import numexpr as ne from circle_square_symbolic_demo import contour_fnc def torus_fnc(x, y, z, r=1): r = 4 rx = 0.1 ry = 0.1 rz = 0.1 return (1 - (r - ((x / rx) ** 20 + (y / ry) ** 20)**0.05) ** 20 - (z / rz) ** 20) def torus_circle_ne(x, y, z, r=1): r = 2 rx = 0.4 ...
sohale/implisolid
python_implicit/experimentation/implicitShapes.py
implicitShapes.py
py
1,345
python
en
code
17
github-code
21
[ { "api_name": "numexpr.evaluate", "line_number": 19, "usage_type": "call" }, { "api_name": "numexpr.evaluate", "line_number": 20, "usage_type": "call" }, { "api_name": "numexpr.evaluate", "line_number": 22, "usage_type": "call" }, { "api_name": "numexpr.evaluate",...
34018283865
import argparse import collections import glob import json from scipy import stats parser = argparse.ArgumentParser( description='Load OpenReview data from a sqlite3 database.') parser.add_argument('-d', '--dataset_file', type=str, help='path to dataset file') ResultMap = collections.namedtu...
nnkennard/iclr-discourse-dataset
baselines/old/info_retrieval/agreement.py
agreement.py
py
1,793
python
en
code
4
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 14, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 18, "usage_type": "call" }, { "api_name": "json.load", ...
73654786932
from django.shortcuts import render from rest_framework import status from rest_framework.response import Response from rest_framework.permissions import AllowAny from rest_framework.views import APIView from django.db.models import Q from rest_framework_api_key.permissions import HasAPIKey from .utils import validate...
coodblooded/homeLane
homelane/query_service/views.py
views.py
py
3,654
python
en
code
0
github-code
21
[ { "api_name": "rest_framework.views.APIView", "line_number": 16, "usage_type": "name" }, { "api_name": "rest_framework_api_key.permissions.HasAPIKey", "line_number": 17, "usage_type": "name" }, { "api_name": "utils.validate_payload", "line_number": 20, "usage_type": "call...
9757243715
import torch import cv2 import numpy as np import zmq import urllib import os import pickle import time import datetime # Model # class # 객체 정보 송신을 위한 pub 선언 info_context = zmq.Context() info_socket = info_context.socket(zmq.PUB) # Drone의 info_socket과 동일한 docker의 ip info_socket.bind("tcp://172.17.0.2:5555") #ZMQ SU...
stmoon/abcdrone
yolotest.py
yolotest.py
py
2,431
python
en
code
0
github-code
21
[ { "api_name": "zmq.Context", "line_number": 14, "usage_type": "call" }, { "api_name": "zmq.PUB", "line_number": 15, "usage_type": "attribute" }, { "api_name": "zmq.Context", "line_number": 20, "usage_type": "call" }, { "api_name": "zmq.SUB", "line_number": 21,...
8826140476
# -*- coding: utf-8 -*- """ Created on Wed Apr 13 13:20:09 2016 @author: gs13g11 """ import numpy as np import matplotlib.pyplot as plt from numpy.linalg import inv from numpy.matlib import rand,zeros,ones,empty,eye f=np.logspace(1,4,500) w=f*2*np.pi m1=10 m2=10 k1=1e8 k2=1e1 c1=1e2 c2=1e2 ...
GSquiccia/Ipython-group
2dof_Array_V2.py
2dof_Array_V2.py
py
1,308
python
en
code
0
github-code
21
[ { "api_name": "numpy.logspace", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 15, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.array", "line_numb...
22926015065
# encoding: utf-8 # # # 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 http:# mozilla.org/MPL/2.0/. # # Contact: Kyle Lahnakoski (kyle@lahnakoski.com) # """ # NOTE: THE self.lang[operator] PATTERN ...
mozilla/jx-sqlite
vendor/jx_base/expressions/base_multi_op.py
base_multi_op.py
py
4,392
python
en
code
35
github-code
21
[ { "api_name": "jx_base.expressions.expression.Expression", "line_number": 36, "usage_type": "name" }, { "api_name": "mo_json.NUMBER", "line_number": 38, "usage_type": "name" }, { "api_name": "jx_base.expressions.expression.Expression.__init__", "line_number": 42, "usage_t...
38066930142
import pathlib import numpy as np from .defs import Tiles from .map import Map from z3 import Bool, And, Or, Solver, Not def is_rock(m, x, y): return np.asscalar(m.dat[y][x] == Tiles.LAND_ROCK) def make_cell(top_inputs, left_inputs): v1 = And(left_inputs[0], left_inputs[3]) v2 = And(left_inputs[1], le...
nguyenguyen753/WriteUp-CTF
CSaw Qual 2021/turning_trees/solve.py
solve.py
py
6,023
python
en
code
3
github-code
21
[ { "api_name": "numpy.asscalar", "line_number": 11, "usage_type": "call" }, { "api_name": "defs.Tiles.LAND_ROCK", "line_number": 11, "usage_type": "attribute" }, { "api_name": "defs.Tiles", "line_number": 11, "usage_type": "name" }, { "api_name": "z3.And", "lin...
42528693262
import math, random, argparse, time, sys import numpy as np from numba import jit import warnings warnings.filterwarnings("ignore") from data_stream import stream T_oja = 100 #### Hyperparameters ##################################################### clip = False loop = 5 testwindow = 500 k = 3 B_list = np.unique(...
MinchanJeong/Robust-Streaming-PCA
real_data/main.py
main.py
py
4,793
python
en
code
1
github-code
21
[ { "api_name": "warnings.filterwarnings", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.power", "...
33899035993
from typing import Any, Dict, List, Type, TypeVar import attr from ..models.regulated_information_field_field_type import RegulatedInformationFieldFieldType T = TypeVar("T", bound="RegulatedInformationField") @attr.s(auto_attribs=True) class RegulatedInformationField: r"""A field collected from the regulatory ...
milyord/sp-api
sp/orders_v0/models/regulated_information_field.py
regulated_information_field.py
py
2,507
python
en
code
1
github-code
21
[ { "api_name": "typing.TypeVar", "line_number": 7, "usage_type": "call" }, { "api_name": "models.regulated_information_field_field_type.RegulatedInformationFieldFieldType", "line_number": 24, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 26, "usage_ty...
6810945897
import threading import socket import sys import json import time class Client: def __init__(self): self.socket_cliente = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.host = "localhost" self.port = 1234 try: self.socket_cliente.connect((self.host, self.port))...
mesantamaria/Advanced-programming-Homeworks
Actividades/AC14/client.py
client.py
py
2,663
python
es
code
0
github-code
21
[ { "api_name": "socket.socket", "line_number": 10, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 10, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREAM", "line_number": 10, "usage_type": "attribute" }, { "api_name": "threading.T...
71099265332
"""data fpr status Revision ID: 271e06a87763 Revises: db48589a8915 Create Date: 2022-05-03 11:14:07.543520 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql # revision identifiers, used by Alembic. revision = '271e06a87763' down_revision = 'db48589a8915' branch_labels = No...
vrcompugo/EV-Manager-Data-API
migrations/versions/271e06a87763_data_fpr_status.py
271e06a87763_data_fpr_status.py
py
737
python
en
code
0
github-code
21
[ { "api_name": "alembic.op.add_column", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 21, "usage_type": "call" }, { "api_name": "sqlalchemy.dialect...
15024298773
# Note to self, need to at least finish the part that gathers all of the data into all 3 dataframes from state_abbrevs import states from bs4 import BeautifulSoup from datetime import datetime from api_key import key import pandas as pd import requests import json import os # +++++++++++++++++++++++++++++++ # Retri...
bhyman67/City-Energy-Usage
Get Nrg City Usage Data.py
Get Nrg City Usage Data.py
py
4,886
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 19, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 22, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 87, "usage_type": "call" }, { "api_name": "pandas.DataFrame", ...
27209328962
import psycopg2 #for some reason this is not working - potentially because the postgreSQL implementation has a different path which is # "/Applications/Postgres.app/Contents/Versions/9.6/bin/psql" -p5432 -d "snippets" import logging import argparse # Set the log output file, and the log level logging.basicConfig(filen...
sbonning/snippets-app
snippets.py
snippets.py
py
5,087
python
en
code
0
github-code
21
[ { "api_name": "logging.basicConfig", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 8, "usage_type": "attribute" }, { "api_name": "logging.debug", "line_number": 9, "usage_type": "call" }, { "api_name": "psycopg2.connect", ...
31404695830
#!/usr/bin/env python3 import collections import math import random from urllib import parse import pathlib BASE_URL = 'https://upload.wikimedia.org/wikipedia/commons/' LOCAL_PATH = 'img/' DEFAULT_TARGET_SIZE = 4_000_000 TOLERANCE = .05 def file_name(url): url_parts = parse.urlsplit(url) path = pathlib.Pu...
ramalho/chipy2019
spinners/python/io-bound/images.py
images.py
py
1,321
python
en
code
9
github-code
21
[ { "api_name": "urllib.parse.urlsplit", "line_number": 18, "usage_type": "call" }, { "api_name": "urllib.parse", "line_number": 18, "usage_type": "name" }, { "api_name": "pathlib.PurePath", "line_number": 19, "usage_type": "call" }, { "api_name": "random.choice", ...
19771919947
"""Test a uniform permutation algorithm against a non-uniform one.""" import typing as t import matplotlib.pyplot as plt import numpy as np def uniform_permutation(num_elements: int, random_state: t.Optional[int] = None) -> np.ndarray: r"""Uniformly distributed permutation algorithm. ...
FelSiq/statistics-related
comp_stat_little_tricks/perm_prob_testing.py
perm_prob_testing.py
py
2,916
python
en
code
1
github-code
21
[ { "api_name": "typing.Optional", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.random.seed", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 17, "usage_type": "attribute" }, { "api_name": "numpy.arange"...
41187292577
# coding: utf-8 from django.contrib import messages from django.contrib.auth.decorators import login_required from django.core.mail import mail_managers from django.core.urlresolvers import reverse from django.shortcuts import redirect from django.utils.decorators import method_decorator from django.utils.translation ...
nonZero/hackforisrael
src/student_applications/views.py
views.py
py
6,770
python
en
code
4
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 25, "usage_type": "call" }, { "api_name": "h4il.base_views.ProtectedMixin", "line_number": 28, "usage_type": "name" }, { "api_name": "student_applications.consts.get_user_progress", "line_number": 32, "usage_type": "call" ...
33326507236
"""FunGAPsite URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.2/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-ba...
takimailto/FunGAPsite-webapp
FunGAPsite/urls.py
urls.py
py
1,248
python
en
code
0
github-code
21
[ { "api_name": "django.conf.urls.url", "line_number": 21, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 21, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 21, "usage_type": "name" }, { "api_name...
10352909332
#!/usr/bin/env python # -*- coding:utf-8 -*- """ @author: peter.s @project: GeoMAN @time: 2019/11/7 21:09 @desc: """ from models.GeoMAN import GeoMAN from trainer import Trainer from preprocess.data_loader import PEMS4DataLoader from preprocess.data_provider import DataProvider if __name__ == '__main__': max_epo...
Maple728/GeoMAN
main.py
main.py
py
1,120
python
en
code
0
github-code
21
[ { "api_name": "preprocess.data_loader.PEMS4DataLoader", "line_number": 27, "usage_type": "call" }, { "api_name": "preprocess.data_provider.DataProvider", "line_number": 30, "usage_type": "call" }, { "api_name": "preprocess.data_provider.DataProvider", "line_number": 31, "...
1948464325
#!/usr/bin/env python3 import sys import time from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from guitarseq import * import notes def fix_ctrlc(app): app.event = lambda e: QApplication.event(app, e) app.startTimer(100) import signal signal.signal(signal.SIGINT,lambda *args:a...
amstan/guitar
guitarseq/QGuitarSeq.py
QGuitarSeq.py
py
16,016
python
en
code
7
github-code
21
[ { "api_name": "signal.signal", "line_number": 18, "usage_type": "call" }, { "api_name": "signal.SIGINT", "line_number": 18, "usage_type": "attribute" }, { "api_name": "time.sleep", "line_number": 55, "usage_type": "call" }, { "api_name": "time.sleep", "line_nu...
25743878836
# 03 # Hard # Given an arithmetic expression with *, /, - & + operators and single digit numbers, # evaluate it and return the result. # For example, 1 + 2 / 1 + 3 * 2 ==> 9 # ----------------------------------------------------- # Time Complexity: O(n) # Space Complexity: O(n) because we store a copy of the ope...
dannynoonan/interview-prep
ic/08_stacks/03_stack_math.py
03_stack_math.py
py
1,987
python
en
code
0
github-code
21
[ { "api_name": "pytest.main", "line_number": 63, "usage_type": "call" } ]
42582856415
import os import sys import torch import pathlib torch.set_default_dtype(torch.float64) # Set right path for local imports and dataset finding try: exec_path = pathlib.Path(os.path.dirname(os.path.realpath(__file__))) code_path = exec_path.parent.parent except NameError: exec_path = pathlib.Path(os.getcwd...
allambert/foreg
demos/synth.py
synth.py
py
4,157
python
en
code
4
github-code
21
[ { "api_name": "torch.set_default_dtype", "line_number": 6, "usage_type": "call" }, { "api_name": "torch.float64", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.dirname...
44499171975
# !/usr/bin/env python3 # -*- encoding: utf-8 -*- # @author: condi # @file: unetImp_comment.py # @time: 19-1-27 下午3:01 import os import shutil import cv2 import numpy as np from numpy import set_printoptions import mxnet as mx from collections import namedtuple from Services.utils import get_coord set_printoptions(t...
condilin/QAS
Services/Unet/unetImp_comment.py
unetImp_comment.py
py
9,829
python
zh
code
0
github-code
21
[ { "api_name": "numpy.set_printoptions", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.nan", "line_number": 17, "usage_type": "attribute" }, { "api_name": "mxnet.gpu", "line_number": 19, "usage_type": "call" }, { "api_name": "mxnet.model.load_chec...
149752693
# Assumption: The server does not go offline import pika import json MAXSERVERS = 12 SERVERS = {} connection = pika.BlockingConnection( pika.ConnectionParameters(host="localhost")) channel = connection.channel() channel.queue_declare(queue="registry") def StringifyMessage(message): return json.dumps(messag...
meetakshi253/DSCD-Winter-2023
28_a1/rabbitmq/registry_server.py
registry_server.py
py
1,881
python
en
code
0
github-code
21
[ { "api_name": "pika.BlockingConnection", "line_number": 9, "usage_type": "call" }, { "api_name": "pika.ConnectionParameters", "line_number": 10, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 16, "usage_type": "call" }, { "api_name": "json.load...
43388694422
# - * - coding: utf-8 - * - from scrapy.spiders import CrawlSpider from scrapy.http import Request from scrapy.selector import Selector from BookSpider.items import BookspiderItem import re,sys reload(sys) sys.setdefaultencoding('utf8') class DouBan(CrawlSpider): name = 'Book' start_urls = ['https://book.doub...
iMissWonder/DoubanBookSpider
BookSpider/spiders/bookspider.py
bookspider.py
py
5,091
python
en
code
0
github-code
21
[ { "api_name": "sys.setdefaultencoding", "line_number": 9, "usage_type": "call" }, { "api_name": "scrapy.spiders.CrawlSpider", "line_number": 11, "usage_type": "name" }, { "api_name": "scrapy.selector.Selector", "line_number": 18, "usage_type": "call" }, { "api_nam...
72669432692
import streamlit as st import torch from pandas import options from transformers import BartForConditionalGeneration, BartTokenizer # initialize model + tok variables model = None tok = None # Examples for each models context_example = '' context_length = '' examples = [ "Well, I was born in South Af...
haramkoo/InterviewAI
interview-streamlit/app.py
app.py
py
7,108
python
en
code
1
github-code
21
[ { "api_name": "transformers.BartForConditionalGeneration.from_pretrained", "line_number": 26, "usage_type": "call" }, { "api_name": "transformers.BartForConditionalGeneration", "line_number": 26, "usage_type": "name" }, { "api_name": "transformers.BartTokenizer.from_pretrained", ...
39799373624
# from collections import deque # def solution(numbers, target): # answer = 0 # dq = deque([[0, 0]]) # while dq: # tmp_sum, idx = dq.pop() # if idx == len(numbers): # if tmp_sum == target: # answer += 1 # continue # dq.append([tmp_sum + numbers...
cheol-95/Algorithm
re-start/038. 타겟 넘버.py
038. 타겟 넘버.py
py
676
python
en
code
0
github-code
21
[ { "api_name": "itertools.product", "line_number": 18, "usage_type": "call" } ]
17588000406
import os import sys import math from PIL import Image import statistics def pngs_2_emoji(png_list): assert png_list img_width = png_list[0].size[0] img_height = png_list[0].size[1] for png in png_list: assert img_width == png.size[0] assert img_height == png.size[1] best_usag...
etorth/mir2x
tools/png2emoji/src/png2emoji.py
png2emoji.py
py
9,358
python
zh
code
288
github-code
21
[ { "api_name": "PIL.Image.new", "line_number": 30, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 30, "usage_type": "name" }, { "api_name": "os.path.isdir", "line_number": 48, "usage_type": "call" }, { "api_name": "os.path", "line_number": 48...
20951355827
import os import asyncio import aiohttp import aiofiles from bs4 import BeautifulSoup import re from utils.get_results_from_GPT import gpt_completion # Function to replace multiple newlines with double newlines def replace_newlines(text): return '\n\n'.join(paragraph.strip() for paragraph in text.split('\n\n') if ...
faisal-saddique/intelli_scrape
scraper_async.py
scraper_async.py
py
3,140
python
en
code
0
github-code
21
[ { "api_name": "utils.get_results_from_GPT.gpt_completion", "line_number": 44, "usage_type": "call" }, { "api_name": "aiohttp.ClientSession", "line_number": 48, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 56, "usage_type": "call" }, { ...
2770030502
from typing import Any, Optional from authentication.models import User from django.core.management.base import BaseCommand class Command(BaseCommand): def handle(self, *args: Any, **options: Any) -> Optional[str]: for user in User.objects.all(): self.stdout.write(f'Delete {user}...'...
pykulytsky/freelance-service
src/authentication/management/commands/truncateusers.py
truncateusers.py
py
448
python
en
code
0
github-code
21
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 7, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 8, "usage_type": "name" }, { "api_name": "authentication.models.User.objects.all", "line_number": 9, "usage_type": "call" }, {...
23130812742
# -*- coding: utf-8 -*- from spacy.lang.en import English from medspacy_io.reader import EhostDocReader from medspacy_io.reader import EhostDirReader from spacy.lang.en import English from spacy.tokens import Doc import pandas as pd from typing import List def eHost_dir_reader(proj_schema:str,corpus_dir:str) -> List...
medspacy/medspacy_annotations
IAA/eHost_annot2dataframe.py
eHost_annot2dataframe.py
py
1,527
python
en
code
2
github-code
21
[ { "api_name": "medspacy_io.reader.EhostDirReader", "line_number": 13, "usage_type": "call" }, { "api_name": "spacy.lang.en.English", "line_number": 13, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 12, "usage_type": "name" }, { "api_name": "s...
12084962500
from sklearn import svm import pandas as pd import numpy as np import IPython from sklearn.externals import joblib import sklearn.metrics as stats import winsound df= pd.read_csv(r"C:\Users\John\jhm4.github.io\DIS2.csv", parse_dates=['Date'], infer_datetime_format=True) adjPrice = df[' Adj Close'] Volume = df[' Vol...
jhm4/jhm4.github.io
LearnML_dis.py
LearnML_dis.py
py
4,149
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.Series", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.Series", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.array", "line_n...
25704620886
import os, sys BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "src.settings") sys.path.append(os.path.abspath(os.path.join(BASE_DIR, os.pardir))) from django.core.wsgi import get_wsgi_application application = get_wsgi_application() from Food.mod...
gargpushkar/AppyHighProject
Django2/Project1/script.py
script.py
py
9,481
python
en
code
1
github-code
21
[ { "api_name": "os.path.dirname", "line_number": 2, "usage_type": "call" }, { "api_name": "os.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 2, "usage_type": "call" }, { "api_name": "os.environ.setdefault", ...
18404845899
import itertools; import math; import operator; import random; import string; from bisect import *; from collections import deque, defaultdict, Counter, OrderedDict; from functools import lru_cache, cache; from heapq import *; import unittest; from typing import List; def get_sol(): return Solution() class Solution: ...
afzalsiddique/problem-solving
Problem_Solving_Python/leetcode/lc1888.py
lc1888.py
py
2,002
python
en
code
1
github-code
21
[ { "api_name": "collections.deque", "line_number": 19, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 36, "usage_type": "attribute" } ]
20393613918
#!/usr/bin/python3 from db_computations import ComputationsDbSession from db_personal import FittingSession import recommend from flask import abort from flask import Blueprint from flask import flash from flask import jsonify from flask import make_response from flask import request from PIL import ExifTags from PI...
sfedia/size-adviser-server
subservices/mobile_requests.py
mobile_requests.py
py
11,978
python
en
code
0
github-code
21
[ { "api_name": "flask.Blueprint", "line_number": 30, "usage_type": "call" }, { "api_name": "db_computations.ComputationsDbSession", "line_number": 40, "usage_type": "call" }, { "api_name": "flask.request.args.get", "line_number": 50, "usage_type": "call" }, { "api_...
23318539865
from django.contrib import admin from .models import User, UserDraft from django.contrib.auth.forms import UserChangeForm from django.contrib.auth.admin import UserAdmin from imagekit.admin import AdminThumbnail @admin.register(User) class UserAdmin(UserAdmin): form = UserChangeForm admin_thumbnail = AdminThu...
ri-gilfanov/pharmacosphere-site
CMS/users/admin.py
admin.py
py
3,349
python
en
code
0
github-code
21
[ { "api_name": "django.contrib.auth.forms.UserChangeForm", "line_number": 10, "usage_type": "name" }, { "api_name": "imagekit.admin.AdminThumbnail", "line_number": 11, "usage_type": "call" }, { "api_name": "django.contrib.admin.register", "line_number": 8, "usage_type": "c...
34953631836
from django.urls import re_path from . import consumers websocket_urlpatterns = [ re_path( r"ws/workflows/(?P<wid>\w+)/$", consumers.WorkflowConsumer.as_asgi(), name="workflow_status_websocket", ), ] app_name = "main"
snakemake/snakeface
snakeface/apps/main/routing.py
routing.py
py
253
python
en
code
14
github-code
21
[ { "api_name": "django.urls.re_path", "line_number": 6, "usage_type": "call" } ]
1552170662
""" This module takes indexed posts and DON'T CALL THIS MODULE PRE_FILTER!!! """ from __future__ import division import json import math import sys from collections import defaultdict from operator import itemgetter from mrjob.job import MRJob text_term_counts = {} code_term_counts = {} with open('/home/jason/K...
rottentomato56/kaggle-fb-stackoverflow
Run3/class_index_prefilter.py
class_index_prefilter.py
py
5,476
python
en
code
0
github-code
21
[ { "api_name": "mrjob.job.MRJob", "line_number": 35, "usage_type": "name" }, { "api_name": "collections.defaultdict", "line_number": 84, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 85, "usage_type": "call" }, { "api_name": "json....
36658002292
from aiohttp import web from views import setup_routes import aiohttp_jinja2 import jinja2 from chemist_spyder import start_spyder, close_spyder from orm import create_pool, close_pool from models import check_user from config_default import config import aioredis async def setup_redis(app, **kwargs): ...
qinghuawu/ozprice
www/app.py
app.py
py
1,121
python
en
code
0
github-code
21
[ { "api_name": "aioredis.create_redis_pool", "line_number": 13, "usage_type": "call" }, { "api_name": "aiohttp.web.Application", "line_number": 22, "usage_type": "call" }, { "api_name": "aiohttp.web", "line_number": 22, "usage_type": "name" }, { "api_name": "config...
25110303137
from collections import defaultdict class Game: def __init__(self, init=[]): (data, index, last_number) = self._convert(init) self.data = data self.index = index self.last_number = last_number def next(self): num = None if len(self.data[self.last_number]) == 1:...
thomas9911/aoc2020
day15/main.py
main.py
py
1,209
python
en
code
0
github-code
21
[ { "api_name": "collections.defaultdict", "line_number": 31, "usage_type": "call" } ]
73034088694
import pandas as pd from time import sleep import tushare as ts from datetime import datetime, timedelta import numpy as np ts.set_token('c721c267a710ecdcb3f8da94e4a3c3ed145ae5c0e4cf6a5c983e470b') pro = ts.pro_api() def datetime_range(start: str, end: str): """ :param start: str :param end: str :retur...
ChaunceyDong/seek-max-vol-stock
tushare_data.py
tushare_data.py
py
3,637
python
en
code
0
github-code
21
[ { "api_name": "tushare.set_token", "line_number": 6, "usage_type": "call" }, { "api_name": "tushare.pro_api", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.d...
31933108671
from selenium import webdriver from time import sleep driver = webdriver.Chrome('C:\\Users\\d33ps3curity\\Downloads\\chromedriver_win32\\chromedriver.exe') driver.get('https://www.instagram.com/') sleep(5) login_button = driver.find_element_by_link_text('Sign up') login_button.click() sleep(5) driver.close()
Ajay-2007/WebScraping
Web Scraping with Beautiful Soup/7.Using Selenium to Handle AJAX JavaScript Driven Web Pages/clicking_elements.py
clicking_elements.py
py
319
python
en
code
0
github-code
21
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 6, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 6, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 9, "usage_type": "call" }, { "api_name": "time.sleep", ...
855156691
import matplotlib.pyplot as plt import numpy as np lines = map(lambda l: l.split(), open("timeout/part-r-00000").readlines()) dates, counts = [], [] for l in lines: dates.append(l[0]) counts.append(int(l[1])) fig = plt.figure() plt.title("Time series bar chart showing tweets/day") plt.xlabel("Dates") plt.ylab...
fayimora/ecs739p-cw1
src/time_analysis.py
time_analysis.py
py
486
python
en
code
0
github-code
21
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 10, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.title", "line_number": 11, "usage_type": "call" }, { "api_name": "ma...
37218313157
import re from sapgui import SAPGuiApplication from sapguielements import SAPGuiElements, SAVE_BUTTON, MESSAGE_ELEMENT from transaction import SAPTransaction import sys import traceback ELEMENTO_CODIGO_TRANSPORTADOR = "wnd[0]/usr/tabsHEADER_TABSTRIP1/tabpTABS_OV_PR/ssubG_HEADER_SUBSCREEN1:SAPMV56A:1021" \ ...
kslima/bootTransp
vt.py
vt.py
py
15,986
python
pt
code
0
github-code
21
[ { "api_name": "sapguielements.SAPGuiElements.enter", "line_number": 76, "usage_type": "call" }, { "api_name": "sapguielements.SAPGuiElements", "line_number": 76, "usage_type": "name" }, { "api_name": "sapguielements.SAPGuiElements.verificar_mensagem_barra_inferior", "line_num...
17453072781
import json from pathlib import Path from flask import (Blueprint, flash, g, request, render_template, abort, Markup, redirect, url_for, jsonify, current_app) from flask_sqlalchemy import SQLAlchemy from sqlalchemy import func from .models import ArticleEval, db ARTICLE_DIR = "data/articles" VALID...
LukasRub/stocks-tldr-eval
flask_eval/task_one.py
task_one.py
py
3,889
python
en
code
0
github-code
21
[ { "api_name": "flask.Blueprint", "line_number": 17, "usage_type": "call" }, { "api_name": "flask.current_app", "line_number": 18, "usage_type": "name" }, { "api_name": "json.load", "line_number": 29, "usage_type": "call" }, { "api_name": "models.ArticleEval.query....
31142383258
""" Tests for the api server. """ import time import multiprocessing import uuid import requests import pytest import uvicorn from api import __main__ URL = "http://localhost:5000" TIMEOUT = 5 def run_server(): """Run the FastAPI app using Uvicorn.""" __main__.TIMEOUT = TIMEOUT uvicorn.run(__main__.ap...
DArtagan/job-api
tests/test_api.py
test_api.py
py
6,555
python
en
code
0
github-code
21
[ { "api_name": "api.__main__.TIMEOUT", "line_number": 21, "usage_type": "attribute" }, { "api_name": "api.__main__", "line_number": 21, "usage_type": "name" }, { "api_name": "uvicorn.run", "line_number": 22, "usage_type": "call" }, { "api_name": "api.__main__.app",...