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
36580274522
from matplotlib.colors import ListedColormap from sklearn.metrics import accuracy_score import matplotlib.pyplot as plt import numpy as np def plot_decision_regions(X, y, classifier, test_idx = None, resolution = 0.02): labels = np.unique(y) markers = ('s', 'x', 'o', '^', 'v') colors = ('red', 'blue', 'lig...
zackcd/Machine-Learning-Projects
utilities.py
utilities.py
py
1,584
python
en
code
0
github-code
1
[ { "api_name": "numpy.unique", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.colors.ListedColormap", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.meshgrid", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.ara...
26950031561
import os import json import mikochiku_alarm from PyQt5.QtWidgets import QWidget, QMainWindow from PyQt5.QtWidgets import QComboBox, QLabel, QFrame, QLineEdit, QPushButton, QCheckBox from PyQt5.QtGui import QFont from PyQt5.QtCore import Qt import settings class ConfigTab(QMainWindow): def __init__(self, pare...
pusaitou/mikochiku_alarm
config_tab.py
config_tab.py
py
4,043
python
en
code
17
github-code
1
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 10, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QComboBox", "line_number": 34, "usage_type": "call" }, { "api_name": "json.load", "line_number": 42, "usage_type": "call" }, { "api_name": "json....
11483892621
from sklearn.neighbors import KNeighborsClassifier from sklearn.model_selection import train_test_split import pandas as pd import matplotlib.pyplot as plt import numpy as np df = pd.read_csv('/home/filip/Desktop/MachineLearning/dataset.csv') #df.drop('date',axis=1) y = df['deaths'] X = df[['cases','date']] benchmark ...
filipboucek/MachineLearning-filip_boucek
MachineLearning-filip_boucek/machineLeanrning.py
machineLeanrning.py
py
1,287
python
en
code
0
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "sklearn.neighbors.KNeighborsClassifier", "line_number": 12, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 25, "usage_type": "call" ...
74843330274
from django.http import HttpResponse from django.shortcuts import render, redirect from myapp.models import * from django.contrib import messages def show_about_page(request): print("requesting show about page") name="Channel name is Learn Code with Durgesh" link="https://www.youtube.com/watch?v=697_0UGxD...
AbdulQadir8/Imagebazzar.github.io
imagebazar/views.py
views.py
py
1,487
python
en
code
0
github-code
1
[ { "api_name": "django.shortcuts.render", "line_number": 14, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 20, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 28, "usage_type": "call" }, { "api_name"...
30815615363
from flask import abort from sqlalchemy.exc import SQLAlchemyError from app_client.app_client.models import Client, db from app_client.app_client.handle_excep import valid_none def list_client(): try: cliente_list = Client.query.all() except SQLAlchemyError as error: abort(500, str(error.__d...
dilermando-lima/api-python-flask
app_client/app_client/cliente_views.py
cliente_views.py
py
1,940
python
en
code
0
github-code
1
[ { "api_name": "app_client.app_client.models.Client.query.all", "line_number": 9, "usage_type": "call" }, { "api_name": "app_client.app_client.models.Client.query", "line_number": 9, "usage_type": "attribute" }, { "api_name": "app_client.app_client.models.Client", "line_number...
40089766883
from rest_framework import serializers from s2016.models import Doctor, LANGUAGE_CHOICES, STYLE_CHOICES class DoctorSerializer(serializers.Serializer): pk = serializers.IntegerField(read_only=True) name = serializers.CharField(max_length=100) education = serializers.CharField(max_length=100) specialty = serial...
ksj1993/s2016
s2016/serializers.py
serializers.py
py
995
python
en
code
0
github-code
1
[ { "api_name": "rest_framework.serializers.Serializer", "line_number": 4, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 4, "usage_type": "name" }, { "api_name": "rest_framework.serializers.IntegerField", "line_number": 5, "usage_ty...
24893230486
# -*- coding: utf-8 -*- import scrapy from scrapy import Request from lxml import etree from WaiBaoSpider.utils.csvWriter import CSVDumper from WaiBaoSpider.utils.base import unicode_body, deal_ntr import os class ChuzhouSpider(scrapy.Spider): name = 'chuzhou' base_url = "http://www.chuzhou.gov.cn/content/col...
jamesfyp/WaiBaoSpider
WaiBaoSpider/spiders/chuzhou.py
chuzhou.py
py
3,885
python
en
code
1
github-code
1
[ { "api_name": "scrapy.Spider", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_numbe...
41489742414
# -*- coding:utf-8 -*- # Author: hankcs # Date: 2020-11-26 16:07 import glob import json import re from urllib.error import HTTPError import os from hanlp_common.io import load_json from elit.datasets.srl.ontonotes4 import ONTONOTES4_TASKS_HOME, ONTONOTES4_HOME from elit.datasets.srl.ontonotes5._utils import convert_...
emorynlp/seq2seq-corenlp
elit/datasets/srl/ontonotes4/chinese.py
chinese.py
py
7,307
python
en
code
13
github-code
1
[ { "api_name": "elit.datasets.srl.ontonotes4.ONTONOTES4_HOME", "line_number": 18, "usage_type": "name" }, { "api_name": "elit.datasets.srl.ontonotes4.ONTONOTES4_TASKS_HOME", "line_number": 19, "usage_type": "name" }, { "api_name": "re.compile", "line_number": 29, "usage_ty...
24154787834
revision = '044' down_revision = '043' from alembic import op import sqlalchemy as sa from sqlalchemy.sql.expression import table MYSQL_ENGINE = 'InnoDB' MYSQL_CHARSET = 'utf8' def upgrade(active_plugins=None, options=None): op.create_table( 'story_types', sa.Column('id', sa.Integer(), nullable=...
pombredanne/storyboard
storyboard/db/migration/alembic_migrations/versions/044_story_types.py
044_story_types.py
py
1,855
python
en
code
null
github-code
1
[ { "api_name": "alembic.op.create_table", "line_number": 13, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 13, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 15, "usage_type": "call" }, { "api_name": "sqlalchemy.Integ...
2736703863
''' https://www.codewars.com/kata/520b9d2ad5c005041100000f/python ''' from curses.ascii import isalpha def pig_it1(text:str): content = [] txt_lst = text.split() for txt in txt_lst: if not isalpha(txt[0]): content.append(txt) continue first_letter = txt[0] ...
SzybkiRabarbar/CodeWars
2022-03/2022-03-29Simple Pig Latin.py
2022-03-29Simple Pig Latin.py
py
625
python
en
code
0
github-code
1
[ { "api_name": "curses.ascii.isalpha", "line_number": 11, "usage_type": "call" }, { "api_name": "curses.ascii.isalpha", "line_number": 22, "usage_type": "call" } ]
3156473153
#%% import re import pandas as pd import nltk import numpy as np from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.metrics.pairwise import cosine_similarity import plotly.express as px from termcolor import colored from DataUtility impor...
porterbmoody/Wilford-Woodruff-Papers
deprecated/scripts/WoodruffPapers.py
WoodruffPapers.py
py
8,270
python
en
code
0
github-code
1
[ { "api_name": "pandas.set_option", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.options", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pandas.options", "line_number": 16, "usage_type": "attribute" }, { "api_name": "nltk.downlo...
28676451867
from fastai.vision.all import * from fastai.vision.all import cnn_learner #imports relevant libraries to create a CNN model from fastaudio.core.all import * from fastaudio.augment.all import * from fastaudio.ci import skip_if_ci #imports relevant libraries to prepare audio data from pandas.api.types impo...
kmcshane811/AutoML
autoMl/source(Commented code)/train_cnn.py
train_cnn.py
py
2,983
python
en
code
1
github-code
1
[ { "api_name": "json.dump", "line_number": 16, "usage_type": "call" }, { "api_name": "fastaudio.ci.skip_if_ci", "line_number": 18, "usage_type": "name" }, { "api_name": "json.load", "line_number": 39, "usage_type": "call" }, { "api_name": "os.listdir", "line_nu...
11336816782
# -*- coding: utf-8 -*- """Test s3 class.""" import pytest from unittest.mock import Mock, patch from s3_client import s3_client from conftest import BUCKET_NAME def test_download_object(s3, s3_bucket, tmpdir): """Test object download.""" s3_client.log = Mock() obj_name = "my_object" obj_body = "Te...
thobiast/s3_client
tests/test_s3_class_download_object.py
test_s3_class_download_object.py
py
1,302
python
en
code
3
github-code
1
[ { "api_name": "s3_client.s3_client.log", "line_number": 14, "usage_type": "attribute" }, { "api_name": "s3_client.s3_client", "line_number": 14, "usage_type": "name" }, { "api_name": "unittest.mock.Mock", "line_number": 14, "usage_type": "call" }, { "api_name": "c...
71238790753
import numpy as np import pandas as pd import os import matplotlib.pyplot as plt import pandas as pd from scipy.stats import hmean from productiecapaciteit.src.capaciteit_strang import strangWeerstand import numpy as np from scipy.optimize import least_squares from scipy import linalg from dawacotools import get_daw_ts...
bdestombe/python-pwn-productiecapaciteit-infiltratiegebieden
productiecapaciteit/src/wvp_transient.py
wvp_transient.py
py
4,472
python
en
code
0
github-code
1
[ { "api_name": "os.path.join", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "productiecapaciteit.src.strang_analyse_fun2.get_config", "line_number": 27, "usage_type": "call" }, { "...
1218277044
""" Populate database command module """ import os import json from django.core.management.base import BaseCommand from core.settings import BASE_DIR from schemas.models.cities import City from schemas.models.countries import Country class Command(BaseCommand): help = "Populate the databse with multiple count...
alexeipopov95/drf-practice
tools/management/commands/populate_database.py
populate_database.py
py
1,906
python
en
code
0
github-code
1
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 14, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 16, "usage_type": "call" }, { "api_name": "core.settings.BASE_DIR", "line_number": 16, "usage_type": "argument" }, { "a...
8120556036
#!/usr/bin/env python # coding: utf-8 # # FINAL PROJECT # # ### Pooja Agrawal # # # In[1]: get_ipython().run_line_magic('reset', '-f') # In[2]: # To supress warnings import warnings warnings.filterwarnings("ignore") # In[4]: from pandas import ExcelWriter from pandas import ExcelFile from pandas import Series from p...
Poojaagwork/Bankruptcy-Data-Analysis-And-Prediction
Pooja_FINAL PROJECT320.py
Pooja_FINAL PROJECT320.py
py
41,482
python
en
code
0
github-code
1
[ { "api_name": "warnings.filterwarnings", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.read_table", "line_number": 40, "usage_type": "call" }, { "api_name": "pandas.read_table", "line_number": 41, "usage_type": "call" }, { "api_name": "pandas.re...
43242842310
# -*- coding: utf-8 -*- """ Resources for handball models. TODO: Use ApiKeyAuthentication for models that need authentication. Implement custom authorization based on handball graph. """ from tastypie.resources import ModelResource, ALL_WITH_RELATIONS, ALL from tastypie import fields from handball.models impo...
Engaginglab/scoreit-handball
api.py
api.py
py
20,144
python
en
code
1
github-code
1
[ { "api_name": "tastypie.resources.ModelResource", "line_number": 21, "usage_type": "name" }, { "api_name": "tastypie.authorization.Authorization", "line_number": 28, "usage_type": "call" }, { "api_name": "tastypie.authentication.Authentication", "line_number": 29, "usage_...
8015046067
# freecodecamp Algorithmic Trading - Equal-Weight S&P 500 import numpy as np # one or two dimensional arrays/tensors import pandas as pd # spreadsheets, tabular import requests # html import xlsxwriter import math stocks = pd.read_csv('sp_500_stocks.csv') type(stocks) # print? tells what type # store in s...
chrissmith10/projects-freecodecamp
algtradeqweightsp500.py
algtradeqweightsp500.py
py
4,848
python
en
code
0
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "secrets.IEX_CLOUD_API_TOKEN", "line_number": 16, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 17, "usage_type": "call" }, { "api_name": "pandas.DataFr...
12539332954
from django.contrib.auth.decorators import login_required from django.shortcuts import render, redirect from . import models, forms def show_all_posts(request): """ This view will show all of the posts """ my_posts = models.Post.objects.all() return render( request=request, contex...
javadkhd/JavadKhadem_HWs_M50
message/blog/views.py
views.py
py
884
python
en
code
0
github-code
1
[ { "api_name": "django.shortcuts.render", "line_number": 12, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "line_number": 33, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 35, "usage_type": "call" }, { "api_nam...
14592464595
from rest_framework import serializers from .models import RegisterInvitation from django.core.mail import send_mail from django.conf import settings import datetime class RegisterInvitationSerializer(serializers.ModelSerializer): class Meta: model = RegisterInvitation fields = '__all__' de...
benhchoi/coursemanager
coursemanager/invitations/serializers.py
serializers.py
py
950
python
en
code
0
github-code
1
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 10, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 10, "usage_type": "name" }, { "api_name": "models.RegisterInvitation", "line_number": 12, "usage_type": "...
25467462275
__author__ = 'jcgregorio@google.com (Joe Gregorio)' import unittest from oauth2client import xsrfutil # Jan 17 2008, 5:40PM TEST_KEY = 'test key' TEST_TIME = 1200609642081230 TEST_USER_ID_1 = 123832983 TEST_USER_ID_2 = 938297432 TEST_ACTION_ID_1 = 'some_action' TEST_ACTION_ID_2 = 'some_other_action' TEST_EXTRA_INFO_...
hanpfei/chromium-net
third_party/catapult/third_party/gsutil/third_party/oauth2client/tests/test_xsrfutil.py
test_xsrfutil.py
py
3,932
python
en
code
289
github-code
1
[ { "api_name": "unittest.TestCase", "line_number": 18, "usage_type": "attribute" }, { "api_name": "oauth2client.xsrfutil.generate_token", "line_number": 23, "usage_type": "call" }, { "api_name": "oauth2client.xsrfutil", "line_number": 23, "usage_type": "name" }, { ...
2946911396
# Авторизоваться на сайте https://fix-online.sbis.ru/ # Перейти в реестр Контакты # Отправить сообщение самому себе # Убедиться, что сообщение появилось в реестре # Удалить это сообщение и убедиться, что удалили # Для сдачи задания пришлите код и запись с экрана прохождения теста from selenium import webdriver from se...
AnnaBlem/AT_course
hw11/task_2.py
task_2.py
py
3,467
python
ru
code
0
github-code
1
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 15, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 15, "usage_type": "name" }, { "api_name": "time.time", "line_number": 19, "usage_type": "call" }, { "api_name": "time.sleep", ...
13496397373
import logging import logging.handlers import sys import datetime LOGGING_LEVEL = logging.DEBUG LOGGING_BASE = '/tmp' SUMMON_API_HOST = 'api.summon.serialssolutions.com' # Google credentials GOOGLE_CRED_JSON_FILE = '' # Summon Credentials SUMMON_ACCESS_ID = '' SUMMON_API_KEY = '' supported_languages = { 'Afri...
summon/translated-search
translatedsearch/settings.py
settings.py
py
2,042
python
en
code
2
github-code
1
[ { "api_name": "logging.DEBUG", "line_number": 6, "usage_type": "attribute" }, { "api_name": "logging.Formatter", "line_number": 60, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 61, "usage_type": "call" }, { "api_name": "sys.argv", ...
2269945821
import os import torchvision as tv import numpy as np from PIL import Image def get_dataset(args, transform_train, transform_test): cifar_train = Cifar100Train(args, train=True, transform=transform_train, download = args.download) testset = tv.datasets.CIFAR100(root='./data', train=False, download=False, tran...
EricArazo/ImportanceSampling
dataset/cifar100_dataset.py
cifar100_dataset.py
py
1,531
python
en
code
10
github-code
1
[ { "api_name": "torchvision.datasets.CIFAR100", "line_number": 9, "usage_type": "call" }, { "api_name": "torchvision.datasets", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torchvision.datasets", "line_number": 12, "usage_type": "attribute" }, { "a...
31808609856
# encoding: utf-8 import re import time import json import datetime from aliyun.log import * from prometheus_client import CollectorRegistry, push_to_gateway, Gauge, write_to_textfile endpoint = '' # 选择与上面步骤创建Project所属区域匹配的Endpoint accessKeyId = '' # 使用你的阿里云访问密钥AccessKeyId accessKey = '' # 使用你的阿里云访问密钥Acc...
amendge/OpsSricpts
getlogfromaliyun.py
getlogfromaliyun.py
py
1,943
python
en
code
5
github-code
1
[ { "api_name": "datetime.datetime.today", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 16, "usage_type": "attribute" }, { "api_name": "datetime.timedelta", "line_number": 17, "usage_type": "call" }, { "api_name": "dat...
22919970401
import torch import numpy as np import torch.nn as nn import os, gc os.environ["CUDA_VISIBLE_DEVICES"] = '0' import warnings warnings.filterwarnings(action='ignore', category=DeprecationWarning) warnings.simplefilter("ignore", UserWarning) from VAD_module import VAD, Scheduler, add_loss from utils import Speec...
Yifei-ZHAO96/STAM-pytorch
train_STAM.py
train_STAM.py
py
9,476
python
en
code
7
github-code
1
[ { "api_name": "os.environ", "line_number": 5, "usage_type": "attribute" }, { "api_name": "warnings.filterwarnings", "line_number": 7, "usage_type": "call" }, { "api_name": "warnings.simplefilter", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.cuda...
74574230112
def deltat (popT,Tc,a): delta = a*(popT**2)*(1 - (Tc/popT)) return delta def deltaA (popA,Ac,k): delta = k*(popA**2)*(1 - (Ac/popA)) return delta def deltaV (popV,Vc,l): delta = l*(popV**2)*(1 - (Vc/popV)) return delta def Tf(popA,Ap,popT): tubarao_fome=popA/Ap-popT return tubarao_fome def A...
Leobhering/projeto1-modsim
Projeto 1/projeto1.py
projeto1.py
py
1,851
python
pt
code
0
github-code
1
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 68, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 68, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.ylabel", "line_number": 69, "usage_type": "call" }, { "api_name": "mat...
10651942871
#imports import json import pandas as pd from tqdm import * import pickle import networkx as nx # Extraindo dados dos json e colocando em dataframe pandas contador = 0 lista_slices = [] # Quantidade de slices que serão utilizados, 1 slice são 1000 playlists pegar_quant_slices = 1 while(True): with open("data\mpd...
Carlos1999/Network_Analysis_Spotify_Playlists
Cria_grafo.py
Cria_grafo.py
py
2,942
python
pt
code
0
github-code
1
[ { "api_name": "json.load", "line_number": 17, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 25, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 36, "usage_type": "call" }, { "api_name": "pandas.concat", "line...
1931622003
""" This module contains a Flask application that uses OpenAI's GPT-4 model to chat with users. """ import os import markdown from flask import Flask, request, jsonify, render_template from flask_wtf import FlaskForm from wtforms import StringField, SubmitField from flask_bootstrap import Bootstrap from gunicorn.app.ba...
hooman130/gpt4-gui
main.py
main.py
py
3,003
python
en
code
0
github-code
1
[ { "api_name": "logging.basicConfig", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 14, "usage_type": "attribute" }, { "api_name": "gunicorn.app.base.BaseApplication", "line_number": 17, "usage_type": "name" }, { "api_name...
6953518270
import json from django.shortcuts import render, get_object_or_404, render_to_response from django.template import loader from django.http import HttpResponse, HttpResponseRedirect from .models import Libro from .models import Autor, Editor from .forms import AutorForm, EditorForm from django.views.generic import List...
JokerBerlin/python
biblioteca/views.py
views.py
py
7,569
python
en
code
0
github-code
1
[ { "api_name": "django.shortcuts.render", "line_number": 17, "usage_type": "call" }, { "api_name": "models.Libro.objects.filter", "line_number": 29, "usage_type": "call" }, { "api_name": "models.Libro.objects", "line_number": 29, "usage_type": "attribute" }, { "api...
6370764918
import json import tweepy import socket ACCESS_TOKEN = '311893922-jasoBxDymbqR4OxLBoDLw9Ab0pkPqUX2AVxFoYuy' ACCESS_SECRET = 'wa87QvHapxNOh3AxDy5bPL1vh9GrfqDA5kKuasbn8unhl' CONSUMER_KEY = 'UiDazJWIu3SvHSxltmO7mtN6b' CONSUMER_SECRET = 'YDI2mHOyWXfjUupr1CpUNVpAD6oin6YQ2u03RpWUtPbFeaXn4H' auth = tweepy.OAuthHandler(CON...
Sharayu2554/Big-Data
HW3/RoughWork/tweetApi.py
tweetApi.py
py
1,319
python
en
code
0
github-code
1
[ { "api_name": "tweepy.OAuthHandler", "line_number": 11, "usage_type": "call" }, { "api_name": "socket.socket", "line_number": 22, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 22, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STR...
8275354682
import argparse parser = argparse.ArgumentParser( description="Save baselines and klambda conversions to CSV." ) parser.add_argument("outfile", help="Destination to save CSV table.") args = parser.parse_args() import csv import numpy as np from mpol.constants import c_ms header = ["baseline", "100 GHz (Band 3)...
shawn194/MPoL
docs/_static/baselines/src/print_conversions.py
print_conversions.py
py
1,298
python
en
code
null
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 3, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 18, "usage_type": "call" }, { "api_name": "mpol.constants.c_ms", ...
21232958424
import numpy as np import copy import pickle import torch import torch.nn as nn from torch.utils.data import TensorDataset, DataLoader from sklearn.metrics import f1_score import feature_engineer from catboost import CatBoostClassifier from xgboost import XGBClassifier from mlp import MLP class EnsembleRNN(nn.Modul...
hjc18/sml_project
ensemble.py
ensemble.py
py
6,012
python
en
code
1
github-code
1
[ { "api_name": "torch.nn.Module", "line_number": 16, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 16, "usage_type": "name" }, { "api_name": "torch.nn.ModuleList", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.nn", "lin...
42157120652
# from django.http import JsonResponse, HttpResponse from rest_framework.status import HTTP_201_CREATED, HTTP_404_NOT_FOUND, HTTP_400_BAD_REQUEST, HTTP_200_OK from .serializers import * from .models import * from .exceptions import * from rest_framework.response import Response from rest_framework.views import APIVie...
Ellanity/sweets-from-all-misfortunes
server/delivery/views.py
views.py
py
16,143
python
en
code
1
github-code
1
[ { "api_name": "rest_framework.views.APIView", "line_number": 15, "usage_type": "name" }, { "api_name": "rest_framework.response.Response", "line_number": 28, "usage_type": "call" }, { "api_name": "rest_framework.response.Response", "line_number": 30, "usage_type": "call" ...
15247482287
import socketserver import socket import threading import functools from webserver.casseroleWebServerImpl import CasseroleWebServerImpl, dashboardWidgetList, WEB_ROOT from utils.singleton import Singleton # A threaded TCP server starts up new python threads for each client request, which allows # complex reque...
RobotCasserole1736/firstRoboPy
webserver/webserver.py
webserver.py
py
2,100
python
en
code
1
github-code
1
[ { "api_name": "socketserver.ThreadingMixIn", "line_number": 10, "usage_type": "attribute" }, { "api_name": "socketserver.TCPServer", "line_number": 10, "usage_type": "attribute" }, { "api_name": "utils.singleton.Singleton", "line_number": 14, "usage_type": "name" }, {...
34872538868
import numpy as np from deep_sort.utils.parser import get_config from deep_sort.deep_sort import DeepSort class DeepSortTracker: """ DeepSort object tracker. """ def init(self, reid_model_path, max_dist=0.2, min_confidence=0.3, nms_max_overlap=1.0, max_iou_distance=0.7, max_age=70, n_ini...
strikerPro818/strikerBot
Xavier_NX/personDetection.py
personDetection.py
py
1,215
python
en
code
0
github-code
1
[ { "api_name": "deep_sort.deep_sort.DeepSort", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 23, "usage_type": "call" } ]
35916070388
# -*- coding: utf-8 -*- from typing import Dict, List, Tuple import json import requests import re from enum import Enum from bs4 import BeautifulSoup import configparser import logging import pickle # 创建日志记录器 logger = logging.getLogger('my_logger') logger.setLevel(logging.DEBUG) file_logger = logging.getLogger('my...
supersonictan/astro_web
util.py
util.py
py
9,394
python
en
code
0
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 16, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "logging.INFO",...
9547326563
import os from sld.configs import Config import numpy as np from tqdm import tqdm from sklearn.model_selection import train_test_split from tensorflow.keras.models import Sequential from tensorflow.keras.layers import LSTM, Dense from tensorflow.keras.callbacks import TensorBoard from tensorflow.keras.utils import to_c...
hyeonslove/SignLanguageDetection
utils/training.py
training.py
py
1,604
python
en
code
1
github-code
1
[ { "api_name": "os.path.isfile", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "utils.DatasetLoader.DatasetLoader", "line_number": 19, "usage_type": "call" }, { "api_name": "sld.con...
74962288673
import os import threading import time import tkinter.messagebox from tkinter import * from tkinter import filedialog import pyglet from tkinter import ttk from ttkthemes import themed_tk as tk from mutagen.mp3 import MP3 from pygame import mixer class Media: def musicPlayer(self, music_player, window): ...
Dkarya846/PaiBot
ExtraFiles/MediaPlayer.py
MediaPlayer.py
py
6,714
python
en
code
1
github-code
1
[ { "api_name": "tkinter.ttk.Label", "line_number": 37, "usage_type": "call" }, { "api_name": "tkinter.ttk", "line_number": 37, "usage_type": "name" }, { "api_name": "tkinter.filedialog.askopenfilename", "line_number": 43, "usage_type": "call" }, { "api_name": "tkin...
20539075614
""" Curve Fit example @luis.fernandes #Nov 20 2019 """ import numpy as np import pandas as pd import matplotlib.pyplot as plt from scipy.optimize import curve_fit def lorentzian(x, amplitude, x0, sigma, background): # A lorentzian peak with: # Constant Background : background # Proportional t...
OSHI7/Learning1
LM/fit.py
fit.py
py
2,118
python
en
code
0
github-code
1
[ { "api_name": "numpy.pi", "line_number": 19, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number": 26, "usage_type": "call" }, { "api_name": "scipy.optimize.curve_fit", "line_number": 42, "usage_type": "call" }, { "api_name": "numpy.sum", ...
17341410745
from flask import Flask,request from flask.helpers import make_response from flask.json import jsonify import qrcode import json from PIL import Image app = Flask(__name__) app.config.from_pyfile("settings.py") baseUrl = "http://10.0.2.2:5000" @app.route("/home") def home(): list = [] list.append(createPrevie...
cnatom/MeiTuanAndroidAppServer
app.py
app.py
py
3,976
python
en
code
6
github-code
1
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.helpers.make_response", "line_number": 24, "usage_type": "call" }, { "api_name": "flask.json.jsonify", "line_number": 24, "usage_type": "call" }, { "api_name": "flask.helpe...
6080209867
import gym from gym import spaces import numpy as np import matplotlib.pyplot as plt from scipy.optimize import minimize class PortfolioManagementEnv(gym.Env): """ Portfolio Management Env """ def __init__(self, seed=0): # self.simulator = BlackScholes(num_stocks=3, # ...
JinyangJiangAI/Quantile-based-Policy-Optimization
portfolio_management/envs/portfolio_management.py
portfolio_management.py
py
9,366
python
en
code
6
github-code
1
[ { "api_name": "gym.Env", "line_number": 8, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": ...
17811259423
#!/usr/bin/env python3 import numpy as np import h5py import glob import matplotlib import matplotlib.pyplot as plt import argparse import csv def get_dataset_keys(f): keys = [] f.visit(lambda key : keys.append(key) if isinstance(f[key], h5py.Dataset) else None) return keys if __name__ == '__main__': ...
MichaelSt98/milupHPC
postprocessing/PlotBB.py
PlotBB.py
py
2,384
python
en
code
6
github-code
1
[ { "api_name": "h5py.Dataset", "line_number": 14, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 20, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 30, "usage_type": "call" }, { "api_name": "h5py.File", "...
42769197778
#!/usr/bin/python # __author__ = 'jasonsheh' # -*- coding:utf-8 -*- import sys import requests import threading import queue import time from database.database import Database class Sendir: def __init__(self, targets, id=''): self.targets = targets self.id = id self.q = queue.Queue(0) ...
euphrat1ca/SiteScan
lib/sendir.py
sendir.py
py
3,854
python
en
code
1
github-code
1
[ { "api_name": "queue.Queue", "line_number": 17, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 43, "usage_type": "call" }, { "api_name": "requests.exceptions", "line_number": 48, "usage_type": "attribute" }, { "api_name": "requests.exceptions...
43406778979
from tkinter import * from PIL import ImageTk,Image root = Tk() root.title("Learn to code") root.iconbitmap(r'C:\Users\tomry\GraphicUserInterface\wifi.ico') # Odkaz: https://www.youtube.com/watch?v=YXPyB4XeYLA&list=PLWKjhJtqVAbnqBxcdjVGgT3uVR10bzTEB&index=2 def open(): global my_img top = Toplevel() to...
BlackRou/GraphicUserInterface
base.py
base.py
py
684
python
en
code
0
github-code
1
[ { "api_name": "PIL.ImageTk.PhotoImage", "line_number": 17, "usage_type": "call" }, { "api_name": "PIL.ImageTk", "line_number": 17, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number": 17, "usage_type": "call" }, { "api_name": "PIL.Image", "li...
19545085642
import math from functools import reduce f = [x.rstrip('\n').split(',') for x in open('buses.txt').readlines()] times = [] positions = [] total = 0 for y, x in enumerate(f[1]): if x != 'x': times.append(int(x)) positions.append(y) current = 0 for pos in range(1, len(times)): done = False whi...
Patchkat/Advent-Of-Code-2020
Day 13/AoC13B.py
AoC13B.py
py
664
python
en
code
0
github-code
1
[ { "api_name": "functools.reduce", "line_number": 24, "usage_type": "call" }, { "api_name": "math.gcd", "line_number": 24, "usage_type": "call" } ]
30211290727
from __future__ import annotations import logging from ._apik import validate_api_key from ._kafka import KafkaProducer try: KAFKA_PRODUCER = KafkaProducer() except Exception as exc: logging.exception(exc) KAFKA_PRODUCER = None # type: ignore def add_query_ingest_impl(api_key: str, body: bytes) -> boo...
bloomberg/datalake-query-ingester
src/bloomberg/datalake/datalakequeryingester/_request_handler.py
_request_handler.py
py
493
python
en
code
7
github-code
1
[ { "api_name": "_kafka.KafkaProducer", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.exception", "line_number": 11, "usage_type": "call" }, { "api_name": "_apik.validate_api_key", "line_number": 16, "usage_type": "call" }, { "api_name": "logging....
71992212513
"""Support functions to write and read data.""" import os from enum import Enum from pathlib import Path import yaml from scm.plams import Molecule as PlamsMolecule from scm.plams.interfaces.adfsuite.ams import AMSResults from osp.core.cuds import Cuds from osp.core.namespaces import crystallography, emmo # from osp....
simphony/reaxpro-wrappers
osp/tools/io_functions.py
io_functions.py
py
27,357
python
en
code
0
github-code
1
[ { "api_name": "enum.Enum", "line_number": 15, "usage_type": "name" }, { "api_name": "os.path.basename", "line_number": 54, "usage_type": "call" }, { "api_name": "os.path", "line_number": 54, "usage_type": "attribute" }, { "api_name": "os.path.basename", "line_...
30051399636
from django.test import TestCase from datasets.models import RADataEntry from datasets.serializers import RADataEntrySerializer class RADataRecordSerializerTestCase(TestCase): fixtures = ['set.json', 'record.json', 'entry.json', 'member.json'] serializer_class = RADataEntrySerializer @classmethod de...
quanttide/django-quanttide-data
example/datasets/tests/test_serializers_entry.py
test_serializers_entry.py
py
989
python
en
code
0
github-code
1
[ { "api_name": "django.test.TestCase", "line_number": 7, "usage_type": "name" }, { "api_name": "datasets.serializers.RADataEntrySerializer", "line_number": 9, "usage_type": "name" }, { "api_name": "datasets.models.RADataEntry.objects.get", "line_number": 13, "usage_type": ...
46356953091
from flask import Flask, render_template, request, redirect from mysqlconnection import connectToMySQL app = Flask(__name__) mysql = connectToMySQL('friendsdb') @app.route('/') def index(): result = mysql.query_db("select * from players") return render_template("index.html", entry = result) if __name__=="__ma...
RamS2k/Python
Players and Slams/server.py
server.py
py
350
python
en
code
0
github-code
1
[ { "api_name": "flask.Flask", "line_number": 3, "usage_type": "call" }, { "api_name": "mysqlconnection.connectToMySQL", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 9, "usage_type": "call" } ]
74583620193
# -*- coding : utf-8 -*- from dateutil.relativedelta import relativedelta from datetime import datetime, timedelta from odoo import fields, models, api, tools, _ from odoo.exceptions import Warning, UserError, ValidationError class custom_partner(models.Model): _inherit = "res.partner" @api.multi def _dr...
lawrence24/e_order
models/custom_partner.py
custom_partner.py
py
11,031
python
en
code
0
github-code
1
[ { "api_name": "odoo.models.Model", "line_number": 8, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 8, "usage_type": "name" }, { "api_name": "odoo.api.multi", "line_number": 11, "usage_type": "attribute" }, { "api_name": "odoo.api", "...
32964384592
from ConfigSpace import Constant, UniformFloatHyperparameter, UniformIntegerHyperparameter, CategoricalHyperparameter, \ EqualsCondition from skorch.callbacks import LRScheduler from torch import nn from torch.optim import AdamW, Adam from .skorch_base import SkorchBaseModel class MLP(nn.Module): def __init...
automl/AutomlCup2023
models/base_models/mlp_model.py
mlp_model.py
py
4,522
python
en
code
2
github-code
1
[ { "api_name": "torch.nn.Module", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 10, "usage_type": "name" }, { "api_name": "torch.nn.GELU", "line_number": 17, "usage_type": "attribute" }, { "api_name": "torch.nn", "line...
74618324832
"""This submodule handles the cli-like utilities such as the parser """ import argparse class RadolanParser(argparse.ArgumentParser): def __init__(self): super().__init__( description="Training U-Net model for segmentation of RADOLAN precipitation images" ) self.add_arguments...
Campostrini/dwd_dl
dwd_dl/cli.py
cli.py
py
4,660
python
en
code
2
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 60, "usage_type": "attribute" } ]
12036768402
from django.shortcuts import render, redirect from . import models from . import forms from django.contrib.auth.decorators import permission_required # Create your views here. def Product(request, _product_id): category_parents = models.Category_parent.objects.order_by("order") product = models.Product.object...
AndresGroselj/Ultrahardware
Ultrahardware/products/views.py
views.py
py
4,306
python
en
code
0
github-code
1
[ { "api_name": "django.shortcuts.render", "line_number": 15, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 24, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 37, "usage_type": "call" }, { "api_name"...
38861082488
from loaders.dataloader_mnist import load_mnist from models.model_vae import VariationalInference, VariationalAutoencoder from models.distributions import ReparameterizedDiagonalGaussian import torch import matplotlib.pyplot as plt import seaborn as sns import pandas as pd sns.set_style("whitegrid") ### TEST DISTRIBU...
nikolasborrel/dlmusic
misc/tests_vae.py
tests_vae.py
py
2,588
python
en
code
0
github-code
1
[ { "api_name": "seaborn.set_style", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.ones", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.Size", "line_number": 16, "usage_type": "call" }, { "api_name": "models.distributions.Reparamet...
11520253260
import xml.etree.ElementTree import xml_share as xshare import os class xml_share_repository: """ Stores the information read from xml for easy access. """ xml_shares = [] def built_up_repository(self, share_file=os.path.dirname(__file__) + '/shares.xml'): """ Fill the reposit...
postmanisonline/pyShares
xml_share_repository.py
xml_share_repository.py
py
2,807
python
en
code
0
github-code
1
[ { "api_name": "os.path.dirname", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "xml.etree.ElementTree.etree.ElementTree.parse", "line_number": 16, "usage_type": "call" }, { "api_na...
22919346325
###################################################### # 8,330: Machine Learning (MiQEF) # Assignment 3: kNN Algorithm # Niklas Leander Kampe | 16-611-618 ###################################################### # Utility Libraries import math import warnings import numpy as np import pandas as pd from sklearn.model_sel...
nikampe/Machine_Learning
Assignment 3/kNN Algorithm - Niklas Kampe.py
kNN Algorithm - Niklas Kampe.py
py
4,660
python
en
code
2
github-code
1
[ { "api_name": "pandas.set_option", "line_number": 13, "usage_type": "call" }, { "api_name": "warnings.filterwarnings", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 28, "usage_type": "call" }, { "api_name": "sklearn.mod...
37621288464
def app(): import pandas as pd from operator import itemgetter import glob import streamlit as st pd.options.mode.chained_assignment = None st.header('Master List of LPI') files = glob.glob('*.xlsx') appended_data = [] leagueList = [] for file in files: leagueName = fil...
LouieR3/FantasyFootballApp
pages/10_LPI_Master_List.py
10_LPI_Master_List.py
py
1,670
python
en
code
2
github-code
1
[ { "api_name": "pandas.options", "line_number": 7, "usage_type": "attribute" }, { "api_name": "streamlit.header", "line_number": 8, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.read_excel", "...
9391112971
''' Created on Feb 13, 2014 @author: theo ''' import os from django.core.management.base import BaseCommand, CommandError from acacia.data.models import Project, ProjectLocatie, MeetLocatie, Datasource, Parameter, Series from django.conf import settings class Command(BaseCommand): args = '' help = 'Deletes un...
tkleinen/acaciadata
acacia/acacia/management/commands/cleanup.py
cleanup.py
py
1,613
python
en
code
0
github-code
1
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 11, "usage_type": "name" }, { "api_name": "acacia.data.models.Project.objects.exclude", "line_number": 17, "usage_type": "call" }, { "api_name": "acacia.data.models.Project.objects", "line_number": 17, ...
8716232323
from django.conf.urls import url from . import views from django.contrib.auth import views as auth_views urlpatterns = [ url(r'^$', views.index, name="index"), url(r'^login/$', views.authentication, name="authentication"), url(r'^logout$', auth_views.logout, {'next_page': '/'}, name="logout", ), url(...
chrisar12/Tesis_App
SituacionSalud/urls.py
urls.py
py
1,458
python
en
code
0
github-code
1
[ { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 10, "usage_type": "call" }, { "api_name": "django.c...
2121705474
import os from datetime import date import dateutil from src.examples.program.traccar.config.config import Config from src.examples.program.traccar.config.keys import Keys class MediaManager: _LOGGER = "LoggerFactory.getLogger(MediaManager.class)" def __init__(self, config): self._path = None ...
sofialucca/thesisResearch
src/examples/program/traccar/database/mediaManager.py
mediaManager.py
py
1,536
python
en
code
0
github-code
1
[ { "api_name": "src.examples.program.traccar.config.keys.Keys.MEDIA_PATH", "line_number": 18, "usage_type": "attribute" }, { "api_name": "src.examples.program.traccar.config.keys.Keys", "line_number": 18, "usage_type": "name" }, { "api_name": "os.O_PATH.get", "line_number": 21...
23671007568
import numpy as np import matplotlib.pyplot as plt def test_polyreg_univariate(): ''' Test polynomial regression ''' # load the data filepath = "./test.txt" df = pd.read_csv(filepath, header=None) X = df[df.columns[:-1]] y = df[df.columns[-1]] # regression with degree = d ...
spapazov/regression
test/test_poly_reg.py
test_poly_reg.py
py
1,163
python
en
code
0
github-code
1
[ { "api_name": "numpy.linspace", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.min", "line_number": 24, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "li...
41402696786
from datetime import date from typing import List, Optional from pydantic import BaseModel class UserBase(BaseModel): email: str username: str tanggal_lahir: date alamat: str status: Optional[str] no_telp: str class UserUpdate(BaseModel): email: Optional[str] username: Optional[str]...
vaniaalya14/rpl
sql_app/schemas.py
schemas.py
py
1,046
python
en
code
0
github-code
1
[ { "api_name": "pydantic.BaseModel", "line_number": 7, "usage_type": "name" }, { "api_name": "datetime.date", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 12, "usage_type": "name" }, { "api_name": "pydantic.BaseModel", ...
5580413154
from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: from django.contrib import admin from django.http import HttpResponseRedirect admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'tsune.views.home', name='home'), # url(r'^tsune/'...
DummyDivision/Tsune
tsune/urls.py
urls.py
py
1,281
python
en
code
3
github-code
1
[ { "api_name": "django.contrib.admin.autodiscover", "line_number": 7, "usage_type": "call" }, { "api_name": "django.contrib.admin", "line_number": 7, "usage_type": "name" }, { "api_name": "django.conf.urls.patterns", "line_number": 9, "usage_type": "call" }, { "api...
20048120941
from django.db import models from django.utils import timezone from embed_video.fields import EmbedVideoField from multiselectfield import MultiSelectField CATEGORY_CHOICES =( ('action','ACTION'), ('biography','BIOGAPHY'), ('drama','DRAMA',), ('comedy','COMEDY'), ('romance','ROMANCE',), ) LANGUAG...
sureshsaravananbabu/IMDB-clone
imdb/movie/models.py
models.py
py
1,730
python
en
code
0
github-code
1
[ { "api_name": "django.db.models.Model", "line_number": 26, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 26, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 27, "usage_type": "call" }, { "api_name"...
71188285794
from pyspark import SparkContext from pyspark.sql import SparkSession class SparkSpawner: @classmethod def get_spark(self) -> SparkSession: spark_builder = SparkSession.builder.appName('BigDW')\ .enableHiveSupport() \ .config("spark.jars.packages","io.delta:delta-core_2.11:0.5....
FP-DataSolutions/DeltaWarehouse
src/utils/spark_spawner.py
spark_spawner.py
py
689
python
en
code
5
github-code
1
[ { "api_name": "pyspark.sql.SparkSession.builder.appName", "line_number": 8, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pyspark.sql.SparkSession", "line_number": 8, "usage_type": "...
31002519252
import numpy as np import pandas as pd import pyarrow as pa import pyarrow.parquet as pq import os import gc array_length = 2**20 num_arrays = 10 filename = "test.parquet" # Only run this if the data file hasn't been already generated if(not os.path.isfile(filename)): # Generate arrays and write them to a datafr...
Hugo-loio/lasap
test/parquet_read_bug.py
parquet_read_bug.py
py
2,055
python
en
code
0
github-code
1
[ { "api_name": "os.path.isfile", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "numpy.arange", "line_number": 17, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line...
2775757377
""" https://leetcode.com/problems/sort-array-by-parity/ """ from typing import List class Solution: def sortArrayByParity(self, A: List[int]) -> List[int]: write_p = 0 for i in range(len(A)): if A[i] % 2 == 0: A[i], A[write_p] = A[write_p], A[i] write_...
alexparunov/leetcode_solutions
src/900-1000/_905_sort-array-by-parity.py
_905_sort-array-by-parity.py
py
345
python
en
code
1
github-code
1
[ { "api_name": "typing.List", "line_number": 9, "usage_type": "name" } ]
17575244199
import requests from bs4 import BeautifulSoup import pandas as pd import pathlib import datetime def fetch(which): url = 'https://isin.twse.com.tw/isin/C_public.jsp' param = dict( exchange={'strMode':'2'}, otc={'strMode':'4'}) response = requests.get(url, param[which]) assert response.s...
you-ming-hu/Stock_Trend_Analysis
Stocky/Database/agent/overview/core.py
core.py
py
4,298
python
en
code
0
github-code
1
[ { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 31, "usage_type": "call" }, { "api_name": "pandas.read_html", "line_number": 36, "usage_type": "call" }, { "api_name": "pandas.read_csv", ...
21615992825
from django.test import TestCase from core.models import User, ActivityPeriod from core.views import get_user_data_by_id, get_all_user_data, get_user_activity_details class UserTestCase(TestCase): def test_user(self): with self.assertRaises(User.DoesNotExist): user_1 = User.objects.get(id="W...
Mangy007/full-throttle-labs-api
core/tests.py
tests.py
py
1,030
python
en
code
0
github-code
1
[ { "api_name": "django.test.TestCase", "line_number": 7, "usage_type": "name" }, { "api_name": "core.models.User.DoesNotExist", "line_number": 10, "usage_type": "attribute" }, { "api_name": "core.models.User", "line_number": 10, "usage_type": "name" }, { "api_name"...
70195295073
import matplotlib.pyplot as plt import numpy as np from fluids.fittings import entrance_rounded, entrance_rounded_methods rcs = np.linspace(0,0.4, 1000) for method in entrance_rounded_methods: Ks = [entrance_rounded(Di=1.0, rc=rc, method=method) for rc in rcs] plt.plot(rcs, Ks, label=method) plt.legend() plt....
CalebBell/fluids
docs/plots/entrance_rounded_plot.py
entrance_rounded_plot.py
py
446
python
en
code
306
github-code
1
[ { "api_name": "numpy.linspace", "line_number": 6, "usage_type": "call" }, { "api_name": "fluids.fittings.entrance_rounded_methods", "line_number": 7, "usage_type": "name" }, { "api_name": "fluids.fittings.entrance_rounded", "line_number": 8, "usage_type": "call" }, { ...
30322019110
import cv2 import os for root, dirs, files in os.walk('pai/1/'): # print(root) # print(dirs) # print(files) if (files): for item in files: img = cv2.imread(os.path.join('pai/1', item)) rows, cols = img.shape[:2] M = cv2.getRotationMatrix2D((cols / 2, rows / ...
huilizhou/Deeplearning_Python_DEMO
image_preprocess/pre_img_warp_20181017.py
pre_img_warp_20181017.py
py
449
python
en
code
0
github-code
1
[ { "api_name": "os.walk", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "...
11510286902
# Released under the MIT License. See LICENSE for details. # """Functionality related to managing cloud based assets.""" from __future__ import annotations from typing import TYPE_CHECKING, Annotated from dataclasses import dataclass, field from pathlib import Path import threading import urllib.request import loggin...
efroemling/ballistica
src/assets/ba_data/python/babase/_assetmanager.py
_assetmanager.py
py
7,331
python
en
code
468
github-code
1
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 26, "usage_type": "name" }, { "api_name": "efro.dataclassio.ioprepped", "line_number": 30, "usage_type": "name" }, { "api_name": "dataclasses.dataclass", "line_number": 31, "usage_type": "name" }, { "api_name": ...
33593215042
""" 2005B DVD租赁 考虑如下的在线DVD租赁问题。顾客缴纳一定数量的月费成为会员,订购DVD租赁服务。会员对哪些DVD有兴趣,只要在线提交订单,网站就会通过快递的方式尽可能满足要求。会员提交的订单包括多张DVD,这些DVD是基于其偏爱程度排序的。网站会根据手头现有的DVD数量和会员的订单进行分发。每个会员每个月租赁次数不得超过2次,每次获得3张DVD。请考虑以下问题: 数据中会在测试点中给出。数据包括:网站n种DVD的现有张数和当前需要处理的m位会员的在线订单。 如何对这些DVD进行分配,才能使会员获得最大的满意度。 具体数据大家可以参考2005年全国大学生数学建模竞赛B题。 """ import numpy as np...
MicroPlusone/SDU_mathmodeling_program
山东大学 数学模型 程序汇总/2005年全国大学生数学建模竞赛B题 DVD租赁.py
2005年全国大学生数学建模竞赛B题 DVD租赁.py
py
1,302
python
zh
code
1
github-code
1
[ { "api_name": "numpy.zeros", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 14, "usage_type": "call" }, { "api_name": "cvxpy.Variable", "line_number": 19, "usage_type": "call" }, { "api_name": "cvxpy.Maximize", "line_num...
25258516529
from __future__ import absolute_import from flask import current_app from .builder import JenkinsBuilder class JenkinsGenericBuilder(JenkinsBuilder): def __init__(self, master_urls=None, *args, **kwargs): self.script = kwargs.pop('script') self.cluster = kwargs.pop('cluster') self.path =...
harrisonfeng/changes
changes/backends/jenkins/generic_builder.py
generic_builder.py
py
1,685
python
en
code
null
github-code
1
[ { "api_name": "builder.JenkinsBuilder", "line_number": 8, "usage_type": "name" }, { "api_name": "flask.current_app.config", "line_number": 18, "usage_type": "attribute" }, { "api_name": "flask.current_app", "line_number": 18, "usage_type": "name" } ]
30355678992
import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from sklearn.metrics import mean_absolute_error,mean_squared_error from keras.models import Model,Sequential from keras.layers import Dense,Activation df = pd.read_excel('AL_WIND_07_12....
Jabor047/Deep-Learning-and-Machine-Learning-Competitions
Zindi Africa/Wind Power predictions/lineareg.py
lineareg.py
py
1,220
python
en
code
0
github-code
1
[ { "api_name": "pandas.read_excel", "line_number": 10, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 19, "usage_type": "call" }, { "api_name": "keras.models.Sequential", "line_number": 22, "usage_type": "call" }, { ...
42739885025
import argparse from ccc_client.dcs.DcsRunner import DcsRunner from ccc_client.utils import print_API_response def run(args): runner = DcsRunner(args.host, args.port, args.authToken) for i in args.cccId: r = runner.create_link(args.setId, i) print_API_response(r) parser = argparse.ArgumentP...
ohsu-comp-bio/ccc_client
ccc_client/dcs/cli/create_link.py
create_link.py
py
659
python
en
code
0
github-code
1
[ { "api_name": "ccc_client.dcs.DcsRunner.DcsRunner", "line_number": 8, "usage_type": "call" }, { "api_name": "ccc_client.utils.print_API_response", "line_number": 11, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 14, "usage_type": "call" ...
7961996580
import math import numpy as np import pandas as pd import random import itertools as itr import os from pathlib import PurePath from scipy.sparse import coo_matrix from scipy.spatial import distance_matrix import scipy.stats as sts from sklearn.preprocessing import normalize import time import functools import operat...
jb-chaudron/Neural-Gas-MCMC
fonction.py
fonction.py
py
11,525
python
en
code
0
github-code
1
[ { "api_name": "os.path.exists", "line_number": 57, "usage_type": "call" }, { "api_name": "os.path", "line_number": 57, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number": 59, "usage_type": "call" }, { "api_name": "csv.reader", "line_nu...
37083046284
import scapy.all as sp import datetime as dt class TCPDumpHelper: def __init__(self, p): self.path = p # with Jan 1 1970 as reference, the exp_day is the no of seconds till experiment day self.exp_day = 1539388800 self.ist_hour = 5 self.ist_mins = 30 self.Mac_IP_Ma...
samvram/wmn_track3_helper
TCPDumpHelper.py
TCPDumpHelper.py
py
6,699
python
en
code
0
github-code
1
[ { "api_name": "scapy.all.PcapReader", "line_number": 70, "usage_type": "call" }, { "api_name": "scapy.all", "line_number": 70, "usage_type": "name" }, { "api_name": "datetime.datetime", "line_number": 78, "usage_type": "call" }, { "api_name": "scapy.all.IP", "...
955910411
# coding: utf-8 """ SnapTrade Connect brokerage accounts to your app for live positions and trading The version of the OpenAPI document: 1.0.0 Contact: api@snaptrade.com Created by: https://snaptrade.com/ """ from datetime import date, datetime # noqa: F401 import decimal # noqa: F401 import f...
passiv/snaptrade-sdks
sdks/python/snaptrade_client/model/status.py
status.py
py
3,639
python
en
code
3
github-code
1
[ { "api_name": "snaptrade_client.schemas.DictSchema", "line_number": 28, "usage_type": "attribute" }, { "api_name": "snaptrade_client.schemas", "line_number": 28, "usage_type": "name" }, { "api_name": "snaptrade_client.schemas.IntSchema", "line_number": 40, "usage_type": "...
30294953
from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart import smtplib import speech import imaplib fromadd = "mmanibalan2@gmail.com" def send(): speech.voice("To whom") a = speech.speech() print("done") speech.voice("mail") body = speech.speech() p...
manibalanM/manibalan-chan
mail.py
mail.py
py
1,702
python
en
code
1
github-code
1
[ { "api_name": "speech.voice", "line_number": 10, "usage_type": "call" }, { "api_name": "speech.speech", "line_number": 11, "usage_type": "call" }, { "api_name": "speech.voice", "line_number": 13, "usage_type": "call" }, { "api_name": "speech.speech", "line_num...
3662992089
import requests #设置代理 proxy = { 'http':'218.65.254.114', 'https':'175.148.72.52:1133' } url = 'https://httpbin.org/get' response = requests.get(url,proxies=proxy) print(response.status_code) print(response.text) #使用私密代理 # proxy = { # 'http':'' # }
1615961606/-test
备份/1804爬虫/第一周/第四天/request_proxy.py
request_proxy.py
py
279
python
en
code
0
github-code
1
[ { "api_name": "requests.get", "line_number": 8, "usage_type": "call" } ]
70342956194
import logging import os import termcolor # Success log level SUCCESS = 25 def configure_logging(level=logging.INFO, use_color=True): """ Configure te global logging settings. """ override_level = os.environ.get('S2EENV_LOG_LEVEL', None) if override_level: level = logging.getLevelName(o...
S2E/s2e-env
s2e_env/utils/log.py
log.py
py
2,179
python
en
code
89
github-code
1
[ { "api_name": "logging.INFO", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 15, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 15, "usage_type": "attribute" }, { "api_name": "logging.getLevelName...
31914585274
from __future__ import absolute_import import datetime import json import os import requests import simpy from celery.utils.log import get_task_logger from DLP.celery import app from DLP.settings import BASE_DIR from dlp.apis.api_weather import can_fly, ALLOW from dlp.file_manager.file_manager import get_site_url, \...
xavics/DLP
dlp/tasks.py
tasks.py
py
5,131
python
en
code
2
github-code
1
[ { "api_name": "celery.utils.log.get_task_logger", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path", "line_number": 24, "usage_type": "attribute" }, { "api_name": "DLP.settin...
26535774253
from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtCore import QObject, pyqtSlot, QThread, pyqtSignal, QRectF, QRect, QPointF, QLocale import sys from collections import OrderedDict import pyqtgraph as pg import numpy as np from easydict import EasyDict as edict class Viewer2DBasic(QObject): sig_double_click...
Attolab/FAB1_LIZARD
220317_backup/pymodaq/daq_utils/plotting/viewer2D/viewer2d_basic.py
viewer2d_basic.py
py
9,024
python
en
code
0
github-code
1
[ { "api_name": "PyQt5.QtCore.QObject", "line_number": 10, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 11, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 17, "usage_type": "call" }, { "api_name": "...
38120283463
import numpy as np import cv2 #calling and storing the file for face recognition face_cascade=cv2.CascadeClassifier('cascades/data/haarcascade_frontalface_alt2.xml') cap=cv2.VideoCapture(0) while True: ret,frame=cap.read() gray=cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY)#cascade works on gray #fa...
Jindalkaran/OpenCv
e_face_detection.py
e_face_detection.py
py
1,181
python
en
code
1
github-code
1
[ { "api_name": "cv2.CascadeClassifier", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY"...
13392283616
import matplotlib.pyplot as plt fig, axes = plt.subplots(nrows=12, ncols=3, figsize=(30, 100)) def getAvg(df): res = pd.Series(np.zeros(128)) for x in df: res += df[x] res /= (len(list(dfH)) - 1) return res subject_nums = [ '04', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15'...
ezhang7423/CS192
vis.py
vis.py
py
1,463
python
en
code
0
github-code
1
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 2, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 2, "usage_type": "name" } ]
33751812156
import sys from os.path import dirname, abspath sys.path.append(dirname(dirname(dirname(abspath(__file__))))) import unittest import thread import beanstalkc import simplejson from scavengers.scavenger import Scavenger from scavengers.scavenger_utils import OK_CODE, NOT_FOUND_ERROR_CODE from scavengers.google_plus_sca...
andreisoare/droopy
scavengers/test/google_plus_test.py
google_plus_test.py
py
1,751
python
en
code
0
github-code
1
[ { "api_name": "sys.path.append", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 3, "usage_type": "call" }, { "api_name": "os.path.abspath", "lin...
6021296254
from typing import Set, List import argparse import itertools import numpy as np import cv2 import os ALLOWED_EXT = [".jpg", ".JPG", ".png", ".PNG", ".jpeg", ".JPEG"] AVAILABLE_ALGORITHMS = ["dhash", "humming"] def read_args(): parser = argparse.ArgumentParser() parser.add_argument("folder", help="Path to a...
EvgeniiTitov/detectors
scripts/duplicates_detector.py
duplicates_detector.py
py
6,038
python
en
code
1
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.ndarray", "line_number": 22, "usage_type": "attribute" }, { "api_name": "cv2.cvtColor", "line_number": 31, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR...
24099043056
import requests import json url = 'https://api.privatbank.ua/p24api/pubinfo?json&exchange&coursid=5' response = requests.get(url) json_data = json.loads(response.text) string_out = '' for data in json_data: buy = data['buy'] sale = data['sale'] string_out +=f'Покупка: {buy} - Продажа: {sale}\n' print(string_out...
mikh-maksi/python-autocourse
pasing/parse_pb.py
parse_pb.py
py
335
python
en
code
0
github-code
1
[ { "api_name": "requests.get", "line_number": 6, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 7, "usage_type": "call" } ]
8530202683
import torch import os def save_tuple(state, next_state, action, reward, is_terminal, path, t): s_prime_aux = state s_prime_aux = s_prime_aux.detach().cpu().type(torch.uint8) s_aux = next_state s_aux = s_aux.detach().cpu().type(torch.uint8) action_aux = action action_aux = action_aux....
riordan45/rl-edge-of-stability
utils/save_tuple.py
save_tuple.py
py
854
python
en
code
0
github-code
1
[ { "api_name": "torch.uint8", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.uint8", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.uint8", "line_number": 12, "usage_type": "attribute" }, { "api_name": "torch.tensor", "...
18973686604
import os import sys from datetime import datetime import logging import shutil from spotcam_utils.config_helper import ConfigHelper class DirectoryHelper(): def __init__(self, CAMERA_NAME, DATE = datetime.now()): self.CAMERA_NAME = CAMERA_NAME self.DATE = DATE self.HOME = os.environ['HOME...
andrewchiull/get-camera-video_POM
spotcam_utils/directory_helper.py
directory_helper.py
py
1,625
python
en
code
2
github-code
1
[ { "api_name": "datetime.datetime.now", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 10, "usage_type": "name" }, { "api_name": "os.environ", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.environ", ...
32525669806
import requests from lxml import html # 创建 session 对象。这个对象会保存所有的登录会话请求。 session_requests = requests.session() # 提取在登录时所使用的 csrf 标记 login_url = "http://www.chechebijia.com/api/user/login/" payload = { "phone": "13811848104", "password": "cnt82562288", "operateType": 0 } # 执行登录 result = session_requests.post( log...
anjiayin/test
login.py
login.py
py
880
python
en
code
0
github-code
1
[ { "api_name": "requests.session", "line_number": 4, "usage_type": "call" } ]
6913184410
from profile import Profile from os import unlink from io import StringIO import pstats def calibrate(n): """ https://docs.python.org/3/library/profile.html#calibration """ if n > 0: pr = Profile() magics = [] for i in range(n): magics.append(pr.calibrate(10000)) ...
vstinner/python-ptrace
ptrace/profiler.py
profiler.py
py
1,232
python
en
code
172
github-code
1
[ { "api_name": "profile.Profile", "line_number": 12, "usage_type": "call" }, { "api_name": "profile.Profile", "line_number": 26, "usage_type": "call" }, { "api_name": "pstats.Stats", "line_number": 32, "usage_type": "call" }, { "api_name": "io.StringIO", "line_...
11735270517
import tensorflow.compat.v1 as tf import posenet import cv2 import keyboard class Tracker(): def capture_pose_gen(self): model = posenet.load_model_keras(101, model_dir='./converted_models/saved_model') cap = cv2.VideoCapture(0) cap.set(3, 1280) cap.set(4, 720) cv2.namedWin...
ImpulseFitnessCode/ExcerciseTracker
tracker.py
tracker.py
py
1,449
python
en
code
0
github-code
1
[ { "api_name": "posenet.load_model_keras", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.namedWindow", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.WINDOW_N...
41489675162
# -*- coding: utf-8 -*- """ Created on Tue Jun 9 09:54:35 2020 Calculating number of pixels for hull convex area @author: Rafael Yassue """ import cv2 import numpy as np import os as os from skimage.morphology import convex_hull_image import pandas as pd import matplotlib.pyplot as plt os.chdir("G:\\My Drive...
RafaelYassue/Root-phenotyping
python/HULL.py
HULL.py
py
1,098
python
en
code
2
github-code
1
[ { "api_name": "os.chdir", "line_number": 21, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 22, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 31, ...
24349331321
import api import logbook from webbrowser import open as web_open logbook.RotatingFileHandler('my_search_api', level=logbook.TRACE).push_application() logger = logbook.Logger("Main") def main(): logger.info('Taking user input...') user_input = input('Enter search criteria: ') logger.info(f'Searching for {...
pgmilenkov/100daysofcode-with-python-course
days/43-45-search-api/my_search_api_43/program.py
program.py
py
855
python
en
code
null
github-code
1
[ { "api_name": "logbook.RotatingFileHandler", "line_number": 5, "usage_type": "call" }, { "api_name": "logbook.TRACE", "line_number": 5, "usage_type": "attribute" }, { "api_name": "logbook.Logger", "line_number": 6, "usage_type": "call" }, { "api_name": "api.search...
75201389472
#!/usr/bin/python3 # -*- coding:utf-8 -*- # Created by Jianguo on 2017/10/23 __author__ = "Jianguo Jin (jinjianguosky@hotmail.com)" """ Description: Person 字段 属性 方法 """ from datetime import date, datetime class Person: def __init__(self, name, age, birthdate,...
skyaiolos/SeleniumWithPython
OOP/employee.py
employee.py
py
1,134
python
en
code
1
github-code
1
[ { "api_name": "datetime.date.today", "line_number": 43, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 43, "usage_type": "name" }, { "api_name": "datetime.date", "line_number": 47, "usage_type": "call" } ]
16144823426
import unittest import pygame import database from ui.renderer import Renderer from sprites.ball import Ball from sprites.paddle import Paddle from eventhandler import EventHandler from gameloop import GameLoop class TestGameloop(unittest.TestCase): def setUp(self): DISPLAY_WIDTH = 800 DISPLAY_HEIG...
katajak/ot-harjoitustyo
src/tests/gameloop_test.py
gameloop_test.py
py
2,393
python
en
code
0
github-code
1
[ { "api_name": "unittest.TestCase", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pygame.display.set_mode", "line_number": 16, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 16, "usage_type": "attribute" }, { "api_name": "sp...
35627807301
# Файл с N последовательностью натуральных чисел, sep = ' '. Последовательность A[i] - 1 = A[i - 1]. Найти нехватающее число # Пример 1 2 3 4 5 7 8 9 -> 6 from pathlib import Path path = Path(r'task1File.txt') with open(path, 'r') as data: string = data.readline() array = list(map(int, string.split())) tmp = -1 fo...
RamkaTheRacist/python-RTR
PY_les5_s/task1.py
task1.py
py
652
python
ru
code
0
github-code
1
[ { "api_name": "pathlib.Path", "line_number": 4, "usage_type": "call" } ]