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
9334336743
import bpy, math, os from mathutils import * from bpy.app.handlers import persistent from bpy.props import * from .common import * mo_names = { 'DIFFUSE': "Diffuse Color", 'DIFFUSE_SHADED': "Diffuse Shaded", 'LIGHTING_ONLY': "Lighting Only", 'SPECULAR': "Specular Color", 'SPECUL...
ucupumar/yPanel
material_override.py
material_override.py
py
34,577
python
en
code
109
github-code
7
[ { "api_name": "bpy.data.libraries.load", "line_number": 32, "usage_type": "call" }, { "api_name": "bpy.data", "line_number": 32, "usage_type": "attribute" }, { "api_name": "bpy.data", "line_number": 33, "usage_type": "attribute" }, { "api_name": "bpy.data.images.g...
72289667104
# !pip install bs4 from bs4 import BeautifulSoup import requests import matplotlib.pyplot as plt import numpy as np user1 = 'imvickykumar999' user2 = 'ayu4tor' def fetch_data(user): gurl = f'https://github.com/{user}' r = requests.get(gurl) soup = BeautifulSoup(r.content, 'html5lib') a = soup.findAl...
imvickykumar999/Ideationology-Lab
Libraries/Beautiful Soup/instagit.py
instagit.py
py
1,826
python
en
code
9
github-code
7
[ { "api_name": "requests.get", "line_number": 13, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.array", "line_nu...
25407934085
from pyspark.sql import SparkSession from pyspark.sql import functions as func from pyspark.sql.types import StructType, StructField, IntegerType, LongType # Init Spark sp = SparkSession.builder.appName("MostPopularMovie").getOrCreate() # Define the Schema movieSchema = StructType([ StructField(name="UserId", dat...
BertCatsburg/Apache_Spark_Playing
Udemy_4/most-popular-movie.py
most-popular-movie.py
py
850
python
en
code
0
github-code
7
[ { "api_name": "pyspark.sql.SparkSession.builder.appName", "line_number": 6, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pyspark.sql.SparkSession", "line_number": 6, "usage_type": "...
11112991637
#!/usr/bin/env python # encoding: utf-8 # Before running this program, first Start HFO server: # $> ./bin/HFO --offense-agents 1 from __future__ import division import itertools import math import hfo import argparse from array import array import numpy as np import helper import tensorflow as tf import random from lo...
RubenvanHeusden/HFO-Robotkeeper
example/test_keepers/q_learning_neural_low_level_agent.py
q_learning_neural_low_level_agent.py
py
4,140
python
en
code
0
github-code
7
[ { "api_name": "argparse.ArgumentParser", "line_number": 29, "usage_type": "call" }, { "api_name": "hfo.HIGH_LEVEL_FEATURE_SET", "line_number": 31, "usage_type": "attribute" }, { "api_name": "tensorflow.reset_default_graph", "line_number": 36, "usage_type": "call" }, {...
26503501296
import os import pandas as pd import argparse import utils as ut def main( input_data_dir, store_dir, lib_prefix, lib_replicates, lib_short, ): # get the master file filtered with at least 50 reads per replicate master_file = os.path.join(input_data_dir, "master", lib_short, "master_fi...
deeprob/starrseq_quality_control_lib
src/2_create_overlapping_windows.py
2_create_overlapping_windows.py
py
1,319
python
en
code
0
github-code
7
[ { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 1...
72850859422
import numpy as np import torch import torch.nn.functional as F from mmdet.core import multi_apply from torch import nn from mmocr.models.builder import LOSSES @LOSSES.register_module() class FCELoss(nn.Module): """The class for implementing FCENet loss. FCENet(CVPR2021): `Fourier Contour Embedding for Arbi...
Ascend/ModelZoo-PyTorch
PyTorch/built-in/cv/detection/DBpp_ID4145_for_PyTorch/mmocr/models/textdet/losses/fce_loss.py
fce_loss.py
py
7,866
python
en
code
31
github-code
7
[ { "api_name": "torch.nn.Module", "line_number": 11, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 11, "usage_type": "name" }, { "api_name": "torch.from_numpy", "line_number": 57, "usage_type": "call" }, { "api_name": "numpy.stack", "lin...
23544929007
# -*- coding: utf-8 -*- import django_filters from ipware import get_client_ip from django_filters.rest_framework import DjangoFilterBackend from django.conf.urls import url, include from django.shortcuts import get_list_or_404, get_object_or_404 from rest_framework import filters from rest_framework import generics fr...
over55/workery-django
workery/tenant_api/views/insurance_requirement.py
insurance_requirement.py
py
4,155
python
en
code
10
github-code
7
[ { "api_name": "rest_framework.generics.ListCreateAPIView", "line_number": 26, "usage_type": "attribute" }, { "api_name": "rest_framework.generics", "line_number": 26, "usage_type": "name" }, { "api_name": "tenant_api.serializers.insurance_requirement.InsuranceRequirementListCreat...
22078077235
from PyQt5.QtWidgets import (QApplication, QWidget, QTableWidget, QTableWidgetItem, QVBoxLayout, QHBoxLayout, QPushButton, QComboBox, QFileDialog) from PyQt5.QtCore import Qt import sys import pandas as pd import matplotlib.pyplot as plt import matplotlib.dates as mdates import matplotlib.fo...
koreanbulbasaur/Project
semi_project/Design/ex/ex1.py
ex1.py
py
3,865
python
en
code
0
github-code
7
[ { "api_name": "matplotlib.font_manager.FontProperties", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.font_manager", "line_number": 13, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.rc", "line_number": 14, "usage_type": "call" }, { ...
20120653007
from __future__ import division import matplotlib.pyplot as plt import numpy as np from scipy.stats import beta class BernoulliBandit(object): """伯努利多臂老虎机,输入K表示拉杆个数.""" def __init__(self, num_bandit, probs=None): assert probs is None or len(probs) == num_bandit if probs is None: ...
jianzhnie/deep-rl-toolkit
examples/hands-on-rl/base_concept/multi_armed_bandit.py
multi_armed_bandit.py
py
12,858
python
en
code
14
github-code
7
[ { "api_name": "numpy.random.uniform", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 16, "usage_type": "attribute" }, { "api_name": "numpy.argmax", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.random.rand...
2535940146
import cv2 import numpy as np import matplotlib.pyplot as plt import yaml from glob import glob import random import os ROOT = "/home/lisp3r/image-recognition" DATASET = "{}/datasets".format(ROOT) RESULT = "{}/result".format(ROOT) LABELS = "{}/labels.txt".format(ROOT) BACKUP_DATASETS = "{}/English Typed Alphabets And...
lisp3r/UIM-3D-display-output-recognition
neural-network/helper.py
helper.py
py
2,711
python
en
code
0
github-code
7
[ { "api_name": "numpy.array", "line_number": 37, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 41, "usage_type": "call" }, { "api_name": "cv2.IMREAD_GRAYSCALE", "line_number": 41, "usage_type": "attribute" }, { "api_name": "glob.glob", "lin...
12919778617
from app import create_app from flask import request app = create_app() flask_app = app.app @flask_app.before_request def before_request(): # This is the url which the GLB hit to verify if the service is live or not. if request.path == '/': return 'Heath Check Successfull', 200 if __name__ == '__ma...
akshayg294/ML-DL-Sandbox
run.py
run.py
py
350
python
en
code
0
github-code
7
[ { "api_name": "app.create_app", "line_number": 4, "usage_type": "call" }, { "api_name": "app.app", "line_number": 5, "usage_type": "attribute" }, { "api_name": "flask.request.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "flask.request", ...
33191371138
import numpy as np from scipy.stats import mstats import pandas as pd import matplotlib.pyplot as plt import seaborn as sns train = pd.read_csv("train.csv") train.head(2) train.isnull().sum() # Product_category 2 and 3 have lots of NAN value. train['Product_Category_2'].fillna(mstats.mode(train["Product_Category_2...
Raj-Yadav/Black_friday
Black_friday.py
Black_friday.py
py
3,111
python
en
code
0
github-code
7
[ { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "scipy.stats.mstats.mode", "line_number": 13, "usage_type": "call" }, { "api_name": "scipy.stats.mstats", "line_number": 13, "usage_type": "name" }, { "api_name": "scipy.stats...
31921728793
import torch import torch.nn.functional as F from allennlp.models import Model from allennlp.modules.text_field_embedders import BasicTextFieldEmbedder from allennlp.data import TextFieldTensors, Vocabulary from allennlp.nn.util import get_text_field_mask from allennlp.training.metrics import CategoricalAccuracy from a...
dugu9sword/dne
awesome_glue/vanilla_classifier.py
vanilla_classifier.py
py
3,676
python
en
code
14
github-code
7
[ { "api_name": "torch.nn", "line_number": 19, "usage_type": "attribute" }, { "api_name": "torch.bernoulli", "line_number": 26, "usage_type": "call" }, { "api_name": "allennlp.models.Model", "line_number": 31, "usage_type": "name" }, { "api_name": "allennlp.data.Voc...
7359997846
#!/usr/bin/env #!/usr/bin/python3 # -*- coding: utf-8 -*- from eve import Eve from eve.auth import HMACAuth from flask import current_app from hashlib import sha1 import hmac from werkzeug.contrib.fixers import ProxyFix app = Eve() with app.app_context(): # within this block, current_app points to app. prin...
Dertosh/mipdd_base_rest_api
mipdd_base_rest_api/app.py
app.py
py
1,022
python
en
code
0
github-code
7
[ { "api_name": "eve.Eve", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.current_app.name", "line_number": 17, "usage_type": "attribute" }, { "api_name": "flask.current_app", "line_number": 17, "usage_type": "name" }, { "api_name": "werkzeug.contri...
40965613652
from typing import List, Dict from app.Cards import Suit, Rank, Card from app.PlayerCards import PlayerCards def to_cards(cards_str: str) -> List[Card]: return [Card(ranks_dict.get(cards_str[i]), suits_dict.get(cards_str[i+1])) for i in range(0, len(cards_str)-1, 2)] def to_player_cards(input_string...
f1ne2/Poker
app/Converter.py
Converter.py
py
1,544
python
en
code
0
github-code
7
[ { "api_name": "app.Cards.Card", "line_number": 7, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 6, "usage_type": "name" }, { "api_name": "app.Cards.Card", "line_number": 6, "usage_type": "name" }, { "api_name": "app.PlayerCards.PlayerCards", ...
14168312466
import os import re import matplotlib.pyplot as plt import joblib as jl from DataProcesser import DataProcesser def display_missing_barchart(dataframe, columns, missing_value): labels = [] rects = [] plt.figure(figsize=(15,6)) for m in columns: x = dataframe[m][dataframe[m] == missing...
SamuelBaptista/ia-doctor
src/functions.py
functions.py
py
3,088
python
en
code
0
github-code
7
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 15, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.bar", "line_number": 19, "usage_type": "call" }, { "api_name": "matp...
72863586462
# BSD 3-Clause License # # Copyright (c) 2017 xxxx # All rights reserved. # Copyright 2021 Huawei Technologies Co., Ltd # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must ...
Ascend/ModelZoo-PyTorch
PyTorch/contrib/cv/others/3D_EDSR_ID3005_for_PyTorch/edsr_x3_3d.py
edsr_x3_3d.py
py
3,665
python
en
code
31
github-code
7
[ { "api_name": "torch.nn.Conv3d", "line_number": 37, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 37, "usage_type": "name" }, { "api_name": "torch.nn.Module", "line_number": 41, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_nu...
19286809646
# coding: utf-8 # In[1]: import numpy as np import pandas as pd import json from ast import literal_eval pd.set_option('display.max_columns', 500) # In[2]: d = pd.read_csv("/wdblue/gstore_spending/all/train_v2.csv") # In[36]: # for i in range(600): # x = json.loads(d.hits[i]) # print(x.keys()) # ...
donaldtang8/Customer-Revenue-Prediction
python/wrangle_trainv2.py
wrangle_trainv2.py
py
2,363
python
en
code
0
github-code
7
[ { "api_name": "pandas.set_option", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 18, "usage_type": "call" }, { "api_name": "ast.literal_eval", "line_number": 37, "usage_type": "call" }, { "api_name": "ast.literal_eval",...
72219194782
from django.urls import path from customuser_app import admin from . import views urlpatterns = [ path("", admin.site, name="admin"), path("", views.index, name="homepage"), path("adduser/", views.adduser_view, name="adduser"), path("login/", views.login_view, name="login"), path("logout/", views....
lnginyard/django-custom-users
django-custom-users/customuser_app/urls.py
urls.py
py
350
python
en
code
0
github-code
7
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "customuser_app.admin.site", "line_number": 7, "usage_type": "attribute" }, { "api_name": "customuser_app.admin", "line_number": 7, "usage_type": "name" }, { "api_name": "dja...
37017941862
import solara @solara.component def Page(): clicks, set_clicks = solara.use_state(0) color = "green" if clicks >= 5: color = "red" def on_click(): set_clicks(clicks + 1) print("clicks", clicks) # noqa return solara.Button(label=f"Clicked: {clicks}", on_click=on_click, c...
civvic/solara
solara/template/button.py
button.py
py
332
python
en
code
null
github-code
7
[ { "api_name": "solara.use_state", "line_number": 6, "usage_type": "call" }, { "api_name": "solara.Button", "line_number": 16, "usage_type": "call" }, { "api_name": "solara.component", "line_number": 4, "usage_type": "attribute" } ]
24729279366
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys import requests from requests import ConnectionError # The following disables the InsecureRequests warning and the 'Starting new HTTPS connection' log message from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.di...
byt3bl33d3r/CrackMapExec
cme/modules/empire_exec.py
empire_exec.py
py
5,647
python
en
code
7,833
github-code
7
[ { "api_name": "requests.packages.urllib3.disable_warnings", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.packages.urllib3.exceptions.InsecureRequestWarning", "line_number": 11, "usage_type": "argument" }, { "api_name": "requests.packages", "line_number":...
71353525024
# import libraries import sys import pandas as pd import numpy as np import sqlite3 import nltk import string import re from sqlalchemy import create_engine from sklearn.ensemble import RandomForestClassifier from sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer from sklearn.multioutput ...
mumtazdemirci/ML-Pipeline
models/train_classifier.py
train_classifier.py
py
4,274
python
en
code
0
github-code
7
[ { "api_name": "warnings.filterwarnings", "line_number": 25, "usage_type": "call" }, { "api_name": "nltk.download", "line_number": 27, "usage_type": "call" }, { "api_name": "sqlalchemy.create_engine", "line_number": 39, "usage_type": "call" }, { "api_name": "pandas...
73941686944
import os import logging logger = logging.getLogger() logger.setLevel(logging.INFO) def handler(event, context): alarm_dictionary = {} fragment = event["fragment"] monitoring_topic = os.environ['SNSTopic'] logger.info('Input Template: {}'.format(fragment)) resources = fragment['Resources'] for...
aws-quickstart/cloudwatch-alarm-macro
src/alarm_macro.py
alarm_macro.py
py
13,461
python
en
code
12
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 4, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 10, "usage_type": "attribute" } ]
28155901050
from django.test import TestCase from rest_framework.test import APIRequestFactory # Create your tests here. from .persister import WorkoutWeekPersister from .models import ResistanceTrainingExercise from .week_upgrade import valid_fitness, upgrade from epilogue.models import Customer from workoutplan.generator impo...
dotslash227/98fitcortex
testing/workout/tests.py
tests.py
py
2,620
python
en
code
0
github-code
7
[ { "api_name": "rest_framework.test.APIRequestFactory", "line_number": 15, "usage_type": "call" }, { "api_name": "django.test.TestCase", "line_number": 18, "usage_type": "name" }, { "api_name": "models.ResistanceTrainingExercise.objects.count", "line_number": 22, "usage_ty...
40977519591
# https://leetcode.cn/problems/prefix-and-suffix-search/ from itertools import zip_longest class node: def __init__(self) -> None: self.child ={} self.idx =-1 class WordFilter: def __init__(self, words): self.root = node() for i ,word in enumerate(words): ...
wherby/code
algorithm/trieTree/questions/q745.2.py
q745.2.py
py
1,508
python
en
code
1
github-code
7
[ { "api_name": "itertools.zip_longest", "line_number": 39, "usage_type": "call" } ]
72864957662
import os import numpy as np import torch import time from PIL import Image from argparse import ArgumentParser from torch.autograd import Variable from erfnet_nobn import ERFNet from transform import Relabel, ToLabel, Colorize import torch.backends.cudnn as cudnn cudnn.benchmark = True def main(args): model =...
Ascend/ModelZoo-PyTorch
PyTorch/contrib/cv/semantic_segmentation/ErfNet/eval/eval_forwardTime.py
eval_forwardTime.py
py
1,841
python
en
code
31
github-code
7
[ { "api_name": "torch.backends.cudnn.benchmark", "line_number": 15, "usage_type": "attribute" }, { "api_name": "torch.backends.cudnn", "line_number": 15, "usage_type": "name" }, { "api_name": "erfnet_nobn.ERFNet", "line_number": 18, "usage_type": "call" }, { "api_n...
24324541965
from django.urls import reverse from rest_framework import status from rest_framework.test import APITestCase from .models import Hostel class HostelTests(APITestCase): def setUp(self): # Create a test hostel self.hostel_data = { 'name': 'Test Hostel', 'location'...
esmond-adjei/hnh-backend
hnh_accommodation/hostel/tests.py
tests.py
py
2,768
python
en
code
0
github-code
7
[ { "api_name": "rest_framework.test.APITestCase", "line_number": 7, "usage_type": "name" }, { "api_name": "models.Hostel.objects.create", "line_number": 17, "usage_type": "call" }, { "api_name": "models.Hostel.objects", "line_number": 17, "usage_type": "attribute" }, {...
4404586253
import numpy as np import cv2 image = cv2.imread("resource/terminator.jpg") cv2.imshow("Original", image) r = 150.0/image.shape[1] dim = (150, int(image.shape[0]*r)) resized = cv2.resize(image,dim, interpolation=cv2.INTER_AREA) cv2.imshow("Resized (Width)", resized) r = 50.0/image.shape[0] dim = (int(image.shape[1]...
SweiLz/Image_Processing
Practical Python and OpenCV/02_1_3_resizing.py
02_1_3_resizing.py
py
1,030
python
en
code
0
github-code
7
[ { "api_name": "cv2.imread", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.INTER_AREA", "line_number": 10...
71003454622
from rest_framework.urlpatterns import format_suffix_patterns from rest_framework.authtoken.views import obtain_auth_token from django.urls import path, include from . import views urlpatterns = { path('auth/', include('rest_framework.urls', namespace='rest_framework') ), path( 'm...
jpcasa/jpcasabianca-api
api/urls.py
urls.py
py
4,473
python
en
code
0
github-code
7
[ { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.include", "line_number": 10, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 13, "usage_type": "call" }, { "api_name": "django.urls.path...
74897197024
import pytest import requests @pytest.mark.jsonplaceholdertest def test_post_request(): my_obj = { "userId": 1, "id": 1, "title": 'foo', "body": 'bar' } response = requests.put("https://jsonplaceholder.typicode.com/posts/1", data=my_obj) assert response.status_code == ...
allaselenium/apiAutomation
tests/json_placeholder/test_put_request.py
test_put_request.py
py
324
python
en
code
0
github-code
7
[ { "api_name": "requests.put", "line_number": 14, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 5, "usage_type": "attribute" } ]
72223585183
def call(): from Common.Command import IntervalCommand, Command from TradeEngine.GlobleConf import SysWidget, StrategyWidget, Shares from TradeEngine.MonitorClient import Monitor import traceback import json def get_shares_of_strategy(tid, strategy): try: shares = StrategyWi...
algo2019/algorithm
AlgorithmEngine/TradeEngine/RegisterWebCall/GetPosition.py
GetPosition.py
py
1,597
python
en
code
0
github-code
7
[ { "api_name": "TradeEngine.GlobleConf.StrategyWidget.get_shares_mgr", "line_number": 10, "usage_type": "call" }, { "api_name": "TradeEngine.GlobleConf.StrategyWidget", "line_number": 10, "usage_type": "name" }, { "api_name": "TradeEngine.GlobleConf.StrategyWidget.get_account_mgr"...
5206421598
# -*- coding: utf-8 -*- """Functions for pulling data from the USAFacts website.""" from datetime import date import hashlib from logging import Logger import os import numpy as np import pandas as pd import requests # Columns to drop the the data frame. DROP_COLUMNS = [ "countyfips", "county name", "stat...
kosovsky/recruiting-technical-usafacts_error
usafacts/delphi_usafacts/pull.py
pull.py
py
6,707
python
en
code
0
github-code
7
[ { "api_name": "requests.get", "line_number": 26, "usage_type": "call" }, { "api_name": "datetime.date.today", "line_number": 28, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 28, "usage_type": "name" }, { "api_name": "os.makedirs", "lin...
73348671264
# -*- coding: utf-8 -*- from __future__ import unicode_literals, division import gevent.monkey gevent.monkey.patch_all() from gevent.wsgi import WSGIServer import sys from ivr.common.logger import default_config as default_log_config from ivr.common.ws import WSServer from ivr.common.schema import Schema, Use, IntV...
dulton/IVR
ivr/ivc/main.py
main.py
py
6,674
python
en
code
0
github-code
7
[ { "api_name": "gevent.monkey.monkey.patch_all", "line_number": 6, "usage_type": "call" }, { "api_name": "gevent.monkey.monkey", "line_number": 6, "usage_type": "attribute" }, { "api_name": "gevent.monkey", "line_number": 6, "usage_type": "name" }, { "api_name": "i...
33468621460
# coding: utf8 # config.py # 11/1/2012 jichi # # This file must be self-contained. # Be careful of unicode requirement for locations import os ## YAML parsing ## def u_from_native(s): # Following contents are copied from sakurakit.skunicode import locale lc, enc = locale.getdefaultlocale() return s.decode(en...
Dangetsu/vnr
Frameworks/Sakura/py/apps/reader/config.py
config.py
py
19,233
python
en
code
87
github-code
7
[ { "api_name": "locale.getdefaultlocale", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path", "line_number": 26, "usage_type": "attribute" }, { "api_name": "os.path.dirname", ...
23477665407
# Implement a basic gradient descent procedure to minimize scalar functions of a vector argument. # Write it generically, so that you can easily specify the objective function and the function # to compute the gradient. You should be able to specify the initial guess, the step size and the # convergence criterion (a th...
Srinithi-Ramesh/Machine-Learning
PA1/PA1_Final.py
PA1_Final.py
py
19,440
python
en
code
0
github-code
7
[ { "api_name": "math.inf", "line_number": 33, "usage_type": "attribute" }, { "api_name": "collections.Iterable", "line_number": 38, "usage_type": "argument" }, { "api_name": "numpy.subtract", "line_number": 39, "usage_type": "call" }, { "api_name": "math.sin", ...
40553037736
import json from urllib import request moneda="bitcoin" api_key = "b2668cd3e4f820172a995365c6085654" unidades ="metric" url = "ttps://api.blockchain.com/v3/exchange" % (moneda, unidades, api_key) #print (url) response = request.urlopen(url) http_body = response.readline().decode('utf-8') print (http_...
Serg-ux/EjerciciosPython
Sockets/sockets/P4-12-a-blockchain.py
P4-12-a-blockchain.py
py
624
python
es
code
1
github-code
7
[ { "api_name": "urllib.request.urlopen", "line_number": 11, "usage_type": "call" }, { "api_name": "urllib.request", "line_number": 11, "usage_type": "name" }, { "api_name": "json.loads", "line_number": 19, "usage_type": "call" } ]
71081817183
##\file fsmattachdlg.py ##\brief Dialog to set the parent FSMs used by each agent type import wx import pynebula import app import format import fsm import servers import togwin # FSMAttacherDialog class class FSMAttacherDialog(togwin.ChildToggableDialog): """Dialog to set the parent FSMs used ...
xuebai5/TheZombieEngine
zombie/code/conjurer/conjurer/gui/fsmattachdlg.py
fsmattachdlg.py
py
5,768
python
en
code
3
github-code
7
[ { "api_name": "togwin.ChildToggableDialog", "line_number": 16, "usage_type": "attribute" }, { "api_name": "togwin.ChildToggableDialog.__init__", "line_number": 24, "usage_type": "call" }, { "api_name": "togwin.ChildToggableDialog", "line_number": 24, "usage_type": "attrib...
877186615
from django.shortcuts import render from datetime import datetime # Create your views here. def index(request): date = datetime.now() new_year = date.month == 1 and date.day == 1 return render(request, 'newyear/index.html', { 'newyear': new_year })
sibarras/harvardCS50
django/lecture3/newyear/views.py
views.py
py
274
python
en
code
0
github-code
7
[ { "api_name": "datetime.datetime.now", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 6, "usage_type": "name" }, { "api_name": "django.shortcuts.render", "line_number": 9, "usage_type": "call" } ]
25419159604
""" Attempts to gracefully stop a running ondevice daemon After sending the terminate signal, it'll wait for up to five seconds for the daemon to stop. Only if the daemon was running, it'll return 0 Returns: - 0 on success - 1 on exceptions (if you encounter those, let us know) - 2 if the daemon wasn't running - 3 on...
ondevice/ondevice-python
ondevice/commands/stop_cmd.py
stop_cmd.py
py
1,733
python
en
code
3
github-code
7
[ { "api_name": "ondevice.core.daemon.getDaemonPID", "line_number": 31, "usage_type": "call" }, { "api_name": "ondevice.core.daemon", "line_number": 31, "usage_type": "name" }, { "api_name": "sys.stderr.write", "line_number": 33, "usage_type": "call" }, { "api_name"...
21570412513
import matplotlib.pyplot as plt import numpy as np # creating figure and axes fig, ax = plt.subplots(2, 2, sharex=True, sharey=True) # creating x axis axis_len = 2000 phi = np.arange(-np.pi, np.pi, (2*np.pi)/2000) # creating visual blobs blob_widths = [600, 150] offsets = [0, int(axis_len/4)] centers = [int(axis_len...
scioip34/ABM
abm/projects/visual_flocking/vf_utils/blobs_vs_edges.py
blobs_vs_edges.py
py
1,873
python
en
code
3
github-code
7
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 5, "usage_type": "name" }, { "api_name": "numpy.arange", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.pi", ...
29654992166
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from matplotlib import style df = pd.read_csv("forex.csv", index_col='date') df.head() df.index = pd.to_datetime(df.index) #Get Number Of All The Records concerning the USD to EGP Exchange print('Data has '+st...
Hendawyy/forex-analysis-prediction
Forex Analysis.py
Forex Analysis.py
py
4,610
python
en
code
0
github-code
7
[ { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 11, "usage_type": "call" }, { "api_name": "seaborn.set", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.style.use", ...
40090763774
from forms import RegisterForm from django.shortcuts import render_to_response from django.http import HttpResponseRedirect, Http404 from django.core.context_processors import csrf from activation import activate_user def register(request): if request.method == 'POST': form = RegisterForm(request.POST) ...
nesl/Visualizing-Server-Data
Server_data_visualization/accounts/views.py
views.py
py
797
python
en
code
10
github-code
7
[ { "api_name": "forms.RegisterForm", "line_number": 9, "usage_type": "call" }, { "api_name": "django.http.HttpResponseRedirect", "line_number": 12, "usage_type": "call" }, { "api_name": "forms.RegisterForm", "line_number": 14, "usage_type": "call" }, { "api_name": ...
43734750755
from django.shortcuts import render, redirect, get_object_or_404 from django.contrib.auth.forms import UserCreationForm from .forms import CreateUserForm from django.contrib import messages from django.contrib.auth import authenticate, login, logout from django.contrib.auth.decorators import login_required from django....
KojoHero/MainUpdate
MyApp/views.py
views.py
py
3,540
python
en
code
0
github-code
7
[ { "api_name": "django.shortcuts.redirect", "line_number": 14, "usage_type": "call" }, { "api_name": "forms.CreateUserForm", "line_number": 16, "usage_type": "name" }, { "api_name": "forms.CreateUserForm", "line_number": 18, "usage_type": "call" }, { "api_name": "d...
38581899740
import numpy as np import torch from more_itertools import grouper, windowed from dataclasses import dataclass from functools import reduce from itertools import accumulate, chain, groupby from operator import add, sub, itemgetter from pathlib import Path def split_instance(text): url, context, question, answer...
kiendang/bioread
src/bert-qa/preprocess.py
preprocess.py
py
7,729
python
en
code
2
github-code
7
[ { "api_name": "more_itertools.windowed", "line_number": 45, "usage_type": "call" }, { "api_name": "torch.Tensor", "line_number": 66, "usage_type": "attribute" }, { "api_name": "torch.Tensor", "line_number": 67, "usage_type": "attribute" }, { "api_name": "torch.Ten...
31765383252
import argparse import base64 import datetime import json import sys if (2, 6) <= sys.version_info < (3, 0): from httplib import HTTPConnection, HTTPSConnection from urlparse import urlparse else: from http.client import HTTPConnection, HTTPSConnection from urllib.parse import urlparse API_ENDPOINT = ...
WANdisco/livedata-migrator-scripting
schedular/ldm-schedular.py
ldm-schedular.py
py
5,867
python
en
code
3
github-code
7
[ { "api_name": "sys.version_info", "line_number": 7, "usage_type": "attribute" }, { "api_name": "base64.b64encode", "line_number": 36, "usage_type": "call" }, { "api_name": "urllib.parse.urlparse", "line_number": 41, "usage_type": "call" }, { "api_name": "http.clie...
8281616052
# encoding=utf-8 from collections import OrderedDict def soil_results(sample): def level_in_range(value, levels): for max_value, level in levels.iteritems(): if not isinstance(max_value, (int, float)): return level if value < max_value: return leve...
SEL-Columbia/microsites
soillab/result_logic.py
result_logic.py
py
25,192
python
en
code
0
github-code
7
[ { "api_name": "collections.OrderedDict", "line_number": 56, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 84, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 121, "usage_type": "call" }, { "api_name...
27926250221
from django.shortcuts import render, redirect from django.core.exceptions import ObjectDoesNotExist # Translate from django.utils.translation import gettext as _ from .models import Product, Shoe, Accessorie # Create your views here. def index(request): user = request.user last_added = Product.objects.all...
VaheAvetikyan/cattlea
cattlea/apps/core/views.py
views.py
py
1,402
python
en
code
0
github-code
7
[ { "api_name": "models.Product.objects.all", "line_number": 15, "usage_type": "call" }, { "api_name": "models.Product.objects", "line_number": 15, "usage_type": "attribute" }, { "api_name": "models.Product", "line_number": 15, "usage_type": "name" }, { "api_name": ...
39190614517
"""Provides access to secrets stored in a .env file.""" import os as _os from pathlib import Path as _Path from dotenv import load_dotenv as _load_dotenv _load_dotenv() def _get_setting(key: str) -> str: """Retrieve an environment variable.""" return _os.environ.get(key) DCA_TOJUST_NFU_DATABAS...
RoseaghTerrins/Lit_Automation
settings.py
settings.py
py
6,362
python
en
code
0
github-code
7
[ { "api_name": "dotenv.load_dotenv", "line_number": 6, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 11, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "...
6726849947
import numpy as np import utils import kalman_filter import matplotlib.pyplot as plt import os baseDir = os.path.dirname(__file__) def trajectory_simulation(x, y, vx, vy, ax, ay, T): x_t = [] for t in range(T): x_t.append([x+vx*t+0.5*ax*t**2, vx+ax*t, y+vy*t+0.5*ay*t**2, vy+ay*t]) return x_t def ...
coolis/kalman_filter_example
trajectory_simulation.py
trajectory_simulation.py
py
1,766
python
en
code
0
github-code
7
[ { "api_name": "os.path.dirname", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "numpy.random.normal", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.random", "li...
71935705183
r"""Utility functions to mock SCPI device over TCP. Example Usage: MockServerHandler.AddLookup(r'\*CLS', None) SetupLookupTable() SERVER_PORT = 5025 MockTestServer(('0.0.0.0', SERVER_PORT), MockServerHandler).serve_forever() """ import inspect import logging import re import socketserver class MockTestServe...
arccode/factory
py/test/rf/scpi_mock.py
scpi_mock.py
py
2,222
python
en
code
3
github-code
7
[ { "api_name": "socketserver.ThreadingMixIn", "line_number": 16, "usage_type": "attribute" }, { "api_name": "socketserver.TCPServer", "line_number": 16, "usage_type": "attribute" }, { "api_name": "socketserver.StreamRequestHandler", "line_number": 20, "usage_type": "attrib...
39560215226
#!/usr/bin/env python # -*- coding:utf-8 -*- # django项目搭建与Session使用详解 # 前言 # Django完全支持也匿名会话,简单说就是使用跨网页之间可以进行通讯,比如显示用户名,用户是否已经发表评论。session框架让你存储和获取访问者的数据信息,这些信息保存在服务器上(默认是数据库中),以 cookies 的方式发送和获取一个包含 session ID的值,并不是用cookies传递数据本身。 # 本文给大家详细介绍了关于django项目搭建与Session使用的相关内容,分享出来供大家参考学习,下面话不多说了,来一起看看详细的介绍吧 # django+sessio...
isoundy000/learn_python
learn_django/learn_session_0.py
learn_session_0.py
py
4,958
python
zh
code
0
github-code
7
[ { "api_name": "sys.setdefaultencoding", "line_number": 35, "usage_type": "call" }, { "api_name": "django.contrib.sessions.backends.db.SessionStore", "line_number": 44, "usage_type": "call" }, { "api_name": "django.contrib.sessions.models.Session.objects.all", "line_number": 4...
72428693343
# Currently use Namespace variables, Need to add a hyperparameter tuning package from argparse import Namespace args = Namespace() args.description = "Training ..." args.max_epochs = 20 args.data_path = "./data/" # args.limit_train_batches = 0.01 # args.limit_val_batches = 0.01 # args.limit_test_batches = 0.01 args.t...
SurajDonthi/Conformer
conformer/tuner.py
tuner.py
py
428
python
en
code
1
github-code
7
[ { "api_name": "argparse.Namespace", "line_number": 4, "usage_type": "call" } ]
70957024223
# -*- coding: utf-8 -*- """ Created on Wed Dec 14 20:53:05 2016 @author: yamane """ import numpy as np from skimage import draw class RandomCircleSquareDataset(object): def __init__(self, image_size=500, circle_r_min=50, circle_r_max=150, size_min=50, size_max=200, p=[0.3, 0.3, 0.4], output_siz...
YamaneSasuke/correct_aspect_ratio
datasets.py
datasets.py
py
3,222
python
en
code
1
github-code
7
[ { "api_name": "numpy.stack", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.random.choice", "line_number": 39, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 39, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "...
18125111623
"""Define data models for various Ridwell objects.""" from __future__ import annotations from collections.abc import Awaitable, Callable from dataclasses import dataclass, field from datetime import date, datetime from enum import Enum from typing import Any, TypedDict, cast from titlecase import titlecase from .con...
bachya/aioridwell
aioridwell/model.py
model.py
py
7,911
python
en
code
1
github-code
7
[ { "api_name": "enum.Enum", "line_number": 21, "usage_type": "name" }, { "api_name": "typing.TypedDict", "line_number": 43, "usage_type": "name" }, { "api_name": "enum.Enum", "line_number": 52, "usage_type": "name" }, { "api_name": "const.LOGGER.warning", "line...
38872000250
import numpy as np from jax import numpy as jnp from scipy import sparse from jax._src import abstract_arrays from jax._src import ad_util from jax import core from jax.interpreters import ad from jax import lax from jax.experimental import sparse as jsparse from functools import partial ## =========================...
dpsimpson/blog
posts/2022-05-20-to-catch-a-derivative-first-youve-got-to-think-like-a-derivative/python/linalg.py
linalg.py
py
15,032
python
en
code
0
github-code
7
[ { "api_name": "jax.core.Primitive", "line_number": 16, "usage_type": "call" }, { "api_name": "jax.core", "line_number": 16, "usage_type": "name" }, { "api_name": "scipy.sparse.csc_array", "line_number": 25, "usage_type": "call" }, { "api_name": "scipy.sparse", ...
27409135440
from setuptools import find_packages from setuptools import setup package_name = 'jetbot_base' setup( name=package_name, version='0.14.0', packages=find_packages(exclude=['test']), data_files=[ ('share/ament_index/resource_index/packages', ['resource/' + package_name]), ('s...
kyopark2014/aws-robomaker
cloud-connected-robots/building-cloud-connected-robots-reinvent2021/robot_ws/src/jetbot_base/setup.py
setup.py
py
1,382
python
en
code
1
github-code
7
[ { "api_name": "setuptools.setup", "line_number": 6, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 9, "usage_type": "call" } ]
35771312564
import numpy as np import pandas as pd import matplotlib.pyplot as plt import os import glob import cv2 cwd = os.getcwd() def Seperate(loadfile,savefolder): img = cv2.imread(loadfile + ".jpg",0) img = 255 - img ydone = False start_ypoints_crop = [] end_ypoints_crop = [] for row in range(len(...
shahab1376/Persian-MNIST
main.py
main.py
py
4,373
python
en
code
0
github-code
7
[ { "api_name": "os.getcwd", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.copyMakeBorder", "line_number": 48, "usage_type": "call" }, { "api_name": "cv2.BORDER_CONSTANT", "lin...
30753273441
from django.db import models from shop.models import Electronic,Jewellery,Fashion from django.contrib.auth.models import User from django.utils import timezone from .ultis.genirite_code import genirite_code # Create your models here. ORDER_STATUS=( ('Recevied','Recevied'), ('Processed','Processed'), ('Sh...
ehsanmorgan/create-shopping-app-using-django
order/models.py
models.py
py
1,422
python
en
code
1
github-code
7
[ { "api_name": "django.db.models.Model", "line_number": 16, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 16, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 17, "usage_type": "call" }, { "api_name"...
21674741331
import json import uuid from google.cloud import firestore with open('artists.json') as data_file: artists = json.load(data_file) db = firestore.Client() for artist in artists: artist["id"] = str(uuid.uuid4()) doc_ref = db.collection(u'artists').document(artist["id"]) doc_ref.set(artist)
comiko-app/data_importer_firestore
import_artists.py
import_artists.py
py
309
python
en
code
1
github-code
7
[ { "api_name": "json.load", "line_number": 6, "usage_type": "call" }, { "api_name": "google.cloud.firestore.Client", "line_number": 8, "usage_type": "call" }, { "api_name": "google.cloud.firestore", "line_number": 8, "usage_type": "name" }, { "api_name": "uuid.uuid...
33935051226
#!/usr/bin/env python2.7 import cauv import cauv.messaging as messaging import cauv.pipeline as pipeline import cauv.node from utils.control import PIDController from utils.timeaverage import TimeAverage from cauv.debug import debug, info, warning, error import AI import threading from math import degrees, cos, sin,...
lixiii/CAUV_old_software
auv/scripting/script_library/follow_pipe.py
follow_pipe.py
py
10,185
python
en
code
0
github-code
7
[ { "api_name": "AI.Script", "line_number": 17, "usage_type": "attribute" }, { "api_name": "AI.Script", "line_number": 18, "usage_type": "attribute" }, { "api_name": "threading.Event", "line_number": 61, "usage_type": "call" }, { "api_name": "threading.Event", "...
19366194145
import os from collections import Counter #собираем пути и приводим их к виду 'папка?расширение' #символ '?' нужен для того, чтобы потом отделить имя папки от расширения def collect_paths(): dir_ext = [] start_path = '.' for root, dirs, files in os.walk(start_path): for file in files: ...
kayajiva/HSE-Programming1
hw13/6 вариант. 20.05.2018.py
6 вариант. 20.05.2018.py
py
1,632
python
ru
code
0
github-code
7
[ { "api_name": "os.walk", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.path.split", "line_number": ...
26243754894
#/usr/bin/env python import datetime import logging import random import time from slackclient import SlackClient NUDGE_TEXT = ['hello?', 'any news?', 'could you please click one of the buttons?', 'still there?'] class SlackWorker(object): """ Iterates over tickets, creates/opens conversations...
sy-bee/talktome
lib/messaging.py
messaging.py
py
6,440
python
en
code
0
github-code
7
[ { "api_name": "slackclient.SlackClient", "line_number": 18, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 33, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 33, "usage_type": "attribute" }, { "api_name": "...
39295529835
import os import json from _thread import start_new_thread from gi.repository import GLib, Gtk, GdkPixbuf, Notify from .ChatController import ChatController from .CreateTeamController import CreateTeamController from .SearchChannelsController import SearchChannelsController from Mattermost.ChannelModel import Channe...
addiks/gmattermost
src/Controller/TeamController.py
TeamController.py
py
13,795
python
en
code
0
github-code
7
[ { "api_name": "Mattermost.ChannelModel.ChannelModel", "line_number": 59, "usage_type": "name" }, { "api_name": "Mattermost.ChannelModel.ChannelModel", "line_number": 62, "usage_type": "name" }, { "api_name": "ChatController.ChatController", "line_number": 70, "usage_type"...
16066737079
# -*- coding: utf-8 -*- import numpy as np import copy import skimage.io as io import os import sys from skimage import morphology from skimage.morphology import watershed from skimage import transform from scipy import ndimage from argparse import ArgumentParser from utils import Utils class Evaluator(): def __i...
funalab/QCANet
src/lib/evaluation.py
evaluation.py
py
5,993
python
en
code
31
github-code
7
[ { "api_name": "numpy.array", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 23, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_numb...
10479986371
# encoding: utf-8 import ntpath import os import numpy as np import PIL import pytest from histolab.exceptions import LevelError, SlidePropertyError from histolab.masks import BiggestTissueBoxMask, TissueMask from histolab.slide import Slide from ..fixtures import EXTERNAL_SVS, SVS from ..unitutil import on_ci from...
sarthakpati/histolab
tests/integration/test_slide.py
test_slide.py
py
6,867
python
en
code
null
github-code
7
[ { "api_name": "histolab.slide.Slide", "line_number": 21, "usage_type": "call" }, { "api_name": "fixtures.SVS.CMU_1_SMALL_REGION", "line_number": 22, "usage_type": "attribute" }, { "api_name": "fixtures.SVS", "line_number": 22, "usage_type": "name" }, { "api_name":...
37381223621
import contextlib import datetime import os import sqlite3 import openpyxl from dotenv import load_dotenv class FileFormatError(Exception): pass def validate_row( row, type_mask=( (int, float), str, (int, float), (int, float), (int, float), (int, float), (int, float), (i...
IBA20/matcher_tt
parser.py
parser.py
py
4,185
python
en
code
0
github-code
7
[ { "api_name": "openpyxl.load_workbook", "line_number": 31, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 61, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 64, "usage_type": "call" }, { "api_name": "dotenv.load_d...
28862655507
# vim: set fileencoding=utf8: from setuptools import setup, find_packages version = '0.1.0' def read(filename): import os.path return open(os.path.join(os.path.dirname(__file__), filename)).read() setup( name="django-packageutils", version=version, description = "Utility collection of Django packa...
lambdalisue/django-packageutils
setup.py
setup.py
py
1,163
python
en
code
5
github-code
7
[ { "api_name": "os.path.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path", "line_number": 8, "usage_type": "name" }, { "api_name": "os.path.path.dirname", "...
6553280388
#!/usr/bin/env python3 import os import argparse import logging import warnings from common import (start_container, stop_container, run_in_container, get_container_id, container_mkdir, container_log, copy_log_from_container, image_name, copy_git_to_container, copy_to_container) warnings.filterwar...
mminichino/host-prep-lib
tests/test_m.py
test_m.py
py
4,333
python
en
code
0
github-code
7
[ { "api_name": "warnings.filterwarnings", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", ...
22071726151
from decimal import Decimal from typing import Union from django.conf import settings from django.http import HttpRequest from apps.coupons.models import Coupon from apps.shop.models import Product class Cart: """ Class representing a shopping cart for a user. Attributes: - session: session data fo...
ch4zzy/online-shop
apps/cart/cart.py
cart.py
py
5,083
python
en
code
0
github-code
7
[ { "api_name": "django.http.HttpRequest", "line_number": 35, "usage_type": "name" }, { "api_name": "django.conf.settings.CART_SESSION_ID", "line_number": 43, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 43, "usage_type": "name" }, {...
28465901879
from collections import deque class MyQueue: def __init__(self): self.input = deque() self.output = deque() def push(self, x: int) -> None: self.input.append(x) def pop(self) -> int: if self.empty(): return -1 if len(self.output) == 0: ...
JianLiu666/StudyNote-DSA
leetcode/p00232/p00232.py
p00232.py
py
953
python
en
code
1
github-code
7
[ { "api_name": "collections.deque", "line_number": 6, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 7, "usage_type": "call" } ]
37482701324
import torch def pos_int_to_base(x, b=2, extend_zero_to_length=0): if x == 0: return [0] out = [] cur = x while cur > 0: out.append(int(cur % b)) cur = int(cur / b) if extend_zero_to_length>0 and len(out) < extend_zero_to_length: out += [0]*(extend_zero_to_length - len(out)) return out[::-1] def compute...
siyucosmo/ML-Recon
periodic_padding.py
periodic_padding.py
py
2,033
python
en
code
131
github-code
7
[ { "api_name": "torch.nn.ConstantPad3d", "line_number": 39, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 39, "usage_type": "attribute" }, { "api_name": "torch.rand", "line_number": 62, "usage_type": "call" } ]
27363448472
import numpy as np import time import pickle import json from copy import deepcopy from pycvi.cluster import compute_cluster_params, prepare_data from typing import List, Sequence, Tuple, Union, Any, Dict from . import Vertex from . import Edge from . import Component from ._set_default_properties import ( _set_m...
nglm/persigraph
persigraph/persistentgraph/persistentgraph.py
persistentgraph.py
py
29,333
python
en
code
0
github-code
7
[ { "api_name": "numpy.ndarray", "line_number": 29, "usage_type": "attribute" }, { "api_name": "numpy.ndarray", "line_number": 30, "usage_type": "attribute" }, { "api_name": "numpy.ndarray", "line_number": 32, "usage_type": "attribute" }, { "api_name": "_set_default...
30090261214
import os from dotenv import load_dotenv import ptbot as alien_bot from pytimeparse import parse def start_countdown(chat_id, text): time = parse(text) message_id = bot.send_message(chat_id, f'Осталось {time}') bot.create_countdown( time, update_telegram_message, chat_id=chat_id, ...
DrSleep16/timer_in_telegram
main.py
main.py
py
1,345
python
en
code
0
github-code
7
[ { "api_name": "pytimeparse.parse", "line_number": 8, "usage_type": "call" }, { "api_name": "dotenv.load_dotenv", "line_number": 43, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 44, "usage_type": "call" }, { "api_name": "ptbot.Bot", "line_n...
74952069984
#!/usr/bin/env python # -*- coding: UTF-8 -*- '''================================================= @Project -> File :qiyangPythonCrawler -> start @IDE :PyCharm @Author :Mr. cyh @Date :2021-05-31 10:41 @Desc :https://www.chyxx.com/minglu/list_12832.html ==================================================''' impo...
j38472/qiyangPythonCrawler
产业信息网_end/start.py
start.py
py
4,832
python
en
code
0
github-code
7
[ { "api_name": "myJDBC.jdbc.mySqlJdbc", "line_number": 19, "usage_type": "call" }, { "api_name": "fake_useragent.UserAgent", "line_number": 21, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 65, "usage_type": "call" }, { "api_name": "time.time",...
5169361376
import scipy.io as io import numpy as np self = io.netcdf.netcdf_file('/home/hendrik/data/global/AHF_2005_2.5min.nc','r') self.fp.seek(0) magic = self.fp.read(3) self.__dict__['version_byte'] = np.fromstring(self.fp.read(1), '>b')[0] # Read file headers and set data. # stolen from scipy: /usr/lib/python2.7/dist-pack...
hendrikwout/pynacolada
trash/raw_read_nc.py
raw_read_nc.py
py
570
python
en
code
1
github-code
7
[ { "api_name": "scipy.io.netcdf.netcdf_file", "line_number": 5, "usage_type": "call" }, { "api_name": "scipy.io.netcdf", "line_number": 5, "usage_type": "attribute" }, { "api_name": "scipy.io", "line_number": 5, "usage_type": "name" }, { "api_name": "numpy.fromstri...
6792461740
import boto3 import sys db = sys.argv[1] rds = boto3.client('rds') try: resp = rds.delete_db_instance( DBInstanceIdentifier = db, SkipFinalSnapshot = True ) print(resp) except Exception as e: print(e)
Pawel22729/aws
python_aws/scripts/delete_db_instance.py
delete_db_instance.py
py
237
python
en
code
0
github-code
7
[ { "api_name": "sys.argv", "line_number": 3, "usage_type": "attribute" }, { "api_name": "boto3.client", "line_number": 4, "usage_type": "call" } ]
12256443447
from trped_main import MainWindow as trpedmw from aiced_main import MainWindow as aicedmw from stged_main import MainWindow as stgedmw from UI.ucpre_allinone import Ui_MainWindow as LauncherMain from PyQt5 import QtWidgets from PyQt5.QtCore import pyqtSlot import sys class UCPAllInOne(QtWidgets.QMainWindow, LauncherM...
CIO61/ucp_re_gui
ucpre_allinone.py
ucpre_allinone.py
py
1,191
python
en
code
3
github-code
7
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 10, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidgets", "line_number": 10, "usage_type": "name" }, { "api_name": "UI.ucpre_allinone.Ui_MainWindow", "line_number": 10, "usage_type": "name" }, { "...
34357830457
from django.shortcuts import redirect, render from store.models import Customer from store.models import Product from store.models import Order from django.views import View class Checkout(View): def get(self, request): # if customer is already logged in if request.session.get('customer_id'): ...
Sachin-Kahandal/eshop
store/views/checkout.py
checkout.py
py
1,152
python
en
code
0
github-code
7
[ { "api_name": "django.views.View", "line_number": 8, "usage_type": "name" }, { "api_name": "store.models.Customer.objects.get", "line_number": 16, "usage_type": "call" }, { "api_name": "store.models.Customer.objects", "line_number": 16, "usage_type": "attribute" }, { ...
19087776548
import asyncio import pandas as pd import aiohttp import matplotlib.pyplot as plt from io import BytesIO from openpyxl import Workbook from openpyxl.utils.dataframe import dataframe_to_rows from openpyxl.drawing.image import Image async def is_url_accessible(session, url): try: async with session.get(url)...
razvan233/exadel-ml
check_urls_and_generate_stats.py
check_urls_and_generate_stats.py
py
2,320
python
en
code
0
github-code
7
[ { "api_name": "aiohttp.ClientError", "line_number": 15, "usage_type": "attribute" }, { "api_name": "aiohttp.ClientSession", "line_number": 20, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 21, "usage_type": "call" }, { "api_name": "asynci...
30026456962
import json import pprint import certifi import mt940 import pymongo import xmltodict from flask import Flask, render_template, request, flash, redirect, url_for, session from flask_login import LoginManager, login_user, current_user, login_required from flask_table import Table, Col from flask_wtf import FlaskForm fr...
Rares-001/sport_accounting_
app.py
app.py
py
8,793
python
en
code
0
github-code
7
[ { "api_name": "flask.Flask", "line_number": 22, "usage_type": "call" }, { "api_name": "flask_login.LoginManager", "line_number": 29, "usage_type": "call" }, { "api_name": "database.db.init_app", "line_number": 32, "usage_type": "call" }, { "api_name": "database.db...
6976742733
import pytest from ItsPrompt.data.expand import ExpandOption, process_data def test_process_data_standard_options(): options = ("first", "second", "third") result = [ ExpandOption("f", "first", "first", False), ExpandOption("s", "second", "second", False), ExpandOption("t", "third", ...
TheItsProjects/ItsPrompt
tests/data/test_expand.py
test_expand.py
py
1,750
python
en
code
24
github-code
7
[ { "api_name": "ItsPrompt.data.expand.ExpandOption", "line_number": 10, "usage_type": "call" }, { "api_name": "ItsPrompt.data.expand.ExpandOption", "line_number": 11, "usage_type": "call" }, { "api_name": "ItsPrompt.data.expand.ExpandOption", "line_number": 12, "usage_type...
41075968355
import logging from datetime import datetime from sqlalchemy import asc from ibm import get_db_session from ibm.models import DisasterRecoveryBackup, DisasterRecoveryResourceBlueprint, WorkflowRoot, WorkflowTask from ibm.tasks.celery_app import celery_app LOGGER = logging.getLogger(__name__) @celery_app.task(name="...
talha927/cloud-ibm-test
ibm/tasks/draas_tasks/schedule_backup_tasks.py
schedule_backup_tasks.py
py
5,159
python
en
code
0
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "ibm.get_db_session", "line_number": 19, "usage_type": "call" }, { "api_name": "ibm.models.DisasterRecoveryResourceBlueprint", "line_number": 20, "usage_type": "argument" }, { ...
72864057182
import bisect import torch import torch.utils.data as data from alphapose.models.builder import DATASET, build_dataset @DATASET.register_module class ConcatDataset(data.Dataset): """Custom Concat dataset. Annotation file must be in `coco` format. Parameters ---------- train: bool, default is Tr...
Ascend/ModelZoo-PyTorch
PyTorch/contrib/cv/pose_estimation/AlphaPose/alphapose/datasets/concat_dataset.py
concat_dataset.py
py
2,416
python
en
code
31
github-code
7
[ { "api_name": "torch.utils.data.Dataset", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.utils.data", "line_number": 10, "usage_type": "name" }, { "api_name": "alphapose.models.builder.build_dataset", "line_number": 41, "usage_type": "call" }, { ...
34965426079
from src.settings import Settings from src.audio_devices import get_devices import sounddevice import soundfile import threading import numpy as np from logging import info from os import path BLOCK_SIZE = 1024 class InvalidDeviceIDError(Exception): def __init__(self, id: "int") -> None: su...
IMatynia/epicki-soundboard-v3
src/audio_handle.py
audio_handle.py
py
4,480
python
en
code
0
github-code
7
[ { "api_name": "threading.Thread", "line_number": 18, "usage_type": "attribute" }, { "api_name": "threading.Thread.__init__", "line_number": 35, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 35, "usage_type": "attribute" }, { "api_name": ...
72869463262
import argparse, json, os from imageio import imwrite import torch from sg2im.model import Sg2ImModel from sg2im.data.utils import imagenet_deprocess_batch import sg2im.vis as vis parser = argparse.ArgumentParser() parser.add_argument('--checkpoint', default='sg2im-models/vg128.pt') parser.add_argument('--scene_gra...
Ascend/ModelZoo-PyTorch
PyTorch/dev/cv/image_classification/SG2IM_ID0786_for_PyTorch/scripts/run_model.py
run_model.py
py
2,401
python
en
code
31
github-code
7
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os.path.isdir", ...
41134349339
from django.shortcuts import render from django.contrib.auth import logout , login , authenticate from django.http import Http404, HttpResponseRedirect , HttpResponse from django.urls import reverse , NoReverseMatch from django.contrib.auth.decorators import login_required from .forms import LoginFrom , RegisterationFo...
Ai7mn/Mi-nest-eCommerce
myecommerce/accounts/views.py
views.py
py
6,775
python
en
code
0
github-code
7
[ { "api_name": "django.conf.settings.AUTH_USER_MODEL", "line_number": 23, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 23, "usage_type": "name" }, { "api_name": "django.contrib.auth.logout", "line_number": 27, "usage_type": "call" }, ...
34128811928
#!/usr/bin/python import sys from math import * from numpy import linspace from scipy import interpolate import pylab scalefactor = 0.5 * 27.1 def f(x,y): return 0.5*x + sin(y) # Prepend p to the string s until its length is at least n. def pad(s, p, n): x = s while len(x) < n: x = p + x ret...
bptripp/nengo-FPGA
interpolate_rom_pc_2d.py
interpolate_rom_pc_2d.py
py
1,583
python
en
code
1
github-code
7
[ { "api_name": "sys.stderr.write", "line_number": 29, "usage_type": "call" }, { "api_name": "sys.stderr", "line_number": 29, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 48, "usage_type": "attribute" }, { "api_name": "scipy.interpolate.inte...
37915463058
''' xlwt写入Excel步骤 1.创建工作簿 2.创建工作表 3.填充工作表内容 4.保存 ''' import xlwt # 1.创建工作簿 wb=xlwt.Workbook() # 2.创建工作表 ws=wb.add_sheet("CNY") # 3.填充工作表内容 '''合并单元格 >>> help (xlwt.Worksheet) write_merge(self, r1, r2, c1, c2, label='', style=<xlwt.Style.XFStyle object at 0x0000018769444E50>) ''' ...
zhusl/mukewang_python_automation
practice/ch3-xlrd+xlwt读取写入Excel数据/3-7写入Excel/2写入数据/index.py
index.py
py
1,230
python
zh
code
1
github-code
7
[ { "api_name": "xlwt.Workbook", "line_number": 10, "usage_type": "call" } ]
6207825063
#!/usr/bin/env python3 import sys,os import numpy as np import argparse import json import time import glob from mpi4py import MPI sys.path.append(os.path.dirname(os.path.realpath(__file__))+'/mpi_learn_src') from mpi_learn.train.algo import Algo from mpi_learn.train.data import H5Data from mpi_learn.utils import imp...
vlimant/mpi_opt
OptimizeCNN.py
OptimizeCNN.py
py
3,667
python
en
code
2
github-code
7
[ { "api_name": "sys.path.append", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_num...
27576722435
##################################################################################################################### # Neural Network Backpropagation # The neural network has two hidden layers # # Below are the meaning of symbols: # train - training dataset - can be a link to a URL or a local file # - y...
mehtadhruv1/Backpropagation-algorithm-Neural-Networks
neural_network.py
neural_network.py
py
12,061
python
en
code
0
github-code
7
[ { "api_name": "sklearn.preprocessing.StandardScaler", "line_number": 25, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 38, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 45, "usage_type": "call" ...
34728969847
import importlib import time import re from sys import argv from typing import Optional from LaylaRobot import ( ALLOW_EXCL, CERT_PATH, DONATION_LINK, LOGGER, OWNER_ID, PORT, SUPPORT_CHAT, TOKEN, URL, WEBHOOK, SUPPORT_CHAT, dispatcher, StartTime, telethn, pbo...
QueenArzoo/LaylaRobot
LaylaRobot/__main__.py
__main__.py
py
26,261
python
en
code
62
github-code
7
[ { "api_name": "telegram.InlineKeyboardButton", "line_number": 84, "usage_type": "call" }, { "api_name": "telegram.InlineKeyboardButton", "line_number": 88, "usage_type": "call" }, { "api_name": "telegram.InlineKeyboardButton", "line_number": 89, "usage_type": "call" }, ...
44735893499
import pygame from pygame.draw import * import colors as cl pygame.init() win = pygame.display.set_mode((500, 500)) x = 50 y = 50 width = 40 height = 60 speed = 5 isJump = False Jumpcount = 10 run = True while run: pygame.time.delay(50) for event in pygame.event.get(): if event.type == pygame.QUIT: ...
F4lanker/pycharm_files
Pygame/Test.py
Test.py
py
802
python
en
code
0
github-code
7
[ { "api_name": "pygame.init", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pygame.time.dela...
36320564742
from django.core.cache import cache from django.shortcuts import render, get_object_or_404 from django_redis import get_redis_connection from .models import Image # Create your views here. con = get_redis_connection("default") def index(request): query = Image.objects.all() images_seq = [ {'id': da...
twtrubiks/django-docker-redis-tutorial
images/views.py
views.py
py
1,200
python
en
code
41
github-code
7
[ { "api_name": "django_redis.get_redis_connection", "line_number": 9, "usage_type": "call" }, { "api_name": "models.Image.objects.all", "line_number": 13, "usage_type": "call" }, { "api_name": "models.Image.objects", "line_number": 13, "usage_type": "attribute" }, { ...
73348195424
import numpy as np import matplotlib.pyplot as plt import sys,os from TicTacToe import TicTacToe class TicTacToeAI: def __init__(self, cycles, gamesPerRound = 10, movesPerGame = 30, numberOfRandomTest = 100, numChildren = 10, layers= 1, sigma = 0.1, filename = "defaultAI.npy",seed = 0): try: ...
dulte/Div
TicTacToe/TicTacToeAI.py
TicTacToeAI.py
py
9,386
python
en
code
0
github-code
7
[ { "api_name": "numpy.load", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.random.normal", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.random", "line_nu...
26045622798
# ------------------------------------------------------------ # File to save events on date input by user into calendar.txt # ------------------------------------------------------------ from __future__ import print_function import datetime import os.path import numbers import time from google.auth.transport.re...
ohio-software-development/RustGoogleTUI
RustTUIOUSDC/src/calendar_date.py
calendar_date.py
py
3,412
python
en
code
0
github-code
7
[ { "api_name": "os.path.chdir", "line_number": 34, "usage_type": "call" }, { "api_name": "os.path", "line_number": 34, "usage_type": "name" }, { "api_name": "pathlib.Path.home", "line_number": 34, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_numb...
23318005983
#!/usr/bin/env python """ CMSC733 Spring 2019: Classical and Deep Learning Approaches for Geometric Computer Vision Homework 0: Alohomora: Phase 2 Starter Code Author(s): Nitin J. Sanket (nitinsan@terpmail.umd.edu) PhD Candidate in Computer Science, University of Maryland, College Park """ import tens...
ykwang11/End-To-End-Deep-Homography-Estimation-With-Differential-RANSAC
Code/Test.py
Test.py
py
6,947
python
en
code
1
github-code
7
[ { "api_name": "sys.dont_write_bytecode", "line_number": 37, "usage_type": "attribute" }, { "api_name": "glob.glob", "line_number": 50, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 68, "usage_type": "call" }, { "api_name": "cv2.cvtColor", ...
71742257824
from datetime import datetime class Greeter: def __init__(self, name, store) -> None: self.name = name self.store = store def _day(self): return datetime.now().strftime('%A') def _part_of_day(self): hour = datetime.now().hour if (hour < 12): return 'Morning' elif (hour < 17): ...
yen102/practices-of-the-python-pro
chap03/greet.py
greet.py
py
626
python
en
code
0
github-code
7
[ { "api_name": "datetime.datetime.now", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 9, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime....
26904972888
#!/usr/bin/env python3 """ The basic plan: 1. Due to memory constraints, train up a model one day at a time. 2. Load up one day's data. Use online training with xgboost to update the model. 3. Validate using the final month's worth of data. """ import glob import re import matplotlib matplotlib.use("agg") import m...
captainceramic/jane-kaggle
archive/jane-street-comp.py
jane-street-comp.py
py
4,162
python
en
code
0
github-code
7
[ { "api_name": "matplotlib.use", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.int", "line_number": 36, "usage_type": "attribute" }, { "api_name": "glob.glob", "line_n...
2786849892
import bs4 as bs import requests import time import datetime as dt import pickle from secret_information import STOCK_API_KEY ERROR_VALUE = 0.0001 #This is the value that gets added to our data if we cannot find what we are looking for. wiki_response = requests.get('http://en.wikipedia.org/wiki/List_of_S%26P...
Harry-Andrews/Monthly-Value-Stock-Finder
data_collection.py
data_collection.py
py
5,090
python
en
code
0
github-code
7
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 11, "usage_type": "call" }, { "api_name": "secret_information.STOCK_API_KEY", "line_number": 54, "usage_type": "name" }, { "api_name": "time....
32286651445
import ast from dataclasses import dataclass from pathlib import Path from sphinx.application import Sphinx from sphinx.util.logging import getLogger logger = getLogger(__name__) @dataclass class Example: path: Path source_folder: Path name: str = "" reference: str = "" summary: str = "" cat...
bryanwweber/sphinx-gooey
src/sphinx_gooey/default.py
default.py
py
2,314
python
en
code
0
github-code
7
[ { "api_name": "sphinx.util.logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 13, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 14, "usage_type": "name" }, { "api_name": "dataclasses.da...