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
11880730133
#!/usr/bin/python import argparse import time import struct import socket import select import sys class PingOptions(object): def __init__(self): """Reset the class; indicates the class hasn't been initailized""" self.initialized = False def initialize(self, parser): parser.add_argum...
jansona/MyPingGUI
src/main/python/MyPing/opts.py
opts.py
py
1,425
python
en
code
0
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 25, "usage_type": "call" }, { "api_name": "argparse.ArgumentDefaultsHelpFormatter", "line_number": 25, "usage_type": "attribute" } ]
71688402345
__author__ = 'vamsee' import geojson as geo Center = (-83.79706,42.268138) Center_Point = geo.Point(Center) def get_locations(filename,lat_idx,long_idx, write_filename,point_properties): opened_file = open(filename) features_list = [] for line in opened_file: line_contents = line.split(',') ...
vamseedhar-reddyvari/Connected-Vehicles
scripts/rse-locations.py
rse-locations.py
py
1,254
python
en
code
0
github-code
36
[ { "api_name": "geojson.Point", "line_number": 6, "usage_type": "call" }, { "api_name": "geojson.Feature", "line_number": 14, "usage_type": "call" }, { "api_name": "geojson.Point", "line_number": 14, "usage_type": "call" }, { "api_name": "geojson.FeatureCollection"...
37215521511
import pymc as pm import numpy as np x = np.random.normal(loc=0, scale=1, size=10) # Data Placeholder y = np.random.normal(loc=2*x, scale=1, size=10) # Data Placeholder with pm.Model() as model: # Priors α = pm.Normal("α", 1, 2) β = pm.Normal("β", -1, 2) σ = pm.Exponential("σ", 3) # Linear Model μ = pm.Deter...
pbrowne88/pykrusch
examples/simple_model.py
simple_model.py
py
587
python
en
code
0
github-code
36
[ { "api_name": "numpy.random.normal", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 4, "usage_type": "attribute" }, { "api_name": "numpy.random.normal", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.random",...
3520925666
#!/usr/bin/env python import math import copy import matplotlib.pyplot as plt def plot_obstacles(previous_obstacles, new_obstacles, updated_obstacles, updated_labels): # Extract x and y coordinates from the obstacles lists prev_x, prev_y, new_x, new_y, updated_x, updated_y = [], [],[],[],[],[] if len(pr...
husamhamu/ps_robotik
update_obstacles_approach.py
update_obstacles_approach.py
py
5,081
python
en
code
1
github-code
36
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 18, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 18, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.scatter", "line_number": 23, "usage_type": "call" }, { "api_name": "...
20142637580
import os, sys, argparse os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' import numpy as np import pandas as pd import tensorflow as tf import tensorflow.keras.backend as K from tensorflow.keras.layers import Add, Concatenate, Dense, Embedding, Flatten, Input, InputLayer, Lambda, Layer, Reshape, Subtract tf.keras.backend.set...
zachglick/directional-mpnn
train.py
train.py
py
4,767
python
en
code
6
github-code
36
[ { "api_name": "os.environ", "line_number": 2, "usage_type": "attribute" }, { "api_name": "tensorflow.keras.backend.set_floatx", "line_number": 9, "usage_type": "call" }, { "api_name": "tensorflow.keras", "line_number": 9, "usage_type": "attribute" }, { "api_name":...
625334349
import os import time import aiofiles import aiohttp import asyncio from retrying import retry class Spider(object): """ 下载路径在实例化时候指定,比如:r'd:\test\\',这个目录如果不存在,会出错。 默认路径为当前文件下的downpic目录,此目录如果不存在会自动生成 """ def __init__(self, down_path='', ): self.headers = { 'User-Agent': 'Mozi...
chenxy2022/long
yituhuitu.py
yituhuitu.py
py
5,707
python
en
code
0
github-code
36
[ { "api_name": "os.listdir", "line_number": 24, "usage_type": "call" }, { "api_name": "os.mkdir", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path", "line_number": 26, ...
733407856
import sqlite3 import pandas as pd from sklearn.metrics.pairwise import cosine_similarity def get_latent_dataframe(): conn = sqlite3.connect('db/latent_features.db') # Load the DataFrame from the database latent_df = pd.read_sql_query('SELECT * FROM latent_features', conn,index_col='index') conn.close(...
haris-bit/TMDB
util.py
util.py
py
3,156
python
en
code
0
github-code
36
[ { "api_name": "sqlite3.connect", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.read_sql_query", "line_number": 8, "usage_type": "call" }, { "api_name": "sklearn.metrics.pairwise.cosine_similarity", "line_number": 18, "usage_type": "call" }, { "ap...
1188276033
import json from fastapi.testclient import TestClient from sqlalchemy.orm import Session from app import config class TestNodeInfoNodeInfo: # テスト対象API apiurl = "/NodeInfo" # <正常系1> # 通常参照 def test_nodeinfo_normal_1(self, client: TestClient, session: Session): resp = client.get(self.apiu...
BoostryJP/ibet-Wallet-API
tests/app/node_info_NodeInfo_test.py
node_info_NodeInfo_test.py
py
3,543
python
en
code
9
github-code
36
[ { "api_name": "fastapi.testclient.TestClient", "line_number": 15, "usage_type": "name" }, { "api_name": "sqlalchemy.orm.Session", "line_number": 15, "usage_type": "name" }, { "api_name": "json.load", "line_number": 18, "usage_type": "call" }, { "api_name": "json.l...
16636321945
from torch import nn __all__ = ["DropPath"] def drop_path(x, drop_prob: float = 0.0, training: bool = False, scale_by_keep: bool = True): """Drop paths (Stochastic Depth) per sample (when applied in main path of residual blocks). This is the same as the DropConnect impl I created for EfficientNet, etc netwo...
BloodAxe/pytorch-toolbelt
pytorch_toolbelt/modules/drop_path.py
drop_path.py
py
1,579
python
en
code
1,447
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 26, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 26, "usage_type": "name" } ]
32120333326
import scrapy from scrapy.loader import ItemLoader from goodreads.items import QuoteItem # used to filter the data class GoodReadsSpider(scrapy.Spider): #identity name = 'goodreads' #request def start_requests(self): url = 'https://www.goodreads.com/quotes?page=1' yield scrapy.Reque...
Karthiindia90/Goodreads
goodreads/spiders/goodreads.py
goodreads.py
py
1,593
python
en
code
0
github-code
36
[ { "api_name": "scrapy.Spider", "line_number": 6, "usage_type": "attribute" }, { "api_name": "scrapy.Request", "line_number": 14, "usage_type": "call" }, { "api_name": "scrapy.loader.ItemLoader", "line_number": 20, "usage_type": "call" }, { "api_name": "goodreads.i...
31352736355
# For data loading from scipy.io import loadmat # For splitting the data into test, train, validation splits from sklearn.model_selection import train_test_split # For manipulation of the arrays import numpy as np # For file manipulation and locating import os # For plotting import json # For showing progress from tqdm...
martinferianc/PatternRecognition-EIE4
Coursework 2/pre_process.py
pre_process.py
py
8,332
python
en
code
1
github-code
36
[ { "api_name": "numpy.random.choice", "line_number": 43, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 43, "usage_type": "attribute" }, { "api_name": "seaborn.set", "line_number": 45, "usage_type": "call" }, { "api_name": "pandas.DataFrame", ...
29719398042
# # Hot Wire RNN #%% import tensorflow as tf import numpy as np import matplotlib.pyplot as plt import time #%% #Import data, U for velocity and sample rate as frequency import h5py with h5py.File('../resource/asnlib/publicdata/hot_wire_data.mat', 'r') as f: U = list(f['U']) freq = list(f['samp_rate']) #%% ...
nathanboachie/sw_projects
src_deeplearningtf/wire_rnn_lstm_tf.py
wire_rnn_lstm_tf.py
py
3,546
python
en
code
0
github-code
36
[ { "api_name": "h5py.File", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 21, "usage_type": "call" }, { "api_name": "tensorflow.data.Dataset.from_tensor_slices", "line_number": 36, "usage_type": "call" }, { "api_name": "ten...
25734461539
import discord import os from discord.ext import commands from asyncio import sleep from dotenv import load_dotenv from cogs.giveaway import giveaway from cogs.polls import Polls load_dotenv() intents = discord.Intents.default() intents.members = True prefix = commands.when_mentioned_or('-') bot = commands.Bot(comma...
tyler7kehoe/Argus
bot.py
bot.py
py
1,489
python
en
code
0
github-code
36
[ { "api_name": "dotenv.load_dotenv", "line_number": 11, "usage_type": "call" }, { "api_name": "discord.Intents.default", "line_number": 12, "usage_type": "call" }, { "api_name": "discord.Intents", "line_number": 12, "usage_type": "attribute" }, { "api_name": "disco...
25465846204
from drf_yasg.utils import swagger_auto_schema from rest_framework.generics import ListCreateAPIView from rest_framework.response import Response from rest_framework.views import APIView from rest_framework.parsers import MultiPartParser from service_objects.services import ServiceOutcome from api.constants import * f...
sasha-pipec/mentor_project
api/views/comment/views.py
views.py
py
3,808
python
en
code
1
github-code
36
[ { "api_name": "rest_framework.generics.ListCreateAPIView", "line_number": 16, "usage_type": "name" }, { "api_name": "rest_framework.parsers.MultiPartParser", "line_number": 17, "usage_type": "name" }, { "api_name": "api.utils.CustomTokenAuthentication", "line_number": 18, ...
29029006849
""" Definition of forms. """ from django import forms from django.contrib.auth.forms import AuthenticationForm from django.utils.translation import ugettext_lazy as _ from django.db import models # Лаба 9 from .models import Comment # Лаба 9 from .models import Blog #лаба 10 from .models import Catalog #New class Bo...
InovTe4/DjangoWebProject1
app/forms.py
forms.py
py
3,202
python
ru
code
0
github-code
36
[ { "api_name": "django.contrib.auth.forms.AuthenticationForm", "line_number": 13, "usage_type": "name" }, { "api_name": "django.forms.CharField", "line_number": 15, "usage_type": "call" }, { "api_name": "django.forms", "line_number": 15, "usage_type": "name" }, { "...
40086679560
# -*- coding: utf-8 -*- """ Created on Fri Aug 27 13:25:02 2021 @author: Luca Medeiros """ import glob import yaml import torch import wandb import random import json from argparse import ArgumentParser, Namespace from collections import defaultdict from sklearn.metrics import f1_score from model impo...
luca-medeiros/zeroshot_lightning
test.py
test.py
py
7,875
python
en
code
0
github-code
36
[ { "api_name": "yaml.safe_load", "line_number": 24, "usage_type": "call" }, { "api_name": "argparse.Namespace", "line_number": 25, "usage_type": "call" }, { "api_name": "utils.ImageInstance", "line_number": 31, "usage_type": "call" }, { "api_name": "torch.utils.dat...
41028938045
from Functions import Functions_Configs as configFunc from Functions import Functions_SQL_Interfacing as sqlf from Functions import Functions_FFlogsAPI as fflogs import pandas as pd import csv import time import os import datetime import mysql.connector import _01_Extract_Data as extract import _02_Map_Statics as mapst...
ystol/FFlogs-Analysis
_04_Get_static_performance.py
_04_Get_static_performance.py
py
4,951
python
en
code
0
github-code
36
[ { "api_name": "pandas.options", "line_number": 13, "usage_type": "attribute" }, { "api_name": "Functions.Functions_SQL_Interfacing.get_from_MYSQL_to_df", "line_number": 18, "usage_type": "call" }, { "api_name": "Functions.Functions_SQL_Interfacing", "line_number": 18, "us...
9285859360
from os import path from tkinter import Label, Frame, TOP, BOTTOM, RIGHT, LEFT, N, E, S, W, X, Y, BOTH, Tk, filedialog import math from pathlib import Path import pyautogui import numpy as np from time import sleep from PIL import Image, ImageTk from pyautogui import position import cv2 from src.auto_align import aut...
IronicPickle/dw-piper
src/snap.py
snap.py
py
11,091
python
en
code
0
github-code
36
[ { "api_name": "src.lib.tk_overlay.TkOverlay", "line_number": 23, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number": 29, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 29, "usage_type": "name" }, { "api_name": "os.path.join", ...
12217757601
import zmq import os import time #Send Receve Server process = str(os.getpid()) print ('PID: ' + process) try: ctx = zmq.Context.instance() #socket = ctx.socket(zmq.REP) socket = ctx.socket(zmq.DEALER) socket.bind('tcp://127.0.0.1:4000') print('Server listening on : 127.0.0.1:3000\n...') except ...
mcesarpl/pyZMQ-Monitor-Master-Client
SR_server.py
SR_server.py
py
681
python
en
code
0
github-code
36
[ { "api_name": "os.getpid", "line_number": 7, "usage_type": "call" }, { "api_name": "zmq.Context.instance", "line_number": 11, "usage_type": "call" }, { "api_name": "zmq.Context", "line_number": 11, "usage_type": "attribute" }, { "api_name": "zmq.DEALER", "line...
72193969063
#!/usr/bin/env python # coding: utf-8 # In[7]: import os import csv import json f2 = open('allproducts.csv', 'w') f2.write("prod_id,prod_sku,prod_cat,prod_name\n") f2.close() f2 = open('allproducts.csv', 'a') writer = csv.writer(f2, delimiter=',', lineterminator='\n') for root, dirs, files in os.walk('output'): ...
chennavc/threding
combine.py
combine.py
py
942
python
en
code
0
github-code
36
[ { "api_name": "csv.writer", "line_number": 16, "usage_type": "call" }, { "api_name": "os.walk", "line_number": 18, "usage_type": "call" }, { "api_name": "os.sep", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.sep", "line_number": 22, "u...
37380582441
# File name: floatlayout.py from kivy.lang import Builder from kivy.app import App from kivy.uix.floatlayout import FloatLayout from kivy.uix.togglebutton import ToggleButton from kivy.clock import Clock from kivy.utils import platform class FloatLayoutWidget(FloatLayout): def __init__(self, *args, **kwargs): sup...
Conner-JD/ISAT-280
lab5/mfield/myfield/main.py
main.py
py
1,503
python
en
code
0
github-code
36
[ { "api_name": "kivy.uix.floatlayout.FloatLayout", "line_number": 10, "usage_type": "name" }, { "api_name": "kivy.app.App", "line_number": 19, "usage_type": "name" }, { "api_name": "kivy.utils.platform", "line_number": 23, "usage_type": "call" }, { "api_name": "jni...
73478576745
from pprint import pformat from six import iteritems class PIResponse(object): swagger_types = { 'status': 'int', 'headers': 'dict(str, str)', 'content': 'object', } attribute_map = { 'status': 'Status', 'headers': 'Headers', 'content': 'Content', } def __init__(self, status=None, headers=None, cont...
dcbark01/PI-Web-API-Client-Python
osisoft/pidevclub/piwebapi/models/pi_response.py
pi_response.py
py
1,762
python
en
code
39
github-code
36
[ { "api_name": "six.iteritems", "line_number": 56, "usage_type": "call" }, { "api_name": "pprint.pformat", "line_number": 76, "usage_type": "call" } ]
38115304895
import torch; import torch.nn as nn; import torch.nn.functional as F; import torchvision; import torchvision.transforms as transforms; from torchvision.models.detection.faster_rcnn import FastRCNNPredictor; from torchvision.models.detection.mask_rcnn import MaskRCNNPredictor; from engine import train_one_epoch...
evgen32cd32/torchvisionBGremoval
BGRemovalTest.py
BGRemovalTest.py
py
4,392
python
en
code
0
github-code
36
[ { "api_name": "numpy.Inf", "line_number": 26, "usage_type": "attribute" }, { "api_name": "torch.utils", "line_number": 44, "usage_type": "attribute" }, { "api_name": "pycocotools.coco.COCO", "line_number": 48, "usage_type": "call" }, { "api_name": "PIL.Image.open"...
6791686071
from django.core.exceptions import ObjectDoesNotExist from rest_framework import serializers from exo_mentions.api.serializers import SearchMentionResultsSerializer from circles.models import Circle class SearchMentionSerializer(serializers.Serializer): search = serializers.CharField(required=False, allow_blan...
tomasgarzon/exo-services
service-exo-core/mentions/api/serializers.py
serializers.py
py
1,062
python
en
code
0
github-code
36
[ { "api_name": "rest_framework.serializers.Serializer", "line_number": 9, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 9, "usage_type": "name" }, { "api_name": "rest_framework.serializers.CharField", "line_number": 11, "usage_type...
70188064425
import re import requests url = "https://search.51job.com/list/020000,000000,0000,00,9,99,python,2,{}.html?lang=c&stype=&postchannel=0000&workyear=99&cotype=99&degreefrom=99&jobterm=99&companysize=99&providesalary=99&lonlat=0%2C0&radius=-1&ord_field=0&confirmdate=9&fromType=&dibiaoid=0&address=&line=&specialarea=00&fr...
M0025/PythonSpider
codes/crawlers/51job-demo-2.py
51job-demo-2.py
py
1,620
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 7, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 16, "usage_type": "call" }, { "api_name": "re.S", "line_number": 16, "usage_type": "attribute" }, { "api_name": "re.findall", "line_number": 17, ...
20895643740
from . import create_app from .model import Option, Meal, TIME_FORMAT, list_of import json from datetime import datetime from typing import List from flask import request from flask_restful import ( Api, Resource, fields, marshal_with, marshal_with_field, ) app = create_app() api = Api(app) mea...
genzj/flask-restful-api-course
s03-output-fields/meal_options/meal_options/app.py
app.py
py
1,605
python
en
code
1
github-code
36
[ { "api_name": "flask_restful.Api", "line_number": 19, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 21, "usage_type": "name" }, { "api_name": "model.Meal", "line_number": 21, "usage_type": "name" }, { "api_name": "model.Meal", "line_numbe...
19878151397
import re import functools class InputError(Exception): """Exception to be raised for invalid inputs. """ def __init__(self, char, message="Input is invalid."): """ Parameters ---------- char : str Invalidad character raising this exception. message: st...
gonzaferreiro/python_enigma_machine
errorHandling.py
errorHandling.py
py
3,663
python
en
code
0
github-code
36
[ { "api_name": "re.findall", "line_number": 65, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 88, "usage_type": "call" }, { "api_name": "functools.update_wrapper", "line_number": 101, "usage_type": "call" } ]
19510966399
#from selenium import webdriver #from selenium.webdriver.common.by import By #import time #from selenium.webdriver import ActionChains from pages.home.login_pages import LoginPage from utilities.teststatus import TestStatus import unittest import pytest @pytest.mark.usefixtures("oneTimeSetUp","setUp") class LoginTes...
pprad123/python-selenium-framework
tests/home/login_tests.py
login_tests.py
py
1,344
python
en
code
0
github-code
36
[ { "api_name": "unittest.TestCase", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pages.home.login_pages.LoginPage", "line_number": 16, "usage_type": "call" }, { "api_name": "utilities.teststatus.TestStatus", "line_number": 17, "usage_type": "call" }, ...
38227453623
from collections import defaultdict from datetime import time from typing import Dict, List import pandas as pd from pandas import ExcelFile class ConfigMaker: def make_regions_config(self, excel_file: ExcelFile) -> Dict[str, str]: regions = {} df = pd.read_excel(excel_file, sheet_name="Region--...
tenetko/phone-numbers-beautifier
backend/src/core/config_maker/tzb_config_maker.py
tzb_config_maker.py
py
3,898
python
en
code
0
github-code
36
[ { "api_name": "pandas.ExcelFile", "line_number": 10, "usage_type": "name" }, { "api_name": "pandas.read_excel", "line_number": 13, "usage_type": "call" }, { "api_name": "typing.Dict", "line_number": 10, "usage_type": "name" }, { "api_name": "pandas.ExcelFile", ...
12196143390
import matplotlib.pyplot as plt import numpy as np from matplotlib.animation import FuncAnimation fig = plt.figure() ax = fig.add_subplot() x_data = np.linspace(-10, 10, 100) sinx = np.sin(x_data) cosx = np.cos(x_data) ax.set_xlim(-10, 10) ax.set_ylim(2, -2) line1, = plt.plot(x_data, sinx) line2, = plt.plot(x_data, co...
marksverdhei/advanced_matplotlib_workshop
demos/enkel_animasjon.py
enkel_animasjon.py
py
531
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 5, "usage_type": "name" }, { "api_name": "numpy.linspace", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.sin", ...
39807470849
from grid_world import * from numpy.random import choice import numpy as np import random from matplotlib import pyplot as plt class DiscreteSoftmaxPolicy(object): def __init__(self, num_states, num_actions, temperature): self.num_states = num_states self.num_actions = num_actions self.temp...
nipunbhanot/Reinforcement-Learning---Policy-Gradient
Policy Gradient Control/reinforce_skeleton.py
reinforce_skeleton.py
py
5,841
python
en
code
1
github-code
36
[ { "api_name": "numpy.random.randn", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 16, "usage_type": "attribute" }, { "api_name": "numpy.sqrt", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.random.choice",...
17895586270
r"""CLIP ImageNet zero-shot evaluation. """ # pylint: enable=line-too-long import ml_collections from configs import clip_common # local file import from experimental.multimodal def get_config(): """Config for zero-shot evaluation of CLIP on ImageNet.""" config = ml_collections.ConfigDict() config.model_na...
google/uncertainty-baselines
experimental/multimodal/configs/clip_zeroshot_eval.py
clip_zeroshot_eval.py
py
6,176
python
en
code
1,305
github-code
36
[ { "api_name": "ml_collections.ConfigDict", "line_number": 13, "usage_type": "call" }, { "api_name": "configs.clip_common.IMAGE_RESOLUTION", "line_number": 34, "usage_type": "attribute" }, { "api_name": "configs.clip_common", "line_number": 34, "usage_type": "name" }, ...
19241188993
"""Can we download user information?""" from datetime import date, datetime, timedelta import pytest import requests import mal_scraper class TestDiscovery(object): """Test discovery of usernames.""" DISCOVERY_LINK = 'http://myanimelist.net/users.php' # TODO: Test Cache # TODO: Test fall-back ...
QasimK/mal-scraper
tests/mal_scraper/test_users.py
test_users.py
py
10,125
python
en
code
19
github-code
36
[ { "api_name": "mal_scraper.discover_users", "line_number": 23, "usage_type": "call" }, { "api_name": "mal_scraper.discover_users", "line_number": 35, "usage_type": "call" }, { "api_name": "pytest.raises", "line_number": 41, "usage_type": "call" }, { "api_name": "r...
39266700309
import sys import cv2 import matplotlib.pyplot as plt print(cv2.__version__) path = '../main/big_data/lecture/week9/data/cat.bmp' img = cv2.imread(path) plt.imshow(cv2.cvtColor(img,cv2.COLOR_BGR2RGB)) plt.show() if img is None: print('image load failed') sys.exit() cv2.namedWindow('image') cv2.imshow('image'...
jjh0987/multi_campus
big_data/lecture/week9/cv2_practice0.py
cv2_practice0.py
py
1,666
python
en
code
0
github-code
36
[ { "api_name": "cv2.__version__", "line_number": 5, "usage_type": "attribute" }, { "api_name": "cv2.imread", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.imshow", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pypl...
39247108881
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Feb 26 11:46:50 2023 @author: BD Evaluate and plot the effect of package color on the win rate """ import pandas as pd import numpy as np import matplotlib.pyplot as plt def draw_it(i): ax.errorbar(x[i], MC_mean[i], yerr=uncertainty[i], fmt='o', el...
deshev/Candies
package_color.py
package_color.py
py
2,290
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 45, "usage_type": "call" }, { "api_name": "numpy.std", "line_number"...
37820408361
from django.contrib.gis.geos import Point, Polygon, GEOSGeometry import requests import pytest import json API_URL = "http://127.0.0.1:8000/api/buildings/" @pytest.fixture def building_data(): return { "geom": { "type": "Polygon", "coordinates": [ [ ...
ValarValar/GeoDjangoRestTest
GeoBack/TestTask/tests/test_dist.py
test_dist.py
py
5,384
python
en
code
0
github-code
36
[ { "api_name": "pytest.fixture", "line_number": 8, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 43, "usage_type": "call" }, { "api_name": "django.contrib.gis.geos.Point", "line_number": 50, "usage_type": "call" }, { "api_name": "pytest....
23522566087
# "Eugene Morozov"<Eugene ~at~ HiEugene.com> import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from util import get_color import time def plotX(X, mu, M, N, K, r, ax): for i in range(M): if plotX.px[i]: plotX.px[i].remove() if N == 2: plotX.px[i] = ...
eugegit/examples
k_means.py
k_means.py
py
2,211
python
en
code
1
github-code
36
[ { "api_name": "util.get_color", "line_number": 13, "usage_type": "call" }, { "api_name": "util.get_color", "line_number": 15, "usage_type": "call" }, { "api_name": "util.get_color", "line_number": 19, "usage_type": "call" }, { "api_name": "util.get_color", "li...
10262708742
import rospy import open3d as o3d import sensor_msgs.point_cloud2 as pc2 from sensor_msgs.msg import PointCloud2 import numpy as np class RealSensePointCloud: def __init__(self): # Initialize ROS node rospy.init_node('realsense_pointcloud_visualizer') # Create a subscriber to the RealSense...
yanglh14/DIA
DIA/real_exp/catkin_ws/src/robot_control/scripts/camera.py
camera.py
py
2,507
python
en
code
0
github-code
36
[ { "api_name": "rospy.init_node", "line_number": 10, "usage_type": "call" }, { "api_name": "rospy.Subscriber", "line_number": 14, "usage_type": "call" }, { "api_name": "sensor_msgs.msg.PointCloud2", "line_number": 14, "usage_type": "argument" }, { "api_name": "open...
72198921384
# -*- coding: utf-8 -*- """ Created on Fri Aug 2 11:57:41 2019 Updated 20220904 22:42WER @authors: wrosing, mfitz """ import os import pathlib import sys import socket import glob # This routine here removes all mention of previous configs from the path... # for safety and local computer got clogged with all manne...
LCOGT/ptr-observatory
ptr_config.py
ptr_config.py
py
2,150
python
en
code
0
github-code
36
[ { "api_name": "sys.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "sys.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "sys.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "sys.path", "line_number...
11347574978
from typing import MutableSequence def fsort(a: MutableSequence, max:int)->None: # 원소의값은 0이상 max이하 n = len(a) f = [0]*(max+1) b = [0]*n # 도수 분포표 : 해당 값을 인덱스로 가지는 배열을 만들어서 count하면 해당 값이 몇번? 나왔는지 알수있음 for i in range(n): f[a[i]] += 1 # 1 step # 누적 도수 분포표 : 0 ~ n까지 몇개의 데이터가 있는지 누적된 값을 나...
leekyuyoungcalgo/python_algo
20220819/countingSort2.py
countingSort2.py
py
1,028
python
ko
code
0
github-code
36
[ { "api_name": "typing.MutableSequence", "line_number": 2, "usage_type": "name" }, { "api_name": "typing.MutableSequence", "line_number": 15, "usage_type": "name" }, { "api_name": "random.sample", "line_number": 20, "usage_type": "call" } ]
36789253348
from __future__ import print_function import os.path from googleapiclient.discovery import build from google_auth_oauthlib.flow import InstalledAppFlow from google.auth.transport.requests import Request from google.oauth2.credentials import Credentials import pandas as pd from IPython.display import HTML import loggin...
AdamLenning/sheets-catan
get_stats.py
get_stats.py
py
9,937
python
en
code
0
github-code
36
[ { "api_name": "os.path.path.exists", "line_number": 45, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 45, "usage_type": "attribute" }, { "api_name": "os.path", "line_number": 45, "usage_type": "name" }, { "api_name": "google.oauth2.credentia...
41766780834
import curses ########################################################################## ## Este código 'movimenta' o X no terminal ao pressionar as teclas W,S,A,D ########################################################################## def main(stdscr): # Configurações iniciais do terminal stdscr.clear() ...
mathemaia/studies
Python/Bibliotecas/Curses/main.py
main.py
py
1,378
python
en
code
0
github-code
36
[ { "api_name": "curses.curs_set", "line_number": 11, "usage_type": "call" }, { "api_name": "curses.wrapper", "line_number": 50, "usage_type": "call" } ]
11836108476
from collections import OrderedDict as OD from numpy import exp, log as ln from styles import mark_styles def KWW(t, tau, beta): "Kohlrausch-Williams-Watts compressed (beta>1) exponential function." return 1 - exp(-(t/tau)**beta) KWW.title = 'Non-normalized Kohlrausch-Williams-Watts compressed (beta>1) exponen...
hingels/CoOP-Assembly-Analyzer
Curves/KWW.py
KWW.py
py
2,547
python
en
code
0
github-code
36
[ { "api_name": "numpy.exp", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.log", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 17, "...
6994296870
from lib.cuckoo.common.abstracts import Signature class DiskInformation(Signature): name = "antivm_generic_disk" description = "Queries information on disks, possibly for anti-virtualization" severity = 3 categories = ["anti-vm"] authors = ["nex"] minimum = "2.0" filter_apinames = [ ...
cuckoosandbox/community
modules/signatures/windows/antivm_generic_disk.py
antivm_generic_disk.py
py
1,192
python
en
code
312
github-code
36
[ { "api_name": "lib.cuckoo.common.abstracts.Signature", "line_number": 3, "usage_type": "name" } ]
27932648838
import streamlit as st import pandas as pd import numpy as np import folium import os from folium.plugins import HeatMap from streamlit_folium import st_folium, folium_static # from gbq_functions.big_query_download import * from gbq_functions.params import * import matplotlib.pyplot as plt import matplotlib as mpl from...
willbanny/Location-Analysis-Website
streamlit/pages/3_District_Chloropleth.py
3_District_Chloropleth.py
py
4,362
python
en
code
0
github-code
36
[ { "api_name": "streamlit.set_page_config", "line_number": 17, "usage_type": "call" }, { "api_name": "streamlit.session_state.keys", "line_number": 19, "usage_type": "call" }, { "api_name": "streamlit.session_state", "line_number": 19, "usage_type": "attribute" }, { ...
38707667108
#!/usr/bin/python import numpy as np import copy import time import itertools from sim import * from scenario import * from AStarAlgo import aStar, clearcache def parse_env(env): fires = [] lakes = [] #print(env) for value in env: x, y, z = value x = np.float(x) y = np.float(y...
NithyaMA/Artificial-Intelligence
ai-cs540-team-e-proj-master/Divide_And_Conquer_Functional.py
Divide_And_Conquer_Functional.py
py
8,982
python
en
code
0
github-code
36
[ { "api_name": "numpy.float", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.float", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.float", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": ...
37877829101
import array import fcntl import os import re import subprocess import time from multiprocessing import cpu_count from tempfile import mkstemp from termios import FIONREAD from catkin_tools.common import log from catkin_tools.common import version_tuple from catkin_tools.terminal_color import ColorMapper mapper = Col...
catkin/catkin_tools
catkin_tools/execution/job_server.py
job_server.py
py
12,196
python
en
code
153
github-code
36
[ { "api_name": "catkin_tools.terminal_color.ColorMapper", "line_number": 15, "usage_type": "call" }, { "api_name": "catkin_tools.common.version_tuple", "line_number": 31, "usage_type": "call" }, { "api_name": "psutil.__version__", "line_number": 31, "usage_type": "attribut...
2251121998
""" Random test stuff """ from pysynth.seq import Sequencer from pysynth.utils import * from pysynth.osc import * from pysynth.synth import * from pysynth.filters import * from pysynth.output.base import OutputHandler from pysynth.output.modules import * from pysynth.wrappers import querty, mml from pysynt...
Owen-Cochell/python-audio-synth
pysynth/temp.py
temp.py
py
19,592
python
en
code
1
github-code
36
[ { "api_name": "pyaudio.PyAudio", "line_number": 31, "usage_type": "call" }, { "api_name": "pyaudio.paFloat32", "line_number": 32, "usage_type": "attribute" }, { "api_name": "time.sleep", "line_number": 67, "usage_type": "call" }, { "api_name": "threading.Thread", ...
34440124613
""" 05_Collisions_v2 by Sun Woo Yi This version will be carried on from 05_Collisions_v1_testing_2 This version will show a collision being detected between two objects When the objects collide the game will quit automatically 26/05/2023 """ import pygame # Initialize Pygame pygame.init() # Set the dimensions of the...
yis1234/Car-Game
05_Collisions_v2.py
05_Collisions_v2.py
py
1,753
python
en
code
0
github-code
36
[ { "api_name": "pygame.init", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 18, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 18, "usage_type": "attribute" }, { "api_name": "pygame.sprite...
21119688527
from functools import lru_cache from typing import List class Solution: def minScoreTriangulation(self, values: List[int]) -> int: @lru_cache(None) def dp(i, j): if i + 2 > j: return 0 if i + 2 == j: return values[i] * values[i + 1] * values[...
plattanus/leetcodeDAY
python/1039. 多边形三角剖分的最低得分.py
1039. 多边形三角剖分的最低得分.py
py
647
python
en
code
0
github-code
36
[ { "api_name": "typing.List", "line_number": 6, "usage_type": "name" }, { "api_name": "functools.lru_cache", "line_number": 7, "usage_type": "call" } ]
31835787818
import os from fontTools.designspaceLib import DesignSpaceDocument, AxisDescriptor, SourceDescriptor, InstanceDescriptor, RuleDescriptor root = os.getcwd() doc = DesignSpaceDocument() familyName = "MutatorSansTest" #------ # axes #------ a1 = AxisDescriptor() a1.maximum = 1000 a1.minimum = 0 a1.default = 0 a1.name...
LettError/mutatorSans
makeDesignSpace.py
makeDesignSpace.py
py
2,364
python
en
code
112
github-code
36
[ { "api_name": "os.getcwd", "line_number": 5, "usage_type": "call" }, { "api_name": "fontTools.designspaceLib.DesignSpaceDocument", "line_number": 6, "usage_type": "call" }, { "api_name": "fontTools.designspaceLib.AxisDescriptor", "line_number": 14, "usage_type": "call" ...
41205022751
''' Write a Python Script that captures images from your webcam video stream Extract all faces from the image frame(using haarcascade) Store the face information into numpy arrays 1. Read and show video stream, capture images 2. Detect faces and show bounding box 3. Flatten the largest face image(gray scale image) and...
ankan-das-2001/Machine-learning-and-Deep-learning
Projects/Face Recognition/face_data_collect.py
face_data_collect.py
py
1,813
python
en
code
0
github-code
36
[ { "api_name": "cv2.VideoCapture", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.CascadeClassifier", "line_number": 19, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 29, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRA...
14066016259
# 섬의 개수 # pypy3: 200ms from collections import deque def bfs(start): queue = deque() queue.append(start) mapp[start[0]][start[1]] = 0 while queue: now = queue.popleft() for m in move: new_r, new_c = now[0] + m[0], now[1] + m[1] if new_r in range(h) and new_c in...
yeon-june/BaekJoon
4963.py
4963.py
py
858
python
en
code
0
github-code
36
[ { "api_name": "collections.deque", "line_number": 7, "usage_type": "call" } ]
24486683451
"""Backward compatibility: in the past, APITaxi was deployed on a dedicated server and nginx was configured to redirect / to the console, and /doc to swagger. Now, the infrastructure is deployed on CleverCloud. We need to perform these redirections here, since it is impossible to perform redirections on CleverCloud's ...
openmaraude/APITaxi
APITaxi2/views/redirect.py
redirect.py
py
709
python
en
code
24
github-code
36
[ { "api_name": "flask.Blueprint", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.current_app.config.get", "line_number": 18, "usage_type": "call" }, { "api_name": "flask.current_app.config", "line_number": 18, "usage_type": "attribute" }, { "api_na...
6260370623
import time import requests as rs from bs4 import BeautifulSoup as bs from email.MIMEMultipart import MIMEMultipart from email.MIMEText import MIMEText from email.MIMEImage import MIMEImage import smtplib url = "http://www.gumtree.com.au/s-cats-kittens/launceston/c18435l3000393" domain = "http://www.gumtree.com.au" ...
myme5261314/GumtreeCatNotifier
main.py
main.py
py
4,672
python
en
code
0
github-code
36
[ { "api_name": "email.MIMEMultipart.MIMEMultipart", "line_number": 57, "usage_type": "call" }, { "api_name": "email.MIMEMultipart.MIMEMultipart", "line_number": 65, "usage_type": "call" }, { "api_name": "email.MIMEText.MIMEText", "line_number": 71, "usage_type": "call" }...
5521906377
from scripts.helpful_scripts import get_account, get_contract, OPENSEA_URL from brownie import DappToken, Escrow, SimpleNFT, network, config, ANFT from web3 import Web3 import time import yaml import json import os import shutil sample_token_uri = ( "ipfs://Qmd9MCGtdVz2miNumBHDbvj8bigSgTwnr4SbyH6DNnpWdt?filename=...
dankorea/loanAgainstNFT
scripts/deploy.py
deploy.py
py
11,494
python
en
code
0
github-code
36
[ { "api_name": "web3.Web3.toWei", "line_number": 15, "usage_type": "call" }, { "api_name": "web3.Web3", "line_number": 15, "usage_type": "name" }, { "api_name": "web3.Web3.toWei", "line_number": 16, "usage_type": "call" }, { "api_name": "web3.Web3", "line_numbe...
25691822349
from django.core.mail import EmailMessage from django.contrib.sites.shortcuts import get_current_site from django.utils.encoding import force_bytes, force_text from django.utils.http import urlsafe_base64_encode, urlsafe_base64_decode from django.template.loader import render_to_string from .tokens import user_activat...
michaeljohannesmeier/vidamia
project/app/django-src/api/utils.py
utils.py
py
1,063
python
en
code
0
github-code
36
[ { "api_name": "django.contrib.sites.shortcuts.get_current_site", "line_number": 10, "usage_type": "call" }, { "api_name": "django.template.loader.render_to_string", "line_number": 18, "usage_type": "call" }, { "api_name": "django.utils.http.urlsafe_base64_encode", "line_numbe...
5451484871
from .models import Auction from .serializer import AuctionSerializer from utils.utils import Utils from django.db import connection class AuctionService: def create(self, auction): serializer = AuctionSerializer(data=auction) if serializer.is_valid(): serializer.save() re...
wboniecki/time_is_money
TimeIsMoney/model_auction/auction_service.py
auction_service.py
py
3,526
python
en
code
1
github-code
36
[ { "api_name": "serializer.AuctionSerializer", "line_number": 9, "usage_type": "call" }, { "api_name": "serializer.is_valid", "line_number": 11, "usage_type": "call" }, { "api_name": "serializer.save", "line_number": 12, "usage_type": "call" }, { "api_name": "model...
18665391705
""" Input ----- intensities_experimental.csv intensities_sensitivity_unscaled.csv intensities_singlef_unscaled.csv intensities_multif_unscaled.csv conf[model][reference_amplitude] conf[experimental][reference_amplitude] Output ------ intensities.csv : columns: view, Experimental, Model_SingleFreq_Max, Model_Single...
nbud/arimtoolkit
arimtoolkit/collect_intensities.py
collect_intensities.py
py
2,376
python
en
code
0
github-code
36
[ { "api_name": "logging.basicConfig", "line_number": 24, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 25, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 26, "usage_type": "attribute" }, { "api_name": "arim.io.load_...
6800684121
from django.shortcuts import get_object_or_404 from rest_framework import viewsets from rest_framework.permissions import IsAuthenticated from project.models import Project from ...models import ProjectTeamRole from ..serializers.role import TeamRoleSerializer class TeamRoleViewSet( viewsets.ModelViewSet):...
tomasgarzon/exo-services
service-exo-projects/team/api/views/role.py
role.py
py
968
python
en
code
0
github-code
36
[ { "api_name": "rest_framework.viewsets.ModelViewSet", "line_number": 13, "usage_type": "attribute" }, { "api_name": "rest_framework.viewsets", "line_number": 13, "usage_type": "name" }, { "api_name": "models.ProjectTeamRole", "line_number": 15, "usage_type": "name" }, ...
21536945118
# Desenvolva um programa que leia o nome, idade e sexo de 4 pessoas. No final mostre: # A média de idade do grupo. # Qual o nome do homem mais velho. # Quantas mulheres tem menos de 20 anos. from datetime import date # Variáveis de controle: idadeh = 0 nm_h = '' nm_m = '' sx = '' idadem = ...
FelipePassos09/Curso-em-Video-Python-mod2
Exercícios/Ex#56.py
Ex#56.py
py
1,438
python
pt
code
0
github-code
36
[ { "api_name": "datetime.date.today", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 17, "usage_type": "name" } ]
40500439125
#!/usr/bin/env python3 """ Script to make graph for QMEE collaboration network. Edge width represents number of collaborations, node colour represents institution type. INPUTS: None OUTPUTS: ../Results/QMEENet_python.svg.pdf = network representing QMEE collaboration network """ __appname__ = 'Nets....
SamT123/CMEECoursework
Week7/Code/Nets.py
Nets.py
py
2,092
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 31, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 33, "usage_type": "call" }, { "api_name": "itertools.product", "line_number": 37, "usage_type": "call" }, { "api_name": "matplotlib.patches....
14547426726
from app_ml.functionalities.preprocessing_mongo import read_from_mongo_as_dataframe from app_ml.functionalities.constants import SAVED_MODEL_PATH from app_ml.models.RNN import RNN import pymongo def main(): cars_db = pymongo.MongoClient('mongodb://localhost:27017')['cars'] data, labels = read_from_mongo_as_dat...
serapan/DrEYEve
app_ml/train/train_rnn.py
train_rnn.py
py
620
python
en
code
0
github-code
36
[ { "api_name": "pymongo.MongoClient", "line_number": 7, "usage_type": "call" }, { "api_name": "app_ml.functionalities.preprocessing_mongo.read_from_mongo_as_dataframe", "line_number": 8, "usage_type": "call" }, { "api_name": "app_ml.models.RNN.RNN", "line_number": 9, "usag...
17289255049
#sql requesting in python, import sqlite3 import pandas conn = sqlite3.connect("database.db") cur = conn.cursor() cur.execute("SELECT * FROM countries WHERE area >= 2000000") rows = cur.fetchall() conn.close() for i in rows: print(i) #put in csv df = pandas.DataFrame.from_records(rows) df.columns = ["Rank", "Cou...
michalmendygral/python
python101/advanced_2.py
advanced_2.py
py
926
python
en
code
0
github-code
36
[ { "api_name": "sqlite3.connect", "line_number": 5, "usage_type": "call" }, { "api_name": "pandas.DataFrame.from_records", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pa...
36731154633
# -*- coding: utf-8 -*- from django.conf.urls import url from baremetal_service.bw_views import BmSharedBandwidthsViews, BmSharedBandwidthViews, BmSharedBandwidthFipViews from baremetal_service.views import BaremetalServiceFloatingIPViews urlpatterns = [ # 共享带宽实例管理 # 功能:购买,列表,编辑,详情,删除/批量删除 # resource: ...
21vcloud/Controller
app/baremetal_service/urls_bandwidth.py
urls_bandwidth.py
py
2,081
python
en
code
0
github-code
36
[ { "api_name": "django.conf.urls.url", "line_number": 15, "usage_type": "call" }, { "api_name": "baremetal_service.bw_views.BmSharedBandwidthsViews.as_view", "line_number": 15, "usage_type": "call" }, { "api_name": "baremetal_service.bw_views.BmSharedBandwidthsViews", "line_nu...
42871168335
import _ import config from logging import Logger from sklearn.metrics import * from utils.experiments_utils import * from utils.experiments_utils.results.tables import * from utils.helpers.datasets import Dataset from utils.rulekit.classification import RuleClassifier from steps.train import TrainedModelsResul...
cezary986/complex_conditions
src/experiments/public_datasets/steps/evaluate.py
evaluate.py
py
9,017
python
en
code
0
github-code
36
[ { "api_name": "steps.train.TrainedModelsResults", "line_number": 26, "usage_type": "name" }, { "api_name": "utils.helpers.datasets.Dataset", "line_number": 40, "usage_type": "name" }, { "api_name": "utils.rulekit.classification.RuleClassifier", "line_number": 43, "usage_t...
6510269028
from enum import Enum from selenium_util.locator import Locator from selenium.webdriver.common.by import By from pages.mortgage_rates_page import MortgageRatesPage from pages.zillow_base_page import ZillowBasePage from utilities.mortgage_math import calculate_payment class LoanPrograms(Enum): """ A class to...
jcahill-ht/Hometap-zillow-test
pages/mortage_calculator_page.py
mortage_calculator_page.py
py
16,429
python
en
code
0
github-code
36
[ { "api_name": "enum.Enum", "line_number": 11, "usage_type": "name" }, { "api_name": "pages.zillow_base_page.ZillowBasePage", "line_number": 35, "usage_type": "name" }, { "api_name": "selenium_util.locator.Locator", "line_number": 57, "usage_type": "call" }, { "api...
28054516597
import feedparser import datetime import dateutil.parser from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404, render, redirect from django.urls import reverse from django.views import generic from django_feedparser.settings import * from .models import Story from source.models im...
arpitmandal/newsmonitor
story/views.py
views.py
py
2,429
python
en
code
1
github-code
36
[ { "api_name": "source.models.Sources.objects.get", "line_number": 20, "usage_type": "call" }, { "api_name": "source.models.Sources.objects", "line_number": 20, "usage_type": "attribute" }, { "api_name": "source.models.Sources", "line_number": 20, "usage_type": "name" },...
19618117170
import argparse import logging import pathlib import matplotlib.pyplot as plt # from train import test plt.style.use("ggplot") import gc from pprint import pformat import numpy as np import torch import torch.nn as nn import torch.nn.functional as F # from functorch import grad, make_functional_with_buffers, vmap ...
ABD-01/Coreset
src/grad_match.py
grad_match.py
py
15,845
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.pyplot.style.use", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 9, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 9, "usage_type": "name" }, { "api_name"...
1804307548
''' Loads up each users config and creates the service watchers ''' import yaml def load_config(filename): '''Loads config file, format is in yaml and looks like: services: - name: openvpn input: 10 output: 2 - name: samba input: 10 output: 2 ...
jammers-ach/systemd-gpio
config.py
config.py
py
830
python
en
code
0
github-code
36
[ { "api_name": "yaml.load", "line_number": 21, "usage_type": "call" } ]
24177742490
#!/usr/bin/python3 # -*- coding: utf-8 -*- import os, sys, re, time, datetime, logging, random, string, logging.handlers, gzip, paramiko import multiprocessing, subprocess, requests, urllib3, uuid from threading import Timer from configparser import ConfigParser from Crypto.Cipher import AES from iscpy.iscpy_dns.name...
heweiblog/bind_command
src/drms_toggle.py
drms_toggle.py
py
4,738
python
en
code
0
github-code
36
[ { "api_name": "dns.message.make_query", "line_number": 65, "usage_type": "call" }, { "api_name": "dns.message", "line_number": 65, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 67, "usage_type": "call" }, { "api_name": "datetim...
38697991171
"""Define the Autorization Manager.""" from datetime import datetime, timedelta from typing import Optional import jwt from fastapi import BackgroundTasks, Depends, HTTPException, Request, status from fastapi.security import HTTPAuthorizationCredentials, HTTPBearer from app.config.settings import get_settings from ap...
seapagan/fastapi-template
app/managers/auth.py
auth.py
py
10,228
python
en
code
45
github-code
36
[ { "api_name": "datetime.datetime.utcnow", "line_number": 41, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 41, "usage_type": "name" }, { "api_name": "datetime.timedelta", "line_number": 42, "usage_type": "call" }, { "api_name": "app.con...
73339229863
from pydantic import BaseModel, Field from faststream import FastStream, Logger from faststream.kafka import KafkaBroker class Employee(BaseModel): name: str = Field(..., examples=["Mickey"], description="name example") surname: str = Field(..., examples=["Mouse"], description="surname example") email: s...
airtai/faststream-gen
search/examples/example_new_employee/app.py
app.py
py
973
python
en
code
19
github-code
36
[ { "api_name": "pydantic.BaseModel", "line_number": 7, "usage_type": "name" }, { "api_name": "pydantic.Field", "line_number": 8, "usage_type": "call" }, { "api_name": "pydantic.Field", "line_number": 9, "usage_type": "call" }, { "api_name": "pydantic.Field", "l...
27283985016
from pypaq.lipytools.files import r_json from pypaq.lipytools.plots import two_dim_multi from pypaq.lipytools.moving_average import MovAvg from typing import List, Dict, Optional from envy import RESULTS_FP from run.functions import get_saved_dmks_names def get_ranks( all_results: Optional[Dict]= None, ...
piteren/pypoks
run/after_run/ranks.py
ranks.py
py
2,314
python
en
code
19
github-code
36
[ { "api_name": "typing.Optional", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 11, "usage_type": "name" }, { "api_name": "pypaq.lipytools.files.r_json", "line_number": 16, "usage_type": "call" }, { "api_name": "envy.RESULTS...
3240003586
''' Set Dataset This file was developed as a project for DACO subject from Bioengeneering Masters at FEUP It separates the images from a folder into a respective one according to its class It helps to better analyse and organize the project ''' import os import pandas as pd from torch.utils.data import DataLoader im...
mariamiguel01/Project_DACO
Features/setDataset.py
setDataset.py
py
2,832
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 34, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 35, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 36, "usage_type": "call" }, { "api_name": "torch.utils.data.Data...
10899219070
import unittest import torch import numpy as np import onnx from onnx import helper from onnx.helper import make_tensor_value_info, make_sequence_value_info from functools import reduce from interp.interp_utils import AbstractionInitConfig from interp.interp_operator import Abstraction, Interpreter from tests.test_a...
llylly/RANUM
tests/test_abstraction_loop.py
test_abstraction_loop.py
py
9,508
python
en
code
10
github-code
36
[ { "api_name": "unittest.TestCase", "line_number": 16, "usage_type": "attribute" }, { "api_name": "interp.interp_operator.Abstraction", "line_number": 18, "usage_type": "name" }, { "api_name": "torch.Size", "line_number": 23, "usage_type": "call" }, { "api_name": "...
14940527187
from __future__ import print_function import os, sys, tempfile, shutil, tarfile import log, argdb from urllib.request import urlretrieve from urllib import parse as urlparse_local import subprocess import socket from shutil import which # just to break compatibility with python2 # Fix parsing for nonstandard schemes ...
firedrakeproject/slepc
config/package.py
package.py
py
21,339
python
en
code
2
github-code
36
[ { "api_name": "urllib.parse.uses_netloc.extend", "line_number": 11, "usage_type": "call" }, { "api_name": "urllib.parse.uses_netloc", "line_number": 11, "usage_type": "attribute" }, { "api_name": "urllib.parse", "line_number": 11, "usage_type": "name" }, { "api_na...
33096692946
import torch import torch.nn as nn from torchvision import models from torch.autograd import Variable from models.head import ClassBlock class Resnet50_ft(nn.Module): def __init__(self, class_num=751, droprate=0.5, stride=2, circle=False, ibn=False): super(Resnet50_ft, self).__init__() model_ft =...
SHT-Club4/ReID-PyTorch
models/backbone.py
backbone.py
py
1,513
python
en
code
0
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "torchvision.models.resnet50", "line_number": 12, "usage_type": "call" }, { "api_name": "torchvision.m...
4023568474
import pandas as pd import geopandas from shapely import wkt ''' Reader function that decompresses a csv file containing trajectory data for toy object needed in homework 2 assignment for Spatial Databases. Parameters: path = path to csv compressed file column_names = names of columns for dataframe once creat...
Sedwards8900/gridmapped_interval_tree
Util.py
Util.py
py
1,257
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 19, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 22, "usage_type": "call" }, { "api_name": "shapely.wkt.loads", "line_number": 25, "usage_type": "attribute" }, { "api_name": "shapely.wkt...
30335762959
import agate from agatecharts.charts.base import Chart from agatecharts.colors import Qualitative class Lines(Chart): def __init__(self, x_column_name, y_column_names): self._x_column_name = x_column_name if isinstance(y_column_names, str): y_column_names = [y_column_names] ...
wireservice/agate-charts
agatecharts/charts/lines.py
lines.py
py
2,121
python
en
code
9
github-code
36
[ { "api_name": "agatecharts.charts.base.Chart", "line_number": 7, "usage_type": "name" }, { "api_name": "agate.Number", "line_number": 20, "usage_type": "attribute" }, { "api_name": "agatecharts.colors.Qualitative", "line_number": 35, "usage_type": "call" }, { "api...
74330590505
# -*- coding: utf-8 -*- __author__ = "Amir Arfan, Sebastian Becker" __email__ = "amar@nmbu.no" from biosim.map import Map from biosim.cell import Mountain, Ocean, Savannah, Jungle, Desert from biosim.animals import Herbivore, Carnivore import pytest import textwrap @pytest.fixture def standard_map(): """ Cr...
amirarfan/BioSim_G03_Amir_Sebastian
tests/test_map.py
test_map.py
py
7,808
python
en
code
0
github-code
36
[ { "api_name": "textwrap.dedent", "line_number": 39, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 13, "usage_type": "attribute" }, { "api_name": "biosim.map.Map", "line_number": 64, "usage_type": "call" }, { "api_name": "pytest.fixture", ...
9377241284
import sys import pandas as pd import numpy as np import sklearn import matplotlib import keras import matplotlib.pyplot as plt from pandas.plotting import scatter_matrix import seaborn as sns cleveland = pd.read_csv('input/heart.csv') print('Shape of DataFrame: {}'.format(cleveland.shape)) print (cleveland.loc[1]) c...
MasudCodes/HeartAnalysis
heart.py
heart.py
py
2,941
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.to_numeric", "line_number": 23, "usage_type": "attribute" }, { "api_name": "seaborn.heatmap", "line_number": 27, "usage_type": "call" }, { "api_name": "matplotlib.pyp...
74339900582
import numpy as np import math from gym.envs.mujoco import mujoco_env from gym import utils from mujoco_py import functions as mjcf import mujoco_py #from mujoco_py import mjvisualize as mjcv def mass_center(model, sim): mass = np.expand_dims(model.body_mass, 1) xpos = sim.data.xipos speed_weights = np.arr...
kvogelzang/GP_exoskeleton
gym/envs/mujoco/kevin_fallinghumanoid.py
kevin_fallinghumanoid.py
py
10,527
python
en
code
0
github-code
36
[ { "api_name": "numpy.expand_dims", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 13, "usage_type": "call" }, { "api_name": "math.cos", "line_number":...
31563105051
from datetime import datetime from dateutil import parser from lxml import etree import json import logging from StringIO import StringIO import requests from requests import RequestException from moxie_events.domain import Event logger = logging.getLogger(__name__) class TalksCamEventsImporter(object): FETCH...
ox-it/moxie-events
moxie_events/importers/talks_cam.py
talks_cam.py
py
2,358
python
en
code
0
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 32, "usage_type": "call" }, { "api_name": "requests.RequestException", "line_number": 35, "usage_type": "name" }, { "api_name": "json.loads",...
20199237869
from django.shortcuts import render, redirect from .models import AiClass, AiStudent, StudentPost from django.contrib.auth.models import User from django.contrib import auth # Create your views here. def home(request): context = { 'AiClass': AiClass.objects.all() } return render(request, 'home.ht...
WooseopIM/temp_django
AiSchoolProject/AiInfoApp/views.py
views.py
py
5,147
python
en
code
0
github-code
36
[ { "api_name": "models.AiClass.objects.all", "line_number": 11, "usage_type": "call" }, { "api_name": "models.AiClass.objects", "line_number": 11, "usage_type": "attribute" }, { "api_name": "models.AiClass", "line_number": 11, "usage_type": "name" }, { "api_name": ...
16094884293
#============================================================= """ Plots contribution functions for forward model results that have utilized ONE variable only Uses data from kk.dat Saves plots in a new directory: contribution_plots Usage: Set show below to True or False python -W ignore plot_contribution.py ""...
JHarkett/MIRI-code
plot_contribution.py
plot_contribution.py
py
2,611
python
en
code
2
github-code
36
[ { "api_name": "glob.glob", "line_number": 42, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 46, "usage_type": "call" }, { "api_name": "os.path", "line_number": 46, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number": 4...
9502216060
#!/usr/bin/env python # -*- coding:utf-8 -*- # ====#====#====#==== # Author: wangben # CreatDate: 2020/9/23 16:04 # Filename:read_log.py # Function:历史记录 # ====#====#====#==== import json import sys from PyQt5.QtWidgets import QMainWindow, QApplication from UI.GUI_style import log_MainWindow from common._util import l...
falling3wood/pyexe
common/read_log.py
read_log.py
py
1,867
python
en
code
0
github-code
36
[ { "api_name": "UI.GUI_style.log_MainWindow", "line_number": 16, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 16, "usage_type": "name" }, { "api_name": "UI.GUI_style.log_MainWindow", "line_number": 18, "usage_type": "argument" }, ...
4014355062
# 문제 출처 : https://programmers.co.kr/learn/courses/30/lessons/68645 # 참고 블로그 : https://inspirit941.tistory.com/entry/Python-프로그래머스-삼각-달팽이-Level-2 # chain 사용법 : https://python.flowdas.com/library/itertools.html from itertools import chain def solution(n): maps = [[0 for _ in range(n)] for _ in range(n)] y, x =...
ThreeFive85/Algorithm
Programmers/level2/triangleSnail/triangle_snail.py
triangle_snail.py
py
814
python
ko
code
1
github-code
36
[ { "api_name": "itertools.chain", "line_number": 23, "usage_type": "call" } ]
23771931621
import requests url = 'http://challenge01.root-me.org/web-client/ch19/?section=admin' headers = {"Content-Type":"application/x-www-form-urlencoded", "Cookie":'''"><script>document.location='http://llartngjebaflscnrijk19it2k8dw2.burpcollaborator.net?'.concat(document.cookie)</script>'''} data = {"titre":"...
huydoppa/CTF
root_me/storedxss2.py
storedxss2.py
py
550
python
en
code
0
github-code
36
[ { "api_name": "requests.post", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 18, "usage_type": "call" } ]
74876356585
import tweepy import csv from textblob import TextBlob import operator import copy def checkminimum(test): #test has the intracluster distances for your data point,refer to kmeans function, first for loop min_dist = test[0] c=0 p=0 for i in test: if min_dist>i: min_dist = i p=c #c is the p...
anirudhkamath/sentimentAnalyser
twitter-extract-revised.py
twitter-extract-revised.py
py
3,704
python
en
code
0
github-code
36
[ { "api_name": "copy.deepcopy", "line_number": 61, "usage_type": "call" }, { "api_name": "tweepy.OAuthHandler", "line_number": 71, "usage_type": "call" }, { "api_name": "tweepy.API", "line_number": 74, "usage_type": "call" }, { "api_name": "csv.writer", "line_n...
74430361063
from flask import Flask from flask import render_template, request import subprocess, os, base64 from subprocess import PIPE, Popen app = Flask(__name__) @app.route('/') def Compiler(): check = '' return render_template('home.html', check=check) @app.route('/submit', methods=['GET', 'POST']) def submit(): ...
apollliinaria/moodle_compiler_testik
app.py
app.py
py
2,066
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 17, "usage_type": "attribute" }, { "api_name": "flask.requ...
496284447
import os import pytest from dagster_bash import bash_command_solid, bash_script_solid from dagster import DagsterExecutionStepExecutionError, composite_solid, execute_solid def test_bash_command_solid(): solid = bash_command_solid('echo "this is a test message: $MY_ENV_VAR"', name='foobar') result = execu...
helloworld/continuous-dagster
deploy/dagster_modules/libraries/dagster-bash/dagster_bash_tests/test_solids.py
test_solids.py
py
2,443
python
en
code
2
github-code
36
[ { "api_name": "dagster_bash.bash_command_solid", "line_number": 10, "usage_type": "call" }, { "api_name": "dagster.execute_solid", "line_number": 12, "usage_type": "call" }, { "api_name": "pytest.raises", "line_number": 20, "usage_type": "call" }, { "api_name": "d...
16858298223
from collections import OrderedDict order = OrderedDict() for i in range(int(input())): a = input().split() order[' '.join(a[:-1])] = order.get(' '.join(a[:-1]), 0) + int(a[-1]) for i, j in order.items(): print(i, j) ''' input: 9 BANANA FRIES 12 POTATO CHIPS 30 APPLE JUICE 10 CANDY 5 APPLE JUICE 10 CANDY...
polemeest/daily_practice
hackerrank_ordered_dict.py
hackerrank_ordered_dict.py
py
432
python
en
code
0
github-code
36
[ { "api_name": "collections.OrderedDict", "line_number": 3, "usage_type": "call" } ]
21604577101
import base64 from collections import OrderedDict import datetime from google.cloud._helpers import UTC from google.cloud._helpers import _date_from_iso8601_date from google.cloud._helpers import _datetime_from_microseconds from google.cloud._helpers import _datetime_to_rfc3339 from google.cloud._helpers import _RFC33...
a0x8o/kafka
sdks/python/.tox/lint/lib/python2.7/site-packages/google/cloud/bigquery/_helpers.py
_helpers.py
py
19,540
python
en
code
59
github-code
36
[ { "api_name": "base64.decodestring", "line_number": 45, "usage_type": "call" }, { "api_name": "google.cloud._helpers._to_bytes", "line_number": 45, "usage_type": "call" }, { "api_name": "google.cloud._helpers._datetime_from_microseconds", "line_number": 52, "usage_type": ...
295139608
import sqlite3 conn = sqlite3.connect('coffee_main.db') c = conn.cursor() with conn: c.execute("SELECT * FROM coffee_products") coffees = c.fetchall() c.execute("SELECT * FROM coffee_components") component_quantity = c.fetchall() quantity = [] name = [] for comp_name, comp_quant in component_quant...
arayik-99/Coffee-Machine
src/coffee_database.py
coffee_database.py
py
779
python
en
code
1
github-code
36
[ { "api_name": "sqlite3.connect", "line_number": 3, "usage_type": "call" } ]
31316835712
from django.conf.urls import url from.import views # from django.contrib.auth.decorators import permission_required urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^nova-conta$', views.novaConta, name='novaConta'), url(r'^cadastra-nova-conta$', views.novoUsuario, name='novoUsuario'), url(r...
Sosantos/bancoamaro
bancoamaro/urls.py
urls.py
py
710
python
en
code
0
github-code
36
[ { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "django.co...
31188070789
#!/usr/bin/env python import json import numpy as np from scipy import stats import os import sys from pathlib import Path import pandas as pd #from sklearn.cluster import KMeans from scipy.cluster.vq import vq, kmeans2 # Choosing config file configFilename = "config-sample.json" argCount = len(sys.argv) if(argCoun...
FarnazZE/bnbl-brainlife-clustering-edge-time-series
main.py
main.py
py
1,486
python
en
code
0
github-code
36
[ { "api_name": "sys.argv", "line_number": 17, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path", "line_number...
39553556437
# OFT network module import math import os from typing import Dict, List, Optional, Tuple, Type, Union from diffusers import AutoencoderKL from transformers import CLIPTextModel import numpy as np import torch import re RE_UPDOWN = re.compile(r"(up|down)_blocks_(\d+)_(resnets|upsamplers|downsamplers|attentions)_(\d+...
kohya-ss/sd-scripts
networks/oft.py
oft.py
py
14,491
python
en
code
3,347
github-code
36
[ { "api_name": "re.compile", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 16, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 24, "usage_type": "attribute" }, { "api_name": "torch.Tensor", "line_numbe...
26374121947
import numpy as np import matplotlib.pyplot as plt def MC_Ising_model(beta, vis = False, N = 50, rng = 3000): s = np.random.choice([-1, 1],[N,N]) numbers = np.arange(N*N).reshape(N,N) M_list = [] blacks = ((numbers//N + numbers%N)%2).astype(bool) whites = np.logical_not(blacks) if vis == True: plt.rcP...
czaro2k/Ising-Model
MC_Ising.py
MC_Ising.py
py
1,694
python
en
code
0
github-code
36
[ { "api_name": "numpy.random.choice", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 5, "usage_type": "attribute" }, { "api_name": "numpy.arange", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.logical_not", ...
12323619959
# -*- coding: utf-8 -*- """ Created on Wed Oct 26 09:28:19 2022 @author: bjk_a """ #1.kutuphaneler import numpy as np import matplotlib.pyplot as plt import pandas as pd # veri yukleme veriler = pd.read_csv('maaslar.csv') x = veriler.iloc[:,1:2] y = veriler.iloc[:,2:] X = x.values Y = y.values ...
SamedAkbulut/Machine_Learning
ML_17_Decision_tree.py
ML_17_Decision_tree.py
py
2,633
python
en
code
1
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LinearRegression", "line_number": 24, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.scatter", "line_number": 27, "usage_type": "call" }, { "a...